@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.
@@ -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 the denser `type-chat`. */
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;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type TurnStepsProps = Omit<React.ComponentProps<'div'>, 'children'> & {
11
11
  /** 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 every step is done; defaults to "Worked through N steps". */
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: a live list of real steps, each with a spinner that turns into a
23
- * check. Once every step is done the list folds into one quiet line ("Worked through 5 steps") that opens on click. A
24
- * failed step shows an ×, a one-line reason and Try again, and the list stays open.
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,CAAA;IACV,2EAA2E;IAC3E,KAAK,E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IAC3D,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,yFAAyF;IACzF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACnC,qCAAqC;IACrC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,kGAAkG;IAClG,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AA+ID;;;;;;GAMG;AACH,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,OAAO,EACP,UAAwB,EACxB,OAC6D,EAC7D,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 { jsx as o, jsxs as s } from "react/jsx-runtime";
7
- import { IconCheck as c, IconChevronRight as l, IconX as u } from "@tabler/icons-react";
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
- function d({ status: e }) {
10
- return e === "done" ? /* @__PURE__ */ o(c, {
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
- className: "size-3.5 text-success"
14
- }) : e === "failed" ? /* @__PURE__ */ o(u, {
14
+ stroke: h,
15
+ className: m
16
+ }) : t === "failed" ? /* @__PURE__ */ s(d, {
15
17
  "aria-label": "Failed",
16
18
  role: "img",
17
- className: "size-3.5 text-destructive"
18
- }) : e === "running" ? /* @__PURE__ */ o(a, {
19
+ stroke: h,
20
+ className: e(m, n && "text-destructive")
21
+ }) : t === "running" ? /* @__PURE__ */ s(a, {
19
22
  "aria-label": "Working",
20
- className: "size-3.5"
21
- }) : /* @__PURE__ */ o("span", {
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.5 rounded-full border border-border"
28
+ className: "size-2 rounded-full border border-current"
25
29
  });
26
30
  }
27
- function f({ steps: n, onRetry: r, retryLabel: i, quiet: a }) {
28
- return /* @__PURE__ */ o("ol", {
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 p-0", a ? "type-detail gap-1 border-l border-border py-0.5 pl-3 text-muted-foreground" : "type-body gap-2"),
31
- children: n.map((n) => /* @__PURE__ */ s("li", {
32
- "data-status": n.status,
33
- className: "flex items-start gap-2.5",
34
- children: [/* @__PURE__ */ o("span", {
35
- className: "flex h-[1lh] w-4 flex-none items-center justify-center",
36
- children: /* @__PURE__ */ o(d, { status: n.status })
37
- }), /* @__PURE__ */ s("span", {
38
- className: "flex min-w-0 flex-col gap-1",
39
- children: [
40
- /* @__PURE__ */ o("span", {
41
- className: e(n.status === "pending" && "text-foreground-tertiary", n.status === "done" && !a && "text-muted-foreground", (n.status === "running" || n.status === "failed") && "font-medium text-foreground"),
42
- children: n.label
43
- }),
44
- n.status === "failed" && n.detail ? /* @__PURE__ */ o("span", {
45
- className: "type-detail text-muted-foreground",
46
- children: n.detail
47
- }) : null,
48
- n.status === "failed" && r ? /* @__PURE__ */ o(t, {
49
- type: "button",
50
- size: "sm",
51
- variant: "secondary",
52
- className: "self-start",
53
- onClick: r,
54
- children: i
55
- }) : null
56
- ]
57
- })]
58
- }, n.id))
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 p({ steps: e, onRetry: t, retryLabel: a = "Try again", summary: c = (e) => `Worked through ${e} ${e === 1 ? "step" : "steps"}`, defaultOpen: u = !1, className: d, ...p }) {
62
- let m = e.length > 0 && e.every((e) => e.status === "done");
63
- return /* @__PURE__ */ o("div", {
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": m ? "done" : "live",
89
+ "data-state": h ? "done" : "live",
66
90
  "aria-live": "polite",
67
- className: d,
68
- ...p,
69
- children: m ? /* @__PURE__ */ s(n, {
70
- defaultOpen: u,
71
- className: "flex flex-col gap-1.5",
72
- children: [/* @__PURE__ */ s(i, {
73
- className: "group type-detail flex items-center gap-1.5 self-start rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",
74
- children: [/* @__PURE__ */ o(l, {
75
- "aria-hidden": "true",
76
- className: "size-3 transition-transform group-data-[panel-open]:rotate-90"
77
- }), c(e.length)]
78
- }), /* @__PURE__ */ o(r, { children: /* @__PURE__ */ o(f, {
79
- steps: e,
80
- retryLabel: a,
81
- quiet: !0
82
- }) })]
83
- }) : /* @__PURE__ */ o(f, {
84
- steps: e,
85
- onRetry: t,
86
- retryLabel: a
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 { p as TurnSteps };
116
+ export { y as TurnSteps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almanaclabs/blaze-ui",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "description": "Shared React components and design tokens for Blaze",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -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: denser than body copy, so a conversation reads like one (ADR 0035). */
189
- --type-chat-size: 0.875rem;
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;