Skip to content

feat: SW-2591 add size prop to Switch and Slider - #214

Open
boramyi-ts wants to merge 3 commits into
mainfrom
SW-2591-switch-slider
Open

feat: SW-2591 add size prop to Switch and Slider#214
boramyi-ts wants to merge 3 commits into
mainfrom
SW-2591-switch-slider

Conversation

@boramyi-ts

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

Copy link
Copy Markdown
Contributor

SW-2591 — add size prop to Switch & Slider

Jira: SW-2591

The pill/track slice of the input-size harmonization (final input group). These need internal track+thumb geometry, so — per the design call — I preserved the current sizes unchanged and added xs + lg around them (no regression to existing switches/sliders).

Switch (track h × w / thumb)

size dims
xs 12 × 20 / thumb 10
sm 14 × 24 / thumb 12 (unchanged)
default 18.4 × 32 / thumb 16 (unchanged)
lg 22 × 40 / thumb 20

The checked translate is thumb-relative (calc(100%-2px)), so the thumb stays flush at every size (track width = 2× thumb).

xs sm default lg

Slider (track / thumb)

default (thumb 12 / track 4) unchanged; sm aliases default; xs track 2 / thumb 10; lg track 6 / thumb 14.

xs default lg

Tests

New ExtraSmall / Large stories assert the rendered geometry (switch track 12px xs / 22px lg; slider thumb 10px xs / 14px lg) + data-size. Switch + Slider suites pass (11/11) incl. axe; typecheck + lint clean. Zephyr ids via zephyr_sync.

This completes the SW-2591 input family. Full harmonization across the ticket: #211 toggles · #212 Input/Textarea/Select/Combobox · #213 Checkbox/Radio · this one Switch/Slider.

🤖 Generated with Claude Code

Preserve the current sizes (switch sm 14x24 + default 18.4x32; slider
default thumb 12 / track 4) unchanged, and add xs + lg around them:
- Switch: xs 12x20 (thumb 10), lg 22x40 (thumb 20); the checked translate is
  thumb-relative so it stays flush at every size.
- Slider: xs track 2 / thumb 10, lg track 6 / thumb 14; sm aliases default.

No visual change to existing switches/sliders (default untouched).

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 15:23
@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:50pm 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.

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 96.94% (🎯 83%)
🟰 ±0%
24714 / 25493
🟢 Statements 96.94% (🎯 83%)
🟰 ±0%
24714 / 25493
🟢 Functions 94.61% (🎯 74%)
🟰 ±0%
1177 / 1244
🟢 Branches 90.76% (🎯 81%)
🟰 ±0%
4971 / 5477
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/ui/slider.tsx 96.29%
⬆️ +0.22%
54.54%
🟰 ±0%
100%
🟰 ±0%
96.29%
⬆️ +0.22%
21, 24
src/components/ui/switch.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
Generated in workflow #1234 for commit b8a07e3 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