@keboola/design 11.0.1 → 11.3.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 (243) hide show
  1. package/AGENTS.md +41 -15
  2. package/CHANGELOG.md +2392 -0
  3. package/COMPONENT-API.md +41 -2
  4. package/dist/{AIKit-Dre37SJr.js → AIKit-DaFT7p92.js} +23 -22
  5. package/dist/AIKit-DaFT7p92.js.map +1 -0
  6. package/dist/{Alert-DfZq9kGe.js → Alert-CseY3yAj.js} +3 -3
  7. package/dist/{Alert-DfZq9kGe.js.map → Alert-CseY3yAj.js.map} +1 -1
  8. package/dist/{AlertModal-BUC4Es8o.js → AlertModal-DQAGpsEy.js} +4 -7
  9. package/dist/{AlertModal-BUC4Es8o.js.map → AlertModal-DQAGpsEy.js.map} +1 -1
  10. package/dist/{AppShell-B5GQN6Zs.js → AppShell-BUoxM3fv.js} +29 -10
  11. package/dist/AppShell-BUoxM3fv.js.map +1 -0
  12. package/dist/{BrandEditor-B8o9zdZO.js → BrandEditor-BnTLMRMp.js} +6 -6
  13. package/dist/{BrandEditor-B8o9zdZO.js.map → BrandEditor-BnTLMRMp.js.map} +1 -1
  14. package/dist/{BrandLogo-CJkRd0F8.js → BrandLogo-V2pRUAeO.js} +2 -2
  15. package/dist/{BrandLogo-CJkRd0F8.js.map → BrandLogo-V2pRUAeO.js.map} +1 -1
  16. package/dist/{Breadcrumb-DJp7WwSv.js → Breadcrumb-CQTPn_KB.js} +3 -3
  17. package/dist/{Breadcrumb-DJp7WwSv.js.map → Breadcrumb-CQTPn_KB.js.map} +1 -1
  18. package/dist/{Button-nzmDNS2q.js → Button-CPsEQuTN.js} +16 -16
  19. package/dist/Button-CPsEQuTN.js.map +1 -0
  20. package/dist/{Card-BAoZ35CV.js → Card-Cd5HSBmv.js} +2 -2
  21. package/dist/{Card-BAoZ35CV.js.map → Card-Cd5HSBmv.js.map} +1 -1
  22. package/dist/{Checkbox-GJ8-srt4.js → Checkbox-5VNCcV7E.js} +3 -3
  23. package/dist/{Checkbox-GJ8-srt4.js.map → Checkbox-5VNCcV7E.js.map} +1 -1
  24. package/dist/{Clipboard-CBJZiviP.js → Clipboard-B7rckqV_.js} +2 -2
  25. package/dist/{Clipboard-CBJZiviP.js.map → Clipboard-B7rckqV_.js.map} +1 -1
  26. package/dist/{ClipboardButton-ez5V3fkk.js → ClipboardButton-CQ6Aewpg.js} +3 -3
  27. package/dist/{ClipboardButton-ez5V3fkk.js.map → ClipboardButton-CQ6Aewpg.js.map} +1 -1
  28. package/dist/{CodeEditor-BfQJfbhL.js → CodeEditor-CUse8znx.js} +290 -100
  29. package/dist/CodeEditor-CUse8znx.js.map +1 -0
  30. package/dist/{ColorInput-Dx8Dsv7Y.js → ColorInput-Q1D9Vcc_.js} +3 -3
  31. package/dist/{ColorInput-Dx8Dsv7Y.js.map → ColorInput-Q1D9Vcc_.js.map} +1 -1
  32. package/dist/{ColorModeSwitch-CCqj7tjE.js → ColorModeSwitch-B5PXCVqB.js} +3 -3
  33. package/dist/{ColorModeSwitch-CCqj7tjE.js.map → ColorModeSwitch-B5PXCVqB.js.map} +1 -1
  34. package/dist/{Combobox-c_xBjf0P.js → Combobox-CyoRA7oY.js} +12 -8
  35. package/dist/Combobox-CyoRA7oY.js.map +1 -0
  36. package/dist/{Command-CQ_bQsJp.js → Command-Ds68v2rX.js} +3 -3
  37. package/dist/{Command-CQ_bQsJp.js.map → Command-Ds68v2rX.js.map} +1 -1
  38. package/dist/{CopyField-BJ96zvXs.js → CopyField-DI66uY_g.js} +2 -2
  39. package/dist/{CopyField-BJ96zvXs.js.map → CopyField-DI66uY_g.js.map} +1 -1
  40. package/dist/{DateInput-CMD3dY-T.js → DateInput-BPj2pzsn.js} +4 -4
  41. package/dist/{DateInput-CMD3dY-T.js.map → DateInput-BPj2pzsn.js.map} +1 -1
  42. package/dist/{DatePicker-BbFbmsGl.js → DatePicker-DyEGuW9m.js} +2 -2
  43. package/dist/{DatePicker-BbFbmsGl.js.map → DatePicker-DyEGuW9m.js.map} +1 -1
  44. package/dist/{DateRangeInput-D3BhiKyk.js → DateRangeInput-u9DxNbHW.js} +4 -4
  45. package/dist/{DateRangeInput-D3BhiKyk.js.map → DateRangeInput-u9DxNbHW.js.map} +1 -1
  46. package/dist/{DateRangePicker-BiUgtt_M.js → DateRangePicker-CYYhX6S7.js} +6 -6
  47. package/dist/{DateRangePicker-BiUgtt_M.js.map → DateRangePicker-CYYhX6S7.js.map} +1 -1
  48. package/dist/{DropdownMenu-B6ZbYvaM.js → DropdownMenu-DpMEcyCq.js} +9 -9
  49. package/dist/DropdownMenu-DpMEcyCq.js.map +1 -0
  50. package/dist/FieldItem-qQKGU9lF.js +108 -0
  51. package/dist/FieldItem-qQKGU9lF.js.map +1 -0
  52. package/dist/FieldItem-vhIJW4pj.d.ts +103 -0
  53. package/dist/{FileUpload-sXRv7JiY.js → FileUpload-C336MVnU.js} +2 -2
  54. package/dist/{FileUpload-sXRv7JiY.js.map → FileUpload-C336MVnU.js.map} +1 -1
  55. package/dist/{Form-BDCef6O9.js → Form-CTygENDc.js} +21 -81
  56. package/dist/{Form-BDCef6O9.js.map → Form-CTygENDc.js.map} +1 -1
  57. package/dist/{FormGroup-S9mPNHKH.js → FormGroup-BnwP0jNu.js} +7 -7
  58. package/dist/FormGroup-BnwP0jNu.js.map +1 -0
  59. package/dist/{FullScreenModal-CJa2VkJ2.js → FullScreenModal-j-M4aPFd.js} +3 -3
  60. package/dist/{FullScreenModal-CJa2VkJ2.js.map → FullScreenModal-j-M4aPFd.js.map} +1 -1
  61. package/dist/{HoverCard-WfDkLK1s.js → HoverCard-yQq-O49c.js} +2 -2
  62. package/dist/{HoverCard-WfDkLK1s.js.map → HoverCard-yQq-O49c.js.map} +1 -1
  63. package/dist/{InputGroup-BJWsI35s.js → InputGroup-D7zlmqPB.js} +3 -3
  64. package/dist/{InputGroup-BJWsI35s.js.map → InputGroup-D7zlmqPB.js.map} +1 -1
  65. package/dist/{Kbd-CxHAo1oo.js → Kbd-D6LpR7G2.js} +2 -2
  66. package/dist/{Kbd-CxHAo1oo.js.map → Kbd-D6LpR7G2.js.map} +1 -1
  67. package/dist/{MermaidDiagram-BB06gymm.js → MermaidDiagram-JlvuGcY-.js} +6 -87
  68. package/dist/MermaidDiagram-JlvuGcY-.js.map +1 -0
  69. package/dist/{Modal-BA5Wc3sx.js → Modal-o4ATIexE.js} +3 -3
  70. package/dist/{Modal-BA5Wc3sx.js.map → Modal-o4ATIexE.js.map} +1 -1
  71. package/dist/{MultiActionButtonGroup-CiBHxsSk.js → MultiActionButtonGroup-GTeFk-L8.js} +3 -3
  72. package/dist/{MultiActionButtonGroup-CiBHxsSk.js.map → MultiActionButtonGroup-GTeFk-L8.js.map} +1 -1
  73. package/dist/{Navbar-t16usFZQ.js → Navbar-CAQs4BZz.js} +6 -3
  74. package/dist/Navbar-CAQs4BZz.js.map +1 -0
  75. package/dist/{PageToolbar-0_1OBzaZ.js → PageToolbar-bG2YtSa3.js} +4 -4
  76. package/dist/PageToolbar-bG2YtSa3.js.map +1 -0
  77. package/dist/{Pagination-CM_Rszz-.js → Pagination-BB3X7ooY.js} +2 -2
  78. package/dist/{Pagination-CM_Rszz-.js.map → Pagination-BB3X7ooY.js.map} +1 -1
  79. package/dist/{Popconfirm-BGe1jLov.js → Popconfirm-C2Ky5hJO.js} +4 -7
  80. package/dist/{Popconfirm-BGe1jLov.js.map → Popconfirm-C2Ky5hJO.js.map} +1 -1
  81. package/dist/{Popover-Ca0V6AD1.js → Popover-DsbI2HKu.js} +7 -14
  82. package/dist/Popover-DsbI2HKu.js.map +1 -0
  83. package/dist/{RadioGroup-sIveSsNa.js → RadioGroup-BMxuZEbT.js} +3 -3
  84. package/dist/{RadioGroup-sIveSsNa.js.map → RadioGroup-BMxuZEbT.js.map} +1 -1
  85. package/dist/{Search-3UiqNZRj.js → Search-DFeECt5D.js} +2 -2
  86. package/dist/{Search-3UiqNZRj.js.map → Search-DFeECt5D.js.map} +1 -1
  87. package/dist/{SearchInput-D2fcOv7E.js → SearchInput-CCpdUego.js} +3 -3
  88. package/dist/{SearchInput-D2fcOv7E.js.map → SearchInput-CCpdUego.js.map} +1 -1
  89. package/dist/{SectionNav--7bw2b6u.js → SectionNav-Bw_MVL0_.js} +4 -4
  90. package/dist/{SectionNav--7bw2b6u.js.map → SectionNav-Bw_MVL0_.js.map} +1 -1
  91. package/dist/{Select-4YX38G5h.js → Select-D6IZVvwL.js} +5 -5
  92. package/dist/Select-D6IZVvwL.js.map +1 -0
  93. package/dist/{Sheet-BQrX8-h5.js → Sheet-BIzs2K2H.js} +3 -3
  94. package/dist/{Sheet-BQrX8-h5.js.map → Sheet-BIzs2K2H.js.map} +1 -1
  95. package/dist/{Sidebar-ROaR_AqC.js → Sidebar-r1TW4g_b.js} +5 -5
  96. package/dist/{Sidebar-ROaR_AqC.js.map → Sidebar-r1TW4g_b.js.map} +1 -1
  97. package/dist/{Slider-Da_3mS5v.js → Slider-CjxyfEty.js} +3 -3
  98. package/dist/{Slider-Da_3mS5v.js.map → Slider-CjxyfEty.js.map} +1 -1
  99. package/dist/{Switch-CX2A0v50.js → Switch-BueTV03C.js} +2 -2
  100. package/dist/{Switch-CX2A0v50.js.map → Switch-BueTV03C.js.map} +1 -1
  101. package/dist/{Tabs-EAihyqCt.js → Tabs-l72-WuhK.js} +2 -2
  102. package/dist/{Tabs-EAihyqCt.js.map → Tabs-l72-WuhK.js.map} +1 -1
  103. package/dist/{TextInput-BGed-V13.js → TextInput-DhdRk8qm.js} +3 -3
  104. package/dist/{TextInput-BGed-V13.js.map → TextInput-DhdRk8qm.js.map} +1 -1
  105. package/dist/{ThemeProvider-QncUrfJn.js → ThemeProvider-DZfGdf1v.js} +5 -4
  106. package/dist/{ThemeProvider-QncUrfJn.js.map → ThemeProvider-DZfGdf1v.js.map} +1 -1
  107. package/dist/{TimePicker-B_NegL-7.js → TimePicker-B6d2rAbX.js} +2 -2
  108. package/dist/{TimePicker-B_NegL-7.js.map → TimePicker-B6d2rAbX.js.map} +1 -1
  109. package/dist/{Toast-DQSbs3oA.js → Toast-CxXUulYN.js} +2 -2
  110. package/dist/{Toast-DQSbs3oA.js.map → Toast-CxXUulYN.js.map} +1 -1
  111. package/dist/{ZoomableSvg-DG9PnAm8.js → ZoomableSvg-CNIzRHKH.js} +4 -4
  112. package/dist/{ZoomableSvg-DG9PnAm8.js.map → ZoomableSvg-CNIzRHKH.js.map} +1 -1
  113. package/dist/{context-KxxeMHbR.js → context-BrNtMc1H.js} +3 -33
  114. package/dist/context-BrNtMc1H.js.map +1 -0
  115. package/dist/defaults-CTfvj2KB.js +34 -0
  116. package/dist/defaults-CTfvj2KB.js.map +1 -0
  117. package/dist/editors.d.ts +81 -9
  118. package/dist/editors.js +75 -12
  119. package/dist/editors.js.map +1 -1
  120. package/dist/flint.d.ts +15 -0
  121. package/dist/flint.js +212 -0
  122. package/dist/flint.js.map +1 -0
  123. package/dist/index.d.ts +361 -317
  124. package/dist/index.js +60 -57
  125. package/dist/internal/blocks/AIKit.js +1 -1
  126. package/dist/internal/blocks/AppShell.js +2 -2
  127. package/dist/internal/blocks/BrandEditor.js +1 -1
  128. package/dist/internal/blocks/ChartPanel.js +1 -1
  129. package/dist/internal/blocks/ClipboardButton.js +1 -1
  130. package/dist/internal/blocks/ColorInput.js +1 -1
  131. package/dist/internal/blocks/ColorModeSwitch.js +1 -1
  132. package/dist/internal/blocks/Command.js +1 -1
  133. package/dist/internal/blocks/CopyField.js +1 -1
  134. package/dist/internal/blocks/DateInput.js +1 -1
  135. package/dist/internal/blocks/DateRangeInput.js +1 -1
  136. package/dist/{DiagramSkeleton-lwBS2YBa.js → internal/blocks/DiagramShared/DiagramSkeleton.js} +3 -3
  137. package/dist/internal/blocks/DiagramShared/DiagramSkeleton.js.map +1 -0
  138. package/dist/internal/blocks/EmptyConfigurationActionCard.js +1 -1
  139. package/dist/internal/blocks/ErrorState.js +1 -1
  140. package/dist/internal/blocks/ExportMenu.js +3 -3
  141. package/dist/internal/blocks/Form/connectors/MultiComboboxField.js +56 -0
  142. package/dist/internal/blocks/Form/connectors/MultiComboboxField.js.map +1 -0
  143. package/dist/internal/blocks/Form.js +1 -1
  144. package/dist/internal/blocks/FormGroup.js +1 -1
  145. package/dist/internal/blocks/MultiActionButtonGroup.js +1 -1
  146. package/dist/internal/blocks/MultiCombobox.js +10 -4
  147. package/dist/internal/blocks/MultiCombobox.js.map +1 -1
  148. package/dist/internal/blocks/NumberInput.js +1 -1
  149. package/dist/internal/blocks/PageToolbar.js +1 -1
  150. package/dist/internal/blocks/PasswordInput.js +2 -2
  151. package/dist/internal/blocks/SearchInput.js +1 -1
  152. package/dist/internal/blocks/SearchInputWithNavigation.js +3 -3
  153. package/dist/internal/blocks/SectionNav.js +1 -1
  154. package/dist/internal/blocks/SplitButton.js +2 -2
  155. package/dist/internal/blocks/StatCard.js +1 -1
  156. package/dist/internal/blocks/TextInput.js +1 -1
  157. package/dist/internal/blocks/Textarea.js +1 -1
  158. package/dist/internal/blocks/TimeInput.js +3 -3
  159. package/dist/internal/components/Alert.js +1 -1
  160. package/dist/internal/components/AlertModal.js +1 -1
  161. package/dist/internal/components/Avatar.js +1 -1
  162. package/dist/internal/components/BrandLogo.js +1 -1
  163. package/dist/internal/components/Breadcrumb.js +1 -1
  164. package/dist/internal/components/Button.js +1 -1
  165. package/dist/internal/components/Card.js +1 -1
  166. package/dist/internal/components/Checkbox.js +1 -1
  167. package/dist/internal/components/Clipboard.js +1 -1
  168. package/dist/internal/components/CollapsiblePanel.js +1 -1
  169. package/dist/internal/components/Combobox.js +1 -1
  170. package/dist/internal/components/DatePicker.js +1 -1
  171. package/dist/internal/components/DateRangePicker.js +1 -1
  172. package/dist/internal/components/DropdownMenu.js +1 -1
  173. package/dist/internal/components/FileUpload.js +1 -1
  174. package/dist/internal/components/FullScreenModal.js +1 -1
  175. package/dist/internal/components/HoverCard.js +1 -1
  176. package/dist/internal/components/InputGroup.js +1 -1
  177. package/dist/internal/components/Kbd.js +1 -1
  178. package/dist/internal/components/Modal.js +1 -1
  179. package/dist/internal/components/Navbar.js +1 -1
  180. package/dist/internal/components/Pagination.js +1 -1
  181. package/dist/internal/components/Popconfirm.js +1 -1
  182. package/dist/internal/components/Popover.js +1 -1
  183. package/dist/internal/components/RadioGroup.js +1 -1
  184. package/dist/internal/components/Search.js +1 -1
  185. package/dist/internal/components/Select.js +1 -1
  186. package/dist/internal/components/Sheet.js +1 -1
  187. package/dist/internal/components/Sidebar.js +1 -1
  188. package/dist/internal/components/Slider.js +1 -1
  189. package/dist/internal/components/Switch.js +1 -1
  190. package/dist/internal/components/Tabs.js +1 -1
  191. package/dist/internal/components/ThemeProvider.js +3 -2
  192. package/dist/internal/components/TimePicker.js +1 -1
  193. package/dist/internal/components/Toast.js +2 -2
  194. package/dist/internal/components/Tooltip.js +1 -1
  195. package/dist/internal/components/Truncated.js +16 -8
  196. package/dist/internal/components/Truncated.js.map +1 -1
  197. package/dist/internal/components/ZoomableSvg.js +1 -1
  198. package/dist/internal/utils.js +1 -1
  199. package/dist/markdown-editor.js +7 -7
  200. package/dist/mermaid.js +1 -1
  201. package/dist/rjsf.d.ts +13 -1
  202. package/dist/rjsf.js +237 -177
  203. package/dist/rjsf.js.map +1 -1
  204. package/dist/{styles-DSUP_-9Z.js → styles-BAFscjSV.js} +4 -3
  205. package/dist/styles-BAFscjSV.js.map +1 -0
  206. package/dist/styles.css +1 -1
  207. package/dist/svgTransforms-C9njt92h.js +89 -0
  208. package/dist/svgTransforms-C9njt92h.js.map +1 -0
  209. package/dist/testing.js +3 -2
  210. package/dist/testing.js.map +1 -1
  211. package/dist/{themeTokens-BNg98Mu9.js → themeTokens-7T1AFLhq.js} +13 -6
  212. package/dist/{themeTokens-BNg98Mu9.js.map → themeTokens-7T1AFLhq.js.map} +1 -1
  213. package/dist/{toast-CjkURw0M.js → toast-BweSoKn3.js} +3 -3
  214. package/dist/toast-BweSoKn3.js.map +1 -0
  215. package/dist/types-BPcAjMG0.d.ts +10 -0
  216. package/dist/{useColorSchemeState-CYqcUfSH.js → useColorSchemeState-BJEk6esG.js} +2 -2
  217. package/dist/{useColorSchemeState-CYqcUfSH.js.map → useColorSchemeState-BJEk6esG.js.map} +1 -1
  218. package/dist/{utils-D0c5VAyF.js → utils-B-g7d_Jb.js} +2 -2
  219. package/dist/{utils-D0c5VAyF.js.map → utils-B-g7d_Jb.js.map} +1 -1
  220. package/dist/vega.d.ts +46 -0
  221. package/dist/vega.js +26 -0
  222. package/dist/vega.js.map +1 -0
  223. package/dist/vegaTheme-FBXgAdHK.js +146 -0
  224. package/dist/vegaTheme-FBXgAdHK.js.map +1 -0
  225. package/package.json +29 -9
  226. package/src/styles.css +27 -4
  227. package/dist/AIKit-Dre37SJr.js.map +0 -1
  228. package/dist/AppShell-B5GQN6Zs.js.map +0 -1
  229. package/dist/Button-nzmDNS2q.js.map +0 -1
  230. package/dist/CodeEditor-BfQJfbhL.js.map +0 -1
  231. package/dist/Combobox-c_xBjf0P.js.map +0 -1
  232. package/dist/DiagramSkeleton-lwBS2YBa.js.map +0 -1
  233. package/dist/DropdownMenu-B6ZbYvaM.js.map +0 -1
  234. package/dist/FormGroup-S9mPNHKH.js.map +0 -1
  235. package/dist/MermaidDiagram-BB06gymm.js.map +0 -1
  236. package/dist/Navbar-t16usFZQ.js.map +0 -1
  237. package/dist/PageToolbar-0_1OBzaZ.js.map +0 -1
  238. package/dist/Popover-Ca0V6AD1.js.map +0 -1
  239. package/dist/Select-4YX38G5h.js.map +0 -1
  240. package/dist/constants-D6JcsD4_.d.ts +0 -41
  241. package/dist/context-KxxeMHbR.js.map +0 -1
  242. package/dist/styles-DSUP_-9Z.js.map +0 -1
  243. package/dist/toast-CjkURw0M.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"AppShell-B5GQN6Zs.js","names":["Root"],"sources":["../src/blocks/AppShell/SidebarShell.tsx","../src/blocks/AppShell/TopNavShell.tsx","../src/blocks/AppShell/AppShell.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\nimport type { AppShellHeaderSpan } from './types';\n\n// Required, not defaulted: `AppShell` owns the default so the generated component\n// API reports it, and this shell is internal — nothing else constructs it.\ntype Props = ComponentProps<'div'> & { headerSpan: AppShellHeaderSpan };\n\n/**\n * Sidebar geometry: left-rail navigation + header row + main outlet, with an\n * optional right rail. The grid template names match the `[grid-area:*]`\n * utilities the `AppShell.*` slots write onto themselves, so slot placement\n * is independent of source order.\n *\n * `headerSpan` picks which of the two row templates applies — see\n * {@link AppShellHeaderSpan}. Both keep the same three columns, so the rails\n * line up either way.\n */\nexport const SidebarShell = ({ ref, className, headerSpan, children, ...props }: Props) => (\n <div\n ref={ref}\n data-app-shell-geometry=\"sidebar\"\n data-header-span={headerSpan}\n className={cn(\n 'tw:relative tw:grid tw:h-svh tw:w-full tw:bg-background',\n 'tw:grid-cols-[auto_1fr_auto] tw:grid-rows-[auto_1fr]',\n headerSpan === 'full'\n ? cn(\n 'tw:[grid-template-areas:\"header_header_header\"_\"sidebar_main_aside\"]',\n // `Sidebar`'s inner wrapper is `fixed inset-y-0` — it owns that for its\n // collapse/resize animation — so it anchors to the viewport and paints\n // over a full-width header. Promoting the rail slots to containing\n // blocks re-anchors those fixed children to the slot's own grid box.\n // Beats overriding `top`: no `!important` to out-specify `inset-y-0`,\n // and the shell never needs to know the header's height.\n 'tw:[&>[data-app-shell-slot=sidebar]]:[transform:translateZ(0)]',\n 'tw:[&>[data-app-shell-slot=aside]]:[transform:translateZ(0)]',\n // A containing block is also a stacking context, so the promotion traps\n // the rail's own `z-50` inside the slot. The left rail sits before `main`\n // in source order, so without a slot-level z-index an expand-on-hover rail\n // paints *under* main's positioned content instead of over it. Restate it\n // here — grid items take `z-index` without `position`. The right rail needs\n // one too: source order only beats `z-index: auto` content, so main's\n // sticky elements (table headers at `z-10`, PageLayout's sticky header at\n // `z-20`) would paint over an aside left at `auto`. `z-30` clears them all\n // outright — no source-order tiebreak — while staying under the left\n // rail's `z-50`, keeping an expanding left rail above a filled right one.\n 'tw:[&>[data-app-shell-slot=sidebar]]:z-50',\n 'tw:[&>[data-app-shell-slot=aside]]:z-30',\n // The promotion is also what lets `styles.css` clip a parked off-canvas\n // rail: it makes the slot that panel's containing block.\n )\n : 'tw:[grid-template-areas:\"sidebar_header_aside\"_\"sidebar_main_aside\"]',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\n/**\n * Top-nav geometry: header row spans the full width, main + aside live below.\n * The `sidebar` grid area is intentionally absent — the\n * `[grid-area:sidebar]` slot collapses to `display: none` so consumers can\n * pass the same composition under either brand. Primary navigation moves\n * into `<AppShell.Header>` for top-nav-first compositions.\n *\n * Takes no `headerSpan`: this header already spans the full width, so `AppShell`\n * keeps the prop away from this shell rather than having it accept and ignore it.\n */\nexport const TopNavShell = ({ ref, className, children, ...props }: Props) => (\n <div\n ref={ref}\n data-app-shell-geometry=\"topnav\"\n className={cn(\n 'tw:grid tw:h-svh tw:w-full tw:bg-background',\n 'tw:grid-cols-[1fr_auto] tw:grid-rows-[auto_1fr]',\n 'tw:[grid-template-areas:\"header_header\"_\"main_aside\"]',\n // The sidebar slot has no place in this geometry — hide it without\n // forcing callers to conditionalise their JSX.\n 'tw:[&>[data-app-shell-slot=sidebar]]:hidden',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n);\n","import type { ComponentPropsWithoutRef, ComponentRef, Ref } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { useTheme } from '../../components/ThemeProvider';\nimport { cn } from '../../utils';\n\nimport { SidebarShell } from './SidebarShell';\nimport { TopNavShell } from './TopNavShell';\nimport type { AppShellHeaderSpan } from './types';\n\ntype RootProps = ComponentPropsWithoutRef<'div'> & {\n /**\n * How far the header row stretches. `content` (default) gives it the middle\n * column only, with both rails beside it; `full` spans all three columns and\n * drops the rails below it, so the brand mark aligns to the viewport edge.\n * No-op under the top-nav geometry, whose header is already full width.\n *\n * Reach for `full` when the header carries app-wide identity (brand mark,\n * project switcher, account menu) rather than page-level navigation.\n */\n headerSpan?: AppShellHeaderSpan;\n};\n\nconst Root = ({\n ref,\n className,\n // Defaulted here rather than in SidebarShell so the generated component API\n // records `content` instead of \"no default\".\n headerSpan = 'content',\n children,\n ...props\n}: RootProps & { ref?: Ref<ComponentRef<'div'>> }) => {\n const { currentTheme: brand } = useTheme();\n\n // Branch rather than pick a component and spread: `headerSpan` is meaningless\n // to the top-nav geometry, and forwarding it there would land a stray\n // `headerspan` attribute on the DOM node.\n if (brand.shell === 'topnav') {\n return (\n <TopNavShell ref={ref} className={className} {...props}>\n {children}\n </TopNavShell>\n );\n }\n\n return (\n <SidebarShell ref={ref} className={className} headerSpan={headerSpan} {...props}>\n {children}\n </SidebarShell>\n );\n};\n\ntype SlotProps = ComponentPropsWithoutRef<'div'> & {\n /** Render as the child element (Radix-Slot pattern), forwarding props onto it. */\n asChild?: boolean;\n};\n\ntype ChromeSlotProps = SlotProps & {\n /**\n * Drop the slot's own padding, background and border so a hosted chrome component\n * (`Navbar` in `Header`, `Sidebar side=\"right\"` in `Aside`) can render edge to edge.\n *\n * The slots paint themselves, which is right when you put content straight into them.\n * It is wrong when the child is already a full-bleed surface: the child ends up inset\n * inside the slot with the slot's background showing through as gutters at each end.\n * Use this instead of re-stating the overrides at the call site — hand-written\n * overrides also have to win a cascade fight, which is why they tend to grow an `!`.\n */\n flush?: boolean;\n};\n\nconst Header = ({\n ref,\n className,\n asChild,\n flush = false,\n children,\n ...props\n}: ChromeSlotProps & { ref?: Ref<ComponentRef<'header'>> }) => {\n const Comp = asChild ? Slot : 'header';\n return (\n <Comp\n ref={ref}\n data-app-shell-slot=\"header\"\n data-flush={flush || undefined}\n className={cn(\n 'tw:flex',\n flush\n ? 'tw:items-stretch tw:gap-0'\n : 'tw:items-center tw:gap-3 tw:border-b tw:border-border tw:bg-background tw:px-4',\n 'tw:[grid-area:header]',\n className,\n )}\n {...props}\n >\n {children}\n </Comp>\n );\n};\n\nconst SidebarSlot = ({\n ref,\n className,\n asChild,\n children,\n ...props\n}: SlotProps & { ref?: Ref<ComponentRef<'div'>> }) => {\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp\n ref={ref}\n data-app-shell-slot=\"sidebar\"\n // In a sidebar shell the children render in place. In a top-nav shell\n // the slot is hidden — the shell defines `display: none` for the\n // `sidebar` grid area in that geometry, so consumers can pass the\n // same JSX and let the shell decide visibility.\n className={cn('tw:flex tw:min-h-0 tw:flex-col', 'tw:[grid-area:sidebar]', className)}\n {...props}\n >\n {children}\n </Comp>\n );\n};\n\nconst Main = ({\n ref,\n className,\n asChild,\n children,\n ...props\n}: SlotProps & { ref?: Ref<ComponentRef<'main'>> }) => {\n const Comp = asChild ? Slot : 'main';\n return (\n <Comp\n ref={ref}\n data-app-shell-slot=\"main\"\n className={cn(\n 'tw:flex tw:min-w-0 tw:min-h-0 tw:flex-1 tw:flex-col tw:overflow-auto',\n // Opinionated default page gutter so page content clears the header /\n // rails and looks right out of the box. `cn` is tailwind-merge, so an\n // app that owns its own gutter overrides it (e.g. `className=\"tw:p-0\"`).\n 'tw:p-6',\n 'tw:[grid-area:main]',\n className,\n )}\n {...props}\n >\n {children}\n </Comp>\n );\n};\n\nconst Aside = ({\n ref,\n className,\n asChild,\n flush = false,\n children,\n ...props\n}: ChromeSlotProps & { ref?: Ref<ComponentRef<'aside'>> }) => {\n const Comp = asChild ? Slot : 'aside';\n return (\n <Comp\n ref={ref}\n data-app-shell-slot=\"aside\"\n data-flush={flush || undefined}\n className={cn(\n 'tw:flex tw:min-h-0 tw:shrink-0 tw:flex-col',\n // A hosted `Sidebar side=\"right\"` owns its own width, border, background and\n // scrolling — so the slot must not also set them, or the rail renders inset\n // inside a second painted surface.\n flush\n ? 'tw:w-auto tw:overflow-visible'\n : 'tw:w-72 tw:overflow-auto tw:border-l tw:border-border tw:bg-background',\n 'tw:[grid-area:aside]',\n className,\n )}\n {...props}\n >\n {children}\n </Comp>\n );\n};\n\n/**\n * App-shell layout primitive. Reads `useTheme().brand.shell` and dispatches to\n * a sidebar (left rail) or top-nav geometry. Consumers compose the same\n * `<AppShell.Header>` / `<AppShell.Sidebar>` / `<AppShell.Main>` /\n * `<AppShell.Aside>` slots — the shell decides where each slot lives based on\n * the active brand.\n *\n * **When to use:** the root layout of any app that wants to follow the active\n * brand's shell geometry. Host a `PageLayout` inside `<AppShell.Main>` for\n * the per-page content column. Pass `headerSpan=\"full\"` for a full-bleed header\n * row above both rails.\n * **When NOT to use:** standalone screens that aren't part of a navigated app\n * (sign-in, error pages). Render those without `AppShell`.\n * **Composition:** must be rendered inside a `<ThemeProvider>` — the geometry\n * is brand-driven. Pass the same content across brands; the shell handles\n * placement and shows/hides the `Sidebar` slot accordingly.\n *\n * @see AppShell.stories.tsx — flip the Storybook brand toolbar to see the\n * sidebar / top-nav geometry swap from a single composition.\n */\nexport const AppShell = Object.assign(Root, {\n /**\n * Top header row. Renders above `Main` in the sidebar shell; renders as the\n * top bar (with full-width navigation room) in the top-nav shell.\n */\n Header,\n /**\n * Left navigation rail. Rendered in the sidebar shell; hidden by the\n * top-nav shell so the same composition works under either brand — move\n * primary navigation into `Header` for top-nav-first compositions.\n */\n Sidebar: SidebarSlot,\n /**\n * Main content outlet. Applies an opinionated default page gutter (`tw:p-6`)\n * so content looks right out of the box; override the padding (e.g. `tw:p-0`)\n * when the app owns its own gutter.\n */\n Main,\n /** Optional right rail. Present in both shells. */\n Aside,\n});\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAa,gBAAgB,EAAE,KAAK,WAAW,YAAY,UAAU,GAAG,YACtE,oBAAC,OAAD;CACO;CACL,2BAAwB;CACxB,oBAAkB;CAClB,WAAW,GACT,2DACA,wDACA,eAAe,SACX,GACE,4EAOA,kEACA,gEAWA,6CACA,yCAGF,IACA,4EACJ,SACF;CACA,GAAI;CAEH;AACE,CAAA;;;;;;;;;;;;;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ACJ,wBACA,SACF;EACA,GAAI;EAEH;CACG,CAAA;AAEV;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,WAAW,OAAO,OAAOA,QAAM;;;;;CAK1C;;;;;;CAMA,SAAS;;;;;;CAMT;;CAEA;AACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button-nzmDNS2q.js","names":[],"sources":["../src/components/Button/styles.ts","../src/components/Button/Button.tsx","../src/components/Button/ButtonInline.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const variants = cva(\n [\n 'tailwindcss-preflight',\n 'tw:group/button',\n 'tw:border-box',\n\n // layout\n 'tw:relative',\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:gap-2',\n\n // text — chrome weight/tracking are brand-overridable tokens\n // (`--font-weight-medium` / `--letter-spacing-chrome`). Casing: standard case is\n // the default; only legacy brands (`keboola-legacy-*`) uppercase the chrome, so\n // modern brands (incl. Keboola V2) read naturally. Mirrors the V2 standard-case\n // treatment shipped for Tooltip/Badge (PR 7629).\n 'tw:text-xs',\n 'tw:leading-5',\n 'tw:font-medium',\n 'tw:[[data-brand^=keboola-legacy]_&]:tracking-chrome',\n 'tw:[[data-brand^=keboola-legacy]_&]:uppercase',\n\n // border — legacy (non-argo) chrome uses a fixed radius, not the brand token.\n 'tw:rounded',\n 'tw:border',\n 'tw:border-transparent',\n\n // styling\n 'tw:shadow-none',\n 'tw:[a]:cursor-pointer', // explicitly set for anchor\n\n 'tw:focus-visible:outline',\n 'tw:focus-visible:outline-1',\n 'tw:focus-visible:-outline-offset-1',\n 'tw:focus-visible:outline-ring',\n 'tw:focus-visible:ring-4',\n 'tw:focus-visible:ring-ring/30',\n\n // disabled\n 'tw:disabled:opacity-40',\n 'tw:disabled:cursor-not-allowed',\n\n // anchor support\n 'tw:!no-underline',\n 'tw:aria-disabled:opacity-40',\n 'tw:aria-disabled:cursor-not-allowed',\n\n 'tw:[&_svg]:shrink-0',\n ],\n {\n defaultVariants: {\n size: 'medium',\n variant: 'primary',\n block: false,\n },\n variants: {\n block: {\n true: ['tw:w-full'],\n },\n variant: {\n primary: [\n 'tw:text-white',\n 'tw:bg-primary-500',\n\n 'tw:focus:text-white',\n 'tw:hover:text-white',\n 'tw:hover:not-disabled:bg-primary-600',\n 'tw:active:not-disabled:bg-primary-800',\n\n // anchor disabled override\n 'tw:aria-disabled:!bg-primary-500',\n ],\n secondary: [\n 'tw:text-white',\n 'tw:bg-secondary-500',\n\n 'tw:focus:text-white',\n 'tw:hover:text-white',\n 'tw:hover:not-disabled:bg-secondary-700',\n 'tw:active:not-disabled:bg-secondary-800',\n\n // anchor disabled override\n 'tw:aria-disabled:!bg-secondary-500',\n ],\n danger: [\n 'tw:text-white',\n 'tw:bg-error-500',\n\n 'tw:focus:text-white',\n 'tw:hover:text-white',\n 'tw:hover:not-disabled:bg-error-600',\n 'tw:active:not-disabled:bg-error-700',\n\n // anchor disabled override\n 'tw:aria-disabled:!bg-error-500',\n ],\n // The label and the hover/active fills read tokens rather than the fixed\n // neutral scale, so the variant follows the active brand and colour scheme\n // (argo's `invisible` already did). A transparent button inherits whatever\n // surface it is dropped on, so it is the one legacy variant that cannot\n // assume a light page — pinning it forced every dark-scheme call site to\n // re-declare the colour by hand.\n invisible: [\n 'tw:text-foreground',\n 'tw:bg-transparent',\n\n 'tw:focus:text-foreground',\n 'tw:hover:not-disabled:bg-muted',\n 'tw:hover:text-foreground',\n 'tw:active:not-disabled:bg-secondary',\n\n // contrasting icon on hover/active\n 'tw:[&_svg]:text-neutral-400',\n 'tw:hover:not-disabled:[&_svg]:text-secondary-600',\n 'tw:active:not-disabled:[&_svg]:text-secondary-600',\n\n // anchor disabled override\n 'tw:aria-disabled:!bg-transparent',\n ],\n outline: [\n 'tw:text-neutral-800',\n 'tw:bg-white',\n // border\n 'tw:!border-neutral-200',\n 'tw:hover:text-neutral-800',\n 'tw:focus:text-neutral-800',\n 'tw:hover:not-disabled:!border-neutral-300',\n 'tw:hover:not-disabled:bg-neutral-100',\n 'tw:active:not-disabled:bg-neutral-200',\n\n // contrasting icon hover, same as invisible\n 'tw:[&_svg]:text-neutral-400',\n 'tw:not-disabled:hover:[&_svg]:text-secondary-600',\n 'tw:active:not-disabled:[&_svg]:text-secondary-600',\n\n // anchor disabled override\n 'tw:aria-disabled:!bg-white',\n 'tw:aria-disabled:!border-neutral-200',\n ],\n\n inline: [\n 'tw:text-neutral-800',\n 'tw:bg-transparent',\n 'tw:rounded-full',\n\n 'tw:[&_svg]:text-neutral-400',\n 'tw:not-disabled:hover:[&_svg]:text-secondary-600',\n 'tw:not-disabled:focus:[&_svg]:text-secondary-600',\n ],\n },\n size: {\n medium: [\n 'tw:max-h-10',\n 'tw:min-h-10',\n 'tw:px-4',\n 'tw:py-2.5',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4',\n ],\n small: [\n 'tw:max-h-8',\n 'tw:min-h-8',\n 'tw:px-4',\n 'tw:py-1.5',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4',\n ],\n large: [\n 'tw:max-h-12',\n 'tw:min-h-12',\n 'tw:px-4',\n 'tw:py-3.5',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4',\n ],\n\n 'icon-lg': ['tw:size-12', 'tw:p-0', 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-6'],\n icon: ['tw:size-10', 'tw:p-0', 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4'],\n 'icon-sm': ['tw:size-8', 'tw:p-0', 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4'],\n 'icon-xs': ['tw:size-6', 'tw:p-0', 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4'],\n 'icon-2xs': [\n 'tw:!inline-flex',\n 'tw:size-5',\n 'tw:max-h-5',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-3',\n ],\n 'icon-3xs': ['tw:h-fit', 'tw:w-fit', 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4'],\n },\n },\n },\n);\n\nexport const argoVariants = cva(\n [\n 'tailwindcss-preflight',\n\n // layout\n 'tw:relative',\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:whitespace-nowrap',\n 'tw:gap-2',\n\n // border\n 'tw:border',\n 'tw:border-transparent',\n 'tw:rounded-[var(--radius-lg,0.25rem)]',\n\n // text\n 'tw:font-medium',\n 'tw:select-none',\n\n // focus visible\n 'tw:!outline-hidden',\n 'tw:focus-visible:ring-2',\n\n // disabled\n 'tw:disabled:cursor-not-allowed',\n 'tw:disabled:opacity-50',\n 'tw:active:opacity-60',\n\n 'tw:transition-all',\n 'tw:bg-clip-padding',\n\n // anchor support\n 'tw:!no-underline',\n 'tw:aria-disabled:cursor-not-allowed',\n 'tw:aria-disabled:opacity-50',\n\n // icon\n 'tw:shrink-0',\n 'tw:[&_svg]:pointer-events-none',\n 'tw:[&_svg]:shrink-0',\n \"tw:[&_svg:not([class*='tw:size-'])]:size-4\",\n ],\n {\n defaultVariants: {\n variant: 'primary',\n size: 'medium',\n },\n variants: {\n block: {\n true: ['tw:w-full'],\n },\n variant: {\n primary: [\n 'tw:bg-primary',\n 'tw:text-primary-foreground',\n 'tw:[a]:hover:bg-primary/80',\n 'tw:hover:not-disabled:bg-primary/90',\n 'tw:hover:text-primary-foreground',\n 'tw:focus:text-primary-foreground',\n\n 'tw:focus-visible:border-primary',\n 'tw:focus-visible:ring-ring/50',\n ],\n secondary: [\n 'tw:bg-primary/10',\n 'tw:text-primary',\n 'tw:hover:not-disabled:bg-primary/20',\n\n 'tw:focus-visible:border-primary',\n 'tw:focus-visible:ring-ring/50',\n ],\n\n // should be called \"destructive\" by Figma\n danger: [\n 'tw:bg-destructive',\n 'tw:text-destructive-foreground',\n 'tw:hover:not-disabled:bg-destructive/90',\n 'tw:hover:text-destructive-foreground',\n 'tw:focus:text-destructive-foreground',\n\n 'tw:focus-visible:border-destructive',\n 'tw:focus-visible:ring-destructive/20',\n ],\n outline: [\n 'tw:!border-input',\n 'tw:bg-background',\n // Semantic base text color so the label/icon flips in dark mode\n // (matches `invisible`); previously unset → inherited a fixed dark color.\n 'tw:text-foreground',\n // Hover follows the brand primary (translucent tint), matching the\n // `secondary` variant — not the fixed `accent` blue.\n 'tw:hover:not-disabled:bg-primary/10',\n 'tw:hover:not-disabled:text-primary',\n 'tw:hover:active:bg-background',\n 'tw:focus-visible:!border-primary',\n 'tw:focus-visible:ring-ring/50',\n ],\n\n // should be called \"ghost\" by Figma\n invisible: [\n 'tw:bg-transparent',\n 'tw:text-foreground',\n 'tw:hover:not-disabled:bg-primary/10',\n 'tw:hover:not-disabled:text-primary',\n 'tw:hover:not-disabled:border-primary/10',\n\n 'tw:focus-visible:ring-ring/50',\n ],\n // should be called \"link\" by Figma\n inline: [\n 'tw:bg-transparent',\n 'tw:text-primary',\n 'tw:hover:underline',\n 'tw:hover:active:bg-transparent',\n 'tw:focus-visible:ring-ring/50',\n ],\n },\n size: {\n // should be called \"default\" by Figma\n medium: ['tw:max-h-9', 'tw:py-2', 'tw:px-4', 'tw:text-sm'],\n // should be called \"small\" by Figma\n small: ['tw:max-h-8', 'tw:py-2', 'tw:px-3', 'tw:text-xs'],\n // should be called \"large\" by Figma\n large: ['tw:max-h-10', 'tw:py-2.5', 'tw:px-6', 'tw:text-sm'],\n\n 'icon-lg': ['tw:size-10'],\n icon: ['tw:size-9'],\n 'icon-sm': ['tw:size-8'],\n 'icon-xs': ['tw:size-6'],\n // unsupported in ARGO, remove when old design is gone\n 'icon-2xs': [],\n 'icon-3xs': [],\n },\n },\n },\n);\n","import type { ComponentProps } from 'react';\nimport { Root, Slottable } from '@radix-ui/react-slot';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { Loader2 } from '../../icons';\nimport { cn } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { argoVariants, variants } from './styles';\n\n/**\n * Props for the `Button` component.\n *\n * Pass `variant` for primary/secondary/danger/outline/invisible looks, `size`\n * for height (including `icon-*` sizes when rendering icon-only). Icons are\n * composed as children — `<Button><Trash2 className=\"tw:size-4\" /> Delete</Button>`.\n */\ntype Props = {\n /** Replaces the leading content with a spinner and disables the button visually. The caller still controls `disabled`. */\n isLoading?: boolean;\n /** Render as a Radix `Slot` so the parent JSX (e.g. a `react-router` `<Link>`) becomes the button element. */\n asChild?: boolean;\n} & ComponentProps<'button'> &\n VariantProps<typeof variants>;\n\n/**\n * Primary action surface for the design system — covers all clickable controls except inline text links.\n *\n * **When to use:** any user-initiated action (submit, save, open modal, run job). Use `size=\"icon-*\"` with no\n * children for an icon-only button; there is no separate `IconButton` component.\n * **When NOT to use:** for inline text-link actions inside body copy use `ButtonInline`; for navigation that\n * opens a URL use `Link`; for \"primary action + dropdown of related actions\" use `SplitButton`.\n * **Composition:** wrap in `Tooltip` when icon-only or when disabled state needs an explanation; pair with\n * `Popconfirm` for destructive confirmations; pass through `Modal.Trigger` / `DropdownMenu.Trigger` via `asChild`.\n *\n * @see RECIPES.md#disabled-button-tooltip — for the disabled-button + tooltip pattern\n * @see RECIPES.md#confirm-dialog — for destructive-action confirmation\n */\nexport const Button = ({\n ref,\n children,\n disabled = false,\n className,\n type = 'button',\n isLoading = false,\n asChild = false,\n onClick,\n variant = 'primary',\n size = 'medium',\n block = false,\n ...buttonProps\n}: Props) => {\n const renderArgo = useArgoDesign();\n const Comp = asChild ? Root : 'button';\n const isIconOnly = String(size).startsWith('icon');\n const classNames = renderArgo\n ? argoVariants({ variant, size, block, className })\n : variants({ size, variant, block, className });\n\n const handleClick: ComponentProps<'button'>['onClick'] = (event) => {\n const isAnchor = event.currentTarget.tagName === 'A';\n\n // <a/> does not support disabled by default, and we cannot use pointer-events: none because cursor-not-allowed would not work.\n if (isAnchor && disabled) {\n event.preventDefault();\n return;\n }\n\n onClick?.(event);\n };\n\n return (\n <Comp\n {...buttonProps}\n ref={ref}\n disabled={disabled}\n aria-disabled={disabled}\n data-variant={variant}\n // `size=\"icon\"` / `size=\"icon-*\"` flags the button as icon-only — needed\n // by `ButtonGroup space=\"block\"` which stretches non-icon children to\n // equal width.\n data-icon-only={isIconOnly}\n type={type}\n onClick={handleClick}\n className={cn(classNames)}\n >\n {isLoading && <Loader2 className=\"tw:size-4 tw:shrink-0 tw:animate-spin\" />}\n <Slottable>{isLoading && isIconOnly ? null : children}</Slottable>\n </Comp>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Root } from '@radix-ui/react-slot';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cva } from 'class-variance-authority';\n\nconst buttonInlineVariants = cva(\n [\n 'tailwindcss-preflight',\n\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:gap-2',\n\n 'tw:underline-offset-2',\n\n 'tw:disabled:opacity-40',\n 'tw:disabled:cursor-not-allowed',\n 'tw:disabled:text-neutral-500',\n 'tw:disabled:no-underline',\n 'tw:disabled:[&_svg]:text-neutral-400',\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 {\n defaultVariants: {\n variant: 'link',\n color: 'link',\n },\n variants: {\n color: {\n link: ['tw:text-primary', 'tw:hover:text-primary/90', 'tw:[&_svg]:text-primary'],\n dark: ['tw:text-neutral-800 tw:[&_svg]:text-neutral-400'],\n danger: ['tw:text-error-500 tw:[&_svg]:text-error-500'],\n muted: ['tw:text-muted-foreground tw:[&_svg]:text-muted-foreground'],\n custom: [],\n },\n variant: {\n link: ['tw:underline', 'tw:hover:no-underline'],\n 'link-reverse': ['tw:no-underline', '', 'tw:hover:underline'],\n custom: [],\n },\n },\n },\n);\n\ntype Props = ComponentProps<'button'> &\n VariantProps<typeof buttonInlineVariants> & { asChild?: boolean };\n\nexport const ButtonInline = ({\n ref,\n children,\n className,\n variant,\n color,\n type = 'button',\n asChild = false,\n ...buttonProps\n}: Props) => {\n const Comp = asChild ? Root : 'button';\n\n return (\n <Comp\n {...buttonProps}\n ref={ref}\n type={asChild ? undefined : type}\n className={buttonInlineVariants({ variant, color, className })}\n >\n {children}\n </Comp>\n );\n};\n"],"mappings":";;;;;;;AAEA,MAAa,WAAW,IACtB;CACE;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CAOA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CAGA;CACA;CACA;CAEA;AACF,GACA;CACE,iBAAiB;EACf,MAAM;EACN,SAAS;EACT,OAAO;CACT;CACA,UAAU;EACR,OAAO,EACL,MAAM,CAAC,WAAW,EACpB;EACA,SAAS;GACP,SAAS;IACP;IACA;IAEA;IACA;IACA;IACA;IAGA;GACF;GACA,WAAW;IACT;IACA;IAEA;IACA;IACA;IACA;IAGA;GACF;GACA,QAAQ;IACN;IACA;IAEA;IACA;IACA;IACA;IAGA;GACF;GAOA,WAAW;IACT;IACA;IAEA;IACA;IACA;IACA;IAGA;IACA;IACA;IAGA;GACF;GACA,SAAS;IACP;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IAGA;IACA;IACA;IAGA;IACA;GACF;GAEA,QAAQ;IACN;IACA;IACA;IAEA;IACA;IACA;GACF;EACF;EACA,MAAM;GACJ,QAAQ;IACN;IACA;IACA;IACA;IACA;GACF;GACA,OAAO;IACL;IACA;IACA;IACA;IACA;GACF;GACA,OAAO;IACL;IACA;IACA;IACA;IACA;GACF;GAEA,WAAW;IAAC;IAAc;IAAU;GAA4C;GAChF,MAAM;IAAC;IAAc;IAAU;GAA4C;GAC3E,WAAW;IAAC;IAAa;IAAU;GAA4C;GAC/E,WAAW;IAAC;IAAa;IAAU;GAA4C;GAC/E,YAAY;IACV;IACA;IACA;IACA;GACF;GACA,YAAY;IAAC;IAAY;IAAY;GAA4C;EACnF;CACF;AACF,CACF;AAEA,MAAa,eAAe,IAC1B;CACE;CAGA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CAGA;CACA;CAGA;CACA;CACA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A,UAAU,KAAK;CACjB;CAEA,OACE,qBAAC,MAAD;EACE,GAAI;EACC;EACK;EACV,iBAAe;EACf,gBAAc;EAId,kBAAgB;EACV;EACN,SAAS;EACT,WAAW,GAAG,UAAU;EAZ1B,UAAA,CAcG,aAAa,oBAAC,SAAD,EAAS,WAAU,wCAAyC,CAAA,GAC1E,oBAAC,WAAD,EAAA,UAAY,aAAa,aAAa,OAAO,SAAoB,CAAA,CAC7D;;AAEV;;;ACrFA,MAAM,uBAAuB,IAC3B;CACE;CAEA;CACA;CACA;CAEA;CAEA;CACA;CACA;CACA;CACA;CAGA;CACA;AACF,GACA;CACE,iBAAiB;EACf,SAAS;EACT,OAAO;CACT;CACA,UAAU;EACR,OAAO;GACL,MAAM;IAAC;IAAmB;IAA4B;GAAyB;GAC/E,MAAM,CAAC,iDAAiD;GACxD,QAAQ,CAAC,6CAA6C;GACtD,OAAO,CAAC,2DAA2D;GACnE,QAAQ,CAAC;EACX;EACA,SAAS;GACP,MAAM,CAAC,gBAAgB,uBAAuB;GAC9C,gBAAgB;IAAC;IAAmB;IAAI;GAAoB;GAC5D,QAAQ,CAAC;EACX;CACF;AACF,CACF;AAKA,MAAa,gBAAgB,EAC3B,KACA,UACA,WACA,SACA,OACA,OAAO,UACP,UAAU,OACV,GAAG,kBACQ;CAGX,OACE,oBAHW,UAAU,OAAO,UAG5B;EACE,GAAI;EACC;EACL,MAAM,UAAU,KAAA,IAAY;EAC5B,WAAW,qBAAqB;GAAE;GAAS;GAAO;EAAU,CAAC;EAE5D;CACG,CAAA;AAEV"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeEditor-BfQJfbhL.js","names":["cmPlaceholder","placeholder"],"sources":["../src/components/CodeEditor/ButtonToolbar.tsx","../src/components/CodeEditor/modes/dbt.ts","../src/components/CodeEditor/modes/jsonnet.ts","../src/components/CodeEditor/helpers.ts","../src/components/CodeEditor/editorChrome.ts","../src/components/CodeEditor/search.ts","../src/components/CodeEditor/ToggleComponentHelp.tsx","../src/components/CodeEditor/tokenTheme.ts","../src/components/CodeEditor/tooltips.ts","../src/components/CodeEditor/variableCompletion.ts","../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { ClipboardButton } from '../../blocks/ClipboardButton';\n\n// Floats over the top-right corner of the editor it is rendered into — private to\n// `CodeEditor`, which is the `relative` ancestor it positions against. `right-3`\n// leaves room for the scrollbar track, whose width the browser owns and no token\n// here describes.\nexport const ButtonToolbar = ({ value, children }: { value?: string; children?: ReactNode }) => {\n if (!value && !children) return null;\n\n return (\n <div className=\"tw:absolute tw:right-3 tw:top-1 tw:z-10 tw:flex tw:gap-0.5 tw:overflow-visible tw:rounded tw:border tw:border-solid tw:border-border tw:!bg-background tw:p-px tw:shadow-sm\">\n {!!value && <ClipboardButton size=\"icon-xs\" variant=\"invisible\" text={value} />}\n {children}\n </div>\n );\n};\n","import type { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';\nimport { simpleMode } from '@codemirror/legacy-modes/mode/simple-mode';\n\n// A dbt step is `dbt <command> [<subcommand>] [arguments, flags and selectors]`,\n// and the vocabulary below is grouped by the slot it belongs to — both to colour\n// it and to decide what is worth offering where.\nconst COMMANDS = [\n 'run-operation',\n 'run',\n 'test',\n 'seed',\n 'snapshot',\n 'list',\n 'ls',\n 'compile',\n 'build',\n 'deps',\n 'docs',\n 'source',\n];\nconst SUBCOMMANDS: Record<string, string[]> = { docs: ['generate'], source: ['freshness'] };\nconst ARGUMENTS = ['--select', '--exclude', '--selector', '--defer', '--resource-type', '-s'];\n// The arguments whose value is a graph selector, and so the only ones a selector\n// method has anything to attach to.\nconst SELECTORS = ['--select', '--exclude', '-s'];\nconst METHODS = [\n 'path:',\n 'source:',\n 'tag:',\n 'package:',\n 'config:',\n 'test_type:',\n 'test_name:',\n 'state:',\n 'exposure:',\n 'metric:',\n 'result:',\n 'source_status:',\n 'column_name:',\n];\nconst FLAGS = [\n '--fail-fast',\n '--warn-error',\n '--favor-state',\n '--vars',\n '--models',\n '--threads',\n '--profiles-dir',\n '--profile',\n '--full-refresh',\n];\n\n// A subcommand only ever highlights together with its command, so `dbt docs` stays\n// unpainted until `generate` follows it.\nconst COMMAND_PHRASES = COMMANDS.flatMap((command) => {\n const subcommands = SUBCOMMANDS[command];\n\n return subcommands ? subcommands.map((subcommand) => `${command} ${subcommand}`) : [command];\n});\n\n// Alternation is first-match, so a word that prefixes another has to come first\n// (`run-operation` before `run`, `--profiles-dir` before `--profile`). Sorting by\n// length keeps that true however the lists above are written.\nconst alternation = (list: string[]) => [...list].sort((a, b) => b.length - a.length).join('|');\n\n// Every keyword follows whitespace, so the leading run is part of the match.\n// Commands and arguments end on a word boundary; methods and flags carry their\n// own terminator (`:`) or need none.\nconst word = (list: string[]) => new RegExp(`^\\\\s+(?:${alternation(list)})\\\\b`, 'i');\nconst prefix = (list: string[]) => new RegExp(`^\\\\s+(?:${alternation(list)})`, 'i');\n\n// The word being completed: letters, digits, `_`, `-` and the `:` a selector\n// method ends with. Whitespace stays out of it, so a two-word label like `docs\n// generate` cannot stretch the match back across the words before the cursor.\nconst WORD = /[\\w:-]*$/;\n\nconst asOptions = (list: string[], type: string): Completion[] =>\n list.map((label) => ({ label, type }));\n\n// `type` drives the popup icon, so each group carries the one that matches the\n// colour the mode paints it in.\nconst DBT: Completion[] = [{ label: 'dbt', type: 'keyword' }];\nconst COMMAND_OPTIONS = asOptions(COMMANDS, 'keyword');\nconst SUBCOMMAND_OPTIONS: Record<string, Completion[]> = Object.fromEntries(\n Object.entries(SUBCOMMANDS).map(([command, subcommands]) => [\n command,\n asOptions(subcommands, 'keyword'),\n ]),\n);\nconst ARGUMENT_OPTIONS = asOptions(ARGUMENTS, 'variable');\nconst FLAG_OPTIONS = asOptions(FLAGS, 'constant');\nconst METHOD_OPTIONS = asOptions(METHODS, 'property');\n\n// Which slice of the vocabulary the cursor's slot can hold, given the words\n// already finished ahead of it. Offering the whole vocabulary everywhere proposes\n// `dbt` mid-command and a selector method with no selector to attach to.\nconst optionsAfter = (words: string[]): Completion[] => {\n const [step, command, ...rest] = words;\n\n if (step === undefined) return DBT;\n if (step.toLowerCase() !== 'dbt') return [];\n if (command === undefined) return COMMAND_OPTIONS;\n\n const subcommands = SUBCOMMAND_OPTIONS[command.toLowerCase()];\n if (subcommands && rest.length === 0) return subcommands;\n\n // A selector argument takes any number of space-separated values, so what\n // decides the slot is the last argument, not whether a selector appeared at all:\n // `--select tag:a tag:b` keeps offering methods, `--select a --profile p` stops.\n const lastArgument = rest.filter((it) => it.startsWith('-')).at(-1);\n const selecting = lastArgument !== undefined && SELECTORS.includes(lastArgument.toLowerCase());\n\n return selecting\n ? [...ARGUMENT_OPTIONS, ...FLAG_OPTIONS, ...METHOD_OPTIONS]\n : [...ARGUMENT_OPTIONS, ...FLAG_OPTIONS];\n};\n\nconst complete = (context: CompletionContext): CompletionResult | null => {\n const typed = context.matchBefore(WORD);\n\n // `WORD` also matches the empty string, so without this the popup would open on\n // every space. Asking for completions explicitly still opens it there.\n if (!typed?.text && !context.explicit) return null;\n\n const from = typed?.from ?? context.pos;\n const line = context.state.doc.lineAt(from);\n const options = optionsAfter(\n line.text\n .slice(0, from - line.from)\n .split(/\\s+/)\n .filter(Boolean),\n );\n\n return options.length > 0 ? { from, options, validFor: WORD } : null;\n};\n\nexport const dbt = simpleMode({\n languageData: {\n // `toggleComment` is a no-op without these, so Mod-/ silently does nothing.\n commentTokens: { line: '--', block: { open: '/*', close: '*/' } },\n autocomplete: complete,\n },\n start: [\n { regex: /\"(?:[^\\\\]|\\\\.)*?(?:\"|$)/, token: 'string' },\n // Word-bounded, so `dbtX` is not a dbt step whose first word happens to\n // colour — the same thing the completion source asks of it.\n { regex: /dbt\\b/, token: 'keyword', sol: true },\n { regex: word(COMMAND_PHRASES), token: 'keyword' },\n { regex: word(ARGUMENTS), token: 'variableName' },\n { regex: prefix(METHODS), token: 'propertyName' },\n { regex: prefix(FLAGS), token: 'attributeName' },\n { regex: /(?:@|\\*|,|\\+\\d+|\\d+\\+|\\+)/, token: 'operator' },\n { regex: /'.*'/, token: 'string' },\n { regex: /true|false/, token: 'atom' },\n ],\n});\n","import type { StreamParser } from '@codemirror/language';\n\n/**\n * Ported from google/codemirror-mode-jsonnet (Apache-2.0), the mode written by\n * the language's own authors, which was never taken past CodeMirror 5.\n * CodeMirror 5 style names are replaced by their CodeMirror 6 highlight tags:\n * `string-2` is `escape`, `error` is `invalid`.\n *\n * Every pattern is anchored and hoisted. `StringStream.match` slices the rest of\n * the line and, without `^`, scans all of it for a match it then discards unless\n * it started at the cursor — so an unanchored probe costs the whole remaining\n * line, and this tokenizer makes up to twenty of them per token.\n */\n\nconst COMMENT_END = /^\\*\\//;\nconst COMMENT_START = /^\\/\\/|^#/;\nconst C_COMMENT_START = /^\\/\\*/;\nconst TEXT_BLOCK = /^\\|\\|\\|/;\nconst TEXT_BLOCK_END = /^\\s*\\|\\|\\|/;\nconst RAW_DOUBLE = /^\"\"/;\nconst RAW_SINGLE = /^''/;\nconst CLOSE_DOUBLE = /^\"/;\nconst CLOSE_SINGLE = /^'/;\nconst ESCAPE = /^\\\\[\\\\\"'/bfnrt0]/;\nconst UNICODE_ESCAPE = /^\\\\u[0-9a-fA-F]{4}/;\nconst BACKSLASH = /^\\\\/;\nconst IMPORT = /^import(?:str)?\\s*(@?)([\"'])/;\nconst QUOTE = /^(@?)([\"'])/;\nconst ROOT = /^\\$/;\nconst NUMBER = /^(?:\\.\\d+|\\d+\\.?\\d*)(?:e[-+]?\\d+)?/i;\nconst OPERATOR = /^[-+/*=<>!&~^|$%]+/;\nconst IDENTIFIER = /^[a-zA-Z_][a-zA-Z0-9_]*/;\n\nconst KEYWORDS: Record<string, 'keyword' | 'atom'> = {\n local: 'keyword',\n self: 'keyword',\n super: 'keyword',\n assert: 'keyword',\n function: 'keyword',\n if: 'keyword',\n then: 'keyword',\n else: 'keyword',\n for: 'keyword',\n in: 'keyword',\n tailstrict: 'keyword',\n error: 'keyword',\n true: 'atom',\n false: 'atom',\n null: 'atom',\n};\n\ntype State = {\n cComment: boolean;\n textBlock: boolean;\n textBlockIndent: number | null;\n string: boolean;\n importString: boolean;\n stringSingle: boolean;\n stringRaw: boolean;\n};\n\nexport const jsonnet: StreamParser<State> = {\n name: 'jsonnet',\n\n // `toggleComment` is a no-op without these, so Mod-/ silently does nothing.\n languageData: { commentTokens: { line: '//', block: { open: '/*', close: '*/' } } },\n\n startState: () => ({\n cComment: false,\n textBlock: false,\n textBlockIndent: null,\n string: false,\n importString: false,\n stringSingle: false,\n stringRaw: false,\n }),\n\n token: (stream, state) => {\n if (state.cComment) {\n if (stream.match(COMMENT_END)) {\n state.cComment = false;\n return 'comment';\n }\n stream.next();\n return 'comment';\n }\n\n // A `|||` block runs from its own first content line to the first line\n // indented less than that — so the closing `|||` has to be recognised\n // before the indent is measured, or a block closed at column 0 never ends.\n if (state.textBlock) {\n if (state.textBlockIndent == null) {\n if (stream.match(TEXT_BLOCK_END)) {\n state.textBlock = false;\n return 'string';\n }\n state.textBlockIndent = stream.indentation();\n }\n if (stream.indentation() >= state.textBlockIndent) {\n stream.skipToEnd();\n return 'string';\n }\n if (stream.match(TEXT_BLOCK_END)) {\n state.textBlock = false;\n return 'string';\n }\n stream.next();\n return 'invalid';\n }\n\n // Quoted and `@`-raw strings, single or double, plain or after an import.\n if (state.string || state.importString) {\n const style = state.string ? 'string' : 'meta';\n\n if (state.stringRaw) {\n if (stream.match(state.stringSingle ? RAW_SINGLE : RAW_DOUBLE)) return 'escape';\n } else {\n if (stream.match(ESCAPE)) return 'escape';\n if (stream.match(UNICODE_ESCAPE)) return 'escape';\n if (stream.match(BACKSLASH)) return 'invalid';\n }\n\n if (stream.match(state.stringSingle ? CLOSE_SINGLE : CLOSE_DOUBLE)) {\n state.string = false;\n state.importString = false;\n return style;\n }\n\n stream.next();\n return style;\n }\n\n if (stream.match(COMMENT_START)) {\n stream.skipToEnd();\n return 'comment';\n }\n if (stream.match(C_COMMENT_START)) {\n state.cComment = true;\n return 'comment';\n }\n\n // An import opens a string that is styled as meta rather than as content.\n const imported = stream.match(IMPORT);\n if (Array.isArray(imported)) {\n state.importString = true;\n state.stringRaw = imported[1] === '@';\n state.stringSingle = imported[2] === \"'\";\n return 'meta';\n }\n\n const quoted = stream.match(QUOTE);\n if (Array.isArray(quoted)) {\n state.string = true;\n state.stringRaw = quoted[1] === '@';\n state.stringSingle = quoted[2] === \"'\";\n return 'string';\n }\n\n if (stream.match(TEXT_BLOCK)) {\n state.textBlock = true;\n state.textBlockIndent = null;\n return 'string';\n }\n\n if (stream.match(ROOT)) return 'keyword';\n if (stream.match(NUMBER)) return 'number';\n if (stream.match(OPERATOR)) return 'operator';\n\n // Consumed whole so that a keyword's prefix (`locally`) is not styled.\n const identifier = stream.match(IDENTIFIER);\n if (Array.isArray(identifier)) return KEYWORDS[identifier[0]] ?? null;\n\n stream.next();\n return null;\n },\n};\n","import { javascript } from '@codemirror/lang-javascript';\nimport { json } from '@codemirror/lang-json';\nimport { python } from '@codemirror/lang-python';\nimport { MSSQL, MySQL, PLSQL, PostgreSQL, StandardSQL } from '@codemirror/lang-sql';\nimport { StreamLanguage } from '@codemirror/language';\nimport { r } from '@codemirror/legacy-modes/mode/r';\nimport { shell } from '@codemirror/legacy-modes/mode/shell';\nimport { toml } from '@codemirror/legacy-modes/mode/toml';\nimport { tags } from '@lezer/highlight';\nimport { githubLightInit } from '@uiw/codemirror-theme-github';\nimport type { BasicSetupOptions } from '@uiw/react-codemirror';\n\nimport { getSqlLanguageSupport } from '@keboola/codemirror-lang-sql';\nimport colors from '@keboola/tailwind-config/colors';\n\nimport { resolveToken } from '../../utils/themeTokens';\n\nimport { dbt } from './modes/dbt';\nimport { jsonnet } from './modes/jsonnet';\n\n// The MIME vocabulary callers pass. Kept as a const so the runtime whitelist and\n// the type stay one list — an annotated `LANGUAGE_MODE[]` copy elsewhere silently\n// drifts, since the type checker accepts a short one.\nexport const LANGUAGE_MODES = [\n 'application/json',\n 'text/plain',\n 'text/x-python',\n 'text/x-sql',\n 'text/x-mysql',\n 'text/x-pgsql',\n 'text/x-mssql',\n // Snowflake, under a historical name — these strings are a published prop contract.\n 'text/x-sfsql',\n 'text/x-bqsql',\n 'text/x-plsql',\n 'text/x-rsrc',\n 'text/x-sh',\n 'text/x-toml',\n 'text/jsonnet',\n 'text/x-dbt',\n 'text/javascript',\n 'text/typescript',\n] as const;\n\nexport type LANGUAGE_MODE = (typeof LANGUAGE_MODES)[number];\n\nexport const isLanguageMode = (mode: string): mode is LANGUAGE_MODE =>\n (LANGUAGE_MODES as readonly string[]).includes(mode);\n\n// `readOnly` reaches CodeMirror as `contenteditable`, so the two states are only\n// addressable through it. Exported because `fieldChrome` overrides the read-only\n// wash below by re-declaring the same key — which only works while the strings\n// match exactly.\nexport const READ_ONLY_EDITOR = '&.cm-editor:has(.cm-content[contenteditable=\"false\"])';\nexport const EDITABLE_EDITOR = '&.cm-editor:has(.cm-content[contenteditable=\"true\"])';\n\n// Chrome surfaces (selection, read-only wash) resolve from live `--*`\n// tokens so they re-skin with brand + dark mode; diff/syntax colors below stay\n// categorical (fixed across brands). Fallback channels mirror the light-mode\n// token values for SSR / no-provider parity.\nexport const buildBaseThemeStyles = () => ({\n '*': { lineHeight: '20px' },\n '*::selection': {\n backgroundColor: resolveToken('primary', '31 143 255'),\n color: `${resolveToken('primary-foreground', '255 255 255')} !important`,\n },\n [READ_ONLY_EDITOR]: {\n backgroundColor: resolveToken('secondary', '226 232 240'),\n },\n [`${READ_ONLY_EDITOR} .cm-gutters`]: {\n backgroundColor: resolveToken('border', '229 231 235'),\n },\n '&.cm-editor .cm-scroller': { overflowAnchor: 'none' },\n '&.cm-editor, &.cm-editor .cm-scroller': {\n minHeight: '100%',\n flexGrow: 1,\n alignItems: 'stretch !important',\n outline: 'none',\n },\n '.cm-gutter.cm-foldGutter': { display: 'none !important' },\n '.cm-gutter.cm-lineNumbers': { paddingLeft: '20px', paddingRight: '6px' },\n '.cm-gutters': { height: 'auto' },\n\n // merge (diff) view\n '&[class*=\"cm-merge-\"] .cm-deletedLine': { backgroundColor: colors.error[100] },\n '&[class*=\"cm-merge-\"] .cm-changedLine': { backgroundColor: colors.green[100] },\n '&[class*=\"cm-merge-\"] .cm-deletedLineGutter': { backgroundColor: colors.error[200] },\n '&[class*=\"cm-merge-\"] .cm-changedLineGutter': { backgroundColor: colors.green[200] },\n '&[class*=\"cm-merge-\"] .cm-deletedText': { background: colors.error[200] },\n '&[class*=\"cm-merge-\"] .cm-changedText': { background: colors.green[200] },\n '&[class*=\"cm-merge-\"]': {\n backgroundColor: `${colors.white} !important`,\n },\n '&[class*=\"cm-merge-\"] .cm-gutters': {\n backgroundColor: `${colors.white} !important`,\n },\n '.cm-changeGutter': { position: 'absolute', zIndex: -1, width: '100%', paddingLeft: 0 },\n '&[class*=\"cm-merge-\"] .cm-changedLine,&[class*=\"cm-merge-\"] .cm-line, &[class*=\"cm-merge-\"] .cm-deletedChunk':\n { paddingLeft: 0 },\n});\n\n// Dead whatever the editor does with them: `buildBaseThemeStyles` hides the fold\n// gutter outright, and `buildCustomTheme` paints the active line transparent.\nconst ALWAYS_OFF = {\n drawSelection: false,\n foldGutter: false,\n foldKeymap: false,\n highlightActiveLine: false,\n highlightActiveLineGutter: false,\n} as const;\n\n// `basicSetup` enables everything it is not told to skip, so a viewer would\n// otherwise install bracket closing and keybindings for commands a read-only\n// document rejects. Search stays — Mod-f is useful on a viewer. Same reasoning\n// as `shouldLintJson` below.\n//\n// `history` stays too, though a viewer can never add an entry: a caller that\n// flips `readOnly` mid-session reconfigures the view, and a reconfigure discards\n// state fields the new configuration doesn't have. Leaving it out saves nothing\n// and costs the editable session its undo stack.\n//\n// Autocompletion is absent here on purpose: `CodeEditor` installs its own\n// `autocompletion()` extension, which is appended after this object and would\n// re-add the plugin and its keymap. It gates that call on `readOnly` instead.\nexport const buildBasicSetup = (readOnly: boolean): BasicSetupOptions => ({\n ...ALWAYS_OFF,\n ...(readOnly\n ? {\n closeBrackets: false,\n closeBracketsKeymap: false,\n lintKeymap: false,\n indentOnInput: false,\n rectangularSelection: false,\n dropCursor: false,\n highlightSelectionMatches: false,\n }\n : null),\n});\n\n// Editor surface + gutter resolve from live `--*` tokens; the github\n// syntax palette stays categorical. Fallback channels mirror the light-mode\n// token values. `foreground` / `gutterForeground` pair the token-driven\n// surfaces with token-driven text so line content and line numbers stay\n// readable when the background goes dark (e.g. standalone, no surrounding\n// `tw:text-foreground`).\n//\n// `styles` corrects the stock github palette where a colour stops carrying\n// meaning (later entries win over the stock rule for the same tag), for every\n// language this theme paints — the SQL modes that motivated it (UT-5024) and\n// JSON, python, JS alike. The github theme paints every `name`-family tag\n// green, and in SQL nearly every token is a name — identifiers, function calls\n// and `$variables` all drowned in one colour, and a keyword that doubles as a\n// function (`create or REPLACE`) read as a value. Instead: plain identifiers,\n// quoted identifiers (`\"a column\"`) and brackets carry no colour (matching\n// github.com's own rendering; stock github also lumped brackets in with\n// comments), functions and special vars get their own hues, and amber is\n// unique to string literals — in JSON that shifts string values from navy to\n// amber, the one visible non-SQL change.\nexport const buildCustomTheme = () => {\n const foreground = resolveToken('foreground', '30 41 59');\n\n return githubLightInit({\n settings: {\n fontFamily: `'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New'`,\n background: resolveToken('background', '249 250 251'),\n foreground,\n gutterBackground: resolveToken('muted', '241 245 249'),\n gutterForeground: resolveToken('muted-foreground', '100 116 139'),\n gutterBorder: 'transparent',\n lineHighlight: 'transparent',\n selection: resolveToken('primary', '31 143 255'),\n },\n styles: [\n { tag: [tags.name, tags.special(tags.string), tags.bracket], color: foreground },\n { tag: tags.standard(tags.name), color: colors.purple[600] },\n { tag: tags.special(tags.name), color: colors.cyan[700] },\n { tag: tags.string, color: colors.warning[700] },\n ],\n });\n};\n\nexport const getLanguageMode = (mode?: LANGUAGE_MODE) => {\n switch (mode) {\n case undefined:\n case 'application/json':\n return json();\n case 'text/x-python':\n return python();\n case 'text/x-sql':\n return getSqlLanguageSupport(StandardSQL);\n case 'text/x-mysql':\n return getSqlLanguageSupport(MySQL);\n case 'text/x-pgsql':\n return getSqlLanguageSupport(PostgreSQL);\n case 'text/x-mssql':\n return getSqlLanguageSupport(MSSQL);\n case 'text/x-sfsql':\n return getSqlLanguageSupport('snowflake');\n case 'text/x-bqsql':\n return getSqlLanguageSupport('bigquery');\n case 'text/x-plsql':\n return getSqlLanguageSupport(PLSQL);\n case 'text/x-rsrc':\n return StreamLanguage.define(r);\n case 'text/x-sh':\n return StreamLanguage.define(shell);\n case 'text/x-toml':\n return StreamLanguage.define(toml);\n case 'text/jsonnet':\n return StreamLanguage.define(jsonnet);\n case 'text/x-dbt':\n return StreamLanguage.define(dbt);\n case 'text/javascript':\n return javascript({ jsx: true });\n case 'text/typescript':\n return javascript({ jsx: true, typescript: true });\n // No language — `text/plain` lands here, and so does any mode added to\n // LANGUAGE_MODES without an arm above. Unstyled text is the safe degradation;\n // a `json()` default would colour unrelated content as if it were JSON.\n default:\n return [];\n }\n};\n\n// The JSON parse linter is only useful on an editable editor — a read-only one\n// can't act on the errors, so running it is wasted work and its underlines are\n// noise (e.g. non-strict JSON shown read-only in Kai chat).\nexport const shouldLintJson = (mode: LANGUAGE_MODE | undefined, readOnly: boolean): boolean =>\n mode === 'application/json' && !readOnly;\n","import colors from '@keboola/tailwind-config/colors';\n\nimport { resolveToken } from '../../utils/themeTokens';\n\nimport { EDITABLE_EDITOR, READ_ONLY_EDITOR } from './helpers';\n\n/**\n * The parts of an editor's outer chrome that differ between presets; how they\n * reach CodeMirror's selectors lives once in `buildChromeStyles`.\n */\nexport type EditorChrome = {\n surface: string;\n borderColor: string;\n readOnlySurface: string;\n readOnlyBorderColor: string;\n /** `null` for a preset with no hover affordance — form inputs have none. */\n hoverBorderColor: string | null;\n focusBorderColor: string;\n focusRing: string;\n radius: string;\n paddingY: string;\n /** `null` leaves CodeMirror's own 6px/2px line inset alone. */\n paddingX: { left: string; right: string } | null;\n};\n\n/**\n * Mirrors `InputGroup` at the sizing each design language gives a `TextInput`,\n * so an editor dropped into a form reads as one of its fields.\n *\n * The legacy preset reads the neutral ramp because the legacy `secondary`\n * variant does. No semantic token holds that grey, and the nearest one\n * (`--muted`) is a few points off — which is the \"almost, but not quite, the\n * input next to it\" mismatch this preset exists to remove.\n */\nexport const buildInputChrome = (isArgo: boolean): EditorChrome => ({\n surface: isArgo ? resolveToken('muted', '241 245 249') : colors.neutral[100],\n borderColor: isArgo ? resolveToken('input', '203 213 225') : colors.neutral[100],\n readOnlySurface: isArgo ? resolveToken('muted', '241 245 249') : colors.neutral[150],\n readOnlyBorderColor: isArgo ? resolveToken('input', '203 213 225') : colors.neutral[150],\n hoverBorderColor: null,\n focusBorderColor: isArgo\n ? resolveToken('primary', '37 99 235')\n : resolveToken('ring', '31 143 255'),\n focusRing: `0 0 0 4px ${resolveToken('ring', '31 143 255', isArgo ? 0.5 : 0.3)}`,\n radius: isArgo ? 'var(--radius-lg, 0.25rem)' : '0.25rem',\n // 2px border + 2×this + `.cm-content`'s own 4px + a 20px line, against the\n // height a one-line `TextInput` has: argo forces `sizing: 'medium'` (36px),\n // legacy leaves it at `default` (40px).\n paddingY: isArgo ? '3px' : '5px',\n // Tops `.cm-line`'s 6px/2px up to the 16px an input's text is inset by.\n paddingX: { left: '10px', right: '14px' },\n});\n\n/** The SQL workspace's notebook cell: a white canvas, not a form control. */\nexport const buildCanvasChrome = (): EditorChrome => ({\n surface: resolveToken('card', '255 255 255'),\n borderColor: 'transparent',\n readOnlySurface: resolveToken('muted', '241 245 249'),\n readOnlyBorderColor: 'transparent',\n hoverBorderColor: resolveToken('ring', '31 143 255'),\n focusBorderColor: resolveToken('ring', '31 143 255'),\n focusRing: `0 0 0 4px ${resolveToken('ring', '31 143 255', 0.3)}`,\n radius: '8px',\n paddingY: '8px',\n paddingX: null,\n});\n\n/**\n * Spread over `buildBaseThemeStyles()` — never used alone. The read-only keys\n * are the base's own, so they replace its wash instead of landing beside it.\n */\nexport const buildChromeStyles = (chrome: EditorChrome) => ({\n '&.cm-editor': {\n border: `solid 1px ${chrome.borderColor}`,\n borderRadius: chrome.radius,\n backgroundColor: chrome.surface,\n paddingTop: chrome.paddingY,\n paddingBottom: chrome.paddingY,\n },\n '&.cm-editor :is(.cm-gutters,.cm-scroller)': { backgroundColor: chrome.surface },\n\n ...(chrome.paddingX\n ? {\n // Only without a gutter: there the editor reads as a one-line input and\n // its text should start where a neighbouring `TextInput`'s does. With a\n // gutter, the gutter owns the left edge.\n '&.cm-editor:not(:has(.cm-gutters)) .cm-content': {\n paddingLeft: chrome.paddingX.left,\n paddingRight: chrome.paddingX.right,\n },\n }\n : null),\n\n ...(chrome.hoverBorderColor\n ? { [`${EDITABLE_EDITOR}:hover`]: { borderColor: chrome.hoverBorderColor } }\n : null),\n [`${EDITABLE_EDITOR}:focus-within`]: {\n borderColor: chrome.focusBorderColor,\n boxShadow: chrome.focusRing,\n },\n\n [READ_ONLY_EDITOR]: {\n backgroundColor: chrome.readOnlySurface,\n borderColor: chrome.readOnlyBorderColor,\n },\n [`${READ_ONLY_EDITOR} .cm-gutters`]: { backgroundColor: chrome.readOnlySurface },\n [`${READ_ONLY_EDITOR} .cm-scroller`]: { backgroundColor: chrome.readOnlySurface },\n});\n","import { StateEffect, StateField, type Text } from '@codemirror/state';\nimport {\n Decoration,\n type DecorationSet,\n EditorView,\n ViewPlugin,\n type ViewUpdate,\n} from '@codemirror/view';\n\nimport colors from '@keboola/tailwind-config/colors';\n\nimport { escapeStringRegexp } from '../../utils/escapeStringRegexp';\n\n// Represents a single search match in the editor\ntype SearchMatch = {\n /** Start position in document */\n from: number;\n /** End position in document */\n to: number;\n /** Text content of the match */\n text: string;\n /** Local match index within this editor (0-based) */\n localIndex: number;\n};\n\n// Effect to update search state\nconst setSearchEffect = StateEffect.define<{\n query: string;\n selectedMatchIndex?: number;\n}>();\n\n// State to track current search matches\ntype SearchState = {\n query: string;\n selectedMatchIndex?: number;\n matches: SearchMatch[];\n decorations: DecorationSet;\n};\n\n// Find all matches in the document\nfunction findMatches(doc: Text, query: string): SearchMatch[] {\n if (!query) return [];\n\n const text = doc.toString();\n\n try {\n const regex = new RegExp(escapeStringRegexp(query), 'gi');\n\n return Array.from(text.matchAll(regex)).map((match, index) => {\n const from = match.index!;\n const to = from + match[0].length;\n\n return { from, to, text: match[0], localIndex: index };\n });\n } catch (e) {\n // Invalid regex - return no matches\n console.warn('Invalid search regex:', e);\n return [];\n }\n}\n\n// Create decorations for search matches\nfunction createDecorations(matches: SearchMatch[], selectedLocalIndex?: number): DecorationSet {\n const decorations = matches.map((match) => {\n const isSelected = match.localIndex === selectedLocalIndex;\n\n const decoration = Decoration.mark({\n class: isSelected ? 'cm-searchMatch-selected' : 'cm-searchMatch',\n });\n\n return decoration.range(match.from, match.to);\n });\n\n return Decoration.set(decorations, true);\n}\n\n// StateField to manage search state\nconst searchField = StateField.define<SearchState>({\n create() {\n return {\n query: '',\n selectedMatchIndex: undefined,\n matches: [],\n decorations: Decoration.none,\n };\n },\n\n update(state, tr) {\n let newState = state;\n\n // Handle search effect\n for (const effect of tr.effects) {\n if (!effect.is(setSearchEffect)) {\n continue;\n }\n\n const { query, selectedMatchIndex } = effect.value;\n\n // Find matches\n const matches = findMatches(tr.state.doc, query);\n\n // Create decorations\n const decorations = createDecorations(matches, selectedMatchIndex);\n\n newState = {\n query,\n selectedMatchIndex,\n matches,\n decorations,\n };\n }\n\n // Map decorations through document changes\n if (tr.docChanged && newState.query) {\n const matches = findMatches(tr.state.doc, newState.query);\n const decorations = createDecorations(matches, newState.selectedMatchIndex);\n\n newState = {\n ...newState,\n matches,\n decorations,\n };\n }\n\n return newState;\n },\n\n provide: (field) => EditorView.decorations.from(field, (state) => state.decorations),\n});\n\n// View plugin to handle scrolling to selected match\nconst searchViewPlugin = ViewPlugin.fromClass(\n class {\n private lastSelectedIndex?: number;\n\n update(update: ViewUpdate) {\n const state = update.state.field(searchField);\n\n // Scroll to selected match when it changes\n if (\n state.selectedMatchIndex !== undefined &&\n state.selectedMatchIndex !== this.lastSelectedIndex\n ) {\n const match = state.matches[state.selectedMatchIndex];\n\n if (match) {\n requestAnimationFrame(() => {\n update.view.dispatch({\n effects: EditorView.scrollIntoView(match.from, { y: 'center' }),\n });\n });\n }\n\n this.lastSelectedIndex = state.selectedMatchIndex;\n }\n\n // Reset if no selection\n if (state.selectedMatchIndex === undefined) {\n this.lastSelectedIndex = undefined;\n }\n }\n },\n);\n\nconst searchTheme = EditorView.baseTheme({\n '.cm-searchMatch': {\n backgroundColor: colors.blue[100],\n },\n '.cm-searchMatch > span': {\n color: `${colors.blue[600]} !important`,\n },\n '.cm-searchMatch-selected': {\n backgroundColor: colors.blue[600],\n },\n '.cm-searchMatch-selected > span': {\n color: `${colors.white} !important`,\n },\n});\n\nexport function searchExtension() {\n return [searchField, searchViewPlugin, searchTheme];\n}\n\nexport function updateSearch(view: EditorView, query: string, selectedMatchIndex?: number) {\n view.dispatch({ effects: setSearchEffect.of({ query, selectedMatchIndex }) });\n}\n","import { isMac } from '../../utils';\nimport { Kbd } from '../Kbd';\n\nexport const ToggleComponentHelp = () => (\n <div>\n Use <Kbd>{isMac ? 'Command+/' : 'Ctrl+/'}</Kbd> to toggle comments.\n </div>\n);\n","import { type Extension } from '@codemirror/state';\n\nimport type { ResolvedColorScheme } from '../ThemeProvider/types';\nimport { useThemeAttributes } from '../ThemeProvider/useThemeAttributes';\n\n// Cached across component instances, not just across renders. A CodeMirror theme\n// extension carries its own StyleModule, and mounting an EditorView appends its\n// rules to a document-level stylesheet — which invalidates style for the whole\n// document. Sharing one module per theme keeps the stylesheet a constant size no\n// matter how many editors mount.\nconst themeCache = new Map<string, Extension>();\n\n/**\n * Memoize a CodeMirror theme/extension built from `resolveToken`, shared across\n * every instance that passes the same `cacheKey` and rebuilt whenever the active\n * brand / light-dark mode changes. `build` reads live `--*` values off `<html>`,\n * so the active theme is an invisible dependency a deps array can't see.\n *\n * `build` receives the scheme those values were read under, for the theme values\n * that are a light/dark *pair* rather than a token lookup (a categorical diff\n * wash has no semantic token, but an opaque light pastel still has to become a\n * low-alpha tint under dark). It comes from the same read that produced the key,\n * so a builder cannot resolve one scheme's colours under the other one's key.\n *\n * `cacheKey` is the extension's full identity: anything the builder closes over\n * must be part of it (e.g. `` `merge-pane:${deleted}` ``), or instances built\n * from different inputs would share one theme.\n */\nexport const useThemedExtension = (\n cacheKey: string,\n build: (scheme: ResolvedColorScheme) => Extension,\n): Extension => {\n const { scheme, cacheKey: themeKey } = useThemeAttributes();\n const key = `${themeKey} ${cacheKey}`;\n\n // The module-level cache is the memo; reading and filling it during render is\n // idempotent and keyed only on values already stable for the render.\n let cached = themeCache.get(key);\n if (!cached) {\n cached = build(scheme);\n themeCache.set(key, cached);\n }\n\n return cached;\n};\n","import { useMemo } from 'react';\nimport { Compartment, type Extension } from '@codemirror/state';\nimport { tooltips, ViewPlugin } from '@codemirror/view';\n\n// A `position: fixed` box is laid out against the viewport — and so escapes\n// every scroll container above it — only while no ancestor claims the job of\n// being its containing block. This encodes the CSS rule for who claims it\n// rather than the subset this repo happens to use today; `contain` and\n// `will-change` take value lists, so those two are matched loosely.\n//\n// `content-visibility` is absent on purpose: it implies containment without\n// saying so through `contain`, and it is handled below as a clipper — which is\n// the stronger of the two properties for our purposes.\nconst establishesFixedContainingBlock = (style: CSSStyleDeclaration) =>\n style.transform !== 'none' ||\n style.translate !== 'none' ||\n style.rotate !== 'none' ||\n style.scale !== 'none' ||\n style.perspective !== 'none' ||\n style.filter !== 'none' ||\n style.backdropFilter !== 'none' ||\n /\\b(paint|layout|strict|content)\\b/.test(style.contain) ||\n /\\b(transform|perspective|filter|contain)\\b/.test(style.willChange);\n\n// Crops its content, so hosting the tooltip inside it would not help. Paint\n// containment — which `content-visibility: auto` turns on without ever showing\n// up in computed `contain` — crops even a fixed-position descendant, and so\n// does a mask.\nconst crops = (style: CSSStyleDeclaration) =>\n style.overflowX !== 'visible' ||\n style.overflowY !== 'visible' ||\n style.maskImage !== 'none' ||\n style.contentVisibility !== 'visible' ||\n /\\b(paint|strict|content)\\b/.test(style.contain);\n\n/**\n * Where a tooltip can hang without being cropped, or `null` for \"wherever\n * CodeMirror would put it anyway\".\n *\n * Two ancestors matter, and they are not the same ancestor. The **outermost\n * cropper** is the one to get above — landing anywhere below it leaves the\n * tooltip inside the box doing the cropping. The **containing block** is where\n * the search can stop, because from there upwards `position: fixed` is measured\n * against that element and nothing higher can crop it.\n *\n * `document.body` and `<html>` are not treated as croppers: a fixed box whose\n * containing block is the viewport is not clipped by their overflow, and\n * hosting outside `<body>` would drop the tooltip out of the app's stacking and\n * pointer-events scope for no gain.\n */\nconst findTooltipHost = (from: HTMLElement) => {\n let outermostCropper: HTMLElement | null = null;\n\n for (let node = from.parentElement; node && node !== document.body; node = node.parentElement) {\n const style = getComputedStyle(node);\n\n if (crops(style)) {\n outermostCropper = node;\n } else if (establishesFixedContainingBlock(style)) {\n return outermostCropper?.parentElement ?? node;\n }\n }\n\n return outermostCropper?.parentElement ?? null;\n};\n\n/**\n * `tooltips()`, re-hosted so the completion popup is never cropped.\n *\n * CodeMirror hangs tooltips inside the editor and lets `position: fixed` carry\n * them past its edges. That holds only while the viewport is their containing\n * block — a modal centred with a translate, a sheet sliding in, or a box under\n * paint containment takes that job, and then every scroller, mask and contained\n * box in between crops the popup instead. A tall editor hides the damage; a\n * one-line one shows a sliver of an unreadable list.\n *\n * The two shapes this has to survive in production are a `Modal`, whose body\n * scrolls and carries the argo fade mask, and kbc-ui's SQL editor, which wraps\n * every code block in `content-visibility: auto` to keep long scripts cheap.\n *\n * Hosting the layer above the outermost cropper clears all of that while keeping\n * the popup inside the modal's stacking, focus and pointer-events scope — which\n * `document.body` would not: the popup would sit behind the modal, and Radix\n * leaves the body `pointer-events: none` while a dialog is open.\n *\n * Both editors install this, and it is the only place either of them configures\n * a tooltip host. Keep it that way: CodeMirror's tooltip config takes the first\n * contributor that names a parent, so a second mechanism would not compose with\n * this one — it would silently win or lose on extension order.\n */\nconst tooltipsExtension = (): Extension => {\n // The resolved host lives in a compartment, not in an appended config: React\n // hands CodeMirror a new extension array whenever the editor's props move,\n // which dispatches a full reconfigure. That replaces appended config, while\n // compartment contents are carried over.\n const layer = new Compartment();\n\n return [\n layer.of(tooltips()),\n ViewPlugin.define((view) => {\n // Deferred on two counts: a plugin cannot dispatch while the view it\n // belongs to is still being built, and reading computed styles here would\n // force a style and layout flush in the middle of the commit that inserted\n // the editor. The lookup is one-shot — an ancestor that gains a transform\n // afterwards is not picked up.\n const scheduled = setTimeout(() => {\n if (!view.dom.isConnected) return;\n\n const parent = findTooltipHost(view.dom);\n if (parent) view.dispatch({ effects: layer.reconfigure(tooltips({ parent })) });\n });\n\n return { destroy: () => clearTimeout(scheduled) };\n }),\n ];\n};\n\n/**\n * The extension above, built once per editor. Rebuilding it would hand\n * CodeMirror a fresh compartment and plugin on every reconfigure, dropping the\n * host it had already resolved — so it is only ever reached through this hook.\n */\nexport const useTooltipsExtension = () => useMemo(tooltipsExtension, []);\n","import type { Completion, CompletionContext, CompletionSource } from '@codemirror/autocomplete';\n\nimport { useStableCallback } from '../../hooks/useStableCallback';\n\nexport type EditorVariable = { name: string; value?: string };\n\n// Keywords come by the hundred from the language, so a variable would otherwise rank\n// below every one of them that shares a prefix.\nconst BOOST = 2000;\n\n// One brace or two, because `closeBrackets` turns a typed `{` into `{}` and a caret\n// that has only opened the placeholder is still asking for a variable. One charset\n// for the name throughout: a second, narrower one would start the range mid-name on\n// anything it disagreed about, and a range that starts mid-name never matches.\nconst NAME = String.raw`[\\w-]*`;\nconst AT_CARET = new RegExp(String.raw`(?:\\{{1,2} ?)?${NAME}$`);\nconst NAME_AT_END = new RegExp(`${NAME}$`);\nconst OPENING = /\\{{1,2} ?$/;\nconst CLOSING = /^ ?\\}{1,2}/;\n\n/**\n * Completes a mustache-style `{{name}}` placeholder.\n */\nexport const completeVariables = (variables: EditorVariable[] = []): CompletionSource => {\n if (variables.length === 0) return () => null;\n\n const options: Completion[] = variables.map(({ name, value }) => ({\n // The bare name: `SqlEditor` filters prefix-only while `CodeEditor` filters\n // fuzzily, and this is the only spelling both accept whether or not the caret\n // has typed the braces. The braces are `displayLabel`, which is what renders.\n label: name,\n displayLabel: `{{${name}}}`,\n detail: value,\n type: 'variable',\n boost: BOOST,\n apply: (view, completion, from, to) => {\n const { doc } = view.state;\n const line = doc.lineAt(from);\n const insert = `{{${completion.label}}}`;\n\n // The range covers the name alone, so the braces around it are found rather\n // than assumed — `closeBrackets` may have added a closing one nobody typed.\n const opening = OPENING.exec(doc.sliceString(line.from, from));\n const closing = CLOSING.exec(doc.sliceString(to, line.to));\n const start = opening ? from - opening[0].length : from;\n const end = closing ? to + closing[0].length : to;\n\n view.dispatch({\n changes: { from: start, to: end, insert },\n selection: { anchor: start + insert.length },\n });\n },\n }));\n\n return (context: CompletionContext) => {\n const match = context.matchBefore(AT_CARET);\n\n if (!match?.text) return null;\n\n const [name = ''] = NAME_AT_END.exec(match.text) ?? [];\n\n return { from: match.to - name.length, options };\n };\n};\n\n/**\n * The completion source both editors install, with an identity that never moves.\n *\n * Both hold it inside the memo that keys their whole extension tree, and callers\n * build the list inline — a config row mapped to `{ name, value }` in a store\n * selector, so a fresh array arrives on every store push. Because CodeMirror asks\n * the source for options rather than reading them up front, holding it steady costs\n * nothing: a completion request always reaches the latest render's variables.\n */\nexport const useVariableCompletion = (variables: EditorVariable[] = []): CompletionSource =>\n useStableCallback(completeVariables(variables));\n","import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';\nimport type { KeyboardEvent, ReactNode } from 'react';\nimport type { CompletionSource } from '@codemirror/autocomplete';\nimport { autocompletion, completeAnyWord } from '@codemirror/autocomplete';\nimport { jsonParseLinter } from '@codemirror/lang-json';\nimport { linter } from '@codemirror/lint';\nimport { unifiedMergeView } from '@codemirror/merge';\nimport { EditorView, keymap, placeholder as cmPlaceholder } from '@codemirror/view';\nimport CodeMirror, {\n EditorState,\n type Extension,\n type ReactCodeMirrorRef,\n} from '@uiw/react-codemirror';\n\nimport { keyCodes } from '../../constants/keyCodes';\nimport { useStableCallback } from '../../hooks/useStableCallback';\nimport { cn } from '../../utils';\nimport { HelpBlock } from '../HelpBlock';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { ButtonToolbar } from './ButtonToolbar';\nimport { buildChromeStyles, buildInputChrome } from './editorChrome';\nimport type { LANGUAGE_MODE } from './helpers';\nimport {\n buildBaseThemeStyles,\n buildBasicSetup,\n buildCustomTheme,\n getLanguageMode,\n shouldLintJson,\n} from './helpers';\nimport { searchExtension, updateSearch } from './search';\nimport { ToggleComponentHelp } from './ToggleComponentHelp';\nimport { useThemedExtension } from './tokenTheme';\nimport { useTooltipsExtension } from './tooltips';\nimport { type EditorVariable, useVariableCompletion } from './variableCompletion';\n\ntype Props = {\n value: string;\n previousValue?: string;\n /**\n * `'field'` draws the chrome an `InputGroup` draws — surface, border, radius,\n * focus ring, read-only wash — for an editor that is one control among others\n * in a form. It sizes to its content, so don't pin its height.\n *\n * `'plain'` (the default) is the full-bleed surface of an editor that *is* the\n * panel: a modal body, a chat block, a fixed-height viewer already framed by\n * whatever contains it.\n */\n variant?: 'plain' | 'field';\n mode?: LANGUAGE_MODE;\n placeholder?: string;\n /** Names the editable region for screen readers — the editor has no visible label of its own. */\n ariaLabel?: string;\n /**\n * Highlights every occurrence and scrolls the selected one into view. The find\n * UI is the caller's — pass the query it holds, and omit both props entirely to\n * leave the search extension uninstalled.\n */\n searchQuery?: string;\n searchMatchIndex?: number;\n readOnly?: boolean;\n /**\n * Refuses edits while leaving the editor looking and behaving as it did — for a\n * transient lock such as an in-flight save, where a keystroke landing mid-request\n * would be overwritten by the response. `readOnly` is the wrong prop for that:\n * it turns the editor into a viewer, greying the surface and taking the lint\n * marks and completions with it.\n */\n inputLocked?: boolean;\n /**\n * A flat list of completions, offered everywhere in the document. One word per\n * label: CodeMirror derives the pattern for the word being completed from the\n * labels' characters, so a space in one widens it across whitespace and the\n * editor offers nothing past the first word of a line. A phrase belongs in\n * `completionSource`.\n *\n * Compared by identity, like `completionSource` — hand the editor a stable array.\n */\n autocompletions?: string[];\n /**\n * Completions that depend on where the cursor is — a column list offered only\n * after its table, say. Wins over both `autocompletions` and `completeAny`,\n * which stay the right props for a list that is the same everywhere in the\n * document and for having no list at all. Like them, it opens on typing.\n *\n * Compared by identity: build it in a `useMemo` or the editor rebuilds its whole\n * extension tree on every render.\n */\n completionSource?: CompletionSource;\n /**\n * Configuration variables, completed into `{{name}}`. Independent of\n * `completionSource`: both are offered, so a caller keeps its own completions and\n * gets variables spelled the way the rest of the platform writes them.\n */\n variables?: EditorVariable[];\n extraKeys?: Record<string, () => void>;\n withToggleCommentHint?: boolean;\n withAutofocus?: boolean;\n withLineNumbers?: boolean;\n withLineWrapping?: boolean;\n withCollapseUnchanged?: boolean;\n withCopyButton?: boolean;\n completeAny?: boolean;\n help?: ReactNode;\n helpPostfix?: ReactNode;\n /**\n * Extra actions for the toolbar that floats over the editor's top-right corner,\n * beside the copy button. The toolbar is a 28px chip, so pass `size=\"icon-xs\"`\n * buttons — a default-sized one grows the chip and de-aligns the copy button.\n */\n renderAdditionalButtons?: (value?: string) => ReactNode;\n className?: string;\n} & (\n | { readOnly: true; onChange?: never }\n // `boolean` rather than `false`: a field the user's permissions may lock still\n // needs its handler for the case where they can edit.\n | { readOnly?: boolean; onChange: (value: string) => void }\n);\n\nconst emptyObject = {};\n\nexport const CodeEditor = ({\n value,\n previousValue,\n onChange,\n variant = 'plain',\n mode = 'application/json',\n placeholder = '',\n ariaLabel,\n searchQuery,\n searchMatchIndex,\n readOnly = false,\n inputLocked = false,\n autocompletions,\n completionSource,\n variables,\n extraKeys = emptyObject,\n withToggleCommentHint = false,\n withAutofocus = false,\n withLineNumbers = true,\n withLineWrapping = true,\n withCollapseUnchanged = false,\n withCopyButton = false,\n completeAny = false,\n help = null,\n helpPostfix = null,\n renderAdditionalButtons,\n className,\n}: Props) => {\n // CodeMirror rebuilds and re-resolves the whole extension tree whenever the\n // change handler's identity moves, and callers pass inline arrows.\n const handleChange = useStableCallback((next: string) => onChange?.(next));\n\n // Themes re-resolve their `--*` tokens on brand / light-dark change. The\n // syntax palette is keyed without a component prefix so `SqlEditor` — which\n // builds it from the same `buildCustomTheme` — shares this one module.\n // Presence, not truthiness: a caller that searches always passes the prop, so\n // the extension set stays stable while the query changes.\n const withSearch = searchQuery !== undefined;\n const editorRef = useRef<ReactCodeMirrorRef>(null);\n\n useEffect(() => {\n const view = editorRef.current?.view;\n if (view && withSearch) updateSearch(view, searchQuery, searchMatchIndex);\n }, [withSearch, searchQuery, searchMatchIndex]);\n\n // A view created while a query is already set — a remount, a tab switch —\n // starts with no highlights unless the search is applied as it is built.\n const handleCreateEditor = useStableCallback((view: EditorView) => {\n if (searchQuery) updateSearch(view, searchQuery, searchMatchIndex);\n });\n\n // Same reasoning as `onChange` above, one level out: callers build this object\n // inline, so keying the extensions on it would reconfigure the editor on every\n // parent render. Only the set of bound keys can change what the keymap *is* —\n // the handlers behind them are read when the key is actually pressed.\n const extraKeysRef = useRef(extraKeys);\n useLayoutEffect(() => {\n extraKeysRef.current = extraKeys;\n });\n\n const boundKeysSignature = Object.keys(extraKeys).join('\\n');\n const boundKeys = useMemo(\n () => boundKeysSignature.split('\\n').filter(Boolean),\n [boundKeysSignature],\n );\n\n const tooltipLayer = useTooltipsExtension();\n\n // `languageData.of` takes a function CodeMirror calls per completion request, so\n // the source is built here rather than inside it — otherwise every keystroke that\n // opens the popup rebuilds an option per variable.\n const variableCompletion = useVariableCompletion(variables);\n\n const customTheme = useThemedExtension('editor:syntax', buildCustomTheme);\n\n // The brand decides which `InputGroup` the field chrome has to match, so it is\n // part of the theme's identity — `useThemedExtension` caches per key across\n // every instance, and the theme signal it keys on carries only `<html>`.\n const isArgo = useArgoDesign();\n const isField = variant === 'field';\n const baseTheme = useThemedExtension(\n isField ? `code-editor:field:${isArgo ? 'argo' : 'legacy'}` : 'code-editor:chrome',\n () =>\n EditorView.theme({\n ...buildBaseThemeStyles(),\n ...(isField ? buildChromeStyles(buildInputChrome(isArgo)) : null),\n }),\n );\n\n const commonExtensions: Extension[] = useMemo(() => {\n const callerCompletions =\n completionSource ??\n (completeAny ? completeAnyWord : autocompletions?.length ? autocompletions : null);\n\n // An empty list is left out: CodeMirror wraps a list in `completeFromList`, which\n // answers an empty result rather than none, so the editor would run a source that\n // can never match on every keystroke.\n const completionEntries = [\n ...(callerCompletions ? [{ autocomplete: callerCompletions }] : []),\n { autocomplete: variableCompletion },\n ];\n\n return [\n getLanguageMode(mode),\n shouldLintJson(mode, readOnly) ? linter(jsonParseLinter()) : [],\n withLineWrapping ? EditorView.lineWrapping : [],\n EditorState.languageData.of(() => completionEntries),\n keymap.of(\n boundKeys.map((key) => ({\n key,\n run: () => {\n extraKeysRef.current[key]?.();\n return true;\n },\n })),\n ),\n readOnly\n ? []\n : [\n // CodeMirror's own default. Gating it on the props hid completions the\n // *language* supplies — dbt's vocabulary, Snowflake's keywords — behind\n // a shortcut, and macOS leaves no usable one. With nothing to offer, no\n // popup opens anyway.\n autocompletion(),\n ],\n ariaLabel ? EditorView.contentAttributes.of({ 'aria-label': ariaLabel }) : [],\n withSearch ? searchExtension() : [],\n tooltipLayer,\n baseTheme,\n ];\n }, [\n autocompletions,\n completionSource,\n variableCompletion,\n completeAny,\n boundKeys,\n mode,\n readOnly,\n withLineWrapping,\n baseTheme,\n ariaLabel,\n withSearch,\n tooltipLayer,\n ]);\n\n const extensions = useMemo(() => {\n return [\n ...commonExtensions,\n cmPlaceholder(placeholder),\n EditorView.editable.of(!readOnly),\n // The lock is this facet and nothing else. `contenteditable` is what the\n // read-only wash keys off, and `basicSetup` is what holds the undo history,\n // so leaving both alone is what makes the lock invisible.\n EditorState.readOnly.of(readOnly || inputLocked),\n previousValue\n ? unifiedMergeView({\n original: previousValue,\n mergeControls: false,\n highlightChanges: false,\n collapseUnchanged: withCollapseUnchanged ? {} : undefined,\n })\n : [],\n ];\n }, [commonExtensions, placeholder, readOnly, inputLocked, previousValue, withCollapseUnchanged]);\n\n const config = useMemo(() => {\n return {\n ...buildBasicSetup(readOnly),\n lineNumbers: withLineNumbers,\n // Mod-f opens CodeMirror's own panel, which would run a second query and a\n // second match count over the same document beside the caller's input.\n ...(withSearch ? { searchKeymap: false } : null),\n };\n }, [withLineNumbers, readOnly, withSearch]);\n\n return (\n // oxlint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n data-variant={variant}\n className={cn(\n // Scoped to the box CodeMirror renders into rather than to every child, so\n // the toolbar below does not have to undo all three in `!important`.\n 'tw:relative tw:flex tw:min-h-0 tw:flex-col tw:[&_.cm-mergeViewEditor]:overflow-visible tw:[&_.cm-mergeViewEditors]:h-full tw:[&_.cm-mergeView]:h-full tw:[&_>.cm-theme]:h-full',\n // A field's `.cm-editor` is rounded, so the square box behind it would show\n // at the corners, and `overflow-auto` would crop the focus ring — a shadow\n // painted outside the editor's own box.\n isField\n ? 'tw:[&_>.cm-theme]:overflow-visible tw:[&_>.cm-theme]:bg-transparent'\n : 'tw:[&_>.cm-theme]:overflow-auto tw:[&_>.cm-theme]:bg-background',\n className,\n )}\n onKeyDown={(event: KeyboardEvent) => {\n if (event.key === keyCodes.ESCAPE) {\n event.stopPropagation();\n }\n }}\n >\n <ButtonToolbar value={withCopyButton ? value : undefined}>\n {renderAdditionalButtons?.(value)}\n </ButtonToolbar>\n <CodeMirror\n ref={editorRef}\n onCreateEditor={handleCreateEditor}\n theme={customTheme}\n value={value}\n onChange={handleChange}\n extensions={extensions}\n autoFocus={withAutofocus}\n basicSetup={config}\n />\n {!readOnly && (withToggleCommentHint || help || helpPostfix) && (\n <HelpBlock className=\"tw:mt-2 tw:flex tw:flex-wrap tw:gap-1\">\n {help}\n {withToggleCommentHint ? <ToggleComponentHelp /> : null}\n {helpPostfix}\n </HelpBlock>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAa,iBAAiB,E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AAG,gBAAgB,QAAQ;GAC3B,aAAa;GAGb,GAAI,aAAa,EAAE,cAAc,MAAM,IAAI;EAC7C;CACF,GAAG;EAAC;EAAiB;EAAU;CAAU,CAAC;CAE1C,OAEE,qBAAC,OAAD;EACE,gBAAc;EACd,WAAW,GAGT,kLAIA,UACI,wEACA,mEACJ,SACF;EACA,YAAY,UAAyB;GACnC,IAAI,MAAM,QAAQ,SAAS,QACzB,MAAM,gBAAgB;EAE1B;EAlBF,UAAA;GAoBE,oBAAC,eAAD;IAAe,OAAO,iBAAiB,QAAQ,KAAA;IAC5C,UAAA,0BAA0B,KAAK;GACnB,CAAA;GACf,oBAAC,YAAD;IACE,KAAK;IACL,gBAAgB;IAChB,OAAO;IACA;IACP,UAAU;IACE;IACZ,WAAW;IACX,YAAY;GACb,CAAA;GACA,CAAC,aAAa,yBAAyB,QAAQ,gBAC9C,qBAAC,WAAD;IAAW,WAAU;IAArB,UAAA;KACG;KACA,wBAAwB,oBAAC,qBAAD,CAAsB,CAAA,IAAI;KAClD;IACQ;;EAEV;;AAET"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Combobox-c_xBjf0P.js","names":["BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","Combobox","BaseCombobox"],"sources":["../src/components/Combobox/utils.ts","../src/components/Combobox/ComboboxChips.tsx","../src/components/Combobox/ComboboxContent.tsx","../src/components/Combobox/ComboboxEmpty.tsx","../src/components/Combobox/ComboboxInput.tsx","../src/components/Combobox/ComboboxInputGroup.tsx","../src/components/Combobox/ComboboxItemIndicator.tsx","../src/components/Combobox/ComboboxItem.tsx","../src/components/Combobox/ComboboxList.tsx","../src/components/Combobox/ComboboxRoot.tsx","../src/components/Combobox/ComboboxSeparator.tsx","../src/components/Combobox/Group/ComboboxGroup.tsx","../src/components/Combobox/Group/ComboboxGroupLabel.tsx","../src/components/Combobox/Group/ComboboxCollection.tsx","../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import type { CreatableItem, Group, InternalItems, LabeledItem, SelectAllItem } from './types';\n\nconst isPlainObject = (item: unknown): item is Record<string, unknown> =>\n item !== null && typeof item === 'object';\n\nconst isNumber = (item: unknown): item is number => typeof item === 'number';\nconst isString = (item: unknown): item is string => typeof item === 'string';\n\nexport const isLabeledItem = (item: unknown): item is LabeledItem =>\n isPlainObject(item) && Reflect.has(item, 'label') && Reflect.has(item, 'value');\n\nconst isInternalItem = (item: unknown): item is InternalItems =>\n isLabeledItem(item) && '__marker' in item;\n\nexport const isSelectAllItem = (item: unknown): item is SelectAllItem =>\n isInternalItem(item) && item.__marker === 'selectAll';\n\nexport const isCreatableItem = (item: unknown): item is CreatableItem => {\n return isInternalItem(item) && item.__marker === 'creatable';\n};\n\nexport const isGroupItem = <Item>(itemOrGroup: Item | Group<Item>): itemOrGroup is Group<Item> =>\n itemOrGroup !== null && typeof itemOrGroup === 'object' && Reflect.has(itemOrGroup, 'items');\n\nexport const isGroupItems = <Item, GroupShape extends Group<Item> = Group<Item>>(\n items: readonly (Item | GroupShape)[],\n): items is GroupShape[] => {\n if (!Array.isArray(items)) return false;\n if (items.length === 0) return false; // Base UI treats an empty items array as non-grouped, so we must too for consistency\n return isGroupItem(items[0]); // Base UI only checks the first item to determine if it's a group or not, so we do the same for consistency\n};\n\nexport const defaultItemToLabel = <Item>(item: Item) => {\n if (isNumber(item) || isString(item)) return item;\n if (!isLabeledItem(item))\n throw new Error(\n 'Combobox: Item does not have a `label` field. Pass `itemToLabel` for custom item shapes.',\n );\n\n return item.label;\n};\n\n/** Display string for an item — mirrors base-ui's own default logic. */\nexport const toLabel = (item: unknown): string => {\n if (isString(item)) return item;\n if (isLabeledItem(item)) {\n if (item.label) return item.label;\n if (item.value) return item.value;\n }\n return String(item);\n};\n\n/** Equality key for an item — prefers .value for stable identity. */\nexport const toValueKey = (item: unknown): string => {\n if (isString(item)) return item;\n if (isLabeledItem(item)) {\n if (item.value) return item.value;\n if (item.label) return item.label;\n }\n return String(item);\n};\n\nexport const defaultItemToIcon = <Item>(item: Item) =>\n isLabeledItem(item) ? item.icon : undefined;\n\nexport const defaultItemToDisabled = <Item>(item: Item) =>\n isLabeledItem(item) ? (item.disabled ?? false) : false;\n\nexport const defaultGroupToLabel = () => undefined;\n\n// Internal markers ------------------------------------------------------------\n// Both `selectAll` and `creatable` are LabeledItem-shaped sentinels that we\n// inject into the items list passed to Base UI. They carry a `__marker`\n// discriminator so consumer code (and user-supplied callbacks) can't collide\n// with them by accident.\n\nexport const selectAllItem: SelectAllItem = {\n __marker: 'selectAll',\n value: '__select_all__',\n label: 'Select All',\n};\n\nexport const createCreatableItem = (query: string): CreatableItem => ({\n __marker: 'creatable',\n value: query,\n label: query,\n});\n\nexport const defaultToCreateValue = <Value>(\n query: string,\n value: Value | undefined,\n queryToCreateValue?: (query: string) => Value,\n): Value => {\n if (queryToCreateValue) return queryToCreateValue(query);\n if (value === undefined) return query as Value;\n if (isString(value)) return query as Value;\n if (isLabeledItem(value)) return { value: query, label: query } as Value;\n throw new Error(\n 'Combobox: Cannot infer item shape for `allowCreate`. Pass `queryToCreateValue` for custom item shapes.',\n );\n};\n\nexport const defaultQueryToCreateLabel = (query: string) => `Create \"${query}\"`;\n","import type { ComponentProps, ReactNode } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { X } from '../../icons';\nimport { Badge } from '../Badge';\n\nimport { defaultItemToLabel } from './utils';\n\ntype BadgeColor = ComponentProps<typeof Badge>['color'];\ntype BadgeVariant = ComponentProps<typeof Badge>['variant'];\n\ntype Props<Value> = {\n maxVisible?: number;\n itemToChipLabel?: (item: Value) => ReactNode;\n itemToChipColor?: (item: Value) => BadgeColor;\n variant?: BadgeVariant;\n};\n\nexport const ComboboxChips = <Value,>({\n maxVisible = 3,\n itemToChipLabel = defaultItemToLabel,\n itemToChipColor,\n variant = 'pill',\n}: Props<Value>) => (\n <BaseCombobox.Value>\n {(values: Value[]) => {\n if (!values.length) return null;\n\n const visible = values.slice(0, maxVisible);\n const overflow = values.slice(maxVisible);\n\n return (\n <>\n {visible.map((value: Value, index) => (\n <BaseCombobox.Chip\n // oxlint-disable-next-line react/no-array-index-key\n key={index}\n render={\n <Badge.Root\n color={itemToChipColor?.(value)}\n className=\"tw:max-w-40\"\n variant={variant}\n />\n }\n >\n <Badge.Label>{itemToChipLabel(value)}</Badge.Label>\n <Badge.Addon variant=\"inline\" align=\"inline-end\">\n <BaseCombobox.ChipRemove\n render={\n <Badge.Button aria-label=\"Remove value\">\n <X className=\"tw:size-3\" />\n </Badge.Button>\n }\n />\n </Badge.Addon>\n </BaseCombobox.Chip>\n ))}\n\n {overflow.length > 0 && (\n <Badge.Root variant=\"pill\">\n <Badge.Label>+{overflow.length}</Badge.Label>\n </Badge.Root>\n )}\n </>\n );\n }}\n </BaseCombobox.Value>\n);\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { cn } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\ntype PortalProps = ComponentProps<typeof BaseCombobox.Portal>;\ntype PositionerProps = ComponentProps<typeof BaseCombobox.Positioner>;\ntype PopupProps = Omit<ComponentProps<typeof BaseCombobox.Popup>, 'className'> & {\n className?: string;\n};\n\ntype Variant = 'default' | 'argo';\n\ntype Props = PopupProps &\n Pick<PositionerProps, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'> &\n Pick<PortalProps, 'container'>;\n\nexport const ComboboxContent = ({\n ref,\n align = 'start',\n side = 'bottom',\n sideOffset = 4,\n alignOffset,\n anchor,\n container,\n className,\n children,\n ...popupProps\n}: Props) => {\n const effectiveVariant: Variant = useArgoDesign() ? 'argo' : 'default';\n return (\n <BaseCombobox.Portal container={container}>\n <BaseCombobox.Positioner\n align={align}\n side={side}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n anchor={anchor}\n className=\"tw:isolate tw:z-[1055] tailwindcss-preflight\"\n >\n <BaseCombobox.Popup\n ref={ref}\n data-chips={!!anchor}\n data-variant={effectiveVariant}\n className={cn(\n 'tw:!pointer-events-auto',\n 'tw:group/combobox-content',\n 'tw:relative',\n 'tw:flex tw:flex-col tw:overflow-hidden',\n\n // sizing\n 'tw:max-h-[var(--available-height)]',\n 'tw:w-[var(--anchor-width)]',\n 'tw:max-w-[var(--available-width)]',\n 'tw:origin-[var(--transform-origin)]',\n 'tw:data-[chips=true]:min-w-[var(--anchor-width)]',\n\n // appearance\n 'tw:rounded-lg',\n 'tw:data-[variant=default]:rounded',\n\n 'tw:bg-popover',\n 'tw:text-popover-foreground',\n 'tw:shadow-md',\n 'tw:ring-1',\n 'tw:ring-foreground/10',\n 'tw:duration-100',\n\n // open animation\n 'data-open:animate-in',\n 'data-open:fade-in-0',\n 'data-open:zoom-in-95',\n\n // closed animation\n 'data-closed:animate-out',\n 'data-closed:fade-out-0',\n 'data-closed:zoom-out-95',\n\n // position animations\n 'tw:data-[side=bottom]:slide-in-from-top-2',\n 'tw:data-[side=top]:slide-in-from-bottom-2',\n 'tw:data-[side=left]:slide-in-from-right-2',\n 'tw:data-[side=right]:slide-in-from-left-2',\n 'tw:data-[side=inline-start]:slide-in-from-right-2',\n 'tw:data-[side=inline-end]:slide-in-from-left-2',\n className,\n )}\n {...popupProps}\n >\n {children}\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { cn } from '../../utils';\n\ntype Props = Omit<ComponentProps<typeof BaseCombobox.Empty>, 'className'> & {\n className?: string;\n};\n\nexport const ComboboxEmpty = ({ ref, className, ...props }: Props) => (\n <BaseCombobox.Empty\n ref={ref}\n className={cn(\n 'tw:hidden',\n 'tw:group-data-[empty]/combobox-content:flex',\n 'tw:justify-center',\n 'tw:items-center',\n 'tw:text-center',\n 'tw:px-2',\n 'tw:text-muted-foreground',\n 'tw:py-6',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { InputGroup } from '../InputGroup';\n\ntype Props = Omit<ComponentProps<typeof BaseCombobox.Input>, 'render'>;\n\nexport const ComboboxInput = ({ ref, ...props }: Props) => (\n <BaseCombobox.Input {...props} ref={ref} render={<InputGroup.Input />} />\n);\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { InputGroup } from '../InputGroup';\n\ntype InputGroupProps = Pick<\n ComponentProps<typeof InputGroup>,\n 'variant' | 'focusVariant' | 'sizing' | 'state'\n>;\n\ntype Props = InputGroupProps &\n Omit<ComponentProps<typeof BaseCombobox.InputGroup>, 'render' | 'className'> & {\n className?: string;\n };\n\nexport const ComboboxInputGroup = ({\n ref,\n state,\n variant,\n sizing,\n focusVariant,\n className,\n ...props\n}: Props) => (\n <BaseCombobox.InputGroup\n {...props}\n ref={ref}\n render={\n <InputGroup\n state={state}\n variant={variant}\n focusVariant={focusVariant}\n sizing={sizing}\n className={className}\n />\n }\n />\n);\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { Check } from '../../icons';\nimport { cn } from '../../utils';\n\ntype Variant = 'check' | 'checkbox';\n\ntype Props = Omit<ComponentProps<typeof BaseCombobox.ItemIndicator>, 'className' | 'children'> & {\n className?: string;\n variant?: Variant;\n};\n\nexport const ComboboxItemIndicator = ({ ref, className, variant = 'check', ...props }: Props) => {\n if (variant === 'checkbox') {\n return (\n <BaseCombobox.ItemIndicator\n ref={ref}\n keepMounted\n className={cn(\n 'tw:group/combobox-item-indicator',\n\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:size-4',\n 'tw:shrink-0',\n\n 'tw:rounded',\n 'tw:border',\n 'tw:border-input',\n 'tw:bg-background',\n\n 'tw:data-[selected]:bg-primary',\n 'tw:data-[selected]:border-primary',\n className,\n )}\n {...props}\n >\n <Check\n className={cn(\n 'tw:hidden',\n 'tw:size-3',\n 'tw:stroke-[4px]',\n 'tw:!text-primary-foreground',\n 'tw:group-data-[selected]/combobox-item-indicator:block',\n )}\n />\n </BaseCombobox.ItemIndicator>\n );\n }\n\n return (\n <BaseCombobox.ItemIndicator\n {...props}\n ref={ref}\n className={cn(\n 'tw:pointer-events-none',\n 'tw:absolute',\n 'tw:right-2',\n\n 'tw:group-data-[variant=default]/combobox-content:right-4',\n // `render={<Check />}` makes the icon the indicator element itself (not a descendant), so a\n // `[&_svg]` rule never matches it — size it directly or Lucide renders at its 24px default.\n 'tw:size-4',\n 'tw:group-data-[highlighted]/combobox-item:text-accent-foreground',\n 'tw:group-data-[variant=default]/combobox-content:group-data-[highlighted]/combobox-item:text-foreground',\n className,\n )}\n render={<Check />}\n />\n );\n};\n","import type { ComponentProps, ReactNode } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { cn } from '../../utils';\n\nimport { ComboboxItemIndicator } from './ComboboxItemIndicator';\n\ntype Props = Omit<ComponentProps<typeof BaseCombobox.Item>, 'className'> & {\n className?: string;\n icon?: ReactNode;\n indicator?: ComponentProps<typeof ComboboxItemIndicator>['variant'];\n};\n\nexport const ComboboxItem = ({\n ref,\n className,\n children,\n icon,\n indicator: variant = 'check',\n ...props\n}: Props) => (\n <BaseCombobox.Item\n {...props}\n ref={ref}\n data-slot=\"combobox-item\"\n className={cn(\n 'tw:group/combobox-item',\n // layout\n 'tw:relative',\n 'tw:flex',\n 'tw:flex-1',\n 'tw:items-center',\n 'tw:gap-2',\n\n // spacing\n 'tw:py-2',\n 'tw:px-2',\n 'tw:group-data-[variant=default]/combobox-content:px-4',\n 'tw:rounded-lg',\n 'tw:group-data-[variant=default]/combobox-content:rounded-none',\n\n // typography\n 'tw:text-sm',\n 'tw:select-none',\n 'tw:cursor-default',\n 'tw:outline-hidden',\n\n // highlighted (keyboard / hover)\n 'tw:data-[highlighted]:bg-accent',\n 'tw:group-data-[variant=default]/combobox-content:data-[highlighted]:bg-neutral-100',\n 'tw:data-[highlighted]:text-accent-foreground',\n 'tw:group-data-[variant=default]/combobox-content:data-[highlighted]:text-foreground',\n\n // disabled\n 'tw:data-disabled:pointer-events-none',\n 'tw:data-disabled:opacity-50',\n\n // child svg defaults\n 'tw:[&_svg]:pointer-events-none',\n 'tw:[&_svg]:shrink-0',\n 'tw:[&_svg]:text-muted-foreground',\n \"tw:[&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n >\n {<ComboboxItemIndicator variant={variant} />}\n {icon}\n <span className=\"tw:truncate\">{children}</span>\n </BaseCombobox.Item>\n);\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { cn } from '../../utils';\n\ntype Props = Omit<ComponentProps<typeof BaseCombobox.List>, 'className'> & {\n className?: string;\n};\n\nexport const ComboboxList = ({ ref, className, ...props }: Props) => (\n <BaseCombobox.List\n ref={ref}\n className={cn(\n 'tw:no-scrollbar',\n 'tw:scroll-py-1',\n 'tw:overflow-y-auto',\n 'tw:overscroll-contain',\n 'tw:min-h-0',\n 'tw:flex-1',\n\n 'tw:p-2',\n 'tw:data-[empty]:p-0',\n 'tw:group-data-[variant=default]/combobox-content:p-0',\n className,\n )}\n {...props}\n />\n);\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nexport const ComboboxRoot = <Value, Multiple extends boolean | undefined = false>(\n props: BaseCombobox.Root.Props<Value, Multiple>,\n) => <BaseCombobox.Root {...props} />;\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { cn } from '../../utils';\n\ntype Props = Omit<ComponentProps<typeof BaseCombobox.Separator>, 'className'> & {\n className?: string;\n};\n\nexport const ComboboxSeparator = ({ ref, className, ...props }: Props) => (\n <BaseCombobox.Separator\n ref={ref}\n className={cn('tw:mx-2 tw:my-1 tw:h-px tw:bg-border', className)}\n {...props}\n />\n);\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { cn } from '../../../utils';\n\ntype Props = Omit<ComponentProps<typeof BaseCombobox.Group>, 'className'> & {\n className?: string;\n};\n\nexport const ComboboxGroup = ({ ref, className, children, ...props }: Props) => (\n <BaseCombobox.Group\n ref={ref}\n className={cn('tw:flex tw:flex-col tw:gap-0.5', className)}\n {...props}\n >\n {children}\n </BaseCombobox.Group>\n);\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { cn } from '../../../utils';\n\ntype Props = Omit<BaseCombobox.GroupLabel.Props, 'className'> & {\n className?: string;\n};\n\nexport const ComboboxGroupLabel = ({ ref, className, ...props }: Props) => (\n <BaseCombobox.GroupLabel\n {...props}\n ref={ref}\n className={cn(\n // Base (argo variant) — soft gray section label.\n 'tw:px-2',\n 'tw:py-1.5',\n 'tw:text-xs',\n 'tw:font-medium',\n 'tw:leading-none',\n 'tw:text-muted-foreground',\n\n 'tw:group-data-[variant=default]/combobox-content:uppercase',\n 'tw:group-data-[variant=default]/combobox-content:font-semibold',\n 'tw:group-data-[variant=default]/combobox-content:tracking-wider',\n 'tw:group-data-[variant=default]/combobox-content:text-[11px]',\n 'tw:group-data-[variant=default]/combobox-content:text-black',\n 'tw:group-data-[variant=default]/combobox-content:pt-2',\n 'tw:group-data-[variant=default]/combobox-content:px-4',\n\n className,\n )}\n />\n);\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\ntype Props = BaseCombobox.Collection.Props;\n\nexport const ComboboxCollection = ({ ...props }: Props) => (\n <BaseCombobox.Collection data-slot=\"combobox-collection\" {...props} />\n);\n","import {\n type ComponentProps,\n type CSSProperties,\n type ReactNode,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport { useVirtualizer } from '@tanstack/react-virtual';\n\nimport { ChevronDown, Plus, X } from '../../icons';\nimport { InputGroup } from '../InputGroup';\n\nimport { ComboboxChips } from './ComboboxChips';\nimport { ComboboxContent } from './ComboboxContent';\nimport { ComboboxEmpty } from './ComboboxEmpty';\nimport { ComboboxInput } from './ComboboxInput';\nimport { ComboboxInputGroup } from './ComboboxInputGroup';\nimport { ComboboxItem } from './ComboboxItem';\nimport { ComboboxList } from './ComboboxList';\nimport { ComboboxRoot } from './ComboboxRoot';\nimport { ComboboxSeparator } from './ComboboxSeparator';\nimport { ComboboxCollection, ComboboxGroup, ComboboxGroupLabel } from './Group';\nimport type { Group } from './types';\nimport {\n createCreatableItem,\n defaultGroupToLabel,\n defaultItemToDisabled,\n defaultItemToIcon,\n defaultItemToLabel,\n defaultQueryToCreateLabel,\n defaultToCreateValue,\n isCreatableItem,\n isGroupItem,\n isGroupItems,\n toLabel,\n toValueKey,\n} from './utils';\n\n// Above this many (ungrouped) items, the list is windowed with `@tanstack/react-virtual` so only\n// the visible rows hit the DOM. Base UI keeps keyboard nav + filtering working against the full\n// `items` set (via `virtualized`), so search is unaffected.\nconst VIRTUALIZE_THRESHOLD = 30;\nconst ESTIMATED_ROW_HEIGHT = 40;\nconst ESTIMATED_LIST_HEIGHT = 320;\n\ntype ComboboxProps<Value> = BaseCombobox.Root.Props<Value, false>;\ntype ComboboxInputProps = ComponentProps<typeof ComboboxInput>;\ntype ComboboxInputGroupProps = ComponentProps<typeof ComboboxInputGroup>;\ntype ComboboxItemProps = ComponentProps<typeof ComboboxItem>;\n\ntype Indicator = NonNullable<ComboboxItemProps['indicator']>;\n\ntype PublicComboboxInputProps = Pick<ComboboxInputProps, 'placeholder' | 'id'> &\n Pick<ComboboxInputGroupProps, 'variant' | 'focusVariant' | 'sizing' | 'state' | 'className'>;\n\ntype PublicComboboxProps<Value> = Pick<\n ComboboxProps<Value>,\n | 'disabled'\n | 'inputRef'\n | 'value'\n | 'defaultValue'\n | 'onValueChange'\n | 'itemToStringLabel'\n | 'itemToStringValue'\n | 'filter'\n | 'onOpenChangeComplete'\n | 'isItemEqualToValue'\n>;\n\ntype CreatableProps<Value> = {\n allowCreate?: boolean;\n queryToCreateLabel?: (query: string) => ReactNode;\n queryToCreateValue?: (query: string) => Value;\n};\n\ntype Props<Value, GroupShape extends Group<Value> = Group<Value>> = PublicComboboxInputProps &\n PublicComboboxProps<Value> &\n CreatableProps<Value> & {\n items?: readonly (Value | GroupShape)[];\n\n // root specific\n allowClear?: boolean;\n empty?: ReactNode;\n indicator?: Indicator;\n prefix?: ReactNode;\n /**\n * Window the list with a virtualizer so large option sets stay fast. Opt-in — defaults to\n * `false` to keep behavior unchanged for existing call sites (every option stays in the DOM).\n * Pass `'auto'` to virtualize only ungrouped lists longer than {@link VIRTUALIZE_THRESHOLD},\n * or `true` to force it. Grouped lists are never virtualized.\n */\n virtualized?: boolean | 'auto';\n\n // item specific\n itemToLabel?: (item: Value) => ReactNode;\n itemToIcon?: (item: Value) => ReactNode;\n itemToDisabled?: (item: Value) => boolean;\n\n // group specific\n groupToLabel?: (group: GroupShape) => ReactNode;\n };\n\nexport const Combobox = <Value, GroupShape extends Group<Value> = Group<Value>>({\n // root props\n items: _itemsProp,\n value,\n defaultValue,\n onValueChange,\n itemToStringLabel: itemToStringLabelProp,\n itemToStringValue,\n disabled,\n filter,\n inputRef,\n onOpenChangeComplete,\n isItemEqualToValue: isItemEqualToValueProp,\n\n // input props\n variant,\n sizing,\n focusVariant,\n state,\n placeholder,\n allowClear,\n id,\n className,\n\n // own props\n empty = 'No items',\n indicator,\n prefix,\n virtualized = false,\n\n // creatable\n allowCreate,\n queryToCreateValue,\n queryToCreateLabel = defaultQueryToCreateLabel,\n\n // own item props\n itemToDisabled = defaultItemToDisabled,\n itemToLabel = defaultItemToLabel,\n itemToIcon = defaultItemToIcon,\n groupToLabel = defaultGroupToLabel,\n}: Props<Value, GroupShape>) => {\n const closeReasonRef = useRef<'outside-click' | 'item-press' | 'creatable-item-press' | 'none'>(\n 'none',\n );\n const [inputValue, setInputValue] = useState(() => {\n const initial = value !== undefined ? value : defaultValue;\n if (initial == null) return '';\n return itemToStringLabelProp?.(initial) ?? toLabel(initial);\n });\n\n useEffect(() => {\n if (value === undefined) return;\n const label = value === null ? '' : (itemToStringLabelProp?.(value) ?? toLabel(value));\n setInputValue((prev) => (prev === label ? prev : label));\n }, [value]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const selectedLabel =\n value == null ? undefined : (itemToStringLabelProp?.(value) ?? toLabel(value));\n // While the input still shows the current selection's label (nothing typed since the popup\n // opened), treat it as an empty query so the whole list stays browsable. Otherwise the combobox\n // filters down to just the selected item and you can't switch to a different, unrelated one\n // without clearing first.\n const isShowingSelection = selectedLabel !== undefined && inputValue === selectedLabel;\n const query = (isShowingSelection ? '' : inputValue).trim();\n const queryLower = query.toLowerCase();\n\n const itemsProp = _itemsProp ?? [];\n const sampleItem = itemsProp.flatMap((item) => (isGroupItem(item) ? item.items : [item]))[0];\n\n const [createdItems, setCreatedItems] = useState<Value[]>([]);\n\n const allItems = (() => {\n if (createdItems.length === 0) return itemsProp as (Value | GroupShape)[];\n if (isGroupItems(itemsProp))\n return [...itemsProp, { items: createdItems } as unknown as GroupShape];\n return [...itemsProp, ...createdItems];\n })();\n\n const items = (() => {\n if (!allowCreate || disabled) return allItems;\n if (!query) return allItems;\n const exactMatch = allItems\n .flatMap((item) => (isGroupItem(item) ? item.items : [item]))\n .some(\n (item) => (itemToStringLabelProp?.(item) ?? toLabel(item)).toLowerCase() === queryLower,\n );\n if (exactMatch) return allItems;\n\n const creatable = isGroupItems(itemsProp)\n ? [{ items: [createCreatableItem(query)] }]\n : [createCreatableItem(query)];\n\n return [...allItems, ...creatable];\n })();\n\n const itemToStringLabel: ComboboxProps<Value>['itemToStringLabel'] = (value) => {\n if (isCreatableItem(value)) return value.value;\n return itemToStringLabelProp?.(value) ?? toLabel(value);\n };\n\n const wrappedFilter: ComboboxProps<Value>['filter'] = isShowingSelection\n ? () => true\n : !allowCreate || !filter\n ? filter\n : (item, ...args) => isCreatableItem(item) || filter(item, ...args);\n\n const wrappedItemToStringValue: ComboboxProps<Value>['itemToStringValue'] =\n !allowCreate || !itemToStringValue\n ? itemToStringValue\n : (item) => (isCreatableItem(item) ? item.value : itemToStringValue(item));\n\n const isItemEqualToValue: ComboboxProps<Value>['isItemEqualToValue'] = (a, b) => {\n if (isCreatableItem(a) || isCreatableItem(b)) return toValueKey(a) === toValueKey(b);\n return isItemEqualToValueProp?.(a, b) ?? Object.is(a, b);\n };\n\n const handleInputValueChange: NonNullable<ComboboxProps<Value>['onInputValueChange']> = (\n value,\n { reason },\n ) => {\n if (\n ['input-clear', 'none'].includes(reason) &&\n ['item-press', 'creatable-item-press'].includes(closeReasonRef.current)\n ) {\n closeReasonRef.current = 'none';\n return;\n }\n\n if (reason === 'none' && closeReasonRef.current == 'outside-click') {\n closeReasonRef.current = 'none';\n setInputValue(value);\n return;\n }\n\n setInputValue(value);\n };\n\n const handleOnOpenChangeComplete: NonNullable<ComboboxProps<Value>['onOpenChangeComplete']> = (\n open,\n ) => {\n onOpenChangeComplete?.(open);\n if (open) return;\n if (closeReasonRef.current !== 'none') return;\n closeReasonRef.current = 'outside-click';\n };\n\n const handleOnValueChange: ComboboxProps<Value>['onValueChange'] = (next, event) => {\n if (isCreatableItem(next)) {\n const newValue = defaultToCreateValue(next.value, sampleItem, queryToCreateValue) as Value;\n closeReasonRef.current = 'creatable-item-press';\n setCreatedItems((prev) => [...prev, newValue]);\n onValueChange?.(newValue, event);\n return;\n }\n\n closeReasonRef.current = 'item-press';\n onValueChange?.(next, event);\n };\n\n // State-backed (not a ref) so a re-render fires when the popup mounts/remounts — Base UI unmounts\n // the list on close, and the virtualizer must re-observe the fresh element on each reopen or it\n // measures a stale/detached node and paints nothing.\n const [listElement, setListElement] = useState<HTMLDivElement | null>(null);\n // Base the decision on `allItems` (the real options) rather than `items`, which also holds the\n // transient creatable row — otherwise virtualization could toggle on/off as the user types.\n const isGrouped = isGroupItems(allItems);\n const shouldVirtualize =\n !isGrouped &&\n (virtualized === true || (virtualized === 'auto' && allItems.length > VIRTUALIZE_THRESHOLD));\n\n // In virtualized mode we pre-filter here and disable Base UI's filter with `null` (see the Root\n // `filter` prop — `undefined` would keep Base UI's default `contains`, which re-filters our items\n // with a different predicate and wrongly drives the empty state + keyboard nav). The creatable\n // row is always kept.\n const matchesQuery = (item: Value) => {\n if (isCreatableItem(item)) return true;\n if (!query) return true;\n if (filter) return !!filter(item, query, (value) => itemToStringLabel(value) ?? toLabel(value));\n return (itemToStringLabel(item) ?? toLabel(item)).toLowerCase().includes(queryLower);\n };\n\n const virtualItems = shouldVirtualize ? (items as Value[]).filter(matchesQuery) : [];\n\n const virtualizer = useVirtualizer({\n count: virtualItems.length,\n getScrollElement: () => listElement,\n estimateSize: () => ESTIMATED_ROW_HEIGHT,\n overscan: 12,\n enabled: shouldVirtualize,\n // Seed a viewport height so rows paint on the first frame. Without it the list measures 0 until\n // the ResizeObserver fires (a frame later), which renders an empty popup on open.\n initialRect: { width: 0, height: ESTIMATED_LIST_HEIGHT },\n });\n\n const renderItem = (item: Value, index?: number) => {\n if (isCreatableItem(item)) {\n return (\n <Combobox.Item index={index} value={item} icon={<Plus />}>\n {queryToCreateLabel(item.value)}\n </Combobox.Item>\n );\n }\n\n return (\n <Combobox.Item\n index={index}\n value={item}\n indicator={indicator}\n icon={itemToIcon(item)}\n disabled={itemToDisabled(item)}\n >\n {itemToLabel(item)}\n </Combobox.Item>\n );\n };\n\n const rowStyle = (offset: number): CSSProperties => ({\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n transform: `translateY(${offset}px)`,\n });\n\n return (\n <BaseCombobox.Root<Value, false>\n items={shouldVirtualize ? virtualItems : items}\n value={value}\n defaultValue={defaultValue}\n filter={shouldVirtualize ? null : wrappedFilter}\n onValueChange={handleOnValueChange}\n itemToStringLabel={itemToStringLabel}\n isItemEqualToValue={isItemEqualToValue}\n itemToStringValue={wrappedItemToStringValue}\n onOpenChangeComplete={handleOnOpenChangeComplete}\n disabled={disabled}\n inputRef={inputRef}\n inputValue={inputValue}\n onInputValueChange={handleInputValueChange}\n virtualized={shouldVirtualize}\n onItemHighlighted={(_, details) => {\n if (shouldVirtualize && details.reason === 'keyboard') {\n virtualizer.scrollToIndex(details.index);\n }\n }}\n >\n <ComboboxInputGroup\n variant={variant}\n sizing={sizing}\n state={state}\n focusVariant={focusVariant}\n className={className}\n >\n {prefix && <InputGroup.Addon align=\"inline-start\">{prefix}</InputGroup.Addon>}\n <ComboboxInput id={id} placeholder={placeholder} disabled={disabled} />\n <InputGroup.Addon align=\"inline-end\">\n {allowClear && (\n <InputGroup.Button asChild aria-label=\"Clear\" disabled={disabled}>\n <BaseCombobox.Clear>\n <X className=\"tw:size-4\" />\n </BaseCombobox.Clear>\n </InputGroup.Button>\n )}\n <InputGroup.Button disabled={disabled} asChild aria-label=\"Open combobox\">\n <BaseCombobox.Trigger>\n <ChevronDown className=\"tw:size-4\" />\n </BaseCombobox.Trigger>\n </InputGroup.Button>\n </InputGroup.Addon>\n </ComboboxInputGroup>\n <ComboboxContent>\n <ComboboxEmpty>{empty}</ComboboxEmpty>\n {shouldVirtualize ? (\n <ComboboxList ref={setListElement}>\n <div\n style={{\n position: 'relative',\n width: '100%',\n height: `${virtualizer.getTotalSize()}px`,\n }}\n >\n {virtualizer.getVirtualItems().map((row) => {\n const item = virtualItems[row.index];\n if (item === undefined) return null;\n return (\n <div\n key={row.key}\n data-index={row.index}\n ref={virtualizer.measureElement}\n style={rowStyle(row.start)}\n >\n {renderItem(item, row.index)}\n </div>\n );\n })}\n </div>\n </ComboboxList>\n ) : (\n <ComboboxList>\n {(itemOrGroup: Value | GroupShape) => {\n if (isCreatableItem(itemOrGroup))\n return (\n <Combobox.Item value={itemOrGroup} icon={<Plus />}>\n {queryToCreateLabel(itemOrGroup.value)}\n </Combobox.Item>\n );\n\n if (isGroupItem(itemOrGroup)) {\n const maybeCreatable = itemOrGroup.items[0];\n\n if (isCreatableItem(maybeCreatable)) {\n return (\n <Combobox.Item value={maybeCreatable} icon={<Plus />}>\n {queryToCreateLabel(maybeCreatable.value)}\n </Combobox.Item>\n );\n }\n\n const groupLabel = groupToLabel(itemOrGroup);\n\n return (\n <Combobox.Group items={itemOrGroup.items}>\n {groupLabel && <Combobox.GroupLabel>{groupLabel}</Combobox.GroupLabel>}\n {/* Don't forward `renderItem` by reference — the collection passes its\n group-local index, which ComboboxItem uses verbatim and breaks keyboard\n nav. Drop it so the item falls back to its own global list index. */}\n <Combobox.GroupList>{(item: Value) => renderItem(item)}</Combobox.GroupList>\n </Combobox.Group>\n );\n }\n\n return renderItem(itemOrGroup);\n }}\n </ComboboxList>\n )}\n </ComboboxContent>\n </BaseCombobox.Root>\n );\n};\n\n// Base\nCombobox.Root = ComboboxRoot;\nCombobox.InputGroup = ComboboxInputGroup;\nCombobox.Input = ComboboxInput;\nCombobox.Content = ComboboxContent;\nCombobox.List = ComboboxList;\nCombobox.Item = ComboboxItem;\nCombobox.Empty = ComboboxEmpty;\nCombobox.Value = BaseCombobox.Value;\nCombobox.Separator = ComboboxSeparator;\n\n// Group\nCombobox.Group = ComboboxGroup;\nCombobox.GroupLabel = ComboboxGroupLabel;\nCombobox.GroupList = ComboboxCollection;\n\n// Chips\nCombobox.Chips = ComboboxChips;\n"],"mappings":";;;;;;;;;;AAEA,MAAM,iBAAiB,SACrB,SAAS,QAAQ,OAAO,SAAS;AAEnC,MAAM,YAAY,SAAkC,OAAO,SAAS;AACpE,MAAM,YAAY,SAAkC,OAAO,SAAS;AAEpE,MAAa,iBAAiB,SAC5B,cAAc,IAAI,KAAK,QAAQ,IAAI,MAAM,OAAO,KAAK,QAAQ,IAAI,MAAM,OAAO;AAEhF,MAAM,kBAAkB,SACtB,cAAc,IAAI,KAAK,cAAc;AAKvC,MAAa,mBAAmB,SAAyC;CACvE,OAAO,eAAe,IAAI,KAAK,KAAK,aAAa;AACnD;AAEA,MAAa,eAAqB,gBAChC,gBAAgB,QA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IACO;IACL,cAAY,CAAC,CAAC;IACd,gBAAc;IACd,WAAW,GACT,2BACA,6BACA,eACA,0CAGA,sCACA,8BACA,qCACA,uCACA,oDAGA,iBACA,qCAEA,iBACA,8BACA,gBACA,aACA,yBACA,mBAGA,wBACA,uBACA,wBAGA,2BACA,0BACA,2BAGA,6CACA,6CACA,6CACA,6CACA,qDACA,kDACA,SACF;IACA,GAAI;IAEH;GACiB,CAAA;EACG,CAAA;CACN,CAAA;AAEzB;;;ACtFA,MAAa,iBAAiB,EAAE,KAAK,WAAW,GAAG,YACjD,oBAACC,SAAa,OAAd;CACO;CACL,WAAW,GACT,aACA,+CACA,qBACA,mBACA,kBACA,WACA,4BACA,WACA,SACF;CACA,GAAI;AACL,CAAA;;;ACjBH,MAAa,iBAAiB,EAAE,KAAK,GAAG,YACtC,oBAACC,SAAa,OAAd;CAAoB,GAAI;CAAY;CAAK,QAAQ,oBAAC,WAAW,OAAZ,CAAmB,CAAA;AAAI,CAAA;;;ACO1E,MAAa,sBAAsB,EACjC,KACA,OACA,SACA,QACA,cACA,WACA,GAAG,YAEH,oBAACC,SAAa,YAAd;CACE,GAAI;CACC;CACL,QACE,oBAAC,YAAD;EACS;EACE;EACK;EACN;EACG;CACZ,CAAA;AAEJ,CAAA;;;ACvBH,MAAa,yBAAyB,EAAE,KAAK,WAAW,UAAU,SAAS,GAAG,YAAmB;CAC/F,IAAI,YAAY,YACd,OACE,oBAACC,SAAa,eAAd;EACO;EACL,aAAA;EACA,WAAW,GACT,oCAEA,kBACA,mBACA,qBACA,aACA,eAEA,cACA,aACA,mBACA,oBAEA,iCACA,qCACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,OAAD,EACE,WAAW,GACT,aACA,aACA,mBACA,+BACA,wDACF,EACD,CAAA;CACyB,CAAA;CAIhC,OACE,oBAACA,SAAa,eAAd;EACE,GAAI;EACC;EACL,WAAW,GACT,0BACA,eACA,cAEA,4DAGA,aACA,oEACA,2GACA,SACF;EACA,QAAQ,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;GAEA,OAAO,WAAW,WAAW;EAC/B,EACY,CAAA,CAED,EAAA,CAAA,CACA;;AAEvB;AAGA,WAAS,OAAO;AAChB,WAAS,aAAa;AACtB,WAAS,QAAQ;AACjB,WAAS,UAAU;AACnB,WAAS,OAAO;AAChB,WAAS,OAAO;AAChB,WAAS,QAAQ;AACjB,WAAS,QAAQC,SAAa;AAC9B,WAAS,YAAY;AAGrB,WAAS,QAAQ;AACjB,WAAS,aAAa;AACtB,WAAS,YAAY;AAGrB,WAAS,QAAQ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DiagramSkeleton-lwBS2YBa.js","names":[],"sources":["../src/blocks/MermaidDiagram/DiagramSkeleton.tsx"],"sourcesContent":["import { Skeleton } from '../../components/Skeleton/Skeleton';\n\n// Lives apart from MermaidDiagram so callers can show it while that component's\n// chunk is still loading, without importing beautiful-mermaid to do it.\nexport const DiagramSkeleton = () => (\n <div className=\"tw:my-3 tw:overflow-hidden tw:rounded-md tw:border tw:border-border tw:bg-muted tw:p-6\">\n <Skeleton className=\"tw:h-40\" />\n </div>\n);\n"],"mappings":";;;AAIA,MAAa,wBACX,oBAAC,OAAD;CAAK,WAAU;CACb,UAAA,oBAAC,UAAD,EAAU,WAAU,UAAW,CAAA;AAC5B,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DropdownMenu-B6ZbYvaM.js","names":["Root"],"sources":["../src/components/DropdownMenu/DropdownMenuItemIndicator.tsx","../src/components/DropdownMenu/ItemIcon.tsx","../src/components/DropdownMenu/styles.ts","../src/components/DropdownMenu/DropdownMenuCheckboxItem.tsx","../src/components/DropdownMenu/DropdownMenuContext.tsx","../src/components/DropdownMenu/DropdownMenuContent.tsx","../src/components/DropdownMenu/DropdownMenuItem.tsx","../src/components/DropdownMenu/DropdownMenuItemDescription.tsx","../src/components/DropdownMenu/DropdownMenuLabel.tsx","../src/components/DropdownMenu/DropdownMenuRadioGroup/DropdownMenuRadioGroup.tsx","../src/components/DropdownMenu/DropdownMenuRadioGroup/DropdownMenuRadioItem.tsx","../src/components/DropdownMenu/DropdownMenuSeparator.tsx","../src/components/DropdownMenu/DropdownMenuSub/DropdownMenuSub.tsx","../src/components/DropdownMenu/DropdownMenuSub/DropdownMenuSubContent.tsx","../src/components/DropdownMenu/DropdownMenuSub/DropdownMenuSubTrigger.tsx","../src/components/DropdownMenu/DropdownMenuTrigger.tsx","../src/components/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cva } from 'class-variance-authority';\n\nimport { Check, Circle, ToggleRight } from '../../icons';\n\nconst variants = cva(\n [\n 'tailwindcss-preflight',\n 'tw:pointer-events-none',\n\n // sizing\n 'tw:size-4',\n 'tw:aspect-square',\n 'tw:shrink-0',\n\n // layout\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n ],\n {\n variants: {\n variant: {\n none: [],\n radio: [\n 'tw:border',\n 'tw:border-solid',\n 'tw:border-border',\n 'tw:rounded-full',\n 'tw:group-data-[variant=default]/dropdown-menu-content:bg-white',\n 'tw:group-data-[variant=argo]/dropdown-menu-content:bg-background',\n\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-2',\n 'tw:data-[state=unchecked]:[&_svg]:hidden',\n // Lucide Circle is stroke-only — force fill to match the stroke\n // (currentColor) so the indicator reads as a solid dot.\n 'tw:[&_svg]:fill-current',\n 'tw:group-data-[variant=argo]/dropdown-menu-content:[&_svg]:text-primary',\n 'tw:group-data-[variant=default]/dropdown-menu-content:[&_svg]:text-primary',\n ],\n check: ['tw:[&_svg:not([class*=\"tw:size-\"])]:size-3.5', 'tw:[&_svg]:text-primary'],\n checkbox: [\n 'tw:[&_svg]:text-primary-foreground',\n 'tw:border',\n 'tw:border-solid',\n 'tw:rounded',\n 'tw:group-data-[variant=default]/dropdown-menu-content:border-neutral-200',\n 'tw:group-data-[variant=argo]/dropdown-menu-content:border-input',\n\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-3',\n 'tw:data-[state=unchecked]:[&_svg]:hidden',\n 'tw:group-data-[variant=argo]/dropdown-menu-content:data-[state=checked]:border-primary',\n 'tw:group-data-[variant=argo]/dropdown-menu-content:data-[state=checked]:bg-primary',\n 'tw:group-data-[variant=default]/dropdown-menu-content:data-[state=checked]:border-primary',\n 'tw:group-data-[variant=default]/dropdown-menu-content:data-[state=checked]:bg-primary',\n ],\n switch: [\n 'tw:size-5',\n // Lucide SVGs default to 24×24 — constrain the rendered ToggleRight\n // to the indicator slot so it doesn't overflow.\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-5',\n 'tw:text-neutral-400',\n 'tw:data-[state=unchecked]:rotate-180',\n 'tw:group-data-[variant=default]/dropdown-menu-content:data-[state=checked]:text-primary',\n 'tw:group-data-[variant=argo]/dropdown-menu-content:data-[state=checked]:text-primary',\n ],\n },\n },\n },\n);\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.ItemIndicator> &\n VariantProps<typeof variants>;\n\nexport const DropdownMenuItemIndicator = ({\n variant,\n className,\n forceMount: forceMountProp,\n ...rest\n}: Props) => {\n const IconComp = (() => {\n if (variant === 'switch') return ToggleRight;\n if (variant === 'radio') return Circle;\n return Check;\n })();\n\n const forceMount = (() => {\n if (forceMountProp) return true;\n // All variants, except for check, require rendering at all times.\n return variant === 'check' ? undefined : true;\n })();\n\n if (variant === 'none') return null;\n\n return (\n <DropdownMenuPrimitive.ItemIndicator\n {...rest}\n forceMount={forceMount}\n className={variants({ variant, className })}\n >\n <IconComp />\n </DropdownMenuPrimitive.ItemIndicator>\n );\n};\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'span'> & {\n children: ReactNode;\n};\n\nexport const ItemIcon = ({ className, children, ...props }: Props) => (\n <span\n {...props}\n className={cn(\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:aspect-square',\n // 20px container fits the 16px Lucide glyph plus 2px breathing room\n // each side — the previous tw:size-4 + tw:p-0.5 clipped the 16px child.\n 'tw:size-5',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4',\n 'tw:group-data-[variant=default]/dropdown-menu-content:text-neutral-400',\n 'tw:group-data-[variant=argo]/dropdown-menu-content:text-primary',\n 'tw:group-data-[variant=argo]/dropdown-menu-content:group-aria-disabled:text-muted-foreground',\n 'tw:group-data-[variant=default]/dropdown-menu-content:group-hover:text-primary',\n className,\n )}\n >\n {children}\n </span>\n);\n","import { cn } from '../../utils';\n\nexport const itemVariants = cn(\n // reset\n 'tailwindcss-preflight',\n 'tw:outline-hidden',\n 'tw:group',\n 'tw:peer',\n 'tw:relative',\n\n // positioning\n 'tw:flex',\n 'tw:flex-1',\n 'tw:items-center',\n 'tw:gap-2',\n\n // An icon passed as `children` rather than via the `icon` prop misses `ItemIcon`,\n // so without this it falls back to Lucide's 24px default and towers over the\n // siblings this row is laid out for. The `:not()` keeps a call-site size winning.\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4',\n\n 'tw:cursor-pointer',\n 'tw:select-none',\n 'tw:transition-colors',\n\n // spacing\n 'tw:p-2',\n\n // typography\n 'tw:font-sans',\n 'tw:text-sm',\n\n 'tw:aria-disabled:pointer-events-none',\n 'tw:aria-disabled:opacity-50',\n\n 'tw:focus-visible:outline-hidden',\n\n 'tw:group-data-[variant=default]/dropdown-menu-content:rounded',\n 'tw:group-data-[variant=default]/dropdown-menu-content:focus:bg-neutral-100',\n 'tw:group-data-[variant=default]/dropdown-menu-content:focus:text-neutral-900',\n 'tw:group-data-[variant=default]/dropdown-menu-content:hover:bg-neutral-100',\n 'tw:group-data-[variant=default]/dropdown-menu-content:hover:text-neutral-900',\n\n 'tw:group-data-[variant=argo]/dropdown-menu-content:rounded-md',\n 'tw:group-data-[variant=argo]/dropdown-menu-content:text-popover-foreground',\n 'tw:group-data-[variant=argo]/dropdown-menu-content:focus:text-primary',\n 'tw:group-data-[variant=argo]/dropdown-menu-content:focus:bg-primary/10',\n 'tw:group-data-[variant=argo]/dropdown-menu-content:hover:text-primary',\n 'tw:group-data-[variant=argo]/dropdown-menu-content:hover:bg-primary/10',\n);\n\nexport const contentVariants = cn(\n 'tailwindcss-preflight',\n 'tw:group/dropdown-menu-content',\n // Sit above Modal/Sheet (z-1051), matching the other floating overlays (Popover/Select z-1055)\n 'tw:z-[1055]',\n\n // positioning\n 'tw:flex',\n 'tw:flex-col',\n 'tw:origin-(--radix-dropdown-menu-content-transform-origin)',\n\n // sizing\n 'tw:max-h-[var(--radix-dropdown-menu-content-available-height)]',\n 'tw:min-w-32',\n\n // border\n 'tw:border',\n 'tw:shadow-md',\n\n // Legacy surface — fixed white panel.\n 'tw:data-[variant=default]:rounded-md',\n 'tw:data-[variant=default]:bg-white',\n 'tw:data-[variant=default]:border-neutral-100',\n 'tw:data-[variant=default]:text-neutral-800',\n // Argo surface — semantic popover tokens (brand + dark aware).\n 'tw:data-[variant=argo]:rounded-2xl',\n 'tw:data-[variant=argo]:bg-popover',\n 'tw:data-[variant=argo]:text-popover-foreground',\n 'tw:data-[variant=argo]:border-border',\n\n // animations\n 'tw:data-[state=open]:animate-in',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=open]:zoom-in-95',\n\n 'tw:data-[state=closed]:animate-out',\n 'tw:data-[state=closed]:fade-out-0',\n 'tw:data-[state=closed]:zoom-out-95',\n\n 'tw:data-[side=bottom]:slide-in-from-top-2',\n 'tw:data-[side=left]:slide-in-from-right-2',\n 'tw:data-[side=right]:slide-in-from-left-2',\n 'tw:data-[side=top]:slide-in-from-bottom-2',\n);\n","import type { ComponentProps } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { Loader2 } from '../../icons';\nimport { cn } from '../../utils';\n\nimport { DropdownMenuItemIndicator } from './DropdownMenuItemIndicator';\nimport { ItemIcon } from './ItemIcon';\nimport { itemVariants } from './styles';\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {\n closeOnSelect?: boolean;\n indicator?: 'switch' | 'checkbox' | 'check';\n indicatorAlign?: 'start' | 'end';\n isLoading?: boolean;\n};\n\nexport const DropdownMenuCheckboxItem = ({\n className,\n children,\n checked,\n closeOnSelect = false,\n onSelect,\n indicatorAlign = 'start',\n indicator = 'checkbox',\n isLoading = false,\n ...props\n}: Props) => {\n const isAtStart = indicatorAlign === 'start';\n const indicatorEle = isLoading ? (\n <ItemIcon className={isAtStart ? '' : 'tw:ml-auto'}>\n <Loader2 className=\"tw:animate-spin\" />\n </ItemIcon>\n ) : (\n <DropdownMenuItemIndicator variant={indicator} className={isAtStart ? '' : 'tw:ml-auto'} />\n );\n\n const handleSelect = (event: Event) => {\n if (!closeOnSelect) event.preventDefault();\n onSelect?.(event);\n };\n\n return (\n <DropdownMenuPrimitive.CheckboxItem\n className={cn(itemVariants, className)}\n checked={checked}\n onSelect={handleSelect}\n {...props}\n >\n {isAtStart && indicatorEle}\n {children}\n {!isAtStart && indicatorEle}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n};\n","import { createContext, use } from 'react';\n\nexport type DropdownMenuVariant = 'default' | 'argo';\n\ntype DropdownMenuContextType = {\n variant: DropdownMenuVariant;\n};\n\nexport const DropdownMenuContext = createContext<DropdownMenuContextType>({\n variant: 'default',\n});\n\nexport const useDropdownMenuContext = () => use(DropdownMenuContext);\n","import type { ComponentProps } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { cn } from '../../utils';\nimport { ScrollArea } from '../ScrollArea';\n\nimport { useDropdownMenuContext } from './DropdownMenuContext';\nimport { contentVariants } from './styles';\n\ntype Props = Omit<\n ComponentProps<typeof DropdownMenuPrimitive.Content>,\n 'forceMount' | 'asChild'\n> & {\n forceMount?: boolean;\n viewPortClassName?: string;\n container?: HTMLElement | null;\n};\n\nexport const DropdownMenuContent = ({\n className,\n sideOffset = 4,\n forceMount,\n children,\n viewPortClassName,\n container,\n ...props\n}: Props) => {\n const { variant } = useDropdownMenuContext();\n\n return (\n <DropdownMenuPrimitive.Portal forceMount={forceMount || undefined} container={container}>\n <DropdownMenuPrimitive.Content\n {...props}\n data-variant={variant}\n sideOffset={sideOffset}\n className={contentVariants}\n >\n <ScrollArea\n className={className}\n viewPortClassName={cn(\n 'tw:p-2',\n 'tw:max-h-[var(--radix-dropdown-menu-content-available-height)]',\n viewPortClassName,\n )}\n scrollBarClassName=\"tw:w-1.5\"\n >\n {children}\n </ScrollArea>\n </DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>\n );\n};\n","import type { ComponentProps, PointerEventHandler, ReactNode } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { Root, Slottable } from '@radix-ui/react-slot';\n\nimport { Loader2 } from '../../icons';\nimport { cn } from '../../utils';\n\nimport { ItemIcon } from './ItemIcon';\nimport { itemVariants } from './styles';\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n /**\n * Fix for `autoFocus` on inputs not working correctly in modals.\n * While the DropdownMenuItem was animating out and the modal was animating in, the dying DropdownMenuItem was constantly trying to steal focus while the Dialog was trying to correctly set the new focus.\n * https://github.com/radix-ui/primitives/issues/2193#issuecomment-2758461323\n */\n asModalTrigger?: boolean;\n /** Pass a Lucide icon node as a leading adornment. */\n icon?: ReactNode;\n isLoading?: boolean;\n iconClassName?: string;\n};\n\nexport const DropdownMenuItem = ({\n ref,\n className,\n asModalTrigger = false,\n onSelect,\n onPointerLeave,\n onPointerMove,\n children,\n asChild,\n icon,\n iconClassName,\n isLoading = false,\n ...props\n}: Props) => {\n const Comp = asChild ? Root : 'div';\n const adornment = isLoading ? <Loader2 className=\"tw:animate-spin\" /> : icon;\n\n const handleOnSelect = (event: Event) => {\n // prevents dropdown menu from closing to prevent modal unmounting from dom\n if (asModalTrigger) event.preventDefault();\n onSelect?.(event);\n };\n\n const handlePointerLeave: PointerEventHandler<HTMLDivElement> = (event) => {\n // prevents focus stealing from modal\n if (asModalTrigger) event.preventDefault();\n onPointerLeave?.(event);\n };\n\n const handlePointerMove: PointerEventHandler<HTMLDivElement> = (event) => {\n // prevents focus stealing from modal\n if (asModalTrigger) event.preventDefault();\n onPointerMove?.(event);\n };\n\n return (\n <DropdownMenuPrimitive.Item\n {...props}\n ref={ref}\n onSelect={handleOnSelect}\n onPointerLeave={handlePointerLeave}\n onPointerMove={handlePointerMove}\n className={cn(itemVariants, asChild && 'tw:text-inherit', className)}\n asChild\n >\n <Comp>\n {adornment && <ItemIcon className={iconClassName}>{adornment}</ItemIcon>}\n <Slottable>{children}</Slottable>\n </Comp>\n </DropdownMenuPrimitive.Item>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\n\nconst descriptionVariants = cva(\n [\n 'tw:box-border',\n 'tw:ml-auto',\n 'tw:font-sans',\n 'tw:tracking-normal',\n 'tw:font-normal',\n 'tw:text-xs',\n 'tw:text-muted-foreground',\n ],\n {\n variants: {\n hideOnHover: {\n true: ['tw:group-focus-within:hidden', 'tw:group-hover:hidden'],\n false: [],\n },\n },\n defaultVariants: {},\n },\n);\n\ntype Props = ComponentProps<'span'> & {\n hideOnHover?: boolean;\n};\n\nexport const DropdownMenuItemDescription = ({\n className,\n children,\n hideOnHover = false,\n ...props\n}: Props) => {\n return (\n <span {...props} className={cn(descriptionVariants({ hideOnHover }), className)}>\n {children}\n </span>\n );\n};\n","import type { ComponentProps } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.Label>;\n\nexport const DropdownMenuLabel = ({ className, ...props }: Props) => {\n return (\n <DropdownMenuPrimitive.Label\n className={cn(\n 'tw:p-2',\n 'tw:font-medium',\n 'tw:text-xs',\n 'tw:text-muted-foreground',\n className,\n )}\n {...props}\n />\n );\n};\n","import type { ComponentProps } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\ntype Props<Value> = Omit<\n ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>,\n 'value' | 'onValueChange' | 'defaultValue'\n> & {\n value?: Value;\n defaultValue?: Value;\n onValueChange?: (value: Value) => void;\n};\n\nexport const DropdownMenuRadioGroup = <Value extends string = string>({\n value,\n defaultValue,\n onValueChange,\n ...props\n}: Props<Value>) => {\n const handleChange = (value: string) => {\n onValueChange?.(value as Value);\n };\n\n return (\n <DropdownMenuPrimitive.RadioGroup\n {...props}\n value={value}\n defaultValue={defaultValue}\n onValueChange={handleChange}\n />\n );\n};\n","import type { ComponentProps, ReactNode } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { Loader2 } from '../../../icons';\nimport { cn } from '../../../utils';\nimport { DropdownMenuItemIndicator } from '../DropdownMenuItemIndicator';\nimport { ItemIcon } from '../ItemIcon';\nimport { itemVariants } from '../styles';\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {\n closeOnSelect?: boolean;\n indicatorAlign?: 'start' | 'end';\n indicator?: 'radio' | 'check' | 'none';\n icon?: ReactNode;\n iconClassName?: string;\n isLoading?: boolean;\n};\n\nexport const DropdownMenuRadioItem = ({\n className,\n children,\n closeOnSelect,\n onSelect,\n indicatorAlign = 'start',\n indicator = 'radio',\n icon,\n iconClassName,\n isLoading = false,\n ...props\n}: Props) => {\n const isAtStart = indicatorAlign === 'start';\n const indicatorEle = isLoading ? (\n <ItemIcon className={iconClassName}>\n <Loader2 className=\"tw:animate-spin\" />\n </ItemIcon>\n ) : (\n <DropdownMenuItemIndicator variant={indicator} />\n );\n\n const handleSelect = (event: Event) => {\n if (!closeOnSelect) event.preventDefault();\n onSelect?.(event);\n };\n\n return (\n <DropdownMenuPrimitive.RadioItem\n className={cn(\n itemVariants,\n 'tw:data-[state=checked]:cursor-default',\n {\n 'tw:data-[state=checked]:bg-neutral-100': indicator === 'none',\n // Semantic brand tint (flips under `[data-theme='dark']`) instead of a\n // hardcoded `tw:bg-sky-100`, which stayed light in dark mode and left the\n // checked item's text near-invisible.\n 'tw:group-data-[variant=argo]/dropdown-menu-content:data-[state=checked]:bg-primary/10':\n indicator === 'check',\n },\n className,\n )}\n onSelect={handleSelect}\n {...props}\n >\n {isAtStart && indicatorEle}\n {icon && <ItemIcon className={iconClassName}>{icon}</ItemIcon>}\n <span className=\"tw:flex tw:min-w-0 tw:flex-1 tw:items-center tw:gap-2\">{children}</span>\n {!isAtStart && indicatorEle}\n </DropdownMenuPrimitive.RadioItem>\n );\n};\n","import type { ComponentProps } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.Separator>;\n\nexport const DropdownMenuSeparator = ({ className, ...props }: Props) => (\n <DropdownMenuPrimitive.Separator\n className={cn(\n 'tw:relative',\n 'tw:z-10',\n\n // layout\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:w-full',\n\n // separator line\n 'tw:before:content-[\"\"]',\n 'tw:before:w-full',\n 'tw:before:h-px',\n\n 'tw:group-data-[variant=default]/dropdown-menu-content:py-2',\n 'tw:group-data-[variant=default]/dropdown-menu-content:before:bg-neutral-150',\n\n 'tw:group-data-[variant=argo]/dropdown-menu-content:py-1',\n 'tw:group-data-[variant=argo]/dropdown-menu-content:before:bg-border',\n\n className,\n )}\n {...props}\n />\n);\n","import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nexport const DropdownMenuSub = DropdownMenuPrimitive.Sub;\n","import type { ComponentProps } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { cn } from '../../../utils';\nimport { useDropdownMenuContext } from '../DropdownMenuContext';\nimport { contentVariants } from '../styles';\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.SubContent>;\n\nexport const DropdownMenuSubContent = ({ className, ...props }: Props) => {\n const { variant } = useDropdownMenuContext();\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n data-variant={variant}\n className={cn(contentVariants, 'tw:z-[1041]', 'tw:p-2', className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n};\n","import type { ComponentProps } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { ChevronRight } from '../../../icons';\nimport { cn } from '../../../utils';\nimport { itemVariants } from '../styles';\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.SubTrigger>;\n\nexport const DropdownMenuSubTrigger = ({ className, children, ...props }: Props) => {\n return (\n <DropdownMenuPrimitive.SubTrigger className={cn(itemVariants, className)} {...props}>\n {children}\n <ChevronRight className=\"tw:ml-auto tw:size-5\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Trigger } from '@radix-ui/react-dropdown-menu';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof Trigger>;\n\nexport const DropdownMenuTrigger = ({ ref, className, ...props }: Props) => (\n <Trigger\n {...props}\n ref={ref}\n data-slot=\"dropdown-menu-trigger\"\n className={cn('tw:group/dropdown-menu-trigger', className)}\n />\n);\n","import { useMemo } from 'react';\nimport type { ComponentProps } from 'react';\nimport { Group, Root } from '@radix-ui/react-dropdown-menu';\n\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { DropdownMenuCheckboxItem } from './DropdownMenuCheckboxItem';\nimport { DropdownMenuContent } from './DropdownMenuContent';\nimport type { DropdownMenuVariant } from './DropdownMenuContext';\nimport { DropdownMenuContext } from './DropdownMenuContext';\nimport { DropdownMenuItem } from './DropdownMenuItem';\nimport { DropdownMenuItemDescription } from './DropdownMenuItemDescription';\nimport { DropdownMenuLabel } from './DropdownMenuLabel';\nimport { DropdownMenuRadioGroup, DropdownMenuRadioItem } from './DropdownMenuRadioGroup';\nimport { DropdownMenuSeparator } from './DropdownMenuSeparator';\nimport { DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger } from './DropdownMenuSub';\nimport { DropdownMenuTrigger } from './DropdownMenuTrigger';\n\ntype Props = ComponentProps<typeof Root>;\n\nexport const DropdownMenu = ({\n // change a default value to false, for modal property, as it is not used in most cases\n modal = false,\n ...props\n}: Props) => {\n const effectiveVariant: DropdownMenuVariant = useArgoDesign() ? 'argo' : 'default';\n const contextValue = useMemo(() => ({ variant: effectiveVariant }), [effectiveVariant]);\n\n return (\n <DropdownMenuContext value={contextValue}>\n <Root {...props} modal={modal} />\n </DropdownMenuContext>\n );\n};\n\n/**\n * Main Layout\n */\nDropdownMenu.Trigger = DropdownMenuTrigger;\nDropdownMenu.Content = DropdownMenuContent;\nDropdownMenu.Group = Group;\n\n/**\n * Sub Layout\n */\nDropdownMenu.Sub = DropdownMenuSub;\nDropdownMenu.SubContent = DropdownMenuSubContent;\nDropdownMenu.SubTrigger = DropdownMenuSubTrigger;\n\n/**\n * Items can be used either Sub ar Main Layout\n */\nDropdownMenu.Separator = DropdownMenuSeparator;\nDropdownMenu.Label = DropdownMenuLabel;\nDropdownMenu.Item = DropdownMenuItem;\nDropdownMenu.CheckboxItem = DropdownMenuCheckboxItem;\nDropdownMenu.RadioGroup = DropdownMenuRadioGroup;\nDropdownMenu.RadioItem = DropdownMenuRadioItem;\n\n// item content\nDropdownMenu.ItemDescription = DropdownMenuItemDescription;\n"],"mappings":";;;;;;;;;;;AAOA,MAAM,WAAW,IACf;CACE;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;AACF,GACA,EACE,UAAU,EACR,SAAS;CACP,MAAM,CAAC;CACP,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAGA;EACA;EACA;CACF;CACA,OAAO,CAAC,kDAAgD,yBAAyB;CACjF,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;C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AS;EAAG,GAAI;EAA9E,UAAA,CACG,UACD,oBAAC,cAAD,EAAc,WAAU,uBAAwB,CAAA,CAChB;;AAEtC;;;ACTA,MAAa,uBAAuB,EAAE,KAAK,WAAW,GAAG,YACvD,oBAAC,SAAD;CACE,GAAI;CACC;CACL,aAAU;CACV,WAAW,GAAG,kCAAkC,SAAS;AAC1D,CAAA;;;ACOH,MAAa,gBAAgB,EAE3B,QAAQ,OACR,GAAG,YACQ;CACX,MAAM,mBAAwC,cAAc,IAAI,SAAS;CACzE,MAAM,eAAe,eAAe,EAAE,SAAS,iBAAiB,IAAI,CAAC,gBAAgB,CAAC;CAEtF,OACE,oBAAC,qBAAD;EAAqB,OAAO;EAC1B,UAAA,oBAACA,QAAD;GAAM,GAAI;GAAc;EAAQ,CAAA;CACb,CAAA;AAEzB;;;;AAKA,aAAa,UAAU;AACvB,aAAa,UAAU;AACvB,aAAa,QAAQ;;;;AAKrB,aAAa,MAAM;AACnB,aAAa,aAAa;AAC1B,aAAa,aAAa;;;;AAK1B,aAAa,YAAY;AACzB,aAAa,QAAQ;AACrB,aAAa,OAAO;AACpB,aAAa,eAAe;AAC5B,aAAa,aAAa;AAC1B,aAAa,YAAY;AAGzB,aAAa,kBAAkB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormGroup-S9mPNHKH.js","names":[],"sources":["../src/blocks/FormGroup/context.ts","../src/blocks/FormGroup/FormGroupColorInput.tsx","../src/blocks/FormGroup/FormGroupError.tsx","../src/blocks/FormGroup/FormGroupHelp.tsx","../src/blocks/FormGroup/FormGroupNumberInput.tsx","../src/blocks/FormGroup/FormGroupTextarea.tsx","../src/blocks/FormGroup/FormGroupTextInput.tsx","../src/blocks/FormGroup/FormGroup.tsx"],"sourcesContent":["import { createContext, use } from 'react';\n\nimport type { FormGroupContext } from './types';\n\nconst FormGroupContext = createContext<FormGroupContext>({\n state: 'default',\n});\n\nexport const FormGroupProvider = FormGroupContext;\n\nexport const useFormGroupContext = () => use(FormGroupContext);\n","import type { ComponentProps } from 'react';\n\nimport { ColorInput } from '../ColorInput';\n\nimport { useFormGroupContext } from './context';\n\ntype Props = Omit<ComponentProps<typeof ColorInput>, 'state'>;\n\nexport const FormGroupColorInput = ({ ref, ...props }: Props) => {\n const { state } = useFormGroupContext();\n return <ColorInput state={state} {...props} ref={ref} />;\n};\n","import { useMemo } from 'react';\nimport type { ComponentPropsWithRef, ReactNode } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<'div'> & {\n /**\n * Field validation errors. TanStack Form errors are strings (function validators) or\n * `{ message }` objects (Standard Schema / zod). A single message renders inline; several\n * render as a list. Ignored when `children` is provided.\n */\n errors?: readonly (string | { message?: string } | undefined)[];\n};\n\n// Normalize a TanStack error entry (string or `{ message }`) to a display string.\nconst toMessage = (entry: string | { message?: string } | undefined): string | undefined =>\n typeof entry === 'string' ? entry : entry?.message;\n\n/**\n * Field error message. Unlike `FormGroup.Help` (advisory description), this is a validation\n * error, so it carries `role=\"alert\"` — announced when it appears, even if focus isn't on the\n * field (e.g. surfaced on submit). Renders a `<div>` (not `<p>`) so multiple errors can render\n * as a `<ul>`.\n */\nexport const FormGroupError = ({ children, className, errors, ...rest }: Props) => {\n const content = useMemo<ReactNode>(() => {\n if (children) return children;\n\n const messages = (errors ?? []).map(toMessage).filter((message) => !!message);\n if (messages.length === 0) return null;\n if (messages.length === 1) return messages[0];\n\n return (\n <ul className=\"tw:m-0 tw:flex tw:list-disc tw:flex-col tw:gap-0 tw:pl-4\">\n {messages.map((message, index) => (\n <li key={index}>{message}</li>\n ))}\n </ul>\n );\n }, [children, errors]);\n\n if (!content) return null;\n\n return (\n <div {...rest} role=\"alert\" className={cn('tw:m-0 tw:text-xs tw:text-destructive', className)}>\n {content}\n </div>\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { HelpBlock } from '../../components/HelpBlock';\n\nimport { useFormGroupContext } from './context';\n\ntype Props = Omit<ComponentProps<typeof HelpBlock>, 'state'>;\n\nexport const FormGroupHelp = ({ children, ...rest }: Props) => {\n const formGroupContext = useFormGroupContext();\n\n // Help stays advisory; a group's error state surfaces via FormGroup.Error, not here.\n return (\n <HelpBlock state={formGroupContext.state === 'warning' ? 'warning' : 'default'} {...rest}>\n {children}\n </HelpBlock>\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { NumberInput } from '../NumberInput';\n\nimport { useFormGroupContext } from './context';\n\ntype Props = Omit<ComponentProps<typeof NumberInput>, 'state'>;\n\nexport const FormGroupNumberInput = ({ ref, ...props }: Props) => {\n const { state } = useFormGroupContext();\n return <NumberInput {...props} ref={ref} state={state} />;\n};\n","import type { ComponentProps } from 'react';\n\nimport { Textarea } from '../Textarea';\n\nimport { useFormGroupContext } from './context';\n\ntype Props = Omit<ComponentProps<typeof Textarea>, 'state'>;\n\nexport const FormGroupTextarea = (props: Props) => {\n const { state } = useFormGroupContext();\n return <Textarea state={state} {...props} />;\n};\n","import type { ComponentProps } from 'react';\n\nimport { TextInput } from '../TextInput';\n\nimport { useFormGroupContext } from './context';\n\ntype Props = Omit<ComponentProps<typeof TextInput>, 'state'>;\n\nexport const FormGroupTextInput = ({ ref, ...props }: Props) => {\n const { state } = useFormGroupContext();\n return <TextInput state={state} {...props} ref={ref} />;\n};\n","import type { ComponentPropsWithRef } from 'react';\n\nimport { cn } from '../../utils';\n\nimport { FormGroupProvider } from './context';\nimport { FormGroupColorInput } from './FormGroupColorInput';\nimport { FormGroupError } from './FormGroupError';\nimport { FormGroupHelp } from './FormGroupHelp';\nimport { FormGroupNumberInput } from './FormGroupNumberInput';\nimport { FormGroupTextarea } from './FormGroupTextarea';\nimport { FormGroupTextInput } from './FormGroupTextInput';\nimport type { FormGroupContext } from './types';\n\n/**\n * Props for `FormGroup`. `state` from `FormGroupContext` (\"default\" | \"error\" | \"warning\") propagates via\n * context to nested inputs. `FormGroup.Help` stays advisory (it reacts only to \"warning\"); validation errors\n * render through `FormGroup.Error`, not the input `state`.\n */\ntype FormGroupProps = ComponentPropsWithRef<'div'> & FormGroupContext;\n\n/**\n * Label + input + help-text grouping with shared validation state. Provides the chrome for a single field.\n *\n * **When to use:** rendering a label + bare input + help/error text outside `useAppForm` (e.g. one-off\n * filter fields, settings panes). `state=\"error\"` flips `FormGroup.TextInput` chrome without per-component\n * wiring; the error message itself renders via `FormGroup.Error` (`role=\"alert\"`), while `FormGroup.Help`\n * stays advisory.\n * **When NOT to use:** for a full form with validation and submit state, use `useAppForm` from `blocks/Form` —\n * it composes `FormGroup` internally via the typed field connectors.\n * **Composition:** nest a `Label`, then one of `FormGroup.TextInput` / `FormGroup.NumberInput` /\n * `FormGroup.ColorInput` / `FormGroup.Textarea`, optionally followed by `FormGroup.Help`\n * (advisory description) or `FormGroup.Error` (validation error, announced via `role=\"alert\"`).\n */\nexport const FormGroup = ({ className, children, state, ...rest }: FormGroupProps) => {\n return (\n <FormGroupProvider value={{ state }}>\n <div {...rest} className={cn('tw:flex tw:flex-col tw:gap-1', className)}>\n {children}\n </div>\n </FormGroupProvider>\n );\n};\n\nFormGroup.Help = FormGroupHelp;\nFormGroup.Error = FormGroupError;\nFormGroup.TextInput = FormGroupTextInput;\nFormGroup.NumberInput = FormGroupNumberInput;\nFormGroup.ColorInput = FormGroupColorInput;\nFormGroup.Textarea = FormGroupTextarea;\n"],"mappings":";;;;;;;;;AAIA,MAAM,mBAAmB,cAAgC,EACvD,OAAO,UACT,CAAC;AAED,MAAa,oBAAoB;AAEjC,MAAa,4BAA4B,IAAI,gBAAgB;;;ACF7D,MAAa,uBAAuB,EAAE,KAAK,GAAG,YAAmB;CAC/D,MAAM,EAAE,UAAU,oBAAoB;CACtC,OAAO,oBAAC,YAAD;EAAmB;EAAO,GAAI;EAAY;CAAM,CAAA;AACzD;;;ACIA,MAAM,aAAa,UACjB,OAAO,UAAU,WAAW,QAAQ,OAAO;;;;;;;AAQ7C,MAAa,kBAAkB,EAAE,UAAU,WAAW,QAAQ,GAAG,WAAkB;CACjF,MAAM,UAAU,cAAyB;EAC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