@playbooks/ui
Version:
An interface library for Playbooks.
62 lines (61 loc) • 1.81 kB
JavaScript
import { jsx } from "react/jsx-runtime";
import { useUI } from "./context.es.js";
import { Font, P } from "./fonts.es.js";
import { Div } from "./html.es.js";
const Header = ({ name = "Header", tailwind, className, children, ...props }) => {
const context = useUI();
const base = context?.theme?.header();
const computed = { ...base, ...props, tailwind, className, name };
return /* @__PURE__ */ jsx(Div, { ...computed, children });
};
const HeaderTitle = ({
name = "HeaderTitle",
size = "h4",
tailwind,
className,
children,
...props
}) => {
const context = useUI();
const base = context?.theme?.headerTitle();
const computed = { ...base, ...props, tailwind, className, name };
return /* @__PURE__ */ jsx(Font, { size, ...computed, children });
};
const HeaderSubtitle = ({
name = "HeaderSubtitle",
size = "h6",
tailwind,
className,
children,
...props
}) => {
const context = useUI();
const base = context?.theme?.headerSubtitle();
const computed = { ...base, ...props, tailwind, className, name };
return /* @__PURE__ */ jsx(Font, { size, ...computed, children });
};
const HeaderText = ({ name = "HeaderText", tailwind, className, children, ...props }) => {
const context = useUI();
const base = context?.theme?.headerText();
const computed = { ...base, ...props, tailwind, className, name };
return /* @__PURE__ */ jsx(P, { ...computed, children });
};
const HeaderActions = ({
name = "HeaderActions",
tailwind,
className,
children,
...props
}) => {
const context = useUI();
const base = context?.theme?.headerActions();
const computed = { ...base, ...props, tailwind, className, name };
return /* @__PURE__ */ jsx(Div, { ...computed, children });
};
export {
Header,
HeaderActions,
HeaderSubtitle,
HeaderText,
HeaderTitle
};