{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"black-border-form","type":"registry:component","title":"Black Border Form","description":"Neo-brutalist form fields in 3px ink: focus presses a field into its shadow, and errors are stamped on as tilted black tags. The browser's own validation, a posting form and a received stamp.","dependencies":[],"registryDependencies":[],"files":[{"path":"components/viberdy/black-border-form.tsx","content":"\"use client\";\n\nimport { useEffect, useId, useRef, useState } from \"react\";\nimport type { ChangeEvent, CSSProperties, FocusEvent, FormEvent, ReactNode } from \"react\";\n\n/**\n * BlackBorderForm — neo-brutalist form fields that press in when you use\n * them and stamp their errors on.\n *\n * - BlackBorderField: a label, a 3px-bordered control on a hard 5px shadow,\n *   and an optional hint. Focus presses the control into its shadow (it\n *   moves 5px onto it and fills with the accent), 100ms linear. It validates\n *   itself with the browser's own constraint validation (required, type,\n *   minLength, pattern...): an error is stamped over the control's top-right\n *   corner as a tilted black tag, with no transition at all. Errors appear\n *   when a filled field loses focus or when the form is submitted, and clear\n *   the moment the value becomes valid.\n * - BlackBorderCheck: a 28px square checkbox on a 3px shadow, same rules.\n * - BlackBorderForm: a form that uses those fields as they are. On submit it\n *   lets the browser validate, suppresses the browser's own bubbles, focuses\n *   the first stamped field, and only calls onSubmit(formData) when every\n *   field is valid. While onSubmit runs the button shows it is busy; when it\n *   resolves, a \"received\" stamp lands on the form and takes focus; if it\n *   throws, a stamped retry line appears by the button.\n *\n * The form posts (method=\"post\"), so without JavaScript nothing typed ends\n * up in the address bar. Type reads var(--font-display), var(--font-sans)\n * and var(--font-mono), so a buyer's next/font variables drop in.\n *\n * Needs Tailwind v4 (or v3.4+). No dependencies beyond React.\n */\n\nconst DISPLAY = 'var(--font-display, \"Archivo\", \"Archivo Black\", \"Arial Black\", \"Helvetica Neue\", Arial, sans-serif)';\nconst SANS = 'var(--font-sans, \"Geist\", \"Inter\", \"Helvetica Neue\", Arial, sans-serif)';\nconst MONO = 'var(--font-mono, \"Geist Mono\", ui-monospace, \"SFMono-Regular\", Menlo, Consolas, monospace)';\nconst HEX = /^#[0-9a-fA-F]{6}$/;\n\nconst FILLS = {\n  yellow: \"#ffd23f\",\n  coral: \"#ff6b6b\",\n  blue: \"#74b9ff\",\n  lime: \"#b4f462\",\n  pink: \"#ff5fa2\",\n} as const;\n\nfunction own<T extends object>(map: T, key: string): key is Extract<keyof T, string> {\n  return Object.prototype.hasOwnProperty.call(map, key);\n}\n\n/** A form action is a URL the browser navigates to: allow https and same-site paths only. */\nfunction safeAction(raw?: string) {\n  if (!raw) return undefined;\n  const v = raw.replace(/[\\t\\n\\r]/g, \"\").trim();\n  if (!v || v.includes(\"\\\\\")) return undefined;\n  if (/^https:/i.test(v)) return v;\n  if (/^[/?]/.test(v) && !/^\\/\\//.test(v)) return v;\n  return undefined;\n}\n\nfunction fillOf(v: string, fallback: string) {\n  return own(FILLS, v) ? FILLS[v] : HEX.test(v) ? v : fallback;\n}\n\nexport type BlackBorderMessages = Partial<Record<\"valueMissing\" | \"typeMismatch\" | \"tooShort\" | \"tooLong\" | \"patternMismatch\", string>>;\n\ntype Control = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;\n\n/** The stamp's text for a control's current validity, or \"\" when it is valid. */\nfunction stampFor(el: Control, kind: string, messages: BlackBorderMessages) {\n  const v = el.validity;\n  if (v.valid) return \"\";\n  if (v.valueMissing) return messages.valueMissing ?? (el instanceof HTMLSelectElement ? \"Pick one\" : \"Required\");\n  if (v.typeMismatch) return messages.typeMismatch ?? (kind === \"email\" ? \"Needs an @ and a domain\" : kind === \"url\" ? \"Needs https://\" : \"Wrong format\");\n  if (v.tooShort) return messages.tooShort ?? \"Too short\";\n  if (v.tooLong) return messages.tooLong ?? \"Too long\";\n  if (v.patternMismatch) return messages.patternMismatch ?? \"Wrong format\";\n  return el.validationMessage || \"Check this\";\n}\n\n/**\n * The tilted black tag an error is stamped with. No transition, on purpose.\n * The text is rendered as text: never render a server message as HTML here.\n */\nfunction Stamp({ id, text, ink, ground }: { id: string; text: string; ink: string; ground: string }) {\n  return (\n    <span id={id} aria-live=\"polite\" className=\"pointer-events-none absolute -top-3.5 right-3 z-10\">\n      {text && (\n        <span\n          className=\"inline-flex h-7 -rotate-[2deg] items-center px-2 text-[11.5px] uppercase tracking-[0.06em]\"\n          style={{ background: ink, color: ground, fontFamily: MONO, fontWeight: 700 }}\n        >\n          {text}\n        </span>\n      )}\n    </span>\n  );\n}\n\ntype Shared = {\n  /** The focus fill: a kit fill or #rrggbb. */\n  accent?: keyof typeof FILLS | string;\n  /** Border, shadow, label and stamp colour, #rrggbb. */\n  ink?: string;\n  messages?: BlackBorderMessages;\n  className?: string;\n};\n\nexport type BlackBorderFieldProps = Shared & {\n  label: string;\n  name: string;\n  kind?: \"text\" | \"email\" | \"tel\" | \"url\" | \"textarea\" | \"select\";\n  /** For kind \"select\": the options; the first is shown until one is picked. */\n  options?: (string | { value: string; label: string })[];\n  /** For kind \"select\": the empty first option's text. */\n  prompt?: string;\n  hint?: string;\n  required?: boolean;\n  placeholder?: string;\n  autoComplete?: string;\n  minLength?: number;\n  maxLength?: number;\n  pattern?: string;\n  defaultValue?: string;\n  rows?: number;\n  disabled?: boolean;\n  /** An error from your server (e.g. \"Already registered\"), stamped until the value changes. */\n  error?: string;\n};\n\nexport function BlackBorderField({\n  label,\n  name,\n  kind = \"text\",\n  options = [],\n  prompt = \"Choose…\",\n  hint,\n  required = false,\n  placeholder,\n  autoComplete,\n  minLength,\n  maxLength,\n  pattern,\n  defaultValue,\n  rows = 4,\n  disabled = false,\n  error = \"\",\n  accent = \"yellow\",\n  ink = \"#000000\",\n  messages = {},\n  className = \"\",\n}: BlackBorderFieldProps) {\n  const id = useId();\n  const [stamp, setStamp] = useState(\"\");\n  const [edited, setEdited] = useState(false);\n  // A new server error is shown again even if the field was edited before (render-time reset).\n  const [seenError, setSeenError] = useState(error);\n  if (seenError !== error) {\n    setSeenError(error);\n    setEdited(false);\n  }\n  const shown = stamp || (edited ? \"\" : error);\n  const line = HEX.test(ink) ? ink : \"#000000\";\n  const fill = fillOf(accent, FILLS.yellow);\n  const hintId = id + \"-hint\";\n  const stampId = id + \"-stamp\";\n  const describedBy = (hint ? hintId + \" \" : \"\") + stampId;\n\n  const check = (el: Control) => setStamp(stampFor(el, kind, messages));\n  const onInvalid = (e: FormEvent<Control>) => {\n    // Our stamp replaces the browser's bubble.\n    e.preventDefault();\n    check(e.currentTarget);\n  };\n  const onBlur = (e: FocusEvent<Control>) => {\n    if (e.currentTarget.value !== \"\") check(e.currentTarget);\n  };\n  const onChange = (e: ChangeEvent<Control>) => {\n    setEdited(true);\n    if (stamp) check(e.currentTarget);\n  };\n\n  const common = {\n    id,\n    name,\n    required,\n    disabled,\n    \"aria-invalid\": shown ? true : undefined,\n    \"aria-describedby\": describedBy,\n    onInvalid,\n    onBlur,\n    onChange,\n    className:\n      \"block w-full bg-transparent text-[16px] leading-[1.35] outline-none focus-visible:![outline:none] placeholder:opacity-45 disabled:cursor-not-allowed \" +\n      (kind === \"textarea\" ? \"resize-y px-4 py-3\" : \"h-[50px] px-4\"),\n    style: { fontFamily: SANS, color: line } as CSSProperties,\n  };\n\n  let control: ReactNode;\n  if (kind === \"textarea\") {\n    control = <textarea {...common} rows={rows} placeholder={placeholder} minLength={minLength} maxLength={maxLength} defaultValue={defaultValue} />;\n  } else if (kind === \"select\") {\n    control = (\n      <>\n        <select {...common} defaultValue={defaultValue ?? \"\"} className={common.className + \" cursor-pointer appearance-none pr-12\"}>\n          <option value=\"\" disabled>\n            {prompt}\n          </option>\n          {options.map((o) => {\n            const opt = typeof o === \"string\" ? { value: o, label: o } : o;\n            return (\n              <option key={opt.value} value={opt.value}>\n                {opt.label}\n              </option>\n            );\n          })}\n        </select>\n        <svg aria-hidden width=\"16\" height=\"10\" viewBox=\"0 0 16 10\" fill=\"none\" className=\"pointer-events-none absolute right-4 top-1/2 -translate-y-1/2\">\n          <path d=\"M1.5 1.5L8 8L14.5 1.5\" stroke={line} strokeWidth=\"3\" strokeLinecap=\"square\" />\n        </svg>\n      </>\n    );\n  } else {\n    control = (\n      <input\n        {...common}\n        type={kind}\n        placeholder={placeholder}\n        autoComplete={autoComplete}\n        minLength={minLength}\n        // An email is at most 254 characters; capping it keeps the pattern check cheap.\n        maxLength={kind === \"email\" ? Math.min(maxLength ?? 254, 254) : maxLength}\n        pattern={pattern}\n        defaultValue={defaultValue}\n        inputMode={kind === \"email\" ? \"email\" : kind === \"tel\" ? \"tel\" : kind === \"url\" ? \"url\" : undefined}\n      />\n    );\n  }\n\n  return (\n    <div className={\"flex flex-col gap-2 \" + className} style={{ \"--bbf-ink\": line, \"--bbf-fill\": fill } as CSSProperties}>\n      <label htmlFor={id} className=\"text-[15px] leading-none tracking-[-0.005em]\" style={{ fontFamily: DISPLAY, fontWeight: 800, color: line }}>\n        {label}\n        {required && (\n          <span aria-hidden className=\"ml-1\">\n            *\n          </span>\n        )}\n      </label>\n      <div\n        className={\n          \"relative bg-white shadow-[5px_5px_0_0_var(--bbf-ink)] transition-[transform,translate,box-shadow] duration-100 ease-linear motion-reduce:transition-none \" +\n          \"focus-within:translate-x-[5px] focus-within:translate-y-[5px] focus-within:bg-[var(--bbf-fill)] focus-within:shadow-none \" +\n          (disabled ? \"opacity-60\" : \"\")\n        }\n        style={{ border: \"3px solid \" + line }}\n      >\n        {control}\n        <Stamp id={stampId} text={shown} ink={line} ground=\"#ffffff\" />\n      </div>\n      {hint && (\n        <p id={hintId} className=\"text-[12px] uppercase tracking-[0.06em]\" style={{ fontFamily: MONO, color: line, opacity: 0.7 }}>\n          {hint}\n        </p>\n      )}\n    </div>\n  );\n}\n\nexport type BlackBorderCheckProps = Shared & {\n  label: ReactNode;\n  name: string;\n  value?: string;\n  required?: boolean;\n  defaultChecked?: boolean;\n  disabled?: boolean;\n};\n\nexport function BlackBorderCheck({\n  label,\n  name,\n  value = \"yes\",\n  required = false,\n  defaultChecked,\n  disabled = false,\n  accent = \"yellow\",\n  ink = \"#000000\",\n  messages = {},\n  className = \"\",\n}: BlackBorderCheckProps) {\n  const id = useId();\n  const [stamp, setStamp] = useState(\"\");\n  const line = HEX.test(ink) ? ink : \"#000000\";\n  const fill = fillOf(accent, FILLS.yellow);\n  return (\n    <div className={\"relative flex items-start gap-3.5 \" + className} style={{ \"--bbf-ink\": line, \"--bbf-fill\": fill } as CSSProperties}>\n      <span className=\"relative mt-0.5 grid size-7 shrink-0 place-items-center\">\n        <input\n          id={id}\n          type=\"checkbox\"\n          name={name}\n          value={value}\n          required={required}\n          disabled={disabled}\n          defaultChecked={defaultChecked}\n          aria-invalid={stamp ? true : undefined}\n          aria-describedby={id + \"-stamp\"}\n          onInvalid={(e) => {\n            e.preventDefault();\n            setStamp(messages.valueMissing ?? \"Tick this to continue\");\n          }}\n          onChange={(e) => {\n            if (stamp && e.currentTarget.checked) setStamp(\"\");\n          }}\n          className={\n            \"peer size-7 cursor-pointer appearance-none bg-white shadow-[3px_3px_0_0_var(--bbf-ink)] outline-none focus-visible:![outline:3px_dashed_var(--bbf-ink)] focus-visible:![outline-offset:3px] focus-visible:![border-radius:0] transition-[transform,translate,box-shadow] duration-100 ease-linear motion-reduce:transition-none \" +\n            \"checked:bg-[var(--bbf-fill)] focus-visible:translate-x-[3px] focus-visible:translate-y-[3px] focus-visible:shadow-none disabled:cursor-not-allowed\"\n          }\n          style={{ border: \"3px solid \" + line }}\n        />\n        <svg\n          aria-hidden\n          width=\"16\"\n          height=\"13\"\n          viewBox=\"0 0 16 13\"\n          fill=\"none\"\n          className=\"pointer-events-none absolute left-1/2 top-1/2 hidden -translate-x-1/2 -translate-y-1/2 peer-checked:block peer-focus-visible:ml-[3px] peer-focus-visible:mt-[3px]\"\n        >\n          <path d=\"M1.5 6.5L6 11L14.5 1.5\" stroke={line} strokeWidth=\"3\" strokeLinecap=\"square\" />\n        </svg>\n      </span>\n      <label htmlFor={id} className=\"cursor-pointer pt-0.5 text-[15px] leading-[1.45]\" style={{ fontFamily: SANS, color: line }}>\n        {label}\n      </label>\n      <Stamp id={id + \"-stamp\"} text={stamp} ink={line} ground=\"#ffffff\" />\n    </div>\n  );\n}\n\nexport type BlackBorderFormProps = {\n  children: ReactNode;\n  /** Called with the form's data once every field is valid. May return a promise. */\n  onSubmit?: (data: FormData) => void | Promise<void>;\n  submitLabel?: string;\n  busyLabel?: string;\n  /** The stamp that lands when onSubmit resolves. */\n  doneLabel?: string;\n  doneNote?: string;\n  /** Shown by the button if onSubmit throws. */\n  failLabel?: string;\n  /** The submit button's fill: a kit fill or #rrggbb. */\n  accent?: keyof typeof FILLS | string;\n  ink?: string;\n  /** Where the form posts when JavaScript is off: https or a same-site path (anything else is dropped). */\n  action?: string;\n  className?: string;\n};\n\nexport function BlackBorderForm({\n  children,\n  onSubmit,\n  submitLabel = \"Send\",\n  busyLabel = \"Sending\",\n  doneLabel = \"Received\",\n  doneNote = \"We'll reply within a working day.\",\n  failLabel = \"Didn't send. Try again\",\n  accent = \"yellow\",\n  ink = \"#000000\",\n  action,\n  className = \"\",\n}: BlackBorderFormProps) {\n  const [state, setState] = useState<\"idle\" | \"busy\" | \"done\" | \"fail\">(\"idle\");\n  const [pressed, setPressed] = useState(false);\n  const focusedThisRound = useRef(false);\n  const run = useRef(0);\n  const done = useRef<HTMLDivElement>(null);\n  const line = HEX.test(ink) ? ink : \"#000000\";\n  const fill = fillOf(accent, FILLS.yellow);\n\n  useEffect(() => {\n    if (state === \"done\") done.current?.focus();\n  }, [state]);\n\n  const submit = async (e: FormEvent<HTMLFormElement>) => {\n    e.preventDefault();\n    if (state === \"busy\" || state === \"done\") return;\n    const data = new FormData(e.currentTarget);\n    const mine = ++run.current;\n    setState(\"busy\");\n    try {\n      await onSubmit?.(data);\n      if (run.current === mine) setState(\"done\");\n    } catch {\n      if (run.current === mine) setState(\"fail\");\n    }\n  };\n\n  const release = () => setPressed(false);\n  const busy = state === \"busy\";\n\n  return (\n    <form\n      method=\"post\"\n      action={safeAction(action)}\n      onSubmit={submit}\n      // The first field to fail in a submit attempt takes focus; the rest just stamp.\n      onInvalidCapture={(e) => {\n        if (focusedThisRound.current) return;\n        focusedThisRound.current = true;\n        (e.target as HTMLElement).focus();\n        // Every invalid event of one submit attempt fires in the same task.\n        window.setTimeout(() => {\n          focusedThisRound.current = false;\n        }, 0);\n      }}\n      className={\"relative flex flex-col gap-6 \" + className}\n      style={{ \"--bbf-ink\": line } as CSSProperties}\n    >\n      {/* Once received, the fields behind the stamp are disabled so Tab cannot reach them. */}\n      <fieldset disabled={state === \"done\"} className=\"m-0 flex min-w-0 flex-col gap-6 border-0 p-0\">\n        {children}\n      </fieldset>\n      <div className=\"flex flex-wrap items-center gap-x-6 gap-y-4 pt-1\">\n        <button\n          type=\"submit\"\n          aria-busy={busy || undefined}\n          aria-disabled={busy || state === \"done\" || undefined}\n          onPointerDown={(e) => {\n            if (e.button === 0 && !busy) setPressed(true);\n          }}\n          onPointerUp={release}\n          onPointerLeave={release}\n          onKeyDown={(e) => {\n            if ((e.key === \"Enter\" || e.key === \" \") && !e.repeat && !busy) setPressed(true);\n          }}\n          onKeyUp={release}\n          onBlur={release}\n          className={\n            \"inline-flex h-14 items-center gap-2.5 px-7 text-[17px] leading-none focus-visible:![outline-offset:4px] transition-[transform,translate,box-shadow] duration-100 ease-linear \" +\n            \"focus-visible:![outline-style:dashed] focus-visible:![outline-width:3px] focus-visible:![border-radius:0] motion-reduce:transition-none \" +\n            (busy\n              ? \"cursor-progress shadow-[5px_5px_0_0_var(--bbf-ink)]\"\n              : pressed\n                ? \"translate-x-[5px] translate-y-[5px] shadow-none\"\n                : \"shadow-[5px_5px_0_0_var(--bbf-ink)] hover:-translate-x-[2px] hover:-translate-y-[2px] hover:shadow-[7px_7px_0_0_var(--bbf-ink)]\")\n          }\n          style={{ background: fill, color: line, border: \"3px solid \" + line, outlineColor: line, fontFamily: DISPLAY, fontWeight: 800 }}\n        >\n          {busy ? busyLabel + \"…\" : submitLabel}\n          {!busy && (\n            <svg aria-hidden width=\"18\" height=\"14\" viewBox=\"0 0 18 14\" fill=\"none\">\n              <path d=\"M0 7H15M9 1.5L15 7L9 12.5\" stroke=\"currentColor\" strokeWidth=\"3\" strokeLinecap=\"square\" />\n            </svg>\n          )}\n        </button>\n        <p role=\"status\" className=\"text-[12px] uppercase tracking-[0.06em]\" style={{ fontFamily: MONO, color: line }}>\n          {state === \"fail\" && (\n            <span className=\"inline-flex h-7 -rotate-[2deg] items-center px-2\" style={{ background: line, color: \"#ffffff\", fontWeight: 700 }}>\n              {failLabel}\n            </span>\n          )}\n        </p>\n      </div>\n\n      {state === \"done\" && (\n        <div ref={done} tabIndex={-1} role=\"status\" className=\"absolute inset-0 z-20 grid place-items-center\" style={{ background: \"rgba(255,255,255,0.72)\", outline: \"none\", borderRadius: 0 }}>\n          <div\n            className=\"flex -rotate-[4deg] flex-col items-center gap-2 px-7 py-5 text-center shadow-[8px_8px_0_0_var(--bbf-ink)]\"\n            style={{ background: fill, border: \"3px solid \" + line, color: line }}\n          >\n            <span className=\"text-[44px] uppercase leading-[0.9] tracking-[-0.02em]\" style={{ fontFamily: DISPLAY, fontWeight: 900 }}>\n              {doneLabel}\n            </span>\n            {doneNote && (\n              <span className=\"text-[12.5px] uppercase tracking-[0.06em]\" style={{ fontFamily: MONO, fontWeight: 600 }}>\n                {doneNote}\n              </span>\n            )}\n          </div>\n        </div>\n      )}\n    </form>\n  );\n}\n","type":"registry:component","target":"components/viberdy/black-border-form.tsx"}],"meta":{"tier":"free","tags":["form","input","validation","sign up","neo-brutalism","brutalist","error state","select","checkbox"],"href":"https://viberdy.dev/library/black-border-form","aiPrompt":"Create neo-brutalist React + Tailwind form fields that press in when used and stamp their errors on: export BlackBorderField, BlackBorderCheck and BlackBorderForm (with their Props types and BlackBorderMessages).\n\nKit grammar: 3px ink borders set inline (no global border-colour rule can repaint them), square corners, hard shadows in the ink with no blur (5px on fields and the button, 3px on the checkbox), accent fills (yellow #ffd23f default, coral #ff6b6b, blue #74b9ff, lime #b4f462, pink #ff5fa2 or a regex-validated hex, names looked up by own key), motion 100ms linear on transform and translate (Tailwind v4 translate utilities set the translate property) and box-shadow, none under reduced motion. Type: labels in var(--font-display, \"Archivo\", \"Archivo Black\", \"Arial Black\", …) at 800, 15px; values in var(--font-sans, …) at 16px; hints and stamps in var(--font-mono, …) uppercase.\n\nBlackBorderField { label, name, kind (\"text\" | \"email\" | \"tel\" | \"url\" | \"textarea\" | \"select\"), options (strings or { value, label }) and prompt (the disabled empty first option) for selects, hint, required, placeholder, autoComplete, minLength, maxLength, pattern, defaultValue, rows, disabled, error (a server error stamped until the value changes; a new error shows again), accent, ink, messages, className }: a label (with an aria-hidden \"*\" when required), then the control inside a white box with the 3px border and a 5px shadow; focus-within presses the box 5px onto its shadow (shadow none) and fills it with the accent (the fill in a class, not inline, so the focus class can win). Selects are appearance-none with a chevron drawn in 3px strokes. Emails cap maxLength at 254. Validation is the browser's own: onInvalid prevents the default bubble and stamps the error; blur stamps it if the field is not empty; change re-checks while a stamp shows. Map validity to short stamp text (valueMissing \"Required\" or \"Pick one\" for selects, typeMismatch \"Needs an @ and a domain\" for email, \"Needs https://\" for url, tooShort, tooLong, patternMismatch), overridable through messages. The stamp is a tilted (-2deg) black tag with white 11.5px mono caps, positioned over the box's top-right corner, inside an aria-live polite span referenced by aria-describedby, with NO transition; aria-invalid is set while a stamp shows.\n\nBlackBorderCheck { label, name, value, required, defaultChecked, disabled, accent, ink, messages }: a real checkbox, appearance-none, 28px, 3px border, 3px shadow, checked fills with the accent and shows a check drawn in 3px strokes, focus-visible presses it 3px in; required stamps \"Tick this to continue\".\n\nBlackBorderForm { children, onSubmit(formData) that may return a promise, submitLabel, busyLabel, doneLabel, doneNote, failLabel, accent, ink, action, className }: a form with method=\"post\" (so without JavaScript nothing typed lands in the address bar) whose action is sanitised (strip tabs and newlines, refuse backslashes, allow https and same-site paths starting / or ? but not //; drop anything else). On the first invalid event of a submit attempt (every invalid event fires in the same task; reset the flag with a setTimeout 0, not a microtask, which runs between listeners) focus that field. On a valid submit, prevent the default, read FormData, set busy (the button keeps its shadow, shows the busy label, sets aria-busy and aria-disabled, and further submits are ignored), await onSubmit, and take a run number so a stale result cannot win. On success, a \"received\" stamp (the accent, 3px border, 8px shadow, rotated -4deg, 44px display caps and a mono note) lands over the form on a 72% white veil, takes focus (tabIndex -1, role status), and the fields are disabled through a fieldset so Tab cannot reach them behind it. On failure, a stamped retry line appears beside the button in a role=\"status\" paragraph. The submit button has the kit's press: hover lifts 2px onto a 7px shadow, pointer down or Enter or Space lands it on its shadow.\n\nWrite the focus-ring declarations as important utilities (for example focus-visible:![outline-style:dashed], focus-visible:![outline-offset:4px], focus-visible:![border-radius:0]) and keep the ring colour inline, so an unlayered global :focus-visible rule in the host app cannot replace them.\n\nOutput one self-contained \"use client\" TSX file with no dependencies beyond React. Build strings with + rather than template literals.","license":"https://viberdy.dev/license"}}