@crewlethq/ui 0.148.0 → 0.150.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 (273) hide show
  1. package/dist/ActivityLine/index.js +3 -3
  2. package/dist/AgentHandoffPanel/index.js +8 -8
  3. package/dist/AppShell/index.js +5 -5
  4. package/dist/ArrangeFrame/index.js +3 -3
  5. package/dist/ArrangeList/index.js +5 -5
  6. package/dist/ArtifactBar/index.js +7 -7
  7. package/dist/ArtifactCard/index.js +6 -6
  8. package/dist/ArtifactPanel/index.js +4 -4
  9. package/dist/ArtifactRef/index.js +2 -2
  10. package/dist/AttentionList/index.js +4 -4
  11. package/dist/Avatar/index.js +1 -1
  12. package/dist/{Avatar-HD7YSWDV.css → Avatar-OUKBB6UF.css} +19 -5
  13. package/dist/AvatarPicker/index.js +8 -8
  14. package/dist/BriefCard/index.js +3 -3
  15. package/dist/Button/index.js +2 -2
  16. package/dist/Callout/index.js +3 -3
  17. package/dist/Canvas/index.js +4 -4
  18. package/dist/CanvasBoard/index.js +6 -6
  19. package/dist/CanvasToolbar/index.js +5 -5
  20. package/dist/ChangeMark/index.js +2 -2
  21. package/dist/ChatMessage/index.js +3 -3
  22. package/dist/ChatThread/index.js +4 -4
  23. package/dist/CheckGrid/index.js +5 -5
  24. package/dist/Checkbox/index.js +4 -4
  25. package/dist/Clamp/index.js +3 -3
  26. package/dist/CodeBlock/CodeBlock.d.ts +11 -1
  27. package/dist/CodeBlock/index.js +6 -6
  28. package/dist/CodeBlock/syntax.d.ts +23 -0
  29. package/dist/{CodeBlock-LS7H6KUQ.css → CodeBlock-GPNAG43I.css} +34 -0
  30. package/dist/ColorField/index.js +4 -4
  31. package/dist/ColorSwatch/index.js +6 -6
  32. package/dist/Combobox/index.js +4 -4
  33. package/dist/CommandPalette/index.js +6 -6
  34. package/dist/CommentThread/index.js +7 -7
  35. package/dist/Composer/index.js +4 -4
  36. package/dist/ConfirmField/index.js +4 -4
  37. package/dist/ConflictNote/index.js +3 -3
  38. package/dist/ContrastHelp/index.js +3 -3
  39. package/dist/Copyable/index.js +5 -5
  40. package/dist/DataGrid/index.js +7 -6
  41. package/dist/DataTable/index.js +8 -8
  42. package/dist/DataView/index.js +11 -11
  43. package/dist/DateTimePicker/index.js +4 -4
  44. package/dist/DeepWorkCard/index.js +4 -4
  45. package/dist/DeliveryReceipt/DeliveryReceipt.d.ts +69 -53
  46. package/dist/DeliveryReceipt/index.js +8 -1
  47. package/dist/DeliveryReceipt-GTES3RSG.css +90 -0
  48. package/dist/DocTabsEditor/index.js +6 -6
  49. package/dist/DownloadButton/index.js +3 -3
  50. package/dist/DurationField/DurationField.d.ts +59 -0
  51. package/dist/DurationField/index.d.ts +3 -0
  52. package/dist/DurationField/index.js +32 -0
  53. package/dist/DurationField-TJFIAUMW.css +23 -0
  54. package/dist/{Editor-PGDR7XMZ.js → Editor-FXREHINI.js} +5 -5
  55. package/dist/EmojiPicker/index.js +4 -4
  56. package/dist/EntityChip/index.js +1 -1
  57. package/dist/ErrorBoundary/index.js +3 -3
  58. package/dist/FactList/index.js +2 -2
  59. package/dist/FileDrop/index.js +3 -3
  60. package/dist/FilterPill/index.js +3 -3
  61. package/dist/FollowBanner/index.js +5 -5
  62. package/dist/Fullscreen/index.js +3 -3
  63. package/dist/GraphCanvas/index.js +6 -6
  64. package/dist/HuePicker/index.js +7 -7
  65. package/dist/IconButton/index.js +2 -2
  66. package/dist/ImageUpload/index.js +1 -1
  67. package/dist/InlineEditor/index.js +3 -3
  68. package/dist/InlineRef/index.js +1 -1
  69. package/dist/{InlineRef-LHU6MH4I.css → InlineRef-CUBTBIYD.css} +2 -1
  70. package/dist/Input/index.js +3 -3
  71. package/dist/KeyValueRows/index.js +5 -5
  72. package/dist/LinkInterstitial/index.js +6 -6
  73. package/dist/ListDetail/index.js +3 -3
  74. package/dist/ListInput/index.js +5 -5
  75. package/dist/LogoSlot/index.js +4 -4
  76. package/dist/MarkdownEditor/index.js +7 -7
  77. package/dist/MemberPicker/index.js +5 -5
  78. package/dist/Menu/index.js +4 -4
  79. package/dist/MergeConflicts/index.js +7 -7
  80. package/dist/MessageActions/index.js +5 -5
  81. package/dist/Modal/index.js +4 -4
  82. package/dist/NoticeList/index.js +3 -3
  83. package/dist/NumberField/NumberField.d.ts +56 -0
  84. package/dist/NumberField/index.d.ts +3 -0
  85. package/dist/NumberField/index.js +29 -0
  86. package/dist/NumberField-G7H4VNZP.css +30 -0
  87. package/dist/OpenInAppCard/index.js +4 -4
  88. package/dist/OrgLabel/index.js +1 -1
  89. package/dist/OrgNode/index.js +1 -1
  90. package/dist/OrgTable/index.js +10 -9
  91. package/dist/PeekRail/index.js +4 -4
  92. package/dist/PeopleRail/index.js +5 -5
  93. package/dist/PinTile/index.js +3 -3
  94. package/dist/PresenceStack/index.js +1 -1
  95. package/dist/PresenterView/index.js +5 -5
  96. package/dist/PresetChips/PresetChips.d.ts +27 -0
  97. package/dist/PresetChips/index.d.ts +2 -0
  98. package/dist/PresetChips/index.js +21 -0
  99. package/dist/Principal/index.js +1 -1
  100. package/dist/PrincipalPicker/index.js +6 -6
  101. package/dist/ProposalCard/index.js +8 -8
  102. package/dist/RailList/index.js +5 -5
  103. package/dist/ReactionBar/index.js +5 -5
  104. package/dist/ReceiptStrip/index.js +3 -3
  105. package/dist/ResultTableCard/index.js +4 -4
  106. package/dist/RichEditor/index.js +5 -5
  107. package/dist/SandboxedFrame/index.js +5 -5
  108. package/dist/SectionFrame/index.js +4 -4
  109. package/dist/SegmentedControl/index.js +6 -6
  110. package/dist/SelectionBar/index.js +3 -3
  111. package/dist/SendButton/index.js +3 -3
  112. package/dist/SettingForm/SettingForm.d.ts +50 -0
  113. package/dist/SettingForm/index.d.ts +3 -0
  114. package/dist/SettingForm/index.js +20 -0
  115. package/dist/SettingForm-ODVZZ7JZ.css +30 -0
  116. package/dist/SettingsTable/SettingsTable.d.ts +47 -34
  117. package/dist/SettingsTable/index.d.ts +3 -2
  118. package/dist/SettingsTable/index.js +7 -5
  119. package/dist/SettingsTable-KAMWVCQB.css +169 -0
  120. package/dist/ShareDialog/index.js +9 -9
  121. package/dist/SheetColumnEditor/index.js +11 -11
  122. package/dist/SheetGrid/index.js +7 -7
  123. package/dist/SidePanel/index.js +3 -3
  124. package/dist/SidebarNav/index.js +3 -3
  125. package/dist/SlideCompare/index.js +3 -3
  126. package/dist/SlideFilmstrip/index.js +5 -5
  127. package/dist/SlideNav/index.js +3 -3
  128. package/dist/StatusLine/index.js +2 -2
  129. package/dist/Switcher/index.js +6 -6
  130. package/dist/TableCells/index.js +1 -1
  131. package/dist/Tabs/index.js +5 -5
  132. package/dist/TagsInput/index.js +3 -3
  133. package/dist/ThemeSwitcher/index.js +7 -7
  134. package/dist/ThemeToggle/index.js +3 -3
  135. package/dist/ThreadSummary/index.js +2 -2
  136. package/dist/TimeRangePicker/index.js +10 -10
  137. package/dist/TimeWindowPicker/index.js +5 -5
  138. package/dist/Tooltip/Tooltip.d.ts +8 -1
  139. package/dist/Tooltip/index.js +1 -1
  140. package/dist/TreeCanvas/index.js +5 -5
  141. package/dist/TreeGrid/index.js +8 -7
  142. package/dist/ValueField/index.js +5 -5
  143. package/dist/VersionCompare/index.js +7 -7
  144. package/dist/VersionTimeline/index.js +4 -4
  145. package/dist/WorkingLine/index.js +2 -2
  146. package/dist/{chunk-CYRGASHY.js → chunk-27NS67UI.js} +2 -2
  147. package/dist/{chunk-2RJFKMTX.js → chunk-27ZF7D3C.js} +2 -2
  148. package/dist/chunk-2EPEVS2M.js +158 -0
  149. package/dist/{chunk-SPCNQUEU.js → chunk-2PSOUDCS.js} +1 -1
  150. package/dist/{chunk-IEM64WYC.js → chunk-2QPELDAA.js} +2 -2
  151. package/dist/{chunk-RG6XQJ74.js → chunk-2W2KAF7D.js} +1 -1
  152. package/dist/{chunk-CLEQII3E.js → chunk-3EL3IF3W.js} +1 -1
  153. package/dist/{chunk-2Z5SMA7Q.js → chunk-3OZPHFDT.js} +1 -1
  154. package/dist/{chunk-BXP6WDKR.js → chunk-3Q5USPLM.js} +2 -2
  155. package/dist/{chunk-YLOADTDS.js → chunk-3RLOH5AR.js} +1 -1
  156. package/dist/{chunk-IAER2ZMS.js → chunk-4DUK2TC4.js} +1 -1
  157. package/dist/{chunk-T7J2U3IN.js → chunk-4LNSURYZ.js} +1 -1
  158. package/dist/{chunk-WTRAMP4V.js → chunk-5ORAUELE.js} +3 -3
  159. package/dist/chunk-6QWSGM4W.js +21 -0
  160. package/dist/{chunk-VXSCGB2L.js → chunk-6RBE5RVG.js} +2 -2
  161. package/dist/{chunk-7UN7ICUE.js → chunk-733FZXNS.js} +2 -2
  162. package/dist/{chunk-UOVEN5RY.js → chunk-7C6NHVMX.js} +5 -5
  163. package/dist/{chunk-RIAEOKY7.js → chunk-7CVV3DQC.js} +1 -1
  164. package/dist/{chunk-RJZO5NQW.js → chunk-7FY7L6WD.js} +2 -2
  165. package/dist/{chunk-OU4P4E3U.js → chunk-7J2RIAZ4.js} +1 -1
  166. package/dist/{chunk-BPCXMQMB.js → chunk-7MAU74EI.js} +1 -1
  167. package/dist/{chunk-UJETUDIL.js → chunk-7PK2Z5JY.js} +2 -2
  168. package/dist/{chunk-SSRQLPGT.js → chunk-7SXCCVUR.js} +2 -2
  169. package/dist/{chunk-RMGAZEEX.js → chunk-7WXLPNZF.js} +1 -1
  170. package/dist/{chunk-MMJYDMGL.js → chunk-AH7R777J.js} +2 -2
  171. package/dist/{chunk-5L4ZSNGP.js → chunk-AU4EKD2G.js} +1 -1
  172. package/dist/{chunk-PDGXQBFS.js → chunk-BFZAGIXR.js} +3 -1
  173. package/dist/{chunk-QNN4OYLU.js → chunk-BJE7TPO6.js} +2 -2
  174. package/dist/chunk-BQMDD2FD.js +224 -0
  175. package/dist/{chunk-TYCICVST.js → chunk-BRMJPZC4.js} +1 -1
  176. package/dist/{chunk-EZG3SRSM.js → chunk-CA62YCFK.js} +1 -1
  177. package/dist/{chunk-JXLFC5BX.js → chunk-CC5NUAOF.js} +1 -1
  178. package/dist/{chunk-74B3HREV.js → chunk-CJGLMT44.js} +1 -1
  179. package/dist/{chunk-TCQIJ2VO.js → chunk-CRGYWLP6.js} +1 -1
  180. package/dist/{chunk-2UEMCSVB.js → chunk-CXJMWEZC.js} +1 -1
  181. package/dist/{chunk-HHCD55D3.js → chunk-D33K2BCZ.js} +1 -1
  182. package/dist/chunk-DDGHRDGV.js +134 -0
  183. package/dist/{chunk-SNKLBPXQ.js → chunk-DGB7R42F.js} +1 -1
  184. package/dist/{chunk-GYVL23ZK.js → chunk-DLYYW77C.js} +1 -1
  185. package/dist/{chunk-7VE7SOH6.js → chunk-E3JUS3CR.js} +1 -1
  186. package/dist/{chunk-X2R3GWCB.js → chunk-ECHQLOWI.js} +2 -2
  187. package/dist/{chunk-QA774VCH.js → chunk-ECYA6XZL.js} +1 -1
  188. package/dist/{chunk-QDVXEQJC.js → chunk-EDQHZOU3.js} +3 -3
  189. package/dist/{chunk-HLCQHRHJ.js → chunk-EO64FXVL.js} +1 -1
  190. package/dist/{chunk-BXGFDSC7.js → chunk-F6OYNO7O.js} +3 -3
  191. package/dist/{chunk-U62CXJPE.js → chunk-FCRJAFTU.js} +7 -7
  192. package/dist/{chunk-LO3CTXQI.js → chunk-FMKQSDBQ.js} +3 -3
  193. package/dist/{chunk-4DJONKYN.js → chunk-FYVV6GJN.js} +1 -1
  194. package/dist/{chunk-D7XI5DN5.js → chunk-GMXOZEF5.js} +1 -1
  195. package/dist/{chunk-3HY3KHMR.js → chunk-GR6XGA5V.js} +2 -2
  196. package/dist/{chunk-R4H352IB.js → chunk-HHTAGV5R.js} +1 -1
  197. package/dist/{chunk-EVOLZQTB.js → chunk-HIDOUXLD.js} +1 -1
  198. package/dist/{chunk-CMLRFHBD.js → chunk-HJ6ZY4UX.js} +2 -2
  199. package/dist/chunk-HU56GCZ7.js +198 -0
  200. package/dist/{chunk-F37ZBF4D.js → chunk-HYUO2RHC.js} +1 -1
  201. package/dist/{chunk-QGDQ5YDC.js → chunk-IMF3CPTY.js} +2 -2
  202. package/dist/{chunk-TRV7VZW6.js → chunk-IRGS5FEC.js} +1 -1
  203. package/dist/{chunk-P67SLIPX.js → chunk-IRLHICS4.js} +2 -2
  204. package/dist/{chunk-HDJMTHAP.js → chunk-IZH5DCOQ.js} +1 -1
  205. package/dist/{chunk-3ZJ6X3ZJ.js → chunk-JD5K6Y7Q.js} +3 -3
  206. package/dist/{chunk-7R77GFUO.js → chunk-JNDZGQGS.js} +2 -2
  207. package/dist/{chunk-DJAYXYDZ.js → chunk-KM5OKCW6.js} +2 -2
  208. package/dist/{chunk-NDZEN2ON.js → chunk-KQUENZR3.js} +1 -1
  209. package/dist/{chunk-PD3RJT3F.js → chunk-LDSLEEWR.js} +3 -3
  210. package/dist/{chunk-MCZJ2SD7.js → chunk-LZ3TKYAY.js} +2 -2
  211. package/dist/{chunk-LDVZYLA6.js → chunk-M2USLODI.js} +2 -2
  212. package/dist/{chunk-VGAZHT6S.js → chunk-M4VA76JF.js} +6 -6
  213. package/dist/{chunk-5Y3BFCGM.js → chunk-MUBJN75T.js} +5 -5
  214. package/dist/{chunk-5B5N4X5H.js → chunk-N3LAAA4R.js} +3 -3
  215. package/dist/{chunk-RVFSUF7V.js → chunk-N3R2POGO.js} +3 -3
  216. package/dist/chunk-NG6GEBSJ.js +53 -0
  217. package/dist/chunk-NZHWGKPW.js +334 -0
  218. package/dist/{chunk-XIJU47UT.js → chunk-O2J5PSWI.js} +2 -2
  219. package/dist/{chunk-R75TTEHL.js → chunk-OAD4AXYJ.js} +1 -1
  220. package/dist/{chunk-ZCA3JNQS.js → chunk-ODN3LSYW.js} +1 -1
  221. package/dist/{chunk-BKHS6YPM.js → chunk-OMVGWZ3V.js} +1 -1
  222. package/dist/chunk-OX332RI7.js +127 -0
  223. package/dist/{chunk-ETVXKUW7.js → chunk-PW6QXVIX.js} +3 -3
  224. package/dist/{chunk-N37AX25G.js → chunk-Q3SHCEXN.js} +7 -196
  225. package/dist/{chunk-PGLRFPYY.js → chunk-Q7RI66TT.js} +4 -4
  226. package/dist/{chunk-FYN2HXEB.js → chunk-QRUQOITJ.js} +1 -1
  227. package/dist/{chunk-XNTYJAHL.js → chunk-QULAFXL3.js} +1 -1
  228. package/dist/{chunk-QO76JNSB.js → chunk-R2RHSKAT.js} +3 -3
  229. package/dist/{chunk-V2K6EHJA.js → chunk-RNVPYDRQ.js} +1 -1
  230. package/dist/{chunk-QPAUKLNC.js → chunk-RUKSDKG5.js} +4 -3
  231. package/dist/{chunk-WGSIKYDE.js → chunk-RUNZWWN6.js} +5 -5
  232. package/dist/{chunk-QNG5MH7P.js → chunk-RXHY5T2Z.js} +2 -2
  233. package/dist/{chunk-Z3GOZ42N.js → chunk-S4ADDFRT.js} +3 -3
  234. package/dist/{chunk-EFTWYGN5.js → chunk-TBOVJ7RL.js} +1 -1
  235. package/dist/{chunk-ZPJX57QO.js → chunk-TPABM6DW.js} +2 -2
  236. package/dist/{chunk-ACXYNJZR.js → chunk-TSLXQVBC.js} +1 -1
  237. package/dist/{chunk-WK3OWTOD.js → chunk-TTUFOH2Y.js} +1 -1
  238. package/dist/{chunk-LHGDKWHV.js → chunk-U3ZUZ7VU.js} +3 -3
  239. package/dist/{chunk-X4QL7STV.js → chunk-UEO3A76N.js} +1 -1
  240. package/dist/{chunk-LILN66O3.js → chunk-V4CGY2CI.js} +1 -1
  241. package/dist/{chunk-PY3PKWAN.js → chunk-V67VL3WD.js} +1 -1
  242. package/dist/{chunk-JLWCONCZ.js → chunk-VARFEAUH.js} +5 -5
  243. package/dist/{chunk-OL42IZ6I.js → chunk-VFC7KVCW.js} +1 -1
  244. package/dist/{chunk-HTWN4IJJ.js → chunk-W2T7RGH7.js} +2 -2
  245. package/dist/{chunk-3FBJACLW.js → chunk-WAF36OFS.js} +5 -5
  246. package/dist/{chunk-EILMLMSG.js → chunk-WOHPQEBZ.js} +1 -1
  247. package/dist/{chunk-QWDTC2UI.js → chunk-WSKVFRKK.js} +1 -1
  248. package/dist/{chunk-TAOVSH32.js → chunk-X5ZUDJNK.js} +1 -1
  249. package/dist/{chunk-CNEHTSA5.js → chunk-XJU53WMW.js} +1 -1
  250. package/dist/{chunk-VGYVCLN4.js → chunk-XQMRSL7Z.js} +1 -1
  251. package/dist/{chunk-UC4YASMJ.js → chunk-YMBXTGFC.js} +2 -2
  252. package/dist/{chunk-VWEF6LTZ.js → chunk-YOCTDR2P.js} +1 -1
  253. package/dist/{chunk-H4OV6SYF.js → chunk-YRNIPS4M.js} +2 -2
  254. package/dist/{chunk-2BIGA4VD.js → chunk-YWPUT6JQ.js} +2 -2
  255. package/dist/{chunk-5DYNF5U2.js → chunk-Z6HWOPI7.js} +1 -1
  256. package/dist/{chunk-DQ3MKG7I.js → chunk-Z6OZNSHF.js} +1 -1
  257. package/dist/{chunk-PRNJO37A.js → chunk-Z7BA2EVV.js} +2 -2
  258. package/dist/{chunk-YKM3HCDL.js → chunk-ZAQ7CEYN.js} +2 -2
  259. package/dist/{chunk-WYO5KDET.js → chunk-ZC73GPA3.js} +1 -1
  260. package/dist/{chunk-SQHDMVU7.js → chunk-ZFSKRN6D.js} +1 -1
  261. package/dist/{chunk-4DKECHWE.js → chunk-ZMZNKDPO.js} +4 -4
  262. package/dist/{chunk-2FAEKL36.js → chunk-ZNEMXLTY.js} +1 -1
  263. package/dist/generated/index.d.ts +4 -0
  264. package/dist/generated/index.js +153 -148
  265. package/dist/index.js +153 -148
  266. package/dist/styles.css +286 -132
  267. package/package.json +3 -3
  268. package/dist/DeliveryReceipt-BILVVNTO.css +0 -64
  269. package/dist/SettingsTable-MTZJTKA6.css +0 -182
  270. package/dist/chunk-GTNXDLYH.js +0 -146
  271. package/dist/chunk-L6E4DVIF.js +0 -131
  272. package/dist/chunk-TNYRJVKE.js +0 -94
  273. /package/dist/{chunk-II7TPQ64.js → chunk-2DASEYUG.js} +0 -0
