@neurocode-ai/ui 1.18.8

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 (356) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +113 -0
  3. package/src/assets/audio/alert-01.aac +0 -0
  4. package/src/assets/audio/alert-01.mp3 +0 -0
  5. package/src/assets/audio/alert-02.aac +0 -0
  6. package/src/assets/audio/alert-02.mp3 +0 -0
  7. package/src/assets/audio/alert-03.aac +0 -0
  8. package/src/assets/audio/alert-03.mp3 +0 -0
  9. package/src/assets/audio/alert-04.aac +0 -0
  10. package/src/assets/audio/alert-04.mp3 +0 -0
  11. package/src/assets/audio/alert-05.aac +0 -0
  12. package/src/assets/audio/alert-05.mp3 +0 -0
  13. package/src/assets/audio/alert-06.aac +0 -0
  14. package/src/assets/audio/alert-06.mp3 +0 -0
  15. package/src/assets/audio/alert-07.aac +0 -0
  16. package/src/assets/audio/alert-07.mp3 +0 -0
  17. package/src/assets/audio/alert-08.aac +0 -0
  18. package/src/assets/audio/alert-08.mp3 +0 -0
  19. package/src/assets/audio/alert-09.aac +0 -0
  20. package/src/assets/audio/alert-09.mp3 +0 -0
  21. package/src/assets/audio/alert-10.aac +0 -0
  22. package/src/assets/audio/alert-10.mp3 +0 -0
  23. package/src/assets/audio/bip-bop-01.aac +0 -0
  24. package/src/assets/audio/bip-bop-01.mp3 +0 -0
  25. package/src/assets/audio/bip-bop-02.aac +0 -0
  26. package/src/assets/audio/bip-bop-02.mp3 +0 -0
  27. package/src/assets/audio/bip-bop-03.aac +0 -0
  28. package/src/assets/audio/bip-bop-03.mp3 +0 -0
  29. package/src/assets/audio/bip-bop-04.aac +0 -0
  30. package/src/assets/audio/bip-bop-04.mp3 +0 -0
  31. package/src/assets/audio/bip-bop-05.aac +0 -0
  32. package/src/assets/audio/bip-bop-05.mp3 +0 -0
  33. package/src/assets/audio/bip-bop-06.aac +0 -0
  34. package/src/assets/audio/bip-bop-06.mp3 +0 -0
  35. package/src/assets/audio/bip-bop-07.aac +0 -0
  36. package/src/assets/audio/bip-bop-07.mp3 +0 -0
  37. package/src/assets/audio/bip-bop-08.aac +0 -0
  38. package/src/assets/audio/bip-bop-08.mp3 +0 -0
  39. package/src/assets/audio/bip-bop-09.aac +0 -0
  40. package/src/assets/audio/bip-bop-09.mp3 +0 -0
  41. package/src/assets/audio/bip-bop-10.aac +0 -0
  42. package/src/assets/audio/bip-bop-10.mp3 +0 -0
  43. package/src/assets/audio/nope-01.aac +0 -0
  44. package/src/assets/audio/nope-01.mp3 +0 -0
  45. package/src/assets/audio/nope-02.aac +0 -0
  46. package/src/assets/audio/nope-02.mp3 +0 -0
  47. package/src/assets/audio/nope-03.aac +0 -0
  48. package/src/assets/audio/nope-03.mp3 +0 -0
  49. package/src/assets/audio/nope-04.aac +0 -0
  50. package/src/assets/audio/nope-04.mp3 +0 -0
  51. package/src/assets/audio/nope-05.aac +0 -0
  52. package/src/assets/audio/nope-05.mp3 +0 -0
  53. package/src/assets/audio/nope-06.aac +0 -0
  54. package/src/assets/audio/nope-06.mp3 +0 -0
  55. package/src/assets/audio/nope-07.aac +0 -0
  56. package/src/assets/audio/nope-07.mp3 +0 -0
  57. package/src/assets/audio/nope-08.aac +0 -0
  58. package/src/assets/audio/nope-08.mp3 +0 -0
  59. package/src/assets/audio/nope-09.aac +0 -0
  60. package/src/assets/audio/nope-09.mp3 +0 -0
  61. package/src/assets/audio/nope-10.aac +0 -0
  62. package/src/assets/audio/nope-10.mp3 +0 -0
  63. package/src/assets/audio/nope-11.aac +0 -0
  64. package/src/assets/audio/nope-11.mp3 +0 -0
  65. package/src/assets/audio/nope-12.aac +0 -0
  66. package/src/assets/audio/nope-12.mp3 +0 -0
  67. package/src/assets/audio/staplebops-01.aac +0 -0
  68. package/src/assets/audio/staplebops-01.mp3 +0 -0
  69. package/src/assets/audio/staplebops-02.aac +0 -0
  70. package/src/assets/audio/staplebops-02.mp3 +0 -0
  71. package/src/assets/audio/staplebops-03.aac +0 -0
  72. package/src/assets/audio/staplebops-03.mp3 +0 -0
  73. package/src/assets/audio/staplebops-04.aac +0 -0
  74. package/src/assets/audio/staplebops-04.mp3 +0 -0
  75. package/src/assets/audio/staplebops-05.aac +0 -0
  76. package/src/assets/audio/staplebops-05.mp3 +0 -0
  77. package/src/assets/audio/staplebops-06.aac +0 -0
  78. package/src/assets/audio/staplebops-06.mp3 +0 -0
  79. package/src/assets/audio/staplebops-07.aac +0 -0
  80. package/src/assets/audio/staplebops-07.mp3 +0 -0
  81. package/src/assets/audio/yup-01.aac +0 -0
  82. package/src/assets/audio/yup-01.mp3 +0 -0
  83. package/src/assets/audio/yup-02.aac +0 -0
  84. package/src/assets/audio/yup-02.mp3 +0 -0
  85. package/src/assets/audio/yup-03.aac +0 -0
  86. package/src/assets/audio/yup-03.mp3 +0 -0
  87. package/src/assets/audio/yup-04.aac +0 -0
  88. package/src/assets/audio/yup-04.mp3 +0 -0
  89. package/src/assets/audio/yup-05.aac +0 -0
  90. package/src/assets/audio/yup-05.mp3 +0 -0
  91. package/src/assets/audio/yup-06.aac +0 -0
  92. package/src/assets/audio/yup-06.mp3 +0 -0
  93. package/src/assets/fonts/Inter.ttf +0 -0
  94. package/src/assets/fonts/JetBrainsMonoNerdFontMono-Regular.woff2 +0 -0
  95. package/src/assets/icons/app/android-studio.svg +369 -0
  96. package/src/assets/icons/app/antigravity.svg +97 -0
  97. package/src/assets/icons/app/cursor.svg +16 -0
  98. package/src/assets/icons/app/file-explorer.svg +20 -0
  99. package/src/assets/icons/app/finder.png +0 -0
  100. package/src/assets/icons/app/ghostty.svg +13 -0
  101. package/src/assets/icons/app/iterm2.svg +13 -0
  102. package/src/assets/icons/app/powershell.svg +14 -0
  103. package/src/assets/icons/app/sublimetext.svg +17 -0
  104. package/src/assets/icons/app/terminal.png +0 -0
  105. package/src/assets/icons/app/textmate.png +0 -0
  106. package/src/assets/icons/app/vscode.svg +39 -0
  107. package/src/assets/icons/app/warp.png +0 -0
  108. package/src/assets/icons/app/xcode.png +0 -0
  109. package/src/assets/icons/app/zed-dark.svg +15 -0
  110. package/src/assets/icons/app/zed.svg +15 -0
  111. package/src/components/accordion.css +147 -0
  112. package/src/components/accordion.tsx +92 -0
  113. package/src/components/animated-number.css +75 -0
  114. package/src/components/animated-number.tsx +109 -0
  115. package/src/components/app-icon.css +5 -0
  116. package/src/components/app-icon.tsx +85 -0
  117. package/src/components/app-icons/sprite.svg +114 -0
  118. package/src/components/app-icons/types.ts +21 -0
  119. package/src/components/avatar.css +49 -0
  120. package/src/components/avatar.tsx +55 -0
  121. package/src/components/button.css +194 -0
  122. package/src/components/button.tsx +33 -0
  123. package/src/components/card.css +115 -0
  124. package/src/components/card.tsx +123 -0
  125. package/src/components/checkbox.css +131 -0
  126. package/src/components/checkbox.tsx +43 -0
  127. package/src/components/collapsible.css +154 -0
  128. package/src/components/collapsible.tsx +48 -0
  129. package/src/components/context-menu.css +134 -0
  130. package/src/components/context-menu.tsx +308 -0
  131. package/src/components/dialog.css +181 -0
  132. package/src/components/dialog.tsx +72 -0
  133. package/src/components/diff-changes.css +42 -0
  134. package/src/components/diff-changes.tsx +115 -0
  135. package/src/components/dock-surface.css +37 -0
  136. package/src/components/dock-surface.tsx +54 -0
  137. package/src/components/dropdown-menu.css +135 -0
  138. package/src/components/dropdown-menu.tsx +308 -0
  139. package/src/components/favicon.tsx +13 -0
  140. package/src/components/file-icon.css +26 -0
  141. package/src/components/file-icon.tsx +588 -0
  142. package/src/components/file-icons/sprite.svg +11707 -0
  143. package/src/components/file-icons/types.ts +1095 -0
  144. package/src/components/font.tsx +1 -0
  145. package/src/components/hover-card.css +61 -0
  146. package/src/components/hover-card.tsx +32 -0
  147. package/src/components/icon-button.css +181 -0
  148. package/src/components/icon-button.tsx +29 -0
  149. package/src/components/icon.css +34 -0
  150. package/src/components/icon.tsx +170 -0
  151. package/src/components/image-preview.css +63 -0
  152. package/src/components/image-preview.tsx +32 -0
  153. package/src/components/inline-input.css +17 -0
  154. package/src/components/inline-input.tsx +22 -0
  155. package/src/components/keybind.css +18 -0
  156. package/src/components/keybind.tsx +20 -0
  157. package/src/components/list.css +331 -0
  158. package/src/components/list.tsx +394 -0
  159. package/src/components/logo.css +4 -0
  160. package/src/components/logo.tsx +62 -0
  161. package/src/components/motion-spring.tsx +58 -0
  162. package/src/components/popover.css +98 -0
  163. package/src/components/popover.tsx +153 -0
  164. package/src/components/progress-circle.css +16 -0
  165. package/src/components/progress-circle.tsx +64 -0
  166. package/src/components/progress.css +63 -0
  167. package/src/components/progress.tsx +39 -0
  168. package/src/components/provider-icon.css +5 -0
  169. package/src/components/provider-icon.tsx +25 -0
  170. package/src/components/provider-icons/sprite.svg +1135 -0
  171. package/src/components/provider-icons/types.ts +105 -0
  172. package/src/components/radio-group.css +187 -0
  173. package/src/components/radio-group.tsx +83 -0
  174. package/src/components/resize-handle.css +58 -0
  175. package/src/components/resize-handle.tsx +98 -0
  176. package/src/components/scroll-view.css +67 -0
  177. package/src/components/scroll-view.tsx +388 -0
  178. package/src/components/select.css +199 -0
  179. package/src/components/select.tsx +174 -0
  180. package/src/components/spinner.css +6 -0
  181. package/src/components/spinner.tsx +52 -0
  182. package/src/components/sticky-accordion-header.css +6 -0
  183. package/src/components/sticky-accordion-header.tsx +18 -0
  184. package/src/components/switch.css +132 -0
  185. package/src/components/switch.tsx +29 -0
  186. package/src/components/tabs.css +861 -0
  187. package/src/components/tabs.tsx +125 -0
  188. package/src/components/tag.css +37 -0
  189. package/src/components/tag.tsx +22 -0
  190. package/src/components/text-field.css +134 -0
  191. package/src/components/text-field.tsx +128 -0
  192. package/src/components/text-reveal.css +150 -0
  193. package/src/components/text-reveal.tsx +143 -0
  194. package/src/components/text-shimmer.css +119 -0
  195. package/src/components/text-shimmer.tsx +62 -0
  196. package/src/components/text-strikethrough.css +27 -0
  197. package/src/components/text-strikethrough.tsx +84 -0
  198. package/src/components/toast.css +236 -0
  199. package/src/components/toast.tsx +185 -0
  200. package/src/components/tooltip.css +74 -0
  201. package/src/components/tooltip.tsx +163 -0
  202. package/src/components/typewriter.css +14 -0
  203. package/src/components/typewriter.tsx +55 -0
  204. package/src/context/dialog.tsx +197 -0
  205. package/src/context/file.tsx +10 -0
  206. package/src/context/helper.tsx +38 -0
  207. package/src/context/i18n.tsx +38 -0
  208. package/src/context/index.ts +4 -0
  209. package/src/context/marked-code-span.ts +17 -0
  210. package/src/context/marked.tsx +570 -0
  211. package/src/context/worker-pool.tsx +20 -0
  212. package/src/custom-elements.d.ts +17 -0
  213. package/src/hooks/create-auto-scroll.tsx +237 -0
  214. package/src/hooks/index.ts +2 -0
  215. package/src/hooks/use-filtered-list.tsx +134 -0
  216. package/src/i18n/ar.ts +193 -0
  217. package/src/i18n/br.ts +193 -0
  218. package/src/i18n/bs.ts +197 -0
  219. package/src/i18n/da.ts +192 -0
  220. package/src/i18n/de.ts +199 -0
  221. package/src/i18n/en.ts +196 -0
  222. package/src/i18n/es.ts +193 -0
  223. package/src/i18n/fr.ts +193 -0
  224. package/src/i18n/ja.ts +192 -0
  225. package/src/i18n/ko.ts +194 -0
  226. package/src/i18n/no.ts +197 -0
  227. package/src/i18n/pl.ts +192 -0
  228. package/src/i18n/ru.ts +192 -0
  229. package/src/i18n/th.ts +194 -0
  230. package/src/i18n/tr.ts +199 -0
  231. package/src/i18n/uk.ts +196 -0
  232. package/src/i18n/zh.ts +196 -0
  233. package/src/i18n/zht.ts +196 -0
  234. package/src/storybook/fixtures.ts +51 -0
  235. package/src/storybook/scaffold.tsx +62 -0
  236. package/src/styles/animations.css +141 -0
  237. package/src/styles/base.css +404 -0
  238. package/src/styles/colors.css +772 -0
  239. package/src/styles/index.css +53 -0
  240. package/src/styles/tailwind/colors.css +286 -0
  241. package/src/styles/tailwind/index.css +78 -0
  242. package/src/styles/tailwind/utilities.css +131 -0
  243. package/src/styles/theme.css +631 -0
  244. package/src/styles/utilities.css +118 -0
  245. package/src/theme/color.ts +299 -0
  246. package/src/theme/context.tsx +373 -0
  247. package/src/theme/default-themes.ts +116 -0
  248. package/src/theme/index.ts +78 -0
  249. package/src/theme/loader.ts +112 -0
  250. package/src/theme/resolve.ts +540 -0
  251. package/src/theme/themes/amoled.json +49 -0
  252. package/src/theme/themes/aura.json +51 -0
  253. package/src/theme/themes/ayu.json +51 -0
  254. package/src/theme/themes/carbonfox.json +53 -0
  255. package/src/theme/themes/catppuccin-frappe.json +85 -0
  256. package/src/theme/themes/catppuccin-macchiato.json +85 -0
  257. package/src/theme/themes/catppuccin.json +45 -0
  258. package/src/theme/themes/cobalt2.json +87 -0
  259. package/src/theme/themes/cursor.json +91 -0
  260. package/src/theme/themes/dracula.json +49 -0
  261. package/src/theme/themes/everforest.json +89 -0
  262. package/src/theme/themes/flexoki.json +86 -0
  263. package/src/theme/themes/github.json +85 -0
  264. package/src/theme/themes/gruvbox.json +45 -0
  265. package/src/theme/themes/kanagawa.json +89 -0
  266. package/src/theme/themes/lucent-orng.json +87 -0
  267. package/src/theme/themes/material.json +87 -0
  268. package/src/theme/themes/matrix.json +113 -0
  269. package/src/theme/themes/mercury.json +86 -0
  270. package/src/theme/themes/monokai.json +49 -0
  271. package/src/theme/themes/nightowl.json +46 -0
  272. package/src/theme/themes/nord.json +46 -0
  273. package/src/theme/themes/oc-2.json +474 -0
  274. package/src/theme/themes/one-dark.json +89 -0
  275. package/src/theme/themes/onedarkpro.json +45 -0
  276. package/src/theme/themes/opencode.json +89 -0
  277. package/src/theme/themes/orng.json +87 -0
  278. package/src/theme/themes/osaka-jade.json +88 -0
  279. package/src/theme/themes/palenight.json +85 -0
  280. package/src/theme/themes/rosepine.json +85 -0
  281. package/src/theme/themes/shadesofpurple.json +51 -0
  282. package/src/theme/themes/solarized.json +49 -0
  283. package/src/theme/themes/synthwave84.json +87 -0
  284. package/src/theme/themes/tokyonight.json +47 -0
  285. package/src/theme/themes/vercel.json +90 -0
  286. package/src/theme/themes/vesper.json +51 -0
  287. package/src/theme/themes/zenburn.json +87 -0
  288. package/src/theme/types.ts +75 -0
  289. package/src/theme/v2/avatar.ts +48 -0
  290. package/src/theme/v2/default-primitives.ts +114 -0
  291. package/src/theme/v2/foreground.ts +60 -0
  292. package/src/theme/v2/mapping.ts +170 -0
  293. package/src/theme/v2/resolve.ts +153 -0
  294. package/src/v2/components/accordion-v2.css +139 -0
  295. package/src/v2/components/accordion-v2.tsx +86 -0
  296. package/src/v2/components/avatar-v2.css +70 -0
  297. package/src/v2/components/avatar-v2.tsx +59 -0
  298. package/src/v2/components/badge-v2.css +33 -0
  299. package/src/v2/components/badge-v2.tsx +23 -0
  300. package/src/v2/components/button-v2.css +262 -0
  301. package/src/v2/components/button-v2.tsx +35 -0
  302. package/src/v2/components/checkbox-v2.css +184 -0
  303. package/src/v2/components/checkbox-v2.tsx +65 -0
  304. package/src/v2/components/dialog-v2.css +177 -0
  305. package/src/v2/components/dialog-v2.tsx +115 -0
  306. package/src/v2/components/diff-changes-v2.css +24 -0
  307. package/src/v2/components/diff-changes-v2.tsx +28 -0
  308. package/src/v2/components/divider-v2.css +11 -0
  309. package/src/v2/components/divider-v2.tsx +20 -0
  310. package/src/v2/components/field-v2.css +94 -0
  311. package/src/v2/components/field-v2.tsx +265 -0
  312. package/src/v2/components/file-tree-v2.css +137 -0
  313. package/src/v2/components/icon-button-v2.css +159 -0
  314. package/src/v2/components/icon-button-v2.tsx +37 -0
  315. package/src/v2/components/icon.tsx +209 -0
  316. package/src/v2/components/inline-input-v2.css +225 -0
  317. package/src/v2/components/inline-input-v2.tsx +105 -0
  318. package/src/v2/components/keybind-v2.css +76 -0
  319. package/src/v2/components/keybind-v2.tsx +30 -0
  320. package/src/v2/components/line-comment-v2.css +258 -0
  321. package/src/v2/components/line-comment-v2.tsx +304 -0
  322. package/src/v2/components/loader-v2.css +32 -0
  323. package/src/v2/components/loader-v2.tsx +31 -0
  324. package/src/v2/components/menu-v2.css +190 -0
  325. package/src/v2/components/menu-v2.tsx +225 -0
  326. package/src/v2/components/progress-circle-v2.css +13 -0
  327. package/src/v2/components/progress-circle-v2.tsx +52 -0
  328. package/src/v2/components/project-avatar-v2.css +132 -0
  329. package/src/v2/components/project-avatar-v2.tsx +66 -0
  330. package/src/v2/components/radio-v2.css +202 -0
  331. package/src/v2/components/radio-v2.tsx +72 -0
  332. package/src/v2/components/segmented-control-v2.css +80 -0
  333. package/src/v2/components/segmented-control-v2.tsx +208 -0
  334. package/src/v2/components/select-v2.css +286 -0
  335. package/src/v2/components/select-v2.tsx +208 -0
  336. package/src/v2/components/split-button-v2.css +99 -0
  337. package/src/v2/components/split-button-v2.tsx +48 -0
  338. package/src/v2/components/switch-v2.css +154 -0
  339. package/src/v2/components/switch-v2.tsx +28 -0
  340. package/src/v2/components/tab-state-indicator.tsx +37 -0
  341. package/src/v2/components/tabs-v2.css +226 -0
  342. package/src/v2/components/tabs-v2.tsx +147 -0
  343. package/src/v2/components/text-input-v2.css +179 -0
  344. package/src/v2/components/text-input-v2.tsx +93 -0
  345. package/src/v2/components/text-shimmer-v2.css +125 -0
  346. package/src/v2/components/text-shimmer-v2.tsx +63 -0
  347. package/src/v2/components/textarea-v2.css +78 -0
  348. package/src/v2/components/textarea-v2.tsx +31 -0
  349. package/src/v2/components/toast-v2.css +215 -0
  350. package/src/v2/components/toast-v2.tsx +146 -0
  351. package/src/v2/components/tooltip-v2.css +69 -0
  352. package/src/v2/components/tooltip-v2.tsx +147 -0
  353. package/src/v2/components/wordmark-v2.tsx +71 -0
  354. package/src/v2/styles/colors.css +172 -0
  355. package/src/v2/styles/tailwind.css +2 -0
  356. package/src/v2/styles/theme.css +503 -0
