@ciridae/ui-agent 0.3.2 → 0.3.6

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 (250) hide show
  1. package/README.md +8 -2
  2. package/dist/ciridae-agent.css +5 -0
  3. package/dist/ciridae-agent.css.d.ts +2 -0
  4. package/dist/components/agentic/agent-card.d.ts +28 -0
  5. package/dist/components/agentic/agent-card.js +27 -0
  6. package/dist/components/agentic/agent-composer.d.ts +42 -0
  7. package/dist/components/agentic/agent-composer.js +89 -0
  8. package/dist/components/agentic/agent-context.d.ts +28 -0
  9. package/dist/components/agentic/agent-context.js +102 -0
  10. package/dist/components/agentic/agent-plan.js +1 -1
  11. package/dist/components/agentic/approval-request.d.ts +1 -1
  12. package/dist/components/agentic/assistant-mark-icon.d.ts +9 -0
  13. package/dist/components/agentic/assistant-mark-icon.js +12 -0
  14. package/dist/components/agentic/attachments-actions.d.ts +10 -0
  15. package/dist/components/agentic/attachments-actions.js +142 -0
  16. package/dist/components/agentic/attachments-context.d.ts +25 -0
  17. package/dist/components/agentic/attachments-context.js +196 -0
  18. package/dist/components/agentic/attachments-model.d.ts +23 -0
  19. package/dist/components/agentic/attachments-model.js +226 -0
  20. package/dist/components/agentic/attachments-preview.d.ts +7 -0
  21. package/dist/components/agentic/attachments-preview.js +25 -0
  22. package/dist/components/agentic/attachments-types.d.ts +87 -0
  23. package/dist/components/agentic/attachments-types.js +1 -0
  24. package/dist/components/agentic/attachments-ui.d.ts +14 -0
  25. package/dist/components/agentic/attachments-ui.js +90 -0
  26. package/dist/components/agentic/attachments.d.ts +5 -124
  27. package/dist/components/agentic/attachments.js +5 -591
  28. package/dist/components/agentic/audio-player.d.ts +16 -0
  29. package/dist/components/agentic/audio-player.js +21 -0
  30. package/dist/components/agentic/breathing-grid-icon.css +45 -0
  31. package/dist/components/agentic/breathing-grid-icon.css.d.ts +2 -0
  32. package/dist/components/agentic/breathing-grid-icon.d.ts +6 -0
  33. package/dist/components/agentic/breathing-grid-icon.js +7 -0
  34. package/dist/components/agentic/canvas.d.ts +10 -0
  35. package/dist/components/agentic/canvas.js +22 -0
  36. package/dist/components/agentic/code-block.js +1 -1
  37. package/dist/components/agentic/commit.d.ts +57 -0
  38. package/dist/components/agentic/commit.js +85 -0
  39. package/dist/components/agentic/connection.d.ts +3 -0
  40. package/dist/components/agentic/connection.js +8 -0
  41. package/dist/components/agentic/controls.d.ts +6 -0
  42. package/dist/components/agentic/controls.js +7 -0
  43. package/dist/components/agentic/conversation.d.ts +1 -1
  44. package/dist/components/agentic/edge.d.ts +8 -0
  45. package/dist/components/agentic/edge.js +65 -0
  46. package/dist/components/agentic/effort-selector.d.ts +43 -0
  47. package/dist/components/agentic/effort-selector.js +47 -0
  48. package/dist/components/agentic/environment-variables.d.ts +32 -0
  49. package/dist/components/agentic/environment-variables.js +66 -0
  50. package/dist/components/agentic/jsx-preview.d.ts +19 -0
  51. package/dist/components/agentic/jsx-preview.js +34 -0
  52. package/dist/components/agentic/message.d.ts +4 -4
  53. package/dist/components/agentic/message.js +48 -8
  54. package/dist/components/agentic/mic-selector.d.ts +58 -0
  55. package/dist/components/agentic/mic-selector.js +173 -0
  56. package/dist/components/agentic/node.d.ts +26 -0
  57. package/dist/components/agentic/node.js +29 -0
  58. package/dist/components/agentic/open-in-chat.d.ts +9 -0
  59. package/dist/components/agentic/open-in-chat.js +8 -0
  60. package/dist/components/agentic/package-info.d.ts +30 -0
  61. package/dist/components/agentic/package-info.js +44 -0
  62. package/dist/components/agentic/panel.d.ts +6 -0
  63. package/dist/components/agentic/panel.js +7 -0
  64. package/dist/components/agentic/persona.d.ts +16 -0
  65. package/dist/components/agentic/persona.js +116 -0
  66. package/dist/components/agentic/prompt-input-select.js +1 -1
  67. package/dist/components/agentic/prompt-input.d.ts +9 -9
  68. package/dist/components/agentic/prompt-input.js +7 -7
  69. package/dist/components/agentic/reasoning.d.ts +1 -1
  70. package/dist/components/agentic/reasoning.js +2 -2
  71. package/dist/components/agentic/run-checkpoint.d.ts +1 -1
  72. package/dist/components/agentic/shimmer.d.ts +2 -2
  73. package/dist/components/agentic/speech-input.d.ts +24 -0
  74. package/dist/components/agentic/speech-input.js +30 -0
  75. package/dist/components/agentic/stack-trace.d.ts +27 -0
  76. package/dist/components/agentic/stack-trace.js +76 -0
  77. package/dist/components/agentic/suggestion.d.ts +12 -0
  78. package/dist/components/agentic/suggestion.js +15 -0
  79. package/dist/components/agentic/test-results.d.ts +51 -0
  80. package/dist/components/agentic/test-results.js +83 -0
  81. package/dist/components/agentic/theme.d.ts +5 -0
  82. package/dist/components/agentic/theme.js +31 -0
  83. package/dist/components/agentic/tool.d.ts +1 -1
  84. package/dist/components/agentic/toolbar.d.ts +6 -0
  85. package/dist/components/agentic/toolbar.js +7 -0
  86. package/dist/components/agentic/transcription.d.ts +20 -0
  87. package/dist/components/agentic/transcription.js +32 -0
  88. package/dist/components/agentic/use-controllable-state.d.ts +6 -0
  89. package/dist/components/agentic/use-controllable-state.js +13 -0
  90. package/dist/components/agentic/voice-selector.d.ts +69 -0
  91. package/dist/components/agentic/voice-selector.js +122 -0
  92. package/dist/components/blocks/artifact-workbench.d.ts +9 -0
  93. package/dist/components/blocks/artifact-workbench.js +28 -0
  94. package/dist/components/blocks/tool-approval-panel.d.ts +11 -0
  95. package/dist/components/blocks/tool-approval-panel.js +11 -0
  96. package/dist/components/blocks/voice-agent-panel.d.ts +14 -0
  97. package/dist/components/blocks/voice-agent-panel.js +60 -0
  98. package/dist/components/blocks/workflow-canvas-panel.d.ts +18 -0
  99. package/dist/components/blocks/workflow-canvas-panel.js +106 -0
  100. package/dist/entries/agent-card.d.ts +1 -0
  101. package/dist/entries/agent-card.js +1 -0
  102. package/dist/entries/agent-composer.d.ts +1 -0
  103. package/dist/entries/agent-composer.js +1 -0
  104. package/dist/entries/agent-context.d.ts +1 -0
  105. package/dist/entries/agent-context.js +1 -0
  106. package/dist/entries/agent-plan.d.ts +1 -0
  107. package/dist/entries/agent-plan.js +1 -0
  108. package/dist/entries/agent-queue.d.ts +1 -0
  109. package/dist/entries/agent-queue.js +1 -0
  110. package/dist/entries/agent-task.d.ts +1 -0
  111. package/dist/entries/agent-task.js +1 -0
  112. package/dist/entries/agentic-types.d.ts +1 -0
  113. package/dist/entries/agentic-types.js +1 -0
  114. package/dist/entries/approval-request.d.ts +1 -0
  115. package/dist/entries/approval-request.js +1 -0
  116. package/dist/entries/artifact-workbench.d.ts +1 -0
  117. package/dist/entries/artifact-workbench.js +1 -0
  118. package/dist/entries/artifact.d.ts +1 -0
  119. package/dist/entries/artifact.js +1 -0
  120. package/dist/entries/assistant-mark-icon.d.ts +1 -0
  121. package/dist/entries/assistant-mark-icon.js +1 -0
  122. package/dist/entries/attachments-actions.d.ts +1 -0
  123. package/dist/entries/attachments-actions.js +1 -0
  124. package/dist/entries/attachments-context.d.ts +1 -0
  125. package/dist/entries/attachments-context.js +1 -0
  126. package/dist/entries/attachments-model.d.ts +1 -0
  127. package/dist/entries/attachments-model.js +1 -0
  128. package/dist/entries/attachments-preview.d.ts +1 -0
  129. package/dist/entries/attachments-preview.js +1 -0
  130. package/dist/entries/attachments-types.d.ts +1 -0
  131. package/dist/entries/attachments-types.js +1 -0
  132. package/dist/entries/attachments-ui.d.ts +1 -0
  133. package/dist/entries/attachments-ui.js +1 -0
  134. package/dist/entries/attachments.d.ts +1 -0
  135. package/dist/entries/attachments.js +1 -0
  136. package/dist/entries/audio-player.d.ts +1 -0
  137. package/dist/entries/audio-player.js +1 -0
  138. package/dist/entries/breathing-grid-icon.d.ts +1 -0
  139. package/dist/entries/breathing-grid-icon.js +1 -0
  140. package/dist/entries/canvas.d.ts +1 -0
  141. package/dist/entries/canvas.js +1 -0
  142. package/dist/entries/clipboard.d.ts +1 -0
  143. package/dist/entries/clipboard.js +1 -0
  144. package/dist/entries/code-block.d.ts +1 -0
  145. package/dist/entries/code-block.js +1 -0
  146. package/dist/entries/commit.d.ts +1 -0
  147. package/dist/entries/commit.js +1 -0
  148. package/dist/entries/connection.d.ts +1 -0
  149. package/dist/entries/connection.js +1 -0
  150. package/dist/entries/controls.d.ts +1 -0
  151. package/dist/entries/controls.js +1 -0
  152. package/dist/entries/conversation.d.ts +1 -0
  153. package/dist/entries/conversation.js +1 -0
  154. package/dist/entries/edge.d.ts +1 -0
  155. package/dist/entries/edge.js +1 -0
  156. package/dist/entries/effort-selector.d.ts +1 -0
  157. package/dist/entries/effort-selector.js +1 -0
  158. package/dist/entries/environment-variables.d.ts +1 -0
  159. package/dist/entries/environment-variables.js +1 -0
  160. package/dist/entries/file-tree.d.ts +1 -0
  161. package/dist/entries/file-tree.js +1 -0
  162. package/dist/entries/image.d.ts +1 -0
  163. package/dist/entries/image.js +1 -0
  164. package/dist/entries/inline-citation.d.ts +1 -0
  165. package/dist/entries/inline-citation.js +1 -0
  166. package/dist/entries/jsx-preview.d.ts +1 -0
  167. package/dist/entries/jsx-preview.js +1 -0
  168. package/dist/entries/message-branch.d.ts +1 -0
  169. package/dist/entries/message-branch.js +1 -0
  170. package/dist/entries/message.d.ts +1 -0
  171. package/dist/entries/message.js +1 -0
  172. package/dist/entries/mic-selector.d.ts +1 -0
  173. package/dist/entries/mic-selector.js +1 -0
  174. package/dist/entries/model-selector.d.ts +1 -0
  175. package/dist/entries/model-selector.js +1 -0
  176. package/dist/entries/node.d.ts +1 -0
  177. package/dist/entries/node.js +1 -0
  178. package/dist/entries/open-in-chat.d.ts +1 -0
  179. package/dist/entries/open-in-chat.js +1 -0
  180. package/dist/entries/package-info.d.ts +1 -0
  181. package/dist/entries/package-info.js +1 -0
  182. package/dist/entries/panel.d.ts +1 -0
  183. package/dist/entries/panel.js +1 -0
  184. package/dist/entries/persona.d.ts +1 -0
  185. package/dist/entries/persona.js +1 -0
  186. package/dist/entries/prompt-input-action-menu.d.ts +1 -0
  187. package/dist/entries/prompt-input-action-menu.js +1 -0
  188. package/dist/entries/prompt-input-command.d.ts +1 -0
  189. package/dist/entries/prompt-input-command.js +1 -0
  190. package/dist/entries/prompt-input-hover-card.d.ts +1 -0
  191. package/dist/entries/prompt-input-hover-card.js +1 -0
  192. package/dist/entries/prompt-input-select.d.ts +1 -0
  193. package/dist/entries/prompt-input-select.js +1 -0
  194. package/dist/entries/prompt-input-tabs.d.ts +1 -0
  195. package/dist/entries/prompt-input-tabs.js +1 -0
  196. package/dist/entries/prompt-input.d.ts +1 -0
  197. package/dist/entries/prompt-input.js +1 -0
  198. package/dist/entries/reasoning.d.ts +1 -0
  199. package/dist/entries/reasoning.js +1 -0
  200. package/dist/entries/run-checkpoint.d.ts +1 -0
  201. package/dist/entries/run-checkpoint.js +1 -0
  202. package/dist/entries/run-trace.d.ts +1 -0
  203. package/dist/entries/run-trace.js +1 -0
  204. package/dist/entries/sandbox.d.ts +1 -0
  205. package/dist/entries/sandbox.js +1 -0
  206. package/dist/entries/schema-display.d.ts +1 -0
  207. package/dist/entries/schema-display.js +1 -0
  208. package/dist/entries/shimmer.d.ts +1 -0
  209. package/dist/entries/shimmer.js +1 -0
  210. package/dist/entries/snippet.d.ts +1 -0
  211. package/dist/entries/snippet.js +1 -0
  212. package/dist/entries/sources.d.ts +1 -0
  213. package/dist/entries/sources.js +1 -0
  214. package/dist/entries/speech-input.d.ts +1 -0
  215. package/dist/entries/speech-input.js +1 -0
  216. package/dist/entries/stack-trace.d.ts +1 -0
  217. package/dist/entries/stack-trace.js +1 -0
  218. package/dist/entries/suggestion.d.ts +1 -0
  219. package/dist/entries/suggestion.js +1 -0
  220. package/dist/entries/terminal.d.ts +1 -0
  221. package/dist/entries/terminal.js +1 -0
  222. package/dist/entries/test-results.d.ts +1 -0
  223. package/dist/entries/test-results.js +1 -0
  224. package/dist/entries/theme.d.ts +1 -0
  225. package/dist/entries/theme.js +1 -0
  226. package/dist/entries/tool-approval-panel.d.ts +1 -0
  227. package/dist/entries/tool-approval-panel.js +1 -0
  228. package/dist/entries/tool.d.ts +1 -0
  229. package/dist/entries/tool.js +1 -0
  230. package/dist/entries/toolbar.d.ts +1 -0
  231. package/dist/entries/toolbar.js +1 -0
  232. package/dist/entries/transcription.d.ts +1 -0
  233. package/dist/entries/transcription.js +1 -0
  234. package/dist/entries/types.d.ts +1 -0
  235. package/dist/entries/types.js +1 -0
  236. package/dist/entries/use-controllable-state.d.ts +1 -0
  237. package/dist/entries/use-controllable-state.js +1 -0
  238. package/dist/entries/voice-agent-panel.d.ts +1 -0
  239. package/dist/entries/voice-agent-panel.js +1 -0
  240. package/dist/entries/voice-selector.d.ts +1 -0
  241. package/dist/entries/voice-selector.js +1 -0
  242. package/dist/entries/web-preview.d.ts +1 -0
  243. package/dist/entries/web-preview.js +1 -0
  244. package/dist/entries/workflow-canvas-panel.d.ts +1 -0
  245. package/dist/entries/workflow-canvas-panel.js +1 -0
  246. package/dist/style-imports.d.ts +3 -0
  247. package/dist/styled-system/styles.css +422 -0
  248. package/dist/styled-system/styles.css.d.ts +2 -0
  249. package/dist/styles.css +7 -0
  250. package/package.json +17 -137
