@agimon-ai/doompi-web-components 0.0.1-alpha.37 → 0.0.1-alpha.39

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 (339) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.d.mts +2 -1
  3. package/dist/index.mjs +1 -1
  4. package/dist/src/components/Accordion.cjs +1 -1
  5. package/dist/src/components/Accordion.cjs.map +1 -1
  6. package/dist/src/components/Accordion.mjs +1 -1
  7. package/dist/src/components/Accordion.mjs.map +1 -1
  8. package/dist/src/components/AnsiText.cjs +3 -3
  9. package/dist/src/components/AnsiText.cjs.map +1 -1
  10. package/dist/src/components/AnsiText.mjs +3 -3
  11. package/dist/src/components/AnsiText.mjs.map +1 -1
  12. package/dist/src/components/Avatar.cjs +1 -1
  13. package/dist/src/components/Avatar.cjs.map +1 -1
  14. package/dist/src/components/Avatar.mjs +1 -1
  15. package/dist/src/components/Avatar.mjs.map +1 -1
  16. package/dist/src/components/Badge.cjs +1 -1
  17. package/dist/src/components/Badge.cjs.map +1 -1
  18. package/dist/src/components/Badge.mjs +1 -1
  19. package/dist/src/components/Badge.mjs.map +1 -1
  20. package/dist/src/components/Breadcrumb.cjs +1 -1
  21. package/dist/src/components/Breadcrumb.cjs.map +1 -1
  22. package/dist/src/components/Breadcrumb.mjs +1 -1
  23. package/dist/src/components/Breadcrumb.mjs.map +1 -1
  24. package/dist/src/components/Button.cjs +1 -1
  25. package/dist/src/components/Button.cjs.map +1 -1
  26. package/dist/src/components/Button.mjs +1 -1
  27. package/dist/src/components/Button.mjs.map +1 -1
  28. package/dist/src/components/Checkbox.cjs +1 -1
  29. package/dist/src/components/Checkbox.cjs.map +1 -1
  30. package/dist/src/components/Checkbox.mjs +1 -1
  31. package/dist/src/components/Checkbox.mjs.map +1 -1
  32. package/dist/src/components/CodeBlock.cjs +1 -1
  33. package/dist/src/components/CodeBlock.cjs.map +1 -1
  34. package/dist/src/components/CodeBlock.mjs +1 -1
  35. package/dist/src/components/CodeBlock.mjs.map +1 -1
  36. package/dist/src/components/CodeEditor.cjs +1 -1
  37. package/dist/src/components/CodeEditor.cjs.map +1 -1
  38. package/dist/src/components/CodeEditor.mjs +1 -1
  39. package/dist/src/components/CodeEditor.mjs.map +1 -1
  40. package/dist/src/components/CodeEditorView.cjs +1 -1
  41. package/dist/src/components/CodeEditorView.cjs.map +1 -1
  42. package/dist/src/components/CodeEditorView.mjs +1 -1
  43. package/dist/src/components/CodeEditorView.mjs.map +1 -1
  44. package/dist/src/components/Collapsible.cjs +1 -1
  45. package/dist/src/components/Collapsible.cjs.map +1 -1
  46. package/dist/src/components/Collapsible.mjs +1 -1
  47. package/dist/src/components/Collapsible.mjs.map +1 -1
  48. package/dist/src/components/Command.cjs +1 -1
  49. package/dist/src/components/Command.cjs.map +1 -1
  50. package/dist/src/components/Command.mjs +1 -1
  51. package/dist/src/components/Command.mjs.map +1 -1
  52. package/dist/src/components/CopyButton.cjs +1 -1
  53. package/dist/src/components/CopyButton.cjs.map +1 -1
  54. package/dist/src/components/CopyButton.mjs +1 -1
  55. package/dist/src/components/CopyButton.mjs.map +1 -1
  56. package/dist/src/components/Dialog.cjs +1 -1
  57. package/dist/src/components/Dialog.cjs.map +1 -1
  58. package/dist/src/components/Dialog.mjs +1 -1
  59. package/dist/src/components/Dialog.mjs.map +1 -1
  60. package/dist/src/components/Dot.cjs +1 -1
  61. package/dist/src/components/Dot.cjs.map +1 -1
  62. package/dist/src/components/Dot.mjs +1 -1
  63. package/dist/src/components/Dot.mjs.map +1 -1
  64. package/dist/src/components/Drawer.cjs +2 -0
  65. package/dist/src/components/Drawer.cjs.map +1 -0
  66. package/dist/src/components/Drawer.d.mts +17 -0
  67. package/dist/src/components/Drawer.d.mts.map +1 -0
  68. package/dist/src/components/Drawer.mjs +2 -0
  69. package/dist/src/components/Drawer.mjs.map +1 -0
  70. package/dist/src/components/DropdownMenu.cjs +1 -1
  71. package/dist/src/components/DropdownMenu.cjs.map +1 -1
  72. package/dist/src/components/DropdownMenu.mjs +1 -1
  73. package/dist/src/components/DropdownMenu.mjs.map +1 -1
  74. package/dist/src/components/EmptyState.cjs +1 -1
  75. package/dist/src/components/EmptyState.cjs.map +1 -1
  76. package/dist/src/components/EmptyState.mjs +1 -1
  77. package/dist/src/components/EmptyState.mjs.map +1 -1
  78. package/dist/src/components/HashlineLines.cjs +1 -1
  79. package/dist/src/components/HashlineLines.cjs.map +1 -1
  80. package/dist/src/components/HashlineLines.mjs +1 -1
  81. package/dist/src/components/HashlineLines.mjs.map +1 -1
  82. package/dist/src/components/Input.cjs +1 -1
  83. package/dist/src/components/Input.cjs.map +1 -1
  84. package/dist/src/components/Input.mjs +1 -1
  85. package/dist/src/components/Input.mjs.map +1 -1
  86. package/dist/src/components/Kbd.cjs +1 -1
  87. package/dist/src/components/Kbd.cjs.map +1 -1
  88. package/dist/src/components/Kbd.mjs +1 -1
  89. package/dist/src/components/Kbd.mjs.map +1 -1
  90. package/dist/src/components/Label.cjs +1 -1
  91. package/dist/src/components/Label.cjs.map +1 -1
  92. package/dist/src/components/Label.mjs +1 -1
  93. package/dist/src/components/Label.mjs.map +1 -1
  94. package/dist/src/components/Markdown.cjs +1 -1
  95. package/dist/src/components/Markdown.cjs.map +1 -1
  96. package/dist/src/components/Markdown.mjs +1 -1
  97. package/dist/src/components/Markdown.mjs.map +1 -1
  98. package/dist/src/components/MediaPreview.cjs +1 -1
  99. package/dist/src/components/MediaPreview.cjs.map +1 -1
  100. package/dist/src/components/MediaPreview.mjs +1 -1
  101. package/dist/src/components/MediaPreview.mjs.map +1 -1
  102. package/dist/src/components/MermaidDiagram.cjs +1 -1
  103. package/dist/src/components/MermaidDiagram.cjs.map +1 -1
  104. package/dist/src/components/MermaidDiagram.mjs +1 -1
  105. package/dist/src/components/MermaidDiagram.mjs.map +1 -1
  106. package/dist/src/components/MessageItem.cjs +1 -1
  107. package/dist/src/components/MessageItem.cjs.map +1 -1
  108. package/dist/src/components/MessageItem.mjs +1 -1
  109. package/dist/src/components/MessageItem.mjs.map +1 -1
  110. package/dist/src/components/MessageLines.cjs +1 -1
  111. package/dist/src/components/MessageLines.cjs.map +1 -1
  112. package/dist/src/components/MessageLines.mjs +1 -1
  113. package/dist/src/components/MessageLines.mjs.map +1 -1
  114. package/dist/src/components/OptionList.cjs +1 -1
  115. package/dist/src/components/OptionList.cjs.map +1 -1
  116. package/dist/src/components/OptionList.mjs +1 -1
  117. package/dist/src/components/OptionList.mjs.map +1 -1
  118. package/dist/src/components/Panel.cjs +1 -1
  119. package/dist/src/components/Panel.cjs.map +1 -1
  120. package/dist/src/components/Panel.mjs +1 -1
  121. package/dist/src/components/Panel.mjs.map +1 -1
  122. package/dist/src/components/PdfPreview.cjs +1 -1
  123. package/dist/src/components/PdfPreview.cjs.map +1 -1
  124. package/dist/src/components/PdfPreview.mjs +1 -1
  125. package/dist/src/components/PdfPreview.mjs.map +1 -1
  126. package/dist/src/components/Popover.cjs +1 -1
  127. package/dist/src/components/Popover.cjs.map +1 -1
  128. package/dist/src/components/Popover.mjs +1 -1
  129. package/dist/src/components/Popover.mjs.map +1 -1
  130. package/dist/src/components/Progress.cjs +1 -1
  131. package/dist/src/components/Progress.cjs.map +1 -1
  132. package/dist/src/components/Progress.mjs +1 -1
  133. package/dist/src/components/Progress.mjs.map +1 -1
  134. package/dist/src/components/RadioGroup.cjs +1 -1
  135. package/dist/src/components/RadioGroup.cjs.map +1 -1
  136. package/dist/src/components/RadioGroup.mjs +1 -1
  137. package/dist/src/components/RadioGroup.mjs.map +1 -1
  138. package/dist/src/components/ScrollArea.cjs +1 -1
  139. package/dist/src/components/ScrollArea.cjs.map +1 -1
  140. package/dist/src/components/ScrollArea.mjs +1 -1
  141. package/dist/src/components/ScrollArea.mjs.map +1 -1
  142. package/dist/src/components/SectionLabel.cjs +1 -1
  143. package/dist/src/components/SectionLabel.cjs.map +1 -1
  144. package/dist/src/components/SectionLabel.mjs +1 -1
  145. package/dist/src/components/SectionLabel.mjs.map +1 -1
  146. package/dist/src/components/Select.cjs +1 -1
  147. package/dist/src/components/Select.cjs.map +1 -1
  148. package/dist/src/components/Select.mjs +1 -1
  149. package/dist/src/components/Select.mjs.map +1 -1
  150. package/dist/src/components/Separator.cjs +1 -1
  151. package/dist/src/components/Separator.cjs.map +1 -1
  152. package/dist/src/components/Separator.mjs +1 -1
  153. package/dist/src/components/Separator.mjs.map +1 -1
  154. package/dist/src/components/Sheet.cjs +1 -1
  155. package/dist/src/components/Sheet.cjs.map +1 -1
  156. package/dist/src/components/Sheet.mjs +1 -1
  157. package/dist/src/components/Sheet.mjs.map +1 -1
  158. package/dist/src/components/Skeleton.cjs +1 -1
  159. package/dist/src/components/Skeleton.cjs.map +1 -1
  160. package/dist/src/components/Skeleton.mjs +1 -1
  161. package/dist/src/components/Skeleton.mjs.map +1 -1
  162. package/dist/src/components/Spinner.cjs +1 -1
  163. package/dist/src/components/Spinner.cjs.map +1 -1
  164. package/dist/src/components/Spinner.mjs +1 -1
  165. package/dist/src/components/Spinner.mjs.map +1 -1
  166. package/dist/src/components/StatusBadge.cjs +1 -1
  167. package/dist/src/components/StatusBadge.cjs.map +1 -1
  168. package/dist/src/components/StatusBadge.mjs +1 -1
  169. package/dist/src/components/StatusBadge.mjs.map +1 -1
  170. package/dist/src/components/StreamCursor.cjs +1 -1
  171. package/dist/src/components/StreamCursor.cjs.map +1 -1
  172. package/dist/src/components/StreamCursor.mjs +1 -1
  173. package/dist/src/components/StreamCursor.mjs.map +1 -1
  174. package/dist/src/components/Switch.cjs +1 -1
  175. package/dist/src/components/Switch.cjs.map +1 -1
  176. package/dist/src/components/Switch.mjs +1 -1
  177. package/dist/src/components/Switch.mjs.map +1 -1
  178. package/dist/src/components/SyntaxText.cjs +3 -3
  179. package/dist/src/components/SyntaxText.cjs.map +1 -1
  180. package/dist/src/components/SyntaxText.mjs +3 -3
  181. package/dist/src/components/SyntaxText.mjs.map +1 -1
  182. package/dist/src/components/Tabs.cjs +1 -1
  183. package/dist/src/components/Tabs.cjs.map +1 -1
  184. package/dist/src/components/Tabs.mjs +1 -1
  185. package/dist/src/components/Tabs.mjs.map +1 -1
  186. package/dist/src/components/TerminalView.cjs +1 -1
  187. package/dist/src/components/TerminalView.cjs.map +1 -1
  188. package/dist/src/components/TerminalView.mjs +1 -1
  189. package/dist/src/components/TerminalView.mjs.map +1 -1
  190. package/dist/src/components/Textarea.cjs +1 -1
  191. package/dist/src/components/Textarea.cjs.map +1 -1
  192. package/dist/src/components/Textarea.mjs +1 -1
  193. package/dist/src/components/Textarea.mjs.map +1 -1
  194. package/dist/src/components/Toast.cjs +1 -1
  195. package/dist/src/components/Toast.cjs.map +1 -1
  196. package/dist/src/components/Toast.mjs +1 -1
  197. package/dist/src/components/Toast.mjs.map +1 -1
  198. package/dist/src/components/ToolPathLink.cjs +1 -1
  199. package/dist/src/components/ToolPathLink.cjs.map +1 -1
  200. package/dist/src/components/ToolPathLink.mjs +1 -1
  201. package/dist/src/components/ToolPathLink.mjs.map +1 -1
  202. package/dist/src/components/Tooltip.cjs +1 -1
  203. package/dist/src/components/Tooltip.cjs.map +1 -1
  204. package/dist/src/components/Tooltip.mjs +1 -1
  205. package/dist/src/components/Tooltip.mjs.map +1 -1
  206. package/package.json +11 -11
  207. package/dist/components/Accordion.d.cts +0 -11
  208. package/dist/components/Accordion.d.cts.map +0 -1
  209. package/dist/components/AnsiText.d.cts +0 -16
  210. package/dist/components/AnsiText.d.cts.map +0 -1
  211. package/dist/components/Avatar.d.cts +0 -10
  212. package/dist/components/Avatar.d.cts.map +0 -1
  213. package/dist/components/Badge.d.cts +0 -17
  214. package/dist/components/Badge.d.cts.map +0 -1
  215. package/dist/components/Breadcrumb.d.cts +0 -36
  216. package/dist/components/Breadcrumb.d.cts.map +0 -1
  217. package/dist/components/Button.d.cts +0 -24
  218. package/dist/components/Button.d.cts.map +0 -1
  219. package/dist/components/Checkbox.d.cts +0 -8
  220. package/dist/components/Checkbox.d.cts.map +0 -1
  221. package/dist/components/CodeEditor.d.cts +0 -5
  222. package/dist/components/CodeEditor.d.cts.map +0 -1
  223. package/dist/components/Collapsible.d.cts +0 -10
  224. package/dist/components/Collapsible.d.cts.map +0 -1
  225. package/dist/components/Command.d.cts +0 -41
  226. package/dist/components/Command.d.cts.map +0 -1
  227. package/dist/components/Dialog.d.cts +0 -39
  228. package/dist/components/Dialog.d.cts.map +0 -1
  229. package/dist/components/Dot.d.cts +0 -15
  230. package/dist/components/Dot.d.cts.map +0 -1
  231. package/dist/components/DropdownMenu.d.cts +0 -34
  232. package/dist/components/DropdownMenu.d.cts.map +0 -1
  233. package/dist/components/EmptyState.d.cts +0 -17
  234. package/dist/components/EmptyState.d.cts.map +0 -1
  235. package/dist/components/HashlineLines.d.cts +0 -23
  236. package/dist/components/HashlineLines.d.cts.map +0 -1
  237. package/dist/components/Input.d.cts +0 -19
  238. package/dist/components/Input.d.cts.map +0 -1
  239. package/dist/components/Kbd.d.cts +0 -6
  240. package/dist/components/Kbd.d.cts.map +0 -1
  241. package/dist/components/Label.d.cts +0 -8
  242. package/dist/components/Label.d.cts.map +0 -1
  243. package/dist/components/Markdown.d.cts +0 -17
  244. package/dist/components/Markdown.d.cts.map +0 -1
  245. package/dist/components/MediaPreview.d.cts +0 -61
  246. package/dist/components/MediaPreview.d.cts.map +0 -1
  247. package/dist/components/MessageItem.d.cts +0 -102
  248. package/dist/components/MessageItem.d.cts.map +0 -1
  249. package/dist/components/MessageLines.d.cts +0 -23
  250. package/dist/components/MessageLines.d.cts.map +0 -1
  251. package/dist/components/OptionList.d.cts +0 -49
  252. package/dist/components/OptionList.d.cts.map +0 -1
  253. package/dist/components/Panel.d.cts +0 -14
  254. package/dist/components/Panel.d.cts.map +0 -1
  255. package/dist/components/PdfPreview.d.cts +0 -52
  256. package/dist/components/PdfPreview.d.cts.map +0 -1
  257. package/dist/components/Popover.d.cts +0 -19
  258. package/dist/components/Popover.d.cts.map +0 -1
  259. package/dist/components/Progress.d.cts +0 -8
  260. package/dist/components/Progress.d.cts.map +0 -1
  261. package/dist/components/RadioGroup.d.cts +0 -15
  262. package/dist/components/RadioGroup.d.cts.map +0 -1
  263. package/dist/components/ScrollArea.d.cts +0 -13
  264. package/dist/components/ScrollArea.d.cts.map +0 -1
  265. package/dist/components/SectionLabel.d.cts +0 -6
  266. package/dist/components/SectionLabel.d.cts.map +0 -1
  267. package/dist/components/Select.d.cts +0 -19
  268. package/dist/components/Select.d.cts.map +0 -1
  269. package/dist/components/Separator.d.cts +0 -13
  270. package/dist/components/Separator.d.cts.map +0 -1
  271. package/dist/components/Sheet.d.cts +0 -35
  272. package/dist/components/Sheet.d.cts.map +0 -1
  273. package/dist/components/Skeleton.d.cts +0 -10
  274. package/dist/components/Skeleton.d.cts.map +0 -1
  275. package/dist/components/Spinner.d.cts +0 -14
  276. package/dist/components/Spinner.d.cts.map +0 -1
  277. package/dist/components/StatusBadge.d.cts +0 -23
  278. package/dist/components/StatusBadge.d.cts.map +0 -1
  279. package/dist/components/StreamCursor.d.cts +0 -6
  280. package/dist/components/StreamCursor.d.cts.map +0 -1
  281. package/dist/components/Switch.d.cts +0 -8
  282. package/dist/components/Switch.d.cts.map +0 -1
  283. package/dist/components/SyntaxText.d.cts +0 -50
  284. package/dist/components/SyntaxText.d.cts.map +0 -1
  285. package/dist/components/Tabs.d.cts +0 -36
  286. package/dist/components/Tabs.d.cts.map +0 -1
  287. package/dist/components/TerminalView.d.cts +0 -31
  288. package/dist/components/TerminalView.d.cts.map +0 -1
  289. package/dist/components/Textarea.d.cts +0 -9
  290. package/dist/components/Textarea.d.cts.map +0 -1
  291. package/dist/components/Toast.d.cts +0 -24
  292. package/dist/components/Toast.d.cts.map +0 -1
  293. package/dist/components/ToolPathLink.d.cts +0 -22
  294. package/dist/components/ToolPathLink.d.cts.map +0 -1
  295. package/dist/components/Tooltip.d.cts +0 -11
  296. package/dist/components/Tooltip.d.cts.map +0 -1
  297. package/dist/icons/icons.d.cts +0 -2
  298. package/dist/index.d.cts +0 -59
  299. package/dist/lib/ansiSpans.d.cts +0 -42
  300. package/dist/lib/ansiSpans.d.cts.map +0 -1
  301. package/dist/lib/cn.d.cts +0 -6
  302. package/dist/lib/cn.d.cts.map +0 -1
  303. package/dist/lib/collapse.d.cts +0 -14
  304. package/dist/lib/collapse.d.cts.map +0 -1
  305. package/dist/lib/editorLanguage.d.cts +0 -21
  306. package/dist/lib/editorLanguage.d.cts.map +0 -1
  307. package/dist/lib/editorTheme.d.cts +0 -76
  308. package/dist/lib/editorTheme.d.cts.map +0 -1
  309. package/dist/lib/hashlineHighlight.d.cts +0 -30
  310. package/dist/lib/hashlineHighlight.d.cts.map +0 -1
  311. package/dist/lib/hashlineView.d.cts +0 -60
  312. package/dist/lib/hashlineView.d.cts.map +0 -1
  313. package/dist/lib/media.d.cts +0 -11
  314. package/dist/lib/media.d.cts.map +0 -1
  315. package/dist/lib/optionList.d.cts +0 -21
  316. package/dist/lib/optionList.d.cts.map +0 -1
  317. package/dist/lib/syntaxHighlight.d.cts +0 -54
  318. package/dist/lib/syntaxHighlight.d.cts.map +0 -1
  319. package/dist/lib/tone.d.cts +0 -25
  320. package/dist/lib/tone.d.cts.map +0 -1
  321. package/dist/theme/apply.d.cts +0 -25
  322. package/dist/theme/apply.d.cts.map +0 -1
  323. package/dist/theme/builtinThemes.d.cts +0 -11
  324. package/dist/theme/builtinThemes.d.cts.map +0 -1
  325. package/dist/theme/derive.d.cts +0 -14
  326. package/dist/theme/derive.d.cts.map +0 -1
  327. package/dist/theme/parse.d.cts +0 -10
  328. package/dist/theme/parse.d.cts.map +0 -1
  329. package/dist/theme/piTheme.d.cts +0 -19
  330. package/dist/theme/piTheme.d.cts.map +0 -1
  331. package/dist/theme/preference.d.cts +0 -15
  332. package/dist/theme/preference.d.cts.map +0 -1
  333. package/dist/theme.d.cts +0 -8
  334. package/dist/types/editor.d.cts +0 -78
  335. package/dist/types/editor.d.cts.map +0 -1
  336. package/dist/types/theme.d.cts +0 -38
  337. package/dist/types/theme.d.cts.map +0 -1
  338. package/dist/types/tone.d.cts +0 -28
  339. package/dist/types/tone.d.cts.map +0 -1
