@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Think & Action
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# @axis-ds/agentic-ui
|
|
2
|
+
|
|
3
|
+
AXIS Design System의 AI/Agent 전용 UI 컴포넌트 라이브러리입니다. LLM 기반 애플리케이션에 최적화된 컴포넌트를 제공합니다.
|
|
4
|
+
|
|
5
|
+
## 설치
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @axis-ds/agentic-ui
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @axis-ds/agentic-ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 사용법
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { StreamingText, ToolCallCard } from '@axis-ds/agentic-ui';
|
|
17
|
+
// 또는 개별 임포트
|
|
18
|
+
import { StreamingText } from '@axis-ds/agentic-ui/streaming-text';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 컴포넌트 목록
|
|
22
|
+
|
|
23
|
+
RunProgress, ApprovalCard, StreamingText, ToolCallCard, MessageBubble, FeedbackButtons, CodeBlock, DiffViewer, PlanCard, ContextPanel, TokenUsageIndicator, AttachmentCard
|
|
24
|
+
|
|
25
|
+
## 문서
|
|
26
|
+
|
|
27
|
+
자세한 사용법은 [AXIS Design System 문서](https://axis.minu.best)를 참고하세요.
|
|
28
|
+
|
|
29
|
+
## 라이선스
|
|
30
|
+
|
|
31
|
+
MIT
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface AgentAvatarProps {
|
|
4
|
+
/** 에이전트 이름 */
|
|
5
|
+
name: string;
|
|
6
|
+
/** 이미지 URL */
|
|
7
|
+
src?: string;
|
|
8
|
+
/** 크기 */
|
|
9
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
10
|
+
/** 상태 표시 */
|
|
11
|
+
status?: "online" | "busy" | "offline";
|
|
12
|
+
/** 에이전트 타입 */
|
|
13
|
+
type?: "assistant" | "tool" | "system";
|
|
14
|
+
/** 추가 클래스 */
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 에이전트 아바타 컴포넌트
|
|
19
|
+
*/
|
|
20
|
+
declare function AgentAvatar({ name, src, size, status, type, className, }: AgentAvatarProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { AgentAvatar, type AgentAvatarProps };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface AgentAvatarProps {
|
|
4
|
+
/** 에이전트 이름 */
|
|
5
|
+
name: string;
|
|
6
|
+
/** 이미지 URL */
|
|
7
|
+
src?: string;
|
|
8
|
+
/** 크기 */
|
|
9
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
10
|
+
/** 상태 표시 */
|
|
11
|
+
status?: "online" | "busy" | "offline";
|
|
12
|
+
/** 에이전트 타입 */
|
|
13
|
+
type?: "assistant" | "tool" | "system";
|
|
14
|
+
/** 추가 클래스 */
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 에이전트 아바타 컴포넌트
|
|
19
|
+
*/
|
|
20
|
+
declare function AgentAvatar({ name, src, size, status, type, className, }: AgentAvatarProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { AgentAvatar, type AgentAvatarProps };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/agent-avatar/index.tsx
|
|
21
|
+
var agent_avatar_exports = {};
|
|
22
|
+
__export(agent_avatar_exports, {
|
|
23
|
+
AgentAvatar: () => AgentAvatar
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(agent_avatar_exports);
|
|
26
|
+
var import_ui_react = require("@axis-ds/ui-react");
|
|
27
|
+
|
|
28
|
+
// src/constants/a11y-labels.ts
|
|
29
|
+
var AGENT_STATUS_LABELS = {
|
|
30
|
+
online: "\uC628\uB77C\uC778",
|
|
31
|
+
busy: "\uC0AC\uC6A9 \uC911",
|
|
32
|
+
offline: "\uC624\uD504\uB77C\uC778"
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// src/agent-avatar/index.tsx
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var sizeStyles = {
|
|
38
|
+
sm: "w-6 h-6 text-xs",
|
|
39
|
+
md: "w-8 h-8 text-sm",
|
|
40
|
+
lg: "w-10 h-10 text-base",
|
|
41
|
+
xl: "w-12 h-12 text-lg"
|
|
42
|
+
};
|
|
43
|
+
var statusStyles = {
|
|
44
|
+
online: "bg-[var(--axis-color-green-500)]",
|
|
45
|
+
busy: "bg-[var(--axis-color-yellow-500)]",
|
|
46
|
+
offline: "bg-[var(--axis-color-gray-400)]"
|
|
47
|
+
};
|
|
48
|
+
var typeColors = {
|
|
49
|
+
assistant: "bg-[var(--axis-color-purple-500)]",
|
|
50
|
+
tool: "bg-[var(--axis-color-blue-500)]",
|
|
51
|
+
system: "bg-[var(--axis-color-gray-600)]"
|
|
52
|
+
};
|
|
53
|
+
function AgentAvatar({
|
|
54
|
+
name,
|
|
55
|
+
src,
|
|
56
|
+
size = "md",
|
|
57
|
+
status,
|
|
58
|
+
type = "assistant",
|
|
59
|
+
className
|
|
60
|
+
}) {
|
|
61
|
+
const initials = name.split(" ").map((n) => n[0]).join("").slice(0, 2).toUpperCase();
|
|
62
|
+
const statusLabel = status ? AGENT_STATUS_LABELS[status] : "";
|
|
63
|
+
const ariaLabel = `${name}${statusLabel ? `, ${statusLabel}` : ""}`;
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
role: "img",
|
|
68
|
+
"aria-label": ariaLabel,
|
|
69
|
+
className: (0, import_ui_react.cn)("relative inline-flex", className),
|
|
70
|
+
children: [
|
|
71
|
+
src ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
72
|
+
"img",
|
|
73
|
+
{
|
|
74
|
+
src,
|
|
75
|
+
alt: "",
|
|
76
|
+
"aria-hidden": "true",
|
|
77
|
+
className: (0, import_ui_react.cn)(
|
|
78
|
+
"rounded-full object-cover",
|
|
79
|
+
sizeStyles[size]
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
"aria-hidden": "true",
|
|
86
|
+
className: (0, import_ui_react.cn)(
|
|
87
|
+
"rounded-full flex items-center justify-center font-medium text-white",
|
|
88
|
+
sizeStyles[size],
|
|
89
|
+
typeColors[type]
|
|
90
|
+
),
|
|
91
|
+
children: initials
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
95
|
+
"span",
|
|
96
|
+
{
|
|
97
|
+
"aria-hidden": "true",
|
|
98
|
+
className: (0, import_ui_react.cn)(
|
|
99
|
+
"absolute bottom-0 right-0 rounded-full border-2 border-[var(--axis-surface-default)]",
|
|
100
|
+
size === "sm" ? "w-2 h-2" : "w-3 h-3",
|
|
101
|
+
statusStyles[status]
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
+
0 && (module.exports = {
|
|
111
|
+
AgentAvatar
|
|
112
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type Severity = "info" | "warning" | "error";
|
|
5
|
+
interface ApprovalAction {
|
|
6
|
+
label: string;
|
|
7
|
+
variant?: "default" | "secondary" | "ghost" | "destructive";
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
}
|
|
10
|
+
interface ApprovalCardProps {
|
|
11
|
+
/** 고유 ID (접근성용) */
|
|
12
|
+
id?: string;
|
|
13
|
+
/** 제목 */
|
|
14
|
+
title: string;
|
|
15
|
+
/** 설명 */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** 심각도 (색상 결정) */
|
|
18
|
+
severity?: Severity;
|
|
19
|
+
/** 액션 버튼 목록 */
|
|
20
|
+
actions: ApprovalAction[];
|
|
21
|
+
/** 추가 내용 */
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
/** 추가 클래스 */
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 사용자 승인이 필요한 작업을 표시하는 카드 컴포넌트
|
|
28
|
+
*/
|
|
29
|
+
declare function ApprovalCard({ id, title, description, severity, actions, children, className, }: ApprovalCardProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
export { type ApprovalAction, ApprovalCard, type ApprovalCardProps, type Severity };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type Severity = "info" | "warning" | "error";
|
|
5
|
+
interface ApprovalAction {
|
|
6
|
+
label: string;
|
|
7
|
+
variant?: "default" | "secondary" | "ghost" | "destructive";
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
}
|
|
10
|
+
interface ApprovalCardProps {
|
|
11
|
+
/** 고유 ID (접근성용) */
|
|
12
|
+
id?: string;
|
|
13
|
+
/** 제목 */
|
|
14
|
+
title: string;
|
|
15
|
+
/** 설명 */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** 심각도 (색상 결정) */
|
|
18
|
+
severity?: Severity;
|
|
19
|
+
/** 액션 버튼 목록 */
|
|
20
|
+
actions: ApprovalAction[];
|
|
21
|
+
/** 추가 내용 */
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
/** 추가 클래스 */
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 사용자 승인이 필요한 작업을 표시하는 카드 컴포넌트
|
|
28
|
+
*/
|
|
29
|
+
declare function ApprovalCard({ id, title, description, severity, actions, children, className, }: ApprovalCardProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
export { type ApprovalAction, ApprovalCard, type ApprovalCardProps, type Severity };
|
|
@@ -0,0 +1,133 @@
|
|
|
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/approval-card/index.tsx
|
|
31
|
+
var approval_card_exports = {};
|
|
32
|
+
__export(approval_card_exports, {
|
|
33
|
+
ApprovalCard: () => ApprovalCard
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(approval_card_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 SEVERITY_LABELS = {
|
|
41
|
+
info: "\uC815\uBCF4",
|
|
42
|
+
warning: "\uC8FC\uC758",
|
|
43
|
+
error: "\uC624\uB958"
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// src/approval-card/index.tsx
|
|
47
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
48
|
+
var severityStyles = {
|
|
49
|
+
info: {
|
|
50
|
+
border: "border-l-[var(--axis-color-blue-500)]",
|
|
51
|
+
icon: "text-[var(--axis-color-blue-500)]",
|
|
52
|
+
bg: "bg-[var(--axis-surface-info)]"
|
|
53
|
+
},
|
|
54
|
+
warning: {
|
|
55
|
+
border: "border-l-[var(--axis-color-yellow-500)]",
|
|
56
|
+
icon: "text-[var(--axis-color-yellow-500)]",
|
|
57
|
+
bg: "bg-[var(--axis-surface-warning)]"
|
|
58
|
+
},
|
|
59
|
+
error: {
|
|
60
|
+
border: "border-l-[var(--axis-color-red-500)]",
|
|
61
|
+
icon: "text-[var(--axis-color-red-500)]",
|
|
62
|
+
bg: "bg-[var(--axis-surface-error)]"
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var severityIcons = {
|
|
66
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.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" }) }),
|
|
67
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.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" }) }),
|
|
68
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) })
|
|
69
|
+
};
|
|
70
|
+
var actionVariantStyles = {
|
|
71
|
+
default: "bg-[var(--axis-button-bg-default)] text-white hover:bg-[var(--axis-button-bg-hover)]",
|
|
72
|
+
secondary: "bg-[var(--axis-button-secondary-bg-default)] text-[var(--axis-text-primary)] hover:bg-[var(--axis-button-secondary-bg-hover)]",
|
|
73
|
+
ghost: "bg-transparent text-[var(--axis-text-primary)] hover:bg-[var(--axis-surface-secondary)]",
|
|
74
|
+
destructive: "bg-[var(--axis-button-destructive-bg-default)] text-white hover:bg-[var(--axis-button-destructive-bg-hover)]"
|
|
75
|
+
};
|
|
76
|
+
function ApprovalCard({
|
|
77
|
+
id,
|
|
78
|
+
title,
|
|
79
|
+
description,
|
|
80
|
+
severity = "info",
|
|
81
|
+
actions,
|
|
82
|
+
children,
|
|
83
|
+
className
|
|
84
|
+
}) {
|
|
85
|
+
const styles = severityStyles[severity];
|
|
86
|
+
const generatedId = React.useId();
|
|
87
|
+
const baseId = id || generatedId;
|
|
88
|
+
const titleId = `${baseId}-title`;
|
|
89
|
+
const descId = `${baseId}-desc`;
|
|
90
|
+
const severityLabel = SEVERITY_LABELS[severity];
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
role: "region",
|
|
95
|
+
"aria-labelledby": titleId,
|
|
96
|
+
"aria-describedby": description ? descId : void 0,
|
|
97
|
+
className: (0, import_ui_react.cn)(
|
|
98
|
+
"rounded-lg border border-l-4 p-4",
|
|
99
|
+
"bg-[var(--axis-surface-default)] border-[var(--axis-border-default)]",
|
|
100
|
+
styles.border,
|
|
101
|
+
className
|
|
102
|
+
),
|
|
103
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_ui_react.cn)("flex-shrink-0 mt-0.5", styles.icon), "aria-hidden": "true", children: severityIcons[severity] }),
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "sr-only", children: [
|
|
107
|
+
severityLabel,
|
|
108
|
+
" \uC54C\uB9BC:"
|
|
109
|
+
] }),
|
|
110
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { id: titleId, className: "text-sm font-semibold text-[var(--axis-text-primary)]", children: title }),
|
|
111
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { id: descId, className: "mt-1 text-sm text-[var(--axis-text-secondary)]", children: description }),
|
|
112
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-3", children }),
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2 mt-4", children: actions.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
114
|
+
"button",
|
|
115
|
+
{
|
|
116
|
+
onClick: action.onClick,
|
|
117
|
+
className: (0, import_ui_react.cn)(
|
|
118
|
+
"px-3 py-1.5 text-sm font-medium rounded-md transition-colors",
|
|
119
|
+
actionVariantStyles[action.variant || "default"]
|
|
120
|
+
),
|
|
121
|
+
children: action.label
|
|
122
|
+
},
|
|
123
|
+
index
|
|
124
|
+
)) })
|
|
125
|
+
] })
|
|
126
|
+
] })
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
131
|
+
0 && (module.exports = {
|
|
132
|
+
ApprovalCard
|
|
133
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type AttachmentType = "image" | "document" | "code" | "archive" | "other";
|
|
4
|
+
type AttachmentStatus = "uploading" | "complete" | "error";
|
|
5
|
+
interface AttachmentCardProps {
|
|
6
|
+
/** 파일 타입 */
|
|
7
|
+
type: AttachmentType;
|
|
8
|
+
/** 파일명 */
|
|
9
|
+
name: string;
|
|
10
|
+
/** 파일 크기 (bytes) */
|
|
11
|
+
size?: number;
|
|
12
|
+
/** 파일 URL */
|
|
13
|
+
url?: string;
|
|
14
|
+
/** 썸네일 URL (이미지인 경우) */
|
|
15
|
+
thumbnail?: string;
|
|
16
|
+
/** 업로드 상태 */
|
|
17
|
+
status?: AttachmentStatus;
|
|
18
|
+
/** 업로드 진행률 (0-100) */
|
|
19
|
+
progress?: number;
|
|
20
|
+
/** 삭제 콜백 */
|
|
21
|
+
onRemove?: () => void;
|
|
22
|
+
/** 추가 클래스 */
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 파일/이미지 첨부를 표시하는 카드 컴포넌트
|
|
27
|
+
*/
|
|
28
|
+
declare function AttachmentCard({ type, name, size, url, thumbnail, status, progress, onRemove, className, }: AttachmentCardProps): react_jsx_runtime.JSX.Element;
|
|
29
|
+
|
|
30
|
+
export { AttachmentCard, type AttachmentCardProps, type AttachmentStatus, type AttachmentType };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type AttachmentType = "image" | "document" | "code" | "archive" | "other";
|
|
4
|
+
type AttachmentStatus = "uploading" | "complete" | "error";
|
|
5
|
+
interface AttachmentCardProps {
|
|
6
|
+
/** 파일 타입 */
|
|
7
|
+
type: AttachmentType;
|
|
8
|
+
/** 파일명 */
|
|
9
|
+
name: string;
|
|
10
|
+
/** 파일 크기 (bytes) */
|
|
11
|
+
size?: number;
|
|
12
|
+
/** 파일 URL */
|
|
13
|
+
url?: string;
|
|
14
|
+
/** 썸네일 URL (이미지인 경우) */
|
|
15
|
+
thumbnail?: string;
|
|
16
|
+
/** 업로드 상태 */
|
|
17
|
+
status?: AttachmentStatus;
|
|
18
|
+
/** 업로드 진행률 (0-100) */
|
|
19
|
+
progress?: number;
|
|
20
|
+
/** 삭제 콜백 */
|
|
21
|
+
onRemove?: () => void;
|
|
22
|
+
/** 추가 클래스 */
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 파일/이미지 첨부를 표시하는 카드 컴포넌트
|
|
27
|
+
*/
|
|
28
|
+
declare function AttachmentCard({ type, name, size, url, thumbnail, status, progress, onRemove, className, }: AttachmentCardProps): react_jsx_runtime.JSX.Element;
|
|
29
|
+
|
|
30
|
+
export { AttachmentCard, type AttachmentCardProps, type AttachmentStatus, type AttachmentType };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/attachment-card/index.tsx
|
|
21
|
+
var attachment_card_exports = {};
|
|
22
|
+
__export(attachment_card_exports, {
|
|
23
|
+
AttachmentCard: () => AttachmentCard
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(attachment_card_exports);
|
|
26
|
+
var import_ui_react = require("@axis-ds/ui-react");
|
|
27
|
+
|
|
28
|
+
// src/constants/a11y-labels.ts
|
|
29
|
+
var ATTACHMENT_TYPE_LABELS = {
|
|
30
|
+
image: "\uC774\uBBF8\uC9C0",
|
|
31
|
+
document: "\uBB38\uC11C",
|
|
32
|
+
code: "\uCF54\uB4DC",
|
|
33
|
+
archive: "\uC555\uCD95 \uD30C\uC77C",
|
|
34
|
+
other: "\uAE30\uD0C0 \uD30C\uC77C"
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// src/attachment-card/index.tsx
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var typeIcons = {
|
|
40
|
+
image: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.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" }) }),
|
|
41
|
+
document: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.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" }) }),
|
|
42
|
+
code: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" }) }),
|
|
43
|
+
archive: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.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" }) }),
|
|
44
|
+
other: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.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" }) })
|
|
45
|
+
};
|
|
46
|
+
var formatFileSize = (bytes) => {
|
|
47
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
48
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
49
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
50
|
+
};
|
|
51
|
+
function AttachmentCard({
|
|
52
|
+
type,
|
|
53
|
+
name,
|
|
54
|
+
size,
|
|
55
|
+
url,
|
|
56
|
+
thumbnail,
|
|
57
|
+
status = "complete",
|
|
58
|
+
progress,
|
|
59
|
+
onRemove,
|
|
60
|
+
className
|
|
61
|
+
}) {
|
|
62
|
+
const typeLabel = ATTACHMENT_TYPE_LABELS[type];
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
role: "article",
|
|
67
|
+
"aria-label": `${typeLabel}: ${name}`,
|
|
68
|
+
className: (0, import_ui_react.cn)(
|
|
69
|
+
"flex items-center gap-3 rounded-lg border p-3",
|
|
70
|
+
"bg-[var(--axis-surface-default)] border-[var(--axis-border-default)]",
|
|
71
|
+
status === "error" && "border-[var(--axis-color-red-500)]/30",
|
|
72
|
+
className
|
|
73
|
+
),
|
|
74
|
+
children: [
|
|
75
|
+
thumbnail ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
|
+
"img",
|
|
77
|
+
{
|
|
78
|
+
src: thumbnail,
|
|
79
|
+
alt: "",
|
|
80
|
+
"aria-hidden": "true",
|
|
81
|
+
className: "w-10 h-10 rounded object-cover flex-shrink-0"
|
|
82
|
+
}
|
|
83
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
className: "w-10 h-10 rounded flex items-center justify-center flex-shrink-0 bg-[var(--axis-surface-secondary)] text-[var(--axis-icon-secondary)]",
|
|
87
|
+
"aria-hidden": "true",
|
|
88
|
+
children: typeIcons[type]
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-medium text-[var(--axis-text-primary)] truncate", children: url ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
93
|
+
"a",
|
|
94
|
+
{
|
|
95
|
+
href: url,
|
|
96
|
+
target: "_blank",
|
|
97
|
+
rel: "noopener noreferrer",
|
|
98
|
+
className: "hover:underline",
|
|
99
|
+
"aria-label": `${name} (\uC0C8 \uCC3D\uC5D0\uC11C \uC5F4\uB9BC)`,
|
|
100
|
+
children: name
|
|
101
|
+
}
|
|
102
|
+
) : name }),
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 text-xs text-[var(--axis-text-tertiary)]", children: [
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: typeLabel }),
|
|
105
|
+
size !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": "true", children: "\xB7" }),
|
|
107
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: formatFileSize(size) })
|
|
108
|
+
] }),
|
|
109
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-[var(--axis-text-error)]", children: "\uC5C5\uB85C\uB4DC \uC2E4\uD328" })
|
|
110
|
+
] }),
|
|
111
|
+
status === "uploading" && progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-1.5 h-1 rounded-full bg-[var(--axis-surface-secondary)] overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
className: "h-full rounded-full bg-[var(--axis-color-blue-500)] transition-all",
|
|
115
|
+
style: { width: `${progress}%` },
|
|
116
|
+
role: "progressbar",
|
|
117
|
+
"aria-valuenow": progress,
|
|
118
|
+
"aria-valuemin": 0,
|
|
119
|
+
"aria-valuemax": 100,
|
|
120
|
+
"aria-label": "\uC5C5\uB85C\uB4DC \uC9C4\uD589\uB960"
|
|
121
|
+
}
|
|
122
|
+
) })
|
|
123
|
+
] }),
|
|
124
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
|
+
"button",
|
|
126
|
+
{
|
|
127
|
+
onClick: onRemove,
|
|
128
|
+
"aria-label": `${name} \uC0AD\uC81C`,
|
|
129
|
+
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",
|
|
130
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
138
|
+
0 && (module.exports = {
|
|
139
|
+
AttachmentCard
|
|
140
|
+
});
|