@locusgraph/loop 0.3.1 → 0.4.1

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 (119) hide show
  1. package/dist/agent/index.d.ts +1 -1
  2. package/dist/agent/pulse/gradient-label.js +6 -5
  3. package/dist/agent/pulse/marks/bars-mark.js +1 -1
  4. package/dist/agent/pulse/marks/glyph-mark.js +2 -2
  5. package/dist/agent/pulse/marks/locus-mark.js +1 -1
  6. package/dist/agent/pulse/pulse.js +1 -1
  7. package/dist/agent/pulse/use-loop-animation.d.ts +0 -1
  8. package/dist/agent/pulse/use-loop-animation.js +1 -3
  9. package/dist/agent/steps/step-icon.js +20 -13
  10. package/dist/agent/steps/steps.js +39 -37
  11. package/dist/agent/thinking/thinking.js +65 -62
  12. package/dist/agent/tool/json-block.js +10 -7
  13. package/dist/agent/tool/tool-status.d.ts +2 -0
  14. package/dist/agent/tool/tool-status.js +16 -13
  15. package/dist/agent/tool/tool.d.ts +8 -1
  16. package/dist/agent/tool/tool.js +238 -119
  17. package/dist/approval/inbox/inbox-row.d.ts +3 -3
  18. package/dist/approval/inbox/inbox-row.js +135 -200
  19. package/dist/approval/inbox/inbox.d.ts +3 -3
  20. package/dist/approval/inbox/inbox.js +180 -139
  21. package/dist/approval/inbox/virtual-inbox-list.d.ts +3 -3
  22. package/dist/approval/inbox/virtual-inbox-list.js +20 -21
  23. package/dist/approval/memory/memory-review.js +155 -154
  24. package/dist/approval/memory/memory-row.js +86 -87
  25. package/dist/approval/plan/plan-review.js +110 -129
  26. package/dist/approval/plan/plan-step-row.js +7 -6
  27. package/dist/approval/plan/plan-steps.d.ts +1 -1
  28. package/dist/approval/plan/plan-steps.js +2 -2
  29. package/dist/approval/plan/question-choices.js +10 -7
  30. package/dist/approval/plan/question.js +116 -112
  31. package/dist/approval/run/run-bar.js +43 -40
  32. package/dist/approval/shared/approval-line.d.ts +27 -0
  33. package/dist/approval/shared/approval-line.js +85 -0
  34. package/dist/approval/shared/risk-badge.d.ts +3 -5
  35. package/dist/approval/shared/risk-badge.js +11 -19
  36. package/dist/approval/shared/time.d.ts +0 -1
  37. package/dist/approval/shared/time.js +0 -1
  38. package/dist/approval/shared/use-focus-when-settled.d.ts +2 -0
  39. package/dist/approval/shared/use-focus-when-settled.js +18 -0
  40. package/dist/approval/spend/raise-cap-form.d.ts +2 -2
  41. package/dist/approval/spend/raise-cap-form.js +134 -126
  42. package/dist/approval/spend/spend-gate.js +133 -156
  43. package/dist/approval/spend/spend-math.d.ts +1 -0
  44. package/dist/approval/spend/spend-math.js +5 -2
  45. package/dist/approval/spend/spend-meter.js +5 -5
  46. package/dist/approval/tool/approval.js +114 -214
  47. package/dist/approval/tool/args/args-editor.js +147 -156
  48. package/dist/approval/tool/args/args-field.js +197 -109
  49. package/dist/approval/tool/deny-form.js +59 -66
  50. package/dist/approval/tool/tool-inputs.js +38 -45
  51. package/dist/chat/chat/chat.js +5 -4
  52. package/dist/chat/chat/use-stick-to-bottom.js +1 -3
  53. package/dist/chat/composer/composer-actions.js +4 -1
  54. package/dist/chat/composer/composer.js +4 -3
  55. package/dist/chat/composer/use-auto-grow.js +14 -10
  56. package/dist/chat/files/files.js +12 -10
  57. package/dist/chat/reply/fenced-code.js +1 -1
  58. package/dist/chat/reply/markdown-components.js +9 -116
  59. package/dist/chat/reply/reply.js +2 -2
  60. package/dist/chat/turn/group-parts.d.ts +1 -0
  61. package/dist/chat/turn/group-parts.js +6 -3
  62. package/dist/chat/turn/turn.js +13 -4
  63. package/dist/cost/context.js +3 -3
  64. package/dist/cost/cost-steps.js +31 -30
  65. package/dist/cost/cost.js +39 -39
  66. package/dist/cost/model-picker.js +5 -4
  67. package/dist/cost/shared/context-breakdown.js +10 -11
  68. package/dist/cost/shared/model-option-row.js +4 -3
  69. package/dist/cost/shared/step-cost-row.js +11 -12
  70. package/dist/cost/shared/usage-totals.d.ts +1 -0
  71. package/dist/cost/shared/usage-totals.js +19 -1
  72. package/dist/memory/cite.js +55 -47
  73. package/dist/memory/memorized.js +123 -108
  74. package/dist/memory/recall.js +136 -146
  75. package/dist/memory/shared/host-label.d.ts +1 -1
  76. package/dist/memory/shared/host-label.js +2 -2
  77. package/dist/memory/shared/source-mark.js +1 -1
  78. package/dist/memory/sources.d.ts +2 -1
  79. package/dist/memory/sources.js +135 -100
  80. package/dist/shared/decision-summary.js +2 -1
  81. package/dist/shared/line.d.ts +10 -0
  82. package/dist/shared/line.js +11 -0
  83. package/dist/shared/live-status.d.ts +3 -0
  84. package/dist/shared/live-status.js +11 -0
  85. package/dist/shared/reduced-motion.d.ts +1 -0
  86. package/dist/shared/reduced-motion.js +3 -0
  87. package/dist/thread/actions/action-button.js +1 -1
  88. package/dist/thread/actions/actions.d.ts +3 -1
  89. package/dist/thread/actions/actions.js +100 -81
  90. package/dist/thread/actions/branch-switcher.js +67 -37
  91. package/dist/thread/canvas/canvas-meta.d.ts +9 -0
  92. package/dist/thread/canvas/canvas-meta.js +35 -0
  93. package/dist/thread/canvas/canvas.d.ts +1 -1
  94. package/dist/thread/canvas/canvas.js +64 -74
  95. package/dist/thread/canvas/version-switcher.d.ts +1 -0
  96. package/dist/thread/canvas/version-switcher.js +106 -87
  97. package/dist/thread/code/code.js +4 -6
  98. package/dist/thread/code/copy-code-button.d.ts +2 -1
  99. package/dist/thread/code/copy-code-button.js +56 -25
  100. package/dist/thread/history/history.d.ts +1 -1
  101. package/dist/thread/history/history.js +104 -104
  102. package/dist/thread/history/row/history-row.js +8 -5
  103. package/dist/thread/history/row/thread-item-menu.js +13 -4
  104. package/dist/thread/history/row/thread-title-editor.js +1 -1
  105. package/dist/thread/history/virtual-history-list.js +1 -2
  106. package/dist/thread/index.d.ts +1 -0
  107. package/dist/thread/index.js +1 -0
  108. package/dist/thread/starters/starters.js +5 -4
  109. package/package.json +6 -6
  110. package/dist/agent/shared/status-dot.d.ts +0 -1
  111. package/dist/agent/shared/status-dot.js +0 -1
  112. package/dist/approval/shared/decision-line.d.ts +0 -1
  113. package/dist/approval/shared/decision-line.js +0 -1
  114. package/dist/memory/shared/disclosure.d.ts +0 -6
  115. package/dist/memory/shared/disclosure.js +0 -6
  116. package/dist/shared/panel.d.ts +0 -19
  117. package/dist/shared/panel.js +0 -77
  118. package/dist/shared/status-dot.d.ts +0 -6
  119. package/dist/shared/status-dot.js +0 -20
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
 
