@opencode-ai/ui 0.0.0-dev-19219 → 0.0.0-dev-202609070344

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 (299) 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 +4 -14
  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 -242
  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 -52
  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 -5
  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 +35 -141
  81. package/src/{data-display/accordion → components}/accordion.css +33 -7
  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.css +4 -36
  116. package/src/components/scroll-view.tsx +88 -153
  117. package/src/components/select.css +201 -0
  118. package/src/components/select.tsx +174 -0
  119. package/src/components/sticky-accordion-header.tsx +1 -1
  120. package/src/components/switch.css +136 -0
  121. package/src/components/switch.tsx +29 -0
  122. package/src/{navigation/tabs → components}/tabs.css +232 -53
  123. package/src/components/tabs.tsx +126 -0
  124. package/src/components/tag.css +37 -0
  125. package/src/components/tag.tsx +22 -0
  126. package/src/components/text-field.tsx +4 -12
  127. package/src/{typography/text-shimmer → components}/text-shimmer.css +1 -2
  128. package/src/{typography/text-shimmer → components}/text-shimmer.tsx +0 -1
  129. package/src/components/toast.css +236 -0
  130. package/src/components/toast.tsx +185 -0
  131. package/src/components/tooltip.css +74 -0
  132. package/src/components/tooltip.tsx +163 -0
  133. package/src/context/dialog.tsx +0 -1
  134. package/src/context/i18n.tsx +14 -17
  135. package/src/context/marked-parser.tsx +13 -3
  136. package/src/hooks/create-auto-scroll.tsx +0 -20
  137. package/src/i18n/am.ts +9 -7
  138. package/src/i18n/ar.ts +9 -7
  139. package/src/i18n/az.ts +9 -7
  140. package/src/i18n/bg.ts +9 -7
  141. package/src/i18n/bn.ts +9 -7
  142. package/src/i18n/br.ts +9 -7
  143. package/src/i18n/bs.ts +9 -7
  144. package/src/i18n/ca.ts +9 -7
  145. package/src/i18n/cs.ts +9 -7
  146. package/src/i18n/da.ts +9 -7
  147. package/src/i18n/de.ts +3 -1
  148. package/src/i18n/dv.ts +9 -7
  149. package/src/i18n/dz.ts +7 -5
  150. package/src/i18n/el.ts +9 -7
  151. package/src/i18n/en.ts +12 -59
  152. package/src/i18n/es.ts +8 -6
  153. package/src/i18n/et.ts +9 -7
  154. package/src/i18n/fa.ts +9 -7
  155. package/src/i18n/fi.ts +9 -7
  156. package/src/i18n/fo.ts +9 -7
  157. package/src/i18n/fr.ts +8 -6
  158. package/src/i18n/hi.ts +9 -7
  159. package/src/i18n/hr.ts +9 -7
  160. package/src/i18n/hu.ts +9 -7
  161. package/src/i18n/hy.ts +9 -7
  162. package/src/i18n/id.ts +9 -7
  163. package/src/i18n/is.ts +9 -7
  164. package/src/i18n/it.ts +9 -7
  165. package/src/i18n/ja.ts +9 -7
  166. package/src/i18n/ka.ts +9 -7
  167. package/src/i18n/km.ts +9 -7
  168. package/src/i18n/ko.ts +9 -7
  169. package/src/i18n/lo.ts +9 -7
  170. package/src/i18n/lt.ts +9 -7
  171. package/src/i18n/lv.ts +9 -7
  172. package/src/i18n/mk.ts +9 -7
  173. package/src/i18n/mn.ts +9 -7
  174. package/src/i18n/ms.ts +9 -7
  175. package/src/i18n/my.ts +9 -7
  176. package/src/i18n/ne.ts +9 -7
  177. package/src/i18n/nl.ts +9 -7
  178. package/src/i18n/no.ts +9 -7
  179. package/src/i18n/pa.ts +9 -7
  180. package/src/i18n/pl.ts +9 -7
  181. package/src/i18n/ro.ts +9 -7
  182. package/src/i18n/ru.ts +9 -7
  183. package/src/i18n/si.ts +9 -7
  184. package/src/i18n/sk.ts +9 -7
  185. package/src/i18n/sl.ts +9 -7
  186. package/src/i18n/sq.ts +9 -7
  187. package/src/i18n/sr.ts +9 -7
  188. package/src/i18n/sv.ts +9 -7
  189. package/src/i18n/tg.ts +9 -7
  190. package/src/i18n/th.ts +9 -7
  191. package/src/i18n/tk.ts +9 -7
  192. package/src/i18n/tr.ts +9 -7
  193. package/src/i18n/uk.ts +9 -7
  194. package/src/i18n/ur.ts +9 -7
  195. package/src/i18n/uz.ts +9 -7
  196. package/src/i18n/vi.ts +9 -7
  197. package/src/i18n/zh.ts +9 -7
  198. package/src/i18n/zht.ts +9 -7
  199. package/src/styles/base.css +0 -5
  200. package/src/styles/index.css +20 -4
  201. package/src/styles/tailwind/colors.css +0 -2
  202. package/src/styles/tailwind/index.css +1 -18
  203. package/src/styles/theme.css +2 -2
  204. package/src/theme/context.tsx +11 -19
  205. package/src/theme/themes/oc-2.json +19 -50
  206. package/src/theme/v2/default-primitives.ts +8 -8
  207. package/src/theme/v2/foreground.ts +0 -1
  208. package/src/theme/v2/mapping.ts +1 -7
  209. package/src/v2/components/accordion-v2.css +139 -0
  210. package/src/v2/components/accordion-v2.tsx +86 -0
  211. package/src/{data-display/avatar/avatar.tsx → v2/components/avatar-v2.tsx} +1 -1
  212. package/src/{data-display/badge/badge.css → v2/components/badge-v2.css} +0 -19
  213. package/src/{data-display/badge/badge.tsx → v2/components/badge-v2.tsx} +4 -6
  214. package/src/{actions/button/button.css → v2/components/button-v2.css} +0 -30
  215. package/src/v2/components/button-v2.tsx +35 -0
  216. package/src/v2/components/checkbox-v2.css +184 -0
  217. package/src/v2/components/checkbox-v2.tsx +65 -0
  218. package/src/{overlays/dialog/dialog.css → v2/components/dialog-v2.css} +0 -3
  219. package/src/{overlays/dialog/dialog.tsx → v2/components/dialog-v2.tsx} +13 -11
  220. package/src/v2/components/diff-changes-v2.css +26 -0
  221. package/src/{data-display/diff-changes/diff-changes.tsx → v2/components/diff-changes-v2.tsx} +2 -7
  222. package/src/{layout/divider/divider.tsx → v2/components/divider-v2.tsx} +3 -3
  223. package/src/{forms/field/field.css → v2/components/field-v2.css} +1 -1
  224. package/src/{forms/field/field.tsx → v2/components/field-v2.tsx} +11 -9
  225. package/src/{styles/file-tree.css → v2/components/file-tree-v2.css} +3 -64
  226. package/src/{actions/icon-button/icon-button.css → v2/components/icon-button-v2.css} +9 -27
  227. package/src/v2/components/icon-button-v2.tsx +37 -0
  228. package/src/{icons/icon → v2/components}/icon.tsx +12 -88
  229. package/src/v2/components/inline-input-v2.css +225 -0
  230. package/src/v2/components/inline-input-v2.tsx +107 -0
  231. package/src/{data-display/keybind/keybind.css → v2/components/keybind-v2.css} +1 -1
  232. package/src/{data-display/keybind/keybind.tsx → v2/components/keybind-v2.tsx} +3 -3
  233. package/src/{data-display/line-comment/line-comment.css → v2/components/line-comment-v2.css} +4 -4
  234. package/src/{data-display/line-comment/line-comment.tsx → v2/components/line-comment-v2.tsx} +15 -17
  235. package/src/{feedback/loader/loader.tsx → v2/components/loader-v2.tsx} +2 -2
  236. package/src/{navigation/menu/menu.css → v2/components/menu-v2.css} +2 -124
  237. package/src/{navigation/menu/menu.tsx → v2/components/menu-v2.tsx} +32 -96
  238. package/src/v2/components/progress-circle-v2.css +13 -0
  239. package/src/v2/components/progress-circle-v2.tsx +52 -0
  240. package/src/{data-display/project-avatar/project-avatar.css → v2/components/project-avatar-v2.css} +4 -4
  241. package/src/{data-display/project-avatar/project-avatar.tsx → v2/components/project-avatar-v2.tsx} +1 -1
  242. package/src/{forms/radio/radio.tsx → v2/components/radio-v2.tsx} +20 -30
  243. package/src/{navigation/segmented-control/segmented-control.css → v2/components/segmented-control-v2.css} +1 -1
  244. package/src/{navigation/segmented-control/segmented-control.tsx → v2/components/segmented-control-v2.tsx} +8 -9
  245. package/src/{forms/select/select.css → v2/components/select-v2.css} +8 -2
  246. package/src/{forms/select/select.tsx → v2/components/select-v2.tsx} +32 -42
  247. package/src/{actions/split-button/split-button.css → v2/components/split-button-v2.css} +6 -2
  248. package/src/{actions/split-button/split-button.tsx → v2/components/split-button-v2.tsx} +4 -4
  249. package/src/{forms/switch/switch.css → v2/components/switch-v2.css} +0 -110
  250. package/src/v2/components/switch-v2.tsx +28 -0
  251. package/src/{navigation/tabs/tabs-current.css → v2/components/tabs-v2.css} +10 -25
  252. package/src/v2/components/tabs-v2.tsx +149 -0
  253. package/src/{forms/text-input/text-input.css → v2/components/text-input-v2.css} +3 -3
  254. package/src/{forms/text-input/text-input.tsx → v2/components/text-input-v2.tsx} +4 -4
  255. package/src/v2/components/text-shimmer-v2.css +125 -0
  256. package/src/v2/components/text-shimmer-v2.tsx +63 -0
  257. package/src/{forms/textarea/textarea.tsx → v2/components/textarea-v2.tsx} +3 -3
  258. package/src/{feedback/toast/toast.tsx → v2/components/toast-v2.tsx} +58 -60
  259. package/src/{overlays/tooltip/tooltip.css → v2/components/tooltip-v2.css} +0 -33
  260. package/src/{overlays/tooltip/tooltip.tsx → v2/components/tooltip-v2.tsx} +17 -24
  261. package/src/v2/components/wordmark-v2.tsx +71 -0
  262. package/src/{styles/tokens → v2/styles}/colors.css +8 -8
  263. package/src/{styles/tokens → v2/styles}/theme.css +16 -23
  264. package/dist/actions/button/button.d.ts +0 -10
  265. package/dist/actions/icon-button/icon-button.d.ts +0 -11
  266. package/dist/actions/split-button/split-button.d.ts +0 -5
  267. package/dist/context/marked-base.d.ts +0 -3
  268. package/dist/data-display/badge/badge.d.ts +0 -7
  269. package/dist/data-display/keybind/keybind.d.ts +0 -7
  270. package/dist/feedback/loader/loader.d.ts +0 -3
  271. package/dist/feedback/toast/toast.d.ts +0 -57
  272. package/dist/forms/radio/radio.d.ts +0 -16
  273. package/dist/forms/textarea/textarea.d.ts +0 -7
  274. package/dist/i18n/he.d.ts +0 -197
  275. package/dist/layout/divider/divider.d.ts +0 -5
  276. package/dist/navigation/menu/menu.d.ts +0 -59
  277. package/dist/overlays/tooltip/tooltip.d.ts +0 -15
  278. package/dist/typography/wordmark/wordmark.d.ts +0 -5
  279. package/src/actions/icon-button/icon-button.tsx +0 -32
  280. package/src/context/marked-base.tsx +0 -27
  281. package/src/feedback/progress-circle/progress-circle.css +0 -28
  282. package/src/feedback/progress-circle/progress-circle.tsx +0 -64
  283. package/src/forms/switch/switch.tsx +0 -34
  284. package/src/i18n/he.ts +0 -199
  285. package/src/icons/icon/icon.css +0 -3
  286. package/src/navigation/tabs/tabs.tsx +0 -194
  287. package/src/typography/wordmark/wordmark.tsx +0 -39
  288. /package/dist/{forms/inline-input → components}/inline-input.d.ts +0 -0
  289. /package/dist/{navigation → v2/components}/tab-state-indicator.d.ts +0 -0
  290. /package/src/{forms/inline-input → components}/inline-input.css +0 -0
  291. /package/src/{forms/inline-input → components}/inline-input.tsx +0 -0
  292. /package/src/{data-display/avatar/avatar.css → v2/components/avatar-v2.css} +0 -0
  293. /package/src/{layout/divider/divider.css → v2/components/divider-v2.css} +0 -0
  294. /package/src/{feedback/loader/loader.css → v2/components/loader-v2.css} +0 -0
  295. /package/src/{forms/radio/radio.css → v2/components/radio-v2.css} +0 -0
  296. /package/src/{navigation → v2/components}/tab-state-indicator.tsx +0 -0
  297. /package/src/{forms/textarea/textarea.css → v2/components/textarea-v2.css} +0 -0
  298. /package/src/{feedback/toast/toast.css → v2/components/toast-v2.css} +0 -0
  299. /package/src/{styles/tokens/index.css → v2/styles/tailwind.css} +0 -0
