/** * @oxpulse/chat-widget — Product picker (seller catalog). * * Searchable dropdown listing the seller's product catalog. On select, * calls `onSelect(productRef, productMeta)` which the Composer wires to * `setProductCard()`. * * Lifecycle (mirrors EmojiPicker): * show(anchorEl) — appends picker to container, positions below anchor * hide() — removes from DOM, restores focus * * A11y: * role="dialog", search input focused on open, Arrow keys navigate, * Escape hides + restores focus, Tab focus trap. * * Used from: * - Composer: product button in the toolbar → opens picker → * onSelect → composer.setProductCard(ref, meta) → existing chip → send */ import type { ProductMeta } from "../types.js"; import type { SDKCatalogClient } from "@oxpulse/chat-sdk"; export interface ProductPickerOptions { /** Container element to render the picker inside. */ container: HTMLElement; /** Catalog client for fetching the seller's products. */ client: SDKCatalogClient; /** Called when the user selects a product. */ onSelect: (productRef: string, productMeta: ProductMeta) => void; /** Optional abort signal — when aborted, show() becomes a no-op. */ signal?: AbortSignal; /** BCP-47 tag or an already-resolved Locale. */ lang?: string; /** Called when the picker closes itself (Escape, outside click). */ onHide?: () => void; /** Element to append the picker to (default: constructor container). * Pass the ShadowRoot host element to escape overflow:hidden clip contexts * — mirrors EmojiPicker's mountTo pattern (MAJOR-5). */ mountTo?: HTMLElement; } export declare class ProductPicker { #private; constructor(opts: ProductPickerOptions); /** Show the picker anchored below the given element. */ show(anchorEl: HTMLElement, restoreFocusEl?: HTMLElement): Promise; /** Hide the picker without firing onSelect. */ hide(): void; get isOpen(): boolean; } //# sourceMappingURL=product-picker.d.ts.map