add xsmall size variant to segmented control
This commit is contained in:
parent
cc58e8e1b1
commit
135146d1ee
3 changed files with 13 additions and 2 deletions
|
|
@ -35,7 +35,8 @@
|
||||||
// Apply size-specific classes
|
// Apply size-specific classes
|
||||||
const sizeClasses = {
|
const sizeClasses = {
|
||||||
default: '',
|
default: '',
|
||||||
small: styles.small
|
small: styles.small,
|
||||||
|
xsmall: styles.xsmall
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply element-specific classes
|
// Apply element-specific classes
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
import type { HTMLAttributes } from 'svelte/elements'
|
import type { HTMLAttributes } from 'svelte/elements'
|
||||||
|
|
||||||
export type SegmentedControlVariant = 'default' | 'blended' | 'background'
|
export type SegmentedControlVariant = 'default' | 'blended' | 'background'
|
||||||
export type SegmentedControlSize = 'default' | 'small'
|
export type SegmentedControlSize = 'default' | 'small' | 'xsmall'
|
||||||
|
|
||||||
interface Props extends HTMLAttributes<HTMLDivElement> {
|
interface Props extends HTMLAttributes<HTMLDivElement> {
|
||||||
value?: string
|
value?: string
|
||||||
|
|
|
||||||
|
|
@ -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 variant - fill available space equally
|
||||||
.grow {
|
.grow {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue