UNPKG

fui-fancyui

Version:
52 lines (51 loc) 1.39 kB
"use client"; import { jsx as r, jsxs as S } from "react/jsx-runtime"; import { useState as c, useRef as W, useEffect as H } from "react"; import L from "../../molecules/SearchBar/SearchBar.js"; import { WrapperListInput as b, Background as v, WrapperList as z } from "./FancySearchBar.style.js"; function j(o) { const { children: h, searchListWidth: l, value: e, openListWhenFocused: p, themeType: t = "primary", layer: s = 0, sizeC: i = "md", borderRadius: n, externalStyle: d, className: u, ...m } = o, [f, y] = c(!1), [$, g] = c(0), a = W(null), x = (R) => { y(R); }; return H(() => { a.current && g(a.current.offsetHeight); }, []), /* @__PURE__ */ r(b, { style: { minHeight: `${$}px` }, className: u, $externalStyle: d, children: /* @__PURE__ */ S(v, { $sizeC: i, $borderRadius: n, $themeType: t, $layer: s, children: [ /* @__PURE__ */ r("div", { ref: a, children: /* @__PURE__ */ r( L, { themeType: t, layer: s, sizeC: i, activeHandler: x, searchValue: e, ...m } ) }), f && (p || ((e == null ? void 0 : e.length) ?? 0) > 0) && /* @__PURE__ */ r( z, { $sizeC: i, $themeType: t, $layer: s, $borderRadius: n, $width: l, children: h } ) ] }) }); } export { j as default };