@crewlethq/ui 0.180.0 → 0.182.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 (125) hide show
  1. package/README.md +54 -2
  2. package/dist/AgentHandoffPanel/index.js +4 -4
  3. package/dist/AgentIdentity/index.js +11 -5
  4. package/dist/ArrangeFrame/index.js +2 -2
  5. package/dist/ArrangeList/index.js +4 -4
  6. package/dist/ArtifactCard/index.js +4 -4
  7. package/dist/AssignmentList/AssignmentList.d.ts +78 -0
  8. package/dist/AssignmentList/index.d.ts +3 -0
  9. package/dist/AssignmentList/index.js +8 -0
  10. package/dist/AssignmentList-3NZQFSYD.css +297 -0
  11. package/dist/ChangeList/ChangeGroups.d.ts +28 -0
  12. package/dist/ChangeList/ChangeList.d.ts +18 -1
  13. package/dist/ChangeList/index.d.ts +2 -0
  14. package/dist/ChangeList/index.js +11 -1
  15. package/dist/{ChangeList-R4UZBGU5.css → ChangeList-2VAPZDT3.css} +99 -0
  16. package/dist/CheckGrid/index.js +4 -4
  17. package/dist/Checkbox/index.js +3 -3
  18. package/dist/ChipField/index.js +2 -2
  19. package/dist/ColorField/index.js +3 -3
  20. package/dist/Combobox/index.js +3 -3
  21. package/dist/CommandPalette/index.js +16 -4
  22. package/dist/CommentThread/index.js +4 -4
  23. package/dist/Composer/index.js +3 -3
  24. package/dist/ConfirmField/index.js +3 -3
  25. package/dist/ConfirmModal-V2OAWUGJ.css +14 -0
  26. package/dist/ConsequenceList/ConsequenceList.d.ts +65 -0
  27. package/dist/ConsequenceList/index.d.ts +3 -0
  28. package/dist/ConsequenceList/index.js +23 -0
  29. package/dist/ConsequenceList-EEXTCT6J.css +74 -0
  30. package/dist/ContrastHelp/index.js +1 -1
  31. package/dist/DataGrid/index.js +4 -4
  32. package/dist/DataTable/index.js +17 -5
  33. package/dist/DataView/index.js +18 -7
  34. package/dist/DocTabsEditor/index.js +3 -3
  35. package/dist/DurationField/index.js +4 -4
  36. package/dist/{Editor-N3HLIXHX.js → Editor-HW7A54RA.js} +3 -3
  37. package/dist/EmojiPicker/index.js +3 -3
  38. package/dist/GraphCanvas/index.js +2 -2
  39. package/dist/InboxList/index.js +2 -2
  40. package/dist/Input/index.js +2 -2
  41. package/dist/KeyValueRows/index.js +3 -3
  42. package/dist/LinkInterstitial/index.js +20 -3
  43. package/dist/ListInput/index.js +3 -3
  44. package/dist/MemberPicker/index.js +4 -4
  45. package/dist/MessageActions/index.js +4 -4
  46. package/dist/Modal/ConfirmModal.d.ts +35 -2
  47. package/dist/Modal/index.d.ts +1 -0
  48. package/dist/Modal/index.js +20 -1
  49. package/dist/MoneyField/index.js +3 -3
  50. package/dist/NumberField/index.js +3 -3
  51. package/dist/OrgTable/index.js +6 -6
  52. package/dist/PrincipalPicker/index.js +4 -4
  53. package/dist/ProposalCard/index.js +8 -8
  54. package/dist/RailList/index.js +1 -1
  55. package/dist/ReactionBar/index.js +4 -4
  56. package/dist/RichEditor/index.js +1 -1
  57. package/dist/ScopeList/index.js +4 -4
  58. package/dist/SelectionBar/index.js +2 -2
  59. package/dist/SettingForm/index.js +3 -3
  60. package/dist/ShareDialog/index.js +20 -3
  61. package/dist/SheetColumnEditor/index.js +4 -4
  62. package/dist/SheetGrid/index.js +1 -1
  63. package/dist/SlideFilmstrip/index.js +1 -1
  64. package/dist/Switcher/index.js +17 -5
  65. package/dist/TagsInput/index.js +2 -2
  66. package/dist/TimeRangePicker/index.js +15 -4
  67. package/dist/TimeWindowPicker/index.js +3 -3
  68. package/dist/TreeGrid/index.js +5 -5
  69. package/dist/ValueField/index.js +4 -4
  70. package/dist/{chunk-HHQFTPHY.js → chunk-2EBAGM5E.js} +1 -1
  71. package/dist/{chunk-U32DZ6Q4.js → chunk-2XKPQBAX.js} +1 -1
  72. package/dist/{chunk-SKDMFJZD.js → chunk-3ZMDQUFO.js} +1 -1
  73. package/dist/{chunk-BIOS7CQN.js → chunk-5WPNDMMI.js} +1 -1
  74. package/dist/{chunk-65ACQRWE.js → chunk-6PXXUHIH.js} +2 -2
  75. package/dist/{chunk-5KUJWSPT.js → chunk-CVKCSJ5F.js} +1 -1
  76. package/dist/{chunk-SN2FN2XW.js → chunk-D54HL3AN.js} +103 -14
  77. package/dist/{chunk-BFYADGPT.js → chunk-DJXY65LN.js} +2 -2
  78. package/dist/{chunk-NC4CT5D3.js → chunk-DKXMP3LN.js} +1 -1
  79. package/dist/{chunk-5MRK6I7V.js → chunk-FF2YPFIZ.js} +1 -1
  80. package/dist/{chunk-VDJJSZ6N.js → chunk-G5W5ZLIL.js} +1 -1
  81. package/dist/{chunk-7PLFR7AF.js → chunk-G7YITKUF.js} +2 -2
  82. package/dist/{chunk-PZ6CR4F2.js → chunk-GJVLQXDA.js} +2 -2
  83. package/dist/{chunk-QXKPMRUG.js → chunk-GQAHG6NB.js} +2 -2
  84. package/dist/{chunk-TTN5QKIV.js → chunk-H36ZMY4G.js} +1 -1
  85. package/dist/{chunk-W6NSF6E2.js → chunk-H7L4ZEVN.js} +1 -1
  86. package/dist/{chunk-FC225TSK.js → chunk-HLIWHEXR.js} +33 -2
  87. package/dist/{chunk-KYW3GH2W.js → chunk-IUCQ5WOX.js} +1 -1
  88. package/dist/{chunk-NJCF4FUM.js → chunk-IZDILOZ5.js} +2 -2
  89. package/dist/{chunk-ZMY5F3SF.js → chunk-JLZ37UFI.js} +2 -2
  90. package/dist/{chunk-MQJQVEFQ.js → chunk-JZN5VTHT.js} +1 -1
  91. package/dist/{chunk-MVSR3KE6.js → chunk-KHELXOOP.js} +1 -1
  92. package/dist/{chunk-PL4YO2KU.js → chunk-KIPQWDPP.js} +2 -2
  93. package/dist/{chunk-L3QL5QLE.js → chunk-LBLHL5KZ.js} +1 -1
  94. package/dist/chunk-LNS3I6MG.js +68 -0
  95. package/dist/{chunk-CIFX64WT.js → chunk-NRE7D5JZ.js} +2 -2
  96. package/dist/{chunk-2SX6FP6K.js → chunk-NYIVZNML.js} +3 -3
  97. package/dist/{chunk-7YI6OCXI.js → chunk-P3UGTTUA.js} +1 -1
  98. package/dist/{chunk-YXOCR6QP.js → chunk-QFO375KV.js} +1 -1
  99. package/dist/{chunk-JMNVSA65.js → chunk-R4A2Y7HG.js} +2 -2
  100. package/dist/{chunk-RTVKQOK3.js → chunk-RMBPTHLK.js} +1 -1
  101. package/dist/{chunk-SYAK2KOB.js → chunk-RRMZ5ITI.js} +1 -1
  102. package/dist/{chunk-3LS2XHI5.js → chunk-SEBNQVEU.js} +1 -1
  103. package/dist/{chunk-QOEOXKV2.js → chunk-SFKAZSZE.js} +1 -1
  104. package/dist/{chunk-KLNQEBYF.js → chunk-TEAHPDQM.js} +1 -1
  105. package/dist/{chunk-5TNJEP2C.js → chunk-TEHDRA7W.js} +2 -2
  106. package/dist/{chunk-WP2MLABG.js → chunk-TICGBUBC.js} +1 -1
  107. package/dist/{chunk-PCS2ZEIM.js → chunk-UI37YHEJ.js} +4 -4
  108. package/dist/{chunk-7YAEM37E.js → chunk-UJSD6N7V.js} +1 -1
  109. package/dist/{chunk-DPEMGLRK.js → chunk-WG7GNCUQ.js} +1 -1
  110. package/dist/{chunk-SYL6JDZH.js → chunk-X6FJSY3C.js} +1 -1
  111. package/dist/chunk-XDTWKLEX.js +103 -0
  112. package/dist/{chunk-2OYZFXUY.js → chunk-ZZCUQWA2.js} +2 -2
  113. package/dist/generated/index.d.ts +2 -0
  114. package/dist/generated/index.js +108 -106
  115. package/dist/index.js +108 -106
  116. package/dist/styles.css +494 -1
  117. package/package.json +3 -3
  118. package/dist/{chunk-FA6ROZOF.js → chunk-3OZCJUFS.js} +1 -1
  119. package/dist/{chunk-L3RGZSNE.js → chunk-GF7VSU5G.js} +1 -1
  120. package/dist/{chunk-5643FBGN.js → chunk-KF7ZOWJW.js} +1 -1
  121. package/dist/{chunk-LVCYS5JG.js → chunk-KH4HKMXF.js} +1 -1
  122. package/dist/{chunk-ITFAH735.js → chunk-L4BKQVXX.js} +1 -1
  123. package/dist/{chunk-OD7LFCYV.js → chunk-UTPLRVXN.js} +1 -1
  124. package/dist/{chunk-4BTFE223.js → chunk-XIZI47NY.js} +1 -1
  125. /package/dist/{chunk-IMD3SCK7.js → chunk-YDDWUJ4O.js} +0 -0
