User has interacted with an input.
<label class="tch" for="tch-1">
<span class="tch__label">
Email address
<span class="tch__flag tch__flag--outline" style="--accent:#E8A020;">touched</span>
</span>
<input class="tch__input tch__input--touched" id="tch-1" type="text" value="steven@" style="--accent:#E8A020;">
</label>
<style>
.tch { display: block; font: 14px system-ui, sans-serif; color: #241430; max-width: 260px; }
.tch__label { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-weight: 500; }
.tch__flag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); font-weight: 700; }
.tch__flag--text::after { content: ""; }
.tch__input { width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; color: #241430; background: #FAF7F2; border: 1.5px solid #24143040; border-radius: 8px; }
.tch__input--touched { border-color: var(--accent); }
.tch__input:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
</style><label class="block max-w-[260px] font-sans text-sm text-[#241430]" for="tch-tw-1">
<span class="flex items-center gap-1.5 mb-1.5 font-medium">
Email address
<span class="tch-tw-flag--outline text-[10px] uppercase tracking-wide font-bold" style="color:#E8A020;">touched</span>
</span>
<input id="tch-tw-1" type="text" value="steven@" class="w-full box-border px-3 py-2.5 bg-[#FAF7F2] border-[1.5px] rounded-lg focus-visible:outline-none" style="border-color:#E8A020;">
</label>export function TouchedState({
label = "Email address",
value = "steven@",
touched = true,
indicator = "outline",
accent = "#E8A020",
}) {
return (
<label style={{ display: "block", maxWidth: 260, fontFamily: "system-ui, sans-serif", fontSize: 14, color: "#241430" }}>
<span style={{ display: "flex", alignItems: "center", gap: 6, marginBottom: 6, fontWeight: 500 }}>
{label}
{touched && (
<span style={{
fontSize: 10, textTransform: "uppercase", letterSpacing: "0.04em", color: accent, fontWeight: 700,
textDecoration: indicator === "text" ? "underline" : "none",
}}>touched</span>
)}
</span>
<input type="text" defaultValue={value} style={{
width: "100%", boxSizing: "border-box", padding: "10px 12px", font: "inherit", color: "#241430",
background: "#FAF7F2", border: `1.5px solid ${touched ? accent : "#24143040"}`, borderRadius: 8,
}} />
</label>
);
}