@opencode-ai/ui 0.0.0-dev-19010 → 0.0.0-dev-202609031506

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 (297) 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 -238
  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 -32
  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 -19
  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 +9 -7
  137. package/src/i18n/ar.ts +9 -7
  138. package/src/i18n/az.ts +9 -7
  139. package/src/i18n/bg.ts +9 -7
  140. package/src/i18n/bn.ts +9 -7
  141. package/src/i18n/br.ts +9 -7
  142. package/src/i18n/bs.ts +9 -7
  143. package/src/i18n/ca.ts +9 -7
  144. package/src/i18n/cs.ts +9 -7
  145. package/src/i18n/da.ts +9 -7
  146. package/src/i18n/de.ts +3 -1
  147. package/src/i18n/dv.ts +9 -7
  148. package/src/i18n/dz.ts +7 -5
  149. package/src/i18n/el.ts +9 -7
  150. package/src/i18n/en.ts +11 -54
  151. package/src/i18n/es.ts +8 -6
  152. package/src/i18n/et.ts +9 -7
  153. package/src/i18n/fa.ts +9 -7
  154. package/src/i18n/fi.ts +9 -7
  155. package/src/i18n/fo.ts +9 -7
  156. package/src/i18n/fr.ts +8 -6
  157. package/src/i18n/hi.ts +9 -7
  158. package/src/i18n/hr.ts +9 -7
  159. package/src/i18n/hu.ts +9 -7
  160. package/src/i18n/hy.ts +9 -7
  161. package/src/i18n/id.ts +9 -7
  162. package/src/i18n/is.ts +9 -7
  163. package/src/i18n/it.ts +9 -7
  164. package/src/i18n/ja.ts +9 -7
  165. package/src/i18n/ka.ts +9 -7
  166. package/src/i18n/km.ts +9 -7
  167. package/src/i18n/ko.ts +9 -7
  168. package/src/i18n/lo.ts +9 -7
  169. package/src/i18n/lt.ts +9 -7
  170. package/src/i18n/lv.ts +9 -7
  171. package/src/i18n/mk.ts +9 -7
  172. package/src/i18n/mn.ts +9 -7
  173. package/src/i18n/ms.ts +9 -7
  174. package/src/i18n/my.ts +9 -7
  175. package/src/i18n/ne.ts +9 -7
  176. package/src/i18n/nl.ts +9 -7
  177. package/src/i18n/no.ts +9 -7
  178. package/src/i18n/pa.ts +9 -7
  179. package/src/i18n/pl.ts +9 -7
  180. package/src/i18n/ro.ts +9 -7
  181. package/src/i18n/ru.ts +9 -7
  182. package/src/i18n/si.ts +9 -7
  183. package/src/i18n/sk.ts +9 -7
  184. package/src/i18n/sl.ts +9 -7
  185. package/src/i18n/sq.ts +9 -7
  186. package/src/i18n/sr.ts +9 -7
  187. package/src/i18n/sv.ts +9 -7
  188. package/src/i18n/tg.ts +9 -7
  189. package/src/i18n/th.ts +9 -7
  190. package/src/i18n/tk.ts +9 -7
  191. package/src/i18n/tr.ts +9 -7
  192. package/src/i18n/uk.ts +9 -7
  193. package/src/i18n/ur.ts +9 -7
  194. package/src/i18n/uz.ts +9 -7
  195. package/src/i18n/vi.ts +9 -7
  196. package/src/i18n/zh.ts +9 -7
  197. package/src/i18n/zht.ts +9 -7
  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 +19 -48
  205. package/src/theme/v2/default-primitives.ts +8 -8
  206. package/src/theme/v2/foreground.ts +0 -1
  207. package/src/theme/v2/mapping.ts +1 -5
  208. package/src/v2/components/accordion-v2.css +139 -0
  209. package/src/v2/components/accordion-v2.tsx +86 -0
  210. package/src/{data-display/avatar/avatar.tsx → v2/components/avatar-v2.tsx} +1 -1
  211. package/src/{data-display/badge/badge.css → v2/components/badge-v2.css} +0 -19
  212. package/src/{data-display/badge/badge.tsx → v2/components/badge-v2.tsx} +4 -6
  213. package/src/{actions/button/button.css → v2/components/button-v2.css} +0 -29
  214. package/src/v2/components/button-v2.tsx +35 -0
  215. package/src/v2/components/checkbox-v2.css +184 -0
  216. package/src/v2/components/checkbox-v2.tsx +65 -0
  217. package/src/{overlays/dialog/dialog.css → v2/components/dialog-v2.css} +0 -3
  218. package/src/{overlays/dialog/dialog.tsx → v2/components/dialog-v2.tsx} +13 -11
  219. package/src/v2/components/diff-changes-v2.css +26 -0
  220. package/src/{data-display/diff-changes/diff-changes.tsx → v2/components/diff-changes-v2.tsx} +2 -7
  221. package/src/{layout/divider/divider.tsx → v2/components/divider-v2.tsx} +3 -3
  222. package/src/{forms/field/field.css → v2/components/field-v2.css} +1 -1
  223. package/src/{forms/field/field.tsx → v2/components/field-v2.tsx} +11 -9
  224. package/src/v2/components/icon-button-v2.tsx +37 -0
  225. package/src/{icons/icon → v2/components}/icon.tsx +12 -67
  226. package/src/v2/components/inline-input-v2.css +225 -0
  227. package/src/v2/components/inline-input-v2.tsx +107 -0
  228. package/src/{data-display/keybind/keybind.css → v2/components/keybind-v2.css} +1 -1
  229. package/src/{data-display/keybind/keybind.tsx → v2/components/keybind-v2.tsx} +3 -3
  230. package/src/{data-display/line-comment/line-comment.css → v2/components/line-comment-v2.css} +4 -4
  231. package/src/{data-display/line-comment/line-comment.tsx → v2/components/line-comment-v2.tsx} +15 -17
  232. package/src/{feedback/loader/loader.tsx → v2/components/loader-v2.tsx} +2 -2
  233. package/src/{navigation/menu/menu.css → v2/components/menu-v2.css} +2 -123
  234. package/src/{navigation/menu/menu.tsx → v2/components/menu-v2.tsx} +32 -96
  235. package/src/v2/components/progress-circle-v2.css +13 -0
  236. package/src/v2/components/progress-circle-v2.tsx +52 -0
  237. package/src/{data-display/project-avatar/project-avatar.tsx → v2/components/project-avatar-v2.tsx} +1 -1
  238. package/src/{forms/radio/radio.tsx → v2/components/radio-v2.tsx} +20 -30
  239. package/src/{navigation/segmented-control/segmented-control.css → v2/components/segmented-control-v2.css} +1 -1
  240. package/src/{navigation/segmented-control/segmented-control.tsx → v2/components/segmented-control-v2.tsx} +8 -9
  241. package/src/{forms/select/select.css → v2/components/select-v2.css} +8 -2
  242. package/src/{forms/select/select.tsx → v2/components/select-v2.tsx} +32 -40
  243. package/src/{actions/split-button/split-button.css → v2/components/split-button-v2.css} +6 -1
  244. package/src/{actions/split-button/split-button.tsx → v2/components/split-button-v2.tsx} +4 -4
  245. package/src/{forms/switch/switch.css → v2/components/switch-v2.css} +0 -110
  246. package/src/v2/components/switch-v2.tsx +28 -0
  247. package/src/{navigation/tabs/tabs-current.css → v2/components/tabs-v2.css} +10 -25
  248. package/src/v2/components/tabs-v2.tsx +149 -0
  249. package/src/{forms/text-input/text-input.css → v2/components/text-input-v2.css} +3 -3
  250. package/src/{forms/text-input/text-input.tsx → v2/components/text-input-v2.tsx} +4 -4
  251. package/src/v2/components/text-shimmer-v2.css +125 -0
  252. package/src/v2/components/text-shimmer-v2.tsx +63 -0
  253. package/src/{forms/textarea/textarea.tsx → v2/components/textarea-v2.tsx} +3 -3
  254. package/src/{feedback/toast/toast.tsx → v2/components/toast-v2.tsx} +58 -60
  255. package/src/{overlays/tooltip/tooltip.css → v2/components/tooltip-v2.css} +0 -26
  256. package/src/{overlays/tooltip/tooltip.tsx → v2/components/tooltip-v2.tsx} +17 -24
  257. package/src/{typography/wordmark/wordmark.tsx → v2/components/wordmark-v2.tsx} +2 -2
  258. package/src/{styles/tokens → v2/styles}/colors.css +8 -8
  259. package/src/{styles/tokens → v2/styles}/theme.css +16 -20
  260. package/dist/actions/button/button.d.ts +0 -10
  261. package/dist/actions/icon-button/icon-button.d.ts +0 -11
  262. package/dist/actions/split-button/split-button.d.ts +0 -5
  263. package/dist/context/marked-base.d.ts +0 -3
  264. package/dist/data-display/badge/badge.d.ts +0 -7
  265. package/dist/data-display/keybind/keybind.d.ts +0 -7
  266. package/dist/feedback/loader/loader.d.ts +0 -3
  267. package/dist/feedback/toast/toast.d.ts +0 -57
  268. package/dist/forms/radio/radio.d.ts +0 -16
  269. package/dist/forms/textarea/textarea.d.ts +0 -7
  270. package/dist/i18n/he.d.ts +0 -197
  271. package/dist/layout/divider/divider.d.ts +0 -5
  272. package/dist/navigation/menu/menu.d.ts +0 -59
  273. package/dist/overlays/tooltip/tooltip.d.ts +0 -15
  274. package/dist/typography/wordmark/wordmark.d.ts +0 -2
  275. package/src/actions/icon-button/icon-button.tsx +0 -32
  276. package/src/context/marked-base.tsx +0 -27
  277. package/src/feedback/progress-circle/progress-circle.css +0 -28
  278. package/src/feedback/progress-circle/progress-circle.tsx +0 -64
  279. package/src/forms/switch/switch.tsx +0 -34
  280. package/src/i18n/he.ts +0 -199
  281. package/src/icons/icon/icon.css +0 -3
  282. package/src/navigation/tabs/tabs.tsx +0 -194
  283. /package/dist/{forms/inline-input → components}/inline-input.d.ts +0 -0
  284. /package/dist/{navigation → v2/components}/tab-state-indicator.d.ts +0 -0
  285. /package/src/{forms/inline-input → components}/inline-input.css +0 -0
  286. /package/src/{forms/inline-input → components}/inline-input.tsx +0 -0
  287. /package/src/{data-display/avatar/avatar.css → v2/components/avatar-v2.css} +0 -0
  288. /package/src/{layout/divider/divider.css → v2/components/divider-v2.css} +0 -0
  289. /package/src/{styles/file-tree.css → v2/components/file-tree-v2.css} +0 -0
  290. /package/src/{actions/icon-button/icon-button.css → v2/components/icon-button-v2.css} +0 -0
  291. /package/src/{feedback/loader/loader.css → v2/components/loader-v2.css} +0 -0
  292. /package/src/{data-display/project-avatar/project-avatar.css → v2/components/project-avatar-v2.css} +0 -0
  293. /package/src/{forms/radio/radio.css → v2/components/radio-v2.css} +0 -0
  294. /package/src/{navigation → v2/components}/tab-state-indicator.tsx +0 -0
  295. /package/src/{forms/textarea/textarea.css → v2/components/textarea-v2.css} +0 -0
  296. /package/src/{feedback/toast/toast.css → v2/components/toast-v2.css} +0 -0
  297. /package/src/{styles/tokens/index.css → v2/styles/tailwind.css} +0 -0
