Skip to content

feat: SW-2591 add size prop to Input, Textarea, Select and Combobox - #212

Open
boramyi-ts wants to merge 7 commits into
mainfrom
SW-2591-input-xs
Open

feat: SW-2591 add size prop to Input, Textarea, Select and Combobox#212
boramyi-ts wants to merge 7 commits into
mainfrom
SW-2591-input-xs

Conversation

@boramyi-ts

@boramyi-ts boramyi-ts commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

SW-2591 — add size prop to Input, Textarea & Select

Jira: SW-2591

Next slice of the input-size harmonization (after #211 toggles). Gives the core form inputs the shared control scale — 24 / 28 / 32 / 36, radius 8 at xs/sm and 10 at default/lg — matching Button.

Changes

  • Input — new CVA size variant (xs | sm | default | lg, default default). Since the CVA prop takes the size name, the native HTML size attribute is available as htmlSize (the native prop is Omit-ted to avoid the type clash).
  • Textarea — same size prop; steps min-height 48 / 56 / 64 / 80 with matching padding/radius/text.
  • Select (trigger) — extended the existing size prop from sm | default to xs | sm | default | lg.
  • InputGroupInput — now types its props off Input, so the size prop flows through the input-group control.

default is kept as the canonical mid size (consistent with Button/Select today), so existing rendering is unchanged — the default variant is exactly the previous classes.

Size ladder (measured height · radius)

xs — 24·r8 sm — 28·r8 default — 32·r10 lg — 36·r10
Input
Select
Textarea (min-h 48/56/64/80)

Tests

New ExtraSmall / Large stories assert the rendered height (input/select 24px & 36px; textarea 48px min-height) + data-size. Full Input/Textarea/Select/InputGroup play suites pass (26/26) incl. axe; typecheck + lint clean. Zephyr ids for the new stories via zephyr_sync.

Note on scope / breaking

Input's size prop is now the size variant, not the native char-width attribute — pass htmlSize for the latter (type-level change only, no runtime behavior change).

Combobox / ComboboxChips (single + multi) are the remaining input slice — they compose InputGroup and the multi-select needs the chip-pill + remove-X scaling — tracked as the next follow-up PR.

🤖 Generated with Claude Code


Update: Combobox family added

Extended the same size prop to the combobox family so the whole input group is harmonized in one PR:

  • InputGroup — new size prop (xs/sm/default/lg) drives container height + radius, and is provided via context so the inner control fills the height.
  • ComboboxInput (single) — forwards size to InputGroup; renders at 24 / 28 / 32 / 36.
  • ComboboxChips (multi) — size sets the container min-height to match Select/Combobox per size, and the chip pill + remove-X scale via group-data (chip 16/20/24/28, concentric radius 4/4/6/6).
Combobox xs sm default lg Multi (xs) — chips scale

New ExtraSmall (single, asserts input-group 24px) and MultiExtraSmall (multi, asserts chip pill 16px) stories; full Combobox + InputGroup suites pass (29/29).

Behavior change to call out: ComboboxChips default min-height goes 48 → 32 so single/multi selects line up with Select at the same size — existing multi-selects get shorter (and still grow as chips wrap). This also aligns the chips radius to rounded-lg, overlapping the intent of #206 (combobox radius) — coordinate so they don't both change it.


Folds in #206 (SW-2583) — closing that PR

This PR now also carries #206's default multi-select chevron: ComboboxChips gains showTrigger (default true) rendering the dropdown chevron at the inline end, so single- and multi-select share the affordance. #206's other change — ComboboxChips radius rounded-md → rounded-lg — is already delivered here by the size default. So #206 is fully superseded and closed; its RadiusConsistency intent is guarded by this PR's size stories, and the chevron by a MultiExtraSmall assertion.

multi with chevron

…lect

Give the core form inputs the shared control scale — 24 / 28 / 32 / 36,
radius 8 at xs/sm and 10 at default/lg, matching Button:
- Input & Textarea: new CVA size variant (Textarea steps min-height 48/56/64/80).
  Input keeps the native size attr available as htmlSize since the CVA prop
  takes the size name.
- Select trigger: extend the size prop from sm|default to xs|sm|default|lg.
- InputGroupInput now types its props off Input so the size prop flows through.

Existing default rendering is unchanged (default variant == prior classes).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@boramyi-ts
boramyi-ts requested review from a team as code owners September 10, 2026 14:42
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ts-lib-ui-kit-storybook Ready Ready Preview Sep 10, 2026 4:42pm UTC

Request Review

@unblocked unblocked Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No issues found

About Unblocked

Unblocked has been set up to automatically review your team's pull requests to identify genuine bugs and issues.

📖 Documentation — Learn more in our docs.

💬 Ask questions — Mention @unblocked to request a review or summary, or ask follow-up questions.

👍 Give feedback — React to comments with 👍 or 👎 to help us improve.

⚙️ Customize — Adjust settings in your preferences.

Extend the shared control scale to the combobox family:
- InputGroup gains a size prop (xs/sm/default/lg) driving container height +
  radius, and provides it via context so the inner control fills the height.
- ComboboxInput forwards size to InputGroup.
- ComboboxChips gains size: container min-height matches Select/Combobox per
  size (24/28/32/36), and the chip pill + remove-X scale via group-data.

The ComboboxChips default min-height goes 48 -> 32 so single/multi selects line
up with Select at the same size (harmonization; existing multi-selects get
shorter and grow as chips wrap).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@boramyi-ts boramyi-ts changed the title feat: SW-2591 add size prop to Input, Textarea and Select feat: SW-2591 add size prop to Input, Textarea, Select and Combobox Sep 10, 2026
Supersedes #206: ComboboxChips gains showTrigger (default true) rendering the
dropdown chevron at the inline end, mirroring ComboboxInput so single- and
multi-select share the affordance. The radius consistency from #206 is already
covered by this PR's size default (rounded-lg).

@owilliams-tetrascience owilliams-tetrascience left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Image

Can you adjust the padding and where the toggle icon lands when there is multiple lines?

Review feedback (#212): with chips wrapping to multiple rows the chevron
floated on the last row. Pin it absolutely to the top-right, sized to the
first row per size, and reserve right padding so chips wrap before it — so the
toggle lands consistently with the input row regardless of chip rows.
@boramyi-ts

Copy link
Copy Markdown
Contributor Author

@owilliams-tetrascience fixed — thanks for catching it. On multiple lines the toggle chevron was a wrapping flow item, so it dropped to the last row. It's now pinned to the top-right and sized to the first row, with right padding reserved so chips wrap before it — the chevron stays aligned with the input row no matter how many rows of chips there are. Single-line and xs are unchanged.

multi-line chips with pinned chevron

Combobox suite still passes 21/21. (bf38291)

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 96.95% (🎯 83%)
⬆️ +0.01%
24790 / 25569
🟢 Statements 96.95% (🎯 83%)
⬆️ +0.01%
24790 / 25569
🟢 Functions 94.61% (🎯 74%)
🟰 ±0%
1177 / 1244
🟢 Branches 90.7% (🎯 81%)
⬇️ -0.06%
4977 / 5487
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/ui/combobox.tsx 100%
🟰 ±0%
83.33%
⬇️ -3.62%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/input-group.tsx 97.05%
⬆️ +0.58%
75%
⬇️ -15.00%
87.5%
🟰 ±0%
97.05%
⬆️ +0.58%
82-86
src/components/ui/input.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/select.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/textarea.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
Generated in workflow #1232 for commit d987b79 by the Vitest Coverage Report Action

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