@ikas/component-cli 0.133.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/create.d.ts +8 -3
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +8 -227
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +120 -31
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/proxy.d.ts.map +1 -1
- package/dist/commands/proxy.js +5 -1
- package/dist/commands/proxy.js.map +1 -1
- package/package.json +4 -5
- package/bin/create-ikas-component.js +0 -8
- package/templates/create/README.md +0 -50
- package/templates/create/claude-md +0 -275
- package/templates/create/cursorrules +0 -123
- package/templates/create/gitignore +0 -6
- package/templates/create/ikas.config.json +0 -95
- package/templates/create/mcp.json +0 -10
- package/templates/create/package.json +0 -22
- package/templates/create/src/components/ExampleComponent/index.tsx +0 -22
- package/templates/create/src/components/ExampleComponent/styles.css +0 -36
- package/templates/create/src/components/ExampleComponent/types.ts +0 -7
- package/templates/create/src/components/ExampleSection/index.tsx +0 -14
- package/templates/create/src/components/ExampleSection/styles.css +0 -29
- package/templates/create/src/components/ExampleSection/types.ts +0 -6
- package/templates/create/src/components/index.ts +0 -2
- package/templates/create/src/global-types.ts +0 -5
- package/templates/create/src/global.css +0 -29
- package/templates/create/src/ikas-component-utils.d.ts +0 -3
- package/templates/create/tsconfig.json +0 -30
- package/templates/create/vite.config.ts +0 -15
- package/templates/create-full/README.md +0 -78
- package/templates/create-full/claude-md +0 -752
- package/templates/create-full/cursorrules +0 -117
- package/templates/create-full/gitignore +0 -4
- package/templates/create-full/ikas.config.json +0 -5009
- package/templates/create-full/mcp.json +0 -10
- package/templates/create-full/package.json +0 -23
- package/templates/create-full/src/components/AccountAddresses/components/AddressCard/index.tsx +0 -55
- package/templates/create-full/src/components/AccountAddresses/components/AddressCard/styles.css +0 -46
- package/templates/create-full/src/components/AccountAddresses/components/AddressModal/index.tsx +0 -298
- package/templates/create-full/src/components/AccountAddresses/components/AddressModal/styles.css +0 -23
- package/templates/create-full/src/components/AccountAddresses/index.tsx +0 -127
- package/templates/create-full/src/components/AccountAddresses/styles.css +0 -41
- package/templates/create-full/src/components/AccountAddresses/types.ts +0 -15
- package/templates/create-full/src/components/AccountFavorites/index.tsx +0 -82
- package/templates/create-full/src/components/AccountFavorites/styles.css +0 -52
- package/templates/create-full/src/components/AccountFavorites/types.ts +0 -7
- package/templates/create-full/src/components/AccountInfo/components/AccountSidebar/index.tsx +0 -171
- package/templates/create-full/src/components/AccountInfo/components/AccountSidebar/styles.css +0 -144
- package/templates/create-full/src/components/AccountInfo/index.tsx +0 -91
- package/templates/create-full/src/components/AccountInfo/styles.css +0 -35
- package/templates/create-full/src/components/AccountInfo/types.ts +0 -9
- package/templates/create-full/src/components/AccountInfoContent/index.tsx +0 -134
- package/templates/create-full/src/components/AccountInfoContent/styles.css +0 -57
- package/templates/create-full/src/components/AccountInfoContent/types.ts +0 -8
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderHeader/index.tsx +0 -78
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderHeader/styles.css +0 -46
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderItemRow/index.tsx +0 -20
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderItemRow/styles.css +0 -16
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderLineItemDisplay/index.tsx +0 -112
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderLineItemDisplay/styles.css +0 -86
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderSidebar/index.tsx +0 -195
- package/templates/create-full/src/components/AccountOrderDetail/components/OrderSidebar/styles.css +0 -93
- package/templates/create-full/src/components/AccountOrderDetail/components/PackageGroup/index.tsx +0 -156
- package/templates/create-full/src/components/AccountOrderDetail/components/PackageGroup/styles.css +0 -100
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnItemRow/index.tsx +0 -56
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnItemRow/styles.css +0 -57
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnView/index.tsx +0 -159
- package/templates/create-full/src/components/AccountOrderDetail/components/ReturnView/styles.css +0 -29
- package/templates/create-full/src/components/AccountOrderDetail/index.tsx +0 -244
- package/templates/create-full/src/components/AccountOrderDetail/styles.css +0 -125
- package/templates/create-full/src/components/AccountOrderDetail/types.ts +0 -32
- package/templates/create-full/src/components/AccountOrders/components/OrderCard/index.tsx +0 -122
- package/templates/create-full/src/components/AccountOrders/components/OrderCard/styles.css +0 -114
- package/templates/create-full/src/components/AccountOrders/index.tsx +0 -105
- package/templates/create-full/src/components/AccountOrders/styles.css +0 -36
- package/templates/create-full/src/components/AccountOrders/types.ts +0 -11
- package/templates/create-full/src/components/Announcement/index.tsx +0 -11
- package/templates/create-full/src/components/Announcement/styles.css +0 -4
- package/templates/create-full/src/components/Announcement/types.ts +0 -4
- package/templates/create-full/src/components/Announcements/index.tsx +0 -91
- package/templates/create-full/src/components/Announcements/styles.css +0 -46
- package/templates/create-full/src/components/Announcements/types.ts +0 -8
- package/templates/create-full/src/components/BlogHome/components/BlogCard/index.tsx +0 -89
- package/templates/create-full/src/components/BlogHome/components/BlogCard/styles.css +0 -121
- package/templates/create-full/src/components/BlogHome/index.tsx +0 -124
- package/templates/create-full/src/components/BlogHome/styles.css +0 -118
- package/templates/create-full/src/components/BlogHome/types.ts +0 -15
- package/templates/create-full/src/components/BlogPost/index.tsx +0 -128
- package/templates/create-full/src/components/BlogPost/styles.css +0 -120
- package/templates/create-full/src/components/BlogPost/types.ts +0 -12
- package/templates/create-full/src/components/CardProductName/index.tsx +0 -25
- package/templates/create-full/src/components/CardProductName/styles.css +0 -22
- package/templates/create-full/src/components/CardProductName/types.ts +0 -7
- package/templates/create-full/src/components/CardProductPrice/index.tsx +0 -30
- package/templates/create-full/src/components/CardProductPrice/styles.css +0 -13
- package/templates/create-full/src/components/CardProductPrice/types.ts +0 -6
- package/templates/create-full/src/components/CardProductVariants/index.tsx +0 -10
- package/templates/create-full/src/components/CardProductVariants/styles.css +0 -1
- package/templates/create-full/src/components/CardProductVariants/types.ts +0 -6
- package/templates/create-full/src/components/CartPage/components/CouponCode/index.tsx +0 -108
- package/templates/create-full/src/components/CartPage/components/CouponCode/styles.css +0 -68
- package/templates/create-full/src/components/CartPage/components/EmptyState/index.tsx +0 -31
- package/templates/create-full/src/components/CartPage/components/EmptyState/styles.css +0 -18
- package/templates/create-full/src/components/CartPage/components/OrderSummary/index.tsx +0 -106
- package/templates/create-full/src/components/CartPage/components/OrderSummary/styles.css +0 -70
- package/templates/create-full/src/components/CartPage/index.tsx +0 -107
- package/templates/create-full/src/components/CartPage/styles.css +0 -54
- package/templates/create-full/src/components/CartPage/types.ts +0 -16
- package/templates/create-full/src/components/CategoryImageItem/components/Card/index.tsx +0 -64
- package/templates/create-full/src/components/CategoryImageItem/components/Card/styles.css +0 -56
- package/templates/create-full/src/components/CategoryImageItem/index.tsx +0 -64
- package/templates/create-full/src/components/CategoryImageItem/styles.css +0 -10
- package/templates/create-full/src/components/CategoryImageItem/types.ts +0 -16
- package/templates/create-full/src/components/CategoryImages/index.tsx +0 -62
- package/templates/create-full/src/components/CategoryImages/styles.css +0 -38
- package/templates/create-full/src/components/CategoryImages/types.ts +0 -11
- package/templates/create-full/src/components/CategoryList/components/CategoryListControls/index.tsx +0 -129
- package/templates/create-full/src/components/CategoryList/components/CategoryListControls/styles.css +0 -99
- package/templates/create-full/src/components/CategoryList/components/FilterBoxValues/index.tsx +0 -42
- package/templates/create-full/src/components/CategoryList/components/FilterBoxValues/styles.css +0 -27
- package/templates/create-full/src/components/CategoryList/components/FilterCategoryList/index.tsx +0 -43
- package/templates/create-full/src/components/CategoryList/components/FilterCategoryList/styles.css +0 -20
- package/templates/create-full/src/components/CategoryList/components/FilterGroupValues/index.tsx +0 -114
- package/templates/create-full/src/components/CategoryList/components/FilterGroupValues/styles.css +0 -1
- package/templates/create-full/src/components/CategoryList/components/FilterListValues/index.tsx +0 -54
- package/templates/create-full/src/components/CategoryList/components/FilterListValues/styles.css +0 -22
- package/templates/create-full/src/components/CategoryList/components/FilterRangeListValues/index.tsx +0 -50
- package/templates/create-full/src/components/CategoryList/components/FilterRangeListValues/styles.css +0 -25
- package/templates/create-full/src/components/CategoryList/components/FilterRangeValues/index.tsx +0 -189
- package/templates/create-full/src/components/CategoryList/components/FilterRangeValues/styles.css +0 -89
- package/templates/create-full/src/components/CategoryList/components/FilterSidebar/index.tsx +0 -92
- package/templates/create-full/src/components/CategoryList/components/FilterSidebar/styles.css +0 -27
- package/templates/create-full/src/components/CategoryList/components/FilterSwatchValues/index.tsx +0 -63
- package/templates/create-full/src/components/CategoryList/components/FilterSwatchValues/styles.css +0 -48
- package/templates/create-full/src/components/CategoryList/components/MobileFilterModal/index.tsx +0 -146
- package/templates/create-full/src/components/CategoryList/components/MobileFilterModal/styles.css +0 -133
- package/templates/create-full/src/components/CategoryList/index.tsx +0 -333
- package/templates/create-full/src/components/CategoryList/styles.css +0 -110
- package/templates/create-full/src/components/CategoryList/types.ts +0 -30
- package/templates/create-full/src/components/CollapsibleContent/index.tsx +0 -23
- package/templates/create-full/src/components/CollapsibleContent/styles.css +0 -11
- package/templates/create-full/src/components/CollapsibleContent/types.ts +0 -6
- package/templates/create-full/src/components/CookieBar/index.tsx +0 -78
- package/templates/create-full/src/components/CookieBar/styles.css +0 -111
- package/templates/create-full/src/components/CookieBar/types.ts +0 -10
- package/templates/create-full/src/components/CustomerEmailVerification/index.tsx +0 -168
- package/templates/create-full/src/components/CustomerEmailVerification/styles.css +0 -118
- package/templates/create-full/src/components/CustomerEmailVerification/types.ts +0 -17
- package/templates/create-full/src/components/FeatureItem/index.tsx +0 -27
- package/templates/create-full/src/components/FeatureItem/styles.css +0 -19
- package/templates/create-full/src/components/FeatureItem/types.ts +0 -7
- package/templates/create-full/src/components/Features/index.tsx +0 -25
- package/templates/create-full/src/components/Features/styles.css +0 -39
- package/templates/create-full/src/components/Features/types.ts +0 -5
- package/templates/create-full/src/components/Footer/index.tsx +0 -154
- package/templates/create-full/src/components/Footer/styles.css +0 -175
- package/templates/create-full/src/components/Footer/types.ts +0 -15
- package/templates/create-full/src/components/ForgotPassword/components/ForgotPasswordForm/index.tsx +0 -129
- package/templates/create-full/src/components/ForgotPassword/components/ForgotPasswordForm/styles.css +0 -0
- package/templates/create-full/src/components/ForgotPassword/index.tsx +0 -30
- package/templates/create-full/src/components/ForgotPassword/styles.css +0 -85
- package/templates/create-full/src/components/ForgotPassword/types.ts +0 -13
- package/templates/create-full/src/components/Header/index.tsx +0 -46
- package/templates/create-full/src/components/Header/styles.css +0 -4
- package/templates/create-full/src/components/Header/types.ts +0 -4
- package/templates/create-full/src/components/HeroSlider/index.tsx +0 -110
- package/templates/create-full/src/components/HeroSlider/styles.css +0 -129
- package/templates/create-full/src/components/HeroSlider/types.ts +0 -9
- package/templates/create-full/src/components/HeroSliderItem/index.tsx +0 -231
- package/templates/create-full/src/components/HeroSliderItem/styles.css +0 -152
- package/templates/create-full/src/components/HeroSliderItem/types.ts +0 -34
- package/templates/create-full/src/components/Login/components/LoginForm/index.tsx +0 -181
- package/templates/create-full/src/components/Login/components/LoginForm/styles.css +0 -0
- package/templates/create-full/src/components/Login/index.tsx +0 -37
- package/templates/create-full/src/components/Login/styles.css +0 -129
- package/templates/create-full/src/components/Login/types.ts +0 -18
- package/templates/create-full/src/components/Navbar/components/CartSidebar/index.tsx +0 -203
- package/templates/create-full/src/components/Navbar/components/CartSidebar/styles.css +0 -175
- package/templates/create-full/src/components/Navbar/components/MobileMenu/index.tsx +0 -198
- package/templates/create-full/src/components/Navbar/components/MobileMenu/styles.css +0 -122
- package/templates/create-full/src/components/Navbar/components/NavItem/index.tsx +0 -65
- package/templates/create-full/src/components/Navbar/components/SearchModal/index.tsx +0 -339
- package/templates/create-full/src/components/Navbar/components/SearchModal/styles.css +0 -191
- package/templates/create-full/src/components/Navbar/index.tsx +0 -254
- package/templates/create-full/src/components/Navbar/styles.css +0 -254
- package/templates/create-full/src/components/Navbar/types.ts +0 -42
- package/templates/create-full/src/components/NotFound/index.tsx +0 -39
- package/templates/create-full/src/components/NotFound/styles.css +0 -46
- package/templates/create-full/src/components/NotFound/types.ts +0 -8
- package/templates/create-full/src/components/ProductDetail/components/ProductGallery/index.tsx +0 -316
- package/templates/create-full/src/components/ProductDetail/components/ProductGallery/styles.css +0 -213
- package/templates/create-full/src/components/ProductDetail/index.tsx +0 -92
- package/templates/create-full/src/components/ProductDetail/styles.css +0 -58
- package/templates/create-full/src/components/ProductDetail/types.ts +0 -12
- package/templates/create-full/src/components/ProductDetailAddToCart/components/PayWithIkas/index.tsx +0 -34
- package/templates/create-full/src/components/ProductDetailAddToCart/components/PayWithIkas/styles.css +0 -4
- package/templates/create-full/src/components/ProductDetailAddToCart/index.tsx +0 -146
- package/templates/create-full/src/components/ProductDetailAddToCart/styles.css +0 -27
- package/templates/create-full/src/components/ProductDetailAddToCart/types.ts +0 -18
- package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureRow/index.tsx +0 -164
- package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureSection/index.tsx +0 -134
- package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureSection/styles.css +0 -188
- package/templates/create-full/src/components/ProductDetailBundleFurniture/index.tsx +0 -61
- package/templates/create-full/src/components/ProductDetailBundleFurniture/styles.css +0 -12
- package/templates/create-full/src/components/ProductDetailBundleFurniture/types.ts +0 -21
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleProductItem/index.tsx +0 -169
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleProductItem/styles.css +0 -141
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleSkeletonLoading/index.tsx +0 -35
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleSkeletonLoading/styles.css +0 -85
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureRow/index.tsx +0 -51
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureRow/styles.css +0 -30
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureView/index.tsx +0 -54
- package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureView/styles.css +0 -22
- package/templates/create-full/src/components/ProductDetailBundleProduct/index.tsx +0 -101
- package/templates/create-full/src/components/ProductDetailBundleProduct/styles.css +0 -20
- package/templates/create-full/src/components/ProductDetailBundleProduct/types.ts +0 -18
- package/templates/create-full/src/components/ProductDetailDescription/index.tsx +0 -56
- package/templates/create-full/src/components/ProductDetailDescription/styles.css +0 -21
- package/templates/create-full/src/components/ProductDetailDescription/types.ts +0 -13
- package/templates/create-full/src/components/ProductDetailFeatureItem/index.tsx +0 -28
- package/templates/create-full/src/components/ProductDetailFeatureItem/styles.css +0 -22
- package/templates/create-full/src/components/ProductDetailFeatureItem/types.ts +0 -7
- package/templates/create-full/src/components/ProductDetailFeatures/index.tsx +0 -40
- package/templates/create-full/src/components/ProductDetailFeatures/styles.css +0 -17
- package/templates/create-full/src/components/ProductDetailFeatures/types.ts +0 -10
- package/templates/create-full/src/components/ProductDetailNameFavorite/index.tsx +0 -66
- package/templates/create-full/src/components/ProductDetailNameFavorite/styles.css +0 -45
- package/templates/create-full/src/components/ProductDetailNameFavorite/types.ts +0 -11
- package/templates/create-full/src/components/ProductDetailOffer/components/OfferCard/index.tsx +0 -209
- package/templates/create-full/src/components/ProductDetailOffer/components/OfferCard/styles.css +0 -146
- package/templates/create-full/src/components/ProductDetailOffer/components/OfferSummary/index.tsx +0 -175
- package/templates/create-full/src/components/ProductDetailOffer/index.tsx +0 -199
- package/templates/create-full/src/components/ProductDetailOffer/styles.css +0 -211
- package/templates/create-full/src/components/ProductDetailOffer/types.ts +0 -24
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionCheckbox/index.tsx +0 -52
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionCheckbox/styles.css +0 -19
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceBox/index.tsx +0 -60
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceBox/styles.css +0 -38
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSelect/index.tsx +0 -102
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSelect/styles.css +0 -34
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSwatch/index.tsx +0 -121
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSwatch/styles.css +0 -87
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/index.tsx +0 -57
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionColorPicker/index.tsx +0 -54
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionColorPicker/styles.css +0 -0
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionDatePicker/index.tsx +0 -124
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionDatePicker/styles.css +0 -1
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionFile/index.tsx +0 -217
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionFile/styles.css +0 -87
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionRenderer/index.tsx +0 -133
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionText/index.tsx +0 -60
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionText/styles.css +0 -1
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionTextarea/index.tsx +0 -74
- package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionTextarea/styles.css +0 -10
- package/templates/create-full/src/components/ProductDetailOptionSet/index.tsx +0 -99
- package/templates/create-full/src/components/ProductDetailOptionSet/styles.css +0 -30
- package/templates/create-full/src/components/ProductDetailOptionSet/types.ts +0 -21
- package/templates/create-full/src/components/ProductDetailPrices/index.tsx +0 -62
- package/templates/create-full/src/components/ProductDetailPrices/styles.css +0 -32
- package/templates/create-full/src/components/ProductDetailPrices/types.ts +0 -10
- package/templates/create-full/src/components/ProductDetailProductGroup/index.tsx +0 -74
- package/templates/create-full/src/components/ProductDetailProductGroup/styles.css +0 -33
- package/templates/create-full/src/components/ProductDetailProductGroup/types.ts +0 -10
- package/templates/create-full/src/components/ProductDetailReviews/index.tsx +0 -205
- package/templates/create-full/src/components/ProductDetailReviews/styles.css +0 -43
- package/templates/create-full/src/components/ProductDetailReviews/types.ts +0 -19
- package/templates/create-full/src/components/ProductDetailSku/index.tsx +0 -38
- package/templates/create-full/src/components/ProductDetailSku/styles.css +0 -16
- package/templates/create-full/src/components/ProductDetailSku/types.ts +0 -11
- package/templates/create-full/src/components/ProductDetailVariant/index.tsx +0 -38
- package/templates/create-full/src/components/ProductDetailVariant/styles.css +0 -14
- package/templates/create-full/src/components/ProductDetailVariant/types.ts +0 -12
- package/templates/create-full/src/components/ProductSlider/index.tsx +0 -151
- package/templates/create-full/src/components/ProductSlider/styles.css +0 -105
- package/templates/create-full/src/components/ProductSlider/types.ts +0 -17
- package/templates/create-full/src/components/RecoverPassword/components/RecoverPasswordForm/index.tsx +0 -133
- package/templates/create-full/src/components/RecoverPassword/components/RecoverPasswordForm/styles.css +0 -0
- package/templates/create-full/src/components/RecoverPassword/index.tsx +0 -30
- package/templates/create-full/src/components/RecoverPassword/styles.css +0 -93
- package/templates/create-full/src/components/RecoverPassword/types.ts +0 -13
- package/templates/create-full/src/components/Register/components/RegisterForm/index.tsx +0 -326
- package/templates/create-full/src/components/Register/components/RegisterForm/styles.css +0 -0
- package/templates/create-full/src/components/Register/index.tsx +0 -30
- package/templates/create-full/src/components/Register/styles.css +0 -152
- package/templates/create-full/src/components/Register/types.ts +0 -27
- package/templates/create-full/src/components/RichText/index.tsx +0 -25
- package/templates/create-full/src/components/RichText/styles.css +0 -51
- package/templates/create-full/src/components/RichText/types.ts +0 -5
- package/templates/create-full/src/components/SocialMediaIcon/index.tsx +0 -26
- package/templates/create-full/src/components/SocialMediaIcon/styles.css +0 -17
- package/templates/create-full/src/components/SocialMediaIcon/types.ts +0 -7
- package/templates/create-full/src/components/index.ts +0 -50
- package/templates/create-full/src/global-types.ts +0 -11
- package/templates/create-full/src/global.css +0 -598
- package/templates/create-full/src/hooks/useBundleProducts.ts +0 -75
- package/templates/create-full/src/hooks/useColumnPreference.ts +0 -26
- package/templates/create-full/src/hooks/useInfiniteScroll.ts +0 -49
- package/templates/create-full/src/hooks/usePageTracking.ts +0 -56
- package/templates/create-full/src/hooks/usePayWithIkas.ts +0 -114
- package/templates/create-full/src/hooks/useRedirectIfLoggedIn.ts +0 -35
- package/templates/create-full/src/hooks/useScrollLock.ts +0 -19
- package/templates/create-full/src/hooks/useToast.ts +0 -27
- package/templates/create-full/src/ikas-component-utils.d.ts +0 -3
- package/templates/create-full/src/sub-components/Badge/index.tsx +0 -208
- package/templates/create-full/src/sub-components/Badge/styles.css +0 -129
- package/templates/create-full/src/sub-components/Breadcrumb/index.tsx +0 -57
- package/templates/create-full/src/sub-components/Breadcrumb/styles.css +0 -49
- package/templates/create-full/src/sub-components/BundleMedia/index.tsx +0 -72
- package/templates/create-full/src/sub-components/BundleQuantityBox/index.tsx +0 -73
- package/templates/create-full/src/sub-components/BundleQuantityBox/styles.css +0 -43
- package/templates/create-full/src/sub-components/Button/index.tsx +0 -52
- package/templates/create-full/src/sub-components/Button/styles.css +0 -114
- package/templates/create-full/src/sub-components/CartItem/components/BundleProductItem/index.tsx +0 -59
- package/templates/create-full/src/sub-components/CartItem/components/BundleProductItem/styles.css +0 -24
- package/templates/create-full/src/sub-components/CartItem/components/BundleProducts/index.tsx +0 -55
- package/templates/create-full/src/sub-components/CartItem/components/BundleProducts/styles.css +0 -30
- package/templates/create-full/src/sub-components/CartItem/components/ItemOptions/index.tsx +0 -31
- package/templates/create-full/src/sub-components/CartItem/components/ItemOptions/styles.css +0 -6
- package/templates/create-full/src/sub-components/CartItem/components/OptionValueDisplay/index.tsx +0 -79
- package/templates/create-full/src/sub-components/CartItem/components/OptionValueDisplay/styles.css +0 -28
- package/templates/create-full/src/sub-components/CartItem/index.tsx +0 -216
- package/templates/create-full/src/sub-components/CartItem/styles.css +0 -170
- package/templates/create-full/src/sub-components/Checkbox/index.tsx +0 -42
- package/templates/create-full/src/sub-components/Checkbox/styles.css +0 -65
- package/templates/create-full/src/sub-components/CollapsibleGroup/index.tsx +0 -52
- package/templates/create-full/src/sub-components/CollapsibleGroup/styles.css +0 -51
- package/templates/create-full/src/sub-components/ColorInput/index.tsx +0 -33
- package/templates/create-full/src/sub-components/ColorInput/styles.css +0 -53
- package/templates/create-full/src/sub-components/ConfirmModal/index.tsx +0 -60
- package/templates/create-full/src/sub-components/ConfirmModal/styles.css +0 -20
- package/templates/create-full/src/sub-components/FormItem/index.tsx +0 -66
- package/templates/create-full/src/sub-components/FormItem/styles.css +0 -38
- package/templates/create-full/src/sub-components/ImagePreviewModal/index.tsx +0 -55
- package/templates/create-full/src/sub-components/ImagePreviewModal/styles.css +0 -50
- package/templates/create-full/src/sub-components/Input/index.tsx +0 -69
- package/templates/create-full/src/sub-components/Input/styles.css +0 -162
- package/templates/create-full/src/sub-components/Modal/index.tsx +0 -120
- package/templates/create-full/src/sub-components/Modal/styles.css +0 -70
- package/templates/create-full/src/sub-components/PageLoader/index.tsx +0 -14
- package/templates/create-full/src/sub-components/PageLoader/styles.css +0 -12
- package/templates/create-full/src/sub-components/Pagination/index.tsx +0 -107
- package/templates/create-full/src/sub-components/Pagination/styles.css +0 -88
- package/templates/create-full/src/sub-components/ProductCard/index.tsx +0 -276
- package/templates/create-full/src/sub-components/ProductCard/styles.css +0 -99
- package/templates/create-full/src/sub-components/QuantitySelector/index.tsx +0 -41
- package/templates/create-full/src/sub-components/QuantitySelector/styles.css +0 -51
- package/templates/create-full/src/sub-components/ReviewCard/index.tsx +0 -103
- package/templates/create-full/src/sub-components/ReviewCard/styles.css +0 -95
- package/templates/create-full/src/sub-components/ReviewForm/index.tsx +0 -115
- package/templates/create-full/src/sub-components/ReviewForm/styles.css +0 -11
- package/templates/create-full/src/sub-components/ReviewSummary/index.tsx +0 -65
- package/templates/create-full/src/sub-components/ReviewSummary/styles.css +0 -86
- package/templates/create-full/src/sub-components/Select/index.tsx +0 -86
- package/templates/create-full/src/sub-components/Select/styles.css +0 -110
- package/templates/create-full/src/sub-components/SkeletonField/index.tsx +0 -12
- package/templates/create-full/src/sub-components/SkeletonField/styles.css +0 -29
- package/templates/create-full/src/sub-components/SliderArrow/index.tsx +0 -26
- package/templates/create-full/src/sub-components/SliderArrow/styles.css +0 -24
- package/templates/create-full/src/sub-components/SocialLoginButton/index.tsx +0 -24
- package/templates/create-full/src/sub-components/SocialLoginButton/styles.css +0 -19
- package/templates/create-full/src/sub-components/SpinnerIcon/index.tsx +0 -10
- package/templates/create-full/src/sub-components/SpinnerIcon/styles.css +0 -8
- package/templates/create-full/src/sub-components/StarRating/index.tsx +0 -76
- package/templates/create-full/src/sub-components/StarRating/styles.css +0 -40
- package/templates/create-full/src/sub-components/Tag/index.tsx +0 -21
- package/templates/create-full/src/sub-components/Tag/styles.css +0 -30
- package/templates/create-full/src/sub-components/Textarea/index.tsx +0 -45
- package/templates/create-full/src/sub-components/Textarea/styles.css +0 -82
- package/templates/create-full/src/sub-components/Toast/index.tsx +0 -257
- package/templates/create-full/src/sub-components/Toast/styles.css +0 -3
- package/templates/create-full/src/sub-components/Toggle/index.tsx +0 -46
- package/templates/create-full/src/sub-components/Toggle/styles.css +0 -86
- package/templates/create-full/src/sub-components/VariantBadge/index.tsx +0 -153
- package/templates/create-full/src/sub-components/VariantBadge/styles.css +0 -47
- package/templates/create-full/src/sub-components/icons/index.tsx +0 -981
- package/templates/create-full/src/utils/bundle.ts +0 -70
- package/templates/create-full/src/utils/cx.ts +0 -4
- package/templates/create-full/src/utils/fullName.ts +0 -6
- package/templates/create-full/src/utils/media.ts +0 -36
- package/templates/create-full/src/utils/optionPrice.ts +0 -19
- package/templates/create-full/src/utils/optionSet.ts +0 -17
- package/templates/create-full/src/utils/orderStatus.ts +0 -28
- package/templates/create-full/src/utils/pagination.ts +0 -29
- package/templates/create-full/src/utils/toast.ts +0 -5
- package/templates/create-full/tsconfig.json +0 -30
- package/templates/create-full/vite.config.ts +0 -15
|
@@ -1,752 +0,0 @@
|
|
|
1
|
-
Do not hesitate to ask me any questions. ASK ME ANYTHING YOU NEED! Use the AskUserQuestion tool to ask as many follow ups as you need to reach clarity.
|
|
2
|
-
|
|
3
|
-
# ikas Code Components Project
|
|
4
|
-
|
|
5
|
-
You are building **Preact + TypeScript components for an e-commerce storefront**.
|
|
6
|
-
This project uses the ikas Code Components framework with an MCP server for API documentation.
|
|
7
|
-
|
|
8
|
-
**ALWAYS query MCP tools before writing code that uses storefront APIs.**
|
|
9
|
-
Never guess function signatures or type shapes — the MCP server is the source of truth.
|
|
10
|
-
|
|
11
|
-
## CRITICAL: Auto-Generated Files
|
|
12
|
-
|
|
13
|
-
**NEVER manually create or edit `ikas.config.json`, `types.ts`, `global-types.ts`, or `src/components/index.ts`** — they are all auto-generated by CLI commands.
|
|
14
|
-
Use `npx ikas-component config add-component --props '[...]'` or `npx ikas-component config add-prop` to manage components and props.
|
|
15
|
-
These commands update `ikas.config.json`, `types.ts`, `global-types.ts`, AND `src/components/index.ts` (including the component export) automatically.
|
|
16
|
-
|
|
17
|
-
**The CLI does NOT edit your component source.** `remove-prop` and `remove-enum` update `ikas.config.json` and the generated `types.ts` / `global-types.ts` only — `index.tsx`, sub-components, and `styles.css` are untouched. After removing a prop or enum, grep the source for the old identifier and clean up dead references yourself before building.
|
|
18
|
-
|
|
19
|
-
## MCP Tools (12 tools)
|
|
20
|
-
|
|
21
|
-
### Starting a New Section
|
|
22
|
-
|
|
23
|
-
| Tool | Purpose |
|
|
24
|
-
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
25
|
-
| `get_section_template(sectionType)` | **Start here** — production-ready starter template (index.tsx + types.ts + styles.css + config) for common sections: header, footer, product-detail, product-list, cart, login, register, hero-banner, blog-post, faq, etc. |
|
|
26
|
-
| `get_framework_guide(topic)` | Framework docs — "ai-workflow", "common-pitfalls", "prop-types", "css-scoping", "form-handling", "imports", "sections-vs-components" |
|
|
27
|
-
| `get_code_example(task)` | Code examples — "add to cart", "variant selection", "image-handling", "product-detail-section", "cart-section" |
|
|
28
|
-
|
|
29
|
-
### Looking Up APIs
|
|
30
|
-
|
|
31
|
-
| Tool | Purpose |
|
|
32
|
-
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
33
|
-
| `search_docs(query)` | Search across all storefront API docs and framework guides |
|
|
34
|
-
| `get_function_doc(name)` | Full docs for a specific function (e.g. "addItemToCart", "Router.navigate") |
|
|
35
|
-
| `list_functions(category?)` | List functions by category: ProductDetail, Cart, ProductList, Navigation, Customer, Order, Image, Blog, Brand, Category, Pricing, Form, Validation, Pagination, Filtering |
|
|
36
|
-
| `get_prop_types()` | All available ikas.config.json prop types with TS types and examples |
|
|
37
|
-
|
|
38
|
-
### Exploring Types
|
|
39
|
-
|
|
40
|
-
| Tool | Purpose |
|
|
41
|
-
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
42
|
-
| `get_model_guide(model)` | **One-stop-shop** — type definition + all utility functions + examples + related types for a model (e.g. "IkasProduct", "IkasOrder") |
|
|
43
|
-
| `get_type_definition(name)` | Full definition of a type or enum (e.g. "IkasProduct", "IkasOrderStatus") |
|
|
44
|
-
| `get_functions_for_type(typeName)` | All utility functions for a type (e.g. "IkasImage") |
|
|
45
|
-
| `search_types(query)` | Search types/enums by keyword (e.g. "price", "address", "status") |
|
|
46
|
-
| `list_types(domain?, kind?)` | List all types, optionally filtered by domain ("product", "cart", "order") or kind ("type", "enum") |
|
|
47
|
-
|
|
48
|
-
## CLI Commands
|
|
49
|
-
|
|
50
|
-
**Never edit ikas.config.json or types.ts manually** — use the CLI commands:
|
|
51
|
-
|
|
52
|
-
| Command | Purpose |
|
|
53
|
-
| ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
|
|
54
|
-
| `npx ikas-component config add-component --name "Name" --type section --props '[...]'` | **Primary** — create component with all props in one command |
|
|
55
|
-
| `npx ikas-component config add-component --name "Name" --type section` | Create component with no props (add later) |
|
|
56
|
-
| `npx ikas-component config add-prop --component "Name" --name title --displayName "Title" --type TEXT --required [--group content]` | Add a single prop incrementally |
|
|
57
|
-
| `npx ikas-component config update-prop --component "Name" --prop title --type RICH_TEXT [--group colors]` | Update a prop's type or group |
|
|
58
|
-
| `npx ikas-component config remove-prop --component "Name" --prop title` | Remove a prop |
|
|
59
|
-
| `npx ikas-component config remove-component --name "Name"` | Remove a component |
|
|
60
|
-
| `npx ikas-component config add-prop-group --component "Name" --id colors --name "Colors" [--description "..."] [--parent style]` | Create a prop group |
|
|
61
|
-
| `npx ikas-component config update-prop-group --component "Name" --id colors [--name "..."] [--description "..."]` | Update a prop group |
|
|
62
|
-
| `npx ikas-component config remove-prop-group --component "Name" --id colors` | Remove a prop group |
|
|
63
|
-
| `npx ikas-component config list` | List all components and their props |
|
|
64
|
-
| `npx ikas-component config add-enum --name "Size" --options '[{"name":"Small","value":"s"}]'` | Create a custom ENUM type (returns `enumTypeId`) |
|
|
65
|
-
| `npx ikas-component config update-enum --id <enumId> --name "..." [--options '[...]']` | Update enum name/options |
|
|
66
|
-
| `npx ikas-component config remove-enum --id <enumId>` | Remove enum (fails if any prop still references it) |
|
|
67
|
-
| `npx ikas-component config list-enums` | List all custom enums |
|
|
68
|
-
| `npx ikas-component check --json` | Type-check all components, output errors as JSON |
|
|
69
|
-
| `npx ikas-component build` | Compile server.js + client.js + styles.css per component |
|
|
70
|
-
| `npx ikas-component dev` | Start dev server (Vite 5200 + WebSocket 5201) |
|
|
71
|
-
|
|
72
|
-
## Workflow: Building a New Section
|
|
73
|
-
|
|
74
|
-
1. `get_section_template("product-detail-section")` → get starter files + CLI command with --props
|
|
75
|
-
2. For any custom ENUM props the section needs: `config add-enum` **first** (capture the returned `enumTypeId`), then reference it in `add-prop --type ENUM --enumTypeId <id>`. Order matters — an ENUM prop without a pre-existing `enumTypeId` is rejected.
|
|
76
|
-
3. Run the CLI command (creates component + props + types.ts in one step)
|
|
77
|
-
4. Write `index.tsx` and `styles.css` using the template (do NOT edit `types.ts` or `global-types.ts` — both are regenerated on every prop/enum mutation)
|
|
78
|
-
5. Look up APIs → `get_model_guide("IkasProduct")`, `get_function_doc("addItemToCart")`
|
|
79
|
-
6. `npx ikas-component check --json` → fix type errors
|
|
80
|
-
7. `npx ikas-component build` → verify clean build
|
|
81
|
-
|
|
82
|
-
### Custom ENUM lifecycle
|
|
83
|
-
|
|
84
|
-
- **Create:** `add-enum` → `add-prop --type ENUM --enumTypeId <id>`. The enum must exist before the prop is created.
|
|
85
|
-
- **Rename options:** `update-enum --id <id> --options '[...]'`. `types.ts` regenerates automatically.
|
|
86
|
-
- **Remove:** remove (or repoint) every prop that references the enum **first**, then `remove-enum`. `remove-enum` blocks with an error while any prop still references the id.
|
|
87
|
-
- `global-types.ts` is regenerated unconditionally on `add-enum` / `update-enum` / `remove-enum` / `remove-prop` — never hand-edit it.
|
|
88
|
-
|
|
89
|
-
## Sub-Component Structure
|
|
90
|
-
|
|
91
|
-
**ALWAYS create sub-components in `src/sub-components/` with their own folder containing `index.tsx` and `styles.css`. NEVER create flat .tsx files inside a component folder.**
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
src/
|
|
95
|
-
├── components/
|
|
96
|
-
│ ├── ProductList/
|
|
97
|
-
│ │ ├── index.tsx # imports from ../../sub-components/...
|
|
98
|
-
│ │ ├── types.ts # auto-generated (CLI-managed)
|
|
99
|
-
│ │ └── styles.css
|
|
100
|
-
│ └── index.ts
|
|
101
|
-
└── sub-components/
|
|
102
|
-
├── ProductCard/
|
|
103
|
-
│ ├── index.tsx # sub-component with inline Props
|
|
104
|
-
│ └── styles.css
|
|
105
|
-
└── FilterSidebar/
|
|
106
|
-
├── index.tsx
|
|
107
|
-
└── styles.css
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
**Key rules:**
|
|
111
|
-
|
|
112
|
-
- `src/components/` = registered in ikas.config.json. `src/sub-components/` = internal helpers (NOT in ikas.config.json)
|
|
113
|
-
- Sub-components do NOT have `types.ts` — define `Props` inline in `index.tsx`
|
|
114
|
-
- TSX: use `import ProductCard from "../../sub-components/ProductCard";`
|
|
115
|
-
- Sub-components that read MobX stores need `observer()`, others don't
|
|
116
|
-
- Sub-components can be shared across multiple parent sections
|
|
117
|
-
|
|
118
|
-
```tsx
|
|
119
|
-
// src/sub-components/ProductCard/index.tsx — inline Props, no types.ts
|
|
120
|
-
import { IkasProduct, getSelectedProductVariant } from "@ikas/bp-storefront";
|
|
121
|
-
|
|
122
|
-
interface Props { product: IkasProduct; }
|
|
123
|
-
|
|
124
|
-
export default function ProductCard({ product }: Props) { ... }
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
## SVG Icons
|
|
128
|
-
|
|
129
|
-
**CRITICAL: Never write inline `<svg>` in components or sub-components.**
|
|
130
|
-
All icons live in `src/sub-components/icons/index.tsx` as named exports.
|
|
131
|
-
|
|
132
|
-
```tsx
|
|
133
|
-
// Adding a new icon — IconProps extends SVGAttributes<SVGSVGElement>
|
|
134
|
-
export function HeartSVG({ className, ...props }: IconProps) {
|
|
135
|
-
return (
|
|
136
|
-
<svg
|
|
137
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
138
|
-
viewBox="0 0 24 24"
|
|
139
|
-
fill="none"
|
|
140
|
-
className={`kombos-icon ${className}`}
|
|
141
|
-
{...props}
|
|
142
|
-
>
|
|
143
|
-
<path d="M20.84 4.61..." fill="currentColor" />
|
|
144
|
-
</svg>
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// Using it
|
|
149
|
-
import { HeartSVG } from "../../sub-components/icons";
|
|
150
|
-
<HeartSVG />;
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
### Rules
|
|
154
|
-
|
|
155
|
-
- One file (`index.tsx`) holds all icons — no separate files per icon
|
|
156
|
-
- `IconProps` extends `SVGAttributes<SVGSVGElement>` from Preact — accepts all standard SVG attributes
|
|
157
|
-
- Pattern: `{ className, ...props }` with `className={`kombos-icon ${className}`}` and `{...props}` spread
|
|
158
|
-
- Icons use `fill="currentColor"` — they inherit color from the parent element's CSS `color` property
|
|
159
|
-
- Before adding a new icon, check if it already exists in the file
|
|
160
|
-
|
|
161
|
-
### Sizing Icons
|
|
162
|
-
|
|
163
|
-
**CRITICAL: Never pass `width`/`height` props to size icons.** Icon sizing is controlled via CSS `font-size` on the parent element or a wrapping class.
|
|
164
|
-
|
|
165
|
-
The `.kombos-icon` base class uses `width: 1em; height: 1em` so icons scale with `font-size`.
|
|
166
|
-
|
|
167
|
-
```css
|
|
168
|
-
/* Size an icon via font-size on the parent or the icon itself */
|
|
169
|
-
.my-section__icon-btn {
|
|
170
|
-
font-size: 1.5rem;
|
|
171
|
-
} /* icon inside will be 24x24 */
|
|
172
|
-
.my-section__small-icon {
|
|
173
|
-
font-size: 1rem;
|
|
174
|
-
} /* icon will be 16x16 */
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
```tsx
|
|
178
|
-
/* In JSX — no width/height props needed */
|
|
179
|
-
<button className="my-section__icon-btn"><HeartSVG /></button>
|
|
180
|
-
<span className="my-section__small-icon"><PackageSVG /></span>
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
## Button Sub-Component
|
|
184
|
-
|
|
185
|
-
**CRITICAL: Never write custom button styles in components.** All buttons MUST use `src/sub-components/Button`.
|
|
186
|
-
Import: `import Button from "../../sub-components/Button";`
|
|
187
|
-
|
|
188
|
-
### Variants
|
|
189
|
-
|
|
190
|
-
| Prop | Values | Default |
|
|
191
|
-
| --------- | ---------------------------- | ----------- |
|
|
192
|
-
| `variant` | `"primary"` \| `"secondary"` | `"primary"` |
|
|
193
|
-
| `size` | `"xs"` \| `"s"` \| `"m"` | `"s"` |
|
|
194
|
-
|
|
195
|
-
### Size Specs (from Figma)
|
|
196
|
-
|
|
197
|
-
| Size | Padding | Typography class |
|
|
198
|
-
| ---- | --------- | ------------------ |
|
|
199
|
-
| `xs` | 8px 16px | `text-sm-semibold` |
|
|
200
|
-
| `s` | 10px 20px | `text-md-semibold` |
|
|
201
|
-
| `m` | 12px 24px | `text-lg-semibold` |
|
|
202
|
-
|
|
203
|
-
### Variant Styles
|
|
204
|
-
|
|
205
|
-
- **Primary:** bg gray-900, text white. Hover: bg gray-800. Disabled: bg gray-300, text gray-50.
|
|
206
|
-
- **Secondary:** bg white, border gray-200, text gray-900. Hover: border gray-300. Disabled: bg gray-50, text gray-300.
|
|
207
|
-
|
|
208
|
-
All: `border-radius: 6px`, typography class auto-applied by size.
|
|
209
|
-
|
|
210
|
-
### Usage
|
|
211
|
-
|
|
212
|
-
```tsx
|
|
213
|
-
import Button from "../../sub-components/Button";
|
|
214
|
-
|
|
215
|
-
<Button variant="primary" size="s">{buttonText}</Button>
|
|
216
|
-
<Button variant="secondary" size="m" disabled>{disabledText}</Button>
|
|
217
|
-
<Button variant="primary" size="xs" onClick={handleClick}>{label}</Button>
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
Extends `JSX.HTMLAttributes<HTMLButtonElement>` — accepts all standard button props (`onClick`, `disabled`, `className`, `aria-label`, etc.).
|
|
221
|
-
When placed in flex containers, add a layout class (e.g. `className="my-section__footer-btn"`) with `flex: 1` for full-width behavior.
|
|
222
|
-
|
|
223
|
-
## Input Sub-Component
|
|
224
|
-
|
|
225
|
-
**CRITICAL: Never write custom input styles in components.** All text inputs MUST use `src/sub-components/Input`.
|
|
226
|
-
Import: `import Input from "../../sub-components/Input";`
|
|
227
|
-
|
|
228
|
-
Input is a pure input field — no label, no helper text. Wrap with `FormItem` for labels and validation messages.
|
|
229
|
-
|
|
230
|
-
### Props
|
|
231
|
-
|
|
232
|
-
| Prop | Type | Default | Description |
|
|
233
|
-
| ---------- | ----------------------- | ------- | -------------------------------------------------------------------- |
|
|
234
|
-
| `password` | `boolean` | `false` | Shows eye toggle icon for password visibility |
|
|
235
|
-
| `disabled` | `boolean` | `false` | Disabled state |
|
|
236
|
-
| `leftIcon` | `ComponentChildren` | — | Icon rendered on the left (activates search-style border `gray-500`) |
|
|
237
|
-
| `inputRef` | `Ref<HTMLInputElement>` | — | Ref forwarded to the native `<input>` element |
|
|
238
|
-
|
|
239
|
-
Also extends `InputHTMLAttributes<HTMLInputElement>` — accepts `placeholder`, `value`, `onInput`, `name`, etc.
|
|
240
|
-
|
|
241
|
-
### Design Specs (from Figma)
|
|
242
|
-
|
|
243
|
-
- Input field: padding `10px 14px`, border-radius `6px`, border `1px solid gray-200`
|
|
244
|
-
- Input text: `text-md-regular`, color `gray-900`
|
|
245
|
-
- Placeholder: color `gray-400`
|
|
246
|
-
- Hover: border `gray-300`
|
|
247
|
-
- With `leftIcon`: border `gray-500`, padding `10px 12px`, gap `12px`
|
|
248
|
-
- Disabled: bg `gray-50`, text `gray-300`
|
|
249
|
-
|
|
250
|
-
### Usage
|
|
251
|
-
|
|
252
|
-
```tsx
|
|
253
|
-
import Input from "../../sub-components/Input";
|
|
254
|
-
|
|
255
|
-
<Input placeholder="you@example.com" />
|
|
256
|
-
<Input password placeholder="Enter password" />
|
|
257
|
-
<Input disabled placeholder="Disabled" />
|
|
258
|
-
<Input leftIcon={<MagnifyingGlass1SVG />} placeholder="Search..." />
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
**Remember:** Use `onInput` instead of `onChange` for text inputs (Preact behavior).
|
|
262
|
-
|
|
263
|
-
## FormItem Sub-Component
|
|
264
|
-
|
|
265
|
-
Wraps form controls (Input, select, etc.) with a label and helper/error text.
|
|
266
|
-
Import: `import FormItem from "../../sub-components/FormItem";`
|
|
267
|
-
|
|
268
|
-
### Props
|
|
269
|
-
|
|
270
|
-
| Prop | Type | Default | Description |
|
|
271
|
-
| ------------ | --------------------------------------- | ----------- | ---------------------------------------------------------- |
|
|
272
|
-
| `label` | `string` | — | Label text above the input |
|
|
273
|
-
| `status` | `"default"` \| `"error"` \| `"success"` | `"default"` | Controls border color of child Input and helper text color |
|
|
274
|
-
| `helperText` | `string` | — | Helper/error/success message below the input |
|
|
275
|
-
| `children` | `ComponentChildren` | — | The form control (e.g. `<Input />`) |
|
|
276
|
-
|
|
277
|
-
### Design Specs (from Figma)
|
|
278
|
-
|
|
279
|
-
- Label: `text-xs-medium`, color `gray-700`
|
|
280
|
-
- Helper text: `text-xs-regular`, default `gray-500`
|
|
281
|
-
- Error: border & helper `--kombos-error` (#FF3C48)
|
|
282
|
-
- Success: border & helper `--kombos-success` (#12B76A)
|
|
283
|
-
- Gap between label / input / helper: `4px`
|
|
284
|
-
|
|
285
|
-
### Usage
|
|
286
|
-
|
|
287
|
-
```tsx
|
|
288
|
-
import FormItem from "../../sub-components/FormItem";
|
|
289
|
-
import Input from "../../sub-components/Input";
|
|
290
|
-
|
|
291
|
-
<FormItem label="Email">
|
|
292
|
-
<Input placeholder="you@example.com" />
|
|
293
|
-
</FormItem>
|
|
294
|
-
|
|
295
|
-
<FormItem label="Password">
|
|
296
|
-
<Input password placeholder="Enter password" />
|
|
297
|
-
</FormItem>
|
|
298
|
-
|
|
299
|
-
<FormItem label="Email" status="error" helperText="Invalid email">
|
|
300
|
-
<Input value="bad@" />
|
|
301
|
-
</FormItem>
|
|
302
|
-
|
|
303
|
-
<FormItem label="Email" status="success" helperText="Looks good!">
|
|
304
|
-
<Input value="ok@ikas.com" />
|
|
305
|
-
</FormItem>
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
## Media Utilities (`src/utils/media.ts`)
|
|
309
|
-
|
|
310
|
-
**CRITICAL: Never define local `ASPECT_RATIO_MAP`, `OBJECT_FIT_MAP`, or `ALIGNMENT_MAP` in components.**
|
|
311
|
-
All aspect ratio, object fit, and vertical alignment resolution MUST use the shared helpers from `src/utils/media.ts`.
|
|
312
|
-
|
|
313
|
-
```tsx
|
|
314
|
-
import {
|
|
315
|
-
resolveAspectRatio,
|
|
316
|
-
resolveObjectFit,
|
|
317
|
-
resolveVerticalAlignment,
|
|
318
|
-
} from "../../utils/media";
|
|
319
|
-
|
|
320
|
-
// Each function accepts an optional value and returns the CSS string.
|
|
321
|
-
// When undefined is passed, defaults are applied: "Square" → "1 / 1", "Cover" → "cover", "Middle" → "center"
|
|
322
|
-
const ar = resolveAspectRatio(aspectRatio); // e.g. "1 / 1"
|
|
323
|
-
const of = resolveObjectFit(objectFit); // e.g. "cover"
|
|
324
|
-
const va = resolveVerticalAlignment(align); // e.g. "center"
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
- No need to set defaults in destructuring (`aspectRatio = "Square"`) — the functions handle it
|
|
328
|
-
- Components that only pass these values through to children (e.g. `ProductDetailBundleFurniture`) don't need to import the utils
|
|
329
|
-
|
|
330
|
-
## Hooks (`src/hooks/`)
|
|
331
|
-
|
|
332
|
-
### `useScrollLock` — overlay/modal scroll lock (`src/hooks/useScrollLock.ts`)
|
|
333
|
-
|
|
334
|
-
**CRITICAL: Never write inline `document.body.style.overflow = "hidden"` in components.** All overlay/modal scroll locking MUST use `useScrollLock`.
|
|
335
|
-
|
|
336
|
-
```tsx
|
|
337
|
-
import { useScrollLock } from "../../hooks/useScrollLock";
|
|
338
|
-
|
|
339
|
-
// Always-on (mount-triggered overlays: CartSidebar, AddressModal, ImagePreviewModal, SearchModal)
|
|
340
|
-
useScrollLock();
|
|
341
|
-
|
|
342
|
-
// Conditional (prop-triggered overlays: MobileFilterModal)
|
|
343
|
-
useScrollLock(isOpen);
|
|
344
|
-
|
|
345
|
-
// With skip-cleanup (overlay handoff: MobileMenu → CartSidebar)
|
|
346
|
-
const skipCleanupRef = useRef(false);
|
|
347
|
-
useScrollLock(true, skipCleanupRef);
|
|
348
|
-
// Set skipCleanupRef.current = true before closing to keep scroll locked for the next overlay
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
**Parameters:**
|
|
352
|
-
|
|
353
|
-
- `enabled` (default `true`) — lock when true, unlock cleanup when false or unmount
|
|
354
|
-
- `skipCleanupRef` (optional `RefObject<boolean>`) — when `.current` is true, cleanup skips restoring scroll (for seamless overlay transitions)
|
|
355
|
-
|
|
356
|
-
**What it does:** calculates scrollbar width, sets `overflow: hidden` + `paddingRight` on body, restores on cleanup.
|
|
357
|
-
|
|
358
|
-
**Exception:** `Header/index.tsx` uses a raw reset (`overflow = ""`) as a safety cleanup on mount — this is intentionally NOT using the hook.
|
|
359
|
-
|
|
360
|
-
### `useRedirectIfLoggedIn` — auth page guard (`src/hooks/useRedirectIfLoggedIn.ts`)
|
|
361
|
-
|
|
362
|
-
Redirects logged-in users away from auth pages (Login, Register, ForgotPassword, RecoverPassword).
|
|
363
|
-
Returns `isChecking: boolean` — render `null` while checking to avoid flash.
|
|
364
|
-
|
|
365
|
-
```tsx
|
|
366
|
-
import { useRedirectIfLoggedIn } from "../../hooks/useRedirectIfLoggedIn";
|
|
367
|
-
|
|
368
|
-
const isChecking = useRedirectIfLoggedIn(() => {
|
|
369
|
-
initLoginForm(loginForm);
|
|
370
|
-
});
|
|
371
|
-
if (isChecking) return null;
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
## Utility Modules (`src/utils/`)
|
|
375
|
-
|
|
376
|
-
### `cx()` — className joiner (`src/utils/cx.ts`)
|
|
377
|
-
|
|
378
|
-
**CRITICAL: Use `cx()` for conditional className assembly.** Never use template literal ternaries for conditional classes.
|
|
379
|
-
|
|
380
|
-
Wrong: `className={\`base ${cond ? "modifier" : ""}\`}`Correct:`className={cx("base", cond && "modifier")}`
|
|
381
|
-
|
|
382
|
-
Import: `import { cx } from "../../utils/cx";`
|
|
383
|
-
|
|
384
|
-
### `getSelectValuePrice()` — option price formatter (`src/utils/optionPrice.ts`)
|
|
385
|
-
|
|
386
|
-
Formats price for product option select values. Used by ChoiceBox, ChoiceSelect, ChoiceSwatch.
|
|
387
|
-
|
|
388
|
-
### `isBundleOutOfStock()` — bundle helpers (`src/utils/bundle.ts`)
|
|
389
|
-
|
|
390
|
-
Bundle validation logic shared across ProductDetailAddToCart and ProductDetailPrices.
|
|
391
|
-
|
|
392
|
-
## Key Patterns
|
|
393
|
-
|
|
394
|
-
### Component Exports & Reactivity
|
|
395
|
-
|
|
396
|
-
```tsx
|
|
397
|
-
// Root components are automatically reactive — the ikas runtime wraps them in autorun().
|
|
398
|
-
// Do NOT import or use observer() on root exports.
|
|
399
|
-
import { Props } from "./types";
|
|
400
|
-
|
|
401
|
-
export function MySection({ product }: Props) { ... }
|
|
402
|
-
export default MySection;
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
```tsx
|
|
406
|
-
// Only use observer() on extracted SUB-COMPONENTS that independently read MobX stores:
|
|
407
|
-
import { observer } from "@ikas/component-utils";
|
|
408
|
-
|
|
409
|
-
const CartBadge = observer(function CartBadge() {
|
|
410
|
-
const count = cartStore.order?.orderLineItems?.length ?? 0;
|
|
411
|
-
return <span>{count}</span>;
|
|
412
|
-
});
|
|
413
|
-
```
|
|
414
|
-
|
|
415
|
-
```tsx
|
|
416
|
-
// ALSO wrap EXTRACTED HELPER COMPONENTS declared inside a component file —
|
|
417
|
-
// especially list items rendered via .map() that read/write MobX state
|
|
418
|
-
// (e.g., offer.isSelected, option.values). Without observer(), the helper
|
|
419
|
-
// won't re-render when the observable changes.
|
|
420
|
-
const OfferCard = observer(function OfferCard({ offer }) {
|
|
421
|
-
const isSelected = offer.isSelected;
|
|
422
|
-
return <div>{isSelected ? "ON" : "OFF"}</div>;
|
|
423
|
-
});
|
|
424
|
-
|
|
425
|
-
export function MySection({ product }: Props) {
|
|
426
|
-
return product.offers.map((offer) => (
|
|
427
|
-
<OfferCard key={offer.id} offer={offer} />
|
|
428
|
-
));
|
|
429
|
-
}
|
|
430
|
-
```
|
|
431
|
-
|
|
432
|
-
**Rule of thumb:** if a non-root component reads or writes MobX observables (store fields, `offer.isSelected`, `option.values`, etc.), wrap it with `observer()`. Without it, MobX mutations won't trigger re-renders.
|
|
433
|
-
|
|
434
|
-
### Null Safety
|
|
435
|
-
|
|
436
|
-
```tsx
|
|
437
|
-
// Storefront models can be null — always check before accessing
|
|
438
|
-
if (!product) return null;
|
|
439
|
-
const price = product.selectedVariant?.price?.formattedPrice ?? "";
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
### Mutations
|
|
443
|
-
|
|
444
|
-
```tsx
|
|
445
|
-
// Functions like addItemToCart() mutate the model in-place (MobX observable)
|
|
446
|
-
// No need to capture return value — root components re-render automatically via autorun()
|
|
447
|
-
await addItemToCart({ product });
|
|
448
|
-
```
|
|
449
|
-
|
|
450
|
-
### CSS Scoping
|
|
451
|
-
|
|
452
|
-
All CSS is auto-scoped with `.cc_{componentId}` prefix. Write plain class names — they are scoped at build time.
|
|
453
|
-
|
|
454
|
-
### Preact Event Handling
|
|
455
|
-
|
|
456
|
-
Use `onInput` instead of `onChange` for text inputs (Preact behavior).
|
|
457
|
-
|
|
458
|
-
### Import Source
|
|
459
|
-
|
|
460
|
-
```tsx
|
|
461
|
-
import { addItemToCart, IkasProduct, IkasImage } from "@ikas/bp-storefront";
|
|
462
|
-
```
|
|
463
|
-
|
|
464
|
-
## No Static Text Rule
|
|
465
|
-
|
|
466
|
-
**CRITICAL: Never hardcode user-visible text in JSX.** All text strings (headings, button labels,
|
|
467
|
-
empty states, loading messages, form labels) MUST be TEXT props with defaultValues.
|
|
468
|
-
|
|
469
|
-
Wrong: `<h1>Sign In</h1>`
|
|
470
|
-
Correct: `<h1>{title}</h1>` with `title` as TEXT prop (defaultValue: "Sign In")
|
|
471
|
-
|
|
472
|
-
For button loading states, use two separate props:
|
|
473
|
-
|
|
474
|
-
- `submitButtonText` (default: "Sign In")
|
|
475
|
-
- `submittingButtonText` (default: "Signing in...")
|
|
476
|
-
|
|
477
|
-
Group text props under a "Texts" propGroup when the component has 5+ props.
|
|
478
|
-
|
|
479
|
-
**Assistive strings (`aria-label`, `aria-describedby`, `alt`, sr-only text):** if the string is meaningful to end users (e.g. icon-only button label, product image alt), make it a TEXT prop. English literal defaults are acceptable for purely structural labels a merchant would never want to change (e.g. `role="dialog" aria-modal="true"`). When in doubt, make it a prop.
|
|
480
|
-
|
|
481
|
-
## Sections vs Components
|
|
482
|
-
|
|
483
|
-
- **Sections** = page-level, full-width containers (Header, Hero, Product Grid, Footer).
|
|
484
|
-
Set `"type": "section"` via CLI. Use `<section>` root element. Props interface: `Props`.
|
|
485
|
-
**Sections MUST use `kombos-container` for max-width.** The `<section>` root stays full-width (for background color),
|
|
486
|
-
but all inner content MUST be wrapped in a `<div className="kombos-container">` (or added to an existing inner div).
|
|
487
|
-
This limits content to `var(--kombos-max-width)` (1500px) and centers it with `margin: auto`.
|
|
488
|
-
Padding/layout styles go on the container wrapper, NOT on the `<section>` root.
|
|
489
|
-
**Exceptions:** Header (sticky, renders child components via IkasComponentRenderer) and HeroSlider (full-width by design) do NOT use the container.
|
|
490
|
-
- **Components** = child elements placed inside sections (buttons, cards, badges).
|
|
491
|
-
Defaults to `"component"`. Use `<div>` root element. Props interface: `Props`.
|
|
492
|
-
|
|
493
|
-
## Prop Groups
|
|
494
|
-
|
|
495
|
-
Organize props into collapsible groups in the editor sidebar. Use prop groups when a component has 5+ props to improve UX.
|
|
496
|
-
|
|
497
|
-
### Config Format
|
|
498
|
-
|
|
499
|
-
- Define groups in `propGroups` array on the component in `ikas.config.json`
|
|
500
|
-
- Assign props to groups via `groupId` on each prop
|
|
501
|
-
- Groups can nest 1 level deep via `children`
|
|
502
|
-
- Props without `groupId` appear ungrouped at root level
|
|
503
|
-
- Group IDs must be unique within a component
|
|
504
|
-
- **NEVER assign `COMPONENT` or `COMPONENT_LIST` props to a prop group** — they don't render in the editor sidebar, so grouping them is meaningless. Leave them ungrouped at root level.
|
|
505
|
-
|
|
506
|
-
### CLI Commands
|
|
507
|
-
|
|
508
|
-
- `config add-prop-group --component "Name" --id content --name "Content"` — create group
|
|
509
|
-
- `config add-prop-group --component "Name" --id colors --name "Colors" --parent style` — create nested group
|
|
510
|
-
- `config add-prop --component "Name" --name title --displayName "Title" --type TEXT --group content` — add prop to group
|
|
511
|
-
- `config update-prop --component "Name" --prop title --group colors` — move prop to different group
|
|
512
|
-
- `config remove-prop-group --component "Name" --id content` — remove group (props become ungrouped)
|
|
513
|
-
|
|
514
|
-
### When to Use
|
|
515
|
-
|
|
516
|
-
- 5+ props → group related props
|
|
517
|
-
- Sections with content + style props → separate "Content" and "Appearance" groups
|
|
518
|
-
- Complex sections → use nested groups (e.g., "Style" → "Colors", "Typography")
|
|
519
|
-
|
|
520
|
-
## Workflow Addition
|
|
521
|
-
|
|
522
|
-
When building a section with 5+ props, organize into prop groups after defining props:
|
|
523
|
-
|
|
524
|
-
```bash
|
|
525
|
-
npx ikas-component config add-prop-group --component "Name" --id content --name "Content"
|
|
526
|
-
npx ikas-component config update-prop --component "Name" --prop title --group content
|
|
527
|
-
```
|
|
528
|
-
|
|
529
|
-
## Global Z-Index (Kombos Design System)
|
|
530
|
-
|
|
531
|
-
**CRITICAL: Never hardcode `z-index` values in component CSS.**
|
|
532
|
-
All z-index levels are defined as CSS custom properties in `src/global.css` under `:root`.
|
|
533
|
-
|
|
534
|
-
| Variable | Value | Usage |
|
|
535
|
-
| --------------------- | ----- | -------------------------------------------- |
|
|
536
|
-
| `--kombos-z-dropdown` | 50 | Dropdown menus |
|
|
537
|
-
| `--kombos-z-header` | 100 | Sticky header |
|
|
538
|
-
| `--kombos-z-overlay` | 200 | Overlays (cart sidebar, mobile menu, modals) |
|
|
539
|
-
|
|
540
|
-
```css
|
|
541
|
-
.my-dropdown {
|
|
542
|
-
z-index: var(--kombos-z-dropdown);
|
|
543
|
-
}
|
|
544
|
-
.my-header {
|
|
545
|
-
z-index: var(--kombos-z-header);
|
|
546
|
-
}
|
|
547
|
-
.my-overlay {
|
|
548
|
-
z-index: var(--kombos-z-overlay);
|
|
549
|
-
}
|
|
550
|
-
```
|
|
551
|
-
|
|
552
|
-
## Global Colors (Kombos Design System)
|
|
553
|
-
|
|
554
|
-
**CRITICAL: Never hardcode hex color values in component CSS.**
|
|
555
|
-
All colors are defined as CSS custom properties in `src/global.css` under `:root`.
|
|
556
|
-
Use `var(--kombos-*)` in component CSS. Only `rgba()` values for overlays/shadows are exempt.
|
|
557
|
-
|
|
558
|
-
### Available Variables
|
|
559
|
-
|
|
560
|
-
| Variable | Hex | Usage |
|
|
561
|
-
| ------------------- | ------- | ----------------------------------- |
|
|
562
|
-
| `--kombos-white` | #ffffff | Backgrounds, text on dark |
|
|
563
|
-
| `--kombos-gray-50` | #fafafa | Hover backgrounds |
|
|
564
|
-
| `--kombos-gray-100` | #f6f6f6 | Light borders, image placeholders |
|
|
565
|
-
| `--kombos-gray-200` | #ececed | Separator borders |
|
|
566
|
-
| `--kombos-gray-300` | #c4c4c6 | Disabled/muted borders, muted icons |
|
|
567
|
-
| `--kombos-gray-400` | #9c9c9f | Placeholder/empty state text |
|
|
568
|
-
| `--kombos-gray-500` | #727276 | Secondary text (sublinks, captions) |
|
|
569
|
-
| `--kombos-gray-600` | #4a4a4f | — |
|
|
570
|
-
| `--kombos-gray-700` | #2e2e33 | Primary text, icons |
|
|
571
|
-
| `--kombos-gray-800` | #202025 | — |
|
|
572
|
-
| `--kombos-gray-900` | #14141a | Headings, buttons, badges |
|
|
573
|
-
| `--kombos-badge-bg` | #ff0000 | Cart badge background |
|
|
574
|
-
|
|
575
|
-
### Usage in CSS
|
|
576
|
-
|
|
577
|
-
```css
|
|
578
|
-
.my-section__title {
|
|
579
|
-
color: var(--kombos-gray-900);
|
|
580
|
-
}
|
|
581
|
-
.my-section__border {
|
|
582
|
-
border: 1px solid var(--kombos-gray-100);
|
|
583
|
-
}
|
|
584
|
-
.my-section__btn {
|
|
585
|
-
background: var(--kombos-gray-900);
|
|
586
|
-
color: var(--kombos-white);
|
|
587
|
-
}
|
|
588
|
-
.my-section__btn:hover {
|
|
589
|
-
background: var(--kombos-gray-700);
|
|
590
|
-
}
|
|
591
|
-
```
|
|
592
|
-
|
|
593
|
-
### Rules
|
|
594
|
-
|
|
595
|
-
- Every color in component CSS MUST use a `var(--kombos-*)` variable
|
|
596
|
-
- Only exception: `rgba()` for overlays (`rgba(0,0,0,0.35)`) and box-shadows
|
|
597
|
-
- When props provide dynamic colors (e.g., `backgroundColor`, `textColor`), apply via inline `style` in JSX — CSS variables are for static/design-system colors only
|
|
598
|
-
|
|
599
|
-
## Global Typography (Kombos Design System)
|
|
600
|
-
|
|
601
|
-
**CRITICAL: Never write `font-family`, `font-weight`, `font-size`, or `line-height` in component CSS.**
|
|
602
|
-
All typography is defined as utility classes in `src/global.css`. Apply them via `className` in JSX.
|
|
603
|
-
|
|
604
|
-
**`font-family` is NOT set by typography classes.** The storefront injects a global `* { font-family: ... }` rule
|
|
605
|
-
which acts as the base font. Our typography classes only control `font-weight`, `font-size`, and `line-height`.
|
|
606
|
-
Never add `font-family` in component CSS or global typography classes — let the storefront's global font cascade through.
|
|
607
|
-
|
|
608
|
-
Font: **Montserrat** | Weights: Regular 400, Medium 500, Semibold 600
|
|
609
|
-
|
|
610
|
-
### Class Naming Convention
|
|
611
|
-
|
|
612
|
-
```
|
|
613
|
-
{scale}-{size}-{weight}
|
|
614
|
-
```
|
|
615
|
-
|
|
616
|
-
- **Scale:** `display` (large headings) or `text` (body/UI text)
|
|
617
|
-
- **Size:** `xxl`, `xl`, `lg`, `md`, `sm`, `xs`
|
|
618
|
-
- **Weight:** `regular`, `medium`, `semibold`
|
|
619
|
-
- **Special variants:** append `-strike` (line-through) or `-underline`
|
|
620
|
-
|
|
621
|
-
### Available Classes & Sizes
|
|
622
|
-
|
|
623
|
-
| Class prefix | Font size | Line height |
|
|
624
|
-
| --------------- | --------- | ----------- |
|
|
625
|
-
| `display-xxl-*` | 72px | 90px |
|
|
626
|
-
| `display-xl-*` | 60px | 72px |
|
|
627
|
-
| `display-lg-*` | 48px | 60px |
|
|
628
|
-
| `display-md-*` | 36px | 44px |
|
|
629
|
-
| `display-sm-*` | 30px | 38px |
|
|
630
|
-
| `display-xs-*` | 24px | 32px |
|
|
631
|
-
| `text-xl-*` | 20px | 30px |
|
|
632
|
-
| `text-lg-*` | 18px | 28px |
|
|
633
|
-
| `text-md-*` | 16px | 24px |
|
|
634
|
-
| `text-sm-*` | 14px | 20px |
|
|
635
|
-
| `text-xs-*` | 12px | 18px |
|
|
636
|
-
|
|
637
|
-
### Usage in JSX
|
|
638
|
-
|
|
639
|
-
```tsx
|
|
640
|
-
// Combine component class with typography class
|
|
641
|
-
<h1 className="my-section__title display-sm-semibold">{title}</h1>
|
|
642
|
-
<p className="my-section__desc text-md-regular">{description}</p>
|
|
643
|
-
<a className="my-section__link text-sm-medium">{label}</a>
|
|
644
|
-
<button className="my-section__btn text-md-semibold">{buttonText}</button>
|
|
645
|
-
```
|
|
646
|
-
|
|
647
|
-
### Responsive Prefixes (Tailwind-style)
|
|
648
|
-
|
|
649
|
-
- No prefix = mobile/base (all breakpoints)
|
|
650
|
-
- `sm:` = 640px+
|
|
651
|
-
- `md:` = 768px+
|
|
652
|
-
- `lg:` = 1024px+
|
|
653
|
-
|
|
654
|
-
Usage: `className="text-sm-medium md:text-md-medium lg:text-lg-medium"`
|
|
655
|
-
This renders `text-sm` on mobile, `text-md` on 768px+, `text-lg` on 1024px+.
|
|
656
|
-
|
|
657
|
-
### Rules
|
|
658
|
-
|
|
659
|
-
- Every visible text element MUST have a typography class in its `className`
|
|
660
|
-
- Component CSS handles layout, spacing, color, decoration — NOT font properties
|
|
661
|
-
- Only exception: elements with non-standard sizes not in the scale (e.g., 10px badge, 22px logo text) can use inline font properties in component CSS
|
|
662
|
-
- Use responsive prefixes (`sm:`, `md:`, `lg:`) instead of writing font-size media queries in component CSS
|
|
663
|
-
|
|
664
|
-
## Responsive Breakpoints
|
|
665
|
-
|
|
666
|
-
All components use a **mobile-first** approach with three breakpoints: **640px**, **768px**, and **1024px**.
|
|
667
|
-
|
|
668
|
-
- Base styles → Small mobile (< 640px: tightest padding, minimal layout)
|
|
669
|
-
- `≥ 640px` → Small tablet (slightly wider padding)
|
|
670
|
-
- `≥ 768px` → Tablet (hamburger menu, mobile logo size, medium padding)
|
|
671
|
-
- `≥ 1024px` → Desktop (full nav, desktop logo size, wider padding)
|
|
672
|
-
|
|
673
|
-
```css
|
|
674
|
-
/* Mobile-first: base styles are small mobile, then scale up */
|
|
675
|
-
.my-section__element {
|
|
676
|
-
padding: 0.625rem 1rem;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
@media (min-width: 768px) {
|
|
680
|
-
.my-section__element {
|
|
681
|
-
padding: 0.75rem 2rem;
|
|
682
|
-
}
|
|
683
|
-
/* tablet adjustments */
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
@media (min-width: 1024px) {
|
|
687
|
-
.my-section__element {
|
|
688
|
-
padding: 0.75rem 4.5rem;
|
|
689
|
-
}
|
|
690
|
-
/* full nav visible, desktop logo size, wider padding */
|
|
691
|
-
}
|
|
692
|
-
```
|
|
693
|
-
|
|
694
|
-
## CSS Units — rem Convention
|
|
695
|
-
|
|
696
|
-
**CRITICAL: Use `rem` for all spacing and sizing values. Keep `px` only for borders, border-radius, box-shadow, and outlines.**
|
|
697
|
-
|
|
698
|
-
Base: `16px = 1rem`. Figma gives pixel values — convert with `value / 16`.
|
|
699
|
-
|
|
700
|
-
### Convert to rem
|
|
701
|
-
|
|
702
|
-
- `font-size`, `line-height`
|
|
703
|
-
- `padding`, `margin` (all sides)
|
|
704
|
-
- `gap`, `row-gap`, `column-gap`
|
|
705
|
-
- `width`, `height`, `max-width`, `max-height`, `min-width`, `min-height`
|
|
706
|
-
- `top`, `right`, `bottom`, `left`
|
|
707
|
-
- CSS custom properties for spacing/sizing
|
|
708
|
-
|
|
709
|
-
### Keep as px
|
|
710
|
-
|
|
711
|
-
- `border`, `border-width` (1px, 2px borders)
|
|
712
|
-
- `border-radius`
|
|
713
|
-
- `box-shadow`
|
|
714
|
-
- `outline`
|
|
715
|
-
- `@media` breakpoints (640px, 768px, 1024px)
|
|
716
|
-
|
|
717
|
-
### Common Conversions (Figma px → CSS rem)
|
|
718
|
-
|
|
719
|
-
| px | rem | | px | rem |
|
|
720
|
-
| --- | ----- | --- | --- | ----- |
|
|
721
|
-
| 4 | 0.25 | | 24 | 1.5 |
|
|
722
|
-
| 6 | 0.375 | | 28 | 1.75 |
|
|
723
|
-
| 8 | 0.5 | | 30 | 1.875 |
|
|
724
|
-
| 10 | 0.625 | | 32 | 2 |
|
|
725
|
-
| 12 | 0.75 | | 36 | 2.25 |
|
|
726
|
-
| 14 | 0.875 | | 40 | 2.5 |
|
|
727
|
-
| 16 | 1 | | 48 | 3 |
|
|
728
|
-
| 18 | 1.125 | | 60 | 3.75 |
|
|
729
|
-
| 20 | 1.25 | | 72 | 4.5 |
|
|
730
|
-
|
|
731
|
-
```css
|
|
732
|
-
/* Correct */
|
|
733
|
-
.my-section {
|
|
734
|
-
padding: 1rem 1.5rem;
|
|
735
|
-
gap: 0.75rem;
|
|
736
|
-
}
|
|
737
|
-
.my-section {
|
|
738
|
-
border: 1px solid var(--kombos-gray-200);
|
|
739
|
-
border-radius: 6px;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
/* Wrong */
|
|
743
|
-
.my-section {
|
|
744
|
-
padding: 16px 24px;
|
|
745
|
-
gap: 12px;
|
|
746
|
-
}
|
|
747
|
-
```
|
|
748
|
-
|
|
749
|
-
## Build Verification
|
|
750
|
-
|
|
751
|
-
IMPORTANT: After completing any task, always run `npx ikas-component build` (or `npm run build`) to check for
|
|
752
|
-
TypeScript and build errors. Fix any errors before considering the task done.
|