@@ -0,0 +1,334 @@
1
+ import { CopyButton, copyGlyph, CopyStatus } from './chunk-IRGS5FEC.js';
2
+ import { useClipboard } from './chunk-STJ7QBC3.js';
3
+ import { IconButton } from './chunk-KM5OKCW6.js';
4
+ import { cx } from './chunk-ODEQTPFM.js';
5
+ import './CodeBlock-GPNAG43I.css';
6
+ import { forwardRef, useRef, useState, useLayoutEffect, useMemo } from 'react';
7
+ import { jsxs, jsx } from 'react/jsx-runtime';
8
+
9
+ // src/CodeBlock/syntax.ts
10
+ var CODE_BLOCK_GRAMMARS = ["json", "yaml", "yml"];
11
+ var CODE_BLOCK_HIGHLIGHT_LIMIT = 256 * 1024;
12
+ function grammarOf(language) {
13
+ const name = language?.trim().toLowerCase();
14
+ return CODE_BLOCK_GRAMMARS.includes(name ?? "") ? name : null;
15
+ }
16
+ var Runs = class {
17
+ list = [];
18
+ push(kind, text) {
19
+ if (text === "") return;
20
+ const last = this.list[this.list.length - 1];
21
+ if (last && last.kind === kind) last.text += text;
22
+ else this.list.push({ kind, text });
23
+ }
24
+ };
25
+ var JSON_NUMBER = /-?\d+(?:\.\d+)?(?:[eE][-+]?\d+)?/y;
26
+ var WORD = /[A-Za-z_$][\w$]*/y;
27
+ function quoted(line, start, quote, escapes) {
28
+ let i = start + 1;
29
+ while (i < line.length) {
30
+ const ch = line[i];
31
+ if (escapes && ch === "\\") i += 2;
32
+ else if (ch === quote) {
33
+ if (!escapes && line[i + 1] === quote) i += 2;
34
+ else return i + 1;
35
+ } else i += 1;
36
+ }
37
+ return line.length;
38
+ }
39
+ function sticky(pattern, line, at) {
40
+ pattern.lastIndex = at;
41
+ return pattern.test(line) ? pattern.lastIndex : at;
42
+ }
43
+ function jsonLine(line, out) {
44
+ let i = 0;
45
+ while (i < line.length) {
46
+ const ch = line[i];
47
+ if (ch === " " || ch === " " || ch === "\r") {
48
+ let end = i + 1;
49
+ while (end < line.length && /[ \t\r]/.test(line[end])) end += 1;
50
+ out.push(null, line.slice(i, end));
51
+ i = end;
52
+ } else if (ch === '"') {
53
+ const end = quoted(line, i, '"', true);
54
+ let after = end;
55
+ while (after < line.length && (line[after] === " " || line[after] === " ")) after += 1;
56
+ out.push(line[after] === ":" ? "key" : "string", line.slice(i, end));
57
+ i = end;
58
+ } else if ("{}[]:,".includes(ch)) {
59
+ out.push("punctuation", ch);
60
+ i += 1;
61
+ } else if (ch === "-" || ch >= "0" && ch <= "9") {
62
+ const end = sticky(JSON_NUMBER, line, i);
63
+ out.push(end > i ? "number" : null, line.slice(i, Math.max(end, i + 1)));
64
+ i = Math.max(end, i + 1);
65
+ } else {
66
+ const end = sticky(WORD, line, i);
67
+ if (end > i) {
68
+ const word = line.slice(i, end);
69
+ out.push(word === "true" || word === "false" ? "boolean" : word === "null" ? "null" : null, word);
70
+ i = end;
71
+ } else {
72
+ out.push(null, ch);
73
+ i += 1;
74
+ }
75
+ }
76
+ }
77
+ }
78
+ var YAML_NUMBER = /^[-+]?(?:\d[\d_]*(?:\.\d*)?(?:[eE][-+]?\d+)?|\.\d+(?:[eE][-+]?\d+)?|0x[\da-fA-F]+|0o[0-7]+|\.(?:inf|Inf|INF)|\.(?:nan|NaN|NAN))$/;
79
+ var YAML_BOOLEAN = /^(?:true|True|TRUE|false|False|FALSE)$/;
80
+ var YAML_NULL = /^(?:null|Null|NULL|~)$/;
81
+ var BLOCK_HEADER = /^[|>][-+]?\d?[-+]?\s*(?:#.*)?$/;
82
+ function scalarKind(text) {
83
+ if (YAML_BOOLEAN.test(text)) return "boolean";
84
+ if (YAML_NULL.test(text)) return "null";
85
+ if (YAML_NUMBER.test(text)) return "number";
86
+ return "string";
87
+ }
88
+ function plainEnd(line, start, flow) {
89
+ let i = start;
90
+ while (i < line.length) {
91
+ const ch = line[i];
92
+ if (ch === ":" && (i + 1 === line.length || /[\s,\]}]/.test(line[i + 1]))) return i;
93
+ if (ch === "#" && i > start && /\s/.test(line[i - 1])) return i;
94
+ if (flow && ",[]{}".includes(ch)) return i;
95
+ i += 1;
96
+ }
97
+ return i;
98
+ }
99
+ function pushScalar(out, text, kind) {
100
+ const trimmed = text.replace(/\s+$/, "");
101
+ out.push(kind ?? scalarKind(trimmed), trimmed);
102
+ out.push(null, text.slice(trimmed.length));
103
+ }
104
+ function yamlLine(line, out) {
105
+ const indent = /^[ \t]*/.exec(line)[0].length;
106
+ out.push(null, line.slice(0, indent));
107
+ let i = indent;
108
+ if (/^(?:---|\.\.\.)(?:\s|$)/.test(line.slice(i))) {
109
+ out.push("punctuation", line.slice(i, i + 3));
110
+ i += 3;
111
+ }
112
+ let depth = 0;
113
+ let block = null;
114
+ let expectKey = true;
115
+ while (i < line.length) {
116
+ const ch = line[i];
117
+ const rest = line.slice(i);
118
+ if (ch === " " || ch === " " || ch === "\r") {
119
+ const end = i + /^[ \t\r]+/.exec(rest)[0].length;
120
+ out.push(null, line.slice(i, end));
121
+ i = end;
122
+ } else if (ch === "#") {
123
+ out.push("comment", rest);
124
+ i = line.length;
125
+ } else if (ch === "-" && depth === 0 && (i + 1 === line.length || /\s/.test(line[i + 1]))) {
126
+ out.push("punctuation", "-");
127
+ i += 1;
128
+ expectKey = true;
129
+ } else if ("[]{},".includes(ch)) {
130
+ depth += ch === "[" || ch === "{" ? 1 : ch === "]" || ch === "}" ? -1 : 0;
131
+ depth = Math.max(depth, 0);
132
+ out.push("punctuation", ch);
133
+ i += 1;
134
+ expectKey = ch !== "]" && ch !== "}";
135
+ } else if (ch === ":" && (i + 1 === line.length || /\s/.test(line[i + 1]))) {
136
+ out.push("punctuation", ":");
137
+ i += 1;
138
+ expectKey = false;
139
+ } else if (depth === 0 && !expectKey && BLOCK_HEADER.test(rest)) {
140
+ const header = /^[|>][-+]?\d?[-+]?/.exec(rest)[0];
141
+ out.push("punctuation", header);
142
+ i += header.length;
143
+ block = indent;
144
+ } else if (ch === '"' || ch === "'") {
145
+ const end = quoted(line, i, ch, ch === '"');
146
+ let after = end;
147
+ while (after < line.length && (line[after] === " " || line[after] === " ")) after += 1;
148
+ const isKey = line[after] === ":" && (after + 1 === line.length || /\s/.test(line[after + 1]));
149
+ out.push(isKey ? "key" : "string", line.slice(i, end));
150
+ i = end;
151
+ } else {
152
+ const end = Math.max(plainEnd(line, i, depth > 0), i + 1);
153
+ const text = line.slice(i, end);
154
+ const isKey = line[end] === ":" && expectKey;
155
+ if (isKey) pushScalar(out, text, "key");
156
+ else pushScalar(out, text);
157
+ i = end;
158
+ }
159
+ }
160
+ return block;
161
+ }
162
+ function yaml(code, out) {
163
+ const lines = code.split("\n");
164
+ let block = null;
165
+ lines.forEach((line, index) => {
166
+ if (block !== null) {
167
+ const indent = /^[ \t]*/.exec(line)[0].length;
168
+ if (line.trim() === "" || indent > block) {
169
+ out.push(null, line.slice(0, Math.min(indent, line.length)));
170
+ out.push("string", line.slice(indent));
171
+ if (index < lines.length - 1) out.push(null, "\n");
172
+ return;
173
+ }
174
+ block = null;
175
+ }
176
+ block = yamlLine(line, out);
177
+ if (index < lines.length - 1) out.push(null, "\n");
178
+ });
179
+ }
180
+ function tokenizeCode(code, language) {
181
+ const grammar = grammarOf(language);
182
+ if (grammar === null || code.length > CODE_BLOCK_HIGHLIGHT_LIMIT) return null;
183
+ const out = new Runs();
184
+ if (grammar === "json") {
185
+ const lines = code.split("\n");
186
+ lines.forEach((line, index) => {
187
+ jsonLine(line, out);
188
+ if (index < lines.length - 1) out.push(null, "\n");
189
+ });
190
+ } else yaml(code, out);
191
+ return out.list;
192
+ }
193
+ function tokenLines(tokens) {
194
+ const lines = [[]];
195
+ for (const token of tokens) {
196
+ const parts = token.text.split("\n");
197
+ parts.forEach((part, index) => {
198
+ if (index > 0) lines.push([]);
199
+ if (part !== "") lines[lines.length - 1].push({ kind: token.kind, text: part });
200
+ });
201
+ }
202
+ return lines;
203
+ }
204
+ var CodeBlock = forwardRef(function CodeBlock2({
205
+ code,
206
+ language,
207
+ highlight = true,
208
+ filename,
209
+ showLineNumbers = false,
210
+ copyable = true,
211
+ copyLabel,
212
+ copyPlacement = "header",
213
+ prompt,
214
+ wrap = true,
215
+ maxHeight,
216
+ plain = false,
217
+ selectable = false,
218
+ focusWhenScrollable = false,
219
+ label,
220
+ className,
221
+ style,
222
+ ...rest
223
+ }, ref) {
224
+ const box = useRef(null);
225
+ const body = code.replace(/\n+$/, "");
226
+ const corner = !plain && copyable && copyPlacement === "corner";
227
+ const showHeader = !plain && !corner && (filename !== void 0 || language !== void 0 || copyable);
228
+ const perLine = showLineNumbers || prompt !== void 0;
229
+ const [overflows, setOverflows] = useState(false);
230
+ useLayoutEffect(() => {
231
+ if (!focusWhenScrollable) return;
232
+ const node = box.current;
233
+ if (!node) return;
234
+ const measure = () => setOverflows(node.scrollHeight > node.clientHeight || node.scrollWidth > node.clientWidth);
235
+ measure();
236
+ if (typeof ResizeObserver !== "function") return;
237
+ const watch = new ResizeObserver(measure);
238
+ watch.observe(node);
239
+ return () => watch.disconnect();
240
+ }, [focusWhenScrollable, body, wrap, showLineNumbers, prompt, maxHeight]);
241
+ const focusable = selectable || focusWhenScrollable && overflows;
242
+ const onKeyDown = (event) => {
243
+ const isA = event.code === "KeyA" || !event.code && event.key.toLowerCase() === "a";
244
+ if (!isA || event.altKey || event.shiftKey || !(event.metaKey || event.ctrlKey)) return;
245
+ const node = box.current;
246
+ const selection = window.getSelection?.();
247
+ if (!node || !selection) return;
248
+ event.preventDefault();
249
+ selection.removeAllRanges();
250
+ const range = document.createRange();
251
+ range.selectNodeContents(node);
252
+ selection.addRange(range);
253
+ };
254
+ const tokens = useMemo(() => highlight ? tokenizeCode(body, language) : null, [highlight, body, language]);
255
+ let content = tokens ? drawTokens(tokens) : body;
256
+ let digits;
257
+ if (perLine) {
258
+ const lines = body.split("\n");
259
+ const coloured = tokens ? tokenLines(tokens) : null;
260
+ if (showLineNumbers) digits = String(lines.length).length;
261
+ content = lines.map((line, index) => /* @__PURE__ */ jsxs("span", { className: "crewlet-codeblock__line", children: [
262
+ showLineNumbers ? /* @__PURE__ */ jsx("span", { className: "crewlet-codeblock__ln", "aria-hidden": true, children: index + 1 }) : null,
263
+ prompt === void 0 ? null : /* @__PURE__ */ jsx("span", { className: "crewlet-codeblock__prompt", "aria-hidden": true, children: prompt }),
264
+ /* @__PURE__ */ jsx("span", { className: "crewlet-codeblock__linecontent", children: coloured ? drawTokens(coloured[index] ?? []) : line }),
265
+ index < lines.length - 1 ? "\n" : null
266
+ ] }, `${index}-${line}`));
267
+ }
268
+ return /* @__PURE__ */ jsxs(
269
+ "div",
270
+ {
271
+ ...rest,
272
+ ref,
273
+ className: cx(
274
+ "crewlet-codeblock",
275
+ showLineNumbers && "crewlet-codeblock--numbered",
276
+ !wrap && "crewlet-codeblock--nowrap",
277
+ corner && "crewlet-codeblock--corner",
278
+ maxHeight !== void 0 && "crewlet-codeblock--bounded",
279
+ className
280
+ ),
281
+ style: maxHeight === void 0 && digits === void 0 ? style : {
282
+ ...style,
283
+ ...maxHeight === void 0 ? null : { "--crewlet-codeblock-max-height": typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight },
284
+ ...digits === void 0 ? null : { "--crewlet-codeblock-digits": String(digits) }
285
+ },
286
+ children: [
287
+ showHeader ? /* @__PURE__ */ jsxs("div", { className: "crewlet-codeblock__header", children: [
288
+ /* @__PURE__ */ jsxs("span", { className: "crewlet-codeblock__meta", children: [
289
+ filename === void 0 ? null : /* @__PURE__ */ jsx("span", { className: "crewlet-codeblock__filename", children: filename }),
290
+ language !== void 0 && filename === void 0 ? /* @__PURE__ */ jsx("span", { className: "crewlet-codeblock__lang", children: language }) : null
291
+ ] }),
292
+ copyable ? /* @__PURE__ */ jsx(CopyButton, { text: code, label: copyLabel ?? "Copy", className: "crewlet-codeblock__copy" }) : null
293
+ ] }) : null,
294
+ corner ? /* @__PURE__ */ jsx(CornerCopy, { text: code, label: copyLabel ?? "Copy code" }) : null,
295
+ /* @__PURE__ */ jsx(
296
+ "pre",
297
+ {
298
+ ref: box,
299
+ className: "crewlet-codeblock__pre",
300
+ "data-language": language,
301
+ tabIndex: focusable ? 0 : void 0,
302
+ role: focusable ? "region" : void 0,
303
+ "aria-label": focusable ? label : void 0,
304
+ onKeyDown: selectable ? onKeyDown : void 0,
305
+ children: /* @__PURE__ */ jsx("code", { className: "crewlet-codeblock__code", children: content })
306
+ }
307
+ )
308
+ ]
309
+ }
310
+ );
311
+ });
312
+ function drawTokens(tokens) {
313
+ return tokens.map(
314
+ (token, index) => token.kind === null ? token.text : /* @__PURE__ */ jsx("span", { className: `crewlet-codeblock__tok crewlet-codeblock__tok--${token.kind}`, children: token.text }, index)
315
+ );
316
+ }
317
+ function CornerCopy({ text, label }) {
318
+ const { state, attempt, copy } = useClipboard();
319
+ const hint = state === "copied" ? "Copied" : state === "failed" ? "Copy failed" : label;
320
+ return /* @__PURE__ */ jsxs("span", { className: "crewlet-codeblock__corner", children: [
321
+ /* @__PURE__ */ jsx(IconButton, { label, size: "sm", variant: "ghost", icon: copyGlyph(state), tooltip: hint, onClick: () => void copy(text) }),
322
+ /* @__PURE__ */ jsx(
323
+ CopyStatus,
324
+ {
325
+ state,
326
+ attempt,
327
+ copiedMessage: "copied to the clipboard",
328
+ failedMessage: "the browser refused the clipboard"
329
+ }
330
+ )
331
+ ] });
332
+ }
333
+
334
+ export { CodeBlock };
@@ -1,10 +1,10 @@
1
- import { Modal } from './chunk-UJETUDIL.js';
1
+ import { Modal } from './chunk-7PK2Z5JY.js';
2
2
  import { useListbox, useOptionKeys } from './chunk-KW7T23RT.js';
