@almanaclabs/blaze-ui 0.27.0 → 0.28.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/dist/components/chat-panel/chat-panel.d.ts +1 -1
- package/dist/components/chat-panel/chat-panel.d.ts.map +1 -1
- package/dist/components/turn-steps/turn-steps.d.ts +10 -6
- package/dist/components/turn-steps/turn-steps.d.ts.map +1 -1
- package/dist/components/turn-steps/turn-steps.js +93 -68
- package/package.json +1 -1
- package/src/styles/globals.css +2 -2
|
@@ -31,7 +31,7 @@ type ChatPanelHeaderProps = Omit<React.ComponentProps<'header'>, 'children'> & {
|
|
|
31
31
|
};
|
|
32
32
|
/** The panel's top: the chat's name in a soft filled field you can rename in place, and Collapse. */
|
|
33
33
|
declare function ChatPanelHeader({ title, onRename, titleLabel, onCollapse, collapseLabel, className, ...props }: ChatPanelHeaderProps): React.JSX.Element;
|
|
34
|
-
/** The conversation, scrolling between the header and the composer, set in
|
|
34
|
+
/** The conversation, scrolling between the header and the composer, set in `type-chat`. */
|
|
35
35
|
declare function ChatPanelBody({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
36
36
|
/** The panel's composer, pinned at the foot. Holds a ChatBar with `floating={false}`. */
|
|
37
37
|
declare function ChatPanelFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-panel.d.ts","sourceRoot":"","sources":["../../../src/components/chat-panel/chat-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA2C9B,KAAK,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG;IACpD;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B,CAAA;AAED;;;;GAIG;AACH,iBAAS,SAAS,CAAC,EACjB,SAAiB,EACjB,YAAuC,EACvC,QAA+B,EAC/B,QAA+B,EAC/B,UAAmC,EACnC,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,qBAsChB;AA0GD,KAAK,oBAAoB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IAC7E,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,qGAAqG;IACrG,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,qGAAqG;AACrG,iBAAS,eAAe,CAAC,EACvB,KAAK,EACL,QAAQ,EACR,UAAwB,EACxB,UAAU,EACV,aAAmC,EACnC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,qBA8DtB;AAED,
|
|
1
|
+
{"version":3,"file":"chat-panel.d.ts","sourceRoot":"","sources":["../../../src/components/chat-panel/chat-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA2C9B,KAAK,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG;IACpD;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iFAAiF;IACjF,UAAU,CA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
/** The turn's real stages, in order, as they stream in. */
|
|
12
12
|
steps: TurnStep[];
|
|
13
|
-
/** Offered on a failed step; reruns the turn. */
|
|
13
|
+
/** Offered on a failed step; reruns the turn. With it, a failed list stays open. */
|
|
14
14
|
onRetry?: () => void;
|
|
15
15
|
retryLabel?: string;
|
|
16
|
-
/** The folded line once
|
|
16
|
+
/** The folded line once no step is left to run; defaults to "Worked through N steps". */
|
|
17
17
|
summary?: (count: number) => string;
|
|
18
18
|
/** Open the folded list at first. */
|
|
19
19
|
defaultOpen?: boolean;
|
|
20
|
+
/** While the turn runs, how many of the latest steps stay in view; older ones fold above them. */
|
|
21
|
+
recent?: number;
|
|
20
22
|
};
|
|
21
23
|
/**
|
|
22
|
-
* What an agent is doing on its turn, like Claude's
|
|
23
|
-
*
|
|
24
|
-
*
|
|
24
|
+
* What an agent is doing on its turn, like Claude's. While it works, the latest steps show in a quiet list, the
|
|
25
|
+
* current one shimmering beside a spinner, with older steps folded into a line above them. Once no step is left to
|
|
26
|
+
* run, the list folds into one line ("Worked through 5 steps") that opens on click, failed steps the agent got past
|
|
27
|
+
* included. A failed step is loud only when `onRetry` is offered: then it shows its reason and Try again, and the list
|
|
28
|
+
* stays open.
|
|
25
29
|
*/
|
|
26
|
-
declare function TurnSteps({ steps, onRetry, retryLabel, summary, defaultOpen, className, ...props }: TurnStepsProps): React.JSX.Element;
|
|
30
|
+
declare function TurnSteps({ steps, onRetry, retryLabel, summary, defaultOpen, recent, className, ...props }: TurnStepsProps): React.JSX.Element;
|
|
27
31
|
export { TurnSteps, type TurnStep, type TurnStepsProps };
|
|
28
32
|
//# sourceMappingURL=turn-steps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turn-steps.d.ts","sourceRoot":"","sources":["../../../src/components/turn-steps/turn-steps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B,KAAK,QAAQ,GAAG;IACd,EAAE,EAAE,MAAM,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7D,WAAmB,EACnB,MAAU,EACV,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,qBAiDhB;AAED,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,CAAA"}
|
|
@@ -3,89 +3,114 @@ import { Button as t } from "../button/button.js";
|
|
|
3
3
|
import { Collapsible as n, CollapsibleContent as r, CollapsibleTrigger as i } from "../collapsible/collapsible.js";
|
|
4
4
|
import { Spinner as a } from "../spinner/spinner.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import {
|
|
7
|
-
import { IconCheck as
|
|
6
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { IconCheck as l, IconChevronRight as u, IconX as d } from "@tabler/icons-react";
|
|
8
8
|
//#region src/components/turn-steps/turn-steps.tsx
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
var f = "flex items-start gap-2.5", p = "flex h-[1lh] w-4 flex-none items-center justify-center", m = "size-3.5", h = 1.75;
|
|
10
|
+
function g({ status: t, alarm: n }) {
|
|
11
|
+
return t === "done" ? /* @__PURE__ */ s(l, {
|
|
11
12
|
"aria-label": "Done",
|
|
12
13
|
role: "img",
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
stroke: h,
|
|
15
|
+
className: m
|
|
16
|
+
}) : t === "failed" ? /* @__PURE__ */ s(d, {
|
|
15
17
|
"aria-label": "Failed",
|
|
16
18
|
role: "img",
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
stroke: h,
|
|
20
|
+
className: e(m, n && "text-destructive")
|
|
21
|
+
}) : t === "running" ? /* @__PURE__ */ s(a, {
|
|
19
22
|
"aria-label": "Working",
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
strokeWidth: h,
|
|
24
|
+
className: e(m, "text-foreground")
|
|
25
|
+
}) : /* @__PURE__ */ s("span", {
|
|
22
26
|
"aria-label": "Waiting",
|
|
23
27
|
role: "img",
|
|
24
|
-
className: "size-2
|
|
28
|
+
className: "size-2 rounded-full border border-current"
|
|
25
29
|
});
|
|
26
30
|
}
|
|
27
|
-
function
|
|
28
|
-
return /* @__PURE__ */
|
|
31
|
+
function _({ steps: n, onRetry: r, retryLabel: i, className: a }) {
|
|
32
|
+
return /* @__PURE__ */ s("ol", {
|
|
29
33
|
"data-slot": "turn-steps-list",
|
|
30
|
-
className: e("m-0 flex list-none flex-col
|
|
31
|
-
children: n.map((n) =>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
className:
|
|
36
|
-
children: /* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
34
|
+
className: e("m-0 flex list-none flex-col gap-1 p-0", a),
|
|
35
|
+
children: n.map((n) => {
|
|
36
|
+
let a = n.status === "failed" && r !== void 0;
|
|
37
|
+
return /* @__PURE__ */ c("li", {
|
|
38
|
+
"data-status": n.status,
|
|
39
|
+
className: f,
|
|
40
|
+
children: [/* @__PURE__ */ s("span", {
|
|
41
|
+
className: p,
|
|
42
|
+
children: /* @__PURE__ */ s(g, {
|
|
43
|
+
status: n.status,
|
|
44
|
+
alarm: a
|
|
45
|
+
})
|
|
46
|
+
}), /* @__PURE__ */ c("span", {
|
|
47
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ s("span", {
|
|
50
|
+
className: e(n.status === "pending" && "text-foreground-tertiary", n.status === "running" && "shimmer font-medium text-foreground", a && "font-medium text-foreground"),
|
|
51
|
+
children: n.label
|
|
52
|
+
}),
|
|
53
|
+
n.status === "failed" && n.detail ? /* @__PURE__ */ s("span", { children: n.detail }) : null,
|
|
54
|
+
a ? /* @__PURE__ */ s(t, {
|
|
55
|
+
type: "button",
|
|
56
|
+
size: "sm",
|
|
57
|
+
variant: "secondary",
|
|
58
|
+
className: "self-start",
|
|
59
|
+
onClick: r,
|
|
60
|
+
children: i
|
|
61
|
+
}) : null
|
|
62
|
+
]
|
|
63
|
+
})]
|
|
64
|
+
}, n.id);
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function v({ label: t, defaultOpen: a, children: o }) {
|
|
69
|
+
return /* @__PURE__ */ c(n, {
|
|
70
|
+
defaultOpen: a,
|
|
71
|
+
className: "flex flex-col gap-1",
|
|
72
|
+
children: [/* @__PURE__ */ c(i, {
|
|
73
|
+
className: e(f, "group self-start rounded-sm text-left outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50"),
|
|
74
|
+
children: [/* @__PURE__ */ s("span", {
|
|
75
|
+
className: p,
|
|
76
|
+
children: /* @__PURE__ */ s(u, {
|
|
77
|
+
"aria-hidden": "true",
|
|
78
|
+
stroke: h,
|
|
79
|
+
className: e(m, "transition-transform group-data-[panel-open]:rotate-90")
|
|
80
|
+
})
|
|
81
|
+
}), t]
|
|
82
|
+
}), /* @__PURE__ */ s(r, { children: o })]
|
|
59
83
|
});
|
|
60
84
|
}
|
|
61
|
-
function
|
|
62
|
-
let
|
|
63
|
-
return /* @__PURE__ */
|
|
85
|
+
function y({ steps: t, onRetry: n, retryLabel: r = "Try again", summary: i = (e) => `Worked through ${e} ${e === 1 ? "step" : "steps"}`, defaultOpen: a = !1, recent: l = 3, className: u, ...d }) {
|
|
86
|
+
let f = t.findIndex((e) => e.status === "running" || e.status === "pending"), p = t.length > 0 && f === -1, m = n !== void 0 && t.some((e) => e.status === "failed"), h = p && !m, g = Math.max(0, (f === -1 ? t.length : f + 1) - l), y = h ? [] : t.slice(0, g), b = h ? [] : t.slice(g);
|
|
87
|
+
return /* @__PURE__ */ s("div", {
|
|
64
88
|
"data-slot": "turn-steps",
|
|
65
|
-
"data-state":
|
|
89
|
+
"data-state": h ? "done" : "live",
|
|
66
90
|
"aria-live": "polite",
|
|
67
|
-
className:
|
|
68
|
-
...
|
|
69
|
-
children:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
children:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
className: e("type-detail flex flex-col gap-1 text-muted-foreground", u),
|
|
92
|
+
...d,
|
|
93
|
+
children: h ? /* @__PURE__ */ s(v, {
|
|
94
|
+
label: i(t.length),
|
|
95
|
+
defaultOpen: a,
|
|
96
|
+
children: /* @__PURE__ */ s(_, {
|
|
97
|
+
steps: t,
|
|
98
|
+
retryLabel: r,
|
|
99
|
+
className: "pl-6.5"
|
|
100
|
+
})
|
|
101
|
+
}) : /* @__PURE__ */ c(o, { children: [y.length > 0 ? /* @__PURE__ */ s(v, {
|
|
102
|
+
label: `${y.length} earlier ${y.length === 1 ? "step" : "steps"}`,
|
|
103
|
+
defaultOpen: !1,
|
|
104
|
+
children: /* @__PURE__ */ s(_, {
|
|
105
|
+
steps: y,
|
|
106
|
+
retryLabel: r
|
|
107
|
+
})
|
|
108
|
+
}) : null, /* @__PURE__ */ s(_, {
|
|
109
|
+
steps: b,
|
|
110
|
+
onRetry: n,
|
|
111
|
+
retryLabel: r
|
|
112
|
+
})] })
|
|
88
113
|
});
|
|
89
114
|
}
|
|
90
115
|
//#endregion
|
|
91
|
-
export {
|
|
116
|
+
export { y as TurnSteps };
|
package/package.json
CHANGED
package/src/styles/globals.css
CHANGED
|
@@ -185,8 +185,8 @@
|
|
|
185
185
|
--type-body-size: 0.9375rem;
|
|
186
186
|
--type-body-line-height: 1.45;
|
|
187
187
|
--type-body-letter-spacing: 0;
|
|
188
|
-
/* Chat messages:
|
|
189
|
-
--type-chat-size: 0.
|
|
188
|
+
/* Chat messages: Claude's reply size, 15px on a 1.45 line (ADR 0036). */
|
|
189
|
+
--type-chat-size: 0.9375rem;
|
|
190
190
|
--type-chat-line-height: 1.45;
|
|
191
191
|
/* Regular 14px and 13px text for secondary lines and notes (ADR 0029). */
|
|
192
192
|
--type-small-size: 0.875rem;
|