// axi0 Motion 0.2.0: Ring dial. A dial of fine ticks you turn by angle: the value arc fills behind a bright head that drags a comet tail when you spin it fast.
// Generated from src/ring-dial/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 RingDialProps extends HTMLAttributes<HTMLElement> {
  /** the dial's width (default 200) */
  size?: number;
  /** text after the value in the middle (default "%") */
  unit?: string;
  /** The element to render (default "div") */
  as?: string;
  children?: ReactNode;
}

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

export function RingDial({ as = "div", size, unit, ...rest }: RingDialProps) {
  return createElement(as, { ...rest, "data-motion": "ring-dial", "data-motion-size": s(size), "data-motion-unit": s(unit) });
}

export default RingDial;
