// axi0 Motion 0.2.0: Card drawer. A floating nav bar that springs open into a row of cards, each a group of links, revealed by a clip that only repaints.
// Generated from src/card-drawer/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 CardDrawerProps extends HTMLAttributes<HTMLElement> {
  /** the button's label (default "Menu") */
  menu?: string;
  /** how much accent each card takes, rising card by card (default 14) */
  tint?: number;
  /** The element to render (default "div") */
  as?: string;
  children?: ReactNode;
}

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

export function CardDrawer({ as = "div", menu, tint, ...rest }: CardDrawerProps) {
  return createElement(as, { ...rest, "data-motion": "card-drawer", "data-motion-menu": s(menu), "data-motion-tint": s(tint) });
}

export default CardDrawer;
