// axi0 Motion 0.2.0: Proximity list. List items lean out and light up as the pointer passes near them.
// Generated from src/proximity-list/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 ProximityListProps extends HTMLAttributes<HTMLElement> {
  /** how far, in pixels above and below, the pointer reaches (default 80) */
  reach?: number;
  /** how far the nearest item leans out, in pixels (default 16) */
  shift?: number;
  /** the tick and highlight 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 ProximityList({ as = "div", reach, shift, color, ...rest }: ProximityListProps) {
  return createElement(as, { ...rest, "data-motion": "proximity-list", "data-motion-reach": s(reach), "data-motion-shift": s(shift), "data-motion-color": s(color) });
}

export default ProximityList;
