fix: keep plugin switches from shrinking next to long labels, like the app's settings switches

This commit is contained in:
Linus Rath
2026-10-26 14:52:04 +01:00
parent ff3e088cbb
commit fb793220b7
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ describe('plugin UI kit components', () => {
// copy must still be there, word for word.
const copies: [string, string][] = [
['components/settings/settings-section.tsx', 'px-3 py-1.5 text-sm rounded-md bg-muted border border-border text-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-colors duration-150'],
['components/settings/settings-section.tsx', 'relative inline-flex h-6 w-11 items-center rounded-full transition-colors duration-150'],
['components/settings/settings-section.tsx', 'relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors duration-150'],
['components/settings/settings-section.tsx', 'inline-block h-4 w-4 transform rounded-full bg-background transition-transform duration-150'],
['components/settings/settings-section.tsx', 'flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between sm:gap-4 py-3 border-b border-border last:border-0'],
['components/settings/settings-section.tsx', 'px-3 py-1.5 text-xs rounded-md transition-colors duration-150'],
+1 -1
View File
@@ -709,7 +709,7 @@ export function Switch({ checked, onChange, disabled = false, label, id }: { che
disabled={disabled}
onClick={() => onChange?.(!checked)}
className={cn(
'bk relative inline-flex h-6 w-11 items-center rounded-full transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
'bk relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
checked ? 'bg-primary' : 'bg-muted',
disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer',
)}