@opencode-ai/ui 0.0.0-beta-202606251302

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 (346) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +110 -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 +123 -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 +94 -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 +148 -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 +23 -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 +169 -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 +12 -0
  165. package/src/components/progress-circle.tsx +57 -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 +82 -0
  176. package/src/components/scroll-view.css +66 -0
  177. package/src/components/scroll-view.tsx +250 -0
  178. package/src/components/select.css +202 -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 +635 -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 +161 -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.tsx +522 -0
  210. package/src/context/worker-pool.tsx +20 -0
  211. package/src/custom-elements.d.ts +17 -0
  212. package/src/hooks/create-auto-scroll.tsx +237 -0
  213. package/src/hooks/index.ts +2 -0
  214. package/src/hooks/use-filtered-list.tsx +134 -0
  215. package/src/i18n/ar.ts +168 -0
  216. package/src/i18n/br.ts +168 -0
  217. package/src/i18n/bs.ts +172 -0
  218. package/src/i18n/da.ts +167 -0
  219. package/src/i18n/de.ts +173 -0
  220. package/src/i18n/en.ts +176 -0
  221. package/src/i18n/es.ts +168 -0
  222. package/src/i18n/fr.ts +168 -0
  223. package/src/i18n/ja.ts +167 -0
  224. package/src/i18n/ko.ts +168 -0
  225. package/src/i18n/no.ts +171 -0
  226. package/src/i18n/pl.ts +167 -0
  227. package/src/i18n/ru.ts +167 -0
  228. package/src/i18n/th.ts +169 -0
  229. package/src/i18n/tr.ts +174 -0
  230. package/src/i18n/uk.ts +167 -0
  231. package/src/i18n/zh.ts +171 -0
  232. package/src/i18n/zht.ts +171 -0
  233. package/src/storybook/fixtures.ts +51 -0
  234. package/src/storybook/scaffold.tsx +62 -0
  235. package/src/styles/animations.css +141 -0
  236. package/src/styles/base.css +404 -0
  237. package/src/styles/colors.css +772 -0
  238. package/src/styles/index.css +53 -0
  239. package/src/styles/tailwind/colors.css +285 -0
  240. package/src/styles/tailwind/index.css +78 -0
  241. package/src/styles/tailwind/utilities.css +131 -0
  242. package/src/styles/theme.css +609 -0
  243. package/src/styles/utilities.css +118 -0
  244. package/src/theme/color.ts +299 -0
  245. package/src/theme/context.tsx +370 -0
  246. package/src/theme/default-themes.ts +116 -0
  247. package/src/theme/index.ts +78 -0
  248. package/src/theme/loader.ts +112 -0
  249. package/src/theme/resolve.ts +540 -0
  250. package/src/theme/themes/amoled.json +49 -0
  251. package/src/theme/themes/aura.json +51 -0
  252. package/src/theme/themes/ayu.json +51 -0
  253. package/src/theme/themes/carbonfox.json +53 -0
  254. package/src/theme/themes/catppuccin-frappe.json +85 -0
  255. package/src/theme/themes/catppuccin-macchiato.json +85 -0
  256. package/src/theme/themes/catppuccin.json +45 -0
  257. package/src/theme/themes/cobalt2.json +87 -0
  258. package/src/theme/themes/cursor.json +91 -0
  259. package/src/theme/themes/dracula.json +49 -0
  260. package/src/theme/themes/everforest.json +89 -0
  261. package/src/theme/themes/flexoki.json +86 -0
  262. package/src/theme/themes/github.json +85 -0
  263. package/src/theme/themes/gruvbox.json +45 -0
  264. package/src/theme/themes/kanagawa.json +89 -0
  265. package/src/theme/themes/lucent-orng.json +87 -0
  266. package/src/theme/themes/material.json +87 -0
  267. package/src/theme/themes/matrix.json +113 -0
  268. package/src/theme/themes/mercury.json +86 -0
  269. package/src/theme/themes/monokai.json +49 -0
  270. package/src/theme/themes/nightowl.json +46 -0
  271. package/src/theme/themes/nord.json +46 -0
  272. package/src/theme/themes/oc-2.json +468 -0
  273. package/src/theme/themes/one-dark.json +89 -0
  274. package/src/theme/themes/onedarkpro.json +45 -0
  275. package/src/theme/themes/opencode.json +89 -0
  276. package/src/theme/themes/orng.json +87 -0
  277. package/src/theme/themes/osaka-jade.json +88 -0
  278. package/src/theme/themes/palenight.json +85 -0
  279. package/src/theme/themes/rosepine.json +85 -0
  280. package/src/theme/themes/shadesofpurple.json +51 -0
  281. package/src/theme/themes/solarized.json +49 -0
  282. package/src/theme/themes/synthwave84.json +87 -0
  283. package/src/theme/themes/tokyonight.json +47 -0
  284. package/src/theme/themes/vercel.json +90 -0
  285. package/src/theme/themes/vesper.json +51 -0
  286. package/src/theme/themes/zenburn.json +87 -0
  287. package/src/theme/types.ts +75 -0
  288. package/src/theme/v2/avatar.ts +48 -0
  289. package/src/theme/v2/default-primitives.ts +114 -0
  290. package/src/theme/v2/foreground.ts +60 -0
  291. package/src/theme/v2/mapping.ts +138 -0
  292. package/src/theme/v2/resolve.ts +153 -0
  293. package/src/v2/components/accordion-v2.css +139 -0
  294. package/src/v2/components/accordion-v2.tsx +86 -0
  295. package/src/v2/components/avatar-v2.css +70 -0
  296. package/src/v2/components/avatar-v2.tsx +59 -0
  297. package/src/v2/components/badge-v2.css +27 -0
  298. package/src/v2/components/badge-v2.tsx +20 -0
  299. package/src/v2/components/button-v2.css +186 -0
  300. package/src/v2/components/button-v2.tsx +35 -0
  301. package/src/v2/components/checkbox-v2.css +184 -0
  302. package/src/v2/components/checkbox-v2.tsx +65 -0
  303. package/src/v2/components/dialog-v2.css +150 -0
  304. package/src/v2/components/dialog-v2.tsx +93 -0
  305. package/src/v2/components/diff-changes-v2.css +24 -0
  306. package/src/v2/components/diff-changes-v2.tsx +28 -0
  307. package/src/v2/components/field-v2.css +94 -0
  308. package/src/v2/components/field-v2.tsx +265 -0
  309. package/src/v2/components/icon-button-v2.css +155 -0
  310. package/src/v2/components/icon-button-v2.tsx +37 -0
  311. package/src/v2/components/icon.tsx +129 -0
  312. package/src/v2/components/inline-input-v2.css +218 -0
  313. package/src/v2/components/inline-input-v2.tsx +90 -0
  314. package/src/v2/components/keybind-v2.css +76 -0
  315. package/src/v2/components/keybind-v2.tsx +30 -0
  316. package/src/v2/components/line-comment-v2.css +204 -0
  317. package/src/v2/components/line-comment-v2.tsx +155 -0
  318. package/src/v2/components/menu-v2.css +190 -0
  319. package/src/v2/components/menu-v2.tsx +225 -0
  320. package/src/v2/components/project-avatar-v2.css +126 -0
  321. package/src/v2/components/project-avatar-v2.tsx +64 -0
  322. package/src/v2/components/radio-v2.css +202 -0
  323. package/src/v2/components/radio-v2.tsx +72 -0
  324. package/src/v2/components/segmented-control-v2.css +80 -0
  325. package/src/v2/components/segmented-control-v2.tsx +208 -0
  326. package/src/v2/components/select-v2.css +285 -0
  327. package/src/v2/components/select-v2.tsx +208 -0
  328. package/src/v2/components/switch-v2.css +154 -0
  329. package/src/v2/components/switch-v2.tsx +28 -0
  330. package/src/v2/components/tab-state-indicator.tsx +37 -0
  331. package/src/v2/components/tabs-v2.css +225 -0
  332. package/src/v2/components/tabs-v2.tsx +147 -0
  333. package/src/v2/components/text-input-v2.css +145 -0
  334. package/src/v2/components/text-input-v2.tsx +67 -0
  335. package/src/v2/components/text-shimmer-v2.css +125 -0
  336. package/src/v2/components/text-shimmer-v2.tsx +63 -0
  337. package/src/v2/components/textarea-v2.css +78 -0
  338. package/src/v2/components/textarea-v2.tsx +31 -0
  339. package/src/v2/components/toast-v2.css +215 -0
  340. package/src/v2/components/toast-v2.tsx +144 -0
  341. package/src/v2/components/tooltip-v2.css +53 -0
  342. package/src/v2/components/tooltip-v2.tsx +146 -0
  343. package/src/v2/components/wordmark-v2.tsx +92 -0
  344. package/src/v2/styles/colors.css +172 -0
  345. package/src/v2/styles/tailwind.css +2 -0
  346. package/src/v2/styles/theme.css +441 -0
