UNPKG

@playbooks/ui

Version:

An interface library for Playbooks.

46 lines (45 loc) 1.14 kB
import { jsx } from "react/jsx-runtime"; import { useUI } from "./context.es.js"; import { Div } from "./html.es.js"; const Container = ({ name = "Container", size, tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.container({ size }); const computed = { ...base, ...props, tailwind, className, name }; return /* @__PURE__ */ jsx(Div, { ...computed, children }); }; const Grid = ({ name = "Grid", cols = "12", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.grid({ cols }); const computed = { ...base, ...props, tailwind, className, name }; return /* @__PURE__ */ jsx(Div, { ...computed, children }); }; const Col = ({ name = "Col", span = "12", sm, md, lg, xl, xxl, tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.col({ span, sm, md, lg, xl, xxl }); const computed = { ...base, ...props, tailwind, className, name }; return /* @__PURE__ */ jsx(Div, { ...computed, children }); }; export { Col, Container, Grid };