softricity-ui 0.0.0-stage → 0.1.1

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 (341) hide show
  1. package/README.md +82 -2
  2. package/lib/cli.mjs +322 -0
  3. package/lib/prompt-lib.mjs +215 -0
  4. package/package.json +33 -4
  5. package/registry/assets/fonts/Urbanist_500Medium.ttf +0 -0
  6. package/registry/assets/fonts/Urbanist_600SemiBold.ttf +0 -0
  7. package/registry/assets/fonts/Urbanist_700Bold.ttf +0 -0
  8. package/registry/assets/fonts/urbanist-latin.woff2 +0 -0
  9. package/registry/catalog.md +122 -0
  10. package/registry/components/charts/area-chart/AreaChart.tsx +153 -0
  11. package/registry/components/charts/area-chart/demo.tsx +18 -0
  12. package/registry/components/charts/area-chart/meta.json +17 -0
  13. package/registry/components/charts/bar-chart/BarChart.tsx +76 -0
  14. package/registry/components/charts/bar-chart/demo.tsx +18 -0
  15. package/registry/components/charts/bar-chart/meta.json +19 -0
  16. package/registry/components/charts/candlestick-chart/CandlestickChart.tsx +196 -0
  17. package/registry/components/charts/candlestick-chart/demo.tsx +39 -0
  18. package/registry/components/charts/candlestick-chart/meta.json +16 -0
  19. package/registry/components/charts/capsule-chart/CapsuleChart.tsx +89 -0
  20. package/registry/components/charts/capsule-chart/demo.tsx +15 -0
  21. package/registry/components/charts/capsule-chart/meta.json +17 -0
  22. package/registry/components/charts/funnel-chart/FunnelChart.tsx +59 -0
  23. package/registry/components/charts/funnel-chart/demo.tsx +14 -0
  24. package/registry/components/charts/funnel-chart/meta.json +16 -0
  25. package/registry/components/charts/gauge-chart/GaugeChart.tsx +89 -0
  26. package/registry/components/charts/gauge-chart/demo.tsx +12 -0
  27. package/registry/components/charts/gauge-chart/meta.json +17 -0
  28. package/registry/components/charts/ring/Ring.tsx +52 -0
  29. package/registry/components/charts/ring/demo.tsx +13 -0
  30. package/registry/components/charts/ring/meta.json +18 -0
  31. package/registry/components/charts/sparkline/Sparkline.tsx +41 -0
  32. package/registry/components/charts/sparkline/demo.tsx +12 -0
  33. package/registry/components/charts/sparkline/meta.json +18 -0
  34. package/registry/components/data-display/accordion/Accordion.tsx +68 -0
  35. package/registry/components/data-display/accordion/demo.tsx +13 -0
  36. package/registry/components/data-display/accordion/meta.json +18 -0
  37. package/registry/components/data-display/action-list/ActionList.tsx +55 -0
  38. package/registry/components/data-display/action-list/demo.tsx +24 -0
  39. package/registry/components/data-display/action-list/meta.json +17 -0
  40. package/registry/components/data-display/activity-feed/ActivityFeed.tsx +56 -0
  41. package/registry/components/data-display/activity-feed/demo.tsx +17 -0
  42. package/registry/components/data-display/activity-feed/meta.json +14 -0
  43. package/registry/components/data-display/breakdown-list/BreakdownList.tsx +58 -0
  44. package/registry/components/data-display/breakdown-list/demo.tsx +14 -0
  45. package/registry/components/data-display/breakdown-list/meta.json +17 -0
  46. package/registry/components/data-display/card/Card.tsx +51 -0
  47. package/registry/components/data-display/card/demo.tsx +16 -0
  48. package/registry/components/data-display/card/meta.json +19 -0
  49. package/registry/components/data-display/change/Change.tsx +35 -0
  50. package/registry/components/data-display/change/demo.tsx +12 -0
  51. package/registry/components/data-display/change/meta.json +17 -0
  52. package/registry/components/data-display/count-number/CountNumber.tsx +12 -0
  53. package/registry/components/data-display/count-number/demo.tsx +16 -0
  54. package/registry/components/data-display/count-number/meta.json +16 -0
  55. package/registry/components/data-display/data-table/DataTable.tsx +83 -0
  56. package/registry/components/data-display/data-table/demo.tsx +30 -0
  57. package/registry/components/data-display/data-table/meta.json +18 -0
  58. package/registry/components/data-display/description-list/DescriptionList.tsx +16 -0
  59. package/registry/components/data-display/description-list/demo.tsx +10 -0
  60. package/registry/components/data-display/description-list/meta.json +13 -0
  61. package/registry/components/data-display/empty-state/EmptyState.tsx +14 -0
  62. package/registry/components/data-display/empty-state/demo.tsx +13 -0
  63. package/registry/components/data-display/empty-state/meta.json +18 -0
  64. package/registry/components/data-display/goal-card/GoalCard.tsx +33 -0
  65. package/registry/components/data-display/goal-card/demo.tsx +7 -0
  66. package/registry/components/data-display/goal-card/meta.json +16 -0
  67. package/registry/components/data-display/heatmap/Heatmap.tsx +56 -0
  68. package/registry/components/data-display/heatmap/demo.tsx +17 -0
  69. package/registry/components/data-display/heatmap/meta.json +17 -0
  70. package/registry/components/data-display/kpi-card/KpiCard.tsx +47 -0
  71. package/registry/components/data-display/kpi-card/demo.tsx +20 -0
  72. package/registry/components/data-display/kpi-card/meta.json +18 -0
  73. package/registry/components/data-display/leaderboard-card/LeaderboardCard.tsx +40 -0
  74. package/registry/components/data-display/leaderboard-card/demo.tsx +13 -0
  75. package/registry/components/data-display/leaderboard-card/meta.json +16 -0
  76. package/registry/components/data-display/legend/Legend.tsx +19 -0
  77. package/registry/components/data-display/legend/demo.tsx +5 -0
  78. package/registry/components/data-display/legend/meta.json +13 -0
  79. package/registry/components/data-display/meter/Meter.tsx +33 -0
  80. package/registry/components/data-display/meter/demo.tsx +14 -0
  81. package/registry/components/data-display/meter/meta.json +19 -0
  82. package/registry/components/data-display/notice-list/NoticeList.tsx +30 -0
  83. package/registry/components/data-display/notice-list/demo.tsx +22 -0
  84. package/registry/components/data-display/notice-list/meta.json +17 -0
  85. package/registry/components/data-display/odometer/Odometer.tsx +37 -0
  86. package/registry/components/data-display/odometer/demo.tsx +15 -0
  87. package/registry/components/data-display/odometer/meta.json +14 -0
  88. package/registry/components/data-display/permission-matrix/PermissionMatrix.tsx +77 -0
  89. package/registry/components/data-display/permission-matrix/demo.tsx +20 -0
  90. package/registry/components/data-display/permission-matrix/meta.json +16 -0
  91. package/registry/components/data-display/pricing-card/PricingCard.tsx +108 -0
  92. package/registry/components/data-display/pricing-card/demo.tsx +33 -0
  93. package/registry/components/data-display/pricing-card/meta.json +16 -0
  94. package/registry/components/data-display/segment-bar/SegmentBar.tsx +46 -0
  95. package/registry/components/data-display/segment-bar/demo.tsx +12 -0
  96. package/registry/components/data-display/segment-bar/meta.json +17 -0
  97. package/registry/components/data-display/settings-row/SettingsRow.tsx +14 -0
  98. package/registry/components/data-display/settings-row/demo.tsx +18 -0
  99. package/registry/components/data-display/settings-row/meta.json +13 -0
  100. package/registry/components/data-display/split-bar/SplitBar.tsx +23 -0
  101. package/registry/components/data-display/split-bar/demo.tsx +13 -0
  102. package/registry/components/data-display/split-bar/meta.json +13 -0
  103. package/registry/components/data-display/stat/Stat.tsx +33 -0
  104. package/registry/components/data-display/stat/demo.tsx +12 -0
  105. package/registry/components/data-display/stat/meta.json +13 -0
  106. package/registry/components/data-display/stat-strip/StatStrip.tsx +40 -0
  107. package/registry/components/data-display/stat-strip/demo.tsx +15 -0
  108. package/registry/components/data-display/stat-strip/meta.json +16 -0
  109. package/registry/components/data-display/theme-picker/ThemePicker.tsx +82 -0
  110. package/registry/components/data-display/theme-picker/demo.tsx +21 -0
  111. package/registry/components/data-display/theme-picker/meta.json +18 -0
  112. package/registry/components/data-display/tick-value/TickValue.tsx +19 -0
  113. package/registry/components/data-display/tick-value/demo.tsx +12 -0
  114. package/registry/components/data-display/tick-value/meta.json +13 -0
  115. package/registry/components/data-display/ticker/Ticker.tsx +32 -0
  116. package/registry/components/data-display/ticker/demo.tsx +12 -0
  117. package/registry/components/data-display/ticker/meta.json +13 -0
  118. package/registry/components/data-display/timeline/Timeline.tsx +72 -0
  119. package/registry/components/data-display/timeline/demo.tsx +19 -0
  120. package/registry/components/data-display/timeline/meta.json +17 -0
  121. package/registry/components/data-display/token-icon/TokenIcon.tsx +38 -0
  122. package/registry/components/data-display/token-icon/demo.tsx +13 -0
  123. package/registry/components/data-display/token-icon/meta.json +17 -0
  124. package/registry/components/data-display/transaction-row/TransactionRow.tsx +54 -0
  125. package/registry/components/data-display/transaction-row/demo.tsx +20 -0
  126. package/registry/components/data-display/transaction-row/meta.json +14 -0
  127. package/registry/components/data-display/uptime-strip/UptimeStrip.tsx +52 -0
  128. package/registry/components/data-display/uptime-strip/demo.tsx +15 -0
  129. package/registry/components/data-display/uptime-strip/meta.json +17 -0
  130. package/registry/components/domain-blocks/auction-lot-card/AuctionLotCard.tsx +123 -0
  131. package/registry/components/domain-blocks/auction-lot-card/demo.tsx +26 -0
  132. package/registry/components/domain-blocks/auction-lot-card/meta.json +23 -0
  133. package/registry/components/domain-blocks/balance-card/BalanceCard.tsx +80 -0
  134. package/registry/components/domain-blocks/balance-card/demo.tsx +16 -0
  135. package/registry/components/domain-blocks/balance-card/meta.json +14 -0
  136. package/registry/components/domain-blocks/calendar/Calendar.tsx +376 -0
  137. package/registry/components/domain-blocks/calendar/demo.tsx +53 -0
  138. package/registry/components/domain-blocks/calendar/meta.json +23 -0
  139. package/registry/components/domain-blocks/call-bar/CallBar.tsx +45 -0
  140. package/registry/components/domain-blocks/call-bar/demo.tsx +23 -0
  141. package/registry/components/domain-blocks/call-bar/meta.json +14 -0
  142. package/registry/components/domain-blocks/card-stack/CardStack.tsx +65 -0
  143. package/registry/components/domain-blocks/card-stack/demo.tsx +12 -0
  144. package/registry/components/domain-blocks/card-stack/meta.json +16 -0
  145. package/registry/components/domain-blocks/contact-profile-card/ContactProfileCard.tsx +216 -0
  146. package/registry/components/domain-blocks/contact-profile-card/demo.tsx +38 -0
  147. package/registry/components/domain-blocks/contact-profile-card/meta.json +16 -0
  148. package/registry/components/domain-blocks/customer-card/CustomerCard.tsx +112 -0
  149. package/registry/components/domain-blocks/customer-card/demo.tsx +40 -0
  150. package/registry/components/domain-blocks/customer-card/meta.json +30 -0
  151. package/registry/components/domain-blocks/invoice-preview/InvoicePreview.tsx +100 -0
  152. package/registry/components/domain-blocks/invoice-preview/demo.tsx +22 -0
  153. package/registry/components/domain-blocks/invoice-preview/meta.json +17 -0
  154. package/registry/components/domain-blocks/kanban-board/KanbanBoard.tsx +221 -0
  155. package/registry/components/domain-blocks/kanban-board/demo.tsx +48 -0
  156. package/registry/components/domain-blocks/kanban-board/meta.json +24 -0
  157. package/registry/components/domain-blocks/keypad/Keypad.tsx +67 -0
  158. package/registry/components/domain-blocks/keypad/demo.tsx +15 -0
  159. package/registry/components/domain-blocks/keypad/meta.json +13 -0
  160. package/registry/components/domain-blocks/node-canvas/NodeCanvas.tsx +120 -0
  161. package/registry/components/domain-blocks/node-canvas/demo.tsx +18 -0
  162. package/registry/components/domain-blocks/node-canvas/meta.json +16 -0
  163. package/registry/components/domain-blocks/onboarding-carousel/OnboardingCarousel.tsx +100 -0
  164. package/registry/components/domain-blocks/onboarding-carousel/demo.tsx +13 -0
  165. package/registry/components/domain-blocks/onboarding-carousel/meta.json +16 -0
  166. package/registry/components/domain-blocks/pay-card/PayCard.tsx +51 -0
  167. package/registry/components/domain-blocks/pay-card/demo.tsx +25 -0
  168. package/registry/components/domain-blocks/pay-card/meta.json +14 -0
  169. package/registry/components/domain-blocks/project-card/ProjectCard.tsx +59 -0
  170. package/registry/components/domain-blocks/project-card/demo.tsx +34 -0
  171. package/registry/components/domain-blocks/project-card/meta.json +16 -0
  172. package/registry/components/domain-blocks/quick-actions/QuickActions.tsx +58 -0
  173. package/registry/components/domain-blocks/quick-actions/demo.tsx +31 -0
  174. package/registry/components/domain-blocks/quick-actions/meta.json +28 -0
  175. package/registry/components/domain-blocks/quota-card/QuotaCard.tsx +48 -0
  176. package/registry/components/domain-blocks/quota-card/demo.tsx +20 -0
  177. package/registry/components/domain-blocks/quota-card/meta.json +16 -0
  178. package/registry/components/domain-blocks/recipient-picker/RecipientPicker.tsx +42 -0
  179. package/registry/components/domain-blocks/recipient-picker/demo.tsx +16 -0
  180. package/registry/components/domain-blocks/recipient-picker/meta.json +16 -0
  181. package/registry/components/domain-blocks/sign-in/SignIn.tsx +77 -0
  182. package/registry/components/domain-blocks/sign-in/demo.tsx +20 -0
  183. package/registry/components/domain-blocks/sign-in/meta.json +18 -0
  184. package/registry/components/domain-blocks/task-checklist/TaskChecklist.tsx +116 -0
  185. package/registry/components/domain-blocks/task-checklist/demo.tsx +23 -0
  186. package/registry/components/domain-blocks/task-checklist/meta.json +16 -0
  187. package/registry/components/layout/app-shell/AppShell.tsx +50 -0
  188. package/registry/components/layout/app-shell/demo.tsx +37 -0
  189. package/registry/components/layout/app-shell/meta.json +18 -0
  190. package/registry/components/layout/mesh-background/MeshBackground.tsx +39 -0
  191. package/registry/components/layout/mesh-background/demo.tsx +14 -0
  192. package/registry/components/layout/mesh-background/meta.json +14 -0
  193. package/registry/components/layout/page-header/PageHeader.tsx +19 -0
  194. package/registry/components/layout/page-header/demo.tsx +13 -0
  195. package/registry/components/layout/page-header/meta.json +18 -0
  196. package/registry/components/layout/section-label/SectionLabel.tsx +6 -0
  197. package/registry/components/layout/section-label/demo.tsx +12 -0
  198. package/registry/components/layout/section-label/meta.json +13 -0
  199. package/registry/components/layout/toolbar/Toolbar.tsx +7 -0
  200. package/registry/components/layout/toolbar/demo.tsx +21 -0
  201. package/registry/components/layout/toolbar/meta.json +13 -0
  202. package/registry/components/navigation/breadcrumbs/Breadcrumbs.tsx +22 -0
  203. package/registry/components/navigation/breadcrumbs/demo.tsx +10 -0
  204. package/registry/components/navigation/breadcrumbs/meta.json +13 -0
  205. package/registry/components/navigation/command-finder/CommandFinder.tsx +135 -0
  206. package/registry/components/navigation/command-finder/demo.tsx +28 -0
  207. package/registry/components/navigation/command-finder/meta.json +18 -0
  208. package/registry/components/navigation/command-trigger/CommandTrigger.tsx +66 -0
  209. package/registry/components/navigation/command-trigger/demo.tsx +12 -0
  210. package/registry/components/navigation/command-trigger/meta.json +16 -0
  211. package/registry/components/navigation/dock/Dock.tsx +64 -0
  212. package/registry/components/navigation/dock/demo.tsx +22 -0
  213. package/registry/components/navigation/dock/meta.json +14 -0
  214. package/registry/components/navigation/mega-menu/MegaMenu.tsx +111 -0
  215. package/registry/components/navigation/mega-menu/demo.tsx +26 -0
  216. package/registry/components/navigation/mega-menu/meta.json +16 -0
  217. package/registry/components/navigation/pill-nav/PillNav.tsx +45 -0
  218. package/registry/components/navigation/pill-nav/demo.tsx +14 -0
  219. package/registry/components/navigation/pill-nav/meta.json +14 -0
  220. package/registry/components/navigation/segmented/Segmented.tsx +60 -0
  221. package/registry/components/navigation/segmented/demo.tsx +16 -0
  222. package/registry/components/navigation/segmented/meta.json +19 -0
  223. package/registry/components/navigation/sidebar-nav/SidebarNav.tsx +147 -0
  224. package/registry/components/navigation/sidebar-nav/demo.tsx +30 -0
  225. package/registry/components/navigation/sidebar-nav/meta.json +18 -0
  226. package/registry/components/navigation/steps/Steps.tsx +43 -0
  227. package/registry/components/navigation/steps/demo.tsx +19 -0
  228. package/registry/components/navigation/steps/meta.json +17 -0
  229. package/registry/components/navigation/tabbar/Tabbar.tsx +33 -0
  230. package/registry/components/navigation/tabbar/demo.tsx +16 -0
  231. package/registry/components/navigation/tabbar/meta.json +18 -0
  232. package/registry/components/navigation/tabs/Tabs.tsx +50 -0
  233. package/registry/components/navigation/tabs/demo.tsx +15 -0
  234. package/registry/components/navigation/tabs/meta.json +18 -0
  235. package/registry/components/navigation/topbar/Topbar.tsx +39 -0
  236. package/registry/components/navigation/topbar/demo.tsx +26 -0
  237. package/registry/components/navigation/topbar/meta.json +17 -0
  238. package/registry/components/overlays/overlay-system/demo.tsx +52 -0
  239. package/registry/components/overlays/overlay-system/meta.json +20 -0
  240. package/registry/components/overlays/overlay-system/overlays.tsx +360 -0
  241. package/registry/components/overlays/success-check/SuccessCheck.tsx +42 -0
  242. package/registry/components/overlays/success-check/demo.tsx +19 -0
  243. package/registry/components/overlays/success-check/meta.json +28 -0
  244. package/registry/components/primitives/avatar/Avatar.tsx +46 -0
  245. package/registry/components/primitives/avatar/demo.tsx +20 -0
  246. package/registry/components/primitives/avatar/meta.json +19 -0
  247. package/registry/components/primitives/badge/Badge.tsx +15 -0
  248. package/registry/components/primitives/badge/demo.tsx +9 -0
  249. package/registry/components/primitives/badge/meta.json +13 -0
  250. package/registry/components/primitives/button/Button.tsx +53 -0
  251. package/registry/components/primitives/button/demo.tsx +28 -0
  252. package/registry/components/primitives/button/meta.json +17 -0
  253. package/registry/components/primitives/checkbox/Checkbox.tsx +30 -0
  254. package/registry/components/primitives/checkbox/demo.tsx +16 -0
  255. package/registry/components/primitives/checkbox/meta.json +18 -0
  256. package/registry/components/primitives/chip/Chip.tsx +35 -0
  257. package/registry/components/primitives/chip/demo.tsx +15 -0
  258. package/registry/components/primitives/chip/meta.json +13 -0
  259. package/registry/components/primitives/copy-button/CopyButton.tsx +49 -0
  260. package/registry/components/primitives/copy-button/demo.tsx +15 -0
  261. package/registry/components/primitives/copy-button/meta.json +31 -0
  262. package/registry/components/primitives/field/Field.tsx +81 -0
  263. package/registry/components/primitives/field/demo.tsx +21 -0
  264. package/registry/components/primitives/field/meta.json +19 -0
  265. package/registry/components/primitives/icon/Icon.tsx +26 -0
  266. package/registry/components/primitives/icon/demo.tsx +25 -0
  267. package/registry/components/primitives/icon/icons.ts +208 -0
  268. package/registry/components/primitives/icon/meta.json +17 -0
  269. package/registry/components/primitives/icon-button/IconButton.tsx +42 -0
  270. package/registry/components/primitives/icon-button/demo.tsx +14 -0
  271. package/registry/components/primitives/icon-button/meta.json +17 -0
  272. package/registry/components/primitives/icon-tile/IconTile.tsx +37 -0
  273. package/registry/components/primitives/icon-tile/demo.tsx +16 -0
  274. package/registry/components/primitives/icon-tile/meta.json +17 -0
  275. package/registry/components/primitives/kbd/Kbd.tsx +11 -0
  276. package/registry/components/primitives/kbd/demo.tsx +9 -0
  277. package/registry/components/primitives/kbd/meta.json +13 -0
  278. package/registry/components/primitives/live-dot/LiveDot.tsx +15 -0
  279. package/registry/components/primitives/live-dot/demo.tsx +11 -0
  280. package/registry/components/primitives/live-dot/meta.json +13 -0
  281. package/registry/components/primitives/pill/Pill.tsx +52 -0
  282. package/registry/components/primitives/pill/demo.tsx +24 -0
  283. package/registry/components/primitives/pill/meta.json +38 -0
  284. package/registry/components/primitives/search-input/SearchInput.tsx +23 -0
  285. package/registry/components/primitives/search-input/demo.tsx +13 -0
  286. package/registry/components/primitives/search-input/meta.json +17 -0
  287. package/registry/components/primitives/skeleton/Skeleton.tsx +21 -0
  288. package/registry/components/primitives/skeleton/demo.tsx +11 -0
  289. package/registry/components/primitives/skeleton/meta.json +13 -0
  290. package/registry/components/primitives/slide-to-confirm/SlideToConfirm.tsx +60 -0
  291. package/registry/components/primitives/slide-to-confirm/demo.tsx +16 -0
  292. package/registry/components/primitives/slide-to-confirm/meta.json +13 -0
  293. package/registry/components/primitives/slider/Slider.tsx +155 -0
  294. package/registry/components/primitives/slider/demo.tsx +33 -0
  295. package/registry/components/primitives/slider/meta.json +16 -0
  296. package/registry/components/primitives/spinner/Spinner.tsx +6 -0
  297. package/registry/components/primitives/spinner/demo.tsx +10 -0
  298. package/registry/components/primitives/spinner/meta.json +13 -0
  299. package/registry/components/primitives/stepper/Stepper.tsx +36 -0
  300. package/registry/components/primitives/stepper/demo.tsx +14 -0
  301. package/registry/components/primitives/stepper/meta.json +17 -0
  302. package/registry/components/primitives/switch/Switch.tsx +37 -0
  303. package/registry/components/primitives/switch/demo.tsx +15 -0
  304. package/registry/components/primitives/switch/meta.json +19 -0
  305. package/registry/index.json +3303 -0
  306. package/registry/lib/chart-math.ts +23 -0
  307. package/registry/lib/cn.ts +41 -0
  308. package/registry/lib/motion.ts +104 -0
  309. package/registry/package.json +16 -0
  310. package/registry/templates/brisko/Template.tsx +149 -0
  311. package/registry/templates/brisko/data.ts +32 -0
  312. package/registry/templates/brisko/template.json +11 -0
  313. package/registry/templates/kavora/Template.tsx +44 -0
  314. package/registry/templates/kavora/data.ts +21 -0
  315. package/registry/templates/kavora/pages/Orders.tsx +58 -0
  316. package/registry/templates/kavora/pages/Overview.tsx +78 -0
  317. package/registry/templates/kavora/template.json +12 -0
  318. package/registry/templates/kestro-desk/Template.tsx +61 -0
  319. package/registry/templates/kestro-desk/data.ts +31 -0
  320. package/registry/templates/kestro-desk/pages/History.tsx +64 -0
  321. package/registry/templates/kestro-desk/pages/Overview.tsx +91 -0
  322. package/registry/templates/kestro-desk/template.json +12 -0
  323. package/registry/templates/rapport/Template.tsx +36 -0
  324. package/registry/templates/rapport/data.ts +28 -0
  325. package/registry/templates/rapport/pages/Customers.tsx +49 -0
  326. package/registry/templates/rapport/pages/Pipeline.tsx +92 -0
  327. package/registry/templates/rapport/template.json +12 -0
  328. package/registry/templates/sagewell/Template.tsx +21 -0
  329. package/registry/templates/sagewell/pages/Cards.tsx +49 -0
  330. package/registry/templates/sagewell/pages/Home.tsx +53 -0
  331. package/registry/templates/sagewell/pages/Send.tsx +37 -0
  332. package/registry/templates/sagewell/template.json +13 -0
  333. package/registry/tokens/base.css +37 -0
  334. package/registry/tokens/index.css +8 -0
  335. package/registry/tokens/tailwind.css +83 -0
  336. package/registry/tokens/themes/brisko.css +34 -0
  337. package/registry/tokens/themes/kavora.css +32 -0
  338. package/registry/tokens/themes/kestro.css +32 -0
  339. package/registry/tokens/themes/rapport.css +35 -0
  340. package/registry/tokens/themes/sagewell.css +34 -0
  341. package/server.mjs +358 -0