@@ -0,0 +1,215 @@
1
+ [data-component="toast-v2-region"] {
2
+ position: fixed;
3
+ bottom: 48px;
4
+ right: 32px;
5
+ z-index: 1000;
6
+ display: flex;
7
+ flex-direction: column;
8
+ gap: 12px;
9
+ max-width: min(320px, calc(100vw - 64px));
10
+ max-height: none;
11
+ width: 100%;
12
+ overflow: visible;
13
+ pointer-events: none;
14
+
15
+ [data-slot="toast-v2-list"] {
16
+ display: flex;
17
+ flex-direction: column;
18
+ gap: 12px;
19
+ list-style: none;
20
+ margin: 0;
21
+ padding: 0;
22
+ max-height: none;
23
+ overflow-y: visible;
24
+ overflow-x: visible;
25
+ scrollbar-width: none;
26
+
27
+ &::-webkit-scrollbar {
28
+ display: none;
29
+ }
30
+ }
31
+ }
32
+
33
+ [data-component="toast-v2"] {
34
+ position: relative;
35
+ display: flex;
36
+ flex-direction: column;
37
+ gap: 12px;
38
+ width: 320px;
39
+ padding: 12px;
40
+ max-height: min(420px, calc(100dvh - 96px));
41
+ overflow: hidden;
42
+ pointer-events: auto;
43
+ transition: transform 140ms ease-out;
44
+
45
+ border-radius: 8px;
46
+ color: var(--v2-text-text-base);
47
+ background: var(--v2-background-bg-layer-01);
48
+ box-shadow: var(--v2-elevation-floating);
49
+
50
+ &[data-opened] {
51
+ animation: toastV2PopIn 140ms ease-out;
52
+ }
53
+
54
+ &[data-closed] {
55
+ animation: toastV2PopOut 100ms ease-in forwards;
56
+ }
57
+
58
+ [data-slot="toast-v2-header"] {
59
+ display: flex;
60
+ align-items: flex-start;
61
+ gap: 12px;
62
+ width: 100%;
63
+ }
64
+
65
+ [data-slot="toast-v2-icon"] {
66
+ flex-shrink: 0;
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ width: 16px;
71
+ height: 20px;
72
+ min-width: 16px;
73
+ min-height: 20px;
74
+ color: var(--v2-icon-icon-base);
75
+
76
+ [data-component="icon"] {
77
+ color: var(--v2-icon-icon-base);
78
+ width: 16px;
79
+ height: 16px;
80
+ display: inline-flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ }
84
+
85
+ > * {
86
+ width: 16px;
87
+ height: 16px;
88
+ display: inline-flex;
89
+ align-items: center;
90
+ justify-content: center;
91
+ flex-shrink: 0;
92
+ }
93
+
94
+ svg {
95
+ width: 16px;
96
+ height: 16px;
97
+ display: block;
98
+ flex-shrink: 0;
99
+ }
100
+ }
101
+
102
+ [data-slot="toast-v2-content"] {
103
+ flex: 1;
104
+ display: flex;
105
+ flex-direction: column;
106
+ gap: 4px;
107
+ min-height: 0;
108
+ min-width: 0;
109
+ overflow: hidden;
110
+ }
111
+
112
+ [data-slot="toast-v2-title"] {
113
+ color: var(--v2-text-text-base);
114
+ overflow: hidden;
115
+ text-overflow: ellipsis;
116
+ white-space: nowrap;
117
+ font-size: 13px;
118
+ font-style: normal;
119
+ font-weight: 530;
120
+ line-height: 20px;
121
+ letter-spacing: -0.04px;
122
+ font-synthesis: none;
123
+ margin: 0;
124
+ }
125
+
126
+ [data-slot="toast-v2-description"] {
127
+ color: var(--v2-text-text-muted);
128
+ text-wrap-style: pretty;
129
+ overflow-wrap: anywhere;
130
+ word-break: break-word;
131
+ font-size: 13px;
132
+ font-style: normal;
133
+ font-weight: 440;
134
+ line-height: 20px;
135
+ letter-spacing: -0.04px;
136
+ font-synthesis: none;
137
+ margin: 0;
138
+ }
139
+
140
+ [data-slot="toast-v2-actions"] {
141
+ display: flex;
142
+ flex-wrap: wrap;
143
+ gap: 8px;
144
+ padding-left: 28px;
145
+ }
146
+
147
+ [data-slot="toast-v2-actions"] [data-component="button-v2"] {
148
+ min-height: 24px;
149
+ font-size: 13px;
150
+ font-style: normal;
151
+ font-weight: 530;
152
+ line-height: 20px;
153
+ letter-spacing: -0.04px;
154
+ font-synthesis: none;
155
+ }
156
+
157
+ [data-slot="toast-v2-close-button"] {
158
+ flex-shrink: 0;
159
+ width: 20px;
160
+ height: 20px;
161
+ min-width: 20px;
162
+ min-height: 20px;
163
+ padding: 0;
164
+ border: 0;
165
+ border-radius: 4px;
166
+ background: transparent;
167
+ color: var(--v2-icon-icon-muted);
168
+ cursor: pointer;
169
+ display: inline-flex;
170
+ align-items: center;
171
+ justify-content: center;
172
+
173
+ &:hover {
174
+ background: var(--v2-overlay-simple-overlay-hover);
175
+ color: var(--v2-icon-icon-base);
176
+ }
177
+
178
+ &:active {
179
+ background: var(--v2-overlay-simple-overlay-pressed);
180
+ }
181
+
182
+ &:focus-visible {
183
+ outline: 2px solid var(--v2-border-border-focus);
184
+ outline-offset: 2px;
185
+ }
186
+
187
+ svg {
188
+ width: 16px;
189
+ height: 16px;
190
+ display: block;
191
+ }
192
+ }
193
+ }
194
+
195
+ @keyframes toastV2PopIn {
196
+ from {
197
+ opacity: 0.8;
198
+ transform: translateY(6px);
199
+ }
200
+ to {
201
+ transform: translateY(0);
202
+ opacity: 1;
203
+ }
204
+ }
205
+
206
+ @keyframes toastV2PopOut {
207
+ from {
208
+ transform: translateY(0);
209
+ opacity: 1;
210
+ }
211
+ to {
212
+ transform: translateY(6px);
213
+ opacity: 0.8;
214
+ }
215
+ }
@@ -0,0 +1,144 @@
1
+ import { Toast as Kobalte, toaster } from "@kobalte/core/toast"
2
+ import type { ToastRootProps, ToastCloseButtonProps, ToastTitleProps, ToastDescriptionProps } from "@kobalte/core/toast"
3
+ import type { ComponentProps, JSX } from "solid-js"
4
+ import { Show, children } from "solid-js"
5
+ import { Portal } from "solid-js/web"
6
+ import { ButtonV2 } from "./button-v2"
7
+ import "./toast-v2.css"
8
+
9
+ export interface ToastV2RegionProps extends ComponentProps<typeof Kobalte.Region> {}
10
+
11
+ function ToastV2Region(props: ToastV2RegionProps) {
12
+ return (
13
+ <Portal>
14
+ <Kobalte.Region data-component="toast-v2-region" {...props}>
15
+ <Kobalte.List data-slot="toast-v2-list" />
16
+ </Kobalte.Region>
17
+ </Portal>
18
+ )
19
+ }
20
+
21
+ export interface ToastV2RootComponentProps extends ToastRootProps {
22
+ class?: string
23
+ classList?: ComponentProps<"li">["classList"]
24
+ children?: JSX.Element
25
+ }
26
+
27
+ function ToastV2Root(props: ToastV2RootComponentProps) {
28
+ return (
29
+ <Kobalte
30
+ data-component="toast-v2"
31
+ classList={{
32
+ ...props.classList,
33
+ [props.class ?? ""]: !!props.class,
34
+ }}
35
+ {...props}
36
+ />
37
+ )
38
+ }
39
+
40
+ function ToastV2Icon(props: ComponentProps<"div">) {
41
+ return <div data-slot="toast-v2-icon" {...props} />
42
+ }
43
+
44
+ function ToastV2Content(props: ComponentProps<"div">) {
45
+ return <div data-slot="toast-v2-content" {...props} />
46
+ }
47
+
48
+ function ToastV2Title(props: ToastTitleProps & ComponentProps<"div">) {
49
+ return <Kobalte.Title data-slot="toast-v2-title" {...props} />
50
+ }
51
+
52
+ function ToastV2Description(props: ToastDescriptionProps & ComponentProps<"div">) {
53
+ return <Kobalte.Description data-slot="toast-v2-description" {...props} />
54
+ }
55
+
56
+ function ToastV2Actions(props: ComponentProps<"div">) {
57
+ return <div data-slot="toast-v2-actions" {...props} />
58
+ }
59
+
60
+ function ToastV2CloseButton(props: ToastCloseButtonProps & ComponentProps<"button">) {
61
+ return (
62
+ <Kobalte.CloseButton data-slot="toast-v2-close-button" aria-label="Dismiss" {...props}>
63
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
64
+ <path d="M4.25 11.75L11.75 4.25" stroke="currentColor" />
65
+ <path d="M11.75 11.75L4.25 4.25" stroke="currentColor" />
66
+ </svg>
67
+ </Kobalte.CloseButton>
68
+ )
69
+ }
70
+
71
+ export const ToastV2 = Object.assign(ToastV2Root, {
72
+ Region: ToastV2Region,
73
+ Icon: ToastV2Icon,
74
+ Content: ToastV2Content,
75
+ Title: ToastV2Title,
76
+ Description: ToastV2Description,
77
+ Actions: ToastV2Actions,
78
+ CloseButton: ToastV2CloseButton,
79
+ })
80
+
81
+ export { toaster as toasterV2 }
82
+
83
+ export interface ToastV2Action {
84
+ label: string
85
+ variant?: "primary" | "secondary"
86
+ onClick: "dismiss" | (() => void)
87
+ }
88
+
89
+ export interface ToastV2Options {
90
+ title?: string
91
+ description?: string
92
+ icon?: JSX.Element
93
+ duration?: number
94
+ persistent?: boolean
95
+ actions?: ToastV2Action[]
96
+ }
97
+
98
+ export function showToastV2(options: ToastV2Options | string) {
99
+ const opts = typeof options === "string" ? { description: options } : options
100
+ const resolvedIcon = children(() => opts.icon)
101
+ return toaster.show((props) => (
102
+ <ToastV2 toastId={props.toastId} duration={opts.duration} persistent={opts.persistent}>
103
+ <div data-slot="toast-v2-header">
104
+ <Show when={resolvedIcon()}>
105
+ <ToastV2.Icon>{resolvedIcon()}</ToastV2.Icon>
106
+ </Show>
107
+ <ToastV2.Content>
108
+ <Show when={opts.title}>
109
+ <ToastV2.Title>{opts.title}</ToastV2.Title>
110
+ </Show>
111
+ <Show when={opts.description}>
112
+ <ToastV2.Description>{opts.description}</ToastV2.Description>
113
+ </Show>
114
+ </ToastV2.Content>
115
+ <ToastV2.CloseButton />
116
+ </div>
117
+ <Show when={opts.actions?.length}>
118
+ <ToastV2.Actions>
119
+ {opts.actions!.map((action) => (
120
+ <ButtonV2
121
+ variant={action.variant === "secondary" ? "ghost" : "neutral"}
122
+ size="small"
123
+ data-action-variant={action.variant ?? "primary"}
124
+ onClick={() => {
125
+ if (typeof action.onClick === "function") {
126
+ action.onClick()
127
+ }
128
+ toaster.dismiss(props.toastId)
129
+ }}
130
+ >
131
+ {action.label}
132
+ </ButtonV2>
133
+ ))}
134
+ </ToastV2.Actions>
135
+ </Show>
136
+ </ToastV2>
137
+ ))
138
+ }
139
+
140
+ export interface ToastV2PromiseOptions<T, U = unknown> {
141
+ loading?: JSX.Element
142
+ success?: (data: T) => JSX.Element
143
+ error?: (error: U) => JSX.Element
144
+ }
@@ -0,0 +1,53 @@
1
+ [data-component="tooltip-v2"] {
2
+ box-sizing: border-box;
3
+ display: inline-flex;
4
+ flex-direction: row;
5
+ align-items: center;
6
+ padding: 5px 6px;
7
+ gap: 6px;
8
+
9
+ background: var(--v2-background-bg-layer-01);
10
+ box-shadow: var(--v2-elevation-floating);
11
+ border-radius: 4px;
12
+
13
+ font-style: normal;
14
+ font-weight: 530;
15
+ font-size: 11px;
16
+ line-height: 12px;
17
+ letter-spacing: 0.05px;
18
+ color: var(--v2-text-text-base);
19
+ font-variant-numeric: tabular-nums;
20
+ font-variation-settings: "slnt" 0;
21
+
22
+ user-select: none;
23
+ pointer-events: none;
24
+
25
+ animation: tooltipV2In 120ms ease-out;
26
+ transform-origin: var(--kb-tooltip-content-transform-origin);
27
+
28
+ &[data-closed] {
29
+ animation: tooltipV2Out 80ms ease-in forwards;
30
+ }
31
+ }
32
+
33
+ @keyframes tooltipV2In {
34
+ from {
35
+ opacity: 0;
36
+ transform: scale(0.96);
37
+ }
38
+ to {
39
+ opacity: 1;
40
+ transform: scale(1);
41
+ }
42
+ }
43
+
44
+ @keyframes tooltipV2Out {
45
+ from {
46
+ opacity: 1;
47
+ transform: scale(1);
48
+ }
49
+ to {
50
+ opacity: 0;
51
+ transform: scale(0.96);
52
+ }
53
+ }
@@ -0,0 +1,146 @@
1
+ import { Tooltip as KobalteTooltip } from "@kobalte/core/tooltip"
2
+ import { createEffect, Match, onCleanup, splitProps, Switch, type JSX } from "solid-js"
3
+ import type { ComponentProps } from "solid-js"
4
+ import { createStore } from "solid-js/store"
5
+ import "./tooltip-v2.css"
6
+
7
+ export interface TooltipV2Props extends ComponentProps<typeof KobalteTooltip> {
8
+ value: JSX.Element
9
+ class?: string
10
+ contentClass?: string
11
+ contentStyle?: JSX.CSSProperties
12
+ inactive?: boolean
13
+ forceOpen?: boolean
14
+ }
15
+
16
+ export function TooltipV2(props: TooltipV2Props) {
17
+ let ref: HTMLDivElement | undefined
18
+ const [state, setState] = createStore({
19
+ open: false,
20
+ block: false,
21
+ expand: false,
22
+ })
23
+ const [local, others] = splitProps(props, [
24
+ "children",
25
+ "class",
26
+ "contentClass",
27
+ "contentStyle",
28
+ "inactive",
29
+ "forceOpen",
30
+ "ignoreSafeArea",
31
+ "value",
32
+ ])
33
+
34
+ const close = () => setState("open", false)
35
+
36
+ const inside = () => {
37
+ const active = document.activeElement
38
+ if (!ref || !active) return false
39
+ return ref.contains(active)
40
+ }
41
+
42
+ const drop = (expand = state.expand) => {
43
+ if (expand) return
44
+ if (ref?.matches(":hover")) return
45
+ if (inside()) return
46
+ setState("block", false)
47
+ }
48
+
49
+ const sync = () => {
50
+ const expand = !!ref?.querySelector('[aria-expanded="true"], [data-expanded]')
51
+ setState("expand", expand)
52
+ if (expand) {
53
+ setState("block", true)
54
+ close()
55
+ return
56
+ }
57
+ drop(expand)
58
+ }
59
+
60
+ const arm = () => {
61
+ setState("block", true)
62
+ close()
63
+ }
64
+
65
+ const leave = () => {
66
+ if (!inside()) close()
67
+ drop()
68
+ }
69
+
70
+ createEffect(() => {
71
+ if (!ref) return
72
+ sync()
73
+ const obs = new MutationObserver(sync)
74
+ obs.observe(ref, {
75
+ subtree: true,
76
+ childList: true,
77
+ attributes: true,
78
+ attributeFilter: ["aria-expanded", "data-expanded"],
79
+ })
80
+ onCleanup(() => obs.disconnect())
81
+ })
82
+
83
+ let justClickedTrigger = false
84
+
85
+ return (
86
+ <Switch>
87
+ <Match when={local.inactive}>{local.children}</Match>
88
+ <Match when={true}>
89
+ <KobalteTooltip
90
+ gutter={4}
91
+ {...others}
92
+ openDelay={0}
93
+ closeDelay={0}
94
+ ignoreSafeArea={local.ignoreSafeArea ?? true}
95
+ open={local.forceOpen || state.open}
96
+ onOpenChange={(open) => {
97
+ if (local.forceOpen) return
98
+ if (state.block && open) return
99
+ if (justClickedTrigger) {
100
+ justClickedTrigger = false
101
+ return
102
+ }
103
+ setState("open", open)
104
+ }}
105
+ >
106
+ <KobalteTooltip.Trigger
107
+ ref={ref}
108
+ as="div"
109
+ data-component="tooltip-v2-trigger"
110
+ class={local.class}
111
+ onPointerDownCapture={arm}
112
+ onKeyDownCapture={(event: KeyboardEvent) => {
113
+ if (event.key !== "Enter" && event.key !== " ") return
114
+ arm()
115
+ }}
116
+ onPointerLeave={leave}
117
+ onFocusOut={() => requestAnimationFrame(() => drop())}
118
+ >
119
+ {local.children}
120
+ </KobalteTooltip.Trigger>
121
+ <KobalteTooltip.Portal>
122
+ <KobalteTooltip.Content
123
+ ref={(el) => {
124
+ const theme = ref?.closest("[data-theme]")?.getAttribute("data-theme")
125
+ if (theme) el.setAttribute("data-theme", theme)
126
+ }}
127
+ data-component="tooltip-v2"
128
+ data-placement={props.placement}
129
+ data-force-open={local.forceOpen}
130
+ class={local.contentClass}
131
+ style={local.contentStyle}
132
+ onPointerDownOutside={(e) => {
133
+ if (ref === e.target || (e.target instanceof Node && ref?.contains(e.target))) {
134
+ justClickedTrigger = true
135
+ }
136
+ e.preventDefault()
137
+ }}
138
+ >
139
+ {local.value}
140
+ </KobalteTooltip.Content>
141
+ </KobalteTooltip.Portal>
142
+ </KobalteTooltip>
143
+ </Match>
144
+ </Switch>
145
+ )
146
+ }
@@ -0,0 +1,92 @@
1
+ import { createUniqueId, type ComponentProps } from "solid-js"
2
+
3
+ export function WordmarkV2(props: Pick<ComponentProps<"svg">, "class">) {
4
+ const filter = createUniqueId()
5
+ const mask = createUniqueId()
6
+ const maskGradient = createUniqueId()
7
+
8
+ return (
9
+ <svg
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ viewBox="0 0 720.002 129.001"
12
+ fill="none"
13
+ preserveAspectRatio="none"
14
+ classList={{ [props.class ?? ""]: !!props.class }}
15
+ >
16
+ <g opacity="0.16" filter={`url(#${filter})`} mask={`url(#${mask})`}>
17
+ <path
18
+ opacity="0.7"
19
+ d="M55.3846 36.8583H18.4615V92.144H55.3846V36.8583ZM73.8462 110.573H0V18.4297H73.8462V110.573Z"
20
+ fill="currentColor"
21
+ />
22
+ <path
23
+ opacity="0.7"
24
+ d="M110.774 92.144H147.697V36.8583H110.774V92.144ZM166.159 110.573H110.774V129.001H92.3125V18.4297H166.159V110.573Z"
25
+ fill="currentColor"
26
+ />
27
+ <path
28
+ opacity="0.7"
29
+ d="M258.463 73.7154H203.079V92.144H258.463V110.573H184.617V18.4297H258.463V73.7154ZM203.079 55.2868H240.002V36.8583H203.079V55.2868Z"
30
+ fill="currentColor"
31
+ />
32
+ <path
33
+ opacity="0.7"
34
+ d="M332.306 36.8583H295.383V110.573H276.922V18.4297H332.306V36.8583ZM350.768 110.573H332.306V36.8583H350.768V110.573Z"
35
+ fill="currentColor"
36
+ />
37
+ <path
38
+ opacity="0.7"
39
+ d="M443.081 36.8583H387.696V92.144H443.081V110.573H369.234V18.4297H443.081V36.8583Z"
40
+ fill="currentColor"
41
+ />
42
+ <path
43
+ opacity="0.7"
44
+ d="M516.924 36.8583H480.001V92.144H516.924V36.8583ZM535.385 110.573H461.539V18.4297H535.385V110.573Z"
45
+ fill="currentColor"
46
+ />
47
+ <path
48
+ opacity="0.7"
49
+ d="M609.228 36.8571H572.305V92.1429H609.228V36.8571ZM627.69 110.571H553.844V18.4286H609.228V0H627.69V110.571Z"
50
+ fill="currentColor"
51
+ />
52
+ <path
53
+ opacity="0.7"
54
+ d="M664.618 36.8583V55.2868H701.541V36.8583H664.618ZM720.002 73.7154H664.618V92.144H720.002V110.573H646.156V18.4297H720.002V73.7154Z"
55
+ fill="currentColor"
56
+ />
57
+ </g>
58
+ <defs>
59
+ <mask id={mask} maskUnits="userSpaceOnUse" x="0" y="0" width="720" height="129">
60
+ <rect width="720" height="129" fill={`url(#${maskGradient})`} />
61
+ </mask>
62
+ <linearGradient id={maskGradient} x1="360" y1="0" x2="360" y2="112" gradientUnits="userSpaceOnUse">
63
+ <stop stop-color="white" stop-opacity="0.7" />
64
+ <stop offset="1" stop-color="white" stop-opacity="0" />
65
+ </linearGradient>
66
+ <filter
67
+ id={filter}
68
+ x="0"
69
+ y="0"
70
+ width="720.002"
71
+ height="130.001"
72
+ filterUnits="userSpaceOnUse"
73
+ color-interpolation-filters="sRGB"
74
+ >
75
+ <feFlood flood-opacity="0" result="BackgroundImageFix" />
76
+ <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
77
+ <feColorMatrix
78
+ in="SourceAlpha"
79
+ type="matrix"
80
+ values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
81
+ result="hardAlpha"
82
+ />
83
+ <feOffset dy="1" />
84
+ <feGaussianBlur stdDeviation="1" />
85
+ <feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1" />
86
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" />
87
+ <feBlend mode="normal" in2="shape" result="effect1_innerShadow_4938_16028" />
88
+ </filter>
89
+ </defs>
90
+ </svg>
91
+ )
92
+ }