// axi0 Motion 0.2.0: Focus frame. One word at a time comes into focus inside gliding corner brackets while the rest stay soft.
// Generated from src/focus-frame/meta.json by motion-pack: a thin wrapper. The loader (motion.js) must be on the page once;
// it starts the effect on the element this renders. Options left out keep the effect's own defaults.
import { createElement } from "react";
import type { HTMLAttributes, ReactNode } from "react";

export interface FocusFrameProps extends HTMLAttributes<HTMLElement> {
  /** Focus moves (default "auto") */
  mode?: "auto" | "hover";
  /** Time per word (default 1500) */
  interval?: number;
  /** Blur of the other words (default 4) */
  blur?: number;
  /** Bracket color (default "#f6a04d") */
  color?: string;
  /** The element to render (default "div") */
  as?: string;
  children?: ReactNode;
}

const s = (v: unknown) => (v === undefined ? undefined : String(v));

export function FocusFrame({ as = "div", mode, interval, blur, color, ...rest }: FocusFrameProps) {
  return createElement(as, { ...rest, "data-motion": "focus-frame", "data-motion-mode": s(mode), "data-motion-interval": s(interval), "data-motion-blur": s(blur), "data-motion-color": s(color) });
}

export default FocusFrame;
