@nikala-ui/docs 0.12.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 (463) hide show
  1. package/README.md +22 -0
  2. package/dist/cli/commands/build.d.ts +5 -0
  3. package/dist/cli/commands/build.d.ts.map +1 -0
  4. package/dist/cli/commands/build.js +27 -0
  5. package/dist/cli/commands/build.js.map +1 -0
  6. package/dist/cli/commands/dev.d.ts +7 -0
  7. package/dist/cli/commands/dev.d.ts.map +1 -0
  8. package/dist/cli/commands/dev.js +32 -0
  9. package/dist/cli/commands/dev.js.map +1 -0
  10. package/dist/cli/commands/init.d.ts +2 -0
  11. package/dist/cli/commands/init.d.ts.map +1 -0
  12. package/dist/cli/commands/init.js +308 -0
  13. package/dist/cli/commands/init.js.map +1 -0
  14. package/dist/cli/commands/preview.d.ts +7 -0
  15. package/dist/cli/commands/preview.d.ts.map +1 -0
  16. package/dist/cli/commands/preview.js +24 -0
  17. package/dist/cli/commands/preview.js.map +1 -0
  18. package/dist/cli/commands/serve.d.ts +7 -0
  19. package/dist/cli/commands/serve.d.ts.map +1 -0
  20. package/dist/cli/commands/serve.js +33 -0
  21. package/dist/cli/commands/serve.js.map +1 -0
  22. package/dist/cli/index.d.ts +3 -0
  23. package/dist/cli/index.d.ts.map +1 -0
  24. package/dist/cli/index.js +53 -0
  25. package/dist/cli/index.js.map +1 -0
  26. package/dist/client/App.d.ts +5 -0
  27. package/dist/client/App.d.ts.map +1 -0
  28. package/dist/client/App.jsx +31 -0
  29. package/dist/client/App.jsx.map +1 -0
  30. package/dist/client/app-types.d.ts +14 -0
  31. package/dist/client/app-types.d.ts.map +1 -0
  32. package/dist/client/app-types.js +2 -0
  33. package/dist/client/app-types.js.map +1 -0
  34. package/dist/client/components/DocsLayoutShell.d.ts +21 -0
  35. package/dist/client/components/DocsLayoutShell.d.ts.map +1 -0
  36. package/dist/client/components/DocsLayoutShell.jsx +14 -0
  37. package/dist/client/components/DocsLayoutShell.jsx.map +1 -0
  38. package/dist/client/components/DocsPageContent.d.ts +9 -0
  39. package/dist/client/components/DocsPageContent.d.ts.map +1 -0
  40. package/dist/client/components/DocsPageContent.jsx +10 -0
  41. package/dist/client/components/DocsPageContent.jsx.map +1 -0
  42. package/dist/client/entry.d.ts +2 -0
  43. package/dist/client/entry.d.ts.map +1 -0
  44. package/dist/client/entry.jsx +28 -0
  45. package/dist/client/entry.jsx.map +1 -0
  46. package/dist/client/index.html +21 -0
  47. package/dist/client/navigation/page-navigation.d.ts +9 -0
  48. package/dist/client/navigation/page-navigation.d.ts.map +1 -0
  49. package/dist/client/navigation/page-navigation.js +51 -0
  50. package/dist/client/navigation/page-navigation.js.map +1 -0
  51. package/dist/client/routing/use-docs-router.d.ts +17 -0
  52. package/dist/client/routing/use-docs-router.d.ts.map +1 -0
  53. package/dist/client/routing/use-docs-router.js +71 -0
  54. package/dist/client/routing/use-docs-router.js.map +1 -0
  55. package/dist/client/ssr-entry.d.ts +3 -0
  56. package/dist/client/ssr-entry.d.ts.map +1 -0
  57. package/dist/client/ssr-entry.jsx +13 -0
  58. package/dist/client/ssr-entry.jsx.map +1 -0
  59. package/dist/client/style.css +183 -0
  60. package/dist/client/utils/sidebar.d.ts +2 -0
  61. package/dist/client/utils/sidebar.d.ts.map +1 -0
  62. package/dist/client/utils/sidebar.js +2 -0
  63. package/dist/client/utils/sidebar.js.map +1 -0
  64. package/dist/components/mdx-components.d.ts +34 -0
  65. package/dist/components/mdx-components.d.ts.map +1 -0
  66. package/dist/components/mdx-components.jsx +131 -0
  67. package/dist/components/mdx-components.jsx.map +1 -0
  68. package/dist/config.d.ts +6 -0
  69. package/dist/config.d.ts.map +1 -0
  70. package/dist/config.js +105 -0
  71. package/dist/config.js.map +1 -0
  72. package/dist/core/content-scanner.d.ts +10 -0
  73. package/dist/core/content-scanner.d.ts.map +1 -0
  74. package/dist/core/content-scanner.js +153 -0
  75. package/dist/core/content-scanner.js.map +1 -0
  76. package/dist/core/route-tree.d.ts +19 -0
  77. package/dist/core/route-tree.d.ts.map +1 -0
  78. package/dist/core/route-tree.js +176 -0
  79. package/dist/core/route-tree.js.map +1 -0
  80. package/dist/index.d.ts +13 -0
  81. package/dist/index.d.ts.map +1 -0
  82. package/dist/index.js +14 -0
  83. package/dist/index.js.map +1 -0
  84. package/dist/lib/cn.d.ts +6 -0
  85. package/dist/lib/cn.d.ts.map +1 -0
  86. package/dist/lib/cn.js +9 -0
  87. package/dist/lib/cn.js.map +1 -0
  88. package/dist/mdx/compiler.d.ts +13 -0
  89. package/dist/mdx/compiler.d.ts.map +1 -0
  90. package/dist/mdx/compiler.js +38 -0
  91. package/dist/mdx/compiler.js.map +1 -0
  92. package/dist/mdx/highlighter.d.ts +22 -0
  93. package/dist/mdx/highlighter.d.ts.map +1 -0
  94. package/dist/mdx/highlighter.js +139 -0
  95. package/dist/mdx/highlighter.js.map +1 -0
  96. package/dist/mdx/rehype-shiki.d.ts +3 -0
  97. package/dist/mdx/rehype-shiki.d.ts.map +1 -0
  98. package/dist/mdx/rehype-shiki.js +83 -0
  99. package/dist/mdx/rehype-shiki.js.map +1 -0
  100. package/dist/navigation/index.d.ts +2 -0
  101. package/dist/navigation/index.d.ts.map +1 -0
  102. package/dist/navigation/index.js +2 -0
  103. package/dist/navigation/index.js.map +1 -0
  104. package/dist/navigation/sidebar-state.d.ts +6 -0
  105. package/dist/navigation/sidebar-state.d.ts.map +1 -0
  106. package/dist/navigation/sidebar-state.js +20 -0
  107. package/dist/navigation/sidebar-state.js.map +1 -0
  108. package/dist/navigation/sidebar-tree.d.ts +7 -0
  109. package/dist/navigation/sidebar-tree.d.ts.map +1 -0
  110. package/dist/navigation/sidebar-tree.js +11 -0
  111. package/dist/navigation/sidebar-tree.js.map +1 -0
  112. package/dist/registry/accordion.json +18 -0
  113. package/dist/registry/alert.json +18 -0
  114. package/dist/registry/api-table.json +21 -0
  115. package/dist/registry/aspect-ratio.json +17 -0
  116. package/dist/registry/avatar.json +17 -0
  117. package/dist/registry/badge.json +18 -0
  118. package/dist/registry/banner.json +19 -0
  119. package/dist/registry/breadcrumb.json +17 -0
  120. package/dist/registry/bubble.json +18 -0
  121. package/dist/registry/button-group.json +20 -0
  122. package/dist/registry/button.json +21 -0
  123. package/dist/registry/callout.json +19 -0
  124. package/dist/registry/card.json +17 -0
  125. package/dist/registry/checkbox.json +20 -0
  126. package/dist/registry/code-block.json +26 -0
  127. package/dist/registry/code-group.json +20 -0
  128. package/dist/registry/collapsible.json +18 -0
  129. package/dist/registry/combobox.json +21 -0
  130. package/dist/registry/command.json +27 -0
  131. package/dist/registry/component-viewer.json +25 -0
  132. package/dist/registry/container.json +18 -0
  133. package/dist/registry/context-menu.json +24 -0
  134. package/dist/registry/create-active-element.json +13 -0
  135. package/dist/registry/create-app-updater.json +13 -0
  136. package/dist/registry/create-audio.json +7 -0
  137. package/dist/registry/create-battery.json +13 -0
  138. package/dist/registry/create-chat-scroll.json +13 -0
  139. package/dist/registry/create-click-outside.json +13 -0
  140. package/dist/registry/create-clipboard.json +13 -0
  141. package/dist/registry/create-color-mode.json +13 -0
  142. package/dist/registry/create-controllable-signal.json +13 -0
  143. package/dist/registry/create-debounce.json +13 -0
  144. package/dist/registry/create-disclosure.json +13 -0
  145. package/dist/registry/create-document-tabs.json +13 -0
  146. package/dist/registry/create-document-title.json +13 -0
  147. package/dist/registry/create-drop-zone.json +13 -0
  148. package/dist/registry/create-event-source.json +13 -0
  149. package/dist/registry/create-favicon.json +13 -0
  150. package/dist/registry/create-fetch.json +13 -0
  151. package/dist/registry/create-focus-trap.json +13 -0
  152. package/dist/registry/create-form.json +13 -0
  153. package/dist/registry/create-fullscreen.json +13 -0
  154. package/dist/registry/create-geolocation.json +13 -0
  155. package/dist/registry/create-global-shortcut.json +13 -0
  156. package/dist/registry/create-hover.json +13 -0
  157. package/dist/registry/create-idle.json +13 -0
  158. package/dist/registry/create-infinite-scroll.json +13 -0
  159. package/dist/registry/create-input-mask.json +13 -0
  160. package/dist/registry/create-intersection-observer.json +13 -0
  161. package/dist/registry/create-keybindings.json +13 -0
  162. package/dist/registry/create-lock-scroll.json +13 -0
  163. package/dist/registry/create-long-press.json +13 -0
  164. package/dist/registry/create-media-query.json +13 -0
  165. package/dist/registry/create-mouse-position.json +13 -0
  166. package/dist/registry/create-network-status.json +13 -0
  167. package/dist/registry/create-orientation.json +13 -0
  168. package/dist/registry/create-pagination.json +13 -0
  169. package/dist/registry/create-permission.json +13 -0
  170. package/dist/registry/create-previous.json +13 -0
  171. package/dist/registry/create-resize-observer.json +13 -0
  172. package/dist/registry/create-scroll-into-view.json +13 -0
  173. package/dist/registry/create-scroll-position.json +13 -0
  174. package/dist/registry/create-storage.json +13 -0
  175. package/dist/registry/create-tauri-window.json +13 -0
  176. package/dist/registry/create-timer.json +13 -0
  177. package/dist/registry/create-tiptap-editor.json +34 -0
  178. package/dist/registry/create-undo-redo.json +13 -0
  179. package/dist/registry/create-web-notification.json +13 -0
  180. package/dist/registry/create-websocket.json +13 -0
  181. package/dist/registry/create-window-size.json +13 -0
  182. package/dist/registry/dialog.json +21 -0
  183. package/dist/registry/dropdown-menu.json +22 -0
  184. package/dist/registry/dropzone.json +21 -0
  185. package/dist/registry/empty.json +17 -0
  186. package/dist/registry/field.json +20 -0
  187. package/dist/registry/file-tree.json +21 -0
  188. package/dist/registry/footer.json +18 -0
  189. package/dist/registry/forgot-password-01.json +28 -0
  190. package/dist/registry/form-message.json +17 -0
  191. package/dist/registry/form.json +17 -0
  192. package/dist/registry/hero-01.json +22 -0
  193. package/dist/registry/hover-card.json +18 -0
  194. package/dist/registry/icon-button.json +20 -0
  195. package/dist/registry/index.json +1489 -0
  196. package/dist/registry/input-group.json +21 -0
  197. package/dist/registry/input.json +17 -0
  198. package/dist/registry/kbd.json +18 -0
  199. package/dist/registry/label.json +18 -0
  200. package/dist/registry/list.json +20 -0
  201. package/dist/registry/login-01.json +28 -0
  202. package/dist/registry/logo.json +17 -0
  203. package/dist/registry/marker.json +17 -0
  204. package/dist/registry/marquee.json +17 -0
  205. package/dist/registry/message.json +17 -0
  206. package/dist/registry/navbar.json +19 -0
  207. package/dist/registry/navigation-menu.json +22 -0
  208. package/dist/registry/number-input.json +24 -0
  209. package/dist/registry/otp-verification-01.json +26 -0
  210. package/dist/registry/package-manager-tabs.json +24 -0
  211. package/dist/registry/pager.json +21 -0
  212. package/dist/registry/pagination.json +22 -0
  213. package/dist/registry/pin-input.json +17 -0
  214. package/dist/registry/popover.json +22 -0
  215. package/dist/registry/progress.json +18 -0
  216. package/dist/registry/radio-group.json +18 -0
  217. package/dist/registry/rating.json +19 -0
  218. package/dist/registry/register-01.json +31 -0
  219. package/dist/registry/resizable.json +21 -0
  220. package/dist/registry/review-card.json +23 -0
  221. package/dist/registry/rich-text-editor.json +95 -0
  222. package/dist/registry/scroll-area.json +21 -0
  223. package/dist/registry/section-heading.json +21 -0
  224. package/dist/registry/select.json +22 -0
  225. package/dist/registry/separator.json +17 -0
  226. package/dist/registry/sheet.json +22 -0
  227. package/dist/registry/sidebar.json +24 -0
  228. package/dist/registry/skeleton.json +17 -0
  229. package/dist/registry/slider.json +18 -0
  230. package/dist/registry/spinner.json +18 -0
  231. package/dist/registry/stat.json +19 -0
  232. package/dist/registry/status.json +18 -0
  233. package/dist/registry/steps.json +20 -0
  234. package/dist/registry/switch.json +20 -0
  235. package/dist/registry/table-of-contents.json +23 -0
  236. package/dist/registry/table.json +17 -0
  237. package/dist/registry/tabs.json +20 -0
  238. package/dist/registry/textarea.json +17 -0
  239. package/dist/registry/theme-manager.json +39 -0
  240. package/dist/registry/timeline.json +18 -0
  241. package/dist/registry/titlebar-tabs.json +24 -0
  242. package/dist/registry/titlebar.json +26 -0
  243. package/dist/registry/toast.json +20 -0
  244. package/dist/registry/toggle-group.json +21 -0
  245. package/dist/registry/toggle.json +18 -0
  246. package/dist/registry/tooltip.json +18 -0
  247. package/dist/registry/updater-modal.json +26 -0
  248. package/dist/server/index.d.ts +18 -0
  249. package/dist/server/index.d.ts.map +1 -0
  250. package/dist/server/index.js +526 -0
  251. package/dist/server/index.js.map +1 -0
  252. package/dist/server/plugin.d.ts +10 -0
  253. package/dist/server/plugin.d.ts.map +1 -0
  254. package/dist/server/plugin.js +271 -0
  255. package/dist/server/plugin.js.map +1 -0
  256. package/dist/themes/default/content/breadcrumbs.d.ts +4 -0
  257. package/dist/themes/default/content/breadcrumbs.d.ts.map +1 -0
  258. package/dist/themes/default/content/breadcrumbs.jsx +31 -0
  259. package/dist/themes/default/content/breadcrumbs.jsx.map +1 -0
  260. package/dist/themes/default/content/pager.d.ts +5 -0
  261. package/dist/themes/default/content/pager.d.ts.map +1 -0
  262. package/dist/themes/default/content/pager.jsx +9 -0
  263. package/dist/themes/default/content/pager.jsx.map +1 -0
  264. package/dist/themes/default/content/table-of-contents.d.ts +4 -0
  265. package/dist/themes/default/content/table-of-contents.d.ts.map +1 -0
  266. package/dist/themes/default/content/table-of-contents.jsx +19 -0
  267. package/dist/themes/default/content/table-of-contents.jsx.map +1 -0
  268. package/dist/themes/default/index.d.ts +11 -0
  269. package/dist/themes/default/index.d.ts.map +1 -0
  270. package/dist/themes/default/index.js +30 -0
  271. package/dist/themes/default/index.js.map +1 -0
  272. package/dist/themes/default/layout.d.ts +4 -0
  273. package/dist/themes/default/layout.d.ts.map +1 -0
  274. package/dist/themes/default/layout.jsx +75 -0
  275. package/dist/themes/default/layout.jsx.map +1 -0
  276. package/dist/themes/default/navbar.d.ts +4 -0
  277. package/dist/themes/default/navbar.d.ts.map +1 -0
  278. package/dist/themes/default/navbar.jsx +74 -0
  279. package/dist/themes/default/navbar.jsx.map +1 -0
  280. package/dist/themes/default/navigation/mobile-table-of-contents.d.ts +4 -0
  281. package/dist/themes/default/navigation/mobile-table-of-contents.d.ts.map +1 -0
  282. package/dist/themes/default/navigation/mobile-table-of-contents.jsx +22 -0
  283. package/dist/themes/default/navigation/mobile-table-of-contents.jsx.map +1 -0
  284. package/dist/themes/default/navigation/sidebar-tree.d.ts +8 -0
  285. package/dist/themes/default/navigation/sidebar-tree.d.ts.map +1 -0
  286. package/dist/themes/default/navigation/sidebar-tree.jsx +100 -0
  287. package/dist/themes/default/navigation/sidebar-tree.jsx.map +1 -0
  288. package/dist/themes/default/overlays/search-dialog.d.ts +4 -0
  289. package/dist/themes/default/overlays/search-dialog.d.ts.map +1 -0
  290. package/dist/themes/default/overlays/search-dialog.jsx +34 -0
  291. package/dist/themes/default/overlays/search-dialog.jsx.map +1 -0
  292. package/dist/themes/default/sidebar.d.ts +4 -0
  293. package/dist/themes/default/sidebar.d.ts.map +1 -0
  294. package/dist/themes/default/sidebar.jsx +60 -0
  295. package/dist/themes/default/sidebar.jsx.map +1 -0
  296. package/dist/themes/index.d.ts +4 -0
  297. package/dist/themes/index.d.ts.map +1 -0
  298. package/dist/themes/index.js +5 -0
  299. package/dist/themes/index.js.map +1 -0
  300. package/dist/themes/types.d.ts +83 -0
  301. package/dist/themes/types.d.ts.map +1 -0
  302. package/dist/themes/types.js +2 -0
  303. package/dist/themes/types.js.map +1 -0
  304. package/dist/types.d.ts +97 -0
  305. package/dist/types.d.ts.map +1 -0
  306. package/dist/types.js +3 -0
  307. package/dist/types.js.map +1 -0
  308. package/dist/vendor/core-src/index.css +11 -0
  309. package/dist/vendor/core-src/index.ts +48 -0
  310. package/dist/vendor/core-src/lib/cn.ts +9 -0
  311. package/dist/vendor/core-src/registry/blocks/forgot-password-01.tsx +141 -0
  312. package/dist/vendor/core-src/registry/blocks/hero-01.tsx +28 -0
  313. package/dist/vendor/core-src/registry/blocks/login-01.tsx +231 -0
  314. package/dist/vendor/core-src/registry/blocks/otp-verification-01.tsx +170 -0
  315. package/dist/vendor/core-src/registry/blocks/register-01.tsx +318 -0
  316. package/dist/vendor/core-src/registry/components/ui/accordion.tsx +128 -0
  317. package/dist/vendor/core-src/registry/components/ui/alert.tsx +155 -0
  318. package/dist/vendor/core-src/registry/components/ui/api-table.tsx +117 -0
  319. package/dist/vendor/core-src/registry/components/ui/aspect-ratio.tsx +31 -0
  320. package/dist/vendor/core-src/registry/components/ui/avatar.tsx +114 -0
  321. package/dist/vendor/core-src/registry/components/ui/badge.tsx +56 -0
  322. package/dist/vendor/core-src/registry/components/ui/banner.tsx +187 -0
  323. package/dist/vendor/core-src/registry/components/ui/breadcrumb.tsx +136 -0
  324. package/dist/vendor/core-src/registry/components/ui/bubble.tsx +142 -0
  325. package/dist/vendor/core-src/registry/components/ui/button-group.tsx +42 -0
  326. package/dist/vendor/core-src/registry/components/ui/button.tsx +82 -0
  327. package/dist/vendor/core-src/registry/components/ui/callout.tsx +137 -0
  328. package/dist/vendor/core-src/registry/components/ui/card.tsx +113 -0
  329. package/dist/vendor/core-src/registry/components/ui/checkbox.tsx +74 -0
  330. package/dist/vendor/core-src/registry/components/ui/code-block.tsx +326 -0
  331. package/dist/vendor/core-src/registry/components/ui/code-group.tsx +105 -0
  332. package/dist/vendor/core-src/registry/components/ui/collapsible.tsx +73 -0
  333. package/dist/vendor/core-src/registry/components/ui/combobox.tsx +299 -0
  334. package/dist/vendor/core-src/registry/components/ui/command.tsx +378 -0
  335. package/dist/vendor/core-src/registry/components/ui/component-viewer.tsx +363 -0
  336. package/dist/vendor/core-src/registry/components/ui/container.tsx +45 -0
  337. package/dist/vendor/core-src/registry/components/ui/context-menu.tsx +237 -0
  338. package/dist/vendor/core-src/registry/components/ui/dialog.tsx +200 -0
  339. package/dist/vendor/core-src/registry/components/ui/dropdown-menu.tsx +298 -0
  340. package/dist/vendor/core-src/registry/components/ui/dropzone.tsx +189 -0
  341. package/dist/vendor/core-src/registry/components/ui/empty.tsx +83 -0
  342. package/dist/vendor/core-src/registry/components/ui/field.tsx +71 -0
  343. package/dist/vendor/core-src/registry/components/ui/file-tree.tsx +181 -0
  344. package/dist/vendor/core-src/registry/components/ui/footer.tsx +247 -0
  345. package/dist/vendor/core-src/registry/components/ui/form-message.tsx +36 -0
  346. package/dist/vendor/core-src/registry/components/ui/form.tsx +21 -0
  347. package/dist/vendor/core-src/registry/components/ui/hover-card.tsx +105 -0
  348. package/dist/vendor/core-src/registry/components/ui/icon-button.tsx +34 -0
  349. package/dist/vendor/core-src/registry/components/ui/input-group.tsx +80 -0
  350. package/dist/vendor/core-src/registry/components/ui/input.tsx +28 -0
  351. package/dist/vendor/core-src/registry/components/ui/kbd.tsx +73 -0
  352. package/dist/vendor/core-src/registry/components/ui/label.tsx +30 -0
  353. package/dist/vendor/core-src/registry/components/ui/list.tsx +222 -0
  354. package/dist/vendor/core-src/registry/components/ui/logo.tsx +68 -0
  355. package/dist/vendor/core-src/registry/components/ui/marker.tsx +102 -0
  356. package/dist/vendor/core-src/registry/components/ui/marquee.tsx +118 -0
  357. package/dist/vendor/core-src/registry/components/ui/message.tsx +168 -0
  358. package/dist/vendor/core-src/registry/components/ui/navbar.tsx +375 -0
  359. package/dist/vendor/core-src/registry/components/ui/navigation-menu.tsx +358 -0
  360. package/dist/vendor/core-src/registry/components/ui/number-input.tsx +150 -0
  361. package/dist/vendor/core-src/registry/components/ui/package-manager-tabs.tsx +226 -0
  362. package/dist/vendor/core-src/registry/components/ui/pager.tsx +102 -0
  363. package/dist/vendor/core-src/registry/components/ui/pagination.tsx +258 -0
  364. package/dist/vendor/core-src/registry/components/ui/pin-input.tsx +198 -0
  365. package/dist/vendor/core-src/registry/components/ui/popover.tsx +90 -0
  366. package/dist/vendor/core-src/registry/components/ui/progress.tsx +66 -0
  367. package/dist/vendor/core-src/registry/components/ui/radio-group.tsx +95 -0
  368. package/dist/vendor/core-src/registry/components/ui/rating.tsx +185 -0
  369. package/dist/vendor/core-src/registry/components/ui/resizable.tsx +195 -0
  370. package/dist/vendor/core-src/registry/components/ui/review-card.tsx +195 -0
  371. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/bubble-menu.tsx +236 -0
  372. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/editor.tsx +308 -0
  373. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/extensions.ts +116 -0
  374. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/footer.tsx +36 -0
  375. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/image-dialog.tsx +75 -0
  376. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/index.ts +11 -0
  377. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/link-dialog.tsx +48 -0
  378. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/markdown.ts +170 -0
  379. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/slash-command.tsx +301 -0
  380. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/table-controls.tsx +68 -0
  381. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/toolbar.tsx +465 -0
  382. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/use-editor.ts +231 -0
  383. package/dist/vendor/core-src/registry/components/ui/scroll-area.tsx +228 -0
  384. package/dist/vendor/core-src/registry/components/ui/section-heading.tsx +108 -0
  385. package/dist/vendor/core-src/registry/components/ui/select.tsx +156 -0
  386. package/dist/vendor/core-src/registry/components/ui/separator.tsx +37 -0
  387. package/dist/vendor/core-src/registry/components/ui/sheet.tsx +220 -0
  388. package/dist/vendor/core-src/registry/components/ui/sidebar.tsx +692 -0
  389. package/dist/vendor/core-src/registry/components/ui/skeleton.tsx +24 -0
  390. package/dist/vendor/core-src/registry/components/ui/slider.tsx +153 -0
  391. package/dist/vendor/core-src/registry/components/ui/spinner.tsx +41 -0
  392. package/dist/vendor/core-src/registry/components/ui/stat.tsx +245 -0
  393. package/dist/vendor/core-src/registry/components/ui/status.tsx +121 -0
  394. package/dist/vendor/core-src/registry/components/ui/steps.tsx +198 -0
  395. package/dist/vendor/core-src/registry/components/ui/switch.tsx +68 -0
  396. package/dist/vendor/core-src/registry/components/ui/table-of-contents.tsx +131 -0
  397. package/dist/vendor/core-src/registry/components/ui/table.tsx +160 -0
  398. package/dist/vendor/core-src/registry/components/ui/tabs.tsx +204 -0
  399. package/dist/vendor/core-src/registry/components/ui/textarea.tsx +82 -0
  400. package/dist/vendor/core-src/registry/components/ui/theme-toggle.tsx +238 -0
  401. package/dist/vendor/core-src/registry/components/ui/timeline.tsx +350 -0
  402. package/dist/vendor/core-src/registry/components/ui/titlebar-tabs.tsx +773 -0
  403. package/dist/vendor/core-src/registry/components/ui/titlebar.tsx +468 -0
  404. package/dist/vendor/core-src/registry/components/ui/toast.tsx +124 -0
  405. package/dist/vendor/core-src/registry/components/ui/toggle-group.tsx +203 -0
  406. package/dist/vendor/core-src/registry/components/ui/toggle.tsx +101 -0
  407. package/dist/vendor/core-src/registry/components/ui/tooltip.tsx +41 -0
  408. package/dist/vendor/core-src/registry/components/ui/updater-modal.tsx +254 -0
  409. package/dist/vendor/core-src/registry/index.ts +50 -0
  410. package/dist/vendor/core-src/registry/metadata.ts +742 -0
  411. package/dist/vendor/core-src/registry/providers/theme-provider.tsx +216 -0
  412. package/dist/vendor/core-src/registry/providers/theme-script.tsx +78 -0
  413. package/dist/vendor/core-src/registry/providers/theme-transitions.ts +139 -0
  414. package/dist/vendor/hooks-src/create-active-element.ts +51 -0
  415. package/dist/vendor/hooks-src/create-app-updater.ts +272 -0
  416. package/dist/vendor/hooks-src/create-audio-video.ts +444 -0
  417. package/dist/vendor/hooks-src/create-battery.ts +78 -0
  418. package/dist/vendor/hooks-src/create-chat-scroll.ts +113 -0
  419. package/dist/vendor/hooks-src/create-click-outside.ts +82 -0
  420. package/dist/vendor/hooks-src/create-clipboard.ts +69 -0
  421. package/dist/vendor/hooks-src/create-color-mode.ts +115 -0
  422. package/dist/vendor/hooks-src/create-controllable-signal.ts +56 -0
  423. package/dist/vendor/hooks-src/create-debounce.ts +90 -0
  424. package/dist/vendor/hooks-src/create-disclosure.ts +82 -0
  425. package/dist/vendor/hooks-src/create-document-tabs.ts +267 -0
  426. package/dist/vendor/hooks-src/create-document-title.ts +33 -0
  427. package/dist/vendor/hooks-src/create-drop-zone.ts +317 -0
  428. package/dist/vendor/hooks-src/create-event-source.ts +126 -0
  429. package/dist/vendor/hooks-src/create-favicon.ts +52 -0
  430. package/dist/vendor/hooks-src/create-fetch.ts +93 -0
  431. package/dist/vendor/hooks-src/create-focus-trap.ts +94 -0
  432. package/dist/vendor/hooks-src/create-form.ts +200 -0
  433. package/dist/vendor/hooks-src/create-fullscreen.ts +105 -0
  434. package/dist/vendor/hooks-src/create-geolocation.ts +140 -0
  435. package/dist/vendor/hooks-src/create-global-shortcut.ts +140 -0
  436. package/dist/vendor/hooks-src/create-hover.ts +88 -0
  437. package/dist/vendor/hooks-src/create-idle.ts +109 -0
  438. package/dist/vendor/hooks-src/create-infinite-scroll.ts +90 -0
  439. package/dist/vendor/hooks-src/create-input-mask.ts +109 -0
  440. package/dist/vendor/hooks-src/create-intersection-observer.ts +82 -0
  441. package/dist/vendor/hooks-src/create-keybindings.ts +148 -0
  442. package/dist/vendor/hooks-src/create-lock-scroll.ts +97 -0
  443. package/dist/vendor/hooks-src/create-long-press.ts +85 -0
  444. package/dist/vendor/hooks-src/create-media-query.ts +94 -0
  445. package/dist/vendor/hooks-src/create-mouse-position.ts +87 -0
  446. package/dist/vendor/hooks-src/create-network-status.ts +100 -0
  447. package/dist/vendor/hooks-src/create-orientation.ts +129 -0
  448. package/dist/vendor/hooks-src/create-pagination.ts +208 -0
  449. package/dist/vendor/hooks-src/create-permission.ts +91 -0
  450. package/dist/vendor/hooks-src/create-previous.ts +21 -0
  451. package/dist/vendor/hooks-src/create-resize-observer.ts +89 -0
  452. package/dist/vendor/hooks-src/create-scroll-into-view.ts +57 -0
  453. package/dist/vendor/hooks-src/create-scroll-position.ts +129 -0
  454. package/dist/vendor/hooks-src/create-storage.ts +106 -0
  455. package/dist/vendor/hooks-src/create-tauri-window.ts +628 -0
  456. package/dist/vendor/hooks-src/create-timer.ts +150 -0
  457. package/dist/vendor/hooks-src/create-tiptap-editor.ts +326 -0
  458. package/dist/vendor/hooks-src/create-undo-redo.ts +100 -0
  459. package/dist/vendor/hooks-src/create-web-notification.ts +111 -0
  460. package/dist/vendor/hooks-src/create-websocket.ts +179 -0
  461. package/dist/vendor/hooks-src/create-window-size.ts +41 -0
  462. package/dist/vendor/hooks-src/index.ts +48 -0
  463. package/package.json +87 -0
