sparkdesign 0.4.6 → 0.4.8

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 (276) hide show
  1. package/AI_README.md +60 -0
  2. package/README.md +1 -1
  3. package/cli/dist/commands/add.js +1 -1
  4. package/cli/dist/commands/init.js +1 -1
  5. package/cli/registry/AGENTS.md +9 -2
  6. package/cli/registry/agent-manifest.json +794 -0
  7. package/cli/registry/basic/alert-dialog.tsx +3 -6
  8. package/cli/registry/basic/alert.tsx +76 -0
  9. package/cli/registry/basic/aspect-ratio.tsx +8 -0
  10. package/cli/registry/basic/breadcrumb.tsx +117 -0
  11. package/cli/registry/basic/button-group.tsx +79 -0
  12. package/cli/registry/basic/button.tsx +19 -6
  13. package/cli/registry/basic/calendar.tsx +221 -0
  14. package/cli/registry/basic/card.tsx +115 -0
  15. package/cli/registry/basic/carousel.tsx +241 -0
  16. package/cli/registry/basic/chart.tsx +372 -0
  17. package/cli/registry/basic/checkbox.tsx +42 -0
  18. package/cli/registry/basic/collapsible-card.tsx +4 -6
  19. package/cli/registry/basic/combobox.tsx +133 -0
  20. package/cli/registry/basic/command.tsx +184 -0
  21. package/cli/registry/basic/context-menu.tsx +238 -0
  22. package/cli/registry/basic/data-table.tsx +73 -0
  23. package/cli/registry/basic/date-picker.tsx +84 -0
  24. package/cli/registry/basic/dialog.tsx +164 -0
  25. package/cli/registry/basic/direction.tsx +25 -0
  26. package/cli/registry/basic/drawer.tsx +162 -0
  27. package/cli/registry/basic/dropdown-menu.tsx +2 -7
  28. package/cli/registry/basic/empty.tsx +104 -0
  29. package/cli/registry/basic/field.tsx +248 -0
  30. package/cli/registry/basic/hover-card.tsx +57 -0
  31. package/cli/registry/basic/icon-button.tsx +18 -11
  32. package/cli/registry/basic/input-group.tsx +168 -0
  33. package/cli/registry/basic/input-otp.tsx +75 -0
  34. package/cli/registry/basic/input.tsx +43 -0
  35. package/cli/registry/basic/item.tsx +204 -0
  36. package/cli/registry/basic/label.tsx +24 -0
  37. package/cli/registry/basic/menubar.tsx +274 -0
  38. package/cli/registry/basic/native-select.tsx +62 -0
  39. package/cli/registry/basic/navigation-menu.tsx +168 -0
  40. package/cli/registry/basic/popover.tsx +58 -0
  41. package/cli/registry/basic/scroll-area.tsx +58 -0
  42. package/cli/registry/basic/select.tsx +24 -3
  43. package/cli/registry/basic/separator.tsx +26 -0
  44. package/cli/registry/basic/sheet.tsx +18 -0
  45. package/cli/registry/basic/spinner.tsx +20 -5
  46. package/cli/registry/basic/textarea.tsx +43 -0
  47. package/cli/registry/basic/toggle.tsx +1 -1
  48. package/cli/registry/basic/tooltip.tsx +2 -1
  49. package/cli/registry/basic/typography.tsx +1 -1
  50. package/cli/registry/chat/chat-input/chat-input-textarea.tsx +1 -1
  51. package/cli/registry/chat/chat-input/compound.tsx +4 -3
  52. package/cli/registry/chat/chat-input/context.tsx +4 -1
  53. package/cli/registry/chat/code-block-part.tsx +1 -1
  54. package/cli/registry/chat/conversation-anchor-nav.tsx +349 -0
  55. package/cli/registry/chat/file-attachment.tsx +2 -1
  56. package/cli/registry/chat/file-review-part.tsx +21 -21
  57. package/cli/registry/chat/markdown.tsx +2 -2
  58. package/cli/registry/chat/queue-indicator.tsx +1 -0
  59. package/cli/registry/chat/streaming-markdown-block.tsx +12 -8
  60. package/cli/registry/chat/tool-invocation-card.tsx +4 -1
  61. package/cli/registry/lib/file-icon-maps.ts +22 -22
  62. package/cli/registry/meta.json +600 -15
  63. package/cli/registry/tokens/ontology.json +404 -0
  64. package/cli/registry/tokens/scale/presets/compact.css +16 -5
  65. package/cli/registry/tokens/scale/presets/dense.css +13 -2
  66. package/cli/registry/tokens/scale/presets/sharp.css +18 -6
  67. package/cli/registry/tokens/scale/presets/soft.css +23 -1
  68. package/dist/registry/basic/alert-dialog.d.ts +1 -1
  69. package/dist/registry/basic/alert.d.ts +24 -0
  70. package/dist/registry/basic/aspect-ratio.d.ts +16 -0
  71. package/dist/registry/basic/avatar.d.ts +1 -1
  72. package/dist/registry/basic/breadcrumb.d.ts +24 -0
  73. package/dist/registry/basic/button-group.d.ts +26 -0
  74. package/dist/registry/basic/button.d.ts +3 -1
  75. package/dist/registry/basic/calendar.d.ts +22 -0
  76. package/dist/registry/basic/card.d.ts +32 -0
  77. package/dist/registry/basic/carousel.d.ts +19 -0
  78. package/dist/registry/basic/chart.d.ts +55 -0
  79. package/dist/registry/basic/checkbox.d.ts +21 -0
  80. package/dist/registry/basic/combobox.d.ts +37 -0
  81. package/dist/registry/basic/command.d.ts +18 -0
  82. package/dist/registry/basic/context-menu.d.ts +44 -0
  83. package/dist/registry/basic/data-table.d.ts +26 -0
  84. package/dist/registry/basic/date-picker.d.ts +27 -0
  85. package/dist/registry/basic/dialog.d.ts +39 -0
  86. package/dist/registry/basic/direction.d.ts +19 -0
  87. package/dist/registry/basic/drawer.d.ts +37 -0
  88. package/dist/registry/basic/empty.d.ts +22 -0
  89. package/dist/registry/basic/field.d.ts +24 -0
  90. package/dist/registry/basic/hover-card.d.ts +22 -0
  91. package/dist/registry/basic/icon-button.d.ts +2 -1
  92. package/dist/registry/basic/input-group.d.ts +29 -0
  93. package/dist/registry/basic/input-otp.d.ts +22 -0
  94. package/dist/registry/basic/input.d.ts +20 -0
  95. package/dist/registry/basic/item.d.ts +34 -0
  96. package/dist/registry/basic/label.d.ts +16 -0
  97. package/dist/registry/basic/menubar.d.ts +37 -0
  98. package/dist/registry/basic/native-select.d.ts +18 -0
  99. package/dist/registry/basic/navigation-menu.d.ts +25 -0
  100. package/dist/registry/basic/popover.d.ts +23 -0
  101. package/dist/registry/basic/resizable.d.ts +48 -48
  102. package/dist/registry/basic/scroll-area.d.ts +5 -0
  103. package/dist/registry/basic/select.d.ts +7 -2
  104. package/dist/registry/basic/separator.d.ts +16 -0
  105. package/dist/registry/basic/sheet.d.ts +13 -0
  106. package/dist/registry/basic/spinner.d.ts +6 -2
  107. package/dist/registry/basic/tag.d.ts +1 -1
  108. package/dist/registry/basic/textarea.d.ts +21 -0
  109. package/dist/registry/chat/chat-input/context.d.ts +3 -1
  110. package/dist/registry/chat/conversation-anchor-nav.d.ts +72 -0
  111. package/dist/registry/chat/tool-invocation-card.d.ts +2 -0
  112. package/dist/scale/computed.css +11 -0
  113. package/dist/scale/config.css +11 -0
  114. package/dist/scale/presets/compact.css +23 -5
  115. package/dist/scale/presets/dense.css +20 -2
  116. package/dist/scale/presets/sharp.css +25 -6
  117. package/dist/scale/presets/soft.css +30 -1
  118. package/dist/spark-design.cjs.js +37 -33
  119. package/dist/spark-design.es.js +10324 -8950
  120. package/dist/sparkdesign.css +1 -1
  121. package/dist/src/components/basic/Alert/index.d.ts +13 -0
  122. package/dist/src/components/basic/AspectRatio/index.d.ts +13 -0
  123. package/dist/src/components/basic/Breadcrumb/index.d.ts +12 -0
  124. package/dist/src/components/basic/ButtonGroup/index.d.ts +13 -0
  125. package/dist/src/components/basic/Calendar/index.d.ts +13 -0
  126. package/dist/src/components/basic/Card/index.d.ts +13 -0
  127. package/dist/src/components/basic/Carousel/index.d.ts +12 -0
  128. package/dist/src/components/basic/Chart/index.d.ts +13 -0
  129. package/dist/src/components/basic/Checkbox/index.d.ts +13 -0
  130. package/dist/src/components/basic/Combobox/index.d.ts +13 -0
  131. package/dist/src/components/basic/Command/index.d.ts +12 -0
  132. package/dist/src/components/basic/ContextMenu/index.d.ts +19 -0
  133. package/dist/src/components/basic/DataTable/index.d.ts +13 -0
  134. package/dist/src/components/basic/DatePicker/index.d.ts +13 -0
  135. package/dist/src/components/basic/Dialog/index.d.ts +16 -0
  136. package/dist/src/components/basic/Direction/index.d.ts +13 -0
  137. package/dist/src/components/basic/Drawer/index.d.ts +16 -0
  138. package/dist/src/components/basic/Empty/index.d.ts +12 -0
  139. package/dist/src/components/basic/Field/index.d.ts +12 -0
  140. package/dist/src/components/basic/HoverCard/index.d.ts +16 -0
  141. package/dist/src/components/basic/Input/index.d.ts +13 -0
  142. package/dist/src/components/basic/InputGroup/index.d.ts +12 -0
  143. package/dist/src/components/basic/InputOTP/index.d.ts +12 -0
  144. package/dist/src/components/basic/Item/index.d.ts +12 -0
  145. package/dist/src/components/basic/Label/index.d.ts +13 -0
  146. package/dist/src/components/basic/Menubar/index.d.ts +12 -0
  147. package/dist/src/components/basic/NativeSelect/index.d.ts +12 -0
  148. package/dist/src/components/basic/NavigationMenu/index.d.ts +12 -0
  149. package/dist/src/components/basic/Popover/index.d.ts +16 -0
  150. package/dist/src/components/basic/ScrollArea/index.d.ts +12 -0
  151. package/dist/src/components/basic/Separator/index.d.ts +13 -0
  152. package/dist/src/components/basic/Sheet/index.d.ts +13 -0
  153. package/dist/src/components/basic/Textarea/index.d.ts +13 -0
  154. package/dist/src/components/chat/ConversationAnchorNav/index.d.ts +13 -0
  155. package/dist/src/components/chat/StreamingMarkdownBlock/index.d.ts +13 -0
  156. package/dist/src/components/index.d.ts +58 -1
  157. package/dist/src/lib/index.d.ts +1 -1
  158. package/dist/src/lib/motion.d.ts +79 -0
  159. package/dist/theme-base.css +22 -0
  160. package/dist/themes/dark-mint.css +6 -0
  161. package/dist/themes/dark-parchment.css +6 -0
  162. package/dist/themes/light-parchment.css +6 -0
  163. package/dist/tokens/AGENTS.md +1 -0
  164. package/dist/tokens/scale/computed.css +11 -0
  165. package/dist/tokens/scale/config.css +11 -0
  166. package/dist/tokens/scale/presets/compact.css +23 -5
  167. package/dist/tokens/scale/presets/dense.css +20 -2
  168. package/dist/tokens/scale/presets/sharp.css +25 -6
  169. package/dist/tokens/scale/presets/soft.css +30 -1
  170. package/dist/tokens/theme-base.css +22 -0
  171. package/dist/tokens/themes/dark-mint.css +6 -0
  172. package/dist/tokens/themes/dark-parchment.css +6 -0
  173. package/dist/tokens/themes/light-parchment.css +6 -0
  174. package/docs/agent/component-selection.md +60 -0
  175. package/docs/agent/token-ontology.md +37 -0
  176. package/package.json +31 -5
  177. package/registry/agent-manifest.json +794 -0
  178. package/registry/tokens/ontology.json +404 -0
  179. package/dist/_basePickBy-DnQN8w3y.js +0 -151
  180. package/dist/_basePickBy-a-kPMlkg.cjs +0 -1
  181. package/dist/_baseUniq-B-N2NQ50.js +0 -614
  182. package/dist/_baseUniq-Cc_zbSif.cjs +0 -1
  183. package/dist/arc-BQBhijZ6.js +0 -83
  184. package/dist/arc-mWQt0Yph.cjs +0 -1
  185. package/dist/architectureDiagram-VXUJARFQ-BMZEucno.cjs +0 -36
  186. package/dist/architectureDiagram-VXUJARFQ-DTdjD3Bp.js +0 -4661
  187. package/dist/blockDiagram-VD42YOAC-CzHn0yob.js +0 -2256
  188. package/dist/blockDiagram-VD42YOAC-DDxdHAlz.cjs +0 -122
  189. package/dist/c4Diagram-YG6GDRKO-4Gz0I4gj.cjs +0 -10
  190. package/dist/c4Diagram-YG6GDRKO-BIy--yVN.js +0 -1580
  191. package/dist/channel-BQn0o8bs.js +0 -5
  192. package/dist/channel-DaN7XniJ.cjs +0 -1
  193. package/dist/chunk-4BX2VUAB-BlQFTQqz.cjs +0 -1
  194. package/dist/chunk-4BX2VUAB-Czitj3Kc.js +0 -8
  195. package/dist/chunk-55IACEB6-DXacNZbO.js +0 -8
  196. package/dist/chunk-55IACEB6-DnDxpye9.cjs +0 -1
  197. package/dist/chunk-B4BG7PRW-CBdN0q_V.js +0 -1375
  198. package/dist/chunk-B4BG7PRW-DbGvUkGO.cjs +0 -165
  199. package/dist/chunk-DI55MBZ5-D1YJMs6x.cjs +0 -220
  200. package/dist/chunk-DI55MBZ5-NCQTvayw.js +0 -1370
  201. package/dist/chunk-FMBD7UC4-CsGMbrtr.js +0 -19
  202. package/dist/chunk-FMBD7UC4-Di7cUUh5.cjs +0 -15
  203. package/dist/chunk-QN33PNHL-0j5LC8Lm.cjs +0 -1
  204. package/dist/chunk-QN33PNHL-3GERZBRm.js +0 -19
  205. package/dist/chunk-QZHKN3VN-AVEY9ImQ.js +0 -15
  206. package/dist/chunk-QZHKN3VN-s8Z0a8mc.cjs +0 -1
  207. package/dist/chunk-TZMSLE5B-CAf87HPt.cjs +0 -1
  208. package/dist/chunk-TZMSLE5B-sbiflal0.js +0 -64
  209. package/dist/classDiagram-2ON5EDUG-Ct9JLIN2.cjs +0 -1
  210. package/dist/classDiagram-2ON5EDUG-Dzfrft3a.js +0 -16
  211. package/dist/classDiagram-v2-WZHVMYZB-Ct9JLIN2.cjs +0 -1
  212. package/dist/classDiagram-v2-WZHVMYZB-Dzfrft3a.js +0 -16
  213. package/dist/clone-Cde_NQ8V.js +0 -8
  214. package/dist/clone-DCNjWuM2.cjs +0 -1
  215. package/dist/cose-bilkent-S5V4N54A-0uLijMro.cjs +0 -1
  216. package/dist/cose-bilkent-S5V4N54A-Bb08N431.js +0 -2608
  217. package/dist/cytoscape.esm-CNUX3VTg.cjs +0 -321
  218. package/dist/cytoscape.esm-Cvf3sx9F.js +0 -18704
  219. package/dist/dagre-6UL2VRFP-CY_Wz5Zd.js +0 -444
  220. package/dist/dagre-6UL2VRFP-Dxe7_qZc.cjs +0 -4
  221. package/dist/defaultLocale-BgPVtth8.js +0 -171
  222. package/dist/defaultLocale-C4wbwF1n.cjs +0 -1
  223. package/dist/diagram-PSM6KHXK-D2bdb7MT.js +0 -531
  224. package/dist/diagram-PSM6KHXK-YF69SUjY.cjs +0 -24
  225. package/dist/diagram-QEK2KX5R-BpUSoh0-.js +0 -217
  226. package/dist/diagram-QEK2KX5R-DZPGteon.cjs +0 -43
  227. package/dist/diagram-S2PKOQOG-ht-zdvFG.cjs +0 -24
  228. package/dist/diagram-S2PKOQOG-zFeLJ50Z.js +0 -142
  229. package/dist/erDiagram-Q2GNP2WA-B38iJ6ts.js +0 -841
  230. package/dist/erDiagram-Q2GNP2WA-RgS80DDU.cjs +0 -60
  231. package/dist/flowDiagram-NV44I4VS-BHilOs2p.cjs +0 -162
  232. package/dist/flowDiagram-NV44I4VS-BrBJcoce.js +0 -1620
  233. package/dist/ganttDiagram-JELNMOA3-pZiJeFio.cjs +0 -267
  234. package/dist/ganttDiagram-JELNMOA3-tw6FhkWJ.js +0 -2670
  235. package/dist/gitGraphDiagram-V2S2FVAM-BWn5uIK5.js +0 -699
  236. package/dist/gitGraphDiagram-V2S2FVAM-DKKeG-9R.cjs +0 -65
  237. package/dist/graph-DIbblrZP.cjs +0 -1
  238. package/dist/graph-DPcK91G3.js +0 -247
  239. package/dist/infoDiagram-HS3SLOUP-B8gwwhct.cjs +0 -2
  240. package/dist/infoDiagram-HS3SLOUP-D47PNcP_.js +0 -24
  241. package/dist/init-CHZsXQcr.cjs +0 -1
  242. package/dist/init-DjUOC4st.js +0 -16
  243. package/dist/journeyDiagram-XKPGCS4Q-BG3cfhyU.js +0 -834
  244. package/dist/journeyDiagram-XKPGCS4Q-D8DVLJof.cjs +0 -139
  245. package/dist/kanban-definition-3W4ZIXB7-4OCnEouP.cjs +0 -89
  246. package/dist/kanban-definition-3W4ZIXB7-CWi_ssF9.js +0 -719
  247. package/dist/layout-Byuh8f-J.cjs +0 -1
  248. package/dist/layout-CdLdvj1j.js +0 -1335
  249. package/dist/linear-C2Q_PI9B.js +0 -259
  250. package/dist/linear-C69aPBW1.cjs +0 -1
  251. package/dist/mermaid.core-DBwAx_jp.cjs +0 -249
  252. package/dist/mermaid.core-gFR0XUlD.js +0 -15300
  253. package/dist/mindmap-definition-VGOIOE7T-8P7obVV4.cjs +0 -68
  254. package/dist/mindmap-definition-VGOIOE7T-DnOa7WJ9.js +0 -784
  255. package/dist/ordinal-B6-f3MAq.js +0 -61
  256. package/dist/ordinal-CagbB1m8.cjs +0 -1
  257. package/dist/pieDiagram-ADFJNKIX-5NAlvhMo.js +0 -161
  258. package/dist/pieDiagram-ADFJNKIX-CQBG4yR9.cjs +0 -30
  259. package/dist/quadrantDiagram-AYHSOK5B-Oe4y7RZ0.cjs +0 -7
  260. package/dist/quadrantDiagram-AYHSOK5B-rh2DPEP1.js +0 -1022
  261. package/dist/requirementDiagram-UZGBJVZJ-DcWaCuXr.js +0 -850
  262. package/dist/requirementDiagram-UZGBJVZJ-gfdlrFiq.cjs +0 -64
  263. package/dist/sankeyDiagram-TZEHDZUN-CQIKFwD0.js +0 -810
  264. package/dist/sankeyDiagram-TZEHDZUN-DvPtzQvC.cjs +0 -10
  265. package/dist/sequenceDiagram-WL72ISMW-BNrsMagL.cjs +0 -145
  266. package/dist/sequenceDiagram-WL72ISMW-iCX3ckKx.js +0 -2511
  267. package/dist/stateDiagram-FKZM4ZOC-DBvJ_eeL.cjs +0 -1
  268. package/dist/stateDiagram-FKZM4ZOC-ZVsJlaHJ.js +0 -263
  269. package/dist/stateDiagram-v2-4FDKWEC3-CB_nTHcE.js +0 -16
  270. package/dist/stateDiagram-v2-4FDKWEC3-Xkx17v6T.cjs +0 -1
  271. package/dist/timeline-definition-IT6M3QCI-BmGkYQiz.cjs +0 -61
  272. package/dist/timeline-definition-IT6M3QCI-Ck8zTt6w.js +0 -795
  273. package/dist/treemap-GDKQZRPO-B9sfERx8.js +0 -17922
  274. package/dist/treemap-GDKQZRPO-BVfJRs0Z.cjs +0 -160
  275. package/dist/xychartDiagram-PRI3JC2R-By_S8NzN.js +0 -1340
  276. package/dist/xychartDiagram-PRI3JC2R-CNfDrGxM.cjs +0 -7
