@locusgraph/loop 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +37 -2
- package/dist/agent/index.d.ts +5 -0
- package/dist/agent/index.js +5 -0
- package/dist/agent/pulse/gradient-label.d.ts +7 -0
- package/dist/agent/pulse/gradient-label.js +94 -0
- package/dist/agent/pulse/marks/bars-mark.d.ts +1 -0
- package/dist/agent/pulse/marks/bars-mark.js +51 -0
- package/dist/agent/pulse/marks/glyph-mark.d.ts +4 -0
- package/dist/agent/pulse/marks/glyph-mark.js +62 -0
- package/dist/agent/pulse/marks/locus-mark.d.ts +1 -0
- package/dist/agent/pulse/marks/locus-mark.js +73 -0
- package/dist/agent/pulse/marks/orb-mark.d.ts +1 -0
- package/dist/agent/pulse/marks/orb-mark.js +34 -0
- package/dist/agent/pulse/marks/spinner-mark.d.ts +1 -0
- package/dist/agent/pulse/marks/spinner-mark.js +32 -0
- package/dist/agent/pulse/pulse-tone.d.ts +1 -0
- package/dist/agent/pulse/pulse-tone.js +1 -0
- package/dist/agent/pulse/pulse.d.ts +12 -0
- package/dist/agent/pulse/pulse.js +166 -0
- package/dist/agent/pulse/use-loop-animation.d.ts +2 -0
- package/dist/agent/pulse/use-loop-animation.js +40 -0
- package/dist/agent/shared/status-dot.d.ts +1 -0
- package/dist/agent/shared/status-dot.js +1 -0
- package/dist/agent/steps/step-icon.d.ts +8 -0
- package/dist/agent/steps/step-icon.js +117 -0
- package/dist/agent/steps/steps.d.ts +7 -0
- package/dist/agent/steps/steps.js +249 -0
- package/dist/agent/thinking/thinking.d.ts +6 -0
- package/dist/agent/thinking/thinking.js +211 -0
- package/dist/agent/thinking/thought-duration.d.ts +2 -0
- package/dist/agent/thinking/thought-duration.js +11 -0
- package/dist/agent/tool/json-block.d.ts +5 -0
- package/dist/agent/tool/json-block.js +42 -0
- package/dist/agent/tool/tool-status.d.ts +6 -0
- package/dist/agent/tool/tool-status.js +59 -0
- package/dist/agent/tool/tool.d.ts +7 -0
- package/dist/agent/tool/tool.js +192 -0
- package/dist/approval/inbox/inbox-row.d.ts +12 -0
- package/dist/approval/inbox/inbox-row.js +328 -0
- package/dist/approval/inbox/inbox-selection.d.ts +6 -0
- package/dist/approval/inbox/inbox-selection.js +15 -0
- package/dist/approval/inbox/inbox.d.ts +12 -0
- package/dist/approval/inbox/inbox.js +258 -0
- package/dist/approval/inbox/virtual-inbox-list.d.ts +13 -0
- package/dist/approval/inbox/virtual-inbox-list.js +129 -0
- package/dist/approval/index.d.ts +9 -0
- package/dist/approval/index.js +8 -0
- package/dist/approval/memory/memory-choices.d.ts +10 -0
- package/dist/approval/memory/memory-choices.js +35 -0
- package/dist/approval/memory/memory-review.d.ts +11 -0
- package/dist/approval/memory/memory-review.js +256 -0
- package/dist/approval/memory/memory-row.d.ts +9 -0
- package/dist/approval/memory/memory-row.js +226 -0
- package/dist/approval/plan/plan-review.d.ts +13 -0
- package/dist/approval/plan/plan-review.js +289 -0
- package/dist/approval/plan/plan-step-row.d.ts +13 -0
- package/dist/approval/plan/plan-step-row.js +201 -0
- package/dist/approval/plan/plan-steps.d.ts +8 -0
- package/dist/approval/plan/plan-steps.js +30 -0
- package/dist/approval/plan/question-choices.d.ts +10 -0
- package/dist/approval/plan/question-choices.js +166 -0
- package/dist/approval/plan/question.d.ts +18 -0
- package/dist/approval/plan/question.js +232 -0
- package/dist/approval/run/run-bar.d.ts +13 -0
- package/dist/approval/run/run-bar.js +189 -0
- package/dist/approval/shared/decision-line.d.ts +1 -0
- package/dist/approval/shared/decision-line.js +1 -0
- package/dist/approval/shared/risk-badge.d.ts +10 -0
- package/dist/approval/shared/risk-badge.js +57 -0
- package/dist/approval/shared/time.d.ts +3 -0
- package/dist/approval/shared/time.js +12 -0
- package/dist/approval/shared/use-focus-on-mount.d.ts +2 -0
- package/dist/approval/shared/use-focus-on-mount.js +26 -0
- package/dist/approval/spend/raise-cap-form.d.ts +8 -0
- package/dist/approval/spend/raise-cap-form.js +244 -0
- package/dist/approval/spend/spend-gate.d.ts +16 -0
- package/dist/approval/spend/spend-gate.js +250 -0
- package/dist/approval/spend/spend-math.d.ts +5 -0
- package/dist/approval/spend/spend-math.js +17 -0
- package/dist/approval/spend/spend-meter.d.ts +10 -0
- package/dist/approval/spend/spend-meter.js +377 -0
- package/dist/approval/tool/approval.d.ts +14 -0
- package/dist/approval/tool/approval.js +290 -0
- package/dist/approval/tool/args/args-editor.d.ts +16 -0
- package/dist/approval/tool/args/args-editor.js +273 -0
- package/dist/approval/tool/args/args-field.d.ts +11 -0
- package/dist/approval/tool/args/args-field.js +268 -0
- package/dist/approval/tool/args/args-validation.d.ts +8 -0
- package/dist/approval/tool/args/args-validation.js +50 -0
- package/dist/approval/tool/deny-form.d.ts +6 -0
- package/dist/approval/tool/deny-form.js +135 -0
- package/dist/approval/tool/tool-inputs.d.ts +6 -0
- package/dist/approval/tool/tool-inputs.js +142 -0
- package/dist/approval/types.d.ts +59 -0
- package/dist/approval/types.js +1 -0
- 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 +8 -0
- package/dist/chat/chat/chat.js +187 -0
- package/dist/chat/chat/use-stick-to-bottom.d.ts +7 -0
- package/dist/chat/chat/use-stick-to-bottom.js +133 -0
- 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.d.ts +15 -0
- package/dist/chat/composer/composer-actions.js +158 -0
- package/dist/chat/composer/composer.d.ts +20 -0
- package/dist/chat/composer/composer.js +340 -0
- package/dist/chat/composer/use-auto-grow.d.ts +2 -0
- package/dist/chat/composer/use-auto-grow.js +29 -0
- package/dist/chat/files/file-meta.d.ts +13 -0
- package/dist/chat/files/file-meta.js +30 -0
- package/dist/chat/files/files.d.ts +9 -0
- package/dist/chat/files/files.js +327 -0
- package/dist/chat/index.d.ts +7 -0
- package/dist/chat/index.js +7 -0
- package/dist/chat/reply/fenced-code.d.ts +8 -0
- package/dist/chat/reply/fenced-code.js +53 -0
- package/dist/chat/reply/markdown-components.d.ts +2 -0
- package/dist/chat/reply/markdown-components.js +142 -0
- package/dist/chat/reply/reply.d.ts +8 -0
- package/dist/chat/reply/reply.js +116 -0
- package/dist/chat/turn/group-parts.d.ts +24 -0
- package/dist/chat/turn/group-parts.js +49 -0
- package/dist/chat/turn/turn.d.ts +11 -0
- package/dist/chat/turn/turn.js +253 -0
- package/dist/cost/context.d.ts +13 -0
- package/dist/cost/context.js +333 -0
- package/dist/cost/cost-steps.d.ts +17 -0
- package/dist/cost/cost-steps.js +230 -0
- package/dist/cost/cost.d.ts +8 -0
- package/dist/cost/cost.js +531 -0
- package/dist/cost/index.d.ts +4 -0
- package/dist/cost/index.js +4 -0
- package/dist/cost/model-picker.d.ts +11 -0
- package/dist/cost/model-picker.js +184 -0
- package/dist/cost/shared/context-breakdown.d.ts +15 -0
- package/dist/cost/shared/context-breakdown.js +306 -0
- package/dist/cost/shared/meter-marks.d.ts +9 -0
- package/dist/cost/shared/meter-marks.js +114 -0
- package/dist/cost/shared/model-option-row.d.ts +14 -0
- package/dist/cost/shared/model-option-row.js +189 -0
- package/dist/cost/shared/step-cost-row.d.ts +15 -0
- package/dist/cost/shared/step-cost-row.js +262 -0
- package/dist/cost/shared/usage-totals.d.ts +11 -0
- package/dist/cost/shared/usage-totals.js +30 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/memory/cite.d.ts +8 -0
- package/dist/memory/cite.js +190 -0
- package/dist/memory/index.d.ts +5 -0
- package/dist/memory/index.js +4 -0
- package/dist/memory/memorized.d.ts +14 -0
- package/dist/memory/memorized.js +225 -0
- package/dist/memory/recall.d.ts +9 -0
- package/dist/memory/recall.js +303 -0
- package/dist/memory/shared/disclosure.d.ts +6 -0
- package/dist/memory/shared/disclosure.js +6 -0
- package/dist/memory/shared/host-label.d.ts +6 -0
- package/dist/memory/shared/host-label.js +31 -0
- package/dist/memory/shared/source-mark.d.ts +5 -0
- package/dist/memory/shared/source-mark.js +42 -0
- package/dist/memory/sources.d.ts +9 -0
- package/dist/memory/sources.js +264 -0
- package/dist/shared/decision-summary.d.ts +18 -0
- package/dist/shared/decision-summary.js +144 -0
- package/dist/shared/panel-empty.d.ts +8 -0
- package/dist/shared/panel-empty.js +80 -0
- package/dist/shared/panel.d.ts +19 -0
- package/dist/shared/panel.js +251 -0
- package/dist/shared/status-dot.d.ts +6 -0
- package/dist/shared/status-dot.js +42 -0
- package/dist/shared/virtual/use-list-virtualizer.d.ts +24 -0
- package/dist/shared/virtual/use-list-virtualizer.js +68 -0
- package/dist/sources.css +1 -0
- package/dist/thread/actions/action-button.d.ts +8 -0
- package/dist/thread/actions/action-button.js +67 -0
- package/dist/thread/actions/actions.d.ts +13 -0
- package/dist/thread/actions/actions.js +192 -0
- package/dist/thread/actions/branch-switcher.d.ts +10 -0
- package/dist/thread/actions/branch-switcher.js +104 -0
- package/dist/thread/canvas/canvas.d.ts +14 -0
- package/dist/thread/canvas/canvas.js +212 -0
- package/dist/thread/canvas/version-switcher.d.ts +12 -0
- package/dist/thread/canvas/version-switcher.js +152 -0
- package/dist/thread/code/code.d.ts +10 -0
- package/dist/thread/code/code.js +195 -0
- package/dist/thread/code/copy-code-button.d.ts +6 -0
- package/dist/thread/code/copy-code-button.js +66 -0
- package/dist/thread/code/highlight.d.ts +1 -0
- package/dist/thread/code/highlight.js +40 -0
- 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 +16 -0
- package/dist/thread/history/history.js +179 -0
- package/dist/thread/history/row/history-row.d.ts +15 -0
- package/dist/thread/history/row/history-row.js +137 -0
- package/dist/thread/history/row/thread-item-menu.d.ts +7 -0
- package/dist/thread/history/row/thread-item-menu.js +84 -0
- package/dist/thread/history/row/thread-title-editor.d.ts +7 -0
- package/dist/thread/history/row/thread-title-editor.js +81 -0
- package/dist/thread/history/thread-groups.d.ts +8 -0
- package/dist/thread/history/thread-groups.js +52 -0
- 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 +8 -0
- package/dist/thread/index.js +5 -0
- package/dist/thread/starters/starters.d.ts +12 -0
- package/dist/thread/starters/starters.js +100 -0
- package/dist/thread/use-copied.d.ts +5 -0
- package/dist/thread/use-copied.js +52 -0
- package/dist/types.d.ts +70 -0
- package/dist/types.js +3 -0
- package/package.json +59 -3
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { Checkmark as CheckIcon, Close as XIcon } from "@carbon/icons-react";
|
|
3
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
const decisionTimeFormat = new Intl.DateTimeFormat("en-US", {
|
|
5
|
+
dateStyle: "medium",
|
|
6
|
+
timeStyle: "short",
|
|
7
|
+
timeZone: "UTC"
|
|
8
|
+
});
|
|
9
|
+
export function toDate(value) {
|
|
10
|
+
return value instanceof Date ? value : new Date(value);
|
|
11
|
+
}
|
|
12
|
+
export function isoOf(value) {
|
|
13
|
+
const date = toDate(value);
|
|
14
|
+
return Number.isNaN(date.getTime()) ? undefined : date.toISOString();
|
|
15
|
+
}
|
|
16
|
+
export function formatDecidedAt(value) {
|
|
17
|
+
const date = toDate(value);
|
|
18
|
+
return Number.isNaN(date.getTime()) ? "" : `${decisionTimeFormat.format(date)} UTC`;
|
|
19
|
+
}
|
|
20
|
+
function DecisionMeta(t0) {
|
|
21
|
+
const $ = _c(6);
|
|
22
|
+
const {
|
|
23
|
+
decision,
|
|
24
|
+
verb
|
|
25
|
+
} = t0;
|
|
26
|
+
const t1 = decision.by && ` by ${decision.by}`;
|
|
27
|
+
let t2;
|
|
28
|
+
if ($[0] !== decision.at) {
|
|
29
|
+
t2 = decision.at !== undefined && /*#__PURE__*/_jsxs(_Fragment, {
|
|
30
|
+
children: [" \xB7 ", /*#__PURE__*/_jsx("time", {
|
|
31
|
+
dateTime: isoOf(decision.at),
|
|
32
|
+
className: "tabular-nums",
|
|
33
|
+
children: formatDecidedAt(decision.at)
|
|
34
|
+
})]
|
|
35
|
+
});
|
|
36
|
+
$[0] = decision.at;
|
|
37
|
+
$[1] = t2;
|
|
38
|
+
} else {
|
|
39
|
+
t2 = $[1];
|
|
40
|
+
}
|
|
41
|
+
let t3;
|
|
42
|
+
if ($[2] !== t1 || $[3] !== t2 || $[4] !== verb) {
|
|
43
|
+
t3 = /*#__PURE__*/_jsxs("p", {
|
|
44
|
+
className: "text-xs text-muted-foreground",
|
|
45
|
+
children: [verb, t1, t2]
|
|
46
|
+
});
|
|
47
|
+
$[2] = t1;
|
|
48
|
+
$[3] = t2;
|
|
49
|
+
$[4] = verb;
|
|
50
|
+
$[5] = t3;
|
|
51
|
+
} else {
|
|
52
|
+
t3 = $[5];
|
|
53
|
+
}
|
|
54
|
+
return t3;
|
|
55
|
+
}
|
|
56
|
+
export function DecisionSummary(t0) {
|
|
57
|
+
const $ = _c(18);
|
|
58
|
+
const {
|
|
59
|
+
decision,
|
|
60
|
+
result,
|
|
61
|
+
approvedVerb: t1,
|
|
62
|
+
deniedVerb: t2
|
|
63
|
+
} = t0;
|
|
64
|
+
const approvedVerb = t1 === undefined ? "Approved" : t1;
|
|
65
|
+
const deniedVerb = t2 === undefined ? "Denied" : t2;
|
|
66
|
+
const Icon = decision.approved ? CheckIcon : XIcon;
|
|
67
|
+
const t3 = `mt-0.5 size-4 shrink-0 ${decision.approved ? "text-good" : "text-destructive"}`;
|
|
68
|
+
let t4;
|
|
69
|
+
if ($[0] !== Icon || $[1] !== t3) {
|
|
70
|
+
t4 = /*#__PURE__*/_jsx(Icon, {
|
|
71
|
+
"aria-hidden": true,
|
|
72
|
+
className: t3
|
|
73
|
+
});
|
|
74
|
+
$[0] = Icon;
|
|
75
|
+
$[1] = t3;
|
|
76
|
+
$[2] = t4;
|
|
77
|
+
} else {
|
|
78
|
+
t4 = $[2];
|
|
79
|
+
}
|
|
80
|
+
let t5;
|
|
81
|
+
if ($[3] !== result) {
|
|
82
|
+
t5 = /*#__PURE__*/_jsx("p", {
|
|
83
|
+
className: "font-medium",
|
|
84
|
+
children: result
|
|
85
|
+
});
|
|
86
|
+
$[3] = result;
|
|
87
|
+
$[4] = t5;
|
|
88
|
+
} else {
|
|
89
|
+
t5 = $[4];
|
|
90
|
+
}
|
|
91
|
+
const t6 = decision.approved ? approvedVerb : deniedVerb;
|
|
92
|
+
let t7;
|
|
93
|
+
if ($[5] !== decision || $[6] !== t6) {
|
|
94
|
+
t7 = /*#__PURE__*/_jsx(DecisionMeta, {
|
|
95
|
+
decision: decision,
|
|
96
|
+
verb: t6
|
|
97
|
+
});
|
|
98
|
+
$[5] = decision;
|
|
99
|
+
$[6] = t6;
|
|
100
|
+
$[7] = t7;
|
|
101
|
+
} else {
|
|
102
|
+
t7 = $[7];
|
|
103
|
+
}
|
|
104
|
+
let t8;
|
|
105
|
+
if ($[8] !== decision.reason) {
|
|
106
|
+
t8 = decision.reason && /*#__PURE__*/_jsxs("p", {
|
|
107
|
+
className: "text-xs text-muted-foreground",
|
|
108
|
+
children: ["Reason: ", decision.reason]
|
|
109
|
+
});
|
|
110
|
+
$[8] = decision.reason;
|
|
111
|
+
$[9] = t8;
|
|
112
|
+
} else {
|
|
113
|
+
t8 = $[9];
|
|
114
|
+
}
|
|
115
|
+
let t9;
|
|
116
|
+
if ($[10] !== t5 || $[11] !== t7 || $[12] !== t8) {
|
|
117
|
+
t9 = /*#__PURE__*/_jsxs("div", {
|
|
118
|
+
className: "flex min-w-0 flex-col gap-0.5",
|
|
119
|
+
children: [t5, t7, t8]
|
|
120
|
+
});
|
|
121
|
+
$[10] = t5;
|
|
122
|
+
$[11] = t7;
|
|
123
|
+
$[12] = t8;
|
|
124
|
+
$[13] = t9;
|
|
125
|
+
} else {
|
|
126
|
+
t9 = $[13];
|
|
127
|
+
}
|
|
128
|
+
let t10;
|
|
129
|
+
if ($[14] !== decision.approved || $[15] !== t4 || $[16] !== t9) {
|
|
130
|
+
t10 = /*#__PURE__*/_jsxs("div", {
|
|
131
|
+
"data-slot": "decision-summary",
|
|
132
|
+
"data-approved": decision.approved,
|
|
133
|
+
className: "flex items-start gap-2.5 text-sm",
|
|
134
|
+
children: [t4, t9]
|
|
135
|
+
});
|
|
136
|
+
$[14] = decision.approved;
|
|
137
|
+
$[15] = t4;
|
|
138
|
+
$[16] = t9;
|
|
139
|
+
$[17] = t10;
|
|
140
|
+
} else {
|
|
141
|
+
t10 = $[17];
|
|
142
|
+
}
|
|
143
|
+
return t10;
|
|
144
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
type PanelEmptyProps = Omit<ComponentProps<"div">, "title"> & {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function PanelEmpty({ icon, title, description, className, ...props }: PanelEmptyProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { cn } from "@locusgraph/components";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
export function PanelEmpty(t0) {
|
|
5
|
+
const $ = _c(18);
|
|
6
|
+
let className;
|
|
7
|
+
let description;
|
|
8
|
+
let icon;
|
|
9
|
+
let props;
|
|
10
|
+
let title;
|
|
11
|
+
if ($[0] !== t0) {
|
|
12
|
+
({
|
|
13
|
+
icon,
|
|
14
|
+
title,
|
|
15
|
+
description,
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
} = t0);
|
|
19
|
+
$[0] = t0;
|
|
20
|
+
$[1] = className;
|
|
21
|
+
$[2] = description;
|
|
22
|
+
$[3] = icon;
|
|
23
|
+
$[4] = props;
|
|
24
|
+
$[5] = title;
|
|
25
|
+
} else {
|
|
26
|
+
className = $[1];
|
|
27
|
+
description = $[2];
|
|
28
|
+
icon = $[3];
|
|
29
|
+
props = $[4];
|
|
30
|
+
title = $[5];
|
|
31
|
+
}
|
|
32
|
+
let t1;
|
|
33
|
+
if ($[6] !== className) {
|
|
34
|
+
t1 = cn("flex flex-col items-center gap-1 px-6 pt-8 pb-10 text-center [&_svg]:mb-1 [&_svg]:size-5 [&_svg]:text-muted-foreground", className);
|
|
35
|
+
$[6] = className;
|
|
36
|
+
$[7] = t1;
|
|
37
|
+
} else {
|
|
38
|
+
t1 = $[7];
|
|
39
|
+
}
|
|
40
|
+
let t2;
|
|
41
|
+
if ($[8] !== title) {
|
|
42
|
+
t2 = /*#__PURE__*/_jsx("p", {
|
|
43
|
+
className: "text-sm font-medium",
|
|
44
|
+
children: title
|
|
45
|
+
});
|
|
46
|
+
$[8] = title;
|
|
47
|
+
$[9] = t2;
|
|
48
|
+
} else {
|
|
49
|
+
t2 = $[9];
|
|
50
|
+
}
|
|
51
|
+
let t3;
|
|
52
|
+
if ($[10] !== description) {
|
|
53
|
+
t3 = description && /*#__PURE__*/_jsx("p", {
|
|
54
|
+
className: "max-w-xs text-xs text-muted-foreground",
|
|
55
|
+
children: description
|
|
56
|
+
});
|
|
57
|
+
$[10] = description;
|
|
58
|
+
$[11] = t3;
|
|
59
|
+
} else {
|
|
60
|
+
t3 = $[11];
|
|
61
|
+
}
|
|
62
|
+
let t4;
|
|
63
|
+
if ($[12] !== icon || $[13] !== props || $[14] !== t1 || $[15] !== t2 || $[16] !== t3) {
|
|
64
|
+
t4 = /*#__PURE__*/_jsxs("div", {
|
|
65
|
+
"data-slot": "panel-empty",
|
|
66
|
+
...props,
|
|
67
|
+
className: t1,
|
|
68
|
+
children: [icon, t2, t3]
|
|
69
|
+
});
|
|
70
|
+
$[12] = icon;
|
|
71
|
+
$[13] = props;
|
|
72
|
+
$[14] = t1;
|
|
73
|
+
$[15] = t2;
|
|
74
|
+
$[16] = t3;
|
|
75
|
+
$[17] = t4;
|
|
76
|
+
} else {
|
|
77
|
+
t4 = $[17];
|
|
78
|
+
}
|
|
79
|
+
return t4;
|
|
80
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { type StatusTone } from "./status-dot.js";
|
|
3
|
+
export declare function ApprovalPanel({ className, ...props }: ComponentProps<"section">): import("react").JSX.Element;
|
|
4
|
+
export type PanelTone = StatusTone;
|
|
5
|
+
type PanelHeaderProps = {
|
|
6
|
+
icon: ReactNode;
|
|
7
|
+
eyebrow: string;
|
|
8
|
+
status?: string;
|
|
9
|
+
tone?: PanelTone;
|
|
10
|
+
aside?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export declare function PanelHeader({ icon, eyebrow, status, tone, aside }: PanelHeaderProps): import("react").JSX.Element;
|
|
13
|
+
export declare function PanelTitle({ className, ...props }: ComponentProps<"h3">): import("react").JSX.Element;
|
|
14
|
+
export declare function PanelBody({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
15
|
+
export declare function PanelFooter({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
16
|
+
export declare function LiveStatus({ message }: {
|
|
17
|
+
message: string;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { cn } from "@locusgraph/components";
|
|
3
|
+
import { StatusDot } from "./status-dot.js";
|
|
4
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
export function ApprovalPanel(t0) {
|
|
6
|
+
const $ = _c(8);
|
|
7
|
+
let className;
|
|
8
|
+
let props;
|
|
9
|
+
if ($[0] !== t0) {
|
|
10
|
+
({
|
|
11
|
+
className,
|
|
12
|
+
...props
|
|
13
|
+
} = t0);
|
|
14
|
+
$[0] = t0;
|
|
15
|
+
$[1] = className;
|
|
16
|
+
$[2] = props;
|
|
17
|
+
} else {
|
|
18
|
+
className = $[1];
|
|
19
|
+
props = $[2];
|
|
20
|
+
}
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[3] !== className) {
|
|
23
|
+
t1 = cn("flex min-w-0 flex-col bg-card text-card-foreground ring-1 ring-border", className);
|
|
24
|
+
$[3] = className;
|
|
25
|
+
$[4] = t1;
|
|
26
|
+
} else {
|
|
27
|
+
t1 = $[4];
|
|
28
|
+
}
|
|
29
|
+
let t2;
|
|
30
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
31
|
+
t2 = /*#__PURE__*/_jsx("section", {
|
|
32
|
+
className: t1,
|
|
33
|
+
...props
|
|
34
|
+
});
|
|
35
|
+
$[5] = props;
|
|
36
|
+
$[6] = t1;
|
|
37
|
+
$[7] = t2;
|
|
38
|
+
} else {
|
|
39
|
+
t2 = $[7];
|
|
40
|
+
}
|
|
41
|
+
return t2;
|
|
42
|
+
}
|
|
43
|
+
export function PanelHeader(t0) {
|
|
44
|
+
const $ = _c(14);
|
|
45
|
+
const {
|
|
46
|
+
icon,
|
|
47
|
+
eyebrow,
|
|
48
|
+
status,
|
|
49
|
+
tone: t1,
|
|
50
|
+
aside
|
|
51
|
+
} = t0;
|
|
52
|
+
const tone = t1 === undefined ? "idle" : t1;
|
|
53
|
+
let t2;
|
|
54
|
+
if ($[0] !== eyebrow) {
|
|
55
|
+
t2 = /*#__PURE__*/_jsx("span", {
|
|
56
|
+
className: "min-w-0 truncate",
|
|
57
|
+
children: eyebrow
|
|
58
|
+
});
|
|
59
|
+
$[0] = eyebrow;
|
|
60
|
+
$[1] = t2;
|
|
61
|
+
} else {
|
|
62
|
+
t2 = $[1];
|
|
63
|
+
}
|
|
64
|
+
let t3;
|
|
65
|
+
if ($[2] !== aside) {
|
|
66
|
+
t3 = aside && /*#__PURE__*/_jsx("span", {
|
|
67
|
+
className: "mr-2 tabular-nums",
|
|
68
|
+
children: aside
|
|
69
|
+
});
|
|
70
|
+
$[2] = aside;
|
|
71
|
+
$[3] = t3;
|
|
72
|
+
} else {
|
|
73
|
+
t3 = $[3];
|
|
74
|
+
}
|
|
75
|
+
let t4;
|
|
76
|
+
if ($[4] !== status || $[5] !== tone) {
|
|
77
|
+
t4 = status && /*#__PURE__*/_jsxs(_Fragment, {
|
|
78
|
+
children: [/*#__PURE__*/_jsx(StatusDot, {
|
|
79
|
+
tone: tone
|
|
80
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
81
|
+
children: status
|
|
82
|
+
})]
|
|
83
|
+
});
|
|
84
|
+
$[4] = status;
|
|
85
|
+
$[5] = tone;
|
|
86
|
+
$[6] = t4;
|
|
87
|
+
} else {
|
|
88
|
+
t4 = $[6];
|
|
89
|
+
}
|
|
90
|
+
let t5;
|
|
91
|
+
if ($[7] !== t3 || $[8] !== t4) {
|
|
92
|
+
t5 = /*#__PURE__*/_jsxs("span", {
|
|
93
|
+
className: "ml-auto flex shrink-0 items-center gap-1.5",
|
|
94
|
+
children: [t3, t4]
|
|
95
|
+
});
|
|
96
|
+
$[7] = t3;
|
|
97
|
+
$[8] = t4;
|
|
98
|
+
$[9] = t5;
|
|
99
|
+
} else {
|
|
100
|
+
t5 = $[9];
|
|
101
|
+
}
|
|
102
|
+
let t6;
|
|
103
|
+
if ($[10] !== icon || $[11] !== t2 || $[12] !== t5) {
|
|
104
|
+
t6 = /*#__PURE__*/_jsxs("header", {
|
|
105
|
+
"data-slot": "panel-header",
|
|
106
|
+
className: "eyebrow flex items-center gap-2 px-5 pt-4 [&_svg]:size-3.5 [&_svg]:shrink-0",
|
|
107
|
+
children: [icon, t2, t5]
|
|
108
|
+
});
|
|
109
|
+
$[10] = icon;
|
|
110
|
+
$[11] = t2;
|
|
111
|
+
$[12] = t5;
|
|
112
|
+
$[13] = t6;
|
|
113
|
+
} else {
|
|
114
|
+
t6 = $[13];
|
|
115
|
+
}
|
|
116
|
+
return t6;
|
|
117
|
+
}
|
|
118
|
+
export function PanelTitle(t0) {
|
|
119
|
+
const $ = _c(8);
|
|
120
|
+
let className;
|
|
121
|
+
let props;
|
|
122
|
+
if ($[0] !== t0) {
|
|
123
|
+
({
|
|
124
|
+
className,
|
|
125
|
+
...props
|
|
126
|
+
} = t0);
|
|
127
|
+
$[0] = t0;
|
|
128
|
+
$[1] = className;
|
|
129
|
+
$[2] = props;
|
|
130
|
+
} else {
|
|
131
|
+
className = $[1];
|
|
132
|
+
props = $[2];
|
|
133
|
+
}
|
|
134
|
+
let t1;
|
|
135
|
+
if ($[3] !== className) {
|
|
136
|
+
t1 = cn("px-5 pt-2 font-sans text-base leading-snug font-semibold tracking-tight text-balance", className);
|
|
137
|
+
$[3] = className;
|
|
138
|
+
$[4] = t1;
|
|
139
|
+
} else {
|
|
140
|
+
t1 = $[4];
|
|
141
|
+
}
|
|
142
|
+
let t2;
|
|
143
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
144
|
+
t2 = /*#__PURE__*/_jsx("h3", {
|
|
145
|
+
className: t1,
|
|
146
|
+
...props
|
|
147
|
+
});
|
|
148
|
+
$[5] = props;
|
|
149
|
+
$[6] = t1;
|
|
150
|
+
$[7] = t2;
|
|
151
|
+
} else {
|
|
152
|
+
t2 = $[7];
|
|
153
|
+
}
|
|
154
|
+
return t2;
|
|
155
|
+
}
|
|
156
|
+
export function PanelBody(t0) {
|
|
157
|
+
const $ = _c(8);
|
|
158
|
+
let className;
|
|
159
|
+
let props;
|
|
160
|
+
if ($[0] !== t0) {
|
|
161
|
+
({
|
|
162
|
+
className,
|
|
163
|
+
...props
|
|
164
|
+
} = t0);
|
|
165
|
+
$[0] = t0;
|
|
166
|
+
$[1] = className;
|
|
167
|
+
$[2] = props;
|
|
168
|
+
} else {
|
|
169
|
+
className = $[1];
|
|
170
|
+
props = $[2];
|
|
171
|
+
}
|
|
172
|
+
let t1;
|
|
173
|
+
if ($[3] !== className) {
|
|
174
|
+
t1 = cn("flex flex-col gap-4 px-5 pt-4 pb-5", className);
|
|
175
|
+
$[3] = className;
|
|
176
|
+
$[4] = t1;
|
|
177
|
+
} else {
|
|
178
|
+
t1 = $[4];
|
|
179
|
+
}
|
|
180
|
+
let t2;
|
|
181
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
182
|
+
t2 = /*#__PURE__*/_jsx("div", {
|
|
183
|
+
className: t1,
|
|
184
|
+
...props
|
|
185
|
+
});
|
|
186
|
+
$[5] = props;
|
|
187
|
+
$[6] = t1;
|
|
188
|
+
$[7] = t2;
|
|
189
|
+
} else {
|
|
190
|
+
t2 = $[7];
|
|
191
|
+
}
|
|
192
|
+
return t2;
|
|
193
|
+
}
|
|
194
|
+
export function PanelFooter(t0) {
|
|
195
|
+
const $ = _c(8);
|
|
196
|
+
let className;
|
|
197
|
+
let props;
|
|
198
|
+
if ($[0] !== t0) {
|
|
199
|
+
({
|
|
200
|
+
className,
|
|
201
|
+
...props
|
|
202
|
+
} = t0);
|
|
203
|
+
$[0] = t0;
|
|
204
|
+
$[1] = className;
|
|
205
|
+
$[2] = props;
|
|
206
|
+
} else {
|
|
207
|
+
className = $[1];
|
|
208
|
+
props = $[2];
|
|
209
|
+
}
|
|
210
|
+
let t1;
|
|
211
|
+
if ($[3] !== className) {
|
|
212
|
+
t1 = cn("flex flex-wrap items-center justify-end gap-2 border-t bg-muted/70 px-5 py-3", className);
|
|
213
|
+
$[3] = className;
|
|
214
|
+
$[4] = t1;
|
|
215
|
+
} else {
|
|
216
|
+
t1 = $[4];
|
|
217
|
+
}
|
|
218
|
+
let t2;
|
|
219
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
220
|
+
t2 = /*#__PURE__*/_jsx("div", {
|
|
221
|
+
className: t1,
|
|
222
|
+
...props
|
|
223
|
+
});
|
|
224
|
+
$[5] = props;
|
|
225
|
+
$[6] = t1;
|
|
226
|
+
$[7] = t2;
|
|
227
|
+
} else {
|
|
228
|
+
t2 = $[7];
|
|
229
|
+
}
|
|
230
|
+
return t2;
|
|
231
|
+
}
|
|
232
|
+
export function LiveStatus(t0) {
|
|
233
|
+
const $ = _c(2);
|
|
234
|
+
const {
|
|
235
|
+
message
|
|
236
|
+
} = t0;
|
|
237
|
+
let t1;
|
|
238
|
+
if ($[0] !== message) {
|
|
239
|
+
t1 = /*#__PURE__*/_jsx("p", {
|
|
240
|
+
role: "status",
|
|
241
|
+
"aria-live": "polite",
|
|
242
|
+
className: "sr-only",
|
|
243
|
+
children: message
|
|
244
|
+
});
|
|
245
|
+
$[0] = message;
|
|
246
|
+
$[1] = t1;
|
|
247
|
+
} else {
|
|
248
|
+
t1 = $[1];
|
|
249
|
+
}
|
|
250
|
+
return t1;
|
|
251
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type StatusTone = "running" | "waiting" | "done" | "danger" | "idle";
|
|
2
|
+
export declare const statusDotTones: Record<StatusTone, string>;
|
|
3
|
+
export declare function StatusDot({ tone, className }: {
|
|
4
|
+
tone: StatusTone;
|
|
5
|
+
className?: string;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { cn } from "@locusgraph/components";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export const statusDotTones = {
|
|
5
|
+
running: "bg-warn motion-safe:animate-pulse",
|
|
6
|
+
waiting: "bg-warn motion-safe:animate-pulse",
|
|
7
|
+
done: "bg-good",
|
|
8
|
+
danger: "bg-destructive",
|
|
9
|
+
idle: "bg-muted-foreground/50"
|
|
10
|
+
};
|
|
11
|
+
export function StatusDot(t0) {
|
|
12
|
+
const $ = _c(6);
|
|
13
|
+
const {
|
|
14
|
+
tone,
|
|
15
|
+
className
|
|
16
|
+
} = t0;
|
|
17
|
+
const t1 = statusDotTones[tone];
|
|
18
|
+
let t2;
|
|
19
|
+
if ($[0] !== className || $[1] !== t1) {
|
|
20
|
+
t2 = cn("size-1.5 shrink-0 rounded-full", t1, className);
|
|
21
|
+
$[0] = className;
|
|
22
|
+
$[1] = t1;
|
|
23
|
+
$[2] = t2;
|
|
24
|
+
} else {
|
|
25
|
+
t2 = $[2];
|
|
26
|
+
}
|
|
27
|
+
let t3;
|
|
28
|
+
if ($[3] !== t2 || $[4] !== tone) {
|
|
29
|
+
t3 = /*#__PURE__*/_jsx("span", {
|
|
30
|
+
"aria-hidden": true,
|
|
31
|
+
"data-slot": "status-dot",
|
|
32
|
+
"data-tone": tone,
|
|
33
|
+
className: t2
|
|
34
|
+
});
|
|
35
|
+
$[3] = t2;
|
|
36
|
+
$[4] = tone;
|
|
37
|
+
$[5] = t3;
|
|
38
|
+
} else {
|
|
39
|
+
t3 = $[5];
|
|
40
|
+
}
|
|
41
|
+
return t3;
|
|
42
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type CSSProperties, type FocusEvent } from "react";
|
|
2
|
+
export declare const virtualizeAboveCount = 50;
|
|
3
|
+
export declare function shouldVirtualize(count: number, virtualize: boolean | undefined): boolean;
|
|
4
|
+
export type ListVirtualizerOptions = {
|
|
5
|
+
count: number;
|
|
6
|
+
getScrollElement: () => HTMLElement | null;
|
|
7
|
+
estimateSize: (index: number) => number;
|
|
8
|
+
getItemKey: (index: number) => string | number;
|
|
9
|
+
anchorTo?: "start" | "end";
|
|
10
|
+
};
|
|
11
|
+
export declare function useListVirtualizer({ count, getScrollElement, estimateSize, getItemKey, anchorTo, }: ListVirtualizerOptions): {
|
|
12
|
+
virtualizer: import("@tanstack/react-virtual").ReactVirtualizer<HTMLElement, HTMLElement>;
|
|
13
|
+
rows: import("@tanstack/react-virtual").VirtualItem[];
|
|
14
|
+
totalSize: number;
|
|
15
|
+
isScrolling: boolean;
|
|
16
|
+
itemProps: (index: number) => {
|
|
17
|
+
"data-index": number;
|
|
18
|
+
ref: (node: HTMLElement | null) => void;
|
|
19
|
+
onFocus: () => void;
|
|
20
|
+
onBlur: (event: FocusEvent<HTMLElement>) => void;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare const virtualRowClassName = "absolute top-0 left-0 w-full";
|
|
24
|
+
export declare function rowOffsetStyle(start: number): CSSProperties;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { defaultRangeExtractor, useVirtualizer } from "@tanstack/react-virtual";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
export const virtualizeAboveCount = 50;
|
|
4
|
+
const serverViewportRect = {
|
|
5
|
+
width: 0,
|
|
6
|
+
height: 800
|
|
7
|
+
};
|
|
8
|
+
export function shouldVirtualize(count, virtualize) {
|
|
9
|
+
return virtualize !== false && count > virtualizeAboveCount;
|
|
10
|
+
}
|
|
11
|
+
function offsetOfLastScreen(count, estimateSize) {
|
|
12
|
+
let total = 0;
|
|
13
|
+
for (let index = 0; index < count; index += 1) total += estimateSize(index);
|
|
14
|
+
return Math.max(0, total - serverViewportRect.height);
|
|
15
|
+
}
|
|
16
|
+
function keepFocusedRendered(indexes, focusedIndex, count) {
|
|
17
|
+
if (focusedIndex === null || focusedIndex >= count || indexes.includes(focusedIndex)) {
|
|
18
|
+
return indexes;
|
|
19
|
+
}
|
|
20
|
+
return [...indexes, focusedIndex].sort((a, b) => a - b);
|
|
21
|
+
}
|
|
22
|
+
function focusLeft(event) {
|
|
23
|
+
return !event.currentTarget.contains(event.relatedTarget);
|
|
24
|
+
}
|
|
25
|
+
export function useListVirtualizer({
|
|
26
|
+
count,
|
|
27
|
+
getScrollElement,
|
|
28
|
+
estimateSize,
|
|
29
|
+
getItemKey,
|
|
30
|
+
anchorTo = "start"
|
|
31
|
+
}) {
|
|
32
|
+
"use no memo";
|
|
33
|
+
|
|
34
|
+
const [focusedIndex, setFocusedIndex] = useState(null);
|
|
35
|
+
const rangeExtractor = useCallback(range => keepFocusedRendered(defaultRangeExtractor(range), focusedIndex, range.count), [focusedIndex]);
|
|
36
|
+
const virtualizer = useVirtualizer({
|
|
37
|
+
count,
|
|
38
|
+
getScrollElement,
|
|
39
|
+
estimateSize,
|
|
40
|
+
getItemKey,
|
|
41
|
+
rangeExtractor,
|
|
42
|
+
anchorTo,
|
|
43
|
+
initialRect: serverViewportRect,
|
|
44
|
+
initialOffset: () => anchorTo === "end" ? offsetOfLastScreen(count, estimateSize) : 0,
|
|
45
|
+
overscan: 6
|
|
46
|
+
});
|
|
47
|
+
const itemProps = index => ({
|
|
48
|
+
"data-index": index,
|
|
49
|
+
ref: virtualizer.measureElement,
|
|
50
|
+
onFocus: () => setFocusedIndex(index),
|
|
51
|
+
onBlur: event => {
|
|
52
|
+
if (focusLeft(event)) setFocusedIndex(null);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
virtualizer,
|
|
57
|
+
rows: virtualizer.getVirtualItems(),
|
|
58
|
+
totalSize: virtualizer.getTotalSize(),
|
|
59
|
+
isScrolling: virtualizer.isScrolling,
|
|
60
|
+
itemProps
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export const virtualRowClassName = "absolute top-0 left-0 w-full";
|
|
64
|
+
export function rowOffsetStyle(start) {
|
|
65
|
+
return {
|
|
66
|
+
transform: `translateY(${start}px)`
|
|
67
|
+
};
|
|
68
|
+
}
|
package/dist/sources.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@source "./";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Button } from "@locusgraph/components";
|
|
2
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
3
|
+
type ActionButtonProps = Omit<ComponentProps<typeof Button>, "aria-label" | "children"> & {
|
|
4
|
+
label: string;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function ActionButton({ label, children, ...props }: ActionButtonProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|