@ikas/component-cli 0.92.0 → 0.94.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.map +1 -1
- package/dist/commands/create.js +108 -42
- package/dist/commands/create.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.js +1 -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/package.json +3 -2
- package/templates/create/claude-md +1 -1
- package/templates/create/cursorrules +1 -1
- 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/claude-md +721 -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 +17 -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,205 @@
|
|
|
1
|
+
import { useState, useEffect, useRef } from "preact/hooks";
|
|
2
|
+
import type { IkasCustomerReviewList } from "@ikas/bp-storefront";
|
|
3
|
+
import {
|
|
4
|
+
customerStore,
|
|
5
|
+
getProductCustomerReviews,
|
|
6
|
+
getCustomerReviewListPageCount,
|
|
7
|
+
hasCustomerReviewListPrevPage,
|
|
8
|
+
hasCustomerReviewListNextPage,
|
|
9
|
+
getCustomerReviewListPage,
|
|
10
|
+
isCustomerReviewEnabled,
|
|
11
|
+
isCustomerReviewLoginRequired,
|
|
12
|
+
hasCustomer,
|
|
13
|
+
Router,
|
|
14
|
+
getIkasProductCustomerReviewForm,
|
|
15
|
+
clearIkasProductCustomerReviewForm,
|
|
16
|
+
} from "@ikas/bp-storefront";
|
|
17
|
+
import { Props } from "./types";
|
|
18
|
+
import Pagination from "../../sub-components/Pagination";
|
|
19
|
+
import Button from "../../sub-components/Button";
|
|
20
|
+
import Modal from "../../sub-components/Modal";
|
|
21
|
+
import ImagePreviewModal from "../../sub-components/ImagePreviewModal";
|
|
22
|
+
import ReviewSummary from "../../sub-components/ReviewSummary";
|
|
23
|
+
import ReviewCard from "../../sub-components/ReviewCard";
|
|
24
|
+
import ReviewForm from "../../sub-components/ReviewForm";
|
|
25
|
+
import PageLoader from "../../sub-components/PageLoader";
|
|
26
|
+
|
|
27
|
+
export function ProductDetailReviews({
|
|
28
|
+
product,
|
|
29
|
+
reviewsPerPage = 5,
|
|
30
|
+
sectionTitle = "Customer Reviews",
|
|
31
|
+
writeReviewButtonText = "Write a Review",
|
|
32
|
+
emptyStateText = "No reviews yet. Be the first to review this product!",
|
|
33
|
+
reviewCountText = "Based on {count} reviews",
|
|
34
|
+
submitButtonText = "Submit Review",
|
|
35
|
+
submittingButtonText = "Submitting...",
|
|
36
|
+
titlePlaceholder = "Review title",
|
|
37
|
+
commentPlaceholder = "Write your review...",
|
|
38
|
+
merchantReplyLabel = "Store Reply",
|
|
39
|
+
starRequiredError = "Please select a rating",
|
|
40
|
+
cancelButtonText = "Cancel",
|
|
41
|
+
errorMessage = "Something went wrong. Please try again.",
|
|
42
|
+
}: Props) {
|
|
43
|
+
const listRef = useRef<HTMLDivElement>(null);
|
|
44
|
+
const [reviewList, setReviewList] = useState<IkasCustomerReviewList | null>(
|
|
45
|
+
null,
|
|
46
|
+
);
|
|
47
|
+
const [formVisible, setFormVisible] = useState(false);
|
|
48
|
+
const [previewImage, setPreviewImage] = useState<{
|
|
49
|
+
src: string;
|
|
50
|
+
alt: string;
|
|
51
|
+
} | null>(null);
|
|
52
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
53
|
+
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (!product) return;
|
|
56
|
+
|
|
57
|
+
setIsLoading(true);
|
|
58
|
+
|
|
59
|
+
getProductCustomerReviews(product, reviewsPerPage)
|
|
60
|
+
.then((result) => {
|
|
61
|
+
setReviewList(result);
|
|
62
|
+
})
|
|
63
|
+
.finally(() => {
|
|
64
|
+
setIsLoading(false);
|
|
65
|
+
});
|
|
66
|
+
}, [product, reviewsPerPage]);
|
|
67
|
+
|
|
68
|
+
if (!product) return null;
|
|
69
|
+
|
|
70
|
+
const reviewsEnabled = isCustomerReviewEnabled(product);
|
|
71
|
+
const hasReviews = reviewList && reviewList.data.length > 0;
|
|
72
|
+
const hasSummary =
|
|
73
|
+
product.averageRating !== null && product.reviewCount !== null;
|
|
74
|
+
|
|
75
|
+
const handleWriteReview = () => {
|
|
76
|
+
if (isCustomerReviewLoginRequired(product) && !hasCustomer(customerStore)) {
|
|
77
|
+
Router.navigateToPage("LOGIN");
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
setFormVisible(true);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const handlePageChange = async (page: number) => {
|
|
85
|
+
if (!reviewList) return;
|
|
86
|
+
|
|
87
|
+
await getCustomerReviewListPage(reviewList, page);
|
|
88
|
+
listRef.current?.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const reviewForm = getIkasProductCustomerReviewForm(product);
|
|
92
|
+
|
|
93
|
+
const handleCloseForm = () => {
|
|
94
|
+
clearIkasProductCustomerReviewForm(product);
|
|
95
|
+
setFormVisible(false);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const handleReviewSuccess = () => {
|
|
99
|
+
getProductCustomerReviews(product, reviewsPerPage).then(setReviewList);
|
|
100
|
+
handleCloseForm();
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<section className="product-detail-reviews">
|
|
105
|
+
<div className="kombos-container product-detail-reviews__inner">
|
|
106
|
+
<div className="product-detail-reviews__header">
|
|
107
|
+
<h2 className="product-detail-reviews__title display-xs-semibold">
|
|
108
|
+
{sectionTitle}
|
|
109
|
+
</h2>
|
|
110
|
+
{reviewsEnabled && !hasSummary && (
|
|
111
|
+
<Button variant="secondary" size="s" onClick={handleWriteReview}>
|
|
112
|
+
{writeReviewButtonText}
|
|
113
|
+
</Button>
|
|
114
|
+
)}
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
{hasSummary && (
|
|
118
|
+
<ReviewSummary
|
|
119
|
+
averageStar={product.averageRating!}
|
|
120
|
+
totalReview={product.reviewCount!}
|
|
121
|
+
stars={product.stars ?? []}
|
|
122
|
+
reviewCountText={reviewCountText}
|
|
123
|
+
action={
|
|
124
|
+
reviewsEnabled ? (
|
|
125
|
+
<Button
|
|
126
|
+
variant="secondary"
|
|
127
|
+
size="s"
|
|
128
|
+
onClick={handleWriteReview}
|
|
129
|
+
>
|
|
130
|
+
{writeReviewButtonText}
|
|
131
|
+
</Button>
|
|
132
|
+
) : undefined
|
|
133
|
+
}
|
|
134
|
+
/>
|
|
135
|
+
)}
|
|
136
|
+
|
|
137
|
+
{isLoading && <PageLoader />}
|
|
138
|
+
|
|
139
|
+
{!hasReviews && !isLoading && reviewList && (
|
|
140
|
+
<p className="product-detail-reviews__empty text-md-regular">
|
|
141
|
+
{emptyStateText}
|
|
142
|
+
</p>
|
|
143
|
+
)}
|
|
144
|
+
|
|
145
|
+
{hasReviews && !isLoading && (
|
|
146
|
+
<>
|
|
147
|
+
<div ref={listRef} className="product-detail-reviews__list">
|
|
148
|
+
{reviewList?.data.map((review) => (
|
|
149
|
+
<ReviewCard
|
|
150
|
+
key={review.id}
|
|
151
|
+
review={review}
|
|
152
|
+
merchantReplyLabel={merchantReplyLabel}
|
|
153
|
+
onImageClick={(src, alt) => setPreviewImage({ src, alt })}
|
|
154
|
+
/>
|
|
155
|
+
))}
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
<Pagination
|
|
159
|
+
currentPage={reviewList.page}
|
|
160
|
+
totalPages={getCustomerReviewListPageCount(reviewList!)}
|
|
161
|
+
hasPrev={hasCustomerReviewListPrevPage(reviewList!)}
|
|
162
|
+
hasNext={hasCustomerReviewListNextPage(reviewList!)}
|
|
163
|
+
onPageChange={handlePageChange}
|
|
164
|
+
/>
|
|
165
|
+
</>
|
|
166
|
+
)}
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
{formVisible && (
|
|
170
|
+
<Modal
|
|
171
|
+
title={writeReviewButtonText}
|
|
172
|
+
onClose={handleCloseForm}
|
|
173
|
+
okText={
|
|
174
|
+
reviewForm.isSubmitting ? submittingButtonText : submitButtonText
|
|
175
|
+
}
|
|
176
|
+
cancelText={cancelButtonText}
|
|
177
|
+
okButtonProps={{
|
|
178
|
+
type: "submit",
|
|
179
|
+
form: "review-form",
|
|
180
|
+
disabled: reviewForm.isSubmitting,
|
|
181
|
+
}}
|
|
182
|
+
>
|
|
183
|
+
<ReviewForm
|
|
184
|
+
product={product}
|
|
185
|
+
onSuccess={handleReviewSuccess}
|
|
186
|
+
titlePlaceholder={titlePlaceholder}
|
|
187
|
+
commentPlaceholder={commentPlaceholder}
|
|
188
|
+
starRequiredError={starRequiredError}
|
|
189
|
+
errorMessage={errorMessage}
|
|
190
|
+
/>
|
|
191
|
+
</Modal>
|
|
192
|
+
)}
|
|
193
|
+
|
|
194
|
+
{previewImage && (
|
|
195
|
+
<ImagePreviewModal
|
|
196
|
+
src={previewImage.src}
|
|
197
|
+
alt={previewImage.alt}
|
|
198
|
+
onClose={() => setPreviewImage(null)}
|
|
199
|
+
/>
|
|
200
|
+
)}
|
|
201
|
+
</section>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export default ProductDetailReviews;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.product-detail-reviews {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.product-detail-reviews__inner {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 1rem;
|
|
9
|
+
padding-top: 2.5rem;
|
|
10
|
+
padding-bottom: 2.5rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@media (min-width: 768px) {
|
|
14
|
+
.product-detail-reviews__inner {
|
|
15
|
+
padding-top: 3.5rem;
|
|
16
|
+
padding-bottom: 3.5rem;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.product-detail-reviews__header {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: space-between;
|
|
24
|
+
gap: 1rem;
|
|
25
|
+
flex-wrap: wrap;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.product-detail-reviews__title {
|
|
29
|
+
margin: 0;
|
|
30
|
+
color: var(--kombos-gray-900);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.product-detail-reviews__empty {
|
|
34
|
+
color: var(--kombos-gray-500);
|
|
35
|
+
text-align: center;
|
|
36
|
+
padding: 3rem 1rem;
|
|
37
|
+
margin: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.product-detail-reviews__list {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// This file is auto-generated — do not edit manually.
|
|
2
|
+
import type { IkasProduct } from "@ikas/bp-storefront";
|
|
3
|
+
|
|
4
|
+
export interface Props {
|
|
5
|
+
product?: IkasProduct | null;
|
|
6
|
+
reviewsPerPage?: number;
|
|
7
|
+
sectionTitle?: string;
|
|
8
|
+
writeReviewButtonText?: string;
|
|
9
|
+
emptyStateText?: string;
|
|
10
|
+
reviewCountText?: string;
|
|
11
|
+
submitButtonText?: string;
|
|
12
|
+
submittingButtonText?: string;
|
|
13
|
+
titlePlaceholder?: string;
|
|
14
|
+
commentPlaceholder?: string;
|
|
15
|
+
merchantReplyLabel?: string;
|
|
16
|
+
starRequiredError?: string;
|
|
17
|
+
cancelButtonText?: string;
|
|
18
|
+
errorMessage?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getFormattedMarginTopSize,
|
|
3
|
+
getFormattedMarginBottomSize,
|
|
4
|
+
getSelectedProductVariant,
|
|
5
|
+
} from "@ikas/bp-storefront";
|
|
6
|
+
import { Props } from "./types";
|
|
7
|
+
|
|
8
|
+
export function ProductDetailSku({
|
|
9
|
+
product,
|
|
10
|
+
productCodeLabel = "Ürün Kodu:",
|
|
11
|
+
mobileMarginTop,
|
|
12
|
+
mobileMarginBottom,
|
|
13
|
+
desktopMarginTop,
|
|
14
|
+
desktopMarginBottom,
|
|
15
|
+
}: Props) {
|
|
16
|
+
if (!product) return null;
|
|
17
|
+
|
|
18
|
+
const selectedVariant = getSelectedProductVariant(product);
|
|
19
|
+
const sku = selectedVariant?.sku;
|
|
20
|
+
|
|
21
|
+
if (!sku) return null;
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<p
|
|
25
|
+
className="kombos-pd-sku__text text-sm-medium"
|
|
26
|
+
style={{
|
|
27
|
+
"--mobile-mt": getFormattedMarginTopSize(mobileMarginTop),
|
|
28
|
+
"--mobile-mb": getFormattedMarginBottomSize(mobileMarginBottom),
|
|
29
|
+
"--desktop-mt": getFormattedMarginTopSize(desktopMarginTop),
|
|
30
|
+
"--desktop-mb": getFormattedMarginBottomSize(desktopMarginBottom),
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
{productCodeLabel} {sku}
|
|
34
|
+
</p>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default ProductDetailSku;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* ===== ProductDetailSKU ===== */
|
|
2
|
+
|
|
3
|
+
.kombos-pd-sku__text {
|
|
4
|
+
margin: 0;
|
|
5
|
+
color: var(--kombos-gray-600);
|
|
6
|
+
margin-top: var(--mobile-mt);
|
|
7
|
+
margin-bottom: var(--mobile-mb);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* ===== Desktop (>=1024px) ===== */
|
|
11
|
+
@media (min-width: 1024px) {
|
|
12
|
+
.kombos-pd-sku__text {
|
|
13
|
+
margin-top: var(--desktop-mt, var(--mobile-mt));
|
|
14
|
+
margin-bottom: var(--desktop-mb, var(--mobile-mb));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
productCodeLabel?: string;
|
|
7
|
+
mobileMarginTop?: MarginTopStyleType;
|
|
8
|
+
mobileMarginBottom?: MarginBottomStyleType;
|
|
9
|
+
desktopMarginTop?: MarginTopStyleType;
|
|
10
|
+
desktopMarginBottom?: MarginBottomStyleType;
|
|
11
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getFormattedMarginTopSize,
|
|
3
|
+
getFormattedMarginBottomSize,
|
|
4
|
+
} from "@ikas/bp-storefront";
|
|
5
|
+
import { Props } from "./types";
|
|
6
|
+
import VariantBadge from "../../sub-components/VariantBadge";
|
|
7
|
+
|
|
8
|
+
export function ProductDetailVariant({
|
|
9
|
+
product,
|
|
10
|
+
mobileMarginTop,
|
|
11
|
+
mobileMarginBottom,
|
|
12
|
+
desktopMarginTop,
|
|
13
|
+
desktopMarginBottom,
|
|
14
|
+
useVariantImages,
|
|
15
|
+
}: Props) {
|
|
16
|
+
if (!product) return null;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div
|
|
20
|
+
className="kombos-pd-variant"
|
|
21
|
+
style={{
|
|
22
|
+
"--mobile-mt": getFormattedMarginTopSize(mobileMarginTop),
|
|
23
|
+
"--mobile-mb": getFormattedMarginBottomSize(mobileMarginBottom),
|
|
24
|
+
"--desktop-mt": getFormattedMarginTopSize(desktopMarginTop),
|
|
25
|
+
"--desktop-mb": getFormattedMarginBottomSize(desktopMarginBottom),
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<VariantBadge
|
|
29
|
+
product={product}
|
|
30
|
+
size="l"
|
|
31
|
+
showLabels
|
|
32
|
+
useVariantImages={useVariantImages}
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default ProductDetailVariant;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* ===== ProductDetailVariant ===== */
|
|
2
|
+
|
|
3
|
+
.kombos-pd-variant {
|
|
4
|
+
margin-top: var(--mobile-mt);
|
|
5
|
+
margin-bottom: var(--mobile-mb);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* ===== Desktop (>=1024px) ===== */
|
|
9
|
+
@media (min-width: 1024px) {
|
|
10
|
+
.kombos-pd-variant {
|
|
11
|
+
margin-top: var(--desktop-mt, var(--mobile-mt));
|
|
12
|
+
margin-bottom: var(--desktop-mb, var(--mobile-mb));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
mobileMarginTop?: MarginTopStyleType;
|
|
7
|
+
mobileMarginBottom?: MarginBottomStyleType;
|
|
8
|
+
desktopMarginTop?: MarginTopStyleType;
|
|
9
|
+
desktopMarginBottom?: MarginBottomStyleType;
|
|
10
|
+
/** Renk varyantı için ürün görsellerini kullan. */
|
|
11
|
+
useVariantImages?: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useRef,
|
|
3
|
+
useState,
|
|
4
|
+
useEffect,
|
|
5
|
+
useMemo,
|
|
6
|
+
useCallback,
|
|
7
|
+
} from "preact/hooks";
|
|
8
|
+
import {
|
|
9
|
+
getProductOptionSet,
|
|
10
|
+
IkasComponentRenderer,
|
|
11
|
+
} from "@ikas/bp-storefront";
|
|
12
|
+
import ProductCard from "../../sub-components/ProductCard";
|
|
13
|
+
import SliderArrow from "../../sub-components/SliderArrow";
|
|
14
|
+
import { Props } from "./types";
|
|
15
|
+
|
|
16
|
+
const COLUMNS_MAP: Record<string, number> = {
|
|
17
|
+
One: 1,
|
|
18
|
+
Two: 2,
|
|
19
|
+
Three: 3,
|
|
20
|
+
Four: 4,
|
|
21
|
+
Five: 5,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export function ProductSlider(props: Props) {
|
|
25
|
+
const {
|
|
26
|
+
productList,
|
|
27
|
+
title,
|
|
28
|
+
addToCartText = "Sepete Ekle",
|
|
29
|
+
addedToCartText = "Sepete Eklendi",
|
|
30
|
+
outOfStockText = "Tükendi",
|
|
31
|
+
goToProductText = "Ürüne Git",
|
|
32
|
+
desktopColumns,
|
|
33
|
+
aspectRatio,
|
|
34
|
+
objectFit,
|
|
35
|
+
hideAddToCartButton,
|
|
36
|
+
components,
|
|
37
|
+
} = props;
|
|
38
|
+
|
|
39
|
+
const cols = COLUMNS_MAP[desktopColumns ?? ""] ?? 4;
|
|
40
|
+
const trackRef = useRef<HTMLDivElement>(null);
|
|
41
|
+
const [canScrollLeft, setCanScrollLeft] = useState(false);
|
|
42
|
+
const [canScrollRight, setCanScrollRight] = useState(false);
|
|
43
|
+
|
|
44
|
+
const updateScrollState = useCallback(() => {
|
|
45
|
+
const track = trackRef.current;
|
|
46
|
+
if (!track) return;
|
|
47
|
+
|
|
48
|
+
setCanScrollLeft(track.scrollLeft > 1);
|
|
49
|
+
setCanScrollRight(
|
|
50
|
+
track.scrollLeft + track.clientWidth < track.scrollWidth - 1,
|
|
51
|
+
);
|
|
52
|
+
}, []);
|
|
53
|
+
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
const track = trackRef.current;
|
|
56
|
+
if (!track) return;
|
|
57
|
+
track.addEventListener("scroll", updateScrollState, { passive: true });
|
|
58
|
+
window.addEventListener("resize", updateScrollState);
|
|
59
|
+
const ro = new ResizeObserver(updateScrollState);
|
|
60
|
+
ro.observe(track);
|
|
61
|
+
return () => {
|
|
62
|
+
track.removeEventListener("scroll", updateScrollState);
|
|
63
|
+
window.removeEventListener("resize", updateScrollState);
|
|
64
|
+
ro.disconnect();
|
|
65
|
+
};
|
|
66
|
+
}, [updateScrollState]);
|
|
67
|
+
|
|
68
|
+
const products = productList?.data ?? [];
|
|
69
|
+
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
products.forEach((p) => {
|
|
72
|
+
if (!p.productOptionSet) getProductOptionSet(p);
|
|
73
|
+
});
|
|
74
|
+
}, [products.length]);
|
|
75
|
+
|
|
76
|
+
const productCardSizes = useMemo(() => {
|
|
77
|
+
const desktopGaps = (cols - 1) * 24;
|
|
78
|
+
return `(max-width: 767px) calc((100vw - 48px) / 2), (max-width: 1023px) calc((100vw - 80px) / 2), calc((100vw - ${144 + desktopGaps}px) / ${cols})`;
|
|
79
|
+
}, [cols]);
|
|
80
|
+
|
|
81
|
+
if (!productList) return null;
|
|
82
|
+
|
|
83
|
+
const scroll = (direction: "left" | "right") => {
|
|
84
|
+
const el = trackRef.current;
|
|
85
|
+
if (!el) return;
|
|
86
|
+
const amount = direction === "left" ? -el.clientWidth : el.clientWidth;
|
|
87
|
+
el.scrollBy({ left: amount, behavior: "smooth" });
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<section className="kombos-product-slider">
|
|
92
|
+
<div className="kombos-product-slider__wrapper kombos-container">
|
|
93
|
+
{title && (
|
|
94
|
+
<h2 className="kombos-product-slider__title display-xs-medium md:display-sm-medium">
|
|
95
|
+
{title}
|
|
96
|
+
</h2>
|
|
97
|
+
)}
|
|
98
|
+
|
|
99
|
+
<div className="kombos-product-slider__slider">
|
|
100
|
+
<SliderArrow
|
|
101
|
+
direction="left"
|
|
102
|
+
className="kombos-product-slider__arrow kombos-product-slider__arrow--left"
|
|
103
|
+
onClick={() => scroll("left")}
|
|
104
|
+
disabled={!canScrollLeft}
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
<div
|
|
108
|
+
className="kombos-product-slider__track"
|
|
109
|
+
ref={trackRef}
|
|
110
|
+
style={{ "--columns": cols }}
|
|
111
|
+
>
|
|
112
|
+
{products.map((product, index) => (
|
|
113
|
+
<div key={product.id} className="kombos-product-slider__card">
|
|
114
|
+
<ProductCard
|
|
115
|
+
product={product}
|
|
116
|
+
addToCartText={addToCartText}
|
|
117
|
+
addedToCartText={addedToCartText}
|
|
118
|
+
outOfStockText={outOfStockText}
|
|
119
|
+
goToProductText={goToProductText}
|
|
120
|
+
aspectRatio={aspectRatio}
|
|
121
|
+
objectFit={objectFit}
|
|
122
|
+
sizes={productCardSizes}
|
|
123
|
+
hideAddToCartButton={hideAddToCartButton}
|
|
124
|
+
priority={index < 4}
|
|
125
|
+
/>
|
|
126
|
+
<IkasComponentRenderer
|
|
127
|
+
id={`product-slider-product-${product.id}`}
|
|
128
|
+
components={components}
|
|
129
|
+
parentProps={props}
|
|
130
|
+
map={{
|
|
131
|
+
product,
|
|
132
|
+
}}
|
|
133
|
+
className="kombos-product-slider__card-content"
|
|
134
|
+
/>
|
|
135
|
+
</div>
|
|
136
|
+
))}
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<SliderArrow
|
|
140
|
+
direction="right"
|
|
141
|
+
className="kombos-product-slider__arrow kombos-product-slider__arrow--right"
|
|
142
|
+
onClick={() => scroll("right")}
|
|
143
|
+
disabled={!canScrollRight}
|
|
144
|
+
/>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</section>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export default ProductSlider;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/* ===== Product Slider Section ===== */
|
|
2
|
+
.kombos-product-slider {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
width: 100%;
|
|
5
|
+
max-width: 100%;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.kombos-product-slider__wrapper {
|
|
10
|
+
padding-top: 1rem;
|
|
11
|
+
padding-bottom: 1rem;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: 1.5rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.kombos-product-slider__title {
|
|
18
|
+
color: var(--kombos-gray-900);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Slider wrapper */
|
|
22
|
+
.kombos-product-slider__slider {
|
|
23
|
+
position: relative;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Scrollable track */
|
|
28
|
+
.kombos-product-slider__track {
|
|
29
|
+
display: flex;
|
|
30
|
+
gap: 1rem;
|
|
31
|
+
width: 100%;
|
|
32
|
+
overflow-x: auto;
|
|
33
|
+
scroll-snap-type: x mandatory;
|
|
34
|
+
-webkit-overflow-scrolling: touch;
|
|
35
|
+
scrollbar-width: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.kombos-product-slider__track::-webkit-scrollbar {
|
|
39
|
+
display: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Card sizing — mobile: 2 columns, desktop: driven by --columns */
|
|
43
|
+
.kombos-product-slider__card {
|
|
44
|
+
flex: 0 0 calc((100% - 1rem) / 2);
|
|
45
|
+
min-width: 0;
|
|
46
|
+
scroll-snap-align: start;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
gap: 0.5rem;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.kombos-product-slider__card-content {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
gap: 0.5rem;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Navigation arrows */
|
|
59
|
+
.kombos-product-slider__arrow {
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: 50%;
|
|
62
|
+
transform: translateY(-50%);
|
|
63
|
+
z-index: var(--kombos-z-dropdown);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.kombos-product-slider__arrow--left {
|
|
67
|
+
left: 0.5rem;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.kombos-product-slider__arrow--right {
|
|
71
|
+
right: 0.5rem;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* ===== Tablet (>=768px) ===== */
|
|
75
|
+
@media (min-width: 768px) {
|
|
76
|
+
.kombos-product-slider__wrapper {
|
|
77
|
+
padding-top: 1.5rem;
|
|
78
|
+
padding-bottom: 1.5rem;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* ===== Desktop (>=1024px) ===== */
|
|
83
|
+
@media (min-width: 1024px) {
|
|
84
|
+
.kombos-product-slider__wrapper {
|
|
85
|
+
padding-top: 2rem;
|
|
86
|
+
padding-bottom: 2rem;
|
|
87
|
+
gap: 2rem;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.kombos-product-slider__track {
|
|
91
|
+
gap: 1.5rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.kombos-product-slider__card {
|
|
95
|
+
flex: 0 0 calc((100% - (var(--columns) - 1) * 1.5rem) / var(--columns));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.kombos-product-slider__arrow--left {
|
|
99
|
+
left: 1rem;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.kombos-product-slider__arrow--right {
|
|
103
|
+
right: 1rem;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file is auto-generated — do not edit manually.
|
|
2
|
+
import type { IkasProductList } from "@ikas/bp-storefront";
|
|
3
|
+
import type { AspectRatio, NumberOfColumns, ObjectFit } from "../../global-types";
|
|
4
|
+
|
|
5
|
+
export interface Props {
|
|
6
|
+
productList: IkasProductList;
|
|
7
|
+
title?: string;
|
|
8
|
+
addToCartText?: string;
|
|
9
|
+
addedToCartText?: string;
|
|
10
|
+
outOfStockText?: string;
|
|
11
|
+
goToProductText?: string;
|
|
12
|
+
desktopColumns?: NumberOfColumns;
|
|
13
|
+
aspectRatio?: AspectRatio;
|
|
14
|
+
objectFit?: ObjectFit;
|
|
15
|
+
hideAddToCartButton?: boolean;
|
|
16
|
+
components?: any;
|
|
17
|
+
}
|