@seekora-ai/ui-sdk-react 0.2.16 → 0.2.18

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.
Files changed (26) hide show
  1. package/dist/components/suggestions-primitives/CategoriesTabs.js +1 -1
  2. package/dist/components/suggestions-primitives/ItemCard.js +3 -3
  3. package/dist/components/suggestions-primitives/ProductCard.js +3 -3
  4. package/dist/components/suggestions-primitives/ProductCardLayouts.js +6 -6
  5. package/dist/components/suggestions-primitives/RecentSearchesList.js +3 -3
  6. package/dist/components/suggestions-primitives/SearchInput.js +2 -2
  7. package/dist/components/suggestions-primitives/SuggestionItem.js +3 -3
  8. package/dist/components/suggestions-primitives/SuggestionsContext.d.ts +3 -0
  9. package/dist/components/suggestions-primitives/SuggestionsContext.d.ts.map +1 -1
  10. package/dist/components/suggestions-primitives/SuggestionsProvider.d.ts.map +1 -1
  11. package/dist/components/suggestions-primitives/SuggestionsProvider.js +46 -9
  12. package/dist/components/suggestions-primitives/TrendingList.js +4 -4
  13. package/dist/docsearch/components/Footer.d.ts.map +1 -1
  14. package/dist/docsearch/components/Footer.js +11 -1
  15. package/dist/docsearch/hooks/useDocSearch.d.ts.map +1 -1
  16. package/dist/docsearch/hooks/useDocSearch.js +25 -12
  17. package/dist/hooks/useQuerySuggestionsEnhanced.d.ts +2 -0
  18. package/dist/hooks/useQuerySuggestionsEnhanced.d.ts.map +1 -1
  19. package/dist/hooks/useQuerySuggestionsEnhanced.js +26 -2
  20. package/dist/index.umd.js +1 -1
  21. package/dist/src/index.d.ts +5 -0
  22. package/dist/src/index.esm.js +133 -49
  23. package/dist/src/index.esm.js.map +1 -1
  24. package/dist/src/index.js +133 -49
  25. package/dist/src/index.js.map +1 -1
  26. package/package.json +7 -7