@@ -1,10 +1,12 @@
1
1
  import { DiffList } from './chunk-7XUP32RY.js';
2
2
  import { Tag } from './chunk-HOIZJFYS.js';
3
+ import { titleWhenCut } from './chunk-WSIJDWUG.js';
3
4
  import { Disclosure } from './chunk-RUROK3EU.js';
5
+ import { Button } from './chunk-JYJ24UUX.js';
4
6
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
5
7
  import { cx } from './chunk-ODEQTPFM.js';
6
- import './ChangeList-R4UZBGU5.css';
7
- import { useId } from 'react';
8
+ import './ChangeList-2VAPZDT3.css';
9
+ import { useId, useState } from 'react';
8
10
  import { ArrowRightGlyph } from '@crewlethq/icons/glyphs';
9
11
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
10
12
 
@@ -17,7 +19,9 @@ var CHANGE_LIST_LABELS = {
17
19
  addedWords: "added:",
18
20
  removedWords: "removed:",
19
21
  betweenChanges: ";",
20
- showWhole: "Show the whole change"
22
+ showWhole: "Show the whole change",
23
+ more: (hidden) => `Show ${hidden} more`,
24
+ less: "Show fewer"
21
25
  };
22
26
  var CHANGE_LIST_COLLAPSE_OVER = 80;
23
27
  var ELLIPSIS = "\u2026";