@@ -0,0 +1,201 @@
1
+ [data-component="select"] {
2
+ [data-slot="select-select-trigger"] {
3
+ padding-block: 0;
4
+ padding-inline: 8px 4px;
5
+ box-shadow: none;
6
+
7
+ [data-slot="select-select-trigger-value"] {
8
+ overflow: hidden;
9
+ text-overflow: ellipsis;
10
+ white-space: nowrap;
11
+ }
12
+ [data-slot="select-select-trigger-icon"] {
13
+ width: 16px;
14
+ height: 16px;
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ flex-shrink: 0;
19
+ color: var(--text-weak);
20
+ transition: transform 0.1s ease-in-out;
21
+ }
22
+
23
+ &[data-expanded] {
24
+ &[data-variant="secondary"] {
25
+ background-color: var(--button-secondary-hover);
26
+ }
27
+ &[data-variant="ghost"] {
28
+ background-color: var(--surface-raised-base-active);
29
+ }
30
+ &[data-variant="primary"] {
31
+ background-color: var(--icon-strong-active);
32
+ }
33
+ }
34
+
35
+ &:not([data-expanded]):focus-visible {
36
+ &[data-variant="secondary"] {
37
+ background-color: var(--button-secondary-base);
38
+ }
39
+ &[data-variant="ghost"] {
40
+ background-color: var(--surface-raised-base-hover);
41
+ }
42
+ &[data-variant="primary"] {
43
+ background-color: var(--icon-strong-base);
44
+ }
45
+ }
46
+ }
47
+
48
+ &[data-trigger-style="settings"] {
49
+ [data-slot="select-select-trigger"] {
50
+ padding-block: 6px;
51
+ padding-inline: 12px 6px;
52
+ box-shadow: none;
53
+ border-radius: 6px;
54
+ min-width: 160px;
55
+ height: 32px;
56
+ justify-content: flex-end;
57
+ gap: 12px;
58
+ background-color: transparent;
59
+
60
+ [data-slot="select-select-trigger-value"] {
61
+ overflow: hidden;
62
+ text-overflow: ellipsis;
63
+ white-space: nowrap;
64
+ font-size: var(--font-size-base);
65
+ font-weight: var(--font-weight-regular);
66
+ }
67
+ [data-slot="select-select-trigger-icon"] {
68
+ width: 16px;
69
+ height: 20px;
70
+ display: flex;
71
+ align-items: center;
72
+ justify-content: center;
73
+ flex-shrink: 0;
74
+ color: var(--text-weak);
75
+ background-color: var(--surface-raised-base);
76
+ border-radius: 4px;
77
+ transition: transform 0.1s ease-in-out;
78
+ }
79
+
80
+ &[data-slot="select-select-trigger"]:hover:not(:disabled),
81
+ &[data-slot="select-select-trigger"][data-expanded],
82
+ &[data-slot="select-select-trigger"][data-expanded]:hover:not(:disabled) {
83
+ background-color: var(--input-base);
84
+ box-shadow: var(--shadow-xs-border-base);
85
+ }
86
+
87
+ &:not([data-expanded]):not(:focus-visible):focus {
88
+ background-color: transparent;
89
+ box-shadow: none;
90
+ }
91
+ }
92
+ }
93
+ }
94
+
95
+ [data-component="select-content"] {
96
+ min-width: 104px;
97
+ max-width: 23rem;
98
+ overflow: hidden;
99
+ border-radius: var(--radius-md);
100
+ background-color: var(--surface-raised-stronger-non-alpha);
101
+ padding: 4px;
102
+ box-shadow: var(--shadow-xs-border);
103
+ z-index: 60;
104
+
105
+ &[data-expanded] {
106
+ animation: select-open 0.15s ease-out;
107
+ }
108
+
109
+ [data-slot="select-select-content-list"] {
110
+ overflow-y: auto;
111
+ max-height: 12rem;
112
+ white-space: nowrap;
113
+ overflow-x: hidden;
114
+ display: flex;
115
+ flex-direction: column;
116
+
117
+ &:focus {
118
+ outline: none;
119
+ }
120
+
121
+ > *:not([role="presentation"]) + *:not([role="presentation"]) {
122
+ margin-top: 2px;
123
+ }
124
+ }
125
+
126
+ [data-slot="select-select-item"] {
127
+ position: relative;
128
+ display: flex;
129
+ align-items: center;
130
+ padding: 2px 8px;
131
+ gap: 12px;
132
+ border-radius: 4px;
133
+ cursor: default;
134
+
135
+ /* text-12-medium */
136
+ font-family: var(--font-family-sans);
137
+ font-size: var(--font-size-small);
138
+ font-style: normal;
139
+ font-weight: var(--font-weight-medium);
140
+ line-height: var(--line-height-large); /* 166.667% */
141
+ letter-spacing: var(--letter-spacing-normal);
142
+
143
+ color: var(--text-strong);
144
+
145
+ outline: none;
146
+ user-select: none;
147
+
148
+ &[data-highlighted] {
149
+ background: var(--surface-raised-base-hover);
150
+ }
151
+ &[data-disabled] {
152
+ background-color: var(--surface-raised-base);
153
+ pointer-events: none;
154
+ }
155
+ [data-slot="select-select-item-indicator"] {
156
+ display: flex;
157
+ align-items: center;
158
+ justify-content: center;
159
+ margin-inline-start: auto;
160
+ width: 16px;
161
+ height: 16px;
162
+ }
163
+ &:focus {
164
+ outline: none;
165
+ }
166
+ &:hover {
167
+ background: var(--surface-raised-base-hover);
168
+ }
169
+ }
170
+ }
171
+
172
+ [data-component="select-content"][data-trigger-style="settings"] {
173
+ min-width: 160px;
174
+ border-radius: 8px;
175
+ padding: 0;
176
+
177
+ [data-slot="select-select-content-list"] {
178
+ padding: 4px;
179
+ }
180
+
181
+ [data-slot="select-select-item"] {
182
+ /* text-14-regular */
183
+ font-family: var(--font-family-sans);
184
+ font-size: var(--font-size-base);
185
+ font-style: normal;
186
+ font-weight: var(--font-weight-regular);
187
+ line-height: var(--line-height-large);
188
+ letter-spacing: var(--letter-spacing-normal);
189
+ }
190
+ }
191
+
192
+ @keyframes select-open {
193
+ from {
194
+ opacity: 0;
195
+ transform: scale(0.95);
196
+ }
197
+ to {
198
+ opacity: 1;
199
+ transform: scale(1);
200
+ }
201
+ }
@@ -0,0 +1,174 @@
1
+ import { Select as Kobalte } from "@kobalte/core/select"
2
+ import { createMemo, onCleanup, splitProps, type ComponentProps, type JSX } from "solid-js"
3
+ import { pipe, groupBy, entries, map } from "remeda"
4
+ import { Button, ButtonProps } from "./button"
5
+ import { Icon } from "./icon"
6
+
7
+ export type SelectProps<T> = Omit<ComponentProps<typeof Kobalte<T>>, "value" | "onSelect" | "children"> & {
8
+ placeholder?: string
9
+ options: T[]
10
+ current?: T
11
+ value?: (x: T) => string
12
+ label?: (x: T) => string
13
+ groupBy?: (x: T) => string
14
+ valueClass?: ComponentProps<"div">["class"]
15
+ onSelect?: (value: T | undefined) => void
16
+ onHighlight?: (value: T | undefined) => (() => void) | void
17
+ class?: ComponentProps<"div">["class"]
18
+ classList?: ComponentProps<"div">["classList"]
19
+ children?: (item: T | undefined) => JSX.Element
20
+ triggerStyle?: JSX.CSSProperties
21
+ triggerVariant?: "settings"
22
+ triggerProps?: Record<string, string | number | boolean | undefined>
23
+ }
24
+
25
+ export function Select<T>(props: SelectProps<T> & Omit<ButtonProps, "children">) {
26
+ const [local, others] = splitProps(props, [
27
+ "class",
28
+ "classList",
29
+ "placeholder",
30
+ "options",
31
+ "current",
32
+ "value",
33
+ "label",
34
+ "groupBy",
35
+ "valueClass",
36
+ "onSelect",
37
+ "onHighlight",
38
+ "onOpenChange",
39
+ "children",
40
+ "triggerStyle",
41
+ "triggerVariant",
42
+ "triggerProps",
43
+ ])
44
+
45
+ const state = {
46
+ key: undefined as string | undefined,
47
+ cleanup: undefined as (() => void) | void,
48
+ }
49
+
50
+ const stop = () => {
51
+ state.cleanup?.()
52
+ state.cleanup = undefined
53
+ state.key = undefined
54
+ }
55
+
56
+ const keyFor = (item: T) => (local.value ? local.value(item) : (item as string))
57
+
58
+ const move = (item: T | undefined) => {
59
+ if (!local.onHighlight) return
60
+ if (!item) {
61
+ stop()
62
+ return
63
+ }
64
+
65
+ const key = keyFor(item)
66
+ if (state.key === key) return
67
+ state.cleanup?.()
68
+ state.cleanup = local.onHighlight(item)
69
+ state.key = key
70
+ }
71
+
72
+ onCleanup(stop)
73
+
74
+ const grouped = createMemo(() => {
75
+ const result = pipe(
76
+ local.options,
77
+ groupBy((x) => (local.groupBy ? local.groupBy(x) : "")),
78
+ // mapValues((x) => x.sort((a, b) => a.title.localeCompare(b.title))),
79
+ entries(),
80
+ map(([k, v]) => ({ category: k, options: v })),
81
+ )
82
+ return result
83
+ })
84
+
85
+ return (
86
+ // @ts-ignore
87
+ <Kobalte<T, { category: string; options: T[] }>
88
+ {...others}
89
+ data-component="select"
90
+ data-trigger-style={local.triggerVariant}
91
+ placement={local.triggerVariant === "settings" ? "bottom-end" : "bottom-start"}
92
+ gutter={4}
93
+ value={local.current}
94
+ options={grouped()}
95
+ optionValue={(x) => (local.value ? local.value(x) : (x as string))}
96
+ optionTextValue={(x) => (local.label ? local.label(x) : (x as string))}
97
+ optionGroupChildren="options"
98
+ placeholder={local.placeholder}
99
+ sectionComponent={(local) => (
100
+ <Kobalte.Section data-slot="select-section">{local.section.rawValue.category}</Kobalte.Section>
101
+ )}
102
+ itemComponent={(itemProps) => (
103
+ <Kobalte.Item
104
+ {...itemProps}
105
+ data-slot="select-select-item"
106
+ classList={{
107
+ ...local.classList,
108
+ [local.class ?? ""]: !!local.class,
109
+ }}
110
+ onPointerEnter={() => move(itemProps.item.rawValue)}
111
+ onPointerMove={() => move(itemProps.item.rawValue)}
112
+ onFocus={() => move(itemProps.item.rawValue)}
113
+ >
114
+ <Kobalte.ItemLabel data-slot="select-select-item-label">
115
+ {local.children
116
+ ? local.children(itemProps.item.rawValue)
117
+ : local.label
118
+ ? local.label(itemProps.item.rawValue)
119
+ : (itemProps.item.rawValue as string)}
120
+ </Kobalte.ItemLabel>
121
+ <Kobalte.ItemIndicator data-slot="select-select-item-indicator">
122
+ <Icon name="check-small" size="small" />
123
+ </Kobalte.ItemIndicator>
124
+ </Kobalte.Item>
125
+ )}
126
+ onChange={(v) => {
127
+ local.onSelect?.(v ?? undefined)
128
+ stop()
129
+ }}
130
+ onOpenChange={(open) => {
131
+ local.onOpenChange?.(open)
132
+ if (!open) stop()
133
+ }}
134
+ >
135
+ <Kobalte.Trigger
136
+ {...local.triggerProps}
137
+ disabled={props.disabled}
138
+ data-slot="select-select-trigger"
139
+ as={Button}
140
+ size={props.size}
141
+ variant={props.variant}
142
+ style={local.triggerStyle}
143
+ classList={{
144
+ ...local.classList,
145
+ [local.class ?? ""]: !!local.class,
146
+ }}
147
+ >
148
+ <Kobalte.Value<T> data-slot="select-select-trigger-value" class={local.valueClass}>
149
+ {(state) => {
150
+ const selected = state.selectedOption() ?? local.current
151
+ if (!selected) return local.placeholder || ""
152
+ if (local.label) return local.label(selected)
153
+ return selected as string
154
+ }}
155
+ </Kobalte.Value>
156
+ <Kobalte.Icon data-slot="select-select-trigger-icon">
157
+ <Icon name={local.triggerVariant === "settings" ? "selector" : "chevron-down"} size="small" />
158
+ </Kobalte.Icon>
159
+ </Kobalte.Trigger>
160
+ <Kobalte.Portal>
161
+ <Kobalte.Content
162
+ classList={{
163
+ ...local.classList,
164
+ [local.class ?? ""]: !!local.class,
165
+ }}
166
+ data-component="select-content"
167
+ data-trigger-style={local.triggerVariant}
168
+ >
169
+ <Kobalte.Listbox data-slot="select-select-content-list" />
170
+ </Kobalte.Content>
171
+ </Kobalte.Portal>
172
+ </Kobalte>
173
+ )
174
+ }
@@ -1,4 +1,4 @@
1
- import { Accordion } from "@opencode-ai/ui/accordion"
1
+ import { Accordion } from "./accordion"
2
2
  import { ParentProps } from "solid-js"
