Switch to BiomeJS (#306)

This commit is contained in:
Gregory Schier
2025-11-23 08:38:13 -08:00
committed by GitHub
parent 2bac610efe
commit ec3e2e16a9
332 changed files with 3007 additions and 4097 deletions

View File

@@ -37,18 +37,18 @@ export function SegmentedControl<T extends string>({
const selectedIndex = options.findIndex((o) => o.value === selectedValue);
if (e.key === 'ArrowRight') {
const newIndex = Math.abs((selectedIndex + 1) % options.length);
setSelectedValue(options[newIndex]!.value);
options[newIndex] && setSelectedValue(options[newIndex].value);
const child = containerRef.current?.children[newIndex] as HTMLButtonElement;
child.focus();
} else if (e.key === 'ArrowLeft') {
const newIndex = Math.abs((selectedIndex - 1) % options.length);
setSelectedValue(options[newIndex]!.value);
options[newIndex] && setSelectedValue(options[newIndex].value);
const child = containerRef.current?.children[newIndex] as HTMLButtonElement;
child.focus();
}
}}
>
{options.map((o, i) => {
{options.map((o) => {
const isSelected = selectedValue === o.value;
const isActive = value === o.value;
return (
@@ -63,7 +63,7 @@ export function SegmentedControl<T extends string>({
'!px-1.5 !w-auto',
'focus:ring-border-focus',
)}
key={i}
key={o.label}
title={o.label}
icon={o.icon}
onClick={() => onChange(o.value)}