@ikas/component-cli 0.103.0 → 0.104.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/config.d.ts.map +1 -1
- package/dist/commands/config.js +385 -5
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +118 -43
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +135 -5
- package/dist/commands/dev.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/component-helpers.d.ts +5 -0
- package/dist/utils/component-helpers.d.ts.map +1 -1
- package/dist/utils/component-helpers.js +14 -1
- package/dist/utils/component-helpers.js.map +1 -1
- package/dist/utils/template.d.ts +12 -0
- package/dist/utils/template.d.ts.map +1 -1
- package/dist/utils/template.js +44 -0
- package/dist/utils/template.js.map +1 -1
- package/dist/utils/websocket-server.d.ts +26 -0
- package/dist/utils/websocket-server.d.ts.map +1 -1
- package/dist/utils/websocket-server.js +42 -0
- package/dist/utils/websocket-server.js.map +1 -1
- package/package.json +3 -2
- package/templates/create/claude-md +2 -1
- package/templates/create/cursorrules +1 -1
- package/templates/create/package.json +1 -0
- package/templates/create/src/components/ExampleComponent/types.ts +1 -1
- package/templates/create/src/components/ExampleSection/types.ts +1 -1
- package/templates/create-full/README.md +78 -0
- package/templates/create-full/cursorrules +103 -0
- package/templates/create-full/gitignore +4 -0
- package/templates/create-full/ikas.config.json +5007 -0
- package/templates/create-full/mcp.json +10 -0
- package/templates/create-full/package.json +22 -0
- package/templates/create-full/src/components/AccountAddresses/components/AddressCard/index.tsx +55 -0
- package/templates/create-full/src/components/AccountAddresses/components/AddressCard/styles.css +46 -0
- package/templates/create-full/src/components/AccountAddresses/components/AddressModal/index.tsx +301 -0
- package/templates/create-full/src/components/AccountAddresses/components/AddressModal/styles.css +22 -0
- package/templates/create-full/src/components/AccountAddresses/index.tsx +127 -0
- package/templates/create-full/src/components/AccountAddresses/styles.css +41 -0
- package/templates/create-full/src/components/AccountAddresses/types.ts +15 -0
- package/templates/create-full/src/components/AccountFavorites/index.tsx +82 -0
- package/templates/create-full/src/components/AccountFavorites/styles.css +52 -0
- package/templates/create-full/src/components/AccountFavorites/types.ts +7 -0
- package/templates/create-full/src/components/AccountInfo/components/AccountSidebar/index.tsx +171 -0
- package/templates/create-full/src/components/AccountInfo/components/AccountSidebar/styles.css +144 -0
- package/templates/create-full/src/components/AccountInfo/index.tsx +91 -0
- package/templates/create-full/src/components/AccountInfo/styles.css +35 -0
- package/templates/create-full/src/components/AccountInfo/types.ts +9 -0
- package/templates/create-full/src/components/AccountInfoContent/index.tsx +134 -0
- package/templates/create-full/src/components/AccountInfoContent/styles.css +57 -0
- package/templates/create-full/src/components/AccountInfoContent/types.ts +8 -0
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderHeader/index.tsx +78 -0
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderHeader/styles.css +46 -0
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderItemRow/index.tsx +20 -0
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderItemRow/styles.css +16 -0
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderLineItemDisplay/index.tsx +112 -0
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderLineItemDisplay/styles.css +86 -0
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderSidebar/index.tsx +195 -0
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderSidebar/styles.css +93 -0
- package/templates/create-full/src/components/AccountOrderDetail/components/PackageGroup/index.tsx +156 -0
- package/templates/create-full/src/components/AccountOrderDetail/components/PackageGroup/styles.css +100 -0
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnItemRow/index.tsx +56 -0
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnItemRow/styles.css +57 -0
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnView/index.tsx +159 -0
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnView/styles.css +29 -0
- package/templates/create-full/src/components/AccountOrderDetail/index.tsx +244 -0
- package/templates/create-full/src/components/AccountOrderDetail/styles.css +125 -0
- package/templates/create-full/src/components/AccountOrderDetail/types.ts +32 -0
- package/templates/create-full/src/components/AccountOrders/components/OrderCard/index.tsx +122 -0
- package/templates/create-full/src/components/AccountOrders/components/OrderCard/styles.css +114 -0
- package/templates/create-full/src/components/AccountOrders/index.tsx +105 -0
- package/templates/create-full/src/components/AccountOrders/styles.css +36 -0
- package/templates/create-full/src/components/AccountOrders/types.ts +11 -0
- package/templates/create-full/src/components/Announcement/index.tsx +11 -0
- package/templates/create-full/src/components/Announcement/styles.css +4 -0
- package/templates/create-full/src/components/Announcement/types.ts +4 -0
- package/templates/create-full/src/components/Announcements/index.tsx +91 -0
- package/templates/create-full/src/components/Announcements/styles.css +45 -0
- package/templates/create-full/src/components/Announcements/types.ts +8 -0
- package/templates/create-full/src/components/BlogHome/components/BlogCard/index.tsx +89 -0
- package/templates/create-full/src/components/BlogHome/components/BlogCard/styles.css +121 -0
- package/templates/create-full/src/components/BlogHome/index.tsx +124 -0
- package/templates/create-full/src/components/BlogHome/styles.css +118 -0
- package/templates/create-full/src/components/BlogHome/types.ts +15 -0
- package/templates/create-full/src/components/BlogPost/index.tsx +128 -0
- package/templates/create-full/src/components/BlogPost/styles.css +120 -0
- package/templates/create-full/src/components/BlogPost/types.ts +12 -0
- package/templates/create-full/src/components/CardProductName/index.tsx +25 -0
- package/templates/create-full/src/components/CardProductName/styles.css +22 -0
- package/templates/create-full/src/components/CardProductName/types.ts +7 -0
- package/templates/create-full/src/components/CardProductPrice/index.tsx +30 -0
- package/templates/create-full/src/components/CardProductPrice/styles.css +13 -0
- package/templates/create-full/src/components/CardProductPrice/types.ts +6 -0
- package/templates/create-full/src/components/CardProductVariants/index.tsx +10 -0
- package/templates/create-full/src/components/CardProductVariants/styles.css +1 -0
- package/templates/create-full/src/components/CardProductVariants/types.ts +6 -0
- package/templates/create-full/src/components/CartPage/components/CouponCode/index.tsx +108 -0
- package/templates/create-full/src/components/CartPage/components/CouponCode/styles.css +68 -0
- package/templates/create-full/src/components/CartPage/components/EmptyState/index.tsx +31 -0
- package/templates/create-full/src/components/CartPage/components/EmptyState/styles.css +18 -0
- package/templates/create-full/src/components/CartPage/components/OrderSummary/index.tsx +106 -0
- package/templates/create-full/src/components/CartPage/components/OrderSummary/styles.css +70 -0
- package/templates/create-full/src/components/CartPage/index.tsx +107 -0
- package/templates/create-full/src/components/CartPage/styles.css +54 -0
- package/templates/create-full/src/components/CartPage/types.ts +16 -0
- package/templates/create-full/src/components/CategoryImageItem/components/Card/index.tsx +64 -0
- package/templates/create-full/src/components/CategoryImageItem/components/Card/styles.css +56 -0
- package/templates/create-full/src/components/CategoryImageItem/index.tsx +64 -0
- package/templates/create-full/src/components/CategoryImageItem/styles.css +10 -0
- package/templates/create-full/src/components/CategoryImageItem/types.ts +16 -0
- package/templates/create-full/src/components/CategoryImages/index.tsx +62 -0
- package/templates/create-full/src/components/CategoryImages/styles.css +38 -0
- package/templates/create-full/src/components/CategoryImages/types.ts +11 -0
- package/templates/create-full/src/components/CategoryList/components/CategoryListControls/index.tsx +129 -0
- package/templates/create-full/src/components/CategoryList/components/CategoryListControls/styles.css +99 -0
- package/templates/create-full/src/components/CategoryList/components/FilterBoxValues/index.tsx +42 -0
- package/templates/create-full/src/components/CategoryList/components/FilterBoxValues/styles.css +27 -0
- package/templates/create-full/src/components/CategoryList/components/FilterCategoryList/index.tsx +43 -0
- package/templates/create-full/src/components/CategoryList/components/FilterCategoryList/styles.css +20 -0
- package/templates/create-full/src/components/CategoryList/components/FilterGroupValues/index.tsx +114 -0
- package/templates/create-full/src/components/CategoryList/components/FilterGroupValues/styles.css +1 -0
- package/templates/create-full/src/components/CategoryList/components/FilterListValues/index.tsx +54 -0
- package/templates/create-full/src/components/CategoryList/components/FilterListValues/styles.css +22 -0
- package/templates/create-full/src/components/CategoryList/components/FilterRangeListValues/index.tsx +50 -0
- package/templates/create-full/src/components/CategoryList/components/FilterRangeListValues/styles.css +25 -0
- package/templates/create-full/src/components/CategoryList/components/FilterRangeValues/index.tsx +189 -0
- package/templates/create-full/src/components/CategoryList/components/FilterRangeValues/styles.css +89 -0
- package/templates/create-full/src/components/CategoryList/components/FilterSidebar/index.tsx +92 -0
- package/templates/create-full/src/components/CategoryList/components/FilterSidebar/styles.css +27 -0
- package/templates/create-full/src/components/CategoryList/components/FilterSwatchValues/index.tsx +63 -0
- package/templates/create-full/src/components/CategoryList/components/FilterSwatchValues/styles.css +48 -0
- package/templates/create-full/src/components/CategoryList/components/MobileFilterModal/index.tsx +146 -0
- package/templates/create-full/src/components/CategoryList/components/MobileFilterModal/styles.css +133 -0
- package/templates/create-full/src/components/CategoryList/index.tsx +333 -0
- package/templates/create-full/src/components/CategoryList/styles.css +110 -0
- package/templates/create-full/src/components/CategoryList/types.ts +30 -0
- package/templates/create-full/src/components/CollapsibleContent/index.tsx +23 -0
- package/templates/create-full/src/components/CollapsibleContent/styles.css +11 -0
- package/templates/create-full/src/components/CollapsibleContent/types.ts +6 -0
- package/templates/create-full/src/components/CookieBar/index.tsx +78 -0
- package/templates/create-full/src/components/CookieBar/styles.css +111 -0
- package/templates/create-full/src/components/CookieBar/types.ts +10 -0
- package/templates/create-full/src/components/CustomerEmailVerification/index.tsx +168 -0
- package/templates/create-full/src/components/CustomerEmailVerification/styles.css +118 -0
- package/templates/create-full/src/components/CustomerEmailVerification/types.ts +17 -0
- package/templates/create-full/src/components/FeatureItem/index.tsx +27 -0
- package/templates/create-full/src/components/FeatureItem/styles.css +19 -0
- package/templates/create-full/src/components/FeatureItem/types.ts +7 -0
- package/templates/create-full/src/components/Features/index.tsx +25 -0
- package/templates/create-full/src/components/Features/styles.css +39 -0
- package/templates/create-full/src/components/Features/types.ts +5 -0
- package/templates/create-full/src/components/Footer/index.tsx +154 -0
- package/templates/create-full/src/components/Footer/styles.css +175 -0
- package/templates/create-full/src/components/Footer/types.ts +15 -0
- package/templates/create-full/src/components/ForgotPassword/components/ForgotPasswordForm/index.tsx +129 -0
- package/templates/create-full/src/components/ForgotPassword/components/ForgotPasswordForm/styles.css +0 -0
- package/templates/create-full/src/components/ForgotPassword/index.tsx +30 -0
- package/templates/create-full/src/components/ForgotPassword/styles.css +85 -0
- package/templates/create-full/src/components/ForgotPassword/types.ts +13 -0
- package/templates/create-full/src/components/Header/index.tsx +53 -0
- package/templates/create-full/src/components/Header/styles.css +6 -0
- package/templates/create-full/src/components/Header/types.ts +6 -0
- package/templates/create-full/src/components/HeroSlider/index.tsx +110 -0
- package/templates/create-full/src/components/HeroSlider/styles.css +129 -0
- package/templates/create-full/src/components/HeroSlider/types.ts +9 -0
- package/templates/create-full/src/components/HeroSliderItem/index.tsx +231 -0
- package/templates/create-full/src/components/HeroSliderItem/styles.css +152 -0
- package/templates/create-full/src/components/HeroSliderItem/types.ts +34 -0
- package/templates/create-full/src/components/Login/components/LoginForm/index.tsx +181 -0
- package/templates/create-full/src/components/Login/components/LoginForm/styles.css +0 -0
- package/templates/create-full/src/components/Login/index.tsx +37 -0
- package/templates/create-full/src/components/Login/styles.css +129 -0
- package/templates/create-full/src/components/Login/types.ts +18 -0
- package/templates/create-full/src/components/Navbar/components/CartSidebar/index.tsx +203 -0
- package/templates/create-full/src/components/Navbar/components/CartSidebar/styles.css +175 -0
- package/templates/create-full/src/components/Navbar/components/MobileMenu/index.tsx +198 -0
- package/templates/create-full/src/components/Navbar/components/MobileMenu/styles.css +122 -0
- package/templates/create-full/src/components/Navbar/components/NavItem/index.tsx +65 -0
- package/templates/create-full/src/components/Navbar/components/SearchModal/index.tsx +267 -0
- package/templates/create-full/src/components/Navbar/components/SearchModal/styles.css +182 -0
- package/templates/create-full/src/components/Navbar/index.tsx +250 -0
- package/templates/create-full/src/components/Navbar/styles.css +243 -0
- package/templates/create-full/src/components/Navbar/types.ts +37 -0
- package/templates/create-full/src/components/NotFound/index.tsx +39 -0
- package/templates/create-full/src/components/NotFound/styles.css +46 -0
- package/templates/create-full/src/components/NotFound/types.ts +8 -0
- package/templates/create-full/src/components/ProductDetail/components/ProductGallery/index.tsx +316 -0
- package/templates/create-full/src/components/ProductDetail/components/ProductGallery/styles.css +213 -0
- package/templates/create-full/src/components/ProductDetail/index.tsx +92 -0
- package/templates/create-full/src/components/ProductDetail/styles.css +58 -0
- package/templates/create-full/src/components/ProductDetail/types.ts +12 -0
- package/templates/create-full/src/components/ProductDetailAddToCart/components/PayWithIkas/index.tsx +34 -0
- package/templates/create-full/src/components/ProductDetailAddToCart/components/PayWithIkas/styles.css +4 -0
- package/templates/create-full/src/components/ProductDetailAddToCart/index.tsx +146 -0
- package/templates/create-full/src/components/ProductDetailAddToCart/styles.css +27 -0
- package/templates/create-full/src/components/ProductDetailAddToCart/types.ts +18 -0
- package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureRow/index.tsx +164 -0
- package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureSection/index.tsx +134 -0
- package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureSection/styles.css +188 -0
- package/templates/create-full/src/components/ProductDetailBundleFurniture/index.tsx +61 -0
- package/templates/create-full/src/components/ProductDetailBundleFurniture/styles.css +12 -0
- package/templates/create-full/src/components/ProductDetailBundleFurniture/types.ts +21 -0
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleProductItem/index.tsx +169 -0
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleProductItem/styles.css +141 -0
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleSkeletonLoading/index.tsx +35 -0
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleSkeletonLoading/styles.css +85 -0
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureRow/index.tsx +51 -0
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureRow/styles.css +30 -0
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureView/index.tsx +54 -0
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureView/styles.css +22 -0
- package/templates/create-full/src/components/ProductDetailBundleProduct/index.tsx +101 -0
- package/templates/create-full/src/components/ProductDetailBundleProduct/styles.css +20 -0
- package/templates/create-full/src/components/ProductDetailBundleProduct/types.ts +18 -0
- package/templates/create-full/src/components/ProductDetailDescription/index.tsx +56 -0
- package/templates/create-full/src/components/ProductDetailDescription/styles.css +21 -0
- package/templates/create-full/src/components/ProductDetailDescription/types.ts +13 -0
- package/templates/create-full/src/components/ProductDetailFeatureItem/index.tsx +28 -0
- package/templates/create-full/src/components/ProductDetailFeatureItem/styles.css +22 -0
- package/templates/create-full/src/components/ProductDetailFeatureItem/types.ts +7 -0
- package/templates/create-full/src/components/ProductDetailFeatures/index.tsx +40 -0
- package/templates/create-full/src/components/ProductDetailFeatures/styles.css +17 -0
- package/templates/create-full/src/components/ProductDetailFeatures/types.ts +10 -0
- package/templates/create-full/src/components/ProductDetailNameFavorite/index.tsx +66 -0
- package/templates/create-full/src/components/ProductDetailNameFavorite/styles.css +45 -0
- package/templates/create-full/src/components/ProductDetailNameFavorite/types.ts +11 -0
- package/templates/create-full/src/components/ProductDetailOffer/components/OfferCard/index.tsx +209 -0
- package/templates/create-full/src/components/ProductDetailOffer/components/OfferCard/styles.css +146 -0
- package/templates/create-full/src/components/ProductDetailOffer/components/OfferSummary/index.tsx +175 -0
- package/templates/create-full/src/components/ProductDetailOffer/index.tsx +199 -0
- package/templates/create-full/src/components/ProductDetailOffer/styles.css +211 -0
- package/templates/create-full/src/components/ProductDetailOffer/types.ts +24 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionCheckbox/index.tsx +52 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionCheckbox/styles.css +19 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceBox/index.tsx +60 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceBox/styles.css +38 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSelect/index.tsx +102 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSelect/styles.css +34 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSwatch/index.tsx +121 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSwatch/styles.css +87 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/index.tsx +57 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionColorPicker/index.tsx +54 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionColorPicker/styles.css +0 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionDatePicker/index.tsx +124 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionDatePicker/styles.css +1 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionFile/index.tsx +217 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionFile/styles.css +87 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionRenderer/index.tsx +133 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionText/index.tsx +60 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionText/styles.css +1 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionTextarea/index.tsx +74 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionTextarea/styles.css +10 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/index.tsx +99 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/styles.css +30 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/types.ts +21 -0
- package/templates/create-full/src/components/ProductDetailPrices/index.tsx +62 -0
- package/templates/create-full/src/components/ProductDetailPrices/styles.css +32 -0
- package/templates/create-full/src/components/ProductDetailPrices/types.ts +10 -0
- package/templates/create-full/src/components/ProductDetailProductGroup/index.tsx +74 -0
- package/templates/create-full/src/components/ProductDetailProductGroup/styles.css +33 -0
- package/templates/create-full/src/components/ProductDetailProductGroup/types.ts +10 -0
- package/templates/create-full/src/components/ProductDetailReviews/index.tsx +205 -0
- package/templates/create-full/src/components/ProductDetailReviews/styles.css +43 -0
- package/templates/create-full/src/components/ProductDetailReviews/types.ts +19 -0
- package/templates/create-full/src/components/ProductDetailSku/index.tsx +38 -0
- package/templates/create-full/src/components/ProductDetailSku/styles.css +16 -0
- package/templates/create-full/src/components/ProductDetailSku/types.ts +11 -0
- package/templates/create-full/src/components/ProductDetailVariant/index.tsx +38 -0
- package/templates/create-full/src/components/ProductDetailVariant/styles.css +14 -0
- package/templates/create-full/src/components/ProductDetailVariant/types.ts +12 -0
- package/templates/create-full/src/components/ProductSlider/index.tsx +151 -0
- package/templates/create-full/src/components/ProductSlider/styles.css +105 -0
- package/templates/create-full/src/components/ProductSlider/types.ts +17 -0
- package/templates/create-full/src/components/RecoverPassword/components/RecoverPasswordForm/index.tsx +133 -0
- package/templates/create-full/src/components/RecoverPassword/components/RecoverPasswordForm/styles.css +0 -0
- package/templates/create-full/src/components/RecoverPassword/index.tsx +30 -0
- package/templates/create-full/src/components/RecoverPassword/styles.css +93 -0
- package/templates/create-full/src/components/RecoverPassword/types.ts +13 -0
- package/templates/create-full/src/components/Register/components/RegisterForm/index.tsx +326 -0
- package/templates/create-full/src/components/Register/components/RegisterForm/styles.css +0 -0
- package/templates/create-full/src/components/Register/index.tsx +30 -0
- package/templates/create-full/src/components/Register/styles.css +152 -0
- package/templates/create-full/src/components/Register/types.ts +27 -0
- package/templates/create-full/src/components/RichText/index.tsx +25 -0
- package/templates/create-full/src/components/RichText/styles.css +51 -0
- package/templates/create-full/src/components/RichText/types.ts +5 -0
- package/templates/create-full/src/components/SocialMediaIcon/index.tsx +26 -0
- package/templates/create-full/src/components/SocialMediaIcon/styles.css +17 -0
- package/templates/create-full/src/components/SocialMediaIcon/types.ts +7 -0
- package/templates/create-full/src/components/index.ts +50 -0
- package/templates/create-full/src/global-types.ts +13 -0
- package/templates/create-full/src/global.css +582 -0
- package/templates/create-full/src/hooks/useBundleProducts.ts +75 -0
- package/templates/create-full/src/hooks/useColumnPreference.ts +26 -0
- package/templates/create-full/src/hooks/useInfiniteScroll.ts +49 -0
- package/templates/create-full/src/hooks/usePageTracking.ts +56 -0
- package/templates/create-full/src/hooks/usePayWithIkas.ts +114 -0
- package/templates/create-full/src/hooks/useRedirectIfLoggedIn.ts +35 -0
- package/templates/create-full/src/hooks/useScrollLock.ts +20 -0
- package/templates/create-full/src/hooks/useToast.ts +27 -0
- package/templates/create-full/src/ikas-component-utils.d.ts +3 -0
- package/templates/create-full/src/sub-components/Badge/index.tsx +208 -0
- package/templates/create-full/src/sub-components/Badge/styles.css +129 -0
- package/templates/create-full/src/sub-components/Breadcrumb/index.tsx +57 -0
- package/templates/create-full/src/sub-components/Breadcrumb/styles.css +49 -0
- package/templates/create-full/src/sub-components/BundleMedia/index.tsx +72 -0
- package/templates/create-full/src/sub-components/BundleQuantityBox/index.tsx +73 -0
- package/templates/create-full/src/sub-components/BundleQuantityBox/styles.css +43 -0
- package/templates/create-full/src/sub-components/Button/index.tsx +52 -0
- package/templates/create-full/src/sub-components/Button/styles.css +114 -0
- package/templates/create-full/src/sub-components/CartItem/components/BundleProductItem/index.tsx +59 -0
- package/templates/create-full/src/sub-components/CartItem/components/BundleProductItem/styles.css +24 -0
- package/templates/create-full/src/sub-components/CartItem/components/BundleProducts/index.tsx +55 -0
- package/templates/create-full/src/sub-components/CartItem/components/BundleProducts/styles.css +30 -0
- package/templates/create-full/src/sub-components/CartItem/components/ItemOptions/index.tsx +31 -0
- package/templates/create-full/src/sub-components/CartItem/components/ItemOptions/styles.css +6 -0
- package/templates/create-full/src/sub-components/CartItem/components/OptionValueDisplay/index.tsx +79 -0
- package/templates/create-full/src/sub-components/CartItem/components/OptionValueDisplay/styles.css +28 -0
- package/templates/create-full/src/sub-components/CartItem/index.tsx +216 -0
- package/templates/create-full/src/sub-components/CartItem/styles.css +170 -0
- package/templates/create-full/src/sub-components/Checkbox/index.tsx +42 -0
- package/templates/create-full/src/sub-components/Checkbox/styles.css +65 -0
- package/templates/create-full/src/sub-components/CollapsibleGroup/index.tsx +52 -0
- package/templates/create-full/src/sub-components/CollapsibleGroup/styles.css +51 -0
- package/templates/create-full/src/sub-components/ColorInput/index.tsx +33 -0
- package/templates/create-full/src/sub-components/ColorInput/styles.css +53 -0
- package/templates/create-full/src/sub-components/ConfirmModal/index.tsx +60 -0
- package/templates/create-full/src/sub-components/ConfirmModal/styles.css +20 -0
- package/templates/create-full/src/sub-components/FormItem/index.tsx +66 -0
- package/templates/create-full/src/sub-components/FormItem/styles.css +38 -0
- package/templates/create-full/src/sub-components/ImagePreviewModal/index.tsx +55 -0
- package/templates/create-full/src/sub-components/ImagePreviewModal/styles.css +50 -0
- package/templates/create-full/src/sub-components/Input/index.tsx +69 -0
- package/templates/create-full/src/sub-components/Input/styles.css +162 -0
- package/templates/create-full/src/sub-components/Modal/index.tsx +118 -0
- package/templates/create-full/src/sub-components/Modal/styles.css +70 -0
- package/templates/create-full/src/sub-components/PageLoader/index.tsx +14 -0
- package/templates/create-full/src/sub-components/PageLoader/styles.css +12 -0
- package/templates/create-full/src/sub-components/Pagination/index.tsx +107 -0
- package/templates/create-full/src/sub-components/Pagination/styles.css +88 -0
- package/templates/create-full/src/sub-components/ProductCard/index.tsx +276 -0
- package/templates/create-full/src/sub-components/ProductCard/styles.css +99 -0
- package/templates/create-full/src/sub-components/QuantitySelector/index.tsx +41 -0
- package/templates/create-full/src/sub-components/QuantitySelector/styles.css +51 -0
- package/templates/create-full/src/sub-components/ReviewCard/index.tsx +103 -0
- package/templates/create-full/src/sub-components/ReviewCard/styles.css +95 -0
- package/templates/create-full/src/sub-components/ReviewForm/index.tsx +115 -0
- package/templates/create-full/src/sub-components/ReviewForm/styles.css +11 -0
- package/templates/create-full/src/sub-components/ReviewSummary/index.tsx +65 -0
- package/templates/create-full/src/sub-components/ReviewSummary/styles.css +86 -0
- package/templates/create-full/src/sub-components/Select/index.tsx +86 -0
- package/templates/create-full/src/sub-components/Select/styles.css +110 -0
- package/templates/create-full/src/sub-components/SkeletonField/index.tsx +12 -0
- package/templates/create-full/src/sub-components/SkeletonField/styles.css +29 -0
- package/templates/create-full/src/sub-components/SliderArrow/index.tsx +26 -0
- package/templates/create-full/src/sub-components/SliderArrow/styles.css +24 -0
- package/templates/create-full/src/sub-components/SocialLoginButton/index.tsx +24 -0
- package/templates/create-full/src/sub-components/SocialLoginButton/styles.css +19 -0
- package/templates/create-full/src/sub-components/SpinnerIcon/index.tsx +10 -0
- package/templates/create-full/src/sub-components/SpinnerIcon/styles.css +8 -0
- package/templates/create-full/src/sub-components/StarRating/index.tsx +76 -0
- package/templates/create-full/src/sub-components/StarRating/styles.css +40 -0
- package/templates/create-full/src/sub-components/Tag/index.tsx +21 -0
- package/templates/create-full/src/sub-components/Tag/styles.css +30 -0
- package/templates/create-full/src/sub-components/Textarea/index.tsx +45 -0
- package/templates/create-full/src/sub-components/Textarea/styles.css +82 -0
- package/templates/create-full/src/sub-components/Toast/index.tsx +257 -0
- package/templates/create-full/src/sub-components/Toast/styles.css +3 -0
- package/templates/create-full/src/sub-components/Toggle/index.tsx +46 -0
- package/templates/create-full/src/sub-components/Toggle/styles.css +86 -0
- package/templates/create-full/src/sub-components/VariantBadge/index.tsx +153 -0
- package/templates/create-full/src/sub-components/VariantBadge/styles.css +47 -0
- package/templates/create-full/src/sub-components/icons/index.tsx +981 -0
- package/templates/create-full/src/utils/bundle.ts +70 -0
- package/templates/create-full/src/utils/cx.ts +4 -0
- package/templates/create-full/src/utils/fullName.ts +6 -0
- package/templates/create-full/src/utils/media.ts +36 -0
- package/templates/create-full/src/utils/optionPrice.ts +19 -0
- package/templates/create-full/src/utils/optionSet.ts +17 -0
- package/templates/create-full/src/utils/orderStatus.ts +28 -0
- package/templates/create-full/src/utils/pagination.ts +29 -0
- package/templates/create-full/src/utils/toast.ts +5 -0
- package/templates/create-full/tsconfig.json +30 -0
- package/templates/create-full/vite.config.ts +15 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IkasBundleProduct,
|
|
3
|
+
getSelectedProductVariant,
|
|
4
|
+
getProductHref,
|
|
5
|
+
shouldDisplayBundleProductPrice,
|
|
6
|
+
getBundleProductFinalPrice,
|
|
7
|
+
getBundleProductSellPrice,
|
|
8
|
+
getBundleProductFormattedFinalPrice,
|
|
9
|
+
getBundleProductFormattedSellPrice,
|
|
10
|
+
getBundleProductFormattedFinalPriceWithQuantity,
|
|
11
|
+
getBundleProductFormattedSellPriceWithQuantity,
|
|
12
|
+
getBundleProductFinalPriceWithQuantity,
|
|
13
|
+
getBundleProductSellPriceWithQuantity,
|
|
14
|
+
hasProductVariantStock,
|
|
15
|
+
} from "@ikas/bp-storefront";
|
|
16
|
+
import { observer } from "@ikas/component-utils";
|
|
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
|
+
import type { AspectRatio, ObjectFit } from "../../../../global-types";
|
|
22
|
+
|
|
23
|
+
interface Props {
|
|
24
|
+
bundleProduct: IkasBundleProduct;
|
|
25
|
+
quantityLabel: string;
|
|
26
|
+
outOfStockText: string;
|
|
27
|
+
bundleProductWithoutLink?: boolean;
|
|
28
|
+
aspectRatio?: AspectRatio;
|
|
29
|
+
objectFit?: ObjectFit;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const BundleProductItem = observer(function BundleProductItem({
|
|
33
|
+
bundleProduct,
|
|
34
|
+
quantityLabel,
|
|
35
|
+
outOfStockText,
|
|
36
|
+
bundleProductWithoutLink,
|
|
37
|
+
aspectRatio = "Square",
|
|
38
|
+
objectFit = "Cover",
|
|
39
|
+
}: Props) {
|
|
40
|
+
const product = bundleProduct.product;
|
|
41
|
+
if (!product) return null;
|
|
42
|
+
|
|
43
|
+
const selectedVariant = getSelectedProductVariant(product);
|
|
44
|
+
const hasStock = selectedVariant
|
|
45
|
+
? hasProductVariantStock(selectedVariant)
|
|
46
|
+
: false;
|
|
47
|
+
|
|
48
|
+
const productHref = getProductHref(product);
|
|
49
|
+
|
|
50
|
+
const showPrice = shouldDisplayBundleProductPrice(bundleProduct);
|
|
51
|
+
const unitFinalPrice = getBundleProductFinalPrice(bundleProduct);
|
|
52
|
+
const unitSellPrice = getBundleProductSellPrice(bundleProduct);
|
|
53
|
+
const hasDiscount = showPrice && unitFinalPrice !== unitSellPrice;
|
|
54
|
+
|
|
55
|
+
const hasQuantity = bundleProduct.quantity > 1;
|
|
56
|
+
|
|
57
|
+
const totalFinalPrice = getBundleProductFinalPriceWithQuantity(bundleProduct);
|
|
58
|
+
const totalSellPrice = getBundleProductSellPriceWithQuantity(bundleProduct);
|
|
59
|
+
const hasTotalDiscount =
|
|
60
|
+
showPrice &&
|
|
61
|
+
totalFinalPrice !== totalSellPrice &&
|
|
62
|
+
bundleProduct.quantity > 0;
|
|
63
|
+
|
|
64
|
+
const ImageWrapper = bundleProductWithoutLink ? "div" : "a";
|
|
65
|
+
const imageWrapperProps = bundleProductWithoutLink
|
|
66
|
+
? {}
|
|
67
|
+
: { href: productHref, "aria-label": product.name };
|
|
68
|
+
|
|
69
|
+
const NameWrapper = bundleProductWithoutLink ? "span" : "a";
|
|
70
|
+
const nameWrapperProps = bundleProductWithoutLink
|
|
71
|
+
? {}
|
|
72
|
+
: { href: productHref };
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<div className="kombos-bundle-item">
|
|
76
|
+
{/* Image */}
|
|
77
|
+
<ImageWrapper
|
|
78
|
+
className="kombos-bundle-item__image-wrap"
|
|
79
|
+
{...imageWrapperProps}
|
|
80
|
+
>
|
|
81
|
+
<BundleMedia
|
|
82
|
+
variant={selectedVariant}
|
|
83
|
+
alt={product.name}
|
|
84
|
+
aspectRatio={aspectRatio}
|
|
85
|
+
objectFit={objectFit}
|
|
86
|
+
wrapperClassName="kombos-bundle-item__media-inner"
|
|
87
|
+
mediaClassName="kombos-bundle-item__image"
|
|
88
|
+
placeholderClassName="kombos-bundle-item__image-placeholder"
|
|
89
|
+
/>
|
|
90
|
+
</ImageWrapper>
|
|
91
|
+
{/* Info */}
|
|
92
|
+
<div className="kombos-bundle-item__info">
|
|
93
|
+
{/* Header: name + total price (quantity × unit) */}
|
|
94
|
+
<div className="kombos-bundle-item__header">
|
|
95
|
+
<NameWrapper
|
|
96
|
+
className="kombos-bundle-item__name text-sm-semibold"
|
|
97
|
+
{...nameWrapperProps}
|
|
98
|
+
>
|
|
99
|
+
{product.name}
|
|
100
|
+
</NameWrapper>
|
|
101
|
+
{showPrice && hasQuantity && (
|
|
102
|
+
<div className="kombos-bundle-item__total-price">
|
|
103
|
+
{hasTotalDiscount && (
|
|
104
|
+
<span className="kombos-bundle-item__total-sell text-sm-regular-strike">
|
|
105
|
+
{getBundleProductFormattedSellPriceWithQuantity(
|
|
106
|
+
bundleProduct,
|
|
107
|
+
)}
|
|
108
|
+
</span>
|
|
109
|
+
)}
|
|
110
|
+
<span className="kombos-bundle-item__total-final text-sm-semibold">
|
|
111
|
+
{getBundleProductFormattedFinalPriceWithQuantity(bundleProduct)}
|
|
112
|
+
</span>
|
|
113
|
+
</div>
|
|
114
|
+
)}
|
|
115
|
+
{showPrice && !hasQuantity && (
|
|
116
|
+
<div className="kombos-bundle-item__unit-price">
|
|
117
|
+
{hasDiscount && (
|
|
118
|
+
<span className="kombos-bundle-item__sell-price text-sm-regular-strike">
|
|
119
|
+
{getBundleProductFormattedSellPrice(bundleProduct)}
|
|
120
|
+
</span>
|
|
121
|
+
)}
|
|
122
|
+
<span className="kombos-bundle-item__final-price text-sm-semibold">
|
|
123
|
+
{getBundleProductFormattedFinalPrice(bundleProduct)}
|
|
124
|
+
</span>
|
|
125
|
+
</div>
|
|
126
|
+
)}
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
{/* Variants */}
|
|
130
|
+
<VariantBadge
|
|
131
|
+
product={product}
|
|
132
|
+
disableRoute
|
|
133
|
+
size="xs"
|
|
134
|
+
onSelect={() => adjustBundleProductQuantity(bundleProduct)}
|
|
135
|
+
/>
|
|
136
|
+
|
|
137
|
+
{/* Bottom: quantity + unit price + out of stock */}
|
|
138
|
+
<div className="kombos-bundle-item__bottom">
|
|
139
|
+
<div className="kombos-bundle-item__qty-row">
|
|
140
|
+
<span className="kombos-bundle-item__qty-label text-xs-regular">
|
|
141
|
+
{quantityLabel}
|
|
142
|
+
</span>
|
|
143
|
+
<BundleQuantityBox bundleProduct={bundleProduct} />
|
|
144
|
+
{showPrice && bundleProduct.quantity > 1 && (
|
|
145
|
+
<div className="kombos-bundle-item__unit-price">
|
|
146
|
+
{hasDiscount && (
|
|
147
|
+
<span className="kombos-bundle-item__sell-price text-sm-regular-strike">
|
|
148
|
+
{getBundleProductFormattedSellPrice(bundleProduct)}
|
|
149
|
+
</span>
|
|
150
|
+
)}
|
|
151
|
+
<span className="kombos-bundle-item__final-price text-sm-semibold">
|
|
152
|
+
{getBundleProductFormattedFinalPrice(bundleProduct)}
|
|
153
|
+
</span>
|
|
154
|
+
</div>
|
|
155
|
+
)}
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
{!hasStock && (
|
|
159
|
+
<span className="kombos-bundle-item__out-of-stock text-xs-medium">
|
|
160
|
+
{outOfStockText}
|
|
161
|
+
</span>
|
|
162
|
+
)}
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
export default BundleProductItem;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/* ===== BundleProductItem ===== */
|
|
2
|
+
.kombos-bundle-item {
|
|
3
|
+
display: flex;
|
|
4
|
+
gap: 0.75rem;
|
|
5
|
+
padding: 0.75rem 0;
|
|
6
|
+
border-bottom: 1px solid var(--kombos-gray-100);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.kombos-bundle-item__image-wrap {
|
|
10
|
+
display: block;
|
|
11
|
+
width: 6.25rem;
|
|
12
|
+
min-width: 6.25rem;
|
|
13
|
+
height: fit-content;
|
|
14
|
+
border-radius: 6px;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
background-color: var(--kombos-gray-50);
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.kombos-bundle-item__image {
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
object-fit: cover;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.kombos-bundle-item__image-placeholder {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
width: 100%;
|
|
31
|
+
height: 100%;
|
|
32
|
+
font-size: 2rem;
|
|
33
|
+
color: var(--kombos-gray-300);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.kombos-bundle-item__info {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
gap: 0.5rem;
|
|
40
|
+
flex: 1;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.kombos-bundle-item__header {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: flex-start;
|
|
47
|
+
justify-content: space-between;
|
|
48
|
+
gap: 0.75rem;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.kombos-bundle-item__name {
|
|
52
|
+
color: var(--kombos-gray-900);
|
|
53
|
+
text-decoration: none;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
text-overflow: ellipsis;
|
|
56
|
+
display: -webkit-box;
|
|
57
|
+
-webkit-line-clamp: 2;
|
|
58
|
+
-webkit-box-orient: vertical;
|
|
59
|
+
width: fit-content;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
a.kombos-bundle-item__name:hover {
|
|
63
|
+
text-decoration: underline;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.kombos-bundle-item__unit-price {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 0.375rem;
|
|
70
|
+
flex-shrink: 0;
|
|
71
|
+
white-space: nowrap;
|
|
72
|
+
margin-left: auto;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
.kombos-bundle-item__final-price {
|
|
77
|
+
color: var(--kombos-gray-900);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.kombos-bundle-item__sell-price {
|
|
81
|
+
color: var(--kombos-gray-500);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.kombos-bundle-item__bottom {
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
gap: 0.5rem;
|
|
88
|
+
margin-top: auto;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.kombos-bundle-item__qty-row {
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
gap: 0.5rem;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.kombos-bundle-item__qty-label {
|
|
98
|
+
color: var(--kombos-gray-500);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.kombos-bundle-item__total-price {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
gap: 0.375rem;
|
|
105
|
+
flex-shrink: 0;
|
|
106
|
+
white-space: nowrap;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.kombos-bundle-item__total-final {
|
|
110
|
+
color: var(--kombos-gray-900);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.kombos-bundle-item__total-sell {
|
|
114
|
+
color: var(--kombos-gray-500);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.kombos-bundle-item__out-of-stock {
|
|
118
|
+
color: var(--kombos-error);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* ===== Mobile adjustments (< 768px) ===== */
|
|
122
|
+
@media (max-width: 767px) {
|
|
123
|
+
.kombos-bundle-item__image-wrap {
|
|
124
|
+
width: 4.5rem;
|
|
125
|
+
min-width: 4.5rem;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.kombos-bundle-item__header {
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
gap: 0.25rem;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.kombos-bundle-item__unit-price {
|
|
134
|
+
margin-left: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.kombos-bundle-item__qty-row {
|
|
138
|
+
flex-wrap: wrap;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
count?: number;
|
|
3
|
+
variant?: "card" | "table";
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export default function BundleSkeletonLoading({ count = 3, variant = "card" }: Props) {
|
|
7
|
+
if (variant === "table") {
|
|
8
|
+
return (
|
|
9
|
+
<div className="kombos-bundle-skeleton-table">
|
|
10
|
+
<div className="kombos-bundle-skeleton-table__header kombos-bundle-skeleton__shimmer" />
|
|
11
|
+
{Array.from({ length: count }).map((_, i) => (
|
|
12
|
+
<div key={i} className="kombos-bundle-skeleton-table__row">
|
|
13
|
+
<div className="kombos-bundle-skeleton__bar kombos-bundle-skeleton__bar--wide kombos-bundle-skeleton__shimmer" />
|
|
14
|
+
<div className="kombos-bundle-skeleton__bar kombos-bundle-skeleton__bar--price kombos-bundle-skeleton__shimmer" />
|
|
15
|
+
</div>
|
|
16
|
+
))}
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div className="kombos-bundle-skeleton">
|
|
23
|
+
{Array.from({ length: count }).map((_, i) => (
|
|
24
|
+
<div key={i} className="kombos-bundle-skeleton__item">
|
|
25
|
+
<div className="kombos-bundle-skeleton__image kombos-bundle-skeleton__shimmer" />
|
|
26
|
+
<div className="kombos-bundle-skeleton__info">
|
|
27
|
+
<div className="kombos-bundle-skeleton__bar kombos-bundle-skeleton__bar--wide kombos-bundle-skeleton__shimmer" />
|
|
28
|
+
<div className="kombos-bundle-skeleton__bar kombos-bundle-skeleton__bar--medium kombos-bundle-skeleton__shimmer" />
|
|
29
|
+
<div className="kombos-bundle-skeleton__bar kombos-bundle-skeleton__bar--narrow kombos-bundle-skeleton__shimmer" />
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
))}
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* ===== BundleSkeletonLoading ===== */
|
|
2
|
+
.kombos-bundle-skeleton {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: 1rem;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.kombos-bundle-skeleton__item {
|
|
9
|
+
display: flex;
|
|
10
|
+
gap: 0.75rem;
|
|
11
|
+
padding: 0.75rem 0;
|
|
12
|
+
border-bottom: 1px solid var(--kombos-gray-100);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.kombos-bundle-skeleton__image {
|
|
16
|
+
width: 6.25rem;
|
|
17
|
+
min-width: 6.25rem;
|
|
18
|
+
height: 4.75rem;
|
|
19
|
+
border-radius: 6px;
|
|
20
|
+
background-color: var(--kombos-gray-100);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.kombos-bundle-skeleton__info {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: 0.5rem;
|
|
27
|
+
flex: 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.kombos-bundle-skeleton__bar {
|
|
31
|
+
height: 0.875rem;
|
|
32
|
+
border-radius: 4px;
|
|
33
|
+
background-color: var(--kombos-gray-100);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.kombos-bundle-skeleton__bar--wide {
|
|
37
|
+
width: 70%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.kombos-bundle-skeleton__bar--medium {
|
|
41
|
+
width: 50%;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.kombos-bundle-skeleton__bar--narrow {
|
|
45
|
+
width: 35%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.kombos-bundle-skeleton__bar--price {
|
|
49
|
+
width: 4.5rem;
|
|
50
|
+
margin-left: auto;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ===== Table variant ===== */
|
|
54
|
+
.kombos-bundle-skeleton-table {
|
|
55
|
+
border: 1px solid var(--kombos-gray-200);
|
|
56
|
+
border-radius: 6px;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.kombos-bundle-skeleton-table__header {
|
|
61
|
+
height: 2.75rem;
|
|
62
|
+
background-color: var(--kombos-gray-200);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.kombos-bundle-skeleton-table__row {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
padding: 0.75rem 1rem;
|
|
69
|
+
border-bottom: 1px solid var(--kombos-gray-100);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.kombos-bundle-skeleton-table__row:last-child {
|
|
73
|
+
border-bottom: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.kombos-bundle-skeleton__shimmer {
|
|
77
|
+
background: linear-gradient(
|
|
78
|
+
90deg,
|
|
79
|
+
var(--kombos-gray-100) 25%,
|
|
80
|
+
var(--kombos-gray-50) 50%,
|
|
81
|
+
var(--kombos-gray-100) 75%
|
|
82
|
+
);
|
|
83
|
+
background-size: 200% 100%;
|
|
84
|
+
animation: kombos-shimmer 1.5s ease-in-out infinite;
|
|
85
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
shouldDisplayBundleProductPrice,
|
|
3
|
+
getBundleProductFormattedFinalPrice,
|
|
4
|
+
getProductHref,
|
|
5
|
+
IkasBundleProduct,
|
|
6
|
+
} from "@ikas/bp-storefront";
|
|
7
|
+
import { observer } from "@ikas/component-utils";
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
bundleProduct: IkasBundleProduct;
|
|
11
|
+
withoutLink?: boolean;
|
|
12
|
+
quantityLabel: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const FurnitureRow = observer(function FurnitureRow({
|
|
16
|
+
bundleProduct,
|
|
17
|
+
withoutLink,
|
|
18
|
+
quantityLabel,
|
|
19
|
+
}: Props) {
|
|
20
|
+
const product = bundleProduct.product;
|
|
21
|
+
if (!product || bundleProduct.quantity === 0) return null;
|
|
22
|
+
|
|
23
|
+
const showPrice = shouldDisplayBundleProductPrice(bundleProduct);
|
|
24
|
+
const formattedPrice = showPrice
|
|
25
|
+
? getBundleProductFormattedFinalPrice(bundleProduct)
|
|
26
|
+
: "";
|
|
27
|
+
const productHref = getProductHref(product);
|
|
28
|
+
|
|
29
|
+
const NameTag = withoutLink ? "span" : "a";
|
|
30
|
+
const nameProps = withoutLink ? {} : { href: productHref };
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<tr className="kombos-bundle-table__row">
|
|
34
|
+
<td className="kombos-bundle-table__cell kombos-bundle-table__cell--name">
|
|
35
|
+
<NameTag
|
|
36
|
+
className="kombos-bundle-table__link text-sm-regular"
|
|
37
|
+
{...nameProps}
|
|
38
|
+
>
|
|
39
|
+
{product.name}
|
|
40
|
+
</NameTag>
|
|
41
|
+
</td>
|
|
42
|
+
<td className="kombos-bundle-table__cell kombos-bundle-table__cell--price text-sm-medium">
|
|
43
|
+
{showPrice && formattedPrice
|
|
44
|
+
? `${bundleProduct.quantity} x ${formattedPrice}`
|
|
45
|
+
: `${quantityLabel} ${bundleProduct.quantity}`}
|
|
46
|
+
</td>
|
|
47
|
+
</tr>
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export default FurnitureRow;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.kombos-bundle-table__row {
|
|
2
|
+
border-bottom: 1px solid var(--kombos-gray-200);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.kombos-bundle-table__row:last-child {
|
|
6
|
+
border-bottom: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.kombos-bundle-table__cell {
|
|
10
|
+
padding: 0.75rem 1rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.kombos-bundle-table__cell--name {
|
|
14
|
+
color: var(--kombos-gray-900);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.kombos-bundle-table__link {
|
|
18
|
+
color: inherit;
|
|
19
|
+
text-decoration: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
a.kombos-bundle-table__link:hover {
|
|
23
|
+
text-decoration: underline;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.kombos-bundle-table__cell--price {
|
|
27
|
+
color: var(--kombos-gray-900);
|
|
28
|
+
text-align: right;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { IkasBundleProduct } from "@ikas/bp-storefront";
|
|
2
|
+
import BundleSkeletonLoading from "../BundleSkeletonLoading";
|
|
3
|
+
import FurnitureRow from "../FurnitureRow";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
marginStyles: Record<string, string>;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
skeletonCount: number;
|
|
9
|
+
sortedProducts: IkasBundleProduct[];
|
|
10
|
+
productContentTitle: string;
|
|
11
|
+
bundleProductWithoutLink?: boolean;
|
|
12
|
+
quantityLabel: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default function FurnitureView({
|
|
16
|
+
marginStyles,
|
|
17
|
+
isLoading,
|
|
18
|
+
skeletonCount,
|
|
19
|
+
sortedProducts,
|
|
20
|
+
productContentTitle,
|
|
21
|
+
bundleProductWithoutLink,
|
|
22
|
+
quantityLabel,
|
|
23
|
+
}: Props) {
|
|
24
|
+
return (
|
|
25
|
+
<div
|
|
26
|
+
className="kombos-bundle"
|
|
27
|
+
style={{ ...marginStyles, "--kombos-bundle-table-border": "var(--kombos-gray-900)" }}
|
|
28
|
+
>
|
|
29
|
+
{isLoading ? (
|
|
30
|
+
<BundleSkeletonLoading count={skeletonCount} variant="table" />
|
|
31
|
+
) : (
|
|
32
|
+
<div className="kombos-bundle-table">
|
|
33
|
+
<div className="kombos-bundle-table__header">
|
|
34
|
+
<span className="kombos-bundle-table__title text-md-semibold">
|
|
35
|
+
{productContentTitle}
|
|
36
|
+
</span>
|
|
37
|
+
</div>
|
|
38
|
+
<table className="kombos-bundle-table__table">
|
|
39
|
+
<tbody>
|
|
40
|
+
{sortedProducts.map((bp) => (
|
|
41
|
+
<FurnitureRow
|
|
42
|
+
key={bp.id}
|
|
43
|
+
bundleProduct={bp}
|
|
44
|
+
withoutLink={bundleProductWithoutLink}
|
|
45
|
+
quantityLabel={quantityLabel}
|
|
46
|
+
/>
|
|
47
|
+
))}
|
|
48
|
+
</tbody>
|
|
49
|
+
</table>
|
|
50
|
+
</div>
|
|
51
|
+
)}
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.kombos-bundle-table {
|
|
2
|
+
border: 1px solid var(--kombos-bundle-table-border, var(--kombos-gray-900));
|
|
3
|
+
border-radius: 6px;
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.kombos-bundle-table__header {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
padding: 0.75rem 1rem;
|
|
11
|
+
background-color: var(--kombos-gray-900);
|
|
12
|
+
color: var(--kombos-white);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.kombos-bundle-table__title {
|
|
16
|
+
color: inherit;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.kombos-bundle-table__table {
|
|
20
|
+
width: 100%;
|
|
21
|
+
border-collapse: collapse;
|
|
22
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getFormattedMarginTopSize,
|
|
3
|
+
getFormattedMarginBottomSize,
|
|
4
|
+
} from "@ikas/bp-storefront";
|
|
5
|
+
import { Props } from "./types";
|
|
6
|
+
import { useBundleProducts } from "../../hooks/useBundleProducts";
|
|
7
|
+
import BundleProductItem from "./components/BundleProductItem";
|
|
8
|
+
import BundleSkeletonLoading from "./components/BundleSkeletonLoading";
|
|
9
|
+
import FurnitureView from "./components/FurnitureView";
|
|
10
|
+
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Helpers
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
function buildMarginStyles(
|
|
16
|
+
props: Pick<
|
|
17
|
+
Props,
|
|
18
|
+
| "mobileMarginTop"
|
|
19
|
+
| "mobileMarginBottom"
|
|
20
|
+
| "desktopMarginTop"
|
|
21
|
+
| "desktopMarginBottom"
|
|
22
|
+
>,
|
|
23
|
+
) {
|
|
24
|
+
return {
|
|
25
|
+
"--mobile-mt": getFormattedMarginTopSize(props.mobileMarginTop),
|
|
26
|
+
"--mobile-mb": getFormattedMarginBottomSize(props.mobileMarginBottom),
|
|
27
|
+
"--desktop-mt": getFormattedMarginTopSize(props.desktopMarginTop),
|
|
28
|
+
"--desktop-mb": getFormattedMarginBottomSize(props.desktopMarginBottom),
|
|
29
|
+
} as Record<string, string>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
// Main component
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
|
|
36
|
+
export function ProductDetailBundleProduct({
|
|
37
|
+
product,
|
|
38
|
+
mobileMarginTop,
|
|
39
|
+
mobileMarginBottom,
|
|
40
|
+
desktopMarginTop,
|
|
41
|
+
desktopMarginBottom,
|
|
42
|
+
isBundleFurniture,
|
|
43
|
+
bundleProductWithoutLink,
|
|
44
|
+
quantityLabel = "Adet",
|
|
45
|
+
outOfStockText = "Stokta yok",
|
|
46
|
+
productContentTitle = "Takım içeriği",
|
|
47
|
+
aspectRatio,
|
|
48
|
+
objectFit,
|
|
49
|
+
}: Props) {
|
|
50
|
+
const { isLoading, selectedVariant, bundleSettings, sortedProducts } =
|
|
51
|
+
useBundleProducts(product);
|
|
52
|
+
|
|
53
|
+
if (!product || !selectedVariant || !bundleSettings) return null;
|
|
54
|
+
|
|
55
|
+
const marginStyles = buildMarginStyles({
|
|
56
|
+
mobileMarginTop,
|
|
57
|
+
mobileMarginBottom,
|
|
58
|
+
desktopMarginTop,
|
|
59
|
+
desktopMarginBottom,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const skeletonCount = sortedProducts.length || 3;
|
|
63
|
+
|
|
64
|
+
if (isBundleFurniture) {
|
|
65
|
+
return (
|
|
66
|
+
<FurnitureView
|
|
67
|
+
marginStyles={marginStyles}
|
|
68
|
+
isLoading={isLoading}
|
|
69
|
+
skeletonCount={skeletonCount}
|
|
70
|
+
sortedProducts={sortedProducts}
|
|
71
|
+
productContentTitle={productContentTitle}
|
|
72
|
+
bundleProductWithoutLink={bundleProductWithoutLink}
|
|
73
|
+
quantityLabel={quantityLabel}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<div className="kombos-bundle" style={marginStyles}>
|
|
80
|
+
<div className="kombos-bundle__list">
|
|
81
|
+
{isLoading ? (
|
|
82
|
+
<BundleSkeletonLoading count={skeletonCount} />
|
|
83
|
+
) : (
|
|
84
|
+
sortedProducts.map((bp) => (
|
|
85
|
+
<BundleProductItem
|
|
86
|
+
key={bp.id}
|
|
87
|
+
bundleProduct={bp}
|
|
88
|
+
quantityLabel={quantityLabel}
|
|
89
|
+
outOfStockText={outOfStockText}
|
|
90
|
+
bundleProductWithoutLink={bundleProductWithoutLink}
|
|
91
|
+
aspectRatio={aspectRatio}
|
|
92
|
+
objectFit={objectFit}
|
|
93
|
+
/>
|
|
94
|
+
))
|
|
95
|
+
)}
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export default ProductDetailBundleProduct;
|