@opencode-ai/ui 0.0.0-dev-202608261632 → 0.0.0-dev-18317

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 (289) hide show
  1. package/dist/actions/button/button.d.ts +10 -0
  2. package/dist/actions/icon-button/icon-button.d.ts +11 -0
  3. package/dist/actions/split-button/split-button.d.ts +5 -0
  4. package/dist/components/card.d.ts +1 -1
  5. package/dist/components/list.d.ts +1 -1
  6. package/dist/components/scroll-view.d.ts +3 -3
  7. package/dist/context/i18n.d.ts +10 -7
  8. package/dist/{components → data-display/accordion}/accordion.d.ts +6 -6
  9. package/dist/{v2/components/avatar-v2.d.ts → data-display/avatar/avatar.d.ts} +1 -1
  10. package/dist/data-display/badge/badge.d.ts +7 -0
  11. package/dist/{components → data-display/diff-changes}/diff-changes.d.ts +2 -1
  12. package/dist/data-display/keybind/keybind.d.ts +7 -0
  13. package/dist/{v2/components/line-comment-v2.d.ts → data-display/line-comment/line-comment.d.ts} +9 -9
  14. package/dist/{v2/components/project-avatar-v2.d.ts → data-display/project-avatar/project-avatar.d.ts} +1 -1
  15. package/dist/feedback/loader/loader.d.ts +3 -0
  16. package/dist/{components → feedback/progress-circle}/progress-circle.d.ts +2 -0
  17. package/dist/feedback/toast/toast.d.ts +57 -0
  18. package/dist/{components → forms/checkbox}/checkbox.d.ts +2 -2
  19. package/dist/{v2/components/field-v2.d.ts → forms/field/field.d.ts} +4 -10
  20. package/dist/forms/radio/radio.d.ts +16 -0
  21. package/dist/{v2/components/select-v2.d.ts → forms/select/select.d.ts} +4 -6
  22. package/dist/{components → forms/switch}/switch.d.ts +4 -2
  23. package/dist/{v2/components/text-input-v2.d.ts → forms/text-input/text-input.d.ts} +3 -3
  24. package/dist/forms/textarea/textarea.d.ts +7 -0
  25. package/dist/i18n/ar.d.ts +0 -2
  26. package/dist/i18n/bg.d.ts +0 -2
  27. package/dist/i18n/br.d.ts +0 -2
  28. package/dist/i18n/bs.d.ts +0 -2
  29. package/dist/i18n/da.d.ts +0 -2
  30. package/dist/i18n/de.d.ts +0 -2
  31. package/dist/i18n/en.d.ts +226 -1
  32. package/dist/i18n/es.d.ts +0 -2
  33. package/dist/i18n/fr.d.ts +0 -2
  34. package/dist/i18n/he.d.ts +197 -0
  35. package/dist/i18n/ja.d.ts +0 -2
  36. package/dist/i18n/km.d.ts +0 -2
  37. package/dist/i18n/ko.d.ts +0 -2
  38. package/dist/i18n/lo.d.ts +0 -2
  39. package/dist/i18n/mk.d.ts +0 -2
  40. package/dist/i18n/mn.d.ts +0 -2
  41. package/dist/i18n/my.d.ts +0 -2
  42. package/dist/i18n/pl.d.ts +0 -2
  43. package/dist/i18n/ru.d.ts +0 -2
  44. package/dist/i18n/sr.d.ts +0 -2
  45. package/dist/i18n/tg.d.ts +0 -2
  46. package/dist/i18n/th.d.ts +0 -2
  47. package/dist/i18n/tr.d.ts +0 -2
  48. package/dist/i18n/zh.d.ts +0 -2
  49. package/dist/i18n/zht.d.ts +0 -2
  50. package/dist/{components/icon.d.ts → icons/icon/additional-icons.d.ts} +8 -8
  51. package/dist/{v2/components → icons/icon}/icon.d.ts +24 -1
  52. package/dist/layout/divider/divider.d.ts +5 -0
  53. package/dist/navigation/menu/menu.d.ts +59 -0
  54. package/dist/{v2/components/segmented-control-v2.d.ts → navigation/segmented-control/segmented-control.d.ts} +5 -5
  55. package/dist/{components → navigation/tabs}/tabs.d.ts +15 -8
  56. package/dist/{v2/components/dialog-v2.d.ts → overlays/dialog/dialog.d.ts} +1 -2
  57. package/dist/overlays/tooltip/tooltip.d.ts +15 -0
  58. package/dist/{components → typography/text-shimmer}/text-shimmer.d.ts +1 -0
  59. package/dist/typography/wordmark/wordmark.d.ts +2 -0
  60. package/package.json +131 -13
  61. package/src/{components → actions/button}/button.tsx +10 -11
  62. package/src/actions/icon-button/icon-button.tsx +32 -0
  63. package/src/{v2/components/split-button-v2.css → actions/split-button/split-button.css} +1 -6
  64. package/src/{v2/components/split-button-v2.tsx → actions/split-button/split-button.tsx} +4 -4
  65. package/src/components/animated-number.css +29 -11
  66. package/src/components/animated-number.tsx +2 -2
  67. package/src/components/card.css +2 -23
  68. package/src/components/card.tsx +4 -4
  69. package/src/components/collapsible.tsx +2 -2
  70. package/src/components/dock-surface.css +2 -9
  71. package/src/components/image-preview.tsx +3 -2
  72. package/src/components/list.css +5 -5
  73. package/src/components/list.tsx +7 -5
  74. package/src/components/popover.tsx +3 -2
  75. package/src/components/scroll-view.tsx +5 -20
  76. package/src/components/sticky-accordion-header.tsx +1 -1
  77. package/src/components/text-field.tsx +12 -4
  78. package/src/context/dialog.tsx +1 -0
  79. package/src/context/i18n.tsx +17 -14
  80. package/src/{components → data-display/accordion}/accordion.css +1 -26
  81. package/src/{components → data-display/accordion}/accordion.tsx +14 -14
  82. package/src/{v2/components/avatar-v2.tsx → data-display/avatar/avatar.tsx} +1 -1
  83. package/src/{v2/components/badge-v2.css → data-display/badge/badge.css} +19 -0
  84. package/src/{v2/components/badge-v2.tsx → data-display/badge/badge.tsx} +6 -4
  85. package/src/{components → data-display/diff-changes}/diff-changes.css +22 -19
  86. package/src/{v2/components/diff-changes-v2.tsx → data-display/diff-changes/diff-changes.tsx} +7 -2
  87. package/src/{v2/components/keybind-v2.css → data-display/keybind/keybind.css} +1 -1
  88. package/src/{v2/components/keybind-v2.tsx → data-display/keybind/keybind.tsx} +3 -3
  89. package/src/{v2/components/line-comment-v2.css → data-display/line-comment/line-comment.css} +3 -3
  90. package/src/{v2/components/line-comment-v2.tsx → data-display/line-comment/line-comment.tsx} +17 -15
  91. package/src/{v2/components/project-avatar-v2.tsx → data-display/project-avatar/project-avatar.tsx} +1 -1
  92. package/src/{v2/components/loader-v2.tsx → feedback/loader/loader.tsx} +2 -2
  93. package/src/feedback/progress-circle/progress-circle.css +28 -0
  94. package/src/feedback/progress-circle/progress-circle.tsx +64 -0
  95. package/src/{v2/components/toast-v2.tsx → feedback/toast/toast.tsx} +60 -58
  96. package/src/{components → forms/checkbox}/checkbox.css +1 -7
  97. package/src/{components → forms/checkbox}/checkbox.tsx +13 -13
  98. package/src/{v2/components/field-v2.css → forms/field/field.css} +1 -1
  99. package/src/{v2/components/field-v2.tsx → forms/field/field.tsx} +9 -11
  100. package/src/{v2/components/radio-v2.tsx → forms/radio/radio.tsx} +30 -20
  101. package/src/{v2/components/select-v2.css → forms/select/select.css} +2 -8
  102. package/src/{v2/components/select-v2.tsx → forms/select/select.tsx} +38 -32
  103. package/src/{v2/components/switch-v2.css → forms/switch/switch.css} +110 -0
  104. package/src/forms/switch/switch.tsx +34 -0
  105. package/src/{v2/components/text-input-v2.css → forms/text-input/text-input.css} +1 -1
  106. package/src/{v2/components/text-input-v2.tsx → forms/text-input/text-input.tsx} +4 -4
  107. package/src/{v2/components/textarea-v2.tsx → forms/textarea/textarea.tsx} +3 -3
  108. package/src/hooks/create-auto-scroll.tsx +20 -0
  109. package/src/i18n/am.ts +1 -3
  110. package/src/i18n/ar.ts +1 -3
  111. package/src/i18n/az.ts +1 -3
  112. package/src/i18n/bg.ts +1 -3
  113. package/src/i18n/bn.ts +1 -3
  114. package/src/i18n/br.ts +1 -3
  115. package/src/i18n/bs.ts +1 -3
  116. package/src/i18n/ca.ts +1 -3
  117. package/src/i18n/cs.ts +1 -3
  118. package/src/i18n/da.ts +1 -3
  119. package/src/i18n/de.ts +1 -3
  120. package/src/i18n/dv.ts +1 -3
  121. package/src/i18n/dz.ts +1 -3
  122. package/src/i18n/el.ts +1 -3
  123. package/src/i18n/en.ts +36 -5
  124. package/src/i18n/es.ts +1 -3
  125. package/src/i18n/et.ts +1 -3
  126. package/src/i18n/fa.ts +1 -3
  127. package/src/i18n/fi.ts +1 -3
  128. package/src/i18n/fo.ts +1 -3
  129. package/src/i18n/fr.ts +1 -3
  130. package/src/i18n/he.ts +199 -0
  131. package/src/i18n/hi.ts +1 -3
  132. package/src/i18n/hr.ts +1 -3
  133. package/src/i18n/hu.ts +1 -3
  134. package/src/i18n/hy.ts +1 -3
  135. package/src/i18n/id.ts +1 -3
  136. package/src/i18n/is.ts +1 -3
  137. package/src/i18n/it.ts +1 -3
  138. package/src/i18n/ja.ts +1 -3
  139. package/src/i18n/ka.ts +1 -3
  140. package/src/i18n/km.ts +1 -3
  141. package/src/i18n/ko.ts +1 -3
  142. package/src/i18n/lo.ts +1 -3
  143. package/src/i18n/lt.ts +1 -3
  144. package/src/i18n/lv.ts +1 -3
  145. package/src/i18n/mk.ts +1 -3
  146. package/src/i18n/mn.ts +1 -3
  147. package/src/i18n/ms.ts +1 -3
  148. package/src/i18n/my.ts +1 -3
  149. package/src/i18n/ne.ts +1 -3
  150. package/src/i18n/nl.ts +1 -3
  151. package/src/i18n/no.ts +1 -3
  152. package/src/i18n/pa.ts +1 -3
  153. package/src/i18n/pl.ts +1 -3
  154. package/src/i18n/ro.ts +1 -3
  155. package/src/i18n/ru.ts +1 -3
  156. package/src/i18n/si.ts +1 -3
  157. package/src/i18n/sk.ts +1 -3
  158. package/src/i18n/sl.ts +1 -3
  159. package/src/i18n/sq.ts +1 -3
  160. package/src/i18n/sr.ts +1 -3
  161. package/src/i18n/sv.ts +1 -3
  162. package/src/i18n/tg.ts +1 -3
  163. package/src/i18n/th.ts +1 -3
  164. package/src/i18n/tk.ts +1 -3
  165. package/src/i18n/tr.ts +1 -3
  166. package/src/i18n/uk.ts +1 -3
  167. package/src/i18n/ur.ts +1 -3
  168. package/src/i18n/uz.ts +1 -3
  169. package/src/i18n/vi.ts +1 -3
  170. package/src/i18n/zh.ts +1 -3
  171. package/src/i18n/zht.ts +1 -3
  172. package/src/{components/icon.tsx → icons/icon/additional-icons.ts} +8 -74
  173. package/src/icons/icon/icon.css +3 -0
  174. package/src/{v2/components → icons/icon}/icon.tsx +50 -9
  175. package/src/{v2/components/divider-v2.tsx → layout/divider/divider.tsx} +3 -3
  176. package/src/{v2/components/menu-v2.css → navigation/menu/menu.css} +122 -1
  177. package/src/{v2/components/menu-v2.tsx → navigation/menu/menu.tsx} +96 -32
  178. package/src/{v2/components/segmented-control-v2.css → navigation/segmented-control/segmented-control.css} +1 -1
  179. package/src/{v2/components/segmented-control-v2.tsx → navigation/segmented-control/segmented-control.tsx} +9 -8
  180. package/src/{v2/components/tabs-v2.css → navigation/tabs/tabs-current.css} +25 -10
  181. package/src/{components → navigation/tabs}/tabs.css +39 -229
  182. package/src/navigation/tabs/tabs.tsx +194 -0
  183. package/src/{v2/components/dialog-v2.css → overlays/dialog/dialog.css} +3 -0
  184. package/src/{v2/components/dialog-v2.tsx → overlays/dialog/dialog.tsx} +11 -13
  185. package/src/{v2/components/tooltip-v2.css → overlays/tooltip/tooltip.css} +26 -0
  186. package/src/{v2/components/tooltip-v2.tsx → overlays/tooltip/tooltip.tsx} +21 -14
  187. package/src/styles/index.css +4 -20
  188. package/src/styles/tailwind/colors.css +1 -0
  189. package/src/styles/tailwind/index.css +18 -1
  190. package/src/styles/theme.css +2 -2
  191. package/src/{v2/styles → styles/tokens}/theme.css +10 -14
  192. package/src/theme/context.tsx +19 -11
  193. package/src/theme/themes/oc-2.json +3 -1
  194. package/src/theme/v2/foreground.ts +1 -0
  195. package/src/{components → typography/text-shimmer}/text-shimmer.css +2 -1
  196. package/src/{components → typography/text-shimmer}/text-shimmer.tsx +1 -0
  197. package/src/{v2/components/wordmark-v2.tsx → typography/wordmark/wordmark.tsx} +1 -1
  198. package/dist/components/avatar.d.ts +0 -9
  199. package/dist/components/button.d.ts +0 -9
  200. package/dist/components/dialog.d.ts +0 -12
  201. package/dist/components/dropdown-menu.d.ts +0 -80
  202. package/dist/components/icon-button.d.ts +0 -10
  203. package/dist/components/keybind.d.ts +0 -6
  204. package/dist/components/radio-group.d.ts +0 -16
  205. package/dist/components/select.d.ts +0 -21
  206. package/dist/components/tag.d.ts +0 -5
  207. package/dist/components/toast.d.ts +0 -56
  208. package/dist/components/tooltip.d.ts +0 -17
  209. package/dist/v2/components/accordion-v2.d.ts +0 -26
  210. package/dist/v2/components/badge-v2.d.ts +0 -6
  211. package/dist/v2/components/button-v2.d.ts +0 -10
  212. package/dist/v2/components/checkbox-v2.d.ts +0 -10
  213. package/dist/v2/components/diff-changes-v2.d.ts +0 -11
  214. package/dist/v2/components/divider-v2.d.ts +0 -5
  215. package/dist/v2/components/icon-button-v2.d.ts +0 -11
  216. package/dist/v2/components/inline-input-v2.d.ts +0 -21
  217. package/dist/v2/components/keybind-v2.d.ts +0 -7
  218. package/dist/v2/components/loader-v2.d.ts +0 -3
  219. package/dist/v2/components/menu-v2.d.ts +0 -52
  220. package/dist/v2/components/progress-circle-v2.d.ts +0 -8
  221. package/dist/v2/components/radio-v2.d.ts +0 -16
  222. package/dist/v2/components/split-button-v2.d.ts +0 -5
  223. package/dist/v2/components/switch-v2.d.ts +0 -7
  224. package/dist/v2/components/tabs-v2.d.ts +0 -34
  225. package/dist/v2/components/text-shimmer-v2.d.ts +0 -9
  226. package/dist/v2/components/textarea-v2.d.ts +0 -7
  227. package/dist/v2/components/toast-v2.d.ts +0 -57
  228. package/dist/v2/components/tooltip-v2.d.ts +0 -13
  229. package/dist/v2/components/wordmark-v2.d.ts +0 -2
  230. package/src/components/avatar.css +0 -49
  231. package/src/components/avatar.tsx +0 -55
  232. package/src/components/button.css +0 -194
  233. package/src/components/dialog.css +0 -181
  234. package/src/components/dialog.tsx +0 -72
  235. package/src/components/diff-changes.tsx +0 -115
  236. package/src/components/dropdown-menu.css +0 -135
  237. package/src/components/dropdown-menu.tsx +0 -308
  238. package/src/components/icon-button.css +0 -181
  239. package/src/components/icon-button.tsx +0 -29
  240. package/src/components/icon.css +0 -39
  241. package/src/components/keybind.css +0 -18
  242. package/src/components/keybind.tsx +0 -20
  243. package/src/components/progress-circle.css +0 -16
  244. package/src/components/progress-circle.tsx +0 -64
  245. package/src/components/radio-group.css +0 -187
  246. package/src/components/radio-group.tsx +0 -83
  247. package/src/components/select.css +0 -201
  248. package/src/components/select.tsx +0 -174
  249. package/src/components/switch.css +0 -136
  250. package/src/components/switch.tsx +0 -29
  251. package/src/components/tabs.tsx +0 -126
  252. package/src/components/tag.css +0 -37
  253. package/src/components/tag.tsx +0 -22
  254. package/src/components/toast.css +0 -236
  255. package/src/components/toast.tsx +0 -185
  256. package/src/components/tooltip.css +0 -74
  257. package/src/components/tooltip.tsx +0 -163
  258. package/src/v2/components/accordion-v2.css +0 -139
  259. package/src/v2/components/accordion-v2.tsx +0 -86
  260. package/src/v2/components/button-v2.tsx +0 -35
  261. package/src/v2/components/checkbox-v2.css +0 -184
  262. package/src/v2/components/checkbox-v2.tsx +0 -65
  263. package/src/v2/components/diff-changes-v2.css +0 -26
  264. package/src/v2/components/icon-button-v2.tsx +0 -37
  265. package/src/v2/components/inline-input-v2.css +0 -225
  266. package/src/v2/components/inline-input-v2.tsx +0 -107
  267. package/src/v2/components/progress-circle-v2.css +0 -13
  268. package/src/v2/components/progress-circle-v2.tsx +0 -52
  269. package/src/v2/components/switch-v2.tsx +0 -28
  270. package/src/v2/components/tabs-v2.tsx +0 -149
  271. package/src/v2/components/text-shimmer-v2.css +0 -125
  272. package/src/v2/components/text-shimmer-v2.tsx +0 -63
  273. /package/dist/{components → forms/inline-input}/inline-input.d.ts +0 -0
  274. /package/dist/{v2/components → navigation}/tab-state-indicator.d.ts +0 -0
  275. /package/src/{v2/components/button-v2.css → actions/button/button.css} +0 -0
  276. /package/src/{v2/components/icon-button-v2.css → actions/icon-button/icon-button.css} +0 -0
  277. /package/src/{v2/components/avatar-v2.css → data-display/avatar/avatar.css} +0 -0
  278. /package/src/{v2/components/project-avatar-v2.css → data-display/project-avatar/project-avatar.css} +0 -0
  279. /package/src/{v2/components/loader-v2.css → feedback/loader/loader.css} +0 -0
  280. /package/src/{v2/components/toast-v2.css → feedback/toast/toast.css} +0 -0
  281. /package/src/{components → forms/inline-input}/inline-input.css +0 -0
  282. /package/src/{components → forms/inline-input}/inline-input.tsx +0 -0
  283. /package/src/{v2/components/radio-v2.css → forms/radio/radio.css} +0 -0
  284. /package/src/{v2/components/textarea-v2.css → forms/textarea/textarea.css} +0 -0
  285. /package/src/{v2/components/divider-v2.css → layout/divider/divider.css} +0 -0
  286. /package/src/{v2/components → navigation}/tab-state-indicator.tsx +0 -0
  287. /package/src/{v2/components/file-tree-v2.css → styles/file-tree.css} +0 -0
  288. /package/src/{v2/styles → styles/tokens}/colors.css +0 -0
  289. /package/src/{v2/styles/tailwind.css → styles/tokens/index.css} +0 -0
