@ikas/code-components-mcp 1.4.0-beta.17 → 1.4.0-beta.171

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.
Files changed (94) hide show
  1. package/data/framework.json +108 -17
  2. package/data/migration.json +10 -4
  3. package/data/section-templates/account-info-section/children/AccountFavorites/ikas-config-snippet.json +13 -0
  4. package/data/section-templates/account-info-section/children/AccountOrders/index.tsx +1 -1
  5. package/data/section-templates/account-info-section/ikas-config-snippet.json +19 -0
  6. package/data/section-templates/add-to-cart/ikas-config-snippet.json +17 -0
  7. package/data/section-templates/add-to-cart/index.tsx +16 -2
  8. package/data/section-templates/add-to-cart/sub-components/QuantitySelector/index.tsx +11 -3
  9. package/data/section-templates/add-to-cart/utils/cartLimits.ts +24 -0
  10. package/data/section-templates/blog-home-section/ikas-config-snippet.json +2 -0
  11. package/data/section-templates/blog-home-section/index.tsx +2 -1
  12. package/data/section-templates/blog-post-section/ikas-config-snippet.json +2 -0
  13. package/data/section-templates/blog-post-section/index.tsx +3 -2
  14. package/data/section-templates/bundle-products/hooks/useBundleProducts.ts +7 -6
  15. package/data/section-templates/bundle-products/ikas-config-snippet.json +20 -0
  16. package/data/section-templates/cart-section/components/EmptyState/index.tsx +1 -1
  17. package/data/section-templates/cart-section/sub-components/CartItem/index.tsx +66 -24
  18. package/data/section-templates/cart-section/sub-components/CartItem/styles.css +14 -0
  19. package/data/section-templates/cart-section/sub-components/QuantitySelector/index.tsx +11 -3
  20. package/data/section-templates/cart-section/utils/cartLimits.ts +24 -0
  21. package/data/section-templates/cart-section/utils/cartLineLimits.ts +100 -0
  22. package/data/section-templates/category-images-section/children/CategoryImageItem/ikas-config-snippet.json +4 -0
  23. package/data/section-templates/category-images-section/ikas-config-snippet.json +15 -0
  24. package/data/section-templates/category-list-section/children/CardProductName/ikas-config-snippet.json +2 -1
  25. package/data/section-templates/category-list-section/ikas-config-snippet.json +21 -0
  26. package/data/section-templates/category-list-section/index.tsx +2 -1
  27. package/data/section-templates/component-renderer/additional/ProductDetail/index.tsx +5 -1
  28. package/data/section-templates/component-renderer/ikas-config-snippet.json +13 -0
  29. package/data/section-templates/favorites/ikas-config-snippet.json +18 -1
  30. package/data/section-templates/features-section/ikas-config-snippet.json +13 -0
  31. package/data/section-templates/footer-section/ikas-config-snippet.json +15 -0
  32. package/data/section-templates/forgot-password-section/components/ForgotPasswordForm/index.tsx +1 -1
  33. package/data/section-templates/header-section/children/Announcements/ikas-config-snippet.json +7 -0
  34. package/data/section-templates/header-section/children/CookieBar/ikas-config-snippet.json +3 -0
  35. package/data/section-templates/header-section/children/Navbar/components/CartSidebar/index.tsx +2 -1
  36. package/data/section-templates/header-section/children/Navbar/components/SearchModal/index.tsx +2 -1
  37. package/data/section-templates/header-section/children/Navbar/ikas-config-snippet.json +27 -0
  38. package/data/section-templates/header-section/children/Navbar/index.tsx +6 -5
  39. package/data/section-templates/header-section/ikas-config-snippet.json +13 -0
  40. package/data/section-templates/header-section/sub-components/CartItem/index.tsx +66 -24
  41. package/data/section-templates/header-section/sub-components/CartItem/styles.css +14 -0
  42. package/data/section-templates/header-section/sub-components/QuantitySelector/index.tsx +11 -3
  43. package/data/section-templates/header-section/utils/cartLimits.ts +24 -0
  44. package/data/section-templates/header-section/utils/cartLineLimits.ts +100 -0
  45. package/data/section-templates/hero-slider-section/children/HeroSliderItem/ikas-config-snippet.json +18 -0
  46. package/data/section-templates/hero-slider-section/children/HeroSliderItem/index.tsx +12 -7
  47. package/data/section-templates/hero-slider-section/ikas-config-snippet.json +13 -0
  48. package/data/section-templates/image-handling/ikas-config-snippet.json +53 -0
  49. package/data/section-templates/image-handling/index.tsx +5 -1
  50. package/data/section-templates/login-section/ikas-config-snippet.json +2 -0
  51. package/data/section-templates/navigation/components/CartSidebar/index.tsx +2 -1
  52. package/data/section-templates/navigation/components/SearchModal/index.tsx +2 -1
  53. package/data/section-templates/navigation/ikas-config-snippet.json +27 -0
  54. package/data/section-templates/navigation/index.tsx +6 -5
  55. package/data/section-templates/navigation/sub-components/CartItem/index.tsx +66 -24
  56. package/data/section-templates/navigation/sub-components/CartItem/styles.css +14 -0
  57. package/data/section-templates/navigation/sub-components/QuantitySelector/index.tsx +11 -3
  58. package/data/section-templates/navigation/utils/cartLimits.ts +24 -0
  59. package/data/section-templates/navigation/utils/cartLineLimits.ts +100 -0
  60. package/data/section-templates/product-detail-section/children/ProductDetailAddToCart/ikas-config-snippet.json +17 -0
  61. package/data/section-templates/product-detail-section/children/ProductDetailAddToCart/index.tsx +16 -2
  62. package/data/section-templates/product-detail-section/children/ProductDetailBackInStock/components/BackInStockForm/index.tsx +92 -0
  63. package/data/section-templates/product-detail-section/children/ProductDetailBackInStock/ikas-config-snippet.json +175 -0
  64. package/data/section-templates/product-detail-section/children/ProductDetailBackInStock/index.tsx +141 -0
  65. package/data/section-templates/product-detail-section/children/ProductDetailBackInStock/styles.css +47 -0
  66. package/data/section-templates/product-detail-section/children/ProductDetailBackInStock/types.ts +25 -0
  67. package/data/section-templates/product-detail-section/children/ProductDetailBundleFurniture/ikas-config-snippet.json +18 -0
  68. package/data/section-templates/product-detail-section/children/ProductDetailBundleProduct/ikas-config-snippet.json +20 -0
  69. package/data/section-templates/product-detail-section/children/ProductDetailDescription/ikas-config-snippet.json +27 -0
  70. package/data/section-templates/product-detail-section/children/ProductDetailFeatures/ikas-config-snippet.json +29 -0
  71. package/data/section-templates/product-detail-section/children/ProductDetailNameFavorite/ikas-config-snippet.json +18 -1
  72. package/data/section-templates/product-detail-section/children/ProductDetailOffer/ikas-config-snippet.json +20 -0
  73. package/data/section-templates/product-detail-section/children/ProductDetailOptionSet/ikas-config-snippet.json +16 -0
  74. package/data/section-templates/product-detail-section/children/ProductDetailPrices/ikas-config-snippet.json +16 -0
  75. package/data/section-templates/product-detail-section/children/ProductDetailProductGroup/ikas-config-snippet.json +16 -0
  76. package/data/section-templates/product-detail-section/children/ProductDetailSku/ikas-config-snippet.json +16 -0
  77. package/data/section-templates/product-detail-section/children/ProductDetailVariant/ikas-config-snippet.json +17 -0
  78. package/data/section-templates/product-detail-section/hooks/useBundleProducts.ts +7 -6
  79. package/data/section-templates/product-detail-section/ikas-config-snippet.json +53 -0
  80. package/data/section-templates/product-detail-section/index.tsx +5 -1
  81. package/data/section-templates/product-detail-section/sub-components/Modal/index.tsx +120 -0
  82. package/data/section-templates/product-detail-section/sub-components/Modal/styles.css +70 -0
  83. package/data/section-templates/product-detail-section/sub-components/QuantitySelector/index.tsx +11 -3
  84. package/data/section-templates/product-detail-section/utils/cartLimits.ts +24 -0
  85. package/data/section-templates/product-pricing/ikas-config-snippet.json +16 -0
  86. package/data/section-templates/product-slider-section/children/CardProductName/ikas-config-snippet.json +2 -1
  87. package/data/section-templates/product-slider-section/ikas-config-snippet.json +17 -0
  88. package/data/section-templates/register-section/ikas-config-snippet.json +2 -0
  89. package/data/section-templates/variant-selection/ikas-config-snippet.json +17 -0
  90. package/data/storefront-api.json +307 -38
  91. package/data/storefront-types.json +9554 -6145
  92. package/dist/index.js +1320 -32
  93. package/dist/index.js.map +1 -1
  94. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-06-03T18:42:32.196Z",
