@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,13 +1,15 @@
1
1
  "use client";
2
2
 
3
3
  import { c as _c } from "react/compiler-runtime";
4
- import { ArrowRight as ArrowRightIcon, ListChecked as ListChecksIcon } from "@carbon/icons-react";
5
- import { Button } from "@locusgraph/components";
4
+ import { Button, cn } from "@locusgraph/components";
6
5
  import { pluralize } from "@locusgraph/utils";
6
+ import { ArrowRight as ArrowRightIcon, ListChecks as ListChecksIcon } from "@phosphor-icons/react/ssr";
7
7
  import { useEffect, useId, useState } from "react";
8
- import { ApprovalPanel, LiveStatus, PanelBody, PanelFooter, PanelHeader, PanelTitle } from "../../shared/panel.js";
9
- import { DecisionSummary } from "../shared/decision-line.js";
8
+ import { DecisionSummary } from "../../shared/decision-summary.js";
9
+ import { LiveStatus } from "../../shared/live-status.js";
10
+ import { ApprovalHeadline, SettledLine } from "../shared/approval-line.js";
10
11
  import { useFocusOnMount } from "../shared/use-focus-on-mount.js";
12
+ import { useFocusWhenSettled } from "../shared/use-focus-when-settled.js";
11
13
  import { PlanStepRow, stepControlId } from "./plan-step-row.js";
12
14
  import { applyStepAction, describeStepAction, focusAfterAction } from "./plan-steps.js";