@@ -1,30 +1,20 @@
1
- @property --file-tree-v2-row-overlay {
2
- syntax: "<color>";
3
- inherits: true;
4
- initial-value: transparent;
5
- }
6
-
7
1
  [data-component="file-tree-v2"] {
8
2
  display: flex;
9
3
  flex-direction: column;
10
4
  gap: 2px;
11
- width: max-content;
12
- min-width: 100%;
13
5
  }
14
6
 
15
7
  [data-component="file-tree-v2"] [data-slot="file-tree-v2-row"] {
16
- --file-tree-v2-row-overlay: transparent;
17
-
18
8
  box-sizing: border-box;
19
9
  width: 100%;
20
- min-width: max-content;
10
+ min-width: 0;
21
11
  height: 28px;
22
12
  display: flex;
23
13
  align-items: center;
24
14
  justify-content: flex-start;
25
15
  gap: 6px;
26
16
  padding-inline-end: 8px;
27
- overflow: clip;
17
+ overflow: visible;
28
18
  border: none;
29
19
  border-radius: 6px;
30
20
  background-color: transparent;
@@ -34,12 +24,7 @@
34
24
  scroll-margin-block: 8px;
35
25
  transition:
36
26
  background-color 120ms ease,
37
- color 120ms ease,
38
- --file-tree-v2-row-overlay 120ms ease;
39
- }
40
-
41
- [data-component="file-tree-v2"] [data-slot="file-tree-v2-label"] {
42
- margin-inline-end: 12px;
27
+ color 120ms ease;
43
28
  }
