@opencode-ai/ui 0.0.0-dev-18801 → 0.0.0-dev-202609010712

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 (296) hide show
  1. package/dist/{data-display/accordion → components}/accordion.d.ts +6 -6
  2. package/dist/components/avatar.d.ts +9 -0
  3. package/dist/components/button.d.ts +9 -0
  4. package/dist/components/card.d.ts +1 -1
  5. package/dist/{forms/checkbox → components}/checkbox.d.ts +2 -2
  6. package/dist/components/dialog.d.ts +12 -0
  7. package/dist/{data-display/diff-changes → components}/diff-changes.d.ts +1 -2
  8. package/dist/components/dropdown-menu.d.ts +80 -0
  9. package/dist/components/icon-button.d.ts +10 -0
  10. package/dist/{icons/icon/additional-icons.d.ts → components/icon.d.ts} +8 -8
  11. package/dist/components/keybind.d.ts +6 -0
  12. package/dist/components/list.d.ts +1 -1
  13. package/dist/{feedback/progress-circle → components}/progress-circle.d.ts +0 -2
  14. package/dist/components/radio-group.d.ts +16 -0
  15. package/dist/components/scroll-view.d.ts +3 -3
  16. package/dist/components/select.d.ts +21 -0
  17. package/dist/{forms/switch → components}/switch.d.ts +2 -4
  18. package/dist/{navigation/tabs → components}/tabs.d.ts +8 -15
  19. package/dist/components/tag.d.ts +5 -0
  20. package/dist/{typography/text-shimmer → components}/text-shimmer.d.ts +0 -1
  21. package/dist/components/toast.d.ts +56 -0
  22. package/dist/components/tooltip.d.ts +17 -0
  23. package/dist/context/i18n.d.ts +7 -10
  24. package/dist/context/marked-parser.d.ts +2 -1
  25. package/dist/hooks/use-filtered-list.d.ts +0 -9
  26. package/dist/i18n/ar.d.ts +2 -0
  27. package/dist/i18n/bg.d.ts +2 -0
  28. package/dist/i18n/br.d.ts +2 -0
  29. package/dist/i18n/bs.d.ts +2 -0
  30. package/dist/i18n/da.d.ts +2 -0
  31. package/dist/i18n/de.d.ts +2 -0
  32. package/dist/i18n/en.d.ts +1 -230
  33. package/dist/i18n/es.d.ts +2 -0
  34. package/dist/i18n/fr.d.ts +2 -0
  35. package/dist/i18n/ja.d.ts +2 -0
  36. package/dist/i18n/km.d.ts +2 -0
  37. package/dist/i18n/ko.d.ts +2 -0
  38. package/dist/i18n/lo.d.ts +2 -0
  39. package/dist/i18n/mk.d.ts +2 -0
  40. package/dist/i18n/mn.d.ts +2 -0
  41. package/dist/i18n/my.d.ts +2 -0
  42. package/dist/i18n/pl.d.ts +2 -0
  43. package/dist/i18n/ru.d.ts +2 -0
  44. package/dist/i18n/sr.d.ts +2 -0
  45. package/dist/i18n/tg.d.ts +2 -0
  46. package/dist/i18n/th.d.ts +2 -0
  47. package/dist/i18n/tr.d.ts +2 -0
  48. package/dist/i18n/zh.d.ts +2 -0
  49. package/dist/i18n/zht.d.ts +2 -0
  50. package/dist/v2/components/accordion-v2.d.ts +26 -0
  51. package/dist/{data-display/avatar/avatar.d.ts → v2/components/avatar-v2.d.ts} +1 -1
  52. package/dist/v2/components/badge-v2.d.ts +6 -0
  53. package/dist/v2/components/button-v2.d.ts +10 -0
  54. package/dist/v2/components/checkbox-v2.d.ts +10 -0
  55. package/dist/{overlays/dialog/dialog.d.ts → v2/components/dialog-v2.d.ts} +2 -1
  56. package/dist/v2/components/diff-changes-v2.d.ts +11 -0
  57. package/dist/v2/components/divider-v2.d.ts +5 -0
  58. package/dist/{forms/field/field.d.ts → v2/components/field-v2.d.ts} +10 -4
  59. package/dist/v2/components/icon-button-v2.d.ts +11 -0
  60. package/dist/{icons/icon → v2/components}/icon.d.ts +1 -24
  61. package/dist/v2/components/inline-input-v2.d.ts +21 -0
  62. package/dist/v2/components/keybind-v2.d.ts +7 -0
  63. package/dist/{data-display/line-comment/line-comment.d.ts → v2/components/line-comment-v2.d.ts} +9 -9
  64. package/dist/v2/components/loader-v2.d.ts +3 -0
  65. package/dist/v2/components/menu-v2.d.ts +52 -0
  66. package/dist/v2/components/progress-circle-v2.d.ts +8 -0
  67. package/dist/{data-display/project-avatar/project-avatar.d.ts → v2/components/project-avatar-v2.d.ts} +1 -1
  68. package/dist/v2/components/radio-v2.d.ts +16 -0
  69. package/dist/{navigation/segmented-control/segmented-control.d.ts → v2/components/segmented-control-v2.d.ts} +5 -5
  70. package/dist/{forms/select/select.d.ts → v2/components/select-v2.d.ts} +6 -4
  71. package/dist/v2/components/split-button-v2.d.ts +5 -0
  72. package/dist/v2/components/switch-v2.d.ts +7 -0
  73. package/dist/v2/components/tabs-v2.d.ts +34 -0
  74. package/dist/{forms/text-input/text-input.d.ts → v2/components/text-input-v2.d.ts} +3 -3
  75. package/dist/v2/components/text-shimmer-v2.d.ts +9 -0
  76. package/dist/v2/components/textarea-v2.d.ts +7 -0
  77. package/dist/v2/components/toast-v2.d.ts +57 -0
  78. package/dist/v2/components/tooltip-v2.d.ts +13 -0
  79. package/dist/v2/components/wordmark-v2.d.ts +2 -0
  80. package/package.json +34 -140
  81. package/src/{data-display/accordion → components}/accordion.css +31 -5
  82. package/src/{data-display/accordion → components}/accordion.tsx +14 -14
  83. package/src/components/animated-number.css +11 -29
  84. package/src/components/animated-number.tsx +2 -2
  85. package/src/components/avatar.css +49 -0
  86. package/src/components/avatar.tsx +55 -0
  87. package/src/components/button.css +194 -0
  88. package/src/{actions/button → components}/button.tsx +11 -10
  89. package/src/components/card.css +23 -2
  90. package/src/components/card.tsx +4 -4
  91. package/src/{forms/checkbox → components}/checkbox.css +7 -1
  92. package/src/{forms/checkbox → components}/checkbox.tsx +13 -13
  93. package/src/components/collapsible.tsx +2 -2
  94. package/src/components/dialog.css +181 -0
  95. package/src/components/dialog.tsx +72 -0
  96. package/src/{data-display/diff-changes → components}/diff-changes.css +19 -22
  97. package/src/components/diff-changes.tsx +115 -0
  98. package/src/components/dock-surface.css +9 -2
  99. package/src/components/dropdown-menu.css +135 -0
  100. package/src/components/dropdown-menu.tsx +308 -0
  101. package/src/components/icon-button.css +181 -0
  102. package/src/components/icon-button.tsx +29 -0
  103. package/src/components/icon.css +39 -0
  104. package/src/{icons/icon/additional-icons.ts → components/icon.tsx} +74 -8
  105. package/src/components/image-preview.tsx +2 -3
  106. package/src/components/keybind.css +18 -0
  107. package/src/components/keybind.tsx +20 -0
  108. package/src/components/list.css +5 -5
  109. package/src/components/list.tsx +5 -7
  110. package/src/components/popover.tsx +2 -3
  111. package/src/components/progress-circle.css +16 -0
  112. package/src/components/progress-circle.tsx +64 -0
  113. package/src/components/radio-group.css +187 -0
  114. package/src/components/radio-group.tsx +83 -0
  115. package/src/components/scroll-view.tsx +20 -5
  116. package/src/components/select.css +201 -0
  117. package/src/components/select.tsx +174 -0
  118. package/src/components/sticky-accordion-header.tsx +1 -1
  119. package/src/components/switch.css +136 -0
  120. package/src/components/switch.tsx +29 -0
  121. package/src/{navigation/tabs → components}/tabs.css +229 -39
  122. package/src/components/tabs.tsx +126 -0
  123. package/src/components/tag.css +37 -0
  124. package/src/components/tag.tsx +22 -0
  125. package/src/components/text-field.tsx +4 -12
  126. package/src/{typography/text-shimmer → components}/text-shimmer.css +1 -2
  127. package/src/{typography/text-shimmer → components}/text-shimmer.tsx +0 -1
  128. package/src/components/toast.css +236 -0
  129. package/src/components/toast.tsx +185 -0
  130. package/src/components/tooltip.css +74 -0
  131. package/src/components/tooltip.tsx +163 -0
  132. package/src/context/dialog.tsx +0 -1
  133. package/src/context/i18n.tsx +14 -17
  134. package/src/context/marked-parser.tsx +13 -3
  135. package/src/hooks/create-auto-scroll.tsx +0 -20
  136. package/src/i18n/am.ts +3 -1
  137. package/src/i18n/ar.ts +3 -1
  138. package/src/i18n/az.ts +3 -1
  139. package/src/i18n/bg.ts +3 -1
  140. package/src/i18n/bn.ts +3 -1
  141. package/src/i18n/br.ts +3 -1
  142. package/src/i18n/bs.ts +3 -1
  143. package/src/i18n/ca.ts +3 -1
  144. package/src/i18n/cs.ts +3 -1
  145. package/src/i18n/da.ts +3 -1
  146. package/src/i18n/de.ts +3 -1
  147. package/src/i18n/dv.ts +3 -1
  148. package/src/i18n/dz.ts +3 -1
  149. package/src/i18n/el.ts +3 -1
  150. package/src/i18n/en.ts +5 -40
  151. package/src/i18n/es.ts +3 -1
  152. package/src/i18n/et.ts +3 -1
  153. package/src/i18n/fa.ts +3 -1
  154. package/src/i18n/fi.ts +3 -1
  155. package/src/i18n/fo.ts +3 -1
  156. package/src/i18n/fr.ts +3 -1
  157. package/src/i18n/hi.ts +3 -1
  158. package/src/i18n/hr.ts +3 -1
  159. package/src/i18n/hu.ts +3 -1
  160. package/src/i18n/hy.ts +3 -1
  161. package/src/i18n/id.ts +3 -1
  162. package/src/i18n/is.ts +3 -1
  163. package/src/i18n/it.ts +3 -1
  164. package/src/i18n/ja.ts +3 -1
  165. package/src/i18n/ka.ts +3 -1
  166. package/src/i18n/km.ts +3 -1
  167. package/src/i18n/ko.ts +3 -1
  168. package/src/i18n/lo.ts +3 -1
  169. package/src/i18n/lt.ts +3 -1
  170. package/src/i18n/lv.ts +3 -1
  171. package/src/i18n/mk.ts +3 -1
  172. package/src/i18n/mn.ts +3 -1
  173. package/src/i18n/ms.ts +3 -1
  174. package/src/i18n/my.ts +3 -1
  175. package/src/i18n/ne.ts +3 -1
  176. package/src/i18n/nl.ts +3 -1
  177. package/src/i18n/no.ts +3 -1
  178. package/src/i18n/pa.ts +3 -1
  179. package/src/i18n/pl.ts +3 -1
  180. package/src/i18n/ro.ts +3 -1
  181. package/src/i18n/ru.ts +3 -1
  182. package/src/i18n/si.ts +3 -1
  183. package/src/i18n/sk.ts +3 -1
  184. package/src/i18n/sl.ts +3 -1
  185. package/src/i18n/sq.ts +3 -1
  186. package/src/i18n/sr.ts +3 -1
  187. package/src/i18n/sv.ts +3 -1
  188. package/src/i18n/tg.ts +3 -1
  189. package/src/i18n/th.ts +3 -1
  190. package/src/i18n/tk.ts +3 -1
  191. package/src/i18n/tr.ts +3 -1
  192. package/src/i18n/uk.ts +3 -1
  193. package/src/i18n/ur.ts +3 -1
  194. package/src/i18n/uz.ts +3 -1
  195. package/src/i18n/vi.ts +3 -1
  196. package/src/i18n/zh.ts +3 -1
  197. package/src/i18n/zht.ts +3 -1
  198. package/src/styles/base.css +0 -5
  199. package/src/styles/index.css +20 -4
  200. package/src/styles/tailwind/colors.css +0 -1
  201. package/src/styles/tailwind/index.css +1 -18
  202. package/src/styles/theme.css +2 -2
  203. package/src/theme/context.tsx +11 -19
  204. package/src/theme/themes/oc-2.json +1 -3
  205. package/src/theme/v2/foreground.ts +0 -1
  206. package/src/theme/v2/mapping.ts +0 -4
  207. package/src/v2/components/accordion-v2.css +139 -0
  208. package/src/v2/components/accordion-v2.tsx +86 -0
  209. package/src/{data-display/avatar/avatar.tsx → v2/components/avatar-v2.tsx} +1 -1
  210. package/src/{data-display/badge/badge.css → v2/components/badge-v2.css} +0 -19
  211. package/src/{data-display/badge/badge.tsx → v2/components/badge-v2.tsx} +4 -6
  212. package/src/v2/components/button-v2.tsx +35 -0
  213. package/src/v2/components/checkbox-v2.css +184 -0
  214. package/src/v2/components/checkbox-v2.tsx +65 -0
  215. package/src/{overlays/dialog/dialog.css → v2/components/dialog-v2.css} +0 -3
  216. package/src/{overlays/dialog/dialog.tsx → v2/components/dialog-v2.tsx} +13 -11
  217. package/src/v2/components/diff-changes-v2.css +26 -0
  218. package/src/{data-display/diff-changes/diff-changes.tsx → v2/components/diff-changes-v2.tsx} +2 -7
  219. package/src/{layout/divider/divider.tsx → v2/components/divider-v2.tsx} +3 -3
  220. package/src/{forms/field/field.css → v2/components/field-v2.css} +1 -1
  221. package/src/{forms/field/field.tsx → v2/components/field-v2.tsx} +11 -9
  222. package/src/v2/components/icon-button-v2.tsx +37 -0
  223. package/src/{icons/icon → v2/components}/icon.tsx +9 -50
  224. package/src/v2/components/inline-input-v2.css +225 -0
  225. package/src/v2/components/inline-input-v2.tsx +107 -0
  226. package/src/{data-display/keybind/keybind.css → v2/components/keybind-v2.css} +1 -1
  227. package/src/{data-display/keybind/keybind.tsx → v2/components/keybind-v2.tsx} +3 -3
  228. package/src/{data-display/line-comment/line-comment.css → v2/components/line-comment-v2.css} +3 -3
  229. package/src/{data-display/line-comment/line-comment.tsx → v2/components/line-comment-v2.tsx} +15 -17
  230. package/src/{feedback/loader/loader.tsx → v2/components/loader-v2.tsx} +2 -2
  231. package/src/{navigation/menu/menu.css → v2/components/menu-v2.css} +2 -123
  232. package/src/{navigation/menu/menu.tsx → v2/components/menu-v2.tsx} +32 -96
  233. package/src/v2/components/progress-circle-v2.css +13 -0
  234. package/src/v2/components/progress-circle-v2.tsx +52 -0
  235. package/src/{data-display/project-avatar/project-avatar.tsx → v2/components/project-avatar-v2.tsx} +1 -1
  236. package/src/{forms/radio/radio.tsx → v2/components/radio-v2.tsx} +20 -30
  237. package/src/{navigation/segmented-control/segmented-control.css → v2/components/segmented-control-v2.css} +1 -1
  238. package/src/{navigation/segmented-control/segmented-control.tsx → v2/components/segmented-control-v2.tsx} +8 -9
  239. package/src/{forms/select/select.css → v2/components/select-v2.css} +8 -2
  240. package/src/{forms/select/select.tsx → v2/components/select-v2.tsx} +32 -38
  241. package/src/{actions/split-button/split-button.css → v2/components/split-button-v2.css} +6 -1
  242. package/src/{actions/split-button/split-button.tsx → v2/components/split-button-v2.tsx} +4 -4
  243. package/src/{forms/switch/switch.css → v2/components/switch-v2.css} +0 -110
  244. package/src/v2/components/switch-v2.tsx +28 -0
  245. package/src/{navigation/tabs/tabs-current.css → v2/components/tabs-v2.css} +10 -25
  246. package/src/v2/components/tabs-v2.tsx +149 -0
  247. package/src/{forms/text-input/text-input.css → v2/components/text-input-v2.css} +1 -1
  248. package/src/{forms/text-input/text-input.tsx → v2/components/text-input-v2.tsx} +4 -4
  249. package/src/v2/components/text-shimmer-v2.css +125 -0
  250. package/src/v2/components/text-shimmer-v2.tsx +63 -0
  251. package/src/{forms/textarea/textarea.tsx → v2/components/textarea-v2.tsx} +3 -3
  252. package/src/{feedback/toast/toast.tsx → v2/components/toast-v2.tsx} +58 -60
  253. package/src/{overlays/tooltip/tooltip.css → v2/components/tooltip-v2.css} +0 -26
  254. package/src/{overlays/tooltip/tooltip.tsx → v2/components/tooltip-v2.tsx} +17 -24
  255. package/src/{typography/wordmark/wordmark.tsx → v2/components/wordmark-v2.tsx} +1 -1
  256. package/src/{styles/tokens → v2/styles}/theme.css +14 -18
  257. package/dist/actions/button/button.d.ts +0 -10
  258. package/dist/actions/icon-button/icon-button.d.ts +0 -11
  259. package/dist/actions/split-button/split-button.d.ts +0 -5
  260. package/dist/context/marked-base.d.ts +0 -3
  261. package/dist/data-display/badge/badge.d.ts +0 -7
  262. package/dist/data-display/keybind/keybind.d.ts +0 -7
  263. package/dist/feedback/loader/loader.d.ts +0 -3
  264. package/dist/feedback/toast/toast.d.ts +0 -57
  265. package/dist/forms/radio/radio.d.ts +0 -16
  266. package/dist/forms/textarea/textarea.d.ts +0 -7
  267. package/dist/i18n/he.d.ts +0 -197
  268. package/dist/layout/divider/divider.d.ts +0 -5
  269. package/dist/navigation/menu/menu.d.ts +0 -59
  270. package/dist/overlays/tooltip/tooltip.d.ts +0 -15
  271. package/dist/typography/wordmark/wordmark.d.ts +0 -2
  272. package/src/actions/icon-button/icon-button.tsx +0 -32
  273. package/src/context/marked-base.tsx +0 -27
  274. package/src/feedback/progress-circle/progress-circle.css +0 -28
  275. package/src/feedback/progress-circle/progress-circle.tsx +0 -64
  276. package/src/forms/switch/switch.tsx +0 -34
  277. package/src/i18n/he.ts +0 -199
  278. package/src/icons/icon/icon.css +0 -3
  279. package/src/navigation/tabs/tabs.tsx +0 -194
  280. /package/dist/{forms/inline-input → components}/inline-input.d.ts +0 -0
  281. /package/dist/{navigation → v2/components}/tab-state-indicator.d.ts +0 -0
  282. /package/src/{forms/inline-input → components}/inline-input.css +0 -0
  283. /package/src/{forms/inline-input → components}/inline-input.tsx +0 -0
  284. /package/src/{data-display/avatar/avatar.css → v2/components/avatar-v2.css} +0 -0
  285. /package/src/{actions/button/button.css → v2/components/button-v2.css} +0 -0
  286. /package/src/{layout/divider/divider.css → v2/components/divider-v2.css} +0 -0
  287. /package/src/{styles/file-tree.css → v2/components/file-tree-v2.css} +0 -0
  288. /package/src/{actions/icon-button/icon-button.css → v2/components/icon-button-v2.css} +0 -0
  289. /package/src/{feedback/loader/loader.css → v2/components/loader-v2.css} +0 -0
  290. /package/src/{data-display/project-avatar/project-avatar.css → v2/components/project-avatar-v2.css} +0 -0
  291. /package/src/{forms/radio/radio.css → v2/components/radio-v2.css} +0 -0
  292. /package/src/{navigation → v2/components}/tab-state-indicator.tsx +0 -0
  293. /package/src/{forms/textarea/textarea.css → v2/components/textarea-v2.css} +0 -0
  294. /package/src/{feedback/toast/toast.css → v2/components/toast-v2.css} +0 -0
  295. /package/src/{styles/tokens → v2/styles}/colors.css +0 -0
  296. /package/src/{styles/tokens/index.css → v2/styles/tailwind.css} +0 -0
