@ciridae/ui 0.2.0

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 (339) hide show
  1. package/README.md +31 -0
  2. package/dist/components/agentic/agent-card.d.ts +28 -0
  3. package/dist/components/agentic/agent-card.js +27 -0
  4. package/dist/components/agentic/agent-composer.d.ts +44 -0
  5. package/dist/components/agentic/agent-composer.js +104 -0
  6. package/dist/components/agentic/agent-context.d.ts +28 -0
  7. package/dist/components/agentic/agent-context.js +102 -0
  8. package/dist/components/agentic/agent-plan.d.ts +27 -0
  9. package/dist/components/agentic/agent-plan.js +43 -0
  10. package/dist/components/agentic/agent-queue.d.ts +46 -0
  11. package/dist/components/agentic/agent-queue.js +53 -0
  12. package/dist/components/agentic/agent-task.d.ts +16 -0
  13. package/dist/components/agentic/agent-task.js +20 -0
  14. package/dist/components/agentic/approval-request.d.ts +24 -0
  15. package/dist/components/agentic/approval-request.js +57 -0
  16. package/dist/components/agentic/artifact.d.ts +24 -0
  17. package/dist/components/agentic/artifact.js +72 -0
  18. package/dist/components/agentic/attachments.d.ts +124 -0
  19. package/dist/components/agentic/attachments.js +595 -0
  20. package/dist/components/agentic/audio-player.d.ts +16 -0
  21. package/dist/components/agentic/audio-player.js +21 -0
  22. package/dist/components/agentic/canvas.d.ts +10 -0
  23. package/dist/components/agentic/canvas.js +22 -0
  24. package/dist/components/agentic/clipboard.d.ts +2 -0
  25. package/dist/components/agentic/clipboard.js +12 -0
  26. package/dist/components/agentic/code-block.d.ts +43 -0
  27. package/dist/components/agentic/code-block.js +92 -0
  28. package/dist/components/agentic/commit.d.ts +57 -0
  29. package/dist/components/agentic/commit.js +85 -0
  30. package/dist/components/agentic/connection.d.ts +3 -0
  31. package/dist/components/agentic/connection.js +8 -0
  32. package/dist/components/agentic/controls.d.ts +6 -0
  33. package/dist/components/agentic/controls.js +7 -0
  34. package/dist/components/agentic/conversation.d.ts +25 -0
  35. package/dist/components/agentic/conversation.js +56 -0
  36. package/dist/components/agentic/edge.d.ts +8 -0
  37. package/dist/components/agentic/edge.js +65 -0
  38. package/dist/components/agentic/effort-selector.d.ts +43 -0
  39. package/dist/components/agentic/effort-selector.js +47 -0
  40. package/dist/components/agentic/environment-variables.d.ts +32 -0
  41. package/dist/components/agentic/environment-variables.js +66 -0
  42. package/dist/components/agentic/file-tree.d.ts +24 -0
  43. package/dist/components/agentic/file-tree.js +56 -0
  44. package/dist/components/agentic/image.d.ts +9 -0
  45. package/dist/components/agentic/image.js +11 -0
  46. package/dist/components/agentic/inline-citation.d.ts +40 -0
  47. package/dist/components/agentic/inline-citation.js +111 -0
  48. package/dist/components/agentic/jsx-preview.d.ts +19 -0
  49. package/dist/components/agentic/jsx-preview.js +34 -0
  50. package/dist/components/agentic/message-branch.d.ts +20 -0
  51. package/dist/components/agentic/message-branch.js +83 -0
  52. package/dist/components/agentic/message-response.css +265 -0
  53. package/dist/components/agentic/message-response.css.d.ts +2 -0
  54. package/dist/components/agentic/message.d.ts +27 -0
  55. package/dist/components/agentic/message.js +57 -0
  56. package/dist/components/agentic/mic-selector.d.ts +58 -0
  57. package/dist/components/agentic/mic-selector.js +173 -0
  58. package/dist/components/agentic/model-selector.d.ts +39 -0
  59. package/dist/components/agentic/model-selector.js +47 -0
  60. package/dist/components/agentic/node.d.ts +26 -0
  61. package/dist/components/agentic/node.js +29 -0
  62. package/dist/components/agentic/open-in-chat.d.ts +9 -0
  63. package/dist/components/agentic/open-in-chat.js +8 -0
  64. package/dist/components/agentic/package-info.d.ts +30 -0
  65. package/dist/components/agentic/package-info.js +44 -0
  66. package/dist/components/agentic/panel.d.ts +6 -0
  67. package/dist/components/agentic/panel.js +7 -0
  68. package/dist/components/agentic/persona.d.ts +16 -0
  69. package/dist/components/agentic/persona.js +116 -0
  70. package/dist/components/agentic/prompt-input-action-menu.d.ts +16 -0
  71. package/dist/components/agentic/prompt-input-action-menu.js +22 -0
  72. package/dist/components/agentic/prompt-input-command.d.ts +18 -0
  73. package/dist/components/agentic/prompt-input-command.js +25 -0
  74. package/dist/components/agentic/prompt-input-hover-card.d.ts +10 -0
  75. package/dist/components/agentic/prompt-input-hover-card.js +13 -0
  76. package/dist/components/agentic/prompt-input-select.d.ts +14 -0
  77. package/dist/components/agentic/prompt-input-select.js +19 -0
  78. package/dist/components/agentic/prompt-input-tabs.d.ts +17 -0
  79. package/dist/components/agentic/prompt-input-tabs.js +45 -0
  80. package/dist/components/agentic/prompt-input.d.ts +79 -0
  81. package/dist/components/agentic/prompt-input.js +206 -0
  82. package/dist/components/agentic/reasoning.d.ts +21 -0
  83. package/dist/components/agentic/reasoning.js +106 -0
  84. package/dist/components/agentic/run-checkpoint.d.ts +13 -0
  85. package/dist/components/agentic/run-checkpoint.js +19 -0
  86. package/dist/components/agentic/run-trace.d.ts +30 -0
  87. package/dist/components/agentic/run-trace.js +56 -0
  88. package/dist/components/agentic/sandbox.d.ts +24 -0
  89. package/dist/components/agentic/sandbox.js +33 -0
  90. package/dist/components/agentic/schema-display.d.ts +39 -0
  91. package/dist/components/agentic/schema-display.js +56 -0
  92. package/dist/components/agentic/shimmer.d.ts +11 -0
  93. package/dist/components/agentic/shimmer.js +16 -0
  94. package/dist/components/agentic/snippet.d.ts +18 -0
  95. package/dist/components/agentic/snippet.js +35 -0
  96. package/dist/components/agentic/sources.d.ts +16 -0
  97. package/dist/components/agentic/sources.js +17 -0
  98. package/dist/components/agentic/speech-input.d.ts +24 -0
  99. package/dist/components/agentic/speech-input.js +30 -0
  100. package/dist/components/agentic/stack-trace.d.ts +27 -0
  101. package/dist/components/agentic/stack-trace.js +76 -0
  102. package/dist/components/agentic/suggestion.d.ts +12 -0
  103. package/dist/components/agentic/suggestion.js +15 -0
  104. package/dist/components/agentic/terminal.d.ts +24 -0
  105. package/dist/components/agentic/terminal.js +47 -0
  106. package/dist/components/agentic/test-results.d.ts +51 -0
  107. package/dist/components/agentic/test-results.js +83 -0
  108. package/dist/components/agentic/theme.d.ts +5 -0
  109. package/dist/components/agentic/theme.js +31 -0
  110. package/dist/components/agentic/tool.d.ts +25 -0
  111. package/dist/components/agentic/tool.js +73 -0
  112. package/dist/components/agentic/toolbar.d.ts +6 -0
  113. package/dist/components/agentic/toolbar.js +7 -0
  114. package/dist/components/agentic/transcription.d.ts +20 -0
  115. package/dist/components/agentic/transcription.js +32 -0
  116. package/dist/components/agentic/types.d.ts +172 -0
  117. package/dist/components/agentic/types.js +1 -0
  118. package/dist/components/agentic/use-controllable-state.d.ts +6 -0
  119. package/dist/components/agentic/use-controllable-state.js +13 -0
  120. package/dist/components/agentic/voice-selector.d.ts +69 -0
  121. package/dist/components/agentic/voice-selector.js +122 -0
  122. package/dist/components/agentic/web-preview.d.ts +25 -0
  123. package/dist/components/agentic/web-preview.js +33 -0
  124. package/dist/components/ui/accordion.d.ts +7 -0
  125. package/dist/components/ui/accordion.js +17 -0
  126. package/dist/components/ui/alert-dialog.d.ts +22 -0
  127. package/dist/components/ui/alert-dialog.js +51 -0
  128. package/dist/components/ui/alert.d.ts +9 -0
  129. package/dist/components/ui/alert.js +24 -0
  130. package/dist/components/ui/aspect-ratio.d.ts +3 -0
  131. package/dist/components/ui/aspect-ratio.js +7 -0
  132. package/dist/components/ui/avatar.d.ts +11 -0
  133. package/dist/components/ui/avatar.js +22 -0
  134. package/dist/components/ui/badge-variants.d.ts +100 -0
  135. package/dist/components/ui/badge-variants.js +140 -0
  136. package/dist/components/ui/badge.d.ts +6 -0
  137. package/dist/components/ui/badge.js +9 -0
  138. package/dist/components/ui/breadcrumb.d.ts +11 -0
  139. package/dist/components/ui/breadcrumb.js +27 -0
  140. package/dist/components/ui/button-group-variants.d.ts +6 -0
  141. package/dist/components/ui/button-group-variants.js +13 -0
  142. package/dist/components/ui/button-group.d.ts +8 -0
  143. package/dist/components/ui/button-group.js +16 -0
  144. package/dist/components/ui/button-variants.d.ts +133 -0
  145. package/dist/components/ui/button-variants.js +170 -0
  146. package/dist/components/ui/button.d.ts +8 -0
  147. package/dist/components/ui/button.js +67 -0
  148. package/dist/components/ui/calendar.d.ts +9 -0
  149. package/dist/components/ui/calendar.js +99 -0
  150. package/dist/components/ui/card.d.ts +14 -0
  151. package/dist/components/ui/card.js +28 -0
  152. package/dist/components/ui/carousel.d.ts +19 -0
  153. package/dist/components/ui/carousel.js +104 -0
  154. package/dist/components/ui/chart-context.d.ts +33 -0
  155. package/dist/components/ui/chart-context.js +36 -0
  156. package/dist/components/ui/chart-panel.d.ts +11 -0
  157. package/dist/components/ui/chart-panel.js +6 -0
  158. package/dist/components/ui/chart-tooltip.d.ts +13 -0
  159. package/dist/components/ui/chart-tooltip.js +84 -0
  160. package/dist/components/ui/chart.d.ts +23 -0
  161. package/dist/components/ui/chart.js +52 -0
  162. package/dist/components/ui/checkbox.d.ts +4 -0
  163. package/dist/components/ui/checkbox.js +9 -0
  164. package/dist/components/ui/collapsible.d.ts +5 -0
  165. package/dist/components/ui/collapsible.js +12 -0
  166. package/dist/components/ui/combobox-anchor.d.ts +3 -0
  167. package/dist/components/ui/combobox-anchor.js +5 -0
  168. package/dist/components/ui/combobox.d.ts +23 -0
  169. package/dist/components/ui/combobox.js +54 -0
  170. package/dist/components/ui/command.d.ts +19 -0
  171. package/dist/components/ui/command.js +38 -0
  172. package/dist/components/ui/context-menu.d.ts +30 -0
  173. package/dist/components/ui/context-menu.js +63 -0
  174. package/dist/components/ui/data-table.d.ts +17 -0
  175. package/dist/components/ui/data-table.js +26 -0
  176. package/dist/components/ui/dialog.d.ts +22 -0
  177. package/dist/components/ui/dialog.js +48 -0
  178. package/dist/components/ui/direction-context.d.ts +3 -0
  179. package/dist/components/ui/direction-context.js +3 -0
  180. package/dist/components/ui/direction.d.ts +6 -0
  181. package/dist/components/ui/direction.js +7 -0
  182. package/dist/components/ui/drawer.d.ts +18 -0
  183. package/dist/components/ui/drawer.js +47 -0
  184. package/dist/components/ui/dropdown-menu.d.ts +30 -0
  185. package/dist/components/ui/dropdown-menu.js +63 -0
  186. package/dist/components/ui/empty.d.ts +11 -0
  187. package/dist/components/ui/empty.js +33 -0
  188. package/dist/components/ui/expandable-data-table.d.ts +24 -0
  189. package/dist/components/ui/expandable-data-table.js +62 -0
  190. package/dist/components/ui/field.d.ts +26 -0
  191. package/dist/components/ui/field.js +74 -0
  192. package/dist/components/ui/file-upload-field-parts.d.ts +21 -0
  193. package/dist/components/ui/file-upload-field-parts.js +55 -0
  194. package/dist/components/ui/file-upload-field.d.ts +15 -0
  195. package/dist/components/ui/file-upload-field.js +85 -0
  196. package/dist/components/ui/form-context.d.ts +23 -0
  197. package/dist/components/ui/form-context.js +35 -0
  198. package/dist/components/ui/form.d.ts +12 -0
  199. package/dist/components/ui/form.js +38 -0
  200. package/dist/components/ui/hover-card.d.ts +10 -0
  201. package/dist/components/ui/hover-card.js +22 -0
  202. package/dist/components/ui/input-group.d.ts +16 -0
  203. package/dist/components/ui/input-group.js +62 -0
  204. package/dist/components/ui/input-otp.d.ts +11 -0
  205. package/dist/components/ui/input-otp.js +21 -0
  206. package/dist/components/ui/input.d.ts +3 -0
  207. package/dist/components/ui/input.js +6 -0
  208. package/dist/components/ui/item.d.ts +23 -0
  209. package/dist/components/ui/item.js +66 -0
  210. package/dist/components/ui/kbd.d.ts +3 -0
  211. package/dist/components/ui/kbd.js +9 -0
  212. package/dist/components/ui/label.d.ts +4 -0
  213. package/dist/components/ui/label.js +7 -0
  214. package/dist/components/ui/loading-state.d.ts +27 -0
  215. package/dist/components/ui/loading-state.js +44 -0
  216. package/dist/components/ui/menubar.d.ts +30 -0
  217. package/dist/components/ui/menubar.js +63 -0
  218. package/dist/components/ui/metrics-strip.d.ts +7 -0
  219. package/dist/components/ui/metrics-strip.js +18 -0
  220. package/dist/components/ui/native-select.d.ts +7 -0
  221. package/dist/components/ui/native-select.js +13 -0
  222. package/dist/components/ui/navigation-menu-variants.d.ts +2 -0
  223. package/dist/components/ui/navigation-menu-variants.js +3 -0
  224. package/dist/components/ui/navigation-menu.d.ts +13 -0
  225. package/dist/components/ui/navigation-menu.js +30 -0
  226. package/dist/components/ui/page-header.d.ts +19 -0
  227. package/dist/components/ui/page-header.js +36 -0
  228. package/dist/components/ui/pagination.d.ts +13 -0
  229. package/dist/components/ui/pagination.js +29 -0
  230. package/dist/components/ui/popover.d.ts +14 -0
  231. package/dist/components/ui/popover.js +34 -0
  232. package/dist/components/ui/progress.d.ts +4 -0
  233. package/dist/components/ui/progress.js +8 -0
  234. package/dist/components/ui/property-list.d.ts +6 -0
  235. package/dist/components/ui/property-list.js +15 -0
  236. package/dist/components/ui/radio-group.d.ts +5 -0
  237. package/dist/components/ui/radio-group.js +11 -0
  238. package/dist/components/ui/registry-docs-api.d.ts +11 -0
  239. package/dist/components/ui/registry-docs-api.js +9 -0
  240. package/dist/components/ui/registry-docs-code.d.ts +19 -0
  241. package/dist/components/ui/registry-docs-code.js +78 -0
  242. package/dist/components/ui/registry-docs-showcase.d.ts +11 -0
  243. package/dist/components/ui/registry-docs-showcase.js +27 -0
  244. package/dist/components/ui/registry-docs.d.ts +27 -0
  245. package/dist/components/ui/registry-docs.js +32 -0
  246. package/dist/components/ui/resizable.d.ts +7 -0
  247. package/dist/components/ui/resizable.js +15 -0
  248. package/dist/components/ui/scroll-area.d.ts +7 -0
  249. package/dist/components/ui/scroll-area.js +10 -0
  250. package/dist/components/ui/select.d.ts +15 -0
  251. package/dist/components/ui/select.js +38 -0
  252. package/dist/components/ui/separator.d.ts +4 -0
  253. package/dist/components/ui/separator.js +7 -0
  254. package/dist/components/ui/sheet.d.ts +21 -0
  255. package/dist/components/ui/sheet.js +62 -0
  256. package/dist/components/ui/sidebar/context.d.ts +21 -0
  257. package/dist/components/ui/sidebar/context.js +15 -0
  258. package/dist/components/ui/sidebar/group.d.ts +10 -0
  259. package/dist/components/ui/sidebar/group.js +18 -0
  260. package/dist/components/ui/sidebar/layout.d.ts +17 -0
  261. package/dist/components/ui/sidebar/layout.js +73 -0
  262. package/dist/components/ui/sidebar/menu.d.ts +30 -0
  263. package/dist/components/ui/sidebar/menu.js +64 -0
  264. package/dist/components/ui/sidebar/provider.d.ts +7 -0
  265. package/dist/components/ui/sidebar/provider.js +53 -0
  266. package/dist/components/ui/sidebar/rail.d.ts +3 -0
  267. package/dist/components/ui/sidebar/rail.js +12 -0
  268. package/dist/components/ui/sidebar/trigger.d.ts +4 -0
  269. package/dist/components/ui/sidebar/trigger.js +16 -0
  270. package/dist/components/ui/sidebar-account-menu-theme.d.ts +7 -0
  271. package/dist/components/ui/sidebar-account-menu-theme.js +32 -0
  272. package/dist/components/ui/sidebar-account-menu.d.ts +14 -0
  273. package/dist/components/ui/sidebar-account-menu.js +51 -0
  274. package/dist/components/ui/sidebar.d.ts +7 -0
  275. package/dist/components/ui/sidebar.js +7 -0
  276. package/dist/components/ui/skeleton.d.ts +2 -0
  277. package/dist/components/ui/skeleton.js +15 -0
  278. package/dist/components/ui/slider.d.ts +4 -0
  279. package/dist/components/ui/slider.js +9 -0
  280. package/dist/components/ui/sonner.d.ts +3 -0
  281. package/dist/components/ui/sonner.js +33 -0
  282. package/dist/components/ui/spinner.d.ts +2 -0
  283. package/dist/components/ui/spinner.js +16 -0
  284. package/dist/components/ui/switch.d.ts +6 -0
  285. package/dist/components/ui/switch.js +7 -0
  286. package/dist/components/ui/table.d.ts +10 -0
  287. package/dist/components/ui/table.js +28 -0
  288. package/dist/components/ui/tabs-variants.d.ts +6 -0
  289. package/dist/components/ui/tabs-variants.js +13 -0
  290. package/dist/components/ui/tabs.d.ts +8 -0
  291. package/dist/components/ui/tabs.js +17 -0
  292. package/dist/components/ui/textarea.d.ts +3 -0
  293. package/dist/components/ui/textarea.js +6 -0
  294. package/dist/components/ui/toggle-group.d.ts +9 -0
  295. package/dist/components/ui/toggle-group.js +24 -0
  296. package/dist/components/ui/toggle-variants.d.ts +7 -0
  297. package/dist/components/ui/toggle-variants.js +19 -0
  298. package/dist/components/ui/toggle.d.ts +5 -0
  299. package/dist/components/ui/toggle.js +9 -0
  300. package/dist/components/ui/tooltip.d.ts +11 -0
  301. package/dist/components/ui/tooltip.js +25 -0
  302. package/dist/components/ui/workflow-timeline.d.ts +20 -0
  303. package/dist/components/ui/workflow-timeline.js +92 -0
  304. package/dist/hooks/use-mobile.d.ts +1 -0
  305. package/dist/hooks/use-mobile.js +15 -0
  306. package/dist/lib/utils.d.ts +5 -0
  307. package/dist/lib/utils.js +8 -0
  308. package/dist/styled-system/css/conditions.mjs +36 -0
  309. package/dist/styled-system/css/css.mjs +45 -0
  310. package/dist/styled-system/css/cva.mjs +87 -0
  311. package/dist/styled-system/css/cx.mjs +15 -0
  312. package/dist/styled-system/css/index.mjs +4 -0
  313. package/dist/styled-system/css/sva.mjs +46 -0
  314. package/dist/styled-system/helpers.mjs +316 -0
  315. package/dist/styled-system/patterns/aspect-ratio.mjs +38 -0
  316. package/dist/styled-system/patterns/bleed.mjs +24 -0
  317. package/dist/styled-system/patterns/box.mjs +15 -0
  318. package/dist/styled-system/patterns/center.mjs +21 -0
  319. package/dist/styled-system/patterns/circle.mjs +25 -0
  320. package/dist/styled-system/patterns/container.mjs +21 -0
  321. package/dist/styled-system/patterns/cq.mjs +21 -0
  322. package/dist/styled-system/patterns/divider.mjs +25 -0
  323. package/dist/styled-system/patterns/flex.mjs +26 -0
  324. package/dist/styled-system/patterns/float.mjs +52 -0
  325. package/dist/styled-system/patterns/grid-item.mjs +25 -0
  326. package/dist/styled-system/patterns/grid.mjs +27 -0
  327. package/dist/styled-system/patterns/hstack.mjs +24 -0
  328. package/dist/styled-system/patterns/index.mjs +20 -0
  329. package/dist/styled-system/patterns/link-overlay.mjs +24 -0
  330. package/dist/styled-system/patterns/spacer.mjs +25 -0
  331. package/dist/styled-system/patterns/square.mjs +24 -0
  332. package/dist/styled-system/patterns/stack.mjs +24 -0
  333. package/dist/styled-system/patterns/visually-hidden.mjs +18 -0
  334. package/dist/styled-system/patterns/vstack.mjs +24 -0
  335. package/dist/styled-system/patterns/wrap.mjs +25 -0
  336. package/dist/styled-system/styles.css +1089 -0
  337. package/dist/styled-system/styles.css.d.ts +2 -0
  338. package/dist/styled-system/tokens/index.mjs +2304 -0
  339. package/package.json +688 -0