13
15
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
@@ -27,7 +29,7 @@ function DecidedSteps(t0) {
27
29
  let t2;
28
30
  if ($[2] !== t1) {
29
31
  t2 = /*#__PURE__*/_jsx("ol", {
30
- className: "flex flex-col gap-1 pl-6.5 text-sm text-muted-foreground",
32
+ className: "flex flex-col gap-1 pt-2 text-sm text-muted-foreground",
31
33
  children: t1
32
34
  });
33
35
  $[2] = t1;
@@ -41,7 +43,7 @@ function _temp(step, position) {
41
43
  return /*#__PURE__*/_jsxs("li", {
42
44
  className: "flex gap-3",
43
45
  children: [/*#__PURE__*/_jsx("span", {
44
- className: "w-4 shrink-0 font-mono text-xs leading-5 tabular-nums",
46
+ className: "w-4 shrink-0 text-xs leading-5 text-faint tabular-nums",
45
47
  children: position + 1
46
48
  }), /*#__PURE__*/_jsx("span", {
47
49
  className: "min-w-0",
@@ -50,7 +52,7 @@ function _temp(step, position) {
50
52
  }, step.id);
51
53
  }
52
54
  export function PlanReview(t0) {
53
- const $ = _c(41);
55
+ const $ = _c(36);
54
56
  const {
55
57
  steps: initialSteps,
56
58
  title: t1,
@@ -70,6 +72,7 @@ export function PlanReview(t0) {
70
72
  const [announcement, setAnnouncement] = useState("");
71
73
  const [pendingFocus, setPendingFocus] = useState(null);
72
74
  const approveRef = useFocusOnMount(autoFocus && !decision);
75
+ const settleRef = useFocusWhenSettled(!decision);
73
76
  let t4;
74
77
  if ($[0] !== steps) {
75
78
  t4 = steps.some(_temp2);
@@ -100,7 +103,7 @@ export function PlanReview(t0) {
100
103
  if ($[5] !== idPrefix || $[6] !== steps) {
101
104
  t7 = function handleAction(stepId, position, action) {
102
105
  const next = applyStepAction(steps, stepId, action);
103
- const focus = focusAfterAction(next, stepId, action);
106
+ const focus = focusAfterAction(next, stepId, action, position);
104
107
  setSteps(next);
105
108
  setAnnouncement(describeStepAction(position, action));
106
109
  setPendingFocus(focus ? {
@@ -127,58 +130,35 @@ export function PlanReview(t0) {
127
130
  t8 = $[8];
128
131
  }
129
132
  const renameStep = t8;
130
- const t9 = decision ? true : undefined;
131
- let t10;
132
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
133
- t10 = /*#__PURE__*/_jsx(ListChecksIcon, {
134
- "aria-hidden": true
135
- });
136
- $[9] = t10;
137
- } else {
138
- t10 = $[9];
139
- }
140
- const t11 = decision ? decision.approved ? "Approved" : "Cancelled" : "Waiting for you";
141
- const t12 = decision ? decision.approved ? "done" : "danger" : "waiting";
142
- let t13;
143
- if ($[10] !== steps.length) {
144
- t13 = pluralize(steps.length, "step");
145
- $[10] = steps.length;
146
- $[11] = t13;
133
+ let t9;
134
+ if ($[9] !== steps.length) {
135
+ t9 = pluralize(steps.length, "step");
136
+ $[9] = steps.length;
137
+ $[10] = t9;
147
138
  } else {
148
- t13 = $[11];
139
+ t9 = $[10];
149
140
  }
150
- let t14;
151
- if ($[12] !== t11 || $[13] !== t12 || $[14] !== t13) {
152
- t14 = /*#__PURE__*/_jsx(PanelHeader, {
153
- icon: t10,
154
- eyebrow: "Plan",
155
- status: t11,
156
- tone: t12,
157
- aside: t13
158
- });
141
+ const stepCount = t9;
142
+ const t10 = decision ? true : undefined;
143
+ const t11 = !decision && "gap-3";
144
+ let t12;
145
+ if ($[11] !== className || $[12] !== t11) {
146
+ t12 = cn("flex min-w-0 flex-col outline-none", t11, className);
147
+ $[11] = className;
159
148
  $[12] = t11;
160
149
  $[13] = t12;
161
- $[14] = t13;
162
- $[15] = t14;
163
150
  } else {
164
- t14 = $[15];
151
+ t12 = $[13];
165
152
  }
166
- const t15 = decision ? "text-muted-foreground" : undefined;
167
- let t16;
168
- if ($[16] !== t15 || $[17] !== title) {
169
- t16 = /*#__PURE__*/_jsx(PanelTitle, {
170
- className: t15,
171
- children: title
172
- });
173
- $[16] = t15;
174
- $[17] = title;
175
- $[18] = t16;
176
- } else {
177
- t16 = $[18];
178
- }
179
- let t17;
180
- if ($[19] !== actionLabel || $[20] !== approveRef || $[21] !== decision || $[22] !== description || $[23] !== handleAction || $[24] !== hasBlankTitle || $[25] !== idPrefix || $[26] !== initialSteps || $[27] !== onApprove || $[28] !== onCancel || $[29] !== steps) {
181
- t17 = decision ? /*#__PURE__*/_jsxs(PanelBody, {
153
+ let t13;
154
+ if ($[14] !== actionLabel || $[15] !== approveRef || $[16] !== decision || $[17] !== description || $[18] !== handleAction || $[19] !== hasBlankTitle || $[20] !== idPrefix || $[21] !== initialSteps || $[22] !== onApprove || $[23] !== onCancel || $[24] !== stepCount || $[25] !== steps) {
155
+ t13 = decision ? /*#__PURE__*/_jsxs(SettledLine, {
156
+ name: pluralize(initialSteps.length, "step"),
157
+ verb: "Planned",
158
+ icon: /*#__PURE__*/_jsx(ListChecksIcon, {
159
+ weight: "bold",
160
+ "aria-hidden": true
161
+ }),
182
162
  children: [/*#__PURE__*/_jsx(DecisionSummary, {
183
163
  decision: decision,
184
164
  deniedVerb: "Cancelled",
@@ -187,98 +167,99 @@ export function PlanReview(t0) {
187
167
  steps: initialSteps
188
168
  })]
189
169
  }) : /*#__PURE__*/_jsxs(_Fragment, {
190
- children: [/*#__PURE__*/_jsx("p", {
191
- className: "px-5 pt-1 text-sm text-muted-foreground",
192
- children: description
193
- }), /*#__PURE__*/_jsx(PanelBody, {
194
- className: "pb-0",
195
- children: /*#__PURE__*/_jsx("ol", {
196
- className: "-mx-5 flex flex-col divide-y border-t",
197
- children: steps.map((step_0, position_0) => /*#__PURE__*/_jsx(PlanStepRow, {
198
- idPrefix: idPrefix,
199
- step: step_0,
200
- position: position_0,
201
- count: steps.length,
202
- onRename: nextTitle_0 => renameStep(step_0.id, nextTitle_0),
203
- onAction: action_0 => handleAction(step_0.id, position_0, action_0)
204
- }, step_0.id))
170
+ children: [/*#__PURE__*/_jsx(ApprovalHeadline, {
171
+ name: stepCount,
172
+ action: "to run",
173
+ icon: /*#__PURE__*/_jsx(ListChecksIcon, {
174
+ weight: "bold",
175
+ "aria-hidden": true
205
176
  })
206
- }), /*#__PURE__*/_jsxs(PanelFooter, {
207
- className: "justify-between",
208
- children: [hasBlankTitle ? /*#__PURE__*/_jsx("span", {
177
+ }), /*#__PURE__*/_jsx("p", {
178
+ className: "-mt-2 text-sm text-faint",
179
+ children: description
180
+ }), /*#__PURE__*/_jsx("ol", {
181
+ className: "flex flex-col",
182
+ children: steps.map((step_0, position_0) => /*#__PURE__*/_jsx(PlanStepRow, {
183
+ idPrefix: idPrefix,
184
+ step: step_0,
185
+ position: position_0,
186
+ count: steps.length,
187
+ onRename: nextTitle_0 => renameStep(step_0.id, nextTitle_0),
188
+ onAction: action_0 => handleAction(step_0.id, position_0, action_0)
189
+ }, step_0.id))
190
+ }), /*#__PURE__*/_jsxs("div", {
191
+ className: "flex flex-wrap items-center gap-2 pt-1",
192
+ children: [/*#__PURE__*/_jsxs(Button, {
193
+ ref: approveRef,
194
+ type: "button",
195
+ size: "sm",
196
+ disabled: hasBlankTitle || steps.length === 0,
197
+ onClick: () => onApprove(steps.map(_temp3)),
198
+ children: [actionLabel ?? `Run ${stepCount}`, /*#__PURE__*/_jsx(ArrowRightIcon, {
199
+ weight: "bold",
200
+ "aria-hidden": true
201
+ })]
202
+ }), /*#__PURE__*/_jsx(Button, {
203
+ type: "button",
204
+ size: "sm",
205
+ variant: "ghost",
206
+ onClick: onCancel,
207
+ children: "Cancel"
208
+ }), hasBlankTitle && /*#__PURE__*/_jsx("span", {
209
209
  className: "text-xs text-destructive",
210
210
  children: "Every step needs a title."
211
- }) : /*#__PURE__*/_jsx("span", {
212
- className: "hidden font-mono text-[11px] text-muted-foreground sm:inline",
213
- children: "The run starts when you approve"
214
- }), /*#__PURE__*/_jsxs("span", {
215
- className: "ml-auto flex gap-2",
216
- children: [/*#__PURE__*/_jsx(Button, {
217
- type: "button",
218
- size: "sm",
219
- variant: "ghost",
220
- onClick: onCancel,
221
- children: "Cancel"
222
- }), /*#__PURE__*/_jsxs(Button, {
223
- ref: approveRef,
224
- type: "button",
225
- size: "sm",
226
- disabled: hasBlankTitle || steps.length === 0,
227
- onClick: () => onApprove(steps.map(_temp3)),
228
- children: [actionLabel ?? `Run ${pluralize(steps.length, "step")}`, /*#__PURE__*/_jsx(ArrowRightIcon, {
229
- "aria-hidden": true
230
- })]
231
- })]
232
211
  })]
233
212
  })]
234
213
  });
235
- $[19] = actionLabel;
236
- $[20] = approveRef;
237
- $[21] = decision;
238
- $[22] = description;
239
- $[23] = handleAction;
240
- $[24] = hasBlankTitle;
241
- $[25] = idPrefix;
242
- $[26] = initialSteps;
243
- $[27] = onApprove;
244
- $[28] = onCancel;
245
- $[29] = steps;
246
- $[30] = t17;
214
+ $[14] = actionLabel;
215
+ $[15] = approveRef;
216
+ $[16] = decision;
217
+ $[17] = description;
218
+ $[18] = handleAction;
219
+ $[19] = hasBlankTitle;
220
+ $[20] = idPrefix;
221
+ $[21] = initialSteps;
222
+ $[22] = onApprove;
223
+ $[23] = onCancel;
224
+ $[24] = stepCount;
225
+ $[25] = steps;
226
+ $[26] = t13;
247
227
  } else {
248
- t17 = $[30];
228
+ t13 = $[26];
249
229
  }
250
- const t18 = decision ? decision.approved ? "Plan approved" : "Plan cancelled" : announcement;
251
- let t19;
252
- if ($[31] !== t18) {
253
- t19 = /*#__PURE__*/_jsx(LiveStatus, {
254
- message: t18
230
+ const t14 = decision ? decision.approved ? "Plan approved" : "Plan cancelled" : announcement;
231
+ let t15;
232
+ if ($[27] !== t14) {
233
+ t15 = /*#__PURE__*/_jsx(LiveStatus, {
234
+ message: t14
255
235
  });
256
- $[31] = t18;
257
- $[32] = t19;
236
+ $[27] = t14;
237
+ $[28] = t15;
258
238
  } else {
259
- t19 = $[32];
239
+ t15 = $[28];
260
240
  }
261
- let t20;
262
- if ($[33] !== className || $[34] !== t14 || $[35] !== t16 || $[36] !== t17 || $[37] !== t19 || $[38] !== t9 || $[39] !== title) {
263
- t20 = /*#__PURE__*/_jsxs(ApprovalPanel, {
241
+ let t16;
242
+ if ($[29] !== settleRef || $[30] !== t10 || $[31] !== t12 || $[32] !== t13 || $[33] !== t15 || $[34] !== title) {
243
+ t16 = /*#__PURE__*/_jsxs("section", {
244
+ ref: settleRef,
245
+ tabIndex: -1,
264
246
  "data-slot": "plan-review",
265
- "data-decided": t9,
247
+ "data-decided": t10,
266
248
  "aria-label": title,
267
- className: className,
268
- children: [t14, t16, t17, t19]
249
+ className: t12,
250
+ children: [t13, t15]
269
251
  });
270
- $[33] = className;
271
- $[34] = t14;
252
+ $[29] = settleRef;
253
+ $[30] = t10;
254
+ $[31] = t12;
255
+ $[32] = t13;
256
+ $[33] = t15;
257
+ $[34] = title;
272
258
  $[35] = t16;
273
- $[36] = t17;
274
- $[37] = t19;
275
- $[38] = t9;
276
- $[39] = title;
277
- $[40] = t20;
278
259
  } else {
279
- t20 = $[40];
260
+ t16 = $[35];
280
261
  }
281
- return t20;
262
+ return t16;
282
263
  }
283
264
  function _temp3(step_1) {
284
265
  return {
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
 
3
3
  import { c as _c } from "react/compiler-runtime";
4
- import { ArrowDown as ArrowDownIcon, ArrowUp as ArrowUpIcon, Edit as PencilIcon, TrashCan as Trash2Icon } from "@carbon/icons-react";
5
4
  import { Button, cn } from "@locusgraph/components";
5
+ import { ArrowDown as ArrowDownIcon, ArrowUp as ArrowUpIcon, PencilSimple as PencilIcon, Trash as Trash2Icon } from "@phosphor-icons/react/ssr";
6
6
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
7
  export function stepControlId(idPrefix, stepId, action) {
8
8
  return `${idPrefix}-${stepId}-${action}`;
@@ -69,11 +69,11 @@ export function PlanStepRow(t0) {
69
69
  danger: true
70
70
  }];
71
71
  t3 = "plan-step";
72
- t4 = "group flex items-start gap-3 px-5 py-2.5 focus-within:bg-accent/50 hover:bg-accent/50 motion-safe:transition-colors";
72
+ t4 = "group flex items-start gap-3 py-1";
73
73
  if ($[17] !== number) {
74
74
  t5 = /*#__PURE__*/_jsx("span", {
75
75
  "aria-hidden": true,
76
- className: "mt-0.5 flex size-5 shrink-0 items-center justify-center font-mono text-[11px] text-muted-foreground tabular-nums ring-1 ring-input",
76
+ className: "flex h-control-xs w-5 shrink-0 items-center text-xs text-faint tabular-nums",
77
77
  children: number
78
78
  });
79
79
  $[17] = number;
@@ -93,7 +93,7 @@ export function PlanStepRow(t0) {
93
93
  const t10 = blank && "ring-1 ring-destructive/70";
94
94
  let t11;
95
95
  if ($[21] !== t10) {
96
- t11 = cn("-mx-1.5 h-6 min-w-0 bg-transparent px-1.5 text-sm font-medium outline-none placeholder:font-normal placeholder:text-muted-foreground focus-visible:bg-background focus-visible:ring-1 focus-visible:ring-ring", t10);
96
+ t11 = cn("-mx-1.5 h-control-xs min-w-0 bg-transparent px-1.5 text-sm text-foreground outline-none placeholder:text-faint hover:bg-muted/50 focus-visible:bg-muted focus-visible:ring-1 focus-visible:ring-ring", t10);
97
97
  $[21] = t10;
98
98
  $[22] = t11;
99
99
  } else {
@@ -102,7 +102,7 @@ export function PlanStepRow(t0) {
102
102
  let t12;
103
103
  if ($[23] !== step.detail) {
104
104
  t12 = step.detail && /*#__PURE__*/_jsx("p", {
105
- className: "text-xs text-muted-foreground",
105
+ className: "text-xs text-faint",
106
106
  children: step.detail
107
107
  });
108
108
  $[23] = step.detail;
@@ -195,8 +195,9 @@ function _temp(t0) {
195
195
  title: label,
196
196
  disabled: disabled,
197
197
  onClick: onClick,
198
- className: cn("text-muted-foreground hover:text-foreground", danger && "hover:text-destructive"),
198
+ className: cn("text-faint hover:bg-transparent hover:text-interactive", danger && "hover:text-destructive"),
199
199
  children: /*#__PURE__*/_jsx(Icon, {
200
+ weight: "bold",
200
201
  "aria-hidden": true
201
202
  })
202
203
  }, id);
@@ -1,7 +1,7 @@
1
1
  import type { PlanStepDraft } from "../types.js";
2
2
  import type { StepAction } from "./plan-step-row.js";
3
3
  export declare function applyStepAction(steps: PlanStepDraft[], stepId: string, action: StepAction): PlanStepDraft[];
4
- export declare function focusAfterAction(steps: PlanStepDraft[], stepId: string, action: StepAction): {
4
+ export declare function focusAfterAction(steps: PlanStepDraft[], stepId: string, action: StepAction, removedPosition?: number): {
5
5
  stepId: string;
6
6
  control: StepAction | "title";
7
7
  } | null;
@@ -9,7 +9,7 @@ export function applyStepAction(steps, stepId, action) {
9
9
  if (moved) reordered.splice(target, 0, moved);
10
10
  return reordered;
11
11
  }
12
- export function focusAfterAction(steps, stepId, action) {
12
+ export function focusAfterAction(steps, stepId, action, removedPosition = 0) {
13
13
  if (action !== "remove") {
14
14
  const index = steps.findIndex(step => step.id === stepId);
15
15
  const atEdge = action === "up" ? index === 0 : index === steps.length - 1;
@@ -18,7 +18,7 @@ export function focusAfterAction(steps, stepId, action) {
18
18
  control: atEdge ? "title" : action
19
19
  };
20
20
  }
21
- const neighbor = steps[0];
21
+ const neighbor = steps[Math.min(removedPosition, steps.length - 1)];
22
22
  return neighbor ? {
23
23
  stepId: neighbor.id,
24
24
  control: "title"
@@ -98,7 +98,7 @@ export function QuestionChoices(t0) {
98
98
  t6 = "radiogroup";
99
99
  t7 = label;
100
100
  t8 = "question-choices";
101
- t9 = "-mx-5 flex flex-col divide-y border-y";
101
+ t9 = "flex flex-col";
102
102
  t10 = options.map((option_1, index_0) => {
103
103
  const checked = option_1.id === selectedId;
104
104
  return /*#__PURE__*/_jsxs("button", {
@@ -112,19 +112,22 @@ export function QuestionChoices(t0) {
112
112
  "data-state": checked ? "checked" : "unchecked",
113
113
  onClick: () => onSelect(option_1.id),
114
114
  onKeyDown: event_0 => handleKeyDown(event_0, index_0),
115
- className: cn("group relative flex items-center gap-3 px-5 py-2.5 text-left text-sm outline-none motion-safe:transition-colors focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-inset", checked ? "bg-accent" : "hover:bg-accent/50"),
115
+ className: cn("group relative -mx-2 flex items-start gap-3 px-2 py-1.5 text-left text-sm locus-focus-ring motion-safe:transition-colors", checked ? "bg-muted" : "hover:bg-muted/50"),
116
116
  children: [/*#__PURE__*/_jsx("span", {
117
117
  "aria-hidden": true,
118
- className: cn("flex size-5 shrink-0 items-center justify-center font-mono text-[11px] ring-1", checked ? "bg-primary text-primary-foreground ring-primary" : "text-muted-foreground ring-input"),
118
+ className: cn("flex h-5 w-4 shrink-0 items-center text-xs tabular-nums", checked ? "font-medium text-interactive" : "text-faint"),
119
119
  children: index_0 + 1
120
120
  }), /*#__PURE__*/_jsxs("span", {
121
121
  className: "flex min-w-0 flex-1 flex-col",
122
122
  children: [/*#__PURE__*/_jsx("span", {
123
- className: "font-medium",
123
+ className: "font-medium text-foreground",
124
124
  children: option_1.label
125
- }), option_1.description && /*#__PURE__*/_jsx("span", {
126
- className: "text-xs text-muted-foreground",
127
- children: option_1.description
125
+ }), option_1.description && /*#__PURE__*/_jsxs("span", {
126
+ className: "text-xs text-faint",
127
+ children: [/*#__PURE__*/_jsx("span", {
128
+ className: "sr-only",
129
+ children: ", "
130
+ }), option_1.description]
128
131
  })]
129
132
  })]
130
133
  }, option_1.id);