3
3
 
4
4
  export function StickyAccordionHeader(
@@ -0,0 +1,136 @@
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
+ display: inline-flex;
22
+ align-items: center;
23
+ width: 28px;
24
+ height: 16px;
25
+ flex-shrink: 0;
26
+ border-radius: 3px;
27
+ border: 1px solid var(--border-weak-base);
28
+ background: var(--surface-base);
29
+ transition:
30
+ background-color 150ms,
31
+ border-color 150ms;
32
+ }
33
+
34
+ [data-slot="switch-thumb"] {
35
+ width: 14px;
36
+ height: 14px;
37
+ box-sizing: content-box;
38
+
39
+ border-radius: 2px;
40
+ border: 1px solid var(--border-base);
41
+ background: var(--icon-invert-base);
42
+
43
+ /* shadows/shadow-xs */
44
+ box-shadow:
45
+ 0 1px 2px -1px rgba(19, 16, 16, 0.04),
46
+ 0 1px 2px 0 rgba(19, 16, 16, 0.06),
47
+ 0 1px 3px 0 rgba(19, 16, 16, 0.08);
48
+
49
+ transform: translateX(-1px);
50
+ transition:
51
+ transform 150ms,
52
+ background-color 150ms;
53
+ }
54
+
55
+ [data-slot="switch-label"] {
56
+ user-select: none;
57
+ color: var(--text-base);
58
+ font-family: var(--font-family-sans);
59
+ font-size: var(--font-size-small);
60
+ font-style: normal;
61
+ font-weight: var(--font-weight-regular);
62
+ line-height: var(--line-height-large);
63
+ letter-spacing: var(--letter-spacing-normal);
64
+ }
65
+
66
+ [data-slot="switch-description"] {
67
+ color: var(--text-base);
68
+ font-family: var(--font-family-sans);
69
+ font-size: 12px;
70
+ font-weight: var(--font-weight-regular);
71
+ line-height: var(--line-height-normal);
72
+ letter-spacing: var(--letter-spacing-normal);
73
+ }
74
+
75
+ [data-slot="switch-error"] {
76
+ color: var(--text-error);
77
+ font-family: var(--font-family-sans);
78
+ font-size: 12px;
79
+ font-weight: var(--font-weight-regular);
80
+ line-height: var(--line-height-normal);
81
+ letter-spacing: var(--letter-spacing-normal);
82
+ }
83
+
84
+ &:hover:not([data-disabled], [data-readonly]) [data-slot="switch-control"] {
85
+ border-color: var(--border-hover);
86
+ background-color: var(--surface-hover);
87
+ }
88
+
89
+ &:not([data-readonly]) [data-slot="switch-input"]:focus-visible ~ [data-slot="switch-control"] {
90
+ border-color: var(--border-focus);
91
+ box-shadow: var(--shadow-xs-border-focus);
92
+ }
93
+
94
+ &[data-checked] [data-slot="switch-control"] {
95
+ box-sizing: border-box;
96
+ border-color: var(--icon-strong-base);
97
+ background-color: var(--icon-strong-base);
98
+ }
99
+
100
+ &[data-checked] [data-slot="switch-thumb"] {
101
+ border: none;
102
+ transform: translateX(12px);
103
+ background-color: var(--icon-invert-base);
104
+ }
105
+
106
+ &:dir(rtl)[data-checked] [data-slot="switch-thumb"] {
107
+ transform: translateX(-12px);
108
+ }
109
+
110
+ &[data-checked]:hover:not([data-disabled], [data-readonly]) [data-slot="switch-control"] {
111
+ border-color: var(--border-hover);
112
+ background-color: var(--surface-hover);
113
+ }
114
+
115
+ &[data-disabled] {
116
+ cursor: not-allowed;
117
+ }
118
+
119
+ &[data-disabled] [data-slot="switch-control"] {
120
+ border-color: var(--border-disabled);
121
+ background-color: var(--surface-disabled);
122
+ }
123
+
124
+ &[data-disabled] [data-slot="switch-thumb"] {
125
+ background-color: var(--icon-disabled);
126
+ }
127
+
128
+ &[data-invalid] [data-slot="switch-control"] {
129
+ border-color: var(--border-error);
130
+ }
131
+
132
+ &[data-readonly] {
133
+ cursor: default;
134
+ pointer-events: none;
135
+ }
136
+ }
@@ -0,0 +1,29 @@
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
+
5
+ export interface SwitchProps extends ParentProps<ComponentProps<typeof Kobalte>> {
6
+ hideLabel?: boolean
7
+ description?: string
8
+ }
9
+
10
+ export function Switch(props: SwitchProps) {
11
+ const [local, others] = splitProps(props, ["children", "class", "hideLabel", "description"])
12
+ return (
13
+ <Kobalte {...others} class={local.class} data-component="switch">
14
+ <Kobalte.Input data-slot="switch-input" />
15
+ <Show when={local.children}>
16
+ <Kobalte.Label data-slot="switch-label" classList={{ "sr-only": local.hideLabel }}>
17
+ {local.children}
18
+ </Kobalte.Label>
19
+ </Show>
20
+ <Show when={local.description}>
21
+ <Kobalte.Description data-slot="switch-description">{local.description}</Kobalte.Description>
22
+ </Show>
23
+ <Kobalte.ErrorMessage data-slot="switch-error" />
24
+ <Kobalte.Control data-slot="switch-control">
25
+ <Kobalte.Thumb data-slot="switch-thumb" />
26
+ </Kobalte.Control>
27
+ </Kobalte>
28
+ )
29
+ }