UNPKG

@playbooks/ui

Version:

An interface library for Playbooks.

142 lines (141 loc) 6.44 kB
import { jsx } from "react/jsx-runtime"; import { a as computeProps, A as Article$1, i as Aside$1, j as Blockquote$1, k as Body$1, C as Caption$1, l as Code$1, D as Div$1, m as Figure$1, n as Hr$1, o as Html$1, p as Iframe, q as Img$1, r as Li$1, M as Main$1, s as Pre$1, t as Span$1, U as Ul$1 } from "./index.es-7ZX4yv7W.js"; import { useUI } from "./context.es.js"; const Article = ({ name = "Article", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.article(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Article$1, { name, tailwind: formatted, className, ...filtered, children }); }; const Aside = ({ name = "Aside", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.aside(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Aside$1, { name, tailwind: formatted, className, ...filtered, children }); }; const Blockquote = ({ name = "Blockquote", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.blockquote(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Blockquote$1, { name, tailwind: formatted, className, ...filtered, children }); }; const Body = ({ name = "Body", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.body(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Body$1, { name, tailwind: formatted, className, ...filtered, children }); }; const Caption = ({ name = "Caption", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.caption(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Caption$1, { name, tailwind: formatted, className, ...filtered, children }); }; const Code = ({ name = "Code", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.code(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Code$1, { name, tailwind: formatted, className, ...filtered, children }); }; const Div = ({ name = "Div", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.div(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Div$1, { name, tailwind: formatted, className, ...filtered, children }); }; const Figure = ({ name = "Figure", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.figure(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Figure$1, { name, tailwind: formatted, className, ...filtered, children }); }; const Hr = ({ name = "Hr", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.hr(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Hr$1, { name, tailwind: formatted, className, ...filtered, children }); }; const Html = ({ name = "Html", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.html(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Html$1, { name, tailwind: formatted, className, ...filtered, children }); }; const IFrame = ({ name = "iFrame", tailwind, className, ...props }) => { const context = useUI(); const base = context?.theme?.iFrame(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Iframe, { name, tailwind: formatted, className, ...filtered }); }; const Img = ({ name = "Img", src, alt = "photo", tailwind, className, ...props }) => { const context = useUI(); const base = context?.theme?.img(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Img$1, { name, src, alt, tailwind: formatted, className, ...filtered }); }; const Li = ({ name = "Li", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.li(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Li$1, { name, tailwind: formatted, className, ...filtered, children }); }; const Main = ({ name = "Main", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.main(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Main$1, { name, tailwind: formatted, className, ...filtered, children }); }; const Pre = ({ name = "Pre", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.pre(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Pre$1, { name, tailwind: formatted, className, ...filtered, children }); }; const Span = ({ name = "Span", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.span(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Span$1, { name, tailwind: formatted, className, ...filtered, children }); }; const Ul = ({ name = "Ul", tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.ul(); const formatted = { ...base, ...props, ...tailwind }; const filtered = computeProps(props); return /* @__PURE__ */ jsx(Ul$1, { name, tailwind: formatted, className, ...filtered, children }); }; export { Article, Aside, Blockquote, Body, Caption, Code, Div, Figure, Hr, Html, IFrame, Img, Li, Main, Pre, Span, Ul };