@opencode-ai/ui 0.0.0-dev-202609040530 → 0.0.0-dev-19079

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. package/dist/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/context/marked-base.d.ts +3 -0
  9. package/dist/context/marked-parser.d.ts +1 -2
  10. package/dist/{components → data-display/accordion}/accordion.d.ts +6 -6
  11. package/dist/{v2/components/avatar-v2.d.ts → data-display/avatar/avatar.d.ts} +1 -1
  12. package/dist/data-display/badge/badge.d.ts +7 -0
  13. package/dist/{components → data-display/diff-changes}/diff-changes.d.ts +2 -1
  14. package/dist/data-display/keybind/keybind.d.ts +7 -0
  15. package/dist/{v2/components/line-comment-v2.d.ts → data-display/line-comment/line-comment.d.ts} +9 -9
  16. package/dist/{v2/components/project-avatar-v2.d.ts → data-display/project-avatar/project-avatar.d.ts} +1 -1
  17. package/dist/feedback/loader/loader.d.ts +3 -0
  18. package/dist/{components → feedback/progress-circle}/progress-circle.d.ts +2 -0
  19. package/dist/feedback/toast/toast.d.ts +57 -0
  20. package/dist/{components → forms/checkbox}/checkbox.d.ts +2 -2
  21. package/dist/{v2/components/field-v2.d.ts → forms/field/field.d.ts} +4 -10
  22. package/dist/forms/radio/radio.d.ts +16 -0
  23. package/dist/{v2/components/select-v2.d.ts → forms/select/select.d.ts} +4 -6
  24. package/dist/{components → forms/switch}/switch.d.ts +4 -2
  25. package/dist/{v2/components/text-input-v2.d.ts → forms/text-input/text-input.d.ts} +3 -3
  26. package/dist/forms/textarea/textarea.d.ts +7 -0
  27. package/dist/hooks/use-filtered-list.d.ts +9 -0
  28. package/dist/i18n/ar.d.ts +0 -2
  29. package/dist/i18n/bg.d.ts +0 -2
  30. package/dist/i18n/br.d.ts +0 -2
  31. package/dist/i18n/bs.d.ts +0 -2
  32. package/dist/i18n/da.d.ts +0 -2
  33. package/dist/i18n/de.d.ts +0 -2
  34. package/dist/i18n/en.d.ts +238 -1
  35. package/dist/i18n/es.d.ts +0 -2
  36. package/dist/i18n/fr.d.ts +0 -2
  37. package/dist/i18n/he.d.ts +197 -0
  38. package/dist/i18n/ja.d.ts +0 -2
  39. package/dist/i18n/km.d.ts +0 -2
  40. package/dist/i18n/ko.d.ts +0 -2
  41. package/dist/i18n/lo.d.ts +0 -2
  42. package/dist/i18n/mk.d.ts +0 -2
  43. package/dist/i18n/mn.d.ts +0 -2
  44. package/dist/i18n/my.d.ts +0 -2
  45. package/dist/i18n/pl.d.ts +0 -2
  46. package/dist/i18n/ru.d.ts +0 -2
  47. package/dist/i18n/sr.d.ts +0 -2
  48. package/dist/i18n/tg.d.ts +0 -2
  49. package/dist/i18n/th.d.ts +0 -2
  50. package/dist/i18n/tr.d.ts +0 -2
  51. package/dist/i18n/zh.d.ts +0 -2
  52. package/dist/i18n/zht.d.ts +0 -2
  53. package/dist/{components/icon.d.ts → icons/icon/additional-icons.d.ts} +8 -8
  54. package/dist/{v2/components → icons/icon}/icon.d.ts +44 -1
  55. package/dist/layout/divider/divider.d.ts +5 -0
  56. package/dist/navigation/menu/menu.d.ts +59 -0
  57. package/dist/{v2/components/segmented-control-v2.d.ts → navigation/segmented-control/segmented-control.d.ts} +5 -5
  58. package/dist/{components → navigation/tabs}/tabs.d.ts +15 -8
  59. package/dist/{v2/components/dialog-v2.d.ts → overlays/dialog/dialog.d.ts} +1 -2
  60. package/dist/overlays/tooltip/tooltip.d.ts +15 -0
  61. package/dist/{components → typography/text-shimmer}/text-shimmer.d.ts +1 -0
  62. package/dist/typography/wordmark/wordmark.d.ts +2 -0
  63. package/package.json +140 -34
  64. package/src/{v2/components/button-v2.css → actions/button/button.css} +29 -0
  65. package/src/{components → actions/button}/button.tsx +19 -11
  66. package/src/actions/icon-button/icon-button.tsx +32 -0
  67. package/src/{v2/components/split-button-v2.css → actions/split-button/split-button.css} +2 -6
  68. package/src/{v2/components/split-button-v2.tsx → actions/split-button/split-button.tsx} +4 -4
  69. package/src/components/animated-number.css +29 -11
  70. package/src/components/animated-number.tsx +2 -2
  71. package/src/components/card.css +2 -23
  72. package/src/components/card.tsx +4 -4
  73. package/src/components/collapsible.tsx +2 -2
  74. package/src/components/dock-surface.css +2 -9
  75. package/src/components/image-preview.tsx +3 -2
  76. package/src/components/list.css +5 -5
  77. package/src/components/list.tsx +7 -5
  78. package/src/components/popover.tsx +3 -2
  79. package/src/components/scroll-view.tsx +5 -20
  80. package/src/components/sticky-accordion-header.tsx +1 -1
  81. package/src/components/text-field.tsx +12 -4
  82. package/src/context/dialog.tsx +1 -0
  83. package/src/context/i18n.tsx +17 -14
  84. package/src/context/marked-base.tsx +27 -0
  85. package/src/context/marked-parser.tsx +3 -13
  86. package/src/{components → data-display/accordion}/accordion.css +5 -31
  87. package/src/{components → data-display/accordion}/accordion.tsx +14 -14
  88. package/src/{v2/components/avatar-v2.tsx → data-display/avatar/avatar.tsx} +1 -1
  89. package/src/{v2/components/badge-v2.css → data-display/badge/badge.css} +19 -0
  90. package/src/{v2/components/badge-v2.tsx → data-display/badge/badge.tsx} +6 -4
  91. package/src/{components → data-display/diff-changes}/diff-changes.css +22 -19
  92. package/src/{v2/components/diff-changes-v2.tsx → data-display/diff-changes/diff-changes.tsx} +7 -2
  93. package/src/{v2/components/keybind-v2.css → data-display/keybind/keybind.css} +1 -1
  94. package/src/{v2/components/keybind-v2.tsx → data-display/keybind/keybind.tsx} +3 -3
  95. package/src/{v2/components/line-comment-v2.css → data-display/line-comment/line-comment.css} +4 -4
  96. package/src/{v2/components/line-comment-v2.tsx → data-display/line-comment/line-comment.tsx} +17 -15
  97. package/src/{v2/components/project-avatar-v2.tsx → data-display/project-avatar/project-avatar.tsx} +1 -1
  98. package/src/{v2/components/loader-v2.tsx → feedback/loader/loader.tsx} +2 -2
  99. package/src/feedback/progress-circle/progress-circle.css +28 -0
  100. package/src/feedback/progress-circle/progress-circle.tsx +64 -0
  101. package/src/{v2/components/toast-v2.tsx → feedback/toast/toast.tsx} +60 -58
  102. package/src/{components → forms/checkbox}/checkbox.css +1 -7
  103. package/src/{components → forms/checkbox}/checkbox.tsx +13 -13
  104. package/src/{v2/components/field-v2.css → forms/field/field.css} +1 -1
  105. package/src/{v2/components/field-v2.tsx → forms/field/field.tsx} +9 -11
  106. package/src/{v2/components/radio-v2.tsx → forms/radio/radio.tsx} +30 -20
  107. package/src/{v2/components/select-v2.css → forms/select/select.css} +2 -8
  108. package/src/{v2/components/select-v2.tsx → forms/select/select.tsx} +40 -32
  109. package/src/{v2/components/switch-v2.css → forms/switch/switch.css} +110 -0
  110. package/src/forms/switch/switch.tsx +34 -0
  111. package/src/{v2/components/text-input-v2.css → forms/text-input/text-input.css} +3 -3
  112. package/src/{v2/components/text-input-v2.tsx → forms/text-input/text-input.tsx} +4 -4
  113. package/src/{v2/components/textarea-v2.tsx → forms/textarea/textarea.tsx} +3 -3
  114. package/src/hooks/create-auto-scroll.tsx +20 -0
  115. package/src/i18n/am.ts +7 -9
  116. package/src/i18n/ar.ts +7 -9
  117. package/src/i18n/az.ts +7 -9
  118. package/src/i18n/bg.ts +7 -9
  119. package/src/i18n/bn.ts +7 -9
  120. package/src/i18n/br.ts +7 -9
  121. package/src/i18n/bs.ts +7 -9
  122. package/src/i18n/ca.ts +7 -9
  123. package/src/i18n/cs.ts +7 -9
  124. package/src/i18n/da.ts +7 -9
  125. package/src/i18n/de.ts +1 -3
  126. package/src/i18n/dv.ts +7 -9
  127. package/src/i18n/dz.ts +5 -7
  128. package/src/i18n/el.ts +7 -9
  129. package/src/i18n/en.ts +54 -11
  130. package/src/i18n/es.ts +6 -8
  131. package/src/i18n/et.ts +7 -9
  132. package/src/i18n/fa.ts +7 -9
  133. package/src/i18n/fi.ts +7 -9
  134. package/src/i18n/fo.ts +7 -9
  135. package/src/i18n/fr.ts +6 -8
  136. package/src/i18n/he.ts +199 -0
  137. package/src/i18n/hi.ts +7 -9
  138. package/src/i18n/hr.ts +7 -9
  139. package/src/i18n/hu.ts +7 -9
  140. package/src/i18n/hy.ts +7 -9
  141. package/src/i18n/id.ts +7 -9
  142. package/src/i18n/is.ts +7 -9
  143. package/src/i18n/it.ts +7 -9
  144. package/src/i18n/ja.ts +7 -9
  145. package/src/i18n/ka.ts +7 -9
  146. package/src/i18n/km.ts +7 -9
  147. package/src/i18n/ko.ts +7 -9
  148. package/src/i18n/lo.ts +7 -9
  149. package/src/i18n/lt.ts +7 -9
  150. package/src/i18n/lv.ts +7 -9
  151. package/src/i18n/mk.ts +7 -9
  152. package/src/i18n/mn.ts +7 -9
  153. package/src/i18n/ms.ts +7 -9
  154. package/src/i18n/my.ts +7 -9
  155. package/src/i18n/ne.ts +7 -9
  156. package/src/i18n/nl.ts +7 -9
  157. package/src/i18n/no.ts +7 -9
  158. package/src/i18n/pa.ts +7 -9
  159. package/src/i18n/pl.ts +7 -9
  160. package/src/i18n/ro.ts +7 -9
  161. package/src/i18n/ru.ts +7 -9
  162. package/src/i18n/si.ts +7 -9
  163. package/src/i18n/sk.ts +7 -9
  164. package/src/i18n/sl.ts +7 -9
  165. package/src/i18n/sq.ts +7 -9
  166. package/src/i18n/sr.ts +7 -9
  167. package/src/i18n/sv.ts +7 -9
  168. package/src/i18n/tg.ts +7 -9
  169. package/src/i18n/th.ts +7 -9
  170. package/src/i18n/tk.ts +7 -9
  171. package/src/i18n/tr.ts +7 -9
  172. package/src/i18n/uk.ts +7 -9
  173. package/src/i18n/ur.ts +7 -9
  174. package/src/i18n/uz.ts +7 -9
  175. package/src/i18n/vi.ts +7 -9
  176. package/src/i18n/zh.ts +7 -9
  177. package/src/i18n/zht.ts +7 -9
  178. package/src/{components/icon.tsx → icons/icon/additional-icons.ts} +8 -74
  179. package/src/icons/icon/icon.css +3 -0
  180. package/src/{v2/components → icons/icon}/icon.tsx +80 -12
  181. package/src/{v2/components/divider-v2.tsx → layout/divider/divider.tsx} +3 -3
  182. package/src/{v2/components/menu-v2.css → navigation/menu/menu.css} +124 -2
  183. package/src/{v2/components/menu-v2.tsx → navigation/menu/menu.tsx} +96 -32
  184. package/src/{v2/components/segmented-control-v2.css → navigation/segmented-control/segmented-control.css} +1 -1
  185. package/src/{v2/components/segmented-control-v2.tsx → navigation/segmented-control/segmented-control.tsx} +9 -8
  186. package/src/{v2/components/tabs-v2.css → navigation/tabs/tabs-current.css} +25 -10
  187. package/src/{components → navigation/tabs}/tabs.css +53 -232
  188. package/src/navigation/tabs/tabs.tsx +194 -0
  189. package/src/{v2/components/dialog-v2.css → overlays/dialog/dialog.css} +3 -0
  190. package/src/{v2/components/dialog-v2.tsx → overlays/dialog/dialog.tsx} +11 -13
  191. package/src/{v2/components/tooltip-v2.css → overlays/tooltip/tooltip.css} +26 -0
  192. package/src/{v2/components/tooltip-v2.tsx → overlays/tooltip/tooltip.tsx} +24 -17
  193. package/src/styles/base.css +5 -0
  194. package/src/styles/index.css +4 -20
  195. package/src/styles/tailwind/colors.css +1 -0
  196. package/src/styles/tailwind/index.css +18 -1
  197. package/src/styles/theme.css +2 -2
  198. package/src/{v2/styles → styles/tokens}/colors.css +8 -8
  199. package/src/{v2/styles → styles/tokens}/theme.css +20 -16
  200. package/src/theme/context.tsx +19 -11
  201. package/src/theme/themes/oc-2.json +48 -19
  202. package/src/theme/v2/default-primitives.ts +8 -8
  203. package/src/theme/v2/foreground.ts +1 -0
  204. package/src/theme/v2/mapping.ts +5 -1
  205. package/src/{components → typography/text-shimmer}/text-shimmer.css +2 -1
  206. package/src/{components → typography/text-shimmer}/text-shimmer.tsx +1 -0
  207. package/src/{v2/components/wordmark-v2.tsx → typography/wordmark/wordmark.tsx} +2 -2
  208. package/dist/components/avatar.d.ts +0 -9
  209. package/dist/components/button.d.ts +0 -9
  210. package/dist/components/dialog.d.ts +0 -12
  211. package/dist/components/dropdown-menu.d.ts +0 -80
  212. package/dist/components/icon-button.d.ts +0 -10
  213. package/dist/components/keybind.d.ts +0 -6
  214. package/dist/components/radio-group.d.ts +0 -16
  215. package/dist/components/select.d.ts +0 -21
  216. package/dist/components/tag.d.ts +0 -5
  217. package/dist/components/toast.d.ts +0 -56
  218. package/dist/components/tooltip.d.ts +0 -17
  219. package/dist/v2/components/accordion-v2.d.ts +0 -26
  220. package/dist/v2/components/badge-v2.d.ts +0 -6
  221. package/dist/v2/components/button-v2.d.ts +0 -10
  222. package/dist/v2/components/checkbox-v2.d.ts +0 -10
  223. package/dist/v2/components/diff-changes-v2.d.ts +0 -11
  224. package/dist/v2/components/divider-v2.d.ts +0 -5
  225. package/dist/v2/components/icon-button-v2.d.ts +0 -11
  226. package/dist/v2/components/inline-input-v2.d.ts +0 -21
  227. package/dist/v2/components/keybind-v2.d.ts +0 -7
  228. package/dist/v2/components/loader-v2.d.ts +0 -3
  229. package/dist/v2/components/menu-v2.d.ts +0 -52
  230. package/dist/v2/components/progress-circle-v2.d.ts +0 -8
  231. package/dist/v2/components/radio-v2.d.ts +0 -16
  232. package/dist/v2/components/split-button-v2.d.ts +0 -5
  233. package/dist/v2/components/switch-v2.d.ts +0 -7
  234. package/dist/v2/components/tabs-v2.d.ts +0 -34
  235. package/dist/v2/components/text-shimmer-v2.d.ts +0 -9
  236. package/dist/v2/components/textarea-v2.d.ts +0 -7
  237. package/dist/v2/components/toast-v2.d.ts +0 -57
  238. package/dist/v2/components/tooltip-v2.d.ts +0 -13
  239. package/dist/v2/components/wordmark-v2.d.ts +0 -2
  240. package/src/components/avatar.css +0 -49
  241. package/src/components/avatar.tsx +0 -55
  242. package/src/components/button.css +0 -194
  243. package/src/components/dialog.css +0 -181
  244. package/src/components/dialog.tsx +0 -72
  245. package/src/components/diff-changes.tsx +0 -115
  246. package/src/components/dropdown-menu.css +0 -135
  247. package/src/components/dropdown-menu.tsx +0 -308
  248. package/src/components/icon-button.css +0 -181
  249. package/src/components/icon-button.tsx +0 -29
  250. package/src/components/icon.css +0 -39
  251. package/src/components/keybind.css +0 -18
  252. package/src/components/keybind.tsx +0 -20
  253. package/src/components/progress-circle.css +0 -16
  254. package/src/components/progress-circle.tsx +0 -64
  255. package/src/components/radio-group.css +0 -187
  256. package/src/components/radio-group.tsx +0 -83
  257. package/src/components/select.css +0 -201
  258. package/src/components/select.tsx +0 -174
  259. package/src/components/switch.css +0 -136
  260. package/src/components/switch.tsx +0 -29
  261. package/src/components/tabs.tsx +0 -126
  262. package/src/components/tag.css +0 -37
  263. package/src/components/tag.tsx +0 -22
  264. package/src/components/toast.css +0 -236
  265. package/src/components/toast.tsx +0 -185
  266. package/src/components/tooltip.css +0 -74
  267. package/src/components/tooltip.tsx +0 -163
  268. package/src/v2/components/accordion-v2.css +0 -139
  269. package/src/v2/components/accordion-v2.tsx +0 -86
  270. package/src/v2/components/button-v2.tsx +0 -35
  271. package/src/v2/components/checkbox-v2.css +0 -184
  272. package/src/v2/components/checkbox-v2.tsx +0 -65
  273. package/src/v2/components/diff-changes-v2.css +0 -26
  274. package/src/v2/components/icon-button-v2.tsx +0 -37
  275. package/src/v2/components/inline-input-v2.css +0 -225
  276. package/src/v2/components/inline-input-v2.tsx +0 -107
  277. package/src/v2/components/progress-circle-v2.css +0 -13
  278. package/src/v2/components/progress-circle-v2.tsx +0 -52
  279. package/src/v2/components/switch-v2.tsx +0 -28
  280. package/src/v2/components/tabs-v2.tsx +0 -149
  281. package/src/v2/components/text-shimmer-v2.css +0 -125
  282. package/src/v2/components/text-shimmer-v2.tsx +0 -63
  283. /package/dist/{components → forms/inline-input}/inline-input.d.ts +0 -0
  284. /package/dist/{v2/components → navigation}/tab-state-indicator.d.ts +0 -0
  285. /package/src/{v2/components/icon-button-v2.css → actions/icon-button/icon-button.css} +0 -0
  286. /package/src/{v2/components/avatar-v2.css → data-display/avatar/avatar.css} +0 -0
  287. /package/src/{v2/components/project-avatar-v2.css → data-display/project-avatar/project-avatar.css} +0 -0
  288. /package/src/{v2/components/loader-v2.css → feedback/loader/loader.css} +0 -0
  289. /package/src/{v2/components/toast-v2.css → feedback/toast/toast.css} +0 -0
  290. /package/src/{components → forms/inline-input}/inline-input.css +0 -0
  291. /package/src/{components → forms/inline-input}/inline-input.tsx +0 -0
  292. /package/src/{v2/components/radio-v2.css → forms/radio/radio.css} +0 -0
  293. /package/src/{v2/components/textarea-v2.css → forms/textarea/textarea.css} +0 -0
  294. /package/src/{v2/components/divider-v2.css → layout/divider/divider.css} +0 -0
  295. /package/src/{v2/components → navigation}/tab-state-indicator.tsx +0 -0
  296. /package/src/{v2/components/file-tree-v2.css → styles/file-tree.css} +0 -0
  297. /package/src/{v2/styles/tailwind.css → styles/tokens/index.css} +0 -0
