import { cx } from "@/lib/cx" export interface SegOption { value: T label: string } export interface SegControlProps { value: T options: SegOption[] onChange: (value: T) => void className?: string /** Accessible name for the control group. */ "aria-label"?: string } /** * Segmented control — same interaction pattern as the prototype `.segctl`. * Soft track + elevated active pill. Touch targets ≥48px. */ export function SegControl({ value, options, onChange, className, "aria-label": ariaLabel, }: SegControlProps) { return (
{options.map((option) => { const active = option.value === value return ( ) })}
) }