UNPKG

@konstructio/ui

Version:

A set of reusable and customizable React components built for konstruct.io

49 lines (48 loc) 1.2 kB
import { jsx as s, jsxs as w } from "react/jsx-runtime"; import { forwardRef as h } from "react"; import { cn as o } from "../../utils/index.js"; import { DropdownProvider as v } from "./contexts/dropdown.provider.js"; import { Wrapper as N } from "./components/Wrapper.js"; const W = h( ({ error: t, errorClassName: i, helperText: r, helperTextClassName: m, highlightSearch: a, mainWrapperClassName: p, name: l, value: d, options: n, onChange: c, onBlur: e, ...f }, x) => /* @__PURE__ */ s( v, { highlightSearch: a, name: l, value: d, options: n, onBlur: e, onChange: c, children: /* @__PURE__ */ w("div", { className: o("relative w-full", p), children: [ /* @__PURE__ */ s( N, { error: t, name: l, ref: x, onBlur: e, ...f } ), t ? /* @__PURE__ */ s("span", { className: o("text-xs text-red-700", i), children: t }) : null, !t && r ? /* @__PURE__ */ s("span", { className: o("text-xs text-slate-600", m), children: r }) : null ] }) } ) ); export { W as Dropdown };