@ikas/component-cli 0.133.0 → 1.1.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.
- package/dist/commands/create.d.ts +8 -3
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +8 -227
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +120 -31
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/proxy.js +1 -1
- package/dist/commands/proxy.js.map +1 -1
- package/package.json +4 -5
- package/bin/create-ikas-component.js +0 -8
- package/templates/create/README.md +0 -50
- package/templates/create/claude-md +0 -275
- package/templates/create/cursorrules +0 -123
- package/templates/create/gitignore +0 -6
- package/templates/create/ikas.config.json +0 -95
- package/templates/create/mcp.json +0 -10
- package/templates/create/package.json +0 -22
- package/templates/create/src/components/ExampleComponent/index.tsx +0 -22
- package/templates/create/src/components/ExampleComponent/styles.css +0 -36
- package/templates/create/src/components/ExampleComponent/types.ts +0 -7
- package/templates/create/src/components/ExampleSection/index.tsx +0 -14
- package/templates/create/src/components/ExampleSection/styles.css +0 -29
- package/templates/create/src/components/ExampleSection/types.ts +0 -6
- package/templates/create/src/components/index.ts +0 -2
- package/templates/create/src/global-types.ts +0 -5
- package/templates/create/src/global.css +0 -29
- package/templates/create/src/ikas-component-utils.d.ts +0 -3
- package/templates/create/tsconfig.json +0 -30
- package/templates/create/vite.config.ts +0 -15
- package/templates/create-full/README.md +0 -78
- package/templates/create-full/claude-md +0 -752
- package/templates/create-full/cursorrules +0 -117
- package/templates/create-full/gitignore +0 -4
- package/templates/create-full/ikas.config.json +0 -5009
- package/templates/create-full/mcp.json +0 -10
- package/templates/create-full/package.json +0 -23
- package/templates/create-full/src/components/AccountAddresses/components/AddressCard/index.tsx +0 -55
- package/templates/create-full/src/components/AccountAddresses/components/AddressCard/styles.css +0 -46
- package/templates/create-full/src/components/AccountAddresses/components/AddressModal/index.tsx +0 -298
- package/templates/create-full/src/components/AccountAddresses/components/AddressModal/styles.css +0 -23
- package/templates/create-full/src/components/AccountAddresses/index.tsx +0 -127
- package/templates/create-full/src/components/AccountAddresses/styles.css +0 -41
- package/templates/create-full/src/components/AccountAddresses/types.ts +0 -15
- package/templates/create-full/src/components/AccountFavorites/index.tsx +0 -82
- package/templates/create-full/src/components/AccountFavorites/styles.css +0 -52
- package/templates/create-full/src/components/AccountFavorites/types.ts +0 -7
- package/templates/create-full/src/components/AccountInfo/components/AccountSidebar/index.tsx +0 -171
- package/templates/create-full/src/components/AccountInfo/components/AccountSidebar/styles.css +0 -144
- package/templates/create-full/src/components/AccountInfo/index.tsx +0 -91
- package/templates/create-full/src/components/AccountInfo/styles.css +0 -35
- package/templates/create-full/src/components/AccountInfo/types.ts +0 -9
- package/templates/create-full/src/components/AccountInfoContent/index.tsx +0 -134
- package/templates/create-full/src/components/AccountInfoContent/styles.css +0 -57
- package/templates/create-full/src/components/AccountInfoContent/types.ts +0 -8
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderHeader/index.tsx +0 -78
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderHeader/styles.css +0 -46
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderItemRow/index.tsx +0 -20
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderItemRow/styles.css +0 -16
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderLineItemDisplay/index.tsx +0 -112
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderLineItemDisplay/styles.css +0 -86
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderSidebar/index.tsx +0 -195
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderSidebar/styles.css +0 -93
- package/templates/create-full/src/components/AccountOrderDetail/components/PackageGroup/index.tsx +0 -156
- package/templates/create-full/src/components/AccountOrderDetail/components/PackageGroup/styles.css +0 -100
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnItemRow/index.tsx +0 -56
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnItemRow/styles.css +0 -57
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnView/index.tsx +0 -159
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnView/styles.css +0 -29
- package/templates/create-full/src/components/AccountOrderDetail/index.tsx +0 -244
- package/templates/create-full/src/components/AccountOrderDetail/styles.css +0 -125
- package/templates/create-full/src/components/AccountOrderDetail/types.ts +0 -32
- package/templates/create-full/src/components/AccountOrders/components/OrderCard/index.tsx +0 -122
- package/templates/create-full/src/components/AccountOrders/components/OrderCard/styles.css +0 -114
- package/templates/create-full/src/components/AccountOrders/index.tsx +0 -105
- package/templates/create-full/src/components/AccountOrders/styles.css +0 -36
- package/templates/create-full/src/components/AccountOrders/types.ts +0 -11
- package/templates/create-full/src/components/Announcement/index.tsx +0 -11
- package/templates/create-full/src/components/Announcement/styles.css +0 -4
- package/templates/create-full/src/components/Announcement/types.ts +0 -4
- package/templates/create-full/src/components/Announcements/index.tsx +0 -91
- package/templates/create-full/src/components/Announcements/styles.css +0 -46
- package/templates/create-full/src/components/Announcements/types.ts +0 -8
- package/templates/create-full/src/components/BlogHome/components/BlogCard/index.tsx +0 -89
- package/templates/create-full/src/components/BlogHome/components/BlogCard/styles.css +0 -121
- package/templates/create-full/src/components/BlogHome/index.tsx +0 -124
- package/templates/create-full/src/components/BlogHome/styles.css +0 -118
- package/templates/create-full/src/components/BlogHome/types.ts +0 -15
- package/templates/create-full/src/components/BlogPost/index.tsx +0 -128
- package/templates/create-full/src/components/BlogPost/styles.css +0 -120
- package/templates/create-full/src/components/BlogPost/types.ts +0 -12
- package/templates/create-full/src/components/CardProductName/index.tsx +0 -25
- package/templates/create-full/src/components/CardProductName/styles.css +0 -22
- package/templates/create-full/src/components/CardProductName/types.ts +0 -7
- package/templates/create-full/src/components/CardProductPrice/index.tsx +0 -30
- package/templates/create-full/src/components/CardProductPrice/styles.css +0 -13
- package/templates/create-full/src/components/CardProductPrice/types.ts +0 -6
- package/templates/create-full/src/components/CardProductVariants/index.tsx +0 -10
- package/templates/create-full/src/components/CardProductVariants/styles.css +0 -1
- package/templates/create-full/src/components/CardProductVariants/types.ts +0 -6
- package/templates/create-full/src/components/CartPage/components/CouponCode/index.tsx +0 -108
- package/templates/create-full/src/components/CartPage/components/CouponCode/styles.css +0 -68
- package/templates/create-full/src/components/CartPage/components/EmptyState/index.tsx +0 -31
- package/templates/create-full/src/components/CartPage/components/EmptyState/styles.css +0 -18
- package/templates/create-full/src/components/CartPage/components/OrderSummary/index.tsx +0 -106
- package/templates/create-full/src/components/CartPage/components/OrderSummary/styles.css +0 -70
- package/templates/create-full/src/components/CartPage/index.tsx +0 -107
- package/templates/create-full/src/components/CartPage/styles.css +0 -54
- package/templates/create-full/src/components/CartPage/types.ts +0 -16
- package/templates/create-full/src/components/CategoryImageItem/components/Card/index.tsx +0 -64
- package/templates/create-full/src/components/CategoryImageItem/components/Card/styles.css +0 -56
- package/templates/create-full/src/components/CategoryImageItem/index.tsx +0 -64
- package/templates/create-full/src/components/CategoryImageItem/styles.css +0 -10
- package/templates/create-full/src/components/CategoryImageItem/types.ts +0 -16
- package/templates/create-full/src/components/CategoryImages/index.tsx +0 -62
- package/templates/create-full/src/components/CategoryImages/styles.css +0 -38
- package/templates/create-full/src/components/CategoryImages/types.ts +0 -11
- package/templates/create-full/src/components/CategoryList/components/CategoryListControls/index.tsx +0 -129
- package/templates/create-full/src/components/CategoryList/components/CategoryListControls/styles.css +0 -99
- package/templates/create-full/src/components/CategoryList/components/FilterBoxValues/index.tsx +0 -42
- package/templates/create-full/src/components/CategoryList/components/FilterBoxValues/styles.css +0 -27
- package/templates/create-full/src/components/CategoryList/components/FilterCategoryList/index.tsx +0 -43
- package/templates/create-full/src/components/CategoryList/components/FilterCategoryList/styles.css +0 -20
- package/templates/create-full/src/components/CategoryList/components/FilterGroupValues/index.tsx +0 -114
- package/templates/create-full/src/components/CategoryList/components/FilterGroupValues/styles.css +0 -1
- package/templates/create-full/src/components/CategoryList/components/FilterListValues/index.tsx +0 -54
- package/templates/create-full/src/components/CategoryList/components/FilterListValues/styles.css +0 -22
- package/templates/create-full/src/components/CategoryList/components/FilterRangeListValues/index.tsx +0 -50
- package/templates/create-full/src/components/CategoryList/components/FilterRangeListValues/styles.css +0 -25
- package/templates/create-full/src/components/CategoryList/components/FilterRangeValues/index.tsx +0 -189
- package/templates/create-full/src/components/CategoryList/components/FilterRangeValues/styles.css +0 -89
- package/templates/create-full/src/components/CategoryList/components/FilterSidebar/index.tsx +0 -92
- package/templates/create-full/src/components/CategoryList/components/FilterSidebar/styles.css +0 -27
- package/templates/create-full/src/components/CategoryList/components/FilterSwatchValues/index.tsx +0 -63
- package/templates/create-full/src/components/CategoryList/components/FilterSwatchValues/styles.css +0 -48
- package/templates/create-full/src/components/CategoryList/components/MobileFilterModal/index.tsx +0 -146
- package/templates/create-full/src/components/CategoryList/components/MobileFilterModal/styles.css +0 -133
- package/templates/create-full/src/components/CategoryList/index.tsx +0 -333
- package/templates/create-full/src/components/CategoryList/styles.css +0 -110
- package/templates/create-full/src/components/CategoryList/types.ts +0 -30
- package/templates/create-full/src/components/CollapsibleContent/index.tsx +0 -23
- package/templates/create-full/src/components/CollapsibleContent/styles.css +0 -11
- package/templates/create-full/src/components/CollapsibleContent/types.ts +0 -6
- package/templates/create-full/src/components/CookieBar/index.tsx +0 -78
- package/templates/create-full/src/components/CookieBar/styles.css +0 -111
- package/templates/create-full/src/components/CookieBar/types.ts +0 -10
- package/templates/create-full/src/components/CustomerEmailVerification/index.tsx +0 -168
- package/templates/create-full/src/components/CustomerEmailVerification/styles.css +0 -118
- package/templates/create-full/src/components/CustomerEmailVerification/types.ts +0 -17
- package/templates/create-full/src/components/FeatureItem/index.tsx +0 -27
- package/templates/create-full/src/components/FeatureItem/styles.css +0 -19
- package/templates/create-full/src/components/FeatureItem/types.ts +0 -7
- package/templates/create-full/src/components/Features/index.tsx +0 -25
- package/templates/create-full/src/components/Features/styles.css +0 -39
- package/templates/create-full/src/components/Features/types.ts +0 -5
- package/templates/create-full/src/components/Footer/index.tsx +0 -154
- package/templates/create-full/src/components/Footer/styles.css +0 -175
- package/templates/create-full/src/components/Footer/types.ts +0 -15
- package/templates/create-full/src/components/ForgotPassword/components/ForgotPasswordForm/index.tsx +0 -129
- package/templates/create-full/src/components/ForgotPassword/components/ForgotPasswordForm/styles.css +0 -0
- package/templates/create-full/src/components/ForgotPassword/index.tsx +0 -30
- package/templates/create-full/src/components/ForgotPassword/styles.css +0 -85
- package/templates/create-full/src/components/ForgotPassword/types.ts +0 -13
- package/templates/create-full/src/components/Header/index.tsx +0 -46
- package/templates/create-full/src/components/Header/styles.css +0 -4
- package/templates/create-full/src/components/Header/types.ts +0 -4
- package/templates/create-full/src/components/HeroSlider/index.tsx +0 -110
- package/templates/create-full/src/components/HeroSlider/styles.css +0 -129
- package/templates/create-full/src/components/HeroSlider/types.ts +0 -9
- package/templates/create-full/src/components/HeroSliderItem/index.tsx +0 -231
- package/templates/create-full/src/components/HeroSliderItem/styles.css +0 -152
- package/templates/create-full/src/components/HeroSliderItem/types.ts +0 -34
- package/templates/create-full/src/components/Login/components/LoginForm/index.tsx +0 -181
- package/templates/create-full/src/components/Login/components/LoginForm/styles.css +0 -0
- package/templates/create-full/src/components/Login/index.tsx +0 -37
- package/templates/create-full/src/components/Login/styles.css +0 -129
- package/templates/create-full/src/components/Login/types.ts +0 -18
- package/templates/create-full/src/components/Navbar/components/CartSidebar/index.tsx +0 -203
- package/templates/create-full/src/components/Navbar/components/CartSidebar/styles.css +0 -175
- package/templates/create-full/src/components/Navbar/components/MobileMenu/index.tsx +0 -198
- package/templates/create-full/src/components/Navbar/components/MobileMenu/styles.css +0 -122
- package/templates/create-full/src/components/Navbar/components/NavItem/index.tsx +0 -65
- package/templates/create-full/src/components/Navbar/components/SearchModal/index.tsx +0 -339
- package/templates/create-full/src/components/Navbar/components/SearchModal/styles.css +0 -191
- package/templates/create-full/src/components/Navbar/index.tsx +0 -254
- package/templates/create-full/src/components/Navbar/styles.css +0 -254
- package/templates/create-full/src/components/Navbar/types.ts +0 -42
- package/templates/create-full/src/components/NotFound/index.tsx +0 -39
- package/templates/create-full/src/components/NotFound/styles.css +0 -46
- package/templates/create-full/src/components/NotFound/types.ts +0 -8
- package/templates/create-full/src/components/ProductDetail/components/ProductGallery/index.tsx +0 -316
- package/templates/create-full/src/components/ProductDetail/components/ProductGallery/styles.css +0 -213
- package/templates/create-full/src/components/ProductDetail/index.tsx +0 -92
- package/templates/create-full/src/components/ProductDetail/styles.css +0 -58
- package/templates/create-full/src/components/ProductDetail/types.ts +0 -12
- package/templates/create-full/src/components/ProductDetailAddToCart/components/PayWithIkas/index.tsx +0 -34
- package/templates/create-full/src/components/ProductDetailAddToCart/components/PayWithIkas/styles.css +0 -4
- package/templates/create-full/src/components/ProductDetailAddToCart/index.tsx +0 -146
- package/templates/create-full/src/components/ProductDetailAddToCart/styles.css +0 -27
- package/templates/create-full/src/components/ProductDetailAddToCart/types.ts +0 -18
- package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureRow/index.tsx +0 -164
- package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureSection/index.tsx +0 -134
- package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureSection/styles.css +0 -188
- package/templates/create-full/src/components/ProductDetailBundleFurniture/index.tsx +0 -61
- package/templates/create-full/src/components/ProductDetailBundleFurniture/styles.css +0 -12
- package/templates/create-full/src/components/ProductDetailBundleFurniture/types.ts +0 -21
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleProductItem/index.tsx +0 -169
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleProductItem/styles.css +0 -141
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleSkeletonLoading/index.tsx +0 -35
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleSkeletonLoading/styles.css +0 -85
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureRow/index.tsx +0 -51
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureRow/styles.css +0 -30
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureView/index.tsx +0 -54
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureView/styles.css +0 -22
- package/templates/create-full/src/components/ProductDetailBundleProduct/index.tsx +0 -101
- package/templates/create-full/src/components/ProductDetailBundleProduct/styles.css +0 -20
- package/templates/create-full/src/components/ProductDetailBundleProduct/types.ts +0 -18
- package/templates/create-full/src/components/ProductDetailDescription/index.tsx +0 -56
- package/templates/create-full/src/components/ProductDetailDescription/styles.css +0 -21
- package/templates/create-full/src/components/ProductDetailDescription/types.ts +0 -13
- package/templates/create-full/src/components/ProductDetailFeatureItem/index.tsx +0 -28
- package/templates/create-full/src/components/ProductDetailFeatureItem/styles.css +0 -22
- package/templates/create-full/src/components/ProductDetailFeatureItem/types.ts +0 -7
- package/templates/create-full/src/components/ProductDetailFeatures/index.tsx +0 -40
- package/templates/create-full/src/components/ProductDetailFeatures/styles.css +0 -17
- package/templates/create-full/src/components/ProductDetailFeatures/types.ts +0 -10
- package/templates/create-full/src/components/ProductDetailNameFavorite/index.tsx +0 -66
- package/templates/create-full/src/components/ProductDetailNameFavorite/styles.css +0 -45
- package/templates/create-full/src/components/ProductDetailNameFavorite/types.ts +0 -11
- package/templates/create-full/src/components/ProductDetailOffer/components/OfferCard/index.tsx +0 -209
- package/templates/create-full/src/components/ProductDetailOffer/components/OfferCard/styles.css +0 -146
- package/templates/create-full/src/components/ProductDetailOffer/components/OfferSummary/index.tsx +0 -175
- package/templates/create-full/src/components/ProductDetailOffer/index.tsx +0 -199
- package/templates/create-full/src/components/ProductDetailOffer/styles.css +0 -211
- package/templates/create-full/src/components/ProductDetailOffer/types.ts +0 -24
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionCheckbox/index.tsx +0 -52
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionCheckbox/styles.css +0 -19
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceBox/index.tsx +0 -60
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceBox/styles.css +0 -38
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSelect/index.tsx +0 -102
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSelect/styles.css +0 -34
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSwatch/index.tsx +0 -121
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSwatch/styles.css +0 -87
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/index.tsx +0 -57
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionColorPicker/index.tsx +0 -54
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionColorPicker/styles.css +0 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionDatePicker/index.tsx +0 -124
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionDatePicker/styles.css +0 -1
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionFile/index.tsx +0 -217
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionFile/styles.css +0 -87
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionRenderer/index.tsx +0 -133
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionText/index.tsx +0 -60
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionText/styles.css +0 -1
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionTextarea/index.tsx +0 -74
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionTextarea/styles.css +0 -10
- package/templates/create-full/src/components/ProductDetailOptionSet/index.tsx +0 -99
- package/templates/create-full/src/components/ProductDetailOptionSet/styles.css +0 -30
- package/templates/create-full/src/components/ProductDetailOptionSet/types.ts +0 -21
- package/templates/create-full/src/components/ProductDetailPrices/index.tsx +0 -62
- package/templates/create-full/src/components/ProductDetailPrices/styles.css +0 -32
- package/templates/create-full/src/components/ProductDetailPrices/types.ts +0 -10
- package/templates/create-full/src/components/ProductDetailProductGroup/index.tsx +0 -74
- package/templates/create-full/src/components/ProductDetailProductGroup/styles.css +0 -33
- package/templates/create-full/src/components/ProductDetailProductGroup/types.ts +0 -10
- package/templates/create-full/src/components/ProductDetailReviews/index.tsx +0 -205
- package/templates/create-full/src/components/ProductDetailReviews/styles.css +0 -43
- package/templates/create-full/src/components/ProductDetailReviews/types.ts +0 -19
- package/templates/create-full/src/components/ProductDetailSku/index.tsx +0 -38
- package/templates/create-full/src/components/ProductDetailSku/styles.css +0 -16
- package/templates/create-full/src/components/ProductDetailSku/types.ts +0 -11
- package/templates/create-full/src/components/ProductDetailVariant/index.tsx +0 -38
- package/templates/create-full/src/components/ProductDetailVariant/styles.css +0 -14
- package/templates/create-full/src/components/ProductDetailVariant/types.ts +0 -12
- package/templates/create-full/src/components/ProductSlider/index.tsx +0 -151
- package/templates/create-full/src/components/ProductSlider/styles.css +0 -105
- package/templates/create-full/src/components/ProductSlider/types.ts +0 -17
- package/templates/create-full/src/components/RecoverPassword/components/RecoverPasswordForm/index.tsx +0 -133
- package/templates/create-full/src/components/RecoverPassword/components/RecoverPasswordForm/styles.css +0 -0
- package/templates/create-full/src/components/RecoverPassword/index.tsx +0 -30
- package/templates/create-full/src/components/RecoverPassword/styles.css +0 -93
- package/templates/create-full/src/components/RecoverPassword/types.ts +0 -13
- package/templates/create-full/src/components/Register/components/RegisterForm/index.tsx +0 -326
- package/templates/create-full/src/components/Register/components/RegisterForm/styles.css +0 -0
- package/templates/create-full/src/components/Register/index.tsx +0 -30
- package/templates/create-full/src/components/Register/styles.css +0 -152
- package/templates/create-full/src/components/Register/types.ts +0 -27
- package/templates/create-full/src/components/RichText/index.tsx +0 -25
- package/templates/create-full/src/components/RichText/styles.css +0 -51
- package/templates/create-full/src/components/RichText/types.ts +0 -5
- package/templates/create-full/src/components/SocialMediaIcon/index.tsx +0 -26
- package/templates/create-full/src/components/SocialMediaIcon/styles.css +0 -17
- package/templates/create-full/src/components/SocialMediaIcon/types.ts +0 -7
- package/templates/create-full/src/components/index.ts +0 -50
- package/templates/create-full/src/global-types.ts +0 -11
- package/templates/create-full/src/global.css +0 -598
- package/templates/create-full/src/hooks/useBundleProducts.ts +0 -75
- package/templates/create-full/src/hooks/useColumnPreference.ts +0 -26
- package/templates/create-full/src/hooks/useInfiniteScroll.ts +0 -49
- package/templates/create-full/src/hooks/usePageTracking.ts +0 -56
- package/templates/create-full/src/hooks/usePayWithIkas.ts +0 -114
- package/templates/create-full/src/hooks/useRedirectIfLoggedIn.ts +0 -35
- package/templates/create-full/src/hooks/useScrollLock.ts +0 -19
- package/templates/create-full/src/hooks/useToast.ts +0 -27
- package/templates/create-full/src/ikas-component-utils.d.ts +0 -3
- package/templates/create-full/src/sub-components/Badge/index.tsx +0 -208
- package/templates/create-full/src/sub-components/Badge/styles.css +0 -129
- package/templates/create-full/src/sub-components/Breadcrumb/index.tsx +0 -57
- package/templates/create-full/src/sub-components/Breadcrumb/styles.css +0 -49
- package/templates/create-full/src/sub-components/BundleMedia/index.tsx +0 -72
- package/templates/create-full/src/sub-components/BundleQuantityBox/index.tsx +0 -73
- package/templates/create-full/src/sub-components/BundleQuantityBox/styles.css +0 -43
- package/templates/create-full/src/sub-components/Button/index.tsx +0 -52
- package/templates/create-full/src/sub-components/Button/styles.css +0 -114
- package/templates/create-full/src/sub-components/CartItem/components/BundleProductItem/index.tsx +0 -59
- package/templates/create-full/src/sub-components/CartItem/components/BundleProductItem/styles.css +0 -24
- package/templates/create-full/src/sub-components/CartItem/components/BundleProducts/index.tsx +0 -55
- package/templates/create-full/src/sub-components/CartItem/components/BundleProducts/styles.css +0 -30
- package/templates/create-full/src/sub-components/CartItem/components/ItemOptions/index.tsx +0 -31
- package/templates/create-full/src/sub-components/CartItem/components/ItemOptions/styles.css +0 -6
- package/templates/create-full/src/sub-components/CartItem/components/OptionValueDisplay/index.tsx +0 -79
- package/templates/create-full/src/sub-components/CartItem/components/OptionValueDisplay/styles.css +0 -28
- package/templates/create-full/src/sub-components/CartItem/index.tsx +0 -216
- package/templates/create-full/src/sub-components/CartItem/styles.css +0 -170
- package/templates/create-full/src/sub-components/Checkbox/index.tsx +0 -42
- package/templates/create-full/src/sub-components/Checkbox/styles.css +0 -65
- package/templates/create-full/src/sub-components/CollapsibleGroup/index.tsx +0 -52
- package/templates/create-full/src/sub-components/CollapsibleGroup/styles.css +0 -51
- package/templates/create-full/src/sub-components/ColorInput/index.tsx +0 -33
- package/templates/create-full/src/sub-components/ColorInput/styles.css +0 -53
- package/templates/create-full/src/sub-components/ConfirmModal/index.tsx +0 -60
- package/templates/create-full/src/sub-components/ConfirmModal/styles.css +0 -20
- package/templates/create-full/src/sub-components/FormItem/index.tsx +0 -66
- package/templates/create-full/src/sub-components/FormItem/styles.css +0 -38
- package/templates/create-full/src/sub-components/ImagePreviewModal/index.tsx +0 -55
- package/templates/create-full/src/sub-components/ImagePreviewModal/styles.css +0 -50
- package/templates/create-full/src/sub-components/Input/index.tsx +0 -69
- package/templates/create-full/src/sub-components/Input/styles.css +0 -162
- package/templates/create-full/src/sub-components/Modal/index.tsx +0 -120
- package/templates/create-full/src/sub-components/Modal/styles.css +0 -70
- package/templates/create-full/src/sub-components/PageLoader/index.tsx +0 -14
- package/templates/create-full/src/sub-components/PageLoader/styles.css +0 -12
- package/templates/create-full/src/sub-components/Pagination/index.tsx +0 -107
- package/templates/create-full/src/sub-components/Pagination/styles.css +0 -88
- package/templates/create-full/src/sub-components/ProductCard/index.tsx +0 -276
- package/templates/create-full/src/sub-components/ProductCard/styles.css +0 -99
- package/templates/create-full/src/sub-components/QuantitySelector/index.tsx +0 -41
- package/templates/create-full/src/sub-components/QuantitySelector/styles.css +0 -51
- package/templates/create-full/src/sub-components/ReviewCard/index.tsx +0 -103
- package/templates/create-full/src/sub-components/ReviewCard/styles.css +0 -95
- package/templates/create-full/src/sub-components/ReviewForm/index.tsx +0 -115
- package/templates/create-full/src/sub-components/ReviewForm/styles.css +0 -11
- package/templates/create-full/src/sub-components/ReviewSummary/index.tsx +0 -65
- package/templates/create-full/src/sub-components/ReviewSummary/styles.css +0 -86
- package/templates/create-full/src/sub-components/Select/index.tsx +0 -86
- package/templates/create-full/src/sub-components/Select/styles.css +0 -110
- package/templates/create-full/src/sub-components/SkeletonField/index.tsx +0 -12
- package/templates/create-full/src/sub-components/SkeletonField/styles.css +0 -29
- package/templates/create-full/src/sub-components/SliderArrow/index.tsx +0 -26
- package/templates/create-full/src/sub-components/SliderArrow/styles.css +0 -24
- package/templates/create-full/src/sub-components/SocialLoginButton/index.tsx +0 -24
- package/templates/create-full/src/sub-components/SocialLoginButton/styles.css +0 -19
- package/templates/create-full/src/sub-components/SpinnerIcon/index.tsx +0 -10
- package/templates/create-full/src/sub-components/SpinnerIcon/styles.css +0 -8
- package/templates/create-full/src/sub-components/StarRating/index.tsx +0 -76
- package/templates/create-full/src/sub-components/StarRating/styles.css +0 -40
- package/templates/create-full/src/sub-components/Tag/index.tsx +0 -21
- package/templates/create-full/src/sub-components/Tag/styles.css +0 -30
- package/templates/create-full/src/sub-components/Textarea/index.tsx +0 -45
- package/templates/create-full/src/sub-components/Textarea/styles.css +0 -82
- package/templates/create-full/src/sub-components/Toast/index.tsx +0 -257
- package/templates/create-full/src/sub-components/Toast/styles.css +0 -3
- package/templates/create-full/src/sub-components/Toggle/index.tsx +0 -46
- package/templates/create-full/src/sub-components/Toggle/styles.css +0 -86
- package/templates/create-full/src/sub-components/VariantBadge/index.tsx +0 -153
- package/templates/create-full/src/sub-components/VariantBadge/styles.css +0 -47
- package/templates/create-full/src/sub-components/icons/index.tsx +0 -981
- package/templates/create-full/src/utils/bundle.ts +0 -70
- package/templates/create-full/src/utils/cx.ts +0 -4
- package/templates/create-full/src/utils/fullName.ts +0 -6
- package/templates/create-full/src/utils/media.ts +0 -36
- package/templates/create-full/src/utils/optionPrice.ts +0 -19
- package/templates/create-full/src/utils/optionSet.ts +0 -17
- package/templates/create-full/src/utils/orderStatus.ts +0 -28
- package/templates/create-full/src/utils/pagination.ts +0 -29
- package/templates/create-full/src/utils/toast.ts +0 -5
- package/templates/create-full/tsconfig.json +0 -30
- package/templates/create-full/vite.config.ts +0 -15
package/templates/create-full/src/components/ProductDetailAddToCart/components/PayWithIkas/index.tsx
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { IkasProduct } from "@ikas/bp-storefront";
|
|
2
|
-
import { usePayWithIkas } from "../../../../hooks/usePayWithIkas";
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
product: IkasProduct;
|
|
6
|
-
quantity: number;
|
|
7
|
-
isEnabled: boolean;
|
|
8
|
-
payWithIkasUrl: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default function PayWithIkas({
|
|
12
|
-
product,
|
|
13
|
-
quantity,
|
|
14
|
-
isEnabled,
|
|
15
|
-
payWithIkasUrl,
|
|
16
|
-
}: Props) {
|
|
17
|
-
const { iframeRef, iframeSrc, iframeHeight } = usePayWithIkas({
|
|
18
|
-
product,
|
|
19
|
-
quantity,
|
|
20
|
-
isEnabled,
|
|
21
|
-
payWithIkasUrl,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<iframe
|
|
26
|
-
ref={iframeRef}
|
|
27
|
-
className="kombos-pd-atc__ikas-pay"
|
|
28
|
-
title="Pay with ikas"
|
|
29
|
-
src={iframeSrc}
|
|
30
|
-
width="100%"
|
|
31
|
-
height={iframeHeight}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
addItemToCart,
|
|
3
|
-
getFormattedMarginTopSize,
|
|
4
|
-
getFormattedMarginBottomSize,
|
|
5
|
-
getSelectedProductVariant,
|
|
6
|
-
hasProductStock,
|
|
7
|
-
hasProductVariantStock,
|
|
8
|
-
isAddToCartEnabled,
|
|
9
|
-
initProductOptionSetValues,
|
|
10
|
-
IkasBundleSettings,
|
|
11
|
-
IkasStorefrontConfig,
|
|
12
|
-
} from "@ikas/bp-storefront";
|
|
13
|
-
import { useState } from "preact/hooks";
|
|
14
|
-
import { Props } from "./types";
|
|
15
|
-
import Button from "../../sub-components/Button";
|
|
16
|
-
import QuantitySelector from "../../sub-components/QuantitySelector";
|
|
17
|
-
import PayWithIkas from "./components/PayWithIkas";
|
|
18
|
-
import { isBundleOutOfStock } from "../../utils/bundle";
|
|
19
|
-
import { validateOptionSet } from "../../utils/optionSet";
|
|
20
|
-
import { showToast } from "../../utils/toast";
|
|
21
|
-
|
|
22
|
-
export function ProductDetailAddToCart({
|
|
23
|
-
product,
|
|
24
|
-
addToCartButtonText = "Add to Cart",
|
|
25
|
-
addingToCartText = "Adding...",
|
|
26
|
-
outOfStockText = "Sold Out",
|
|
27
|
-
errorMessage = "Failed to add product to cart",
|
|
28
|
-
optionSetErrorMessage = "Please fill in the required options",
|
|
29
|
-
updateCartButtonText = "Update",
|
|
30
|
-
updatingCartText = "Updating...",
|
|
31
|
-
hideQuantityInput = false,
|
|
32
|
-
mobileMarginTop,
|
|
33
|
-
mobileMarginBottom,
|
|
34
|
-
desktopMarginTop,
|
|
35
|
-
desktopMarginBottom,
|
|
36
|
-
}: Props) {
|
|
37
|
-
const [quantity, setQuantity] = useState(1);
|
|
38
|
-
const [isAddingToCart, setIsAddingToCart] = useState(false);
|
|
39
|
-
|
|
40
|
-
if (!product) return null;
|
|
41
|
-
|
|
42
|
-
const editLineID =
|
|
43
|
-
typeof window !== "undefined"
|
|
44
|
-
? new URLSearchParams(window.location.search).get("editLineID")
|
|
45
|
-
: null;
|
|
46
|
-
const isEditMode = !!editLineID;
|
|
47
|
-
|
|
48
|
-
const selectedVariant = getSelectedProductVariant(product);
|
|
49
|
-
const bundleSettings = selectedVariant?.bundleSettings as
|
|
50
|
-
| IkasBundleSettings
|
|
51
|
-
| undefined;
|
|
52
|
-
const isBundle = !!bundleSettings;
|
|
53
|
-
|
|
54
|
-
const isEnabled = isAddToCartEnabled(product);
|
|
55
|
-
|
|
56
|
-
const isOutOfStock = isBundle
|
|
57
|
-
? isBundleOutOfStock(bundleSettings) || !isEnabled
|
|
58
|
-
: !hasProductStock(product) || !hasProductVariantStock(selectedVariant);
|
|
59
|
-
|
|
60
|
-
const isDisabled = isOutOfStock || isAddingToCart;
|
|
61
|
-
|
|
62
|
-
const payWithIkasUrl = IkasStorefrontConfig.getPayWithIkasUrl();
|
|
63
|
-
const routing = IkasStorefrontConfig.getCurrentRouting();
|
|
64
|
-
const showPayWithIkas =
|
|
65
|
-
!isOutOfStock &&
|
|
66
|
-
!!payWithIkasUrl &&
|
|
67
|
-
routing?.locale === "tr" &&
|
|
68
|
-
routing?.currencyCode === "TRY";
|
|
69
|
-
|
|
70
|
-
const handleAddToCart = async () => {
|
|
71
|
-
if (isDisabled) return;
|
|
72
|
-
|
|
73
|
-
if (!validateOptionSet(product.productOptionSet, optionSetErrorMessage))
|
|
74
|
-
return;
|
|
75
|
-
|
|
76
|
-
if (!isAddToCartEnabled(product)) {
|
|
77
|
-
showToast(errorMessage, "error");
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
setIsAddingToCart(true);
|
|
82
|
-
try {
|
|
83
|
-
const result = await addItemToCart(selectedVariant, product, quantity);
|
|
84
|
-
|
|
85
|
-
if (result.success) {
|
|
86
|
-
if (product.productOptionSet) {
|
|
87
|
-
initProductOptionSetValues(product.productOptionSet);
|
|
88
|
-
}
|
|
89
|
-
window.dispatchEvent(new CustomEvent("ikas:reset-option-state"));
|
|
90
|
-
window.dispatchEvent(new CustomEvent("ikas:open-cart-sidebar"));
|
|
91
|
-
} else {
|
|
92
|
-
showToast(errorMessage, "error");
|
|
93
|
-
}
|
|
94
|
-
} finally {
|
|
95
|
-
setIsAddingToCart(false);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const getButtonText = () => {
|
|
100
|
-
if (isEditMode) {
|
|
101
|
-
if (isAddingToCart) return updatingCartText;
|
|
102
|
-
if (isOutOfStock) return outOfStockText;
|
|
103
|
-
return updateCartButtonText;
|
|
104
|
-
}
|
|
105
|
-
if (isAddingToCart) return addingToCartText;
|
|
106
|
-
if (isOutOfStock) return outOfStockText;
|
|
107
|
-
return addToCartButtonText;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<div
|
|
112
|
-
className="kombos-pd-atc"
|
|
113
|
-
style={{
|
|
114
|
-
"--mobile-mt": getFormattedMarginTopSize(mobileMarginTop),
|
|
115
|
-
"--mobile-mb": getFormattedMarginBottomSize(mobileMarginBottom),
|
|
116
|
-
"--desktop-mt": getFormattedMarginTopSize(desktopMarginTop),
|
|
117
|
-
"--desktop-mb": getFormattedMarginBottomSize(desktopMarginBottom),
|
|
118
|
-
}}
|
|
119
|
-
>
|
|
120
|
-
<div className="kombos-pd-atc__actions">
|
|
121
|
-
{!hideQuantityInput && !isOutOfStock && (
|
|
122
|
-
<QuantitySelector value={quantity} onChange={setQuantity} />
|
|
123
|
-
)}
|
|
124
|
-
<Button
|
|
125
|
-
variant="primary"
|
|
126
|
-
size="s"
|
|
127
|
-
className="kombos-pd-atc__btn"
|
|
128
|
-
disabled={isDisabled}
|
|
129
|
-
onClick={handleAddToCart}
|
|
130
|
-
>
|
|
131
|
-
{getButtonText()}
|
|
132
|
-
</Button>
|
|
133
|
-
</div>
|
|
134
|
-
{showPayWithIkas && (
|
|
135
|
-
<PayWithIkas
|
|
136
|
-
product={product}
|
|
137
|
-
quantity={quantity}
|
|
138
|
-
isEnabled={isEnabled}
|
|
139
|
-
payWithIkasUrl={payWithIkasUrl!}
|
|
140
|
-
/>
|
|
141
|
-
)}
|
|
142
|
-
</div>
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export default ProductDetailAddToCart;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/* ===== ProductDetailAddToCart ===== */
|
|
2
|
-
|
|
3
|
-
.kombos-pd-atc {
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
gap: 0.75rem;
|
|
7
|
-
margin-top: var(--mobile-mt);
|
|
8
|
-
margin-bottom: var(--mobile-mb);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.kombos-pd-atc__actions {
|
|
12
|
-
display: flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
gap: 0.75rem;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.kombos-pd-atc__btn {
|
|
18
|
-
flex: 1;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* ===== Desktop (>=1024px) ===== */
|
|
22
|
-
@media (min-width: 1024px) {
|
|
23
|
-
.kombos-pd-atc {
|
|
24
|
-
margin-top: var(--desktop-mt, var(--mobile-mt));
|
|
25
|
-
margin-bottom: var(--desktop-mb, var(--mobile-mb));
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// This file is auto-generated — do not edit manually.
|
|
2
|
-
import type { IkasProduct, MarginTopStyleType, MarginBottomStyleType } from "@ikas/bp-storefront";
|
|
3
|
-
|
|
4
|
-
export interface Props {
|
|
5
|
-
product?: IkasProduct | null;
|
|
6
|
-
addToCartButtonText?: string;
|
|
7
|
-
addingToCartText?: string;
|
|
8
|
-
outOfStockText?: string;
|
|
9
|
-
mobileMarginTop?: MarginTopStyleType;
|
|
10
|
-
mobileMarginBottom?: MarginBottomStyleType;
|
|
11
|
-
desktopMarginTop?: MarginTopStyleType;
|
|
12
|
-
desktopMarginBottom?: MarginBottomStyleType;
|
|
13
|
-
hideQuantityInput?: boolean;
|
|
14
|
-
errorMessage?: string;
|
|
15
|
-
optionSetErrorMessage?: string;
|
|
16
|
-
updateCartButtonText?: string;
|
|
17
|
-
updatingCartText?: string;
|
|
18
|
-
}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IkasBundleProduct,
|
|
3
|
-
getSelectedProductVariant,
|
|
4
|
-
shouldDisplayBundleProductPrice,
|
|
5
|
-
getBundleProductFormattedFinalPrice,
|
|
6
|
-
getBundleProductFormattedFinalPriceWithQuantity,
|
|
7
|
-
getBundleProductFormattedSellPrice,
|
|
8
|
-
getBundleProductFormattedSellPriceWithQuantity,
|
|
9
|
-
getBundleProductFinalPrice,
|
|
10
|
-
getBundleProductSellPrice,
|
|
11
|
-
getBundleProductFinalPriceWithQuantity,
|
|
12
|
-
getBundleProductSellPriceWithQuantity,
|
|
13
|
-
hasProductVariantStock,
|
|
14
|
-
} from "@ikas/bp-storefront";
|
|
15
|
-
import { observer } from "@ikas/component-utils";
|
|
16
|
-
import type { AspectRatio, ObjectFit } from "../../../../global-types";
|
|
17
|
-
import VariantBadge from "../../../../sub-components/VariantBadge";
|
|
18
|
-
import BundleQuantityBox from "../../../../sub-components/BundleQuantityBox";
|
|
19
|
-
import BundleMedia from "../../../../sub-components/BundleMedia";
|
|
20
|
-
import { adjustBundleProductQuantity } from "../../../../utils/bundle";
|
|
21
|
-
|
|
22
|
-
export interface BundleFurnitureRowTexts {
|
|
23
|
-
outOfStockText: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface PriceCellProps {
|
|
27
|
-
formattedFinalPrice: string;
|
|
28
|
-
formattedSellPrice: string;
|
|
29
|
-
hasDiscount: boolean;
|
|
30
|
-
finalTypography: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function PriceCell({
|
|
34
|
-
formattedFinalPrice,
|
|
35
|
-
formattedSellPrice,
|
|
36
|
-
hasDiscount,
|
|
37
|
-
finalTypography,
|
|
38
|
-
}: PriceCellProps) {
|
|
39
|
-
return (
|
|
40
|
-
<div className="kombos-bundle-furniture__price-col">
|
|
41
|
-
<span className={finalTypography}>{formattedFinalPrice}</span>
|
|
42
|
-
{hasDiscount && (
|
|
43
|
-
<span className="kombos-bundle-furniture__old-price text-sm-regular-strike">
|
|
44
|
-
{formattedSellPrice}
|
|
45
|
-
</span>
|
|
46
|
-
)}
|
|
47
|
-
</div>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
interface Props {
|
|
52
|
-
bundleProduct: IkasBundleProduct;
|
|
53
|
-
texts: BundleFurnitureRowTexts;
|
|
54
|
-
showFeatures: boolean;
|
|
55
|
-
aspectRatio?: AspectRatio;
|
|
56
|
-
objectFit?: ObjectFit;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const BundleFurnitureRow = observer(function BundleFurnitureRow({
|
|
60
|
-
bundleProduct,
|
|
61
|
-
texts,
|
|
62
|
-
showFeatures,
|
|
63
|
-
aspectRatio = "Square",
|
|
64
|
-
objectFit = "Cover",
|
|
65
|
-
}: Props) {
|
|
66
|
-
const product = bundleProduct.product;
|
|
67
|
-
if (!product) return null;
|
|
68
|
-
|
|
69
|
-
const selectedVariant = getSelectedProductVariant(product);
|
|
70
|
-
const hasStock = selectedVariant
|
|
71
|
-
? hasProductVariantStock(selectedVariant)
|
|
72
|
-
: false;
|
|
73
|
-
const showPrice = shouldDisplayBundleProductPrice(bundleProduct);
|
|
74
|
-
|
|
75
|
-
const unitFinalPrice = getBundleProductFinalPrice(bundleProduct);
|
|
76
|
-
const unitSellPrice = getBundleProductSellPrice(bundleProduct);
|
|
77
|
-
const hasUnitDiscount = showPrice && unitFinalPrice !== unitSellPrice;
|
|
78
|
-
|
|
79
|
-
const totalFinalPrice = getBundleProductFinalPriceWithQuantity(bundleProduct);
|
|
80
|
-
const totalSellPrice = getBundleProductSellPriceWithQuantity(bundleProduct);
|
|
81
|
-
const hasTotalDiscount =
|
|
82
|
-
showPrice &&
|
|
83
|
-
totalFinalPrice !== totalSellPrice &&
|
|
84
|
-
bundleProduct.quantity > 0;
|
|
85
|
-
|
|
86
|
-
const showTotalPrice = showPrice && bundleProduct.quantity > 0;
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
<tr className="kombos-bundle-furniture__row">
|
|
90
|
-
{/* Parts: image + name */}
|
|
91
|
-
<td className="kombos-bundle-furniture__cell kombos-bundle-furniture__cell--parts">
|
|
92
|
-
<div className="kombos-bundle-furniture__part-info">
|
|
93
|
-
<BundleMedia
|
|
94
|
-
variant={selectedVariant}
|
|
95
|
-
alt=""
|
|
96
|
-
aspectRatio={aspectRatio}
|
|
97
|
-
objectFit={objectFit}
|
|
98
|
-
wrapperClassName="kombos-bundle-furniture__thumb"
|
|
99
|
-
mediaClassName="kombos-bundle-furniture__thumb-img"
|
|
100
|
-
placeholderClassName="kombos-bundle-furniture__thumb-placeholder"
|
|
101
|
-
/>
|
|
102
|
-
<span className="kombos-bundle-furniture__part-name text-sm-medium">
|
|
103
|
-
{product.name}
|
|
104
|
-
</span>
|
|
105
|
-
</div>
|
|
106
|
-
</td>
|
|
107
|
-
|
|
108
|
-
{/* Unit Price */}
|
|
109
|
-
<td className="kombos-bundle-furniture__cell kombos-bundle-furniture__cell--price">
|
|
110
|
-
{showPrice ? (
|
|
111
|
-
<PriceCell
|
|
112
|
-
formattedFinalPrice={getBundleProductFormattedFinalPrice(
|
|
113
|
-
bundleProduct,
|
|
114
|
-
)}
|
|
115
|
-
formattedSellPrice={getBundleProductFormattedSellPrice(
|
|
116
|
-
bundleProduct,
|
|
117
|
-
)}
|
|
118
|
-
hasDiscount={hasUnitDiscount}
|
|
119
|
-
finalTypography="text-sm-medium"
|
|
120
|
-
/>
|
|
121
|
-
) : (
|
|
122
|
-
<span className="text-sm-regular">-</span>
|
|
123
|
-
)}
|
|
124
|
-
</td>
|
|
125
|
-
|
|
126
|
-
{/* Quantity */}
|
|
127
|
-
<td className="kombos-bundle-furniture__cell kombos-bundle-furniture__cell--qty">
|
|
128
|
-
<BundleQuantityBox bundleProduct={bundleProduct} />
|
|
129
|
-
{!hasStock && (
|
|
130
|
-
<span className="kombos-bundle-furniture__no-stock text-xs-medium">
|
|
131
|
-
{texts.outOfStockText}
|
|
132
|
-
</span>
|
|
133
|
-
)}
|
|
134
|
-
</td>
|
|
135
|
-
|
|
136
|
-
{/* Features (variants) */}
|
|
137
|
-
{showFeatures && (
|
|
138
|
-
<td className="kombos-bundle-furniture__cell kombos-bundle-furniture__cell--features">
|
|
139
|
-
<VariantBadge product={product} disableRoute size="xs" onSelect={() => adjustBundleProductQuantity(bundleProduct)} />
|
|
140
|
-
</td>
|
|
141
|
-
)}
|
|
142
|
-
|
|
143
|
-
{/* Total Price */}
|
|
144
|
-
<td className="kombos-bundle-furniture__cell kombos-bundle-furniture__cell--total">
|
|
145
|
-
{showTotalPrice ? (
|
|
146
|
-
<PriceCell
|
|
147
|
-
formattedFinalPrice={getBundleProductFormattedFinalPriceWithQuantity(
|
|
148
|
-
bundleProduct,
|
|
149
|
-
)}
|
|
150
|
-
formattedSellPrice={getBundleProductFormattedSellPriceWithQuantity(
|
|
151
|
-
bundleProduct,
|
|
152
|
-
)}
|
|
153
|
-
hasDiscount={hasTotalDiscount}
|
|
154
|
-
finalTypography="text-sm-semibold"
|
|
155
|
-
/>
|
|
156
|
-
) : (
|
|
157
|
-
<span className="text-sm-regular">-</span>
|
|
158
|
-
)}
|
|
159
|
-
</td>
|
|
160
|
-
</tr>
|
|
161
|
-
);
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
export default BundleFurnitureRow;
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { useState } from "preact/hooks";
|
|
2
|
-
import {
|
|
3
|
-
IkasBundleProduct,
|
|
4
|
-
IkasBundleSettings,
|
|
5
|
-
getDisplayedProductVariantTypes,
|
|
6
|
-
} from "@ikas/bp-storefront";
|
|
7
|
-
import { observer } from "@ikas/component-utils";
|
|
8
|
-
import type { AspectRatio, ObjectFit } from "../../../../global-types";
|
|
9
|
-
import { cx } from "../../../../utils/cx";
|
|
10
|
-
import BundleFurnitureRow from "../BundleFurnitureRow";
|
|
11
|
-
|
|
12
|
-
interface Texts {
|
|
13
|
-
productContentTitle: string;
|
|
14
|
-
partsLabel: string;
|
|
15
|
-
unitPriceLabel: string;
|
|
16
|
-
quantityLabel: string;
|
|
17
|
-
featuresLabel: string;
|
|
18
|
-
totalPriceLabel: string;
|
|
19
|
-
outOfStockText: string;
|
|
20
|
-
addProductItemText: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface Props {
|
|
24
|
-
bundleSettings: IkasBundleSettings;
|
|
25
|
-
isLoading: boolean;
|
|
26
|
-
texts: Texts;
|
|
27
|
-
aspectRatio?: AspectRatio;
|
|
28
|
-
objectFit?: ObjectFit;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function hasAnyVariants(products: IkasBundleProduct[]): boolean {
|
|
32
|
-
return products.some((bp) => {
|
|
33
|
-
if (!bp.product) return false;
|
|
34
|
-
return getDisplayedProductVariantTypes(bp.product).length > 0;
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const COLUMN_HEADER_CLASS = "kombos-bundle-furniture__th text-sm-semibold";
|
|
39
|
-
|
|
40
|
-
const BundleFurnitureSection = observer(function BundleFurnitureSection({
|
|
41
|
-
bundleSettings,
|
|
42
|
-
isLoading,
|
|
43
|
-
texts,
|
|
44
|
-
aspectRatio,
|
|
45
|
-
objectFit,
|
|
46
|
-
}: Props) {
|
|
47
|
-
const [isExpanded, setIsExpanded] = useState(true);
|
|
48
|
-
|
|
49
|
-
const sortedProducts = [...bundleSettings.products].sort(
|
|
50
|
-
(a, b) => a.order - b.order,
|
|
51
|
-
);
|
|
52
|
-
const showFeatures = hasAnyVariants(sortedProducts);
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<div className="kombos-bundle-furniture" id="bundle-furniture-section">
|
|
56
|
-
{/* Collapsible header */}
|
|
57
|
-
<button
|
|
58
|
-
type="button"
|
|
59
|
-
className="kombos-bundle-furniture__toggle"
|
|
60
|
-
onClick={() => setIsExpanded((prev) => !prev)}
|
|
61
|
-
aria-expanded={isExpanded}
|
|
62
|
-
>
|
|
63
|
-
<span className="kombos-bundle-furniture__toggle-text text-sm-semibold">
|
|
64
|
-
{texts.productContentTitle}
|
|
65
|
-
</span>
|
|
66
|
-
<span
|
|
67
|
-
className={cx(
|
|
68
|
-
"kombos-bundle-furniture__toggle-icon",
|
|
69
|
-
isExpanded && "kombos-bundle-furniture__toggle-icon--open",
|
|
70
|
-
)}
|
|
71
|
-
/>
|
|
72
|
-
</button>
|
|
73
|
-
|
|
74
|
-
{/* Table content */}
|
|
75
|
-
{isExpanded && (
|
|
76
|
-
<div className="kombos-bundle-furniture__body">
|
|
77
|
-
{isLoading ? (
|
|
78
|
-
<div className="kombos-bundle-furniture__loading">
|
|
79
|
-
<div className="kombos-bundle-furniture__spinner" />
|
|
80
|
-
</div>
|
|
81
|
-
) : (
|
|
82
|
-
<div className="kombos-bundle-furniture__table-wrap">
|
|
83
|
-
<table className="kombos-bundle-furniture__table">
|
|
84
|
-
<colgroup>
|
|
85
|
-
<col style={{ width: showFeatures ? "33.33%" : "40%" }} />
|
|
86
|
-
<col style={{ width: showFeatures ? "16.67%" : "20%" }} />
|
|
87
|
-
<col style={{ width: showFeatures ? "16.67%" : "20%" }} />
|
|
88
|
-
{showFeatures && <col style={{ width: "16.67%" }} />}
|
|
89
|
-
<col style={{ width: showFeatures ? "16.67%" : "20%" }} />
|
|
90
|
-
</colgroup>
|
|
91
|
-
<thead>
|
|
92
|
-
<tr className="kombos-bundle-furniture__head-row">
|
|
93
|
-
<th className={COLUMN_HEADER_CLASS}>{texts.partsLabel}</th>
|
|
94
|
-
<th className={COLUMN_HEADER_CLASS}>
|
|
95
|
-
{texts.unitPriceLabel}
|
|
96
|
-
</th>
|
|
97
|
-
<th className={COLUMN_HEADER_CLASS}>
|
|
98
|
-
{texts.quantityLabel}
|
|
99
|
-
</th>
|
|
100
|
-
{showFeatures && (
|
|
101
|
-
<th className={COLUMN_HEADER_CLASS}>
|
|
102
|
-
{texts.featuresLabel}
|
|
103
|
-
</th>
|
|
104
|
-
)}
|
|
105
|
-
<th
|
|
106
|
-
className={COLUMN_HEADER_CLASS}
|
|
107
|
-
style={{ textAlign: "right" }}
|
|
108
|
-
>
|
|
109
|
-
{texts.totalPriceLabel}
|
|
110
|
-
</th>
|
|
111
|
-
</tr>
|
|
112
|
-
</thead>
|
|
113
|
-
<tbody>
|
|
114
|
-
{sortedProducts.map((bp) => (
|
|
115
|
-
<BundleFurnitureRow
|
|
116
|
-
key={bp.id}
|
|
117
|
-
bundleProduct={bp}
|
|
118
|
-
texts={texts}
|
|
119
|
-
showFeatures={showFeatures}
|
|
120
|
-
aspectRatio={aspectRatio}
|
|
121
|
-
objectFit={objectFit}
|
|
122
|
-
/>
|
|
123
|
-
))}
|
|
124
|
-
</tbody>
|
|
125
|
-
</table>
|
|
126
|
-
</div>
|
|
127
|
-
)}
|
|
128
|
-
</div>
|
|
129
|
-
)}
|
|
130
|
-
</div>
|
|
131
|
-
);
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
export default BundleFurnitureSection;
|