feat: Add size to various components, deprecating compact - #809
feat: Add size to various components, deprecating compact#809cb-ekuersch wants to merge 21 commits into
Conversation
🟡 Heimdall Review Status
🟡
|
| Code Owner | Status | Calculation | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ui-systems-eng-team |
🟡
0/1
|
Denominator calculation
|
Add cross-platform `size` (xs/s/m/l, default l) via a local size-config map; deprecate `compact` in favor of `size` (size wins; compact-only maps to s). Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Add xs/s/m/l size prop (web + mobile), deprecate compact, preserving today's geometry. Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Add size prop (s/m/l, default l) deprecating compact via a per-size config map. Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Add a size prop (xs | s, default s) to the shared Chip base and deprecate compact, mapping it to size="xs" across web, mobile, and the common media-chip spacing helper. Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Forward size (xs|s, default s) through to the base Chip and deprecate compact in favor of size="xs". Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Thread a size prop (xs | s, default s) through to tab chips and deprecate compact. Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Add size ('s'|'m'|'l', default 'l') driving vertical density on web and mobile TextInput; deprecate compact in favor of size="s".
Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Thread size through to TextInput, deprecate compact (maps to size s), and drop the fixed-height lever. Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Add a minimal size (s|m|l) prop to alpha Select on web and mobile, deprecating compact, driving only the field vertical padding on the existing inputStackStyles. Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Thread a size ('s'|'m'|'l', default 'l') prop through DateInput and DatePicker to TextInput and deprecate compact in favor of size="s".
Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Add SizeComposition stories (web + mobile) demonstrating the t-shirt `size` prop across inputs, chips, and buttons together (brought back from the original rollout branch). Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Refinements on top of the t-shirt size rollout for the input family: - Select: multi-select value chips now use the compact xs size at every size, with per-size vertical padding tuned so single- and multi-select heights match (42/50/58). - Inside labels are decoupled from size: horizontal in the start slot at s/m, and vertically stacked only at l (single and multi), all landing on the same field height an outside label produces. - Mobile: floor the native input to `padding + line-height token` via minHeight so fields reach their intended height instead of the font's shorter natural metric, and vertically center single-line text in the extra space (multiline excluded). Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Align mobile SelectChip control-prop spread order with web (chip-level props win; drop the unnecessary compact strip) - Rename Select label-placement flags to mirror TextInput semantics (insideVerticalLabel / insideHorizontalLabel / wantsInsideLabel / isCompactLabel) and multiSelectValueChipSize, web + mobile - Limit per-size padding-value unit tests to TextInput and Select (alpha); drop them from SearchInput, Chip, MediaChip, and SelectChip (both packages) - Group simple per-size stories into a single "Sizes" example for TextInput, SearchInput, Button, and SlideButton (web + mobile) Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
…mpact Combobox composes Select, so it already inherits `size` and the deprecated `compact` via SelectBaseProps and threads them through to the underlying select control on both platforms. Lock this in and demonstrate it: - Add a grouped "Sizes" story (s/m/l + deprecated compact) to the web and mobile Combobox stories - Add a wiring test verifying `size` and `compact` reach the select control (web + mobile) — no padding-value assertions Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
… audited usage of deprecated compact internally
|
|
||
| export type SlideButtonHandleCheckedProps = Pick<SlideButtonBaseProps, 'variant' | 'compact'> & { | ||
| export type SlideButtonHandleCheckedProps = Pick<SlideButtonBaseProps, 'variant'> & { | ||
| size: SlideButtonSize; |
There was a problem hiding this comment.
is it safe to make this prop required?
There was a problem hiding this comment.
probably not since someone may be using a custom slide handle component - if this is the case, we should make it optional for now and just render the default size if undefeind
| xs: { padding: 1, iconSize: 's', borderRadius: 1000, feedback: 'light' }, | ||
| s: { padding: 1.5, iconSize: 's', borderRadius: 1000, feedback: 'light' }, | ||
| m: { padding: 1.5, iconSize: 'm', borderRadius: 1000, feedback: 'normal' }, | ||
| l: { padding: 2, iconSize: 'm', borderRadius: 1000, feedback: 'normal' }, |
There was a problem hiding this comment.
nit: should we keep borderRadius out since it is 1000 all the way
There was a problem hiding this comment.
yes, remove borderRadius and apply prop directly in render for all conditions
| import { isSelectOptionGroup } from './Select'; | ||
| import { defaultSelectSize } from './types'; | ||
|
|
||
| const selectSizeVerticalSpace: Record<SelectSize, 1 | 1.5 | 2> = { s: 1, m: 1.5, l: 2 }; |
There was a problem hiding this comment.
use theme var space type
| font={labelFont} | ||
| // A horizontal inline label shares its row with the value, so keep it to a single line — | ||
| // otherwise a long label wraps and stretches the field past its size. | ||
| numberOfLines={insideHorizontalLabel ? 1 : undefined} |
There was a problem hiding this comment.
do we want to limit to one line for vetically stacked inside label - it looks like tihs node is used for that case as well
There was a problem hiding this comment.
for consistency it may be nice to just force a single line label for any inside label regardless if its stacked vertically or horizontally
| paddingTop: compact || labelVariant === 'inside' ? theme.space[1] : theme.space[2], | ||
| paddingBottom: compact || labelVariant === 'inside' ? theme.space[1] : theme.space[2], | ||
| const inputStackStyles: StyleProp<ViewStyle> = useMemo(() => { | ||
| let verticalSpace: 0.25 | 0.5 | 0.75 | 1 | 1.5 | 2; |
There was a problem hiding this comment.
use theme var space stype
|
|
||
| export type SlideButtonHandleCheckedProps = Pick<SlideButtonBaseProps, 'variant' | 'compact'> & { | ||
| export type SlideButtonHandleCheckedProps = Pick<SlideButtonBaseProps, 'variant'> & { | ||
| size: SlideButtonSize; |
There was a problem hiding this comment.
probably not since someone may be using a custom slide handle component - if this is the case, we should make it optional for now and just render the default size if undefeind
| xs: { padding: 1, iconSize: 's', borderRadius: 1000, feedback: 'light' }, | ||
| s: { padding: 1.5, iconSize: 's', borderRadius: 1000, feedback: 'light' }, | ||
| m: { padding: 1.5, iconSize: 'm', borderRadius: 1000, feedback: 'normal' }, | ||
| l: { padding: 2, iconSize: 'm', borderRadius: 1000, feedback: 'normal' }, |
There was a problem hiding this comment.
yes, remove borderRadius and apply prop directly in render for all conditions
…se chip xs/compact height and resolve some overlapping type conflicts
What changed? Why?
Summary
Rolls out the cross-platform t-shirt
sizeprop across CDS components, deprecating the legacycompactboolean in favor of the new sizing API. Each component's per-size styles are derived from its Figma component set and applied consistently across web and mobile. Backward compatibility is preserved throughout:compactkeeps working exactly as before (sizewins when both are set), no fixed heights are introduced (except Slide Button, which is inherently fixed-height by design sign-off), and no public exports are renamed or dropped.compactis deprecated with@deprecationExpectedRemoval v10.Linear Issues
Next steps
Intentionally deferred from this PR to keep scope focused on the size API + component/stories work:
apps/docs): Update component examples to document the newsizeprop and remove/replace deprecatedcompactexamples for each rolled-out component.__figma__templates): Refresh Code Connect mappings to include the newsizevariant property for each rolled-out component.UI changes
Testing
How has it been tested?
Testing instructions
Illustrations/Icons Checklist
Required if this PR changes files under
packages/illustrations/**orpackages/icons/**Change management
type=routine
risk=low
impact=sev5
automerge=false