@keboola/design 11.3.0 → 11.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/AGENTS.md +208 -1
  2. package/CHANGELOG.md +528 -0
  3. package/COMPONENT-API.md +68 -46
  4. package/dist/{AIKit-DaFT7p92.js → AIKit-CNX6aiKm.js} +338 -113
  5. package/dist/AIKit-CNX6aiKm.js.map +1 -0
  6. package/dist/{Alert-CseY3yAj.js → Alert-Ba5b2YPq.js} +3 -3
  7. package/dist/{Alert-CseY3yAj.js.map → Alert-Ba5b2YPq.js.map} +1 -1
  8. package/dist/{AlertModal-DQAGpsEy.js → AlertModal-BGJdaRRj.js} +3 -3
  9. package/dist/{AlertModal-DQAGpsEy.js.map → AlertModal-BGJdaRRj.js.map} +1 -1
  10. package/dist/{AppShell-BUoxM3fv.js → AppShell-DRgJxpXW.js} +2 -2
  11. package/dist/{AppShell-BUoxM3fv.js.map → AppShell-DRgJxpXW.js.map} +1 -1
  12. package/dist/{Badge-Ch26CXoP.js → Badge-D0pXdekt.js} +2 -2
  13. package/dist/Badge-D0pXdekt.js.map +1 -0
  14. package/dist/{BrandEditor-BnTLMRMp.js → BrandEditor-CSANsxUz.js} +8 -8
  15. package/dist/{BrandEditor-BnTLMRMp.js.map → BrandEditor-CSANsxUz.js.map} +1 -1
  16. package/dist/{BrandLogo-V2pRUAeO.js → BrandLogo-CoKBk4MI.js} +5 -5
  17. package/dist/BrandLogo-CoKBk4MI.js.map +1 -0
  18. package/dist/{Breadcrumb-CQTPn_KB.js → Breadcrumb-g_xn_-Nf.js} +3 -3
  19. package/dist/{Breadcrumb-CQTPn_KB.js.map → Breadcrumb-g_xn_-Nf.js.map} +1 -1
  20. package/dist/{Button-CPsEQuTN.js → Button-DsRrU5F1.js} +6 -5
  21. package/dist/Button-DsRrU5F1.js.map +1 -0
  22. package/dist/{Card-Cd5HSBmv.js → Card-Dyo7055Q.js} +2 -2
  23. package/dist/{Card-Cd5HSBmv.js.map → Card-Dyo7055Q.js.map} +1 -1
  24. package/dist/{Checkbox-5VNCcV7E.js → Checkbox-CUIn2jap.js} +3 -3
  25. package/dist/{Checkbox-5VNCcV7E.js.map → Checkbox-CUIn2jap.js.map} +1 -1
  26. package/dist/{Clipboard-B7rckqV_.js → Clipboard-BTW6C-b_.js} +2 -2
  27. package/dist/{Clipboard-B7rckqV_.js.map → Clipboard-BTW6C-b_.js.map} +1 -1
  28. package/dist/{ClipboardButton-CQ6Aewpg.js → ClipboardButton-CwZJdRaz.js} +3 -3
  29. package/dist/{ClipboardButton-CQ6Aewpg.js.map → ClipboardButton-CwZJdRaz.js.map} +1 -1
  30. package/dist/{CodeEditor-CUse8znx.js → CodeEditor-C9zy7PxK.js} +16 -27
  31. package/dist/CodeEditor-C9zy7PxK.js.map +1 -0
  32. package/dist/{ColorInput-Q1D9Vcc_.js → ColorInput-BZV-u_94.js} +3 -3
  33. package/dist/{ColorInput-Q1D9Vcc_.js.map → ColorInput-BZV-u_94.js.map} +1 -1
  34. package/dist/{ColorModeSwitch-B5PXCVqB.js → ColorModeSwitch-CsWLiTBX.js} +3 -3
  35. package/dist/{ColorModeSwitch-B5PXCVqB.js.map → ColorModeSwitch-CsWLiTBX.js.map} +1 -1
  36. package/dist/{Combobox-CyoRA7oY.js → Combobox-BfIfaVMA.js} +285 -109
  37. package/dist/Combobox-BfIfaVMA.js.map +1 -0
  38. package/dist/{Command-Ds68v2rX.js → Command-Bfa1kpbt.js} +6 -6
  39. package/dist/{Command-Ds68v2rX.js.map → Command-Bfa1kpbt.js.map} +1 -1
  40. package/dist/{CopyField-DI66uY_g.js → CopyField-DpT0Ngz1.js} +2 -2
  41. package/dist/{CopyField-DI66uY_g.js.map → CopyField-DpT0Ngz1.js.map} +1 -1
  42. package/dist/{DateInput-BPj2pzsn.js → DateInput-DiEd5uCL.js} +4 -4
  43. package/dist/{DateInput-BPj2pzsn.js.map → DateInput-DiEd5uCL.js.map} +1 -1
  44. package/dist/{DatePicker-DyEGuW9m.js → DatePicker-nA8YdE84.js} +2 -2
  45. package/dist/{DatePicker-DyEGuW9m.js.map → DatePicker-nA8YdE84.js.map} +1 -1
  46. package/dist/{DateRangeInput-u9DxNbHW.js → DateRangeInput-DPfVYchl.js} +4 -4
  47. package/dist/{DateRangeInput-u9DxNbHW.js.map → DateRangeInput-DPfVYchl.js.map} +1 -1
  48. package/dist/{DateRangePicker-CYYhX6S7.js → DateRangePicker-DjSUFjh4.js} +5 -5
  49. package/dist/{DateRangePicker-CYYhX6S7.js.map → DateRangePicker-DjSUFjh4.js.map} +1 -1
  50. package/dist/{DropdownMenu-DpMEcyCq.js → DropdownMenu-CASr-jgl.js} +2 -2
  51. package/dist/{DropdownMenu-DpMEcyCq.js.map → DropdownMenu-CASr-jgl.js.map} +1 -1
  52. package/dist/{FieldItem-qQKGU9lF.js → FieldItem-B7XMmZSz.js} +3 -3
  53. package/dist/{FieldItem-qQKGU9lF.js.map → FieldItem-B7XMmZSz.js.map} +1 -1
  54. package/dist/{FileUpload-C336MVnU.js → FileUpload-ABThVZyg.js} +2 -2
  55. package/dist/{FileUpload-C336MVnU.js.map → FileUpload-ABThVZyg.js.map} +1 -1
  56. package/dist/{Form-CTygENDc.js → Form-CsttTHn4.js} +8 -8
  57. package/dist/Form-CsttTHn4.js.map +1 -0
  58. package/dist/{FormGroup-BnwP0jNu.js → FormGroup-DHvTFdno.js} +3 -3
  59. package/dist/{FormGroup-BnwP0jNu.js.map → FormGroup-DHvTFdno.js.map} +1 -1
  60. package/dist/{FullScreenModal-j-M4aPFd.js → FullScreenModal-BvPuYibe.js} +3 -3
  61. package/dist/{FullScreenModal-j-M4aPFd.js.map → FullScreenModal-BvPuYibe.js.map} +1 -1
  62. package/dist/{HoverCard-yQq-O49c.js → HoverCard-B9ZMJxjn.js} +2 -2
  63. package/dist/{HoverCard-yQq-O49c.js.map → HoverCard-B9ZMJxjn.js.map} +1 -1
  64. package/dist/{InputGroup-D7zlmqPB.js → InputGroup-DcZRlVnN.js} +24 -16
  65. package/dist/InputGroup-DcZRlVnN.js.map +1 -0
  66. package/dist/{Kbd-D6LpR7G2.js → Kbd-Cvvt91Q8.js} +14 -4
  67. package/dist/Kbd-Cvvt91Q8.js.map +1 -0
  68. package/dist/MarkedText-DNGEUVWc.js +67 -0
  69. package/dist/MarkedText-DNGEUVWc.js.map +1 -0
  70. package/dist/{MermaidDiagram-JlvuGcY-.js → MermaidDiagram-CXG5tC6J.js} +19 -18
  71. package/dist/MermaidDiagram-CXG5tC6J.js.map +1 -0
  72. package/dist/{Modal-o4ATIexE.js → Modal-Coj-H02o.js} +16 -4
  73. package/dist/Modal-Coj-H02o.js.map +1 -0
  74. package/dist/{MultiActionButtonGroup-GTeFk-L8.js → MultiActionButtonGroup-DokHbPgM.js} +3 -3
  75. package/dist/{MultiActionButtonGroup-GTeFk-L8.js.map → MultiActionButtonGroup-DokHbPgM.js.map} +1 -1
  76. package/dist/{Navbar-CAQs4BZz.js → Navbar-Liy1TPI7.js} +7 -7
  77. package/dist/{Navbar-CAQs4BZz.js.map → Navbar-Liy1TPI7.js.map} +1 -1
  78. package/dist/PageHeader-Q3IpCnQd.js.map +1 -1
  79. package/dist/{PageToolbar-bG2YtSa3.js → PageToolbar-DExqEYGl.js} +4 -4
  80. package/dist/{PageToolbar-bG2YtSa3.js.map → PageToolbar-DExqEYGl.js.map} +1 -1
  81. package/dist/{Pagination-BB3X7ooY.js → Pagination-C_b7Xhey.js} +2 -2
  82. package/dist/{Pagination-BB3X7ooY.js.map → Pagination-C_b7Xhey.js.map} +1 -1
  83. package/dist/{Popconfirm-C2Ky5hJO.js → Popconfirm-5pBzT_HQ.js} +12 -13
  84. package/dist/{Popconfirm-C2Ky5hJO.js.map → Popconfirm-5pBzT_HQ.js.map} +1 -1
  85. package/dist/{Popover-DsbI2HKu.js → Popover-BEbQrC_P.js} +22 -19
  86. package/dist/Popover-BEbQrC_P.js.map +1 -0
  87. package/dist/{RadioGroup-BMxuZEbT.js → RadioGroup-DXPbSj8P.js} +3 -3
  88. package/dist/{RadioGroup-BMxuZEbT.js.map → RadioGroup-DXPbSj8P.js.map} +1 -1
  89. package/dist/{Search-DFeECt5D.js → Search-5uQAiNIP.js} +2 -2
  90. package/dist/{Search-DFeECt5D.js.map → Search-5uQAiNIP.js.map} +1 -1
  91. package/dist/{SearchInput-CCpdUego.js → SearchInput-D4UgAXJK.js} +3 -3
  92. package/dist/{SearchInput-CCpdUego.js.map → SearchInput-D4UgAXJK.js.map} +1 -1
  93. package/dist/{SectionNav-Bw_MVL0_.js → SectionNav-OkKCjSA-.js} +5 -5
  94. package/dist/{SectionNav-Bw_MVL0_.js.map → SectionNav-OkKCjSA-.js.map} +1 -1
  95. package/dist/{Select-D6IZVvwL.js → Select-DV3Hak_l.js} +31 -21
  96. package/dist/Select-DV3Hak_l.js.map +1 -0
  97. package/dist/{Sheet-BIzs2K2H.js → Sheet-Chf0kX1E.js} +3 -3
  98. package/dist/{Sheet-BIzs2K2H.js.map → Sheet-Chf0kX1E.js.map} +1 -1
  99. package/dist/{Sidebar-r1TW4g_b.js → Sidebar-D3cY1kha.js} +48 -22
  100. package/dist/Sidebar-D3cY1kha.js.map +1 -0
  101. package/dist/{Slider-CjxyfEty.js → Slider-CRf-bB4y.js} +3 -3
  102. package/dist/{Slider-CjxyfEty.js.map → Slider-CRf-bB4y.js.map} +1 -1
  103. package/dist/{Switch-BueTV03C.js → Switch-B0WdGSjz.js} +8 -8
  104. package/dist/{Switch-BueTV03C.js.map → Switch-B0WdGSjz.js.map} +1 -1
  105. package/dist/{Tabs-l72-WuhK.js → Tabs-eB974xJf.js} +2 -2
  106. package/dist/{Tabs-l72-WuhK.js.map → Tabs-eB974xJf.js.map} +1 -1
  107. package/dist/{TextInput-DhdRk8qm.js → TextInput-DH5SkbsE.js} +3 -3
  108. package/dist/{TextInput-DhdRk8qm.js.map → TextInput-DH5SkbsE.js.map} +1 -1
  109. package/dist/{ThemeProvider-DZfGdf1v.js → ThemeProvider-2RMdVGxO.js} +95 -15
  110. package/dist/ThemeProvider-2RMdVGxO.js.map +1 -0
  111. package/dist/{TimePicker-B6d2rAbX.js → TimePicker-BGeqc-Ed.js} +2 -2
  112. package/dist/{TimePicker-B6d2rAbX.js.map → TimePicker-BGeqc-Ed.js.map} +1 -1
  113. package/dist/{Timeline-6btyJl4D.js → Timeline-BG5Xogxh.js} +11 -11
  114. package/dist/{Timeline-6btyJl4D.js.map → Timeline-BG5Xogxh.js.map} +1 -1
  115. package/dist/{Toast-CxXUulYN.js → Toast-Dr6Uw7ao.js} +2 -2
  116. package/dist/{Toast-CxXUulYN.js.map → Toast-Dr6Uw7ao.js.map} +1 -1
  117. package/dist/{Workbench-BzE-Vvd9.js → Workbench-UR2FBC7I.js} +3 -1
  118. package/dist/Workbench-UR2FBC7I.js.map +1 -0
  119. package/dist/{ZoomableSvg-CNIzRHKH.js → ZoomableSvg-pooPb1Cu.js} +4 -4
  120. package/dist/{ZoomableSvg-CNIzRHKH.js.map → ZoomableSvg-pooPb1Cu.js.map} +1 -1
  121. package/dist/{context-BrNtMc1H.js → context-D7X470dy.js} +4 -3
  122. package/dist/context-D7X470dy.js.map +1 -0
  123. package/dist/{defaults-CTfvj2KB.js → defaults-i_xG2F_1.js} +2 -4
  124. package/dist/defaults-i_xG2F_1.js.map +1 -0
  125. package/dist/editors.js +5 -5
  126. package/dist/findLiteralMatches-BGBw8Vbl.js +62 -0
  127. package/dist/findLiteralMatches-BGBw8Vbl.js.map +1 -0
  128. package/dist/flint.js +134 -8
  129. package/dist/flint.js.map +1 -1
  130. package/dist/index.d.ts +1118 -566
  131. package/dist/index.js +64 -62
  132. package/dist/internal/blocks/AIKit.js +2 -2
  133. package/dist/internal/blocks/AppShell.js +1 -1
  134. package/dist/internal/blocks/AuthLayout.js +118 -0
  135. package/dist/internal/blocks/AuthLayout.js.map +1 -0
  136. package/dist/internal/blocks/BrandEditor.js +1 -1
  137. package/dist/internal/blocks/ChartPanel.js +1 -1
  138. package/dist/internal/blocks/ClipboardButton.js +1 -1
  139. package/dist/internal/blocks/ColorInput.js +1 -1
  140. package/dist/internal/blocks/ColorModeSwitch.js +1 -1
  141. package/dist/internal/blocks/Command.js +1 -1
  142. package/dist/internal/blocks/CopyField.js +1 -1
  143. package/dist/internal/blocks/DateInput.js +1 -1
  144. package/dist/internal/blocks/DateRangeInput.js +1 -1
  145. package/dist/internal/blocks/EmptyConfigurationActionCard.js +1 -1
  146. package/dist/internal/blocks/ErrorState.js +1 -1
  147. package/dist/internal/blocks/ExportMenu.js +5 -5
  148. package/dist/internal/blocks/ExportMenu.js.map +1 -1
  149. package/dist/internal/blocks/Form/connectors/MultiComboboxField.js +1 -1
  150. package/dist/internal/blocks/Form.js +1 -1
  151. package/dist/internal/blocks/FormGroup.js +1 -1
  152. package/dist/internal/blocks/MultiActionButtonGroup.js +1 -1
  153. package/dist/internal/blocks/MultiCombobox.js +116 -54
  154. package/dist/internal/blocks/MultiCombobox.js.map +1 -1
  155. package/dist/internal/blocks/NumberInput.js +1 -1
  156. package/dist/internal/blocks/PageToolbar.js +1 -1
  157. package/dist/internal/blocks/PasswordInput.js +2 -2
  158. package/dist/internal/blocks/SearchInput.js +1 -1
  159. package/dist/internal/blocks/SearchInputWithNavigation.js +3 -3
  160. package/dist/internal/blocks/SectionNav.js +1 -1
  161. package/dist/internal/blocks/SplitButton.js +2 -2
  162. package/dist/internal/blocks/StatCard.js +1 -1
  163. package/dist/internal/blocks/TextInput.js +1 -1
  164. package/dist/internal/blocks/Textarea.js +1 -1
  165. package/dist/internal/blocks/TimeInput.js +3 -3
  166. package/dist/internal/components/Alert.js +1 -1
  167. package/dist/internal/components/AlertModal.js +1 -1
  168. package/dist/internal/components/Avatar.js +1 -1
  169. package/dist/internal/components/Badge.js +1 -1
  170. package/dist/internal/components/BrandLogo.js +1 -1
  171. package/dist/internal/components/Breadcrumb.js +1 -1
  172. package/dist/internal/components/Button.js +1 -1
  173. package/dist/internal/components/Card.js +1 -1
  174. package/dist/internal/components/Checkbox.js +1 -1
  175. package/dist/internal/components/Clipboard.js +1 -1
  176. package/dist/internal/components/CollapsiblePanel.js +1 -1
  177. package/dist/internal/components/Combobox.js +2 -2
  178. package/dist/internal/components/DatePicker.js +1 -1
  179. package/dist/internal/components/DateRangePicker.js +1 -1
  180. package/dist/internal/components/DropdownMenu.js +1 -1
  181. package/dist/internal/components/FileUpload.js +1 -1
  182. package/dist/internal/components/FullScreenModal.js +1 -1
  183. package/dist/internal/components/HoverCard.js +1 -1
  184. package/dist/internal/components/InputGroup.js +1 -1
  185. package/dist/internal/components/Kbd.js +1 -1
  186. package/dist/internal/components/MarkedText.js +1 -1
  187. package/dist/internal/components/Modal.js +1 -1
  188. package/dist/internal/components/Navbar.js +1 -1
  189. package/dist/internal/components/Pagination.js +1 -1
  190. package/dist/internal/components/Popconfirm.js +1 -1
  191. package/dist/internal/components/Popover.js +1 -1
  192. package/dist/internal/components/RadioGroup.js +1 -1
  193. package/dist/internal/components/Search.js +1 -1
  194. package/dist/internal/components/Select.js +1 -1
  195. package/dist/internal/components/Sheet.js +1 -1
  196. package/dist/internal/components/Sidebar.js +1 -1
  197. package/dist/internal/components/Slider.js +1 -1
  198. package/dist/internal/components/Switch.js +1 -1
  199. package/dist/internal/components/Tabs.js +1 -1
  200. package/dist/internal/components/ThemeProvider.js +4 -4
  201. package/dist/internal/components/TimePicker.js +1 -1
  202. package/dist/internal/components/Timeline.js +1 -1
  203. package/dist/internal/components/Toast.js +2 -2
  204. package/dist/internal/components/Toggle.js +3 -3
  205. package/dist/internal/components/Toggle.js.map +1 -1
  206. package/dist/internal/components/Tooltip.js +1 -1
  207. package/dist/internal/components/Truncated.js +1 -1
  208. package/dist/internal/components/Workbench.js +1 -1
  209. package/dist/internal/components/ZoomableSvg.js +1 -1
  210. package/dist/internal/utils.js +3 -3
  211. package/dist/markdown-editor.js +32 -26
  212. package/dist/markdown-editor.js.map +1 -1
  213. package/dist/mermaid.js +1 -1
  214. package/dist/rjsf.js +24 -25
  215. package/dist/rjsf.js.map +1 -1
  216. package/dist/styles.css +1 -1
  217. package/dist/testing.js +4 -4
  218. package/dist/testing.js.map +1 -1
  219. package/dist/{useColorSchemeState-BJEk6esG.js → themeScopeContext-D7fSyb06.js} +17 -4
  220. package/dist/themeScopeContext-D7fSyb06.js.map +1 -0
  221. package/dist/{themeTokens-7T1AFLhq.js → themeTokens-qP1-55O7.js} +38 -11
  222. package/dist/themeTokens-qP1-55O7.js.map +1 -0
  223. package/dist/{toast-BweSoKn3.js → toast-DIC0iNRf.js} +2 -2
  224. package/dist/{toast-BweSoKn3.js.map → toast-DIC0iNRf.js.map} +1 -1
  225. package/dist/{utils-B-g7d_Jb.js → utils-DSvrhU8E.js} +7 -3
  226. package/dist/{utils-B-g7d_Jb.js.map → utils-DSvrhU8E.js.map} +1 -1
  227. package/dist/vega.d.ts +1 -1
  228. package/dist/vega.js +3 -3
  229. package/dist/vega.js.map +1 -1
  230. package/dist/{vegaTheme-FBXgAdHK.js → vegaTheme-CSvFEMBl.js} +6 -6
  231. package/dist/vegaTheme-CSvFEMBl.js.map +1 -0
  232. package/package.json +12 -10
  233. package/src/styles.css +3 -0
  234. package/dist/AIKit-DaFT7p92.js.map +0 -1
  235. package/dist/Badge-Ch26CXoP.js.map +0 -1
  236. package/dist/BrandLogo-V2pRUAeO.js.map +0 -1
  237. package/dist/Button-CPsEQuTN.js.map +0 -1
  238. package/dist/CodeEditor-CUse8znx.js.map +0 -1
  239. package/dist/Combobox-CyoRA7oY.js.map +0 -1
  240. package/dist/Form-CTygENDc.js.map +0 -1
  241. package/dist/InputGroup-D7zlmqPB.js.map +0 -1
  242. package/dist/Kbd-D6LpR7G2.js.map +0 -1
  243. package/dist/MarkedText-Ckbft5mw.js +0 -44
  244. package/dist/MarkedText-Ckbft5mw.js.map +0 -1
  245. package/dist/MermaidDiagram-JlvuGcY-.js.map +0 -1
  246. package/dist/Modal-o4ATIexE.js.map +0 -1
  247. package/dist/Popover-DsbI2HKu.js.map +0 -1
  248. package/dist/Select-D6IZVvwL.js.map +0 -1
  249. package/dist/Sidebar-r1TW4g_b.js.map +0 -1
  250. package/dist/ThemeProvider-DZfGdf1v.js.map +0 -1
  251. package/dist/Workbench-BzE-Vvd9.js.map +0 -1
  252. package/dist/context-BrNtMc1H.js.map +0 -1
  253. package/dist/defaults-CTfvj2KB.js.map +0 -1
  254. package/dist/escapeStringRegexp-8MxP2knR.js +0 -6
  255. package/dist/escapeStringRegexp-8MxP2knR.js.map +0 -1
  256. package/dist/themeTokens-7T1AFLhq.js.map +0 -1
  257. package/dist/useColorSchemeState-BJEk6esG.js.map +0 -1
  258. package/dist/vegaTheme-FBXgAdHK.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AIKit-CNX6aiKm.js","names":["renderVariantIcon"],"sources":["../src/blocks/AIKit/AnswerActions.tsx","../src/blocks/AIKit/CollapsibleBody.tsx","../src/blocks/AIKit/CollapsibleStepHeader.tsx","../src/blocks/AIKit/hasMotion.ts","../src/blocks/AIKit/InlineStepDetail.tsx","../src/blocks/AIKit/InlineStepLabel.tsx","../src/blocks/AIKit/AnswerSummary.tsx","../src/blocks/AIKit/Markdown.tsx","../src/blocks/AIKit/MessageBubble.tsx","../src/blocks/AIKit/PlanApproval.tsx","../src/blocks/AIKit/PlanRewritingIndicator.tsx","../src/blocks/AIKit/PromptInputAction.tsx","../src/blocks/AIKit/PromptInputCommands.tsx","../src/blocks/AIKit/PromptInputSubmit.tsx","../src/blocks/AIKit/PromptInput.tsx","../src/blocks/AIKit/Question.tsx","../src/blocks/AIKit/QuestionBlock.tsx","../src/blocks/AIKit/SuggestedPrompt.tsx","../src/blocks/AIKit/ThinkingIndicator.tsx","../src/blocks/AIKit/ToolCall/ToolCallApproval.tsx","../src/blocks/AIKit/ToolCall/ToolCallChip.tsx","../src/blocks/AIKit/ToolCallStatusHeader.tsx","../src/blocks/AIKit/usageStatsHelpers.ts","../src/blocks/AIKit/UsageStatsRing.tsx","../src/blocks/AIKit/UsageStats.tsx"],"sourcesContent":["import { Button } from '../../components/Button';\nimport { ButtonGroup } from '../../components/ButtonGroup';\nimport { Tooltip } from '../../components/Tooltip';\nimport { ThumbsDown, ThumbsUp } from '../../icons';\nimport { ClipboardButton } from '../ClipboardButton';\n\n/** Which way a reader rated an answer. */\nexport type AnswerVote = 'up' | 'down';\n\nconst VOTE_BUTTONS = [\n { vote: 'up', label: 'Good answer', icon: <ThumbsUp className=\"tw:size-4\" /> },\n { vote: 'down', label: 'Bad answer', icon: <ThumbsDown className=\"tw:size-4\" /> },\n] as const;\n\ntype Props = {\n /**\n * The answer as the reader would read it, for the clipboard.\n *\n * - Empty or absent draws no copy button: a turn that produced only tool calls has nothing\n * to take away, and a disabled control is a worse answer to that than no control.\n */\n copyText?: string;\n /** The vote already recorded against this answer, or `null` for none. */\n vote: AnswerVote | null;\n onVote: (vote: AnswerVote) => void;\n};\n\n/**\n * What a reader can do with a finished answer: take it away, and say whether it was any good.\n *\n * - **Always rendered, never hover-only.** A reveal-on-hover row does not exist for anyone\n * reaching it without a pointer. The buttons are quiet (`invisible`) rather than hidden.\n * - Copy sits first: it is the one action with no round trip.\n * - **A vote can be changed but not withdrawn.** `aria-pressed` says which one is recorded, and\n * both buttons stay focusable so a reader can switch. Pressing the pressed one re-sends the\n * same vote.\n * - The recorded vote and the write are the caller's: the two chats vote against different\n * endpoints, and only the caller knows whether a turn is finished enough to rate.\n */\nexport const AnswerActions = ({ copyText, vote, onVote }: Props) => {\n return (\n <ButtonGroup space=\"extra-small\" aria-label=\"Answer actions\">\n {copyText ? (\n <ClipboardButton text={copyText} tooltip=\"Copy answer\" size=\"icon-xs\" variant=\"invisible\" />\n ) : null}\n\n {VOTE_BUTTONS.map(({ vote: candidate, label, icon }) => {\n const isRecorded = vote === candidate;\n\n return (\n <Tooltip key={candidate} tooltip={label} placement=\"top\" triggerAsChild>\n <Button\n size=\"icon-xs\"\n variant={isRecorded ? 'secondary' : 'invisible'}\n aria-label={label}\n aria-pressed={isRecorded}\n onClick={() => onVote(candidate)}\n >\n {icon}\n </Button>\n </Tooltip>\n );\n })}\n </ButtonGroup>\n );\n};\n","import type { ReactNode, TransitionEvent } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = {\n isExpanded: boolean;\n isClosing: boolean;\n onClosed: () => void;\n children: ReactNode;\n};\n\nexport const CollapsibleBody = ({ isExpanded, isClosing, onClosed, children }: Props) => {\n const handleTransitionEnd = (event: TransitionEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) return;\n if (event.propertyName !== 'grid-template-rows') return;\n if (!isExpanded) onClosed();\n };\n\n return (\n <div\n className={cn(\n 'tw:grid tw:transition-[grid-template-rows] tw:duration-300 tw:ease-out tw:motion-reduce:transition-none',\n isExpanded ? 'tw:grid-rows-[1fr]' : 'tw:grid-rows-[0fr]',\n )}\n onTransitionEnd={handleTransitionEnd}\n >\n <div className=\"tw:min-h-0 tw:overflow-hidden\">{(isExpanded || isClosing) && children}</div>\n </div>\n );\n};\n","import type { ReactNode } from 'react';\n\nimport { ChevronDown, CircleCheck, Loader2, XCircle } from '../../icons';\nimport { cn } from '../../utils';\n\ntype Variant = 'success' | 'error' | 'processing' | 'dismissed';\n\ntype Props = {\n isExpanded: boolean;\n onToggle: () => void;\n label: ReactNode;\n variant?: Variant;\n};\n\n// Chrome speaks grey: step headers are meta-information, so they read in\n// muted ink and darken on hover — blue is reserved for genuinely interactive\n// elements (links, buttons), and status colour lives only in the icon. Error\n// keeps its tinted label: a failed step is content, not chrome.\nconst variantClasses: Record<Variant, string> = {\n success:\n 'tw:text-muted-foreground tw:focus-visible:outline-ring tw:not-disabled:hover:text-foreground',\n error:\n 'tw:text-destructive tw:focus-visible:outline-destructive tw:not-disabled:hover:text-destructive',\n processing:\n 'tw:text-muted-foreground tw:focus-visible:outline-ring tw:not-disabled:hover:text-foreground',\n dismissed:\n 'tw:text-muted-foreground tw:focus-visible:outline-ring tw:not-disabled:hover:text-foreground',\n};\n\n// Icons one step quieter than the label so the row reads text-first.\nconst iconClasses = 'tw:size-3.5 tw:shrink-0 tw:basis-3.5 tw:opacity-70';\n\nconst renderVariantIcon = (variant: Variant) => {\n if (variant === 'processing') {\n return <Loader2 className={cn(iconClasses, 'tw:animate-spin')} />;\n }\n // `error` and `dismissed` share the mark and take their ink from the\n // button's variant class — `destructive` for a real failure,\n // `muted-foreground` for a step the user waved off.\n if (variant === 'error' || variant === 'dismissed') {\n return <XCircle className={iconClasses} />;\n }\n return <CircleCheck className={iconClasses} />;\n};\n\nexport const CollapsibleStepHeader = ({\n isExpanded,\n onToggle,\n label,\n variant = 'success',\n}: Props) => {\n return (\n <button\n type=\"button\"\n aria-expanded={isExpanded}\n onClick={onToggle}\n className={cn(\n 'tw:flex tw:w-fit tw:items-center tw:gap-1.5 tw:text-left tw:text-xs tw:font-medium tw:transition-colors tw:focus-visible:outline tw:focus-visible:outline-2 tw:focus-visible:outline-offset-2 tw:disabled:opacity-40',\n variantClasses[variant],\n )}\n >\n {renderVariantIcon(variant)}\n <span className=\"tw:min-w-0\">\n {label}\n {/* Zero-width joiner keeps the chevron on the label's last line —\n an inline chevron with nothing binding it to the preceding word\n orphans onto a line of its own at some container widths. */}\n <span className=\"tw:whitespace-nowrap\">\n {'⁠'}\n <ChevronDown\n className={cn(\n 'tw:ml-1.5 tw:inline-block tw:size-3.5 tw:align-middle tw:transition-transform',\n isExpanded && 'tw:rotate-180',\n )}\n />\n </span>\n </span>\n </button>\n );\n};\n","export const hasMotion = () =>\n typeof window.matchMedia === 'function' &&\n !window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n","import type { ReactNode } from 'react';\n\ntype Props = {\n children: ReactNode;\n};\n\nexport const InlineStepDetail = ({ children }: Props) => (\n // `ml-2.5` is half of the `size-5` icon box `InlineStepLabel` puts beside a\n // step, so the rule falls on that icon's centre line rather than 2px inside\n // it. Anything drawing a run of steps can then line its own connector up with\n // the same number.\n <div className=\"tw:ml-2.5 tw:whitespace-pre-wrap tw:border-l tw:border-border tw:pl-3 tw:text-xs tw:text-muted-foreground\">\n {children}\n </div>\n);\n\nexport type { Props as InlineStepDetailProps };\n","import type { ReactNode } from 'react';\n\nimport { CircleCheck, Loader2, XCircle } from '../../icons';\n\ntype Variant = 'processing' | 'success' | 'error' | 'dismissed';\n\ntype Props = {\n variant: Variant;\n children: ReactNode;\n};\n\n// Status lives in the icon alone, and quietly: success/dismissed marks are\n// muted (they are the expected outcome, not news), the spinner is a shade\n// stronger (it reports active work), and only a real error takes the status\n// red. Fixed neutral-* greys were invisible in dark mode; tokens follow it.\nconst renderVariantIcon = (variant: Variant) => {\n if (variant === 'processing') {\n return <Loader2 className=\"tw:size-3.5 tw:animate-spin tw:text-muted-foreground\" />;\n }\n if (variant === 'error') {\n return <XCircle className=\"tw:size-3.5 tw:text-destructive\" />;\n }\n if (variant === 'dismissed') {\n return <XCircle className=\"tw:size-3.5 tw:text-muted-foreground/50\" />;\n }\n return <CircleCheck className=\"tw:size-3.5 tw:text-muted-foreground/50\" />;\n};\n\nexport const InlineStepLabel = ({ variant, children }: Props) => (\n <div className=\"tw:flex tw:min-w-0 tw:items-center tw:gap-1\">\n {/* The icon can punch a gap in a connector drawn behind a run of steps: set\n `--inline-step-surface` on an ancestor to whatever paints behind, and the\n box masks the line across its own height. `relative` is what makes the\n mask work — the connector is absolutely positioned, so it paints above\n static content no matter what colour that content is. Unset the variable\n and the box stays transparent, so a step outside such a list is\n unchanged. */}\n <div className=\"tw:relative tw:flex tw:size-5 tw:shrink-0 tw:items-center tw:justify-center tw:[background:var(--inline-step-surface,transparent)]\">\n {renderVariantIcon(variant)}\n </div>\n <div className=\"tw:flex tw:min-w-0 tw:flex-wrap tw:items-center tw:gap-x-1.5 tw:gap-y-1 tw:text-xs tw:font-medium tw:text-muted-foreground\">\n {children}\n </div>\n </div>\n);\n\nexport type { Variant as InlineStepLabelVariant, Props as InlineStepLabelProps };\n","import { useState } from 'react';\n\nimport { CollapsibleBody } from './CollapsibleBody';\nimport { CollapsibleStepHeader } from './CollapsibleStepHeader';\nimport { hasMotion } from './hasMotion';\nimport { InlineStepDetail } from './InlineStepDetail';\nimport { InlineStepLabel } from './InlineStepLabel';\n\ntype AnswerItem = {\n question: string;\n answer?: string;\n};\n\ntype Variant = 'success' | 'dismissed';\n\ntype Props = {\n items: readonly AnswerItem[];\n variant?: Variant;\n noAnswerLabel?: string;\n onExpandToggle?: (next: boolean) => void;\n};\n\nconst SECTION_LABELS: Record<Variant, string> = {\n success: 'Answered questions',\n dismissed: 'Dismissed questions',\n};\n\nexport const AnswerSummary = ({\n items,\n variant = 'success',\n noAnswerLabel = 'No answer',\n onExpandToggle,\n}: Props) => {\n const [isExpanded, setIsExpanded] = useState(false);\n const [isClosing, setIsClosing] = useState(false);\n const toggle = () => {\n const next = !isExpanded;\n if (!next) setIsClosing(hasMotion());\n setIsExpanded(next);\n onExpandToggle?.(next);\n };\n const count = items.length;\n const [firstItem] = items;\n const label = count === 1 && firstItem ? firstItem.question : `${count} questions`;\n\n return (\n <section className=\"tw:mt-4 tw:flex tw:flex-col\" aria-label={SECTION_LABELS[variant]}>\n <CollapsibleStepHeader\n isExpanded={isExpanded}\n onToggle={toggle}\n variant={variant}\n label={label}\n />\n\n <CollapsibleBody\n isExpanded={isExpanded}\n isClosing={isClosing}\n onClosed={() => setIsClosing(false)}\n >\n <div className=\"tw:flex tw:flex-col tw:gap-4 tw:pt-4 tw:pl-5\">\n {items.map(({ question, answer }, index) => (\n <div key={`${index}-${question}`} className=\"tw:flex tw:flex-col tw:gap-1\">\n <InlineStepLabel variant={variant}>{question}</InlineStepLabel>\n <InlineStepDetail>\n {answer && answer.length > 0 ? answer : noAnswerLabel}\n </InlineStepDetail>\n </div>\n ))}\n </div>\n </CollapsibleBody>\n </section>\n );\n};\n\nexport type {\n AnswerItem as AnswerSummaryItem,\n Props as AnswerSummaryProps,\n Variant as AnswerSummaryVariant,\n};\n","import { isValidElement, lazy, Suspense } from 'react';\nimport type { ComponentPropsWithoutRef, ComponentType, ReactNode } from 'react';\nimport type { Components, ExtraProps, Options } from 'react-markdown';\nimport ReactMarkdown from 'react-markdown';\nimport remarkGfm from 'remark-gfm';\n\nimport { Table } from '../../components/Table';\nimport { cn } from '../../utils';\nimport { ClipboardButton } from '../ClipboardButton';\nimport { DiagramSkeleton } from '../DiagramShared/DiagramSkeleton';\n\n// beautiful-mermaid pulls elkjs (~442 kB gzip). Loading it on demand keeps it\n// out of the entry chunk of every app that touches the root barrel.\nconst MermaidDiagram = lazy(() =>\n import('@keboola/design/mermaid').then(\n (module) => ({ default: module.MermaidDiagram }),\n (error: unknown) => {\n // Typically a stale tab after a deploy. Log it so the swap to plain source\n // is not silent.\n console.error('[AIKit] failed to load the MermaidDiagram chunk', error);\n return {\n default: ({ code }: { code: string }) => (\n <pre>\n <code>{code}</code>\n </pre>\n ),\n };\n },\n ),\n);\n\n// vega + vega-lite + flint-chart outweigh the rest of an answer, and most\n// answers carry no chart. Loaded on demand for the same reason as mermaid.\nconst FlintChart = lazy(() =>\n import('@keboola/design/flint').then(\n (module) => ({ default: module.FlintChart }),\n (error: unknown) => {\n console.error('[AIKit] failed to load the FlintChart chunk', error);\n return {\n default: ({ code }: { code: string }) => (\n <pre>\n <code>{code}</code>\n </pre>\n ),\n };\n },\n ),\n);\n\n// Code surfaces are painted here rather than left to Tailwind Typography, whose\n// palette is pinned to light-mode values. The fill is the same `--muted` /\n// `--foreground` pair `styles.css` gives `.tw\\:prose blockquote` — the file's\n// idiom for an inset surface — so both follow the colour scheme and the brand.\n//\n// The colour has to be stated on `pre` and on inline `code` separately:\n// `[data-theme='dark'] .tw\\:prose` applies `prose-invert`, whose `code` rules are\n// `:where()`-wrapped, so these utilities win on specificity. Set only the fill\n// and dark mode pairs an inverted light text with it.\nconst proseClass =\n 'tw:prose tw:prose-sm tw:max-w-none tw:break-words tw:[&_pre]:bg-muted tw:[&_pre]:text-foreground tw:[&_:not(pre)>code]:bg-muted tw:[&_:not(pre)>code]:text-foreground tw:[&_:not(pre)>code]:rounded tw:[&_:not(pre)>code]:px-1 tw:[&_:not(pre)>code]:py-0.5 tw:[&_:not(pre)>code]:before:content-none tw:[&_:not(pre)>code]:after:content-none';\n\nconst getText = (node: ReactNode): string => {\n if (typeof node === 'string') return node;\n if (typeof node === 'number') return String(node);\n if (Array.isArray(node)) return node.map(getText).join('');\n if (\n isValidElement(node) &&\n typeof node.props === 'object' &&\n node.props !== null &&\n 'children' in node.props\n ) {\n return getText((node.props as { children: ReactNode }).children);\n }\n return '';\n};\n\nconst getLanguage = (element: ReactNode): string | undefined => {\n if (!isValidElement(element)) return undefined;\n const { props } = element;\n if (typeof props !== 'object' || props === null || !('className' in props)) return undefined;\n if (typeof props.className !== 'string') return undefined;\n return props.className.match(/language-(\\S+)/)?.[1];\n};\n\n/**\n * The plugins this renderer always runs.\n *\n * - GFM is part of its contract: tables route through the design `Table`, and autolinks and\n * task lists are what an assistant answer is written in.\n * - A caller's own plugins are appended to these, never substituted for them.\n */\nconst baseRemarkPlugins: NonNullable<Options['remarkPlugins']> = [remarkGfm];\n\n/**\n * Fence language → the renderer that draws it.\n *\n * - Both dialects are the agent's, not this package's: kai-agent's prompt tells the model to\n * write ```mermaid for structure and ```flint for quantitative data, so a chat that renders\n * one and not the other drops output the agent was instructed to produce.\n * - `flint-chart` is an alias — it is the fence tag flint's own docs use, so a model emits it\n * unprompted often enough to matter. `markdownComponents.tsx` in kbc-ui carries the same pair.\n * - Read through `Object.hasOwn`, never by plain index: a fence tagged ```constructor or\n * ```valueOf otherwise answers with an `Object.prototype` member, which is truthy, and mounting\n * it as a component throws — taking the whole message subtree down with it.\n */\nconst DIAGRAM_RENDERERS: Record<string, ComponentType<{ code: string }> | undefined> = {\n mermaid: MermaidDiagram,\n flint: FlintChart,\n 'flint-chart': FlintChart,\n};\n\n/**\n * The fence languages this renderer draws instead of printing.\n *\n * - For a caller that streams: a diagram mounts a lazily loaded chunk, so an answer arriving a\n * token at a time has to keep a fence that is still open an ordinary code block, or every\n * keystroke fetches the chunk. Sharing the list is what keeps that hold-back from missing a\n * dialect this map has and the caller does not.\n * - Frozen, because it is that shared contract: a consumer that pushed onto it would change how\n * every other app in the same bundle holds a fence back.\n */\nexport const DIAGRAM_LANGUAGES: readonly string[] = Object.freeze(Object.keys(DIAGRAM_RENDERERS));\n\n// react-markdown passes a hast `node` to every component; strip it before\n// spreading the rest onto a DOM element.\nconst baseComponents: Components = {\n // Handle mermaid at the `pre` level: react-markdown renders fenced blocks as\n // `<pre><code class=\"language-…\">`, so a diagram (a block `<div>`) must replace\n // the whole `<pre>` — returning it from the `code` override would nest a block\n // element inside `<pre><code>` (invalid HTML).\n pre({ children, ...props }: ComponentPropsWithoutRef<'pre'> & ExtraProps) {\n const child = Array.isArray(children) ? children[0] : children;\n const code = getText(child).replace(/\\n$/, '');\n const language = getLanguage(child);\n const Diagram =\n language !== undefined && Object.hasOwn(DIAGRAM_RENDERERS, language)\n ? DIAGRAM_RENDERERS[language]\n : undefined;\n if (Diagram) {\n if (!code.trim()) return null;\n return (\n <Suspense fallback={<DiagramSkeleton />}>\n <Diagram code={code} />\n </Suspense>\n );\n }\n const { node: _node, ...rest } = props;\n // Wrap so the copy button can reveal on hover/focus, anchored to the block.\n return (\n <div className=\"tw:group tw:relative\">\n <span className=\"tw:absolute tw:right-2 tw:top-2 tw:opacity-0 tw:transition-opacity tw:group-focus-within:opacity-100 tw:group-hover:opacity-100\">\n <ClipboardButton text={code} tooltip=\"Copy\" size=\"icon-xs\" variant=\"outline\" />\n </span>\n <pre {...rest}>{children}</pre>\n </div>\n );\n },\n // Open absolute http(s) links in a new tab with a safe `rel`; leave relative\n // and anchor links to default in-page navigation.\n a({ children, href, ...props }: ComponentPropsWithoutRef<'a'> & ExtraProps) {\n const { node: _node, ...rest } = props;\n const isExternal = !!href && /^https?:\\/\\//.test(href);\n return (\n <a\n href={href}\n {...(isExternal ? { target: '_blank', rel: 'noopener noreferrer' } : null)}\n {...rest}\n >\n {children}\n </a>\n );\n },\n // Route GFM tables through the design `Table` so they match the rest of the\n // system; `tw:not-prose` opts the table out of prose typography overrides.\n table({ className, ...props }: ComponentPropsWithoutRef<'table'> & ExtraProps) {\n const { node: _node, ...rest } = props;\n return (\n <div className=\"tw:not-prose tw:my-4\">\n <Table bordered className={cn('tw:!mb-0', className)} {...rest} />\n </div>\n );\n },\n thead(props: ComponentPropsWithoutRef<'thead'> & ExtraProps) {\n const { node: _node, ...rest } = props;\n return <Table.Header {...rest} />;\n },\n tbody(props: ComponentPropsWithoutRef<'tbody'> & ExtraProps) {\n const { node: _node, ...rest } = props;\n return <Table.Body {...rest} />;\n },\n tr(props: ComponentPropsWithoutRef<'tr'> & ExtraProps) {\n const { node: _node, ...rest } = props;\n return <Table.Row {...rest} />;\n },\n th(props: ComponentPropsWithoutRef<'th'> & ExtraProps) {\n const { node: _node, ...rest } = props;\n return <Table.Head {...rest} />;\n },\n td(props: ComponentPropsWithoutRef<'td'> & ExtraProps) {\n const { node: _node, ...rest } = props;\n return <Table.Cell {...rest} />;\n },\n};\n\ntype Props = {\n /** Markdown source (GFM: tables, task lists, strikethrough, autolinks). Tables\n * render through the design `Table`; fenced ```mermaid and ```flint blocks render\n * as diagrams; every other fenced block gets a hover copy button. */\n children: string;\n className?: string;\n /**\n * Remark plugins run after the built-in GFM one.\n *\n * - Appended to the built-ins, so GFM keeps working whatever a caller adds.\n * - The seam for an app's own inline syntax — an annotation the agent emits alongside a\n * link, say — which is app product knowledge and does not belong in this package.\n * - Hold it in a module constant. react-markdown re-parses on every render, so this\n * component is meant to be memoised by its caller, and a literal built during render\n * defeats that.\n */\n remarkPlugins?: NonNullable<Options['remarkPlugins']>;\n /**\n * Element renderers layered over the built-in ones.\n *\n * - Merged by key, and an override **replaces** that element's renderer rather than\n * wrapping it: a `table` override loses the design `Table`, an `a` override loses the\n * new-tab treatment for absolute links. Restate what you still want.\n * - Hold it in a module constant, for the same reason as `remarkPlugins`.\n */\n components?: Components;\n};\n\n/**\n * Read-only GFM Markdown renderer with design-token typography. Pair with\n * `MessageBubble` to render an assistant message body. Code blocks expose a\n * copy button, so mount a `TooltipProvider` once at the app root.\n */\nexport const Markdown = ({\n children,\n className,\n remarkPlugins,\n components: componentOverrides,\n}: Props) => {\n return (\n <div data-prose className={cn(proseClass, className)}>\n <ReactMarkdown\n remarkPlugins={\n remarkPlugins === undefined ? baseRemarkPlugins : [...baseRemarkPlugins, ...remarkPlugins]\n }\n components={\n componentOverrides === undefined\n ? baseComponents\n : { ...baseComponents, ...componentOverrides }\n }\n >\n {children}\n </ReactMarkdown>\n </div>\n );\n};\n","import type { ComponentProps, PropsWithChildren, ReactNode } from 'react';\nimport { cva } from 'class-variance-authority';\n\nimport type { Avatar } from '../../components/Avatar';\n\n// No per-message avatar. In a narrow panel a 30px portrait beside every turn\n// spends width on identity the reader already has — there are two participants\n// — and pushes the bubble into an L-shape beside it. Alignment carries the turn.\nconst containerClasses = cva(['tw:flex', 'tw:max-w-full', 'tw:gap-3'], {\n variants: {\n variant: {\n user: ['tw:justify-end'],\n assistant: ['tw:justify-start', 'tw:w-full'],\n },\n },\n defaultVariants: {\n variant: 'assistant',\n },\n});\n\nconst stackClasses = cva(['tw:flex', 'tw:min-w-0', 'tw:flex-1', 'tw:flex-col', 'tw:gap-2'], {\n variants: {\n variant: {\n user: ['tw:items-end'],\n assistant: [],\n },\n },\n defaultVariants: {\n variant: 'assistant',\n },\n});\n\nconst contentClasses = cva(\n [\n 'tw:flex',\n 'tw:flex-col',\n // Prose supplies its own rhythm between blocks, so a large gap here stacks\n // on top of it and reads as slack rather than structure.\n 'tw:gap-3',\n 'tw:break-words',\n 'tw:leading-relaxed',\n 'tw:text-foreground',\n // Hooks on `data-prose`, not the `tw:prose` class — Tailwind scans raw file\n // bytes, so a `\\:` escape in a TS string reaches the generator doubled.\n 'tw:[&_[data-prose]]:text-foreground',\n ],\n {\n variants: {\n variant: {\n assistant: ['tw:flex-1', 'tw:w-full', 'tw:min-w-0', 'tw:[&>*]:min-w-0'],\n user: [\n // The cap is a share of the column, not a fixed width: it is what\n // leaves a gutter on the left, and that gutter is the whole reason\n // the bubble reads as one side of a conversation. A fixed 640px\n // never engages in a docked panel, and a left margin cannot stand in\n // for it — `w-fit` sizes to the space it has before the margin\n // applies, so the margin pushes the bubble past the column instead\n // of insetting it. The absolute term stops a fullscreen panel from\n // running a line of someone's own words 700px wide.\n 'tw:max-w-[min(85%,40rem)]',\n 'tw:w-fit',\n 'tw:bg-muted',\n // Tighter vertically than horizontally: a short message padded evenly\n // on all four sides reads as a block, not as something someone said.\n // The radius comes down with it — a 16px corner on a one-line bubble\n // is most of its height.\n 'tw:px-3',\n 'tw:py-2',\n 'tw:rounded-xl',\n 'tw:overflow-hidden',\n 'tw:break-anywhere',\n ],\n },\n },\n\n defaultVariants: {\n variant: 'assistant',\n },\n },\n);\n\ntype Props = {\n variant: 'user' | 'assistant';\n actions?: ReactNode;\n createdAt?: string;\n /** @deprecated No avatar is rendered; accepted so existing call sites keep compiling. */\n user?: ComponentProps<typeof Avatar>['user'];\n} & PropsWithChildren;\n\nexport const MessageBubble = ({ variant, children, actions, createdAt }: Props) => {\n return (\n <div className={containerClasses({ variant })} data-testid={`chat-message-${variant}`}>\n <div className={stackClasses({ variant })}>\n {/* The timestamp is reachable on the user's own bubble — where the avatar\n that used to carry it sat. Deliberately not on the assistant's: a\n native tooltip fires from anywhere in the body after a hover pause,\n and an answer's body is full of tables and code it would cover. */}\n <div\n className={contentClasses({ variant })}\n title={variant === 'user' ? createdAt : undefined}\n >\n {children}\n </div>\n {actions}\n </div>\n </div>\n );\n};\n","import { type FormEvent, type KeyboardEvent, type ReactNode, useState } from 'react';\n\nimport { Badge } from '../../components/Badge';\nimport { Button } from '../../components/Button';\nimport {\n FullScreenModal,\n FullScreenModalBody,\n FullScreenModalHeader,\n} from '../../components/FullScreenModal';\nimport { Tooltip } from '../../components/Tooltip';\nimport { ChevronDown, Maximize2, Minimize2, Send, X } from '../../icons';\nimport { cn } from '../../utils';\nimport { Textarea } from '../Textarea';\n\nimport { CollapsibleBody } from './CollapsibleBody';\nimport { hasMotion } from './hasMotion';\n\ntype PlanApprovalStatus = 'pending' | 'approved' | 'dismissed' | 'changes-requested';\n\ntype PlanApprovalProps = {\n status: PlanApprovalStatus;\n title: string;\n summary?: ReactNode;\n stepCount?: number;\n planBody?: ReactNode;\n\n defaultExpanded?: boolean;\n isExpanded?: boolean;\n onExpandToggle?: (next: boolean) => void;\n\n onApprove?: () => void;\n onRequestChanges?: (reason: string) => void;\n onClose?: () => void;\n isSubmitting?: boolean;\n approveTooltip?: ReactNode;\n\n pendingPillLabel?: string;\n approvedPillLabel?: string;\n dismissedPillLabel?: string;\n changesRequestedPillLabel?: string;\n approveLabel?: string;\n requestChangesLabel?: string;\n cancelLabel?: string;\n showMoreLabel?: string;\n showLessLabel?: string;\n closeLabel?: string;\n fullScreenLabel?: string;\n exitFullScreenLabel?: string;\n changeRequestPlaceholder?: string;\n changeRequestSubmitLabel?: string;\n stepCountLabel?: (count: number) => string;\n\n className?: string;\n};\n\nconst defaultStepCountLabel = (count: number) => `${count} step${count === 1 ? '' : 's'}`;\n\nconst StatusPill = ({\n status,\n pendingLabel,\n approvedLabel,\n dismissedLabel,\n changesRequestedLabel,\n}: {\n status: PlanApprovalStatus;\n pendingLabel: string;\n approvedLabel: string;\n dismissedLabel: string;\n changesRequestedLabel: string;\n}) => {\n if (status === 'approved') {\n return (\n <Badge color=\"green\" variant=\"pill\" className=\"tw:normal-case tw:tracking-normal\">\n {approvedLabel}\n </Badge>\n );\n }\n if (status === 'dismissed') {\n return (\n <Badge color=\"gray\" variant=\"pill\" className=\"tw:normal-case tw:tracking-normal\">\n {dismissedLabel}\n </Badge>\n );\n }\n if (status === 'changes-requested') {\n return (\n <Badge color=\"blue\" variant=\"pill\" className=\"tw:normal-case tw:tracking-normal\">\n {changesRequestedLabel}\n </Badge>\n );\n }\n return (\n <Badge color=\"green\" variant=\"pill\" className=\"tw:normal-case tw:tracking-normal\">\n {pendingLabel}\n </Badge>\n );\n};\n\nconst ExpandToggle = ({\n isExpanded,\n onToggle,\n showMoreLabel,\n showLessLabel,\n}: {\n isExpanded: boolean;\n onToggle: () => void;\n showMoreLabel: string;\n showLessLabel: string;\n}) => (\n <button\n type=\"button\"\n onClick={onToggle}\n aria-expanded={isExpanded}\n className=\"tw:inline-flex tw:cursor-pointer tw:items-center tw:gap-1 tw:bg-transparent tw:p-0 tw:text-sm tw:font-medium tw:text-secondary-500 tw:hover:text-secondary-600 tw:focus-visible:outline tw:focus-visible:outline-2 tw:focus-visible:outline-offset-2 tw:focus-visible:outline-ring tailwindcss-preflight\"\n >\n <span>{isExpanded ? showLessLabel : showMoreLabel}</span>\n <ChevronDown\n className={cn('tw:size-5 tw:transition-transform', isExpanded && 'tw:rotate-180')}\n />\n </button>\n);\n\nconst ChangeRequestForm = ({\n value,\n onValueChange,\n onSubmit,\n onKeyDown,\n placeholder,\n submitLabel,\n formLabel,\n canSubmit,\n isSubmitting,\n}: {\n value: string;\n onValueChange: (value: string) => void;\n onSubmit: (event?: FormEvent) => void;\n onKeyDown: (event: KeyboardEvent<HTMLTextAreaElement>) => void;\n placeholder: string;\n submitLabel: string;\n formLabel: string;\n canSubmit: boolean;\n isSubmitting: boolean;\n}) => (\n <form\n onSubmit={onSubmit}\n className=\"tw:border-0 tw:border-t tw:border-solid tw:border-border tw:bg-card tw:text-card-foreground tw:px-4 tw:py-3\"\n aria-label={formLabel}\n >\n <div className=\"tw:relative\">\n <Textarea\n value={value}\n onValueChange={onValueChange}\n placeholder={placeholder}\n maxRows={4}\n autoFocus\n onKeyDown={onKeyDown}\n containerClassName=\"tw:pr-12\"\n disabled={isSubmitting}\n aria-label={placeholder}\n data-testid=\"plan-change-request-input\"\n />\n <Button\n type=\"submit\"\n variant=\"invisible\"\n size=\"icon-sm\"\n aria-label={submitLabel}\n disabled={!canSubmit}\n className=\"tw:absolute tw:right-2 tw:top-1/2 tw:-translate-y-1/2 tw:[&_svg]:text-secondary-500 tw:not-disabled:hover:[&_svg]:text-secondary-600\"\n data-testid=\"plan-change-request-submit\"\n >\n <Send className=\"tw:size-4\" />\n </Button>\n </div>\n </form>\n);\n\nconst PlanActions = ({\n isRequestingChanges,\n isSubmitting,\n onApprove,\n onRequestChanges,\n onOpenRequestChanges,\n onCancelChangeRequest,\n approveLabel,\n requestChangesLabel,\n cancelLabel,\n approveTooltip,\n}: {\n isRequestingChanges: boolean;\n isSubmitting: boolean;\n onApprove?: () => void;\n onRequestChanges?: (reason: string) => void;\n onOpenRequestChanges: () => void;\n onCancelChangeRequest: () => void;\n approveLabel: string;\n requestChangesLabel: string;\n cancelLabel: string;\n approveTooltip?: ReactNode;\n}) => (\n <div className=\"tw:flex tw:shrink-0 tw:items-center tw:gap-2\">\n {isRequestingChanges ? (\n <Button\n variant=\"outline\"\n size=\"small\"\n onClick={onCancelChangeRequest}\n disabled={isSubmitting}\n data-testid=\"plan-cancel-button\"\n className=\"tw:shrink-0 tw:whitespace-nowrap\"\n >\n {cancelLabel}\n </Button>\n ) : (\n onRequestChanges && (\n <Button\n variant=\"outline\"\n size=\"small\"\n onClick={onOpenRequestChanges}\n disabled={isSubmitting}\n data-testid=\"plan-request-changes-button\"\n className=\"tw:shrink-0 tw:whitespace-nowrap\"\n >\n {requestChangesLabel}\n </Button>\n )\n )}\n {onApprove &&\n (approveTooltip ? (\n <Tooltip tooltip={approveTooltip} placement=\"top\" triggerAsChild>\n <Button\n variant=\"primary\"\n size=\"small\"\n onClick={onApprove}\n disabled={isSubmitting || isRequestingChanges}\n data-testid=\"plan-approve-button\"\n className=\"tw:shrink-0 tw:whitespace-nowrap\"\n >\n {approveLabel}\n </Button>\n </Tooltip>\n ) : (\n <Button\n variant=\"primary\"\n size=\"small\"\n onClick={onApprove}\n disabled={isSubmitting || isRequestingChanges}\n data-testid=\"plan-approve-button\"\n className=\"tw:shrink-0 tw:whitespace-nowrap\"\n >\n {approveLabel}\n </Button>\n ))}\n </div>\n);\n\nexport const PlanApproval = ({\n status,\n title,\n summary,\n stepCount,\n planBody,\n\n defaultExpanded = false,\n isExpanded: isExpandedProp,\n onExpandToggle,\n\n onApprove,\n onRequestChanges,\n onClose,\n isSubmitting = false,\n approveTooltip,\n\n pendingPillLabel = 'Ready for approval',\n approvedPillLabel = 'Approved',\n dismissedPillLabel = 'Dismissed',\n changesRequestedPillLabel = 'Changes Requested',\n approveLabel = 'Approve',\n requestChangesLabel = 'Request Changes',\n cancelLabel = 'Cancel',\n showMoreLabel = 'Show more',\n showLessLabel = 'Show less',\n closeLabel = 'Dismiss plan',\n fullScreenLabel = 'View full screen',\n exitFullScreenLabel = 'Exit full screen',\n changeRequestPlaceholder = 'What would you like to change in the plan?',\n changeRequestSubmitLabel = 'Send change request',\n stepCountLabel = defaultStepCountLabel,\n\n className,\n}: PlanApprovalProps) => {\n const [uncontrolledExpanded, setUncontrolledExpanded] = useState(defaultExpanded);\n const isExpanded = isExpandedProp ?? uncontrolledExpanded;\n const [isRequestingChanges, setIsRequestingChanges] = useState(false);\n const [changeRequest, setChangeRequest] = useState('');\n const [isFullScreen, setIsFullScreen] = useState(false);\n\n const isPending = status === 'pending';\n const showActions = isPending && (onApprove || onRequestChanges);\n const showClose = isPending && Boolean(onClose);\n const canShowPlanBody = planBody != null;\n const trimmedChangeRequest = changeRequest.trim();\n const canSubmitChangeRequest = trimmedChangeRequest.length > 0 && !isSubmitting;\n\n const [isClosing, setIsClosing] = useState(false);\n\n const toggleExpanded = () => {\n const next = !isExpanded;\n if (!next) setIsClosing(hasMotion());\n if (isExpandedProp === undefined) {\n setUncontrolledExpanded(next);\n }\n onExpandToggle?.(next);\n };\n\n const handleOpenRequestChanges = () => {\n setIsRequestingChanges(true);\n if (!isExpanded) {\n toggleExpanded();\n }\n };\n\n const handleCancelChangeRequest = () => {\n setIsRequestingChanges(false);\n setChangeRequest('');\n };\n\n const handleSubmitChangeRequest = (event?: FormEvent) => {\n event?.preventDefault();\n if (!canSubmitChangeRequest) return;\n onRequestChanges?.(trimmedChangeRequest);\n };\n\n const handleTextareaKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n handleSubmitChangeRequest();\n }\n };\n\n const showChangeRequestForm = isRequestingChanges && isPending;\n\n const changeRequestForm = (\n <ChangeRequestForm\n value={changeRequest}\n onValueChange={setChangeRequest}\n onSubmit={handleSubmitChangeRequest}\n onKeyDown={handleTextareaKeyDown}\n placeholder={changeRequestPlaceholder}\n submitLabel={changeRequestSubmitLabel}\n formLabel={requestChangesLabel}\n canSubmit={canSubmitChangeRequest}\n isSubmitting={isSubmitting}\n />\n );\n\n const planActions = (\n <PlanActions\n isRequestingChanges={isRequestingChanges}\n isSubmitting={isSubmitting}\n onApprove={onApprove}\n onRequestChanges={onRequestChanges}\n onOpenRequestChanges={handleOpenRequestChanges}\n onCancelChangeRequest={handleCancelChangeRequest}\n approveLabel={approveLabel}\n requestChangesLabel={requestChangesLabel}\n cancelLabel={cancelLabel}\n approveTooltip={approveTooltip}\n />\n );\n\n return (\n <>\n {/* Two surface tiers, each painting its own ink.\n\n - The shell is `background`, carrying the header and the summary directly.\n - Plan body, change-request form and action bar lift off it on `card`.\n - Whether the shell reads as a recessed tray is the host's call, not this\n component's: against a white page it does, but kbc-ui paints the Kai\n panel `background` too, so there the 1px border alone delimits the card.\n - Each tier pins a foreground beside its background. One that sets only a\n background inherits ink from whatever rendered it, and reads same-on-same\n in one of the schemes. */}\n <section\n aria-label={title}\n className={cn(\n 'tw:flex tw:w-full tw:max-w-[800px] tw:flex-col tw:overflow-hidden tw:rounded-xl tw:border tw:border-solid tw:border-border tw:bg-background tw:text-foreground',\n className,\n )}\n data-testid=\"plan-approval-root\"\n data-plan-status={status}\n >\n <div className=\"tw:flex tw:items-start tw:gap-2 tw:pl-4 tw:pr-2 tw:pt-4\">\n <div className=\"tw:flex tw:min-w-0 tw:flex-1 tw:flex-col tw:gap-2 tw:pb-4\">\n <div className=\"tw:flex tw:items-center tw:gap-3\">\n <StatusPill\n status={status}\n pendingLabel={pendingPillLabel}\n approvedLabel={approvedPillLabel}\n dismissedLabel={dismissedPillLabel}\n changesRequestedLabel={changesRequestedPillLabel}\n />\n {/* 12px on `muted-foreground` — knowingly at the AA floor.\n\n - 4.55:1 against the shell's `background` in light; AA asks 4.5:1.\n - `muted-foreground` is the ink for secondary metadata, so darker\n ink here would break the hierarchy to buy the margin.\n - Headroom is a token question, not a call-site one. The ratio is\n pinned in `tokenBlocks.test.ts`, so a nudge to\n `--muted-foreground` fails there rather than passing silently. */}\n {stepCount != null && stepCount > 0 && (\n <span className=\"tw:text-xs tw:leading-4 tw:text-muted-foreground\">\n {stepCountLabel(stepCount)}\n </span>\n )}\n </div>\n <p className=\"tw:m-0 tw:text-base tw:font-semibold tw:leading-6\">{title}</p>\n </div>\n <div className=\"tw:flex tw:items-center tw:gap-2\">\n {canShowPlanBody && !isFullScreen && (\n <Tooltip tooltip={fullScreenLabel} placement=\"top\" triggerAsChild>\n <Button\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label={fullScreenLabel}\n onClick={() => setIsFullScreen(true)}\n data-testid=\"plan-fullscreen-button\"\n >\n <Maximize2 className=\"tw:size-4\" />\n </Button>\n </Tooltip>\n )}\n {showClose && !isFullScreen && (\n <Button\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label={closeLabel}\n onClick={onClose}\n disabled={isSubmitting}\n data-testid=\"plan-close-button\"\n >\n <X className=\"tw:size-4\" />\n </Button>\n )}\n </div>\n </div>\n\n {summary != null && (\n <div\n className={cn(\n 'tw:whitespace-pre-wrap tw:border-0 tw:border-t tw:border-solid tw:border-border tw:px-4 tw:pt-4 tw:text-sm',\n isExpanded && canShowPlanBody ? 'tw:pb-4' : 'tw:pb-2',\n )}\n >\n {summary}\n </div>\n )}\n\n {canShowPlanBody && (\n <CollapsibleBody\n isExpanded={isExpanded}\n isClosing={isClosing}\n onClosed={() => setIsClosing(false)}\n >\n <div className=\"tw:max-h-[400px] tw:overflow-y-auto tw:border-0 tw:border-t tw:border-solid tw:border-border tw:bg-card tw:p-4 tw:text-sm tw:text-card-foreground\">\n {planBody}\n </div>\n </CollapsibleBody>\n )}\n\n {!isFullScreen && (\n <>\n {showChangeRequestForm && changeRequestForm}\n\n <div\n className={cn(\n 'tw:flex tw:items-center tw:gap-2 tw:overflow-x-auto tw:border-0 tw:border-t tw:border-solid tw:border-border tw:bg-card tw:px-4 tw:py-3 tw:text-card-foreground',\n canShowPlanBody ? 'tw:justify-between' : 'tw:justify-end',\n )}\n >\n {canShowPlanBody && (\n <div className=\"tw:shrink-0\">\n <ExpandToggle\n isExpanded={isExpanded}\n onToggle={toggleExpanded}\n showMoreLabel={showMoreLabel}\n showLessLabel={showLessLabel}\n />\n </div>\n )}\n\n {showActions && planActions}\n </div>\n </>\n )}\n </section>\n\n {canShowPlanBody && isFullScreen && (\n <FullScreenModal onEscapeKeyDown={() => setIsFullScreen(false)}>\n <FullScreenModalHeader\n title={\n <div className=\"tw:flex tw:min-w-0 tw:items-center tw:gap-3\">\n <StatusPill\n status={status}\n pendingLabel={pendingPillLabel}\n approvedLabel={approvedPillLabel}\n dismissedLabel={dismissedPillLabel}\n changesRequestedLabel={changesRequestedPillLabel}\n />\n <span className=\"tw:truncate\">{title}</span>\n </div>\n }\n onClose={() => setIsFullScreen(false)}\n showPreviousTitle={false}\n >\n <div className=\"tw:flex tw:items-center tw:gap-2\">\n {showClose && (\n <Tooltip tooltip={closeLabel} placement=\"bottom\" triggerAsChild>\n <Button\n variant=\"outline\"\n size=\"icon\"\n aria-label={closeLabel}\n onClick={onClose}\n disabled={isSubmitting}\n data-testid=\"plan-close-button\"\n >\n <X className=\"tw:size-4\" />\n </Button>\n </Tooltip>\n )}\n <Tooltip tooltip={exitFullScreenLabel} placement=\"bottom\" triggerAsChild>\n <Button\n variant=\"outline\"\n size=\"icon\"\n aria-label={exitFullScreenLabel}\n onClick={() => setIsFullScreen(false)}\n data-testid=\"plan-exit-fullscreen-button\"\n >\n <Minimize2 className=\"tw:size-4\" />\n </Button>\n </Tooltip>\n </div>\n </FullScreenModalHeader>\n {/* The modal is portalled to `document.body`, so it inherits nothing\n from the card above — body and footer each pin their own surface\n and ink, on top of the frame's own `background`/`foreground`. */}\n <FullScreenModalBody className=\"tw:bg-card tw:px-6 tw:py-4 tw:text-card-foreground\">\n <div className=\"tw:mx-auto tw:w-full tw:max-w-[800px] tw:text-sm\">{planBody}</div>\n </FullScreenModalBody>\n {(showChangeRequestForm || showActions) && (\n <div className=\"tw:shrink-0 tw:border-0 tw:border-t tw:border-solid tw:border-border tw:bg-card tw:text-card-foreground\">\n <div className=\"tw:mx-auto tw:w-full tw:max-w-[800px]\">\n {showChangeRequestForm && changeRequestForm}\n {showActions && (\n <div className=\"tw:flex tw:justify-end tw:px-4 tw:py-3\">{planActions}</div>\n )}\n </div>\n </div>\n )}\n </FullScreenModal>\n )}\n </>\n );\n};\n\nexport type { PlanApprovalStatus, PlanApprovalProps };\n","import { Loader2 } from '../../icons';\n\ntype PlanRewritingIndicatorProps = {\n label?: string;\n};\n\nexport const PlanRewritingIndicator = ({\n label = 'Rewriting the plan...',\n}: PlanRewritingIndicatorProps) => (\n <div\n className=\"tw:flex tw:items-center tw:gap-2\"\n role=\"status\"\n data-testid=\"plan-rewriting-indicator\"\n >\n <Loader2 className=\"tw:size-4 tw:animate-spin tw:text-secondary-500\" />\n <span className=\"tw:text-sm tw:italic tw:text-secondary-500\">{label}</span>\n </div>\n);\n\nexport type { PlanRewritingIndicatorProps };\n","import type { ComponentProps, MouseEventHandler } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\ntype Props = ComponentProps<'button'>;\n\nexport const PromptInputAction = ({ ref, onMouseDown, ...rest }: Props) => {\n const handleOnMouseDown: MouseEventHandler<HTMLButtonElement> = (event) => {\n // Prevents focus stealing by PromptInput.\n event.stopPropagation();\n onMouseDown?.(event);\n };\n\n return <Slot {...rest} ref={ref} onMouseDown={handleOnMouseDown}></Slot>;\n};\n","import type { ReactNode } from 'react';\n\nimport { Truncated } from '../../components/Truncated';\nimport { cn } from '../../utils';\nimport { Command } from '../Command';\n\nexport type PromptCommand = {\n label: string;\n value: string;\n description?: string;\n icon?: ReactNode;\n group: string;\n};\n\ntype Props = {\n items: PromptCommand[];\n open: boolean;\n onSelect: (value: string) => void;\n filterValue: string;\n children: ReactNode;\n};\n\nexport const PromptInputCommands = ({ items, open, onSelect, filterValue, children }: Props) => {\n const filtered = filterValue\n ? items.filter(\n (item) =>\n item.label.toLowerCase().includes(filterValue.toLowerCase()) ||\n item.value.toLowerCase().includes(filterValue.toLowerCase()),\n )\n : items;\n\n const groups = filtered.reduce<Record<string, PromptCommand[]>>((acc, item) => {\n const group = acc[item.group] ?? [];\n group.push(item);\n acc[item.group] = group;\n return acc;\n }, {});\n\n return (\n <Command loop className=\"tw:relative\" shouldFilter={false}>\n {open && (\n <div\n className={cn(\n 'tw:absolute tw:bottom-full tw:left-0 tw:right-0 tw:z-50 tw:mb-1',\n 'tw:rounded-md tw:border tw:border-border tw:bg-popover tw:text-popover-foreground tw:shadow-lg',\n )}\n >\n {filtered.length === 0 ? (\n <div className=\"tw:px-4 tw:py-3 tw:text-center tw:text-sm tw:text-muted-foreground\">\n No commands found\n </div>\n ) : (\n <Command.List viewPortClassName=\"tw:max-h-80\">\n {Object.entries(groups).map(([groupName, groupItems]) => (\n <Command.Group key={groupName} heading={groupName}>\n {groupItems.map((item) => (\n <Command.Item\n key={item.value}\n value={item.value}\n icon={item.icon}\n onSelect={() => onSelect(item.value)}\n >\n <div className=\"tw:flex tw:min-w-0 tw:flex-1 tw:flex-col\">\n <span>{item.label}</span>\n {item.description && (\n <Truncated\n text={item.description}\n twoLines\n className=\"tw:text-xs tw:text-muted-foreground\"\n />\n )}\n </div>\n </Command.Item>\n ))}\n </Command.Group>\n ))}\n </Command.List>\n )}\n </div>\n )}\n\n {children}\n </Command>\n );\n};\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { Button } from '../../components/Button';\nimport { Tooltip } from '../../components/Tooltip';\nimport { CirclePause, Play, Send } from '../../icons';\nimport { cn } from '../../utils';\n\nimport { PromptInputAction } from './PromptInputAction';\n\ntype SubmitStatus = 'submitted' | 'ready' | 'streaming' | 'interrupted';\n\ntype Props = Pick<ComponentProps<typeof Button>, 'disabled' | 'ref'> & {\n status?: SubmitStatus;\n};\n\n// Icon-only button: the tooltip is visual only, so the accessible name must be\n// set separately per status to match what the button actually does (see\n// PromptInput's handleSubmit: ready->onSend, streaming->onAbort, interrupted->onContinue).\nconst ARIA_LABEL_BY_STATUS: Record<SubmitStatus, string> = {\n ready: 'Send message',\n streaming: 'Stop',\n interrupted: 'Continue',\n submitted: 'Sending…',\n};\n\nexport const PromptInputSubmit = ({ ref, disabled, status = 'ready' }: Props) => {\n const icon: ReactNode = (() => {\n if (status === 'streaming') return <CirclePause className=\"tw:size-4\" />;\n if (status === 'interrupted') return <Play className=\"tw:size-4\" />;\n // Optical centring. The paper plane's ink sits up and to the right of the\n // glyph box — its centroid measures ~1.2px right and ~1.3px high at 16px —\n // so a box-centred Send reads as off-centre inside a circle. The nudge pulls\n // the mass back toward the middle; the symmetric pause/play icons need none.\n return <Send className=\"tw:size-4 tw:translate-x-[-1px] tw:translate-y-[1px]\" />;\n })();\n\n const getTooltipText = () => {\n if (status === 'streaming') return 'Stop';\n if (status === 'interrupted') return 'Continue';\n return undefined;\n };\n\n return (\n <Tooltip.Root>\n <Tooltip.Trigger asChild>\n <PromptInputAction>\n <Button\n ref={ref}\n type=\"submit\"\n disabled={disabled}\n aria-label={ARIA_LABEL_BY_STATUS[status]}\n size=\"icon-sm\"\n // The only filled control in the composer, so the one button that\n // submits stays distinct from the several beside it that do not.\n //\n // - Fill is Kai's gradient (`aigradient-600`) — the same sweep the\n // field's focus border paints, so focus and send read as one family.\n // - `variant=\"primary\"` still supplies the white foreground, focus ring\n // and disabled semantics; the gradient covers its background colour.\n // - Disabled until there is content, so the composer shows ready-or-not\n // without needing a label.\n variant=\"primary\"\n isLoading={status === 'submitted'}\n className={cn(\n 'tw:ml-auto tw:flex tw:items-center tw:rounded-full',\n 'tw:bg-gradient-to-br tw:from-[#61E4FF] tw:via-[#1F8FFF] tw:to-[#7C5CFF]',\n 'tw:hover:not-disabled:brightness-110',\n )}\n >\n {/* Suppress the child icon while isLoading — Button already renders\n the spinner; rendering both would double-stack glyphs. */}\n {status !== 'submitted' && icon}\n </Button>\n </PromptInputAction>\n </Tooltip.Trigger>\n\n {getTooltipText() && (\n <Tooltip.Content placement=\"top\" variant=\"action\">\n {getTooltipText()}\n </Tooltip.Content>\n )}\n </Tooltip.Root>\n );\n};\n","import {\n type ChangeEventHandler,\n type ComponentProps,\n type ComponentRef,\n type FormEventHandler,\n type KeyboardEvent,\n type KeyboardEventHandler,\n type MouseEventHandler,\n type ReactNode,\n type RefObject,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport TextareaAutosize from 'react-textarea-autosize';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cva } from 'class-variance-authority';\n\nimport { TooltipProvider } from '../../components/Tooltip';\nimport { cn } from '../../utils';\n\nimport { PromptInputAction } from './PromptInputAction';\nimport type { PromptCommand } from './PromptInputCommands';\nimport { PromptInputCommands } from './PromptInputCommands';\nimport { PromptInputSubmit } from './PromptInputSubmit';\n\nconst CMDK_HIJACKED_KEYS = new Set(['ArrowUp', 'ArrowDown', 'Home', 'End', 'Enter']);\n\n// Whether cmdk would actually act on this keystroke, and so whether the guard\n// below still needs to hide it from the Command root.\n//\n// cmdk acts on every key in CMDK_HIJACKED_KEYS, modified or not — the arrows\n// branch on metaKey (jump to first/last) and altKey (jump to the adjacent\n// group), and Home/End preventDefault unconditionally. `Enter` is the sole\n// exception: its branch reads no modifier at all, so a modified Enter is the\n// only keystroke the Command root would ignore.\nconst isCmdkNavigation = (event: KeyboardEvent<HTMLTextAreaElement>) =>\n event.key !== 'Enter' || !(event.metaKey || event.ctrlKey || event.altKey);\n\nconst promptInputVariants = cva(\n [\n 'tailwindcss-preflight',\n 'tw:relative',\n\n 'tw:flex',\n 'tw:gap-2',\n 'tw:justify-center',\n\n // Kai's gradient edge, always on: the composer is the one place the reader\n // addresses Kai, and the gradient is what marks it as Kai's rather than the\n // page's. Drawn by filling the interior over a gradient background so only\n // the 2px edge shows through — `bg-origin-border` puts the gradient under\n // the border box, and the inset shadow paints the card back over everything\n // inside it.\n 'tw:border',\n 'tw:border-2',\n 'tw:border-transparent',\n 'tw:rounded-[14px]',\n 'tw:bg-gradient-to-bl',\n 'tw:from-[#61E4FF]',\n 'tw:via-[#1F8FFF]',\n 'tw:to-[#7C5CFF]',\n 'tw:bg-origin-border',\n 'tw:shadow-[inset_0_100vw_rgb(var(--card))]',\n\n // Focus adds the ring alone. The edge is already the loudest thing the\n // control can be, so focus cannot say it louder — it says it wider, and the\n // border width never changes, so nothing shifts.\n 'tw:has-[textarea:focus]:ring-4',\n 'tw:has-[textarea:focus]:ring-ring/30',\n\n 'tw:cursor-text',\n 'tw:px-2',\n ],\n {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n default: ['tw:flex-col', 'tw:pt-3', 'tw:pb-2'],\n inline: ['tw:flex-row', 'tw:py-3', 'tw:items-center'],\n },\n },\n },\n);\n\nconst wrapperVariants = cva(null, {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n default: 'tw:rounded-[14px]',\n inline: '',\n },\n },\n});\n\ntype Props = {\n /** The textarea, for a host that has to put the caret back. Not `ref`: that name is the textarea's own. */\n textareaRef?: RefObject<ComponentRef<'textarea'> | null>;\n onSend?: (value: string) => void;\n onAbort?: () => void;\n onContinue?: () => void;\n value?: string;\n onValueChange?: (value: string) => void;\n defaultValue?: string;\n prefix?: ReactNode;\n suffix?: ReactNode;\n variant?: 'default' | 'inline';\n disableSubmit?: boolean;\n commands?: PromptCommand[];\n} & VariantProps<typeof promptInputVariants> &\n Pick<\n ComponentProps<typeof TextareaAutosize>,\n 'placeholder' | 'minRows' | 'maxRows' | 'disabled' | 'defaultValue' | 'autoFocus'\n > &\n ComponentProps<typeof PromptInputSubmit>;\n\nexport const PromptInput = ({\n onSend,\n onAbort,\n onContinue,\n prefix,\n variant,\n suffix,\n disabled,\n disableSubmit,\n value = '',\n onValueChange,\n status = 'ready',\n maxRows = 6,\n minRows,\n commands,\n autoFocus,\n textareaRef: publishedRef,\n ...textareaProps\n}: Props) => {\n const defaultMinRows = variant === 'inline' ? 1 : 2;\n const isDisabled =\n (disabled || disableSubmit || !value.trim()) &&\n status !== 'streaming' &&\n status !== 'interrupted';\n\n const textareaId = useId();\n const textareaRef = useRef<ComponentRef<'textarea'>>(null);\n\n // From the ref callback, not an effect: a host restructure recreates the element while this stays mounted.\n const setTextareaNode = useCallback(\n (node: ComponentRef<'textarea'> | null) => {\n textareaRef.current = node;\n if (publishedRef) publishedRef.current = node;\n },\n [publishedRef],\n );\n const [dismissedValue, setDismissedValue] = useState<string | null>(null);\n\n // `autoFocus` is applied imperatively, never as the DOM attribute.\n // - The attribute focuses with ancestor scrolling: the browser scrolls every\n // scrollable ancestor to reveal the element.\n // - A composer can mount inside a panel that is still sliding in (kbc-ui's Kai\n // rail); scrolling toward its off-canvas box drags the whole page sideways.\n // - `preventScroll` grants the focus without the scroll. Mount-only, matching\n // the attribute's semantics.\n const autoFocusRef = useRef(autoFocus);\n useEffect(() => {\n if (autoFocusRef.current) textareaRef.current?.focus({ preventScroll: true });\n }, []);\n\n // Esc dismisses the menu for the value at that moment; once the value moves away\n // from it, clear the dismissal so the menu can reopen if it re-matches the slash\n // shape. Done during render rather than in an effect, and keyed off\n // `dismissedValue` so state only updates while a dismissal is active — no extra\n // render per keystroke.\n if (dismissedValue !== null && value !== dismissedValue) setDismissedValue(null);\n\n const hasCommands = !!commands && commands.length > 0;\n const valueLooksLikeSlashCommand = value.startsWith('/') && !/\\s/.test(value);\n const commandsOpen = hasCommands && valueLooksLikeSlashCommand && value !== dismissedValue;\n const slashFilter = commandsOpen ? value.slice(1) : '';\n\n const handleSubmit = () => {\n if (isDisabled) return;\n if (status === 'streaming') onAbort?.();\n if (status === 'interrupted') onContinue?.();\n if (status === 'ready') onSend?.(value);\n };\n\n const handleOnSubmit: FormEventHandler<HTMLFormElement> = (event) => {\n event.preventDefault();\n handleSubmit();\n };\n\n const handleOnChange: ChangeEventHandler<HTMLTextAreaElement> = (event) => {\n onValueChange?.(event.target.value);\n };\n\n const handleCommandSelect = (commandValue: string) => {\n onValueChange?.(commandValue + ' ');\n textareaRef.current?.focus();\n };\n\n const handleOnKeyDown: KeyboardEventHandler<HTMLTextAreaElement> = (event) => {\n if (commandsOpen) {\n if (event.key === 'Escape') {\n event.preventDefault();\n setDismissedValue(value);\n return;\n }\n // Don't preventDefault — let cmdk handle ArrowUp/Down/Enter via bubbling\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown' || event.key === 'Enter') {\n return;\n }\n } else if (hasCommands && CMDK_HIJACKED_KEYS.has(event.key) && isCmdkNavigation(event)) {\n // Keep these from bubbling to the always-mounted cmdk Command root, whose\n // keydown handler preventDefaults them and breaks multiline editing.\n // Keystrokes cmdk ignores (e.g. Cmd+Enter, Alt+Enter) must still reach\n // document-level app hotkeys, so they are deliberately not stopped here.\n event.stopPropagation();\n }\n\n if (event.key === 'Enter' && !event.shiftKey && !event.ctrlKey && !event.metaKey) {\n event.preventDefault();\n if (status !== 'streaming') handleSubmit();\n }\n };\n\n const handleOnMouseDown: MouseEventHandler<HTMLFormElement> = (event) => {\n // don't prevent default if the target is the textarea itself\n if (event.target === textareaRef.current) return;\n\n event.preventDefault();\n textareaRef.current?.focus();\n };\n\n const formEl = (\n <div className={wrapperVariants({ variant })}>\n {/*This is alright, just refocused into a textarea. */}\n {/* oxlint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n <form\n data-testid=\"prompt-input\"\n data-status={status}\n onMouseDown={handleOnMouseDown}\n onSubmit={handleOnSubmit}\n className={cn(\n promptInputVariants({ variant }),\n disabled &&\n 'tw:bg-none tw:border-border tw:shadow-[inset_0_100vw_rgb(var(--muted))] tw:cursor-default',\n )}\n >\n {prefix && <div className=\"tw:flex tw:items-center\">{prefix}</div>}\n\n <label htmlFor={textareaId} className=\"tw:sr-only\">\n Prompt Input\n </label>\n <TextareaAutosize\n {...textareaProps}\n disabled={disabled}\n minRows={minRows ?? defaultMinRows}\n maxRows={maxRows}\n id={textareaId}\n ref={setTextareaNode}\n value={value}\n onChange={handleOnChange}\n onKeyDown={handleOnKeyDown}\n className={cn(\n 'tw:resize-none',\n 'tw:outline-hidden',\n 'tw:w-full',\n 'tw:px-2',\n 'tw:bg-transparent',\n\n // font\n disabled ? 'tw:text-muted-foreground' : 'tw:text-foreground',\n 'tw:text-sm',\n 'tw:font-sans',\n\n 'tw:transition-[width]',\n 'tw:delay-75',\n 'tw:ease-linear',\n 'tw:overflow-auto',\n )}\n />\n\n <div\n className={cn(\n 'tw:flex tw:items-center tw:gap-4',\n variant === 'inline' ? 'tw:items-end' : 'tw:items-center',\n )}\n >\n {suffix}\n <PromptInputSubmit disabled={isDisabled} status={status} />\n </div>\n </form>\n </div>\n );\n\n return (\n <TooltipProvider>\n {hasCommands ? (\n <PromptInputCommands\n items={commands ?? []}\n open={commandsOpen}\n onSelect={handleCommandSelect}\n filterValue={slashFilter}\n >\n {formEl}\n </PromptInputCommands>\n ) : (\n formEl\n )}\n </TooltipProvider>\n );\n};\n\nPromptInput.Action = PromptInputAction;\n","import { type KeyboardEvent, type ReactNode, useState } from 'react';\n\nimport { Button } from '../../components/Button';\nimport { Checkbox } from '../../components/Checkbox';\nimport { Progress } from '../../components/Progress';\nimport { Tooltip } from '../../components/Tooltip';\nimport { ChevronLeft, ChevronRight, X } from '../../icons';\nimport { cn } from '../../utils';\nimport { TextInput } from '../TextInput';\n\ntype QuestionOption = {\n id: string;\n label: string;\n description?: string;\n preview?: string;\n};\n\ntype Props = {\n question: string;\n header?: string;\n options: readonly QuestionOption[];\n multiSelect?: boolean;\n selectedOptionIds?: readonly string[];\n onSelectionChange?: (selectedIds: readonly string[]) => void;\n customAnswer?: string;\n onCustomAnswerChange?: (value: string) => void;\n onCustomAnswerConfirm?: () => void;\n showCustomAnswer?: boolean;\n customAnswerPlaceholder?: string;\n showSkip?: boolean;\n onSkip?: () => void;\n onClose?: () => void;\n onNext?: () => void;\n submitTooltip?: ReactNode;\n onPrevious?: () => void;\n currentStep?: number;\n totalSteps?: number;\n renderPreview?: (content: string) => ReactNode;\n className?: string;\n};\n\nconst handleKeyDown = (callback: () => void) => (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n callback();\n }\n};\n\nexport const Question = ({\n question,\n header,\n options,\n multiSelect = true,\n selectedOptionIds = [],\n onSelectionChange,\n customAnswer = '',\n onCustomAnswerChange,\n onCustomAnswerConfirm,\n showCustomAnswer = true,\n customAnswerPlaceholder = 'Type your answer…',\n showSkip = true,\n onSkip,\n onClose,\n onNext,\n submitTooltip,\n onPrevious,\n currentStep,\n totalSteps,\n renderPreview,\n className,\n}: Props) => {\n const [isCustomExpanded, setIsCustomExpanded] = useState(false);\n const isCustomSelected = isCustomExpanded || customAnswer.length > 0;\n const hasSteps = currentStep != null && totalSteps != null;\n const progressValue = hasSteps ? (currentStep / totalSteps) * 100 : 0;\n const isFirstStep = currentStep === 1;\n const isLastStep = hasSteps && currentStep === totalSteps;\n\n const handleOptionToggle = (optionId: string) => {\n if (multiSelect) {\n const isSelected = selectedOptionIds.includes(optionId);\n const nextIds = isSelected\n ? selectedOptionIds.filter((id) => id !== optionId)\n : [...selectedOptionIds, optionId];\n onSelectionChange?.(nextIds);\n } else {\n // Single-select: picking a real option deselects \"Other\" and drops any\n // typed custom answer so it can't leak into the submitted answer.\n setIsCustomExpanded(false);\n onCustomAnswerChange?.('');\n onSelectionChange?.([optionId]);\n }\n };\n\n const handleCustomToggle = (checked: boolean) => {\n setIsCustomExpanded(checked);\n if (checked) {\n // Single-select: \"Other\" and a real option are mutually exclusive.\n if (!multiSelect) {\n onSelectionChange?.([]);\n }\n } else {\n onCustomAnswerChange?.('');\n }\n };\n\n // Typing into (or focusing) the custom input selects \"Other\" directly — no\n // need to click the row/checkbox first.\n const handleCustomFocus = () => {\n setIsCustomExpanded(true);\n if (!multiSelect) {\n onSelectionChange?.([]);\n }\n };\n\n const handleCustomRowClick = () => {\n // Multi-select: the row toggles the checkbox. Single-select: clicking only\n // selects (never deselects, so a second click can't wipe typed text) —\n // switch away by picking a real option instead.\n if (multiSelect) {\n handleCustomToggle(!isCustomSelected);\n } else {\n handleCustomFocus();\n }\n };\n\n return (\n <div\n className={cn(\n 'tw:flex tw:max-w-[800px] tw:flex-col tw:gap-4 tw:overflow-hidden tw:rounded-xl tw:border tw:border-solid tw:border-border tw:bg-card tw:text-card-foreground tw:shadow-lg',\n className,\n )}\n data-testid=\"question-root\"\n data-question-step={currentStep}\n data-question-total-steps={totalSteps}\n data-question-multi-select={multiSelect}\n >\n <div className=\"tw:flex tw:items-start tw:gap-2 tw:pl-4 tw:pr-2 tw:pt-4\">\n <div className=\"tw:flex tw:min-w-0 tw:flex-1 tw:flex-col tw:gap-1\">\n <p className=\"tw:m-0 tw:text-base tw:font-semibold tw:leading-6\">{question}</p>\n {header && (\n <p className=\"tw:m-0 tw:text-xs tw:leading-4 tw:text-muted-foreground\">{header}</p>\n )}\n </div>\n {onClose && (\n <Button\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label=\"Close\"\n onClick={onClose}\n data-testid=\"question-close-button\"\n >\n <X className=\"tw:size-4\" />\n </Button>\n )}\n </div>\n\n <div className=\"tw:px-4\">\n <div className=\"tw:flex tw:flex-col tw:gap-4 tw:border-0 tw:border-l tw:border-solid tw:border-primary tw:px-4 tw:py-2\">\n {options.map((option) => (\n <div\n key={option.id}\n className=\"tw:-mx-2 tw:-my-1.5 tw:flex tw:cursor-pointer tw:items-start tw:gap-2 tw:rounded-md tw:px-2 tw:py-1.5 tw:hover:bg-accent\"\n onClick={() => handleOptionToggle(option.id)}\n onKeyDown={handleKeyDown(() => handleOptionToggle(option.id))}\n role=\"button\"\n tabIndex={0}\n data-testid={`question-option-${option.id}`}\n >\n {multiSelect && (\n <Checkbox\n checked={selectedOptionIds.includes(option.id)}\n onCheckedChange={() => handleOptionToggle(option.id)}\n onClick={(e) => e.stopPropagation()}\n className=\"tw:shrink-0\"\n />\n )}\n <div className=\"tw:flex tw:min-w-0 tw:flex-1 tw:items-start tw:gap-3\">\n <div className=\"tw:flex tw:flex-col tw:gap-1.5\">\n <span className=\"tw:text-sm tw:font-medium tw:leading-none\">{option.label}</span>\n {option.description && (\n <span className=\"tw:text-sm tw:font-normal tw:leading-5 tw:text-muted-foreground\">\n {option.description}\n </span>\n )}\n </div>\n {option.preview && (\n <div\n data-testid=\"question-option-preview\"\n className={cn(\n 'tw:ml-auto tw:flex tw:max-h-40 tw:min-w-0 tw:max-w-[50%] tw:flex-col tw:overflow-hidden tw:rounded-md',\n !renderPreview &&\n 'tw:overflow-auto tw:border tw:border-solid tw:border-border tw:bg-muted tw:p-2 tw:text-foreground',\n )}\n >\n {renderPreview ? (\n renderPreview(option.preview)\n ) : (\n // `text-foreground` restates the ink the box above already\n // sets, and is not redundant: consuming apps ship a global\n // `pre { color; background-color; border }` rule that beats\n // inheritance but loses to a utility — the same reason\n // `border-0` and `bg-transparent` are spelled out here.\n <pre className=\"tw:m-0 tw:overflow-visible tw:border-0 tw:bg-transparent tw:p-0 tw:font-mono tw:text-xs tw:leading-5 tw:text-foreground\">\n {option.preview}\n </pre>\n )}\n </div>\n )}\n </div>\n </div>\n ))}\n\n {showCustomAnswer && (\n <div className=\"tw:flex tw:flex-col tw:gap-2\">\n <div\n className=\"tw:-mx-2 tw:-my-1.5 tw:flex tw:cursor-pointer tw:items-start tw:gap-2 tw:rounded-md tw:px-2 tw:py-1.5 tw:hover:bg-accent\"\n onClick={handleCustomRowClick}\n onKeyDown={handleKeyDown(handleCustomRowClick)}\n role=\"button\"\n tabIndex={0}\n >\n {/* Multi-select shows a checkbox alongside the option checkboxes.\n Single-select options auto-advance and carry no indicator, so\n \"Other\" is a plain clickable row that reveals the input below. */}\n {multiSelect && (\n <Checkbox\n checked={isCustomSelected}\n onCheckedChange={handleCustomToggle}\n onClick={(e) => e.stopPropagation()}\n className=\"tw:shrink-0\"\n />\n )}\n <span\n className={cn(\n 'tw:text-sm tw:font-medium tw:leading-none',\n !multiSelect && isCustomSelected && 'tw:text-primary',\n )}\n >\n Other\n </span>\n </div>\n {/* Always rendered and editable: typing or focusing selects \"Other\"\n directly, and keeping it mounted avoids layout shift. */}\n <TextInput\n value={customAnswer}\n onValueChange={(value) => onCustomAnswerChange?.(value)}\n onFocus={handleCustomFocus}\n onKeyDown={\n onCustomAnswerConfirm\n ? (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !e.shiftKey && !(e.metaKey || e.ctrlKey)) {\n e.preventDefault();\n onCustomAnswerConfirm();\n }\n }\n : undefined\n }\n placeholder={customAnswerPlaceholder}\n sizing=\"small\"\n testId=\"question-custom\"\n />\n </div>\n )}\n </div>\n </div>\n\n <div className=\"tw:flex tw:flex-col\">\n {hasSteps && <Progress size=\"sm\" value={progressValue} className=\"tw:rounded-none\" />}\n\n <div\n className={cn(\n 'tw:flex tw:items-center tw:justify-end tw:gap-4 tw:px-4 tw:py-3',\n !hasSteps && 'tw:border-0 tw:border-t tw:border-solid tw:border-border',\n )}\n >\n {hasSteps && (\n <div className=\"tw:flex tw:items-center tw:gap-2\">\n <button\n type=\"button\"\n disabled={isFirstStep}\n className=\"tw:flex tw:cursor-pointer tw:items-center tw:justify-center tw:bg-transparent tw:p-0 tw:disabled:cursor-default tailwindcss-preflight\"\n onClick={onPrevious}\n aria-label=\"Previous step\"\n >\n <ChevronLeft\n className={cn(\n 'tw:size-5',\n isFirstStep ? 'tw:text-primary/25' : 'tw:text-primary',\n )}\n />\n </button>\n <span className=\"tw:text-xs tw:leading-4 tw:text-muted-foreground\">\n {currentStep} of {totalSteps}\n </span>\n <button\n type=\"button\"\n disabled={currentStep === totalSteps}\n className=\"tw:flex tw:cursor-pointer tw:items-center tw:justify-center tw:bg-transparent tw:p-0 tw:disabled:cursor-default tailwindcss-preflight\"\n onClick={onNext}\n aria-label=\"Next step\"\n >\n <ChevronRight\n className={cn(\n 'tw:size-5',\n currentStep === totalSteps ? 'tw:text-primary/25' : 'tw:text-primary',\n )}\n />\n </button>\n </div>\n )}\n {showSkip && onSkip && (\n <Button\n variant=\"outline\"\n size=\"small\"\n onClick={onSkip}\n data-testid=\"question-skip-button\"\n >\n Skip\n </Button>\n )}\n {(multiSelect || isCustomSelected) &&\n (submitTooltip ? (\n <Tooltip tooltip={submitTooltip} placement=\"top\" triggerAsChild>\n <Button\n variant=\"primary\"\n size=\"small\"\n onClick={onNext}\n data-testid=\"question-next-button\"\n >\n {isLastStep ? 'Submit' : 'Next'}\n </Button>\n </Tooltip>\n ) : (\n <Button\n variant=\"primary\"\n size=\"small\"\n onClick={onNext}\n data-testid=\"question-next-button\"\n >\n {isLastStep ? 'Submit' : 'Next'}\n </Button>\n ))}\n </div>\n </div>\n </div>\n );\n};\n\nexport type { QuestionOption, Props as QuestionProps };\n","import { type ReactNode, useState } from 'react';\n\nimport type { QuestionOption } from './Question';\nimport { Question } from './Question';\n\ntype QuestionStep = {\n question: string;\n header?: string;\n options: readonly QuestionOption[];\n multiSelect?: boolean;\n showCustomAnswer?: boolean;\n customAnswerPlaceholder?: string;\n};\n\ntype QuestionAnswers = {\n selections: Record<number, readonly string[]>;\n customAnswers: Record<number, string>;\n};\n\ntype Props = {\n steps: readonly [QuestionStep, ...QuestionStep[]];\n showSkip?: boolean;\n onSubmit?: (answers: QuestionAnswers) => void;\n onClose?: () => void;\n renderPreview?: (content: string) => ReactNode;\n className?: string;\n};\n\nexport const QuestionBlock = ({\n steps,\n showSkip = true,\n onSubmit,\n onClose,\n renderPreview,\n className,\n}: Props) => {\n const [currentStep, setCurrentStep] = useState(1);\n const [selections, setSelections] = useState<Record<number, readonly string[]>>({});\n const [customAnswers, setCustomAnswers] = useState<Record<number, string>>({});\n const stepData = steps[currentStep - 1]!;\n const isLastStep = currentStep === steps.length;\n\n const advance = (updatedSelections?: Record<number, readonly string[]>) => {\n const finalSelections = updatedSelections ?? selections;\n if (isLastStep) {\n onSubmit?.({ selections: finalSelections, customAnswers });\n } else {\n setCurrentStep((s) => Math.min(s + 1, steps.length));\n }\n };\n\n const handleSelectionChange = (ids: readonly string[]) => {\n const updated = { ...selections, [currentStep]: ids };\n setSelections(updated);\n if (!stepData.multiSelect) {\n advance(updated);\n }\n };\n\n return (\n <Question\n key={currentStep}\n {...stepData}\n selectedOptionIds={selections[currentStep] ?? []}\n onSelectionChange={handleSelectionChange}\n customAnswer={customAnswers[currentStep] ?? ''}\n onCustomAnswerChange={(value) =>\n setCustomAnswers((prev) => ({ ...prev, [currentStep]: value }))\n }\n currentStep={currentStep}\n totalSteps={steps.length}\n showSkip={showSkip && !isLastStep}\n onNext={() => advance()}\n onPrevious={() => setCurrentStep((s) => Math.max(s - 1, 1))}\n onSkip={() => setCurrentStep((s) => Math.min(s + 1, steps.length))}\n onClose={onClose}\n renderPreview={renderPreview}\n className={className}\n />\n );\n};\n\nexport type { QuestionStep, QuestionAnswers, Props as QuestionBlockProps };\n","import type { ReactNode } from 'react';\n\nimport { Sparkles } from '../../icons';\nimport { cn } from '../../utils';\n\ntype Props = {\n label: string;\n disabled?: boolean;\n onClick: () => void;\n icon?: ReactNode;\n className?: string;\n};\n\nexport const SuggestedPrompt = ({ label, disabled, onClick, icon, className }: Props) => {\n return (\n <button\n type=\"button\"\n disabled={disabled}\n className={cn(\n 'tailwindcss-preflight tw:flex tw:items-center tw:justify-start tw:gap-2.5 tw:whitespace-nowrap',\n 'tw:rounded-lg tw:px-3 tw:py-2',\n 'tw:text-left tw:text-sm tw:font-medium tw:text-foreground',\n 'tw:transition-colors tw:not-disabled:hover:bg-accent',\n 'tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-1',\n 'tw:disabled:cursor-not-allowed tw:disabled:opacity-50',\n className,\n )}\n onClick={onClick}\n >\n {icon ?? (\n // Lucide icons are stroke-based — paint the visible line with the AI\n // gradient (no fill, so the glyph keeps its outline silhouette instead\n // of becoming a solid block). The `*` selector catches every shape\n // element (path, circle, polyline, …) so multi-part icons don't lose\n // sub-shapes the way `path`-only selectors do.\n <Sparkles className=\"tw:size-4 tw:shrink-0 tw:basis-4 tw:[&_*]:stroke-aigradient-600\" />\n )}\n <div className=\"tw:whitespace-normal tw:text-left\">{label}</div>\n </button>\n );\n};\n","import { Loader2 } from '../../icons';\n\ntype ThinkingIndicatorProps = {\n label?: string;\n};\n\nexport const ThinkingIndicator = ({ label = 'Thinking...' }: ThinkingIndicatorProps) => {\n return (\n // Same quiet chrome as the step rows it precedes (muted ink, no italic),\n // so the hand-off from \"Thinking...\" to the first step is seamless.\n <div className=\"tw:flex tw:items-center tw:gap-1.5\" data-testid=\"chat-thinking-indicator\">\n <Loader2 className=\"tw:size-3.5 tw:animate-spin tw:text-muted-foreground\" />\n <span className=\"tw:text-xs tw:font-medium tw:text-muted-foreground\">{label}</span>\n </div>\n );\n};\n","import { type ReactNode, useEffect } from 'react';\n\nimport { Badge } from '../../../components/Badge';\nimport { Button } from '../../../components/Button';\nimport { cn } from '../../../utils';\n\ntype ToolCallApprovalStatus = 'pending' | 'approved' | 'rejected' | 'expired';\n\ntype ToolCallApprovalProps = {\n /** The tool being called (e.g. `run_sql`). Rendered as a monospace tag. */\n toolName: string;\n /** Human-readable summary of what the tool will do. */\n title?: ReactNode;\n status: ToolCallApprovalStatus;\n onApprove?: () => void;\n onReject?: () => void;\n /** App-rendered detail — a diff, a `ToolCallChip`, a chart, arguments. */\n children?: ReactNode;\n /**\n * Replaces the default Approve/Reject buttons in the pending state. Use when\n * the call needs bespoke controls (e.g. an inline reason field).\n */\n actions?: ReactNode;\n isSubmitting?: boolean;\n /**\n * Opt into `Enter` = approve / `Escape` = reject while pending. Off by\n * default so the shortcuts never fire unexpectedly in a busy chat.\n */\n enableShortcuts?: boolean;\n approveLabel?: string;\n rejectLabel?: string;\n className?: string;\n};\n\nconst STATUS_BADGE: Record<\n ToolCallApprovalStatus,\n { label: string; color: 'blue' | 'green' | 'red' | 'gray' }\n> = {\n pending: { label: 'Needs approval', color: 'blue' },\n approved: { label: 'Approved', color: 'green' },\n rejected: { label: 'Rejected', color: 'red' },\n expired: { label: 'Expired', color: 'gray' },\n};\n\n/**\n * Per-tool-call approve/reject frame — the granular sibling of `PlanApproval`\n * (which approves a whole plan). Chrome + status + actions only: the app\n * renders the call detail as `children` and owns the SDK/permission wiring.\n */\nexport const ToolCallApproval = ({\n toolName,\n title,\n status,\n onApprove,\n onReject,\n children,\n actions,\n isSubmitting = false,\n enableShortcuts = false,\n approveLabel = 'Approve',\n rejectLabel = 'Reject',\n className,\n}: ToolCallApprovalProps) => {\n const isPending = status === 'pending';\n const hasCustomActions = actions != null;\n const showDefaultActions = isPending && !hasCustomActions && Boolean(onApprove || onReject);\n // Custom actions, like the defaults, only make sense while a decision is\n // still pending — never leave controls visible in a terminal state.\n const showActions = isPending && (showDefaultActions || hasCustomActions);\n const badge = STATUS_BADGE[status];\n\n useEffect(() => {\n if (!enableShortcuts || !isPending || isSubmitting) return;\n\n const isEditableTarget = (target: EventTarget | null) => {\n if (!(target instanceof HTMLElement)) return false;\n return (\n target.isContentEditable ||\n target.tagName === 'INPUT' ||\n target.tagName === 'TEXTAREA' ||\n target.tagName === 'SELECT'\n );\n };\n\n const handleKeyDown = (event: KeyboardEvent) => {\n // Ignore key-repeat and keystrokes typed into a field.\n if (event.repeat || event.defaultPrevented || isEditableTarget(event.target)) return;\n\n if (\n event.key === 'Enter' &&\n !event.shiftKey &&\n !event.ctrlKey &&\n !event.metaKey &&\n onApprove\n ) {\n event.preventDefault();\n onApprove();\n } else if (event.key === 'Escape' && onReject) {\n event.preventDefault();\n onReject();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n return () => window.removeEventListener('keydown', handleKeyDown);\n }, [enableShortcuts, isPending, isSubmitting, onApprove, onReject]);\n\n return (\n <section\n data-testid=\"tool-call-approval\"\n data-status={status}\n aria-label={typeof title === 'string' ? title : toolName}\n className={cn(\n 'tw:flex tw:w-full tw:max-w-[800px] tw:flex-col tw:gap-3 tw:overflow-hidden tw:rounded-xl tw:border tw:border-solid tw:border-border tw:bg-muted tw:p-4',\n className,\n )}\n >\n <div className=\"tw:flex tw:items-center tw:gap-2\">\n <Badge color={badge.color} variant=\"pill\" className=\"tw:normal-case tw:tracking-normal\">\n {badge.label}\n </Badge>\n <code className=\"tw:rounded tw:bg-background tw:px-1.5 tw:py-0.5 tw:font-mono tw:text-xs tw:text-foreground\">\n {toolName}\n </code>\n </div>\n\n {title != null && (\n <p className=\"tw:m-0 tw:text-sm tw:font-medium tw:text-foreground\">{title}</p>\n )}\n\n {children}\n\n {showActions && (\n <div className=\"tw:flex tw:items-center tw:justify-end tw:gap-2 tw:overflow-x-auto\">\n {actions ?? (\n <>\n {onReject && (\n <Button\n variant=\"outline\"\n size=\"small\"\n onClick={onReject}\n disabled={isSubmitting}\n className=\"tw:shrink-0 tw:whitespace-nowrap\"\n >\n {rejectLabel}\n </Button>\n )}\n {onApprove && (\n <Button\n variant=\"primary\"\n size=\"small\"\n onClick={onApprove}\n disabled={isSubmitting}\n className=\"tw:shrink-0 tw:whitespace-nowrap\"\n >\n {approveLabel}\n </Button>\n )}\n </>\n )}\n </div>\n )}\n </section>\n );\n};\n\nexport type { ToolCallApprovalStatus, ToolCallApprovalProps };\n","import type { MouseEventHandler, ReactNode } from 'react';\nimport { cva } from 'class-variance-authority';\n\nimport { CircleCheck, CircleX, Loader2 } from '../../../icons';\nimport { cn } from '../../../utils';\n\ntype ToolCallState = 'processing' | 'done' | 'error';\n\ntype ToolCallChipProps = {\n label: ReactNode;\n state: ToolCallState;\n /** Leading icon; defaults to a state glyph (spinner / check / x). */\n icon?: ReactNode;\n /** Trailing node (e.g. a chevron or count). */\n trailing?: ReactNode;\n /** When set, the chip renders as a button and fires this on click. */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n className?: string;\n};\n\nconst chipClasses = cva(\n [\n 'tw:inline-flex tw:items-center tw:gap-1.5 tw:rounded-md tw:border tw:border-solid',\n 'tw:border-border tw:bg-muted tw:px-2 tw:py-1 tw:text-xs tw:text-foreground',\n ],\n {\n variants: {\n interactive: {\n true: 'tw:cursor-pointer tw:focus-visible:outline-hidden tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:not-disabled:hover:bg-accent',\n false: '',\n },\n },\n defaultVariants: { interactive: false },\n },\n);\n\nconst StateIcon = ({ state }: { state: ToolCallState }) => {\n if (state === 'processing') {\n return <Loader2 className=\"tw:size-3.5 tw:shrink-0 tw:animate-spin tw:text-muted-foreground\" />;\n }\n if (state === 'error') {\n return <CircleX className=\"tw:size-3.5 tw:shrink-0 tw:text-error-500\" />;\n }\n return <CircleCheck className=\"tw:size-3.5 tw:shrink-0 tw:text-primary\" />;\n};\n\n/**\n * Presentational chip summarising a single tool call (icon + label + optional\n * trailing action). It has **no** URL/router knowledge — wrap it in a `Link`\n * or pass `onClick` for navigation; the app owns deep-linking.\n */\nexport const ToolCallChip = ({\n label,\n state,\n icon,\n trailing,\n onClick,\n className,\n}: ToolCallChipProps) => {\n const content = (\n <>\n {icon ?? <StateIcon state={state} />}\n <span className=\"tw:min-w-0 tw:truncate\">{label}</span>\n {trailing != null && (\n <span className=\"tw:ml-auto tw:inline-flex tw:shrink-0 tw:items-center\">{trailing}</span>\n )}\n </>\n );\n\n if (onClick) {\n return (\n <button\n type=\"button\"\n data-testid=\"tool-call-chip\"\n data-state={state}\n onClick={onClick}\n className={cn('tailwindcss-preflight', chipClasses({ interactive: true }), className)}\n >\n {content}\n </button>\n );\n }\n\n return (\n <span\n data-testid=\"tool-call-chip\"\n data-state={state}\n className={cn(chipClasses({ interactive: false }), className)}\n >\n {content}\n </span>\n );\n};\n\nexport type { ToolCallChipProps, ToolCallState };\n","import type { ReactNode } from 'react';\nimport { cva } from 'class-variance-authority';\n\nimport type { LucideIcon } from '../../icons';\nimport { ChevronDown, TriangleAlert } from '../../icons';\nimport { cn } from '../../utils';\n\ntype ToolCallStatus = 'processing' | 'warning' | 'success' | 'error';\n\ntype Props = {\n icon: LucideIcon;\n iconSpin?: boolean;\n status: ToolCallStatus;\n text: ReactNode;\n needsConfirmation?: boolean;\n isCollapsible?: boolean;\n isCollapsed?: boolean;\n onToggleCollapse?: () => void;\n};\n\n// The header stays a neutral band for routine states — a filled saturated bar\n// made every successful tool call shout. Status is carried by the icon and the\n// label tint; the two states that ask for the user's attention (a pending\n// confirmation, a failure) additionally get a soft tint of their status colour\n// so they catch peripheral vision without shouting.\nconst headerVariants = cva(\n 'tw:flex tw:items-center tw:justify-between tw:gap-2 tw:px-2.5 tw:py-1.5',\n {\n variants: {\n // One boundary cue per state, never two: a tinted header is already\n // bounded by where its wash stops, so it takes no rule — the hairline\n // belongs to the untinted states, which would otherwise have no edge.\n status: {\n processing: 'tw:border-b tw:border-border/60',\n warning: 'tw:bg-warning/10',\n success: 'tw:border-b tw:border-border/60',\n error: 'tw:bg-destructive/10',\n },\n },\n defaultVariants: {\n status: 'success',\n },\n },\n);\n\nconst statusInk: Record<ToolCallStatus, string> = {\n processing: 'tw:text-muted-foreground',\n warning: 'tw:text-warning',\n success: 'tw:text-muted-foreground',\n error: 'tw:text-destructive',\n};\n\nconst statusIconInk: Record<ToolCallStatus, string> = {\n processing: 'tw:text-muted-foreground',\n warning: 'tw:text-warning',\n success: 'tw:text-success/70',\n error: 'tw:text-destructive',\n};\n\nexport const ToolCallStatusHeader = ({\n icon: IconComponent,\n iconSpin,\n status,\n text,\n needsConfirmation,\n isCollapsible,\n isCollapsed,\n onToggleCollapse,\n}: Props) => {\n return (\n <div\n role={isCollapsible ? 'button' : undefined}\n tabIndex={isCollapsible ? 0 : undefined}\n aria-expanded={isCollapsible ? !isCollapsed : undefined}\n data-status={status}\n className={cn(headerVariants({ status }), isCollapsible && 'tw:cursor-pointer')}\n onClick={isCollapsible ? onToggleCollapse : undefined}\n onKeyDown={\n isCollapsible\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onToggleCollapse?.();\n }\n }\n : undefined\n }\n >\n <div className=\"tw:flex tw:min-w-0 tw:flex-1 tw:items-center tw:gap-1.5\">\n <IconComponent\n className={cn(\n 'tw:size-3.5 tw:shrink-0',\n statusIconInk[status],\n iconSpin && 'tw:animate-spin',\n )}\n />\n <span\n data-testid=\"tool-status-text\"\n className={cn('tw:truncate tw:pr-0.5 tw:text-xs tw:font-medium', statusInk[status])}\n >\n {text}\n </span>\n </div>\n {(needsConfirmation || isCollapsible) && (\n <div className=\"tw:flex tw:shrink-0 tw:items-center tw:gap-2\">\n {needsConfirmation && (\n <div className=\"tw:flex tw:items-center tw:gap-1\">\n <span\n data-testid=\"tool-confirmation-required\"\n className=\"tw:text-xs tw:font-medium tw:text-warning\"\n >\n Confirmation required\n </span>\n <TriangleAlert className=\"tw:size-3.5 tw:text-warning\" />\n </div>\n )}\n {isCollapsible && (\n <ChevronDown\n className={cn(\n 'tw:size-3.5 tw:shrink-0 tw:text-muted-foreground',\n 'tw:transition-transform tw:duration-300 tw:ease-out tw:motion-reduce:transition-none',\n !isCollapsed && 'tw:rotate-180',\n )}\n />\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport type { Props as ToolCallStatusHeaderProps, ToolCallStatus };\n","/**\n * Clamp a percentage to 0–100 and normalize non-finite input to 0.\n *\n * - `Progress`'s indicator is unclamped, so a value over 100 slides the bar off-screen.\n * - `NaN` normalizes to 0 — `Math.min`/`Math.max` propagate it, and it renders as no bar at all.\n */\nexport const clampPercentage = (value: number) =>\n Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 0;\n\n/**\n * A percentage as text — `72%`, `1.1%`, `99.9%`.\n *\n * - One decimal place, trimmed to a whole number, so `11/1000` reads as `1.1%` rather than `1%`.\n * - Floored, not rounded: rounding `99.96` up to `100%` disagrees with the at-limit state computed\n * from the raw value, exactly at the boundary everything else turns on.\n * - The `1e-9` nudge is for floating-point noise — `11 / 1000 * 100` is `1.0999999999999999`.\n */\nexport const formatPercentage = (value: number) => {\n const floored = Math.floor(value * 10 + 1e-9) / 10;\n return `${Number.isInteger(floored) ? floored.toFixed(0) : floored.toFixed(1)}%`;\n};\n","import { cn } from '../../utils';\n\nimport { clampPercentage } from './usageStatsHelpers';\n\ntype Props = {\n value: number;\n size?: number;\n strokeWidth?: number;\n className?: string;\n};\n\nexport const UsageStatsRing = ({ value, size = 16, strokeWidth = 2.5, className }: Props) => {\n const radius = Math.max(0, (size - strokeWidth) / 2 - 1);\n const circumference = 2 * Math.PI * radius;\n const offset = circumference * (1 - clampPercentage(value) / 100);\n\n return (\n <svg\n width={size}\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n className={cn('tw:-rotate-90', className)}\n role=\"presentation\"\n >\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n // The unfilled remainder of the gauge: a muted mark, not a surface.\n className=\"tw:stroke-muted-foreground tw:opacity-50\"\n />\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={offset}\n className=\"tw:stroke-primary tw:transition-all\"\n />\n </svg>\n );\n};\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { HoverCard } from '../../components/HoverCard';\nimport { AlertCircle } from '../../icons';\nimport { cn } from '../../utils';\n\nimport { clampPercentage } from './usageStatsHelpers';\nimport { UsageStatsRing } from './UsageStatsRing';\n\ntype Props = {\n value: number;\n /**\n * `true` (or `'error'`) renders the red corner badge; `'warning'` renders\n * it amber for an approaching-limit state that isn't at-limit yet.\n */\n alert?: boolean | 'warning' | 'error';\n children: ReactNode;\n className?: string;\n /**\n * Accessible name for the trigger. Defaults to a value-aware label so\n * screen-reader users get the same information the ring conveys visually.\n */\n ariaLabel?: string;\n align?: ComponentProps<typeof HoverCard.Content>['align'];\n side?: ComponentProps<typeof HoverCard.Content>['side'];\n sideOffset?: ComponentProps<typeof HoverCard.Content>['sideOffset'];\n /** Control the card yourself to hold it open past a pointer leave — e.g. while a popover it contains is up. */\n open?: ComponentProps<typeof HoverCard>['open'];\n onOpenChange?: ComponentProps<typeof HoverCard>['onOpenChange'];\n};\n\nexport const UsageStats = ({\n value,\n alert = false,\n children,\n className,\n ariaLabel,\n align = 'end',\n side = 'top',\n sideOffset = 8,\n open,\n onOpenChange,\n}: Props) => {\n const hasAlert = Boolean(alert);\n const isWarning = alert === 'warning';\n const defaultLabel = `Usage: ${Math.round(clampPercentage(value))}%${hasAlert ? ' (usage alert)' : ''}`;\n return (\n <HoverCard open={open} onOpenChange={onOpenChange}>\n <HoverCard.Trigger asChild>\n <span\n aria-label={ariaLabel ?? defaultLabel}\n className={cn(\n 'tw:relative tw:inline-flex tw:size-8 tw:items-center tw:justify-center',\n className,\n )}\n >\n <UsageStatsRing value={value} />\n {hasAlert && (\n <AlertCircle\n data-testid=\"usage-stats-alert\"\n className={cn(\n 'tw:absolute tw:-right-0.5 tw:-top-0.5 tw:size-3',\n isWarning ? 'tw:text-warning-500' : 'tw:text-error-500',\n )}\n />\n )}\n </span>\n </HoverCard.Trigger>\n\n <HoverCard.Content align={align} side={side} sideOffset={sideOffset}>\n {children}\n </HoverCard.Content>\n </HoverCard>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM,eAAe,CACnB;CAAE,MAAM;CAAM,OAAO;CAAe,MAAM,oBAAC,UAAD,EAAU,WAAU,YAAa,CAAA;AAAE,GAC7E;CAAE,MAAM;CAAQ,OAAO;CAAc,MAAM,oBAAC,YAAD,EAAY,WAAU,YAAa,CAAA;AAAE,CAClF;;;;;;;;;;;;;AA2BA,MAAa,iBAAiB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B;EAAoB;EAArC,UAAA,CACE,oBAAC,UAAU,SAAX;GAAmB,SAAA;GACjB,UAAA,qBAAC,QAAD;IACE,cAAY,aAAa;IACzB,WAAW,GACT,0EACA,SACF;IALF,UAAA,CAOE,oBAAC,gBAAD,EAAuB,MAAQ,CAAA,GAC9B,YACC,oBAAC,aAAD;KACE,eAAY;KACZ,WAAW,GACT,mDACA,YAAY,wBAAwB,mBACtC;IACD,CAAA,CAEC;;EACW,CAAA,GAEnB,oBAAC,UAAU,SAAX;GAA0B;GAAa;GAAkB;GACtD;EACgB,CAAA,CACV;;AAEf"}
@@ -1,6 +1,6 @@
1
1
  import { cn } from "./classNames-BzrkDnOD.js";
2
- import { Tooltip } from "./utils-B-g7d_Jb.js";
3
- import { useArgoDesign } from "./context-BrNtMc1H.js";
2
+ import { Tooltip } from "./utils-DSvrhU8E.js";
3
+ import { useArgoDesign } from "./context-D7X470dy.js";
4
4
  import { AlertTriangle, ChevronDown, CircleCheck, Info } from "./icons-Cek151jC.js";
5
5
  import { Collapsible } from "./Collapsible-BQXWEOBC.js";
6
6
  import { Slot } from "@radix-ui/react-slot";
@@ -130,4 +130,4 @@ const Alert = ({ title, variant = "info", children, hideIcon = false, icon, clas
130
130
  //#endregion
131
131
  export { Alert };
132
132
 
133
- //# sourceMappingURL=Alert-CseY3yAj.js.map
133
+ //# sourceMappingURL=Alert-Ba5b2YPq.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Alert-CseY3yAj.js","names":[],"sources":["../src/components/Alert/AlertAction.tsx","../src/components/Alert/AlertCollapsibleIcon.tsx","../src/components/Alert/AlertDescription.tsx","../src/components/Alert/AlertIcon.tsx","../src/components/Alert/AlertRoot.tsx","../src/components/Alert/AlertTitle.tsx","../src/components/Alert/Alert.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'> & {\n asChild?: boolean;\n};\n\nexport const AlertAction = ({ ref, className, asChild = false, ...props }: Props) => {\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp\n {...props}\n ref={ref}\n className={cn(\n 'tw:col-start-3',\n 'tw:row-start-1',\n 'tw:self-start',\n 'tw:flex',\n 'tw:gap-2',\n className,\n )}\n />\n );\n};\n","import { ChevronDown } from '../../icons';\nimport { cn } from '../../utils';\nimport { Tooltip } from '../Tooltip';\n\ntype Props = {\n open: boolean;\n};\n\nexport const AlertCollapsibleIcon = ({ open }: Props) => (\n <Tooltip placement=\"top\" tooltip={open ? 'Collapse alert' : 'Expand alert'} triggerAsChild>\n <ChevronDown\n className={cn(\n 'tw:mt-px',\n 'tw:size-5',\n 'tw:text-neutral-400',\n 'tw:group-data-[state=open]/alert:rotate-180',\n\n // Legacy uses the fixed categorical hover scales; argo uses the themeable status tokens.\n 'tw:group-data-[variant=info]/alert:group-hover:text-blue-600',\n 'tw:group-data-[variant=info]/alert:group-data-[argo=true]/alert:group-hover:text-info',\n 'tw:group-data-[variant=warning]/alert:group-hover:text-warning-600',\n 'tw:group-data-[variant=warning]/alert:group-data-[argo=true]/alert:group-hover:text-warning',\n 'tw:group-data-[variant=error]/alert:group-hover:text-error-600',\n 'tw:group-data-[variant=error]/alert:group-data-[argo=true]/alert:group-hover:text-destructive',\n 'tw:group-data-[variant=success]/alert:group-hover:text-green-600',\n 'tw:group-data-[variant=success]/alert:group-data-[argo=true]/alert:group-hover:text-success',\n )}\n />\n </Tooltip>\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const AlertDescription = ({ ref, children, className, ...rest }: Props) => (\n <div\n {...rest}\n ref={ref}\n className={cn(\n 'tw:col-start-2',\n 'tw:group-has-[[data-slot=alert-title]]/alert:col-end-[-1]',\n\n // spacer before description when a title exists (pseudo-element so it animates with Collapsible)\n 'tw:group-has-[[data-slot=alert-title]]/alert:before:block',\n 'tw:group-has-[[data-slot=alert-title]]/alert:before:h-4',\n \"tw:group-has-[[data-slot=alert-title]]/alert:before:content-['']\",\n\n 'tw:break-anywhere',\n\n // Default size for nested Lucide icons; callers can override on the icon.\n \"tw:[&_svg.lucide:not([class*='tw:size-'])]:size-4\",\n 'tw:[&_svg]:shrink-0',\n\n className,\n )}\n >\n {children}\n </div>\n);\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { AlertTriangle, CircleCheck, Info } from '../../icons';\nimport { cn } from '../../utils';\n\nimport type { Variant } from './AlertRoot';\n\nconst VARIANT_ICONS: Record<Variant, ReactNode> = {\n info: <Info />,\n warning: <AlertTriangle />,\n error: <AlertTriangle />,\n success: <CircleCheck />,\n};\n\ntype Props = {\n variant: Variant;\n icon?: ReactNode;\n} & Omit<ComponentProps<'span'>, 'children'>;\n\nexport const AlertIcon = ({ variant, icon, className, ...rest }: Props) => (\n <span\n {...rest}\n data-slot=\"alert-icon\"\n className={cn(\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:self-start',\n 'tw:p-0.5',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4',\n // Legacy uses the fixed categorical icon scales; argo uses the themeable status tokens.\n 'tw:group-data-[variant=info]/alert:text-blue-500',\n 'tw:group-data-[variant=info]/alert:group-data-[argo=true]/alert:text-info',\n 'tw:group-data-[variant=warning]/alert:text-warning-500',\n 'tw:group-data-[variant=warning]/alert:group-data-[argo=true]/alert:text-warning',\n 'tw:group-data-[variant=error]/alert:text-error-500',\n 'tw:group-data-[variant=error]/alert:group-data-[argo=true]/alert:text-destructive',\n 'tw:group-data-[variant=success]/alert:text-green-500',\n 'tw:group-data-[variant=success]/alert:group-data-[argo=true]/alert:text-success',\n className,\n )}\n >\n {icon ?? VARIANT_ICONS[variant]}\n </span>\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nexport type Variant = 'info' | 'warning' | 'error' | 'success';\n\ntype Props = {\n variant?: Variant;\n} & ComponentProps<'div'>;\n\nexport const AlertRoot = ({ ref, children, className, variant, ...rest }: Props) => {\n const renderArgo = useArgoDesign();\n return (\n <div\n {...rest}\n ref={ref}\n data-variant={variant}\n data-argo={renderArgo}\n className={cn(\n 'tw:group/alert',\n\n // layout\n 'tw:grid',\n 'tw:grid-cols-[0_1fr_auto]',\n 'tw:has-[[data-slot=alert-icon]]:grid-cols-[auto_1fr_auto]',\n 'tw:has-[[data-slot=alert-icon]]:gap-x-2',\n\n // fonts\n 'tw:text-sm',\n // Legacy keeps the fixed neutral text; argo uses the semantic foreground\n // so the alert flips with the brand's light/dark palette (the categorical\n // variant tint stays — only the text token becomes brand-aware).\n 'tw:text-neutral-800',\n 'tw:data-[argo=true]:text-foreground',\n 'tw:text-left',\n\n 'tw:p-4',\n\n // border — legacy keeps a fixed radius; argo follows the brand radius token.\n 'tw:rounded',\n 'tw:data-[argo=true]:rounded-[var(--radius-lg,0.25rem)]',\n 'tw:border',\n 'tw:border-solid',\n\n // Variant tint + border. Legacy keeps the fixed categorical scales (solid\n // pastel tint); argo uses the brand-overridable status tokens (bg at 10%,\n // border at 25%) so status re-skins with the brand. The argo tokens carry\n // AA-legible defaults, so the variant icon (AlertIcon, full-strength\n // `tw:text-<role>`) clears ≥4.5:1 on the tint in both light and dark.\n 'tw:data-[variant=info]:bg-blue-100',\n 'tw:data-[variant=info]:border-blue-200',\n 'tw:data-[variant=info]:data-[argo=true]:bg-info/10',\n 'tw:data-[variant=info]:data-[argo=true]:border-info/25',\n\n 'tw:data-[variant=warning]:bg-warning-100',\n 'tw:data-[variant=warning]:border-warning-300',\n 'tw:data-[variant=warning]:data-[argo=true]:bg-warning/10',\n 'tw:data-[variant=warning]:data-[argo=true]:border-warning/25',\n\n 'tw:data-[variant=error]:bg-error-100',\n 'tw:data-[variant=error]:border-error-200',\n 'tw:data-[variant=error]:data-[argo=true]:bg-destructive/10',\n 'tw:data-[variant=error]:data-[argo=true]:border-destructive/25',\n\n 'tw:data-[variant=success]:bg-green-100',\n 'tw:data-[variant=success]:border-green-200',\n 'tw:data-[variant=success]:data-[argo=true]:bg-success/10',\n 'tw:data-[variant=success]:data-[argo=true]:border-success/25',\n className,\n )}\n >\n {children}\n </div>\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const AlertTitle = ({ ref, className, ...props }: Props) => (\n <div\n {...props}\n ref={ref}\n data-slot=\"alert-title\"\n className={cn(\n 'tw:group/alert-title',\n 'tw:flex',\n 'tw:col-start-2',\n 'tw:font-medium',\n 'tw:items-center',\n className,\n )}\n />\n);\n","import { useState } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../../utils';\nimport { Collapsible } from '../Collapsible';\n\nimport { AlertAction } from './AlertAction';\nimport { AlertCollapsibleIcon } from './AlertCollapsibleIcon';\nimport { AlertDescription } from './AlertDescription';\nimport { AlertIcon } from './AlertIcon';\nimport { AlertRoot } from './AlertRoot';\nimport { AlertTitle } from './AlertTitle';\n\ntype CommonProps = {\n hideIcon?: boolean;\n icon?: ReactNode;\n} & Pick<ComponentProps<typeof Collapsible>, 'open' | 'onOpenChange' | 'defaultOpen'> &\n Omit<ComponentProps<typeof AlertRoot>, 'children'>;\n\ntype CollapsibleProps = {\n mode: 'collapsible';\n title: ReactNode;\n children: ReactNode;\n actions?: never;\n};\n\ntype DefaultProps = {\n mode?: 'default';\n title?: ReactNode;\n children?: ReactNode;\n actions?: ReactNode;\n};\n\n/**\n * Props for `Alert`. Discriminated by `mode` — `\"default\"` renders `title` / `children` / `actions`,\n * `\"collapsible\"` requires `title` + `children` (no `actions`) and renders a collapsible disclosure.\n * `variant` (`info` | `success` | `warning` | `error`) is a categorical colour contract.\n */\ntype Props = CommonProps & (CollapsibleProps | DefaultProps);\n\n/**\n * Persistent inline banner for contextual messages tied to the page layout.\n *\n * **When to use:** a message that lives in the page (info banner, warning about a misconfiguration,\n * post-save validation summary). Use `variant` to encode meaning; pass `actions` for inline buttons.\n * `mode=\"collapsible\"` collapses long error details behind a toggle.\n * **When NOT to use:** for transient feedback (save succeeded, job started) use `toast()`; for\n * field-level validation errors use `FormGroup state=\"error\"`; for a confirmation popover use\n * `Popconfirm`.\n * **Composition:** typically rendered at the top of `PageLayout.Content` or above a form section.\n *\n * @see RECIPES.md#alert-with-action — for action-bearing alert composition\n */\nexport const Alert = ({\n title,\n variant = 'info',\n children,\n hideIcon = false,\n icon,\n className,\n actions,\n mode = 'default',\n\n // collapsible props\n defaultOpen = true,\n open: openProp,\n onOpenChange: onOpenChangeProp,\n\n ...rest\n}: Props) => {\n const isControlled = openProp !== undefined;\n\n const [innerOpen, setInnerOpen] = useState(defaultOpen);\n const open = isControlled ? openProp : innerOpen;\n const handleOpenChange = (nextOpen: boolean) => {\n if (!isControlled) {\n setInnerOpen(nextOpen);\n }\n onOpenChangeProp?.(nextOpen);\n };\n\n const isCollapsible = mode === 'collapsible' && !!title && !!children && !actions;\n\n if (isCollapsible)\n return (\n <Collapsible open={open} onOpenChange={handleOpenChange} asChild>\n <AlertRoot {...rest} variant={variant} className={className}>\n <Collapsible.Trigger\n className={cn(\n 'tailwindcss-preflight',\n 'tw:group',\n 'tw:col-span-full',\n 'tw:grid',\n 'tw:grid-cols-subgrid',\n 'tw:rounded-sm',\n 'tw:focus-visible:outline',\n 'tw:focus-visible:outline-2',\n 'tw:focus-visible:outline-ring',\n )}\n >\n {!hideIcon && <AlertIcon variant={variant} icon={icon} />}\n <AlertTitle>{title}</AlertTitle>\n <AlertCollapsibleIcon open={open} />\n </Collapsible.Trigger>\n\n <Collapsible.Content asChild>\n <AlertDescription>{children}</AlertDescription>\n </Collapsible.Content>\n </AlertRoot>\n </Collapsible>\n );\n\n return (\n <AlertRoot {...rest} variant={variant} className={className}>\n {!hideIcon && <AlertIcon variant={variant} icon={icon} />}\n {title && <AlertTitle>{title}</AlertTitle>}\n {children && <AlertDescription>{children}</AlertDescription>}\n {actions && <AlertAction>{actions}</AlertAction>}\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A;GAC3B,CAAA,CACZ;;CACA,CAAA;CAGjB,OACE,qBAAC,WAAD;EAAW,GAAI;EAAe;EAAoB;EAAlD,UAAA;GACG,CAAC,YAAY,oBAAC,WAAD;IAAoB;IAAe;GAAO,CAAA;GACvD,SAAS,oBAAC,YAAD,EAAA,UAAa,MAAkB,CAAA;GACxC,YAAY,oBAAC,kBAAD,EAAmB,SAA2B,CAAA;GAC1D,WAAW,oBAAC,aAAD,EAAA,UAAc,QAAqB,CAAA;EACtC;;AAEf"}
1
+ {"version":3,"file":"Alert-Ba5b2YPq.js","names":[],"sources":["../src/components/Alert/AlertAction.tsx","../src/components/Alert/AlertCollapsibleIcon.tsx","../src/components/Alert/AlertDescription.tsx","../src/components/Alert/AlertIcon.tsx","../src/components/Alert/AlertRoot.tsx","../src/components/Alert/AlertTitle.tsx","../src/components/Alert/Alert.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'> & {\n asChild?: boolean;\n};\n\nexport const AlertAction = ({ ref, className, asChild = false, ...props }: Props) => {\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp\n {...props}\n ref={ref}\n className={cn(\n 'tw:col-start-3',\n 'tw:row-start-1',\n 'tw:self-start',\n 'tw:flex',\n 'tw:gap-2',\n className,\n )}\n />\n );\n};\n","import { ChevronDown } from '../../icons';\nimport { cn } from '../../utils';\nimport { Tooltip } from '../Tooltip';\n\ntype Props = {\n open: boolean;\n};\n\nexport const AlertCollapsibleIcon = ({ open }: Props) => (\n <Tooltip placement=\"top\" tooltip={open ? 'Collapse alert' : 'Expand alert'} triggerAsChild>\n <ChevronDown\n className={cn(\n 'tw:mt-px',\n 'tw:size-5',\n 'tw:text-neutral-400',\n 'tw:group-data-[state=open]/alert:rotate-180',\n\n // Legacy uses the fixed categorical hover scales; argo uses the themeable status tokens.\n 'tw:group-data-[variant=info]/alert:group-hover:text-blue-600',\n 'tw:group-data-[variant=info]/alert:group-data-[argo=true]/alert:group-hover:text-info',\n 'tw:group-data-[variant=warning]/alert:group-hover:text-warning-600',\n 'tw:group-data-[variant=warning]/alert:group-data-[argo=true]/alert:group-hover:text-warning',\n 'tw:group-data-[variant=error]/alert:group-hover:text-error-600',\n 'tw:group-data-[variant=error]/alert:group-data-[argo=true]/alert:group-hover:text-destructive',\n 'tw:group-data-[variant=success]/alert:group-hover:text-green-600',\n 'tw:group-data-[variant=success]/alert:group-data-[argo=true]/alert:group-hover:text-success',\n )}\n />\n </Tooltip>\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const AlertDescription = ({ ref, children, className, ...rest }: Props) => (\n <div\n {...rest}\n ref={ref}\n className={cn(\n 'tw:col-start-2',\n 'tw:group-has-[[data-slot=alert-title]]/alert:col-end-[-1]',\n\n // spacer before description when a title exists (pseudo-element so it animates with Collapsible)\n 'tw:group-has-[[data-slot=alert-title]]/alert:before:block',\n 'tw:group-has-[[data-slot=alert-title]]/alert:before:h-4',\n \"tw:group-has-[[data-slot=alert-title]]/alert:before:content-['']\",\n\n 'tw:break-anywhere',\n\n // Default size for nested Lucide icons; callers can override on the icon.\n \"tw:[&_svg.lucide:not([class*='tw:size-'])]:size-4\",\n 'tw:[&_svg]:shrink-0',\n\n className,\n )}\n >\n {children}\n </div>\n);\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { AlertTriangle, CircleCheck, Info } from '../../icons';\nimport { cn } from '../../utils';\n\nimport type { Variant } from './AlertRoot';\n\nconst VARIANT_ICONS: Record<Variant, ReactNode> = {\n info: <Info />,\n warning: <AlertTriangle />,\n error: <AlertTriangle />,\n success: <CircleCheck />,\n};\n\ntype Props = {\n variant: Variant;\n icon?: ReactNode;\n} & Omit<ComponentProps<'span'>, 'children'>;\n\nexport const AlertIcon = ({ variant, icon, className, ...rest }: Props) => (\n <span\n {...rest}\n data-slot=\"alert-icon\"\n className={cn(\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:self-start',\n 'tw:p-0.5',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4',\n // Legacy uses the fixed categorical icon scales; argo uses the themeable status tokens.\n 'tw:group-data-[variant=info]/alert:text-blue-500',\n 'tw:group-data-[variant=info]/alert:group-data-[argo=true]/alert:text-info',\n 'tw:group-data-[variant=warning]/alert:text-warning-500',\n 'tw:group-data-[variant=warning]/alert:group-data-[argo=true]/alert:text-warning',\n 'tw:group-data-[variant=error]/alert:text-error-500',\n 'tw:group-data-[variant=error]/alert:group-data-[argo=true]/alert:text-destructive',\n 'tw:group-data-[variant=success]/alert:text-green-500',\n 'tw:group-data-[variant=success]/alert:group-data-[argo=true]/alert:text-success',\n className,\n )}\n >\n {icon ?? VARIANT_ICONS[variant]}\n </span>\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nexport type Variant = 'info' | 'warning' | 'error' | 'success';\n\ntype Props = {\n variant?: Variant;\n} & ComponentProps<'div'>;\n\nexport const AlertRoot = ({ ref, children, className, variant, ...rest }: Props) => {\n const renderArgo = useArgoDesign();\n return (\n <div\n {...rest}\n ref={ref}\n data-variant={variant}\n data-argo={renderArgo}\n className={cn(\n 'tw:group/alert',\n\n // layout\n 'tw:grid',\n 'tw:grid-cols-[0_1fr_auto]',\n 'tw:has-[[data-slot=alert-icon]]:grid-cols-[auto_1fr_auto]',\n 'tw:has-[[data-slot=alert-icon]]:gap-x-2',\n\n // fonts\n 'tw:text-sm',\n // Legacy keeps the fixed neutral text; argo uses the semantic foreground\n // so the alert flips with the brand's light/dark palette (the categorical\n // variant tint stays — only the text token becomes brand-aware).\n 'tw:text-neutral-800',\n 'tw:data-[argo=true]:text-foreground',\n 'tw:text-left',\n\n 'tw:p-4',\n\n // border — legacy keeps a fixed radius; argo follows the brand radius token.\n 'tw:rounded',\n 'tw:data-[argo=true]:rounded-[var(--radius-lg,0.25rem)]',\n 'tw:border',\n 'tw:border-solid',\n\n // Variant tint + border. Legacy keeps the fixed categorical scales (solid\n // pastel tint); argo uses the brand-overridable status tokens (bg at 10%,\n // border at 25%) so status re-skins with the brand. The argo tokens carry\n // AA-legible defaults, so the variant icon (AlertIcon, full-strength\n // `tw:text-<role>`) clears ≥4.5:1 on the tint in both light and dark.\n 'tw:data-[variant=info]:bg-blue-100',\n 'tw:data-[variant=info]:border-blue-200',\n 'tw:data-[variant=info]:data-[argo=true]:bg-info/10',\n 'tw:data-[variant=info]:data-[argo=true]:border-info/25',\n\n 'tw:data-[variant=warning]:bg-warning-100',\n 'tw:data-[variant=warning]:border-warning-300',\n 'tw:data-[variant=warning]:data-[argo=true]:bg-warning/10',\n 'tw:data-[variant=warning]:data-[argo=true]:border-warning/25',\n\n 'tw:data-[variant=error]:bg-error-100',\n 'tw:data-[variant=error]:border-error-200',\n 'tw:data-[variant=error]:data-[argo=true]:bg-destructive/10',\n 'tw:data-[variant=error]:data-[argo=true]:border-destructive/25',\n\n 'tw:data-[variant=success]:bg-green-100',\n 'tw:data-[variant=success]:border-green-200',\n 'tw:data-[variant=success]:data-[argo=true]:bg-success/10',\n 'tw:data-[variant=success]:data-[argo=true]:border-success/25',\n className,\n )}\n >\n {children}\n </div>\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const AlertTitle = ({ ref, className, ...props }: Props) => (\n <div\n {...props}\n ref={ref}\n data-slot=\"alert-title\"\n className={cn(\n 'tw:group/alert-title',\n 'tw:flex',\n 'tw:col-start-2',\n 'tw:font-medium',\n 'tw:items-center',\n className,\n )}\n />\n);\n","import { useState } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../../utils';\nimport { Collapsible } from '../Collapsible';\n\nimport { AlertAction } from './AlertAction';\nimport { AlertCollapsibleIcon } from './AlertCollapsibleIcon';\nimport { AlertDescription } from './AlertDescription';\nimport { AlertIcon } from './AlertIcon';\nimport { AlertRoot } from './AlertRoot';\nimport { AlertTitle } from './AlertTitle';\n\ntype CommonProps = {\n hideIcon?: boolean;\n icon?: ReactNode;\n} & Pick<ComponentProps<typeof Collapsible>, 'open' | 'onOpenChange' | 'defaultOpen'> &\n Omit<ComponentProps<typeof AlertRoot>, 'children'>;\n\ntype CollapsibleProps = {\n mode: 'collapsible';\n title: ReactNode;\n children: ReactNode;\n actions?: never;\n};\n\ntype DefaultProps = {\n mode?: 'default';\n title?: ReactNode;\n children?: ReactNode;\n actions?: ReactNode;\n};\n\n/**\n * Props for `Alert`. Discriminated by `mode` — `\"default\"` renders `title` / `children` / `actions`,\n * `\"collapsible\"` requires `title` + `children` (no `actions`) and renders a collapsible disclosure.\n * `variant` (`info` | `success` | `warning` | `error`) is a categorical colour contract.\n */\ntype Props = CommonProps & (CollapsibleProps | DefaultProps);\n\n/**\n * Persistent inline banner for contextual messages tied to the page layout.\n *\n * **When to use:** a message that lives in the page (info banner, warning about a misconfiguration,\n * post-save validation summary). Use `variant` to encode meaning; pass `actions` for inline buttons.\n * `mode=\"collapsible\"` collapses long error details behind a toggle.\n * **When NOT to use:** for transient feedback (save succeeded, job started) use `toast()`; for\n * field-level validation errors use `FormGroup state=\"error\"`; for a confirmation popover use\n * `Popconfirm`.\n * **Composition:** typically rendered at the top of `PageLayout.Content` or above a form section.\n *\n * @see RECIPES.md#alert-with-action — for action-bearing alert composition\n */\nexport const Alert = ({\n title,\n variant = 'info',\n children,\n hideIcon = false,\n icon,\n className,\n actions,\n mode = 'default',\n\n // collapsible props\n defaultOpen = true,\n open: openProp,\n onOpenChange: onOpenChangeProp,\n\n ...rest\n}: Props) => {\n const isControlled = openProp !== undefined;\n\n const [innerOpen, setInnerOpen] = useState(defaultOpen);\n const open = isControlled ? openProp : innerOpen;\n const handleOpenChange = (nextOpen: boolean) => {\n if (!isControlled) {\n setInnerOpen(nextOpen);\n }\n onOpenChangeProp?.(nextOpen);\n };\n\n const isCollapsible = mode === 'collapsible' && !!title && !!children && !actions;\n\n if (isCollapsible)\n return (\n <Collapsible open={open} onOpenChange={handleOpenChange} asChild>\n <AlertRoot {...rest} variant={variant} className={className}>\n <Collapsible.Trigger\n className={cn(\n 'tailwindcss-preflight',\n 'tw:group',\n 'tw:col-span-full',\n 'tw:grid',\n 'tw:grid-cols-subgrid',\n 'tw:rounded-sm',\n 'tw:focus-visible:outline',\n 'tw:focus-visible:outline-2',\n 'tw:focus-visible:outline-ring',\n )}\n >\n {!hideIcon && <AlertIcon variant={variant} icon={icon} />}\n <AlertTitle>{title}</AlertTitle>\n <AlertCollapsibleIcon open={open} />\n </Collapsible.Trigger>\n\n <Collapsible.Content asChild>\n <AlertDescription>{children}</AlertDescription>\n </Collapsible.Content>\n </AlertRoot>\n </Collapsible>\n );\n\n return (\n <AlertRoot {...rest} variant={variant} className={className}>\n {!hideIcon && <AlertIcon variant={variant} icon={icon} />}\n {title && <AlertTitle>{title}</AlertTitle>}\n {children && <AlertDescription>{children}</AlertDescription>}\n {actions && <AlertAction>{actions}</AlertAction>}\n </AlertRoot>\n );\n};\n"],"mappings":";;;;;;;;;AASA,MAAa,eAAe,EAAE,KAAK,WAAW,UAAU,OAAO,GAAG,YAAmB;CAEnF,OACE,oBAFW,UAAU,OAAO,OAE5B;EACE,GAAI;EACC;EACL,WAAW,GACT,kBACA,kBACA,iBACA,WACA,YACA,SACF;CACD,CAAA;AAEL;;;ACjBA,MAAa,wBAAwB,EAAE,WACrC,oBAAC,SAAD;CAAS,WAAU;CAAM,SAAS,OAAO,mBAAmB;CAAgB,gBAAA;CAC1E,UAAA,oBAAC,aAAD,EACE,WAAW,GACT,YACA,aACA,uBACA,+CAGA,gEACA,yFACA,sEACA,+FACA,kEACA,iGACA,oEACA,6FACF,EACD,CAAA;AACM,CAAA;;;ACtBX,MAAa,oBAAoB,EAAE,KAAK,UAAU,WAAW,GAAG,WAC9D,oBAAC,OAAD;CACE,GAAI;CACC;CACL,WAAW,G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AAS,WAAW;CACtD,MAAM,OAAO,eAAe,WAAW;CACvC,MAAM,oBAAoB,aAAsB;EAC9C,IAAI,CAAC,cACH,aAAa,QAAQ;EAEvB,mBAAmB,QAAQ;CAC7B;CAIA,IAFsB,SAAS,iBAAiB,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,SAGxE,OACE,oBAAC,aAAD;EAAmB;EAAM,cAAc;EAAkB,SAAA;EACvD,UAAA,qBAAC,WAAD;GAAW,GAAI;GAAe;GAAoB;GAAlD,UAAA,CACE,qBAAC,YAAY,SAAb;IACE,WAAW,GACT,yBACA,YACA,oBACA,WACA,wBACA,iBACA,4BACA,8BACA,+BACF;IAXF,UAAA;KAaG,CAAC,YAAY,oBAAC,WAAD;MAAoB;MAAe;KAAO,CAAA;KACxD,oBAAC,YAAD,EAAA,UAAa,MAAkB,CAAA;KAC/B,oBAAC,sBAAD,EAA4B,KAAO,CAAA;IAChB;GAErB,CAAA,GAAA,oBAAC,YAAY,SAAb;IAAqB,SAAA;IACnB,UAAA,oBAAC,kBAAD,EAAmB,SAA2B,CAAA;GAC3B,CAAA,CACZ;;CACA,CAAA;CAGjB,OACE,qBAAC,WAAD;EAAW,GAAI;EAAe;EAAoB;EAAlD,UAAA;GACG,CAAC,YAAY,oBAAC,WAAD;IAAoB;IAAe;GAAO,CAAA;GACvD,SAAS,oBAAC,YAAD,EAAA,UAAa,MAAkB,CAAA;GACxC,YAAY,oBAAC,kBAAD,EAAmB,SAA2B,CAAA;GAC1D,WAAW,oBAAC,aAAD,EAAA,UAAc,QAAqB,CAAA;EACtC;;AAEf"}
@@ -1,7 +1,7 @@
1
1
  import { cn } from "./classNames-BzrkDnOD.js";
2
- import { useArgoDesign } from "./context-BrNtMc1H.js";
2
+ import { useArgoDesign } from "./context-D7X470dy.js";
3
3
  import { AlertTriangle, CircleCheck, Info } from "./icons-Cek151jC.js";
4
- import { Button } from "./Button-CPsEQuTN.js";
4
+ import { Button } from "./Button-DsRrU5F1.js";
5
5
  import { createContext, use, useCallback, useEffect, useMemo, useRef, useState } from "react";
6
6
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
7
  import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
@@ -216,4 +216,4 @@ AlertModal.Content = AlertModalContent;
216
216
  //#endregion
217
217
  export { AlertModal };
218
218
 
219
- //# sourceMappingURL=AlertModal-DQAGpsEy.js.map
219
+ //# sourceMappingURL=AlertModal-BGJdaRRj.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AlertModal-DQAGpsEy.js","names":[],"sources":["../src/components/AlertModal/AlertModalDescription.tsx","../src/components/AlertModal/AlertModalFooter.tsx","../src/components/AlertModal/AlertModalHeader.tsx","../src/components/AlertModal/AlertModalIcon.tsx","../src/components/AlertModal/AlertModalOverlay.tsx","../src/components/AlertModal/AlertModalTitle.tsx","../src/components/AlertModal/context.ts","../src/components/AlertModal/AlertModalContent.tsx","../src/components/AlertModal/AlertModalTrigger.tsx","../src/components/AlertModal/AlertModal.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<typeof AlertDialogPrimitive.Description>;\n\nexport const AlertModalDescription = ({ className, ...props }: Props) => (\n <AlertDialogPrimitive.Description\n className={cn(\n 'tw:font-sans',\n 'tw:tracking-normal',\n 'tw:font-normal',\n 'tw:text-muted-foreground',\n\n 'tw:group-data-[design=default]/alert-modal:text-foreground',\n 'tw:group-data-[design=default]/alert-modal:text-sm',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentPropsWithRef } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<'div'>;\n\nexport const AlertModalFooter = ({ className, ...props }: Props) => (\n <div\n className={cn(\n 'tw:flex',\n 'tw:gap-2',\n\n 'tw:group-data-[design=default]/alert-modal:flex-col',\n 'tw:group-data-[design=default]/alert-modal:sm:flex-row',\n\n 'tw:group-data-[design=argo]/alert-modal:justify-end',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentPropsWithRef } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<'div'>;\n\nexport const AlertModalHeader = ({ className, ...props }: Props) => (\n <div\n className={cn(\n 'tw:grid',\n 'tw:grid-cols-[auto_1fr]',\n 'tw:items-start',\n 'tw:gap-y-1',\n\n // default (legacy) needs more breathing room below the title's separator border\n 'tw:group-data-[design=default]/alert-modal:gap-y-4',\n 'tw:group-data-[design=argo]/alert-modal:gap-x-3',\n className,\n )}\n {...props}\n />\n);\n","import type { ReactNode } from 'react';\n\nimport { AlertTriangle, CircleCheck, Info } from '../../icons';\nimport { cn } from '../../utils';\n\nimport type { AlertModalVariant } from './variant';\n\nconst VARIANT_ICONS: Record<AlertModalVariant, ReactNode> = {\n info: <Info />,\n warning: <AlertTriangle />,\n danger: <AlertTriangle />,\n success: <CircleCheck />,\n};\n\ntype Props = {\n variant: AlertModalVariant;\n icon?: ReactNode;\n};\n\nexport const AlertModalIcon = ({ variant, icon }: Props) => {\n const glyph = icon ?? VARIANT_ICONS[variant];\n\n return (\n <>\n {/* Default design language: floating circular badge (Modal-style). Hidden in argo. */}\n <div\n data-slot=\"alert-modal-icon\"\n className={cn(\n 'tw:group-data-[design=argo]/alert-modal:hidden',\n 'tw:absolute',\n 'tw:top-0',\n 'tw:left-8',\n 'tw:translate-y-[-50%]',\n 'tw:size-12',\n )}\n >\n <div\n className={cn('tw:relative', 'tw:rounded-full', 'tw:size-12', {\n 'tw:bg-blue-500': variant === 'info',\n 'tw:bg-warning-500': variant === 'warning',\n 'tw:bg-error-500': variant === 'danger',\n 'tw:bg-green-500': variant === 'success',\n })}\n >\n <span\n className={cn(\n 'tw:absolute',\n 'tw:inset-0',\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:text-white',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-6',\n 'tw:[&_svg]:aspect-square',\n )}\n >\n {glyph}\n </span>\n </div>\n </div>\n\n {/* Argo design language: inline tinted badge (Badge \"*-inverse\" pattern). Hidden in default. */}\n <span\n data-slot=\"alert-modal-icon\"\n className={cn(\n 'tw:hidden',\n 'tw:group-data-[design=argo]/alert-modal:inline-flex',\n // grid placement: column 1 of the first row, top-aligned with the first line of content\n 'tw:col-start-1',\n 'tw:row-start-1',\n 'tw:self-start',\n 'tw:shrink-0',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:rounded',\n 'tw:size-8',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-5',\n {\n 'tw:bg-blue-100 tw:text-blue-600': variant === 'info',\n 'tw:bg-warning-100 tw:text-warning-500': variant === 'warning',\n 'tw:bg-error-100 tw:text-error-500': variant === 'danger',\n 'tw:bg-green-100 tw:text-green-900': variant === 'success',\n },\n )}\n >\n {glyph}\n </span>\n </>\n );\n};\n","import type { ComponentPropsWithRef } from 'react';\nimport { Overlay } from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<typeof Overlay>;\n\nexport const AlertModalOverlay = ({ ref, className, ...props }: Props) => (\n <Overlay\n {...props}\n ref={ref}\n className={cn(\n // positioning\n 'tw:fixed',\n 'tw:inset-0',\n 'tw:z-[1051]',\n\n // background\n 'tw:bg-black/50',\n\n // opening animation\n 'tw:data-[state=open]:duration-500',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=open]:animate-in',\n\n // closing animation\n 'tw:data-[state=closed]:duration-500',\n 'tw:data-[state=closed]:fade-out-0',\n 'tw:data-[state=closed]:animate-out',\n\n className,\n )}\n />\n);\n","import type { ComponentPropsWithRef } from 'react';\nimport { Title } from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<typeof Title>;\n\nexport const AlertModalTitle = ({ children, className, ...props }: Props) => (\n <Title\n {...props}\n asChild\n className={cn(\n 'tw:font-medium',\n 'tw:text-foreground',\n 'tw:break-anywhere',\n\n // default (legacy) gets a Modal-style separator line under the title (Modal uses border-neutral-150)\n 'tw:group-data-[design=default]/alert-modal:border-b',\n 'tw:group-data-[design=default]/alert-modal:border-neutral-150',\n 'tw:group-data-[design=default]/alert-modal:pb-3',\n className,\n )}\n >\n <h3>{children}</h3>\n </Title>\n);\n","import { createContext, use } from 'react';\nimport type { MouseEvent } from 'react';\n\ntype AlertModalContextType = {\n isLoading: boolean;\n onConfirm: (event: MouseEvent<HTMLButtonElement>) => void;\n onCancel: (event: MouseEvent<HTMLButtonElement>) => void;\n};\n\nconst AlertModalContext = createContext<AlertModalContextType | null>(null);\n\nexport const AlertModalContextProvider = AlertModalContext.Provider;\n\nexport const useAlertModalContext = (): AlertModalContextType => {\n const context = use(AlertModalContext);\n if (context === null)\n throw new Error('AlertModal compound components must be rendered inside <AlertModal>.');\n return context;\n};\n","import type { ComponentProps, ReactNode } from 'react';\nimport { Action, Cancel, Content, Portal } from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { AlertModalDescription } from './AlertModalDescription';\nimport { AlertModalFooter } from './AlertModalFooter';\nimport { AlertModalHeader } from './AlertModalHeader';\nimport { AlertModalIcon } from './AlertModalIcon';\nimport { AlertModalOverlay } from './AlertModalOverlay';\nimport { AlertModalTitle } from './AlertModalTitle';\nimport { useAlertModalContext } from './context';\nimport type { AlertModalVariant } from './variant';\n\ntype Props = {\n variant?: AlertModalVariant;\n icon?: ReactNode;\n title?: ReactNode;\n cancelLabel?: ReactNode;\n confirmLabel?: ReactNode;\n /** Blocks the confirm action while a host-tracked precondition is unmet. Cancel stays available. */\n confirmDisabled?: boolean;\n container?: ComponentProps<typeof Portal>['container'];\n} & Omit<ComponentProps<typeof Content>, 'title'>;\n\nexport const AlertModalContent = ({\n variant = 'info',\n icon,\n title,\n cancelLabel = 'Cancel',\n confirmLabel: actionLabel = 'Confirm',\n confirmDisabled = false,\n container,\n className,\n children,\n onEscapeKeyDown,\n ...props\n}: Props) => {\n const { isLoading, onConfirm, onCancel } = useAlertModalContext();\n const designLanguage = useArgoDesign() ? 'argo' : 'default';\n\n const handleEscapeKeyDown: ComponentProps<typeof Content>['onEscapeKeyDown'] = (event) => {\n // Stop propagation so a parent Modal/Sheet doesn't also close when this is a nested confirmation.\n event.stopPropagation();\n // Lock dismissal while the action is running.\n if (isLoading) event.preventDefault();\n onEscapeKeyDown?.(event);\n };\n\n return (\n <Portal container={container}>\n <AlertModalOverlay\n // Stop propagation at the overlay (common ancestor of backdrop + content):\n // - without it, clicks/Enter inside the modal also fire handlers on the host that rendered\n // <AlertModal> (e.g. a clickable row, or an editor that opens a code block on Enter)\n // - portaling the content does not prevent this\n // - Escape is exempt so Radix can still close on Esc\n onClick={(event) => event.stopPropagation()}\n onKeyDown={(event) => {\n if (event.key !== 'Escape') event.stopPropagation();\n }}\n >\n <Content\n data-design={designLanguage}\n // Radix auto-links `aria-describedby` to `<AlertModalDescription>`. With no description\n // (no children) it warns about the missing link — suppress it like Modal/Sheet do.\n {...(children ? {} : { 'aria-describedby': undefined })}\n onEscapeKeyDown={handleEscapeKeyDown}\n className={cn(\n 'tailwindcss-preflight',\n 'tw:group/alert-modal',\n 'tw:text-base',\n\n // positioning - horizontally centered; vertical anchor depends on the design language\n 'tw:fixed',\n 'tw:left-1/2',\n 'tw:-translate-x-1/2',\n 'tw:z-[1051]',\n 'tw:data-[design=default]:top-20',\n 'tw:data-[design=argo]:top-1/2',\n 'tw:data-[design=argo]:-translate-y-1/2',\n\n // sizing - compact alert width\n 'tw:w-full',\n 'tw:max-w-[480px]',\n 'tw:max-h-[calc(100vh-2*theme(spacing.20))]',\n 'tw:data-[design=argo]:overflow-y-auto',\n\n // layout: stack the header and footer (each owns its own internal layout)\n 'tw:flex',\n 'tw:flex-col',\n 'tw:gap-4',\n\n 'tw:data-[design=default]:rounded-lg',\n 'tw:data-[design=argo]:rounded-3xl',\n 'tw:bg-popover',\n 'tw:text-popover-foreground',\n\n 'tw:data-[design=default]:px-7',\n 'tw:data-[design=default]:py-8',\n 'tw:data-[design=argo]:p-4',\n\n // animation — shared\n 'tw:duration-200',\n 'tw:data-[state=open]:animate-in',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=closed]:animate-out',\n 'tw:data-[state=closed]:fade-out-0',\n\n // default design: Modal-style slide-down + zoom. No `slide-*-left-1/2`: under v4 the\n // x-centring lives on the `translate` PROPERTY (it persists through the transform-based\n // animation), so an enter `-50%` would stack on it (= -100%) and fly in from the left.\n 'tw:data-[design=default]:data-[state=open]:zoom-in-80',\n 'tw:data-[design=default]:data-[state=open]:slide-in-from-top-[48%]',\n 'tw:data-[design=default]:data-[state=closed]:zoom-out-80',\n 'tw:data-[design=default]:data-[state=closed]:slide-out-to-top-[48%]',\n\n // argo design: pop from the centre — zoom only (centring persists on the translate property)\n 'tw:data-[design=argo]:data-[state=open]:zoom-in-95',\n 'tw:data-[design=argo]:data-[state=closed]:zoom-out-95',\n\n className,\n )}\n {...props}\n >\n <AlertModalHeader>\n <AlertModalIcon variant={variant} icon={icon} />\n\n {title && (\n <AlertModalTitle className=\"tw:col-start-2 tw:row-start-1 tw:self-center\">\n {title}\n </AlertModalTitle>\n )}\n\n {children && (\n <AlertModalDescription\n className={cn(\n 'tw:col-start-2',\n title ? 'tw:row-start-2' : 'tw:row-start-1 tw:self-center',\n )}\n >\n {children}\n </AlertModalDescription>\n )}\n </AlertModalHeader>\n\n <AlertModalFooter>\n <Cancel asChild>\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={isLoading}\n onClick={onCancel}\n className=\"tw:group-data-[design=default]/alert-modal:flex-1\"\n >\n {cancelLabel}\n </Button>\n </Cancel>\n\n <Action asChild>\n <Button\n type=\"button\"\n variant={variant === 'danger' ? 'danger' : 'primary'}\n isLoading={isLoading}\n disabled={isLoading || confirmDisabled}\n onClick={onConfirm}\n className=\"tw:group-data-[design=default]/alert-modal:flex-1\"\n >\n {actionLabel}\n </Button>\n </Action>\n </AlertModalFooter>\n </Content>\n </AlertModalOverlay>\n </Portal>\n );\n};\n","import type { ComponentPropsWithRef } from 'react';\nimport { Trigger } from '@radix-ui/react-alert-dialog';\n\ntype Props = ComponentPropsWithRef<typeof Trigger>;\n\nexport const AlertModalTrigger = ({ ref, onClick, onKeyDown, ...props }: Props) => (\n <Trigger\n {...props}\n ref={ref}\n onClick={(event) => {\n // The trigger sits in the normal DOM tree, often inside a clickable row/card. Stop the\n // open-click from bubbling to that ancestor's onClick. (Radix still opens the modal —\n // stopPropagation only blocks ancestors, not the open handler on the same element.)\n event.stopPropagation();\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n // Only the activation keys open the modal and would leak; stop just those so Tab/arrows/etc.\n // still reach ancestor keyboard handlers. The button still activates (stopPropagation only\n // blocks ancestors).\n if (event.key === 'Enter' || event.key === ' ') event.stopPropagation();\n onKeyDown?.(event);\n }}\n />\n);\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { ComponentProps, MouseEvent } from 'react';\nimport { Root } from '@radix-ui/react-alert-dialog';\n\nimport { AlertModalContent } from './AlertModalContent';\nimport { AlertModalTrigger } from './AlertModalTrigger';\nimport { AlertModalContextProvider } from './context';\n\nconst noop = () => undefined;\n\ntype ConfirmHandler = (event: MouseEvent<HTMLButtonElement>) => void | Promise<unknown>;\ntype CancelHandler = (event: MouseEvent<HTMLButtonElement>) => void;\n\ntype Props = {\n onConfirm?: ConfirmHandler;\n onCancel?: CancelHandler;\n skipAsyncWait?: boolean;\n /** Marks the confirm action busy from the outside, on top of the state inferred from a thenable `onConfirm`. */\n isLoading?: boolean;\n} & ComponentProps<typeof Root>;\n\nexport const AlertModal = ({\n children,\n onConfirm = noop,\n onCancel = noop,\n skipAsyncWait = false,\n isLoading = false,\n open,\n defaultOpen,\n onOpenChange,\n ...rest\n}: Props) => {\n const [isConfirming, setIsConfirming] = useState(false);\n\n // Controllable open state: when `open` is provided the parent owns it; otherwise we keep our own.\n const isControlled = open !== undefined;\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);\n const isOpen = isControlled ? open : uncontrolledOpen;\n\n const confirmRef = useRef(onConfirm);\n const cancelRef = useRef(onCancel);\n const onOpenChangeRef = useRef(onOpenChange);\n\n // Latest-ref pattern: keep the handlers out of `context`'s deps so its identity stays stable,\n // without writing to refs during render (synced in an effect, before any handler can fire).\n useEffect(() => {\n confirmRef.current = onConfirm;\n cancelRef.current = onCancel;\n onOpenChangeRef.current = onOpenChange;\n }, [onConfirm, onCancel, onOpenChange]);\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) setUncontrolledOpen(next);\n onOpenChangeRef.current?.(next);\n },\n [isControlled],\n );\n\n const context = useMemo(\n () => ({\n // The two sources of \"the confirm action is running\" converge here, so every consumer\n // downstream reads one answer regardless of which way the host drives it.\n isLoading: isConfirming || isLoading,\n onConfirm: (event: MouseEvent<HTMLButtonElement>) => {\n const result = confirmRef.current(event);\n\n // Treat any thenable as async, not just native promises.\n const isThenable =\n result !== null && typeof result === 'object' && typeof result.then === 'function';\n if (!isThenable || skipAsyncWait) return;\n\n // The async confirm's outcome drives the modal.\n // - `preventDefault` stops the click closing it, so it stays up while the action runs.\n // - Resolved closes it; rejected leaves it up so the failure stays visible.\n // - The rejection is deliberately not caught — the host's global handler reports it.\n event.preventDefault();\n setIsConfirming(true);\n Promise.resolve(result)\n .then(() => setOpen(false))\n .finally(() => setIsConfirming(false));\n },\n onCancel: (event: MouseEvent<HTMLButtonElement>) => {\n cancelRef.current(event);\n },\n }),\n [isConfirming, isLoading, skipAsyncWait, setOpen],\n );\n\n return (\n <Root {...rest} open={isOpen} onOpenChange={setOpen}>\n <AlertModalContextProvider value={context}>{children}</AlertModalContextProvider>\n </Root>\n );\n};\n\nAlertModal.Trigger = AlertModalTrigger;\nAlertModal.Content = AlertModalContent;\n"],"mappings":";;;;;;;;;AAOA,MAAa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lertModalDescription.tsx","../src/components/AlertModal/AlertModalFooter.tsx","../src/components/AlertModal/AlertModalHeader.tsx","../src/components/AlertModal/AlertModalIcon.tsx","../src/components/AlertModal/AlertModalOverlay.tsx","../src/components/AlertModal/AlertModalTitle.tsx","../src/components/AlertModal/context.ts","../src/components/AlertModal/AlertModalContent.tsx","../src/components/AlertModal/AlertModalTrigger.tsx","../src/components/AlertModal/AlertModal.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<typeof AlertDialogPrimitive.Description>;\n\nexport const AlertModalDescription = ({ className, ...props }: Props) => (\n <AlertDialogPrimitive.Description\n className={cn(\n 'tw:font-sans',\n 'tw:tracking-normal',\n 'tw:font-normal',\n 'tw:text-muted-foreground',\n\n 'tw:group-data-[design=default]/alert-modal:text-foreground',\n 'tw:group-data-[design=default]/alert-modal:text-sm',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentPropsWithRef } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<'div'>;\n\nexport const AlertModalFooter = ({ className, ...props }: Props) => (\n <div\n className={cn(\n 'tw:flex',\n 'tw:gap-2',\n\n 'tw:group-data-[design=default]/alert-modal:flex-col',\n 'tw:group-data-[design=default]/alert-modal:sm:flex-row',\n\n 'tw:group-data-[design=argo]/alert-modal:justify-end',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentPropsWithRef } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<'div'>;\n\nexport const AlertModalHeader = ({ className, ...props }: Props) => (\n <div\n className={cn(\n 'tw:grid',\n 'tw:grid-cols-[auto_1fr]',\n 'tw:items-start',\n 'tw:gap-y-1',\n\n // default (legacy) needs more breathing room below the title's separator border\n 'tw:group-data-[design=default]/alert-modal:gap-y-4',\n 'tw:group-data-[design=argo]/alert-modal:gap-x-3',\n className,\n )}\n {...props}\n />\n);\n","import type { ReactNode } from 'react';\n\nimport { AlertTriangle, CircleCheck, Info } from '../../icons';\nimport { cn } from '../../utils';\n\nimport type { AlertModalVariant } from './variant';\n\nconst VARIANT_ICONS: Record<AlertModalVariant, ReactNode> = {\n info: <Info />,\n warning: <AlertTriangle />,\n danger: <AlertTriangle />,\n success: <CircleCheck />,\n};\n\ntype Props = {\n variant: AlertModalVariant;\n icon?: ReactNode;\n};\n\nexport const AlertModalIcon = ({ variant, icon }: Props) => {\n const glyph = icon ?? VARIANT_ICONS[variant];\n\n return (\n <>\n {/* Default design language: floating circular badge (Modal-style). Hidden in argo. */}\n <div\n data-slot=\"alert-modal-icon\"\n className={cn(\n 'tw:group-data-[design=argo]/alert-modal:hidden',\n 'tw:absolute',\n 'tw:top-0',\n 'tw:left-8',\n 'tw:translate-y-[-50%]',\n 'tw:size-12',\n )}\n >\n <div\n className={cn('tw:relative', 'tw:rounded-full', 'tw:size-12', {\n 'tw:bg-blue-500': variant === 'info',\n 'tw:bg-warning-500': variant === 'warning',\n 'tw:bg-error-500': variant === 'danger',\n 'tw:bg-green-500': variant === 'success',\n })}\n >\n <span\n className={cn(\n 'tw:absolute',\n 'tw:inset-0',\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:text-white',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-6',\n 'tw:[&_svg]:aspect-square',\n )}\n >\n {glyph}\n </span>\n </div>\n </div>\n\n {/* Argo design language: inline tinted badge (Badge \"*-inverse\" pattern). Hidden in default. */}\n <span\n data-slot=\"alert-modal-icon\"\n className={cn(\n 'tw:hidden',\n 'tw:group-data-[design=argo]/alert-modal:inline-flex',\n // grid placement: column 1 of the first row, top-aligned with the first line of content\n 'tw:col-start-1',\n 'tw:row-start-1',\n 'tw:self-start',\n 'tw:shrink-0',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:rounded',\n 'tw:size-8',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-5',\n {\n 'tw:bg-blue-100 tw:text-blue-600': variant === 'info',\n 'tw:bg-warning-100 tw:text-warning-500': variant === 'warning',\n 'tw:bg-error-100 tw:text-error-500': variant === 'danger',\n 'tw:bg-green-100 tw:text-green-900': variant === 'success',\n },\n )}\n >\n {glyph}\n </span>\n </>\n );\n};\n","import type { ComponentPropsWithRef } from 'react';\nimport { Overlay } from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<typeof Overlay>;\n\nexport const AlertModalOverlay = ({ ref, className, ...props }: Props) => (\n <Overlay\n {...props}\n ref={ref}\n className={cn(\n // positioning\n 'tw:fixed',\n 'tw:inset-0',\n 'tw:z-[1051]',\n\n // background\n 'tw:bg-black/50',\n\n // opening animation\n 'tw:data-[state=open]:duration-500',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=open]:animate-in',\n\n // closing animation\n 'tw:data-[state=closed]:duration-500',\n 'tw:data-[state=closed]:fade-out-0',\n 'tw:data-[state=closed]:animate-out',\n\n className,\n )}\n />\n);\n","import type { ComponentPropsWithRef } from 'react';\nimport { Title } from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<typeof Title>;\n\nexport const AlertModalTitle = ({ children, className, ...props }: Props) => (\n <Title\n {...props}\n asChild\n className={cn(\n 'tw:font-medium',\n 'tw:text-foreground',\n 'tw:break-anywhere',\n\n // default (legacy) gets a Modal-style separator line under the title (Modal uses border-neutral-150)\n 'tw:group-data-[design=default]/alert-modal:border-b',\n 'tw:group-data-[design=default]/alert-modal:border-neutral-150',\n 'tw:group-data-[design=default]/alert-modal:pb-3',\n className,\n )}\n >\n <h3>{children}</h3>\n </Title>\n);\n","import { createContext, use } from 'react';\nimport type { MouseEvent } from 'react';\n\ntype AlertModalContextType = {\n isLoading: boolean;\n onConfirm: (event: MouseEvent<HTMLButtonElement>) => void;\n onCancel: (event: MouseEvent<HTMLButtonElement>) => void;\n};\n\nconst AlertModalContext = createContext<AlertModalContextType | null>(null);\n\nexport const AlertModalContextProvider = AlertModalContext.Provider;\n\nexport const useAlertModalContext = (): AlertModalContextType => {\n const context = use(AlertModalContext);\n if (context === null)\n throw new Error('AlertModal compound components must be rendered inside <AlertModal>.');\n return context;\n};\n","import type { ComponentProps, ReactNode } from 'react';\nimport { Action, Cancel, Content, Portal } from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { AlertModalDescription } from './AlertModalDescription';\nimport { AlertModalFooter } from './AlertModalFooter';\nimport { AlertModalHeader } from './AlertModalHeader';\nimport { AlertModalIcon } from './AlertModalIcon';\nimport { AlertModalOverlay } from './AlertModalOverlay';\nimport { AlertModalTitle } from './AlertModalTitle';\nimport { useAlertModalContext } from './context';\nimport type { AlertModalVariant } from './variant';\n\ntype Props = {\n variant?: AlertModalVariant;\n icon?: ReactNode;\n title?: ReactNode;\n cancelLabel?: ReactNode;\n confirmLabel?: ReactNode;\n /** Blocks the confirm action while a host-tracked precondition is unmet. Cancel stays available. */\n confirmDisabled?: boolean;\n container?: ComponentProps<typeof Portal>['container'];\n} & Omit<ComponentProps<typeof Content>, 'title'>;\n\nexport const AlertModalContent = ({\n variant = 'info',\n icon,\n title,\n cancelLabel = 'Cancel',\n confirmLabel: actionLabel = 'Confirm',\n confirmDisabled = false,\n container,\n className,\n children,\n onEscapeKeyDown,\n ...props\n}: Props) => {\n const { isLoading, onConfirm, onCancel } = useAlertModalContext();\n const designLanguage = useArgoDesign() ? 'argo' : 'default';\n\n const handleEscapeKeyDown: ComponentProps<typeof Content>['onEscapeKeyDown'] = (event) => {\n // Stop propagation so a parent Modal/Sheet doesn't also close when this is a nested confirmation.\n event.stopPropagation();\n // Lock dismissal while the action is running.\n if (isLoading) event.preventDefault();\n onEscapeKeyDown?.(event);\n };\n\n return (\n <Portal container={container}>\n <AlertModalOverlay\n // Stop propagation at the overlay (common ancestor of backdrop + content):\n // - without it, clicks/Enter inside the modal also fire handlers on the host that rendered\n // <AlertModal> (e.g. a clickable row, or an editor that opens a code block on Enter)\n // - portaling the content does not prevent this\n // - Escape is exempt so Radix can still close on Esc\n onClick={(event) => event.stopPropagation()}\n onKeyDown={(event) => {\n if (event.key !== 'Escape') event.stopPropagation();\n }}\n >\n <Content\n data-design={designLanguage}\n // Radix auto-links `aria-describedby` to `<AlertModalDescription>`. With no description\n // (no children) it warns about the missing link — suppress it like Modal/Sheet do.\n {...(children ? {} : { 'aria-describedby': undefined })}\n onEscapeKeyDown={handleEscapeKeyDown}\n className={cn(\n 'tailwindcss-preflight',\n 'tw:group/alert-modal',\n 'tw:text-base',\n\n // positioning - horizontally centered; vertical anchor depends on the design language\n 'tw:fixed',\n 'tw:left-1/2',\n 'tw:-translate-x-1/2',\n 'tw:z-[1051]',\n 'tw:data-[design=default]:top-20',\n 'tw:data-[design=argo]:top-1/2',\n 'tw:data-[design=argo]:-translate-y-1/2',\n\n // sizing - compact alert width\n 'tw:w-full',\n 'tw:max-w-[480px]',\n 'tw:max-h-[calc(100vh-2*theme(spacing.20))]',\n 'tw:data-[design=argo]:overflow-y-auto',\n\n // layout: stack the header and footer (each owns its own internal layout)\n 'tw:flex',\n 'tw:flex-col',\n 'tw:gap-4',\n\n 'tw:data-[design=default]:rounded-lg',\n 'tw:data-[design=argo]:rounded-3xl',\n 'tw:bg-popover',\n 'tw:text-popover-foreground',\n\n 'tw:data-[design=default]:px-7',\n 'tw:data-[design=default]:py-8',\n 'tw:data-[design=argo]:p-4',\n\n // animation — shared\n 'tw:duration-200',\n 'tw:data-[state=open]:animate-in',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=closed]:animate-out',\n 'tw:data-[state=closed]:fade-out-0',\n\n // default design: Modal-style slide-down + zoom. No `slide-*-left-1/2`: under v4 the\n // x-centring lives on the `translate` PROPERTY (it persists through the transform-based\n // animation), so an enter `-50%` would stack on it (= -100%) and fly in from the left.\n 'tw:data-[design=default]:data-[state=open]:zoom-in-80',\n 'tw:data-[design=default]:data-[state=open]:slide-in-from-top-[48%]',\n 'tw:data-[design=default]:data-[state=closed]:zoom-out-80',\n 'tw:data-[design=default]:data-[state=closed]:slide-out-to-top-[48%]',\n\n // argo design: pop from the centre — zoom only (centring persists on the translate property)\n 'tw:data-[design=argo]:data-[state=open]:zoom-in-95',\n 'tw:data-[design=argo]:data-[state=closed]:zoom-out-95',\n\n className,\n )}\n {...props}\n >\n <AlertModalHeader>\n <AlertModalIcon variant={variant} icon={icon} />\n\n {title && (\n <AlertModalTitle className=\"tw:col-start-2 tw:row-start-1 tw:self-center\">\n {title}\n </AlertModalTitle>\n )}\n\n {children && (\n <AlertModalDescription\n className={cn(\n 'tw:col-start-2',\n title ? 'tw:row-start-2' : 'tw:row-start-1 tw:self-center',\n )}\n >\n {children}\n </AlertModalDescription>\n )}\n </AlertModalHeader>\n\n <AlertModalFooter>\n <Cancel asChild>\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={isLoading}\n onClick={onCancel}\n className=\"tw:group-data-[design=default]/alert-modal:flex-1\"\n >\n {cancelLabel}\n </Button>\n </Cancel>\n\n <Action asChild>\n <Button\n type=\"button\"\n variant={variant === 'danger' ? 'danger' : 'primary'}\n isLoading={isLoading}\n disabled={isLoading || confirmDisabled}\n onClick={onConfirm}\n className=\"tw:group-data-[design=default]/alert-modal:flex-1\"\n >\n {actionLabel}\n </Button>\n </Action>\n </AlertModalFooter>\n </Content>\n </AlertModalOverlay>\n </Portal>\n );\n};\n","import type { ComponentPropsWithRef } from 'react';\nimport { Trigger } from '@radix-ui/react-alert-dialog';\n\ntype Props = ComponentPropsWithRef<typeof Trigger>;\n\nexport const AlertModalTrigger = ({ ref, onClick, onKeyDown, ...props }: Props) => (\n <Trigger\n {...props}\n ref={ref}\n onClick={(event) => {\n // The trigger sits in the normal DOM tree, often inside a clickable row/card. Stop the\n // open-click from bubbling to that ancestor's onClick. (Radix still opens the modal —\n // stopPropagation only blocks ancestors, not the open handler on the same element.)\n event.stopPropagation();\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n // Only the activation keys open the modal and would leak; stop just those so Tab/arrows/etc.\n // still reach ancestor keyboard handlers. The button still activates (stopPropagation only\n // blocks ancestors).\n if (event.key === 'Enter' || event.key === ' ') event.stopPropagation();\n onKeyDown?.(event);\n }}\n />\n);\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { ComponentProps, MouseEvent } from 'react';\nimport { Root } from '@radix-ui/react-alert-dialog';\n\nimport { AlertModalContent } from './AlertModalContent';\nimport { AlertModalTrigger } from './AlertModalTrigger';\nimport { AlertModalContextProvider } from './context';\n\nconst noop = () => undefined;\n\ntype ConfirmHandler = (event: MouseEvent<HTMLButtonElement>) => void | Promise<unknown>;\ntype CancelHandler = (event: MouseEvent<HTMLButtonElement>) => void;\n\ntype Props = {\n onConfirm?: ConfirmHandler;\n onCancel?: CancelHandler;\n skipAsyncWait?: boolean;\n /** Marks the confirm action busy from the outside, on top of the state inferred from a thenable `onConfirm`. */\n isLoading?: boolean;\n} & ComponentProps<typeof Root>;\n\nexport const AlertModal = ({\n children,\n onConfirm = noop,\n onCancel = noop,\n skipAsyncWait = false,\n isLoading = false,\n open,\n defaultOpen,\n onOpenChange,\n ...rest\n}: Props) => {\n const [isConfirming, setIsConfirming] = useState(false);\n\n // Controllable open state: when `open` is provided the parent owns it; otherwise we keep our own.\n const isControlled = open !== undefined;\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);\n const isOpen = isControlled ? open : uncontrolledOpen;\n\n const confirmRef = useRef(onConfirm);\n const cancelRef = useRef(onCancel);\n const onOpenChangeRef = useRef(onOpenChange);\n\n // Latest-ref pattern: keep the handlers out of `context`'s deps so its identity stays stable,\n // without writing to refs during render (synced in an effect, before any handler can fire).\n useEffect(() => {\n confirmRef.current = onConfirm;\n cancelRef.current = onCancel;\n onOpenChangeRef.current = onOpenChange;\n }, [onConfirm, onCancel, onOpenChange]);\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) setUncontrolledOpen(next);\n onOpenChangeRef.current?.(next);\n },\n [isControlled],\n );\n\n const context = useMemo(\n () => ({\n // The two sources of \"the confirm action is running\" converge here, so every consumer\n // downstream reads one answer regardless of which way the host drives it.\n isLoading: isConfirming || isLoading,\n onConfirm: (event: MouseEvent<HTMLButtonElement>) => {\n const result = confirmRef.current(event);\n\n // Treat any thenable as async, not just native promises.\n const isThenable =\n result !== null && typeof result === 'object' && typeof result.then === 'function';\n if (!isThenable || skipAsyncWait) return;\n\n // The async confirm's outcome drives the modal.\n // - `preventDefault` stops the click closing it, so it stays up while the action runs.\n // - Resolved closes it; rejected leaves it up so the failure stays visible.\n // - The rejection is deliberately not caught — the host's global handler reports it.\n event.preventDefault();\n setIsConfirming(true);\n Promise.resolve(result)\n .then(() => setOpen(false))\n .finally(() => setIsConfirming(false));\n },\n onCancel: (event: MouseEvent<HTMLButtonElement>) => {\n cancelRef.current(event);\n },\n }),\n [isConfirming, isLoading, skipAsyncWait, setOpen],\n );\n\n return (\n <Root {...rest} open={isOpen} onOpenChange={setOpen}>\n <AlertModalContextProvider value={context}>{children}</AlertModalContextProvider>\n </Root>\n );\n};\n\nAlertModal.Trigger = AlertModalTrigger;\nAlertModal.Content = AlertModalContent;\n"],"mappings":";;;;;;;;;AAOA,MAAa,yBAAyB,EAAE,WAAW,GAAG,YACpD,oBAAC,qBAAqB,aAAtB;CACE,WAAW,GACT,gBACA,sBACA,kBACA,4BAEA,8DACA,sDACA,SACF;CACA,GAAI;AACL,CAAA;;;ACdH,MAAa,oBAAoB,EAAE,WAAW,GAAG,YAC/C,oBAAC,OAAD;CACE,WAAW,GACT,WACA,YAEA,uDACA,0DAEA,uDACA,SACF;CACA,GAAI;AACL,CAAA;;;ACbH,MAAa,oBAAoB,EAAE,WAAW,GAAG,YAC/C,oBAAC,OAAD;CACE,WAAW,GACT,WACA,2BACA,kBACA,cAGA,sDACA,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;EACpB,gBAAgB,UAAU;CAC5B,GAAG;EAAC;EAAW;EAAU;CAAY,CAAC;CAEtC,MAAM,UAAU,aACb,SAAkB;EACjB,IAAI,CAAC,cAAc,oBAAoB,IAAI;EAC3C,gBAAgB,UAAU,IAAI;CAChC,GACA,CAAC,YAAY,CACf;CAEA,MAAM,UAAU,eACP;EAGL,WAAW,gBAAgB;EAC3B,YAAY,UAAyC;GACnD,MAAM,SAAS,WAAW,QAAQ,KAAK;GAKvC,IAAI,EADF,WAAW,QAAQ,OAAO,WAAW,YAAY,OAAO,OAAO,SAAS,eACvD,eAAe;GAMlC,MAAM,eAAe;GACrB,gBAAgB,IAAI;GACpB,QAAQ,QAAQ,MAAM,CAAC,CACpB,WAAW,QAAQ,KAAK,CAAC,CAAC,CAC1B,cAAc,gBAAgB,KAAK,CAAC;EACzC;EACA,WAAW,UAAyC;GAClD,UAAU,QAAQ,KAAK;EACzB;CACF,IACA;EAAC;EAAc;EAAW;EAAe;CAAO,CAClD;CAEA,OACE,oBAAC,MAAD;EAAM,GAAI;EAAM,MAAM;EAAQ,cAAc;EAC1C,UAAA,oBAAC,2BAAD;GAA2B,OAAO;GAAU;EAAoC,CAAA;CAC5E,CAAA;AAEV;AAEA,WAAW,UAAU;AACrB,WAAW,UAAU"}
@@ -1,5 +1,5 @@
1
1
  import { cn } from "./classNames-BzrkDnOD.js";
2
- import { useTheme } from "./context-BrNtMc1H.js";
2
+ import { useTheme } from "./context-D7X470dy.js";
3
3
  import { Slot, Slottable } from "@radix-ui/react-slot";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/blocks/AppShell/SidebarShell.tsx
@@ -159,4 +159,4 @@ const AppShell = Object.assign(Root$1, {
159
159
  //#endregion
160
160
  export { AppShell, appShellSlotSelector };
161
161
 
162
- //# sourceMappingURL=AppShell-BUoxM3fv.js.map
162
+ //# sourceMappingURL=AppShell-DRgJxpXW.js.map