@@ -0,0 +1,45 @@
1
+ [data-slot="breathing-grid-icon"] > rect {
2
+ animation: ciridae-thinking-grid 1.35s var(--motion-ease-standard, ease-in-out) infinite;
3
+ opacity: 0.35;
4
+ transform-box: fill-box;
5
+ transform-origin: center;
6
+ }
7
+
8
+ [data-slot="breathing-grid-icon"] > rect:nth-child(2),
9
+ [data-slot="breathing-grid-icon"] > rect:nth-child(4) {
10
+ animation-delay: 90ms;
11
+ }
12
+
13
+ [data-slot="breathing-grid-icon"] > rect:nth-child(3),
14
+ [data-slot="breathing-grid-icon"] > rect:nth-child(5),
15
+ [data-slot="breathing-grid-icon"] > rect:nth-child(7) {
16
+ animation-delay: 180ms;
17
+ }
18
+
19
+ [data-slot="breathing-grid-icon"] > rect:nth-child(6),
20
+ [data-slot="breathing-grid-icon"] > rect:nth-child(8) {
21
+ animation-delay: 270ms;
22
+ }
23
+
24
+ [data-slot="breathing-grid-icon"] > rect:nth-child(9) {
25
+ animation-delay: 360ms;
26
+ }
27
+
28
+ @keyframes ciridae-thinking-grid {
29
+ 0%,
30
+ 100% {
31
+ opacity: 0.28;
32
+ transform: scale(0.68);
33
+ }
34
+
35
+ 42% {
36
+ opacity: 0.94;
37
+ transform: scale(1);
38
+ }
39
+ }
40
+
41
+ @media (prefers-reduced-motion: reduce) {
42
+ [data-slot="breathing-grid-icon"] > rect {
43
+ animation: none;
44
+ }
45
+ }
@@ -0,0 +1,2 @@
1
+ declare const stylesheet: string;
2
+ export default stylesheet;
@@ -0,0 +1,6 @@
1
+ import type { AriaAttributes, ComponentProps } from "react";
2
+ import "./breathing-grid-icon.css";
3
+ type BreathingGridIconProps = Omit<ComponentProps<"svg">, "children" | "dangerouslySetInnerHTML" | "role" | keyof AriaAttributes>;
4
+ declare function BreathingGridIcon({ className, ...props }: BreathingGridIconProps): import("@types/react").JSX.Element;
5
+ export { BreathingGridIcon };
6
+ export type { BreathingGridIconProps };
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import "./breathing-grid-icon.css";
3
+ import { cn } from "@ciridae/ui/utils";
4
+ function BreathingGridIcon({ className, ...props }) {
5
+ return (_jsxs("svg", { ...props, "aria-hidden": "true", className: cn("size-4 shrink-0 text-muted-foreground/75", className), "data-slot": "breathing-grid-icon", fill: "currentColor", viewBox: "0 0 16 16", children: [_jsx("rect", { height: "3", rx: "0.75", width: "3", x: "1", y: "1" }), _jsx("rect", { height: "3", rx: "0.75", width: "3", x: "6.5", y: "1" }), _jsx("rect", { height: "3", rx: "0.75", width: "3", x: "12", y: "1" }), _jsx("rect", { height: "3", rx: "0.75", width: "3", x: "1", y: "6.5" }), _jsx("rect", { height: "3", rx: "0.75", width: "3", x: "6.5", y: "6.5" }), _jsx("rect", { height: "3", rx: "0.75", width: "3", x: "12", y: "6.5" }), _jsx("rect", { height: "3", rx: "0.75", width: "3", x: "1", y: "12" }), _jsx("rect", { height: "3", rx: "0.75", width: "3", x: "6.5", y: "12" }), _jsx("rect", { height: "3", rx: "0.75", width: "3", x: "12", y: "12" })] }));
6
+ }
7
+ export { BreathingGridIcon };
@@ -0,0 +1,10 @@
1
+ import { type ReactNode } from "react";
2
+ import { type Edge as FlowEdge, type Node as FlowNode, type ReactFlowProps } from "@xyflow/react";
3
+ import "@xyflow/react/dist/style.css";
4
+ type CanvasProps<NodeType extends FlowNode = FlowNode, EdgeType extends FlowEdge = FlowEdge> = ReactFlowProps<NodeType, EdgeType> & {
5
+ children?: ReactNode;
6
+ showBackground?: boolean;
7
+ };
8
+ declare function Canvas<NodeType extends FlowNode = FlowNode, EdgeType extends FlowEdge = FlowEdge>({ children, className, colorMode, deleteKeyCode, defaultMarkerColor, fitView, maxZoom, minZoom, proOptions, showBackground, style, ...props }: CanvasProps<NodeType, EdgeType>): import("@types/react").JSX.Element;
9
+ export { Canvas };
10
+ export type { CanvasProps };
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Background, BackgroundVariant, ReactFlow, } from "@xyflow/react";
3
+ import "@xyflow/react/dist/style.css";
4
+ import { useAgenticTheme } from "./theme";
5
+ import { cn } from "@ciridae/ui/utils";
6
+ const defaultDeleteKeyCode = ["Backspace", "Delete"];
7
+ const workflowEdgeColor = "color-mix(in oklch, var(--foreground) 72%, transparent)";
8
+ const workflowEdgeColorVariable = "var(--agentic-workflow-edge-color)";
9
+ function Canvas({ children, className, colorMode, deleteKeyCode = defaultDeleteKeyCode, defaultMarkerColor, fitView = true, maxZoom = 1.5, minZoom = 0.35, proOptions = { hideAttribution: true }, showBackground = true, style, ...props }) {
10
+ const resolvedColorMode = useCanvasColorMode(colorMode);
11
+ const canvasStyle = {
12
+ "--agentic-workflow-edge-color": workflowEdgeColor,
13
+ ...style,
14
+ };
15
+ const markerColor = defaultMarkerColor === undefined ? workflowEdgeColorVariable : defaultMarkerColor;
16
+ return (_jsxs(ReactFlow, { colorMode: resolvedColorMode, deleteKeyCode: deleteKeyCode, defaultMarkerColor: markerColor, fitView: fitView, maxZoom: maxZoom, minZoom: minZoom, proOptions: proOptions, style: canvasStyle, "data-slot": "canvas", className: cn("min-h-80 w-full min-w-0 rounded-lg border bg-background text-foreground", "[&_.react-flow__pane]:cursor-grab [&_.react-flow__pane.react-flow__pane-dragging]:cursor-grabbing", className), ...props, children: [showBackground ? (_jsx(Background, { className: "text-border opacity-80", color: "currentColor", gap: 24, size: 1, variant: BackgroundVariant.Dots })) : null, children] }));
17
+ }
18
+ function useCanvasColorMode(colorMode) {
19
+ const documentTheme = useAgenticTheme();
20
+ return colorMode ?? documentTheme;
21
+ }
22
+ export { Canvas };
@@ -3,7 +3,7 @@ import { CheckIcon, CopyIcon } from "lucide-react";
3
3
  import { createContext, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, } from "react";