@@ -1,2 +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 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`?i(e,{className:`size-3 text-doom-green`}):i(t,{className:`size-3`})})}export{l as CopyButton};
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
2
  //# sourceMappingURL=CopyButton.mjs.map
@@ -1 +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,OACE,EAAC,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,EAAC,EAAD,CAAW,UAAU,wBAA0B,CAAA,EAAI,EAAC,EAAD,CAAU,UAAU,QAAU,CAAA,CACjG,CAAA,CAEZ"}
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("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(0,r.jsx)(s.Provider,{value:t,children:(0,r.jsx)(n.Dialog.Root,{"data-slot":`dialog`,...e,onOpenChange:t})})}function l(e){return(0,r.jsx)(n.Dialog.Trigger,{"data-slot":`dialog-trigger`,...e})}function u(e){return(0,r.jsx)(n.Dialog.Portal,{"data-slot":`dialog-portal`,...e})}function d(e){return(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(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(0,r.jsxs)(u,{children:[(0,r.jsx)(f,{}),(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(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?(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)(o.X,{className:`h-3 w-3`})})}):null]})}function g({className:t,...i}){return(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(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(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(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;
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":["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,OACE,EAAA,EAAA,IAAA,CAAC,EAAwB,SAAzB,CAAkC,MAAO,EACvC,UAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,OAAgB,KAAjB,CAAsB,YAAU,SAAS,GAAI,EAAqB,cAAe,CAAA,CACjD,CAAA,CAEtC,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,GAA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ACG,EAAAA,OAAD,CAAQ,QAAQ,QAAQ,KAAK,OAAO,aAAY,EAAY,UAAU,qCACpE,UAAA,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,OACE,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,OACE,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,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,SA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AAE,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,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{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 i(l.Provider,{value:t,children:i(r.Root,{"data-slot":`dialog`,...e,onOpenChange:t})})}function d(e){return i(r.Trigger,{"data-slot":`dialog-trigger`,...e})}function f(e){return i(r.Portal,{"data-slot":`dialog-portal`,...e})}function p(e){return i(r.Close,{"data-slot":`dialog-close`,...e})}function m({className:e,onPointerDownCapture:n,...a}){let o=s(l);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),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 a(f,{children:[i(m,{}),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 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 v({className:e,...n}){return 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 i(r.Description,{"data-slot":`dialog-description`,className:t(`text-sm leading-relaxed text-doom-dim`,e),...n})}function b({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 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 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};
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 { 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,OACE,EAAC,EAAwB,SAAzB,CAAkC,MAAO,EACvC,SAAA,EAACC,EAAgB,KAAjB,CAAsB,YAAU,SAAS,GAAI,EAAqB,cAAe,CAAA,CACjD,CAAA,CAEtC,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,CAC5B,YACA,uBACA,GAAG,GAC8C,CACjD,IAAM,EAAe,EAAW,CAAuB,EACvD,OACE,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,UAAW,EAAG,yEAA0E,CAAS,EACjG,qBAAuB,GAAU,CAC/B,IAAuB,CAAK,EACxB,IAAM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S,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,OAAO,EAAC,MAAD,CAAK,YAAU,gBAAgB,UAAW,EAAG,EAAqB,CAAE,SAAQ,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CACjH"}
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 { 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,YAAU,SAAS,GAAI,EAAqB,cAAe,CAAA,CACjD,CAAA,CAEtC,CAEA,SAAgB,EAAc,EAAuD,CACnF,MAAO,kBAACA,EAAgB,QAAjB,CAAyB,YAAU,iBAAiB,GAAI,CAAQ,CAAA,CACzE,CAEA,SAAgB,EAAa,EAAsD,CACjF,MAAO,kBAACA,EAAgB,OAAjB,CAAwB,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CACvE,CAEA,SAAgB,EAAY,EAAqD,CAC/E,MAAO,kBAACA,EAAgB,MAAjB,CAAuB,YAAU,eAAe,GAAI,CAAQ,CAAA,CACrE,CAEA,SAAgB,EAAc,CAC5B,YACA,uBACA,GAAG,GAC8C,CACjD,IAAM,EAAe,EAAW,CAAuB,EACvD,MACE,kBAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,UAAW,EAAG,yEAA0E,CAAS,EACjG,qBAAuB,GAAU,CAC/B,IAAuB,CAAK,EACxB,IAAM,kBAAoB,IAAiB,IAAA,KACzB,EAAM,cAAc,oBACD,cAAc,iDAAiD,GAC9E,OAI1B,EAAM,gBAAgB,EACtB,EAAa,EAAK,EACpB,EACA,GAAI,CACL,CAAA,CAEL,CAOA,MAAM,EAAgB,CAAE,GAAI,YAAa,GAAI,YAAa,GAAI,WAAY,EAE1E,SAAgB,EAAc,CAAE,YAAW,WAAU,QAAQ,KA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AD,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';\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,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"}
@@ -1,2 +1,2 @@
1
- import{cn as e}from"../lib/cn.mjs";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";const r=n(`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 i({className:n,tone:i,size:a,pulse:o,...s}){return t(`span`,{"data-slot":`dot`,"aria-hidden":!0,className:e(r({tone:i,size:a,pulse:o}),n),...s})}export{i as Dot,r as dotVariants};
1
+ import{cn as e}from"../lib/cn.mjs";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";const r=n(`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 i({className:n,tone:i,size:a,pulse:o,...s}){return/* @__PURE__ */ t(`span`,{"data-slot":`dot`,"aria-hidden":!0,className:e(r({tone:i,size:a,pulse:o}),n),...s})}export{i as Dot,r as dotVariants};
2
2
  //# sourceMappingURL=Dot.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dot.mjs","names":[],"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":"0HAMA,MAAa,EAAc,EAAI,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,EAAC,OAAD,CAAM,YAAU,MAAM,cAAA,GAAY,UAAW,EAAG,EAAY,CAAE,OAAM,OAAM,OAAM,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CACrH"}
