@seekora-ai/ui-sdk-react 0.2.10 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/primitives/ActionButtons.d.ts +27 -0
- package/dist/components/primitives/ActionButtons.d.ts.map +1 -0
- package/dist/components/primitives/ActionButtons.js +78 -0
- package/dist/components/primitives/AnalyticsProvider.d.ts +22 -0
- package/dist/components/primitives/AnalyticsProvider.d.ts.map +1 -0
- package/dist/components/primitives/AnalyticsProvider.js +87 -0
- package/dist/components/primitives/BadgeList.d.ts +14 -0
- package/dist/components/primitives/BadgeList.d.ts.map +1 -0
- package/dist/components/primitives/BadgeList.js +45 -0
- package/dist/components/primitives/ImageDisplay.d.ts +10 -1
- package/dist/components/primitives/ImageDisplay.d.ts.map +1 -1
- package/dist/components/primitives/ImageDisplay.js +49 -9
- package/dist/components/primitives/ImageZoom.d.ts +33 -0
- package/dist/components/primitives/ImageZoom.d.ts.map +1 -0
- package/dist/components/primitives/ImageZoom.js +357 -0
- package/dist/components/primitives/PriceDisplay.d.ts +21 -0
- package/dist/components/primitives/PriceDisplay.d.ts.map +1 -0
- package/dist/components/primitives/PriceDisplay.js +44 -0
- package/dist/components/primitives/RatingDisplay.d.ts +43 -0
- package/dist/components/primitives/RatingDisplay.d.ts.map +1 -0
- package/dist/components/primitives/RatingDisplay.js +114 -0
- package/dist/components/primitives/VariantSelector.d.ts +30 -0
- package/dist/components/primitives/VariantSelector.d.ts.map +1 -0
- package/dist/components/primitives/VariantSelector.js +162 -0
- package/dist/components/primitives/VariantSwatches.d.ts +28 -0
- package/dist/components/primitives/VariantSwatches.d.ts.map +1 -0
- package/dist/components/primitives/VariantSwatches.js +173 -0
- package/dist/components/primitives/index.d.ts +9 -0
- package/dist/components/primitives/index.d.ts.map +1 -1
- package/dist/components/primitives/index.js +9 -0
- package/dist/components/primitives/withAnalytics.d.ts +24 -0
- package/dist/components/primitives/withAnalytics.d.ts.map +1 -0
- package/dist/components/primitives/withAnalytics.js +73 -0
- package/dist/components/product-page/ProductInfo.d.ts +25 -2
- package/dist/components/product-page/ProductInfo.d.ts.map +1 -1
- package/dist/components/product-page/ProductInfo.js +20 -5
- package/dist/components/suggestions/types.d.ts +24 -0
- package/dist/components/suggestions/types.d.ts.map +1 -1
- package/dist/components/suggestions/utils.d.ts +37 -0
- package/dist/components/suggestions/utils.d.ts.map +1 -1
- package/dist/components/suggestions/utils.js +118 -0
- package/dist/components/suggestions-primitives/ItemCard.d.ts +10 -1
- package/dist/components/suggestions-primitives/ItemCard.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/ItemCard.js +20 -6
- package/dist/components/suggestions-primitives/ProductCard.d.ts +27 -3
- package/dist/components/suggestions-primitives/ProductCard.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/ProductCard.js +124 -17
- package/dist/components/suggestions-primitives/ProductCardLayouts.d.ts +44 -0
- package/dist/components/suggestions-primitives/ProductCardLayouts.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/ProductCardLayouts.js +105 -0
- package/dist/components/suggestions-primitives/ProductGrid.d.ts +6 -1
- package/dist/components/suggestions-primitives/ProductGrid.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/ProductGrid.js +2 -2
- package/dist/hooks/useProductAnalytics.d.ts +49 -0
- package/dist/hooks/useProductAnalytics.d.ts.map +1 -0
- package/dist/hooks/useProductAnalytics.js +116 -0
- package/dist/hooks/useSuggestionsAnalytics.d.ts.map +1 -1
- package/dist/hooks/useSuggestionsAnalytics.js +6 -0
- package/dist/hooks/useVariantSelection.d.ts +28 -0
- package/dist/hooks/useVariantSelection.d.ts.map +1 -0
- package/dist/hooks/useVariantSelection.js +44 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.umd.js +1 -1
- package/dist/src/index.d.ts +1107 -679
- package/dist/src/index.esm.js +2267 -600
- package/dist/src/index.esm.js.map +1 -1
- package/dist/src/index.js +2283 -599
- package/dist/src/index.js.map +1 -1
- package/package.json +5 -5
package/dist/src/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default, { ReactNode, CSSProperties } from 'react';
|
|
3
3
|
import { SearchOptions, SearchResponse, SeekoraClient, SearchContext, DataTypesEventPayload, ExtendedEventPayload } from '@seekora-ai/search-sdk';
|
|
4
4
|
import * as _seekora_ai_ui_sdk_types from '@seekora-ai/ui-sdk-types';
|
|
5
|
-
import { ResultItem, ViewMode, FieldMapping, ThemeConfig, Theme, QuerySuggestionsEventHandlers, HighlightConfig, KeyboardNavConfig, AnimationConfig, QuerySuggestionsClassNames, SuggestionItem as SuggestionItem$3, RecentSearch, DropdownSectionConfig, SuggestionCategory, TrendingSearch, ProductItem, PopularBrand, FilteredTab, QuerySuggestionsVariant, QuerySuggestionsResponse, DropdownRecommendations, TopSearch, RelatedSearch } from '@seekora-ai/ui-sdk-types';
|
|
6
|
-
export { FieldMapping, ResultItem, Theme, ThemeConfig, ViewMode } from '@seekora-ai/ui-sdk-types';
|
|
5
|
+
import { ResultItem, ViewMode, FieldMapping, ThemeConfig, Theme, QuerySuggestionsEventHandlers, HighlightConfig, KeyboardNavConfig, AnimationConfig, QuerySuggestionsClassNames, SuggestionItem as SuggestionItem$3, RecentSearch, DropdownSectionConfig, SuggestionCategory, TrendingSearch, ProductItem, PopularBrand, FilteredTab, QuerySuggestionsVariant, QuerySuggestionsResponse, DropdownRecommendations, TopSearch, RelatedSearch, PriceRange, ProductBadge, ProductOption, ProductVariant } from '@seekora-ai/ui-sdk-types';
|
|
6
|
+
export { FieldMapping, PriceRange, ProductBadge, ProductOption, ProductVariant, ResultItem, Theme, ThemeConfig, ViewMode } from '@seekora-ai/ui-sdk-types';
|
|
7
7
|
import { SearchStateManagerConfig, SearchStateManager, HighlightPart, SearchState } from '@seekora-ai/ui-sdk-core';
|
|
8
8
|
export { Fingerprint, FingerprintComponents, FingerprintConfig, FingerprintResult, getFingerprint, mergeThemes } from '@seekora-ai/ui-sdk-core';
|
|
9
9
|
|
|
@@ -1627,6 +1627,33 @@ interface SuggestionItemProps {
|
|
|
1627
1627
|
}
|
|
1628
1628
|
declare function SuggestionItem$1({ suggestion, index, isActive, onSelect, className, style, enableHighlightMarkup, highlightMarkupOptions, renderHighlight, }: SuggestionItemProps): React__default.JSX.Element;
|
|
1629
1629
|
|
|
1630
|
+
/**
|
|
1631
|
+
* ActionButtons – card action buttons (add to cart, wishlist, buy now, quick view)
|
|
1632
|
+
*
|
|
1633
|
+
* Renders a set of action buttons for product cards. Can be positioned absolutely
|
|
1634
|
+
* over the image (on hover) or inline below the card content.
|
|
1635
|
+
*/
|
|
1636
|
+
|
|
1637
|
+
type ActionButtonType = 'addToCart' | 'wishlist' | 'buyNow' | 'quickView' | 'compare';
|
|
1638
|
+
interface ActionButton {
|
|
1639
|
+
type: ActionButtonType;
|
|
1640
|
+
label?: string;
|
|
1641
|
+
icon?: React__default.ReactNode;
|
|
1642
|
+
onClick?: (e: React__default.MouseEvent) => void;
|
|
1643
|
+
disabled?: boolean;
|
|
1644
|
+
loading?: boolean;
|
|
1645
|
+
}
|
|
1646
|
+
interface ActionButtonsProps {
|
|
1647
|
+
buttons: ActionButton[];
|
|
1648
|
+
layout?: 'horizontal' | 'vertical' | 'overlay';
|
|
1649
|
+
position?: 'top-right' | 'bottom-center' | 'inline';
|
|
1650
|
+
showLabels?: boolean;
|
|
1651
|
+
size?: 'small' | 'medium' | 'large';
|
|
1652
|
+
className?: string;
|
|
1653
|
+
style?: React__default.CSSProperties;
|
|
1654
|
+
}
|
|
1655
|
+
declare function ActionButtons({ buttons, layout, position, showLabels, size, className, style, }: ActionButtonsProps): React__default.JSX.Element;
|
|
1656
|
+
|
|
1630
1657
|
/**
|
|
1631
1658
|
* ItemCard – generic item tile (primitive)
|
|
1632
1659
|
*
|
|
@@ -1663,8 +1690,16 @@ interface ItemCardProps {
|
|
|
1663
1690
|
asLink?: boolean;
|
|
1664
1691
|
/** When multiple images, use ImageDisplay with this variant */
|
|
1665
1692
|
imageVariant?: ImageDisplayVariant$1;
|
|
1693
|
+
/** Layout direction: vertical (default) or horizontal (image left, content right) */
|
|
1694
|
+
layout?: 'vertical' | 'horizontal';
|
|
1695
|
+
/** Action buttons (add to cart, wishlist, etc.) */
|
|
1696
|
+
actionButtons?: ActionButton[];
|
|
1697
|
+
/** Action buttons position */
|
|
1698
|
+
actionButtonsPosition?: 'overlay-top-right' | 'overlay-bottom' | 'inline';
|
|
1699
|
+
/** Show action button labels */
|
|
1700
|
+
showActionLabels?: boolean;
|
|
1666
1701
|
}
|
|
1667
|
-
declare function ItemCard({ item, position, onSelect, className, style, asLink, imageVariant, }: ItemCardProps): React__default.JSX.Element;
|
|
1702
|
+
declare function ItemCard({ item, position, onSelect, className, style, asLink, imageVariant, layout, actionButtons, actionButtonsPosition, showActionLabels, }: ItemCardProps): React__default.JSX.Element;
|
|
1668
1703
|
|
|
1669
1704
|
/**
|
|
1670
1705
|
* ItemGrid – generic grid of items (primitive)
|
|
@@ -1693,770 +1728,1051 @@ interface ItemGridProps<T = GenericItem> {
|
|
|
1693
1728
|
}
|
|
1694
1729
|
declare function ItemGrid<T = GenericItem>({ items, onItemClick, getItemId, getItemTitle, getItemImage, getItemDescription, getItemUrl, renderItem, maxItems, columns, className, style, gridClassName, }: ItemGridProps<T>): React__default.JSX.Element | null;
|
|
1695
1730
|
|
|
1696
|
-
/**
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
className?: string;
|
|
1711
|
-
style?: React__default.CSSProperties;
|
|
1712
|
-
imageVariant?: ProductCardImageVariant;
|
|
1731
|
+
/** Maps client's data fields to component expected fields */
|
|
1732
|
+
interface SuggestionFieldMapping {
|
|
1733
|
+
/** Field path for suggestion text (e.g., "query", "searchTerm", "text") */
|
|
1734
|
+
query: string;
|
|
1735
|
+
/** Field path for suggestion count/popularity */
|
|
1736
|
+
count?: string;
|
|
1737
|
+
/** Field path for object ID */
|
|
1738
|
+
id?: string;
|
|
1739
|
+
/** Field path for categories array */
|
|
1740
|
+
categories?: string;
|
|
1741
|
+
/** Field path for highlighted text */
|
|
1742
|
+
highlighted?: string;
|
|
1743
|
+
/** Custom field mappings */
|
|
1744
|
+
custom?: Record<string, string>;
|
|
1713
1745
|
}
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
/**
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
*/
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
/**
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1746
|
+
/** Maps client's product fields to component expected fields */
|
|
1747
|
+
interface ProductFieldMapping {
|
|
1748
|
+
/** Field path for product ID */
|
|
1749
|
+
id: string;
|
|
1750
|
+
/** Field path for product title/name */
|
|
1751
|
+
title: string;
|
|
1752
|
+
/** Field path for product image URL */
|
|
1753
|
+
image?: string;
|
|
1754
|
+
/** Field path for product price */
|
|
1755
|
+
price?: string;
|
|
1756
|
+
/** Field path for original/compare price */
|
|
1757
|
+
comparePrice?: string;
|
|
1758
|
+
/** Field path for product URL */
|
|
1759
|
+
url?: string;
|
|
1760
|
+
/** Field path for brand name */
|
|
1761
|
+
brand?: string;
|
|
1762
|
+
/** Field path for category */
|
|
1763
|
+
category?: string;
|
|
1764
|
+
/** Field path for rating */
|
|
1765
|
+
rating?: string;
|
|
1766
|
+
/** Field path for review count */
|
|
1767
|
+
reviewCount?: string;
|
|
1768
|
+
/** Field path for discount percentage */
|
|
1769
|
+
discount?: string;
|
|
1770
|
+
/** Field path for availability/in stock */
|
|
1771
|
+
inStock?: string;
|
|
1772
|
+
/** Field path for currency */
|
|
1773
|
+
currency?: string;
|
|
1774
|
+
/** Field path for multiple images */
|
|
1775
|
+
images?: string;
|
|
1776
|
+
/** Field path for original/compare price (alias) */
|
|
1777
|
+
originalPrice?: string;
|
|
1778
|
+
/** Field path for availability */
|
|
1779
|
+
available?: string;
|
|
1780
|
+
/** Field path for product options (Color, Size axes) */
|
|
1781
|
+
options?: string;
|
|
1782
|
+
/** Field path for product variants */
|
|
1783
|
+
variants?: string;
|
|
1784
|
+
/** Field path for product tags */
|
|
1785
|
+
tags?: string;
|
|
1786
|
+
/** Custom field mappings */
|
|
1787
|
+
custom?: Record<string, string>;
|
|
1730
1788
|
}
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
interface CategoriesTabsProps {
|
|
1740
|
-
className?: string;
|
|
1741
|
-
style?: React__default.CSSProperties;
|
|
1742
|
-
tabClassName?: string;
|
|
1789
|
+
/** Maps client's category/tab fields */
|
|
1790
|
+
interface CategoryFieldMapping {
|
|
1791
|
+
id: string;
|
|
1792
|
+
label: string;
|
|
1793
|
+
count?: string;
|
|
1794
|
+
icon?: string;
|
|
1795
|
+
image?: string;
|
|
1743
1796
|
}
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
*/
|
|
1751
|
-
|
|
1752
|
-
interface RecentSearchesListProps {
|
|
1753
|
-
title?: string;
|
|
1754
|
-
maxItems?: number;
|
|
1755
|
-
className?: string;
|
|
1756
|
-
style?: React__default.CSSProperties;
|
|
1757
|
-
listClassName?: string;
|
|
1758
|
-
renderItem?: (search: RecentSearch, index: number, onSelect: () => void) => React__default.ReactNode;
|
|
1797
|
+
/** Maps client's brand fields */
|
|
1798
|
+
interface BrandFieldMapping {
|
|
1799
|
+
id?: string;
|
|
1800
|
+
name: string;
|
|
1801
|
+
logo?: string;
|
|
1802
|
+
count?: string;
|
|
1759
1803
|
}
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
*/
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
style
|
|
1773
|
-
|
|
1774
|
-
|
|
1804
|
+
type DropdownLayout = 'list' | 'two-column' | 'three-column' | 'grid' | 'hero' | 'full-width' | 'mobile-sheet' | 'overlay';
|
|
1805
|
+
type ProductCardSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
1806
|
+
type ProductCardStyle = 'minimal' | 'standard' | 'detailed' | 'compact' | 'horizontal';
|
|
1807
|
+
/** Available dropdown variants */
|
|
1808
|
+
type SuggestionDropdownVariant$1 = 'amazon' | 'google' | 'pinterest' | 'spotlight' | 'shopify' | 'mobile-sheet' | 'minimal';
|
|
1809
|
+
interface VisualConfig {
|
|
1810
|
+
/** Overall dropdown layout */
|
|
1811
|
+
layout?: DropdownLayout;
|
|
1812
|
+
/** Show/hide shadows */
|
|
1813
|
+
shadows?: boolean;
|
|
1814
|
+
/** Border radius (px or CSS value) */
|
|
1815
|
+
borderRadius?: number | string;
|
|
1816
|
+
/** Animation style */
|
|
1817
|
+
animation?: 'none' | 'fade' | 'slide' | 'scale' | 'spring';
|
|
1818
|
+
/** Animation duration in ms */
|
|
1819
|
+
animationDuration?: number;
|
|
1820
|
+
/** Blur background when open */
|
|
1821
|
+
backdropBlur?: boolean;
|
|
1822
|
+
/** Show dividers between sections */
|
|
1823
|
+
showDividers?: boolean;
|
|
1824
|
+
/** Compact mode (reduced padding) */
|
|
1825
|
+
compact?: boolean;
|
|
1775
1826
|
}
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
/**
|
|
1779
|
-
|
|
1780
|
-
*/
|
|
1781
|
-
|
|
1782
|
-
|
|
1827
|
+
type SectionType = 'suggestions' | 'recent' | 'trending' | 'products' | 'categories' | 'brands' | 'collections' | 'pages' | 'custom';
|
|
1828
|
+
interface SectionConfig {
|
|
1829
|
+
/** Section identifier */
|
|
1830
|
+
id: SectionType | string;
|
|
1831
|
+
/** Section title (can be ReactNode for custom rendering) */
|
|
1832
|
+
title?: string | ReactNode;
|
|
1833
|
+
/** Whether section is enabled */
|
|
1834
|
+
enabled?: boolean;
|
|
1835
|
+
/** Maximum items to show */
|
|
1836
|
+
maxItems?: number;
|
|
1837
|
+
/** Section display order (lower = higher) */
|
|
1838
|
+
order?: number;
|
|
1839
|
+
/** Section-specific layout override */
|
|
1840
|
+
layout?: 'list' | 'grid' | 'horizontal-scroll' | 'chips';
|
|
1841
|
+
/** Number of columns for grid layout */
|
|
1842
|
+
columns?: number;
|
|
1843
|
+
/** Show "View All" link */
|
|
1844
|
+
showViewAll?: boolean;
|
|
1845
|
+
/** View All link URL or handler */
|
|
1846
|
+
viewAllLink?: string;
|
|
1847
|
+
/** Custom CSS class */
|
|
1783
1848
|
className?: string;
|
|
1784
|
-
|
|
1785
|
-
|
|
1849
|
+
/** Custom styles */
|
|
1850
|
+
style?: CSSProperties;
|
|
1851
|
+
/** Custom renderer for entire section */
|
|
1852
|
+
render?: (data: any[], config: SectionConfig) => ReactNode;
|
|
1853
|
+
/** Custom renderer for individual items */
|
|
1854
|
+
renderItem?: (item: any, index: number) => ReactNode;
|
|
1855
|
+
/** Empty state message */
|
|
1856
|
+
emptyMessage?: string;
|
|
1857
|
+
/** Icon for section header */
|
|
1858
|
+
icon?: ReactNode;
|
|
1786
1859
|
}
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1860
|
+
interface ProductDisplayConfig {
|
|
1861
|
+
/** Card size */
|
|
1862
|
+
size?: ProductCardSize;
|
|
1863
|
+
/** Card style */
|
|
1864
|
+
style?: ProductCardStyle;
|
|
1865
|
+
/** Show product image */
|
|
1866
|
+
showImage?: boolean;
|
|
1867
|
+
/** Image aspect ratio */
|
|
1868
|
+
imageAspectRatio?: '1:1' | '4:3' | '3:4' | '16:9' | 'auto';
|
|
1869
|
+
/** Show price */
|
|
1870
|
+
showPrice?: boolean;
|
|
1871
|
+
/** Show compare/original price */
|
|
1872
|
+
showComparePrice?: boolean;
|
|
1873
|
+
/** Show discount badge */
|
|
1874
|
+
showDiscount?: boolean;
|
|
1875
|
+
/** Show brand */
|
|
1876
|
+
showBrand?: boolean;
|
|
1877
|
+
/** Show rating */
|
|
1878
|
+
showRating?: boolean;
|
|
1879
|
+
/** Show stock status */
|
|
1880
|
+
showStock?: boolean;
|
|
1881
|
+
/** Show add to cart button */
|
|
1882
|
+
showAddToCart?: boolean;
|
|
1883
|
+
/** Currency symbol */
|
|
1884
|
+
currency?: string;
|
|
1885
|
+
/** Currency position */
|
|
1886
|
+
currencyPosition?: 'before' | 'after';
|
|
1887
|
+
/** Decimal places for price */
|
|
1888
|
+
priceDecimals?: number;
|
|
1889
|
+
/** Truncate title after N lines */
|
|
1890
|
+
titleLines?: number;
|
|
1891
|
+
/** Hover effect */
|
|
1892
|
+
hoverEffect?: 'none' | 'lift' | 'glow' | 'scale' | 'border';
|
|
1893
|
+
/** Image placeholder */
|
|
1894
|
+
imagePlaceholder?: ReactNode;
|
|
1895
|
+
/** Lazy load images */
|
|
1896
|
+
lazyLoadImages?: boolean;
|
|
1897
|
+
/** Show variant swatches on card */
|
|
1898
|
+
showVariants?: boolean;
|
|
1899
|
+
/** Which option names to show as swatches (e.g., ['Color']). Default: all */
|
|
1900
|
+
variantOptionsToShow?: string[];
|
|
1901
|
+
/** Max variant values before "+N more" (default: 5) */
|
|
1902
|
+
maxVariantValues?: number;
|
|
1903
|
+
/** Show price range when variants have different prices */
|
|
1904
|
+
showPriceRange?: boolean;
|
|
1905
|
+
/** Show badges (sale, new, sold out, etc.) */
|
|
1906
|
+
showBadges?: boolean;
|
|
1907
|
+
/** Custom badge extractor from tags */
|
|
1908
|
+
badgeExtractor?: (tags?: string[], product?: any) => _seekora_ai_ui_sdk_types.ProductBadge[];
|
|
1797
1909
|
}
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
*/
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1910
|
+
interface SuggestionDisplayConfig {
|
|
1911
|
+
/** Show search icon */
|
|
1912
|
+
showIcon?: boolean;
|
|
1913
|
+
/** Custom icon */
|
|
1914
|
+
icon?: ReactNode;
|
|
1915
|
+
/** Show hit count */
|
|
1916
|
+
showCount?: boolean;
|
|
1917
|
+
/** Show categories inline */
|
|
1918
|
+
showCategories?: boolean;
|
|
1919
|
+
/** Max categories to show */
|
|
1920
|
+
maxCategories?: number;
|
|
1921
|
+
/** Highlight matching text */
|
|
1922
|
+
highlightMatches?: boolean;
|
|
1923
|
+
/** Highlight style */
|
|
1924
|
+
highlightStyle?: CSSProperties;
|
|
1925
|
+
/** Show arrow on hover */
|
|
1926
|
+
showArrow?: boolean;
|
|
1927
|
+
/** Category click behavior */
|
|
1928
|
+
categoryClickable?: boolean;
|
|
1929
|
+
}
|
|
1930
|
+
interface DropdownThemeConfig {
|
|
1931
|
+
/** Light/dark mode */
|
|
1932
|
+
mode?: 'light' | 'dark' | 'auto';
|
|
1933
|
+
/** Primary brand color */
|
|
1934
|
+
primaryColor?: string;
|
|
1935
|
+
/** Background color */
|
|
1936
|
+
backgroundColor?: string;
|
|
1937
|
+
/** Surface color (cards, sections) */
|
|
1938
|
+
surfaceColor?: string;
|
|
1939
|
+
/** Text color */
|
|
1940
|
+
textColor?: string;
|
|
1941
|
+
/** Secondary text color */
|
|
1942
|
+
textSecondaryColor?: string;
|
|
1943
|
+
/** Border color */
|
|
1944
|
+
borderColor?: string;
|
|
1945
|
+
/** Hover background */
|
|
1946
|
+
hoverColor?: string;
|
|
1947
|
+
/** Highlight/match color */
|
|
1948
|
+
highlightColor?: string;
|
|
1949
|
+
/** Success color (in stock, etc.) */
|
|
1950
|
+
successColor?: string;
|
|
1951
|
+
/** Error color (out of stock, etc.) */
|
|
1952
|
+
errorColor?: string;
|
|
1953
|
+
/** Font family */
|
|
1954
|
+
fontFamily?: string;
|
|
1955
|
+
/** Base font size */
|
|
1956
|
+
fontSize?: number | string;
|
|
1957
|
+
/** Border radius */
|
|
1958
|
+
borderRadius?: number | string;
|
|
1959
|
+
/** Box shadow */
|
|
1960
|
+
boxShadow?: string;
|
|
1961
|
+
/** Custom CSS variables */
|
|
1962
|
+
cssVariables?: Record<string, string>;
|
|
1963
|
+
}
|
|
1964
|
+
interface AnalyticsConfig {
|
|
1965
|
+
/** Enable analytics */
|
|
1966
|
+
enabled?: boolean;
|
|
1967
|
+
/** Track suggestion clicks */
|
|
1968
|
+
trackSuggestionClicks?: boolean;
|
|
1969
|
+
/** Track product clicks */
|
|
1970
|
+
trackProductClicks?: boolean;
|
|
1971
|
+
/** Track impressions */
|
|
1972
|
+
trackImpressions?: boolean;
|
|
1973
|
+
/** Impression debounce time (ms) */
|
|
1974
|
+
impressionDebounce?: number;
|
|
1975
|
+
/** Track category clicks */
|
|
1976
|
+
trackCategoryClicks?: boolean;
|
|
1977
|
+
/** Track brand clicks */
|
|
1978
|
+
trackBrandClicks?: boolean;
|
|
1979
|
+
/** Track search submissions */
|
|
1980
|
+
trackSearchSubmit?: boolean;
|
|
1981
|
+
/** Custom analytics tags */
|
|
1982
|
+
tags?: string[];
|
|
1983
|
+
/** User ID for personalization */
|
|
1984
|
+
userId?: string;
|
|
1985
|
+
/** Session ID */
|
|
1986
|
+
sessionId?: string;
|
|
1987
|
+
/** Custom event handler */
|
|
1988
|
+
onEvent?: (eventType: string, data: any) => void;
|
|
1989
|
+
}
|
|
1990
|
+
interface DropdownEventHandlers<TSuggestion = any, TProduct = any, TCategory = any, TBrand = any> {
|
|
1991
|
+
/** Suggestion selected */
|
|
1992
|
+
onSuggestionSelect?: (suggestion: TSuggestion, index: number) => void;
|
|
1993
|
+
/** Product clicked */
|
|
1994
|
+
onProductClick?: (product: TProduct, index: number) => void;
|
|
1995
|
+
/** Category clicked */
|
|
1996
|
+
onCategoryClick?: (category: TCategory, suggestion?: TSuggestion) => void;
|
|
1997
|
+
/** Brand clicked */
|
|
1998
|
+
onBrandClick?: (brand: TBrand) => void;
|
|
1999
|
+
/** Tab/filter changed */
|
|
2000
|
+
onTabChange?: (tabId: string, tab?: any) => void;
|
|
2001
|
+
/** Recent search clicked */
|
|
2002
|
+
onRecentClick?: (query: string) => void;
|
|
2003
|
+
/** Recent search removed */
|
|
2004
|
+
onRecentRemove?: (query: string) => void;
|
|
2005
|
+
/** Clear all recent searches */
|
|
2006
|
+
onRecentClearAll?: () => void;
|
|
2007
|
+
/** View all clicked */
|
|
2008
|
+
onViewAll?: (section: SectionType | string) => void;
|
|
2009
|
+
/** Search submitted */
|
|
2010
|
+
onSearchSubmit?: (query: string) => void;
|
|
2011
|
+
/** Dropdown opened */
|
|
2012
|
+
onOpen?: () => void;
|
|
2013
|
+
/** Dropdown closed */
|
|
2014
|
+
onClose?: () => void;
|
|
2015
|
+
/** Keyboard navigation */
|
|
2016
|
+
onNavigate?: (direction: 'up' | 'down' | 'left' | 'right', index: number) => void;
|
|
2017
|
+
/** Add to cart clicked (if enabled) */
|
|
2018
|
+
onAddToCart?: (product: TProduct) => void;
|
|
2019
|
+
}
|
|
2020
|
+
interface AccessibilityConfig {
|
|
2021
|
+
/** ARIA label for dropdown */
|
|
2022
|
+
ariaLabel?: string;
|
|
2023
|
+
/** ARIA labelledby */
|
|
2024
|
+
ariaLabelledBy?: string;
|
|
2025
|
+
/** Announce selection to screen readers */
|
|
2026
|
+
announceSelection?: boolean;
|
|
2027
|
+
/** Custom announcement text */
|
|
2028
|
+
getAnnouncementText?: (item: any, type: string) => string;
|
|
2029
|
+
/** Keyboard navigation enabled */
|
|
2030
|
+
keyboardNavigation?: boolean;
|
|
2031
|
+
/** Focus trap (keep focus within dropdown) */
|
|
2032
|
+
focusTrap?: boolean;
|
|
2033
|
+
/** Auto focus first item */
|
|
2034
|
+
autoFocus?: boolean;
|
|
2035
|
+
/** Close on escape */
|
|
2036
|
+
closeOnEscape?: boolean;
|
|
2037
|
+
/** Close on click outside */
|
|
2038
|
+
closeOnClickOutside?: boolean;
|
|
2039
|
+
}
|
|
2040
|
+
interface BaseDropdownProps<TSuggestion = any, TProduct = any, TCategory = any, TBrand = any> extends DropdownEventHandlers<TSuggestion, TProduct, TCategory, TBrand> {
|
|
2041
|
+
/** Current search query */
|
|
2042
|
+
query: string;
|
|
2043
|
+
/** Whether dropdown is open/visible */
|
|
2044
|
+
isOpen?: boolean;
|
|
2045
|
+
/** Loading state */
|
|
2046
|
+
loading?: boolean;
|
|
2047
|
+
/** Error state */
|
|
2048
|
+
error?: Error | string | null;
|
|
2049
|
+
/** Suggestion items */
|
|
2050
|
+
suggestions?: TSuggestion[];
|
|
2051
|
+
/** Product items */
|
|
2052
|
+
products?: TProduct[];
|
|
2053
|
+
/** Category/filter tabs */
|
|
2054
|
+
categories?: TCategory[];
|
|
2055
|
+
/** Brand items */
|
|
2056
|
+
brands?: TBrand[];
|
|
2057
|
+
/** Recent searches (strings or objects) */
|
|
2058
|
+
recentSearches?: string[] | Array<{
|
|
2059
|
+
query: string;
|
|
2060
|
+
timestamp?: number;
|
|
2061
|
+
}>;
|
|
2062
|
+
/** Trending searches */
|
|
2063
|
+
trendingSearches?: string[] | TSuggestion[];
|
|
2064
|
+
/** Filtered tabs with products */
|
|
2065
|
+
filteredTabs?: Array<{
|
|
2066
|
+
id: string;
|
|
2067
|
+
label: string;
|
|
2068
|
+
products?: TProduct[];
|
|
2069
|
+
nb_hits?: number;
|
|
2070
|
+
filter?: string;
|
|
2071
|
+
}>;
|
|
2072
|
+
/** Currently active tab ID */
|
|
2073
|
+
activeTab?: string;
|
|
2074
|
+
/** Map suggestion data fields */
|
|
2075
|
+
suggestionFields?: SuggestionFieldMapping;
|
|
2076
|
+
/** Map product data fields */
|
|
2077
|
+
productFields?: ProductFieldMapping;
|
|
2078
|
+
/** Map category data fields */
|
|
2079
|
+
categoryFields?: CategoryFieldMapping;
|
|
2080
|
+
/** Map brand data fields */
|
|
2081
|
+
brandFields?: BrandFieldMapping;
|
|
2082
|
+
/** Section configurations */
|
|
2083
|
+
sections?: SectionConfig[];
|
|
2084
|
+
/** Product display config */
|
|
2085
|
+
productDisplay?: ProductDisplayConfig;
|
|
2086
|
+
/** Suggestion display config */
|
|
2087
|
+
suggestionDisplay?: SuggestionDisplayConfig;
|
|
2088
|
+
/** Visual/layout config */
|
|
2089
|
+
visual?: VisualConfig;
|
|
2090
|
+
/** Theme config */
|
|
2091
|
+
theme?: DropdownThemeConfig;
|
|
2092
|
+
/** Analytics config */
|
|
2093
|
+
analytics?: AnalyticsConfig;
|
|
2094
|
+
/** Accessibility config */
|
|
2095
|
+
accessibility?: AccessibilityConfig;
|
|
2096
|
+
/** Dropdown width */
|
|
2097
|
+
width?: string | number;
|
|
2098
|
+
/** Dropdown max height */
|
|
2099
|
+
maxHeight?: string | number;
|
|
2100
|
+
/** Dropdown min height */
|
|
2101
|
+
minHeight?: string | number;
|
|
2102
|
+
/** Z-index */
|
|
2103
|
+
zIndex?: number;
|
|
2104
|
+
/** Root CSS class */
|
|
2105
|
+
className?: string;
|
|
2106
|
+
/** Root inline styles */
|
|
2107
|
+
style?: CSSProperties;
|
|
2108
|
+
/** CSS classes for parts */
|
|
2109
|
+
classNames?: Partial<DropdownClassNames>;
|
|
2110
|
+
/** Inline styles for parts */
|
|
2111
|
+
styles?: Partial<DropdownStyles>;
|
|
2112
|
+
/** Custom header */
|
|
2113
|
+
header?: ReactNode;
|
|
2114
|
+
/** Custom footer */
|
|
2115
|
+
footer?: ReactNode;
|
|
2116
|
+
/** Custom loading state */
|
|
2117
|
+
renderLoading?: () => ReactNode;
|
|
2118
|
+
/** Custom empty state */
|
|
2119
|
+
renderEmpty?: (query: string) => ReactNode;
|
|
2120
|
+
/** Custom error state */
|
|
2121
|
+
renderError?: (error: Error | string) => ReactNode;
|
|
2122
|
+
/** Reference to input element (for focus management) */
|
|
2123
|
+
inputRef?: React.RefObject<HTMLInputElement>;
|
|
2124
|
+
}
|
|
2125
|
+
interface DropdownClassNames {
|
|
2126
|
+
root: string;
|
|
2127
|
+
container: string;
|
|
2128
|
+
header: string;
|
|
2129
|
+
content: string;
|
|
2130
|
+
footer: string;
|
|
2131
|
+
section: string;
|
|
2132
|
+
sectionHeader: string;
|
|
2133
|
+
sectionTitle: string;
|
|
2134
|
+
sectionContent: string;
|
|
2135
|
+
sectionViewAll: string;
|
|
2136
|
+
suggestionsList: string;
|
|
2137
|
+
suggestionItem: string;
|
|
2138
|
+
suggestionItemActive: string;
|
|
2139
|
+
suggestionIcon: string;
|
|
2140
|
+
suggestionText: string;
|
|
2141
|
+
suggestionHighlight: string;
|
|
2142
|
+
suggestionCount: string;
|
|
2143
|
+
suggestionCategories: string;
|
|
2144
|
+
suggestionCategory: string;
|
|
2145
|
+
suggestionArrow: string;
|
|
2146
|
+
productsList: string;
|
|
2147
|
+
productCard: string;
|
|
2148
|
+
productCardHover: string;
|
|
2149
|
+
productImage: string;
|
|
2150
|
+
productImagePlaceholder: string;
|
|
2151
|
+
productInfo: string;
|
|
2152
|
+
productTitle: string;
|
|
2153
|
+
productBrand: string;
|
|
2154
|
+
productPrice: string;
|
|
2155
|
+
productComparePrice: string;
|
|
2156
|
+
productDiscount: string;
|
|
2157
|
+
productRating: string;
|
|
2158
|
+
productStock: string;
|
|
2159
|
+
productAddToCart: string;
|
|
2160
|
+
categoriesList: string;
|
|
2161
|
+
categoryItem: string;
|
|
2162
|
+
categoryItemActive: string;
|
|
2163
|
+
categoryIcon: string;
|
|
2164
|
+
categoryLabel: string;
|
|
2165
|
+
categoryCount: string;
|
|
2166
|
+
brandsList: string;
|
|
2167
|
+
brandItem: string;
|
|
2168
|
+
brandLogo: string;
|
|
2169
|
+
brandName: string;
|
|
2170
|
+
recentList: string;
|
|
2171
|
+
recentItem: string;
|
|
2172
|
+
recentIcon: string;
|
|
2173
|
+
recentText: string;
|
|
2174
|
+
recentRemove: string;
|
|
2175
|
+
recentClearAll: string;
|
|
2176
|
+
trendingList: string;
|
|
2177
|
+
trendingItem: string;
|
|
2178
|
+
trendingIcon: string;
|
|
2179
|
+
tabsList: string;
|
|
2180
|
+
tabItem: string;
|
|
2181
|
+
tabItemActive: string;
|
|
2182
|
+
tabCount: string;
|
|
2183
|
+
loading: string;
|
|
2184
|
+
loadingSpinner: string;
|
|
2185
|
+
empty: string;
|
|
2186
|
+
emptyIcon: string;
|
|
2187
|
+
emptyText: string;
|
|
2188
|
+
error: string;
|
|
2189
|
+
errorIcon: string;
|
|
2190
|
+
errorText: string;
|
|
2191
|
+
keyboard: string;
|
|
2192
|
+
keyboardHint: string;
|
|
2193
|
+
keyboardKey: string;
|
|
2194
|
+
}
|
|
2195
|
+
interface DropdownStyles {
|
|
2196
|
+
root: CSSProperties;
|
|
2197
|
+
container: CSSProperties;
|
|
2198
|
+
header: CSSProperties;
|
|
2199
|
+
content: CSSProperties;
|
|
2200
|
+
footer: CSSProperties;
|
|
2201
|
+
section: CSSProperties;
|
|
2202
|
+
suggestionItem: CSSProperties;
|
|
2203
|
+
productCard: CSSProperties;
|
|
2204
|
+
categoryItem: CSSProperties;
|
|
2205
|
+
brandItem: CSSProperties;
|
|
2206
|
+
}
|
|
2207
|
+
interface DropdownRef {
|
|
2208
|
+
/** Get currently active/focused index */
|
|
2209
|
+
getActiveIndex: () => number;
|
|
2210
|
+
/** Set active index */
|
|
2211
|
+
setActiveIndex: (index: number) => void;
|
|
2212
|
+
/** Select currently active item */
|
|
2213
|
+
selectActive: () => void;
|
|
2214
|
+
/** Navigate to next item */
|
|
2215
|
+
navigateNext: () => void;
|
|
2216
|
+
/** Navigate to previous item */
|
|
2217
|
+
navigatePrevious: () => void;
|
|
2218
|
+
/** Focus the dropdown */
|
|
2219
|
+
focus: () => void;
|
|
2220
|
+
/** Close the dropdown */
|
|
2221
|
+
close: () => void;
|
|
2222
|
+
/** Get active tab ID (if tabs exist) */
|
|
2223
|
+
getActiveTab?: () => string | null;
|
|
2224
|
+
/** Set active tab */
|
|
2225
|
+
setActiveTab?: (tabId: string) => void;
|
|
2226
|
+
/** Scroll to item */
|
|
2227
|
+
scrollToItem?: (index: number) => void;
|
|
1820
2228
|
}
|
|
1821
|
-
declare function SuggestionsDropdownComposition({ showRecentSearches, showTrending, showTabs, showProducts, placeholder, ...providerProps }: SuggestionsDropdownCompositionProps): React__default.JSX.Element;
|
|
1822
2229
|
|
|
1823
2230
|
/**
|
|
1824
|
-
*
|
|
2231
|
+
* ProductCard – one product tile (primitive)
|
|
1825
2232
|
*
|
|
1826
|
-
*
|
|
1827
|
-
*
|
|
2233
|
+
* Without displayConfig: renders the original minimal layout (image, title, price).
|
|
2234
|
+
* With displayConfig: renders layout variants (minimal, standard, detailed, compact, horizontal).
|
|
1828
2235
|
*/
|
|
1829
2236
|
|
|
1830
|
-
type
|
|
1831
|
-
interface
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
2237
|
+
type ProductCardImageVariant = 'single' | 'carousel' | 'hover' | 'thumbStrip' | 'thumbList';
|
|
2238
|
+
interface ProductCardProps {
|
|
2239
|
+
product: ProductItem;
|
|
2240
|
+
position: number;
|
|
2241
|
+
section?: string;
|
|
2242
|
+
tabId?: string;
|
|
2243
|
+
onSelect: () => void;
|
|
1835
2244
|
className?: string;
|
|
1836
2245
|
style?: React__default.CSSProperties;
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
2246
|
+
imageVariant?: ProductCardImageVariant;
|
|
2247
|
+
/** Product display configuration for layout variants */
|
|
2248
|
+
displayConfig?: ProductDisplayConfig;
|
|
2249
|
+
/** Callback when a variant swatch is hovered (e.g., to swap card image) */
|
|
2250
|
+
onVariantHover?: (optionName: string, value: string) => void;
|
|
2251
|
+
/** Callback when a variant swatch is clicked (e.g., to swap card image permanently) */
|
|
2252
|
+
onVariantClick?: (optionName: string, value: string) => void;
|
|
2253
|
+
/** Currently selected variant values (e.g., { Color: 'Black', Size: 'M' }) */
|
|
2254
|
+
selectedVariants?: Record<string, string>;
|
|
2255
|
+
/** Render as link when true and product.url exists */
|
|
2256
|
+
asLink?: boolean;
|
|
2257
|
+
/** Action buttons (add to cart, wishlist, etc.) */
|
|
2258
|
+
actionButtons?: ActionButton[];
|
|
2259
|
+
/** Action buttons position */
|
|
2260
|
+
actionButtonsPosition?: 'overlay-top-right' | 'overlay-bottom' | 'inline';
|
|
2261
|
+
/** Show action button labels */
|
|
2262
|
+
showActionLabels?: boolean;
|
|
2263
|
+
/** Enable image zoom functionality */
|
|
2264
|
+
enableImageZoom?: boolean;
|
|
2265
|
+
/** Image zoom mode: 'hover' (Amazon-style), 'lens', 'click' (lightbox), 'both' (hover + click) */
|
|
2266
|
+
imageZoomMode?: 'hover' | 'lens' | 'click' | 'both';
|
|
2267
|
+
/** Image zoom magnification level (2 = 200%, 3 = 300%) */
|
|
2268
|
+
imageZoomLevel?: number;
|
|
2269
|
+
}
|
|
2270
|
+
declare function ProductCard({ product, position, section, tabId, onSelect, className, style, imageVariant, displayConfig, onVariantHover, onVariantClick, selectedVariants, asLink, actionButtons, actionButtonsPosition, showActionLabels, enableImageZoom, imageZoomMode, imageZoomLevel, }: ProductCardProps): React__default.JSX.Element;
|
|
1841
2271
|
|
|
1842
2272
|
/**
|
|
1843
|
-
*
|
|
2273
|
+
* ProductGrid – grid of product cards from context (primitive)
|
|
1844
2274
|
*
|
|
1845
|
-
*
|
|
1846
|
-
* query/filters change. Does not use global SearchStateManager. Use for menus,
|
|
1847
|
-
* sidebar, front-page blocks (e.g. "New arrivals", "On sale").
|
|
2275
|
+
* Uses trendingProducts or active tab products; each click calls context selectProduct.
|
|
1848
2276
|
*/
|
|
1849
2277
|
|
|
1850
|
-
interface
|
|
1851
|
-
field: string;
|
|
1852
|
-
value: string;
|
|
1853
|
-
}
|
|
1854
|
-
interface SectionSearchProviderProps {
|
|
1855
|
-
children: React__default.ReactNode;
|
|
1856
|
-
query: string;
|
|
1857
|
-
refinements?: RefinementInput[];
|
|
2278
|
+
interface ProductGridProps {
|
|
1858
2279
|
maxItems?: number;
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
2280
|
+
/** 'trending' | tab id for filtered tab products */
|
|
2281
|
+
source?: 'trending' | string;
|
|
2282
|
+
columns?: number;
|
|
2283
|
+
className?: string;
|
|
2284
|
+
style?: React__default.CSSProperties;
|
|
2285
|
+
gridClassName?: string;
|
|
2286
|
+
/** Product display configuration passed through to each ProductCard */
|
|
2287
|
+
displayConfig?: ProductDisplayConfig;
|
|
2288
|
+
/** Callback when a variant swatch is hovered on a card */
|
|
2289
|
+
onVariantHover?: (optionName: string, value: string) => void;
|
|
1862
2290
|
}
|
|
1863
|
-
declare function
|
|
2291
|
+
declare function ProductGrid({ maxItems, source, columns, className, style, gridClassName, displayConfig, onVariantHover, }: ProductGridProps): React__default.JSX.Element | null;
|
|
1864
2292
|
|
|
1865
2293
|
/**
|
|
1866
|
-
*
|
|
2294
|
+
* CategoriesTabs – horizontal tabs (e.g. filtered tabs) (primitive)
|
|
1867
2295
|
*
|
|
1868
|
-
*
|
|
2296
|
+
* Active tab from context; on select updates context and tracks analytics.
|
|
1869
2297
|
*/
|
|
1870
2298
|
|
|
1871
|
-
interface
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
totalCount: number;
|
|
1876
|
-
sectionId?: string;
|
|
1877
|
-
trackClick: (item: unknown, position: number) => void;
|
|
2299
|
+
interface CategoriesTabsProps {
|
|
2300
|
+
className?: string;
|
|
2301
|
+
style?: React__default.CSSProperties;
|
|
2302
|
+
tabClassName?: string;
|
|
1878
2303
|
}
|
|
1879
|
-
declare function
|
|
2304
|
+
declare function CategoriesTabs({ className, style, tabClassName }: CategoriesTabsProps): React__default.JSX.Element | null;
|
|
1880
2305
|
|
|
1881
2306
|
/**
|
|
1882
|
-
*
|
|
2307
|
+
* RecentSearchesList – list of recent queries (primitive)
|
|
2308
|
+
*
|
|
2309
|
+
* Reads recentSearches from context; each click calls selectRecentSearch. Optional title/render.
|
|
1883
2310
|
*/
|
|
1884
2311
|
|
|
1885
|
-
interface
|
|
1886
|
-
|
|
2312
|
+
interface RecentSearchesListProps {
|
|
2313
|
+
title?: string;
|
|
1887
2314
|
maxItems?: number;
|
|
1888
2315
|
className?: string;
|
|
1889
2316
|
style?: React__default.CSSProperties;
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
getItemImage?: (item: unknown) => string | undefined;
|
|
1893
|
-
getItemDescription?: (item: unknown) => string | undefined;
|
|
1894
|
-
getItemUrl?: (item: unknown) => string | undefined;
|
|
1895
|
-
renderItem?: (item: unknown, index: number) => React__default.ReactNode;
|
|
2317
|
+
listClassName?: string;
|
|
2318
|
+
renderItem?: (search: RecentSearch, index: number, onSelect: () => void) => React__default.ReactNode;
|
|
1896
2319
|
}
|
|
1897
|
-
declare function
|
|
2320
|
+
declare function RecentSearchesList({ title, maxItems, className, style, listClassName, renderItem, }: RecentSearchesListProps): React__default.JSX.Element | null;
|
|
1898
2321
|
|
|
1899
2322
|
/**
|
|
1900
|
-
*
|
|
2323
|
+
* TrendingList – list of trending searches (primitive)
|
|
2324
|
+
*
|
|
2325
|
+
* Reads trendingSearches from context; each click calls selectTrendingSearch. Optional title/render.
|
|
1901
2326
|
*/
|
|
1902
2327
|
|
|
1903
|
-
interface
|
|
2328
|
+
interface TrendingListProps {
|
|
2329
|
+
title?: string;
|
|
2330
|
+
maxItems?: number;
|
|
1904
2331
|
className?: string;
|
|
1905
2332
|
style?: React__default.CSSProperties;
|
|
1906
|
-
|
|
2333
|
+
listClassName?: string;
|
|
2334
|
+
renderItem?: (trending: TrendingSearch, index: number, onSelect: () => void) => React__default.ReactNode;
|
|
1907
2335
|
}
|
|
1908
|
-
declare function
|
|
2336
|
+
declare function TrendingList({ title, maxItems, className, style, listClassName, renderItem, }: TrendingListProps): React__default.JSX.Element | null;
|
|
1909
2337
|
|
|
1910
2338
|
/**
|
|
1911
|
-
*
|
|
2339
|
+
* SuggestionsLoading – loading indicator (primitive)
|
|
1912
2340
|
*/
|
|
1913
2341
|
|
|
1914
|
-
interface
|
|
2342
|
+
interface SuggestionsLoadingProps {
|
|
1915
2343
|
className?: string;
|
|
1916
2344
|
style?: React__default.CSSProperties;
|
|
1917
|
-
|
|
2345
|
+
text?: string;
|
|
1918
2346
|
}
|
|
1919
|
-
declare function
|
|
2347
|
+
declare function SuggestionsLoading({ className, style, text }: SuggestionsLoadingProps): React__default.JSX.Element | null;
|
|
1920
2348
|
|
|
1921
2349
|
/**
|
|
1922
|
-
*
|
|
1923
|
-
*
|
|
1924
|
-
* Uses ImageDisplay with configurable variant (carousel, thumbStrip, etc.).
|
|
1925
|
-
* For use on individual product page.
|
|
2350
|
+
* SuggestionsError – error message (primitive)
|
|
1926
2351
|
*/
|
|
1927
2352
|
|
|
1928
|
-
interface
|
|
1929
|
-
images: string[];
|
|
1930
|
-
variant?: ImageDisplayVariant;
|
|
1931
|
-
alt?: string;
|
|
2353
|
+
interface SuggestionsErrorProps {
|
|
1932
2354
|
className?: string;
|
|
1933
2355
|
style?: React__default.CSSProperties;
|
|
1934
|
-
|
|
1935
|
-
carouselIntervalMs?: number;
|
|
2356
|
+
render?: (error: Error) => React__default.ReactNode;
|
|
1936
2357
|
}
|
|
1937
|
-
declare function
|
|
2358
|
+
declare function SuggestionsError({ className, style, render }: SuggestionsErrorProps): React__default.JSX.Element | null;
|
|
1938
2359
|
|
|
1939
2360
|
/**
|
|
1940
|
-
*
|
|
2361
|
+
* SuggestionsDropdownComposition – reference composition
|
|
1941
2362
|
*
|
|
1942
|
-
*
|
|
1943
|
-
*
|
|
2363
|
+
* Example layout built from primitives: SearchInput + DropdownPanel containing
|
|
2364
|
+
* RecentSearchesList (when query empty), SuggestionList, CategoriesTabs, ProductGrid, TrendingList.
|
|
2365
|
+
* Wrap with SearchProvider and SuggestionsProvider. Use as reference or replace
|
|
2366
|
+
* with your own arrangement of the same primitives.
|
|
1944
2367
|
*/
|
|
1945
2368
|
|
|
1946
|
-
interface
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
/**
|
|
1952
|
-
|
|
1953
|
-
/**
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
2369
|
+
interface SuggestionsDropdownCompositionProps extends Omit<SuggestionsProviderProps, 'children'> {
|
|
2370
|
+
/** Show recent searches when query is empty */
|
|
2371
|
+
showRecentSearches?: boolean;
|
|
2372
|
+
/** Show trending list */
|
|
2373
|
+
showTrending?: boolean;
|
|
2374
|
+
/** Show categories/filtered tabs */
|
|
2375
|
+
showTabs?: boolean;
|
|
2376
|
+
/** Show product grid */
|
|
2377
|
+
showProducts?: boolean;
|
|
2378
|
+
/** SearchInput placeholder */
|
|
2379
|
+
placeholder?: string;
|
|
1957
2380
|
}
|
|
1958
|
-
declare function
|
|
2381
|
+
declare function SuggestionsDropdownComposition({ showRecentSearches, showTrending, showTabs, showProducts, placeholder, ...providerProps }: SuggestionsDropdownCompositionProps): React__default.JSX.Element;
|
|
1959
2382
|
|
|
1960
2383
|
/**
|
|
1961
|
-
*
|
|
2384
|
+
* ImageZoom – zoom on hover and click (Amazon-style magnifier + lightbox)
|
|
1962
2385
|
*
|
|
1963
|
-
*
|
|
1964
|
-
*
|
|
1965
|
-
*
|
|
2386
|
+
* Supports three zoom modes:
|
|
2387
|
+
* - hover: Magnified view in a separate panel on the right (Amazon style)
|
|
2388
|
+
* - lens: Magnifying glass that follows cursor
|
|
2389
|
+
* - click: Full-screen lightbox modal
|
|
1966
2390
|
*/
|
|
1967
2391
|
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
2392
|
+
type ImageZoomMode = 'hover' | 'lens' | 'click' | 'both';
|
|
2393
|
+
interface ImageZoomProps {
|
|
2394
|
+
src: string;
|
|
2395
|
+
alt?: string;
|
|
2396
|
+
mode?: ImageZoomMode;
|
|
2397
|
+
zoomLevel?: number;
|
|
1974
2398
|
className?: string;
|
|
1975
2399
|
style?: React__default.CSSProperties;
|
|
1976
|
-
|
|
2400
|
+
/** Show zoom indicator icon */
|
|
2401
|
+
showZoomIndicator?: boolean;
|
|
2402
|
+
/** Lens size in pixels (for lens mode) */
|
|
2403
|
+
lensSize?: number;
|
|
2404
|
+
/** Zoom panel size (for hover mode) */
|
|
2405
|
+
zoomPanelSize?: {
|
|
2406
|
+
width: number;
|
|
2407
|
+
height: number;
|
|
2408
|
+
};
|
|
2409
|
+
/** Multiple images for lightbox carousel */
|
|
2410
|
+
images?: string[];
|
|
2411
|
+
/** Current image index (for multi-image support) */
|
|
2412
|
+
currentIndex?: number;
|
|
1977
2413
|
}
|
|
1978
|
-
declare function
|
|
2414
|
+
declare function ImageZoom({ src, alt, mode, zoomLevel, className, style, showZoomIndicator, lensSize, zoomPanelSize, images, currentIndex, }: ImageZoomProps): React__default.JSX.Element;
|
|
1979
2415
|
|
|
1980
2416
|
/**
|
|
1981
|
-
*
|
|
2417
|
+
* ImageDisplay – configurable multi-image display (primitive)
|
|
1982
2418
|
*
|
|
1983
|
-
*
|
|
2419
|
+
* Variants: single, carousel, hover, thumbStrip, thumbList. Use in ItemCard,
|
|
2420
|
+
* ProductCard, ProductGallery. Overridable via className/style.
|
|
1984
2421
|
*/
|
|
1985
2422
|
|
|
1986
|
-
|
|
1987
|
-
interface
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
count?: string;
|
|
1992
|
-
/** Field path for object ID */
|
|
1993
|
-
id?: string;
|
|
1994
|
-
/** Field path for categories array */
|
|
1995
|
-
categories?: string;
|
|
1996
|
-
/** Field path for highlighted text */
|
|
1997
|
-
highlighted?: string;
|
|
1998
|
-
/** Custom field mappings */
|
|
1999
|
-
custom?: Record<string, string>;
|
|
2000
|
-
}
|
|
2001
|
-
/** Maps client's product fields to component expected fields */
|
|
2002
|
-
interface ProductFieldMapping {
|
|
2003
|
-
/** Field path for product ID */
|
|
2004
|
-
id: string;
|
|
2005
|
-
/** Field path for product title/name */
|
|
2006
|
-
title: string;
|
|
2007
|
-
/** Field path for product image URL */
|
|
2008
|
-
image?: string;
|
|
2009
|
-
/** Field path for product price */
|
|
2010
|
-
price?: string;
|
|
2011
|
-
/** Field path for original/compare price */
|
|
2012
|
-
comparePrice?: string;
|
|
2013
|
-
/** Field path for product URL */
|
|
2014
|
-
url?: string;
|
|
2015
|
-
/** Field path for brand name */
|
|
2016
|
-
brand?: string;
|
|
2017
|
-
/** Field path for category */
|
|
2018
|
-
category?: string;
|
|
2019
|
-
/** Field path for rating */
|
|
2020
|
-
rating?: string;
|
|
2021
|
-
/** Field path for review count */
|
|
2022
|
-
reviewCount?: string;
|
|
2023
|
-
/** Field path for discount percentage */
|
|
2024
|
-
discount?: string;
|
|
2025
|
-
/** Field path for availability/in stock */
|
|
2026
|
-
inStock?: string;
|
|
2027
|
-
/** Field path for currency */
|
|
2028
|
-
currency?: string;
|
|
2029
|
-
/** Custom field mappings */
|
|
2030
|
-
custom?: Record<string, string>;
|
|
2031
|
-
}
|
|
2032
|
-
/** Maps client's category/tab fields */
|
|
2033
|
-
interface CategoryFieldMapping {
|
|
2034
|
-
id: string;
|
|
2035
|
-
label: string;
|
|
2036
|
-
count?: string;
|
|
2037
|
-
icon?: string;
|
|
2038
|
-
image?: string;
|
|
2039
|
-
}
|
|
2040
|
-
/** Maps client's brand fields */
|
|
2041
|
-
interface BrandFieldMapping {
|
|
2042
|
-
id?: string;
|
|
2043
|
-
name: string;
|
|
2044
|
-
logo?: string;
|
|
2045
|
-
count?: string;
|
|
2046
|
-
}
|
|
2047
|
-
type DropdownLayout = 'list' | 'two-column' | 'three-column' | 'grid' | 'hero' | 'full-width' | 'mobile-sheet' | 'overlay';
|
|
2048
|
-
type ProductCardSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2049
|
-
type ProductCardStyle = 'minimal' | 'standard' | 'detailed' | 'compact' | 'horizontal';
|
|
2050
|
-
/** Available dropdown variants */
|
|
2051
|
-
type SuggestionDropdownVariant$1 = 'amazon' | 'google' | 'pinterest' | 'spotlight' | 'shopify' | 'mobile-sheet' | 'minimal';
|
|
2052
|
-
interface VisualConfig {
|
|
2053
|
-
/** Overall dropdown layout */
|
|
2054
|
-
layout?: DropdownLayout;
|
|
2055
|
-
/** Show/hide shadows */
|
|
2056
|
-
shadows?: boolean;
|
|
2057
|
-
/** Border radius (px or CSS value) */
|
|
2058
|
-
borderRadius?: number | string;
|
|
2059
|
-
/** Animation style */
|
|
2060
|
-
animation?: 'none' | 'fade' | 'slide' | 'scale' | 'spring';
|
|
2061
|
-
/** Animation duration in ms */
|
|
2062
|
-
animationDuration?: number;
|
|
2063
|
-
/** Blur background when open */
|
|
2064
|
-
backdropBlur?: boolean;
|
|
2065
|
-
/** Show dividers between sections */
|
|
2066
|
-
showDividers?: boolean;
|
|
2067
|
-
/** Compact mode (reduced padding) */
|
|
2068
|
-
compact?: boolean;
|
|
2069
|
-
}
|
|
2070
|
-
type SectionType = 'suggestions' | 'recent' | 'trending' | 'products' | 'categories' | 'brands' | 'collections' | 'pages' | 'custom';
|
|
2071
|
-
interface SectionConfig {
|
|
2072
|
-
/** Section identifier */
|
|
2073
|
-
id: SectionType | string;
|
|
2074
|
-
/** Section title (can be ReactNode for custom rendering) */
|
|
2075
|
-
title?: string | ReactNode;
|
|
2076
|
-
/** Whether section is enabled */
|
|
2077
|
-
enabled?: boolean;
|
|
2078
|
-
/** Maximum items to show */
|
|
2079
|
-
maxItems?: number;
|
|
2080
|
-
/** Section display order (lower = higher) */
|
|
2081
|
-
order?: number;
|
|
2082
|
-
/** Section-specific layout override */
|
|
2083
|
-
layout?: 'list' | 'grid' | 'horizontal-scroll' | 'chips';
|
|
2084
|
-
/** Number of columns for grid layout */
|
|
2085
|
-
columns?: number;
|
|
2086
|
-
/** Show "View All" link */
|
|
2087
|
-
showViewAll?: boolean;
|
|
2088
|
-
/** View All link URL or handler */
|
|
2089
|
-
viewAllLink?: string;
|
|
2090
|
-
/** Custom CSS class */
|
|
2423
|
+
type ImageDisplayVariant = 'single' | 'carousel' | 'hover' | 'thumbStrip' | 'thumbList';
|
|
2424
|
+
interface ImageDisplayProps {
|
|
2425
|
+
images: string[];
|
|
2426
|
+
variant?: ImageDisplayVariant;
|
|
2427
|
+
alt?: string;
|
|
2091
2428
|
className?: string;
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
interface ProductDisplayConfig {
|
|
2104
|
-
/** Card size */
|
|
2105
|
-
size?: ProductCardSize;
|
|
2106
|
-
/** Card style */
|
|
2107
|
-
style?: ProductCardStyle;
|
|
2108
|
-
/** Show product image */
|
|
2109
|
-
showImage?: boolean;
|
|
2110
|
-
/** Image aspect ratio */
|
|
2111
|
-
imageAspectRatio?: '1:1' | '4:3' | '3:4' | '16:9' | 'auto';
|
|
2112
|
-
/** Show price */
|
|
2113
|
-
showPrice?: boolean;
|
|
2114
|
-
/** Show compare/original price */
|
|
2115
|
-
showComparePrice?: boolean;
|
|
2116
|
-
/** Show discount badge */
|
|
2117
|
-
showDiscount?: boolean;
|
|
2118
|
-
/** Show brand */
|
|
2119
|
-
showBrand?: boolean;
|
|
2120
|
-
/** Show rating */
|
|
2121
|
-
showRating?: boolean;
|
|
2122
|
-
/** Show stock status */
|
|
2123
|
-
showStock?: boolean;
|
|
2124
|
-
/** Show add to cart button */
|
|
2125
|
-
showAddToCart?: boolean;
|
|
2126
|
-
/** Currency symbol */
|
|
2127
|
-
currency?: string;
|
|
2128
|
-
/** Currency position */
|
|
2129
|
-
currencyPosition?: 'before' | 'after';
|
|
2130
|
-
/** Decimal places for price */
|
|
2131
|
-
priceDecimals?: number;
|
|
2132
|
-
/** Truncate title after N lines */
|
|
2133
|
-
titleLines?: number;
|
|
2134
|
-
/** Hover effect */
|
|
2135
|
-
hoverEffect?: 'none' | 'lift' | 'glow' | 'scale' | 'border';
|
|
2136
|
-
/** Image placeholder */
|
|
2137
|
-
imagePlaceholder?: ReactNode;
|
|
2138
|
-
/** Lazy load images */
|
|
2139
|
-
lazyLoadImages?: boolean;
|
|
2140
|
-
}
|
|
2141
|
-
interface SuggestionDisplayConfig {
|
|
2142
|
-
/** Show search icon */
|
|
2143
|
-
showIcon?: boolean;
|
|
2144
|
-
/** Custom icon */
|
|
2145
|
-
icon?: ReactNode;
|
|
2146
|
-
/** Show hit count */
|
|
2147
|
-
showCount?: boolean;
|
|
2148
|
-
/** Show categories inline */
|
|
2149
|
-
showCategories?: boolean;
|
|
2150
|
-
/** Max categories to show */
|
|
2151
|
-
maxCategories?: number;
|
|
2152
|
-
/** Highlight matching text */
|
|
2153
|
-
highlightMatches?: boolean;
|
|
2154
|
-
/** Highlight style */
|
|
2155
|
-
highlightStyle?: CSSProperties;
|
|
2156
|
-
/** Show arrow on hover */
|
|
2157
|
-
showArrow?: boolean;
|
|
2158
|
-
/** Category click behavior */
|
|
2159
|
-
categoryClickable?: boolean;
|
|
2429
|
+
style?: React__default.CSSProperties;
|
|
2430
|
+
carouselAutoplay?: boolean;
|
|
2431
|
+
carouselIntervalMs?: number;
|
|
2432
|
+
/** Enable zoom functionality */
|
|
2433
|
+
enableZoom?: boolean;
|
|
2434
|
+
/** Zoom mode: 'hover' (Amazon-style), 'lens', 'click' (lightbox), 'both' (hover + click) */
|
|
2435
|
+
zoomMode?: ImageZoomMode;
|
|
2436
|
+
/** Zoom magnification level (2 = 200%, 3 = 300%) */
|
|
2437
|
+
zoomLevel?: number;
|
|
2438
|
+
/** Show navigation dots for carousel */
|
|
2439
|
+
showDots?: boolean;
|
|
2160
2440
|
}
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2441
|
+
declare function ImageDisplay({ images, variant, alt, className, style, carouselAutoplay, carouselIntervalMs, enableZoom, zoomMode, zoomLevel, showDots, }: ImageDisplayProps): React__default.JSX.Element;
|
|
2442
|
+
|
|
2443
|
+
/**
|
|
2444
|
+
* PriceDisplay – reusable price display primitive
|
|
2445
|
+
*
|
|
2446
|
+
* Handles single price, compare price with strikethrough, discount percentage,
|
|
2447
|
+
* and price range display.
|
|
2448
|
+
*/
|
|
2449
|
+
|
|
2450
|
+
interface PriceDisplayProps {
|
|
2451
|
+
price?: number;
|
|
2452
|
+
comparePrice?: number;
|
|
2453
|
+
priceRange?: PriceRange | null;
|
|
2454
|
+
currency?: string;
|
|
2455
|
+
currencyPosition?: 'before' | 'after';
|
|
2456
|
+
priceDecimals?: number;
|
|
2457
|
+
showDiscount?: boolean;
|
|
2458
|
+
className?: string;
|
|
2459
|
+
style?: React__default.CSSProperties;
|
|
2460
|
+
}
|
|
2461
|
+
declare function PriceDisplay({ price, comparePrice, priceRange, currency, currencyPosition, priceDecimals, showDiscount, className, style, }: PriceDisplayProps): React__default.JSX.Element | null;
|
|
2462
|
+
|
|
2463
|
+
/**
|
|
2464
|
+
* BadgeList – renders product badges (sale, new, sold out, custom)
|
|
2465
|
+
*/
|
|
2466
|
+
|
|
2467
|
+
interface BadgeListProps {
|
|
2468
|
+
badges: ProductBadge[];
|
|
2469
|
+
maxBadges?: number;
|
|
2470
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'inline';
|
|
2471
|
+
className?: string;
|
|
2472
|
+
style?: React__default.CSSProperties;
|
|
2473
|
+
}
|
|
2474
|
+
declare function BadgeList({ badges, maxBadges, position, className, style, }: BadgeListProps): React__default.JSX.Element | null;
|
|
2475
|
+
|
|
2476
|
+
/**
|
|
2477
|
+
* RatingDisplay – star rating display with review count
|
|
2478
|
+
*
|
|
2479
|
+
* Supports multiple variants: stars-only, compact, full, inline.
|
|
2480
|
+
* Can be read-only (display) or interactive (for reviews).
|
|
2481
|
+
*/
|
|
2482
|
+
|
|
2483
|
+
type RatingVariant = 'stars-only' | 'compact' | 'full' | 'inline';
|
|
2484
|
+
type RatingSize = 'small' | 'medium' | 'large';
|
|
2485
|
+
interface RatingDisplayProps {
|
|
2486
|
+
/** Rating value (0-5) */
|
|
2487
|
+
rating: number;
|
|
2488
|
+
/** Total number of reviews */
|
|
2489
|
+
reviewCount?: number;
|
|
2490
|
+
/** Display variant */
|
|
2491
|
+
variant?: RatingVariant;
|
|
2492
|
+
/** Size of stars */
|
|
2493
|
+
size?: RatingSize;
|
|
2494
|
+
/** Maximum rating (default: 5) */
|
|
2495
|
+
maxRating?: number;
|
|
2496
|
+
/** Show decimal rating number */
|
|
2497
|
+
showNumeric?: boolean;
|
|
2498
|
+
/** Show half stars */
|
|
2499
|
+
showHalfStars?: boolean;
|
|
2500
|
+
/** Interactive mode (for leaving reviews) */
|
|
2501
|
+
interactive?: boolean;
|
|
2502
|
+
/** Callback when rating is clicked (interactive mode) */
|
|
2503
|
+
onRatingChange?: (rating: number) => void;
|
|
2504
|
+
/** Custom star color */
|
|
2505
|
+
starColor?: string;
|
|
2506
|
+
/** Custom empty star color */
|
|
2507
|
+
emptyStarColor?: string;
|
|
2508
|
+
/** Custom text color */
|
|
2171
2509
|
textColor?: string;
|
|
2172
|
-
/**
|
|
2173
|
-
|
|
2174
|
-
/**
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
/** Highlight/match color */
|
|
2179
|
-
highlightColor?: string;
|
|
2180
|
-
/** Success color (in stock, etc.) */
|
|
2181
|
-
successColor?: string;
|
|
2182
|
-
/** Error color (out of stock, etc.) */
|
|
2183
|
-
errorColor?: string;
|
|
2184
|
-
/** Font family */
|
|
2185
|
-
fontFamily?: string;
|
|
2186
|
-
/** Base font size */
|
|
2187
|
-
fontSize?: number | string;
|
|
2188
|
-
/** Border radius */
|
|
2189
|
-
borderRadius?: number | string;
|
|
2190
|
-
/** Box shadow */
|
|
2191
|
-
boxShadow?: string;
|
|
2192
|
-
/** Custom CSS variables */
|
|
2193
|
-
cssVariables?: Record<string, string>;
|
|
2510
|
+
/** Show review count in parentheses */
|
|
2511
|
+
showReviewCount?: boolean;
|
|
2512
|
+
/** Custom review count format */
|
|
2513
|
+
reviewCountFormat?: (count: number) => string;
|
|
2514
|
+
className?: string;
|
|
2515
|
+
style?: React__default.CSSProperties;
|
|
2194
2516
|
}
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2517
|
+
declare function RatingDisplay({ rating, reviewCount, variant, size, maxRating, showNumeric, showHalfStars, interactive, onRatingChange, starColor, emptyStarColor, textColor, showReviewCount, reviewCountFormat, className, style, }: RatingDisplayProps): React__default.JSX.Element | null;
|
|
2518
|
+
|
|
2519
|
+
/**
|
|
2520
|
+
* VariantSwatches – inline variant indicators for card display
|
|
2521
|
+
*
|
|
2522
|
+
* Shows color dots, size labels, and "+N more" overflow for compact card views.
|
|
2523
|
+
*/
|
|
2524
|
+
|
|
2525
|
+
interface VariantSwatchesProps {
|
|
2526
|
+
options: ProductOption[];
|
|
2527
|
+
/** Which option names to show (default: all) */
|
|
2528
|
+
visibleOptions?: string[];
|
|
2529
|
+
/** Max values per option before "+N more" (default: 5) */
|
|
2530
|
+
maxValues?: number;
|
|
2531
|
+
/** Map option value names to CSS color strings */
|
|
2532
|
+
colorMap?: Record<string, string>;
|
|
2533
|
+
/** Currently selected value per option (e.g., { Color: 'Black', Size: 'M' }) */
|
|
2534
|
+
selectedValues?: Record<string, string>;
|
|
2535
|
+
/** Product variants for availability checking */
|
|
2536
|
+
variants?: ProductVariant[];
|
|
2537
|
+
/** Show availability cross-out for unavailable combos (default: true) */
|
|
2538
|
+
showAvailability?: boolean;
|
|
2539
|
+
onSwatchHover?: (optionName: string, value: string) => void;
|
|
2540
|
+
onSwatchClick?: (optionName: string, value: string) => void;
|
|
2541
|
+
className?: string;
|
|
2542
|
+
style?: React__default.CSSProperties;
|
|
2220
2543
|
}
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
onAddToCart?: (product: TProduct) => void;
|
|
2544
|
+
declare function VariantSwatches({ options, visibleOptions, maxValues, colorMap, selectedValues, variants, showAvailability, onSwatchHover, onSwatchClick, className, style, }: VariantSwatchesProps): React__default.JSX.Element | null;
|
|
2545
|
+
|
|
2546
|
+
/**
|
|
2547
|
+
* VariantSelector – full variant selector for product detail pages
|
|
2548
|
+
*
|
|
2549
|
+
* Three render modes per option:
|
|
2550
|
+
* - swatch: color circles (auto-detected for "Color" option or when colorMap provided)
|
|
2551
|
+
* - button: rectangular buttons (default for most options)
|
|
2552
|
+
* - dropdown: <select> for options with many values
|
|
2553
|
+
*/
|
|
2554
|
+
|
|
2555
|
+
interface VariantSelectorProps {
|
|
2556
|
+
options: ProductOption[];
|
|
2557
|
+
variants: ProductVariant[];
|
|
2558
|
+
selections: Record<string, string>;
|
|
2559
|
+
onSelectionChange: (optionName: string, value: string) => void;
|
|
2560
|
+
/** Override render mode per option name */
|
|
2561
|
+
optionRenderModes?: Record<string, 'swatch' | 'button' | 'dropdown'>;
|
|
2562
|
+
/** Auto-switch to dropdown when values exceed this count (default: 8) */
|
|
2563
|
+
dropdownThreshold?: number;
|
|
2564
|
+
/** Map value names to CSS colors */
|
|
2565
|
+
colorMap?: Record<string, string>;
|
|
2566
|
+
/** Show availability cross-out for unavailable combos */
|
|
2567
|
+
showAvailability?: boolean;
|
|
2568
|
+
/** Currently matched variant (for display) */
|
|
2569
|
+
selectedVariant?: ProductVariant | null;
|
|
2570
|
+
className?: string;
|
|
2571
|
+
style?: React__default.CSSProperties;
|
|
2250
2572
|
}
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
/**
|
|
2259
|
-
|
|
2260
|
-
/**
|
|
2261
|
-
|
|
2262
|
-
/**
|
|
2263
|
-
|
|
2264
|
-
/**
|
|
2265
|
-
|
|
2266
|
-
/**
|
|
2267
|
-
|
|
2268
|
-
/** Close on click outside */
|
|
2269
|
-
closeOnClickOutside?: boolean;
|
|
2573
|
+
declare function VariantSelector({ options, variants, selections, onSelectionChange, optionRenderModes, dropdownThreshold, colorMap, showAvailability, selectedVariant: _selectedVariant, className, style, }: VariantSelectorProps): React__default.JSX.Element | null;
|
|
2574
|
+
|
|
2575
|
+
/**
|
|
2576
|
+
* withAnalytics – HOC that wraps any React component to inject analytics tracking
|
|
2577
|
+
*/
|
|
2578
|
+
|
|
2579
|
+
interface WithAnalyticsConfig {
|
|
2580
|
+
/** Track clicks on the component */
|
|
2581
|
+
trackClick?: boolean;
|
|
2582
|
+
/** Track impressions (visibility) */
|
|
2583
|
+
trackImpression?: boolean;
|
|
2584
|
+
/** Custom event name for click */
|
|
2585
|
+
clickEventName?: string;
|
|
2586
|
+
/** Extract product/item data from props */
|
|
2587
|
+
getProductFromProps?: (props: any) => ProductItem | null;
|
|
2588
|
+
/** Extract position from props */
|
|
2589
|
+
getPositionFromProps?: (props: any) => number;
|
|
2270
2590
|
}
|
|
2271
|
-
interface
|
|
2272
|
-
|
|
2591
|
+
interface WithAnalyticsInjectedProps {
|
|
2592
|
+
seekoraClient?: SeekoraClient;
|
|
2593
|
+
seekoraContext?: SearchContext | Partial<SearchContext>;
|
|
2594
|
+
}
|
|
2595
|
+
declare function withAnalytics<P extends object>(Component: React__default.ComponentType<P>, config?: WithAnalyticsConfig): React__default.ComponentType<P & WithAnalyticsInjectedProps>;
|
|
2596
|
+
|
|
2597
|
+
/**
|
|
2598
|
+
* AnalyticsProvider – context + delegated event listener for data-seekora-* attribute-based analytics
|
|
2599
|
+
*
|
|
2600
|
+
* Installs a delegated click listener on a container. Any descendant with
|
|
2601
|
+
* data-seekora-track="click"|"add-to-cart" and data-seekora-product-id="..."
|
|
2602
|
+
* automatically fires analytics events without React wiring.
|
|
2603
|
+
*/
|
|
2604
|
+
|
|
2605
|
+
interface AnalyticsProviderProps {
|
|
2606
|
+
client: SeekoraClient;
|
|
2607
|
+
context?: SearchContext | Partial<SearchContext>;
|
|
2608
|
+
children: React__default.ReactNode;
|
|
2609
|
+
}
|
|
2610
|
+
interface AnalyticsContextValue {
|
|
2611
|
+
client: SeekoraClient;
|
|
2612
|
+
context?: SearchContext | Partial<SearchContext>;
|
|
2613
|
+
}
|
|
2614
|
+
declare const useAnalyticsProvider: () => AnalyticsContextValue | null;
|
|
2615
|
+
declare function AnalyticsProvider({ client, context, children }: AnalyticsProviderProps): React__default.JSX.Element;
|
|
2616
|
+
|
|
2617
|
+
/**
|
|
2618
|
+
* SectionSearchProvider – preset query + filter section
|
|
2619
|
+
*
|
|
2620
|
+
* Runs client.search(query, { refinements, hitsPerPage, sortBy }) on mount and when
|
|
2621
|
+
* query/filters change. Does not use global SearchStateManager. Use for menus,
|
|
2622
|
+
* sidebar, front-page blocks (e.g. "New arrivals", "On sale").
|
|
2623
|
+
*/
|
|
2624
|
+
|
|
2625
|
+
interface RefinementInput {
|
|
2626
|
+
field: string;
|
|
2627
|
+
value: string;
|
|
2628
|
+
}
|
|
2629
|
+
interface SectionSearchProviderProps {
|
|
2630
|
+
children: React__default.ReactNode;
|
|
2273
2631
|
query: string;
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
/** Map suggestion data fields */
|
|
2306
|
-
suggestionFields?: SuggestionFieldMapping;
|
|
2307
|
-
/** Map product data fields */
|
|
2308
|
-
productFields?: ProductFieldMapping;
|
|
2309
|
-
/** Map category data fields */
|
|
2310
|
-
categoryFields?: CategoryFieldMapping;
|
|
2311
|
-
/** Map brand data fields */
|
|
2312
|
-
brandFields?: BrandFieldMapping;
|
|
2313
|
-
/** Section configurations */
|
|
2314
|
-
sections?: SectionConfig[];
|
|
2315
|
-
/** Product display config */
|
|
2316
|
-
productDisplay?: ProductDisplayConfig;
|
|
2317
|
-
/** Suggestion display config */
|
|
2318
|
-
suggestionDisplay?: SuggestionDisplayConfig;
|
|
2319
|
-
/** Visual/layout config */
|
|
2320
|
-
visual?: VisualConfig;
|
|
2321
|
-
/** Theme config */
|
|
2322
|
-
theme?: DropdownThemeConfig;
|
|
2323
|
-
/** Analytics config */
|
|
2324
|
-
analytics?: AnalyticsConfig;
|
|
2325
|
-
/** Accessibility config */
|
|
2326
|
-
accessibility?: AccessibilityConfig;
|
|
2327
|
-
/** Dropdown width */
|
|
2328
|
-
width?: string | number;
|
|
2329
|
-
/** Dropdown max height */
|
|
2330
|
-
maxHeight?: string | number;
|
|
2331
|
-
/** Dropdown min height */
|
|
2332
|
-
minHeight?: string | number;
|
|
2333
|
-
/** Z-index */
|
|
2334
|
-
zIndex?: number;
|
|
2335
|
-
/** Root CSS class */
|
|
2632
|
+
refinements?: RefinementInput[];
|
|
2633
|
+
maxItems?: number;
|
|
2634
|
+
sortBy?: string;
|
|
2635
|
+
enabled?: boolean;
|
|
2636
|
+
sectionId?: string;
|
|
2637
|
+
}
|
|
2638
|
+
declare function SectionSearchProvider({ children, query, refinements, maxItems, sortBy, enabled, sectionId, }: SectionSearchProviderProps): React__default.JSX.Element;
|
|
2639
|
+
|
|
2640
|
+
/**
|
|
2641
|
+
* SectionSearchContext – preset query/filter section state
|
|
2642
|
+
*
|
|
2643
|
+
* For menus, sidebar, front-page blocks. Independent of main search state.
|
|
2644
|
+
*/
|
|
2645
|
+
|
|
2646
|
+
interface SectionSearchContextValue {
|
|
2647
|
+
items: unknown[];
|
|
2648
|
+
loading: boolean;
|
|
2649
|
+
error: Error | null;
|
|
2650
|
+
totalCount: number;
|
|
2651
|
+
sectionId?: string;
|
|
2652
|
+
trackClick: (item: unknown, position: number) => void;
|
|
2653
|
+
}
|
|
2654
|
+
declare function useSectionSearchContext(): SectionSearchContextValue;
|
|
2655
|
+
|
|
2656
|
+
/**
|
|
2657
|
+
* SectionItemGrid – generic grid of items from SectionSearchProvider (primitive)
|
|
2658
|
+
*/
|
|
2659
|
+
|
|
2660
|
+
interface SectionItemGridProps {
|
|
2661
|
+
columns?: number;
|
|
2662
|
+
maxItems?: number;
|
|
2336
2663
|
className?: string;
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
header?: ReactNode;
|
|
2345
|
-
/** Custom footer */
|
|
2346
|
-
footer?: ReactNode;
|
|
2347
|
-
/** Custom loading state */
|
|
2348
|
-
renderLoading?: () => ReactNode;
|
|
2349
|
-
/** Custom empty state */
|
|
2350
|
-
renderEmpty?: (query: string) => ReactNode;
|
|
2351
|
-
/** Custom error state */
|
|
2352
|
-
renderError?: (error: Error | string) => ReactNode;
|
|
2353
|
-
/** Reference to input element (for focus management) */
|
|
2354
|
-
inputRef?: React.RefObject<HTMLInputElement>;
|
|
2664
|
+
style?: React__default.CSSProperties;
|
|
2665
|
+
getItemId?: (item: unknown) => string;
|
|
2666
|
+
getItemTitle?: (item: unknown) => string;
|
|
2667
|
+
getItemImage?: (item: unknown) => string | undefined;
|
|
2668
|
+
getItemDescription?: (item: unknown) => string | undefined;
|
|
2669
|
+
getItemUrl?: (item: unknown) => string | undefined;
|
|
2670
|
+
renderItem?: (item: unknown, index: number) => React__default.ReactNode;
|
|
2355
2671
|
}
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
sectionViewAll: string;
|
|
2367
|
-
suggestionsList: string;
|
|
2368
|
-
suggestionItem: string;
|
|
2369
|
-
suggestionItemActive: string;
|
|
2370
|
-
suggestionIcon: string;
|
|
2371
|
-
suggestionText: string;
|
|
2372
|
-
suggestionHighlight: string;
|
|
2373
|
-
suggestionCount: string;
|
|
2374
|
-
suggestionCategories: string;
|
|
2375
|
-
suggestionCategory: string;
|
|
2376
|
-
suggestionArrow: string;
|
|
2377
|
-
productsList: string;
|
|
2378
|
-
productCard: string;
|
|
2379
|
-
productCardHover: string;
|
|
2380
|
-
productImage: string;
|
|
2381
|
-
productImagePlaceholder: string;
|
|
2382
|
-
productInfo: string;
|
|
2383
|
-
productTitle: string;
|
|
2384
|
-
productBrand: string;
|
|
2385
|
-
productPrice: string;
|
|
2386
|
-
productComparePrice: string;
|
|
2387
|
-
productDiscount: string;
|
|
2388
|
-
productRating: string;
|
|
2389
|
-
productStock: string;
|
|
2390
|
-
productAddToCart: string;
|
|
2391
|
-
categoriesList: string;
|
|
2392
|
-
categoryItem: string;
|
|
2393
|
-
categoryItemActive: string;
|
|
2394
|
-
categoryIcon: string;
|
|
2395
|
-
categoryLabel: string;
|
|
2396
|
-
categoryCount: string;
|
|
2397
|
-
brandsList: string;
|
|
2398
|
-
brandItem: string;
|
|
2399
|
-
brandLogo: string;
|
|
2400
|
-
brandName: string;
|
|
2401
|
-
recentList: string;
|
|
2402
|
-
recentItem: string;
|
|
2403
|
-
recentIcon: string;
|
|
2404
|
-
recentText: string;
|
|
2405
|
-
recentRemove: string;
|
|
2406
|
-
recentClearAll: string;
|
|
2407
|
-
trendingList: string;
|
|
2408
|
-
trendingItem: string;
|
|
2409
|
-
trendingIcon: string;
|
|
2410
|
-
tabsList: string;
|
|
2411
|
-
tabItem: string;
|
|
2412
|
-
tabItemActive: string;
|
|
2413
|
-
tabCount: string;
|
|
2414
|
-
loading: string;
|
|
2415
|
-
loadingSpinner: string;
|
|
2416
|
-
empty: string;
|
|
2417
|
-
emptyIcon: string;
|
|
2418
|
-
emptyText: string;
|
|
2419
|
-
error: string;
|
|
2420
|
-
errorIcon: string;
|
|
2421
|
-
errorText: string;
|
|
2422
|
-
keyboard: string;
|
|
2423
|
-
keyboardHint: string;
|
|
2424
|
-
keyboardKey: string;
|
|
2672
|
+
declare function SectionItemGrid({ columns, maxItems, className, style, getItemId, getItemTitle, getItemImage, getItemDescription, getItemUrl, renderItem, }: SectionItemGridProps): React__default.JSX.Element;
|
|
2673
|
+
|
|
2674
|
+
/**
|
|
2675
|
+
* SectionLoading – loading state for section (primitive)
|
|
2676
|
+
*/
|
|
2677
|
+
|
|
2678
|
+
interface SectionLoadingProps {
|
|
2679
|
+
className?: string;
|
|
2680
|
+
style?: React__default.CSSProperties;
|
|
2681
|
+
text?: string;
|
|
2425
2682
|
}
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
brandItem: CSSProperties;
|
|
2683
|
+
declare function SectionLoading({ className, style, text }: SectionLoadingProps): React__default.JSX.Element | null;
|
|
2684
|
+
|
|
2685
|
+
/**
|
|
2686
|
+
* SectionError – error state for section (primitive)
|
|
2687
|
+
*/
|
|
2688
|
+
|
|
2689
|
+
interface SectionErrorProps {
|
|
2690
|
+
className?: string;
|
|
2691
|
+
style?: React__default.CSSProperties;
|
|
2692
|
+
render?: (error: Error) => React__default.ReactNode;
|
|
2437
2693
|
}
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2694
|
+
declare function SectionError({ className, style, render }: SectionErrorProps): React__default.JSX.Element | null;
|
|
2695
|
+
|
|
2696
|
+
/**
|
|
2697
|
+
* ProductGallery – product detail image gallery (primitive)
|
|
2698
|
+
*
|
|
2699
|
+
* Uses ImageDisplay with configurable variant (carousel, thumbStrip, etc.).
|
|
2700
|
+
* For use on individual product page.
|
|
2701
|
+
*/
|
|
2702
|
+
|
|
2703
|
+
interface ProductGalleryProps {
|
|
2704
|
+
images: string[];
|
|
2705
|
+
variant?: ImageDisplayVariant;
|
|
2706
|
+
alt?: string;
|
|
2707
|
+
className?: string;
|
|
2708
|
+
style?: React__default.CSSProperties;
|
|
2709
|
+
carouselAutoplay?: boolean;
|
|
2710
|
+
carouselIntervalMs?: number;
|
|
2711
|
+
}
|
|
2712
|
+
declare function ProductGallery({ images, variant, alt, className, style, carouselAutoplay, carouselIntervalMs, }: ProductGalleryProps): React__default.JSX.Element;
|
|
2713
|
+
|
|
2714
|
+
/**
|
|
2715
|
+
* ProductInfo – product detail block (primitive)
|
|
2716
|
+
*
|
|
2717
|
+
* Title, description, price, optional variant selector and CTA. Minimal layout;
|
|
2718
|
+
* override with className/style. For use on individual product page.
|
|
2719
|
+
*
|
|
2720
|
+
* When options/variants/selections/onSelectionChange are provided and
|
|
2721
|
+
* renderVariantSelector is NOT provided, renders the built-in VariantSelector.
|
|
2722
|
+
* renderVariantSelector still takes priority as an override.
|
|
2723
|
+
*/
|
|
2724
|
+
|
|
2725
|
+
interface ProductInfoProps {
|
|
2726
|
+
title: string;
|
|
2727
|
+
description?: string;
|
|
2728
|
+
price?: number | string;
|
|
2729
|
+
currency?: string;
|
|
2730
|
+
/** Compare/original price for strikethrough display */
|
|
2731
|
+
comparePrice?: number | string;
|
|
2732
|
+
/** Product brand */
|
|
2733
|
+
brand?: string;
|
|
2734
|
+
/** Whether product is available */
|
|
2735
|
+
available?: boolean;
|
|
2736
|
+
/** Badges to display */
|
|
2737
|
+
badges?: ProductBadge[];
|
|
2738
|
+
/** Product option axes (Color, Size, etc.) */
|
|
2739
|
+
options?: ProductOption[];
|
|
2740
|
+
/** Product variants */
|
|
2741
|
+
variants?: ProductVariant[];
|
|
2742
|
+
/** Currently selected variant */
|
|
2743
|
+
selectedVariant?: ProductVariant | null;
|
|
2744
|
+
/** Current option selections */
|
|
2745
|
+
selections?: Record<string, string>;
|
|
2746
|
+
/** Called when an option value is selected */
|
|
2747
|
+
onSelectionChange?: (optionName: string, value: string) => void;
|
|
2748
|
+
/** Optional variant selector override (takes priority over built-in) */
|
|
2749
|
+
renderVariantSelector?: () => React__default.ReactNode;
|
|
2750
|
+
/** Optional CTA (e.g. Add to cart) */
|
|
2751
|
+
renderCTA?: () => React__default.ReactNode;
|
|
2752
|
+
className?: string;
|
|
2753
|
+
style?: React__default.CSSProperties;
|
|
2754
|
+
}
|
|
2755
|
+
declare function ProductInfo({ title, description, price, currency, comparePrice, brand, available, badges, options, variants, selectedVariant: _selectedVariant, selections, onSelectionChange, renderVariantSelector, renderCTA, className, style, }: ProductInfoProps): React__default.JSX.Element;
|
|
2756
|
+
|
|
2757
|
+
/**
|
|
2758
|
+
* ProductRecommendations – related / frequently bought (primitive)
|
|
2759
|
+
*
|
|
2760
|
+
* Renders a section of recommended items (generic ItemGrid or product list).
|
|
2761
|
+
* Pass items and onItemClick; or wrap SectionSearchProvider with preset query for "related".
|
|
2762
|
+
* For use on individual product page.
|
|
2763
|
+
*/
|
|
2764
|
+
|
|
2765
|
+
interface ProductRecommendationsProps {
|
|
2766
|
+
title?: string;
|
|
2767
|
+
items: GenericItem[] | unknown[];
|
|
2768
|
+
onItemClick?: (item: unknown, index: number) => void;
|
|
2769
|
+
maxItems?: number;
|
|
2770
|
+
columns?: number;
|
|
2771
|
+
className?: string;
|
|
2772
|
+
style?: React__default.CSSProperties;
|
|
2773
|
+
renderItem?: (item: unknown, index: number) => React__default.ReactNode;
|
|
2459
2774
|
}
|
|
2775
|
+
declare function ProductRecommendations({ title, items, onItemClick, maxItems, columns, className, style, renderItem, }: ProductRecommendationsProps): React__default.JSX.Element | null;
|
|
2460
2776
|
|
|
2461
2777
|
/**
|
|
2462
2778
|
* MinimalDropdown - Ultra-Clean Minimalist Style
|
|
@@ -2805,6 +3121,12 @@ declare const extractProduct: (item: any, mapping?: ProductFieldMapping) => {
|
|
|
2805
3121
|
discount: any;
|
|
2806
3122
|
inStock: any;
|
|
2807
3123
|
currency: any;
|
|
3124
|
+
images: any;
|
|
3125
|
+
originalPrice: any;
|
|
3126
|
+
available: any;
|
|
3127
|
+
options: any;
|
|
3128
|
+
variants: any;
|
|
3129
|
+
tags: any;
|
|
2808
3130
|
_raw: any;
|
|
2809
3131
|
};
|
|
2810
3132
|
/**
|
|
@@ -2840,6 +3162,36 @@ declare const highlightText: (text: string, query: string, options?: {
|
|
|
2840
3162
|
className?: string;
|
|
2841
3163
|
style?: CSSProperties;
|
|
2842
3164
|
}) => string;
|
|
3165
|
+
/**
|
|
3166
|
+
* Extract badges from product tags (Shopify convention: "badge:new", "badge:limited")
|
|
3167
|
+
* and auto-generate sale/soldOut badges from product data.
|
|
3168
|
+
*/
|
|
3169
|
+
declare const extractBadges: (tags?: string[], product?: {
|
|
3170
|
+
price?: number;
|
|
3171
|
+
original_price?: number;
|
|
3172
|
+
compare_at_price?: number;
|
|
3173
|
+
available?: boolean;
|
|
3174
|
+
}) => ProductBadge[];
|
|
3175
|
+
/**
|
|
3176
|
+
* Compute min/max price from variants. Returns null if all variants have the same price.
|
|
3177
|
+
*/
|
|
3178
|
+
declare const getPriceRange: (variants?: ProductVariant[]) => PriceRange | null;
|
|
3179
|
+
/**
|
|
3180
|
+
* Format a price range like "$54.00 - $72.00"
|
|
3181
|
+
*/
|
|
3182
|
+
declare const formatPriceRange: (range: PriceRange, config?: Pick<ProductDisplayConfig, "currency" | "currencyPosition" | "priceDecimals">) => string;
|
|
3183
|
+
/**
|
|
3184
|
+
* Given current selections, return which values for an option are still available
|
|
3185
|
+
* based on variant availability.
|
|
3186
|
+
*/
|
|
3187
|
+
declare const getAvailableValuesForOption: (optionName: string, options: ProductOption[], variants: ProductVariant[], selections: Record<string, string>) => {
|
|
3188
|
+
value: string;
|
|
3189
|
+
available: boolean;
|
|
3190
|
+
}[];
|
|
3191
|
+
/**
|
|
3192
|
+
* Find the exact variant matching all selected options.
|
|
3193
|
+
*/
|
|
3194
|
+
declare const findVariantBySelections: (options: ProductOption[], variants: ProductVariant[], selections: Record<string, string>) => ProductVariant | null;
|
|
2843
3195
|
declare const getRecentSearches: (storeId?: string) => string[];
|
|
2844
3196
|
declare const addRecentSearch: (query: string, storeId?: string) => string[];
|
|
2845
3197
|
declare const removeRecentSearch: (query: string, storeId?: string) => string[];
|
|
@@ -3523,6 +3875,82 @@ declare function useNaturalLanguageFilters(options?: NaturalLanguageFiltersOptio
|
|
|
3523
3875
|
*/
|
|
3524
3876
|
declare function formatParsedFilters(filters: ParsedFilter[]): string;
|
|
3525
3877
|
|
|
3878
|
+
/**
|
|
3879
|
+
* useVariantSelection – manages variant selection state
|
|
3880
|
+
*
|
|
3881
|
+
* Single source of truth for variant interactions on product pages.
|
|
3882
|
+
* Cards display variants passively; product pages use this hook.
|
|
3883
|
+
*/
|
|
3884
|
+
|
|
3885
|
+
interface UseVariantSelectionOptions {
|
|
3886
|
+
options?: ProductOption[];
|
|
3887
|
+
variants?: ProductVariant[];
|
|
3888
|
+
initialSelections?: Record<string, string>;
|
|
3889
|
+
onVariantChange?: (variant: ProductVariant | null, selections: Record<string, string>) => void;
|
|
3890
|
+
}
|
|
3891
|
+
interface UseVariantSelectionReturn {
|
|
3892
|
+
selections: Record<string, string>;
|
|
3893
|
+
setSelection: (optionName: string, value: string) => void;
|
|
3894
|
+
resetSelections: () => void;
|
|
3895
|
+
selectedVariant: ProductVariant | null;
|
|
3896
|
+
availableValues: Record<string, {
|
|
3897
|
+
value: string;
|
|
3898
|
+
available: boolean;
|
|
3899
|
+
}[]>;
|
|
3900
|
+
isComplete: boolean;
|
|
3901
|
+
effectivePrice: number | null;
|
|
3902
|
+
effectiveComparePrice: number | null;
|
|
3903
|
+
}
|
|
3904
|
+
declare function useVariantSelection({ options, variants, initialSelections, onVariantChange, }?: UseVariantSelectionOptions): UseVariantSelectionReturn;
|
|
3905
|
+
|
|
3906
|
+
/**
|
|
3907
|
+
* useProductAnalytics – analytics event binding hook for custom components
|
|
3908
|
+
*
|
|
3909
|
+
* Returns event handler props ready to spread onto any element, plus imperative
|
|
3910
|
+
* tracking methods. Builds on existing useAnalytics infrastructure.
|
|
3911
|
+
*/
|
|
3912
|
+
|
|
3913
|
+
interface UseProductAnalyticsOptions {
|
|
3914
|
+
client: SeekoraClient;
|
|
3915
|
+
product: ProductItem;
|
|
3916
|
+
position?: number;
|
|
3917
|
+
section?: string;
|
|
3918
|
+
tabId?: string;
|
|
3919
|
+
query?: string;
|
|
3920
|
+
context?: SearchContext | Partial<SearchContext>;
|
|
3921
|
+
enabled?: boolean;
|
|
3922
|
+
}
|
|
3923
|
+
interface UseProductAnalyticsReturn {
|
|
3924
|
+
/** Spread onto any clickable element to track product click */
|
|
3925
|
+
clickProps: {
|
|
3926
|
+
onClick: (e?: React.MouseEvent) => void;
|
|
3927
|
+
'data-seekora-product-id': string;
|
|
3928
|
+
'data-seekora-position': number;
|
|
3929
|
+
};
|
|
3930
|
+
/** Spread onto any element to track variant selection */
|
|
3931
|
+
variantSelectProps: (optionName: string, value: string) => {
|
|
3932
|
+
onClick: (e?: React.MouseEvent) => void;
|
|
3933
|
+
'data-seekora-variant-option': string;
|
|
3934
|
+
'data-seekora-variant-value': string;
|
|
3935
|
+
};
|
|
3936
|
+
/** Spread onto any element to track add-to-cart */
|
|
3937
|
+
addToCartProps: (variant?: ProductVariant) => {
|
|
3938
|
+
onClick: (e?: React.MouseEvent) => void;
|
|
3939
|
+
'data-seekora-action': 'add-to-cart';
|
|
3940
|
+
};
|
|
3941
|
+
/** Spread onto any element to track impression (uses IntersectionObserver) */
|
|
3942
|
+
impressionRef: React.RefCallback<HTMLElement>;
|
|
3943
|
+
/** Imperative: track product click */
|
|
3944
|
+
trackClick: () => void;
|
|
3945
|
+
/** Imperative: track variant select */
|
|
3946
|
+
trackVariantSelect: (optionName: string, value: string) => void;
|
|
3947
|
+
/** Imperative: track add to cart */
|
|
3948
|
+
trackAddToCart: (variant?: ProductVariant) => void;
|
|
3949
|
+
/** Imperative: track custom event with product context */
|
|
3950
|
+
trackCustomEvent: (eventName: string, metadata?: Record<string, any>) => void;
|
|
3951
|
+
}
|
|
3952
|
+
declare function useProductAnalytics({ client, product, position, section, tabId, query, context, enabled, }: UseProductAnalyticsOptions): UseProductAnalyticsReturn;
|
|
3953
|
+
|
|
3526
3954
|
/**
|
|
3527
3955
|
* Default Theme
|
|
3528
3956
|
*/
|
|
@@ -3660,5 +4088,5 @@ declare function updateSuggestionsStyles(theme: SuggestionsThemeVariables): void
|
|
|
3660
4088
|
|
|
3661
4089
|
declare const createTheme: (config: ThemeConfig) => _seekora_ai_ui_sdk_types.Theme;
|
|
3662
4090
|
|
|
3663
|
-
export { AmazonDropdown, Breadcrumb, CategoriesTabs, ClearRefinements, CurrentRefinements, DocSearch, DocSearchButton, DropdownPanel, Facets, FederatedDropdown, FrequentlyBoughtTogether, GoogleDropdown, HierarchicalMenu, Highlight, HitsPerPage, ImageDisplay, InfiniteHits, ItemCard, ItemGrid, MinimalDropdown, MobileFilters, MobileFiltersButton, MobileSheetDropdown, Pagination, PinterestDropdown, ProductCard, ProductGallery, ProductGrid, ProductInfo, ProductRecommendations, QuerySuggestions, QuerySuggestionsDropdown, RangeInput, RangeSlider, RecentSearchesList, RecentlyViewed, RelatedProducts, RichQuerySuggestions, SearchBar, SearchBarWithSuggestions, SearchInput, SearchLayout, SearchProvider, SearchResults, SectionError, SectionItemGrid, SectionLoading, SectionSearchProvider, ShopifyDropdown, Snippet, SortBy, SpotlightDropdown, Stats, SuggestionDropdownVariants, SuggestionItem$1 as SuggestionItem, SuggestionList, SuggestionSearchBar, SuggestionsCache, SuggestionsDropdownComposition, SuggestionsError, SuggestionsLoading, SuggestionsProvider, TrendingItems, TrendingList, addRecentSearch, addToRecentlyViewed, brandPresets, breakpoints, clearRecentSearches, clearSuggestionsCache, createSuggestionsCache, createSuggestionsTheme, createTheme, darkTheme, darkThemeVariables, defaultTheme, extractBrand, extractCategory, extractProduct, extractSuggestion, formatParsedFilters, formatPrice as formatSuggestionPrice, generateSuggestionsStylesheet, getRecentSearches, getShortcutText, getSuggestionsCache, highlightText, injectGlobalResponsiveStyles, injectSuggestionsStyles, lightThemeVariables, mediaQueries, minimalTheme, minimalThemeVariables, parseHighlightMarkup, removeRecentSearch, touchTargets, updateSuggestionsStyles, useAnalytics, useDocSearch, useSeekoraSearch$1 as useDocSearchSeekoraSearch, useInjectResponsiveStyles, useKeyboard, useNaturalLanguageFilters, useQuerySuggestions, useQuerySuggestionsEnhanced, useResponsive, useSearchContext, useSearchState, useSectionSearchContext, useSeekoraSearch, useSmartSuggestions, useSuggestionsAnalytics, useSuggestionsContext };
|
|
3664
|
-
export type { AnalyticsConfig, AnalyticsEventPayload, BaseDropdownProps, BrandFieldMapping, BreadcrumbItem, BreadcrumbProps, BreadcrumbTheme, CategoriesTabsProps, CategoryFieldMapping, ClearRefinementsProps, ClearRefinementsTheme, DocSearchAction, DocSearchButtonProps, DocSearchHit, DocSearchProps, DocSearchResponse, DocSearchState, DocSearchSuggestion, DocSearchSuggestionsResponse, DocSearchTranslations, DropdownClassNames, DropdownEventHandlers, DropdownPanelProps, DropdownRef, DropdownThemeConfig, FederatedDropdownProps, FederatedDropdownRef, FrequentlyBoughtTogetherProps, GenericItem, HierarchicalMenuItem, HierarchicalMenuProps, HierarchicalMenuTheme, HighlightMarkupOptions, HighlightProps, HighlightTheme, HitsPerPageItem, HitsPerPageProps, HitsPerPageTheme, ImageDisplayProps, ImageDisplayVariant, InfiniteHitsProps, InfiniteHitsTheme, ImageDisplayVariant$1 as ItemCardImageVariant, ItemCardProps, ItemGridProps, MobileFiltersButtonProps, MobileFiltersProps, MobileFiltersTheme, NaturalLanguageFiltersOptions, NaturalLanguageResult, NavigableItem, ParsedFilter, ProductCardImageVariant, ProductCardProps, ProductClickEventData, ProductDisplayConfig, ProductFieldMapping, ProductGalleryProps, ProductGridProps, ProductInfoProps, ProductRecommendationsProps, QuerySuggestionsDropdownProps, QuerySuggestionsDropdownRef, QuerySuggestionsProps, QuerySuggestionsTheme, RangeSliderProps, RangeSliderTheme, RecentSearchesListProps, RecentlyViewedProps, RecommendationItem, RecommendationTheme, RefinementInput, RelatedProductsProps, ResponsiveState, RichQuerySuggestionsProps, RichQuerySuggestionsRef, SearchBarProps, SearchBarTheme, SearchBarWithSuggestionsProps, SearchBarWithSuggestionsRef, SearchInputProps, SearchProviderProps, SearchResultsProps, SearchResultsTheme, SearchSource, SectionConfig, SectionErrorProps, SectionItemGridProps, SectionLoadingProps, SectionSearchContextValue, SectionSearchProviderProps, SmartSuggestion, SmartSuggestionsOptions, SnippetProps, SnippetTheme, SuggestionClickEventData, SuggestionDisplayConfig, SuggestionDropdownVariant, SuggestionFieldMapping, SuggestionImpressionEventData, SuggestionItemProps, SuggestionListProps, SuggestionSearchBarProps, SuggestionSearchBarRef, SuggestionsContextValue, SuggestionsDropdownCompositionProps, SuggestionsErrorProps, SuggestionsLoadingProps, SuggestionsProviderProps, SuggestionsThemeVariables, TrendingItemsProps, TrendingListProps, UseAnalyticsOptions, UseAnalyticsReturn, UseSeekoraSearchOptions$1 as UseDocSearchSeekoraSearchOptions, UseSeekoraSearchResult as UseDocSearchSeekoraSearchResult, UseQuerySuggestionsEnhancedOptions, UseQuerySuggestionsEnhancedReturn, UseSmartSuggestionsReturn, UseSuggestionsAnalyticsOptions, UseSuggestionsAnalyticsReturn };
|
|
4091
|
+
export { ActionButtons, AmazonDropdown, AnalyticsProvider, BadgeList, Breadcrumb, CategoriesTabs, ClearRefinements, CurrentRefinements, DocSearch, DocSearchButton, DropdownPanel, Facets, FederatedDropdown, FrequentlyBoughtTogether, GoogleDropdown, HierarchicalMenu, Highlight, HitsPerPage, ImageDisplay, ImageZoom, InfiniteHits, ItemCard, ItemGrid, MinimalDropdown, MobileFilters, MobileFiltersButton, MobileSheetDropdown, Pagination, PinterestDropdown, PriceDisplay, ProductCard, ProductGallery, ProductGrid, ProductInfo, ProductRecommendations, QuerySuggestions, QuerySuggestionsDropdown, RangeInput, RangeSlider, RatingDisplay, RecentSearchesList, RecentlyViewed, RelatedProducts, RichQuerySuggestions, SearchBar, SearchBarWithSuggestions, SearchInput, SearchLayout, SearchProvider, SearchResults, SectionError, SectionItemGrid, SectionLoading, SectionSearchProvider, ShopifyDropdown, Snippet, SortBy, SpotlightDropdown, Stats, SuggestionDropdownVariants, SuggestionItem$1 as SuggestionItem, SuggestionList, SuggestionSearchBar, SuggestionsCache, SuggestionsDropdownComposition, SuggestionsError, SuggestionsLoading, SuggestionsProvider, TrendingItems, TrendingList, VariantSelector, VariantSwatches, addRecentSearch, addToRecentlyViewed, brandPresets, breakpoints, clearRecentSearches, clearSuggestionsCache, createSuggestionsCache, createSuggestionsTheme, createTheme, darkTheme, darkThemeVariables, defaultTheme, extractBadges, extractBrand, extractCategory, extractProduct, extractSuggestion, findVariantBySelections, formatParsedFilters, formatPriceRange, formatPrice as formatSuggestionPrice, generateSuggestionsStylesheet, getAvailableValuesForOption, getPriceRange, getRecentSearches, getShortcutText, getSuggestionsCache, highlightText, injectGlobalResponsiveStyles, injectSuggestionsStyles, lightThemeVariables, mediaQueries, minimalTheme, minimalThemeVariables, parseHighlightMarkup, removeRecentSearch, touchTargets, updateSuggestionsStyles, useAnalytics, useAnalyticsProvider, useDocSearch, useSeekoraSearch$1 as useDocSearchSeekoraSearch, useInjectResponsiveStyles, useKeyboard, useNaturalLanguageFilters, useProductAnalytics, useQuerySuggestions, useQuerySuggestionsEnhanced, useResponsive, useSearchContext, useSearchState, useSectionSearchContext, useSeekoraSearch, useSmartSuggestions, useSuggestionsAnalytics, useSuggestionsContext, useVariantSelection, withAnalytics };
|
|
4092
|
+
export type { ActionButton, ActionButtonType, ActionButtonsProps, AnalyticsConfig, AnalyticsEventPayload, AnalyticsProviderProps, BadgeListProps, BaseDropdownProps, BrandFieldMapping, BreadcrumbItem, BreadcrumbProps, BreadcrumbTheme, CategoriesTabsProps, CategoryFieldMapping, ClearRefinementsProps, ClearRefinementsTheme, DocSearchAction, DocSearchButtonProps, DocSearchHit, DocSearchProps, DocSearchResponse, DocSearchState, DocSearchSuggestion, DocSearchSuggestionsResponse, DocSearchTranslations, DropdownClassNames, DropdownEventHandlers, DropdownPanelProps, DropdownRef, DropdownThemeConfig, FederatedDropdownProps, FederatedDropdownRef, FrequentlyBoughtTogetherProps, GenericItem, HierarchicalMenuItem, HierarchicalMenuProps, HierarchicalMenuTheme, HighlightMarkupOptions, HighlightProps, HighlightTheme, HitsPerPageItem, HitsPerPageProps, HitsPerPageTheme, ImageDisplayProps, ImageDisplayVariant, ImageZoomMode, ImageZoomProps, InfiniteHitsProps, InfiniteHitsTheme, ImageDisplayVariant$1 as ItemCardImageVariant, ItemCardProps, ItemGridProps, MobileFiltersButtonProps, MobileFiltersProps, MobileFiltersTheme, NaturalLanguageFiltersOptions, NaturalLanguageResult, NavigableItem, ParsedFilter, PriceDisplayProps, ProductCardImageVariant, ProductCardProps, ProductClickEventData, ProductDisplayConfig, ProductFieldMapping, ProductGalleryProps, ProductGridProps, ProductInfoProps, ProductRecommendationsProps, QuerySuggestionsDropdownProps, QuerySuggestionsDropdownRef, QuerySuggestionsProps, QuerySuggestionsTheme, RangeSliderProps, RangeSliderTheme, RatingDisplayProps, RatingSize, RatingVariant, RecentSearchesListProps, RecentlyViewedProps, RecommendationItem, RecommendationTheme, RefinementInput, RelatedProductsProps, ResponsiveState, RichQuerySuggestionsProps, RichQuerySuggestionsRef, SearchBarProps, SearchBarTheme, SearchBarWithSuggestionsProps, SearchBarWithSuggestionsRef, SearchInputProps, SearchProviderProps, SearchResultsProps, SearchResultsTheme, SearchSource, SectionConfig, SectionErrorProps, SectionItemGridProps, SectionLoadingProps, SectionSearchContextValue, SectionSearchProviderProps, SmartSuggestion, SmartSuggestionsOptions, SnippetProps, SnippetTheme, SuggestionClickEventData, SuggestionDisplayConfig, SuggestionDropdownVariant, SuggestionFieldMapping, SuggestionImpressionEventData, SuggestionItemProps, SuggestionListProps, SuggestionSearchBarProps, SuggestionSearchBarRef, SuggestionsContextValue, SuggestionsDropdownCompositionProps, SuggestionsErrorProps, SuggestionsLoadingProps, SuggestionsProviderProps, SuggestionsThemeVariables, TrendingItemsProps, TrendingListProps, UseAnalyticsOptions, UseAnalyticsReturn, UseSeekoraSearchOptions$1 as UseDocSearchSeekoraSearchOptions, UseSeekoraSearchResult as UseDocSearchSeekoraSearchResult, UseProductAnalyticsOptions, UseProductAnalyticsReturn, UseQuerySuggestionsEnhancedOptions, UseQuerySuggestionsEnhancedReturn, UseSmartSuggestionsReturn, UseSuggestionsAnalyticsOptions, UseSuggestionsAnalyticsReturn, UseVariantSelectionOptions, UseVariantSelectionReturn, VariantSelectorProps, VariantSwatchesProps, WithAnalyticsConfig, WithAnalyticsInjectedProps };
|