@webjsdev/ui 0.3.17 → 0.5.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 (360) hide show
  1. package/README.md +67 -8
  2. package/THIRD_PARTY_NOTICES.md +349 -0
  3. package/package.json +4 -2
  4. package/packages/registry/blocks/_shared/placeholder.svg +1 -0
  5. package/packages/registry/blocks/charts/chart-area-axes.ts +72 -0
  6. package/packages/registry/blocks/charts/chart-area-default.ts +64 -0
  7. package/packages/registry/blocks/charts/chart-area-gradient.ts +82 -0
  8. package/packages/registry/blocks/charts/chart-area-icons.ts +77 -0
  9. package/packages/registry/blocks/charts/chart-area-interactive.ts +204 -0
  10. package/packages/registry/blocks/charts/chart-area-legend.ts +72 -0
  11. package/packages/registry/blocks/charts/chart-area-linear.ts +64 -0
  12. package/packages/registry/blocks/charts/chart-area-stacked-expand.ts +77 -0
  13. package/packages/registry/blocks/charts/chart-area-stacked.ts +71 -0
  14. package/packages/registry/blocks/charts/chart-area-step.ts +68 -0
  15. package/packages/registry/blocks/charts/chart-bar-active.ts +93 -0
  16. package/packages/registry/blocks/charts/chart-bar-default.ts +60 -0
  17. package/packages/registry/blocks/charts/chart-bar-horizontal.ts +62 -0
  18. package/packages/registry/blocks/charts/chart-bar-interactive.ts +185 -0
  19. package/packages/registry/blocks/charts/chart-bar-label-custom.ts +78 -0
  20. package/packages/registry/blocks/charts/chart-bar-label.ts +66 -0
  21. package/packages/registry/blocks/charts/chart-bar-mixed.ts +87 -0
  22. package/packages/registry/blocks/charts/chart-bar-multiple.ts +67 -0
  23. package/packages/registry/blocks/charts/chart-bar-negative.ts +61 -0
  24. package/packages/registry/blocks/charts/chart-bar-stacked.ts +68 -0
  25. package/packages/registry/blocks/charts/chart-line-default.ts +61 -0
  26. package/packages/registry/blocks/charts/chart-line-dots-colors.ts +86 -0
  27. package/packages/registry/blocks/charts/chart-line-dots-custom.ts +75 -0
  28. package/packages/registry/blocks/charts/chart-line-dots.ts +65 -0
  29. package/packages/registry/blocks/charts/chart-line-interactive.ts +185 -0
  30. package/packages/registry/blocks/charts/chart-line-label-custom.ts +94 -0
  31. package/packages/registry/blocks/charts/chart-line-label.ts +73 -0
  32. package/packages/registry/blocks/charts/chart-line-linear.ts +61 -0
  33. package/packages/registry/blocks/charts/chart-line-multiple.ts +71 -0
  34. package/packages/registry/blocks/charts/chart-line-step.ts +61 -0
  35. package/packages/registry/blocks/charts/chart-pie-donut-active.ts +86 -0
  36. package/packages/registry/blocks/charts/chart-pie-donut-text.ts +89 -0
  37. package/packages/registry/blocks/charts/chart-pie-donut.ts +77 -0
  38. package/packages/registry/blocks/charts/chart-pie-interactive.ts +120 -0
  39. package/packages/registry/blocks/charts/chart-pie-label-custom.ts +82 -0
  40. package/packages/registry/blocks/charts/chart-pie-label-list.ts +86 -0
  41. package/packages/registry/blocks/charts/chart-pie-label.ts +77 -0
  42. package/packages/registry/blocks/charts/chart-pie-legend.ts +79 -0
  43. package/packages/registry/blocks/charts/chart-pie-separator-none.ts +77 -0
  44. package/packages/registry/blocks/charts/chart-pie-simple.ts +77 -0
  45. package/packages/registry/blocks/charts/chart-pie-stacked.ts +99 -0
  46. package/packages/registry/blocks/charts/chart-radar-default.ts +61 -0
  47. package/packages/registry/blocks/charts/chart-radar-dots.ts +61 -0
  48. package/packages/registry/blocks/charts/chart-radar-grid-circle-fill.ts +61 -0
  49. package/packages/registry/blocks/charts/chart-radar-grid-circle-no-lines.ts +61 -0
  50. package/packages/registry/blocks/charts/chart-radar-grid-circle.ts +61 -0
  51. package/packages/registry/blocks/charts/chart-radar-grid-custom.ts +61 -0
  52. package/packages/registry/blocks/charts/chart-radar-grid-fill.ts +61 -0
  53. package/packages/registry/blocks/charts/chart-radar-grid-none.ts +60 -0
  54. package/packages/registry/blocks/charts/chart-radar-icons.ts +76 -0
  55. package/packages/registry/blocks/charts/chart-radar-label-custom.ts +77 -0
  56. package/packages/registry/blocks/charts/chart-radar-legend.ts +70 -0
  57. package/packages/registry/blocks/charts/chart-radar-lines-only.ts +68 -0
  58. package/packages/registry/blocks/charts/chart-radar-multiple.ts +68 -0
  59. package/packages/registry/blocks/charts/chart-radar-radius.ts +68 -0
  60. package/packages/registry/blocks/charts/chart-radial-grid.ts +80 -0
  61. package/packages/registry/blocks/charts/chart-radial-label.ts +85 -0
  62. package/packages/registry/blocks/charts/chart-radial-shape.ts +81 -0
  63. package/packages/registry/blocks/charts/chart-radial-simple.ts +79 -0
  64. package/packages/registry/blocks/charts/chart-radial-stacked.ts +69 -0
  65. package/packages/registry/blocks/charts/chart-radial-text.ts +82 -0
  66. package/packages/registry/blocks/charts/chart-tooltip-advanced.ts +84 -0
  67. package/packages/registry/blocks/charts/chart-tooltip-default.ts +62 -0
  68. package/packages/registry/blocks/charts/chart-tooltip-formatter.ts +75 -0
  69. package/packages/registry/blocks/charts/chart-tooltip-icons.ts +68 -0
  70. package/packages/registry/blocks/charts/chart-tooltip-indicator-line.ts +62 -0
  71. package/packages/registry/blocks/charts/chart-tooltip-indicator-none.ts +62 -0
  72. package/packages/registry/blocks/charts/chart-tooltip-label-custom.ts +65 -0
  73. package/packages/registry/blocks/charts/chart-tooltip-label-formatter.ts +66 -0
  74. package/packages/registry/blocks/charts/chart-tooltip-label-none.ts +62 -0
  75. package/packages/registry/blocks/dashboard-01/components/app-sidebar.ts +108 -0
  76. package/packages/registry/blocks/dashboard-01/components/chart-area-interactive.ts +276 -0
  77. package/packages/registry/blocks/dashboard-01/components/dashboard-data.ts +89 -0
  78. package/packages/registry/blocks/dashboard-01/components/data-table.ts +644 -0
  79. package/packages/registry/blocks/dashboard-01/components/nav-documents.ts +65 -0
  80. package/packages/registry/blocks/dashboard-01/components/nav-main.ts +61 -0
  81. package/packages/registry/blocks/dashboard-01/components/nav-secondary.ts +40 -0
  82. package/packages/registry/blocks/dashboard-01/components/nav-user.ts +66 -0
  83. package/packages/registry/blocks/dashboard-01/components/section-cards.ts +59 -0
  84. package/packages/registry/blocks/dashboard-01/components/site-header.ts +52 -0
  85. package/packages/registry/blocks/dashboard-01/page.ts +39 -0
  86. package/packages/registry/blocks/login-01/components/login-form.ts +70 -0
  87. package/packages/registry/blocks/login-01/page.ts +19 -0
  88. package/packages/registry/blocks/login-02/components/login-form.ts +68 -0
  89. package/packages/registry/blocks/login-02/page.ts +36 -0
  90. package/packages/registry/blocks/login-03/components/login-form.ts +89 -0
  91. package/packages/registry/blocks/login-03/page.ts +28 -0
  92. package/packages/registry/blocks/login-04/components/login-form.ts +91 -0
  93. package/packages/registry/blocks/login-04/page.ts +20 -0
  94. package/packages/registry/blocks/login-05/components/login-form.ts +75 -0
  95. package/packages/registry/blocks/login-05/page.ts +19 -0
  96. package/packages/registry/blocks/preview/cards/activate-agent-dialog.ts +77 -0
  97. package/packages/registry/blocks/preview/cards/analytics-card.ts +64 -0
  98. package/packages/registry/blocks/preview/cards/anomaly-alert.ts +35 -0
  99. package/packages/registry/blocks/preview/cards/bar-chart-card.ts +91 -0
  100. package/packages/registry/blocks/preview/cards/book-appointment.ts +51 -0
  101. package/packages/registry/blocks/preview/cards/codespaces-card.ts +172 -0
  102. package/packages/registry/blocks/preview/cards/contributions-activity.ts +63 -0
  103. package/packages/registry/blocks/preview/cards/contributors.ts +51 -0
  104. package/packages/registry/blocks/preview/cards/environment-variables.ts +47 -0
  105. package/packages/registry/blocks/preview/cards/feedback-form.ts +61 -0
  106. package/packages/registry/blocks/preview/cards/file-upload.ts +51 -0
  107. package/packages/registry/blocks/preview/cards/github-profile.ts +66 -0
  108. package/packages/registry/blocks/preview/cards/icon-preview-grid.ts +47 -0
  109. package/packages/registry/blocks/preview/cards/invite-team.ts +78 -0
  110. package/packages/registry/blocks/preview/cards/invoice.ts +91 -0
  111. package/packages/registry/blocks/preview/cards/live-waveform.ts +330 -0
  112. package/packages/registry/blocks/preview/cards/no-team-members.ts +61 -0
  113. package/packages/registry/blocks/preview/cards/not-found.ts +46 -0
  114. package/packages/registry/blocks/preview/cards/observability-card.ts +44 -0
  115. package/packages/registry/blocks/preview/cards/pie-chart-card.ts +84 -0
  116. package/packages/registry/blocks/preview/cards/report-bug.ts +71 -0
  117. package/packages/registry/blocks/preview/cards/shipping-address.ts +79 -0
  118. package/packages/registry/blocks/preview/cards/shortcuts.ts +57 -0
  119. package/packages/registry/blocks/preview/cards/skeleton-loading.ts +37 -0
  120. package/packages/registry/blocks/preview/cards/sleep-report.ts +85 -0
  121. package/packages/registry/blocks/preview/cards/style-overview.ts +64 -0
  122. package/packages/registry/blocks/preview/cards/typography-specimen.ts +107 -0
  123. package/packages/registry/blocks/preview/cards/ui-elements.ts +164 -0
  124. package/packages/registry/blocks/preview/cards/usage-card.ts +63 -0
  125. package/packages/registry/blocks/preview/cards/visitors.ts +71 -0
  126. package/packages/registry/blocks/preview/cards/weekly-fitness-summary.ts +54 -0
  127. package/packages/registry/blocks/preview/page.ts +103 -0
  128. package/packages/registry/blocks/preview-02/cards/account-access.ts +70 -0
  129. package/packages/registry/blocks/preview-02/cards/card-overview.ts +75 -0
  130. package/packages/registry/blocks/preview-02/cards/claimable-balance.ts +54 -0
  131. package/packages/registry/blocks/preview-02/cards/contribution-history.ts +80 -0
  132. package/packages/registry/blocks/preview-02/cards/cover-art.ts +41 -0
  133. package/packages/registry/blocks/preview-02/cards/dividend-income.ts +76 -0
  134. package/packages/registry/blocks/preview-02/cards/empty-connect-bank.ts +38 -0
  135. package/packages/registry/blocks/preview-02/cards/empty-distribute-track.ts +38 -0
  136. package/packages/registry/blocks/preview-02/cards/empty-explore-catalog.ts +39 -0
  137. package/packages/registry/blocks/preview-02/cards/faq.ts +79 -0
  138. package/packages/registry/blocks/preview-02/cards/front-door.ts +40 -0
  139. package/packages/registry/blocks/preview-02/cards/index-investing.ts +31 -0
  140. package/packages/registry/blocks/preview-02/cards/kitchen-island.ts +90 -0
  141. package/packages/registry/blocks/preview-02/cards/loading-card.ts +34 -0
  142. package/packages/registry/blocks/preview-02/cards/new-milestone.ts +53 -0
  143. package/packages/registry/blocks/preview-02/cards/notification-settings.ts +126 -0
  144. package/packages/registry/blocks/preview-02/cards/payments.ts +88 -0
  145. package/packages/registry/blocks/preview-02/cards/payout-threshold.ts +92 -0
  146. package/packages/registry/blocks/preview-02/cards/power-usage.ts +84 -0
  147. package/packages/registry/blocks/preview-02/cards/preferences.ts +89 -0
  148. package/packages/registry/blocks/preview-02/cards/qr-connect.ts +54 -0
  149. package/packages/registry/blocks/preview-02/cards/receiving-method.ts +89 -0
  150. package/packages/registry/blocks/preview-02/cards/recent-transactions.ts +101 -0
  151. package/packages/registry/blocks/preview-02/cards/release-catalog.ts +73 -0
  152. package/packages/registry/blocks/preview-02/cards/roller-shades.ts +110 -0
  153. package/packages/registry/blocks/preview-02/cards/savings-progress.ts +68 -0
  154. package/packages/registry/blocks/preview-02/cards/savings-targets.ts +132 -0
  155. package/packages/registry/blocks/preview-02/cards/sidebar-nav.ts +88 -0
  156. package/packages/registry/blocks/preview-02/cards/social-links.ts +57 -0
  157. package/packages/registry/blocks/preview-02/cards/stock-performance.ts +106 -0
  158. package/packages/registry/blocks/preview-02/cards/syncing-state.ts +37 -0
  159. package/packages/registry/blocks/preview-02/cards/transfer-funds.ts +111 -0
  160. package/packages/registry/blocks/preview-02/cards/upcoming-payments.ts +69 -0
  161. package/packages/registry/blocks/preview-02/page.ts +111 -0
  162. package/packages/registry/blocks/preview-03/cards/files-chat.ts +75 -0
  163. package/packages/registry/blocks/preview-03/cards/group-chat.ts +114 -0
  164. package/packages/registry/blocks/preview-03/cards/reasoning-chat.ts +88 -0
  165. package/packages/registry/blocks/preview-03/cards/simple-chat.ts +53 -0
  166. package/packages/registry/blocks/preview-03/components/chat-card.ts +126 -0
  167. package/packages/registry/blocks/preview-03/components/chat-player.ts +174 -0
  168. package/packages/registry/blocks/preview-03/components/part-file.ts +77 -0
  169. package/packages/registry/blocks/preview-03/components/part-reasoning.ts +25 -0
  170. package/packages/registry/blocks/preview-03/components/part-source.ts +48 -0
  171. package/packages/registry/blocks/preview-03/components/part-text.ts +69 -0
  172. package/packages/registry/blocks/preview-03/components/part-tool.ts +71 -0
  173. package/packages/registry/blocks/preview-03/components/prompt-input.ts +86 -0
  174. package/packages/registry/blocks/preview-03/page.ts +39 -0
  175. package/packages/registry/blocks/sidebar-01/components/app-sidebar.ts +113 -0
  176. package/packages/registry/blocks/sidebar-01/components/search-form.ts +33 -0
  177. package/packages/registry/blocks/sidebar-01/components/version-switcher.ts +50 -0
  178. package/packages/registry/blocks/sidebar-01/page.ts +58 -0
  179. package/packages/registry/blocks/sidebar-02/components/app-sidebar.ts +131 -0
  180. package/packages/registry/blocks/sidebar-02/components/search-form.ts +33 -0
  181. package/packages/registry/blocks/sidebar-02/components/version-switcher.ts +50 -0
  182. package/packages/registry/blocks/sidebar-02/page.ts +53 -0
  183. package/packages/registry/blocks/sidebar-03/components/app-sidebar.ts +134 -0
  184. package/packages/registry/blocks/sidebar-03/page.ts +60 -0
  185. package/packages/registry/blocks/sidebar-04/components/app-sidebar.ts +136 -0
  186. package/packages/registry/blocks/sidebar-04/page.ts +58 -0
  187. package/packages/registry/blocks/sidebar-05/components/app-sidebar.ts +147 -0
  188. package/packages/registry/blocks/sidebar-05/components/search-form.ts +33 -0
  189. package/packages/registry/blocks/sidebar-05/page.ts +58 -0
  190. package/packages/registry/blocks/sidebar-06/components/app-sidebar.ts +105 -0
  191. package/packages/registry/blocks/sidebar-06/components/nav-main.ts +56 -0
  192. package/packages/registry/blocks/sidebar-06/components/sidebar-opt-in-form.ts +44 -0
  193. package/packages/registry/blocks/sidebar-06/page.ts +57 -0
  194. package/packages/registry/blocks/sidebar-07/components/app-sidebar.ts +108 -0
  195. package/packages/registry/blocks/sidebar-07/components/nav-main.ts +61 -0
  196. package/packages/registry/blocks/sidebar-07/components/nav-projects.ts +65 -0
  197. package/packages/registry/blocks/sidebar-07/components/nav-user.ts +70 -0
  198. package/packages/registry/blocks/sidebar-07/components/team-switcher.ts +66 -0
  199. package/packages/registry/blocks/sidebar-07/page.ts +59 -0
  200. package/packages/registry/blocks/sidebar-08/components/app-sidebar.ts +122 -0
  201. package/packages/registry/blocks/sidebar-08/components/nav-main.ts +68 -0
  202. package/packages/registry/blocks/sidebar-08/components/nav-projects.ts +65 -0
  203. package/packages/registry/blocks/sidebar-08/components/nav-secondary.ts +40 -0
  204. package/packages/registry/blocks/sidebar-08/components/nav-user.ts +70 -0
  205. package/packages/registry/blocks/sidebar-08/page.ts +59 -0
  206. package/packages/registry/blocks/sidebar-09/components/app-sidebar.ts +213 -0
  207. package/packages/registry/blocks/sidebar-09/components/nav-user.ts +70 -0
  208. package/packages/registry/blocks/sidebar-09/page.ts +52 -0
  209. package/packages/registry/blocks/sidebar-10/components/app-sidebar.ts +125 -0
  210. package/packages/registry/blocks/sidebar-10/components/nav-actions.ts +84 -0
  211. package/packages/registry/blocks/sidebar-10/components/nav-favorites.ts +66 -0
  212. package/packages/registry/blocks/sidebar-10/components/nav-main.ts +37 -0
  213. package/packages/registry/blocks/sidebar-10/components/nav-secondary.ts +43 -0
  214. package/packages/registry/blocks/sidebar-10/components/nav-workspaces.ts +78 -0
  215. package/packages/registry/blocks/sidebar-10/components/team-switcher.ts +63 -0
  216. package/packages/registry/blocks/sidebar-10/page.ts +46 -0
  217. package/packages/registry/blocks/sidebar-11/components/app-sidebar.ts +114 -0
  218. package/packages/registry/blocks/sidebar-11/page.ts +63 -0
  219. package/packages/registry/blocks/sidebar-12/components/app-sidebar.ts +63 -0
  220. package/packages/registry/blocks/sidebar-12/components/calendars.ts +53 -0
  221. package/packages/registry/blocks/sidebar-12/components/date-picker.ts +26 -0
  222. package/packages/registry/blocks/sidebar-12/components/nav-user.ts +70 -0
  223. package/packages/registry/blocks/sidebar-12/page.ts +43 -0
  224. package/packages/registry/blocks/sidebar-13/components/settings-dialog.ts +114 -0
  225. package/packages/registry/blocks/sidebar-13/page.ts +21 -0
  226. package/packages/registry/blocks/sidebar-14/components/app-sidebar.ts +120 -0
  227. package/packages/registry/blocks/sidebar-14/page.ts +55 -0
  228. package/packages/registry/blocks/sidebar-15/components/calendars.ts +53 -0
  229. package/packages/registry/blocks/sidebar-15/components/date-picker.ts +26 -0
  230. package/packages/registry/blocks/sidebar-15/components/nav-favorites.ts +66 -0
  231. package/packages/registry/blocks/sidebar-15/components/nav-main.ts +35 -0
  232. package/packages/registry/blocks/sidebar-15/components/nav-secondary.ts +43 -0
  233. package/packages/registry/blocks/sidebar-15/components/nav-user.ts +70 -0
  234. package/packages/registry/blocks/sidebar-15/components/nav-workspaces.ts +75 -0
  235. package/packages/registry/blocks/sidebar-15/components/sidebar-left.ts +126 -0
  236. package/packages/registry/blocks/sidebar-15/components/sidebar-right.ts +62 -0
  237. package/packages/registry/blocks/sidebar-15/components/team-switcher.ts +63 -0
  238. package/packages/registry/blocks/sidebar-15/page.ts +47 -0
  239. package/packages/registry/blocks/sidebar-16/components/app-sidebar.ts +124 -0
  240. package/packages/registry/blocks/sidebar-16/components/nav-main.ts +67 -0
  241. package/packages/registry/blocks/sidebar-16/components/nav-projects.ts +65 -0
  242. package/packages/registry/blocks/sidebar-16/components/nav-secondary.ts +40 -0
  243. package/packages/registry/blocks/sidebar-16/components/nav-user.ts +70 -0
  244. package/packages/registry/blocks/sidebar-16/components/search-form.ts +27 -0
  245. package/packages/registry/blocks/sidebar-16/components/site-header.ts +42 -0
  246. package/packages/registry/blocks/sidebar-16/page.ts +38 -0
  247. package/packages/registry/blocks/signup-01/components/signup-form.ts +78 -0
  248. package/packages/registry/blocks/signup-01/page.ts +19 -0
  249. package/packages/registry/blocks/signup-02/components/signup-form.ts +78 -0
  250. package/packages/registry/blocks/signup-02/page.ts +36 -0
  251. package/packages/registry/blocks/signup-03/components/signup-form.ts +79 -0
  252. package/packages/registry/blocks/signup-03/page.ts +28 -0
  253. package/packages/registry/blocks/signup-04/components/signup-form.ts +100 -0
  254. package/packages/registry/blocks/signup-04/page.ts +20 -0
  255. package/packages/registry/blocks/signup-05/components/signup-form.ts +75 -0
  256. package/packages/registry/blocks/signup-05/page.ts +20 -0
  257. package/packages/registry/components/accordion.ts +20 -7
  258. package/packages/registry/components/alert-dialog.ts +58 -13
  259. package/packages/registry/components/alert.ts +11 -6
  260. package/packages/registry/components/attachment.ts +119 -0
  261. package/packages/registry/components/avatar.ts +17 -8
  262. package/packages/registry/components/badge.ts +16 -9
  263. package/packages/registry/components/breadcrumb.ts +6 -6
  264. package/packages/registry/components/bubble.ts +95 -0
  265. package/packages/registry/components/button-group.ts +73 -0
  266. package/packages/registry/components/button.ts +35 -25
  267. package/packages/registry/components/calendar.ts +566 -0
  268. package/packages/registry/components/card.ts +8 -8
  269. package/packages/registry/components/carousel.ts +352 -0
  270. package/packages/registry/components/chart-element.ts +547 -0
  271. package/packages/registry/components/chart-geometry.ts +457 -0
  272. package/packages/registry/components/chart.ts +932 -0
  273. package/packages/registry/components/checkbox.ts +22 -84
  274. package/packages/registry/components/code-block.ts +191 -0
  275. package/packages/registry/components/collapsible.ts +5 -2
  276. package/packages/registry/components/combobox.ts +802 -0
  277. package/packages/registry/components/command.ts +618 -0
  278. package/packages/registry/components/context-menu.ts +302 -0
  279. package/packages/registry/components/dialog.ts +156 -45
  280. package/packages/registry/components/direction.ts +43 -0
  281. package/packages/registry/components/drawer.ts +226 -0
  282. package/packages/registry/components/dropdown-menu.ts +262 -83
  283. package/packages/registry/components/empty.ts +8 -8
  284. package/packages/registry/components/field.ts +20 -18
  285. package/packages/registry/components/floating.ts +124 -0
  286. package/packages/registry/components/hover-card.ts +19 -8
  287. package/packages/registry/components/input-group.ts +118 -0
  288. package/packages/registry/components/input-otp.ts +365 -0
  289. package/packages/registry/components/input.ts +3 -3
  290. package/packages/registry/components/item.ts +134 -0
  291. package/packages/registry/components/kbd.ts +2 -2
  292. package/packages/registry/components/label.ts +1 -1
  293. package/packages/registry/components/marker.ts +63 -0
  294. package/packages/registry/components/menubar.ts +388 -0
  295. package/packages/registry/components/message-scroller.ts +470 -0
  296. package/packages/registry/components/message.ts +69 -0
  297. package/packages/registry/components/native-select.ts +5 -5
  298. package/packages/registry/components/navigation-menu.ts +564 -0
  299. package/packages/registry/components/pagination.ts +5 -5
  300. package/packages/registry/components/popover.ts +30 -84
  301. package/packages/registry/components/progress.ts +7 -3
  302. package/packages/registry/components/questionnaire.ts +840 -0
  303. package/packages/registry/components/radio-group.ts +18 -73
  304. package/packages/registry/components/resizable.ts +330 -0
  305. package/packages/registry/components/scroll-area.ts +46 -0
  306. package/packages/registry/components/select.ts +650 -0
  307. package/packages/registry/components/separator.ts +1 -1
  308. package/packages/registry/components/sheet.ts +128 -0
  309. package/packages/registry/components/sidebar.ts +457 -0
  310. package/packages/registry/components/skeleton.ts +1 -1
  311. package/packages/registry/components/slider.ts +333 -0
  312. package/packages/registry/components/sonner.ts +74 -7
  313. package/packages/registry/components/spinner.ts +7 -4
  314. package/packages/registry/components/switch.ts +117 -9
  315. package/packages/registry/components/table.ts +11 -9
  316. package/packages/registry/components/tabs.ts +76 -25
  317. package/packages/registry/components/textarea.ts +1 -1
  318. package/packages/registry/components/toggle-group.ts +30 -11
  319. package/packages/registry/components/toggle.ts +20 -13
  320. package/packages/registry/components/tooltip.ts +68 -7
  321. package/packages/registry/components/trace.ts +75 -0
  322. package/packages/registry/lib/dom.ts +3 -4
  323. package/packages/registry/lib/icons-hugeicons.ts +955 -0
  324. package/packages/registry/lib/icons-phosphor.ts +955 -0
  325. package/packages/registry/lib/icons-remixicon.ts +955 -0
  326. package/packages/registry/lib/icons-tabler.ts +955 -0
  327. package/packages/registry/lib/icons.ts +768 -0
  328. package/packages/registry/lib/utils.ts +52 -8
  329. package/packages/registry/registry.json +4056 -72
  330. package/packages/registry/styles/shadcn-tailwind.css +654 -0
  331. package/packages/registry/styles/style-luma.css +1987 -0
  332. package/packages/registry/styles/style-lyra.css +1965 -0
  333. package/packages/registry/styles/style-maia.css +1987 -0
  334. package/packages/registry/styles/style-mira.css +1992 -0
  335. package/packages/registry/styles/style-new-york.css +1597 -0
  336. package/packages/registry/styles/style-nova.css +1990 -0
  337. package/packages/registry/styles/style-rhea.css +1987 -0
  338. package/packages/registry/styles/style-sera.css +1977 -0
  339. package/packages/registry/styles/style-vega.css +1990 -0
  340. package/packages/registry/styles/supplement.json +54 -0
  341. package/packages/registry/styles/tw-animate.css +6 -0
  342. package/packages/registry/themes/base-colors.js +8 -2
  343. package/packages/registry/themes/fonts.js +120 -0
  344. package/packages/registry/themes/index.css +2 -0
  345. package/packages/registry/themes/items.js +61 -0
  346. package/packages/registry/themes/preset.js +302 -0
  347. package/packages/registry/themes/themes.js +1193 -0
  348. package/src/commands/add.js +266 -14
  349. package/src/commands/diff.js +34 -20
  350. package/src/commands/info.js +7 -0
  351. package/src/commands/init.js +127 -10
  352. package/src/commands/list.js +43 -11
  353. package/src/commands/view.js +33 -5
  354. package/src/lint/rules/no-restyle.js +1 -1
  355. package/src/registry/extract.js +194 -5
  356. package/src/registry/icons.js +31 -0
  357. package/src/registry/local.js +15 -1
  358. package/src/registry/schema.js +13 -0
  359. package/src/registry/style-bake.js +506 -0
  360. package/src/utils/theme.js +110 -21
