// axi0 Motion 0.2.0: Doc folder. A folder whose papers peek out under the pointer and fan out above it when it opens; each paper is a link you can pick.
// Generated from src/doc-folder/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 DocFolderProps extends HTMLAttributes<HTMLElement> {
  /** the folder's width (default 200) */
  size?: number;
  /** the folder's color (empty: the accent) (default auto) */
  color?: string;
  /** the button's name when the element has no aria-label (default "Folder") */
  label?: string;
  /** The element to render (default "div") */
  as?: string;
  children?: ReactNode;
}

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

export function DocFolder({ as = "div", size, color, label, ...rest }: DocFolderProps) {
  return createElement(as, { ...rest, "data-motion": "doc-folder", "data-motion-size": s(size), "data-motion-color": s(color), "data-motion-label": s(label) });
}

export default DocFolder;
