@locusgraph/loop 0.3.0 → 0.4.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.
Files changed (130) hide show
  1. package/dist/agent/index.d.ts +1 -1
  2. package/dist/agent/pulse/gradient-label.js +70 -17
  3. package/dist/agent/pulse/marks/bars-mark.js +39 -15
  4. package/dist/agent/pulse/marks/glyph-mark.js +57 -16
  5. package/dist/agent/pulse/marks/locus-mark.js +39 -13
  6. package/dist/agent/pulse/marks/orb-mark.js +21 -9
  7. package/dist/agent/pulse/pulse.js +1 -1
  8. package/dist/agent/pulse/use-loop-animation.d.ts +0 -1
  9. package/dist/agent/pulse/use-loop-animation.js +36 -15
  10. package/dist/agent/steps/step-icon.js +20 -13
  11. package/dist/agent/steps/steps.js +39 -37
  12. package/dist/agent/thinking/thinking.js +65 -62
  13. package/dist/agent/tool/json-block.js +10 -7
  14. package/dist/agent/tool/tool-status.d.ts +2 -0
  15. package/dist/agent/tool/tool-status.js +16 -13
  16. package/dist/agent/tool/tool.d.ts +8 -1
  17. package/dist/agent/tool/tool.js +238 -119
  18. package/dist/approval/inbox/inbox-row.d.ts +3 -3
  19. package/dist/approval/inbox/inbox-row.js +248 -86
  20. package/dist/approval/inbox/inbox.d.ts +3 -3
  21. package/dist/approval/inbox/inbox.js +251 -57
  22. package/dist/approval/inbox/virtual-inbox-list.d.ts +3 -3
  23. package/dist/approval/inbox/virtual-inbox-list.js +107 -30
  24. package/dist/approval/memory/memory-review.js +228 -91
  25. package/dist/approval/memory/memory-row.js +192 -56
  26. package/dist/approval/plan/plan-review.js +241 -108
  27. package/dist/approval/plan/plan-step-row.js +184 -77
  28. package/dist/approval/plan/plan-steps.d.ts +1 -1
  29. package/dist/approval/plan/plan-steps.js +2 -2
  30. package/dist/approval/plan/question-choices.js +139 -48
  31. package/dist/approval/plan/question.js +189 -67
  32. package/dist/approval/run/run-bar.js +138 -49
  33. package/dist/approval/shared/approval-line.d.ts +27 -0
  34. package/dist/approval/shared/approval-line.js +85 -0
  35. package/dist/approval/shared/risk-badge.d.ts +3 -5
  36. package/dist/approval/shared/risk-badge.js +11 -19
  37. package/dist/approval/shared/time.d.ts +0 -1
  38. package/dist/approval/shared/time.js +0 -1
  39. package/dist/approval/shared/use-focus-on-mount.js +23 -5
  40. package/dist/approval/shared/use-focus-when-settled.d.ts +2 -0
  41. package/dist/approval/shared/use-focus-when-settled.js +18 -0
  42. package/dist/approval/spend/raise-cap-form.d.ts +2 -2
  43. package/dist/approval/spend/raise-cap-form.js +235 -52
  44. package/dist/approval/spend/spend-gate.js +200 -106
  45. package/dist/approval/spend/spend-math.d.ts +1 -0
  46. package/dist/approval/spend/spend-math.js +5 -2
  47. package/dist/approval/spend/spend-meter.js +5 -5
  48. package/dist/approval/tool/approval.js +157 -96
  49. package/dist/approval/tool/args/args-editor.js +232 -81
  50. package/dist/approval/tool/args/args-field.js +333 -60
  51. package/dist/approval/tool/deny-form.js +114 -32
  52. package/dist/approval/tool/tool-inputs.js +93 -33
  53. package/dist/chat/chat/chat.js +5 -4
  54. package/dist/chat/chat/use-stick-to-bottom.js +116 -63
  55. package/dist/chat/chat/virtual-chat-items.js +129 -34
  56. package/dist/chat/composer/composer-actions.d.ts +1 -2
  57. package/dist/chat/composer/composer-actions.js +136 -50
  58. package/dist/chat/composer/composer-status.d.ts +2 -0
  59. package/dist/chat/composer/composer-status.js +3 -0
  60. package/dist/chat/composer/composer.d.ts +1 -1
  61. package/dist/chat/composer/composer.js +6 -4
  62. package/dist/chat/composer/use-auto-grow.js +29 -8
  63. package/dist/chat/files/files.js +296 -67
  64. package/dist/chat/index.d.ts +1 -1
  65. package/dist/chat/index.js +1 -1
  66. package/dist/chat/reply/fenced-code.js +1 -1
  67. package/dist/chat/reply/markdown-components.js +9 -116
  68. package/dist/chat/reply/reply.js +2 -2
  69. package/dist/chat/turn/group-parts.d.ts +1 -0
  70. package/dist/chat/turn/group-parts.js +6 -3
  71. package/dist/chat/turn/turn.js +13 -4
  72. package/dist/cost/context.js +3 -3
  73. package/dist/cost/cost-steps.js +31 -30
  74. package/dist/cost/cost.js +39 -39
  75. package/dist/cost/model-picker.js +176 -43
  76. package/dist/cost/shared/context-breakdown.js +10 -11
  77. package/dist/cost/shared/model-option-row.js +4 -3
  78. package/dist/cost/shared/step-cost-row.js +11 -12
  79. package/dist/cost/shared/usage-totals.d.ts +1 -0
  80. package/dist/cost/shared/usage-totals.js +19 -1
  81. package/dist/memory/cite.js +190 -59
  82. package/dist/memory/memorized.js +231 -62
  83. package/dist/memory/recall.js +272 -85
  84. package/dist/memory/shared/host-label.d.ts +1 -1
  85. package/dist/memory/shared/host-label.js +2 -2
  86. package/dist/memory/shared/source-mark.js +1 -1
  87. package/dist/memory/sources.d.ts +2 -1
  88. package/dist/memory/sources.js +277 -62
  89. package/dist/shared/decision-summary.js +2 -1
  90. package/dist/shared/line.d.ts +10 -0
  91. package/dist/shared/line.js +11 -0
  92. package/dist/shared/live-status.d.ts +3 -0
  93. package/dist/shared/live-status.js +11 -0
  94. package/dist/shared/reduced-motion.d.ts +1 -0
  95. package/dist/shared/reduced-motion.js +3 -0
  96. package/dist/shared/virtual/use-list-virtualizer.js +2 -0
  97. package/dist/thread/actions/action-button.js +1 -1
  98. package/dist/thread/actions/actions.d.ts +3 -1
  99. package/dist/thread/actions/actions.js +100 -81
  100. package/dist/thread/actions/branch-switcher.js +129 -23
  101. package/dist/thread/canvas/canvas-meta.d.ts +9 -0
  102. package/dist/thread/canvas/canvas-meta.js +35 -0
  103. package/dist/thread/canvas/canvas.d.ts +1 -1
  104. package/dist/thread/canvas/canvas.js +64 -74
  105. package/dist/thread/canvas/version-switcher.d.ts +1 -0
  106. package/dist/thread/canvas/version-switcher.js +161 -45
  107. package/dist/thread/code/code.js +4 -6
  108. package/dist/thread/code/copy-code-button.d.ts +2 -1
  109. package/dist/thread/code/copy-code-button.js +91 -26
  110. package/dist/thread/history/history.d.ts +1 -1
  111. package/dist/thread/history/history.js +104 -104
  112. package/dist/thread/history/row/history-row.js +106 -22
  113. package/dist/thread/history/row/thread-item-menu.js +84 -20
  114. package/dist/thread/history/row/thread-title-editor.js +74 -29
  115. package/dist/thread/history/virtual-history-list.js +83 -46
  116. package/dist/thread/index.d.ts +1 -0
  117. package/dist/thread/index.js +1 -0
  118. package/dist/thread/starters/starters.js +91 -28
  119. package/dist/thread/use-copied.js +40 -10
  120. package/package.json +6 -6
  121. package/dist/agent/shared/status-dot.d.ts +0 -1
  122. package/dist/agent/shared/status-dot.js +0 -1
  123. package/dist/approval/shared/decision-line.d.ts +0 -1
  124. package/dist/approval/shared/decision-line.js +0 -1
  125. package/dist/memory/shared/disclosure.d.ts +0 -6
  126. package/dist/memory/shared/disclosure.js +0 -6
  127. package/dist/shared/panel.d.ts +0 -19
  128. package/dist/shared/panel.js +0 -77
  129. package/dist/shared/status-dot.d.ts +0 -6
  130. package/dist/shared/status-dot.js +0 -20