2
+ "generatedAt": "2026-08-19T15:11:04.648Z",
3
3
  "functions": [
4
4
  {
5
5
  "name": "apiListProductBrand",
@@ -167,7 +167,7 @@
167
167
  "name": "getAttributeDetailValues",
168
168
  "displayName": "getValues",
169
169
  "signature": "function getAttributeDetailValues(attributeDetail: IkasProductAttributeDetail): IkasProductAttributeValue[]",
170
- "description": "Retrieves the attribute values for a product attribute detail, merging variant and product-level attributes.",
170
+ "description": "Retrieves the attribute values for a product attribute detail, merging variant and product-level attributes.\nThis is how a PRODUCT_ATTRIBUTE code-component prop is consumed: that prop hands you the\nIkasProductAttributeDetail wrapper ({ product, attributePropValue }), never the attribute value itself, so\nreading `prop.value` silently yields nothing — call this function instead.",
171
171
  "params": [
172
172
  {
173
173
  "name": "attributeDetail",
@@ -195,7 +195,7 @@
195
195
  "name": "getAttributeListValues",
196
196
  "displayName": "getValues",
197
197
  "signature": "function getAttributeListValues(list: IkasProductAttributeList): IkasProductAttributeMap[]",
198
- "description": "Retrieves grouped attribute values for a product attribute list, combining variant and product-level attributes.",
198
+ "description": "Retrieves grouped attribute values for a product attribute list, combining variant and product-level attributes.\nThis is how a PRODUCT_ATTRIBUTE_LIST code-component prop is consumed: that prop hands you a single\nIkasProductAttributeList wrapper ({ product, attributeListPropValue }) — never an array — so mapping over the\nprop is a runtime error; call this function and iterate the returned { attribute, values } maps instead.",
199
199
  "params": [
200
200
  {
201
201
  "name": "list",
@@ -2761,16 +2761,16 @@
2761
2761
  {
2762
2762
  "name": "getDefaultSrc",
2763
2763
  "signature": "function getDefaultSrc(image: IkasImage): string",
2764
- "description": "Returns the default source URL for an image at 1080px resolution.",
2764
+ "description": "Returns the default source URL for an image OR video at 1080px resolution.\n\nProduct media items (IkasProductImage) can be videos. ALWAYS check `item.isVideo`\nand render a `<video src={getDefaultSrc(item)}>` instead of an `<img>` when it is true.\nNever assume every media item is an image.",
2765
2765
  "params": [
2766
2766
  {
2767
2767
  "name": "image",
2768
2768
  "description": "- The image object to generate the default source URL for."
2769
2769
  }
2770
2770
  ],
2771
- "returns": "The CDN URL string for the image at 1080px size.",
2771
+ "returns": "The CDN URL string for the image or video at 1080px size.",
2772
2772
  "returnType": "string",
2773
- "example": "```typescript\nimport { getDefaultSrc } from \"@ikas/bp-storefront\";\n\nconst src = getDefaultSrc(image);\nconsole.log(src); // \"https://cdn.example.com/images/.../1080/image.webp\"\n```",
2773
+ "example": "```typescript\nimport { getDefaultSrc, createMediaSrcset } from \"@ikas/bp-storefront\";\n\n// Product images can be videos — ALWAYS branch on isVideo when mapping media:\n{product.images.map((item, i) =>\n item.isVideo ? (\n <video key={i} src={getDefaultSrc(item)} muted playsInline preload=\"metadata\">\n <track kind=\"captions\" />\n </video>\n ) : (\n <img key={i} src={getDefaultSrc(item)} srcSet={createMediaSrcset(item)} alt={`Product ${i + 1}`} />\n )\n)}\n```",
2774
2774
  "categories": [
2775
2775
  "Image"
2776
2776
  ],
@@ -2788,16 +2788,16 @@
2788
2788
  {
2789
2789
  "name": "getThumbnailSrc",
2790
2790
  "signature": "function getThumbnailSrc(image: IkasImage): string",
2791
- "description": "Returns the thumbnail source URL for an image at 180px resolution.",
2791
+ "description": "Returns the thumbnail source URL for an IMAGE at 180px resolution.\n\nVIDEOS HAVE NO 180px THUMBNAIL and no poster URL. When `image.isVideo === true` the size is\nIGNORED and this returns the same full-size .mp4 as `getDefaultSrc(image)` — so using it in a\nthumbnail-sized box (swatch, cart line, order line) downloads the whole video instead of a\n180px webp. Nothing looks broken, which makes it a silent performance regression.\n\nBranch on `item.isVideo` first and only pass images here. For the video branch in a small,\nstatic context render `<video src={getDefaultSrc(item)} preload=\"metadata\" muted playsInline>`\nwith no `autoPlay`: the browser fetches only the first frame and holds it as a stand-in poster.",
2792
2792
  "params": [
2793
2793
  {
2794
2794
  "name": "image",
2795
- "description": "- The image object to generate the thumbnail source URL for."
2795
+ "description": "- The image object to generate the thumbnail source URL for. Videos ignore the size."
2796
2796
  }
2797
2797
  ],
2798
- "returns": "The CDN URL string for the image at 180px size.",
2798
+ "returns": "The CDN URL string: a 180px image, or — for `isVideo` items — the original .mp4.",
2799
2799
  "returnType": "string",
2800
- "example": "```typescript\nimport { getThumbnailSrc } from \"@ikas/bp-storefront\";\n\nconst thumbnailSrc = getThumbnailSrc(image);\nconsole.log(thumbnailSrc); // \"https://cdn.example.com/images/.../180/image.webp\"\n```",
2800
+ "example": "```typescript\nimport { getThumbnailSrc, getDefaultSrc } from \"@ikas/bp-storefront\";\n\n// Thumbnail rail — branch on isVideo per item (no autoPlay: first frame acts as the poster):\n{product.images.map((item, i) =>\n item.isVideo ? (\n <video key={i} src={getDefaultSrc(item)} muted playsInline preload=\"metadata\">\n <track kind=\"captions\" />\n </video>\n ) : (\n <img key={i} src={getThumbnailSrc(item)} sizes=\"112px\" alt={`Thumb ${i + 1}`} />\n )\n)}\n```",
2801
2801
  "categories": [
2802
2802
  "Image"
2803
2803
  ],
@@ -2815,7 +2815,7 @@
2815
2815
  {
2816
2816
  "name": "getSrc",
2817
2817
  "signature": "function getSrc(image: IkasImage, size: number): string",
2818
- "description": "Generates the full CDN source URL for an image or video at the specified size, handling both legacy path-based and merchant-scoped ID formats.",
2818
+ "description": "Generates the full CDN source URL for an image or video at the specified size, handling both legacy path-based and merchant-scoped ID formats.\n\nNOTE: For videos (`image.isVideo === true`) the `size` argument is IGNORED — the original .mp4 is always returned.\nSo `getSrc(item, 240)` and `getDefaultSrc(item)` produce the identical URL for a video. PREFER `getDefaultSrc(item)`\nfor video `src` (no size param) — do NOT pass an arbitrary size like `getSrc(item, 240)`, it is misleading.",
2819
2819
  "params": [
2820
2820
  {
2821
2821
  "name": "image",
@@ -2823,12 +2823,12 @@
2823
2823
  },
2824
2824
  {
2825
2825
  "name": "size",
2826
- "description": "- The desired image width in pixels for the generated URL."
2826
+ "description": "- The desired image width in pixels. Ignored for videos."
2827
2827
  }
2828
2828
  ],
2829
2829
  "returns": "The full CDN URL string for the image or video.",
2830
2830
  "returnType": "string",
2831
- "example": "```typescript\nimport { getSrc } from \"@ikas/bp-storefront\";\n\nconst src = getSrc(image, 640);\nconsole.log(src); // \"https://cdn.example.com/images/.../640/image.webp\"\n```",
2831
+ "example": "```typescript\nimport { getSrc, getDefaultSrc } from \"@ikas/bp-storefront\";\n\nconst src = getSrc(image, 640);\nconsole.log(src); // \"https://cdn.example.com/images/.../640/image.webp\"\n\n// For a video, use getDefaultSrc (size is ignored anyway):\n<video src={getDefaultSrc(item)} muted playsInline preload=\"metadata\" />\n```",
2832
2832
  "categories": [
2833
2833
  "Image"
2834
2834
  ],
@@ -2846,7 +2846,7 @@
2846
2846
  {
2847
2847
  "name": "createMediaSrcset",
2848
2848
  "signature": "function createMediaSrcset(image?: IkasImage | null): string",
2849
- "description": "Generates a complete responsive `srcset` string for an image across all standard sizes (180–3840px).",
2849
+ "description": "Generates a complete responsive `srcset` string for an image across all standard sizes (180–3840px).\n\nsrcset applies to `<img>` only — video media (`item.isVideo === true`) has no srcset\nand must be rendered with `<video src={getDefaultSrc(item)}>`. When mapping product\nimages, branch on `item.isVideo` first, then only use createMediaSrcset on the image branch.",
2850
2850
  "params": [
2851
2851
  {
2852
2852
  "name": "image",
@@ -2855,7 +2855,7 @@
2855
2855
  ],
2856
2856
  "returns": "A srcset string like `\"url 180w, url 360w, ...\"`, or an empty string if no image is provided.",
2857
2857
  "returnType": "string",
2858
- "example": "```typescript\nimport { createMediaSrcset, getDefaultSrc } from \"@ikas/bp-storefront\";\n\n<img\n src={getDefaultSrc(image)}\n srcSet={createMediaSrcset(image)}\n sizes=\"(max-width: 768px) 100vw, 50vw\"\n alt=\"Product\"\n/>\n```",
2858
+ "example": "```typescript\nimport { createMediaSrcset, getDefaultSrc } from \"@ikas/bp-storefront\";\n\n// Product images can be videos — ALWAYS branch on isVideo when mapping media:\n{product.images.map((item, i) =>\n item.isVideo ? (\n <video key={i} src={getDefaultSrc(item)} muted playsInline preload=\"metadata\">\n <track kind=\"captions\" />\n </video>\n ) : (\n <img\n key={i}\n src={getDefaultSrc(item)}\n srcSet={createMediaSrcset(item)}\n sizes=\"(max-width: 768px) 100vw, 50vw\"\n alt={`Product ${i + 1}`}\n />\n )\n)}\n```",
2859
2859
  "categories": [
2860
2860
  "Image"
2861
2861
  ],
@@ -4628,7 +4628,7 @@
4628
4628
  "name": "getIkasProductAttrributeProductIds",
4629
4629
  "displayName": "getProductIds",
4630
4630
  "signature": "function getIkasProductAttrributeProductIds(value: IkasProductAttributeValue): string[]",
4631
- "description": "Extracts and returns the product IDs from a PRODUCT-type attribute value's JSON string.",
4631
+ "description": "Extracts and returns the product IDs from a PRODUCT-type attribute value's JSON string.\nNOTE: the export name really is misspelled — \"Attrribute\" with a double r. It is kept as-is because\nrenaming a published export would break every theme that imports it, so import it VERBATIM; the\ncorrectly spelled `getIkasProductAttributeProductIds` does not exist and will not compile. This is\nnot a documentation typo to report or \"fix\". In the blueprint editor the display alias is\n`getProductIds`, which hides the misspelling; only direct TypeScript imports see it.",
4632
4632
  "params": [
4633
4633
  {
4634
4634
  "name": "value",
@@ -7310,16 +7310,16 @@
7310
7310
  "name": "getProductVariantMainImage",
7311
7311
  "displayName": "getMainImage",
7312
7312
  "signature": "function getProductVariantMainImage(variant: IkasProductVariant): IkasProductImage | undefined",
7313
- "description": "Get the main/primary image for a product variant.",
7313
+ "description": "Get the main/primary media item for a product variant.\n\nThe returned IkasProductImage may be a video (`isVideo === true`) — branch on it\nand render `<video>` instead of `<img>`.",
7314
7314
  "params": [
7315
7315
  {
7316
7316
  "name": "variant",
7317
7317
  "description": "- The product variant"
7318
7318
  }
7319
7319
  ],
7320
- "returns": "The first IkasProductImage of the variant, or undefined if no images. Access `.image` to get the IkasImage for CDN helpers.",
7320
+ "returns": "The first IkasProductImage of the variant, or undefined if no images. Check `.isVideo` to decide between `<video>` and `<img>`, and access `.image` to get the IkasImage for CDN helpers.",
7321
7321
  "returnType": "IkasProductImage | undefined",
7322
- "example": "```typescript\nimport { getProductVariantMainImage, getSelectedProductVariant, getDefaultSrc } from \"@ikas/bp-storefront\";\nimport { IkasProduct } from \"@ikas/bp-storefront\";\n\nfunction ProductImage({ product }: { product: IkasProduct }) {\n const variant = getSelectedProductVariant(product);\n const productImage = getProductVariantMainImage(variant);\n const image = productImage?.image;\n\n if (!image) {\n return <div className=\"no-image\">No image available</div>;\n }\n\n return <img src={getDefaultSrc(image)} alt={product.name} />;\n}\n```",
7322
+ "example": "```typescript\nimport { getProductVariantMainImage, getSelectedProductVariant, getDefaultSrc, createMediaSrcset } from \"@ikas/bp-storefront\";\nimport { IkasProduct } from \"@ikas/bp-storefront\";\n\nfunction ProductImage({ product }: { product: IkasProduct }) {\n const variant = getSelectedProductVariant(product);\n const productImage = getProductVariantMainImage(variant);\n const image = productImage?.image;\n\n if (!image) {\n return <div className=\"no-image\">No image available</div>;\n }\n\n // Media can be a video — branch on isVideo:\n return productImage.isVideo ? (\n <video src={getDefaultSrc(image)} muted playsInline loop>\n <track kind=\"captions\" />\n </video>\n ) : (\n <img src={getDefaultSrc(image)} srcSet={createMediaSrcset(image)} alt={product.name} />\n );\n}\n```",
7323
7323
  "categories": [
7324
7324
  "ProductDetail",
7325
7325
  "ProductList"
@@ -7597,14 +7597,14 @@
7597
7597
  "name": "getProductVariantAppliedCampaignAmount",
7598
7598
  "displayName": "getAppliedCampaignAmount",
7599
7599
  "signature": "function getProductVariantAppliedCampaignAmount(variant: IkasProductVariant): IkasAppliedCampaignAmount | null",
7600
- "description": "Get the applied campaign discount amount details for a product variant, including type and formatted value.",
7600
+ "description": "Get the applied campaign discount amount details for a product variant, including type and formatted value.\n\nHow the discount value is interpreted depends on `campaign.type`:\n- `\"FIXED_AMOUNT\"` → the value is an absolute money amount, returned in `formattedPrice` (e.g. \"$10.00\"); `discountPercentage` stays null.\n- `\"RATIO\"` → the value is a percentage, returned in `discountPercentage` (e.g. \"10\" for 10% off); `formattedPrice` stays null.\n\nBoth fixed and tiered campaigns are supported. For a tiered-discount campaign\n(`campaign.fixedDiscount` is null and the discount lives in `campaign.tieredDiscount.rules`),\nthe first tier's amount (`campaign.tieredDiscount.rules[0].amount`) is used, matching the storefront runtime.",
7601
7601
  "params": [
7602
7602
  {
7603
7603
  "name": "variant",
7604
7604
  "description": "- The product variant to check for applied campaigns"
7605
7605
  }
7606
7606
  ],
7607
- "returns": "An object with campaign type, formatted price, and discount percentage, or null if no campaign is applied",
7607
+ "returns": "An object `{ type, formattedPrice, discountPercentage }` — `formattedPrice` is set for FIXED_AMOUNT campaigns, `discountPercentage` for RATIO campaigns (fixed and tiered alike); the other field stays null. Returns null if no campaign is applied.",
7608
7608
  "returnType": "IkasAppliedCampaignAmount | null",
7609
7609
  "example": "```typescript\nimport { getProductVariantAppliedCampaignAmount, getSelectedProductVariant } from \"@ikas/bp-storefront\";\nimport { IkasProduct } from \"@ikas/bp-storefront\";\n\nfunction CampaignInfo({ product }: { product: IkasProduct }) {\n const variant = getSelectedProductVariant(product);\n const campaignAmount = getProductVariantAppliedCampaignAmount(variant);\n\n if (!campaignAmount) return null;\n\n return (\n <div>\n {campaignAmount.type === \"RATIO\"\n ? `${campaignAmount.discountPercentage}% off`\n : `${campaignAmount.formattedPrice} off`}\n </div>\n );\n}\n```",
7610
7610
  "categories": [
@@ -7999,6 +7999,36 @@
7999
7999
  "IkasProductVariant"
8000
8000
  ]
8001
8001
  },
8002
+ {
8003
+ "name": "getProductVariantTieredDiscountProducts",
8004
+ "displayName": "getTieredDiscountProducts",
8005
+ "signature": "function getProductVariantTieredDiscountProducts(variant: IkasProductVariant): IkasTieredDiscountProduct[]",
8006
+ "description": "Get the tiered-discount breakdown for a product variant, one entry per discount tier.\n\nA tiered discount defines multiple quantity tiers (`campaign.tieredDiscount.rules`), each with its own\namount and quantity range. This resolves every tier against the variant's price and returns the\nper-tier sell/final prices (both raw numbers and formatted strings), matching the storefront runtime.\nThe raw rules are `IkasProductTieredDiscountRule` (ranges may be null); this function returns the\nresolved `IkasTieredDiscountProduct` with normalized `{ min, max }` — use the resolved shape, not the raw rule.\n\n`sellPrice`/`finalPrice` (and their `formatted*` variants) are PER UNIT; the `*WithQuantity` fields are the\ntier total for buying the minimum quantity. A `\"FIXED_AMOUNT\"` discount is applied only to that total, so\nper-unit `finalPrice` equals `sellPrice` and the saving shows only in `finalPriceWithQuantity`.\n\nThe discount `amount` is interpreted by `campaign.type`: `\"RATIO\"` treats it as a percentage,\n`\"FIXED_AMOUNT\"` as an absolute money amount subtracted from the tier total. `amount`/`type` are\ninformational — the discount is already applied in the resolved `*Price` fields, so prefer those over\nrecomputing it yourself.\n\n`lineItemQuantityRange.min`/`max` are normalized numbers where `0` means \"unbounded\". In particular\n`max === 0` marks an open-ended top tier (e.g. \"6+\" with no upper limit) — render it as \"min+\" rather\nthan \"min–max\", and never treat `max` as a real quantity when it is `0`.\n\nEach tier's `salesChannelIds` lists the channels it targets (empty/null = all channels). Filter tiers\nagainst `IkasStorefrontConfig.salesChannelId` so only those valid for the current storefront are shown.\n\nReturns an empty array when the variant has no tiered-discount campaign, when a\n`PRODUCT_AND_VARIANT` filter excludes this variant, or when no tier defines a quantity range.",
8007
+ "params": [
8008
+ {
8009
+ "name": "variant",
8010
+ "description": "- The product variant to resolve tiered discounts for"
8011
+ }
8012
+ ],
8013
+ "returns": "An array of tier objects (`amount`, `lineItemQuantityRange`, `type`, sell/final prices with their formatted variants, `salesChannelIds`), or an empty array if no tiered discount applies",
8014
+ "returnType": "IkasTieredDiscountProduct[]",
8015
+ "example": "```typescript\nimport {\n getProductVariantTieredDiscountProducts,\n getSelectedProductVariant,\n IkasStorefrontConfig,\n} from \"@ikas/bp-storefront\";\nimport { IkasProduct } from \"@ikas/bp-storefront\";\n\nfunction TieredDiscountTable({ product }: { product: IkasProduct }) {\n const variant = getSelectedProductVariant(product);\n const tiers = getProductVariantTieredDiscountProducts(variant);\n const salesChannelId = IkasStorefrontConfig.salesChannelId;\n\n if (!tiers.length) return null;\n\n return (\n <ul>\n {tiers.map((tier, i) => {\n // A tier applies when it targets no channels or includes the current one\n const scoped =\n !tier.salesChannelIds?.length ||\n (!!salesChannelId && tier.salesChannelIds.includes(salesChannelId));\n if (!scoped) return null;\n\n return (\n <li key={i}>\n Buy {tier.lineItemQuantityRange.min}+ → {tier.formattedFinalPriceWithQuantity}{\" \"}\n <s>{tier.formattedSellPriceWithQuantity}</s>\n </li>\n );\n })}\n </ul>\n );\n}\n```",
8016
+ "categories": [
8017
+ "Pricing",
8018
+ "ProductVariant"
8019
+ ],
8020
+ "related": [
8021
+ "getProductVariantAppliedCampaignAmount",
8022
+ "getProductVariantCampaignOffersDiscountPercentage",
8023
+ "getProductVariantFinalPrice"
8024
+ ],
8025
+ "isAsync": false,
8026
+ "isClass": false,
8027
+ "parameterTypes": [
8028
+ "IkasProductVariant",
8029
+ "IkasTieredDiscountProduct"
8030
+ ]
8031
+ },
8002
8032
  {
8003
8033
  "name": "getProductVariantIsBackInStockEnabled",
8004
8034
  "displayName": "isBackInStockEnabled",
@@ -9556,7 +9586,7 @@
9556
9586
  "name": "initAddressForm",
9557
9587
  "displayName": "init",
9558
9588
  "signature": "async function initAddressForm(addressForm: AddressForm, address?: IkasCustomerAddress): Promise<void>",
9559
- "description": "Initializes an address form with default or existing address values, loads location data, and configures field settings.",
9589
+ "description": "Initializes an address form with default or existing address values, loads location data, and configures field settings.\n\nAlso resolves `addressForm.addressFormat` for the selected country. That is an\n`AddressFormItem[][]` describing which fields the country uses and how they group into rows\n(outer array = rows, inner array = fields sharing a row), and it is the only correct source\nfor laying out an address form -- a hardcoded field list will be wrong for most countries.\nIt is empty until this promise resolves, and `setAddressFormCountry` re-resolves it, so\nrender from it rather than copying it into local state.",
9560
9590
  "params": [
9561
9591
  {
9562
9592
  "name": "addressForm",
@@ -9569,7 +9599,7 @@
9569
9599
  ],
9570
9600
  "returns": "A promise that resolves once the form is fully initialized, including country/state/city lists, field settings, checkout settings, and shipping zones.",
9571
9601
  "returnType": "Promise<void>",
9572
- "example": "```typescript\nimport { initAddressForm } from \"@ikas/bp-storefront\";\n\n// Initialize an empty address form\nawait initAddressForm(addressForm);\n\n// Initialize with an existing customer address for editing\nawait initAddressForm(addressForm, existingAddress);\n```",
9602
+ "example": "```tsx\nimport { useEffect, useState } from \"preact/hooks\";\nimport {\n type AddressForm,\n type AddressFormItem,\n initAddressForm,\n setAddressFormFirstName,\n setAddressFormLastName,\n setAddressFormIdentityNumber,\n setAddressFormAddressLine1,\n setAddressFormAddressLine2,\n setAddressFormPostalCode,\n setAddressFormPhone,\n} from \"@ikas/bp-storefront\";\n\n// Initialize an empty address form\nawait initAddressForm(addressForm);\n\n// Initialize with an existing customer address for editing\nawait initAddressForm(addressForm, existingAddress);\n\n// addressFormat is empty until init resolves, so gate the render on it.\nconst [isLoading, setIsLoading] = useState(true);\nuseEffect(() => {\n initAddressForm(addressForm, address).then(() => setIsLoading(false));\n}, []);\n\n// Every addressFormat key has a matching setter, each taking (addressForm, value).\n// The location keys (country, state, city, district, region) are omitted here: they\n// render as selects fed by addressForm.countryOptions / stateOptions / cityOptions /\n// districtOptions / regionOptions, and must fall back to a text input when the field\n// isFreeText or has no options.\nconst SETTERS: Partial<Record<AddressFormItem, (form: AddressForm, value: string) => void>> = {\n firstName: setAddressFormFirstName,\n lastName: setAddressFormLastName,\n identityNumber: setAddressFormIdentityNumber,\n addressLine1: setAddressFormAddressLine1,\n addressLine2: setAddressFormAddressLine2,\n postalCode: setAddressFormPostalCode,\n phone: setAddressFormPhone,\n};\n\n// Render the country's own layout: outer array = rows, inner array = fields in that row.\n(addressForm.addressFormat ?? []).map((row) => {\n // A field the country does not use is absent from the form object entirely.\n const keys = row.filter((key) => addressForm[key] != null);\n if (!keys.length) return null;\n\n return (\n <div className=\"address-row\" key={keys.join(\"-\")}>\n {keys.map((key) => {\n // Each entry is an IkasFormItem: value, label, placeholder, hasError, message.\n const field = addressForm[key];\n if (!field) return null; // already guaranteed by the filter above; narrows the type\n return (\n <label key={key}>\n {field.label}\n <input\n value={field.value ?? \"\"}\n placeholder={field.placeholder}\n onInput={(e) => SETTERS[key]?.(addressForm, e.currentTarget.value)}\n />\n {field.hasError && <small>{field.message}</small>}\n </label>\n );\n })}\n </div>\n );\n})\n```",
9573
9603
  "categories": [
9574
9604
  "Address",
9575
9605
  "Form",
@@ -12559,11 +12589,27 @@
12559
12589
  "name": "bs_searchProductById",
12560
12590
  "displayName": "searchProductById",
12561
12591
  "signature": "async function bs_searchProductById(baseStore: BaseStore, params: { productId: string }): Promise<{\n isSuccess: boolean;\n product: IkasProduct | null;\n}>",
12562
- "description": "",
12563
- "params": [],
12592
+ "description": "Fetches a single product by id and returns it as a full `IkasProduct`.\n\nUse this when a lightweight reference (e.g. a cart line's `IkasOrderLineVariant`, which carries\nneither `salesChannels` nor `stock`) needs product-level data: the returned product includes\n`salesChannels` filtered to the active sales channel (with `minQuantityPerCart` /\n`maxQuantityPerCart`) and per-variant `stock` (summed over the sales channel's configured\nstock locations). `selectedVariantValues` is seeded from the first active variant (or the\nfirst variant when none is active). For multiple ids, prefer `bs_searchProductsById` — one\nbatched request.",
12593
+ "params": [
12594
+ {
12595
+ "name": "baseStore",
12596
+ "description": "- The base store instance"
12597
+ },
12598
+ {
12599
+ "name": "params",
12600
+ "description": "- `{ productId }` — id of the product to fetch"
12601
+ }
12602
+ ],
12603
+ "returns": "`{ isSuccess, product }` — `product` is null when not found or on failure",
12564
12604
  "returnType": "Promise<{\n isSuccess: boolean;\n product: IkasProduct | null;\n}>",
12565
- "categories": [],
12566
- "related": [],
12605
+ "example": "```tsx\nimport { baseStore, bs_searchProductById, IkasStorefrontConfig } from \"@ikas/bp-storefront\";\n\nconst { isSuccess, product } = await bs_searchProductById(baseStore, { productId });\nif (isSuccess && product) {\n const channel = product.salesChannels?.find(sc => sc.id === IkasStorefrontConfig.salesChannelId);\n console.log(channel?.maxQuantityPerCart);\n}\n```",
12606
+ "categories": [
12607
+ "Product",
12608
+ "Search"
12609
+ ],
12610
+ "related": [
12611
+ "bs_searchProductsById"
12612
+ ],
12567
12613
  "isAsync": true,
12568
12614
  "isClass": false,
12569
12615
  "parameterTypes": [
@@ -12574,11 +12620,29 @@
12574
12620
  "name": "bs_searchProductsById",
12575
12621
  "displayName": "searchProductsById",
12576
12622
  "signature": "async function bs_searchProductsById(baseStore: BaseStore, params: { productIds: string[] }): Promise<{\n isSuccess: boolean;\n products: IkasProduct[] | null;\n}>",
12577
- "description": "",
12578
- "params": [],
12623
+ "description": "Batch-fetches products by id in a single request and returns them as full `IkasProduct` objects.\n\nThe go-to function when cart lines (or any lightweight reference) need product-level data they\ndo not carry: `IkasOrderLineVariant` has neither `salesChannels` nor `stock`, while the products\nreturned here include `salesChannels` filtered to the active sales channel (with\n`minQuantityPerCart` / `maxQuantityPerCart`) and per-variant `stock` (summed over the sales\nchannel's configured stock locations). Collect the distinct `productId`s of the lines and\nfetch them in ONE call instead of one request per line. Called with an empty `productIds`,\nit returns `{ isSuccess: true, products: [] }` without a network request.",
12624
+ "params": [
12625
+ {
12626
+ "name": "baseStore",
12627
+ "description": "- The base store instance"
12628
+ },
12629
+ {
12630
+ "name": "params",
12631
+ "description": "- `{ productIds }` — product ids to fetch (deduplicate before calling)"
12632
+ }
12633
+ ],
12634
+ "returns": "`{ isSuccess, products }` — `products` is null on failure",
12579
12635
  "returnType": "Promise<{\n isSuccess: boolean;\n products: IkasProduct[] | null;\n}>",
12580
- "categories": [],
12581
- "related": [],
12636
+ "example": "```tsx\nimport { baseStore, bs_searchProductsById, cartStore, IkasStorefrontConfig } from \"@ikas/bp-storefront\";\n\n// Enforce per-cart quantity limits on cart lines:\nconst productIds = [\n ...new Set(\n (cartStore.cart?.orderLineItems ?? [])\n .map(item => item.variant.productId)\n .filter((id): id is string => !!id)\n ),\n];\nconst { products } = await bs_searchProductsById(baseStore, { productIds });\nconst maxByProductId = new Map<string, number | null>();\nfor (const p of products ?? []) {\n const channel = p.salesChannels?.find(sc => sc.id === IkasStorefrontConfig.salesChannelId);\n maxByProductId.set(p.id, channel?.maxQuantityPerCart ?? null);\n}\n```",
12637
+ "categories": [
12638
+ "Product",
12639
+ "Cart",
12640
+ "Search"
12641
+ ],
12642
+ "related": [
12643
+ "bs_searchProductById",
12644
+ "changeItemQuantity"
12645
+ ],
12582
12646
  "isAsync": true,
12583
12647
  "isClass": false,
12584
12648
  "parameterTypes": [
@@ -12616,7 +12680,7 @@
12616
12680
  "name": "addItemToCart",
12617
12681
  "displayName": "addVariantToCart",
12618
12682
  "signature": "async function addItemToCart(variant: IkasProductVariant, product: IkasProduct, initialQuantity: number = 1, options?: AddItemOptions): Promise<IkasCartOperationResult>",
12619
- "description": "Add a product variant to the shopping cart.",
12683
+ "description": "Add a product variant to the shopping cart.\n\nClamps the quantity to the sales channel's `minQuantityPerCart`/`maxQuantityPerCart` only\nwhen it creates a new cart line. When the variant already has a line in the cart, the add\nis delegated to `changeItemQuantity` (existing quantity + `initialQuantity`) with no\nclient-side clamp — a quantity past `maxQuantityPerCart` is then rejected by the API with\nthe `MAX_QUANTITY_PER_CART_LIMIT_REACHED` code in `result.response.errorCodes`, never as a\n`validationError`. See `changeItemQuantity` for the handling pattern.",
12620
12684
  "params": [
12621
12685
  {
12622
12686
  "name": "variant",
@@ -12692,7 +12756,7 @@
12692
12756
  "name": "changeItemQuantity",
12693
12757
  "displayName": "changeQuantityOnCart",
12694
12758
  "signature": "async function changeItemQuantity(item: IkasOrderLineItem, quantity: number, offers?: IkasProductOffer[], product?: IkasProduct): Promise<IkasCartOperationResult>",
12695
- "description": "Change the quantity of an item in the cart.\nUse quantity=0 to remove the item.",
12759
+ "description": "Change the quantity of an item in the cart.\nUse quantity=0 to remove the item.\n\nPerforms no client-side clamping or validation: a quantity above the sales channel's\n`maxQuantityPerCart` is rejected by the API with the `MAX_QUANTITY_PER_CART_LIMIT_REACHED`\ncode in `result.response.errorCodes` (never as a `validationError`). Prevent violations in\nthe stepper and treat the error code as the fallback.",
12696
12760
  "params": [
12697
12761
  {
12698
12762
  "name": "item",
@@ -12713,7 +12777,7 @@
12713
12777
  ],
12714
12778
  "returns": "Result with success flag",
12715
12779
  "returnType": "Promise<IkasCartOperationResult>",
12716
- "example": "```typescript\nimport { cartStore, changeItemQuantity } from \"@ikas/bp-storefront\";\n\n// Increment quantity\nasync function handleIncrement(itemId: string) {\n const item = cartStore.cart?.orderLineItems.find(i => i.id === itemId);\n if (item) {\n const result = await changeItemQuantity(item, item.quantity + 1);\n if (!result.success) {\n showToast(\"Failed to update quantity\");\n }\n }\n}\n\n// Decrement quantity\nasync function handleDecrement(itemId: string) {\n const item = cartStore.cart?.orderLineItems.find(i => i.id === itemId);\n if (item && item.quantity > 1) {\n await changeItemQuantity(item, item.quantity - 1);\n }\n}\n```",
12780
+ "example": "```typescript\nimport { APIErrorCode, cartStore, changeItemQuantity } from \"@ikas/bp-storefront\";\n\n// Increment quantity\nasync function handleIncrement(itemId: string) {\n const item = cartStore.cart?.orderLineItems.find(i => i.id === itemId);\n if (item) {\n const result = await changeItemQuantity(item, item.quantity + 1);\n if (!result.success) {\n const limitHit = result.response?.errorCodes?.includes(\n APIErrorCode.MAX_QUANTITY_PER_CART_LIMIT_REACHED\n );\n showToast(limitHit ? \"Per-cart quantity limit reached\" : \"Failed to update quantity\");\n }\n }\n}\n\n// Decrement quantity\nasync function handleDecrement(itemId: string) {\n const item = cartStore.cart?.orderLineItems.find(i => i.id === itemId);\n if (item && item.quantity > 1) {\n await changeItemQuantity(item, item.quantity - 1);\n }\n}\n```",
12717
12781
  "categories": [
12718
12782
  "Cart"
12719
12783
  ],
@@ -14862,7 +14926,7 @@
14862
14926
  {
14863
14927
  "name": "getEmptyAddressForm",
14864
14928
  "signature": "function getEmptyAddressForm(customerStore: IkasCustomerStore): AddressForm",
14865
- "description": "Create and return a new, empty address form with validation, wrapped in MobX observability.",
14929
+ "description": "Create and return a new, empty address form with validation, wrapped in MobX observability.\n\nUse this to create an address; use `getIkasCustomerAddressForm(address)` to edit an existing\none. It starts `initAddressForm` internally but does not await it, so await `initAddressForm`\nyourself when you need to know that the country layout (`addressFormat`) and the country/state/\ncity lists are ready to render.",
14866
14930
  "params": [
14867
14931
  {
14868
14932
  "name": "customerStore",
@@ -14871,14 +14935,16 @@
14871
14935
  ],
14872
14936
  "returns": "A new observable address form object with validated fields",
14873
14937
  "returnType": "AddressForm",
14874
- "example": "```typescript\nimport { customerStore, getEmptyAddressForm, saveCustomer } from \"@ikas/bp-storefront\";\n\nfunction AddAddressPage() {\n const form = getEmptyAddressForm(customerStore);\n\n const handleSave = async () => {\n const customer = { ...customerStore.customer! };\n customer.addresses = [...(customer.addresses || []), formToAddress(form)];\n await saveCustomer(customerStore, customer);\n };\n\n return (\n <form>\n <input\n value={form.addressLine1.value}\n onChange={e => form.addressLine1.value = e.target.value}\n />\n <button onClick={handleSave}>Save Address</button>\n </form>\n );\n}\n```",
14938
+ "example": "```tsx\nimport {\n customerStore,\n getEmptyAddressForm,\n initAddressForm,\n setAddressFormAddressLine1,\n submitAddressForm,\n} from \"@ikas/bp-storefront\";\n\n// Create the form once, then await init before rendering the country-driven layout.\nconst [form] = useState(() => getEmptyAddressForm(customerStore));\nconst [isLoading, setIsLoading] = useState(true);\nuseEffect(() => {\n initAddressForm(form).then(() => setIsLoading(false));\n}, []);\n\n// Always go through the setters. Assigning `form.addressLine1.value` directly skips\n// re-validation and the dependent-field resets the location setters perform.\nsetAddressFormAddressLine1(form, \"123 Main Street\");\n\n// submitAddressForm validates and saves the address onto the customer itself --\n// do not hand-build a customer object and call saveCustomer for this.\nconst ok = await submitAddressForm(form);\n```",
14875
14939
  "categories": [
14876
14940
  "Customer",
14877
14941
  "Address"
14878
14942
  ],
14879
14943
  "related": [
14880
- "deleteCustomerAddress",
14881
- "saveCustomer"
14944
+ "initAddressForm",
14945
+ "submitAddressForm",
14946
+ "getIkasCustomerAddressForm",
14947
+ "deleteCustomerAddress"
14882
14948
  ],
14883
14949
  "isAsync": false,
14884
14950
  "isClass": false,
@@ -15116,6 +15182,128 @@
15116
15182
  "isClass": true,
15117
15183
  "className": "Router"
15118
15184
  },
15185
+ {
15186
+ "name": "withRoutePrefix",
15187
+ "signature": "function withRoutePrefix(path: string): string",
15188
+ "description": "Put the visitor's storefront routing in front of a path you wrote yourself.\n\nEntity links (`getProductHref`, `getIkasOrderHref`, …) and LINK props already carry the prefix.\nA literal path in your own markup does not: `href=\"/cart\"` sends a visitor browsing `/en` to the\ndefault language. Wrap it, and a store with no extra routings gets the path back unchanged.\n\nIdempotent — a path that already starts with a supported routing segment is returned as-is.\nAnything that is not a path on this storefront — an absolute URL, `mailto:`, `tel:` — is returned\nuntouched, so a merchant-authored prop can be wrapped without checking it first.",
15189
+ "params": [
15190
+ {
15191
+ "name": "path",
15192
+ "description": "- A path on this storefront, starting with `/`"
15193
+ }
15194
+ ],
15195
+ "returns": "The path under the current routing (e.g. `/cart` → `/en/cart`)",
15196
+ "returnType": "string",
15197
+ "example": "```tsx\nimport { Router, withRoutePrefix } from \"@ikas/bp-storefront\";\n\n// Correct href for crawlers, middle-click and open-in-new-tab...\n<a href={withRoutePrefix(\"/cart\")} onClick={e => {\n e.preventDefault();\n Router.navigateToPage(\"CART\"); // ...and this prefixes on its own.\n}}>Cart</a>\n```",
15198
+ "categories": [
15199
+ "Navigation"
15200
+ ],
15201
+ "related": [
15202
+ "navigate",
15203
+ "navigateToPage"
15204
+ ],
15205
+ "isAsync": false,
15206
+ "isClass": false
15207
+ },
15208
+ {
15209
+ "name": "registerThemeSettingValues",
15210
+ "signature": "function registerThemeSettingValues(values: Record<string, any> | null): void",
15211
+ "description": "Register the live global-variable object (`_g_`) so `getThemeSetting`/`getThemeSettings`\nreturn actual runtime values (constants, computed getters, and in-editor edits) instead\nof the serialized design-time defaults. Called by generated code, not by component authors.",
15212
+ "params": [],
15213
+ "returnType": "void",
15214
+ "categories": [],
15215
+ "related": [],
15216
+ "isAsync": false,
15217
+ "isClass": false
15218
+ },
15219
+ {
15220
+ "name": "getThemeSettings",
15221
+ "signature": "function getThemeSettings(): ThemeSetting[]",
15222
+ "description": "All global variables (Theme Settings) defined for the theme.",
15223
+ "params": [],
15224
+ "returnType": "ThemeSetting[]",
15225
+ "categories": [],
15226
+ "related": [],
15227
+ "isAsync": false,
15228
+ "isClass": false
15229
+ },
15230
+ {
15231
+ "name": "getThemeSetting",
15232
+ "signature": "function getThemeSetting(name: string): ThemeSetting | undefined",
15233
+ "description": "A single global variable by its stable key (`variableName`, e.g. `_6Q0KV7VGGM`).\nDiscover keys via (each item carries a human `displayName`).\nThe returned `value` is the live blueprint value when available, else the default.\nIts shape is discriminated by `type` (see ); note an\nIMAGE setting's value is an image REFERENCE (no `.url`) — resolve with\n`getDefaultSrc`/`getSrc`.",
15234
+ "params": [],
15235
+ "returnType": "ThemeSetting | undefined",
15236
+ "categories": [],
15237
+ "related": [],
15238
+ "isAsync": false,
15239
+ "isClass": false
15240
+ },
15241
+ {
15242
+ "name": "getThemeSettingValue",
15243
+ "signature": "function getThemeSettingValue(name: string): any",
15244
+ "description": "Convenience: the resolved value of a global variable, or `undefined` if not found.",
15245
+ "params": [],
15246
+ "returnType": "any",
15247
+ "categories": [],
15248
+ "related": [],
15249
+ "isAsync": false,
15250
+ "isClass": false
15251
+ },
15252
+ {
15253
+ "name": "getThemeColors",
15254
+ "signature": "function getThemeColors(): RuntimeDesignToken[]",
15255
+ "description": "Theme color tokens. Each carries a resolved value and a `var(--id)` CSS reference.",
15256
+ "params": [],
15257
+ "returnType": "RuntimeDesignToken[]",
15258
+ "categories": [],
15259
+ "related": [],
15260
+ "isAsync": false,
15261
+ "isClass": false
15262
+ },
15263
+ {
15264
+ "name": "getThemeTypography",
15265
+ "signature": "function getThemeTypography(): RuntimeTypographyToken[]",
15266
+ "description": "Theme typography tokens (text styles). Apply `className` or read `resolved` CSS values.",
15267
+ "params": [],
15268
+ "returnType": "RuntimeTypographyToken[]",
15269
+ "categories": [],
15270
+ "related": [],
15271
+ "isAsync": false,
15272
+ "isClass": false
15273
+ },
15274
+ {
15275
+ "name": "getThemeBreakpoints",
15276
+ "signature": "function getThemeBreakpoints(): RuntimeBreakpointToken[]",
15277
+ "description": "Theme responsive breakpoints (`{ id, width }`).",
15278
+ "params": [],
15279
+ "returnType": "RuntimeBreakpointToken[]",
15280
+ "categories": [],
15281
+ "related": [],
15282
+ "isAsync": false,
15283
+ "isClass": false
15284
+ },
15285
+ {
15286
+ "name": "getThemeKeyframes",
15287
+ "signature": "function getThemeKeyframes(): RuntimeKeyframeToken[]",
15288
+ "description": "Theme keyframe/transition animations. Use `ref` as the CSS animation name.",
15289
+ "params": [],
15290
+ "returnType": "RuntimeKeyframeToken[]",
15291
+ "categories": [],
15292
+ "related": [],
15293
+ "isAsync": false,
15294
+ "isClass": false
15295
+ },
15296
+ {
15297
+ "name": "getThemeColorSchemes",
15298
+ "signature": "function getThemeColorSchemes(): RuntimeThemeColorSchemes",
15299
+ "description": "Theme color schemes (palettes). Returns two PARALLEL lists with different jobs:\n- `schemes`: the color SLOTS as `{ id }` only — no colors and no display label live here at\n runtime. A slot's human name is authoring-only (read it via the CLI/MCP `list-theme-globals`\n or the editor); at runtime identify a slot solely by its `id`.\n- `values`: the actual palettes. A palette's colors live in its `colorsByScheme`\n map, keyed by slot id → `{ resolved, cssVar }`.\n\nTo render swatches, iterate `values[].colorsByScheme` (the source of truth for\ncolors), NOT the top-level `schemes` array — `schemes` carries slot ids only, so\niterating it renders empty:\n\n const { values } = getThemeColorSchemes();\n values.forEach(palette =>\n Object.entries(palette.colorsByScheme).forEach(([slotId, { resolved, cssVar }]) => {\n // slotId → stable slot key, cssVar → live var() ref (prefer this), resolved → hex snapshot\n })\n );",
15300
+ "params": [],
15301
+ "returnType": "RuntimeThemeColorSchemes",
15302
+ "categories": [],
15303
+ "related": [],
15304
+ "isAsync": false,
15305
+ "isClass": false
15306
+ },
15119
15307
  {
15120
15308
  "name": "isBrowser",
15121
15309
  "signature": "function isBrowser(yes?: () => void, no?: () => void): void",
@@ -15142,6 +15330,38 @@
15142
15330
  "IkasComponentRendererProps"
15143
15331
  ]
15144
15332
  },
15333
+ {
15334
+ "name": "formatCurrency",
15335
+ "signature": "function formatCurrency(price: number, currencyCode: string, currencySymbol: string | null): string",
15336
+ "description": "Format a free-standing amount with the merchant's currency format settings. Use this for\namounts that are NOT tied to a model (remaining amount to free shipping, gift wrap threshold,\nbulk discount limits, cart limit warnings). For model-bound prices, prefer the\n`get*FormattedPrice` helpers — they call this function internally.\n\nApplies the merchant's `currencyFormats` entry for the given currency code (symbol,\nsymbolPosition, thousandSeparator, decimalSeparator, omitZeroDecimal). Behavior details:\nalways two decimal places, and a space between the symbol and the number. `omitZeroDecimal`\ndrops the fraction only when it is exactly `00`.\n\nDo NOT use `Intl.NumberFormat` for currency — it falls back to the browser locale and\nproduces a format that conflicts with platform-formatted prices on the same screen.",
15337
+ "params": [
15338
+ {
15339
+ "name": "price",
15340
+ "description": "- The amount to format"
15341
+ },
15342
+ {
15343
+ "name": "currencyCode",
15344
+ "description": "- Currency code used to look up the merchant format settings (e.g. \"TRY\", \"USD\")"
15345
+ },
15346
+ {
15347
+ "name": "currencySymbol",
15348
+ "description": "- Fallback symbol used when the merchant has no format entry for the code.\nAlways pass the symbol from the model you took the amount from (e.g. `cart.currencySymbol`) —\npassing `null` can render the amount with no symbol at all."
15349
+ }
15350
+ ],
15351
+ "returns": "The amount formatted with the merchant's currency format (e.g. \"₺ 1,950.00\")",
15352
+ "returnType": "string",
15353
+ "example": "```typescript\nimport { cartStore, formatCurrency } from \"@ikas/bp-storefront\";\n\nfunction FreeShippingBar({ threshold }: { threshold: number }) {\n const cart = cartStore.cart;\n if (!cart) return null;\n\n const remaining = threshold - cart.totalFinalPrice;\n if (remaining <= 0) return <span>Free shipping unlocked!</span>;\n\n return <span>Add {formatCurrency(remaining, cart.currencyCode, cart.currencySymbol)} more for free shipping</span>;\n}\n```",
15354
+ "categories": [
15355
+ "Pricing"
15356
+ ],
15357
+ "related": [
15358
+ "getProductVariantFormattedFinalPrice",
15359
+ "getOrderLineItemFormattedFinalPrice",
15360
+ "getIkasOrderFormattedTotalFinalPrice"
15361
+ ],
15362
+ "isAsync": false,
15363
+ "isClass": false
15364
+ },
15145
15365
  {
15146
15366
  "name": "httpRequest",
15147
15367
  "signature": "async function httpRequest(url: string, method: HttpMethod, body?: Record<string, any>, headers?: Record<string, string>): Promise<FetchResponse>",
@@ -15196,6 +15416,55 @@
15196
15416
  "related": [],
15197
15417
  "isAsync": false,
15198
15418
  "isClass": false
15419
+ },
15420
+ {
15421
+ "name": "PayWithIkas",
15422
+ "signature": "function PayWithIkas({ product, quantity = 1, className, style }: PayWithIkasProps): VNode<ClassAttributes<HTMLIFrameElement> & { ref: MutableRef<HTMLIFrameElement | null>; title: string; ... 4 more ...; style: { ...; }; }> | null",
15423
+ "description": "\"Pay with ikas\" (Hızlı Öde) fast-checkout button for the product detail page.\nDrop-in Preact component that renders the pay-with-ikas checkout iframe and\nwires up its whole message protocol, so a theme gets the one-click \"Hızlı Öde\"\nflow without owning any of the plumbing. Use it next to the add-to-cart button\non the product detail page.\n\nThe pay-with-ikas URL is read from `IkasStorefrontConfig.getPayWithIkasUrl()`;\nwhen the merchant has not enabled Pay with ikas the component renders nothing.\nThe add-to-cart-enabled state is tracked reactively via mobx `autorun`, so the\niframe stays in sync as the product's availability changes (e.g. variant\nselection). Clicking \"Hızlı Öde\" creates a temporary cart via\n`createPayWithIkasSession` and redirects to the returned pay URL.",
15424
+ "params": [
15425
+ {
15426
+ "name": "product",
15427
+ "description": "- The product to fast-checkout via Pay with ikas"
15428
+ },
15429
+ {
15430
+ "name": "quantity",
15431
+ "description": "- Quantity to purchase (defaults to 1)"
15432
+ },
15433
+ {
15434
+ "name": "className",
15435
+ "description": "- Optional CSS class applied to the iframe"
15436
+ },
15437
+ {
15438
+ "name": "style",
15439
+ "description": "- Optional inline styles applied to the iframe"
15440
+ }
15441
+ ],
15442
+ "returnType": "VNode<ClassAttributes<HTMLIFrameElement> & { ref: MutableRef<HTMLIFrameElement | null>; title: string; ... 4 more ...; style: { ...; }; }> | null",
15443
+ "example": "```tsx\nimport { PayWithIkas } from \"@ikas/bp-storefront\";\n\n// On the product detail page, alongside the add-to-cart button:\n<PayWithIkas product={product} quantity={quantity} />\n```",
15444
+ "categories": [
15445
+ "ProductDetail",
15446
+ "Checkout"
15447
+ ],
15448
+ "related": [
15449
+ "createPayWithIkasSession",
15450
+ "isAddToCartEnabled"
15451
+ ],
15452
+ "isAsync": false,
15453
+ "isClass": false,
15454
+ "parameterTypes": [
15455
+ "IkasProps"
15456
+ ]
15457
+ },
15458
+ {
15459
+ "name": "normalizeSvg",
15460
+ "signature": "function normalizeSvg(svg: string, options: NormalizeSvgOptions): string",
15461
+ "description": "Isomorphic, DOM-free normalization of a raw SVG markup string for render.\nSafe to call in SSR, browser, and node — pure string transforms only.",
15462
+ "params": [],
15463
+ "returnType": "string",
15464
+ "categories": [],
15465
+ "related": [],
15466
+ "isAsync": false,
15467
+ "isClass": false
15199
15468
  }
15200
15469
  ],
15201
15470
  "codeExamples": []