@@ -0,0 +1,168 @@
1
+ import * as React from "react"
2
+ import { cva } from "class-variance-authority"
3
+ import { ChevronDownIcon } from "lucide-react"
4
+ import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function NavigationMenu({
9
+ className,
10
+ children,
11
+ viewport = true,
12
+ ...props
13
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
14
+ viewport?: boolean
15
+ }) {
16
+ return (
17
+ <NavigationMenuPrimitive.Root
18
+ data-slot="navigation-menu"
19
+ data-viewport={viewport}
20
+ className={cn(
21
+ "group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
22
+ className
23
+ )}
24
+ {...props}
25
+ >
26
+ {children}
27
+ {viewport && <NavigationMenuViewport />}
28
+ </NavigationMenuPrimitive.Root>
29
+ )
30
+ }
31
+
32
+ function NavigationMenuList({
33
+ className,
34
+ ...props
35
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
36
+ return (
37
+ <NavigationMenuPrimitive.List
38
+ data-slot="navigation-menu-list"
39
+ className={cn(
40
+ "group flex flex-1 list-none items-center justify-center gap-1",
41
+ className
42
+ )}
43
+ {...props}
44
+ />
45
+ )
46
+ }
47
+
48
+ function NavigationMenuItem({
49
+ className,
50
+ ...props
51
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
52
+ return (
53
+ <NavigationMenuPrimitive.Item
54
+ data-slot="navigation-menu-item"
55
+ className={cn("relative", className)}
56
+ {...props}
57
+ />
58
+ )
59
+ }
60
+
61
+ const navigationMenuTriggerStyle = cva(
62
+ "group inline-flex h-9 w-max items-center justify-center rounded-md bg-bg-base px-4 py-2 text-sm font-medium transition-[color,box-shadow] outline-none hover:bg-fill-secondary hover:text-text focus:bg-fill-secondary focus:text-text focus-visible:ring-[3px] focus-visible:ring-primary-border/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-fill-secondary/50 data-[state=open]:text-text data-[state=open]:hover:bg-fill-secondary data-[state=open]:focus:bg-fill-secondary"
63
+ )
64
+
65
+ function NavigationMenuTrigger({
66
+ className,
67
+ children,
68
+ ...props
69
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
70
+ return (
71
+ <NavigationMenuPrimitive.Trigger
72
+ data-slot="navigation-menu-trigger"
73
+ className={cn(navigationMenuTriggerStyle(), "group", className)}
74
+ {...props}
75
+ >
76
+ {children}{" "}
77
+ <ChevronDownIcon
78
+ className="relative top-px ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
79
+ aria-hidden="true"
80
+ />
81
+ </NavigationMenuPrimitive.Trigger>
82
+ )
83
+ }
84
+
85
+ function NavigationMenuContent({
86
+ className,
87
+ ...props
88
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
89
+ return (
90
+ <NavigationMenuPrimitive.Content
91
+ data-slot="navigation-menu-content"
92
+ className={cn(
93
+ "top-0 left-0 w-full p-2 pr-2.5 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out md:absolute md:w-auto",
94
+ "group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:bg-bg-container group-data-[viewport=false]/navigation-menu:text-text group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95",
95
+ className
96
+ )}
97
+ {...props}
98
+ />
99
+ )
100
+ }
101
+
102
+ function NavigationMenuViewport({
103
+ className,
104
+ ...props
105
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
106
+ return (
107
+ <div
108
+ className={cn(
109
+ "absolute top-full left-0 isolate z-50 flex justify-center"
110
+ )}
111
+ >
112
+ <NavigationMenuPrimitive.Viewport
113
+ data-slot="navigation-menu-viewport"
114
+ className={cn(
115
+ "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-bg-container text-text shadow data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
116
+ className
117
+ )}
118
+ {...props}
119
+ />
120
+ </div>
121
+ )
122
+ }
123
+
124
+ function NavigationMenuLink({
125
+ className,
126
+ ...props
127
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
128
+ return (
129
+ <NavigationMenuPrimitive.Link
130
+ data-slot="navigation-menu-link"
131
+ className={cn(
132
+ "flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none hover:bg-fill-secondary hover:text-text focus:bg-fill-secondary focus:text-text focus-visible:ring-[3px] focus-visible:ring-primary-border/50 focus-visible:outline-1 data-[active=true]:bg-fill-secondary/50 data-[active=true]:text-text data-[active=true]:hover:bg-fill-secondary data-[active=true]:focus:bg-fill-secondary [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-text-tertiary",
133
+ className
134
+ )}
135
+ {...props}
136
+ />
137
+ )
138
+ }
139
+
140
+ function NavigationMenuIndicator({
141
+ className,
142
+ ...props
143
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
144
+ return (
145
+ <NavigationMenuPrimitive.Indicator
146
+ data-slot="navigation-menu-indicator"
147
+ className={cn(
148
+ "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in",
149
+ className
150
+ )}
151
+ {...props}
152
+ >
153
+ <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
154
+ </NavigationMenuPrimitive.Indicator>
155
+ )
156
+ }
157
+
158
+ export {
159
+ NavigationMenu,
160
+ NavigationMenuList,
161
+ NavigationMenuItem,
162
+ NavigationMenuContent,
163
+ NavigationMenuTrigger,
164
+ NavigationMenuLink,
165
+ NavigationMenuIndicator,
166
+ NavigationMenuViewport,
167
+ navigationMenuTriggerStyle,
168
+ }
@@ -0,0 +1,58 @@
1
+ import * as React from 'react'
2
+ import { motion } from 'framer-motion'
3
+ import * as PopoverPrimitive from '@radix-ui/react-popover'
4
+ import { cn } from '@/lib/utils'
5
+ import { MOTION_SCALE_IN } from '@/lib/motion'
6
+ import { getThemeFromDocument } from './theme-from-document'
7
+
8
+ const Popover = PopoverPrimitive.Root
9
+ const PopoverTrigger = PopoverPrimitive.Trigger
10
+ const PopoverAnchor = PopoverPrimitive.Anchor
11
+
12
+ export interface PopoverContentProps
13
+ extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {
14
+ /** When provided (e.g. from ThemeStyleProvider), used for portal wrapper */
15
+ dataStyle?: string
16
+ dataTheme?: string
17
+ }
18
+
19
+ const PopoverContent = React.forwardRef<
20
+ React.ElementRef<typeof PopoverPrimitive.Content>,
21
+ PopoverContentProps
22
+ >(
23
+ (
24
+ { className, align = 'center', sideOffset = 4, children, dataStyle, dataTheme, ...props },
25
+ ref,
26
+ ) => {
27
+ const fromDoc = getThemeFromDocument()
28
+ const dataProps =
29
+ dataStyle !== undefined
30
+ ? { 'data-style': dataStyle, 'data-theme': dataTheme ?? fromDoc['data-theme'] ?? '' }
31
+ : fromDoc
32
+ return (
33
+ <PopoverPrimitive.Portal>
34
+ <div style={{ display: 'contents' }} {...dataProps}>
35
+ <PopoverPrimitive.Content
36
+ ref={ref}
37
+ align={align}
38
+ sideOffset={sideOffset}
39
+ className={cn(
40
+ 'z-50 w-72 rounded-lg border border-border-tertiary bg-bg-container p-4 text-sm text-text shadow-md outline-none',
41
+ className,
42
+ )}
43
+ {...props}
44
+ >
45
+ <motion.div
46
+ {...MOTION_SCALE_IN}
47
+ >
48
+ {children}
49
+ </motion.div>
50
+ </PopoverPrimitive.Content>
51
+ </div>
52
+ </PopoverPrimitive.Portal>
53
+ )
54
+ },
55
+ )
56
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName
57
+
58
+ export { Popover, PopoverTrigger, PopoverAnchor, PopoverContent }
@@ -0,0 +1,58 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { ScrollArea as ScrollAreaPrimitive } from "radix-ui"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function ScrollArea({
9
+ className,
10
+ children,
11
+ ...props
12
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
13
+ return (
14
+ <ScrollAreaPrimitive.Root
15
+ data-slot="scroll-area"
16
+ className={cn("relative", className)}
17
+ {...props}
18
+ >
19
+ <ScrollAreaPrimitive.Viewport
20
+ data-slot="scroll-area-viewport"
21
+ className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-primary-border/50 focus-visible:outline-1"
22
+ >
23
+ {children}
24
+ </ScrollAreaPrimitive.Viewport>
25
+ <ScrollBar />
26
+ <ScrollAreaPrimitive.Corner />
27
+ </ScrollAreaPrimitive.Root>
28
+ )
29
+ }
30
+
31
+ function ScrollBar({
32
+ className,
33
+ orientation = "vertical",
34
+ ...props
35
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
36
+ return (
37
+ <ScrollAreaPrimitive.ScrollAreaScrollbar
38
+ data-slot="scroll-area-scrollbar"
39
+ orientation={orientation}
40
+ className={cn(
41
+ "flex touch-none p-px transition-colors select-none",
42
+ orientation === "vertical" &&
43
+ "h-full w-2.5 border-l border-l-transparent",
44
+ orientation === "horizontal" &&
45
+ "h-2.5 flex-col border-t border-t-transparent",
46
+ className
47
+ )}
48
+ {...props}
49
+ >
50
+ <ScrollAreaPrimitive.ScrollAreaThumb
51
+ data-slot="scroll-area-thumb"
52
+ className="relative flex-1 rounded-full bg-border"
53
+ />
54
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>
55
+ )
56
+ }
57
+
58
+ export { ScrollArea, ScrollBar }
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react'
2
2
  import * as SelectPrimitive from '@radix-ui/react-select'
3
+ import { cva, type VariantProps } from 'class-variance-authority'
3
4
  import { cn } from '@/lib/utils'
4
5
  import { ArrowDownSLine, ArrowUpLine, CheckLine } from './icons-inline'
5
6
  import { getThemeFromDocument } from './theme-from-document'
@@ -12,20 +13,39 @@ const Select = SelectPrimitive.Root
12
13
  const SelectGroup = SelectPrimitive.Group
13
14
  const SelectValue = SelectPrimitive.Value
14
15
 
16
+ const selectTriggerVariants = cva(
17
+ [
18
+ 'flex w-full items-center justify-between gap-2 whitespace-nowrap rounded-lg border border-border-tertiary bg-bg-container text-text placeholder:text-muted-foreground transition-colors disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
19
+ 'focus:border-border-secondary focus-visible:border-border-secondary data-[state=open]:border-border-secondary',
20
+ ].join(' '),
21
+ {
22
+ variants: {
23
+ size: {
24
+ sm: 'h-7 px-2 py-0.5 text-xs',
25
+ md: 'h-9 px-3 py-2 text-sm',
26
+ lg: 'h-11 px-4 py-2.5 text-base',
27
+ },
28
+ },
29
+ defaultVariants: { size: 'md' },
30
+ }
31
+ )
32
+
15
33
  export interface SelectTriggerProps
16
- extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {
34
+ extends Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, 'size'>,
35
+ VariantProps<typeof selectTriggerVariants> {
17
36
  triggerIcon?: React.ReactNode
37
+ size?: 'sm' | 'md' | 'lg'
18
38
  }
19
39
 
20
40
  const SelectTrigger = React.forwardRef<
21
41
  React.ElementRef<typeof SelectPrimitive.Trigger>,
22
42
  SelectTriggerProps
23
- >(({ className, children, disabled, triggerIcon, ...props }, ref) => (
43
+ >(({ className, children, disabled, triggerIcon, size = 'md', ...props }, ref) => (
24
44
  <SelectPrimitive.Trigger
25
45
  ref={ref}
26
46
  disabled={disabled}
27
47
  className={cn(
28
- 'flex h-9 w-full items-center justify-between gap-2 whitespace-nowrap rounded-lg border border-border-tertiary bg-bg-container px-3 py-2 text-sm text-text placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
48
+ selectTriggerVariants({ size }),
29
49
  FOCUS_RESET,
30
50
  className
31
51
  )}
@@ -174,4 +194,5 @@ export {
174
194
  SelectSeparator,
175
195
  SelectScrollUpButton,
176
196
  SelectScrollDownButton,
197
+ selectTriggerVariants,
177
198
  }
@@ -0,0 +1,26 @@
1
+ import * as React from 'react'
2
+ import * as SeparatorPrimitive from '@radix-ui/react-separator'
3
+ import { cn } from '@/lib/utils'
4
+
5
+ export type SeparatorProps = React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
6
+
7
+ const Separator = React.forwardRef<
8
+ React.ElementRef<typeof SeparatorPrimitive.Root>,
9
+ SeparatorProps
10
+ >(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (
11
+ <SeparatorPrimitive.Root
12
+ ref={ref}
13
+ decorative={decorative}
14
+ orientation={orientation}
15
+ className={cn(
16
+ 'shrink-0 bg-border-tertiary',
17
+ 'data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full',
18
+ 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',
19
+ className,
20
+ )}
21
+ {...props}
22
+ />
23
+ ))
24
+ Separator.displayName = SeparatorPrimitive.Root.displayName
25
+
26
+ export { Separator }
@@ -0,0 +1,18 @@
1
+ export {
2
+ Drawer as Sheet,
3
+ DrawerTrigger as SheetTrigger,
4
+ DrawerClose as SheetClose,
5
+ DrawerPortal as SheetPortal,
6
+ DrawerOverlay as SheetOverlay,
7
+ DrawerContent as SheetContent,
8
+ DrawerHeader as SheetHeader,
9
+ DrawerFooter as SheetFooter,
10
+ DrawerTitle as SheetTitle,
11
+ DrawerDescription as SheetDescription,
12
+ drawerVariants as sheetVariants,
13
+ } from './drawer'
14
+ export type {
15
+ DrawerContentProps as SheetContentProps,
16
+ DrawerHeaderProps as SheetHeaderProps,
17
+ DrawerFooterProps as SheetFooterProps,
18
+ } from './drawer'
@@ -1,17 +1,32 @@
1
1
  import { forwardRef } from 'react'
2
2
  import type { HTMLAttributes } from 'react'
3
+ import { cva, type VariantProps } from 'class-variance-authority'
3
4
  import { cn } from '@/lib/utils'
4
5
  import { LoaderLine } from './icons-inline'
5
6
 
6
- export interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
7
- className?: string
8
- }
7
+ const spinnerVariants = cva('animate-spin', {
8
+ variants: {
9
+ size: {
10
+ xs: 'size-3',
11
+ sm: 'size-3.5',
12
+ md: 'size-4',
13
+ lg: 'size-5',
14
+ },
15
+ },
16
+ defaultVariants: { size: 'md' },
17
+ })
18
+
19
+ export interface SpinnerProps
20
+ extends HTMLAttributes<HTMLSpanElement>,
21
+ VariantProps<typeof spinnerVariants> {}
9
22
 
10
23
  export const Spinner = forwardRef<HTMLSpanElement, SpinnerProps>(
11
- ({ className, ...props }, ref) => (
24
+ ({ className, size = 'md', ...props }, ref) => (
12
25
  <span ref={ref} role="status" aria-label="Loading" {...props}>
13
- <LoaderLine className={cn('size-4 animate-spin', className)} />
26
+ <LoaderLine className={cn(spinnerVariants({ size }), className)} />
14
27
  </span>
15
28
  )
16
29
  )
17
30
  Spinner.displayName = 'Spinner'
31
+
32
+ export { spinnerVariants }
@@ -0,0 +1,43 @@
1
+ import * as React from 'react'
2
+ import { cva, type VariantProps } from 'class-variance-authority'
3
+ import { cn } from '@/lib/utils'
4
+
5
+ const textareaVariants = cva(
6
+ [
7
+ 'flex w-full rounded-lg border border-border-tertiary bg-bg-container text-text transition-colors',
8
+ 'placeholder:text-text-tertiary',
9
+ 'outline-none focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0',
10
+ 'focus:border-border-secondary focus-visible:border-border-secondary',
11
+ 'disabled:cursor-not-allowed disabled:opacity-50',
12
+ 'aria-invalid:border-error aria-invalid:ring-0',
13
+ ].join(' '),
14
+ {
15
+ variants: {
16
+ size: {
17
+ sm: 'min-h-12 px-2 py-1 text-xs',
18
+ md: 'min-h-16 px-3 py-2 text-sm',
19
+ lg: 'min-h-20 px-4 py-2.5 text-base',
20
+ },
21
+ },
22
+ defaultVariants: { size: 'md' },
23
+ }
24
+ )
25
+
26
+ export interface TextareaProps
27
+ extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'>,
28
+ VariantProps<typeof textareaVariants> {
29
+ size?: 'sm' | 'md' | 'lg'
30
+ }
31
+
32
+ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
33
+ ({ className, size = 'md', ...props }, ref) => (
34
+ <textarea
35
+ ref={ref}
36
+ className={cn(textareaVariants({ size }), className)}
37
+ {...props}
38
+ />
39
+ ),
40
+ )
41
+ Textarea.displayName = 'Textarea'
42
+
43
+ export { Textarea, textareaVariants }
@@ -1,5 +1,5 @@
1
1
  import { createContext, forwardRef, useContext } from 'react'
2
- import type { ComponentPropsWithoutRef, ReactNode } from 'react'
2
+ import type { ReactNode } from 'react'
3
3
  import * as TogglePrimitive from '@radix-ui/react-toggle'
4
4
  import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group'
5
5
  import { cva, type VariantProps } from 'class-variance-authority'
@@ -2,6 +2,7 @@ import * as React from 'react'
2
2
  import { motion } from 'framer-motion'
3
3
  import * as TooltipPrimitive from '@radix-ui/react-tooltip'
4
4
  import { cn } from '@/lib/utils'
5
+ import { MOTION_SCALE_IN } from '@/lib/motion'
5
6
  import { getThemeFromDocument } from './theme-from-document'
6
7
 
7
8
  const TooltipProvider = TooltipPrimitive.Provider
@@ -36,7 +37,7 @@ const TooltipContent = React.forwardRef<
36
37
  )}
37
38
  {...props}
38
39
  >
39
- <motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ duration: 0.15 }}>
40
+ <motion.div {...MOTION_SCALE_IN}>
40
41
  {children}
41
42
  </motion.div>
42
43
  </TooltipPrimitive.Content>
@@ -119,7 +119,7 @@ function TypographyInlineCode({ className, ...props }: TypographyInlineCodeProps
119
119
  return (
120
120
  <code
121
121
  className={cn(
122
- 'relative rounded bg-fill-secondary px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold text-text',
122
+ 'relative rounded bg-fill-secondary px-1 py-0.5 font-mono text-sm font-semibold text-text',
123
123
  className
124
124
  )}
125
125
  {...props}
@@ -56,7 +56,7 @@ export const ChatInputTextarea = forwardRef<HTMLTextAreaElement, ChatInputTextar
56
56
  placeholder={placeholder}
57
57
  disabled={disabled}
58
58
  rows={1}
59
- className={textareaStyles}
59
+ className={[textareaStyles, className].filter(Boolean).join(' ')}
60
60
  {...props}
61
61
  style={{ ...(style ?? {}), ...textareaNoFocusStyle }}
62
62
  />
@@ -94,7 +94,7 @@ export interface ChatInputInputProps extends Omit<React.ComponentProps<typeof Ch
94
94
  }
95
95
 
96
96
  export const ChatInputInput = forwardRef<HTMLTextAreaElement, ChatInputInputProps>(
97
- ({ placeholder = 'What can I help you with today?', maxRows = 6, ...props }, ref) => {
97
+ ({ placeholder, maxRows, ...props }, ref) => {
98
98
  const ctx = useChatInputContext()
99
99
  const setRef = useCallback(
100
100
  (node: HTMLTextAreaElement | null) => {
@@ -111,9 +111,9 @@ export const ChatInputInput = forwardRef<HTMLTextAreaElement, ChatInputInputProp
111
111
  value={ctx.value}
112
112
  onChange={ctx.onChange}
113
113
  onKeyDown={ctx.handleKeyDown}
114
- placeholder={placeholder}
114
+ placeholder={placeholder ?? ctx.placeholder}
115
115
  disabled={ctx.disabled}
116
- maxRows={maxRows}
116
+ maxRows={maxRows ?? ctx.maxRows}
117
117
  {...props}
118
118
  />
119
119
  </div>
@@ -264,6 +264,7 @@ export const ChatInputDefaultLayout = forwardRef<HTMLTextAreaElement, ChatInputD
264
264
  ref
265
265
  ) {
266
266
  const ctx = useChatInputContext()
267
+ void aboveOverlap
267
268
 
268
269
  const renderAttachments = () => {
269
270
  if (!hasAttachments || ctx.attachments == null || ctx.attachments === false) return null
@@ -11,6 +11,8 @@ export interface ChatInputContextValue {
11
11
  onChange: (value: string) => void
12
12
  onSend?: (value: string) => void
13
13
  disabled: boolean
14
+ placeholder: string
15
+ maxRows: number
14
16
  form?: string
15
17
  textareaRef: React.RefObject<HTMLTextAreaElement | null>
16
18
  setTextareaRef: (node: HTMLTextAreaElement | null) => void
@@ -87,7 +89,6 @@ export function ChatInputRootProvider({
87
89
  closeIcon,
88
90
  dataStyle,
89
91
  dataTheme,
90
- className,
91
92
  children,
92
93
  ...rest
93
94
  }: ChatInputRootProps) {
@@ -144,6 +145,8 @@ export function ChatInputRootProvider({
144
145
  onChange: handleChange,
145
146
  onSend,
146
147
  disabled,
148
+ placeholder,
149
+ maxRows,
147
150
  form,
148
151
  textareaRef,
149
152
  setTextareaRef,
@@ -1,7 +1,7 @@
1
1
  import { useMemo, type ReactNode } from 'react'
2
2
  import { motion } from 'framer-motion'
3
3
  import { cn } from '@/lib/utils'
4
- import { Highlight, Prism } from 'prism-react-renderer'
4
+ import { Highlight } from 'prism-react-renderer'
5
5
  import { CollapsibleCard } from '../basic/collapsible-card'
6
6
  import { FileLine, LoaderLine } from '../basic/icons-inline'
7
7
  import { getFileIconColorClass } from '../lib/file-icon-maps'