@seekora-ai/ui-sdk-react 0.2.26 → 0.2.28
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/primitives/ImageDisplay.js +3 -3
- package/dist/components/primitives/ImageZoom.js +1 -1
- package/dist/components/suggestions/types.d.ts +2 -0
- package/dist/components/suggestions/types.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/ProductCardLayouts.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/ProductCardLayouts.js +6 -6
- package/dist/index.umd.js +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.esm.js +10 -10
- package/dist/src/index.esm.js.map +1 -1
- package/dist/src/index.js +10 -10
- package/dist/src/index.js.map +1 -1
- package/package.json +3 -3
package/dist/src/index.js
CHANGED
|
@@ -9982,7 +9982,7 @@ function ImageZoom({ src, alt = '', mode = 'both', zoomLevel = 2.5, className, s
|
|
|
9982
9982
|
const imageStyle = {
|
|
9983
9983
|
width: '100%',
|
|
9984
9984
|
height: '100%',
|
|
9985
|
-
objectFit: 'cover',
|
|
9985
|
+
objectFit: style?.objectFit ?? 'cover',
|
|
9986
9986
|
display: 'block',
|
|
9987
9987
|
};
|
|
9988
9988
|
// Compute the indicator rectangle (what portion of the image the zoom panel shows).
|
|
@@ -10347,7 +10347,7 @@ function ImageDisplay({ images, variant = 'single', alt = '', className, style,
|
|
|
10347
10347
|
if (variant === 'hover') {
|
|
10348
10348
|
const showSecond = safeImages.length > 1 && hovering;
|
|
10349
10349
|
const src = showSecond ? safeImages[1] : safeImages[0];
|
|
10350
|
-
const hoverImgStyle = style?.aspectRatio ? { ...imgBaseStyle, aspectRatio: style.aspectRatio } : imgBaseStyle;
|
|
10350
|
+
const hoverImgStyle = style?.aspectRatio || style?.objectFit ? { ...imgBaseStyle, ...(style.aspectRatio ? { aspectRatio: style.aspectRatio } : {}), ...(style.objectFit ? { objectFit: style.objectFit } : {}) } : imgBaseStyle;
|
|
10351
10351
|
if (enableZoom) {
|
|
10352
10352
|
return (React.createElement("div", { className: clsx('seekora-img-display', 'seekora-img-hover', className), style: { position: 'relative', ...style }, onMouseEnter: () => setHovering(true), onMouseLeave: () => setHovering(false) },
|
|
10353
10353
|
React.createElement(ImageZoom, { src: src, alt: alt, mode: zoomMode, zoomLevel: zoomLevel, images: safeImages, currentIndex: showSecond ? 1 : 0, className: "seekora-img-hover-img", style: hoverImgStyle })));
|
|
@@ -10366,7 +10366,7 @@ function ImageDisplay({ images, variant = 'single', alt = '', className, style,
|
|
|
10366
10366
|
return next;
|
|
10367
10367
|
});
|
|
10368
10368
|
};
|
|
10369
|
-
const carouselImgStyle = style?.aspectRatio ? { ...imgBaseStyle, aspectRatio: style.aspectRatio } : imgBaseStyle;
|
|
10369
|
+
const carouselImgStyle = style?.aspectRatio || style?.objectFit ? { ...imgBaseStyle, ...(style.aspectRatio ? { aspectRatio: style.aspectRatio } : {}), ...(style.objectFit ? { objectFit: style.objectFit } : {}) } : imgBaseStyle;
|
|
10370
10370
|
const mainImage = enableZoom ? (React.createElement(ImageZoom, { src: current, alt: alt, mode: zoomMode, zoomLevel: zoomLevel, images: safeImages, currentIndex: index, className: "seekora-img-carousel-main", style: carouselImgStyle })) : (React.createElement("img", { src: current, alt: alt, className: "seekora-img-carousel-main", style: carouselImgStyle, loading: "lazy" }));
|
|
10371
10371
|
return (React.createElement("div", { className: clsx('seekora-img-display', 'seekora-img-carousel', className), style: { position: 'relative', ...style } },
|
|
10372
10372
|
mainImage,
|
|
@@ -10398,7 +10398,7 @@ function ImageDisplay({ images, variant = 'single', alt = '', className, style,
|
|
|
10398
10398
|
} })))))))));
|
|
10399
10399
|
}
|
|
10400
10400
|
if (variant === 'thumbStrip' || variant === 'thumbList') {
|
|
10401
|
-
const thumbMainStyle = style?.aspectRatio ? { ...imgBaseStyle, aspectRatio: style.aspectRatio } : imgBaseStyle;
|
|
10401
|
+
const thumbMainStyle = style?.aspectRatio || style?.objectFit ? { ...imgBaseStyle, ...(style.aspectRatio ? { aspectRatio: style.aspectRatio } : {}), ...(style.objectFit ? { objectFit: style.objectFit } : {}) } : imgBaseStyle;
|
|
10402
10402
|
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" }));
|
|
10403
10403
|
return (React.createElement("div", { className: clsx('seekora-img-display', 'seekora-img-thumbstrip', className), style: { display: 'flex', flexDirection: 'column', gap: responsiveGap, ...style } },
|
|
10404
10404
|
mainImage,
|
|
@@ -11581,15 +11581,15 @@ const imgPlaceholderStyle = {
|
|
|
11581
11581
|
borderRadius: BORDER_RADIUS$1.sm,
|
|
11582
11582
|
backgroundColor: 'var(--seekora-bg-secondary, rgba(0,0,0,0.04))',
|
|
11583
11583
|
};
|
|
11584
|
-
function ImageBlock({ images, title, imageVariant, aspectRatio, enableZoom, zoomMode, zoomLevel }) {
|
|
11584
|
+
function ImageBlock({ images, title, imageVariant, aspectRatio, objectFit, enableZoom, zoomMode, zoomLevel }) {
|
|
11585
11585
|
const ar = aspectRatio
|
|
11586
11586
|
? (aspectRatio.includes(':') ? aspectRatio.replace(':', '/') : aspectRatio)
|
|
11587
11587
|
: '1';
|
|
11588
11588
|
if (images.length > 0) {
|
|
11589
11589
|
return (React.createElement("div", { className: "seekora-product-card__image", style: { position: 'relative', overflow: 'hidden', borderRadius: BORDER_RADIUS$1.sm } },
|
|
11590
|
-
React.createElement(ImageDisplay, { images: images, variant: images.length > 1 ? imageVariant : 'single', alt: title, className: "seekora-suggestions-product-card-image", style: { aspectRatio: ar }, enableZoom: enableZoom, zoomMode: zoomMode, zoomLevel: zoomLevel })));
|
|
11590
|
+
React.createElement(ImageDisplay, { images: images, variant: images.length > 1 ? imageVariant : 'single', alt: title, className: "seekora-suggestions-product-card-image", style: { aspectRatio: ar, ...(objectFit ? { objectFit } : {}) }, enableZoom: enableZoom, zoomMode: zoomMode, zoomLevel: zoomLevel })));
|
|
11591
11591
|
}
|
|
11592
|
-
return React.createElement("div", { className: "seekora-product-card__image seekora-suggestions-product-card-placeholder", style: { ...imgPlaceholderStyle, aspectRatio: ar }, "aria-hidden": true });
|
|
11592
|
+
return React.createElement("div", { className: "seekora-product-card__image seekora-suggestions-product-card-placeholder", style: { ...imgPlaceholderStyle, aspectRatio: ar, ...(objectFit ? { objectFit } : {}) }, "aria-hidden": true });
|
|
11593
11593
|
}
|
|
11594
11594
|
/** minimal: image, title, price (current default behavior) */
|
|
11595
11595
|
function MinimalLayout({ images, title, price, product, imageVariant, displayConfig, enableImageZoom, imageZoomMode, imageZoomLevel }) {
|
|
@@ -11597,7 +11597,7 @@ function MinimalLayout({ images, title, price, product, imageVariant, displayCon
|
|
|
11597
11597
|
const titleFontSize = isMobile ? '0.9375rem' : '0.875rem'; // Slightly larger on mobile
|
|
11598
11598
|
const priceFontSize = isMobile ? '0.9375rem' : '0.875rem';
|
|
11599
11599
|
return (React.createElement(React.Fragment, null,
|
|
11600
|
-
React.createElement(ImageBlock, { images: images, title: title, imageVariant: imageVariant, aspectRatio: displayConfig.imageAspectRatio, enableZoom: enableImageZoom, zoomMode: imageZoomMode, zoomLevel: imageZoomLevel }),
|
|
11600
|
+
React.createElement(ImageBlock, { images: images, title: title, imageVariant: imageVariant, aspectRatio: displayConfig.imageAspectRatio, objectFit: displayConfig.imageObjectFit, enableZoom: enableImageZoom, zoomMode: imageZoomMode, zoomLevel: imageZoomLevel }),
|
|
11601
11601
|
React.createElement("span", { className: "seekora-product-card__title", style: { fontSize: titleFontSize, fontWeight: 500, lineHeight: 1.4, overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical' } }, title),
|
|
11602
11602
|
price != null && !Number.isNaN(price) && (React.createElement("span", { className: "seekora-product-card__price seekora-suggestions-product-card-price", style: { fontSize: priceFontSize, color: 'inherit', opacity: 0.6 } },
|
|
11603
11603
|
product.currency ?? '$',
|
|
@@ -11615,7 +11615,7 @@ function StandardLayout({ images, title, price, comparePrice, brand, badges, opt
|
|
|
11615
11615
|
const isOverlayPosition = actionButtonsPosition?.startsWith('overlay');
|
|
11616
11616
|
return (React.createElement(React.Fragment, null,
|
|
11617
11617
|
React.createElement("div", { style: { position: 'relative' } },
|
|
11618
|
-
React.createElement(ImageBlock, { images: images, title: title, imageVariant: imageVariant, aspectRatio: cfg.imageAspectRatio, enableZoom: enableImageZoom, zoomMode: imageZoomMode, zoomLevel: imageZoomLevel }),
|
|
11618
|
+
React.createElement(ImageBlock, { images: images, title: title, imageVariant: imageVariant, aspectRatio: cfg.imageAspectRatio, objectFit: cfg.imageObjectFit, enableZoom: enableImageZoom, zoomMode: imageZoomMode, zoomLevel: imageZoomLevel }),
|
|
11619
11619
|
cfg.showBadges !== false && badges.length > 0 && (React.createElement(BadgeList, { badges: badges, position: "top-left", maxBadges: 2 })),
|
|
11620
11620
|
actionButtons && actionButtons.length > 0 && isOverlayPosition && (React.createElement(ActionButtons, { buttons: actionButtons, position: actionButtonsPosition === 'overlay-top-right' ? 'top-right' : 'bottom-center', showLabels: showActionLabels, size: "small" }))),
|
|
11621
11621
|
React.createElement("div", { className: "seekora-product-card__body", style: { display: 'flex', flexDirection: 'column', gap: bodyGap } },
|
|
@@ -11634,7 +11634,7 @@ function DetailedLayout({ images, title, price, comparePrice, brand, badges, pri
|
|
|
11634
11634
|
const isOverlayPosition = actionButtonsPosition?.startsWith('overlay');
|
|
11635
11635
|
return (React.createElement(React.Fragment, null,
|
|
11636
11636
|
React.createElement("div", { style: { position: 'relative' } },
|
|
11637
|
-
React.createElement(ImageBlock, { images: images, title: title, imageVariant: imageVariant, aspectRatio: cfg.imageAspectRatio, enableZoom: enableImageZoom, zoomMode: imageZoomMode, zoomLevel: imageZoomLevel }),
|
|
11637
|
+
React.createElement(ImageBlock, { images: images, title: title, imageVariant: imageVariant, aspectRatio: cfg.imageAspectRatio, objectFit: cfg.imageObjectFit, enableZoom: enableImageZoom, zoomMode: imageZoomMode, zoomLevel: imageZoomLevel }),
|
|
11638
11638
|
cfg.showBadges !== false && badges.length > 0 && (React.createElement(BadgeList, { badges: badges, position: "top-left" })),
|
|
11639
11639
|
actionButtons && actionButtons.length > 0 && isOverlayPosition && (React.createElement(ActionButtons, { buttons: actionButtons, position: actionButtonsPosition === 'overlay-top-right' ? 'top-right' : 'bottom-center', showLabels: showActionLabels, size: "small" }))),
|
|
11640
11640
|
React.createElement("div", { className: "seekora-product-card__body", style: { display: 'flex', flexDirection: 'column', gap: 4 } },
|