@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,208 @@
1
+ import { Select as Kobalte } from "@kobalte/core/select"
2
+ import { Show, createMemo, onCleanup, splitProps, type ComponentProps, type JSX } from "solid-js"
3
+ import "./select-v2.css"
4
+
5
+ function groupOptions<T>(options: T[], groupBy?: (x: T) => string): { category: string; options: T[] }[] {
6
+ if (!groupBy) {
7
+ return [{ category: "", options }]
8
+ }
9
+ const map = new Map<string, T[]>()
10
+ for (const opt of options) {
11
+ const key = groupBy(opt)
12
+ const arr = map.get(key)
13
+ if (arr) arr.push(opt)
14
+ else map.set(key, [opt])
15
+ }
16
+ return [...map.entries()].map(([category, opts]) => ({ category, options: opts }))
17
+ }
18
+
19
+ const ChevronDown = () => (
20
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
21
+ <path
22
+ d="M11 9.5L8 6.5L5 9.5"
23
+ stroke="currentColor"
24
+ stroke-width="1"
25
+ stroke-linecap="round"
26
+ stroke-linejoin="round"
27
+ />
28
+ </svg>
29
+ )
30
+
31
+ const CheckSmall = () => (
32
+ <svg width="14" height="14" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
33
+ <path
34
+ d="M3.53564 8.17857L6.39279 11.75L12.4642 4.25"
35
+ stroke="currentColor"
36
+ stroke-width="1"
37
+ stroke-linecap="round"
38
+ stroke-linejoin="round"
39
+ />
40
+ </svg>
41
+ )
42
+
43
+ export type SelectV2Props<T> = Omit<
44
+ ComponentProps<typeof Kobalte<T, { category: string; options: T[] }>>,
45
+ "value" | "onSelect" | "children" | "options" | "itemComponent" | "sectionComponent" | "defaultValue" | "multiple"
46
+ > & {
47
+ placeholder?: string
48
+ options: T[]
49
+ /** Selected option (single selection). */
50
+ current?: T
51
+ value?: (x: T) => string
52
+ label?: (x: T) => string
53
+ groupBy?: (x: T) => string
54
+ onSelect?: (value: T | null) => void
55
+ onHighlight?: (value: T | undefined) => void | (() => void)
56
+ /** `base` / `large` match text-input-v2; `inline` is a compact settings-row trigger. */
57
+ appearance?: "base" | "large" | "inline"
58
+ invalid?: boolean
59
+ numeric?: boolean
60
+ children?: (item: T) => JSX.Element
61
+ valueClass?: string
62
+ }
63
+
64
+ export function SelectV2<T>(props: SelectV2Props<T>) {
65
+ const [local, others] = splitProps(props, [
66
+ "class",
67
+ "classList",
68
+ "placeholder",
69
+ "options",
70
+ "current",
71
+ "value",
72
+ "label",
73
+ "groupBy",
74
+ "onSelect",
75
+ "onHighlight",
76
+ "onOpenChange",
77
+ "children",
78
+ "appearance",
79
+ "invalid",
80
+ "numeric",
81
+ "disabled",
82
+ "valueClass",
83
+ "placement",
84
+ "gutter",
85
+ "sameWidth",
86
+ "flip",
87
+ "slide",
88
+ "fitViewport",
89
+ ])
90
+
91
+ const inline = () => (local.appearance ?? "base") === "inline"
92
+
93
+ const state: { key?: string; cleanup?: void | (() => void) } = {}
94
+
95
+ const stop = () => {
96
+ state.cleanup?.()
97
+ state.cleanup = undefined
98
+ state.key = undefined
99
+ }
100
+
101
+ const keyFor = (item: T) => (local.value ? local.value(item) : String(item as string))
102
+
103
+ const move = (item: T | undefined) => {
104
+ if (!local.onHighlight) return
105
+ if (!item) {
106
+ stop()
107
+ return
108
+ }
109
+ const key = keyFor(item)
110
+ if (state.key === key) return
111
+ state.cleanup?.()
112
+ state.cleanup = local.onHighlight(item)
113
+ state.key = key
114
+ }
115
+
116
+ onCleanup(stop)
117
+
118
+ const grouped = createMemo(() => groupOptions(local.options, local.groupBy))
119
+
120
+ return (
121
+ <Kobalte<T, { category: string; options: T[] }>
122
+ {...others}
123
+ multiple={false}
124
+ disabled={local.disabled}
125
+ data-component="select-v2-root"
126
+ placement={local.placement ?? (inline() ? "bottom-end" : "bottom-start")}
127
+ gutter={local.gutter ?? 4}
128
+ sameWidth={local.sameWidth ?? !inline()}
129
+ flip={local.flip ?? true}
130
+ slide={local.slide ?? true}
131
+ fitViewport={local.fitViewport ?? false}
132
+ value={local.current}
133
+ options={grouped()}
134
+ optionValue={(x) => (local.value ? local.value(x) : String(x as string))}
135
+ optionTextValue={(x) => (local.label ? local.label(x) : String(x as string))}
136
+ optionGroupChildren="options"
137
+ placeholder={local.placeholder}
138
+ sectionComponent={(sectionProps) => (
139
+ <Kobalte.Section>
140
+ <Show when={sectionProps.section.rawValue.category}>
141
+ <div data-slot="menu-v2-group-label">{sectionProps.section.rawValue.category}</div>
142
+ </Show>
143
+ </Kobalte.Section>
144
+ )}
145
+ itemComponent={(itemProps) => (
146
+ <Kobalte.Item
147
+ {...itemProps}
148
+ data-component="menu-v2-item"
149
+ onPointerEnter={() => move(itemProps.item.rawValue)}
150
+ onPointerMove={() => move(itemProps.item.rawValue)}
151
+ onFocus={() => move(itemProps.item.rawValue)}
152
+ >
153
+ <Kobalte.ItemLabel data-slot="menu-v2-item-content" as="span">
154
+ {local.children
155
+ ? local.children(itemProps.item.rawValue)
156
+ : local.label
157
+ ? local.label(itemProps.item.rawValue)
158
+ : String(itemProps.item.rawValue as string)}
159
+ </Kobalte.ItemLabel>
160
+ <Kobalte.ItemIndicator data-slot="menu-v2-item-indicator" forceMount>
161
+ <CheckSmall />
162
+ </Kobalte.ItemIndicator>
163
+ </Kobalte.Item>
164
+ )}
165
+ onChange={(next) => {
166
+ const v = next == null ? null : Array.isArray(next) ? ((next[0] as T) ?? null) : (next as T)
167
+ local.onSelect?.(v)
168
+ stop()
169
+ }}
170
+ onOpenChange={(open) => {
171
+ local.onOpenChange?.(open)
172
+ if (!open) stop()
173
+ }}
174
+ >
175
+ <Kobalte.Trigger
176
+ as="div"
177
+ data-component="select-v2"
178
+ data-appearance={local.appearance ?? "base"}
179
+ data-invalid={local.invalid ? "" : undefined}
180
+ data-numeric={local.numeric ? "" : undefined}
181
+ disabled={local.disabled}
182
+ data-disabled={local.disabled ? "" : undefined}
183
+ classList={{
184
+ ...local.classList,
185
+ [local.class ?? ""]: !!local.class,
186
+ }}
187
+ >
188
+ <div data-slot="select-v2-value">
189
+ <Kobalte.Value<T> data-slot="select-v2-value-text" class={local.valueClass}>
190
+ {(st) => {
191
+ const selected = st.selectedOption()
192
+ if (local.label && selected != null) return local.label(selected)
193
+ return selected != null ? (selected as string) : ""
194
+ }}
195
+ </Kobalte.Value>
196
+ </div>
197
+ <span data-slot="select-v2-chevron" aria-hidden="true">
198
+ <ChevronDown />
199
+ </span>
200
+ </Kobalte.Trigger>
201
+ <Kobalte.Portal>
202
+ <Kobalte.Content data-component="menu-v2-content" data-slot="select-v2-content">
203
+ <Kobalte.Listbox data-slot="select-v2-listbox" />
204
+ </Kobalte.Content>
205
+ </Kobalte.Portal>
206
+ </Kobalte>
207
+ )
208
+ }
@@ -0,0 +1,154 @@
1
+ [data-component="switch"] {
2
+ position: relative;
3
+ display: flex;
4
+ align-items: center;
5
+ gap: 8px;
6
+ cursor: default;
7
+
8
+ [data-slot="switch-input"] {
9
+ position: absolute;
10
+ width: 1px;
11
+ height: 1px;
12
+ padding: 0;
13
+ margin: -1px;
14
+ overflow: hidden;
15
+ clip: rect(0, 0, 0, 0);
16
+ white-space: nowrap;
17
+ border-width: 0;
18
+ }
19
+
20
+ [data-slot="switch-control"] {
21
+ box-sizing: border-box;
22
+ display: inline-flex;
23
+ justify-content: flex-start;
24
+ align-items: center;
25
+ padding: 2px;
26
+ width: 24px;
27
+ height: 16px;
28
+ flex-shrink: 0;
29
+ border-radius: 4px;
30
+ border: none;
31
+ background:
32
+ linear-gradient(180deg, var(--v2-alpha-light-0) 0%, var(--v2-alpha-light-20) 100%),
33
+ var(--v2-background-bg-layer-03);
34
+ box-shadow: var(--v2-elevation-switch-off);
35
+ transition:
36
+ background 90ms ease-out,
37
+ opacity 90ms ease-out,
38
+ outline-color 90ms ease-out;
39
+ }
40
+
41
+ [data-slot="switch-thumb"] {
42
+ box-sizing: border-box;
43
+ width: 12px;
44
+ height: 12px;
45
+ transform: translateX(0);
46
+ border-radius: 2px;
47
+ border: 0.5px solid var(--v2-overlay-gradient-depth-overlay-depth-top);
48
+ background:
49
+ linear-gradient(
50
+ 180deg,
51
+ var(--v2-overlay-gradient-depth-overlay-depth-top) 0%,
52
+ var(--v2-overlay-gradient-depth-overlay-depth-bot) 100%
53
+ ),
54
+ var(--v2-grey-200);
55
+ box-shadow: var(--v2-elevation-elements);
56
+ transition:
57
+ transform 90ms ease-out,
58
+ width 90ms ease-out,
59
+ border-radius 90ms,
60
+ background 90ms;
61
+ }
62
+
63
+ [data-slot="switch-label"] {
64
+ display: inline-flex;
65
+ align-items: center;
66
+ height: 16px;
67
+ user-select: none;
68
+ color: var(--v2-text-text-faint);
69
+ font-size: 11px;
70
+ font-style: normal;
71
+ font-weight: 440;
72
+ line-height: 16px;
73
+ letter-spacing: 0.05px;
74
+ font-variation-settings: "slnt" 0;
75
+ }
76
+
77
+ [data-slot="switch-error"] {
78
+ color: var(--v2-state-fg-danger);
79
+ font-size: 12px;
80
+ font-weight: var(--font-weight-regular);
81
+ line-height: var(--line-height-normal);
82
+ letter-spacing: var(--letter-spacing-normal);
83
+ }
84
+
85
+ [data-slot="switch-error"]:empty {
86
+ display: none;
87
+ }
88
+
89
+ &:hover:not([data-disabled], [data-readonly]) [data-slot="switch-control"] {
90
+ background:
91
+ linear-gradient(0deg, var(--v2-overlay-simple-overlay-hover), var(--v2-overlay-simple-overlay-hover)),
92
+ linear-gradient(180deg, var(--v2-alpha-light-0) 0%, var(--v2-alpha-light-20) 100%),
93
+ var(--v2-background-bg-layer-03);
94
+ }
95
+
96
+ &:hover:not([data-disabled], [data-readonly]) [data-slot="switch-thumb"] {
97
+ width: 13px;
98
+ border-radius: 3px;
99
+ }
100
+
101
+ &:not([data-readonly]) [data-slot="switch-input"]:focus-visible ~ [data-slot="switch-control"] {
102
+ outline: 2px solid var(--v2-border-border-focus);
103
+ outline-offset: 1px;
104
+ }
105
+
106
+ &[data-checked] [data-slot="switch-control"] {
107
+ background:
108
+ linear-gradient(180deg, var(--v2-alpha-light-0) 0%, var(--v2-alpha-light-10) 100%), var(--v2-background-bg-accent);
109
+ box-shadow: var(--v2-elevation-switch-on);
110
+ }
111
+
112
+ &[data-checked] [data-slot="switch-thumb"] {
113
+ transform: translateX(8px);
114
+ border-radius: 2px;
115
+ background:
116
+ linear-gradient(
117
+ 180deg,
118
+ var(--v2-overlay-gradient-depth-overlay-depth-top) 0%,
119
+ var(--v2-overlay-gradient-depth-overlay-depth-bot) 100%
120
+ ),
121
+ var(--v2-grey-300);
122
+ }
123
+
124
+ &[data-checked]:hover:not([data-disabled], [data-readonly]) [data-slot="switch-control"] {
125
+ background:
126
+ linear-gradient(
127
+ 0deg,
128
+ var(--v2-overlay-simple-overlay-contrast-hover),
129
+ var(--v2-overlay-simple-overlay-contrast-hover)
130
+ ),
131
+ linear-gradient(180deg, var(--v2-alpha-light-0) 0%, var(--v2-alpha-light-10) 100%), var(--v2-background-bg-accent);
132
+ }
133
+
134
+ &[data-checked]:hover:not([data-disabled], [data-readonly]) [data-slot="switch-thumb"] {
135
+ transform: translateX(7px);
136
+ }
137
+
138
+ &[data-disabled] {
139
+ cursor: not-allowed;
140
+ }
141
+
142
+ &[data-disabled] [data-slot="switch-control"] {
143
+ opacity: 0.5;
144
+ }
145
+
146
+ &[data-invalid] [data-slot="switch-control"] {
147
+ border-color: var(--v2-state-border-danger);
148
+ }
149
+
150
+ &[data-readonly] {
151
+ cursor: default;
152
+ pointer-events: none;
153
+ }
154
+ }
@@ -0,0 +1,28 @@
1
+ import { Switch as Kobalte } from "@kobalte/core/switch"
2
+ import { Show, splitProps } from "solid-js"
3
+ import type { ComponentProps, ParentProps } from "solid-js"
4
+ import "./switch-v2.css"
5
+
6
+ export interface SwitchProps extends ParentProps<ComponentProps<typeof Kobalte>> {
7
+ hideLabel?: boolean
8
+ }
9
+
10
+ export function Switch(props: SwitchProps) {
11
+ const [local, others] = splitProps(props, ["children", "class", "hideLabel"])
12
+ return (
13
+ <Kobalte {...others} class={local.class} data-component="switch">
14
+ <Kobalte.Input data-slot="switch-input" />
15
+ <Show when={local.children}>
16
+ {(label) => (
17
+ <Kobalte.Label data-slot="switch-label" classList={{ "sr-only": local.hideLabel }}>
18
+ {label()}
19
+ </Kobalte.Label>
20
+ )}
21
+ </Show>
22
+ <Kobalte.Control data-slot="switch-control">
23
+ <Kobalte.Thumb data-slot="switch-thumb" />
24
+ </Kobalte.Control>
25
+ <Kobalte.ErrorMessage data-slot="switch-error" />
26
+ </Kobalte>
27
+ )
28
+ }
@@ -0,0 +1,37 @@
1
+ import { splitProps, type ComponentProps } from "solid-js"
2
+
3
+ export function TabStateIndicator(props: ComponentProps<"svg">) {
4
+ const [local, rest] = splitProps(props, ["class", "classList", "width", "height"])
5
+ return (
6
+ <svg
7
+ {...rest}
8
+ class={local.class}
9
+ classList={local.classList}
10
+ width={local.width ?? 16}
11
+ height={local.height ?? 16}
12
+ viewBox="0 0 16 16"
13
+ fill="none"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ aria-hidden={rest["aria-hidden"] ?? "true"}
16
+ >
17
+ <g opacity="0.25" fill="#808080">
18
+ <rect x="13.5" y="2.5" width="2" height="2" transform="rotate(90 13.5 2.5)" />
19
+ <path d="M10.5 2.5L10.5 4.5L8.5 4.5L8.5 2.5L10.5 2.5Z" />
20
+ <path d="M4.5 2.5L4.5 4.5L2.5 4.5L2.5 2.5L4.5 2.5Z" />
21
+ <path d="M13.5 5.5L13.5 7.5L11.5 7.5L11.5 5.5L13.5 5.5Z" />
22
+ <path d="M4.5 5.5L4.5 7.5L2.5 7.5L2.5 5.5L4.5 5.5Z" />
23
+ <path d="M13.5 8.5L13.5 10.5L11.5 10.5L11.5 8.5L13.5 8.5Z" />
24
+ <path d="M4.5 8.5L4.5 10.5L2.5 10.5L2.5 8.5L4.5 8.5Z" />
25
+ <path d="M13.5 11.5L13.5 13.5L11.5 13.5L11.5 11.5L13.5 11.5Z" />
26
+ <path d="M7.5 11.5L7.5 13.5L5.5 13.5L5.5 11.5L7.5 11.5Z" />
27
+ <path d="M4.5 11.5L4.5 13.5L2.5 13.5L2.5 11.5L4.5 11.5Z" />
28
+ <path d="M7.5 2.5L7.5 4.5L5.5 4.5L5.5 2.5L7.5 2.5Z" />
29
+ <path d="M10.5 5.5L10.5 7.5L8.5 7.5L8.5 5.5L10.5 5.5Z" />
30
+ <path d="M7.5 5.5L7.5 7.5L5.5 7.5L5.5 5.5L7.5 5.5Z" />
31
+ <path d="M10.5 8.5L10.5 10.5L8.5 10.5L8.5 8.5L10.5 8.5Z" />
32
+ <path d="M7.5 8.5L7.5 10.5L5.5 10.5L5.5 8.5L7.5 8.5Z" />
33
+ <path d="M10.5 11.5L10.5 13.5L8.5 13.5L8.5 11.5L10.5 11.5Z" />
34
+ </g>
35
+ </svg>
36
+ )
37
+ }
@@ -0,0 +1,225 @@
1
+ * {
2
+ -webkit-font-smoothing: antialiased;
3
+ -moz-osx-font-smoothing: grayscale;
4
+ text-rendering: geometricPrecision;
5
+ }
6
+
7
+ [data-component="tabs-v2"] {
8
+ width: 100%;
9
+ height: 100%;
10
+ display: flex;
11
+ overflow: clip;
12
+ }
13
+
14
+ [data-component="tabs-v2"][data-orientation="horizontal"] {
15
+ flex-direction: column;
16
+ }
17
+
18
+ [data-component="tabs-v2"][data-orientation="vertical"] {
19
+ flex-direction: row;
20
+ }
21
+
22
+ [data-component="tabs-v2"] [data-slot="tabs-v2-content"] {
23
+ flex: 1;
24
+ overflow: auto;
25
+ }
26
+
27
+ [data-component="tabs-v2"] [data-slot="tabs-v2-list"] {
28
+ display: flex;
29
+ }
30
+
31
+ [data-component="tabs-v2"][data-orientation="horizontal"] [data-slot="tabs-v2-list"] {
32
+ width: 100%;
33
+ overflow-x: auto;
34
+ scrollbar-width: none;
35
+ -ms-overflow-style: none;
36
+ }
37
+
38
+ [data-component="tabs-v2"][data-orientation="horizontal"] [data-slot="tabs-v2-list"]::-webkit-scrollbar {
39
+ display: none;
40
+ }
41
+
42
+ [data-component="tabs-v2"] [data-slot="tabs-v2-trigger-wrapper"] {
43
+ position: relative;
44
+ display: flex;
45
+ align-items: center;
46
+ flex-shrink: 0;
47
+ white-space: nowrap;
48
+ user-select: none;
49
+ }
50
+
51
+ [data-component="tabs-v2"] [data-slot="tabs-v2-trigger"] {
52
+ display: flex;
53
+ align-items: center;
54
+ min-width: 0;
55
+ overflow: hidden;
56
+ text-overflow: ellipsis;
57
+ outline: none;
58
+ user-select: none;
59
+
60
+ font-size: 13px;
61
+ font-weight: 440;
62
+ line-height: 100%;
63
+ letter-spacing: -0.04px;
64
+ }
65
+
66
+ [data-component="tabs-v2"] [data-slot="tabs-v2-trigger"]:is(:focus, :focus-visible) {
67
+ outline: none;
68
+ box-shadow: none;
69
+ }
70
+
71
+ [data-component="tabs-v2"] [data-slot="tabs-v2-close-button"] {
72
+ width: 20px;
73
+ height: 20px;
74
+ margin-left: -5px;
75
+ flex: none;
76
+ display: flex;
77
+ align-items: center;
78
+ justify-content: center;
79
+ color: var(--v2-text-text-faint);
80
+ }
81
+
82
+ [data-component="tabs-v2"] [data-slot="tabs-v2-close-button"]:hover {
83
+ color: var(--v2-text-text-muted);
84
+ }
85
+
86
+ [data-component="tabs-v2"] [data-component="icon-button"] {
87
+ margin: 0;
88
+ }
89
+
90
+ [data-component="tabs-v2"] [data-slot="tabs-v2-trigger-wrapper"]:disabled {
91
+ pointer-events: none;
92
+ color: var(--v2-text-text-faint);
93
+ }
94
+
95
+ [data-component="tabs-v2"][data-variant="normal"][data-orientation="horizontal"] [data-slot="tabs-v2-list"],
96
+ [data-component="tabs-v2"][data-variant="pill"][data-orientation="horizontal"] [data-slot="tabs-v2-list"] {
97
+ gap: 6px;
98
+ padding-inline: 8px;
99
+ height: 32px;
100
+ align-items: center;
101
+ position: relative;
102
+ }
103
+
104
+ [data-component="tabs-v2"][data-variant="normal"][data-orientation="horizontal"] [data-slot="tabs-v2-list"]::before,
105
+ [data-component="tabs-v2"][data-variant="pill"][data-orientation="horizontal"] [data-slot="tabs-v2-list"]::before {
106
+ height: 1px;
107
+ content: "";
108
+ width: calc(100% + 16px);
109
+ background-color: var(--v2-border-border-base);
110
+ position: absolute;
111
+ bottom: 0px;
112
+ left: -8px;
113
+ }
114
+
115
+ [data-component="tabs-v2"][data-variant="pill"][data-orientation="horizontal"] [data-slot="tabs-v2-list"] {
116
+ padding-bottom: 8px;
117
+ align-items: start;
118
+ }
119
+
120
+ [data-component="tabs-v2"][data-variant="normal"][data-orientation="horizontal"] [data-slot="tabs-v2-trigger-wrapper"] {
121
+ height: 100%;
122
+ gap: 4px;
123
+ color: var(--v2-text-text-muted);
124
+ border-bottom: 1px solid transparent;
125
+ }
126
+
127
+ [data-component="tabs-v2"][data-variant="normal"][data-orientation="horizontal"] [data-slot="tabs-v2-trigger"] {
128
+ height: 100%;
129
+ padding: 6px;
130
+ }
131
+
132
+ [data-component="tabs-v2"][data-variant="normal"][data-orientation="horizontal"]
133
+ [data-slot="tabs-v2-trigger-wrapper"]:hover:not(:disabled):not([data-selected]) {
134
+ color: var(--v2-text-text-base);
135
+ }
136
+
137
+ [data-component="tabs-v2"][data-variant="normal"][data-orientation="horizontal"]
138
+ [data-slot="tabs-v2-trigger-wrapper"]:has([data-selected]) {
139
+ border-bottom-color: var(--v2-text-text-faint);
140
+ color: var(--v2-text-text-base);
141
+ }
142
+
143
+ [data-component="tabs-v2"][data-variant="normal"][data-orientation="horizontal"]
144
+ [data-slot="tabs-v2-trigger-wrapper"]:not(:has([data-selected])) {
145
+ color: var(--v2-text-text-muted);
146
+ }
147
+
148
+ [data-component="tabs-v2"][data-variant="pill"][data-orientation="horizontal"] [data-slot="tabs-v2-trigger-wrapper"] {
149
+ height: 24px;
150
+ border-radius: 4px;
151
+ border: 0.5px solid transparent;
152
+ box-sizing: border-box;
153
+ color: var(--v2-text-text-muted);
154
+ }
155
+
156
+ [data-component="tabs-v2"][data-variant="pill"][data-orientation="horizontal"] [data-slot="tabs-v2-trigger"] {
157
+ width: 100%;
158
+ height: 100%;
159
+ justify-content: center;
160
+ padding: 0 6px;
161
+ border: 0.5px solid transparent;
162
+ }
163
+
164
+ [data-component="tabs-v2"][data-variant="pill"][data-orientation="horizontal"]
165
+ [data-slot="tabs-v2-trigger-wrapper"]:hover:not(:disabled):not(:has([data-selected])) {
166
+ background-color: var(--v2-background-bg-layer-03);
167
+ color: var(--v2-text-text-base);
168
+ border: 0.5px solid var(--v2-border-border-muted);
169
+ }
170
+
171
+ [data-component="tabs-v2"][data-variant="pill"][data-orientation="horizontal"]
172
+ [data-slot="tabs-v2-trigger-wrapper"]:has([data-selected]) {
173
+ background-color: var(--v2-background-bg-layer-03);
174
+ color: var(--v2-text-text-base);
175
+ border: 0.5px solid var(--v2-border-border-muted);
176
+ }
177
+
178
+ [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-list"] {
179
+ flex-direction: column;
180
+ width: 240px;
181
+ min-width: 200px;
182
+ height: 100%;
183
+ padding: 12px;
184
+ gap: 4px;
185
+ overflow-y: auto;
186
+ border-right: 1px solid var(--v2-border-border-base);
187
+ }
188
+
189
+ [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-section-title"] {
190
+ width: 100%;
191
+ padding-left: 4px;
192
+ color: var(--v2-text-text-muted);
193
+ font-size: 12px;
194
+ font-weight: 500;
195
+ }
196
+
197
+ [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-trigger-wrapper"] {
198
+ width: 100%;
199
+ height: 28px;
200
+ border-radius: 4px;
201
+ border: 0.5px solid transparent;
202
+ box-sizing: border-box;
203
+ color: var(--v2-text-text-muted);
204
+ }
205
+
206
+ [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-trigger"] {
207
+ width: 100%;
208
+ height: 100%;
209
+ justify-content: flex-start;
210
+ gap: 6px;
211
+ padding: 0 6px;
212
+ }
213
+
214
+ [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
215
+ [data-slot="tabs-v2-trigger-wrapper"]:hover:not(:disabled):not(:has([data-selected])) {
216
+ background-color: var(--v2-background-bg-layer-03);
217
+ color: var(--v2-text-text-base);
218
+ }
219
+
220
+ [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
221
+ [data-slot="tabs-v2-trigger-wrapper"]:has([data-selected]) {
222
+ background-color: var(--v2-background-bg-layer-03);
223
+ color: var(--v2-text-text-base);
224
+ border: 0.5px solid var(--v2-border-border-muted);
225
+ }