UNPKG

@payfit/unity-components

Version:

47 lines (46 loc) 1.7 kB
import { Icon as e } from "../../icon/Icon.js"; import { Text as t } from "../../text/Text.js"; import { uyTv as n } from "@payfit/unity-themes"; import { jsx as r, jsxs as i } from "react/jsx-runtime"; import { FormattedMessage as a } from "react-intl"; import { ListBox as o } from "react-aria-components/ListBox"; import { Popover as s } from "react-aria-components/Popover"; //#region src/components/autocomplete/parts/AutocompletePanel.tsx var c = n({ 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__ */ i("div", { className: "uy:flex uy:flex-col uy:gap-200 uy:items-center uy:justify-center uy:h-[312px]", children: [/* @__PURE__ */ r(t, { 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__ */ r(e, { size: 24, src: "MagnifyingGlassOutlined" }) }), /* @__PURE__ */ r(t, { variant: "bodyLarge", children: /* @__PURE__ */ r(a, { id: "unity:component:autocomplete:panel:empty:label", defaultMessage: "No results found" }) })] }), u = (e) => { let { children: t, panelWidth: n, searchRef: i, ...a } = e, { base: u, list: d } = c(); return /* @__PURE__ */ r(s, { ...a, className: u(), offset: 1, triggerRef: i, isNonModal: !0, style: { "--trigger-width": n }, children: /* @__PURE__ */ r(o, { className: d(), renderEmptyState: l, children: t }) }); }; u.displayName = "AutocompletePanel"; //#endregion export { u as AutocompletePanel };