Align branch with main: switch to vite-plus and reformat

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Gregory Schier
2026-03-13 13:20:06 -07:00
parent d0f1708017
commit 903f57a415
7 changed files with 1665 additions and 312 deletions

View File

@@ -62,13 +62,17 @@ export function SegmentedControl<T extends string>({
if (e.key === "ArrowRight") {
e.preventDefault();
const newIndex = Math.abs((selectedIndex + 1) % options.length);
if (options[newIndex]) { setSelectedValue(options[newIndex].value); }
if (options[newIndex]) {
setSelectedValue(options[newIndex].value);
}
const child = containerRef.current?.children[newIndex] as HTMLButtonElement;
child.focus();
} else if (e.key === "ArrowLeft") {
e.preventDefault();
const newIndex = Math.abs((selectedIndex - 1) % options.length);
if (options[newIndex]) { setSelectedValue(options[newIndex].value); }
if (options[newIndex]) {
setSelectedValue(options[newIndex].value);
}
const child = containerRef.current?.children[newIndex] as HTMLButtonElement;
child.focus();
}