@nikala-ui/folio 0.13.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 (454) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +221 -0
  3. package/dist/cli/commands/build.d.ts +5 -0
  4. package/dist/cli/commands/build.d.ts.map +1 -0
  5. package/dist/cli/commands/build.js +28 -0
  6. package/dist/cli/commands/build.js.map +1 -0
  7. package/dist/cli/commands/dev.d.ts +7 -0
  8. package/dist/cli/commands/dev.d.ts.map +1 -0
  9. package/dist/cli/commands/dev.js +33 -0
  10. package/dist/cli/commands/dev.js.map +1 -0
  11. package/dist/cli/commands/init.d.ts +2 -0
  12. package/dist/cli/commands/init.d.ts.map +1 -0
  13. package/dist/cli/commands/init.js +359 -0
  14. package/dist/cli/commands/init.js.map +1 -0
  15. package/dist/cli/commands/preview.d.ts +7 -0
  16. package/dist/cli/commands/preview.d.ts.map +1 -0
  17. package/dist/cli/commands/preview.js +25 -0
  18. package/dist/cli/commands/preview.js.map +1 -0
  19. package/dist/cli/commands/serve.d.ts +7 -0
  20. package/dist/cli/commands/serve.d.ts.map +1 -0
  21. package/dist/cli/commands/serve.js +34 -0
  22. package/dist/cli/commands/serve.js.map +1 -0
  23. package/dist/cli/index.d.ts +3 -0
  24. package/dist/cli/index.d.ts.map +1 -0
  25. package/dist/cli/index.js +55 -0
  26. package/dist/cli/index.js.map +1 -0
  27. package/dist/client/app-types.d.ts +18 -0
  28. package/dist/client/app-types.d.ts.map +1 -0
  29. package/dist/client/app-types.js +2 -0
  30. package/dist/client/app-types.js.map +1 -0
  31. package/dist/client/app.d.ts +5 -0
  32. package/dist/client/app.d.ts.map +1 -0
  33. package/dist/client/app.jsx +51 -0
  34. package/dist/client/app.jsx.map +1 -0
  35. package/dist/client/base.css +90 -0
  36. package/dist/client/components/docs-layout-shell.d.ts +23 -0
  37. package/dist/client/components/docs-layout-shell.d.ts.map +1 -0
  38. package/dist/client/components/docs-layout-shell.jsx +15 -0
  39. package/dist/client/components/docs-layout-shell.jsx.map +1 -0
  40. package/dist/client/components/docs-page-content.d.ts +9 -0
  41. package/dist/client/components/docs-page-content.d.ts.map +1 -0
  42. package/dist/client/components/docs-page-content.jsx +10 -0
  43. package/dist/client/components/docs-page-content.jsx.map +1 -0
  44. package/dist/client/entry.d.ts +2 -0
  45. package/dist/client/entry.d.ts.map +1 -0
  46. package/dist/client/entry.jsx +32 -0
  47. package/dist/client/entry.jsx.map +1 -0
  48. package/dist/client/index.html +23 -0
  49. package/dist/client/navigation/page-navigation.d.ts +9 -0
  50. package/dist/client/navigation/page-navigation.d.ts.map +1 -0
  51. package/dist/client/navigation/page-navigation.js +51 -0
  52. package/dist/client/navigation/page-navigation.js.map +1 -0
  53. package/dist/client/page-actions.d.ts +10 -0
  54. package/dist/client/page-actions.d.ts.map +1 -0
  55. package/dist/client/page-actions.js +63 -0
  56. package/dist/client/page-actions.js.map +1 -0
  57. package/dist/client/public/favicon.ico +0 -0
  58. package/dist/client/routing/use-docs-router.d.ts +17 -0
  59. package/dist/client/routing/use-docs-router.d.ts.map +1 -0
  60. package/dist/client/routing/use-docs-router.js +87 -0
  61. package/dist/client/routing/use-docs-router.js.map +1 -0
  62. package/dist/client/ssr-entry.d.ts +3 -0
  63. package/dist/client/ssr-entry.d.ts.map +1 -0
  64. package/dist/client/ssr-entry.jsx +13 -0
  65. package/dist/client/ssr-entry.jsx.map +1 -0
  66. package/dist/client/style.css +186 -0
  67. package/dist/client/utils/sidebar.d.ts +2 -0
  68. package/dist/client/utils/sidebar.d.ts.map +1 -0
  69. package/dist/client/utils/sidebar.js +2 -0
  70. package/dist/client/utils/sidebar.js.map +1 -0
  71. package/dist/components/mdx-components.d.ts +65 -0
  72. package/dist/components/mdx-components.d.ts.map +1 -0
  73. package/dist/components/mdx-components.jsx +133 -0
  74. package/dist/components/mdx-components.jsx.map +1 -0
  75. package/dist/components/ui/api-table.d.ts +29 -0
  76. package/dist/components/ui/api-table.d.ts.map +1 -0
  77. package/dist/components/ui/api-table.jsx +66 -0
  78. package/dist/components/ui/api-table.jsx.map +1 -0
  79. package/dist/components/ui/badge.d.ts +17 -0
  80. package/dist/components/ui/badge.d.ts.map +1 -0
  81. package/dist/components/ui/badge.jsx +33 -0
  82. package/dist/components/ui/badge.jsx.map +1 -0
  83. package/dist/components/ui/breadcrumb.d.ts +51 -0
  84. package/dist/components/ui/breadcrumb.d.ts.map +1 -0
  85. package/dist/components/ui/breadcrumb.jsx +62 -0
  86. package/dist/components/ui/breadcrumb.jsx.map +1 -0
  87. package/dist/components/ui/button.d.ts +19 -0
  88. package/dist/components/ui/button.d.ts.map +1 -0
  89. package/dist/components/ui/button.jsx +54 -0
  90. package/dist/components/ui/button.jsx.map +1 -0
  91. package/dist/components/ui/callout.d.ts +21 -0
  92. package/dist/components/ui/callout.d.ts.map +1 -0
  93. package/dist/components/ui/callout.jsx +76 -0
  94. package/dist/components/ui/callout.jsx.map +1 -0
  95. package/dist/components/ui/card.d.ts +44 -0
  96. package/dist/components/ui/card.d.ts.map +1 -0
  97. package/dist/components/ui/card.jsx +45 -0
  98. package/dist/components/ui/card.jsx.map +1 -0
  99. package/dist/components/ui/code-block.d.ts +23 -0
  100. package/dist/components/ui/code-block.d.ts.map +1 -0
  101. package/dist/components/ui/code-block.jsx +263 -0
  102. package/dist/components/ui/code-block.jsx.map +1 -0
  103. package/dist/components/ui/collapsible.d.ts +27 -0
  104. package/dist/components/ui/collapsible.d.ts.map +1 -0
  105. package/dist/components/ui/collapsible.jsx +29 -0
  106. package/dist/components/ui/collapsible.jsx.map +1 -0
  107. package/dist/components/ui/command.d.ts +57 -0
  108. package/dist/components/ui/command.d.ts.map +1 -0
  109. package/dist/components/ui/command.jsx +224 -0
  110. package/dist/components/ui/command.jsx.map +1 -0
  111. package/dist/components/ui/component-viewer.d.ts +33 -0
  112. package/dist/components/ui/component-viewer.d.ts.map +1 -0
  113. package/dist/components/ui/component-viewer.jsx +210 -0
  114. package/dist/components/ui/component-viewer.jsx.map +1 -0
  115. package/dist/components/ui/container.d.ts +13 -0
  116. package/dist/components/ui/container.d.ts.map +1 -0
  117. package/dist/components/ui/container.jsx +29 -0
  118. package/dist/components/ui/container.jsx.map +1 -0
  119. package/dist/components/ui/dropdown-menu.d.ts +58 -0
  120. package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
  121. package/dist/components/ui/dropdown-menu.jsx +112 -0
  122. package/dist/components/ui/dropdown-menu.jsx.map +1 -0
  123. package/dist/components/ui/input-group.d.ts +16 -0
  124. package/dist/components/ui/input-group.d.ts.map +1 -0
  125. package/dist/components/ui/input-group.jsx +33 -0
  126. package/dist/components/ui/input-group.jsx.map +1 -0
  127. package/dist/components/ui/kbd.d.ts +15 -0
  128. package/dist/components/ui/kbd.d.ts.map +1 -0
  129. package/dist/components/ui/kbd.jsx +42 -0
  130. package/dist/components/ui/kbd.jsx.map +1 -0
  131. package/dist/components/ui/list.d.ts +36 -0
  132. package/dist/components/ui/list.d.ts.map +1 -0
  133. package/dist/components/ui/list.jsx +131 -0
  134. package/dist/components/ui/list.jsx.map +1 -0
  135. package/dist/components/ui/logo.d.ts +9 -0
  136. package/dist/components/ui/logo.d.ts.map +1 -0
  137. package/dist/components/ui/logo.jsx +31 -0
  138. package/dist/components/ui/logo.jsx.map +1 -0
  139. package/dist/components/ui/navbar.d.ts +57 -0
  140. package/dist/components/ui/navbar.d.ts.map +1 -0
  141. package/dist/components/ui/navbar.jsx +174 -0
  142. package/dist/components/ui/navbar.jsx.map +1 -0
  143. package/dist/components/ui/package-manager-tabs.d.ts +21 -0
  144. package/dist/components/ui/package-manager-tabs.d.ts.map +1 -0
  145. package/dist/components/ui/package-manager-tabs.jsx +167 -0
  146. package/dist/components/ui/package-manager-tabs.jsx.map +1 -0
  147. package/dist/components/ui/pager.d.ts +27 -0
  148. package/dist/components/ui/pager.d.ts.map +1 -0
  149. package/dist/components/ui/pager.jsx +50 -0
  150. package/dist/components/ui/pager.jsx.map +1 -0
  151. package/dist/components/ui/scroll-area.d.ts +9 -0
  152. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  153. package/dist/components/ui/scroll-area.jsx +160 -0
  154. package/dist/components/ui/scroll-area.jsx.map +1 -0
  155. package/dist/components/ui/section-heading.d.ts +23 -0
  156. package/dist/components/ui/section-heading.d.ts.map +1 -0
  157. package/dist/components/ui/section-heading.jsx +82 -0
  158. package/dist/components/ui/section-heading.jsx.map +1 -0
  159. package/dist/components/ui/separator.d.ts +13 -0
  160. package/dist/components/ui/separator.d.ts.map +1 -0
  161. package/dist/components/ui/separator.jsx +16 -0
  162. package/dist/components/ui/separator.jsx.map +1 -0
  163. package/dist/components/ui/sidebar.d.ts +103 -0
  164. package/dist/components/ui/sidebar.d.ts.map +1 -0
  165. package/dist/components/ui/sidebar.jsx +315 -0
  166. package/dist/components/ui/sidebar.jsx.map +1 -0
  167. package/dist/components/ui/skeleton.d.ts +9 -0
  168. package/dist/components/ui/skeleton.d.ts.map +1 -0
  169. package/dist/components/ui/skeleton.jsx +11 -0
  170. package/dist/components/ui/skeleton.jsx.map +1 -0
  171. package/dist/components/ui/spinner.d.ts +11 -0
  172. package/dist/components/ui/spinner.d.ts.map +1 -0
  173. package/dist/components/ui/spinner.jsx +21 -0
  174. package/dist/components/ui/spinner.jsx.map +1 -0
  175. package/dist/components/ui/table-of-contents.d.ts +20 -0
  176. package/dist/components/ui/table-of-contents.d.ts.map +1 -0
  177. package/dist/components/ui/table-of-contents.jsx +77 -0
  178. package/dist/components/ui/table-of-contents.jsx.map +1 -0
  179. package/dist/components/ui/table.d.ts +58 -0
  180. package/dist/components/ui/table.d.ts.map +1 -0
  181. package/dist/components/ui/table.jsx +61 -0
  182. package/dist/components/ui/table.jsx.map +1 -0
  183. package/dist/components/ui/tabs.d.ts +42 -0
  184. package/dist/components/ui/tabs.d.ts.map +1 -0
  185. package/dist/components/ui/tabs.jsx +93 -0
  186. package/dist/components/ui/tabs.jsx.map +1 -0
  187. package/dist/components/ui/theme-toggle.d.ts +19 -0
  188. package/dist/components/ui/theme-toggle.d.ts.map +1 -0
  189. package/dist/components/ui/theme-toggle.jsx +142 -0
  190. package/dist/components/ui/theme-toggle.jsx.map +1 -0
  191. package/dist/components/ui/tooltip.d.ts +10 -0
  192. package/dist/components/ui/tooltip.d.ts.map +1 -0
  193. package/dist/components/ui/tooltip.jsx +18 -0
  194. package/dist/components/ui/tooltip.jsx.map +1 -0
  195. package/dist/config.d.ts +6 -0
  196. package/dist/config.d.ts.map +1 -0
  197. package/dist/config.js +105 -0
  198. package/dist/config.js.map +1 -0
  199. package/dist/core/content-scanner.d.ts +10 -0
  200. package/dist/core/content-scanner.d.ts.map +1 -0
  201. package/dist/core/content-scanner.js +218 -0
  202. package/dist/core/content-scanner.js.map +1 -0
  203. package/dist/core/route-tree.d.ts +24 -0
  204. package/dist/core/route-tree.d.ts.map +1 -0
  205. package/dist/core/route-tree.js +221 -0
  206. package/dist/core/route-tree.js.map +1 -0
  207. package/dist/hooks/create-click-outside.d.ts +18 -0
  208. package/dist/hooks/create-click-outside.d.ts.map +1 -0
  209. package/dist/hooks/create-click-outside.js +55 -0
  210. package/dist/hooks/create-click-outside.js.map +1 -0
  211. package/dist/hooks/create-clipboard.d.ts +20 -0
  212. package/dist/hooks/create-clipboard.d.ts.map +1 -0
  213. package/dist/hooks/create-clipboard.js +48 -0
  214. package/dist/hooks/create-clipboard.js.map +1 -0
  215. package/dist/hooks/create-color-mode.d.ts +27 -0
  216. package/dist/hooks/create-color-mode.d.ts.map +1 -0
  217. package/dist/hooks/create-color-mode.js +86 -0
  218. package/dist/hooks/create-color-mode.js.map +1 -0
  219. package/dist/hooks/create-controllable-signal.d.ts +17 -0
  220. package/dist/hooks/create-controllable-signal.d.ts.map +1 -0
  221. package/dist/hooks/create-controllable-signal.js +35 -0
  222. package/dist/hooks/create-controllable-signal.js.map +1 -0
  223. package/dist/hooks/create-focus-trap.d.ts +15 -0
  224. package/dist/hooks/create-focus-trap.d.ts.map +1 -0
  225. package/dist/hooks/create-focus-trap.js +72 -0
  226. package/dist/hooks/create-focus-trap.js.map +1 -0
  227. package/dist/hooks/create-keybindings.d.ts +34 -0
  228. package/dist/hooks/create-keybindings.d.ts.map +1 -0
  229. package/dist/hooks/create-keybindings.js +113 -0
  230. package/dist/hooks/create-keybindings.js.map +1 -0
  231. package/dist/hooks/create-lock-scroll.d.ts +20 -0
  232. package/dist/hooks/create-lock-scroll.d.ts.map +1 -0
  233. package/dist/hooks/create-lock-scroll.js +77 -0
  234. package/dist/hooks/create-lock-scroll.js.map +1 -0
  235. package/dist/hooks/create-resize-observer.d.ts +27 -0
  236. package/dist/hooks/create-resize-observer.d.ts.map +1 -0
  237. package/dist/hooks/create-resize-observer.js +59 -0
  238. package/dist/hooks/create-resize-observer.js.map +1 -0
  239. package/dist/hooks/create-scroll-position.d.ts +29 -0
  240. package/dist/hooks/create-scroll-position.d.ts.map +1 -0
  241. package/dist/hooks/create-scroll-position.js +101 -0
  242. package/dist/hooks/create-scroll-position.js.map +1 -0
  243. package/dist/index.d.ts +13 -0
  244. package/dist/index.d.ts.map +1 -0
  245. package/dist/index.js +14 -0
  246. package/dist/index.js.map +1 -0
  247. package/dist/lib/cn.d.ts +6 -0
  248. package/dist/lib/cn.d.ts.map +1 -0
  249. package/dist/lib/cn.js +9 -0
  250. package/dist/lib/cn.js.map +1 -0
  251. package/dist/mdx/compiler.d.ts +13 -0
  252. package/dist/mdx/compiler.d.ts.map +1 -0
  253. package/dist/mdx/compiler.js +38 -0
  254. package/dist/mdx/compiler.js.map +1 -0
  255. package/dist/mdx/highlighter.d.ts +22 -0
  256. package/dist/mdx/highlighter.d.ts.map +1 -0
  257. package/dist/mdx/highlighter.js +190 -0
  258. package/dist/mdx/highlighter.js.map +1 -0
  259. package/dist/mdx/rehype-shiki.d.ts +3 -0
  260. package/dist/mdx/rehype-shiki.d.ts.map +1 -0
  261. package/dist/mdx/rehype-shiki.js +83 -0
  262. package/dist/mdx/rehype-shiki.js.map +1 -0
  263. package/dist/navigation/index.d.ts +3 -0
  264. package/dist/navigation/index.d.ts.map +1 -0
  265. package/dist/navigation/index.js +3 -0
  266. package/dist/navigation/index.js.map +1 -0
  267. package/dist/navigation/repository-links.d.ts +3 -0
  268. package/dist/navigation/repository-links.d.ts.map +1 -0
  269. package/dist/navigation/repository-links.js +35 -0
  270. package/dist/navigation/repository-links.js.map +1 -0
  271. package/dist/navigation/sidebar-state.d.ts +6 -0
  272. package/dist/navigation/sidebar-state.d.ts.map +1 -0
  273. package/dist/navigation/sidebar-state.js +20 -0
  274. package/dist/navigation/sidebar-state.js.map +1 -0
  275. package/dist/navigation/sidebar-tree.d.ts +7 -0
  276. package/dist/navigation/sidebar-tree.d.ts.map +1 -0
  277. package/dist/navigation/sidebar-tree.js +11 -0
  278. package/dist/navigation/sidebar-tree.js.map +1 -0
  279. package/dist/providers/theme-provider.d.ts +33 -0
  280. package/dist/providers/theme-provider.d.ts.map +1 -0
  281. package/dist/providers/theme-provider.jsx +158 -0
  282. package/dist/providers/theme-provider.jsx.map +1 -0
  283. package/dist/providers/theme-script.d.ts +16 -0
  284. package/dist/providers/theme-script.d.ts.map +1 -0
  285. package/dist/providers/theme-script.jsx +41 -0
  286. package/dist/providers/theme-script.jsx.map +1 -0
  287. package/dist/providers/theme-transitions.d.ts +12 -0
  288. package/dist/providers/theme-transitions.d.ts.map +1 -0
  289. package/dist/providers/theme-transitions.js +115 -0
  290. package/dist/providers/theme-transitions.js.map +1 -0
  291. package/dist/registry/api-table.json +21 -0
  292. package/dist/registry/badge.json +18 -0
  293. package/dist/registry/breadcrumb.json +17 -0
  294. package/dist/registry/button.json +21 -0
  295. package/dist/registry/callout.json +19 -0
  296. package/dist/registry/card.json +17 -0
  297. package/dist/registry/code-block.json +28 -0
  298. package/dist/registry/collapsible.json +18 -0
  299. package/dist/registry/command.json +27 -0
  300. package/dist/registry/component-viewer.json +25 -0
  301. package/dist/registry/container.json +18 -0
  302. package/dist/registry/create-click-outside.json +13 -0
  303. package/dist/registry/create-clipboard.json +13 -0
  304. package/dist/registry/create-color-mode.json +13 -0
  305. package/dist/registry/create-controllable-signal.json +13 -0
  306. package/dist/registry/create-focus-trap.json +13 -0
  307. package/dist/registry/create-keybindings.json +13 -0
  308. package/dist/registry/create-lock-scroll.json +13 -0
  309. package/dist/registry/create-resize-observer.json +13 -0
  310. package/dist/registry/create-scroll-position.json +13 -0
  311. package/dist/registry/dropdown-menu.json +22 -0
  312. package/dist/registry/input-group.json +21 -0
  313. package/dist/registry/kbd.json +18 -0
  314. package/dist/registry/list.json +20 -0
  315. package/dist/registry/logo.json +17 -0
  316. package/dist/registry/navbar.json +19 -0
  317. package/dist/registry/package-manager-tabs.json +24 -0
  318. package/dist/registry/pager.json +21 -0
  319. package/dist/registry/scroll-area.json +21 -0
  320. package/dist/registry/section-heading.json +21 -0
  321. package/dist/registry/separator.json +17 -0
  322. package/dist/registry/sidebar.json +24 -0
  323. package/dist/registry/skeleton.json +17 -0
  324. package/dist/registry/spinner.json +18 -0
  325. package/dist/registry/table-of-contents.json +23 -0
  326. package/dist/registry/table.json +17 -0
  327. package/dist/registry/tabs.json +20 -0
  328. package/dist/registry/theme-manager.json +39 -0
  329. package/dist/registry/tooltip.json +18 -0
  330. package/dist/search/provider.d.ts +14 -0
  331. package/dist/search/provider.d.ts.map +1 -0
  332. package/dist/search/provider.js +14 -0
  333. package/dist/search/provider.js.map +1 -0
  334. package/dist/server/index.d.ts +18 -0
  335. package/dist/server/index.d.ts.map +1 -0
  336. package/dist/server/index.js +565 -0
  337. package/dist/server/index.js.map +1 -0
  338. package/dist/server/plugin.d.ts +10 -0
  339. package/dist/server/plugin.d.ts.map +1 -0
  340. package/dist/server/plugin.js +522 -0
  341. package/dist/server/plugin.js.map +1 -0
  342. package/dist/theme-accent.d.ts +8 -0
  343. package/dist/theme-accent.d.ts.map +1 -0
  344. package/dist/theme-accent.js +18 -0
  345. package/dist/theme-accent.js.map +1 -0
  346. package/dist/theme-mode.d.ts +4 -0
  347. package/dist/theme-mode.d.ts.map +1 -0
  348. package/dist/theme-mode.js +5 -0
  349. package/dist/theme-mode.js.map +1 -0
  350. package/dist/themes/default/content/breadcrumbs.d.ts +4 -0
  351. package/dist/themes/default/content/breadcrumbs.d.ts.map +1 -0
  352. package/dist/themes/default/content/breadcrumbs.jsx +31 -0
  353. package/dist/themes/default/content/breadcrumbs.jsx.map +1 -0
  354. package/dist/themes/default/content/pager.d.ts +5 -0
  355. package/dist/themes/default/content/pager.d.ts.map +1 -0
  356. package/dist/themes/default/content/pager.jsx +9 -0
  357. package/dist/themes/default/content/pager.jsx.map +1 -0
  358. package/dist/themes/default/content/table-of-contents.d.ts +4 -0
  359. package/dist/themes/default/content/table-of-contents.d.ts.map +1 -0
  360. package/dist/themes/default/content/table-of-contents.jsx +19 -0
  361. package/dist/themes/default/content/table-of-contents.jsx.map +1 -0
  362. package/dist/themes/default/icons.d.ts +3 -0
  363. package/dist/themes/default/icons.d.ts.map +1 -0
  364. package/dist/themes/default/icons.js +15 -0
  365. package/dist/themes/default/icons.js.map +1 -0
  366. package/dist/themes/default/index.d.ts +12 -0
  367. package/dist/themes/default/index.d.ts.map +1 -0
  368. package/dist/themes/default/index.js +30 -0
  369. package/dist/themes/default/index.js.map +1 -0
  370. package/dist/themes/default/layout.d.ts +4 -0
  371. package/dist/themes/default/layout.d.ts.map +1 -0
  372. package/dist/themes/default/layout.jsx +194 -0
  373. package/dist/themes/default/layout.jsx.map +1 -0
  374. package/dist/themes/default/navbar.d.ts +4 -0
  375. package/dist/themes/default/navbar.d.ts.map +1 -0
  376. package/dist/themes/default/navbar.jsx +83 -0
  377. package/dist/themes/default/navbar.jsx.map +1 -0
  378. package/dist/themes/default/navigation/mobile-table-of-contents.d.ts +4 -0
  379. package/dist/themes/default/navigation/mobile-table-of-contents.d.ts.map +1 -0
  380. package/dist/themes/default/navigation/mobile-table-of-contents.jsx +38 -0
  381. package/dist/themes/default/navigation/mobile-table-of-contents.jsx.map +1 -0
  382. package/dist/themes/default/navigation/sidebar-tree.d.ts +8 -0
  383. package/dist/themes/default/navigation/sidebar-tree.d.ts.map +1 -0
  384. package/dist/themes/default/navigation/sidebar-tree.jsx +124 -0
  385. package/dist/themes/default/navigation/sidebar-tree.jsx.map +1 -0
  386. package/dist/themes/default/overlays/search-dialog.d.ts +4 -0
  387. package/dist/themes/default/overlays/search-dialog.d.ts.map +1 -0
  388. package/dist/themes/default/overlays/search-dialog.jsx +52 -0
  389. package/dist/themes/default/overlays/search-dialog.jsx.map +1 -0
  390. package/dist/themes/default/sidebar.d.ts +4 -0
  391. package/dist/themes/default/sidebar.d.ts.map +1 -0
  392. package/dist/themes/default/sidebar.jsx +92 -0
  393. package/dist/themes/default/sidebar.jsx.map +1 -0
  394. package/dist/themes/index.d.ts +4 -0
  395. package/dist/themes/index.d.ts.map +1 -0
  396. package/dist/themes/index.js +5 -0
  397. package/dist/themes/index.js.map +1 -0
  398. package/dist/themes/types.d.ts +91 -0
  399. package/dist/themes/types.d.ts.map +1 -0
  400. package/dist/themes/types.js +2 -0
  401. package/dist/themes/types.js.map +1 -0
  402. package/dist/types.d.ts +132 -0
  403. package/dist/types.d.ts.map +1 -0
  404. package/dist/types.js +3 -0
  405. package/dist/types.js.map +1 -0
  406. package/dist/vendor/docs-src/components/mdx-components.tsx +144 -0
  407. package/dist/vendor/docs-src/components/ui/api-table.tsx +117 -0
  408. package/dist/vendor/docs-src/components/ui/badge.tsx +56 -0
  409. package/dist/vendor/docs-src/components/ui/breadcrumb.tsx +136 -0
  410. package/dist/vendor/docs-src/components/ui/button.tsx +82 -0
  411. package/dist/vendor/docs-src/components/ui/callout.tsx +137 -0
  412. package/dist/vendor/docs-src/components/ui/card.tsx +113 -0
  413. package/dist/vendor/docs-src/components/ui/code-block.tsx +347 -0
  414. package/dist/vendor/docs-src/components/ui/collapsible.tsx +73 -0
  415. package/dist/vendor/docs-src/components/ui/command.tsx +382 -0
  416. package/dist/vendor/docs-src/components/ui/component-viewer.tsx +363 -0
  417. package/dist/vendor/docs-src/components/ui/container.tsx +45 -0
  418. package/dist/vendor/docs-src/components/ui/dropdown-menu.tsx +298 -0
  419. package/dist/vendor/docs-src/components/ui/input-group.tsx +80 -0
  420. package/dist/vendor/docs-src/components/ui/kbd.tsx +73 -0
  421. package/dist/vendor/docs-src/components/ui/list.tsx +222 -0
  422. package/dist/vendor/docs-src/components/ui/logo.tsx +68 -0
  423. package/dist/vendor/docs-src/components/ui/navbar.tsx +375 -0
  424. package/dist/vendor/docs-src/components/ui/package-manager-tabs.tsx +226 -0
  425. package/dist/vendor/docs-src/components/ui/pager.tsx +102 -0
  426. package/dist/vendor/docs-src/components/ui/scroll-area.tsx +228 -0
  427. package/dist/vendor/docs-src/components/ui/section-heading.tsx +115 -0
  428. package/dist/vendor/docs-src/components/ui/separator.tsx +37 -0
  429. package/dist/vendor/docs-src/components/ui/sidebar.tsx +712 -0
  430. package/dist/vendor/docs-src/components/ui/skeleton.tsx +24 -0
  431. package/dist/vendor/docs-src/components/ui/spinner.tsx +41 -0
  432. package/dist/vendor/docs-src/components/ui/table-of-contents.tsx +131 -0
  433. package/dist/vendor/docs-src/components/ui/table.tsx +160 -0
  434. package/dist/vendor/docs-src/components/ui/tabs.tsx +204 -0
  435. package/dist/vendor/docs-src/components/ui/theme-toggle.tsx +238 -0
  436. package/dist/vendor/docs-src/components/ui/tooltip.tsx +41 -0
  437. package/dist/vendor/docs-src/hooks/create-click-outside.ts +82 -0
  438. package/dist/vendor/docs-src/hooks/create-clipboard.ts +69 -0
  439. package/dist/vendor/docs-src/hooks/create-color-mode.ts +115 -0
  440. package/dist/vendor/docs-src/hooks/create-controllable-signal.ts +56 -0
  441. package/dist/vendor/docs-src/hooks/create-focus-trap.ts +94 -0
  442. package/dist/vendor/docs-src/hooks/create-keybindings.ts +148 -0
  443. package/dist/vendor/docs-src/hooks/create-lock-scroll.ts +97 -0
  444. package/dist/vendor/docs-src/hooks/create-resize-observer.ts +89 -0
  445. package/dist/vendor/docs-src/hooks/create-scroll-position.ts +129 -0
  446. package/dist/vendor/docs-src/lib/cn.ts +9 -0
  447. package/dist/vendor/docs-src/providers/theme-provider.tsx +203 -0
  448. package/dist/vendor/docs-src/providers/theme-script.tsx +54 -0
  449. package/dist/vendor/docs-src/providers/theme-transitions.ts +139 -0
  450. package/dist/version.d.ts +2 -0
  451. package/dist/version.d.ts.map +1 -0
  452. package/dist/version.js +2 -0
  453. package/dist/version.js.map +1 -0
  454. package/package.json +95 -0
