@locusgraph/loop 0.1.0 → 0.2.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/README.md +2 -0
- package/dist/agent/pulse/gradient-label.js +86 -15
- package/dist/agent/pulse/marks/bars-mark.js +46 -10
- package/dist/agent/pulse/marks/glyph-mark.js +56 -11
- package/dist/agent/pulse/marks/locus-mark.js +63 -28
- package/dist/agent/pulse/marks/orb-mark.js +31 -8
- package/dist/agent/pulse/marks/spinner-mark.js +29 -1
- package/dist/agent/pulse/pulse.js +150 -35
- package/dist/agent/pulse/use-loop-animation.js +36 -17
- package/dist/agent/steps/step-icon.js +110 -24
- package/dist/agent/steps/steps.js +235 -25
- package/dist/agent/thinking/thinking.js +203 -23
- package/dist/agent/thinking/thought-duration.js +7 -9
- package/dist/agent/tool/json-block.js +38 -11
- package/dist/agent/tool/tool-status.js +51 -18
- package/dist/agent/tool/tool.js +184 -6
- package/dist/approval/inbox/inbox-row.d.ts +3 -2
- package/dist/approval/inbox/inbox-row.js +321 -7
- package/dist/approval/inbox/inbox-selection.js +7 -13
- package/dist/approval/inbox/inbox.d.ts +2 -1
- package/dist/approval/inbox/inbox.js +250 -18
- package/dist/approval/inbox/virtual-inbox-list.d.ts +13 -0
- package/dist/approval/inbox/virtual-inbox-list.js +129 -0
- package/dist/approval/memory/memory-choices.js +27 -22
- package/dist/approval/memory/memory-review.js +242 -17
- package/dist/approval/memory/memory-row.js +215 -19
- package/dist/approval/plan/plan-review.js +279 -28
- package/dist/approval/plan/plan-step-row.js +194 -43
- package/dist/approval/plan/plan-steps.js +24 -23
- package/dist/approval/plan/question-choices.js +158 -39
- package/dist/approval/plan/question.d.ts +1 -1
- package/dist/approval/plan/question.js +223 -26
- package/dist/approval/run/run-bar.js +178 -22
- package/dist/approval/shared/decision-line.js +1 -1
- package/dist/approval/shared/risk-badge.js +47 -16
- package/dist/approval/shared/time.js +5 -8
- package/dist/approval/shared/use-focus-on-mount.js +23 -6
- package/dist/approval/spend/raise-cap-form.js +235 -17
- package/dist/approval/spend/spend-gate.js +239 -21
- package/dist/approval/spend/spend-math.js +7 -8
- package/dist/approval/spend/spend-meter.js +362 -34
- package/dist/approval/tool/approval.js +272 -27
- package/dist/approval/tool/args/args-editor.js +262 -26
- package/dist/approval/tool/args/args-field.js +259 -19
- package/dist/approval/tool/args/args-validation.js +38 -47
- package/dist/approval/tool/deny-form.js +130 -10
- package/dist/approval/tool/tool-inputs.js +127 -38
- package/dist/chat/chat/chat-item-spacing.d.ts +3 -0
- package/dist/chat/chat/chat-item-spacing.js +19 -0
- package/dist/chat/chat/chat.d.ts +2 -1
- package/dist/chat/chat/chat.js +181 -5
- package/dist/chat/chat/use-stick-to-bottom.js +123 -47
- package/dist/chat/chat/virtual-chat-items.d.ts +8 -0
- package/dist/chat/chat/virtual-chat-items.js +153 -0
- package/dist/chat/composer/composer-actions.js +151 -16
- package/dist/chat/composer/composer.js +330 -32
- package/dist/chat/composer/use-auto-grow.js +24 -9
- package/dist/chat/files/file-meta.js +19 -19
- package/dist/chat/files/files.js +316 -28
- package/dist/chat/reply/fenced-code.js +45 -21
- package/dist/chat/reply/markdown-components.js +137 -17
- package/dist/chat/reply/reply.js +105 -10
- package/dist/chat/turn/group-parts.js +43 -29
- package/dist/chat/turn/turn.js +238 -30
- package/dist/cost/context.js +321 -23
- package/dist/cost/cost-steps.js +220 -14
- package/dist/cost/cost.js +521 -27
- package/dist/cost/model-picker.js +181 -6
- package/dist/cost/shared/context-breakdown.js +299 -10
- package/dist/cost/shared/meter-marks.js +107 -9
- package/dist/cost/shared/model-option-row.js +178 -21
- package/dist/cost/shared/step-cost-row.js +248 -20
- package/dist/cost/shared/usage-totals.js +22 -18
- package/dist/memory/cite.js +182 -11
- package/dist/memory/memorized.js +217 -11
- package/dist/memory/recall.js +296 -17
- package/dist/memory/shared/host-label.js +19 -22
- package/dist/memory/shared/source-mark.js +39 -3
- package/dist/memory/sources.js +255 -13
- package/dist/shared/decision-summary.js +133 -14
- package/dist/shared/panel-empty.js +78 -3
- package/dist/shared/panel.js +243 -13
- package/dist/shared/status-dot.js +38 -8
- package/dist/shared/virtual/use-list-virtualizer.d.ts +24 -0
- package/dist/shared/virtual/use-list-virtualizer.js +68 -0
- package/dist/thread/actions/action-button.js +65 -3
- package/dist/thread/actions/actions.js +184 -13
- package/dist/thread/actions/branch-switcher.js +102 -5
- package/dist/thread/canvas/canvas.js +205 -5
- package/dist/thread/canvas/version-switcher.js +149 -8
- package/dist/thread/code/code.js +186 -24
- package/dist/thread/code/copy-code-button.js +61 -13
- package/dist/thread/code/highlight.js +30 -29
- package/dist/thread/history/history-rows.d.ts +16 -0
- package/dist/thread/history/history-rows.js +23 -0
- package/dist/thread/history/history.d.ts +3 -2
- package/dist/thread/history/history.js +174 -5
- package/dist/thread/history/{history-row.d.ts → row/history-row.d.ts} +3 -2
- package/dist/thread/history/row/history-row.js +137 -0
- package/dist/thread/history/row/thread-item-menu.js +84 -0
- package/dist/thread/history/row/thread-title-editor.js +81 -0
- package/dist/thread/history/thread-groups.d.ts +1 -1
- package/dist/thread/history/thread-groups.js +40 -34
- package/dist/thread/history/virtual-history-list.d.ts +11 -0
- package/dist/thread/history/virtual-history-list.js +107 -0
- package/dist/thread/index.d.ts +1 -1
- package/dist/thread/starters/starters.js +92 -7
- package/dist/thread/use-copied.js +45 -15
- package/dist/types.js +1 -1
- package/package.json +6 -4
- package/dist/thread/history/history-row.js +0 -17
- package/dist/thread/history/thread-item-menu.js +0 -6
- package/dist/thread/history/thread-title-editor.js +0 -25
- /package/dist/thread/history/{thread-item-menu.d.ts → row/thread-item-menu.d.ts} +0 -0
- /package/dist/thread/history/{thread-title-editor.d.ts → row/thread-title-editor.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -22,6 +22,8 @@ import { Chat, Composer, Turn } from "@locusgraph/loop";
|
|
|
22
22
|
<Composer status={status} onSubmit={(text) => sendMessage({ text })} onStop={stop} />
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
`Chat`, `History` and `Inbox` virtualize with TanStack Virtual above 50 items: only the rows near the viewport are mounted, so a long agent session stays fast. Pass `virtualize={false}` to mount every item. The built package is compiled with the React Compiler, so components skip re-rendering when their props have not changed.
|
|
26
|
+
|
|
25
27
|
| Group | Components |
|
|
26
28
|
|---|---|
|
|
27
29
|
| Chat | `Chat`, `Turn`, `Reply`, `Composer`, `Files` |
|
|
@@ -1,23 +1,94 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { AiGenerate as SparkleIcon } from "@carbon/icons-react";
|
|
3
3
|
import { cn } from "@locusgraph/components";
|
|
4
4
|
import { useLoopAnimation } from "./use-loop-animation.js";
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
];
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
const drift = [{
|
|
7
|
+
backgroundPosition: "0% 50%"
|
|
8
|
+
}, {
|
|
9
|
+
backgroundPosition: "200% 50%"
|
|
10
|
+
}];
|
|
11
|
+
const turn = [{
|
|
12
|
+
transform: "rotate(0deg) scale(1)"
|
|
13
|
+
}, {
|
|
14
|
+
transform: "rotate(180deg) scale(0.8)"
|
|
15
|
+
}, {
|
|
16
|
+
transform: "rotate(360deg) scale(1)"
|
|
17
|
+
}];
|
|
11
18
|
const toneIcon = {
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
neutral: "fill-foreground/70 text-foreground/70",
|
|
20
|
+
brand: "fill-violet-500 text-violet-500"
|
|
14
21
|
};
|
|
15
22
|
const toneText = {
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
neutral: "bg-[linear-gradient(90deg,var(--color-muted-foreground),var(--color-foreground),var(--color-muted-foreground))]",
|
|
24
|
+
brand: "bg-[linear-gradient(90deg,var(--color-sky-500),var(--color-violet-500),var(--color-pink-500),var(--color-sky-500))]"
|
|
18
25
|
};
|
|
19
|
-
export function GradientLabel(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
export function GradientLabel(t0) {
|
|
27
|
+
const $ = _c(14);
|
|
28
|
+
const {
|
|
29
|
+
label,
|
|
30
|
+
tone: t1
|
|
31
|
+
} = t0;
|
|
32
|
+
const tone = t1 === undefined ? "neutral" : t1;
|
|
33
|
+
const text = useLoopAnimation(drift, 2600, 0, "linear");
|
|
34
|
+
const icon = useLoopAnimation(turn, 2600);
|
|
35
|
+
const t2 = toneIcon[tone];
|
|
36
|
+
let t3;
|
|
37
|
+
if ($[0] !== t2) {
|
|
38
|
+
t3 = cn("size-[1.05em]", t2);
|
|
39
|
+
$[0] = t2;
|
|
40
|
+
$[1] = t3;
|
|
41
|
+
} else {
|
|
42
|
+
t3 = $[1];
|
|
43
|
+
}
|
|
44
|
+
let t4;
|
|
45
|
+
if ($[2] !== icon || $[3] !== t3) {
|
|
46
|
+
t4 = /*#__PURE__*/_jsx(SparkleIcon, {
|
|
47
|
+
ref: icon,
|
|
48
|
+
"aria-hidden": true,
|
|
49
|
+
className: t3
|
|
50
|
+
});
|
|
51
|
+
$[2] = icon;
|
|
52
|
+
$[3] = t3;
|
|
53
|
+
$[4] = t4;
|
|
54
|
+
} else {
|
|
55
|
+
t4 = $[4];
|
|
56
|
+
}
|
|
57
|
+
const t5 = toneText[tone];
|
|
58
|
+
let t6;
|
|
59
|
+
if ($[5] !== t5) {
|
|
60
|
+
t6 = cn("bg-[length:200%_100%] bg-clip-text font-medium text-transparent", t5);
|
|
61
|
+
$[5] = t5;
|
|
62
|
+
$[6] = t6;
|
|
63
|
+
} else {
|
|
64
|
+
t6 = $[6];
|
|
65
|
+
}
|
|
66
|
+
let t7;
|
|
67
|
+
if ($[7] !== label || $[8] !== t6 || $[9] !== text) {
|
|
68
|
+
t7 = /*#__PURE__*/_jsx("span", {
|
|
69
|
+
ref: text,
|
|
70
|
+
"data-slot": "pulse-gradient",
|
|
71
|
+
className: t6,
|
|
72
|
+
children: label
|
|
73
|
+
});
|
|
74
|
+
$[7] = label;
|
|
75
|
+
$[8] = t6;
|
|
76
|
+
$[9] = text;
|
|
77
|
+
$[10] = t7;
|
|
78
|
+
} else {
|
|
79
|
+
t7 = $[10];
|
|
80
|
+
}
|
|
81
|
+
let t8;
|
|
82
|
+
if ($[11] !== t4 || $[12] !== t7) {
|
|
83
|
+
t8 = /*#__PURE__*/_jsxs("span", {
|
|
84
|
+
className: "inline-flex items-center gap-1.5",
|
|
85
|
+
children: [t4, t7]
|
|
86
|
+
});
|
|
87
|
+
$[11] = t4;
|
|
88
|
+
$[12] = t7;
|
|
89
|
+
$[13] = t8;
|
|
90
|
+
} else {
|
|
91
|
+
t8 = $[13];
|
|
92
|
+
}
|
|
93
|
+
return t8;
|
|
23
94
|
}
|
|
@@ -1,15 +1,51 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useLoopAnimation } from "../use-loop-animation.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
const bounce = [{
|
|
5
|
+
transform: "scaleY(0.35)"
|
|
6
|
+
}, {
|
|
7
|
+
transform: "scaleY(1)"
|
|
8
|
+
}, {
|
|
9
|
+
transform: "scaleY(0.35)"
|
|
10
|
+
}];
|
|
8
11
|
const barDelays = [0, 140, 280, 420];
|
|
9
|
-
function Bar(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
function Bar(t0) {
|
|
13
|
+
const $ = _c(2);
|
|
14
|
+
const {
|
|
15
|
+
delay
|
|
16
|
+
} = t0;
|
|
17
|
+
const ref = useLoopAnimation(bounce, 900, delay);
|
|
18
|
+
let t1;
|
|
19
|
+
if ($[0] !== ref) {
|
|
20
|
+
t1 = /*#__PURE__*/_jsx("span", {
|
|
21
|
+
ref: ref,
|
|
22
|
+
className: "h-full w-[0.16em] origin-center scale-y-[0.35] rounded-full bg-current"
|
|
23
|
+
});
|
|
24
|
+
$[0] = ref;
|
|
25
|
+
$[1] = t1;
|
|
26
|
+
} else {
|
|
27
|
+
t1 = $[1];
|
|
28
|
+
}
|
|
29
|
+
return t1;
|
|
12
30
|
}
|
|
13
31
|
export function BarsMark() {
|
|
14
|
-
|
|
32
|
+
const $ = _c(1);
|
|
33
|
+
let t0;
|
|
34
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
35
|
+
t0 = /*#__PURE__*/_jsx("span", {
|
|
36
|
+
"aria-hidden": true,
|
|
37
|
+
"data-slot": "pulse-bars",
|
|
38
|
+
className: "inline-flex h-[1em] items-center gap-[0.14em] text-foreground/70",
|
|
39
|
+
children: barDelays.map(_temp)
|
|
40
|
+
});
|
|
41
|
+
$[0] = t0;
|
|
42
|
+
} else {
|
|
43
|
+
t0 = $[0];
|
|
44
|
+
}
|
|
45
|
+
return t0;
|
|
46
|
+
}
|
|
47
|
+
function _temp(delay) {
|
|
48
|
+
return /*#__PURE__*/_jsx(Bar, {
|
|
49
|
+
delay: delay
|
|
50
|
+
}, delay);
|
|
15
51
|
}
|
|
@@ -1,17 +1,62 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { cn } from "@locusgraph/components";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { prefersReducedMotion } from "../use-loop-animation.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
const glyphs = ["·", "✢", "✳", "✶", "✻", "✽", "✻", "✶", "✳", "✢"];
|
|
6
7
|
const restingGlyph = "✻";
|
|
7
|
-
export function GlyphMark(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
export function GlyphMark(t0) {
|
|
9
|
+
const $ = _c(7);
|
|
10
|
+
const {
|
|
11
|
+
tone: t1
|
|
12
|
+
} = t0;
|
|
13
|
+
const tone = t1 === undefined ? "neutral" : t1;
|
|
14
|
+
const [index, setIndex] = useState();
|
|
15
|
+
let t2;
|
|
16
|
+
let t3;
|
|
17
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
18
|
+
t2 = () => {
|
|
19
|
+
if (prefersReducedMotion()) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
setIndex(0);
|
|
23
|
+
const timer = window.setInterval(() => setIndex(_temp), 120);
|
|
24
|
+
return () => window.clearInterval(timer);
|
|
25
|
+
};
|
|
26
|
+
t3 = [];
|
|
27
|
+
$[0] = t2;
|
|
28
|
+
$[1] = t3;
|
|
29
|
+
} else {
|
|
30
|
+
t2 = $[0];
|
|
31
|
+
t3 = $[1];
|
|
32
|
+
}
|
|
33
|
+
useEffect(t2, t3);
|
|
34
|
+
const t4 = tone === "brand" ? "text-orange-500" : "text-foreground/70";
|
|
35
|
+
let t5;
|
|
36
|
+
if ($[2] !== t4) {
|
|
37
|
+
t5 = cn("inline-flex w-[1.1em] justify-center font-mono text-[1.15em] leading-none", t4);
|
|
38
|
+
$[2] = t4;
|
|
39
|
+
$[3] = t5;
|
|
40
|
+
} else {
|
|
41
|
+
t5 = $[3];
|
|
42
|
+
}
|
|
43
|
+
const t6 = index === undefined ? restingGlyph : glyphs[index];
|
|
44
|
+
let t7;
|
|
45
|
+
if ($[4] !== t5 || $[5] !== t6) {
|
|
46
|
+
t7 = /*#__PURE__*/_jsx("span", {
|
|
47
|
+
"aria-hidden": true,
|
|
48
|
+
"data-slot": "pulse-glyph",
|
|
49
|
+
className: t5,
|
|
50
|
+
children: t6
|
|
51
|
+
});
|
|
52
|
+
$[4] = t5;
|
|
53
|
+
$[5] = t6;
|
|
54
|
+
$[6] = t7;
|
|
55
|
+
} else {
|
|
56
|
+
t7 = $[6];
|
|
57
|
+
}
|
|
58
|
+
return t7;
|
|
59
|
+
}
|
|
60
|
+
function _temp(current) {
|
|
61
|
+
return ((current ?? 0) + 1) % glyphs.length;
|
|
17
62
|
}
|
|
@@ -1,38 +1,73 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { LocusGraphMark } from "@locusgraph/brand";
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
4
|
import { prefersReducedMotion } from "../use-loop-animation.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
const sweepMs = 1800;
|
|
6
|
-
const markCenter = {
|
|
7
|
-
|
|
7
|
+
const markCenter = {
|
|
8
|
+
x: 14.5,
|
|
9
|
+
y: 13
|
|
10
|
+
};
|
|
11
|
+
const rayGlow = [{
|
|
12
|
+
opacity: 0.3
|
|
13
|
+
}, {
|
|
14
|
+
opacity: 1,
|
|
15
|
+
offset: 0.12
|
|
16
|
+
}, {
|
|
17
|
+
opacity: 0.3
|
|
18
|
+
}];
|
|
8
19
|
function sweepDelay(path) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
20
|
+
const box = path.getBBox();
|
|
21
|
+
const angle = Math.atan2(box.y + box.height / 2 - markCenter.y, box.x + box.width / 2 - markCenter.x);
|
|
22
|
+
const turn = (angle + Math.PI) / (2 * Math.PI);
|
|
23
|
+
return -(1 - turn) * sweepMs;
|
|
13
24
|
}
|
|
14
25
|
function animateRays(svg) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}));
|
|
26
|
+
const rays = [...svg.querySelectorAll("path")];
|
|
27
|
+
if (rays.length === 0 || typeof rays[0]?.getBBox !== "function") return [];
|
|
28
|
+
return rays.map(ray => ray.animate(rayGlow, {
|
|
29
|
+
duration: sweepMs,
|
|
30
|
+
delay: sweepDelay(ray),
|
|
31
|
+
easing: "linear",
|
|
32
|
+
iterations: Number.POSITIVE_INFINITY
|
|
33
|
+
}));
|
|
24
34
|
}
|
|
25
35
|
export function LocusMark() {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
const $ = _c(3);
|
|
37
|
+
const ref = useRef(null);
|
|
38
|
+
let t0;
|
|
39
|
+
let t1;
|
|
40
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
41
|
+
t0 = () => {
|
|
42
|
+
const svg = ref.current;
|
|
43
|
+
if (!svg || prefersReducedMotion()) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const animations = animateRays(svg);
|
|
47
|
+
return () => {
|
|
48
|
+
for (const animation of animations) {
|
|
49
|
+
animation.cancel();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
t1 = [];
|
|
54
|
+
$[0] = t0;
|
|
55
|
+
$[1] = t1;
|
|
56
|
+
} else {
|
|
57
|
+
t0 = $[0];
|
|
58
|
+
t1 = $[1];
|
|
59
|
+
}
|
|
60
|
+
useEffect(t0, t1);
|
|
61
|
+
let t2;
|
|
62
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
63
|
+
t2 = /*#__PURE__*/_jsx(LocusGraphMark, {
|
|
64
|
+
ref: ref,
|
|
65
|
+
"data-slot": "pulse-locus",
|
|
66
|
+
className: "h-[1.35em] w-auto text-foreground"
|
|
67
|
+
});
|
|
68
|
+
$[2] = t2;
|
|
69
|
+
} else {
|
|
70
|
+
t2 = $[2];
|
|
71
|
+
}
|
|
72
|
+
return t2;
|
|
38
73
|
}
|
|
@@ -1,11 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useLoopAnimation } from "../use-loop-animation.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
const breathe = [{
|
|
5
|
+
transform: "scale(1)",
|
|
6
|
+
opacity: 1
|
|
7
|
+
}, {
|
|
8
|
+
transform: "scale(0.62)",
|
|
9
|
+
opacity: 0.55
|
|
10
|
+
}, {
|
|
11
|
+
transform: "scale(1)",
|
|
12
|
+
opacity: 1
|
|
13
|
+
}];
|
|
8
14
|
export function OrbMark() {
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
const $ = _c(2);
|
|
16
|
+
const ref = useLoopAnimation(breathe, 1500);
|
|
17
|
+
let t0;
|
|
18
|
+
if ($[0] !== ref) {
|
|
19
|
+
t0 = /*#__PURE__*/_jsx("span", {
|
|
20
|
+
"aria-hidden": true,
|
|
21
|
+
className: "inline-flex size-[1.25em] items-center justify-center",
|
|
22
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
23
|
+
ref: ref,
|
|
24
|
+
"data-slot": "pulse-orb",
|
|
25
|
+
className: "size-[0.8em] rounded-full bg-foreground"
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
$[0] = ref;
|
|
29
|
+
$[1] = t0;
|
|
30
|
+
} else {
|
|
31
|
+
t0 = $[1];
|
|
32
|
+
}
|
|
33
|
+
return t0;
|
|
11
34
|
}
|
|
@@ -1,4 +1,32 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
export function SpinnerMark() {
|
|
3
|
-
|
|
4
|
+
const $ = _c(1);
|
|
5
|
+
let t0;
|
|
6
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
7
|
+
t0 = /*#__PURE__*/_jsxs("svg", {
|
|
8
|
+
"aria-hidden": true,
|
|
9
|
+
"data-slot": "pulse-spinner",
|
|
10
|
+
viewBox: "0 0 16 16",
|
|
11
|
+
className: "size-[1.1em] motion-safe:animate-spin",
|
|
12
|
+
fill: "none",
|
|
13
|
+
children: [/*#__PURE__*/_jsx("circle", {
|
|
14
|
+
cx: "8",
|
|
15
|
+
cy: "8",
|
|
16
|
+
r: "6.5",
|
|
17
|
+
stroke: "currentColor",
|
|
18
|
+
strokeOpacity: "0.18",
|
|
19
|
+
strokeWidth: "1.5"
|
|
20
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
21
|
+
d: "M8 1.5a6.5 6.5 0 0 1 6.5 6.5",
|
|
22
|
+
stroke: "currentColor",
|
|
23
|
+
strokeWidth: "1.5",
|
|
24
|
+
strokeLinecap: "round"
|
|
25
|
+
})]
|
|
26
|
+
});
|
|
27
|
+
$[0] = t0;
|
|
28
|
+
} else {
|
|
29
|
+
t0 = $[0];
|
|
30
|
+
}
|
|
31
|
+
return t0;
|
|
4
32
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { cn } from "@locusgraph/components";
|
|
3
3
|
import { GradientLabel } from "./gradient-label.js";
|
|
4
4
|
import { BarsMark } from "./marks/bars-mark.js";
|
|
@@ -6,46 +6,161 @@ import { GlyphMark } from "./marks/glyph-mark.js";
|
|
|
6
6
|
import { LocusMark } from "./marks/locus-mark.js";
|
|
7
7
|
import { OrbMark } from "./marks/orb-mark.js";
|
|
8
8
|
import { SpinnerMark } from "./marks/spinner-mark.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"shimmer",
|
|
12
|
-
"glyph",
|
|
13
|
-
"orb",
|
|
14
|
-
"gradient",
|
|
15
|
-
"bars",
|
|
16
|
-
"spinner",
|
|
17
|
-
"locus",
|
|
18
|
-
];
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export const pulseVariants = ["dots", "shimmer", "glyph", "orb", "gradient", "bars", "spinner", "locus"];
|
|
19
11
|
const dotDelays = ["[animation-delay:0ms]", "[animation-delay:200ms]", "[animation-delay:400ms]"];
|
|
20
12
|
function TypingDots() {
|
|
21
|
-
|
|
13
|
+
const $ = _c(1);
|
|
14
|
+
let t0;
|
|
15
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
16
|
+
t0 = /*#__PURE__*/_jsx("span", {
|
|
17
|
+
"aria-hidden": true,
|
|
18
|
+
className: "flex h-5 items-center gap-1",
|
|
19
|
+
children: dotDelays.map(_temp)
|
|
20
|
+
});
|
|
21
|
+
$[0] = t0;
|
|
22
|
+
} else {
|
|
23
|
+
t0 = $[0];
|
|
24
|
+
}
|
|
25
|
+
return t0;
|
|
26
|
+
}
|
|
27
|
+
function _temp(delay) {
|
|
28
|
+
return /*#__PURE__*/_jsx("span", {
|
|
29
|
+
className: cn("size-1.5 rounded-full bg-muted-foreground/70 motion-safe:animate-pulse", delay)
|
|
30
|
+
}, delay);
|
|
22
31
|
}
|
|
23
32
|
const marks = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
dots: TypingDots,
|
|
34
|
+
glyph: GlyphMark,
|
|
35
|
+
orb: OrbMark,
|
|
36
|
+
bars: BarsMark,
|
|
37
|
+
spinner: SpinnerMark,
|
|
38
|
+
locus: LocusMark
|
|
30
39
|
};
|
|
31
40
|
const labelShownByDefault = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
dots: false,
|
|
42
|
+
shimmer: true,
|
|
43
|
+
glyph: true,
|
|
44
|
+
orb: false,
|
|
45
|
+
gradient: true,
|
|
46
|
+
bars: false,
|
|
47
|
+
spinner: true,
|
|
48
|
+
locus: true
|
|
40
49
|
};
|
|
41
|
-
function VisibleLabel(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
function VisibleLabel(t0) {
|
|
51
|
+
const $ = _c(8);
|
|
52
|
+
const {
|
|
53
|
+
variant,
|
|
54
|
+
label,
|
|
55
|
+
tone
|
|
56
|
+
} = t0;
|
|
57
|
+
if (variant === "gradient") {
|
|
58
|
+
let t1;
|
|
59
|
+
if ($[0] !== label || $[1] !== tone) {
|
|
60
|
+
t1 = /*#__PURE__*/_jsx(GradientLabel, {
|
|
61
|
+
label: label,
|
|
62
|
+
tone: tone
|
|
63
|
+
});
|
|
64
|
+
$[0] = label;
|
|
65
|
+
$[1] = tone;
|
|
66
|
+
$[2] = t1;
|
|
67
|
+
} else {
|
|
68
|
+
t1 = $[2];
|
|
69
|
+
}
|
|
70
|
+
return t1;
|
|
71
|
+
}
|
|
72
|
+
const shimmers = variant === "shimmer" || variant === "glyph" || variant === "locus";
|
|
73
|
+
const t1 = shimmers && "motion-safe:shimmer";
|
|
74
|
+
let t2;
|
|
75
|
+
if ($[3] !== t1) {
|
|
76
|
+
t2 = cn(t1);
|
|
77
|
+
$[3] = t1;
|
|
78
|
+
$[4] = t2;
|
|
79
|
+
} else {
|
|
80
|
+
t2 = $[4];
|
|
81
|
+
}
|
|
82
|
+
let t3;
|
|
83
|
+
if ($[5] !== label || $[6] !== t2) {
|
|
84
|
+
t3 = /*#__PURE__*/_jsx("span", {
|
|
85
|
+
className: t2,
|
|
86
|
+
children: label
|
|
87
|
+
});
|
|
88
|
+
$[5] = label;
|
|
89
|
+
$[6] = t2;
|
|
90
|
+
$[7] = t3;
|
|
91
|
+
} else {
|
|
92
|
+
t3 = $[7];
|
|
93
|
+
}
|
|
94
|
+
return t3;
|
|
46
95
|
}
|
|
47
|
-
export function Pulse(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
96
|
+
export function Pulse(t0) {
|
|
97
|
+
const $ = _c(15);
|
|
98
|
+
const {
|
|
99
|
+
variant: t1,
|
|
100
|
+
label: t2,
|
|
101
|
+
showLabel,
|
|
102
|
+
tone: t3,
|
|
103
|
+
className
|
|
104
|
+
} = t0;
|
|
105
|
+
const variant = t1 === undefined ? "dots" : t1;
|
|
106
|
+
const label = t2 === undefined ? "Thinking\u2026" : t2;
|
|
107
|
+
const tone = t3 === undefined ? "neutral" : t3;
|
|
108
|
+
const Mark = marks[variant];
|
|
109
|
+
const labelVisible = showLabel ?? labelShownByDefault[variant];
|
|
110
|
+
let t4;
|
|
111
|
+
if ($[0] !== className) {
|
|
112
|
+
t4 = cn("inline-flex items-center gap-2 text-sm text-muted-foreground", className);
|
|
113
|
+
$[0] = className;
|
|
114
|
+
$[1] = t4;
|
|
115
|
+
} else {
|
|
116
|
+
t4 = $[1];
|
|
117
|
+
}
|
|
118
|
+
let t5;
|
|
119
|
+
if ($[2] !== Mark || $[3] !== tone) {
|
|
120
|
+
t5 = Mark && /*#__PURE__*/_jsx(Mark, {
|
|
121
|
+
tone: tone
|
|
122
|
+
});
|
|
123
|
+
$[2] = Mark;
|
|
124
|
+
$[3] = tone;
|
|
125
|
+
$[4] = t5;
|
|
126
|
+
} else {
|
|
127
|
+
t5 = $[4];
|
|
128
|
+
}
|
|
129
|
+
let t6;
|
|
130
|
+
if ($[5] !== label || $[6] !== labelVisible || $[7] !== tone || $[8] !== variant) {
|
|
131
|
+
t6 = labelVisible ? /*#__PURE__*/_jsx(VisibleLabel, {
|
|
132
|
+
variant: variant,
|
|
133
|
+
label: label,
|
|
134
|
+
tone: tone
|
|
135
|
+
}) : /*#__PURE__*/_jsx("span", {
|
|
136
|
+
className: "sr-only",
|
|
137
|
+
children: label
|
|
138
|
+
});
|
|
139
|
+
$[5] = label;
|
|
140
|
+
$[6] = labelVisible;
|
|
141
|
+
$[7] = tone;
|
|
142
|
+
$[8] = variant;
|
|
143
|
+
$[9] = t6;
|
|
144
|
+
} else {
|
|
145
|
+
t6 = $[9];
|
|
146
|
+
}
|
|
147
|
+
let t7;
|
|
148
|
+
if ($[10] !== t4 || $[11] !== t5 || $[12] !== t6 || $[13] !== variant) {
|
|
149
|
+
t7 = /*#__PURE__*/_jsxs("span", {
|
|
150
|
+
"data-slot": "pulse",
|
|
151
|
+
"data-variant": variant,
|
|
152
|
+
role: "status",
|
|
153
|
+
"aria-live": "polite",
|
|
154
|
+
className: t4,
|
|
155
|
+
children: [t5, t6]
|
|
156
|
+
});
|
|
157
|
+
$[10] = t4;
|
|
158
|
+
$[11] = t5;
|
|
159
|
+
$[12] = t6;
|
|
160
|
+
$[13] = variant;
|
|
161
|
+
$[14] = t7;
|
|
162
|
+
} else {
|
|
163
|
+
t7 = $[14];
|
|
164
|
+
}
|
|
165
|
+
return t7;
|
|
51
166
|
}
|