@keboola/design 14.0.0 → 15.1.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 (303) hide show
  1. package/AGENTS.md +11 -23
  2. package/CHANGELOG.md +58 -0
  3. package/COMPONENT-API.md +109 -115
  4. package/dist/{AIKit-BRSZ3nY7.js → AIKit-BR6jfsdI.js} +69 -35
  5. package/dist/AIKit-BR6jfsdI.js.map +1 -0
  6. package/dist/{Alert-CZ0dDsuk.js → Alert-Chz6KZ7e.js} +11 -20
  7. package/dist/Alert-Chz6KZ7e.js.map +1 -0
  8. package/dist/{AlertModal-BDle9ZVQ.js → AlertModal-DMsn62JJ.js} +16 -36
  9. package/dist/AlertModal-DMsn62JJ.js.map +1 -0
  10. package/dist/{AppShell-B03fj1j7.js → AppShell-C8V1KRr_.js} +2 -2
  11. package/dist/{AppShell-B03fj1j7.js.map → AppShell-C8V1KRr_.js.map} +1 -1
  12. package/dist/{AutoSaveTextarea-jiqNeeE4.js → AutoSaveTextarea-BbMhC5Aq.js} +3 -3
  13. package/dist/AutoSaveTextarea-BbMhC5Aq.js.map +1 -0
  14. package/dist/{Badge-Ba3epgcI.js → Badge-CqlOE5A2.js} +23 -12
  15. package/dist/Badge-CqlOE5A2.js.map +1 -0
  16. package/dist/{BrandEditor-CN2HJ_12.js → BrandEditor-D61pzWRq.js} +7 -9
  17. package/dist/BrandEditor-D61pzWRq.js.map +1 -0
  18. package/dist/{BrandLogo-BfITD0im.js → BrandLogo-DkESE19K.js} +2 -2
  19. package/dist/{BrandLogo-BfITD0im.js.map → BrandLogo-DkESE19K.js.map} +1 -1
  20. package/dist/{Breadcrumb-BnIlsoIH.js → Breadcrumb-DbqvDnYl.js} +4 -4
  21. package/dist/{Breadcrumb-BnIlsoIH.js.map → Breadcrumb-DbqvDnYl.js.map} +1 -1
  22. package/dist/{Button-D2JqBAq7.js → Button-BNkyYU8u.js} +9 -185
  23. package/dist/Button-BNkyYU8u.js.map +1 -0
  24. package/dist/{Card-Bpc_ZlL4.js → Card-DxjGiqH8.js} +11 -18
  25. package/dist/Card-DxjGiqH8.js.map +1 -0
  26. package/dist/{Checkbox-uFE8XLT_.js → Checkbox-CHDDJyAA.js} +20 -45
  27. package/dist/Checkbox-CHDDJyAA.js.map +1 -0
  28. package/dist/{Clipboard-D-9XOqy4.js → Clipboard-DlwVZS1P.js} +2 -2
  29. package/dist/{Clipboard-D-9XOqy4.js.map → Clipboard-DlwVZS1P.js.map} +1 -1
  30. package/dist/{ClipboardButton-DxvZG_H0.js → ClipboardButton-B1Hr_n_Z.js} +3 -3
  31. package/dist/{ClipboardButton-DxvZG_H0.js.map → ClipboardButton-B1Hr_n_Z.js.map} +1 -1
  32. package/dist/{CodeEditor-BfRSCKEs.js → CodeEditor-DVSPdfdo.js} +24 -31
  33. package/dist/CodeEditor-DVSPdfdo.js.map +1 -0
  34. package/dist/{ColorInput-CDKH8q_f.js → ColorInput-B_eZIu39.js} +5 -7
  35. package/dist/ColorInput-B_eZIu39.js.map +1 -0
  36. package/dist/{ColorModeSwitch-DR6J2U6M.js → ColorModeSwitch-BlrH8jAi.js} +3 -3
  37. package/dist/{ColorModeSwitch-DR6J2U6M.js.map → ColorModeSwitch-BlrH8jAi.js.map} +1 -1
  38. package/dist/{Combobox-CEesMe2M.js → Combobox-BLqX-Tdh.js} +16 -24
  39. package/dist/Combobox-BLqX-Tdh.js.map +1 -0
  40. package/dist/{Command-T3MLRaen.js → Command-DhXmqFLT.js} +46 -32
  41. package/dist/Command-DhXmqFLT.js.map +1 -0
  42. package/dist/{CopyField-CNbCHw9a.js → CopyField-D0Pg4Z0R.js} +2 -2
  43. package/dist/{CopyField-CNbCHw9a.js.map → CopyField-D0Pg4Z0R.js.map} +1 -1
  44. package/dist/{DateInput-ClK1lCxz.js → DateInput-duinbI9_.js} +5 -7
  45. package/dist/DateInput-duinbI9_.js.map +1 -0
  46. package/dist/{DatePicker-CgHAu9KX.js → DatePicker-Cg_aG_N4.js} +2 -2
  47. package/dist/{DatePicker-CgHAu9KX.js.map → DatePicker-Cg_aG_N4.js.map} +1 -1
  48. package/dist/{DateRangeInput-DtlAffS1.js → DateRangeInput-BYVHf9zo.js} +5 -7
  49. package/dist/DateRangeInput-BYVHf9zo.js.map +1 -0
  50. package/dist/{DateRangePicker-CXpXPMoh.js → DateRangePicker-m47cSV1r.js} +7 -12
  51. package/dist/DateRangePicker-m47cSV1r.js.map +1 -0
  52. package/dist/{DropdownMenu-B1gGvZoh.js → DropdownMenu-Bum99mVf.js} +35 -64
  53. package/dist/DropdownMenu-Bum99mVf.js.map +1 -0
  54. package/dist/{FieldItem-CYvJyjiI.js → FieldItem-BHUqgSO1.js} +3 -3
  55. package/dist/{FieldItem-CYvJyjiI.js.map → FieldItem-BHUqgSO1.js.map} +1 -1
  56. package/dist/{FileUpload-D6vPG3WB.js → FileUpload-BYFONpEl.js} +3 -3
  57. package/dist/FileUpload-BYFONpEl.js.map +1 -0
  58. package/dist/{Form-CD55zJiy.js → Form-Dqbt_tIs.js} +8 -8
  59. package/dist/{Form-CD55zJiy.js.map → Form-Dqbt_tIs.js.map} +1 -1
  60. package/dist/{FormGroup-DiYFdEhH.js → FormGroup-V5kIgQRN.js} +3 -3
  61. package/dist/{FormGroup-DiYFdEhH.js.map → FormGroup-V5kIgQRN.js.map} +1 -1
  62. package/dist/{FullScreenModal-CUuAakh3.js → FullScreenModal-DAvvlGOz.js} +2 -5
  63. package/dist/FullScreenModal-DAvvlGOz.js.map +1 -0
  64. package/dist/HoverCard-Cf9iYyaW.js +26 -0
  65. package/dist/HoverCard-Cf9iYyaW.js.map +1 -0
  66. package/dist/{InlineEdit-D5RdunZo.js → InlineEdit-D4P0SvCB.js} +5 -9
  67. package/dist/InlineEdit-D4P0SvCB.js.map +1 -0
  68. package/dist/{InputGroup-Dm014ruw.js → InputGroup-CZv_7QlM.js} +39 -146
  69. package/dist/InputGroup-CZv_7QlM.js.map +1 -0
  70. package/dist/{Kbd-3YM7NQO4.js → Kbd-CflKthfu.js} +5 -14
  71. package/dist/Kbd-CflKthfu.js.map +1 -0
  72. package/dist/{MermaidDiagram-CeiOkI60.js → MermaidDiagram-2-EuNu1i.js} +4 -4
  73. package/dist/{MermaidDiagram-CeiOkI60.js.map → MermaidDiagram-2-EuNu1i.js.map} +1 -1
  74. package/dist/{Modal-DMZRswk4.js → Modal-DwuvuiUx.js} +17 -36
  75. package/dist/Modal-DwuvuiUx.js.map +1 -0
  76. package/dist/{ModalTitle-CTECVgL8.js → ModalTitle-RGWwIMU6.js} +3 -3
  77. package/dist/ModalTitle-RGWwIMU6.js.map +1 -0
  78. package/dist/{MultiActionButtonGroup-CEv_txvz.js → MultiActionButtonGroup-Dzig87s1.js} +3 -3
  79. package/dist/{MultiActionButtonGroup-CEv_txvz.js.map → MultiActionButtonGroup-Dzig87s1.js.map} +1 -1
  80. package/dist/{Navbar-CtVYcRFn.js → Navbar-DHUS7XiU.js} +2 -2
  81. package/dist/{Navbar-CtVYcRFn.js.map → Navbar-DHUS7XiU.js.map} +1 -1
  82. package/dist/OtpInput-CY8yCaJk.js.map +1 -1
  83. package/dist/{PageToolbar-B_e7HGva.js → PageToolbar-LKP6PiP_.js} +4 -4
  84. package/dist/{PageToolbar-B_e7HGva.js.map → PageToolbar-LKP6PiP_.js.map} +1 -1
  85. package/dist/{Pagination-DDp6PRqf.js → Pagination-D27x5KmH.js} +2 -2
  86. package/dist/{Pagination-DDp6PRqf.js.map → Pagination-D27x5KmH.js.map} +1 -1
  87. package/dist/{Popconfirm-BgV6a0sl.js → Popconfirm-p72DiagN.js} +3 -3
  88. package/dist/{Popconfirm-BgV6a0sl.js.map → Popconfirm-p72DiagN.js.map} +1 -1
  89. package/dist/{Popover-BU7nGOv-.js → Popover-DnBw5Uay.js} +25 -38
  90. package/dist/Popover-DnBw5Uay.js.map +1 -0
  91. package/dist/{RadioGroup-C8EC3fqO.js → RadioGroup-B0TwHjBb.js} +9 -13
  92. package/dist/RadioGroup-B0TwHjBb.js.map +1 -0
  93. package/dist/{Search-aaUMI4ix.js → Search-vyZwGKMU.js} +3 -3
  94. package/dist/{Search-aaUMI4ix.js.map → Search-vyZwGKMU.js.map} +1 -1
  95. package/dist/{SearchInput-Dxi2GK4n.js → SearchInput-DyYXyw3u.js} +4 -6
  96. package/dist/SearchInput-DyYXyw3u.js.map +1 -0
  97. package/dist/{SectionNav-BnHOMLtE.js → SectionNav-6hcIpZLO.js} +5 -5
  98. package/dist/{SectionNav-BnHOMLtE.js.map → SectionNav-6hcIpZLO.js.map} +1 -1
  99. package/dist/{Select-CjQgU_6K.js → Select-C6zKeip5.js} +11 -25
  100. package/dist/Select-C6zKeip5.js.map +1 -0
  101. package/dist/{Sheet-utw4_rUa.js → Sheet-DKG20J7W.js} +13 -16
  102. package/dist/Sheet-DKG20J7W.js.map +1 -0
  103. package/dist/{Sidebar-BAmux2Uj.js → Sidebar-BlYqasnX.js} +11 -11
  104. package/dist/Sidebar-BlYqasnX.js.map +1 -0
  105. package/dist/{Slider-DbzzSDRV.js → Slider-DrcsM8_G.js} +4 -4
  106. package/dist/Slider-DrcsM8_G.js.map +1 -0
  107. package/dist/{Stepper-BBPembeK.js → Stepper-CQrUPVFL.js} +2 -2
  108. package/dist/Stepper-CQrUPVFL.js.map +1 -0
  109. package/dist/Switch-DccpSpzC.js +66 -0
  110. package/dist/Switch-DccpSpzC.js.map +1 -0
  111. package/dist/{Tabs-C0uvkPHc.js → Tabs-Ck4uWf8U.js} +2 -2
  112. package/dist/{Tabs-C0uvkPHc.js.map → Tabs-Ck4uWf8U.js.map} +1 -1
  113. package/dist/{TextInput-K2DSDs5O.js → TextInput-CR0_USaY.js} +4 -7
  114. package/dist/TextInput-CR0_USaY.js.map +1 -0
  115. package/dist/{ThemeProvider-C8yaKlM1.js → ThemeProvider-BTK7AL-T.js} +21 -8
  116. package/dist/ThemeProvider-BTK7AL-T.js.map +1 -0
  117. package/dist/{TimePicker-DyyV3nw8.js → TimePicker-lk3NGqeK.js} +2 -2
  118. package/dist/{TimePicker-DyyV3nw8.js.map → TimePicker-lk3NGqeK.js.map} +1 -1
  119. package/dist/{Toast-BGnUL4jV.js → Toast-937n7n8i.js} +2 -2
  120. package/dist/{Toast-BGnUL4jV.js.map → Toast-937n7n8i.js.map} +1 -1
  121. package/dist/{ToggleAllTooltip-Dlmq-yqS.js → ToggleAllTooltip-DEjbWFoj.js} +2 -2
  122. package/dist/{ToggleAllTooltip-Dlmq-yqS.js.map → ToggleAllTooltip-DEjbWFoj.js.map} +1 -1
  123. package/dist/Workbench-CxgNCs3I.js.map +1 -1
  124. package/dist/{ZoomableSvg-Dh1OstPN.js → ZoomableSvg-CxXKanUR.js} +5 -5
  125. package/dist/{ZoomableSvg-Dh1OstPN.js.map → ZoomableSvg-CxXKanUR.js.map} +1 -1
  126. package/dist/editors.js +4 -4
  127. package/dist/flint.js +4 -4
  128. package/dist/index.d.ts +113 -125
  129. package/dist/index.js +61 -61
  130. package/dist/internal/blocks/AIKit.js +1 -1
  131. package/dist/internal/blocks/AppShell.js +1 -1
  132. package/dist/internal/blocks/AuthLayout.js +1 -1
  133. package/dist/internal/blocks/AutoSaveTextarea.js +1 -1
  134. package/dist/internal/blocks/BrandEditor.js +1 -1
  135. package/dist/internal/blocks/ChartPanel.js +1 -1
  136. package/dist/internal/blocks/ChipEditor.js +5 -9
  137. package/dist/internal/blocks/ChipEditor.js.map +1 -1
  138. package/dist/internal/blocks/ClipboardButton.js +1 -1
  139. package/dist/internal/blocks/ColorInput.js +1 -1
  140. package/dist/internal/blocks/ColorModeSwitch.js +1 -1
  141. package/dist/internal/blocks/Command.js +1 -1
  142. package/dist/internal/blocks/CopyField.js +1 -1
  143. package/dist/internal/blocks/DateInput.js +1 -1
  144. package/dist/internal/blocks/DateRangeInput.js +1 -1
  145. package/dist/internal/blocks/EmptyConfigurationActionCard.js +1 -1
  146. package/dist/internal/blocks/ErrorState.js +18 -29
  147. package/dist/internal/blocks/ErrorState.js.map +1 -1
  148. package/dist/internal/blocks/ExportMenu.js +3 -3
  149. package/dist/internal/blocks/ExportMenu.js.map +1 -1
  150. package/dist/internal/blocks/Form/connectors/ComboboxField.js +2 -2
  151. package/dist/internal/blocks/Form/connectors/MultiComboboxField.js +1 -1
  152. package/dist/internal/blocks/Form.js +1 -1
  153. package/dist/internal/blocks/FormGroup.js +1 -1
  154. package/dist/internal/blocks/InlineEdit.js +1 -1
  155. package/dist/internal/blocks/MultiActionButtonGroup.js +1 -1
  156. package/dist/internal/blocks/MultiCombobox.js +5 -9
  157. package/dist/internal/blocks/MultiCombobox.js.map +1 -1
  158. package/dist/internal/blocks/NumberInput.js +2 -4
  159. package/dist/internal/blocks/NumberInput.js.map +1 -1
  160. package/dist/internal/blocks/PageToolbar.js +1 -1
  161. package/dist/internal/blocks/PasswordInput.js +3 -5
  162. package/dist/internal/blocks/PasswordInput.js.map +1 -1
  163. package/dist/internal/blocks/SearchInput.js +1 -1
  164. package/dist/internal/blocks/SearchInputWithNavigation.js +6 -7
  165. package/dist/internal/blocks/SearchInputWithNavigation.js.map +1 -1
  166. package/dist/internal/blocks/SectionNav.js +1 -1
  167. package/dist/internal/blocks/SplitButton.js +2 -2
  168. package/dist/internal/blocks/StatCard.js +1 -1
  169. package/dist/internal/blocks/TextInput.js +1 -1
  170. package/dist/internal/blocks/Textarea.js +3 -8
  171. package/dist/internal/blocks/Textarea.js.map +1 -1
  172. package/dist/internal/blocks/TimeInput.js +4 -6
  173. package/dist/internal/blocks/TimeInput.js.map +1 -1
  174. package/dist/internal/components/Alert.js +1 -1
  175. package/dist/internal/components/AlertModal.js +1 -1
  176. package/dist/internal/components/Avatar.js +1 -1
  177. package/dist/internal/components/Badge.js +1 -1
  178. package/dist/internal/components/BrandLogo.js +1 -1
  179. package/dist/internal/components/Breadcrumb.js +1 -1
  180. package/dist/internal/components/Button.js +2 -2
  181. package/dist/internal/components/ButtonGroup.js +1 -1
  182. package/dist/internal/components/ButtonGroup.js.map +1 -1
  183. package/dist/internal/components/Card.js +1 -1
  184. package/dist/internal/components/Checkbox.js +1 -1
  185. package/dist/internal/components/Clipboard.js +1 -1
  186. package/dist/internal/components/CollapsiblePanel.js +1 -1
  187. package/dist/internal/components/Combobox.js +1 -1
  188. package/dist/internal/components/DatePicker.js +1 -1
  189. package/dist/internal/components/DateRangePicker.js +1 -1
  190. package/dist/internal/components/DropdownMenu.js +1 -1
  191. package/dist/internal/components/FileUpload.js +1 -1
  192. package/dist/internal/components/FullScreenModal.js +1 -1
  193. package/dist/internal/components/HoverCard.js +1 -1
  194. package/dist/internal/components/InputGroup.js +1 -1
  195. package/dist/internal/components/Kbd.js +1 -1
  196. package/dist/internal/components/Modal.js +1 -1
  197. package/dist/internal/components/Navbar.js +1 -1
  198. package/dist/internal/components/Pagination.js +1 -1
  199. package/dist/internal/components/Popconfirm.js +1 -1
  200. package/dist/internal/components/Popover.js +1 -1
  201. package/dist/internal/components/RadioGroup.js +1 -1
  202. package/dist/internal/components/Search.js +1 -1
  203. package/dist/internal/components/Select.js +1 -1
  204. package/dist/internal/components/Sheet.js +1 -1
  205. package/dist/internal/components/Sidebar.js +1 -1
  206. package/dist/internal/components/Skeleton/Skeleton.js +1 -1
  207. package/dist/internal/components/Skeleton/Skeleton.js.map +1 -1
  208. package/dist/internal/components/Slider.js +1 -1
  209. package/dist/internal/components/Stepper.js +1 -1
  210. package/dist/internal/components/Switch.js +1 -1
  211. package/dist/internal/components/Tabs.js +1 -1
  212. package/dist/internal/components/ThemeProvider.js +3 -4
  213. package/dist/internal/components/TimePicker.js +1 -1
  214. package/dist/internal/components/Toast.js +2 -2
  215. package/dist/internal/components/Toggle.js +13 -3
  216. package/dist/internal/components/Toggle.js.map +1 -1
  217. package/dist/internal/components/Tooltip.js +1 -1
  218. package/dist/internal/components/Truncated.js +1 -1
  219. package/dist/internal/components/ZoomableSvg.js +1 -1
  220. package/dist/internal/hooks/useTimeout.js +19 -0
  221. package/dist/internal/hooks/useTimeout.js.map +1 -0
  222. package/dist/internal/utils.js +1 -1
  223. package/dist/markdown-editor.js +16 -18
  224. package/dist/markdown-editor.js.map +1 -1
  225. package/dist/mermaid.js +1 -1
  226. package/dist/rjsf.js +33 -42
  227. package/dist/rjsf.js.map +1 -1
  228. package/dist/styles-DxazJ8Mz.js +81 -0
  229. package/dist/styles-DxazJ8Mz.js.map +1 -0
  230. package/dist/styles-T8xwr0sR.js +73 -0
  231. package/dist/styles-T8xwr0sR.js.map +1 -0
  232. package/dist/styles.css +1 -1
  233. package/dist/testing.d.ts +0 -2
  234. package/dist/testing.js +3 -10
  235. package/dist/testing.js.map +1 -1
  236. package/dist/{useColorSchemeState-Cw4MCXUs.js → themeScopeContext-CEVXbYvZ.js} +43 -15
  237. package/dist/themeScopeContext-CEVXbYvZ.js.map +1 -0
  238. package/dist/{useThemeAttributes-B199Regy.js → themeTokens-DCeb62ap.js} +22 -4
  239. package/dist/themeTokens-DCeb62ap.js.map +1 -0
  240. package/dist/{toast-D6Z6MOB5.js → toast-Y3cTMBW8.js} +7 -10
  241. package/dist/toast-Y3cTMBW8.js.map +1 -0
  242. package/dist/{utils-LQ4jJA-9.js → utils-DwC9u0tM.js} +26 -52
  243. package/dist/utils-DwC9u0tM.js.map +1 -0
  244. package/dist/vega.js +2 -2
  245. package/dist/{vegaTheme-BrmVoPEz.js → vegaTheme-ISwGXvof.js} +2 -2
  246. package/dist/{vegaTheme-BrmVoPEz.js.map → vegaTheme-ISwGXvof.js.map} +1 -1
  247. package/dist/{vegaTokens-Ce07C0DH.js → vegaTokens-DCkvpIVE.js} +2 -2
  248. package/dist/{vegaTokens-Ce07C0DH.js.map → vegaTokens-DCkvpIVE.js.map} +1 -1
  249. package/package.json +2 -2
  250. package/src/styles.css +0 -35
  251. package/src/theme.css +46 -0
  252. package/dist/AIKit-BRSZ3nY7.js.map +0 -1
  253. package/dist/Alert-CZ0dDsuk.js.map +0 -1
  254. package/dist/AlertModal-BDle9ZVQ.js.map +0 -1
  255. package/dist/AutoSaveTextarea-jiqNeeE4.js.map +0 -1
  256. package/dist/Badge-Ba3epgcI.js.map +0 -1
  257. package/dist/BrandEditor-CN2HJ_12.js.map +0 -1
  258. package/dist/Button-D2JqBAq7.js.map +0 -1
  259. package/dist/Card-Bpc_ZlL4.js.map +0 -1
  260. package/dist/Checkbox-uFE8XLT_.js.map +0 -1
  261. package/dist/CodeEditor-BfRSCKEs.js.map +0 -1
  262. package/dist/ColorInput-CDKH8q_f.js.map +0 -1
  263. package/dist/Combobox-CEesMe2M.js.map +0 -1
  264. package/dist/Command-T3MLRaen.js.map +0 -1
  265. package/dist/DateInput-ClK1lCxz.js.map +0 -1
  266. package/dist/DateRangeInput-DtlAffS1.js.map +0 -1
  267. package/dist/DateRangePicker-CXpXPMoh.js.map +0 -1
  268. package/dist/DropdownMenu-B1gGvZoh.js.map +0 -1
  269. package/dist/FileUpload-D6vPG3WB.js.map +0 -1
  270. package/dist/FullScreenModal-CUuAakh3.js.map +0 -1
  271. package/dist/HoverCard-BBdPYqEf.js +0 -31
  272. package/dist/HoverCard-BBdPYqEf.js.map +0 -1
  273. package/dist/InlineEdit-D5RdunZo.js.map +0 -1
  274. package/dist/InputGroup-Dm014ruw.js.map +0 -1
  275. package/dist/Kbd-3YM7NQO4.js.map +0 -1
  276. package/dist/Modal-DMZRswk4.js.map +0 -1
  277. package/dist/ModalTitle-CTECVgL8.js.map +0 -1
  278. package/dist/Popover-BU7nGOv-.js.map +0 -1
  279. package/dist/RadioGroup-C8EC3fqO.js.map +0 -1
  280. package/dist/SearchInput-Dxi2GK4n.js.map +0 -1
  281. package/dist/Select-CjQgU_6K.js.map +0 -1
  282. package/dist/Sheet-utw4_rUa.js.map +0 -1
  283. package/dist/Sidebar-BAmux2Uj.js.map +0 -1
  284. package/dist/Slider-DbzzSDRV.js.map +0 -1
  285. package/dist/Stepper-BBPembeK.js.map +0 -1
  286. package/dist/Switch-Dw4tvQls.js +0 -201
  287. package/dist/Switch-Dw4tvQls.js.map +0 -1
  288. package/dist/TextInput-K2DSDs5O.js.map +0 -1
  289. package/dist/ThemeProvider-C8yaKlM1.js.map +0 -1
  290. package/dist/context-U293r3v-.js +0 -29
  291. package/dist/context-U293r3v-.js.map +0 -1
  292. package/dist/defaults-i_xG2F_1.js +0 -32
  293. package/dist/defaults-i_xG2F_1.js.map +0 -1
  294. package/dist/styles-BDA5rQz3.js +0 -127
  295. package/dist/styles-BDA5rQz3.js.map +0 -1
  296. package/dist/styles-YQdM7G8c.js +0 -159
  297. package/dist/styles-YQdM7G8c.js.map +0 -1
  298. package/dist/themeTokens-l2Fsfcs7.js +0 -22
  299. package/dist/themeTokens-l2Fsfcs7.js.map +0 -1
  300. package/dist/toast-D6Z6MOB5.js.map +0 -1
  301. package/dist/useColorSchemeState-Cw4MCXUs.js.map +0 -1
  302. package/dist/useThemeAttributes-B199Regy.js.map +0 -1
  303. package/dist/utils-LQ4jJA-9.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"Alert-CZ0dDsuk.js","names":[],"sources":["../src/components/Alert/AlertAction.tsx","../src/components/Alert/AlertCollapsibleIcon.tsx","../src/components/Alert/AlertDescription.tsx","../src/components/Alert/AlertIcon.tsx","../src/components/Alert/AlertRoot.tsx","../src/components/Alert/AlertTitle.tsx","../src/components/Alert/Alert.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'> & {\n asChild?: boolean;\n};\n\nexport const AlertAction = ({ ref, className, asChild = false, ...props }: Props) => {\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp\n {...props}\n ref={ref}\n className={cn(\n 'tw:col-start-3',\n 'tw:row-start-1',\n 'tw:self-start',\n 'tw:flex',\n 'tw:gap-2',\n className,\n )}\n />\n );\n};\n","import { ChevronDown } from '../../icons';\nimport { cn } from '../../utils';\nimport { Tooltip } from '../Tooltip';\n\ntype Props = {\n open: boolean;\n};\n\nexport const AlertCollapsibleIcon = ({ open }: Props) => (\n <Tooltip placement=\"top\" tooltip={open ? 'Collapse alert' : 'Expand alert'} triggerAsChild>\n <ChevronDown\n className={cn(\n 'tw:mt-px',\n 'tw:size-5',\n 'tw:text-neutral-400',\n 'tw:group-data-[state=open]/alert:rotate-180',\n\n // Legacy tint uses fixed categorical hover scales; token tint uses themeable status colors.\n 'tw:group-data-[variant=info]/alert:group-data-[tint=legacy]/alert:group-hover:text-blue-600',\n 'tw:group-data-[variant=info]/alert:group-data-[tint=token]/alert:group-hover:text-info',\n 'tw:group-data-[variant=warning]/alert:group-data-[tint=legacy]/alert:group-hover:text-warning-600',\n 'tw:group-data-[variant=warning]/alert:group-data-[tint=token]/alert:group-hover:text-warning',\n 'tw:group-data-[variant=error]/alert:group-data-[tint=legacy]/alert:group-hover:text-error-600',\n 'tw:group-data-[variant=error]/alert:group-data-[tint=token]/alert:group-hover:text-destructive',\n 'tw:group-data-[variant=success]/alert:group-data-[tint=legacy]/alert:group-hover:text-green-600',\n 'tw:group-data-[variant=success]/alert:group-data-[tint=token]/alert:group-hover:text-success',\n )}\n />\n </Tooltip>\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const AlertDescription = ({ ref, children, className, ...rest }: Props) => (\n <div\n {...rest}\n ref={ref}\n className={cn(\n 'tw:col-start-2',\n 'tw:group-has-[[data-slot=alert-title]]/alert:col-end-[-1]',\n\n // spacer before description when a title exists (pseudo-element so it animates with Collapsible)\n 'tw:group-has-[[data-slot=alert-title]]/alert:before:block',\n 'tw:group-has-[[data-slot=alert-title]]/alert:before:h-1',\n \"tw:group-has-[[data-slot=alert-title]]/alert:before:content-['']\",\n\n 'tw:wrap-anywhere',\n\n // Default size for nested Lucide icons; callers can override on the icon.\n \"tw:[&_svg.lucide:not([class*='tw:size-'])]:size-4\",\n 'tw:[&_svg]:shrink-0',\n\n className,\n )}\n >\n {children}\n </div>\n);\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { AlertTriangle, CircleCheck, Info } from '../../icons';\nimport { cn } from '../../utils';\n\nimport type { Variant } from './AlertRoot';\n\nconst VARIANT_ICONS: Record<Variant, ReactNode> = {\n info: <Info />,\n warning: <AlertTriangle />,\n error: <AlertTriangle />,\n success: <CircleCheck />,\n};\n\ntype Props = {\n variant: Variant;\n icon?: ReactNode;\n} & Omit<ComponentProps<'span'>, 'children'>;\n\nexport const AlertIcon = ({ variant, icon, className, ...rest }: Props) => (\n <span\n {...rest}\n data-slot=\"alert-icon\"\n className={cn(\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:self-start',\n 'tw:p-0.5',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4',\n // Legacy tint uses fixed categorical icon scales; token tint uses themeable status colors.\n 'tw:group-data-[variant=info]/alert:group-data-[tint=legacy]/alert:text-blue-500',\n 'tw:group-data-[variant=info]/alert:group-data-[tint=token]/alert:text-info',\n 'tw:group-data-[variant=warning]/alert:group-data-[tint=legacy]/alert:text-warning-500',\n 'tw:group-data-[variant=warning]/alert:group-data-[tint=token]/alert:text-warning',\n 'tw:group-data-[variant=error]/alert:group-data-[tint=legacy]/alert:text-error-500',\n 'tw:group-data-[variant=error]/alert:group-data-[tint=token]/alert:text-destructive',\n 'tw:group-data-[variant=success]/alert:group-data-[tint=legacy]/alert:text-green-500',\n 'tw:group-data-[variant=success]/alert:group-data-[tint=token]/alert:text-success',\n className,\n )}\n >\n {icon ?? VARIANT_ICONS[variant]}\n </span>\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\nimport { useThemeAttributes } from '../ThemeProvider/useThemeAttributes';\n\nexport type Variant = 'info' | 'warning' | 'error' | 'success';\n\ntype Props = {\n variant?: Variant;\n} & ComponentProps<'div'>;\n\nexport const AlertRoot = ({ ref, children, className, variant, ...rest }: Props) => {\n const renderArgo = useArgoDesign();\n const { scheme } = useThemeAttributes();\n const legacyTint = !renderArgo && scheme !== 'dark';\n return (\n <div\n {...rest}\n ref={ref}\n data-variant={variant}\n data-argo={renderArgo}\n data-tint={legacyTint ? 'legacy' : 'token'}\n className={cn(\n 'tw:group/alert',\n\n // layout\n 'tw:grid',\n 'tw:grid-cols-[0_1fr_auto]',\n 'tw:has-[[data-slot=alert-icon]]:grid-cols-[auto_1fr_auto]',\n 'tw:has-[[data-slot=alert-icon]]:gap-x-2',\n\n // fonts\n 'tw:text-sm',\n // Tint mode of the text.\n // - `legacy`: legacy design in the light scheme — fixed neutral text.\n // - `token`: everything else — the semantic foreground, legible on any brand and scheme.\n 'tw:data-[tint=legacy]:text-neutral-800',\n 'tw:data-[tint=token]:text-foreground',\n 'tw:text-left',\n\n 'tw:p-4',\n\n // border — legacy keeps a fixed radius; argo follows the brand radius token.\n 'tw:rounded',\n 'tw:data-[argo=true]:rounded-[var(--radius-lg,0.25rem)]',\n 'tw:border',\n 'tw:border-solid',\n\n // Tint mode of the background and border.\n // - `legacy`: legacy design in the light scheme — fixed pastel scales.\n // - `token`: everything else — status tokens (bg at 10%, border at 25%), so dark mode and\n // brand overrides stay legible.\n 'tw:data-[variant=info]:data-[tint=legacy]:bg-blue-100',\n 'tw:data-[variant=info]:data-[tint=legacy]:border-blue-200',\n 'tw:data-[variant=info]:data-[tint=token]:bg-info/10',\n 'tw:data-[variant=info]:data-[tint=token]:border-info/25',\n\n 'tw:data-[variant=warning]:data-[tint=legacy]:bg-warning-100',\n 'tw:data-[variant=warning]:data-[tint=legacy]:border-warning-300',\n 'tw:data-[variant=warning]:data-[tint=token]:bg-warning/10',\n 'tw:data-[variant=warning]:data-[tint=token]:border-warning/25',\n\n 'tw:data-[variant=error]:data-[tint=legacy]:bg-error-100',\n 'tw:data-[variant=error]:data-[tint=legacy]:border-error-200',\n 'tw:data-[variant=error]:data-[tint=token]:bg-destructive/10',\n 'tw:data-[variant=error]:data-[tint=token]:border-destructive/25',\n\n 'tw:data-[variant=success]:data-[tint=legacy]:bg-green-100',\n 'tw:data-[variant=success]:data-[tint=legacy]:border-green-200',\n 'tw:data-[variant=success]:data-[tint=token]:bg-success/10',\n 'tw:data-[variant=success]:data-[tint=token]:border-success/25',\n className,\n )}\n >\n {children}\n </div>\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const AlertTitle = ({ ref, className, ...props }: Props) => (\n <div\n {...props}\n ref={ref}\n data-slot=\"alert-title\"\n className={cn(\n 'tw:group/alert-title',\n 'tw:flex',\n 'tw:col-start-2',\n 'tw:font-medium',\n 'tw:items-center',\n className,\n )}\n />\n);\n","import { useState } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../../utils';\nimport { Collapsible } from '../Collapsible';\n\nimport { AlertAction } from './AlertAction';\nimport { AlertCollapsibleIcon } from './AlertCollapsibleIcon';\nimport { AlertDescription } from './AlertDescription';\nimport { AlertIcon } from './AlertIcon';\nimport { AlertRoot } from './AlertRoot';\nimport { AlertTitle } from './AlertTitle';\n\ntype CommonProps = {\n hideIcon?: boolean;\n icon?: ReactNode;\n} & Pick<ComponentProps<typeof Collapsible>, 'open' | 'onOpenChange' | 'defaultOpen'> &\n Omit<ComponentProps<typeof AlertRoot>, 'children'>;\n\ntype CollapsibleProps = {\n mode: 'collapsible';\n title: ReactNode;\n children: ReactNode;\n actions?: never;\n};\n\ntype DefaultProps = {\n mode?: 'default';\n title?: ReactNode;\n children?: ReactNode;\n actions?: ReactNode;\n};\n\n/** Discriminated by `mode`: `\"collapsible\"` requires `title` + `children` and takes no `actions`. */\ntype Props = CommonProps & (CollapsibleProps | DefaultProps);\n\n/**\n * Persistent inline banner for contextual messages tied to the page layout.\n *\n * **When to use:** in-page messages; `mode=\"collapsible\"` hides long error details.\n * **When NOT to use:** transient feedback (`toast()`), field errors (`FormGroup state=\"error\"`),\n * confirmations (`Popconfirm`).\n *\n * @see RECIPES.md#alert-with-action\n */\nexport const Alert = ({\n title,\n variant = 'info',\n children,\n hideIcon = false,\n icon,\n className,\n actions,\n mode = 'default',\n\n // collapsible props\n defaultOpen = true,\n open: openProp,\n onOpenChange: onOpenChangeProp,\n\n ...rest\n}: Props) => {\n const isControlled = openProp !== undefined;\n\n const [innerOpen, setInnerOpen] = useState(defaultOpen);\n const open = isControlled ? openProp : innerOpen;\n const handleOpenChange = (nextOpen: boolean) => {\n if (!isControlled) {\n setInnerOpen(nextOpen);\n }\n onOpenChangeProp?.(nextOpen);\n };\n\n const isCollapsible = mode === 'collapsible' && !!title && !!children && !actions;\n\n if (isCollapsible)\n return (\n <Collapsible open={open} onOpenChange={handleOpenChange} asChild>\n <AlertRoot {...rest} variant={variant} className={className}>\n <Collapsible.Trigger\n className={cn(\n 'tailwindcss-preflight',\n 'tw:group',\n 'tw:col-span-full',\n 'tw:grid',\n 'tw:grid-cols-subgrid',\n 'tw:rounded-sm',\n 'tw:focus-visible:outline',\n 'tw:focus-visible:outline-2',\n 'tw:focus-visible:outline-ring',\n )}\n >\n {!hideIcon && <AlertIcon variant={variant} icon={icon} />}\n <AlertTitle>{title}</AlertTitle>\n <AlertCollapsibleIcon open={open} />\n </Collapsible.Trigger>\n\n <Collapsible.Content asChild>\n <AlertDescription>{children}</AlertDescription>\n </Collapsible.Content>\n </AlertRoot>\n </Collapsible>\n );\n\n return (\n <AlertRoot {...rest} variant={variant} className={className}>\n {!hideIcon && <AlertIcon variant={variant} icon={icon} />}\n {title && <AlertTitle>{title}</AlertTitle>}\n {children && <AlertDescription>{children}</AlertDescription>}\n {actions && <AlertAction>{actions}</AlertAction>}\n </AlertRoot>\n );\n};\n"],"mappings":";;;;;;;;;;AASA,MAAa,eAAe,EAAE,KAAK,WAAW,UAAU,OAAO,GAAG,YAAmB;CAEnF,OACE,oBAFW,UAAU,OAAO,OAE5B;EACE,GAAI;EACC;EACL,WAAW,GACT,kBACA,kBACA,iBACA,WACA,YACA,SACF;CACD,CAAA;AAEL;;;ACjBA,MAAa,wBAAwB,EAAE,WACrC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,oBAAC,YAAD,EAAA,UAAa,MAAkB,CAAA;GACxC,YAAY,oBAAC,kBAAD,EAAmB,SAA2B,CAAA;GAC1D,WAAW,oBAAC,aAAD,EAAA,UAAc,QAAqB,CAAA;EACtC;;AAEf"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AlertModal-BDle9ZVQ.js","names":[],"sources":["../src/components/AlertModal/AlertModalDescription.tsx","../src/components/AlertModal/AlertModalFooter.tsx","../src/components/AlertModal/AlertModalHeader.tsx","../src/components/AlertModal/AlertModalIcon.tsx","../src/components/AlertModal/AlertModalOverlay.tsx","../src/components/AlertModal/AlertModalTitle.tsx","../src/components/AlertModal/context.ts","../src/components/AlertModal/AlertModalContent.tsx","../src/components/AlertModal/AlertModalTrigger.tsx","../src/components/AlertModal/AlertModal.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<typeof AlertDialogPrimitive.Description>;\n\nexport const AlertModalDescription = ({ className, ...props }: Props) => (\n <AlertDialogPrimitive.Description\n className={cn(\n 'tw:font-sans',\n 'tw:tracking-normal',\n 'tw:font-normal',\n 'tw:text-muted-foreground',\n\n 'tw:group-data-[design=default]/alert-modal:text-foreground',\n 'tw:group-data-[design=default]/alert-modal:text-sm',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentPropsWithRef } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<'div'>;\n\nexport const AlertModalFooter = ({ className, ...props }: Props) => (\n <div\n className={cn(\n 'tw:flex',\n 'tw:gap-2',\n\n 'tw:group-data-[design=default]/alert-modal:flex-col',\n 'tw:group-data-[design=default]/alert-modal:sm:flex-row',\n\n 'tw:group-data-[design=argo]/alert-modal:justify-end',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentPropsWithRef } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<'div'>;\n\nexport const AlertModalHeader = ({ className, ...props }: Props) => (\n <div\n className={cn(\n 'tw:grid',\n 'tw:grid-cols-[auto_1fr]',\n 'tw:items-start',\n 'tw:gap-y-1',\n\n // default (legacy) needs more breathing room below the title's separator border\n 'tw:group-data-[design=default]/alert-modal:gap-y-4',\n 'tw:group-data-[design=argo]/alert-modal:gap-x-3',\n className,\n )}\n {...props}\n />\n);\n","import type { ReactNode } from 'react';\n\nimport { AlertTriangle, CircleCheck, Info } from '../../icons';\nimport { cn } from '../../utils';\n\nimport type { AlertModalVariant } from './variant';\n\nconst VARIANT_ICONS: Record<AlertModalVariant, ReactNode> = {\n info: <Info />,\n warning: <AlertTriangle />,\n danger: <AlertTriangle />,\n success: <CircleCheck />,\n};\n\ntype Props = {\n variant: AlertModalVariant;\n icon?: ReactNode;\n};\n\nexport const AlertModalIcon = ({ variant, icon }: Props) => {\n const glyph = icon ?? VARIANT_ICONS[variant];\n\n return (\n <>\n {/* Default design language: floating circular badge (Modal-style). Hidden in argo. */}\n <div\n data-slot=\"alert-modal-icon\"\n className={cn(\n 'tw:group-data-[design=argo]/alert-modal:hidden',\n 'tw:absolute',\n 'tw:top-0',\n 'tw:left-8',\n 'tw:translate-y-[-50%]',\n 'tw:size-12',\n )}\n >\n <div\n className={cn('tw:relative', 'tw:rounded-full', 'tw:size-12', {\n 'tw:bg-blue-500': variant === 'info',\n 'tw:bg-warning-500': variant === 'warning',\n 'tw:bg-error-500': variant === 'danger',\n 'tw:bg-green-500': variant === 'success',\n })}\n >\n <span\n className={cn(\n 'tw:absolute',\n 'tw:inset-0',\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:text-white',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-6',\n 'tw:[&_svg]:aspect-square',\n )}\n >\n {glyph}\n </span>\n </div>\n </div>\n\n {/* Argo design language: inline tinted badge (Badge \"*-inverse\" pattern). Hidden in default. */}\n <span\n data-slot=\"alert-modal-icon\"\n className={cn(\n 'tw:hidden',\n 'tw:group-data-[design=argo]/alert-modal:inline-flex',\n // grid placement: column 1 of the first row, top-aligned with the first line of content\n 'tw:col-start-1',\n 'tw:row-start-1',\n 'tw:self-start',\n 'tw:shrink-0',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:rounded',\n 'tw:size-8',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-5',\n {\n 'tw:bg-blue-100 tw:text-blue-600': variant === 'info',\n 'tw:bg-warning-100 tw:text-warning-500': variant === 'warning',\n 'tw:bg-error-100 tw:text-error-500': variant === 'danger',\n 'tw:bg-green-100 tw:text-green-900': variant === 'success',\n },\n )}\n >\n {glyph}\n </span>\n </>\n );\n};\n","import type { ComponentPropsWithRef } from 'react';\nimport { Overlay } from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<typeof Overlay>;\n\nexport const AlertModalOverlay = ({ ref, className, ...props }: Props) => (\n <Overlay\n {...props}\n ref={ref}\n className={cn(\n // positioning\n 'tw:fixed',\n 'tw:inset-0',\n 'tw:z-[1051]',\n\n // background\n 'tw:bg-scrim',\n\n // opening animation\n 'tw:data-[state=open]:duration-500',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=open]:animate-in',\n\n // closing animation\n 'tw:data-[state=closed]:duration-500',\n 'tw:data-[state=closed]:fade-out-0',\n 'tw:data-[state=closed]:animate-out',\n\n className,\n )}\n />\n);\n","import type { ComponentPropsWithRef } from 'react';\nimport { Title } from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<typeof Title>;\n\nexport const AlertModalTitle = ({ children, className, ...props }: Props) => (\n <Title\n {...props}\n asChild\n className={cn(\n 'tw:font-medium',\n 'tw:text-foreground',\n 'tw:wrap-anywhere',\n\n // default (legacy) gets a Modal-style separator line under the title (Modal uses border-neutral-150)\n 'tw:group-data-[design=default]/alert-modal:border-b',\n 'tw:group-data-[design=default]/alert-modal:border-neutral-150',\n 'tw:group-data-[design=default]/alert-modal:pb-3',\n className,\n )}\n >\n <h3>{children}</h3>\n </Title>\n);\n","import { createContext, use } from 'react';\nimport type { MouseEvent } from 'react';\n\ntype AlertModalContextType = {\n isLoading: boolean;\n onConfirm: (event: MouseEvent<HTMLButtonElement>) => void;\n onCancel: (event: MouseEvent<HTMLButtonElement>) => void;\n};\n\nconst AlertModalContext = createContext<AlertModalContextType | null>(null);\n\nexport const AlertModalContextProvider = AlertModalContext.Provider;\n\nexport const useAlertModalContext = (): AlertModalContextType => {\n const context = use(AlertModalContext);\n if (context === null)\n throw new Error('AlertModal compound components must be rendered inside <AlertModal>.');\n return context;\n};\n","import type { ComponentProps, ReactNode } from 'react';\nimport { Action, Cancel, Content, Portal } from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { AlertModalDescription } from './AlertModalDescription';\nimport { AlertModalFooter } from './AlertModalFooter';\nimport { AlertModalHeader } from './AlertModalHeader';\nimport { AlertModalIcon } from './AlertModalIcon';\nimport { AlertModalOverlay } from './AlertModalOverlay';\nimport { AlertModalTitle } from './AlertModalTitle';\nimport { useAlertModalContext } from './context';\nimport type { AlertModalVariant } from './variant';\n\ntype Props = {\n variant?: AlertModalVariant;\n /** `false` draws no icon at all, and gives the title and body its column. */\n icon?: ReactNode | false;\n title?: ReactNode;\n cancelLabel?: ReactNode;\n confirmLabel?: ReactNode;\n /** Disables confirm only; cancel stays available. */\n confirmDisabled?: boolean;\n container?: ComponentProps<typeof Portal>['container'];\n} & Omit<ComponentProps<typeof Content>, 'title'>;\n\nexport const AlertModalContent = ({\n variant = 'info',\n icon,\n title,\n cancelLabel = 'Cancel',\n confirmLabel: actionLabel = 'Confirm',\n confirmDisabled = false,\n container,\n className,\n children,\n onEscapeKeyDown,\n ...props\n}: Props) => {\n const { isLoading, onConfirm, onCancel } = useAlertModalContext();\n const designLanguage = useArgoDesign() ? 'argo' : 'default';\n\n const handleEscapeKeyDown: ComponentProps<typeof Content>['onEscapeKeyDown'] = (event) => {\n // Keeps a parent Modal/Sheet open when this confirmation is nested.\n event.stopPropagation();\n if (isLoading) event.preventDefault();\n onEscapeKeyDown?.(event);\n };\n\n return (\n <Portal container={container}>\n <AlertModalOverlay\n // Portaled events still bubble to the host's React handlers; Escape passes so Radix can close.\n onClick={(event) => event.stopPropagation()}\n onKeyDown={(event) => {\n if (event.key !== 'Escape') event.stopPropagation();\n }}\n >\n <Content\n data-design={designLanguage}\n // Silences Radix's missing-description warning when there are no children.\n {...(children ? {} : { 'aria-describedby': undefined })}\n onEscapeKeyDown={handleEscapeKeyDown}\n className={cn(\n 'tailwindcss-preflight',\n 'tw:group/alert-modal',\n 'tw:text-base',\n\n // positioning\n 'tw:fixed',\n 'tw:left-1/2',\n 'tw:-translate-x-1/2',\n 'tw:z-[1051]',\n 'tw:data-[design=default]:top-20',\n 'tw:data-[design=argo]:top-1/2',\n 'tw:data-[design=argo]:-translate-y-1/2',\n\n // sizing\n 'tw:w-full',\n 'tw:max-w-[480px]',\n 'tw:max-h-[calc(100vh-2*theme(spacing.20))]',\n 'tw:data-[design=argo]:overflow-y-auto',\n\n // layout\n 'tw:flex',\n 'tw:flex-col',\n 'tw:gap-4',\n\n 'tw:data-[design=default]:rounded-lg',\n 'tw:data-[design=argo]:rounded-modal',\n 'tw:bg-popover',\n 'tw:text-popover-foreground',\n\n 'tw:data-[design=default]:px-7',\n 'tw:data-[design=default]:py-8',\n 'tw:data-[design=argo]:p-4',\n\n // animation — shared\n 'tw:duration-200',\n 'tw:data-[state=open]:animate-in',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=closed]:animate-out',\n 'tw:data-[state=closed]:fade-out-0',\n\n // No `slide-*-left-1/2`: it would stack on the `translate` centring and fly in from the left.\n 'tw:data-[design=default]:data-[state=open]:zoom-in-80',\n 'tw:data-[design=default]:data-[state=open]:slide-in-from-top-[48%]',\n 'tw:data-[design=default]:data-[state=closed]:zoom-out-80',\n 'tw:data-[design=default]:data-[state=closed]:slide-out-to-top-[48%]',\n\n // argo: zoom only\n 'tw:data-[design=argo]:data-[state=open]:zoom-in-95',\n 'tw:data-[design=argo]:data-[state=closed]:zoom-out-95',\n\n className,\n )}\n {...props}\n >\n <AlertModalHeader>\n {icon !== false && <AlertModalIcon variant={variant} icon={icon} />}\n\n {title && (\n <AlertModalTitle\n className={cn(\n icon === false ? 'tw:col-start-1' : 'tw:col-start-2',\n 'tw:row-start-1 tw:self-center',\n )}\n >\n {title}\n </AlertModalTitle>\n )}\n\n {children && (\n <AlertModalDescription\n className={cn(\n icon === false ? 'tw:col-start-1' : 'tw:col-start-2',\n title ? 'tw:row-start-2' : 'tw:row-start-1 tw:self-center',\n )}\n >\n {children}\n </AlertModalDescription>\n )}\n </AlertModalHeader>\n\n <AlertModalFooter>\n <Cancel asChild>\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={isLoading}\n onClick={onCancel}\n className=\"tw:group-data-[design=default]/alert-modal:flex-1\"\n >\n {cancelLabel}\n </Button>\n </Cancel>\n\n <Action asChild>\n <Button\n type=\"button\"\n variant={variant === 'danger' ? 'danger' : 'primary'}\n isLoading={isLoading}\n disabled={isLoading || confirmDisabled}\n onClick={onConfirm}\n className=\"tw:group-data-[design=default]/alert-modal:flex-1\"\n >\n {actionLabel}\n </Button>\n </Action>\n </AlertModalFooter>\n </Content>\n </AlertModalOverlay>\n </Portal>\n );\n};\n","import type { ComponentPropsWithRef } from 'react';\nimport { Trigger } from '@radix-ui/react-alert-dialog';\n\ntype Props = ComponentPropsWithRef<typeof Trigger>;\n\nexport const AlertModalTrigger = ({ ref, onClick, onKeyDown, ...props }: Props) => (\n <Trigger\n {...props}\n ref={ref}\n onClick={(event) => {\n // The trigger sits in the normal DOM tree, often inside a clickable row/card. Stop the\n // open-click from bubbling to that ancestor's onClick. (Radix still opens the modal —\n // stopPropagation only blocks ancestors, not the open handler on the same element.)\n event.stopPropagation();\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n // Only the activation keys open the modal and would leak; stop just those so Tab/arrows/etc.\n // still reach ancestor keyboard handlers. The button still activates (stopPropagation only\n // blocks ancestors).\n if (event.key === 'Enter' || event.key === ' ') event.stopPropagation();\n onKeyDown?.(event);\n }}\n />\n);\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { ComponentProps, MouseEvent } from 'react';\nimport { Root } from '@radix-ui/react-alert-dialog';\n\nimport { AlertModalContent } from './AlertModalContent';\nimport { AlertModalTrigger } from './AlertModalTrigger';\nimport { AlertModalContextProvider } from './context';\n\nconst noop = () => undefined;\n\ntype ConfirmHandler = (event: MouseEvent<HTMLButtonElement>) => void | Promise<unknown>;\ntype CancelHandler = (event: MouseEvent<HTMLButtonElement>) => void;\n\ntype Props = {\n onConfirm?: ConfirmHandler;\n onCancel?: CancelHandler;\n skipAsyncWait?: boolean;\n /** Marks the confirm action busy from the outside, on top of the state inferred from a thenable `onConfirm`. */\n isLoading?: boolean;\n} & ComponentProps<typeof Root>;\n\nexport const AlertModal = ({\n children,\n onConfirm = noop,\n onCancel = noop,\n skipAsyncWait = false,\n isLoading = false,\n open,\n defaultOpen,\n onOpenChange,\n ...rest\n}: Props) => {\n const [isConfirming, setIsConfirming] = useState(false);\n\n // Controllable open state: when `open` is provided the parent owns it; otherwise we keep our own.\n const isControlled = open !== undefined;\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);\n const isOpen = isControlled ? open : uncontrolledOpen;\n\n const confirmRef = useRef(onConfirm);\n const cancelRef = useRef(onCancel);\n const onOpenChangeRef = useRef(onOpenChange);\n\n // Latest-ref pattern: keep the handlers out of `context`'s deps so its identity stays stable,\n // without writing to refs during render (synced in an effect, before any handler can fire).\n useEffect(() => {\n confirmRef.current = onConfirm;\n cancelRef.current = onCancel;\n onOpenChangeRef.current = onOpenChange;\n }, [onConfirm, onCancel, onOpenChange]);\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) setUncontrolledOpen(next);\n onOpenChangeRef.current?.(next);\n },\n [isControlled],\n );\n\n const context = useMemo(\n () => ({\n // The two sources of \"the confirm action is running\" converge here, so every consumer\n // downstream reads one answer regardless of which way the host drives it.\n isLoading: isConfirming || isLoading,\n onConfirm: (event: MouseEvent<HTMLButtonElement>) => {\n const result = confirmRef.current(event);\n\n // Treat any thenable as async, not just native promises.\n const isThenable =\n result !== null && typeof result === 'object' && typeof result.then === 'function';\n if (!isThenable || skipAsyncWait) return;\n\n // The async confirm's outcome drives the modal.\n // - `preventDefault` stops the click closing it, so it stays up while the action runs.\n // - Resolved closes it; rejected leaves it up so the failure stays visible.\n // - The rejection is deliberately not caught — the host's global handler reports it.\n event.preventDefault();\n setIsConfirming(true);\n Promise.resolve(result)\n .then(() => setOpen(false))\n .finally(() => setIsConfirming(false));\n },\n onCancel: (event: MouseEvent<HTMLButtonElement>) => {\n cancelRef.current(event);\n },\n }),\n [isConfirming, isLoading, skipAsyncWait, setOpen],\n );\n\n return (\n <Root {...rest} open={isOpen} onOpenChange={setOpen}>\n <AlertModalContextProvider value={context}>{children}</AlertModalContextProvider>\n </Root>\n );\n};\n\nAlertModal.Trigger = AlertModalTrigger;\nAlertModal.Content = AlertModalContent;\n"],"mappings":";;;;;;;;;AAOA,MAAa,yBAAyB,EAAE,WAAW,GAAG,YACpD,oBAAC,qBAAqB,aAAtB;CACE,WAAW,GACT,gBACA,sBACA,kBACA,4BAEA,8DACA,sDACA,SACF;CACA,GAAI;AACL,CAAA;;;ACdH,MAAa,oBAAoB,EAAE,WAAW,GAAG,YAC/C,oBAAC,OAAD;CACE,WAAW,GACT,WACA,YAEA,uDACA,0DAEA,uDACA,SACF;CACA,GAAI;AACL,CAAA;;;ACbH,MAAa,oBAAoB,EAAE,WAAW,GAAG,YAC/C,oBAAC,OAAD;CACE,WAAW,GACT,WACA,2BACA,kBACA,cAGA,sDACA,mDACA,SACF;CACA,GAAI;AACL,CAAA;;;ACbH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d,WAAW,UAAU;EACrB,UAAU,UAAU;EACpB,gBAAgB,UAAU;CAC5B,GAAG;EAAC;EAAW;EAAU;CAAY,CAAC;CAEtC,MAAM,UAAU,aACb,SAAkB;EACjB,IAAI,CAAC,cAAc,oBAAoB,IAAI;EAC3C,gBAAgB,UAAU,IAAI;CAChC,GACA,CAAC,YAAY,CACf;CAEA,MAAM,UAAU,eACP;EAGL,WAAW,gBAAgB;EAC3B,YAAY,UAAyC;GACnD,MAAM,SAAS,WAAW,QAAQ,KAAK;GAKvC,IAAI,EADF,WAAW,QAAQ,OAAO,WAAW,YAAY,OAAO,OAAO,SAAS,eACvD,eAAe;GAMlC,MAAM,eAAe;GACrB,gBAAgB,IAAI;GACpB,QAAQ,QAAQ,MAAM,CAAC,CACpB,WAAW,QAAQ,KAAK,CAAC,CAAC,CAC1B,cAAc,gBAAgB,KAAK,CAAC;EACzC;EACA,WAAW,UAAyC;GAClD,UAAU,QAAQ,KAAK;EACzB;CACF,IACA;EAAC;EAAc;EAAW;EAAe;CAAO,CAClD;CAEA,OACE,oBAAC,MAAD;EAAM,GAAI;EAAM,MAAM;EAAQ,cAAc;EAC1C,UAAA,oBAAC,2BAAD;GAA2B,OAAO;GAAU;EAAoC,CAAA;CAC5E,CAAA;AAEV;AAEA,WAAW,UAAU;AACrB,WAAW,UAAU"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AutoSaveTextarea-jiqNeeE4.js","names":[],"sources":["../src/blocks/AutoSaveTextarea/AutoSaveTextarea.tsx"],"sourcesContent":["import { type ComponentProps, useState } from 'react';\n\nimport { CircleCheck, Loader2 } from '../../icons';\nimport { cn } from '../../utils';\nimport { Textarea } from '../Textarea';\n\ntype AutoSaveTextareaProps = {\n savedValue?: string;\n onSave: (value: string) => Promise<void>;\n placeholder?: string;\n disabled?: boolean;\n grow?: boolean;\n} & Pick<\n ComponentProps<typeof Textarea>,\n 'variant' | 'minRows' | 'maxRows' | 'className' | 'containerClassName' | 'maxLength'\n>;\n\nexport const AutoSaveTextarea = ({\n savedValue,\n onSave,\n placeholder,\n disabled,\n grow = false,\n ...textareaProps\n}: AutoSaveTextareaProps) => {\n const { maxLength, ...restTextareaProps } = textareaProps;\n const [value, setValue] = useState<string | null>(null);\n const [isSaving, setIsSaving] = useState(false);\n\n const currentValue = value ?? savedValue ?? '';\n const isOverLimit = maxLength != null && currentValue.length > maxLength;\n const isChanged = value !== null && savedValue !== value.trim();\n\n const onSaveHandler = (blurValue = '') => {\n if (!isChanged || isOverLimit) return;\n\n setIsSaving(true);\n onSave(blurValue.trim())\n .catch(() => {})\n .finally(() => {\n setIsSaving(false);\n });\n };\n\n return (\n <div\n className={cn(\n 'tw:relative',\n // `-mx-1 + px-3` gives the focus ring 4px of horizontal breathing room inside\n // ancestors that clip with `overflow: hidden` and no horizontal padding (e.g. the\n // Kai sidebar's TabsContent). `-my-1 + py-1` keeps the original zero vertical inset.\n grow &&\n 'tw:-m-1 tw:flex tw:min-h-0 tw:flex-1 tw:flex-col tw:overflow-hidden tw:px-3 tw:py-1',\n )}\n >\n <Textarea\n {...restTextareaProps}\n containerClassName={cn(\n // Descendant selectors match InputGroup's `tw:[&>textarea]:!min-h-[…]` specificity\n // so the textarea fills the wrapper instead of being pinned to the sizing min-height.\n grow &&\n 'tw:min-h-0 tw:flex-1 tw:overflow-hidden tw:[&>textarea]:!min-h-full tw:[&>textarea]:!max-h-full tw:[&>textarea]:overflow-y-auto',\n restTextareaProps.containerClassName,\n )}\n state={isOverLimit ? 'error' : undefined}\n value={currentValue}\n onValueChange={setValue}\n onValueBlur={() => onSaveHandler(value ?? '')}\n placeholder={placeholder}\n disabled={disabled || isSaving}\n disableResize={grow}\n // `grow` fills the container regardless of content length; skip the 4-row cap.\n maxRows={grow ? 'unlimited' : restTextareaProps.maxRows}\n />\n <div\n className={cn(\n 'tw:mt-1 tw:flex tw:items-center tw:text-xs',\n maxLength != null ? 'tw:justify-between' : 'tw:justify-end',\n )}\n >\n {maxLength != null && (\n <span className={cn(isOverLimit ? 'tw:text-error-500' : 'tw:text-neutral-400')}>\n {currentValue.length} / {maxLength}\n </span>\n )}\n <span className=\"tw:flex tw:items-center tw:gap-1 tw:text-neutral-400\">\n {isOverLimit && 'Character limit exceeded'}\n {!isOverLimit && isChanged && !isSaving && 'Unsaved'}\n {!isOverLimit && isChanged && isSaving && (\n <>\n <Loader2 className=\"tw:size-4 tw:animate-spin\" /> Saving\n </>\n )}\n {!isOverLimit && value !== null && !isChanged && !isSaving && (\n <>\n <CircleCheck className=\"tw:size-4 tw:text-green-500\" /> Saved\n </>\n )}\n </span>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;AAiBA,MAAa,oBAAoB,EAC/B,YACA,QACA,aACA,UACA,OAAO,OACP,GAAG,oBACwB;CAC3B,MAAM,EAAE,WAAW,GAAG,sBAAsB;CAC5C,MAAM,CAAC,OAAO,YAAY,SAAwB,IAAI;CACtD,MAAM,CAAC,UAAU,eAAe,SAAS,KAAK;CAE9C,MAAM,eAAe,SAAS,cAAc;CAC5C,MAAM,cAAc,aAAa,QAAQ,aAAa,SAAS;CAC/D,MAAM,YAAY,UAAU,QAAQ,eAAe,MAAM,KAAK;CAE9D,MAAM,iBAAiB,YAAY,OAAO;EACxC,IAAI,CAAC,aAAa,aAAa;EAE/B,YAAY,IAAI;EAChB,OAAO,UAAU,KAAK,CAAC,CAAC,CACrB,YAAY,CAAC,CAAC,CAAC,CACf,cAAc;GACb,YAAY,KAAK;EACnB,CAAC;CACL;CAEA,OACE,qBAAC,OAAD;EACE,WAAW,GACT,eAIA,QACE,qFACJ;EARF,UAAA,CAUE,oBAAC,UAAD;GACE,GAAI;GACJ,oBAAoB,GAGlB,QACE,mIACF,kBAAkB,kBACpB;GACA,OAAO,cAAc,UAAU,KAAA;GAC/B,OAAO;GACP,eAAe;GACf,mBAAmB,cAAc,SAAS,EAAE;GAC/B;GACb,UAAU,YAAY;GACtB,eAAe;GAEf,SAAS,OAAO,cAAc,kBAAkB;EACjD,CAAA,GACD,qBAAC,OAAD;GACE,WAAW,GACT,8CACA,aAAa,OAAO,uBAAuB,gBAC7C;GAJF,UAAA,CAMG,aAAa,QACZ,qBAAC,QAAD;IAAM,WAAW,GAAG,cAAc,sBAAsB,qBAAqB;IAA7E,UAAA;KACG,aAAa;KAAO;KAAI;IACrB;GAER,CAAA,GAAA,qBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA;KACG,eAAe;KACf,CAAC,eAAe,aAAa,CAAC,YAAY;KAC1C,CAAC,eAAe,aAAa,YAC5B,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,SAAD,EAAS,WAAU,4BAA6B,CAAA,GAAC,SACjD,EAAA,CAAA;KAEH,CAAC,eAAe,UAAU,QAAQ,CAAC,aAAa,CAAC,YAChD,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,aAAD,EAAa,WAAU,8BAA+B,CAAA,GAAC,QACvD,EAAA,CAAA;IAEA;GACH,CAAA,CAAA;EACF,CAAA,CAAA;;AAET"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Badge-Ba3epgcI.js","names":[],"sources":["../src/components/Badge/BadgeAddon.tsx","../src/components/Badge/BadgeButton.tsx","../src/components/Badge/BadgeLabel.tsx","../src/components/Badge/styles.ts","../src/components/Badge/BadgeRoot.tsx","../src/components/Badge/Badge.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\n\nconst addonVariants = cva(\n [\n 'tw:flex',\n 'tw:items-center',\n 'tw:shrink-0',\n 'tw:bg-inherit',\n 'tw:self-stretch',\n 'tw:px-1',\n 'tw:has-[button]:px-0',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-3',\n ],\n {\n defaultVariants: {\n align: 'inline-end',\n variant: 'inline',\n },\n variants: {\n align: {\n 'inline-start': ['tw:order-first'],\n 'inline-end': ['tw:order-last'],\n },\n variant: {\n inline: [],\n floating: [\n 'tw:hidden',\n 'tw:group-hover/badge:flex',\n\n 'tw:absolute',\n 'tw:top-0',\n 'tw:bottom-0',\n 'tw:focus-within:flex',\n ],\n },\n },\n compoundVariants: [\n { variant: 'floating', align: 'inline-end', className: ['tw:right-0'] },\n { variant: 'floating', align: 'inline-start', className: ['tw:left-0'] },\n ],\n },\n);\n\ntype Props = ComponentProps<'div'> & VariantProps<typeof addonVariants>;\n\nexport const BadgeAddon = ({\n ref,\n align = 'inline-end',\n variant = 'inline',\n className,\n ...rest\n}: Props) => (\n <div\n {...rest}\n ref={ref}\n data-align={align}\n data-variant={variant}\n className={cn(addonVariants({ align, variant, className }))}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'button'>;\n\nexport const BadgeButton = ({ ref, className, type = 'button', children, ...rest }: Props) => (\n <button\n {...rest}\n ref={ref}\n type={type}\n className={cn(\n 'tailwindcss-preflight',\n\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:cursor-pointer',\n\n 'tw:bg-inherit',\n 'tw:text-inherit',\n\n 'tw:hover:brightness-95',\n 'tw:px-1',\n\n // The focus ring lives here rather than on `BadgeRoot`, whose own `focus-visible` block\n // sits on a `div` that never takes focus. Inset, because a badge root clips its overflow —\n // an outset ring on a nested button would be cut off.\n 'tw:focus-visible:outline-hidden',\n 'tw:focus-visible:ring-2',\n 'tw:focus-visible:ring-inset',\n 'tw:focus-visible:ring-ring',\n // Default sizing for Lucide-icon children (which ship at 24×24); keeps\n // the visual baseline aligned with the previous FA-icon API and other\n // icon-wrapper components (ItemIcon, SidebarMenuIcon).\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-3',\n className,\n )}\n >\n {children}\n </button>\n);\n","import type { ComponentProps } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'span'> & {\n asChild?: boolean;\n};\n\nexport const BadgeLabel = ({ ref, className, asChild = false, ...rest }: Props) => {\n const Comp = asChild ? Slot : 'span';\n return (\n <Comp\n {...rest}\n ref={ref}\n data-slot=\"badge-label\"\n className={cn(\n 'tw:max-w-56',\n 'tw:truncate',\n 'tw:px-2',\n 'tw:py-0.5',\n\n // Drop side padding only when an *inline* addon is present —\n // floating addons overlay the label without taking layout space,\n // so the label still needs full padding behind them.\n 'tw:group-has-[[data-align=inline-start][data-variant=inline]:not(:empty)]/badge:pl-0',\n 'tw:group-has-[[data-align=inline-end][data-variant=inline]:not(:empty)]/badge:pr-0',\n className,\n )}\n />\n );\n};\n","import { cva } from 'class-variance-authority';\n\n/**\n * Badge's `color` variants: fill, foreground, and a `decoration-*` matching the fill.\n *\n * - Tinted (`-inverse`) variants invert under `[data-theme=dark]`; solid fills don't.\n * - Measured by `scripts/contrast-audit.ts` and the contrast story tests.\n */\nexport const badgeColors = {\n gray: 'tw:bg-neutral-400 tw:text-white tw:decoration-neutral-400',\n 'gray-darker': 'tw:bg-neutral-500 tw:text-white tw:decoration-neutral-500',\n 'gray-inverse':\n 'tw:bg-neutral-100 tw:text-neutral-500 tw:decoration-neutral-100 tw:[[data-theme=dark]_&]:bg-neutral-700 tw:[[data-theme=dark]_&]:text-neutral-300 tw:[[data-theme=dark]_&]:decoration-neutral-700',\n green: 'tw:bg-green-500 tw:text-white tw:decoration-green-500',\n 'green-darker': 'tw:bg-green-600 tw:text-white tw:decoration-green-600',\n 'green-inverse':\n 'tw:bg-green-100 tw:text-green-900 tw:decoration-green-100 tw:[[data-theme=dark]_&]:bg-green-900 tw:[[data-theme=dark]_&]:text-green-200 tw:[[data-theme=dark]_&]:decoration-green-900',\n blue: 'tw:bg-blue-500 tw:text-white tw:decoration-blue-500',\n 'blue-inverse':\n 'tw:bg-blue-100 tw:text-blue-800 tw:decoration-blue-100 tw:[[data-theme=dark]_&]:bg-blue-900 tw:[[data-theme=dark]_&]:text-blue-200 tw:[[data-theme=dark]_&]:decoration-blue-900',\n red: 'tw:bg-error-500 tw:text-white tw:decoration-error-500',\n orange: 'tw:bg-warning-500 tw:text-white tw:decoration-warning-500',\n 'orange-inverse':\n 'tw:bg-warning-100 tw:text-warning-800 tw:decoration-warning-100 tw:[[data-theme=dark]_&]:bg-warning-900 tw:[[data-theme=dark]_&]:text-warning-200 tw:[[data-theme=dark]_&]:decoration-warning-900',\n amber: 'tw:bg-warning-300 tw:text-warning-800 tw:decoration-warning-300',\n // One rung deeper than `orange-inverse` so caution stays distinct from warning (same hue).\n 'amber-inverse':\n 'tw:bg-warning-200 tw:text-warning-800 tw:decoration-warning-200 tw:[[data-theme=dark]_&]:bg-warning-800 tw:[[data-theme=dark]_&]:text-warning-200 tw:[[data-theme=dark]_&]:decoration-warning-800',\n teal: 'tw:bg-teal-500 tw:text-white tw:decoration-teal-500',\n 'teal-inverse':\n 'tw:bg-teal-100 tw:text-teal-800 tw:decoration-teal-100 tw:[[data-theme=dark]_&]:bg-teal-900 tw:[[data-theme=dark]_&]:text-teal-200 tw:[[data-theme=dark]_&]:decoration-teal-900',\n purple: 'tw:bg-purple-500 tw:text-white tw:decoration-purple-500',\n 'purple-inverse':\n 'tw:bg-purple-100 tw:text-purple-800 tw:decoration-purple-100 tw:[[data-theme=dark]_&]:bg-purple-900 tw:[[data-theme=dark]_&]:text-purple-200 tw:[[data-theme=dark]_&]:decoration-purple-900',\n cyan: 'tw:bg-cyan-500 tw:text-white tw:decoration-cyan-500',\n 'cyan-inverse':\n 'tw:bg-cyan-100 tw:text-cyan-800 tw:decoration-cyan-100 tw:[[data-theme=dark]_&]:bg-cyan-900 tw:[[data-theme=dark]_&]:text-cyan-200 tw:[[data-theme=dark]_&]:decoration-cyan-900',\n 'sidebar-primary': 'tw:bg-sidebar-primary tw:text-white tw:decoration-sidebar-primary',\n white: 'tw:bg-white/90 tw:text-neutral-600 tw:decoration-white/90',\n} as const;\n\n/** A `Badge` `color` value. */\nexport type BadgeColor = keyof typeof badgeColors;\n\n/** Tinted variants are held to WCAG-AA; solid fills are pinned, so only recorded. */\nexport const isTintedBadgeColor = (color: string): boolean => color.endsWith('-inverse');\n\nexport const badgeRootVariants = cva(\n [\n 'tailwindcss-preflight',\n 'tw:group/badge',\n\n // display\n 'tw:relative',\n 'tw:inline-flex',\n 'tw:justify-center',\n 'tw:items-center',\n 'tw:min-h-5',\n 'tw:h-fit',\n 'tw:shrink-0',\n 'tw:overflow-hidden',\n\n // text — weight/tracking are brand-overridable tokens\n 'tw:whitespace-pre-wrap',\n 'tw:break-normal',\n 'tw:text-xs',\n 'tw:font-medium',\n 'tw:tracking-chrome',\n 'tw:text-center',\n 'tw:underline',\n\n // content\n 'tw:border-none',\n 'tw:[&>svg]:self-center',\n 'tw:[button&]:cursor-pointer',\n\n // focus\n 'tw:focus-visible:outline-hidden',\n 'tw:focus-visible:ring-2',\n 'tw:focus-visible:ring-inset',\n 'tw:focus-visible:ring-ring',\n ],\n {\n defaultVariants: {\n color: 'gray',\n variant: 'default',\n },\n variants: {\n variant: {\n // Only `keboola-legacy-*` brands uppercase; same rule as `Button` and `Tooltip`.\n default: ['tw:rounded', 'tw:[[data-brand^=keboola-legacy]_&]:uppercase'],\n tag: ['tw:rounded tw:normal-case'],\n pill: ['tw:min-w-5 tw:rounded-full tw:normal-case tw:tracking-normal'],\n },\n color: badgeColors,\n },\n },\n);\n","import type { ComponentProps } from 'react';\nimport { type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\n\nimport { badgeRootVariants } from './styles';\n\ntype Props = ComponentProps<'div'> & VariantProps<typeof badgeRootVariants>;\n\nexport const BadgeRoot = ({ ref, variant, color, className, children, ...rest }: Props) => (\n <div\n {...rest}\n ref={ref}\n data-slot=\"badge\"\n className={cn(badgeRootVariants({ variant, color, className }))}\n >\n {children}\n </div>\n);\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { BadgeAddon } from './BadgeAddon';\nimport { BadgeButton } from './BadgeButton';\nimport { BadgeLabel } from './BadgeLabel';\nimport { BadgeRoot } from './BadgeRoot';\n\ntype AddonVariant = ComponentProps<typeof BadgeAddon>['variant'];\ntype BadgeRootProps = ComponentProps<typeof BadgeRoot>;\ntype BadgeLabelProps = ComponentProps<typeof BadgeLabel>;\n\n/**\n * - `color` is semantic (`green` success, `red` error, `orange` warning, `amber` caution; rest decorative).\n * - Colours stay fixed across brand themes.\n */\ntype Props = Pick<BadgeRootProps, 'variant' | 'color'> &\n Omit<BadgeLabelProps, 'prefix'> & {\n prefix?: ReactNode;\n prefixVariant?: AddonVariant;\n suffix?: ReactNode;\n suffixVariant?: AddonVariant;\n labelClassName?: string;\n };\n\n/**\n * Inline pill for a status, count or tag.\n *\n * - Not for actions (`Button` / `ButtonInline`) or banners (`Alert`).\n * - `Badge.Button` for a clickable badge.\n */\nconst BadgeInner = ({\n ref,\n variant = 'pill',\n color,\n prefix,\n prefixVariant = 'inline',\n suffix,\n suffixVariant = 'inline',\n className,\n labelClassName,\n ...labelProps\n}: Props) => (\n <BadgeRoot className={className} variant={variant} color={color}>\n {prefix && (\n <BadgeAddon align=\"inline-start\" variant={prefixVariant}>\n {prefix}\n </BadgeAddon>\n )}\n <BadgeLabel {...labelProps} ref={ref} className={labelClassName} />\n {suffix && (\n <BadgeAddon align=\"inline-end\" variant={suffixVariant}>\n {suffix}\n </BadgeAddon>\n )}\n </BadgeRoot>\n);\n\nexport const Badge = Object.assign(BadgeInner, {\n Root: BadgeRoot,\n Button: BadgeButton,\n Label: BadgeLabel,\n Addon: BadgeAddon,\n});\n"],"mappings":";;;;;AAKA,MAAM,gBAAgB,IACpB;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GACA;CACE,iBAAiB;EACf,OAAO;EACP,SAAS;CACX;CACA,UAAU;EACR,OAAO;GACL,gBAAgB,CAAC,gBAAgB;GACjC,cAAc,CAAC,eAAe;EAChC;EACA,SAAS;GACP,QAAQ,CAAC;GACT,UAAU;IACR;IACA;IAEA;IACA;IACA;IACA;GACF;EACF;CACF;CACA,kBAAkB,CAChB;EAAE,SAAS;EAAY,OAAO;EAAc,WAAW,CAAC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F,MAAM;GACN,gBACE;GACF,mBAAmB;GACnB,OAAO;EAwDI;CACT;AACF,CACF;;;ACxFA,MAAa,aAAa,EAAE,KAAK,SAAS,OAAO,WAAW,UAAU,GAAG,WACvE,oBAAC,OAAD;CACE,GAAI;CACC;CACL,aAAU;CACV,WAAW,GAAG,kBAAkB;EAAE;EAAS;EAAO;CAAU,CAAC,CAAC;CAE7D;AACE,CAAA;;;;;;;;;ACaP,MAAM,cAAc,EAClB,KACA,UAAU,QACV,OACA,QACA,gBAAgB,UAChB,QACA,gBAAgB,UAChB,WACA,gBACA,GAAG,iBAEH,qBAAC,WAAD;CAAsB;CAAoB;CAAgB;CAA1D,UAAA;EACG,UACC,oBAAC,YAAD;GAAY,OAAM;GAAe,SAAS;GACvC,UAAA;EACS,CAAA;EAEd,oBAAC,YAAD;GAAY,GAAI;GAAiB;GAAK,WAAW;EAAiB,CAAA;EACjE,UACC,oBAAC,YAAD;GAAY,OAAM;GAAa,SAAS;GACrC,UAAA;EACS,CAAA;CAEL;;AAGb,MAAa,QAAQ,OAAO,OAAO,YAAY;CAC7C,MAAM;CACN,QAAQ;CACR,OAAO;CACP,OAAO;AACT,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrandEditor-CN2HJ_12.js","names":[],"sources":["../src/blocks/BrandEditor/color.ts","../src/blocks/BrandEditor/ColorField.tsx","../src/blocks/BrandEditor/contrast.ts","../src/blocks/BrandEditor/ControlSection.tsx","../src/blocks/BrandEditor/LogoField.tsx","../src/blocks/BrandEditor/TextField.tsx","../src/blocks/BrandEditor/BrandEditor.tsx"],"sourcesContent":["// Brand colours are stored as space-separated \"R G B\" channel strings (see\n// `rgbChannelsSchema` in @keboola/brand-registry); `ColorInput` speaks hex.\n// These helpers convert at that boundary.\n\nexport const hexToChannels = (hex: string): string => {\n let h = hex.trim().replace(/^#/, '');\n // Expand 3/4-digit shorthand and drop alpha (4- and 8-digit `#rgba`/`#rrggbbaa`) — brand\n // channels carry no alpha. Anything else is malformed → fall back to black.\n if (h.length === 3 || h.length === 4) {\n h = h\n .slice(0, 3)\n .split('')\n .map((c) => c + c)\n .join('');\n } else if (h.length === 8) {\n h = h.slice(0, 6);\n }\n if (!/^[0-9a-fA-F]{6}$/.test(h)) return '0 0 0';\n const n = parseInt(h, 16);\n return `${(n >> 16) & 255} ${(n >> 8) & 255} ${n & 255}`;\n};\n\nexport const channelsToHex = (channels: string): string => {\n const [r = 0, g = 0, b = 0] = channels\n .trim()\n .split(/\\s+/)\n .map((n) => Number(n) || 0);\n const to2 = (v: number) => Math.max(0, Math.min(255, v)).toString(16).padStart(2, '0');\n return `#${to2(r)}${to2(g)}${to2(b)}`;\n};\n","import { Label } from '../../components/Label';\nimport { ColorInput } from '../ColorInput';\n\nimport { channelsToHex, hexToChannels } from './color';\n\ntype Props = {\n id: string;\n label: string;\n /** Current value as an \"R G B\" channel string. */\n channels: string;\n /** Called with a new \"R G B\" channel string when a valid colour is picked. */\n onChange: (channels: string) => void;\n};\n\n// ColorInput fires `onValueChange` on every keystroke (it only coerces on blur), so commit a\n// channel value only for a COMPLETE 3-, 4-, 6-, or 8-digit hex — otherwise a partial \"#1\"/\"#\"\n// would write unintended channels. Alpha (4-/8-digit) is truncated to RGB, since brand tokens\n// carry no alpha.\nconst COMPLETE_HEX = /^([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;\n\n/** A labelled hex colour picker bound to a brand token (stored as RGB channels). */\nexport const ColorField = ({ id, label, channels, onChange }: Props) => {\n const hex = channelsToHex(channels);\n\n return (\n <div className=\"tw:flex tw:items-center tw:justify-between tw:gap-2\">\n <Label htmlFor={id} className=\"tw:text-xs tw:font-normal tw:text-foreground\">\n {label}\n </Label>\n <ColorInput\n id={id}\n sizing=\"medium\"\n value={hex}\n className=\"tw:w-36\"\n onValueChange={(next) => {\n const clean = next.trim().replace(/^#/, '');\n // Commit only complete hex (hexToChannels handles the 3/6/8-digit shapes + alpha drop).\n if (COMPLETE_HEX.test(clean)) onChange(hexToChannels(`#${clean}`));\n }}\n />\n </div>\n );\n};\n","// WCAG contrast helpers over `\"R G B\"` channel strings (the brand token format).\n\n// Coerce non-numeric/blank channels to 0 and clamp to the valid 0–255 range, so a malformed\n// token (e.g. \"999 999 999\") can neither NaN-out nor push luminance past WCAG's expected bounds.\nconst clampChannel = (n: number): number =>\n Number.isFinite(n) ? Math.min(255, Math.max(0, n)) : 0;\n\nconst parseChannels = (channels: string): [number, number, number] => {\n const [r = 0, g = 0, b = 0] = channels\n .trim()\n .split(/\\s+/)\n .map((n) => clampChannel(Number(n)));\n return [r, g, b];\n};\n\nconst relativeLuminance = (channels: string): number => {\n // Destructure with defaults (not an `as` assertion) so `r`/`g`/`b` are `number` under\n // `noUncheckedIndexedAccess` without a production-code type cast.\n const [r = 0, g = 0, b = 0] = parseChannels(channels).map((c) => {\n const s = c / 255;\n return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\n/** WCAG contrast ratio (1–21) between two `\"R G B\"` colours. */\nexport const contrastRatio = (fg: string, bg: string): number => {\n const l1 = relativeLuminance(fg);\n const l2 = relativeLuminance(bg);\n const [lighter, darker] = l1 >= l2 ? [l1, l2] : [l2, l1];\n return (lighter + 0.05) / (darker + 0.05);\n};\n\n/** WCAG level for normal-size text at a given ratio. */\nexport const wcagLevel = (ratio: number): 'AAA' | 'AA' | 'fail' =>\n ratio >= 7 ? 'AAA' : ratio >= 4.5 ? 'AA' : 'fail';\n","import type { ReactNode } from 'react';\n\ntype Props = {\n title: string;\n children: ReactNode;\n};\n\n/** A titled block inside `BrandEditor`. */\nexport const ControlSection = ({ title, children }: Props) => (\n <section className=\"tw:flex tw:flex-col tw:gap-3 tw:border-b tw:border-border tw:p-4\">\n <h3 className=\"tw:m-0 tw:text-xs tw:font-semibold tw:uppercase tw:tracking-wide tw:text-muted-foreground\">\n {title}\n </h3>\n {children}\n </section>\n);\n","import { Label } from '../../components/Label';\nimport { Textarea } from '../Textarea';\n\ntype Props = {\n id: string;\n label: string;\n /** Current logo source: SVG markup, a `data:` URI, or an `http(s)` URL. */\n value: string;\n /** Called with the new source (empty string clears the slot). */\n onChange: (value: string) => void;\n};\n\n/** A labelled multi-line field for a brand logo source. */\nexport const LogoField = ({ id, label, value, onChange }: Props) => (\n <div className=\"tw:flex tw:flex-col tw:gap-1\">\n <Label htmlFor={id} className=\"tw:text-xs tw:font-normal tw:text-foreground\">\n {label}\n </Label>\n <Textarea\n id={id}\n value={value}\n onValueChange={onChange}\n maxRows={4}\n placeholder=\"<svg…>, a data: URI, or an https:// URL\"\n className=\"tw:font-mono tw:text-xs\"\n />\n </div>\n);\n","import { Label } from '../../components/Label';\nimport { TextInput } from '../TextInput';\n\ntype Props = {\n id: string;\n label: string;\n /** Current CSS value (empty clears the token, falling back to the stylesheet default). */\n value: string;\n /** Called with the new CSS value on change. */\n onChange: (value: string) => void;\n /** The inherited default, shown as placeholder when the field is empty. */\n placeholder?: string;\n};\n\n/** A labelled single-line field for a free-form CSS-value token (shadow, motion, gradient). */\nexport const TextField = ({ id, label, value, onChange, placeholder }: Props) => (\n <div className=\"tw:flex tw:flex-col tw:gap-1\">\n <Label htmlFor={id} className=\"tw:text-xs tw:font-normal tw:text-foreground\">\n {label}\n </Label>\n <TextInput\n id={id}\n sizing=\"small\"\n value={value}\n onValueChange={onChange}\n placeholder={placeholder}\n className=\"tw:font-mono tw:text-xs\"\n />\n </div>\n);\n","import { useId, useMemo } from 'react';\nimport DOMPurify from 'dompurify';\n\nimport type { Brand } from '@keboola/brand-registry';\nimport { keboola } from '@keboola/brand-registry';\n\nimport { Badge } from '../../components/Badge';\nimport { Button } from '../../components/Button';\nimport { Collapsible } from '../../components/Collapsible';\nimport { Label } from '../../components/Label';\nimport { Select } from '../../components/Select';\nimport { Slider } from '../../components/Slider';\nimport { ToggleGroup } from '../../components/ToggleGroup';\n\nimport { ColorField } from './ColorField';\nimport { contrastRatio, wcagLevel } from './contrast';\nimport { ControlSection } from './ControlSection';\nimport { LogoField } from './LogoField';\nimport { TextField } from './TextField';\n\ntype Colors = NonNullable<Brand['theme']['colors']>;\n/** Colour tokens written as full CSS values rather than `R G B` channels. */\nexport type StateColorSlot = keyof Pick<\n Colors,\n 'hover' | 'hoverForeground' | 'pressed' | 'selected' | 'selectedForeground' | 'scrim'\n>;\nexport type ColorSlot = keyof Omit<Colors, 'sidebar' | 'chart' | StateColorSlot>;\ntype SidebarColors = NonNullable<Colors['sidebar']>;\n/** Sidebar tokens written as full CSS values rather than `R G B` channels. */\nexport type SidebarStateSlot = keyof Pick<\n SidebarColors,\n 'sidebarHover' | 'sidebarHoverForeground' | 'sidebarSelected' | 'sidebarSelectedForeground'\n>;\nexport type SidebarSlot = keyof Omit<SidebarColors, SidebarStateSlot>;\nexport type ChartSlot = keyof NonNullable<NonNullable<Brand['theme']['colors']>['chart']>;\nexport type RadiusSize = keyof NonNullable<Brand['theme']['radii']>;\n\ntype Typography = NonNullable<Brand['theme']['typography']>;\ntype FontFace = 'fontFamily' | 'fontDisplay' | 'fontMono';\ntype FontWeightSlot = keyof NonNullable<Typography['weight']>;\ntype ShadowSlot = keyof NonNullable<Brand['theme']['shadows']>;\ntype SpacingSlot = keyof NonNullable<Brand['theme']['spacing']>;\ntype MotionSlot = keyof NonNullable<Brand['theme']['motion']>;\n\nexport const DEFAULT_FALLBACK_FONT = \"'Inter', system-ui, sans-serif\";\n\nexport const DEFAULT_FONT_OPTIONS: { value: string; label: string }[] = [\n { value: DEFAULT_FALLBACK_FONT, label: 'Inter (default)' },\n { value: \"'Space Grotesk', system-ui, sans-serif\", label: 'Space Grotesk' },\n { value: \"'Poppins', system-ui, sans-serif\", label: 'Poppins' },\n { value: \"'Manrope', system-ui, sans-serif\", label: 'Manrope' },\n { value: \"'Quicksand', system-ui, sans-serif\", label: 'Quicksand' },\n { value: \"'Baloo 2', system-ui, sans-serif\", label: 'Baloo 2' },\n { value: \"'Fraunces', Georgia, serif\", label: 'Fraunces (serif)' },\n { value: \"Georgia, 'Times New Roman', serif\", label: 'Georgia (serif)' },\n { value: \"'JetBrains Mono', ui-monospace, monospace\", label: 'JetBrains Mono' },\n { value: 'system-ui, sans-serif', label: 'System UI' },\n];\n\n// Label maps double as a compile-time exhaustiveness guard: typed as\n// `Record<ColorSlot, string>` / `Record<SidebarSlot, string>`, a new token added\n// to the upstream `Brand` schema fails to compile here until it gets a control,\n// so it can't silently drift out of the editor. Insertion order is display order.\nconst COLOR_LABELS: Record<ColorSlot, string> = {\n primary: 'Primary',\n primaryForeground: 'Primary foreground',\n background: 'Background',\n foreground: 'Foreground',\n card: 'Card',\n cardForeground: 'Card foreground',\n popover: 'Popover',\n popoverForeground: 'Popover foreground',\n secondary: 'Secondary',\n secondaryForeground: 'Secondary foreground',\n muted: 'Muted',\n mutedForeground: 'Muted foreground',\n accent: 'Accent',\n accentForeground: 'Accent foreground',\n border: 'Border',\n input: 'Input border',\n inputBackground: 'Input background',\n ring: 'Ring',\n ringOffset: 'Ring offset',\n destructive: 'Destructive',\n destructiveForeground: 'Destructive foreground',\n success: 'Success',\n successForeground: 'Success foreground',\n warning: 'Warning',\n warningForeground: 'Warning foreground',\n info: 'Info',\n infoForeground: 'Info foreground',\n};\n\nconst STATE_COLOR_LABELS: Record<StateColorSlot, string> = {\n hover: 'Hover',\n hoverForeground: 'Hover foreground',\n pressed: 'Pressed',\n selected: 'Selected',\n selectedForeground: 'Selected foreground',\n scrim: 'Scrim (modal backdrop)',\n};\n\n// What an unset state token resolves to, shown as the field's placeholder.\nconst STATE_COLOR_DEFAULTS: Record<StateColorSlot, string> = {\n hover: 'Follows accent (menus, table rows: their own tint)',\n hoverForeground: 'Follows accent foreground',\n pressed: 'Reserved: no component reads it yet',\n selected: 'Follows accent',\n selectedForeground: 'Follows accent foreground',\n scrim: 'rgb(0 0 0 / 0.5)',\n};\n\nconst DEFAULT_DISABLED_OPACITY = '0.5';\n\nconst SIDEBAR_LABELS: Record<SidebarSlot, string> = {\n sidebar: 'Sidebar',\n sidebarForeground: 'Foreground',\n sidebarPrimary: 'Primary',\n sidebarPrimaryForeground: 'Primary foreground',\n sidebarAccent: 'Accent',\n sidebarAccentForeground: 'Accent foreground',\n sidebarBorder: 'Border',\n sidebarRing: 'Ring',\n};\n\nconst SIDEBAR_STATE_LABELS: Record<SidebarStateSlot, string> = {\n sidebarHover: 'Hover',\n sidebarHoverForeground: 'Hover foreground',\n sidebarSelected: 'Selected (current page)',\n sidebarSelectedForeground: 'Selected foreground',\n};\n\nconst CHART_LABELS: Record<ChartSlot, string> = {\n chart1: 'Chart 1',\n chart2: 'Chart 2',\n chart3: 'Chart 3',\n chart4: 'Chart 4',\n chart5: 'Chart 5',\n};\n\nconst WEIGHT_LABELS: Record<FontWeightSlot, string> = {\n normal: 'Normal',\n medium: 'Medium',\n semibold: 'Semibold',\n bold: 'Bold',\n};\n\nconst SHADOW_LABELS: Record<ShadowSlot, string> = {\n sm: 'Small',\n md: 'Medium',\n lg: 'Large',\n lift: 'Lift (raised)',\n};\n\nconst SPACING_LABELS: Record<SpacingSlot, string> = {\n gutter: 'Gutter (between sections)',\n inset: 'Inset (in-container)',\n};\n\nconst MOTION_LABELS: Record<MotionSlot, string> = {\n duration: 'Duration',\n easing: 'Easing',\n};\n\nconst COLOR_SLOTS = Object.keys(COLOR_LABELS) as ColorSlot[];\nconst STATE_COLOR_SLOTS = Object.keys(STATE_COLOR_LABELS) as StateColorSlot[];\nconst SIDEBAR_STATE_SLOTS = Object.keys(SIDEBAR_STATE_LABELS) as SidebarStateSlot[];\nconst SIDEBAR_SLOTS = Object.keys(SIDEBAR_LABELS) as SidebarSlot[];\nconst CHART_SLOTS = Object.keys(CHART_LABELS) as ChartSlot[];\nconst WEIGHT_SLOTS = Object.keys(WEIGHT_LABELS) as FontWeightSlot[];\nconst SHADOW_SLOTS = Object.keys(SHADOW_LABELS) as ShadowSlot[];\nconst SPACING_SLOTS = Object.keys(SPACING_LABELS) as SpacingSlot[];\nconst MOTION_SLOTS = Object.keys(MOTION_LABELS) as MotionSlot[];\nconst RADIUS_SIZES: RadiusSize[] = ['sm', 'md', 'lg', 'card', 'popover', 'modal', 'sheet', 'toast'];\n\n// Foreground/background pairs whose contrast decides everyday legibility.\nconst A11Y_PAIRS: { label: string; fg: ColorSlot; bg: ColorSlot }[] = [\n { label: 'Text on background', fg: 'foreground', bg: 'background' },\n { label: 'Text on card', fg: 'cardForeground', bg: 'card' },\n { label: 'Primary button', fg: 'primaryForeground', bg: 'primary' },\n { label: 'Muted text', fg: 'mutedForeground', bg: 'muted' },\n { label: 'Accent', fg: 'accentForeground', bg: 'accent' },\n];\n\n// Fallback sidebar palette — the `keboola` brand doesn't set `colors.sidebar` /\n// `colorsDark.sidebar`, so a slot needs a value to seed from when a user starts\n// editing sidebar tokens on a brand that leaves them unset.\nconst DEFAULT_SIDEBAR: Record<'light' | 'dark', Record<SidebarSlot, string>> = {\n light: {\n sidebar: '255 255 255',\n sidebarForeground: '30 41 59',\n sidebarPrimary: '31 143 255',\n sidebarPrimaryForeground: '255 255 255',\n sidebarAccent: '219 234 254',\n sidebarAccentForeground: '30 41 59',\n sidebarBorder: '229 231 235',\n sidebarRing: '31 143 255',\n },\n dark: {\n sidebar: '14 14 18',\n sidebarForeground: '229 230 236',\n sidebarPrimary: '31 143 255',\n sidebarPrimaryForeground: '255 255 255',\n sidebarAccent: '38 38 45',\n sidebarAccentForeground: '229 230 236',\n sidebarBorder: '48 49 57',\n sidebarRing: '31 143 255',\n },\n};\n\nconst DEFAULT_RADII: NonNullable<Brand['theme']['radii']> = {\n sm: '0.25rem',\n md: '0.375rem',\n lg: '0.5rem',\n};\n\n// What an unset surface radius resolves to on its component.\nconst surfaceRadiusFallback = (\n size: RadiusSize,\n radii: NonNullable<Brand['theme']['radii']>,\n): string => {\n if (size === 'popover') return '1rem';\n if (size === 'modal') return '1.5rem';\n return radii.lg;\n};\n\n// The `@keboola/design/styles` categorical chart palette — seeds the chart\n// pickers when a brand leaves `colors.chart` / `colorsDark.chart` unset.\nconst DEFAULT_CHART: Record<'light' | 'dark', Record<ChartSlot, string>> = {\n light: {\n chart1: '31 143 255',\n chart2: '0 194 135',\n chart3: '146 92 255',\n chart4: '245 147 0',\n chart5: '237 94 223',\n },\n dark: {\n chart1: '92 173 255',\n chart2: '0 230 161',\n chart3: '173 133 255',\n chart4: '255 190 92',\n chart5: '242 140 232',\n },\n};\n\n// Chrome font-weight defaults (the Tailwind scale `@keboola/design` falls back to\n// when `typography.weight` is unset) — seed values for the weight sliders.\nconst DEFAULT_FONT_WEIGHTS: Record<FontWeightSlot, string> = {\n normal: '400',\n medium: '500',\n semibold: '600',\n bold: '700',\n};\n\n// Chrome tracking default (behind the hardcoded `tw:tracking-[1px]`).\nconst DEFAULT_LETTER_SPACING = '1px';\n\n// The monospace stack the mono-face Select falls back to when `fontMono` is unset\n// (matches the `DEFAULT_FONT_OPTIONS` JetBrains Mono entry).\nconst MONO_FALLBACK = \"'JetBrains Mono', ui-monospace, monospace\";\n\n// `@keboola/design/styles` defaults for the advanced token groups, shown as\n// placeholders so an unset field reveals the value it inherits.\nconst DEFAULT_SHADOWS: Record<ShadowSlot, string> = {\n sm: '0 1px 2px 0 rgb(0 0 0 / 0.05)',\n md: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',\n lg: '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',\n lift: '0 10px 30px -12px rgb(0 0 0 / 0.28), 0 2px 6px rgb(0 0 0 / 0.06)',\n};\n\nconst DEFAULT_SPACING: Record<SpacingSlot, string> = {\n gutter: '1.5rem',\n inset: '1.5rem',\n};\n\nconst DEFAULT_MOTION: Record<MotionSlot, string> = {\n duration: '200ms',\n easing: 'cubic-bezier(0.2, 0.7, 0.2, 1)',\n};\n\nconst DEFAULT_GRADIENT =\n 'linear-gradient(135deg, rgb(var(--primary)), rgb(var(--accent, var(--primary))))';\n\n// Leading numeric value of a token string (font-weight \"500\").\nconst numOf = (value: string, fallback: number): number => {\n const n = Number.parseFloat(value);\n return Number.isFinite(n) ? n : fallback;\n};\n\n// Letter-spacing may be px or em. Drive the slider in px (treating `em` as ×16,\n// like the radius slider treats `rem`) and write back in the value's original\n// unit, so an `em`-authored brand (e.g. `0.02em`) stays `em` instead of being\n// silently rewritten to `px`.\nconst letterSpacingToPx = (value: string): number => {\n const n = Number.parseFloat(value);\n if (!Number.isFinite(n)) return 0;\n return value.trim().endsWith('em') ? n * 16 : n;\n};\n\nconst pxToLetterSpacing = (px: number, currentValue: string): string =>\n currentValue.trim().endsWith('em') ? `${Number((px / 16).toFixed(3))}em` : `${px}px`;\n\n// The Brand schema allows any CSS length for radii (`rem`, `px`, unitless). Convert to px for\n// the slider treating `rem` as ×16 and everything else as already-px, and write back preserving\n// the slot's original unit so `8px` stays `8px`, `0.5rem` stays `0.5rem`, and a unitless `8` stays `8`.\nconst lengthToPx = (value: string): number => {\n const n = Number.parseFloat(value);\n if (!Number.isFinite(n)) return 0;\n return Math.round(value.trim().endsWith('rem') ? n * 16 : n);\n};\n\nconst pxToLength = (px: number, currentValue: string): string => {\n const trimmed = currentValue.trim();\n if (trimmed.endsWith('rem')) return `${px / 16}rem`;\n // Preserve a unitless token (the schema allows it) rather than forcing `px` onto it.\n if (/^-?\\d*\\.?\\d+$/.test(trimmed)) return `${px}`;\n return `${px}px`;\n};\n\nexport type BrandEditorProps = {\n value: Brand;\n onChange: (next: Brand) => void;\n /** Palette being edited. Controlled. Default 'light'. */\n colorScheme?: 'light' | 'dark';\n /** If provided, the editor shows a light/dark toggle that calls this. If omitted, no toggle. */\n onColorSchemeChange?: (scheme: 'light' | 'dark') => void;\n /** Font choices for the typography Select. Defaults to DEFAULT_FONT_OPTIONS. */\n fontOptions?: { value: string; label: string }[];\n};\n\n// Match `BrandLogo`'s sniffing: any string starting with `<` is inline markup (covers\n// `<?xml …?><svg>` / `<!doctype …>` prefixes); only `data:` / `http(s)://` are image URLs.\nconst isSvgMarkup = (source: string) => source.trimStart().startsWith('<');\nconst isImageSource = (source: string) => /^(data:|https?:\\/\\/)/.test(source.trim());\n\n/** Renders a logo source (SVG markup, `data:` URI, or `http(s)` URL) from the raw string. */\nconst LogoPreviewImage = ({ source, className }: { source: string; className?: string }) => {\n const safeSvg = useMemo(\n () =>\n isSvgMarkup(source)\n ? DOMPurify.sanitize(source, { USE_PROFILES: { svg: true, svgFilters: true } })\n : null,\n [source],\n );\n\n if (safeSvg !== null) {\n // Decorative preview of what the caller is editing — the textarea holds the real value, so\n // hide the injected graphic from assistive tech (parity with the `alt=\"\"` image branch below).\n return <span aria-hidden className={className} dangerouslySetInnerHTML={{ __html: safeSvg }} />;\n }\n if (isImageSource(source)) {\n return <img src={source} alt=\"\" className={className} />;\n }\n return null;\n};\n\n/**\n * Controlled brand-editing block — colors (light/dark), sidebar colors, WCAG contrast readout,\n * corner radius, typography, and logo. Reads/writes a `Brand` (`@keboola/brand-registry`) via\n * `value` / `onChange`; owns no state of its own, so the caller decides where the brand and the\n * active color scheme live (Kai build-mode preview, theme-generator, …).\n */\nexport const BrandEditor = ({\n value,\n onChange,\n colorScheme = 'light',\n onColorSchemeChange,\n fontOptions = DEFAULT_FONT_OPTIONS,\n}: BrandEditorProps) => {\n // Prefix every control id so multiple BrandEditors on one page don't collide (broken label↔control).\n const baseId = useId();\n const { theme } = value;\n const coreColors = colorScheme === 'light' ? theme.colors : theme.colorsDark;\n const sidebarColors = colorScheme === 'light' ? theme.colors?.sidebar : theme.colorsDark?.sidebar;\n const chartColors = colorScheme === 'light' ? theme.colors?.chart : theme.colorsDark?.chart;\n // Fall back to the keboola default of the SAME scheme — never light values while editing dark.\n const defaultColors = colorScheme === 'light' ? keboola.theme.colors : keboola.theme.colorsDark;\n const radii = theme.radii ?? DEFAULT_RADII;\n const typography = theme.typography;\n\n const setColor = (slot: ColorSlot, channels: string) => {\n if (colorScheme === 'light') {\n onChange({ ...value, theme: { ...theme, colors: { ...theme.colors, [slot]: channels } } });\n return;\n }\n // Keep colorsDark sparse (mirrors the light path) so an unset dark palette inherits the\n // design-system defaults instead of baking in a full keboola palette on the first edit.\n onChange({\n ...value,\n theme: { ...theme, colorsDark: { ...theme.colorsDark, [slot]: channels } },\n });\n };\n\n const setStateColor = (slot: StateColorSlot, color: string) => {\n const next = color.trim() || undefined;\n if (colorScheme === 'light') {\n onChange({ ...value, theme: { ...theme, colors: { ...theme.colors, [slot]: next } } });\n return;\n }\n onChange({ ...value, theme: { ...theme, colorsDark: { ...theme.colorsDark, [slot]: next } } });\n };\n\n const setDisabledOpacity = (disabled: string) =>\n onChange({ ...value, theme: { ...theme, opacity: { ...theme.opacity, disabled } } });\n\n const setSidebarColor = (slot: SidebarSlot, channels: string) => {\n if (colorScheme === 'light') {\n const base = theme.colors?.sidebar ?? DEFAULT_SIDEBAR.light;\n onChange({\n ...value,\n theme: { ...theme, colors: { ...theme.colors, sidebar: { ...base, [slot]: channels } } },\n });\n return;\n }\n // Spread the existing (possibly-empty) colorsDark so setting a sidebar token doesn't seed the\n // whole core dark palette; only the sidebar sub-object is seeded, since it has no default to inherit.\n const sidebarBase = theme.colorsDark?.sidebar ?? DEFAULT_SIDEBAR.dark;\n onChange({\n ...value,\n theme: {\n ...theme,\n colorsDark: { ...theme.colorsDark, sidebar: { ...sidebarBase, [slot]: channels } },\n },\n });\n };\n\n const setSidebarState = (slot: SidebarStateSlot, color: string) => {\n const next = color.trim() || undefined;\n const palette = colorScheme === 'light' ? 'colors' : 'colorsDark';\n const sidebar = { ...(theme[palette]?.sidebar ?? DEFAULT_SIDEBAR[colorScheme]), [slot]: next };\n onChange({ ...value, theme: { ...theme, [palette]: { ...theme[palette], sidebar } } });\n };\n\n const setChart = (slot: ChartSlot, channels: string) => {\n const base = chartColors ?? DEFAULT_CHART[colorScheme];\n const chart = { ...base, [slot]: channels };\n if (colorScheme === 'light') {\n onChange({ ...value, theme: { ...theme, colors: { ...theme.colors, chart } } });\n return;\n }\n onChange({ ...value, theme: { ...theme, colorsDark: { ...theme.colorsDark, chart } } });\n };\n\n const setRadius = (size: RadiusSize, radius: string) =>\n onChange({\n ...value,\n theme: { ...theme, radii: { ...(theme.radii ?? DEFAULT_RADII), [size]: radius } },\n });\n\n // Merge a typography patch, keeping sibling faces / weight / letterSpacing.\n const patchTypography = (patch: Partial<Typography>) =>\n onChange({ ...value, theme: { ...theme, typography: { ...theme.typography, ...patch } } });\n\n const setFontFace = (face: FontFace, font: string) =>\n patchTypography({ [face]: font.trim() || undefined });\n\n const setFontWeight = (slot: FontWeightSlot, weight: string) =>\n patchTypography({ weight: { ...theme.typography?.weight, [slot]: weight || undefined } });\n\n const setLetterSpacing = (chrome: string) =>\n patchTypography({ letterSpacing: { chrome: chrome.trim() || undefined } });\n\n const setShadow = (slot: ShadowSlot, shadow: string) =>\n onChange({\n ...value,\n theme: { ...theme, shadows: { ...theme.shadows, [slot]: shadow.trim() || undefined } },\n });\n\n const setSpacing = (slot: SpacingSlot, length: string) =>\n onChange({\n ...value,\n theme: { ...theme, spacing: { ...theme.spacing, [slot]: length.trim() || undefined } },\n });\n\n const setMotion = (slot: MotionSlot, token: string) =>\n onChange({\n ...value,\n theme: { ...theme, motion: { ...theme.motion, [slot]: token.trim() || undefined } },\n });\n\n const setGradient = (gradient: string) =>\n onChange({\n ...value,\n theme: { ...theme, gradient: { brand: gradient.trim() || undefined } },\n });\n\n const setLogo = (slot: keyof NonNullable<Brand['logo']>, source: string) => {\n const trimmed = source.trim();\n const nextLogo: NonNullable<Brand['logo']> = { ...value.logo };\n if (trimmed) nextLogo[slot] = trimmed;\n else delete nextLogo[slot];\n const { logo: _drop, ...rest } = value;\n onChange(Object.keys(nextLogo).length > 0 ? { ...value, logo: nextLogo } : rest);\n };\n\n return (\n <div className=\"tw:flex tw:flex-col\">\n <ControlSection title=\"Colors\">\n {onColorSchemeChange ? (\n <ToggleGroup\n type=\"single\"\n value={colorScheme}\n onValueChange={(next) => {\n if (next === 'light' || next === 'dark') onColorSchemeChange(next);\n }}\n aria-label=\"Color scheme\"\n className=\"tw:w-full\"\n >\n <ToggleGroup.Item value=\"light\" className=\"tw:flex-1\">\n Light\n </ToggleGroup.Item>\n <ToggleGroup.Item value=\"dark\" className=\"tw:flex-1\">\n Dark\n </ToggleGroup.Item>\n </ToggleGroup>\n ) : null}\n <div className=\"tw:flex tw:flex-col tw:gap-2\">\n {COLOR_SLOTS.map((slot) => (\n <ColorField\n key={slot}\n id={`${baseId}color-${colorScheme}-${slot}`}\n label={COLOR_LABELS[slot]}\n channels={coreColors?.[slot] ?? defaultColors?.[slot] ?? '0 0 0'}\n onChange={(channels) => setColor(slot, channels)}\n />\n ))}\n </div>\n </ControlSection>\n\n <ControlSection title=\"Accessibility\">\n <p className=\"tw:m-0 tw:text-xs tw:text-muted-foreground\">\n WCAG contrast for the {colorScheme} palette (AA needs 4.5:1).\n </p>\n <div className=\"tw:flex tw:flex-col tw:gap-1.5\">\n {A11Y_PAIRS.map((pair) => {\n const fg = coreColors?.[pair.fg] ?? defaultColors?.[pair.fg] ?? '0 0 0';\n const bg = coreColors?.[pair.bg] ?? defaultColors?.[pair.bg] ?? '255 255 255';\n const ratio = contrastRatio(fg, bg);\n const level = wcagLevel(ratio);\n return (\n <div key={pair.label} className=\"tw:flex tw:items-center tw:justify-between tw:gap-2\">\n <span className=\"tw:text-xs tw:text-foreground\">{pair.label}</span>\n <span className=\"tw:flex tw:items-center tw:gap-1.5\">\n <span className=\"tw:text-xs tw:tabular-nums tw:text-muted-foreground\">\n {ratio.toFixed(1)}:1\n </span>\n <Badge color={level === 'fail' ? 'red' : 'green'}>\n {level === 'fail' ? 'Fail' : level}\n </Badge>\n </span>\n </div>\n );\n })}\n </div>\n </ControlSection>\n\n <ControlSection title=\"Interaction states\">\n <p className=\"tw:m-0 tw:text-xs tw:text-muted-foreground\">\n Hover, pressed, selected and backdrop colours for the {colorScheme} palette, as any CSS\n colour so a wash can be translucent. Empty follows the default.\n </p>\n <div className=\"tw:flex tw:flex-col tw:gap-2\">\n {STATE_COLOR_SLOTS.map((slot) => (\n <TextField\n key={slot}\n id={`${baseId}state-${colorScheme}-${slot}`}\n label={STATE_COLOR_LABELS[slot]}\n value={coreColors?.[slot] ?? ''}\n placeholder={STATE_COLOR_DEFAULTS[slot]}\n onChange={(next) => setStateColor(slot, next)}\n />\n ))}\n </div>\n <div className=\"tw:flex tw:flex-col tw:gap-1\">\n <div className=\"tw:flex tw:items-center tw:justify-between\">\n <Label className=\"tw:text-xs tw:font-normal tw:text-foreground\">Disabled opacity</Label>\n <span className=\"tw:text-xs tw:tabular-nums tw:text-muted-foreground\">\n {theme.opacity?.disabled ?? DEFAULT_DISABLED_OPACITY}\n </span>\n </div>\n <Slider\n aria-label=\"Disabled opacity\"\n min={0.2}\n max={0.8}\n step={0.05}\n value={[Number(theme.opacity?.disabled ?? DEFAULT_DISABLED_OPACITY)]}\n onValueChange={(values) => setDisabledOpacity((values[0] ?? 0.5).toFixed(2))}\n />\n </div>\n </ControlSection>\n\n <ControlSection title=\"Sidebar colors\">\n <Collapsible className=\"tw:flex tw:flex-col tw:gap-2\">\n <Collapsible.Trigger asChild>\n <Button variant=\"outline\" size=\"small\" className=\"tw:w-full\">\n Toggle sidebar tokens ({colorScheme})\n </Button>\n </Collapsible.Trigger>\n <Collapsible.Content className=\"tw:flex tw:flex-col tw:gap-2\">\n {SIDEBAR_SLOTS.map((slot) => (\n <ColorField\n key={slot}\n id={`${baseId}sidebar-${colorScheme}-${slot}`}\n label={SIDEBAR_LABELS[slot]}\n channels={sidebarColors?.[slot] ?? DEFAULT_SIDEBAR[colorScheme][slot]}\n onChange={(channels) => setSidebarColor(slot, channels)}\n />\n ))}\n {SIDEBAR_STATE_SLOTS.map((slot) => (\n <TextField\n key={slot}\n id={`${baseId}sidebar-state-${colorScheme}-${slot}`}\n label={`Sidebar ${SIDEBAR_STATE_LABELS[slot].toLowerCase()}`}\n value={sidebarColors?.[slot] ?? ''}\n placeholder=\"Follows sidebar accent\"\n onChange={(next) => setSidebarState(slot, next)}\n />\n ))}\n </Collapsible.Content>\n </Collapsible>\n </ControlSection>\n\n <ControlSection title=\"Chart palette\">\n <p className=\"tw:m-0 tw:text-xs tw:text-muted-foreground\">\n Categorical series colours for the {colorScheme} palette (`--chart-1…5`).\n </p>\n <div className=\"tw:flex tw:flex-col tw:gap-2\">\n {CHART_SLOTS.map((slot) => (\n <ColorField\n key={slot}\n id={`${baseId}chart-${colorScheme}-${slot}`}\n label={CHART_LABELS[slot]}\n channels={chartColors?.[slot] ?? DEFAULT_CHART[colorScheme][slot]}\n onChange={(channels) => setChart(slot, channels)}\n />\n ))}\n </div>\n </ControlSection>\n\n <ControlSection title=\"Radius\">\n {RADIUS_SIZES.map((size) => {\n const current = radii[size] ?? surfaceRadiusFallback(size, radii);\n const px = lengthToPx(current);\n return (\n <div key={size} className=\"tw:flex tw:flex-col tw:gap-1\">\n <div className=\"tw:flex tw:items-center tw:justify-between\">\n <Label className=\"tw:text-xs tw:font-normal tw:uppercase tw:text-foreground\">\n {size}\n </Label>\n <span className=\"tw:text-xs tw:tabular-nums tw:text-muted-foreground\">\n {current}\n </span>\n </div>\n <Slider\n min={0}\n max={32}\n step={1}\n value={[px]}\n onValueChange={(values) => setRadius(size, pxToLength(values[0] ?? 0, current))}\n />\n </div>\n );\n })}\n </ControlSection>\n\n <ControlSection title=\"Typography\">\n <div className=\"tw:flex tw:flex-col tw:gap-1\">\n <Label\n htmlFor={`${baseId}font-family`}\n className=\"tw:text-xs tw:font-normal tw:text-foreground\"\n >\n Font family\n </Label>\n <Select\n id={`${baseId}font-family`}\n value={typography?.fontFamily ?? DEFAULT_FALLBACK_FONT}\n onValueChange={(font) => setFontFace('fontFamily', font)}\n items={fontOptions}\n />\n </div>\n <div className=\"tw:flex tw:flex-col tw:gap-1\">\n <Label\n htmlFor={`${baseId}font-display`}\n className=\"tw:text-xs tw:font-normal tw:text-foreground\"\n >\n Display font (headings)\n </Label>\n <Select\n id={`${baseId}font-display`}\n value={typography?.fontDisplay ?? typography?.fontFamily ?? DEFAULT_FALLBACK_FONT}\n onValueChange={(font) => setFontFace('fontDisplay', font)}\n items={fontOptions}\n />\n </div>\n <div className=\"tw:flex tw:flex-col tw:gap-1\">\n <Label\n htmlFor={`${baseId}font-mono`}\n className=\"tw:text-xs tw:font-normal tw:text-foreground\"\n >\n Monospace font\n </Label>\n <Select\n id={`${baseId}font-mono`}\n value={typography?.fontMono ?? MONO_FALLBACK}\n onValueChange={(font) => setFontFace('fontMono', font)}\n items={fontOptions}\n />\n </div>\n\n <span className=\"tw:text-xs tw:text-muted-foreground\">Chrome font weights</span>\n {WEIGHT_SLOTS.map((slot) => {\n const current = typography?.weight?.[slot] ?? DEFAULT_FONT_WEIGHTS[slot];\n return (\n <div key={slot} className=\"tw:flex tw:flex-col tw:gap-1\">\n <div className=\"tw:flex tw:items-center tw:justify-between\">\n <Label className=\"tw:text-xs tw:font-normal tw:text-foreground\">\n {WEIGHT_LABELS[slot]}\n </Label>\n <span className=\"tw:text-xs tw:tabular-nums tw:text-muted-foreground\">\n {current}\n </span>\n </div>\n <Slider\n min={100}\n max={900}\n step={25}\n value={[numOf(current, 400)]}\n onValueChange={(values) => setFontWeight(slot, String(values[0] ?? 400))}\n />\n </div>\n );\n })}\n\n <div className=\"tw:flex tw:flex-col tw:gap-1\">\n <div className=\"tw:flex tw:items-center tw:justify-between\">\n <Label className=\"tw:text-xs tw:font-normal tw:text-foreground\">\n Chrome letter spacing\n </Label>\n <span className=\"tw:text-xs tw:tabular-nums tw:text-muted-foreground\">\n {typography?.letterSpacing?.chrome ?? DEFAULT_LETTER_SPACING}\n </span>\n </div>\n <Slider\n min={-2}\n max={4}\n step={0.25}\n value={[letterSpacingToPx(typography?.letterSpacing?.chrome ?? DEFAULT_LETTER_SPACING)]}\n onValueChange={(values) =>\n setLetterSpacing(\n pxToLetterSpacing(\n values[0] ?? 0,\n typography?.letterSpacing?.chrome ?? DEFAULT_LETTER_SPACING,\n ),\n )\n }\n />\n </div>\n </ControlSection>\n\n <ControlSection title=\"Elevation\">\n <p className=\"tw:m-0 tw:text-xs tw:text-muted-foreground\">\n Box-shadow scale (`--shadow-*`), shared across light & dark. Empty inherits the default.\n </p>\n {SHADOW_SLOTS.map((slot) => (\n <TextField\n key={slot}\n id={`${baseId}shadow-${slot}`}\n label={SHADOW_LABELS[slot]}\n value={theme.shadows?.[slot] ?? ''}\n placeholder={DEFAULT_SHADOWS[slot]}\n onChange={(next) => setShadow(slot, next)}\n />\n ))}\n </ControlSection>\n\n <ControlSection title=\"Density\">\n <p className=\"tw:m-0 tw:text-xs tw:text-muted-foreground\">\n Semantic spacing (`--space-*`), as CSS lengths.\n </p>\n {SPACING_SLOTS.map((slot) => (\n <TextField\n key={slot}\n id={`${baseId}spacing-${slot}`}\n label={SPACING_LABELS[slot]}\n value={theme.spacing?.[slot] ?? ''}\n placeholder={DEFAULT_SPACING[slot]}\n onChange={(next) => setSpacing(slot, next)}\n />\n ))}\n </ControlSection>\n\n <ControlSection title=\"Motion\">\n <p className=\"tw:m-0 tw:text-xs tw:text-muted-foreground\">\n Base transition `duration` + `easing` (`--motion-*`).\n </p>\n {MOTION_SLOTS.map((slot) => (\n <TextField\n key={slot}\n id={`${baseId}motion-${slot}`}\n label={MOTION_LABELS[slot]}\n value={theme.motion?.[slot] ?? ''}\n placeholder={DEFAULT_MOTION[slot]}\n onChange={(next) => setMotion(slot, next)}\n />\n ))}\n </ControlSection>\n\n <ControlSection title=\"Gradient\">\n <TextField\n id={`${baseId}gradient-brand`}\n label=\"Brand gradient\"\n value={theme.gradient?.brand ?? ''}\n placeholder={DEFAULT_GRADIENT}\n onChange={setGradient}\n />\n </ControlSection>\n\n <ControlSection title=\"Logo\">\n <LogoField\n id={`${baseId}logo-mark`}\n label=\"Mark (icon)\"\n value={value.logo?.mark ?? ''}\n onChange={(source) => setLogo('mark', source)}\n />\n <LogoField\n id={`${baseId}logo-wordmark`}\n label=\"Wordmark (full)\"\n value={value.logo?.wordmark ?? ''}\n onChange={(source) => setLogo('wordmark', source)}\n />\n <Collapsible className=\"tw:flex tw:flex-col tw:gap-2\">\n <Collapsible.Trigger asChild>\n <Button variant=\"outline\" size=\"small\" className=\"tw:w-full\">\n Toggle dark-mode logos\n </Button>\n </Collapsible.Trigger>\n <Collapsible.Content className=\"tw:flex tw:flex-col tw:gap-2\">\n <LogoField\n id={`${baseId}logo-mark-dark`}\n label=\"Mark (dark)\"\n value={value.logo?.markDark ?? ''}\n onChange={(source) => setLogo('markDark', source)}\n />\n <LogoField\n id={`${baseId}logo-wordmark-dark`}\n label=\"Wordmark (dark)\"\n value={value.logo?.wordmarkDark ?? ''}\n onChange={(source) => setLogo('wordmarkDark', source)}\n />\n </Collapsible.Content>\n </Collapsible>\n <div className=\"tw:flex tw:flex-col tw:gap-1\">\n <span className=\"tw:text-xs tw:text-muted-foreground\">Preview</span>\n <div className=\"tw:flex tw:min-h-12 tw:items-center tw:gap-4 tw:rounded-md tw:border tw:border-border tw:bg-background tw:p-3\">\n {value.logo?.mark || value.logo?.wordmark ? (\n <>\n {value.logo.mark ? (\n <LogoPreviewImage source={value.logo.mark} className=\"tw:h-8\" />\n ) : null}\n {value.logo.wordmark ? (\n <LogoPreviewImage source={value.logo.wordmark} className=\"tw:h-8\" />\n ) : null}\n </>\n ) : (\n <span className=\"tw:text-xs tw:text-muted-foreground\">No logo set</span>\n )}\n </div>\n </div>\n </ControlSection>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AAIA,MAAa,iBAAiB,QAAwB;CACpD,IAAI,IAAI,IAAI,KAAK,CAAC,CAAC,QAAQ,MAAM,EAAE;CAGnC,IAAI,EAAE,WAAW,KAAK,EAAE,WAAW,GACjC,IAAI,EACD,MAAM,GAAG,CAAC,CAAC,CACX,MAAM,EAAE,CAAC,CACT,KAAK,MAAM,IAAI,CAAC,CAAC,CACjB,KAAK,EAAE;MACL,IAAI,EAAE,WAAW,GAC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AQ,YAAY,MAAM;OACjD,CAAA,GACD,oBAAC,WAAD;QACE,IAAI,GAAG,OAAO;QACd,OAAM;QACN,OAAO,MAAM,MAAM,gBAAgB;QACnC,WAAW,WAAW,QAAQ,gBAAgB,MAAM;OACrD,CAAA,CACkB;MACV,CAAA,CAAA;;KACb,qBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,oBAAC,QAAD;OAAM,WAAU;OAAsC,UAAA;MAAa,CAAA,GACnE,oBAAC,OAAD;OAAK,WAAU;OACZ,UAAA,MAAM,MAAM,QAAQ,MAAM,MAAM,WAC/B,qBAAA,YAAA,EAAA,UAAA,CACG,MAAM,KAAK,OACV,oBAAC,kBAAD;QAAkB,QAAQ,MAAM,KAAK;QAAM,WAAU;OAAU,CAAA,IAC7D,MACH,MAAM,KAAK,WACV,oBAAC,kBAAD;QAAkB,QAAQ,MAAM,KAAK;QAAU,WAAU;OAAU,CAAA,IACjE,IACJ,EAAA,CAAA,IAEF,oBAAC,QAAD;QAAM,WAAU;QAAsC,UAAA;OAAiB,CAAA;MAEtE,CAAA,CACF;;IACS;;EACb;;AAET"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button-D2JqBAq7.js","names":[],"sources":["../src/components/Button/motion.ts","../src/components/Button/ButtonLabel.tsx","../src/components/Button/styles.ts","../src/components/Button/Button.tsx","../src/components/Button/ButtonInline.tsx"],"sourcesContent":["const ends = (animation: Animation) =>\n Number.isFinite(animation.effect?.getComputedTiming().endTime);\n\n/** Runs `callback` once the finite `animations` have finished or been cancelled; returns a cancel. */\nexport const afterAnimations = (animations: Animation[], callback: () => void) => {\n let isCurrent = true;\n Promise.allSettled(animations.filter(ends).map((animation) => animation.finished)).then(() => {\n if (isCurrent) callback();\n });\n return () => {\n isCurrent = false;\n };\n};\n\nlet waiting = new Set<Element>();\nlet framed = new Set<Element>();\nlet isTicking = false;\n\nconst tick = () => {\n for (const node of framed) if (node.isConnected) node.setAttribute('data-button-ready', '');\n framed = waiting;\n waiting = new Set();\n isTicking = framed.size > 0;\n if (isTicking) requestAnimationFrame(tick);\n};\n\n/**\n * Sets `data-button-ready` on `node` two frames after it mounts, arming its entry animations.\n *\n * - One shared frame loop serves every Button mounting at once.\n * - Arming twice is a no-op, so a re-attached ref doesn't restart the countdown.\n */\nexport const armMotion = (node: Element) => {\n if (node.hasAttribute('data-button-ready') || waiting.has(node) || framed.has(node)) return;\n waiting.add(node);\n if (!isTicking) {\n isTicking = true;\n requestAnimationFrame(tick);\n }\n};\n","import {\n createElement,\n Fragment,\n isValidElement,\n type ReactNode,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { afterAnimations } from './motion';\n\nconst isText = (node: ReactNode): node is string | number =>\n typeof node === 'string' || typeof node === 'number';\n\n/** Milliseconds from a computed `transition-duration` such as `0.3s`. */\nconst toMs = (duration: string) => parseFloat(duration) * (duration.endsWith('ms') ? 1 : 1000);\n\n/**\n * A button's text, rolled over when it changes.\n *\n * - The new text rolls in; the old one stays absolutely positioned while it rolls out.\n * - The width animates from the old text's to the new one's, so neighbours slide instead of jumping.\n * - Motion lives in `styles.css` under `[data-slot='button-label']`.\n */\nconst ButtonLabel = ({ text }: { text: string }) => {\n const ref = useRef<HTMLSpanElement>(null);\n const exitRef = useRef<HTMLSpanElement>(null);\n const interruptedWidthRef = useRef<number | null>(null);\n const [shown, setShown] = useState(text);\n const [exiting, setExiting] = useState<string | null>(null);\n const [hasChanged, setHasChanged] = useState(false);\n if (shown !== text) {\n setShown(text);\n setExiting(shown);\n setHasChanged(true);\n }\n\n useLayoutEffect(() => {\n const node = ref.current;\n // An interrupted animation's on-screen width, else the outgoing text's, still in the DOM.\n const from = interruptedWidthRef.current ?? exitRef.current?.offsetWidth;\n interruptedWidthRef.current = null;\n if (!node || !from || !node.closest('[data-button-ready]')) return;\n\n const to = node.offsetWidth;\n if (\n Math.abs(to - from) < 0.5 ||\n window.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n )\n return;\n\n const { transitionDuration, transitionTimingFunction } = getComputedStyle(node);\n const animation = node.animate?.(\n [\n { width: `${from}px`, overflowX: 'clip', textAlign: 'start' },\n { width: `${to}px`, overflowX: 'clip', textAlign: 'start' },\n ],\n { duration: toMs(transitionDuration), easing: transitionTimingFunction },\n );\n return () => {\n if (animation?.playState === 'running') {\n interruptedWidthRef.current = node.offsetWidth;\n }\n animation?.cancel();\n };\n }, [text]);\n\n useEffect(() => {\n const node = exitRef.current;\n if (!node) return;\n return afterAnimations(node.getAnimations?.() ?? [], () => setExiting(null));\n }, [exiting]);\n\n // Bare text until the first change, so an unchanged button keeps its markup.\n if (!hasChanged) return text;\n\n return (\n <span ref={ref} data-slot=\"button-label\">\n <span key={text} data-slot=\"button-label-text\">\n {text}\n </span>\n {exiting !== null && (\n <span key={exiting} ref={exitRef} aria-hidden data-slot=\"button-label-exit\">\n {exiting}\n </span>\n )}\n </span>\n );\n};\n\n/**\n * `children` with each run of text wrapped in a `ButtonLabel`.\n *\n * - Positions are kept: a joined run leaves `null` behind, so siblings keep their identity.\n * - Whitespace-only text stays bare: as a span it would become a flex item and take a gap.\n */\nexport const withLabels = (children: ReactNode): ReactNode => {\n if (isValidElement<{ children?: ReactNode }>(children) && children.type === Fragment) {\n return withLabels(children.props.children);\n }\n const items = Array.isArray(children) ? children : [children];\n const wrapped = items.map((item: ReactNode, index) => {\n if (!isText(item)) return item;\n if (index > 0 && isText(items[index - 1])) return null;\n\n let text = '';\n for (let i = index; i < items.length && isText(items[i]); i++) text += String(items[i]);\n return text.trim() ? <ButtonLabel key={index} text={text} /> : text;\n });\n return createElement(Fragment, null, ...wrapped);\n};\n","import { cva } from 'class-variance-authority';\n\n// Opaque tints use `bg-[color-mix(in_oklab,rgb(var(--tint))_N%,rgb(var(--base)))]`, not `bg-<token>/N`.\n//\n// - `bg-<token>/N` mixes into `transparent`, showing whatever the button overlaps.\n// - Raw `--*` triples: `--color-*` exist at build time only; unresolved → `transparent`.\n// - Write the whole class literally — Tailwind scans source; assembled strings get no CSS.\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 — weight/tracking are brand tokens; only `keboola-legacy-*` brands uppercase\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 // Kai's actions: its gradient, three light pools drifting behind the label.\n kai: [\n 'tw:bg-kai',\n 'tw:animate-kai-drift',\n 'tw:motion-reduce:animate-none',\n 'tw:text-white',\n 'tw:hover:text-white',\n 'tw:focus:text-white',\n 'tw:hover:not-disabled:brightness-110',\n 'tw:focus-visible:ring-ring/50',\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 // Tokens, not the fixed neutral scale: a transparent button cannot assume a light page.\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-foreground',\n 'tw:bg-card',\n // border\n 'tw:!border-input',\n 'tw:hover:text-foreground',\n 'tw:focus:text-foreground',\n // Hover/pressed are `muted-foreground` tints: `bg-muted` is 4/255 from `bg-card` in dark.\n //\n // - Fills mix into `--card`: unchanged on a card, opaque off one.\n // - Border tints `transparent`: no `bg-clip-padding`, so it composites over the fill.\n 'tw:hover:not-disabled:!border-muted-foreground/60',\n 'tw:hover:not-disabled:bg-[color-mix(in_oklab,rgb(var(--muted-foreground))_15%,rgb(var(--card)))]',\n 'tw:active:not-disabled:bg-[color-mix(in_oklab,rgb(var(--muted-foreground))_35%,rgb(var(--card)))]',\n\n // contrasting icon hover, same as invisible\n 'tw:[&_svg]:text-muted-foreground',\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-card',\n 'tw:aria-disabled:!border-input',\n ],\n\n inline: [\n 'tw:text-foreground',\n 'tw:bg-transparent',\n 'tw:rounded-full',\n\n 'tw:[&_svg]:text-muted-foreground',\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-disabled',\n 'tw:active:opacity-60',\n\n 'tw:transition-all',\n\n // anchor support\n 'tw:!no-underline',\n 'tw:aria-disabled:cursor-not-allowed',\n 'tw:aria-disabled:opacity-disabled',\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 // Kai's actions: its gradient, three light pools drifting behind the label.\n kai: [\n 'tw:bg-kai',\n 'tw:animate-kai-drift',\n 'tw:motion-reduce:animate-none',\n 'tw:text-white',\n 'tw:hover:text-white',\n 'tw:focus:text-white',\n 'tw:hover:not-disabled:brightness-110',\n 'tw:focus-visible:ring-ring/50',\n ],\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 'tw:bg-clip-padding',\n // Semantic text color so the label/icon flips in dark mode (matches `invisible`).\n 'tw:text-foreground',\n // Hover hue comes from the brand primary, not the fixed `accent` blue.\n //\n // - Fill mixes into `--background`: `bg-clip-padding` gives a translucent fill no backing.\n // - The *chrome* border carries the state (fill is ~1.5:1); `--primary` is for `focus-visible`.\n // - Border is solid, not a tint: its contrast would depend on the call site.\n 'tw:hover:not-disabled:bg-[color-mix(in_oklab,rgb(var(--primary))_10%,rgb(var(--background)))]',\n 'tw:hover:not-disabled:!border-muted-foreground',\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:bg-clip-padding',\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 {\n type ComponentProps,\n Fragment,\n isValidElement,\n type ReactNode,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Root, Slottable } from '@radix-ui/react-slot';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { Loader2 } from '../../icons';\nimport { cn, mergeRefs } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { withLabels } from './ButtonLabel';\nimport { afterAnimations, armMotion } from './motion';\nimport { argoVariants, variants } from './styles';\n\n/** Props for `Button`; icons are composed as children. */\ntype Props = {\n /** Shows a spinner in place of the leading icon, or before the label when there is none. 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/** The children that render anything, looking through arrays and fragments. */\nconst renderedChildren = (node: ReactNode): ReactNode[] => {\n if (Array.isArray(node)) return node.flatMap(renderedChildren);\n if (isValidElement<{ children?: ReactNode }>(node) && node.type === Fragment) {\n return renderedChildren(node.props.children);\n }\n const isBlank =\n node == null || typeof node === 'boolean' || (typeof node === 'string' && !node.trim());\n return isBlank ? [] : [node];\n};\n\n/**\n * Any user-initiated action; `size=\"icon-*\"` with no children is the icon-only button.\n *\n * - Not for: inline text links (`ButtonInline`), URL navigation (`Link`), action + dropdown (`SplitButton`).\n * - Wrap in `Tooltip` when icon-only or disabled; `Popconfirm` for destructive actions.\n *\n * @see RECIPES.md#disabled-button-tooltip\n * @see RECIPES.md#confirm-dialog\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 content =\n asChild && isValidElement<{ children?: ReactNode }>(children)\n ? children.props.children\n : children;\n const rendered = renderedChildren(content);\n const leadsWithElement = isValidElement(rendered[0]);\n const elementTypes = rendered.flatMap((child) => (isValidElement(child) ? [child.type] : []));\n\n // The previous render's children, which decide how the spinner and a new icon enter.\n const [prev, setPrev] = useState({ leadsWithElement, elementTypes });\n const [spinnerEnter, setSpinnerEnter] = useState<'grow' | 'fade' | null>(\n isLoading ? 'fade' : null,\n );\n const [iconEnter, setIconEnter] = useState<'grow' | 'fade'>('fade');\n const placement = isIconOnly ? 'center' : leadsWithElement ? 'leading' : 'inline';\n\n if (isLoading && !spinnerEnter) {\n // `fade` also when the caller dropped its leading icon this render: the spinner takes that icon's place.\n setSpinnerEnter(placement === 'inline' && !prev.leadsWithElement ? 'grow' : 'fade');\n }\n const typesChanged =\n prev.elementTypes.length !== elementTypes.length ||\n prev.elementTypes.some((type, index) => type !== elementTypes[index]);\n if (typesChanged || prev.leadsWithElement !== leadsWithElement) {\n setPrev({ leadsWithElement, elementTypes });\n }\n if (typesChanged) {\n const isAdded = elementTypes.length > prev.elementTypes.length;\n setIconEnter(isAdded && !isLoading && !spinnerEnter ? 'grow' : 'fade');\n }\n\n // The spinner stays mounted through its exit transition and unmounts when that ends.\n const spinnerRef = useRef<HTMLSpanElement>(null);\n useEffect(() => {\n const node = spinnerRef.current;\n if (isLoading || !node) return;\n return afterAnimations(node.getAnimations?.() ?? [], () => setSpinnerEnter(null));\n }, [isLoading]);\n\n // A leading spinner is kept centred over the leading icon while the button resizes.\n useLayoutEffect(() => {\n const slot = spinnerRef.current;\n const button = slot?.offsetParent;\n if (!slot || !button || placement !== 'leading') return;\n const centre = () => {\n const icon = slot.nextElementSibling;\n if (!(icon instanceof SVGElement)) return;\n const [iconBox, buttonBox] = [icon.getBoundingClientRect(), button.getBoundingClientRect()];\n const scale = buttonBox.width / (button instanceof HTMLElement ? button.offsetWidth : 1) || 1;\n const x = (iconBox.left - buttonBox.left + iconBox.width / 2) / scale - button.clientLeft;\n slot.style.left = `${x - parseFloat(getComputedStyle(slot).width) / 2}px`;\n };\n centre();\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(centre);\n observer.observe(button);\n return () => observer.disconnect();\n }, [placement, spinnerEnter]);\n\n // `data-button-ready` arms the entry animations a frame after mount, so nothing animates on page load.\n const buttonRef = useRef<HTMLButtonElement>(null);\n const armRef = useCallback(\n (node: HTMLButtonElement | null) => (node ? armMotion(node) : undefined),\n [],\n );\n const mergedRef = useMemo(() => mergeRefs(ref, buttonRef, armRef), [ref, armRef]);\n\n // `grow` lasts only through the entry, so a later rotation or swap keeps the default origin.\n useEffect(() => {\n const node = buttonRef.current;\n if (iconEnter !== 'grow' || !node) return;\n const entries = [...node.querySelectorAll(':scope > svg')].flatMap(\n (icon) => icon.getAnimations?.() ?? [],\n );\n return afterAnimations(entries, () => setIconEnter('fade'));\n }, [iconEnter]);\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={mergedRef}\n disabled={disabled}\n // An explicit `aria-disabled` wins: unavailable yet focusable, unlike `disabled`.\n aria-disabled={buttonProps['aria-disabled'] ?? disabled}\n data-variant={variant}\n // Icon-only flag; `ButtonGroup space=\"block\"` stretches only non-icon children.\n data-icon-only={isIconOnly}\n data-icon-enter={iconEnter}\n type={type}\n onClick={handleClick}\n className={cn(classNames)}\n >\n {spinnerEnter && (\n // Motion lives in `styles.css` under `[data-slot='button-spinner']`.\n <span\n ref={spinnerRef}\n aria-hidden\n data-slot=\"button-spinner\"\n data-state={isLoading ? 'open' : 'closed'}\n data-placement={placement}\n data-enter={spinnerEnter}\n >\n <Loader2 className=\"tw:animate-spin\" />\n </span>\n )}\n <Slottable>{asChild ? children : withLabels(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-foreground tw:[&_svg]:text-muted-foreground'],\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":";;;;;;;;;AAAA,MAAM,QAAQ,cACZ,OAAO,SAAS,UAAU,QAAQ,kBAAkB,CAAC,CAAC,OAAO;;AAG/D,MAAa,mBAAmB,YAAyB,aAAyB;CAChF,IAAI,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,MAAiB,UAAU;EACpD,IAAI,CAAC,OAAO,IAAI,GAAG,OAAO;EAC1B,IAAI,QAAQ,KAAK,OAAO,MAAM,QAAQ,EAAE,GAAG,OAAO;EAElD,IAAI,OAAO;EACX,KAAK,IAAI,IAAI,OAAO,IAAI,MAAM,UAAU,OAAO,MAAM,EAAE,GAAG,KAAK,QAAQ,OAAO,MAAM,EAAE;EACtF,OAAO,KAAK,KAAK,IAAI,oBAAC,aAAD,EAA+B,KAAO,GAApB,KAAoB,IAAI;CACjE,CAAC;CACD,OAAO,cAAc,UAAU,MAAM,GAAG,OAAO;AACjD;;;ACxGA,MAAa,WAAW,IACtB;CACE;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CAGA;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;GAEA,KAAK;IACH;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,QAAQ;IACN;IACA;IAEA;IACA;IACA;IACA;IAGA;GACF;GAEA,WAAW;IACT;IACA;IAEA;IACA;IACA;IACA;IAGA;IACA;IACA;IAGA;GACF;GACA,SAAS;IACP;IACA;IAEA;IACA;IACA;IAKA;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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F;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":"Card-Bpc_ZlL4.js","names":[],"sources":["../src/components/Card/styles.ts","../src/components/Card/CardContent.tsx","../src/components/Card/CardDescription.tsx","../src/components/Card/CardHeader.tsx","../src/components/Card/CardTitle.tsx","../src/components/Card/Card.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\n\nexport const cardClassnames = cva(\n [\n 'tw:flex',\n 'tw:flex-col',\n // `--radius-card` when a theme sets it; unset, the control radius `--radius-lg`.\n 'tw:rounded-[var(--radius-card,var(--radius-lg,0.5rem))]',\n 'tw:bg-card',\n 'tw:text-card-foreground',\n\n // interactive — see the `interactive` variant in theme.css\n 'tw:interactive:cursor-pointer',\n 'tw:interactive:no-underline',\n 'tw:interactive:hover:no-underline',\n 'tw:interactive:hover:text-card-foreground',\n 'tw:interactive:focus:text-card-foreground',\n 'tw:interactive:motion-safe:transition-[translate,box-shadow,border-color]',\n 'tw:interactive:hover:border-input',\n 'tw:interactive:hover:shadow-md',\n 'tw:interactive:motion-safe:hover:-translate-y-0.5',\n 'tw:interactive:active:translate-y-0',\n 'tw:interactive:focus-visible:outline',\n 'tw:interactive:focus-visible:outline-1',\n 'tw:interactive:focus-visible:-outline-offset-1',\n 'tw:interactive:focus-visible:outline-ring',\n 'tw:interactive:focus-visible:ring-4',\n 'tw:interactive:focus-visible:ring-ring/30',\n ],\n {\n defaultVariants: {\n padding: 'small',\n },\n variants: {\n bordered: {\n true: 'tw:border tw:border-solid tw:border-border',\n false: 'tw:shadow-raised tw:data-[argo=true]:shadow-sm',\n },\n // `none` drops the gap too: slots own their padding, so a gap would\n // double-space a `Card.Header divider`.\n padding: {\n none: 'tw:p-0',\n small: 'tw:gap-4 tw:px-6 tw:py-4',\n medium: 'tw:gap-4 tw:p-7',\n large: 'tw:gap-4 tw:p-8',\n },\n },\n },\n);\n\nexport const cardHeaderClassnames = cva('tw:flex', {\n defaultVariants: {\n divider: false,\n layout: 'row',\n },\n variants: {\n // No `border-solid`: it would give the other sides a 3px `medium` border.\n // `min-h-16` holds one height with or without a button; keep padding under it.\n divider: {\n true: 'tw:min-h-16 tw:border-b tw:border-border tw:px-6 tw:py-2',\n false: '',\n },\n layout: {\n row: 'tw:items-center tw:justify-between tw:gap-4',\n inline: 'tw:items-center tw:gap-3',\n stack: 'tw:flex-col tw:gap-1.5',\n },\n },\n});\n\nexport const cardContentClassnames = cva('', {\n defaultVariants: {\n padded: false,\n },\n variants: {\n padded: {\n true: 'tw:px-6 tw:py-5',\n false: '',\n },\n },\n});\n\nexport const cardTitleClassnames = cn(\n 'tw:m-0',\n 'tw:leading-6',\n 'tw:font-medium',\n 'tw:text-base',\n 'tw:text-card-foreground',\n);\n\nexport const cardDescriptionClassnames = cn('tw:m-0', 'tw:text-sm', 'tw:text-muted-foreground');\n","import type { HTMLAttributes } from 'react';\n\nimport { cardContentClassnames } from './styles';\n\ntype Props = HTMLAttributes<HTMLDivElement> & {\n /** Applies the standard body padding. Use with `Card padding=\"none\"`, where the\n * root adds none — otherwise the padding is doubled. */\n padded?: boolean;\n};\n\nexport const CardContent = ({ children, className, padded = false, ...rest }: Props) => (\n // `|| undefined` so an unpadded, unstyled content slot stays attribute-free\n // rather than rendering `class=\"\"`.\n <div {...rest} className={cardContentClassnames({ className, padded }) || undefined}>\n {children}\n </div>\n);\n","import type { HTMLAttributes } from 'react';\n\nimport { cn } from '../../utils';\n\nimport { cardDescriptionClassnames } from './styles';\n\n/** Muted secondary line under `Card.Title`; pair with `Card.Header layout=\"stack\"`. */\nexport const CardDescription = ({\n children,\n className,\n ...rest\n}: HTMLAttributes<HTMLParagraphElement>) => (\n <p className={cn(cardDescriptionClassnames, className)} {...rest}>\n {children}\n </p>\n);\n","import type { HTMLAttributes } from 'react';\n\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { cardHeaderClassnames } from './styles';\n\ntype Props = HTMLAttributes<HTMLDivElement> & {\n /** Bottom rule plus own padding and a 64px min height. Full-bleed only with `Card padding=\"none\"`. */\n divider?: boolean;\n /** `row`: title left, actions right. `inline`: together, e.g. title + badge.\n * `stack`: description under the title. */\n layout?: 'row' | 'inline' | 'stack';\n};\n\nexport const CardHeader = ({\n children,\n className,\n divider = false,\n layout = 'row',\n ...rest\n}: Props) => {\n const renderArgo = useArgoDesign();\n return (\n <div\n {...rest}\n data-argo={renderArgo}\n className={cardHeaderClassnames({ className, divider, layout })}\n >\n {children}\n </div>\n );\n};\n","import type { HTMLAttributes } from 'react';\n\nimport { cn } from '../../utils';\n\nimport { cardTitleClassnames } from './styles';\n\ntype HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\ntype Props = HTMLAttributes<HTMLHeadingElement> & {\n /** Heading tag to render. Defaults to `h3`; set explicitly to avoid a heading-order skip\n * (e.g. `as=\"h2\"` when the Card sits directly under a page's `h1`). */\n as?: HeadingLevel;\n};\n\nexport const CardTitle = ({ children, className, as: Tag = 'h3', ...rest }: Props) => (\n <Tag className={cn(cardTitleClassnames, className)} {...rest}>\n {children}\n </Tag>\n);\n","import type { HTMLAttributes } from 'react';\nimport { Root } from '@radix-ui/react-slot';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { CardContent } from './CardContent';\nimport { CardDescription } from './CardDescription';\nimport { CardHeader } from './CardHeader';\nimport { CardTitle } from './CardTitle';\nimport { cardClassnames } from './styles';\n\ntype Props = HTMLAttributes<HTMLDivElement> &\n VariantProps<typeof cardClassnames> & {\n /** Render as a Radix `Slot`: the child (`<a href>`, a router `<Link>`) becomes the card.\n * The card is then one link — nest no buttons or links inside it. */\n asChild?: boolean;\n /** Hover lift, focus ring and pointer cursor. Defaults to on when the card renders an\n * `<a href>`; `false` opts that out, `true` opts any other element in. */\n interactive?: boolean;\n };\n\nexport const Card = ({\n children,\n className,\n bordered = false,\n padding = 'small',\n asChild = false,\n interactive,\n ...rest\n}: Props) => {\n const renderArgo = useArgoDesign();\n const Comp = asChild ? Root : 'div';\n return (\n <Comp\n {...rest}\n data-argo={renderArgo}\n data-interactive={interactive}\n className={cardClassnames({ className, bordered, padding })}\n >\n {children}\n </Comp>\n );\n};\n\nCard.Header = CardHeader;\nCard.Content = CardContent;\nCard.Title = CardTitle;\nCard.Description = CardDescription;\n"],"mappings":";;;;;;AAIA,MAAa,iBAAiB,IAC5B;CACE;CACA;CAEA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GACA;CACE,iBAAiB,EACf,SAAS,QACX;CACA,UAAU;EACR,UAAU;GACR,MAAM;GACN,OAAO;EACT;EAGA,SAAS;GACP,MAAM;GACN,OAAO;GACP,QAAQ;GACR,OAAO;EACT;CACF;AACF,CACF;AAEA,MAAa,uBAAuB,IAAI,WAAW;CACjD,iBAAiB;EACf,SAAS;EACT,QAAQ;CACV;CACA,UAAU;EAGR,SAAS;GACP,MAAM;GACN,OAAO;EACT;EACA,QAAQ;GACN,KAAK;GACL,QAAQ;GACR,OAAO;EACT;CACF;AACF,CAAC;AAED,MAAa,wBAAwB,IAAI,IAAI;CAC3C,iBAAiB,EACf,QAAQ,MACV;CACA,UAAU,EACR,QAAQ;EACN,MAAM;EACN,OAAO;CACT,EACF;AACF,CAAC;AAED,MAAa,sBAAsB,GACjC,UACA,gBACA,kBACA,gBACA,yBACF;AAEA,MAAa,4BAA4B,GAAG,UAAU,cAAc,0BAA0B;;;AClF9F,MAAa,eAAe,EAAE,UAAU,WAAW,SAAS,OAAO,GAAG,WAGpE,oBAAC,OAAD;CAAK,GAAI;CAAM,WAAW,sBAAsB;EAAE;EAAW;CAAO,CAAC,KAAK,KAAA;CACvE;AACE,CAAA;;;;ACRP,MAAa,mBAAmB,EAC9B,UACA,WACA,GAAG,WAEH,oBAAC,KAAD;CAAG,WAAW,GAAG,2BAA2B,SAAS;CAAG,GAAI;CACzD;AACA,CAAA;;;ACAL,MAAa,cAAc,EACzB,UACA,WACA,UAAU,OACV,SAAS,OACT,GAAG,WACQ;CACX,MAAM,aAAa,cAAc;CACjC,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,aAAW;EACX,WAAW,qBAAqB;GAAE;GAAW;GAAS;EAAO,CAAC;EAE7D;CACE,CAAA;AAET;;;ACjBA,MAAa,aAAa,EAAE,UAAU,WAAW,IAAI,MAAM,MAAM,GAAG,WAClE,oBAAC,KAAD;CAAK,WAAW,GAAG,qBAAqB,SAAS;CAAG,GAAI;CACrD;AACE,CAAA;;;ACKP,MAAa,QAAQ,EACnB,UACA,WACA,WAAW,OACX,UAAU,SACV,UAAU,OACV,aACA,GAAG,WACQ;CACX,MAAM,aAAa,cAAc;CAEjC,OACE,oBAFW,UAAU,OAAO,OAE5B;EACE,GAAI;EACJ,aAAW;EACX,oBAAkB;EAClB,WAAW,eAAe;GAAE;GAAW;GAAU;EAAQ,CAAC;EAEzD;CACG,CAAA;AAEV;AAEA,KAAK,SAAS;AACd,KAAK,UAAU;AACf,KAAK,QAAQ;AACb,KAAK,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox-uFE8XLT_.js","names":[],"sources":["../src/components/Checkbox/styles.ts","../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const rootVariants = cva(\n [\n // reset\n 'tailwindcss-preflight',\n\n // position\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n\n 'tw:peer',\n 'tw:size-4',\n 'tw:shrink-0',\n 'tw:cursor-pointer',\n\n // border\n 'tw:border',\n 'tw:border-solid',\n\n // disabled\n 'tw:disabled:opacity-disabled',\n 'tw:disabled:cursor-not-allowed',\n ],\n {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n default: [\n 'tw:rounded',\n 'tw:border-neutral-200',\n\n 'tw:data-[state=checked]:bg-primary',\n 'tw:data-[state=checked]:border-primary',\n\n 'tw:data-[state=indeterminate]:bg-white',\n 'tw:data-[state=indeterminate]:border-neutral-200',\n ],\n argo: [\n 'tw:rounded',\n 'tw:border-input',\n 'tw:transition-colors',\n\n 'tw:data-[state=checked]:bg-primary',\n 'tw:data-[state=checked]:border-primary',\n\n 'tw:data-[state=indeterminate]:bg-primary',\n 'tw:data-[state=indeterminate]:border-primary',\n\n // focus\n 'tw:focus-visible:outline-hidden',\n 'tw:focus-visible:border-primary',\n 'tw:focus-visible:ring-2',\n 'tw:focus-visible:ring-ring/50',\n ],\n },\n },\n },\n);\n\nexport const indicatorVariants = cva(['tw:group', 'tw:flex', 'tw:items-center'], {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n default: [\n 'tw:data-[state=checked]:text-primary-foreground',\n 'tw:data-[state=indeterminate]:text-neutral-200',\n ],\n argo: ['tw:text-primary-foreground'],\n },\n },\n});\n","import { useId } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\nimport type { CheckedState } from '@radix-ui/react-checkbox';\nimport { Indicator, Root } from '@radix-ui/react-checkbox';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { Check, Minus } from '../../icons';\nimport { cn } from '../../utils';\nimport { FieldBox } from '../FieldBox';\nimport type { fieldBoxVariants } from '../FieldBox/styles';\nimport { useArgoDesign } from '../ThemeProvider/context';\nimport type { Props as TooltipProps } from '../Tooltip';\nimport { Tooltip } from '../Tooltip';\n\nimport { indicatorVariants, rootVariants } from './styles';\n\ntype Props = {\n id?: string | number;\n description?: ReactNode;\n variant?: VariantProps<typeof fieldBoxVariants>['variant'];\n position?: 'start' | 'end';\n tooltip?: TooltipProps['tooltip'];\n tooltipPlacement?: TooltipProps['placement'];\n} & Omit<ComponentProps<typeof Root>, 'id'>;\n\nexport function Checkbox(\n prop: Omit<Props, 'checked' | 'onCheckedChange'> & {\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n },\n): ReactNode;\n\nexport function Checkbox(\n prop: Omit<Props, 'checked' | 'onCheckedChange'> & {\n checked?: CheckedState;\n onCheckedChange?: (checked: CheckedState) => void;\n },\n): ReactNode;\n\nexport function Checkbox({\n className,\n id: idProp,\n children,\n description,\n variant,\n position,\n tooltip,\n tooltipPlacement = 'top',\n ...rest\n}: Props) {\n const fallbackId = useId();\n const id = idProp?.toString() ?? fallbackId;\n const styleVariant = useArgoDesign() ? 'argo' : 'default';\n\n const checkboxElement = (\n <Root id={id} {...rest} className={cn(rootVariants({ variant: styleVariant, className }))}>\n <Indicator className={cn(indicatorVariants({ variant: styleVariant }))}>\n <Check className=\"tw:hidden tw:size-3 tw:stroke-[4px] tw:group-data-[state=checked]:block\" />\n <Minus className=\"tw:hidden tw:size-3 tw:stroke-[4px] tw:group-data-[state=indeterminate]:block\" />\n </Indicator>\n </Root>\n );\n\n const rendered = !children ? (\n checkboxElement\n ) : (\n <FieldBox htmlFor={id} variant={variant} position={position} control={checkboxElement}>\n <FieldBox.Title>{children}</FieldBox.Title>\n {description && <FieldBox.Description>{description}</FieldBox.Description>}\n </FieldBox>\n );\n\n if (!tooltip) return rendered;\n\n // `asChild` only onto the labelled FieldBox: on the bare Radix `Root` the tooltip's\n // `data-state` overwrites the checkbox's and it stops toggling.\n return (\n <Tooltip tooltip={tooltip} placement={tooltipPlacement} triggerAsChild={!!children}>\n {rendered}\n </Tooltip>\n );\n}\n"],"mappings":";;;;;;;;;;AAEA,MAAa,eAAe,IAC1B;CAEE;CAGA;CACA;CACA;CAEA;CACA;CACA;CACA;CAGA;CACA;CAGA;CACA;AACF,GACA;CACE,iBAAiB,EACf,SAAS,UACX;CACA,UAAU,EACR,SAAS;EACP,SAAS;GAC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