@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,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/diff-viewer/index.tsx
|
|
31
|
+
var diff_viewer_exports = {};
|
|
32
|
+
__export(diff_viewer_exports, {
|
|
33
|
+
DiffViewer: () => DiffViewer
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(diff_viewer_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_ui_react = require("@axis-ds/ui-react");
|
|
38
|
+
|
|
39
|
+
// src/constants/a11y-labels.ts
|
|
40
|
+
var DIFF_LABELS = {
|
|
41
|
+
added: "\uCD94\uAC00\uB428",
|
|
42
|
+
removed: "\uC0AD\uC81C\uB428",
|
|
43
|
+
unchanged: "\uBCC0\uACBD \uC5C6\uC74C"
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// src/diff-viewer/index.tsx
|
|
47
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
48
|
+
function computeDiff(before, after) {
|
|
49
|
+
const oldLines = before.split("\n");
|
|
50
|
+
const newLines = after.split("\n");
|
|
51
|
+
const m = oldLines.length;
|
|
52
|
+
const n = newLines.length;
|
|
53
|
+
const dp = Array.from({ length: m + 1 }, () => Array(n + 1).fill(0));
|
|
54
|
+
for (let i2 = 1; i2 <= m; i2++) {
|
|
55
|
+
for (let j2 = 1; j2 <= n; j2++) {
|
|
56
|
+
if (oldLines[i2 - 1] === newLines[j2 - 1]) {
|
|
57
|
+
dp[i2][j2] = dp[i2 - 1][j2 - 1] + 1;
|
|
58
|
+
} else {
|
|
59
|
+
dp[i2][j2] = Math.max(dp[i2 - 1][j2], dp[i2][j2 - 1]);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const result = [];
|
|
64
|
+
let i = m;
|
|
65
|
+
let j = n;
|
|
66
|
+
while (i > 0 || j > 0) {
|
|
67
|
+
if (i > 0 && j > 0 && oldLines[i - 1] === newLines[j - 1]) {
|
|
68
|
+
result.unshift({ type: "unchanged", content: oldLines[i - 1], oldLineNumber: i, newLineNumber: j });
|
|
69
|
+
i--;
|
|
70
|
+
j--;
|
|
71
|
+
} else if (j > 0 && (i === 0 || dp[i][j - 1] >= dp[i - 1][j])) {
|
|
72
|
+
result.unshift({ type: "added", content: newLines[j - 1], newLineNumber: j });
|
|
73
|
+
j--;
|
|
74
|
+
} else if (i > 0) {
|
|
75
|
+
result.unshift({ type: "removed", content: oldLines[i - 1], oldLineNumber: i });
|
|
76
|
+
i--;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
var lineTypeStyles = {
|
|
82
|
+
added: "bg-[var(--axis-color-green-500)]/10",
|
|
83
|
+
removed: "bg-[var(--axis-color-red-500)]/10",
|
|
84
|
+
unchanged: ""
|
|
85
|
+
};
|
|
86
|
+
var lineTypeTextStyles = {
|
|
87
|
+
added: "text-[var(--axis-color-green-600)]",
|
|
88
|
+
removed: "text-[var(--axis-color-red-600)]",
|
|
89
|
+
unchanged: "text-[var(--axis-text-primary)]"
|
|
90
|
+
};
|
|
91
|
+
var lineTypeSymbols = {
|
|
92
|
+
added: "+",
|
|
93
|
+
removed: "-",
|
|
94
|
+
unchanged: " "
|
|
95
|
+
};
|
|
96
|
+
function DiffViewer({
|
|
97
|
+
before,
|
|
98
|
+
after,
|
|
99
|
+
filename,
|
|
100
|
+
viewMode = "unified",
|
|
101
|
+
className
|
|
102
|
+
}) {
|
|
103
|
+
const [mode, setMode] = React.useState(viewMode);
|
|
104
|
+
const diffLines = React.useMemo(() => computeDiff(before, after), [before, after]);
|
|
105
|
+
const addedCount = diffLines.filter((l) => l.type === "added").length;
|
|
106
|
+
const removedCount = diffLines.filter((l) => l.type === "removed").length;
|
|
107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
108
|
+
"div",
|
|
109
|
+
{
|
|
110
|
+
role: "region",
|
|
111
|
+
"aria-label": filename ? `${filename} \uBCC0\uACBD\uC0AC\uD56D` : "\uCF54\uB4DC \uBCC0\uACBD\uC0AC\uD56D",
|
|
112
|
+
className: (0, import_ui_react.cn)(
|
|
113
|
+
"rounded-lg border overflow-hidden",
|
|
114
|
+
"bg-[var(--axis-surface-default)] border-[var(--axis-border-default)]",
|
|
115
|
+
className
|
|
116
|
+
),
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.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: [
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
120
|
+
/* @__PURE__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h16M4 18h7" }) }),
|
|
121
|
+
filename && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { className: "text-xs font-mono text-[var(--axis-text-primary)] truncate", children: filename }),
|
|
122
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-xs text-[var(--axis-color-green-500)]", "aria-label": `${addedCount}\uC904 ${DIFF_LABELS.added}`, children: [
|
|
123
|
+
"+",
|
|
124
|
+
addedCount
|
|
125
|
+
] }),
|
|
126
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-xs text-[var(--axis-color-red-500)]", "aria-label": `${removedCount}\uC904 ${DIFF_LABELS.removed}`, children: [
|
|
127
|
+
"-",
|
|
128
|
+
removedCount
|
|
129
|
+
] })
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-1 bg-[var(--axis-surface-tertiary)] rounded-md p-0.5", children: [
|
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
133
|
+
"button",
|
|
134
|
+
{
|
|
135
|
+
onClick: () => setMode("unified"),
|
|
136
|
+
"aria-pressed": mode === "unified",
|
|
137
|
+
className: (0, import_ui_react.cn)(
|
|
138
|
+
"px-2 py-0.5 text-xs rounded transition-colors",
|
|
139
|
+
mode === "unified" ? "bg-[var(--axis-surface-default)] text-[var(--axis-text-primary)] shadow-sm" : "text-[var(--axis-text-tertiary)] hover:text-[var(--axis-text-secondary)]"
|
|
140
|
+
),
|
|
141
|
+
children: "\uD1B5\uD569"
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
145
|
+
"button",
|
|
146
|
+
{
|
|
147
|
+
onClick: () => setMode("split"),
|
|
148
|
+
"aria-pressed": mode === "split",
|
|
149
|
+
className: (0, import_ui_react.cn)(
|
|
150
|
+
"px-2 py-0.5 text-xs rounded transition-colors",
|
|
151
|
+
mode === "split" ? "bg-[var(--axis-surface-default)] text-[var(--axis-text-primary)] shadow-sm" : "text-[var(--axis-text-tertiary)] hover:text-[var(--axis-text-secondary)]"
|
|
152
|
+
),
|
|
153
|
+
children: "\uBD84\uD560"
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
] })
|
|
157
|
+
] }),
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "overflow-auto", children: mode === "unified" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UnifiedView, { lines: diffLines }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SplitView, { lines: diffLines }) })
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
function UnifiedView({ lines }) {
|
|
164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", { className: "w-full text-xs font-mono border-collapse", role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: lines.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", { className: lineTypeStyles[line.type], children: [
|
|
165
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: "select-none text-right px-2 py-0.5 text-[var(--axis-text-tertiary)] w-10 border-r border-[var(--axis-border-default)]", children: line.oldLineNumber ?? "" }),
|
|
166
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: "select-none text-right px-2 py-0.5 text-[var(--axis-text-tertiary)] w-10 border-r border-[var(--axis-border-default)]", children: line.newLineNumber ?? "" }),
|
|
167
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: (0, import_ui_react.cn)("select-none w-4 text-center py-0.5", lineTypeTextStyles[line.type]), children: lineTypeSymbols[line.type] }),
|
|
168
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: (0, import_ui_react.cn)("px-2 py-0.5 whitespace-pre", lineTypeTextStyles[line.type]), children: line.content })
|
|
169
|
+
] }, i)) }) });
|
|
170
|
+
}
|
|
171
|
+
function SplitView({ lines }) {
|
|
172
|
+
const leftLines = [];
|
|
173
|
+
const rightLines = [];
|
|
174
|
+
for (const line of lines) {
|
|
175
|
+
if (line.type === "unchanged") {
|
|
176
|
+
leftLines.push(line);
|
|
177
|
+
rightLines.push(line);
|
|
178
|
+
} else if (line.type === "removed") {
|
|
179
|
+
leftLines.push(line);
|
|
180
|
+
rightLines.push(null);
|
|
181
|
+
} else {
|
|
182
|
+
leftLines.push(null);
|
|
183
|
+
rightLines.push(line);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", { className: "w-full text-xs font-mono border-collapse", role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: leftLines.map((leftLine, i) => {
|
|
187
|
+
const rightLine = rightLines[i];
|
|
188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", { children: [
|
|
189
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: (0, import_ui_react.cn)("select-none text-right px-2 py-0.5 text-[var(--axis-text-tertiary)] w-10 border-r border-[var(--axis-border-default)]", leftLine ? lineTypeStyles[leftLine.type] : ""), children: leftLine?.oldLineNumber ?? "" }),
|
|
190
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: (0, import_ui_react.cn)("select-none w-4 text-center py-0.5", leftLine ? lineTypeTextStyles[leftLine.type] : ""), children: leftLine ? lineTypeSymbols[leftLine.type] : "" }),
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: (0, import_ui_react.cn)("px-2 py-0.5 whitespace-pre w-1/2 border-r border-[var(--axis-border-default)]", leftLine ? (0, import_ui_react.cn)(lineTypeStyles[leftLine.type], lineTypeTextStyles[leftLine.type]) : ""), children: leftLine?.content ?? "" }),
|
|
192
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: (0, import_ui_react.cn)("select-none text-right px-2 py-0.5 text-[var(--axis-text-tertiary)] w-10 border-r border-[var(--axis-border-default)]", rightLine ? lineTypeStyles[rightLine.type] : ""), children: rightLine?.newLineNumber ?? "" }),
|
|
193
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: (0, import_ui_react.cn)("select-none w-4 text-center py-0.5", rightLine ? lineTypeTextStyles[rightLine.type] : ""), children: rightLine ? lineTypeSymbols[rightLine.type] : "" }),
|
|
194
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: (0, import_ui_react.cn)("px-2 py-0.5 whitespace-pre w-1/2", rightLine ? (0, import_ui_react.cn)(lineTypeStyles[rightLine.type], lineTypeTextStyles[rightLine.type]) : ""), children: rightLine?.content ?? "" })
|
|
195
|
+
] }, i);
|
|
196
|
+
}) }) });
|
|
197
|
+
}
|
|
198
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
199
|
+
0 && (module.exports = {
|
|
200
|
+
DiffViewer
|
|
201
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type FeedbackType = "like" | "dislike" | "none";
|
|
4
|
+
interface FeedbackButtonsProps {
|
|
5
|
+
/** 메시지 ID */
|
|
6
|
+
messageId: string;
|
|
7
|
+
/** 초기 피드백 상태 */
|
|
8
|
+
initialFeedback?: FeedbackType;
|
|
9
|
+
/** 피드백 변경 콜백 */
|
|
10
|
+
onFeedback?: (messageId: string, feedback: FeedbackType) => void;
|
|
11
|
+
/** 크기 */
|
|
12
|
+
size?: "sm" | "md";
|
|
13
|
+
/** 추가 클래스 */
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 좋아요/싫어요 피드백 버튼 컴포넌트
|
|
18
|
+
*/
|
|
19
|
+
declare function FeedbackButtons({ messageId, initialFeedback, onFeedback, size, className, }: FeedbackButtonsProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
|
|
21
|
+
export { FeedbackButtons, type FeedbackButtonsProps, type FeedbackType };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type FeedbackType = "like" | "dislike" | "none";
|
|
4
|
+
interface FeedbackButtonsProps {
|
|
5
|
+
/** 메시지 ID */
|
|
6
|
+
messageId: string;
|
|
7
|
+
/** 초기 피드백 상태 */
|
|
8
|
+
initialFeedback?: FeedbackType;
|
|
9
|
+
/** 피드백 변경 콜백 */
|
|
10
|
+
onFeedback?: (messageId: string, feedback: FeedbackType) => void;
|
|
11
|
+
/** 크기 */
|
|
12
|
+
size?: "sm" | "md";
|
|
13
|
+
/** 추가 클래스 */
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 좋아요/싫어요 피드백 버튼 컴포넌트
|
|
18
|
+
*/
|
|
19
|
+
declare function FeedbackButtons({ messageId, initialFeedback, onFeedback, size, className, }: FeedbackButtonsProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
|
|
21
|
+
export { FeedbackButtons, type FeedbackButtonsProps, type FeedbackType };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/feedback-buttons/index.tsx
|
|
31
|
+
var feedback_buttons_exports = {};
|
|
32
|
+
__export(feedback_buttons_exports, {
|
|
33
|
+
FeedbackButtons: () => FeedbackButtons
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(feedback_buttons_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_ui_react = require("@axis-ds/ui-react");
|
|
38
|
+
|
|
39
|
+
// src/constants/a11y-labels.ts
|
|
40
|
+
var FEEDBACK_LABELS = {
|
|
41
|
+
like: "\uC88B\uC544\uC694",
|
|
42
|
+
dislike: "\uC2EB\uC5B4\uC694",
|
|
43
|
+
none: "\uD53C\uB4DC\uBC31 \uC5C6\uC74C"
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// src/feedback-buttons/index.tsx
|
|
47
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
48
|
+
var sizeStyles = {
|
|
49
|
+
sm: "p-1",
|
|
50
|
+
md: "p-1.5"
|
|
51
|
+
};
|
|
52
|
+
var iconSizes = {
|
|
53
|
+
sm: "w-3.5 h-3.5",
|
|
54
|
+
md: "w-4 h-4"
|
|
55
|
+
};
|
|
56
|
+
function FeedbackButtons({
|
|
57
|
+
messageId,
|
|
58
|
+
initialFeedback = "none",
|
|
59
|
+
onFeedback,
|
|
60
|
+
size = "sm",
|
|
61
|
+
className
|
|
62
|
+
}) {
|
|
63
|
+
const [feedback, setFeedback] = React.useState(initialFeedback);
|
|
64
|
+
const handleFeedback = (type) => {
|
|
65
|
+
const newFeedback = feedback === type ? "none" : type;
|
|
66
|
+
setFeedback(newFeedback);
|
|
67
|
+
onFeedback?.(messageId, newFeedback);
|
|
68
|
+
};
|
|
69
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
role: "group",
|
|
73
|
+
"aria-label": "\uBA54\uC2DC\uC9C0 \uD53C\uB4DC\uBC31",
|
|
74
|
+
className: (0, import_ui_react.cn)("inline-flex items-center gap-1", className),
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
77
|
+
"button",
|
|
78
|
+
{
|
|
79
|
+
onClick: () => handleFeedback("like"),
|
|
80
|
+
"aria-pressed": feedback === "like",
|
|
81
|
+
"aria-label": FEEDBACK_LABELS.like,
|
|
82
|
+
className: (0, import_ui_react.cn)(
|
|
83
|
+
"rounded-md transition-colors",
|
|
84
|
+
sizeStyles[size],
|
|
85
|
+
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)]"
|
|
86
|
+
),
|
|
87
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: iconSizes[size], fill: feedback === "like" ? "currentColor" : "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.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" }) })
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
91
|
+
"button",
|
|
92
|
+
{
|
|
93
|
+
onClick: () => handleFeedback("dislike"),
|
|
94
|
+
"aria-pressed": feedback === "dislike",
|
|
95
|
+
"aria-label": FEEDBACK_LABELS.dislike,
|
|
96
|
+
className: (0, import_ui_react.cn)(
|
|
97
|
+
"rounded-md transition-colors",
|
|
98
|
+
sizeStyles[size],
|
|
99
|
+
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)]"
|
|
100
|
+
),
|
|
101
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: iconSizes[size], fill: feedback === "dislike" ? "currentColor" : "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.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" }) })
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
109
|
+
0 && (module.exports = {
|
|
110
|
+
FeedbackButtons
|
|
111
|
+
});
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { RunProgress, RunProgressProps, Step } from './run-progress/index.mjs';
|
|
2
|
+
export { StepTimeline, StepTimelineProps, TimelineStep } from './step-timeline/index.mjs';
|
|
3
|
+
export { ThinkingIndicator, ThinkingIndicatorProps } from './thinking-indicator/index.mjs';
|
|
4
|
+
export { ApprovalAction, ApprovalCard, ApprovalCardProps } from './approval-card/index.mjs';
|
|
5
|
+
export { Source, SourcePanel, SourcePanelProps } from './source-panel/index.mjs';
|
|
6
|
+
export { StreamingText, StreamingTextProps } from './streaming-text/index.mjs';
|
|
7
|
+
export { ToolCallCard, ToolCallCardProps } from './tool-call-card/index.mjs';
|
|
8
|
+
export { Surface, SurfaceRenderer, SurfaceRendererProps } from './surface-renderer/index.mjs';
|
|
9
|
+
export { RecoveryBanner, RecoveryBannerProps } from './recovery-banner/index.mjs';
|
|
10
|
+
export { AgentAvatar, AgentAvatarProps } from './agent-avatar/index.mjs';
|
|
11
|
+
export { MessageBubble, MessageBubbleProps, MessageRole, MessageStatus } from './message-bubble/index.mjs';
|
|
12
|
+
export { FeedbackButtons, FeedbackButtonsProps, FeedbackType } from './feedback-buttons/index.mjs';
|
|
13
|
+
export { CodeBlock, CodeBlockProps } from './code-block/index.mjs';
|
|
14
|
+
export { DiffViewMode, DiffViewer, DiffViewerProps } from './diff-viewer/index.mjs';
|
|
15
|
+
export { PlanCard, PlanCardProps, PlanStatus, PlanStep, PlanStepStatus } from './plan-card/index.mjs';
|
|
16
|
+
export { ContextPanel, ContextPanelProps, ModelInfo } from './context-panel/index.mjs';
|
|
17
|
+
export { TokenUsageIndicator, TokenUsageIndicatorProps } from './token-usage-indicator/index.mjs';
|
|
18
|
+
export { AttachmentCard, AttachmentCardProps, AttachmentStatus, AttachmentType } from './attachment-card/index.mjs';
|
|
19
|
+
import 'react/jsx-runtime';
|
|
20
|
+
import 'react';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { RunProgress, RunProgressProps, Step } from './run-progress/index.js';
|
|
2
|
+
export { StepTimeline, StepTimelineProps, TimelineStep } from './step-timeline/index.js';
|
|
3
|
+
export { ThinkingIndicator, ThinkingIndicatorProps } from './thinking-indicator/index.js';
|
|
4
|
+
export { ApprovalAction, ApprovalCard, ApprovalCardProps } from './approval-card/index.js';
|
|
5
|
+
export { Source, SourcePanel, SourcePanelProps } from './source-panel/index.js';
|
|
6
|
+
export { StreamingText, StreamingTextProps } from './streaming-text/index.js';
|
|
7
|
+
export { ToolCallCard, ToolCallCardProps } from './tool-call-card/index.js';
|
|
8
|
+
export { Surface, SurfaceRenderer, SurfaceRendererProps } from './surface-renderer/index.js';
|
|
9
|
+
export { RecoveryBanner, RecoveryBannerProps } from './recovery-banner/index.js';
|
|
10
|
+
export { AgentAvatar, AgentAvatarProps } from './agent-avatar/index.js';
|
|
11
|
+
export { MessageBubble, MessageBubbleProps, MessageRole, MessageStatus } from './message-bubble/index.js';
|
|
12
|
+
export { FeedbackButtons, FeedbackButtonsProps, FeedbackType } from './feedback-buttons/index.js';
|
|
13
|
+
export { CodeBlock, CodeBlockProps } from './code-block/index.js';
|
|
14
|
+
export { DiffViewMode, DiffViewer, DiffViewerProps } from './diff-viewer/index.js';
|
|
15
|
+
export { PlanCard, PlanCardProps, PlanStatus, PlanStep, PlanStepStatus } from './plan-card/index.js';
|
|
16
|
+
export { ContextPanel, ContextPanelProps, ModelInfo } from './context-panel/index.js';
|
|
17
|
+
export { TokenUsageIndicator, TokenUsageIndicatorProps } from './token-usage-indicator/index.js';
|
|
18
|
+
export { AttachmentCard, AttachmentCardProps, AttachmentStatus, AttachmentType } from './attachment-card/index.js';
|
|
19
|
+
import 'react/jsx-runtime';
|
|
20
|
+
import 'react';
|