1
+ {"version":3,"file":"Dot.mjs","names":[],"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":"0HAMA,MAAa,EAAc,EAAI,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,kBAAC,OAAD,CAAM,YAAU,MAAM,cAAA,GAAY,UAAW,EAAG,EAAY,CAAE,OAAM,OAAM,OAAM,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CACrH"}
@@ -0,0 +1,2 @@
1
+ const e=require("../lib/cn.cjs"),t=require("./Dialog.cjs");let n=require("radix-ui"),r=require("react/jsx-runtime"),i=require("react");function a({open:a,onOpenChange:o,side:s,title:c,children:l,className:u,showHeader:d=!0,"data-testid":f,backdropTestId:p}){let m=(0,i.useRef)(null);return/* @__PURE__ */ (0,r.jsx)(t.Dialog,{open:a,onOpenChange:o,children:/* @__PURE__ */ (0,r.jsxs)(t.DialogPortal,{children:[/* @__PURE__ */ (0,r.jsx)(t.DialogOverlay,{"data-testid":p}),/* @__PURE__ */ (0,r.jsxs)(n.Dialog.Content,{"aria-describedby":void 0,"data-testid":f,className:e.cn(`fixed inset-y-0 z-50 flex w-[min(300px,calc(100vw-48px))] flex-col overflow-y-auto border-doom-border bg-doom-rail outline-none`,s===`left`?`left-0 border-r`:`right-0 border-l`,u),onOpenAutoFocus:()=>{m.current=document.activeElement instanceof HTMLElement?document.activeElement:null},onCloseAutoFocus:e=>{e.preventDefault(),m.current?.isConnected&&m.current.focus()},children:[d?/* @__PURE__ */ (0,r.jsx)(t.DialogHeader,{dismissible:!0,closeLabel:`hide ${c.toLowerCase()}`,children:/* @__PURE__ */ (0,r.jsx)(t.DialogTitle,{children:c})}):/* @__PURE__ */ (0,r.jsx)(t.DialogTitle,{className:`sr-only`,children:c}),l]})]})})}exports.Drawer=a;
2
+ //# sourceMappingURL=Drawer.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Drawer.cjs","names":["useRef","Dialog","DialogPortal","DialogOverlay","DialogPrimitive","cn","DialogHeader","DialogTitle"],"sources":["../../../src/components/Drawer.tsx"],"sourcesContent":["import { Dialog as DialogPrimitive } from 'radix-ui';\nimport { type ReactNode, useRef } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { Dialog, DialogHeader, DialogOverlay, DialogPortal, DialogTitle } from './Dialog';\n\nexport interface DrawerProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n side: 'left' | 'right';\n title: string;\n children: ReactNode;\n className?: string;\n showHeader?: boolean;\n 'data-testid'?: string;\n backdropTestId?: string;\n}\n\n/** A controlled side panel with a focus trap and restoration for external header buttons. */\nexport function Drawer({\n open,\n onOpenChange,\n side,\n title,\n children,\n className,\n showHeader = true,\n 'data-testid': testId,\n backdropTestId,\n}: DrawerProps) {\n const opener = useRef<HTMLElement | null>(null);\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogPortal>\n <DialogOverlay data-testid={backdropTestId} />\n <DialogPrimitive.Content\n aria-describedby={undefined}\n data-testid={testId}\n className={cn(\n 'fixed inset-y-0 z-50 flex w-[min(300px,calc(100vw-48px))] flex-col overflow-y-auto border-doom-border bg-doom-rail outline-none',\n side === 'left' ? 'left-0 border-r' : 'right-0 border-l',\n className,\n )}\n onOpenAutoFocus={() => {\n opener.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n }}\n onCloseAutoFocus={(event) => {\n event.preventDefault();\n if (opener.current?.isConnected) opener.current.focus();\n }}\n >\n {showHeader ? (\n <DialogHeader dismissible closeLabel={`hide ${title.toLowerCase()}`}>\n <DialogTitle>{title}</DialogTitle>\n </DialogHeader>\n ) : (\n <DialogTitle className=\"sr-only\">{title}</DialogTitle>\n )}\n {children}\n </DialogPrimitive.Content>\n </DialogPortal>\n </Dialog>\n );\n}\n"],"mappings":"uIAmBA,SAAgB,EAAO,CACrB,OACA,eACA,OACA,QACA,WACA,YACA,aAAa,GACb,cAAe,EACf,kBACc,CACd,IAAM,GAAA,EAASA,EAAAA,OAAAA,CAA2B,IAAI,EAC9C,MACE,iBAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,OAAD,CAAc,OAAoB,eAChC,SAAA,iBAAA,EAAA,EAAA,KAAA,CAACC,EAAAA,aAAD,CAAA,SAAA,CACE,iBAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,cAAD,CAAe,cAAa,CAAiB,CAAA,EAC7C,iBAAA,EAAA,EAAA,KAAA,CAACC,EAAAA,OAAgB,QAAjB,CACE,mBAAkB,IAAA,GAClB,cAAa,EACb,UAAWC,EAAAA,GACT,kIACA,IAAS,OAAS,kBAAoB,mBACtC,CACF,EACA,oBAAuB,CACrB,EAAO,QAAU,SAAS,yBAAyB,YAAc,SAAS,cAAgB,IAC5F,EACA,iBAAmB,GAAU,CAC3B,EAAM,eAAe,EACjB,EAAO,SAAS,aAAa,EAAO,QAAQ,MAAM,CACxD,EAdF,SAAA,CAgBG,EACC,iBAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,aAAD,CAAc,YAAA,GAAY,WAAY,QAAQ,EAAM,YAAY,IAC9D,SAAA,iBAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,YAAD,CAAA,SAAc,CAAmB,CAAA,CACrB,CAAA,EAEd,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,YAAD,CAAa,UAAU,UAAW,SAAA,CAAmB,CAAA,EAEtD,CACsB,CACb,CAAA,CAAA,CAAA,CAAA,CACR,CAAA,CAEZ"}
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/components/Drawer.d.ts
3
+ export interface DrawerProps {
4
+ open: boolean;
5
+ onOpenChange: (open: boolean) => void;
6
+ side: 'left' | 'right';
7
+ title: string;
8
+ children: ReactNode;
9
+ className?: string;
10
+ showHeader?: boolean;
11
+ 'data-testid'?: string;
12
+ backdropTestId?: string;
13
+ }
14
+ /** A controlled side panel with a focus trap and restoration for external header buttons. */
15
+ export declare function Drawer({ open, onOpenChange, side, title, children, className, showHeader, 'data-testid': testId, backdropTestId }: DrawerProps): import("react").JSX.Element;
16
+ //#endregion
17
+ //# sourceMappingURL=Drawer.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Drawer.d.mts","names":[],"sources":["../../../src/components/Drawer.tsx"],"mappings":";;iBAMiB;EACf;EACA,eAAe;EACf;EACA;EACA,UAAU;EACV;EACA;EACA;EACA;;;wBAIc,SACd,MACA,cACA,MACA,OACA,UACA,WACA,2BACe,QACf,kBACC,8BAAW,IAAA"}
@@ -0,0 +1,2 @@
1
+ import{cn as e}from"../lib/cn.mjs";import{Dialog as t,DialogHeader as n,DialogOverlay as r,DialogPortal as i,DialogTitle as a}from"./Dialog.mjs";import{Dialog as o}from"radix-ui";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{useRef as l}from"react";function u({open:u,onOpenChange:d,side:f,title:p,children:m,className:h,showHeader:g=!0,"data-testid":_,backdropTestId:v}){let y=l(null);return/* @__PURE__ */ s(t,{open:u,onOpenChange:d,children:/* @__PURE__ */ c(i,{children:[/* @__PURE__ */ s(r,{"data-testid":v}),/* @__PURE__ */ c(o.Content,{"aria-describedby":void 0,"data-testid":_,className:e(`fixed inset-y-0 z-50 flex w-[min(300px,calc(100vw-48px))] flex-col overflow-y-auto border-doom-border bg-doom-rail outline-none`,f===`left`?`left-0 border-r`:`right-0 border-l`,h),onOpenAutoFocus:()=>{y.current=document.activeElement instanceof HTMLElement?document.activeElement:null},onCloseAutoFocus:e=>{e.preventDefault(),y.current?.isConnected&&y.current.focus()},children:[g?/* @__PURE__ */ s(n,{dismissible:!0,closeLabel:`hide ${p.toLowerCase()}`,children:/* @__PURE__ */ s(a,{children:p})}):/* @__PURE__ */ s(a,{className:`sr-only`,children:p}),m]})]})})}export{u as Drawer};
2
+ //# sourceMappingURL=Drawer.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Drawer.mjs","names":["Dialog","DialogPrimitive"],"sources":["../../../src/components/Drawer.tsx"],"sourcesContent":["import { Dialog as DialogPrimitive } from 'radix-ui';\nimport { type ReactNode, useRef } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { Dialog, DialogHeader, DialogOverlay, DialogPortal, DialogTitle } from './Dialog';\n\nexport interface DrawerProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n side: 'left' | 'right';\n title: string;\n children: ReactNode;\n className?: string;\n showHeader?: boolean;\n 'data-testid'?: string;\n backdropTestId?: string;\n}\n\n/** A controlled side panel with a focus trap and restoration for external header buttons. */\nexport function Drawer({\n open,\n onOpenChange,\n side,\n title,\n children,\n className,\n showHeader = true,\n 'data-testid': testId,\n backdropTestId,\n}: DrawerProps) {\n const opener = useRef<HTMLElement | null>(null);\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogPortal>\n <DialogOverlay data-testid={backdropTestId} />\n <DialogPrimitive.Content\n aria-describedby={undefined}\n data-testid={testId}\n className={cn(\n 'fixed inset-y-0 z-50 flex w-[min(300px,calc(100vw-48px))] flex-col overflow-y-auto border-doom-border bg-doom-rail outline-none',\n side === 'left' ? 'left-0 border-r' : 'right-0 border-l',\n className,\n )}\n onOpenAutoFocus={() => {\n opener.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n }}\n onCloseAutoFocus={(event) => {\n event.preventDefault();\n if (opener.current?.isConnected) opener.current.focus();\n }}\n >\n {showHeader ? (\n <DialogHeader dismissible closeLabel={`hide ${title.toLowerCase()}`}>\n <DialogTitle>{title}</DialogTitle>\n </DialogHeader>\n ) : (\n <DialogTitle className=\"sr-only\">{title}</DialogTitle>\n )}\n {children}\n </DialogPrimitive.Content>\n </DialogPortal>\n </Dialog>\n );\n}\n"],"mappings":"oQAmBA,SAAgB,EAAO,CACrB,OACA,eACA,OACA,QACA,WACA,YACA,aAAa,GACb,cAAe,EACf,kBACc,CACd,IAAM,EAAS,EAA2B,IAAI,EAC9C,MACE,kBAACA,EAAD,CAAc,OAAoB,eAChC,SAAA,kBAAC,EAAD,CAAA,SAAA,CACE,kBAAC,EAAD,CAAe,cAAa,CAAiB,CAAA,EAC7C,kBAACC,EAAgB,QAAjB,CACE,mBAAkB,IAAA,GAClB,cAAa,EACb,UAAW,EACT,kIACA,IAAS,OAAS,kBAAoB,mBACtC,CACF,EACA,oBAAuB,CACrB,EAAO,QAAU,SAAS,yBAAyB,YAAc,SAAS,cAAgB,IAC5F,EACA,iBAAmB,GAAU,CAC3B,EAAM,eAAe,EACjB,EAAO,SAAS,aAAa,EAAO,QAAQ,MAAM,CACxD,EAdF,SAAA,CAgBG,EACC,kBAAC,EAAD,CAAc,YAAA,GAAY,WAAY,QAAQ,EAAM,YAAY,IAC9D,SAAA,kBAAC,EAAD,CAAA,SAAc,CAAmB,CAAA,CACrB,CAAA,EAEd,kBAAC,EAAD,CAAa,UAAU,UAAW,SAAA,CAAmB,CAAA,EAEtD,CACsB,CACb,CAAA,CAAA,CAAA,CAAA,CACR,CAAA,CAEZ"}
@@ -1,2 +1,2 @@
1
- require("../icons/icons.cjs");const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime"),r=require("class-variance-authority"),i=require("lucide-react");function a(e){return(0,n.jsx)(t.DropdownMenu.Root,{"data-slot":`dropdown-menu`,...e})}function o(e){return(0,n.jsx)(t.DropdownMenu.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function s(e){return(0,n.jsx)(t.DropdownMenu.Group,{"data-slot":`dropdown-menu-group`,...e})}const c=`z-50 flex min-w-[120px] flex-col overflow-hidden rounded border border-doom-border bg-doom-panel py-1 font-mono shadow-xl outline-none data-[state=open]:animate-doom-rise`;function l({className:r,align:i=`end`,sideOffset:a=4,...o}){return(0,n.jsx)(t.DropdownMenu.Portal,{children:(0,n.jsx)(t.DropdownMenu.Content,{"data-slot":`dropdown-menu-content`,align:i,sideOffset:a,className:e.cn(c,r),...o})})}const u=(0,r.cva)(`flex w-full cursor-pointer items-center gap-2 px-2.5 py-1.5 text-left text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40 data-[highlighted]:bg-doom-deep`,{variants:{variant:{default:`text-doom-hi`,destructive:`text-doom-red`},indented:{true:`pl-7`,false:``}},defaultVariants:{variant:`default`,indented:!1}});function d({className:r,variant:i,indented:a,...o}){return(0,n.jsx)(t.DropdownMenu.Item,{"data-slot":`dropdown-menu-item`,"data-variant":i??`default`,className:e.cn(u({variant:i,indented:a}),r),...o})}function f({children:e}){return(0,n.jsx)(`span`,{className:`pointer-events-none absolute left-2.5 flex h-3 w-3 items-center justify-center`,children:(0,n.jsx)(t.DropdownMenu.ItemIndicator,{children:e})})}function p({className:r,variant:a,children:o,...s}){return(0,n.jsxs)(t.DropdownMenu.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,className:e.cn(`relative`,u({variant:a,indented:!0}),r),...s,children:[(0,n.jsx)(f,{children:(0,n.jsx)(i.Check,{className:`h-3 w-3 text-doom-blue`})}),o]})}function m(e){return(0,n.jsx)(t.DropdownMenu.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function h({className:r,variant:i,children:a,...o}){return(0,n.jsxs)(t.DropdownMenu.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:e.cn(`relative`,u({variant:i,indented:!0}),r),...o,children:[(0,n.jsx)(f,{children:(0,n.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-doom-blue`})}),a]})}function g(e){return(0,n.jsx)(t.DropdownMenu.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function _({className:r,children:a,...o}){return(0,n.jsxs)(t.DropdownMenu.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,className:e.cn(u(),`data-[state=open]:bg-doom-deep`,r),...o,children:[(0,n.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:a}),(0,n.jsx)(i.ChevronRight,{className:`h-3 w-3 shrink-0 text-doom-faint`})]})}function v({className:r,sideOffset:i=2,...a}){return(0,n.jsx)(t.DropdownMenu.Portal,{children:(0,n.jsx)(t.DropdownMenu.SubContent,{"data-slot":`dropdown-menu-sub-content`,sideOffset:i,className:e.cn(c,r),...a})})}function y({className:r,...i}){return(0,n.jsx)(t.DropdownMenu.Label,{"data-slot":`dropdown-menu-label`,className:e.cn(`px-2.5 py-1 text-2xs font-bold tracking-wider text-doom-faint uppercase`,r),...i})}function b({className:t,...r}){return(0,n.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e.cn(`ml-auto shrink-0 text-xs tracking-wide text-doom-faint`,t),...r})}function x({className:r,...i}){return(0,n.jsx)(t.DropdownMenu.Separator,{"data-slot":`dropdown-menu-separator`,className:e.cn(`my-1 h-px bg-doom-border-soft`,r),...i})}exports.DropdownMenu=a,exports.DropdownMenuCheckboxItem=p,exports.DropdownMenuContent=l,exports.DropdownMenuGroup=s,exports.DropdownMenuItem=d,exports.DropdownMenuLabel=y,exports.DropdownMenuRadioGroup=m,exports.DropdownMenuRadioItem=h,exports.DropdownMenuSeparator=x,exports.DropdownMenuShortcut=b,exports.DropdownMenuSub=g,exports.DropdownMenuSubContent=v,exports.DropdownMenuSubTrigger=_,exports.DropdownMenuTrigger=o,exports.dropdownMenuItemVariants=u;
1
+ require("../icons/icons.cjs");const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime"),r=require("class-variance-authority"),i=require("lucide-react");function a(e){return/* @__PURE__ */ (0,n.jsx)(t.DropdownMenu.Root,{"data-slot":`dropdown-menu`,...e})}function o(e){return/* @__PURE__ */ (0,n.jsx)(t.DropdownMenu.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function s(e){return/* @__PURE__ */ (0,n.jsx)(t.DropdownMenu.Group,{"data-slot":`dropdown-menu-group`,...e})}const c=`z-50 flex min-w-[120px] flex-col overflow-hidden rounded border border-doom-border bg-doom-panel py-1 font-mono shadow-xl outline-none data-[state=open]:animate-doom-rise`;function l({className:r,align:i=`end`,sideOffset:a=4,...o}){return/* @__PURE__ */ (0,n.jsx)(t.DropdownMenu.Portal,{children:/* @__PURE__ */ (0,n.jsx)(t.DropdownMenu.Content,{"data-slot":`dropdown-menu-content`,align:i,sideOffset:a,className:e.cn(c,r),...o})})}const u=(0,r.cva)(`flex w-full cursor-pointer items-center gap-2 px-2.5 py-1.5 text-left text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40 data-[highlighted]:bg-doom-deep`,{variants:{variant:{default:`text-doom-hi`,destructive:`text-doom-red`},indented:{true:`pl-7`,false:``}},defaultVariants:{variant:`default`,indented:!1}});function d({className:r,variant:i,indented:a,...o}){return/* @__PURE__ */ (0,n.jsx)(t.DropdownMenu.Item,{"data-slot":`dropdown-menu-item`,"data-variant":i??`default`,className:e.cn(u({variant:i,indented:a}),r),...o})}function f({children:e}){return/* @__PURE__ */ (0,n.jsx)(`span`,{className:`pointer-events-none absolute left-2.5 flex h-3 w-3 items-center justify-center`,children:/* @__PURE__ */ (0,n.jsx)(t.DropdownMenu.ItemIndicator,{children:e})})}function p({className:r,variant:a,children:o,...s}){return/* @__PURE__ */ (0,n.jsxs)(t.DropdownMenu.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,className:e.cn(`relative`,u({variant:a,indented:!0}),r),...s,children:[/* @__PURE__ */ (0,n.jsx)(f,{children:/* @__PURE__ */ (0,n.jsx)(i.Check,{className:`h-3 w-3 text-doom-blue`})}),o]})}function m(e){return/* @__PURE__ */ (0,n.jsx)(t.DropdownMenu.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function h({className:r,variant:i,children:a,...o}){return/* @__PURE__ */ (0,n.jsxs)(t.DropdownMenu.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:e.cn(`relative`,u({variant:i,indented:!0}),r),...o,children:[/* @__PURE__ */ (0,n.jsx)(f,{children:/* @__PURE__ */ (0,n.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-doom-blue`})}),a]})}function g(e){return/* @__PURE__ */ (0,n.jsx)(t.DropdownMenu.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function _({className:r,children:a,...o}){return/* @__PURE__ */ (0,n.jsxs)(t.DropdownMenu.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,className:e.cn(u(),`data-[state=open]:bg-doom-deep`,r),...o,children:[/* @__PURE__ */ (0,n.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:a}),/* @__PURE__ */ (0,n.jsx)(i.ChevronRight,{className:`h-3 w-3 shrink-0 text-doom-faint`})]})}function v({className:r,sideOffset:i=2,...a}){return/* @__PURE__ */ (0,n.jsx)(t.DropdownMenu.Portal,{children:/* @__PURE__ */ (0,n.jsx)(t.DropdownMenu.SubContent,{"data-slot":`dropdown-menu-sub-content`,sideOffset:i,className:e.cn(c,r),...a})})}function y({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.DropdownMenu.Label,{"data-slot":`dropdown-menu-label`,className:e.cn(`px-2.5 py-1 text-2xs font-bold tracking-wider text-doom-faint uppercase`,r),...i})}function b({className:t,...r}){return/* @__PURE__ */ (0,n.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e.cn(`ml-auto shrink-0 text-xs tracking-wide text-doom-faint`,t),...r})}function x({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.DropdownMenu.Separator,{"data-slot":`dropdown-menu-separator`,className:e.cn(`my-1 h-px bg-doom-border-soft`,r),...i})}exports.DropdownMenu=a,exports.DropdownMenuCheckboxItem=p,exports.DropdownMenuContent=l,exports.DropdownMenuGroup=s,exports.DropdownMenuItem=d,exports.DropdownMenuLabel=y,exports.DropdownMenuRadioGroup=m,exports.DropdownMenuRadioItem=h,exports.DropdownMenuSeparator=x,exports.DropdownMenuShortcut=b,exports.DropdownMenuSub=g,exports.DropdownMenuSubContent=v,exports.DropdownMenuSubTrigger=_,exports.DropdownMenuTrigger=o,exports.dropdownMenuItemVariants=u;
2
2
  //# sourceMappingURL=DropdownMenu.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenu.cjs","names":["DropdownMenuPrimitive","cn","cva","CheckIcon","ChevronRightIcon"],"sources":["../../../src/components/DropdownMenu.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { CheckIcon, ChevronRightIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\n\n/** shadcn's DropdownMenu on Radix: roving focus, typeahead, outside click, Escape. */\nexport function DropdownMenu(props: ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nexport function DropdownMenuTrigger(props: ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\n/** A run of items under one label, so the separator between groups is structural. */\nexport function DropdownMenuGroup(props: ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\n/** The surface every menu and submenu wears. */\nconst CONTENT_CLASS =\n 'z-50 flex min-w-[120px] flex-col overflow-hidden rounded border border-doom-border bg-doom-panel py-1 font-mono shadow-xl outline-none data-[state=open]:animate-doom-rise';\n\nexport function DropdownMenuContent({\n className,\n align = 'end',\n sideOffset = 4,\n ...props\n}: ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(CONTENT_CLASS, className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport const dropdownMenuItemVariants = cva(\n 'flex w-full cursor-pointer items-center gap-2 px-2.5 py-1.5 text-left text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40 data-[highlighted]:bg-doom-deep',\n {\n variants: {\n variant: {\n default: 'text-doom-hi',\n destructive: 'text-doom-red',\n },\n /** A row that carries a check or bullet keeps a gutter for it, so labels line up whether or not one is set. */\n indented: { true: 'pl-7', false: '' },\n },\n defaultVariants: { variant: 'default', indented: false },\n },\n);\n\nexport interface DropdownMenuItemProps\n extends ComponentProps<typeof DropdownMenuPrimitive.Item>, VariantProps<typeof dropdownMenuItemVariants> {}\n\nexport function DropdownMenuItem({ className, variant, indented, ...props }: DropdownMenuItemProps) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-variant={variant ?? 'default'}\n className={cn(dropdownMenuItemVariants({ variant, indented }), className)}\n {...props}\n />\n );\n}\n\n/** The check or bullet a selectable row shows when it is set; it sits in the row's gutter. */\nfunction ItemIndicator({ children }: { children: ReactNode }) {\n return (\n <span className=\"pointer-events-none absolute left-2.5 flex h-3 w-3 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>{children}</DropdownMenuPrimitive.ItemIndicator>\n </span>\n );\n}\n\nexport interface DropdownMenuCheckboxItemProps\n extends ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>, VariantProps<typeof dropdownMenuItemVariants> {}\n\n/** A row that toggles: the check lives in the gutter so the label never shifts. */\nexport function DropdownMenuCheckboxItem({ className, variant, children, ...props }: DropdownMenuCheckboxItemProps) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn('relative', dropdownMenuItemVariants({ variant, indented: true }), className)}\n {...props}\n >\n <ItemIndicator>\n <CheckIcon className=\"h-3 w-3 text-doom-blue\" />\n </ItemIndicator>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\n/** The exclusive-choice group; pair it with DropdownMenuRadioItem. */\nexport function DropdownMenuRadioGroup(props: ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nexport interface DropdownMenuRadioItemProps\n extends ComponentProps<typeof DropdownMenuPrimitive.RadioItem>, VariantProps<typeof dropdownMenuItemVariants> {}\n\nexport function DropdownMenuRadioItem({ className, variant, children, ...props }: DropdownMenuRadioItemProps) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn('relative', dropdownMenuItemVariants({ variant, indented: true }), className)}\n {...props}\n >\n <ItemIndicator>\n <span className=\"h-1.5 w-1.5 rounded-full bg-doom-blue\" />\n </ItemIndicator>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nexport function DropdownMenuSub(props: ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\n/** The row that opens a submenu; the chevron is part of the row, not the caller's job. */\nexport function DropdownMenuSubTrigger({\n className,\n children,\n ...props\n}: ComponentProps<typeof DropdownMenuPrimitive.SubTrigger>) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n className={cn(dropdownMenuItemVariants(), 'data-[state=open]:bg-doom-deep', className)}\n {...props}\n >\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n <ChevronRightIcon className=\"h-3 w-3 shrink-0 text-doom-faint\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nexport function DropdownMenuSubContent({\n className,\n sideOffset = 2,\n ...props\n}: ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n sideOffset={sideOffset}\n className={cn(CONTENT_CLASS, className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport function DropdownMenuLabel({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Label>) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n className={cn('px-2.5 py-1 text-2xs font-bold tracking-wider text-doom-faint uppercase', className)}\n {...props}\n />\n );\n}\n\n/** The keystroke printed at the right of a row; the row supplies the gap. */\nexport function DropdownMenuShortcut({ className, ...props }: ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn('ml-auto shrink-0 text-xs tracking-wide text-doom-faint', className)}\n {...props}\n />\n );\n}\n\nexport function DropdownMenuSeparator({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn('my-1 h-px bg-doom-border-soft', className)}\n {...props}\n />\n );\n}\n"],"mappings":"wLAQA,SAAgB,EAAa,EAA0D,CACrF,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,aAAsB,KAAvB,CAA4B,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CAC3E,CAEA,SAAgB,EAAoB,EAA6D,CAC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G,EAAAA,aAAD,CAAkB,UAAU,kCAAoC,CAAA,CAChC,GAEtC,CAEA,SAAgB,EAAuB,CACrC,YACA,aAAa,EACb,GAAG,GACuD,CAC1D,OACE,EAAA,EAAA,IAAA,CAACJ,EAAAA,aAAsB,OAAvB,CAAA,UACE,EAAA,EAAA,IAAA,CAACA,EAAAA,aAAsB,WAAvB,CACE,YAAU,4BACE,aACZ,UAAWC,EAAAA,GAAG,EAAe,CAAS,EACtC,GAAI,CACL,CAAA,CAC2B,CAAA,CAElC,CAEA,SAAgB,EAAkB,CAAE,YAAW,GAAG,GAA6D,CAC7G,OACE,EAAA,EAAA,IAAA,CAACD,EAAAA,aAAsB,MAAvB,CACE,YAAU,sBACV,UAAWC,EAAAA,GAAG,0EAA2E,CAAS,EAClG,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAqB,CAAE,YAAW,GAAG,GAAiC,CACpF,OACE,EAAA,EAAA,IAAA,CAAC,OAAD,CACE,YAAU,yBACV,UAAWA,EAAAA,GAAG,yDAA0D,CAAS,EACjF,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAsB,CAAE,YAAW,GAAG,GAAiE,CACrH,OACE,EAAA,EAAA,IAAA,CAACD,EAAAA,aAAsB,UAAvB,CACE,YAAU,0BACV,UAAWC,EAAAA,GAAG,gCAAiC,CAAS,EACxD,GAAI,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"DropdownMenu.cjs","names":["DropdownMenuPrimitive","cn","cva","CheckIcon","ChevronRightIcon"],"sources":["../../../src/components/DropdownMenu.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { CheckIcon, ChevronRightIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\n\n/** shadcn's DropdownMenu on Radix: roving focus, typeahead, outside click, Escape. */\nexport function DropdownMenu(props: ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nexport function DropdownMenuTrigger(props: ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\n/** A run of items under one label, so the separator between groups is structural. */\nexport function DropdownMenuGroup(props: ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\n/** The surface every menu and submenu wears. */\nconst CONTENT_CLASS =\n 'z-50 flex min-w-[120px] flex-col overflow-hidden rounded border border-doom-border bg-doom-panel py-1 font-mono shadow-xl outline-none data-[state=open]:animate-doom-rise';\n\nexport function DropdownMenuContent({\n className,\n align = 'end',\n sideOffset = 4,\n ...props\n}: ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(CONTENT_CLASS, className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport const dropdownMenuItemVariants = cva(\n 'flex w-full cursor-pointer items-center gap-2 px-2.5 py-1.5 text-left text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40 data-[highlighted]:bg-doom-deep',\n {\n variants: {\n variant: {\n default: 'text-doom-hi',\n destructive: 'text-doom-red',\n },\n /** A row that carries a check or bullet keeps a gutter for it, so labels line up whether or not one is set. */\n indented: { true: 'pl-7', false: '' },\n },\n defaultVariants: { variant: 'default', indented: false },\n },\n);\n\nexport interface DropdownMenuItemProps\n extends ComponentProps<typeof DropdownMenuPrimitive.Item>, VariantProps<typeof dropdownMenuItemVariants> {}\n\nexport function DropdownMenuItem({ className, variant, indented, ...props }: DropdownMenuItemProps) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-variant={variant ?? 'default'}\n className={cn(dropdownMenuItemVariants({ variant, indented }), className)}\n {...props}\n />\n );\n}\n\n/** The check or bullet a selectable row shows when it is set; it sits in the row's gutter. */\nfunction ItemIndicator({ children }: { children: ReactNode }) {\n return (\n <span className=\"pointer-events-none absolute left-2.5 flex h-3 w-3 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>{children}</DropdownMenuPrimitive.ItemIndicator>\n </span>\n );\n}\n\nexport interface DropdownMenuCheckboxItemProps\n extends ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>, VariantProps<typeof dropdownMenuItemVariants> {}\n\n/** A row that toggles: the check lives in the gutter so the label never shifts. */\nexport function DropdownMenuCheckboxItem({ className, variant, children, ...props }: DropdownMenuCheckboxItemProps) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn('relative', dropdownMenuItemVariants({ variant, indented: true }), className)}\n {...props}\n >\n <ItemIndicator>\n <CheckIcon className=\"h-3 w-3 text-doom-blue\" />\n </ItemIndicator>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\n/** The exclusive-choice group; pair it with DropdownMenuRadioItem. */\nexport function DropdownMenuRadioGroup(props: ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nexport interface DropdownMenuRadioItemProps\n extends ComponentProps<typeof DropdownMenuPrimitive.RadioItem>, VariantProps<typeof dropdownMenuItemVariants> {}\n\nexport function DropdownMenuRadioItem({ className, variant, children, ...props }: DropdownMenuRadioItemProps) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn('relative', dropdownMenuItemVariants({ variant, indented: true }), className)}\n {...props}\n >\n <ItemIndicator>\n <span className=\"h-1.5 w-1.5 rounded-full bg-doom-blue\" />\n </ItemIndicator>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nexport function DropdownMenuSub(props: ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\n/** The row that opens a submenu; the chevron is part of the row, not the caller's job. */\nexport function DropdownMenuSubTrigger({\n className,\n children,\n ...props\n}: ComponentProps<typeof DropdownMenuPrimitive.SubTrigger>) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n className={cn(dropdownMenuItemVariants(), 'data-[state=open]:bg-doom-deep', className)}\n {...props}\n >\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n <ChevronRightIcon className=\"h-3 w-3 shrink-0 text-doom-faint\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nexport function DropdownMenuSubContent({\n className,\n sideOffset = 2,\n ...props\n}: ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n sideOffset={sideOffset}\n className={cn(CONTENT_CLASS, className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport function DropdownMenuLabel({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Label>) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n className={cn('px-2.5 py-1 text-2xs font-bold tracking-wider text-doom-faint uppercase', className)}\n {...props}\n />\n );\n}\n\n/** The keystroke printed at the right of a row; the row supplies the gap. */\nexport function DropdownMenuShortcut({ className, ...props }: ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn('ml-auto shrink-0 text-xs tracking-wide text-doom-faint', className)}\n {...props}\n />\n );\n}\n\nexport function DropdownMenuSeparator({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-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,CAAS,EACxD,GAAI,CACL,CAAA,CAEL"}
