import { RotateCcw } from "../../icons/SystemIcons"; import { useTrackDesignInput } from "../../contexts/DesignPanelInputContext"; import { VALUE_TIER_LABEL_CLASS, VALUE_TIER_VALUE_CLASS, type PropertyValueTier, } from "./propertyPanelValueTier"; /* ------------------------------------------------------------------ */ /* FlatSelectRow — label/value row backed by a native * unnamed. Falls back to `label` when omitted. */ ariaLabel?: string; value: string; options: Array; tier: PropertyValueTier; disabled?: boolean; onChange: (nextValue: string) => void; onReset?: () => void; }) { const track = useTrackDesignInput(); const trackName = ariaLabel || label; const normalizedOptions = options.map((option) => typeof option === "string" ? { value: option, label: option } : option, ); // A valid authored value outside the preset list (e.g. a `mix-blend-mode` // or `object-position` this row doesn't offer as a preset) must not be // silently misrepresented as the first option — the native { track("select", trackName); onChange(e.target.value); }} className={`appearance-none bg-transparent text-right font-mono text-[11px] outline-none disabled:cursor-not-allowed ${VALUE_TIER_VALUE_CLASS[tier]}`} > {renderedOptions.map((option) => ( ))} {tier === "explicitCustom" && onReset && ( )} ); }