@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.
- package/LICENSE +21 -0
- package/README.md +31 -0
- package/dist/agent-avatar/index.d.mts +22 -0
- package/dist/agent-avatar/index.d.ts +22 -0
- package/dist/agent-avatar/index.js +112 -0
- package/dist/agent-avatar/index.mjs +7 -0
- package/dist/approval-card/index.d.mts +31 -0
- package/dist/approval-card/index.d.ts +31 -0
- package/dist/approval-card/index.js +133 -0
- package/dist/approval-card/index.mjs +7 -0
- package/dist/attachment-card/index.d.mts +30 -0
- package/dist/attachment-card/index.d.ts +30 -0
- package/dist/attachment-card/index.js +140 -0
- package/dist/attachment-card/index.mjs +7 -0
- package/dist/chunk-2BWCQQLU.mjs +136 -0
- package/dist/chunk-3TH7GFBD.mjs +83 -0
- package/dist/chunk-4PCJFQHQ.mjs +66 -0
- package/dist/chunk-657RY6MM.mjs +106 -0
- package/dist/chunk-7UGSLEYG.mjs +75 -0
- package/dist/chunk-D6GHMPBC.mjs +76 -0
- package/dist/chunk-DPENLPBM.mjs +105 -0
- package/dist/chunk-DPLGRVNQ.mjs +95 -0
- package/dist/chunk-EF4MECAI.mjs +81 -0
- package/dist/chunk-ENIWC4WX.mjs +94 -0
- package/dist/chunk-ETFET3LT.mjs +72 -0
- package/dist/chunk-FAJF5RCY.mjs +115 -0
- package/dist/chunk-FPOHPDZ2.mjs +109 -0
- package/dist/chunk-FYAMA32G.mjs +50 -0
- package/dist/chunk-GQYOOLDL.mjs +63 -0
- package/dist/chunk-H6VXOP7U.mjs +86 -0
- package/dist/chunk-HLW7VEFF.mjs +47 -0
- package/dist/chunk-HWISMHCP.mjs +33 -0
- package/dist/chunk-KH4OXDEV.mjs +83 -0
- package/dist/chunk-KJVPVBET.mjs +103 -0
- package/dist/chunk-LZKOCELQ.mjs +136 -0
- package/dist/chunk-MGQ7AEYE.mjs +94 -0
- package/dist/chunk-MVBXXDZB.mjs +83 -0
- package/dist/chunk-NRBIHROX.mjs +162 -0
- package/dist/chunk-O5VXD6C3.mjs +114 -0
- package/dist/chunk-O5WFJCWK.mjs +63 -0
- package/dist/chunk-OOFM7NNH.mjs +68 -0
- package/dist/chunk-PAKLXPHD.mjs +115 -0
- package/dist/chunk-PWKN5UHT.mjs +152 -0
- package/dist/chunk-RGBY6EEU.mjs +80 -0
- package/dist/chunk-RGPKTWK4.mjs +77 -0
- package/dist/chunk-S3HVRSN2.mjs +95 -0
- package/dist/chunk-SCZ4BQ2G.mjs +68 -0
- package/dist/chunk-TCCZL2D5.mjs +51 -0
- package/dist/chunk-TKUAT5WE.mjs +105 -0
- package/dist/chunk-UG4H7RIP.mjs +77 -0
- package/dist/chunk-VKLPWFAI.mjs +79 -0
- package/dist/code-block/index.d.mts +24 -0
- package/dist/code-block/index.d.ts +24 -0
- package/dist/code-block/index.js +114 -0
- package/dist/code-block/index.mjs +6 -0
- package/dist/context-panel/index.d.mts +32 -0
- package/dist/context-panel/index.d.ts +32 -0
- package/dist/context-panel/index.js +137 -0
- package/dist/context-panel/index.mjs +6 -0
- package/dist/diff-viewer/index.d.mts +21 -0
- package/dist/diff-viewer/index.d.ts +21 -0
- package/dist/diff-viewer/index.js +201 -0
- package/dist/diff-viewer/index.mjs +7 -0
- package/dist/feedback-buttons/index.d.mts +21 -0
- package/dist/feedback-buttons/index.d.ts +21 -0
- package/dist/feedback-buttons/index.js +111 -0
- package/dist/feedback-buttons/index.mjs +7 -0
- package/dist/index.d.mts +20 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +1774 -0
- package/dist/index.mjs +75 -0
- package/dist/message-bubble/index.d.mts +29 -0
- package/dist/message-bubble/index.d.ts +29 -0
- package/dist/message-bubble/index.js +135 -0
- package/dist/message-bubble/index.mjs +7 -0
- package/dist/plan-card/index.d.mts +32 -0
- package/dist/plan-card/index.d.ts +32 -0
- package/dist/plan-card/index.js +202 -0
- package/dist/plan-card/index.mjs +7 -0
- package/dist/recovery-banner/index.d.mts +20 -0
- package/dist/recovery-banner/index.d.ts +20 -0
- package/dist/recovery-banner/index.js +109 -0
- package/dist/recovery-banner/index.mjs +6 -0
- package/dist/run-progress/index.d.mts +29 -0
- package/dist/run-progress/index.d.ts +29 -0
- package/dist/run-progress/index.js +179 -0
- package/dist/run-progress/index.mjs +7 -0
- package/dist/source-panel/index.d.mts +25 -0
- package/dist/source-panel/index.d.ts +25 -0
- package/dist/source-panel/index.js +135 -0
- package/dist/source-panel/index.mjs +7 -0
- package/dist/step-timeline/index.d.mts +21 -0
- package/dist/step-timeline/index.d.ts +21 -0
- package/dist/step-timeline/index.js +110 -0
- package/dist/step-timeline/index.mjs +7 -0
- package/dist/streaming-text/index.d.mts +27 -0
- package/dist/streaming-text/index.d.ts +27 -0
- package/dist/streaming-text/index.js +97 -0
- package/dist/streaming-text/index.mjs +6 -0
- package/dist/surface-renderer/index.d.mts +22 -0
- package/dist/surface-renderer/index.d.ts +22 -0
- package/dist/surface-renderer/index.js +107 -0
- package/dist/surface-renderer/index.mjs +6 -0
- package/dist/thinking-indicator/index.d.mts +16 -0
- package/dist/thinking-indicator/index.d.ts +16 -0
- package/dist/thinking-indicator/index.js +74 -0
- package/dist/thinking-indicator/index.mjs +6 -0
- package/dist/token-usage-indicator/index.d.mts +22 -0
- package/dist/token-usage-indicator/index.d.ts +22 -0
- package/dist/token-usage-indicator/index.js +110 -0
- package/dist/token-usage-indicator/index.mjs +6 -0
- package/dist/tool-call-card/index.d.mts +31 -0
- package/dist/tool-call-card/index.d.ts +31 -0
- package/dist/tool-call-card/index.js +158 -0
- package/dist/tool-call-card/index.mjs +7 -0
- package/package.json +130 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SOURCE_TYPE_LABELS
|
|
3
|
+
} from "./chunk-SCZ4BQ2G.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,81 @@
|
|
|
1
|
+
// src/surface-renderer/index.tsx
|
|
2
|
+
import { cn } from "@axis-ds/ui-react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
function SurfaceRenderer({
|
|
5
|
+
surface,
|
|
6
|
+
renderCustom,
|
|
7
|
+
className
|
|
8
|
+
}) {
|
|
9
|
+
const renderContent = () => {
|
|
10
|
+
switch (surface.type) {
|
|
11
|
+
case "text":
|
|
12
|
+
return /* @__PURE__ */ jsx("div", { className: "prose prose-sm max-w-none text-[var(--axis-text-primary)]", children: String(surface.content) });
|
|
13
|
+
case "code":
|
|
14
|
+
return /* @__PURE__ */ jsx("pre", { className: "p-3 rounded-md bg-[var(--axis-surface-secondary)] overflow-x-auto", children: /* @__PURE__ */ jsx("code", { className: "text-sm font-mono text-[var(--axis-text-primary)]", children: String(surface.content) }) });
|
|
15
|
+
case "table":
|
|
16
|
+
const tableData = surface.content;
|
|
17
|
+
return /* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-sm", children: [
|
|
18
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { className: "border-b border-[var(--axis-border-default)]", children: tableData.headers.map((header, i) => /* @__PURE__ */ jsx(
|
|
19
|
+
"th",
|
|
20
|
+
{
|
|
21
|
+
className: "px-3 py-2 text-left font-medium text-[var(--axis-text-secondary)]",
|
|
22
|
+
children: header
|
|
23
|
+
},
|
|
24
|
+
i
|
|
25
|
+
)) }) }),
|
|
26
|
+
/* @__PURE__ */ jsx("tbody", { children: tableData.rows.map((row, i) => /* @__PURE__ */ jsx(
|
|
27
|
+
"tr",
|
|
28
|
+
{
|
|
29
|
+
className: "border-b border-[var(--axis-border-default)] last:border-0",
|
|
30
|
+
children: row.map((cell, j) => /* @__PURE__ */ jsx(
|
|
31
|
+
"td",
|
|
32
|
+
{
|
|
33
|
+
className: "px-3 py-2 text-[var(--axis-text-primary)]",
|
|
34
|
+
children: cell
|
|
35
|
+
},
|
|
36
|
+
j
|
|
37
|
+
))
|
|
38
|
+
},
|
|
39
|
+
i
|
|
40
|
+
)) })
|
|
41
|
+
] }) });
|
|
42
|
+
case "chart":
|
|
43
|
+
return /* @__PURE__ */ jsxs("div", { className: "p-4 text-center text-[var(--axis-text-secondary)]", children: [
|
|
44
|
+
"[\uCC28\uD2B8: ",
|
|
45
|
+
surface.title || "\uB370\uC774\uD130 \uC2DC\uAC01\uD654",
|
|
46
|
+
"]"
|
|
47
|
+
] });
|
|
48
|
+
case "form":
|
|
49
|
+
return /* @__PURE__ */ jsxs("div", { className: "p-4 text-center text-[var(--axis-text-secondary)]", children: [
|
|
50
|
+
"[\uD3FC: ",
|
|
51
|
+
surface.title || "\uC785\uB825 \uC591\uC2DD",
|
|
52
|
+
"]"
|
|
53
|
+
] });
|
|
54
|
+
case "custom":
|
|
55
|
+
if (renderCustom) {
|
|
56
|
+
return renderCustom(surface);
|
|
57
|
+
}
|
|
58
|
+
return /* @__PURE__ */ jsx("div", { className: "p-4 text-center text-[var(--axis-text-secondary)]", children: "[\uCEE4\uC2A4\uD140 Surface]" });
|
|
59
|
+
default:
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
return /* @__PURE__ */ jsxs(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: cn(
|
|
67
|
+
"rounded-lg border p-4",
|
|
68
|
+
"bg-[var(--axis-surface-default)] border-[var(--axis-border-default)]",
|
|
69
|
+
className
|
|
70
|
+
),
|
|
71
|
+
children: [
|
|
72
|
+
surface.title && /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-[var(--axis-text-primary)] mb-3", children: surface.title }),
|
|
73
|
+
renderContent()
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
SurfaceRenderer
|
|
81
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SEVERITY_LABELS
|
|
3
|
+
} from "./chunk-SCZ4BQ2G.mjs";
|
|
4
|
+
|
|
5
|
+
// src/approval-card/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 severityStyles = {
|
|
10
|
+
info: {
|
|
11
|
+
border: "border-l-[var(--axis-color-blue-500)]",
|
|
12
|
+
icon: "text-[var(--axis-color-blue-500)]",
|
|
13
|
+
bg: "bg-[var(--axis-surface-info)]"
|
|
14
|
+
},
|
|
15
|
+
warning: {
|
|
16
|
+
border: "border-l-[var(--axis-color-yellow-500)]",
|
|
17
|
+
icon: "text-[var(--axis-color-yellow-500)]",
|
|
18
|
+
bg: "bg-[var(--axis-surface-warning)]"
|
|
19
|
+
},
|
|
20
|
+
error: {
|
|
21
|
+
border: "border-l-[var(--axis-color-red-500)]",
|
|
22
|
+
icon: "text-[var(--axis-color-red-500)]",
|
|
23
|
+
bg: "bg-[var(--axis-surface-error)]"
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var severityIcons = {
|
|
27
|
+
info: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
28
|
+
warning: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
|
|
29
|
+
error: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) })
|
|
30
|
+
};
|
|
31
|
+
var actionVariantStyles = {
|
|
32
|
+
default: "bg-[var(--axis-button-bg-default)] text-white hover:bg-[var(--axis-button-bg-hover)]",
|
|
33
|
+
secondary: "bg-[var(--axis-button-secondary-bg-default)] text-[var(--axis-text-primary)] hover:bg-[var(--axis-button-secondary-bg-hover)]",
|
|
34
|
+
ghost: "bg-transparent text-[var(--axis-text-primary)] hover:bg-[var(--axis-surface-secondary)]",
|
|
35
|
+
destructive: "bg-[var(--axis-button-destructive-bg-default)] text-white hover:bg-[var(--axis-button-destructive-bg-hover)]"
|
|
36
|
+
};
|
|
37
|
+
function ApprovalCard({
|
|
38
|
+
id,
|
|
39
|
+
title,
|
|
40
|
+
description,
|
|
41
|
+
severity = "info",
|
|
42
|
+
actions,
|
|
43
|
+
children,
|
|
44
|
+
className
|
|
45
|
+
}) {
|
|
46
|
+
const styles = severityStyles[severity];
|
|
47
|
+
const generatedId = React.useId();
|
|
48
|
+
const baseId = id || generatedId;
|
|
49
|
+
const titleId = `${baseId}-title`;
|
|
50
|
+
const descId = `${baseId}-desc`;
|
|
51
|
+
const severityLabel = SEVERITY_LABELS[severity];
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
role: "region",
|
|
56
|
+
"aria-labelledby": titleId,
|
|
57
|
+
"aria-describedby": description ? descId : void 0,
|
|
58
|
+
className: cn(
|
|
59
|
+
"rounded-lg border border-l-4 p-4",
|
|
60
|
+
"bg-[var(--axis-surface-default)] border-[var(--axis-border-default)]",
|
|
61
|
+
styles.border,
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
65
|
+
/* @__PURE__ */ jsx("div", { className: cn("flex-shrink-0 mt-0.5", styles.icon), "aria-hidden": "true", children: severityIcons[severity] }),
|
|
66
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
67
|
+
/* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
|
|
68
|
+
severityLabel,
|
|
69
|
+
" \uC54C\uB9BC:"
|
|
70
|
+
] }),
|
|
71
|
+
/* @__PURE__ */ jsx("h4", { id: titleId, className: "text-sm font-semibold text-[var(--axis-text-primary)]", children: title }),
|
|
72
|
+
description && /* @__PURE__ */ jsx("p", { id: descId, className: "mt-1 text-sm text-[var(--axis-text-secondary)]", children: description }),
|
|
73
|
+
children && /* @__PURE__ */ jsx("div", { className: "mt-3", children }),
|
|
74
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 mt-4", children: actions.map((action, index) => /* @__PURE__ */ jsx(
|
|
75
|
+
"button",
|
|
76
|
+
{
|
|
77
|
+
onClick: action.onClick,
|
|
78
|
+
className: cn(
|
|
79
|
+
"px-3 py-1.5 text-sm font-medium rounded-md transition-colors",
|
|
80
|
+
actionVariantStyles[action.variant || "default"]
|
|
81
|
+
),
|
|
82
|
+
children: action.label
|
|
83
|
+
},
|
|
84
|
+
index
|
|
85
|
+
)) })
|
|
86
|
+
] })
|
|
87
|
+
] })
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export {
|
|
93
|
+
ApprovalCard
|
|
94
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FEEDBACK_LABELS
|
|
3
|
+
} from "./chunk-SCZ4BQ2G.mjs";
|
|
4
|
+
|
|
5
|
+
// src/feedback-buttons/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 sizeStyles = {
|
|
10
|
+
sm: "p-1",
|
|
11
|
+
md: "p-1.5"
|
|
12
|
+
};
|
|
13
|
+
var iconSizes = {
|
|
14
|
+
sm: "w-3.5 h-3.5",
|
|
15
|
+
md: "w-4 h-4"
|
|
16
|
+
};
|
|
17
|
+
function FeedbackButtons({
|
|
18
|
+
messageId,
|
|
19
|
+
initialFeedback = "none",
|
|
20
|
+
onFeedback,
|
|
21
|
+
size = "sm",
|
|
22
|
+
className
|
|
23
|
+
}) {
|
|
24
|
+
const [feedback, setFeedback] = React.useState(initialFeedback);
|
|
25
|
+
const handleFeedback = (type) => {
|
|
26
|
+
const newFeedback = feedback === type ? "none" : type;
|
|
27
|
+
setFeedback(newFeedback);
|
|
28
|
+
onFeedback?.(messageId, newFeedback);
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ jsxs(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
role: "group",
|
|
34
|
+
"aria-label": "\uBA54\uC2DC\uC9C0 \uD53C\uB4DC\uBC31",
|
|
35
|
+
className: cn("inline-flex items-center gap-1", className),
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsx(
|
|
38
|
+
"button",
|
|
39
|
+
{
|
|
40
|
+
onClick: () => handleFeedback("like"),
|
|
41
|
+
"aria-pressed": feedback === "like",
|
|
42
|
+
"aria-label": FEEDBACK_LABELS.like,
|
|
43
|
+
className: cn(
|
|
44
|
+
"rounded-md transition-colors",
|
|
45
|
+
sizeStyles[size],
|
|
46
|
+
feedback === "like" ? "text-[var(--axis-color-green-500)] bg-[var(--axis-color-green-500)]/10" : "text-[var(--axis-text-tertiary)] hover:text-[var(--axis-text-secondary)] hover:bg-[var(--axis-surface-secondary)]"
|
|
47
|
+
),
|
|
48
|
+
children: /* @__PURE__ */ jsx("svg", { className: iconSizes[size], fill: feedback === "like" ? "currentColor" : "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M14 9V5a3 3 0 00-3-3l-4 9v11h11.28a2 2 0 002-1.7l1.38-9a2 2 0 00-2-2.3H14zm-9 11H3a2 2 0 01-2-2v-7a2 2 0 012-2h2" }) })
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
"button",
|
|
53
|
+
{
|
|
54
|
+
onClick: () => handleFeedback("dislike"),
|
|
55
|
+
"aria-pressed": feedback === "dislike",
|
|
56
|
+
"aria-label": FEEDBACK_LABELS.dislike,
|
|
57
|
+
className: cn(
|
|
58
|
+
"rounded-md transition-colors",
|
|
59
|
+
sizeStyles[size],
|
|
60
|
+
feedback === "dislike" ? "text-[var(--axis-color-red-500)] bg-[var(--axis-color-red-500)]/10" : "text-[var(--axis-text-tertiary)] hover:text-[var(--axis-text-secondary)] hover:bg-[var(--axis-surface-secondary)]"
|
|
61
|
+
),
|
|
62
|
+
children: /* @__PURE__ */ jsx("svg", { className: iconSizes[size], fill: feedback === "dislike" ? "currentColor" : "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 15V19a3 3 0 003 3l4-9V2H5.72a2 2 0 00-2 1.7l-1.38 9a2 2 0 002 2.3H10zm9-13h2a2 2 0 012 2v7a2 2 0 01-2 2h-2" }) })
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export {
|
|
71
|
+
FeedbackButtons
|
|
72
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import {
|
|
2
|
+
STATUS_LABELS
|
|
3
|
+
} from "./chunk-SCZ4BQ2G.mjs";
|
|
4
|
+
|
|
5
|
+
// src/tool-call-card/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 statusConfig = {
|
|
10
|
+
pending: {
|
|
11
|
+
color: "text-[var(--axis-color-gray-400)]",
|
|
12
|
+
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 }) })
|
|
13
|
+
},
|
|
14
|
+
running: {
|
|
15
|
+
color: "text-[var(--axis-color-blue-500)]",
|
|
16
|
+
icon: /* @__PURE__ */ jsxs("svg", { className: "w-4 h-4 animate-spin", viewBox: "0 0 24 24", fill: "none", children: [
|
|
17
|
+
/* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
18
|
+
/* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })
|
|
19
|
+
] })
|
|
20
|
+
},
|
|
21
|
+
success: {
|
|
22
|
+
color: "text-[var(--axis-color-green-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: "M5 13l4 4L19 7" }) })
|
|
24
|
+
},
|
|
25
|
+
error: {
|
|
26
|
+
color: "text-[var(--axis-color-red-500)]",
|
|
27
|
+
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" }) })
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
function ToolCallCard({
|
|
31
|
+
toolName,
|
|
32
|
+
description,
|
|
33
|
+
status,
|
|
34
|
+
input,
|
|
35
|
+
output,
|
|
36
|
+
error,
|
|
37
|
+
duration,
|
|
38
|
+
defaultExpanded = false,
|
|
39
|
+
"aria-label": ariaLabel,
|
|
40
|
+
className
|
|
41
|
+
}) {
|
|
42
|
+
const [isExpanded, setIsExpanded] = React.useState(defaultExpanded);
|
|
43
|
+
const config = statusConfig[status];
|
|
44
|
+
const contentId = React.useId();
|
|
45
|
+
const statusLabel = STATUS_LABELS[status] || status;
|
|
46
|
+
return /* @__PURE__ */ jsxs(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
className: cn(
|
|
50
|
+
"rounded-lg border overflow-hidden",
|
|
51
|
+
"bg-[var(--axis-surface-default)] border-[var(--axis-border-default)]",
|
|
52
|
+
className
|
|
53
|
+
),
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsxs(
|
|
56
|
+
"button",
|
|
57
|
+
{
|
|
58
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
59
|
+
"aria-expanded": isExpanded,
|
|
60
|
+
"aria-controls": contentId,
|
|
61
|
+
"aria-label": ariaLabel || `${toolName} - ${statusLabel}`,
|
|
62
|
+
className: "w-full flex items-center justify-between p-3 hover:bg-[var(--axis-surface-secondary)] transition-colors",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
65
|
+
/* @__PURE__ */ jsx("span", { className: config.color, "aria-hidden": "true", children: config.icon }),
|
|
66
|
+
/* @__PURE__ */ jsx("code", { className: "text-sm font-mono text-[var(--axis-text-primary)]", children: toolName }),
|
|
67
|
+
description && /* @__PURE__ */ jsxs("span", { className: "text-xs text-[var(--axis-text-secondary)]", children: [
|
|
68
|
+
"\u2014 ",
|
|
69
|
+
description
|
|
70
|
+
] })
|
|
71
|
+
] }),
|
|
72
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
73
|
+
duration !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-[var(--axis-text-tertiary)]", children: [
|
|
74
|
+
duration,
|
|
75
|
+
"ms"
|
|
76
|
+
] }),
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
"svg",
|
|
79
|
+
{
|
|
80
|
+
className: cn(
|
|
81
|
+
"w-4 h-4 text-[var(--axis-text-secondary)] transition-transform",
|
|
82
|
+
isExpanded && "rotate-180"
|
|
83
|
+
),
|
|
84
|
+
fill: "none",
|
|
85
|
+
stroke: "currentColor",
|
|
86
|
+
viewBox: "0 0 24 24",
|
|
87
|
+
children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] })
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
isExpanded && /* @__PURE__ */ jsxs("div", { id: contentId, className: "border-t border-[var(--axis-border-default)] p-3 space-y-3", children: [
|
|
95
|
+
input && /* @__PURE__ */ jsxs("div", { children: [
|
|
96
|
+
/* @__PURE__ */ jsx("h5", { className: "text-xs font-medium text-[var(--axis-text-secondary)] mb-1", children: "\uC785\uB825" }),
|
|
97
|
+
/* @__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) }) })
|
|
98
|
+
] }),
|
|
99
|
+
output !== void 0 && /* @__PURE__ */ jsxs("div", { children: [
|
|
100
|
+
/* @__PURE__ */ jsx("h5", { className: "text-xs font-medium text-[var(--axis-text-secondary)] mb-1", children: "\uCD9C\uB825" }),
|
|
101
|
+
/* @__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) }) })
|
|
102
|
+
] }),
|
|
103
|
+
error && /* @__PURE__ */ jsxs("div", { children: [
|
|
104
|
+
/* @__PURE__ */ jsx("h5", { className: "text-xs font-medium text-[var(--axis-text-error)] mb-1", children: "\uC5D0\uB7EC" }),
|
|
105
|
+
/* @__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 }) })
|
|
106
|
+
] })
|
|
107
|
+
] })
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export {
|
|
114
|
+
ToolCallCard
|
|
115
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ATTACHMENT_TYPE_LABELS
|
|
3
|
+
} from "./chunk-SCZ4BQ2G.mjs";
|
|
4
|
+
|
|
5
|
+
// src/attachment-card/index.tsx
|
|
6
|
+
import { cn } from "@axis-ds/ui-react";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
var typeIcons = {
|
|
9
|
+
image: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }),
|
|
10
|
+
document: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", 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" }) }),
|
|
11
|
+
code: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" }) }),
|
|
12
|
+
archive: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4" }) }),
|
|
13
|
+
other: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z" }) })
|
|
14
|
+
};
|
|
15
|
+
var formatFileSize = (bytes) => {
|
|
16
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
17
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
18
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
19
|
+
};
|
|
20
|
+
function AttachmentCard({
|
|
21
|
+
type,
|
|
22
|
+
name,
|
|
23
|
+
size,
|
|
24
|
+
url,
|
|
25
|
+
thumbnail,
|
|
26
|
+
status = "complete",
|
|
27
|
+
progress,
|
|
28
|
+
onRemove,
|
|
29
|
+
className
|
|
30
|
+
}) {
|
|
31
|
+
const typeLabel = ATTACHMENT_TYPE_LABELS[type];
|
|
32
|
+
return /* @__PURE__ */ jsxs(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
role: "article",
|
|
36
|
+
"aria-label": `${typeLabel}: ${name}`,
|
|
37
|
+
className: cn(
|
|
38
|
+
"flex items-center gap-3 rounded-lg border p-3",
|
|
39
|
+
"bg-[var(--axis-surface-default)] border-[var(--axis-border-default)]",
|
|
40
|
+
status === "error" && "border-[var(--axis-color-red-500)]/30",
|
|
41
|
+
className
|
|
42
|
+
),
|
|
43
|
+
children: [
|
|
44
|
+
thumbnail ? /* @__PURE__ */ jsx(
|
|
45
|
+
"img",
|
|
46
|
+
{
|
|
47
|
+
src: thumbnail,
|
|
48
|
+
alt: "",
|
|
49
|
+
"aria-hidden": "true",
|
|
50
|
+
className: "w-10 h-10 rounded object-cover flex-shrink-0"
|
|
51
|
+
}
|
|
52
|
+
) : /* @__PURE__ */ jsx(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: "w-10 h-10 rounded flex items-center justify-center flex-shrink-0 bg-[var(--axis-surface-secondary)] text-[var(--axis-icon-secondary)]",
|
|
56
|
+
"aria-hidden": "true",
|
|
57
|
+
children: typeIcons[type]
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
61
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[var(--axis-text-primary)] truncate", children: url ? /* @__PURE__ */ jsx(
|
|
62
|
+
"a",
|
|
63
|
+
{
|
|
64
|
+
href: url,
|
|
65
|
+
target: "_blank",
|
|
66
|
+
rel: "noopener noreferrer",
|
|
67
|
+
className: "hover:underline",
|
|
68
|
+
"aria-label": `${name} (\uC0C8 \uCC3D\uC5D0\uC11C \uC5F4\uB9BC)`,
|
|
69
|
+
children: name
|
|
70
|
+
}
|
|
71
|
+
) : name }),
|
|
72
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-[var(--axis-text-tertiary)]", children: [
|
|
73
|
+
/* @__PURE__ */ jsx("span", { children: typeLabel }),
|
|
74
|
+
size !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\xB7" }),
|
|
76
|
+
/* @__PURE__ */ jsx("span", { children: formatFileSize(size) })
|
|
77
|
+
] }),
|
|
78
|
+
status === "error" && /* @__PURE__ */ jsx("span", { className: "text-[var(--axis-text-error)]", children: "\uC5C5\uB85C\uB4DC \uC2E4\uD328" })
|
|
79
|
+
] }),
|
|
80
|
+
status === "uploading" && progress !== void 0 && /* @__PURE__ */ jsx("div", { className: "mt-1.5 h-1 rounded-full bg-[var(--axis-surface-secondary)] overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
className: "h-full rounded-full bg-[var(--axis-color-blue-500)] transition-all",
|
|
84
|
+
style: { width: `${progress}%` },
|
|
85
|
+
role: "progressbar",
|
|
86
|
+
"aria-valuenow": progress,
|
|
87
|
+
"aria-valuemin": 0,
|
|
88
|
+
"aria-valuemax": 100,
|
|
89
|
+
"aria-label": "\uC5C5\uB85C\uB4DC \uC9C4\uD589\uB960"
|
|
90
|
+
}
|
|
91
|
+
) })
|
|
92
|
+
] }),
|
|
93
|
+
onRemove && /* @__PURE__ */ jsx(
|
|
94
|
+
"button",
|
|
95
|
+
{
|
|
96
|
+
onClick: onRemove,
|
|
97
|
+
"aria-label": `${name} \uC0AD\uC81C`,
|
|
98
|
+
className: "flex-shrink-0 p-1 rounded-md text-[var(--axis-text-tertiary)] hover:text-[var(--axis-text-secondary)] hover:bg-[var(--axis-surface-secondary)] transition-colors",
|
|
99
|
+
children: /* @__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" }) })
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export {
|
|
108
|
+
AttachmentCard
|
|
109
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/thinking-indicator/index.tsx
|
|
2
|
+
import { cn } from "@axis-ds/ui-react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var sizeStyles = {
|
|
5
|
+
sm: "text-xs gap-1",
|
|
6
|
+
md: "text-sm gap-1.5",
|
|
7
|
+
lg: "text-base gap-2"
|
|
8
|
+
};
|
|
9
|
+
var dotSizes = {
|
|
10
|
+
sm: "w-1 h-1",
|
|
11
|
+
md: "w-1.5 h-1.5",
|
|
12
|
+
lg: "w-2 h-2"
|
|
13
|
+
};
|
|
14
|
+
function ThinkingIndicator({
|
|
15
|
+
text = "\uC0DD\uAC01 \uC911",
|
|
16
|
+
size = "md",
|
|
17
|
+
className
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ jsxs(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
role: "status",
|
|
23
|
+
"aria-live": "polite",
|
|
24
|
+
"aria-label": text,
|
|
25
|
+
className: cn(
|
|
26
|
+
"flex items-center text-[var(--axis-text-secondary)]",
|
|
27
|
+
sizeStyles[size],
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsx("span", { children: text }),
|
|
32
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-0.5", "aria-hidden": "true", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: cn(
|
|
36
|
+
"rounded-full bg-current animate-bounce",
|
|
37
|
+
dotSizes[size]
|
|
38
|
+
),
|
|
39
|
+
style: { animationDelay: `${i * 150}ms` }
|
|
40
|
+
},
|
|
41
|
+
i
|
|
42
|
+
)) })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
ThinkingIndicator
|
|
50
|
+
};
|