@@ -0,0 +1,258 @@
1
+ * {
2
+ -webkit-font-smoothing: antialiased;
3
+ -moz-osx-font-smoothing: grayscale;
4
+ text-rendering: geometricPrecision;
5
+ }
6
+
7
+ [data-component="line-comment-v2"] {
8
+ box-sizing: border-box;
9
+ font-family: var(--v2-font-family-sans);
10
+ font-variant-numeric: tabular-nums;
11
+ min-width: 0;
12
+ width: 100%;
13
+ max-width: 400px;
14
+ }
15
+
16
+ [data-component="line-comment-v2"] *,
17
+ [data-component="line-comment-v2"] *::before,
18
+ [data-component="line-comment-v2"] *::after {
19
+ box-sizing: border-box;
20
+ }
21
+
22
+ [data-component="line-comment-v2"] [data-slot="line-comment-v2-shell"] {
23
+ background: var(--v2-background-bg-layer-01);
24
+ border-radius: 6px;
25
+ box-shadow: var(--v2-elevation-raised);
26
+ }
27
+
28
+ /* --- Display (read) --- */
29
+ [data-component="line-comment-v2"][data-variant="display"] [data-slot="line-comment-v2-shell"] {
30
+ display: flex;
31
+ flex-direction: row;
32
+ align-items: flex-start;
33
+ padding: 12px;
34
+ gap: 8px;
35
+ }
36
+
37
+ [data-component="line-comment-v2"][data-variant="display"] [data-slot="line-comment-v2-column"] {
38
+ display: flex;
39
+ flex-direction: column;
40
+ align-items: flex-start;
41
+ gap: 8px;
42
+ flex: 1 1 auto;
43
+ min-width: 0;
44
+ }
45
+
46
+ [data-component="line-comment-v2"][data-variant="display"] [data-slot="line-comment-v2-text"] {
47
+ margin: 0;
48
+ width: 100%;
49
+ font-size: 13px;
50
+ font-style: normal;
51
+ font-weight: 440;
52
+ line-height: 1;
53
+ letter-spacing: -0.04px;
54
+ color: var(--v2-text-text-base);
55
+ font-variation-settings: "slnt" 0;
56
+ }
57
+
58
+ [data-component="line-comment-v2"][data-variant="display"] [data-slot="line-comment-v2-meta"] {
59
+ font-size: 11px;
60
+ font-style: normal;
61
+ font-weight: 530;
62
+ line-height: 1;
63
+ letter-spacing: 0.05px;
64
+ color: var(--v2-text-text-faint);
65
+ font-variation-settings: "slnt" 0;
66
+ }
67
+
68
+ [data-component="line-comment-v2"][data-variant="display"] [data-slot="line-comment-v2-tools"] {
69
+ display: flex;
70
+ flex-direction: row;
71
+ align-items: flex-start;
72
+ flex-shrink: 0;
73
+ }
74
+
75
+ [data-slot="line-comment-v2-overflow"] {
76
+ display: inline-flex;
77
+ flex-direction: row;
78
+ justify-content: center;
79
+ align-items: center;
80
+ width: 20px;
81
+ height: 20px;
82
+ padding: 2px;
83
+ gap: 3px;
84
+ margin: 0;
85
+ border: none;
86
+ border-radius: 4px;
87
+ background: transparent;
88
+ color: var(--v2-icon-icon-muted);
89
+ cursor: pointer;
90
+ outline: none;
91
+ }
92
+
93
+ [data-slot="line-comment-v2-overflow"]:focus {
94
+ outline: none;
95
+ }
96
+
97
+ [data-slot="line-comment-v2-overflow"]:focus-visible {
98
+ outline: 2px solid var(--v2-border-border-focus);
99
+ outline-offset: 2px;
100
+ }
101
+
102
+ [data-slot="line-comment-v2-overflow"]:is(:hover, [data-state="hover"]) {
103
+ background-color: var(--v2-overlay-simple-overlay-hover);
104
+ }
105
+
106
+ [data-slot="line-comment-v2-overflow"]:is(:active, [data-state="pressed"]) {
107
+ background-color: var(--v2-overlay-simple-overlay-pressed);
108
+ }
109
+
110
+ [data-slot="line-comment-v2-overflow"] svg {
111
+ display: block;
112
+ flex-shrink: 0;
113
+ }
114
+
115
+ /* --- Editor --- */
116
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-shell"] {
117
+ display: flex;
118
+ flex-direction: column;
119
+ align-items: flex-start;
120
+ padding: 12px;
121
+ gap: 12px;
122
+ }
123
+
124
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-field"] {
125
+ display: flex;
126
+ flex-direction: column;
127
+ align-items: flex-start;
128
+ gap: 8px;
129
+ width: 100%;
130
+ min-width: 0;
131
+ }
132
+
133
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-label"] {
134
+ display: flex;
135
+ flex-direction: row;
136
+ align-items: center;
137
+ width: 100%;
138
+ font-size: 13px;
139
+ font-style: normal;
140
+ font-weight: 530;
141
+ line-height: 1;
142
+ letter-spacing: -0.04px;
143
+ color: var(--v2-text-text-base);
144
+ user-select: none;
145
+ }
146
+
147
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-textarea"] {
148
+ display: block;
149
+ width: 100%;
150
+ min-width: 0;
151
+ min-height: 80px;
152
+ padding: 8px;
153
+ margin: 0;
154
+ resize: vertical;
155
+ border: 1px solid var(--v2-border-border-base);
156
+ border-radius: 6px;
157
+ background:
158
+ linear-gradient(180deg, var(--v2-alpha-light-2) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-base);
159
+ font-size: 13px;
160
+ font-style: normal;
161
+ font-weight: 440;
162
+ line-height: 1.35;
163
+ letter-spacing: -0.04px;
164
+ color: var(--v2-text-text-base);
165
+ font-variation-settings: "slnt" 0;
166
+ outline: none;
167
+ }
168
+
169
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-textarea"]::placeholder {
170
+ color: var(--v2-text-text-faint);
171
+ user-select: none;
172
+ }
173
+
174
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-textarea"]:focus {
175
+ border-color: var(--v2-border-border-focus);
176
+ }
177
+
178
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-footer"] {
179
+ display: flex;
180
+ flex-direction: row;
181
+ align-items: center;
182
+ gap: 4px;
183
+ width: 100%;
184
+ min-width: 0;
185
+ }
186
+
187
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-footer-meta"] {
188
+ flex: 1 1 auto;
189
+ min-width: 0;
190
+ font-size: 11px;
191
+ font-style: normal;
192
+ font-weight: 530;
193
+ line-height: 1;
194
+ letter-spacing: 0.05px;
195
+ color: var(--v2-text-text-faint);
196
+ font-variation-settings: "slnt" 0;
197
+ }
198
+
199
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-footer-actions"] {
200
+ display: flex;
201
+ flex-direction: row;
202
+ align-items: center;
203
+ gap: 8px;
204
+ flex-shrink: 0;
205
+ }
206
+
207
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-mention-list"] {
208
+ display: flex;
209
+ flex-direction: column;
210
+ gap: 4px;
211
+ max-height: 180px;
212
+ overflow: auto;
213
+ margin-top: 8px;
214
+ padding: 4px;
215
+ border: 0.5px solid var(--v2-border-border-muted);
216
+ border-radius: 6px;
217
+ background: var(--v2-background-bg-layer-02);
218
+ }
219
+
220
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-mention-item"] {
221
+ display: flex;
222
+ align-items: center;
223
+ gap: 8px;
224
+ width: 100%;
225
+ min-width: 0;
226
+ padding: 6px 8px;
227
+ border: 0;
228
+ border-radius: 4px;
229
+ background: transparent;
230
+ color: var(--v2-text-text-base);
231
+ text-align: left;
232
+ cursor: pointer;
233
+ }
234
+
235
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-mention-item"][data-active] {
236
+ background: var(--v2-background-bg-layer-03);
237
+ }
238
+
239
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-mention-path"] {
240
+ display: flex;
241
+ align-items: center;
242
+ min-width: 0;
243
+ font-size: 12px;
244
+ line-height: 16px;
245
+ }
246
+
247
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-mention-dir"] {
248
+ min-width: 0;
249
+ color: var(--v2-text-text-muted);
250
+ white-space: nowrap;
251
+ overflow: hidden;
252
+ text-overflow: ellipsis;
253
+ }
254
+
255
+ [data-component="line-comment-v2"][data-variant="editor"] [data-slot="line-comment-v2-mention-file"] {
256
+ color: var(--v2-text-text-base);
257
+ white-space: nowrap;
258
+ }
@@ -0,0 +1,304 @@
1
+ import { For, Show, createSignal, onMount, splitProps, type ComponentProps, type JSX } from "solid-js"
2
+ import { FileIcon } from "../../components/file-icon"
3
+ import { useFilteredList } from "../../hooks"
4
+ import { ButtonV2 } from "./button-v2"
5
+ import "./line-comment-v2.css"
6
+
7
+ /** Horizontal “more” glyph for the display-card overflow control (Figma outline-dots). */
8
+ export function LineCommentV2OverflowIcon(props: ComponentProps<"svg">) {
9
+ return (
10
+ <svg
11
+ {...props}
12
+ width={props.width ?? 16}
13
+ height={props.height ?? 16}
14
+ viewBox="0 0 16 16"
15
+ fill="none"
16
+ xmlns="http://www.w3.org/2000/svg"
17
+ aria-hidden={props["aria-hidden"] ?? "true"}
18
+ >
19
+ <path d="M2.5 7.5H3.5V8.5H2.5V7.5Z" stroke="currentColor" />
20
+ <path d="M7.5 7.5H8.5V8.5H7.5V7.5Z" stroke="currentColor" />
21
+ <path d="M12.5 7.5H13.5V8.5H12.5V7.5Z" stroke="currentColor" />
22
+ </svg>
23
+ )
24
+ }
25
+
26
+ export interface LineCommentV2Props extends ComponentProps<"div"> {
27
+ /** Main comment body (text or rich content). */
28
+ comment: JSX.Element
29
+ /** Line / selection context (e.g. “Comment on line 40”). */
30
+ selection: JSX.Element
31
+ /** Typically an overflow menu trigger; use `LineCommentV2OverflowIcon` inside `line-comment-v2-overflow`. */
32
+ actions?: JSX.Element
33
+ }
34
+
35
+ export function LineCommentV2(props: LineCommentV2Props) {
36
+ const [local, rest] = splitProps(props, ["comment", "selection", "actions", "class", "classList"])
37
+ return (
38
+ <div
39
+ {...rest}
40
+ data-component="line-comment-v2"
41
+ data-variant="display"
42
+ classList={{
43
+ ...local.classList,
44
+ [local.class ?? ""]: !!local.class,
45
+ }}
46
+ >
47
+ <div data-slot="line-comment-v2-shell">
48
+ <div data-slot="line-comment-v2-column">
49
+ <div data-slot="line-comment-v2-text">{local.comment}</div>
50
+ <div data-slot="line-comment-v2-meta">{local.selection}</div>
51
+ </div>
52
+ <Show when={local.actions}>{(actions) => <div data-slot="line-comment-v2-tools">{actions()}</div>}</Show>
53
+ </div>
54
+ </div>
55
+ )
56
+ }
57
+
58
+ export type LineCommentEditorV2Mention = {
59
+ items: (query: string) => string[] | Promise<string[]>
60
+ }
61
+
62
+ export interface LineCommentEditorV2Props extends Omit<ComponentProps<"div">, "children" | "onInput" | "onSubmit"> {
63
+ /** Visible field label above the textarea (default: “Comment”). */
64
+ heading?: JSX.Element | string
65
+ value: string
66
+ onInput: (value: string) => void
67
+ onCancel: () => void
68
+ onSubmit: (value: string) => void
69
+ selection: JSX.Element
70
+ placeholder?: string
71
+ rows?: number
72
+ cancelLabel?: string
73
+ submitLabel?: string
74
+ autofocus?: boolean
75
+ mention?: LineCommentEditorV2Mention
76
+ }
77
+
78
+ function pathFilename(path: string) {
79
+ const index = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"))
80
+ return index === -1 ? path : path.slice(index + 1)
81
+ }
82
+
83
+ function pathDirectory(path: string) {
84
+ const index = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"))
85
+ return index === -1 ? "" : path.slice(0, index + 1)
86
+ }
87
+
88
+ export function LineCommentEditorV2(props: LineCommentEditorV2Props) {
89
+ let textareaRef: HTMLTextAreaElement | undefined
90
+ const [mentionOpen, setMentionOpen] = createSignal(false)
91
+
92
+ const [local, rest] = splitProps(props, [
93
+ "heading",
94
+ "value",
95
+ "onInput",
96
+ "onCancel",
97
+ "onSubmit",
98
+ "selection",
99
+ "placeholder",
100
+ "rows",
101
+ "cancelLabel",
102
+ "submitLabel",
103
+ "autofocus",
104
+ "mention",
105
+ "class",
106
+ "classList",
107
+ ])
108
+
109
+ const heading = () => local.heading ?? "Comment"
110
+ const canSubmit = () => local.value.trim().length > 0
111
+
112
+ const closeMention = () => {
113
+ setMentionOpen(false)
114
+ mention.clear()
115
+ }
116
+
117
+ const currentMention = () => {
118
+ const textarea = textareaRef
119
+ if (!textarea) return
120
+ if (!local.mention) return
121
+ if (textarea.selectionStart !== textarea.selectionEnd) return
122
+
123
+ const end = textarea.selectionStart
124
+ const match = textarea.value.slice(0, end).match(/@(\S*)$/)
125
+ if (!match) return
126
+
127
+ return {
128
+ query: match[1] ?? "",
129
+ start: end - match[0].length,
130
+ end,
131
+ }
132
+ }
133
+
134
+ function selectMention(item: { path: string } | undefined) {
135
+ if (!item) return
136
+
137
+ const textarea = textareaRef
138
+ const query = currentMention()
139
+ if (!textarea || !query) return
140
+
141
+ const value = `${textarea.value.slice(0, query.start)}@${item.path} ${textarea.value.slice(query.end)}`
142
+ const cursor = query.start + item.path.length + 2
143
+
144
+ local.onInput(value)
145
+ closeMention()
146
+
147
+ requestAnimationFrame(() => {
148
+ textarea.focus()
149
+ textarea.setSelectionRange(cursor, cursor)
150
+ })
151
+ }
152
+
153
+ const mention = useFilteredList<{ path: string }>({
154
+ items: async (query) => {
155
+ if (!local.mention) return []
156
+ if (!query.trim()) return []
157
+ const paths = await local.mention.items(query)
158
+ return paths.map((path) => ({ path }))
159
+ },
160
+ key: (item) => item.path,
161
+ filterKeys: ["path"],
162
+ skipFilter: () => true,
163
+ onSelect: selectMention,
164
+ })
165
+
166
+ const syncMention = () => {
167
+ const item = currentMention()
168
+ if (!item) {
169
+ closeMention()
170
+ return
171
+ }
172
+
173
+ setMentionOpen(true)
174
+ mention.onInput(item.query)
175
+ }
176
+
177
+ const selectActiveMention = () => {
178
+ const items = mention.flat()
179
+ if (items.length === 0) return
180
+ const active = mention.active()
181
+ selectMention(items.find((item) => item.path === active) ?? items[0])
182
+ }
183
+
184
+ const submit = () => {
185
+ const v = local.value.trim()
186
+ if (!v) return
187
+ local.onSubmit(v)
188
+ }
189
+
190
+ onMount(() => {
191
+ if (local.autofocus === false) return
192
+ requestAnimationFrame(() => textareaRef?.focus())
193
+ })
194
+
195
+ return (
196
+ <div
197
+ {...rest}
198
+ data-component="line-comment-v2"
199
+ data-variant="editor"
200
+ classList={{
201
+ ...local.classList,
202
+ [local.class ?? ""]: !!local.class,
203
+ }}
204
+ >
205
+ <div data-slot="line-comment-v2-shell">
206
+ <div data-slot="line-comment-v2-field">
207
+ <div data-slot="line-comment-v2-label">{heading()}</div>
208
+ <textarea
209
+ ref={(el) => {
210
+ textareaRef = el
211
+ }}
212
+ data-slot="line-comment-v2-textarea"
213
+ rows={local.rows ?? 3}
214
+ placeholder={local.placeholder ?? "Add context for this change"}
215
+ value={local.value}
216
+ onInput={(e) => {
217
+ local.onInput(e.currentTarget.value)
218
+ syncMention()
219
+ }}
220
+ onClick={() => syncMention()}
221
+ onSelect={() => syncMention()}
222
+ onKeyDown={(e) => {
223
+ e.stopPropagation()
224
+ if (e.isComposing || e.keyCode === 229) return
225
+
226
+ if (mentionOpen()) {
227
+ if (e.key === "Escape") {
228
+ e.preventDefault()
229
+ closeMention()
230
+ return
231
+ }
232
+
233
+ if (e.key === "Tab") {
234
+ if (mention.flat().length === 0) return
235
+ e.preventDefault()
236
+ selectActiveMention()
237
+ return
238
+ }
239
+
240
+ const nav = e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "Enter"
241
+ const ctrlNav = e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey && (e.key === "n" || e.key === "p")
242
+ if ((nav || ctrlNav) && mention.flat().length > 0) {
243
+ mention.onKeyDown(e)
244
+ e.preventDefault()
245
+ return
246
+ }
247
+ }
248
+
249
+ if (e.key === "Escape") {
250
+ e.preventDefault()
251
+ e.currentTarget.blur()
252
+ local.onCancel()
253
+ return
254
+ }
255
+ if (e.key === "Enter" && !e.shiftKey) {
256
+ e.preventDefault()
257
+ submit()
258
+ }
259
+ }}
260
+ />
261
+ <Show when={mentionOpen() && mention.flat().length > 0}>
262
+ <div data-slot="line-comment-v2-mention-list">
263
+ <For each={mention.flat().slice(0, 10)}>
264
+ {(item) => {
265
+ const directory = item.path.endsWith("/") ? item.path : pathDirectory(item.path)
266
+ const name = item.path.endsWith("/") ? "" : pathFilename(item.path)
267
+ return (
268
+ <button
269
+ type="button"
270
+ data-slot="line-comment-v2-mention-item"
271
+ data-active={mention.active() === item.path ? "" : undefined}
272
+ onMouseDown={(event) => event.preventDefault()}
273
+ onMouseEnter={() => mention.setActive(item.path)}
274
+ onClick={() => selectMention(item)}
275
+ >
276
+ <FileIcon node={{ path: item.path, type: "file" }} class="shrink-0 size-4" />
277
+ <div data-slot="line-comment-v2-mention-path">
278
+ <span data-slot="line-comment-v2-mention-dir">{directory}</span>
279
+ <Show when={name}>
280
+ <span data-slot="line-comment-v2-mention-file">{name}</span>
281
+ </Show>
282
+ </div>
283
+ </button>
284
+ )
285
+ }}
286
+ </For>
287
+ </div>
288
+ </Show>
289
+ </div>
290
+ <div data-slot="line-comment-v2-footer">
291
+ <div data-slot="line-comment-v2-footer-meta">{local.selection}</div>
292
+ <div data-slot="line-comment-v2-footer-actions">
293
+ <ButtonV2 type="button" size="normal" variant="neutral" onClick={() => local.onCancel()}>
294
+ {local.cancelLabel ?? "Cancel"}
295
+ </ButtonV2>
296
+ <ButtonV2 type="button" size="normal" variant="contrast" disabled={!canSubmit()} onClick={submit}>
297
+ {local.submitLabel ?? "Comment"}
298
+ </ButtonV2>
299
+ </div>
300
+ </div>
301
+ </div>
302
+ </div>
303
+ )
304
+ }
@@ -0,0 +1,32 @@
1
+ [data-component="loader-v2"] {
2
+ --_duration: 900ms;
3
+ display: block;
4
+ flex-shrink: 0;
5
+ color: var(--v2-icon-icon-muted, #808080);
6
+ animation: loader-v2-spin var(--_duration) linear infinite;
7
+ transform-origin: center;
8
+ }
9
+
10
+ [data-component="loader-v2"] [data-slot="loader-v2-background"] {
11
+ stroke: currentColor;
12
+ opacity: 0.2;
13
+ }
14
+
15
+ [data-component="loader-v2"] [data-slot="loader-v2-progress"] {
16
+ stroke: currentColor;
17
+ stroke-linecap: round;
18
+ transform: rotate(-90deg);
19
+ transform-origin: center;
20
+ }
21
+
22
+ @keyframes loader-v2-spin {
23
+ to {
24
+ transform: rotate(360deg);
25
+ }
26
+ }
27
+
28
+ @media (prefers-reduced-motion: reduce) {
29
+ [data-component="loader-v2"] {
30
+ animation: none;
31
+ }
32
+ }
@@ -0,0 +1,31 @@
1
+ import { splitProps, type ComponentProps } from "solid-js"
2
+ import "./loader-v2.css"
3
+
4
+ export function LoaderV2(props: ComponentProps<"svg">) {
5
+ const [local, rest] = splitProps(props, ["class", "classList", "width", "height"])
6
+ return (
7
+ <svg
8
+ {...rest}
9
+ class={local.class}
10
+ classList={local.classList}
11
+ width={local.width ?? 16}
12
+ height={local.height ?? 16}
13
+ viewBox="0 0 16 16"
14
+ fill="none"
15
+ xmlns="http://www.w3.org/2000/svg"
16
+ data-component="loader-v2"
17
+ aria-hidden={rest["aria-hidden"] ?? "true"}
18
+ >
19
+ <circle cx="8" cy="8" r="6" data-slot="loader-v2-background" stroke-width="2" />
20
+ <circle
21
+ cx="8"
22
+ cy="8"
23
+ r="6"
24
+ data-slot="loader-v2-progress"
25
+ pathLength="100"
26
+ stroke-width="2"
27
+ stroke-dasharray="33 67"
28
+ />
29
+ </svg>
30
+ )
31
+ }