@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.
Files changed (386) hide show
  1. package/dist/commands/config.d.ts.map +1 -1
  2. package/dist/commands/config.js +385 -5
  3. package/dist/commands/config.js.map +1 -1
  4. package/dist/commands/create.d.ts.map +1 -1
  5. package/dist/commands/create.js +118 -43
  6. package/dist/commands/create.js.map +1 -1
  7. package/dist/commands/dev.d.ts.map +1 -1
  8. package/dist/commands/dev.js +135 -5
  9. package/dist/commands/dev.js.map +1 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +2 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/utils/component-helpers.d.ts +5 -0
  14. package/dist/utils/component-helpers.d.ts.map +1 -1
  15. package/dist/utils/component-helpers.js +14 -1
  16. package/dist/utils/component-helpers.js.map +1 -1
  17. package/dist/utils/template.d.ts +12 -0
  18. package/dist/utils/template.d.ts.map +1 -1
  19. package/dist/utils/template.js +44 -0
  20. package/dist/utils/template.js.map +1 -1
  21. package/dist/utils/websocket-server.d.ts +26 -0
  22. package/dist/utils/websocket-server.d.ts.map +1 -1
  23. package/dist/utils/websocket-server.js +42 -0
  24. package/dist/utils/websocket-server.js.map +1 -1
  25. package/package.json +3 -2
  26. package/templates/create/claude-md +2 -1
  27. package/templates/create/cursorrules +1 -1
  28. package/templates/create/package.json +1 -0
  29. package/templates/create/src/components/ExampleComponent/types.ts +1 -1
  30. package/templates/create/src/components/ExampleSection/types.ts +1 -1
  31. package/templates/create-full/README.md +78 -0
  32. package/templates/create-full/cursorrules +103 -0
  33. package/templates/create-full/gitignore +4 -0
  34. package/templates/create-full/ikas.config.json +5007 -0
  35. package/templates/create-full/mcp.json +10 -0
  36. package/templates/create-full/package.json +22 -0
  37. package/templates/create-full/src/components/AccountAddresses/components/AddressCard/index.tsx +55 -0
  38. package/templates/create-full/src/components/AccountAddresses/components/AddressCard/styles.css +46 -0
  39. package/templates/create-full/src/components/AccountAddresses/components/AddressModal/index.tsx +301 -0
  40. package/templates/create-full/src/components/AccountAddresses/components/AddressModal/styles.css +22 -0
  41. package/templates/create-full/src/components/AccountAddresses/index.tsx +127 -0
  42. package/templates/create-full/src/components/AccountAddresses/styles.css +41 -0
  43. package/templates/create-full/src/components/AccountAddresses/types.ts +15 -0
  44. package/templates/create-full/src/components/AccountFavorites/index.tsx +82 -0
  45. package/templates/create-full/src/components/AccountFavorites/styles.css +52 -0
  46. package/templates/create-full/src/components/AccountFavorites/types.ts +7 -0
  47. package/templates/create-full/src/components/AccountInfo/components/AccountSidebar/index.tsx +171 -0
  48. package/templates/create-full/src/components/AccountInfo/components/AccountSidebar/styles.css +144 -0
  49. package/templates/create-full/src/components/AccountInfo/index.tsx +91 -0
  50. package/templates/create-full/src/components/AccountInfo/styles.css +35 -0
  51. package/templates/create-full/src/components/AccountInfo/types.ts +9 -0
  52. package/templates/create-full/src/components/AccountInfoContent/index.tsx +134 -0
  53. package/templates/create-full/src/components/AccountInfoContent/styles.css +57 -0
  54. package/templates/create-full/src/components/AccountInfoContent/types.ts +8 -0
  55. package/templates/create-full/src/components/AccountOrderDetail/components/OrderHeader/index.tsx +78 -0
  56. package/templates/create-full/src/components/AccountOrderDetail/components/OrderHeader/styles.css +46 -0
  57. package/templates/create-full/src/components/AccountOrderDetail/components/OrderItemRow/index.tsx +20 -0
  58. package/templates/create-full/src/components/AccountOrderDetail/components/OrderItemRow/styles.css +16 -0
  59. package/templates/create-full/src/components/AccountOrderDetail/components/OrderLineItemDisplay/index.tsx +112 -0
  60. package/templates/create-full/src/components/AccountOrderDetail/components/OrderLineItemDisplay/styles.css +86 -0
  61. package/templates/create-full/src/components/AccountOrderDetail/components/OrderSidebar/index.tsx +195 -0
  62. package/templates/create-full/src/components/AccountOrderDetail/components/OrderSidebar/styles.css +93 -0
  63. package/templates/create-full/src/components/AccountOrderDetail/components/PackageGroup/index.tsx +156 -0
  64. package/templates/create-full/src/components/AccountOrderDetail/components/PackageGroup/styles.css +100 -0
  65. package/templates/create-full/src/components/AccountOrderDetail/components/ReturnItemRow/index.tsx +56 -0
  66. package/templates/create-full/src/components/AccountOrderDetail/components/ReturnItemRow/styles.css +57 -0
  67. package/templates/create-full/src/components/AccountOrderDetail/components/ReturnView/index.tsx +159 -0
  68. package/templates/create-full/src/components/AccountOrderDetail/components/ReturnView/styles.css +29 -0
  69. package/templates/create-full/src/components/AccountOrderDetail/index.tsx +244 -0
  70. package/templates/create-full/src/components/AccountOrderDetail/styles.css +125 -0
  71. package/templates/create-full/src/components/AccountOrderDetail/types.ts +32 -0
  72. package/templates/create-full/src/components/AccountOrders/components/OrderCard/index.tsx +122 -0
  73. package/templates/create-full/src/components/AccountOrders/components/OrderCard/styles.css +114 -0
  74. package/templates/create-full/src/components/AccountOrders/index.tsx +105 -0
  75. package/templates/create-full/src/components/AccountOrders/styles.css +36 -0
  76. package/templates/create-full/src/components/AccountOrders/types.ts +11 -0
  77. package/templates/create-full/src/components/Announcement/index.tsx +11 -0
  78. package/templates/create-full/src/components/Announcement/styles.css +4 -0
  79. package/templates/create-full/src/components/Announcement/types.ts +4 -0
  80. package/templates/create-full/src/components/Announcements/index.tsx +91 -0
  81. package/templates/create-full/src/components/Announcements/styles.css +45 -0
  82. package/templates/create-full/src/components/Announcements/types.ts +8 -0
  83. package/templates/create-full/src/components/BlogHome/components/BlogCard/index.tsx +89 -0
  84. package/templates/create-full/src/components/BlogHome/components/BlogCard/styles.css +121 -0
  85. package/templates/create-full/src/components/BlogHome/index.tsx +124 -0
  86. package/templates/create-full/src/components/BlogHome/styles.css +118 -0
  87. package/templates/create-full/src/components/BlogHome/types.ts +15 -0
  88. package/templates/create-full/src/components/BlogPost/index.tsx +128 -0
  89. package/templates/create-full/src/components/BlogPost/styles.css +120 -0
  90. package/templates/create-full/src/components/BlogPost/types.ts +12 -0
  91. package/templates/create-full/src/components/CardProductName/index.tsx +25 -0
  92. package/templates/create-full/src/components/CardProductName/styles.css +22 -0
  93. package/templates/create-full/src/components/CardProductName/types.ts +7 -0
  94. package/templates/create-full/src/components/CardProductPrice/index.tsx +30 -0
  95. package/templates/create-full/src/components/CardProductPrice/styles.css +13 -0
  96. package/templates/create-full/src/components/CardProductPrice/types.ts +6 -0
  97. package/templates/create-full/src/components/CardProductVariants/index.tsx +10 -0
  98. package/templates/create-full/src/components/CardProductVariants/styles.css +1 -0
  99. package/templates/create-full/src/components/CardProductVariants/types.ts +6 -0
  100. package/templates/create-full/src/components/CartPage/components/CouponCode/index.tsx +108 -0
  101. package/templates/create-full/src/components/CartPage/components/CouponCode/styles.css +68 -0
  102. package/templates/create-full/src/components/CartPage/components/EmptyState/index.tsx +31 -0
  103. package/templates/create-full/src/components/CartPage/components/EmptyState/styles.css +18 -0
  104. package/templates/create-full/src/components/CartPage/components/OrderSummary/index.tsx +106 -0
  105. package/templates/create-full/src/components/CartPage/components/OrderSummary/styles.css +70 -0
  106. package/templates/create-full/src/components/CartPage/index.tsx +107 -0
  107. package/templates/create-full/src/components/CartPage/styles.css +54 -0
  108. package/templates/create-full/src/components/CartPage/types.ts +16 -0
  109. package/templates/create-full/src/components/CategoryImageItem/components/Card/index.tsx +64 -0
  110. package/templates/create-full/src/components/CategoryImageItem/components/Card/styles.css +56 -0
  111. package/templates/create-full/src/components/CategoryImageItem/index.tsx +64 -0
  112. package/templates/create-full/src/components/CategoryImageItem/styles.css +10 -0
  113. package/templates/create-full/src/components/CategoryImageItem/types.ts +16 -0
  114. package/templates/create-full/src/components/CategoryImages/index.tsx +62 -0
  115. package/templates/create-full/src/components/CategoryImages/styles.css +38 -0
  116. package/templates/create-full/src/components/CategoryImages/types.ts +11 -0
  117. package/templates/create-full/src/components/CategoryList/components/CategoryListControls/index.tsx +129 -0
  118. package/templates/create-full/src/components/CategoryList/components/CategoryListControls/styles.css +99 -0
  119. package/templates/create-full/src/components/CategoryList/components/FilterBoxValues/index.tsx +42 -0
  120. package/templates/create-full/src/components/CategoryList/components/FilterBoxValues/styles.css +27 -0
  121. package/templates/create-full/src/components/CategoryList/components/FilterCategoryList/index.tsx +43 -0
  122. package/templates/create-full/src/components/CategoryList/components/FilterCategoryList/styles.css +20 -0
  123. package/templates/create-full/src/components/CategoryList/components/FilterGroupValues/index.tsx +114 -0
  124. package/templates/create-full/src/components/CategoryList/components/FilterGroupValues/styles.css +1 -0
  125. package/templates/create-full/src/components/CategoryList/components/FilterListValues/index.tsx +54 -0
  126. package/templates/create-full/src/components/CategoryList/components/FilterListValues/styles.css +22 -0
  127. package/templates/create-full/src/components/CategoryList/components/FilterRangeListValues/index.tsx +50 -0
  128. package/templates/create-full/src/components/CategoryList/components/FilterRangeListValues/styles.css +25 -0
  129. package/templates/create-full/src/components/CategoryList/components/FilterRangeValues/index.tsx +189 -0
  130. package/templates/create-full/src/components/CategoryList/components/FilterRangeValues/styles.css +89 -0
  131. package/templates/create-full/src/components/CategoryList/components/FilterSidebar/index.tsx +92 -0
  132. package/templates/create-full/src/components/CategoryList/components/FilterSidebar/styles.css +27 -0
  133. package/templates/create-full/src/components/CategoryList/components/FilterSwatchValues/index.tsx +63 -0
  134. package/templates/create-full/src/components/CategoryList/components/FilterSwatchValues/styles.css +48 -0
  135. package/templates/create-full/src/components/CategoryList/components/MobileFilterModal/index.tsx +146 -0
  136. package/templates/create-full/src/components/CategoryList/components/MobileFilterModal/styles.css +133 -0
  137. package/templates/create-full/src/components/CategoryList/index.tsx +333 -0
  138. package/templates/create-full/src/components/CategoryList/styles.css +110 -0
  139. package/templates/create-full/src/components/CategoryList/types.ts +30 -0
  140. package/templates/create-full/src/components/CollapsibleContent/index.tsx +23 -0
  141. package/templates/create-full/src/components/CollapsibleContent/styles.css +11 -0
  142. package/templates/create-full/src/components/CollapsibleContent/types.ts +6 -0
  143. package/templates/create-full/src/components/CookieBar/index.tsx +78 -0
  144. package/templates/create-full/src/components/CookieBar/styles.css +111 -0
  145. package/templates/create-full/src/components/CookieBar/types.ts +10 -0
  146. package/templates/create-full/src/components/CustomerEmailVerification/index.tsx +168 -0
  147. package/templates/create-full/src/components/CustomerEmailVerification/styles.css +118 -0
  148. package/templates/create-full/src/components/CustomerEmailVerification/types.ts +17 -0
  149. package/templates/create-full/src/components/FeatureItem/index.tsx +27 -0
  150. package/templates/create-full/src/components/FeatureItem/styles.css +19 -0
  151. package/templates/create-full/src/components/FeatureItem/types.ts +7 -0
  152. package/templates/create-full/src/components/Features/index.tsx +25 -0
  153. package/templates/create-full/src/components/Features/styles.css +39 -0
  154. package/templates/create-full/src/components/Features/types.ts +5 -0
  155. package/templates/create-full/src/components/Footer/index.tsx +154 -0
  156. package/templates/create-full/src/components/Footer/styles.css +175 -0
  157. package/templates/create-full/src/components/Footer/types.ts +15 -0
  158. package/templates/create-full/src/components/ForgotPassword/components/ForgotPasswordForm/index.tsx +129 -0
  159. package/templates/create-full/src/components/ForgotPassword/components/ForgotPasswordForm/styles.css +0 -0
  160. package/templates/create-full/src/components/ForgotPassword/index.tsx +30 -0
  161. package/templates/create-full/src/components/ForgotPassword/styles.css +85 -0
  162. package/templates/create-full/src/components/ForgotPassword/types.ts +13 -0
  163. package/templates/create-full/src/components/Header/index.tsx +53 -0
  164. package/templates/create-full/src/components/Header/styles.css +6 -0
  165. package/templates/create-full/src/components/Header/types.ts +6 -0
  166. package/templates/create-full/src/components/HeroSlider/index.tsx +110 -0
  167. package/templates/create-full/src/components/HeroSlider/styles.css +129 -0
  168. package/templates/create-full/src/components/HeroSlider/types.ts +9 -0
  169. package/templates/create-full/src/components/HeroSliderItem/index.tsx +231 -0
  170. package/templates/create-full/src/components/HeroSliderItem/styles.css +152 -0
  171. package/templates/create-full/src/components/HeroSliderItem/types.ts +34 -0
  172. package/templates/create-full/src/components/Login/components/LoginForm/index.tsx +181 -0
  173. package/templates/create-full/src/components/Login/components/LoginForm/styles.css +0 -0
  174. package/templates/create-full/src/components/Login/index.tsx +37 -0
  175. package/templates/create-full/src/components/Login/styles.css +129 -0
  176. package/templates/create-full/src/components/Login/types.ts +18 -0
  177. package/templates/create-full/src/components/Navbar/components/CartSidebar/index.tsx +203 -0
  178. package/templates/create-full/src/components/Navbar/components/CartSidebar/styles.css +175 -0
  179. package/templates/create-full/src/components/Navbar/components/MobileMenu/index.tsx +198 -0
  180. package/templates/create-full/src/components/Navbar/components/MobileMenu/styles.css +122 -0
  181. package/templates/create-full/src/components/Navbar/components/NavItem/index.tsx +65 -0
  182. package/templates/create-full/src/components/Navbar/components/SearchModal/index.tsx +267 -0
  183. package/templates/create-full/src/components/Navbar/components/SearchModal/styles.css +182 -0
  184. package/templates/create-full/src/components/Navbar/index.tsx +250 -0
  185. package/templates/create-full/src/components/Navbar/styles.css +243 -0
  186. package/templates/create-full/src/components/Navbar/types.ts +37 -0
  187. package/templates/create-full/src/components/NotFound/index.tsx +39 -0
  188. package/templates/create-full/src/components/NotFound/styles.css +46 -0
  189. package/templates/create-full/src/components/NotFound/types.ts +8 -0
  190. package/templates/create-full/src/components/ProductDetail/components/ProductGallery/index.tsx +316 -0
  191. package/templates/create-full/src/components/ProductDetail/components/ProductGallery/styles.css +213 -0
  192. package/templates/create-full/src/components/ProductDetail/index.tsx +92 -0
  193. package/templates/create-full/src/components/ProductDetail/styles.css +58 -0
  194. package/templates/create-full/src/components/ProductDetail/types.ts +12 -0
  195. package/templates/create-full/src/components/ProductDetailAddToCart/components/PayWithIkas/index.tsx +34 -0
  196. package/templates/create-full/src/components/ProductDetailAddToCart/components/PayWithIkas/styles.css +4 -0
  197. package/templates/create-full/src/components/ProductDetailAddToCart/index.tsx +146 -0
  198. package/templates/create-full/src/components/ProductDetailAddToCart/styles.css +27 -0
  199. package/templates/create-full/src/components/ProductDetailAddToCart/types.ts +18 -0
  200. package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureRow/index.tsx +164 -0
  201. package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureSection/index.tsx +134 -0
  202. package/templates/create-full/src/components/ProductDetailBundleFurniture/components/BundleFurnitureSection/styles.css +188 -0
  203. package/templates/create-full/src/components/ProductDetailBundleFurniture/index.tsx +61 -0
  204. package/templates/create-full/src/components/ProductDetailBundleFurniture/styles.css +12 -0
  205. package/templates/create-full/src/components/ProductDetailBundleFurniture/types.ts +21 -0
  206. package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleProductItem/index.tsx +169 -0
  207. package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleProductItem/styles.css +141 -0
  208. package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleSkeletonLoading/index.tsx +35 -0
  209. package/templates/create-full/src/components/ProductDetailBundleProduct/components/BundleSkeletonLoading/styles.css +85 -0
  210. package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureRow/index.tsx +51 -0
  211. package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureRow/styles.css +30 -0
  212. package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureView/index.tsx +54 -0
  213. package/templates/create-full/src/components/ProductDetailBundleProduct/components/FurnitureView/styles.css +22 -0
  214. package/templates/create-full/src/components/ProductDetailBundleProduct/index.tsx +101 -0
  215. package/templates/create-full/src/components/ProductDetailBundleProduct/styles.css +20 -0
  216. package/templates/create-full/src/components/ProductDetailBundleProduct/types.ts +18 -0
  217. package/templates/create-full/src/components/ProductDetailDescription/index.tsx +56 -0
  218. package/templates/create-full/src/components/ProductDetailDescription/styles.css +21 -0
  219. package/templates/create-full/src/components/ProductDetailDescription/types.ts +13 -0
  220. package/templates/create-full/src/components/ProductDetailFeatureItem/index.tsx +28 -0
  221. package/templates/create-full/src/components/ProductDetailFeatureItem/styles.css +22 -0
  222. package/templates/create-full/src/components/ProductDetailFeatureItem/types.ts +7 -0
  223. package/templates/create-full/src/components/ProductDetailFeatures/index.tsx +40 -0
  224. package/templates/create-full/src/components/ProductDetailFeatures/styles.css +17 -0
  225. package/templates/create-full/src/components/ProductDetailFeatures/types.ts +10 -0
  226. package/templates/create-full/src/components/ProductDetailNameFavorite/index.tsx +66 -0
  227. package/templates/create-full/src/components/ProductDetailNameFavorite/styles.css +45 -0
  228. package/templates/create-full/src/components/ProductDetailNameFavorite/types.ts +11 -0
  229. package/templates/create-full/src/components/ProductDetailOffer/components/OfferCard/index.tsx +209 -0
  230. package/templates/create-full/src/components/ProductDetailOffer/components/OfferCard/styles.css +146 -0
  231. package/templates/create-full/src/components/ProductDetailOffer/components/OfferSummary/index.tsx +175 -0
  232. package/templates/create-full/src/components/ProductDetailOffer/index.tsx +199 -0
  233. package/templates/create-full/src/components/ProductDetailOffer/styles.css +211 -0
  234. package/templates/create-full/src/components/ProductDetailOffer/types.ts +24 -0
  235. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionCheckbox/index.tsx +52 -0
  236. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionCheckbox/styles.css +19 -0
  237. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceBox/index.tsx +60 -0
  238. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceBox/styles.css +38 -0
  239. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSelect/index.tsx +102 -0
  240. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSelect/styles.css +34 -0
  241. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSwatch/index.tsx +121 -0
  242. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/components/ChoiceSwatch/styles.css +87 -0
  243. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionChoice/index.tsx +57 -0
  244. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionColorPicker/index.tsx +54 -0
  245. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionColorPicker/styles.css +0 -0
  246. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionDatePicker/index.tsx +124 -0
  247. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionDatePicker/styles.css +1 -0
  248. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionFile/index.tsx +217 -0
  249. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionFile/styles.css +87 -0
  250. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionRenderer/index.tsx +133 -0
  251. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionText/index.tsx +60 -0
  252. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionText/styles.css +1 -0
  253. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionTextarea/index.tsx +74 -0
  254. package/templates/create-full/src/components/ProductDetailOptionSet/components/OptionTextarea/styles.css +10 -0
  255. package/templates/create-full/src/components/ProductDetailOptionSet/index.tsx +99 -0
  256. package/templates/create-full/src/components/ProductDetailOptionSet/styles.css +30 -0
  257. package/templates/create-full/src/components/ProductDetailOptionSet/types.ts +21 -0
  258. package/templates/create-full/src/components/ProductDetailPrices/index.tsx +62 -0
  259. package/templates/create-full/src/components/ProductDetailPrices/styles.css +32 -0
  260. package/templates/create-full/src/components/ProductDetailPrices/types.ts +10 -0
  261. package/templates/create-full/src/components/ProductDetailProductGroup/index.tsx +74 -0
  262. package/templates/create-full/src/components/ProductDetailProductGroup/styles.css +33 -0
  263. package/templates/create-full/src/components/ProductDetailProductGroup/types.ts +10 -0
  264. package/templates/create-full/src/components/ProductDetailReviews/index.tsx +205 -0
  265. package/templates/create-full/src/components/ProductDetailReviews/styles.css +43 -0
  266. package/templates/create-full/src/components/ProductDetailReviews/types.ts +19 -0
  267. package/templates/create-full/src/components/ProductDetailSku/index.tsx +38 -0
  268. package/templates/create-full/src/components/ProductDetailSku/styles.css +16 -0
  269. package/templates/create-full/src/components/ProductDetailSku/types.ts +11 -0
  270. package/templates/create-full/src/components/ProductDetailVariant/index.tsx +38 -0
  271. package/templates/create-full/src/components/ProductDetailVariant/styles.css +14 -0
  272. package/templates/create-full/src/components/ProductDetailVariant/types.ts +12 -0
  273. package/templates/create-full/src/components/ProductSlider/index.tsx +151 -0
  274. package/templates/create-full/src/components/ProductSlider/styles.css +105 -0
  275. package/templates/create-full/src/components/ProductSlider/types.ts +17 -0
  276. package/templates/create-full/src/components/RecoverPassword/components/RecoverPasswordForm/index.tsx +133 -0
  277. package/templates/create-full/src/components/RecoverPassword/components/RecoverPasswordForm/styles.css +0 -0
  278. package/templates/create-full/src/components/RecoverPassword/index.tsx +30 -0
  279. package/templates/create-full/src/components/RecoverPassword/styles.css +93 -0
  280. package/templates/create-full/src/components/RecoverPassword/types.ts +13 -0
  281. package/templates/create-full/src/components/Register/components/RegisterForm/index.tsx +326 -0
  282. package/templates/create-full/src/components/Register/components/RegisterForm/styles.css +0 -0
  283. package/templates/create-full/src/components/Register/index.tsx +30 -0
  284. package/templates/create-full/src/components/Register/styles.css +152 -0
  285. package/templates/create-full/src/components/Register/types.ts +27 -0
  286. package/templates/create-full/src/components/RichText/index.tsx +25 -0
  287. package/templates/create-full/src/components/RichText/styles.css +51 -0
  288. package/templates/create-full/src/components/RichText/types.ts +5 -0
  289. package/templates/create-full/src/components/SocialMediaIcon/index.tsx +26 -0
  290. package/templates/create-full/src/components/SocialMediaIcon/styles.css +17 -0
  291. package/templates/create-full/src/components/SocialMediaIcon/types.ts +7 -0
  292. package/templates/create-full/src/components/index.ts +50 -0
  293. package/templates/create-full/src/global-types.ts +13 -0
  294. package/templates/create-full/src/global.css +582 -0
  295. package/templates/create-full/src/hooks/useBundleProducts.ts +75 -0
  296. package/templates/create-full/src/hooks/useColumnPreference.ts +26 -0
  297. package/templates/create-full/src/hooks/useInfiniteScroll.ts +49 -0
  298. package/templates/create-full/src/hooks/usePageTracking.ts +56 -0
  299. package/templates/create-full/src/hooks/usePayWithIkas.ts +114 -0
  300. package/templates/create-full/src/hooks/useRedirectIfLoggedIn.ts +35 -0
  301. package/templates/create-full/src/hooks/useScrollLock.ts +20 -0
  302. package/templates/create-full/src/hooks/useToast.ts +27 -0
  303. package/templates/create-full/src/ikas-component-utils.d.ts +3 -0
  304. package/templates/create-full/src/sub-components/Badge/index.tsx +208 -0
  305. package/templates/create-full/src/sub-components/Badge/styles.css +129 -0
  306. package/templates/create-full/src/sub-components/Breadcrumb/index.tsx +57 -0
  307. package/templates/create-full/src/sub-components/Breadcrumb/styles.css +49 -0
  308. package/templates/create-full/src/sub-components/BundleMedia/index.tsx +72 -0
  309. package/templates/create-full/src/sub-components/BundleQuantityBox/index.tsx +73 -0
  310. package/templates/create-full/src/sub-components/BundleQuantityBox/styles.css +43 -0
  311. package/templates/create-full/src/sub-components/Button/index.tsx +52 -0
  312. package/templates/create-full/src/sub-components/Button/styles.css +114 -0
  313. package/templates/create-full/src/sub-components/CartItem/components/BundleProductItem/index.tsx +59 -0
  314. package/templates/create-full/src/sub-components/CartItem/components/BundleProductItem/styles.css +24 -0
  315. package/templates/create-full/src/sub-components/CartItem/components/BundleProducts/index.tsx +55 -0
  316. package/templates/create-full/src/sub-components/CartItem/components/BundleProducts/styles.css +30 -0
  317. package/templates/create-full/src/sub-components/CartItem/components/ItemOptions/index.tsx +31 -0
  318. package/templates/create-full/src/sub-components/CartItem/components/ItemOptions/styles.css +6 -0
  319. package/templates/create-full/src/sub-components/CartItem/components/OptionValueDisplay/index.tsx +79 -0
  320. package/templates/create-full/src/sub-components/CartItem/components/OptionValueDisplay/styles.css +28 -0
  321. package/templates/create-full/src/sub-components/CartItem/index.tsx +216 -0
  322. package/templates/create-full/src/sub-components/CartItem/styles.css +170 -0
  323. package/templates/create-full/src/sub-components/Checkbox/index.tsx +42 -0
  324. package/templates/create-full/src/sub-components/Checkbox/styles.css +65 -0
  325. package/templates/create-full/src/sub-components/CollapsibleGroup/index.tsx +52 -0
  326. package/templates/create-full/src/sub-components/CollapsibleGroup/styles.css +51 -0
  327. package/templates/create-full/src/sub-components/ColorInput/index.tsx +33 -0
  328. package/templates/create-full/src/sub-components/ColorInput/styles.css +53 -0
  329. package/templates/create-full/src/sub-components/ConfirmModal/index.tsx +60 -0
  330. package/templates/create-full/src/sub-components/ConfirmModal/styles.css +20 -0
  331. package/templates/create-full/src/sub-components/FormItem/index.tsx +66 -0
  332. package/templates/create-full/src/sub-components/FormItem/styles.css +38 -0
  333. package/templates/create-full/src/sub-components/ImagePreviewModal/index.tsx +55 -0
  334. package/templates/create-full/src/sub-components/ImagePreviewModal/styles.css +50 -0
  335. package/templates/create-full/src/sub-components/Input/index.tsx +69 -0
  336. package/templates/create-full/src/sub-components/Input/styles.css +162 -0
  337. package/templates/create-full/src/sub-components/Modal/index.tsx +118 -0
  338. package/templates/create-full/src/sub-components/Modal/styles.css +70 -0
  339. package/templates/create-full/src/sub-components/PageLoader/index.tsx +14 -0
  340. package/templates/create-full/src/sub-components/PageLoader/styles.css +12 -0
  341. package/templates/create-full/src/sub-components/Pagination/index.tsx +107 -0
  342. package/templates/create-full/src/sub-components/Pagination/styles.css +88 -0
  343. package/templates/create-full/src/sub-components/ProductCard/index.tsx +276 -0
  344. package/templates/create-full/src/sub-components/ProductCard/styles.css +99 -0
  345. package/templates/create-full/src/sub-components/QuantitySelector/index.tsx +41 -0
  346. package/templates/create-full/src/sub-components/QuantitySelector/styles.css +51 -0
  347. package/templates/create-full/src/sub-components/ReviewCard/index.tsx +103 -0
  348. package/templates/create-full/src/sub-components/ReviewCard/styles.css +95 -0
  349. package/templates/create-full/src/sub-components/ReviewForm/index.tsx +115 -0
  350. package/templates/create-full/src/sub-components/ReviewForm/styles.css +11 -0
  351. package/templates/create-full/src/sub-components/ReviewSummary/index.tsx +65 -0
  352. package/templates/create-full/src/sub-components/ReviewSummary/styles.css +86 -0
  353. package/templates/create-full/src/sub-components/Select/index.tsx +86 -0
  354. package/templates/create-full/src/sub-components/Select/styles.css +110 -0
  355. package/templates/create-full/src/sub-components/SkeletonField/index.tsx +12 -0
  356. package/templates/create-full/src/sub-components/SkeletonField/styles.css +29 -0
  357. package/templates/create-full/src/sub-components/SliderArrow/index.tsx +26 -0
  358. package/templates/create-full/src/sub-components/SliderArrow/styles.css +24 -0
  359. package/templates/create-full/src/sub-components/SocialLoginButton/index.tsx +24 -0
  360. package/templates/create-full/src/sub-components/SocialLoginButton/styles.css +19 -0
  361. package/templates/create-full/src/sub-components/SpinnerIcon/index.tsx +10 -0
  362. package/templates/create-full/src/sub-components/SpinnerIcon/styles.css +8 -0
  363. package/templates/create-full/src/sub-components/StarRating/index.tsx +76 -0
  364. package/templates/create-full/src/sub-components/StarRating/styles.css +40 -0
  365. package/templates/create-full/src/sub-components/Tag/index.tsx +21 -0
  366. package/templates/create-full/src/sub-components/Tag/styles.css +30 -0
  367. package/templates/create-full/src/sub-components/Textarea/index.tsx +45 -0
  368. package/templates/create-full/src/sub-components/Textarea/styles.css +82 -0
  369. package/templates/create-full/src/sub-components/Toast/index.tsx +257 -0
  370. package/templates/create-full/src/sub-components/Toast/styles.css +3 -0
  371. package/templates/create-full/src/sub-components/Toggle/index.tsx +46 -0
  372. package/templates/create-full/src/sub-components/Toggle/styles.css +86 -0
  373. package/templates/create-full/src/sub-components/VariantBadge/index.tsx +153 -0
  374. package/templates/create-full/src/sub-components/VariantBadge/styles.css +47 -0
  375. package/templates/create-full/src/sub-components/icons/index.tsx +981 -0
  376. package/templates/create-full/src/utils/bundle.ts +70 -0
  377. package/templates/create-full/src/utils/cx.ts +4 -0
  378. package/templates/create-full/src/utils/fullName.ts +6 -0
  379. package/templates/create-full/src/utils/media.ts +36 -0
  380. package/templates/create-full/src/utils/optionPrice.ts +19 -0
  381. package/templates/create-full/src/utils/optionSet.ts +17 -0
  382. package/templates/create-full/src/utils/orderStatus.ts +28 -0
  383. package/templates/create-full/src/utils/pagination.ts +29 -0
  384. package/templates/create-full/src/utils/toast.ts +5 -0
  385. package/templates/create-full/tsconfig.json +30 -0
  386. package/templates/create-full/vite.config.ts +15 -0
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAk8BpC,wBAAgB,mBAAmB,IAAI,OAAO,CAwH7C"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAg3CpC,wBAAgB,mBAAmB,IAAI,OAAO,CA0K7C"}
@@ -1,7 +1,7 @@
1
1
  import { Command } from "commander";