44
29
 
45
30
  [data-component="file-tree-v2"] [data-slot="file-tree-v2-row"][data-ignored] {
@@ -47,14 +32,10 @@
47
32
  }
48
33
 
49
34
  [data-component="file-tree-v2"] [data-slot="file-tree-v2-row"]:hover {
50
- --file-tree-v2-row-overlay: var(--v2-overlay-simple-overlay-hover);
51
-
52
35
  background-color: var(--v2-overlay-simple-overlay-hover);
53
36
  }
54
37
 
55
38
  [data-component="file-tree-v2"] [data-slot="file-tree-v2-row"][data-selected] {
56
- --file-tree-v2-row-overlay: var(--v2-overlay-simple-overlay-pressed);
57
-
58
39
  color: var(--v2-text-text-base);
59
40
  background-color: var(--v2-overlay-simple-overlay-pressed);
60
41
  }
@@ -63,14 +44,6 @@
63
44
  background-color: var(--v2-overlay-simple-overlay-pressed);
64
45
  }
65
46
 
66
- [data-component="file-tree-v2"]
67
- [data-slot="file-tree-v2-context-trigger"][data-context-menu-open]
68
- [data-slot="file-tree-v2-row"]:not([data-selected]) {
69
- --file-tree-v2-row-overlay: var(--v2-overlay-simple-overlay-hover);
70
-
71
- background-color: var(--v2-overlay-simple-overlay-hover);
72
- }
73
-
74
47
  [data-component="file-tree-v2"] [data-slot="file-tree-v2-guide"] {
75
48
  position: absolute;
76
49
  top: 0;
@@ -137,9 +110,6 @@
137
110
  [data-component="file-tree-v2"] [data-slot="file-tree-v2-change"] {
138
111
  box-sizing: border-box;
139
112
  flex: none;
140
- position: sticky;
141
- inset-inline-end: 8px;
142
- z-index: 1;
143
113
  display: flex;
144
114
  flex-direction: row;
145
115
  align-items: center;
@@ -156,37 +126,6 @@
156
126
  font-feature-settings:
157
127
  "tnum" on,
158
128
  "lnum" on;
159
- background:
160
- linear-gradient(var(--file-tree-v2-row-overlay), var(--file-tree-v2-row-overlay)), var(--v2-background-bg-base);
161
- }
162
-
163
- [data-component="file-tree-v2"] [data-slot="file-tree-v2-change"]::before {
164
- content: "";
165
- position: absolute;
166
- inset-block: 0;
167
- inset-inline-end: 100%;
168
- width: 16px;
169
- pointer-events: none;
170
- background:
171
- linear-gradient(to right, transparent, var(--file-tree-v2-row-overlay)),
172
- linear-gradient(to right, transparent, var(--v2-background-bg-base));
173
- }
174
-
175
- [data-component="file-tree-v2"]:dir(rtl) [data-slot="file-tree-v2-change"]::before {
176
- background:
177
- linear-gradient(to left, transparent, var(--file-tree-v2-row-overlay)),
178
- linear-gradient(to left, transparent, var(--v2-background-bg-base));
179
- }
180
-
181
- [data-component="file-tree-v2"] [data-slot="file-tree-v2-change"]::after {
182
- content: "";
183
- position: absolute;
184
- inset-block: 0;
185
- inset-inline-start: 100%;
186
- width: 16px;
187
- pointer-events: none;
188
- background:
189
- linear-gradient(var(--file-tree-v2-row-overlay), var(--file-tree-v2-row-overlay)), var(--v2-background-bg-base);
190
129
  }
191
130
 
192
131
  [data-component="file-tree-v2"] [data-slot="file-tree-v2-change"][data-change="modified"] {
@@ -71,37 +71,23 @@
71
71
 
72
72
  /* Contrast */
73
73
  [data-component="icon-button-v2"][data-variant="contrast"] {
74
- --icon-button-contrast-highlight: var(--v2-alpha-light-20);
75
- --icon-button-contrast-hover: var(--v2-overlay-simple-overlay-contrast-hover);
76
-
77
74
  background-image:
78
- linear-gradient(180deg, var(--icon-button-contrast-highlight) 0%, var(--v2-alpha-light-0) 100%),
79
- linear-gradient(
80
- 90deg,
81
- var(--v2-background-bg-icon-button-contrast) 0%,
82
- var(--v2-background-bg-icon-button-contrast) 100%
83
- );
75
+ linear-gradient(180deg, var(--v2-alpha-light-20) 0%, var(--v2-alpha-light-0) 100%),
76
+ linear-gradient(90deg, var(--v2-background-bg-contrast) 0%, var(--v2-background-bg-contrast) 100%);
84
77
  color: var(--v2-text-text-contrast);
85
78
  text-shadow: 0 0.5px 0.5px rgba(0, 0, 0, 0.3);
86
79
  box-shadow: var(--v2-elevation-button-contrast);
87
80
  }
88
81
 
89
- [data-color-scheme="dark"] [data-component="icon-button-v2"][data-variant="contrast"] {
90
- --icon-button-contrast-highlight: var(--v2-alpha-light-60);
91
- --icon-button-contrast-hover: var(--v2-alpha-dark-8);
92
-
93
- color: var(--v2-icon-icon-inverse);
94
- }
95
-
96
82
  [data-component="icon-button-v2"][data-variant="contrast"]:is(:hover, [data-state="hover"]):not(:disabled) {
97
83
  background-image:
98
- linear-gradient(90deg, var(--icon-button-contrast-hover) 0%, var(--icon-button-contrast-hover) 100%),
99
- linear-gradient(180deg, var(--icon-button-contrast-highlight) 0%, var(--v2-alpha-light-0) 100%),
100
84
  linear-gradient(
101
85
  90deg,
102
- var(--v2-background-bg-icon-button-contrast) 0%,
103
- var(--v2-background-bg-icon-button-contrast) 100%
104
- );
86
+ var(--v2-overlay-simple-overlay-contrast-hover) 0%,
87
+ var(--v2-overlay-simple-overlay-contrast-hover) 100%
88
+ ),
89
+ linear-gradient(180deg, var(--v2-alpha-light-20) 0%, var(--v2-alpha-light-0) 100%),
90
+ linear-gradient(90deg, var(--v2-background-bg-contrast) 0%, var(--v2-background-bg-contrast) 100%);
105
91
  }
106
92
 
107
93
  [data-component="icon-button-v2"][data-variant="contrast"]:is(:active, [data-state="pressed"]):not(:disabled) {
@@ -111,12 +97,8 @@
111
97
  var(--v2-overlay-simple-overlay-contrast-pressed) 0%,
112
98
  var(--v2-overlay-simple-overlay-contrast-pressed) 100%
113
99
  ),
114
- linear-gradient(180deg, var(--icon-button-contrast-highlight) 0%, var(--v2-alpha-light-0) 100%),
115
- linear-gradient(
116
- 90deg,
117
- var(--v2-background-bg-icon-button-contrast) 0%,
118
- var(--v2-background-bg-icon-button-contrast) 100%
119
- );
100
+ linear-gradient(180deg, var(--v2-alpha-light-20) 0%, var(--v2-alpha-light-0) 100%),
101
+ linear-gradient(90deg, var(--v2-background-bg-contrast) 0%, var(--v2-background-bg-contrast) 100%);
120
102
  }
