import { type ElementRef, EventEmitter, type OnChanges, type OnDestroy } from "@angular/core"; import { type Product, type ProductImageFallback, type ProductsLayout, productInitial, type UIStrings } from "@magicx-eng/ai-autocomplete-vanilla"; import * as i0 from "@angular/core"; type CartState = "adding" | "added"; /** * Internal product strip rendered below the dropdown's options grid. Mirrors * `packages/react/src/components/ProductStrip.tsx` and the vanilla core's * `renderProductStrip`, so all three packages emit the same structure and * theme identically. * * Two layout notes carried over from the vanilla implementation: * * - The dropdown paints a background but never sets `color`, so anything here * relying on `color: inherit` would pick up the *host page's* text colour — * black text on a dark panel. Every text node resolves its colour through * the same `--aia-option-*` chain the options use. * - The options grid carries a negative bottom margin so the footer rides up * over its reserved band, and whatever follows the grid inherits that pull. * The dropdown root is marked `data-aia-has-products` and the appearance * layer zeroes the band at its source rather than the strip cancelling it * from here. * * @internal */ export declare class ProductStripComponent implements OnDestroy, OnChanges { products: Product[]; /** Scopes the section label's id to the owning listbox. */ listboxId: string; /** * False while the panel is fading out. The closed dropdown keeps rendering * its last content for the fade, and focusable cards inside it would still * answer Tab. */ focusable: boolean; /** How the cards lay out — a scrolling row, or stacked as full-width rows. Default: "row". */ layout: ProductsLayout; imageFallback: ProductImageFallback; /** The words of the widget language. Default: English. */ strings: UIStrings; /** * Set when the integration adds to cart: each card that is not sold out * draws a cart button, whose press calls this instead of emitting `select`. */ addToCart: ((product: Product) => void | PromiseLike) | null; readonly initial: typeof productInitial; /** * Per product id, the `src`s that failed to load: a card moves on to the * next source (a Shopify thumbnail falls back to the original) and shows its * placeholder once none is left. */ private readonly failedImages; /** Per product id, the `src` that last finished loading; its tile drops the fill. */ private readonly loadedImages; ngOnChanges(): void; imageSource(product: Product): string | null; /** Whether the card's photo has loaded, so the placeholder fill steps aside. */ imageLoaded(product: Product): boolean; onImageLoad(product: Product, src: string, event?: Event): void; onImageError(product: Product): void; /** Per product id, how much of the tile the loaded photo fills (productPhotoFill). */ private readonly photoFills; /** * The card's photo-fill custom properties, which put the cart button inside * the photo's own corner. Null until the photo loads. */ photoFillStyle(product: Product): Record | null; readonly select: EventEmitter; /** * Focus moved into / out of the strip. The panel closes on blur by default * and the editor blurs the moment a card takes focus, so the dropdown * reports focus as still-inside rather than shutting out from under the card * the user just tabbed to. */ readonly focusChange: EventEmitter; private detachWheel; private readonly cdr; /** * Per product id, the cart button's state while it isn't at rest, with the * product identity it belongs to and the press that set it (a settle from an * earlier press, or for a card since reset, is dropped). */ private readonly carts; private destroyed; /** * A mouse wheel over the row scrolls it sideways. The row sits inside the * section's `*ngIf`, so the query fires with the element as products arrive * and with `undefined` as they go; the binding follows it either way. */ set row(ref: ElementRef | undefined); ngOnDestroy(): void; /** A sold-out product can't be added, so its card has no button at all. */ hasCart(product: Product): boolean; cartState(product: Product): CartState | null; onCartKeyDown(event: KeyboardEvent, product: Product): void; /** * Mirrors vanilla's `buildCartButton` press: adding → added, or rest on a * rejection. The check stays until the product changes; another press adds again. */ onCartPress(event: Event, product: Product): void; private settleCart; get labelId(): string; cardId(index: number): string; trackByProduct: (_: number, product: Product) => string; onClick(event: MouseEvent, product: Product): void; onKeyDown(event: KeyboardEvent, product: Product): void; onCardFocus(): void; onCardBlur(event: FocusEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {}; //# sourceMappingURL=product-strip.component.d.ts.map