3
3
  import { KeyChip, highlightMatch } from './chunk-HBDA76EZ.js';
4
4
  import { Popover } from './chunk-AJFA2XDQ.js';
5
5
  import { Skeleton } from './chunk-WFAJYBLX.js';
6
6
  import { Text } from './chunk-475DOAWF.js';
7
- import { Input } from './chunk-VGYVCLN4.js';
7
+ import { Input } from './chunk-XQMRSL7Z.js';
8
8
  import { useMediaMatch } from './chunk-COS6LJ4K.js';
9
9
  import { focusables, isComposing } from './chunk-EDPMHSLZ.js';
10
10
  import { returnFocus } from './chunk-4ITETIGZ.js';
@@ -1,4 +1,4 @@
1
- import { Button } from './chunk-QGDQ5YDC.js';
1
+ import { Button } from './chunk-IMF3CPTY.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
3
  import './ReceiptStrip-V7ASVZVV.css';
4
4
  import { CircleAlertGlyph, TriangleAlertGlyph, InfoGlyph, CircleCheckGlyph } from '@crewlethq/icons/glyphs';
@@ -1,5 +1,5 @@
1
1
  import { useThemePreference, useDensityPreference } from './chunk-Z24ZUSTX.js';
2
- import { SegmentedControl } from './chunk-D7XI5DN5.js';
2
+ import { SegmentedControl } from './chunk-GMXOZEF5.js';
3
3
  import { SunGlyph, MonitorGlyph, MoonGlyph } from '@crewlethq/icons/glyphs';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { diffLines, diffStat, collapseDiff, DiffSummary, DiffView } from './chunk-F4CM5KD3.js';