3
3
  import { c as _c } from "react/compiler-runtime";
4
- import { Close as XIcon } from "@carbon/icons-react";
5
4
  import { Button, cn, ScrollArea } from "@locusgraph/components";
6
- import { VersionSwitcher } from "./version-switcher.js";
5
+ import { X as XIcon } from "@phosphor-icons/react/ssr";
6
+ import { CanvasMeta } from "./canvas-meta.js";
7
7
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
8
  function currentVersionOf(versions, versionId) {
9
9
  return versions.find(version => version.id === versionId) ?? versions.at(-1);
10
10
  }
11
11
  export function Canvas(t0) {
12
- const $ = _c(46);
12
+ const $ = _c(44);
13
13
  let actions;
14
14
  let children;
15
15
  let className;
@@ -77,136 +77,126 @@ export function Canvas(t0) {
77
77
  const current = t3;
78
78
  let t4;
79
79
  if ($[16] !== className) {
80
- t4 = cn("flex h-full min-h-0 min-w-0 flex-col bg-card text-card-foreground ring-1 ring-border", className);
80
+ t4 = cn("flex h-full min-h-0 min-w-0 flex-col bg-muted/40 text-foreground", className);
81
81
  $[16] = className;
82
82
  $[17] = t4;
83
83
  } else {
84
84
  t4 = $[17];
85
85
  }
86
86
  let t5;
87
- if ($[18] !== kind) {
88
- t5 = kind && /*#__PURE__*/_jsx("span", {
89
- className: "locus-eyebrow",
90
- children: kind
87
+ if ($[18] !== title) {
88
+ t5 = /*#__PURE__*/_jsx("h2", {
89
+ className: "truncate text-base leading-snug font-semibold tracking-tight",
90
+ children: title
91
91
  });
92
- $[18] = kind;
92
+ $[18] = title;
93
93
  $[19] = t5;
94
94
  } else {
95
95
  t5 = $[19];
96
96
  }
97
97
  let t6;
98
- if ($[20] !== title) {
99
- t6 = /*#__PURE__*/_jsx("h2", {
100
- className: "truncate font-sans text-base leading-snug font-semibold tracking-tight",
101
- children: title
98
+ if ($[20] !== current || $[21] !== kind || $[22] !== onVersionChange || $[23] !== versions) {
99
+ t6 = /*#__PURE__*/_jsx(CanvasMeta, {
100
+ kind: kind,
101
+ versions: versions,
102
+ current: current,
103
+ onVersionChange: onVersionChange
102
104
  });
103
- $[20] = title;
104
- $[21] = t6;
105
+ $[20] = current;
106
+ $[21] = kind;
107
+ $[22] = onVersionChange;
108
+ $[23] = versions;
109
+ $[24] = t6;
105
110
  } else {
106
- t6 = $[21];
111
+ t6 = $[24];
107
112
  }
108
113
  let t7;
109
- if ($[22] !== t5 || $[23] !== t6) {
114
+ if ($[25] !== t5 || $[26] !== t6) {
110
115
  t7 = /*#__PURE__*/_jsxs("div", {
111
- className: "flex min-w-0 flex-1 flex-col gap-1",
116
+ className: "flex min-w-0 flex-1 flex-col gap-0.5",
112
117
  children: [t5, t6]
113
118
  });
114
- $[22] = t5;
115
- $[23] = t6;
116
- $[24] = t7;
119
+ $[25] = t5;
120
+ $[26] = t6;
121
+ $[27] = t7;
117
122
  } else {
118
- t7 = $[24];
123
+ t7 = $[27];
119
124
  }
120
125
  let t8;
121
- if ($[25] !== onClose) {
126
+ if ($[28] !== onClose) {
122
127
  t8 = onClose && /*#__PURE__*/_jsx(Button, {
123
128
  type: "button",
124
129
  variant: "ghost",
125
130
  size: "icon-sm",
126
131
  "aria-label": "Close panel",
127
- className: "text-muted-foreground hover:text-foreground",
132
+ className: "text-faint hover:bg-transparent hover:text-interactive",
128
133
  onClick: onClose,
129
- children: /*#__PURE__*/_jsx(XIcon, {})
134
+ children: /*#__PURE__*/_jsx(XIcon, {
135
+ weight: "bold",
136
+ "aria-hidden": true
137
+ })
130
138
  });
131
- $[25] = onClose;
132
- $[26] = t8;
139
+ $[28] = onClose;
140
+ $[29] = t8;
133
141
  } else {
134
- t8 = $[26];
142
+ t8 = $[29];
135
143
  }
136
144
  let t9;
137
- if ($[27] !== actions || $[28] !== t8) {
145
+ if ($[30] !== actions || $[31] !== t8) {
138
146
  t9 = /*#__PURE__*/_jsxs("div", {
139
- className: "-mr-2 flex shrink-0 items-center gap-0.5 text-muted-foreground",
147
+ className: "-mr-2 flex shrink-0 items-center gap-0.5 text-faint [&_button:hover]:text-interactive",
140
148
  children: [actions, t8]
141
149
  });
142
- $[27] = actions;
143
- $[28] = t8;
144
- $[29] = t9;
150
+ $[30] = actions;
151
+ $[31] = t8;
152
+ $[32] = t9;
145
153
  } else {
146
- t9 = $[29];
154
+ t9 = $[32];
147
155
  }
148
156
  let t10;
149
- if ($[30] !== t7 || $[31] !== t9) {
157
+ if ($[33] !== t7 || $[34] !== t9) {
150
158
  t10 = /*#__PURE__*/_jsxs("header", {
151
- className: "flex items-start gap-3 border-b px-5 pt-3.5 pb-3",
159
+ className: "flex items-start gap-3 px-6 pt-4 pb-3",
152
160
  children: [t7, t9]
153
161
  });
154
- $[30] = t7;
155
- $[31] = t9;
156
- $[32] = t10;
162
+ $[33] = t7;
163
+ $[34] = t9;
164
+ $[35] = t10;
157
165
  } else {
158
- t10 = $[32];
166
+ t10 = $[35];
159
167
  }
160
168
  let t11;
161
- if ($[33] !== children) {
169
+ if ($[36] !== children) {
162
170
  t11 = /*#__PURE__*/_jsx(ScrollArea, {
163
171
  className: "min-h-0 flex-1",
164
172
  children: /*#__PURE__*/_jsx("div", {
165
173
  "data-slot": "canvas-content",
166
- className: "px-5 py-4 has-[>[data-slot=code]:only-child]:p-0 [&>[data-slot=code]:only-child]:ring-0",
174
+ className: "px-6 pt-1 pb-6 [&>[data-slot=code]:only-child]:bg-transparent [&>[data-slot=code]:only-child>figcaption]:hidden [&>[data-slot=code]:only-child_[data-slot=code-area]]:p-0",
167
175
  children: children
168
176
  })
169
177
  });
170
- $[33] = children;
171
- $[34] = t11;
178
+ $[36] = children;
179
+ $[37] = t11;
172
180
  } else {
173
- t11 = $[34];
181
+ t11 = $[37];
174
182
  }
175
183
  let t12;
176
- if ($[35] !== current || $[36] !== onVersionChange || $[37] !== versions) {
177
- t12 = current && /*#__PURE__*/_jsx("footer", {
178
- className: "flex h-10 items-center gap-2 border-t bg-muted/30 pr-3 pl-5",
179
- children: /*#__PURE__*/_jsx(VersionSwitcher, {
180
- versions: versions,
181
- current: current,
182
- onVersionChange: onVersionChange
183
- })
184
- });
185
- $[35] = current;
186
- $[36] = onVersionChange;
187
- $[37] = versions;
188
- $[38] = t12;
189
- } else {
190
- t12 = $[38];
191
- }
192
- let t13;
193
- if ($[39] !== props || $[40] !== t10 || $[41] !== t11 || $[42] !== t12 || $[43] !== t4 || $[44] !== title) {
194
- t13 = /*#__PURE__*/_jsxs("aside", {
184
+ if ($[38] !== props || $[39] !== t10 || $[40] !== t11 || $[41] !== t4 || $[42] !== title) {
185
+ t12 = /*#__PURE__*/_jsxs("aside", {
195
186
  "data-slot": "canvas",
196
187
  "aria-label": title,
197
188
  className: t4,
198
189
  ...props,
199
- children: [t10, t11, t12]
190
+ children: [t10, t11]
200
191
  });
201
- $[39] = props;
202
- $[40] = t10;
203
- $[41] = t11;
204
- $[42] = t12;
205
- $[43] = t4;
206
- $[44] = title;
207
- $[45] = t13;
192
+ $[38] = props;
193
+ $[39] = t10;
194
+ $[40] = t11;
195
+ $[41] = t4;
196
+ $[42] = title;
197
+ $[43] = t12;
208
198
  } else {
209
- t13 = $[45];
199
+ t12 = $[43];
210
200
  }
211
- return t13;
201
+ return t12;
212
202
  }
@@ -8,5 +8,6 @@ type VersionSwitcherProps = {
8
8
  current: CanvasVersion;
9
9
  onVersionChange?: (id: string) => void;
10
10
  };
11
+ export declare const metaLinkClass = "inline-flex items-center gap-1 locus-focus-ring transition-colors duration-150 hover:text-interactive motion-reduce:transition-none";
11
12
  export declare function VersionSwitcher({ versions, current, onVersionChange }: VersionSwitcherProps): import("react").JSX.Element;
12
13
  export {};
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
 
3
3
  import { c as _c } from "react/compiler-runtime";
4
- import { ChevronDown as ChevronDownIcon } from "@carbon/icons-react";
5
- import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "@locusgraph/components";
4
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "@locusgraph/components";
6
5
  import { formatDate } from "@locusgraph/utils";
6
+ import { CaretDown as ChevronDownIcon } from "@phosphor-icons/react/ssr";
7
7
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
- export function VersionSwitcher(t0) {
9
- const $ = _c(26);
8
+ export const metaLinkClass = "inline-flex items-center gap-1 locus-focus-ring transition-colors duration-150 hover:text-interactive motion-reduce:transition-none";
9
+ function VersionLabel(t0) {
10
+ const $ = _c(11);
10
11
  const {
11
12
  versions,
12
- current,
13
- onVersionChange
13
+ current
14
14
  } = t0;
15
15
  let t1;
16
16
  if ($[0] !== current.label) {
@@ -23,131 +23,150 @@ export function VersionSwitcher(t0) {
23
23
  } else {
24
24
  t1 = $[1];
25
25
  }
26
- let t2;
27
- if ($[2] !== versions.length) {
28
- t2 = versions.length > 1 && /*#__PURE__*/_jsxs("span", {
29
- className: "text-muted-foreground",
30
- children: ["of ", versions.length]
31
- });
32
- $[2] = versions.length;
33
- $[3] = t2;
34
- } else {
35
- t2 = $[3];
36
- }
26
+ const t2 = versions.length > 1 && ` of ${versions.length}`;
37
27
  const t3 = current.createdAt;
38
28
  let t4;
39
- if ($[4] !== current.createdAt) {
29
+ if ($[2] !== current.createdAt) {
40
30
  t4 = formatDate(current.createdAt);
41
- $[4] = current.createdAt;
42
- $[5] = t4;
31
+ $[2] = current.createdAt;
32
+ $[3] = t4;
43
33
  } else {
44
- t4 = $[5];
34
+ t4 = $[3];
45
35
  }
46
36
  let t5;
47
- if ($[6] !== current.createdAt || $[7] !== t4) {
37
+ if ($[4] !== current.createdAt || $[5] !== t4) {
48
38
  t5 = /*#__PURE__*/_jsx("time", {
49
39
  dateTime: t3,
50
- className: "text-muted-foreground",
51
40
  children: t4
52
41
  });
53
- $[6] = current.createdAt;
54
- $[7] = t4;
55
- $[8] = t5;
42
+ $[4] = current.createdAt;
43
+ $[5] = t4;
44
+ $[6] = t5;
56
45
  } else {
57
- t5 = $[8];
46
+ t5 = $[6];
58
47
  }
59
48
  let t6;
60
- if ($[9] !== t1 || $[10] !== t2 || $[11] !== t5) {
49
+ if ($[7] !== t1 || $[8] !== t2 || $[9] !== t5) {
61
50
  t6 = /*#__PURE__*/_jsxs("span", {
62
- className: "flex items-center gap-2 font-mono text-[11px] tabular-nums",
63
- children: [t1, t2, t5]
51
+ className: "tabular-nums",
52
+ children: [t1, t2, " \xB7 ", t5]
64
53
  });
65
- $[9] = t1;
66
- $[10] = t2;
67
- $[11] = t5;
68
- $[12] = t6;
54
+ $[7] = t1;
55
+ $[8] = t2;
56
+ $[9] = t5;
57
+ $[10] = t6;
69
58
  } else {
70
- t6 = $[12];
59
+ t6 = $[10];
71
60
  }
72
- const label = t6;
61
+ return t6;
62
+ }
63
+ export function VersionSwitcher(t0) {
64
+ const $ = _c(19);
65
+ const {
66
+ versions,
67
+ current,
68
+ onVersionChange
69
+ } = t0;
73
70
  if (versions.length < 2 || !onVersionChange) {
74
- return label;
71
+ let t1;
72
+ if ($[0] !== current || $[1] !== versions) {
73
+ t1 = /*#__PURE__*/_jsx(VersionLabel, {
74
+ versions: versions,
75
+ current: current
76
+ });
77
+ $[0] = current;
78
+ $[1] = versions;
79
+ $[2] = t1;
80
+ } else {
81
+ t1 = $[2];
82
+ }
83
+ return t1;
75
84
  }
76
- const t7 = `Version ${current.label}, choose another version`;
77
- let t8;
78
- if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
79
- t8 = /*#__PURE__*/_jsx(ChevronDownIcon, {});
80
- $[13] = t8;
85
+ const t1 = `Version ${current.label}, choose another version`;
86
+ let t2;
87
+ if ($[3] !== current || $[4] !== versions) {
88
+ t2 = /*#__PURE__*/_jsx(VersionLabel, {
89
+ versions: versions,
90
+ current: current
91
+ });
92
+ $[3] = current;
93
+ $[4] = versions;
94
+ $[5] = t2;
81
95
  } else {
82
- t8 = $[13];
96
+ t2 = $[5];
83
97
  }
84
- let t9;
85
- if ($[14] !== label || $[15] !== t7) {
86
- t9 = /*#__PURE__*/_jsx(DropdownMenuTrigger, {
87
- asChild: true,
88
- children: /*#__PURE__*/_jsxs(Button, {
89
- type: "button",
90
- variant: "ghost",
91
- size: "xs",
92
- className: "-ml-2 font-normal",
93
- "aria-label": t7,
94
- children: [label, t8]
95
- })
98
+ let t3;
99
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
100
+ t3 = /*#__PURE__*/_jsx(ChevronDownIcon, {
101
+ weight: "bold",
102
+ "aria-hidden": true,
103
+ className: "size-3"
96
104
  });
97
- $[14] = label;
98
- $[15] = t7;
99
- $[16] = t9;
105
+ $[6] = t3;
100
106
  } else {
101
- t9 = $[16];
107
+ t3 = $[6];
102
108
  }
103
- const t10 = current.id;
104
- let t11;
105
- if ($[17] !== versions) {
106
- t11 = versions.map(_temp);
107
- $[17] = versions;
108
- $[18] = t11;
109
+ let t4;
110
+ if ($[7] !== t1 || $[8] !== t2) {
111
+ t4 = /*#__PURE__*/_jsxs(DropdownMenuTrigger, {
112
+ className: metaLinkClass,
113
+ "aria-label": t1,
114
+ children: [t2, t3]
115
+ });
116
+ $[7] = t1;
117
+ $[8] = t2;
118
+ $[9] = t4;
109
119
  } else {
110
- t11 = $[18];
120
+ t4 = $[9];
111
121
  }
112
- let t12;
113
- if ($[19] !== current.id || $[20] !== onVersionChange || $[21] !== t11) {
114
- t12 = /*#__PURE__*/_jsx(DropdownMenuContent, {
122
+ const t5 = current.id;
123
+ let t6;
124
+ if ($[10] !== versions) {
125
+ t6 = versions.map(_temp);
126
+ $[10] = versions;
127
+ $[11] = t6;
128
+ } else {
129
+ t6 = $[11];
130
+ }
131
+ let t7;
132
+ if ($[12] !== current.id || $[13] !== onVersionChange || $[14] !== t6) {
133
+ t7 = /*#__PURE__*/_jsx(DropdownMenuContent, {
115
134
  align: "start",
116
135
  sideOffset: 6,
117
136
  children: /*#__PURE__*/_jsx(DropdownMenuRadioGroup, {
118
- value: t10,
137
+ value: t5,
119
138
  onValueChange: onVersionChange,
120
- children: t11
139
+ children: t6
121
140
  })
122
141
  });
123
- $[19] = current.id;
124
- $[20] = onVersionChange;
125
- $[21] = t11;
126
- $[22] = t12;
142
+ $[12] = current.id;
143
+ $[13] = onVersionChange;
144
+ $[14] = t6;
145
+ $[15] = t7;
127
146
  } else {
128
- t12 = $[22];
147
+ t7 = $[15];
129
148
  }
130
- let t13;
131
- if ($[23] !== t12 || $[24] !== t9) {
132
- t13 = /*#__PURE__*/_jsxs(DropdownMenu, {
133
- children: [t9, t12]
149
+ let t8;
150
+ if ($[16] !== t4 || $[17] !== t7) {
151
+ t8 = /*#__PURE__*/_jsxs(DropdownMenu, {
152
+ children: [t4, t7]
134
153
  });
135
- $[23] = t12;
136
- $[24] = t9;
137
- $[25] = t13;
154
+ $[16] = t4;
155
+ $[17] = t7;
156
+ $[18] = t8;
138
157
  } else {
139
- t13 = $[25];
158
+ t8 = $[18];
140
159
  }
141
- return t13;
160
+ return t8;
142
161
  }
143
162
  function _temp(version) {
144
163
  return /*#__PURE__*/_jsxs(DropdownMenuRadioItem, {
145
164
  value: version.id,
146
165
  children: [/*#__PURE__*/_jsx("span", {
147
- className: "font-mono text-xs",
166
+ className: "text-sm tabular-nums",
148
167
  children: version.label
149
168
  }), /*#__PURE__*/_jsx("span", {
150
- className: "ml-auto pl-4 text-xs text-muted-foreground",
169
+ className: "ml-auto pl-4 text-xs text-muted-foreground tabular-nums",
151
170
  children: formatDate(version.createdAt)
152
171
  })]
153
172
  }, version.id);
@@ -6,7 +6,7 @@ import { useEffect, useState } from "react";
6
6
  import { CopyCodeButton } from "./copy-code-button.js";
7
7
  import { highlightToHtml } from "./highlight.js";
8
8
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
- const codeAreaClass = cn("overflow-x-auto bg-muted/40 px-4 py-3 font-mono text-xs leading-relaxed", "[&_pre]:bg-transparent! [&_pre]:outline-none", "[&_.shiki_span]:text-(--shiki-light) dark:[&_.shiki_span]:text-(--shiki-dark)");
9
+ const codeAreaClass = cn("overflow-x-auto px-4 pb-3 font-mono text-xs leading-relaxed", "[&_pre]:bg-transparent! [&_pre]:outline-none has-[pre:focus-visible]:outline-2 has-[pre:focus-visible]:-outline-offset-2 has-[pre:focus-visible]:outline-ring/70", "[&_.shiki_span]:text-(--shiki-light) dark:[&_.shiki_span]:text-(--shiki-dark)");
10
10
  function useHighlightedHtml(code, language) {
11
11
  const $ = _c(4);
12
12
  const [html, setHtml] = useState(null);
@@ -82,7 +82,7 @@ export function Code(t0) {
82
82
  const html = useHighlightedHtml(code, language);
83
83
  let t3;
84
84
  if ($[8] !== className) {
85
- t3 = cn("min-w-0 bg-card text-card-foreground ring-1 ring-border", className);
85
+ t3 = cn("min-w-0 bg-muted/40 text-foreground", className);
86
86
  $[8] = className;
87
87
  $[9] = t3;
88
88
  } else {
@@ -91,10 +91,9 @@ export function Code(t0) {
91
91
  let t4;
92
92
  if ($[10] !== filename || $[11] !== language) {
93
93
  t4 = filename ? /*#__PURE__*/_jsx("span", {
94
- className: "min-w-0 truncate font-mono text-xs text-foreground",
94
+ className: "min-w-0 truncate font-medium text-muted-foreground",
95
95
  children: filename
96
96
  }) : /*#__PURE__*/_jsx("span", {
97
- className: "locus-eyebrow",
98
97
  children: language
99
98
  });
100
99
  $[10] = filename;
@@ -106,7 +105,6 @@ export function Code(t0) {
106
105
  let t5;
107
106
  if ($[13] !== filename || $[14] !== language) {
108
107
  t5 = filename && /*#__PURE__*/_jsx("span", {
109
- className: "locus-eyebrow",
110
108
  children: language
111
109
  });
112
110
  $[13] = filename;
@@ -143,7 +141,7 @@ export function Code(t0) {
143
141
  let t8;
144
142
  if ($[23] !== t4 || $[24] !== t7) {
145
143
  t8 = /*#__PURE__*/_jsxs("figcaption", {
146
- className: "flex h-8 items-center justify-between gap-2 border-b pr-1 pl-3",
144
+ className: "flex h-control items-center justify-between gap-2 pr-1.5 pl-4 text-xs text-faint",
147
145
  children: [t4, t7]
148
146
  });
149
147
  $[23] = t4;
@@ -1,6 +1,7 @@
1
1
  type CopyCodeButtonProps = {
2
2
  code: string;
3
3
  onCopy?: (code: string) => void;
4
+ size?: "icon-xs" | "icon-sm";
4
5
  };
5
- export declare function CopyCodeButton({ code, onCopy }: CopyCodeButtonProps): import("react").JSX.Element;
6
+ export declare function CopyCodeButton({ code, onCopy, size }: CopyCodeButtonProps): import("react").JSX.Element;
6
7
  export {};
@@ -1,23 +1,26 @@
1
1
  "use client";
2
2
 
3
3
  import { c as _c } from "react/compiler-runtime";
4
- import { Checkmark as CheckIcon, Copy as CopyIcon } from "@carbon/icons-react";
5
4
  import { Button } from "@locusgraph/components";
5
+ import { Check as CheckIcon, Copy as CopyIcon } from "@phosphor-icons/react/ssr";
6
+ import { LiveStatus } from "../../shared/live-status.js";
6
7
  import { useCopied, writeToClipboard } from "../use-copied.js";
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
8
9
  export function CopyCodeButton(t0) {
9
- const $ = _c(10);
10
+ const $ = _c(16);
10
11
  const {
11
12
  code,
12
- onCopy
13
+ onCopy,
14
+ size: t1
13
15
  } = t0;
16
+ const size = t1 === undefined ? "icon-xs" : t1;
14
17
  const {
15
18
  copied,
16
19
  markCopied
17
20
  } = useCopied();
18
- let t1;
21
+ let t2;
19
22
  if ($[0] !== code || $[1] !== markCopied || $[2] !== onCopy) {
20
- t1 = async () => {
23
+ t2 = async () => {
21
24
  if (onCopy) {
22
25
  onCopy(code);
23
26
  markCopied();
@@ -30,39 +33,67 @@ export function CopyCodeButton(t0) {
30
33
  $[0] = code;
31
34
  $[1] = markCopied;
32
35
  $[2] = onCopy;
33
- $[3] = t1;
36
+ $[3] = t2;
34
37
  } else {
35
- t1 = $[3];
38
+ t2 = $[3];
36
39
  }
37
- const copy = t1;
38
- const t2 = copied ? "Copied" : "Copy code";
39
- let t3;
40
+ const copy = t2;
41
+ const t3 = copied ? "Copied" : "Copy code";
42
+ let t4;
40
43
  if ($[4] !== copied) {
41
- t3 = copied ? /*#__PURE__*/_jsx(CheckIcon, {
44
+ t4 = copied ? /*#__PURE__*/_jsx(CheckIcon, {
45
+ weight: "bold",
46
+ "aria-hidden": true,
42
47
  className: "text-good"
43
- }) : /*#__PURE__*/_jsx(CopyIcon, {});
48
+ }) : /*#__PURE__*/_jsx(CopyIcon, {
49
+ weight: "bold",
50
+ "aria-hidden": true
51
+ });
44
52
  $[4] = copied;
45
- $[5] = t3;
53
+ $[5] = t4;
46
54
  } else {
47
- t3 = $[5];
55
+ t4 = $[5];
48
56
  }
49
- let t4;
50
- if ($[6] !== copy || $[7] !== t2 || $[8] !== t3) {
51
- t4 = /*#__PURE__*/_jsx(Button, {
57
+ let t5;
58
+ if ($[6] !== copy || $[7] !== size || $[8] !== t3 || $[9] !== t4) {
59
+ t5 = /*#__PURE__*/_jsx(Button, {
52
60
  type: "button",
53
61
  variant: "ghost",
54
- size: "icon-xs",
55
- "aria-label": t2,
56
- className: "text-muted-foreground hover:text-foreground",
62
+ size: size,
63
+ "aria-label": t3,
64
+ className: "text-faint hover:bg-transparent hover:text-interactive",
57
65
  onClick: copy,
58
- children: t3
66
+ children: t4
59
67
  });
60
68
  $[6] = copy;
61
- $[7] = t2;
69
+ $[7] = size;
62
70
  $[8] = t3;
63
71
  $[9] = t4;
72
+ $[10] = t5;
73
+ } else {
74
+ t5 = $[10];
75
+ }
76
+ const t6 = copied ? "Code copied" : "";
77
+ let t7;
78
+ if ($[11] !== t6) {
79
+ t7 = /*#__PURE__*/_jsx(LiveStatus, {
80
+ message: t6
81
+ });
82
+ $[11] = t6;
83
+ $[12] = t7;
84
+ } else {
85
+ t7 = $[12];
86
+ }
87
+ let t8;
88
+ if ($[13] !== t5 || $[14] !== t7) {
89
+ t8 = /*#__PURE__*/_jsxs(_Fragment, {
90
+ children: [t5, t7]
91
+ });
92
+ $[13] = t5;
93
+ $[14] = t7;
94
+ $[15] = t8;
64
95
  } else {
65
- t4 = $[9];
96
+ t8 = $[15];
66
97
  }
67
- return t4;
98
+ return t8;
68
99
  }
@@ -1,4 +1,4 @@
1
- import type { ComponentProps } from "react";
1
+ import { type ComponentProps } from "react";
2
2
  import { type HistoryItem } from "./row/history-row.js";
3
3
  type HistoryProps = Omit<ComponentProps<"nav">, "onSelect"> & {
4
4
  threads: HistoryItem[];