@opencode-ai/ui 0.0.0-dev-17913 → 0.0.0-dev-202608221251

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 (288) 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/i18n/ar.d.ts +2 -0
  25. package/dist/i18n/bg.d.ts +2 -0
  26. package/dist/i18n/br.d.ts +2 -0
  27. package/dist/i18n/bs.d.ts +2 -0
  28. package/dist/i18n/da.d.ts +2 -0
  29. package/dist/i18n/de.d.ts +2 -0
  30. package/dist/i18n/en.d.ts +1 -218
  31. package/dist/i18n/es.d.ts +2 -0
  32. package/dist/i18n/fr.d.ts +2 -0
  33. package/dist/i18n/ja.d.ts +2 -0
  34. package/dist/i18n/km.d.ts +2 -0
  35. package/dist/i18n/ko.d.ts +2 -0
  36. package/dist/i18n/lo.d.ts +2 -0
  37. package/dist/i18n/mk.d.ts +2 -0
  38. package/dist/i18n/mn.d.ts +2 -0
  39. package/dist/i18n/my.d.ts +2 -0
  40. package/dist/i18n/pl.d.ts +2 -0
  41. package/dist/i18n/ru.d.ts +2 -0
  42. package/dist/i18n/sr.d.ts +2 -0
  43. package/dist/i18n/tg.d.ts +2 -0
  44. package/dist/i18n/th.d.ts +2 -0
  45. package/dist/i18n/tr.d.ts +2 -0
  46. package/dist/i18n/zh.d.ts +2 -0
  47. package/dist/i18n/zht.d.ts +2 -0
  48. package/dist/v2/components/accordion-v2.d.ts +26 -0
  49. package/dist/{data-display/avatar/avatar.d.ts → v2/components/avatar-v2.d.ts} +1 -1
  50. package/dist/v2/components/badge-v2.d.ts +6 -0
  51. package/dist/v2/components/button-v2.d.ts +10 -0
  52. package/dist/v2/components/checkbox-v2.d.ts +10 -0
  53. package/dist/{overlays/dialog/dialog.d.ts → v2/components/dialog-v2.d.ts} +2 -1
  54. package/dist/v2/components/diff-changes-v2.d.ts +11 -0
  55. package/dist/v2/components/divider-v2.d.ts +5 -0
  56. package/dist/{forms/field/field.d.ts → v2/components/field-v2.d.ts} +10 -4
  57. package/dist/v2/components/icon-button-v2.d.ts +11 -0
  58. package/dist/{icons/icon → v2/components}/icon.d.ts +1 -20
  59. package/dist/v2/components/inline-input-v2.d.ts +21 -0
  60. package/dist/v2/components/keybind-v2.d.ts +7 -0
  61. package/dist/{data-display/line-comment/line-comment.d.ts → v2/components/line-comment-v2.d.ts} +9 -9
  62. package/dist/v2/components/loader-v2.d.ts +3 -0
  63. package/dist/v2/components/menu-v2.d.ts +52 -0
  64. package/dist/v2/components/progress-circle-v2.d.ts +8 -0
  65. package/dist/{data-display/project-avatar/project-avatar.d.ts → v2/components/project-avatar-v2.d.ts} +1 -1
  66. package/dist/v2/components/radio-v2.d.ts +16 -0
  67. package/dist/{navigation/segmented-control/segmented-control.d.ts → v2/components/segmented-control-v2.d.ts} +5 -5
  68. package/dist/{forms/select/select.d.ts → v2/components/select-v2.d.ts} +6 -4
  69. package/dist/v2/components/split-button-v2.d.ts +5 -0
  70. package/dist/v2/components/switch-v2.d.ts +7 -0
  71. package/dist/v2/components/tabs-v2.d.ts +34 -0
  72. package/dist/{forms/text-input/text-input.d.ts → v2/components/text-input-v2.d.ts} +3 -3
  73. package/dist/v2/components/text-shimmer-v2.d.ts +9 -0
  74. package/dist/v2/components/textarea-v2.d.ts +7 -0
  75. package/dist/v2/components/toast-v2.d.ts +57 -0
  76. package/dist/v2/components/tooltip-v2.d.ts +13 -0
  77. package/dist/v2/components/wordmark-v2.d.ts +2 -0
  78. package/package.json +13 -131
  79. package/src/{data-display/accordion → components}/accordion.css +26 -1
  80. package/src/{data-display/accordion → components}/accordion.tsx +14 -14
  81. package/src/components/animated-number.css +11 -29
  82. package/src/components/animated-number.tsx +2 -2
  83. package/src/components/avatar.css +49 -0
  84. package/src/components/avatar.tsx +55 -0
  85. package/src/components/button.css +194 -0
  86. package/src/{actions/button → components}/button.tsx +11 -10
  87. package/src/components/card.css +23 -2
  88. package/src/components/card.tsx +4 -4
  89. package/src/{forms/checkbox → components}/checkbox.css +7 -1
  90. package/src/{forms/checkbox → components}/checkbox.tsx +13 -13
  91. package/src/components/collapsible.tsx +2 -2
  92. package/src/components/dialog.css +181 -0
  93. package/src/components/dialog.tsx +72 -0
  94. package/src/{data-display/diff-changes → components}/diff-changes.css +19 -22
  95. package/src/components/diff-changes.tsx +115 -0
  96. package/src/components/dock-surface.css +9 -2
  97. package/src/components/dropdown-menu.css +135 -0
  98. package/src/components/dropdown-menu.tsx +308 -0
  99. package/src/components/icon-button.css +181 -0
  100. package/src/components/icon-button.tsx +29 -0
  101. package/src/components/icon.css +39 -0
  102. package/src/{icons/icon/additional-icons.ts → components/icon.tsx} +74 -8
  103. package/src/components/image-preview.tsx +2 -3
  104. package/src/components/keybind.css +18 -0
  105. package/src/components/keybind.tsx +20 -0
  106. package/src/components/list.css +5 -5
  107. package/src/components/list.tsx +5 -7
  108. package/src/components/popover.tsx +2 -3
  109. package/src/components/progress-circle.css +16 -0
  110. package/src/components/progress-circle.tsx +64 -0
  111. package/src/components/provider-icon.tsx +1 -1
  112. package/src/components/radio-group.css +187 -0
  113. package/src/components/radio-group.tsx +83 -0
  114. package/src/components/scroll-view.tsx +20 -5
  115. package/src/components/select.css +201 -0
  116. package/src/components/select.tsx +174 -0
  117. package/src/components/sticky-accordion-header.tsx +1 -1
  118. package/src/components/switch.css +136 -0
  119. package/src/components/switch.tsx +29 -0
  120. package/src/{navigation/tabs → components}/tabs.css +229 -39
  121. package/src/components/tabs.tsx +126 -0
  122. package/src/components/tag.css +37 -0
  123. package/src/components/tag.tsx +22 -0
  124. package/src/components/text-field.tsx +4 -12
  125. package/src/{typography/text-shimmer → components}/text-shimmer.css +1 -2
  126. package/src/{typography/text-shimmer → components}/text-shimmer.tsx +0 -1
  127. package/src/components/toast.css +236 -0
  128. package/src/components/toast.tsx +185 -0
  129. package/src/components/tooltip.css +74 -0
  130. package/src/components/tooltip.tsx +163 -0
  131. package/src/context/i18n.tsx +14 -17
  132. package/src/hooks/create-auto-scroll.tsx +0 -20
  133. package/src/i18n/am.ts +2 -0
  134. package/src/i18n/ar.ts +2 -0
  135. package/src/i18n/az.ts +2 -0
  136. package/src/i18n/bg.ts +2 -0
  137. package/src/i18n/bn.ts +2 -0
  138. package/src/i18n/br.ts +2 -0
  139. package/src/i18n/bs.ts +2 -0
  140. package/src/i18n/ca.ts +2 -0
  141. package/src/i18n/cs.ts +2 -0
  142. package/src/i18n/da.ts +2 -0
  143. package/src/i18n/de.ts +2 -0
  144. package/src/i18n/dv.ts +2 -0
  145. package/src/i18n/dz.ts +2 -0
  146. package/src/i18n/el.ts +2 -0
  147. package/src/i18n/en.ts +4 -27
  148. package/src/i18n/es.ts +2 -0
  149. package/src/i18n/et.ts +2 -0
  150. package/src/i18n/fa.ts +2 -0
  151. package/src/i18n/fi.ts +2 -0
  152. package/src/i18n/fo.ts +2 -0
  153. package/src/i18n/fr.ts +2 -0
  154. package/src/i18n/hi.ts +2 -0
  155. package/src/i18n/hr.ts +2 -0
  156. package/src/i18n/hu.ts +2 -0
  157. package/src/i18n/hy.ts +2 -0
  158. package/src/i18n/id.ts +2 -0
  159. package/src/i18n/is.ts +2 -0
  160. package/src/i18n/it.ts +2 -0
  161. package/src/i18n/ja.ts +2 -0
  162. package/src/i18n/ka.ts +2 -0
  163. package/src/i18n/km.ts +2 -0
  164. package/src/i18n/ko.ts +2 -0
  165. package/src/i18n/lo.ts +2 -0
  166. package/src/i18n/lt.ts +2 -0
  167. package/src/i18n/lv.ts +2 -0
  168. package/src/i18n/mk.ts +2 -0
  169. package/src/i18n/mn.ts +2 -0
  170. package/src/i18n/ms.ts +2 -0
  171. package/src/i18n/my.ts +2 -0
  172. package/src/i18n/ne.ts +2 -0
  173. package/src/i18n/nl.ts +2 -0
  174. package/src/i18n/no.ts +2 -0
  175. package/src/i18n/pa.ts +2 -0
  176. package/src/i18n/pl.ts +2 -0
  177. package/src/i18n/ro.ts +2 -0
  178. package/src/i18n/ru.ts +2 -0
  179. package/src/i18n/si.ts +2 -0
  180. package/src/i18n/sk.ts +2 -0
  181. package/src/i18n/sl.ts +2 -0
  182. package/src/i18n/sq.ts +2 -0
  183. package/src/i18n/sr.ts +2 -0
  184. package/src/i18n/sv.ts +2 -0
  185. package/src/i18n/tg.ts +2 -0
  186. package/src/i18n/th.ts +2 -0
  187. package/src/i18n/tk.ts +2 -0
  188. package/src/i18n/tr.ts +2 -0
  189. package/src/i18n/uk.ts +2 -0
  190. package/src/i18n/ur.ts +2 -0
  191. package/src/i18n/uz.ts +2 -0
  192. package/src/i18n/vi.ts +2 -0
  193. package/src/i18n/zh.ts +2 -0
  194. package/src/i18n/zht.ts +2 -0
  195. package/src/styles/index.css +20 -4
  196. package/src/styles/tailwind/colors.css +0 -1
  197. package/src/styles/tailwind/index.css +1 -15
  198. package/src/theme/context.tsx +11 -19
  199. package/src/theme/themes/oc-2.json +1 -3
  200. package/src/theme/v2/foreground.ts +0 -1
  201. package/src/v2/components/accordion-v2.css +139 -0
  202. package/src/v2/components/accordion-v2.tsx +86 -0
  203. package/src/{data-display/avatar/avatar.tsx → v2/components/avatar-v2.tsx} +1 -1
  204. package/src/{data-display/badge/badge.css → v2/components/badge-v2.css} +0 -19
  205. package/src/{data-display/badge/badge.tsx → v2/components/badge-v2.tsx} +4 -6
  206. package/src/v2/components/button-v2.tsx +35 -0
  207. package/src/v2/components/checkbox-v2.css +184 -0
  208. package/src/v2/components/checkbox-v2.tsx +65 -0
  209. package/src/{overlays/dialog/dialog.css → v2/components/dialog-v2.css} +0 -3
  210. package/src/{overlays/dialog/dialog.tsx → v2/components/dialog-v2.tsx} +13 -11
  211. package/src/v2/components/diff-changes-v2.css +26 -0
  212. package/src/{data-display/diff-changes/diff-changes.tsx → v2/components/diff-changes-v2.tsx} +2 -7
  213. package/src/{layout/divider/divider.tsx → v2/components/divider-v2.tsx} +3 -3
  214. package/src/{forms/field/field.tsx → v2/components/field-v2.tsx} +11 -9
  215. package/src/v2/components/icon-button-v2.tsx +37 -0
  216. package/src/{icons/icon → v2/components}/icon.tsx +9 -46
  217. package/src/v2/components/inline-input-v2.css +225 -0
  218. package/src/v2/components/inline-input-v2.tsx +107 -0
  219. package/src/{data-display/keybind/keybind.css → v2/components/keybind-v2.css} +1 -1
  220. package/src/{data-display/keybind/keybind.tsx → v2/components/keybind-v2.tsx} +3 -3
  221. package/src/{data-display/line-comment/line-comment.tsx → v2/components/line-comment-v2.tsx} +15 -17
  222. package/src/{feedback/loader/loader.tsx → v2/components/loader-v2.tsx} +2 -2
  223. package/src/{navigation/menu/menu.css → v2/components/menu-v2.css} +0 -121
  224. package/src/{navigation/menu/menu.tsx → v2/components/menu-v2.tsx} +32 -96
  225. package/src/v2/components/progress-circle-v2.css +13 -0
  226. package/src/v2/components/progress-circle-v2.tsx +52 -0
  227. package/src/{data-display/project-avatar/project-avatar.tsx → v2/components/project-avatar-v2.tsx} +1 -1
  228. package/src/{forms/radio/radio.tsx → v2/components/radio-v2.tsx} +20 -30
  229. package/src/{navigation/segmented-control/segmented-control.tsx → v2/components/segmented-control-v2.tsx} +8 -9
  230. package/src/{forms/select/select.css → v2/components/select-v2.css} +8 -2
  231. package/src/{forms/select/select.tsx → v2/components/select-v2.tsx} +32 -38
  232. package/src/{actions/split-button/split-button.css → v2/components/split-button-v2.css} +6 -1
  233. package/src/{actions/split-button/split-button.tsx → v2/components/split-button-v2.tsx} +4 -4
  234. package/src/{forms/switch/switch.css → v2/components/switch-v2.css} +0 -110
  235. package/src/v2/components/switch-v2.tsx +28 -0
  236. package/src/{navigation/tabs/tabs-current.css → v2/components/tabs-v2.css} +9 -24
  237. package/src/v2/components/tabs-v2.tsx +149 -0
  238. package/src/{forms/text-input/text-input.tsx → v2/components/text-input-v2.tsx} +4 -4
  239. package/src/v2/components/text-shimmer-v2.css +125 -0
  240. package/src/v2/components/text-shimmer-v2.tsx +63 -0
  241. package/src/{forms/textarea/textarea.tsx → v2/components/textarea-v2.tsx} +3 -3
  242. package/src/{feedback/toast/toast.tsx → v2/components/toast-v2.tsx} +58 -60
  243. package/src/{overlays/tooltip/tooltip.css → v2/components/tooltip-v2.css} +0 -26
  244. package/src/{overlays/tooltip/tooltip.tsx → v2/components/tooltip-v2.tsx} +14 -21
  245. package/src/{typography/wordmark/wordmark.tsx → v2/components/wordmark-v2.tsx} +1 -1
  246. package/src/{styles/tokens → v2/styles}/theme.css +12 -4
  247. package/dist/actions/button/button.d.ts +0 -10
  248. package/dist/actions/icon-button/icon-button.d.ts +0 -11
  249. package/dist/actions/split-button/split-button.d.ts +0 -5
  250. package/dist/data-display/badge/badge.d.ts +0 -7
  251. package/dist/data-display/keybind/keybind.d.ts +0 -7
  252. package/dist/feedback/loader/loader.d.ts +0 -3
  253. package/dist/feedback/toast/toast.d.ts +0 -57
  254. package/dist/forms/radio/radio.d.ts +0 -16
  255. package/dist/forms/textarea/textarea.d.ts +0 -7
  256. package/dist/i18n/he.d.ts +0 -197
  257. package/dist/layout/divider/divider.d.ts +0 -5
  258. package/dist/navigation/menu/menu.d.ts +0 -59
  259. package/dist/overlays/tooltip/tooltip.d.ts +0 -15
  260. package/dist/typography/wordmark/wordmark.d.ts +0 -2
  261. package/src/actions/icon-button/icon-button.tsx +0 -32
  262. package/src/feedback/progress-circle/progress-circle.css +0 -28
  263. package/src/feedback/progress-circle/progress-circle.tsx +0 -64
  264. package/src/forms/switch/switch.tsx +0 -34
  265. package/src/i18n/he.ts +0 -199
  266. package/src/icons/icon/icon.css +0 -3
  267. package/src/navigation/tabs/tabs.tsx +0 -194
  268. /package/dist/{forms/inline-input → components}/inline-input.d.ts +0 -0
  269. /package/dist/{navigation → v2/components}/tab-state-indicator.d.ts +0 -0
  270. /package/src/{forms/inline-input → components}/inline-input.css +0 -0
  271. /package/src/{forms/inline-input → components}/inline-input.tsx +0 -0
  272. /package/src/{data-display/avatar/avatar.css → v2/components/avatar-v2.css} +0 -0
  273. /package/src/{actions/button/button.css → v2/components/button-v2.css} +0 -0
  274. /package/src/{layout/divider/divider.css → v2/components/divider-v2.css} +0 -0
  275. /package/src/{forms/field/field.css → v2/components/field-v2.css} +0 -0
  276. /package/src/{styles/file-tree.css → v2/components/file-tree-v2.css} +0 -0
  277. /package/src/{actions/icon-button/icon-button.css → v2/components/icon-button-v2.css} +0 -0
  278. /package/src/{data-display/line-comment/line-comment.css → v2/components/line-comment-v2.css} +0 -0
  279. /package/src/{feedback/loader/loader.css → v2/components/loader-v2.css} +0 -0
  280. /package/src/{data-display/project-avatar/project-avatar.css → v2/components/project-avatar-v2.css} +0 -0
  281. /package/src/{forms/radio/radio.css → v2/components/radio-v2.css} +0 -0
  282. /package/src/{navigation/segmented-control/segmented-control.css → v2/components/segmented-control-v2.css} +0 -0
  283. /package/src/{navigation → v2/components}/tab-state-indicator.tsx +0 -0
  284. /package/src/{forms/text-input/text-input.css → v2/components/text-input-v2.css} +0 -0
  285. /package/src/{forms/textarea/textarea.css → v2/components/textarea-v2.css} +0 -0
  286. /package/src/{feedback/toast/toast.css → v2/components/toast-v2.css} +0 -0
  287. /package/src/{styles/tokens → v2/styles}/colors.css +0 -0
  288. /package/src/{styles/tokens/index.css → v2/styles/tailwind.css} +0 -0