2
- import { SegmentedControl } from './chunk-D7XI5DN5.js';
2
+ import { SegmentedControl } from './chunk-GMXOZEF5.js';
3
3
  import { EmptyState } from './chunk-PPUR46MK.js';
4
4
  import { useHeadingLevel, headingTag, nextHeadingLevel, HeadingLevelProvider } from './chunk-PQADV6P6.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
@@ -0,0 +1,127 @@
1
+ import { Select } from './chunk-657WR3MX.js';
2
+ import { typedNumber, NumberField } from './chunk-DDGHRDGV.js';
3
+ import { PresetChips } from './chunk-6QWSGM4W.js';
4
+ import { cx } from './chunk-ODEQTPFM.js';
5
+ import './DurationField-TJFIAUMW.css';
6
+ import { useId } from 'react';
7
+ import { jsxs, jsx } from 'react/jsx-runtime';
8
+
9
+ var DURATION_UNIT_SECONDS = {
10
+ days: 86400,
11
+ hours: 3600,
12
+ minutes: 60,
13
+ seconds: 1
14
+ };
15
+ var UNITS_LARGEST_FIRST = ["days", "hours", "minutes", "seconds"];
16
+ var DURATION_FIELD_LABELS = {
17
+ units: {
18
+ seconds: ["second", "seconds"],
19
+ minutes: ["minute", "minutes"],
20
+ hours: ["hour", "hours"],
21
+ days: ["day", "days"]
22
+ },
23
+ unit: "Unit",
24
+ defaultPreset: (words) => `Default (${words})`,
25
+ presets: "Common durations",
26
+ decrease: "Decrease",
27
+ increase: "Increase"
28
+ };
29
+ function unitOf(seconds, units) {
30
+ const ordered = UNITS_LARGEST_FIRST.filter((u) => units.includes(u));
31
+ for (const unit of ordered) {
32
+ if (seconds !== 0 && seconds % DURATION_UNIT_SECONDS[unit] === 0) return unit;
33
+ }
34
+ return ordered[ordered.length - 1] ?? "seconds";
35
+ }
36
+ function durationValue(seconds, fallback = null, units = UNITS_LARGEST_FIRST) {
37
+ if (seconds === null) return { amount: "", unit: unitOf(fallback ?? 0, units) };
38
+ const unit = unitOf(seconds, units);
39
+ return { amount: String(seconds / DURATION_UNIT_SECONDS[unit]), unit };
40
+ }
41
+ function durationSeconds(value) {
42
+ if (value.amount.trim() === "") return null;
43
+ const n = typedNumber(value.amount);
44
+ return n === null ? Number.NaN : n * DURATION_UNIT_SECONDS[value.unit];
45
+ }
46
+ function durationWords(seconds, labels = DURATION_FIELD_LABELS) {
47
+ const { amount, unit } = durationValue(seconds);
48
+ const n = Number(amount);
49
+ const [one, many] = labels.units[unit];
50
+ return `${n.toLocaleString()} ${n === 1 ? one : many}`;
51
+ }
52
+ function DurationField({
53
+ id,
54
+ value,
55
+ onValueChange,
56
+ defaultValue,
57
+ min,
58
+ max,
59
+ units = UNITS_LARGEST_FIRST,
60
+ presets,
61
+ error,
62
+ disabled = false,
63
+ focusOnMount,
64
+ labels: overrides,
65
+ className,
66
+ ...aria
67
+ }) {
68
+ const labels = { ...DURATION_FIELD_LABELS, ...overrides };
69
+ const unitId = useId();
70
+ const size = DURATION_UNIT_SECONDS[value.unit];
71
+ const fallback = defaultValue === void 0 ? void 0 : defaultValue / size;
72
+ const seconds = durationSeconds(value);
73
+ const words = (s) => durationWords(s, labels);
74
+ const chosen = seconds === null ? "" : (presets ?? []).find((p) => p === seconds) !== void 0 ? String(seconds) : "#typed";
75
+ const chips = [
76
+ ...defaultValue === void 0 ? [] : [{ value: "", label: labels.defaultPreset(words(defaultValue)) }],
77
+ ...(presets ?? []).map((p) => ({ value: String(p), label: words(p) }))
78
+ ];
79
+ return /* @__PURE__ */ jsxs("div", { className: cx("crewlet-duration-field", className), children: [
80
+ /* @__PURE__ */ jsxs("div", { className: "crewlet-duration-field__row", children: [
81
+ /* @__PURE__ */ jsx(
82
+ NumberField,
83
+ {
84
+ id,
85
+ value: value.amount,
86
+ onValueChange: (amount) => onValueChange({ amount, unit: value.unit }),
87
+ defaultValue: fallback !== void 0 && Number.isInteger(fallback) ? fallback : void 0,
88
+ min: min === void 0 ? 0 : Math.ceil(min / size),
89
+ max: max === void 0 ? void 0 : Math.floor(max / size),
90
+ error,
91
+ disabled,
92
+ focusOnMount,
93
+ "aria-label": aria["aria-label"],
94
+ "aria-describedby": aria["aria-describedby"],
95
+ labels: { decrease: labels.decrease, increase: labels.increase },
96
+ className: "crewlet-duration-field__amount"
97
+ }
98
+ ),
99
+ /* @__PURE__ */ jsx(
100
+ Select,
101
+ {
102
+ id: unitId,
103
+ ariaLabel: labels.unit,
104
+ size: "md",
105
+ width: "auto",
106
+ disabled,
107
+ value: value.unit,
108
+ options: UNITS_LARGEST_FIRST.filter((u) => units.includes(u)).reverse().map((u) => ({ value: u, label: labels.units[u][1] })),
109
+ onChange: (next) => onValueChange({ amount: value.amount, unit: next }),
110
+ className: "crewlet-duration-field__unit"
111
+ }
112
+ )
113
+ ] }),
114
+ chips.length > 0 ? /* @__PURE__ */ jsx(
115
+ PresetChips,
116
+ {
117
+ label: labels.presets,
118
+ options: chips,
119
+ value: chosen,
120
+ disabled,
121
+ onPick: (picked) => onValueChange(picked === "" ? durationValue(null, defaultValue ?? null, units) : durationValue(Number(picked), null, units))
122
+ }
123
+ ) : null
124
+ ] });
125
+ }
126
+
127
+ export { DURATION_FIELD_LABELS, DURATION_UNIT_SECONDS, DurationField, durationSeconds, durationValue, durationWords };
@@ -1,9 +1,9 @@
1
1
  import { useReorder } from './chunk-JMBPMSNI.js';
2
- import { FormField, Textarea } from './chunk-VGYVCLN4.js';
2
+ import { FormField, Textarea } from './chunk-XQMRSL7Z.js';
3
3
  import { characterCountState, CharacterCount, countCharacters } from './chunk-TEXK4RK6.js';
4
4
  import { Kbd } from './chunk-VBBLHS2Y.js';
5
- import { Button } from './chunk-QGDQ5YDC.js';
6
- import { IconButton } from './chunk-DJAYXYDZ.js';
5
+ import { Button } from './chunk-IMF3CPTY.js';
6
+ import { IconButton } from './chunk-KM5OKCW6.js';
7
7
  import { isComposing } from './chunk-EDPMHSLZ.js';
8
8
  import { announce } from './chunk-WGMKERCR.js';
9
9
  import { cx } from './chunk-ODEQTPFM.js';