@axis-ds/agentic-ui 1.1.1 → 1.1.3

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.
@@ -1,105 +0,0 @@
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
- };
@@ -1,77 +0,0 @@
1
- import {
2
- STATUS_LABELS
3
- } from "./chunk-HWISMHCP.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
- };
@@ -1,79 +0,0 @@
1
- // src/source-panel/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 sourceIcons = {
6
- 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" }) }),
7
- 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" }) }),
8
- 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" }) }),
9
- 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" }) })
10
- };
11
- function SourcePanel({
12
- sources,
13
- expandable = true,
14
- defaultExpanded = false,
15
- maxItems = 5,
16
- className
17
- }) {
18
- const [isExpanded, setIsExpanded] = React.useState(defaultExpanded);
19
- const displayedSources = isExpanded ? sources : sources.slice(0, maxItems);
20
- const hasMore = sources.length > maxItems;
21
- if (sources.length === 0) return null;
22
- return /* @__PURE__ */ jsxs(
23
- "div",
24
- {
25
- className: cn(
26
- "rounded-lg border p-3",
27
- "bg-[var(--axis-surface-secondary)] border-[var(--axis-border-default)]",
28
- className
29
- ),
30
- children: [
31
- /* @__PURE__ */ jsxs("h4", { className: "text-xs font-medium text-[var(--axis-text-secondary)] mb-2", children: [
32
- "\uCD9C\uCC98 (",
33
- sources.length,
34
- "\uAC1C)"
35
- ] }),
36
- /* @__PURE__ */ jsx("div", { className: "space-y-2", children: displayedSources.map((source) => /* @__PURE__ */ jsxs(
37
- "div",
38
- {
39
- className: "flex items-start gap-2 p-2 rounded-md bg-[var(--axis-surface-default)]",
40
- children: [
41
- /* @__PURE__ */ jsx("span", { className: "text-[var(--axis-icon-secondary)] mt-0.5", children: sourceIcons[source.type] }),
42
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
43
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[var(--axis-text-primary)] truncate", children: source.url ? /* @__PURE__ */ jsx(
44
- "a",
45
- {
46
- href: source.url,
47
- target: "_blank",
48
- rel: "noopener noreferrer",
49
- className: "hover:underline",
50
- children: source.title
51
- }
52
- ) : source.title }),
53
- source.snippet && /* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--axis-text-secondary)] line-clamp-2 mt-0.5", children: source.snippet }),
54
- source.path && /* @__PURE__ */ jsx("code", { className: "text-xs text-[var(--axis-text-tertiary)]", children: source.path })
55
- ] }),
56
- source.relevance !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-[var(--axis-text-tertiary)]", children: [
57
- Math.round(source.relevance * 100),
58
- "%"
59
- ] })
60
- ]
61
- },
62
- source.id
63
- )) }),
64
- expandable && hasMore && /* @__PURE__ */ jsx(
65
- "button",
66
- {
67
- onClick: () => setIsExpanded(!isExpanded),
68
- className: "mt-2 text-xs text-[var(--axis-text-brand)] hover:underline",
69
- children: isExpanded ? "\uC811\uAE30" : `${sources.length - maxItems}\uAC1C \uB354 \uBCF4\uAE30`
70
- }
71
- )
72
- ]
73
- }
74
- );
75
- }
76
-
77
- export {
78
- SourcePanel
79
- };