@axis-ds/agentic-ui 1.1.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 (116) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -0
  3. package/dist/agent-avatar/index.d.mts +22 -0
  4. package/dist/agent-avatar/index.d.ts +22 -0
  5. package/dist/agent-avatar/index.js +112 -0
  6. package/dist/agent-avatar/index.mjs +7 -0
  7. package/dist/approval-card/index.d.mts +31 -0
  8. package/dist/approval-card/index.d.ts +31 -0
  9. package/dist/approval-card/index.js +133 -0
  10. package/dist/approval-card/index.mjs +7 -0
  11. package/dist/attachment-card/index.d.mts +30 -0
  12. package/dist/attachment-card/index.d.ts +30 -0
  13. package/dist/attachment-card/index.js +140 -0
  14. package/dist/attachment-card/index.mjs +7 -0
  15. package/dist/chunk-2BWCQQLU.mjs +136 -0
  16. package/dist/chunk-3TH7GFBD.mjs +83 -0
  17. package/dist/chunk-4PCJFQHQ.mjs +66 -0
  18. package/dist/chunk-657RY6MM.mjs +106 -0
  19. package/dist/chunk-7UGSLEYG.mjs +75 -0
  20. package/dist/chunk-D6GHMPBC.mjs +76 -0
  21. package/dist/chunk-DPENLPBM.mjs +105 -0
  22. package/dist/chunk-DPLGRVNQ.mjs +95 -0
  23. package/dist/chunk-EF4MECAI.mjs +81 -0
  24. package/dist/chunk-ENIWC4WX.mjs +94 -0
  25. package/dist/chunk-ETFET3LT.mjs +72 -0
  26. package/dist/chunk-FAJF5RCY.mjs +115 -0
  27. package/dist/chunk-FPOHPDZ2.mjs +109 -0
  28. package/dist/chunk-FYAMA32G.mjs +50 -0
  29. package/dist/chunk-GQYOOLDL.mjs +63 -0
  30. package/dist/chunk-H6VXOP7U.mjs +86 -0
  31. package/dist/chunk-HLW7VEFF.mjs +47 -0
  32. package/dist/chunk-HWISMHCP.mjs +33 -0
  33. package/dist/chunk-KH4OXDEV.mjs +83 -0
  34. package/dist/chunk-KJVPVBET.mjs +103 -0
  35. package/dist/chunk-LZKOCELQ.mjs +136 -0
  36. package/dist/chunk-MGQ7AEYE.mjs +94 -0
  37. package/dist/chunk-MVBXXDZB.mjs +83 -0
  38. package/dist/chunk-NRBIHROX.mjs +162 -0
  39. package/dist/chunk-O5VXD6C3.mjs +114 -0
  40. package/dist/chunk-O5WFJCWK.mjs +63 -0
  41. package/dist/chunk-OOFM7NNH.mjs +68 -0
  42. package/dist/chunk-PAKLXPHD.mjs +115 -0
  43. package/dist/chunk-PWKN5UHT.mjs +152 -0
  44. package/dist/chunk-RGBY6EEU.mjs +80 -0
  45. package/dist/chunk-RGPKTWK4.mjs +77 -0
  46. package/dist/chunk-S3HVRSN2.mjs +95 -0
  47. package/dist/chunk-SCZ4BQ2G.mjs +68 -0
  48. package/dist/chunk-TCCZL2D5.mjs +51 -0
  49. package/dist/chunk-TKUAT5WE.mjs +105 -0
  50. package/dist/chunk-UG4H7RIP.mjs +77 -0
  51. package/dist/chunk-VKLPWFAI.mjs +79 -0
  52. package/dist/code-block/index.d.mts +24 -0
  53. package/dist/code-block/index.d.ts +24 -0
  54. package/dist/code-block/index.js +114 -0
  55. package/dist/code-block/index.mjs +6 -0
  56. package/dist/context-panel/index.d.mts +32 -0
  57. package/dist/context-panel/index.d.ts +32 -0
  58. package/dist/context-panel/index.js +137 -0
  59. package/dist/context-panel/index.mjs +6 -0
  60. package/dist/diff-viewer/index.d.mts +21 -0
  61. package/dist/diff-viewer/index.d.ts +21 -0
  62. package/dist/diff-viewer/index.js +201 -0
  63. package/dist/diff-viewer/index.mjs +7 -0
  64. package/dist/feedback-buttons/index.d.mts +21 -0
  65. package/dist/feedback-buttons/index.d.ts +21 -0
  66. package/dist/feedback-buttons/index.js +111 -0
  67. package/dist/feedback-buttons/index.mjs +7 -0
  68. package/dist/index.d.mts +20 -0
  69. package/dist/index.d.ts +20 -0
  70. package/dist/index.js +1774 -0
  71. package/dist/index.mjs +75 -0
  72. package/dist/message-bubble/index.d.mts +29 -0
  73. package/dist/message-bubble/index.d.ts +29 -0
  74. package/dist/message-bubble/index.js +135 -0
  75. package/dist/message-bubble/index.mjs +7 -0
  76. package/dist/plan-card/index.d.mts +32 -0
  77. package/dist/plan-card/index.d.ts +32 -0
  78. package/dist/plan-card/index.js +202 -0
  79. package/dist/plan-card/index.mjs +7 -0
  80. package/dist/recovery-banner/index.d.mts +20 -0
  81. package/dist/recovery-banner/index.d.ts +20 -0
  82. package/dist/recovery-banner/index.js +109 -0
  83. package/dist/recovery-banner/index.mjs +6 -0
  84. package/dist/run-progress/index.d.mts +29 -0
  85. package/dist/run-progress/index.d.ts +29 -0
  86. package/dist/run-progress/index.js +179 -0
  87. package/dist/run-progress/index.mjs +7 -0
  88. package/dist/source-panel/index.d.mts +25 -0
  89. package/dist/source-panel/index.d.ts +25 -0
  90. package/dist/source-panel/index.js +135 -0
  91. package/dist/source-panel/index.mjs +7 -0
  92. package/dist/step-timeline/index.d.mts +21 -0
  93. package/dist/step-timeline/index.d.ts +21 -0
  94. package/dist/step-timeline/index.js +110 -0
  95. package/dist/step-timeline/index.mjs +7 -0
  96. package/dist/streaming-text/index.d.mts +27 -0
  97. package/dist/streaming-text/index.d.ts +27 -0
  98. package/dist/streaming-text/index.js +97 -0
  99. package/dist/streaming-text/index.mjs +6 -0
  100. package/dist/surface-renderer/index.d.mts +22 -0
  101. package/dist/surface-renderer/index.d.ts +22 -0
  102. package/dist/surface-renderer/index.js +107 -0
  103. package/dist/surface-renderer/index.mjs +6 -0
  104. package/dist/thinking-indicator/index.d.mts +16 -0
  105. package/dist/thinking-indicator/index.d.ts +16 -0
  106. package/dist/thinking-indicator/index.js +74 -0
  107. package/dist/thinking-indicator/index.mjs +6 -0
  108. package/dist/token-usage-indicator/index.d.mts +22 -0
  109. package/dist/token-usage-indicator/index.d.ts +22 -0
  110. package/dist/token-usage-indicator/index.js +110 -0
  111. package/dist/token-usage-indicator/index.mjs +6 -0
  112. package/dist/tool-call-card/index.d.mts +31 -0
  113. package/dist/tool-call-card/index.d.ts +31 -0
  114. package/dist/tool-call-card/index.js +158 -0
  115. package/dist/tool-call-card/index.mjs +7 -0
  116. package/package.json +130 -0
