@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,48 @@
1
+ /**
2
+ * The preview-03 source part: a source an assistant cited, either a url (a
3
+ * link with its title and host) or a document (its title, file name, media
4
+ * type and source id). A fragment helper, rendered by the server.
5
+ *
6
+ * Installed by `npx @webjsdev/ui add preview-03` at
7
+ * `components/preview-03/part-source.ts`. Ported from shadcn/ui's preview-03.
8
+ */
9
+ import { html } from '@webjsdev/core';
10
+ import { cn } from '../../../lib/utils.ts';
11
+ import { badgeClass } from '../../../components/badge.ts';
12
+ import { ExternalLinkIcon, FileSearchIcon } from '../../../lib/icons.ts';
13
+
14
+ export type SourcePart =
15
+ | { type: 'source-url'; sourceId: string; url: string; title?: string }
16
+ | { type: 'source-document'; sourceId: string; mediaType: string; title?: string; filename?: string };
17
+
18
+ function hostname(url: string): string {
19
+ try {
20
+ return new URL(url).hostname.replace(/^www\./, '');
21
+ } catch {
22
+ return url;
23
+ }
24
+ }
25
+
26
+ export function partSource(opts: { part: SourcePart; class?: string }) {
27
+ const { part } = opts;
28
+ const icon = 'flex size-8 shrink-0 items-center justify-center rounded-md bg-background text-muted-foreground';
29
+ if (part.type === 'source-url') {
30
+ return html`<a data-slot="part-source" data-type=${part.type} href=${part.url} target="_blank" rel="noreferrer" class=${cn('flex w-full max-w-full min-w-0 items-center gap-2 rounded-lg border bg-muted/40 p-3 text-sm transition-colors hover:bg-muted', opts.class)}>
31
+ <span class=${icon}>${ExternalLinkIcon('size-4')}</span>
32
+ <span class="min-w-0 flex-1">
33
+ <span class="block truncate font-medium">${part.title ?? part.url}</span>
34
+ <span class="block truncate text-xs text-muted-foreground">${hostname(part.url)}</span>
35
+ </span>
36
+ <span data-slot="badge" data-variant="outline" class=${cn(badgeClass({ variant: 'outline' }), 'shrink-0')}>URL</span>
37
+ </a>`;
38
+ }
39
+ return html`<div data-slot="part-source" data-type=${part.type} class=${cn('flex w-full max-w-full min-w-0 items-start gap-2 rounded-lg border bg-muted/40 p-3 text-sm', opts.class)}>
40
+ <span class=${icon}>${FileSearchIcon('size-4')}</span>
41
+ <span class="min-w-0 flex-1">
42
+ <span class="block truncate font-medium">${part.title ?? part.filename ?? 'Document source'}</span>
43
+ <span class="mt-0.5 block truncate text-xs text-muted-foreground">${[part.filename, part.mediaType].filter(Boolean).join(' / ')}</span>
44
+ <span class="mt-2 block text-xs text-muted-foreground">Source ID: ${part.sourceId}</span>
45
+ </span>
46
+ <span data-slot="badge" data-variant="outline" class=${cn(badgeClass({ variant: 'outline' }), 'shrink-0')}>Document</span>
47
+ </div>`;
48
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * The preview-03 text part: one text part of a chat message, in a bubble. A
3
+ * user's text is shown as written; an assistant's is read as Markdown
4
+ * (paragraphs, `-` and `1.` lists, `**bold**`, `*italic*` and inline code).
5
+ * A fragment helper, rendered by the server.
6
+ *
7
+ * Installed by `npx @webjsdev/ui add preview-03` at
8
+ * `components/preview-03/part-text.ts`. Ported from shadcn/ui's preview-03,
9
+ * where the Markdown is Streamdown. Swap `markdown()` for a full Markdown
10
+ * renderer if your replies carry tables or fenced code.
11
+ */
12
+ import { html } from '@webjsdev/core';
13
+ import type { TemplateResult } from '@webjsdev/core';
14
+ import { cn } from '../../../lib/utils.ts';
15
+ import { bubbleClass, bubbleContentClass } from '../../../components/bubble.ts';
16
+
17
+ export type PartTextVariant = 'default' | 'bubble';
18
+ export type ChatRole = 'user' | 'system' | 'assistant';
19
+
20
+ /** `**bold**`, `*italic*` and inline code, everything else as text. */
21
+ function inline(text: string): unknown[] {
22
+ const out: unknown[] = [];
23
+ const re = /\*\*([^*]+)\*\*|\*([^*]+)\*|`([^`]+)`/g;
24
+ let last = 0;
25
+ for (const m of text.matchAll(re)) {
26
+ if (m.index > last) out.push(text.slice(last, m.index));
27
+ if (m[1] !== undefined) out.push(html`<strong>${m[1]}</strong>`);
28
+ else if (m[2] !== undefined) out.push(html`<em>${m[2]}</em>`);
29
+ else out.push(html`<code class="rounded-sm bg-muted px-1 py-0.5 font-mono text-[0.9em]">${m[3]}</code>`);
30
+ last = m.index + m[0].length;
31
+ }
32
+ if (last < text.length) out.push(text.slice(last));
33
+ return out;
34
+ }
35
+
36
+ /** A small Markdown subset, enough for the scripted replies. */
37
+ export function markdown(text: string): TemplateResult {
38
+ // Runs of consecutive lines of one kind: a bullet list, a numbered list, or
39
+ // a paragraph (a blank line also ends a paragraph).
40
+ const runs: Array<{ kind: 'ul' | 'ol' | 'p'; lines: string[] }> = [];
41
+ for (const line of text.trim().split('\n')) {
42
+ if (!line.trim()) {
43
+ runs.push({ kind: 'p', lines: [] });
44
+ continue;
45
+ }
46
+ const kind = /^\s*-\s+/.test(line) ? 'ul' : /^\s*\d+\.\s+/.test(line) ? 'ol' : 'p';
47
+ const last = runs[runs.length - 1];
48
+ if (last && last.kind === kind) last.lines.push(line);
49
+ else runs.push({ kind, lines: [line] });
50
+ }
51
+ return html`<div class="space-y-3">${runs.filter((r) => r.lines.length).map((r) => {
52
+ if (r.kind === 'ul') {
53
+ return html`<ul class="list-disc space-y-1 ps-5">${r.lines.map((l) => html`<li>${inline(l.replace(/^\s*-\s+/, ''))}</li>`)}</ul>`;
54
+ }
55
+ if (r.kind === 'ol') {
56
+ return html`<ol class="list-decimal space-y-1 ps-5">${r.lines.map((l) => html`<li>${inline(l.replace(/^\s*\d+\.\s+/, ''))}</li>`)}</ol>`;
57
+ }
58
+ return html`<p>${r.lines.map((l, i) => html`${i ? html`<br>` : ''}${inline(l)}`)}</p>`;
59
+ })}</div>`;
60
+ }
61
+
62
+ export function partText(opts: { text: string; role?: ChatRole; variant?: PartTextVariant; tinted?: boolean; class?: string }) {
63
+ const { text, role, variant, tinted = false } = opts;
64
+ const content = role === 'user' || variant === 'bubble' ? html`<span class="whitespace-pre-wrap">${text}</span>` : markdown(text);
65
+ const bubbleVariant = variant === 'bubble' ? (tinted ? 'tinted' : 'default') : role === 'user' ? 'default' : 'ghost';
66
+ return html`<div data-slot="bubble" data-variant=${bubbleVariant} class=${cn(bubbleClass({ variant: bubbleVariant }), opts.class)}>
67
+ <div data-slot="bubble-content" class=${bubbleContentClass()}>${content}</div>
68
+ </div>`;
69
+ }
@@ -0,0 +1,71 @@
1
+ /**
2
+ * The preview-03 tool part: one tool call in an assistant turn, with its
3
+ * title, name and state, and its input, output or error underneath. A
4
+ * fragment helper, rendered by the server.
5
+ *
6
+ * Installed by `npx @webjsdev/ui add preview-03` at
7
+ * `components/preview-03/part-tool.ts`. Ported from shadcn/ui's preview-03.
8
+ */
9
+ import { html } from '@webjsdev/core';
10
+ import { cn } from '../../../lib/utils.ts';
11
+ import { badgeClass } from '../../../components/badge.ts';
12
+ import { separatorClass } from '../../../components/separator.ts';
13
+ import { SettingsIcon } from '../../../lib/icons.ts';
14
+
15
+ export interface ToolPart {
16
+ /** `tool-<name>`, or `dynamic-tool` with a `toolName`. */
17
+ type: string;
18
+ toolName?: string;
19
+ toolCallId: string;
20
+ title?: string;
21
+ state: string;
22
+ input?: unknown;
23
+ output?: unknown;
24
+ errorText?: string;
25
+ }
26
+
27
+ function toolName(part: ToolPart): string {
28
+ return part.type === 'dynamic-tool' ? (part.toolName ?? 'dynamicTool') : part.type.replace('tool-', '');
29
+ }
30
+
31
+ function toolTitle(part: ToolPart): string {
32
+ if (typeof part.title === 'string') return part.title;
33
+ return toolName(part)
34
+ .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
35
+ .replace(/[-_]/g, ' ')
36
+ .replace(/\b\w/g, (letter) => letter.toUpperCase());
37
+ }
38
+
39
+ function formatValue(value: unknown): string {
40
+ return typeof value === 'string' ? value : JSON.stringify(value, null, 2);
41
+ }
42
+
43
+ export function partTool(opts: { part: ToolPart; class?: string }) {
44
+ const { part } = opts;
45
+ if (part.type !== 'dynamic-tool' && !part.type.startsWith('tool-')) return '';
46
+ const hasBody = part.input !== undefined || part.output !== undefined || !!part.errorText;
47
+ const pre = 'overflow-auto rounded-md bg-background p-2 text-xs leading-relaxed';
48
+ return html`<div data-slot="part-tool" data-state=${part.state} class=${cn('w-full max-w-full min-w-0 rounded-lg border bg-muted/40 text-sm', opts.class)}>
49
+ <div class="flex min-w-0 items-center gap-2 px-3 py-2">
50
+ <span class="flex size-7 shrink-0 items-center justify-center rounded-md bg-background text-muted-foreground">${SettingsIcon('size-4')}</span>
51
+ <div class="min-w-0 flex-1">
52
+ <div class="truncate font-medium">${toolTitle(part)}</div>
53
+ <div class="truncate text-xs text-muted-foreground">${toolName(part)}</div>
54
+ </div>
55
+ <span data-slot="badge" data-variant="outline" class=${cn(badgeClass({ variant: 'outline' }), 'capitalize')}>${part.state.replace(/-/g, ' ')}</span>
56
+ </div>
57
+ ${hasBody ? html`
58
+ <div role="none" data-slot="separator" data-orientation="horizontal" class=${separatorClass()}></div>
59
+ <div class="grid gap-3 p-3">
60
+ ${part.input !== undefined ? html`<div class="grid gap-1">
61
+ <div class="text-xs font-medium text-muted-foreground">Input</div>
62
+ <pre class=${cn('max-h-32', pre)}>${formatValue(part.input)}</pre>
63
+ </div>` : ''}
64
+ ${part.output !== undefined ? html`<div class="grid gap-1">
65
+ <div class="text-xs font-medium text-muted-foreground">Output</div>
66
+ <pre class=${cn('max-h-40', pre)}>${formatValue(part.output)}</pre>
67
+ </div>` : ''}
68
+ ${part.errorText ? html`<div class="rounded-md border border-destructive/30 bg-destructive/10 p-2 text-xs text-destructive">${part.errorText}</div>` : ''}
69
+ </div>` : ''}
70
+ </div>`;
71
+ }
@@ -0,0 +1,86 @@
1
+ /**
2
+ * The preview-03 prompt input: a chat composer, a textarea with an add menu
3
+ * and a send button in one input group. A fragment helper, rendered by the
4
+ * server; the menu is the kit's `<ui-dropdown-menu>`.
5
+ *
6
+ * The `<form>` has no `action` yet. Bind a server action from a `'use server'`
7
+ * file (`<form action=${sendMessage}>`) and read the `prompt` field, or
8
+ * handle the submit in the element that owns the conversation, as
9
+ * `<preview-03-chat>` (chat-player.ts) does for the scripted demo.
10
+ *
11
+ * Installed by `npx @webjsdev/ui add preview-03` at
12
+ * `components/preview-03/prompt-input.ts`. Ported from shadcn/ui's preview-03.
13
+ */
14
+ import { html } from '@webjsdev/core';
15
+ import { cn } from '../../../lib/utils.ts';
16
+ import { fieldGroupClass } from '../../../components/field.ts';
17
+ import {
18
+ inputGroupAddonClass,
19
+ inputGroupButtonClass,
20
+ inputGroupClass,
21
+ inputGroupTextareaClass,
22
+ } from '../../../components/input-group.ts';
23
+ import '../../../components/dropdown-menu.ts';
24
+ import { ArrowUpIcon, BookOpenIcon, BotIcon, BrainIcon, CheckIcon, GlobeIcon, ImageIcon, MonitorIcon, MoreHorizontalIcon, PaperclipIcon, PlusIcon, SquareIcon } from '../../../lib/icons.ts';
25
+
26
+ /**
27
+ * `id` names the textarea and the add menu's button, so it must be unique on
28
+ * the page. `value` is the text the box opens with.
29
+ */
30
+ export function promptInput(opts: { id: string; value?: string; class?: string }) {
31
+ const value = opts.value ?? '';
32
+ const addId = `${opts.id}-add`;
33
+ // `flex-col` stacks the box over the toolbar. Most styles do it for any
34
+ // group with a block-end addon; new-york does not, so it is written here.
35
+ return html`<form data-slot="prompt-input" class=${cn('w-full', opts.class)}>
36
+ <div data-slot="field-group" class=${cn(fieldGroupClass(), 'gap-1')}>
37
+ <div data-slot="input-group" role="group" class=${cn(inputGroupClass(), 'h-auto flex-col')}>
38
+ <textarea
39
+ data-slot="input-group-control"
40
+ data-chat-input
41
+ id=${opts.id}
42
+ name="prompt"
43
+ aria-label="Message"
44
+ placeholder="Ask me anything..."
45
+ class=${cn(inputGroupTextareaClass(), 'h-10 min-h-10 overflow-y-auto transition-all')}
46
+ >${value}</textarea>
47
+ <div role="group" data-slot="input-group-addon" data-align="block-end" class=${cn(inputGroupAddonClass({ align: 'block-end' }), 'p-2')}>
48
+ <button type="button" id=${addId} data-slot="input-group-button" data-variant="ghost" data-size="icon-sm" class=${inputGroupButtonClass({ size: 'icon-sm', variant: 'ghost' })}>
49
+ ${PlusIcon()}<span class="sr-only">Add</span>
50
+ </button>
51
+ <button type="submit" data-chat-send data-slot="input-group-button" data-variant="default" data-size="icon-sm" data-visible="true" ?disabled=${!value.trim()} class=${cn(inputGroupButtonClass({ size: 'icon-sm', variant: 'default' }), 'ml-auto data-[visible=false]:hidden')}>
52
+ ${ArrowUpIcon()}<span class="sr-only">Send</span>
53
+ </button>
54
+ <button type="button" data-chat-stop data-slot="input-group-button" data-variant="default" data-size="icon-sm" data-visible="false" class=${cn(inputGroupButtonClass({ size: 'icon-sm', variant: 'default' }), 'ml-auto data-[visible=false]:hidden')}>
55
+ ${SquareIcon('fill-foreground')}<span class="sr-only">Stop</span>
56
+ </button>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ <ui-dropdown-menu trigger=${addId}>
61
+ <ui-dropdown-menu-content class="w-fit">
62
+ <ui-dropdown-menu-group>
63
+ <ui-dropdown-menu-item>${PaperclipIcon()}Add Photos and Files</ui-dropdown-menu-item>
64
+ <ui-dropdown-menu-item>${MonitorIcon()}Take a Screenshot</ui-dropdown-menu-item>
65
+ </ui-dropdown-menu-group>
66
+ <ui-dropdown-menu-separator></ui-dropdown-menu-separator>
67
+ <ui-dropdown-menu-group>
68
+ <ui-dropdown-menu-item>${ImageIcon()}Create Image</ui-dropdown-menu-item>
69
+ <ui-dropdown-menu-item>${BrainIcon()}Deep Research</ui-dropdown-menu-item>
70
+ <ui-dropdown-menu-item>${GlobeIcon()}Web Search</ui-dropdown-menu-item>
71
+ </ui-dropdown-menu-group>
72
+ <ui-dropdown-menu-separator></ui-dropdown-menu-separator>
73
+ <ui-dropdown-menu-group>
74
+ <ui-dropdown-menu-sub>
75
+ <ui-dropdown-menu-sub-trigger>${MoreHorizontalIcon()}More</ui-dropdown-menu-sub-trigger>
76
+ <ui-dropdown-menu-sub-content>
77
+ <ui-dropdown-menu-item>${BotIcon()}Agent Mode</ui-dropdown-menu-item>
78
+ <ui-dropdown-menu-item>${BookOpenIcon()}Add Sources</ui-dropdown-menu-item>
79
+ <ui-dropdown-menu-item>${CheckIcon()}Create Tasks</ui-dropdown-menu-item>
80
+ </ui-dropdown-menu-sub-content>
81
+ </ui-dropdown-menu-sub>
82
+ </ui-dropdown-menu-group>
83
+ </ui-dropdown-menu-content>
84
+ </ui-dropdown-menu>
85
+ </form>`;
86
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The preview-03 block's page: four AI chat cards side by side, a simple
3
+ * chat, a group chat, a reasoning trace and a file review, each a scripted
4
+ * conversation you can step through with the send button.
5
+ *
6
+ * Installed by `npx @webjsdev/ui add preview-03` at `app/preview-03/page.ts`.
7
+ * It is app code you own, so edit it freely, and point each card's prompt
8
+ * input at your own chat endpoint. Ported from shadcn/ui's preview-03.
9
+ */
10
+ import { html } from '@webjsdev/core';
11
+ import type { Metadata } from '@webjsdev/core';
12
+ import { spinner } from '../../components/spinner.ts';
13
+ import { filesChat } from './cards/files-chat.ts';
14
+ import { groupChat } from './cards/group-chat.ts';
15
+ import { reasoningChat } from './cards/reasoning-chat.ts';
16
+ import { simpleChat } from './cards/simple-chat.ts';
17
+
18
+ export const metadata: Metadata = { title: 'Preview 03' };
19
+
20
+ const COLUMN = 'flex h-full min-h-0 flex-1 flex-col p-1 [contain-intrinsic-size:380px_1200px] [content-visibility:auto]';
21
+
22
+ export default function Preview03Page() {
23
+ return html`
24
+ <div class="flex h-screen min-h-0 flex-col overflow-x-auto overflow-y-hidden bg-muted contain-[paint] [--gap:--spacing(4)] 3xl:[--gap:--spacing(12)] md:[--gap:--spacing(10)] dark:bg-background style-lyra:md:[--gap:--spacing(6)] style-mira:md:[--gap:--spacing(6)]">
25
+ <div class="flex min-h-0 w-full min-w-max flex-1 justify-center">
26
+ <div
27
+ class="grid min-h-0 w-[2400px] grid-cols-7 items-start gap-(--gap) bg-muted p-(--gap) md:w-[3000px] dark:bg-background style-lyra:md:w-[2600px] style-mira:md:w-[2600px] *:[div]:gap-(--gap)"
28
+ data-slot="capture-target"
29
+ >
30
+ <div class=${COLUMN}>${simpleChat()}</div>
31
+ <div class=${COLUMN}>${groupChat()}</div>
32
+ <div class=${COLUMN}>${reasoningChat()}</div>
33
+ <div class=${COLUMN}>${filesChat()}</div>
34
+ </div>
35
+ </div>
36
+ <div class="sr-only">${spinner()}</div>
37
+ </div>
38
+ `;
39
+ }
@@ -0,0 +1,113 @@
1
+ /**
2
+ * The sidebar-01 app sidebar: a version switcher and a search field in the
3
+ * header, then one group per docs section with its pages as links. A
4
+ * fragment helper, so the markup is rendered by the server; the sidebar, its
5
+ * rail and the version menu are the kit's elements. Ported from shadcn/ui's
6
+ * sidebar-01.
7
+ *
8
+ * The data below is sample data. Replace it with your own, point each `url`
9
+ * at a real route, and mark the current page with `isActive`.
10
+ */
11
+ import { html, nothing } from '@webjsdev/core';
12
+ import {
13
+ sidebarContentClass,
14
+ sidebarGroupClass,
15
+ sidebarGroupContentClass,
16
+ sidebarGroupLabelClass,
17
+ sidebarHeaderClass,
18
+ sidebarMenuButtonClass,
19
+ sidebarMenuClass,
20
+ sidebarMenuItemClass,
21
+ } from '../../../components/sidebar.ts';
22
+ import { searchForm } from './search-form.ts';
23
+ import { versionSwitcher } from './version-switcher.ts';
24
+
25
+ interface NavSection {
26
+ title: string;
27
+ url: string;
28
+ items: { title: string; url: string; isActive?: boolean }[];
29
+ }
30
+
31
+ // This is sample data.
32
+ const data: { versions: string[]; navMain: NavSection[] } = {
33
+ versions: ['1.0.1', '1.1.0-alpha', '2.0.0-beta1'],
34
+ navMain: [
35
+ {
36
+ title: 'Getting Started',
37
+ url: '#',
38
+ items: [
39
+ { title: 'Installation', url: '#' },
40
+ { title: 'Project Structure', url: '#' },
41
+ ],
42
+ },
43
+ {
44
+ title: 'Build Your Application',
45
+ url: '#',
46
+ items: [
47
+ { title: 'Routing', url: '#' },
48
+ { title: 'Data Fetching', url: '#', isActive: true },
49
+ { title: 'Rendering', url: '#' },
50
+ { title: 'Caching', url: '#' },
51
+ { title: 'Styling', url: '#' },
52
+ { title: 'Optimizing', url: '#' },
53
+ { title: 'Configuring', url: '#' },
54
+ { title: 'Testing', url: '#' },
55
+ { title: 'Authentication', url: '#' },
56
+ { title: 'Deploying', url: '#' },
57
+ { title: 'Upgrading', url: '#' },
58
+ { title: 'Examples', url: '#' },
59
+ ],
60
+ },
61
+ {
62
+ title: 'API Reference',
63
+ url: '#',
64
+ items: [
65
+ { title: 'Components', url: '#' },
66
+ { title: 'File Conventions', url: '#' },
67
+ { title: 'Functions', url: '#' },
68
+ { title: 'next.config.js Options', url: '#' },
69
+ { title: 'CLI', url: '#' },
70
+ { title: 'Edge Runtime', url: '#' },
71
+ ],
72
+ },
73
+ {
74
+ title: 'Architecture',
75
+ url: '#',
76
+ items: [
77
+ { title: 'Accessibility', url: '#' },
78
+ { title: 'Fast Refresh', url: '#' },
79
+ { title: 'Next.js Compiler', url: '#' },
80
+ { title: 'Supported Browsers', url: '#' },
81
+ { title: 'Turbopack', url: '#' },
82
+ ],
83
+ },
84
+ ],
85
+ };
86
+
87
+ export function appSidebar() {
88
+ return html`
89
+ <ui-sidebar>
90
+ <div data-slot="sidebar-header" data-sidebar="header" class=${sidebarHeaderClass()}>
91
+ ${versionSwitcher({ versions: data.versions, defaultVersion: data.versions[0] })}
92
+ ${searchForm()}
93
+ </div>
94
+ <nav aria-label="Docs" data-slot="sidebar-content" data-sidebar="content" class=${sidebarContentClass()}>
95
+ ${data.navMain.map((section) => html`
96
+ <div data-slot="sidebar-group" data-sidebar="group" class=${sidebarGroupClass()}>
97
+ <div data-slot="sidebar-group-label" data-sidebar="group-label" class=${sidebarGroupLabelClass()}>${section.title}</div>
98
+ <div data-slot="sidebar-group-content" data-sidebar="group-content" class=${sidebarGroupContentClass()}>
99
+ <ul data-slot="sidebar-menu" data-sidebar="menu" class=${sidebarMenuClass()}>
100
+ ${section.items.map((item) => html`
101
+ <li data-slot="sidebar-menu-item" data-sidebar="menu-item" class=${sidebarMenuItemClass()}>
102
+ <a href=${item.url} data-slot="sidebar-menu-button" data-sidebar="menu-button" data-size="default" data-active=${item.isActive ? 'true' : 'false'} aria-current=${item.isActive ? 'page' : nothing} class=${sidebarMenuButtonClass()}>${item.title}</a>
103
+ </li>
104
+ `)}
105
+ </ul>
106
+ </div>
107
+ </div>
108
+ `)}
109
+ </nav>
110
+ <ui-sidebar-rail></ui-sidebar-rail>
111
+ </ui-sidebar>
112
+ `;
113
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The sidebar-01 search form: a search field at the top of the sidebar. A
3
+ * fragment helper, so it renders on the server and ships no JavaScript.
4
+ * Ported from shadcn/ui's sidebar-01.
5
+ *
6
+ * The `<form>` has no `action` yet. Point it at your search route as a GET
7
+ * (`<form action="/search">`), or bind a server action from a `'use server'`
8
+ * file (`<form action=${search}>`). Until then a submit reloads the page with
9
+ * `?q=` in the URL.
10
+ */
11
+ import { html, nothing } from '@webjsdev/core';
12
+ import { cn } from '../../../lib/utils.ts';
13
+ import { labelClass } from '../../../components/label.ts';
14
+ import {
15
+ sidebarGroupClass,
16
+ sidebarGroupContentClass,
17
+ sidebarInputClass,
18
+ } from '../../../components/sidebar.ts';
19
+ import { SearchIcon } from '../../../lib/icons.ts';
20
+
21
+ export function searchForm(opts: { class?: string } = {}) {
22
+ return html`
23
+ <form role="search" class=${opts.class ?? nothing}>
24
+ <div data-slot="sidebar-group" data-sidebar="group" class=${cn(sidebarGroupClass(), 'py-0')}>
25
+ <div data-slot="sidebar-group-content" data-sidebar="group-content" class=${cn(sidebarGroupContentClass(), 'relative')}>
26
+ <label data-slot="label" for="search" class=${cn(labelClass(), 'sr-only')}>Search</label>
27
+ <input data-slot="sidebar-input" data-sidebar="input" id="search" name="q" placeholder="Search the docs..." class=${cn(sidebarInputClass(), 'pl-8')}>
28
+ ${SearchIcon('pointer-events-none absolute top-1/2 left-2 size-4 -translate-y-1/2 opacity-50 select-none')}
29
+ </div>
30
+ </div>
31
+ </form>
32
+ `;
33
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The sidebar-01 version switcher: the docs logo with the current version,
3
+ * opening a menu of the versions. A fragment helper; the menu is the kit's
4
+ * `<ui-dropdown-menu>`. Ported from shadcn/ui's sidebar-01.
5
+ *
6
+ * It renders `defaultVersion` as the selected one. shadcn keeps the choice in
7
+ * React state; in your app the version is server data (a route segment or a
8
+ * cookie), so render the right one on the server and make each item a link
9
+ * to that version.
10
+ */
11
+ import { html } from '@webjsdev/core';
12
+ import { cn } from '../../../lib/utils.ts';
13
+ import '../../../components/dropdown-menu.ts';
14
+ import {
15
+ sidebarMenuButtonClass,
16
+ sidebarMenuClass,
17
+ sidebarMenuItemClass,
18
+ } from '../../../components/sidebar.ts';
19
+ import { CheckIcon, ChevronsUpDownIcon, GalleryVerticalEndIcon } from '../../../lib/icons.ts';
20
+
21
+ export function versionSwitcher({ versions, defaultVersion }: { versions: string[]; defaultVersion: string }) {
22
+ const selected = defaultVersion;
23
+ return html`
24
+ <ul data-slot="sidebar-menu" data-sidebar="menu" class=${sidebarMenuClass()}>
25
+ <li data-slot="sidebar-menu-item" data-sidebar="menu-item" class=${sidebarMenuItemClass()}>
26
+ <ui-dropdown-menu>
27
+ <ui-dropdown-menu-trigger>
28
+ <button type="button" data-slot="sidebar-menu-button" data-sidebar="menu-button" data-size="lg" class=${cn(sidebarMenuButtonClass({ size: 'lg' }), 'aria-expanded:bg-sidebar-accent aria-expanded:text-sidebar-accent-foreground')}>
29
+ <div class="flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground">
30
+ ${GalleryVerticalEndIcon('size-4')}
31
+ </div>
32
+ <div class="flex flex-col gap-0.5 leading-none">
33
+ <span class="font-medium">Documentation</span>
34
+ <span>v${selected}</span>
35
+ </div>
36
+ ${ChevronsUpDownIcon('ml-auto')}
37
+ </button>
38
+ </ui-dropdown-menu-trigger>
39
+ <ui-dropdown-menu-content class="w-(--radix-dropdown-menu-trigger-width)" align="start">
40
+ ${versions.map((version) => html`
41
+ <ui-dropdown-menu-item>
42
+ v${version} ${version === selected ? CheckIcon('ml-auto') : ''}
43
+ </ui-dropdown-menu-item>
44
+ `)}
45
+ </ui-dropdown-menu-content>
46
+ </ui-dropdown-menu>
47
+ </li>
48
+ </ul>
49
+ `;
50
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The sidebar-01 block's page: a docs-style sidebar with its navigation
3
+ * grouped by section, beside a header with a breadcrumb and a placeholder
4
+ * content grid.
5
+ *
6
+ * Installed by `npx @webjsdev/ui add sidebar-01` at `app/dashboard/page.ts`.
7
+ * It is app code you own, so edit it freely. Ported from shadcn/ui's
8
+ * sidebar-01.
9
+ */
10
+ import { html } from '@webjsdev/core';
11
+ import type { Metadata } from '@webjsdev/core';
12
+ import { cn } from '../../lib/utils.ts';
13
+ import {
14
+ breadcrumbItemClass,
15
+ breadcrumbLinkClass,
16
+ breadcrumbListClass,
17
+ breadcrumbPageClass,
18
+ breadcrumbSeparatorClass,
19
+ } from '../../components/breadcrumb.ts';
20
+ import { separatorClass } from '../../components/separator.ts';
21
+ import '../../components/sidebar.ts';
22
+ import { appSidebar } from './components/app-sidebar.ts';
23
+ import { ChevronRightIcon } from '../../lib/icons.ts';
24
+
25
+ export const metadata: Metadata = { title: 'Dashboard' };
26
+
27
+ export default function DashboardPage() {
28
+ return html`
29
+ <ui-sidebar-provider>
30
+ ${appSidebar()}
31
+ <ui-sidebar-inset>
32
+ <header class="flex h-16 shrink-0 items-center gap-2 border-b px-4">
33
+ <ui-sidebar-trigger class="-ml-1"></ui-sidebar-trigger>
34
+ <div role="none" data-slot="separator" data-orientation="vertical" class=${cn(separatorClass(), 'mr-2 data-vertical:h-4 data-vertical:self-auto')}></div>
35
+ <nav aria-label="breadcrumb" data-slot="breadcrumb">
36
+ <ol data-slot="breadcrumb-list" class=${breadcrumbListClass()}>
37
+ <li data-slot="breadcrumb-item" class=${cn(breadcrumbItemClass(), 'hidden md:block')}>
38
+ <a data-slot="breadcrumb-link" class=${breadcrumbLinkClass()} href="#">Build Your Application</a>
39
+ </li>
40
+ <li data-slot="breadcrumb-separator" role="presentation" aria-hidden="true" class=${cn(breadcrumbSeparatorClass(), 'hidden md:block')}>${ChevronRightIcon()}</li>
41
+ <li data-slot="breadcrumb-item" class=${breadcrumbItemClass()}>
42
+ <span data-slot="breadcrumb-page" class=${breadcrumbPageClass()} aria-current="page">Data Fetching</span>
43
+ </li>
44
+ </ol>
45
+ </nav>
46
+ </header>
47
+ <div class="flex flex-1 flex-col gap-4 p-4">
48
+ <div class="grid auto-rows-min gap-4 md:grid-cols-3">
49
+ <div class="aspect-video rounded-xl bg-muted/50"></div>
50
+ <div class="aspect-video rounded-xl bg-muted/50"></div>
51
+ <div class="aspect-video rounded-xl bg-muted/50"></div>
52
+ </div>
53
+ <div class="min-h-screen flex-1 rounded-xl bg-muted/50 md:min-h-min"></div>
54
+ </div>
55
+ </ui-sidebar-inset>
56
+ </ui-sidebar-provider>
57
+ `;
58
+ }