@seekora-ai/ui-sdk-react 0.0.0-stage-20260517092419
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/Breadcrumb.d.ts +43 -0
- package/dist/components/Breadcrumb.d.ts.map +1 -0
- package/dist/components/Breadcrumb.js +119 -0
- package/dist/components/ClearRefinements.d.ts +42 -0
- package/dist/components/ClearRefinements.d.ts.map +1 -0
- package/dist/components/ClearRefinements.js +81 -0
- package/dist/components/CurrentRefinements.d.ts +63 -0
- package/dist/components/CurrentRefinements.d.ts.map +1 -0
- package/dist/components/CurrentRefinements.js +302 -0
- package/dist/components/FacetDropdown.d.ts +94 -0
- package/dist/components/FacetDropdown.d.ts.map +1 -0
- package/dist/components/FacetDropdown.js +396 -0
- package/dist/components/Facets.d.ts +118 -0
- package/dist/components/Facets.d.ts.map +1 -0
- package/dist/components/Facets.js +785 -0
- package/dist/components/FederatedDropdown.d.ts +98 -0
- package/dist/components/FederatedDropdown.d.ts.map +1 -0
- package/dist/components/FederatedDropdown.js +526 -0
- package/dist/components/HierarchicalMenu.d.ts +55 -0
- package/dist/components/HierarchicalMenu.d.ts.map +1 -0
- package/dist/components/HierarchicalMenu.js +276 -0
- package/dist/components/Highlight.d.ts +51 -0
- package/dist/components/Highlight.d.ts.map +1 -0
- package/dist/components/Highlight.js +155 -0
- package/dist/components/HitsPerPage.d.ts +41 -0
- package/dist/components/HitsPerPage.d.ts.map +1 -0
- package/dist/components/HitsPerPage.js +82 -0
- package/dist/components/InfiniteHits.d.ts +51 -0
- package/dist/components/InfiniteHits.d.ts.map +1 -0
- package/dist/components/InfiniteHits.js +173 -0
- package/dist/components/MobileFilters.d.ts +71 -0
- package/dist/components/MobileFilters.d.ts.map +1 -0
- package/dist/components/MobileFilters.js +242 -0
- package/dist/components/Pagination.d.ts +90 -0
- package/dist/components/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination.js +298 -0
- package/dist/components/QuerySuggestions.d.ts +36 -0
- package/dist/components/QuerySuggestions.d.ts.map +1 -0
- package/dist/components/QuerySuggestions.js +71 -0
- package/dist/components/QuerySuggestionsDropdown.d.ts +82 -0
- package/dist/components/QuerySuggestionsDropdown.d.ts.map +1 -0
- package/dist/components/QuerySuggestionsDropdown.js +394 -0
- package/dist/components/RangeInput.d.ts +58 -0
- package/dist/components/RangeInput.d.ts.map +1 -0
- package/dist/components/RangeInput.js +203 -0
- package/dist/components/RangeSlider.d.ts +51 -0
- package/dist/components/RangeSlider.d.ts.map +1 -0
- package/dist/components/RangeSlider.js +262 -0
- package/dist/components/Recommendations.d.ts +89 -0
- package/dist/components/Recommendations.d.ts.map +1 -0
- package/dist/components/Recommendations.js +256 -0
- package/dist/components/RichQuerySuggestions.d.ts +88 -0
- package/dist/components/RichQuerySuggestions.d.ts.map +1 -0
- package/dist/components/RichQuerySuggestions.js +498 -0
- package/dist/components/SearchBar.d.ts +57 -0
- package/dist/components/SearchBar.d.ts.map +1 -0
- package/dist/components/SearchBar.js +361 -0
- package/dist/components/SearchBarWithSuggestions.d.ts +105 -0
- package/dist/components/SearchBarWithSuggestions.d.ts.map +1 -0
- package/dist/components/SearchBarWithSuggestions.js +275 -0
- package/dist/components/SearchLayout.d.ts +35 -0
- package/dist/components/SearchLayout.d.ts.map +1 -0
- package/dist/components/SearchLayout.js +61 -0
- package/dist/components/SearchProvider.d.ts +35 -0
- package/dist/components/SearchProvider.d.ts.map +1 -0
- package/dist/components/SearchProvider.js +53 -0
- package/dist/components/SearchResults.d.ts +57 -0
- package/dist/components/SearchResults.d.ts.map +1 -0
- package/dist/components/SearchResults.js +456 -0
- package/dist/components/SortBy.d.ts +84 -0
- package/dist/components/SortBy.d.ts.map +1 -0
- package/dist/components/SortBy.js +183 -0
- package/dist/components/Stats.d.ts +51 -0
- package/dist/components/Stats.d.ts.map +1 -0
- package/dist/components/Stats.js +201 -0
- 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 +102 -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 +65 -0
- package/dist/components/primitives/CustomSelect.d.ts +40 -0
- package/dist/components/primitives/CustomSelect.d.ts.map +1 -0
- package/dist/components/primitives/CustomSelect.js +196 -0
- package/dist/components/primitives/ImageDisplay.d.ts +28 -0
- package/dist/components/primitives/ImageDisplay.d.ts.map +1 -0
- package/dist/components/primitives/ImageDisplay.js +127 -0
- 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 +433 -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 +155 -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 +188 -0
- package/dist/components/primitives/index.d.ts +12 -0
- package/dist/components/primitives/index.d.ts.map +1 -0
- package/dist/components/primitives/index.js +11 -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/ProductGallery.d.ts +26 -0
- package/dist/components/product-page/ProductGallery.d.ts.map +1 -0
- package/dist/components/product-page/ProductGallery.js +13 -0
- package/dist/components/product-page/ProductInfo.d.ts +44 -0
- package/dist/components/product-page/ProductInfo.d.ts.map +1 -0
- package/dist/components/product-page/ProductInfo.js +34 -0
- package/dist/components/product-page/ProductRecommendations.d.ts +21 -0
- package/dist/components/product-page/ProductRecommendations.d.ts.map +1 -0
- package/dist/components/product-page/ProductRecommendations.js +17 -0
- package/dist/components/product-page/index.d.ts +4 -0
- package/dist/components/product-page/index.d.ts.map +1 -0
- package/dist/components/product-page/index.js +3 -0
- package/dist/components/section-primitives/SectionError.d.ts +11 -0
- package/dist/components/section-primitives/SectionError.d.ts.map +1 -0
- package/dist/components/section-primitives/SectionError.js +13 -0
- package/dist/components/section-primitives/SectionItemGrid.d.ts +18 -0
- package/dist/components/section-primitives/SectionItemGrid.d.ts.map +1 -0
- package/dist/components/section-primitives/SectionItemGrid.js +14 -0
- package/dist/components/section-primitives/SectionLoading.d.ts +11 -0
- package/dist/components/section-primitives/SectionLoading.d.ts.map +1 -0
- package/dist/components/section-primitives/SectionLoading.js +11 -0
- package/dist/components/section-primitives/SectionSearchContext.d.ts +17 -0
- package/dist/components/section-primitives/SectionSearchContext.d.ts.map +1 -0
- package/dist/components/section-primitives/SectionSearchContext.js +17 -0
- package/dist/components/section-primitives/SectionSearchProvider.d.ts +25 -0
- package/dist/components/section-primitives/SectionSearchProvider.d.ts.map +1 -0
- package/dist/components/section-primitives/SectionSearchProvider.js +106 -0
- package/dist/components/section-primitives/index.d.ts +5 -0
- package/dist/components/section-primitives/index.d.ts.map +1 -0
- package/dist/components/section-primitives/index.js +4 -0
- package/dist/components/suggestions/AmazonDropdown.d.ts +30 -0
- package/dist/components/suggestions/AmazonDropdown.d.ts.map +1 -0
- package/dist/components/suggestions/AmazonDropdown.js +509 -0
- package/dist/components/suggestions/GoogleDropdown.d.ts +31 -0
- package/dist/components/suggestions/GoogleDropdown.d.ts.map +1 -0
- package/dist/components/suggestions/GoogleDropdown.js +349 -0
- package/dist/components/suggestions/MinimalDropdown.d.ts +24 -0
- package/dist/components/suggestions/MinimalDropdown.d.ts.map +1 -0
- package/dist/components/suggestions/MinimalDropdown.js +312 -0
- package/dist/components/suggestions/MobileSheetDropdown.d.ts +31 -0
- package/dist/components/suggestions/MobileSheetDropdown.d.ts.map +1 -0
- package/dist/components/suggestions/MobileSheetDropdown.js +483 -0
- package/dist/components/suggestions/PinterestDropdown.d.ts +29 -0
- package/dist/components/suggestions/PinterestDropdown.d.ts.map +1 -0
- package/dist/components/suggestions/PinterestDropdown.js +446 -0
- package/dist/components/suggestions/ShopifyDropdown.d.ts +27 -0
- package/dist/components/suggestions/ShopifyDropdown.d.ts.map +1 -0
- package/dist/components/suggestions/ShopifyDropdown.js +448 -0
- package/dist/components/suggestions/SpotlightDropdown.d.ts +33 -0
- package/dist/components/suggestions/SpotlightDropdown.d.ts.map +1 -0
- package/dist/components/suggestions/SpotlightDropdown.js +544 -0
- package/dist/components/suggestions/SuggestionSearchBar.d.ts +127 -0
- package/dist/components/suggestions/SuggestionSearchBar.d.ts.map +1 -0
- package/dist/components/suggestions/SuggestionSearchBar.js +644 -0
- package/dist/components/suggestions/index.d.ts +37 -0
- package/dist/components/suggestions/index.d.ts.map +1 -0
- package/dist/components/suggestions/index.js +59 -0
- package/dist/components/suggestions/styles/index.d.ts +11 -0
- package/dist/components/suggestions/styles/index.d.ts.map +1 -0
- package/dist/components/suggestions/styles/index.js +289 -0
- package/dist/components/suggestions/styles/responsive.d.ts +107 -0
- package/dist/components/suggestions/styles/responsive.d.ts.map +1 -0
- package/dist/components/suggestions/styles/responsive.js +237 -0
- package/dist/components/suggestions/types.d.ts +511 -0
- package/dist/components/suggestions/types.d.ts.map +1 -0
- package/dist/components/suggestions/types.js +6 -0
- package/dist/components/suggestions/utils.d.ts +259 -0
- package/dist/components/suggestions/utils.d.ts.map +1 -0
- package/dist/components/suggestions/utils.js +668 -0
- package/dist/components/suggestions-primitives/CategoriesTabs.d.ts +13 -0
- package/dist/components/suggestions-primitives/CategoriesTabs.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/CategoriesTabs.js +35 -0
- package/dist/components/suggestions-primitives/DropdownPanel.d.ts +24 -0
- package/dist/components/suggestions-primitives/DropdownPanel.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/DropdownPanel.js +67 -0
- package/dist/components/suggestions-primitives/ItemCard.d.ts +48 -0
- package/dist/components/suggestions-primitives/ItemCard.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/ItemCard.js +103 -0
- package/dist/components/suggestions-primitives/ItemGrid.d.ts +28 -0
- package/dist/components/suggestions-primitives/ItemGrid.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/ItemGrid.js +55 -0
- package/dist/components/suggestions-primitives/ProductCard.d.ts +45 -0
- package/dist/components/suggestions-primitives/ProductCard.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/ProductCard.js +177 -0
- 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 +137 -0
- package/dist/components/suggestions-primitives/ProductGrid.d.ts +22 -0
- package/dist/components/suggestions-primitives/ProductGrid.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/ProductGrid.js +41 -0
- package/dist/components/suggestions-primitives/RecentSearchesList.d.ts +17 -0
- package/dist/components/suggestions-primitives/RecentSearchesList.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/RecentSearchesList.js +46 -0
- package/dist/components/suggestions-primitives/SearchInput.d.ts +23 -0
- package/dist/components/suggestions-primitives/SearchInput.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/SearchInput.js +114 -0
- package/dist/components/suggestions-primitives/SuggestionItem.d.ts +31 -0
- package/dist/components/suggestions-primitives/SuggestionItem.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/SuggestionItem.js +47 -0
- package/dist/components/suggestions-primitives/SuggestionList.d.ts +26 -0
- package/dist/components/suggestions-primitives/SuggestionList.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/SuggestionList.js +35 -0
- package/dist/components/suggestions-primitives/SuggestionsContext.d.ts +44 -0
- package/dist/components/suggestions-primitives/SuggestionsContext.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/SuggestionsContext.js +18 -0
- package/dist/components/suggestions-primitives/SuggestionsDropdownComposition.d.ts +24 -0
- package/dist/components/suggestions-primitives/SuggestionsDropdownComposition.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/SuggestionsDropdownComposition.js +30 -0
- package/dist/components/suggestions-primitives/SuggestionsError.d.ts +11 -0
- package/dist/components/suggestions-primitives/SuggestionsError.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/SuggestionsError.js +19 -0
- package/dist/components/suggestions-primitives/SuggestionsLoading.d.ts +11 -0
- package/dist/components/suggestions-primitives/SuggestionsLoading.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/SuggestionsLoading.js +17 -0
- package/dist/components/suggestions-primitives/SuggestionsProvider.d.ts +38 -0
- package/dist/components/suggestions-primitives/SuggestionsProvider.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/SuggestionsProvider.js +259 -0
- package/dist/components/suggestions-primitives/TrendingList.d.ts +17 -0
- package/dist/components/suggestions-primitives/TrendingList.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/TrendingList.js +48 -0
- package/dist/components/suggestions-primitives/highlightMarkup.d.ts +31 -0
- package/dist/components/suggestions-primitives/highlightMarkup.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/highlightMarkup.js +70 -0
- package/dist/components/suggestions-primitives/index.d.ts +39 -0
- package/dist/components/suggestions-primitives/index.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/index.js +24 -0
- package/dist/docsearch/components/DocSearch.d.ts +4 -0
- package/dist/docsearch/components/DocSearch.d.ts.map +1 -0
- package/dist/docsearch/components/DocSearch.js +93 -0
- package/dist/docsearch/components/DocSearchButton.d.ts +4 -0
- package/dist/docsearch/components/DocSearchButton.d.ts.map +1 -0
- package/dist/docsearch/components/DocSearchButton.js +12 -0
- package/dist/docsearch/components/Footer.d.ts +8 -0
- package/dist/docsearch/components/Footer.d.ts.map +1 -0
- package/dist/docsearch/components/Footer.js +40 -0
- package/dist/docsearch/components/Highlight.d.ts +9 -0
- package/dist/docsearch/components/Highlight.d.ts.map +1 -0
- package/dist/docsearch/components/Highlight.js +48 -0
- package/dist/docsearch/components/Hit.d.ts +15 -0
- package/dist/docsearch/components/Hit.d.ts.map +1 -0
- package/dist/docsearch/components/Hit.js +96 -0
- package/dist/docsearch/components/Modal.d.ts +10 -0
- package/dist/docsearch/components/Modal.d.ts.map +1 -0
- package/dist/docsearch/components/Modal.js +57 -0
- package/dist/docsearch/components/Results.d.ts +23 -0
- package/dist/docsearch/components/Results.d.ts.map +1 -0
- package/dist/docsearch/components/Results.js +141 -0
- package/dist/docsearch/components/SearchBox.d.ts +11 -0
- package/dist/docsearch/components/SearchBox.d.ts.map +1 -0
- package/dist/docsearch/components/SearchBox.js +16 -0
- package/dist/docsearch/hooks/useDocSearch.d.ts +33 -0
- package/dist/docsearch/hooks/useDocSearch.d.ts.map +1 -0
- package/dist/docsearch/hooks/useDocSearch.js +224 -0
- package/dist/docsearch/hooks/useKeyboard.d.ts +17 -0
- package/dist/docsearch/hooks/useKeyboard.d.ts.map +1 -0
- package/dist/docsearch/hooks/useKeyboard.js +71 -0
- package/dist/docsearch/hooks/useSeekoraSearch.d.ts +27 -0
- package/dist/docsearch/hooks/useSeekoraSearch.d.ts.map +1 -0
- package/dist/docsearch/hooks/useSeekoraSearch.js +213 -0
- package/dist/docsearch/index.d.ts +13 -0
- package/dist/docsearch/index.d.ts.map +1 -0
- package/dist/docsearch/index.js +11 -0
- package/dist/docsearch/types.d.ts +175 -0
- package/dist/docsearch/types.d.ts.map +1 -0
- package/dist/docsearch/types.js +4 -0
- package/dist/docsearch.css +234 -0
- package/dist/hooks/useAnalytics.d.ts +24 -0
- package/dist/hooks/useAnalytics.d.ts.map +1 -0
- package/dist/hooks/useAnalytics.js +67 -0
- package/dist/hooks/useClickTracking.d.ts +36 -0
- package/dist/hooks/useClickTracking.d.ts.map +1 -0
- package/dist/hooks/useClickTracking.js +89 -0
- package/dist/hooks/useExperiment.d.ts +25 -0
- package/dist/hooks/useExperiment.d.ts.map +1 -0
- package/dist/hooks/useExperiment.js +123 -0
- package/dist/hooks/useFilters.d.ts +27 -0
- package/dist/hooks/useFilters.d.ts.map +1 -0
- package/dist/hooks/useFilters.js +86 -0
- package/dist/hooks/useKeyboardNavigation.d.ts +51 -0
- package/dist/hooks/useKeyboardNavigation.d.ts.map +1 -0
- package/dist/hooks/useKeyboardNavigation.js +113 -0
- package/dist/hooks/useNaturalLanguageFilters.d.ts +48 -0
- package/dist/hooks/useNaturalLanguageFilters.d.ts.map +1 -0
- package/dist/hooks/useNaturalLanguageFilters.js +221 -0
- 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/useQuerySuggestions.d.ts +21 -0
- package/dist/hooks/useQuerySuggestions.d.ts.map +1 -0
- package/dist/hooks/useQuerySuggestions.js +84 -0
- package/dist/hooks/useQuerySuggestionsEnhanced.d.ts +120 -0
- package/dist/hooks/useQuerySuggestionsEnhanced.d.ts.map +1 -0
- package/dist/hooks/useQuerySuggestionsEnhanced.js +444 -0
- package/dist/hooks/useSearchState.d.ts +35 -0
- package/dist/hooks/useSearchState.d.ts.map +1 -0
- package/dist/hooks/useSearchState.js +68 -0
- package/dist/hooks/useSeekoraSearch.d.ts +20 -0
- package/dist/hooks/useSeekoraSearch.d.ts.map +1 -0
- package/dist/hooks/useSeekoraSearch.js +63 -0
- package/dist/hooks/useSmartSuggestions.d.ts +55 -0
- package/dist/hooks/useSmartSuggestions.d.ts.map +1 -0
- package/dist/hooks/useSmartSuggestions.js +236 -0
- package/dist/hooks/useSuggestionsAnalytics.d.ts +93 -0
- package/dist/hooks/useSuggestionsAnalytics.d.ts.map +1 -0
- package/dist/hooks/useSuggestionsAnalytics.js +239 -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 +105 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +110 -0
- package/dist/index.umd.js +1 -0
- package/dist/src/index.d.ts +4469 -0
- package/dist/src/index.esm.js +18952 -0
- package/dist/src/index.esm.js.map +1 -0
- package/dist/src/index.js +19086 -0
- package/dist/src/index.js.map +1 -0
- package/dist/themes/createTheme.d.ts +8 -0
- package/dist/themes/createTheme.d.ts.map +1 -0
- package/dist/themes/createTheme.js +10 -0
- package/dist/themes/dark.d.ts +6 -0
- package/dist/themes/dark.d.ts.map +1 -0
- package/dist/themes/dark.js +34 -0
- package/dist/themes/default.d.ts +6 -0
- package/dist/themes/default.d.ts.map +1 -0
- package/dist/themes/default.js +71 -0
- package/dist/themes/mergeThemes.d.ts +7 -0
- package/dist/themes/mergeThemes.d.ts.map +1 -0
- package/dist/themes/mergeThemes.js +6 -0
- package/dist/themes/minimal.d.ts +6 -0
- package/dist/themes/minimal.d.ts.map +1 -0
- package/dist/themes/minimal.js +34 -0
- package/dist/themes/suggestions.d.ts +216 -0
- package/dist/themes/suggestions.d.ts.map +1 -0
- package/dist/themes/suggestions.js +546 -0
- package/dist/themes/types.d.ts +7 -0
- package/dist/themes/types.d.ts.map +1 -0
- package/dist/themes/types.js +6 -0
- package/dist/types/index.d.ts +33 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/utils/responsive.d.ts +130 -0
- package/dist/utils/responsive.d.ts.map +1 -0
- package/dist/utils/responsive.js +225 -0
- package/package.json +68 -0
- package/src/docsearch/docsearch.css +234 -0
|
@@ -0,0 +1,4469 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { ReactNode, CSSProperties } from 'react';
|
|
3
|
+
import { SearchOptions, SearchResponse, SeekoraClient, SearchContext, DataTypesEventPayload, ExtendedEventPayload, FilterOptions, FilterField, FiltersSchemaResponse, FacetValuesSearchResponse } from '@seekora-ai/search-sdk';
|
|
4
|
+
export { FacetSearchOptions, FacetValuesSearchResponse, FilterField, FilterOptions, FilterSchemaField, FilterStats, FilterValue, FiltersResponse, FiltersSchemaResponse } from '@seekora-ai/search-sdk';
|
|
5
|
+
import * as _seekora_ai_ui_sdk_types from '@seekora-ai/ui-sdk-types';
|
|
6
|
+
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';
|
|
7
|
+
export { FieldMapping, PriceRange, ProductBadge, ProductOption, ProductVariant, ResultItem, Theme, ThemeConfig, ViewMode } from '@seekora-ai/ui-sdk-types';
|
|
8
|
+
import { SearchStateManagerConfig, SearchStateManager, HighlightPart, SearchState } from '@seekora-ai/ui-sdk-core';
|
|
9
|
+
export { Fingerprint, FingerprintComponents, FingerprintConfig, FingerprintResult, getFingerprint, mergeThemes } from '@seekora-ai/ui-sdk-core';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* SearchBar Component
|
|
13
|
+
*
|
|
14
|
+
* Interactive search input component with query suggestions support
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
type SearchBarSize = 'small' | 'medium' | 'large';
|
|
18
|
+
interface SearchBarTheme {
|
|
19
|
+
container?: string;
|
|
20
|
+
input?: string;
|
|
21
|
+
inputFocused?: string;
|
|
22
|
+
suggestionsContainer?: string;
|
|
23
|
+
suggestionItem?: string;
|
|
24
|
+
suggestionItemHover?: string;
|
|
25
|
+
suggestionItemActive?: string;
|
|
26
|
+
searchIcon?: string;
|
|
27
|
+
clearButton?: string;
|
|
28
|
+
submitButton?: string;
|
|
29
|
+
}
|
|
30
|
+
interface SearchBarProps {
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
showSuggestions?: boolean;
|
|
33
|
+
debounceMs?: number;
|
|
34
|
+
minQueryLength?: number;
|
|
35
|
+
maxSuggestions?: number;
|
|
36
|
+
onSearch?: (query: string, results: any) => void;
|
|
37
|
+
onQueryChange?: (query: string) => void;
|
|
38
|
+
onSuggestionSelect?: (suggestion: string) => void;
|
|
39
|
+
onSearchStateChange?: (state: {
|
|
40
|
+
results: any;
|
|
41
|
+
loading: boolean;
|
|
42
|
+
error: Error | null;
|
|
43
|
+
}) => void;
|
|
44
|
+
searchOptions?: Omit<SearchOptions, 'q'>;
|
|
45
|
+
className?: string;
|
|
46
|
+
style?: React__default.CSSProperties;
|
|
47
|
+
theme?: SearchBarTheme;
|
|
48
|
+
renderSuggestion?: (suggestion: string, index: number) => React__default.ReactNode;
|
|
49
|
+
/** Custom render for the search icon. If not provided, a default magnifying glass SVG is rendered. */
|
|
50
|
+
renderSearchIcon?: () => React__default.ReactNode;
|
|
51
|
+
/** Whether to show a clear button when the query is non-empty (default: true) */
|
|
52
|
+
showClearButton?: boolean;
|
|
53
|
+
/** Custom render for the clear icon */
|
|
54
|
+
renderClearIcon?: () => React__default.ReactNode;
|
|
55
|
+
/** Whether to show a submit button to the right of the input (default: false) */
|
|
56
|
+
showSubmitButton?: boolean;
|
|
57
|
+
/** Custom render for the submit button */
|
|
58
|
+
renderSubmitButton?: () => React__default.ReactNode;
|
|
59
|
+
/** Size variant controlling padding and font size (default: 'medium') */
|
|
60
|
+
size?: SearchBarSize;
|
|
61
|
+
/** Trigger search automatically as user types, with debounce (default: false).
|
|
62
|
+
* When true, uses `debounceMs` for the delay. Enter still triggers immediately. */
|
|
63
|
+
searchAsYouType?: boolean;
|
|
64
|
+
}
|
|
65
|
+
declare const SearchBar: React__default.FC<SearchBarProps>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* SearchResults Component
|
|
69
|
+
*
|
|
70
|
+
* Displays search results with customizable rendering
|
|
71
|
+
* Includes keyboard navigation support (arrow keys, Enter to select)
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
interface SearchResultsTheme {
|
|
75
|
+
container?: string;
|
|
76
|
+
header?: string;
|
|
77
|
+
resultsList?: string;
|
|
78
|
+
resultItem?: string;
|
|
79
|
+
resultItemHover?: string;
|
|
80
|
+
resultTitle?: string;
|
|
81
|
+
resultDescription?: string;
|
|
82
|
+
resultImage?: string;
|
|
83
|
+
resultPrice?: string;
|
|
84
|
+
emptyState?: string;
|
|
85
|
+
errorState?: string;
|
|
86
|
+
pagination?: string;
|
|
87
|
+
/** Custom min-height class override */
|
|
88
|
+
minHeight?: string;
|
|
89
|
+
/** Custom min-width class override */
|
|
90
|
+
minWidth?: string;
|
|
91
|
+
}
|
|
92
|
+
interface SearchResultsProps {
|
|
93
|
+
results?: SearchResponse | null;
|
|
94
|
+
loading?: boolean;
|
|
95
|
+
error?: Error | null;
|
|
96
|
+
onResultClick?: (result: ResultItem, index: number) => void;
|
|
97
|
+
renderResult?: (result: ResultItem, index: number, isActive?: boolean) => React__default.ReactNode;
|
|
98
|
+
renderEmpty?: () => React__default.ReactNode;
|
|
99
|
+
renderError?: (error: Error) => React__default.ReactNode;
|
|
100
|
+
className?: string;
|
|
101
|
+
style?: React__default.CSSProperties;
|
|
102
|
+
theme?: SearchResultsTheme;
|
|
103
|
+
itemsPerPage?: number;
|
|
104
|
+
showPagination?: boolean;
|
|
105
|
+
/** Display mode: 'list' (default), 'card', or 'grid' */
|
|
106
|
+
viewMode?: ViewMode;
|
|
107
|
+
/** Field mapping configuration for extracting data from results */
|
|
108
|
+
fieldMapping?: FieldMapping;
|
|
109
|
+
/** Function to extract results array from the response (if custom structure) */
|
|
110
|
+
extractResults?: (response: any) => any[];
|
|
111
|
+
/** Enable keyboard navigation (arrow keys, Enter to select) */
|
|
112
|
+
enableKeyboardNavigation?: boolean;
|
|
113
|
+
/** Auto-focus the results container */
|
|
114
|
+
autoFocus?: boolean;
|
|
115
|
+
/** Minimum height to prevent container collapse when empty (default: '400px') */
|
|
116
|
+
minHeight?: string;
|
|
117
|
+
/** Minimum width to prevent container shrinking (default: '100%') */
|
|
118
|
+
minWidth?: string;
|
|
119
|
+
}
|
|
120
|
+
declare const SearchResults: React__default.FC<SearchResultsProps>;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* SearchProvider Component
|
|
124
|
+
*
|
|
125
|
+
* Provides Seekora client and context to child components.
|
|
126
|
+
* Supports A/B testing via abTestId/abVariant props.
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
interface SearchContextValue {
|
|
130
|
+
client: SeekoraClient;
|
|
131
|
+
theme: Theme;
|
|
132
|
+
enableAnalytics: boolean;
|
|
133
|
+
autoTrackSearch: boolean;
|
|
134
|
+
stateManager: SearchStateManager;
|
|
135
|
+
}
|
|
136
|
+
interface SearchProviderProps {
|
|
137
|
+
client: SeekoraClient;
|
|
138
|
+
theme?: ThemeConfig;
|
|
139
|
+
enableAnalytics?: boolean;
|
|
140
|
+
autoTrackSearch?: boolean;
|
|
141
|
+
stateManager?: SearchStateManagerConfig;
|
|
142
|
+
children: ReactNode;
|
|
143
|
+
/** A/B test experiment ID to include in all analytics events */
|
|
144
|
+
abTestId?: string;
|
|
145
|
+
/** A/B test variant to include in all analytics events */
|
|
146
|
+
abVariant?: string;
|
|
147
|
+
/** Auto-fetch experiment assignments on mount (default: false) */
|
|
148
|
+
experiments?: boolean;
|
|
149
|
+
}
|
|
150
|
+
declare const SearchProvider: React__default.FC<SearchProviderProps>;
|
|
151
|
+
declare const useSearchContext: () => SearchContextValue;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Stats Component
|
|
155
|
+
*
|
|
156
|
+
* Displays search statistics (total results, processing time, etc.)
|
|
157
|
+
* Supports inline, badge, and detailed display variants.
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
interface StatsTheme {
|
|
161
|
+
container?: string;
|
|
162
|
+
text?: string;
|
|
163
|
+
highlight?: string;
|
|
164
|
+
separator?: string;
|
|
165
|
+
badge?: string;
|
|
166
|
+
badgeLabel?: string;
|
|
167
|
+
badgeValue?: string;
|
|
168
|
+
detailed?: string;
|
|
169
|
+
detailedRow?: string;
|
|
170
|
+
detailedLabel?: string;
|
|
171
|
+
detailedValue?: string;
|
|
172
|
+
}
|
|
173
|
+
interface StatsProps {
|
|
174
|
+
/** Search results response */
|
|
175
|
+
results?: SearchResponse | null;
|
|
176
|
+
/** Custom render function */
|
|
177
|
+
renderStats?: (stats: {
|
|
178
|
+
totalResults: number;
|
|
179
|
+
processingTime?: number;
|
|
180
|
+
query?: string;
|
|
181
|
+
}) => React__default.ReactNode;
|
|
182
|
+
/** Custom className */
|
|
183
|
+
className?: string;
|
|
184
|
+
/** Custom styles */
|
|
185
|
+
style?: React__default.CSSProperties;
|
|
186
|
+
/** Custom theme */
|
|
187
|
+
theme?: StatsTheme;
|
|
188
|
+
/** Show processing time */
|
|
189
|
+
showProcessingTime?: boolean;
|
|
190
|
+
/** Show query */
|
|
191
|
+
showQuery?: boolean;
|
|
192
|
+
/** Custom separator between stats */
|
|
193
|
+
separator?: string;
|
|
194
|
+
/** Display variant */
|
|
195
|
+
variant?: 'inline' | 'badge' | 'detailed';
|
|
196
|
+
/** Show result count (default: true) */
|
|
197
|
+
showResultCount?: boolean;
|
|
198
|
+
/** Custom number formatter (default: toLocaleString) */
|
|
199
|
+
formatNumber?: (n: number) => string;
|
|
200
|
+
}
|
|
201
|
+
declare const Stats: React__default.FC<StatsProps>;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Pagination Component
|
|
205
|
+
*
|
|
206
|
+
* Displays pagination controls for search results.
|
|
207
|
+
* Supports three display variants: numbered, load-more, and simple.
|
|
208
|
+
*
|
|
209
|
+
* CSS Variables (applied to the container element):
|
|
210
|
+
* --seekora-pagination-bg
|
|
211
|
+
* --seekora-pagination-color
|
|
212
|
+
* --seekora-pagination-active-bg
|
|
213
|
+
* --seekora-pagination-active-color
|
|
214
|
+
* --seekora-pagination-border
|
|
215
|
+
* --seekora-pagination-radius
|
|
216
|
+
*/
|
|
217
|
+
|
|
218
|
+
interface PaginationTheme {
|
|
219
|
+
container?: string;
|
|
220
|
+
list?: string;
|
|
221
|
+
item?: string;
|
|
222
|
+
itemActive?: string;
|
|
223
|
+
itemDisabled?: string;
|
|
224
|
+
link?: string;
|
|
225
|
+
ellipsis?: string;
|
|
226
|
+
/** Class for the Load More button */
|
|
227
|
+
loadMoreButton?: string;
|
|
228
|
+
/** Class for the Load More descriptive text (e.g. "X remaining") */
|
|
229
|
+
loadMoreText?: string;
|
|
230
|
+
/** Class for the simple variant outer container */
|
|
231
|
+
simpleContainer?: string;
|
|
232
|
+
/** Class for the "Page X of Y" text in the simple variant */
|
|
233
|
+
simpleText?: string;
|
|
234
|
+
/** Class for Previous/Next buttons in the simple variant */
|
|
235
|
+
simpleButton?: string;
|
|
236
|
+
/** Class for the "Page X of Y" info text (usable in any variant) */
|
|
237
|
+
pageInfo?: string;
|
|
238
|
+
}
|
|
239
|
+
interface PaginationProps {
|
|
240
|
+
/** Search results response */
|
|
241
|
+
results?: SearchResponse | null;
|
|
242
|
+
/** Current page number (1-indexed) */
|
|
243
|
+
currentPage?: number;
|
|
244
|
+
/** Items per page */
|
|
245
|
+
itemsPerPage?: number;
|
|
246
|
+
/** Total number of pages */
|
|
247
|
+
totalPages?: number;
|
|
248
|
+
/** Callback when page changes */
|
|
249
|
+
onPageChange?: (page: number) => void;
|
|
250
|
+
/** Maximum number of page buttons to show */
|
|
251
|
+
maxPages?: number;
|
|
252
|
+
/** Show first/last page buttons */
|
|
253
|
+
showFirstLast?: boolean;
|
|
254
|
+
/** Show previous/next buttons */
|
|
255
|
+
showPrevNext?: boolean;
|
|
256
|
+
/** Custom render function for page button */
|
|
257
|
+
renderPageButton?: (page: number, isActive: boolean, isDisabled: boolean) => React__default.ReactNode;
|
|
258
|
+
/** Custom className */
|
|
259
|
+
className?: string;
|
|
260
|
+
/** Custom styles */
|
|
261
|
+
style?: React__default.CSSProperties;
|
|
262
|
+
/** Custom theme */
|
|
263
|
+
theme?: PaginationTheme;
|
|
264
|
+
/**
|
|
265
|
+
* Display variant.
|
|
266
|
+
* - 'numbered' (default): numbered page buttons with prev/next
|
|
267
|
+
* - 'load-more': single "Load More" button
|
|
268
|
+
* - 'simple': Previous / Next buttons with "Page X of Y" text
|
|
269
|
+
*/
|
|
270
|
+
variant?: 'numbered' | 'load-more' | 'simple';
|
|
271
|
+
/** Label for the Load More button (default: "Load More") */
|
|
272
|
+
loadMoreText?: string;
|
|
273
|
+
/**
|
|
274
|
+
* Button / text sizing.
|
|
275
|
+
* - 'small': compact
|
|
276
|
+
* - 'medium' (default): standard
|
|
277
|
+
* - 'large': spacious
|
|
278
|
+
*/
|
|
279
|
+
size?: 'small' | 'medium' | 'large';
|
|
280
|
+
/**
|
|
281
|
+
* Show "Page X of Y" text.
|
|
282
|
+
* Defaults to false for numbered, true for simple.
|
|
283
|
+
*/
|
|
284
|
+
showPageInfo?: boolean;
|
|
285
|
+
/** Label for the Previous button (default: "Previous") */
|
|
286
|
+
previousLabel?: string;
|
|
287
|
+
/** Label for the Next button (default: "Next") */
|
|
288
|
+
nextLabel?: string;
|
|
289
|
+
}
|
|
290
|
+
declare const Pagination: React__default.FC<PaginationProps>;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* SortBy Component
|
|
294
|
+
*
|
|
295
|
+
* Displays sort options for search results in multiple display variants:
|
|
296
|
+
* - dropdown (default) — native select element
|
|
297
|
+
* - button-group — horizontal row of toggle buttons
|
|
298
|
+
* - radio-group — vertical list of radio inputs
|
|
299
|
+
*
|
|
300
|
+
* Integrates with SearchStateManager for automatic state sync.
|
|
301
|
+
*
|
|
302
|
+
* CSS Variables (apply on a parent element to customize):
|
|
303
|
+
* --seekora-sort-bg — background color
|
|
304
|
+
* --seekora-sort-color — text color
|
|
305
|
+
* --seekora-sort-border — border color
|
|
306
|
+
* --seekora-sort-active-bg — active item background
|
|
307
|
+
* --seekora-sort-active-color — active item text color
|
|
308
|
+
*/
|
|
309
|
+
|
|
310
|
+
interface SortOption {
|
|
311
|
+
value: string;
|
|
312
|
+
label: string;
|
|
313
|
+
}
|
|
314
|
+
type SortByVariant = 'dropdown' | 'button-group' | 'radio-group';
|
|
315
|
+
type SortBySize = 'small' | 'medium' | 'large';
|
|
316
|
+
interface SortByTheme {
|
|
317
|
+
/** Root container */
|
|
318
|
+
container?: string;
|
|
319
|
+
/** Dropdown select element */
|
|
320
|
+
select?: string;
|
|
321
|
+
/** Dropdown option element */
|
|
322
|
+
option?: string;
|
|
323
|
+
/** Optional label above the control */
|
|
324
|
+
label?: string;
|
|
325
|
+
/** Button group wrapper */
|
|
326
|
+
buttonGroup?: string;
|
|
327
|
+
/** Individual button in the group */
|
|
328
|
+
buttonGroupItem?: string;
|
|
329
|
+
/** Active button in the group */
|
|
330
|
+
buttonGroupItemActive?: string;
|
|
331
|
+
/** Radio group wrapper */
|
|
332
|
+
radioGroup?: string;
|
|
333
|
+
/** Individual radio row (input + label) */
|
|
334
|
+
radioItem?: string;
|
|
335
|
+
/** Active radio row */
|
|
336
|
+
radioItemActive?: string;
|
|
337
|
+
/** Radio label text */
|
|
338
|
+
radioLabel?: string;
|
|
339
|
+
}
|
|
340
|
+
interface SortByProps {
|
|
341
|
+
/** Available sort options */
|
|
342
|
+
options: SortOption[];
|
|
343
|
+
/** Current sort value (controlled mode - overrides StateManager) */
|
|
344
|
+
value?: string;
|
|
345
|
+
/** Default sort value */
|
|
346
|
+
defaultValue?: string;
|
|
347
|
+
/** Callback when sort changes */
|
|
348
|
+
onSortChange?: (value: string) => void;
|
|
349
|
+
/** Custom render function for select (only used in dropdown variant) */
|
|
350
|
+
renderSelect?: (props: {
|
|
351
|
+
value: string;
|
|
352
|
+
onChange: (e: React__default.ChangeEvent<HTMLSelectElement>) => void;
|
|
353
|
+
options: SortOption[];
|
|
354
|
+
}) => React__default.ReactNode;
|
|
355
|
+
/** Custom className */
|
|
356
|
+
className?: string;
|
|
357
|
+
/** Custom styles */
|
|
358
|
+
style?: React__default.CSSProperties;
|
|
359
|
+
/** Custom theme */
|
|
360
|
+
theme?: SortByTheme;
|
|
361
|
+
/** Placeholder text (dropdown variant) */
|
|
362
|
+
placeholder?: string;
|
|
363
|
+
/** Whether to sync with SearchStateManager (default: true) */
|
|
364
|
+
syncWithState?: boolean;
|
|
365
|
+
/** Display variant (default: 'dropdown') */
|
|
366
|
+
variant?: SortByVariant;
|
|
367
|
+
/** Optional label text displayed above the control */
|
|
368
|
+
label?: string;
|
|
369
|
+
/** Whether to show the label (default: true when label is provided) */
|
|
370
|
+
showLabel?: boolean;
|
|
371
|
+
/** Size variant affecting padding and font size (default: 'medium') */
|
|
372
|
+
size?: SortBySize;
|
|
373
|
+
}
|
|
374
|
+
declare const SortBy: React__default.FC<SortByProps>;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Facets Component
|
|
378
|
+
*
|
|
379
|
+
* Displays facet filters for search results with multiple display variants,
|
|
380
|
+
* client-side search, count badges, and color swatch support.
|
|
381
|
+
*/
|
|
382
|
+
|
|
383
|
+
interface FacetItem {
|
|
384
|
+
value: string;
|
|
385
|
+
count: number;
|
|
386
|
+
selected?: boolean;
|
|
387
|
+
}
|
|
388
|
+
interface FacetStats {
|
|
389
|
+
min: number;
|
|
390
|
+
max: number;
|
|
391
|
+
avg?: number;
|
|
392
|
+
sum?: number;
|
|
393
|
+
}
|
|
394
|
+
interface FacetRangeItem {
|
|
395
|
+
label: string;
|
|
396
|
+
from?: number;
|
|
397
|
+
to?: number;
|
|
398
|
+
}
|
|
399
|
+
interface FacetRangeConfig {
|
|
400
|
+
field: string;
|
|
401
|
+
ranges: FacetRangeItem[];
|
|
402
|
+
}
|
|
403
|
+
interface Facet {
|
|
404
|
+
field: string;
|
|
405
|
+
label?: string;
|
|
406
|
+
items: FacetItem[];
|
|
407
|
+
stats?: FacetStats;
|
|
408
|
+
}
|
|
409
|
+
interface FacetsTheme {
|
|
410
|
+
container?: string;
|
|
411
|
+
facet?: string;
|
|
412
|
+
facetHeader?: string;
|
|
413
|
+
facetTitle?: string;
|
|
414
|
+
facetList?: string;
|
|
415
|
+
facetItem?: string;
|
|
416
|
+
facetItemActive?: string;
|
|
417
|
+
facetItemCount?: string;
|
|
418
|
+
facetItemLabel?: string;
|
|
419
|
+
checkbox?: string;
|
|
420
|
+
/** Color swatch circle/square */
|
|
421
|
+
colorSwatch?: string;
|
|
422
|
+
/** Color swatch when selected */
|
|
423
|
+
colorSwatchSelected?: string;
|
|
424
|
+
/** Inner element of color swatch (for checkmark overlay) */
|
|
425
|
+
colorSwatchInner?: string;
|
|
426
|
+
/** Search input within a facet group */
|
|
427
|
+
searchInput?: string;
|
|
428
|
+
/** Collapsible header row */
|
|
429
|
+
collapsibleHeader?: string;
|
|
430
|
+
/** Chevron/expand icon in collapsible header */
|
|
431
|
+
collapsibleIcon?: string;
|
|
432
|
+
/** Count badge pill */
|
|
433
|
+
countBadge?: string;
|
|
434
|
+
/** Range button (pre-configured range option) */
|
|
435
|
+
rangeButton?: string;
|
|
436
|
+
/** Active range button */
|
|
437
|
+
rangeButtonActive?: string;
|
|
438
|
+
/** Count badge on range button */
|
|
439
|
+
rangeButtonCount?: string;
|
|
440
|
+
/** Clear button for range filters */
|
|
441
|
+
rangeClear?: string;
|
|
442
|
+
}
|
|
443
|
+
type FacetVariant = 'checkbox' | 'color-swatch' | 'collapsible';
|
|
444
|
+
type FacetSize = 'small' | 'medium' | 'large';
|
|
445
|
+
interface FacetsProps {
|
|
446
|
+
/** Search results response */
|
|
447
|
+
results?: SearchResponse | null;
|
|
448
|
+
/** Custom facets data */
|
|
449
|
+
facets?: Facet[];
|
|
450
|
+
/** Callback when facet is selected/deselected */
|
|
451
|
+
onFacetChange?: (field: string, value: string, selected: boolean) => void;
|
|
452
|
+
/** Custom render function for facet */
|
|
453
|
+
renderFacet?: (facet: Facet, index: number) => React__default.ReactNode;
|
|
454
|
+
/** Custom render function for facet item */
|
|
455
|
+
renderFacetItem?: (item: FacetItem, facet: Facet, index: number) => React__default.ReactNode;
|
|
456
|
+
/** Maximum number of items to show per facet */
|
|
457
|
+
maxItems?: number;
|
|
458
|
+
/** Show "Show more" button */
|
|
459
|
+
showMore?: boolean;
|
|
460
|
+
/** Custom className */
|
|
461
|
+
className?: string;
|
|
462
|
+
/** Custom styles */
|
|
463
|
+
style?: React__default.CSSProperties;
|
|
464
|
+
/** Custom theme */
|
|
465
|
+
theme?: FacetsTheme;
|
|
466
|
+
/** Display variant: checkbox (default), color-swatch, or collapsible */
|
|
467
|
+
variant?: FacetVariant;
|
|
468
|
+
/** When true, show a search input at the top of each facet group */
|
|
469
|
+
searchable?: boolean;
|
|
470
|
+
/** Show count badges (default: true) */
|
|
471
|
+
showCounts?: boolean;
|
|
472
|
+
/** Maps facet values to CSS colors (used by color-swatch variant) */
|
|
473
|
+
colorMap?: Record<string, string>;
|
|
474
|
+
/** For collapsible variant, whether facets start collapsed (default: false) */
|
|
475
|
+
defaultCollapsed?: boolean;
|
|
476
|
+
/** Size preset: small, medium (default), or large */
|
|
477
|
+
size?: FacetSize;
|
|
478
|
+
/** Pre-configured range button definitions for numeric facets */
|
|
479
|
+
facetRanges?: FacetRangeConfig[];
|
|
480
|
+
/** Use dedicated Filters API instead of extracting facets from search results */
|
|
481
|
+
useFiltersApi?: boolean;
|
|
482
|
+
/** Fields that should use disjunctive (OR) faceting (only with useFiltersApi) */
|
|
483
|
+
disjunctiveFacets?: string[];
|
|
484
|
+
/** Hide facets that have no selectable values (default: true) */
|
|
485
|
+
hideEmptyFacets?: boolean;
|
|
486
|
+
/** Fields that should start collapsed (collapsible variant only). Overrides defaultCollapsed for listed fields. */
|
|
487
|
+
defaultCollapsedFields?: string[];
|
|
488
|
+
/** Callback fired when facet availability changes. Receives true when facets are available, false when empty. */
|
|
489
|
+
onFacetsAvailable?: (available: boolean) => void;
|
|
490
|
+
}
|
|
491
|
+
declare const Facets: React__default.FC<FacetsProps>;
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* FacetDropdown Component
|
|
495
|
+
*
|
|
496
|
+
* A dropdown component that displays facet values from a specific field
|
|
497
|
+
* and allows users to filter search results by selecting values.
|
|
498
|
+
*
|
|
499
|
+
* Can be used standalone (fetches its own data) or integrated with SearchProvider.
|
|
500
|
+
*
|
|
501
|
+
* @cssVariables
|
|
502
|
+
* Customize the dropdown appearance using CSS variables:
|
|
503
|
+
*
|
|
504
|
+
* Button:
|
|
505
|
+
* - `--facet-dropdown-button-bg`: Button background color
|
|
506
|
+
* - `--facet-dropdown-text`: Button text color
|
|
507
|
+
* - `--facet-dropdown-border`: Button and panel border color
|
|
508
|
+
* - `--facet-dropdown-font-size`: Button font size (default: 0.875rem)
|
|
509
|
+
* - `--facet-dropdown-font-weight`: Button font weight (default: 500)
|
|
510
|
+
*
|
|
511
|
+
* Dropdown Panel:
|
|
512
|
+
* - `--facet-dropdown-bg`: Panel background color
|
|
513
|
+
* - `--facet-dropdown-shadow`: Panel box shadow
|
|
514
|
+
*
|
|
515
|
+
* Options:
|
|
516
|
+
* - `--facet-dropdown-option-text`: Option text color
|
|
517
|
+
* - `--facet-dropdown-option-font-size`: Option font size (default: 0.875rem)
|
|
518
|
+
* - `--facet-dropdown-option-font-weight-active`: Active option font weight (default: 500)
|
|
519
|
+
* - `--facet-dropdown-option-active-bg`: Active option background color
|
|
520
|
+
*
|
|
521
|
+
* Count Badge:
|
|
522
|
+
* - `--facet-dropdown-count-text`: Count text color
|
|
523
|
+
* - `--facet-dropdown-count-font-size`: Count font size (default: 0.75rem)
|
|
524
|
+
*
|
|
525
|
+
* Scrollbar:
|
|
526
|
+
* - `--facet-dropdown-scrollbar-thumb`: Scrollbar thumb color
|
|
527
|
+
* - `--facet-dropdown-scrollbar-thumb-hover`: Scrollbar thumb hover color
|
|
528
|
+
*
|
|
529
|
+
* @example
|
|
530
|
+
* ```tsx
|
|
531
|
+
* <FacetDropdown
|
|
532
|
+
* field="category"
|
|
533
|
+
* placeholder="All Categories"
|
|
534
|
+
* applyFilter={true}
|
|
535
|
+
* showCounts={true}
|
|
536
|
+
* />
|
|
537
|
+
* ```
|
|
538
|
+
*/
|
|
539
|
+
|
|
540
|
+
interface FacetDropdownOption {
|
|
541
|
+
value: string;
|
|
542
|
+
count: number;
|
|
543
|
+
label?: string;
|
|
544
|
+
}
|
|
545
|
+
interface FacetDropdownTheme {
|
|
546
|
+
button?: string;
|
|
547
|
+
buttonOpen?: string;
|
|
548
|
+
panel?: string;
|
|
549
|
+
option?: string;
|
|
550
|
+
optionActive?: string;
|
|
551
|
+
optionHover?: string;
|
|
552
|
+
caretIcon?: string;
|
|
553
|
+
}
|
|
554
|
+
interface FacetDropdownProps {
|
|
555
|
+
/** The facet field to display (e.g., "category", "brand", "product_type") */
|
|
556
|
+
field: string;
|
|
557
|
+
/** Placeholder text when no value is selected */
|
|
558
|
+
placeholder?: string;
|
|
559
|
+
/** Custom className for the button */
|
|
560
|
+
className?: string;
|
|
561
|
+
/** Custom theme overrides */
|
|
562
|
+
theme?: FacetDropdownTheme;
|
|
563
|
+
/** Called when a value is selected */
|
|
564
|
+
onChange?: (value: string) => void;
|
|
565
|
+
/** Current selected value (controlled mode) */
|
|
566
|
+
value?: string;
|
|
567
|
+
/** Maximum number of options to show before scrolling */
|
|
568
|
+
maxOptions?: number;
|
|
569
|
+
/** Whether to show facet counts */
|
|
570
|
+
showCounts?: boolean;
|
|
571
|
+
/** Custom options (if you want to provide static options instead of fetching) */
|
|
572
|
+
options?: FacetDropdownOption[];
|
|
573
|
+
/** Standalone mode: provide your own search client */
|
|
574
|
+
client?: SeekoraClient;
|
|
575
|
+
/** Apply filter immediately on selection (default: true) */
|
|
576
|
+
applyFilter?: boolean;
|
|
577
|
+
/** Navigate to search page on selection (default: false) */
|
|
578
|
+
navigateOnSelect?: boolean;
|
|
579
|
+
/** Base URL for navigation (e.g., "/search") */
|
|
580
|
+
searchPageUrl?: string;
|
|
581
|
+
/** Use dedicated Filters API instead of search API for fetching facet values */
|
|
582
|
+
useFiltersApi?: boolean;
|
|
583
|
+
}
|
|
584
|
+
declare const FacetDropdown: React__default.FC<FacetDropdownProps>;
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* CurrentRefinements Component
|
|
588
|
+
*
|
|
589
|
+
* Displays currently active filters/refinements with ability to clear them.
|
|
590
|
+
* Supports StateManager auto-sync, display variants, layout modes, and animations.
|
|
591
|
+
*/
|
|
592
|
+
|
|
593
|
+
interface Refinement {
|
|
594
|
+
field: string;
|
|
595
|
+
label?: string;
|
|
596
|
+
value: string;
|
|
597
|
+
displayValue?: string;
|
|
598
|
+
}
|
|
599
|
+
interface CurrentRefinementsTheme {
|
|
600
|
+
container?: string;
|
|
601
|
+
list?: string;
|
|
602
|
+
item?: string;
|
|
603
|
+
label?: string;
|
|
604
|
+
value?: string;
|
|
605
|
+
clearButton?: string;
|
|
606
|
+
clearAllButton?: string;
|
|
607
|
+
/** Variant-specific class slots */
|
|
608
|
+
chip?: string;
|
|
609
|
+
tag?: string;
|
|
610
|
+
pill?: string;
|
|
611
|
+
badge?: string;
|
|
612
|
+
group?: string;
|
|
613
|
+
groupLabel?: string;
|
|
614
|
+
}
|
|
615
|
+
/** Display variant for refinement items */
|
|
616
|
+
type RefinementVariant = 'chips' | 'tags' | 'pills' | 'badges' | 'text-list';
|
|
617
|
+
/** Layout variant for the container */
|
|
618
|
+
type RefinementLayout = 'horizontal' | 'vertical' | 'grouped';
|
|
619
|
+
interface CurrentRefinementsProps {
|
|
620
|
+
/** Current refinements (if not provided, auto-reads from StateManager) */
|
|
621
|
+
refinements?: Refinement[];
|
|
622
|
+
/** Callback when a refinement is cleared */
|
|
623
|
+
onRefinementClear?: (field: string, value: string) => void;
|
|
624
|
+
/** Callback when all refinements are cleared */
|
|
625
|
+
onClearAll?: () => void;
|
|
626
|
+
/** Custom render function for refinement */
|
|
627
|
+
renderRefinement?: (refinement: Refinement, index: number) => React__default.ReactNode;
|
|
628
|
+
/** Show "Clear all" button */
|
|
629
|
+
showClearAll?: boolean;
|
|
630
|
+
/** Display variant (default: 'chips') */
|
|
631
|
+
variant?: RefinementVariant;
|
|
632
|
+
/** Layout mode (default: 'horizontal') */
|
|
633
|
+
layout?: RefinementLayout;
|
|
634
|
+
/** Per-field color mapping */
|
|
635
|
+
fieldColors?: Record<string, string>;
|
|
636
|
+
/** Custom close icon renderer */
|
|
637
|
+
renderCloseIcon?: () => React__default.ReactNode;
|
|
638
|
+
/** Custom className */
|
|
639
|
+
className?: string;
|
|
640
|
+
/** Custom styles */
|
|
641
|
+
style?: React__default.CSSProperties;
|
|
642
|
+
/** Custom theme */
|
|
643
|
+
theme?: CurrentRefinementsTheme;
|
|
644
|
+
/** Fields to exclude from display (e.g. ['category'] on collection pages) */
|
|
645
|
+
excludeFields?: string[];
|
|
646
|
+
}
|
|
647
|
+
declare const CurrentRefinements: React__default.FC<CurrentRefinementsProps>;
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* ClearRefinements Component
|
|
651
|
+
*
|
|
652
|
+
* A standalone button to clear all active refinements/filters
|
|
653
|
+
* Integrates with SearchStateManager for automatic state sync
|
|
654
|
+
*/
|
|
655
|
+
|
|
656
|
+
interface ClearRefinementsTheme {
|
|
657
|
+
root?: string;
|
|
658
|
+
button?: string;
|
|
659
|
+
buttonDisabled?: string;
|
|
660
|
+
}
|
|
661
|
+
interface ClearRefinementsProps {
|
|
662
|
+
/** Button text when there are refinements to clear */
|
|
663
|
+
clearsQuery?: boolean;
|
|
664
|
+
/** Whether clicking should also clear the search query */
|
|
665
|
+
resetLabel?: string;
|
|
666
|
+
/** Button text shown when there are no refinements */
|
|
667
|
+
disabledLabel?: string;
|
|
668
|
+
/** Fields to include (if not specified, all fields are included) */
|
|
669
|
+
includedFields?: string[];
|
|
670
|
+
/** Fields to exclude from clearing */
|
|
671
|
+
excludedFields?: string[];
|
|
672
|
+
/** Callback when refinements are cleared */
|
|
673
|
+
onClear?: () => void;
|
|
674
|
+
/** Custom render function */
|
|
675
|
+
renderButton?: (props: {
|
|
676
|
+
canClear: boolean;
|
|
677
|
+
onClick: () => void;
|
|
678
|
+
disabled: boolean;
|
|
679
|
+
}) => React__default.ReactNode;
|
|
680
|
+
/** Custom className */
|
|
681
|
+
className?: string;
|
|
682
|
+
/** Custom styles */
|
|
683
|
+
style?: React__default.CSSProperties;
|
|
684
|
+
/** Custom theme */
|
|
685
|
+
theme?: ClearRefinementsTheme;
|
|
686
|
+
/** Whether to hide when there are no refinements */
|
|
687
|
+
hideWhenEmpty?: boolean;
|
|
688
|
+
}
|
|
689
|
+
declare const ClearRefinements: React__default.FC<ClearRefinementsProps>;
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* SearchLayout Component
|
|
693
|
+
*
|
|
694
|
+
* Provides a layout structure for search interfaces with sidebar and main content
|
|
695
|
+
*/
|
|
696
|
+
|
|
697
|
+
interface SearchLayoutTheme {
|
|
698
|
+
container?: string;
|
|
699
|
+
sidebar?: string;
|
|
700
|
+
main?: string;
|
|
701
|
+
header?: string;
|
|
702
|
+
footer?: string;
|
|
703
|
+
}
|
|
704
|
+
interface SearchLayoutProps {
|
|
705
|
+
/** Content to render in the sidebar (filters, facets, etc.) */
|
|
706
|
+
sidebar?: React__default.ReactNode;
|
|
707
|
+
/** Content to render in the main area (results, etc.) */
|
|
708
|
+
children: React__default.ReactNode;
|
|
709
|
+
/** Header content */
|
|
710
|
+
header?: React__default.ReactNode;
|
|
711
|
+
/** Footer content */
|
|
712
|
+
footer?: React__default.ReactNode;
|
|
713
|
+
/** Sidebar width */
|
|
714
|
+
sidebarWidth?: string;
|
|
715
|
+
/** Custom className */
|
|
716
|
+
className?: string;
|
|
717
|
+
/** Custom styles */
|
|
718
|
+
style?: React__default.CSSProperties;
|
|
719
|
+
/** Custom theme */
|
|
720
|
+
theme?: SearchLayoutTheme;
|
|
721
|
+
/** Show sidebar on mobile */
|
|
722
|
+
showSidebarOnMobile?: boolean;
|
|
723
|
+
}
|
|
724
|
+
declare const SearchLayout: React__default.FC<SearchLayoutProps>;
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* RangeInput Component
|
|
728
|
+
*
|
|
729
|
+
* Displays a range input for filtering numeric values (e.g., price range)
|
|
730
|
+
* Integrates with SearchStateManager for automatic state sync
|
|
731
|
+
*/
|
|
732
|
+
|
|
733
|
+
interface RangeInputTheme {
|
|
734
|
+
container?: string;
|
|
735
|
+
label?: string;
|
|
736
|
+
inputGroup?: string;
|
|
737
|
+
input?: string;
|
|
738
|
+
separator?: string;
|
|
739
|
+
button?: string;
|
|
740
|
+
}
|
|
741
|
+
interface RangeInputProps {
|
|
742
|
+
/** Field name for the range filter */
|
|
743
|
+
field: string;
|
|
744
|
+
/** Label for the range input */
|
|
745
|
+
label?: string;
|
|
746
|
+
/** Minimum value */
|
|
747
|
+
min?: number;
|
|
748
|
+
/** Maximum value */
|
|
749
|
+
max?: number;
|
|
750
|
+
/** Current minimum value (controlled mode) */
|
|
751
|
+
currentMin?: number;
|
|
752
|
+
/** Current maximum value (controlled mode) */
|
|
753
|
+
currentMax?: number;
|
|
754
|
+
/** Step value for inputs */
|
|
755
|
+
step?: number;
|
|
756
|
+
/** Callback when range changes */
|
|
757
|
+
onRangeChange?: (min: number | undefined, max: number | undefined) => void;
|
|
758
|
+
/** Custom render function */
|
|
759
|
+
renderRangeInput?: (props: {
|
|
760
|
+
min: number | undefined;
|
|
761
|
+
max: number | undefined;
|
|
762
|
+
onMinChange: (value: number | undefined) => void;
|
|
763
|
+
onMaxChange: (value: number | undefined) => void;
|
|
764
|
+
onApply: () => void;
|
|
765
|
+
}) => React__default.ReactNode;
|
|
766
|
+
/** Custom className */
|
|
767
|
+
className?: string;
|
|
768
|
+
/** Custom styles */
|
|
769
|
+
style?: React__default.CSSProperties;
|
|
770
|
+
/** Custom theme */
|
|
771
|
+
theme?: RangeInputTheme;
|
|
772
|
+
/** Show apply button */
|
|
773
|
+
showApplyButton?: boolean;
|
|
774
|
+
/** Placeholder text for inputs */
|
|
775
|
+
placeholder?: {
|
|
776
|
+
min?: string;
|
|
777
|
+
max?: string;
|
|
778
|
+
};
|
|
779
|
+
/** Whether to sync with SearchStateManager (default: true) */
|
|
780
|
+
syncWithState?: boolean;
|
|
781
|
+
}
|
|
782
|
+
declare const RangeInput: React__default.FC<RangeInputProps>;
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* HitsPerPage Component
|
|
786
|
+
*
|
|
787
|
+
* A dropdown to let users change the number of displayed hits per page
|
|
788
|
+
* Integrates with SearchStateManager for automatic state sync
|
|
789
|
+
*/
|
|
790
|
+
|
|
791
|
+
interface HitsPerPageItem {
|
|
792
|
+
value: number;
|
|
793
|
+
label: string;
|
|
794
|
+
default?: boolean;
|
|
795
|
+
}
|
|
796
|
+
interface HitsPerPageTheme {
|
|
797
|
+
root?: string;
|
|
798
|
+
select?: string;
|
|
799
|
+
option?: string;
|
|
800
|
+
}
|
|
801
|
+
interface HitsPerPageProps {
|
|
802
|
+
/** Available items per page options */
|
|
803
|
+
items: HitsPerPageItem[];
|
|
804
|
+
/** Callback when hits per page changes */
|
|
805
|
+
onHitsPerPageChange?: (value: number) => void;
|
|
806
|
+
/** Custom render function for select */
|
|
807
|
+
renderSelect?: (props: {
|
|
808
|
+
value: number;
|
|
809
|
+
onChange: (e: React__default.ChangeEvent<HTMLSelectElement>) => void;
|
|
810
|
+
items: HitsPerPageItem[];
|
|
811
|
+
}) => React__default.ReactNode;
|
|
812
|
+
/** Custom className */
|
|
813
|
+
className?: string;
|
|
814
|
+
/** Custom styles */
|
|
815
|
+
style?: React__default.CSSProperties;
|
|
816
|
+
/** Custom theme */
|
|
817
|
+
theme?: HitsPerPageTheme;
|
|
818
|
+
/** Label text before the select */
|
|
819
|
+
label?: string;
|
|
820
|
+
/** Whether to sync with SearchStateManager (default: true) */
|
|
821
|
+
syncWithState?: boolean;
|
|
822
|
+
}
|
|
823
|
+
declare const HitsPerPage: React__default.FC<HitsPerPageProps>;
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* InfiniteHits Component
|
|
827
|
+
*
|
|
828
|
+
* Displays search results with infinite scroll or "Show More" button
|
|
829
|
+
* Accumulates results as user loads more pages
|
|
830
|
+
*/
|
|
831
|
+
|
|
832
|
+
interface InfiniteHitsTheme {
|
|
833
|
+
root?: string;
|
|
834
|
+
list?: string;
|
|
835
|
+
item?: string;
|
|
836
|
+
loadMore?: string;
|
|
837
|
+
loadMoreDisabled?: string;
|
|
838
|
+
empty?: string;
|
|
839
|
+
sentinel?: string;
|
|
840
|
+
}
|
|
841
|
+
interface InfiniteHitsProps {
|
|
842
|
+
/** Custom render function for each hit */
|
|
843
|
+
renderHit?: (hit: ResultItem, index: number) => React__default.ReactNode;
|
|
844
|
+
/** Custom render for empty state */
|
|
845
|
+
renderEmpty?: () => React__default.ReactNode;
|
|
846
|
+
/** Custom render for "Show More" button */
|
|
847
|
+
renderShowMore?: (props: {
|
|
848
|
+
isLoading: boolean;
|
|
849
|
+
isLastPage: boolean;
|
|
850
|
+
onClick: () => void;
|
|
851
|
+
}) => React__default.ReactNode;
|
|
852
|
+
/** Whether to show the "Show More" button (default: true) */
|
|
853
|
+
showMoreButton?: boolean;
|
|
854
|
+
/** Whether to use infinite scroll with IntersectionObserver (default: false) */
|
|
855
|
+
useInfiniteScroll?: boolean;
|
|
856
|
+
/** Threshold for IntersectionObserver (default: 0.1) */
|
|
857
|
+
scrollThreshold?: number;
|
|
858
|
+
/** Field mapping for extracting data from hits */
|
|
859
|
+
fieldMapping?: FieldMapping;
|
|
860
|
+
/** Text for "Show More" button */
|
|
861
|
+
showMoreLabel?: string;
|
|
862
|
+
/** Callback when a hit is clicked */
|
|
863
|
+
onHitClick?: (hit: ResultItem, index: number) => void;
|
|
864
|
+
/** Custom className */
|
|
865
|
+
className?: string;
|
|
866
|
+
/** Custom styles */
|
|
867
|
+
style?: React__default.CSSProperties;
|
|
868
|
+
/** Custom theme */
|
|
869
|
+
theme?: InfiniteHitsTheme;
|
|
870
|
+
/** Whether to sync with SearchStateManager (default: true) */
|
|
871
|
+
syncWithState?: boolean;
|
|
872
|
+
}
|
|
873
|
+
declare const InfiniteHits: React__default.FC<InfiniteHitsProps>;
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Highlight Component
|
|
877
|
+
*
|
|
878
|
+
* Renders highlighted search result text with matching terms emphasized
|
|
879
|
+
*/
|
|
880
|
+
|
|
881
|
+
interface HighlightTheme {
|
|
882
|
+
root?: string;
|
|
883
|
+
highlighted?: string;
|
|
884
|
+
nonHighlighted?: string;
|
|
885
|
+
}
|
|
886
|
+
interface HighlightProps {
|
|
887
|
+
/** The search hit containing highlight data */
|
|
888
|
+
hit: Record<string, any>;
|
|
889
|
+
/** The attribute to highlight */
|
|
890
|
+
attribute: string;
|
|
891
|
+
/** Custom className */
|
|
892
|
+
className?: string;
|
|
893
|
+
/** Custom styles */
|
|
894
|
+
style?: React__default.CSSProperties;
|
|
895
|
+
/** Custom theme */
|
|
896
|
+
theme?: HighlightTheme;
|
|
897
|
+
/** Tag name for root element (default: 'span') */
|
|
898
|
+
tagName?: keyof JSX.IntrinsicElements;
|
|
899
|
+
/** Custom render for highlighted parts */
|
|
900
|
+
renderHighlighted?: (part: HighlightPart, index: number) => React__default.ReactNode;
|
|
901
|
+
/** Custom render for non-highlighted parts */
|
|
902
|
+
renderNonHighlighted?: (part: HighlightPart, index: number) => React__default.ReactNode;
|
|
903
|
+
/** Fallback query for client-side highlighting (when server highlight not available) */
|
|
904
|
+
query?: string;
|
|
905
|
+
}
|
|
906
|
+
declare const Highlight: React__default.FC<HighlightProps>;
|
|
907
|
+
/**
|
|
908
|
+
* Snippet Component
|
|
909
|
+
*
|
|
910
|
+
* Renders a truncated, highlighted excerpt from search results
|
|
911
|
+
*/
|
|
912
|
+
interface SnippetTheme extends HighlightTheme {
|
|
913
|
+
ellipsis?: string;
|
|
914
|
+
}
|
|
915
|
+
interface SnippetProps extends Omit<HighlightProps, 'theme'> {
|
|
916
|
+
/** Maximum length of snippet (default: 100) */
|
|
917
|
+
maxLength?: number;
|
|
918
|
+
/** Ellipsis to use when truncating (default: '...') */
|
|
919
|
+
ellipsis?: string;
|
|
920
|
+
/** Custom theme */
|
|
921
|
+
theme?: SnippetTheme;
|
|
922
|
+
}
|
|
923
|
+
declare const Snippet: React__default.FC<SnippetProps>;
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* HierarchicalMenu Component
|
|
927
|
+
*
|
|
928
|
+
* Displays a hierarchical menu for nested category navigation
|
|
929
|
+
* Example: Electronics > Phones > iPhone
|
|
930
|
+
*/
|
|
931
|
+
|
|
932
|
+
interface HierarchicalMenuItem {
|
|
933
|
+
label: string;
|
|
934
|
+
value: string;
|
|
935
|
+
count?: number;
|
|
936
|
+
isRefined?: boolean;
|
|
937
|
+
data?: HierarchicalMenuItem[];
|
|
938
|
+
}
|
|
939
|
+
interface HierarchicalMenuTheme {
|
|
940
|
+
root?: string;
|
|
941
|
+
list?: string;
|
|
942
|
+
item?: string;
|
|
943
|
+
itemSelected?: string;
|
|
944
|
+
itemParent?: string;
|
|
945
|
+
link?: string;
|
|
946
|
+
label?: string;
|
|
947
|
+
count?: string;
|
|
948
|
+
showMore?: string;
|
|
949
|
+
}
|
|
950
|
+
interface HierarchicalMenuProps {
|
|
951
|
+
/** Attributes for each level of hierarchy (e.g., ['category.lvl0', 'category.lvl1', 'category.lvl2']) */
|
|
952
|
+
attributes: string[];
|
|
953
|
+
/** Separator used in the hierarchical values (default: ' > ') */
|
|
954
|
+
separator?: string;
|
|
955
|
+
/** Maximum number of items to show per level (default: 10) */
|
|
956
|
+
limit?: number;
|
|
957
|
+
/** Show "Show more" button (default: true) */
|
|
958
|
+
showMore?: boolean;
|
|
959
|
+
/** Maximum items when "Show more" is clicked (default: 20) */
|
|
960
|
+
showMoreLimit?: number;
|
|
961
|
+
/** Custom render function for items */
|
|
962
|
+
renderItem?: (item: HierarchicalMenuItem, level: number) => React__default.ReactNode;
|
|
963
|
+
/** Callback when an item is selected */
|
|
964
|
+
onSelect?: (value: string, level: number) => void;
|
|
965
|
+
/** Custom className */
|
|
966
|
+
className?: string;
|
|
967
|
+
/** Custom styles */
|
|
968
|
+
style?: React__default.CSSProperties;
|
|
969
|
+
/** Custom theme */
|
|
970
|
+
theme?: HierarchicalMenuTheme;
|
|
971
|
+
/** Root path (for pre-selecting a category) */
|
|
972
|
+
rootPath?: string | null;
|
|
973
|
+
/** Sort by (default: 'name') */
|
|
974
|
+
sortBy?: 'name' | 'count' | 'isRefined';
|
|
975
|
+
/** Custom facet data (if not using StateManager) */
|
|
976
|
+
items?: HierarchicalMenuItem[];
|
|
977
|
+
}
|
|
978
|
+
declare const HierarchicalMenu: React__default.FC<HierarchicalMenuProps>;
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* RangeSlider Component
|
|
982
|
+
*
|
|
983
|
+
* Visual slider for numeric range filtering
|
|
984
|
+
* Alternative to RangeInput for a more interactive UX
|
|
985
|
+
*/
|
|
986
|
+
|
|
987
|
+
interface RangeSliderTheme {
|
|
988
|
+
root?: string;
|
|
989
|
+
label?: string;
|
|
990
|
+
slider?: string;
|
|
991
|
+
track?: string;
|
|
992
|
+
trackFilled?: string;
|
|
993
|
+
thumb?: string;
|
|
994
|
+
values?: string;
|
|
995
|
+
value?: string;
|
|
996
|
+
}
|
|
997
|
+
interface RangeSliderProps {
|
|
998
|
+
/** Field name for the range filter */
|
|
999
|
+
field: string;
|
|
1000
|
+
/** Label for the slider */
|
|
1001
|
+
label?: string;
|
|
1002
|
+
/** Minimum value */
|
|
1003
|
+
min: number;
|
|
1004
|
+
/** Maximum value */
|
|
1005
|
+
max: number;
|
|
1006
|
+
/** Step value (default: 1) */
|
|
1007
|
+
step?: number;
|
|
1008
|
+
/** Current minimum value */
|
|
1009
|
+
currentMin?: number;
|
|
1010
|
+
/** Current maximum value */
|
|
1011
|
+
currentMax?: number;
|
|
1012
|
+
/** Callback when range changes */
|
|
1013
|
+
onRangeChange?: (min: number, max: number) => void;
|
|
1014
|
+
/** Format value for display (default: (v) => v.toString()) */
|
|
1015
|
+
formatValue?: (value: number) => string;
|
|
1016
|
+
/** Custom className */
|
|
1017
|
+
className?: string;
|
|
1018
|
+
/** Custom styles */
|
|
1019
|
+
style?: React__default.CSSProperties;
|
|
1020
|
+
/** Custom theme */
|
|
1021
|
+
theme?: RangeSliderTheme;
|
|
1022
|
+
/** Show current values (default: true) */
|
|
1023
|
+
showValues?: boolean;
|
|
1024
|
+
/** Whether to sync with SearchStateManager (default: true) */
|
|
1025
|
+
syncWithState?: boolean;
|
|
1026
|
+
/** Debounce delay for updates (default: 300ms) */
|
|
1027
|
+
debounceMs?: number;
|
|
1028
|
+
}
|
|
1029
|
+
declare const RangeSlider: React__default.FC<RangeSliderProps>;
|
|
1030
|
+
|
|
1031
|
+
/**
|
|
1032
|
+
* Breadcrumb Component
|
|
1033
|
+
*
|
|
1034
|
+
* Displays the current hierarchical navigation path
|
|
1035
|
+
* Allows users to navigate back to parent categories
|
|
1036
|
+
*/
|
|
1037
|
+
|
|
1038
|
+
interface BreadcrumbItem {
|
|
1039
|
+
label: string;
|
|
1040
|
+
value: string;
|
|
1041
|
+
}
|
|
1042
|
+
interface BreadcrumbTheme {
|
|
1043
|
+
root?: string;
|
|
1044
|
+
list?: string;
|
|
1045
|
+
item?: string;
|
|
1046
|
+
link?: string;
|
|
1047
|
+
separator?: string;
|
|
1048
|
+
current?: string;
|
|
1049
|
+
}
|
|
1050
|
+
interface BreadcrumbProps {
|
|
1051
|
+
/** Attributes for each level of hierarchy */
|
|
1052
|
+
attributes: string[];
|
|
1053
|
+
/** Separator between items (default: ' > ') */
|
|
1054
|
+
separator?: string;
|
|
1055
|
+
/** Root label (default: 'Home') */
|
|
1056
|
+
rootLabel?: string;
|
|
1057
|
+
/** Custom render function for items */
|
|
1058
|
+
renderItem?: (item: BreadcrumbItem, index: number, isLast: boolean) => React__default.ReactNode;
|
|
1059
|
+
/** Custom render for separator */
|
|
1060
|
+
renderSeparator?: () => React__default.ReactNode;
|
|
1061
|
+
/** Callback when an item is clicked */
|
|
1062
|
+
onNavigate?: (item: BreadcrumbItem | null, index: number) => void;
|
|
1063
|
+
/** Custom className */
|
|
1064
|
+
className?: string;
|
|
1065
|
+
/** Custom styles */
|
|
1066
|
+
style?: React__default.CSSProperties;
|
|
1067
|
+
/** Custom theme */
|
|
1068
|
+
theme?: BreadcrumbTheme;
|
|
1069
|
+
/** Custom breadcrumb items (overrides automatic detection) */
|
|
1070
|
+
items?: BreadcrumbItem[];
|
|
1071
|
+
}
|
|
1072
|
+
declare const Breadcrumb: React__default.FC<BreadcrumbProps>;
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* MobileFilters Component
|
|
1076
|
+
*
|
|
1077
|
+
* A full-screen filter drawer optimized for mobile devices
|
|
1078
|
+
* Slides in from the side or bottom to display facets and filters
|
|
1079
|
+
*/
|
|
1080
|
+
|
|
1081
|
+
interface MobileFiltersTheme {
|
|
1082
|
+
overlay?: string;
|
|
1083
|
+
drawer?: string;
|
|
1084
|
+
header?: string;
|
|
1085
|
+
title?: string;
|
|
1086
|
+
closeButton?: string;
|
|
1087
|
+
content?: string;
|
|
1088
|
+
footer?: string;
|
|
1089
|
+
applyButton?: string;
|
|
1090
|
+
clearButton?: string;
|
|
1091
|
+
filterCount?: string;
|
|
1092
|
+
}
|
|
1093
|
+
interface MobileFiltersProps {
|
|
1094
|
+
/** Whether the drawer is open */
|
|
1095
|
+
isOpen: boolean;
|
|
1096
|
+
/** Callback when drawer should close */
|
|
1097
|
+
onClose: () => void;
|
|
1098
|
+
/** Callback when filters are applied */
|
|
1099
|
+
onApply?: () => void;
|
|
1100
|
+
/** Title text */
|
|
1101
|
+
title?: string;
|
|
1102
|
+
/** Apply button text */
|
|
1103
|
+
applyButtonText?: string;
|
|
1104
|
+
/** Clear button text */
|
|
1105
|
+
clearButtonText?: string;
|
|
1106
|
+
/** Position of the drawer */
|
|
1107
|
+
position?: 'left' | 'right' | 'bottom';
|
|
1108
|
+
/** Children (filter components) */
|
|
1109
|
+
children: React__default.ReactNode;
|
|
1110
|
+
/** Custom className */
|
|
1111
|
+
className?: string;
|
|
1112
|
+
/** Custom theme */
|
|
1113
|
+
theme?: MobileFiltersTheme;
|
|
1114
|
+
/** Show header */
|
|
1115
|
+
showHeader?: boolean;
|
|
1116
|
+
/** Show footer with apply/clear buttons */
|
|
1117
|
+
showFooter?: boolean;
|
|
1118
|
+
/** Show filter count badge */
|
|
1119
|
+
showFilterCount?: boolean;
|
|
1120
|
+
/** Close on backdrop click */
|
|
1121
|
+
closeOnBackdropClick?: boolean;
|
|
1122
|
+
/** Close on escape key */
|
|
1123
|
+
closeOnEscape?: boolean;
|
|
1124
|
+
}
|
|
1125
|
+
declare const MobileFilters: React__default.FC<MobileFiltersProps>;
|
|
1126
|
+
/**
|
|
1127
|
+
* MobileFiltersButton Component
|
|
1128
|
+
*
|
|
1129
|
+
* A button to toggle the MobileFilters drawer
|
|
1130
|
+
*/
|
|
1131
|
+
interface MobileFiltersButtonProps {
|
|
1132
|
+
/** Callback when clicked */
|
|
1133
|
+
onClick: () => void;
|
|
1134
|
+
/** Button text */
|
|
1135
|
+
text?: string;
|
|
1136
|
+
/** Show filter count */
|
|
1137
|
+
showCount?: boolean;
|
|
1138
|
+
/** Custom className */
|
|
1139
|
+
className?: string;
|
|
1140
|
+
/** Custom styles */
|
|
1141
|
+
style?: React__default.CSSProperties;
|
|
1142
|
+
}
|
|
1143
|
+
declare const MobileFiltersButton: React__default.FC<MobileFiltersButtonProps>;
|
|
1144
|
+
|
|
1145
|
+
/**
|
|
1146
|
+
* Recommendation Components
|
|
1147
|
+
*
|
|
1148
|
+
* Components for displaying product recommendations:
|
|
1149
|
+
* - RelatedProducts: Show related items based on a product
|
|
1150
|
+
* - TrendingItems: Display trending/popular products
|
|
1151
|
+
* - FrequentlyBoughtTogether: Bundle recommendations
|
|
1152
|
+
* - RecentlyViewed: User's recently viewed items
|
|
1153
|
+
*/
|
|
1154
|
+
|
|
1155
|
+
interface RecommendationItem extends ResultItem {
|
|
1156
|
+
[key: string]: any;
|
|
1157
|
+
}
|
|
1158
|
+
interface RecommendationTheme {
|
|
1159
|
+
root?: string;
|
|
1160
|
+
title?: string;
|
|
1161
|
+
list?: string;
|
|
1162
|
+
item?: string;
|
|
1163
|
+
image?: string;
|
|
1164
|
+
content?: string;
|
|
1165
|
+
name?: string;
|
|
1166
|
+
price?: string;
|
|
1167
|
+
empty?: string;
|
|
1168
|
+
}
|
|
1169
|
+
interface BaseRecommendationProps {
|
|
1170
|
+
/** Title for the section */
|
|
1171
|
+
title?: string;
|
|
1172
|
+
/** Maximum items to show */
|
|
1173
|
+
maxItems?: number;
|
|
1174
|
+
/** Custom render function for items */
|
|
1175
|
+
renderItem?: (item: RecommendationItem, index: number) => React__default.ReactNode;
|
|
1176
|
+
/** Callback when item is clicked */
|
|
1177
|
+
onItemClick?: (item: RecommendationItem, index: number) => void;
|
|
1178
|
+
/** Custom className */
|
|
1179
|
+
className?: string;
|
|
1180
|
+
/** Custom styles */
|
|
1181
|
+
style?: React__default.CSSProperties;
|
|
1182
|
+
/** Custom theme */
|
|
1183
|
+
theme?: RecommendationTheme;
|
|
1184
|
+
/** Layout mode */
|
|
1185
|
+
layout?: 'horizontal' | 'grid' | 'list';
|
|
1186
|
+
/** Currency symbol for prices */
|
|
1187
|
+
currencySymbol?: string;
|
|
1188
|
+
}
|
|
1189
|
+
interface RelatedProductsProps extends BaseRecommendationProps {
|
|
1190
|
+
/** Product ID to get related products for */
|
|
1191
|
+
productId: string;
|
|
1192
|
+
/** Custom items (if not using API) */
|
|
1193
|
+
items?: RecommendationItem[];
|
|
1194
|
+
/** Loading state */
|
|
1195
|
+
loading?: boolean;
|
|
1196
|
+
}
|
|
1197
|
+
declare const RelatedProducts: React__default.FC<RelatedProductsProps>;
|
|
1198
|
+
interface TrendingItemsProps extends BaseRecommendationProps {
|
|
1199
|
+
/** Custom items (if not using API) */
|
|
1200
|
+
items?: RecommendationItem[];
|
|
1201
|
+
/** Loading state */
|
|
1202
|
+
loading?: boolean;
|
|
1203
|
+
/** Facet name for trending (if using facet data) */
|
|
1204
|
+
facetName?: string;
|
|
1205
|
+
}
|
|
1206
|
+
declare const TrendingItems: React__default.FC<TrendingItemsProps>;
|
|
1207
|
+
interface FrequentlyBoughtTogetherProps extends BaseRecommendationProps {
|
|
1208
|
+
/** Product ID to get frequently bought together items for */
|
|
1209
|
+
productId: string;
|
|
1210
|
+
/** Custom items (if not using API) */
|
|
1211
|
+
items?: RecommendationItem[];
|
|
1212
|
+
/** Loading state */
|
|
1213
|
+
loading?: boolean;
|
|
1214
|
+
/** Show "Add all to cart" button */
|
|
1215
|
+
showAddAllButton?: boolean;
|
|
1216
|
+
/** Callback when "Add all" is clicked */
|
|
1217
|
+
onAddAll?: (items: RecommendationItem[]) => void;
|
|
1218
|
+
}
|
|
1219
|
+
declare const FrequentlyBoughtTogether: React__default.FC<FrequentlyBoughtTogetherProps>;
|
|
1220
|
+
interface RecentlyViewedProps extends BaseRecommendationProps {
|
|
1221
|
+
/** Storage key for localStorage */
|
|
1222
|
+
storageKey?: string;
|
|
1223
|
+
/** Custom items (overrides localStorage) */
|
|
1224
|
+
items?: RecommendationItem[];
|
|
1225
|
+
}
|
|
1226
|
+
declare const RecentlyViewed: React__default.FC<RecentlyViewedProps>;
|
|
1227
|
+
/**
|
|
1228
|
+
* Add item to recently viewed (utility function)
|
|
1229
|
+
*/
|
|
1230
|
+
declare function addToRecentlyViewed(item: RecommendationItem, storageKey?: string, maxItems?: number): void;
|
|
1231
|
+
|
|
1232
|
+
/**
|
|
1233
|
+
* QuerySuggestions Component
|
|
1234
|
+
*
|
|
1235
|
+
* Standalone component for displaying query suggestions
|
|
1236
|
+
*/
|
|
1237
|
+
|
|
1238
|
+
interface SuggestionItem$2 {
|
|
1239
|
+
query: string;
|
|
1240
|
+
count?: number;
|
|
1241
|
+
metadata?: Record<string, any>;
|
|
1242
|
+
}
|
|
1243
|
+
interface QuerySuggestionsTheme {
|
|
1244
|
+
container?: string;
|
|
1245
|
+
title?: string;
|
|
1246
|
+
suggestionsList?: string;
|
|
1247
|
+
suggestionItem?: string;
|
|
1248
|
+
suggestionItemHover?: string;
|
|
1249
|
+
suggestionItemActive?: string;
|
|
1250
|
+
emptyState?: string;
|
|
1251
|
+
}
|
|
1252
|
+
interface QuerySuggestionsProps {
|
|
1253
|
+
query?: string;
|
|
1254
|
+
maxSuggestions?: number;
|
|
1255
|
+
debounceMs?: number;
|
|
1256
|
+
minQueryLength?: number;
|
|
1257
|
+
onSuggestionClick?: (suggestion: string) => void;
|
|
1258
|
+
renderSuggestion?: (suggestion: SuggestionItem$2, index: number) => React__default.ReactNode;
|
|
1259
|
+
renderEmpty?: () => React__default.ReactNode;
|
|
1260
|
+
showTitle?: boolean;
|
|
1261
|
+
title?: string;
|
|
1262
|
+
className?: string;
|
|
1263
|
+
style?: React__default.CSSProperties;
|
|
1264
|
+
theme?: QuerySuggestionsTheme;
|
|
1265
|
+
}
|
|
1266
|
+
declare const QuerySuggestions: React__default.FC<QuerySuggestionsProps>;
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* QuerySuggestionsDropdown Component
|
|
1270
|
+
*
|
|
1271
|
+
* Classic dropdown variant with:
|
|
1272
|
+
* - Highlighted matches
|
|
1273
|
+
* - Keyboard navigation
|
|
1274
|
+
* - Recent searches
|
|
1275
|
+
* - Customizable styling
|
|
1276
|
+
* - Analytics tracking
|
|
1277
|
+
* - Accessibility support
|
|
1278
|
+
*/
|
|
1279
|
+
|
|
1280
|
+
interface QuerySuggestionsDropdownProps extends QuerySuggestionsEventHandlers {
|
|
1281
|
+
/** Current query string */
|
|
1282
|
+
query: string;
|
|
1283
|
+
/** Whether the dropdown is visible */
|
|
1284
|
+
isOpen?: boolean;
|
|
1285
|
+
/** Maximum suggestions to display */
|
|
1286
|
+
maxSuggestions?: number;
|
|
1287
|
+
/** Minimum query length to trigger suggestions */
|
|
1288
|
+
minQueryLength?: number;
|
|
1289
|
+
/** Debounce delay in ms */
|
|
1290
|
+
debounceMs?: number;
|
|
1291
|
+
/** Show recent searches section */
|
|
1292
|
+
showRecentSearches?: boolean;
|
|
1293
|
+
/** Maximum recent searches to display */
|
|
1294
|
+
maxRecentSearches?: number;
|
|
1295
|
+
/** Show suggestion counts */
|
|
1296
|
+
showCounts?: boolean;
|
|
1297
|
+
/** Show empty state when no results */
|
|
1298
|
+
showEmptyState?: boolean;
|
|
1299
|
+
/** Highlight configuration */
|
|
1300
|
+
highlight?: HighlightConfig;
|
|
1301
|
+
/** Keyboard navigation configuration */
|
|
1302
|
+
keyboardNav?: KeyboardNavConfig;
|
|
1303
|
+
/** Animation configuration */
|
|
1304
|
+
animation?: AnimationConfig;
|
|
1305
|
+
/** Custom class names */
|
|
1306
|
+
classNames?: QuerySuggestionsClassNames;
|
|
1307
|
+
/** Custom CSS styles */
|
|
1308
|
+
style?: React__default.CSSProperties;
|
|
1309
|
+
/** Custom render for suggestion item */
|
|
1310
|
+
renderSuggestion?: (suggestion: SuggestionItem$3, index: number, isActive: boolean, highlight: (text: string) => React__default.ReactNode) => React__default.ReactNode;
|
|
1311
|
+
/** Custom render for recent search item */
|
|
1312
|
+
renderRecentSearch?: (search: RecentSearch, index: number, isActive: boolean) => React__default.ReactNode;
|
|
1313
|
+
/** Custom render for empty state */
|
|
1314
|
+
renderEmpty?: () => React__default.ReactNode;
|
|
1315
|
+
/** Custom footer content */
|
|
1316
|
+
footer?: React__default.ReactNode;
|
|
1317
|
+
/** Position of dropdown */
|
|
1318
|
+
position?: 'absolute' | 'fixed';
|
|
1319
|
+
/** Dropdown width */
|
|
1320
|
+
width?: string | number;
|
|
1321
|
+
/** Z-index for dropdown */
|
|
1322
|
+
zIndex?: number;
|
|
1323
|
+
/** Input element ref for positioning */
|
|
1324
|
+
inputRef?: React__default.RefObject<HTMLInputElement>;
|
|
1325
|
+
/** Close on click outside */
|
|
1326
|
+
closeOnClickOutside?: boolean;
|
|
1327
|
+
/** Close on escape key */
|
|
1328
|
+
closeOnEscape?: boolean;
|
|
1329
|
+
/** ARIA label */
|
|
1330
|
+
ariaLabel?: string;
|
|
1331
|
+
}
|
|
1332
|
+
interface QuerySuggestionsDropdownRef {
|
|
1333
|
+
/** Select the currently active item */
|
|
1334
|
+
selectActive: () => void;
|
|
1335
|
+
/** Navigate to next item */
|
|
1336
|
+
navigateNext: () => void;
|
|
1337
|
+
/** Navigate to previous item */
|
|
1338
|
+
navigatePrevious: () => void;
|
|
1339
|
+
/** Reset selection */
|
|
1340
|
+
resetSelection: () => void;
|
|
1341
|
+
/** Get active index */
|
|
1342
|
+
getActiveIndex: () => number;
|
|
1343
|
+
/** Get total items count */
|
|
1344
|
+
getTotalItems: () => number;
|
|
1345
|
+
}
|
|
1346
|
+
declare const QuerySuggestionsDropdown: React__default.ForwardRefExoticComponent<QuerySuggestionsDropdownProps & React__default.RefAttributes<QuerySuggestionsDropdownRef>>;
|
|
1347
|
+
|
|
1348
|
+
/**
|
|
1349
|
+
* RichQuerySuggestions Component
|
|
1350
|
+
*
|
|
1351
|
+
* Advanced multi-section dropdown with:
|
|
1352
|
+
* - Suggestions with categories
|
|
1353
|
+
* - Trending searches
|
|
1354
|
+
* - Recent searches
|
|
1355
|
+
* - Top searches (popular)
|
|
1356
|
+
* - Related searches
|
|
1357
|
+
* - Configurable sections
|
|
1358
|
+
* - Rich styling options
|
|
1359
|
+
*/
|
|
1360
|
+
|
|
1361
|
+
interface RichQuerySuggestionsProps extends QuerySuggestionsEventHandlers {
|
|
1362
|
+
/** Current query string */
|
|
1363
|
+
query: string;
|
|
1364
|
+
/** Whether the dropdown is visible */
|
|
1365
|
+
isOpen?: boolean;
|
|
1366
|
+
/** Section configuration */
|
|
1367
|
+
sections?: DropdownSectionConfig[];
|
|
1368
|
+
/** Maximum suggestions per section */
|
|
1369
|
+
maxSuggestionsPerSection?: number;
|
|
1370
|
+
/** Minimum query length */
|
|
1371
|
+
minQueryLength?: number;
|
|
1372
|
+
/** Debounce delay in ms */
|
|
1373
|
+
debounceMs?: number;
|
|
1374
|
+
/** Include dropdown recommendations from API */
|
|
1375
|
+
includeDropdownRecommendations?: boolean;
|
|
1376
|
+
/** When false, omit product hits list from dropdown (default true) */
|
|
1377
|
+
includeDropdownProductList?: boolean;
|
|
1378
|
+
/** When false, omit filtered_tabs from dropdown (default true) */
|
|
1379
|
+
includeFilteredTabs?: boolean;
|
|
1380
|
+
/** Include categories in suggestions */
|
|
1381
|
+
includeCategories?: boolean;
|
|
1382
|
+
/** Max categories per suggestion */
|
|
1383
|
+
maxCategories?: number;
|
|
1384
|
+
/** Show suggestion counts */
|
|
1385
|
+
showCounts?: boolean;
|
|
1386
|
+
/** Show category counts */
|
|
1387
|
+
showCategoryCounts?: boolean;
|
|
1388
|
+
/** Show section headers */
|
|
1389
|
+
showSectionHeaders?: boolean;
|
|
1390
|
+
/** Custom class names */
|
|
1391
|
+
classNames?: QuerySuggestionsClassNames;
|
|
1392
|
+
/** Custom CSS styles */
|
|
1393
|
+
style?: React__default.CSSProperties;
|
|
1394
|
+
/** Custom render for suggestion */
|
|
1395
|
+
renderSuggestion?: (suggestion: SuggestionItem$3, isActive: boolean) => React__default.ReactNode;
|
|
1396
|
+
/** Custom render for category pill */
|
|
1397
|
+
renderCategory?: (category: SuggestionCategory) => React__default.ReactNode;
|
|
1398
|
+
/** Custom render for trending item */
|
|
1399
|
+
renderTrendingItem?: (item: TrendingSearch, index: number) => React__default.ReactNode;
|
|
1400
|
+
/** Custom render for recent item */
|
|
1401
|
+
renderRecentItem?: (item: RecentSearch) => React__default.ReactNode;
|
|
1402
|
+
/** Custom header content */
|
|
1403
|
+
header?: React__default.ReactNode;
|
|
1404
|
+
/** Custom footer content */
|
|
1405
|
+
footer?: React__default.ReactNode;
|
|
1406
|
+
/** Dropdown width */
|
|
1407
|
+
width?: string | number;
|
|
1408
|
+
/** Dropdown max height */
|
|
1409
|
+
maxHeight?: string | number;
|
|
1410
|
+
/** Z-index */
|
|
1411
|
+
zIndex?: number;
|
|
1412
|
+
/** ARIA label */
|
|
1413
|
+
ariaLabel?: string;
|
|
1414
|
+
/** Analytics tags */
|
|
1415
|
+
analyticsTags?: string[];
|
|
1416
|
+
/** Highlight options for query suggestions (passed to highlight rendering) */
|
|
1417
|
+
highlightOptions?: {
|
|
1418
|
+
highlightColor?: string;
|
|
1419
|
+
highlightTextColor?: string;
|
|
1420
|
+
highlightFontWeight?: string | number;
|
|
1421
|
+
highlightStyle?: 'background' | 'underline' | 'bold' | 'color-only';
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
interface RichQuerySuggestionsRef {
|
|
1425
|
+
getActiveIndex: () => number;
|
|
1426
|
+
setActiveIndex: (index: number) => void;
|
|
1427
|
+
selectActive: () => void;
|
|
1428
|
+
navigateNext: () => void;
|
|
1429
|
+
navigatePrevious: () => void;
|
|
1430
|
+
getTotalItems: () => number;
|
|
1431
|
+
}
|
|
1432
|
+
declare const RichQuerySuggestions: React__default.ForwardRefExoticComponent<RichQuerySuggestionsProps & React__default.RefAttributes<RichQuerySuggestionsRef>>;
|
|
1433
|
+
|
|
1434
|
+
/**
|
|
1435
|
+
* FederatedDropdown Component
|
|
1436
|
+
*
|
|
1437
|
+
* Full-featured federated search dropdown with:
|
|
1438
|
+
* - Multi-column layout (suggestions + products)
|
|
1439
|
+
* - Filtered tabs with product results
|
|
1440
|
+
* - Popular brands
|
|
1441
|
+
* - Trending products
|
|
1442
|
+
* - Category navigation
|
|
1443
|
+
* - Responsive design
|
|
1444
|
+
* - Rich product cards
|
|
1445
|
+
*/
|
|
1446
|
+
|
|
1447
|
+
interface FederatedDropdownProps extends QuerySuggestionsEventHandlers {
|
|
1448
|
+
/** Current query string */
|
|
1449
|
+
query: string;
|
|
1450
|
+
/** Whether the dropdown is visible */
|
|
1451
|
+
isOpen?: boolean;
|
|
1452
|
+
/** Maximum suggestions to show */
|
|
1453
|
+
maxSuggestions?: number;
|
|
1454
|
+
/** Maximum products to show per section */
|
|
1455
|
+
maxProducts?: number;
|
|
1456
|
+
/** Maximum brands to show */
|
|
1457
|
+
maxBrands?: number;
|
|
1458
|
+
/** Minimum query length */
|
|
1459
|
+
minQueryLength?: number;
|
|
1460
|
+
/** Debounce delay in ms */
|
|
1461
|
+
debounceMs?: number;
|
|
1462
|
+
/** Filtered tabs configuration */
|
|
1463
|
+
filteredTabs?: Array<{
|
|
1464
|
+
id?: string;
|
|
1465
|
+
label: string;
|
|
1466
|
+
filter: string;
|
|
1467
|
+
}>;
|
|
1468
|
+
/** Show products section */
|
|
1469
|
+
showProducts?: boolean;
|
|
1470
|
+
/** Show brands section */
|
|
1471
|
+
showBrands?: boolean;
|
|
1472
|
+
/** Show filtered tabs */
|
|
1473
|
+
showFilteredTabs?: boolean;
|
|
1474
|
+
/** Show recent searches */
|
|
1475
|
+
showRecentSearches?: boolean;
|
|
1476
|
+
/** Layout mode */
|
|
1477
|
+
layout?: 'side-by-side' | 'stacked' | 'full-width';
|
|
1478
|
+
/** Products column width (for side-by-side) */
|
|
1479
|
+
productsColumnWidth?: string;
|
|
1480
|
+
/** Suggestions column width (for side-by-side) */
|
|
1481
|
+
suggestionsColumnWidth?: string;
|
|
1482
|
+
/** Show product prices */
|
|
1483
|
+
showPrices?: boolean;
|
|
1484
|
+
/** Currency symbol */
|
|
1485
|
+
currencySymbol?: string;
|
|
1486
|
+
/** Custom class names */
|
|
1487
|
+
classNames?: QuerySuggestionsClassNames;
|
|
1488
|
+
/** Custom styles */
|
|
1489
|
+
style?: React__default.CSSProperties;
|
|
1490
|
+
/** Custom product card renderer */
|
|
1491
|
+
renderProduct?: (product: ProductItem, index: number) => React__default.ReactNode;
|
|
1492
|
+
/** Custom suggestion renderer */
|
|
1493
|
+
renderSuggestion?: (suggestion: SuggestionItem$3, index: number, isActive: boolean) => React__default.ReactNode;
|
|
1494
|
+
/** Custom brand renderer */
|
|
1495
|
+
renderBrand?: (brand: PopularBrand, index: number) => React__default.ReactNode;
|
|
1496
|
+
/** Custom tab renderer */
|
|
1497
|
+
renderTab?: (tab: FilteredTab, isActive: boolean) => React__default.ReactNode;
|
|
1498
|
+
/** Header content */
|
|
1499
|
+
header?: React__default.ReactNode;
|
|
1500
|
+
/** Footer content */
|
|
1501
|
+
footer?: React__default.ReactNode;
|
|
1502
|
+
/** View all products link */
|
|
1503
|
+
viewAllProductsLink?: string;
|
|
1504
|
+
/** Width */
|
|
1505
|
+
width?: string | number;
|
|
1506
|
+
/** Max height */
|
|
1507
|
+
maxHeight?: string | number;
|
|
1508
|
+
/** Z-index */
|
|
1509
|
+
zIndex?: number;
|
|
1510
|
+
/** Analytics tags */
|
|
1511
|
+
analyticsTags?: string[];
|
|
1512
|
+
/** Include facets in suggestions API response */
|
|
1513
|
+
includeFacets?: boolean;
|
|
1514
|
+
/** Include categories in suggestions API response */
|
|
1515
|
+
includeCategories?: boolean;
|
|
1516
|
+
/** Include dropdown recommendations (trending products, top searches, etc.) */
|
|
1517
|
+
includeDropdownRecommendations?: boolean;
|
|
1518
|
+
}
|
|
1519
|
+
interface FederatedDropdownRef {
|
|
1520
|
+
getActiveIndex: () => number;
|
|
1521
|
+
setActiveIndex: (index: number) => void;
|
|
1522
|
+
selectActive: () => void;
|
|
1523
|
+
navigateNext: () => void;
|
|
1524
|
+
navigatePrevious: () => void;
|
|
1525
|
+
getActiveTab: () => string | null;
|
|
1526
|
+
setActiveTab: (tabId: string) => void;
|
|
1527
|
+
}
|
|
1528
|
+
declare const FederatedDropdown: React__default.ForwardRefExoticComponent<FederatedDropdownProps & React__default.RefAttributes<FederatedDropdownRef>>;
|
|
1529
|
+
|
|
1530
|
+
/**
|
|
1531
|
+
* SearchBarWithSuggestions Component
|
|
1532
|
+
*
|
|
1533
|
+
* Integrated search bar with query suggestions dropdown.
|
|
1534
|
+
* Combines SearchBar with any of the suggestion dropdown variants.
|
|
1535
|
+
*/
|
|
1536
|
+
|
|
1537
|
+
interface SearchBarWithSuggestionsProps {
|
|
1538
|
+
/** Dropdown variant to use */
|
|
1539
|
+
variant?: QuerySuggestionsVariant;
|
|
1540
|
+
/** Placeholder text */
|
|
1541
|
+
placeholder?: string;
|
|
1542
|
+
/** Initial query value */
|
|
1543
|
+
initialQuery?: string;
|
|
1544
|
+
/** Controlled query value */
|
|
1545
|
+
value?: string;
|
|
1546
|
+
/** Callback when query changes */
|
|
1547
|
+
onQueryChange?: (query: string) => void;
|
|
1548
|
+
/** Callback when search is submitted */
|
|
1549
|
+
onSearch?: (query: string) => void;
|
|
1550
|
+
/** Callback when suggestion is selected */
|
|
1551
|
+
onSuggestionSelect?: (suggestion: SuggestionItem$3) => void;
|
|
1552
|
+
/** Callback when product is clicked */
|
|
1553
|
+
onProductClick?: (product: ProductItem) => void;
|
|
1554
|
+
/** Show search button */
|
|
1555
|
+
showSearchButton?: boolean;
|
|
1556
|
+
/** Search button text */
|
|
1557
|
+
searchButtonText?: string;
|
|
1558
|
+
/** Show clear button */
|
|
1559
|
+
showClearButton?: boolean;
|
|
1560
|
+
/** Auto focus on mount */
|
|
1561
|
+
autoFocus?: boolean;
|
|
1562
|
+
/** Min query length for suggestions */
|
|
1563
|
+
minQueryLength?: number;
|
|
1564
|
+
/** Max suggestions to show */
|
|
1565
|
+
maxSuggestions?: number;
|
|
1566
|
+
/** Max products to show in dropdown (federated/rich) */
|
|
1567
|
+
maxProducts?: number;
|
|
1568
|
+
/** Debounce delay (ms) */
|
|
1569
|
+
debounceMs?: number;
|
|
1570
|
+
/** Show recent searches */
|
|
1571
|
+
showRecentSearches?: boolean;
|
|
1572
|
+
/** Show trending when empty */
|
|
1573
|
+
showTrendingOnEmpty?: boolean;
|
|
1574
|
+
/** Include dropdown recommendations */
|
|
1575
|
+
includeDropdownRecommendations?: boolean;
|
|
1576
|
+
/** Filtered tabs config */
|
|
1577
|
+
filteredTabs?: Array<{
|
|
1578
|
+
id?: string;
|
|
1579
|
+
label: string;
|
|
1580
|
+
filter: string;
|
|
1581
|
+
}>;
|
|
1582
|
+
/** Enable analytics tracking */
|
|
1583
|
+
enableAnalytics?: boolean;
|
|
1584
|
+
/** Analytics tags */
|
|
1585
|
+
analyticsTags?: string[];
|
|
1586
|
+
/** Include facets in suggestions API response (federated/rich) */
|
|
1587
|
+
includeFacets?: boolean;
|
|
1588
|
+
/** Include categories in suggestions API response (federated/rich) */
|
|
1589
|
+
includeCategories?: boolean;
|
|
1590
|
+
/** Dropdown width */
|
|
1591
|
+
dropdownWidth?: string | number;
|
|
1592
|
+
/** Dropdown max height */
|
|
1593
|
+
dropdownMaxHeight?: string | number;
|
|
1594
|
+
/** Custom class names */
|
|
1595
|
+
classNames?: {
|
|
1596
|
+
wrapper?: string;
|
|
1597
|
+
input?: string;
|
|
1598
|
+
button?: string;
|
|
1599
|
+
clearButton?: string;
|
|
1600
|
+
dropdown?: string;
|
|
1601
|
+
} & QuerySuggestionsClassNames;
|
|
1602
|
+
/** Custom styles */
|
|
1603
|
+
style?: React__default.CSSProperties;
|
|
1604
|
+
/** Input style */
|
|
1605
|
+
inputStyle?: React__default.CSSProperties;
|
|
1606
|
+
/** ARIA label */
|
|
1607
|
+
ariaLabel?: string;
|
|
1608
|
+
}
|
|
1609
|
+
interface SearchBarWithSuggestionsRef {
|
|
1610
|
+
/** Focus the input */
|
|
1611
|
+
focus: () => void;
|
|
1612
|
+
/** Blur the input */
|
|
1613
|
+
blur: () => void;
|
|
1614
|
+
/** Clear the input */
|
|
1615
|
+
clear: () => void;
|
|
1616
|
+
/** Get current query */
|
|
1617
|
+
getQuery: () => string;
|
|
1618
|
+
/** Set query value */
|
|
1619
|
+
setQuery: (query: string) => void;
|
|
1620
|
+
/** Open dropdown */
|
|
1621
|
+
openDropdown: () => void;
|
|
1622
|
+
/** Close dropdown */
|
|
1623
|
+
closeDropdown: () => void;
|
|
1624
|
+
/** Navigate to next suggestion */
|
|
1625
|
+
navigateNext: () => void;
|
|
1626
|
+
/** Navigate to previous suggestion */
|
|
1627
|
+
navigatePrevious: () => void;
|
|
1628
|
+
/** Select current suggestion */
|
|
1629
|
+
selectCurrent: () => void;
|
|
1630
|
+
}
|
|
1631
|
+
declare const SearchBarWithSuggestions: React__default.ForwardRefExoticComponent<SearchBarWithSuggestionsProps & React__default.RefAttributes<SearchBarWithSuggestionsRef>>;
|
|
1632
|
+
|
|
1633
|
+
/**
|
|
1634
|
+
* Enhanced Query Suggestions Hook
|
|
1635
|
+
*
|
|
1636
|
+
* Provides full support for query suggestions API including:
|
|
1637
|
+
* - Basic suggestions
|
|
1638
|
+
* - Dropdown recommendations (trending, top searches, related)
|
|
1639
|
+
* - Filtered tabs with products
|
|
1640
|
+
* - Recent searches (local storage)
|
|
1641
|
+
* - Analytics tracking
|
|
1642
|
+
*/
|
|
1643
|
+
|
|
1644
|
+
interface UseQuerySuggestionsEnhancedOptions {
|
|
1645
|
+
/** Seekora client instance */
|
|
1646
|
+
client: SeekoraClient;
|
|
1647
|
+
/** Current search query */
|
|
1648
|
+
query: string;
|
|
1649
|
+
/** Enable/disable the hook */
|
|
1650
|
+
enabled?: boolean;
|
|
1651
|
+
/** Prefetch initial (empty-query) data on mount even if not enabled yet */
|
|
1652
|
+
prefetch?: boolean;
|
|
1653
|
+
/** Debounce delay in ms */
|
|
1654
|
+
debounceMs?: number;
|
|
1655
|
+
/** Max suggestions to fetch */
|
|
1656
|
+
maxSuggestions?: number;
|
|
1657
|
+
/** Minimum query length to trigger search */
|
|
1658
|
+
minQueryLength?: number;
|
|
1659
|
+
/** Include dropdown recommendations (trending, products, etc.) */
|
|
1660
|
+
includeDropdownRecommendations?: boolean;
|
|
1661
|
+
/** When false, omit product hits list from dropdown (default true) */
|
|
1662
|
+
includeDropdownProductList?: boolean;
|
|
1663
|
+
/** When false, omit filtered_tabs from dropdown extensions (default true) */
|
|
1664
|
+
includeFilteredTabs?: boolean;
|
|
1665
|
+
/** Include categories in suggestions */
|
|
1666
|
+
includeCategories?: boolean;
|
|
1667
|
+
/** Include facets in suggestions */
|
|
1668
|
+
includeFacets?: boolean;
|
|
1669
|
+
/** Max categories per suggestion */
|
|
1670
|
+
maxCategories?: number;
|
|
1671
|
+
/** Max facets per suggestion */
|
|
1672
|
+
maxFacets?: number;
|
|
1673
|
+
/** Filtered tabs configuration */
|
|
1674
|
+
filteredTabs?: Array<{
|
|
1675
|
+
id?: string;
|
|
1676
|
+
label: string;
|
|
1677
|
+
filter: string;
|
|
1678
|
+
}>;
|
|
1679
|
+
/** Minimum popularity threshold */
|
|
1680
|
+
minPopularity?: number;
|
|
1681
|
+
/** Time range for analytics data */
|
|
1682
|
+
timeRange?: '7d' | '30d' | '90d';
|
|
1683
|
+
/** Disable typo tolerance */
|
|
1684
|
+
disableTypoTolerance?: boolean;
|
|
1685
|
+
/** Analytics tags */
|
|
1686
|
+
analyticsTags?: string[];
|
|
1687
|
+
/** Enable recent searches from localStorage */
|
|
1688
|
+
enableRecentSearches?: boolean;
|
|
1689
|
+
/** Max recent searches to store */
|
|
1690
|
+
maxRecentSearches?: number;
|
|
1691
|
+
/** Local storage key for recent searches */
|
|
1692
|
+
recentSearchesKey?: string;
|
|
1693
|
+
/** Callback when suggestions are loaded */
|
|
1694
|
+
onSuggestionsLoaded?: (response: QuerySuggestionsResponse) => void;
|
|
1695
|
+
/** Callback on error */
|
|
1696
|
+
onError?: (error: Error) => void;
|
|
1697
|
+
}
|
|
1698
|
+
interface UseQuerySuggestionsEnhancedReturn {
|
|
1699
|
+
/** Basic suggestion items */
|
|
1700
|
+
suggestions: SuggestionItem$3[];
|
|
1701
|
+
/** Loading state */
|
|
1702
|
+
loading: boolean;
|
|
1703
|
+
/** Error state */
|
|
1704
|
+
error: Error | null;
|
|
1705
|
+
/** Dropdown recommendations */
|
|
1706
|
+
dropdownRecommendations: DropdownRecommendations | null;
|
|
1707
|
+
/** Trending searches */
|
|
1708
|
+
trendingSearches: TrendingSearch[];
|
|
1709
|
+
/** Top searches */
|
|
1710
|
+
topSearches: TopSearch[];
|
|
1711
|
+
/** Related searches */
|
|
1712
|
+
relatedSearches: RelatedSearch[];
|
|
1713
|
+
/** Popular brands */
|
|
1714
|
+
popularBrands: PopularBrand[];
|
|
1715
|
+
/** Filtered tabs with products */
|
|
1716
|
+
filteredTabs: FilteredTab[];
|
|
1717
|
+
/** Trending products */
|
|
1718
|
+
trendingProducts: ProductItem[];
|
|
1719
|
+
/** Recent searches (from localStorage) */
|
|
1720
|
+
recentSearches: RecentSearch[];
|
|
1721
|
+
/** Processing time in ms */
|
|
1722
|
+
processingTimeMs: number | null;
|
|
1723
|
+
/** Total hits count */
|
|
1724
|
+
totalHits: number;
|
|
1725
|
+
/** Current page */
|
|
1726
|
+
currentPage: number;
|
|
1727
|
+
/** Total pages */
|
|
1728
|
+
totalPages: number;
|
|
1729
|
+
/** Original query */
|
|
1730
|
+
originalQuery: string;
|
|
1731
|
+
/** Add a search to recent searches */
|
|
1732
|
+
addRecentSearch: (query: string, resultsCount?: number) => void;
|
|
1733
|
+
/** Remove a search from recent searches */
|
|
1734
|
+
removeRecentSearch: (query: string) => void;
|
|
1735
|
+
/** Clear all recent searches */
|
|
1736
|
+
clearRecentSearches: () => void;
|
|
1737
|
+
/** Manually refetch suggestions */
|
|
1738
|
+
refetch: () => Promise<void>;
|
|
1739
|
+
/** Check if dropdown has any content to show */
|
|
1740
|
+
hasContent: boolean;
|
|
1741
|
+
/** Get all items for keyboard navigation (flattened) */
|
|
1742
|
+
getAllNavigableItems: () => NavigableItem[];
|
|
1743
|
+
}
|
|
1744
|
+
interface NavigableItem {
|
|
1745
|
+
type: 'suggestion' | 'recent' | 'trending' | 'product' | 'category' | 'brand' | 'tab';
|
|
1746
|
+
index: number;
|
|
1747
|
+
data: SuggestionItem$3 | RecentSearch | TrendingSearch | ProductItem | SuggestionCategory | PopularBrand | FilteredTab;
|
|
1748
|
+
}
|
|
1749
|
+
declare function useQuerySuggestionsEnhanced(options: UseQuerySuggestionsEnhancedOptions): UseQuerySuggestionsEnhancedReturn;
|
|
1750
|
+
|
|
1751
|
+
/**
|
|
1752
|
+
* Suggestions Context
|
|
1753
|
+
*
|
|
1754
|
+
* Type definitions and React context for composable suggestions primitives.
|
|
1755
|
+
* Consuming components use useSuggestionsContext() for state and actions.
|
|
1756
|
+
*/
|
|
1757
|
+
|
|
1758
|
+
interface SuggestionsContextValue {
|
|
1759
|
+
query: string;
|
|
1760
|
+
setQuery: (query: string) => void;
|
|
1761
|
+
isOpen: boolean;
|
|
1762
|
+
setIsOpen: (open: boolean) => void;
|
|
1763
|
+
activeIndex: number;
|
|
1764
|
+
setActiveIndex: (index: number) => void;
|
|
1765
|
+
suggestions: SuggestionItem$3[];
|
|
1766
|
+
recentSearches: RecentSearch[];
|
|
1767
|
+
trendingSearches: TrendingSearch[];
|
|
1768
|
+
trendingProducts: ProductItem[];
|
|
1769
|
+
/** Products prefetched on mount via client.search("*") — available before dropdown opens */
|
|
1770
|
+
prefetchedProducts: unknown[];
|
|
1771
|
+
filteredTabs: FilteredTab[];
|
|
1772
|
+
activeTabId: string;
|
|
1773
|
+
setActiveTabId: (id: string) => void;
|
|
1774
|
+
loading: boolean;
|
|
1775
|
+
error: Error | null;
|
|
1776
|
+
hasContent: boolean;
|
|
1777
|
+
getAllNavigableItems: () => NavigableItem[];
|
|
1778
|
+
selectSuggestion: (suggestion: SuggestionItem$3, position: number) => void;
|
|
1779
|
+
selectProduct: (product: ProductItem, position: number, section?: string, tabId?: string) => void;
|
|
1780
|
+
selectRecentSearch: (search: RecentSearch) => void;
|
|
1781
|
+
selectTrendingSearch: (trending: TrendingSearch, position: number) => void;
|
|
1782
|
+
setActiveTab: (tab: FilteredTab) => void;
|
|
1783
|
+
submitSearch: (query: string, fromSuggestion?: boolean, suggestion?: SuggestionItem$3) => void;
|
|
1784
|
+
clearRecentSearches: () => void;
|
|
1785
|
+
close: () => void;
|
|
1786
|
+
navigateNext: () => void;
|
|
1787
|
+
navigatePrev: () => void;
|
|
1788
|
+
selectActive: () => void;
|
|
1789
|
+
}
|
|
1790
|
+
declare function useSuggestionsContext(): SuggestionsContextValue;
|
|
1791
|
+
|
|
1792
|
+
/**
|
|
1793
|
+
* SuggestionsProvider
|
|
1794
|
+
*
|
|
1795
|
+
* Provides suggestions state (query, suggestions, products, recent, trending, tabs),
|
|
1796
|
+
* actions (selectSuggestion, selectProduct, submitSearch, etc.), and keyboard navigation.
|
|
1797
|
+
* Uses useQuerySuggestionsEnhanced and useSuggestionsAnalytics; must be inside SearchProvider.
|
|
1798
|
+
*/
|
|
1799
|
+
|
|
1800
|
+
interface SuggestionsProviderProps {
|
|
1801
|
+
children: React__default.ReactNode;
|
|
1802
|
+
/** Min query length to fetch suggestions */
|
|
1803
|
+
minQueryLength?: number;
|
|
1804
|
+
/** Debounce ms for suggestion fetch */
|
|
1805
|
+
debounceMs?: number;
|
|
1806
|
+
/** Max suggestions */
|
|
1807
|
+
maxSuggestions?: number;
|
|
1808
|
+
/** Include dropdown recommendations (trending, products, etc.) */
|
|
1809
|
+
includeDropdownRecommendations?: boolean;
|
|
1810
|
+
/** Filtered tabs config */
|
|
1811
|
+
filteredTabs?: Array<{
|
|
1812
|
+
id?: string;
|
|
1813
|
+
label: string;
|
|
1814
|
+
filter: string;
|
|
1815
|
+
}>;
|
|
1816
|
+
/** Enable analytics (V3) */
|
|
1817
|
+
enableAnalytics?: boolean;
|
|
1818
|
+
/** Analytics tags */
|
|
1819
|
+
analyticsTags?: string[];
|
|
1820
|
+
/** Callback when user submits search (e.g. navigate to results page) */
|
|
1821
|
+
onSearch?: (query: string) => void;
|
|
1822
|
+
/** Callback when user selects a suggestion */
|
|
1823
|
+
onSuggestionSelect?: (suggestion: SuggestionItem$3) => void;
|
|
1824
|
+
/** Callback when user clicks a product */
|
|
1825
|
+
onProductClick?: (product: ProductItem) => void;
|
|
1826
|
+
}
|
|
1827
|
+
declare function SuggestionsProvider({ children, minQueryLength, debounceMs, maxSuggestions, includeDropdownRecommendations, filteredTabs, enableAnalytics, analyticsTags, onSearch, onSuggestionSelect, onProductClick, }: SuggestionsProviderProps): React__default.JSX.Element;
|
|
1828
|
+
|
|
1829
|
+
/**
|
|
1830
|
+
* SearchInput – suggestion-scoped search input (primitive)
|
|
1831
|
+
*
|
|
1832
|
+
* Single input bound to suggestions context: query, setQuery, focus opens dropdown,
|
|
1833
|
+
* keydown ArrowUp/Down/Enter/Escape delegates to context. Overridable via className/style.
|
|
1834
|
+
*/
|
|
1835
|
+
|
|
1836
|
+
interface SearchInputProps {
|
|
1837
|
+
placeholder?: string;
|
|
1838
|
+
autoFocus?: boolean;
|
|
1839
|
+
showClearButton?: boolean;
|
|
1840
|
+
/** When false, blur does not close the dropdown (e.g. for overlay mode). Default true. */
|
|
1841
|
+
closeOnBlur?: boolean;
|
|
1842
|
+
/** Optional icon (e.g. magnifying glass) rendered to the left of the input */
|
|
1843
|
+
leftIcon?: React__default.ReactNode;
|
|
1844
|
+
className?: string;
|
|
1845
|
+
style?: React__default.CSSProperties;
|
|
1846
|
+
inputClassName?: string;
|
|
1847
|
+
inputStyle?: React__default.CSSProperties;
|
|
1848
|
+
ariaLabel?: string;
|
|
1849
|
+
}
|
|
1850
|
+
declare function SearchInput({ placeholder, autoFocus, showClearButton, closeOnBlur, leftIcon, className, style, inputClassName, inputStyle, ariaLabel, }: SearchInputProps): React__default.JSX.Element;
|
|
1851
|
+
|
|
1852
|
+
/**
|
|
1853
|
+
* DropdownPanel – floating panel for suggestions (primitive)
|
|
1854
|
+
*
|
|
1855
|
+
* Shows when isOpen; handles click-outside and Escape to close. Children = any composition
|
|
1856
|
+
* of SuggestionList, ProductGrid, etc. Position and z-index configurable.
|
|
1857
|
+
*/
|
|
1858
|
+
|
|
1859
|
+
interface DropdownPanelProps {
|
|
1860
|
+
children: React__default.ReactNode;
|
|
1861
|
+
position?: 'absolute' | 'fixed';
|
|
1862
|
+
/** CSS top offset (e.g. '100%', '4px') */
|
|
1863
|
+
top?: string | number;
|
|
1864
|
+
left?: string | number;
|
|
1865
|
+
right?: string | number;
|
|
1866
|
+
width?: string | number;
|
|
1867
|
+
maxHeight?: string | number;
|
|
1868
|
+
zIndex?: number;
|
|
1869
|
+
className?: string;
|
|
1870
|
+
style?: React__default.CSSProperties;
|
|
1871
|
+
closeOnClickOutside?: boolean;
|
|
1872
|
+
closeOnEscape?: boolean;
|
|
1873
|
+
}
|
|
1874
|
+
declare function DropdownPanel({ children, position, top, left, right, width, maxHeight, zIndex, className, style, closeOnClickOutside, closeOnEscape, }: DropdownPanelProps): React__default.JSX.Element | null;
|
|
1875
|
+
|
|
1876
|
+
/**
|
|
1877
|
+
* Parses suggestion text containing <mark>...</mark> and returns React nodes
|
|
1878
|
+
* with the marked segments rendered as styled elements. Safe: inner content
|
|
1879
|
+
* is rendered as text, not HTML.
|
|
1880
|
+
*/
|
|
1881
|
+
|
|
1882
|
+
/** Visual highlight styles */
|
|
1883
|
+
type HighlightStyle = 'background' | 'underline' | 'bold' | 'color-only';
|
|
1884
|
+
interface HighlightMarkupOptions {
|
|
1885
|
+
/** Class name for the highlight element. */
|
|
1886
|
+
markClassName?: string;
|
|
1887
|
+
/** Inline style for the highlight element (merged with computed styles). */
|
|
1888
|
+
markStyle?: React__default.CSSProperties;
|
|
1889
|
+
/** Override background color for highlighted segments */
|
|
1890
|
+
highlightColor?: string;
|
|
1891
|
+
/** Text color for highlighted segments */
|
|
1892
|
+
highlightTextColor?: string;
|
|
1893
|
+
/** Font weight for highlighted segments */
|
|
1894
|
+
highlightFontWeight?: string | number;
|
|
1895
|
+
/** Visual highlight style (default: 'background') */
|
|
1896
|
+
highlightStyle?: HighlightStyle;
|
|
1897
|
+
/** Which HTML element to render for highlights (default: 'mark') */
|
|
1898
|
+
highlightTag?: keyof JSX.IntrinsicElements;
|
|
1899
|
+
}
|
|
1900
|
+
/**
|
|
1901
|
+
* Converts a string like "lined <mark>blue</mark>" into React nodes with
|
|
1902
|
+
* the marked part rendered as a styled element. When no <mark> tags are
|
|
1903
|
+
* present, returns the string as-is.
|
|
1904
|
+
*/
|
|
1905
|
+
declare function parseHighlightMarkup(text: string, options?: HighlightMarkupOptions): React__default.ReactNode;
|
|
1906
|
+
|
|
1907
|
+
interface SuggestionListProps {
|
|
1908
|
+
maxItems?: number;
|
|
1909
|
+
className?: string;
|
|
1910
|
+
style?: React__default.CSSProperties;
|
|
1911
|
+
listClassName?: string;
|
|
1912
|
+
/**
|
|
1913
|
+
* When true (default), suggestion text with <mark>...</mark> is rendered
|
|
1914
|
+
* with those segments highlighted. When false, plain text is shown.
|
|
1915
|
+
* Only applies when not using custom renderItem.
|
|
1916
|
+
*/
|
|
1917
|
+
enableHighlightMarkup?: boolean;
|
|
1918
|
+
/** Options for default highlight <mark> styling. Only applies when not using custom renderItem. */
|
|
1919
|
+
highlightMarkupOptions?: HighlightMarkupOptions;
|
|
1920
|
+
renderItem?: (suggestion: _seekora_ai_ui_sdk_types.SuggestionItem, index: number, isActive: boolean, onSelect: () => void) => React__default.ReactNode;
|
|
1921
|
+
}
|
|
1922
|
+
declare function SuggestionList({ maxItems, className, style, listClassName, enableHighlightMarkup, highlightMarkupOptions, renderItem, }: SuggestionListProps): React__default.JSX.Element | null;
|
|
1923
|
+
|
|
1924
|
+
/**
|
|
1925
|
+
* SuggestionItem – single text suggestion row (primitive)
|
|
1926
|
+
*
|
|
1927
|
+
* Highlights when isActive; onClick calls context selectSuggestion.
|
|
1928
|
+
* When enableHighlightMarkup is true (default), parses <mark>...</mark> in
|
|
1929
|
+
* suggestion text and renders as highlighted <mark> elements. Overridable via
|
|
1930
|
+
* renderHighlight, className/style.
|
|
1931
|
+
*/
|
|
1932
|
+
|
|
1933
|
+
interface SuggestionItemProps {
|
|
1934
|
+
suggestion: SuggestionItem$3;
|
|
1935
|
+
index: number;
|
|
1936
|
+
isActive: boolean;
|
|
1937
|
+
onSelect: () => void;
|
|
1938
|
+
className?: string;
|
|
1939
|
+
style?: React__default.CSSProperties;
|
|
1940
|
+
/**
|
|
1941
|
+
* When true (default), text containing <mark>...</mark> is rendered with
|
|
1942
|
+
* those segments as highlighted <mark> elements. When false, plain query
|
|
1943
|
+
* text is shown with no markup parsing.
|
|
1944
|
+
*/
|
|
1945
|
+
enableHighlightMarkup?: boolean;
|
|
1946
|
+
/** Options for the default highlight <mark> styling when enableHighlightMarkup is true. */
|
|
1947
|
+
highlightMarkupOptions?: HighlightMarkupOptions;
|
|
1948
|
+
/** Custom renderer for suggestion text; overrides default highlight parsing when provided. */
|
|
1949
|
+
renderHighlight?: (text: string) => React__default.ReactNode;
|
|
1950
|
+
}
|
|
1951
|
+
declare function SuggestionItem$1({ suggestion, index, isActive, onSelect, className, style, enableHighlightMarkup, highlightMarkupOptions, renderHighlight, }: SuggestionItemProps): React__default.JSX.Element;
|
|
1952
|
+
|
|
1953
|
+
/**
|
|
1954
|
+
* ActionButtons – card action buttons (add to cart, wishlist, buy now, quick view)
|
|
1955
|
+
*
|
|
1956
|
+
* Renders a set of action buttons for product cards. Can be positioned absolutely
|
|
1957
|
+
* over the image (on hover) or inline below the card content.
|
|
1958
|
+
*/
|
|
1959
|
+
|
|
1960
|
+
type ActionButtonType = 'addToCart' | 'wishlist' | 'buyNow' | 'quickView' | 'compare';
|
|
1961
|
+
interface ActionButton {
|
|
1962
|
+
type: ActionButtonType;
|
|
1963
|
+
label?: string;
|
|
1964
|
+
icon?: React__default.ReactNode;
|
|
1965
|
+
onClick?: (e: React__default.MouseEvent) => void;
|
|
1966
|
+
disabled?: boolean;
|
|
1967
|
+
loading?: boolean;
|
|
1968
|
+
}
|
|
1969
|
+
interface ActionButtonsProps {
|
|
1970
|
+
buttons: ActionButton[];
|
|
1971
|
+
layout?: 'horizontal' | 'vertical' | 'overlay';
|
|
1972
|
+
position?: 'top-right' | 'bottom-center' | 'inline';
|
|
1973
|
+
showLabels?: boolean;
|
|
1974
|
+
size?: 'small' | 'medium' | 'large';
|
|
1975
|
+
className?: string;
|
|
1976
|
+
style?: React__default.CSSProperties;
|
|
1977
|
+
}
|
|
1978
|
+
declare function ActionButtons({ buttons, layout, position, showLabels, size, className, style, }: ActionButtonsProps): React__default.JSX.Element;
|
|
1979
|
+
|
|
1980
|
+
/**
|
|
1981
|
+
* ItemCard – generic item tile (primitive)
|
|
1982
|
+
*
|
|
1983
|
+
* Domain-agnostic: works for docs, articles, products, or any hit with id, title,
|
|
1984
|
+
* optional description, image, url. Overridable via className/style. Use for
|
|
1985
|
+
* search results, section blocks, or any list; for e-commerce products use ProductCard.
|
|
1986
|
+
*/
|
|
1987
|
+
|
|
1988
|
+
/** Generic item shape for ItemCard – compatible with ResultItem and most hit types */
|
|
1989
|
+
interface GenericItem {
|
|
1990
|
+
id: string;
|
|
1991
|
+
title: string;
|
|
1992
|
+
description?: string;
|
|
1993
|
+
image?: string;
|
|
1994
|
+
/** Multiple images for carousel/hover/thumbStrip */
|
|
1995
|
+
images?: string[];
|
|
1996
|
+
url?: string;
|
|
1997
|
+
/** Widget/display fields */
|
|
1998
|
+
primaryText?: string;
|
|
1999
|
+
secondaryText?: string;
|
|
2000
|
+
tertiaryText?: string;
|
|
2001
|
+
imageUrl?: string;
|
|
2002
|
+
[key: string]: unknown;
|
|
2003
|
+
}
|
|
2004
|
+
type ImageDisplayVariant$1 = 'single' | 'carousel' | 'hover' | 'thumbStrip' | 'thumbList';
|
|
2005
|
+
interface ItemCardProps {
|
|
2006
|
+
item: GenericItem;
|
|
2007
|
+
/** Position in list (for analytics) */
|
|
2008
|
+
position?: number;
|
|
2009
|
+
onSelect?: () => void;
|
|
2010
|
+
className?: string;
|
|
2011
|
+
style?: React__default.CSSProperties;
|
|
2012
|
+
/** Render as link (anchor) when item.url is set; otherwise button */
|
|
2013
|
+
asLink?: boolean;
|
|
2014
|
+
/** When multiple images, use ImageDisplay with this variant */
|
|
2015
|
+
imageVariant?: ImageDisplayVariant$1;
|
|
2016
|
+
/** Layout direction: vertical (default) or horizontal (image left, content right) */
|
|
2017
|
+
layout?: 'vertical' | 'horizontal';
|
|
2018
|
+
/** Action buttons (add to cart, wishlist, etc.) */
|
|
2019
|
+
actionButtons?: ActionButton[];
|
|
2020
|
+
/** Action buttons position */
|
|
2021
|
+
actionButtonsPosition?: 'overlay-top-right' | 'overlay-bottom' | 'inline';
|
|
2022
|
+
/** Show action button labels */
|
|
2023
|
+
showActionLabels?: boolean;
|
|
2024
|
+
}
|
|
2025
|
+
declare function ItemCard({ item, position, onSelect, className, style, asLink, imageVariant, layout, actionButtons, actionButtonsPosition, showActionLabels, }: ItemCardProps): React__default.JSX.Element;
|
|
2026
|
+
|
|
2027
|
+
/**
|
|
2028
|
+
* ItemGrid – generic grid of items (primitive)
|
|
2029
|
+
*
|
|
2030
|
+
* Domain-agnostic: accepts any items[] and onItemClick. Renders ItemCard by default
|
|
2031
|
+
* or custom renderItem. Use for search hits, section blocks, docs, articles; for
|
|
2032
|
+
* product-only lists use ProductGrid.
|
|
2033
|
+
*/
|
|
2034
|
+
|
|
2035
|
+
interface ItemGridProps<T = GenericItem> {
|
|
2036
|
+
items: T[];
|
|
2037
|
+
onItemClick?: (item: T, index: number) => void;
|
|
2038
|
+
/** Map item to GenericItem for default ItemCard rendering */
|
|
2039
|
+
getItemId?: (item: T) => string;
|
|
2040
|
+
getItemTitle?: (item: T) => string;
|
|
2041
|
+
getItemImage?: (item: T) => string | undefined;
|
|
2042
|
+
getItemDescription?: (item: T) => string | undefined;
|
|
2043
|
+
getItemUrl?: (item: T) => string | undefined;
|
|
2044
|
+
/** Custom render for each item; overrides default ItemCard */
|
|
2045
|
+
renderItem?: (item: T, index: number) => React__default.ReactNode;
|
|
2046
|
+
maxItems?: number;
|
|
2047
|
+
columns?: number;
|
|
2048
|
+
className?: string;
|
|
2049
|
+
style?: React__default.CSSProperties;
|
|
2050
|
+
gridClassName?: string;
|
|
2051
|
+
}
|
|
2052
|
+
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;
|
|
2053
|
+
|
|
2054
|
+
/** Maps client's data fields to component expected fields */
|
|
2055
|
+
interface SuggestionFieldMapping {
|
|
2056
|
+
/** Field path for suggestion text (e.g., "query", "searchTerm", "text") */
|
|
2057
|
+
query: string;
|
|
2058
|
+
/** Field path for suggestion count/popularity */
|
|
2059
|
+
count?: string;
|
|
2060
|
+
/** Field path for object ID */
|
|
2061
|
+
id?: string;
|
|
2062
|
+
/** Field path for categories array */
|
|
2063
|
+
categories?: string;
|
|
2064
|
+
/** Field path for highlighted text */
|
|
2065
|
+
highlighted?: string;
|
|
2066
|
+
/** Custom field mappings */
|
|
2067
|
+
custom?: Record<string, string>;
|
|
2068
|
+
}
|
|
2069
|
+
/** Maps client's product fields to component expected fields */
|
|
2070
|
+
interface ProductFieldMapping {
|
|
2071
|
+
/** Field path for product ID */
|
|
2072
|
+
id: string;
|
|
2073
|
+
/** Field path for product title/name */
|
|
2074
|
+
title: string;
|
|
2075
|
+
/** Field path for product image URL */
|
|
2076
|
+
image?: string;
|
|
2077
|
+
/** Field path for product price */
|
|
2078
|
+
price?: string;
|
|
2079
|
+
/** Field path for original/compare price */
|
|
2080
|
+
comparePrice?: string;
|
|
2081
|
+
/** Field path for product URL */
|
|
2082
|
+
url?: string;
|
|
2083
|
+
/** Field path for brand name */
|
|
2084
|
+
brand?: string;
|
|
2085
|
+
/** Field path for category */
|
|
2086
|
+
category?: string;
|
|
2087
|
+
/** Field path for rating */
|
|
2088
|
+
rating?: string;
|
|
2089
|
+
/** Field path for review count */
|
|
2090
|
+
reviewCount?: string;
|
|
2091
|
+
/** Field path for discount percentage */
|
|
2092
|
+
discount?: string;
|
|
2093
|
+
/** Field path for availability/in stock */
|
|
2094
|
+
inStock?: string;
|
|
2095
|
+
/** Field path for currency */
|
|
2096
|
+
currency?: string;
|
|
2097
|
+
/** Field path for multiple images */
|
|
2098
|
+
images?: string;
|
|
2099
|
+
/** Field path for original/compare price (alias) */
|
|
2100
|
+
originalPrice?: string;
|
|
2101
|
+
/** Field path for availability */
|
|
2102
|
+
available?: string;
|
|
2103
|
+
/** Field path for product options (Color, Size axes) */
|
|
2104
|
+
options?: string;
|
|
2105
|
+
/** Field path for product variants */
|
|
2106
|
+
variants?: string;
|
|
2107
|
+
/** Field path for product tags */
|
|
2108
|
+
tags?: string;
|
|
2109
|
+
/** Custom field mappings */
|
|
2110
|
+
custom?: Record<string, string>;
|
|
2111
|
+
}
|
|
2112
|
+
/** Maps client's category/tab fields */
|
|
2113
|
+
interface CategoryFieldMapping {
|
|
2114
|
+
id: string;
|
|
2115
|
+
label: string;
|
|
2116
|
+
count?: string;
|
|
2117
|
+
icon?: string;
|
|
2118
|
+
image?: string;
|
|
2119
|
+
}
|
|
2120
|
+
/** Maps client's brand fields */
|
|
2121
|
+
interface BrandFieldMapping {
|
|
2122
|
+
id?: string;
|
|
2123
|
+
name: string;
|
|
2124
|
+
logo?: string;
|
|
2125
|
+
count?: string;
|
|
2126
|
+
}
|
|
2127
|
+
type DropdownLayout = 'list' | 'two-column' | 'three-column' | 'grid' | 'hero' | 'full-width' | 'mobile-sheet' | 'overlay';
|
|
2128
|
+
type ProductCardSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2129
|
+
type ProductCardStyle = 'minimal' | 'standard' | 'detailed' | 'compact' | 'horizontal';
|
|
2130
|
+
/** Available dropdown variants */
|
|
2131
|
+
type SuggestionDropdownVariant$1 = 'amazon' | 'google' | 'pinterest' | 'spotlight' | 'shopify' | 'mobile-sheet' | 'minimal';
|
|
2132
|
+
interface VisualConfig {
|
|
2133
|
+
/** Overall dropdown layout */
|
|
2134
|
+
layout?: DropdownLayout;
|
|
2135
|
+
/** Show/hide shadows */
|
|
2136
|
+
shadows?: boolean;
|
|
2137
|
+
/** Border radius (px or CSS value) */
|
|
2138
|
+
borderRadius?: number | string;
|
|
2139
|
+
/** Animation style */
|
|
2140
|
+
animation?: 'none' | 'fade' | 'slide' | 'scale' | 'spring';
|
|
2141
|
+
/** Animation duration in ms */
|
|
2142
|
+
animationDuration?: number;
|
|
2143
|
+
/** Blur background when open */
|
|
2144
|
+
backdropBlur?: boolean;
|
|
2145
|
+
/** Show dividers between sections */
|
|
2146
|
+
showDividers?: boolean;
|
|
2147
|
+
/** Compact mode (reduced padding) */
|
|
2148
|
+
compact?: boolean;
|
|
2149
|
+
}
|
|
2150
|
+
type SectionType = 'suggestions' | 'recent' | 'trending' | 'products' | 'categories' | 'brands' | 'collections' | 'pages' | 'custom';
|
|
2151
|
+
interface SectionConfig {
|
|
2152
|
+
/** Section identifier */
|
|
2153
|
+
id: SectionType | string;
|
|
2154
|
+
/** Section title (can be ReactNode for custom rendering) */
|
|
2155
|
+
title?: string | ReactNode;
|
|
2156
|
+
/** Whether section is enabled */
|
|
2157
|
+
enabled?: boolean;
|
|
2158
|
+
/** Maximum items to show */
|
|
2159
|
+
maxItems?: number;
|
|
2160
|
+
/** Section display order (lower = higher) */
|
|
2161
|
+
order?: number;
|
|
2162
|
+
/** Section-specific layout override */
|
|
2163
|
+
layout?: 'list' | 'grid' | 'horizontal-scroll' | 'chips';
|
|
2164
|
+
/** Number of columns for grid layout */
|
|
2165
|
+
columns?: number;
|
|
2166
|
+
/** Show "View All" link */
|
|
2167
|
+
showViewAll?: boolean;
|
|
2168
|
+
/** View All link URL or handler */
|
|
2169
|
+
viewAllLink?: string;
|
|
2170
|
+
/** Custom CSS class */
|
|
2171
|
+
className?: string;
|
|
2172
|
+
/** Custom styles */
|
|
2173
|
+
style?: CSSProperties;
|
|
2174
|
+
/** Custom renderer for entire section */
|
|
2175
|
+
render?: (data: any[], config: SectionConfig) => ReactNode;
|
|
2176
|
+
/** Custom renderer for individual items */
|
|
2177
|
+
renderItem?: (item: any, index: number) => ReactNode;
|
|
2178
|
+
/** Empty state message */
|
|
2179
|
+
emptyMessage?: string;
|
|
2180
|
+
/** Icon for section header */
|
|
2181
|
+
icon?: ReactNode;
|
|
2182
|
+
}
|
|
2183
|
+
interface ProductDisplayConfig {
|
|
2184
|
+
/** Card size */
|
|
2185
|
+
size?: ProductCardSize;
|
|
2186
|
+
/** Card style */
|
|
2187
|
+
style?: ProductCardStyle;
|
|
2188
|
+
/** Show product image */
|
|
2189
|
+
showImage?: boolean;
|
|
2190
|
+
/** Image aspect ratio */
|
|
2191
|
+
imageAspectRatio?: '1:1' | '4:3' | '3:4' | '16:9' | 'auto';
|
|
2192
|
+
/** Image object-fit: 'cover' crops to fill (default), 'contain' fits entire image */
|
|
2193
|
+
imageObjectFit?: 'cover' | 'contain';
|
|
2194
|
+
/** Show price */
|
|
2195
|
+
showPrice?: boolean;
|
|
2196
|
+
/** Show compare/original price */
|
|
2197
|
+
showComparePrice?: boolean;
|
|
2198
|
+
/** Show discount badge */
|
|
2199
|
+
showDiscount?: boolean;
|
|
2200
|
+
/** Show brand */
|
|
2201
|
+
showBrand?: boolean;
|
|
2202
|
+
/** Show rating */
|
|
2203
|
+
showRating?: boolean;
|
|
2204
|
+
/** Show stock status */
|
|
2205
|
+
showStock?: boolean;
|
|
2206
|
+
/** Show add to cart button */
|
|
2207
|
+
showAddToCart?: boolean;
|
|
2208
|
+
/** Currency symbol */
|
|
2209
|
+
currency?: string;
|
|
2210
|
+
/** Currency position */
|
|
2211
|
+
currencyPosition?: 'before' | 'after';
|
|
2212
|
+
/** Decimal places for price */
|
|
2213
|
+
priceDecimals?: number;
|
|
2214
|
+
/** Truncate title after N lines */
|
|
2215
|
+
titleLines?: number;
|
|
2216
|
+
/** Hover effect */
|
|
2217
|
+
hoverEffect?: 'none' | 'lift' | 'glow' | 'scale' | 'border';
|
|
2218
|
+
/** Image placeholder */
|
|
2219
|
+
imagePlaceholder?: ReactNode;
|
|
2220
|
+
/** Lazy load images */
|
|
2221
|
+
lazyLoadImages?: boolean;
|
|
2222
|
+
/** Show variant swatches on card */
|
|
2223
|
+
showVariants?: boolean;
|
|
2224
|
+
/** Which option names to show as swatches (e.g., ['Color']). Default: all */
|
|
2225
|
+
variantOptionsToShow?: string[];
|
|
2226
|
+
/** Max variant values before "+N more" (default: 5) */
|
|
2227
|
+
maxVariantValues?: number;
|
|
2228
|
+
/** Show price range when variants have different prices */
|
|
2229
|
+
showPriceRange?: boolean;
|
|
2230
|
+
/** Show badges (sale, new, sold out, etc.) */
|
|
2231
|
+
showBadges?: boolean;
|
|
2232
|
+
/** Custom badge extractor from tags */
|
|
2233
|
+
badgeExtractor?: (tags?: string[], product?: any) => _seekora_ai_ui_sdk_types.ProductBadge[];
|
|
2234
|
+
}
|
|
2235
|
+
interface SuggestionDisplayConfig {
|
|
2236
|
+
/** Show search icon */
|
|
2237
|
+
showIcon?: boolean;
|
|
2238
|
+
/** Custom icon */
|
|
2239
|
+
icon?: ReactNode;
|
|
2240
|
+
/** Show hit count */
|
|
2241
|
+
showCount?: boolean;
|
|
2242
|
+
/** Show categories inline */
|
|
2243
|
+
showCategories?: boolean;
|
|
2244
|
+
/** Max categories to show */
|
|
2245
|
+
maxCategories?: number;
|
|
2246
|
+
/** Highlight matching text */
|
|
2247
|
+
highlightMatches?: boolean;
|
|
2248
|
+
/** Highlight style */
|
|
2249
|
+
highlightStyle?: CSSProperties;
|
|
2250
|
+
/** Show arrow on hover */
|
|
2251
|
+
showArrow?: boolean;
|
|
2252
|
+
/** Category click behavior */
|
|
2253
|
+
categoryClickable?: boolean;
|
|
2254
|
+
}
|
|
2255
|
+
interface DropdownThemeConfig {
|
|
2256
|
+
/** Light/dark mode */
|
|
2257
|
+
mode?: 'light' | 'dark' | 'auto';
|
|
2258
|
+
/** Primary brand color */
|
|
2259
|
+
primaryColor?: string;
|
|
2260
|
+
/** Background color */
|
|
2261
|
+
backgroundColor?: string;
|
|
2262
|
+
/** Surface color (cards, sections) */
|
|
2263
|
+
surfaceColor?: string;
|
|
2264
|
+
/** Text color */
|
|
2265
|
+
textColor?: string;
|
|
2266
|
+
/** Secondary text color */
|
|
2267
|
+
textSecondaryColor?: string;
|
|
2268
|
+
/** Border color */
|
|
2269
|
+
borderColor?: string;
|
|
2270
|
+
/** Hover background */
|
|
2271
|
+
hoverColor?: string;
|
|
2272
|
+
/** Highlight/match color */
|
|
2273
|
+
highlightColor?: string;
|
|
2274
|
+
/** Success color (in stock, etc.) */
|
|
2275
|
+
successColor?: string;
|
|
2276
|
+
/** Error color (out of stock, etc.) */
|
|
2277
|
+
errorColor?: string;
|
|
2278
|
+
/** Font family */
|
|
2279
|
+
fontFamily?: string;
|
|
2280
|
+
/** Base font size */
|
|
2281
|
+
fontSize?: number | string;
|
|
2282
|
+
/** Border radius */
|
|
2283
|
+
borderRadius?: number | string;
|
|
2284
|
+
/** Box shadow */
|
|
2285
|
+
boxShadow?: string;
|
|
2286
|
+
/** Custom CSS variables */
|
|
2287
|
+
cssVariables?: Record<string, string>;
|
|
2288
|
+
}
|
|
2289
|
+
interface AnalyticsConfig {
|
|
2290
|
+
/** Enable analytics */
|
|
2291
|
+
enabled?: boolean;
|
|
2292
|
+
/** Track suggestion clicks */
|
|
2293
|
+
trackSuggestionClicks?: boolean;
|
|
2294
|
+
/** Track product clicks */
|
|
2295
|
+
trackProductClicks?: boolean;
|
|
2296
|
+
/** Track impressions */
|
|
2297
|
+
trackImpressions?: boolean;
|
|
2298
|
+
/** Impression debounce time (ms) */
|
|
2299
|
+
impressionDebounce?: number;
|
|
2300
|
+
/** Track category clicks */
|
|
2301
|
+
trackCategoryClicks?: boolean;
|
|
2302
|
+
/** Track brand clicks */
|
|
2303
|
+
trackBrandClicks?: boolean;
|
|
2304
|
+
/** Track search submissions */
|
|
2305
|
+
trackSearchSubmit?: boolean;
|
|
2306
|
+
/** Custom analytics tags */
|
|
2307
|
+
tags?: string[];
|
|
2308
|
+
/** User ID for personalization */
|
|
2309
|
+
userId?: string;
|
|
2310
|
+
/** Session ID */
|
|
2311
|
+
sessionId?: string;
|
|
2312
|
+
/** Custom event handler */
|
|
2313
|
+
onEvent?: (eventType: string, data: any) => void;
|
|
2314
|
+
}
|
|
2315
|
+
interface DropdownEventHandlers<TSuggestion = any, TProduct = any, TCategory = any, TBrand = any> {
|
|
2316
|
+
/** Suggestion selected */
|
|
2317
|
+
onSuggestionSelect?: (suggestion: TSuggestion, index: number) => void;
|
|
2318
|
+
/** Product clicked */
|
|
2319
|
+
onProductClick?: (product: TProduct, index: number) => void;
|
|
2320
|
+
/** Category clicked */
|
|
2321
|
+
onCategoryClick?: (category: TCategory, suggestion?: TSuggestion) => void;
|
|
2322
|
+
/** Brand clicked */
|
|
2323
|
+
onBrandClick?: (brand: TBrand) => void;
|
|
2324
|
+
/** Tab/filter changed */
|
|
2325
|
+
onTabChange?: (tabId: string, tab?: any) => void;
|
|
2326
|
+
/** Recent search clicked */
|
|
2327
|
+
onRecentClick?: (query: string) => void;
|
|
2328
|
+
/** Recent search removed */
|
|
2329
|
+
onRecentRemove?: (query: string) => void;
|
|
2330
|
+
/** Clear all recent searches */
|
|
2331
|
+
onRecentClearAll?: () => void;
|
|
2332
|
+
/** View all clicked */
|
|
2333
|
+
onViewAll?: (section: SectionType | string) => void;
|
|
2334
|
+
/** Search submitted */
|
|
2335
|
+
onSearchSubmit?: (query: string) => void;
|
|
2336
|
+
/** Dropdown opened */
|
|
2337
|
+
onOpen?: () => void;
|
|
2338
|
+
/** Dropdown closed */
|
|
2339
|
+
onClose?: () => void;
|
|
2340
|
+
/** Keyboard navigation */
|
|
2341
|
+
onNavigate?: (direction: 'up' | 'down' | 'left' | 'right', index: number) => void;
|
|
2342
|
+
/** Add to cart clicked (if enabled) */
|
|
2343
|
+
onAddToCart?: (product: TProduct) => void;
|
|
2344
|
+
}
|
|
2345
|
+
interface AccessibilityConfig {
|
|
2346
|
+
/** ARIA label for dropdown */
|
|
2347
|
+
ariaLabel?: string;
|
|
2348
|
+
/** ARIA labelledby */
|
|
2349
|
+
ariaLabelledBy?: string;
|
|
2350
|
+
/** Announce selection to screen readers */
|
|
2351
|
+
announceSelection?: boolean;
|
|
2352
|
+
/** Custom announcement text */
|
|
2353
|
+
getAnnouncementText?: (item: any, type: string) => string;
|
|
2354
|
+
/** Keyboard navigation enabled */
|
|
2355
|
+
keyboardNavigation?: boolean;
|
|
2356
|
+
/** Focus trap (keep focus within dropdown) */
|
|
2357
|
+
focusTrap?: boolean;
|
|
2358
|
+
/** Auto focus first item */
|
|
2359
|
+
autoFocus?: boolean;
|
|
2360
|
+
/** Close on escape */
|
|
2361
|
+
closeOnEscape?: boolean;
|
|
2362
|
+
/** Close on click outside */
|
|
2363
|
+
closeOnClickOutside?: boolean;
|
|
2364
|
+
}
|
|
2365
|
+
interface BaseDropdownProps<TSuggestion = any, TProduct = any, TCategory = any, TBrand = any> extends DropdownEventHandlers<TSuggestion, TProduct, TCategory, TBrand> {
|
|
2366
|
+
/** Current search query */
|
|
2367
|
+
query: string;
|
|
2368
|
+
/** Whether dropdown is open/visible */
|
|
2369
|
+
isOpen?: boolean;
|
|
2370
|
+
/** Loading state */
|
|
2371
|
+
loading?: boolean;
|
|
2372
|
+
/** Error state */
|
|
2373
|
+
error?: Error | string | null;
|
|
2374
|
+
/** Suggestion items */
|
|
2375
|
+
suggestions?: TSuggestion[];
|
|
2376
|
+
/** Product items */
|
|
2377
|
+
products?: TProduct[];
|
|
2378
|
+
/** Category/filter tabs */
|
|
2379
|
+
categories?: TCategory[];
|
|
2380
|
+
/** Brand items */
|
|
2381
|
+
brands?: TBrand[];
|
|
2382
|
+
/** Recent searches (strings or objects) */
|
|
2383
|
+
recentSearches?: string[] | Array<{
|
|
2384
|
+
query: string;
|
|
2385
|
+
timestamp?: number;
|
|
2386
|
+
}>;
|
|
2387
|
+
/** Trending searches */
|
|
2388
|
+
trendingSearches?: string[] | TSuggestion[];
|
|
2389
|
+
/** Filtered tabs with products */
|
|
2390
|
+
filteredTabs?: Array<{
|
|
2391
|
+
id: string;
|
|
2392
|
+
label: string;
|
|
2393
|
+
products?: TProduct[];
|
|
2394
|
+
nb_hits?: number;
|
|
2395
|
+
filter?: string;
|
|
2396
|
+
}>;
|
|
2397
|
+
/** Currently active tab ID */
|
|
2398
|
+
activeTab?: string;
|
|
2399
|
+
/** Map suggestion data fields */
|
|
2400
|
+
suggestionFields?: SuggestionFieldMapping;
|
|
2401
|
+
/** Map product data fields */
|
|
2402
|
+
productFields?: ProductFieldMapping;
|
|
2403
|
+
/** Map category data fields */
|
|
2404
|
+
categoryFields?: CategoryFieldMapping;
|
|
2405
|
+
/** Map brand data fields */
|
|
2406
|
+
brandFields?: BrandFieldMapping;
|
|
2407
|
+
/** Section configurations */
|
|
2408
|
+
sections?: SectionConfig[];
|
|
2409
|
+
/** Product display config */
|
|
2410
|
+
productDisplay?: ProductDisplayConfig;
|
|
2411
|
+
/** Suggestion display config */
|
|
2412
|
+
suggestionDisplay?: SuggestionDisplayConfig;
|
|
2413
|
+
/** Visual/layout config */
|
|
2414
|
+
visual?: VisualConfig;
|
|
2415
|
+
/** Theme config */
|
|
2416
|
+
theme?: DropdownThemeConfig;
|
|
2417
|
+
/** Analytics config */
|
|
2418
|
+
analytics?: AnalyticsConfig;
|
|
2419
|
+
/** Accessibility config */
|
|
2420
|
+
accessibility?: AccessibilityConfig;
|
|
2421
|
+
/** Dropdown width */
|
|
2422
|
+
width?: string | number;
|
|
2423
|
+
/** Dropdown max height */
|
|
2424
|
+
maxHeight?: string | number;
|
|
2425
|
+
/** Dropdown min height */
|
|
2426
|
+
minHeight?: string | number;
|
|
2427
|
+
/** Z-index */
|
|
2428
|
+
zIndex?: number;
|
|
2429
|
+
/** Root CSS class */
|
|
2430
|
+
className?: string;
|
|
2431
|
+
/** Root inline styles */
|
|
2432
|
+
style?: CSSProperties;
|
|
2433
|
+
/** CSS classes for parts */
|
|
2434
|
+
classNames?: Partial<DropdownClassNames>;
|
|
2435
|
+
/** Inline styles for parts */
|
|
2436
|
+
styles?: Partial<DropdownStyles>;
|
|
2437
|
+
/** Custom header */
|
|
2438
|
+
header?: ReactNode;
|
|
2439
|
+
/** Custom footer */
|
|
2440
|
+
footer?: ReactNode;
|
|
2441
|
+
/** Custom empty state */
|
|
2442
|
+
renderEmpty?: (query: string) => ReactNode;
|
|
2443
|
+
/** Custom error state */
|
|
2444
|
+
renderError?: (error: Error | string) => ReactNode;
|
|
2445
|
+
/** Reference to input element (for focus management) */
|
|
2446
|
+
inputRef?: React.RefObject<HTMLInputElement>;
|
|
2447
|
+
}
|
|
2448
|
+
interface DropdownClassNames {
|
|
2449
|
+
root: string;
|
|
2450
|
+
container: string;
|
|
2451
|
+
header: string;
|
|
2452
|
+
content: string;
|
|
2453
|
+
footer: string;
|
|
2454
|
+
section: string;
|
|
2455
|
+
sectionHeader: string;
|
|
2456
|
+
sectionTitle: string;
|
|
2457
|
+
sectionContent: string;
|
|
2458
|
+
sectionViewAll: string;
|
|
2459
|
+
suggestionsList: string;
|
|
2460
|
+
suggestionItem: string;
|
|
2461
|
+
suggestionItemActive: string;
|
|
2462
|
+
suggestionIcon: string;
|
|
2463
|
+
suggestionText: string;
|
|
2464
|
+
suggestionHighlight: string;
|
|
2465
|
+
suggestionCount: string;
|
|
2466
|
+
suggestionCategories: string;
|
|
2467
|
+
suggestionCategory: string;
|
|
2468
|
+
suggestionArrow: string;
|
|
2469
|
+
productsList: string;
|
|
2470
|
+
productCard: string;
|
|
2471
|
+
productCardHover: string;
|
|
2472
|
+
productImage: string;
|
|
2473
|
+
productImagePlaceholder: string;
|
|
2474
|
+
productInfo: string;
|
|
2475
|
+
productTitle: string;
|
|
2476
|
+
productBrand: string;
|
|
2477
|
+
productPrice: string;
|
|
2478
|
+
productComparePrice: string;
|
|
2479
|
+
productDiscount: string;
|
|
2480
|
+
productRating: string;
|
|
2481
|
+
productStock: string;
|
|
2482
|
+
productAddToCart: string;
|
|
2483
|
+
categoriesList: string;
|
|
2484
|
+
categoryItem: string;
|
|
2485
|
+
categoryItemActive: string;
|
|
2486
|
+
categoryIcon: string;
|
|
2487
|
+
categoryLabel: string;
|
|
2488
|
+
categoryCount: string;
|
|
2489
|
+
brandsList: string;
|
|
2490
|
+
brandItem: string;
|
|
2491
|
+
brandLogo: string;
|
|
2492
|
+
brandName: string;
|
|
2493
|
+
recentList: string;
|
|
2494
|
+
recentItem: string;
|
|
2495
|
+
recentIcon: string;
|
|
2496
|
+
recentText: string;
|
|
2497
|
+
recentRemove: string;
|
|
2498
|
+
recentClearAll: string;
|
|
2499
|
+
trendingList: string;
|
|
2500
|
+
trendingItem: string;
|
|
2501
|
+
trendingIcon: string;
|
|
2502
|
+
tabsList: string;
|
|
2503
|
+
tabItem: string;
|
|
2504
|
+
tabItemActive: string;
|
|
2505
|
+
tabCount: string;
|
|
2506
|
+
empty: string;
|
|
2507
|
+
emptyIcon: string;
|
|
2508
|
+
emptyText: string;
|
|
2509
|
+
error: string;
|
|
2510
|
+
errorIcon: string;
|
|
2511
|
+
errorText: string;
|
|
2512
|
+
keyboard: string;
|
|
2513
|
+
keyboardHint: string;
|
|
2514
|
+
keyboardKey: string;
|
|
2515
|
+
}
|
|
2516
|
+
interface DropdownStyles {
|
|
2517
|
+
root: CSSProperties;
|
|
2518
|
+
container: CSSProperties;
|
|
2519
|
+
header: CSSProperties;
|
|
2520
|
+
content: CSSProperties;
|
|
2521
|
+
footer: CSSProperties;
|
|
2522
|
+
section: CSSProperties;
|
|
2523
|
+
suggestionItem: CSSProperties;
|
|
2524
|
+
productCard: CSSProperties;
|
|
2525
|
+
categoryItem: CSSProperties;
|
|
2526
|
+
brandItem: CSSProperties;
|
|
2527
|
+
}
|
|
2528
|
+
interface DropdownRef {
|
|
2529
|
+
/** Get currently active/focused index */
|
|
2530
|
+
getActiveIndex: () => number;
|
|
2531
|
+
/** Set active index */
|
|
2532
|
+
setActiveIndex: (index: number) => void;
|
|
2533
|
+
/** Select currently active item */
|
|
2534
|
+
selectActive: () => void;
|
|
2535
|
+
/** Navigate to next item */
|
|
2536
|
+
navigateNext: () => void;
|
|
2537
|
+
/** Navigate to previous item */
|
|
2538
|
+
navigatePrevious: () => void;
|
|
2539
|
+
/** Focus the dropdown */
|
|
2540
|
+
focus: () => void;
|
|
2541
|
+
/** Close the dropdown */
|
|
2542
|
+
close: () => void;
|
|
2543
|
+
/** Get active tab ID (if tabs exist) */
|
|
2544
|
+
getActiveTab?: () => string | null;
|
|
2545
|
+
/** Set active tab */
|
|
2546
|
+
setActiveTab?: (tabId: string) => void;
|
|
2547
|
+
/** Scroll to item */
|
|
2548
|
+
scrollToItem?: (index: number) => void;
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
/**
|
|
2552
|
+
* ProductCard – one product tile (primitive)
|
|
2553
|
+
*
|
|
2554
|
+
* Without displayConfig: renders the original minimal layout (image, title, price).
|
|
2555
|
+
* With displayConfig: renders layout variants (minimal, standard, detailed, compact, horizontal).
|
|
2556
|
+
*/
|
|
2557
|
+
|
|
2558
|
+
type ProductCardImageVariant = 'single' | 'carousel' | 'hover' | 'thumbStrip' | 'thumbList';
|
|
2559
|
+
interface ProductCardProps {
|
|
2560
|
+
product: ProductItem;
|
|
2561
|
+
position: number;
|
|
2562
|
+
section?: string;
|
|
2563
|
+
tabId?: string;
|
|
2564
|
+
onSelect: () => void;
|
|
2565
|
+
className?: string;
|
|
2566
|
+
style?: React__default.CSSProperties;
|
|
2567
|
+
imageVariant?: ProductCardImageVariant;
|
|
2568
|
+
/** Product display configuration for layout variants */
|
|
2569
|
+
displayConfig?: ProductDisplayConfig;
|
|
2570
|
+
/** Callback when a variant swatch is hovered (e.g., to swap card image) */
|
|
2571
|
+
onVariantHover?: (optionName: string, value: string) => void;
|
|
2572
|
+
/** Callback when a variant swatch is clicked (e.g., to swap card image permanently) */
|
|
2573
|
+
onVariantClick?: (optionName: string, value: string) => void;
|
|
2574
|
+
/** Currently selected variant values (e.g., { Color: 'Black', Size: 'M' }) */
|
|
2575
|
+
selectedVariants?: Record<string, string>;
|
|
2576
|
+
/** Render as link when true and product.url exists */
|
|
2577
|
+
asLink?: boolean;
|
|
2578
|
+
/** Action buttons (add to cart, wishlist, etc.) */
|
|
2579
|
+
actionButtons?: ActionButton[];
|
|
2580
|
+
/** Action buttons position */
|
|
2581
|
+
actionButtonsPosition?: 'overlay-top-right' | 'overlay-bottom' | 'inline';
|
|
2582
|
+
/** Show action button labels */
|
|
2583
|
+
showActionLabels?: boolean;
|
|
2584
|
+
/** Enable image zoom functionality */
|
|
2585
|
+
enableImageZoom?: boolean;
|
|
2586
|
+
/** Image zoom mode: 'hover' (Amazon-style), 'lens', 'click' (lightbox), 'both' (hover + click) */
|
|
2587
|
+
imageZoomMode?: 'hover' | 'lens' | 'click' | 'both';
|
|
2588
|
+
/** Image zoom magnification level (2 = 200%, 3 = 300%) */
|
|
2589
|
+
imageZoomLevel?: number;
|
|
2590
|
+
}
|
|
2591
|
+
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;
|
|
2592
|
+
|
|
2593
|
+
/**
|
|
2594
|
+
* ProductGrid – grid of product cards from context (primitive)
|
|
2595
|
+
*
|
|
2596
|
+
* Uses trendingProducts or active tab products; each click calls context selectProduct.
|
|
2597
|
+
*/
|
|
2598
|
+
|
|
2599
|
+
interface ProductGridProps {
|
|
2600
|
+
maxItems?: number;
|
|
2601
|
+
/** 'trending' | tab id for filtered tab products */
|
|
2602
|
+
source?: 'trending' | string;
|
|
2603
|
+
columns?: number;
|
|
2604
|
+
className?: string;
|
|
2605
|
+
style?: React__default.CSSProperties;
|
|
2606
|
+
gridClassName?: string;
|
|
2607
|
+
/** Product display configuration passed through to each ProductCard */
|
|
2608
|
+
displayConfig?: ProductDisplayConfig;
|
|
2609
|
+
/** Callback when a variant swatch is hovered on a card */
|
|
2610
|
+
onVariantHover?: (optionName: string, value: string) => void;
|
|
2611
|
+
}
|
|
2612
|
+
declare function ProductGrid({ maxItems, source, columns, className, style, gridClassName, displayConfig, onVariantHover, }: ProductGridProps): React__default.JSX.Element | null;
|
|
2613
|
+
|
|
2614
|
+
/**
|
|
2615
|
+
* CategoriesTabs – horizontal tabs (e.g. filtered tabs) (primitive)
|
|
2616
|
+
*
|
|
2617
|
+
* Active tab from context; on select updates context and tracks analytics.
|
|
2618
|
+
*/
|
|
2619
|
+
|
|
2620
|
+
interface CategoriesTabsProps {
|
|
2621
|
+
className?: string;
|
|
2622
|
+
style?: React__default.CSSProperties;
|
|
2623
|
+
tabClassName?: string;
|
|
2624
|
+
}
|
|
2625
|
+
declare function CategoriesTabs({ className, style, tabClassName }: CategoriesTabsProps): React__default.JSX.Element | null;
|
|
2626
|
+
|
|
2627
|
+
/**
|
|
2628
|
+
* RecentSearchesList – list of recent queries (primitive)
|
|
2629
|
+
*
|
|
2630
|
+
* Reads recentSearches from context; each click calls selectRecentSearch. Optional title/render.
|
|
2631
|
+
*/
|
|
2632
|
+
|
|
2633
|
+
interface RecentSearchesListProps {
|
|
2634
|
+
title?: string;
|
|
2635
|
+
maxItems?: number;
|
|
2636
|
+
className?: string;
|
|
2637
|
+
style?: React__default.CSSProperties;
|
|
2638
|
+
listClassName?: string;
|
|
2639
|
+
renderItem?: (search: RecentSearch, index: number, onSelect: () => void) => React__default.ReactNode;
|
|
2640
|
+
}
|
|
2641
|
+
declare function RecentSearchesList({ title, maxItems, className, style, listClassName, renderItem, }: RecentSearchesListProps): React__default.JSX.Element | null;
|
|
2642
|
+
|
|
2643
|
+
/**
|
|
2644
|
+
* TrendingList – list of trending searches (primitive)
|
|
2645
|
+
*
|
|
2646
|
+
* Reads trendingSearches from context; each click calls selectTrendingSearch. Optional title/render.
|
|
2647
|
+
*/
|
|
2648
|
+
|
|
2649
|
+
interface TrendingListProps {
|
|
2650
|
+
title?: string;
|
|
2651
|
+
maxItems?: number;
|
|
2652
|
+
className?: string;
|
|
2653
|
+
style?: React__default.CSSProperties;
|
|
2654
|
+
listClassName?: string;
|
|
2655
|
+
renderItem?: (trending: TrendingSearch, index: number, onSelect: () => void) => React__default.ReactNode;
|
|
2656
|
+
}
|
|
2657
|
+
declare function TrendingList({ title, maxItems, className, style, listClassName, renderItem, }: TrendingListProps): React__default.JSX.Element | null;
|
|
2658
|
+
|
|
2659
|
+
/**
|
|
2660
|
+
* SuggestionsError – error message (primitive)
|
|
2661
|
+
*/
|
|
2662
|
+
|
|
2663
|
+
interface SuggestionsErrorProps {
|
|
2664
|
+
className?: string;
|
|
2665
|
+
style?: React__default.CSSProperties;
|
|
2666
|
+
render?: (error: Error) => React__default.ReactNode;
|
|
2667
|
+
}
|
|
2668
|
+
declare function SuggestionsError({ className, style, render }: SuggestionsErrorProps): React__default.JSX.Element | null;
|
|
2669
|
+
|
|
2670
|
+
/**
|
|
2671
|
+
* SuggestionsDropdownComposition – reference composition
|
|
2672
|
+
*
|
|
2673
|
+
* Example layout built from primitives: SearchInput + DropdownPanel containing
|
|
2674
|
+
* RecentSearchesList (when query empty), SuggestionList, CategoriesTabs, ProductGrid, TrendingList.
|
|
2675
|
+
* Wrap with SearchProvider and SuggestionsProvider. Use as reference or replace
|
|
2676
|
+
* with your own arrangement of the same primitives.
|
|
2677
|
+
*/
|
|
2678
|
+
|
|
2679
|
+
interface SuggestionsDropdownCompositionProps extends Omit<SuggestionsProviderProps, 'children'> {
|
|
2680
|
+
/** Show recent searches when query is empty */
|
|
2681
|
+
showRecentSearches?: boolean;
|
|
2682
|
+
/** Show trending list */
|
|
2683
|
+
showTrending?: boolean;
|
|
2684
|
+
/** Show categories/filtered tabs */
|
|
2685
|
+
showTabs?: boolean;
|
|
2686
|
+
/** Show product grid */
|
|
2687
|
+
showProducts?: boolean;
|
|
2688
|
+
/** SearchInput placeholder */
|
|
2689
|
+
placeholder?: string;
|
|
2690
|
+
}
|
|
2691
|
+
declare function SuggestionsDropdownComposition({ showRecentSearches, showTrending, showTabs, showProducts, placeholder, ...providerProps }: SuggestionsDropdownCompositionProps): React__default.JSX.Element;
|
|
2692
|
+
|
|
2693
|
+
/**
|
|
2694
|
+
* ImageZoom – zoom on hover and click (Amazon-style magnifier + lightbox)
|
|
2695
|
+
*
|
|
2696
|
+
* Supports three zoom modes:
|
|
2697
|
+
* - hover: Magnified view in a separate panel on the right (Amazon style)
|
|
2698
|
+
* - lens: Magnifying glass that follows cursor
|
|
2699
|
+
* - click: Full-screen lightbox modal
|
|
2700
|
+
*/
|
|
2701
|
+
|
|
2702
|
+
type ImageZoomMode = 'hover' | 'lens' | 'click' | 'both';
|
|
2703
|
+
interface ImageZoomProps {
|
|
2704
|
+
src: string;
|
|
2705
|
+
alt?: string;
|
|
2706
|
+
mode?: ImageZoomMode;
|
|
2707
|
+
zoomLevel?: number;
|
|
2708
|
+
className?: string;
|
|
2709
|
+
style?: React__default.CSSProperties;
|
|
2710
|
+
/** Show zoom indicator icon */
|
|
2711
|
+
showZoomIndicator?: boolean;
|
|
2712
|
+
/** Lens size in pixels (for lens mode) */
|
|
2713
|
+
lensSize?: number;
|
|
2714
|
+
/** Zoom panel size (for hover mode) */
|
|
2715
|
+
zoomPanelSize?: {
|
|
2716
|
+
width: number;
|
|
2717
|
+
height: number;
|
|
2718
|
+
};
|
|
2719
|
+
/** Multiple images for lightbox carousel */
|
|
2720
|
+
images?: string[];
|
|
2721
|
+
/** Current image index (for multi-image support) */
|
|
2722
|
+
currentIndex?: number;
|
|
2723
|
+
}
|
|
2724
|
+
declare function ImageZoom({ src, alt, mode, zoomLevel, className, style, showZoomIndicator, lensSize, zoomPanelSize, images, currentIndex, }: ImageZoomProps): React__default.JSX.Element;
|
|
2725
|
+
|
|
2726
|
+
/**
|
|
2727
|
+
* ImageDisplay – configurable multi-image display (primitive)
|
|
2728
|
+
*
|
|
2729
|
+
* Variants: single, carousel, hover, thumbStrip, thumbList. Use in ItemCard,
|
|
2730
|
+
* ProductCard, ProductGallery. Overridable via className/style.
|
|
2731
|
+
*/
|
|
2732
|
+
|
|
2733
|
+
type ImageDisplayVariant = 'single' | 'carousel' | 'hover' | 'thumbStrip' | 'thumbList';
|
|
2734
|
+
interface ImageDisplayProps {
|
|
2735
|
+
images: string[];
|
|
2736
|
+
variant?: ImageDisplayVariant;
|
|
2737
|
+
alt?: string;
|
|
2738
|
+
className?: string;
|
|
2739
|
+
style?: React__default.CSSProperties;
|
|
2740
|
+
carouselAutoplay?: boolean;
|
|
2741
|
+
carouselIntervalMs?: number;
|
|
2742
|
+
/** Enable zoom functionality */
|
|
2743
|
+
enableZoom?: boolean;
|
|
2744
|
+
/** Zoom mode: 'hover' (Amazon-style), 'lens', 'click' (lightbox), 'both' (hover + click) */
|
|
2745
|
+
zoomMode?: ImageZoomMode;
|
|
2746
|
+
/** Zoom magnification level (2 = 200%, 3 = 300%) */
|
|
2747
|
+
zoomLevel?: number;
|
|
2748
|
+
/** Show navigation dots for carousel */
|
|
2749
|
+
showDots?: boolean;
|
|
2750
|
+
}
|
|
2751
|
+
declare function ImageDisplay({ images, variant, alt, className, style, carouselAutoplay, carouselIntervalMs, enableZoom, zoomMode, zoomLevel, showDots, }: ImageDisplayProps): React__default.JSX.Element;
|
|
2752
|
+
|
|
2753
|
+
/**
|
|
2754
|
+
* PriceDisplay – reusable price display primitive
|
|
2755
|
+
*
|
|
2756
|
+
* Handles single price, compare price with strikethrough, discount percentage,
|
|
2757
|
+
* and price range display.
|
|
2758
|
+
*/
|
|
2759
|
+
|
|
2760
|
+
interface PriceDisplayProps {
|
|
2761
|
+
price?: number;
|
|
2762
|
+
comparePrice?: number;
|
|
2763
|
+
priceRange?: PriceRange | null;
|
|
2764
|
+
currency?: string;
|
|
2765
|
+
currencyPosition?: 'before' | 'after';
|
|
2766
|
+
priceDecimals?: number;
|
|
2767
|
+
showDiscount?: boolean;
|
|
2768
|
+
className?: string;
|
|
2769
|
+
style?: React__default.CSSProperties;
|
|
2770
|
+
}
|
|
2771
|
+
declare function PriceDisplay({ price, comparePrice, priceRange, currency, currencyPosition, priceDecimals, showDiscount, className, style, }: PriceDisplayProps): React__default.JSX.Element | null;
|
|
2772
|
+
|
|
2773
|
+
/**
|
|
2774
|
+
* BadgeList – renders product badges (sale, new, sold out, custom)
|
|
2775
|
+
*/
|
|
2776
|
+
|
|
2777
|
+
interface BadgeListProps {
|
|
2778
|
+
badges: ProductBadge[];
|
|
2779
|
+
maxBadges?: number;
|
|
2780
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'inline';
|
|
2781
|
+
className?: string;
|
|
2782
|
+
style?: React__default.CSSProperties;
|
|
2783
|
+
}
|
|
2784
|
+
declare function BadgeList({ badges, maxBadges, position, className, style, }: BadgeListProps): React__default.JSX.Element | null;
|
|
2785
|
+
|
|
2786
|
+
/**
|
|
2787
|
+
* RatingDisplay – star rating display with review count
|
|
2788
|
+
*
|
|
2789
|
+
* Supports multiple variants: stars-only, compact, full, inline.
|
|
2790
|
+
* Can be read-only (display) or interactive (for reviews).
|
|
2791
|
+
*/
|
|
2792
|
+
|
|
2793
|
+
type RatingVariant = 'stars-only' | 'compact' | 'full' | 'inline';
|
|
2794
|
+
type RatingSize = 'small' | 'medium' | 'large';
|
|
2795
|
+
interface RatingDisplayProps {
|
|
2796
|
+
/** Rating value (0-5) */
|
|
2797
|
+
rating: number;
|
|
2798
|
+
/** Total number of reviews */
|
|
2799
|
+
reviewCount?: number;
|
|
2800
|
+
/** Display variant */
|
|
2801
|
+
variant?: RatingVariant;
|
|
2802
|
+
/** Size of stars */
|
|
2803
|
+
size?: RatingSize;
|
|
2804
|
+
/** Maximum rating (default: 5) */
|
|
2805
|
+
maxRating?: number;
|
|
2806
|
+
/** Show decimal rating number */
|
|
2807
|
+
showNumeric?: boolean;
|
|
2808
|
+
/** Show half stars */
|
|
2809
|
+
showHalfStars?: boolean;
|
|
2810
|
+
/** Interactive mode (for leaving reviews) */
|
|
2811
|
+
interactive?: boolean;
|
|
2812
|
+
/** Callback when rating is clicked (interactive mode) */
|
|
2813
|
+
onRatingChange?: (rating: number) => void;
|
|
2814
|
+
/** Custom star color */
|
|
2815
|
+
starColor?: string;
|
|
2816
|
+
/** Custom empty star color */
|
|
2817
|
+
emptyStarColor?: string;
|
|
2818
|
+
/** Custom text color */
|
|
2819
|
+
textColor?: string;
|
|
2820
|
+
/** Show review count in parentheses */
|
|
2821
|
+
showReviewCount?: boolean;
|
|
2822
|
+
/** Custom review count format */
|
|
2823
|
+
reviewCountFormat?: (count: number) => string;
|
|
2824
|
+
className?: string;
|
|
2825
|
+
style?: React__default.CSSProperties;
|
|
2826
|
+
}
|
|
2827
|
+
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;
|
|
2828
|
+
|
|
2829
|
+
/**
|
|
2830
|
+
* VariantSwatches – inline variant indicators for card display
|
|
2831
|
+
*
|
|
2832
|
+
* Shows color dots, size labels, and "+N more" overflow for compact card views.
|
|
2833
|
+
*/
|
|
2834
|
+
|
|
2835
|
+
interface VariantSwatchesProps {
|
|
2836
|
+
options: ProductOption[];
|
|
2837
|
+
/** Which option names to show (default: all) */
|
|
2838
|
+
visibleOptions?: string[];
|
|
2839
|
+
/** Max values per option before "+N more" (default: 5) */
|
|
2840
|
+
maxValues?: number;
|
|
2841
|
+
/** Map option value names to CSS color strings */
|
|
2842
|
+
colorMap?: Record<string, string>;
|
|
2843
|
+
/** Currently selected value per option (e.g., { Color: 'Black', Size: 'M' }) */
|
|
2844
|
+
selectedValues?: Record<string, string>;
|
|
2845
|
+
/** Product variants for availability checking */
|
|
2846
|
+
variants?: ProductVariant[];
|
|
2847
|
+
/** Show availability cross-out for unavailable combos (default: true) */
|
|
2848
|
+
showAvailability?: boolean;
|
|
2849
|
+
onSwatchHover?: (optionName: string, value: string) => void;
|
|
2850
|
+
onSwatchClick?: (optionName: string, value: string) => void;
|
|
2851
|
+
className?: string;
|
|
2852
|
+
style?: React__default.CSSProperties;
|
|
2853
|
+
}
|
|
2854
|
+
declare function VariantSwatches({ options, visibleOptions, maxValues, colorMap, selectedValues, variants, showAvailability, onSwatchHover, onSwatchClick, className, style, }: VariantSwatchesProps): React__default.JSX.Element | null;
|
|
2855
|
+
|
|
2856
|
+
/**
|
|
2857
|
+
* VariantSelector – full variant selector for product detail pages
|
|
2858
|
+
*
|
|
2859
|
+
* Three render modes per option:
|
|
2860
|
+
* - swatch: color circles (auto-detected for "Color" option or when colorMap provided)
|
|
2861
|
+
* - button: rectangular buttons (default for most options)
|
|
2862
|
+
* - dropdown: <select> for options with many values
|
|
2863
|
+
*/
|
|
2864
|
+
|
|
2865
|
+
interface VariantSelectorProps {
|
|
2866
|
+
options: ProductOption[];
|
|
2867
|
+
variants: ProductVariant[];
|
|
2868
|
+
selections: Record<string, string>;
|
|
2869
|
+
onSelectionChange: (optionName: string, value: string) => void;
|
|
2870
|
+
/** Override render mode per option name */
|
|
2871
|
+
optionRenderModes?: Record<string, 'swatch' | 'button' | 'dropdown'>;
|
|
2872
|
+
/** Auto-switch to dropdown when values exceed this count (default: 8) */
|
|
2873
|
+
dropdownThreshold?: number;
|
|
2874
|
+
/** Map value names to CSS colors */
|
|
2875
|
+
colorMap?: Record<string, string>;
|
|
2876
|
+
/** Show availability cross-out for unavailable combos */
|
|
2877
|
+
showAvailability?: boolean;
|
|
2878
|
+
/** Currently matched variant (for display) */
|
|
2879
|
+
selectedVariant?: ProductVariant | null;
|
|
2880
|
+
className?: string;
|
|
2881
|
+
style?: React__default.CSSProperties;
|
|
2882
|
+
}
|
|
2883
|
+
declare function VariantSelector({ options, variants, selections, onSelectionChange, optionRenderModes, dropdownThreshold, colorMap, showAvailability, selectedVariant: _selectedVariant, className, style, }: VariantSelectorProps): React__default.JSX.Element | null;
|
|
2884
|
+
|
|
2885
|
+
/**
|
|
2886
|
+
* withAnalytics – HOC that wraps any React component to inject analytics tracking
|
|
2887
|
+
*/
|
|
2888
|
+
|
|
2889
|
+
interface WithAnalyticsConfig {
|
|
2890
|
+
/** Track clicks on the component */
|
|
2891
|
+
trackClick?: boolean;
|
|
2892
|
+
/** Track impressions (visibility) */
|
|
2893
|
+
trackImpression?: boolean;
|
|
2894
|
+
/** Custom event name for click */
|
|
2895
|
+
clickEventName?: string;
|
|
2896
|
+
/** Extract product/item data from props */
|
|
2897
|
+
getProductFromProps?: (props: any) => ProductItem | null;
|
|
2898
|
+
/** Extract position from props */
|
|
2899
|
+
getPositionFromProps?: (props: any) => number;
|
|
2900
|
+
}
|
|
2901
|
+
interface WithAnalyticsInjectedProps {
|
|
2902
|
+
seekoraClient?: SeekoraClient;
|
|
2903
|
+
seekoraContext?: SearchContext | Partial<SearchContext>;
|
|
2904
|
+
}
|
|
2905
|
+
declare function withAnalytics<P extends object>(Component: React__default.ComponentType<P>, config?: WithAnalyticsConfig): React__default.ComponentType<P & WithAnalyticsInjectedProps>;
|
|
2906
|
+
|
|
2907
|
+
/**
|
|
2908
|
+
* AnalyticsProvider – context + delegated event listener for data-seekora-* attribute-based analytics
|
|
2909
|
+
*
|
|
2910
|
+
* Installs a delegated click listener on a container. Any descendant with
|
|
2911
|
+
* data-seekora-track="click"|"add-to-cart" and data-seekora-product-id="..."
|
|
2912
|
+
* automatically fires analytics events without React wiring.
|
|
2913
|
+
*/
|
|
2914
|
+
|
|
2915
|
+
interface AnalyticsProviderProps {
|
|
2916
|
+
client: SeekoraClient;
|
|
2917
|
+
context?: SearchContext | Partial<SearchContext>;
|
|
2918
|
+
children: React__default.ReactNode;
|
|
2919
|
+
}
|
|
2920
|
+
interface AnalyticsContextValue {
|
|
2921
|
+
client: SeekoraClient;
|
|
2922
|
+
context?: SearchContext | Partial<SearchContext>;
|
|
2923
|
+
}
|
|
2924
|
+
declare const useAnalyticsProvider: () => AnalyticsContextValue | null;
|
|
2925
|
+
declare function AnalyticsProvider({ client, context, children }: AnalyticsProviderProps): React__default.JSX.Element;
|
|
2926
|
+
|
|
2927
|
+
/**
|
|
2928
|
+
* CustomSelect — lightweight, accessible custom dropdown replacement for native <select>.
|
|
2929
|
+
*
|
|
2930
|
+
* CSS Variables (apply on a parent element to customize):
|
|
2931
|
+
* --seekora-select-bg — background color (default: #fff)
|
|
2932
|
+
* --seekora-select-color — text color (default: inherit)
|
|
2933
|
+
* --seekora-select-border — border color (default: rgba(128,128,128,0.3))
|
|
2934
|
+
* --seekora-select-hover-bg — option hover background (default: #f3f4f6)
|
|
2935
|
+
* --seekora-select-active-bg — selected option background (default: #eff6ff)
|
|
2936
|
+
* --seekora-select-active-color — selected option text color (default: inherit)
|
|
2937
|
+
* --seekora-select-radius — border radius (default: 6px)
|
|
2938
|
+
* --seekora-select-font-size — font size (default: 0.875rem)
|
|
2939
|
+
*/
|
|
2940
|
+
|
|
2941
|
+
interface CustomSelectOption {
|
|
2942
|
+
value: string;
|
|
2943
|
+
label: string;
|
|
2944
|
+
disabled?: boolean;
|
|
2945
|
+
}
|
|
2946
|
+
interface CustomSelectTheme {
|
|
2947
|
+
trigger?: string;
|
|
2948
|
+
menu?: string;
|
|
2949
|
+
option?: string;
|
|
2950
|
+
optionActive?: string;
|
|
2951
|
+
optionDisabled?: string;
|
|
2952
|
+
}
|
|
2953
|
+
interface CustomSelectProps {
|
|
2954
|
+
value: string;
|
|
2955
|
+
onChange: (value: string) => void;
|
|
2956
|
+
options: CustomSelectOption[];
|
|
2957
|
+
placeholder?: string;
|
|
2958
|
+
className?: string;
|
|
2959
|
+
style?: React__default.CSSProperties;
|
|
2960
|
+
theme?: CustomSelectTheme;
|
|
2961
|
+
/** aria-label for the trigger button */
|
|
2962
|
+
'aria-label'?: string;
|
|
2963
|
+
disabled?: boolean;
|
|
2964
|
+
}
|
|
2965
|
+
declare const CustomSelect: React__default.FC<CustomSelectProps>;
|
|
2966
|
+
|
|
2967
|
+
/**
|
|
2968
|
+
* SectionSearchProvider – preset query + filter section
|
|
2969
|
+
*
|
|
2970
|
+
* Runs client.search(query, { refinements, hitsPerPage, sortBy }) on mount and when
|
|
2971
|
+
* query/filters change. Does not use global SearchStateManager. Use for menus,
|
|
2972
|
+
* sidebar, front-page blocks (e.g. "New arrivals", "On sale").
|
|
2973
|
+
*/
|
|
2974
|
+
|
|
2975
|
+
interface RefinementInput {
|
|
2976
|
+
field: string;
|
|
2977
|
+
value: string;
|
|
2978
|
+
}
|
|
2979
|
+
interface SectionSearchProviderProps {
|
|
2980
|
+
children: React__default.ReactNode;
|
|
2981
|
+
query: string;
|
|
2982
|
+
refinements?: RefinementInput[];
|
|
2983
|
+
maxItems?: number;
|
|
2984
|
+
sortBy?: string;
|
|
2985
|
+
enabled?: boolean;
|
|
2986
|
+
sectionId?: string;
|
|
2987
|
+
/** Additional search options merged into the request (e.g. { widget_mode: false }). */
|
|
2988
|
+
searchOptions?: Record<string, unknown>;
|
|
2989
|
+
}
|
|
2990
|
+
declare function SectionSearchProvider({ children, query, refinements, maxItems, sortBy, enabled, sectionId, searchOptions, }: SectionSearchProviderProps): React__default.JSX.Element;
|
|
2991
|
+
|
|
2992
|
+
/**
|
|
2993
|
+
* SectionSearchContext – preset query/filter section state
|
|
2994
|
+
*
|
|
2995
|
+
* For menus, sidebar, front-page blocks. Independent of main search state.
|
|
2996
|
+
*/
|
|
2997
|
+
|
|
2998
|
+
interface SectionSearchContextValue {
|
|
2999
|
+
items: unknown[];
|
|
3000
|
+
loading: boolean;
|
|
3001
|
+
error: Error | null;
|
|
3002
|
+
totalCount: number;
|
|
3003
|
+
sectionId?: string;
|
|
3004
|
+
trackClick: (item: unknown, position: number) => void;
|
|
3005
|
+
}
|
|
3006
|
+
declare function useSectionSearchContext(): SectionSearchContextValue;
|
|
3007
|
+
|
|
3008
|
+
/**
|
|
3009
|
+
* SectionItemGrid – generic grid of items from SectionSearchProvider (primitive)
|
|
3010
|
+
*/
|
|
3011
|
+
|
|
3012
|
+
interface SectionItemGridProps {
|
|
3013
|
+
columns?: number;
|
|
3014
|
+
maxItems?: number;
|
|
3015
|
+
className?: string;
|
|
3016
|
+
style?: React__default.CSSProperties;
|
|
3017
|
+
getItemId?: (item: unknown) => string;
|
|
3018
|
+
getItemTitle?: (item: unknown) => string;
|
|
3019
|
+
getItemImage?: (item: unknown) => string | undefined;
|
|
3020
|
+
getItemDescription?: (item: unknown) => string | undefined;
|
|
3021
|
+
getItemUrl?: (item: unknown) => string | undefined;
|
|
3022
|
+
renderItem?: (item: unknown, index: number) => React__default.ReactNode;
|
|
3023
|
+
}
|
|
3024
|
+
declare function SectionItemGrid({ columns, maxItems, className, style, getItemId, getItemTitle, getItemImage, getItemDescription, getItemUrl, renderItem, }: SectionItemGridProps): React__default.JSX.Element;
|
|
3025
|
+
|
|
3026
|
+
/**
|
|
3027
|
+
* SectionError – error state for section (primitive)
|
|
3028
|
+
*/
|
|
3029
|
+
|
|
3030
|
+
interface SectionErrorProps {
|
|
3031
|
+
className?: string;
|
|
3032
|
+
style?: React__default.CSSProperties;
|
|
3033
|
+
render?: (error: Error) => React__default.ReactNode;
|
|
3034
|
+
}
|
|
3035
|
+
declare function SectionError({ className, style, render }: SectionErrorProps): React__default.JSX.Element | null;
|
|
3036
|
+
|
|
3037
|
+
/**
|
|
3038
|
+
* ProductGallery – product detail image gallery (primitive)
|
|
3039
|
+
*
|
|
3040
|
+
* Uses ImageDisplay with configurable variant (carousel, thumbStrip, etc.).
|
|
3041
|
+
* For use on individual product page.
|
|
3042
|
+
*/
|
|
3043
|
+
|
|
3044
|
+
interface ProductGalleryProps {
|
|
3045
|
+
images: string[];
|
|
3046
|
+
variant?: ImageDisplayVariant;
|
|
3047
|
+
alt?: string;
|
|
3048
|
+
className?: string;
|
|
3049
|
+
style?: React__default.CSSProperties;
|
|
3050
|
+
carouselAutoplay?: boolean;
|
|
3051
|
+
carouselIntervalMs?: number;
|
|
3052
|
+
/** Enable zoom functionality on product images */
|
|
3053
|
+
enableZoom?: boolean;
|
|
3054
|
+
/** Zoom mode: 'hover' (Amazon-style), 'lens', 'click' (lightbox), 'both' */
|
|
3055
|
+
zoomMode?: ImageZoomMode;
|
|
3056
|
+
/** Zoom magnification level (2 = 200%, 3 = 300%) */
|
|
3057
|
+
zoomLevel?: number;
|
|
3058
|
+
}
|
|
3059
|
+
declare function ProductGallery({ images, variant, alt, className, style, carouselAutoplay, carouselIntervalMs, enableZoom, zoomMode, zoomLevel, }: ProductGalleryProps): React__default.JSX.Element;
|
|
3060
|
+
|
|
3061
|
+
/**
|
|
3062
|
+
* ProductInfo – product detail block (primitive)
|
|
3063
|
+
*
|
|
3064
|
+
* Title, description, price, optional variant selector and CTA. Minimal layout;
|
|
3065
|
+
* override with className/style. For use on individual product page.
|
|
3066
|
+
*
|
|
3067
|
+
* When options/variants/selections/onSelectionChange are provided and
|
|
3068
|
+
* renderVariantSelector is NOT provided, renders the built-in VariantSelector.
|
|
3069
|
+
* renderVariantSelector still takes priority as an override.
|
|
3070
|
+
*/
|
|
3071
|
+
|
|
3072
|
+
interface ProductInfoProps {
|
|
3073
|
+
title: string;
|
|
3074
|
+
description?: string;
|
|
3075
|
+
price?: number | string;
|
|
3076
|
+
currency?: string;
|
|
3077
|
+
/** Compare/original price for strikethrough display */
|
|
3078
|
+
comparePrice?: number | string;
|
|
3079
|
+
/** Product brand */
|
|
3080
|
+
brand?: string;
|
|
3081
|
+
/** Whether product is available */
|
|
3082
|
+
available?: boolean;
|
|
3083
|
+
/** Badges to display */
|
|
3084
|
+
badges?: ProductBadge[];
|
|
3085
|
+
/** Product option axes (Color, Size, etc.) */
|
|
3086
|
+
options?: ProductOption[];
|
|
3087
|
+
/** Product variants */
|
|
3088
|
+
variants?: ProductVariant[];
|
|
3089
|
+
/** Currently selected variant */
|
|
3090
|
+
selectedVariant?: ProductVariant | null;
|
|
3091
|
+
/** Current option selections */
|
|
3092
|
+
selections?: Record<string, string>;
|
|
3093
|
+
/** Called when an option value is selected */
|
|
3094
|
+
onSelectionChange?: (optionName: string, value: string) => void;
|
|
3095
|
+
/** Optional variant selector override (takes priority over built-in) */
|
|
3096
|
+
renderVariantSelector?: () => React__default.ReactNode;
|
|
3097
|
+
/** Optional CTA (e.g. Add to cart) */
|
|
3098
|
+
renderCTA?: () => React__default.ReactNode;
|
|
3099
|
+
className?: string;
|
|
3100
|
+
style?: React__default.CSSProperties;
|
|
3101
|
+
}
|
|
3102
|
+
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;
|
|
3103
|
+
|
|
3104
|
+
/**
|
|
3105
|
+
* ProductRecommendations – related / frequently bought (primitive)
|
|
3106
|
+
*
|
|
3107
|
+
* Renders a section of recommended items (generic ItemGrid or product list).
|
|
3108
|
+
* Pass items and onItemClick; or wrap SectionSearchProvider with preset query for "related".
|
|
3109
|
+
* For use on individual product page.
|
|
3110
|
+
*/
|
|
3111
|
+
|
|
3112
|
+
interface ProductRecommendationsProps {
|
|
3113
|
+
title?: string;
|
|
3114
|
+
items: GenericItem[] | unknown[];
|
|
3115
|
+
onItemClick?: (item: unknown, index: number) => void;
|
|
3116
|
+
maxItems?: number;
|
|
3117
|
+
columns?: number;
|
|
3118
|
+
className?: string;
|
|
3119
|
+
style?: React__default.CSSProperties;
|
|
3120
|
+
renderItem?: (item: unknown, index: number) => React__default.ReactNode;
|
|
3121
|
+
}
|
|
3122
|
+
declare function ProductRecommendations({ title, items, onItemClick, maxItems, columns, className, style, renderItem, }: ProductRecommendationsProps): React__default.JSX.Element | null;
|
|
3123
|
+
|
|
3124
|
+
/**
|
|
3125
|
+
* MinimalDropdown - Ultra-Clean Minimalist Style
|
|
3126
|
+
*
|
|
3127
|
+
* Features:
|
|
3128
|
+
* - Stripped-down, distraction-free design
|
|
3129
|
+
* - Focus on typography and whitespace
|
|
3130
|
+
* - Subtle animations
|
|
3131
|
+
* - Perfect for editorial/content sites
|
|
3132
|
+
*/
|
|
3133
|
+
|
|
3134
|
+
interface MinimalDropdownProps extends BaseDropdownProps {
|
|
3135
|
+
/** Show item indices */
|
|
3136
|
+
showIndices?: boolean;
|
|
3137
|
+
/** Show item type labels */
|
|
3138
|
+
showTypeLabels?: boolean;
|
|
3139
|
+
/** Show dividers between sections */
|
|
3140
|
+
showSectionDividers?: boolean;
|
|
3141
|
+
/** Monospace indices */
|
|
3142
|
+
monoIndices?: boolean;
|
|
3143
|
+
}
|
|
3144
|
+
declare const MinimalDropdown: React__default.ForwardRefExoticComponent<MinimalDropdownProps & React__default.RefAttributes<DropdownRef>>;
|
|
3145
|
+
|
|
3146
|
+
/**
|
|
3147
|
+
* MobileSheetDropdown - Mobile-First Bottom Sheet Style
|
|
3148
|
+
*
|
|
3149
|
+
* Features:
|
|
3150
|
+
* - iOS-style bottom sheet with drag handle
|
|
3151
|
+
* - Full-screen overlay with smooth transitions
|
|
3152
|
+
* - Touch-friendly large tap targets
|
|
3153
|
+
* - Swipe to dismiss
|
|
3154
|
+
* - Optimized for small screens
|
|
3155
|
+
*/
|
|
3156
|
+
|
|
3157
|
+
interface MobileSheetDropdownProps extends BaseDropdownProps {
|
|
3158
|
+
/** Show search input in header */
|
|
3159
|
+
showSearchInput?: boolean;
|
|
3160
|
+
/** Show cancel button */
|
|
3161
|
+
showCancel?: boolean;
|
|
3162
|
+
/** Cancel button text */
|
|
3163
|
+
cancelText?: string;
|
|
3164
|
+
/** Show drag handle */
|
|
3165
|
+
showDragHandle?: boolean;
|
|
3166
|
+
/** Enable swipe to dismiss */
|
|
3167
|
+
swipeToDismiss?: boolean;
|
|
3168
|
+
/** Footer button text */
|
|
3169
|
+
footerButtonText?: string;
|
|
3170
|
+
/** Show footer button */
|
|
3171
|
+
showFooterButton?: boolean;
|
|
3172
|
+
}
|
|
3173
|
+
declare const MobileSheetDropdown: React__default.ForwardRefExoticComponent<MobileSheetDropdownProps & React__default.RefAttributes<DropdownRef>>;
|
|
3174
|
+
|
|
3175
|
+
/**
|
|
3176
|
+
* ShopifyDropdown - Modern E-commerce Style Suggestions
|
|
3177
|
+
*
|
|
3178
|
+
* Features:
|
|
3179
|
+
* - Hero product with large image
|
|
3180
|
+
* - Horizontal product scroll
|
|
3181
|
+
* - Collection/category links
|
|
3182
|
+
* - Clean, modern design
|
|
3183
|
+
* - Quick add to cart
|
|
3184
|
+
*/
|
|
3185
|
+
|
|
3186
|
+
interface ShopifyDropdownProps extends BaseDropdownProps {
|
|
3187
|
+
/** Show hero product */
|
|
3188
|
+
showHeroProduct?: boolean;
|
|
3189
|
+
/** Show collections/categories */
|
|
3190
|
+
showCollections?: boolean;
|
|
3191
|
+
/** Show add to cart button */
|
|
3192
|
+
showAddToCart?: boolean;
|
|
3193
|
+
/** Add to cart text */
|
|
3194
|
+
addToCartText?: string;
|
|
3195
|
+
/** Show compare price */
|
|
3196
|
+
showComparePrice?: boolean;
|
|
3197
|
+
}
|
|
3198
|
+
declare const ShopifyDropdown: React__default.ForwardRefExoticComponent<ShopifyDropdownProps & React__default.RefAttributes<DropdownRef>>;
|
|
3199
|
+
|
|
3200
|
+
/**
|
|
3201
|
+
* SpotlightDropdown - macOS Spotlight / Command Palette Style
|
|
3202
|
+
*
|
|
3203
|
+
* Features:
|
|
3204
|
+
* - Clean, centered modal design
|
|
3205
|
+
* - Category grouping with keyboard navigation
|
|
3206
|
+
* - Instant preview panel
|
|
3207
|
+
* - Actions/commands support
|
|
3208
|
+
* - Keyboard-first interaction
|
|
3209
|
+
*/
|
|
3210
|
+
|
|
3211
|
+
interface SpotlightDropdownProps extends BaseDropdownProps {
|
|
3212
|
+
/** Show preview panel */
|
|
3213
|
+
showPreview?: boolean;
|
|
3214
|
+
/** Show as overlay */
|
|
3215
|
+
asOverlay?: boolean;
|
|
3216
|
+
/** Placeholder text */
|
|
3217
|
+
placeholder?: string;
|
|
3218
|
+
/** Show keyboard shortcuts */
|
|
3219
|
+
showShortcuts?: boolean;
|
|
3220
|
+
/** Quick actions */
|
|
3221
|
+
actions?: Array<{
|
|
3222
|
+
id: string;
|
|
3223
|
+
label: string;
|
|
3224
|
+
icon?: React__default.ReactNode;
|
|
3225
|
+
shortcut?: string;
|
|
3226
|
+
onAction: () => void;
|
|
3227
|
+
}>;
|
|
3228
|
+
}
|
|
3229
|
+
declare const SpotlightDropdown: React__default.ForwardRefExoticComponent<SpotlightDropdownProps & React__default.RefAttributes<DropdownRef>>;
|
|
3230
|
+
|
|
3231
|
+
/**
|
|
3232
|
+
* PinterestDropdown - Visual Discovery Style Suggestions
|
|
3233
|
+
*
|
|
3234
|
+
* Features:
|
|
3235
|
+
* - Visually-driven masonry/grid product display
|
|
3236
|
+
* - Large hero images
|
|
3237
|
+
* - Category chips/pills for filtering
|
|
3238
|
+
* - Smooth hover effects with quick preview
|
|
3239
|
+
* - Color palette extraction ready
|
|
3240
|
+
*/
|
|
3241
|
+
|
|
3242
|
+
interface PinterestDropdownProps extends BaseDropdownProps {
|
|
3243
|
+
/** Show save/pin button on products */
|
|
3244
|
+
showSaveButton?: boolean;
|
|
3245
|
+
/** Save button handler */
|
|
3246
|
+
onSaveProduct?: (product: any) => void;
|
|
3247
|
+
/** Active category ID */
|
|
3248
|
+
activeCategory?: string;
|
|
3249
|
+
/** Show price overlay on hover */
|
|
3250
|
+
showPriceOverlay?: boolean;
|
|
3251
|
+
/** Grid columns */
|
|
3252
|
+
gridColumns?: number;
|
|
3253
|
+
/** Card aspect ratio */
|
|
3254
|
+
cardAspectRatio?: 'square' | 'portrait' | 'landscape';
|
|
3255
|
+
}
|
|
3256
|
+
declare const PinterestDropdown: React__default.ForwardRefExoticComponent<PinterestDropdownProps & React__default.RefAttributes<DropdownRef>>;
|
|
3257
|
+
|
|
3258
|
+
/**
|
|
3259
|
+
* GoogleDropdown - Google-style Clean Search Suggestions
|
|
3260
|
+
*
|
|
3261
|
+
* Features:
|
|
3262
|
+
* - Ultra-clean, minimal design
|
|
3263
|
+
* - Instant suggestions with smooth animations
|
|
3264
|
+
* - Trending searches when empty
|
|
3265
|
+
* - "I'm Feeling Lucky" style quick actions
|
|
3266
|
+
* - Voice search integration ready
|
|
3267
|
+
*/
|
|
3268
|
+
|
|
3269
|
+
interface GoogleDropdownProps extends BaseDropdownProps {
|
|
3270
|
+
/** Show "I'm Feeling Lucky" button */
|
|
3271
|
+
showFeelingLucky?: boolean;
|
|
3272
|
+
/** Feeling lucky button text */
|
|
3273
|
+
feelingLuckyText?: string;
|
|
3274
|
+
/** Show remove button on recent searches */
|
|
3275
|
+
showRemoveRecent?: boolean;
|
|
3276
|
+
/** Show voice search button */
|
|
3277
|
+
showVoiceSearch?: boolean;
|
|
3278
|
+
/** Voice search handler */
|
|
3279
|
+
onVoiceSearch?: () => void;
|
|
3280
|
+
/** Feeling lucky handler */
|
|
3281
|
+
onFeelingLucky?: (query: string) => void;
|
|
3282
|
+
/** Show trending indicator */
|
|
3283
|
+
showTrendingIndicator?: boolean;
|
|
3284
|
+
}
|
|
3285
|
+
declare const GoogleDropdown: React__default.ForwardRefExoticComponent<GoogleDropdownProps & React__default.RefAttributes<DropdownRef>>;
|
|
3286
|
+
|
|
3287
|
+
/**
|
|
3288
|
+
* AmazonDropdown - Amazon-style Search Suggestions
|
|
3289
|
+
*
|
|
3290
|
+
* Features:
|
|
3291
|
+
* - Department/category scoping in search
|
|
3292
|
+
* - Suggestions with category context
|
|
3293
|
+
* - Product grid with images
|
|
3294
|
+
* - "in Department" suffix for scoped searches
|
|
3295
|
+
* - Clean, functional design
|
|
3296
|
+
*/
|
|
3297
|
+
|
|
3298
|
+
interface AmazonDropdownProps extends BaseDropdownProps {
|
|
3299
|
+
/** Show department scoping in suggestions */
|
|
3300
|
+
showDepartments?: boolean;
|
|
3301
|
+
/** Current department filter */
|
|
3302
|
+
currentDepartment?: string;
|
|
3303
|
+
/** Available departments */
|
|
3304
|
+
departments?: Array<{
|
|
3305
|
+
id: string;
|
|
3306
|
+
label: string;
|
|
3307
|
+
}>;
|
|
3308
|
+
/** Show Prime badge */
|
|
3309
|
+
showPrime?: boolean;
|
|
3310
|
+
/** Prime icon URL */
|
|
3311
|
+
primeIconUrl?: string;
|
|
3312
|
+
}
|
|
3313
|
+
declare const AmazonDropdown: React__default.ForwardRefExoticComponent<AmazonDropdownProps & React__default.RefAttributes<DropdownRef>>;
|
|
3314
|
+
|
|
3315
|
+
/**
|
|
3316
|
+
* SuggestionSearchBar - Unified Search Component with Premium Dropdowns
|
|
3317
|
+
*
|
|
3318
|
+
* A self-contained search component that:
|
|
3319
|
+
* - Fetches suggestions from the API automatically
|
|
3320
|
+
* - Parses responses internally (no user-side parsing needed)
|
|
3321
|
+
* - Renders any of the 7 premium dropdown variants
|
|
3322
|
+
* - Handles analytics tracking
|
|
3323
|
+
* - Supports recent searches via localStorage
|
|
3324
|
+
* - Fully responsive and mobile-ready
|
|
3325
|
+
*
|
|
3326
|
+
* Usage:
|
|
3327
|
+
* ```tsx
|
|
3328
|
+
* <SuggestionSearchBar
|
|
3329
|
+
* client={seekoraClient}
|
|
3330
|
+
* variant="amazon"
|
|
3331
|
+
* onSearch={(query) => router.push(`/search?q=${query}`)}
|
|
3332
|
+
* />
|
|
3333
|
+
* ```
|
|
3334
|
+
*/
|
|
3335
|
+
|
|
3336
|
+
interface SuggestionSearchBarProps {
|
|
3337
|
+
/** Seekora client instance - REQUIRED */
|
|
3338
|
+
client: SeekoraClient;
|
|
3339
|
+
/** Dropdown variant to use */
|
|
3340
|
+
variant?: SuggestionDropdownVariant$1;
|
|
3341
|
+
/** Auto-select mobile variant on small screens */
|
|
3342
|
+
autoMobileVariant?: boolean;
|
|
3343
|
+
/** Placeholder text */
|
|
3344
|
+
placeholder?: string;
|
|
3345
|
+
/** Initial/default query */
|
|
3346
|
+
defaultQuery?: string;
|
|
3347
|
+
/** Controlled query value */
|
|
3348
|
+
value?: string;
|
|
3349
|
+
/** Min characters before fetching */
|
|
3350
|
+
minQueryLength?: number;
|
|
3351
|
+
/** Max suggestions to fetch */
|
|
3352
|
+
maxSuggestions?: number;
|
|
3353
|
+
/** Debounce delay in ms */
|
|
3354
|
+
debounceMs?: number;
|
|
3355
|
+
/** Include dropdown recommendations (products, tabs, trending) */
|
|
3356
|
+
includeDropdownRecommendations?: boolean;
|
|
3357
|
+
/** When false, omit product hits list from dropdown (default true) */
|
|
3358
|
+
includeDropdownProductList?: boolean;
|
|
3359
|
+
/** When false, omit filtered_tabs from dropdown (default true) */
|
|
3360
|
+
includeFilteredTabs?: boolean;
|
|
3361
|
+
/** Include categories per suggestion */
|
|
3362
|
+
includeCategories?: boolean;
|
|
3363
|
+
/** Filtered tabs configuration */
|
|
3364
|
+
filteredTabs?: Array<{
|
|
3365
|
+
id?: string;
|
|
3366
|
+
label: string;
|
|
3367
|
+
filter: string;
|
|
3368
|
+
}>;
|
|
3369
|
+
/** Analytics tags */
|
|
3370
|
+
analyticsTags?: string[];
|
|
3371
|
+
/** Enable recent searches */
|
|
3372
|
+
enableRecentSearches?: boolean;
|
|
3373
|
+
/** Max recent searches to store */
|
|
3374
|
+
maxRecentSearches?: number;
|
|
3375
|
+
/** Show products in dropdown */
|
|
3376
|
+
showProducts?: boolean;
|
|
3377
|
+
/** Show trending when empty */
|
|
3378
|
+
showTrendingOnEmpty?: boolean;
|
|
3379
|
+
/** Enable analytics tracking */
|
|
3380
|
+
enableAnalytics?: boolean;
|
|
3381
|
+
/** Analytics configuration */
|
|
3382
|
+
analyticsConfig?: AnalyticsConfig;
|
|
3383
|
+
/** Map suggestion fields to your data */
|
|
3384
|
+
suggestionFields?: SuggestionFieldMapping;
|
|
3385
|
+
/** Map product fields to your data */
|
|
3386
|
+
productFields?: ProductFieldMapping;
|
|
3387
|
+
/** Theme configuration */
|
|
3388
|
+
theme?: DropdownThemeConfig;
|
|
3389
|
+
/** Called when search is submitted */
|
|
3390
|
+
onSearch?: (query: string) => void;
|
|
3391
|
+
/** Called when query changes */
|
|
3392
|
+
onQueryChange?: (query: string) => void;
|
|
3393
|
+
/** Called when a suggestion is selected */
|
|
3394
|
+
onSuggestionSelect?: (suggestion: any, index: number) => void;
|
|
3395
|
+
/** Called when a product is clicked */
|
|
3396
|
+
onProductClick?: (product: any, index: number) => void;
|
|
3397
|
+
/** Called when a category/tab is clicked */
|
|
3398
|
+
onCategoryClick?: (category: any, index: number) => void;
|
|
3399
|
+
/** Called when a tab is changed */
|
|
3400
|
+
onTabChange?: (tabId: string) => void;
|
|
3401
|
+
/** Container class name */
|
|
3402
|
+
className?: string;
|
|
3403
|
+
/** Container style */
|
|
3404
|
+
style?: React__default.CSSProperties;
|
|
3405
|
+
/** Input class name */
|
|
3406
|
+
inputClassName?: string;
|
|
3407
|
+
/** Dropdown width */
|
|
3408
|
+
dropdownWidth?: string | number;
|
|
3409
|
+
/** Dropdown max height */
|
|
3410
|
+
dropdownMaxHeight?: string | number;
|
|
3411
|
+
/** Z-index for dropdown */
|
|
3412
|
+
zIndex?: number;
|
|
3413
|
+
/** Enable caching for suggestions (reduces API calls) */
|
|
3414
|
+
enableCache?: boolean;
|
|
3415
|
+
/** Cache TTL in milliseconds (default: 30000 = 30 seconds) */
|
|
3416
|
+
cacheTtlMs?: number;
|
|
3417
|
+
/** Maximum cache entries (default: 100) */
|
|
3418
|
+
cacheMaxSize?: number;
|
|
3419
|
+
}
|
|
3420
|
+
interface SuggestionSearchBarRef {
|
|
3421
|
+
focus: () => void;
|
|
3422
|
+
blur: () => void;
|
|
3423
|
+
clear: () => void;
|
|
3424
|
+
getQuery: () => string;
|
|
3425
|
+
setQuery: (query: string) => void;
|
|
3426
|
+
openDropdown: () => void;
|
|
3427
|
+
closeDropdown: () => void;
|
|
3428
|
+
refresh: () => void;
|
|
3429
|
+
/** Clear the suggestions cache */
|
|
3430
|
+
clearCache: () => void;
|
|
3431
|
+
/** Get cache statistics */
|
|
3432
|
+
getCacheStats: () => {
|
|
3433
|
+
size: number;
|
|
3434
|
+
maxSize: number;
|
|
3435
|
+
} | null;
|
|
3436
|
+
}
|
|
3437
|
+
declare const SuggestionSearchBar: React__default.ForwardRefExoticComponent<SuggestionSearchBarProps & React__default.RefAttributes<SuggestionSearchBarRef>>;
|
|
3438
|
+
|
|
3439
|
+
/**
|
|
3440
|
+
* Utility functions for Query Suggestions components
|
|
3441
|
+
*/
|
|
3442
|
+
|
|
3443
|
+
/**
|
|
3444
|
+
* Extract suggestion fields from raw data
|
|
3445
|
+
*/
|
|
3446
|
+
declare const extractSuggestion: (item: any, mapping?: SuggestionFieldMapping) => {
|
|
3447
|
+
query: any;
|
|
3448
|
+
count: any;
|
|
3449
|
+
id: any;
|
|
3450
|
+
categories: any;
|
|
3451
|
+
highlighted: any;
|
|
3452
|
+
_raw: any;
|
|
3453
|
+
};
|
|
3454
|
+
/**
|
|
3455
|
+
* Extract product fields from raw data
|
|
3456
|
+
*/
|
|
3457
|
+
declare const extractProduct: (item: any, mapping?: ProductFieldMapping) => {
|
|
3458
|
+
id: any;
|
|
3459
|
+
title: any;
|
|
3460
|
+
image: any;
|
|
3461
|
+
price: any;
|
|
3462
|
+
comparePrice: any;
|
|
3463
|
+
url: any;
|
|
3464
|
+
brand: any;
|
|
3465
|
+
category: any;
|
|
3466
|
+
rating: any;
|
|
3467
|
+
reviewCount: any;
|
|
3468
|
+
discount: any;
|
|
3469
|
+
inStock: any;
|
|
3470
|
+
currency: any;
|
|
3471
|
+
images: any;
|
|
3472
|
+
originalPrice: any;
|
|
3473
|
+
available: any;
|
|
3474
|
+
options: any;
|
|
3475
|
+
variants: any;
|
|
3476
|
+
tags: any;
|
|
3477
|
+
_raw: any;
|
|
3478
|
+
};
|
|
3479
|
+
/**
|
|
3480
|
+
* Extract category fields from raw data
|
|
3481
|
+
*/
|
|
3482
|
+
declare const extractCategory: (item: any, mapping?: CategoryFieldMapping) => {
|
|
3483
|
+
id: any;
|
|
3484
|
+
label: any;
|
|
3485
|
+
count: any;
|
|
3486
|
+
icon: any;
|
|
3487
|
+
image: any;
|
|
3488
|
+
_raw: any;
|
|
3489
|
+
};
|
|
3490
|
+
/**
|
|
3491
|
+
* Extract brand fields from raw data
|
|
3492
|
+
*/
|
|
3493
|
+
declare const extractBrand: (item: any, mapping?: BrandFieldMapping) => {
|
|
3494
|
+
id: any;
|
|
3495
|
+
name: any;
|
|
3496
|
+
logo: any;
|
|
3497
|
+
count: any;
|
|
3498
|
+
_raw: any;
|
|
3499
|
+
};
|
|
3500
|
+
/**
|
|
3501
|
+
* Format price with currency
|
|
3502
|
+
*/
|
|
3503
|
+
declare const formatPrice: (value: number | string | undefined, config?: Pick<ProductDisplayConfig, "currency" | "currencyPosition" | "priceDecimals">) => string;
|
|
3504
|
+
/**
|
|
3505
|
+
* Highlight matching text in a string
|
|
3506
|
+
*/
|
|
3507
|
+
declare const highlightText: (text: string, query: string, options?: {
|
|
3508
|
+
tag?: string;
|
|
3509
|
+
className?: string;
|
|
3510
|
+
style?: CSSProperties;
|
|
3511
|
+
}) => string;
|
|
3512
|
+
/**
|
|
3513
|
+
* Extract badges from product tags (Shopify convention: "badge:new", "badge:limited")
|
|
3514
|
+
* and auto-generate sale/soldOut badges from product data.
|
|
3515
|
+
*/
|
|
3516
|
+
declare const extractBadges: (tags?: string[], product?: {
|
|
3517
|
+
price?: number;
|
|
3518
|
+
original_price?: number;
|
|
3519
|
+
compare_at_price?: number;
|
|
3520
|
+
available?: boolean;
|
|
3521
|
+
}) => ProductBadge[];
|
|
3522
|
+
/**
|
|
3523
|
+
* Compute min/max price from variants. Returns null if all variants have the same price.
|
|
3524
|
+
*/
|
|
3525
|
+
declare const getPriceRange: (variants?: ProductVariant[]) => PriceRange | null;
|
|
3526
|
+
/**
|
|
3527
|
+
* Format a price range like "$54.00 - $72.00"
|
|
3528
|
+
*/
|
|
3529
|
+
declare const formatPriceRange: (range: PriceRange, config?: Pick<ProductDisplayConfig, "currency" | "currencyPosition" | "priceDecimals">) => string;
|
|
3530
|
+
/**
|
|
3531
|
+
* Given current selections, return which values for an option are still available
|
|
3532
|
+
* based on variant availability.
|
|
3533
|
+
*/
|
|
3534
|
+
declare const getAvailableValuesForOption: (optionName: string, options: ProductOption[], variants: ProductVariant[], selections: Record<string, string>) => {
|
|
3535
|
+
value: string;
|
|
3536
|
+
available: boolean;
|
|
3537
|
+
}[];
|
|
3538
|
+
/**
|
|
3539
|
+
* Find the exact variant matching all selected options.
|
|
3540
|
+
*/
|
|
3541
|
+
declare const findVariantBySelections: (options: ProductOption[], variants: ProductVariant[], selections: Record<string, string>) => ProductVariant | null;
|
|
3542
|
+
declare const getRecentSearches: (storeId?: string) => string[];
|
|
3543
|
+
declare const addRecentSearch: (query: string, storeId?: string) => string[];
|
|
3544
|
+
declare const removeRecentSearch: (query: string, storeId?: string) => string[];
|
|
3545
|
+
declare const clearRecentSearches: (storeId?: string) => void;
|
|
3546
|
+
/**
|
|
3547
|
+
* Simple in-memory cache with TTL support for suggestions
|
|
3548
|
+
* Reduces API calls by caching results for quick repeated queries
|
|
3549
|
+
*/
|
|
3550
|
+
declare class SuggestionsCache {
|
|
3551
|
+
private cache;
|
|
3552
|
+
private maxSize;
|
|
3553
|
+
private defaultTtl;
|
|
3554
|
+
constructor(options?: {
|
|
3555
|
+
maxSize?: number;
|
|
3556
|
+
defaultTtlMs?: number;
|
|
3557
|
+
});
|
|
3558
|
+
/**
|
|
3559
|
+
* Generate a cache key from query and options
|
|
3560
|
+
*/
|
|
3561
|
+
generateKey(query: string, options?: Record<string, any>): string;
|
|
3562
|
+
/**
|
|
3563
|
+
* Get cached data if valid (not expired)
|
|
3564
|
+
*/
|
|
3565
|
+
get<T>(key: string): T | null;
|
|
3566
|
+
/**
|
|
3567
|
+
* Store data in cache
|
|
3568
|
+
*/
|
|
3569
|
+
set<T>(key: string, data: T, ttlMs?: number): void;
|
|
3570
|
+
/**
|
|
3571
|
+
* Check if key exists and is valid
|
|
3572
|
+
*/
|
|
3573
|
+
has(key: string): boolean;
|
|
3574
|
+
/**
|
|
3575
|
+
* Clear all cached entries
|
|
3576
|
+
*/
|
|
3577
|
+
clear(): void;
|
|
3578
|
+
/**
|
|
3579
|
+
* Clear expired entries
|
|
3580
|
+
*/
|
|
3581
|
+
cleanup(): void;
|
|
3582
|
+
/**
|
|
3583
|
+
* Get cache statistics
|
|
3584
|
+
*/
|
|
3585
|
+
getStats(): {
|
|
3586
|
+
size: number;
|
|
3587
|
+
maxSize: number;
|
|
3588
|
+
};
|
|
3589
|
+
}
|
|
3590
|
+
/**
|
|
3591
|
+
* Get the global suggestions cache instance
|
|
3592
|
+
*/
|
|
3593
|
+
declare const getSuggestionsCache: (options?: {
|
|
3594
|
+
maxSize?: number;
|
|
3595
|
+
defaultTtlMs?: number;
|
|
3596
|
+
}) => SuggestionsCache;
|
|
3597
|
+
/**
|
|
3598
|
+
* Create a new cache instance (for isolated caching per component)
|
|
3599
|
+
*/
|
|
3600
|
+
declare const createSuggestionsCache: (options?: {
|
|
3601
|
+
maxSize?: number;
|
|
3602
|
+
defaultTtlMs?: number;
|
|
3603
|
+
}) => SuggestionsCache;
|
|
3604
|
+
/**
|
|
3605
|
+
* Clear the global cache
|
|
3606
|
+
*/
|
|
3607
|
+
declare const clearSuggestionsCache: () => void;
|
|
3608
|
+
|
|
3609
|
+
/**
|
|
3610
|
+
* Responsive Utilities and Breakpoints
|
|
3611
|
+
*
|
|
3612
|
+
* Shared responsive design utilities for all dropdown components
|
|
3613
|
+
*/
|
|
3614
|
+
|
|
3615
|
+
declare const breakpoints: {
|
|
3616
|
+
readonly xs: 0;
|
|
3617
|
+
readonly sm: 480;
|
|
3618
|
+
readonly md: 768;
|
|
3619
|
+
readonly lg: 1024;
|
|
3620
|
+
readonly xl: 1280;
|
|
3621
|
+
};
|
|
3622
|
+
type Breakpoint = keyof typeof breakpoints;
|
|
3623
|
+
declare const mediaQueries: {
|
|
3624
|
+
readonly xs: `@media (max-width: ${number}px)`;
|
|
3625
|
+
readonly sm: `@media (min-width: 480px) and (max-width: ${number}px)`;
|
|
3626
|
+
readonly md: `@media (min-width: 768px) and (max-width: ${number}px)`;
|
|
3627
|
+
readonly lg: `@media (min-width: 1024px) and (max-width: ${number}px)`;
|
|
3628
|
+
readonly xl: "@media (min-width: 1280px)";
|
|
3629
|
+
readonly mobile: `@media (max-width: ${number}px)`;
|
|
3630
|
+
readonly tablet: `@media (min-width: 768px) and (max-width: ${number}px)`;
|
|
3631
|
+
readonly desktop: "@media (min-width: 1024px)";
|
|
3632
|
+
readonly touch: "@media (hover: none) and (pointer: coarse)";
|
|
3633
|
+
readonly mouse: "@media (hover: hover) and (pointer: fine)";
|
|
3634
|
+
};
|
|
3635
|
+
declare const touchTargets: {
|
|
3636
|
+
/** Minimum touch target size per WCAG guidelines */
|
|
3637
|
+
readonly minimum: 44;
|
|
3638
|
+
/** Comfortable touch target size */
|
|
3639
|
+
readonly comfortable: 48;
|
|
3640
|
+
/** Large touch target for primary actions */
|
|
3641
|
+
readonly large: 56;
|
|
3642
|
+
};
|
|
3643
|
+
interface ResponsiveState {
|
|
3644
|
+
isMobile: boolean;
|
|
3645
|
+
isTablet: boolean;
|
|
3646
|
+
isDesktop: boolean;
|
|
3647
|
+
isTouch: boolean;
|
|
3648
|
+
width: number;
|
|
3649
|
+
height: number;
|
|
3650
|
+
breakpoint: Breakpoint;
|
|
3651
|
+
}
|
|
3652
|
+
declare const useResponsive: () => ResponsiveState;
|
|
3653
|
+
|
|
3654
|
+
/**
|
|
3655
|
+
* Shared Styles Index
|
|
3656
|
+
*/
|
|
3657
|
+
|
|
3658
|
+
declare const injectGlobalResponsiveStyles: () => void;
|
|
3659
|
+
/**
|
|
3660
|
+
* Hook to auto-inject styles on mount
|
|
3661
|
+
*/
|
|
3662
|
+
declare const useInjectResponsiveStyles: () => void;
|
|
3663
|
+
|
|
3664
|
+
declare const SuggestionDropdownVariants: {
|
|
3665
|
+
readonly amazon: React$1.ForwardRefExoticComponent<AmazonDropdownProps & React$1.RefAttributes<DropdownRef>>;
|
|
3666
|
+
readonly google: React$1.ForwardRefExoticComponent<GoogleDropdownProps & React$1.RefAttributes<DropdownRef>>;
|
|
3667
|
+
readonly pinterest: React$1.ForwardRefExoticComponent<PinterestDropdownProps & React$1.RefAttributes<DropdownRef>>;
|
|
3668
|
+
readonly spotlight: React$1.ForwardRefExoticComponent<SpotlightDropdownProps & React$1.RefAttributes<DropdownRef>>;
|
|
3669
|
+
readonly shopify: React$1.ForwardRefExoticComponent<ShopifyDropdownProps & React$1.RefAttributes<DropdownRef>>;
|
|
3670
|
+
readonly 'mobile-sheet': React$1.ForwardRefExoticComponent<MobileSheetDropdownProps & React$1.RefAttributes<DropdownRef>>;
|
|
3671
|
+
readonly minimal: React$1.ForwardRefExoticComponent<MinimalDropdownProps & React$1.RefAttributes<DropdownRef>>;
|
|
3672
|
+
};
|
|
3673
|
+
type SuggestionDropdownVariant = keyof typeof SuggestionDropdownVariants;
|
|
3674
|
+
|
|
3675
|
+
/**
|
|
3676
|
+
* Seekora DocSearch Types
|
|
3677
|
+
*/
|
|
3678
|
+
|
|
3679
|
+
interface DocSearchHit {
|
|
3680
|
+
objectID: string;
|
|
3681
|
+
url: string;
|
|
3682
|
+
anchor?: string;
|
|
3683
|
+
title: string;
|
|
3684
|
+
content: string;
|
|
3685
|
+
section_level: number;
|
|
3686
|
+
hierarchy: {
|
|
3687
|
+
lvl0?: string;
|
|
3688
|
+
lvl1?: string;
|
|
3689
|
+
lvl2?: string;
|
|
3690
|
+
lvl3?: string;
|
|
3691
|
+
lvl4?: string;
|
|
3692
|
+
lvl5?: string;
|
|
3693
|
+
};
|
|
3694
|
+
_highlightResult?: {
|
|
3695
|
+
title?: {
|
|
3696
|
+
value: string;
|
|
3697
|
+
matchLevel: string;
|
|
3698
|
+
};
|
|
3699
|
+
content?: {
|
|
3700
|
+
value: string;
|
|
3701
|
+
matchLevel: string;
|
|
3702
|
+
};
|
|
3703
|
+
hierarchy?: {
|
|
3704
|
+
lvl0?: {
|
|
3705
|
+
value: string;
|
|
3706
|
+
matchLevel: string;
|
|
3707
|
+
};
|
|
3708
|
+
lvl1?: {
|
|
3709
|
+
value: string;
|
|
3710
|
+
matchLevel: string;
|
|
3711
|
+
};
|
|
3712
|
+
lvl2?: {
|
|
3713
|
+
value: string;
|
|
3714
|
+
matchLevel: string;
|
|
3715
|
+
};
|
|
3716
|
+
lvl3?: {
|
|
3717
|
+
value: string;
|
|
3718
|
+
matchLevel: string;
|
|
3719
|
+
};
|
|
3720
|
+
};
|
|
3721
|
+
};
|
|
3722
|
+
_source?: string;
|
|
3723
|
+
}
|
|
3724
|
+
interface DocSearchSuggestion {
|
|
3725
|
+
url: string;
|
|
3726
|
+
title: string;
|
|
3727
|
+
content?: string;
|
|
3728
|
+
description?: string;
|
|
3729
|
+
category?: string;
|
|
3730
|
+
hierarchy?: {
|
|
3731
|
+
lvl0?: string;
|
|
3732
|
+
lvl1?: string;
|
|
3733
|
+
lvl2?: string;
|
|
3734
|
+
lvl3?: string;
|
|
3735
|
+
lvl4?: string;
|
|
3736
|
+
lvl5?: string;
|
|
3737
|
+
};
|
|
3738
|
+
highlight?: {
|
|
3739
|
+
title?: string;
|
|
3740
|
+
content?: string;
|
|
3741
|
+
};
|
|
3742
|
+
_source?: string;
|
|
3743
|
+
route?: string;
|
|
3744
|
+
parentTitle?: string;
|
|
3745
|
+
type?: string;
|
|
3746
|
+
anchor?: string;
|
|
3747
|
+
}
|
|
3748
|
+
interface SearchSource {
|
|
3749
|
+
id: string;
|
|
3750
|
+
name: string;
|
|
3751
|
+
endpoint: string;
|
|
3752
|
+
apiKey?: string;
|
|
3753
|
+
storeId?: string;
|
|
3754
|
+
storeSecret?: string;
|
|
3755
|
+
maxResults?: number;
|
|
3756
|
+
minQueryLength?: number;
|
|
3757
|
+
transformResults?: (data: any) => DocSearchSuggestion[];
|
|
3758
|
+
openInNewTab?: boolean;
|
|
3759
|
+
icon?: string;
|
|
3760
|
+
}
|
|
3761
|
+
interface DocSearchResponse {
|
|
3762
|
+
hits: DocSearchHit[];
|
|
3763
|
+
query: string;
|
|
3764
|
+
total?: number;
|
|
3765
|
+
page?: number;
|
|
3766
|
+
nbPages?: number;
|
|
3767
|
+
}
|
|
3768
|
+
interface DocSearchSuggestionsResponse {
|
|
3769
|
+
suggestions: DocSearchSuggestion[];
|
|
3770
|
+
query: string;
|
|
3771
|
+
}
|
|
3772
|
+
interface DocSearchProps {
|
|
3773
|
+
storeId?: string;
|
|
3774
|
+
storeSecret?: string;
|
|
3775
|
+
seekoraApiEndpoint?: string;
|
|
3776
|
+
apiEndpoint?: string;
|
|
3777
|
+
apiKey?: string;
|
|
3778
|
+
sources?: SearchSource[];
|
|
3779
|
+
indexName?: string;
|
|
3780
|
+
placeholder?: string;
|
|
3781
|
+
maxResults?: number;
|
|
3782
|
+
debounceMs?: number;
|
|
3783
|
+
onSelect?: (hit: DocSearchHit | DocSearchSuggestion) => void;
|
|
3784
|
+
onClose?: () => void;
|
|
3785
|
+
translations?: DocSearchTranslations;
|
|
3786
|
+
renderButton?: boolean;
|
|
3787
|
+
buttonComponent?: React__default.ComponentType<DocSearchButtonProps>;
|
|
3788
|
+
initialOpen?: boolean;
|
|
3789
|
+
disableShortcut?: boolean;
|
|
3790
|
+
shortcutKey?: string;
|
|
3791
|
+
/** Post-process results per source (e.g. filter by permission, resolve :storeId). */
|
|
3792
|
+
processGroupedResults?: (sourceId: string, items: DocSearchSuggestion[]) => DocSearchSuggestion[];
|
|
3793
|
+
/** Additional CSS class applied to the modal overlay and container — use to scope CSS variable overrides. */
|
|
3794
|
+
className?: string;
|
|
3795
|
+
}
|
|
3796
|
+
interface DocSearchButtonProps {
|
|
3797
|
+
onClick: () => void;
|
|
3798
|
+
placeholder?: string;
|
|
3799
|
+
/** Additional CSS class for the button element. */
|
|
3800
|
+
className?: string;
|
|
3801
|
+
}
|
|
3802
|
+
interface DocSearchTranslations {
|
|
3803
|
+
buttonText?: string;
|
|
3804
|
+
buttonAriaLabel?: string;
|
|
3805
|
+
searchPlaceholder?: string;
|
|
3806
|
+
noResultsText?: string;
|
|
3807
|
+
errorText?: string;
|
|
3808
|
+
footerText?: string;
|
|
3809
|
+
closeText?: string;
|
|
3810
|
+
searchByText?: string;
|
|
3811
|
+
}
|
|
3812
|
+
interface DocSearchState {
|
|
3813
|
+
query: string;
|
|
3814
|
+
results: DocSearchHit[];
|
|
3815
|
+
suggestions: DocSearchSuggestion[];
|
|
3816
|
+
isLoading: boolean;
|
|
3817
|
+
error: string | null;
|
|
3818
|
+
selectedIndex: number;
|
|
3819
|
+
mode: "suggestions" | "results";
|
|
3820
|
+
}
|
|
3821
|
+
type DocSearchAction = {
|
|
3822
|
+
type: "SET_QUERY";
|
|
3823
|
+
payload: string;
|
|
3824
|
+
} | {
|
|
3825
|
+
type: "SET_RESULTS";
|
|
3826
|
+
payload: DocSearchHit[];
|
|
3827
|
+
} | {
|
|
3828
|
+
type: "SET_SUGGESTIONS";
|
|
3829
|
+
payload: DocSearchSuggestion[];
|
|
3830
|
+
} | {
|
|
3831
|
+
type: "SET_LOADING";
|
|
3832
|
+
payload: boolean;
|
|
3833
|
+
} | {
|
|
3834
|
+
type: "SET_ERROR";
|
|
3835
|
+
payload: string | null;
|
|
3836
|
+
} | {
|
|
3837
|
+
type: "SET_SELECTED_INDEX";
|
|
3838
|
+
payload: number;
|
|
3839
|
+
} | {
|
|
3840
|
+
type: "SELECT_NEXT";
|
|
3841
|
+
} | {
|
|
3842
|
+
type: "SELECT_PREV";
|
|
3843
|
+
} | {
|
|
3844
|
+
type: "SET_MODE";
|
|
3845
|
+
payload: "suggestions" | "results";
|
|
3846
|
+
} | {
|
|
3847
|
+
type: "RESET";
|
|
3848
|
+
};
|
|
3849
|
+
|
|
3850
|
+
declare function DocSearch({ storeId, storeSecret, seekoraApiEndpoint, apiEndpoint, apiKey, sources, placeholder, maxResults, debounceMs, onSelect, onClose, translations, renderButton, buttonComponent: ButtonComponent, initialOpen, disableShortcut, shortcutKey, processGroupedResults, className, }: DocSearchProps): React__default.JSX.Element;
|
|
3851
|
+
|
|
3852
|
+
declare function DocSearchButton({ onClick, placeholder, className, }: DocSearchButtonProps): React__default.JSX.Element;
|
|
3853
|
+
|
|
3854
|
+
interface UseDocSearchOptions {
|
|
3855
|
+
apiEndpoint?: string;
|
|
3856
|
+
apiKey?: string;
|
|
3857
|
+
sources?: SearchSource[];
|
|
3858
|
+
maxResults?: number;
|
|
3859
|
+
debounceMs?: number;
|
|
3860
|
+
processGroupedResults?: (sourceId: string, items: DocSearchSuggestion[]) => DocSearchSuggestion[];
|
|
3861
|
+
}
|
|
3862
|
+
declare function useDocSearch(options: UseDocSearchOptions): {
|
|
3863
|
+
sources: SearchSource[];
|
|
3864
|
+
setQuery: (query: string) => void;
|
|
3865
|
+
search: (q: string) => Promise<void>;
|
|
3866
|
+
fetchSuggestions: (query: string) => Promise<void>;
|
|
3867
|
+
selectNext: () => void;
|
|
3868
|
+
selectPrev: () => void;
|
|
3869
|
+
setSelectedIndex: (index: number) => void;
|
|
3870
|
+
reset: () => void;
|
|
3871
|
+
getSelectedItem: () => DocSearchHit | DocSearchSuggestion | null;
|
|
3872
|
+
groupedSuggestions: {
|
|
3873
|
+
source: SearchSource;
|
|
3874
|
+
items: DocSearchSuggestion[];
|
|
3875
|
+
}[];
|
|
3876
|
+
query: string;
|
|
3877
|
+
results: DocSearchHit[];
|
|
3878
|
+
suggestions: DocSearchSuggestion[];
|
|
3879
|
+
isLoading: boolean;
|
|
3880
|
+
error: string | null;
|
|
3881
|
+
selectedIndex: number;
|
|
3882
|
+
mode: "suggestions" | "results";
|
|
3883
|
+
};
|
|
3884
|
+
|
|
3885
|
+
interface UseSeekoraSearchOptions$1 {
|
|
3886
|
+
storeId: string;
|
|
3887
|
+
storeSecret?: string;
|
|
3888
|
+
apiEndpoint?: string;
|
|
3889
|
+
maxResults?: number;
|
|
3890
|
+
debounceMs?: number;
|
|
3891
|
+
analyticsTags?: string[];
|
|
3892
|
+
groupField?: string;
|
|
3893
|
+
groupSize?: number;
|
|
3894
|
+
}
|
|
3895
|
+
interface UseSeekoraSearchResult {
|
|
3896
|
+
query: string;
|
|
3897
|
+
suggestions: DocSearchSuggestion[];
|
|
3898
|
+
isLoading: boolean;
|
|
3899
|
+
error: string | null;
|
|
3900
|
+
selectedIndex: number;
|
|
3901
|
+
setQuery: (query: string) => void;
|
|
3902
|
+
selectNext: () => void;
|
|
3903
|
+
selectPrev: () => void;
|
|
3904
|
+
setSelectedIndex: (index: number) => void;
|
|
3905
|
+
reset: () => void;
|
|
3906
|
+
getSelectedItem: () => DocSearchSuggestion | null;
|
|
3907
|
+
trackDocClick: (hit: DocSearchSuggestion, position: number) => void | Promise<void>;
|
|
3908
|
+
}
|
|
3909
|
+
declare function useSeekoraSearch$1(options: UseSeekoraSearchOptions$1): UseSeekoraSearchResult;
|
|
3910
|
+
|
|
3911
|
+
interface UseKeyboardOptions {
|
|
3912
|
+
isOpen: boolean;
|
|
3913
|
+
onOpen: () => void;
|
|
3914
|
+
onClose: () => void;
|
|
3915
|
+
onSelectNext: () => void;
|
|
3916
|
+
onSelectPrev: () => void;
|
|
3917
|
+
onEnter: () => void;
|
|
3918
|
+
disableShortcut?: boolean;
|
|
3919
|
+
shortcutKey?: string;
|
|
3920
|
+
}
|
|
3921
|
+
declare function useKeyboard(options: UseKeyboardOptions): {
|
|
3922
|
+
handleModalKeyDown: (event: KeyboardEvent | React__default.KeyboardEvent) => void;
|
|
3923
|
+
};
|
|
3924
|
+
declare function getShortcutText(key?: string): string;
|
|
3925
|
+
|
|
3926
|
+
/**
|
|
3927
|
+
* useSeekoraSearch Hook
|
|
3928
|
+
*
|
|
3929
|
+
* Hook for performing searches with the Seekora SDK
|
|
3930
|
+
*/
|
|
3931
|
+
|
|
3932
|
+
interface UseSeekoraSearchOptions {
|
|
3933
|
+
client: SeekoraClient;
|
|
3934
|
+
autoTrack?: boolean;
|
|
3935
|
+
}
|
|
3936
|
+
interface UseSeekoraSearchReturn {
|
|
3937
|
+
search: (options: SearchOptions) => Promise<SearchResponse | null>;
|
|
3938
|
+
results: SearchResponse | null;
|
|
3939
|
+
loading: boolean;
|
|
3940
|
+
error: Error | null;
|
|
3941
|
+
context: SearchContext | null;
|
|
3942
|
+
clearResults: () => void;
|
|
3943
|
+
}
|
|
3944
|
+
declare const useSeekoraSearch: ({ client, autoTrack, }: UseSeekoraSearchOptions) => UseSeekoraSearchReturn;
|
|
3945
|
+
|
|
3946
|
+
/**
|
|
3947
|
+
* Common types for Seekora UI SDK
|
|
3948
|
+
*/
|
|
3949
|
+
|
|
3950
|
+
interface SuggestionItem {
|
|
3951
|
+
query: string;
|
|
3952
|
+
count?: number;
|
|
3953
|
+
metadata?: Record<string, any>;
|
|
3954
|
+
}
|
|
3955
|
+
|
|
3956
|
+
/**
|
|
3957
|
+
* useQuerySuggestions Hook
|
|
3958
|
+
*
|
|
3959
|
+
* Hook for fetching query suggestions with debouncing
|
|
3960
|
+
*/
|
|
3961
|
+
|
|
3962
|
+
interface UseQuerySuggestionsOptions {
|
|
3963
|
+
client: SeekoraClient;
|
|
3964
|
+
query: string;
|
|
3965
|
+
enabled?: boolean;
|
|
3966
|
+
debounceMs?: number;
|
|
3967
|
+
maxSuggestions?: number;
|
|
3968
|
+
}
|
|
3969
|
+
interface UseQuerySuggestionsReturn {
|
|
3970
|
+
suggestions: SuggestionItem[];
|
|
3971
|
+
loading: boolean;
|
|
3972
|
+
error: Error | null;
|
|
3973
|
+
}
|
|
3974
|
+
declare const useQuerySuggestions: ({ client, query, enabled, debounceMs, maxSuggestions, }: UseQuerySuggestionsOptions) => UseQuerySuggestionsReturn;
|
|
3975
|
+
|
|
3976
|
+
/**
|
|
3977
|
+
* Suggestions Analytics Hook
|
|
3978
|
+
*
|
|
3979
|
+
* Provides analytics tracking for query suggestions components using
|
|
3980
|
+
* Analytics V3 event structure and schema/fields (event_name, event_ts,
|
|
3981
|
+
* correlation_id/search_id via context, and V3 top-level fields such as
|
|
3982
|
+
* original_query, position, section, clicked_item_id, click_type, tab_id,
|
|
3983
|
+
* suggestions_count, etc.). All events are sent via client.trackEvent(payload, context)
|
|
3984
|
+
* so the SDK can attach correlation_id, search_id, event_ts, orgcode, xstoreid.
|
|
3985
|
+
*/
|
|
3986
|
+
|
|
3987
|
+
interface UseSuggestionsAnalyticsOptions {
|
|
3988
|
+
/** Seekora client instance */
|
|
3989
|
+
client: SeekoraClient;
|
|
3990
|
+
/** Enable analytics tracking */
|
|
3991
|
+
enabled?: boolean;
|
|
3992
|
+
/** Analytics tags to include with all events */
|
|
3993
|
+
analyticsTags?: string[];
|
|
3994
|
+
/** Debounce impression events (ms) */
|
|
3995
|
+
impressionDebounce?: number;
|
|
3996
|
+
/** Track suggestion impressions automatically */
|
|
3997
|
+
trackImpressions?: boolean;
|
|
3998
|
+
/** Track clicks automatically */
|
|
3999
|
+
trackClicks?: boolean;
|
|
4000
|
+
/** Optional search context (correlationId, searchId) to attach to events when available */
|
|
4001
|
+
context?: SearchContext | Partial<SearchContext>;
|
|
4002
|
+
}
|
|
4003
|
+
interface SuggestionClickEventData {
|
|
4004
|
+
/** The clicked suggestion */
|
|
4005
|
+
suggestion: SuggestionItem$3;
|
|
4006
|
+
/** Position in the list (0-indexed) */
|
|
4007
|
+
position: number;
|
|
4008
|
+
/** Section where the suggestion appeared */
|
|
4009
|
+
section?: 'suggestions' | 'trending' | 'recent' | 'related';
|
|
4010
|
+
/** Original query that triggered suggestions */
|
|
4011
|
+
query?: string;
|
|
4012
|
+
/** Total suggestions shown */
|
|
4013
|
+
totalSuggestions?: number;
|
|
4014
|
+
}
|
|
4015
|
+
interface ProductClickEventData {
|
|
4016
|
+
/** The clicked product */
|
|
4017
|
+
product: ProductItem;
|
|
4018
|
+
/** Position in the list (0-indexed) */
|
|
4019
|
+
position: number;
|
|
4020
|
+
/** Section where the product appeared */
|
|
4021
|
+
section?: 'products' | 'trending' | 'recommendations' | 'filtered_tab';
|
|
4022
|
+
/** Tab ID if from filtered tab */
|
|
4023
|
+
tabId?: string;
|
|
4024
|
+
/** Original query */
|
|
4025
|
+
query?: string;
|
|
4026
|
+
}
|
|
4027
|
+
interface SuggestionImpressionEventData {
|
|
4028
|
+
/** Suggestions that were shown */
|
|
4029
|
+
suggestions: SuggestionItem$3[];
|
|
4030
|
+
/** Products that were shown */
|
|
4031
|
+
products?: ProductItem[];
|
|
4032
|
+
/** Categories that were shown */
|
|
4033
|
+
categories?: SuggestionCategory[];
|
|
4034
|
+
/** Brands that were shown */
|
|
4035
|
+
brands?: PopularBrand[];
|
|
4036
|
+
/** Original query */
|
|
4037
|
+
query: string;
|
|
4038
|
+
/** Timestamp when impressions occurred */
|
|
4039
|
+
timestamp: number;
|
|
4040
|
+
}
|
|
4041
|
+
interface UseSuggestionsAnalyticsReturn {
|
|
4042
|
+
/** Track a suggestion click */
|
|
4043
|
+
trackSuggestionClick: (data: SuggestionClickEventData) => void;
|
|
4044
|
+
/** Track a product click from suggestions dropdown */
|
|
4045
|
+
trackProductClick: (data: ProductClickEventData) => void;
|
|
4046
|
+
/** Track a category click */
|
|
4047
|
+
trackCategoryClick: (category: SuggestionCategory, query?: string) => void;
|
|
4048
|
+
/** Track a brand click */
|
|
4049
|
+
trackBrandClick: (brand: PopularBrand, query?: string) => void;
|
|
4050
|
+
/** Track a tab selection */
|
|
4051
|
+
trackTabSelect: (tab: FilteredTab, query?: string) => void;
|
|
4052
|
+
/** Track recent search click */
|
|
4053
|
+
trackRecentSearchClick: (search: RecentSearch) => void;
|
|
4054
|
+
/** Track trending search click */
|
|
4055
|
+
trackTrendingClick: (trending: TrendingSearch, position: number) => void;
|
|
4056
|
+
/** Track suggestions impression */
|
|
4057
|
+
trackImpression: (data: SuggestionImpressionEventData) => void;
|
|
4058
|
+
/** Track search submission from suggestion */
|
|
4059
|
+
trackSearchSubmit: (query: string, fromSuggestion: boolean, suggestion?: SuggestionItem$3) => void;
|
|
4060
|
+
/** Track dropdown open */
|
|
4061
|
+
trackDropdownOpen: (query: string) => void;
|
|
4062
|
+
/** Track dropdown close */
|
|
4063
|
+
trackDropdownClose: (query: string, selectedSuggestion?: string) => void;
|
|
4064
|
+
}
|
|
4065
|
+
declare function useSuggestionsAnalytics(options: UseSuggestionsAnalyticsOptions): UseSuggestionsAnalyticsReturn;
|
|
4066
|
+
|
|
4067
|
+
/**
|
|
4068
|
+
* useAnalytics Hook
|
|
4069
|
+
*
|
|
4070
|
+
* Hook for tracking analytics events with the Seekora SDK.
|
|
4071
|
+
* Supports Analytics V3 payload fields (event_ts, anonymous_id, orgcode, xstoreid);
|
|
4072
|
+
* the SDK sends both legacy and v3 fields for backend compatibility.
|
|
4073
|
+
*/
|
|
4074
|
+
|
|
4075
|
+
interface UseAnalyticsOptions {
|
|
4076
|
+
client: SeekoraClient;
|
|
4077
|
+
enabled?: boolean;
|
|
4078
|
+
}
|
|
4079
|
+
/** Payload for trackEvent/trackBatch: supports legacy and Analytics V3 field names */
|
|
4080
|
+
type AnalyticsEventPayload = Partial<DataTypesEventPayload> & Partial<ExtendedEventPayload>;
|
|
4081
|
+
interface UseAnalyticsReturn {
|
|
4082
|
+
trackEvent: (eventType: string, payload: AnalyticsEventPayload, context?: SearchContext | Partial<SearchContext>) => Promise<void>;
|
|
4083
|
+
trackClick: (resultId: string, result: any, context?: SearchContext | Partial<SearchContext>, position?: number) => Promise<void>;
|
|
4084
|
+
trackConversion: (resultId: string, result: any, value?: number, currency?: string, context?: SearchContext | Partial<SearchContext>) => Promise<void>;
|
|
4085
|
+
trackBatch: (events: (AnalyticsEventPayload & {
|
|
4086
|
+
event_name?: string;
|
|
4087
|
+
})[], context?: SearchContext) => Promise<void>;
|
|
4088
|
+
}
|
|
4089
|
+
declare const useAnalytics: ({ client, enabled, }: UseAnalyticsOptions) => UseAnalyticsReturn;
|
|
4090
|
+
|
|
4091
|
+
/**
|
|
4092
|
+
* useSearchState Hook
|
|
4093
|
+
*
|
|
4094
|
+
* React hook for accessing and managing search state via SearchStateManager
|
|
4095
|
+
* Provides reactive state and methods to update search parameters
|
|
4096
|
+
*/
|
|
4097
|
+
|
|
4098
|
+
interface UseSearchStateReturn {
|
|
4099
|
+
query: string;
|
|
4100
|
+
refinements: Array<{
|
|
4101
|
+
field: string;
|
|
4102
|
+
value: string;
|
|
4103
|
+
}>;
|
|
4104
|
+
currentPage: number;
|
|
4105
|
+
itemsPerPage: number;
|
|
4106
|
+
sortBy?: string;
|
|
4107
|
+
results: SearchState['results'];
|
|
4108
|
+
loading: boolean;
|
|
4109
|
+
error: Error | null;
|
|
4110
|
+
setQuery: (query: string, triggerSearch?: boolean) => void;
|
|
4111
|
+
addRefinement: (field: string, value: string, triggerSearch?: boolean) => void;
|
|
4112
|
+
removeRefinement: (field: string, value: string, triggerSearch?: boolean) => void;
|
|
4113
|
+
clearRefinements: (triggerSearch?: boolean) => void;
|
|
4114
|
+
setPage: (page: number, triggerSearch?: boolean) => void;
|
|
4115
|
+
setSortBy: (sortBy: string, triggerSearch?: boolean) => void;
|
|
4116
|
+
search: (additionalOptions?: Parameters<SearchStateManager['search']>[0]) => Promise<SearchResponse | null>;
|
|
4117
|
+
clear: () => void;
|
|
4118
|
+
}
|
|
4119
|
+
/**
|
|
4120
|
+
* Hook to access and manage search state
|
|
4121
|
+
* Automatically subscribes to state changes and re-renders when state updates
|
|
4122
|
+
*/
|
|
4123
|
+
declare const useSearchState: () => UseSearchStateReturn;
|
|
4124
|
+
|
|
4125
|
+
/**
|
|
4126
|
+
* useSmartSuggestions Hook
|
|
4127
|
+
*
|
|
4128
|
+
* AI-enhanced query suggestions with intent understanding
|
|
4129
|
+
* Provides context-aware suggestions based on user behavior and query patterns
|
|
4130
|
+
*/
|
|
4131
|
+
interface SmartSuggestion {
|
|
4132
|
+
text: string;
|
|
4133
|
+
type: 'query' | 'correction' | 'expansion' | 'related' | 'trending';
|
|
4134
|
+
confidence: number;
|
|
4135
|
+
metadata?: {
|
|
4136
|
+
intent?: string;
|
|
4137
|
+
category?: string;
|
|
4138
|
+
correctedFrom?: string;
|
|
4139
|
+
expandedTo?: string[];
|
|
4140
|
+
};
|
|
4141
|
+
}
|
|
4142
|
+
interface SmartSuggestionsOptions {
|
|
4143
|
+
/** Minimum query length */
|
|
4144
|
+
minQueryLength?: number;
|
|
4145
|
+
/** Maximum suggestions to return */
|
|
4146
|
+
maxSuggestions?: number;
|
|
4147
|
+
/** Debounce delay in ms */
|
|
4148
|
+
debounceMs?: number;
|
|
4149
|
+
/** Enable spell correction */
|
|
4150
|
+
enableSpellCorrection?: boolean;
|
|
4151
|
+
/** Enable query expansion */
|
|
4152
|
+
enableQueryExpansion?: boolean;
|
|
4153
|
+
/** Enable intent detection */
|
|
4154
|
+
enableIntentDetection?: boolean;
|
|
4155
|
+
/** Include trending queries when query is empty */
|
|
4156
|
+
includeTrending?: boolean;
|
|
4157
|
+
/** User context for personalization */
|
|
4158
|
+
userContext?: {
|
|
4159
|
+
recentSearches?: string[];
|
|
4160
|
+
preferences?: Record<string, any>;
|
|
4161
|
+
};
|
|
4162
|
+
}
|
|
4163
|
+
interface UseSmartSuggestionsReturn {
|
|
4164
|
+
suggestions: SmartSuggestion[];
|
|
4165
|
+
loading: boolean;
|
|
4166
|
+
error: Error | null;
|
|
4167
|
+
/** Detected intent from the query */
|
|
4168
|
+
detectedIntent: string | null;
|
|
4169
|
+
/** Suggested corrections if query has typos */
|
|
4170
|
+
corrections: string[];
|
|
4171
|
+
/** Expanded query terms */
|
|
4172
|
+
expansions: string[];
|
|
4173
|
+
/** Process a query for smart suggestions */
|
|
4174
|
+
getSuggestions: (query: string) => Promise<SmartSuggestion[]>;
|
|
4175
|
+
/** Clear current suggestions */
|
|
4176
|
+
clear: () => void;
|
|
4177
|
+
}
|
|
4178
|
+
declare function useSmartSuggestions(query: string, options?: SmartSuggestionsOptions): UseSmartSuggestionsReturn;
|
|
4179
|
+
|
|
4180
|
+
/**
|
|
4181
|
+
* useNaturalLanguageFilters Hook
|
|
4182
|
+
*
|
|
4183
|
+
* Convert natural language queries to structured filters
|
|
4184
|
+
* Examples:
|
|
4185
|
+
* - "red shirts under $50" → color: red, category: shirts, price: <= 50
|
|
4186
|
+
* - "size large blue jeans" → size: L, color: blue, category: jeans
|
|
4187
|
+
*/
|
|
4188
|
+
interface ParsedFilter {
|
|
4189
|
+
field: string;
|
|
4190
|
+
value: string;
|
|
4191
|
+
operator: '=' | '>' | '<' | '>=' | '<=' | 'contains';
|
|
4192
|
+
confidence: number;
|
|
4193
|
+
matchedText: string;
|
|
4194
|
+
}
|
|
4195
|
+
interface NaturalLanguageResult {
|
|
4196
|
+
/** Cleaned query with filter terms removed */
|
|
4197
|
+
cleanedQuery: string;
|
|
4198
|
+
/** Extracted filters */
|
|
4199
|
+
filters: ParsedFilter[];
|
|
4200
|
+
/** Original query */
|
|
4201
|
+
originalQuery: string;
|
|
4202
|
+
/** Whether any filters were detected */
|
|
4203
|
+
hasFilters: boolean;
|
|
4204
|
+
}
|
|
4205
|
+
interface NaturalLanguageFiltersOptions {
|
|
4206
|
+
/** Custom field mappings */
|
|
4207
|
+
fieldMappings?: Record<string, string>;
|
|
4208
|
+
/** Custom value mappings */
|
|
4209
|
+
valueMappings?: Record<string, Record<string, string>>;
|
|
4210
|
+
/** Whether to auto-apply filters to search state */
|
|
4211
|
+
autoApply?: boolean;
|
|
4212
|
+
/** Currency symbol for price parsing */
|
|
4213
|
+
currencySymbol?: string;
|
|
4214
|
+
}
|
|
4215
|
+
declare function useNaturalLanguageFilters(options?: NaturalLanguageFiltersOptions): {
|
|
4216
|
+
/** Parse a natural language query */
|
|
4217
|
+
parse: (query: string) => NaturalLanguageResult;
|
|
4218
|
+
/** Apply parsed filters to search state */
|
|
4219
|
+
applyFilters: (filters: ParsedFilter[]) => void;
|
|
4220
|
+
/** Parse and apply in one step */
|
|
4221
|
+
parseAndApply: (query: string) => NaturalLanguageResult;
|
|
4222
|
+
};
|
|
4223
|
+
/**
|
|
4224
|
+
* Utility to format parsed filters for display
|
|
4225
|
+
*/
|
|
4226
|
+
declare function formatParsedFilters(filters: ParsedFilter[]): string;
|
|
4227
|
+
|
|
4228
|
+
/**
|
|
4229
|
+
* useVariantSelection – manages variant selection state
|
|
4230
|
+
*
|
|
4231
|
+
* Single source of truth for variant interactions on product pages.
|
|
4232
|
+
* Cards display variants passively; product pages use this hook.
|
|
4233
|
+
*/
|
|
4234
|
+
|
|
4235
|
+
interface UseVariantSelectionOptions {
|
|
4236
|
+
options?: ProductOption[];
|
|
4237
|
+
variants?: ProductVariant[];
|
|
4238
|
+
initialSelections?: Record<string, string>;
|
|
4239
|
+
onVariantChange?: (variant: ProductVariant | null, selections: Record<string, string>) => void;
|
|
4240
|
+
}
|
|
4241
|
+
interface UseVariantSelectionReturn {
|
|
4242
|
+
selections: Record<string, string>;
|
|
4243
|
+
setSelection: (optionName: string, value: string) => void;
|
|
4244
|
+
resetSelections: () => void;
|
|
4245
|
+
selectedVariant: ProductVariant | null;
|
|
4246
|
+
availableValues: Record<string, {
|
|
4247
|
+
value: string;
|
|
4248
|
+
available: boolean;
|
|
4249
|
+
}[]>;
|
|
4250
|
+
isComplete: boolean;
|
|
4251
|
+
effectivePrice: number | null;
|
|
4252
|
+
effectiveComparePrice: number | null;
|
|
4253
|
+
}
|
|
4254
|
+
declare function useVariantSelection({ options, variants, initialSelections, onVariantChange, }?: UseVariantSelectionOptions): UseVariantSelectionReturn;
|
|
4255
|
+
|
|
4256
|
+
/**
|
|
4257
|
+
* useProductAnalytics – analytics event binding hook for custom components
|
|
4258
|
+
*
|
|
4259
|
+
* Returns event handler props ready to spread onto any element, plus imperative
|
|
4260
|
+
* tracking methods. Builds on existing useAnalytics infrastructure.
|
|
4261
|
+
*/
|
|
4262
|
+
|
|
4263
|
+
interface UseProductAnalyticsOptions {
|
|
4264
|
+
client: SeekoraClient;
|
|
4265
|
+
product: ProductItem;
|
|
4266
|
+
position?: number;
|
|
4267
|
+
section?: string;
|
|
4268
|
+
tabId?: string;
|
|
4269
|
+
query?: string;
|
|
4270
|
+
context?: SearchContext | Partial<SearchContext>;
|
|
4271
|
+
enabled?: boolean;
|
|
4272
|
+
}
|
|
4273
|
+
interface UseProductAnalyticsReturn {
|
|
4274
|
+
/** Spread onto any clickable element to track product click */
|
|
4275
|
+
clickProps: {
|
|
4276
|
+
onClick: (e?: React.MouseEvent) => void;
|
|
4277
|
+
'data-seekora-product-id': string;
|
|
4278
|
+
'data-seekora-position': number;
|
|
4279
|
+
};
|
|
4280
|
+
/** Spread onto any element to track variant selection */
|
|
4281
|
+
variantSelectProps: (optionName: string, value: string) => {
|
|
4282
|
+
onClick: (e?: React.MouseEvent) => void;
|
|
4283
|
+
'data-seekora-variant-option': string;
|
|
4284
|
+
'data-seekora-variant-value': string;
|
|
4285
|
+
};
|
|
4286
|
+
/** Spread onto any element to track add-to-cart */
|
|
4287
|
+
addToCartProps: (variant?: ProductVariant) => {
|
|
4288
|
+
onClick: (e?: React.MouseEvent) => void;
|
|
4289
|
+
'data-seekora-action': 'add-to-cart';
|
|
4290
|
+
};
|
|
4291
|
+
/** Spread onto any element to track impression (uses IntersectionObserver) */
|
|
4292
|
+
impressionRef: React.RefCallback<HTMLElement>;
|
|
4293
|
+
/** Imperative: track product click */
|
|
4294
|
+
trackClick: () => void;
|
|
4295
|
+
/** Imperative: track variant select */
|
|
4296
|
+
trackVariantSelect: (optionName: string, value: string) => void;
|
|
4297
|
+
/** Imperative: track add to cart */
|
|
4298
|
+
trackAddToCart: (variant?: ProductVariant) => void;
|
|
4299
|
+
/** Imperative: track custom event with product context */
|
|
4300
|
+
trackCustomEvent: (eventName: string, metadata?: Record<string, any>) => void;
|
|
4301
|
+
}
|
|
4302
|
+
declare function useProductAnalytics({ client, product, position, section, tabId, query, context, enabled, }: UseProductAnalyticsOptions): UseProductAnalyticsReturn;
|
|
4303
|
+
|
|
4304
|
+
/**
|
|
4305
|
+
* useFilters Hook
|
|
4306
|
+
*
|
|
4307
|
+
* React hook for fetching filter values, searching facet values,
|
|
4308
|
+
* and retrieving filter schema via the dedicated Filters API.
|
|
4309
|
+
*/
|
|
4310
|
+
|
|
4311
|
+
interface UseFiltersOptions extends FilterOptions {
|
|
4312
|
+
/** Whether to automatically refetch filters when query or refinements change (default: true) */
|
|
4313
|
+
autoFetch?: boolean;
|
|
4314
|
+
}
|
|
4315
|
+
interface UseFiltersReturn {
|
|
4316
|
+
/** Filter fields with values and counts */
|
|
4317
|
+
filters: FilterField[];
|
|
4318
|
+
/** Filter schema metadata (fetched once on mount) */
|
|
4319
|
+
schema: FiltersSchemaResponse | null;
|
|
4320
|
+
/** Whether filters are currently loading */
|
|
4321
|
+
loading: boolean;
|
|
4322
|
+
/** Error from the last fetch, if any */
|
|
4323
|
+
error: Error | null;
|
|
4324
|
+
/** Search within a facet's values (for typeahead/autocomplete) */
|
|
4325
|
+
searchFacetValues: (facetName: string, query: string) => Promise<FacetValuesSearchResponse>;
|
|
4326
|
+
/** Manually refetch filters */
|
|
4327
|
+
refetch: () => Promise<void>;
|
|
4328
|
+
}
|
|
4329
|
+
declare const useFilters: (options?: UseFiltersOptions) => UseFiltersReturn;
|
|
4330
|
+
|
|
4331
|
+
/**
|
|
4332
|
+
* Default Theme
|
|
4333
|
+
*/
|
|
4334
|
+
|
|
4335
|
+
declare const defaultTheme: Theme;
|
|
4336
|
+
|
|
4337
|
+
/**
|
|
4338
|
+
* Dark Theme
|
|
4339
|
+
*/
|
|
4340
|
+
|
|
4341
|
+
declare const darkTheme: Theme;
|
|
4342
|
+
|
|
4343
|
+
/**
|
|
4344
|
+
* Minimal Theme
|
|
4345
|
+
*/
|
|
4346
|
+
|
|
4347
|
+
declare const minimalTheme: Theme;
|
|
4348
|
+
|
|
4349
|
+
/**
|
|
4350
|
+
* Query Suggestions Theme System
|
|
4351
|
+
*
|
|
4352
|
+
* Provides comprehensive theming for query suggestions components including:
|
|
4353
|
+
* - CSS variables for easy customization
|
|
4354
|
+
* - Pre-built theme presets (light, dark, minimal, branded)
|
|
4355
|
+
* - Component-specific style generators
|
|
4356
|
+
* - Responsive utilities
|
|
4357
|
+
*/
|
|
4358
|
+
|
|
4359
|
+
interface SuggestionsThemeVariables {
|
|
4360
|
+
'--seekora-bg-surface': string;
|
|
4361
|
+
'--seekora-bg-secondary': string;
|
|
4362
|
+
'--seekora-bg-tertiary': string;
|
|
4363
|
+
'--seekora-bg-hover': string;
|
|
4364
|
+
'--seekora-text-primary': string;
|
|
4365
|
+
'--seekora-text-secondary': string;
|
|
4366
|
+
'--seekora-text-tertiary': string;
|
|
4367
|
+
'--seekora-border-color': string;
|
|
4368
|
+
'--seekora-primary': string;
|
|
4369
|
+
'--seekora-primary-light': string;
|
|
4370
|
+
'--seekora-primary-dark': string;
|
|
4371
|
+
'--seekora-highlight-bg': string;
|
|
4372
|
+
'--seekora-success': string;
|
|
4373
|
+
'--seekora-warning': string;
|
|
4374
|
+
'--seekora-error': string;
|
|
4375
|
+
'--seekora-font-family': string;
|
|
4376
|
+
'--seekora-font-size-xs': string;
|
|
4377
|
+
'--seekora-font-size-sm': string;
|
|
4378
|
+
'--seekora-font-size-base': string;
|
|
4379
|
+
'--seekora-font-size-lg': string;
|
|
4380
|
+
'--seekora-font-weight-normal': string;
|
|
4381
|
+
'--seekora-font-weight-medium': string;
|
|
4382
|
+
'--seekora-font-weight-semibold': string;
|
|
4383
|
+
'--seekora-font-weight-bold': string;
|
|
4384
|
+
'--seekora-line-height-tight': string;
|
|
4385
|
+
'--seekora-line-height-normal': string;
|
|
4386
|
+
'--seekora-line-height-relaxed': string;
|
|
4387
|
+
'--seekora-spacing-xs': string;
|
|
4388
|
+
'--seekora-spacing-sm': string;
|
|
4389
|
+
'--seekora-spacing-md': string;
|
|
4390
|
+
'--seekora-spacing-lg': string;
|
|
4391
|
+
'--seekora-spacing-xl': string;
|
|
4392
|
+
'--seekora-border-radius-sm': string;
|
|
4393
|
+
'--seekora-border-radius': string;
|
|
4394
|
+
'--seekora-border-radius-lg': string;
|
|
4395
|
+
'--seekora-border-radius-xl': string;
|
|
4396
|
+
'--seekora-border-radius-full': string;
|
|
4397
|
+
'--seekora-shadow-sm': string;
|
|
4398
|
+
'--seekora-shadow': string;
|
|
4399
|
+
'--seekora-shadow-md': string;
|
|
4400
|
+
'--seekora-shadow-lg': string;
|
|
4401
|
+
'--seekora-shadow-xl': string;
|
|
4402
|
+
'--seekora-transition-fast': string;
|
|
4403
|
+
'--seekora-transition-normal': string;
|
|
4404
|
+
'--seekora-transition-slow': string;
|
|
4405
|
+
'--seekora-z-dropdown': string;
|
|
4406
|
+
'--seekora-z-modal': string;
|
|
4407
|
+
'--seekora-z-tooltip': string;
|
|
4408
|
+
}
|
|
4409
|
+
declare const lightThemeVariables: SuggestionsThemeVariables;
|
|
4410
|
+
declare const darkThemeVariables: SuggestionsThemeVariables;
|
|
4411
|
+
declare const minimalThemeVariables: SuggestionsThemeVariables;
|
|
4412
|
+
declare const brandPresets: {
|
|
4413
|
+
blue: {
|
|
4414
|
+
'--seekora-primary': string;
|
|
4415
|
+
'--seekora-primary-light': string;
|
|
4416
|
+
'--seekora-primary-dark': string;
|
|
4417
|
+
};
|
|
4418
|
+
green: {
|
|
4419
|
+
'--seekora-primary': string;
|
|
4420
|
+
'--seekora-primary-light': string;
|
|
4421
|
+
'--seekora-primary-dark': string;
|
|
4422
|
+
};
|
|
4423
|
+
purple: {
|
|
4424
|
+
'--seekora-primary': string;
|
|
4425
|
+
'--seekora-primary-light': string;
|
|
4426
|
+
'--seekora-primary-dark': string;
|
|
4427
|
+
};
|
|
4428
|
+
red: {
|
|
4429
|
+
'--seekora-primary': string;
|
|
4430
|
+
'--seekora-primary-light': string;
|
|
4431
|
+
'--seekora-primary-dark': string;
|
|
4432
|
+
};
|
|
4433
|
+
orange: {
|
|
4434
|
+
'--seekora-primary': string;
|
|
4435
|
+
'--seekora-primary-light': string;
|
|
4436
|
+
'--seekora-primary-dark': string;
|
|
4437
|
+
};
|
|
4438
|
+
teal: {
|
|
4439
|
+
'--seekora-primary': string;
|
|
4440
|
+
'--seekora-primary-light': string;
|
|
4441
|
+
'--seekora-primary-dark': string;
|
|
4442
|
+
};
|
|
4443
|
+
pink: {
|
|
4444
|
+
'--seekora-primary': string;
|
|
4445
|
+
'--seekora-primary-light': string;
|
|
4446
|
+
'--seekora-primary-dark': string;
|
|
4447
|
+
};
|
|
4448
|
+
};
|
|
4449
|
+
/**
|
|
4450
|
+
* Create a complete theme object from variables
|
|
4451
|
+
*/
|
|
4452
|
+
declare function createSuggestionsTheme(baseTheme?: 'light' | 'dark' | 'minimal', overrides?: Partial<SuggestionsThemeVariables>, brandColor?: keyof typeof brandPresets): SuggestionsThemeVariables;
|
|
4453
|
+
/**
|
|
4454
|
+
* Generate complete CSS stylesheet for suggestions components
|
|
4455
|
+
*/
|
|
4456
|
+
declare function generateSuggestionsStylesheet(theme?: SuggestionsThemeVariables): string;
|
|
4457
|
+
/**
|
|
4458
|
+
* Inject suggestions styles into the document
|
|
4459
|
+
*/
|
|
4460
|
+
declare function injectSuggestionsStyles(theme?: SuggestionsThemeVariables, force?: boolean): void;
|
|
4461
|
+
/**
|
|
4462
|
+
* Update injected styles with new theme
|
|
4463
|
+
*/
|
|
4464
|
+
declare function updateSuggestionsStyles(theme: SuggestionsThemeVariables): void;
|
|
4465
|
+
|
|
4466
|
+
declare const createTheme: (config: ThemeConfig) => _seekora_ai_ui_sdk_types.Theme;
|
|
4467
|
+
|
|
4468
|
+
export { ActionButtons, AmazonDropdown, AnalyticsProvider, BadgeList, Breadcrumb, CategoriesTabs, ClearRefinements, CurrentRefinements, CustomSelect, DocSearch, DocSearchButton, DropdownPanel, FacetDropdown, 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, SectionSearchProvider, ShopifyDropdown, Snippet, SortBy, SpotlightDropdown, Stats, SuggestionDropdownVariants, SuggestionItem$1 as SuggestionItem, SuggestionList, SuggestionSearchBar, SuggestionsCache, SuggestionsDropdownComposition, SuggestionsError, 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, useFilters, useInjectResponsiveStyles, useKeyboard, useNaturalLanguageFilters, useProductAnalytics, useQuerySuggestions, useQuerySuggestionsEnhanced, useResponsive, useSearchContext, useSearchState, useSectionSearchContext, useSeekoraSearch, useSmartSuggestions, useSuggestionsAnalytics, useSuggestionsContext, useVariantSelection, withAnalytics };
|
|
4469
|
+
export type { ActionButton, ActionButtonType, ActionButtonsProps, AnalyticsConfig, AnalyticsEventPayload, AnalyticsProviderProps, BadgeListProps, BaseDropdownProps, BrandFieldMapping, BreadcrumbItem, BreadcrumbProps, BreadcrumbTheme, CategoriesTabsProps, CategoryFieldMapping, ClearRefinementsProps, ClearRefinementsTheme, CustomSelectOption, CustomSelectProps, CustomSelectTheme, DocSearchAction, DocSearchButtonProps, DocSearchHit, DocSearchProps, DocSearchResponse, DocSearchState, DocSearchSuggestion, DocSearchSuggestionsResponse, DocSearchTranslations, DropdownClassNames, DropdownEventHandlers, DropdownPanelProps, DropdownRef, DropdownThemeConfig, Facet, FacetDropdownOption, FacetDropdownProps, FacetDropdownTheme, FacetItem, FacetRangeConfig, FacetRangeItem, FacetSize, FacetStats, FacetVariant, FacetsProps, FacetsTheme, 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, PaginationProps, PaginationTheme, 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, SearchBarSize, SearchBarTheme, SearchBarWithSuggestionsProps, SearchBarWithSuggestionsRef, SearchInputProps, SearchProviderProps, SearchResultsProps, SearchResultsTheme, SearchSource, SectionConfig, SectionErrorProps, SectionItemGridProps, SectionSearchContextValue, SectionSearchProviderProps, SmartSuggestion, SmartSuggestionsOptions, SnippetProps, SnippetTheme, SortByProps, SortBySize, SortByTheme, SortByVariant, SortOption, SuggestionClickEventData, SuggestionDisplayConfig, SuggestionDropdownVariant, SuggestionFieldMapping, SuggestionImpressionEventData, SuggestionItemProps, SuggestionListProps, SuggestionSearchBarProps, SuggestionSearchBarRef, SuggestionsContextValue, SuggestionsDropdownCompositionProps, SuggestionsErrorProps, SuggestionsProviderProps, SuggestionsThemeVariables, TrendingItemsProps, TrendingListProps, UseAnalyticsOptions, UseAnalyticsReturn, UseSeekoraSearchOptions$1 as UseDocSearchSeekoraSearchOptions, UseSeekoraSearchResult as UseDocSearchSeekoraSearchResult, UseFiltersOptions, UseFiltersReturn, UseProductAnalyticsOptions, UseProductAnalyticsReturn, UseQuerySuggestionsEnhancedOptions, UseQuerySuggestionsEnhancedReturn, UseSmartSuggestionsReturn, UseSuggestionsAnalyticsOptions, UseSuggestionsAnalyticsReturn, UseVariantSelectionOptions, UseVariantSelectionReturn, VariantSelectorProps, VariantSwatchesProps, WithAnalyticsConfig, WithAnalyticsInjectedProps };
|