@@ -0,0 +1,18 @@
1
+ [data-component="keybind"] {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ flex-shrink: 0;
6
+ height: 20px;
7
+ padding: 0 8px;
8
+ border-radius: 2px;
9
+ background: var(--surface-base);
10
+ box-shadow: var(--shadow-xxs-border);
11
+
12
+ /* text-12-regular */
13
+ font-family: var(--font-family-sans);
14
+ font-size: 12px;
15
+ font-weight: var(--font-weight-regular);
16
+ line-height: 1;
17
+ color: var(--text-weak);
18
+ }
@@ -0,0 +1,20 @@
1
+ import type { ComponentProps, ParentProps } from "solid-js"
2
+
3
+ export interface KeybindProps extends ParentProps {
4
+ class?: string
5
+ classList?: ComponentProps<"span">["classList"]
6
+ }
7
+
8
+ export function Keybind(props: KeybindProps) {
9
+ return (
10
+ <span
11
+ data-component="keybind"
12
+ classList={{
13
+ ...props.classList,
14
+ [props.class ?? ""]: !!props.class,
15
+ }}
16
+ >
17
+ {props.children}
18
+ </span>
19
+ )
20
+ }
@@ -31,7 +31,7 @@
31
31
  align-self: stretch;
32
32
  margin-bottom: 4px;