2
2
  import * as fs from "fs";
3
3
  import * as path from "path";
4
- import { PROP_TYPES, toPascalCase, toKebabCase, generateTypesFile, generateGlobalTypesFile, generateComponentFile, generateStylesFile, generateProjectId, generateComponentId, updateBarrelExport, findPropGroup, collectPropGroupIds, } from "../utils/component-helpers.js";
4
+ import { PROP_TYPES, toPascalCase, toKebabCase, generateTypesFile, generateGlobalTypesFile, generateComponentFile, generateStylesFile, generateProjectId, generateComponentId, generateUniqueId, updateBarrelExport, findPropGroup, collectPropGroupIds, } from "../utils/component-helpers.js";
5
5
  function loadConfig() {
6
6
  const configPath = path.resolve(process.cwd(), "ikas.config.json");
7
7
  if (!fs.existsSync(configPath)) {
@@ -53,7 +53,7 @@ function camelCaseToDisplayName(name) {
53
53
  * Parse and validate the --props JSON flag for add-component.
54
54
  * Returns validated ComponentProp[] or exits with error.
55
55
  */
56
- function parsePropsFlag(propsJson) {
56
+ function parsePropsFlag(propsJson, config) {
57
57
  let rawProps;
58
58
  try {
59
59
  rawProps = JSON.parse(propsJson);
@@ -135,10 +135,22 @@ function parsePropsFlag(propsJson) {
135
135
  if (!r.enumTypeId || typeof r.enumTypeId !== "string") {
136
136
  console.log(JSON.stringify({
137
137
  success: false,
138
- error: `Prop "${r.name}" has type ENUM but is missing required "enumTypeId" field.`,
138
+ error: `Prop "${r.name}" has type ENUM but is missing required "enumTypeId" field. Create one with: config add-enum`,
139
139
  }));
140
140
  process.exit(1);
141
141
  }
142
+ // Validate enum type exists (skip library types)
143
+ if (config && typeof r.enumTypeId === "string" && !r.enumTypeId.startsWith("@ikas/")) {
144
+ const customTypes = config.customTypes || [];
145
+ const enumExists = customTypes.some((t) => t.id === r.enumTypeId && t.type === "enum");
146
+ if (!enumExists) {
147
+ console.log(JSON.stringify({
148
+ success: false,
149
+ error: `Enum type "${r.enumTypeId}" not found for prop "${r.name}". Create it first with: config add-enum --name "MyEnum" --options '{"Label":"value"}'`,
150
+ }));
151
+ process.exit(1);
152
+ }
153
+ }
142
154
  }
143
155
  const prop = {
144
156
  name: r.name,
@@ -151,12 +163,21 @@ function parsePropsFlag(propsJson) {
151
163
  ...(r.defaultValue !== undefined
152
164
  ? { defaultValue: r.defaultValue }
153
165
  : {}),
166
+ ...(typeof r.groupId === "string" && r.groupId
167
+ ? { groupId: r.groupId }
168
+ : {}),
154
169
  ...(propType === "TYPE" && typeof r.typeId === "string"
155
170
  ? { typeId: r.typeId }
156
171
  : {}),
157
172
  ...(propType === "ENUM" && typeof r.enumTypeId === "string"
158
173
  ? { enumTypeId: r.enumTypeId }
159
174
  : {}),
175
+ ...((propType === "COMPONENT" || propType === "COMPONENT_LIST") && r.filteredComponentIds && Array.isArray(r.filteredComponentIds)
176
+ ? { filteredComponentIds: r.filteredComponentIds }
177
+ : {}),
178
+ ...((propType === "COMPONENT" || propType === "COMPONENT_LIST") && r.privateVarMap && typeof r.privateVarMap === "object"
179
+ ? { privateVarMap: r.privateVarMap }
180
+ : {}),
160
181
  };
161
182
  props.push(prop);
162
183
  }
@@ -194,8 +215,22 @@ function addComponent(name, options) {
194
215
  fs.mkdirSync(componentDir, { recursive: true });
195
216
  // Parse --props if provided, otherwise empty
196
217
  const props = options.props
197
- ? parsePropsFlag(options.props)
218
+ ? parsePropsFlag(options.props, config)
198
219
  : [];
220
+ // Auto-create prop groups from groupId references in props
221
+ const referencedGroupIds = new Set();
222
+ for (const prop of props) {
223
+ if (prop.groupId) {
224
+ referencedGroupIds.add(prop.groupId);
225
+ }
226
+ }
227
+ let propGroups;
228
+ if (referencedGroupIds.size > 0) {
229
+ propGroups = Array.from(referencedGroupIds).map((groupId) => ({
230
+ id: groupId,
231
+ name: camelCaseToDisplayName(groupId),
232
+ }));
233
+ }
199
234
  fs.writeFileSync(path.join(componentDir, "types.ts"), generateTypesFile(pascalName, props, componentType, null, config.customTypes));
200
235
  fs.writeFileSync(path.join(componentDir, "index.tsx"), generateComponentFile(pascalName, props, componentType));
201
236
  fs.writeFileSync(path.join(componentDir, "styles.css"), generateStylesFile(pascalName, componentType));
@@ -209,6 +244,7 @@ function addComponent(name, options) {
209
244
  ...(options.isHeader ? { isHeader: true } : {}),
210
245
  ...(options.isFooter ? { isFooter: true } : {}),
211
246
  props,
247
+ ...(propGroups ? { propGroups } : {}),
212
248
  };
213
249
  config.components.push(newComponent);
214
250
  saveConfig(configPath, config);
@@ -278,10 +314,22 @@ function addProp(componentName, options) {
278
314
  if (propType === "ENUM" && !options.enumTypeId) {
279
315
  console.log(JSON.stringify({
280
316
  success: false,
281
- error: `ENUM props require --enumTypeId. Run "config list-types" to see available enum types.`,
317
+ error: `ENUM props require --enumTypeId. Run "config add-enum" to create one, or "config list-types" to see available types.`,
282
318
  }));
283
319
  process.exit(1);
284
320
  }
321
+ // Validate that enumTypeId references an existing enum type
322
+ if (propType === "ENUM" && options.enumTypeId && !options.enumTypeId.startsWith("@ikas/")) {
323
+ const customTypes = config.customTypes || [];
324
+ const enumExists = customTypes.some((t) => t.id === options.enumTypeId && t.type === "enum");
325
+ if (!enumExists) {
326
+ console.log(JSON.stringify({
327
+ success: false,
328
+ error: `Enum type "${options.enumTypeId}" not found. Create it first with: config add-enum --name "MyEnum" --options '{"Label":"value"}'`,
329
+ }));
330
+ process.exit(1);
331
+ }
332
+ }
285
333
  // Validate group reference
286
334
  if (options.group) {
287
335
  if (!component.propGroups || component.propGroups.length === 0) {
@@ -300,6 +348,36 @@ function addProp(componentName, options) {
300
348
  process.exit(1);
301
349
  }
302
350
  }
351
+ // Parse filteredComponentIds JSON for COMPONENT/COMPONENT_LIST
352
+ let parsedFilteredIds;
353
+ if (options.filteredComponentIds && (propType === "COMPONENT" || propType === "COMPONENT_LIST")) {
354
+ try {
355
+ parsedFilteredIds = JSON.parse(options.filteredComponentIds);
356
+ if (!Array.isArray(parsedFilteredIds)) {
357
+ console.log(JSON.stringify({ success: false, error: "--filteredComponentIds must be a JSON array of strings." }));
358
+ process.exit(1);
359
+ }
360
+ }
361
+ catch {
362
+ console.log(JSON.stringify({ success: false, error: `Invalid --filteredComponentIds JSON: ${options.filteredComponentIds}` }));
363
+ process.exit(1);
364
+ }
365
+ }
366
+ // Parse privateVarMap JSON for COMPONENT/COMPONENT_LIST
367
+ let parsedPrivateVarMap;
368
+ if (options.privateVarMap && (propType === "COMPONENT" || propType === "COMPONENT_LIST")) {
369
+ try {
370
+ parsedPrivateVarMap = JSON.parse(options.privateVarMap);
371
+ if (typeof parsedPrivateVarMap !== "object" || Array.isArray(parsedPrivateVarMap)) {
372
+ console.log(JSON.stringify({ success: false, error: "--privateVarMap must be a JSON object mapping keys to {id, typeId}." }));
373
+ process.exit(1);
374
+ }
375
+ }
376
+ catch {
377
+ console.log(JSON.stringify({ success: false, error: `Invalid --privateVarMap JSON: ${options.privateVarMap}` }));
378
+ process.exit(1);
379
+ }
380
+ }
303
381
  const newProp = {
304
382
  name: options.name,
305
383
  displayName: options.displayName,
@@ -312,6 +390,8 @@ function addProp(componentName, options) {
312
390
  ...(options.group ? { groupId: options.group } : {}),
313
391
  ...(options.typeId ? { typeId: options.typeId } : {}),
314
392
  ...(options.enumTypeId ? { enumTypeId: options.enumTypeId } : {}),
393
+ ...(parsedFilteredIds ? { filteredComponentIds: parsedFilteredIds } : {}),
394
+ ...(parsedPrivateVarMap ? { privateVarMap: parsedPrivateVarMap } : {}),
315
395
  };
316
396
  component.props.push(newProp);
317
397
  saveConfig(configPath, config);
@@ -328,6 +408,8 @@ function addProp(componentName, options) {
328
408
  required: newProp.required,
329
409
  ...(newProp.groupId ? { groupId: newProp.groupId } : {}),
330
410
  ...(newProp.enumTypeId ? { enumTypeId: newProp.enumTypeId } : {}),
411
+ ...(newProp.filteredComponentIds ? { filteredComponentIds: newProp.filteredComponentIds } : {}),
412
+ ...(newProp.privateVarMap ? { privateVarMap: newProp.privateVarMap } : {}),
331
413
  },
332
414
  }));
333
415
  }
@@ -422,6 +504,44 @@ function updateProp(componentName, options) {
422
504
  prop.enumTypeId = options.enumTypeId;
423
505
  }
424
506
  }
507
+ if (options.filteredComponentIds !== undefined) {
508
+ if (options.filteredComponentIds === "" || options.filteredComponentIds === "none") {
509
+ delete prop.filteredComponentIds;
510
+ }
511
+ else {
512
+ try {
513
+ const parsed = JSON.parse(options.filteredComponentIds);
514
+ if (!Array.isArray(parsed)) {
515
+ console.log(JSON.stringify({ success: false, error: "--filteredComponentIds must be a JSON array of strings." }));
516
+ process.exit(1);
517
+ }
518
+ prop.filteredComponentIds = parsed;
519
+ }
520
+ catch {
521
+ console.log(JSON.stringify({ success: false, error: `Invalid --filteredComponentIds JSON: ${options.filteredComponentIds}` }));
522
+ process.exit(1);
523
+ }
524
+ }
525
+ }
526
+ if (options.privateVarMap !== undefined) {
527
+ if (options.privateVarMap === "" || options.privateVarMap === "none") {
528
+ delete prop.privateVarMap;
529
+ }
530
+ else {
531
+ try {
532
+ const parsed = JSON.parse(options.privateVarMap);
533
+ if (typeof parsed !== "object" || Array.isArray(parsed)) {
534
+ console.log(JSON.stringify({ success: false, error: "--privateVarMap must be a JSON object mapping keys to {id, typeId}." }));
535
+ process.exit(1);
536
+ }
537
+ prop.privateVarMap = parsed;
538
+ }
539
+ catch {
540
+ console.log(JSON.stringify({ success: false, error: `Invalid --privateVarMap JSON: ${options.privateVarMap}` }));
541
+ process.exit(1);
542
+ }
543
+ }
544
+ }
425
545
  saveConfig(configPath, config);
426
546
  // Regenerate types.ts and global types
427
547
  regenerateTypes(component, undefined, config);
@@ -437,6 +557,8 @@ function updateProp(componentName, options) {
437
557
  ...(prop.groupId ? { groupId: prop.groupId } : {}),
438
558
  ...(prop.typeId ? { typeId: prop.typeId } : {}),
439
559
  ...(prop.enumTypeId ? { enumTypeId: prop.enumTypeId } : {}),
560
+ ...(prop.filteredComponentIds ? { filteredComponentIds: prop.filteredComponentIds } : {}),
561
+ ...(prop.privateVarMap ? { privateVarMap: prop.privateVarMap } : {}),
440
562
  },
441
563
  }));
442
564
  }
@@ -643,6 +765,41 @@ function removePropGroup(componentName, options) {
643
765
  remainingPropGroups: component.propGroups.map(g => g.id),
644
766
  }));
