@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,3 +1,6 @@
1
+ "use client";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
1
4
  import { cn } from "@locusgraph/components";
2
5
  import { useRef } from "react";
3
6
  import { rowOffsetStyle, useListVirtualizer, virtualRowClassName } from "../../shared/virtual/use-list-virtualizer.js";
@@ -7,14 +10,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
7
10
  function scrollAreaViewportOf(element) {
8
11
  return element?.closest("[data-slot=scroll-area-viewport]") ?? null;
9
12
  }
10
- export function VirtualHistoryList({
11
- groups,
12
- label,
13
- activeId,
14
- onSelect,
15
- onRename,
16
- onArchive
17
- }) {
13
+ export function VirtualHistoryList(t0) {
14
+ const $ = _c(12);
15
+ const {
16
+ groups,
17
+ label,
18
+ activeId,
19
+ onSelect,
20
+ onRename,
21
+ onArchive
22
+ } = t0;
18
23
  const listRef = useRef(null);
19
24
  const rows = historyListRows(groups);
20
25
  const {
@@ -25,47 +30,79 @@ export function VirtualHistoryList({
25
30
  count: rows.length,
26
31
  getScrollElement: () => scrollAreaViewportOf(listRef.current),
27
32
  estimateSize: index => estimatedRowHeight(rows[index], index),
28
- getItemKey: index => rows[index].key
29
- });
30
- const threadRowProps = thread => ({
31
- thread,
32
- active: thread.id === activeId,
33
- onSelect,
34
- onRename,
35
- onArchive
33
+ getItemKey: index_0 => rows[index_0].key
36
34
  });
37
- return /*#__PURE__*/_jsx("ul", {
38
- ref: listRef,
39
- "data-slot": "history-list",
40
- "aria-label": label,
41
- className: "relative",
42
- style: {
35
+ let t1;
36
+ if ($[0] !== activeId || $[1] !== onArchive || $[2] !== onRename || $[3] !== onSelect) {
37
+ t1 = thread => ({
38
+ thread,
39
+ active: thread.id === activeId,
40
+ onSelect,
41
+ onRename,
42
+ onArchive
43
+ });
44
+ $[0] = activeId;
45
+ $[1] = onArchive;
46
+ $[2] = onRename;
47
+ $[3] = onSelect;
48
+ $[4] = t1;
49
+ } else {
50
+ t1 = $[4];
51
+ }
52
+ const threadRowProps = t1;
53
+ const t2 = "history-list";
54
+ const t3 = "relative";
55
+ let t4;
56
+ if ($[5] !== totalSize) {
57
+ t4 = {
43
58
  height: totalSize
44
- },
45
- children: visibleRows.map(virtualRow => {
46
- const row = rows[virtualRow.index];
47
- if (row.kind === "group") {
48
- return /*#__PURE__*/_jsx("li", {
49
- role: "presentation",
50
- ...itemProps(virtualRow.index),
51
- className: cn(virtualRowClassName, virtualRow.index > 0 && "pt-4"),
52
- style: rowOffsetStyle(virtualRow.start),
53
- children: /*#__PURE__*/_jsx("h3", {
54
- id: `thread-group-${row.groupKey}`,
55
- className: "locus-eyebrow px-2 pb-1",
56
- suppressHydrationWarning: true,
57
- children: row.label
58
- })
59
- }, virtualRow.key);
60
- }
61
- return /*#__PURE__*/_jsx(HistoryRow, {
62
- ...threadRowProps(row.thread),
59
+ };
60
+ $[5] = totalSize;
61
+ $[6] = t4;
62
+ } else {
63
+ t4 = $[6];
64
+ }
65
+ const t5 = visibleRows.map(virtualRow => {
66
+ const row = rows[virtualRow.index];
67
+ if (row.kind === "group") {
68
+ return /*#__PURE__*/_jsx("li", {
69
+ role: "presentation",
63
70
  ...itemProps(virtualRow.index),
64
- "aria-posinset": row.position,
65
- "aria-setsize": row.groupSize,
66
- className: virtualRowClassName,
67
- style: rowOffsetStyle(virtualRow.start)
71
+ className: cn(virtualRowClassName, virtualRow.index > 0 && "pt-4"),
72
+ style: rowOffsetStyle(virtualRow.start),
73
+ children: /*#__PURE__*/_jsx("h3", {
74
+ className: "px-2 pb-1 font-sans text-xs text-faint",
75
+ suppressHydrationWarning: true,
76
+ children: row.label
77
+ })
68
78
  }, virtualRow.key);
69
- })
79
+ }
80
+ return /*#__PURE__*/_jsx(HistoryRow, {
81
+ ...threadRowProps(row.thread),
82
+ ...itemProps(virtualRow.index),
83
+ "aria-posinset": row.position,
84
+ "aria-setsize": row.groupSize,
85
+ className: virtualRowClassName,
86
+ style: rowOffsetStyle(virtualRow.start)
87
+ }, virtualRow.key);
70
88
  });
89
+ let t6;
90
+ if ($[7] !== label || $[8] !== listRef || $[9] !== t4 || $[10] !== t5) {
91
+ t6 = /*#__PURE__*/_jsx("ul", {
92
+ ref: listRef,
93
+ "data-slot": t2,
94
+ "aria-label": label,
95
+ className: t3,
96
+ style: t4,
97
+ children: t5
98
+ });
99
+ $[7] = label;
100
+ $[8] = listRef;
101
+ $[9] = t4;
102
+ $[10] = t5;
103
+ $[11] = t6;
104
+ } else {
105
+ t6 = $[11];
106
+ }
107
+ return t6;
71
108
  }
@@ -3,6 +3,7 @@ export type { MessageBranch } from "./actions/branch-switcher.js";
3
3
  export * from "./canvas/canvas.js";
4
4
  export type { CanvasVersion } from "./canvas/version-switcher.js";
5
5
  export * from "./code/code.js";
6
+ export * from "./code/copy-code-button.js";
6
7
  export * from "./history/history.js";
7
8
  export type { HistoryItem } from "./history/row/history-row.js";
8
9
  export * from "./starters/starters.js";
@@ -1,5 +1,6 @@
1
1
  export * from "./actions/actions.js";
2
2
  export * from "./canvas/canvas.js";
3
3
  export * from "./code/code.js";
4
+ export * from "./code/copy-code-button.js";
4
5
  export * from "./history/history.js";
5
6
  export * from "./starters/starters.js";
@@ -1,5 +1,8 @@
1
- import { ArrowUpRight as ArrowUpRightIcon } 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 { ArrowUpRight as ArrowUpRightIcon } from "@phosphor-icons/react/ssr";
3
6
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
7
  function textOf(suggestion) {
5
8
  return typeof suggestion === "string" ? suggestion : suggestion.text;
@@ -7,34 +10,94 @@ function textOf(suggestion) {
7
10
  function labelOf(suggestion) {
8
11
  return typeof suggestion === "string" ? suggestion : suggestion.label ?? suggestion.text;
9
12
  }
10
- export function Starters({
11
- suggestions,
12
- onSelect,
13
- disabled = false,
14
- className,
15
- ...props
16
- }) {
13
+ export function Starters(t0) {
14
+ const $ = _c(19);
15
+ let className;
16
+ let onSelect;
17
+ let props;
18
+ let suggestions;
19
+ let t1;
20
+ if ($[0] !== t0) {
21
+ ({
22
+ suggestions,
23
+ onSelect,
24
+ disabled: t1,
25
+ className,
26
+ ...props
27
+ } = t0);
28
+ $[0] = t0;
29
+ $[1] = className;
30
+ $[2] = onSelect;
31
+ $[3] = props;
32
+ $[4] = suggestions;
33
+ $[5] = t1;
34
+ } else {
35
+ className = $[1];
36
+ onSelect = $[2];
37
+ props = $[3];
38
+ suggestions = $[4];
39
+ t1 = $[5];
40
+ }
41
+ const disabled = t1 === undefined ? false : t1;
17
42
  if (suggestions.length === 0) {
18
43
  return null;
19
44
  }
20
- return /*#__PURE__*/_jsx("div", {
21
- "data-slot": "starters",
22
- role: "group",
23
- "aria-label": "Suggested prompts",
24
- className: cn("flex flex-col divide-y bg-card ring-1 ring-border", className),
25
- ...props,
26
- children: suggestions.map(suggestion => /*#__PURE__*/_jsxs("button", {
27
- type: "button",
28
- disabled: disabled,
29
- onClick: () => onSelect(textOf(suggestion)),
30
- className: "group flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm outline-none hover:bg-accent/50 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 motion-safe:transition-colors",
31
- children: [/*#__PURE__*/_jsx("span", {
32
- className: "min-w-0 flex-1 text-pretty",
33
- children: labelOf(suggestion)
34
- }), /*#__PURE__*/_jsx(ArrowUpRightIcon, {
35
- "aria-hidden": true,
36
- className: "size-3.5 shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 motion-safe:transition-opacity"
37
- })]
38
- }, textOf(suggestion)))
39
- });
45
+ let t2;
46
+ if ($[6] !== className) {
47
+ t2 = cn("flex flex-col", className);
48
+ $[6] = className;
49
+ $[7] = t2;
50
+ } else {
51
+ t2 = $[7];
52
+ }
53
+ let t3;
54
+ if ($[8] !== disabled || $[9] !== onSelect || $[10] !== suggestions) {
55
+ let t4;
56
+ if ($[12] !== disabled || $[13] !== onSelect) {
57
+ t4 = suggestion => /*#__PURE__*/_jsxs("button", {
58
+ type: "button",
59
+ disabled: disabled,
60
+ onClick: () => onSelect(textOf(suggestion)),
61
+ className: "group -mx-2 flex w-[calc(100%+1rem)] items-center gap-3 px-2 py-1.5 text-left text-sm text-muted-foreground locus-focus-ring hover:bg-muted/50 hover:text-foreground disabled:pointer-events-none disabled:opacity-50 motion-safe:transition-colors",
62
+ children: [/*#__PURE__*/_jsx("span", {
63
+ className: "min-w-0 flex-1 text-pretty",
64
+ children: labelOf(suggestion)
65
+ }), /*#__PURE__*/_jsx(ArrowUpRightIcon, {
66
+ weight: "bold",
67
+ "aria-hidden": true,
68
+ className: "size-3.5 shrink-0 text-interactive opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 motion-safe:transition-opacity"
69
+ })]
70
+ }, textOf(suggestion));
71
+ $[12] = disabled;
72
+ $[13] = onSelect;
73
+ $[14] = t4;
74
+ } else {
75
+ t4 = $[14];
76
+ }
77
+ t3 = suggestions.map(t4);
78
+ $[8] = disabled;
79
+ $[9] = onSelect;
80
+ $[10] = suggestions;
81
+ $[11] = t3;
82
+ } else {
83
+ t3 = $[11];
84
+ }
85
+ let t4;
86
+ if ($[15] !== props || $[16] !== t2 || $[17] !== t3) {
87
+ t4 = /*#__PURE__*/_jsx("div", {
88
+ "data-slot": "starters",
89
+ role: "group",
90
+ "aria-label": "Suggested prompts",
91
+ className: t2,
92
+ ...props,
93
+ children: t3
94
+ });
95
+ $[15] = props;
96
+ $[16] = t2;
97
+ $[17] = t3;
98
+ $[18] = t4;
99
+ } else {
100
+ t4 = $[18];
101
+ }
102
+ return t4;
40
103
  }
@@ -1,18 +1,48 @@
1
+ "use client";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
1
4
  import { useEffect, useRef, useState } from "react";
2
5
  const copiedDurationMs = 1500;
3
6
  export function useCopied() {
7
+ const $ = _c(5);
4
8
  const [copied, setCopied] = useState(false);
5
9
  const timer = useRef(undefined);
6
- useEffect(() => () => clearTimeout(timer.current), []);
7
- const markCopied = () => {
8
- setCopied(true);
9
- clearTimeout(timer.current);
10
- timer.current = setTimeout(() => setCopied(false), copiedDurationMs);
11
- };
12
- return {
13
- copied,
14
- markCopied
15
- };
10
+ let t0;
11
+ let t1;
12
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
13
+ t0 = () => () => clearTimeout(timer.current);
14
+ t1 = [];
15
+ $[0] = t0;
16
+ $[1] = t1;
17
+ } else {
18
+ t0 = $[0];
19
+ t1 = $[1];
20
+ }
21
+ useEffect(t0, t1);
22
+ let t2;
23
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
24
+ t2 = () => {
25
+ setCopied(true);
26
+ clearTimeout(timer.current);
27
+ timer.current = setTimeout(() => setCopied(false), copiedDurationMs);
28
+ };
29
+ $[2] = t2;
30
+ } else {
31
+ t2 = $[2];
32
+ }
33
+ const markCopied = t2;
34
+ let t3;
35
+ if ($[3] !== copied) {
36
+ t3 = {
37
+ copied,
38
+ markCopied
39
+ };
40
+ $[3] = copied;
41
+ $[4] = t3;
42
+ } else {
43
+ t3 = $[4];
44
+ }
45
+ return t3;
16
46
  }
17
47
  export async function writeToClipboard(text) {
18
48
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@locusgraph/loop",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Agent components for LocusGraph apps: chat, agent steps, human-in-the-loop approvals, memory and cost. Takes Vercel AI SDK UIMessage parts; never calls a model.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -29,21 +29,21 @@
29
29
  "provenance": true
30
30
  },
31
31
  "peerDependencies": {
32
- "@locusgraph/components": "^0.3.0",
32
+ "@locusgraph/components": "^0.4.0",
33
33
  "react": "^19.2.0",
34
34
  "react-dom": "^19.2.0"
35
35
  },
36
36
  "dependencies": {
37
- "@carbon/icons-react": "11.89.0",
38
- "@locusgraph/brand": "0.2.0",
39
- "@locusgraph/utils": "0.1.1",
37
+ "@phosphor-icons/react": "2.1.10",
38
+ "@locusgraph/brand": "0.2.1",
39
+ "@locusgraph/utils": "0.1.2",
40
40
  "@tanstack/react-virtual": "3.14.13",
41
41
  "react-markdown": "^10.1.0",
42
42
  "remark-gfm": "^4.0.1",
43
43
  "shiki": "^4.5.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@locusgraph/components": "0.3.0",
46
+ "@locusgraph/components": "0.4.0",
47
47
  "@locusgraph/config": "0.1.1",
48
48
  "@types/node": "^22.0.0",
49
49
  "@types/react": "^19.2.0",
@@ -1 +0,0 @@
1
- export { StatusDot, type StatusTone, statusDotTones } from "../../shared/status-dot.js";
@@ -1 +0,0 @@
1
- export { StatusDot, statusDotTones } from "../../shared/status-dot.js";
@@ -1 +0,0 @@
1
- export { DecisionSummary, type DecisionSummaryProps, } from "../../shared/decision-summary.js";
@@ -1 +0,0 @@
1
- export { DecisionSummary } from "../../shared/decision-summary.js";
@@ -1,6 +0,0 @@
1
- export declare const eyebrowClass = "locus-eyebrow [&_svg]:size-3.5 [&_svg]:shrink-0";
2
- export declare const collapsibleTriggerClass = "group inline-flex w-fit items-center gap-2 py-1 outline-none transition-colors duration-150 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/70 motion-reduce:transition-none locus-eyebrow [&_svg]:size-3.5 [&_svg]:shrink-0";
3
- export declare const chevronClass = "opacity-70 transition-transform duration-150 group-data-[state=open]:rotate-90 motion-reduce:transition-none";
4
- export declare const ruledRowClass = "flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm";
5
- export declare const ruledListClass = "flex flex-col divide-y divide-border bg-card ring-1 ring-border";
6
- export declare const interactiveRowClass = "outline-none transition-colors duration-150 hover:bg-accent/50 focus-visible:bg-accent motion-reduce:transition-none";
@@ -1,6 +0,0 @@
1
- export const eyebrowClass = "locus-eyebrow [&_svg]:size-3.5 [&_svg]:shrink-0";
2
- export const collapsibleTriggerClass = `group inline-flex w-fit items-center gap-2 py-1 outline-none transition-colors duration-150 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/70 motion-reduce:transition-none ${eyebrowClass}`;
3
- export const chevronClass = "opacity-70 transition-transform duration-150 group-data-[state=open]:rotate-90 motion-reduce:transition-none";
4
- export const ruledRowClass = "flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm";
5
- export const ruledListClass = "flex flex-col divide-y divide-border bg-card ring-1 ring-border";
6
- export const interactiveRowClass = "outline-none transition-colors duration-150 hover:bg-accent/50 focus-visible:bg-accent motion-reduce:transition-none";
@@ -1,19 +0,0 @@
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 {};
@@ -1,77 +0,0 @@
1
- import { cn } from "@locusgraph/components";
2
- import { StatusDot } from "./status-dot.js";
3
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
4
- export function ApprovalPanel({
5
- className,
6
- ...props
7
- }) {
8
- return /*#__PURE__*/_jsx("section", {
9
- className: cn("flex min-w-0 flex-col bg-card text-card-foreground ring-1 ring-border", className),
10
- ...props
11
- });
12
- }
13
- export function PanelHeader({
14
- icon,
15
- eyebrow,
16
- status,
17
- tone = "idle",
18
- aside
19
- }) {
20
- return /*#__PURE__*/_jsxs("header", {
21
- "data-slot": "panel-header",
22
- className: "locus-eyebrow flex items-center gap-2 px-5 pt-4 [&_svg]:size-3.5 [&_svg]:shrink-0",
23
- children: [icon, /*#__PURE__*/_jsx("span", {
24
- className: "min-w-0 truncate",
25
- children: eyebrow
26
- }), /*#__PURE__*/_jsxs("span", {
27
- className: "ml-auto flex shrink-0 items-center gap-1.5",
28
- children: [aside && /*#__PURE__*/_jsx("span", {
29
- className: "mr-2 tabular-nums",
30
- children: aside
31
- }), status && /*#__PURE__*/_jsxs(_Fragment, {
32
- children: [/*#__PURE__*/_jsx(StatusDot, {
33
- tone: tone
34
- }), /*#__PURE__*/_jsx("span", {
35
- children: status
36
- })]
37
- })]
38
- })]
39
- });
40
- }
41
- export function PanelTitle({
42
- className,
43
- ...props
44
- }) {
45
- return /*#__PURE__*/_jsx("h3", {
46
- className: cn("px-5 pt-2 font-sans text-base leading-snug font-semibold tracking-tight text-balance", className),
47
- ...props
48
- });
49
- }
50
- export function PanelBody({
51
- className,
52
- ...props
53
- }) {
54
- return /*#__PURE__*/_jsx("div", {
55
- className: cn("flex flex-col gap-4 px-5 pt-4 pb-5", className),
56
- ...props
57
- });
58
- }
59
- export function PanelFooter({
60
- className,
61
- ...props
62
- }) {
63
- return /*#__PURE__*/_jsx("div", {
64
- className: cn("flex flex-wrap items-center justify-end gap-2 border-t bg-muted/70 px-5 py-3", className),
65
- ...props
66
- });
67
- }
68
- export function LiveStatus({
69
- message
70
- }) {
71
- return /*#__PURE__*/_jsx("p", {
72
- role: "status",
73
- "aria-live": "polite",
74
- className: "sr-only",
75
- children: message
76
- });
77
- }
@@ -1,6 +0,0 @@
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;
@@ -1,20 +0,0 @@
1
- import { cn } from "@locusgraph/components";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- export const statusDotTones = {
4
- running: "bg-warn motion-safe:animate-pulse",
5
- waiting: "bg-warn motion-safe:animate-pulse",
6
- done: "bg-good",
7
- danger: "bg-destructive",
8
- idle: "bg-muted-foreground/50"
9
- };
10
- export function StatusDot({
11
- tone,
12
- className
13
- }) {
14
- return /*#__PURE__*/_jsx("span", {
15
- "aria-hidden": true,
16
- "data-slot": "status-dot",
17
- "data-tone": tone,
18
- className: cn("size-1.5 shrink-0 rounded-full", statusDotTones[tone], className)
19
- });
20
- }