UNPKG

@payfit/unity-components

Version:

47 lines (46 loc) • 1.69 kB
import { Text as e } from "../../text/Text.js"; import { uyTv as t } from "@payfit/unity-themes"; import { jsx as n, jsxs as r } from "react/jsx-runtime"; import { Trans as i } from "react-i18next"; import { Icon as a } from "@payfit/unity-icons"; import { ListBox as o } from "react-aria-components/ListBox"; import { Popover as s } from "react-aria-components/Popover"; //#region src/core/components/autocomplete/parts/AutocompletePanel.tsx var c = t({ slots: { base: "uy:rounded-75 uy:border uy:border-solid uy:border-border-neutral uy:w-[var(--trigger-width)] uy:bg-surface-neutral uy:max-h-[312px] uy:shadow-300", list: "uy:overflow-y-auto uy:max-h-[296px] uy:p-100" } }), l = () => /* @__PURE__ */ r("div", { className: "uy:flex uy:flex-col uy:gap-200 uy:items-center uy:justify-center uy:h-[312px]", children: [/* @__PURE__ */ n(e, { variant: "body", className: "uy:w-500 uy:h-500 uy:bg-surface-neutral-lowest uy:flex uy:items-center uy:justify-center uy:rounded-75", children: /* @__PURE__ */ n(a, { size: 24, src: "MagnifyingGlassOutlined" }) }), /* @__PURE__ */ n(e, { variant: "bodyLarge", children: /* @__PURE__ */ n(i, { ns: "unity", i18nKey: (e) => e.unity.component.autocomplete.panel.empty.label }) })] }), u = (e) => { let { children: t, panelWidth: r, searchRef: i, ...a } = e, { base: u, list: d } = c(); return /* @__PURE__ */ n(s, { ...a, className: u(), offset: 1, triggerRef: i, isNonModal: !0, style: { "--trigger-width": r }, children: /* @__PURE__ */ n(o, { className: d(), renderEmptyState: l, children: t }) }); }; u.displayName = "AutocompletePanel"; //#endregion export { u as AutocompletePanel };