121
103
 
122
104
  [data-component="icon-button-v2"][data-variant="contrast"]:is(:disabled, [data-state="disabled"]) {
@@ -0,0 +1,37 @@
1
+ import { Button as Kobalte } from "@kobalte/core/button"
2
+ import { type ComponentProps, splitProps } from "solid-js"
3
+ import { JSX } from "solid-js"
4
+ import "./icon-button-v2.css"
5
+
6
+ export interface IconButtonV2Props
7
+ extends ComponentProps<typeof Kobalte>,
8
+ Pick<ComponentProps<"button">, "class" | "classList"> {
9
+ // temporary
10
+ icon?: JSX.Element
11
+ // icon: IconProps["name"]
12
+ size?: "small" | "normal" | "large"
13
+ // iconSize?: IconProps["size"]
14
+ variant?: "neutral" | "contrast" | "ghost" | "ghost-muted"
15
+ state?: "rest" | "hover" | "pressed"
16
+ }
17
+
18
+ export function IconButtonV2(props: ComponentProps<"button"> & IconButtonV2Props) {
19
+ const [split, rest] = splitProps(props, ["variant", "size", "iconSize", "class", "classList", "state"])
20
+ return (
21
+ <Kobalte
22
+ {...rest}
23
+ data-component="icon-button-v2"
24
+ // data-icon={props.icon}
25
+ data-size={split.size || "normal"}
26
+ data-variant={split.variant || "neutral"}
27
+ data-state={split.state}
28
+ classList={{
29
+ ...split.classList,
30
+ [split.class ?? ""]: !!split.class,
31
+ }}
32
+ >
33
+ {props.icon}
34
+ {/*<Icon name={props.icon} size={split.iconSize ?? (split.size === "large" ? "normal" : "small")} />*/}
35
+ </Kobalte>
36
+ )
37
+ }
@@ -1,16 +1,9 @@
1
1
  import { onMount, type ComponentProps, splitProps } from "solid-js"
2
- import { additionalIcons, additionalIconViewBox } from "./additional-icons"
3
- import "./icon.css"
4
2
 
5
- // Consumers center the SVG viewport, so each icon must center its artwork within its viewBox.
6
3
  const icons = {
7
- flask: {
8
- viewBox: "0 0 16 16",
9
- body: `<path d="M5.5 2H10.5M6 2V6L2.5 12C2 13 2.5 14 3.5 14H12.5C13.5 14 14 13 13.5 12L10 6V2M4.25 9H11.75" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>`,
10
- },
11
4
  edit: {
12
5
  viewBox: "0 0 16 16",
13
- body: `<path d="M13.5556 8.21529V13.5556H2.44446L2.44446 2.44445H7.78474M6.00002 8.16216V10H7.83786L14 3.83784L12.1622 2L6.00002 8.16216Z" stroke="currentColor"/>`,
6
+ body: `<path d="M13.5555 8.21534V13.5556H2.44434L2.44434 2.4445H7.78462M6.88878 9.11119C6.88878 9.11119 8.96327 9.0367 9.69678 8.3032L14.0301 3.96986C14.5824 3.4176 14.5824 2.52213 14.0301 1.96986C13.4778 1.4176 12.5824 1.4176 12.0301 1.96986L7.69678 6.3032C7.00513 6.99484 6.88878 9.11119 6.88878 9.11119Z" stroke="currentColor"/>`,
14
7
  },
15
8
  "folder-add-left": {
16
9
  viewBox: "0 0 16 16",
@@ -24,10 +17,6 @@ const icons = {
24
17
  viewBox: "0 0 16 16",
25
18
  body: `<path d="M5.118 5.686V10.314M5.118 5.686C5.97 5.686 6.661 4.995 6.661 4.143C6.661 3.291 5.97 2.6 5.118 2.6C4.266 2.6 3.575 3.291 3.575 4.143C3.575 4.995 4.266 5.686 5.118 5.686ZM5.118 10.314C4.266 10.314 3.575 11.005 3.575 11.857C3.575 12.709 4.266 13.4 5.118 13.4C5.97 13.4 6.661 12.709 6.661 11.857M5.118 10.314C5.97 10.314 6.661 11.005 6.661 11.857M10.882 5.686C11.734 5.686 12.425 4.995 12.425 4.143C12.425 3.291 11.734 2.6 10.882 2.6C10.03 2.6 9.339 3.291 9.339 4.143C9.339 4.995 10.03 5.686 10.882 5.686ZM10.882 5.686V9.457C10.882 10.783 9.807 11.857 8.482 11.857H6.661" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>`,
26
19
  },
27
- "branch-out": {
28
- viewBox: "0 0 16 16",
29
- body: `<path d="M10.4225 3.35355L12.9024 5.83344L10.4225 8.31333" stroke="currentColor"/><path d="M1 12.2852H4.23042C4.89912 12.2852 5.52359 11.951 5.89452 11.3946L9.00783 6.72462C8.37877 6.16823 10.0032 5.83402 10.6719 5.83402H12.9024" stroke="currentColor"/><path d="M8.5 12.2852H14" stroke="currentColor" stroke-linejoin="round"/>`,
30
- },
31
20
  "grid-plus": {
32
21
  viewBox: "0 0 16 16",
33
22
  body: `<path d="M13.9948 11.668H9.32812M11.6641 9.33203V13.9987M6.66667 9.33203V13.9987H2V9.33203H6.66667ZM6.66667 2V6.66667H2V2H6.66667ZM13.9948 2V6.66667H9.32812V2H13.9948Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`,
@@ -36,14 +25,6 @@ const icons = {
36
25
  viewBox: "0 0 16 16",
37
26
  body: `<path d="M6.33345 6.33349V5.00015H9.66679V7.00015L8.00015 8.00015V9.66679M8.27485 11.6819H7.71897M14.4446 8.00011C14.4446 11.5593 11.5593 14.4446 8.00011 14.4446C4.44094 14.4446 1.55566 11.5593 1.55566 8.00011C1.55566 4.44094 4.44094 1.55566 8.00011 1.55566C11.5593 1.55566 14.4446 4.44094 14.4446 8.00011Z" stroke="currentColor" stroke-linecap="square"/>`,
38
27
  },
39
- info: {
40
- viewBox: "0 0 16 16",
41
- body: `<g transform="translate(2 2)"><path d="M12 12H0V0H12V12ZM1 1V11H11V1H1ZM6.5791 4.81641V9.37207H5.5791V5.81641H4.46777V4.81641H6.5791ZM6.85645 2.62891V3.62891H5.30078V2.62891H6.85645Z" fill="currentColor"/></g>`,
42
- },
43
- "circle-exclamation": {
44
- viewBox: "0 0 16 16",
45
- body: `<path d="M8.75 11.75H7.25V10.25H8.75V11.75Z" fill="currentColor"/><path d="M8.75 9.25H7.25V4.25H8.75V9.25Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 1C9.93286 1 11.684 1.7836 12.9502 3.0498C14.2164 4.31601 15 6.06714 15 8C15 11.866 11.866 15 8 15C6.06714 15 4.31601 14.2164 3.0498 12.9502C1.7836 11.684 1 9.93286 1 8C1 4.13401 4.13401 1 8 1ZM8 2C4.68629 2 2 4.68629 2 8C2 9.65699 2.67148 11.1559 3.75781 12.2422C4.84415 13.3285 6.34301 14 8 14C11.3137 14 14 11.3137 14 8C14 6.34301 13.3285 4.84415 12.2422 3.75781C11.1559 2.67148 9.65699 2 8 2Z" fill="currentColor"/>`,
46
- },
47
28
  "sidebar-right": {
48
29
  viewBox: "0 0 20 20",
49
30
  body: `<path d="M2.91536 2.91406H2.36536V2.36406H2.91536V2.91406ZM2.91536 17.0807V17.6307H2.36536V17.0807H2.91536ZM17.082 17.0807H17.632V17.6307H17.082V17.0807ZM17.082 2.91406V2.36406H17.632V2.91406H17.082ZM6.9987 2.91406H6.4487V2.36406H6.9987V2.91406ZM6.9987 17.0807V17.6307H6.4487V17.0807H6.9987ZM2.91536 2.91406H3.46536V17.0807H2.91536H2.36536V2.91406H2.91536ZM2.91536 17.0807V16.5307H17.082V17.0807V17.6307H2.91536V17.0807ZM17.082 17.0807H16.532V2.91406H17.082H17.632V17.0807H17.082ZM17.082 2.91406V3.46406H2.91536V2.91406V2.36406H17.082V2.91406ZM6.9987 2.91406H7.5487V17.0807H6.9987H6.4487V2.91406H6.9987ZM17.082 17.0807L17.082 17.6307L6.9987 17.6307V17.0807V16.5307L17.082 16.5307L17.082 17.0807ZM6.9987 2.91406V2.36406H17.082V2.91406V3.46406H6.9987V2.91406Z" fill="currentColor"/>`,
@@ -100,14 +81,6 @@ const icons = {
100
81
  viewBox: "0 0 16 16",
101
82
  body: `<path d="M2 10.668V14.0013H10.6667M13.9974 10.6667V2H2.66406M13.9974 10.668V14.0013H10.6641M2 10V2H5.33333" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/><path d="M10.6693 10.6654V5.33203H5.33594V10.6654H10.6693Z" fill="currentColor"/>`,
102
83
  },
103
- "outline-worktree": {
104
- viewBox: "0 0 16 16",
105
- body: `<path d="M12 3.11133L14.3885 5.49977L12 7.88822M14.5 5.49972H10.058L5.13456 11.8139M14.5 11.6606L8.5 11.6606M5.50012 11.6597H1.5" stroke="currentColor"/>`,
106
- },
107
- "outline-trash": {
108
- viewBox: "0 0 16 16",
109
- body: `<path d="M2.44434 4.22224H13.5554M5.99994 4.22224V2.44446C5.99994 1.95557 5.99992 1.55557 5.99992 1.55557H9.99989C9.99989 1.55557 9.99994 1.95557 9.99994 2.44446V4.22224M6.55545 7.77779L6.7485 11.7778M9.44437 7.77779L9.2513 11.7778M12.1756 6.88891L11.8666 12.7556C11.8168 13.7068 11.7748 14.4445 11.7748 14.4445H4.22511C4.22511 14.4445 4.18392 13.7067 4.13414 12.7556L3.82509 6.88891" stroke="currentColor"/>`,
110
- },
111
84
  close: {
112
85
  viewBox: "0 0 20 20",
113
86
  body: `<path d="M14.4446 5.55566L5.55566 14.4446M5.55566 5.55566L14.4446 14.4446" stroke="currentColor" stroke-linejoin="round"/>`,
@@ -148,14 +121,6 @@ const icons = {
148
121
  viewBox: "0 0 20 20",
149
122
  body: `<path d="M7 14.5H13M7 7.99512H10.0049M10.0049 7.99512H13M10.0049 7.99512V5M10.0049 7.99512V11M18 18V2L2 2L2 18H18Z" stroke="currentColor"/>`,
150
123
  },
151
- "window-analytics": {
152
- viewBox: "0 0 16 16",
153
- body: `<path d="M14.5 9.8333V13.5H1.5V2.5H7.1667M9.5 2.5V7.5H14.5V2.5H9.5Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`,
154
- },
155
- trash: {
156
- viewBox: "0 0 20 20",
157
- body: `<path d="M4.58342 17.9134L4.58369 17.4134L4.22787 17.5384L4.22766 18.0384H4.58342V17.9134ZM15.4167 17.9134V18.0384H15.7725L15.7723 17.5384L15.4167 17.9134ZM2.08342 3.95508V3.45508H1.58342V3.95508H2.08342V4.45508V3.95508ZM17.9167 4.45508V4.95508H18.4167V4.45508H17.9167V3.95508V4.45508ZM4.16677 4.58008L3.66701 4.5996L4.22816 17.5379L4.72792 17.4934L5.22767 17.4489L4.66652 4.54055L4.16677 4.58008ZM4.58342 18.0384V17.9134H15.4167V18.0384V18.5384H4.58342V18.0384ZM15.4167 17.9134L15.8332 17.5379L16.2498 4.5996L15.7501 4.58008L15.2503 4.56055L14.8337 17.4989L15.4167 17.9134ZM15.8334 4.58008V4.08008H4.16677V4.58008V5.08008H15.8334V4.58008ZM2.08342 4.45508V4.95508H4.16677V4.58008V4.08008H2.08342V4.45508ZM15.8334 4.58008V5.08008H17.9167V4.45508V3.95508H15.8334V4.58008ZM6.83951 4.35149L7.432 4.55047C7.79251 3.47701 8.80699 2.70508 10.0001 2.70508V2.20508V1.70508C8.25392 1.70508 6.77335 2.83539 6.24702 4.15251L6.83951 4.35149ZM10.0001 2.20508V2.70508C11.1932 2.70508 12.2077 3.47701 12.5682 4.55047L13.1607 4.35149L13.7532 4.15251C13.2269 2.83539 11.7463 1.70508 10.0001 1.70508V2.20508Z" fill="currentColor"/>`,
158
- },
159
124
  "outline-sliders": {
160
125
  viewBox: "0 0 16 16",
161
126
  body: `<path d="M11.7779 4.66675H14.4446M11.7779 4.66675C11.7779 5.77132 10.8825 6.66675 9.77789 6.66675C8.67332 6.66675 7.77789 5.77132 7.77789 4.66675M11.7779 4.66675C11.7779 3.56218 10.8825 2.66675 9.77789 2.66675C8.67332 2.66675 7.77789 3.56218 7.77789 4.66675M1.55566 4.66675H7.77789M4.22233 11.3334H1.55566M4.22233 11.3334C4.22233 12.438 5.11776 13.3334 6.22233 13.3334C7.3269 13.3334 8.22233 12.438 8.22233 11.3334M4.22233 11.3334C4.22233 10.2288 5.11776 9.33341 6.22233 9.33341C7.3269 9.33341 8.22233 10.2288 8.22233 11.3334M14.4446 11.3334H8.22233" stroke="currentColor"/>`,
@@ -164,22 +129,10 @@ const icons = {
164
129
  viewBox: "0 0 16 16",
165
130
  body: `<path d="M4.14908 11.0081H1.76282V1.51758H9.1038V2.55588M14.2225 4.99681H6.75397V14.4873H14.2225V4.99681Z" stroke="currentColor"/>`,
166
131
  },
167
- "arrow-up-right": {
168
- viewBox: "0 0 16 16",
169
- body: `<path d="M11 9.56V5H6.44M11 5L5 11" stroke="currentColor"/>`,
170
- },
171
132
  "outline-square-arrow": {
172
133
  viewBox: "0 0 16 16",
173
134
  body: `<path d="M13.5555 6.66656V2.44434H9.33326M13.5555 2.44434L7.99993 7.99989M13.5555 9.33324V13.5555C13.5555 13.5555 12.7599 13.5555 11.7777 13.5555H2.44438C2.44438 13.5555 2.44438 12.7599 2.44438 11.7777V4.22213C2.44438 3.2399 2.44434 2.44435 2.44434 2.44435H6.66661" stroke="currentColor"/>`,
174
135
  },
175
- "outline-arrow-to-corner-top-right": {
176
- viewBox: "0 0 16 16",
177
- body: `<path d="M2 8.5V2H14V14H8M5 5.66667H10.3333V11M3.66797 12.333L9.94292 6.05806" stroke="currentColor" stroke-linecap="square"/>`,
178
- },
179
- "outline-hexagonal-warning": {
180
- viewBox: "0 0 16 16",
181
- body: `<path d="M10.6667 1.33325H5.33272L1.33334 5.33325L1.33342 10.6917L5.3327 14.691L10.6667 14.6909L14.6911 10.6917V5.33255L10.6667 1.33325Z" stroke="currentColor"/><path d="M8 10.6667H8.00667" stroke="currentColor" stroke-linecap="square"/><path d="M8 7.99992V5.33325" stroke="currentColor" stroke-linecap="square"/>`,
182
- },
183
136
  "outline-share": {
184
137
  viewBox: "0 0 16 16",
185
138
  body: `<path d="M13.5554 10.4445V13.5556C13.5554 13.5556 12.7599 13.5556 11.7777 13.5556H4.22211C3.23989 13.5556 2.44434 13.5556 2.44434 13.5556V10.4445M4.88878 5.55557L7.99989 2.44446L11.111 5.55557M7.99989 2.44446L7.99989 9.11112" stroke="currentColor"/>`,
@@ -192,42 +145,20 @@ const icons = {
192
145
  viewBox: "0 0 20 20",
193
146
  body: `<path d="M5.83333 4.16406L2.5 7.4974L5.83333 10.8307M3.33333 7.4974H17.9167V15.4141H10" stroke="currentColor" stroke-linecap="square"/>`,
194
147
  },
195
- "fill-triangle-down": {
196
- viewBox: "0 0 16 16",
197
- body: `<path d="M5.37624 6.75194C5.1818 6.41861 5.42223 6 5.80813 6H10.1921C10.578 6 10.8184 6.41861 10.624 6.75194L8.43199 10.5096C8.23905 10.8404 7.76115 10.8404 7.56821 10.5096L5.37624 6.75194Z" fill="currentColor"/>`,
198
- },
199
148
  archive: {
200
149
  viewBox: "0 0 16 16",
201
150
  body: `<path d="M13.1112 13.5555V14.0555H13.6112V13.5555H13.1112ZM2.889 13.5555H2.389L2.389 14.0555H2.889V13.5555ZM3.38901 5.55546L3.38901 5.05546L2.38901 5.05546L2.38901 5.55546L2.88901 5.55546L3.38901 5.55546ZM14.4446 2.44434H14.9446V1.94434L14.4446 1.94434L14.4446 2.44434ZM14.4446 5.55545L14.4446 6.05545L14.9446 6.05545V5.55545H14.4446ZM1.55566 5.55546L1.05566 5.55545L1.05566 6.05546L1.55566 6.05546L1.55566 5.55546ZM1.5557 2.44436L1.5557 1.94436L1.05571 1.94436L1.0557 2.44435L1.5557 2.44436ZM13.1112 5.55546H12.6112V13.5555H13.1112H13.6112V5.55546H13.1112ZM2.889 13.5555H3.389L3.38901 5.55546L2.88901 5.55546L2.38901 5.55546L2.389 13.5555H2.889ZM14.4446 2.44434H13.9446V5.55545H14.4446H14.9446V2.44434H14.4446ZM1.55566 5.55546L2.05566 5.55547L2.0557 2.44436L1.5557 2.44436L1.0557 2.44435L1.05566 5.55545L1.55566 5.55546ZM6.22234 8.22213V8.72213H9.7779V8.22213V7.72213H6.22234V8.22213ZM13.1112 13.5555V13.0555H2.889V13.5555V14.0555H13.1112V13.5555ZM1.5557 2.44436L1.5557 2.94436L14.4446 2.94434L14.4446 2.44434L14.4446 1.94434L1.5557 1.94436L1.5557 2.44436ZM14.4446 5.55545L14.4446 5.05545L1.55566 5.05546L1.55566 5.55546L1.55566 6.05546L14.4446 6.05545L14.4446 5.55545Z" fill="currentColor"/>`,
202
151
  },
203
152
  }
204
153
 
205
- type IconName = keyof typeof icons | keyof typeof additionalIcons
206
-
207
154
  const spriteID = "opencode-v2-icon-sprite"
208
- const symbol = (name: IconName) => `opencode-v2-icon-${name}`
155
+ const symbol = (name: keyof typeof icons) => `opencode-v2-icon-${name}`
209
156
  let spriteInserted = false
210
157
 
211
- function getIcon(name: IconName) {
212
- const icon = icons[name as keyof typeof icons]
213
- if (icon) return icon
214
- const body = additionalIcons[name as keyof typeof additionalIcons]
215
- return { body, viewBox: additionalIconViewBox(name as keyof typeof additionalIcons) }
216
- }
217
-
218
- function spriteContent() {
219
- return Array.from(new Set<IconName>([...Object.keys(additionalIcons), ...Object.keys(icons)] as IconName[]))
220
- .map((name) => `<symbol id="${symbol(name)}" viewBox="${getIcon(name).viewBox}">${getIcon(name).body}</symbol>`)
221
- .join("")
222
- }
223
-
224
158
  function ensureSprite() {
225
159
  if (spriteInserted) return
226
160
  if (typeof document === "undefined") return
227
- // Hot reload preserves the DOM sprite, but its symbols may be from an older module.
228
- const existing = document.getElementById(spriteID)
229
- if (existing) {
230
- existing.innerHTML = spriteContent()
161
+ if (document.getElementById(spriteID)) {
231
162
  spriteInserted = true
232
163
  return
233
164
  }
@@ -239,24 +170,25 @@ function ensureSprite() {
239
170
  svg.setAttribute("height", "0")
240
171
  svg.style.position = "absolute"
241
172
  svg.style.overflow = "hidden"
242
- svg.innerHTML = spriteContent()
173
+ svg.innerHTML = Object.entries(icons)
174
+ .map(
175
+ ([name, icon]) =>
176
+ `<symbol id="${symbol(name as keyof typeof icons)}" viewBox="${icon.viewBox}">${icon.body}</symbol>`,
177
+ )
178
+ .join("")
243
179
  document.body.insertBefore(svg, document.body.firstChild)
244
180
  spriteInserted = true
245
181
  }
246
182
 
247
183
  export interface IconProps extends ComponentProps<"svg"> {
248
- name: IconName | (string & {})
184
+ name: keyof typeof icons | (string & {})
249
185
  size?: "small" | "normal" | "large"
250
186
  }
251
187
 
252
188
  export function Icon(props: IconProps) {
253
189
  const [split, rest] = splitProps(props, ["name", "size"])
254
- const iconName = (): IconName => {
255
- if (icons[split.name as keyof typeof icons]) return split.name as keyof typeof icons
256
- if (additionalIcons[split.name as keyof typeof additionalIcons]) return split.name as keyof typeof additionalIcons
257
- return "plus"
258
- }
259
- const icon = () => getIcon(iconName())
190
+ const iconName = () => (icons[split.name as keyof typeof icons] ? (split.name as keyof typeof icons) : "plus")
191
+ const icon = () => icons[iconName()]
260
192
  const pixelSize = split.size === "small" ? 14 : split.size === "large" ? 20 : 16
261
193
  onMount(ensureSprite)
262
194
 
@@ -264,14 +196,6 @@ export function Icon(props: IconProps) {
264
196
  <svg
265
197
  {...rest}
266
198
  data-slot="icon-svg"
267
- data-directional={
268
- iconName() === "arrow-left" ||
269
- iconName() === "arrow-right" ||
270
- iconName() === "chevron-left" ||
271
- iconName() === "chevron-right"
272
- ? ""
273
- : undefined
274
- }
275
199
  width={pixelSize}
276
200
  height={pixelSize}
277
201
  viewBox={icon().viewBox}
@@ -0,0 +1,225 @@
1
+ [data-component="inline-input-v2"] {
2
+ box-sizing: border-box;
3
+ display: flex;
4
+ flex-direction: row;
5
+ align-items: stretch;
6
+ padding: 0;
7
+ width: 280px;
8
+ height: 28px;
9
+ border: 0;
10
+ border-radius: 6px;
11
+ outline: 1px solid transparent;
12
+ outline-offset: 0;
13
+ background:
14
+ linear-gradient(180deg, var(--v2-alpha-light-2) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-base);
15
+ box-shadow: var(--v2-elevation-button-neutral);
16
+ flex: none;
17
+ align-self: stretch;
18
+ overflow: hidden;
19
+ transition:
20
+ background 85ms ease-out,
21
+ outline-color 85ms ease-out,
22
+ box-shadow 85ms ease-out;
23
+ }
24
+
25
+ [data-component="inline-input-v2"][data-appearance="large"] {
26
+ height: 32px;
27
+ }
28
+
29
+ [data-component="inline-input-v2"]:where(:hover):not([data-disabled], [data-invalid]):not(:focus-within) {
30
+ background:
31
+ linear-gradient(0deg, var(--v2-overlay-simple-overlay-hover), var(--v2-overlay-simple-overlay-hover)),
32
+ linear-gradient(180deg, var(--v2-alpha-light-2) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-base);
33
+ }
34
+
35
+ [data-component="inline-input-v2"]:where(:hover):not([data-disabled], [data-invalid]):not(:focus-within)
36
+ [data-slot="inline-input-v2-prefix"] {
37
+ background: transparent;
38
+ }
39
+
40
+ [data-component="inline-input-v2"]:where(:focus-within):not([data-disabled], [data-invalid]) {
41
+ outline-color: var(--v2-border-border-focus);
42
+ box-shadow: none;
43
+ }
44
+
45
+ [data-component="inline-input-v2"]:where([data-invalid]):not([data-disabled]) {
46
+ outline-color: var(--v2-state-fg-danger);
47
+ box-shadow: none;
48
+ }
49
+
50
+ [data-component="inline-input-v2"]:where([data-disabled]) {
51
+ opacity: 0.5;
52
+ cursor: not-allowed;
53
+ }
54
+
55
+ [data-component="inline-input-v2"] [data-slot="inline-input-v2-prefix"] {
56
+ box-sizing: border-box;
57
+ display: flex;
58
+ flex-direction: column;
59
+ justify-content: center;
60
+ align-items: flex-start;
61
+ flex: none;
62
+ align-self: stretch;
63
+ width: fit-content;
64
+ min-width: 0;
65
+ max-width: 100%;
66
+ padding: 4px 8px;
67
+ gap: 4px;
68
+ background: var(--v2-background-bg-layer-01);
69
+ border-radius: 4px 0 0 4px;
70
+ cursor: default;
71
+ transition: background 85ms ease-out;
72
+ }
73
+
74
+ [data-component="inline-input-v2"]:where([data-disabled]) [data-slot="inline-input-v2-prefix"] {
75
+ cursor: not-allowed;
76
+ }
77
+
78
+ [data-component="inline-input-v2"][data-label-width] [data-slot="inline-input-v2-prefix"] {
79
+ width: var(--inline-input-v2-label-width);
80
+ min-width: var(--inline-input-v2-label-width);
81
+ max-width: var(--inline-input-v2-label-width);
82
+ }
83
+
84
+ [data-component="inline-input-v2"] [data-slot="inline-input-v2-prefix-text"] {
85
+ display: block;
86
+ width: 100%;
87
+ overflow: hidden;
88
+ text-overflow: ellipsis;
89
+ white-space: nowrap;
90
+ font-style: normal;
91
+ font-weight: 440;
92
+ font-size: 13px;
93
+ line-height: 1;
94
+ letter-spacing: -0.04px;
95
+ color: var(--v2-text-text-muted);
96
+ font-variation-settings: "slnt" 0;
97
+ user-select: none;
98
+ }
99
+
100
+ [data-component="inline-input-v2"][data-numeric] [data-slot="inline-input-v2-prefix-text"] {
101
+ font-variant-numeric: tabular-nums;
102
+ }
103
+
104
+ [data-component="inline-input-v2"] [data-slot="inline-input-v2-divider"] {
105
+ flex: none;
106
+ align-self: stretch;
107
+ width: 0.5px;
108
+ min-width: 0.5px;
109
+ background: var(--v2-border-border-base);
110
+ }
111
+
112
+ [data-component="inline-input-v2"] [data-slot="inline-input-v2-field"] {
113
+ display: flex;
114
+ flex-direction: row;
115
+ align-items: center;
116
+ align-self: stretch;
117
+ flex: 1 1 auto;
118
+ min-width: 0;
119
+ padding: 4px 8px;
120
+ gap: 8px;
121
+ }
122
+
123
+ [data-component="inline-input-v2"][data-appearance="large"] [data-slot="inline-input-v2-field"] {
124
+ padding-top: 6px;
125
+ padding-bottom: 6px;
126
+ }
127
+
128
+ [data-component="inline-input-v2"] [data-slot="inline-input-v2-value"] {
129
+ display: flex;
130
+ flex-direction: row;
131
+ align-items: center;
132
+ flex: 1 1 auto;
133
+ min-width: 0;
134
+ min-height: 0;
135
+ }
136
+
137
+ [data-component="inline-input-v2"] [data-slot="inline-input-v2-input"] {
138
+ display: block;
139
+ width: 100%;
140
+ min-width: 0;
141
+ height: 100%;
142
+ padding: 0;
143
+ margin: 0;
144
+ border: 0;
145
+ background: transparent;
146
+ outline: none;
147
+ font-style: normal;
148
+ font-weight: 440;
149
+ font-size: 13px;
150
+ line-height: 1;
151
+ letter-spacing: -0.04px;
152
+ color: var(--v2-text-text-base);
153
+ font-variation-settings: "slnt" 0;
154
+ }
155
+
156
+ [data-component="inline-input-v2"] [data-slot="inline-input-v2-input"]::placeholder {
157
+ color: var(--v2-text-text-faint);
158
+ user-select: none;
159
+ }
160
+
161
+ [data-component="inline-input-v2"][data-numeric] [data-slot="inline-input-v2-input"] {
162
+ font-variant-numeric: tabular-nums;
163
+ }
164
+
165
+ [data-component="inline-input-v2"] [data-slot="inline-input-v2-icon-button"] {
166
+ display: flex;
167
+ flex-direction: row;
168
+ justify-content: center;
169
+ align-items: center;
170
+ flex: none;
171
+ width: 20px;
172
+ height: 20px;
173
+ padding: 2px;
174
+ gap: 3px;
175
+ border: 0;
176
+ border-radius: 4px;
177
+ background: transparent;
178
+ color: var(--v2-icon-icon-muted);
179
+ cursor: pointer;
180
+ outline: none;
181
+ }
182
+
183
+ [data-component="inline-input-v2"]
184
+ [data-slot="inline-input-v2-icon-button"]:is(:hover, [data-state="hover"]):not(:disabled) {
185
+ background-color: var(--v2-overlay-simple-overlay-hover);
186
+ }
187
+
188
+ [data-component="inline-input-v2"]
189
+ [data-slot="inline-input-v2-icon-button"]:is(:active, [data-state="pressed"]):not(:disabled) {
190
+ background-color: var(--v2-overlay-simple-overlay-pressed);
191
+ }
192
+
193
+ [data-component="inline-input-v2"] [data-slot="inline-input-v2-icon-button"]:focus {
194
+ outline: none;
195
+ }
196
+
197
+ [data-component="inline-input-v2"] [data-slot="inline-input-v2-icon-button"]:focus-visible {
198
+ outline: 2px solid var(--v2-border-border-focus);
199
+ outline-offset: 1px;
200
+ }
201
+
202
+ [data-component="inline-input-v2"]:where([data-disabled]) [data-slot="inline-input-v2-icon-button"] {
203
+ cursor: not-allowed;
204
+ pointer-events: none;
205
+ }
206
+
207
+ [data-component="inline-input-v2"] [data-slot="inline-input-v2-icon-button"] [data-slot="icon-svg"] {
208
+ display: block;
209
+ flex: none;
210
+ color: currentColor;
211
+ }
212
+
213
+ [data-component="inline-input-v2"][data-invalid]:not([data-disabled]) [data-slot="inline-input-v2-prefix-text"] {
214
+ color: var(--v2-text-text-muted);
215
+ }
216
+
217
+ [data-component="inline-input-v2"][data-invalid]:not([data-disabled]) [data-slot="inline-input-v2-input"] {
218
+ color: var(--v2-state-fg-danger);
219
+ caret-color: var(--v2-state-fg-danger);
220
+ }
221
+
222
+ [data-component="inline-input-v2"][data-invalid]:not([data-disabled]) [data-slot="inline-input-v2-input"]::placeholder {
223
+ color: var(--v2-state-fg-danger);
224
+ opacity: 1;
225
+ }