package/README.md CHANGED
@@ -1,3 +1,83 @@
1
- # Temporary Holding Version
1
+ # Softricity UI
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **63 dashboard components and 5 full templates for Next.js 15 + Tailwind CSS v4 + TypeScript — served to your AI through MCP.**
4
+
5
+ Ask your AI assistant for a sortable table, a KPI row, a command palette or a whole dashboard. It finds the right part, copies the source into your project (you own it, edit anything), wires the theme, and tells you what to install. No runtime package, no lock-in.
6
+
7
+ - **Components:** buttons, fields, tabs, segmented controls, sidebar, dock, ⌘K finder, KPI cards, data table, charts (area, bars, capsules, ring, donut), drawers, modals, menus, toasts, sign-in, pay card, keypad…
8
+ - **Templates:** trading desk, coffee-trading admin, ops automation, CRM, mobile banking.
9
+ - **Themes:** `kestro` · `kavora` · `brisko` · `rapport` · `sagewell`, light + dark — or make your own brand theme in one call.
10
+ - **Low token use:** short text answers; code and full rebuild prompts only when the AI asks.
11
+
12
+ ## Install in your AI app
13
+
14
+ Needs Node 18.17+. The server runs on your machine via `npx`.
15
+
16
+ **Claude Code**
17
+ ```bash
18
+ claude mcp add softricity-ui -- npx -y softricity-ui
19
+ ```
20
+
21
+ **Claude Desktop** — Settings → Developer → Edit config (`claude_desktop_config.json`):
22
+ ```json
23
+ { "mcpServers": { "softricity-ui": { "command": "npx", "args": ["-y", "softricity-ui"] } } }
24
+ ```
25
+
26
+ **Cursor** — `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project): same JSON as above.
27
+
28
+ **VS Code (Copilot agent mode)** — `.vscode/mcp.json`:
29
+ ```json
30
+ { "servers": { "softricity-ui": { "type": "stdio", "command": "npx", "args": ["-y", "softricity-ui"] } } }
31
+ ```
32
+
33
+ **Windsurf** — `~/.codeium/windsurf/mcp_config.json`: same JSON as Claude Desktop.
34
+
35
+ Windows: if `npx` is not found by your app, use `"command": "cmd", "args": ["/c", "npx", "-y", "softricity-ui"]`.
36
+
37
+ ## Then just ask
38
+
39
+ > Set up Softricity UI in this project with the kavora theme.
40
+ > Add a sortable orders table and a row of KPI cards to the dashboard page.
41
+ > Make a theme called "acme" from our brand purple #6d28d9 and use it.
42
+ > Add the rapport CRM template.
43
+ > Which parts did I change since I added them?
44
+
45
+ Your project needs Next.js (App Router) and Tailwind CSS v4 (`npx create-next-app@latest` includes both).
46
+
47
+ ## Tools
48
+
49
+ | Tool | What it does |
50
+ |---|---|
51
+ | `ui_overview` | what's available — start here |
52
+ | `ui_search` | find parts by words or names (`"sortable table"`, `"segmented"`) |
53
+ | `ui_component` | one part: `meta` (default) · `code` · `demo` · `prompt` (self-contained rebuild prompt) |
54
+ | `ui_match` | "do you already have something like X?" |
55
+ | `ui_tokens` | theme colors, radii, type sizes |
56
+ | `ui_template` | list templates / one template's pages and parts |
57
+ | `ui_project` | your project: set up?, theme, installed parts, which ones you modified |
58
+ | `ui_init` | one-time setup: config, theme tokens, `globals.css` import |
59
+ | `ui_add` | copy parts + their dependencies into `ui/` (never overwrites your edits unless asked) |
60
+ | `ui_add_template` | copy a whole template + a route (`/t/<id>`) |
61
+ | `ui_theme_create` | new brand theme from your colors (light + dark) |
62
+
63
+ ## What gets written to your project
64
+
65
+ ```
66
+ uilib.json settings (folder, import alias, themes)
67
+ ui/tokens/ base.css, tailwind.css, themes/<theme>.css, index.css
68
+ ui/lib/ small helpers (cn, motion, chart math)
69
+ ui/components/<cat>/<id>/ the parts you added — edit freely
70
+ ui/templates/<id>/ templates you added
71
+ app/globals.css + one @import line for the tokens
72
+ ```
73
+ Put the theme on `<html>`: `<html data-ui-theme="kavora" data-theme="light">`. Parts with overlays need `<OverlayHost />` once in your root layout. All parts use `tailwind-merge`, and many use `gsap` for motion (`npm i tailwind-merge gsap`; the AI or CLI tells you which).
74
+
75
+ ## CLI (same package, no AI needed)
76
+
77
+ ```bash
78
+ npx softricity-ui init --theme kavora
79
+ npx softricity-ui list
80
+ npx softricity-ui add data-table kpi-card
81
+ npx softricity-ui template rapport
82
+ npx softricity-ui prompt pay-card --theme sagewell --out pay-card.md
83
+ ```
package/lib/cli.mjs ADDED
@@ -0,0 +1,322 @@
1
+ #!/usr/bin/env node
2
+ // uilib — copy registry components, themes and templates into a Next.js + Tailwind v4 project.
3
+ // shadcn-style: files are copied into your repo (you own them), imports rewritten to your alias.
4
+ // No dependencies. Node 18+.
5
+ import { existsSync, mkdirSync, readFileSync, writeFileSync, readdirSync, statSync, copyFileSync } from 'node:fs';
6
+ import { dirname, join, relative, resolve, posix } from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
8
+ import { execSync } from 'node:child_process';
9
+
10
+ const CLI_DIR = dirname(fileURLToPath(import.meta.url));
11
+ const CWD = process.cwd();
12
+ const CONFIG = 'uilib.json';
13
+ /** Command name shown in messages (the npm package sets softricity-ui). */
14
+ const BIN = process.env.UILIB_BIN ?? 'uilib';
15
+
16
+ /* ---------- args ---------- */
17
+ const argv = process.argv.slice(2);
18
+ const flags = {};
19
+ const pos = [];
20
+ for (let i = 0; i < argv.length; i++) {
21
+ const a = argv[i];
22
+ if (a.startsWith('--')) {
23
+ const [k, v] = a.slice(2).split('=');
24
+ if (v !== undefined) flags[k] = v;
25
+ else if (argv[i + 1] && !argv[i + 1].startsWith('--') && ['registry', 'dir', 'alias', 'theme', 'route', 'css', 'out'].includes(k)) flags[k] = argv[++i];
26
+ else flags[k] = true;
27
+ } else pos.push(a);
28
+ }
29
+ const [cmd, ...rest] = pos;
30
+
31
+ /* ---------- output ---------- */
32
+ const c = (n) => (s) => (process.stdout.isTTY ? `\x1b[${n}m${s}\x1b[0m` : s);
33
+ const bold = c(1), dim = c(2), green = c(32), yellow = c(33), red = c(31), cyan = c(36);
34
+ const log = (...a) => console.log(...a);
35
+ const die = (msg) => { console.error(red(`✖ ${msg}`)); process.exit(1); };
36
+
37
+ /* ---------- registry ---------- */
38
+ // Registry: flag → env → bundled next to this file (npm package: lib/../registry) → repo (cli/bin/../../registry).
39
+ const REG = resolve(flags.registry ?? process.env.UILIB_REGISTRY ?? [join(CLI_DIR, '..', 'registry'), join(CLI_DIR, '..', '..', 'registry')].find((p) => existsSync(join(p, 'index.json'))) ?? join(CLI_DIR, '..', '..', 'registry'));
40
+ if (!existsSync(join(REG, 'index.json'))) die(`registry not found at ${REG} (use --registry <path> or UILIB_REGISTRY)`);
41
+ const index = JSON.parse(readFileSync(join(REG, 'index.json'), 'utf8'));
42
+ const byKey = new Map(index.components.map((m) => [`${m.category}/${m.id}`, m]));
43
+ const byId = new Map(index.components.map((m) => [m.id, m]));
44
+ const findComp = (q) => byKey.get(q) ?? byId.get(q) ?? index.components.find((m) => m.name.toLowerCase() === q.toLowerCase() || (m.aliases ?? []).some((a) => a.toLowerCase() === q.toLowerCase()));
45
+
46
+ /* ---------- project config ---------- */
47
+ const cfgPath = join(CWD, CONFIG);
48
+ const loadCfg = () => {
49
+ if (!existsSync(cfgPath)) die(`no ${CONFIG} here. Run: npx ${BIN} init`);
50
+ return JSON.parse(readFileSync(cfgPath, 'utf8'));
51
+ };
52
+
53
+ /** Rewrite @ui/... imports to the project alias. */
54
+ const rewrite = (src, alias) => src.replace(/(['"])@ui\//g, `$1${alias}/`);
55
+
56
+ function writeFile(dest, content, { force } = {}) {
57
+ const rel = relative(CWD, dest);
58
+ if (existsSync(dest) && !force) {
59
+ if (readFileSync(dest, 'utf8') === content) return log(dim(` = ${rel}`));
60
+ return log(yellow(` ! ${rel} exists and differs — skipped (use --overwrite)`));
61
+ }
62
+ mkdirSync(dirname(dest), { recursive: true });
63
+ writeFileSync(dest, content);
64
+ log(green(` + ${rel}`));
65
+ }
66
+
67
+ /* ---------- dependency resolution ---------- */
68
+ const LIB_RE = /@ui\/lib\/([\w-]+)/g;
69
+ const COMP_RE = /@ui\/components\/([\w-]+\/[\w-]+)\//g;
70
+
71
+ /** All component keys + lib files needed by these keys (deps followed recursively, imports scanned). */
72
+ function resolveDeps(keys) {
73
+ const comps = new Set();
74
+ const libs = new Set();
75
+ const npm = new Set();
76
+ const visit = (k) => {
77
+ if (comps.has(k)) return;
78
+ const m = byKey.get(k);
79
+ if (!m) die(`unknown component ${k}`);
80
+ comps.add(k);
81
+ (m.npmDeps ?? []).forEach((d) => npm.add(d));
82
+ for (const f of m.files) {
83
+ const src = readFileSync(join(REG, 'components', k, f), 'utf8');
84
+ for (const x of src.matchAll(LIB_RE)) libs.add(x[1]);
85
+ for (const x of src.matchAll(COMP_RE)) visit(x[1]);
86
+ }
87
+ (m.registryDeps ?? []).forEach(visit);
88
+ };
89
+ keys.forEach(visit);
90
+ // lib files may import each other / gsap
91
+ for (const l of [...libs]) {
92
+ const src = readFileSync(join(REG, 'lib', `${l}.ts`), 'utf8');
93
+ for (const x of src.matchAll(LIB_RE)) libs.add(x[1]);
94
+ // every bare package a lib file imports (gsap, tailwind-merge, …)
95
+ for (const x of src.matchAll(/from '((?:@[\w-]+\/)?[a-z][\w-]*)(?:\/[^']*)?'/g)) npm.add(x[1]);
96
+ }
97
+ return { comps: [...comps], libs: [...libs], npm: [...npm] };
98
+ }
99
+
100
+ function copyComponents(keys, cfg, opts) {
101
+ const { comps, libs, npm } = resolveDeps(keys);
102
+ const out = resolve(CWD, cfg.dir);
103
+ log(bold(`\nComponents (${comps.length})`));
104
+ for (const k of comps) {
105
+ const m = byKey.get(k);
106
+ const files = [...m.files, ...(opts.demo ? ['demo.tsx'] : [])];
107
+ for (const f of files) {
108
+ const src = join(REG, 'components', k, f);
109
+ if (existsSync(src)) writeFile(join(out, 'components', k, f), rewrite(readFileSync(src, 'utf8'), cfg.alias), opts);
110
+ }
111
+ }
112
+ log(bold(`\nLib (${libs.length})`));
113
+ for (const l of libs) writeFile(join(out, 'lib', `${l}.ts`), rewrite(readFileSync(join(REG, 'lib', `${l}.ts`), 'utf8'), cfg.alias), opts);
114
+ return npm;
115
+ }
116
+
117
+ function installNpm(pkgs) {
118
+ const pj = existsSync(join(CWD, 'package.json')) ? JSON.parse(readFileSync(join(CWD, 'package.json'), 'utf8')) : {};
119
+ const have = { ...pj.dependencies, ...pj.devDependencies };
120
+ const missing = pkgs.filter((p) => !have[p]);
121
+ if (!missing.length) return;
122
+ const pm = existsSync(join(CWD, 'pnpm-lock.yaml')) ? 'pnpm add' : existsSync(join(CWD, 'yarn.lock')) ? 'yarn add' : existsSync(join(CWD, 'bun.lockb')) ? 'bun add' : 'npm install';
123
+ const line = `${pm} ${missing.join(' ')}`;
124
+ if (flags['no-install']) return log(yellow(`\nRun: ${line}`));
125
+ log(bold(`\nInstalling: ${line}`));
126
+ try { execSync(line, { stdio: 'inherit', cwd: CWD }); } catch { log(yellow(`Install failed. Run it yourself: ${line}`)); }
127
+ }
128
+
129
+ /* ---------- tokens ---------- */
130
+ function writeTokens(cfg, opts) {
131
+ const out = join(resolve(CWD, cfg.dir), 'tokens');
132
+ const themes = [...new Set(cfg.themes ?? [cfg.theme])];
133
+ writeFile(join(out, 'base.css'), readFileSync(join(REG, 'tokens', 'base.css'), 'utf8'), opts);
134
+ writeFile(join(out, 'tailwind.css'), readFileSync(join(REG, 'tokens', 'tailwind.css'), 'utf8'), opts);
135
+ for (const t of themes) {
136
+ const p = join(REG, 'tokens', 'themes', `${t}.css`);
137
+ if (!existsSync(p)) {
138
+ // Custom theme made in the project (e.g. by the MCP ui_theme_create tool): keep it.
139
+ if (existsSync(join(out, 'themes', `${t}.css`))) continue;
140
+ die(`unknown theme ${t}. Themes: ${index.themes.join(', ')}`);
141
+ }
142
+ writeFile(join(out, 'themes', `${t}.css`), readFileSync(p, 'utf8'), opts);
143
+ }
144
+ const idx = `/* Generated by uilib. Import once after \`@import "tailwindcss";\` */\n@import './base.css';\n${themes.map((t) => `@import './themes/${t}.css';`).join('\n')}\n@import './tailwind.css';\n`;
145
+ writeFile(join(out, 'index.css'), idx, { force: true });
146
+ }
147
+
148
+ /** Add the tokens import to the global css (after tailwindcss). */
149
+ function wireCss(cfg) {
150
+ const css = resolve(CWD, cfg.css);
151
+ if (!existsSync(css)) return log(yellow(`\n! ${cfg.css} not found. Add this after @import "tailwindcss":\n @import "${posix.normalize(relative(dirname(css), join(resolve(CWD, cfg.dir), 'tokens', 'index.css')).split('\\').join('/'))}";`));
152
+ let s = readFileSync(css, 'utf8');
153
+ const rel = relative(dirname(css), join(resolve(CWD, cfg.dir), 'tokens', 'index.css')).split('\\').join('/');
154
+ const line = `@import "${rel.startsWith('.') ? rel : `./${rel}`}";`;
155
+ if (s.includes(line)) return;
156
+ if (!/@import\s+["']tailwindcss["']/.test(s)) log(yellow(`! ${cfg.css} has no @import "tailwindcss" — uilib needs Tailwind v4.`));
157
+ s = /@import\s+["']tailwindcss["'];?/.test(s) ? s.replace(/(@import\s+["']tailwindcss["'];?)/, `$1\n${line}`) : `${line}\n${s}`;
158
+ writeFileSync(css, s);
159
+ log(green(` ~ ${relative(CWD, css)} (imports tokens)`));
160
+ }
161
+
162
+ /* ---------- commands ---------- */
163
+ function help() {
164
+ log((`${bold('uilib')} — copy UI Library parts into a Next.js + Tailwind v4 project
165
+
166
+ ${bold('Usage')}
167
+ uilib init [--theme kestro] [--dir ui] [--alias @/ui] [--css app/globals.css]
168
+ uilib list [category]
169
+ uilib info <component>
170
+ uilib add <component...> [--demo] [--overwrite] [--no-install]
171
+ uilib theme <name> [--add] switch (or --add another) theme
172
+ uilib template <id> [--route t/<id>] copy a full template + its parts + a route
173
+ uilib templates list templates
174
+ uilib prompt <component|template:<id>> [--theme x] [--out file.md]
175
+ self-contained rebuild prompt for any AI (stdout or file)
176
+
177
+ ${bold('Options')}
178
+ --registry <path> registry folder (default: next to this CLI) · env UILIB_REGISTRY
179
+
180
+ Themes: ${index.themes.join(', ')}
181
+ Components are matched by id, category/id, name or source alias (e.g. "Seg", ".kpi").`).replaceAll('uilib ', `${BIN} `).replace('uilib', BIN));
182
+ }
183
+
184
+ function init() {
185
+ if (existsSync(cfgPath) && !flags.overwrite) die(`${CONFIG} already exists (use --overwrite)`);
186
+ const appDir = existsSync(join(CWD, 'src', 'app')) ? 'src/app' : 'app';
187
+ const srcBase = appDir.startsWith('src') ? 'src/' : '';
188
+ const theme = flags.theme ?? 'kestro';
189
+ if (!index.themes.includes(theme)) die(`unknown theme ${theme}. Themes: ${index.themes.join(', ')}`);
190
+ const cfg = { $schema: 'uilib/1', dir: flags.dir ?? `${srcBase}ui`, alias: flags.alias ?? '@/ui', css: flags.css ?? `${appDir}/globals.css`, theme, themes: [theme], appDir };
191
+ writeFileSync(cfgPath, JSON.stringify(cfg, null, 2) + '\n');
192
+ log(green(` + ${CONFIG}`));
193
+ writeTokens(cfg, { force: !!flags.overwrite });
194
+ wireCss(cfg);
195
+ // alias check
196
+ const ts = ['tsconfig.json', 'jsconfig.json'].map((f) => join(CWD, f)).find(existsSync);
197
+ const paths = ts ? JSON.parse(readFileSync(ts, 'utf8').replace(/\/\/.*$/gm, '')).compilerOptions?.paths ?? {} : {};
198
+ const aliasOk = Object.keys(paths).some((p) => cfg.alias.startsWith(p.replace('/*', '')));
199
+ log(`\n${bold('Next steps')}
200
+ 1. Put the theme on <html>: <html data-ui-theme="${theme}" data-theme="light">
201
+ 2. Load the Urbanist font (or set --font) — e.g. next/font/google Urbanist, then style={{'--font': 'var(--font-urbanist)'}} on <html>.
202
+ 3. Add parts: npx ${BIN} add button card overlay-system
203
+ ${aliasOk ? '' : yellow(` ! tsconfig has no path covering "${cfg.alias}". Add "paths": { "@/*": ["./${srcBase}*"] }`)}`);
204
+ }
205
+
206
+ function list() {
207
+ const cat = rest[0];
208
+ for (const k of index.categories.filter((x) => !cat || x === cat)) {
209
+ log(bold(`\n${k}`));
210
+ for (const m of index.components.filter((x) => x.category === k)) log(` ${cyan(m.id.padEnd(18))} ${dim(m.description.slice(0, 90))}`);
211
+ }
212
+ }
213
+
214
+ function info() {
215
+ const m = findComp(rest[0] ?? '') ?? die(`no component "${rest[0]}"`);
216
+ const { comps, libs, npm } = resolveDeps([`${m.category}/${m.id}`]);
217
+ log(`${bold(m.name)} ${dim(`${m.category}/${m.id}`)}\n${m.description}\n
218
+ exports: ${m.exports.join(', ')}
219
+ variants: ${m.variants.join(', ') || '—'}
220
+ brings: ${comps.join(', ')}
221
+ lib: ${libs.join(', ') || '—'}
222
+ npm: ${npm.join(', ') || '—'}
223
+ sources: ${Object.keys(m.sources ?? {}).join(', ')}
224
+ aliases: ${(m.aliases ?? []).join(' · ')}${m.notes ? `\nnotes: ${m.notes}` : ''}`);
225
+ }
226
+
227
+ function add() {
228
+ if (!rest.length) die(`which components? e.g. ${BIN} add button data-table`);
229
+ const cfg = loadCfg();
230
+ const keys = rest.map((q) => { const m = findComp(q); if (!m) die(`no component "${q}" (try: uilib list)`); return `${m.category}/${m.id}`; });
231
+ const npm = copyComponents(keys, cfg, { demo: !!flags.demo, force: !!flags.overwrite });
232
+ installNpm(npm);
233
+ const first = byKey.get(keys[0]);
234
+ log(`\n${green('✔ done')} import { ${first.exports[0]} } from '${cfg.alias}/components/${keys[0]}/${first.files[0].replace(/\.tsx?$/, '')}';`);
235
+ if (keys.some((k) => resolveDeps([k]).comps.includes('overlays/overlay-system'))) log(dim(' Uses overlays: mount <OverlayHost /> once in your root layout.'));
236
+ }
237
+
238
+ function theme() {
239
+ const name = rest[0] ?? die('which theme? ' + index.themes.join(', '));
240
+ if (!index.themes.includes(name)) die(`unknown theme ${name}`);
241
+ const cfg = loadCfg();
242
+ cfg.themes = flags.add ? [...new Set([...(cfg.themes ?? [cfg.theme]), name])] : [name];
243
+ if (!flags.add) cfg.theme = name;
244
+ writeFileSync(cfgPath, JSON.stringify(cfg, null, 2) + '\n');
245
+ writeTokens(cfg, { force: !!flags.overwrite });
246
+ log(`\nSet ${bold(`data-ui-theme="${cfg.theme}"`)} on <html>.${flags.add ? ` Wrappers can use data-ui-theme="${name}".` : ''}`);
247
+ }
248
+
249
+ function templates() {
250
+ for (const t of index.templates) log(` ${cyan(t.id.padEnd(14))} ${t.device.padEnd(8)} ${dim(`${t.pages.length} pages · ${t.components.length} parts · theme ${t.theme}`)} ${t.description.slice(0, 70)}`);
251
+ }
252
+
253
+ function template() {
254
+ const id = rest[0] ?? die('which template? uilib templates');
255
+ const t = index.templates.find((x) => x.id === id) ?? die(`no template ${id}`);
256
+ const cfg = loadCfg();
257
+ const opts = { force: !!flags.overwrite };
258
+ // theme
259
+ if (!(cfg.themes ?? []).includes(t.theme)) { cfg.themes = [...(cfg.themes ?? [cfg.theme]), t.theme]; writeFileSync(cfgPath, JSON.stringify(cfg, null, 2) + '\n'); writeTokens(cfg, { force: !!flags.overwrite }); }
260
+ // parts
261
+ const npm = copyComponents(t.components, cfg, opts);
262
+ // template files
263
+ const src = join(REG, 'templates', id);
264
+ const dest = join(resolve(CWD, cfg.dir), 'templates', id);
265
+ log(bold('\nTemplate'));
266
+ const walk = (d) => { for (const f of readdirSync(d)) { const p = join(d, f); if (statSync(p).isDirectory()) walk(p); else if (/\.(tsx?|json)$/.test(f)) writeFile(join(dest, relative(src, p)), rewrite(readFileSync(p, 'utf8'), cfg.alias), opts); } };
267
+ walk(src);
268
+ // route
269
+ const route = flags.route ?? `t/${id}`;
270
+ const routeDir = join(resolve(CWD, cfg.appDir ?? 'app'), ...route.split('/'), '[[...page]]');
271
+ writeFile(join(routeDir, 'page.tsx'), `import { TemplateRoute } from './TemplateRoute';
272
+
273
+ const PAGES = ${JSON.stringify(t.pages.map((p) => p.id))};
274
+ export const generateStaticParams = () => [{ page: [] }, ...PAGES.map((p) => ({ page: [p] }))];
275
+
276
+ export default async function Page({ params }: { params: Promise<{ page?: string[] }> }) {
277
+ const { page } = await params;
278
+ return <TemplateRoute page={page?.[0] ?? PAGES[0]} />;
279
+ }
280
+ `, opts);
281
+ writeFile(join(routeDir, 'TemplateRoute.tsx'), `'use client';
282
+ // ${t.name} template route (generated by uilib). The template forces its theme on <html>.
283
+ import { useEffect } from 'react';
284
+ import { useRouter } from 'next/navigation';
285
+ import Template from '${cfg.alias}/templates/${id}/Template';
286
+ import { OverlayHost } from '${cfg.alias}/components/overlays/overlay-system/overlays';
287
+
288
+ export function TemplateRoute({ page }: { page: string }) {
289
+ const router = useRouter();
290
+ useEffect(() => {
291
+ const h = document.documentElement;
292
+ const prev = h.dataset.uiTheme;
293
+ h.dataset.uiTheme = '${t.theme}';
294
+ return () => { if (prev) h.dataset.uiTheme = prev; };
295
+ }, []);
296
+ return (
297
+ <>
298
+ <Template page={page} go={(p) => router.push('/${route}/' + p)} />
299
+ <OverlayHost />
300
+ </>
301
+ );
302
+ }
303
+ `, opts);
304
+ installNpm([...new Set([...npm, 'gsap'])]);
305
+ log(`\n${green('✔ done')} open /${route}`);
306
+ }
307
+
308
+ async function prompt() {
309
+ const q = rest[0] ?? die('which component or template:<id>?');
310
+ const local = new URL('./prompt-lib.mjs', import.meta.url); // inside the npm package
311
+ const { createPromptKit } = await import(existsSync(fileURLToPath(local)) ? local.href : new URL('../../scripts/prompt-lib.mjs', import.meta.url).href);
312
+ const kit = createPromptKit(REG);
313
+ if (flags.theme && !index.themes.includes(flags.theme)) die(`unknown theme ${flags.theme}`);
314
+ let md;
315
+ if (q.startsWith('template:')) md = kit.templatePrompt(q.slice(9), { theme: flags.theme });
316
+ else { const m = findComp(q) ?? die(`no component "${q}"`); md = kit.componentPrompt(`${m.category}/${m.id}`, { theme: flags.theme ?? 'kestro' }); }
317
+ if (flags.out) { writeFileSync(resolve(CWD, flags.out), md); log(green(` + ${flags.out}`), dim(`(${(md.length / 1024).toFixed(1)} KB ≈ ${Math.round(md.length / 4)} tokens)`)); }
318
+ else process.stdout.write(md);
319
+ }
320
+
321
+ const CMDS = { init, list, info, add, theme, templates, template, prompt, help };
322
+ await (CMDS[cmd] ?? help)();
@@ -0,0 +1,215 @@
1
+ // Replicate-prompt generator. One self-contained Markdown prompt per component or template:
2
+ // any AI (or person) can rebuild the exact part from it with no access to this repo.
3
+ // Context-lean on purpose: only the tokens, utilities, keyframes and icons the code actually uses.
4
+ // Used by scripts/build-prompts.mjs and `uilib prompt`.
5
+ import { readFileSync, existsSync, readdirSync, statSync } from 'node:fs';
6
+ import { join, relative } from 'node:path';
7
+
8
+ const LIB_RE = /@ui\/lib\/([\w-]+)/g;
9
+ const COMP_RE = /@ui\/components\/([\w-]+\/[\w-]+)\//g;
10
+ const ALIAS = '@/ui';
11
+ const rewrite = (s) => s.replace(/(['"])@ui\//g, `$1${ALIAS}/`);
12
+ const read = (p) => readFileSync(p, 'utf8');
13
+ const fence = (lang, title, code) => `\`\`\`${lang} title="${title}"\n${code.replace(/\s+$/, '')}\n\`\`\``;
14
+
15
+ export function createPromptKit(REG) {
16
+ const index = JSON.parse(read(join(REG, 'index.json')));
17
+ const byKey = new Map(index.components.map((m) => [`${m.category}/${m.id}`, m]));
18
+ const tw = read(join(REG, 'tokens', 'tailwind.css'));
19
+ const base = read(join(REG, 'tokens', 'base.css'));
20
+
21
+ // name in utility → css var. e.g. card-2 → --card-2, text size md → --fs-md, rounded-lg → --r-lg
22
+ const colorMap = [...tw.matchAll(/--color-([\w-]+):\s*var\(--([\w-]+)\)/g)].map((m) => [m[1], m[2]]).sort((a, b) => b[0].length - a[0].length);
23
+ const textMap = [...tw.matchAll(/--text-([\w-]+):\s*var\(--([\w-]+)\)/g)].map((m) => [m[1], m[2]]);
24
+ const radiusMap = [...tw.matchAll(/--radius-([\w-]+):\s*var\(--([\w-]+)\)/g)].map((m) => [m[1], m[2]]);
25
+ const utilities = [...tw.matchAll(/@utility ([\w-]+) \{([^\n]*)\}\n/g)].map((m) => ({ name: m[1], body: m[0].trim() }));
26
+ const keyframes = [...base.matchAll(/@keyframes (ui-[\w-]+)[^\n]*\n/g)].map((m) => ({ name: m[1], body: m[0].trim() }));
27
+
28
+ function resolve(keys) {
29
+ const comps = [], libs = new Set(), npm = new Set(), seen = new Set();
30
+ const visit = (k) => {
31
+ if (seen.has(k)) return;
32
+ seen.add(k);
33
+ const m = byKey.get(k);
34
+ if (!m) throw new Error(`unknown component ${k}`);
35
+ (m.npmDeps ?? []).forEach((d) => npm.add(d));
36
+ for (const f of m.files) {
37
+ const src = read(join(REG, 'components', k, f));
38
+ for (const x of src.matchAll(LIB_RE)) libs.add(x[1]);
39
+ for (const x of src.matchAll(COMP_RE)) visit(x[1]);
40
+ }
41
+ (m.registryDeps ?? []).forEach(visit);
42
+ comps.push(k); // deps first
43
+ };
44
+ keys.forEach(visit);
45
+ for (const l of [...libs]) { const s = read(join(REG, 'lib', `${l}.ts`)); for (const x of s.matchAll(LIB_RE)) libs.add(x[1]); for (const x of s.matchAll(/from '((?:@[\w-]+\/)?[a-z][\w-]*)(?:\/[^']*)?'/g)) npm.add(x[1]); }
46
+ return { comps, libs: [...libs], npm: [...npm] };
47
+ }
48
+
49
+ /** Which tokens / utilities / keyframes / icons a body of code needs. */
50
+ function analyse(code) {
51
+ const vars = new Set();
52
+ for (const m of code.matchAll(/var\(--([\w-]+)/g)) vars.add(m[1]);
53
+ // Dynamic names like var(--h${hue}) / var(--c${i}) / var(--tile-${i}) → every numbered token with that prefix.
54
+ for (const m of code.matchAll(/var\(--([\w-]*)\$\{/g)) for (let i = 0; i <= 9; i++) vars.add(`${m[1]}${i}`);
55
+ // Class-like tokens. Quotes/backticks split tokens so 'bg-card' inside strings is seen.
56
+ const cls = code.match(/[\w:\-[\]/.!&>()=]+/g) ?? [];
57
+ vars.add('bg'); vars.add('ink'); // body rule in the token block
58
+ const hasClass = (re) => cls.some((c) => re.test(c));
59
+ for (const [n, v] of colorMap) if (hasClass(new RegExp(`(^|[:-])(bg|text|ring|border|fill|stroke|outline|from|to|via|shadow|accent|decoration|caret|divide)-${n}(\\/\\d+)?$`))) vars.add(v);
60
+ for (const [n, v] of textMap) if (hasClass(new RegExp(`(^|:)text-${n}$`))) vars.add(v);
61
+ for (const [n, v] of radiusMap) if (hasClass(new RegExp(`(^|:)rounded(-[tblr]{1,2})?-${n}$`))) vars.add(v);
62
+ if (hasClass(/(^|:)shadow-card$/)) vars.add('shadow');
63
+ if (hasClass(/(^|:)shadow-pop$/)) vars.add('shadow-lg');
64
+ const utils = utilities.filter((u) => hasClass(new RegExp(`(^|:)${u.name}$`)));
65
+ for (const u of utils) for (const m of u.body.matchAll(/var\(--([\w-]+)/g)) vars.add(m[1]);
66
+ const kfs = keyframes.filter((k) => code.includes(k.name));
67
+ for (const k of kfs) for (const m of k.body.matchAll(/var\(--([\w-]+)/g)) vars.add(m[1]);
68
+ if (code.includes('font-sans') || true) vars.add('font');
69
+ return { vars, utils, kfs };
70
+ }
71
+
72
+ /** Values of vars for a theme (light + dark), falling back to base.css. */
73
+ function tokenBlock(vars, theme) {
74
+ const css = read(join(REG, 'tokens', 'themes', `${theme}.css`));
75
+ const [light, dark = ''] = css.split(/\[data-theme='dark'\]/);
76
+ const pick = (src) => Object.fromEntries([...src.matchAll(/--([\w-]+):\s*([^;]+);/g)].map((m) => [m[1], m[2].trim()]));
77
+ const L = { ...pick(base.split(/\[data-theme='dark'\] \{ --scrim/)[0]), ...pick(light) };
78
+ const D = pick(dark);
79
+ const want = [...vars].filter((v) => !v.startsWith('font-') && v !== 't');
80
+ const line = (map, v) => (map[v] !== undefined ? ` --${v}: ${map[v]};` : null);
81
+ const l = want.map((v) => line(L, v)).filter(Boolean);
82
+ const d = want.map((v) => line(D, v)).filter(Boolean);
83
+ // Scoped to the theme attribute so several themes can live in one app without bleeding.
84
+ return `[data-ui-theme='${theme}'] {\n${l.join('\n')}\n}\n[data-ui-theme='${theme}'][data-theme='dark'] {\n${d.join('\n')}\n}`;
85
+ }
86
+
87
+ /** Tailwind @theme lines for the vars in use. */
88
+ function bridge(vars) {
89
+ const lines = [];
90
+ for (const [n, v] of colorMap) if (vars.has(v)) lines.push(` --color-${n}: var(--${v});`);
91
+ const t = textMap.filter(([, v]) => vars.has(v));
92
+ if (t.length) lines.push(' --text-*: initial;', ...t.map(([n, v]) => ` --text-${n}: var(--${v});`));
93
+ for (const [n, v] of radiusMap) if (vars.has(v)) lines.push(` --radius-${n}: var(--${v});`);
94
+ if (vars.has('shadow')) lines.push(' --shadow-card: var(--shadow);');
95
+ if (vars.has('shadow-lg')) lines.push(' --shadow-pop: var(--shadow-lg);');
96
+ lines.push(' --font-sans: var(--font);');
97
+ return `@theme inline {\n${lines.join('\n')}\n}`;
98
+ }
99
+
100
+ /** icons.ts trimmed to names the code uses (string literals that are icon keys). */
101
+ function trimmedIcons(code) {
102
+ const src = read(join(REG, 'components', 'primitives', 'icon', 'icons.ts'));
103
+ const all = [...src.matchAll(/^ {2}"([^"]+)": ("(?:[^"\\]|\\.)*"),$/gm)];
104
+ const used = new Set();
105
+ for (const m of code.matchAll(/['"`]([\w-]+)['"`]/g)) used.add(m[1]);
106
+ used.add('info');
107
+ const keep = all.filter((m) => used.has(m[1]));
108
+ return `// Line icons, 24x24, stroked. Trimmed to the icons this part uses; add more from the full set when needed.\nexport const ICONS = {\n${keep.map((m) => ` ${JSON.stringify(m[1])}: ${m[2]},`).join('\n')}\n} as const satisfies Record<string, string>;\n\nexport type IconName = keyof typeof ICONS;\n`;
109
+ }
110
+
111
+ function filesFor(comps, libs, extra = []) {
112
+ const out = [];
113
+ for (const l of libs) out.push({ path: `ui/lib/${l}.ts`, code: rewrite(read(join(REG, 'lib', `${l}.ts`))) });
114
+ for (const k of comps) for (const f of byKey.get(k).files) out.push({ path: `ui/components/${k}/${f}`, code: rewrite(read(join(REG, 'components', k, f))) });
115
+ return [...out, ...extra];
116
+ }
117
+
118
+ function setupSection(theme, vars, utils, kfs, npm) {
119
+ return `## 1. Setup
120
+ - Next.js 15 App Router, React 19, TypeScript, **Tailwind CSS v4**${npm.length ? `, npm: \`${npm.join(' ')}\`` : ''}.
121
+ - Path alias \`@/*\` → project root. Files below go under \`ui/\` and import each other as \`${ALIAS}/…\`.
122
+ - Font: **Urbanist** 400–700 (Google Fonts \`https://fonts.google.com/specimen/Urbanist\`, or \`next/font/google\`). Set \`--font\` to it.
123
+ - On \`<html>\`: \`data-ui-theme="${theme}"\` and \`data-theme="light"\` (or \`"dark"\`).
124
+
125
+ ## 2. Design tokens (theme \`${theme}\`, only what this part uses)
126
+ Put in a CSS file imported **after** \`@import "tailwindcss";\`:
127
+ ${fence('css', 'ui/tokens.css', `${tokenBlock(vars, theme)}\n[data-ui-theme] > body { background: var(--bg); color: var(--ink); font-family: var(--font); }\n\n${bridge(vars)}${utils.length ? `\n\n${utils.map((u) => u.body).join('\n')}` : ''}${kfs.length ? `\n\n${kfs.map((k) => k.body).join('\n')}` : ''}`)}`;
128
+ }
129
+
130
+ function componentPrompt(key, { theme = 'kestro' } = {}) {
131
+ const m = byKey.get(key);
132
+ if (!m) throw new Error(`unknown component ${key}`);
133
+ const demoPath = join(REG, 'components', key, 'demo.tsx');
134
+ const rawDemo = existsSync(demoPath) ? read(demoPath) : '';
135
+ // The usage example may import helper parts (e.g. Button) — include them so the prompt stands alone.
136
+ const demoDeps = [...rawDemo.matchAll(COMP_RE)].map((x) => x[1]).filter((k) => byKey.has(k));
137
+ const { comps, libs, npm } = resolve([...demoDeps, key]);
138
+ const iconUsed = comps.includes('primitives/icon');
139
+ const files = filesFor(comps, libs);
140
+ const demo = rewrite(rawDemo);
141
+ const allCode = files.filter((f) => !f.path.endsWith('/icons.ts')).map((f) => f.code).join('\n') + demo;
142
+ if (iconUsed) {
143
+ const i = files.findIndex((f) => f.path.endsWith('primitives/icon/icons.ts'));
144
+ if (i >= 0) files[i] = { path: files[i].path, code: trimmedIcons(allCode) };
145
+ }
146
+ const { vars, utils, kfs } = analyse(allCode);
147
+ const src = Object.entries(m.sources ?? {}).map(([s, w]) => `${s} (${w})`).join('; ');
148
+ return `# Rebuild: ${m.name} (\`${key}\`)
149
+
150
+ ${m.description}
151
+
152
+ - **Exports:** ${m.exports.map((e) => `\`${e}\``).join(', ')}
153
+ - **Variants:** ${m.variants.join(', ') || '—'}
154
+ - **Found in:** ${src}${m.notes ? `\n- **Notes:** ${m.notes}` : ''}
155
+
156
+ Rebuild it **exactly**: same DOM, classes, motion and accessibility. Create every file below verbatim, then render the usage example.
157
+
158
+ ${setupSection(theme, vars, utils, kfs, npm)}
159
+
160
+ ## 3. Files (${files.length}, dependencies first)
161
+ ${files.map((f) => fence(f.path.endsWith('.tsx') ? 'tsx' : 'ts', f.path, f.code)).join('\n\n')}
162
+ ${demo ? `\n## 4. Usage example\n${fence('tsx', `app/demo/${m.id}/page.tsx`, demo.replace(/from '\.\/([\w-]+)'/g, `from '${ALIAS}/components/${key}/$1'`))}\n` : ''}
163
+ ## ${demo ? 5 : 4}. Check
164
+ - Renders in light and dark (\`data-theme\`) with no hard-coded colors beyond those in the code.
165
+ - Keyboard: every control reachable with Tab, visible focus ring.
166
+ - \`prefers-reduced-motion: reduce\` → animations jump to the end state.${comps.includes('overlays/overlay-system') ? '\n- Mount `<OverlayHost />` once (root layout) — overlays render there.' : ''}
167
+ `;
168
+ }
169
+
170
+ function templatePrompt(id, { theme } = {}) {
171
+ const t = index.templates.find((x) => x.id === id);
172
+ if (!t) throw new Error(`unknown template ${id}`);
173
+ const th = theme ?? t.theme;
174
+ const dir = join(REG, 'templates', id);
175
+ const tfiles = [];
176
+ const walk = (d) => { for (const f of readdirSync(d)) { const p = join(d, f); if (statSync(p).isDirectory()) walk(p); else if (/\.tsx?$/.test(f)) tfiles.push({ path: `ui/templates/${id}/${relative(dir, p).split('\\').join('/')}`, code: rewrite(read(p)) }); } };
177
+ walk(dir);
178
+ const { comps, libs, npm } = resolve(t.components);
179
+ const all = filesFor(comps, libs).map((f) => f.code).join('\n') + tfiles.map((f) => f.code).join('\n');
180
+ const { vars, utils, kfs } = analyse(all);
181
+ // Icons the template + its parts use (part prompts only carry their own icons).
182
+ if (comps.includes('primitives/icon')) tfiles.push({ path: 'ui/components/primitives/icon/icons.ts', code: trimmedIcons(all.replace(/^export const ICONS[\s\S]*?as const[^\n]*\n/m, '')) });
183
+ return `# Rebuild template: ${t.name} (\`${id}\`)
184
+
185
+ ${t.description}
186
+
187
+ - **Device:** ${t.device} · **Theme:** ${th} · **Source:** ${t.source}
188
+ - **Pages:** ${t.pages.map((p) => `\`${p.id}\` ${p.label}`).join(', ')}
189
+ - **Uses ${comps.length} registry parts:** ${comps.map((c) => `\`${c}\``).join(', ')}
190
+
191
+ The template is composition only. First get each part listed above — fastest: \`uilib add ${t.components.map((c) => c.split('/')[1]).join(' ')}\`, or rebuild each from its own prompt (\`uilib prompt <id>\`). Then create the template files below.
192
+
193
+ ${setupSection(th, vars, utils, kfs, [...new Set([...npm, 'gsap'])])}
194
+
195
+ ## 3. Template files
196
+ ${tfiles.map((f) => fence(f.path.endsWith('.tsx') ? 'tsx' : 'ts', f.path, f.code)).join('\n\n')}
197
+
198
+ ## 4. Route
199
+ ${fence('tsx', `app/t/${id}/[[...page]]/page.tsx`, `'use client';
200
+ import { use, useEffect } from 'react';
201
+ import { useRouter } from 'next/navigation';
202
+ import Template from '${ALIAS}/templates/${id}/Template';
203
+ import { OverlayHost } from '${ALIAS}/components/overlays/overlay-system/overlays';
204
+
205
+ export default function Page({ params }: { params: Promise<{ page?: string[] }> }) {
206
+ const { page } = use(params);
207
+ const router = useRouter();
208
+ useEffect(() => { document.documentElement.dataset.uiTheme = '${th}'; }, []);
209
+ return (<><Template page={page?.[0] ?? '${t.pages[0].id}'} go={(p) => router.push('/t/${id}/' + p)} /><OverlayHost /></>);
210
+ }`)}
211
+ `;
212
+ }
213
+
214
+ return { index, componentPrompt, templatePrompt, byKey };
215
+ }