@@ -1637,6 +1637,8 @@ interface UseQuerySuggestionsEnhancedOptions {
1637
1637
  query: string;
1638
1638
  /** Enable/disable the hook */
1639
1639
  enabled?: boolean;
1640
+ /** Prefetch initial (empty-query) data on mount even if not enabled yet */
1641
+ prefetch?: boolean;
1640
1642
  /** Debounce delay in ms */
1641
1643
  debounceMs?: number;
1642
1644
  /** Max suggestions to fetch */
@@ -1753,6 +1755,8 @@ interface SuggestionsContextValue {
1753
1755
  recentSearches: RecentSearch[];
1754
1756
  trendingSearches: TrendingSearch[];
1755
1757
  trendingProducts: ProductItem[];
1758
+ /** Products prefetched on mount via client.search("*") — available before dropdown opens */
1759
+ prefetchedProducts: unknown[];
1756
1760
  filteredTabs: FilteredTab[];
1757
1761
  activeTabId: string;
1758
1762
  setActiveTabId: (id: string) => void;
@@ -1766,6 +1770,7 @@ interface SuggestionsContextValue {
1766
1770
  selectTrendingSearch: (trending: TrendingSearch, position: number) => void;
1767
1771
  setActiveTab: (tab: FilteredTab) => void;
1768
1772
  submitSearch: (query: string, fromSuggestion?: boolean, suggestion?: SuggestionItem$3) => void;
1773
+ clearRecentSearches: () => void;
1769
1774
  close: () => void;
1770
1775
  navigateNext: () => void;
1771
1776
  navigatePrev: () => void;
@@ -6800,7 +6800,7 @@ function transformFilteredTab(raw) {
6800
6800
  // Main Hook
6801
6801
  // ============================================================================
6802
6802
  function useQuerySuggestionsEnhanced(options) {
6803
- const { client, query, enabled = true, debounceMs = 200, maxSuggestions = 10, minQueryLength = 1, includeDropdownRecommendations = false, includeDropdownProductList = true, includeFilteredTabs = true, includeCategories = true, includeFacets = true, // CHANGED: Enable facets by default
6803
+ const { client, query, enabled = true, prefetch = false, debounceMs = 200, maxSuggestions = 10, minQueryLength = 1, includeDropdownRecommendations = false, includeDropdownProductList = true, includeFilteredTabs = true, includeCategories = true, includeFacets = true, // CHANGED: Enable facets by default
6804
6804
  maxCategories = 3, maxFacets = 5, filteredTabs, minPopularity, timeRange, disableTypoTolerance, analyticsTags, enableRecentSearches = true, maxRecentSearches = MAX_RECENT_SEARCHES_DEFAULT, recentSearchesKey = RECENT_SEARCHES_DEFAULT_KEY, onSuggestionsLoaded, onError, } = options;
6805
6805
  // State
6806
6806
  const [suggestions, setSuggestions] = useState([]);
@@ -6973,17 +6973,41 @@ function useQuerySuggestionsEnhanced(options) {
6973
6973
  onSuggestionsLoaded,
6974
6974
  onError,
6975
6975
  ]);
6976
+ // Prefetch: fire initial empty-query fetch once client is ready (before dropdown opens)
6977
+ const prefetchedRef = useRef(false);
6978
+ useEffect(() => {
6979
+ if (!prefetch || prefetchedRef.current)
6980
+ return;
6981
+ if (minQueryLength > 0)
6982
+ return;
6983
+ if (!client?.getSuggestions)
6984
+ return;
6985
+ prefetchedRef.current = true;
6986
+ fetchSuggestions('');
6987
+ }, [prefetch, client, minQueryLength, fetchSuggestions]);
6976
6988
  // Debounced fetch effect
6977
6989
  useEffect(() => {
6978
6990
  if (debounceTimerRef.current) {
6979
6991
  clearTimeout(debounceTimerRef.current);
6980
6992
  }
6981
6993
  if (!enabled || query.length < minQueryLength) {
6994
+ // Don't clear prefetched data when dropdown is closed
6995
+ if (prefetch && prefetchedRef.current && query === '') {
6996
+ // Keep prefetched data intact
6997
+ setLoading(false);
6998
+ setError(null);
6999
+ return;
7000
+ }
6982
7001
  setSuggestions([]);
7002
+ setDropdownRecommendations(null);
6983
7003
  setLoading(false);
6984
7004
  setError(null);
6985
7005
  return;
6986
7006
  }
7007
+ // When dropdown opens with empty query and we already have prefetched data, skip re-fetch
7008
+ if (prefetch && prefetchedRef.current && query === '') {
7009
+ return;
7010
+ }
6987
7011
  setLoading(true);
6988
7012
  debounceTimerRef.current = setTimeout(() => {
6989
7013
  fetchSuggestions(query);
@@ -6993,7 +7017,7 @@ function useQuerySuggestionsEnhanced(options) {
6993
7017
  clearTimeout(debounceTimerRef.current);
6994
7018
  }
6995
7019
  };
6996
- }, [query, enabled, minQueryLength, debounceMs, fetchSuggestions]);
7020
+ }, [query, enabled, prefetch, minQueryLength, debounceMs, fetchSuggestions]);
6997
7021
  // Recent search management
6998
7022
  const addRecentSearch = useCallback((searchQuery, resultsCount) => {
6999
7023
  if (!enableRecentSearches || !searchQuery.trim())
@@ -9028,10 +9052,28 @@ function SuggestionsProvider({ children, minQueryLength = 1, debounceMs = 200, m
9028
9052
  const [isOpen, setIsOpenState] = useState(false);
9029
9053
  const [activeIndex, setActiveIndex] = useState(-1);
9030
9054
  const [activeTabId, setActiveTabId] = useState('');
9055
+ const [prefetchedProducts, setPrefetchedProducts] = useState([]);
9056
+ // Prefetch product results on mount so they're available instantly when dropdown opens
9057
+ const prefetchedProductsRef = useRef(false);
9058
+ useEffect(() => {
9059
+ if (prefetchedProductsRef.current || !client?.search)
9060
+ return;
9061
+ prefetchedProductsRef.current = true;
9062
+ client.search('*', { per_page: 12, page: 1 })
9063
+ .then((res) => {
9064
+ const data = res?.data;
9065
+ const items = data?.results || data?.data || res?.results || res?.hits || [];
9066
+ if (Array.isArray(items) && items.length > 0) {
9067
+ setPrefetchedProducts(items);
9068
+ }
9069
+ })
9070
+ .catch(() => { });
9071
+ }, [client]);
9031
9072
  const suggestionsData = useQuerySuggestionsEnhanced({
9032
9073
  client,
9033
9074
  query,
9034
9075
  enabled: isOpen,
9076
+ prefetch: minQueryLength === 0,
9035
9077
  minQueryLength,
9036
9078
  debounceMs,
9037
9079
  maxSuggestions,
@@ -9049,7 +9091,22 @@ function SuggestionsProvider({ children, minQueryLength = 1, debounceMs = 200, m
9049
9091
  trackClicks: true,
9050
9092
  trackImpressions: true,
9051
9093
  });
9052
- const { suggestions, recentSearches, trendingSearches, trendingProducts, filteredTabs: filteredTabsData, loading, error, hasContent, getAllNavigableItems, addRecentSearch, } = suggestionsData;
9094
+ const { suggestions, recentSearches, trendingSearches, trendingProducts, filteredTabs: filteredTabsData, loading, error, hasContent, getAllNavigableItems, addRecentSearch, clearRecentSearches, } = suggestionsData;
9095
+ // Wrap getAllNavigableItems to include prefetchedProducts when trendingProducts is empty
9096
+ const getAllNavigableItemsWithPrefetched = useCallback(() => {
9097
+ const items = getAllNavigableItems();
9098
+ // If there are already product items in the list, return as-is
9099
+ if (items.some(i => i.type === 'product'))
9100
+ return items;
9101
+ // Otherwise append prefetchedProducts as navigable product items
9102
+ if (prefetchedProducts.length > 0) {
9103
+ let idx = items.length;
9104
+ prefetchedProducts.forEach(product => {
9105
+ items.push({ type: 'product', index: idx++, data: product });
9106
+ });
9107
+ }
9108
+ return items;
9109
+ }, [getAllNavigableItems, prefetchedProducts]);
9053
9110
  const onSearchRef = useRef(onSearch);
9054
9111
  const onSuggestionSelectRef = useRef(onSuggestionSelect);
9055
9112
  const onProductClickRef = useRef(onProductClick);
@@ -9127,19 +9184,19 @@ function SuggestionsProvider({ children, minQueryLength = 1, debounceMs = 200, m
9127
9184
  onSearchRef.current?.(trimmed);
9128
9185
  }, [analytics, addRecentSearch, close]);
9129
9186
  const navigateNext = useCallback(() => {
9130
- const items = getAllNavigableItems();
9187
+ const items = getAllNavigableItemsWithPrefetched();
9131
9188
  if (items.length === 0)
9132
9189
  return;
9133
9190
  setActiveIndex((i) => (i < items.length - 1 ? i + 1 : 0));
9134
- }, [getAllNavigableItems]);
9191
+ }, [getAllNavigableItemsWithPrefetched]);
9135
9192
  const navigatePrev = useCallback(() => {
9136
- const items = getAllNavigableItems();
9193
+ const items = getAllNavigableItemsWithPrefetched();
9137
9194
  if (items.length === 0)
9138
9195
  return;
9139
9196
  setActiveIndex((i) => (i <= 0 ? items.length - 1 : i - 1));
9140
- }, [getAllNavigableItems]);
9197
+ }, [getAllNavigableItemsWithPrefetched]);
9141
9198
  const selectActive = useCallback(() => {
9142
- const items = getAllNavigableItems();
9199
+ const items = getAllNavigableItemsWithPrefetched();
9143
9200
  if (activeIndex < 0 || activeIndex >= items.length) {
9144
9201
  submitSearch(query);
9145
9202
  return;
@@ -9161,7 +9218,7 @@ function SuggestionsProvider({ children, minQueryLength = 1, debounceMs = 200, m
9161
9218
  default:
9162
9219
  submitSearch(query);
9163
9220
  }
9164
- }, [activeIndex, getAllNavigableItems, query, submitSearch, selectSuggestion, selectProduct, selectRecentSearch, selectTrendingSearch]);
9221
+ }, [activeIndex, getAllNavigableItemsWithPrefetched, query, submitSearch, selectSuggestion, selectProduct, selectRecentSearch, selectTrendingSearch]);
9165
9222
  // Impression when open and content changes
9166
9223
  useEffect(() => {
9167
9224
  if (!isOpen || !hasContent || !query)
@@ -9184,19 +9241,21 @@ function SuggestionsProvider({ children, minQueryLength = 1, debounceMs = 200, m
9184
9241
  recentSearches,
9185
9242
  trendingSearches,
9186
9243
  trendingProducts,
9244
+ prefetchedProducts,
9187
9245
  filteredTabs: filteredTabsData,
9188
9246
  activeTabId,
9189
9247
  setActiveTabId,
9190
9248
  loading,
9191
9249
  error,
9192
9250
  hasContent,
9193
- getAllNavigableItems,
9251
+ getAllNavigableItems: getAllNavigableItemsWithPrefetched,
9194
9252
  selectSuggestion,
9195
9253
  selectProduct,
9196
9254
  selectRecentSearch,
9197
9255
  selectTrendingSearch,
9198
9256
  setActiveTab,
9199
9257
  submitSearch,
9258
+ clearRecentSearches,
9200
9259
  close,
9201
9260
  navigateNext,
9202
9261
  navigatePrev,
@@ -9212,19 +9271,21 @@ function SuggestionsProvider({ children, minQueryLength = 1, debounceMs = 200, m
9212
9271
  recentSearches,
9213
9272
  trendingSearches,
9214
9273
  trendingProducts,
9274
+ prefetchedProducts,
9215
9275
  filteredTabsData,
9216
9276
  activeTabId,
9217
9277
  setActiveTabId,
9218
9278
  loading,
9219
9279
  error,
9220
9280
  hasContent,
9221
- getAllNavigableItems,
9281
+ getAllNavigableItemsWithPrefetched,
9222
9282
  selectSuggestion,
9223
9283
  selectProduct,
9224
9284
  selectRecentSearch,
9225
9285
  selectTrendingSearch,
9226
9286
  setActiveTab,
9227
9287
  submitSearch,
9288
+ clearRecentSearches,
9228
9289
  close,
9229
9290
  navigateNext,
9230
9291
  navigatePrev,
@@ -9315,14 +9376,14 @@ function SearchInput({ placeholder = 'Powered by Seekora', autoFocus = false, sh
9315
9376
  }, [setQuery]);
9316
9377
  return (React.createElement("div", { className: clsx('seekora-suggestions-search-input-wrapper', className), style: { ...defaultStyles, ...style } },
9317
9378
  React.createElement("div", { className: "seekora-suggestions-input-wrapper", style: inputWrapperStyles },
9318
- leftIcon ? (React.createElement("span", { className: "seekora-suggestions-input-left-icon", style: { display: 'flex', flexShrink: 0, color: 'var(--seekora-text-secondary, #6b7280)' } }, leftIcon)) : null,
9379
+ leftIcon ? (React.createElement("span", { className: "seekora-suggestions-input-left-icon", style: { display: 'flex', flexShrink: 0, color: 'inherit', opacity: 0.5 } }, leftIcon)) : null,
9319
9380
  React.createElement("input", { ref: inputRef, type: "text", value: query, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleKeyDown, placeholder: placeholder, autoFocus: autoFocus, autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: false, "aria-label": ariaLabel, "aria-expanded": isOpen, "aria-haspopup": "listbox", "aria-autocomplete": "list", role: "combobox", className: clsx('seekora-suggestions-input', inputClassName), style: { ...inputStyles, ...inputStyle } }),
9320
9381
  showClearButton && query ? (React.createElement("button", { type: "button", onClick: handleClear, className: "seekora-suggestions-input-clear", "aria-label": "Clear search", style: {
9321
9382
  padding: 8,
9322
9383
  border: 'none',
9323
9384
  background: 'transparent',
9324
9385
  cursor: 'pointer',
9325
- color: 'var(--seekora-text-secondary, #6b7280)',
9386
+ color: 'inherit', opacity: 0.5,
9326
9387
  display: 'flex',
9327
9388
  alignItems: 'center',
9328
9389
  justifyContent: 'center',
@@ -9473,7 +9534,7 @@ const defaultItemStyle = {
9473
9534
  fontSize: 'inherit',
9474
9535
  fontFamily: 'inherit',
9475
9536
  backgroundColor: 'transparent',
9476
- color: 'var(--seekora-text-primary, #111827)',
9537
+ color: 'inherit',
9477
9538
  transition: 'background-color 120ms ease',
9478
9539
  overflow: 'hidden',
9479
9540
  textOverflow: 'ellipsis',
@@ -9490,14 +9551,14 @@ function SuggestionItem({ suggestion, index, isActive, onSelect, className, styl
9490
9551
  const showHighlight = isActive || isHovered;
9491
9552
  return (React.createElement("li", { role: "option", "aria-selected": isActive, id: `seekora-suggestion-${index}`, className: clsx('seekora-suggestions-item', isActive && 'seekora-suggestions-item--active', isHovered && 'seekora-suggestions-item--hover', className), style: {
9492
9553
  ...defaultItemStyle,
9493
- ...(showHighlight ? { backgroundColor: 'var(--seekora-bg-hover, #f3f4f6)' } : {}),
9554
+ ...(showHighlight ? { backgroundColor: 'var(--seekora-bg-hover, rgba(0,0,0,0.05))' } : {}),
9494
9555
  ...style,
9495
9556
  }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onMouseDown: (e) => {
9496
9557
  e.preventDefault();
9497
9558
  onSelect();
9498
9559
  } },
9499
9560
  content,
9500
- suggestion.count != null ? (React.createElement("span", { className: "seekora-suggestions-item-count", style: { marginLeft: 8, color: 'var(--seekora-text-secondary, #6b7280)', fontSize: '0.875em' } }, suggestion.count)) : null));
9561
+ suggestion.count != null ? (React.createElement("span", { className: "seekora-suggestions-item-count", style: { marginLeft: 8, color: 'inherit', opacity: 0.6, fontSize: '0.875em' } }, suggestion.count)) : null));
9501
9562
  }
9502
9563
 
9503
9564
  /**
@@ -10183,7 +10244,7 @@ const imgStyle$1 = {
10183
10244
  aspectRatio: 'var(--seekora-card-aspect-ratio, 1)',
10184
10245
  objectFit: 'cover',
10185
10246
  borderRadius: BORDER_RADIUS$3.sm,
10186
- backgroundColor: 'var(--seekora-bg-secondary, #f3f4f6)',
10247
+ backgroundColor: 'var(--seekora-bg-secondary, rgba(0,0,0,0.04))',
10187
10248
  display: 'block',
10188
10249
  overflow: 'hidden',
10189
10250
  };
@@ -10209,7 +10270,7 @@ function ItemCard({ item, position, onSelect, className, style, asLink = true, i
10209
10270
  // Hover style
10210
10271
  const cardHoverStyle = isHovered
10211
10272
  ? {
10212
- backgroundColor: 'var(--seekora-card-hover-bg, var(--seekora-bg-hover, #f9fafb))',
10273
+ backgroundColor: 'var(--seekora-card-hover-bg, var(--seekora-bg-hover, rgba(0,0,0,0.03)))',
10213
10274
  boxShadow: 'var(--seekora-card-hover-shadow, 0 2px 8px rgba(0, 0, 0, 0.08))',
10214
10275
  }
10215
10276
  : {};
@@ -10218,7 +10279,7 @@ function ItemCard({ item, position, onSelect, className, style, asLink = true, i
10218
10279
  actionButtons && actionButtons.length > 0 && actionButtonsPosition?.startsWith('overlay') && (React.createElement(ActionButtons, { buttons: actionButtons, position: actionButtonsPosition === 'overlay-top-right' ? 'top-right' : 'bottom-center', showLabels: showActionLabels, size: "small" })))) : (React.createElement("div", { className: "seekora-item-card-placeholder", style: { ...imgStyle$1, ...(isHorizontal ? { minWidth: imageMinWidth, flexBasis: imageFlex, maxWidth: imageMaxWidth, height: imageHeight, flexShrink: 0 } : {}) }, "aria-hidden": true }));
10219
10280
  const textBlock = (React.createElement("div", { style: isHorizontal ? { display: 'flex', flexDirection: 'column', gap: textGap, flex: 1, minWidth: 0 } : undefined },
10220
10281
  React.createElement("span", { className: "seekora-item-card-title", style: { fontSize: titleFontSize, fontWeight: 500, lineHeight: 1.4, overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box', WebkitLineClamp: isHorizontal ? 2 : 3, WebkitBoxOrient: 'vertical' } }, String(title)),
10221
- description ? (React.createElement("span", { className: "seekora-item-card-description", style: { fontSize: descriptionFontSize, color: 'var(--seekora-text-secondary, #6b7280)', lineHeight: 1.3, display: '-webkit-box', WebkitLineClamp: lineClamp, WebkitBoxOrient: 'vertical', overflow: 'hidden' } }, String(description))) : null,
10282
+ description ? (React.createElement("span", { className: "seekora-item-card-description", style: { fontSize: descriptionFontSize, color: 'inherit', opacity: 0.6, lineHeight: 1.3, display: '-webkit-box', WebkitLineClamp: lineClamp, WebkitBoxOrient: 'vertical', overflow: 'hidden' } }, String(description))) : null,
10222
10283
  actionButtons && actionButtons.length > 0 && actionButtonsPosition === 'inline' && (React.createElement(ActionButtons, { buttons: actionButtons, position: "inline", showLabels: showActionLabels, size: "small", layout: "horizontal" }))));
10223
10284
  const content = isHorizontal ? (React.createElement("div", { style: { display: 'flex', gap: horizontalGap, alignItems: 'flex-start' } },
10224
10285
  imageBlock,
@@ -11213,7 +11274,7 @@ const imgPlaceholderStyle = {
11213
11274
  aspectRatio: '1',
11214
11275
  objectFit: 'cover',
11215
11276
  borderRadius: BORDER_RADIUS$1.sm,
11216
- backgroundColor: 'var(--seekora-bg-secondary, #f3f4f6)',
11277
+ backgroundColor: 'var(--seekora-bg-secondary, rgba(0,0,0,0.04))',
11217
11278
  };
11218
11279
  function ImageBlock({ images, title, imageVariant, aspectRatio, enableZoom, zoomMode, zoomLevel }) {
11219
11280
  const ar = aspectRatio
@@ -11233,7 +11294,7 @@ function MinimalLayout({ images, title, price, product, imageVariant, displayCon
11233
11294
  return (React.createElement(React.Fragment, null,
11234
11295
  React.createElement(ImageBlock, { images: images, title: title, imageVariant: imageVariant, aspectRatio: displayConfig.imageAspectRatio, enableZoom: enableImageZoom, zoomMode: imageZoomMode, zoomLevel: imageZoomLevel }),
11235
11296
  React.createElement("span", { className: "seekora-product-card__title", style: { fontSize: titleFontSize, fontWeight: 500, lineHeight: 1.4, overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical' } }, title),
11236
- price != null && !Number.isNaN(price) && (React.createElement("span", { className: "seekora-product-card__price seekora-suggestions-product-card-price", style: { fontSize: priceFontSize, color: 'var(--seekora-text-secondary, #6b7280)' } },
11297
+ price != null && !Number.isNaN(price) && (React.createElement("span", { className: "seekora-product-card__price seekora-suggestions-product-card-price", style: { fontSize: priceFontSize, color: 'inherit', opacity: 0.6 } },
11237
11298
  product.currency ?? '$',
11238
11299
  price.toFixed(2)))));
11239
11300
  }
@@ -11253,7 +11314,7 @@ function StandardLayout({ images, title, price, comparePrice, brand, badges, opt
11253
11314
  cfg.showBadges !== false && badges.length > 0 && (React.createElement(BadgeList, { badges: badges, position: "top-left", maxBadges: 2 })),
11254
11315
  actionButtons && actionButtons.length > 0 && isOverlayPosition && (React.createElement(ActionButtons, { buttons: actionButtons, position: actionButtonsPosition === 'overlay-top-right' ? 'top-right' : 'bottom-center', showLabels: showActionLabels, size: "small" }))),
11255
11316
  React.createElement("div", { className: "seekora-product-card__body", style: { display: 'flex', flexDirection: 'column', gap: bodyGap } },
11256
- cfg.showBrand !== false && brand && (React.createElement("span", { className: "seekora-product-card__brand", style: { fontSize: brandFontSize, color: 'var(--seekora-text-secondary, #6b7280)', textTransform: 'uppercase', letterSpacing: '0.02em' } }, brand)),
11317
+ cfg.showBrand !== false && brand && (React.createElement("span", { className: "seekora-product-card__brand", style: { fontSize: brandFontSize, color: 'inherit', opacity: 0.6, textTransform: 'uppercase', letterSpacing: '0.02em' } }, brand)),
11257
11318
  React.createElement("span", { className: "seekora-product-card__title", style: { fontSize: titleFontSize, fontWeight: 500, lineHeight: 1.4, overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical' } }, title),
11258
11319
  React.createElement("div", { className: "seekora-product-card__price" },
11259
11320
  React.createElement(PriceDisplay, { price: price ?? undefined, comparePrice: comparePrice ?? undefined, currency: cfg.currency ?? product.currency, currencyPosition: cfg.currencyPosition, priceDecimals: cfg.priceDecimals, showDiscount: cfg.showDiscount, style: { fontSize: priceFontSize } })),
@@ -11272,7 +11333,7 @@ function DetailedLayout({ images, title, price, comparePrice, brand, badges, pri
11272
11333
  cfg.showBadges !== false && badges.length > 0 && (React.createElement(BadgeList, { badges: badges, position: "top-left" })),
11273
11334
  actionButtons && actionButtons.length > 0 && isOverlayPosition && (React.createElement(ActionButtons, { buttons: actionButtons, position: actionButtonsPosition === 'overlay-top-right' ? 'top-right' : 'bottom-center', showLabels: showActionLabels, size: "small" }))),
11274
11335
  React.createElement("div", { className: "seekora-product-card__body", style: { display: 'flex', flexDirection: 'column', gap: 4 } },
11275
- cfg.showBrand !== false && brand && (React.createElement("span", { className: "seekora-product-card__brand", style: { fontSize: '0.75rem', color: 'var(--seekora-text-secondary, #6b7280)', textTransform: 'uppercase', letterSpacing: '0.02em' } }, brand)),
11336
+ cfg.showBrand !== false && brand && (React.createElement("span", { className: "seekora-product-card__brand", style: { fontSize: '0.75rem', color: 'inherit', opacity: 0.6, textTransform: 'uppercase', letterSpacing: '0.02em' } }, brand)),
11276
11337
  React.createElement("span", { className: "seekora-product-card__title", style: { fontSize: '0.875rem', fontWeight: 500, lineHeight: 1.4, overflow: 'hidden', textOverflow: 'ellipsis' } }, title),
11277
11338
  cfg.showRating !== false && product.rating != null && (React.createElement(RatingDisplay, { rating: product.rating, reviewCount: product.reviewCount, variant: "compact", size: "small", showNumeric: false, showReviewCount: true, className: "seekora-product-card__rating" })),
11278
11339
  React.createElement("div", { className: "seekora-product-card__price" }, cfg.showPriceRange && priceRange ? (React.createElement(PriceDisplay, { priceRange: priceRange, currency: cfg.currency ?? product.currency, currencyPosition: cfg.currencyPosition, priceDecimals: cfg.priceDecimals, style: { fontSize: '0.875rem' } })) : (React.createElement(PriceDisplay, { price: price ?? undefined, comparePrice: comparePrice ?? undefined, currency: cfg.currency ?? product.currency, currencyPosition: cfg.currencyPosition, priceDecimals: cfg.priceDecimals, showDiscount: cfg.showDiscount, style: { fontSize: '0.875rem' } }))),
@@ -11294,7 +11355,7 @@ function CompactLayout({ images, title, price, product, imageVariant, displayCon
11294
11355
  textOverflow: 'ellipsis',
11295
11356
  whiteSpace: 'nowrap',
11296
11357
  } }, title),
11297
- price != null && !Number.isNaN(price) && (React.createElement("span", { className: "seekora-product-card__price", style: { fontSize: '0.8125rem', color: 'var(--seekora-text-secondary, #6b7280)' } },
11358
+ price != null && !Number.isNaN(price) && (React.createElement("span", { className: "seekora-product-card__price", style: { fontSize: '0.8125rem', color: 'inherit', opacity: 0.6 } },
11298
11359
  product.currency ?? '$',
11299
11360
  price.toFixed(2)))));
11300
11361
  }
@@ -11318,7 +11379,7 @@ function HorizontalLayout({ images, title, price, comparePrice, brand, badges, o
11318
11379
  cfg.showBadges !== false && badges.length > 0 && (React.createElement(BadgeList, { badges: badges, position: "top-left", maxBadges: 1 })),
11319
11380
  actionButtons && actionButtons.length > 0 && actionButtonsPosition?.startsWith('overlay') && (React.createElement(ActionButtons, { buttons: actionButtons, position: actionButtonsPosition === 'overlay-top-right' ? 'top-right' : 'bottom-center', showLabels: showActionLabels, size: "small" }))),
11320
11381
  React.createElement("div", { className: "seekora-product-card__body", style: { display: 'flex', flexDirection: 'column', gap: bodyGap, flex: 1, minWidth: 0 } },
11321
- cfg.showBrand !== false && brand && (React.createElement("span", { className: "seekora-product-card__brand", style: { fontSize: brandFontSize, color: 'var(--seekora-text-secondary, #6b7280)', textTransform: 'uppercase' } }, brand)),
11382
+ cfg.showBrand !== false && brand && (React.createElement("span", { className: "seekora-product-card__brand", style: { fontSize: brandFontSize, color: 'inherit', opacity: 0.6, textTransform: 'uppercase' } }, brand)),
11322
11383
  React.createElement("span", { className: "seekora-product-card__title", style: { fontSize: titleFontSize, fontWeight: 500, lineHeight: 1.4, overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box', WebkitLineClamp: isMobile ? 3 : 2, WebkitBoxOrient: 'vertical' } }, title),
11323
11384
  React.createElement("div", { className: "seekora-product-card__price" },
11324
11385
  React.createElement(PriceDisplay, { price: price ?? undefined, comparePrice: comparePrice ?? undefined, currency: cfg.currency ?? product.currency, currencyPosition: cfg.currencyPosition, priceDecimals: cfg.priceDecimals, showDiscount: cfg.showDiscount, style: { fontSize: priceFontSize } })),
@@ -11354,7 +11415,7 @@ const imgStyle = {
11354
11415
  aspectRatio: '1',
11355
11416
  objectFit: 'cover',
11356
11417
  borderRadius: BORDER_RADIUS.sm,
11357
- backgroundColor: 'var(--seekora-bg-secondary, #f3f4f6)',
11418
+ backgroundColor: 'var(--seekora-bg-secondary, rgba(0,0,0,0.04))',
11358
11419
  };
11359
11420
  function ProductCard({ product, position, section, tabId, onSelect, className, style, imageVariant = 'single', displayConfig, onVariantHover, onVariantClick, selectedVariants, asLink, actionButtons, actionButtonsPosition = 'inline', showActionLabels = false, enableImageZoom = false, imageZoomMode = 'both', imageZoomLevel = 2.5, }) {
11360
11421
  // Find selected variant if selections are provided
@@ -11403,7 +11464,7 @@ function ProductCard({ product, position, section, tabId, onSelect, className, s
11403
11464
  const [isHovered, setIsHovered] = React.useState(false);
11404
11465
  const cardHoverStyle = isHovered
11405
11466
  ? {
11406
- backgroundColor: 'var(--seekora-card-hover-bg, var(--seekora-bg-hover, #f9fafb))',
11467
+ backgroundColor: 'var(--seekora-card-hover-bg, var(--seekora-bg-hover, rgba(0,0,0,0.03)))',
11407
11468
  boxShadow: 'var(--seekora-card-hover-shadow, 0 2px 8px rgba(0, 0, 0, 0.08))',
11408
11469
  }
11409
11470
  : {};
@@ -11417,7 +11478,7 @@ function ProductCard({ product, position, section, tabId, onSelect, className, s
11417
11478
  }, "data-position": position, "data-section": section, "data-tab-id": tabId },
11418
11479
  images.length > 0 ? (React.createElement(ImageDisplay, { images: images, variant: imageVariant, alt: title, className: "seekora-suggestions-product-card-image", enableZoom: enableImageZoom, zoomMode: imageZoomMode, zoomLevel: imageZoomLevel })) : (React.createElement("div", { className: "seekora-suggestions-product-card-placeholder", style: imgStyle, "aria-hidden": true })),
11419
11480
  React.createElement("span", { className: "seekora-suggestions-product-card-title", style: { fontSize: '0.875rem', fontWeight: 500 } }, title),
11420
- price != null && !Number.isNaN(price) ? (React.createElement("span", { className: "seekora-suggestions-product-card-price", style: { fontSize: '0.875rem', color: 'var(--seekora-text-secondary, #6b7280)' } },
11481
+ price != null && !Number.isNaN(price) ? (React.createElement("span", { className: "seekora-suggestions-product-card-price", style: { fontSize: '0.875rem', color: 'inherit', opacity: 0.6 } },
11421
11482
  product.currency ?? '$',
11422
11483
  price.toFixed(2))) : null));
11423
11484
  }
@@ -11553,7 +11614,7 @@ function CategoriesTabs({ className, style, tabClassName }) {
11553
11614
  border: 'none',
11554
11615
  borderRadius: 'var(--seekora-border-radius, 6px)',
11555
11616
  backgroundColor: isActive ? 'var(--seekora-primary-light, rgba(59, 130, 246, 0.1))' : 'transparent',
11556
- color: isActive ? 'var(--seekora-primary, #3b82f6)' : 'var(--seekora-text-primary, #111827)',
11617
+ color: isActive ? 'var(--seekora-primary, #3b82f6)' : 'inherit',
11557
11618
  cursor: 'pointer',
11558
11619
  fontSize: '0.875rem',
11559
11620
  fontWeight: isActive ? 600 : 400,
@@ -11577,7 +11638,7 @@ const itemStyle$1 = {
11577
11638
  fontSize: 'inherit',
11578
11639
  fontFamily: 'inherit',
11579
11640
  backgroundColor: 'transparent',
11580
- color: 'var(--seekora-text-primary, #111827)',
11641
+ color: 'inherit',
11581
11642
  transition: 'background-color 120ms ease',
11582
11643
  };
11583
11644
  function RecentSearchItem({ search, onSelect }) {
@@ -11585,7 +11646,7 @@ function RecentSearchItem({ search, onSelect }) {
11585
11646
  return (React.createElement("li", null,
11586
11647
  React.createElement("button", { type: "button", className: clsx('seekora-suggestions-recent-item', isHovered && 'seekora-suggestions-recent-item--hover'), style: {
11587
11648
  ...itemStyle$1,
11588
- ...(isHovered ? { backgroundColor: 'var(--seekora-bg-hover, #f3f4f6)' } : {}),
11649
+ ...(isHovered ? { backgroundColor: 'var(--seekora-bg-hover, rgba(0,0,0,0.05))' } : {}),
11589
11650
  }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onMouseDown: (e) => {
11590
11651
  e.preventDefault();
11591
11652
  onSelect();
@@ -11597,7 +11658,7 @@ function RecentSearchesList({ title = 'Recent', maxItems = 8, className, style,
11597
11658
  if (items.length === 0)
11598
11659
  return null;
11599
11660
  return (React.createElement("div", { className: clsx('seekora-suggestions-recent-list', className), style: style },
11600
- title ? (React.createElement("div", { className: "seekora-suggestions-recent-title", style: { padding: '8px 12px', fontSize: '0.75rem', fontWeight: 600, color: 'var(--seekora-text-secondary, #6b7280)', textTransform: 'uppercase' } }, title)) : null,
11661
+ title ? (React.createElement("div", { className: "seekora-suggestions-recent-title", style: { padding: '8px 12px', fontSize: '0.75rem', fontWeight: 600, color: 'inherit', opacity: 0.6, textTransform: 'uppercase' } }, title)) : null,
11601
11662
  React.createElement("ul", { className: clsx('seekora-suggestions-recent-ul', listClassName), style: { margin: 0, padding: 0, listStyle: 'none' } }, items.map((search, i) => {
11602
11663
  const onSelect = () => selectRecentSearch(search);
11603
11664
  if (renderItem) {
@@ -11621,7 +11682,7 @@ const itemStyle = {
11621
11682
  fontSize: 'inherit',
11622
11683
  fontFamily: 'inherit',
11623
11684
  backgroundColor: 'transparent',
11624
- color: 'var(--seekora-text-primary, #111827)',
11685
+ color: 'inherit',
11625
11686
  transition: 'background-color 120ms ease',
11626
11687
  };
11627
11688
  function TrendingItem({ trending, onSelect }) {
@@ -11629,13 +11690,13 @@ function TrendingItem({ trending, onSelect }) {
11629
11690
  return (React.createElement("li", null,
11630
11691
  React.createElement("button", { type: "button", className: clsx('seekora-suggestions-trending-item', isHovered && 'seekora-suggestions-trending-item--hover'), style: {
11631
11692
  ...itemStyle,
11632
- ...(isHovered ? { backgroundColor: 'var(--seekora-bg-hover, #f3f4f6)' } : {}),
11693
+ ...(isHovered ? { backgroundColor: 'var(--seekora-bg-hover, rgba(0,0,0,0.05))' } : {}),
11633
11694
  }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onMouseDown: (e) => {
11634
11695
  e.preventDefault();
11635
11696
  onSelect();
11636
11697
  } },
11637
11698
  trending.query,
11638
- trending.count != null ? (React.createElement("span", { style: { marginLeft: 8, color: 'var(--seekora-text-secondary, #6b7280)', fontSize: '0.875em' } }, trending.count)) : null)));
11699
+ trending.count != null ? (React.createElement("span", { style: { marginLeft: 8, color: 'inherit', opacity: 0.6, fontSize: '0.875em' } }, trending.count)) : null)));
11639
11700
  }
11640
11701
  function TrendingList({ title = 'Trending', maxItems = 8, className, style, listClassName, renderItem, }) {
11641
11702
  const { trendingSearches, selectTrendingSearch } = useSuggestionsContext();
@@ -11643,7 +11704,7 @@ function TrendingList({ title = 'Trending', maxItems = 8, className, style, list
11643
11704
  if (items.length === 0)
11644
11705
  return null;
11645
11706
  return (React.createElement("div", { className: clsx('seekora-suggestions-trending-list', className), style: style },
11646
- title ? (React.createElement("div", { className: "seekora-suggestions-trending-title", style: { padding: '8px 12px', fontSize: '0.75rem', fontWeight: 600, color: 'var(--seekora-text-secondary, #6b7280)', textTransform: 'uppercase' } }, title)) : null,
11707
+ title ? (React.createElement("div", { className: "seekora-suggestions-trending-title", style: { padding: '8px 12px', fontSize: '0.75rem', fontWeight: 600, color: 'inherit', opacity: 0.6, textTransform: 'uppercase' } }, title)) : null,
11647
11708
  React.createElement("ul", { className: clsx('seekora-suggestions-trending-ul', listClassName), style: { margin: 0, padding: 0, listStyle: 'none' } }, items.map((trending, i) => {
11648
11709
  const onSelect = () => selectTrendingSearch(trending, i);
11649
11710
  if (renderItem) {
@@ -16640,6 +16701,15 @@ function Results({ hits, groupedHits, selectedIndex, onSelect, onHover, scrollSe
16640
16701
  }))))))));
16641
16702
  }
16642
16703
 
16704
+ function SeekoraLogo() {
16705
+ return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 563 636", width: "20", height: "22", "aria-hidden": "true" },
16706
+ React.createElement("path", { fill: "#03d1ff", d: "M243.44,231.23l-99.23,98.52-9.41,9.41c-14.83,14.83-38.57,13.17-51.4-1.5-2.39-2.73-4.39-5.89-5.89-9.49-.05-.16-.13-.32-.18-.47-1.55-3.68-2.95-7.41-4.29-11.2-7.39-21.24-11.33-44.04-11.25-67.81h.24c-.05-.6-.05-1.24-.08-1.87-.08-2.13-.11-4.29-.11-6.44,0-126.81,102.78-229.59,229.6-229.59,30.84,0,60.29,6.07,87.16,17.14-10.18,10.36-15.22,25.4-12.23,40.7,1.42,7.05,4.39,13.41,8.55,18.75,1.26,1.68,2.68,3.26,4.18,4.73-.58-.34-1.16-.68-1.76-1-25.29-14.62-54.64-22.95-85.9-22.95-95.13,0-172.22,77.12-172.22,172.22,0,1.95.03,3.87.11,5.78v.05c.39,11.94,2,23.59,4.73,34.79l.82-.82,23.14-23.16,47.14-47.14,20.09-20.06c11.31-11.31,27.69-15.57,42.99-11.2.05.03.13.03.18.05.24.05.45.11.68.18,9.47,2.87,17.46,8.73,22.95,16.49,3.6,5.02,6.15,10.83,7.39,17.06l5.94,30.21,1.5,7.57.11.63,1.97-2.05,69.62-72.57,15.28-15.93,33.68-35.15,5.47-5.68,11.31-11.78,23.32-24.32,4.23-4.39,7.94-8.28-6.07,1.18-12.46,2.45-2.18.42-16.36,3.23-.03.03-18.64,3.68c-11.86,2.34-23.4-5.39-25.77-17.25-2.08-10.52,3.73-20.75,13.33-24.64,1.26-.5,2.58-.89,3.97-1.16l45.54-8.99,34.44-6.81,14.99-2.92,23.06-4.58c.58-.11,1.16-.21,1.71-.26.5-.05,1-.11,1.5-.13,1-.05,2-.03,3,.05,4.47.39,8.78,2.18,12.3,5.18,3.76,3.21,6.28,7.52,7.26,12.25.13.68.24,1.37.31,2.05.11,1.05.13,2.1.11,3.16l-1.05,28.08-.66,18.64-.24,6.68-2.26,62.63-.03,1.1c-.39,11.83-10.12,21.14-21.9,21.14-.26,0-.53-.03-.79-.03-5.13-.18-9.75-2.1-13.36-5.15-4.97-4.18-8.05-10.54-7.76-17.54l.11-2.76.42-11.86.58-16.33.58-16.3-235.99,252.7-24.03-127.37Z" }),
16707
+ React.createElement("path", { fill: "#4d66fe", d: "M11.11,572.49c-1.27-6.46.68-13.13,5.22-17.89l105.47-110.63,15.28-15.93,33.68-35.15,5.47-5.68,34.63-36.1,8.23-8.57,11.91,57.94.63,1.42h0c10.78,4,22.09,6.94,33.76,8.73v57.87c-27.58-3.1-53.69-11.12-77.43-23.14L21.34,623.95l-10.23-51.46Z" }),
16708
+ React.createElement("path", { fill: "#4d66fe", d: "M325.32,330.56v136.38c-10.31,1.44-20.85,2.17-31.56,2.17-1.56,0-3.13,0-4.69-.08v-101.86l36.25-36.61Z" }),
16709
+ React.createElement("polygon", { fill: "#4d66fe", points: "381.47 451.71 381.47 385.94 381.55 270.05 345.17 308.07 345.17 463.34 381.47 451.71" }),
16710
+ React.createElement("polygon", { fill: "#4d66fe", points: "437.61 418.26 437.65 321.78 437.69 213.67 401.32 251.68 401.32 442.32 437.61 418.26" }),
16711
+ React.createElement("path", { fill: "#4d66fe", d: "M493.87,157.13l-.08,108.11v86.38c-9.91,17.8-22.14,34.13-36.29,48.56v-205l36.37-38.05Z" })));
16712
+ }
16643
16713
  function Footer({ translations = {} }) {
16644
16714
  return (React.createElement("footer", { className: "seekora-docsearch-footer" },
16645
16715
  React.createElement("div", { className: "seekora-docsearch-footer-commands" },
@@ -16660,7 +16730,8 @@ function Footer({ translations = {} }) {
16660
16730
  React.createElement("div", { className: "seekora-docsearch-footer-logo" },
16661
16731
  React.createElement("span", { className: "seekora-docsearch-footer-logo-text" }, translations.searchByText || 'Search by'),
16662
16732
  React.createElement("a", { href: "https://seekora.ai", target: "_blank", rel: "noopener noreferrer", className: "seekora-docsearch-footer-logo-link" },
16663
- React.createElement("span", { className: "seekora-docsearch-logo", style: { fontFamily: 'system-ui', fontSize: 14, fontWeight: 600 } }, "Seekora")))));
16733
+ React.createElement(SeekoraLogo, null),
16734
+ React.createElement("span", { className: "seekora-docsearch-logo", style: { fontWeight: 600 } }, "Seekora")))));
16664
16735
  }
16665
16736
 
16666
16737
  function useKeyboard(options) {
@@ -16804,18 +16875,31 @@ function useDocSearch(options) {
16804
16875
  const abortControllersRef = useRef(new Map());
16805
16876
  const debounceTimerRef = useRef(null);
16806
16877
  const defaultTransform = (data, sourceId) => {
16807
- const items = data.data?.suggestions || data.data?.results || data.suggestions || data.results || data.hits || [];
16808
- return items.map((item) => ({
16809
- url: item.url || item.route || '',
16810
- title: item.title?.replace?.(/<\/?mark>/g, '') || item.title || '',
16811
- content: item.content?.replace?.(/<\/?mark>/g, '')?.substring?.(0, 100) || item.description || '',
16812
- description: item.description || item.content?.substring?.(0, 100) || '',
16813
- category: item.category || item.hierarchy?.lvl0 || '',
16814
- hierarchy: item.hierarchy,
16815
- route: item.route,
16816
- parentTitle: item.parent_title || item.parentTitle,
16817
- _source: sourceId,
16818
- }));
16878
+ const items = data.data?.suggestions || data.data?.results || data.data?.hits || data.suggestions || data.results || data.hits || [];
16879
+ return items.map((item) => {
16880
+ const doc = item.document || item;
16881
+ // Build hierarchy from nested object or flat dot-notation keys
16882
+ const hierarchy = doc.hierarchy || {
16883
+ lvl0: doc['hierarchy.lvl0'],
16884
+ lvl1: doc['hierarchy.lvl1'],
16885
+ lvl2: doc['hierarchy.lvl2'],
16886
+ lvl3: doc['hierarchy.lvl3'],
16887
+ lvl4: doc['hierarchy.lvl4'],
16888
+ lvl5: doc['hierarchy.lvl5'],
16889
+ };
16890
+ return {
16891
+ url: doc.url || doc.route || item.url || '',
16892
+ title: (doc.title || '').replace?.(/<\/?mark>/g, '') || '',
16893
+ content: (doc.content || doc.description || '').replace?.(/<\/?mark>/g, '')?.substring?.(0, 100) || '',
16894
+ description: doc.description || doc.content?.substring?.(0, 100) || '',
16895
+ category: doc.category || hierarchy?.lvl0 || '',
16896
+ hierarchy,
16897
+ route: doc.route,
16898
+ parentTitle: doc.parent_title || doc.parentTitle,
16899
+ anchor: doc.anchor || item.anchor,
16900
+ _source: sourceId,
16901
+ };
16902
+ });
16819
16903
  };
16820
16904
  const transformPublicSearchResults = useCallback((data, sourceId) => {
16821
16905
  const results = data?.data?.results || [];