@playbooks/ui
Version:
An interface library for Playbooks.
49 lines (48 loc) • 1.68 kB
JavaScript
import { jsx } from "react/jsx-runtime";
import { useUI } from "./context.es.js";
import { Div, Img } from "./html.es.js";
const Tags = ({ name = "Tags", tailwind, className, children, ...props }) => {
const context = useUI();
const base = context?.theme?.tags();
const computed = { ...base, ...props, tailwind, className, name };
return /* @__PURE__ */ jsx(Div, { ...computed, children });
};
const Tag = ({ name = "Tag", size = "md", tailwind, className, children, ...props }) => {
const context = useUI();
const base = context?.theme?.tag({ size });
const computed = { ...base, ...props, tailwind, className, name };
return /* @__PURE__ */ jsx(Div, { ...computed, children });
};
const TagImg = ({
name = "TagImg",
size = "md",
src,
alt = "tag image",
tailwind,
className,
...props
}) => {
const context = useUI();
const base = context?.theme?.tagImg({ size });
const computed = { ...base, ...props, tailwind, className, name };
return /* @__PURE__ */ jsx(Img, { src, alt, ...computed });
};
const TagBody = ({ name = "TagBody", tailwind, className, children, ...props }) => {
const context = useUI();
const base = context?.theme?.tagBody();
const computed = { ...base, ...props, tailwind, className, name };
return /* @__PURE__ */ jsx(Div, { ...computed, children });
};
const TagActions = ({ name = "TagActions", tailwind, className, children, ...props }) => {
const context = useUI();
const base = context?.theme?.tagActions();
const computed = { ...base, ...props, tailwind, className, name };
return /* @__PURE__ */ jsx(Div, { ...computed, children });
};
export {
Tag,
TagActions,
TagBody,
TagImg,
Tags
};