@seekora-ai/ui-sdk-react 0.2.14 → 0.2.15
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 +92 -0
- package/dist/components/FacetDropdown.d.ts.map +1 -0
- package/dist/components/FacetDropdown.js +374 -0
- package/dist/components/Facets.d.ts +26 -0
- package/dist/components/Facets.d.ts.map +1 -1
- package/dist/components/Facets.js +195 -6
- package/dist/components/FederatedDropdown.d.ts.map +1 -1
- package/dist/components/FederatedDropdown.js +45 -31
- package/dist/components/QuerySuggestionsDropdown.d.ts.map +1 -1
- package/dist/components/QuerySuggestionsDropdown.js +32 -18
- 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/RichQuerySuggestions.d.ts.map +1 -1
- package/dist/components/RichQuerySuggestions.js +40 -26
- package/dist/components/SearchBar.d.ts.map +1 -1
- package/dist/components/SearchBar.js +15 -7
- package/dist/components/SearchBarWithSuggestions.js +3 -3
- package/dist/components/SearchLayout.d.ts.map +1 -1
- package/dist/components/SearchLayout.js +10 -1
- package/dist/components/SearchResults.d.ts.map +1 -1
- package/dist/components/SearchResults.js +37 -25
- 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 +11 -8
- package/dist/components/primitives/ImageZoom.js +26 -26
- package/dist/components/primitives/VariantSelector.js +10 -10
- package/dist/components/primitives/VariantSwatches.js +3 -3
- 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/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/suggestions/MobileSheetDropdown.js +18 -18
- package/dist/components/suggestions/ShopifyDropdown.js +37 -37
- 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 +21 -8
- package/dist/components/suggestions-primitives/ItemGrid.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/ItemGrid.js +9 -3
- package/dist/components/suggestions-primitives/ProductCard.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/ProductCard.js +25 -10
- package/dist/components/suggestions-primitives/ProductCardLayouts.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/ProductCardLayouts.js +24 -12
- package/dist/components/suggestions-primitives/SearchInput.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/SearchInput.js +28 -9
- package/dist/components/suggestions-primitives/SuggestionItem.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/SuggestionItem.js +3 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.umd.js +1 -1
- package/dist/src/index.d.ts +129 -4
- package/dist/src/index.esm.js +1361 -616
- package/dist/src/index.esm.js.map +1 -1
- package/dist/src/index.js +1361 -615
- package/dist/src/index.js.map +1 -1
- package/package.json +6 -6
|
@@ -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: {
|
|
@@ -23,8 +23,8 @@ const createStyles = (isMobile = false) => ({
|
|
|
23
23
|
right: 0,
|
|
24
24
|
bottom: isMobile ? 0 : 'auto',
|
|
25
25
|
marginTop: isMobile ? 0 : '8px',
|
|
26
|
-
backgroundColor: 'var(--seekora-bg-surface,
|
|
27
|
-
color: 'var(--seekora-text-primary,
|
|
26
|
+
backgroundColor: 'var(--seekora-bg-surface, transparent)',
|
|
27
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
28
28
|
borderRadius: isMobile ? 0 : '16px',
|
|
29
29
|
boxShadow: isMobile ? 'none' : '0 4px 30px rgba(0, 0, 0, 0.12)',
|
|
30
30
|
overflow: 'hidden',
|
|
@@ -42,14 +42,14 @@ const createStyles = (isMobile = false) => ({
|
|
|
42
42
|
overflowY: 'auto',
|
|
43
43
|
},
|
|
44
44
|
leftPanel: {
|
|
45
|
-
backgroundColor: 'var(--seekora-bg-surface,
|
|
46
|
-
borderRight: isMobile ? 'none' : '1px solid var(--seekora-border-color,
|
|
47
|
-
borderBottom: isMobile ? '1px solid var(--seekora-border-color,
|
|
45
|
+
backgroundColor: 'var(--seekora-bg-surface, transparent)',
|
|
46
|
+
borderRight: isMobile ? 'none' : '1px solid var(--seekora-border-color, rgba(128,128,128,0.2))',
|
|
47
|
+
borderBottom: isMobile ? '1px solid var(--seekora-border-color, rgba(128,128,128,0.2))' : 'none',
|
|
48
48
|
display: 'flex',
|
|
49
49
|
flexDirection: 'column',
|
|
50
50
|
},
|
|
51
51
|
rightPanel: {
|
|
52
|
-
backgroundColor: 'var(--seekora-bg-secondary,
|
|
52
|
+
backgroundColor: 'var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))',
|
|
53
53
|
padding: isMobile ? '16px' : '24px',
|
|
54
54
|
display: 'flex',
|
|
55
55
|
flexDirection: 'column',
|
|
@@ -64,7 +64,7 @@ const createStyles = (isMobile = false) => ({
|
|
|
64
64
|
display: 'flex',
|
|
65
65
|
alignItems: 'center',
|
|
66
66
|
justifyContent: 'space-between',
|
|
67
|
-
borderBottom: '1px solid var(--seekora-border-color,
|
|
67
|
+
borderBottom: '1px solid var(--seekora-border-color, rgba(128,128,128,0.2))',
|
|
68
68
|
},
|
|
69
69
|
sectionTitle: {
|
|
70
70
|
fontSize: '11px',
|
|
@@ -75,7 +75,7 @@ const createStyles = (isMobile = false) => ({
|
|
|
75
75
|
},
|
|
76
76
|
viewAllLink: {
|
|
77
77
|
fontSize: '12px',
|
|
78
|
-
color: 'var(--seekora-text-primary,
|
|
78
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
79
79
|
textDecoration: 'underline',
|
|
80
80
|
cursor: 'pointer',
|
|
81
81
|
},
|
|
@@ -89,11 +89,11 @@ const createStyles = (isMobile = false) => ({
|
|
|
89
89
|
minHeight: '48px',
|
|
90
90
|
margin: '4px 8px',
|
|
91
91
|
borderRadius: '10px',
|
|
92
|
-
color: 'var(--seekora-text-primary,
|
|
92
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
93
93
|
},
|
|
94
94
|
suggestionItemActive: {
|
|
95
|
-
backgroundColor: 'var(--seekora-bg-hover,
|
|
96
|
-
color: 'var(--seekora-text-primary,
|
|
95
|
+
backgroundColor: 'var(--seekora-bg-hover, rgba(255, 255, 255, 0.1))',
|
|
96
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
97
97
|
},
|
|
98
98
|
suggestionIcon: {
|
|
99
99
|
display: 'flex',
|
|
@@ -108,12 +108,12 @@ const createStyles = (isMobile = false) => ({
|
|
|
108
108
|
},
|
|
109
109
|
suggestionQuery: {
|
|
110
110
|
fontSize: '14px',
|
|
111
|
-
color: 'var(--seekora-text-primary,
|
|
111
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
112
112
|
fontWeight: 400,
|
|
113
113
|
},
|
|
114
114
|
suggestionMeta: {
|
|
115
115
|
fontSize: '12px',
|
|
116
|
-
color: 'var(--seekora-text-secondary,
|
|
116
|
+
color: 'var(--seekora-text-secondary, inherit)',
|
|
117
117
|
marginTop: '2px',
|
|
118
118
|
},
|
|
119
119
|
suggestionArrow: {
|
|
@@ -131,29 +131,29 @@ const createStyles = (isMobile = false) => ({
|
|
|
131
131
|
display: 'grid',
|
|
132
132
|
gridTemplateColumns: 'repeat(2, 1fr)',
|
|
133
133
|
gap: '1px',
|
|
134
|
-
backgroundColor: 'var(--seekora-border-color,
|
|
135
|
-
borderTop: '1px solid var(--seekora-border-color,
|
|
134
|
+
backgroundColor: 'var(--seekora-border-color, rgba(128,128,128,0.2))',
|
|
135
|
+
borderTop: '1px solid var(--seekora-border-color, rgba(128,128,128,0.2))',
|
|
136
136
|
},
|
|
137
137
|
collectionItem: {
|
|
138
|
-
backgroundColor: 'var(--seekora-bg-surface,
|
|
139
|
-
color: 'var(--seekora-text-primary,
|
|
138
|
+
backgroundColor: 'var(--seekora-bg-surface, transparent)',
|
|
139
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
140
140
|
padding: '16px 20px',
|
|
141
141
|
cursor: 'pointer',
|
|
142
142
|
transition: 'background-color 150ms',
|
|
143
143
|
},
|
|
144
144
|
collectionItemHover: {
|
|
145
|
-
backgroundColor: 'var(--seekora-bg-hover,
|
|
146
|
-
color: 'var(--seekora-text-primary,
|
|
145
|
+
backgroundColor: 'var(--seekora-bg-hover, rgba(255, 255, 255, 0.1))',
|
|
146
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
147
147
|
},
|
|
148
148
|
collectionName: {
|
|
149
149
|
fontSize: '13px',
|
|
150
150
|
fontWeight: 500,
|
|
151
|
-
color: 'var(--seekora-text-primary,
|
|
151
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
152
152
|
marginBottom: '4px',
|
|
153
153
|
},
|
|
154
154
|
collectionCount: {
|
|
155
155
|
fontSize: '11px',
|
|
156
|
-
color: 'var(--seekora-text-secondary,
|
|
156
|
+
color: 'var(--seekora-text-secondary, inherit)',
|
|
157
157
|
},
|
|
158
158
|
heroProduct: {
|
|
159
159
|
marginBottom: '24px',
|
|
@@ -169,13 +169,13 @@ const createStyles = (isMobile = false) => ({
|
|
|
169
169
|
heroTitle: {
|
|
170
170
|
fontSize: '16px',
|
|
171
171
|
fontWeight: 500,
|
|
172
|
-
color: 'var(--seekora-text-primary,
|
|
172
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
173
173
|
marginBottom: '8px',
|
|
174
174
|
lineHeight: 1.3,
|
|
175
175
|
},
|
|
176
176
|
heroBrand: {
|
|
177
177
|
fontSize: '12px',
|
|
178
|
-
color: 'var(--seekora-text-secondary,
|
|
178
|
+
color: 'var(--seekora-text-secondary, inherit)',
|
|
179
179
|
marginBottom: '12px',
|
|
180
180
|
textTransform: 'uppercase',
|
|
181
181
|
letterSpacing: '0.05em',
|
|
@@ -189,7 +189,7 @@ const createStyles = (isMobile = false) => ({
|
|
|
189
189
|
heroPrice: {
|
|
190
190
|
fontSize: '18px',
|
|
191
191
|
fontWeight: 500,
|
|
192
|
-
color: 'var(--seekora-text-primary,
|
|
192
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
193
193
|
},
|
|
194
194
|
heroComparePrice: {
|
|
195
195
|
fontSize: '14px',
|
|
@@ -207,8 +207,8 @@ const createStyles = (isMobile = false) => ({
|
|
|
207
207
|
heroButton: {
|
|
208
208
|
width: '100%',
|
|
209
209
|
padding: '14px 20px',
|
|
210
|
-
backgroundColor: 'var(--seekora-text-primary,
|
|
211
|
-
color: 'var(--seekora-bg-surface,
|
|
210
|
+
backgroundColor: 'var(--seekora-text-primary, inherit)',
|
|
211
|
+
color: 'var(--seekora-bg-surface, transparent)',
|
|
212
212
|
border: 'none',
|
|
213
213
|
borderRadius: '2px',
|
|
214
214
|
fontSize: '13px',
|
|
@@ -219,8 +219,8 @@ const createStyles = (isMobile = false) => ({
|
|
|
219
219
|
transition: 'background-color 150ms',
|
|
220
220
|
},
|
|
221
221
|
heroButtonHover: {
|
|
222
|
-
backgroundColor: 'var(--seekora-text-secondary,
|
|
223
|
-
color: 'var(--seekora-bg-surface,
|
|
222
|
+
backgroundColor: 'var(--seekora-text-secondary, inherit)',
|
|
223
|
+
color: 'var(--seekora-bg-surface, transparent)',
|
|
224
224
|
},
|
|
225
225
|
productsScroll: {
|
|
226
226
|
flex: 1,
|
|
@@ -248,7 +248,7 @@ const createStyles = (isMobile = false) => ({
|
|
|
248
248
|
},
|
|
249
249
|
productTitle: {
|
|
250
250
|
fontSize: '12px',
|
|
251
|
-
color: 'var(--seekora-text-primary,
|
|
251
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
252
252
|
marginBottom: '4px',
|
|
253
253
|
whiteSpace: 'nowrap',
|
|
254
254
|
overflow: 'hidden',
|
|
@@ -257,20 +257,20 @@ const createStyles = (isMobile = false) => ({
|
|
|
257
257
|
productPrice: {
|
|
258
258
|
fontSize: '12px',
|
|
259
259
|
fontWeight: 500,
|
|
260
|
-
color: 'var(--seekora-text-primary,
|
|
260
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
261
261
|
},
|
|
262
262
|
footer: {
|
|
263
263
|
padding: '12px 20px',
|
|
264
|
-
borderTop: '1px solid var(--seekora-border-color,
|
|
265
|
-
backgroundColor: 'var(--seekora-bg-secondary,
|
|
264
|
+
borderTop: '1px solid var(--seekora-border-color, rgba(128,128,128,0.2))',
|
|
265
|
+
backgroundColor: 'var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))',
|
|
266
266
|
display: 'flex',
|
|
267
267
|
alignItems: 'center',
|
|
268
268
|
justifyContent: 'space-between',
|
|
269
269
|
fontSize: '11px',
|
|
270
|
-
color: 'var(--seekora-text-secondary,
|
|
270
|
+
color: 'var(--seekora-text-secondary, inherit)',
|
|
271
271
|
},
|
|
272
272
|
footerLink: {
|
|
273
|
-
color: 'var(--seekora-text-primary,
|
|
273
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
274
274
|
textDecoration: 'underline',
|
|
275
275
|
cursor: 'pointer',
|
|
276
276
|
},
|
|
@@ -279,13 +279,13 @@ const createStyles = (isMobile = false) => ({
|
|
|
279
279
|
alignItems: 'center',
|
|
280
280
|
justifyContent: 'center',
|
|
281
281
|
padding: '60px',
|
|
282
|
-
color: 'var(--seekora-text-secondary,
|
|
282
|
+
color: 'var(--seekora-text-secondary, inherit)',
|
|
283
283
|
},
|
|
284
284
|
spinner: {
|
|
285
285
|
width: '24px',
|
|
286
286
|
height: '24px',
|
|
287
|
-
border: '2px solid var(--seekora-border-color,
|
|
288
|
-
borderTopColor: 'var(--seekora-text-primary,
|
|
287
|
+
border: '2px solid var(--seekora-border-color, rgba(128,128,128,0.2))',
|
|
288
|
+
borderTopColor: 'var(--seekora-text-primary, inherit)',
|
|
289
289
|
borderRadius: '50%',
|
|
290
290
|
animation: 'seekora-spin 0.8s linear infinite',
|
|
291
291
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownPanel.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/DropdownPanel.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAyC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownPanel.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/DropdownPanel.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAyC,MAAM,OAAO,CAAC;AAmB9D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAChC,0CAA0C;IAC1C,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAqB,EACrB,GAAY,EACZ,IAAQ,EACR,KAAK,EACL,KAAc,EACd,SAAkB,EAClB,MAAyB,EACzB,SAAS,EACT,KAAK,EACL,mBAA0B,EAC1B,aAAoB,GACrB,EAAE,kBAAkB,4BAqDpB"}
|
|
@@ -7,7 +7,20 @@
|
|
|
7
7
|
import React, { useRef, useEffect, useCallback } from 'react';
|
|
8
8
|
import { useSuggestionsContext } from './SuggestionsContext';
|
|
9
9
|
import { clsx } from 'clsx';
|
|
10
|
-
|
|
10
|
+
const BORDER_RADIUS = {
|
|
11
|
+
sm: 4,
|
|
12
|
+
md: 6,
|
|
13
|
+
lg: 8,
|
|
14
|
+
full: 9999,
|
|
15
|
+
};
|
|
16
|
+
// Z-index scale for consistent layering
|
|
17
|
+
const Z_INDEX = {
|
|
18
|
+
dropdown: 100,
|
|
19
|
+
modal: 200,
|
|
20
|
+
overlay: 300,
|
|
21
|
+
tooltip: 50,
|
|
22
|
+
};
|
|
23
|
+
export function DropdownPanel({ children, position = 'absolute', top = '100%', left = 0, right, width = '100%', maxHeight = '80vh', zIndex = Z_INDEX.dropdown, className, style, closeOnClickOutside = true, closeOnEscape = true, }) {
|
|
11
24
|
const { isOpen, close } = useSuggestionsContext();
|
|
12
25
|
const panelRef = useRef(null);
|
|
13
26
|
useEffect(() => {
|
|
@@ -46,7 +59,7 @@ export function DropdownPanel({ children, position = 'absolute', top = '100%', l
|
|
|
46
59
|
overflow: 'auto',
|
|
47
60
|
backgroundColor: 'var(--seekora-bg-surface, #fff)',
|
|
48
61
|
border: '1px solid var(--seekora-border-color, #e5e7eb)',
|
|
49
|
-
borderRadius:
|
|
62
|
+
borderRadius: `var(--seekora-border-radius, ${BORDER_RADIUS.md}px)`,
|
|
50
63
|
boxShadow: 'var(--seekora-shadow-lg, 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05))',
|
|
51
64
|
marginTop: 4,
|
|
52
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemCard.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/ItemCard.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"ItemCard.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/ItemCard.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAehE,sFAAsF;AACtF,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,GAAG,WAAW,CAAC;AAE/F,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,qEAAqE;IACrE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,qFAAqF;IACrF,MAAM,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACnC,mDAAmD;IACnD,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,8BAA8B;IAC9B,qBAAqB,CAAC,EAAE,mBAAmB,GAAG,gBAAgB,GAAG,QAAQ,CAAC;IAC1E,gCAAgC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AA0BD,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,KAAK,EACL,MAAa,EACb,YAAuB,EACvB,MAAmB,EACnB,aAAa,EACb,qBAA2C,EAC3C,gBAAwB,GACzB,EAAE,aAAa,qBAyFf"}
|
|
@@ -9,6 +9,17 @@ import React from 'react';
|
|
|
9
9
|
import { clsx } from 'clsx';
|
|
10
10
|
import { ImageDisplay } from '../primitives/ImageDisplay';
|
|
11
11
|
import { ActionButtons } from '../primitives/ActionButtons';
|
|
12
|
+
const TRANSITIONS = {
|
|
13
|
+
fast: '150ms ease-in-out',
|
|
14
|
+
normal: '200ms ease-in-out',
|
|
15
|
+
slow: '300ms ease-in-out',
|
|
16
|
+
};
|
|
17
|
+
const BORDER_RADIUS = {
|
|
18
|
+
sm: 4,
|
|
19
|
+
md: 6,
|
|
20
|
+
lg: 8,
|
|
21
|
+
full: 9999,
|
|
22
|
+
};
|
|
12
23
|
const cardStyle = {
|
|
13
24
|
display: 'flex',
|
|
14
25
|
flexDirection: 'column',
|
|
@@ -16,19 +27,21 @@ const cardStyle = {
|
|
|
16
27
|
padding: 8,
|
|
17
28
|
cursor: 'pointer',
|
|
18
29
|
border: 'none',
|
|
19
|
-
borderRadius:
|
|
30
|
+
borderRadius: `var(--seekora-border-radius, ${BORDER_RADIUS.md}px)`,
|
|
20
31
|
backgroundColor: 'transparent',
|
|
21
32
|
textAlign: 'left',
|
|
22
33
|
fontSize: 'inherit',
|
|
23
34
|
fontFamily: 'inherit',
|
|
24
|
-
transition:
|
|
35
|
+
transition: `background-color ${TRANSITIONS.fast}`,
|
|
25
36
|
};
|
|
26
37
|
const imgStyle = {
|
|
27
38
|
width: '100%',
|
|
28
|
-
aspectRatio: '1',
|
|
39
|
+
aspectRatio: 'var(--seekora-card-aspect-ratio, 1)',
|
|
29
40
|
objectFit: 'cover',
|
|
30
|
-
borderRadius:
|
|
41
|
+
borderRadius: BORDER_RADIUS.sm,
|
|
31
42
|
backgroundColor: 'var(--seekora-bg-secondary, #f3f4f6)',
|
|
43
|
+
display: 'block',
|
|
44
|
+
overflow: 'hidden',
|
|
32
45
|
};
|
|
33
46
|
export function ItemCard({ item, position, onSelect, className, style, asLink = true, imageVariant = 'single', layout = 'vertical', actionButtons, actionButtonsPosition = 'overlay-top-right', showActionLabels = false, }) {
|
|
34
47
|
const images = item.images?.length ? item.images : item.image ?? item.imageUrl ? [String(item.image ?? item.imageUrl)] : [];
|
|
@@ -36,12 +49,12 @@ export function ItemCard({ item, position, onSelect, className, style, asLink =
|
|
|
36
49
|
const description = item.description ?? item.secondaryText;
|
|
37
50
|
const href = item.url;
|
|
38
51
|
const isHorizontal = layout === 'horizontal';
|
|
39
|
-
const imageBlock = images.length > 0 ? (React.createElement("div", { style: { position: 'relative', ...(isHorizontal ? {
|
|
52
|
+
const imageBlock = images.length > 0 ? (React.createElement("div", { style: { position: 'relative', overflow: 'hidden', borderRadius: 4, ...(isHorizontal ? { minWidth: 80, flexBasis: '20%', maxWidth: 120, flexShrink: 0 } : {}) } },
|
|
40
53
|
React.createElement(ImageDisplay, { images: images, variant: imageVariant, alt: String(title), className: "seekora-item-card-image" }),
|
|
41
|
-
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, ...(isHorizontal ? {
|
|
54
|
+
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, ...(isHorizontal ? { minWidth: 80, flexBasis: '20%', maxWidth: 120, height: 80, flexShrink: 0 } : {}) }, "aria-hidden": true }));
|
|
42
55
|
const textBlock = (React.createElement("div", { style: isHorizontal ? { display: 'flex', flexDirection: 'column', gap: 4, flex: 1, minWidth: 0 } : undefined },
|
|
43
|
-
React.createElement("span", { className: "seekora-item-card-title", style: { fontSize: '0.875rem', fontWeight: 500 } }, String(title)),
|
|
44
|
-
description ? (React.createElement("span", { className: "seekora-item-card-description", style: { fontSize: '0.8125rem', color: 'var(--seekora-text-secondary, #6b7280)', lineHeight: 1.3 } }, String(description))) : null,
|
|
56
|
+
React.createElement("span", { className: "seekora-item-card-title", style: { fontSize: '0.875rem', fontWeight: 500, lineHeight: 1.4, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, String(title)),
|
|
57
|
+
description ? (React.createElement("span", { className: "seekora-item-card-description", style: { fontSize: '0.8125rem', color: 'var(--seekora-text-secondary, #6b7280)', lineHeight: 1.3, display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden' } }, String(description))) : null,
|
|
45
58
|
actionButtons && actionButtons.length > 0 && actionButtonsPosition === 'inline' && (React.createElement(ActionButtons, { buttons: actionButtons, position: "inline", showLabels: showActionLabels, size: "small", layout: "horizontal" }))));
|
|
46
59
|
const content = isHorizontal ? (React.createElement("div", { style: { display: 'flex', gap: 12, alignItems: 'flex-start' } },
|
|
47
60
|
imageBlock,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemGrid.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/ItemGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ItemGrid.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/ItemGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAUxD,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,WAAW;IAC5C,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,6DAA6D;IAC7D,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAChC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IACnC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,SAAS,CAAC;IAC/C,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,SAAS,CAAC;IACrD,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,SAAS,CAAC;IAC7C,8DAA8D;IAC9D,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA0BD,wBAAgB,QAAQ,CAAC,CAAC,GAAG,WAAW,EAAE,EACxC,KAAK,EACL,WAAW,EACX,SAA2C,EAC3C,YAAiD,EACjD,YAAiD,EACjD,kBAA6D,EAC7D,UAA6C,EAC7C,UAAU,EACV,QAAa,EACb,OAAW,EACX,SAAS,EACT,KAAK,EACL,aAAa,GACd,EAAE,aAAa,CAAC,CAAC,CAAC,4BA2BlB"}
|
|
@@ -8,11 +8,17 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { clsx } from 'clsx';
|
|
10
10
|
import { ItemCard } from './ItemCard';
|
|
11
|
+
const SPACING = {
|
|
12
|
+
xs: 4,
|
|
13
|
+
sm: 8,
|
|
14
|
+
md: 12,
|
|
15
|
+
lg: 16,
|
|
16
|
+
xl: 24,
|
|
17
|
+
};
|
|
11
18
|
const defaultGridStyle = {
|
|
12
19
|
display: 'grid',
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
padding: 12,
|
|
20
|
+
gap: SPACING.md,
|
|
21
|
+
padding: SPACING.md,
|
|
16
22
|
};
|
|
17
23
|
function toGenericItem(item, getItemId, getItemTitle, getItemImage, getItemDescription, getItemUrl) {
|
|
18
24
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductCard.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/ProductCard.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAA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IACtD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mDAAmD;IACnD,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,8BAA8B;IAC9B,qBAAqB,CAAC,EAAE,mBAAmB,GAAG,gBAAgB,GAAG,QAAQ,CAAC;IAC1E,gCAAgC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,sCAAsC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kGAAkG;IAClG,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACpD,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAsBD,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,QAAQ,EACR,OAAO,EACP,KAAK,EACL,QAAQ,EACR,SAAS,EACT,KAAK,EACL,YAAuB,EACvB,aAAa,EACb,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,MAAM,EACN,aAAa,EACb,qBAAgC,EAChC,gBAAwB,EACxB,eAAuB,EACvB,aAAsB,EACtB,cAAoB,GACrB,EAAE,gBAAgB,qBA+LlB"}
|
|
@@ -8,6 +8,17 @@ import React, { useMemo } from 'react';
|
|
|
8
8
|
import { clsx } from 'clsx';
|
|
9
9
|
import { ImageDisplay } from '../primitives/ImageDisplay';
|
|
10
10
|
import { extractBadges, getPriceRange, findVariantBySelections } from '../suggestions/utils';
|
|
11
|
+
const TRANSITIONS = {
|
|
12
|
+
fast: '150ms ease-in-out',
|
|
13
|
+
normal: '200ms ease-in-out',
|
|
14
|
+
slow: '300ms ease-in-out',
|
|
15
|
+
};
|
|
16
|
+
const BORDER_RADIUS = {
|
|
17
|
+
sm: 4,
|
|
18
|
+
md: 6,
|
|
19
|
+
lg: 8,
|
|
20
|
+
full: 9999,
|
|
21
|
+
};
|
|
11
22
|
import { MinimalLayout, StandardLayout, DetailedLayout, CompactLayout, HorizontalLayout, } from './ProductCardLayouts';
|
|
12
23
|
const cardStyle = {
|
|
13
24
|
display: 'flex',
|
|
@@ -16,19 +27,19 @@ const cardStyle = {
|
|
|
16
27
|
padding: 8,
|
|
17
28
|
cursor: 'pointer',
|
|
18
29
|
border: 'none',
|
|
19
|
-
borderRadius:
|
|
30
|
+
borderRadius: `var(--seekora-border-radius, ${BORDER_RADIUS.md}px)`,
|
|
20
31
|
backgroundColor: 'transparent',
|
|
21
32
|
textAlign: 'left',
|
|
22
|
-
transition:
|
|
33
|
+
transition: `background-color ${TRANSITIONS.fast}`,
|
|
23
34
|
};
|
|
24
35
|
const imgStyle = {
|
|
25
36
|
width: '100%',
|
|
26
37
|
aspectRatio: '1',
|
|
27
38
|
objectFit: 'cover',
|
|
28
|
-
borderRadius:
|
|
39
|
+
borderRadius: BORDER_RADIUS.sm,
|
|
29
40
|
backgroundColor: 'var(--seekora-bg-secondary, #f3f4f6)',
|
|
30
41
|
};
|
|
31
|
-
export function ProductCard({ product, position, section, tabId, onSelect, className, style, imageVariant = 'single', displayConfig, onVariantHover, onVariantClick, selectedVariants, asLink, actionButtons, actionButtonsPosition = '
|
|
42
|
+
export 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, }) {
|
|
32
43
|
// Find selected variant if selections are provided
|
|
33
44
|
const selectedVariant = useMemo(() => {
|
|
34
45
|
if (!selectedVariants || !product.options || !product.variants)
|
|
@@ -73,9 +84,11 @@ export function ProductCard({ product, position, section, tabId, onSelect, class
|
|
|
73
84
|
const price = effectivePrice;
|
|
74
85
|
// If no displayConfig, render original minimal layout (backwards compat)
|
|
75
86
|
if (!displayConfig) {
|
|
76
|
-
return (React.createElement("
|
|
77
|
-
e.
|
|
78
|
-
|
|
87
|
+
return (React.createElement("div", { role: "button", tabIndex: 0, className: clsx('seekora-suggestions-product-card', className), style: { ...cardStyle, ...style }, onClick: () => onSelect(), onKeyDown: (e) => {
|
|
88
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
onSelect();
|
|
91
|
+
}
|
|
79
92
|
}, "data-position": position, "data-section": section, "data-tab-id": tabId },
|
|
80
93
|
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 })),
|
|
81
94
|
React.createElement("span", { className: "seekora-suggestions-product-card-title", style: { fontSize: '0.875rem', fontWeight: 500 } }, title),
|
|
@@ -145,9 +158,11 @@ export function ProductCard({ product, position, section, tabId, onSelect, class
|
|
|
145
158
|
}, "data-position": position, "data-section": section, "data-tab-id": tabId },
|
|
146
159
|
React.createElement(LayoutComponent, { ...layoutProps })));
|
|
147
160
|
}
|
|
148
|
-
return (React.createElement("
|
|
149
|
-
e.
|
|
150
|
-
|
|
161
|
+
return (React.createElement("div", { role: "button", tabIndex: 0, className: rootClassName, style: rootStyle, onClick: () => onSelect(), onKeyDown: (e) => {
|
|
162
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
163
|
+
e.preventDefault();
|
|
164
|
+
onSelect();
|
|
165
|
+
}
|
|
151
166
|
}, "data-position": position, "data-section": section, "data-tab-id": tabId },
|
|
152
167
|
React.createElement(LayoutComponent, { ...layoutProps })));
|
|
153
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductCardLayouts.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/ProductCardLayouts.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,E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