@@ -0,0 +1,54 @@
1
+ {
2
+ "cn-accordion": "flex flex-col",
3
+ "cn-accordion-content": "overflow-hidden",
4
+ "cn-accordion-trigger": "relative flex-1 items-start border border-transparent disabled:pointer-events-none disabled:opacity-50",
5
+ "cn-alert-description": "[&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
6
+ "cn-alert-dialog-content": "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 outline-none",
7
+ "cn-alert-title": "[&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
8
+ "cn-avatar": "after:absolute after:inset-0 after:border after:border-border after:mix-blend-darken dark:after:mix-blend-lighten",
9
+ "cn-avatar-badge": "bg-blend-color",
10
+ "cn-avatar-image": "object-cover",
11
+ "cn-breadcrumb-list": "wrap-break-word",
12
+ "cn-button": "select-none",
13
+ "cn-card-header": "has-data-[slot=card-description]:grid-rows-[auto_auto]",
14
+ "cn-checkbox": "relative after:absolute after:-inset-x-3 after:-inset-y-2",
15
+ "cn-context-menu-checkbox-item": "data-disabled:pointer-events-none data-disabled:opacity-50",
16
+ "cn-context-menu-content": "max-h-(--radix-context-menu-content-available-height) origin-(--radix-context-menu-content-transform-origin)",
17
+ "cn-context-menu-item": "data-disabled:pointer-events-none data-disabled:opacity-50",
18
+ "cn-context-menu-radio-item": "data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
19
+ "cn-context-menu-sub-content": "origin-(--radix-context-menu-content-transform-origin)",
20
+ "cn-dialog-content": "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
21
+ "cn-dropdown-menu-checkbox-item": "data-disabled:pointer-events-none data-disabled:opacity-50",
22
+ "cn-dropdown-menu-content": "max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) data-[state=closed]:overflow-hidden",
23
+ "cn-dropdown-menu-item": "data-disabled:pointer-events-none data-disabled:opacity-50",
24
+ "cn-dropdown-menu-radio-item": "data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
25
+ "cn-dropdown-menu-sub-content": "origin-(--radix-dropdown-menu-content-transform-origin)",
26
+ "cn-empty": "w-full",
27
+ "cn-field-description": "group-has-data-horizontal/field:text-balance",
28
+ "cn-field-orientation-horizontal": "*:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
29
+ "cn-field-orientation-responsive": "*:w-full @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
30
+ "cn-field-orientation-vertical": "*:w-full",
31
+ "cn-hover-card-content": "origin-(--radix-hover-card-content-transform-origin)",
32
+ "cn-menubar-checkbox-item": "data-disabled:pointer-events-none",
33
+ "cn-menubar-checkbox-item-indicator": "absolute flex items-center justify-center",
34
+ "cn-menubar-content": "origin-(--radix-menubar-content-transform-origin) overflow-hidden",
35
+ "cn-menubar-item": "data-disabled:pointer-events-none",
36
+ "cn-menubar-radio-item": "data-disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",
37
+ "cn-menubar-radio-item-indicator": "absolute flex items-center justify-center",
38
+ "cn-menubar-separator": "-mx-1 my-1 h-px",
39
+ "cn-menubar-shortcut": "ms-auto",
40
+ "cn-menubar-sub-content": "origin-(--radix-menubar-content-transform-origin)",
41
+ "cn-menubar-sub-trigger": "outline-none",
42
+ "cn-popover-content": "z-50 origin-(--radix-popover-content-transform-origin)",
43
+ "cn-progress": "relative flex items-center overflow-x-hidden",
44
+ "cn-radio-group": "w-full",
45
+ "cn-radio-group-item": "relative after:absolute after:-inset-x-3 after:-inset-y-2",
46
+ "cn-switch": "after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",
47
+ "cn-switch-thumb": "pointer-events-none block ring-0 transition-transform",
48
+ "cn-tabs": "data-horizontal:flex-col",
49
+ "cn-tabs-list": "group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col",
50
+ "cn-tabs-trigger": "group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start",
51
+ "cn-toggle-group": "flex-row gap-[--spacing(var(--gap))] data-vertical:flex-col data-vertical:items-stretch",
52
+ "cn-toggle-group-item": "cursor-default select-none aria-disabled:pointer-events-none aria-disabled:opacity-50 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",
53
+ "cn-tooltip-content": "max-w-xs origin-(--radix-tooltip-content-transform-origin)"
54
+ }
@@ -0,0 +1,6 @@
1
+ /* Ported from tw-animate-css 1.4.0 (dist/tw-animate.css), MIT, Copyright (c) 2025
2
+ Wombosvideo. The enter and exit animation utilities (animate-in, fade-in-0,
3
+ zoom-in-95, slide-in-from-*) the shadcn/ui styles use. Vendored as CSS
4
+ rather than installed, since the kit takes no third-party dependency
5
+ (#1666). See packages/ui/THIRD_PARTY_NOTICES.md. */
6
+ @property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@theme inline{--animation-delay-0: 0s; --animation-delay-75: 75ms; --animation-delay-100: .1s; --animation-delay-150: .15s; --animation-delay-200: .2s; --animation-delay-300: .3s; --animation-delay-500: .5s; --animation-delay-700: .7s; --animation-delay-1000: 1s; --animation-repeat-0: 0; --animation-repeat-1: 1; --animation-repeat-infinite: infinite; --animation-direction-normal: normal; --animation-direction-reverse: reverse; --animation-direction-alternate: alternate; --animation-direction-alternate-reverse: alternate-reverse; --animation-fill-mode-none: none; --animation-fill-mode-forwards: forwards; --animation-fill-mode-backwards: backwards; --animation-fill-mode-both: both; --percentage-0: 0; --percentage-5: .05; --percentage-10: .1; --percentage-15: .15; --percentage-20: .2; --percentage-25: .25; --percentage-30: .3; --percentage-35: .35; --percentage-40: .4; --percentage-45: .45; --percentage-50: .5; --percentage-55: .55; --percentage-60: .6; --percentage-65: .65; --percentage-70: .7; --percentage-75: .75; --percentage-80: .8; --percentage-85: .85; --percentage-90: .9; --percentage-95: .95; --percentage-100: 1; --percentage-translate-full: 1; --animate-in: enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none); --animate-out: exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none); @keyframes enter { from { opacity: var(--tw-enter-opacity,1); transform: translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0)); filter: blur(var(--tw-enter-blur,0)); }}@keyframes exit { to { opacity: var(--tw-exit-opacity,1); transform: translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0)); filter: blur(var(--tw-exit-blur,0)); }}--animate-accordion-down: accordion-down var(--tw-animation-duration,var(--tw-duration,.2s))var(--tw-ease,ease-out)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none); --animate-accordion-up: accordion-up var(--tw-animation-duration,var(--tw-duration,.2s))var(--tw-ease,ease-out)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none); --animate-collapsible-down: collapsible-down var(--tw-animation-duration,var(--tw-duration,.2s))var(--tw-ease,ease-out)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none); --animate-collapsible-up: collapsible-up var(--tw-animation-duration,var(--tw-duration,.2s))var(--tw-ease,ease-out)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none); @keyframes accordion-down { from { height: 0; }to { height: var(--radix-accordion-content-height,var(--bits-accordion-content-height,var(--reka-accordion-content-height,var(--kb-accordion-content-height,var(--ngp-accordion-content-height,auto))))); }}@keyframes accordion-up { from { height: var(--radix-accordion-content-height,var(--bits-accordion-content-height,var(--reka-accordion-content-height,var(--kb-accordion-content-height,var(--ngp-accordion-content-height,auto))))); }to { height: 0; }}@keyframes collapsible-down { from { height: 0; }to { height: var(--radix-collapsible-content-height,var(--bits-collapsible-content-height,var(--reka-collapsible-content-height,var(--kb-collapsible-content-height,auto)))); }}@keyframes collapsible-up { from { height: var(--radix-collapsible-content-height,var(--bits-collapsible-content-height,var(--reka-collapsible-content-height,var(--kb-collapsible-content-height,auto)))); }to { height: 0; }}--animate-caret-blink: caret-blink 1.25s ease-out infinite; @keyframes caret-blink { 0%,70%,100% { opacity: 1; }20%,50% { opacity: 0; }}}@utility animation-duration-*{--tw-animation-duration: calc(--value(number)*1ms); --tw-animation-duration: --value(--animation-duration-*,[duration],"initial",[*]); animation-duration: calc(--value(number)*1ms); animation-duration: --value(--animation-duration-*,[duration],"initial",[*]);}@utility delay-*{animation-delay: calc(--value(number)*1ms); animation-delay: --value(--animation-delay-*,[duration],"initial",[*]); --tw-animation-delay: calc(--value(number)*1ms); --tw-animation-delay: --value(--animation-delay-*,[duration],"initial",[*]);}@utility repeat-*{animation-iteration-count: --value(--animation-repeat-*,number,"initial",[*]); --tw-animation-iteration-count: --value(--animation-repeat-*,number,"initial",[*]);}@utility direction-*{animation-direction: --value(--animation-direction-*,"initial",[*]); --tw-animation-direction: --value(--animation-direction-*,"initial",[*]);}@utility fill-mode-*{animation-fill-mode: --value(--animation-fill-mode-*,"initial",[*]); --tw-animation-fill-mode: --value(--animation-fill-mode-*,"initial",[*]);}@utility running{animation-play-state: running;}@utility paused{animation-play-state: paused;}@utility play-state-*{animation-play-state: --value("initial",[*]);}@utility blur-in{--tw-enter-blur: 20px;}@utility blur-in-*{--tw-enter-blur: calc(--value(number)*1px); --tw-enter-blur: --value(--blur-*,[*]);}@utility blur-out{--tw-exit-blur: 20px;}@utility blur-out-*{--tw-exit-blur: calc(--value(number)*1px); --tw-exit-blur: --value(--blur-*,[*]);}@utility fade-in{--tw-enter-opacity: 0;}@utility fade-in-*{--tw-enter-opacity: calc(--value(number)/100); --tw-enter-opacity: --value(--percentage-*,[*]);}@utility fade-out{--tw-exit-opacity: 0;}@utility fade-out-*{--tw-exit-opacity: calc(--value(number)/100); --tw-exit-opacity: --value(--percentage-*,[*]);}@utility zoom-in{--tw-enter-scale: 0;}@utility zoom-in-*{--tw-enter-scale: calc(--value(number)*1%); --tw-enter-scale: calc(--value(ratio)); --tw-enter-scale: --value(--percentage-*,[*]);}@utility -zoom-in-*{--tw-enter-scale: calc(--value(number)*-1%); --tw-enter-scale: calc(--value(ratio)*-1); --tw-enter-scale: --value(--percentage-*,[*]);}@utility zoom-out{--tw-exit-scale: 0;}@utility zoom-out-*{--tw-exit-scale: calc(--value(number)*1%); --tw-exit-scale: calc(--value(ratio)); --tw-exit-scale: --value(--percentage-*,[*]);}@utility -zoom-out-*{--tw-exit-scale: calc(--value(number)*-1%); --tw-exit-scale: calc(--value(ratio)*-1); --tw-exit-scale: --value(--percentage-*,[*]);}@utility spin-in{--tw-enter-rotate: 30deg;}@utility spin-in-*{--tw-enter-rotate: calc(--value(number)*1deg); --tw-enter-rotate: calc(--value(ratio)*360deg); --tw-enter-rotate: --value(--rotate-*,[*]);}@utility -spin-in{--tw-enter-rotate: -30deg;}@utility -spin-in-*{--tw-enter-rotate: calc(--value(number)*-1deg); --tw-enter-rotate: calc(--value(ratio)*-360deg); --tw-enter-rotate: --value(--rotate-*,[*]);}@utility spin-out{--tw-exit-rotate: 30deg;}@utility spin-out-*{--tw-exit-rotate: calc(--value(number)*1deg); --tw-exit-rotate: calc(--value(ratio)*360deg); --tw-exit-rotate: --value(--rotate-*,[*]);}@utility -spin-out{--tw-exit-rotate: -30deg;}@utility -spin-out-*{--tw-exit-rotate: calc(--value(number)*-1deg); --tw-exit-rotate: calc(--value(ratio)*-360deg); --tw-exit-rotate: --value(--rotate-*,[*]);}@utility slide-in-from-top{--tw-enter-translate-y: -100%;}@utility slide-in-from-top-*{--tw-enter-translate-y: calc(--value(integer)*var(--spacing)*-1); --tw-enter-translate-y: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-enter-translate-y: calc(--value(ratio)*-100%); --tw-enter-translate-y: calc(--value(--translate-*,[percentage],[length])*-1);}@utility slide-in-from-bottom{--tw-enter-translate-y: 100%;}@utility slide-in-from-bottom-*{--tw-enter-translate-y: calc(--value(integer)*var(--spacing)); --tw-enter-translate-y: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-enter-translate-y: calc(--value(ratio)*100%); --tw-enter-translate-y: --value(--translate-*,[percentage],[length]);}@utility slide-in-from-left{--tw-enter-translate-x: -100%;}@utility slide-in-from-left-*{--tw-enter-translate-x: calc(--value(integer)*var(--spacing)*-1); --tw-enter-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-enter-translate-x: calc(--value(ratio)*-100%); --tw-enter-translate-x: calc(--value(--translate-*,[percentage],[length])*-1);}@utility slide-in-from-right{--tw-enter-translate-x: 100%;}@utility slide-in-from-right-*{--tw-enter-translate-x: calc(--value(integer)*var(--spacing)); --tw-enter-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-enter-translate-x: calc(--value(ratio)*100%); --tw-enter-translate-x: --value(--translate-*,[percentage],[length]);}@utility slide-in-from-start{&:dir(ltr){ --tw-enter-translate-x: -100%; }&:dir(rtl){ --tw-enter-translate-x: 100%; }}@utility slide-in-from-start-*{&:where(:dir(ltr),[dir="ltr"],[dir="ltr"]*){ --tw-enter-translate-x: calc(--value(integer)*var(--spacing)*-1); --tw-enter-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-enter-translate-x: calc(--value(ratio)*-100%); --tw-enter-translate-x: calc(--value(--translate-*,[percentage],[length])*-1); }&:where(:dir(rtl),[dir="rtl"],[dir="rtl"]*){ --tw-enter-translate-x: calc(--value(integer)*var(--spacing)); --tw-enter-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-enter-translate-x: calc(--value(ratio)*100%); --tw-enter-translate-x: --value(--translate-*,[percentage],[length]); }}@utility slide-in-from-end{&:dir(ltr){ --tw-enter-translate-x: 100%; }&:dir(rtl){ --tw-enter-translate-x: -100%; }}@utility slide-in-from-end-*{&:where(:dir(ltr),[dir="ltr"],[dir="ltr"]*){ --tw-enter-translate-x: calc(--value(integer)*var(--spacing)); --tw-enter-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-enter-translate-x: calc(--value(ratio)*100%); --tw-enter-translate-x: --value(--translate-*,[percentage],[length]); }&:where(:dir(rtl),[dir="rtl"],[dir="rtl"]*){ --tw-enter-translate-x: calc(--value(integer)*var(--spacing)*-1); --tw-enter-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-enter-translate-x: calc(--value(ratio)*-100%); --tw-enter-translate-x: calc(--value(--translate-*,[percentage],[length])*-1); }}@utility slide-out-to-top{--tw-exit-translate-y: -100%;}@utility slide-out-to-top-*{--tw-exit-translate-y: calc(--value(integer)*var(--spacing)*-1); --tw-exit-translate-y: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-exit-translate-y: calc(--value(ratio)*-100%); --tw-exit-translate-y: calc(--value(--translate-*,[percentage],[length])*-1);}@utility slide-out-to-bottom{--tw-exit-translate-y: 100%;}@utility slide-out-to-bottom-*{--tw-exit-translate-y: calc(--value(integer)*var(--spacing)); --tw-exit-translate-y: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-exit-translate-y: calc(--value(ratio)*100%); --tw-exit-translate-y: --value(--translate-*,[percentage],[length]);}@utility slide-out-to-left{--tw-exit-translate-x: -100%;}@utility slide-out-to-left-*{--tw-exit-translate-x: calc(--value(integer)*var(--spacing)*-1); --tw-exit-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-exit-translate-x: calc(--value(ratio)*-100%); --tw-exit-translate-x: calc(--value(--translate-*,[percentage],[length])*-1);}@utility slide-out-to-right{--tw-exit-translate-x: 100%;}@utility slide-out-to-right-*{--tw-exit-translate-x: calc(--value(integer)*var(--spacing)); --tw-exit-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-exit-translate-x: calc(--value(ratio)*100%); --tw-exit-translate-x: --value(--translate-*,[percentage],[length]);}@utility slide-out-to-start{&:dir(ltr){ --tw-exit-translate-x: -100%; }&:dir(rtl){ --tw-exit-translate-x: 100%; }}@utility slide-out-to-start-*{&:where(:dir(ltr),[dir="ltr"],[dir="ltr"]*){ --tw-exit-translate-x: calc(--value(integer)*var(--spacing)*-1); --tw-exit-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-exit-translate-x: calc(--value(ratio)*-100%); --tw-exit-translate-x: calc(--value(--translate-*,[percentage],[length])*-1); }&:where(:dir(rtl),[dir="rtl"],[dir="rtl"]*){ --tw-exit-translate-x: calc(--value(integer)*var(--spacing)); --tw-exit-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-exit-translate-x: calc(--value(ratio)*100%); --tw-exit-translate-x: --value(--translate-*,[percentage],[length]); }}@utility slide-out-to-end{&:dir(ltr){ --tw-exit-translate-x: 100%; }&:dir(rtl){ --tw-exit-translate-x: -100%; }}@utility slide-out-to-end-*{&:where(:dir(ltr),[dir="ltr"],[dir="ltr"]*){ --tw-exit-translate-x: calc(--value(integer)*var(--spacing)); --tw-exit-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-exit-translate-x: calc(--value(ratio)*100%); --tw-exit-translate-x: --value(--translate-*,[percentage],[length]); }&:where(:dir(rtl),[dir="rtl"],[dir="rtl"]*){ --tw-exit-translate-x: calc(--value(integer)*var(--spacing)*-1); --tw-exit-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-exit-translate-x: calc(--value(ratio)*-100%); --tw-exit-translate-x: calc(--value(--translate-*,[percentage],[length])*-1); }}
@@ -6,8 +6,14 @@
6
6
  *
