@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
|
@@ -6,6 +6,30 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { clsx } from 'clsx';
|
|
9
|
+
const SPACING = {
|
|
10
|
+
xs: 4,
|
|
11
|
+
sm: 8,
|
|
12
|
+
md: 12,
|
|
13
|
+
lg: 16,
|
|
14
|
+
xl: 24,
|
|
15
|
+
};
|
|
16
|
+
const TRANSITIONS = {
|
|
17
|
+
fast: '150ms ease-in-out',
|
|
18
|
+
normal: '200ms ease-in-out',
|
|
19
|
+
slow: '300ms ease-in-out',
|
|
20
|
+
};
|
|
21
|
+
const BORDER_RADIUS = {
|
|
22
|
+
sm: 4,
|
|
23
|
+
md: 6,
|
|
24
|
+
lg: 8,
|
|
25
|
+
full: 9999,
|
|
26
|
+
};
|
|
27
|
+
const SHADOWS = {
|
|
28
|
+
sm: '0 1px 2px rgba(0,0,0,0.05)',
|
|
29
|
+
md: '0 2px 4px rgba(0,0,0,0.1)',
|
|
30
|
+
lg: '0 4px 6px rgba(0,0,0,0.1)',
|
|
31
|
+
xl: '0 10px 15px rgba(0,0,0,0.1)',
|
|
32
|
+
};
|
|
9
33
|
const DEFAULT_ICONS = {
|
|
10
34
|
addToCart: '🛒',
|
|
11
35
|
wishlist: '♡',
|
|
@@ -21,8 +45,8 @@ const DEFAULT_LABELS = {
|
|
|
21
45
|
compare: 'Compare',
|
|
22
46
|
};
|
|
23
47
|
const BUTTON_SIZES = {
|
|
24
|
-
small: { width:
|
|
25
|
-
medium: { width:
|
|
48
|
+
small: { width: 44, height: 44, fontSize: '0.75rem', iconSize: '1rem' },
|
|
49
|
+
medium: { width: 44, height: 44, fontSize: '0.875rem', iconSize: '1.25rem' },
|
|
26
50
|
large: { width: 44, height: 44, fontSize: '1rem', iconSize: '1.5rem' },
|
|
27
51
|
};
|
|
28
52
|
export function ActionButtons({ buttons, layout = 'horizontal', position = 'inline', showLabels = false, size = 'medium', className, style, }) {
|
|
@@ -31,11 +55,11 @@ export function ActionButtons({ buttons, layout = 'horizontal', position = 'inli
|
|
|
31
55
|
const containerStyle = {
|
|
32
56
|
display: 'flex',
|
|
33
57
|
flexDirection: layout === 'vertical' ? 'column' : 'row',
|
|
34
|
-
gap:
|
|
58
|
+
gap: SPACING.sm,
|
|
35
59
|
...(isOverlay ? {
|
|
36
60
|
position: 'absolute',
|
|
37
|
-
...(position === 'top-right' ? { top:
|
|
38
|
-
...(position === 'bottom-center' ? { bottom:
|
|
61
|
+
...(position === 'top-right' ? { top: SPACING.sm, right: SPACING.sm } : {}),
|
|
62
|
+
...(position === 'bottom-center' ? { bottom: SPACING.sm, left: '50%', transform: 'translateX(-50%)' } : {}),
|
|
39
63
|
} : {}),
|
|
40
64
|
...style,
|
|
41
65
|
};
|
|
@@ -50,12 +74,12 @@ export function ActionButtons({ buttons, layout = 'horizontal', position = 'inli
|
|
|
50
74
|
fontSize: sizeConfig.fontSize,
|
|
51
75
|
fontWeight: 500,
|
|
52
76
|
border: 'none',
|
|
53
|
-
borderRadius:
|
|
54
|
-
backgroundColor: 'var(--seekora-bg-surface,
|
|
55
|
-
color: 'var(--seekora-text,
|
|
77
|
+
borderRadius: BORDER_RADIUS.md,
|
|
78
|
+
backgroundColor: 'var(--seekora-bg-surface, transparent)',
|
|
79
|
+
color: 'var(--seekora-text, inherit)',
|
|
56
80
|
cursor: 'pointer',
|
|
57
|
-
transition:
|
|
58
|
-
boxShadow:
|
|
81
|
+
transition: `all ${TRANSITIONS.fast}`,
|
|
82
|
+
boxShadow: SHADOWS.md,
|
|
59
83
|
};
|
|
60
84
|
const handleClick = (btn, e) => {
|
|
61
85
|
e.stopPropagation();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeList.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/BadgeList.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"BadgeList.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/BadgeList.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAyB7D,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,GAAG,QAAQ,CAAC;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAkBD,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,SAAS,EACT,QAAqB,EACrB,SAAS,EACT,KAAK,GACN,EAAE,cAAc,4BA4ChB"}
|
|
@@ -3,19 +3,39 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
|
+
const SPACING = {
|
|
7
|
+
xs: 4,
|
|
8
|
+
sm: 8,
|
|
9
|
+
md: 12,
|
|
10
|
+
lg: 16,
|
|
11
|
+
xl: 24,
|
|
12
|
+
};
|
|
13
|
+
const BORDER_RADIUS = {
|
|
14
|
+
sm: 4,
|
|
15
|
+
md: 6,
|
|
16
|
+
lg: 8,
|
|
17
|
+
full: 9999,
|
|
18
|
+
};
|
|
19
|
+
// Z-index scale for consistent layering
|
|
20
|
+
const Z_INDEX = {
|
|
21
|
+
dropdown: 100,
|
|
22
|
+
modal: 200,
|
|
23
|
+
overlay: 300,
|
|
24
|
+
tooltip: 50,
|
|
25
|
+
};
|
|
6
26
|
const positionStyles = {
|
|
7
|
-
'top-left': { position: 'absolute', top:
|
|
8
|
-
'top-right': { position: 'absolute', top:
|
|
9
|
-
'bottom-left': { position: 'absolute', bottom:
|
|
10
|
-
'bottom-right': { position: 'absolute', bottom:
|
|
27
|
+
'top-left': { position: 'absolute', top: SPACING.sm, left: SPACING.sm },
|
|
28
|
+
'top-right': { position: 'absolute', top: SPACING.sm, right: SPACING.sm },
|
|
29
|
+
'bottom-left': { position: 'absolute', bottom: SPACING.sm, left: SPACING.sm },
|
|
30
|
+
'bottom-right': { position: 'absolute', bottom: SPACING.sm, right: SPACING.sm },
|
|
11
31
|
inline: {},
|
|
12
32
|
};
|
|
13
33
|
const typeColors = {
|
|
14
|
-
sale: { bg: '#ef4444', text: '#fff' },
|
|
15
|
-
new: { bg: '#3b82f6', text: '#fff' },
|
|
16
|
-
soldOut: { bg: '#6b7280', text: '#fff' },
|
|
17
|
-
limited: { bg: '#f59e0b', text: '#fff' },
|
|
18
|
-
custom: { bg: '#111827', text: '#fff' },
|
|
34
|
+
sale: { bg: 'var(--seekora-badge-sale-bg, #ef4444)', text: 'var(--seekora-badge-sale-text, #fff)' },
|
|
35
|
+
new: { bg: 'var(--seekora-badge-new-bg, #3b82f6)', text: 'var(--seekora-badge-new-text, #fff)' },
|
|
36
|
+
soldOut: { bg: 'var(--seekora-badge-soldout-bg, #6b7280)', text: 'var(--seekora-badge-soldout-text, #fff)' },
|
|
37
|
+
limited: { bg: 'var(--seekora-badge-limited-bg, #f59e0b)', text: 'var(--seekora-badge-limited-text, #fff)' },
|
|
38
|
+
custom: { bg: 'var(--seekora-badge-custom-bg, #111827)', text: 'var(--seekora-badge-custom-text, #fff)' },
|
|
19
39
|
};
|
|
20
40
|
export function BadgeList({ badges, maxBadges, position = 'top-left', className, style, }) {
|
|
21
41
|
if (!badges || badges.length === 0)
|
|
@@ -24,8 +44,8 @@ export function BadgeList({ badges, maxBadges, position = 'top-left', className,
|
|
|
24
44
|
return (React.createElement("div", { className: clsx('seekora-badge-list', className), style: {
|
|
25
45
|
display: 'flex',
|
|
26
46
|
flexWrap: 'wrap',
|
|
27
|
-
gap:
|
|
28
|
-
zIndex:
|
|
47
|
+
gap: SPACING.xs,
|
|
48
|
+
zIndex: 2,
|
|
29
49
|
...positionStyles[position],
|
|
30
50
|
...style,
|
|
31
51
|
} }, visible.map((badge, i) => {
|
|
@@ -33,10 +53,10 @@ export function BadgeList({ badges, maxBadges, position = 'top-left', className,
|
|
|
33
53
|
return (React.createElement("span", { key: `${badge.text}-${i}`, className: clsx('seekora-badge', badge.type && `seekora-badge--${badge.type === 'soldOut' ? 'sold-out' : badge.type}`), style: {
|
|
34
54
|
display: 'inline-block',
|
|
35
55
|
padding: '2px 8px',
|
|
36
|
-
borderRadius:
|
|
56
|
+
borderRadius: BORDER_RADIUS.sm,
|
|
37
57
|
fontSize: '0.6875rem',
|
|
38
58
|
fontWeight: 600,
|
|
39
|
-
lineHeight: 1.
|
|
59
|
+
lineHeight: 1.2,
|
|
40
60
|
backgroundColor: badge.color ?? colors.bg,
|
|
41
61
|
color: badge.textColor ?? colors.text,
|
|
42
62
|
whiteSpace: 'nowrap',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/ImageDisplay.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,GAAG,WAAW,CAAC;AAE/F,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gCAAgC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"ImageDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/ImageDisplay.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,GAAG,WAAW,CAAC;AAE/F,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gCAAgC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAaD,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,OAAkB,EAClB,GAAQ,EACR,SAAS,EACT,KAAK,EACL,gBAAwB,EACxB,kBAAyB,EACzB,UAAkB,EAClB,QAAiB,EACjB,SAAe,EACf,QAAe,GAChB,EAAE,iBAAiB,qBAsNnB"}
|
|
@@ -9,10 +9,13 @@ import { clsx } from 'clsx';
|
|
|
9
9
|
import { ImageZoom } from './ImageZoom';
|
|
10
10
|
const imgBaseStyle = {
|
|
11
11
|
width: '100%',
|
|
12
|
+
height: 'auto',
|
|
12
13
|
aspectRatio: '1',
|
|
13
14
|
objectFit: 'cover',
|
|
14
15
|
borderRadius: 4,
|
|
15
16
|
backgroundColor: 'var(--seekora-bg-secondary, #f3f4f6)',
|
|
17
|
+
display: 'block',
|
|
18
|
+
overflow: 'hidden',
|
|
16
19
|
};
|
|
17
20
|
export function ImageDisplay({ images, variant = 'single', alt = '', className, style, carouselAutoplay = false, carouselIntervalMs = 4000, enableZoom = false, zoomMode = 'both', zoomLevel = 2.5, showDots = true, }) {
|
|
18
21
|
const [index, setIndex] = useState(0);
|
|
@@ -55,8 +58,8 @@ export function ImageDisplay({ images, variant = 'single', alt = '', className,
|
|
|
55
58
|
return (React.createElement("div", { className: clsx('seekora-img-display', 'seekora-img-carousel', className), style: { position: 'relative', ...style } },
|
|
56
59
|
mainImage,
|
|
57
60
|
safeImages.length > 1 && (React.createElement(React.Fragment, null,
|
|
58
|
-
React.createElement("button", { type: "button", "aria-label": "Previous", className: "seekora-img-carousel-prev", style: arrowStyle(true), onMouseDown: (e) => { e.stopPropagation(); e.preventDefault(); go(-1); }, onClick: (e) => e.stopPropagation(), onMouseEnter: (e) => { e.currentTarget.style.backgroundColor = 'rgba(255,255,255,1)'; }, onMouseLeave: (e) => { e.currentTarget.style.backgroundColor = 'rgba(255,255,255,0.9)'; } }, "\u2039"),
|
|
59
|
-
React.createElement("button", { type: "button", "aria-label": "Next", className: "seekora-img-carousel-next", style: arrowStyle(false), onMouseDown: (e) => { e.stopPropagation(); e.preventDefault(); go(1); }, onClick: (e) => e.stopPropagation(), onMouseEnter: (e) => { e.currentTarget.style.backgroundColor = 'rgba(255,255,255,1)'; }, onMouseLeave: (e) => { e.currentTarget.style.backgroundColor = 'rgba(255,255,255,0.9)'; } }, "\u203A"),
|
|
61
|
+
React.createElement("button", { type: "button", "aria-label": "Previous", className: "seekora-img-carousel-prev", style: arrowStyle(true), onMouseDown: (e) => { e.stopPropagation(); e.preventDefault(); go(-1); }, onClick: (e) => { e.stopPropagation(); e.preventDefault(); }, onMouseEnter: (e) => { e.currentTarget.style.backgroundColor = 'var(--seekora-carousel-btn-bg-hover, rgba(255,255,255,1))'; }, onMouseLeave: (e) => { e.currentTarget.style.backgroundColor = 'var(--seekora-carousel-btn-bg, rgba(255,255,255,0.9))'; } }, "\u2039"),
|
|
62
|
+
React.createElement("button", { type: "button", "aria-label": "Next", className: "seekora-img-carousel-next", style: arrowStyle(false), onMouseDown: (e) => { e.stopPropagation(); e.preventDefault(); go(1); }, onClick: (e) => { e.stopPropagation(); e.preventDefault(); }, onMouseEnter: (e) => { e.currentTarget.style.backgroundColor = 'var(--seekora-carousel-btn-bg-hover, rgba(255,255,255,1))'; }, onMouseLeave: (e) => { e.currentTarget.style.backgroundColor = 'var(--seekora-carousel-btn-bg, rgba(255,255,255,0.9))'; } }, "\u203A"),
|
|
60
63
|
showDots && (React.createElement("div", { className: "seekora-img-carousel-dots", style: {
|
|
61
64
|
position: 'absolute',
|
|
62
65
|
bottom: 8,
|
|
@@ -65,16 +68,16 @@ export function ImageDisplay({ images, variant = 'single', alt = '', className,
|
|
|
65
68
|
display: 'flex',
|
|
66
69
|
gap: 6,
|
|
67
70
|
padding: '6px 12px',
|
|
68
|
-
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
71
|
+
backgroundColor: 'var(--seekora-carousel-dots-bg, rgba(0,0,0,0.5))',
|
|
69
72
|
borderRadius: 12,
|
|
70
73
|
zIndex: 10,
|
|
71
|
-
} }, safeImages.map((_, i) => (React.createElement("button", { key: i, type: "button", "aria-label": `Go to image ${i + 1}`, onMouseDown: (e) => { e.stopPropagation(); e.preventDefault(); }, onClick: (e) => { e.stopPropagation(); setIndex(i); }, style: {
|
|
74
|
+
} }, safeImages.map((_, i) => (React.createElement("button", { key: i, type: "button", "aria-label": `Go to image ${i + 1}`, onMouseDown: (e) => { e.stopPropagation(); e.preventDefault(); }, onClick: (e) => { e.stopPropagation(); e.preventDefault(); setIndex(i); }, style: {
|
|
72
75
|
width: 8,
|
|
73
76
|
height: 8,
|
|
74
77
|
borderRadius: '50%',
|
|
75
78
|
border: 'none',
|
|
76
79
|
padding: 0,
|
|
77
|
-
backgroundColor: i === index ? '#fff' : 'rgba(255,255,255,0.5)',
|
|
80
|
+
backgroundColor: i === index ? 'var(--seekora-carousel-dot-active, #fff)' : 'var(--seekora-carousel-dot, rgba(255,255,255,0.5))',
|
|
78
81
|
cursor: 'pointer',
|
|
79
82
|
transition: 'all 150ms ease',
|
|
80
83
|
} })))))))));
|
|
@@ -84,7 +87,7 @@ export function ImageDisplay({ images, variant = 'single', alt = '', className,
|
|
|
84
87
|
const mainImage = enableZoom ? (React.createElement(ImageZoom, { src: current, alt: alt, mode: zoomMode, zoomLevel: zoomLevel, images: safeImages, currentIndex: index, className: "seekora-img-thumb-main", style: thumbMainStyle })) : (React.createElement("img", { src: current, alt: alt, className: "seekora-img-thumb-main", style: thumbMainStyle, loading: "lazy" }));
|
|
85
88
|
return (React.createElement("div", { className: clsx('seekora-img-display', 'seekora-img-thumbstrip', className), style: { display: 'flex', flexDirection: 'column', gap: 8, ...style } },
|
|
86
89
|
mainImage,
|
|
87
|
-
React.createElement("div", { className: "seekora-img-thumbs", style: { display: 'flex', gap: 4, overflowX: 'auto', paddingBottom: 4 } }, safeImages.map((src, i) => (React.createElement("button", { type: "button", key: i, className: clsx('seekora-img-thumb', i === index && 'seekora-img-thumb--active'), style: { flexShrink: 0, width: 48, height: 48, padding: 0, border: i === index ? '2px solid var(--seekora-primary)' : '1px solid transparent', borderRadius: 4, overflow: 'hidden', cursor: 'pointer', background: 'none' }, onMouseDown: (e) => { e.stopPropagation(); e.preventDefault(); setIndex(i); }, onClick: (e) => e.stopPropagation() },
|
|
90
|
+
React.createElement("div", { className: "seekora-img-thumbs", style: { display: 'flex', gap: 4, overflowX: 'auto', paddingBottom: 4 } }, safeImages.map((src, i) => (React.createElement("button", { type: "button", key: i, className: clsx('seekora-img-thumb', i === index && 'seekora-img-thumb--active'), style: { flexShrink: 0, width: 48, height: 48, padding: 0, border: i === index ? '2px solid var(--seekora-primary)' : '1px solid transparent', borderRadius: 4, overflow: 'hidden', cursor: 'pointer', background: 'none' }, onMouseDown: (e) => { e.stopPropagation(); e.preventDefault(); setIndex(i); }, onClick: (e) => { e.stopPropagation(); e.preventDefault(); } },
|
|
88
91
|
React.createElement("img", { src: src, alt: "", style: { width: '100%', height: '100%', objectFit: 'cover' } })))))));
|
|
89
92
|
}
|
|
90
93
|
return React.createElement("img", { src: current, alt: alt, className: clsx('seekora-img-display', className), style: { ...imgBaseStyle, ...style }, loading: "lazy" });
|
|
@@ -99,8 +102,8 @@ function arrowStyle(left) {
|
|
|
99
102
|
height: 32,
|
|
100
103
|
borderRadius: '50%',
|
|
101
104
|
border: 'none',
|
|
102
|
-
backgroundColor: 'rgba(255, 255, 255, 0.9)',
|
|
103
|
-
color: '#111',
|
|
105
|
+
backgroundColor: 'var(--seekora-carousel-btn-bg, rgba(255, 255, 255, 0.9))',
|
|
106
|
+
color: 'var(--seekora-carousel-btn-text, #111)',
|
|
104
107
|
fontSize: '1.25rem',
|
|
105
108
|
fontWeight: 'bold',
|
|
106
109
|
cursor: 'pointer',
|
|
@@ -126,8 +126,8 @@ export function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, class
|
|
|
126
126
|
backgroundRepeat: 'no-repeat',
|
|
127
127
|
border: '2px solid var(--seekora-border-color, #e5e7eb)',
|
|
128
128
|
borderRadius: 8,
|
|
129
|
-
boxShadow: '0 8px 24px rgba(0,0,0,0.2)',
|
|
130
|
-
backgroundColor: '#fff',
|
|
129
|
+
boxShadow: 'var(--seekora-zoom-panel-shadow, 0 8px 24px rgba(0,0,0,0.2))',
|
|
130
|
+
backgroundColor: 'var(--seekora-zoom-panel-bg, #fff)',
|
|
131
131
|
pointerEvents: 'none',
|
|
132
132
|
zIndex: 9998,
|
|
133
133
|
};
|
|
@@ -142,9 +142,9 @@ export function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, class
|
|
|
142
142
|
height: lensSize,
|
|
143
143
|
left: cursorPos.x - lensSize / 2,
|
|
144
144
|
top: cursorPos.y - lensSize / 2,
|
|
145
|
-
border: '2px solid rgba(255,255,255,0.8)',
|
|
145
|
+
border: 'var(--seekora-lens-border, 2px solid rgba(255,255,255,0.8))',
|
|
146
146
|
borderRadius: '50%',
|
|
147
|
-
boxShadow: '0 0 0 1px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(0,0,0,0.3)',
|
|
147
|
+
boxShadow: 'var(--seekora-lens-shadow, 0 0 0 1px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(0,0,0,0.3))',
|
|
148
148
|
pointerEvents: 'none',
|
|
149
149
|
overflow: 'hidden',
|
|
150
150
|
zIndex: 100,
|
|
@@ -174,8 +174,8 @@ export function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, class
|
|
|
174
174
|
width: 32,
|
|
175
175
|
height: 32,
|
|
176
176
|
borderRadius: '50%',
|
|
177
|
-
backgroundColor: 'rgba(0,0,0,0.6)',
|
|
178
|
-
color: '#fff',
|
|
177
|
+
backgroundColor: 'var(--seekora-zoom-indicator-bg, rgba(0,0,0,0.6))',
|
|
178
|
+
color: 'var(--seekora-zoom-indicator-text, #fff)',
|
|
179
179
|
display: 'flex',
|
|
180
180
|
alignItems: 'center',
|
|
181
181
|
justifyContent: 'center',
|
|
@@ -192,8 +192,8 @@ export function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, class
|
|
|
192
192
|
top: cursorPos.y - 75,
|
|
193
193
|
width: 150,
|
|
194
194
|
height: 150,
|
|
195
|
-
border: '2px solid rgba(0,0,0,0.3)',
|
|
196
|
-
backgroundColor: 'rgba(255,255,255,0.1)',
|
|
195
|
+
border: 'var(--seekora-hover-area-border, 2px solid rgba(0,0,0,0.3))',
|
|
196
|
+
backgroundColor: 'var(--seekora-hover-area-bg, rgba(255,255,255,0.1))',
|
|
197
197
|
pointerEvents: 'none',
|
|
198
198
|
zIndex: 50,
|
|
199
199
|
} })),
|
|
@@ -204,7 +204,7 @@ export function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, class
|
|
|
204
204
|
left: 0,
|
|
205
205
|
right: 0,
|
|
206
206
|
bottom: 0,
|
|
207
|
-
backgroundColor: 'rgba(0,0,0,0.95)',
|
|
207
|
+
backgroundColor: 'var(--seekora-lightbox-bg, rgba(0,0,0,0.95))',
|
|
208
208
|
zIndex: 9999,
|
|
209
209
|
display: 'flex',
|
|
210
210
|
alignItems: 'center',
|
|
@@ -220,8 +220,8 @@ export function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, class
|
|
|
220
220
|
height: 44,
|
|
221
221
|
borderRadius: '50%',
|
|
222
222
|
border: 'none',
|
|
223
|
-
backgroundColor: 'rgba(255,255,255,0.2)',
|
|
224
|
-
color: '#fff',
|
|
223
|
+
backgroundColor: 'var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))',
|
|
224
|
+
color: 'var(--seekora-lightbox-btn-text, #fff)',
|
|
225
225
|
fontSize: '1.5rem',
|
|
226
226
|
cursor: 'pointer',
|
|
227
227
|
display: 'flex',
|
|
@@ -233,9 +233,9 @@ export function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, class
|
|
|
233
233
|
e.stopPropagation();
|
|
234
234
|
closeLightbox();
|
|
235
235
|
}, onMouseEnter: (e) => {
|
|
236
|
-
e.currentTarget.style.backgroundColor = 'rgba(255,255,255,0.3)';
|
|
236
|
+
e.currentTarget.style.backgroundColor = 'var(--seekora-lightbox-btn-bg-hover, rgba(255,255,255,0.3))';
|
|
237
237
|
}, onMouseLeave: (e) => {
|
|
238
|
-
e.currentTarget.style.backgroundColor = 'rgba(255,255,255,0.2)';
|
|
238
|
+
e.currentTarget.style.backgroundColor = 'var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))';
|
|
239
239
|
} }, "\u2715"),
|
|
240
240
|
hasMultipleImages && (React.createElement(React.Fragment, null,
|
|
241
241
|
React.createElement("button", { type: "button", "aria-label": "Previous image", style: {
|
|
@@ -247,8 +247,8 @@ export function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, class
|
|
|
247
247
|
height: 56,
|
|
248
248
|
borderRadius: '50%',
|
|
249
249
|
border: 'none',
|
|
250
|
-
backgroundColor: 'rgba(255,255,255,0.2)',
|
|
251
|
-
color: '#fff',
|
|
250
|
+
backgroundColor: 'var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))',
|
|
251
|
+
color: 'var(--seekora-lightbox-btn-text, #fff)',
|
|
252
252
|
fontSize: '2rem',
|
|
253
253
|
fontWeight: 'bold',
|
|
254
254
|
cursor: 'pointer',
|
|
@@ -261,9 +261,9 @@ export function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, class
|
|
|
261
261
|
e.stopPropagation();
|
|
262
262
|
goToPrev();
|
|
263
263
|
}, onMouseEnter: (e) => {
|
|
264
|
-
e.currentTarget.style.backgroundColor = 'rgba(255,255,255,0.3)';
|
|
264
|
+
e.currentTarget.style.backgroundColor = 'var(--seekora-lightbox-btn-bg-hover, rgba(255,255,255,0.3))';
|
|
265
265
|
}, onMouseLeave: (e) => {
|
|
266
|
-
e.currentTarget.style.backgroundColor = 'rgba(255,255,255,0.2)';
|
|
266
|
+
e.currentTarget.style.backgroundColor = 'var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))';
|
|
267
267
|
} }, "\u2039"),
|
|
268
268
|
React.createElement("button", { type: "button", "aria-label": "Next image", style: {
|
|
269
269
|
position: 'absolute',
|
|
@@ -274,8 +274,8 @@ export function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, class
|
|
|
274
274
|
height: 56,
|
|
275
275
|
borderRadius: '50%',
|
|
276
276
|
border: 'none',
|
|
277
|
-
backgroundColor: 'rgba(255,255,255,0.2)',
|
|
278
|
-
color: '#fff',
|
|
277
|
+
backgroundColor: 'var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))',
|
|
278
|
+
color: 'var(--seekora-lightbox-btn-text, #fff)',
|
|
279
279
|
fontSize: '2rem',
|
|
280
280
|
fontWeight: 'bold',
|
|
281
281
|
cursor: 'pointer',
|
|
@@ -288,9 +288,9 @@ export function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, class
|
|
|
288
288
|
e.stopPropagation();
|
|
289
289
|
goToNext();
|
|
290
290
|
}, onMouseEnter: (e) => {
|
|
291
|
-
e.currentTarget.style.backgroundColor = 'rgba(255,255,255,0.3)';
|
|
291
|
+
e.currentTarget.style.backgroundColor = 'var(--seekora-lightbox-btn-bg-hover, rgba(255,255,255,0.3))';
|
|
292
292
|
}, onMouseLeave: (e) => {
|
|
293
|
-
e.currentTarget.style.backgroundColor = 'rgba(255,255,255,0.2)';
|
|
293
|
+
e.currentTarget.style.backgroundColor = 'var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))';
|
|
294
294
|
} }, "\u203A"))),
|
|
295
295
|
React.createElement("img", { src: allImages[lightboxIndex], alt: alt, style: {
|
|
296
296
|
maxWidth: '90%',
|
|
@@ -316,7 +316,7 @@ export function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, class
|
|
|
316
316
|
width: 60,
|
|
317
317
|
height: 60,
|
|
318
318
|
padding: 0,
|
|
319
|
-
border: i === lightboxIndex ? '3px solid #fff' : '2px solid rgba(255,255,255,0.3)',
|
|
319
|
+
border: i === lightboxIndex ? 'var(--seekora-lightbox-thumb-border-active, 3px solid #fff)' : 'var(--seekora-lightbox-thumb-border, 2px solid rgba(255,255,255,0.3))',
|
|
320
320
|
borderRadius: 4,
|
|
321
321
|
overflow: 'hidden',
|
|
322
322
|
cursor: 'pointer',
|
|
@@ -332,10 +332,10 @@ export function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, class
|
|
|
332
332
|
} },
|
|
333
333
|
React.createElement("img", { src: img, alt: "", style: { width: '100%', height: '100%', objectFit: 'cover' } }))))),
|
|
334
334
|
React.createElement("div", { style: {
|
|
335
|
-
color: 'rgba(255,255,255,0.9)',
|
|
335
|
+
color: 'var(--seekora-lightbox-counter-text, rgba(255,255,255,0.9))',
|
|
336
336
|
fontSize: '0.875rem',
|
|
337
337
|
textAlign: 'center',
|
|
338
|
-
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
338
|
+
backgroundColor: 'var(--seekora-lightbox-counter-bg, rgba(0,0,0,0.5))',
|
|
339
339
|
padding: '4px 12px',
|
|
340
340
|
borderRadius: 12,
|
|
341
341
|
} },
|
|
@@ -347,10 +347,10 @@ export function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, class
|
|
|
347
347
|
top: 20,
|
|
348
348
|
left: '50%',
|
|
349
349
|
transform: 'translateX(-50%)',
|
|
350
|
-
color: 'rgba(255,255,255,0.7)',
|
|
350
|
+
color: 'var(--seekora-lightbox-instructions-text, rgba(255,255,255,0.7))',
|
|
351
351
|
fontSize: '0.875rem',
|
|
352
352
|
textAlign: 'center',
|
|
353
|
-
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
353
|
+
backgroundColor: 'var(--seekora-lightbox-instructions-bg, rgba(0,0,0,0.5))',
|
|
354
354
|
padding: '8px 16px',
|
|
355
355
|
borderRadius: 12,
|
|
356
356
|
} }, hasMultipleImages ? 'Use arrow keys or click thumbnails to navigate • ESC to close' : 'Click outside or press ESC to close')))));
|
|
@@ -76,10 +76,10 @@ export function VariantSelector({ options, variants, selections, onSelectionChan
|
|
|
76
76
|
fontSize: '0.875rem',
|
|
77
77
|
fontWeight: 600,
|
|
78
78
|
marginBottom: 8,
|
|
79
|
-
color: 'var(--seekora-text-primary,
|
|
79
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
80
80
|
} },
|
|
81
81
|
option.name,
|
|
82
|
-
selected && (React.createElement("span", { style: { fontWeight: 400, marginLeft: 6, color: 'var(--seekora-text-secondary,
|
|
82
|
+
selected && (React.createElement("span", { style: { fontWeight: 400, marginLeft: 6, color: 'var(--seekora-text-secondary, inherit)' } }, selected))),
|
|
83
83
|
mode === 'dropdown' ? (React.createElement("select", { className: "seekora-variant-dropdown", value: selected ?? '', onChange: (e) => {
|
|
84
84
|
e.stopPropagation();
|
|
85
85
|
onSelectionChange(option.name, e.target.value);
|
|
@@ -87,9 +87,9 @@ export function VariantSelector({ options, variants, selections, onSelectionChan
|
|
|
87
87
|
padding: '8px 12px',
|
|
88
88
|
fontSize: '0.875rem',
|
|
89
89
|
borderRadius: 6,
|
|
90
|
-
border: '1px solid var(--seekora-border-color,
|
|
91
|
-
backgroundColor: 'var(--seekora-bg-surface,
|
|
92
|
-
color: 'var(--seekora-text-primary,
|
|
90
|
+
border: '1px solid var(--seekora-border-color, rgba(128,128,128,0.2))',
|
|
91
|
+
backgroundColor: 'var(--seekora-bg-surface, transparent)',
|
|
92
|
+
color: 'var(--seekora-text-primary, inherit)',
|
|
93
93
|
cursor: 'pointer',
|
|
94
94
|
minWidth: 120,
|
|
95
95
|
} },
|
|
@@ -123,7 +123,7 @@ export function VariantSelector({ options, variants, selections, onSelectionChan
|
|
|
123
123
|
backgroundColor: color,
|
|
124
124
|
border: isActive
|
|
125
125
|
? '2px solid var(--seekora-primary, #111827)'
|
|
126
|
-
: '1px solid var(--seekora-border-color,
|
|
126
|
+
: '1px solid var(--seekora-border-color, rgba(128,128,128,0.2))',
|
|
127
127
|
outline: isActive ? '2px solid var(--seekora-primary, #111827)' : 'none',
|
|
128
128
|
outlineOffset: 2,
|
|
129
129
|
cursor: available ? 'pointer' : 'not-allowed',
|
|
@@ -144,13 +144,13 @@ export function VariantSelector({ options, variants, selections, onSelectionChan
|
|
|
144
144
|
borderRadius: 6,
|
|
145
145
|
border: isActive
|
|
146
146
|
? '2px solid var(--seekora-primary, #111827)'
|
|
147
|
-
: '1px solid var(--seekora-border-color,
|
|
147
|
+
: '1px solid var(--seekora-border-color, rgba(128,128,128,0.2))',
|
|
148
148
|
backgroundColor: isActive
|
|
149
149
|
? 'var(--seekora-primary, #111827)'
|
|
150
|
-
: 'var(--seekora-bg-surface,
|
|
150
|
+
: 'var(--seekora-bg-surface, transparent)',
|
|
151
151
|
color: isActive
|
|
152
|
-
? '
|
|
153
|
-
: 'var(--seekora-text-primary,
|
|
152
|
+
? 'transparent'
|
|
153
|
+
: 'var(--seekora-text-primary, inherit)',
|
|
154
154
|
cursor: available ? 'pointer' : 'not-allowed',
|
|
155
155
|
opacity: available ? 1 : 0.5,
|
|
156
156
|
textDecoration: !available ? 'line-through' : 'none',
|
|
@@ -109,7 +109,7 @@ export function VariantSwatches({ options, visibleOptions, maxValues = 5, colorM
|
|
|
109
109
|
outlineOffset: 2,
|
|
110
110
|
cursor: onSwatchClick && isAvailable ? 'pointer' : 'not-allowed',
|
|
111
111
|
flexShrink: 0,
|
|
112
|
-
boxShadow: isSelected ? '0 0 0 1px #fff' : 'none',
|
|
112
|
+
boxShadow: isSelected ? 'var(--seekora-swatch-ring, 0 0 0 1px #fff)' : 'none',
|
|
113
113
|
opacity: isAvailable ? 1 : 0.3,
|
|
114
114
|
position: 'relative',
|
|
115
115
|
}, onMouseEnter: () => isAvailable && onSwatchHover?.(option.name, value), onMouseDown: (e) => {
|
|
@@ -126,7 +126,7 @@ export function VariantSwatches({ options, visibleOptions, maxValues = 5, colorM
|
|
|
126
126
|
left: '-2px',
|
|
127
127
|
right: '-2px',
|
|
128
128
|
height: 1,
|
|
129
|
-
backgroundColor: '#ef4444',
|
|
129
|
+
backgroundColor: 'var(--seekora-unavailable-line, #ef4444)',
|
|
130
130
|
transform: 'translateY(-50%) rotate(-45deg)',
|
|
131
131
|
} }))));
|
|
132
132
|
}
|
|
@@ -142,7 +142,7 @@ export function VariantSwatches({ options, visibleOptions, maxValues = 5, colorM
|
|
|
142
142
|
? 'var(--seekora-primary, #111827)'
|
|
143
143
|
: 'transparent',
|
|
144
144
|
color: isSelected
|
|
145
|
-
? '#fff'
|
|
145
|
+
? 'var(--seekora-primary-text, #fff)'
|
|
146
146
|
: 'var(--seekora-text-secondary, #6b7280)',
|
|
147
147
|
cursor: onSwatchClick && isAvailable ? 'pointer' : 'not-allowed',
|
|
148
148
|
whiteSpace: 'nowrap',
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { type ImageDisplayVariant } from '../primitives/ImageDisplay';
|
|
9
|
+
import type { ImageZoomMode } from '../primitives/ImageZoom';
|
|
9
10
|
export interface ProductGalleryProps {
|
|
10
11
|
images: string[];
|
|
11
12
|
variant?: ImageDisplayVariant;
|
|
@@ -14,6 +15,12 @@ export interface ProductGalleryProps {
|
|
|
14
15
|
style?: React.CSSProperties;
|
|
15
16
|
carouselAutoplay?: boolean;
|
|
16
17
|
carouselIntervalMs?: number;
|
|
18
|
+
/** Enable zoom functionality on product images */
|
|
19
|
+
enableZoom?: boolean;
|
|
20
|
+
/** Zoom mode: 'hover' (Amazon-style), 'lens', 'click' (lightbox), 'both' */
|
|
21
|
+
zoomMode?: ImageZoomMode;
|
|
22
|
+
/** Zoom magnification level (2 = 200%, 3 = 300%) */
|
|
23
|
+
zoomLevel?: number;
|
|
17
24
|
}
|
|
18
|
-
export declare function ProductGallery({ images, variant, alt, className, style, carouselAutoplay, carouselIntervalMs, }: ProductGalleryProps): React.JSX.Element;
|
|
25
|
+
export declare function ProductGallery({ images, variant, alt, className, style, carouselAutoplay, carouselIntervalMs, enableZoom, zoomMode, zoomLevel, }: ProductGalleryProps): React.JSX.Element;
|
|
19
26
|
//# sourceMappingURL=ProductGallery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductGallery.d.ts","sourceRoot":"","sources":["../../../src/components/product-page/ProductGallery.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductGallery.d.ts","sourceRoot":"","sources":["../../../src/components/product-page/ProductGallery.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,OAAsB,EACtB,GAAe,EACf,SAAS,EACT,KAAK,EACL,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,QAAQ,EACR,SAAS,GACV,EAAE,mBAAmB,qBAerB"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { clsx } from 'clsx';
|
|
9
9
|
import { ImageDisplay } from '../primitives/ImageDisplay';
|
|
10
|
-
export function ProductGallery({ images, variant = 'thumbStrip', alt = 'Product', className, style, carouselAutoplay, carouselIntervalMs, }) {
|
|
10
|
+
export function ProductGallery({ images, variant = 'thumbStrip', alt = 'Product', className, style, carouselAutoplay, carouselIntervalMs, enableZoom, zoomMode, zoomLevel, }) {
|
|
11
11
|
return (React.createElement("div", { className: clsx('seekora-product-gallery', className), style: style },
|
|
12
|
-
React.createElement(ImageDisplay, { images: images, variant: variant, alt: alt, carouselAutoplay: carouselAutoplay, carouselIntervalMs: carouselIntervalMs })));
|
|
12
|
+
React.createElement(ImageDisplay, { images: images, variant: variant, alt: alt, carouselAutoplay: carouselAutoplay, carouselIntervalMs: carouselIntervalMs, enableZoom: enableZoom, zoomMode: zoomMode, zoomLevel: zoomLevel })));
|
|
13
13
|
}
|
|
@@ -18,6 +18,8 @@ export interface SectionSearchProviderProps {
|
|
|
18
18
|
sortBy?: string;
|
|
19
19
|
enabled?: boolean;
|
|
20
20
|
sectionId?: string;
|
|
21
|
+
/** Additional search options merged into the request (e.g. { widget_mode: false }). */
|
|
22
|
+
searchOptions?: Record<string, unknown>;
|
|
21
23
|
}
|
|
22
|
-
export declare function SectionSearchProvider({ children, query, refinements, maxItems, sortBy, enabled, sectionId, }: SectionSearchProviderProps): React.JSX.Element;
|
|
24
|
+
export declare function SectionSearchProvider({ children, query, refinements, maxItems, sortBy, enabled, sectionId, searchOptions, }: SectionSearchProviderProps): React.JSX.Element;
|
|
23
25
|
//# sourceMappingURL=SectionSearchProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionSearchProvider.d.ts","sourceRoot":"","sources":["../../../src/components/section-primitives/SectionSearchProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAoD,MAAM,OAAO,CAAC;AAIzE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"SectionSearchProvider.d.ts","sourceRoot":"","sources":["../../../src/components/section-primitives/SectionSearchProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAoD,MAAM,OAAO,CAAC;AAIzE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAsBD,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,KAAK,EACL,WAAgB,EAChB,QAAa,EACb,MAAM,EACN,OAAc,EACd,SAAS,EACT,aAAa,GACd,EAAE,0BAA0B,qBAiF5B"}
|
|
@@ -35,7 +35,7 @@ function extractTotal(response) {
|
|
|
35
35
|
return Number(data.data.total_results);
|
|
36
36
|
return 0;
|
|
37
37
|
}
|
|
38
|
-
export function SectionSearchProvider({ children, query, refinements = [], maxItems = 12, sortBy, enabled = true, sectionId, }) {
|
|
38
|
+
export function SectionSearchProvider({ children, query, refinements = [], maxItems = 12, sortBy, enabled = true, sectionId, searchOptions, }) {
|
|
39
39
|
const { client } = useSearchContext();
|
|
40
40
|
const [items, setItems] = useState([]);
|
|
41
41
|
const [loading, setLoading] = useState(true);
|
|
@@ -53,6 +53,7 @@ export function SectionSearchProvider({ children, query, refinements = [], maxIt
|
|
|
53
53
|
setLoading(true);
|
|
54
54
|
setError(null);
|
|
55
55
|
const options = {
|
|
56
|
+
...searchOptions,
|
|
56
57
|
per_page: maxItems,
|
|
57
58
|
page: 1,
|
|
58
59
|
};
|
|
@@ -80,7 +81,7 @@ export function SectionSearchProvider({ children, query, refinements = [], maxIt
|
|
|
80
81
|
return () => {
|
|
81
82
|
cancelled = true;
|
|
82
83
|
};
|
|
83
|
-
}, [client, enabled, query, maxItems, sortBy, refinements]);
|
|
84
|
+
}, [client, enabled, query, maxItems, sortBy, refinements, searchOptions]);
|
|
84
85
|
const trackClick = useCallback((item, position) => {
|
|
85
86
|
if (!client?.trackEvent)
|
|
86
87
|
return;
|