import React__default from 'react'; /** A single searchable destination. `keywords` extend matching beyond the title. */ type SiteSearchItem = { title: string; href: string; keywords?: string[]; }; /** A titled section of results, rendered with a muted group heading. */ type SiteSearchGroup = { title: string; items: SiteSearchItem[]; }; type SiteSearchProps = { /** The searchable site map, as titled groups of items. */ groups: SiteSearchGroup[]; /** * Called with the chosen item on click or Enter, after the palette closes. * Navigation is the APP's job — call your router here (e.g. next/navigation's * `router.push(item.href)`). The design system ships no framework code, so it * never navigates itself; this mirrors the DS-wide framework-free rule * (see `Link` / `LinkProvider`). */ onSelect: (item: SiteSearchItem) => void; /** Whether the palette is open. Use when controlled. */ open?: boolean; /** Called whenever the palette asks to open or close. */ onOpenChange?: (open: boolean) => void; /** Whether the palette is initially open (uncontrolled). */ defaultOpen?: boolean; /** * Wire the global Cmd/Ctrl-K toggle on `document`, with cleanup on unmount. * Defaults to true. Only one shortcut-enabled SiteSearch should be mounted * per page, or each press toggles all of them. */ shortcut?: boolean; /** * Accessible name for the palette, applied as `aria-label` to the dialog * panel, the search input and the default trigger. Defaults to * `'Search site'`. Mirrors ExpandableSearch's `label` prop — localise it * rather than hardcoding English into consumers' pages. */ label?: string; /** Placeholder for the search input. */ placeholder?: string; /** Message shown when no items match the query. */ emptyMessage?: string; /** * The element that opens the palette. Defaults to a ghost icon `Button` * named by `label`. Pass an element to replace it — it is composed via Base * UI's `render` prop, so it inherits the trigger behaviour and ARIA — or * `null` to render no trigger at all (open via `open` or the shortcut). * A custom trigger owns its own accessible name — `label` is applied as * `aria-label` to the default icon button only, since overriding a visible * label that way fails WCAG 2.2, 2.5.3 Label in Name. * * Conditional triggers must resolve to `null`, not `false`: write * `cond ?