7
7
  * Pure ESM data module: imported at request time by the website's registry
8
8
  * composer (`website/modules/ui/queries/registry.server.ts`) to synthesize `theme-<color>` items
9
- * on demand. No build step, no committed output. Numbers match the values
10
- * shadcn emits in `apps/v4/public/r/themes/*.json`.
9
+ * on demand. No build step, no committed output.
10
+ *
11
+ * These are the kit's ORIGINAL palettes, which is what a bare
12
+ * `webjsui init --base-color <color>` writes, and they are kept byte stable
13
+ * so an existing app and the scaffold do not shift. They are NOT shadcn's
14
+ * current values: neutral, stone and zinc are close, while mauve, olive, mist
15
+ * and taupe were approximated. shadcn's palettes, verbatim, are in
16
+ * `themes.js`, which `init --preset` and the configurator use (#1666).
11
17
  */
12
18
 
13
19
  export const BASE_COLORS = ['neutral', 'stone', 'zinc', 'mauve', 'olive', 'mist', 'taupe'];
@@ -0,0 +1,120 @@
1
+ /**
2
+ * The 26 font families the configurator offers, ported from shadcn/ui's
3
+ * apps/v4/lib/font-definitions.ts (MIT) in shadcn's order (#1666), and the
4
+ * `registry:font` items built from them (shadcn's registry/fonts.ts).
5
+ *
6
+ * Two departures, both because a WebJs app has no next/font and no bundler:
7
+ *
8
+ * - `family` is the family's own name ('Inter', sans-serif), not
9
+ * fontsource's 'Inter Variable'. The face is loaded from a stylesheet
10
+ * (Google Fonts, or self-hosted woff2 under public/), and both declare it
11
+ * under its own name.
12
+ * - `range` is the variable weight axis, as Google's css2 API spells it
13
+ * (it refuses a range wider than the font has), so {@link googleFontsUrl}
14
+ * can build the link. The values are next/font's font-data.json. A face
15
+ * with no variable axis has `weights` instead.
16
+ *
17
+ * shadcn's `import` (the next/font export name) and `dependency` (the
18
+ * fontsource package) are kept, so an item reads the same on the wire.
19
+ *
20
+ * Pure data with no imports, so the CLI, the site and a browser can load it.
21
+ */
22
+
23
+ /**
24
+ * @typedef {object} FontDefinition
25
+ * @property {string} name the id: `font-<name>` is its registry item
26
+ * @property {string} title
27
+ * @property {'sans' | 'mono' | 'serif'} type
28
+ * @property {string} family the CSS font-family stack
29
+ * @property {'--font-sans' | '--font-mono' | '--font-serif'} variable the token a body font sets
30
+ * @property {string} import next/font's export name (shadcn parity)
31
+ * @property {string} dependency fontsource's package (shadcn parity)
32
+ * @property {string} [range] the variable weight axis, css2 spelling
33
+ * @property {string[]} [weights] the static weights of a non-variable face
34
+ */
35
+
36
+ /** @type {FontDefinition[]} */
37
+ export const FONT_DEFINITIONS = [
38
+ { name: 'geist', title: 'Geist', type: 'sans', family: "'Geist', sans-serif", variable: '--font-sans', import: 'Geist', dependency: '@fontsource-variable/geist', range: '100..900' },
39
+ { name: 'inter', title: 'Inter', type: 'sans', family: "'Inter', sans-serif", variable: '--font-sans', import: 'Inter', dependency: '@fontsource-variable/inter', range: '100..900' },
40
+ { name: 'noto-sans', title: 'Noto Sans', type: 'sans', family: "'Noto Sans', sans-serif", variable: '--font-sans', import: 'Noto_Sans', dependency: '@fontsource-variable/noto-sans', range: '100..900' },
41
+ { name: 'nunito-sans', title: 'Nunito Sans', type: 'sans', family: "'Nunito Sans', sans-serif", variable: '--font-sans', import: 'Nunito_Sans', dependency: '@fontsource-variable/nunito-sans', range: '200..1000' },
42
+ { name: 'figtree', title: 'Figtree', type: 'sans', family: "'Figtree', sans-serif", variable: '--font-sans', import: 'Figtree', dependency: '@fontsource-variable/figtree', range: '300..900' },
43
+ { name: 'roboto', title: 'Roboto', type: 'sans', family: "'Roboto', sans-serif", variable: '--font-sans', import: 'Roboto', dependency: '@fontsource-variable/roboto', range: '100..900' },
44
+ { name: 'raleway', title: 'Raleway', type: 'sans', family: "'Raleway', sans-serif", variable: '--font-sans', import: 'Raleway', dependency: '@fontsource-variable/raleway', range: '100..900' },
45
+ { name: 'dm-sans', title: 'DM Sans', type: 'sans', family: "'DM Sans', sans-serif", variable: '--font-sans', import: 'DM_Sans', dependency: '@fontsource-variable/dm-sans', range: '100..1000' },
46
+ { name: 'public-sans', title: 'Public Sans', type: 'sans', family: "'Public Sans', sans-serif", variable: '--font-sans', import: 'Public_Sans', dependency: '@fontsource-variable/public-sans', range: '100..900' },
47
+ { name: 'outfit', title: 'Outfit', type: 'sans', family: "'Outfit', sans-serif", variable: '--font-sans', import: 'Outfit', dependency: '@fontsource-variable/outfit', range: '100..900' },
48
+ { name: 'oxanium', title: 'Oxanium', type: 'sans', family: "'Oxanium', sans-serif", variable: '--font-sans', import: 'Oxanium', dependency: '@fontsource-variable/oxanium', range: '200..800' },
49
+ { name: 'manrope', title: 'Manrope', type: 'sans', family: "'Manrope', sans-serif", variable: '--font-sans', import: 'Manrope', dependency: '@fontsource-variable/manrope', range: '200..800' },
50
+ { name: 'space-grotesk', title: 'Space Grotesk', type: 'sans', family: "'Space Grotesk', sans-serif", variable: '--font-sans', import: 'Space_Grotesk', dependency: '@fontsource-variable/space-grotesk', range: '300..700' },
51
+ { name: 'montserrat', title: 'Montserrat', type: 'sans', family: "'Montserrat', sans-serif", variable: '--font-sans', import: 'Montserrat', dependency: '@fontsource-variable/montserrat', range: '100..900' },
52
+ { name: 'ibm-plex-sans', title: 'IBM Plex Sans', type: 'sans', family: "'IBM Plex Sans', sans-serif", variable: '--font-sans', import: 'IBM_Plex_Sans', dependency: '@fontsource-variable/ibm-plex-sans', range: '100..700' },
53
+ { name: 'source-sans-3', title: 'Source Sans 3', type: 'sans', family: "'Source Sans 3', sans-serif", variable: '--font-sans', import: 'Source_Sans_3', dependency: '@fontsource-variable/source-sans-3', range: '200..900' },
54
+ { name: 'instrument-sans', title: 'Instrument Sans', type: 'sans', family: "'Instrument Sans', sans-serif", variable: '--font-sans', import: 'Instrument_Sans', dependency: '@fontsource-variable/instrument-sans', range: '400..700' },
55
+ { name: 'jetbrains-mono', title: 'JetBrains Mono', type: 'mono', family: "'JetBrains Mono', monospace", variable: '--font-mono', import: 'JetBrains_Mono', dependency: '@fontsource-variable/jetbrains-mono', range: '100..800' },
56
+ { name: 'geist-mono', title: 'Geist Mono', type: 'mono', family: "'Geist Mono', monospace", variable: '--font-mono', import: 'Geist_Mono', dependency: '@fontsource-variable/geist-mono', range: '100..900' },
57
+ { name: 'noto-serif', title: 'Noto Serif', type: 'serif', family: "'Noto Serif', serif", variable: '--font-serif', import: 'Noto_Serif', dependency: '@fontsource-variable/noto-serif', range: '100..900' },
58
+ { name: 'roboto-slab', title: 'Roboto Slab', type: 'serif', family: "'Roboto Slab', serif", variable: '--font-serif', import: 'Roboto_Slab', dependency: '@fontsource-variable/roboto-slab', range: '100..900' },
59
+ { name: 'merriweather', title: 'Merriweather', type: 'serif', family: "'Merriweather', serif", variable: '--font-serif', import: 'Merriweather', dependency: '@fontsource-variable/merriweather', range: '300..900' },
60
+ { name: 'lora', title: 'Lora', type: 'serif', family: "'Lora', serif", variable: '--font-serif', import: 'Lora', dependency: '@fontsource-variable/lora', range: '400..700' },
61
+ { name: 'playfair-display', title: 'Playfair Display', type: 'serif', family: "'Playfair Display', serif", variable: '--font-serif', import: 'Playfair_Display', dependency: '@fontsource-variable/playfair-display', range: '400..900' },
62
+ { name: 'eb-garamond', title: 'EB Garamond', type: 'serif', family: "'EB Garamond', serif", variable: '--font-serif', import: 'EB_Garamond', dependency: '@fontsource-variable/eb-garamond', range: '400..800' },
63
+ { name: 'instrument-serif', title: 'Instrument Serif', type: 'serif', family: "'Instrument Serif', serif", variable: '--font-serif', import: 'Instrument_Serif', dependency: '@fontsource/instrument-serif', weights: ['400'] },
64
+ ];
65
+
66
+ /** The font with this name, or undefined. */
67
+ export function getFont(name) {
68
+ return FONT_DEFINITIONS.find((f) => f.name === name);
69
+ }
70
+
71
+ /**
72
+ * The Google Fonts stylesheet URL that serves a font at its full weight
73
+ * range, for an app that does not self-host it.
74
+ *
75
+ * @param {FontDefinition} font
76
+ */
77
+ export function googleFontsUrl(font) {
78
+ const family = font.title.replace(/ /g, '+');
79
+ const axis = font.range ? `:wght@${font.range}` : font.weights ? `:wght@${font.weights.join(';')}` : '';
80
+ return `https://fonts.googleapis.com/css2?family=${family}${axis}&display=swap`;
81
+ }
82
+
83
+ /**
84
+ * The `registry:font` item for a font, in shadcn's shape: a body font
85
+ * (`font-<name>`) sets the token its type uses, a heading font
86
+ * (`font-heading-<name>`) sets `--font-heading`. `cssVars.theme` carries the
87
+ * token, so `add` merges it into the app's `@theme inline` block.
88
+ *
89
+ * @param {FontDefinition} font
90
+ * @param {'body' | 'heading'} role
91
+ */
92
+ export function fontItem(font, role) {
93
+ const variable = role === 'body' ? font.variable : '--font-heading';
94
+ return {
95
+ name: role === 'body' ? `font-${font.name}` : `font-heading-${font.name}`,
96
+ title: role === 'body' ? font.title : `${font.title} (Heading)`,
97
+ type: 'registry:font',
98
+ description: `${font.title}, loaded from ${googleFontsUrl(font)} or self-hosted under public/.`,
99
+ font: {
100
+ family: font.family,
101
+ provider: 'google',
102
+ variable,
103
+ ...(font.weights ? { weight: [...font.weights] } : {}),
104
+ subsets: ['latin'],
105
+ import: font.import,
106
+ dependency: font.dependency,
107
+ },
108
+ // Bare token names, as every kit item's cssVars spells them (add's
109
+ // mergeCssVars writes `--<name>`).
110
+ cssVars: { theme: { [variable.slice(2)]: font.family } },
111
+ };
112
+ }
113
+
114
+ /** Every font item: the 26 body fonts, then the 26 heading fonts. */
115
+ export function fontItems() {
116
+ return [
117
+ ...FONT_DEFINITIONS.map((f) => fontItem(f, 'body')),
118
+ ...FONT_DEFINITIONS.map((f) => fontItem(f, 'heading')),
119
+ ];
120
+ }
@@ -163,3 +163,5 @@
163
163
  color: CanvasText;
164
164
  }