@@ -130,33 +134,35 @@ function ChipValue({ row, labels }) {
130
134
  function Value({
131
135
  row,
132
136
  labels,
133
- inline
137
+ inline,
138
+ truncate
134
139
  }) {
135
140
  if (row.block) return /* @__PURE__ */ jsx(BlockValue, { row, labels });
136
141
  if (inline) return /* @__PURE__ */ jsx(ChipValue, { row, labels });
142
+ const cut = truncate ? titleWhenCut : void 0;
137
143
  switch (row.kind) {
138
144
  case "fact":
139
- return /* @__PURE__ */ jsx("span", { className: "crewlet-change-list__fact", children: row.value });
145
+ return /* @__PURE__ */ jsx("span", { className: "crewlet-change-list__fact", onMouseEnter: cut, children: row.value });
140
146
  case "changed":
141
147
  return /* @__PURE__ */ jsxs("span", { className: "crewlet-change-list__pair", children: [
142
148
  /* @__PURE__ */ jsx(VisuallyHidden, { children: `${labels.changedFrom} ` }),
143
- /* @__PURE__ */ jsx("del", { className: "crewlet-change-list__from", children: row.from }),
149
+ /* @__PURE__ */ jsx("del", { className: "crewlet-change-list__from", onMouseEnter: cut, children: row.from }),
144
150
  /* @__PURE__ */ jsxs("span", { className: "crewlet-change-list__next", children: [
145
151
  /* @__PURE__ */ jsx(ArrowRightGlyph, { size: "sm", className: "crewlet-change-list__arrow" }),
146
152
  /* @__PURE__ */ jsx(VisuallyHidden, { children: ` ${labels.to} ` }),
147
- /* @__PURE__ */ jsx("ins", { className: "crewlet-change-list__to", children: row.to })
153
+ /* @__PURE__ */ jsx("ins", { className: "crewlet-change-list__to", onMouseEnter: cut, children: row.to })
148
154
  ] })
149
155
  ] });
150
156
  case "added":
151
157
  return /* @__PURE__ */ jsxs("span", { className: "crewlet-change-list__pair", children: [
152
- /* @__PURE__ */ jsxs("ins", { className: "crewlet-change-list__to", children: [
158
+ /* @__PURE__ */ jsxs("ins", { className: "crewlet-change-list__to", onMouseEnter: cut, children: [
153
159
  /* @__PURE__ */ jsx(VisuallyHidden, { children: `${labels.added} ` }),
154
160
  row.to
155
161
  ] }),
156
162
  row.isNew ? /* @__PURE__ */ jsx(Tag, { size: "xs", variant: "success", children: labels.isNew }) : null
157
163
  ] });
158
164
  case "removed":
159
- return /* @__PURE__ */ jsxs("del", { className: "crewlet-change-list__removed", children: [
165
+ return /* @__PURE__ */ jsxs("del", { className: "crewlet-change-list__removed", onMouseEnter: cut, children: [
160
166
  /* @__PURE__ */ jsx(VisuallyHidden, { children: `${labels.removed} ` }),
161
167
  row.from
162
168
  ] });
@@ -165,6 +171,9 @@ function Value({
165
171
  function ChangeList({
166
172
  rows,
167
173
  heading,
174
+ subject,
175
+ truncate = false,
176
+ collapseAfter,
168
177
  layout = "grid",
169
178
  settled = false,
170
179
  labels: overrides,
@@ -173,6 +182,14 @@ function ChangeList({
173
182
  }) {
174
183
  const labels = overrides ? { ...CHANGE_LIST_LABELS, ...overrides } : CHANGE_LIST_LABELS;
175
184
  const headingId = useId();
185
+ const subjectId = `${headingId}-subject`;
186
+ const rowsId = `${headingId}-rows`;
187
+ const [expanded, setExpanded] = useState(false);
188
+ const hasHeading = heading !== void 0 && heading !== null;
189
+ const hasSubject = subject !== void 0 && subject !== null;
190
+ const folds = collapseAfter !== void 0 && rows.length > collapseAfter + 1;
191
+ const shown = folds && !expanded ? rows.slice(0, collapseAfter) : rows;
192
+ const named = cx(hasHeading && headingId, hasSubject && subjectId) || void 0;
176
193
  return /* @__PURE__ */ jsxs(
177
194
  "div",
178
195
  {
@@ -180,11 +197,13 @@ function ChangeList({
180
197
  "crewlet-change-list",
181
198
  layout === "inline" && "crewlet-change-list--inline",
182
199
  settled && "crewlet-change-list--settled",
200
+ truncate && "crewlet-change-list--truncate",
183
201
  className
184
202
  ),
185
203
  children: [
186
- heading === void 0 || heading === null ? null : /* @__PURE__ */ jsx("div", { id: headingId, className: "crewlet-change-list__heading", children: heading }),
187
- /* @__PURE__ */ jsx("dl", { className: "crewlet-change-list__rows", "aria-labelledby": heading === void 0 || heading === null ? void 0 : headingId, children: rows.map((row, index) => /* @__PURE__ */ jsxs(
204
+ hasHeading ? /* @__PURE__ */ jsx("div", { id: headingId, className: "crewlet-change-list__heading", children: heading }) : null,
205
+ hasSubject ? /* @__PURE__ */ jsx("div", { id: subjectId, className: "crewlet-change-list__subject", onMouseEnter: truncate ? titleWhenCut : void 0, children: subject }) : null,
206
+ /* @__PURE__ */ jsx("dl", { id: rowsId, className: "crewlet-change-list__rows", "aria-labelledby": named, children: shown.map((row, index) => /* @__PURE__ */ jsxs(
188
207
  "div",
189
208
  {
190
209
  className: cx(
@@ -198,16 +217,86 @@ function ChangeList({
198
217
  row.kind === "text" ? /* @__PURE__ */ jsxs(Fragment, { children: [
199
218
  /* @__PURE__ */ jsx(WordDiff, { row, labels }),
200
219
  row.whole && row.whole.length > 0 ? /* @__PURE__ */ jsx(Disclosure, { title: labels.showWhole, headingLevel: "none", size: "compact", className: "crewlet-change-list__whole", children: /* @__PURE__ */ jsx(DiffList, { rows: [...row.whole], layout: "auto", labels: diffLabels }) }) : null
201
- ] }) : /* @__PURE__ */ jsx(Value, { row, labels, inline: layout === "inline" }),
220
+ ] }) : /* @__PURE__ */ jsx(Value, { row, labels, inline: layout === "inline", truncate }),
202
221
  row.note === void 0 || row.note === null ? null : /* @__PURE__ */ jsx("span", { className: "crewlet-change-list__note", children: row.note })
203
222
  ] })
204
223
  ]
205
224
  },
206
225
  `${index}:${row.label}`
207
- )) })
226
+ )) }),
227
+ folds ? /* @__PURE__ */ jsx(
228
+ Button,
229
+ {
230
+ variant: "ghost",
231
+ size: "small",
232
+ flush: true,
233
+ className: "crewlet-change-list__more",
234
+ "aria-expanded": expanded,
235
+ "aria-controls": rowsId,
236
+ onClick: () => setExpanded((open) => !open),
237
+ children: expanded ? labels.less : labels.more(rows.length - collapseAfter)
238
+ }
239
+ ) : null
240
+ ]
241
+ }
242
+ );
243
+ }
244
+ var CHANGE_GROUPS_COLLAPSE_AFTER = 3;
245
+ function plain(group) {
246
+ return group.subjectText ?? (typeof group.subject === "string" ? group.subject : "");
247
+ }
248
+ function ChangeGroups({
249
+ groups,
250
+ heading,
251
+ collapseAfter = CHANGE_GROUPS_COLLAPSE_AFTER,
252
+ rowsCollapseAfter,
253
+ labels: overrides,
254
+ className
255
+ }) {
256
+ const labels = overrides ? { ...CHANGE_LIST_LABELS, ...overrides } : CHANGE_LIST_LABELS;
257
+ const id = useId();
258
+ const [expanded, setExpanded] = useState(false);
259
+ const folds = groups.length > collapseAfter + 1;
260
+ const shown = folds && !expanded ? groups.slice(0, collapseAfter) : groups;
261
+ const hiddenNames = folds ? groups.slice(collapseAfter).map(plain).filter((name) => name !== "").join(", ") : "";
262
+ const hasHeading = heading !== void 0 && heading !== null;
263
+ return /* @__PURE__ */ jsxs(
264
+ "div",
265
+ {
266
+ role: "group",
267
+ "aria-labelledby": hasHeading ? `${id}-heading` : void 0,
268
+ className: cx("crewlet-change-groups", className),
269
+ children: [
270
+ hasHeading ? /* @__PURE__ */ jsx("div", { id: `${id}-heading`, className: "crewlet-change-list__heading", children: heading }) : null,
271
+ /* @__PURE__ */ jsx("div", { id: `${id}-groups`, className: "crewlet-change-groups__list", children: shown.map((group) => /* @__PURE__ */ jsx(
272
+ ChangeList,
273
+ {
274
+ subject: group.subject,
275
+ rows: group.rows,
276
+ truncate: true,
277
+ collapseAfter: rowsCollapseAfter,
278
+ labels
279
+ },
280
+ group.key
281
+ )) }),
282
+ folds ? /* @__PURE__ */ jsxs("div", { className: "crewlet-change-groups__more", children: [
283
+ /* @__PURE__ */ jsx(
284
+ Button,
285
+ {
286
+ variant: "ghost",
287
+ size: "small",
288
+ flush: true,
289
+ "aria-expanded": expanded,
290
+ "aria-controls": `${id}-groups`,
291
+ onClick: () => setExpanded((open) => !open),
292
+ children: expanded ? labels.less : labels.more(groups.length - collapseAfter)
293
+ }
294
+ ),
295
+ expanded || hiddenNames === "" ? null : /* @__PURE__ */ jsx("span", { className: "crewlet-change-groups__hidden", onMouseEnter: titleWhenCut, children: hiddenNames })
296
+ ] }) : null
208
297
  ]
209
298
  }
210
299
  );
211
300
  }
212
301
 
213
- export { CHANGE_LIST_COLLAPSE_OVER, CHANGE_LIST_LABELS, ChangeList, ChangeListItems, shortenUnchanged };
302
+ export { CHANGE_GROUPS_COLLAPSE_AFTER, CHANGE_LIST_COLLAPSE_OVER, CHANGE_LIST_LABELS, ChangeGroups, ChangeList, ChangeListItems, shortenUnchanged };
@@ -1,7 +1,7 @@
1
1
  import { Select } from './chunk-D5UVJL4I.js';
2
- import { Combobox } from './chunk-W6NSF6E2.js';
2
+ import { Combobox } from './chunk-H7L4ZEVN.js';
3
3
  import { Button } from './chunk-JYJ24UUX.js';
4
- import { FormField, Textarea, InputAffix } from './chunk-LVCYS5JG.js';
4
+ import { FormField, Textarea, InputAffix } from './chunk-KH4HKMXF.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
6
6
  import './Input-YVCNNTYT.css';
7
7
  import './VisuallyHidden-OUYVMKEH.css';
@@ -1,4 +1,4 @@
1
- import { Checkbox } from './chunk-SYL6JDZH.js';
1
+ import { Checkbox } from './chunk-X6FJSY3C.js';
2
2
  import { IconButton } from './chunk-VM73Y6TO.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './MemberPicker-ZD35VEK6.css';
@@ -1,5 +1,5 @@
1
1
  import { useSendOnEnter, SendKeysHint } from './chunk-YUVQUJND.js';
2
- import { Textarea } from './chunk-LVCYS5JG.js';
2
+ import { Textarea } from './chunk-KH4HKMXF.js';
3
3
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
5
5
  import './ChatScale-LGESYXCO.css';
@@ -1,6 +1,6 @@
1
1
  import { Menu } from './chunk-QHPKLY4V.js';
2
2
  import { useReorder } from './chunk-JMBPMSNI.js';
3
- import { Input } from './chunk-LVCYS5JG.js';
3
+ import { Input } from './chunk-KH4HKMXF.js';
4
4
  import { IconButton } from './chunk-VM73Y6TO.js';
5
5
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
6
6
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,10 +1,10 @@
1
1
  import { useTreeState, treeExpandable, treeLevel, treePosInSet, treeSetSize, treeItemAction, treePrevious, treeNext, treeStep } from './chunk-MY374UUD.js';
2
- import { fitGridColumns } from './chunk-YXOCR6QP.js';
2
+ import { fitGridColumns } from './chunk-QFO375KV.js';
3
3
  import { GRID_FOOT_LABELS, parseGridSort, overrunning, squeezedCells, tableTrack, GRID_ICON_TRACK, GridHeadCell, alignOf, rowLinkTitle, headerWord, GridFoot, droppedNames, nextGridSort, sortByValue } from './chunk-QBLBUPHO.js';
4
4
  import { LayerNodeBridge } from './chunk-CUEPPDBC.js';
5
- import { Checkbox } from './chunk-SYL6JDZH.js';
6
5
  import { EmptyState } from './chunk-HG7J6I65.js';
7
6
  import { useMediaMatch } from './chunk-COS6LJ4K.js';
7
+ import { Checkbox } from './chunk-X6FJSY3C.js';
8
8
  import { IconButton } from './chunk-VM73Y6TO.js';
9
9
  import { LayerHost, LAYER_REPOSITION_EVENT } from './chunk-AVJKMQXK.js';
10
10
  import { focusables } from './chunk-EDPMHSLZ.js';
@@ -2,13 +2,13 @@ import { List, ListItem } from './chunk-GAQU5V5R.js';
2
2
  import { FileDrop, FilePickButton } from './chunk-J73XXTGG.js';
3
3
  import { StepList, Stepper } from './chunk-2MN3RNRM.js';
4
4
  import { Copyable } from './chunk-GKVQL352.js';
5
- import { Modal } from './chunk-FC225TSK.js';
5
+ import { Modal } from './chunk-HLIWHEXR.js';
6
6
  import { Callout } from './chunk-UJYSDWQ7.js';
7
7
  import { Tag } from './chunk-HOIZJFYS.js';
8
8
  import { Text } from './chunk-475DOAWF.js';
9
9
  import { Disclosure } from './chunk-RUROK3EU.js';
10
10
  import { Button, ButtonLink } from './chunk-JYJ24UUX.js';
11
- import { FormField, Input } from './chunk-LVCYS5JG.js';
11
+ import { FormField, Input } from './chunk-KH4HKMXF.js';
12
12
  import { cx } from './chunk-ODEQTPFM.js';
13
13
  import './AgentIdentity-KQWGKBNT.css';
14
14
  import './AgentIdentitySheet-D2T7ELGN.css';
@@ -1,9 +1,9 @@
1
1
  import { EmptyValue } from './chunk-WGLOH33S.js';
2
2
  import { useCardHeaderSlot } from './chunk-AV2DXAEL.js';
3
3
  import { Menu } from './chunk-QHPKLY4V.js';
4
- import { Checkbox } from './chunk-SYL6JDZH.js';
5
4
  import { useClipboard } from './chunk-STJ7QBC3.js';
6
- import { Modal } from './chunk-FC225TSK.js';
5
+ import { Modal } from './chunk-HLIWHEXR.js';
6
+ import { Checkbox } from './chunk-X6FJSY3C.js';
7
7
  import { Button } from './chunk-JYJ24UUX.js';
8
8
  import { IconButton } from './chunk-VM73Y6TO.js';
9
9
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
@@ -1,5 +1,5 @@
1
1
  import { Button } from './chunk-JYJ24UUX.js';
2
- import { FormField } from './chunk-LVCYS5JG.js';
2
+ import { FormField } from './chunk-KH4HKMXF.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './SettingForm-ODVZZ7JZ.css';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -1,6 +1,6 @@
1
1
  import { useListbox, useOptionKeys } from './chunk-KW7T23RT.js';
2
2
  import { HIT_AREA_CLASS } from './chunk-2YTOOH3A.js';
3
- import { Input } from './chunk-LVCYS5JG.js';
3
+ import { Input } from './chunk-KH4HKMXF.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
5
5
  import './HitArea-QUOS6ZDJ.css';
6
6
  import './Combobox-GHT43K32.css';
@@ -1,3 +1,5 @@
1
+ import { consequencesAnswered, ConsequenceList } from './chunk-LNS3I6MG.js';
2
+ import { ChangeGroups } from './chunk-D54HL3AN.js';
1
3
  import { Button } from './chunk-JYJ24UUX.js';
2
4
  import { IconButton } from './chunk-VM73Y6TO.js';
3
5
  import { useComposedRef } from './chunk-L72URIHR.js';
@@ -6,6 +8,7 @@ import { focusables, useModalLayer, useBodyScrollLock } from './chunk-EDPMHSLZ.j
6
8
  import { HeadingLevelProvider } from './chunk-PQADV6P6.js';
7
9
  import { cx } from './chunk-ODEQTPFM.js';
8
10
  import './Modal-TVHT3TEL.css';
11
+ import './ConfirmModal-V2OAWUGJ.css';
9
12
  import { useState, useLayoutEffect, useId, useRef, useCallback } from 'react';
10
13
  import { createPortal } from 'react-dom';
11
14
  import { ChevronLeftGlyph, XGlyph } from '@crewlethq/icons/glyphs';
@@ -287,6 +290,13 @@ function ConfirmModal({
287
290
  onConfirm,
288
291
  title,
289
292
  message,
293
+ moveTo,
294
+ changes,
295
+ changesHeading,
296
+ changesCollapseAfter,
297
+ consequences,
298
+ consequencesHeading,
299
+ alternative,
290
300
  children,
291
301
  confirmLabel = "Confirm",
292
302
  cancelLabel = "Cancel",
@@ -302,7 +312,9 @@ function ConfirmModal({
302
312
  }) {
303
313
  const messageId = `${useId()}-message`;
304
314
  const resolvedConfirm = confirmVariant ?? (destructive ? "danger" : "primary");
305
- const blocked = confirmDisabled || submitting;
315
+ const unanswered = !consequencesAnswered(consequences);
316
+ const held = confirmDisabled || unanswered;
317
+ const blocked = held || submitting;
306
318
  const submit = useCallback(() => {
307
319
  if (blocked) return;
308
320
  void (async () => {
@@ -326,6 +338,7 @@ function ConfirmModal({
326
338
  closeDisabledReason: busyReason,
327
339
  onSubmit: submit,
328
340
  stackBody: true,
341
+ footerStart: alternative ? /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: alternative.onSelect, disabledReason: submitting ? busyReason : void 0, children: alternative.label }) : void 0,
329
342
  footer: /* @__PURE__ */ jsxs(Fragment, { children: [
330
343
  /* @__PURE__ */ jsx(
331
344
  Button,
@@ -342,13 +355,31 @@ function ConfirmModal({
342
355
  type: "submit",
343
356
  variant: resolvedConfirm,
344
357
  loading: submitting,
345
- disabledReason: confirmDisabled ? confirmDisabledReason : void 0,
358
+ disabledReason: held ? confirmDisabledReason : void 0,
346
359
  children: confirmLabel
347
360
  }
348
361
  )
349
362
  ] }),
350
363
  children: [
351
364
  given(message) ? /* @__PURE__ */ jsx("p", { className: "crewlet-modal__message", id: messageId, children: message }) : null,
365
+ moveTo,
366
+ changes && changes.length > 0 ? /* @__PURE__ */ jsx(
367
+ ChangeGroups,
368
+ {
369
+ groups: changes,
370
+ heading: changesHeading,
371
+ collapseAfter: changesCollapseAfter,
372
+ className: "crewlet-confirm-modal__changes"
373
+ }
374
+ ) : null,
375
+ consequences && consequences.length > 0 ? /* @__PURE__ */ jsx(
376
+ ConsequenceList,
377
+ {
378
+ items: consequences,
379
+ heading: consequencesHeading,
380
+ className: "crewlet-confirm-modal__consequences"
381
+ }
382
+ ) : null,
352
383
  children
353
384
  ]
354
385
  }
@@ -1,5 +1,5 @@
1
1
  import { normalizeHex, parseColourInput } from './chunk-7W3LYIOC.js';
2
- import { FormField, Input, InputAffix } from './chunk-LVCYS5JG.js';
2
+ import { FormField, Input, InputAffix } from './chunk-KH4HKMXF.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './ColorField-2OIOWT3Z.css';
5
5
  import { useId, useState } from 'react';
@@ -1,8 +1,8 @@
1
1
  import { useListbox, useHighlightRest } from './chunk-KW7T23RT.js';
2
2
  import { Kbd } from './chunk-VBBLHS2Y.js';
3
3
  import { HIT_AREA_CLASS } from './chunk-2YTOOH3A.js';
4
- import { useScrollerFocus, Modal } from './chunk-FC225TSK.js';
5
- import { Input } from './chunk-LVCYS5JG.js';
4
+ import { useScrollerFocus, Modal } from './chunk-HLIWHEXR.js';
5
+ import { Input } from './chunk-KH4HKMXF.js';
6
6
  import { isComposing } from './chunk-EDPMHSLZ.js';
7
7
  import { Count } from './chunk-6YKTRAWI.js';
8
8
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
@@ -1,7 +1,7 @@
1
- import { Checkbox } from './chunk-SYL6JDZH.js';
2
1
  import { Text } from './chunk-475DOAWF.js';
2
+ import { Checkbox } from './chunk-X6FJSY3C.js';
3
3
  import { Button } from './chunk-JYJ24UUX.js';
4
- import { Input } from './chunk-LVCYS5JG.js';
4
+ import { Input } from './chunk-KH4HKMXF.js';
5
5
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
6
6
  import { cx } from './chunk-ODEQTPFM.js';
7
7
  import './ScopeList-564YHC7Z.css';
@@ -1,4 +1,4 @@
1
- import { emojiName } from './chunk-WP2MLABG.js';
1
+ import { emojiName } from './chunk-TICGBUBC.js';
2
2
  import { Toolbar } from './chunk-NPEI2QAN.js';
3
3
  import { IconButton } from './chunk-VM73Y6TO.js';
4
4
  import { heldHint } from './chunk-TDFLCUBE.js';
@@ -1,5 +1,5 @@
1
1
  import { Select } from './chunk-D5UVJL4I.js';
2
- import { typedNumber, NumberField } from './chunk-5KUJWSPT.js';
2
+ import { typedNumber, NumberField } from './chunk-CVKCSJ5F.js';
3
3
  import { PresetChips } from './chunk-UMQYZDYC.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
5
5
  import './DurationField-TJFIAUMW.css';
@@ -1,6 +1,6 @@
1
- import { InlineCode } from './chunk-W4UJWFCZ.js';
2
- import { ConfirmModal } from './chunk-FC225TSK.js';
1
+ import { ConfirmModal } from './chunk-HLIWHEXR.js';
3
2
  import { Callout } from './chunk-UJYSDWQ7.js';
3
+ import { InlineCode } from './chunk-W4UJWFCZ.js';
4
4
  import './LinkInterstitial-ET4MSVSV.css';
5
5
  import { jsx, jsxs } from 'react/jsx-runtime';
6
6
 
@@ -2,7 +2,7 @@ import { Select } from './chunk-D5UVJL4I.js';
2
2
  import { PrincipalAvatar } from './chunk-265IX4YA.js';
3
3
  import { useMediaMatch } from './chunk-COS6LJ4K.js';
4
4
  import { CopyButton } from './chunk-G5HHQ3RD.js';
5
- import { Modal } from './chunk-FC225TSK.js';
5
+ import { Modal } from './chunk-HLIWHEXR.js';
6
6
  import { Callout } from './chunk-UJYSDWQ7.js';
7
7
  import { Button } from './chunk-JYJ24UUX.js';
8
8
  import { IconButton } from './chunk-VM73Y6TO.js';
@@ -0,0 +1,68 @@
1
+ import { Eyebrow } from './chunk-RK4XPHVG.js';
2
+ import { InlineCode } from './chunk-W4UJWFCZ.js';
3
+ import { titleWhenCut } from './chunk-WSIJDWUG.js';
4
+ import { Checkbox } from './chunk-X6FJSY3C.js';
5
+ import { cx } from './chunk-ODEQTPFM.js';
6
+ import './ConsequenceList-EEXTCT6J.css';
7
+ import { useId } from 'react';
8
+ import { TriangleAlertGlyph, InfoGlyph, ArrowRightGlyph, LockGlyph } from '@crewlethq/icons/glyphs';
9
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
10
+
11
+ var FACT_GLYPHS = {
12
+ kept: LockGlyph,
13
+ follows: ArrowRightGlyph,
14
+ info: InfoGlyph,
15
+ warning: TriangleAlertGlyph,
16
+ danger: TriangleAlertGlyph
17
+ };
18
+ function ResourceName({ children, className }) {
19
+ return /* @__PURE__ */ jsx(InlineCode, { truncate: true, className: cx("crewlet-resource-name", className), onMouseEnter: titleWhenCut, children });
20
+ }
21
+ function ConsequenceList({ items, heading, divided = false, className }) {
22
+ const headingId = useId();
23
+ const named = heading !== void 0 && heading !== null;
24
+ return /* @__PURE__ */ jsxs(
25
+ "div",
26
+ {
27
+ role: "group",
28
+ "aria-labelledby": named ? headingId : void 0,
29
+ className: cx("crewlet-consequence-list", divided && "crewlet-consequence-list--divided", className),
30
+ children: [
31
+ named ? /* @__PURE__ */ jsx(Eyebrow, { as: "div", id: headingId, className: "crewlet-consequence-list__heading", children: heading }) : null,
32
+ items.map(
33
+ (item) => item.kind === "choice" ? /* @__PURE__ */ jsx(
34
+ Checkbox,
35
+ {
36
+ className: "crewlet-consequence-list__choice",
37
+ checked: item.checked,
38
+ onCheckedChange: item.onCheckedChange,
39
+ disabled: item.disabled,
40
+ tone: item.tone === "danger" ? "danger" : "default",
41
+ label: item.name === void 0 ? item.label : /* @__PURE__ */ jsxs(Fragment, { children: [
42
+ item.label,
43
+ " ",
44
+ /* @__PURE__ */ jsx(ResourceName, { children: item.name })
45
+ ] }),
46
+ description: item.description
47
+ },
48
+ item.key
49
+ ) : /* @__PURE__ */ jsx(Fact, { fact: item }, item.key)
50
+ )
51
+ ]
52
+ }
53
+ );
54
+ }
55
+ function Fact({ fact }) {
56
+ const tone = fact.tone ?? "plain";
57
+ const Glyph = tone === "plain" ? null : FACT_GLYPHS[tone];
58
+ const glyph = fact.icon ?? (Glyph ? /* @__PURE__ */ jsx(Glyph, { size: "sm" }) : null);
59
+ return /* @__PURE__ */ jsxs("p", { className: cx("crewlet-consequence-list__fact", `crewlet-consequence-list__fact--${tone}`), children: [
60
+ /* @__PURE__ */ jsx("span", { className: "crewlet-consequence-list__mark", "aria-hidden": "true", children: glyph }),
61
+ /* @__PURE__ */ jsx("span", { className: "crewlet-consequence-list__text", children: fact.text })
62
+ ] });
63
+ }
64
+ function consequencesAnswered(items) {
65
+ return (items ?? []).every((item) => item.kind !== "choice" || !item.required || item.checked);
66
+ }
67
+
68
+ export { ConsequenceList, ResourceName, consequencesAnswered };
@@ -1,11 +1,11 @@
1
1
  import { useReorder } from './chunk-JMBPMSNI.js';
2
2
  import { Kbd } from './chunk-VBBLHS2Y.js';
3
3
  import { Button } from './chunk-JYJ24UUX.js';
4
- import { FormField, Textarea } from './chunk-LVCYS5JG.js';
4
+ import { FormField, Textarea } from './chunk-KH4HKMXF.js';
5
5
  import { characterCountState, CharacterCount, countCharacters } from './chunk-TEXK4RK6.js';
6
+ import { announce } from './chunk-WGMKERCR.js';
6
7
  import { IconButton } from './chunk-VM73Y6TO.js';
7
8
  import { isComposing } from './chunk-EDPMHSLZ.js';
8
- import { announce } from './chunk-WGMKERCR.js';
9
9
  import { cx } from './chunk-ODEQTPFM.js';
10
10
  import './ListInput-L6XJUDTB.css';
11
11
  import { forwardRef, useState, useRef, useImperativeHandle, useLayoutEffect, useId } from 'react';
@@ -1,10 +1,10 @@
1
- import { ValueField } from './chunk-BFYADGPT.js';
1
+ import { ValueField } from './chunk-DJXY65LN.js';
2
2
  import { RefusalStrip, ReceiptStrip } from './chunk-UNYT6KEK.js';
3
- import { ChangeList } from './chunk-SN2FN2XW.js';
4
3
  import { StatusCard } from './chunk-SR5GHUP5.js';
5
4
  import { toInstant, currentNow, formatUntil, useNow, formatExact, toISO } from './chunk-GBKBME7Q.js';
6
- import { Checkbox } from './chunk-SYL6JDZH.js';
5
+ import { ChangeList } from './chunk-D54HL3AN.js';
7
6
  import { Callout } from './chunk-UJYSDWQ7.js';
7
+ import { Checkbox } from './chunk-X6FJSY3C.js';
8
8
  import { Disclosure } from './chunk-RUROK3EU.js';
9
9
  import { Button } from './chunk-JYJ24UUX.js';
10
10
  import { Spinner } from './chunk-XSPCITPN.js';
@@ -1,6 +1,6 @@
1
1
  import { Switch } from './chunk-6YYRFGXO.js';
2
2
  import { useReorder } from './chunk-JMBPMSNI.js';
3
- import { Checkbox } from './chunk-SYL6JDZH.js';
3
+ import { Checkbox } from './chunk-X6FJSY3C.js';
4
4
  import { IconButton } from './chunk-VM73Y6TO.js';
5
5
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
6
6
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,10 +1,10 @@
1
1
  import { GRID_FOOT_LABELS, GRID_ICON_TRACK, headerWord, sortByValue, parseGridSort, overrunning, tableTrack, GridHeadCell, GridFoot, droppedNames, nextGridSort, rowLinkTitle, squeezedCells, SHORT_COLUMN_PX, alignOf } from './chunk-QBLBUPHO.js';
2
2
  import { Skeleton } from './chunk-WFAJYBLX.js';
3
3
  import { useReorder } from './chunk-JMBPMSNI.js';
4
- import { Checkbox } from './chunk-SYL6JDZH.js';
5
4
  import { EmptyState } from './chunk-HG7J6I65.js';
6
5
  import { useMediaMatch } from './chunk-COS6LJ4K.js';
7
6
  import { titleWhenCut } from './chunk-WSIJDWUG.js';
7
+ import { Checkbox } from './chunk-X6FJSY3C.js';
8
8
  import { IconButton } from './chunk-VM73Y6TO.js';
9
9
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
10
10
  import { cx } from './chunk-ODEQTPFM.js';
@@ -3,10 +3,10 @@ import { SHEET_LABELS, SHEET_COLUMN_TYPES, optionHue, retypeColumn } from './chu
3
3
  import { HueSwatch } from './chunk-6JPM2FL7.js';
4
4
  import { NODE_HUES, NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
5
5
  import { Menu } from './chunk-QHPKLY4V.js';
6
- import { Checkbox } from './chunk-SYL6JDZH.js';
7
6
  import { Kbd } from './chunk-VBBLHS2Y.js';
7
+ import { Checkbox } from './chunk-X6FJSY3C.js';
8
8
  import { Button } from './chunk-JYJ24UUX.js';
9
- import { FormField, Input } from './chunk-LVCYS5JG.js';
9
+ import { FormField, Input } from './chunk-KH4HKMXF.js';
10
10
  import { IconButton } from './chunk-VM73Y6TO.js';
11
11
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
12
12
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,7 +1,7 @@
1
1
  import { PrincipalAvatar } from './chunk-265IX4YA.js';
2
2
  import { toInstant, RelativeTime, formatExact, toISO } from './chunk-GBKBME7Q.js';
3
3
  import { Document } from './chunk-I4PBFJGX.js';
4
- import { Composer } from './chunk-5MRK6I7V.js';
4
+ import { Composer } from './chunk-FF2YPFIZ.js';
5
5
  import { Button } from './chunk-JYJ24UUX.js';
6
6
  import { IconButton } from './chunk-VM73Y6TO.js';
7
7
  import { Count } from './chunk-6YKTRAWI.js';
@@ -1,5 +1,5 @@
1
1
  import { minorUnits, parseMoney } from './chunk-G6DKKJN6.js';
2
- import { Input } from './chunk-LVCYS5JG.js';
2
+ import { Input } from './chunk-KH4HKMXF.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './MoneyField-4PHZWHJL.css';
5
5
  import { forwardRef, useId } from 'react';
@@ -9,7 +9,7 @@ import { jsx } from 'react/jsx-runtime';
9
9
  var engine = null;
10
10
  var loading = null;
11
11
  function loadEngine() {
12
- loading ??= import('./Editor-N3HLIXHX.js').then(
12
+ loading ??= import('./Editor-HW7A54RA.js').then(
13
13
  (module) => {
14
14
  engine = module.Editor;
15
15
  return engine;
@@ -1,4 +1,4 @@
1
- import { emojiOfShortcode, emojiName, EmojiPicker } from './chunk-WP2MLABG.js';
1
+ import { emojiOfShortcode, emojiName, EmojiPicker } from './chunk-TICGBUBC.js';
2
2
  import { heldHint } from './chunk-TDFLCUBE.js';
3
3
  import { Tooltip } from './chunk-QB3VHZRB.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,6 +1,6 @@
1
1
  import { Timeline } from './chunk-XDUXAQIS.js';
2
2
  import { Section } from './chunk-WFCWPXJN.js';
3
- import { Composer } from './chunk-5MRK6I7V.js';
3
+ import { Composer } from './chunk-FF2YPFIZ.js';
4
4
  import { ArtifactPanel } from './chunk-MYAC6NMF.js';
5
5
  import { Disclosure } from './chunk-RUROK3EU.js';
6
6
  import { Button } from './chunk-JYJ24UUX.js';
@@ -1,7 +1,7 @@
1
1
  import { Button } from './chunk-JYJ24UUX.js';
2
- import { FormField, Label, Input } from './chunk-LVCYS5JG.js';
3
- import { IconButton } from './chunk-VM73Y6TO.js';
2
+ import { FormField, Label, Input } from './chunk-KH4HKMXF.js';
4
3
  import { announce } from './chunk-WGMKERCR.js';
4
+ import { IconButton } from './chunk-VM73Y6TO.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
6
6
  import './KeyValueRows-US5KW7JK.css';
7
7
  import { useId, useRef, useEffect } from 'react';