@opencode-ai/ui 0.0.0-dev-202608201855 → 0.0.0-dev-17751

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