@@ -0,0 +1,299 @@
1
+ import { splitProps, type JSX, type ValidComponent } from "solid-js";
2
+ import { Check, ChevronDown, X } from "lucide-solid";
3
+ import { ScrollArea } from "@/components/ui/scroll-area";
4
+ import * as ComboboxPrimitive from "@kobalte/core/combobox";
5
+ import { cn } from "@/lib/cn";
6
+
7
+ export type ComboboxRootProps<Option = any, OptGroup = any, T extends ValidComponent = "div"> =
8
+ ComboboxPrimitive.ComboboxRootProps<Option, OptGroup, T> & {
9
+ class?: string;
10
+ children?: JSX.Element;
11
+ triggerMode?: "input" | "focus" | "both" | "manual";
12
+ };
13
+
14
+ /**
15
+ * Root Combobox component providing search, single/multi-selection, and group support.
16
+ * `triggerMode="focus"` or `triggerMode="both"` enables opening dropdown on input click/focus.
17
+ */
18
+ export const Combobox = <Option = any, OptGroup = any, T extends ValidComponent = "div">(
19
+ props: ComboboxRootProps<Option, OptGroup, T>
20
+ ) => {
21
+ const [local, rest] = splitProps(props as ComboboxRootProps, ["class", "children", "triggerMode"]);
22
+
23
+ return (
24
+ <ComboboxPrimitive.Root
25
+ triggerMode={local.triggerMode ?? "input"}
26
+ class={cn("relative w-full", local.class)}
27
+ {...(rest as any)}
28
+ >
29
+ {local.children}
30
+ </ComboboxPrimitive.Root>
31
+ );
32
+ };
33
+
34
+ export type ComboboxControlProps<Option = any, T extends ValidComponent = "div"> =
35
+ ComboboxPrimitive.ComboboxControlProps<Option, T> & {
36
+ class?: string;
37
+ children?: JSX.Element;
38
+ clearable?: boolean;
39
+ onClear?: () => void;
40
+ };
41
+
42
+ /**
43
+ * Input container for Combobox supporting search input, selected tags, and clear button.
44
+ */
45
+ export const ComboboxControl = <Option = any, T extends ValidComponent = "div">(
46
+ props: ComboboxControlProps<Option, T>
47
+ ) => {
48
+ const [local, rest] = splitProps(props as ComboboxControlProps, [
49
+ "class",
50
+ "children",
51
+ "clearable",
52
+ "onClear",
53
+ ]);
54
+
55
+ return (
56
+ <ComboboxPrimitive.Control
57
+ class={cn(
58
+ "flex min-h-9 w-full flex-wrap items-center justify-between rounded-md border border-input bg-muted px-3 py-1 text-sm shadow-sm transition-colors focus-within:ring-1 focus-within:ring-primary focus-within:border-primary disabled:cursor-not-allowed disabled:opacity-50 gap-1.5 text-foreground",
59
+ local.class
60
+ )}
61
+ {...(rest as any)}
62
+ >
63
+ <div class="flex flex-wrap items-center gap-1.5 flex-1 min-w-0">
64
+ {local.children}
65
+ </div>
66
+
67
+ <div class="flex items-center gap-1 shrink-0 self-center">
68
+ {local.clearable && (
69
+ <button
70
+ type="button"
71
+ tabIndex={-1}
72
+ onClick={(e) => {
73
+ e.stopPropagation();
74
+ if (local.onClear) local.onClear();
75
+ }}
76
+ class="rounded-sm p-0.5 opacity-60 hover:opacity-100 hover:bg-accent text-foreground transition-opacity focus:outline-none cursor-pointer"
77
+ aria-label="Clear selection"
78
+ >
79
+ <svg class="h-3.5 w-3.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
80
+ <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
81
+ </svg>
82
+ </button>
83
+ )}
84
+ <ComboboxTrigger />
85
+ </div>
86
+ </ComboboxPrimitive.Control>
87
+ );
88
+ };
89
+
90
+ export type ComboboxInputProps<T extends ValidComponent = "input"> =
91
+ ComboboxPrimitive.ComboboxInputProps<T> & {
92
+ class?: string;
93
+ openOnFocus?: boolean;
94
+ };
95
+
96
+ /**
97
+ * Search input field embedded within ComboboxControl.
98
+ * Supports `openOnFocus` to automatically trigger the dropdown when focused or clicked.
99
+ */
100
+ export const ComboboxInput = <T extends ValidComponent = "input">(
101
+ props: ComboboxInputProps<T>
102
+ ) => {
103
+ const [local, rest] = splitProps(props as ComboboxInputProps, ["class", "openOnFocus", "onFocus", "onClick"]);
104
+
105
+ return (
106
+ <ComboboxPrimitive.Input
107
+ class={cn(
108
+ "flex-1 bg-transparent py-1 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed text-foreground min-w-16",
109
+ local.class
110
+ )}
111
+ onFocus={(e: FocusEvent) => {
112
+ if (typeof local.onFocus === "function") local.onFocus(e as any);
113
+ }}
114
+ onClick={(e: MouseEvent) => {
115
+ if (typeof local.onClick === "function") local.onClick(e as any);
116
+ }}
117
+ {...(rest as any)}
118
+ />
119
+ );
120
+ };
121
+
122
+ export type ComboboxTriggerProps<T extends ValidComponent = "button"> =
123
+ ComboboxPrimitive.ComboboxTriggerProps<T> & {
124
+ class?: string;
125
+ };
126
+
127
+ /**
128
+ * Dropdown chevron trigger icon.
129
+ */
130
+ export const ComboboxTrigger = <T extends ValidComponent = "button">(
131
+ props: ComboboxTriggerProps<T>
132
+ ) => {
133
+ const [local, rest] = splitProps(props as ComboboxTriggerProps, ["class"]);
134
+
135
+ return (
136
+ <ComboboxPrimitive.Trigger
137
+ class={cn(
138
+ "flex h-4 w-4 items-center justify-center opacity-50 hover:opacity-100 transition-opacity focus:outline-none cursor-pointer",
139
+ local.class
140
+ )}
141
+ {...(rest as any)}
142
+ >
143
+ <ComboboxPrimitive.Icon
144
+ as="svg"
145
+ class="h-4 w-4 stroke-current stroke-2 fill-none"
146
+ viewBox="0 0 24 24"
147
+ >
148
+ <path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7" />
149
+ </ComboboxPrimitive.Icon>
150
+ </ComboboxPrimitive.Trigger>
151
+ );
152
+ };
153
+
154
+ export type ComboboxTokenProps<Option = any> = {
155
+ class?: string;
156
+ children?: JSX.Element;
157
+ item?: Option;
158
+ onRemove?: () => void;
159
+ };
160
+
161
+ /**
162
+ * Selected item tag token pill rendered in multi-select mode.
163
+ */
164
+ export const ComboboxToken = <Option = any>(props: ComboboxTokenProps<Option>) => {
165
+ const [local, rest] = splitProps(props, ["class", "children", "onRemove"]);
166
+
167
+ return (
168
+ <span
169
+ class={cn(
170
+ "inline-flex items-center gap-1.5 rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-accent-foreground border border-border shadow-2xs animate-in fade-in-50",
171
+ local.class
172
+ )}
173
+ {...rest}
174
+ >
175
+ <span class="truncate">{local.children}</span>
176
+ <button
177
+ type="button"
178
+ tabIndex={-1}
179
+ onClick={(e) => {
180
+ e.stopPropagation();
181
+ if (local.onRemove) local.onRemove();
182
+ }}
183
+ class="rounded-xs p-0.5 hover:bg-muted-foreground/20 text-muted-foreground hover:text-foreground transition-colors focus:outline-none cursor-pointer"
184
+ aria-label="Remove tag"
185
+ >
186
+ <svg class="h-3 w-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
187
+ <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
188
+ </svg>
189
+ </button>
190
+ </span>
191
+ );
192
+ };
193
+
194
+ export type ComboboxContentProps<T extends ValidComponent = "div"> =
195
+ ComboboxPrimitive.ComboboxContentProps<T> & {
196
+ class?: string;
197
+ };
198
+
199
+ /**
200
+ * Portaled popover content listbox container.
201
+ */
202
+ export const ComboboxContent = <T extends ValidComponent = "div">(
203
+ props: ComboboxContentProps<T>
204
+ ) => {
205
+ const [local, rest] = splitProps(props as ComboboxContentProps, ["class"]);
206
+
207
+ return (
208
+ <ComboboxPrimitive.Portal>
209
+ <ComboboxPrimitive.Content
210
+ class={cn(
211
+ "relative z-50 min-w-8rem overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md animate-in fade-in-80 data-expanded:animate-in data-closed:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0 data-closed:zoom-out-95 data-expanded:zoom-in-95 max-h-60",
212
+ local.class
213
+ )}
214
+ {...(rest as any)}
215
+ >
216
+ <ScrollArea class="max-h-60 w-full">
217
+ <ComboboxPrimitive.Listbox class="p-1 outline-none" />
218
+ </ScrollArea>
219
+ </ComboboxPrimitive.Content>
220
+ </ComboboxPrimitive.Portal>
221
+ );
222
+ };
223
+
224
+ export type ComboboxItemProps<T extends ValidComponent = "li"> =
225
+ ComboboxPrimitive.ComboboxItemProps<T> & {
226
+ class?: string;
227
+ children?: JSX.Element;
228
+ };
229
+
230
+ /**
231
+ * Individual option item inside listbox supporting custom avatars, icons, and titles.
232
+ */
233
+ export const ComboboxItem = <T extends ValidComponent = "li">(
234
+ props: ComboboxItemProps<T>
235
+ ) => {
236
+ const [local, rest] = splitProps(props as ComboboxItemProps, ["class", "children"]);
237
+
238
+ return (
239
+ <ComboboxPrimitive.Item
240
+ class={cn(
241
+ "relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-accent data-highlighted:text-accent-foreground text-popover-foreground transition-colors",
242
+ local.class
243
+ )}
244
+ {...rest}
245
+ >
246
+ <ComboboxPrimitive.ItemIndicator class="absolute left-2 flex h-4 w-4 items-center justify-center text-primary">
247
+ <svg class="h-4 w-4 fill-none stroke-current stroke-2" viewBox="0 0 24 24">
248
+ <path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
249
+ </svg>
250
+ </ComboboxPrimitive.ItemIndicator>
251
+ <ComboboxPrimitive.ItemLabel class="flex items-center gap-2 w-full truncate">
252
+ {local.children}
253
+ </ComboboxPrimitive.ItemLabel>
254
+ </ComboboxPrimitive.Item>
255
+ );
256
+ };
257
+
258
+ export type ComboboxGroupProps<T extends ValidComponent = "li"> =
259
+ ComboboxPrimitive.ComboboxSectionProps<T> & {
260
+ class?: string;
261
+ children?: JSX.Element;
262
+ label?: JSX.Element;
263
+ };
264
+
265
+ /**
266
+ * Group container for organizing related options.
267
+ */
268
+ export const ComboboxGroup = <T extends ValidComponent = "li">(
269
+ props: ComboboxGroupProps<T>
270
+ ) => {
271
+ const [local, rest] = splitProps(props as ComboboxGroupProps, ["class", "children", "label"]);
272
+
273
+ return (
274
+ <ComboboxPrimitive.Section class={cn("px-1 py-1", local.class)} {...(rest as any)}>
275
+ {local.label && (
276
+ <span class="px-2 py-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider block">
277
+ {local.label}
278
+ </span>
279
+ )}
280
+ {local.children}
281
+ </ComboboxPrimitive.Section>
282
+ );
283
+ };
284
+
285
+ /**
286
+ * Empty state notice when no matching search items exist.
287
+ */
288
+ export const ComboboxEmpty = (props: { class?: string; children?: JSX.Element }) => {
289
+ return (
290
+ <div class={cn("py-6 text-center text-sm text-muted-foreground", props.class)}>
291
+ {props.children || "No matching items found."}
292
+ </div>
293
+ );
294
+ };
295
+
296
+ /**
297
+ * Hidden native select element for form integrations.
298
+ */
299
+ export const ComboboxHiddenSelect = ComboboxPrimitive.HiddenSelect;
@@ -0,0 +1,378 @@
1
+ import {
2
+ createContext,
3
+ useContext,
4
+ createSignal,
5
+ onCleanup,
6
+ Show,
7
+ splitProps,
8
+ type Component,
9
+ type JSX,
10
+ type Accessor,
11
+ } from "solid-js";
12
+ import { createKeybindings } from "@/hooks/create-keybindings";
13
+ import { Dialog } from "@kobalte/core/dialog";
14
+ import { Search, ArrowUp, ArrowDown, CornerDownLeft } from "lucide-solid";
15
+ import { cn } from "@/lib/cn";
16
+ import { Kbd, KbdGroup } from "../ui/kbd";
17
+ import { InputGroup, InputGroupInput, InputGroupAddon } from "../ui/input-group";
18
+ import { List, ListGroup, ListHeader, ListItem, type ListItemProps } from "../ui/list";
19
+ import { ScrollArea } from "@/components/ui/scroll-area";
20
+
21
+ /* --- Command Context State --- */
22
+ interface CommandContextValue {
23
+ search: Accessor<string>;
24
+ setSearch: (value: string) => void;
25
+ activeIndex: Accessor<number>;
26
+ setActiveIndex: (fn: (prev: number) => number) => void;
27
+ registerItemIndex: (element: HTMLElement) => number;
28
+ onItemSelect: (index: number, action?: () => void) => void;
29
+ }
30
+
31
+ const CommandContext = createContext<CommandContextValue>();
32
+
33
+ export const useCommand = () => {
34
+ const ctx = useContext(CommandContext);
35
+ if (!ctx) {
36
+ throw new Error("useCommand must be used within a <Command />");
37
+ }
38
+ return ctx;
39
+ };
40
+
41
+ /* --- Root Command Container --- */
42
+ export interface CommandProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> {
43
+ class?: string;
44
+ children?: JSX.Element | ((ctx: CommandContextValue) => JSX.Element);
45
+ }
46
+
47
+ export const Command: Component<CommandProps> = (props) => {
48
+ const [local, rest] = splitProps(props, ["class", "children"]);
49
+ const [search, setSearch] = createSignal("");
50
+ const [activeIndex, setActiveIndex] = createSignal(0);
51
+
52
+ let containerRef: HTMLDivElement | undefined;
53
+ let itemsList: HTMLElement[] = [];
54
+
55
+ const registerItemIndex = (element: HTMLElement) => {
56
+ if (!itemsList.includes(element)) {
57
+ itemsList.push(element);
58
+ }
59
+ return itemsList.indexOf(element);
60
+ };
61
+
62
+ const onItemSelect = (index: number, action?: () => void) => {
63
+ setActiveIndex(index);
64
+ if (action) action();
65
+ };
66
+
67
+ const getVisibleItems = () => {
68
+ if (!containerRef) return [];
69
+ return Array.from(containerRef.querySelectorAll<HTMLElement>("[data-command-item]:not(.hidden)"));
70
+ };
71
+
72
+ const updateActiveAttribute = (index: number) => {
73
+ const visible = getVisibleItems();
74
+ visible.forEach((el, idx) => {
75
+ if (idx === index) {
76
+ el.setAttribute("aria-selected", "true");
77
+ el.scrollIntoView({ block: "nearest" });
78
+ } else {
79
+ el.removeAttribute("aria-selected");
80
+ }
81
+ });
82
+ };
83
+
84
+ const handleKeyDown = (e: KeyboardEvent) => {
85
+ const visible = getVisibleItems();
86
+ if (visible.length === 0) return;
87
+
88
+ if (e.key === "ArrowDown") {
89
+ e.preventDefault();
90
+ const next = (activeIndex() + 1) % visible.length;
91
+ setActiveIndex(next);
92
+ updateActiveAttribute(next);
93
+ } else if (e.key === "ArrowUp") {
94
+ e.preventDefault();
95
+ const prev = (activeIndex() - 1 + visible.length) % visible.length;
96
+ setActiveIndex(prev);
97
+ updateActiveAttribute(prev);
98
+ } else if (e.key === "Enter") {
99
+ e.preventDefault();
100
+ const current = visible[activeIndex()];
101
+ if (current) {
102
+ current.click();
103
+ }
104
+ }
105
+ };
106
+
107
+ const ctx: CommandContextValue = {
108
+ search,
109
+ setSearch: (val) => {
110
+ setSearch(val);
111
+ setActiveIndex(0);
112
+ },
113
+ activeIndex,
114
+ setActiveIndex: (fn) => setActiveIndex(fn),
115
+ registerItemIndex,
116
+ onItemSelect,
117
+ };
118
+
119
+ return (
120
+ <CommandContext.Provider value={ctx}>
121
+ <div
122
+ ref={containerRef}
123
+ onKeyDown={handleKeyDown}
124
+ class={cn(
125
+ "flex flex-col w-full h-full rounded-lg bg-popover text-popover-foreground overflow-hidden border border-border shadow-md outline-none",
126
+ local.class
127
+ )}
128
+ tabIndex={0}
129
+ {...rest}
130
+ >
131
+ {typeof local.children === "function" ? (local.children as any)(ctx) : local.children}
132
+ </div>
133
+ </CommandContext.Provider>
134
+ );
135
+ };
136
+
137
+ /* --- Command Dialog (Modal) --- */
138
+ export interface CommandDialogProps {
139
+ open?: boolean;
140
+ onOpenChange?: (open: boolean) => void;
141
+ enableHotkey?: boolean;
142
+ children?: JSX.Element | ((ctx: CommandContextValue) => JSX.Element);
143
+ class?: string;
144
+ }
145
+
146
+ export const CommandDialog: Component<CommandDialogProps> = (props) => {
147
+ const [internalOpen, setInternalOpen] = createSignal(false);
148
+
149
+ const isOpen = () => (props.open !== undefined ? props.open : internalOpen());
150
+ const setOpen = (val: boolean) => {
151
+ if (props.open === undefined) setInternalOpen(val);
152
+ if (typeof props.onOpenChange === "function") props.onOpenChange(val);
153
+ };
154
+
155
+ /* Listen for global Ctrl+K / Cmd+K hotkeys */
156
+ createKeybindings(
157
+ [
158
+ {
159
+ key: ["meta+k", "ctrl+k"],
160
+ handler: () => setOpen(!isOpen()),
161
+ preventDefault: true,
162
+ },
163
+ ],
164
+ {
165
+ enabled: () => props.enableHotkey !== false,
166
+ }
167
+ );
168
+
169
+ return (
170
+ <Dialog open={isOpen()} onOpenChange={setOpen}>
171
+ <Dialog.Portal>
172
+ <Dialog.Overlay class="fixed inset-0 z-50 bg-black/60 backdrop-blur-xs data-expanded:animate-in data-closed:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0" />
173
+ <div class="fixed inset-0 z-50 flex items-start justify-center pt-16 sm:pt-24 px-4">
174
+ <Dialog.Content class="w-full max-w-xl rounded-lg border border-border bg-popover text-popover-foreground shadow-2xl outline-none data-expanded:animate-in data-closed:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0 data-closed:zoom-out-95 data-expanded:zoom-in-95">
175
+ <Command class={props.class}>{props.children}</Command>
176
+ </Dialog.Content>
177
+ </div>
178
+ </Dialog.Portal>
179
+ </Dialog>
180
+ );
181
+ };
182
+
183
+ /* --- Command Input --- */
184
+ export interface CommandInputProps
185
+ extends JSX.InputHTMLAttributes<HTMLInputElement> {
186
+ class?: string;
187
+ }
188
+
189
+ export const CommandInput: Component<CommandInputProps> = (props) => {
190
+ const [local, rest] = splitProps(props, ["class", "value", "onInput"]);
191
+ const { search, setSearch } = useCommand();
192
+
193
+ return (
194
+ <InputGroup class="border-0 border-b border-border rounded-none bg-transparent px-3 py-1 shadow-none focus-within:ring-0 focus-within:border-border">
195
+ <InputGroupAddon align="inline-start">
196
+ <Search class="w-4 h-4 text-muted-foreground" />
197
+ </InputGroupAddon>
198
+
199
+ <InputGroupInput
200
+ value={search()}
201
+ onInput={(e) => {
202
+ setSearch(e.currentTarget.value);
203
+ if (typeof local.onInput === "function") {
204
+ local.onInput(e);
205
+ }
206
+ }}
207
+ placeholder="Type a command or search..."
208
+ class="h-11 text-base sm:text-sm font-medium"
209
+ {...rest}
210
+ />
211
+ </InputGroup>
212
+ );
213
+ };
214
+
215
+ /* --- Command List Container --- */
216
+ export interface CommandListProps extends JSX.HTMLAttributes<HTMLDivElement> {
217
+ class?: string;
218
+ }
219
+
220
+ export const CommandList: Component<CommandListProps> = (props) => {
221
+ const [local, rest] = splitProps(props, ["class", "children"]);
222
+
223
+ return (
224
+ <ScrollArea
225
+ class={cn("max-h-82.5 p-1.5", local.class)}
226
+ {...rest}
227
+ >
228
+ <List>{local.children}</List>
229
+ </ScrollArea>
230
+ );
231
+ };
232
+
233
+ /* --- Command Empty Block --- */
234
+ export interface CommandEmptyProps extends JSX.HTMLAttributes<HTMLDivElement> {
235
+ class?: string;
236
+ }
237
+
238
+ export const CommandEmpty: Component<CommandEmptyProps> = (props) => {
239
+ const [local, rest] = splitProps(props, ["class", "children"]);
240
+ const { search } = useCommand();
241
+
242
+ return (
243
+ <Show when={search().trim().length > 0}>
244
+ <div
245
+ class={cn(
246
+ "py-8 text-center text-sm text-muted-foreground font-medium select-none",
247
+ local.class
248
+ )}
249
+ {...rest}
250
+ >
251
+ {local.children || `No results found for "${search()}".`}
252
+ </div>
253
+ </Show>
254
+ );
255
+ };
256
+
257
+ /* --- Command Group --- */
258
+ export interface CommandGroupProps {
259
+ heading: string;
260
+ children?: JSX.Element;
261
+ class?: string;
262
+ }
263
+
264
+ export const CommandGroup: Component<CommandGroupProps> = (props) => {
265
+ return (
266
+ <ListGroup class={props.class}>
267
+ <ListHeader title={props.heading} />
268
+ {props.children}
269
+ </ListGroup>
270
+ );
271
+ };
272
+
273
+ /* --- Command Item --- */
274
+ export interface CommandItemProps extends ListItemProps {
275
+ keywords?: string[];
276
+ description?: string;
277
+ onSelect?: () => void;
278
+ shouldFilter?: boolean;
279
+ }
280
+
281
+ export const CommandItem: Component<CommandItemProps> = (props) => {
282
+ let itemRef: HTMLDivElement | undefined;
283
+ const [local, rest] = splitProps(props, [
284
+ "title",
285
+ "subtitle",
286
+ "description",
287
+ "keywords",
288
+ "onSelect",
289
+ "onClick",
290
+ "shouldFilter",
291
+ "class",
292
+ ]);
293
+ const { search } = useCommand();
294
+
295
+ /* Auto filter item based on search query */
296
+ const matchesSearch = () => {
297
+ if (local.shouldFilter === false) return true;
298
+ const query = search().toLowerCase().trim();
299
+ if (!query) return true;
300
+
301
+ const titleMatch = local.title?.toLowerCase().includes(query);
302
+ const subtitleMatch = local.subtitle?.toLowerCase().includes(query);
303
+ const descMatch = local.description?.toLowerCase().includes(query);
304
+ const keywordMatch = local.keywords?.some((k) =>
305
+ k.toLowerCase().includes(query)
306
+ );
307
+
308
+ return Boolean(titleMatch || subtitleMatch || descMatch || keywordMatch);
309
+ };
310
+
311
+ const handleClick = (e: MouseEvent) => {
312
+ if (typeof local.onSelect === "function") {
313
+ local.onSelect();
314
+ }
315
+ if (typeof local.onClick === "function") {
316
+ local.onClick(e as any);
317
+ }
318
+ };
319
+
320
+ return (
321
+ <Show when={matchesSearch()}>
322
+ <ListItem
323
+ ref={itemRef}
324
+ data-command-item="true"
325
+ title={local.title}
326
+ subtitle={local.subtitle || local.description}
327
+ onClick={handleClick}
328
+ class={cn(
329
+ "aria-selected:bg-accent aria-selected:text-accent-foreground cursor-pointer transition-colors hover:bg-accent hover:text-accent-foreground",
330
+ local.class
331
+ )}
332
+ {...rest}
333
+ />
334
+ </Show>
335
+ );
336
+ };
337
+
338
+ /* --- Command Footer --- */
339
+ export interface CommandFooterProps extends JSX.HTMLAttributes<HTMLDivElement> {
340
+ class?: string;
341
+ children?: JSX.Element;
342
+ }
343
+
344
+ export const CommandFooter: Component<CommandFooterProps> = (props) => {
345
+ const [local, rest] = splitProps(props, ["class", "children"]);
346
+
347
+ return (
348
+ <div
349
+ class={cn(
350
+ "flex items-center justify-between border-t border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground select-none",
351
+ local.class
352
+ )}
353
+ {...rest}
354
+ >
355
+ <div class="flex items-center gap-3">
356
+ <span class="flex items-center gap-1">
357
+ <KbdGroup>
358
+ <Kbd size="sm"><ArrowUp class="w-2.5 h-2.5" /></Kbd>
359
+ <Kbd size="sm"><ArrowDown class="w-2.5 h-2.5" /></Kbd>
360
+ </KbdGroup>
361
+ <span>Navigate</span>
362
+ </span>
363
+
364
+ <span class="flex items-center gap-1">
365
+ <Kbd size="sm"><CornerDownLeft class="w-2.5 h-2.5" /></Kbd>
366
+ <span>Select</span>
367
+ </span>
368
+
369
+ <span class="flex items-center gap-1">
370
+ <Kbd size="sm">Esc</Kbd>
371
+ <span>Close</span>
372
+ </span>
373
+ </div>
374
+
375
+ {local.children}
376
+ </div>
377
+ );
378
+ };