@@ -1,7 +1,17 @@
1
1
  import { DropdownMenu } from "@kobalte/core/dropdown-menu"
2
2
  import { ContextMenu } from "@kobalte/core/context-menu"
3
- import { Show, splitProps, type Component, type ComponentProps, type JSX, type ParentProps } from "solid-js"
4
- import "./menu-v2.css"
3
+ import {
4
+ createContext,
5
+ Show,
6
+ splitProps,
7
+ useContext,
8
+ type Accessor,
9
+ type Component,
10
+ type ComponentProps,
11
+ type JSX,
12
+ type ParentProps,
13
+ } from "solid-js"
14
+ import "./menu.css"
5
15
 
6
16
  const ChevronRight: Component = () => (
7
17
  <svg
@@ -29,6 +39,18 @@ const CheckMark: Component = () => (
29
39
  </svg>
30
40
  )
31
41
 
42
+ export type MenuAppearance = "standard" | "compact"
43
+
44
+ const MenuAppearanceContext = createContext<{ appearance: Accessor<MenuAppearance> }>({
45
+ appearance: (): MenuAppearance => "compact",
46
+ })
47
+
48
+ function useMenuContext() {
49
+ const ctx = useContext(MenuAppearanceContext)
50
+ if (!ctx) throw new Error("Menu components must be used inside Menu or Menu.Context")
51
+ return ctx
52
+ }
53
+
32
54
  function ItemBody(
33
55
  props: ParentProps<{
34
56
  shortcut?: JSX.Element | string
@@ -46,15 +68,21 @@ function ItemBody(
46
68
  )
47
69
  }
48
70
 
49
- export interface MenuV2ItemProps extends ComponentProps<typeof DropdownMenu.Item> {
71
+ export interface MenuItemProps extends ComponentProps<typeof DropdownMenu.Item> {
50
72
  shortcut?: JSX.Element | string
51
73
  badge?: JSX.Element | string
52
74
  }
53
75
 
54
- function MenuV2Item(props: ParentProps<MenuV2ItemProps>) {
76
+ function MenuItem(props: ParentProps<MenuItemProps>) {
77
+ const ctx = useMenuContext()
55
78
  const [s, r] = splitProps(props, ["class", "classList", "children", "shortcut", "badge"])
56
79
  return (
57
- <DropdownMenu.Item {...r} data-component="menu-v2-item" classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}>
80
+ <DropdownMenu.Item
81
+ {...r}
82
+ data-component="menu-v2-item"
83
+ data-appearance={ctx.appearance()}
84
+ classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
85
+ >
58
86
  <ItemBody shortcut={s.shortcut} badge={s.badge}>
59
87
  {s.children}
60
88
  </ItemBody>
@@ -62,17 +90,19 @@ function MenuV2Item(props: ParentProps<MenuV2ItemProps>) {
62
90
  )
63
91
  }
64
92
 
65
- export interface MenuV2CheckboxItemProps extends ComponentProps<typeof DropdownMenu.CheckboxItem> {
93
+ export interface MenuCheckboxItemProps extends ComponentProps<typeof DropdownMenu.CheckboxItem> {
66
94
  shortcut?: JSX.Element | string
67
95
  badge?: JSX.Element | string
68
96
  }
69
97
 
70
- function MenuV2CheckboxItem(props: ParentProps<MenuV2CheckboxItemProps>) {
98
+ function MenuCheckboxItem(props: ParentProps<MenuCheckboxItemProps>) {
99
+ const ctx = useMenuContext()
71
100
  const [s, r] = splitProps(props, ["class", "classList", "children", "shortcut", "badge"])
72
101
  return (
73
102
  <DropdownMenu.CheckboxItem
74
103
  {...r}
75
104
  data-component="menu-v2-item"
105
+ data-appearance={ctx.appearance()}
76
106
  classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
77
107
  >
78
108
  <ItemBody
@@ -90,17 +120,19 @@ function MenuV2CheckboxItem(props: ParentProps<MenuV2CheckboxItemProps>) {
90
120
  )
91
121
  }
92
122
 
93
- export interface MenuV2RadioItemProps extends ComponentProps<typeof DropdownMenu.RadioItem> {
123
+ export interface MenuRadioItemProps extends ComponentProps<typeof DropdownMenu.RadioItem> {
94
124
  shortcut?: JSX.Element | string
95
125
  badge?: JSX.Element | string
96
126
  }
97
127
 
98
- function MenuV2RadioItem(props: ParentProps<MenuV2RadioItemProps>) {
128
+ function MenuRadioItem(props: ParentProps<MenuRadioItemProps>) {
129
+ const ctx = useMenuContext()
99
130
  const [s, r] = splitProps(props, ["class", "classList", "children", "shortcut", "badge"])
100
131
  return (
101
132
  <DropdownMenu.RadioItem
102
133
  {...r}
103
134
  data-component="menu-v2-item"
135
+ data-appearance={ctx.appearance()}
104
136
  classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
105
137
  >
106
138
  <ItemBody
@@ -118,17 +150,19 @@ function MenuV2RadioItem(props: ParentProps<MenuV2RadioItemProps>) {
118
150
  )
119
151
  }
120
152
 
121
- export interface MenuV2SubTriggerProps extends ComponentProps<typeof DropdownMenu.SubTrigger> {
153
+ export interface MenuSubTriggerProps extends ComponentProps<typeof DropdownMenu.SubTrigger> {
122
154
  shortcut?: JSX.Element | string
123
155
  badge?: JSX.Element | string
124
156
  }
125
157
 
126
- function MenuV2SubTrigger(props: ParentProps<MenuV2SubTriggerProps>) {
158
+ function MenuSubTrigger(props: ParentProps<MenuSubTriggerProps>) {
159
+ const ctx = useMenuContext()
127
160
  const [s, r] = splitProps(props, ["class", "classList", "children", "shortcut", "badge"])
128
161
  return (
129
162
  <DropdownMenu.SubTrigger
130
163
  {...r}
131
164
  data-component="menu-v2-item"
165
+ data-appearance={ctx.appearance()}
132
166
  classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
133
167
  >
134
168
  <ItemBody shortcut={s.shortcut} badge={s.badge} trailing={<ChevronRight />}>
@@ -138,88 +172,118 @@ function MenuV2SubTrigger(props: ParentProps<MenuV2SubTriggerProps>) {
138
172
  )
139
173
  }
140
174
 
141
- function MenuV2SubContent(props: ComponentProps<typeof DropdownMenu.SubContent>) {
175
+ function MenuSubContent(props: ComponentProps<typeof DropdownMenu.SubContent>) {
176
+ const ctx = useMenuContext()
142
177
  const [s, r] = splitProps(props, ["class", "classList"])
143
178
  return (
144
179
  <DropdownMenu.SubContent
145
180
  {...r}
146
181
  data-component="menu-v2-content"
182
+ data-appearance={ctx.appearance()}
147
183
  classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
148
184
  />
149
185
  )
150
186
  }
151
187
 
152
- function MenuV2GroupLabel(props: ComponentProps<typeof DropdownMenu.GroupLabel>) {
188
+ function MenuGroupLabel(props: ComponentProps<typeof DropdownMenu.GroupLabel>) {
189
+ const ctx = useMenuContext()
153
190
  const [s, r] = splitProps(props, ["class", "classList"])
154
191
  return (
155
192
  <DropdownMenu.GroupLabel
156
193
  {...r}
157
194
  data-slot="menu-v2-group-label"
195
+ data-appearance={ctx.appearance()}
158
196
  classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
159
197
  />
160
198
  )
161
199
  }
162
200
 
163
- function MenuV2Separator(props: ComponentProps<typeof DropdownMenu.Separator>) {
201
+ function MenuSeparator(props: ComponentProps<typeof DropdownMenu.Separator>) {
202
+ const ctx = useMenuContext()
164
203
  const [s, r] = splitProps(props, ["class", "classList"])
165
204
  return (
166
205
  <DropdownMenu.Separator
167
206
  {...r}
168
207
  data-slot="menu-v2-separator"
208
+ data-appearance={ctx.appearance()}
169
209
  classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
170
210
  />
171
211
  )
172
212
  }
173
213
 
174
- function MenuV2Content(props: ComponentProps<typeof DropdownMenu.Content>) {
214
+ function MenuContent(props: ComponentProps<typeof DropdownMenu.Content>) {
215
+ const ctx = useMenuContext()
175
216
  const [s, r] = splitProps(props, ["class", "classList"])
176
217
  return (
177
218
  <DropdownMenu.Content
178
219
  {...r}
179
220
  data-component="menu-v2-content"
221
+ data-appearance={ctx.appearance()}
180
222
  classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
181
223
  />
182
224
  )
183
225
  }
184
226
 
185
- function MenuV2Root(props: ComponentProps<typeof DropdownMenu>) {
186
- return <DropdownMenu {...props} />
227
+ export interface MenuProps extends ComponentProps<typeof DropdownMenu> {
228
+ appearance?: MenuAppearance
187
229
  }
188
230
 
189
- function MenuV2ContextRoot(props: ComponentProps<typeof ContextMenu>) {
190
- return <ContextMenu {...props} />
231
+ function MenuRoot(props: MenuProps) {
232
+ const [local, rest] = splitProps(props, ["appearance", "children"])
233
+ const appearance = () => local.appearance ?? "compact"
234
+ return (
235
+ <MenuAppearanceContext.Provider value={{ appearance }}>
236
+ <DropdownMenu {...rest}>{local.children}</DropdownMenu>
237
+ </MenuAppearanceContext.Provider>
238
+ )
239
+ }
240
+
241
+ export interface MenuContextProps extends ComponentProps<typeof ContextMenu> {
242
+ appearance?: MenuAppearance
243
+ }
244
+
245
+ function MenuContextRoot(props: MenuContextProps) {
246
+ const [local, rest] = splitProps(props, ["appearance", "children"])
247
+ const appearance = () => local.appearance ?? "compact"
248
+ return (
249
+ <MenuAppearanceContext.Provider value={{ appearance }}>
250
+ <ContextMenu {...rest}>{local.children}</ContextMenu>
251
+ </MenuAppearanceContext.Provider>
252
+ )
191
253
  }
192
254
 
193
- function MenuV2ContextContent(props: ComponentProps<typeof ContextMenu.Content>) {
255
+ function MenuContextContent(props: ComponentProps<typeof ContextMenu.Content>) {
256
+ const ctx = useMenuContext()
194
257
  const [s, r] = splitProps(props, ["class", "classList"])
195
258
  return (
196
259
  <ContextMenu.Content
197
260
  {...r}
198
261
  data-component="menu-v2-content"
262
+ data-appearance={ctx.appearance()}
199
263
  classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
200
264
  />
201
265
  )
202
266
  }
203
267
 
204
- const MenuV2Context = Object.assign(MenuV2ContextRoot, {
268
+ const MenuContext = Object.assign(MenuContextRoot, {
205
269
  Trigger: ContextMenu.Trigger,
206
270
  Portal: ContextMenu.Portal,
207
- Content: MenuV2ContextContent,
271
+ Content: MenuContextContent,
208
272
  })
209
273
 
210
- export const MenuV2 = Object.assign(MenuV2Root, {
274
+ export const Menu = Object.assign(MenuRoot, {
211
275
  Trigger: DropdownMenu.Trigger,
212
276
  Portal: DropdownMenu.Portal,
213
- Content: MenuV2Content,
214
- Item: MenuV2Item,
215
- CheckboxItem: MenuV2CheckboxItem,
277
+ Content: MenuContent,
278
+ Item: MenuItem,
279
+ CheckboxItem: MenuCheckboxItem,
216
280
  RadioGroup: DropdownMenu.RadioGroup,
217
- RadioItem: MenuV2RadioItem,
281
+ RadioItem: MenuRadioItem,
218
282
  Group: DropdownMenu.Group,
219
- GroupLabel: MenuV2GroupLabel,
220
- Separator: MenuV2Separator,
283
+ GroupLabel: MenuGroupLabel,
284
+ Separator: MenuSeparator,
221
285
  Sub: DropdownMenu.Sub,
222
- SubTrigger: MenuV2SubTrigger,
223
- SubContent: MenuV2SubContent,
224
- Context: MenuV2Context,
286
+ SubTrigger: MenuSubTrigger,
287
+ SubContent: MenuSubContent,
288
+ Context: MenuContext,
225
289
  })
@@ -37,7 +37,7 @@
37
37
  font-style: normal;
38
38
  font-weight: 440;
39
39
  font-size: 13px;
40
- line-height: 100%;
40
+ line-height: var(--line-height-compact);
41
41
  letter-spacing: -0.04px;
42
42
  font-variant-numeric: tabular-nums;
43
43
  font-variation-settings: "slnt" 0;
@@ -10,7 +10,7 @@ import {
10
10
  type ParentProps,
11
11
  } from "solid-js"
12
12
  import type { ComponentProps } from "solid-js"
13
- import "./segmented-control-v2.css"
13
+ import "./segmented-control.css"
14
14
 
15
15
  type OnChange = (value: string | null) => void
16
16
 
@@ -26,11 +26,11 @@ const SegmentedControlContext = createContext<SegmentedControlContextValue>()
26
26
 
27
27
  function useSegmentedControlContext() {
28
28
  const ctx = useContext(SegmentedControlContext)
29
- if (!ctx) throw new Error("SegmentedControlItemV2 must be used inside SegmentedControlV2")
29
+ if (!ctx) throw new Error("SegmentedControlItem must be used inside SegmentedControl")
30
30
  return ctx
31
31
  }
32
32
 
33
- export type SegmentedControlV2Props = Omit<ComponentProps<"div">, "onChange"> &
33
+ export type SegmentedControlProps = Omit<ComponentProps<"div">, "onChange"> &
34
34
  ParentProps<{
35
35
  /** Selected value when controlled (including `null` when empty). Omit key for uncontrolled. */
36
36
  value?: string | null
@@ -42,7 +42,7 @@ export type SegmentedControlV2Props = Omit<ComponentProps<"div">, "onChange"> &
42
42
  disabled?: boolean
43
43
  }>
44
44
 
45
- export function SegmentedControlV2(props: SegmentedControlV2Props) {
45
+ export function SegmentedControl(props: SegmentedControlProps) {
46
46
  const isControlled = createMemo(() => Object.hasOwn(props as object, "value"))
47
47
  const merged = mergeProps({ allowDeselect: false, disabled: false }, props)
48
48
  const [local, rest] = splitProps(merged, [
@@ -119,7 +119,7 @@ export function SegmentedControlV2(props: SegmentedControlV2Props) {
119
119
  )
120
120
  }
121
121
 
122
- export type SegmentedControlItemV2Props = Omit<ComponentProps<"button">, "type" | "children"> &
122
+ export type SegmentedControlItemProps = Omit<ComponentProps<"button">, "type" | "children"> &
123
123
  ParentProps<{
124
124
  value: string
125
125
  children: JSX.Element
@@ -132,7 +132,7 @@ function invokeButtonHandler<E extends Event>(
132
132
  if (typeof handler === "function") (handler as (ev: typeof e) => void)(e)
133
133
  }
134
134
 
135
- export function SegmentedControlItemV2(props: SegmentedControlItemV2Props) {
135
+ export function SegmentedControlItem(props: SegmentedControlItemProps) {
136
136
  const merged = mergeProps({ disabled: false }, props)
137
137
  const [local, rest] = splitProps(merged, [
138
138
  "class",
@@ -159,13 +159,14 @@ export function SegmentedControlItemV2(props: SegmentedControlItemV2Props) {
159
159
  invokeButtonHandler(local.onKeyDown, e)
160
160
  if (e.defaultPrevented || disabled()) return
161
161
  const t = e.currentTarget
162
+ const horizontal = t.closest(`[data-slot="segmented-control-v2"]`)?.matches(":dir(rtl)") ? -1 : 1
162
163
 
163
164
  if (e.key === "ArrowRight") {
164
165
  e.preventDefault()
165
- ctx.focusNext(t, 1)
166
+ ctx.focusNext(t, horizontal)
166
167
  } else if (e.key === "ArrowLeft") {
167
168
  e.preventDefault()
168
- ctx.focusNext(t, -1)
169
+ ctx.focusNext(t, -horizontal as 1 | -1)
169
170
  }
170
171
 
171
172
  // accessibility stuff
@@ -59,7 +59,7 @@
59
59
 
60
60
  font-size: 13px;
61
61
  font-weight: 440;
62
- line-height: 100%;
62
+ line-height: var(--line-height-compact);
63
63
  letter-spacing: -0.04px;
64
64
  }
65
65
 
@@ -68,22 +68,29 @@
68
68
  box-shadow: none;
69
69
  }
70
70
 
71
- [data-component="tabs-v2"] [data-slot="tabs-v2-close-button"] {
72
- width: 20px;
73
- height: 20px;
71
+ [data-slot="tabs-v2-trigger-close-button"] {
72
+ display: flex;
73
+ align-items: center;
74
+ justify-content: center;
74
75
  margin-inline-start: -5px;
75
76
  flex: none;
77
+ }
78
+
79
+ [data-slot="tabs-v2-trigger-close-button"] [data-slot="tabs-close-button"] {
80
+ width: 20px;
81
+ height: 20px;
82
+ padding: 0;
76
83
  display: flex;
77
84
  align-items: center;
78
85
  justify-content: center;
79
86
  color: var(--v2-text-text-faint);
80
87
  }
81
88
 
82
- [data-component="tabs-v2"] [data-slot="tabs-v2-close-button"]:hover {
89
+ [data-slot="tabs-v2-trigger-close-button"] [data-slot="tabs-close-button"]:hover {
83
90
  color: var(--v2-text-text-muted);
84
91
  }
85
92
 
86
- [data-component="tabs-v2"] [data-component="icon-button"] {
93
+ [data-component="tabs-v2"] [data-component="icon-button-v2"] {
87
94
  margin: 0;
88
95
  }
89
96
 
@@ -175,7 +182,7 @@
175
182
  border: 0.5px solid var(--v2-border-border-muted);
176
183
  }
177
184
 
178
- [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-list"] {
185
+ [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] > [data-slot="tabs-v2-list"] {
179
186
  flex-direction: column;
180
187
  width: 240px;
181
188
  min-width: 200px;
@@ -186,7 +193,9 @@
186
193
  border-inline-end: 1px solid var(--v2-border-border-base);
187
194
  }
188
195
 
189
- [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-section-title"] {
196
+ [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
197
+ > [data-slot="tabs-v2-list"]
198
+ [data-slot="tabs-v2-section-title"] {
190
199
  width: 100%;
191
200
  padding-inline-start: 4px;
192
201
  color: var(--v2-text-text-muted);
@@ -195,7 +204,9 @@
195
204
  user-select: none;
196
205
  }
197
206
 
198
- [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-trigger-wrapper"] {
207
+ [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
208
+ > [data-slot="tabs-v2-list"]
209
+ [data-slot="tabs-v2-trigger-wrapper"] {
199
210
  width: 100%;
200
211
  height: 28px;
201
212
  border-radius: 4px;
@@ -203,7 +214,9 @@
203
214
  color: var(--v2-text-text-muted);
204
215
  }
205
216
 
206
- [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-trigger"] {
217
+ [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
218
+ > [data-slot="tabs-v2-list"]
219
+ [data-slot="tabs-v2-trigger"] {
207
220
  width: 100%;
208
221
  height: 100%;
209
222
  justify-content: flex-start;
@@ -212,12 +225,14 @@
212
225
  }
213
226
 
214
227
  [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
228
+ > [data-slot="tabs-v2-list"]
215
229
  [data-slot="tabs-v2-trigger-wrapper"]:hover:not(:disabled):not(:has([data-selected])) {
216
230
  background-color: var(--v2-background-bg-layer-03);
217
231
  color: var(--v2-text-text-base);
218
232
  }
219
233
 
220
234
  [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
235
+ > [data-slot="tabs-v2-list"]
221
236
  [data-slot="tabs-v2-trigger-wrapper"]:has([data-selected]) {
222
237
  background-color: var(--v2-background-bg-layer-03);
223
238
  color: var(--v2-text-text-base);