Skip to content

Commit 03529fa

Browse files
committed
fix(emcn): fill compact switch segments to the border
1 parent e100bb9 commit 03529fa

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

packages/emcn/src/components/icon-switch/icon-switch.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function IconSwitch<T extends string>({
4343
role='radiogroup'
4444
aria-label={ariaLabel}
4545
className={cn(
46-
'inline-flex w-fit shrink-0 items-center gap-0.5 rounded-sm border border-[var(--border)] bg-[var(--surface-3)] p-[1px]',
46+
'inline-flex w-fit shrink-0 items-center rounded-sm border border-[var(--border)] bg-[var(--surface-3)]',
4747
disabled && 'opacity-50',
4848
className
4949
)}
@@ -62,15 +62,18 @@ export function IconSwitch<T extends string>({
6262
onChange={() => onValueChange(option.value)}
6363
disabled={disabled}
6464
aria-label={option.label}
65-
className='peer m-0 size-[16px] cursor-pointer appearance-none rounded-[calc(theme(borderRadius.sm)-1px-var(--border-width,1px))] bg-transparent transition-colors checked:bg-[var(--surface-active)] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--text-icon)] disabled:cursor-not-allowed'
65+
className='peer m-0 size-[18px] cursor-pointer appearance-none rounded-[inherit] bg-transparent transition-colors checked:bg-[var(--surface-active)] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--text-icon)] disabled:cursor-not-allowed'
6666
/>
6767
)
6868

6969
return (
7070
<label
7171
key={option.value}
7272
htmlFor={optionId}
73-
className={cn('relative flex', disabled ? 'cursor-not-allowed' : 'cursor-pointer')}
73+
className={cn(
74+
'relative flex first:rounded-l-[calc(theme(borderRadius.sm)-var(--border-width,1px))] last:rounded-r-[calc(theme(borderRadius.sm)-var(--border-width,1px))]',
75+
disabled ? 'cursor-not-allowed' : 'cursor-pointer'
76+
)}
7477
>
7578
{showTooltips ? (
7679
<Tooltip.Root>

0 commit comments

Comments
 (0)