// axi0 Motion 0.2.0: Tip group. Tooltips for a row of icon buttons: the first one waits a beat, then its neighbors open at once while the group is warm, the tip gliding from one to the next.
// Generated from src/tip-group/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 TipGroupProps extends HTMLAttributes<HTMLElement> {
  /** the wait before the first tip (default 500) */
  delay?: number;
  /** how long the group stays warm after a tip closes (default 600) */
  warm?: number;
  /** The element to render (default "div") */
  as?: string;
  children?: ReactNode;
}

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

export function TipGroup({ as = "div", delay, warm, ...rest }: TipGroupProps) {
  return createElement(as, { ...rest, "data-motion": "tip-group", "data-motion-delay": s(delay), "data-motion-warm": s(warm) });
}

export default TipGroup;