@@ -0,0 +1,298 @@
1
+ import { splitProps, type Component, type JSX, type ValidComponent, createContext, useContext } from "solid-js";
2
+ import * as DropdownMenuPrimitive from "@kobalte/core/dropdown-menu";
3
+ import type { PolymorphicProps } from "@kobalte/core/polymorphic";
4
+ import { createClickOutside } from "@/hooks/create-click-outside";
5
+ import { ScrollArea } from "@/components/ui/scroll-area";
6
+ import { cn } from "@/lib/cn";
7
+
8
+ const DropdownGroupContext = createContext<boolean>(false);
9
+
10
+ export type DropdownMenuRootProps = Omit<
11
+ DropdownMenuPrimitive.DropdownMenuRootProps,
12
+ "placement"
13
+ > & {
14
+ placement?:
15
+ | "top"
16
+ | "top-start"
17
+ | "top-end"
18
+ | "right"
19
+ | "right-start"
20
+ | "right-end"
21
+ | "bottom"
22
+ | "bottom-start"
23
+ | "bottom-end"
24
+ | "left"
25
+ | "left-start"
26
+ | "left-end";
27
+ };
28
+
29
+ export const DropdownMenu: Component<DropdownMenuRootProps> = (props) => {
30
+ return <DropdownMenuPrimitive.Root {...props} />;
31
+ };
32
+
33
+ export const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
34
+
35
+ export const DropdownMenuGroup: Component<DropdownMenuPrimitive.DropdownMenuGroupProps> = (props) => {
36
+ return (
37
+ <DropdownGroupContext.Provider value={true}>
38
+ <DropdownMenuPrimitive.Group {...props} />
39
+ </DropdownGroupContext.Provider>
40
+ );
41
+ };
42
+
43
+ export const DropdownMenuSub = DropdownMenuPrimitive.Sub;
44
+ export const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
45
+
46
+ export type DropdownMenuSubTriggerProps<T extends ValidComponent = "div"> =
47
+ DropdownMenuPrimitive.DropdownMenuSubTriggerProps<T> & {
48
+ class?: string;
49
+ children?: JSX.Element;
50
+ inset?: boolean;
51
+ };
52
+
53
+ export const DropdownMenuSubTrigger = <T extends ValidComponent = "div">(
54
+ props: PolymorphicProps<T, DropdownMenuSubTriggerProps<T>>
55
+ ) => {
56
+ const [local, rest] = splitProps(props as DropdownMenuSubTriggerProps, ["class", "children", "inset"]);
57
+
58
+ return (
59
+ <DropdownMenuPrimitive.SubTrigger
60
+ class={cn(
61
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent text-foreground",
62
+ local.inset && "pl-8",
63
+ local.class
64
+ )}
65
+ {...(rest as any)}
66
+ >
67
+ {local.children}
68
+ <svg class="ml-auto h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
69
+ <path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" />
70
+ </svg>
71
+ </DropdownMenuPrimitive.SubTrigger>
72
+ );
73
+ };
74
+
75
+ export type DropdownMenuSubContentProps<T extends ValidComponent = "div"> =
76
+ DropdownMenuPrimitive.DropdownMenuSubContentProps<T> & {
77
+ class?: string;
78
+ };
79
+
80
+ export const DropdownMenuSubContent = <T extends ValidComponent = "div">(
81
+ props: PolymorphicProps<T, DropdownMenuSubContentProps<T>>
82
+ ) => {
83
+ const [local, rest] = splitProps(props as DropdownMenuSubContentProps, ["class"]);
84
+
85
+ return (
86
+ <DropdownMenuPrimitive.Portal>
87
+ <DropdownMenuPrimitive.SubContent
88
+ class={cn(
89
+ "z-50 min-w-32 overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg data-expanded:animate-in data-closed:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0",
90
+ local.class
91
+ )}
92
+ {...(rest as any)}
93
+ />
94
+ </DropdownMenuPrimitive.Portal>
95
+ );
96
+ };
97
+
98
+ export type DropdownMenuContentProps<T extends ValidComponent = "div"> =
99
+ DropdownMenuPrimitive.DropdownMenuContentProps<T> & {
100
+ class?: string;
101
+ children?: JSX.Element;
102
+ };
103
+
104
+ export const DropdownMenuContent = <T extends ValidComponent = "div">(
105
+ props: PolymorphicProps<T, DropdownMenuContentProps<T>>
106
+ ) => {
107
+ const [local, rest] = splitProps(props as DropdownMenuContentProps, ["class", "children"]);
108
+ let contentRef: HTMLElement | undefined;
109
+
110
+ createClickOutside({
111
+ target: () => contentRef,
112
+ onInteractOutside: (e) => {
113
+ if (typeof (props as any).onInteractOutside === "function") {
114
+ (props as any).onInteractOutside(e);
115
+ }
116
+ },
117
+ });
118
+
119
+ return (
120
+ <DropdownMenuPrimitive.Portal>
121
+ <DropdownMenuPrimitive.Content
122
+ ref={(el) => {
123
+ contentRef = el;
124
+ if (typeof (props as any).ref === "function") (props as any).ref(el);
125
+ }}
126
+ {...(rest as any)}
127
+ sideOffset={(rest as any).sideOffset ?? 8}
128
+ class={cn(
129
+ "z-50 min-w-32 overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md animate-in fade-in-80 max-h-72 flex flex-col mt-1",
130
+ local.class
131
+ )}
132
+ >
133
+ <ScrollArea class="max-h-72 w-full">
134
+ <div class="p-1">
135
+ {local.children}
136
+ </div>
137
+ </ScrollArea>
138
+ </DropdownMenuPrimitive.Content>
139
+ </DropdownMenuPrimitive.Portal>
140
+ );
141
+ };
142
+
143
+ export type DropdownMenuItemProps<T extends ValidComponent = "div"> =
144
+ DropdownMenuPrimitive.DropdownMenuItemProps<T> & {
145
+ class?: string;
146
+ inset?: boolean;
147
+ variant?: "default" | "destructive";
148
+ };
149
+
150
+ export const DropdownMenuItem = <T extends ValidComponent = "div">(
151
+ props: PolymorphicProps<T, DropdownMenuItemProps<T>>
152
+ ) => {
153
+ const [local, rest] = splitProps(props as DropdownMenuItemProps, [
154
+ "class",
155
+ "inset",
156
+ "variant",
157
+ ]);
158
+
159
+ return (
160
+ <DropdownMenuPrimitive.Item
161
+ class={cn(
162
+ "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
163
+ local.inset && "pl-8",
164
+ local.variant === "destructive" &&
165
+ "text-destructive focus:bg-destructive/15 focus:text-destructive",
166
+ local.class
167
+ )}
168
+ {...(rest as any)}
169
+ />
170
+ );
171
+ };
172
+
173
+ export type DropdownMenuCheckboxItemProps<T extends ValidComponent = "div"> =
174
+ DropdownMenuPrimitive.DropdownMenuCheckboxItemProps<T> & {
175
+ class?: string;
176
+ children?: JSX.Element;
177
+ };
178
+
179
+ export const DropdownMenuCheckboxItem = <T extends ValidComponent = "div">(
180
+ props: PolymorphicProps<T, DropdownMenuCheckboxItemProps<T>>
181
+ ) => {
182
+ const [local, rest] = splitProps(props as DropdownMenuCheckboxItemProps, ["class", "children"]);
183
+
184
+ return (
185
+ <DropdownMenuPrimitive.CheckboxItem
186
+ class={cn(
187
+ "relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
188
+ local.class
189
+ )}
190
+ {...(rest as any)}
191
+ >
192
+ <span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
193
+ <DropdownMenuPrimitive.ItemIndicator>
194
+ <svg class="h-4 w-4 fill-none stroke-current stroke-2" viewBox="0 0 24 24">
195
+ <path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
196
+ </svg>
197
+ </DropdownMenuPrimitive.ItemIndicator>
198
+ </span>
199
+ {local.children}
200
+ </DropdownMenuPrimitive.CheckboxItem>
201
+ );
202
+ };
203
+
204
+ export type DropdownMenuRadioItemProps<T extends ValidComponent = "div"> =
205
+ DropdownMenuPrimitive.DropdownMenuRadioItemProps<T> & {
206
+ class?: string;
207
+ children?: JSX.Element;
208
+ };
209
+
210
+ export const DropdownMenuRadioItem = <T extends ValidComponent = "div">(
211
+ props: PolymorphicProps<T, DropdownMenuRadioItemProps<T>>
212
+ ) => {
213
+ const [local, rest] = splitProps(props as DropdownMenuRadioItemProps, ["class", "children"]);
214
+
215
+ return (
216
+ <DropdownMenuPrimitive.RadioItem
217
+ class={cn(
218
+ "relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
219
+ local.class
220
+ )}
221
+ {...(rest as any)}
222
+ >
223
+ <span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
224
+ <DropdownMenuPrimitive.ItemIndicator>
225
+ <span class="h-2 w-2 rounded-lg bg-current" />
226
+ </DropdownMenuPrimitive.ItemIndicator>
227
+ </span>
228
+ {local.children}
229
+ </DropdownMenuPrimitive.RadioItem>
230
+ );
231
+ };
232
+
233
+ export const DropdownMenuGroupLabel = DropdownMenuPrimitive.GroupLabel;
234
+
235
+ export interface DropdownMenuLabelProps extends JSX.HTMLAttributes<HTMLDivElement> {
236
+ class?: string;
237
+ inset?: boolean;
238
+ children?: JSX.Element;
239
+ }
240
+
241
+ export const DropdownMenuLabel: Component<DropdownMenuLabelProps> = (props) => {
242
+ const [local, rest] = splitProps(props, ["class", "inset", "children"]);
243
+ const isInsideGroup = useContext(DropdownGroupContext);
244
+
245
+ const classes = () =>
246
+ cn(
247
+ "px-2 py-1.5 text-sm font-semibold text-foreground",
248
+ local.inset && "pl-8",
249
+ local.class
250
+ );
251
+
252
+ return (
253
+ <>
254
+ {isInsideGroup ? (
255
+ <DropdownMenuPrimitive.GroupLabel class={classes()} {...(rest as any)}>
256
+ {local.children}
257
+ </DropdownMenuPrimitive.GroupLabel>
258
+ ) : (
259
+ <div class={classes()} {...rest}>
260
+ {local.children}
261
+ </div>
262
+ )}
263
+ </>
264
+ );
265
+ };
266
+
267
+ export type DropdownMenuSeparatorProps<T extends ValidComponent = "hr"> =
268
+ DropdownMenuPrimitive.DropdownMenuSeparatorProps<T> & {
269
+ class?: string;
270
+ };
271
+
272
+ export const DropdownMenuSeparator = <T extends ValidComponent = "hr">(
273
+ props: PolymorphicProps<T, DropdownMenuSeparatorProps<T>>
274
+ ) => {
275
+ const [local, rest] = splitProps(props as DropdownMenuSeparatorProps, ["class"]);
276
+
277
+ return (
278
+ <DropdownMenuPrimitive.Separator
279
+ class={cn("-mx-1 my-1 h-px bg-border", local.class)}
280
+ {...(rest as any)}
281
+ />
282
+ );
283
+ };
284
+
285
+ export interface DropdownMenuShortcutProps extends JSX.HTMLAttributes<HTMLSpanElement> {
286
+ class?: string;
287
+ }
288
+
289
+ export const DropdownMenuShortcut: Component<DropdownMenuShortcutProps> = (props) => {
290
+ const [local, rest] = splitProps(props, ["class"]);
291
+
292
+ return (
293
+ <span
294
+ class={cn("ml-auto text-xs tracking-widest text-muted-foreground", local.class)}
295
+ {...rest}
296
+ />
297
+ );
298
+ };
@@ -0,0 +1,80 @@
1
+ // src/components/ui/input-group.tsx
2
+ import { splitProps, type Component, type JSX } from "solid-js";
3
+ import { cva, type VariantProps } from "class-variance-authority";
4
+ import { cn } from "@/lib/cn";
5
+
6
+ /* --- Main InputGroup Wrapper --- */
7
+ export interface InputGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {
8
+ class?: string;
9
+ }
10
+
11
+ export const InputGroup: Component<InputGroupProps> = (props) => {
12
+ const [local, rest] = splitProps(props, ["class", "children"]);
13
+
14
+ return (
15
+ <div
16
+ class={cn(
17
+ "relative flex w-full items-center rounded-md border border-input bg-muted text-sm shadow-2xs transition-colors focus-within:border-primary focus-within:ring-1 focus-within:ring-primary",
18
+ local.class
19
+ )}
20
+ {...rest}
21
+ >
22
+ {local.children}
23
+ </div>
24
+ );
25
+ };
26
+
27
+ /* --- InputGroup Addon (Prefix / Suffix) --- */
28
+ export const addonVariants = cva(
29
+ "flex items-center shrink-0 text-muted-foreground select-none",
30
+ {
31
+ variants: {
32
+ align: {
33
+ "inline-start": "order-first pl-3 pr-1",
34
+ "inline-end": "order-last pr-3 pl-1 gap-1",
35
+ },
36
+ },
37
+ defaultVariants: {
38
+ align: "inline-start",
39
+ },
40
+ }
41
+ );
42
+
43
+ export interface InputGroupAddonProps
44
+ extends JSX.HTMLAttributes<HTMLDivElement>,
45
+ VariantProps<typeof addonVariants> {
46
+ class?: string;
47
+ }
48
+
49
+ export const InputGroupAddon: Component<InputGroupAddonProps> = (props) => {
50
+ const [local, rest] = splitProps(props, ["align", "class", "children"]);
51
+
52
+ return (
53
+ <div
54
+ class={cn(addonVariants({ align: local.align }), local.class)}
55
+ {...rest}
56
+ >
57
+ {local.children}
58
+ </div>
59
+ );
60
+ };
61
+
62
+ /* --- InputGroup Native Input --- */
63
+ export interface InputGroupInputProps
64
+ extends JSX.InputHTMLAttributes<HTMLInputElement> {
65
+ class?: string;
66
+ }
67
+
68
+ export const InputGroupInput: Component<InputGroupInputProps> = (props) => {
69
+ const [local, rest] = splitProps(props, ["class"]);
70
+
71
+ return (
72
+ <input
73
+ class={cn(
74
+ "flex h-9 w-full flex-1 border-0 px-2.5 py-1 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
75
+ local.class
76
+ )}
77
+ {...rest}
78
+ />
79
+ );
80
+ };
@@ -0,0 +1,73 @@
1
+ // src/components/ui/kbd.tsx
2
+ import { splitProps, type Component, type JSX } from "solid-js";
3
+ import { cva, type VariantProps } from "class-variance-authority";
4
+ import { cn } from "@/lib/cn";
5
+
6
+ export const kbdVariants = cva(
7
+ "pointer-events-none inline-flex select-none items-center justify-center gap-1 rounded border border-border bg-muted font-mono font-medium text-muted-foreground shadow-2xs transition-colors",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "border-border bg-muted text-muted-foreground",
12
+ outline: "border-border bg-transparent text-foreground",
13
+ },
14
+ size: {
15
+ sm: "h-4 min-w-[16px] px-1 text-[9px]",
16
+ md: "h-5 min-w-[20px] px-1.5 text-[10px]",
17
+ lg: "h-6 min-w-[24px] px-2 text-xs",
18
+ },
19
+ },
20
+ defaultVariants: {
21
+ variant: "default",
22
+ size: "md",
23
+ },
24
+ }
25
+ );
26
+
27
+ export interface KbdProps
28
+ extends JSX.HTMLAttributes<HTMLElement>,
29
+ VariantProps<typeof kbdVariants> {
30
+ class?: string;
31
+ }
32
+
33
+ /**
34
+ * Nikala UI Kbd (Keyboard Key) Component.
35
+ */
36
+ export const Kbd: Component<KbdProps> = (props) => {
37
+ const [local, rest] = splitProps(props, [
38
+ "variant",
39
+ "size",
40
+ "class",
41
+ "children",
42
+ ]);
43
+
44
+ return (
45
+ <kbd
46
+ class={cn(
47
+ kbdVariants({ variant: local.variant, size: local.size }),
48
+ local.class
49
+ )}
50
+ {...rest}
51
+ >
52
+ {local.children}
53
+ </kbd>
54
+ );
55
+ };
56
+
57
+ /* --- Kbd Group Container --- */
58
+ export interface KbdGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {
59
+ class?: string;
60
+ }
61
+
62
+ export const KbdGroup: Component<KbdGroupProps> = (props) => {
63
+ const [local, rest] = splitProps(props, ["class", "children"]);
64
+
65
+ return (
66
+ <div
67
+ class={cn("inline-flex items-center gap-1", local.class)}
68
+ {...rest}
69
+ >
70
+ {local.children}
71
+ </div>
72
+ );
73
+ };
@@ -0,0 +1,222 @@
1
+ // src/components/ui/list.tsx
2
+ import {
3
+ splitProps,
4
+ Show,
5
+ type Component,
6
+ type JSX,
7
+ } from "solid-js";
8
+ import { Dynamic } from "solid-js/web";
9
+ import { cva, type VariantProps } from "class-variance-authority";
10
+ import { ChevronRight } from "lucide-solid";
11
+ import { cn } from "@/lib/cn";
12
+
13
+ /* --- List Container --- */
14
+ export interface ListProps extends JSX.HTMLAttributes<HTMLDivElement> {
15
+ class?: string;
16
+ }
17
+
18
+ export const List: Component<ListProps> = (props) => {
19
+ const [local, rest] = splitProps(props, ["class", "children"]);
20
+ return (
21
+ <div role="list" class={cn("flex flex-col gap-1 w-full p-1", local.class)} {...rest}>
22
+ {local.children}
23
+ </div>
24
+ );
25
+ };
26
+
27
+ /* --- List Group Container --- */
28
+ export interface ListGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {
29
+ class?: string;
30
+ }
31
+
32
+ export const ListGroup: Component<ListGroupProps> = (props) => {
33
+ const [local, rest] = splitProps(props, ["class", "children"]);
34
+ return (
35
+ <div class={cn("flex flex-col gap-1 w-full", local.class)} {...rest}>
36
+ {local.children}
37
+ </div>
38
+ );
39
+ };
40
+
41
+ /* --- List Group Header --- */
42
+ export interface ListHeaderProps extends JSX.HTMLAttributes<HTMLDivElement> {
43
+ title: string;
44
+ class?: string;
45
+ }
46
+
47
+ export const ListHeader: Component<ListHeaderProps> = (props) => {
48
+ const [local, rest] = splitProps(props, ["title", "class"]);
49
+ return (
50
+ <div
51
+ class={cn(
52
+ "px-2 py-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground select-none",
53
+ local.class
54
+ )}
55
+ {...rest}
56
+ >
57
+ {local.title}
58
+ </div>
59
+ );
60
+ };
61
+
62
+ /* --- List Item Variants --- */
63
+ export const listItemVariants = cva(
64
+ "group relative flex w-full items-center justify-between gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors outline-none cursor-pointer select-none disabled:pointer-events-none disabled:opacity-50 transform duration-150 ease-in-out",
65
+ {
66
+ variants: {
67
+ hoverVariant: {
68
+ default:
69
+ "hover:bg-accent hover:text-accent-foreground data-highlighted:bg-accent data-highlighted:text-accent-foreground",
70
+ accent:
71
+ "hover:bg-accent/80 hover:text-accent-foreground data-highlighted:bg-accent/80",
72
+ primary:
73
+ "hover:bg-primary/10 hover:text-primary data-highlighted:bg-primary/10 data-highlighted:text-primary",
74
+ muted:
75
+ "hover:bg-muted hover:text-foreground data-highlighted:bg-muted",
76
+ },
77
+ size: {
78
+ sm: "px-2.5 py-1.5 text-xs",
79
+ md: "px-3 py-2 text-sm",
80
+ lg: "px-4 py-3 text-base",
81
+ },
82
+ active: {
83
+ true: "bg-accent text-accent-foreground font-semibold",
84
+ false: "",
85
+ },
86
+ },
87
+ defaultVariants: {
88
+ hoverVariant: "default",
89
+ size: "md",
90
+ active: false,
91
+ },
92
+ }
93
+ );
94
+
95
+ export interface ListItemProps
96
+ extends JSX.HTMLAttributes<HTMLDivElement>,
97
+ VariantProps<typeof listItemVariants> {
98
+ title?: string;
99
+ subtitle?: string;
100
+ avatar?: string;
101
+ avatarFallback?: string;
102
+ icon?: Component<{ class?: string }>;
103
+ shortcut?: string;
104
+ showChevron?: boolean;
105
+ href?: string;
106
+ disabled?: boolean;
107
+ active?: boolean;
108
+ class?: string;
109
+ }
110
+
111
+ /**
112
+ * Nikala UI ListItem Component.
113
+ */
114
+ export const ListItem: Component<ListItemProps> = (props) => {
115
+ const [local, rest] = splitProps(props, [
116
+ "title",
117
+ "subtitle",
118
+ "avatar",
119
+ "avatarFallback",
120
+ "icon",
121
+ "shortcut",
122
+ "showChevron",
123
+ "href",
124
+ "disabled",
125
+ "active",
126
+ "hoverVariant",
127
+ "size",
128
+ "class",
129
+ "children",
130
+ ]);
131
+
132
+ const content = () => (
133
+ <>
134
+ {/* Left Visual: Icon, Avatar, or Image */}
135
+ <div class="flex items-center gap-2.5 min-w-0">
136
+ <Show when={local.avatar}>
137
+ <img
138
+ src={local.avatar}
139
+ alt={local.title || "Avatar"}
140
+ class="w-10 h-10 rounded-lg object-cover shrink-0 border border-border"
141
+ />
142
+ </Show>
143
+
144
+ <Show when={!local.avatar && local.avatarFallback}>
145
+ <span class="w-10 h-10 rounded-lg bg-primary/10 text-primary text-[10px] font-bold flex items-center justify-center shrink-0 uppercase">
146
+ {local.avatarFallback}
147
+ </span>
148
+ </Show>
149
+
150
+ <Show when={!local.avatar && !local.avatarFallback && local.icon}>
151
+ <span class="shrink-0 text-muted-foreground group-hover:text-foreground transition-colors">
152
+ <Dynamic component={local.icon} class="w-4 h-4" />
153
+ </span>
154
+ </Show>
155
+
156
+ {/* Main Text Content */}
157
+ <div class="flex flex-col min-w-0 text-left">
158
+ <Show when={local.title}>
159
+ <span class="truncate font-medium leading-none">
160
+ {local.title}
161
+ </span>
162
+ </Show>
163
+ <Show when={local.subtitle}>
164
+ <span class="truncate text-xs opacity-50 font-normal mt-1">
165
+ {local.subtitle}
166
+ </span>
167
+ </Show>
168
+ {local.children}
169
+ </div>
170
+ </div>
171
+
172
+ {/* Right Visual: Shortcut Badge & Trailing Chevron */}
173
+ <div class="flex items-center gap-2 shrink-0">
174
+ <Show when={local.shortcut}>
175
+ <kbd class="pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground">
176
+ {local.shortcut}
177
+ </kbd>
178
+ </Show>
179
+
180
+ <Show when={local.showChevron}>
181
+ <ChevronRight class="w-4 h-4 text-muted-foreground transition-colors" />
182
+ </Show>
183
+ </div>
184
+ </>
185
+ );
186
+
187
+ const itemClasses = () =>
188
+ cn(
189
+ listItemVariants({
190
+ hoverVariant: local.hoverVariant,
191
+ size: local.size,
192
+ active: local.active,
193
+ }),
194
+ local.class
195
+ );
196
+
197
+ return (
198
+ <Show
199
+ when={local.href}
200
+ fallback={
201
+ <div
202
+ role="listitem"
203
+ class={itemClasses()}
204
+ aria-disabled={local.disabled}
205
+ {...rest}
206
+ >
207
+ {content()}
208
+ </div>
209
+ }
210
+ >
211
+ <a
212
+ role="listitem"
213
+ href={local.href}
214
+ class={itemClasses()}
215
+ aria-disabled={local.disabled}
216
+ {...(rest as JSX.AnchorHTMLAttributes<HTMLAnchorElement>)}
217
+ >
218
+ {content()}
219
+ </a>
220
+ </Show>
221
+ );
222
+ };