@@ -1,5 +1,5 @@
1
1
  export * from "./pulse/pulse.js";
2
2
  export * from "./steps/steps.js";
3
3
  export * from "./thinking/thinking.js";
4
- export { Tool, type ToolProps } from "./tool/tool.js";
4
+ export { Tool, type ToolProps, type ToolTone } from "./tool/tool.js";
5
5
  export { toolStateLabels } from "./tool/tool-status.js";
@@ -1,5 +1,8 @@
1
- import { AiGenerate as SparkleIcon } from "@carbon/icons-react";
1
+ "use client";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
2
4
  import { cn } from "@locusgraph/components";
5
+ import { StarFour as SparkleIcon } from "@phosphor-icons/react/ssr";
3
6
  import { useLoopAnimation } from "./use-loop-animation.js";
4
7
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
8
  const drift = [{
@@ -15,30 +18,80 @@ const turn = [{
15
18
  transform: "rotate(360deg) scale(1)"
16
19
  }];
17
20
  const toneIcon = {
18
- neutral: "fill-foreground/70 text-foreground/70",
19
- brand: "fill-violet-500 text-violet-500"
21
+ neutral: "fill-muted-foreground text-muted-foreground",
22
+ brand: "fill-memory text-memory"
20
23
  };
21
24
  const toneText = {
22
- neutral: "bg-[linear-gradient(90deg,var(--color-muted-foreground),var(--color-foreground),var(--color-muted-foreground))]",
23
- brand: "bg-[linear-gradient(90deg,var(--color-sky-500),var(--color-violet-500),var(--color-pink-500),var(--color-sky-500))]"
25
+ neutral: "bg-[linear-gradient(90deg,var(--color-faint)_25%,var(--color-foreground)_50%,var(--color-faint)_75%)]",
26
+ brand: "bg-[linear-gradient(90deg,var(--color-interactive),var(--color-memory),var(--locus-s5),var(--color-interactive))]"
24
27
  };
25
- export function GradientLabel({
26
- label,
27
- tone = "neutral"
28
- }) {
28
+ export function GradientLabel(t0) {
29
+ const $ = _c(14);
30
+ const {
31
+ label,
32
+ tone: t1
33
+ } = t0;
34
+ const tone = t1 === undefined ? "neutral" : t1;
29
35
  const text = useLoopAnimation(drift, 2600, 0, "linear");
30
36
  const icon = useLoopAnimation(turn, 2600);
31
- return /*#__PURE__*/_jsxs("span", {
32
- className: "inline-flex items-center gap-1.5",
33
- children: [/*#__PURE__*/_jsx(SparkleIcon, {
37
+ const t2 = toneIcon[tone];
38
+ let t3;
39
+ if ($[0] !== t2) {
40
+ t3 = cn("size-[1.05em]", t2);
41
+ $[0] = t2;
42
+ $[1] = t3;
43
+ } else {
44
+ t3 = $[1];
45
+ }
46
+ let t4;
47
+ if ($[2] !== icon || $[3] !== t3) {
48
+ t4 = /*#__PURE__*/_jsx(SparkleIcon, {
49
+ weight: "fill",
34
50
  ref: icon,
35
51
  "aria-hidden": true,
36
- className: cn("size-[1.05em]", toneIcon[tone])
37
- }), /*#__PURE__*/_jsx("span", {
52
+ className: t3
53
+ });
54
+ $[2] = icon;
55
+ $[3] = t3;
56
+ $[4] = t4;
57
+ } else {
58
+ t4 = $[4];
59
+ }
60
+ const t5 = toneText[tone];
61
+ let t6;
62
+ if ($[5] !== t5) {
63
+ t6 = cn("bg-[length:200%_100%] bg-clip-text font-medium text-transparent", t5);
64
+ $[5] = t5;
65
+ $[6] = t6;
66
+ } else {
67
+ t6 = $[6];
68
+ }
69
+ let t7;
70
+ if ($[7] !== label || $[8] !== t6 || $[9] !== text) {
71
+ t7 = /*#__PURE__*/_jsx("span", {
38
72
  ref: text,
39
73
  "data-slot": "pulse-gradient",
40
- className: cn("bg-[length:200%_100%] bg-clip-text font-medium text-transparent", toneText[tone]),
74
+ className: t6,
41
75
  children: label
42
- })]
43
- });
76
+ });
77
+ $[7] = label;
78
+ $[8] = t6;
79
+ $[9] = text;
80
+ $[10] = t7;
81
+ } else {
82
+ t7 = $[10];
83
+ }
84
+ let t8;
85
+ if ($[11] !== t4 || $[12] !== t7) {
86
+ t8 = /*#__PURE__*/_jsxs("span", {
87
+ className: "inline-flex items-center gap-1.5",
88
+ children: [t4, t7]
89
+ });
90
+ $[11] = t4;
91
+ $[12] = t7;
92
+ $[13] = t8;
93
+ } else {
94
+ t8 = $[13];
95
+ }
96
+ return t8;
44
97
  }
@@ -1,3 +1,6 @@
1
+ "use client";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
1
4
  import { useLoopAnimation } from "../use-loop-animation.js";
2
5
  import { jsx as _jsx } from "react/jsx-runtime";
3
6
  const bounce = [{
@@ -8,22 +11,43 @@ const bounce = [{
8
11
  transform: "scaleY(0.35)"
9
12
  }];
10
13
  const barDelays = [0, 140, 280, 420];
11
- function Bar({
12
- delay
13
- }) {
14
+ function Bar(t0) {
15
+ const $ = _c(2);
16
+ const {
17
+ delay
18
+ } = t0;
14
19
  const ref = useLoopAnimation(bounce, 900, delay);
15
- return /*#__PURE__*/_jsx("span", {
16
- ref: ref,
17
- className: "h-full w-[0.16em] origin-center scale-y-[0.35] rounded-full bg-current"
18
- });
20
+ let t1;
21
+ if ($[0] !== ref) {
22
+ t1 = /*#__PURE__*/_jsx("span", {
23
+ ref: ref,
24
+ className: "h-full w-[0.16em] origin-center scale-y-[0.35] rounded-full bg-current"
25
+ });
26
+ $[0] = ref;
27
+ $[1] = t1;
28
+ } else {
29
+ t1 = $[1];
30
+ }
31
+ return t1;
19
32
  }
20
33
  export function BarsMark() {
21
- return /*#__PURE__*/_jsx("span", {
22
- "aria-hidden": true,
23
- "data-slot": "pulse-bars",
24
- className: "inline-flex h-[1em] items-center gap-[0.14em] text-foreground/70",
25
- children: barDelays.map(delay => /*#__PURE__*/_jsx(Bar, {
26
- delay: delay
27
- }, delay))
28
- });
34
+ const $ = _c(1);
35
+ let t0;
36
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
37
+ t0 = /*#__PURE__*/_jsx("span", {
38
+ "aria-hidden": true,
39
+ "data-slot": "pulse-bars",
40
+ className: "inline-flex h-[1em] items-center gap-[0.14em] text-muted-foreground",
41
+ children: barDelays.map(_temp)
42
+ });
43
+ $[0] = t0;
44
+ } else {
45
+ t0 = $[0];
46
+ }
47
+ return t0;
48
+ }
49
+ function _temp(delay) {
50
+ return /*#__PURE__*/_jsx(Bar, {
51
+ delay: delay
52
+ }, delay);
29
53
  }
@@ -1,23 +1,64 @@
1
+ "use client";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
1
4
  import { cn } from "@locusgraph/components";
2
5
  import { useEffect, useState } from "react";
3
- import { prefersReducedMotion } from "../use-loop-animation.js";
6
+ import { prefersReducedMotion } from "../../../shared/reduced-motion.js";
4
7
  import { jsx as _jsx } from "react/jsx-runtime";
5
8
  const glyphs = ["·", "✢", "✳", "✶", "✻", "✽", "✻", "✶", "✳", "✢"];
6
9
  const restingGlyph = "✻";
7
- export function GlyphMark({
8
- tone = "neutral"
9
- }) {
10
+ export function GlyphMark(t0) {
11
+ const $ = _c(7);
12
+ const {
13
+ tone: t1
14
+ } = t0;
15
+ const tone = t1 === undefined ? "neutral" : t1;
10
16
  const [index, setIndex] = useState();
11
- useEffect(() => {
12
- if (prefersReducedMotion()) return;
13
- setIndex(0);
14
- const timer = window.setInterval(() => setIndex(current => ((current ?? 0) + 1) % glyphs.length), 120);
15
- return () => window.clearInterval(timer);
16
- }, []);
17
- return /*#__PURE__*/_jsx("span", {
18
- "aria-hidden": true,
19
- "data-slot": "pulse-glyph",
20
- className: cn("inline-flex w-[1.1em] justify-center font-mono text-[1.15em] leading-none", tone === "brand" ? "text-orange-500" : "text-foreground/70"),
21
- children: index === undefined ? restingGlyph : glyphs[index]
22
- });
17
+ let t2;
18
+ let t3;
19
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
20
+ t2 = () => {
21
+ if (prefersReducedMotion()) {
22
+ return;
23
+ }
24
+ setIndex(0);
25
+ const timer = window.setInterval(() => setIndex(_temp), 120);
26
+ return () => window.clearInterval(timer);
27
+ };
28
+ t3 = [];
29
+ $[0] = t2;
30
+ $[1] = t3;
31
+ } else {
32
+ t2 = $[0];
33
+ t3 = $[1];
34
+ }
35
+ useEffect(t2, t3);
36
+ const t4 = tone === "brand" ? "text-[var(--locus-s2)]" : "text-muted-foreground";
37
+ let t5;
38
+ if ($[2] !== t4) {
39
+ t5 = cn("inline-flex w-[1.1em] justify-center font-mono text-[1.15em] leading-none", t4);
40
+ $[2] = t4;
41
+ $[3] = t5;
42
+ } else {
43
+ t5 = $[3];
44
+ }
45
+ const t6 = index === undefined ? restingGlyph : glyphs[index];
46
+ let t7;
47
+ if ($[4] !== t5 || $[5] !== t6) {
48
+ t7 = /*#__PURE__*/_jsx("span", {
49
+ "aria-hidden": true,
50
+ "data-slot": "pulse-glyph",
51
+ className: t5,
52
+ children: t6
53
+ });
54
+ $[4] = t5;
55
+ $[5] = t6;
56
+ $[6] = t7;
57
+ } else {
58
+ t7 = $[6];
59
+ }
60
+ return t7;
61
+ }
62
+ function _temp(current) {
63
+ return ((current ?? 0) + 1) % glyphs.length;
23
64
  }
@@ -1,6 +1,9 @@
1
+ "use client";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
1
4
  import { LocusGraphMark } from "@locusgraph/brand";
2
5
  import { useEffect, useRef } from "react";
3
- import { prefersReducedMotion } from "../use-loop-animation.js";
6
+ import { prefersReducedMotion } from "../../../shared/reduced-motion.js";
4
7
  import { jsx as _jsx } from "react/jsx-runtime";
5
8
  const sweepMs = 1800;
6
9
  const markCenter = {
@@ -32,18 +35,41 @@ function animateRays(svg) {
32
35
  }));
33
36
  }
34
37
  export function LocusMark() {
38
+ const $ = _c(3);
35
39
  const ref = useRef(null);
36
- useEffect(() => {
37
- const svg = ref.current;
38
- if (!svg || prefersReducedMotion()) return;
39
- const animations = animateRays(svg);
40
- return () => {
41
- for (const animation of animations) animation.cancel();
40
+ let t0;
41
+ let t1;
42
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
43
+ t0 = () => {
44
+ const svg = ref.current;
45
+ if (!svg || prefersReducedMotion()) {
46
+ return;
47
+ }
48
+ const animations = animateRays(svg);
49
+ return () => {
50
+ for (const animation of animations) {
51
+ animation.cancel();
52
+ }
53
+ };
42
54
  };
43
- }, []);
44
- return /*#__PURE__*/_jsx(LocusGraphMark, {
45
- ref: ref,
46
- "data-slot": "pulse-locus",
47
- className: "h-[1.35em] w-auto text-foreground"
48
- });
55
+ t1 = [];
56
+ $[0] = t0;
57
+ $[1] = t1;
58
+ } else {
59
+ t0 = $[0];
60
+ t1 = $[1];
61
+ }
62
+ useEffect(t0, t1);
63
+ let t2;
64
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
65
+ t2 = /*#__PURE__*/_jsx(LocusGraphMark, {
66
+ ref: ref,
67
+ "data-slot": "pulse-locus",
68
+ className: "h-[1.35em] w-auto text-foreground"
69
+ });
70
+ $[2] = t2;
71
+ } else {
72
+ t2 = $[2];
73
+ }
74
+ return t2;
49
75
  }
@@ -1,3 +1,6 @@
1
+ "use client";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
1
4
  import { useLoopAnimation } from "../use-loop-animation.js";
2
5
  import { jsx as _jsx } from "react/jsx-runtime";
3
6
  const breathe = [{
@@ -11,14 +14,23 @@ const breathe = [{
11
14
  opacity: 1
12
15
  }];
13
16
  export function OrbMark() {
17
+ const $ = _c(2);
14
18
  const ref = useLoopAnimation(breathe, 1500);
15
- return /*#__PURE__*/_jsx("span", {
16
- "aria-hidden": true,
17
- className: "inline-flex size-[1.25em] items-center justify-center",
18
- children: /*#__PURE__*/_jsx("span", {
19
- ref: ref,
20
- "data-slot": "pulse-orb",
21
- className: "size-[0.8em] rounded-full bg-foreground"
22
- })
23
- });
19
+ let t0;
20
+ if ($[0] !== ref) {
21
+ t0 = /*#__PURE__*/_jsx("span", {
22
+ "aria-hidden": true,
23
+ className: "inline-flex size-[1.25em] items-center justify-center",
24
+ children: /*#__PURE__*/_jsx("span", {
25
+ ref: ref,
26
+ "data-slot": "pulse-orb",
27
+ className: "size-[0.8em] rounded-full bg-foreground"
28
+ })
29
+ });
30
+ $[0] = ref;
31
+ $[1] = t0;
32
+ } else {
33
+ t0 = $[1];
34
+ }
35
+ return t0;
24
36
  }
@@ -13,7 +13,7 @@ function TypingDots() {
13
13
  "aria-hidden": true,
14
14
  className: "flex h-5 items-center gap-1",
15
15
  children: dotDelays.map(delay => /*#__PURE__*/_jsx("span", {
16
- className: cn("size-1.5 rounded-full bg-muted-foreground/70 motion-safe:animate-pulse", delay)
16
+ className: cn("size-1.5 rounded-full bg-muted-foreground motion-safe:animate-pulse", delay)
17
17
  }, delay))
18
18
  });
19
19
  }
@@ -1,2 +1 @@
1
- export declare function prefersReducedMotion(): boolean;
2
1
  export declare function useLoopAnimation<T extends Element>(keyframes: Keyframe[], duration: number, delay?: number, easing?: string): import("react").RefObject<T | null>;
@@ -1,19 +1,40 @@
1
+ "use client";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
1
4
  import { useEffect, useRef } from "react";
2
- export function prefersReducedMotion() {
3
- return typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === true;
4
- }
5
- export function useLoopAnimation(keyframes, duration, delay = 0, easing = "ease-in-out") {
5
+ import { prefersReducedMotion } from "../../shared/reduced-motion.js";
6
+ export function useLoopAnimation(keyframes, duration, t0, t1) {
7
+ const $ = _c(6);
8
+ const delay = t0 === undefined ? 0 : t0;
9
+ const easing = t1 === undefined ? "ease-in-out" : t1;
6
10
  const ref = useRef(null);
7
- useEffect(() => {
8
- const element = ref.current;
9
- if (!element || typeof element.animate !== "function" || prefersReducedMotion()) return;
10
- const animation = element.animate(keyframes, {
11
- duration,
12
- delay,
13
- easing,
14
- iterations: Number.POSITIVE_INFINITY
15
- });
16
- return () => animation.cancel();
17
- }, [keyframes, duration, delay, easing]);
11
+ let t2;
12
+ let t3;
13
+ if ($[0] !== delay || $[1] !== duration || $[2] !== easing || $[3] !== keyframes) {
14
+ t2 = () => {
15
+ const element = ref.current;
16
+ if (!element || typeof element.animate !== "function" || prefersReducedMotion()) {
17
+ return;
18
+ }
19
+ const animation = element.animate(keyframes, {
20
+ duration,
21
+ delay,
22
+ easing,
23
+ iterations: Number.POSITIVE_INFINITY
24
+ });
25
+ return () => animation.cancel();
26
+ };
27
+ t3 = [keyframes, duration, delay, easing];
28
+ $[0] = delay;
29
+ $[1] = duration;
30
+ $[2] = easing;
31
+ $[3] = keyframes;
32
+ $[4] = t2;
33
+ $[5] = t3;
34
+ } else {
35
+ t2 = $[4];
36
+ t3 = $[5];
37
+ }
38
+ useEffect(t2, t3);
18
39
  return ref;
19
40
  }
@@ -1,5 +1,5 @@
1
- import { Checkmark as CheckIcon, InProgress as LoaderCircleIcon, Subtract as MinusIcon, Close as XIcon } from "@carbon/icons-react";
2
1
  import { cn } from "@locusgraph/components";
2
+ import { Check as CheckIcon, CircleNotch as LoaderCircleIcon, Minus as MinusIcon, X as XIcon } from "@phosphor-icons/react/ssr";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export const stepStatusLabels = {
5
5
  pending: "Pending",
@@ -8,29 +8,36 @@ export const stepStatusLabels = {
8
8
  failed: "Failed",
9
9
  skipped: "Skipped"
10
10
  };
11
- const stepIconFrames = {
12
- pending: "bg-card ring-1 ring-muted-foreground/40 ring-inset",
13
- running: "bg-card text-warn",
14
- done: "bg-good text-white dark:text-background",
15
- failed: "bg-destructive text-white",
16
- skipped: "bg-muted text-muted-foreground"
11
+ const stepIconTones = {
12
+ pending: "text-faint",
13
+ running: "text-warn",
14
+ done: "text-good",
15
+ failed: "text-destructive",
16
+ skipped: "text-faint"
17
17
  };
18
18
  function StepGlyph({
19
19
  status
20
20
  }) {
21
21
  if (status === "running") return /*#__PURE__*/_jsx(LoaderCircleIcon, {
22
- className: "size-4 motion-safe:animate-spin"
22
+ weight: "bold",
23
+ "aria-hidden": true,
24
+ className: "motion-safe:animate-spin"
23
25
  });
24
26
  if (status === "done") return /*#__PURE__*/_jsx(CheckIcon, {
25
- className: "size-2.5"
27
+ weight: "bold",
28
+ "aria-hidden": true
26
29
  });
27
30
  if (status === "failed") return /*#__PURE__*/_jsx(XIcon, {
28
- className: "size-2.5"
31
+ weight: "bold",
32
+ "aria-hidden": true
29
33
  });
30
34
  if (status === "skipped") return /*#__PURE__*/_jsx(MinusIcon, {
31
- className: "size-2.5"
35
+ weight: "bold",
36
+ "aria-hidden": true
37
+ });
38
+ return /*#__PURE__*/_jsx("span", {
39
+ className: "size-1.5 rounded-full bg-current"
32
40
  });
33
- return null;
34
41
  }
35
42
  export function StepIcon({
36
43
  status,
@@ -39,7 +46,7 @@ export function StepIcon({
39
46
  return /*#__PURE__*/_jsx("span", {
40
47
  "aria-hidden": true,
41
48
  "data-slot": "step-icon",
42
- className: cn("relative z-10 mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full", stepIconFrames[status], current && status === "pending" && "ring-foreground/60"),
49
+ className: cn("flex size-4 shrink-0 items-center justify-center [&_svg]:size-3.5", stepIconTones[status], current && status === "pending" && "text-foreground"),
43
50
  children: /*#__PURE__*/_jsx(StepGlyph, {
44
51
  status: status
45
52
  })
@@ -1,14 +1,14 @@
1
- import { ListChecked as ListChecksIcon } from "@carbon/icons-react";
2
1
  import { cn } from "@locusgraph/components";
3
- import { ApprovalPanel, PanelHeader } from "../../shared/panel.js";
2
+ import { ListChecks as ListChecksIcon } from "@phosphor-icons/react/ssr";
3
+ import { lineIconClass, lineRowClass } from "../../shared/line.js";
4
4
  import { StepIcon, stepStatusLabels } from "./step-icon.js";
5
5
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  const stepTitleTones = {
7
- pending: "text-muted-foreground",
8
- running: "text-foreground font-medium",
9
- done: "text-foreground",
10
- failed: "text-foreground font-medium",
11
- skipped: "text-muted-foreground line-through"
7
+ pending: "text-faint",
8
+ running: "font-medium text-foreground",
9
+ done: "text-muted-foreground",
10
+ failed: "font-medium text-foreground",
11
+ skipped: "text-faint line-through decoration-faint"
12
12
  };
13
13
  function currentStepId(steps) {
14
14
  const running = steps.find(step => step.status === "running");
@@ -20,38 +20,31 @@ function progressLabel(steps) {
20
20
  const done = steps.filter(step => step.status === "done").length;
21
21
  return `${done} of ${steps.length} done`;
22
22
  }
23
- function progressTone(steps) {
24
- if (steps.some(step => step.status === "failed")) return "danger";
25
- if (steps.some(step => step.status === "running")) return "waiting";
26
- const settled = steps.every(step => step.status === "done" || step.status === "skipped");
27
- return steps.length > 0 && settled ? "done" : "idle";
28
- }
29
23
  function StepRow({
30
24
  step,
31
- current,
32
- last
25
+ current
33
26
  }) {
34
27
  return /*#__PURE__*/_jsxs("li", {
35
28
  "data-slot": "step",
36
29
  "data-status": step.status,
37
30
  "aria-current": current ? "step" : undefined,
38
- className: "relative flex gap-3 pb-4 last:pb-0",
39
- children: [!last && /*#__PURE__*/_jsx("span", {
40
- "aria-hidden": true,
41
- className: "absolute top-5 bottom-0.5 left-[7.5px] w-px bg-border"
42
- }), /*#__PURE__*/_jsx(StepIcon, {
43
- status: step.status,
44
- current: current
31
+ className: "flex gap-2 py-1",
32
+ children: [/*#__PURE__*/_jsx("span", {
33
+ className: "flex h-5 items-center",
34
+ children: /*#__PURE__*/_jsx(StepIcon, {
35
+ status: step.status,
36
+ current: current
37
+ })
45
38
  }), /*#__PURE__*/_jsxs("div", {
46
39
  className: "flex min-w-0 flex-col gap-0.5",
47
40
  children: [/*#__PURE__*/_jsxs("span", {
48
- className: cn("text-sm leading-snug", stepTitleTones[step.status], current && step.status === "pending" && "text-foreground"),
41
+ className: cn("leading-5", stepTitleTones[step.status], current && step.status === "pending" && "text-foreground"),
49
42
  children: [step.title, /*#__PURE__*/_jsxs("span", {
50
43
  className: "sr-only",
51
44
  children: [" (", stepStatusLabels[step.status], ")"]
52
45
  })]
53
46
  }), step.detail && /*#__PURE__*/_jsx("span", {
54
- className: cn("font-mono text-xs text-muted-foreground", step.status === "failed" && "font-sans text-destructive"),
47
+ className: cn("text-xs text-faint", step.status === "failed" && "text-destructive"),
55
48
  children: step.detail
56
49
  })]
57
50
  })]
@@ -63,23 +56,32 @@ export function Steps({
63
56
  className
64
57
  }) {
65
58
  const currentId = currentStepId(steps);
66
- return /*#__PURE__*/_jsxs(ApprovalPanel, {
59
+ return /*#__PURE__*/_jsxs("section", {
67
60
  "data-slot": "steps",
68
61
  "aria-label": title,
69
- className: className,
70
- children: [/*#__PURE__*/_jsx(PanelHeader, {
71
- icon: /*#__PURE__*/_jsx(ListChecksIcon, {
72
- "aria-hidden": true
73
- }),
74
- eyebrow: title,
75
- status: progressLabel(steps),
76
- tone: progressTone(steps)
62
+ className: cn("flex min-w-0 flex-col", className),
63
+ children: [/*#__PURE__*/_jsxs("header", {
64
+ className: lineRowClass,
65
+ children: [/*#__PURE__*/_jsx("span", {
66
+ "aria-hidden": true,
67
+ className: lineIconClass,
68
+ children: /*#__PURE__*/_jsx(ListChecksIcon, {
69
+ weight: "bold",
70
+ "aria-hidden": true
71
+ })
72
+ }), /*#__PURE__*/_jsx("span", {
73
+ className: "truncate",
74
+ children: title
75
+ }), /*#__PURE__*/_jsx("span", {
76
+ "aria-live": "polite",
77
+ className: "shrink-0 text-faint tabular-nums",
78
+ children: progressLabel(steps)
79
+ })]
77
80
  }), /*#__PURE__*/_jsx("ol", {
78
- className: "flex flex-col px-5 pt-4 pb-5",
79
- children: steps.map((step, position) => /*#__PURE__*/_jsx(StepRow, {
81
+ className: "flex min-w-0 flex-col text-sm",
82
+ children: steps.map(step => /*#__PURE__*/_jsx(StepRow, {
80
83
  step: step,
81
- current: step.id === currentId,
82
- last: position === steps.length - 1
84
+ current: step.id === currentId
83
85
  }, step.id))
84
86
  })]
85
87
  });