@@ -0,0 +1,57 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useMemo } from "react";
3
+ import { Button } from "@ciridae/ui/button";
4
+ import { cn } from "@ciridae/ui/utils";
5
+ const ApprovalRequestContext = createContext(null);
6
+ const responseStates = [
7
+ "approval-responded",
8
+ "output-denied",
9
+ "output-error",
10
+ "output-available",
11
+ ];
12
+ function useApprovalRequest() {
13
+ const context = useContext(ApprovalRequestContext);
14
+ if (!context)
15
+ throw new Error("ApprovalRequest components must be used within ApprovalRequest");
16
+ return context;
17
+ }
18
+ function ApprovalRequest({ approval, className, state, ...props }) {
19
+ const contextValue = useMemo(() => ({ approval, state }), [approval, state]);
20
+ if (!approval || state === "input-streaming" || state === "input-available")
21
+ return null;
22
+ return (_jsx(ApprovalRequestContext.Provider, { value: contextValue, children: _jsx("div", { "data-slot": "approval-request", className: cn("grid gap-2 rounded-lg border bg-card p-3 text-sm text-card-foreground", className), ...props }) }));
23
+ }
24
+ function ApprovalRequestTitle({ className, ...props }) {
25
+ return (_jsx("div", { "data-slot": "approval-request-title", className: cn("font-medium text-foreground", className), ...props }));
26
+ }
27
+ function ApprovalRequestDescription({ className, ...props }) {
28
+ return (_jsx("div", { "data-slot": "approval-request-description", className: cn("text-muted-foreground", className), ...props }));
29
+ }
30
+ function ApprovalRequestPending({ children }) {
31
+ const { state } = useApprovalRequest();
32
+ if (state !== "approval-requested")
33
+ return null;
34
+ return children;
35
+ }
36
+ function ApprovalRequestAccepted({ children }) {
37
+ const { approval, state } = useApprovalRequest();
38
+ if (!approval?.approved || !responseStates.includes(state))
39
+ return null;
40
+ return children;
41
+ }
42
+ function ApprovalRequestRejected({ children }) {
43
+ const { approval, state } = useApprovalRequest();
44
+ if (approval?.approved !== false || !responseStates.includes(state))
45
+ return null;
46
+ return children;
47
+ }
48
+ function ApprovalRequestActions({ className, ...props }) {
49
+ const { state } = useApprovalRequest();
50
+ if (state !== "approval-requested")
51
+ return null;
52
+ return (_jsx("div", { "data-slot": "approval-request-actions", className: cn("flex items-center justify-end gap-2", className), ...props }));
53
+ }
54
+ function ApprovalRequestAction({ className, size = "sm", type = "button", ...props }) {
55
+ return (_jsx(Button, { "data-slot": "approval-request-action", className: className, size: size, type: type, ...props }));
56
+ }
57
+ export { ApprovalRequest, ApprovalRequestAccepted, ApprovalRequestAction, ApprovalRequestActions, ApprovalRequestDescription, ApprovalRequestPending, ApprovalRequestRejected, ApprovalRequestTitle, };
@@ -0,0 +1,24 @@
1
+ import type * as React from "react";
2
+ import { Button } from "@ciridae/ui/button";
3
+ type ArtifactProps = React.ComponentProps<"div">;
4
+ type ArtifactHeaderProps = React.ComponentProps<"div">;
5
+ type ArtifactCloseProps = React.ComponentProps<typeof Button>;
6
+ type ArtifactTitleProps = React.ComponentProps<"p">;
7
+ type ArtifactDescriptionProps = React.ComponentProps<"p">;
8
+ type ArtifactActionsProps = React.ComponentProps<"div">;
9
+ type ArtifactActionProps = React.ComponentProps<typeof Button> & {
10
+ label?: string;
11
+ mode?: "copy" | "download" | "open";
12
+ value?: string;
13
+ };
14
+ type ArtifactContentProps = React.ComponentProps<"div">;
15
+ declare function Artifact({ className, ...props }: ArtifactProps): import("react/jsx-runtime").JSX.Element;
16
+ declare function ArtifactHeader({ className, ...props }: ArtifactHeaderProps): import("react/jsx-runtime").JSX.Element;
17
+ declare function ArtifactClose({ children, type, ...props }: ArtifactCloseProps): import("react/jsx-runtime").JSX.Element;
18
+ declare function ArtifactTitle({ className, ...props }: ArtifactTitleProps): import("react/jsx-runtime").JSX.Element;
19
+ declare function ArtifactDescription({ className, ...props }: ArtifactDescriptionProps): import("react/jsx-runtime").JSX.Element;
20
+ declare function ArtifactActions({ className, ...props }: ArtifactActionsProps): import("react/jsx-runtime").JSX.Element;
21
+ declare function ArtifactAction({ children, label, mode, type, value, onClick, ...props }: ArtifactActionProps): import("react/jsx-runtime").JSX.Element;
22
+ declare function ArtifactContent({ className, ...props }: ArtifactContentProps): import("react/jsx-runtime").JSX.Element;
23
+ export { Artifact, ArtifactAction, ArtifactActions, ArtifactClose, ArtifactContent, ArtifactDescription, ArtifactHeader, ArtifactTitle, };
24
+ export type { ArtifactActionProps, ArtifactActionsProps, ArtifactCloseProps, ArtifactContentProps, ArtifactDescriptionProps, ArtifactHeaderProps, ArtifactProps, ArtifactTitleProps, };
@@ -0,0 +1,72 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { CheckIcon, CopyIcon, DownloadIcon, ExternalLinkIcon, XIcon } from "lucide-react";
3
+ import { useState } from "react";
4
+ import { Button } from "@ciridae/ui/button";
5
+ import { cn } from "@ciridae/ui/utils";
6
+ import { copyToClipboard } from "./clipboard";
7
+ function Artifact({ className, ...props }) {
8
+ return (_jsx("div", { "data-slot": "artifact", className: cn("flex h-full min-h-0 w-full flex-col overflow-hidden rounded-lg border bg-card text-card-foreground", className), ...props }));
9
+ }
10
+ function ArtifactHeader({ className, ...props }) {
11
+ return (_jsx("div", { "data-slot": "artifact-header", className: cn("flex min-w-0 items-start justify-between gap-3 border-b px-4 py-3", className), ...props }));
12
+ }
13
+ function ArtifactClose({ children, type = "button", ...props }) {
14
+ return (_jsx(Button, { "aria-label": "Close artifact", size: "icon", variant: "ghost", ...props, type: type, children: children ?? _jsx(XIcon, { "aria-hidden": "true", className: "size-4" }) }));
15
+ }
16
+ function ArtifactTitle({ className, ...props }) {
17
+ return (_jsx("p", { "data-slot": "artifact-title", className: cn("truncate text-sm font-medium", className), ...props }));
18
+ }
19
+ function ArtifactDescription({ className, ...props }) {
20
+ return (_jsx("p", { "data-slot": "artifact-description", className: cn("text-sm text-muted-foreground", className), ...props }));
21
+ }
22
+ function ArtifactActions({ className, ...props }) {
23
+ return (_jsx("div", { "data-slot": "artifact-actions", className: cn("flex shrink-0 items-center gap-1", className), ...props }));
24
+ }
25
+ function ArtifactAction({ children, label, mode = "open", type = "button", value = "", onClick, ...props }) {
26
+ const [copied, setCopied] = useState(false);
27
+ const Icon = copied
28
+ ? CheckIcon
29
+ : mode === "copy"
30
+ ? CopyIcon
31
+ : mode === "download"
32
+ ? DownloadIcon
33
+ : ExternalLinkIcon;
34
+ return (_jsx(Button, { "aria-label": copied ? "Copied" : label, size: "icon", variant: "ghost", ...props, type: type, onClick: (event) => {
35
+ onClick?.(event);
36
+ if (!event.defaultPrevented)
37
+ void runArtifactAction(mode, value, setCopied);
38
+ }, children: children ?? _jsx(Icon, { "aria-hidden": "true", className: "size-4" }) }));
39
+ }
40
+ function ArtifactContent({ className, ...props }) {
41
+ return (_jsx("div", { "data-slot": "artifact-content", className: cn("min-h-0 flex-1 overflow-auto p-4", className), ...props }));
42
+ }
43
+ async function runArtifactAction(mode, value, setCopied) {
44
+ if (!value)
45
+ return;
46
+ if (mode === "copy") {
47
+ await copyToClipboard(value, setCopied);
48
+ return;
49
+ }
50
+ if (mode === "download") {
51
+ const link = document.createElement("a");
52
+ link.href = value;
53
+ link.download = getArtifactDownloadName(value);
54
+ link.rel = "noreferrer";
55
+ document.body.appendChild(link);
56
+ link.click();
57
+ link.remove();
58
+ return;
59
+ }
60
+ window.open(value, "_blank", "noopener,noreferrer");
61
+ }
62
+ function getArtifactDownloadName(value) {
63
+ try {
64
+ const url = new URL(value, window.location.href);
65
+ const name = url.pathname.split("/").filter(Boolean).pop();
66
+ return name || "artifact";
67
+ }
68
+ catch {
69
+ return "artifact";
70
+ }
71
+ }
72
+ export { Artifact, ArtifactAction, ArtifactActions, ArtifactClose, ArtifactContent, ArtifactDescription, ArtifactHeader, ArtifactTitle, };
@@ -0,0 +1,124 @@
1
+ import * as React from "react";
2
+ import type { AgenticPromptAttachment, AgenticPromptAttachmentKind } from "@ciridae/ui/types";
3
+ import { Button } from "@ciridae/ui/button";
4
+ import { HoverCard, HoverCardContent, HoverCardTrigger } from "@ciridae/ui/hover-card";
5
+ type AgenticAttachment = AgenticPromptAttachment & {
6
+ file?: File;
7
+ filename?: string;
8
+ title?: string;
9
+ type?: "file" | "source-document";
10
+ };
11
+ type AttachmentData = AgenticAttachment;
12
+ type AttachmentMediaCategory = "image" | "video" | "audio" | "document" | "source" | "unknown";
13
+ type AttachmentVariant = "grid" | "inline" | "list";
14
+ type AttachmentErrorCode = "accept" | "max_attachments" | "max_attachment_size";
15
+ type AttachmentError = {
16
+ code: AttachmentErrorCode;
17
+ message: string;
18
+ };
19
+ type AttachmentAddOptions = {
20
+ kind?: AgenticPromptAttachmentKind;
21
+ };
22
+ type AttachmentScreenshotStatus = "idle" | "capturing" | "unavailable" | "error";
23
+ type AttachmentControllerContextValue = {
24
+ accept?: string;
25
+ add: (files: File[] | FileList, options?: AttachmentAddOptions) => void;
26
+ clear: () => void;
27
+ error?: AttachmentError;
28
+ files: AgenticAttachment[];
29
+ maxAttachmentSizeMb?: number;
30
+ maxAttachments?: number;
31
+ openFileDialog: () => void;
32
+ remove: (id: string) => void;
33
+ screenshotStatus: AttachmentScreenshotStatus;
34
+ takeScreenshot: () => Promise<void>;
35
+ };
36
+ type AttachmentProviderProps = {
37
+ accept?: string;
38
+ attachments?: AgenticAttachment[];
39
+ children: React.ReactNode;
40
+ defaultAttachments?: AgenticAttachment[];
41
+ maxAttachmentSizeMb?: number;
42
+ maxAttachments?: number;
43
+ multiple?: boolean;
44
+ onAttachmentError?: (error: AttachmentError) => void;
45
+ onAttachmentsChange?: (attachments: AgenticAttachment[]) => void;
46
+ onCaptureScreenshot?: () => File | null | Promise<File | null>;
47
+ };
48
+ type AttachmentsProps = React.ComponentProps<"div"> & {
49
+ variant?: AttachmentVariant;
50
+ };
51
+ type AttachmentProps = React.ComponentProps<"div"> & {
52
+ attachment?: AttachmentData;
53
+ data?: AttachmentData;
54
+ onRemove?: () => void;
55
+ };
56
+ type AttachmentPreviewProps = React.ComponentProps<"div"> & {
57
+ fallbackIcon?: React.ReactNode;
58
+ };
59
+ type AttachmentInfoProps = React.ComponentProps<"div"> & {
60
+ showMediaType?: boolean;
61
+ };
62
+ type AttachmentRemoveProps = React.ComponentProps<typeof Button> & {
63
+ attachmentId?: string;
64
+ label?: string;
65
+ };
66
+ type AttachmentHoverCardProps = React.ComponentProps<typeof HoverCard>;
67
+ type AttachmentHoverCardTriggerProps = React.ComponentProps<typeof HoverCardTrigger>;
68
+ type AttachmentHoverCardContentProps = React.ComponentProps<typeof HoverCardContent>;
69
+ type AttachmentEmptyProps = React.ComponentProps<"div">;
70
+ type AttachmentListProps = AttachmentsProps;
71
+ type AttachmentNameProps = React.ComponentProps<"span">;
72
+ type AttachmentMetaProps = React.ComponentProps<"span"> & {
73
+ attachment?: AttachmentData;
74
+ data?: AttachmentData;
75
+ };
76
+ type AttachmentActionRenderAs = "button" | "menu-item";
77
+ type AttachmentActionAddFilesProps = React.ComponentProps<typeof Button> & {
78
+ label?: string;
79
+ renderAs?: AttachmentActionRenderAs;
80
+ tooltip?: string;
81
+ };
82
+ type AttachmentActionAddScreenshotProps = React.ComponentProps<typeof Button> & {
83
+ label?: string;
84
+ renderAs?: AttachmentActionRenderAs;
85
+ status?: AttachmentScreenshotStatus;
86
+ tooltip?: string;
87
+ };
88
+ declare function AttachmentProvider({ accept, attachments, children, defaultAttachments, maxAttachmentSizeMb, maxAttachments, multiple, onAttachmentError, onAttachmentsChange, onCaptureScreenshot, }: AttachmentProviderProps): import("react/jsx-runtime").JSX.Element;
89
+ declare function useAttachments(): AttachmentControllerContextValue;
90
+ declare function useOptionalAttachments(): AttachmentControllerContextValue | null;
91
+ declare function useAttachmentsContext(): {
92
+ variant: AttachmentVariant;
93
+ };
94
+ declare function useAttachmentContext(): {
95
+ data: AttachmentData;
96
+ mediaCategory: AttachmentMediaCategory;
97
+ onRemove?: () => void;
98
+ variant: AttachmentVariant;
99
+ };
100
+ declare function Attachments({ variant, className, children, ...props }: AttachmentsProps): import("react/jsx-runtime").JSX.Element | null;
101
+ declare function AttachmentList({ variant, ...props }: AttachmentListProps): import("react/jsx-runtime").JSX.Element;
102
+ declare function Attachment({ attachment, children, className, data, onRemove, ...props }: AttachmentProps): import("react/jsx-runtime").JSX.Element | null;
103
+ declare function AttachmentPreview({ fallbackIcon, className, ...props }: AttachmentPreviewProps): import("react/jsx-runtime").JSX.Element;
104
+ declare function AttachmentInfo({ showMediaType, className, ...props }: AttachmentInfoProps): import("react/jsx-runtime").JSX.Element | null;
105
+ declare function AttachmentName({ className, children, ...props }: AttachmentNameProps): import("react/jsx-runtime").JSX.Element;
106
+ declare function AttachmentMeta({ attachment, children, className, data, ...props }: AttachmentMetaProps): import("react/jsx-runtime").JSX.Element;
107
+ declare function AttachmentRemove({ attachmentId, children, className, label, onClick, size, type, variant: buttonVariant, ...props }: AttachmentRemoveProps): import("react/jsx-runtime").JSX.Element | null;
108
+ declare function AttachmentHoverCard({ closeDelay, openDelay, ...props }: AttachmentHoverCardProps): import("react/jsx-runtime").JSX.Element;
109
+ declare function AttachmentHoverCardTrigger(props: AttachmentHoverCardTriggerProps): import("react/jsx-runtime").JSX.Element;
110
+ declare function AttachmentHoverCardContent({ align, className, ...props }: AttachmentHoverCardContentProps): import("react/jsx-runtime").JSX.Element;
111
+ declare function AttachmentEmpty({ className, children, ...props }: AttachmentEmptyProps): import("react/jsx-runtime").JSX.Element;
112
+ declare function AttachmentActionAddFiles({ children, className, label, onClick, renderAs, size, tooltip, type, variant, ...props }: AttachmentActionAddFilesProps): import("react/jsx-runtime").JSX.Element;
113
+ declare function AttachmentActionAddScreenshot({ children, className, disabled, label, onClick, renderAs, size, status, tooltip, type, variant, ...props }: AttachmentActionAddScreenshotProps): import("react/jsx-runtime").JSX.Element;
114
+ declare function useAttachmentDropTarget({ global, ref, }: {
115
+ global?: boolean;
116
+ ref: React.RefObject<HTMLElement | null>;
117
+ }): void;
118
+ declare function prepareAttachmentsForSubmit(attachments: AgenticAttachment[]): Promise<AgenticAttachment[]>;
119
+ declare function fileToAttachment(file: File, kind?: AgenticPromptAttachmentKind): AgenticAttachment;
120
+ declare function getMediaCategory(data: AttachmentData): AttachmentMediaCategory;
121
+ declare function getAttachmentLabel(data: AttachmentData): string;
122
+ declare function captureBrowserScreenshot(): Promise<File | null>;
123
+ export { Attachment, AttachmentActionAddFiles, AttachmentActionAddScreenshot, AttachmentEmpty, AttachmentHoverCard, AttachmentHoverCardContent, AttachmentHoverCardTrigger, AttachmentInfo, AttachmentList, AttachmentMeta, AttachmentName, AttachmentPreview, AttachmentProvider, AttachmentRemove, Attachments, captureBrowserScreenshot, fileToAttachment, getAttachmentLabel, getMediaCategory, prepareAttachmentsForSubmit, useAttachmentContext, useAttachmentDropTarget, useAttachments, useAttachmentsContext, useOptionalAttachments, };
124
+ export type { AgenticAttachment, AttachmentActionAddFilesProps, AttachmentActionAddScreenshotProps, AttachmentAddOptions, AttachmentControllerContextValue as AttachmentContextValue, AttachmentData, AttachmentEmptyProps, AttachmentError, AttachmentErrorCode, AttachmentHoverCardContentProps, AttachmentHoverCardProps, AttachmentHoverCardTriggerProps, AttachmentInfoProps, AttachmentListProps, AttachmentMediaCategory, AttachmentMetaProps, AttachmentNameProps, AttachmentPreviewProps, AttachmentProps, AttachmentProviderProps, AttachmentRemoveProps, AttachmentScreenshotStatus, AttachmentVariant, AttachmentsProps, };