4
4
  import { codeToHtml } from "shiki";
5
5
  import { Button } from "@ciridae/ui/button";
6
- import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@ciridae/ui/select";
6
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@ciridae/ui/select";
7
7
  import { cn } from "@ciridae/ui/utils";
8
8
  import { css } from "@ciridae/ui/styled-system/css";
9
9
  import { copyToClipboard } from "./clipboard";
@@ -0,0 +1,57 @@
1
+ import { FileIcon } from "lucide-react";
2
+ import type * as React from "react";
3
+ import { Avatar } from "@ciridae/ui/avatar";
4
+ import { Button } from "@ciridae/ui/button";
5
+ import { Collapsible, CollapsibleContent } from "@ciridae/ui/collapsible";
6
+ type CommitProps = React.ComponentProps<typeof Collapsible> & {
7
+ hash?: string;
8
+ };
9
+ type CommitHeaderProps = React.ComponentProps<"div">;
10
+ type CommitHashProps = React.ComponentProps<"span">;
11
+ type CommitMessageProps = React.ComponentProps<"span">;
12
+ type CommitMetadataProps = React.ComponentProps<"div">;
13
+ type CommitSeparatorProps = React.ComponentProps<"span">;
14
+ type CommitInfoProps = React.ComponentProps<"div">;
15
+ type CommitAuthorProps = React.ComponentProps<"div">;
16
+ type CommitAuthorAvatarProps = React.ComponentProps<typeof Avatar> & {
17
+ fallback?: string;
18
+ src?: string;
19
+ };
20
+ type CommitTimestampProps = React.ComponentProps<"time">;
21
+ type CommitActionsProps = React.ComponentProps<"div">;
22
+ type CommitCopyButtonProps = React.ComponentProps<typeof Button>;
23
+ type CommitContentProps = React.ComponentProps<typeof CollapsibleContent>;
24
+ type CommitFilesProps = React.ComponentProps<"div">;
25
+ type CommitFileProps = React.ComponentProps<"div">;
26
+ type CommitFileInfoProps = React.ComponentProps<"div">;
27
+ type CommitFileStatusProps = React.ComponentProps<"span"> & {
28
+ status?: "added" | "deleted" | "modified" | "renamed";
29
+ };
30
+ type CommitFileIconProps = React.ComponentProps<typeof FileIcon>;
31
+ type CommitFilePathProps = React.ComponentProps<"span">;
32
+ type CommitFileChangesProps = React.ComponentProps<"div">;
33
+ type CommitFileAdditionsProps = React.ComponentProps<"span">;
34
+ type CommitFileDeletionsProps = React.ComponentProps<"span">;
35
+ declare function Commit({ children, className, defaultOpen, hash, ...props }: CommitProps): React.JSX.Element;
36
+ declare function CommitHeader({ children, className, ...props }: CommitHeaderProps): React.JSX.Element;
37
+ declare function CommitHash({ className, ...props }: CommitHashProps): React.JSX.Element;
38
+ declare function CommitMessage({ className, ...props }: CommitMessageProps): React.JSX.Element;
39
+ declare function CommitMetadata({ className, ...props }: CommitMetadataProps): React.JSX.Element;
40
+ declare function CommitSeparator(props: CommitSeparatorProps): React.JSX.Element;
41
+ declare function CommitInfo({ className, ...props }: CommitInfoProps): React.JSX.Element;
42
+ declare function CommitAuthor({ className, ...props }: CommitAuthorProps): React.JSX.Element;
43
+ declare function CommitAuthorAvatar({ fallback, src, ...props }: CommitAuthorAvatarProps): React.JSX.Element;
44
+ declare function CommitTimestamp(props: CommitTimestampProps): React.JSX.Element;
45
+ declare function CommitActions({ className, ...props }: CommitActionsProps): React.JSX.Element;
46
+ declare function CommitCopyButton({ children, onClick, type, ...props }: CommitCopyButtonProps): React.JSX.Element;
47
+ declare function CommitContent({ className, ...props }: CommitContentProps): React.JSX.Element;
48
+ declare function CommitFiles({ className, ...props }: CommitFilesProps): React.JSX.Element;
49
+ declare function CommitFile({ className, ...props }: CommitFileProps): React.JSX.Element;
50
+ declare function CommitFileInfo({ className, ...props }: CommitFileInfoProps): React.JSX.Element;
51
+ declare function CommitFileStatus({ className, status, ...props }: CommitFileStatusProps): React.JSX.Element;
52
+ declare function CommitFileIcon(props: CommitFileIconProps): React.JSX.Element;
53
+ declare function CommitFilePath({ className, ...props }: CommitFilePathProps): React.JSX.Element;
54
+ declare function CommitFileChanges({ className, ...props }: CommitFileChangesProps): React.JSX.Element;
55
+ declare function CommitFileAdditions({ className, ...props }: CommitFileAdditionsProps): React.JSX.Element;
56
+ declare function CommitFileDeletions({ className, ...props }: CommitFileDeletionsProps): React.JSX.Element;
57
+ export { Commit, CommitActions, CommitAuthor, CommitAuthorAvatar, CommitContent, CommitCopyButton, CommitFile, CommitFileAdditions, CommitFileChanges, CommitFileDeletions, CommitFileIcon, CommitFileInfo, CommitFilePath, CommitFiles, CommitFileStatus, CommitHash, CommitHeader, CommitInfo, CommitMessage, CommitMetadata, CommitSeparator, CommitTimestamp, };
@@ -0,0 +1,85 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CheckIcon, ChevronDownIcon, CopyIcon, FileIcon } from "lucide-react";
3
+ import { createContext, useContext, useMemo, useState } from "react";
4
+ import { Avatar, AvatarFallback, AvatarImage } from "@ciridae/ui/avatar";
5
+ import { Button } from "@ciridae/ui/button";
6
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@ciridae/ui/collapsible";
7
+ import { cn } from "@ciridae/ui/utils";
8
+ import { copyToClipboard } from "./clipboard";
9
+ const CommitContext = createContext({ hash: "" });
10
+ function Commit({ children, className, defaultOpen = true, hash = "", ...props }) {
11
+ const contextValue = useMemo(() => ({ hash }), [hash]);
12
+ return (_jsx(CommitContext.Provider, { value: contextValue, children: _jsx(Collapsible, { "data-slot": "commit", className: cn("rounded-lg border bg-card", className), defaultOpen: defaultOpen, ...props, children: children }) }));
13
+ }
14
+ function CommitHeader({ children, className, ...props }) {
15
+ return (_jsxs("div", { "data-slot": "commit-header", className: cn("flex w-full items-center justify-between gap-3 px-3 py-2 text-left", className), ...props, children: [children, _jsx(CollapsibleTrigger, { asChild: true, children: _jsx(Button, { "aria-label": "Toggle commit details", className: "group/commit-toggle shrink-0", size: "icon", type: "button", variant: "ghost", children: _jsx(ChevronDownIcon, { "aria-hidden": "true", className: "size-4 transition-transform group-data-[state=open]/commit-toggle:rotate-180" }) }) })] }));
16
+ }
17
+ function CommitHash({ className, ...props }) {
18
+ const { hash } = useContext(CommitContext);
19
+ return (_jsx("span", { "data-slot": "commit-hash", className: cn("font-mono text-xs text-muted-foreground", className), ...props, children: props.children ?? hash.slice(0, 7) }));
20
+ }
21
+ function CommitMessage({ className, ...props }) {
22
+ return (_jsx("span", { "data-slot": "commit-message", className: cn("truncate text-sm font-medium", className), ...props }));
23
+ }
24
+ function CommitMetadata({ className, ...props }) {
25
+ return (_jsx("div", { "data-slot": "commit-metadata", className: cn("flex flex-wrap items-center gap-2 text-xs text-muted-foreground", className), ...props }));
26
+ }
27
+ function CommitSeparator(props) {
28
+ return (_jsx("span", { "aria-hidden": "true", "data-slot": "commit-separator", ...props, children: "/" }));
29
+ }
30
+ function CommitInfo({ className, ...props }) {
31
+ return (_jsx("div", { "data-slot": "commit-info", className: cn("min-w-0 flex-1 space-y-1", className), ...props }));
32
+ }
33
+ function CommitAuthor({ className, ...props }) {
34
+ return (_jsx("div", { "data-slot": "commit-author", className: cn("inline-flex items-center gap-1.5", className), ...props }));
35
+ }
36
+ function CommitAuthorAvatar({ fallback = "A", src, ...props }) {
37
+ return (_jsxs(Avatar, { "data-slot": "commit-author-avatar", ...props, children: [src ? _jsx(AvatarImage, { alt: "", src: src }) : null, _jsx(AvatarFallback, { children: fallback })] }));
38
+ }
39
+ function CommitTimestamp(props) {
40
+ return _jsx("time", { "data-slot": "commit-timestamp", ...props });
41
+ }
42
+ function CommitActions({ className, ...props }) {
43
+ return (_jsx("div", { "data-slot": "commit-actions", className: cn("flex shrink-0 items-center gap-1", className), ...props }));
44
+ }
45
+ function CommitCopyButton({ children, onClick, type = "button", ...props }) {
46
+ const { hash } = useContext(CommitContext);
47
+ const [copied, setCopied] = useState(false);
48
+ const Icon = copied ? CheckIcon : CopyIcon;
49
+ return (_jsx(Button, { "aria-label": copied ? "Copied" : "Copy commit hash", size: "icon", variant: "ghost", ...props, type: type, onClick: (event) => {
50
+ onClick?.(event);
51
+ if (!event.defaultPrevented)
52
+ void copyToClipboard(hash, setCopied);
53
+ }, children: children ?? _jsx(Icon, { "aria-hidden": "true", className: "size-4" }) }));
54
+ }
55
+ function CommitContent({ className, ...props }) {
56
+ return (_jsx(CollapsibleContent, { "data-slot": "commit-content", className: cn("border-t p-3", className), ...props }));
57
+ }
58
+ function CommitFiles({ className, ...props }) {
59
+ return _jsx("div", { "data-slot": "commit-files", className: cn("grid gap-1", className), ...props });
60
+ }
61
+ function CommitFile({ className, ...props }) {
62
+ return (_jsx("div", { "data-slot": "commit-file", className: cn("flex min-w-0 items-center justify-between gap-3 rounded-md px-2 py-1 text-sm hover:bg-muted", className), ...props }));
63
+ }
64
+ function CommitFileInfo({ className, ...props }) {
65
+ return (_jsx("div", { "data-slot": "commit-file-info", className: cn("flex min-w-0 items-center gap-2", className), ...props }));
66
+ }
67
+ function CommitFileStatus({ className, status = "modified", ...props }) {
68
+ return (_jsx("span", { "data-slot": "commit-file-status", className: cn("text-meta text-muted-foreground", className), ...props, children: status }));
69
+ }
70
+ function CommitFileIcon(props) {
71
+ return _jsx(FileIcon, { "aria-hidden": "true", "data-slot": "commit-file-icon", ...props });
72
+ }
73
+ function CommitFilePath({ className, ...props }) {
74
+ return (_jsx("span", { "data-slot": "commit-file-path", className: cn("truncate font-mono text-xs", className), ...props }));
75
+ }
76
+ function CommitFileChanges({ className, ...props }) {
77
+ return (_jsx("div", { "data-slot": "commit-file-changes", className: cn("flex shrink-0 items-center gap-2 font-mono text-xs", className), ...props }));
78
+ }
79
+ function CommitFileAdditions({ className, ...props }) {
80
+ return (_jsx("span", { "data-slot": "commit-file-additions", className: cn("text-foreground", className), ...props }));
81
+ }
82
+ function CommitFileDeletions({ className, ...props }) {
83
+ return (_jsx("span", { "data-slot": "commit-file-deletions", className: cn("text-muted-foreground", className), ...props }));
84
+ }
85
+ export { Commit, CommitActions, CommitAuthor, CommitAuthorAvatar, CommitContent, CommitCopyButton, CommitFile, CommitFileAdditions, CommitFileChanges, CommitFileDeletions, CommitFileIcon, CommitFileInfo, CommitFilePath, CommitFiles, CommitFileStatus, CommitHash, CommitHeader, CommitInfo, CommitMessage, CommitMetadata, CommitSeparator, CommitTimestamp, };
@@ -0,0 +1,3 @@
1
+ import type { ConnectionLineComponentProps, Node as FlowNode } from "@xyflow/react";
2
+ declare function Connection<NodeType extends FlowNode = FlowNode>({ fromX, fromY, toX, toY, }: ConnectionLineComponentProps<NodeType>): import("@types/react").JSX.Element;
3
+ export { Connection };
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const half = 0.5;
3
+ function Connection({ fromX, fromY, toX, toY, }) {
4
+ const centerX = fromX + (toX - fromX) * half;
5
+ const path = `M ${fromX} ${fromY} C ${centerX} ${fromY}, ${centerX} ${toY}, ${toX} ${toY}`;
6
+ return (_jsx("path", { className: "fill-none stroke-foreground/70", d: path, "data-slot": "connection", strokeDasharray: "4 4", strokeLinecap: "round", strokeWidth: 1.5 }));
7
+ }
8
+ export { Connection };
@@ -0,0 +1,6 @@
1
+ import type * as React from "react";
2
+ import { Controls as ControlsPrimitive } from "@xyflow/react";
3
+ type ControlsProps = React.ComponentProps<typeof ControlsPrimitive>;
4
+ declare function Controls({ className, ...props }: ControlsProps): React.JSX.Element;
5
+ export { Controls };
6
+ export type { ControlsProps };
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Controls as ControlsPrimitive } from "@xyflow/react";
3
+ import { cn } from "@ciridae/ui/utils";
4
+ function Controls({ className, ...props }) {
5
+ return (_jsx(ControlsPrimitive, { "data-slot": "controls", className: cn("overflow-hidden rounded-lg border bg-card p-1 shadow-xs", "[&>button]:size-7 [&>button]:border-0! [&>button]:bg-transparent! [&>button]:text-foreground", "[&>button]:hover:bg-secondary! [&>button>svg]:max-h-4 [&>button>svg]:max-w-4", className), ...props }));
6
+ }
7
+ export { Controls };
@@ -1,6 +1,6 @@
1
1
  import type * as React from "react";
