UNPKG

koval-ui

Version:

React components collection with minimalistic design. Supports theming, layout, and input validation.

34 lines (33 loc) 849 B
"use client"; import { jsx as s, jsxs as f } from "react/jsx-runtime"; import { forwardRef as n, useMemo as p } from "react"; import u from "classnames"; import { useLocalTheme as d } from "css-vars-hook"; import o from "./Figure.module.css.js"; const g = n( ({ children: m, className: c, caption: e, position: r = "center", ...a }, i) => { const t = p( () => ({ position: r }), [r] ), { LocalRoot: l } = d(); return /* @__PURE__ */ s(l, { theme: t, className: o.wrapper, children: /* @__PURE__ */ f( "figure", { ...a, className: u(o.figure, c), ref: i, children: [ m, e && /* @__PURE__ */ s("figcaption", { children: e }) ] } ) }); } ); g.displayName = "Figure"; export { g as Figure }; //# sourceMappingURL=Figure.js.map