@@ -1,2 +1,2 @@
1
- import{CheckIcon as e,ChevronRightIcon as t}from"../icons/icons.mjs";import{cn as n}from"../lib/cn.mjs";import{DropdownMenu 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":`dropdown-menu`,...e})}function c(e){return i(r.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function l(e){return i(r.Group,{"data-slot":`dropdown-menu-group`,...e})}const u=`z-50 flex min-w-[120px] flex-col overflow-hidden rounded border border-doom-border bg-doom-panel py-1 font-mono shadow-xl outline-none data-[state=open]:animate-doom-rise`;function d({className:e,align:t=`end`,sideOffset:a=4,...o}){return i(r.Portal,{children:i(r.Content,{"data-slot":`dropdown-menu-content`,align:t,sideOffset:a,className:n(u,e),...o})})}const f=o(`flex w-full cursor-pointer items-center gap-2 px-2.5 py-1.5 text-left text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40 data-[highlighted]:bg-doom-deep`,{variants:{variant:{default:`text-doom-hi`,destructive:`text-doom-red`},indented:{true:`pl-7`,false:``}},defaultVariants:{variant:`default`,indented:!1}});function p({className:e,variant:t,indented:a,...o}){return i(r.Item,{"data-slot":`dropdown-menu-item`,"data-variant":t??`default`,className:n(f({variant:t,indented:a}),e),...o})}function m({children:e}){return i(`span`,{className:`pointer-events-none absolute left-2.5 flex h-3 w-3 items-center justify-center`,children:i(r.ItemIndicator,{children:e})})}function h({className:t,variant:o,children:s,...c}){return a(r.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,className:n(`relative`,f({variant:o,indented:!0}),t),...c,children:[i(m,{children:i(e,{className:`h-3 w-3 text-doom-blue`})}),s]})}function g(e){return i(r.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function _({className:e,variant:t,children:o,...s}){return a(r.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:n(`relative`,f({variant:t,indented:!0}),e),...s,children:[i(m,{children:i(`span`,{className:`h-1.5 w-1.5 rounded-full bg-doom-blue`})}),o]})}function v(e){return i(r.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function y({className:e,children:o,...s}){return a(r.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,className:n(f(),`data-[state=open]:bg-doom-deep`,e),...s,children:[i(`span`,{className:`min-w-0 flex-1 truncate`,children:o}),i(t,{className:`h-3 w-3 shrink-0 text-doom-faint`})]})}function b({className:e,sideOffset:t=2,...a}){return i(r.Portal,{children:i(r.SubContent,{"data-slot":`dropdown-menu-sub-content`,sideOffset:t,className:n(u,e),...a})})}function x({className:e,...t}){return i(r.Label,{"data-slot":`dropdown-menu-label`,className:n(`px-2.5 py-1 text-2xs font-bold tracking-wider text-doom-faint uppercase`,e),...t})}function S({className:e,...t}){return i(`span`,{"data-slot":`dropdown-menu-shortcut`,className:n(`ml-auto shrink-0 text-xs tracking-wide text-doom-faint`,e),...t})}function C({className:e,...t}){return i(r.Separator,{"data-slot":`dropdown-menu-separator`,className:n(`my-1 h-px bg-doom-border-soft`,e),...t})}export{s as DropdownMenu,h as DropdownMenuCheckboxItem,d as DropdownMenuContent,l as DropdownMenuGroup,p as DropdownMenuItem,x as DropdownMenuLabel,g as DropdownMenuRadioGroup,_ as DropdownMenuRadioItem,C as DropdownMenuSeparator,S as DropdownMenuShortcut,v as DropdownMenuSub,b as DropdownMenuSubContent,y as DropdownMenuSubTrigger,c as DropdownMenuTrigger,f as dropdownMenuItemVariants};
1
+ import{CheckIcon as e,ChevronRightIcon as t}from"../icons/icons.mjs";import{cn as n}from"../lib/cn.mjs";import{DropdownMenu 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/* @__PURE__ */ i(r.Root,{"data-slot":`dropdown-menu`,...e})}function c(e){return/* @__PURE__ */ i(r.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function l(e){return/* @__PURE__ */ i(r.Group,{"data-slot":`dropdown-menu-group`,...e})}const u=`z-50 flex min-w-[120px] flex-col overflow-hidden rounded border border-doom-border bg-doom-panel py-1 font-mono shadow-xl outline-none data-[state=open]:animate-doom-rise`;function d({className:e,align:t=`end`,sideOffset:a=4,...o}){return/* @__PURE__ */ i(r.Portal,{children:/* @__PURE__ */ i(r.Content,{"data-slot":`dropdown-menu-content`,align:t,sideOffset:a,className:n(u,e),...o})})}const f=o(`flex w-full cursor-pointer items-center gap-2 px-2.5 py-1.5 text-left text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40 data-[highlighted]:bg-doom-deep`,{variants:{variant:{default:`text-doom-hi`,destructive:`text-doom-red`},indented:{true:`pl-7`,false:``}},defaultVariants:{variant:`default`,indented:!1}});function p({className:e,variant:t,indented:a,...o}){return/* @__PURE__ */ i(r.Item,{"data-slot":`dropdown-menu-item`,"data-variant":t??`default`,className:n(f({variant:t,indented:a}),e),...o})}function m({children:e}){return/* @__PURE__ */ i(`span`,{className:`pointer-events-none absolute left-2.5 flex h-3 w-3 items-center justify-center`,children:/* @__PURE__ */ i(r.ItemIndicator,{children:e})})}function h({className:t,variant:o,children:s,...c}){return/* @__PURE__ */ a(r.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,className:n(`relative`,f({variant:o,indented:!0}),t),...c,children:[/* @__PURE__ */ i(m,{children:/* @__PURE__ */ i(e,{className:`h-3 w-3 text-doom-blue`})}),s]})}function g(e){return/* @__PURE__ */ i(r.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function _({className:e,variant:t,children:o,...s}){return/* @__PURE__ */ a(r.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:n(`relative`,f({variant:t,indented:!0}),e),...s,children:[/* @__PURE__ */ i(m,{children:/* @__PURE__ */ i(`span`,{className:`h-1.5 w-1.5 rounded-full bg-doom-blue`})}),o]})}function v(e){return/* @__PURE__ */ i(r.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function y({className:e,children:o,...s}){return/* @__PURE__ */ a(r.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,className:n(f(),`data-[state=open]:bg-doom-deep`,e),...s,children:[/* @__PURE__ */ i(`span`,{className:`min-w-0 flex-1 truncate`,children:o}),/* @__PURE__ */ i(t,{className:`h-3 w-3 shrink-0 text-doom-faint`})]})}function b({className:e,sideOffset:t=2,...a}){return/* @__PURE__ */ i(r.Portal,{children:/* @__PURE__ */ i(r.SubContent,{"data-slot":`dropdown-menu-sub-content`,sideOffset:t,className:n(u,e),...a})})}function x({className:e,...t}){return/* @__PURE__ */ i(r.Label,{"data-slot":`dropdown-menu-label`,className:n(`px-2.5 py-1 text-2xs font-bold tracking-wider text-doom-faint uppercase`,e),...t})}function S({className:e,...t}){return/* @__PURE__ */ i(`span`,{"data-slot":`dropdown-menu-shortcut`,className:n(`ml-auto shrink-0 text-xs tracking-wide text-doom-faint`,e),...t})}function C({className:e,...t}){return/* @__PURE__ */ i(r.Separator,{"data-slot":`dropdown-menu-separator`,className:n(`my-1 h-px bg-doom-border-soft`,e),...t})}export{s as DropdownMenu,h as DropdownMenuCheckboxItem,d as DropdownMenuContent,l as DropdownMenuGroup,p as DropdownMenuItem,x as DropdownMenuLabel,g as DropdownMenuRadioGroup,_ as DropdownMenuRadioItem,C as DropdownMenuSeparator,S as DropdownMenuShortcut,v as DropdownMenuSub,b as DropdownMenuSubContent,y as DropdownMenuSubTrigger,c as DropdownMenuTrigger,f as dropdownMenuItemVariants};
2
2
  //# sourceMappingURL=DropdownMenu.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenu.mjs","names":["DropdownMenu","DropdownMenuPrimitive"],"sources":["../../../src/components/DropdownMenu.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { CheckIcon, ChevronRightIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\n\n/** shadcn's DropdownMenu on Radix: roving focus, typeahead, outside click, Escape. */\nexport function DropdownMenu(props: ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nexport function DropdownMenuTrigger(props: ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\n/** A run of items under one label, so the separator between groups is structural. */\nexport function DropdownMenuGroup(props: ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\n/** The surface every menu and submenu wears. */\nconst CONTENT_CLASS =\n 'z-50 flex min-w-[120px] flex-col overflow-hidden rounded border border-doom-border bg-doom-panel py-1 font-mono shadow-xl outline-none data-[state=open]:animate-doom-rise';\n\nexport function DropdownMenuContent({\n className,\n align = 'end',\n sideOffset = 4,\n ...props\n}: ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(CONTENT_CLASS, className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport const dropdownMenuItemVariants = cva(\n 'flex w-full cursor-pointer items-center gap-2 px-2.5 py-1.5 text-left text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40 data-[highlighted]:bg-doom-deep',\n {\n variants: {\n variant: {\n default: 'text-doom-hi',\n destructive: 'text-doom-red',\n },\n /** A row that carries a check or bullet keeps a gutter for it, so labels line up whether or not one is set. */\n indented: { true: 'pl-7', false: '' },\n },\n defaultVariants: { variant: 'default', indented: false },\n },\n);\n\nexport interface DropdownMenuItemProps\n extends ComponentProps<typeof DropdownMenuPrimitive.Item>, VariantProps<typeof dropdownMenuItemVariants> {}\n\nexport function DropdownMenuItem({ className, variant, indented, ...props }: DropdownMenuItemProps) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-variant={variant ?? 'default'}\n className={cn(dropdownMenuItemVariants({ variant, indented }), className)}\n {...props}\n />\n );\n}\n\n/** The check or bullet a selectable row shows when it is set; it sits in the row's gutter. */\nfunction ItemIndicator({ children }: { children: ReactNode }) {\n return (\n <span className=\"pointer-events-none absolute left-2.5 flex h-3 w-3 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>{children}</DropdownMenuPrimitive.ItemIndicator>\n </span>\n );\n}\n\nexport interface DropdownMenuCheckboxItemProps\n extends ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>, VariantProps<typeof dropdownMenuItemVariants> {}\n\n/** A row that toggles: the check lives in the gutter so the label never shifts. */\nexport function DropdownMenuCheckboxItem({ className, variant, children, ...props }: DropdownMenuCheckboxItemProps) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn('relative', dropdownMenuItemVariants({ variant, indented: true }), className)}\n {...props}\n >\n <ItemIndicator>\n <CheckIcon className=\"h-3 w-3 text-doom-blue\" />\n </ItemIndicator>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\n/** The exclusive-choice group; pair it with DropdownMenuRadioItem. */\nexport function DropdownMenuRadioGroup(props: ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nexport interface DropdownMenuRadioItemProps\n extends ComponentProps<typeof DropdownMenuPrimitive.RadioItem>, VariantProps<typeof dropdownMenuItemVariants> {}\n\nexport function DropdownMenuRadioItem({ className, variant, children, ...props }: DropdownMenuRadioItemProps) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn('relative', dropdownMenuItemVariants({ variant, indented: true }), className)}\n {...props}\n >\n <ItemIndicator>\n <span className=\"h-1.5 w-1.5 rounded-full bg-doom-blue\" />\n </ItemIndicator>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nexport function DropdownMenuSub(props: ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\n/** The row that opens a submenu; the chevron is part of the row, not the caller's job. */\nexport function DropdownMenuSubTrigger({\n className,\n children,\n ...props\n}: ComponentProps<typeof DropdownMenuPrimitive.SubTrigger>) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n className={cn(dropdownMenuItemVariants(), 'data-[state=open]:bg-doom-deep', className)}\n {...props}\n >\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n <ChevronRightIcon className=\"h-3 w-3 shrink-0 text-doom-faint\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nexport function DropdownMenuSubContent({\n className,\n sideOffset = 2,\n ...props\n}: ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n sideOffset={sideOffset}\n className={cn(CONTENT_CLASS, className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport function DropdownMenuLabel({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Label>) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n className={cn('px-2.5 py-1 text-2xs font-bold tracking-wider text-doom-faint uppercase', className)}\n {...props}\n />\n );\n}\n\n/** The keystroke printed at the right of a row; the row supplies the gap. */\nexport function DropdownMenuShortcut({ className, ...props }: ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn('ml-auto shrink-0 text-xs tracking-wide text-doom-faint', className)}\n {...props}\n />\n );\n}\n\nexport function DropdownMenuSeparator({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn('my-1 h-px bg-doom-border-soft', className)}\n {...props}\n />\n );\n}\n"],"mappings":"iPAQA,SAAgBA,EAAa,EAA0D,CACrF,OAAO,EAACC,EAAsB,KAAvB,CAA4B,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CAC3E,CAEA,SAAgB,EAAoB,EAA6D,CAC/F,OAAO,EAACA,EAAsB,QAAvB,CAA+B,YAAU,wBAAwB,GAAI,CAAQ,CAAA,CACtF,CAGA,SAAgB,EAAkB,EAA2D,CAC3F,OAAO,EAACA,EAAsB,MAAvB,CAA6B,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAClF,CAGA,MAAM,EACJ,6KAEF,SAAgB,EAAoB,CAClC,YACA,QAAQ,MACR,aAAa,EACb,GAAG,GACoD,CACvD,OACE,EAACA,EAAsB,OAAvB,CAAA,SACE,EAACA,EAAsB,QAAvB,CACE,YAAU,wBACH,QACK,aACZ,UAAW,EAAG,EAAe,CAAS,EACtC,GAAI,CACL,CAAA,CAC2B,CAAA,CAElC,CAEA,MAAa,EAA2B,EACtC,wMACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,eACT,YAAa,eACf,EAEA,SAAU,CAAE,KAAM,OAAQ,MAAO,EAAG,CACtC,EACA,gBAAiB,CAAE,QAAS,UAAW,SAAU,EAAM,CACzD,CACF,EAKA,SAAgB,EAAiB,CAAE,YAAW,UAAS,WAAU,GAAG,GAAgC,CAClG,OACE,EAACA,EAAsB,KAAvB,CACE,YAAU,qBACV,eAAc,GAAW,UACzB,UAAW,EAAG,EAAyB,CAAE,UAAS,UAAS,CAAC,EAAG,CAAS,EACxE,GAAI,CACL,CAAA,CAEL,CAGA,SAAS,EAAc,CAAE,YAAqC,CAC5D,OACE,EAAC,OAAD,CAAM,UAAU,iFACd,SAAA,EAACA,EAAsB,cAAvB,CA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vB,CACE,YAAU,4BACE,aACZ,UAAW,EAAG,EAAe,CAAS,EACtC,GAAI,CACL,CAAA,CAC2B,CAAA,CAElC,CAEA,SAAgB,EAAkB,CAAE,YAAW,GAAG,GAA6D,CAC7G,OACE,EAACA,EAAsB,MAAvB,CACE,YAAU,sBACV,UAAW,EAAG,0EAA2E,CAAS,EAClG,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAqB,CAAE,YAAW,GAAG,GAAiC,CACpF,OACE,EAAC,OAAD,CACE,YAAU,yBACV,UAAW,EAAG,yDAA0D,CAAS,EACjF,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAsB,CAAE,YAAW,GAAG,GAAiE,CACrH,OACE,EAACA,EAAsB,UAAvB,CACE,YAAU,0BACV,UAAW,EAAG,gCAAiC,CAAS,EACxD,GAAI,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"DropdownMenu.mjs","names":["DropdownMenu","DropdownMenuPrimitive"],"sources":["../../../src/components/DropdownMenu.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { CheckIcon, ChevronRightIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\n\n/** shadcn's DropdownMenu on Radix: roving focus, typeahead, outside click, Escape. */\nexport function DropdownMenu(props: ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nexport function DropdownMenuTrigger(props: ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\n/** A run of items under one label, so the separator between groups is structural. */\nexport function DropdownMenuGroup(props: ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\n/** The surface every menu and submenu wears. */\nconst CONTENT_CLASS =\n 'z-50 flex min-w-[120px] flex-col overflow-hidden rounded border border-doom-border bg-doom-panel py-1 font-mono shadow-xl outline-none data-[state=open]:animate-doom-rise';\n\nexport function DropdownMenuContent({\n className,\n align = 'end',\n sideOffset = 4,\n ...props\n}: ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(CONTENT_CLASS, className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport const dropdownMenuItemVariants = cva(\n 'flex w-full cursor-pointer items-center gap-2 px-2.5 py-1.5 text-left text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40 data-[highlighted]:bg-doom-deep',\n {\n variants: {\n variant: {\n default: 'text-doom-hi',\n destructive: 'text-doom-red',\n },\n /** A row that carries a check or bullet keeps a gutter for it, so labels line up whether or not one is set. */\n indented: { true: 'pl-7', false: '' },\n },\n defaultVariants: { variant: 'default', indented: false },\n },\n);\n\nexport interface DropdownMenuItemProps\n extends ComponentProps<typeof DropdownMenuPrimitive.Item>, VariantProps<typeof dropdownMenuItemVariants> {}\n\nexport function DropdownMenuItem({ className, variant, indented, ...props }: DropdownMenuItemProps) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-variant={variant ?? 'default'}\n className={cn(dropdownMenuItemVariants({ variant, indented }), className)}\n {...props}\n />\n );\n}\n\n/** The check or bullet a selectable row shows when it is set; it sits in the row's gutter. */\nfunction ItemIndicator({ children }: { children: ReactNode }) {\n return (\n <span className=\"pointer-events-none absolute left-2.5 flex h-3 w-3 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>{children}</DropdownMenuPrimitive.ItemIndicator>\n </span>\n );\n}\n\nexport interface DropdownMenuCheckboxItemProps\n extends ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>, VariantProps<typeof dropdownMenuItemVariants> {}\n\n/** A row that toggles: the check lives in the gutter so the label never shifts. */\nexport function DropdownMenuCheckboxItem({ className, variant, children, ...props }: DropdownMenuCheckboxItemProps) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn('relative', dropdownMenuItemVariants({ variant, indented: true }), className)}\n {...props}\n >\n <ItemIndicator>\n <CheckIcon className=\"h-3 w-3 text-doom-blue\" />\n </ItemIndicator>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\n/** The exclusive-choice group; pair it with DropdownMenuRadioItem. */\nexport function DropdownMenuRadioGroup(props: ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nexport interface DropdownMenuRadioItemProps\n extends ComponentProps<typeof DropdownMenuPrimitive.RadioItem>, VariantProps<typeof dropdownMenuItemVariants> {}\n\nexport function DropdownMenuRadioItem({ className, variant, children, ...props }: DropdownMenuRadioItemProps) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn('relative', dropdownMenuItemVariants({ variant, indented: true }), className)}\n {...props}\n >\n <ItemIndicator>\n <span className=\"h-1.5 w-1.5 rounded-full bg-doom-blue\" />\n </ItemIndicator>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nexport function DropdownMenuSub(props: ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\n/** The row that opens a submenu; the chevron is part of the row, not the caller's job. */\nexport function DropdownMenuSubTrigger({\n className,\n children,\n ...props\n}: ComponentProps<typeof DropdownMenuPrimitive.SubTrigger>) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n className={cn(dropdownMenuItemVariants(), 'data-[state=open]:bg-doom-deep', className)}\n {...props}\n >\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n <ChevronRightIcon className=\"h-3 w-3 shrink-0 text-doom-faint\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nexport function DropdownMenuSubContent({\n className,\n sideOffset = 2,\n ...props\n}: ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n sideOffset={sideOffset}\n className={cn(CONTENT_CLASS, className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport function DropdownMenuLabel({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Label>) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n className={cn('px-2.5 py-1 text-2xs font-bold tracking-wider text-doom-faint uppercase', className)}\n {...props}\n />\n );\n}\n\n/** The keystroke printed at the right of a row; the row supplies the gap. */\nexport function DropdownMenuShortcut({ className, ...props }: ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn('ml-auto shrink-0 text-xs tracking-wide text-doom-faint', className)}\n {...props}\n />\n );\n}\n\nexport function DropdownMenuSeparator({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn('my-1 h-px bg-doom-border-soft', className)}\n {...props}\n />\n );\n}\n"],"mappings":"iPAQA,SAAgBA,EAAa,EAA0D,CACrF,MAAO,kBAACC,EAAsB,KAAvB,CAA4B,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CAC3E,CAEA,SAAgB,EAAoB,EAA6D,CAC/F,MAAO,kBAACA,EAAsB,QAAvB,CAA+B,YAAU,wBAAwB,GAAI,CAAQ,CAAA,CACtF,CAGA,SAAgB,EAAkB,EAA2D,CAC3F,MAAO,kBAACA,EA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W,GAAG,GAAiE,CACrH,MACE,kBAACA,EAAsB,UAAvB,CACE,YAAU,0BACV,UAAW,EAAG,gCAAiC,CAAS,EACxD,GAAI,CACL,CAAA,CAEL"}
@@ -1,2 +1,2 @@
1
- const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime");function r({title:r,description:i,children:a,className:o,asChild:s=!1,...c}){let l=s?t.Slot.Root:`div`;return(0,n.jsx)(l,{"data-slot":`empty-state`,className:e.cn(`flex flex-1 items-center justify-center px-3 py-4 sm:px-4`,o),...c,children:(0,n.jsxs)(`div`,{className:`flex w-[520px] max-w-full flex-col items-center gap-3 text-center`,children:[(0,n.jsx)(`span`,{className:`text-base font-bold text-doom-hi`,children:r}),i?(0,n.jsx)(`span`,{className:`text-sm leading-relaxed text-doom-dim`,children:i}):null,a]})})}exports.EmptyState=r;
1
+ const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime");function r({title:r,description:i,children:a,className:o,asChild:s=!1,...c}){let l=s?t.Slot.Root:`div`;return/* @__PURE__ */ (0,n.jsx)(l,{"data-slot":`empty-state`,className:e.cn(`flex flex-1 items-center justify-center px-3 py-4 sm:px-4`,o),...c,children:/* @__PURE__ */ (0,n.jsxs)(`div`,{className:`flex w-[520px] max-w-full flex-col items-center gap-3 text-center`,children:[/* @__PURE__ */ (0,n.jsx)(`span`,{className:`text-base font-bold text-doom-hi`,children:r}),i?/* @__PURE__ */ (0,n.jsx)(`span`,{className:`text-sm leading-relaxed text-doom-dim`,children:i}):null,a]})})}exports.EmptyState=r;
2
2
  //# sourceMappingURL=EmptyState.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.cjs","names":["Slot","cn"],"sources":["../../../src/components/EmptyState.tsx"],"sourcesContent":["import { Slot } from 'radix-ui';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../lib/cn';\n\nexport interface EmptyStateProps extends Omit<ComponentProps<'div'>, 'title'> {\n title: ReactNode;\n description?: ReactNode;\n /** Optional calls to action under the copy. */\n children?: ReactNode;\n /**\n * Render the child element instead of a <div>, so an empty row inside a\n * list stays an <li> and the list keeps its semantics.\n */\n asChild?: boolean;\n}\n\n/** The centred \"nothing here yet\" card every empty panel shares. */\nexport function EmptyState({ title, description, children, className, asChild = false, ...props }: EmptyStateProps) {\n const Component = asChild ? Slot.Root : 'div';\n return (\n <Component\n data-slot=\"empty-state\"\n className={cn('flex flex-1 items-center justify-center px-3 py-4 sm:px-4', className)}\n {...props}\n >\n <div className=\"flex w-[520px] max-w-full flex-col items-center gap-3 text-center\">\n <span className=\"text-base font-bold text-doom-hi\">{title}</span>\n {description ? <span className=\"text-sm leading-relaxed text-doom-dim\">{description}</span> : null}\n {children}\n </div>\n </Component>\n );\n}\n"],"mappings":"0FAkBA,SAAgB,EAAW,CAAE,QAAO,cAAa,WAAU,YAAW,UAAU,GAAO,GAAG,GAA0B,CAClH,IAAM,EAAY,EAAUA,EAAAA,KAAK,KAAO,MACxC,OACE,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,YAAU,cACV,UAAWC,EAAAA,GAAG,4DAA6D,CAAS,EACpF,GAAI,EAEJ,UAAA,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,oEAAf,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,mCAAoC,SAAA,CAAY,CAAA,EAC/D,GAAc,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,wCAAyC,SAAA,CAAkB,CAAA,EAAI,KAC7F,CACE,GACI,CAAA,CAEf"}
1
+ {"version":3,"file":"EmptyState.cjs","names":["Slot","cn"],"sources":["../../../src/components/EmptyState.tsx"],"sourcesContent":["import { Slot } from 'radix-ui';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../lib/cn';\n\nexport interface EmptyStateProps extends Omit<ComponentProps<'div'>, 'title'> {\n title: ReactNode;\n description?: ReactNode;\n /** Optional calls to action under the copy. */\n children?: ReactNode;\n /**\n * Render the child element instead of a <div>, so an empty row inside a\n * list stays an <li> and the list keeps its semantics.\n */\n asChild?: boolean;\n}\n\n/** The centred \"nothing here yet\" card every empty panel shares. */\nexport function EmptyState({ title, description, children, className, asChild = false, ...props }: EmptyStateProps) {\n const Component = asChild ? Slot.Root : 'div';\n return (\n <Component\n data-slot=\"empty-state\"\n className={cn('flex flex-1 items-center justify-center px-3 py-4 sm:px-4', className)}\n {...props}\n >\n <div className=\"flex w-[520px] max-w-full flex-col items-center gap-3 text-center\">\n <span className=\"text-base font-bold text-doom-hi\">{title}</span>\n {description ? <span className=\"text-sm leading-relaxed text-doom-dim\">{description}</span> : null}\n {children}\n </div>\n </Component>\n );\n}\n"],"mappings":"0FAkBA,SAAgB,EAAW,CAAE,QAAO,cAAa,WAAU,YAAW,UAAU,GAAO,GAAG,GAA0B,CAClH,IAAM,EAAY,EAAUA,EAAAA,KAAK,KAAO,MACxC,MACE,iBAAA,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,YAAU,cACV,UAAWC,EAAAA,GAAG,4DAA6D,CAAS,EACpF,GAAI,EAEJ,SAAA,iBAAA,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,oEAAf,SAAA,CACE,iBAAA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,mCAAoC,SAAA,CAAY,CAAA,EAC/D,EAAc,iBAAA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,wCAAyC,SAAA,CAAkB,CAAA,EAAI,KAC7F,CACE,GACI,CAAA,CAEf"}
@@ -1,2 +1,2 @@
1
- import{cn as e}from"../lib/cn.mjs";import{Slot as t}from"radix-ui";import{jsx as n,jsxs as r}from"react/jsx-runtime";function i({title:i,description:a,children:o,className:s,asChild:c=!1,...l}){let u=c?t.Root:`div`;return n(u,{"data-slot":`empty-state`,className:e(`flex flex-1 items-center justify-center px-3 py-4 sm:px-4`,s),...l,children:r(`div`,{className:`flex w-[520px] max-w-full flex-col items-center gap-3 text-center`,children:[n(`span`,{className:`text-base font-bold text-doom-hi`,children:i}),a?n(`span`,{className:`text-sm leading-relaxed text-doom-dim`,children:a}):null,o]})})}export{i as EmptyState};
1
+ import{cn as e}from"../lib/cn.mjs";import{Slot as t}from"radix-ui";import{jsx as n,jsxs as r}from"react/jsx-runtime";function i({title:i,description:a,children:o,className:s,asChild:c=!1,...l}){let u=c?t.Root:`div`;return/* @__PURE__ */ n(u,{"data-slot":`empty-state`,className:e(`flex flex-1 items-center justify-center px-3 py-4 sm:px-4`,s),...l,children:/* @__PURE__ */ r(`div`,{className:`flex w-[520px] max-w-full flex-col items-center gap-3 text-center`,children:[/* @__PURE__ */ n(`span`,{className:`text-base font-bold text-doom-hi`,children:i}),a?/* @__PURE__ */ n(`span`,{className:`text-sm leading-relaxed text-doom-dim`,children:a}):null,o]})})}export{i as EmptyState};
2
2
  //# sourceMappingURL=EmptyState.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.mjs","names":[],"sources":["../../../src/components/EmptyState.tsx"],"sourcesContent":["import { Slot } from 'radix-ui';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../lib/cn';\n\nexport interface EmptyStateProps extends Omit<ComponentProps<'div'>, 'title'> {\n title: ReactNode;\n description?: ReactNode;\n /** Optional calls to action under the copy. */\n children?: ReactNode;\n /**\n * Render the child element instead of a <div>, so an empty row inside a\n * list stays an <li> and the list keeps its semantics.\n */\n asChild?: boolean;\n}\n\n/** The centred \"nothing here yet\" card every empty panel shares. */\nexport function EmptyState({ title, description, children, className, asChild = false, ...props }: EmptyStateProps) {\n const Component = asChild ? Slot.Root : 'div';\n return (\n <Component\n data-slot=\"empty-state\"\n className={cn('flex flex-1 items-center justify-center px-3 py-4 sm:px-4', className)}\n {...props}\n >\n <div className=\"flex w-[520px] max-w-full flex-col items-center gap-3 text-center\">\n <span className=\"text-base font-bold text-doom-hi\">{title}</span>\n {description ? <span className=\"text-sm leading-relaxed text-doom-dim\">{description}</span> : null}\n {children}\n </div>\n </Component>\n );\n}\n"],"mappings":"qHAkBA,SAAgB,EAAW,CAAE,QAAO,cAAa,WAAU,YAAW,UAAU,GAAO,GAAG,GAA0B,CAClH,IAAM,EAAY,EAAU,EAAK,KAAO,MACxC,OACE,EAAC,EAAD,CACE,YAAU,cACV,UAAW,EAAG,4DAA6D,CAAS,EACpF,GAAI,EAEJ,SAAA,EAAC,MAAD,CAAK,UAAU,oEAAf,SAAA,CACE,EAAC,OAAD,CAAM,UAAU,mCAAoC,SAAA,CAAY,CAAA,EAC/D,EAAc,EAAC,OAAD,CAAM,UAAU,wCAAyC,SAAA,CAAkB,CAAA,EAAI,KAC7F,CACE,GACI,CAAA,CAEf"}
1
+ {"version":3,"file":"EmptyState.mjs","names":[],"sources":["../../../src/components/EmptyState.tsx"],"sourcesContent":["import { Slot } from 'radix-ui';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../lib/cn';\n\nexport interface EmptyStateProps extends Omit<ComponentProps<'div'>, 'title'> {\n title: ReactNode;\n description?: ReactNode;\n /** Optional calls to action under the copy. */\n children?: ReactNode;\n /**\n * Render the child element instead of a <div>, so an empty row inside a\n * list stays an <li> and the list keeps its semantics.\n */\n asChild?: boolean;\n}\n\n/** The centred \"nothing here yet\" card every empty panel shares. */\nexport function EmptyState({ title, description, children, className, asChild = false, ...props }: EmptyStateProps) {\n const Component = asChild ? Slot.Root : 'div';\n return (\n <Component\n data-slot=\"empty-state\"\n className={cn('flex flex-1 items-center justify-center px-3 py-4 sm:px-4', className)}\n {...props}\n >\n <div className=\"flex w-[520px] max-w-full flex-col items-center gap-3 text-center\">\n <span className=\"text-base font-bold text-doom-hi\">{title}</span>\n {description ? <span className=\"text-sm leading-relaxed text-doom-dim\">{description}</span> : null}\n {children}\n </div>\n </Component>\n );\n}\n"],"mappings":"qHAkBA,SAAgB,EAAW,CAAE,QAAO,cAAa,WAAU,YAAW,UAAU,GAAO,GAAG,GAA0B,CAClH,IAAM,EAAY,EAAU,EAAK,KAAO,MACxC,MACE,kBAAC,EAAD,CACE,YAAU,cACV,UAAW,EAAG,4DAA6D,CAAS,EACpF,GAAI,EAEJ,SAAA,kBAAC,MAAD,CAAK,UAAU,oEAAf,SAAA,CACE,kBAAC,OAAD,CAAM,UAAU,mCAAoC,SAAA,CAAY,CAAA,EAC/D,EAAc,kBAAC,OAAD,CAAM,UAAU,wCAAyC,SAAA,CAAkB,CAAA,EAAI,KAC7F,CACE,GACI,CAAA,CAEf"}
@@ -1,2 +1,2 @@
1
- const e=require("../lib/cn.cjs"),t=require("../lib/hashlineHighlight.cjs"),n=require("../lib/syntaxHighlight.cjs"),r=require("./SyntaxText.cjs");let i=require("react/jsx-runtime"),a=require("react");const o=new Map;function s(e){let r=t.hashlineGroupsKey(e),[i,s]=(0,a.useState)(void 0);return(0,a.useEffect)(()=>{let t=!0,i=new Map,a=e.map(async e=>{let t=n.detectGrammar({path:e.path,text:e.text});if(t===void 0)return;let r=await n.highlightToLines(e.text,t);if(r!==void 0)for(let[t,n]of e.indices.entries()){let e=r[t];e!==void 0&&i.set(n,e)}});return Promise.allSettled(a).then(()=>{t&&i.size>0&&s({key:r,spans:i})}),()=>{t=!1}},[r]),i?.key===r?i.spans:o}function c({className:n,lines:o,gutter:c,path:l,...u}){let d=s((0,a.useMemo)(()=>t.hashlineGroups(o,l),[o,l])),f={width:`${c}ch`};return(0,i.jsx)(`div`,{"data-slot":`hashline-lines`,className:e.cn(`flex flex-col font-mono`,n),...u,children:o.map((e,t)=>{if(e.type===`file`)return(0,i.jsx)(`span`,{className:`mt-1 truncate text-doom-faint first:mt-0`,children:e.path},t);if(e.type===`plain`)return(0,i.jsx)(`span`,{className:`whitespace-pre-wrap break-words text-doom-dim`,children:e.text},t);let{value:n}=e;return(0,i.jsxs)(`span`,{className:`flex gap-2`,children:[n.marker===void 0?null:(0,i.jsx)(`span`,{className:`w-4 shrink-0 ${n.marker===`match`?`text-doom-blue`:`text-doom-faint`}`,children:n.marker===`match`?`>>`:``}),(0,i.jsx)(`span`,{className:`shrink-0 text-right text-doom-faint`,style:f,children:n.line}),(0,i.jsx)(r.SyntaxLine,{spans:d.get(t),text:n.content,className:`min-w-0 whitespace-pre-wrap break-words ${n.marker===`match`?`text-doom-hi`:`text-doom-text`}`})]},t)})})}exports.HashlineLines=c;
1
+ const e=require("../lib/cn.cjs"),t=require("../lib/hashlineHighlight.cjs"),n=require("../lib/syntaxHighlight.cjs"),r=require("./SyntaxText.cjs");let i=require("react/jsx-runtime"),a=require("react");const o=/* @__PURE__ */ new Map;function s(e){let r=t.hashlineGroupsKey(e),[i,s]=(0,a.useState)(void 0);return(0,a.useEffect)(()=>{let t=!0,i=/* @__PURE__ */ new Map,a=e.map(async e=>{let t=n.detectGrammar({path:e.path,text:e.text});if(t===void 0)return;let r=await n.highlightToLines(e.text,t);if(r!==void 0)for(let[t,n]of e.indices.entries()){let e=r[t];e!==void 0&&i.set(n,e)}});return Promise.allSettled(a).then(()=>{t&&i.size>0&&s({key:r,spans:i})}),()=>{t=!1}},[r]),i?.key===r?i.spans:o}function c({className:n,lines:o,gutter:c,path:l,...u}){let d=s((0,a.useMemo)(()=>t.hashlineGroups(o,l),[o,l])),f={width:`${c}ch`};return/* @__PURE__ */ (0,i.jsx)(`div`,{"data-slot":`hashline-lines`,className:e.cn(`flex flex-col font-mono`,n),...u,children:o.map((e,t)=>{if(e.type===`file`)return/* @__PURE__ */ (0,i.jsx)(`span`,{className:`mt-1 truncate text-doom-faint first:mt-0`,children:e.path},t);if(e.type===`plain`)return/* @__PURE__ */ (0,i.jsx)(`span`,{className:`whitespace-pre-wrap break-words text-doom-dim`,children:e.text},t);let{value:n}=e;return/* @__PURE__ */ (0,i.jsxs)(`span`,{className:`flex gap-2`,children:[n.marker===void 0?null:/* @__PURE__ */ (0,i.jsx)(`span`,{className:`w-4 shrink-0 ${n.marker===`match`?`text-doom-blue`:`text-doom-faint`}`,children:n.marker===`match`?`>>`:``}),/* @__PURE__ */ (0,i.jsx)(`span`,{className:`shrink-0 text-right text-doom-faint`,style:f,children:n.line}),/* @__PURE__ */ (0,i.jsx)(r.SyntaxLine,{spans:d.get(t),text:n.content,className:`min-w-0 whitespace-pre-wrap break-words ${n.marker===`match`?`text-doom-hi`:`text-doom-text`}`})]},t)})})}exports.HashlineLines=c;
2
2
  //# sourceMappingURL=HashlineLines.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"HashlineLines.cjs","names":["hashlineGroupsKey","useState","detectGrammar","highlightToLines","useMemo","hashlineGroups","cn","SyntaxLine"],"sources":["../../../src/components/HashlineLines.tsx"],"sourcesContent":["import { type ComponentProps, useEffect, useMemo, useState } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { type HashlineGroup, hashlineGroups, hashlineGroupsKey } from '../lib/hashlineHighlight';\nimport type { PresentedLine } from '../lib/hashlineView';\nimport { detectGrammar, highlightToLines, type SyntaxSpan } from '../lib/syntaxHighlight';\nimport { SyntaxLine } from './SyntaxText';\n\n/**\n * The anchored body shared by hashline results: a file heading per group, a\n * right-aligned line-number gutter, and a `>>` marker on grep matches. The\n * gutter width is a style, not a class, because it follows the widest number.\n *\n * The anchored lines are coloured with the editor's grammars when the body\n * names a file, or when `path` names one for a result that does not. Colour\n * arrives a frame or two late and never blocks the text: an unhighlighted body\n * is the same body without the colours.\n */\nexport interface HashlineLinesProps extends ComponentProps<'div'> {\n lines: readonly PresentedLine[];\n /** Width of the line-number column, in characters, from `hashlineBody`. */\n gutter: number;\n /** The file a body of bare anchored lines came from, for highlighting. */\n path?: string | undefined;\n}\n\nconst NO_SPANS: ReadonlyMap<number, readonly SyntaxSpan[]> = new Map();\n\n/**\n * Spans per presented-line index, once every file's run has parsed. The result\n * is stored with the body it belongs to, so a body that has changed since\n * reads as plain rather than wearing the previous body's colours.\n */\nfunction useHashlineSpans(groups: readonly HashlineGroup[]): ReadonlyMap<number, readonly SyntaxSpan[]> {\n const key = hashlineGroupsKey(groups);\n const [done, setDone] = useState<{ key: string; spans: ReadonlyMap<number, readonly SyntaxSpan[]> } | undefined>(\n undefined,\n );\n\n useEffect(() => {\n let live = true;\n const next = new Map<number, readonly SyntaxSpan[]>();\n const work = groups.map(async (group) => {\n const grammar = detectGrammar({ path: group.path, text: group.text });\n if (grammar === undefined) return;\n const highlighted = await highlightToLines(group.text, grammar);\n if (highlighted === undefined) return;\n for (const [offset, index] of group.indices.entries()) {\n const line = highlighted[offset];\n if (line !== undefined) next.set(index, line);\n }\n });\n // One state write for the whole body, so a many-file grep result does not\n // repaint once per file. A grammar that fails to load leaves its run plain.\n void Promise.allSettled(work).then(() => {\n if (live && next.size > 0) setDone({ key, spans: next });\n });\n return () => {\n live = false;\n };\n // The groups are rebuilt every render; their key is what actually changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [key]);\n\n return done?.key === key ? done.spans : NO_SPANS;\n}\n\nexport function HashlineLines({ className, lines, gutter, path, ...props }: HashlineLinesProps) {\n const groups = useMemo(() => hashlineGroups(lines, path), [lines, path]);\n const spans = useHashlineSpans(groups);\n // Bound to a name rather than written inline: this file ships as a scaffold\n // template too, and an inline style object opens with the same two braces\n // Liquid reads as an output tag, which fails to render.\n const gutterStyle = { width: `${gutter}ch` };\n return (\n <div data-slot=\"hashline-lines\" className={cn('flex flex-col font-mono', className)} {...props}>\n {lines.map((line, index) => {\n if (line.type === 'file') {\n return (\n <span key={index} className=\"mt-1 truncate text-doom-faint first:mt-0\">\n {line.path}\n </span>\n );\n }\n if (line.type === 'plain') {\n return (\n <span key={index} className=\"whitespace-pre-wrap break-words text-doom-dim\">\n {line.text}\n </span>\n );\n }\n const { value } = line;\n return (\n <span key={index} className=\"flex gap-2\">\n {value.marker !== undefined ? (\n <span className={`w-4 shrink-0 ${value.marker === 'match' ? 'text-doom-blue' : 'text-doom-faint'}`}>\n {value.marker === 'match' ? '>>' : ''}\n </span>\n ) : null}\n <span className=\"shrink-0 text-right text-doom-faint\" style={gutterStyle}>\n {value.line}\n </span>\n <SyntaxLine\n spans={spans.get(index)}\n text={value.content}\n className={`min-w-0 whitespace-pre-wrap break-words ${value.marker === 'match' ? 'text-doom-hi' : 'text-doom-text'}`}\n />\n </span>\n );\n })}\n </div>\n );\n}\n"],"mappings":"uMA0BA,MAAM,EAAuD,IAAI,IAOjE,SAAS,EAAiB,EAA8E,CACtG,IAAM,EAAMA,EAAAA,kBAAkB,CAAM,EAC9B,CAAC,EAAM,IAAA,EAAWC,EAAAA,SAAAA,CACtB,IAAA,EACF,EA2BA,OAzBA,EAAA,EAAA,UAAA,KAAgB,CACd,IAAI,EAAO,GACL,EAAO,IAAI,IACX,EAAO,EAAO,IAAI,KAAO,IAAU,CACvC,IAAM,EAAUC,EAAAA,cAAc,CAAE,KAAM,EAAM,KAAM,KAAM,EAAM,IAAK,CAAC,EACpE,GAAI,IAAY,IAAA,GAAW,OAC3B,IAAM,EAAc,MAAMC,EAAAA,iBAAiB,EAAM,KAAM,CAAO,EAC1D,OAAgB,IAAA,GACpB,IAAK,GAAM,CAAC,EAAQ,KAAU,EAAM,QAAQ,QAAQ,EAAG,CACrD,IAAM,EAAO,EAAY,GACrB,IAAS,IAAA,IAAW,EAAK,IAAI,EAAO,CAAI,CAC9C,CACF,CAAC,EAMD,OAHA,QAAa,WAAW,CAAI,CAAC,CAAC,SAAW,CACnC,GAAQ,EAAK,KAAO,GAAG,EAAQ,CAAE,MAAK,MAAO,CAAK,CAAC,CACzD,CAAC,MACY,CACX,EAAO,EACT,CAGF,EAAG,CAAC,CAAG,CAAC,EAED,GAAM,MAAQ,EAAM,EAAK,MAAQ,CAC1C,CAEA,SAAgB,EAAc,CAAE,YAAW,QAAO,SAAQ,OAAM,GAAG,GAA6B,CAE9F,IAAM,EAAQ,GAAA,EADCC,EAAAA,QAAAA,KAAcC,EAAAA,eAAe,EAAO,CAAI,EAAG,CAAC,EAAO,CAAI,CAClC,CAAC,EAI/B,EAAc,CAAE,MAAO,GAAG,EAAO,GAAI,EAC3C,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,YAAU,iBAAiB,UAAWC,EAAAA,GAAG,0BAA2B,CAAS,EAAG,GAAI,EACtF,SAAA,EAAM,KAAK,EAAM,IAAU,CAC1B,GAAI,EAAK,OAAS,OAChB,OACE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAkB,UAAU,2CACzB,SAAA,EAAK,IACF,EAFK,CAEL,EAGV,GAAI,EAAK,OAAS,QAChB,OACE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAkB,UAAU,gDACzB,SAAA,EAAK,IACF,EAFK,CAEL,EAGV,GAAM,CAAE,SAAU,EAClB,OACE,EAAA,EAAA,KAAA,CAAC,OAAD,CAAkB,UAAU,aAA5B,SAAA,CACG,EAAM,SAAW,IAAA,GAId,MAHF,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAW,gBAAgB,EAAM,SAAW,QAAU,iBAAmB,oBAC5E,SAAA,EAAM,SAAW,QAAU,KAAO,EAC/B,CAAA,GAER,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sCAAsC,MAAO,EAC1D,SAAA,EAAM,IACH,CAAA,GACN,EAAA,EAAA,IAAA,CAACC,EAAAA,WAAD,CACE,MAAO,EAAM,IAAI,CAAK,EACtB,KAAM,EAAM,QACZ,UAAW,2CAA2C,EAAM,SAAW,QAAU,eAAiB,kBACnG,CAAA,CACG,CAdK,EAAA,CAcL,CAEV,CAAC,CACE,CAAA,CAET"}
1
+ {"version":3,"file":"HashlineLines.cjs","names":["hashlineGroupsKey","useState","detectGrammar","highlightToLines","useMemo","hashlineGroups","cn","SyntaxLine"],"sources":["../../../src/components/HashlineLines.tsx"],"sourcesContent":["import { type ComponentProps, useEffect, useMemo, useState } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { type HashlineGroup, hashlineGroups, hashlineGroupsKey } from '../lib/hashlineHighlight';\nimport type { PresentedLine } from '../lib/hashlineView';\nimport { detectGrammar, highlightToLines, type SyntaxSpan } from '../lib/syntaxHighlight';\nimport { SyntaxLine } from './SyntaxText';\n\n/**\n * The anchored body shared by hashline results: a file heading per group, a\n * right-aligned line-number gutter, and a `>>` marker on grep matches. The\n * gutter width is a style, not a class, because it follows the widest number.\n *\n * The anchored lines are coloured with the editor's grammars when the body\n * names a file, or when `path` names one for a result that does not. Colour\n * arrives a frame or two late and never blocks the text: an unhighlighted body\n * is the same body without the colours.\n */\nexport interface HashlineLinesProps extends ComponentProps<'div'> {\n lines: readonly PresentedLine[];\n /** Width of the line-number column, in characters, from `hashlineBody`. */\n gutter: number;\n /** The file a body of bare anchored lines came from, for highlighting. */\n path?: string | undefined;\n}\n\nconst NO_SPANS: ReadonlyMap<number, readonly SyntaxSpan[]> = new Map();\n\n/**\n * Spans per presented-line index, once every file's run has parsed. The result\n * is stored with the body it belongs to, so a body that has changed since\n * reads as plain rather than wearing the previous body's colours.\n */\nfunction useHashlineSpans(groups: readonly HashlineGroup[]): ReadonlyMap<number, readonly SyntaxSpan[]> {\n const key = hashlineGroupsKey(groups);\n const [done, setDone] = useState<{ key: string; spans: ReadonlyMap<number, readonly SyntaxSpan[]> } | undefined>(\n undefined,\n );\n\n useEffect(() => {\n let live = true;\n const next = new Map<number, readonly SyntaxSpan[]>();\n const work = groups.map(async (group) => {\n const grammar = detectGrammar({ path: group.path, text: group.text });\n if (grammar === undefined) return;\n const highlighted = await highlightToLines(group.text, grammar);\n if (highlighted === undefined) return;\n for (const [offset, index] of group.indices.entries()) {\n const line = highlighted[offset];\n if (line !== undefined) next.set(index, line);\n }\n });\n // One state write for the whole body, so a many-file grep result does not\n // repaint once per file. A grammar that fails to load leaves its run plain.\n void Promise.allSettled(work).then(() => {\n if (live && next.size > 0) setDone({ key, spans: next });\n });\n return () => {\n live = false;\n };\n // The groups are rebuilt every render; their key is what actually changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [key]);\n\n return done?.key === key ? done.spans : NO_SPANS;\n}\n\nexport function HashlineLines({ className, lines, gutter, path, ...props }: HashlineLinesProps) {\n const groups = useMemo(() => hashlineGroups(lines, path), [lines, path]);\n const spans = useHashlineSpans(groups);\n // Bound to a name rather than written inline: this file ships as a scaffold\n // template too, and an inline style object opens with the same two braces\n // Liquid reads as an output tag, which fails to render.\n const gutterStyle = { width: `${gutter}ch` };\n return (\n <div data-slot=\"hashline-lines\" className={cn('flex flex-col font-mono', className)} {...props}>\n {lines.map((line, index) => {\n if (line.type === 'file') {\n return (\n <span key={index} className=\"mt-1 truncate text-doom-faint first:mt-0\">\n {line.path}\n </span>\n );\n }\n if (line.type === 'plain') {\n return (\n <span key={index} className=\"whitespace-pre-wrap break-words text-doom-dim\">\n {line.text}\n </span>\n );\n }\n const { value } = line;\n return (\n <span key={index} className=\"flex gap-2\">\n {value.marker !== undefined ? (\n <span className={`w-4 shrink-0 ${value.marker === 'match' ? 'text-doom-blue' : 'text-doom-faint'}`}>\n {value.marker === 'match' ? '>>' : ''}\n </span>\n ) : null}\n <span className=\"shrink-0 text-right text-doom-faint\" style={gutterStyle}>\n {value.line}\n </span>\n <SyntaxLine\n spans={spans.get(index)}\n text={value.content}\n className={`min-w-0 whitespace-pre-wrap break-words ${value.marker === 'match' ? 'text-doom-hi' : 'text-doom-text'}`}\n />\n </span>\n );\n })}\n </div>\n );\n}\n"],"mappings":"uMA0BA,MAAM,kBAAuD,IAAI,IAOjE,SAAS,EAAiB,EAA8E,CACtG,IAAM,EAAMA,EAAAA,kBAAkB,CAAM,EAC9B,CAAC,EAAM,IAAA,EAAWC,EAAAA,SAAAA,CACtB,IAAA,EACF,EA2BA,OAzBA,EAAA,EAAA,UAAA,KAAgB,CACd,IAAI,EAAO,GACL,kBAAO,IAAI,IACX,EAAO,EAAO,IAAI,KAAO,IAAU,CACvC,IAAM,EAAUC,EAAAA,cAAc,CAAE,KAAM,EAAM,KAAM,KAAM,EAAM,IAAK,CAAC,EACpE,GAAI,IAAY,IAAA,GAAW,OAC3B,IAAM,EAAc,MAAMC,EAAAA,iBAAiB,EAAM,KAAM,CAAO,EAC1D,OAAg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AAA,EAAM,SAAW,QAAU,KAAO,EAC/B,CAAA,EAER,iBAAA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sCAAsC,MAAO,EAC1D,SAAA,EAAM,IACH,CAAA,EACN,iBAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,WAAD,CACE,MAAO,EAAM,IAAI,CAAK,EACtB,KAAM,EAAM,QACZ,UAAW,2CAA2C,EAAM,SAAW,QAAU,eAAiB,kBACnG,CAAA,CACG,CAdK,EAAA,CAcL,CAEV,CAAC,CACE,CAAA,CAET"}
@@ -1,2 +1,2 @@
1
- import{cn as e}from"../lib/cn.mjs";import{hashlineGroups as t,hashlineGroupsKey as n}from"../lib/hashlineHighlight.mjs";import{detectGrammar as r,highlightToLines as i}from"../lib/syntaxHighlight.mjs";import{SyntaxLine as a}from"./SyntaxText.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{useEffect as c,useMemo as l,useState as u}from"react";const d=new Map;function f(e){let t=n(e),[a,o]=u(void 0);return c(()=>{let n=!0,a=new Map,s=e.map(async e=>{let t=r({path:e.path,text:e.text});if(t===void 0)return;let n=await i(e.text,t);if(n!==void 0)for(let[t,r]of e.indices.entries()){let e=n[t];e!==void 0&&a.set(r,e)}});return Promise.allSettled(s).then(()=>{n&&a.size>0&&o({key:t,spans:a})}),()=>{n=!1}},[t]),a?.key===t?a.spans:d}function p({className:n,lines:r,gutter:i,path:c,...u}){let d=f(l(()=>t(r,c),[r,c])),p={width:`${i}ch`};return o(`div`,{"data-slot":`hashline-lines`,className:e(`flex flex-col font-mono`,n),...u,children:r.map((e,t)=>{if(e.type===`file`)return o(`span`,{className:`mt-1 truncate text-doom-faint first:mt-0`,children:e.path},t);if(e.type===`plain`)return o(`span`,{className:`whitespace-pre-wrap break-words text-doom-dim`,children:e.text},t);let{value:n}=e;return s(`span`,{className:`flex gap-2`,children:[n.marker===void 0?null:o(`span`,{className:`w-4 shrink-0 ${n.marker===`match`?`text-doom-blue`:`text-doom-faint`}`,children:n.marker===`match`?`>>`:``}),o(`span`,{className:`shrink-0 text-right text-doom-faint`,style:p,children:n.line}),o(a,{spans:d.get(t),text:n.content,className:`min-w-0 whitespace-pre-wrap break-words ${n.marker===`match`?`text-doom-hi`:`text-doom-text`}`})]},t)})})}export{p as HashlineLines};
1
+ import{cn as e}from"../lib/cn.mjs";import{hashlineGroups as t,hashlineGroupsKey as n}from"../lib/hashlineHighlight.mjs";import{detectGrammar as r,highlightToLines as i}from"../lib/syntaxHighlight.mjs";import{SyntaxLine as a}from"./SyntaxText.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{useEffect as c,useMemo as l,useState as u}from"react";const d=/* @__PURE__ */ new Map;function f(e){let t=n(e),[a,o]=u(void 0);return c(()=>{let n=!0,a=/* @__PURE__ */ new Map,s=e.map(async e=>{let t=r({path:e.path,text:e.text});if(t===void 0)return;let n=await i(e.text,t);if(n!==void 0)for(let[t,r]of e.indices.entries()){let e=n[t];e!==void 0&&a.set(r,e)}});return Promise.allSettled(s).then(()=>{n&&a.size>0&&o({key:t,spans:a})}),()=>{n=!1}},[t]),a?.key===t?a.spans:d}function p({className:n,lines:r,gutter:i,path:c,...u}){let d=f(l(()=>t(r,c),[r,c])),p={width:`${i}ch`};return/* @__PURE__ */ o(`div`,{"data-slot":`hashline-lines`,className:e(`flex flex-col font-mono`,n),...u,children:r.map((e,t)=>{if(e.type===`file`)return/* @__PURE__ */ o(`span`,{className:`mt-1 truncate text-doom-faint first:mt-0`,children:e.path},t);if(e.type===`plain`)return/* @__PURE__ */ o(`span`,{className:`whitespace-pre-wrap break-words text-doom-dim`,children:e.text},t);let{value:n}=e;return/* @__PURE__ */ s(`span`,{className:`flex gap-2`,children:[n.marker===void 0?null:/* @__PURE__ */ o(`span`,{className:`w-4 shrink-0 ${n.marker===`match`?`text-doom-blue`:`text-doom-faint`}`,children:n.marker===`match`?`>>`:``}),/* @__PURE__ */ o(`span`,{className:`shrink-0 text-right text-doom-faint`,style:p,children:n.line}),/* @__PURE__ */ o(a,{spans:d.get(t),text:n.content,className:`min-w-0 whitespace-pre-wrap break-words ${n.marker===`match`?`text-doom-hi`:`text-doom-text`}`})]},t)})})}export{p as HashlineLines};
2
2
  //# sourceMappingURL=HashlineLines.mjs.map