@seekora-ai/ui-sdk-react 0.2.14 → 0.2.16
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/CurrentRefinements.d.ts.map +1 -1
- package/dist/components/CurrentRefinements.js +69 -9
- 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 +30 -0
- package/dist/components/Facets.d.ts.map +1 -1
- package/dist/components/Facets.js +215 -7
- package/dist/components/FederatedDropdown.d.ts.map +1 -1
- package/dist/components/FederatedDropdown.js +45 -31
- package/dist/components/InfiniteHits.d.ts +0 -7
- package/dist/components/InfiniteHits.d.ts.map +1 -1
- package/dist/components/InfiniteHits.js +2 -13
- package/dist/components/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination.js +27 -9
- package/dist/components/QuerySuggestions.d.ts +0 -4
- package/dist/components/QuerySuggestions.d.ts.map +1 -1
- package/dist/components/QuerySuggestions.js +1 -17
- package/dist/components/QuerySuggestionsDropdown.d.ts +0 -4
- package/dist/components/QuerySuggestionsDropdown.d.ts.map +1 -1
- package/dist/components/QuerySuggestionsDropdown.js +32 -33
- package/dist/components/RangeInput.d.ts.map +1 -1
- package/dist/components/RangeInput.js +6 -6
- package/dist/components/RangeSlider.d.ts.map +1 -1
- package/dist/components/RangeSlider.js +54 -32
- package/dist/components/Recommendations.d.ts +0 -7
- package/dist/components/Recommendations.d.ts.map +1 -1
- package/dist/components/Recommendations.js +3 -23
- package/dist/components/RichQuerySuggestions.d.ts +0 -4
- package/dist/components/RichQuerySuggestions.d.ts.map +1 -1
- package/dist/components/RichQuerySuggestions.js +40 -35
- package/dist/components/SearchBar.d.ts +0 -4
- package/dist/components/SearchBar.d.ts.map +1 -1
- package/dist/components/SearchBar.js +17 -11
- package/dist/components/SearchBarWithSuggestions.js +4 -4
- package/dist/components/SearchLayout.d.ts.map +1 -1
- package/dist/components/SearchLayout.js +22 -17
- package/dist/components/SearchProvider.d.ts.map +1 -1
- package/dist/components/SearchProvider.js +1 -3
- package/dist/components/SearchResults.d.ts +0 -6
- package/dist/components/SearchResults.d.ts.map +1 -1
- package/dist/components/SearchResults.js +38 -39
- package/dist/components/primitives/ActionButtons.d.ts.map +1 -1
- package/dist/components/primitives/ActionButtons.js +34 -10
- package/dist/components/primitives/BadgeList.d.ts.map +1 -1
- package/dist/components/primitives/BadgeList.js +33 -13
- package/dist/components/primitives/ImageDisplay.d.ts.map +1 -1
- package/dist/components/primitives/ImageDisplay.js +32 -19
- package/dist/components/primitives/ImageZoom.d.ts.map +1 -1
- package/dist/components/primitives/ImageZoom.js +85 -30
- package/dist/components/primitives/VariantSelector.js +10 -10
- package/dist/components/primitives/VariantSwatches.d.ts.map +1 -1
- package/dist/components/primitives/VariantSwatches.js +28 -13
- package/dist/components/product-page/ProductGallery.d.ts +8 -1
- package/dist/components/product-page/ProductGallery.d.ts.map +1 -1
- package/dist/components/product-page/ProductGallery.js +2 -2
- package/dist/components/section-primitives/SectionItemGrid.d.ts +1 -3
- package/dist/components/section-primitives/SectionItemGrid.d.ts.map +1 -1
- package/dist/components/section-primitives/SectionItemGrid.js +1 -4
- package/dist/components/section-primitives/SectionSearchProvider.d.ts +3 -1
- package/dist/components/section-primitives/SectionSearchProvider.d.ts.map +1 -1
- package/dist/components/section-primitives/SectionSearchProvider.js +3 -2
- package/dist/components/section-primitives/index.d.ts +0 -1
- package/dist/components/section-primitives/index.d.ts.map +1 -1
- package/dist/components/section-primitives/index.js +0 -1
- package/dist/components/suggestions/AmazonDropdown.d.ts.map +1 -1
- package/dist/components/suggestions/AmazonDropdown.js +3 -21
- package/dist/components/suggestions/GoogleDropdown.d.ts.map +1 -1
- package/dist/components/suggestions/GoogleDropdown.js +3 -20
- package/dist/components/suggestions/MinimalDropdown.d.ts.map +1 -1
- package/dist/components/suggestions/MinimalDropdown.js +2 -2
- package/dist/components/suggestions/MobileSheetDropdown.d.ts.map +1 -1
- package/dist/components/suggestions/MobileSheetDropdown.js +78 -78
- package/dist/components/suggestions/PinterestDropdown.d.ts.map +1 -1
- package/dist/components/suggestions/PinterestDropdown.js +41 -41
- package/dist/components/suggestions/ShopifyDropdown.d.ts.map +1 -1
- package/dist/components/suggestions/ShopifyDropdown.js +40 -41
- package/dist/components/suggestions/SpotlightDropdown.d.ts.map +1 -1
- package/dist/components/suggestions/SpotlightDropdown.js +2 -3
- package/dist/components/suggestions/SuggestionSearchBar.d.ts.map +1 -1
- package/dist/components/suggestions/SuggestionSearchBar.js +2 -15
- package/dist/components/suggestions/types.d.ts +0 -6
- package/dist/components/suggestions/types.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/DropdownPanel.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/DropdownPanel.js +15 -2
- package/dist/components/suggestions-primitives/ItemCard.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/ItemCard.js +48 -11
- package/dist/components/suggestions-primitives/ItemGrid.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/ItemGrid.js +18 -5
- package/dist/components/suggestions-primitives/ProductCard.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/ProductCard.js +36 -12
- package/dist/components/suggestions-primitives/ProductCardLayouts.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/ProductCardLayouts.js +52 -20
- package/dist/components/suggestions-primitives/ProductGrid.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/ProductGrid.js +8 -3
- package/dist/components/suggestions-primitives/RecentSearchesList.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/RecentSearchesList.js +12 -5
- package/dist/components/suggestions-primitives/SearchInput.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/SearchInput.js +29 -10
- package/dist/components/suggestions-primitives/SuggestionItem.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/SuggestionItem.js +8 -3
- package/dist/components/suggestions-primitives/SuggestionList.d.ts +1 -8
- package/dist/components/suggestions-primitives/SuggestionList.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/SuggestionList.js +1 -7
- package/dist/components/suggestions-primitives/TrendingList.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/TrendingList.js +14 -7
- package/dist/components/suggestions-primitives/index.d.ts +1 -3
- package/dist/components/suggestions-primitives/index.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/index.js +1 -2
- package/dist/docsearch/components/DocSearch.d.ts.map +1 -1
- package/dist/docsearch/components/DocSearch.js +1 -1
- package/dist/docsearch/components/Results.d.ts +1 -3
- package/dist/docsearch/components/Results.d.ts.map +1 -1
- package/dist/docsearch/components/Results.js +1 -9
- package/dist/docsearch/components/SearchBox.d.ts +1 -2
- package/dist/docsearch/components/SearchBox.d.ts.map +1 -1
- package/dist/docsearch/components/SearchBox.js +4 -6
- package/dist/docsearch/hooks/useSeekoraSearch.d.ts.map +1 -1
- package/dist/docsearch/hooks/useSeekoraSearch.js +6 -0
- package/dist/docsearch/types.d.ts +0 -1
- package/dist/docsearch/types.d.ts.map +1 -1
- package/dist/docsearch.css +2 -5
- package/dist/hooks/useClickTracking.d.ts.map +1 -1
- package/dist/hooks/useClickTracking.js +4 -11
- package/dist/hooks/useExperiment.d.ts.map +1 -1
- package/dist/hooks/useExperiment.js +10 -33
- package/dist/hooks/useFilters.d.ts +27 -0
- package/dist/hooks/useFilters.d.ts.map +1 -0
- package/dist/hooks/useFilters.js +66 -0
- package/dist/index.d.ts +10 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.umd.js +1 -1
- package/dist/src/index.d.ts +166 -81
- package/dist/src/index.esm.js +2141 -1048
- package/dist/src/index.esm.js.map +1 -1
- package/dist/src/index.js +2142 -1049
- package/dist/src/index.js.map +1 -1
- package/dist/utils/responsive.d.ts +130 -0
- package/dist/utils/responsive.d.ts.map +1 -0
- package/dist/utils/responsive.js +231 -0
- package/package.json +7 -7
- package/src/docsearch/docsearch.css +2 -5
|
@@ -30,7 +30,7 @@ const createStyles = () => ({
|
|
|
30
30
|
left: 0,
|
|
31
31
|
right: 0,
|
|
32
32
|
bottom: 0,
|
|
33
|
-
backgroundColor: 'var(--seekora-bg-surface,
|
|
33
|
+
backgroundColor: 'var(--seekora-bg-surface, transparent)',
|
|
34
34
|
borderRadius: '16px 16px 0 0',
|
|
35
35
|
boxShadow: '0 -4px 20px rgba(0, 0, 0, 0.15)',
|
|
36
36
|
fontFamily: 'var(--seekora-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif)',
|
|
@@ -54,17 +54,17 @@ const createStyles = () => ({
|
|
|
54
54
|
dragBar: {
|
|
55
55
|
width: '36px',
|
|
56
56
|
height: '5px',
|
|
57
|
-
backgroundColor: 'var(--seekora-border-color,
|
|
57
|
+
backgroundColor: 'var(--seekora-border-color, rgba(128,128,128,0.2))',
|
|
58
58
|
borderRadius: '3px',
|
|
59
59
|
},
|
|
60
60
|
header: {
|
|
61
61
|
padding: '0 16px 16px',
|
|
62
|
-
borderBottom: '1px solid var(--seekora-border-color,
|
|
62
|
+
borderBottom: '1px solid var(--seekora-border-color, rgba(128,128,128,0.2))',
|
|
63
63
|
},
|
|
64
64
|
searchContainer: {
|
|
65
65
|
display: 'flex',
|
|
66
66
|
alignItems: 'center',
|
|
67
|
-
backgroundColor: 'var(--seekora-bg-secondary,
|
|
67
|
+
backgroundColor: 'var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))',
|
|
68
68
|
borderRadius: '12px',
|
|
69
69
|
padding: '12px 16px',
|
|
70
70
|
gap: '12px',
|
|
@@ -80,7 +80,7 @@ const createStyles = () => ({
|
|
|
80
80
|
border: 'none',
|
|
81
81
|
background: 'transparent',
|
|
82
82
|
fontSize: '17px',
|
|
83
|
-
color: 'var(--seekora-text-primary,
|
|
83
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
84
84
|
outline: 'none',
|
|
85
85
|
},
|
|
86
86
|
cancelBtn: {
|
|
@@ -128,11 +128,11 @@ const createStyles = () => ({
|
|
|
128
128
|
cursor: 'pointer',
|
|
129
129
|
transition: 'background-color 100ms',
|
|
130
130
|
minHeight: '56px', // Touch-friendly
|
|
131
|
-
color: 'var(--seekora-text-primary,
|
|
131
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
132
132
|
},
|
|
133
133
|
itemActive: {
|
|
134
|
-
backgroundColor: 'var(--seekora-bg-hover,
|
|
135
|
-
color: 'var(--seekora-text-primary,
|
|
134
|
+
backgroundColor: 'var(--seekora-bg-hover, rgba(255, 255, 255, 0.1))',
|
|
135
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
136
136
|
},
|
|
137
137
|
itemIcon: {
|
|
138
138
|
width: '24px',
|
|
@@ -154,14 +154,14 @@ const createStyles = () => ({
|
|
|
154
154
|
},
|
|
155
155
|
itemTitle: {
|
|
156
156
|
fontSize: '17px',
|
|
157
|
-
color: 'var(--seekora-text-primary,
|
|
157
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
158
158
|
whiteSpace: 'nowrap',
|
|
159
159
|
overflow: 'hidden',
|
|
160
160
|
textOverflow: 'ellipsis',
|
|
161
161
|
},
|
|
162
162
|
itemSubtitle: {
|
|
163
163
|
fontSize: '15px',
|
|
164
|
-
color: 'var(--seekora-text-secondary,
|
|
164
|
+
color: 'var(--seekora-text-secondary, inherit)',
|
|
165
165
|
marginTop: '2px',
|
|
166
166
|
whiteSpace: 'nowrap',
|
|
167
167
|
overflow: 'hidden',
|
|
@@ -194,7 +194,7 @@ const createStyles = () => ({
|
|
|
194
194
|
},
|
|
195
195
|
productTitle: {
|
|
196
196
|
fontSize: '15px',
|
|
197
|
-
color: 'var(--seekora-text-primary,
|
|
197
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
198
198
|
marginBottom: '4px',
|
|
199
199
|
whiteSpace: 'nowrap',
|
|
200
200
|
overflow: 'hidden',
|
|
@@ -203,19 +203,19 @@ const createStyles = () => ({
|
|
|
203
203
|
productPrice: {
|
|
204
204
|
fontSize: '15px',
|
|
205
205
|
fontWeight: 600,
|
|
206
|
-
color: 'var(--seekora-text-primary,
|
|
206
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
207
207
|
},
|
|
208
208
|
footer: {
|
|
209
209
|
padding: '12px 16px',
|
|
210
210
|
paddingBottom: 'calc(12px + env(safe-area-inset-bottom, 0px))',
|
|
211
|
-
borderTop: '1px solid var(--seekora-border-color,
|
|
212
|
-
backgroundColor: 'var(--seekora-bg-secondary,
|
|
211
|
+
borderTop: '1px solid var(--seekora-border-color, rgba(128,128,128,0.2))',
|
|
212
|
+
backgroundColor: 'var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))',
|
|
213
213
|
},
|
|
214
214
|
footerBtn: {
|
|
215
215
|
width: '100%',
|
|
216
216
|
padding: '16px',
|
|
217
217
|
backgroundColor: 'var(--seekora-primary, #007aff)',
|
|
218
|
-
color: 'var(--seekora-text-inverse,
|
|
218
|
+
color: 'var(--seekora-text-inverse, transparent)',
|
|
219
219
|
border: 'none',
|
|
220
220
|
borderRadius: '12px',
|
|
221
221
|
fontSize: '17px',
|
|
@@ -227,12 +227,12 @@ const createStyles = () => ({
|
|
|
227
227
|
alignItems: 'center',
|
|
228
228
|
justifyContent: 'center',
|
|
229
229
|
padding: '60px',
|
|
230
|
-
color: 'var(--seekora-text-secondary,
|
|
230
|
+
color: 'var(--seekora-text-secondary, inherit)',
|
|
231
231
|
},
|
|
232
232
|
spinner: {
|
|
233
233
|
width: '28px',
|
|
234
234
|
height: '28px',
|
|
235
|
-
border: '3px solid var(--seekora-border-color,
|
|
235
|
+
border: '3px solid var(--seekora-border-color, rgba(128,128,128,0.2))',
|
|
236
236
|
borderTopColor: 'var(--seekora-primary, #007aff)',
|
|
237
237
|
borderRadius: '50%',
|
|
238
238
|
animation: 'seekora-spin 0.8s linear infinite',
|
|
@@ -240,7 +240,7 @@ const createStyles = () => ({
|
|
|
240
240
|
empty: {
|
|
241
241
|
padding: '60px 20px',
|
|
242
242
|
textAlign: 'center',
|
|
243
|
-
color: 'var(--seekora-text-secondary,
|
|
243
|
+
color: 'var(--seekora-text-secondary, inherit)',
|
|
244
244
|
fontSize: '17px',
|
|
245
245
|
},
|
|
246
246
|
emptyIcon: {
|
|
@@ -267,7 +267,7 @@ const ChevronIcon = () => (React.createElement("svg", { viewBox: "0 0 24 24", fi
|
|
|
267
267
|
const ArrowUpIcon = () => (React.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", width: "20", height: "20" },
|
|
268
268
|
React.createElement("path", { d: "M7 17l5-5-5-5M13 17l5-5-5-5" })));
|
|
269
269
|
export const MobileSheetDropdown = forwardRef(function MobileSheetDropdown(props, ref) {
|
|
270
|
-
const { query, isOpen = true, loading = false, suggestions = [], products = [], recentSearches = [], trendingSearches = [], suggestionFields = { query: 'query' }, productFields = { id: 'id', title: 'title' }, productDisplay = {}, theme = {}, showSearchInput = true, showCancel = true, cancelText = 'Cancel', showDragHandle = true, swipeToDismiss = true, footerButtonText = 'Search', showFooterButton = true, width = '100%', maxHeight = '85vh', zIndex = 9999, className, style, classNames = {}, inputRef, onSuggestionSelect, onProductClick, onRecentClick, onRecentClearAll, onSearchSubmit, onClose, header, footer,
|
|
270
|
+
const { query, isOpen = true, loading = false, suggestions = [], products = [], recentSearches = [], trendingSearches = [], suggestionFields = { query: 'query' }, productFields = { id: 'id', title: 'title' }, productDisplay = {}, theme = {}, showSearchInput = true, showCancel = true, cancelText = 'Cancel', showDragHandle = true, swipeToDismiss = true, footerButtonText = 'Search', showFooterButton = true, width = '100%', maxHeight = '85vh', zIndex = 9999, className, style, classNames = {}, inputRef, onSuggestionSelect, onProductClick, onRecentClick, onRecentClearAll, onSearchSubmit, onClose, header, footer, renderEmpty, } = props;
|
|
271
271
|
// Inject global responsive styles
|
|
272
272
|
useInjectResponsiveStyles();
|
|
273
273
|
const styles = useMemo(() => createStyles(), []);
|
|
@@ -386,7 +386,7 @@ export const MobileSheetDropdown = forwardRef(function MobileSheetDropdown(props
|
|
|
386
386
|
React.createElement("div", { style: styles.searchContainer },
|
|
387
387
|
React.createElement("div", { style: styles.searchIcon },
|
|
388
388
|
React.createElement(SearchIcon, null)),
|
|
389
|
-
React.createElement("input", { ref: inputRef, type: "text", placeholder: "
|
|
389
|
+
React.createElement("input", { ref: inputRef, type: "text", placeholder: "Powered by Seekora", value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: (e) => {
|
|
390
390
|
if (e.key === 'Enter') {
|
|
391
391
|
e.preventDefault();
|
|
392
392
|
if (activeIndex >= 0) {
|
|
@@ -409,70 +409,70 @@ export const MobileSheetDropdown = forwardRef(function MobileSheetDropdown(props
|
|
|
409
409
|
}
|
|
410
410
|
}, style: styles.searchInput, autoFocus: true })),
|
|
411
411
|
showCancel && (React.createElement("button", { style: styles.cancelBtn, onClick: onClose }, cancelText)))))),
|
|
412
|
-
React.createElement("div", { style: styles.content },
|
|
413
|
-
React.createElement(
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
onRecentClick?.(q);
|
|
420
|
-
setInputValue(q);
|
|
421
|
-
}, onMouseEnter: () => setActiveIndex(idx) },
|
|
422
|
-
React.createElement("div", { style: styles.itemIcon },
|
|
423
|
-
React.createElement(ClockIcon, null)),
|
|
424
|
-
React.createElement("div", { style: styles.itemContent },
|
|
425
|
-
React.createElement("div", { style: styles.itemTitle }, q)),
|
|
426
|
-
React.createElement("div", { style: styles.itemAction },
|
|
427
|
-
React.createElement(ArrowUpIcon, null))))))),
|
|
428
|
-
showTrending && (React.createElement("div", { style: styles.section },
|
|
429
|
-
React.createElement("div", { style: styles.sectionHeader },
|
|
430
|
-
React.createElement("span", { style: styles.sectionTitle }, "Trending")),
|
|
431
|
-
trendingQueries.map((q, idx) => {
|
|
432
|
-
const globalIdx = recentQueries.length + idx;
|
|
433
|
-
return (React.createElement("div", { key: `trending-${q}`, "data-index": globalIdx, style: mergeStyles(styles.item, activeIndex === globalIdx ? styles.itemActive : undefined), onClick: () => {
|
|
412
|
+
React.createElement("div", { style: styles.content },
|
|
413
|
+
React.createElement(React.Fragment, null,
|
|
414
|
+
showRecent && (React.createElement("div", { style: styles.section },
|
|
415
|
+
React.createElement("div", { style: styles.sectionHeader },
|
|
416
|
+
React.createElement("span", { style: styles.sectionTitle }, "Recent"),
|
|
417
|
+
React.createElement("button", { style: styles.clearBtn, onClick: onRecentClearAll }, "Clear")),
|
|
418
|
+
recentQueries.map((q, idx) => (React.createElement("div", { key: `recent-${q}`, "data-index": idx, style: mergeStyles(styles.item, activeIndex === idx ? styles.itemActive : undefined), onClick: () => {
|
|
434
419
|
onRecentClick?.(q);
|
|
435
420
|
setInputValue(q);
|
|
436
|
-
}, onMouseEnter: () => setActiveIndex(
|
|
421
|
+
}, onMouseEnter: () => setActiveIndex(idx) },
|
|
437
422
|
React.createElement("div", { style: styles.itemIcon },
|
|
438
|
-
React.createElement(
|
|
423
|
+
React.createElement(ClockIcon, null)),
|
|
439
424
|
React.createElement("div", { style: styles.itemContent },
|
|
440
425
|
React.createElement("div", { style: styles.itemTitle }, q)),
|
|
441
426
|
React.createElement("div", { style: styles.itemAction },
|
|
442
|
-
React.createElement(
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
427
|
+
React.createElement(ArrowUpIcon, null))))))),
|
|
428
|
+
showTrending && (React.createElement("div", { style: styles.section },
|
|
429
|
+
React.createElement("div", { style: styles.sectionHeader },
|
|
430
|
+
React.createElement("span", { style: styles.sectionTitle }, "Trending")),
|
|
431
|
+
trendingQueries.map((q, idx) => {
|
|
432
|
+
const globalIdx = recentQueries.length + idx;
|
|
433
|
+
return (React.createElement("div", { key: `trending-${q}`, "data-index": globalIdx, style: mergeStyles(styles.item, activeIndex === globalIdx ? styles.itemActive : undefined), onClick: () => {
|
|
434
|
+
onRecentClick?.(q);
|
|
435
|
+
setInputValue(q);
|
|
436
|
+
}, onMouseEnter: () => setActiveIndex(globalIdx) },
|
|
437
|
+
React.createElement("div", { style: styles.itemIcon },
|
|
438
|
+
React.createElement(TrendingIcon, null)),
|
|
439
|
+
React.createElement("div", { style: styles.itemContent },
|
|
440
|
+
React.createElement("div", { style: styles.itemTitle }, q)),
|
|
441
|
+
React.createElement("div", { style: styles.itemAction },
|
|
442
|
+
React.createElement(ChevronIcon, null))));
|
|
443
|
+
}))),
|
|
444
|
+
inputValue && processedSuggestions.length > 0 && (React.createElement("div", { style: styles.section },
|
|
445
|
+
React.createElement("div", { style: styles.sectionHeader },
|
|
446
|
+
React.createElement("span", { style: styles.sectionTitle }, "Suggestions")),
|
|
447
|
+
processedSuggestions.map((s, idx) => {
|
|
448
|
+
const globalIdx = recentQueries.length + trendingQueries.length + idx;
|
|
449
|
+
return (React.createElement("div", { key: s.id || idx, "data-index": globalIdx, style: mergeStyles(styles.item, activeIndex === globalIdx ? styles.itemActive : undefined), onClick: () => onSuggestionSelect?.(s._raw, idx), onMouseEnter: () => setActiveIndex(globalIdx) },
|
|
450
|
+
React.createElement("div", { style: styles.itemIcon },
|
|
451
|
+
React.createElement(SearchIcon, null)),
|
|
452
|
+
React.createElement("div", { style: styles.itemContent },
|
|
453
|
+
React.createElement("div", { style: styles.itemTitle }, highlightTextReact(s.query, inputValue, { tag: 'strong' })),
|
|
454
|
+
s.count && (React.createElement("div", { style: styles.itemSubtitle },
|
|
455
|
+
s.count,
|
|
456
|
+
" results"))),
|
|
457
|
+
React.createElement("div", { style: styles.itemAction },
|
|
458
|
+
React.createElement(ChevronIcon, null))));
|
|
459
|
+
}))),
|
|
460
|
+
showProducts && (React.createElement("div", { style: styles.section },
|
|
461
|
+
React.createElement("div", { style: styles.sectionHeader },
|
|
462
|
+
React.createElement("span", { style: styles.sectionTitle }, "Products")),
|
|
463
|
+
React.createElement("div", { style: styles.productsScroll }, processedProducts.slice(0, 8).map((p, idx) => (React.createElement("div", { key: p.id, style: styles.productCard, onClick: () => onProductClick?.(p._raw, idx) },
|
|
464
|
+
p.image ? (React.createElement("img", { src: p.image, alt: p.title, style: styles.productImage, loading: "lazy" })) : (React.createElement("div", { style: styles.productImage })),
|
|
465
|
+
React.createElement("div", { style: styles.productTitle }, p.title),
|
|
466
|
+
p.price !== undefined && (React.createElement("div", { style: styles.productPrice }, formatPrice(p.price, {
|
|
467
|
+
currency: productDisplay.currency || p.currency || '$'
|
|
468
|
+
}))))))))),
|
|
469
|
+
inputValue && processedSuggestions.length === 0 && !loading && (renderEmpty ? renderEmpty(inputValue) : (React.createElement("div", { style: styles.empty },
|
|
470
|
+
React.createElement("div", { style: styles.emptyIcon },
|
|
471
|
+
React.createElement(SearchIcon, null)),
|
|
472
|
+
React.createElement("p", null,
|
|
473
|
+
"No results for \"",
|
|
474
|
+
inputValue,
|
|
475
|
+
"\"")))))),
|
|
476
476
|
footer !== undefined ? footer : (showFooterButton && inputValue && (React.createElement("div", { style: styles.footer },
|
|
477
477
|
React.createElement("button", { style: styles.footerBtn, onClick: () => onSearchSubmit?.(inputValue) },
|
|
478
478
|
footerButtonText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinterestDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions/PinterestDropdown.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAQN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAuU9D,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAC/D,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0BAA0B;IAC1B,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC,yBAAyB;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB;IACxB,eAAe,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;CACvD;AAED,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"PinterestDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions/PinterestDropdown.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAQN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAuU9D,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAC/D,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0BAA0B;IAC1B,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC,yBAAyB;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB;IACxB,eAAe,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;CACvD;AAED,eAAO,MAAM,iBAAiB,4FA4W7B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -302,7 +302,7 @@ const ImageIcon = () => (React.createElement("svg", { viewBox: "0 0 24 24", fill
|
|
|
302
302
|
React.createElement("polyline", { points: "21 15 16 10 5 21" })));
|
|
303
303
|
export const PinterestDropdown = forwardRef(function PinterestDropdown(props, ref) {
|
|
304
304
|
const { query, isOpen = true, loading = false, suggestions = [], products = [], categories = [], suggestionFields = { query: 'query' }, productFields = { id: 'id', title: 'title' }, categoryFields = { id: 'id', label: 'label' }, productDisplay = {}, theme = {}, showSaveButton = true, activeCategory: initialActiveCategory, activeTab, // From BaseDropdownProps
|
|
305
|
-
showPriceOverlay = true, gridColumns = 4, width = '800px', maxHeight = '600px', zIndex = 1000, className, style, classNames = {}, onSuggestionSelect, onProductClick, onCategoryClick, onTabChange, onSaveProduct, onViewAll, onClose, header, footer,
|
|
305
|
+
showPriceOverlay = true, gridColumns = 4, width = '800px', maxHeight = '600px', zIndex = 1000, className, style, classNames = {}, onSuggestionSelect, onProductClick, onCategoryClick, onTabChange, onSaveProduct, onViewAll, onClose, header, footer, renderEmpty, } = props;
|
|
306
306
|
// Inject global responsive styles
|
|
307
307
|
useInjectResponsiveStyles();
|
|
308
308
|
// Responsive state
|
|
@@ -396,47 +396,47 @@ export const PinterestDropdown = forwardRef(function PinterestDropdown(props, re
|
|
|
396
396
|
"(",
|
|
397
397
|
cat.count,
|
|
398
398
|
")"))))))))),
|
|
399
|
-
React.createElement("div", { style: { ...styles.content, maxHeight } },
|
|
400
|
-
React.createElement(
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
399
|
+
React.createElement("div", { style: { ...styles.content, maxHeight } },
|
|
400
|
+
React.createElement(React.Fragment, null,
|
|
401
|
+
processedSuggestions.length > 0 && (React.createElement("div", { style: styles.suggestionsRow }, processedSuggestions.slice(0, 8).map((s, idx) => (React.createElement("button", { key: s.id || idx, "data-index": idx, style: mergeStyles(styles.suggestionPill, activeIndex === idx ? styles.suggestionPillActive : undefined, hoveredSuggestion === idx && activeIndex !== idx ? styles.suggestionPillHover : undefined), onClick: () => onSuggestionSelect?.(s._raw, idx), onMouseEnter: () => {
|
|
402
|
+
setHoveredSuggestion(idx);
|
|
403
|
+
setActiveIndex(idx);
|
|
404
|
+
}, onMouseLeave: () => setHoveredSuggestion(-1) },
|
|
405
|
+
React.createElement("span", { style: styles.suggestionIcon }, query ? highlightTextReact(s.query, query, { tag: 'strong' }) : s.query)))))),
|
|
406
|
+
displayProducts.length > 0 && (React.createElement(React.Fragment, null,
|
|
407
|
+
React.createElement("div", { style: styles.sectionTitle },
|
|
408
|
+
React.createElement(TrendingIcon, null),
|
|
409
|
+
"Ideas for you"),
|
|
410
|
+
React.createElement("div", { style: {
|
|
411
|
+
...styles.productsGrid,
|
|
412
|
+
gridTemplateColumns: `repeat(${gridColumns}, 1fr)`,
|
|
413
|
+
} }, displayProducts.slice(0, 12).map((product, idx) => (React.createElement("div", { key: product.id, style: mergeStyles(styles.productCard, hoveredProduct === product.id ? styles.productCardHover : undefined), onClick: () => onProductClick?.(product._raw, idx), onMouseEnter: () => setHoveredProduct(product.id), onMouseLeave: () => setHoveredProduct(null) },
|
|
414
|
+
React.createElement("div", { style: styles.productImageContainer },
|
|
415
|
+
product.image ? (React.createElement("img", { src: product.image, alt: product.title, style: styles.productImage, loading: "lazy" })) : (React.createElement("div", { style: styles.productImagePlaceholder },
|
|
416
|
+
React.createElement(ImageIcon, null))),
|
|
417
|
+
showSaveButton && (React.createElement("button", { style: mergeStyles(styles.productSaveBtn, hoveredProduct === product.id ? styles.productSaveBtnVisible : undefined), onClick: (e) => {
|
|
418
|
+
e.stopPropagation();
|
|
419
|
+
onSaveProduct?.(product._raw);
|
|
420
|
+
}, "aria-label": "Save" },
|
|
421
|
+
React.createElement(HeartIcon, null))),
|
|
422
|
+
showPriceOverlay && product.price !== undefined && (React.createElement("div", { style: mergeStyles(styles.productOverlay, hoveredProduct === product.id ? styles.productOverlayVisible : undefined) },
|
|
423
|
+
React.createElement("div", { style: styles.productTitleOverlay }, product.title),
|
|
424
|
+
React.createElement("div", { style: styles.productPriceOverlay }, formatPrice(product.price, {
|
|
425
|
+
currency: productDisplay.currency || product.currency || '$'
|
|
426
|
+
}))))),
|
|
427
|
+
!showPriceOverlay && (React.createElement("div", { style: styles.productInfo },
|
|
428
|
+
React.createElement("div", { style: styles.productTitle }, product.title),
|
|
429
|
+
product.price !== undefined && (React.createElement("div", { style: styles.productPrice }, formatPrice(product.price, {
|
|
425
430
|
currency: productDisplay.currency || product.currency || '$'
|
|
426
|
-
}))))),
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
React.createElement(
|
|
435
|
-
React.createElement("p", null,
|
|
436
|
-
"No ideas found for \"",
|
|
437
|
-
query,
|
|
438
|
-
"\""),
|
|
439
|
-
React.createElement("p", { style: { fontSize: '14px', marginTop: '8px' } }, "Try searching for something else"))))))),
|
|
431
|
+
}))))))))))),
|
|
432
|
+
!loading && displayProducts.length === 0 && processedSuggestions.length === 0 && (renderEmpty ? renderEmpty(query) : (React.createElement("div", { style: styles.empty },
|
|
433
|
+
React.createElement("div", { style: styles.emptyIcon },
|
|
434
|
+
React.createElement(SearchIcon, null)),
|
|
435
|
+
React.createElement("p", null,
|
|
436
|
+
"No ideas found for \"",
|
|
437
|
+
query,
|
|
438
|
+
"\""),
|
|
439
|
+
React.createElement("p", { style: { fontSize: '14px', marginTop: '8px' } }, "Try searching for something else")))))),
|
|
440
440
|
footer !== undefined ? footer : (displayProducts.length > 0 && (React.createElement("div", { style: styles.footer },
|
|
441
441
|
React.createElement("span", { style: { color: 'var(--seekora-text-secondary, #767676)', fontSize: '14px' } },
|
|
442
442
|
displayProducts.length,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShopifyDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions/ShopifyDropdown.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAQN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAuU9D,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,wBAAwB;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kCAAkC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,8BAA8B;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,uBAAuB;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yBAAyB;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"ShopifyDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions/ShopifyDropdown.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAQN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAuU9D,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,wBAAwB;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kCAAkC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,8BAA8B;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,uBAAuB;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yBAAyB;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,eAAe,0FAiW3B,CAAC;AAEF,eAAe,eAAe,CAAC"}
|