@@ -1,17 +1,6 @@
1
- import {
2
- Content,
3
- Item,
4
- ItemIndicator,
5
- ItemLabel,
6
- Listbox,
7
- Portal,
8
- Root,
9
- Section,
10
- Trigger,
11
- Value,
12
- } from "@kobalte/core/select"
1
+ import { Select as Kobalte } from "@kobalte/core/select"
13
2
  import { Show, createMemo, onCleanup, splitProps, type ComponentProps, type JSX } from "solid-js"
14
- import "./select.css"
3
+ import "./select-v2.css"
15
4
 
16
5
  function groupOptions<T>(options: T[], groupBy?: (x: T) => string): { category: string; options: T[] }[] {
17
6
  if (!groupBy) {
@@ -51,8 +40,8 @@ const CheckSmall = () => (
51
40
  </svg>
52
41
  )
53
42
 
54
- export type SelectProps<T> = Omit<
55
- ComponentProps<typeof Root<T, { category: string; options: T[] }>>,
43
+ export type SelectV2Props<T> = Omit<
44
+ ComponentProps<typeof Kobalte<T, { category: string; options: T[] }>>,
56
45
  "value" | "onSelect" | "children" | "options" | "itemComponent" | "sectionComponent" | "defaultValue" | "multiple"
57
46
  > & {
58
47
  placeholder?: string
@@ -64,13 +53,15 @@ export type SelectProps<T> = Omit<
64
53
  groupBy?: (x: T) => string
65
54
  onSelect?: (value: T | null) => void
66
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"
67
58
  invalid?: boolean
68
59
  numeric?: boolean
69
60
  children?: (item: T) => JSX.Element
70
61
  valueClass?: string
71
62
  }
72
63
 
73
- export function Select<T>(props: SelectProps<T>) {
64
+ export function SelectV2<T>(props: SelectV2Props<T>) {
74
65
  const [local, others] = splitProps(props, [
75
66
  "class",
76
67
  "classList",
@@ -84,6 +75,7 @@ export function Select<T>(props: SelectProps<T>) {
84
75
  "onHighlight",
85
76
  "onOpenChange",
86
77
  "children",
78
+ "appearance",
87
79
  "invalid",
88
80
  "numeric",
89
81
  "disabled",
@@ -96,6 +88,8 @@ export function Select<T>(props: SelectProps<T>) {
96
88
  "fitViewport",
97
89
  ])
98
90
 
91
+ const inline = () => (local.appearance ?? "base") === "inline"
92
+
99
93
  const state: { key?: string; cleanup?: void | (() => void) } = {}
100
94
 
101
95
  const stop = () => {
@@ -124,15 +118,15 @@ export function Select<T>(props: SelectProps<T>) {
124
118
  const grouped = createMemo(() => groupOptions(local.options, local.groupBy))
125
119
 
126
120
  return (
127
- <Root<T, { category: string; options: T[] }>
121
+ <Kobalte<T, { category: string; options: T[] }>
128
122
  {...others}
129
123
  multiple={false}
130
124
  allowDuplicateSelectionEvents={false}
131
125
  disabled={local.disabled}
132
126
  data-component="select-v2-root"
133
- placement={local.placement ?? "bottom-end"}
127
+ placement={local.placement ?? (inline() ? "bottom-end" : "bottom-start")}
134
128
  gutter={local.gutter ?? 4}
135
- sameWidth={local.sameWidth ?? false}
129
+ sameWidth={local.sameWidth ?? !inline()}
136
130
  flip={local.flip ?? true}
137
131
  slide={local.slide ?? true}
138
132
  fitViewport={local.fitViewport ?? false}
@@ -143,31 +137,31 @@ export function Select<T>(props: SelectProps<T>) {
143
137
  optionGroupChildren="options"
144
138
  placeholder={local.placeholder}
145
139
  sectionComponent={(sectionProps) => (
146
- <Section>
140
+ <Kobalte.Section>
147
141
  <Show when={sectionProps.section.rawValue.category}>
148
142
  <div data-slot="menu-v2-group-label">{sectionProps.section.rawValue.category}</div>
149
143
  </Show>
150
- </Section>
144
+ </Kobalte.Section>
151
145
  )}
152
146
  itemComponent={(itemProps) => (
153
- <Item
147
+ <Kobalte.Item
154
148
  {...itemProps}
155
149
  data-component="menu-v2-item"
156
150
  onPointerEnter={() => move(itemProps.item.rawValue)}
157
151
  onPointerMove={() => move(itemProps.item.rawValue)}
158
152
  onFocus={() => move(itemProps.item.rawValue)}
159
153
  >
160
- <ItemLabel data-slot="menu-v2-item-content" as="span">
154
+ <Kobalte.ItemLabel data-slot="menu-v2-item-content" as="span">
161
155
  {local.children
162
156
  ? local.children(itemProps.item.rawValue)
163
157
  : local.label
164
158
  ? local.label(itemProps.item.rawValue)
165
159
  : String(itemProps.item.rawValue as string)}
166
- </ItemLabel>
167
- <ItemIndicator data-slot="menu-v2-item-indicator" forceMount>
160
+ </Kobalte.ItemLabel>
161
+ <Kobalte.ItemIndicator data-slot="menu-v2-item-indicator" forceMount>
168
162
  <CheckSmall />
169
- </ItemIndicator>
170
- </Item>
163
+ </Kobalte.ItemIndicator>
164
+ </Kobalte.Item>
171
165
  )}
172
166
  onChange={(next) => {
173
167
  const v = next == null ? null : Array.isArray(next) ? ((next[0] as T) ?? null) : (next as T)
@@ -179,10 +173,10 @@ export function Select<T>(props: SelectProps<T>) {
179
173
  if (!open) stop()
180
174
  }}
181
175
  >
182
- <Trigger
176
+ <Kobalte.Trigger
183
177
  as="div"
184
178
  data-component="select-v2"
185
- data-appearance="inline"
179
+ data-appearance={local.appearance ?? "base"}
186
180
  data-invalid={local.invalid ? "" : undefined}
187
181
  data-numeric={local.numeric ? "" : undefined}
188
182
  disabled={local.disabled}
@@ -193,23 +187,23 @@ export function Select<T>(props: SelectProps<T>) {
193
187
  }}
194
188
  >
195
189
  <div data-slot="select-v2-value">
196
- <Value<T> data-slot="select-v2-value-text" class={local.valueClass}>
190
+ <Kobalte.Value<T> data-slot="select-v2-value-text" class={local.valueClass}>
197
191
  {(st) => {
198
192
  const selected = st.selectedOption()
199
193
  if (local.label && selected != null) return local.label(selected)
200
194
  return selected != null ? (selected as string) : ""
201
195
  }}
202
- </Value>
196
+ </Kobalte.Value>
203
197
  </div>
204
198
  <span data-slot="select-v2-chevron" aria-hidden="true">
205
199
  <ChevronDown />
206
200
  </span>
207
- </Trigger>
208
- <Portal>
209
- <Content data-component="menu-v2-content" data-slot="select-v2-content">
210
- <Listbox data-slot="select-v2-listbox" />
211
- </Content>
212
- </Portal>
213
- </Root>
201
+ </Kobalte.Trigger>
202
+ <Kobalte.Portal>
203
+ <Kobalte.Content data-component="menu-v2-content" data-slot="select-v2-content">
204
+ <Kobalte.Listbox data-slot="select-v2-listbox" />
205
+ </Kobalte.Content>
206
+ </Kobalte.Portal>
207
+ </Kobalte>
214
208
  )
215
209
  }
@@ -87,8 +87,13 @@
87
87
  flex-shrink: 0;
88
88
  }
89
89
 
90
- [data-component="menu-v2-content"].open-in-app-v2-menu [data-slot="icon-svg"] {
90
+ [data-component="menu-v2-content"].open-in-app-v2-menu [data-component="icon"] {
91
91
  width: 16px;
92
92
  height: 16px;
93
93
  flex-shrink: 0;
94
94
  }
95
+
96
+ [data-component="menu-v2-content"].open-in-app-v2-menu [data-component="icon"] [data-slot="icon-svg"] {
97
+ width: 16px;
98
+ height: 16px;
99
+ }
@@ -1,7 +1,7 @@
1
1
  import { splitProps, type ComponentProps, type ParentProps } from "solid-js"
2
- import "./split-button.css"
2
+ import "./split-button-v2.css"
3
3
 
4
- export function SplitButton(props: ParentProps<ComponentProps<"div">>) {
4
+ export function SplitButtonV2(props: ParentProps<ComponentProps<"div">>) {
5
5
  const [split, rest] = splitProps(props, ["class", "classList", "children"])
6
6
  return (
7
7
  <div
@@ -17,7 +17,7 @@ export function SplitButton(props: ParentProps<ComponentProps<"div">>) {
17
17
  )
18
18
  }
19
19
 
20
- export function SplitButtonAction(props: ComponentProps<"button">) {
20
+ export function SplitButtonV2Action(props: ComponentProps<"button">) {
21
21
  const [split, rest] = splitProps(props, ["class", "classList"])
22
22
  return (
23
23
  <button
@@ -32,7 +32,7 @@ export function SplitButtonAction(props: ComponentProps<"button">) {
32
32
  )
33
33
  }
34
34
 
35
- export function SplitButtonMenuTrigger(props: ComponentProps<"button">) {
35
+ export function SplitButtonV2MenuTrigger(props: ComponentProps<"button">) {
36
36
  const [split, rest] = splitProps(props, ["class", "classList"])
37
37
  return (
38
38
  <button
@@ -160,113 +160,3 @@
160
160
  pointer-events: none;
161
161
  }
162
162
  }
163
-
164
- [data-component="switch"][data-appearance="standard"] {
165
- [data-slot="switch-control"] {
166
- padding: 0;
167
- width: 28px;
168
- height: 16px;
169
- border-radius: 3px;
170
- border: 1px solid var(--border-weak-base);
171
- background: var(--surface-base);
172
- box-shadow: none;
173
- transition:
174
- background-color 150ms,
175
- border-color 150ms;
176
- }
177
-
178
- [data-slot="switch-thumb"] {
179
- box-sizing: content-box;
180
- width: 14px;
181
- height: 14px;
182
- border-radius: 2px;
183
- border: 1px solid var(--border-base);
184
- background: var(--icon-invert-base);
185
- box-shadow:
186
- 0 1px 2px -1px rgba(19, 16, 16, 0.04),
187
- 0 1px 2px 0 rgba(19, 16, 16, 0.06),
188
- 0 1px 3px 0 rgba(19, 16, 16, 0.08);
189
- transform: translateX(-1px);
190
- transition:
191
- transform 150ms,
192
- background-color 150ms;
193
- }
194
-
195
- [data-slot="switch-label"] {
196
- color: var(--text-base);
197
- font-family: var(--font-family-sans);
198
- font-size: var(--font-size-small);
199
- font-style: normal;
200
- font-weight: var(--font-weight-regular);
201
- line-height: var(--line-height-large);
202
- letter-spacing: var(--letter-spacing-normal);
203
- }
204
-
205
- [data-slot="switch-description"] {
206
- color: var(--text-base);
207
- font-family: var(--font-family-sans);
208
- font-size: 12px;
209
- font-weight: var(--font-weight-regular);
210
- line-height: var(--line-height-normal);
211
- letter-spacing: var(--letter-spacing-normal);
212
- }
213
-
214
- [data-slot="switch-error"] {
215
- color: var(--text-error);
216
- }
217
-
218
- &:hover:not([data-disabled], [data-readonly]) [data-slot="switch-control"] {
219
- border-color: var(--border-hover);
220
- background: var(--surface-hover);
221
- }
222
-
223
- &:hover:not([data-disabled], [data-readonly]) [data-slot="switch-thumb"] {
224
- width: 14px;
225
- border-radius: 2px;
226
- }
227
-
228
- &:not([data-readonly]) [data-slot="switch-input"]:focus-visible ~ [data-slot="switch-control"] {
229
- border-color: var(--border-focus);
230
- outline: none;
231
- box-shadow: var(--shadow-xs-border-focus);
232
- }
233
-
234
- &[data-checked] [data-slot="switch-control"] {
235
- border-color: var(--icon-strong-base);
236
- background: var(--icon-strong-base);
237
- box-shadow: none;
238
- }
239
-
240
- &[data-checked] [data-slot="switch-thumb"],
241
- &[data-checked]:hover:not([data-disabled], [data-readonly]) [data-slot="switch-thumb"] {
242
- width: 14px;
243
- border: none;
244
- border-radius: 2px;
245
- transform: translateX(12px);
246
- background: var(--icon-invert-base);
247
- }
248
-
249
- &:dir(rtl)[data-checked] [data-slot="switch-thumb"],
250
- &:dir(rtl)[data-checked]:hover:not([data-disabled], [data-readonly]) [data-slot="switch-thumb"] {
251
- transform: translateX(-12px);
252
- }
253
-
254
- &[data-checked]:hover:not([data-disabled], [data-readonly]) [data-slot="switch-control"] {
255
- border-color: var(--border-hover);
256
- background: var(--surface-hover);
257
- }
258
-
259
- &[data-disabled] [data-slot="switch-control"] {
260
- border-color: var(--border-disabled);
261
- background: var(--surface-disabled);
262
- opacity: 1;
263
- }
264
-
265
- &[data-disabled] [data-slot="switch-thumb"] {
266
- background: var(--icon-disabled);
267
- }
268
-
269
- &[data-invalid] [data-slot="switch-control"] {
270
- border-color: var(--border-error);
271
- }
272
- }
@@ -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
+ }
@@ -68,29 +68,22 @@
68
68
  box-shadow: none;
69
69
  }
70
70
 
71
- [data-slot="tabs-v2-trigger-close-button"] {
72
- display: flex;
73
- align-items: center;
74
- justify-content: center;
75
- margin-inline-start: -5px;
76
- flex: none;
77
- }
78
-
79
- [data-slot="tabs-v2-trigger-close-button"] [data-slot="tabs-close-button"] {
71
+ [data-component="tabs-v2"] [data-slot="tabs-v2-close-button"] {
80
72
  width: 20px;
81
73
  height: 20px;
82
- padding: 0;
74
+ margin-inline-start: -5px;
75
+ flex: none;
83
76
  display: flex;
84
77
  align-items: center;
85
78
  justify-content: center;
86
79
  color: var(--v2-text-text-faint);
87
80
  }
88
81
 
89
- [data-slot="tabs-v2-trigger-close-button"] [data-slot="tabs-close-button"]:hover {
82
+ [data-component="tabs-v2"] [data-slot="tabs-v2-close-button"]:hover {
90
83
  color: var(--v2-text-text-muted);
91
84
  }
92
85
 
93
- [data-component="tabs-v2"] [data-component="icon-button-v2"] {
86
+ [data-component="tabs-v2"] [data-component="icon-button"] {
94
87
  margin: 0;
95
88
  }
96
89
 
@@ -182,7 +175,7 @@
182
175
  border: 0.5px solid var(--v2-border-border-muted);
183
176
  }
184
177
 
185
- [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] > [data-slot="tabs-v2-list"] {
178
+ [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-list"] {
186
179
  flex-direction: column;
187
180
  width: 240px;
188
181
  min-width: 200px;
@@ -193,9 +186,7 @@
193
186
  border-inline-end: 1px solid var(--v2-border-border-base);
194
187
  }
195
188
 
196
- [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
197
- > [data-slot="tabs-v2-list"]
198
- [data-slot="tabs-v2-section-title"] {
189
+ [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-section-title"] {
199
190
  width: 100%;
200
191
  padding-inline-start: 4px;
201
192
  color: var(--v2-text-text-muted);
@@ -204,9 +195,7 @@
204
195
  user-select: none;
205
196
  }
206
197
 
207
- [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
208
- > [data-slot="tabs-v2-list"]
209
- [data-slot="tabs-v2-trigger-wrapper"] {
198
+ [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-trigger-wrapper"] {
210
199
  width: 100%;
211
200
  height: 28px;
212
201
  border-radius: 4px;
@@ -214,9 +203,7 @@
214
203
  color: var(--v2-text-text-muted);
215
204
  }
216
205
 
217
- [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
218
- > [data-slot="tabs-v2-list"]
219
- [data-slot="tabs-v2-trigger"] {
206
+ [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-trigger"] {
220
207
  width: 100%;
221
208
  height: 100%;
222
209
  justify-content: flex-start;
@@ -225,14 +212,12 @@
225
212
  }
226
213
 
227
214
  [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
228
- > [data-slot="tabs-v2-list"]
229
215
  [data-slot="tabs-v2-trigger-wrapper"]:hover:not(:disabled):not(:has([data-selected])) {
230
216
  background-color: var(--v2-background-bg-layer-03);
231
217
  color: var(--v2-text-text-base);
232
218
  }
233
219
 
234
220
  [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
235
- > [data-slot="tabs-v2-list"]
236
221
  [data-slot="tabs-v2-trigger-wrapper"]:has([data-selected]) {
237
222
  background-color: var(--v2-background-bg-layer-03);
238
223
  color: var(--v2-text-text-base);
@@ -0,0 +1,149 @@
1
+ import { Tabs as Kobalte } from "@kobalte/core/tabs"
2
+ import { Show, splitProps, type JSX } from "solid-js"
3
+ import type { ComponentProps, ParentProps, Component } from "solid-js"
4
+ import { useI18n } from "../../context/i18n"
5
+ import "./tabs-v2.css"
6
+
7
+ export interface TabsV2Props extends ComponentProps<typeof Kobalte> {
8
+ variant?: "normal" | "pill" | "settings"
9
+ orientation?: "horizontal" | "vertical"
10
+ }
11
+ export interface TabsV2ListProps extends ComponentProps<typeof Kobalte.List> {}
12
+ export interface TabsV2TriggerProps extends ComponentProps<typeof Kobalte.Trigger> {
13
+ onMiddleClick?: () => void
14
+ /** Optional subtext shown beside the primary content (muted style) */
15
+ subtext?: JSX.Element | string
16
+ }
17
+ export interface TabsV2CloseButtonProps extends ComponentProps<"div"> {}
18
+ export interface TabsV2ContentProps extends ComponentProps<typeof Kobalte.Content> {}
19
+
20
+ function TabsV2Root(props: TabsV2Props) {
21
+ const [split, rest] = splitProps(props, ["class", "classList", "variant", "orientation"])
22
+ return (
23
+ <Kobalte
24
+ {...rest}
25
+ orientation={split.orientation}
26
+ data-component="tabs-v2"
27
+ data-variant={split.variant || "normal"}
28
+ data-orientation={split.orientation || "horizontal"}
29
+ classList={{
30
+ ...split.classList,
31
+ [split.class ?? ""]: !!split.class,
32
+ }}
33
+ />
34
+ )
35
+ }
36
+
37
+ function TabsV2List(props: TabsV2ListProps) {
38
+ const [split, rest] = splitProps(props, ["class", "classList"])
39
+ return (
40
+ <Kobalte.List
41
+ {...rest}
42
+ data-slot="tabs-v2-list"
43
+ classList={{
44
+ ...split.classList,
45
+ [split.class ?? ""]: !!split.class,
46
+ }}
47
+ />
48
+ )
49
+ }
50
+
51
+ function TabsV2Trigger(props: ParentProps<TabsV2TriggerProps>) {
52
+ const [split, rest] = splitProps(props, ["class", "classList", "children", "onMiddleClick", "subtext"])
53
+ return (
54
+ <div
55
+ data-slot="tabs-v2-trigger-wrapper"
56
+ data-value={props.value}
57
+ classList={{
58
+ ...split.classList,
59
+ [split.class ?? ""]: !!split.class,
60
+ }}
61
+ onMouseDown={(e) => {
62
+ if (e.button === 1 && split.onMiddleClick) {
63
+ e.preventDefault()
64
+ }
65
+ }}
66
+ onAuxClick={(e) => {
67
+ if (e.button === 1 && split.onMiddleClick) {
68
+ e.preventDefault()
69
+ split.onMiddleClick()
70
+ }
71
+ }}
72
+ >
73
+ <Kobalte.Trigger {...rest} data-slot="tabs-v2-trigger" data-value={props.value}>
74
+ <span class="inline-flex items-center gap-2" data-slot="tabs-v2-trigger-content">
75
+ {split.children}
76
+ <Show when={split.subtext}>
77
+ {(subtext) => (
78
+ <span data-slot="tabs-v2-subtext" class="ms-2 text-xs text-text-weak">
79
+ {subtext()}
80
+ </span>
81
+ )}
82
+ </Show>
83
+ </span>
84
+ </Kobalte.Trigger>
85
+ </div>
86
+ )
87
+ }
88
+
89
+ function TabsV2CloseButton(props: TabsV2CloseButtonProps) {
90
+ const i18n = useI18n()
91
+ const [split, rest] = splitProps(props, ["class", "classList", "onClick"])
92
+ return (
93
+ <div
94
+ role="button"
95
+ tabindex={0}
96
+ aria-label={i18n.t("ui.tabs.close")}
97
+ data-slot="tabs-v2-close-button"
98
+ {...rest}
99
+ classList={{
100
+ [split.class ?? ""]: !!split.class,
101
+ ...split.classList,
102
+ }}
103
+ onClick={(e) => {
104
+ e.preventDefault()
105
+ e.stopPropagation()
106
+ if (typeof split.onClick === "function") {
107
+ split.onClick(e)
108
+ }
109
+ }}
110
+ onMouseDown={(e) => {
111
+ e.preventDefault()
112
+ e.stopPropagation()
113
+ }}
114
+ >
115
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
116
+ <path d="M10.8889 3.11108L3.11108 10.8889" stroke="currentColor" stroke-linejoin="round" />
117
+ <path d="M3.11108 3.11108L10.8889 10.8889" stroke="currentColor" stroke-linejoin="round" />
118
+ </svg>
119
+ </div>
120
+ )
121
+ }
122
+
123
+ function TabsV2Content(props: ParentProps<TabsV2ContentProps>) {
124
+ const [split, rest] = splitProps(props, ["class", "classList", "children"])
125
+ return (
126
+ <Kobalte.Content
127
+ {...rest}
128
+ data-slot="tabs-v2-content"
129
+ classList={{
130
+ ...split.classList,
131
+ [split.class ?? ""]: !!split.class,
132
+ }}
133
+ >
134
+ {split.children}
135
+ </Kobalte.Content>
136
+ )
137
+ }
138
+
139
+ const TabsV2SectionTitle: Component<ParentProps> = (props) => {
140
+ return <div data-slot="tabs-v2-section-title">{props.children}</div>
141
+ }
142
+
143
+ export const TabsV2 = Object.assign(TabsV2Root, {
144
+ List: TabsV2List,
145
+ Trigger: TabsV2Trigger,
146
+ CloseButton: TabsV2CloseButton,
147
+ Content: TabsV2Content,
148
+ SectionTitle: TabsV2SectionTitle,
149
+ })
@@ -1,9 +1,9 @@
1
1
  import { type ComponentProps, type JSX, Show, splitProps } from "solid-js"
2
- import { Icon } from "@opencode-ai/ui/icon"
2
+ import { Icon } from "./icon"
3
3
  import { useI18n } from "../../context/i18n"
4
- import "./text-input.css"
4
+ import "./text-input-v2.css"
5
5
 
6
- export interface TextInputProps extends Omit<ComponentProps<"input">, "type"> {
6
+ export interface TextInputV2Props extends Omit<ComponentProps<"input">, "type"> {
7
7
  /** Icon or adornment shown before the field value. */
8
8
  leadingIcon?: JSX.Element
9
9
  /** Show the trailing copy action. */
@@ -25,7 +25,7 @@ export interface TextInputProps extends Omit<ComponentProps<"input">, "type"> {
25
25
  type?: ComponentProps<"input">["type"]
26
26
  }
27
27
 
28
- export function TextInput(props: TextInputProps) {
28
+ export function TextInputV2(props: TextInputV2Props) {
29
29
  const i18n = useI18n()
30
30
  const [local, inputProps] = splitProps(props, [
31
31
  "class",