2
2
  import { StickToBottom } from "use-stick-to-bottom";
3
- import type { AgenticMessage } from "@ciridae/ui-agent/types";
3
+ import type { AgenticMessage } from "./types";
4
4
  import { Button } from "@ciridae/ui/button";
5
5
  type ConversationProps = React.ComponentProps<typeof StickToBottom>;
6
6
  type ConversationContentProps = React.ComponentProps<typeof StickToBottom.Content>;
@@ -0,0 +1,8 @@
1
+ import type { EdgeProps } from "@xyflow/react";
2
+ declare function Temporary({ id, markerEnd, sourcePosition, sourceX, sourceY, style, targetPosition, targetX, targetY, }: EdgeProps): import("@types/react").JSX.Element;
3
+ declare function Animated({ id, markerEnd, source, style, target }: EdgeProps): import("@types/react").JSX.Element | null;
4
+ declare const Edge: {
5
+ Animated: typeof Animated;
6
+ Temporary: typeof Temporary;
7
+ };
8
+ export { Edge };
@@ -0,0 +1,65 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { BaseEdge, getBezierPath, getSimpleBezierPath, Position, useInternalNode, } from "@xyflow/react";
3
+ function Temporary({ id, markerEnd, sourcePosition, sourceX, sourceY, style, targetPosition, targetX, targetY, }) {
4
+ const [edgePath] = getSimpleBezierPath({
5
+ sourcePosition,
6
+ sourceX,
7
+ sourceY,
8
+ targetPosition,
9
+ targetX,
10
+ targetY,
11
+ });
12
+ return _jsx(WorkflowBaseEdge, { id: id, markerEnd: markerEnd, path: edgePath, style: style });
13
+ }
14
+ function Animated({ id, markerEnd, source, style, target }) {
15
+ const sourceNode = useInternalNode(source);
16
+ const targetNode = useInternalNode(target);
17
+ if (!(sourceNode && targetNode))
18
+ return null;
19
+ const { sourcePos, sx, sy, targetPos, tx, ty } = getEdgeParams(sourceNode, targetNode);
20
+ const [edgePath] = getBezierPath({
21
+ sourcePosition: sourcePos,
22
+ sourceX: sx,
23
+ sourceY: sy,
24
+ targetPosition: targetPos,
25
+ targetX: tx,
26
+ targetY: ty,
27
+ });
28
+ return (_jsxs(_Fragment, { children: [_jsx(WorkflowBaseEdge, { id: id, markerEnd: markerEnd, path: edgePath, style: style }), _jsx("circle", { className: "fill-foreground/70 motion-reduce:hidden", r: "3", children: _jsx("animateMotion", { dur: "2.4s", path: edgePath, repeatCount: "indefinite" }) })] }));
29
+ }
30
+ function WorkflowBaseEdge({ className, id, markerEnd, path, style, }) {
31
+ return (_jsx(BaseEdge, { className: className, id: id, markerEnd: markerEnd, path: path, style: {
32
+ stroke: "var(--agentic-workflow-edge-color, color-mix(in oklch, var(--foreground) 72%, transparent))",
33
+ strokeWidth: 1.5,
34
+ ...style,
35
+ } }));
36
+ }
37
+ function getEdgeParams(source, target) {
38
+ const sourcePos = Position.Right;
39
+ const targetPos = Position.Left;
40
+ const [sx, sy] = getHandleCoordsByPosition(source, sourcePos);
41
+ const [tx, ty] = getHandleCoordsByPosition(target, targetPos);
42
+ return { sourcePos, sx, sy, targetPos, tx, ty };
43
+ }
44
+ function getHandleCoordsByPosition(node, handlePosition) {
45
+ const handleType = handlePosition === Position.Left ? "target" : "source";
46
+ const handle = node.internals.handleBounds?.[handleType]?.find((candidate) => candidate.position === handlePosition);
47
+ if (!handle)
48
+ return [node.internals.positionAbsolute.x, node.internals.positionAbsolute.y];
49
+ let offsetX = handle.width / 2;
50
+ let offsetY = handle.height / 2;
51
+ if (handlePosition === Position.Left)
52
+ offsetX = 0;
53
+ if (handlePosition === Position.Right)
54
+ offsetX = handle.width;
55
+ if (handlePosition === Position.Top)
56
+ offsetY = 0;
57
+ if (handlePosition === Position.Bottom)
58
+ offsetY = handle.height;
59
+ return [
60
+ node.internals.positionAbsolute.x + handle.x + offsetX,
61
+ node.internals.positionAbsolute.y + handle.y + offsetY,
62
+ ];
63
+ }
64
+ const Edge = { Animated, Temporary };
65
+ export { Edge };
@@ -0,0 +1,43 @@
1
+ import type * as React from "react";
2
+ import { Button } from "@ciridae/ui/button";
3
+ type EffortSelectorValue = "auto" | "low" | "medium" | "high" | "xhigh";
4
+ type EffortSelectorOption = {
5
+ label: string;
6
+ shortLabel: string;
7
+ value: EffortSelectorValue;
8
+ };
9
+ type EffortSelectorProps = Omit<React.ComponentProps<typeof Button>, "onChange" | "onClick" | "value"> & {
10
+ onValueChange: (value: EffortSelectorValue) => void;
11
+ showLabel?: boolean;
12
+ value: EffortSelectorValue;
13
+ };
14
+ type EffortSelectorIconProps = React.ComponentProps<"span"> & {
15
+ value: EffortSelectorValue;
16
+ };
17
+ declare const EFFORT_SELECTOR_OPTIONS: readonly [{
18
+ readonly value: "auto";
19
+ readonly label: "Auto";
20
+ readonly shortLabel: "";
21
+ }, {
22
+ readonly value: "low";
23
+ readonly label: "Low";
24
+ readonly shortLabel: "Low";
25
+ }, {
26
+ readonly value: "medium";
27
+ readonly label: "Medium";
28
+ readonly shortLabel: "Medium";
29
+ }, {
30
+ readonly value: "high";
31
+ readonly label: "High";
32
+ readonly shortLabel: "High";
33
+ }, {
34
+ readonly value: "xhigh";
35
+ readonly label: "Extra High";
36
+ readonly shortLabel: "Extra High";
37
+ }];
38
+ declare function EffortSelector({ className, disabled, onValueChange, showLabel, value, variant, ...props }: EffortSelectorProps): React.JSX.Element;
39
+ declare function EffortSelectorIcon({ className, value, ...props }: EffortSelectorIconProps): React.JSX.Element;
40
+ declare function getEffortSelectorOption(value: string | null | undefined): EffortSelectorOption;
41
+ declare function getNextEffortValue(value: EffortSelectorValue): "medium" | "auto" | "low" | "high" | "xhigh";
42
+ export { EFFORT_SELECTOR_OPTIONS, EffortSelector, EffortSelectorIcon, getEffortSelectorOption, getNextEffortValue, };
43
+ export type { EffortSelectorOption, EffortSelectorProps, EffortSelectorValue };
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from "@ciridae/ui/button";
3
+ import { cn } from "@ciridae/ui/utils";
4
+ const EFFORT_SELECTOR_OPTIONS = [
5
+ { value: "auto", label: "Auto", shortLabel: "" },
6
+ { value: "low", label: "Low", shortLabel: "Low" },
7
+ { value: "medium", label: "Medium", shortLabel: "Medium" },
8
+ { value: "high", label: "High", shortLabel: "High" },
9
+ { value: "xhigh", label: "Extra High", shortLabel: "Extra High" },
10
+ ];
11
+ function EffortSelector({ className, disabled, onValueChange, showLabel = true, value, variant = "ghost", ...props }) {
12
+ const selectedOption = getEffortSelectorOption(value);
13
+ return (_jsxs(Button, { "aria-label": `Effort: ${selectedOption.label}. Click to change.`, className: cn("h-7 w-auto justify-start gap-1 rounded-md px-1.5 text-xs", className), "data-slot": "effort-selector", disabled: disabled, onClick: () => onValueChange(getNextEffortValue(value)), title: `Effort: ${selectedOption.label}`, type: "button", variant: variant, ...props, children: [_jsx(EffortSelectorIcon, { value: value }), showLabel && selectedOption.shortLabel ? (_jsx("span", { className: "min-w-0 flex-none truncate text-left", "data-slot": "effort-selector-label", children: selectedOption.shortLabel })) : null] }));
14
+ }
15
+ function EffortSelectorIcon({ className, value, ...props }) {
16
+ const activeBars = getActiveBarCount(value);
17
+ return (_jsx("span", { "aria-hidden": "true", className: cn("flex size-4 shrink-0 items-end justify-center gap-0.5 text-muted-foreground", className), "data-slot": "effort-selector-icon", ...props, children: [1, 2, 3, 4].map((bar) => (_jsx("span", { className: cn("w-0.5 rounded-full bg-current transition-opacity", getBarHeightClassName(bar), bar <= activeBars ? "opacity-100" : "opacity-30") }, bar))) }));
18
+ }
19
+ function getEffortSelectorOption(value) {
20
+ return (EFFORT_SELECTOR_OPTIONS.find((option) => option.value === value) ?? EFFORT_SELECTOR_OPTIONS[0]);
21
+ }
22
+ function getNextEffortValue(value) {
23
+ const selectedIndex = EFFORT_SELECTOR_OPTIONS.findIndex((option) => option.value === value);
24
+ const nextIndex = (selectedIndex + 1) % EFFORT_SELECTOR_OPTIONS.length;
25
+ return EFFORT_SELECTOR_OPTIONS[nextIndex].value;
26
+ }
27
+ function getActiveBarCount(value) {
28
+ if (value === "auto")
29
+ return 0;
30
+ if (value === "low")
31
+ return 1;
32
+ if (value === "medium")
33
+ return 2;
34
+ if (value === "high")
35
+ return 3;
36
+ return 4;
37
+ }
38
+ function getBarHeightClassName(bar) {
39
+ if (bar === 1)
40
+ return "h-2";
41
+ if (bar === 2)
42
+ return "h-2.5";
43
+ if (bar === 3)
44
+ return "h-3";
45
+ return "h-3.5";
46
+ }
47
+ export { EFFORT_SELECTOR_OPTIONS, EffortSelector, EffortSelectorIcon, getEffortSelectorOption, getNextEffortValue, };
@@ -0,0 +1,32 @@
1
+ import type * as React from "react";
2
+ import { Badge } from "@ciridae/ui/badge";
3
+ import { Button } from "@ciridae/ui/button";
4
+ import { Switch } from "@ciridae/ui/switch";
5
+ type EnvironmentVariablesProps = React.ComponentProps<"div"> & {
6
+ defaultRevealed?: boolean;
7
+ };
8
+ type EnvironmentVariablesHeaderProps = React.ComponentProps<"div">;
9
+ type EnvironmentVariablesTitleProps = React.ComponentProps<"h3">;
10
+ type EnvironmentVariablesToggleProps = React.ComponentProps<typeof Switch>;
11
+ type EnvironmentVariablesContentProps = React.ComponentProps<"div">;
12
+ type EnvironmentVariableGroupProps = React.ComponentProps<"div">;
13
+ type EnvironmentVariableProps = React.ComponentProps<"div"> & {
14
+ value: string;
15
+ };
16
+ type EnvironmentVariableNameProps = React.ComponentProps<"span">;
17
+ type EnvironmentVariableValueProps = React.ComponentProps<"span">;
18
+ type EnvironmentVariableCopyButtonProps = React.ComponentProps<typeof Button>;
19
+ type EnvironmentVariableRequiredProps = React.ComponentProps<typeof Badge>;
20
+ declare function EnvironmentVariables({ children, className, defaultRevealed, ...props }: EnvironmentVariablesProps): React.JSX.Element;
21
+ declare function EnvironmentVariablesHeader({ className, ...props }: EnvironmentVariablesHeaderProps): React.JSX.Element;
22
+ declare function EnvironmentVariablesTitle({ className, ...props }: EnvironmentVariablesTitleProps): React.JSX.Element;
23
+ declare function EnvironmentVariablesToggle(props: EnvironmentVariablesToggleProps): React.JSX.Element;
24
+ declare function EnvironmentVariablesContent({ className, ...props }: EnvironmentVariablesContentProps): React.JSX.Element;
25
+ declare function EnvironmentVariableGroup({ className, ...props }: EnvironmentVariableGroupProps): React.JSX.Element;
26
+ declare function EnvironmentVariable({ children, className, value, ...props }: EnvironmentVariableProps): React.JSX.Element;
27
+ declare function EnvironmentVariableName({ className, ...props }: EnvironmentVariableNameProps): React.JSX.Element;
28
+ declare function EnvironmentVariableValue({ className, ...props }: EnvironmentVariableValueProps): React.JSX.Element;
29
+ declare function EnvironmentVariableCopyButton({ children, onClick, type, ...props }: EnvironmentVariableCopyButtonProps): React.JSX.Element;
30
+ declare function EnvironmentVariableRequired({ children, variant, ...props }: EnvironmentVariableRequiredProps): React.JSX.Element;
31
+ export { EnvironmentVariable, EnvironmentVariableCopyButton, EnvironmentVariableGroup, EnvironmentVariableName, EnvironmentVariableRequired, EnvironmentVariableValue, EnvironmentVariables, EnvironmentVariablesContent, EnvironmentVariablesHeader, EnvironmentVariablesTitle, EnvironmentVariablesToggle, };
32
+ export type { EnvironmentVariableCopyButtonProps, EnvironmentVariableGroupProps, EnvironmentVariableNameProps, EnvironmentVariableProps, EnvironmentVariableRequiredProps, EnvironmentVariableValueProps, EnvironmentVariablesContentProps, EnvironmentVariablesHeaderProps, EnvironmentVariablesProps, EnvironmentVariablesTitleProps, EnvironmentVariablesToggleProps, };
@@ -0,0 +1,66 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { CheckIcon, CopyIcon } from "lucide-react";
3
+ import { createContext, useContext, useMemo, useState } from "react";
4
+ import { Badge } from "@ciridae/ui/badge";
5
+ import { Button } from "@ciridae/ui/button";
6
+ import { Switch } from "@ciridae/ui/switch";
7
+ import { cn } from "@ciridae/ui/utils";
8
+ import { copyToClipboard } from "./clipboard";
9
+ const EnvironmentVariablesContext = createContext(null);
10
+ const EnvironmentVariableContext = createContext({ value: "" });
11
+ function useEnvironmentVariables() {
12
+ const context = useContext(EnvironmentVariablesContext);
13
+ if (!context)
14
+ throw new Error("EnvironmentVariables components must be used within EnvironmentVariables");
15
+ return context;
16
+ }
17
+ function EnvironmentVariables({ children, className, defaultRevealed = false, ...props }) {
18
+ const [revealed, setRevealed] = useState(defaultRevealed);
19
+ const contextValue = useMemo(() => ({ revealed, setRevealed }), [revealed]);
20
+ return (_jsx(EnvironmentVariablesContext.Provider, { value: contextValue, children: _jsx("div", { "data-slot": "environment-variables", className: cn("grid gap-3 rounded-lg border bg-card p-4", className), ...props, children: children }) }));
21
+ }
22
+ function EnvironmentVariablesHeader({ className, ...props }) {
23
+ return (_jsx("div", { "data-slot": "environment-variables-header", className: cn("flex items-center justify-between gap-3", className), ...props }));
24
+ }
25
+ function EnvironmentVariablesTitle({ className, ...props }) {
26
+ return (_jsx("h3", { "data-slot": "environment-variables-title", className: cn("text-sm font-medium", className), ...props }));
27
+ }
28
+ function EnvironmentVariablesToggle(props) {
29
+ const { revealed, setRevealed } = useEnvironmentVariables();
30
+ return (_jsx(Switch, { checked: revealed, "data-slot": "environment-variables-toggle", onCheckedChange: setRevealed, ...props }));
31
+ }
32
+ function EnvironmentVariablesContent({ className, ...props }) {
33
+ return (_jsx("div", { "data-slot": "environment-variables-content", className: cn("grid gap-2", className), ...props }));
34
+ }
35
+ function EnvironmentVariableGroup({ className, ...props }) {
36
+ return (_jsx("div", { "data-slot": "environment-variable-group", className: cn("grid gap-2", className), ...props }));
37
+ }
38
+ function EnvironmentVariable({ children, className, value, ...props }) {
39
+ const contextValue = useMemo(() => ({ value }), [value]);
40
+ return (_jsx(EnvironmentVariableContext.Provider, { value: contextValue, children: _jsx("div", { "data-slot": "environment-variable", className: cn("grid gap-1 rounded-md border bg-muted/30 p-2", className), ...props, children: children }) }));
41
+ }
42
+ function EnvironmentVariableName({ className, ...props }) {
43
+ return (_jsx("span", { "data-slot": "environment-variable-name", className: cn("font-mono text-xs font-medium", className), ...props }));
44
+ }
45
+ function EnvironmentVariableValue({ className, ...props }) {
46
+ const { revealed } = useEnvironmentVariables();
47
+ const { value } = useContext(EnvironmentVariableContext);
48
+ return (_jsx("span", { "data-slot": "environment-variable-value", className: cn("font-mono text-xs break-all text-muted-foreground", className), ...props, children: props.children ?? (revealed ? value : maskValue(value)) }));
49
+ }
50
+ function EnvironmentVariableCopyButton({ children, onClick, type = "button", ...props }) {
51
+ const { value } = useContext(EnvironmentVariableContext);
52
+ const [copied, setCopied] = useState(false);
53
+ const Icon = copied ? CheckIcon : CopyIcon;
54
+ return (_jsx(Button, { "aria-label": copied ? "Copied" : "Copy variable", size: "icon", variant: "ghost", ...props, type: type, onClick: (event) => {
55
+ onClick?.(event);
56
+ if (!event.defaultPrevented)
57
+ void copyToClipboard(value, setCopied);
58
+ }, children: children ?? _jsx(Icon, { "aria-hidden": "true", className: "size-4" }) }));
59
+ }
60
+ function EnvironmentVariableRequired({ children = "required", variant = "outline", ...props }) {
61
+ return (_jsx(Badge, { "data-slot": "environment-variable-required", variant: variant, ...props, children: children }));
62
+ }
63
+ function maskValue(value) {
64
+ return value.length > 0 ? "••••••••••••" : "";
65
+ }
66
+ export { EnvironmentVariable, EnvironmentVariableCopyButton, EnvironmentVariableGroup, EnvironmentVariableName, EnvironmentVariableRequired, EnvironmentVariableValue, EnvironmentVariables, EnvironmentVariablesContent, EnvironmentVariablesHeader, EnvironmentVariablesTitle, EnvironmentVariablesToggle, };
@@ -0,0 +1,19 @@
1
+ import type * as React from "react";
2
+ import { type TProps as JsxParserProps } from "react-jsx-parser";
3
+ type JSXPreviewProps = React.ComponentProps<"div"> & {
4
+ bindings?: JsxParserProps["bindings"];
5
+ components?: JsxParserProps["components"];
6
+ jsx: string;
7
+ onError?: (error: Error) => void;
8
+ };
9
+ type JSXPreviewContentProps = Omit<React.ComponentProps<"div">, "children">;
10
+ type JSXPreviewErrorProps = React.ComponentProps<"div"> & {
11
+ fallback?: React.ReactNode;
12
+ };
13
+ declare function JSXPreview({ bindings, children, className, components, jsx, onError, ...props }: JSXPreviewProps): React.JSX.Element;
14
+ declare function JSXPreviewContent({ className, onError, ...props }: JSXPreviewContentProps & {
15
+ onError?: (error: Error) => void;
16
+ }): React.JSX.Element;
17
+ declare function JSXPreviewError({ className, fallback, ...props }: JSXPreviewErrorProps): React.JSX.Element | null;
18
+ export { JSXPreview, JSXPreviewContent, JSXPreviewError };
19
+ export type { JSXPreviewContentProps, JSXPreviewErrorProps, JSXPreviewProps };
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { AlertCircleIcon } from "lucide-react";
3
+ import { createContext, useContext, useEffect, useMemo, useState } from "react";
4
+ import JsxParser from "react-jsx-parser";
5
+ import { cn } from "@ciridae/ui/utils";
6
+ const JSXPreviewContext = createContext(null);
7
+ function useJSXPreview() {
8
+ const context = useContext(JSXPreviewContext);
9
+ if (!context)
10
+ throw new Error("JSXPreview components must be used within JSXPreview");
11
+ return context;
12
+ }
13
+ function JSXPreview({ bindings, children, className, components, jsx, onError, ...props }) {
14
+ const [error, setError] = useState(null);
15
+ useEffect(() => {
16
+ setError(null);
17
+ }, [jsx]);
18
+ const contextValue = useMemo(() => ({ bindings, components, error, jsx, setError }), [bindings, components, error, jsx]);
19
+ return (_jsx(JSXPreviewContext.Provider, { value: contextValue, children: _jsx("div", { "data-slot": "jsx-preview", className: cn("relative rounded-lg border bg-card p-4", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx(JSXPreviewContent, { onError: onError }), _jsx(JSXPreviewError, {})] })) }) }));
20
+ }
21
+ function JSXPreviewContent({ className, onError, ...props }) {
22
+ const { bindings, components, jsx, setError } = useJSXPreview();
23
+ return (_jsx("div", { "data-slot": "jsx-preview-content", className: cn("min-h-40", className), ...props, children: _jsx(JsxParser, { allowUnknownElements: false, bindings: bindings, blacklistedAttrs: [/^on.+/i, "style"], blacklistedTags: ["script", "style", "iframe"], components: components, componentsOnly: true, jsx: jsx, onError: (error) => {
24
+ setError(error);
25
+ onError?.(error);
26
+ }, renderInWrapper: false, showWarnings: false }) }));
27
+ }
28
+ function JSXPreviewError({ className, fallback, ...props }) {
29
+ const { error } = useJSXPreview();
30
+ if (!error)
31
+ return null;
32
+ return (_jsxs("div", { "data-slot": "jsx-preview-error", className: cn("mt-3 flex gap-2 rounded-md border p-3 text-sm text-muted-foreground", className), ...props, children: [_jsx(AlertCircleIcon, { "aria-hidden": "true", className: "size-4 shrink-0 text-destructive" }), _jsx("div", { className: "min-w-0", children: fallback ?? error.message })] }));
33
+ }
34
+ export { JSXPreview, JSXPreviewContent, JSXPreviewError };