@@ -0,0 +1,152 @@
1
+ import {
2
+ PLAN_STATUS_LABELS,
3
+ STATUS_LABELS
4
+ } from "./chunk-SCZ4BQ2G.mjs";
5
+
6
+ // src/plan-card/index.tsx
7
+ import * as React from "react";
8
+ import { cn } from "@axis-ds/ui-react";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ var planStatusStyles = {
11
+ draft: {
12
+ border: "border-l-[var(--axis-color-gray-400)]",
13
+ badge: "bg-[var(--axis-color-gray-100)] text-[var(--axis-color-gray-600)]"
14
+ },
15
+ pending: {
16
+ border: "border-l-[var(--axis-color-yellow-500)]",
17
+ badge: "bg-[var(--axis-color-yellow-500)]/10 text-[var(--axis-color-yellow-600)]"
18
+ },
19
+ approved: {
20
+ border: "border-l-[var(--axis-color-green-500)]",
21
+ badge: "bg-[var(--axis-color-green-500)]/10 text-[var(--axis-color-green-600)]"
22
+ },
23
+ rejected: {
24
+ border: "border-l-[var(--axis-color-red-500)]",
25
+ badge: "bg-[var(--axis-color-red-500)]/10 text-[var(--axis-color-red-600)]"
26
+ },
27
+ executing: {
28
+ border: "border-l-[var(--axis-color-blue-500)]",
29
+ badge: "bg-[var(--axis-color-blue-500)]/10 text-[var(--axis-color-blue-600)]"
30
+ },
31
+ completed: {
32
+ border: "border-l-[var(--axis-color-green-500)]",
33
+ badge: "bg-[var(--axis-color-green-500)]/10 text-[var(--axis-color-green-600)]"
34
+ }
35
+ };
36
+ var stepStatusIcons = {
37
+ pending: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4 text-[var(--axis-color-gray-400)]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10", strokeWidth: 2 }) }),
38
+ running: /* @__PURE__ */ jsxs("svg", { className: "w-4 h-4 text-[var(--axis-color-blue-500)] animate-spin", viewBox: "0 0 24 24", fill: "none", children: [
39
+ /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
40
+ /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })
41
+ ] }),
42
+ complete: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4 text-[var(--axis-color-green-500)]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }),
43
+ error: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4 text-[var(--axis-color-red-500)]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }),
44
+ skipped: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4 text-[var(--axis-color-gray-400)]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 5l7 7-7 7M5 5l7 7-7 7" }) })
45
+ };
46
+ function PlanCard({
47
+ title,
48
+ steps,
49
+ status = "pending",
50
+ onApprove,
51
+ onEdit,
52
+ onReject,
53
+ className
54
+ }) {
55
+ const styles = planStatusStyles[status];
56
+ const titleId = React.useId();
57
+ const statusLabel = PLAN_STATUS_LABELS[status];
58
+ const completedCount = steps.filter((s) => s.status === "complete").length;
59
+ return /* @__PURE__ */ jsxs(
60
+ "div",
61
+ {
62
+ role: "region",
63
+ "aria-labelledby": titleId,
64
+ className: cn(
65
+ "rounded-lg border border-l-4 overflow-hidden",
66
+ "bg-[var(--axis-surface-default)] border-[var(--axis-border-default)]",
67
+ styles.border,
68
+ className
69
+ ),
70
+ children: [
71
+ /* @__PURE__ */ jsxs("div", { className: "p-4", children: [
72
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
73
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
74
+ /* @__PURE__ */ jsx("svg", { className: "w-4 h-4 text-[var(--axis-icon-secondary)]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) }),
75
+ /* @__PURE__ */ jsx("h4", { id: titleId, className: "text-sm font-semibold text-[var(--axis-text-primary)]", children: title })
76
+ ] }),
77
+ /* @__PURE__ */ jsx("span", { className: cn("text-xs px-2 py-0.5 rounded-full font-medium", styles.badge), children: statusLabel })
78
+ ] }),
79
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-[var(--axis-text-tertiary)]", children: [
80
+ /* @__PURE__ */ jsxs("span", { children: [
81
+ completedCount,
82
+ "/",
83
+ steps.length,
84
+ " \uB2E8\uACC4"
85
+ ] }),
86
+ steps.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex-1 h-1 rounded-full bg-[var(--axis-surface-secondary)] overflow-hidden", children: /* @__PURE__ */ jsx(
87
+ "div",
88
+ {
89
+ className: "h-full rounded-full bg-[var(--axis-color-green-500)] transition-all",
90
+ style: { width: `${completedCount / steps.length * 100}%` },
91
+ "aria-hidden": "true"
92
+ }
93
+ ) })
94
+ ] })
95
+ ] }),
96
+ /* @__PURE__ */ jsx("div", { role: "list", "aria-label": "\uC2E4\uD589 \uB2E8\uACC4", className: "border-t border-[var(--axis-border-default)] divide-y divide-[var(--axis-border-default)]", children: steps.map((step) => {
97
+ const stepStatusLabel = STATUS_LABELS[step.status] || step.status;
98
+ return /* @__PURE__ */ jsxs(
99
+ "div",
100
+ {
101
+ role: "listitem",
102
+ "aria-current": step.status === "running" ? "step" : void 0,
103
+ className: "flex items-start gap-3 px-4 py-2.5",
104
+ children: [
105
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "mt-0.5 flex-shrink-0", children: stepStatusIcons[step.status] }),
106
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
107
+ /* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
108
+ stepStatusLabel,
109
+ ":"
110
+ ] }),
111
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-[var(--axis-text-primary)]", children: step.label }),
112
+ step.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--axis-text-secondary)] mt-0.5", children: step.description })
113
+ ] })
114
+ ]
115
+ },
116
+ step.id
117
+ );
118
+ }) }),
119
+ (status === "pending" || status === "draft") && (onApprove || onEdit || onReject) && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 p-3 border-t border-[var(--axis-border-default)] bg-[var(--axis-surface-secondary)]", children: [
120
+ onApprove && /* @__PURE__ */ jsx(
121
+ "button",
122
+ {
123
+ onClick: onApprove,
124
+ className: "px-3 py-1.5 text-xs font-medium rounded-md bg-[var(--axis-color-green-500)] text-white hover:bg-[var(--axis-color-green-600)] transition-colors",
125
+ children: "\uC2B9\uC778"
126
+ }
127
+ ),
128
+ onEdit && /* @__PURE__ */ jsx(
129
+ "button",
130
+ {
131
+ onClick: onEdit,
132
+ className: "px-3 py-1.5 text-xs font-medium rounded-md bg-[var(--axis-button-secondary-bg-default)] text-[var(--axis-text-primary)] hover:bg-[var(--axis-button-secondary-bg-hover)] transition-colors",
133
+ children: "\uC218\uC815"
134
+ }
135
+ ),
136
+ onReject && /* @__PURE__ */ jsx(
137
+ "button",
138
+ {
139
+ onClick: onReject,
140
+ className: "px-3 py-1.5 text-xs font-medium rounded-md text-[var(--axis-color-red-500)] hover:bg-[var(--axis-color-red-500)]/10 transition-colors",
141
+ children: "\uAC70\uC808"
142
+ }
143
+ )
144
+ ] })
145
+ ]
146
+ }
147
+ );
148
+ }
149
+
150
+ export {
151
+ PlanCard
152
+ };
@@ -0,0 +1,80 @@
1
+ // src/code-block/index.tsx
2
+ import * as React from "react";
3
+ import { cn } from "@axis-ds/ui-react";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ function CodeBlock({
6
+ code,
7
+ language,
8
+ filename,
9
+ showLineNumbers = false,
10
+ onCopy,
11
+ maxHeight,
12
+ className
13
+ }) {
14
+ const [copied, setCopied] = React.useState(false);
15
+ const handleCopy = async () => {
16
+ try {
17
+ await navigator.clipboard.writeText(code);
18
+ setCopied(true);
19
+ onCopy?.(code);
20
+ setTimeout(() => setCopied(false), 2e3);
21
+ } catch {
22
+ }
23
+ };
24
+ const lines = code.split("\n");
25
+ return /* @__PURE__ */ jsxs(
26
+ "div",
27
+ {
28
+ className: cn(
29
+ "rounded-lg border overflow-hidden",
30
+ "bg-[var(--axis-surface-default)] border-[var(--axis-border-default)]",
31
+ className
32
+ ),
33
+ children: [
34
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-3 py-2 border-b border-[var(--axis-border-default)] bg-[var(--axis-surface-secondary)]", children: [
35
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
36
+ filename && /* @__PURE__ */ jsx("code", { className: "text-xs font-mono text-[var(--axis-text-primary)] truncate", children: filename }),
37
+ language && /* @__PURE__ */ jsx("span", { className: "text-xs px-1.5 py-0.5 rounded bg-[var(--axis-surface-tertiary)] text-[var(--axis-text-tertiary)]", children: language })
38
+ ] }),
39
+ /* @__PURE__ */ jsx(
40
+ "button",
41
+ {
42
+ onClick: handleCopy,
43
+ "aria-label": copied ? "\uBCF5\uC0AC\uB428" : "\uCF54\uB4DC \uBCF5\uC0AC",
44
+ className: "flex items-center gap-1 px-2 py-1 text-xs rounded-md text-[var(--axis-text-secondary)] hover:bg-[var(--axis-surface-tertiary)] transition-colors",
45
+ children: copied ? /* @__PURE__ */ jsxs(Fragment, { children: [
46
+ /* @__PURE__ */ jsx("svg", { className: "w-3.5 h-3.5 text-[var(--axis-color-green-500)]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }),
47
+ /* @__PURE__ */ jsx("span", { children: "\uBCF5\uC0AC\uB428" })
48
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
49
+ /* @__PURE__ */ jsx("svg", { className: "w-3.5 h-3.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" }) }),
50
+ /* @__PURE__ */ jsx("span", { children: "\uBCF5\uC0AC" })
51
+ ] })
52
+ }
53
+ )
54
+ ] }),
55
+ /* @__PURE__ */ jsx(
56
+ "div",
57
+ {
58
+ className: "overflow-auto",
59
+ style: maxHeight ? { maxHeight } : void 0,
60
+ children: /* @__PURE__ */ jsx("pre", { className: "p-3 text-sm leading-relaxed", children: /* @__PURE__ */ jsx("code", { className: "text-[var(--axis-text-primary)] font-mono", children: showLineNumbers ? /* @__PURE__ */ jsx("table", { className: "border-collapse w-full", role: "presentation", children: /* @__PURE__ */ jsx("tbody", { children: lines.map((line, i) => /* @__PURE__ */ jsxs("tr", { children: [
61
+ /* @__PURE__ */ jsx(
62
+ "td",
63
+ {
64
+ className: "select-none text-right pr-4 text-[var(--axis-text-tertiary)] w-8",
65
+ "aria-hidden": "true",
66
+ children: i + 1
67
+ }
68
+ ),
69
+ /* @__PURE__ */ jsx("td", { className: "whitespace-pre", children: line })
70
+ ] }, i)) }) }) : code }) })
71
+ }
72
+ )
73
+ ]
74
+ }
75
+ );
76
+ }
77
+
78
+ export {
79
+ CodeBlock
80
+ };
@@ -0,0 +1,77 @@
1
+ import {
2
+ STATUS_LABELS
3
+ } from "./chunk-SCZ4BQ2G.mjs";
4
+
5
+ // src/step-timeline/index.tsx
6
+ import { cn } from "@axis-ds/ui-react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ function StepTimeline({
9
+ steps,
10
+ orientation = "vertical",
11
+ className
12
+ }) {
13
+ const isVertical = orientation === "vertical";
14
+ return /* @__PURE__ */ jsx(
15
+ "div",
16
+ {
17
+ role: "list",
18
+ "aria-label": "\uC791\uC5C5 \uD0C0\uC784\uB77C\uC778",
19
+ className: cn(
20
+ isVertical ? "flex flex-col gap-4" : "flex items-center gap-2",
21
+ className
22
+ ),
23
+ children: steps.map((step, index) => /* @__PURE__ */ jsxs(
24
+ "div",
25
+ {
26
+ role: "listitem",
27
+ "aria-current": step.status === "running" ? "step" : void 0,
28
+ className: cn(
29
+ "relative flex",
30
+ isVertical ? "items-start gap-3" : "flex-col items-center"
31
+ ),
32
+ children: [
33
+ index < steps.length - 1 && /* @__PURE__ */ jsx(
34
+ "div",
35
+ {
36
+ "aria-hidden": "true",
37
+ className: cn(
38
+ "absolute bg-[var(--axis-border-default)]",
39
+ isVertical ? "left-2.5 top-6 w-0.5 h-full -translate-x-1/2" : "top-2.5 left-6 h-0.5 w-full"
40
+ )
41
+ }
42
+ ),
43
+ /* @__PURE__ */ jsx(
44
+ "div",
45
+ {
46
+ "aria-hidden": "true",
47
+ className: cn(
48
+ "relative z-10 w-5 h-5 rounded-full flex items-center justify-center",
49
+ step.status === "complete" && "bg-[var(--axis-color-green-500)]",
50
+ step.status === "running" && "bg-[var(--axis-color-blue-500)] animate-pulse",
51
+ step.status === "error" && "bg-[var(--axis-color-red-500)]",
52
+ step.status === "skipped" && "bg-[var(--axis-color-gray-300)]",
53
+ step.status === "pending" && "bg-[var(--axis-color-gray-300)]"
54
+ ),
55
+ children: step.status === "complete" && /* @__PURE__ */ jsx("svg", { className: "w-3 h-3 text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 3, d: "M5 13l4 4L19 7" }) })
56
+ }
57
+ ),
58
+ /* @__PURE__ */ jsxs("div", { className: cn(isVertical ? "flex-1" : "text-center mt-2"), children: [
59
+ /* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
60
+ STATUS_LABELS[step.status],
61
+ ":"
62
+ ] }),
63
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[var(--axis-text-primary)]", children: step.label }),
64
+ step.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--axis-text-secondary)]", children: step.description }),
65
+ step.timestamp && /* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--axis-text-tertiary)]", children: step.timestamp.toLocaleTimeString() })
66
+ ] })
67
+ ]
68
+ },
69
+ step.id
70
+ ))
71
+ }
72
+ );
73
+ }
74
+
75
+ export {
76
+ StepTimeline
77
+ };
@@ -0,0 +1,95 @@
1
+ import {
2
+ SOURCE_TYPE_LABELS
3
+ } from "./chunk-HWISMHCP.mjs";
4
+
5
+ // src/source-panel/index.tsx
6
+ import * as React from "react";
7
+ import { cn } from "@axis-ds/ui-react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ var sourceIcons = {
10
+ web: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" }) }),
11
+ file: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }),
12
+ database: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4" }) }),
13
+ api: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) })
14
+ };
15
+ function SourcePanel({
16
+ sources,
17
+ expandable = true,
18
+ defaultExpanded = false,
19
+ maxItems = 5,
20
+ className
21
+ }) {
22
+ const [isExpanded, setIsExpanded] = React.useState(defaultExpanded);
23
+ const displayedSources = isExpanded ? sources : sources.slice(0, maxItems);
24
+ const hasMore = sources.length > maxItems;
25
+ const listId = React.useId();
26
+ if (sources.length === 0) return null;
27
+ return /* @__PURE__ */ jsxs(
28
+ "div",
29
+ {
30
+ className: cn(
31
+ "rounded-lg border p-3",
32
+ "bg-[var(--axis-surface-secondary)] border-[var(--axis-border-default)]",
33
+ className
34
+ ),
35
+ children: [
36
+ /* @__PURE__ */ jsxs("h4", { className: "text-xs font-medium text-[var(--axis-text-secondary)] mb-2", children: [
37
+ "\uCD9C\uCC98 (",
38
+ sources.length,
39
+ "\uAC1C)"
40
+ ] }),
41
+ /* @__PURE__ */ jsx("div", { id: listId, role: "list", "aria-label": "\uCD9C\uCC98 \uBAA9\uB85D", className: "space-y-2", children: displayedSources.map((source) => /* @__PURE__ */ jsxs(
42
+ "div",
43
+ {
44
+ role: "listitem",
45
+ className: "flex items-start gap-2 p-2 rounded-md bg-[var(--axis-surface-default)]",
46
+ children: [
47
+ /* @__PURE__ */ jsx("span", { className: "text-[var(--axis-icon-secondary)] mt-0.5", "aria-hidden": "true", children: sourceIcons[source.type] }),
48
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
49
+ /* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
50
+ SOURCE_TYPE_LABELS[source.type],
51
+ ":"
52
+ ] }),
53
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[var(--axis-text-primary)] truncate", children: source.url ? /* @__PURE__ */ jsxs(
54
+ "a",
55
+ {
56
+ href: source.url,
57
+ target: "_blank",
58
+ rel: "noopener noreferrer",
59
+ className: "hover:underline",
60
+ "aria-label": `${source.title} (\uC0C8 \uCC3D\uC5D0\uC11C \uC5F4\uB9BC)`,
61
+ children: [
62
+ source.title,
63
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: ", \uC0C8 \uCC3D\uC5D0\uC11C \uC5F4\uB9BC" })
64
+ ]
65
+ }
66
+ ) : source.title }),
67
+ source.snippet && /* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--axis-text-secondary)] line-clamp-2 mt-0.5", children: source.snippet }),
68
+ source.path && /* @__PURE__ */ jsx("code", { className: "text-xs text-[var(--axis-text-tertiary)]", children: source.path })
69
+ ] }),
70
+ source.relevance !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-[var(--axis-text-tertiary)]", children: [
71
+ Math.round(source.relevance * 100),
72
+ "%"
73
+ ] })
74
+ ]
75
+ },
76
+ source.id
77
+ )) }),
78
+ expandable && hasMore && /* @__PURE__ */ jsx(
79
+ "button",
80
+ {
81
+ onClick: () => setIsExpanded(!isExpanded),
82
+ "aria-expanded": isExpanded,
83
+ "aria-controls": listId,
84
+ className: "mt-2 text-xs text-[var(--axis-text-brand)] hover:underline",
85
+ children: isExpanded ? "\uC811\uAE30" : `${sources.length - maxItems}\uAC1C \uB354 \uBCF4\uAE30`
86
+ }
87
+ )
88
+ ]
89
+ }
90
+ );
91
+ }
92
+
93
+ export {
94
+ SourcePanel
95
+ };
@@ -0,0 +1,68 @@
1
+ // src/constants/a11y-labels.ts
2
+ var STATUS_LABELS = {
3
+ pending: "\uB300\uAE30 \uC911",
4
+ running: "\uC2E4\uD589 \uC911",
5
+ complete: "\uC644\uB8CC",
6
+ success: "\uC131\uACF5",
7
+ error: "\uC624\uB958",
8
+ skipped: "\uAC74\uB108\uB700",
9
+ idle: "\uB300\uAE30 \uC911"
10
+ };
11
+ var SEVERITY_LABELS = {
12
+ info: "\uC815\uBCF4",
13
+ warning: "\uC8FC\uC758",
14
+ error: "\uC624\uB958"
15
+ };
16
+ var AGENT_STATUS_LABELS = {
17
+ online: "\uC628\uB77C\uC778",
18
+ busy: "\uC0AC\uC6A9 \uC911",
19
+ offline: "\uC624\uD504\uB77C\uC778"
20
+ };
21
+ var SOURCE_TYPE_LABELS = {
22
+ web: "\uC6F9 \uD398\uC774\uC9C0",
23
+ file: "\uD30C\uC77C",
24
+ database: "\uB370\uC774\uD130\uBCA0\uC774\uC2A4",
25
+ api: "API"
26
+ };
27
+ var MESSAGE_ROLE_LABELS = {
28
+ user: "\uC0AC\uC6A9\uC790",
29
+ assistant: "\uC5B4\uC2DC\uC2A4\uD134\uD2B8",
30
+ system: "\uC2DC\uC2A4\uD15C"
31
+ };
32
+ var FEEDBACK_LABELS = {
33
+ like: "\uC88B\uC544\uC694",
34
+ dislike: "\uC2EB\uC5B4\uC694",
35
+ none: "\uD53C\uB4DC\uBC31 \uC5C6\uC74C"
36
+ };
37
+ var ATTACHMENT_TYPE_LABELS = {
38
+ image: "\uC774\uBBF8\uC9C0",
39
+ document: "\uBB38\uC11C",
40
+ code: "\uCF54\uB4DC",
41
+ archive: "\uC555\uCD95 \uD30C\uC77C",
42
+ other: "\uAE30\uD0C0 \uD30C\uC77C"
43
+ };
44
+ var DIFF_LABELS = {
45
+ added: "\uCD94\uAC00\uB428",
46
+ removed: "\uC0AD\uC81C\uB428",
47
+ unchanged: "\uBCC0\uACBD \uC5C6\uC74C"
48
+ };
49
+ var PLAN_STATUS_LABELS = {
50
+ draft: "\uCD08\uC548",
51
+ pending: "\uC2B9\uC778 \uB300\uAE30",
52
+ approved: "\uC2B9\uC778\uB428",
53
+ rejected: "\uAC70\uC808\uB428",
54
+ executing: "\uC2E4\uD589 \uC911",
55
+ completed: "\uC644\uB8CC"
56
+ };
57
+
58
+ export {
59
+ STATUS_LABELS,
60
+ SEVERITY_LABELS,
61
+ AGENT_STATUS_LABELS,
62
+ SOURCE_TYPE_LABELS,
63
+ MESSAGE_ROLE_LABELS,
64
+ FEEDBACK_LABELS,
65
+ ATTACHMENT_TYPE_LABELS,
66
+ DIFF_LABELS,
67
+ PLAN_STATUS_LABELS
68
+ };
@@ -0,0 +1,51 @@
1
+ // src/streaming-text/index.tsx
2
+ import * as React from "react";
3
+ import { cn } from "@axis-ds/ui-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ function StreamingText({
6
+ text,
7
+ speed = 20,
8
+ isComplete = false,
9
+ showCursor = true,
10
+ onComplete,
11
+ className
12
+ }) {
13
+ const [displayedText, setDisplayedText] = React.useState("");
14
+ const [isStreaming, setIsStreaming] = React.useState(false);
15
+ const prevTextRef = React.useRef("");
16
+ React.useEffect(() => {
17
+ if (isComplete) {
18
+ setDisplayedText(text);
19
+ setIsStreaming(false);
20
+ return;
21
+ }
22
+ if (text.length > prevTextRef.current.length && text.startsWith(prevTextRef.current)) {
23
+ const newText = text.slice(prevTextRef.current.length);
24
+ let charIndex = 0;
25
+ setIsStreaming(true);
26
+ const interval = setInterval(() => {
27
+ if (charIndex < newText.length) {
28
+ setDisplayedText((prev) => prev + newText[charIndex]);
29
+ charIndex++;
30
+ } else {
31
+ clearInterval(interval);
32
+ setIsStreaming(false);
33
+ if (onComplete) onComplete();
34
+ }
35
+ }, speed);
36
+ prevTextRef.current = text;
37
+ return () => clearInterval(interval);
38
+ } else if (text !== prevTextRef.current) {
39
+ setDisplayedText("");
40
+ prevTextRef.current = "";
41
+ }
42
+ }, [text, speed, isComplete, onComplete]);
43
+ return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
44
+ /* @__PURE__ */ jsx("span", { className: "text-[var(--axis-text-primary)] whitespace-pre-wrap", children: displayedText }),
45
+ showCursor && isStreaming && /* @__PURE__ */ jsx("span", { className: "inline-block w-0.5 h-4 ml-0.5 bg-[var(--axis-text-primary)] animate-pulse" })
46
+ ] });
47
+ }
48
+
49
+ export {
50
+ StreamingText
51
+ };
@@ -0,0 +1,105 @@
1
+ // src/tool-call-card/index.tsx
2
+ import * as React from "react";
3
+ import { cn } from "@axis-ds/ui-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ var statusConfig = {
6
+ pending: {
7
+ color: "text-[var(--axis-color-gray-400)]",
8
+ icon: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10", strokeWidth: 2 }) })
9
+ },
10
+ running: {
11
+ color: "text-[var(--axis-color-blue-500)]",
12
+ icon: /* @__PURE__ */ jsxs("svg", { className: "w-4 h-4 animate-spin", viewBox: "0 0 24 24", fill: "none", children: [
13
+ /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
14
+ /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })
15
+ ] })
16
+ },
17
+ success: {
18
+ color: "text-[var(--axis-color-green-500)]",
19
+ icon: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) })
20
+ },
21
+ error: {
22
+ color: "text-[var(--axis-color-red-500)]",
23
+ icon: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
24
+ }
25
+ };
26
+ function ToolCallCard({
27
+ toolName,
28
+ description,
29
+ status,
30
+ input,
31
+ output,
32
+ error,
33
+ duration,
34
+ defaultExpanded = false,
35
+ className
36
+ }) {
37
+ const [isExpanded, setIsExpanded] = React.useState(defaultExpanded);
38
+ const config = statusConfig[status];
39
+ return /* @__PURE__ */ jsxs(
40
+ "div",
41
+ {
42
+ className: cn(
43
+ "rounded-lg border overflow-hidden",
44
+ "bg-[var(--axis-surface-default)] border-[var(--axis-border-default)]",
45
+ className
46
+ ),
47
+ children: [
48
+ /* @__PURE__ */ jsxs(
49
+ "button",
50
+ {
51
+ onClick: () => setIsExpanded(!isExpanded),
52
+ className: "w-full flex items-center justify-between p-3 hover:bg-[var(--axis-surface-secondary)] transition-colors",
53
+ children: [
54
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
55
+ /* @__PURE__ */ jsx("span", { className: config.color, children: config.icon }),
56
+ /* @__PURE__ */ jsx("code", { className: "text-sm font-mono text-[var(--axis-text-primary)]", children: toolName }),
57
+ description && /* @__PURE__ */ jsxs("span", { className: "text-xs text-[var(--axis-text-secondary)]", children: [
58
+ "\u2014 ",
59
+ description
60
+ ] })
61
+ ] }),
62
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
63
+ duration !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-[var(--axis-text-tertiary)]", children: [
64
+ duration,
65
+ "ms"
66
+ ] }),
67
+ /* @__PURE__ */ jsx(
68
+ "svg",
69
+ {
70
+ className: cn(
71
+ "w-4 h-4 text-[var(--axis-text-secondary)] transition-transform",
72
+ isExpanded && "rotate-180"
73
+ ),
74
+ fill: "none",
75
+ stroke: "currentColor",
76
+ viewBox: "0 0 24 24",
77
+ children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })
78
+ }
79
+ )
80
+ ] })
81
+ ]
82
+ }
83
+ ),
84
+ isExpanded && /* @__PURE__ */ jsxs("div", { className: "border-t border-[var(--axis-border-default)] p-3 space-y-3", children: [
85
+ input && /* @__PURE__ */ jsxs("div", { children: [
86
+ /* @__PURE__ */ jsx("h5", { className: "text-xs font-medium text-[var(--axis-text-secondary)] mb-1", children: "\uC785\uB825" }),
87
+ /* @__PURE__ */ jsx("pre", { className: "text-xs p-2 rounded bg-[var(--axis-surface-secondary)] overflow-x-auto", children: /* @__PURE__ */ jsx("code", { className: "text-[var(--axis-text-primary)]", children: JSON.stringify(input, null, 2) }) })
88
+ ] }),
89
+ output && /* @__PURE__ */ jsxs("div", { children: [
90
+ /* @__PURE__ */ jsx("h5", { className: "text-xs font-medium text-[var(--axis-text-secondary)] mb-1", children: "\uCD9C\uB825" }),
91
+ /* @__PURE__ */ jsx("pre", { className: "text-xs p-2 rounded bg-[var(--axis-surface-secondary)] overflow-x-auto", children: /* @__PURE__ */ jsx("code", { className: "text-[var(--axis-text-primary)]", children: typeof output === "string" ? output : JSON.stringify(output, null, 2) }) })
92
+ ] }),
93
+ error && /* @__PURE__ */ jsxs("div", { children: [
94
+ /* @__PURE__ */ jsx("h5", { className: "text-xs font-medium text-[var(--axis-text-error)] mb-1", children: "\uC5D0\uB7EC" }),
95
+ /* @__PURE__ */ jsx("pre", { className: "text-xs p-2 rounded bg-[var(--axis-surface-error)] overflow-x-auto", children: /* @__PURE__ */ jsx("code", { className: "text-[var(--axis-text-error)]", children: error }) })
96
+ ] })
97
+ ] })
98
+ ]
99
+ }
100
+ );
101
+ }
102
+
103
+ export {
104
+ ToolCallCard
105
+ };