@@ -1,52 +0,0 @@
1
- import { type ComponentProps, createMemo, splitProps } from "solid-js"
2
- import "./progress-circle-v2.css"
3
-
4
- export interface ProgressCircleV2Props extends Pick<ComponentProps<"svg">, "class" | "classList"> {
5
- percentage: number
6
- size?: number
7
- strokeWidth?: number
8
- }
9
-
10
- export function ProgressCircleV2(props: ProgressCircleV2Props) {
11
- const [split, rest] = splitProps(props, ["percentage", "size", "strokeWidth", "class", "classList"])
12
-
13
- const size = () => split.size ?? 14
14
- const strokeWidth = () => split.strokeWidth ?? 1.5
15
- const viewBoxSize = 14
16
- const center = viewBoxSize / 2
17
- const radius = () => center - strokeWidth() / 2
18
- const circumference = createMemo(() => 2 * Math.PI * radius())
19
- const offset = createMemo(() => circumference() * (1 - Math.max(0, Math.min(100, split.percentage || 0)) / 100))
20
-
21
- return (
22
- <svg
23
- {...rest}
24
- width={size()}
25
- height={size()}
26
- viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}
27
- fill="none"
28
- data-component="progress-circle-v2"
29
- classList={{
30
- ...split.classList,
31
- [split.class ?? ""]: !!split.class,
32
- }}
33
- >
34
- <circle
35
- cx={center}
36
- cy={center}
37
- r={radius()}
38
- data-slot="progress-circle-v2-background"
39
- stroke-width={strokeWidth()}
40
- />
41
- <circle
42
- cx={center}
43
- cy={center}
44
- r={radius()}
45
- data-slot="progress-circle-v2-progress"
46
- stroke-width={strokeWidth()}
47
- stroke-dasharray={circumference().toString()}
48
- stroke-dashoffset={offset()}
49
- />
50
- </svg>
51
- )
52
- }
@@ -1,28 +0,0 @@
1
- import { Switch as Kobalte } from "@kobalte/core/switch"
2
- import { Show, splitProps } from "solid-js"
3
- import type { ComponentProps, ParentProps } from "solid-js"
4
- import "./switch-v2.css"
5
-
6
- export interface SwitchProps extends ParentProps<ComponentProps<typeof Kobalte>> {
7
- hideLabel?: boolean
8
- }
9
-
10
- export function Switch(props: SwitchProps) {
11
- const [local, others] = splitProps(props, ["children", "class", "hideLabel"])
12
- return (
13
- <Kobalte {...others} class={local.class} data-component="switch">
14
- <Kobalte.Input data-slot="switch-input" />
15
- <Show when={local.children}>
16
- {(label) => (
17
- <Kobalte.Label data-slot="switch-label" classList={{ "sr-only": local.hideLabel }}>
18
- {label()}
19
- </Kobalte.Label>
20
- )}
21
- </Show>
22
- <Kobalte.Control data-slot="switch-control">
23
- <Kobalte.Thumb data-slot="switch-thumb" />
24
- </Kobalte.Control>
25
- <Kobalte.ErrorMessage data-slot="switch-error" />
26
- </Kobalte>
27
- )
28
- }
@@ -1,149 +0,0 @@
1
- import { Tabs as Kobalte } from "@kobalte/core/tabs"
2
- import { Show, splitProps, type JSX } from "solid-js"
3
- import type { ComponentProps, ParentProps, Component } from "solid-js"
4
- import { useI18n } from "../../context/i18n"
5
- import "./tabs-v2.css"
6
-
7
- export interface TabsV2Props extends ComponentProps<typeof Kobalte> {
8
- variant?: "normal" | "pill" | "settings"
9
- orientation?: "horizontal" | "vertical"
10
- }
11
- export interface TabsV2ListProps extends ComponentProps<typeof Kobalte.List> {}
12
- export interface TabsV2TriggerProps extends ComponentProps<typeof Kobalte.Trigger> {
13
- onMiddleClick?: () => void
14
- /** Optional subtext shown beside the primary content (muted style) */
15
- subtext?: JSX.Element | string
16
- }
17
- export interface TabsV2CloseButtonProps extends ComponentProps<"div"> {}
18
- export interface TabsV2ContentProps extends ComponentProps<typeof Kobalte.Content> {}
19
-
20
- function TabsV2Root(props: TabsV2Props) {
21
- const [split, rest] = splitProps(props, ["class", "classList", "variant", "orientation"])
22
- return (
23
- <Kobalte
24
- {...rest}
25
- orientation={split.orientation}
26
- data-component="tabs-v2"
27
- data-variant={split.variant || "normal"}
28
- data-orientation={split.orientation || "horizontal"}
29
- classList={{
30
- ...split.classList,
31
- [split.class ?? ""]: !!split.class,
32
- }}
33
- />
34
- )
35
- }
36
-
37
- function TabsV2List(props: TabsV2ListProps) {
38
- const [split, rest] = splitProps(props, ["class", "classList"])
39
- return (
40
- <Kobalte.List
41
- {...rest}
42
- data-slot="tabs-v2-list"
43
- classList={{
44
- ...split.classList,
45
- [split.class ?? ""]: !!split.class,
46
- }}
47
- />
48
- )
49
- }
50
-
51
- function TabsV2Trigger(props: ParentProps<TabsV2TriggerProps>) {
52
- const [split, rest] = splitProps(props, ["class", "classList", "children", "onMiddleClick", "subtext"])
53
- return (
54
- <div
55
- data-slot="tabs-v2-trigger-wrapper"
56
- data-value={props.value}
57
- classList={{
58
- ...split.classList,
59
- [split.class ?? ""]: !!split.class,
60
- }}
61
- onMouseDown={(e) => {
62
- if (e.button === 1 && split.onMiddleClick) {
63
- e.preventDefault()
64
- }
65
- }}
66
- onAuxClick={(e) => {
67
- if (e.button === 1 && split.onMiddleClick) {
68
- e.preventDefault()
69
- split.onMiddleClick()
70
- }
71
- }}
72
- >
73
- <Kobalte.Trigger {...rest} data-slot="tabs-v2-trigger" data-value={props.value}>
74
- <span class="inline-flex items-center gap-2" data-slot="tabs-v2-trigger-content">
75
- {split.children}
76
- <Show when={split.subtext}>
77
- {(subtext) => (
78
- <span data-slot="tabs-v2-subtext" class="ms-2 text-xs text-text-weak">
79
- {subtext()}
80
- </span>
81
- )}
82
- </Show>
83
- </span>
84
- </Kobalte.Trigger>
85
- </div>
86
- )
87
- }
88
-
89
- function TabsV2CloseButton(props: TabsV2CloseButtonProps) {
90
- const i18n = useI18n()
91
- const [split, rest] = splitProps(props, ["class", "classList", "onClick"])
92
- return (
93
- <div
94
- role="button"
95
- tabindex={0}
96
- aria-label={i18n.t("ui.tabs.close")}
97
- data-slot="tabs-v2-close-button"
98
- {...rest}
99
- classList={{
100
- [split.class ?? ""]: !!split.class,
101
- ...split.classList,
102
- }}
103
- onClick={(e) => {
104
- e.preventDefault()
105
- e.stopPropagation()
106
- if (typeof split.onClick === "function") {
107
- split.onClick(e)
108
- }
109
- }}
110
- onMouseDown={(e) => {
111
- e.preventDefault()
112
- e.stopPropagation()
113
- }}
114
- >
115
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
116
- <path d="M10.8889 3.11108L3.11108 10.8889" stroke="currentColor" stroke-linejoin="round" />
117
- <path d="M3.11108 3.11108L10.8889 10.8889" stroke="currentColor" stroke-linejoin="round" />
118
- </svg>
119
- </div>
120
- )
121
- }
122
-
123
- function TabsV2Content(props: ParentProps<TabsV2ContentProps>) {
124
- const [split, rest] = splitProps(props, ["class", "classList", "children"])
125
- return (
126
- <Kobalte.Content
127
- {...rest}
128
- data-slot="tabs-v2-content"
129
- classList={{
130
- ...split.classList,
131
- [split.class ?? ""]: !!split.class,
132
- }}
133
- >
134
- {split.children}
135
- </Kobalte.Content>
136
- )
137
- }
138
-
139
- const TabsV2SectionTitle: Component<ParentProps> = (props) => {
140
- return <div data-slot="tabs-v2-section-title">{props.children}</div>
141
- }
142
-
143
- export const TabsV2 = Object.assign(TabsV2Root, {
144
- List: TabsV2List,
145
- Trigger: TabsV2Trigger,
146
- CloseButton: TabsV2CloseButton,
147
- Content: TabsV2Content,
148
- SectionTitle: TabsV2SectionTitle,
149
- })
@@ -1,125 +0,0 @@
1
- * {
2
- -webkit-font-smoothing: antialiased;
3
- -moz-osx-font-smoothing: grayscale;
4
- text-rendering: geometricPrecision;
5
- }
6
-
7
- [data-component="text-shimmer-v2"] {
8
- --_step: 45ms;
9
- --_duration: 1200ms;
10
- --_swap: 220ms;
11
- --_index: 0;
12
- --_angle: 90deg;
13
- --_spread: 5.2ch;
14
- --_size: 360%;
15
- --_base-color: var(--v2-text-text-muted);
16
- --_peak-color: var(--v2-text-text-base);
17
- --_sweep: linear-gradient(
18
- var(--_angle),
19
- transparent calc(50% - var(--_spread)),
20
- var(--_peak-color) 50%,
21
- transparent calc(50% + var(--_spread))
22
- );
23
- --_base: linear-gradient(var(--_base-color), var(--_base-color));
24
-
25
- display: inline-flex;
26
- align-items: baseline;
27
- font: inherit;
28
- letter-spacing: inherit;
29
- line-height: inherit;
30
- user-select: none;
31
- }
32
-
33
- [data-component="text-shimmer-v2"] [data-slot="text-shimmer-v2-char"] {
34
- display: inline-grid;
35
- white-space: pre;
36
- font: inherit;
37
- letter-spacing: inherit;
38
- line-height: inherit;
39
- }
40
-
41
- [data-component="text-shimmer-v2"] [data-slot="text-shimmer-v2-base"],
42
- [data-component="text-shimmer-v2"] [data-slot="text-shimmer-v2-shimmer"] {
43
- grid-area: 1 / 1;
44
- white-space: pre;
45
- transition: opacity var(--_swap) ease-out;
46
- font: inherit;
47
- letter-spacing: inherit;
48
- line-height: inherit;
49
- }
50
-
51
- [data-component="text-shimmer-v2"] [data-slot="text-shimmer-v2-base"] {
52
- color: inherit;
53
- opacity: 1;
54
- }
55
-
56
- [data-component="text-shimmer-v2"] [data-slot="text-shimmer-v2-shimmer"] {
57
- color: var(--_base-color);
58
- opacity: 0;
59
- }
60
-
61
- [data-component="text-shimmer-v2"][data-active="true"] [data-slot="text-shimmer-v2-shimmer"] {
62
- opacity: 1;
63
- }
64
-
65
- [data-component="text-shimmer-v2"] [data-slot="text-shimmer-v2-shimmer"][data-run="true"] {
66
- animation-name: text-shimmer-v2-sweep;
67
- animation-duration: var(--_duration);
68
- animation-iteration-count: infinite;
69
- animation-timing-function: linear;
70
- animation-fill-mode: both;
71
- animation-delay: calc(var(--_step) * var(--_index) * -1);
72
- will-change: background-position;
73
- }
74
-
75
- @keyframes text-shimmer-v2-sweep {
76
- 0% {
77
- background-position:
78
- 100% 0,
79
- 0 0;
80
- }
81
- 100% {
82
- background-position:
83
- 0% 0,
84
- 0 0;
85
- }
86
- }
87
-
88
- @supports ((-webkit-background-clip: text) or (background-clip: text)) {
89
- [data-component="text-shimmer-v2"] [data-slot="text-shimmer-v2-shimmer"] {
90
- color: transparent;
91
- -webkit-text-fill-color: transparent;
92
- background-image: var(--_sweep), var(--_base);
93
- background-size:
94
- var(--_size) 100%,
95
- 100% 100%;
96
- background-position:
97
- 100% 0,
98
- 0 0;
99
- background-repeat: no-repeat;
100
- -webkit-background-clip: text;
101
- background-clip: text;
102
- }
103
-
104
- [data-component="text-shimmer-v2"][data-active="true"] [data-slot="text-shimmer-v2-base"] {
105
- opacity: 0;
106
- }
107
- }
108
-
109
- @media (prefers-reduced-motion: reduce) {
110
- [data-component="text-shimmer-v2"] [data-slot="text-shimmer-v2-base"],
111
- [data-component="text-shimmer-v2"] [data-slot="text-shimmer-v2-shimmer"] {
112
- transition-duration: 0ms;
113
- }
114
-
115
- [data-component="text-shimmer-v2"] [data-slot="text-shimmer-v2-shimmer"] {
116
- animation: none !important;
117
- color: inherit;
118
- -webkit-text-fill-color: currentColor;
119
- background-image: none;
120
- }
121
-
122
- [data-component="text-shimmer-v2"] [data-slot="text-shimmer-v2-base"] {
123
- opacity: 1 !important;
124
- }
125
- }
@@ -1,63 +0,0 @@
1
- import { createEffect, createMemo, createSignal, onCleanup, type ValidComponent } from "solid-js"
2
- import { Dynamic } from "solid-js/web"
3
- import "./text-shimmer-v2.css"
4
-
5
- export const TextShimmerV2 = <T extends ValidComponent = "span">(props: {
6
- text: string
7
- class?: string
8
- as?: T
9
- active?: boolean
10
- offset?: number
11
- }) => {
12
- const text = createMemo(() => props.text ?? "")
13
- const active = createMemo(() => props.active ?? true)
14
- const offset = createMemo(() => props.offset ?? 0)
15
- const [run, setRun] = createSignal(active())
16
- const swap = 220
17
- let timer: ReturnType<typeof setTimeout> | undefined
18
-
19
- createEffect(() => {
20
- if (timer) {
21
- clearTimeout(timer)
22
- timer = undefined
23
- }
24
-
25
- if (active()) {
26
- setRun(true)
27
- return
28
- }
29
-
30
- timer = setTimeout(() => {
31
- timer = undefined
32
- setRun(false)
33
- }, swap)
34
- })
35
-
36
- onCleanup(() => {
37
- if (!timer) return
38
- clearTimeout(timer)
39
- })
40
-
41
- return (
42
- <Dynamic
43
- component={props.as ?? "span"}
44
- data-component="text-shimmer-v2"
45
- data-active={active() ? "true" : "false"}
46
- class={props.class}
47
- aria-label={text()}
48
- style={{
49
- "--_swap": `${swap}ms`,
50
- "--_index": `${offset()}`,
51
- }}
52
- >
53
- <span data-slot="text-shimmer-v2-char">
54
- <span data-slot="text-shimmer-v2-base" aria-hidden="true">
55
- {text()}
56
- </span>
57
- <span data-slot="text-shimmer-v2-shimmer" data-run={run() ? "true" : "false"} aria-hidden="true">
58
- {text()}
59
- </span>
60
- </span>
61
- </Dynamic>
62
- )
63
- }