@ikas/bp-storefront 0.24.0 → 0.26.0

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.
@@ -6,22 +6,23 @@ import { BackInStockNotificationForm, IkasAppliedCampaignAmount, IkasProductAttr
6
6
  * @ai-related getSelectedProductVariant
7
7
  *
8
8
  * @param variant - The product variant
9
- * @returns The first image of the variant, or undefined if no images
9
+ * @returns The first IkasProductImage of the variant, or undefined if no images. Access `.image` to get the IkasImage for CDN helpers.
10
10
  *
11
11
  * @example
12
12
  * ```typescript
13
- * import { getProductVariantMainImage, getSelectedProductVariant } from "@ikas/bp-storefront";
13
+ * import { getProductVariantMainImage, getSelectedProductVariant, getDefaultSrc } from "@ikas/bp-storefront";
14
14
  * import { IkasProduct } from "@ikas/bp-storefront";
15
15
  *
16
16
  * function ProductImage({ product }: { product: IkasProduct }) {
17
17
  * const variant = getSelectedProductVariant(product);
18
- * const mainImage = getProductVariantMainImage(variant);
18
+ * const productImage = getProductVariantMainImage(variant);
19
+ * const image = productImage?.image;
19
20
  *
20
- * if (!mainImage) {
21
+ * if (!image) {
21
22
  * return <div className="no-image">No image available</div>;
22
23
  * }
23
24
  *
24
- * return <img src={mainImage.src} alt={product.name} />;
25
+ * return <img src={getDefaultSrc(image)} alt={product.name} />;
25
26
  * }
26
27
  * ```
27
28
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/bp-storefront",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "description": "A framework for the ikas blueprint storefronts.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",