645
767
  }
768
+ function updateComponent(options) {
769
+ const { config, configPath } = loadConfig();
770
+ const component = findComponent(config, options.name);
771
+ if (!component) {
772
+ console.log(JSON.stringify({
773
+ success: false,
774
+ error: `Component "${options.name}" not found. Available: ${getComponentNames(config).join(", ")}`,
775
+ }));
776
+ process.exit(1);
777
+ }
778
+ if (options.isHeader !== undefined) {
779
+ if (options.isHeader) {
780
+ component.isHeader = true;
781
+ }
782
+ else {
783
+ delete component.isHeader;
784
+ }
785
+ }
786
+ if (options.isFooter !== undefined) {
787
+ if (options.isFooter) {
788
+ component.isFooter = true;
789
+ }
790
+ else {
791
+ delete component.isFooter;
792
+ }
793
+ }
794
+ saveConfig(configPath, config);
795
+ console.log(JSON.stringify({
796
+ success: true,
797
+ componentName: component.name,
798
+ type: component.type ?? "component",
799
+ ...(component.isHeader ? { isHeader: true } : {}),
800
+ ...(component.isFooter ? { isFooter: true } : {}),
801
+ }));
802
+ }
646
803
  function listComponents() {
647
804
  const { config } = loadConfig();
648
805
  const components = config.components.map((c) => ({
@@ -670,6 +827,184 @@ function listComponents() {
670
827
  components,
671
828
  }));
672
829
  }
830
+ // --- Enum CRUD ---
831
+ function addEnum(options) {
832
+ const { config, configPath } = loadConfig();
833
+ // Validate name
834
+ if (!options.name || typeof options.name !== "string" || !options.name.trim()) {
835
+ console.log(JSON.stringify({ success: false, error: "Enum name is required." }));
836
+ process.exit(1);
837
+ }
838
+ const enumName = options.name.trim();
839
+ // Check for name collision (PascalCase comparison since generated TS types are PascalCase)
840
+ if (!config.customTypes)
841
+ config.customTypes = [];
842
+ const pascalName = toPascalCase(enumName);
843
+ const existing = config.customTypes.find((t) => t.type === "enum" && toPascalCase(t.name) === pascalName);
844
+ if (existing) {
845
+ console.log(JSON.stringify({
846
+ success: false,
847
+ error: `Enum "${enumName}" already exists (ID: ${existing.id}).`,
848
+ }));
849
+ process.exit(1);
850
+ }
851
+ // Parse and validate options JSON
852
+ let enumOptions;
853
+ try {
854
+ enumOptions = JSON.parse(options.options);
855
+ }
856
+ catch {
857
+ console.log(JSON.stringify({
858
+ success: false,
859
+ error: `Invalid --options JSON: ${options.options}`,
860
+ }));
861
+ process.exit(1);
862
+ }
863
+ if (typeof enumOptions !== "object" ||
864
+ Array.isArray(enumOptions) ||
865
+ Object.keys(enumOptions).length === 0) {
866
+ console.log(JSON.stringify({
867
+ success: false,
868
+ error: 'Options must be a non-empty JSON object, e.g. \'{"Small":"sm","Medium":"md","Large":"lg"}\'.',
869
+ }));
870
+ process.exit(1);
871
+ }
872
+ const enumId = generateUniqueId();
873
+ config.customTypes.push({
874
+ id: enumId,
875
+ name: enumName,
876
+ type: "enum",
877
+ enumOptions,
878
+ isDynamic: false,
879
+ });
880
+ saveConfig(configPath, config);
881
+ // Regenerate global types and all component types
882
+ regenerateGlobalTypes(config);
883
+ for (const component of config.components) {
884
+ regenerateTypes(component, undefined, config);
885
+ }
886
+ console.log(JSON.stringify({
887
+ success: true,
888
+ enumId,
889
+ enumName,
890
+ enumOptions,
891
+ }));
892
+ }
893
+ function updateEnum(options) {
894
+ const { config, configPath } = loadConfig();
895
+ if (!config.customTypes)
896
+ config.customTypes = [];
897
+ const enumIndex = config.customTypes.findIndex((t) => t.id === options.id && t.type === "enum");
898
+ if (enumIndex === -1) {
899
+ console.log(JSON.stringify({
900
+ success: false,
901
+ error: `Enum with ID "${options.id}" not found.`,
902
+ }));
903
+ process.exit(1);
904
+ }
905
+ const enumType = config.customTypes[enumIndex];
906
+ if (options.name !== undefined) {
907
+ const pascalName = toPascalCase(options.name);
908
+ const collision = config.customTypes.find((t) => t.type === "enum" &&
909
+ t.id !== options.id &&
910
+ toPascalCase(t.name) === pascalName);
911
+ if (collision) {
912
+ console.log(JSON.stringify({
913
+ success: false,
914
+ error: `Enum name "${options.name}" conflicts with existing enum (ID: ${collision.id}).`,
915
+ }));
916
+ process.exit(1);
917
+ }
918
+ enumType.name = options.name;
919
+ }
920
+ if (options.options !== undefined) {
921
+ let enumOptions;
922
+ try {
923
+ enumOptions = JSON.parse(options.options);
924
+ }
925
+ catch {
926
+ console.log(JSON.stringify({
927
+ success: false,
928
+ error: `Invalid --options JSON: ${options.options}`,
929
+ }));
930
+ process.exit(1);
931
+ }
932
+ if (typeof enumOptions !== "object" ||
933
+ Array.isArray(enumOptions) ||
934
+ Object.keys(enumOptions).length === 0) {
935
+ console.log(JSON.stringify({
936
+ success: false,
937
+ error: 'Options must be a non-empty JSON object.',
938
+ }));
939
+ process.exit(1);
940
+ }
941
+ enumType.enumOptions = enumOptions;
942
+ }
943
+ saveConfig(configPath, config);
944
+ // Regenerate global types and all component types
945
+ regenerateGlobalTypes(config);
946
+ for (const component of config.components) {
947
+ regenerateTypes(component, undefined, config);
948
+ }
949
+ console.log(JSON.stringify({
950
+ success: true,
951
+ enumId: enumType.id,
952
+ enumName: enumType.name,
953
+ enumOptions: enumType.enumOptions,
954
+ }));
955
+ }
956
+ function removeEnum(options) {
957
+ const { config, configPath } = loadConfig();
958
+ if (!config.customTypes)
959
+ config.customTypes = [];
960
+ const enumIndex = config.customTypes.findIndex((t) => t.id === options.id && t.type === "enum");
961
+ if (enumIndex === -1) {
962
+ console.log(JSON.stringify({
963
+ success: false,
964
+ error: `Enum with ID "${options.id}" not found.`,
965
+ }));
966
+ process.exit(1);
967
+ }
968
+ // Check if any component prop references this enum
969
+ for (const component of config.components) {
970
+ for (const prop of component.props) {
971
+ if (prop.enumTypeId === options.id) {
972
+ console.log(JSON.stringify({
973
+ success: false,
974
+ error: `Cannot remove enum "${config.customTypes[enumIndex].name}": prop "${prop.name}" on component "${component.name}" references it. Remove or update the prop first.`,
975
+ }));
976
+ process.exit(1);
977
+ }
978
+ }
979
+ }
980
+ const removed = config.customTypes.splice(enumIndex, 1)[0];
981
+ saveConfig(configPath, config);
982
+ // Regenerate global types and all component types
983
+ regenerateGlobalTypes(config);
984
+ for (const component of config.components) {
985
+ regenerateTypes(component, undefined, config);
986
+ }
987
+ console.log(JSON.stringify({
988
+ success: true,
989
+ removedEnumId: removed.id,
990
+ removedEnumName: removed.name,
991
+ }));
992
+ }
993
+ function listEnums() {
994
+ const { config } = loadConfig();
995
+ const enums = (config.customTypes || [])
996
+ .filter((t) => t.type === "enum")
997
+ .map((t) => ({
998
+ id: t.id,
999
+ name: t.name,
1000
+ enumOptions: t.enumOptions,
1001
+ }));
1002
+ console.log(JSON.stringify({
1003
+ success: true,
1004
+ enumCount: enums.length,
1005
+ enums,
1006
+ }));
1007
+ }
673
1008
  // --- Command registration ---
674
1009
  export function createConfigCommand() {
675
1010
  const config = new Command("config")
@@ -698,6 +1033,8 @@ export function createConfigCommand() {
698
1033
  .option("--group <groupId>", "Assign prop to a prop group")
699
1034
  .option("--typeId <typeId>", "Type ID for TYPE props (required when type is TYPE)")
700
1035
  .option("--enumTypeId <enumTypeId>", "Enum type ID for ENUM props (required when type is ENUM)")
1036
+ .option("--filteredComponentIds <json>", "JSON array of component IDs to restrict selection (for COMPONENT/COMPONENT_LIST)")
1037
+ .option("--privateVarMap <json>", 'JSON object mapping variable keys to {id, typeId} (for COMPONENT/COMPONENT_LIST)')
701
1038
  .action((options) => {
702
1039
  addProp(options.component, options);
703
1040
  });
@@ -714,6 +1051,8 @@ export function createConfigCommand() {
714
1051
  .option("--group <groupId>", "Move prop to a group (use 'none' to ungroup)")
715
1052
  .option("--typeId <typeId>", "Type ID for TYPE props (use 'none' to clear)")
716
1053
  .option("--enumTypeId <enumTypeId>", "Enum type ID for ENUM props (use 'none' to clear)")
1054
+ .option("--filteredComponentIds <json>", "JSON array of component IDs (use 'none' to clear)")
1055
+ .option("--privateVarMap <json>", "JSON object mapping variable keys to {id, typeId} (use 'none' to clear)")
717
1056
  .action((options) => {
718
1057
  updateProp(options.component, options);
719
1058
  });
@@ -725,6 +1064,17 @@ export function createConfigCommand() {
725
1064
  .action((options) => {
726
1065
  removeProp(options.component, options);
727
1066
  });
1067
+ config
1068
+ .command("update-component")
1069
+ .description("Update a component's metadata (isHeader, isFooter)")
1070
+ .requiredOption("--name <name>", "Component name")
1071
+ .option("--isHeader", "Mark as store header")
1072
+ .option("--no-isHeader", "Unmark as store header")
1073
+ .option("--isFooter", "Mark as store footer")
1074
+ .option("--no-isFooter", "Unmark as store footer")
1075
+ .action((options) => {
1076
+ updateComponent(options);
1077
+ });
728
1078
  config
729
1079
  .command("remove-component")
730
1080
  .description("Remove a component from the project (deletes files)")
@@ -774,6 +1124,36 @@ export function createConfigCommand() {
774
1124
  .action(async (options) => {
775
1125
  await listTypes(options.componentType);
776
1126
  });
1127
+ config
1128
+ .command("add-enum")
1129
+ .description("Create a custom enum type (offline, no editor needed)")
1130
+ .requiredOption("--name <name>", "Enum name (e.g. Size, AspectRatio)")
1131
+ .requiredOption("--options <json>", 'JSON object of label→value pairs, e.g. \'{"Small":"sm","Medium":"md","Large":"lg"}\'')
1132
+ .action((options) => {
1133
+ addEnum(options);
1134
+ });
1135
+ config
1136
+ .command("update-enum")
1137
+ .description("Update a custom enum type")
1138
+ .requiredOption("--id <id>", "Enum ID to update")
1139
+ .option("--name <name>", "New enum name")
1140
+ .option("--options <json>", "New JSON object of label→value pairs")
1141
+ .action((options) => {
1142
+ updateEnum(options);
1143
+ });
1144
+ config
1145
+ .command("remove-enum")
1146
+ .description("Remove a custom enum type (fails if any prop references it)")
1147
+ .requiredOption("--id <id>", "Enum ID to remove")
1148
+ .action((options) => {
1149
+ removeEnum(options);
1150
+ });
1151
+ config
1152
+ .command("list-enums")
1153
+ .description("List all custom enum types defined in this project")
1154
+ .action(() => {
1155
+ listEnums();
1156
+ });
777
1157
  return config;
778
1158
  }
779
1159
  async function listTypes(componentType) {