@zmzai/theme 0.5.4 → 0.5.5
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/package.json
CHANGED
|
Binary file
|
package/src/components/index.ts
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import "./subtask.css";
|
|
4
|
+
|
|
5
|
+
import { Badge } from "../badge/Badge";
|
|
6
|
+
import { Icon } from "../icon/Icon";
|
|
7
|
+
|
|
8
|
+
export interface SubtaskPartProps {
|
|
9
|
+
/** 子任务描述;缺省时回退显示 agent 名 */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** 执行该子任务的智能体名 */
|
|
12
|
+
agent?: string;
|
|
13
|
+
/** 子任务 prompt(mono 小字显示) */
|
|
14
|
+
prompt?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* SubtaskPart — 执行树中的子任务行(分支线样式与 ToolCard 一致)。
|
|
19
|
+
*
|
|
20
|
+
* 上下文增强(执行树 ::before 分支线)依赖消费端容器留出左侧空间,
|
|
21
|
+
* 与 ToolCard 的执行树用法相同。
|
|
22
|
+
*/
|
|
23
|
+
export function SubtaskPart({ description, agent, prompt }: SubtaskPartProps) {
|
|
24
|
+
return (
|
|
25
|
+
<div className="subtask-row">
|
|
26
|
+
<span className="subtask-icon" aria-hidden>
|
|
27
|
+
<Icon name="chevron-down" size={12} />
|
|
28
|
+
</span>
|
|
29
|
+
<span className="subtask-copy">
|
|
30
|
+
<strong>{description || agent}</strong>
|
|
31
|
+
{prompt ? <small>{prompt}</small> : null}
|
|
32
|
+
</span>
|
|
33
|
+
<Badge variant="outline" size="sm">子任务</Badge>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SubtaskPart";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* SubtaskPart — 执行树中的子任务行。token 依赖消费端 @theme
|
|
2
|
+
(--color-line、--color-accent、--color-muted、--font-mono)。
|
|
3
|
+
执行树分支线(::before)等上下文增强由消费端自己的 CSS 叠加。 */
|
|
4
|
+
|
|
5
|
+
.subtask-row { position: relative; display: flex; align-items: center; gap: 0.5rem; min-height: 2.15rem; padding: 0.38rem 0.4rem; background: transparent; }
|
|
6
|
+
/* 执行树分支线(挂在左侧时间轴上;独立使用时容器需留出左侧空间) */
|
|
7
|
+
.subtask-row::before { position: absolute; top: 1.08rem; left: -0.81rem; width: 0.81rem; height: 1px; background: var(--color-line); content: ""; }
|
|
8
|
+
.subtask-icon { display: grid; width: 1rem; height: 1rem; place-items: center; color: var(--color-accent); }
|
|
9
|
+
.subtask-copy { display: grid; min-width: 0; flex: 1; gap: 0.1rem; }
|
|
10
|
+
.subtask-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; font-weight: 600; }
|
|
11
|
+
.subtask-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-muted); font-family: var(--font-mono); font-size: 0.6rem; }
|