@agimon-ai/doompi-web-components 0.0.1-alpha.4 → 0.0.1-alpha.41

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 (503) hide show
  1. package/README.md +7 -7
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.d.mts +18 -6
  4. package/dist/index.mjs +1 -1
  5. package/dist/src/components/Accordion.cjs +1 -1
  6. package/dist/src/components/Accordion.cjs.map +1 -1
  7. package/dist/src/components/Accordion.d.mts +5 -5
  8. package/dist/src/components/Accordion.d.mts.map +1 -1
  9. package/dist/src/components/Accordion.mjs +1 -1
  10. package/dist/src/components/Accordion.mjs.map +1 -1
  11. package/dist/src/components/AnsiText.cjs +4 -0
  12. package/dist/src/components/AnsiText.cjs.map +1 -0
  13. package/dist/src/components/AnsiText.d.mts +16 -0
  14. package/dist/src/components/AnsiText.d.mts.map +1 -0
  15. package/dist/src/components/AnsiText.mjs +4 -0
  16. package/dist/src/components/AnsiText.mjs.map +1 -0
  17. package/dist/src/components/Avatar.cjs +1 -1
  18. package/dist/src/components/Avatar.cjs.map +1 -1
  19. package/dist/src/components/Avatar.d.mts +4 -4
  20. package/dist/src/components/Avatar.d.mts.map +1 -1
  21. package/dist/src/components/Avatar.mjs +1 -1
  22. package/dist/src/components/Avatar.mjs.map +1 -1
  23. package/dist/src/components/Badge.cjs +1 -1
  24. package/dist/src/components/Badge.cjs.map +1 -1
  25. package/dist/src/components/Badge.d.mts +5 -6
  26. package/dist/src/components/Badge.d.mts.map +1 -1
  27. package/dist/src/components/Badge.mjs +1 -1
  28. package/dist/src/components/Badge.mjs.map +1 -1
  29. package/dist/src/components/Breadcrumb.cjs +1 -1
  30. package/dist/src/components/Breadcrumb.cjs.map +1 -1
  31. package/dist/src/components/Breadcrumb.d.mts +4 -5
  32. package/dist/src/components/Breadcrumb.d.mts.map +1 -1
  33. package/dist/src/components/Breadcrumb.mjs +1 -1
  34. package/dist/src/components/Breadcrumb.mjs.map +1 -1
  35. package/dist/src/components/Button.cjs +1 -1
  36. package/dist/src/components/Button.cjs.map +1 -1
  37. package/dist/src/components/Button.d.mts +6 -7
  38. package/dist/src/components/Button.d.mts.map +1 -1
  39. package/dist/src/components/Button.mjs +1 -1
  40. package/dist/src/components/Button.mjs.map +1 -1
  41. package/dist/src/components/Checkbox.cjs +1 -1
  42. package/dist/src/components/Checkbox.cjs.map +1 -1
  43. package/dist/src/components/Checkbox.d.mts +1 -1
  44. package/dist/src/components/Checkbox.d.mts.map +1 -1
  45. package/dist/src/components/Checkbox.mjs +1 -1
  46. package/dist/src/components/Checkbox.mjs.map +1 -1
  47. package/dist/src/components/CodeBlock.cjs +2 -0
  48. package/dist/src/components/CodeBlock.cjs.map +1 -0
  49. package/dist/src/components/CodeBlock.mjs +2 -0
  50. package/dist/src/components/CodeBlock.mjs.map +1 -0
  51. package/dist/src/components/CodeEditor.cjs +1 -1
  52. package/dist/src/components/CodeEditor.cjs.map +1 -1
  53. package/dist/src/components/CodeEditor.d.mts +1 -2
  54. package/dist/src/components/CodeEditor.d.mts.map +1 -1
  55. package/dist/src/components/CodeEditor.mjs +1 -1
  56. package/dist/src/components/CodeEditor.mjs.map +1 -1
  57. package/dist/src/components/CodeEditorView.cjs +1 -1
  58. package/dist/src/components/CodeEditorView.cjs.map +1 -1
  59. package/dist/src/components/CodeEditorView.mjs +1 -1
  60. package/dist/src/components/CodeEditorView.mjs.map +1 -1
  61. package/dist/src/components/Collapsible.cjs +1 -1
  62. package/dist/src/components/Collapsible.cjs.map +1 -1
  63. package/dist/src/components/Collapsible.d.mts +4 -4
  64. package/dist/src/components/Collapsible.d.mts.map +1 -1
  65. package/dist/src/components/Collapsible.mjs +1 -1
  66. package/dist/src/components/Collapsible.mjs.map +1 -1
  67. package/dist/src/components/Command.cjs +1 -1
  68. package/dist/src/components/Command.cjs.map +1 -1
  69. package/dist/src/components/Command.d.mts +11 -12
  70. package/dist/src/components/Command.d.mts.map +1 -1
  71. package/dist/src/components/Command.mjs +1 -1
  72. package/dist/src/components/Command.mjs.map +1 -1
  73. package/dist/src/components/CopyButton.cjs +2 -0
  74. package/dist/src/components/CopyButton.cjs.map +1 -0
  75. package/dist/src/components/CopyButton.mjs +2 -0
  76. package/dist/src/components/CopyButton.mjs.map +1 -0
  77. package/dist/src/components/Dialog.cjs +1 -1
  78. package/dist/src/components/Dialog.cjs.map +1 -1
  79. package/dist/src/components/Dialog.d.mts +15 -15
  80. package/dist/src/components/Dialog.d.mts.map +1 -1
  81. package/dist/src/components/Dialog.mjs +1 -1
  82. package/dist/src/components/Dialog.mjs.map +1 -1
  83. package/dist/src/components/Dot.cjs +1 -1
  84. package/dist/src/components/Dot.cjs.map +1 -1
  85. package/dist/src/components/Dot.d.mts +5 -6
  86. package/dist/src/components/Dot.d.mts.map +1 -1
  87. package/dist/src/components/Dot.mjs +1 -1
  88. package/dist/src/components/Dot.mjs.map +1 -1
  89. package/dist/src/components/Drawer.cjs +2 -0
  90. package/dist/src/components/Drawer.cjs.map +1 -0
  91. package/dist/src/components/Drawer.d.mts +17 -0
  92. package/dist/src/components/Drawer.d.mts.map +1 -0
  93. package/dist/src/components/Drawer.mjs +2 -0
  94. package/dist/src/components/Drawer.mjs.map +1 -0
  95. package/dist/src/components/DropdownMenu.cjs +1 -1
  96. package/dist/src/components/DropdownMenu.cjs.map +1 -1
  97. package/dist/src/components/DropdownMenu.d.mts +20 -20
  98. package/dist/src/components/DropdownMenu.d.mts.map +1 -1
  99. package/dist/src/components/DropdownMenu.mjs +1 -1
  100. package/dist/src/components/DropdownMenu.mjs.map +1 -1
  101. package/dist/src/components/EmptyState.cjs +1 -1
  102. package/dist/src/components/EmptyState.cjs.map +1 -1
  103. package/dist/src/components/EmptyState.d.mts +2 -3
  104. package/dist/src/components/EmptyState.d.mts.map +1 -1
  105. package/dist/src/components/EmptyState.mjs +1 -1
  106. package/dist/src/components/EmptyState.mjs.map +1 -1
  107. package/dist/src/components/HashlineLines.cjs +2 -0
  108. package/dist/src/components/HashlineLines.cjs.map +1 -0
  109. package/dist/src/components/HashlineLines.d.mts +23 -0
  110. package/dist/src/components/HashlineLines.d.mts.map +1 -0
  111. package/dist/src/components/HashlineLines.mjs +2 -0
  112. package/dist/src/components/HashlineLines.mjs.map +1 -0
  113. package/dist/src/components/Input.cjs +1 -1
  114. package/dist/src/components/Input.cjs.map +1 -1
  115. package/dist/src/components/Input.d.mts +6 -7
  116. package/dist/src/components/Input.d.mts.map +1 -1
  117. package/dist/src/components/Input.mjs +1 -1
  118. package/dist/src/components/Input.mjs.map +1 -1
  119. package/dist/src/components/Kbd.cjs +1 -1
  120. package/dist/src/components/Kbd.cjs.map +1 -1
  121. package/dist/src/components/Kbd.d.mts +1 -2
  122. package/dist/src/components/Kbd.d.mts.map +1 -1
  123. package/dist/src/components/Kbd.mjs +1 -1
  124. package/dist/src/components/Kbd.mjs.map +1 -1
  125. package/dist/src/components/Label.cjs +1 -1
  126. package/dist/src/components/Label.cjs.map +1 -1
  127. package/dist/src/components/Label.d.mts +1 -1
  128. package/dist/src/components/Label.d.mts.map +1 -1
  129. package/dist/src/components/Label.mjs +1 -1
  130. package/dist/src/components/Label.mjs.map +1 -1
  131. package/dist/src/components/Markdown.cjs +2 -1
  132. package/dist/src/components/Markdown.cjs.map +1 -1
  133. package/dist/src/components/Markdown.d.mts +12 -3
  134. package/dist/src/components/Markdown.d.mts.map +1 -1
  135. package/dist/src/components/Markdown.mjs +2 -1
  136. package/dist/src/components/Markdown.mjs.map +1 -1
  137. package/dist/src/components/MediaPreview.cjs +1 -1
  138. package/dist/src/components/MediaPreview.cjs.map +1 -1
  139. package/dist/src/components/MediaPreview.d.mts +39 -3
  140. package/dist/src/components/MediaPreview.d.mts.map +1 -1
  141. package/dist/src/components/MediaPreview.mjs +1 -1
  142. package/dist/src/components/MediaPreview.mjs.map +1 -1
  143. package/dist/src/components/MermaidDiagram.cjs +2 -0
  144. package/dist/src/components/MermaidDiagram.cjs.map +1 -0
  145. package/dist/src/components/MermaidDiagram.mjs +2 -0
  146. package/dist/src/components/MermaidDiagram.mjs.map +1 -0
  147. package/dist/src/components/MessageItem.cjs +1 -1
  148. package/dist/src/components/MessageItem.cjs.map +1 -1
  149. package/dist/src/components/MessageItem.d.mts +48 -17
  150. package/dist/src/components/MessageItem.d.mts.map +1 -1
  151. package/dist/src/components/MessageItem.mjs +1 -1
  152. package/dist/src/components/MessageItem.mjs.map +1 -1
  153. package/dist/src/components/MessageLines.cjs +1 -1
  154. package/dist/src/components/MessageLines.cjs.map +1 -1
  155. package/dist/src/components/MessageLines.d.mts +5 -6
  156. package/dist/src/components/MessageLines.d.mts.map +1 -1
  157. package/dist/src/components/MessageLines.mjs +1 -1
  158. package/dist/src/components/MessageLines.mjs.map +1 -1
  159. package/dist/src/components/OptionList.cjs +1 -1
  160. package/dist/src/components/OptionList.cjs.map +1 -1
  161. package/dist/src/components/OptionList.d.mts +9 -10
  162. package/dist/src/components/OptionList.d.mts.map +1 -1
  163. package/dist/src/components/OptionList.mjs +1 -1
  164. package/dist/src/components/OptionList.mjs.map +1 -1
  165. package/dist/src/components/Panel.cjs +1 -1
  166. package/dist/src/components/Panel.cjs.map +1 -1
  167. package/dist/src/components/Panel.d.mts +4 -5
  168. package/dist/src/components/Panel.d.mts.map +1 -1
  169. package/dist/src/components/Panel.mjs +1 -1
  170. package/dist/src/components/Panel.mjs.map +1 -1
  171. package/dist/src/components/PdfPreview.cjs +2 -0
  172. package/dist/src/components/PdfPreview.cjs.map +1 -0
  173. package/dist/src/components/PdfPreview.d.mts +52 -0
  174. package/dist/src/components/PdfPreview.d.mts.map +1 -0
  175. package/dist/src/components/PdfPreview.mjs +2 -0
  176. package/dist/src/components/PdfPreview.mjs.map +1 -0
  177. package/dist/src/components/Popover.cjs +1 -1
  178. package/dist/src/components/Popover.cjs.map +1 -1
  179. package/dist/src/components/Popover.d.mts +8 -8
  180. package/dist/src/components/Popover.d.mts.map +1 -1
  181. package/dist/src/components/Popover.mjs +1 -1
  182. package/dist/src/components/Popover.mjs.map +1 -1
  183. package/dist/src/components/Progress.cjs +1 -1
  184. package/dist/src/components/Progress.cjs.map +1 -1
  185. package/dist/src/components/Progress.d.mts +1 -1
  186. package/dist/src/components/Progress.d.mts.map +1 -1
  187. package/dist/src/components/Progress.mjs +1 -1
  188. package/dist/src/components/Progress.mjs.map +1 -1
  189. package/dist/src/components/RadioGroup.cjs +1 -1
  190. package/dist/src/components/RadioGroup.cjs.map +1 -1
  191. package/dist/src/components/RadioGroup.d.mts +4 -4
  192. package/dist/src/components/RadioGroup.d.mts.map +1 -1
  193. package/dist/src/components/RadioGroup.mjs +1 -1
  194. package/dist/src/components/RadioGroup.mjs.map +1 -1
  195. package/dist/src/components/ScrollArea.cjs +1 -1
  196. package/dist/src/components/ScrollArea.cjs.map +1 -1
  197. package/dist/src/components/ScrollArea.d.mts +3 -3
  198. package/dist/src/components/ScrollArea.d.mts.map +1 -1
  199. package/dist/src/components/ScrollArea.mjs +1 -1
  200. package/dist/src/components/ScrollArea.mjs.map +1 -1
  201. package/dist/src/components/SectionLabel.cjs +1 -1
  202. package/dist/src/components/SectionLabel.cjs.map +1 -1
  203. package/dist/src/components/SectionLabel.d.mts +1 -2
  204. package/dist/src/components/SectionLabel.d.mts.map +1 -1
  205. package/dist/src/components/SectionLabel.mjs +1 -1
  206. package/dist/src/components/SectionLabel.mjs.map +1 -1
  207. package/dist/src/components/Select.cjs +1 -1
  208. package/dist/src/components/Select.cjs.map +1 -1
  209. package/dist/src/components/Select.d.mts +9 -9
  210. package/dist/src/components/Select.d.mts.map +1 -1
  211. package/dist/src/components/Select.mjs +1 -1
  212. package/dist/src/components/Select.mjs.map +1 -1
  213. package/dist/src/components/Separator.cjs +1 -1
  214. package/dist/src/components/Separator.cjs.map +1 -1
  215. package/dist/src/components/Separator.d.mts +1 -1
  216. package/dist/src/components/Separator.d.mts.map +1 -1
  217. package/dist/src/components/Separator.mjs +1 -1
  218. package/dist/src/components/Separator.mjs.map +1 -1
  219. package/dist/src/components/Sheet.cjs +2 -0
  220. package/dist/src/components/Sheet.cjs.map +1 -0
  221. package/dist/src/components/Sheet.d.mts +35 -0
  222. package/dist/src/components/Sheet.d.mts.map +1 -0
  223. package/dist/src/components/Sheet.mjs +2 -0
  224. package/dist/src/components/Sheet.mjs.map +1 -0
  225. package/dist/src/components/Skeleton.cjs +1 -1
  226. package/dist/src/components/Skeleton.cjs.map +1 -1
  227. package/dist/src/components/Skeleton.d.mts +1 -2
  228. package/dist/src/components/Skeleton.d.mts.map +1 -1
  229. package/dist/src/components/Skeleton.mjs +1 -1
  230. package/dist/src/components/Skeleton.mjs.map +1 -1
  231. package/dist/src/components/Spinner.cjs +1 -1
  232. package/dist/src/components/Spinner.cjs.map +1 -1
  233. package/dist/src/components/Spinner.d.mts +2 -3
  234. package/dist/src/components/Spinner.d.mts.map +1 -1
  235. package/dist/src/components/Spinner.mjs +1 -1
  236. package/dist/src/components/Spinner.mjs.map +1 -1
  237. package/dist/src/components/StatusBadge.cjs +1 -1
  238. package/dist/src/components/StatusBadge.cjs.map +1 -1
  239. package/dist/src/components/StatusBadge.d.mts +6 -7
  240. package/dist/src/components/StatusBadge.d.mts.map +1 -1
  241. package/dist/src/components/StatusBadge.mjs +1 -1
  242. package/dist/src/components/StatusBadge.mjs.map +1 -1
  243. package/dist/src/components/StreamCursor.cjs +1 -1
  244. package/dist/src/components/StreamCursor.cjs.map +1 -1
  245. package/dist/src/components/StreamCursor.d.mts +1 -2
  246. package/dist/src/components/StreamCursor.d.mts.map +1 -1
  247. package/dist/src/components/StreamCursor.mjs +1 -1
  248. package/dist/src/components/StreamCursor.mjs.map +1 -1
  249. package/dist/src/components/Switch.cjs +1 -1
  250. package/dist/src/components/Switch.cjs.map +1 -1
  251. package/dist/src/components/Switch.d.mts +1 -1
  252. package/dist/src/components/Switch.d.mts.map +1 -1
  253. package/dist/src/components/Switch.mjs +1 -1
  254. package/dist/src/components/Switch.mjs.map +1 -1
  255. package/dist/src/components/SyntaxText.cjs +4 -0
  256. package/dist/src/components/SyntaxText.cjs.map +1 -0
  257. package/dist/src/components/SyntaxText.d.mts +50 -0
  258. package/dist/src/components/SyntaxText.d.mts.map +1 -0
  259. package/dist/src/components/SyntaxText.mjs +4 -0
  260. package/dist/src/components/SyntaxText.mjs.map +1 -0
  261. package/dist/src/components/Tabs.cjs +1 -1
  262. package/dist/src/components/Tabs.cjs.map +1 -1
  263. package/dist/src/components/Tabs.d.mts +11 -11
  264. package/dist/src/components/Tabs.d.mts.map +1 -1
  265. package/dist/src/components/Tabs.mjs +1 -1
  266. package/dist/src/components/Tabs.mjs.map +1 -1
  267. package/dist/src/components/TerminalView.cjs +2 -0
  268. package/dist/src/components/TerminalView.cjs.map +1 -0
  269. package/dist/src/components/TerminalView.d.mts +31 -0
  270. package/dist/src/components/TerminalView.d.mts.map +1 -0
  271. package/dist/src/components/TerminalView.mjs +2 -0
  272. package/dist/src/components/TerminalView.mjs.map +1 -0
  273. package/dist/src/components/Textarea.cjs +1 -1
  274. package/dist/src/components/Textarea.cjs.map +1 -1
  275. package/dist/src/components/Textarea.d.mts +3 -4
  276. package/dist/src/components/Textarea.d.mts.map +1 -1
  277. package/dist/src/components/Textarea.mjs +1 -1
  278. package/dist/src/components/Textarea.mjs.map +1 -1
  279. package/dist/src/components/Toast.cjs +1 -1
  280. package/dist/src/components/Toast.cjs.map +1 -1
  281. package/dist/src/components/Toast.d.mts +11 -11
  282. package/dist/src/components/Toast.d.mts.map +1 -1
  283. package/dist/src/components/Toast.mjs +1 -1
  284. package/dist/src/components/Toast.mjs.map +1 -1
  285. package/dist/src/components/ToolPathLink.cjs +2 -0
  286. package/dist/src/components/ToolPathLink.cjs.map +1 -0
  287. package/dist/src/components/ToolPathLink.d.mts +22 -0
  288. package/dist/src/components/ToolPathLink.d.mts.map +1 -0
  289. package/dist/src/components/ToolPathLink.mjs +2 -0
  290. package/dist/src/components/ToolPathLink.mjs.map +1 -0
  291. package/dist/src/components/Tooltip.cjs +1 -1
  292. package/dist/src/components/Tooltip.cjs.map +1 -1
  293. package/dist/src/components/Tooltip.d.mts +5 -5
  294. package/dist/src/components/Tooltip.d.mts.map +1 -1
  295. package/dist/src/components/Tooltip.mjs +1 -1
  296. package/dist/src/components/Tooltip.mjs.map +1 -1
  297. package/dist/src/icons/icons.cjs +1 -1
  298. package/dist/src/icons/icons.d.mts +2 -2
  299. package/dist/src/icons/icons.mjs +1 -1
  300. package/dist/src/lib/ansiSpans.cjs +2 -0
  301. package/dist/src/lib/ansiSpans.cjs.map +1 -0
  302. package/dist/src/lib/ansiSpans.d.mts +42 -0
  303. package/dist/src/lib/ansiSpans.d.mts.map +1 -0
  304. package/dist/src/lib/ansiSpans.mjs +2 -0
  305. package/dist/src/lib/ansiSpans.mjs.map +1 -0
  306. package/dist/src/lib/cn.d.mts +1 -2
  307. package/dist/src/lib/cn.d.mts.map +1 -1
  308. package/dist/src/lib/collapse.d.mts +2 -3
  309. package/dist/src/lib/collapse.d.mts.map +1 -1
  310. package/dist/src/lib/editorController.cjs +2 -0
  311. package/dist/src/lib/editorController.cjs.map +1 -0
  312. package/dist/src/lib/editorController.mjs +2 -0
  313. package/dist/src/lib/editorController.mjs.map +1 -0
  314. package/dist/src/lib/editorLanguage.d.mts +2 -3
  315. package/dist/src/lib/editorLanguage.d.mts.map +1 -1
  316. package/dist/src/lib/editorTheme.cjs +1 -1
  317. package/dist/src/lib/editorTheme.cjs.map +1 -1
  318. package/dist/src/lib/editorTheme.d.mts +76 -0
  319. package/dist/src/lib/editorTheme.d.mts.map +1 -0
  320. package/dist/src/lib/editorTheme.mjs +1 -1
  321. package/dist/src/lib/editorTheme.mjs.map +1 -1
  322. package/dist/src/lib/fenceGrammar.cjs +2 -0
  323. package/dist/src/lib/fenceGrammar.cjs.map +1 -0
  324. package/dist/src/lib/fenceGrammar.mjs +2 -0
  325. package/dist/src/lib/fenceGrammar.mjs.map +1 -0
  326. package/dist/src/lib/hashlineHighlight.cjs +3 -0
  327. package/dist/src/lib/hashlineHighlight.cjs.map +1 -0
  328. package/dist/src/lib/hashlineHighlight.d.mts +30 -0
  329. package/dist/src/lib/hashlineHighlight.d.mts.map +1 -0
  330. package/dist/src/lib/hashlineHighlight.mjs +3 -0
  331. package/dist/src/lib/hashlineHighlight.mjs.map +1 -0
  332. package/dist/src/lib/hashlineView.cjs +6 -0
  333. package/dist/src/lib/hashlineView.cjs.map +1 -0
  334. package/dist/src/lib/hashlineView.d.mts +60 -0
  335. package/dist/src/lib/hashlineView.d.mts.map +1 -0
  336. package/dist/src/lib/hashlineView.mjs +6 -0
  337. package/dist/src/lib/hashlineView.mjs.map +1 -0
  338. package/dist/src/lib/media.cjs.map +1 -1
  339. package/dist/src/lib/media.d.mts +1 -2
  340. package/dist/src/lib/media.d.mts.map +1 -1
  341. package/dist/src/lib/media.mjs.map +1 -1
  342. package/dist/src/lib/mediaPlayback.cjs +2 -0
  343. package/dist/src/lib/mediaPlayback.cjs.map +1 -0
  344. package/dist/src/lib/mediaPlayback.mjs +2 -0
  345. package/dist/src/lib/mediaPlayback.mjs.map +1 -0
  346. package/dist/src/lib/mermaidDiagram.cjs +2 -0
  347. package/dist/src/lib/mermaidDiagram.cjs.map +1 -0
  348. package/dist/src/lib/mermaidDiagram.mjs +2 -0
  349. package/dist/src/lib/mermaidDiagram.mjs.map +1 -0
  350. package/dist/src/lib/optionList.d.mts +4 -5
  351. package/dist/src/lib/optionList.d.mts.map +1 -1
  352. package/dist/src/lib/syntaxHighlight.cjs +3 -0
  353. package/dist/src/lib/syntaxHighlight.cjs.map +1 -0
  354. package/dist/src/lib/syntaxHighlight.d.mts +54 -0
  355. package/dist/src/lib/syntaxHighlight.d.mts.map +1 -0
  356. package/dist/src/lib/syntaxHighlight.mjs +3 -0
  357. package/dist/src/lib/syntaxHighlight.mjs.map +1 -0
  358. package/dist/src/lib/tone.cjs.map +1 -1
  359. package/dist/src/lib/tone.d.mts +4 -5
  360. package/dist/src/lib/tone.d.mts.map +1 -1
  361. package/dist/src/lib/tone.mjs.map +1 -1
  362. package/dist/src/theme/apply.cjs.map +1 -1
  363. package/dist/src/theme/apply.d.mts +5 -6
  364. package/dist/src/theme/apply.d.mts.map +1 -1
  365. package/dist/src/theme/apply.mjs.map +1 -1
  366. package/dist/src/theme/builtinThemes.cjs.map +1 -1
  367. package/dist/src/theme/builtinThemes.d.mts +4 -5
  368. package/dist/src/theme/builtinThemes.d.mts.map +1 -1
  369. package/dist/src/theme/builtinThemes.mjs.map +1 -1
  370. package/dist/src/theme/derive.cjs.map +1 -1
  371. package/dist/src/theme/derive.d.mts +4 -5
  372. package/dist/src/theme/derive.d.mts.map +1 -1
  373. package/dist/src/theme/derive.mjs.map +1 -1
  374. package/dist/src/theme/parse.cjs.map +1 -1
  375. package/dist/src/theme/parse.d.mts +1 -2
  376. package/dist/src/theme/parse.d.mts.map +1 -1
  377. package/dist/src/theme/parse.mjs.map +1 -1
  378. package/dist/src/theme/piTheme.cjs.map +1 -1
  379. package/dist/src/theme/piTheme.d.mts +2 -3
  380. package/dist/src/theme/piTheme.d.mts.map +1 -1
  381. package/dist/src/theme/piTheme.mjs.map +1 -1
  382. package/dist/src/theme/preference.d.mts +4 -5
  383. package/dist/src/theme/preference.d.mts.map +1 -1
  384. package/dist/src/types/editor.cjs.map +1 -1
  385. package/dist/src/types/editor.d.mts +39 -5
  386. package/dist/src/types/editor.d.mts.map +1 -1
  387. package/dist/src/types/editor.mjs.map +1 -1
  388. package/dist/src/types/theme.d.mts +11 -12
  389. package/dist/src/types/theme.d.mts.map +1 -1
  390. package/dist/src/types/tone.d.mts +10 -11
  391. package/dist/src/types/tone.d.mts.map +1 -1
  392. package/package.json +21 -17
  393. package/styles/preview.css +17 -0
  394. package/styles/tokens.css +72 -0
  395. package/dist/components/Accordion.d.cts +0 -11
  396. package/dist/components/Accordion.d.cts.map +0 -1
  397. package/dist/components/Avatar.d.cts +0 -10
  398. package/dist/components/Avatar.d.cts.map +0 -1
  399. package/dist/components/Badge.d.cts +0 -18
  400. package/dist/components/Badge.d.cts.map +0 -1
  401. package/dist/components/Breadcrumb.d.cts +0 -37
  402. package/dist/components/Breadcrumb.d.cts.map +0 -1
  403. package/dist/components/Button.d.cts +0 -25
  404. package/dist/components/Button.d.cts.map +0 -1
  405. package/dist/components/Checkbox.d.cts +0 -8
  406. package/dist/components/Checkbox.d.cts.map +0 -1
  407. package/dist/components/CodeEditor.d.cts +0 -6
  408. package/dist/components/CodeEditor.d.cts.map +0 -1
  409. package/dist/components/Collapsible.d.cts +0 -10
  410. package/dist/components/Collapsible.d.cts.map +0 -1
  411. package/dist/components/Command.d.cts +0 -42
  412. package/dist/components/Command.d.cts.map +0 -1
  413. package/dist/components/Dialog.d.cts +0 -39
  414. package/dist/components/Dialog.d.cts.map +0 -1
  415. package/dist/components/Dot.d.cts +0 -16
  416. package/dist/components/Dot.d.cts.map +0 -1
  417. package/dist/components/DropdownMenu.d.cts +0 -34
  418. package/dist/components/DropdownMenu.d.cts.map +0 -1
  419. package/dist/components/EmptyState.d.cts +0 -18
  420. package/dist/components/EmptyState.d.cts.map +0 -1
  421. package/dist/components/Input.d.cts +0 -20
  422. package/dist/components/Input.d.cts.map +0 -1
  423. package/dist/components/Kbd.d.cts +0 -7
  424. package/dist/components/Kbd.d.cts.map +0 -1
  425. package/dist/components/Label.d.cts +0 -8
  426. package/dist/components/Label.d.cts.map +0 -1
  427. package/dist/components/Markdown.d.cts +0 -8
  428. package/dist/components/Markdown.d.cts.map +0 -1
  429. package/dist/components/MediaPreview.d.cts +0 -25
  430. package/dist/components/MediaPreview.d.cts.map +0 -1
  431. package/dist/components/MessageItem.d.cts +0 -71
  432. package/dist/components/MessageItem.d.cts.map +0 -1
  433. package/dist/components/MessageLines.d.cts +0 -24
  434. package/dist/components/MessageLines.d.cts.map +0 -1
  435. package/dist/components/OptionList.d.cts +0 -50
  436. package/dist/components/OptionList.d.cts.map +0 -1
  437. package/dist/components/Panel.d.cts +0 -15
  438. package/dist/components/Panel.d.cts.map +0 -1
  439. package/dist/components/Popover.d.cts +0 -19
  440. package/dist/components/Popover.d.cts.map +0 -1
  441. package/dist/components/Progress.d.cts +0 -8
  442. package/dist/components/Progress.d.cts.map +0 -1
  443. package/dist/components/RadioGroup.d.cts +0 -15
  444. package/dist/components/RadioGroup.d.cts.map +0 -1
  445. package/dist/components/ScrollArea.d.cts +0 -13
  446. package/dist/components/ScrollArea.d.cts.map +0 -1
  447. package/dist/components/SectionLabel.d.cts +0 -7
  448. package/dist/components/SectionLabel.d.cts.map +0 -1
  449. package/dist/components/Select.d.cts +0 -19
  450. package/dist/components/Select.d.cts.map +0 -1
  451. package/dist/components/Separator.d.cts +0 -13
  452. package/dist/components/Separator.d.cts.map +0 -1
  453. package/dist/components/Skeleton.d.cts +0 -11
  454. package/dist/components/Skeleton.d.cts.map +0 -1
  455. package/dist/components/Spinner.d.cts +0 -15
  456. package/dist/components/Spinner.d.cts.map +0 -1
  457. package/dist/components/StatusBadge.d.cts +0 -24
  458. package/dist/components/StatusBadge.d.cts.map +0 -1
  459. package/dist/components/StreamCursor.d.cts +0 -7
  460. package/dist/components/StreamCursor.d.cts.map +0 -1
  461. package/dist/components/Switch.d.cts +0 -8
  462. package/dist/components/Switch.d.cts.map +0 -1
  463. package/dist/components/Tabs.d.cts +0 -36
  464. package/dist/components/Tabs.d.cts.map +0 -1
  465. package/dist/components/Textarea.d.cts +0 -10
  466. package/dist/components/Textarea.d.cts.map +0 -1
  467. package/dist/components/Toast.d.cts +0 -24
  468. package/dist/components/Toast.d.cts.map +0 -1
  469. package/dist/components/Tooltip.d.cts +0 -11
  470. package/dist/components/Tooltip.d.cts.map +0 -1
  471. package/dist/icons/icons.d.cts +0 -2
  472. package/dist/index.d.cts +0 -48
  473. package/dist/lib/cn.d.cts +0 -7
  474. package/dist/lib/cn.d.cts.map +0 -1
  475. package/dist/lib/collapse.d.cts +0 -15
  476. package/dist/lib/collapse.d.cts.map +0 -1
  477. package/dist/lib/editorLanguage.d.cts +0 -22
  478. package/dist/lib/editorLanguage.d.cts.map +0 -1
  479. package/dist/lib/media.d.cts +0 -12
  480. package/dist/lib/media.d.cts.map +0 -1
  481. package/dist/lib/optionList.d.cts +0 -22
  482. package/dist/lib/optionList.d.cts.map +0 -1
  483. package/dist/lib/tone.d.cts +0 -26
  484. package/dist/lib/tone.d.cts.map +0 -1
  485. package/dist/theme/apply.d.cts +0 -26
  486. package/dist/theme/apply.d.cts.map +0 -1
  487. package/dist/theme/builtinThemes.d.cts +0 -12
  488. package/dist/theme/builtinThemes.d.cts.map +0 -1
  489. package/dist/theme/derive.d.cts +0 -15
  490. package/dist/theme/derive.d.cts.map +0 -1
  491. package/dist/theme/parse.d.cts +0 -11
  492. package/dist/theme/parse.d.cts.map +0 -1
  493. package/dist/theme/piTheme.d.cts +0 -20
  494. package/dist/theme/piTheme.d.cts.map +0 -1
  495. package/dist/theme/preference.d.cts +0 -16
  496. package/dist/theme/preference.d.cts.map +0 -1
  497. package/dist/theme.d.cts +0 -8
  498. package/dist/types/editor.d.cts +0 -44
  499. package/dist/types/editor.d.cts.map +0 -1
  500. package/dist/types/theme.d.cts +0 -39
  501. package/dist/types/theme.d.cts.map +0 -1
  502. package/dist/types/tone.d.cts +0 -29
  503. package/dist/types/tone.d.cts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditorView.mjs","names":[],"sources":["../../../src/components/CodeEditorView.tsx"],"sourcesContent":["import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';\nimport {\n bracketMatching,\n foldGutter,\n foldKeymap,\n HighlightStyle,\n indentOnInput,\n syntaxHighlighting,\n} from '@codemirror/language';\nimport { highlightSelectionMatches, search, searchKeymap } from '@codemirror/search';\nimport { Compartment, EditorState } from '@codemirror/state';\nimport {\n drawSelection,\n EditorView,\n highlightActiveLine,\n highlightActiveLineGutter,\n keymap,\n lineNumbers,\n rectangularSelection,\n} from '@codemirror/view';\nimport { tags } from '@lezer/highlight';\nimport { useEffect, useRef } from 'react';\nimport { cn } from '../lib/cn.ts';\nimport { grammarKeyOf, loadGrammar } from '../lib/editorLanguage.ts';\nimport { DOOM_EDITOR_STYLES, DOOM_SYNTAX_STYLES } from '../lib/editorTheme.ts';\nimport type { CodeEditorProps } from '../types/editor.ts';\n\n/**\n * The editor itself, mounted on a real CodeMirror view.\n *\n * Nothing imports this module directly: `CodeEditor` reaches it through a lazy\n * import so the whole editor, and every grammar under it, stays out of the\n * cockpit's first load. Behaviour lives here rather than in that wrapper so\n * the split costs one file and no indirection.\n *\n * The three things a caller can change after mount each sit in their own\n * compartment. Reconfiguring one is a transaction; rebuilding the editor would\n * throw away the undo history, the scroll position and the cursor, which is\n * what a reader loses if a parent re-render is allowed to remount this.\n */\n\n/** Not a colour or a layout choice: how CodeMirror is told to draw the doom palette. */\nconst DOOM_THEME = EditorView.theme(DOOM_EDITOR_STYLES);\n\nconst DOOM_HIGHLIGHT = HighlightStyle.define([\n { tag: tags.comment, ...DOOM_SYNTAX_STYLES.comment },\n { tag: tags.keyword, ...DOOM_SYNTAX_STYLES.keyword },\n { tag: [tags.atom, tags.bool, tags.null, tags.self], ...DOOM_SYNTAX_STYLES.constant },\n { tag: tags.number, ...DOOM_SYNTAX_STYLES.literal },\n { tag: [tags.string, tags.special(tags.string), tags.character], ...DOOM_SYNTAX_STYLES.string },\n { tag: tags.regexp, ...DOOM_SYNTAX_STYLES.regexp },\n { tag: tags.operator, ...DOOM_SYNTAX_STYLES.operator },\n { tag: tags.punctuation, ...DOOM_SYNTAX_STYLES.punctuation },\n { tag: tags.variableName, ...DOOM_SYNTAX_STYLES.variable },\n { tag: tags.propertyName, ...DOOM_SYNTAX_STYLES.property },\n { tag: [tags.function(tags.variableName), tags.function(tags.propertyName)], ...DOOM_SYNTAX_STYLES.callable },\n { tag: [tags.typeName, tags.className, tags.namespace], ...DOOM_SYNTAX_STYLES.type },\n { tag: tags.tagName, ...DOOM_SYNTAX_STYLES.tag },\n { tag: tags.attributeName, ...DOOM_SYNTAX_STYLES.attribute },\n { tag: [tags.meta, tags.processingInstruction], ...DOOM_SYNTAX_STYLES.meta },\n { tag: tags.heading, ...DOOM_SYNTAX_STYLES.heading },\n { tag: [tags.link, tags.url], ...DOOM_SYNTAX_STYLES.link },\n { tag: tags.emphasis, ...DOOM_SYNTAX_STYLES.emphasis },\n { tag: tags.strong, ...DOOM_SYNTAX_STYLES.strong },\n { tag: tags.strikethrough, ...DOOM_SYNTAX_STYLES.strikethrough },\n { tag: tags.invalid, ...DOOM_SYNTAX_STYLES.invalid },\n]);\n\n/** Everything that never changes for the life of an editor. */\nconst FIXED_EXTENSIONS = [\n lineNumbers(),\n highlightActiveLineGutter(),\n foldGutter(),\n highlightActiveLine(),\n drawSelection(),\n rectangularSelection(),\n indentOnInput(),\n bracketMatching(),\n history(),\n search({ top: true }),\n highlightSelectionMatches(),\n // Tab indents rather than leaving the editor. That trades a keyboard user's\n // escape route for the behaviour every other editor has, so it is last in\n // the keymap and Escape then Tab still moves focus out.\n keymap.of([...defaultKeymap, ...historyKeymap, ...searchKeymap, ...foldKeymap, indentWithTab]),\n syntaxHighlighting(DOOM_HIGHLIGHT),\n DOOM_THEME,\n];\n\nexport function CodeEditorView({\n value,\n path,\n readOnly = false,\n lineWrapping = true,\n className,\n onChange,\n onSelect,\n 'data-testid': testId,\n}: CodeEditorProps) {\n const host = useRef<HTMLDivElement>(null);\n const view = useRef<EditorView | null>(null);\n // The callbacks are new objects on every parent render. Reading them through\n // a ref is what lets the editor be built once and still call the current\n // pair, rather than being rebuilt whenever the parent re-renders.\n const handlers = useRef({ onChange, onSelect });\n const compartments = useRef({\n language: new Compartment(),\n readOnly: new Compartment(),\n wrapping: new Compartment(),\n });\n\n useEffect(() => {\n handlers.current = { onChange, onSelect };\n });\n\n useEffect(() => {\n const parent = host.current;\n if (parent === null) return;\n const { language, readOnly: readOnlyPart, wrapping } = compartments.current;\n const editor = new EditorView({\n parent,\n state: EditorState.create({\n // The initial document only; every later change arrives as a\n // transaction from the effect below.\n doc: value,\n extensions: [\n ...FIXED_EXTENSIONS,\n language.of([]),\n readOnlyPart.of([]),\n wrapping.of([]),\n EditorView.updateListener.of((update) => {\n if (update.docChanged) handlers.current.onChange?.(update.state.doc.toString());\n if (!update.selectionSet && !update.docChanged) return;\n const report = handlers.current.onSelect;\n if (report === undefined) return;\n const range = update.state.selection.main;\n report({\n text: update.state.sliceDoc(range.from, range.to),\n startLine: update.state.doc.lineAt(range.from).number,\n endLine: update.state.doc.lineAt(range.to).number,\n });\n }),\n ],\n }),\n });\n view.current = editor;\n return () => {\n editor.destroy();\n view.current = null;\n };\n // Built once. `value` seeds the document and the sync effect owns it after that.\n }, []);\n\n useEffect(() => {\n const editor = view.current;\n // A caller that echoes onChange back into `value` would otherwise replace\n // the document on every keystroke and drop the cursor to the end.\n if (editor === null || editor.state.doc.toString() === value) return;\n editor.dispatch({ changes: { from: 0, to: editor.state.doc.length, insert: value } });\n }, [value]);\n\n useEffect(() => {\n view.current?.dispatch({\n effects: compartments.current.readOnly.reconfigure([\n EditorState.readOnly.of(readOnly),\n EditorView.editable.of(!readOnly),\n ]),\n });\n }, [readOnly]);\n\n useEffect(() => {\n view.current?.dispatch({\n effects: compartments.current.wrapping.reconfigure(lineWrapping ? EditorView.lineWrapping : []),\n });\n }, [lineWrapping]);\n\n useEffect(() => {\n const key = path === undefined ? undefined : grammarKeyOf(path);\n const { language } = compartments.current;\n if (key === undefined) {\n view.current?.dispatch({ effects: language.reconfigure([]) });\n return;\n }\n let cancelled = false;\n void loadGrammar(key)\n .then((grammar) => {\n if (!cancelled) view.current?.dispatch({ effects: language.reconfigure(grammar) });\n })\n .catch(() => {\n // A grammar is a separate chunk over the network, and the cockpit is\n // often read through a tunnel. Losing it costs syntax colour, not the\n // file, so fall back to plain text rather than failing the pane.\n if (!cancelled) view.current?.dispatch({ effects: language.reconfigure([]) });\n });\n return () => {\n cancelled = true;\n };\n }, [path]);\n\n return <div ref={host} data-testid={testId} className={cn('min-h-0 overflow-hidden', className)} />;\n}\n"],"mappings":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AClB,KAAM,GAAY,CACZ,GAAW,EAAK,SAAS,SAAS,CAAE,QAAS,EAAS,YAAY,CAAO,CAAE,CAAC,CACnF,CAAC,CAAC,CACD,UAAY,CAIN,GAAW,EAAK,SAAS,SAAS,CAAE,QAAS,EAAS,YAAY,CAAC,CAAC,CAAE,CAAC,CAC9E,CAAC,MACU,CACX,EAAY,EACd,CACF,EAAG,CAAC,CAAI,CAAC,EAEF,EAAC,MAAD,CAAK,IAAK,EAAM,cAAa,EAAQ,UAAW,EAAG,0BAA2B,CAAS,CAAI,CAAA,CACpG"}
1
+ {"version":3,"file":"CodeEditorView.mjs","names":[],"sources":["../../../src/components/CodeEditorView.tsx"],"sourcesContent":["import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';\nimport {\n bracketMatching,\n foldGutter,\n foldKeymap,\n HighlightStyle,\n indentOnInput,\n syntaxHighlighting,\n} from '@codemirror/language';\nimport { highlightSelectionMatches, search, searchKeymap } from '@codemirror/search';\nimport { Compartment, EditorState, StateEffect, StateField } from '@codemirror/state';\nimport {\n Decoration,\n type DecorationSet,\n drawSelection,\n EditorView,\n highlightActiveLine,\n highlightActiveLineGutter,\n keymap,\n lineNumbers,\n rectangularSelection,\n WidgetType,\n} from '@codemirror/view';\nimport { tags } from '@lezer/highlight';\nimport { useEffect, useImperativeHandle, useLayoutEffect, useRef } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { boundedEditorEdits, boundedEditorRanges } from '../lib/editorController';\nimport { grammarKeyOf, loadGrammar } from '../lib/editorLanguage';\nimport { DOOM_EDITOR_STYLES, DOOM_SYNTAX_STYLES } from '../lib/editorTheme';\nimport type { CodeEditorProps, EditorSelectionRange, EditorViewportRectangle } from '../types/editor';\n\nfunction selectionRange(editor: { readonly state: EditorState }, from: number, to: number): EditorSelectionRange {\n const start = Math.min(from, to);\n const end = Math.max(from, to);\n return {\n text: editor.state.sliceDoc(start, end),\n from: start,\n to: end,\n startLine: editor.state.doc.lineAt(start).number,\n endLine: editor.state.doc.lineAt(end).number,\n };\n}\n\nexport function resolveEditorViewportRegion(\n editor: {\n readonly state: EditorState;\n posAtCoords(coords: { x: number; y: number }): number | null;\n },\n rectangle: EditorViewportRectangle,\n): EditorSelectionRange | null {\n const start = editor.posAtCoords({ x: rectangle.left, y: rectangle.top });\n const end = editor.posAtCoords({ x: rectangle.right, y: rectangle.bottom });\n if (start === null || end === null) return null;\n return selectionRange(editor, start, end);\n}\n/**\n * The editor itself, mounted on a real CodeMirror view.\n *\n * Nothing imports this module directly: `CodeEditor` reaches it through a lazy\n * import so the whole editor, and every grammar under it, stays out of the\n * cockpit's first load. Behaviour lives here rather than in that wrapper so\n * the split costs one file and no indirection.\n *\n * The three things a caller can change after mount each sit in their own\n * compartment. Reconfiguring one is a transaction; rebuilding the editor would\n * throw away the undo history, the scroll position and the cursor, which is\n * what a reader loses if a parent re-render is allowed to remount this.\n */\n\n/** Not a colour or a layout choice: how CodeMirror is told to draw the doom palette. */\nconst DOOM_THEME = EditorView.theme(DOOM_EDITOR_STYLES);\n\nconst DOOM_HIGHLIGHT = HighlightStyle.define([\n { tag: tags.comment, ...DOOM_SYNTAX_STYLES.comment },\n { tag: tags.keyword, ...DOOM_SYNTAX_STYLES.keyword },\n { tag: [tags.atom, tags.bool, tags.null, tags.self], ...DOOM_SYNTAX_STYLES.constant },\n { tag: tags.number, ...DOOM_SYNTAX_STYLES.literal },\n { tag: [tags.string, tags.special(tags.string), tags.character], ...DOOM_SYNTAX_STYLES.string },\n { tag: tags.regexp, ...DOOM_SYNTAX_STYLES.regexp },\n { tag: tags.operator, ...DOOM_SYNTAX_STYLES.operator },\n { tag: tags.punctuation, ...DOOM_SYNTAX_STYLES.punctuation },\n { tag: tags.variableName, ...DOOM_SYNTAX_STYLES.variable },\n { tag: tags.propertyName, ...DOOM_SYNTAX_STYLES.property },\n { tag: [tags.function(tags.variableName), tags.function(tags.propertyName)], ...DOOM_SYNTAX_STYLES.callable },\n { tag: [tags.typeName, tags.className, tags.namespace], ...DOOM_SYNTAX_STYLES.type },\n { tag: tags.tagName, ...DOOM_SYNTAX_STYLES.tag },\n { tag: tags.attributeName, ...DOOM_SYNTAX_STYLES.attribute },\n { tag: [tags.meta, tags.processingInstruction], ...DOOM_SYNTAX_STYLES.meta },\n { tag: tags.heading, ...DOOM_SYNTAX_STYLES.heading },\n { tag: [tags.link, tags.url], ...DOOM_SYNTAX_STYLES.link },\n { tag: tags.emphasis, ...DOOM_SYNTAX_STYLES.emphasis },\n { tag: tags.strong, ...DOOM_SYNTAX_STYLES.strong },\n { tag: tags.strikethrough, ...DOOM_SYNTAX_STYLES.strikethrough },\n { tag: tags.invalid, ...DOOM_SYNTAX_STYLES.invalid },\n]);\n\nconst setClosedDecorations = StateEffect.define<DecorationSet>();\nconst closedDecorations = StateField.define<DecorationSet>({\n create: () => Decoration.none,\n update: (decorations, transaction) => {\n let next = decorations.map(transaction.changes);\n for (const effect of transaction.effects) {\n if (effect.is(setClosedDecorations)) next = effect.value;\n }\n return next;\n },\n provide: (field) => EditorView.decorations.from(field),\n});\n\nconst setMarkedDecorations = StateEffect.define<DecorationSet>();\nconst markedDecorations = StateField.define<DecorationSet>({\n create: () => Decoration.none,\n update: (decorations, transaction) => {\n let next = decorations.map(transaction.changes);\n for (const effect of transaction.effects) {\n if (effect.is(setMarkedDecorations)) next = effect.value;\n }\n return next;\n },\n provide: (field) => EditorView.decorations.from(field),\n});\n\nclass MarkedRangeLabel extends WidgetType {\n constructor(private readonly label: string) {\n super();\n }\n\n eq(other: MarkedRangeLabel): boolean {\n return other.label === this.label;\n }\n\n toDOM(): HTMLElement {\n const label = document.createElement('span');\n label.className = 'cm-marked-region-label';\n label.dataset.authorRegionLabel = this.label;\n label.textContent = this.label;\n return label;\n }\n}\n\nconst MARKED_REGION_THEME = EditorView.baseTheme({\n '.cm-marked-region': {\n backgroundColor: 'var(--doom-tint-yellow)',\n borderBottom: '1px solid var(--doom-edge-yellow)',\n },\n '.cm-marked-region-label': {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n minWidth: '16px',\n height: '16px',\n marginRight: '4px',\n borderRadius: '999px',\n backgroundColor: 'var(--doom-yellow)',\n color: 'var(--doom-deep)',\n fontSize: '9px',\n fontWeight: '700',\n lineHeight: '1',\n verticalAlign: 'text-bottom',\n },\n});\n\n/** Everything that never changes for the life of an editor. */\nconst FIXED_EXTENSIONS = [\n lineNumbers(),\n highlightActiveLineGutter(),\n foldGutter(),\n highlightActiveLine(),\n drawSelection(),\n rectangularSelection(),\n indentOnInput(),\n bracketMatching(),\n history(),\n search({ top: true }),\n highlightSelectionMatches(),\n // Tab indents rather than leaving the editor. That trades a keyboard user's\n // escape route for the behaviour every other editor has, so it is last in\n // the keymap and Escape then Tab still moves focus out.\n keymap.of([...defaultKeymap, ...historyKeymap, ...searchKeymap, ...foldKeymap, indentWithTab]),\n syntaxHighlighting(DOOM_HIGHLIGHT),\n closedDecorations,\n markedDecorations,\n MARKED_REGION_THEME,\n DOOM_THEME,\n];\n\nexport function CodeEditorView({\n value,\n path,\n readOnly = false,\n lineWrapping = true,\n className,\n onChange,\n onSelect,\n controllerRef,\n 'data-testid': testId,\n}: CodeEditorProps) {\n const host = useRef<HTMLDivElement>(null);\n const view = useRef<EditorView | null>(null);\n // The callbacks are new objects on every parent render. Reading them through\n // a ref is what lets the editor be built once and still call the current\n // pair, rather than being rebuilt whenever the parent re-renders.\n const handlers = useRef({ onChange, onSelect });\n // The document is seeded once from the value of the first render; the sync effect\n // below owns every later change.\n const initialValue = useRef(value);\n const compartments = useRef({\n language: new Compartment(),\n readOnly: new Compartment(),\n wrapping: new Compartment(),\n });\n\n useEffect(() => {\n handlers.current = { onChange, onSelect };\n });\n\n useLayoutEffect(() => {\n const parent = host.current;\n if (parent === null) return;\n const { language, readOnly: readOnlyPart, wrapping } = compartments.current;\n const editor = new EditorView({\n parent,\n state: EditorState.create({\n // The initial document only; every later change arrives as a\n // transaction from the effect below.\n doc: initialValue.current,\n extensions: [\n ...FIXED_EXTENSIONS,\n language.of([]),\n readOnlyPart.of([]),\n wrapping.of([]),\n EditorView.updateListener.of((update) => {\n if (update.docChanged) handlers.current.onChange?.(update.state.doc.toString());\n if (!update.selectionSet && !update.docChanged) return;\n const report = handlers.current.onSelect;\n if (report === undefined) return;\n const range = update.state.selection.main;\n report(selectionRange(update.view, range.from, range.to));\n }),\n ],\n }),\n });\n view.current = editor;\n return () => {\n editor.destroy();\n view.current = null;\n };\n // Built once.\n }, []);\n\n useImperativeHandle(\n controllerRef,\n () => ({\n focus: () => view.current?.focus(),\n revealAndSelect: (range) => {\n const editor = view.current;\n if (editor === null) return;\n const [bounded] = boundedEditorRanges(editor.state.doc.length, [range]);\n if (bounded === undefined) return;\n editor.dispatch({\n selection: { anchor: bounded.from, head: bounded.to },\n effects: EditorView.scrollIntoView(bounded.from, { y: 'center' }),\n });\n },\n applyEdits: (edits) => {\n const editor = view.current;\n if (editor === null || edits.length === 0) return;\n editor.dispatch({ changes: boundedEditorEdits(editor.state.doc.length, edits) });\n },\n setClosedRanges: (ranges) => {\n const editor = view.current;\n if (editor === null) return;\n const bounded = boundedEditorRanges(editor.state.doc.length, ranges);\n const decorations = bounded.map((range) =>\n range.from === range.to\n ? Decoration.line({ attributes: { class: 'cm-closed-tone', 'data-tone': 'closed' } }).range(\n editor.state.doc.lineAt(range.from).from,\n )\n : Decoration.mark({ class: 'cm-closed-tone', attributes: { 'data-tone': 'closed' } }).range(\n range.from,\n range.to,\n ),\n );\n editor.dispatch({ effects: setClosedDecorations.of(Decoration.set(decorations)) });\n },\n setMarkedRanges: (ranges) => {\n const editor = view.current;\n if (editor === null) return;\n const decorations = ranges.flatMap((range) => {\n const [bounded] = boundedEditorRanges(editor.state.doc.length, [range]);\n if (bounded === undefined || bounded.from === bounded.to) return [];\n return [\n Decoration.widget({ widget: new MarkedRangeLabel(range.label), side: -1 }).range(bounded.from),\n Decoration.mark({\n class: 'cm-marked-region',\n attributes: { 'data-author-region': range.label },\n }).range(bounded.from, bounded.to),\n ];\n });\n editor.dispatch({ effects: setMarkedDecorations.of(Decoration.set(decorations, true)) });\n },\n resolveViewportRegion: (rectangle) => {\n const editor = view.current;\n return editor === null ? null : resolveEditorViewportRegion(editor, rectangle);\n },\n }),\n [],\n );\n\n useEffect(() => {\n const editor = view.current;\n // A caller that echoes onChange back into `value` would otherwise replace\n // the document on every keystroke and drop the cursor to the end.\n if (editor === null || editor.state.doc.toString() === value) return;\n editor.dispatch({ changes: { from: 0, to: editor.state.doc.length, insert: value } });\n }, [value]);\n\n useEffect(() => {\n view.current?.dispatch({\n effects: compartments.current.readOnly.reconfigure([\n EditorState.readOnly.of(readOnly),\n EditorView.editable.of(!readOnly),\n ]),\n });\n }, [readOnly]);\n\n useEffect(() => {\n view.current?.dispatch({\n effects: compartments.current.wrapping.reconfigure(lineWrapping ? EditorView.lineWrapping : []),\n });\n }, [lineWrapping]);\n\n useEffect(() => {\n const key = path === undefined ? undefined : grammarKeyOf(path);\n const { language } = compartments.current;\n if (key === undefined) {\n view.current?.dispatch({ effects: language.reconfigure([]) });\n return;\n }\n let cancelled = false;\n void loadGrammar(key)\n .then((grammar) => {\n if (!cancelled) view.current?.dispatch({ effects: language.reconfigure(grammar) });\n })\n .catch(() => {\n // A grammar is a separate chunk over the network, and the cockpit is\n // often read through a tunnel. Losing it costs syntax colour, not the\n // file, so fall back to plain text rather than failing the pane.\n if (!cancelled) view.current?.dispatch({ effects: language.reconfigure([]) });\n });\n return () => {\n cancelled = true;\n };\n }, [path]);\n\n return <div ref={host} data-testid={testId} className={cn('min-h-0 overflow-hidden', className)} />;\n}\n"],"mappings":"olCAgCA,SAAS,EAAe,EAAyC,EAAc,EAAkC,CAC/G,IAAM,EAAQ,KAAK,IAAI,EAAM,CAAE,EACzB,EAAM,KAAK,IAAI,EAAM,CAAE,EAC7B,MAAO,CACL,KAAM,EAAO,MAAM,SAAS,EAAO,CAAG,EACtC,KAAM,EACN,GAAI,EACJ,UAAW,EAAO,MAAM,IA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G,GAAI,EAAO,MAAM,IAAI,OAAQ,OAAQ,CAAM,CAAE,CAAC,CACtF,EAAG,CAAC,CAAK,CAAC,EAEV,MAAgB,CACd,EAAK,SAAS,SAAS,CACrB,QAAS,EAAa,QAAQ,SAAS,YAAY,CACjD,EAAY,SAAS,GAAG,CAAQ,EAChC,EAAW,SAAS,GAAG,CAAC,CAAQ,CAClC,CAAC,CACH,CAAC,CACH,EAAG,CAAC,CAAQ,CAAC,EAEb,MAAgB,CACd,EAAK,SAAS,SAAS,CACrB,QAAS,EAAa,QAAQ,SAAS,YAAY,EAAe,EAAW,aAAe,CAAC,CAAC,CAChG,CAAC,CACH,EAAG,CAAC,CAAY,CAAC,EAEjB,MAAgB,CACd,IAAM,EAAM,IAAS,IAAA,GAAY,IAAA,GAAY,EAAa,CAAI,EACxD,CAAE,YAAa,EAAa,QAClC,GAAI,IAAQ,IAAA,GAAW,CACrB,EAAK,SAAS,SAAS,CAAE,QAAS,EAAS,YAAY,CAAC,CAAC,CAAE,CAAC,EAC5D,MACF,CACA,IAAI,EAAY,GAWhB,OAVA,EAAiB,CAAG,CAAC,CAClB,KAAM,GAAY,CACZ,GAAW,EAAK,SAAS,SAAS,CAAE,QAAS,EAAS,YAAY,CAAO,CAAE,CAAC,CACnF,CAAC,CAAC,CACD,UAAY,CAIN,GAAW,EAAK,SAAS,SAAS,CAAE,QAAS,EAAS,YAAY,CAAC,CAAC,CAAE,CAAC,CAC9E,CAAC,MACU,CACX,EAAY,EACd,CACF,EAAG,CAAC,CAAI,CAAC,EAEF,kBAAC,MAAD,CAAK,IAAK,EAAM,cAAa,EAAQ,UAAW,EAAG,0BAA2B,CAAS,CAAI,CAAA,CACpG"}
@@ -1,2 +1,2 @@
1
- const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime");function r(e){return(0,n.jsx)(t.Collapsible.Root,{"data-slot":`collapsible`,...e})}function i(e){return(0,n.jsx)(t.Collapsible.CollapsibleTrigger,{"data-slot":`collapsible-trigger`,...e})}function a({className:r,...i}){return(0,n.jsx)(t.Collapsible.CollapsibleContent,{"data-slot":`collapsible-content`,className:e.cn(`overflow-hidden`,r),...i})}exports.Collapsible=r,exports.CollapsibleContent=a,exports.CollapsibleTrigger=i;
1
+ const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime");function r(e){return/* @__PURE__ */ (0,n.jsx)(t.Collapsible.Root,{"data-slot":`collapsible`,...e})}function i(e){return/* @__PURE__ */ (0,n.jsx)(t.Collapsible.CollapsibleTrigger,{"data-slot":`collapsible-trigger`,...e})}function a({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Collapsible.CollapsibleContent,{"data-slot":`collapsible-content`,className:e.cn(`overflow-hidden`,r),...i})}exports.Collapsible=r,exports.CollapsibleContent=a,exports.CollapsibleTrigger=i;
2
2
  //# sourceMappingURL=Collapsible.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Collapsible.cjs","names":["CollapsiblePrimitive","cn"],"sources":["../../../src/components/Collapsible.tsx"],"sourcesContent":["import { Collapsible as CollapsiblePrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\nimport { cn } from '../lib/cn.ts';\n\n/** A section that folds; Radix keeps the trigger's aria-expanded in step with the content. */\nexport function Collapsible(props: ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nexport function CollapsibleTrigger(props: ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />;\n}\n\nexport function CollapsibleContent({\n className,\n ...props\n}: ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return (\n <CollapsiblePrimitive.CollapsibleContent\n data-slot=\"collapsible-content\"\n className={cn('overflow-hidden', className)}\n {...props}\n />\n );\n}\n"],"mappings":"0FAKA,SAAgB,EAAY,EAAyD,CACnF,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,YAAqB,KAAtB,CAA2B,YAAU,cAAc,GAAI,CAAQ,CAAA,CACxE,CAEA,SAAgB,EAAmB,EAAuE,CACxG,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,YAAqB,mBAAtB,CAAyC,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAC9F,CAEA,SAAgB,EAAmB,CACjC,YACA,GAAG,GAC8D,CACjE,OACE,EAAA,EAAA,IAAA,CAACA,EAAAA,YAAqB,mBAAtB,CACE,YAAU,sBACV,UAAWC,EAAAA,GAAG,kBAAmB,CAAS,EAC1C,GAAI,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"Collapsible.cjs","names":["CollapsiblePrimitive","cn"],"sources":["../../../src/components/Collapsible.tsx"],"sourcesContent":["import { Collapsible as CollapsiblePrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** A section that folds; Radix keeps the trigger's aria-expanded in step with the content. */\nexport function Collapsible(props: ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nexport function CollapsibleTrigger(props: ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />;\n}\n\nexport function CollapsibleContent({\n className,\n ...props\n}: ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return (\n <CollapsiblePrimitive.CollapsibleContent\n data-slot=\"collapsible-content\"\n className={cn('overflow-hidden', className)}\n {...props}\n />\n );\n}\n"],"mappings":"0FAMA,SAAgB,EAAY,EAAyD,CACnF,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,YAAqB,KAAtB,CAA2B,YAAU,cAAc,GAAI,CAAQ,CAAA,CACxE,CAEA,SAAgB,EAAmB,EAAuE,CACxG,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,YAAqB,mBAAtB,CAAyC,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAC9F,CAEA,SAAgB,EAAmB,CACjC,YACA,GAAG,GAC8D,CACjE,MACE,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,YAAqB,mBAAtB,CACE,YAAU,sBACV,UAAWC,EAAAA,GAAG,kBAAmB,CAAS,EAC1C,GAAI,CACL,CAAA,CAEL"}
@@ -2,9 +2,9 @@ import { Collapsible } from "radix-ui";
2
2
  import { ComponentProps } from "react";
3
3
  //#region src/components/Collapsible.d.ts
4
4
  /** A section that folds; Radix keeps the trigger's aria-expanded in step with the content. */
5
- declare function Collapsible$1(props: ComponentProps<typeof Collapsible.Root>): import("react/jsx-runtime").JSX.Element;
6
- declare function CollapsibleTrigger(props: ComponentProps<typeof Collapsible.CollapsibleTrigger>): import("react/jsx-runtime").JSX.Element;
7
- declare function CollapsibleContent({ className, ...props }: ComponentProps<typeof Collapsible.CollapsibleContent>): import("react/jsx-runtime").JSX.Element;
5
+ declare function Collapsible$1(props: ComponentProps<typeof Collapsible.Root>): import("react").JSX.Element;
6
+ export declare function CollapsibleTrigger(props: ComponentProps<typeof Collapsible.CollapsibleTrigger>): import("react").JSX.Element;
7
+ export declare function CollapsibleContent({ className, ...props }: ComponentProps<typeof Collapsible.CollapsibleContent>): import("react").JSX.Element;
8
8
  //#endregion
9
- export { Collapsible$1 as Collapsible, CollapsibleContent, CollapsibleTrigger };
9
+ export { Collapsible$1 as Collapsible };
10
10
  //# sourceMappingURL=Collapsible.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Collapsible.d.mts","names":[],"sources":["../../../src/components/Collapsible.tsx"],"mappings":";;;;iBAKgB,cAAY,OAAO,sBAAsB,YAAqB,oCAAK,IAAA;iBAInE,mBAAmB,OAAO,sBAAsB,YAAqB,kDAAmB,IAAA;iBAIxF,qBACd,cACG,SACF,sBAAsB,YAAqB,kDAAmB,IAAA"}
1
+ {"version":3,"file":"Collapsible.d.mts","names":[],"sources":["../../../src/components/Collapsible.tsx"],"mappings":";;;;iBAMgB,cAAY,OAAO,sBAAsB,YAAqB,wBAAK,IAAA;wBAInE,mBAAmB,OAAO,sBAAsB,YAAqB,sCAAmB,IAAA;wBAIxF,qBACd,cACG,SACF,sBAAsB,YAAqB,sCAAmB,IAAA"}
@@ -1,2 +1,2 @@
1
- import{cn as e}from"../lib/cn.mjs";import{Collapsible as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function r(e){return n(t.Root,{"data-slot":`collapsible`,...e})}function i(e){return n(t.CollapsibleTrigger,{"data-slot":`collapsible-trigger`,...e})}function a({className:r,...i}){return n(t.CollapsibleContent,{"data-slot":`collapsible-content`,className:e(`overflow-hidden`,r),...i})}export{r as Collapsible,a as CollapsibleContent,i as CollapsibleTrigger};
1
+ import{cn as e}from"../lib/cn.mjs";import{Collapsible as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function r(e){return/* @__PURE__ */ n(t.Root,{"data-slot":`collapsible`,...e})}function i(e){return/* @__PURE__ */ n(t.CollapsibleTrigger,{"data-slot":`collapsible-trigger`,...e})}function a({className:r,...i}){return/* @__PURE__ */ n(t.CollapsibleContent,{"data-slot":`collapsible-content`,className:e(`overflow-hidden`,r),...i})}export{r as Collapsible,a as CollapsibleContent,i as CollapsibleTrigger};
2
2
  //# sourceMappingURL=Collapsible.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Collapsible.mjs","names":["Collapsible","CollapsiblePrimitive"],"sources":["../../../src/components/Collapsible.tsx"],"sourcesContent":["import { Collapsible as CollapsiblePrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\nimport { cn } from '../lib/cn.ts';\n\n/** A section that folds; Radix keeps the trigger's aria-expanded in step with the content. */\nexport function Collapsible(props: ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nexport function CollapsibleTrigger(props: ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />;\n}\n\nexport function CollapsibleContent({\n className,\n ...props\n}: ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return (\n <CollapsiblePrimitive.CollapsibleContent\n data-slot=\"collapsible-content\"\n className={cn('overflow-hidden', className)}\n {...props}\n />\n );\n}\n"],"mappings":"kHAKA,SAAgBA,EAAY,EAAyD,CACnF,OAAO,EAACC,EAAqB,KAAtB,CAA2B,YAAU,cAAc,GAAI,CAAQ,CAAA,CACxE,CAEA,SAAgB,EAAmB,EAAuE,CACxG,OAAO,EAACA,EAAqB,mBAAtB,CAAyC,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAC9F,CAEA,SAAgB,EAAmB,CACjC,YACA,GAAG,GAC8D,CACjE,OACE,EAACA,EAAqB,mBAAtB,CACE,YAAU,sBACV,UAAW,EAAG,kBAAmB,CAAS,EAC1C,GAAI,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"Collapsible.mjs","names":["Collapsible","CollapsiblePrimitive"],"sources":["../../../src/components/Collapsible.tsx"],"sourcesContent":["import { Collapsible as CollapsiblePrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** A section that folds; Radix keeps the trigger's aria-expanded in step with the content. */\nexport function Collapsible(props: ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nexport function CollapsibleTrigger(props: ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />;\n}\n\nexport function CollapsibleContent({\n className,\n ...props\n}: ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return (\n <CollapsiblePrimitive.CollapsibleContent\n data-slot=\"collapsible-content\"\n className={cn('overflow-hidden', className)}\n {...props}\n />\n );\n}\n"],"mappings":"kHAMA,SAAgBA,EAAY,EAAyD,CACnF,MAAO,kBAACC,EAAqB,KAAtB,CAA2B,YAAU,cAAc,GAAI,CAAQ,CAAA,CACxE,CAEA,SAAgB,EAAmB,EAAuE,CACxG,MAAO,kBAACA,EAAqB,mBAAtB,CAAyC,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAC9F,CAEA,SAAgB,EAAmB,CACjC,YACA,GAAG,GAC8D,CACjE,MACE,kBAACA,EAAqB,mBAAtB,CACE,YAAU,sBACV,UAAW,EAAG,kBAAmB,CAAS,EAC1C,GAAI,CACL,CAAA,CAEL"}
@@ -1,2 +1,2 @@
1
- const e=require("../lib/cn.cjs"),t=require("./Dialog.cjs"),n=require("./Input.cjs"),r=require("./OptionList.cjs");let i=require("react/jsx-runtime");function a({open:n,onOpenChange:r,title:a,titleVisible:o=!1,className:s,children:c,width:l=`lg`,...u}){return(0,i.jsx)(t.Dialog,{open:n,onOpenChange:r,children:(0,i.jsxs)(t.DialogContent,{"data-slot":`command-dialog`,width:l,className:e.cn(`max-h-[70vh]`,s),...u,children:[(0,i.jsx)(t.DialogTitle,{className:o?void 0:`sr-only`,children:a}),c]})})}function o({className:t,...n}){return(0,i.jsx)(`div`,{"data-slot":`command-header`,className:e.cn(`flex shrink-0 items-center gap-2 border-b border-doom-border px-3 py-2.5`,t),...n})}function s({className:t,...r}){return(0,i.jsx)(n.Input,{"data-slot":`command-input`,variant:`bare`,autoFocus:!0,autoComplete:`off`,className:e.cn(`flex-1`,t),...r})}function c({className:t,...n}){return(0,i.jsx)(`div`,{role:`listbox`,"data-slot":`command-list`,className:e.cn(`flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-1.5`,t),...n})}function l({className:t,...n}){return(0,i.jsx)(`div`,{"data-slot":`command-group`,className:e.cn(`flex flex-col gap-0.5`,t),...n})}function u({className:t,...n}){return(0,i.jsx)(`div`,{"data-slot":`command-group-label`,className:e.cn(`px-2 pt-2 pb-1 text-[8px] font-bold tracking-[0.14em] text-doom-faint uppercase`,t),...n})}function d({density:e=`compact`,...t}){return(0,i.jsx)(r.OptionRow,{"data-slot":`command-item`,density:e,...t})}function f(e){return(0,i.jsx)(r.OptionLabel,{"data-slot":`command-item-label`,density:`compact`,...e})}function p({className:t,...n}){return(0,i.jsx)(`div`,{"data-slot":`command-empty`,className:e.cn(`px-2 py-6 text-center text-[11px] text-doom-faint`,t),...n})}function m({className:t,...n}){return(0,i.jsx)(`div`,{"data-slot":`command-footer`,className:e.cn(`flex min-h-[30px] shrink-0 items-center justify-between gap-3 border-t border-doom-border-soft bg-doom-deep px-3 text-[9px] text-doom-faint`,t),...n})}exports.CommandDialog=a,exports.CommandEmpty=p,exports.CommandFooter=m,exports.CommandGroup=l,exports.CommandGroupLabel=u,exports.CommandHeader=o,exports.CommandInput=s,exports.CommandItem=d,exports.CommandItemLabel=f,exports.CommandList=c;
1
+ const e=require("../lib/cn.cjs"),t=require("./Dialog.cjs"),n=require("./Input.cjs"),r=require("./OptionList.cjs");let i=require("react/jsx-runtime");function a({open:n,onOpenChange:r,title:a,titleVisible:o=!1,className:s,children:c,width:l=`lg`,...u}){return/* @__PURE__ */ (0,i.jsx)(t.Dialog,{open:n,onOpenChange:r,children:/* @__PURE__ */ (0,i.jsxs)(t.DialogContent,{"data-slot":`command-dialog`,width:l,className:e.cn(`max-h-[70vh]`,s),...u,children:[/* @__PURE__ */ (0,i.jsx)(t.DialogTitle,{className:o?void 0:`sr-only`,children:a}),c]})})}function o({className:t,...n}){return/* @__PURE__ */ (0,i.jsx)(`div`,{"data-slot":`command-header`,className:e.cn(`flex shrink-0 items-center gap-2 border-b border-doom-border px-3 py-2.5`,t),...n})}function s({className:t,...r}){return/* @__PURE__ */ (0,i.jsx)(n.Input,{"data-slot":`command-input`,variant:`bare`,autoFocus:!0,autoComplete:`off`,className:e.cn(`flex-1`,t),...r})}function c({className:t,...n}){return/* @__PURE__ */ (0,i.jsx)(`div`,{role:`listbox`,"data-slot":`command-list`,className:e.cn(`flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-1.5`,t),...n})}function l({className:t,...n}){return/* @__PURE__ */ (0,i.jsx)(`div`,{"data-slot":`command-group`,className:e.cn(`flex flex-col gap-0.5`,t),...n})}function u({className:t,...n}){return/* @__PURE__ */ (0,i.jsx)(`div`,{"data-slot":`command-group-label`,className:e.cn(`px-2 pt-2 pb-1 text-2xs font-bold tracking-wider text-doom-faint uppercase`,t),...n})}function d({density:e=`compact`,...t}){return/* @__PURE__ */ (0,i.jsx)(r.OptionRow,{"data-slot":`command-item`,density:e,...t})}function f(e){return/* @__PURE__ */ (0,i.jsx)(r.OptionLabel,{"data-slot":`command-item-label`,density:`compact`,...e})}function p({className:t,...n}){return/* @__PURE__ */ (0,i.jsx)(`div`,{"data-slot":`command-empty`,className:e.cn(`px-2 py-6 text-center text-sm text-doom-faint`,t),...n})}function m({className:t,...n}){return/* @__PURE__ */ (0,i.jsx)(`div`,{"data-slot":`command-footer`,className:e.cn(`flex min-h-[30px] shrink-0 items-center justify-between gap-3 border-t border-doom-border-soft bg-doom-deep px-3 text-2xs text-doom-faint`,t),...n})}exports.CommandDialog=a,exports.CommandEmpty=p,exports.CommandFooter=m,exports.CommandGroup=l,exports.CommandGroupLabel=u,exports.CommandHeader=o,exports.CommandInput=s,exports.CommandItem=d,exports.CommandItemLabel=f,exports.CommandList=c;
2
2
  //# sourceMappingURL=Command.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Command.cjs","names":["Dialog","DialogContent","cn","DialogTitle","Input","OptionRow","OptionLabel"],"sources":["../../../src/components/Command.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\nimport { cn } from '../lib/cn.ts';\nimport { Dialog, DialogContent, type DialogContentProps, DialogTitle } from './Dialog.tsx';\nimport { Input, type InputProps } from './Input.tsx';\nimport { OptionLabel, OptionRow, type OptionRowProps } from './OptionList.tsx';\n\n/**\n * The command palette's frame, its search strip, its rows, and its hint.\n *\n * It has no Radix counterpart and it deliberately does no filtering: the\n * surface that opens a palette already knows how to rank its own commands,\n * and a matcher baked in here would be a second, worse one. Built on Dialog,\n * Input, and the option row so a palette and a select popover cannot drift\n * apart, rather than on a new dependency.\n */\n\nexport interface CommandDialogProps extends Omit<DialogContentProps, 'title'> {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** Names the dialog for assistive tech; visually hidden unless the palette draws its own heading. */\n title: ReactNode;\n titleVisible?: boolean;\n}\n\nexport function CommandDialog({\n open,\n onOpenChange,\n title,\n titleVisible = false,\n className,\n children,\n width = 'lg',\n ...props\n}: CommandDialogProps) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent data-slot=\"command-dialog\" width={width} className={cn('max-h-[70vh]', className)} {...props}>\n <DialogTitle className={titleVisible ? undefined : 'sr-only'}>{title}</DialogTitle>\n {children}\n </DialogContent>\n </Dialog>\n );\n}\n\n/** The strip the search field sits in. */\nexport function CommandHeader({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-header\"\n className={cn('flex shrink-0 items-center gap-2 border-b border-doom-border px-3 py-2.5', className)}\n {...props}\n />\n );\n}\n\n/** The search field: bare, because the header already draws the surface. */\nexport function CommandInput({ className, ...props }: InputProps) {\n return (\n <Input\n data-slot=\"command-input\"\n variant=\"bare\"\n autoFocus\n autoComplete=\"off\"\n className={cn('flex-1', className)}\n {...props}\n />\n );\n}\n\n/** The scrolling body. It is the listbox, so its rows are the options. */\nexport function CommandList({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n role=\"listbox\"\n data-slot=\"command-list\"\n className={cn('flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-1.5', className)}\n {...props}\n />\n );\n}\n\n/** A labelled run of rows. */\nexport function CommandGroup({ className, ...props }: ComponentProps<'div'>) {\n return <div data-slot=\"command-group\" className={cn('flex flex-col gap-0.5', className)} {...props} />;\n}\n\nexport function CommandGroupLabel({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-group-label\"\n className={cn('px-2 pt-2 pb-1 text-[8px] font-bold tracking-[0.14em] text-doom-faint uppercase', className)}\n {...props}\n />\n );\n}\n\n/** One command. Compact by default, since a palette shows many at once. */\nexport function CommandItem({ density = 'compact', ...props }: OptionRowProps) {\n return <OptionRow data-slot=\"command-item\" density={density} {...props} />;\n}\n\n/** A command's name, taking the width the row has left. */\nexport function CommandItemLabel(props: ComponentProps<'span'>) {\n return <OptionLabel data-slot=\"command-item-label\" density=\"compact\" {...props} />;\n}\n\n/** What the palette says when nothing matches. */\nexport function CommandEmpty({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-empty\"\n className={cn('px-2 py-6 text-center text-[11px] text-doom-faint', className)}\n {...props}\n />\n );\n}\n\n/** The hint strip along the bottom: what the keys do. */\nexport function CommandFooter({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-footer\"\n className={cn(\n 'flex min-h-[30px] shrink-0 items-center justify-between gap-3 border-t border-doom-border-soft bg-doom-deep px-3 text-[9px] text-doom-faint',\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":"qJAwBA,SAAgB,EAAc,CAC5B,OACA,eACA,QACA,eAAe,GACf,YACA,WACA,QAAQ,KACR,GAAG,GACkB,CACrB,OACE,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAD,CAAc,OAAoB,eAChC,UAAA,EAAA,EAAA,KAAA,CAACC,EAAAA,cAAD,CAAe,YAAU,iBAAwB,QAAO,UAAWC,EAAAA,GAAG,eAAgB,CAAS,EAAG,GAAI,EAAtG,SAAA,EACE,EAAA,EAAA,IAAA,CAACC,EAAAA,YAAD,CAAa,UAAW,EAAe,IAAA,GAAY,UAAY,SAAA,CAAmB,CAAA,EACjF,CACY,GACT,CAAA,CAEZ,CAGA,SAAgB,EAAc,CAAE,YAAW,GAAG,GAAgC,CAC5E,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CACE,YAAU,iBACV,UAAWD,E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,CAEL,CAGA,SAAgB,EAAc,CAAE,YAAW,GAAG,GAAgC,CAC5E,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CACE,YAAU,iBACV,UAAWA,EAAAA,GACT,8IACA,CACF,EACA,GAAI,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"Command.cjs","names":["Dialog","DialogContent","cn","DialogTitle","Input","OptionRow","OptionLabel"],"sources":["../../../src/components/Command.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { Dialog, DialogContent, type DialogContentProps, DialogTitle } from './Dialog';\nimport { Input, type InputProps } from './Input';\nimport { OptionLabel, OptionRow, type OptionRowProps } from './OptionList';\n\n/**\n * The command palette's frame, its search strip, its rows, and its hint.\n *\n * It has no Radix counterpart and it deliberately does no filtering: the\n * surface that opens a palette already knows how to rank its own commands,\n * and a matcher baked in here would be a second, worse one. Built on Dialog,\n * Input, and the option row so a palette and a select popover cannot drift\n * apart, rather than on a new dependency.\n */\n\nexport interface CommandDialogProps extends Omit<DialogContentProps, 'title'> {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** Names the dialog for assistive tech; visually hidden unless the palette draws its own heading. */\n title: ReactNode;\n titleVisible?: boolean;\n}\n\nexport function CommandDialog({\n open,\n onOpenChange,\n title,\n titleVisible = false,\n className,\n children,\n width = 'lg',\n ...props\n}: CommandDialogProps) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent data-slot=\"command-dialog\" width={width} className={cn('max-h-[70vh]', className)} {...props}>\n <DialogTitle className={titleVisible ? undefined : 'sr-only'}>{title}</DialogTitle>\n {children}\n </DialogContent>\n </Dialog>\n );\n}\n\n/** The strip the search field sits in. */\nexport function CommandHeader({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-header\"\n className={cn('flex shrink-0 items-center gap-2 border-b border-doom-border px-3 py-2.5', className)}\n {...props}\n />\n );\n}\n\n/** The search field: bare, because the header already draws the surface. */\nexport function CommandInput({ className, ...props }: InputProps) {\n return (\n <Input\n data-slot=\"command-input\"\n variant=\"bare\"\n autoFocus\n autoComplete=\"off\"\n className={cn('flex-1', className)}\n {...props}\n />\n );\n}\n\n/** The scrolling body. It is the listbox, so its rows are the options. */\nexport function CommandList({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n role=\"listbox\"\n data-slot=\"command-list\"\n className={cn('flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-1.5', className)}\n {...props}\n />\n );\n}\n\n/** A labelled run of rows. */\nexport function CommandGroup({ className, ...props }: ComponentProps<'div'>) {\n return <div data-slot=\"command-group\" className={cn('flex flex-col gap-0.5', className)} {...props} />;\n}\n\nexport function CommandGroupLabel({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-group-label\"\n className={cn('px-2 pt-2 pb-1 text-2xs font-bold tracking-wider text-doom-faint uppercase', className)}\n {...props}\n />\n );\n}\n\n/** One command. Compact by default, since a palette shows many at once. */\nexport function CommandItem({ density = 'compact', ...props }: OptionRowProps) {\n return <OptionRow data-slot=\"command-item\" density={density} {...props} />;\n}\n\n/** A command's name, taking the width the row has left. */\nexport function CommandItemLabel(props: ComponentProps<'span'>) {\n return <OptionLabel data-slot=\"command-item-label\" density=\"compact\" {...props} />;\n}\n\n/** What the palette says when nothing matches. */\nexport function CommandEmpty({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-empty\"\n className={cn('px-2 py-6 text-center text-sm text-doom-faint', className)}\n {...props}\n />\n );\n}\n\n/** The hint strip along the bottom: what the keys do. */\nexport function CommandFooter({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-footer\"\n className={cn(\n 'flex min-h-[30px] shrink-0 items-center justify-between gap-3 border-t border-doom-border-soft bg-doom-deep px-3 text-2xs text-doom-faint',\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":"qJAyBA,SAAgB,EAAc,CAC5B,OACA,eACA,QACA,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D,CACE,YAAU,sBACV,UAAWA,EAAAA,GAAG,6EAA8E,CAAS,EACrG,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAY,CAAE,UAAU,UAAW,GAAG,GAAyB,CAC7E,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACG,EAAAA,UAAD,CAAW,YAAU,eAAwB,UAAS,GAAI,CAAQ,CAAA,CAC3E,CAGA,SAAgB,EAAiB,EAA+B,CAC9D,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,YAAD,CAAa,YAAU,qBAAqB,QAAQ,UAAU,GAAI,CAAQ,CAAA,CACnF,CAGA,SAAgB,EAAa,CAAE,YAAW,GAAG,GAAgC,CAC3E,MACE,iBAAA,EAAA,EAAA,IAAA,CAAC,MAAD,CACE,YAAU,gBACV,UAAWJ,EAAAA,GAAG,gDAAiD,CAAS,EACxE,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAc,CAAE,YAAW,GAAG,GAAgC,CAC5E,MACE,iBAAA,EAAA,EAAA,IAAA,CAAC,MAAD,CACE,YAAU,iBACV,UAAWA,EAAAA,GACT,4IACA,CACF,EACA,GAAI,CACL,CAAA,CAEL"}
@@ -12,31 +12,30 @@ import { ComponentProps, ReactNode } from "react";
12
12
  * Input, and the option row so a palette and a select popover cannot drift
13
13
  * apart, rather than on a new dependency.
14
14
  */
15
- interface CommandDialogProps extends Omit<DialogContentProps, 'title'> {
15
+ export interface CommandDialogProps extends Omit<DialogContentProps, 'title'> {
16
16
  open: boolean;
17
17
  onOpenChange: (open: boolean) => void;
18
18
  /** Names the dialog for assistive tech; visually hidden unless the palette draws its own heading. */
19
19
  title: ReactNode;
20
20
  titleVisible?: boolean;
21
21
  }
22
- declare function CommandDialog({ open, onOpenChange, title, titleVisible, className, children, width, ...props }: CommandDialogProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function CommandDialog({ open, onOpenChange, title, titleVisible, className, children, width, ...props }: CommandDialogProps): import("react").JSX.Element;
23
23
  /** The strip the search field sits in. */
24
- declare function CommandHeader({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
24
+ export declare function CommandHeader({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
25
25
  /** The search field: bare, because the header already draws the surface. */
26
- declare function CommandInput({ className, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
26
+ export declare function CommandInput({ className, ...props }: InputProps): import("react").JSX.Element;
27
27
  /** The scrolling body. It is the listbox, so its rows are the options. */
28
- declare function CommandList({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
28
+ export declare function CommandList({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
29
29
  /** A labelled run of rows. */
30
- declare function CommandGroup({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
31
- declare function CommandGroupLabel({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
30
+ export declare function CommandGroup({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
31
+ export declare function CommandGroupLabel({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
32
32
  /** One command. Compact by default, since a palette shows many at once. */
33
- declare function CommandItem({ density, ...props }: OptionRowProps): import("react/jsx-runtime").JSX.Element;
33
+ export declare function CommandItem({ density, ...props }: OptionRowProps): import("react").JSX.Element;
34
34
  /** A command's name, taking the width the row has left. */
35
- declare function CommandItemLabel(props: ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
35
+ export declare function CommandItemLabel(props: ComponentProps<'span'>): import("react").JSX.Element;
36
36
  /** What the palette says when nothing matches. */
37
- declare function CommandEmpty({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
37
+ export declare function CommandEmpty({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
38
38
  /** The hint strip along the bottom: what the keys do. */
39
- declare function CommandFooter({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
39
+ export declare function CommandFooter({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
40
40
  //#endregion
41
- export { CommandDialog, CommandDialogProps, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandHeader, CommandInput, CommandItem, CommandItemLabel, CommandList };
42
41
  //# sourceMappingURL=Command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Command.d.mts","names":[],"sources":["../../../src/components/Command.tsx"],"mappings":";;;;;;;;;;;;;;UAgBiB,2BAA2B,KAAK;EAC/C;EACA,eAAe;;EAEf,OAAO;EACP;;iBAGc,gBACd,MACA,cACA,OACA,cACA,WACA,UACA,UACG,SACF,iDAAkB,IAAA;;iBAYL,gBAAgB,cAAc,SAAS,oDAAqB,IAAA;;iBAW5D,eAAe,cAAc,SAAS,yCAAU,IAAA;;iBAchD,cAAc,cAAc,SAAS,oDAAqB,IAAA;;iBAY1D,eAAe,cAAc,SAAS,oDAAqB,IAAA;iBAI3D,oBAAoB,cAAc,SAAS,oDAAqB,IAAA;;iBAWhE,cAAc,YAAwB,SAAS,6CAAc,IAAA;;iBAK7D,iBAAiB,OAAO,qDAAsB,IAAA;;iBAK9C,eAAe,cAAc,SAAS,oDAAqB,IAAA;;iBAW3D,gBAAgB,cAAc,SAAS,oDAAqB,IAAA"}
1
+ {"version":3,"file":"Command.d.mts","names":[],"sources":["../../../src/components/Command.tsx"],"mappings":";;;;;;;;;;;;;;iBAiBiB,2BAA2B,KAAK;EAC/C;EACA,eAAe;;EAEf,OAAO;EACP;;wBAGc,gBACd,MACA,cACA,OACA,cACA,WACA,UACA,UACG,SACF,qCAAkB,IAAA;;wBAYL,gBAAgB,cAAc,SAAS,wCAAqB,IAAA;;wBAW5D,eAAe,cAAc,SAAS,6BAAU,IAAA;;wBAchD,cAAc,cAAc,SAAS,wCAAqB,IAAA;;wBAY1D,eAAe,cAAc,SAAS,wCAAqB,IAAA;wBAI3D,oBAAoB,cAAc,SAAS,wCAAqB,IAAA;;wBAWhE,cAAc,YAAwB,SAAS,iCAAc,IAAA;;wBAK7D,iBAAiB,OAAO,yCAAsB,IAAA;;wBAK9C,eAAe,cAAc,SAAS,wCAAqB,IAAA;;wBAW3D,gBAAgB,cAAc,SAAS,wCAAqB,IAAA"}
@@ -1,2 +1,2 @@
1
- import{cn as e}from"../lib/cn.mjs";import{Dialog as t,DialogContent as n,DialogTitle as r}from"./Dialog.mjs";import{Input as i}from"./Input.mjs";import{OptionLabel as a,OptionRow as o}from"./OptionList.mjs";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l({open:i,onOpenChange:a,title:o,titleVisible:l=!1,className:u,children:d,width:f=`lg`,...p}){return s(t,{open:i,onOpenChange:a,children:c(n,{"data-slot":`command-dialog`,width:f,className:e(`max-h-[70vh]`,u),...p,children:[s(r,{className:l?void 0:`sr-only`,children:o}),d]})})}function u({className:t,...n}){return s(`div`,{"data-slot":`command-header`,className:e(`flex shrink-0 items-center gap-2 border-b border-doom-border px-3 py-2.5`,t),...n})}function d({className:t,...n}){return s(i,{"data-slot":`command-input`,variant:`bare`,autoFocus:!0,autoComplete:`off`,className:e(`flex-1`,t),...n})}function f({className:t,...n}){return s(`div`,{role:`listbox`,"data-slot":`command-list`,className:e(`flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-1.5`,t),...n})}function p({className:t,...n}){return s(`div`,{"data-slot":`command-group`,className:e(`flex flex-col gap-0.5`,t),...n})}function m({className:t,...n}){return s(`div`,{"data-slot":`command-group-label`,className:e(`px-2 pt-2 pb-1 text-[8px] font-bold tracking-[0.14em] text-doom-faint uppercase`,t),...n})}function h({density:e=`compact`,...t}){return s(o,{"data-slot":`command-item`,density:e,...t})}function g(e){return s(a,{"data-slot":`command-item-label`,density:`compact`,...e})}function _({className:t,...n}){return s(`div`,{"data-slot":`command-empty`,className:e(`px-2 py-6 text-center text-[11px] text-doom-faint`,t),...n})}function v({className:t,...n}){return s(`div`,{"data-slot":`command-footer`,className:e(`flex min-h-[30px] shrink-0 items-center justify-between gap-3 border-t border-doom-border-soft bg-doom-deep px-3 text-[9px] text-doom-faint`,t),...n})}export{l as CommandDialog,_ as CommandEmpty,v as CommandFooter,p as CommandGroup,m as CommandGroupLabel,u as CommandHeader,d as CommandInput,h as CommandItem,g as CommandItemLabel,f as CommandList};
1
+ import{cn as e}from"../lib/cn.mjs";import{Dialog as t,DialogContent as n,DialogTitle as r}from"./Dialog.mjs";import{Input as i}from"./Input.mjs";import{OptionLabel as a,OptionRow as o}from"./OptionList.mjs";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l({open:i,onOpenChange:a,title:o,titleVisible:l=!1,className:u,children:d,width:f=`lg`,...p}){return/* @__PURE__ */ s(t,{open:i,onOpenChange:a,children:/* @__PURE__ */ c(n,{"data-slot":`command-dialog`,width:f,className:e(`max-h-[70vh]`,u),...p,children:[/* @__PURE__ */ s(r,{className:l?void 0:`sr-only`,children:o}),d]})})}function u({className:t,...n}){return/* @__PURE__ */ s(`div`,{"data-slot":`command-header`,className:e(`flex shrink-0 items-center gap-2 border-b border-doom-border px-3 py-2.5`,t),...n})}function d({className:t,...n}){return/* @__PURE__ */ s(i,{"data-slot":`command-input`,variant:`bare`,autoFocus:!0,autoComplete:`off`,className:e(`flex-1`,t),...n})}function f({className:t,...n}){return/* @__PURE__ */ s(`div`,{role:`listbox`,"data-slot":`command-list`,className:e(`flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-1.5`,t),...n})}function p({className:t,...n}){return/* @__PURE__ */ s(`div`,{"data-slot":`command-group`,className:e(`flex flex-col gap-0.5`,t),...n})}function m({className:t,...n}){return/* @__PURE__ */ s(`div`,{"data-slot":`command-group-label`,className:e(`px-2 pt-2 pb-1 text-2xs font-bold tracking-wider text-doom-faint uppercase`,t),...n})}function h({density:e=`compact`,...t}){return/* @__PURE__ */ s(o,{"data-slot":`command-item`,density:e,...t})}function g(e){return/* @__PURE__ */ s(a,{"data-slot":`command-item-label`,density:`compact`,...e})}function _({className:t,...n}){return/* @__PURE__ */ s(`div`,{"data-slot":`command-empty`,className:e(`px-2 py-6 text-center text-sm text-doom-faint`,t),...n})}function v({className:t,...n}){return/* @__PURE__ */ s(`div`,{"data-slot":`command-footer`,className:e(`flex min-h-[30px] shrink-0 items-center justify-between gap-3 border-t border-doom-border-soft bg-doom-deep px-3 text-2xs text-doom-faint`,t),...n})}export{l as CommandDialog,_ as CommandEmpty,v as CommandFooter,p as CommandGroup,m as CommandGroupLabel,u as CommandHeader,d as CommandInput,h as CommandItem,g as CommandItemLabel,f as CommandList};
2
2
  //# sourceMappingURL=Command.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Command.mjs","names":[],"sources":["../../../src/components/Command.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\nimport { cn } from '../lib/cn.ts';\nimport { Dialog, DialogContent, type DialogContentProps, DialogTitle } from './Dialog.tsx';\nimport { Input, type InputProps } from './Input.tsx';\nimport { OptionLabel, OptionRow, type OptionRowProps } from './OptionList.tsx';\n\n/**\n * The command palette's frame, its search strip, its rows, and its hint.\n *\n * It has no Radix counterpart and it deliberately does no filtering: the\n * surface that opens a palette already knows how to rank its own commands,\n * and a matcher baked in here would be a second, worse one. Built on Dialog,\n * Input, and the option row so a palette and a select popover cannot drift\n * apart, rather than on a new dependency.\n */\n\nexport interface CommandDialogProps extends Omit<DialogContentProps, 'title'> {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** Names the dialog for assistive tech; visually hidden unless the palette draws its own heading. */\n title: ReactNode;\n titleVisible?: boolean;\n}\n\nexport function CommandDialog({\n open,\n onOpenChange,\n title,\n titleVisible = false,\n className,\n children,\n width = 'lg',\n ...props\n}: CommandDialogProps) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent data-slot=\"command-dialog\" width={width} className={cn('max-h-[70vh]', className)} {...props}>\n <DialogTitle className={titleVisible ? undefined : 'sr-only'}>{title}</DialogTitle>\n {children}\n </DialogContent>\n </Dialog>\n );\n}\n\n/** The strip the search field sits in. */\nexport function CommandHeader({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-header\"\n className={cn('flex shrink-0 items-center gap-2 border-b border-doom-border px-3 py-2.5', className)}\n {...props}\n />\n );\n}\n\n/** The search field: bare, because the header already draws the surface. */\nexport function CommandInput({ className, ...props }: InputProps) {\n return (\n <Input\n data-slot=\"command-input\"\n variant=\"bare\"\n autoFocus\n autoComplete=\"off\"\n className={cn('flex-1', className)}\n {...props}\n />\n );\n}\n\n/** The scrolling body. It is the listbox, so its rows are the options. */\nexport function CommandList({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n role=\"listbox\"\n data-slot=\"command-list\"\n className={cn('flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-1.5', className)}\n {...props}\n />\n );\n}\n\n/** A labelled run of rows. */\nexport function CommandGroup({ className, ...props }: ComponentProps<'div'>) {\n return <div data-slot=\"command-group\" className={cn('flex flex-col gap-0.5', className)} {...props} />;\n}\n\nexport function CommandGroupLabel({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-group-label\"\n className={cn('px-2 pt-2 pb-1 text-[8px] font-bold tracking-[0.14em] text-doom-faint uppercase', className)}\n {...props}\n />\n );\n}\n\n/** One command. Compact by default, since a palette shows many at once. */\nexport function CommandItem({ density = 'compact', ...props }: OptionRowProps) {\n return <OptionRow data-slot=\"command-item\" density={density} {...props} />;\n}\n\n/** A command's name, taking the width the row has left. */\nexport function CommandItemLabel(props: ComponentProps<'span'>) {\n return <OptionLabel data-slot=\"command-item-label\" density=\"compact\" {...props} />;\n}\n\n/** What the palette says when nothing matches. */\nexport function CommandEmpty({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-empty\"\n className={cn('px-2 py-6 text-center text-[11px] text-doom-faint', className)}\n {...props}\n />\n );\n}\n\n/** The hint strip along the bottom: what the keys do. */\nexport function CommandFooter({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-footer\"\n className={cn(\n 'flex min-h-[30px] shrink-0 items-center justify-between gap-3 border-t border-doom-border-soft bg-doom-deep px-3 text-[9px] text-doom-faint',\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":"iQAwBA,SAAgB,EAAc,CAC5B,OACA,eACA,QACA,eAAe,GACf,YACA,WACA,QAAQ,KACR,GAAG,GACkB,CACrB,OACE,EAAC,EAAD,CAAc,OAAoB,eAChC,SAAA,EAAC,EAAD,CAAe,YAAU,iBAAwB,QAAO,UAAW,EAAG,eAAgB,CAAS,EAAG,GAAI,EAAtG,SAAA,CACE,EAAC,EAAD,CAAa,UAAW,EAAe,IAAA,GAAY,UAAY,SAAA,CAAmB,CAAA,EACjF,CACY,GACT,CAAA,CAEZ,CAGA,SAAgB,EAAc,CAAE,YAAW,GAAG,GAAgC,CAC5E,OACE,EAAC,MAAD,CACE,YAAU,iBACV,UAAW,EAAG,2EAA4E,CAAS,EACnG,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAa,CAAE,YAAW,GAAG,GAAqB,CAChE,OACE,EAAC,EAAD,CACE,YAAU,gBACV,QAAQ,OACR,UAAA,GACA,aAAa,MACb,UAAW,EAAG,SAAU,CAAS,EACjC,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAY,CAAE,YAAW,GAAG,GAAgC,CAC1E,OACE,EAAC,MAAD,CACE,KAAK,UACL,YAAU,eACV,UAAW,EAAG,6DAA8D,CAAS,EACrF,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAa,CAAE,YAAW,GAAG,GAAgC,CAC3E,OAAO,EAAC,MAAD,CAAK,YAAU,gBAAgB,UAAW,EAAG,wBAAyB,CAAS,EAAG,GAAI,CAAQ,CAAA,CACvG,CAEA,SAAgB,EAAkB,CAAE,YAAW,GAAG,GAAgC,CAChF,OACE,EAAC,MAAD,CACE,YAAU,sBACV,UAAW,EAAG,kFAAmF,CAAS,EAC1G,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAY,CAAE,UAAU,UAAW,GAAG,GAAyB,CAC7E,OAAO,EAAC,EAAD,CAAW,YAAU,eAAwB,UAAS,GAAI,CAAQ,CAAA,CAC3E,CAGA,SAAgB,EAAiB,EAA+B,CAC9D,OAAO,EAAC,EAAD,CAAa,YAAU,qBAAqB,QAAQ,UAAU,GAAI,CAAQ,CAAA,CACnF,CAGA,SAAgB,EAAa,CAAE,YAAW,GAAG,GAAgC,CAC3E,OACE,EAAC,MAAD,CACE,YAAU,gBACV,UAAW,EAAG,oDAAqD,CAAS,EAC5E,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAc,CAAE,YAAW,GAAG,GAAgC,CAC5E,OACE,EAAC,MAAD,CACE,YAAU,iBACV,UAAW,EACT,8IACA,CACF,EACA,GAAI,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"Command.mjs","names":[],"sources":["../../../src/components/Command.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { Dialog, DialogContent, type DialogContentProps, DialogTitle } from './Dialog';\nimport { Input, type InputProps } from './Input';\nimport { OptionLabel, OptionRow, type OptionRowProps } from './OptionList';\n\n/**\n * The command palette's frame, its search strip, its rows, and its hint.\n *\n * It has no Radix counterpart and it deliberately does no filtering: the\n * surface that opens a palette already knows how to rank its own commands,\n * and a matcher baked in here would be a second, worse one. Built on Dialog,\n * Input, and the option row so a palette and a select popover cannot drift\n * apart, rather than on a new dependency.\n */\n\nexport interface CommandDialogProps extends Omit<DialogContentProps, 'title'> {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** Names the dialog for assistive tech; visually hidden unless the palette draws its own heading. */\n title: ReactNode;\n titleVisible?: boolean;\n}\n\nexport function CommandDialog({\n open,\n onOpenChange,\n title,\n titleVisible = false,\n className,\n children,\n width = 'lg',\n ...props\n}: CommandDialogProps) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent data-slot=\"command-dialog\" width={width} className={cn('max-h-[70vh]', className)} {...props}>\n <DialogTitle className={titleVisible ? undefined : 'sr-only'}>{title}</DialogTitle>\n {children}\n </DialogContent>\n </Dialog>\n );\n}\n\n/** The strip the search field sits in. */\nexport function CommandHeader({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-header\"\n className={cn('flex shrink-0 items-center gap-2 border-b border-doom-border px-3 py-2.5', className)}\n {...props}\n />\n );\n}\n\n/** The search field: bare, because the header already draws the surface. */\nexport function CommandInput({ className, ...props }: InputProps) {\n return (\n <Input\n data-slot=\"command-input\"\n variant=\"bare\"\n autoFocus\n autoComplete=\"off\"\n className={cn('flex-1', className)}\n {...props}\n />\n );\n}\n\n/** The scrolling body. It is the listbox, so its rows are the options. */\nexport function CommandList({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n role=\"listbox\"\n data-slot=\"command-list\"\n className={cn('flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-1.5', className)}\n {...props}\n />\n );\n}\n\n/** A labelled run of rows. */\nexport function CommandGroup({ className, ...props }: ComponentProps<'div'>) {\n return <div data-slot=\"command-group\" className={cn('flex flex-col gap-0.5', className)} {...props} />;\n}\n\nexport function CommandGroupLabel({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-group-label\"\n className={cn('px-2 pt-2 pb-1 text-2xs font-bold tracking-wider text-doom-faint uppercase', className)}\n {...props}\n />\n );\n}\n\n/** One command. Compact by default, since a palette shows many at once. */\nexport function CommandItem({ density = 'compact', ...props }: OptionRowProps) {\n return <OptionRow data-slot=\"command-item\" density={density} {...props} />;\n}\n\n/** A command's name, taking the width the row has left. */\nexport function CommandItemLabel(props: ComponentProps<'span'>) {\n return <OptionLabel data-slot=\"command-item-label\" density=\"compact\" {...props} />;\n}\n\n/** What the palette says when nothing matches. */\nexport function CommandEmpty({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-empty\"\n className={cn('px-2 py-6 text-center text-sm text-doom-faint', className)}\n {...props}\n />\n );\n}\n\n/** The hint strip along the bottom: what the keys do. */\nexport function CommandFooter({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"command-footer\"\n className={cn(\n 'flex min-h-[30px] shrink-0 items-center justify-between gap-3 border-t border-doom-border-soft bg-doom-deep px-3 text-2xs text-doom-faint',\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":"iQAyBA,SAAgB,EAAc,CAC5B,OACA,eACA,QACA,eAAe,GACf,YACA,WACA,QAAQ,KACR,GAAG,GACkB,CACrB,MACE,kBAAC,EAAD,CAAc,OAAoB,eAChC,SAAA,kBAAC,EAAD,CAAe,YAAU,iBAAwB,QAAO,UAAW,EAAG,eAAgB,CAAS,EAAG,GAAI,EAAtG,SAAA,CACE,kBAAC,EAAD,CAAa,UAAW,EAAe,IAAA,GAAY,UAAY,SAAA,CAAmB,CAAA,EACjF,CACY,GACT,CAAA,CAEZ,CAGA,SAAgB,EAAc,CAAE,YAAW,GAAG,GAAgC,CAC5E,MACE,kBAAC,MAAD,CACE,YAAU,iBACV,UAAW,EAAG,2EAA4E,CAAS,EACnG,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAa,CAAE,YAAW,GAAG,GAAqB,CAChE,MACE,kBAAC,EAAD,CACE,YAAU,gBACV,QAAQ,OACR,UAAA,GACA,aAAa,MACb,UAAW,EAAG,SAAU,CAAS,EACjC,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAY,CAAE,YAAW,GAAG,GAAgC,CAC1E,MACE,kBAAC,MAAD,CACE,KAAK,UACL,YAAU,eACV,UAAW,EAAG,6DAA8D,CAAS,EACrF,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAa,CAAE,YAAW,GAAG,GAAgC,CAC3E,MAAO,kBAAC,MAAD,CAAK,YAAU,gBAAgB,UAAW,EAAG,wBAAyB,CAAS,EAAG,GAAI,CAAQ,CAAA,CACvG,CAEA,SAAgB,EAAkB,CAAE,YAAW,GAAG,GAAgC,CAChF,MACE,kBAAC,MAAD,CACE,YAAU,sBACV,UAAW,EAAG,6EAA8E,CAAS,EACrG,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAY,CAAE,UAAU,UAAW,GAAG,GAAyB,CAC7E,MAAO,kBAAC,EAAD,CAAW,YAAU,eAAwB,UAAS,GAAI,CAAQ,CAAA,CAC3E,CAGA,SAAgB,EAAiB,EAA+B,CAC9D,MAAO,kBAAC,EAAD,CAAa,YAAU,qBAAqB,QAAQ,UAAU,GAAI,CAAQ,CAAA,CACnF,CAGA,SAAgB,EAAa,CAAE,YAAW,GAAG,GAAgC,CAC3E,MACE,kBAAC,MAAD,CACE,YAAU,gBACV,UAAW,EAAG,gDAAiD,CAAS,EACxE,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAc,CAAE,YAAW,GAAG,GAAgC,CAC5E,MACE,kBAAC,MAAD,CACE,YAAU,iBACV,UAAW,EACT,4IACA,CACF,EACA,GAAI,CACL,CAAA,CAEL"}
@@ -0,0 +1,2 @@
1
+ require("../icons/icons.cjs");const e=require("../lib/cn.cjs"),t=require("./Button.cjs");let n=require("react/jsx-runtime"),r=require("react"),i=require("lucide-react");const a={idle:`copy`,copied:`copied`,failed:`copying was blocked by the browser`};function o({text:o,className:s}){let[c,l]=(0,r.useState)(`idle`);(0,r.useEffect)(()=>{if(c===`idle`)return;let e=setTimeout(()=>l(`idle`),1500);return()=>clearTimeout(e)},[c]);let u=(0,r.useCallback)(()=>{navigator.clipboard.writeText(o).then(()=>l(`copied`),()=>l(`failed`))},[o]),d=a[c];return/* @__PURE__ */ (0,n.jsx)(t.Button,{type:`button`,variant:`ghost`,size:`icon`,"data-testid":`copy-button`,"data-state":c,title:d,"aria-label":d,onClick:u,className:e.cn(`opacity-60 hover:opacity-100`,s),children:c===`copied`?/* @__PURE__ */ (0,n.jsx)(i.Check,{className:`size-3 text-doom-green`}):/* @__PURE__ */ (0,n.jsx)(i.Copy,{className:`size-3`})})}exports.CopyButton=o;
2
+ //# sourceMappingURL=CopyButton.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyButton.cjs","names":["useState","useCallback","Button","cn","CheckIcon","CopyIcon"],"sources":["../../../src/components/CopyButton.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport { CheckIcon, CopyIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport { Button } from './Button';\n\n/**\n * Puts a piece of text on the clipboard and says so.\n *\n * DESIGN PATTERNS:\n * - Always visible, dimmed. Half the cockpit's surfaces are touched rather\n * than pointed at, and a control revealed by hover does not exist there.\n * - A refused clipboard is a state, not a crash: the label says the browser\n * blocked it and the text is still there to select by hand.\n */\n\n/** How long the control stays acknowledged before returning to its icon. */\nconst FEEDBACK_MS = 1500;\n\ntype CopyState = 'idle' | 'copied' | 'failed';\n\nconst LABELS: Readonly<Record<CopyState, string>> = {\n idle: 'copy',\n copied: 'copied',\n failed: 'copying was blocked by the browser',\n};\n\nexport interface CopyButtonProps {\n /** What lands on the clipboard. */\n text: string;\n className?: string | undefined;\n}\n\nexport function CopyButton({ text, className }: CopyButtonProps) {\n const [state, setState] = useState<CopyState>('idle');\n\n useEffect(() => {\n if (state === 'idle') return;\n const timer = setTimeout(() => setState('idle'), FEEDBACK_MS);\n return () => clearTimeout(timer);\n }, [state]);\n\n const copy = useCallback(() => {\n void navigator.clipboard.writeText(text).then(\n () => setState('copied'),\n () => setState('failed'),\n );\n }, [text]);\n\n const label = LABELS[state];\n return (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n data-testid=\"copy-button\"\n data-state={state}\n title={label}\n aria-label={label}\n onClick={copy}\n className={cn('opacity-60 hover:opacity-100', className)}\n >\n {state === 'copied' ? <CheckIcon className=\"size-3 text-doom-green\" /> : <CopyIcon className=\"size-3\" />}\n </Button>\n );\n}\n"],"mappings":"yKAiBA,MAIM,EAA8C,CAClD,KAAM,OACN,OAAQ,SACR,OAAQ,oCACV,EAQA,SAAgB,EAAW,CAAE,OAAM,aAA8B,CAC/D,GAAM,CAAC,EAAO,IAAA,EAAYA,EAAAA,SAAAA,CAAoB,MAAM,GAEpD,EAAA,EAAA,UAAA,KAAgB,CACd,GAAI,IAAU,OAAQ,OACtB,IAAM,EAAQ,eAAiB,EAAS,MAAM,EAAG,IAAW,EAC5D,UAAa,aAAa,CAAK,CACjC,EAAG,CAAC,CAAK,CAAC,EAEV,IAAM,GAAA,EAAOC,EAAAA,YAAAA,KAAkB,CAC7B,UAAe,UAAU,UAAU,CAAI,CAAC,CAAC,SACjC,EAAS,QAAQ,MACjB,EAAS,QAAQ,CACzB,CACF,EAAG,CAAC,CAAI,CAAC,EAEH,EAAQ,EAAO,GACrB,MACE,iBAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,OAAD,CACE,KAAK,SACL,QAAQ,QACR,KAAK,OACL,cAAY,cACZ,aAAY,EACZ,MAAO,EACP,aAAY,EACZ,QAAS,EACT,UAAWC,EAAAA,GAAG,+BAAgC,CAAS,EAEtD,SAAA,IAAU,SAAW,iBAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,MAAD,CAAW,UAAU,wBAA0B,CAAA,EAAI,iBAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,KAAD,CAAU,UAAU,QAAU,CAAA,CACjG,CAAA,CAEZ"}
@@ -0,0 +1,2 @@
1
+ import{CheckIcon as e,CopyIcon as t}from"../icons/icons.mjs";import{cn as n}from"../lib/cn.mjs";import{Button as r}from"./Button.mjs";import{jsx as i}from"react/jsx-runtime";import{useCallback as a,useEffect as o,useState as s}from"react";const c={idle:`copy`,copied:`copied`,failed:`copying was blocked by the browser`};function l({text:l,className:u}){let[d,f]=s(`idle`);o(()=>{if(d===`idle`)return;let e=setTimeout(()=>f(`idle`),1500);return()=>clearTimeout(e)},[d]);let p=a(()=>{navigator.clipboard.writeText(l).then(()=>f(`copied`),()=>f(`failed`))},[l]),m=c[d];return/* @__PURE__ */ i(r,{type:`button`,variant:`ghost`,size:`icon`,"data-testid":`copy-button`,"data-state":d,title:m,"aria-label":m,onClick:p,className:n(`opacity-60 hover:opacity-100`,u),children:d===`copied`?/* @__PURE__ */ i(e,{className:`size-3 text-doom-green`}):/* @__PURE__ */ i(t,{className:`size-3`})})}export{l as CopyButton};
2
+ //# sourceMappingURL=CopyButton.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyButton.mjs","names":[],"sources":["../../../src/components/CopyButton.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport { CheckIcon, CopyIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport { Button } from './Button';\n\n/**\n * Puts a piece of text on the clipboard and says so.\n *\n * DESIGN PATTERNS:\n * - Always visible, dimmed. Half the cockpit's surfaces are touched rather\n * than pointed at, and a control revealed by hover does not exist there.\n * - A refused clipboard is a state, not a crash: the label says the browser\n * blocked it and the text is still there to select by hand.\n */\n\n/** How long the control stays acknowledged before returning to its icon. */\nconst FEEDBACK_MS = 1500;\n\ntype CopyState = 'idle' | 'copied' | 'failed';\n\nconst LABELS: Readonly<Record<CopyState, string>> = {\n idle: 'copy',\n copied: 'copied',\n failed: 'copying was blocked by the browser',\n};\n\nexport interface CopyButtonProps {\n /** What lands on the clipboard. */\n text: string;\n className?: string | undefined;\n}\n\nexport function CopyButton({ text, className }: CopyButtonProps) {\n const [state, setState] = useState<CopyState>('idle');\n\n useEffect(() => {\n if (state === 'idle') return;\n const timer = setTimeout(() => setState('idle'), FEEDBACK_MS);\n return () => clearTimeout(timer);\n }, [state]);\n\n const copy = useCallback(() => {\n void navigator.clipboard.writeText(text).then(\n () => setState('copied'),\n () => setState('failed'),\n );\n }, [text]);\n\n const label = LABELS[state];\n return (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n data-testid=\"copy-button\"\n data-state={state}\n title={label}\n aria-label={label}\n onClick={copy}\n className={cn('opacity-60 hover:opacity-100', className)}\n >\n {state === 'copied' ? <CheckIcon className=\"size-3 text-doom-green\" /> : <CopyIcon className=\"size-3\" />}\n </Button>\n );\n}\n"],"mappings":"+OAiBA,MAIM,EAA8C,CAClD,KAAM,OACN,OAAQ,SACR,OAAQ,oCACV,EAQA,SAAgB,EAAW,CAAE,OAAM,aAA8B,CAC/D,GAAM,CAAC,EAAO,GAAY,EAAoB,MAAM,EAEpD,MAAgB,CACd,GAAI,IAAU,OAAQ,OACtB,IAAM,EAAQ,eAAiB,EAAS,MAAM,EAAG,IAAW,EAC5D,UAAa,aAAa,CAAK,CACjC,EAAG,CAAC,CAAK,CAAC,EAEV,IAAM,EAAO,MAAkB,CAC7B,UAAe,UAAU,UAAU,CAAI,CAAC,CAAC,SACjC,EAAS,QAAQ,MACjB,EAAS,QAAQ,CACzB,CACF,EAAG,CAAC,CAAI,CAAC,EAEH,EAAQ,EAAO,GACrB,MACE,kBAAC,EAAD,CACE,KAAK,SACL,QAAQ,QACR,KAAK,OACL,cAAY,cACZ,aAAY,EACZ,MAAO,EACP,aAAY,EACZ,QAAS,EACT,UAAW,EAAG,+BAAgC,CAAS,EAEtD,SAAA,IAAU,SAAW,kBAAC,EAAD,CAAW,UAAU,wBAA0B,CAAA,EAAI,kBAAC,EAAD,CAAU,UAAU,QAAU,CAAA,CACjG,CAAA,CAEZ"}
@@ -1,2 +1,2 @@
1
- require("../icons/icons.cjs");const e=require("../lib/cn.cjs"),t=require("./Button.cjs");let n=require("radix-ui"),r=require("react/jsx-runtime"),i=require("class-variance-authority"),a=require("lucide-react");function o(e){return(0,r.jsx)(n.Dialog.Root,{"data-slot":`dialog`,...e})}function s(e){return(0,r.jsx)(n.Dialog.Trigger,{"data-slot":`dialog-trigger`,...e})}function c(e){return(0,r.jsx)(n.Dialog.Portal,{"data-slot":`dialog-portal`,...e})}function l(e){return(0,r.jsx)(n.Dialog.Close,{"data-slot":`dialog-close`,...e})}function u({className:t,...i}){return(0,r.jsx)(n.Dialog.Overlay,{"data-slot":`dialog-overlay`,className:e.cn(`fixed inset-0 z-40 bg-doom-deep/70 data-[state=open]:animate-doom-fade`,t),...i})}const d={sm:`w-[360px]`,md:`w-[480px]`,lg:`w-[620px]`};function f({className:t,children:i,width:a=`md`,...o}){return(0,r.jsxs)(c,{children:[(0,r.jsx)(u,{}),(0,r.jsx)(n.Dialog.Content,{"data-slot":`dialog-content`,className:e.cn(`fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-24px)] max-w-[calc(100vw-24px)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-lg border border-doom-border bg-doom-panel font-mono shadow-2xl outline-none data-[state=open]:animate-doom-pop`,d[a],t),...o,children:i})]})}function p({className:i,dismissible:o=!1,closeLabel:s=`close`,children:c,...l}){return(0,r.jsxs)(`div`,{"data-slot":`dialog-header`,className:e.cn(`flex min-w-0 items-center justify-between gap-3 border-b border-doom-border px-3 py-3 sm:px-4`,i),...l,children:[c,o?(0,r.jsx)(n.Dialog.Close,{asChild:!0,children:(0,r.jsx)(t.Button,{variant:`ghost`,size:`icon`,"aria-label":s,className:`text-doom-faint hover:text-doom-hi`,children:(0,r.jsx)(a.X,{className:`h-3 w-3`})})}):null]})}function m({className:t,...i}){return(0,r.jsx)(n.Dialog.Title,{"data-slot":`dialog-title`,className:e.cn(`text-[12px] font-bold tracking-wide text-doom-hi`,t),...i})}function h({className:t,...i}){return(0,r.jsx)(n.Dialog.Description,{"data-slot":`dialog-description`,className:e.cn(`text-[11px] leading-relaxed text-doom-dim`,t),...i})}function g({className:t,...n}){return(0,r.jsx)(`div`,{"data-slot":`dialog-body`,className:e.cn(`flex min-h-0 flex-col gap-3 overflow-y-auto px-3 py-3 sm:px-4 sm:py-4`,t),...n})}const _=(0,i.cva)(`flex shrink-0 items-center gap-2`,{variants:{variant:{plain:`justify-end`,bar:`min-h-[34px] flex-wrap justify-between border-t border-doom-border-soft bg-doom-deep px-3 py-1.5 sm:flex-nowrap sm:px-4 sm:py-0`}},defaultVariants:{variant:`plain`}});function v({className:t,variant:n,...i}){return(0,r.jsx)(`div`,{"data-slot":`dialog-footer`,className:e.cn(_({variant:n}),t),...i})}exports.Dialog=o,exports.DialogBody=g,exports.DialogClose=l,exports.DialogContent=f,exports.DialogDescription=h,exports.DialogFooter=v,exports.DialogHeader=p,exports.DialogOverlay=u,exports.DialogPortal=c,exports.DialogTitle=m,exports.DialogTrigger=s,exports.dialogFooterVariants=_;
1
+ require("../icons/icons.cjs");const e=require("../lib/cn.cjs"),t=require("./Button.cjs");let n=require("radix-ui"),r=require("react/jsx-runtime"),i=require("react"),a=require("class-variance-authority"),o=require("lucide-react");const s=(0,i.createContext)(void 0);function c(e){let t=e.onOpenChange===void 0?void 0:t=>e.onOpenChange?.(t);return/* @__PURE__ */ (0,r.jsx)(s.Provider,{value:t,children:/* @__PURE__ */ (0,r.jsx)(n.Dialog.Root,{"data-slot":`dialog`,...e,onOpenChange:t})})}function l(e){return/* @__PURE__ */ (0,r.jsx)(n.Dialog.Trigger,{"data-slot":`dialog-trigger`,...e})}function u(e){return/* @__PURE__ */ (0,r.jsx)(n.Dialog.Portal,{"data-slot":`dialog-portal`,...e})}function d(e){return/* @__PURE__ */ (0,r.jsx)(n.Dialog.Close,{"data-slot":`dialog-close`,...e})}function f({className:t,onPointerDownCapture:a,...o}){let c=(0,i.useContext)(s);return/* @__PURE__ */ (0,r.jsx)(n.Dialog.Overlay,{"data-slot":`dialog-overlay`,className:e.cn(`fixed inset-0 z-40 bg-doom-deep/70 data-[state=open]:animate-doom-fade`,t),onPointerDownCapture:e=>{a?.(e),!(e.defaultPrevented||c===void 0)&&e.currentTarget.nextElementSibling?.querySelector(`[data-slot="select-trigger"][data-state="open"]`)!=null&&(e.stopPropagation(),c(!1))},...o})}const p={sm:`w-[360px]`,md:`w-[480px]`,lg:`w-[620px]`};function m({className:t,children:i,width:a=`md`,...o}){return/* @__PURE__ */ (0,r.jsxs)(u,{children:[/* @__PURE__ */ (0,r.jsx)(f,{}),/* @__PURE__ */ (0,r.jsx)(n.Dialog.Content,{"data-slot":`dialog-content`,className:e.cn(`fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-24px)] max-w-[calc(100vw-24px)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-lg border border-doom-border bg-doom-panel font-mono shadow-2xl outline-none data-[state=open]:animate-doom-pop`,p[a],t),...o,children:i})]})}function h({className:i,dismissible:a=!1,closeLabel:s=`close`,children:c,...l}){return/* @__PURE__ */ (0,r.jsxs)(`div`,{"data-slot":`dialog-header`,className:e.cn(`flex min-w-0 items-center justify-between gap-3 border-b border-doom-border px-3 py-3 sm:px-4`,i),...l,children:[c,a?/* @__PURE__ */ (0,r.jsx)(n.Dialog.Close,{asChild:!0,children:/* @__PURE__ */ (0,r.jsx)(t.Button,{variant:`ghost`,size:`icon`,"aria-label":s,className:`text-doom-faint hover:text-doom-hi`,children:/* @__PURE__ */ (0,r.jsx)(o.X,{className:`h-3 w-3`})})}):null]})}function g({className:t,...i}){return/* @__PURE__ */ (0,r.jsx)(n.Dialog.Title,{"data-slot":`dialog-title`,className:e.cn(`text-sm font-bold tracking-wide text-doom-hi`,t),...i})}function _({className:t,...i}){return/* @__PURE__ */ (0,r.jsx)(n.Dialog.Description,{"data-slot":`dialog-description`,className:e.cn(`text-sm leading-relaxed text-doom-dim`,t),...i})}function v({className:t,...n}){return/* @__PURE__ */ (0,r.jsx)(`div`,{"data-slot":`dialog-body`,className:e.cn(`flex min-h-0 flex-col gap-3 overflow-y-auto px-3 py-3 sm:px-4 sm:py-4`,t),...n})}const y=(0,a.cva)(`flex shrink-0 items-center gap-2`,{variants:{variant:{plain:`justify-end`,bar:`min-h-[34px] flex-wrap justify-between border-t border-doom-border-soft bg-doom-deep px-3 py-1.5 sm:flex-nowrap sm:px-4 sm:py-0`}},defaultVariants:{variant:`plain`}});function b({className:t,variant:n,...i}){return/* @__PURE__ */ (0,r.jsx)(`div`,{"data-slot":`dialog-footer`,className:e.cn(y({variant:n}),t),...i})}exports.Dialog=c,exports.DialogBody=v,exports.DialogClose=d,exports.DialogContent=m,exports.DialogDescription=_,exports.DialogFooter=b,exports.DialogHeader=h,exports.DialogOverlay=f,exports.DialogPortal=u,exports.DialogTitle=g,exports.DialogTrigger=l,exports.dialogFooterVariants=y;
2
2
  //# sourceMappingURL=Dialog.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.cjs","names":["DialogPrimitive","cn","Button","CloseIcon","cva"],"sources":["../../../src/components/Dialog.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\nimport { CloseIcon } from '../icons/icons.ts';\nimport { cn } from '../lib/cn.ts';\nimport { Button } from './Button.tsx';\n\n/**\n * shadcn's Dialog on Radix: focus trap, Escape, outside click, scroll lock,\n * and focus restored to the trigger on close. The frame is the Doom panel.\n */\nexport function Dialog(props: ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nexport function DialogTrigger(props: ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nexport function DialogPortal(props: ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nexport function DialogClose(props: ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nexport function DialogOverlay({ className, ...props }: ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn('fixed inset-0 z-40 bg-doom-deep/70 data-[state=open]:animate-doom-fade', className)}\n {...props}\n />\n );\n}\n\nexport interface DialogContentProps extends ComponentProps<typeof DialogPrimitive.Content> {\n /** Width preset; `className` may still override. */\n width?: 'sm' | 'md' | 'lg';\n}\n\nconst CONTENT_WIDTH = { sm: 'w-[360px]', md: 'w-[480px]', lg: 'w-[620px]' } as const;\n\nexport function DialogContent({ className, children, width = 'md', ...props }: DialogContentProps) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-24px)] max-w-[calc(100vw-24px)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-lg border border-doom-border bg-doom-panel font-mono shadow-2xl outline-none data-[state=open]:animate-doom-pop',\n CONTENT_WIDTH[width],\n className,\n )}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nexport interface DialogHeaderProps extends ComponentProps<'div'> {\n /**\n * Show the close control at the right of the strip. Off by default: most\n * headers already put something there (a spinner, a method label) and every\n * dialog closes on Escape, so an X that fights the existing content is worse\n * than none. Turn it on for a dialog whose only way out is the mouse.\n */\n dismissible?: boolean;\n /** What the close control announces. */\n closeLabel?: string;\n}\n\nexport function DialogHeader({\n className,\n dismissible = false,\n closeLabel = 'close',\n children,\n ...props\n}: DialogHeaderProps) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\n 'flex min-w-0 items-center justify-between gap-3 border-b border-doom-border px-3 py-3 sm:px-4',\n className,\n )}\n {...props}\n >\n {children}\n {dismissible ? (\n <DialogPrimitive.Close asChild>\n <Button variant=\"ghost\" size=\"icon\" aria-label={closeLabel} className=\"text-doom-faint hover:text-doom-hi\">\n <CloseIcon className=\"h-3 w-3\" />\n </Button>\n </DialogPrimitive.Close>\n ) : null}\n </div>\n );\n}\n\nexport function DialogTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-[12px] font-bold tracking-wide text-doom-hi', className)}\n {...props}\n />\n );\n}\n\nexport function DialogDescription({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-[11px] leading-relaxed text-doom-dim', className)}\n {...props}\n />\n );\n}\n\nexport function DialogBody({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-body\"\n className={cn('flex min-h-0 flex-col gap-3 overflow-y-auto px-3 py-3 sm:px-4 sm:py-4', className)}\n {...props}\n />\n );\n}\n\nexport const dialogFooterVariants = cva('flex shrink-0 items-center gap-2', {\n variants: {\n variant: {\n /** Buttons alone, sitting inside the body's padding. */\n plain: 'justify-end',\n /**\n * The full-width strip: a hint on the left, the buttons on the right,\n * recessed and ruled off from the body. The same shape PopoverFooter\n * draws, because a dialog and a popover promise their keys the same way.\n */\n bar: 'min-h-[34px] flex-wrap justify-between border-t border-doom-border-soft bg-doom-deep px-3 py-1.5 sm:flex-nowrap sm:px-4 sm:py-0',\n },\n },\n defaultVariants: { variant: 'plain' },\n});\n\nexport interface DialogFooterProps extends ComponentProps<'div'>, VariantProps<typeof dialogFooterVariants> {}\n\nexport function DialogFooter({ className, variant, ...props }: DialogFooterProps) {\n return <div data-slot=\"dialog-footer\" className={cn(dialogFooterVariants({ variant }), className)} {...props} />;\n}\n"],"mappings":"kNAWA,SAAgB,EAAO,EAAoD,CACzE,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAgB,KAAjB,CAAsB,YAAU,SAAS,GAAI,CAAQ,CAAA,CAC9D,CAEA,SAAgB,EAAc,EAAuD,CACnF,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAgB,QAAjB,CAAyB,YAAU,iBAAiB,GAAI,CAAQ,CAAA,CACzE,CAEA,SAAgB,EAAa,EAAsD,CACjF,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAgB,OAAjB,CAAwB,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CACvE,CAEA,SAAgB,EAAY,EAAqD,CAC/E,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAgB,MAAjB,CAAuB,YAAU,eAAe,GAAI,CAAQ,CAAA,CAC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AAgB,EAAkB,CAAE,YAAW,GAAG,GAA6D,CAC7G,OACE,EAAA,EAAA,IAAA,CAACD,EAAAA,OAAgB,YAAjB,CACE,YAAU,qBACV,UAAWC,EAAAA,GAAG,4CAA6C,CAAS,EACpE,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAW,CAAE,YAAW,GAAG,GAAgC,CACzE,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CACE,YAAU,cACV,UAAWA,EAAAA,GAAG,wEAAyE,CAAS,EAChG,GAAI,CACL,CAAA,CAEL,CAEA,MAAa,GAAA,EAAuBG,EAAAA,IAAAA,CAAI,mCAAoC,CAC1E,SAAU,CACR,QAAS,CAEP,MAAO,cAMP,IAAK,iIACP,CACF,EACA,gBAAiB,CAAE,QAAS,OAAQ,CACtC,CAAC,EAID,SAAgB,EAAa,CAAE,YAAW,UAAS,GAAG,GAA4B,CAChF,OAAO,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,YAAU,gBAAgB,UAAWH,EAAAA,GAAG,EAAqB,CAAE,SAAQ,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CACjH"}
1
+ {"version":3,"file":"Dialog.cjs","names":["createContext","DialogPrimitive","useContext","cn","Button","CloseIcon","cva"],"sources":["../../../src/components/Dialog.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport { createContext, type ComponentProps, useContext } from 'react';\n\nimport { CloseIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport { Button } from './Button';\n\nconst DialogOpenChangeContext = createContext<((open: boolean) => void) | undefined>(undefined);\n/**\n * shadcn's Dialog on Radix: focus trap, Escape, outside click, scroll lock,\n * and focus restored to the trigger on close. The frame is the Doom panel.\n */\nexport function Dialog(props: ComponentProps<typeof DialogPrimitive.Root>) {\n const onOpenChange = props.onOpenChange === undefined ? undefined : (open: boolean) => props.onOpenChange?.(open);\n return (\n <DialogOpenChangeContext.Provider value={onOpenChange}>\n <DialogPrimitive.Root data-slot=\"dialog\" {...props} onOpenChange={onOpenChange} />\n </DialogOpenChangeContext.Provider>\n );\n}\n\nexport function DialogTrigger(props: ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nexport function DialogPortal(props: ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nexport function DialogClose(props: ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nexport function DialogOverlay({\n className,\n onPointerDownCapture,\n ...props\n}: ComponentProps<typeof DialogPrimitive.Overlay>) {\n const onOpenChange = useContext(DialogOpenChangeContext);\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn('fixed inset-0 z-40 bg-doom-deep/70 data-[state=open]:animate-doom-fade', className)}\n onPointerDownCapture={(event) => {\n onPointerDownCapture?.(event);\n if (event.defaultPrevented || onOpenChange === undefined) return;\n const dialogContent = event.currentTarget.nextElementSibling;\n const openSelectTrigger = dialogContent?.querySelector('[data-slot=\"select-trigger\"][data-state=\"open\"]');\n if (openSelectTrigger === null || openSelectTrigger === undefined) return;\n\n // Radix's parent outside listener can lag one render behind a nested\n // modal Select. Own this backdrop press so the complete stack closes.\n event.stopPropagation();\n onOpenChange(false);\n }}\n {...props}\n />\n );\n}\n\nexport interface DialogContentProps extends ComponentProps<typeof DialogPrimitive.Content> {\n /** Width preset; `className` may still override. */\n width?: 'sm' | 'md' | 'lg';\n}\n\nconst CONTENT_WIDTH = { sm: 'w-[360px]', md: 'w-[480px]', lg: 'w-[620px]' } as const;\n\nexport function DialogContent({ className, children, width = 'md', ...props }: DialogContentProps) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-24px)] max-w-[calc(100vw-24px)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-lg border border-doom-border bg-doom-panel font-mono shadow-2xl outline-none data-[state=open]:animate-doom-pop',\n CONTENT_WIDTH[width],\n className,\n )}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nexport interface DialogHeaderProps extends ComponentProps<'div'> {\n /**\n * Show the close control at the right of the strip. Off by default: most\n * headers already put something there (a spinner, a method label) and every\n * dialog closes on Escape, so an X that fights the existing content is worse\n * than none. Turn it on for a dialog whose only way out is the mouse.\n */\n dismissible?: boolean;\n /** What the close control announces. */\n closeLabel?: string;\n}\n\nexport function DialogHeader({\n className,\n dismissible = false,\n closeLabel = 'close',\n children,\n ...props\n}: DialogHeaderProps) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\n 'flex min-w-0 items-center justify-between gap-3 border-b border-doom-border px-3 py-3 sm:px-4',\n className,\n )}\n {...props}\n >\n {children}\n {dismissible ? (\n <DialogPrimitive.Close asChild>\n <Button variant=\"ghost\" size=\"icon\" aria-label={closeLabel} className=\"text-doom-faint hover:text-doom-hi\">\n <CloseIcon className=\"h-3 w-3\" />\n </Button>\n </DialogPrimitive.Close>\n ) : null}\n </div>\n );\n}\n\nexport function DialogTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-sm font-bold tracking-wide text-doom-hi', className)}\n {...props}\n />\n );\n}\n\nexport function DialogDescription({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-sm leading-relaxed text-doom-dim', className)}\n {...props}\n />\n );\n}\n\nexport function DialogBody({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-body\"\n className={cn('flex min-h-0 flex-col gap-3 overflow-y-auto px-3 py-3 sm:px-4 sm:py-4', className)}\n {...props}\n />\n );\n}\n\nexport const dialogFooterVariants = cva('flex shrink-0 items-center gap-2', {\n variants: {\n variant: {\n /** Buttons alone, sitting inside the body's padding. */\n plain: 'justify-end',\n /**\n * The full-width strip: a hint on the left, the buttons on the right,\n * recessed and ruled off from the body. The same shape PopoverFooter\n * draws, because a dialog and a popover promise their keys the same way.\n */\n bar: 'min-h-[34px] flex-wrap justify-between border-t border-doom-border-soft bg-doom-deep px-3 py-1.5 sm:flex-nowrap sm:px-4 sm:py-0',\n },\n },\n defaultVariants: { variant: 'plain' },\n});\n\nexport interface DialogFooterProps extends ComponentProps<'div'>, VariantProps<typeof dialogFooterVariants> {}\n\nexport function DialogFooter({ className, variant, ...props }: DialogFooterProps) {\n return <div data-slot=\"dialog-footer\" className={cn(dialogFooterVariants({ variant }), className)} {...props} />;\n}\n"],"mappings":"qOAQA,MAAM,GAAA,EAA0BA,EAAAA,cAAAA,CAAqD,IAAA,EAAS,EAK9F,SAAgB,EAAO,EAAoD,CACzE,IAAM,EAAe,EAAM,eAAiB,IAAA,GAAY,IAAA,GAAa,GAAkB,EAAM,eAAe,CAAI,EAChH,MACE,iBAAA,EAAA,EAAA,IAAA,CAAC,EAAwB,SAAzB,CAAkC,MAAO,EACvC,SAAA,iBAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,OAAgB,KAAjB,CAAsB,YAAU,SAAS,GAAI,EAAqB,cAAe,CAAA,CACjD,CAAA,CAEtC,CAEA,SAAgB,EAAc,EAAuD,CACnF,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAgB,QAAjB,CAAyB,YAAU,iBAAiB,GAAI,CAAQ,CAAA,CACzE,CAEA,SAAgB,EAAa,EAAsD,CACjF,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAgB,OAAjB,CAAwB,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CACvE,CAEA,SAAgB,EAAY,EAAqD,CAC/E,MAAO,iBAAA,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OAAD,CAAQ,QAAQ,QAAQ,KAAK,OAAO,aAAY,EAAY,UAAU,qCACpE,SAAA,iBAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,EAAD,CAAW,UAAU,SAAW,CAAA,CAC1B,CAAA,CACa,CAAA,EACrB,IACD,GAET,CAEA,SAAgB,EAAY,CAAE,YAAW,GAAG,GAAuD,CACjG,MACE,iBAAA,EAAA,EAAA,IAAA,CAACJ,EAAAA,OAAgB,MAAjB,CACE,YAAU,eACV,UAAWE,EAAAA,GAAG,+CAAgD,CAAS,EACvE,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAkB,CAAE,YAAW,GAAG,GAA6D,CAC7G,MACE,iBAAA,EAAA,EAAA,IAAA,CAACF,EAAAA,OAAgB,YAAjB,CACE,YAAU,qBACV,UAAWE,EAAAA,GAAG,wCAAyC,CAAS,EAChE,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAW,CAAE,YAAW,GAAG,GAAgC,CACzE,MACE,iBAAA,EAAA,EAAA,IAAA,CAAC,MAAD,CACE,YAAU,cACV,UAAWA,EAAAA,GAAG,wEAAyE,CAAS,EAChG,GAAI,CACL,CAAA,CAEL,CAEA,MAAa,GAAA,EAAuBG,EAAAA,IAAAA,CAAI,mCAAoC,CAC1E,SAAU,CACR,QAAS,CAEP,MAAO,cAMP,IAAK,iIACP,CACF,EACA,gBAAiB,CAAE,QAAS,OAAQ,CACtC,CAAC,EAID,SAAgB,EAAa,CAAE,YAAW,UAAS,GAAG,GAA4B,CAChF,MAAO,iBAAA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,YAAU,gBAAgB,UAAWH,EAAAA,GAAG,EAAqB,CAAE,SAAQ,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CACjH"}
@@ -1,20 +1,20 @@
1
1
  import { Dialog } from "radix-ui";
2
- import { VariantProps } from "class-variance-authority";
3
2
  import { ComponentProps } from "react";
3
+ import { VariantProps } from "class-variance-authority";
4
4
  //#region src/components/Dialog.d.ts
5
5
  /**
6
6
  * shadcn's Dialog on Radix: focus trap, Escape, outside click, scroll lock,
7
7
  * and focus restored to the trigger on close. The frame is the Doom panel.
8
8
  */
9
- declare function Dialog$1(props: ComponentProps<typeof Dialog.Root>): import("react/jsx-runtime").JSX.Element;
10
- declare function DialogTrigger(props: ComponentProps<typeof Dialog.Trigger>): import("react/jsx-runtime").JSX.Element;
11
- declare function DialogClose(props: ComponentProps<typeof Dialog.Close>): import("react/jsx-runtime").JSX.Element;
12
- interface DialogContentProps extends ComponentProps<typeof Dialog.Content> {
9
+ declare function Dialog$1(props: ComponentProps<typeof Dialog.Root>): import("react").JSX.Element;
10
+ export declare function DialogTrigger(props: ComponentProps<typeof Dialog.Trigger>): import("react").JSX.Element;
11
+ export declare function DialogClose(props: ComponentProps<typeof Dialog.Close>): import("react").JSX.Element;
12
+ export interface DialogContentProps extends ComponentProps<typeof Dialog.Content> {
13
13
  /** Width preset; `className` may still override. */
14
14
  width?: 'sm' | 'md' | 'lg';
15
15
  }
16
- declare function DialogContent({ className, children, width, ...props }: DialogContentProps): import("react/jsx-runtime").JSX.Element;
17
- interface DialogHeaderProps extends ComponentProps<'div'> {
16
+ export declare function DialogContent({ className, children, width, ...props }: DialogContentProps): import("react").JSX.Element;
17
+ export interface DialogHeaderProps extends ComponentProps<'div'> {
18
18
  /**
19
19
  * Show the close control at the right of the strip. Off by default: most
20
20
  * headers already put something there (a spinner, a method label) and every
@@ -25,15 +25,15 @@ interface DialogHeaderProps extends ComponentProps<'div'> {
25
25
  /** What the close control announces. */
26
26
  closeLabel?: string;
27
27
  }
28
- declare function DialogHeader({ className, dismissible, closeLabel, children, ...props }: DialogHeaderProps): import("react/jsx-runtime").JSX.Element;
29
- declare function DialogTitle({ className, ...props }: ComponentProps<typeof Dialog.Title>): import("react/jsx-runtime").JSX.Element;
30
- declare function DialogDescription({ className, ...props }: ComponentProps<typeof Dialog.Description>): import("react/jsx-runtime").JSX.Element;
31
- declare function DialogBody({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
32
- declare const dialogFooterVariants: (props?: ({
28
+ export declare function DialogHeader({ className, dismissible, closeLabel, children, ...props }: DialogHeaderProps): import("react").JSX.Element;
29
+ export declare function DialogTitle({ className, ...props }: ComponentProps<typeof Dialog.Title>): import("react").JSX.Element;
30
+ export declare function DialogDescription({ className, ...props }: ComponentProps<typeof Dialog.Description>): import("react").JSX.Element;
31
+ export declare function DialogBody({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
32
+ export declare const dialogFooterVariants: (props?: ({
33
33
  variant?: "bar" | "plain" | null | undefined;
34
34
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
35
- interface DialogFooterProps extends ComponentProps<'div'>, VariantProps<typeof dialogFooterVariants> {}
36
- declare function DialogFooter({ className, variant, ...props }: DialogFooterProps): import("react/jsx-runtime").JSX.Element;
35
+ export interface DialogFooterProps extends ComponentProps<'div'>, VariantProps<typeof dialogFooterVariants> {}
36
+ export declare function DialogFooter({ className, variant, ...props }: DialogFooterProps): import("react").JSX.Element;
37
37
  //#endregion
38
- export { Dialog$1 as Dialog, DialogBody, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogTitle, DialogTrigger, dialogFooterVariants };
38
+ export { Dialog$1 as Dialog };
39
39
  //# sourceMappingURL=Dialog.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.mts","names":[],"sources":["../../../src/components/Dialog.tsx"],"mappings":";;;;;;;;iBAWgB,SAAO,OAAO,sBAAsB,OAAgB,oCAAK,IAAA;iBAIzD,cAAc,OAAO,sBAAsB,OAAgB,uCAAQ,IAAA;iBAQnE,YAAY,OAAO,sBAAsB,OAAgB,qCAAM,IAAA;UAc9D,2BAA2B,sBAAsB,OAAgB;;EAEhF;;iBAKc,gBAAgB,WAAW,UAAU,UAAiB,SAAS,iDAAkB,IAAA;UAmBhF,0BAA0B;;;;;;;EAOzC;;EAEA;;iBAGc,eACd,WACA,aACA,YACA,aACG,SACF,gDAAiB,IAAA;iBAsBJ,cAAc,cAAc,SAAS,sBAAsB,OAAgB,qCAAM,IAAA;iBAUjF,oBAAoB,cAAc,SAAS,sBAAsB,OAAgB,2CAAY,IAAA;iBAU7F,aAAa,cAAc,SAAS,oDAAqB,IAAA;cAU5D,uBAAoB;;6CAc/B;UAEe,0BAA0B,uBAAuB,oBAAoB;iBAEtE,eAAe,WAAW,YAAY,SAAS,gDAAiB,IAAA"}
1
+ {"version":3,"file":"Dialog.d.mts","names":[],"sources":["../../../src/components/Dialog.tsx"],"mappings":";;;;;;;;iBAagB,SAAO,OAAO,sBAAsB,OAAgB,wBAAK,IAAA;wBASzD,cAAc,OAAO,sBAAsB,OAAgB,2BAAQ,IAAA;wBAQnE,YAAY,OAAO,sBAAsB,OAAgB,yBAAM,IAAA;iBA+B9D,2BAA2B,sBAAsB,OAAgB;;EAEhF;;wBAKc,gBAAgB,WAAW,UAAU,UAAiB,SAAS,qCAAkB,IAAA;iBAmBhF,0BAA0B;;;;;;;EAOzC;;EAEA;;wBAGc,eACd,WACA,aACA,YACA,aACG,SACF,oCAAiB,IAAA;wBAsBJ,cAAc,cAAc,SAAS,sBAAsB,OAAgB,yBAAM,IAAA;wBAUjF,oBAAoB,cAAc,SAAS,sBAAsB,OAAgB,+BAAY,IAAA;wBAU7F,aAAa,cAAc,SAAS,wCAAqB,IAAA;qBAU5D,uBAAoB;;6CAc/B;iBAEe,0BAA0B,uBAAuB,oBAAoB;wBAEtE,eAAe,WAAW,YAAY,SAAS,oCAAiB,IAAA"}
@@ -1,2 +1,2 @@
1
- import{CloseIcon as e}from"../icons/icons.mjs";import{cn as t}from"../lib/cn.mjs";import{Button as n}from"./Button.mjs";import{Dialog as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{cva as o}from"class-variance-authority";function s(e){return i(r.Root,{"data-slot":`dialog`,...e})}function c(e){return i(r.Trigger,{"data-slot":`dialog-trigger`,...e})}function l(e){return i(r.Portal,{"data-slot":`dialog-portal`,...e})}function u(e){return i(r.Close,{"data-slot":`dialog-close`,...e})}function d({className:e,...n}){return i(r.Overlay,{"data-slot":`dialog-overlay`,className:t(`fixed inset-0 z-40 bg-doom-deep/70 data-[state=open]:animate-doom-fade`,e),...n})}const f={sm:`w-[360px]`,md:`w-[480px]`,lg:`w-[620px]`};function p({className:e,children:n,width:o=`md`,...s}){return a(l,{children:[i(d,{}),i(r.Content,{"data-slot":`dialog-content`,className:t(`fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-24px)] max-w-[calc(100vw-24px)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-lg border border-doom-border bg-doom-panel font-mono shadow-2xl outline-none data-[state=open]:animate-doom-pop`,f[o],e),...s,children:n})]})}function m({className:o,dismissible:s=!1,closeLabel:c=`close`,children:l,...u}){return a(`div`,{"data-slot":`dialog-header`,className:t(`flex min-w-0 items-center justify-between gap-3 border-b border-doom-border px-3 py-3 sm:px-4`,o),...u,children:[l,s?i(r.Close,{asChild:!0,children:i(n,{variant:`ghost`,size:`icon`,"aria-label":c,className:`text-doom-faint hover:text-doom-hi`,children:i(e,{className:`h-3 w-3`})})}):null]})}function h({className:e,...n}){return i(r.Title,{"data-slot":`dialog-title`,className:t(`text-[12px] font-bold tracking-wide text-doom-hi`,e),...n})}function g({className:e,...n}){return i(r.Description,{"data-slot":`dialog-description`,className:t(`text-[11px] leading-relaxed text-doom-dim`,e),...n})}function _({className:e,...n}){return i(`div`,{"data-slot":`dialog-body`,className:t(`flex min-h-0 flex-col gap-3 overflow-y-auto px-3 py-3 sm:px-4 sm:py-4`,e),...n})}const v=o(`flex shrink-0 items-center gap-2`,{variants:{variant:{plain:`justify-end`,bar:`min-h-[34px] flex-wrap justify-between border-t border-doom-border-soft bg-doom-deep px-3 py-1.5 sm:flex-nowrap sm:px-4 sm:py-0`}},defaultVariants:{variant:`plain`}});function y({className:e,variant:n,...r}){return i(`div`,{"data-slot":`dialog-footer`,className:t(v({variant:n}),e),...r})}export{s as Dialog,_ as DialogBody,u as DialogClose,p as DialogContent,g as DialogDescription,y as DialogFooter,m as DialogHeader,d as DialogOverlay,l as DialogPortal,h as DialogTitle,c as DialogTrigger,v as dialogFooterVariants};
1
+ import{CloseIcon as e}from"../icons/icons.mjs";import{cn as t}from"../lib/cn.mjs";import{Button as n}from"./Button.mjs";import{Dialog as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{createContext as o,useContext as s}from"react";import{cva as c}from"class-variance-authority";const l=o(void 0);function u(e){let t=e.onOpenChange===void 0?void 0:t=>e.onOpenChange?.(t);return/* @__PURE__ */ i(l.Provider,{value:t,children:/* @__PURE__ */ i(r.Root,{"data-slot":`dialog`,...e,onOpenChange:t})})}function d(e){return/* @__PURE__ */ i(r.Trigger,{"data-slot":`dialog-trigger`,...e})}function f(e){return/* @__PURE__ */ i(r.Portal,{"data-slot":`dialog-portal`,...e})}function p(e){return/* @__PURE__ */ i(r.Close,{"data-slot":`dialog-close`,...e})}function m({className:e,onPointerDownCapture:n,...a}){let o=s(l);return/* @__PURE__ */ i(r.Overlay,{"data-slot":`dialog-overlay`,className:t(`fixed inset-0 z-40 bg-doom-deep/70 data-[state=open]:animate-doom-fade`,e),onPointerDownCapture:e=>{n?.(e),!(e.defaultPrevented||o===void 0)&&e.currentTarget.nextElementSibling?.querySelector(`[data-slot="select-trigger"][data-state="open"]`)!=null&&(e.stopPropagation(),o(!1))},...a})}const h={sm:`w-[360px]`,md:`w-[480px]`,lg:`w-[620px]`};function g({className:e,children:n,width:o=`md`,...s}){return/* @__PURE__ */ a(f,{children:[/* @__PURE__ */ i(m,{}),/* @__PURE__ */ i(r.Content,{"data-slot":`dialog-content`,className:t(`fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-24px)] max-w-[calc(100vw-24px)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-lg border border-doom-border bg-doom-panel font-mono shadow-2xl outline-none data-[state=open]:animate-doom-pop`,h[o],e),...s,children:n})]})}function _({className:o,dismissible:s=!1,closeLabel:c=`close`,children:l,...u}){return/* @__PURE__ */ a(`div`,{"data-slot":`dialog-header`,className:t(`flex min-w-0 items-center justify-between gap-3 border-b border-doom-border px-3 py-3 sm:px-4`,o),...u,children:[l,s?/* @__PURE__ */ i(r.Close,{asChild:!0,children:/* @__PURE__ */ i(n,{variant:`ghost`,size:`icon`,"aria-label":c,className:`text-doom-faint hover:text-doom-hi`,children:/* @__PURE__ */ i(e,{className:`h-3 w-3`})})}):null]})}function v({className:e,...n}){return/* @__PURE__ */ i(r.Title,{"data-slot":`dialog-title`,className:t(`text-sm font-bold tracking-wide text-doom-hi`,e),...n})}function y({className:e,...n}){return/* @__PURE__ */ i(r.Description,{"data-slot":`dialog-description`,className:t(`text-sm leading-relaxed text-doom-dim`,e),...n})}function b({className:e,...n}){return/* @__PURE__ */ i(`div`,{"data-slot":`dialog-body`,className:t(`flex min-h-0 flex-col gap-3 overflow-y-auto px-3 py-3 sm:px-4 sm:py-4`,e),...n})}const x=c(`flex shrink-0 items-center gap-2`,{variants:{variant:{plain:`justify-end`,bar:`min-h-[34px] flex-wrap justify-between border-t border-doom-border-soft bg-doom-deep px-3 py-1.5 sm:flex-nowrap sm:px-4 sm:py-0`}},defaultVariants:{variant:`plain`}});function S({className:e,variant:n,...r}){return/* @__PURE__ */ i(`div`,{"data-slot":`dialog-footer`,className:t(x({variant:n}),e),...r})}export{u as Dialog,b as DialogBody,p as DialogClose,g as DialogContent,y as DialogDescription,S as DialogFooter,_ as DialogHeader,m as DialogOverlay,f as DialogPortal,v as DialogTitle,d as DialogTrigger,x as dialogFooterVariants};
2
2
  //# sourceMappingURL=Dialog.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.mjs","names":["Dialog","DialogPrimitive"],"sources":["../../../src/components/Dialog.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\nimport { CloseIcon } from '../icons/icons.ts';\nimport { cn } from '../lib/cn.ts';\nimport { Button } from './Button.tsx';\n\n/**\n * shadcn's Dialog on Radix: focus trap, Escape, outside click, scroll lock,\n * and focus restored to the trigger on close. The frame is the Doom panel.\n */\nexport function Dialog(props: ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nexport function DialogTrigger(props: ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nexport function DialogPortal(props: ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nexport function DialogClose(props: ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nexport function DialogOverlay({ className, ...props }: ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn('fixed inset-0 z-40 bg-doom-deep/70 data-[state=open]:animate-doom-fade', className)}\n {...props}\n />\n );\n}\n\nexport interface DialogContentProps extends ComponentProps<typeof DialogPrimitive.Content> {\n /** Width preset; `className` may still override. */\n width?: 'sm' | 'md' | 'lg';\n}\n\nconst CONTENT_WIDTH = { sm: 'w-[360px]', md: 'w-[480px]', lg: 'w-[620px]' } as const;\n\nexport function DialogContent({ className, children, width = 'md', ...props }: DialogContentProps) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-24px)] max-w-[calc(100vw-24px)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-lg border border-doom-border bg-doom-panel font-mono shadow-2xl outline-none data-[state=open]:animate-doom-pop',\n CONTENT_WIDTH[width],\n className,\n )}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nexport interface DialogHeaderProps extends ComponentProps<'div'> {\n /**\n * Show the close control at the right of the strip. Off by default: most\n * headers already put something there (a spinner, a method label) and every\n * dialog closes on Escape, so an X that fights the existing content is worse\n * than none. Turn it on for a dialog whose only way out is the mouse.\n */\n dismissible?: boolean;\n /** What the close control announces. */\n closeLabel?: string;\n}\n\nexport function DialogHeader({\n className,\n dismissible = false,\n closeLabel = 'close',\n children,\n ...props\n}: DialogHeaderProps) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\n 'flex min-w-0 items-center justify-between gap-3 border-b border-doom-border px-3 py-3 sm:px-4',\n className,\n )}\n {...props}\n >\n {children}\n {dismissible ? (\n <DialogPrimitive.Close asChild>\n <Button variant=\"ghost\" size=\"icon\" aria-label={closeLabel} className=\"text-doom-faint hover:text-doom-hi\">\n <CloseIcon className=\"h-3 w-3\" />\n </Button>\n </DialogPrimitive.Close>\n ) : null}\n </div>\n );\n}\n\nexport function DialogTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-[12px] font-bold tracking-wide text-doom-hi', className)}\n {...props}\n />\n );\n}\n\nexport function DialogDescription({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-[11px] leading-relaxed text-doom-dim', className)}\n {...props}\n />\n );\n}\n\nexport function DialogBody({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-body\"\n className={cn('flex min-h-0 flex-col gap-3 overflow-y-auto px-3 py-3 sm:px-4 sm:py-4', className)}\n {...props}\n />\n );\n}\n\nexport const dialogFooterVariants = cva('flex shrink-0 items-center gap-2', {\n variants: {\n variant: {\n /** Buttons alone, sitting inside the body's padding. */\n plain: 'justify-end',\n /**\n * The full-width strip: a hint on the left, the buttons on the right,\n * recessed and ruled off from the body. The same shape PopoverFooter\n * draws, because a dialog and a popover promise their keys the same way.\n */\n bar: 'min-h-[34px] flex-wrap justify-between border-t border-doom-border-soft bg-doom-deep px-3 py-1.5 sm:flex-nowrap sm:px-4 sm:py-0',\n },\n },\n defaultVariants: { variant: 'plain' },\n});\n\nexport interface DialogFooterProps extends ComponentProps<'div'>, VariantProps<typeof dialogFooterVariants> {}\n\nexport function DialogFooter({ className, variant, ...props }: DialogFooterProps) {\n return <div data-slot=\"dialog-footer\" className={cn(dialogFooterVariants({ variant }), className)} {...props} />;\n}\n"],"mappings":"2PAWA,SAAgBA,EAAO,EAAoD,CACzE,OAAO,EAACC,EAAgB,KAAjB,CAAsB,YAAU,SAAS,GAAI,CAAQ,CAAA,CAC9D,CAEA,SAAgB,EAAc,EAAuD,CACnF,OAAO,EAACA,EAAgB,QAAjB,CAAyB,YAAU,iBAAiB,GAAI,CAAQ,CAAA,CACzE,CAEA,SAAgB,EAAa,EAAsD,CACjF,OAAO,EAACA,EAAgB,OAAjB,CAAwB,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CACvE,CAEA,SAAgB,EAAY,EAAqD,CAC/E,OAAO,EAACA,EAAgB,MAAjB,CAAuB,YAAU,eAAe,GAAI,CAAQ,CAAA,CACrE,CAEA,SAAgB,EAAc,CAAE,YAAW,GAAG,GAAyD,CACrG,OACE,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,UAAW,EAAG,yEAA0E,CAAS,EACjG,GAAI,CACL,CAAA,CAEL,CAOA,MAAM,EAAgB,CAAE,GAAI,YAAa,GAAI,YAAa,GAAI,WAAY,EAE1E,SAAgB,EAAc,CAAE,YAAW,WAAU,QAAQ,KAAM,GAAG,GAA6B,CACjG,OACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAgB,CAAA,EAChB,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,UAAW,EACT,yQACA,E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"],"sources":["../../../src/components/Dialog.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport { createContext, type ComponentProps, useContext } from 'react';\n\nimport { CloseIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport { Button } from './Button';\n\nconst DialogOpenChangeContext = createContext<((open: boolean) => void) | undefined>(undefined);\n/**\n * shadcn's Dialog on Radix: focus trap, Escape, outside click, scroll lock,\n * and focus restored to the trigger on close. The frame is the Doom panel.\n */\nexport function Dialog(props: ComponentProps<typeof DialogPrimitive.Root>) {\n const onOpenChange = props.onOpenChange === undefined ? undefined : (open: boolean) => props.onOpenChange?.(open);\n return (\n <DialogOpenChangeContext.Provider value={onOpenChange}>\n <DialogPrimitive.Root data-slot=\"dialog\" {...props} onOpenChange={onOpenChange} />\n </DialogOpenChangeContext.Provider>\n );\n}\n\nexport function DialogTrigger(props: ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nexport function DialogPortal(props: ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nexport function DialogClose(props: ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nexport function DialogOverlay({\n className,\n onPointerDownCapture,\n ...props\n}: ComponentProps<typeof DialogPrimitive.Overlay>) {\n const onOpenChange = useContext(DialogOpenChangeContext);\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn('fixed inset-0 z-40 bg-doom-deep/70 data-[state=open]:animate-doom-fade', className)}\n onPointerDownCapture={(event) => {\n onPointerDownCapture?.(event);\n if (event.defaultPrevented || onOpenChange === undefined) return;\n const dialogContent = event.currentTarget.nextElementSibling;\n const openSelectTrigger = dialogContent?.querySelector('[data-slot=\"select-trigger\"][data-state=\"open\"]');\n if (openSelectTrigger === null || openSelectTrigger === undefined) return;\n\n // Radix's parent outside listener can lag one render behind a nested\n // modal Select. Own this backdrop press so the complete stack closes.\n event.stopPropagation();\n onOpenChange(false);\n }}\n {...props}\n />\n );\n}\n\nexport interface DialogContentProps extends ComponentProps<typeof DialogPrimitive.Content> {\n /** Width preset; `className` may still override. */\n width?: 'sm' | 'md' | 'lg';\n}\n\nconst CONTENT_WIDTH = { sm: 'w-[360px]', md: 'w-[480px]', lg: 'w-[620px]' } as const;\n\nexport function DialogContent({ className, children, width = 'md', ...props }: DialogContentProps) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-24px)] max-w-[calc(100vw-24px)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-lg border border-doom-border bg-doom-panel font-mono shadow-2xl outline-none data-[state=open]:animate-doom-pop',\n CONTENT_WIDTH[width],\n className,\n )}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nexport interface DialogHeaderProps extends ComponentProps<'div'> {\n /**\n * Show the close control at the right of the strip. Off by default: most\n * headers already put something there (a spinner, a method label) and every\n * dialog closes on Escape, so an X that fights the existing content is worse\n * than none. Turn it on for a dialog whose only way out is the mouse.\n */\n dismissible?: boolean;\n /** What the close control announces. */\n closeLabel?: string;\n}\n\nexport function DialogHeader({\n className,\n dismissible = false,\n closeLabel = 'close',\n children,\n ...props\n}: DialogHeaderProps) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\n 'flex min-w-0 items-center justify-between gap-3 border-b border-doom-border px-3 py-3 sm:px-4',\n className,\n )}\n {...props}\n >\n {children}\n {dismissible ? (\n <DialogPrimitive.Close asChild>\n <Button variant=\"ghost\" size=\"icon\" aria-label={closeLabel} className=\"text-doom-faint hover:text-doom-hi\">\n <CloseIcon className=\"h-3 w-3\" />\n </Button>\n </DialogPrimitive.Close>\n ) : null}\n </div>\n );\n}\n\nexport function DialogTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-sm font-bold tracking-wide text-doom-hi', className)}\n {...props}\n />\n );\n}\n\nexport function DialogDescription({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-sm leading-relaxed text-doom-dim', className)}\n {...props}\n />\n );\n}\n\nexport function DialogBody({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-body\"\n className={cn('flex min-h-0 flex-col gap-3 overflow-y-auto px-3 py-3 sm:px-4 sm:py-4', className)}\n {...props}\n />\n );\n}\n\nexport const dialogFooterVariants = cva('flex shrink-0 items-center gap-2', {\n variants: {\n variant: {\n /** Buttons alone, sitting inside the body's padding. */\n plain: 'justify-end',\n /**\n * The full-width strip: a hint on the left, the buttons on the right,\n * recessed and ruled off from the body. The same shape PopoverFooter\n * draws, because a dialog and a popover promise their keys the same way.\n */\n bar: 'min-h-[34px] flex-wrap justify-between border-t border-doom-border-soft bg-doom-deep px-3 py-1.5 sm:flex-nowrap sm:px-4 sm:py-0',\n },\n },\n defaultVariants: { variant: 'plain' },\n});\n\nexport interface DialogFooterProps extends ComponentProps<'div'>, VariantProps<typeof dialogFooterVariants> {}\n\nexport function DialogFooter({ className, variant, ...props }: DialogFooterProps) {\n return <div data-slot=\"dialog-footer\" className={cn(dialogFooterVariants({ variant }), className)} {...props} />;\n}\n"],"mappings":"iTAQA,MAAM,EAA0B,EAAqD,IAAA,EAAS,EAK9F,SAAgBA,EAAO,EAAoD,CACzE,IAAM,EAAe,EAAM,eAAiB,IAAA,GAAY,IAAA,GAAa,GAAkB,EAAM,eAAe,CAAI,EAChH,MACE,kBAAC,EAAwB,SAAzB,CAAkC,MAAO,EACvC,SAAA,kBAACC,EAAgB,KAAjB,CAAsB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gB,MAAjB,CAAuB,QAAA,GACrB,SAAA,kBAAC,EAAD,CAAQ,QAAQ,QAAQ,KAAK,OAAO,aAAY,EAAY,UAAU,qCACpE,SAAA,kBAAC,EAAD,CAAW,UAAU,SAAW,CAAA,CAC1B,CAAA,CACa,CAAA,EACrB,IACD,GAET,CAEA,SAAgB,EAAY,CAAE,YAAW,GAAG,GAAuD,CACjG,MACE,kBAACA,EAAgB,MAAjB,CACE,YAAU,eACV,UAAW,EAAG,+CAAgD,CAAS,EACvE,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAkB,CAAE,YAAW,GAAG,GAA6D,CAC7G,MACE,kBAACA,EAAgB,YAAjB,CACE,YAAU,qBACV,UAAW,EAAG,wCAAyC,CAAS,EAChE,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAW,CAAE,YAAW,GAAG,GAAgC,CACzE,MACE,kBAAC,MAAD,CACE,YAAU,cACV,UAAW,EAAG,wEAAyE,CAAS,EAChG,GAAI,CACL,CAAA,CAEL,CAEA,MAAa,EAAuB,EAAI,mCAAoC,CAC1E,SAAU,CACR,QAAS,CAEP,MAAO,cAMP,IAAK,iIACP,CACF,EACA,gBAAiB,CAAE,QAAS,OAAQ,CACtC,CAAC,EAID,SAAgB,EAAa,CAAE,YAAW,UAAS,GAAG,GAA4B,CAChF,MAAO,kBAAC,MAAD,CAAK,YAAU,gBAAgB,UAAW,EAAG,EAAqB,CAAE,SAAQ,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CACjH"}
@@ -1,2 +1,2 @@
1
- const e=require("../lib/cn.cjs");let t=require("react/jsx-runtime");const n=(0,require("class-variance-authority").cva)(`inline-block shrink-0 rounded-full`,{variants:{tone:{neutral:`bg-doom-faint`,muted:`bg-doom-faint/40`,blue:`bg-doom-blue`,green:`bg-doom-green`,yellow:`bg-doom-yellow`,red:`bg-doom-red`,magenta:`bg-doom-magenta`,violet:`bg-doom-violet`,cyan:`bg-doom-cyan`,orange:`bg-doom-orange`,teal:`bg-doom-teal`},size:{xs:`h-1 w-1`,sm:`h-1.5 w-1.5`,md:`h-2 w-2`,lg:`h-2.5 w-2.5`},pulse:{true:`animate-pulse`,false:``}},defaultVariants:{tone:`neutral`,size:`sm`,pulse:!1}});function r({className:r,tone:i,size:a,pulse:o,...s}){return(0,t.jsx)(`span`,{"data-slot":`dot`,"aria-hidden":!0,className:e.cn(n({tone:i,size:a,pulse:o}),r),...s})}exports.Dot=r,exports.dotVariants=n;
1
+ const e=require("../lib/cn.cjs");let t=require("react/jsx-runtime");const n=(0,require("class-variance-authority").cva)(`inline-block shrink-0 rounded-full`,{variants:{tone:{neutral:`bg-doom-faint`,muted:`bg-doom-faint/40`,blue:`bg-doom-blue`,green:`bg-doom-green`,yellow:`bg-doom-yellow`,red:`bg-doom-red`,magenta:`bg-doom-magenta`,violet:`bg-doom-violet`,cyan:`bg-doom-cyan`,orange:`bg-doom-orange`,teal:`bg-doom-teal`},size:{xs:`h-1 w-1`,sm:`h-1.5 w-1.5`,md:`h-2 w-2`,lg:`h-2.5 w-2.5`},pulse:{true:`animate-pulse`,false:``}},defaultVariants:{tone:`neutral`,size:`sm`,pulse:!1}});function r({className:r,tone:i,size:a,pulse:o,...s}){return/* @__PURE__ */ (0,t.jsx)(`span`,{"data-slot":`dot`,"aria-hidden":!0,className:e.cn(n({tone:i,size:a,pulse:o}),r),...s})}exports.Dot=r,exports.dotVariants=n;
2
2
  //# sourceMappingURL=Dot.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dot.cjs","names":["cva","cn"],"sources":["../../../src/components/Dot.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { ComponentProps } from 'react';\nimport { cn } from '../lib/cn.ts';\nimport type { DotTone as Tone } from '../types/tone.ts';\n\nexport const dotVariants = cva('inline-block shrink-0 rounded-full', {\n variants: {\n tone: {\n neutral: 'bg-doom-faint',\n muted: 'bg-doom-faint/40',\n blue: 'bg-doom-blue',\n green: 'bg-doom-green',\n yellow: 'bg-doom-yellow',\n red: 'bg-doom-red',\n magenta: 'bg-doom-magenta',\n violet: 'bg-doom-violet',\n cyan: 'bg-doom-cyan',\n orange: 'bg-doom-orange',\n teal: 'bg-doom-teal',\n } satisfies Record<Tone, string>,\n size: {\n xs: 'h-1 w-1',\n sm: 'h-1.5 w-1.5',\n md: 'h-2 w-2',\n lg: 'h-2.5 w-2.5',\n },\n pulse: {\n true: 'animate-pulse',\n false: '',\n },\n },\n defaultVariants: { tone: 'neutral', size: 'sm', pulse: false },\n});\n\nexport type DotTone = Tone;\n\nexport interface DotProps extends ComponentProps<'span'>, VariantProps<typeof dotVariants> {}\n\n/** The status dot: a colour and, while something is live, a pulse. */\nexport function Dot({ className, tone, size, pulse, ...props }: DotProps) {\n return <span data-slot=\"dot\" aria-hidden className={cn(dotVariants({ tone, size, pulse }), className)} {...props} />;\n}\n"],"mappings":"oEAKA,MAAa,GAAA,oCAAcA,CAAAA,CAAAA,IAAAA,CAAI,qCAAsC,CACnE,SAAU,CACR,KAAM,CACJ,QAAS,gBACT,MAAO,mBACP,KAAM,eACN,MAAO,gBACP,OAAQ,iBACR,IAAK,cACL,QAAS,kBACT,OAAQ,iBACR,KAAM,eACN,OAAQ,iBACR,KAAM,cACR,EACA,KAAM,CACJ,GAAI,UACJ,GAAI,cACJ,GAAI,UACJ,GAAI,aACN,EACA,MAAO,CACL,KAAM,gBACN,MAAO,EACT,CACF,EACA,gBAAiB,CAAE,KAAM,UAAW,KAAM,KAAM,MAAO,EAAM,CAC/D,CAAC,EAOD,SAAgB,EAAI,CAAE,YAAW,OAAM,OAAM,QAAO,GAAG,GAAmB,CACxE,OAAO,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,YAAU,MAAM,cAAA,GAAY,UAAWC,EAAAA,GAAG,EAAY,CAAE,OAAM,OAAM,OAAM,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CACrH"}
1
+ {"version":3,"file":"Dot.cjs","names":["cva","cn"],"sources":["../../../src/components/Dot.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\nimport type { DotTone as Tone } from '../types/tone';\n\nexport const dotVariants = cva('inline-block shrink-0 rounded-full', {\n variants: {\n tone: {\n neutral: 'bg-doom-faint',\n muted: 'bg-doom-faint/40',\n blue: 'bg-doom-blue',\n green: 'bg-doom-green',\n yellow: 'bg-doom-yellow',\n red: 'bg-doom-red',\n magenta: 'bg-doom-magenta',\n violet: 'bg-doom-violet',\n cyan: 'bg-doom-cyan',\n orange: 'bg-doom-orange',\n teal: 'bg-doom-teal',\n } satisfies Record<Tone, string>,\n size: {\n xs: 'h-1 w-1',\n sm: 'h-1.5 w-1.5',\n md: 'h-2 w-2',\n lg: 'h-2.5 w-2.5',\n },\n pulse: {\n true: 'animate-pulse',\n false: '',\n },\n },\n defaultVariants: { tone: 'neutral', size: 'sm', pulse: false },\n});\n\nexport type DotTone = Tone;\n\nexport interface DotProps extends ComponentProps<'span'>, VariantProps<typeof dotVariants> {}\n\n/** The status dot: a colour and, while something is live, a pulse. */\nexport function Dot({ className, tone, size, pulse, ...props }: DotProps) {\n return <span data-slot=\"dot\" aria-hidden className={cn(dotVariants({ tone, size, pulse }), className)} {...props} />;\n}\n"],"mappings":"oEAMA,MAAa,GAAA,oCAAcA,CAAAA,CAAAA,IAAAA,CAAI,qCAAsC,CACnE,SAAU,CACR,KAAM,CACJ,QAAS,gBACT,MAAO,mBACP,KAAM,eACN,MAAO,gBACP,OAAQ,iBACR,IAAK,cACL,QAAS,kBACT,OAAQ,iBACR,KAAM,eACN,OAAQ,iBACR,KAAM,cACR,EACA,KAAM,CACJ,GAAI,UACJ,GAAI,cACJ,GAAI,UACJ,GAAI,aACN,EACA,MAAO,CACL,KAAM,gBACN,MAAO,EACT,CACF,EACA,gBAAiB,CAAE,KAAM,UAAW,KAAM,KAAM,MAAO,EAAM,CAC/D,CAAC,EAOD,SAAgB,EAAI,CAAE,YAAW,OAAM,OAAM,QAAO,GAAG,GAAmB,CACxE,MAAO,iBAAA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,YAAU,MAAM,cAAA,GAAY,UAAWC,EAAAA,GAAG,EAAY,CAAE,OAAM,OAAM,OAAM,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CACrH"}