@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,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getSelectedProductVariant,
|
|
3
|
+
getProductVariantFormattedFinalPrice,
|
|
4
|
+
getProductVariantFormattedSellPrice,
|
|
5
|
+
hasProductVariantDiscount,
|
|
6
|
+
} from "@ikas/bp-storefront";
|
|
7
|
+
import { Props } from "./types";
|
|
8
|
+
|
|
9
|
+
export function CardProductPrice({ product }: Props) {
|
|
10
|
+
if (!product) return null;
|
|
11
|
+
|
|
12
|
+
const selectedVariant = getSelectedProductVariant(product);
|
|
13
|
+
|
|
14
|
+
const hasDiscount = hasProductVariantDiscount(selectedVariant);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className="kombos-card-product-price">
|
|
18
|
+
<span className="kombos-card-product-price__current text-sm-medium sm:text-md-medium md:text-xl-medium">
|
|
19
|
+
{getProductVariantFormattedFinalPrice(selectedVariant)}
|
|
20
|
+
</span>
|
|
21
|
+
{hasDiscount && (
|
|
22
|
+
<span className="kombos-card-product-price__old text-xs-regular-strike sm:text-sm-regular-strike md:text-md-regular-strike">
|
|
23
|
+
{getProductVariantFormattedSellPrice(selectedVariant)}
|
|
24
|
+
</span>
|
|
25
|
+
)}
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default CardProductPrice;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Props } from "./types";
|
|
2
|
+
import VariantBadge from "../../sub-components/VariantBadge";
|
|
3
|
+
|
|
4
|
+
export function CardProductVariants({ product }: Props) {
|
|
5
|
+
if (!product) return null;
|
|
6
|
+
|
|
7
|
+
return <VariantBadge product={product} size="s" scrollable disableRoute />;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default CardProductVariants;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* CardProductVariants — styles handled by VariantBadge sub-component */
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { useState, useEffect } from "preact/hooks";
|
|
2
|
+
import {
|
|
3
|
+
customerStore,
|
|
4
|
+
getCouponCodeForm,
|
|
5
|
+
initCouponCodeForm,
|
|
6
|
+
setCouponCodeFormCouponCode,
|
|
7
|
+
submitCouponCodeForm,
|
|
8
|
+
removeCouponCodeForm,
|
|
9
|
+
} from "@ikas/bp-storefront";
|
|
10
|
+
import { observer } from "@ikas/component-utils";
|
|
11
|
+
import Button from "../../../../sub-components/Button";
|
|
12
|
+
import Input from "../../../../sub-components/Input";
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
appliedCoupon?: string | null;
|
|
16
|
+
toggleText: string;
|
|
17
|
+
placeholder: string;
|
|
18
|
+
applyText: string;
|
|
19
|
+
removeText: string;
|
|
20
|
+
applyingText: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const CouponCode = observer(function CouponCode({
|
|
24
|
+
appliedCoupon,
|
|
25
|
+
toggleText,
|
|
26
|
+
placeholder,
|
|
27
|
+
applyText,
|
|
28
|
+
removeText,
|
|
29
|
+
applyingText,
|
|
30
|
+
}: Props) {
|
|
31
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
32
|
+
const couponForm = getCouponCodeForm(customerStore);
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
initCouponCodeForm(couponForm);
|
|
36
|
+
}, [couponForm]);
|
|
37
|
+
|
|
38
|
+
const handleSubmit = async (e: Event) => {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
await submitCouponCodeForm(couponForm);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const handleRemove = async () => {
|
|
44
|
+
await removeCouponCodeForm(couponForm);
|
|
45
|
+
setIsOpen(false);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
if (appliedCoupon) {
|
|
49
|
+
return (
|
|
50
|
+
<div className="coupon-code">
|
|
51
|
+
<div className="coupon-code__applied">
|
|
52
|
+
<span className="coupon-code__value text-sm-medium">
|
|
53
|
+
{appliedCoupon}
|
|
54
|
+
</span>
|
|
55
|
+
<button
|
|
56
|
+
type="button"
|
|
57
|
+
className="coupon-code__remove text-sm-medium"
|
|
58
|
+
onClick={handleRemove}
|
|
59
|
+
>
|
|
60
|
+
{removeText}
|
|
61
|
+
</button>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<div className="coupon-code">
|
|
69
|
+
{!isOpen ? (
|
|
70
|
+
<button
|
|
71
|
+
type="button"
|
|
72
|
+
className="coupon-code__toggle text-sm-semibold"
|
|
73
|
+
onClick={() => setIsOpen(true)}
|
|
74
|
+
>
|
|
75
|
+
{toggleText}
|
|
76
|
+
</button>
|
|
77
|
+
) : (
|
|
78
|
+
<form className="coupon-code__form" onSubmit={handleSubmit}>
|
|
79
|
+
<Input
|
|
80
|
+
placeholder={couponForm.couponCode?.placeholder ?? placeholder}
|
|
81
|
+
value={couponForm.couponCode?.value ?? ""}
|
|
82
|
+
onInput={(e: Event) =>
|
|
83
|
+
setCouponCodeFormCouponCode(
|
|
84
|
+
couponForm,
|
|
85
|
+
(e.target as HTMLInputElement).value,
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
status={couponForm.isFailure ? "error" : undefined}
|
|
89
|
+
/>
|
|
90
|
+
<Button
|
|
91
|
+
variant="secondary"
|
|
92
|
+
size="xs"
|
|
93
|
+
disabled={couponForm.isSubmitting}
|
|
94
|
+
>
|
|
95
|
+
{couponForm.isSubmitting ? applyingText : applyText}
|
|
96
|
+
</Button>
|
|
97
|
+
</form>
|
|
98
|
+
)}
|
|
99
|
+
{couponForm.isFailure && couponForm.responseMessage && (
|
|
100
|
+
<p className="coupon-code__error text-xs-regular">
|
|
101
|
+
{couponForm.responseMessage}
|
|
102
|
+
</p>
|
|
103
|
+
)}
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
export default CouponCode;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* CouponCode */
|
|
2
|
+
.coupon-code {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: 0.5rem;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.coupon-code__toggle {
|
|
9
|
+
background: none;
|
|
10
|
+
border: none;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
padding: 0;
|
|
13
|
+
color: var(--kombos-gray-900);
|
|
14
|
+
text-decoration: underline;
|
|
15
|
+
text-align: left;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.coupon-code__toggle:hover {
|
|
19
|
+
color: var(--kombos-gray-700);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.coupon-code__form {
|
|
23
|
+
display: flex;
|
|
24
|
+
gap: 0.5rem;
|
|
25
|
+
align-items: stretch;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.coupon-code__form > :first-child {
|
|
29
|
+
flex: 1;
|
|
30
|
+
min-width: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.coupon-code__form > :last-child {
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
white-space: nowrap;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.coupon-code__applied {
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
padding: 0.625rem 0.875rem;
|
|
43
|
+
background-color: var(--kombos-gray-50);
|
|
44
|
+
border-radius: 6px;
|
|
45
|
+
min-height: 2.75rem;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.coupon-code__value {
|
|
49
|
+
color: var(--kombos-gray-900);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.coupon-code__remove {
|
|
53
|
+
background: none;
|
|
54
|
+
border: none;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
padding: 0;
|
|
57
|
+
color: var(--kombos-gray-500);
|
|
58
|
+
text-decoration: underline;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.coupon-code__remove:hover {
|
|
62
|
+
color: var(--kombos-gray-700);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.coupon-code__error {
|
|
66
|
+
color: var(--kombos-error);
|
|
67
|
+
margin: 0;
|
|
68
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Router } from "@ikas/bp-storefront";
|
|
2
|
+
import { Handbag1SVG } from "../../../../sub-components/icons";
|
|
3
|
+
import Button from "../../../../sub-components/Button";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
emptyCartText: string;
|
|
7
|
+
continueShoppingText: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default function EmptyState({
|
|
11
|
+
emptyCartText,
|
|
12
|
+
continueShoppingText,
|
|
13
|
+
}: Props) {
|
|
14
|
+
const handleContinueShopping = () => {
|
|
15
|
+
Router.navigate("/");
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className="cart-page__empty">
|
|
20
|
+
<span className="cart-page__empty-icon">
|
|
21
|
+
<Handbag1SVG />
|
|
22
|
+
</span>
|
|
23
|
+
<p className="cart-page__empty-text text-xl-semibold md:display-xs-semibold">
|
|
24
|
+
{emptyCartText}
|
|
25
|
+
</p>
|
|
26
|
+
<Button variant="primary" size="s" onClick={handleContinueShopping}>
|
|
27
|
+
{continueShoppingText}
|
|
28
|
+
</Button>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* EmptyState */
|
|
2
|
+
.cart-page__empty {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: 1.5rem;
|
|
7
|
+
padding: 5rem 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.cart-page__empty-icon {
|
|
11
|
+
font-size: 3rem;
|
|
12
|
+
color: var(--kombos-gray-300);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.cart-page__empty-text {
|
|
16
|
+
color: var(--kombos-gray-700);
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cartStore,
|
|
3
|
+
IkasCart,
|
|
4
|
+
getIkasOrderFormattedTotalFinalPrice,
|
|
5
|
+
getIkasOrderFormattedTotalPrice,
|
|
6
|
+
getOrderAdjustmentDisplayName,
|
|
7
|
+
getOrderAdjustmentFormattedAmount,
|
|
8
|
+
getOrderAdjustmentIsDecrement,
|
|
9
|
+
getCheckoutUrlFromCartStore,
|
|
10
|
+
} from "@ikas/bp-storefront";
|
|
11
|
+
import { observer } from "@ikas/component-utils";
|
|
12
|
+
import Button from "../../../../sub-components/Button";
|
|
13
|
+
import CouponCode from "../CouponCode";
|
|
14
|
+
import { cx } from "../../../../utils/cx";
|
|
15
|
+
|
|
16
|
+
interface Props {
|
|
17
|
+
cart: IkasCart;
|
|
18
|
+
title: string;
|
|
19
|
+
subtotalLabel: string;
|
|
20
|
+
totalLabel: string;
|
|
21
|
+
checkoutButtonText: string;
|
|
22
|
+
couponToggleText: string;
|
|
23
|
+
couponPlaceholder: string;
|
|
24
|
+
couponApplyText: string;
|
|
25
|
+
couponRemoveText: string;
|
|
26
|
+
couponApplyingText: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const OrderSummary = observer(function OrderSummary({
|
|
30
|
+
cart,
|
|
31
|
+
title,
|
|
32
|
+
subtotalLabel,
|
|
33
|
+
totalLabel,
|
|
34
|
+
checkoutButtonText,
|
|
35
|
+
couponToggleText,
|
|
36
|
+
couponPlaceholder,
|
|
37
|
+
couponApplyText,
|
|
38
|
+
couponRemoveText,
|
|
39
|
+
couponApplyingText,
|
|
40
|
+
}: Props) {
|
|
41
|
+
const adjustments = cart.orderAdjustments ?? [];
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div className="order-summary">
|
|
45
|
+
<h2 className="order-summary__title text-md-semibold md:text-lg-semibold">{title}</h2>
|
|
46
|
+
|
|
47
|
+
<div className="order-summary__rows">
|
|
48
|
+
<div className="order-summary__row">
|
|
49
|
+
<span className="text-md-regular">{subtotalLabel}</span>
|
|
50
|
+
<span className="text-md-semibold">
|
|
51
|
+
{getIkasOrderFormattedTotalPrice(cart)}
|
|
52
|
+
</span>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
{adjustments.map((adj, i) => {
|
|
56
|
+
const isDecrement = !!getOrderAdjustmentIsDecrement(adj);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div key={i} className="order-summary__row">
|
|
60
|
+
<span className="text-sm-regular">
|
|
61
|
+
{getOrderAdjustmentDisplayName(adj)}
|
|
62
|
+
</span>
|
|
63
|
+
<span
|
|
64
|
+
className={cx(
|
|
65
|
+
"order-summary__adjustment-amount text-sm-semibold",
|
|
66
|
+
isDecrement && "order-summary__adjustment-amount--discount",
|
|
67
|
+
)}
|
|
68
|
+
>
|
|
69
|
+
{getOrderAdjustmentFormattedAmount(adj)}
|
|
70
|
+
</span>
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
})}
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div className="order-summary__divider" />
|
|
77
|
+
|
|
78
|
+
<div className="order-summary__row order-summary__total">
|
|
79
|
+
<span className="text-md-semibold md:text-lg-semibold">{totalLabel}</span>
|
|
80
|
+
<span className="text-md-semibold md:text-lg-semibold">
|
|
81
|
+
{getIkasOrderFormattedTotalFinalPrice(cart)}
|
|
82
|
+
</span>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<CouponCode
|
|
86
|
+
appliedCoupon={cart.couponCode}
|
|
87
|
+
toggleText={couponToggleText}
|
|
88
|
+
placeholder={couponPlaceholder}
|
|
89
|
+
applyText={couponApplyText}
|
|
90
|
+
removeText={couponRemoveText}
|
|
91
|
+
applyingText={couponApplyingText}
|
|
92
|
+
/>
|
|
93
|
+
|
|
94
|
+
<a
|
|
95
|
+
className="order-summary__checkout-link"
|
|
96
|
+
href={getCheckoutUrlFromCartStore(cartStore)}
|
|
97
|
+
>
|
|
98
|
+
<Button variant="primary" className="order-summary__checkout-btn">
|
|
99
|
+
{checkoutButtonText}
|
|
100
|
+
</Button>
|
|
101
|
+
</a>
|
|
102
|
+
</div>
|
|
103
|
+
);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export default OrderSummary;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* OrderSummary */
|
|
2
|
+
.order-summary {
|
|
3
|
+
border: 1px solid var(--kombos-gray-200);
|
|
4
|
+
border-radius: 6px;
|
|
5
|
+
padding: 1.25rem;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 1rem;
|
|
9
|
+
background-color: var(--kombos-white);
|
|
10
|
+
min-width: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@media (min-width: 768px) {
|
|
14
|
+
.order-summary {
|
|
15
|
+
padding: 1.5rem;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media (min-width: 1024px) {
|
|
20
|
+
.order-summary {
|
|
21
|
+
position: sticky;
|
|
22
|
+
top: 7rem;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.order-summary__title {
|
|
27
|
+
margin: 0;
|
|
28
|
+
color: var(--kombos-gray-900);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.order-summary__rows {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
gap: 0.5rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.order-summary__row {
|
|
38
|
+
display: flex;
|
|
39
|
+
justify-content: space-between;
|
|
40
|
+
align-items: center;
|
|
41
|
+
color: var(--kombos-gray-700);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.order-summary__adjustment-amount {
|
|
45
|
+
color: var(--kombos-gray-500);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.order-summary__adjustment-amount--discount {
|
|
49
|
+
color: var(--kombos-error);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.order-summary__divider {
|
|
53
|
+
height: 1px;
|
|
54
|
+
background-color: var(--kombos-gray-200);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.order-summary__total {
|
|
58
|
+
color: var(--kombos-gray-900);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Checkout */
|
|
62
|
+
.order-summary__checkout-link {
|
|
63
|
+
display: block;
|
|
64
|
+
text-decoration: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.order-summary__checkout-btn {
|
|
68
|
+
display: flex;
|
|
69
|
+
width: 100%;
|
|
70
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cartStore,
|
|
3
|
+
hasCart,
|
|
4
|
+
removeItem,
|
|
5
|
+
getIkasOrderTotalItemCount,
|
|
6
|
+
IkasOrderLineItem,
|
|
7
|
+
} from "@ikas/bp-storefront";
|
|
8
|
+
import { Props } from "./types";
|
|
9
|
+
import PageLoader from "../../sub-components/PageLoader";
|
|
10
|
+
import CartItem from "../../sub-components/CartItem";
|
|
11
|
+
import OrderSummary from "./components/OrderSummary";
|
|
12
|
+
import EmptyState from "./components/EmptyState";
|
|
13
|
+
|
|
14
|
+
export function CartPage({
|
|
15
|
+
title = "Sepet",
|
|
16
|
+
emptyCartText = "Sepetinizde Ürün Bulunmamaktadır",
|
|
17
|
+
subtotalLabel = "Ara Toplam",
|
|
18
|
+
totalLabel = "Toplam",
|
|
19
|
+
checkoutButtonText = "Siparişi Tamamla",
|
|
20
|
+
itemsText = "ürün",
|
|
21
|
+
couponToggleText = "Hediye Kodunu Kullan!",
|
|
22
|
+
couponPlaceholder = "Kupon kodu girin",
|
|
23
|
+
couponApplyText = "Uygula",
|
|
24
|
+
couponRemoveText = "Kaldır",
|
|
25
|
+
couponApplyingText = "Uygulanıyor...",
|
|
26
|
+
orderSummaryTitle = "Sipariş Özeti",
|
|
27
|
+
continueShoppingText = "Alışverişe Başla",
|
|
28
|
+
}: Props) {
|
|
29
|
+
const cart = cartStore.cart;
|
|
30
|
+
const isLoading = cartStore.isCartLoading;
|
|
31
|
+
const cartHasItems = hasCart(cartStore);
|
|
32
|
+
const lineItems = (cart?.orderLineItems ?? []).filter(
|
|
33
|
+
(item) => !item?.deleted,
|
|
34
|
+
);
|
|
35
|
+
const totalItemCount = cart ? getIkasOrderTotalItemCount(cart) : 0;
|
|
36
|
+
|
|
37
|
+
const handleRemove = async (item: IkasOrderLineItem) => {
|
|
38
|
+
await removeItem(item);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
if (isLoading) {
|
|
42
|
+
return <PageLoader />;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (!cartHasItems) {
|
|
46
|
+
return (
|
|
47
|
+
<section className="cart-page">
|
|
48
|
+
<div className="kombos-container cart-page__container">
|
|
49
|
+
<header className="cart-page__header">
|
|
50
|
+
<h1 className="cart-page__title text-xl-semibold md:display-xs-semibold">{title}</h1>
|
|
51
|
+
</header>
|
|
52
|
+
<EmptyState
|
|
53
|
+
emptyCartText={emptyCartText}
|
|
54
|
+
continueShoppingText={continueShoppingText}
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
</section>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<section className="cart-page">
|
|
63
|
+
<div className="kombos-container cart-page__container">
|
|
64
|
+
<header className="cart-page__header">
|
|
65
|
+
<h1 className="cart-page__title text-xl-semibold md:display-xs-semibold">
|
|
66
|
+
{title}{" "}
|
|
67
|
+
<span className="cart-page__count text-lg-regular">
|
|
68
|
+
({totalItemCount} {itemsText})
|
|
69
|
+
</span>
|
|
70
|
+
</h1>
|
|
71
|
+
</header>
|
|
72
|
+
|
|
73
|
+
<div className="cart-page__layout">
|
|
74
|
+
<div className="cart-page__items-col">
|
|
75
|
+
<div className="cart-page__items">
|
|
76
|
+
{lineItems.map((item) => (
|
|
77
|
+
<CartItem
|
|
78
|
+
key={item.id}
|
|
79
|
+
item={item}
|
|
80
|
+
onRemove={handleRemove}
|
|
81
|
+
variant="page"
|
|
82
|
+
/>
|
|
83
|
+
))}
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
{cart && (
|
|
88
|
+
<OrderSummary
|
|
89
|
+
cart={cart}
|
|
90
|
+
title={orderSummaryTitle}
|
|
91
|
+
subtotalLabel={subtotalLabel}
|
|
92
|
+
totalLabel={totalLabel}
|
|
93
|
+
checkoutButtonText={checkoutButtonText}
|
|
94
|
+
couponToggleText={couponToggleText}
|
|
95
|
+
couponPlaceholder={couponPlaceholder}
|
|
96
|
+
couponApplyText={couponApplyText}
|
|
97
|
+
couponRemoveText={couponRemoveText}
|
|
98
|
+
couponApplyingText={couponApplyingText}
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</section>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export default CartPage;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* CartPage */
|
|
2
|
+
.cart-page {
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.cart-page__container {
|
|
7
|
+
padding-top: 1rem;
|
|
8
|
+
padding-bottom: 1rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* Header */
|
|
12
|
+
.cart-page__header {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: 0.75rem;
|
|
16
|
+
margin-bottom: 1rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Title */
|
|
20
|
+
.cart-page__title {
|
|
21
|
+
margin: 0;
|
|
22
|
+
color: var(--kombos-gray-900);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.cart-page__count {
|
|
26
|
+
color: var(--kombos-gray-500);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Two-column Layout */
|
|
30
|
+
.cart-page__layout {
|
|
31
|
+
display: grid;
|
|
32
|
+
grid-template-columns: minmax(0, 1fr);
|
|
33
|
+
gap: 2rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media (min-width: 1024px) {
|
|
37
|
+
.cart-page__layout {
|
|
38
|
+
grid-template-columns: minmax(0, 1fr) 22.5rem;
|
|
39
|
+
gap: 2.5rem;
|
|
40
|
+
align-items: start;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Cart Items Column */
|
|
45
|
+
.cart-page__items-col {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.cart-page__items {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// This file is auto-generated — do not edit manually.
|
|
2
|
+
export interface Props {
|
|
3
|
+
title?: string;
|
|
4
|
+
emptyCartText?: string;
|
|
5
|
+
subtotalLabel?: string;
|
|
6
|
+
totalLabel?: string;
|
|
7
|
+
checkoutButtonText?: string;
|
|
8
|
+
itemsText?: string;
|
|
9
|
+
couponPlaceholder?: string;
|
|
10
|
+
couponApplyText?: string;
|
|
11
|
+
couponRemoveText?: string;
|
|
12
|
+
couponApplyingText?: string;
|
|
13
|
+
orderSummaryTitle?: string;
|
|
14
|
+
couponToggleText?: string;
|
|
15
|
+
continueShoppingText?: string;
|
|
16
|
+
}
|