165
165
  }
166
+
167
+ /* @webjsdev/ui theme end */
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The design-system registry items that are built from data rather than
3
+ * listed in registry.json (#1666): shadcn's 17 accent themes and the 52 font
4
+ * items. Both registry composers serve them through these two functions, the
5
+ * CLI's (`src/registry/local.js`) and the site's
6
+ * (`website/modules/ui/queries/registry.server.ts`), so the two cannot
7
+ * disagree.
8
+ *
9
+ * The 7 base-colour themes are not here. `theme-neutral` is a registry.json
10
+ * item and the other six are synthesized by each composer from
11
+ * `base-colors.js`, and all seven carry the theme FILE `init --base-color`
12
+ * writes. An accent theme carries only `cssVars`, shadcn's shape for it,
13
+ * since it is a layer over a base colour rather than a stylesheet of its own.
14
+ */
15
+
16
+ import { THEMES, isBaseColor } from './themes.js';
17
+ import { fontItems } from './fonts.js';
18
+
19
+ /** The accent themes' registry items, `theme-<name>`. */
20
+ function accentThemeItems() {
21
+ return THEMES.filter((t) => !isBaseColor(t.name)).map((t) => ({
22
+ name: `theme-${t.name}`,
23
+ type: 'registry:theme',
24
+ title: t.title,
25
+ description: `${t.title} accent: the primary, chart and sidebar tokens, layered over a base color`,
26
+ cssVars: { light: { ...t.cssVars.light }, dark: { ...t.cssVars.dark } },
27
+ }));
28
+ }
29
+
30
+ /**
31
+ * @typedef {object} DesignSystemItem
32
+ * @property {string} name
33
+ * @property {string} type
34
+ * @property {string} title
35
+ * @property {string} description
36
+ * @property {{ theme?: Record<string, string>, light?: Record<string, string>, dark?: Record<string, string> }} cssVars
37
+ * @property {Record<string, unknown>} [font]
38
+ */
39
+
40
+ /** @type {DesignSystemItem[] | null} */
41
+ let cache = null;
42
+
43
+ /**
44
+ * Every data-built item, accent themes then fonts.
45
+ *
46
+ * @returns {DesignSystemItem[]}
47
+ */
48
+ export function designSystemItems() {
49
+ if (!cache) cache = [...accentThemeItems(), ...fontItems()];
50
+ return cache;
51
+ }
52
+
53
+ /**
54
+ * One data-built item by name, or null.
55
+ *
56
+ * @param {string} name
57
+ * @returns {DesignSystemItem | null}
58
+ */
59
+ export function designSystemItem(name) {
60
+ return designSystemItems().find((it) => it.name === name) || null;
61
+ }
@@ -0,0 +1,302 @@
1
+ /**
2
+ * Design-system presets (#1666): the share code the configurator prints
3
+ * (`npx @webjsdev/ui init --preset <code>`), and what one resolves to.
4
+ *
5
+ * THE CODE is shadcn's preset format (packages/registry/src/preset/preset.ts,
6
+ * MIT), kept wire compatible: a version character (`b`) and a base62 integer
7
+ * that bit-packs one index per field, in this order and width.
8
+ *
9
+ * | field | bits | values (index 0 is the default) |
10
+ * |-------------|------|-------------------------------------------------------|
11
+ * | menuColor | 3 | default, inverted, default-translucent, inverted-translucent |
12
+ * | menuAccent | 3 | subtle, bold |
13
+ * | radius | 4 | default, none, small, medium, large |
14
+ * | font | 6 | the 26 fonts, shadcn's preset order |
15
+ * | iconLibrary | 6 | lucide, hugeicons, tabler, phosphor, remixicon |
16
+ * | theme | 6 | shadcn's 25 preset themes |
17
+ * | baseColor | 6 | neutral, stone, zinc, gray, mauve, olive, mist, taupe |
18
+ * | style | 6 | nova, vega, maia, lyra, mira, luma, sera, rhea, new-york |
19
+ * | chartColor | 6 | as theme (v2 codes only) |
20
+ * | fontHeading | 5 | inherit, then the 26 fonts (v2 codes only) |
21
+ *
22
+ * A shadcn code decodes here to the same fields, and a code encoded here
23
+ * decodes in shadcn the same way, with one exception: `new-york` (the kit's
24
+ * own default style) is APPENDED to the style list, as shadcn's own
25
+ * compatibility rules allow, so a WebJs code naming it decodes in shadcn as
26
+ * index 8, which shadcn reads as out of range and treats as its first style.
27
+ * shadcn's `base` axis (Radix, Base UI, React Aria) is not in the code there
28
+ * either, and the kit has one implementation, so there is nothing to carry.
29
+ *
30
+ * A decoded value is not yet a valid choice: shadcn lists `gray` among its
31
+ * base colours and themes but ships no such palette, and rejects it when the
32
+ * config is validated. {@link resolvePresetConfig} does the same.
33
+ *
34
+ * Pure ESM with no Node imports, so a browser can encode and decode too.
35
+ */
36
+
37
+ import { BASE_COLOR_NAMES, RADII, buildThemeVars, getTheme, themesForBaseColor } from './themes.js';
38
+ import { getFont, googleFontsUrl } from './fonts.js';
39
+
40
+ export const PRESET_STYLES = ['nova', 'vega', 'maia', 'lyra', 'mira', 'luma', 'sera', 'rhea', 'new-york'];
41
+ export const PRESET_BASE_COLORS = ['neutral', 'stone', 'zinc', 'gray', 'mauve', 'olive', 'mist', 'taupe'];
42
+ export const PRESET_THEMES = [
43
+ 'neutral', 'stone', 'zinc', 'gray', 'amber', 'blue', 'cyan', 'emerald', 'fuchsia', 'green',
44
+ 'indigo', 'lime', 'orange', 'pink', 'purple', 'red', 'rose', 'sky', 'teal', 'violet', 'yellow',
45
+ 'mauve', 'olive', 'mist', 'taupe',
46
+ ];
47
+ export const PRESET_CHART_COLORS = PRESET_THEMES;
48
+ export const PRESET_ICON_LIBRARIES = ['lucide', 'hugeicons', 'tabler', 'phosphor', 'remixicon'];
49
+ export const PRESET_FONTS = [
50
+ 'inter', 'noto-sans', 'nunito-sans', 'figtree', 'roboto', 'raleway', 'dm-sans', 'public-sans',
51
+ 'outfit', 'jetbrains-mono', 'geist', 'geist-mono', 'lora', 'merriweather', 'playfair-display',
52
+ 'noto-serif', 'roboto-slab', 'oxanium', 'manrope', 'space-grotesk', 'montserrat', 'ibm-plex-sans',
53
+ 'source-sans-3', 'instrument-sans', 'eb-garamond', 'instrument-serif',
54
+ ];
55
+ export const PRESET_FONT_HEADINGS = ['inherit', ...PRESET_FONTS];
56
+ export const PRESET_RADII = ['default', 'none', 'small', 'medium', 'large'];
57
+ export const PRESET_MENU_ACCENTS = ['subtle', 'bold'];
58
+ export const PRESET_MENU_COLORS = ['default', 'inverted', 'default-translucent', 'inverted-translucent'];
59
+
60
+ const FIELDS_V1 = [
61
+ { key: 'menuColor', values: PRESET_MENU_COLORS, bits: 3 },
62
+ { key: 'menuAccent', values: PRESET_MENU_ACCENTS, bits: 3 },
63
+ { key: 'radius', values: PRESET_RADII, bits: 4 },
64
+ { key: 'font', values: PRESET_FONTS, bits: 6 },
65
+ { key: 'iconLibrary', values: PRESET_ICON_LIBRARIES, bits: 6 },
66
+ { key: 'theme', values: PRESET_THEMES, bits: 6 },
67
+ { key: 'baseColor', values: PRESET_BASE_COLORS, bits: 6 },
68
+ { key: 'style', values: PRESET_STYLES, bits: 6 },
69
+ ];
70
+ const FIELDS_V2 = [
71
+ ...FIELDS_V1,
72
+ { key: 'chartColor', values: PRESET_CHART_COLORS, bits: 6 },
73
+ { key: 'fontHeading', values: PRESET_FONT_HEADINGS, bits: 5 },
74
+ ];
75
+
76
+ /**
77
+ * @typedef {object} PresetConfig
78
+ * @property {string} style
79
+ * @property {string} baseColor
80
+ * @property {string} theme
81
+ * @property {string} [chartColor]
82
+ * @property {string} iconLibrary
83
+ * @property {string} font
84
+ * @property {string} fontHeading
85
+ * @property {string} radius
86
+ * @property {string} menuAccent
87
+ * @property {string} menuColor
88
+ */
89
+
90
+ /**
91
+ * Every field at index 0: what an all-zero code decodes to. Written out
92
+ * rather than computed from the field table, because the module does no work
93
+ * at module scope: the configurator runs it in the browser, and a top-level
94
+ * call would pin every page importing it to the browser (see the kit's
95
+ * AGENTS.md). A test holds it equal to the table.
96
+ *
97
+ * @type {PresetConfig}
98
+ */
99
+ export const DEFAULT_PRESET_CONFIG = {
100
+ menuColor: 'default',
101
+ menuAccent: 'subtle',
102
+ radius: 'default',
103
+ font: 'inter',
104
+ iconLibrary: 'lucide',
105
+ theme: 'neutral',
106
+ baseColor: 'neutral',
107
+ style: 'nova',
108
+ chartColor: 'neutral',
109
+ fontHeading: 'inherit',
110
+ };
111
+
112
+ const BASE62 = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
113
+ const VERSIONS = ['a', 'b'];
114
+
115
+ function toBase62(num) {
116
+ if (num === 0) return '0';
117
+ let out = '';
118
+ let n = num;
119
+ while (n > 0) {
120
+ out = BASE62[n % 62] + out;
121
+ n = Math.floor(n / 62);
122
+ }
123
+ return out;
124
+ }
125
+
126
+ function fromBase62(str) {
127
+ let n = 0;
128
+ for (const ch of str) {
129
+ const i = BASE62.indexOf(ch);
130
+ if (i === -1) return -1;
131
+ n = n * 62 + i;
132
+ }
133
+ return n;
134
+ }
135
+
136
+ /**
137
+ * Encode a config as a v2 (`b`) code. An unknown value encodes as index 0,
138
+ * as in shadcn. A missing field takes its default, except that a missing
139
+ * theme follows the base colour and a missing chart colour follows the
140
+ * theme, so a partial config (`{ baseColor: 'stone' }`) encodes a choice
141
+ * {@link resolvePresetConfig} accepts rather than stone with neutral's
142
+ * theme. Multiplication rather than bit operators, since JavaScript's bitwise
143
+ * operators truncate to 32 bits and the code is 51.
144
+ *
145
+ * @param {Partial<PresetConfig>} config
146
+ */
147
+ export function encodePreset(config) {
148
+ const theme = config.theme || config.baseColor || DEFAULT_PRESET_CONFIG.theme;
149
+ const given = Object.fromEntries(Object.entries(config).filter(([, v]) => v !== undefined));
150
+ const merged = { ...DEFAULT_PRESET_CONFIG, theme, chartColor: config.chartColor || theme, ...given };
151
+ let bits = 0;
152
+ let offset = 0;
153
+ for (const field of FIELDS_V2) {
154
+ const idx = field.values.indexOf(merged[field.key]);
155
+ bits += (idx === -1 ? 0 : idx) * 2 ** offset;
156
+ offset += field.bits;
157
+ }
158
+ return 'b' + toBase62(bits);
159
+ }
160
+
161
+ /**
162
+ * Decode a code to its fields, or null when it is not a code. An `a` (v1)
163
+ * code has no chart colour (it then follows the theme) and inherits its
164
+ * heading font. An index past the end of a list decodes to the default.
165
+ *
166
+ * @param {string} code
167
+ * @returns {PresetConfig | null}
168
+ */
169
+ export function decodePreset(code) {
170
+ if (!isPresetCode(code)) return null;
171
+ const fields = code[0] === 'a' ? FIELDS_V1 : FIELDS_V2;
172
+ const bits = fromBase62(code.slice(1));
173
+ if (bits < 0) return null;
174
+ /** @type {Record<string, string>} */
175
+ const out = {};
176
+ let offset = 0;
177
+ for (const field of fields) {
178
+ const idx = Math.floor(bits / 2 ** offset) % 2 ** field.bits;
179
+ out[field.key] = idx < field.values.length ? field.values[idx] : field.values[0];
180
+ offset += field.bits;
181
+ }
182
+ if (code[0] === 'a') out.fontHeading = 'inherit';
183
+ return /** @type {PresetConfig} */ (out);
184
+ }
185
+
186
+ /** True when a string has the shape of a preset code (a version, then base62). */
187
+ export function isPresetCode(value) {
188
+ if (typeof value !== 'string' || value.length < 2 || value.length > 10) return false;
189
+ if (!VERSIONS.includes(value[0])) return false;
190
+ for (let i = 1; i < value.length; i++) if (BASE62.indexOf(value[i]) === -1) return false;
191
+ return true;
192
+ }
193
+
194
+ /**
195
+ * The icon libraries an app can pick. Each is a registry item whose one file
196
+ * lands beside the cn() helper as `icons.ts` (see `lib/icons*.ts`), so the
197
+ * five export the same names and switching is a file swap.
198
+ */
199
+ export const ICON_LIBRARIES = [
200
+ { name: 'lucide', title: 'Lucide', item: 'lib-icons', path: 'lib/icons.ts' },
201
+ { name: 'tabler', title: 'Tabler Icons', item: 'lib-icons-tabler', path: 'lib/icons-tabler.ts' },
202
+ { name: 'hugeicons', title: 'Hugeicons', item: 'lib-icons-hugeicons', path: 'lib/icons-hugeicons.ts' },
203
+ { name: 'phosphor', title: 'Phosphor Icons', item: 'lib-icons-phosphor', path: 'lib/icons-phosphor.ts' },
204
+ { name: 'remixicon', title: 'Remix Icon', item: 'lib-icons-remixicon', path: 'lib/icons-remixicon.ts' },
205
+ ];
206
+
207
+ /** The icon library with this name, or undefined. */
208
+ export function getIconLibrary(name) {
209
+ return ICON_LIBRARIES.find((l) => l.name === name);
210
+ }
211
+
212
+ /**
213
+ * Validate a decoded (or hand-built) config and fill what it leaves out:
214
+ * `chartColor` follows the theme, a heading font equal to the body font is
215
+ * `inherit`. Returns `{ config }` or `{ error }`, naming the first field that
216
+ * is not a choice the kit offers.
217
+ *
218
+ * @param {Partial<PresetConfig>} input
219
+ * @returns {{ config: PresetConfig, error?: undefined } | { error: string, config?: undefined }}
220
+ */
221
+ export function resolvePresetConfig(input) {
222
+ const c = { ...DEFAULT_PRESET_CONFIG, ...input };
223
+ if (!PRESET_STYLES.includes(c.style)) return { error: `Unknown style "${c.style}"` };
224
+ if (!BASE_COLOR_NAMES.includes(c.baseColor)) return { error: `Unknown base color "${c.baseColor}"` };
225
+ if (!getTheme(c.theme) || !themesForBaseColor(c.baseColor).some((t) => t.name === c.theme)) {
226
+ return { error: `Theme "${c.theme}" is not available for base color "${c.baseColor}"` };
227
+ }
228
+ const chartColor = input.chartColor || c.theme;
229
+ if (!getTheme(chartColor) || !themesForBaseColor(c.baseColor).some((t) => t.name === chartColor)) {
230
+ return { error: `Chart color "${chartColor}" is not available for base color "${c.baseColor}"` };
231
+ }
232
+ if (!getIconLibrary(c.iconLibrary)) return { error: `Unknown icon library "${c.iconLibrary}"` };
233
+ if (!getFont(c.font)) return { error: `Unknown font "${c.font}"` };
234
+ if (c.fontHeading !== 'inherit' && !getFont(c.fontHeading)) return { error: `Unknown heading font "${c.fontHeading}"` };
235
+ if (!RADII.some((r) => r.name === c.radius)) return { error: `Unknown radius "${c.radius}"` };
236
+ if (!PRESET_MENU_ACCENTS.includes(c.menuAccent)) return { error: `Unknown menu accent "${c.menuAccent}"` };
237
+ if (!PRESET_MENU_COLORS.includes(c.menuColor)) return { error: `Unknown menu color "${c.menuColor}"` };
238
+ const fontHeading = c.fontHeading === c.font ? 'inherit' : c.fontHeading;
239
+ return { config: { ...c, chartColor, fontHeading } };
240
+ }
241
+
242
+ /**
243
+ * The `@theme inline` tokens a config's fonts set: the body font's own token
244
+ * (`--font-sans`, `--font-mono` or `--font-serif`), `--font-sans` as well
245
+ * when the body font is a serif or a mono, and `--font-heading`, which is the
246
+ * heading font or, when inherited, a reference to the body font's token. Bare
247
+ * names, as `cssVars.theme` spells them.
248
+ *
249
+ * `--font-sans` is Tailwind's default family, the one the page's text takes.
250
+ * shadcn puts its body font's class on `<body>` from the Next layout; a WebJs
251
+ * app has no such hook, so the body font reaches the page through this token,
252
+ * which is how the configurator previews it whatever its kind.
253
+ *
254
+ * @param {PresetConfig} config
255
+ * @returns {Record<string, string>}
256
+ */
257
+ export function presetFontVars(config) {
258
+ const body = getFont(config.font);
259
+ const heading = config.fontHeading !== 'inherit' ? getFont(config.fontHeading) : undefined;
260
+ if (!body) return {};
261
+ const vars = { [body.variable.slice(2)]: body.family };
262
+ if (body.variable !== '--font-sans') vars['font-sans'] = body.family;
263
+ vars['font-heading'] = heading ? heading.family : `var(${body.variable})`;
264
+ return vars;
265
+ }
266
+
267
+ /**
268
+ * Everything a preset installs, as one `registry:base` item (shadcn's
269
+ * `/init` payload shape): the merged tokens, the font tokens, the items to
270
+ * pull (the helpers, the icon library, the font items), and the config
271
+ * itself under `meta`, since the kit's item schema has no `config` field.
272
+ *
273
+ * @param {PresetConfig} config a resolved config (see {@link resolvePresetConfig})
274
+ */
275
+ export function buildPresetItem(config) {
276
+ const code = encodePreset(config);
277
+ const { light, dark } = buildThemeVars(config);
278
+ const icons = getIconLibrary(config.iconLibrary);
279
+ const registryDependencies = ['lib-utils', 'lib-dom', icons ? icons.item : 'lib-icons', `font-${config.font}`];
280
+ if (config.fontHeading !== 'inherit') registryDependencies.push(`font-heading-${config.fontHeading}`);
281
+ return {
282
+ $schema: 'https://ui.webjs.dev/schema/registry-item.json',
283
+ name: `preset-${code}`,
284
+ type: 'registry:base',
285
+ title: `${config.style} / ${config.baseColor} / ${config.theme}`,
286
+ description: `The design system for preset ${code}. Install it with: npx @webjsdev/ui init --preset ${code}`,
287
+ dependencies: ['@webjsdev/core'],
288
+ registryDependencies,
289
+ cssVars: { theme: presetFontVars(config), light, dark },
290
+ meta: { preset: code, config: { ...config } },
291
+ };
292
+ }
293
+
294
+ /**
295
+ * The Google Fonts stylesheet URLs a config's fonts need, body first.
296
+ *
297
+ * @param {PresetConfig} config
298
+ */
299
+ export function presetFontUrls(config) {
300
+ const names = [config.font, config.fontHeading].filter((n, i, all) => n && n !== 'inherit' && all.indexOf(n) === i);
301
+ return names.map((n) => getFont(n)).filter(Boolean).map((f) => googleFontsUrl(/** @type {any} */ (f)));
302
+ }