UNPKG

@playbooks/ui

Version:

An interface library for Playbooks.

52 lines (51 loc) 1.38 kB
import { jsx } from "react/jsx-runtime"; import { useUI } from "./context.es.js"; import { Div } from "./html.es.js"; import { Icon } from "./icons.es.js"; const InputGroup = ({ name = "InputGroup", active, tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.inputGroup(); const computed = { ...base, ...props, tailwind, className, name }; return /* @__PURE__ */ jsx(Div, { ...computed, children }); }; const InputAppend = ({ name = "InputAppend", icon, taskRunning, tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.inputAppend(); const computed = { ...base, ...props, tailwind, className, name }; return /* @__PURE__ */ jsx(Div, { ...computed, children: icon ? /* @__PURE__ */ jsx(Icon, { icon: icon?.icon || icon, ...icon }) : children }); }; const InputPrepend = ({ name = "InputPrepend", icon, taskRunning, onClick, tailwind, className, children, ...props }) => { const context = useUI(); const base = context?.theme?.inputPrepend(); const computed = { ...base, ...props, tailwind, className, name }; return /* @__PURE__ */ jsx(Div, { ...computed, children: icon ? /* @__PURE__ */ jsx(Icon, { icon: icon?.icon || icon, ...icon }) : children }); }; export { InputAppend, InputGroup, InputPrepend };