33
33
 
34
- > [data-component="icon-button-v2"] {
34
+ > [data-component="icon-button"] {
35
35
  width: 24px;
36
36
  height: 24px;
37
37
  flex-shrink: 0;
@@ -83,7 +83,7 @@
83
83
  }
84
84
  }
85
85
 
86
- > [data-component="icon-button-v2"] {
86
+ > [data-component="icon-button"] {
87
87
  width: 20px;
88
88
  height: 20px;
89
89
  background-color: transparent;
@@ -106,7 +106,7 @@
106
106
  }
107
107
  }
108
108
 
109
- > [data-component="icon-button-v2"] {
109
+ > [data-component="icon-button"] {
110
110
  background-color: transparent;
111
111
 
112
112
  &:hover:not(:disabled),
@@ -252,7 +252,7 @@
252
252
  justify-content: center;
253
253
  flex-shrink: 0;
254
254
  aspect-ratio: 1/1;
255
- [data-slot="icon-svg"] {
255
+ [data-component="icon"] {
256
256
  color: var(--icon-strong-base);
257
257
  }
258
258
  }
@@ -262,7 +262,7 @@
262
262
  justify-content: center;
263
263
  flex-shrink: 0;
264
264
  aspect-ratio: 1/1;
265
- [data-slot="icon-svg"] {
265
+ [data-component="icon"] {
266
266
  color: var(--icon-strong-base);
267
267
  }
268
268
  }
@@ -3,8 +3,8 @@ import { createEffect, For, type JSX, on, Show } from "solid-js"
3
3
  import { createStore } from "solid-js/store"
4
4
  import { makeEventListener } from "@solid-primitives/event-listener"
5
5
  import { useI18n } from "../context/i18n"
6
- import { Icon, type IconProps } from "@opencode-ai/ui/icon"
7
- import { IconButton } from "@opencode-ai/ui/icon-button"
6
+ import { Icon, type IconProps } from "./icon"
7
+ import { IconButton } from "./icon-button"
8
8
  import { TextField } from "./text-field"
9
9
 
10
10
  function findByKey(container: HTMLElement, key: string) {
@@ -302,7 +302,7 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
302
302
  </div>
303
303
  <Show when={internalFilter()}>
304
304
  <IconButton
305
- icon={<Icon name="circle-x" />}
305
+ icon="circle-x"
306
306
  variant="ghost"
307
307
  onClick={() => {
308
308
  setInternalFilter("")
@@ -367,11 +367,9 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
367
367
  </span>
368
368
  )}
369
369
  </Show>
370
- <Show
371
- when={props.divider && (i() !== group.items.length - 1 || (showAdd() && isLastGroup()))}
372
- >
370
+ {props.divider && (i() !== group.items.length - 1 || (showAdd() && isLastGroup())) && (
373
371
  <span data-slot="list-item-divider" />
374
- </Show>
372
+ )}
375
373
  </button>
376
374
  )
377
375
  if (props.itemWrapper) return props.itemWrapper(item, node)
@@ -3,8 +3,7 @@ import { ComponentProps, JSXElement, ParentProps, Show, createEffect, splitProps
3
3
  import { createStore } from "solid-js/store"
4
4
  import { makeEventListener } from "@solid-primitives/event-listener"
5
5
  import { useI18n } from "../context/i18n"
6
- import { Icon } from "@opencode-ai/ui/icon"
7
- import { IconButton } from "@opencode-ai/ui/icon-button"
6
+ import { IconButton } from "./icon-button"
8
7
 
9
8
  export interface PopoverProps<T extends ValidComponent = "div">
10
9
  extends ParentProps,
@@ -123,7 +122,7 @@ export function Popover<T extends ValidComponent = "div">(props: PopoverProps<T>
123
122
  <Kobalte.CloseButton
124
123
  data-slot="popover-close-button"
125
124
  as={IconButton}
126
- icon={<Icon name="close" />}
125
+ icon="close"
127
126
  variant="ghost"
128
127
  aria-label={i18n.t("ui.common.close")}
129
128
  />
@@ -0,0 +1,16 @@
1
+ [data-component="progress-circle"] {
2
+ transform: rotate(-90deg);
3
+
4
+ [data-slot="progress-circle-background"] {
5
+ stroke: var(--progress-circle-background, var(--border-weak-base));
6
+ }
7
+
8
+ [data-slot="progress-circle-background-overlay"] {
9
+ stroke: var(--progress-circle-background-overlay, transparent);
10
+ }
11
+
12
+ [data-slot="progress-circle-progress"] {
13
+ stroke: var(--progress-circle-progress, var(--border-active));
14
+ transition: stroke-dashoffset 0.35s cubic-bezier(0.65, 0, 0.35, 1);
15
+ }
16
+ }
@@ -0,0 +1,64 @@
1
+ import { type ComponentProps, createMemo, splitProps } from "solid-js"
2
+
3
+ export interface ProgressCircleProps extends Pick<ComponentProps<"svg">, "class" | "classList" | "style"> {
4
+ percentage: number
5
+ size?: number
6
+ strokeWidth?: number
7
+ }
8
+
9
+ export function ProgressCircle(props: ProgressCircleProps) {
10
+ const [split, rest] = splitProps(props, ["percentage", "size", "strokeWidth", "class", "classList"])
11
+
12
+ const size = () => split.size || 16
13
+ const strokeWidth = () => split.strokeWidth || 3
14
+
15
+ const viewBoxSize = 16
16
+ const center = viewBoxSize / 2
17
+ const radius = () => center - strokeWidth() / 2
18
+ const circumference = createMemo(() => 2 * Math.PI * radius())
19
+
20
+ const offset = createMemo(() => {
21
+ const clampedPercentage = Math.max(0, Math.min(100, split.percentage || 0))
22
+ const progress = clampedPercentage / 100
23
+ return circumference() * (1 - progress)
24
+ })
25
+
26
+ return (
27
+ <svg
28
+ {...rest}
29
+ width={size()}
30
+ height={size()}
31
+ viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}
32
+ fill="none"
33
+ data-component="progress-circle"
34
+ classList={{
35
+ ...split.classList,
36
+ [split.class ?? ""]: !!split.class,
37
+ }}
38
+ >
39
+ <circle
40
+ cx={center}
41
+ cy={center}
42
+ r={radius()}
43
+ data-slot="progress-circle-background"
44
+ stroke-width={strokeWidth()}
45
+ />
46
+ <circle
47
+ cx={center}
48
+ cy={center}
49
+ r={radius()}
50
+ data-slot="progress-circle-background-overlay"
51
+ stroke-width={strokeWidth()}
52
+ />
53
+ <circle
54
+ cx={center}
55
+ cy={center}
56
+ r={radius()}
57
+ data-slot="progress-circle-progress"
58
+ stroke-width={strokeWidth()}
59
+ stroke-dasharray={circumference().toString()}
60
+ stroke-dashoffset={offset()}
61
+ />
62
+ </svg>
63
+ )
64
+ }
@@ -0,0 +1,187 @@
1
+ [data-component="radio-group"] {
2
+ --radio-group-height: 28px;
3
+ --radio-group-gap: 4px;
4
+ --radio-group-padding: 2px;
5
+
6
+ display: inline-flex;
7
+
8
+ [data-slot="radio-group-wrapper"] {
9
+ all: unset;
10
+ background-color: var(--surface-inset-base);
11
+ border-radius: var(--radius-sm);
12
+ box-shadow: var(--shadow-xxs-border);
13
+ display: inline-flex;
14
+ height: var(--radio-group-height);
15
+ margin: 0;
16
+ overflow: visible;
17
+ padding: 0;
18
+ position: relative;
19
+ width: fit-content;
20
+ }
21
+
22
+ &[data-fill] [data-slot="radio-group-wrapper"] {
23
+ width: 100%;
24
+ }
25
+
26
+ [data-slot="radio-group-items"] {
27
+ display: inline-flex;
28
+ flex-direction: row;
29
+ gap: var(--radio-group-gap);
30
+ height: 100%;
31
+ list-style: none;
32
+ position: relative;
33
+ z-index: 1;
34
+ }
35
+
36
+ &[data-fill] [data-slot="radio-group-items"] {
37
+ width: 100%;
38
+ }
39
+
40
+ [data-slot="radio-group-indicator"] {
41
+ background: var(--button-secondary-base);
42
+ border-radius: var(--radius-sm);
43
+ box-shadow: var(--shadow-xs-border-base);
44
+ content: "";
45
+ opacity: var(--indicator-opacity, 1);
46
+ pointer-events: none;
47
+ position: absolute;
48
+ transition:
49
+ opacity 200ms ease-out,
50
+ box-shadow 100ms ease-in-out,
51
+ width 200ms cubic-bezier(0.22, 1.2, 0.36, 1),
52
+ height 200ms cubic-bezier(0.22, 1.2, 0.36, 1),
53
+ transform 300ms cubic-bezier(0.22, 1.2, 0.36, 1);
54
+ will-change: transform;
55
+ z-index: 0;
56
+ }
57
+
58
+ [data-slot="radio-group-item"] {
59
+ display: flex;
60
+ height: 100%;
61
+ min-width: 0;
62
+ position: relative;
63
+ }
64
+
65
+ &[data-fill] [data-slot="radio-group-item"] {
66
+ flex: 1;
67
+ }
68
+
69
+ [data-slot="radio-group-item-input"] {
70
+ border-width: 0;
71
+ clip: rect(0 0 0 0);
72
+ height: 1px;
73
+ margin: -1px;
74
+ overflow: hidden;
75
+ padding: 0;
76
+ position: absolute;
77
+ white-space: nowrap;
78
+ width: 1px;
79
+ }
80
+
81
+ [data-slot="radio-group-item-label"] {
82
+ color: var(--text-weak);
83
+ cursor: default;
84
+ display: flex;
85
+ align-items: center;
86
+ justify-content: center;
87
+ font-family: var(--font-family-sans);
88
+ font-size: var(--font-size-small);
89
+ font-weight: var(--font-weight-medium);
90
+ flex: 1;
91
+ height: 100%;
92
+ line-height: 1;
93
+ padding: var(--radio-group-padding);
94
+ position: relative;
95
+ transition:
96
+ color 200ms ease-out,
97
+ opacity 200ms ease-out;
98
+ user-select: none;
99
+ }
100
+
101
+ [data-slot="radio-group-item-control"] {
102
+ align-items: center;
103
+ border-radius: var(--radius-xs);
104
+ display: inline-flex;
105
+ height: 100%;
106
+ justify-content: center;
107
+ min-width: 0;
108
+ padding: var(--radio-group-control-padding, 0 10px);
109
+ transition: background-color 200ms ease-out;
110
+ width: 100%;
111
+ }
112
+
113
+ &[data-pad="none"] {
114
+ --radio-group-control-padding: 0;
115
+ }
116
+
117
+ &[data-pad="normal"] {
118
+ --radio-group-control-padding: 0 10px;
119
+ }
120
+
121
+ /* Checked state */
122
+ [data-slot="radio-group-item-input"][data-checked] + [data-slot="radio-group-item-label"] {
123
+ color: var(--text-strong);
124
+ }
125
+
126
+ /* Hover state: match the inset background (adds subtle density) */
127
+ [data-slot="radio-group-item-input"]:not([data-checked], [data-disabled])
128
+ + [data-slot="radio-group-item-label"]:hover
129
+ [data-slot="radio-group-item-control"] {
130
+ background-color: var(--surface-inset-base);
131
+ }
132
+
133
+ /* Do not overlay hover on the active segment */
134
+ [data-slot="radio-group-item-input"][data-checked]
135
+ + [data-slot="radio-group-item-label"]:hover
136
+ [data-slot="radio-group-item-control"] {
137
+ background-color: transparent;
138
+ }
139
+
140
+ /* Disabled state */
141
+ [data-slot="radio-group-item-input"][data-disabled] + [data-slot="radio-group-item-label"] {
142
+ cursor: not-allowed;
143
+ opacity: 0.5;
144
+ }
145
+
146
+ /* Focus state */
147
+ [data-slot="radio-group-wrapper"]:has([data-slot="radio-group-item-input"]:focus-visible)
148
+ [data-slot="radio-group-indicator"] {
149
+ box-shadow: var(--shadow-xs-border-focus);
150
+ }
151
+
152
+ /* Hide indicator when nothing is checked */
153
+ [data-slot="radio-group-wrapper"]:not(:has([data-slot="radio-group-item-input"][data-checked]))
154
+ [data-slot="radio-group-indicator"] {
155
+ --indicator-opacity: 0;
156
+ }
157
+
158
+ /* Vertical orientation */
159
+ &[aria-orientation="vertical"] [data-slot="radio-group-items"] {
160
+ flex-direction: column;
161
+ }
162
+
163
+ /* Small size variant */
164
+ &[data-size="small"] {
165
+ --radio-group-height: 24px;
166
+ --radio-group-gap: 3px;
167
+ --radio-group-padding: 2px;
168
+
169
+ [data-slot="radio-group-item-label"] {
170
+ font-size: 12px;
171
+ }
172
+
173
+ [data-slot="radio-group-item-control"] {
174
+ padding: var(--radio-group-control-padding, 0 8px);
175
+ }
176
+ }
177
+
178
+ &[data-size="small"][data-pad="normal"] {
179
+ --radio-group-control-padding: 0 8px;
180
+ }
181
+
182
+ /* Disabled root state */
183
+ &[data-disabled] {
184
+ opacity: 0.5;
185
+ cursor: not-allowed;
186
+ }
187
+ }
@@ -0,0 +1,83 @@
1
+ import { SegmentedControl as Kobalte } from "@kobalte/core/segmented-control"
2
+ import { For, splitProps } from "solid-js"
3
+ import type { ComponentProps, JSX } from "solid-js"
4
+
5
+ export type RadioGroupProps<T> = Omit<
6
+ ComponentProps<typeof Kobalte>,
7
+ "value" | "defaultValue" | "onChange" | "children"
8
+ > & {
9
+ options: T[]
10
+ current?: T
11
+ defaultValue?: T
12
+ value?: (x: T) => string
13
+ label?: (x: T) => JSX.Element | string
14
+ onSelect?: (value: T | undefined) => void
15
+ class?: ComponentProps<"div">["class"]
16
+ classList?: ComponentProps<"div">["classList"]
17
+ size?: "small" | "medium"
18
+ fill?: boolean
19
+ pad?: "none" | "normal"
20
+ }
21
+
22
+ export function RadioGroup<T>(props: RadioGroupProps<T>) {
23
+ const [local, others] = splitProps(props, [
24
+ "class",
25
+ "classList",
26
+ "options",
27
+ "current",
28
+ "defaultValue",
29
+ "value",
30
+ "label",
31
+ "onSelect",
32
+ "size",
33
+ "fill",
34
+ "pad",
35
+ ])
36
+
37
+ const getValue = (item: T): string => {
38
+ if (local.value) return local.value(item)
39
+ return String(item)
40
+ }
41
+
42
+ const getLabel = (item: T): JSX.Element | string => {
43
+ if (local.label) return local.label(item)
44
+ return String(item)
45
+ }
46
+
47
+ const findOption = (v: string): T | undefined => {
48
+ return local.options.find((opt) => getValue(opt) === v)
49
+ }
50
+
51
+ return (
52
+ <Kobalte
53
+ {...others}
54
+ data-component="radio-group"
55
+ data-size={local.size ?? "medium"}
56
+ data-fill={local.fill ? "" : undefined}
57
+ data-pad={local.pad ?? "normal"}
58
+ classList={{
59
+ ...local.classList,
60
+ [local.class ?? ""]: !!local.class,
61
+ }}
62
+ value={local.current ? getValue(local.current) : undefined}
63
+ defaultValue={local.defaultValue ? getValue(local.defaultValue) : undefined}
64
+ onChange={(v) => local.onSelect?.(findOption(v))}
65
+ >
66
+ <div role="presentation" data-slot="radio-group-wrapper">
67
+ <Kobalte.Indicator data-slot="radio-group-indicator" />
68
+ <div role="presentation" data-slot="radio-group-items">
69
+ <For each={local.options}>
70
+ {(option) => (
71
+ <Kobalte.Item value={getValue(option)} data-slot="radio-group-item" data-value={getValue(option)}>
72
+ <Kobalte.ItemInput data-slot="radio-group-item-input" />
73
+ <Kobalte.ItemLabel data-slot="radio-group-item-label">
74
+ <span data-slot="radio-group-item-control">{getLabel(option)}</span>
75
+ </Kobalte.ItemLabel>
76
+ </Kobalte.Item>
77
+ )}
78
+ </For>
79
+ </div>
80
+ </div>
81
+ </Kobalte>
82
+ )
83
+ }
@@ -1,4 +1,14 @@
1
- import { createEffect, mergeProps, onCleanup, onMount, Show, splitProps, type ComponentProps } from "solid-js"
1
+ import {
2
+ createEffect,
3
+ createMemo,
4
+ mergeProps,
5
+ onCleanup,
6
+ onMount,
7
+ Show,
8
+ splitProps,
9
+ type Accessor,
10
+ type ComponentProps,
11
+ } from "solid-js"
2
12
  import { Portal } from "solid-js/web"
3
13
  import { createResizeObserver } from "@solid-primitives/resize-observer"
4
14
  import { createStore } from "solid-js/store"
@@ -17,9 +27,9 @@ export interface ScrollViewProps extends ComponentProps<"div"> {
17
27
  * */
18
28
  thumbVisibility?: ScrollViewThumbVisibility
19
29
  /** Mount the thumb into an external track. Scroll metrics still come from this ScrollView. */
20
- thumbContainer?: HTMLElement
30
+ thumbContainer?: HTMLElement | Accessor<HTMLElement | undefined>
21
31
  /** Element whose hover reveals the thumb. Defaults to the ScrollView root when unset. */
22
- thumbHoverTarget?: HTMLElement
32
+ thumbHoverTarget?: HTMLElement | Accessor<HTMLElement | undefined>
23
33
  }
24
34
 
25
35
  export const scrollKey = (event: Pick<KeyboardEvent, "key" | "altKey" | "ctrlKey" | "metaKey" | "shiftKey">) => {
@@ -118,8 +128,13 @@ export function ScrollView(props: ScrollViewProps) {
118
128
  let viewportRef!: HTMLDivElement
119
129
  let thumbRef!: HTMLDivElement
120
130
 
121
- const thumbMount = () => local.thumbContainer
122
- const thumbHover = () => local.thumbHoverTarget
131
+ const resolveEl = (value: HTMLElement | Accessor<HTMLElement | undefined> | undefined) => {
132
+ if (typeof value === "function") return value()
133
+ return value
134
+ }
135
+
136
+ const thumbMount = createMemo(() => resolveEl(local.thumbContainer))
137
+ const thumbHover = createMemo(() => resolveEl(local.thumbHoverTarget))
123
138
  const hoverRoot = () => !local.thumbHoverTarget && !local.thumbContainer
124
139
 
125
140
  const [state, setState] = createStore({