add xsmall size variant to segmented control

This commit is contained in:
Justin Edmund 2025-12-20 01:03:41 -08:00
parent cc58e8e1b1
commit 135146d1ee
3 changed files with 13 additions and 2 deletions

View file

@ -35,7 +35,8 @@
// Apply size-specific classes
const sizeClasses = {
default: '',
small: styles.small
small: styles.small,
xsmall: styles.xsmall
}
// Apply element-specific classes

View file

@ -9,7 +9,7 @@
import type { HTMLAttributes } from 'svelte/elements'
export type SegmentedControlVariant = 'default' | 'blended' | 'background'
export type SegmentedControlSize = 'default' | 'small'
export type SegmentedControlSize = 'default' | 'small' | 'xsmall'
interface Props extends HTMLAttributes<HTMLDivElement> {
value?: string

View file

@ -39,6 +39,16 @@
}
}
// Extra small size variant
.xsmall {
font-size: typography.$font-small;
min-width: 60px;
.label {
padding: spacing.$unit-half spacing.$unit;
}
}
// Grow variant - fill available space equally
.grow {
flex: 1;