@ikas/code-components-mcp 1.4.0-beta.16 → 1.4.0-beta.160
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/data/framework.json +103 -16
- package/data/migration.json +10 -4
- package/data/section-templates/account-info-section/children/AccountFavorites/ikas-config-snippet.json +13 -0
- package/data/section-templates/account-info-section/ikas-config-snippet.json +19 -0
- package/data/section-templates/add-to-cart/ikas-config-snippet.json +17 -0
- package/data/section-templates/add-to-cart/index.tsx +16 -2
- package/data/section-templates/add-to-cart/sub-components/QuantitySelector/index.tsx +11 -3
- package/data/section-templates/add-to-cart/utils/cartLimits.ts +23 -0
- package/data/section-templates/blog-home-section/ikas-config-snippet.json +2 -0
- package/data/section-templates/blog-post-section/ikas-config-snippet.json +2 -0
- package/data/section-templates/bundle-products/hooks/useBundleProducts.ts +7 -6
- package/data/section-templates/bundle-products/ikas-config-snippet.json +20 -0
- package/data/section-templates/cart-section/sub-components/CartItem/index.tsx +57 -24
- package/data/section-templates/cart-section/sub-components/CartItem/styles.css +14 -0
- package/data/section-templates/cart-section/sub-components/QuantitySelector/index.tsx +11 -3
- package/data/section-templates/category-images-section/children/CategoryImageItem/ikas-config-snippet.json +4 -0
- package/data/section-templates/category-images-section/ikas-config-snippet.json +15 -0
- package/data/section-templates/category-list-section/children/CardProductName/ikas-config-snippet.json +2 -1
- package/data/section-templates/category-list-section/ikas-config-snippet.json +21 -0
- package/data/section-templates/component-renderer/ikas-config-snippet.json +13 -0
- package/data/section-templates/favorites/ikas-config-snippet.json +18 -1
- package/data/section-templates/features-section/ikas-config-snippet.json +13 -0
- package/data/section-templates/footer-section/ikas-config-snippet.json +15 -0
- package/data/section-templates/header-section/children/Announcements/ikas-config-snippet.json +7 -0
- package/data/section-templates/header-section/children/CookieBar/ikas-config-snippet.json +3 -0
- package/data/section-templates/header-section/children/Navbar/ikas-config-snippet.json +27 -0
- package/data/section-templates/header-section/ikas-config-snippet.json +13 -0
- package/data/section-templates/header-section/sub-components/CartItem/index.tsx +57 -24
- package/data/section-templates/header-section/sub-components/CartItem/styles.css +14 -0
- package/data/section-templates/header-section/sub-components/QuantitySelector/index.tsx +11 -3
- package/data/section-templates/hero-slider-section/children/HeroSliderItem/ikas-config-snippet.json +18 -0
- package/data/section-templates/hero-slider-section/ikas-config-snippet.json +13 -0
- package/data/section-templates/image-handling/ikas-config-snippet.json +53 -0
- package/data/section-templates/login-section/ikas-config-snippet.json +2 -0
- package/data/section-templates/navigation/ikas-config-snippet.json +27 -0
- package/data/section-templates/navigation/sub-components/CartItem/index.tsx +57 -24
- package/data/section-templates/navigation/sub-components/CartItem/styles.css +14 -0
- package/data/section-templates/navigation/sub-components/QuantitySelector/index.tsx +11 -3
- package/data/section-templates/product-detail-section/children/ProductDetailAddToCart/ikas-config-snippet.json +17 -0
- package/data/section-templates/product-detail-section/children/ProductDetailAddToCart/index.tsx +16 -2
- package/data/section-templates/product-detail-section/children/ProductDetailBackInStock/components/BackInStockForm/index.tsx +92 -0
- package/data/section-templates/product-detail-section/children/ProductDetailBackInStock/ikas-config-snippet.json +175 -0
- package/data/section-templates/product-detail-section/children/ProductDetailBackInStock/index.tsx +141 -0
- package/data/section-templates/product-detail-section/children/ProductDetailBackInStock/styles.css +47 -0
- package/data/section-templates/product-detail-section/children/ProductDetailBackInStock/types.ts +25 -0
- package/data/section-templates/product-detail-section/children/ProductDetailBundleFurniture/ikas-config-snippet.json +18 -0
- package/data/section-templates/product-detail-section/children/ProductDetailBundleProduct/ikas-config-snippet.json +20 -0
- package/data/section-templates/product-detail-section/children/ProductDetailDescription/ikas-config-snippet.json +27 -0
- package/data/section-templates/product-detail-section/children/ProductDetailFeatures/ikas-config-snippet.json +29 -0
- package/data/section-templates/product-detail-section/children/ProductDetailNameFavorite/ikas-config-snippet.json +18 -1
- package/data/section-templates/product-detail-section/children/ProductDetailOffer/ikas-config-snippet.json +20 -0
- package/data/section-templates/product-detail-section/children/ProductDetailOptionSet/ikas-config-snippet.json +16 -0
- package/data/section-templates/product-detail-section/children/ProductDetailPrices/ikas-config-snippet.json +16 -0
- package/data/section-templates/product-detail-section/children/ProductDetailProductGroup/ikas-config-snippet.json +16 -0
- package/data/section-templates/product-detail-section/children/ProductDetailSku/ikas-config-snippet.json +16 -0
- package/data/section-templates/product-detail-section/children/ProductDetailVariant/ikas-config-snippet.json +17 -0
- package/data/section-templates/product-detail-section/hooks/useBundleProducts.ts +7 -6
- package/data/section-templates/product-detail-section/ikas-config-snippet.json +53 -0
- package/data/section-templates/product-detail-section/sub-components/Modal/index.tsx +120 -0
- package/data/section-templates/product-detail-section/sub-components/Modal/styles.css +70 -0
- package/data/section-templates/product-detail-section/sub-components/QuantitySelector/index.tsx +11 -3
- package/data/section-templates/product-detail-section/utils/cartLimits.ts +23 -0
- package/data/section-templates/product-pricing/ikas-config-snippet.json +16 -0
- package/data/section-templates/product-slider-section/children/CardProductName/ikas-config-snippet.json +2 -1
- package/data/section-templates/product-slider-section/ikas-config-snippet.json +17 -0
- package/data/section-templates/register-section/ikas-config-snippet.json +2 -0
- package/data/section-templates/variant-selection/ikas-config-snippet.json +17 -0
- package/data/storefront-api.json +239 -27
- package/data/storefront-types.json +9071 -5740
- package/dist/index.js +1242 -28
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* ── Modal ── */
|
|
2
|
+
.kombos-modal {
|
|
3
|
+
position: fixed;
|
|
4
|
+
inset: 0;
|
|
5
|
+
z-index: var(--kombos-z-overlay);
|
|
6
|
+
background: rgba(0, 0, 0, 0.35);
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
opacity: 0;
|
|
11
|
+
transition: opacity 0.3s;
|
|
12
|
+
padding: 1rem;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.kombos-modal--open {
|
|
16
|
+
opacity: 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.kombos-modal__panel {
|
|
20
|
+
background: var(--kombos-white);
|
|
21
|
+
border-radius: 6px;
|
|
22
|
+
width: 100%;
|
|
23
|
+
max-height: 90vh;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
transform: translateY(1rem);
|
|
27
|
+
transition: transform 0.3s;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.kombos-modal--open .kombos-modal__panel {
|
|
31
|
+
transform: translateY(0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.kombos-modal__header {
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
align-items: center;
|
|
38
|
+
background: var(--kombos-white);
|
|
39
|
+
padding: 1.5rem;
|
|
40
|
+
border-bottom: 1px solid var(--kombos-gray-200);
|
|
41
|
+
border-radius: 6px 6px 0 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.kombos-modal__title {
|
|
45
|
+
color: var(--kombos-gray-900);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.kombos-modal__close {
|
|
49
|
+
background: none;
|
|
50
|
+
border: none;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
padding: 0;
|
|
53
|
+
color: var(--kombos-gray-700);
|
|
54
|
+
font-size: 1.25rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.kombos-modal__body {
|
|
58
|
+
padding: 1.5rem;
|
|
59
|
+
overflow-y: auto;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.kombos-modal__footer {
|
|
63
|
+
background: var(--kombos-white);
|
|
64
|
+
padding: 1.5rem;
|
|
65
|
+
border-top: 1px solid var(--kombos-gray-200);
|
|
66
|
+
border-radius: 0 0 6px 6px;
|
|
67
|
+
display: flex;
|
|
68
|
+
gap: 0.75rem;
|
|
69
|
+
justify-content: flex-end;
|
|
70
|
+
}
|
package/data/section-templates/product-detail-section/sub-components/QuantitySelector/index.tsx
CHANGED
|
@@ -5,20 +5,27 @@ interface Props {
|
|
|
5
5
|
value: number;
|
|
6
6
|
onChange: (value: number) => void;
|
|
7
7
|
size?: "default" | "sm";
|
|
8
|
+
min?: number;
|
|
9
|
+
max?: number;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
export default function QuantitySelector({
|
|
11
13
|
value,
|
|
12
14
|
onChange,
|
|
13
15
|
size = "default",
|
|
16
|
+
min = 1,
|
|
17
|
+
max,
|
|
14
18
|
}: Props) {
|
|
19
|
+
const canDecrease = value > min;
|
|
20
|
+
const canIncrease = max == null || value < max;
|
|
21
|
+
|
|
15
22
|
return (
|
|
16
23
|
<div className={cx("kombos-pd__qty", size === "sm" && "kombos-pd__qty--sm")}>
|
|
17
24
|
<button
|
|
18
25
|
type="button"
|
|
19
26
|
className="kombos-pd__qty-btn"
|
|
20
|
-
onClick={() => onChange(Math.max(
|
|
21
|
-
disabled={
|
|
27
|
+
onClick={() => onChange(Math.max(min, value - 1))}
|
|
28
|
+
disabled={!canDecrease}
|
|
22
29
|
aria-label="Decrease quantity"
|
|
23
30
|
>
|
|
24
31
|
<MinusSVG />
|
|
@@ -31,7 +38,8 @@ export default function QuantitySelector({
|
|
|
31
38
|
<button
|
|
32
39
|
type="button"
|
|
33
40
|
className="kombos-pd__qty-btn"
|
|
34
|
-
onClick={() => onChange(value + 1)}
|
|
41
|
+
onClick={() => onChange(max == null ? value + 1 : Math.min(max, value + 1))}
|
|
42
|
+
disabled={!canIncrease}
|
|
35
43
|
aria-label="Increase quantity"
|
|
36
44
|
>
|
|
37
45
|
<PlusSVG />
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IkasProduct, IkasStorefrontConfig } from "@ikas/bp-storefront";
|
|
2
|
+
|
|
3
|
+
export interface CartQuantityLimits {
|
|
4
|
+
min: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the per-cart quantity limits for a product from its active sales
|
|
10
|
+
* channel. Falls back to a minimum of 1 and no maximum when the channel or its
|
|
11
|
+
* limits are not set. `addItemToCart` clamps to the same limits internally, so
|
|
12
|
+
* applying these in the stepper keeps the UI honest instead of letting the
|
|
13
|
+
* quantity snap silently.
|
|
14
|
+
*/
|
|
15
|
+
export function getProductCartLimits(product: IkasProduct): CartQuantityLimits {
|
|
16
|
+
const channel = product.salesChannels?.find(
|
|
17
|
+
(sc) => sc.id === IkasStorefrontConfig.salesChannelId,
|
|
18
|
+
);
|
|
19
|
+
return {
|
|
20
|
+
min: channel?.minQuantityPerCart ?? 1,
|
|
21
|
+
max: channel?.maxQuantityPerCart ?? undefined,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"displayName": "Top Spacing",
|
|
17
17
|
"type": "TYPE",
|
|
18
18
|
"required": false,
|
|
19
|
+
"defaultValue": {
|
|
20
|
+
"value": 0,
|
|
21
|
+
"unit": "px"
|
|
22
|
+
},
|
|
19
23
|
"groupId": "mobile",
|
|
20
24
|
"typeId": "@ikas/bp-storefront-models-MarginTopStyleType"
|
|
21
25
|
},
|
|
@@ -24,6 +28,10 @@
|
|
|
24
28
|
"displayName": "Bottom Spacing",
|
|
25
29
|
"type": "TYPE",
|
|
26
30
|
"required": false,
|
|
31
|
+
"defaultValue": {
|
|
32
|
+
"value": 0,
|
|
33
|
+
"unit": "px"
|
|
34
|
+
},
|
|
27
35
|
"groupId": "mobile",
|
|
28
36
|
"typeId": "@ikas/bp-storefront-models-MarginBottomStyleType"
|
|
29
37
|
},
|
|
@@ -32,6 +40,10 @@
|
|
|
32
40
|
"displayName": "Top Spacing",
|
|
33
41
|
"type": "TYPE",
|
|
34
42
|
"required": false,
|
|
43
|
+
"defaultValue": {
|
|
44
|
+
"value": 0,
|
|
45
|
+
"unit": "px"
|
|
46
|
+
},
|
|
35
47
|
"groupId": "desktop",
|
|
36
48
|
"typeId": "@ikas/bp-storefront-models-MarginTopStyleType"
|
|
37
49
|
},
|
|
@@ -40,6 +52,10 @@
|
|
|
40
52
|
"displayName": "Bottom Spacing",
|
|
41
53
|
"type": "TYPE",
|
|
42
54
|
"required": false,
|
|
55
|
+
"defaultValue": {
|
|
56
|
+
"value": 0,
|
|
57
|
+
"unit": "px"
|
|
58
|
+
},
|
|
43
59
|
"groupId": "desktop",
|
|
44
60
|
"typeId": "@ikas/bp-storefront-models-MarginBottomStyleType"
|
|
45
61
|
}
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"displayName": "Column Count",
|
|
58
58
|
"type": "ENUM",
|
|
59
59
|
"required": false,
|
|
60
|
+
"defaultValue": "Four",
|
|
60
61
|
"groupId": "appearance",
|
|
61
62
|
"enumTypeId": "{{ENUM_ID:NumberOfColumns}}"
|
|
62
63
|
},
|
|
@@ -65,6 +66,7 @@
|
|
|
65
66
|
"displayName": "Aspect Ratio",
|
|
66
67
|
"type": "ENUM",
|
|
67
68
|
"required": false,
|
|
69
|
+
"defaultValue": "Square",
|
|
68
70
|
"groupId": "appearance",
|
|
69
71
|
"enumTypeId": "{{ENUM_ID:AspectRatio}}"
|
|
70
72
|
},
|
|
@@ -73,6 +75,7 @@
|
|
|
73
75
|
"displayName": "Image Fit",
|
|
74
76
|
"type": "ENUM",
|
|
75
77
|
"required": false,
|
|
78
|
+
"defaultValue": "Cover",
|
|
76
79
|
"groupId": "appearance",
|
|
77
80
|
"enumTypeId": "{{ENUM_ID:ObjectFit}}"
|
|
78
81
|
},
|
|
@@ -81,6 +84,7 @@
|
|
|
81
84
|
"displayName": "Hide Add to Cart Button",
|
|
82
85
|
"type": "BOOLEAN",
|
|
83
86
|
"required": false,
|
|
87
|
+
"defaultValue": false,
|
|
84
88
|
"groupId": "appearance"
|
|
85
89
|
},
|
|
86
90
|
{
|
|
@@ -88,6 +92,19 @@
|
|
|
88
92
|
"displayName": "Components",
|
|
89
93
|
"type": "COMPONENT_LIST",
|
|
90
94
|
"required": false,
|
|
95
|
+
"defaultValue": {
|
|
96
|
+
"components": [
|
|
97
|
+
{
|
|
98
|
+
"codeComponentId": "nb34u3yu-card-product-name"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"codeComponentId": "nb34u3yu-card-product-variants"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"codeComponentId": "nb34u3yu-card-product-price"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
91
108
|
"privateVarMap": {
|
|
92
109
|
"product": {
|
|
93
110
|
"id": "pvm_1772803530689_1",
|
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
"displayName": "Google Login",
|
|
143
143
|
"type": "BOOLEAN",
|
|
144
144
|
"required": false,
|
|
145
|
+
"defaultValue": false,
|
|
145
146
|
"groupId": "google"
|
|
146
147
|
},
|
|
147
148
|
{
|
|
@@ -157,6 +158,7 @@
|
|
|
157
158
|
"displayName": "Facebook Login",
|
|
158
159
|
"type": "BOOLEAN",
|
|
159
160
|
"required": false,
|
|
161
|
+
"defaultValue": false,
|
|
160
162
|
"groupId": "facebook"
|
|
161
163
|
},
|
|
162
164
|
{
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"displayName": "Top Spacing",
|
|
17
17
|
"type": "TYPE",
|
|
18
18
|
"required": false,
|
|
19
|
+
"defaultValue": {
|
|
20
|
+
"value": 0,
|
|
21
|
+
"unit": "px"
|
|
22
|
+
},
|
|
19
23
|
"groupId": "mobile",
|
|
20
24
|
"typeId": "@ikas/bp-storefront-models-MarginTopStyleType"
|
|
21
25
|
},
|
|
@@ -24,6 +28,10 @@
|
|
|
24
28
|
"displayName": "Bottom Spacing",
|
|
25
29
|
"type": "TYPE",
|
|
26
30
|
"required": false,
|
|
31
|
+
"defaultValue": {
|
|
32
|
+
"value": 0,
|
|
33
|
+
"unit": "px"
|
|
34
|
+
},
|
|
27
35
|
"groupId": "mobile",
|
|
28
36
|
"typeId": "@ikas/bp-storefront-models-MarginBottomStyleType"
|
|
29
37
|
},
|
|
@@ -32,6 +40,10 @@
|
|
|
32
40
|
"displayName": "Top Spacing",
|
|
33
41
|
"type": "TYPE",
|
|
34
42
|
"required": false,
|
|
43
|
+
"defaultValue": {
|
|
44
|
+
"value": 0,
|
|
45
|
+
"unit": "px"
|
|
46
|
+
},
|
|
35
47
|
"groupId": "desktop",
|
|
36
48
|
"typeId": "@ikas/bp-storefront-models-MarginTopStyleType"
|
|
37
49
|
},
|
|
@@ -40,6 +52,10 @@
|
|
|
40
52
|
"displayName": "Bottom Spacing",
|
|
41
53
|
"type": "TYPE",
|
|
42
54
|
"required": false,
|
|
55
|
+
"defaultValue": {
|
|
56
|
+
"value": 0,
|
|
57
|
+
"unit": "px"
|
|
58
|
+
},
|
|
43
59
|
"groupId": "desktop",
|
|
44
60
|
"typeId": "@ikas/bp-storefront-models-MarginBottomStyleType"
|
|
45
61
|
},
|
|
@@ -48,6 +64,7 @@
|
|
|
48
64
|
"displayName": "Image Variant",
|
|
49
65
|
"type": "BOOLEAN",
|
|
50
66
|
"required": false,
|
|
67
|
+
"defaultValue": false,
|
|
51
68
|
"description": "Use product images for color variant."
|
|
52
69
|
}
|
|
53
70
|
],
|