@keboola/design 13.1.3 → 14.0.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 (347) hide show
  1. package/AGENTS.md +68 -6
  2. package/CHANGELOG.md +196 -0
  3. package/COMPONENT-API.md +60 -50
  4. package/dist/{AIKit-BVCWP9Ks.js → AIKit-BRSZ3nY7.js} +2227 -313
  5. package/dist/AIKit-BRSZ3nY7.js.map +1 -0
  6. package/dist/{Alert-UI-CIs-1.js → Alert-CZ0dDsuk.js} +7 -7
  7. package/dist/{Alert-UI-CIs-1.js.map → Alert-CZ0dDsuk.js.map} +1 -1
  8. package/dist/{AlertModal-mbSnuuka.js → AlertModal-BDle9ZVQ.js} +6 -6
  9. package/dist/AlertModal-BDle9ZVQ.js.map +1 -0
  10. package/dist/{AppShell-WSQabK8r.js → AppShell-B03fj1j7.js} +2 -2
  11. package/dist/{AppShell-WSQabK8r.js.map → AppShell-B03fj1j7.js.map} +1 -1
  12. package/dist/{AutoSaveTextarea-C5iIr2Ts.js → AutoSaveTextarea-jiqNeeE4.js} +3 -3
  13. package/dist/{AutoSaveTextarea-C5iIr2Ts.js.map → AutoSaveTextarea-jiqNeeE4.js.map} +1 -1
  14. package/dist/{Badge-Dz0cj6rj.js → Badge-Ba3epgcI.js} +2 -2
  15. package/dist/{Badge-Dz0cj6rj.js.map → Badge-Ba3epgcI.js.map} +1 -1
  16. package/dist/{BrandEditor-P8OZX2hi.js → BrandEditor-CN2HJ_12.js} +155 -17
  17. package/dist/BrandEditor-CN2HJ_12.js.map +1 -0
  18. package/dist/{BrandLogo-CKpVSZb6.js → BrandLogo-BfITD0im.js} +2 -2
  19. package/dist/{BrandLogo-CKpVSZb6.js.map → BrandLogo-BfITD0im.js.map} +1 -1
  20. package/dist/{Breadcrumb-BUoAZyhO.js → Breadcrumb-BnIlsoIH.js} +62 -20
  21. package/dist/Breadcrumb-BnIlsoIH.js.map +1 -0
  22. package/dist/{Button-B21oVcPU.js → Button-D2JqBAq7.js} +199 -7
  23. package/dist/Button-D2JqBAq7.js.map +1 -0
  24. package/dist/{Calendar-DFtmZzbF.js → Calendar-BnKi1kPu.js} +4 -4
  25. package/dist/{Calendar-DFtmZzbF.js.map → Calendar-BnKi1kPu.js.map} +1 -1
  26. package/dist/{Card-BQmBWHXl.js → Card-Bpc_ZlL4.js} +3 -3
  27. package/dist/Card-Bpc_ZlL4.js.map +1 -0
  28. package/dist/{Checkbox-8yIIgY7g.js → Checkbox-uFE8XLT_.js} +6 -6
  29. package/dist/Checkbox-uFE8XLT_.js.map +1 -0
  30. package/dist/{Clipboard-_xf6hMDD.js → Clipboard-D-9XOqy4.js} +3 -3
  31. package/dist/{Clipboard-_xf6hMDD.js.map → Clipboard-D-9XOqy4.js.map} +1 -1
  32. package/dist/{ClipboardButton-srUgWgwH.js → ClipboardButton-DxvZG_H0.js} +4 -4
  33. package/dist/{ClipboardButton-srUgWgwH.js.map → ClipboardButton-DxvZG_H0.js.map} +1 -1
  34. package/dist/{CodeEditor-Df7VVx08.js → CodeEditor-BfRSCKEs.js} +6 -6
  35. package/dist/{CodeEditor-Df7VVx08.js.map → CodeEditor-BfRSCKEs.js.map} +1 -1
  36. package/dist/{Collapsible-BQXWEOBC.js → Collapsible-DD4xTL75.js} +2 -2
  37. package/dist/{Collapsible-BQXWEOBC.js.map → Collapsible-DD4xTL75.js.map} +1 -1
  38. package/dist/{ColorInput-B3gBZ8Ya.js → ColorInput-CDKH8q_f.js} +5 -5
  39. package/dist/{ColorInput-B3gBZ8Ya.js.map → ColorInput-CDKH8q_f.js.map} +1 -1
  40. package/dist/{ColorModeSwitch-D8Cki137.js → ColorModeSwitch-DR6J2U6M.js} +4 -4
  41. package/dist/{ColorModeSwitch-D8Cki137.js.map → ColorModeSwitch-DR6J2U6M.js.map} +1 -1
  42. package/dist/{Combobox-BNhW0TDB.js → Combobox-CEesMe2M.js} +246 -44
  43. package/dist/Combobox-CEesMe2M.js.map +1 -0
  44. package/dist/{Command-BQPiZCNz.js → Command-T3MLRaen.js} +10 -6
  45. package/dist/Command-T3MLRaen.js.map +1 -0
  46. package/dist/{CopyField-Ba7h8MqZ.js → CopyField-CNbCHw9a.js} +4 -4
  47. package/dist/{CopyField-Ba7h8MqZ.js.map → CopyField-CNbCHw9a.js.map} +1 -1
  48. package/dist/{DateInput-D0nWUasV.js → DateInput-ClK1lCxz.js} +5 -5
  49. package/dist/{DateInput-D0nWUasV.js.map → DateInput-ClK1lCxz.js.map} +1 -1
  50. package/dist/{DatePicker-CtSa9b3V.js → DatePicker-CgHAu9KX.js} +3 -3
  51. package/dist/{DatePicker-CtSa9b3V.js.map → DatePicker-CgHAu9KX.js.map} +1 -1
  52. package/dist/{DateRangeInput-i6wE45-V.js → DateRangeInput-DtlAffS1.js} +5 -5
  53. package/dist/{DateRangeInput-i6wE45-V.js.map → DateRangeInput-DtlAffS1.js.map} +1 -1
  54. package/dist/{DateRangePicker-BAnuz6vO.js → DateRangePicker-CXpXPMoh.js} +8 -8
  55. package/dist/{DateRangePicker-BAnuz6vO.js.map → DateRangePicker-CXpXPMoh.js.map} +1 -1
  56. package/dist/{DiffView-ppTIzh2h.js → DiffView-Dy4z-n-1.js} +3 -3
  57. package/dist/{DiffView-ppTIzh2h.js.map → DiffView-Dy4z-n-1.js.map} +1 -1
  58. package/dist/{DropdownMenu-BJGLjpVc.js → DropdownMenu-B1gGvZoh.js} +9 -9
  59. package/dist/DropdownMenu-B1gGvZoh.js.map +1 -0
  60. package/dist/{FieldBox-D7DYtX_m.js → FieldBox-BrxLkY9C.js} +8 -6
  61. package/dist/FieldBox-BrxLkY9C.js.map +1 -0
  62. package/dist/{FieldItem-BHViBJS3.js → FieldItem-CYvJyjiI.js} +4 -4
  63. package/dist/{FieldItem-BHViBJS3.js.map → FieldItem-CYvJyjiI.js.map} +1 -1
  64. package/dist/{FileUpload-Ch2hrIWq.js → FileUpload-D6vPG3WB.js} +9 -9
  65. package/dist/FileUpload-D6vPG3WB.js.map +1 -0
  66. package/dist/{Form-VkzfVPyT.js → Form-CD55zJiy.js} +10 -10
  67. package/dist/{Form-VkzfVPyT.js.map → Form-CD55zJiy.js.map} +1 -1
  68. package/dist/{FormGroup-CmCppxOn.js → FormGroup-DiYFdEhH.js} +4 -4
  69. package/dist/{FormGroup-CmCppxOn.js.map → FormGroup-DiYFdEhH.js.map} +1 -1
  70. package/dist/{FullScreenModal-Cwnm8WdM.js → FullScreenModal-CUuAakh3.js} +20 -6
  71. package/dist/{FullScreenModal-Cwnm8WdM.js.map → FullScreenModal-CUuAakh3.js.map} +1 -1
  72. package/dist/HoverCard-BBdPYqEf.js +31 -0
  73. package/dist/HoverCard-BBdPYqEf.js.map +1 -0
  74. package/dist/InlineEdit-D5RdunZo.js +370 -0
  75. package/dist/InlineEdit-D5RdunZo.js.map +1 -0
  76. package/dist/{InputGroup-CrlMRz4X.js → InputGroup-Dm014ruw.js} +4 -4
  77. package/dist/{InputGroup-CrlMRz4X.js.map → InputGroup-Dm014ruw.js.map} +1 -1
  78. package/dist/{Kbd-J4n1J6i4.js → Kbd-3YM7NQO4.js} +3 -3
  79. package/dist/{Kbd-J4n1J6i4.js.map → Kbd-3YM7NQO4.js.map} +1 -1
  80. package/dist/MermaidDiagram-CeiOkI60.js +199 -0
  81. package/dist/MermaidDiagram-CeiOkI60.js.map +1 -0
  82. package/dist/{Modal-BkSuS9Yz.js → Modal-DMZRswk4.js} +8 -7
  83. package/dist/Modal-DMZRswk4.js.map +1 -0
  84. package/dist/{ModalTitle-BxopkIoQ.js → ModalTitle-CTECVgL8.js} +3 -3
  85. package/dist/ModalTitle-CTECVgL8.js.map +1 -0
  86. package/dist/{MultiActionButtonGroup-AWLj1Tg7.js → MultiActionButtonGroup-CEv_txvz.js} +5 -5
  87. package/dist/{MultiActionButtonGroup-AWLj1Tg7.js.map → MultiActionButtonGroup-CEv_txvz.js.map} +1 -1
  88. package/dist/{Navbar-B_DNpv5s.js → Navbar-CtVYcRFn.js} +18 -14
  89. package/dist/Navbar-CtVYcRFn.js.map +1 -0
  90. package/dist/{OtpInput-I8B8Vjdl.js → OtpInput-CY8yCaJk.js} +4 -4
  91. package/dist/{OtpInput-I8B8Vjdl.js.map → OtpInput-CY8yCaJk.js.map} +1 -1
  92. package/dist/{PageHeader-CgfyXpf1.js → PageHeader-CL1A6jFM.js} +21 -14
  93. package/dist/PageHeader-CL1A6jFM.js.map +1 -0
  94. package/dist/{PageLayout-DiAAILuS.js → PageLayout-C9aXTpqV.js} +2 -2
  95. package/dist/{PageLayout-DiAAILuS.js.map → PageLayout-C9aXTpqV.js.map} +1 -1
  96. package/dist/{PageToolbar-C06RKIif.js → PageToolbar-B_e7HGva.js} +6 -6
  97. package/dist/{PageToolbar-C06RKIif.js.map → PageToolbar-B_e7HGva.js.map} +1 -1
  98. package/dist/{Pagination-DH3f6LN0.js → Pagination-DDp6PRqf.js} +5 -5
  99. package/dist/Pagination-DDp6PRqf.js.map +1 -0
  100. package/dist/{Popconfirm-Dhzn7sy6.js → Popconfirm-BgV6a0sl.js} +5 -5
  101. package/dist/{Popconfirm-Dhzn7sy6.js.map → Popconfirm-BgV6a0sl.js.map} +1 -1
  102. package/dist/{Popover-CEk915I1.js → Popover-BU7nGOv-.js} +3 -3
  103. package/dist/Popover-BU7nGOv-.js.map +1 -0
  104. package/dist/{RadioGroup-CYEp8Wnx.js → RadioGroup-C8EC3fqO.js} +6 -6
  105. package/dist/{RadioGroup-CYEp8Wnx.js.map → RadioGroup-C8EC3fqO.js.map} +1 -1
  106. package/dist/{Resizable-D3vYToZH.js → Resizable-D8zs0kcq.js} +2 -2
  107. package/dist/{Resizable-D3vYToZH.js.map → Resizable-D8zs0kcq.js.map} +1 -1
  108. package/dist/{Search-DmkQo716.js → Search-aaUMI4ix.js} +4 -4
  109. package/dist/{Search-DmkQo716.js.map → Search-aaUMI4ix.js.map} +1 -1
  110. package/dist/{SearchInput-D3qMkHaW.js → SearchInput-Dxi2GK4n.js} +4 -4
  111. package/dist/{SearchInput-D3qMkHaW.js.map → SearchInput-Dxi2GK4n.js.map} +1 -1
  112. package/dist/{SectionNav-I2p2uXTd.js → SectionNav-BnHOMLtE.js} +11 -11
  113. package/dist/{SectionNav-I2p2uXTd.js.map → SectionNav-BnHOMLtE.js.map} +1 -1
  114. package/dist/{Select-B4uK0QVm.js → Select-CjQgU_6K.js} +6 -6
  115. package/dist/Select-CjQgU_6K.js.map +1 -0
  116. package/dist/{Sheet-D0fAE14T.js → Sheet-utw4_rUa.js} +9 -9
  117. package/dist/Sheet-utw4_rUa.js.map +1 -0
  118. package/dist/{Sidebar-D9ytIs8V.js → Sidebar-BAmux2Uj.js} +21 -18
  119. package/dist/Sidebar-BAmux2Uj.js.map +1 -0
  120. package/dist/{Slider-B0ou9r0B.js → Slider-DbzzSDRV.js} +5 -5
  121. package/dist/{Slider-B0ou9r0B.js.map → Slider-DbzzSDRV.js.map} +1 -1
  122. package/dist/{Stepper-BLkLhfnd.js → Stepper-BBPembeK.js} +3 -3
  123. package/dist/{Stepper-BLkLhfnd.js.map → Stepper-BBPembeK.js.map} +1 -1
  124. package/dist/{Switch-DZvNePOm.js → Switch-Dw4tvQls.js} +3 -3
  125. package/dist/Switch-Dw4tvQls.js.map +1 -0
  126. package/dist/{Table-BaVT5Tkn.js → Table-CilEvpMq.js} +65 -6
  127. package/dist/Table-CilEvpMq.js.map +1 -0
  128. package/dist/{Tabs-CTDmye1N.js → Tabs-C0uvkPHc.js} +5 -5
  129. package/dist/Tabs-C0uvkPHc.js.map +1 -0
  130. package/dist/{TextInput-BWYXbfs4.js → TextInput-K2DSDs5O.js} +5 -5
  131. package/dist/{TextInput-BWYXbfs4.js.map → TextInput-K2DSDs5O.js.map} +1 -1
  132. package/dist/{ThemeProvider-VF38VfUa.js → ThemeProvider-C8yaKlM1.js} +22 -5
  133. package/dist/ThemeProvider-C8yaKlM1.js.map +1 -0
  134. package/dist/{TimePicker-CDGYrRxi.js → TimePicker-DyyV3nw8.js} +2 -2
  135. package/dist/{TimePicker-CDGYrRxi.js.map → TimePicker-DyyV3nw8.js.map} +1 -1
  136. package/dist/{Timeline-B-I6sb0M.js → Timeline-DUXgByUE.js} +3 -3
  137. package/dist/{Timeline-B-I6sb0M.js.map → Timeline-DUXgByUE.js.map} +1 -1
  138. package/dist/{Toast-NrOdDDru.js → Toast-BGnUL4jV.js} +2 -2
  139. package/dist/{Toast-NrOdDDru.js.map → Toast-BGnUL4jV.js.map} +1 -1
  140. package/dist/ToggleAllTooltip-Dlmq-yqS.js +37 -0
  141. package/dist/ToggleAllTooltip-Dlmq-yqS.js.map +1 -0
  142. package/dist/{ToggleGroup-Cy_10Mvu.js → ToggleGroup-BOz1yyz6.js} +3 -3
  143. package/dist/ToggleGroup-BOz1yyz6.js.map +1 -0
  144. package/dist/{Workbench-DmZzpkj7.js → Workbench-CxgNCs3I.js} +4 -4
  145. package/dist/{Workbench-DmZzpkj7.js.map → Workbench-CxgNCs3I.js.map} +1 -1
  146. package/dist/{ZoomableSvg-C65nta_r.js → ZoomableSvg-Dh1OstPN.js} +87 -83
  147. package/dist/ZoomableSvg-Dh1OstPN.js.map +1 -0
  148. package/dist/charts.js +1 -1
  149. package/dist/classNames-DcGnTh2N.js +21 -0
  150. package/dist/classNames-DcGnTh2N.js.map +1 -0
  151. package/dist/editors.js +6 -6
  152. package/dist/flint.js +10 -45
  153. package/dist/flint.js.map +1 -1
  154. package/dist/highlightCode-D354tCXO.js +81 -0
  155. package/dist/highlightCode-D354tCXO.js.map +1 -0
  156. package/dist/{icons-wcA70iQx.js → icons-ZIeZXXS7.js} +37 -4
  157. package/dist/icons-ZIeZXXS7.js.map +1 -0
  158. package/dist/icons.d.ts +2 -2
  159. package/dist/icons.js +2 -2
  160. package/dist/{index-B7k-09i1.d.ts → index-D-itZ3VP.d.ts} +14 -3
  161. package/dist/index.d.ts +942 -424
  162. package/dist/index.js +72 -70
  163. package/dist/internal/blocks/AIKit.js +2 -2
  164. package/dist/internal/blocks/AppShell.js +1 -1
  165. package/dist/internal/blocks/AuthLayout.js +2 -2
  166. package/dist/internal/blocks/AutoSaveTextarea.js +1 -1
  167. package/dist/internal/blocks/BrandEditor.js +1 -1
  168. package/dist/internal/blocks/ChartPanel.js +2 -2
  169. package/dist/internal/blocks/ChipEditor.js +4 -4
  170. package/dist/internal/blocks/ClipboardButton.js +1 -1
  171. package/dist/internal/blocks/ColorInput.js +1 -1
  172. package/dist/internal/blocks/ColorModeSwitch.js +1 -1
  173. package/dist/internal/blocks/Command.js +1 -1
  174. package/dist/internal/blocks/CopyField.js +1 -1
  175. package/dist/internal/blocks/DashboardHero.js +2 -2
  176. package/dist/internal/blocks/DashboardHero.js.map +1 -1
  177. package/dist/internal/blocks/DateInput.js +1 -1
  178. package/dist/internal/blocks/DateRangeInput.js +1 -1
  179. package/dist/internal/blocks/DiagramShared/DiagramSkeleton.js.map +1 -1
  180. package/dist/internal/blocks/EmptyConfigurationActionCard.js +1 -1
  181. package/dist/internal/blocks/ExportMenu.js +4 -4
  182. package/dist/internal/blocks/FacebookButton.js +66 -0
  183. package/dist/internal/blocks/FacebookButton.js.map +1 -0
  184. package/dist/internal/blocks/Form/connectors/ComboboxField.js +2 -2
  185. package/dist/internal/blocks/Form/connectors/MultiComboboxField.js +1 -1
  186. package/dist/internal/blocks/Form.js +1 -1
  187. package/dist/internal/blocks/FormGroup.js +1 -1
  188. package/dist/internal/blocks/GoogleButton.js +2 -2
  189. package/dist/internal/blocks/InlineEdit.js +2 -0
  190. package/dist/internal/blocks/MicrosoftButton.js +2 -2
  191. package/dist/internal/blocks/MultiActionButtonGroup.js +1 -1
  192. package/dist/internal/blocks/MultiCombobox.js +204 -68
  193. package/dist/internal/blocks/MultiCombobox.js.map +1 -1
  194. package/dist/internal/blocks/NumberInput.js +1 -1
  195. package/dist/internal/blocks/OtpInput.js +1 -1
  196. package/dist/internal/blocks/PageHeader.js +1 -1
  197. package/dist/internal/blocks/PageLayout.js +1 -1
  198. package/dist/internal/blocks/PageToolbar.js +1 -1
  199. package/dist/internal/blocks/PasswordInput.js +3 -3
  200. package/dist/internal/blocks/SearchInput.js +1 -1
  201. package/dist/internal/blocks/SearchInputWithNavigation.js +5 -5
  202. package/dist/internal/blocks/SectionNav.js +1 -1
  203. package/dist/internal/blocks/SplitButton.js +6 -5
  204. package/dist/internal/blocks/SplitButton.js.map +1 -1
  205. package/dist/internal/blocks/StatCard.js +2 -2
  206. package/dist/internal/blocks/TextInput.js +1 -1
  207. package/dist/internal/blocks/Textarea.js +1 -1
  208. package/dist/internal/blocks/TimeInput.js +4 -4
  209. package/dist/internal/components/Alert.js +1 -1
  210. package/dist/internal/components/AlertModal.js +1 -1
  211. package/dist/internal/components/Avatar.js +2 -2
  212. package/dist/internal/components/Badge.js +1 -1
  213. package/dist/internal/components/BrandLogo.js +1 -1
  214. package/dist/internal/components/Breadcrumb.js +1 -1
  215. package/dist/internal/components/Button.js +1 -1
  216. package/dist/internal/components/ButtonGroup.js +1 -1
  217. package/dist/internal/components/Calendar.js +1 -1
  218. package/dist/internal/components/Card.js +1 -1
  219. package/dist/internal/components/Checkbox.js +1 -1
  220. package/dist/internal/components/Clipboard.js +1 -1
  221. package/dist/internal/components/Collapsible.js +1 -1
  222. package/dist/internal/components/CollapsiblePanel.js +5 -5
  223. package/dist/internal/components/CollapsiblePanel.js.map +1 -1
  224. package/dist/internal/components/Combobox.js +1 -1
  225. package/dist/internal/components/DatePicker.js +1 -1
  226. package/dist/internal/components/DateRangePicker.js +1 -1
  227. package/dist/internal/components/DiffView.js +1 -1
  228. package/dist/internal/components/DotsLoader.js +1 -1
  229. package/dist/internal/components/DropdownMenu.js +1 -1
  230. package/dist/internal/components/FileUpload.js +1 -1
  231. package/dist/internal/components/FullScreenModal.js +1 -1
  232. package/dist/internal/components/HoverCard.js +1 -1
  233. package/dist/internal/components/InputGroup.js +1 -1
  234. package/dist/internal/components/Kbd.js +1 -1
  235. package/dist/internal/components/Label.js +2 -2
  236. package/dist/internal/components/Label.js.map +1 -1
  237. package/dist/internal/components/Link.js +1 -1
  238. package/dist/internal/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.js +2 -2
  239. package/dist/internal/components/Modal.js +1 -1
  240. package/dist/internal/components/Navbar.js +1 -1
  241. package/dist/internal/components/Pagination.js +1 -1
  242. package/dist/internal/components/PanelWithDetails.js +3 -3
  243. package/dist/internal/components/Popconfirm.js +1 -1
  244. package/dist/internal/components/Popover.js +1 -1
  245. package/dist/internal/components/Progress.js +1 -1
  246. package/dist/internal/components/RadioGroup.js +1 -1
  247. package/dist/internal/components/Resizable.js +1 -1
  248. package/dist/internal/components/ScrollArea.js +1 -1
  249. package/dist/internal/components/Search.js +1 -1
  250. package/dist/internal/components/Select.js +1 -1
  251. package/dist/internal/components/Separator.js +1 -1
  252. package/dist/internal/components/Sheet.js +1 -1
  253. package/dist/internal/components/Sidebar.js +1 -1
  254. package/dist/internal/components/Skeleton/Skeleton.js +2 -2
  255. package/dist/internal/components/Skeleton/Skeleton.js.map +1 -1
  256. package/dist/internal/components/Skeleton/SkeletonList.js +1 -1
  257. package/dist/internal/components/Slider.js +1 -1
  258. package/dist/internal/components/SpotlightBackdrop.js +1 -1
  259. package/dist/internal/components/Stepper.js +1 -1
  260. package/dist/internal/components/Switch.js +1 -1
  261. package/dist/internal/components/Table.js +1 -1
  262. package/dist/internal/components/Tabs.js +1 -1
  263. package/dist/internal/components/ThemeProvider.js +1 -1
  264. package/dist/internal/components/TimePicker.js +1 -1
  265. package/dist/internal/components/Timeline.js +1 -1
  266. package/dist/internal/components/Toast.js +2 -2
  267. package/dist/internal/components/Toggle.js +5 -5
  268. package/dist/internal/components/Toggle.js.map +1 -1
  269. package/dist/internal/components/ToggleGroup.js +1 -1
  270. package/dist/internal/components/Tooltip.js +1 -1
  271. package/dist/internal/components/Truncated.js +2 -2
  272. package/dist/internal/components/Workbench.js +1 -1
  273. package/dist/internal/components/ZoomableSvg.js +1 -1
  274. package/dist/internal/utils.js +2 -2
  275. package/dist/markdown-editor.js +14 -14
  276. package/dist/markdown-editor.js.map +1 -1
  277. package/dist/mermaid.d.ts +1 -2
  278. package/dist/mermaid.js +1 -1
  279. package/dist/rjsf.js +101 -14
  280. package/dist/rjsf.js.map +1 -1
  281. package/dist/{styles-DBGXH5-_.js → styles-BDA5rQz3.js} +6 -6
  282. package/dist/styles-BDA5rQz3.js.map +1 -0
  283. package/dist/{styles-gzcjOyKv.js → styles-YQdM7G8c.js} +3 -3
  284. package/dist/{styles-gzcjOyKv.js.map → styles-YQdM7G8c.js.map} +1 -1
  285. package/dist/styles.css +1 -1
  286. package/dist/svgCache-Dhmbe-7i.js +26 -0
  287. package/dist/svgCache-Dhmbe-7i.js.map +1 -0
  288. package/dist/svgTransforms-Hnvev3Vs.js +38 -0
  289. package/dist/svgTransforms-Hnvev3Vs.js.map +1 -0
  290. package/dist/testing.js +1 -1
  291. package/dist/{themeTokens-7DEab0kp.js → themeTokens-l2Fsfcs7.js} +3 -12
  292. package/dist/themeTokens-l2Fsfcs7.js.map +1 -0
  293. package/dist/{toast-CyXEdaCZ.js → toast-D6Z6MOB5.js} +5 -5
  294. package/dist/toast-D6Z6MOB5.js.map +1 -0
  295. package/dist/{utils-Bd28bWgm.js → utils-LQ4jJA-9.js} +21 -5
  296. package/dist/utils-LQ4jJA-9.js.map +1 -0
  297. package/dist/vega.js +1 -1
  298. package/dist/vegaTheme-BrmVoPEz.js +49 -0
  299. package/dist/vegaTheme-BrmVoPEz.js.map +1 -0
  300. package/dist/{vegaTheme-VQMWTlBw.js → vegaTokens-Ce07C0DH.js} +36 -44
  301. package/dist/vegaTokens-Ce07C0DH.js.map +1 -0
  302. package/package.json +4 -4
  303. package/src/styles.css +183 -4
  304. package/src/theme.css +47 -3
  305. package/dist/AIKit-BVCWP9Ks.js.map +0 -1
  306. package/dist/AlertModal-mbSnuuka.js.map +0 -1
  307. package/dist/BrandEditor-P8OZX2hi.js.map +0 -1
  308. package/dist/Breadcrumb-BUoAZyhO.js.map +0 -1
  309. package/dist/Button-B21oVcPU.js.map +0 -1
  310. package/dist/Card-BQmBWHXl.js.map +0 -1
  311. package/dist/Checkbox-8yIIgY7g.js.map +0 -1
  312. package/dist/Combobox-BNhW0TDB.js.map +0 -1
  313. package/dist/Command-BQPiZCNz.js.map +0 -1
  314. package/dist/DiagramSource-C5_d8Gdj.js +0 -11
  315. package/dist/DiagramSource-C5_d8Gdj.js.map +0 -1
  316. package/dist/DropdownMenu-BJGLjpVc.js.map +0 -1
  317. package/dist/FieldBox-D7DYtX_m.js.map +0 -1
  318. package/dist/FileUpload-Ch2hrIWq.js.map +0 -1
  319. package/dist/HoverCard-B8OKu9XZ.js +0 -31
  320. package/dist/HoverCard-B8OKu9XZ.js.map +0 -1
  321. package/dist/MermaidDiagram-B30x2yV7.js +0 -302
  322. package/dist/MermaidDiagram-B30x2yV7.js.map +0 -1
  323. package/dist/Modal-BkSuS9Yz.js.map +0 -1
  324. package/dist/ModalTitle-BxopkIoQ.js.map +0 -1
  325. package/dist/Navbar-B_DNpv5s.js.map +0 -1
  326. package/dist/PageHeader-CgfyXpf1.js.map +0 -1
  327. package/dist/Pagination-DH3f6LN0.js.map +0 -1
  328. package/dist/Popover-CEk915I1.js.map +0 -1
  329. package/dist/Select-B4uK0QVm.js.map +0 -1
  330. package/dist/Sheet-D0fAE14T.js.map +0 -1
  331. package/dist/Sidebar-D9ytIs8V.js.map +0 -1
  332. package/dist/Switch-DZvNePOm.js.map +0 -1
  333. package/dist/Table-BaVT5Tkn.js.map +0 -1
  334. package/dist/Tabs-CTDmye1N.js.map +0 -1
  335. package/dist/ThemeProvider-VF38VfUa.js.map +0 -1
  336. package/dist/ToggleGroup-Cy_10Mvu.js.map +0 -1
  337. package/dist/ZoomableSvg-C65nta_r.js.map +0 -1
  338. package/dist/classNames-BzrkDnOD.js +0 -9
  339. package/dist/classNames-BzrkDnOD.js.map +0 -1
  340. package/dist/icons-wcA70iQx.js.map +0 -1
  341. package/dist/styles-DBGXH5-_.js.map +0 -1
  342. package/dist/svgTransforms-Dw2hRA-i.js +0 -51
  343. package/dist/svgTransforms-Dw2hRA-i.js.map +0 -1
  344. package/dist/themeTokens-7DEab0kp.js.map +0 -1
  345. package/dist/toast-CyXEdaCZ.js.map +0 -1
  346. package/dist/utils-Bd28bWgm.js.map +0 -1
  347. package/dist/vegaTheme-VQMWTlBw.js.map +0 -1
@@ -0,0 +1,370 @@
1
+ import { cn } from "./classNames-DcGnTh2N.js";
2
+ import { Tooltip } from "./utils-LQ4jJA-9.js";
3
+ import { ArgoDesignContext } from "./context-U293r3v-.js";
4
+ import { Check, Loader2, X } from "./icons-ZIeZXXS7.js";
5
+ import { Button } from "./Button-D2JqBAq7.js";
6
+ import { Kbd, keys } from "./Kbd-3YM7NQO4.js";
7
+ import { useAutosizeInput } from "./internal/hooks/useAutosizeInput.js";
8
+ import { useEffect, useId, useLayoutEffect, useRef, useState } from "react";
9
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
+ //#region src/blocks/InlineEdit/InlineEdit.tsx
11
+ /** A sized `fill` row at least this wide shows Save / Cancel as text; a narrower one as icons. */
12
+ const LABELLED_BUTTONS_MIN_WIDTH = 480;
13
+ /** Below this a `multiline` field keeps the row and Save / Cancel move under it. */
14
+ const INLINE_BUTTONS_MIN_WIDTH = 320;
15
+ /** How long the field and the buttons take to open and close. */
16
+ const EXPAND_MS = 200;
17
+ /**
18
+ * Box and button height per size; the font is always the surrounding one.
19
+ *
20
+ * - Buttons take the box's height, not the brand's own button height, so the row lines up.
21
+ * - The box overhangs its line by the same amount it pads it, so the line box never changes.
22
+ * - `auto` scales the icon buttons with the text instead of picking a fixed height.
23
+ */
24
+ const SIZES = {
25
+ auto: {
26
+ box: "tw:py-px tw:-my-[2px]",
27
+ icon: "icon-xs",
28
+ label: "medium",
29
+ fit: "",
30
+ iconFit: ""
31
+ },
32
+ sm: {
33
+ box: "tw:py-[max(1px,calc((1.5rem-1lh)/2-1px))] tw:-my-[max(2px,calc((1.5rem-1lh)/2))]",
34
+ icon: "icon-xs",
35
+ label: "small",
36
+ fit: "tw:h-6 tw:min-h-6 tw:max-h-6",
37
+ iconFit: "tw:size-6"
38
+ },
39
+ md: {
40
+ box: "tw:py-[max(1px,calc((2rem-1lh)/2-1px))] tw:-my-[max(2px,calc((2rem-1lh)/2))]",
41
+ icon: "icon-sm",
42
+ label: "small",
43
+ fit: "tw:h-8 tw:min-h-8 tw:max-h-8",
44
+ iconFit: "tw:size-8"
45
+ },
46
+ lg: {
47
+ box: "tw:py-[max(1px,calc((2.5rem-1lh)/2-1px))] tw:-my-[max(2px,calc((2.5rem-1lh)/2))]",
48
+ icon: "icon",
49
+ label: "medium",
50
+ fit: "tw:h-10 tw:min-h-10 tw:max-h-10",
51
+ iconFit: "tw:size-10"
52
+ },
53
+ title: {
54
+ box: "tw:py-[max(1px,calc((2.5rem-1lh)/2-1px))] tw:-my-[max(2px,calc((2.5rem-1lh)/2))]",
55
+ icon: "icon",
56
+ label: "medium",
57
+ fit: "tw:h-10 tw:min-h-10 tw:max-h-10",
58
+ iconFit: "tw:size-10"
59
+ }
60
+ };
61
+ const BOX_CLASS = cn("tw:relative tw:-left-1.5 tw:rounded-md tw:border tw:px-[5px] tw:leading-[inherit]", "tw:transition-[border-color,background-color,box-shadow] tw:duration-150 tw:ease-out");
62
+ const VIEW_BOX_CLASS = cn("tw:border-transparent", "tw:hover:border-input tw:hover:bg-muted-foreground/10", "tw:has-[:focus-visible]:border-input tw:has-[:focus-visible]:bg-muted-foreground/10");
63
+ const FIELD_CLASS = cn("tw:m-0 tw:block tw:border-0 tw:bg-transparent tw:p-0 tw:outline-hidden", "tw:[font:inherit] tw:[letter-spacing:inherit] tw:[color:inherit]", "tw:placeholder:text-muted-foreground");
64
+ const AUTO_ICON_BUTTON_CLASS = "tw:size-[max(1.5rem,1.1em)] tw:text-[length:inherit]";
65
+ const ShortcutLabel = ({ label, shortcut }) => /* @__PURE__ */ jsxs("span", {
66
+ className: "tw:inline-flex tw:items-center tw:gap-2",
67
+ children: [label, /* @__PURE__ */ jsx(Kbd, {
68
+ variant: "primary",
69
+ children: shortcut
70
+ })]
71
+ });
72
+ const keepFieldFocus = (event) => event.preventDefault();
73
+ /**
74
+ * Click-to-edit text: a page title, an entity name, a short label in a row.
75
+ *
76
+ * - The caller owns the draft and the editing flag, so it can validate, save and fail on its own terms.
77
+ * - Enter saves a change and closes an unchanged edit; Escape cancels.
78
+ * - Not for multi-paragraph or markdown text: use `MarkdownEditor`.
79
+ */
80
+ const InlineEdit = ({ value, onChange, onSubmit, onCancel, isEditing, onEditStart, isChanged, isSaving = false, invalidReason = null, readOnly = false, fill = true, multiline = false, size = "auto", truncate = false, placeholder = "Click to edit", editTooltip = "Click to edit", tooltipPlacement = "top", maxLength, "aria-label": ariaLabel, className }) => {
81
+ const formRef = useRef(null);
82
+ const viewButtonRef = useRef(null);
83
+ const textareaRef = useRef(null);
84
+ const wasEditingRef = useRef(isEditing);
85
+ const reasonId = useId();
86
+ const { inputRef, inputStyle, sizerElement } = useAutosizeInput({
87
+ value,
88
+ placeholder
89
+ });
90
+ const [rowWidth, setRowWidth] = useState(0);
91
+ const boxRef = useRef(null);
92
+ const buttonsRef = useRef(null);
93
+ const boxWidthRef = useRef(0);
94
+ const [isPrimed, setIsPrimed] = useState(false);
95
+ const [isTipQuiet, setIsTipQuiet] = useState(false);
96
+ const isValid = !invalidReason;
97
+ const canSave = isChanged && isValid && !isSaving;
98
+ const showLabels = fill && size !== "auto" && rowWidth >= LABELLED_BUTTONS_MIN_WIDTH;
99
+ const stackButtons = fill && multiline && rowWidth > 0 && rowWidth < INLINE_BUTTONS_MIN_WIDTH;
100
+ const sizing = SIZES[size];
101
+ useEffect(() => {
102
+ const wasEditing = wasEditingRef.current;
103
+ wasEditingRef.current = isEditing;
104
+ if (isEditing) {
105
+ const field = textareaRef.current ?? inputRef.current;
106
+ field?.focus();
107
+ field?.setSelectionRange(field.value.length, field.value.length);
108
+ return;
109
+ }
110
+ if (!wasEditing) return;
111
+ setIsTipQuiet(true);
112
+ if (!document.activeElement || document.activeElement === document.body) viewButtonRef.current?.focus();
113
+ }, [isEditing, inputRef]);
114
+ useLayoutEffect(() => {
115
+ const box = boxRef.current;
116
+ if (!box || typeof ResizeObserver === "undefined") return;
117
+ const observer = new ResizeObserver(() => {
118
+ boxWidthRef.current = box.offsetWidth;
119
+ });
120
+ observer.observe(box);
121
+ return () => observer.disconnect();
122
+ }, []);
123
+ useLayoutEffect(() => {
124
+ const box = boxRef.current;
125
+ const buttons = buttonsRef.current;
126
+ const from = boxWidthRef.current;
127
+ if (!box || !buttons || !from) return;
128
+ for (const running of box.getAnimations()) running.cancel();
129
+ const to = box.offsetWidth;
130
+ boxWidthRef.current = to;
131
+ if (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches || typeof box.animate !== "function") return;
132
+ const timing = {
133
+ duration: EXPAND_MS,
134
+ easing: "ease-out"
135
+ };
136
+ if (from !== to) {
137
+ const property = fill && isEditing ? "maxWidth" : "width";
138
+ const field = textareaRef.current;
139
+ if (field) field.style.whiteSpace = "nowrap";
140
+ const animation = box.animate([{ [property]: `${from}px` }, { [property]: `${to}px` }], timing);
141
+ const heldRow = fill && !isEditing ? formRef.current : null;
142
+ if (heldRow) heldRow.dataset.expanded = "true";
143
+ animation.onfinish = () => {
144
+ if (field) field.style.whiteSpace = "";
145
+ if (!heldRow) return;
146
+ delete heldRow.dataset.expanded;
147
+ heldRow.dataset.settled = "true";
148
+ };
149
+ }
150
+ for (const running of buttons.getAnimations()) running.cancel();
151
+ const buttonsWidth = `${buttons.scrollWidth}px`;
152
+ buttons.style.overflowX = "clip";
153
+ buttons.animate(isEditing ? [{ maxWidth: "0px" }, { maxWidth: buttonsWidth }] : [{ maxWidth: buttonsWidth }, { maxWidth: "0px" }], timing).onfinish = () => {
154
+ buttons.style.overflowX = "";
155
+ };
156
+ }, [isEditing, fill]);
157
+ useLayoutEffect(() => {
158
+ const textarea = textareaRef.current;
159
+ if (!textarea) return;
160
+ const fitHeight = () => {
161
+ textarea.style.height = "auto";
162
+ textarea.style.height = `${textarea.scrollHeight}px`;
163
+ };
164
+ fitHeight();
165
+ if (typeof ResizeObserver === "undefined") return;
166
+ const observer = new ResizeObserver(fitHeight);
167
+ observer.observe(textarea);
168
+ return () => observer.disconnect();
169
+ }, [isEditing, value]);
170
+ useLayoutEffect(() => {
171
+ const form = formRef.current;
172
+ if (!fill || !isEditing || !form) return;
173
+ const fitButtons = (width) => setRowWidth(width);
174
+ fitButtons(form.offsetWidth);
175
+ if (typeof ResizeObserver === "undefined") return;
176
+ const observer = new ResizeObserver(() => fitButtons(form.offsetWidth));
177
+ observer.observe(form);
178
+ return () => observer.disconnect();
179
+ }, [fill, isEditing]);
180
+ if (readOnly) return /* @__PURE__ */ jsx("span", {
181
+ className: cn(truncate && "tw:block tw:truncate", className),
182
+ children: value
183
+ });
184
+ const handleKeyDown = (event) => {
185
+ event.stopPropagation();
186
+ if (event.key === "Escape") {
187
+ event.preventDefault();
188
+ if (!isSaving) onCancel();
189
+ return;
190
+ }
191
+ if (event.key === "Enter") {
192
+ event.preventDefault();
193
+ if (isSaving) return;
194
+ if (!isChanged) onCancel();
195
+ else if (isValid) onSubmit();
196
+ }
197
+ };
198
+ const handleBlur = (event) => {
199
+ if (!isEditing || isSaving) return;
200
+ if (!document.hasFocus()) return;
201
+ const next = event.relatedTarget;
202
+ if (next instanceof Node && event.currentTarget.contains(next)) return;
203
+ if (!isChanged) onCancel();
204
+ else if (isValid) onSubmit();
205
+ };
206
+ const handleChange = (event) => {
207
+ onChange(multiline ? event.target.value.replace(/[\r\n]+/g, " ") : event.target.value);
208
+ };
209
+ const fieldProps = {
210
+ value,
211
+ placeholder,
212
+ maxLength,
213
+ readOnly: isSaving,
214
+ "aria-label": ariaLabel ?? placeholder,
215
+ "aria-invalid": !isValid || void 0,
216
+ "aria-describedby": invalidReason ? reasonId : void 0,
217
+ onChange: handleChange,
218
+ onKeyDown: handleKeyDown,
219
+ onKeyUp: (event) => event.stopPropagation(),
220
+ onClick: (event) => event.stopPropagation()
221
+ };
222
+ const saveTooltip = (() => {
223
+ if (isSaving) return "Saving…";
224
+ if (!isChanged) return "No changes to save";
225
+ if (invalidReason) return invalidReason;
226
+ return /* @__PURE__ */ jsx(ShortcutLabel, {
227
+ label: "Save",
228
+ shortcut: keys.enter.symbol
229
+ });
230
+ })();
231
+ const iconButtonClass = size === "auto" ? AUTO_ICON_BUTTON_CLASS : sizing.iconFit;
232
+ const labelButtonClass = sizing.fit;
233
+ const buttonSize = showLabels ? sizing.label : sizing.icon;
234
+ const view = /* @__PURE__ */ jsx(Tooltip, {
235
+ tooltip: editTooltip,
236
+ placement: tooltipPlacement,
237
+ forceHide: isTipQuiet,
238
+ triggerAsChild: true,
239
+ children: /* @__PURE__ */ jsx("button", {
240
+ ref: viewButtonRef,
241
+ type: "button",
242
+ "data-testid": "inline-edit-trigger",
243
+ className: cn("tw:block tw:max-w-full tw:cursor-text tw:text-left tw:outline-hidden", "tw:[font:inherit] tw:leading-[inherit] tw:[color:inherit]", "tw:after:absolute tw:after:inset-0", truncate && "tw:min-w-0 tw:truncate"),
244
+ onClick: (event) => {
245
+ event.preventDefault();
246
+ event.stopPropagation();
247
+ onEditStart?.();
248
+ },
249
+ onBlur: () => setIsTipQuiet(false),
250
+ onPointerLeave: () => setIsTipQuiet(false),
251
+ children: value ? /* @__PURE__ */ jsx("span", {
252
+ className: cn(!truncate && !multiline && "tw:line-clamp-2", "tw:break-words"),
253
+ children: value
254
+ }) : /* @__PURE__ */ jsx("span", {
255
+ className: "tw:text-muted-foreground",
256
+ children: placeholder
257
+ })
258
+ })
259
+ });
260
+ const field = multiline ? /* @__PURE__ */ jsx("textarea", {
261
+ ref: textareaRef,
262
+ rows: 1,
263
+ className: cn(FIELD_CLASS, "tw:w-full tw:resize-none tw:overflow-hidden tw:break-words"),
264
+ ...fieldProps
265
+ }) : /* @__PURE__ */ jsx("input", {
266
+ ref: inputRef,
267
+ type: "text",
268
+ className: cn(FIELD_CLASS, fill ? "tw:w-full" : "tw:max-w-full"),
269
+ style: fill ? void 0 : inputStyle,
270
+ ...fieldProps
271
+ });
272
+ const buttons = /* @__PURE__ */ jsxs("div", {
273
+ className: cn("tw:flex tw:items-center tw:gap-1", stackButtons ? "tw:pt-2" : "tw:h-[1lh] tw:pl-2", "tw:transition-opacity tw:duration-200 tw:ease-out", isEditing ? "tw:opacity-100" : "tw:opacity-0"),
274
+ children: [/* @__PURE__ */ jsx(Tooltip, {
275
+ tooltip: saveTooltip,
276
+ placement: "top",
277
+ triggerAsChild: true,
278
+ children: /* @__PURE__ */ jsx("span", {
279
+ className: cn("tw:inline-flex", !canSave && "tw:cursor-not-allowed"),
280
+ children: /* @__PURE__ */ jsx(Button, {
281
+ type: "submit",
282
+ variant: "primary",
283
+ size: buttonSize,
284
+ "aria-label": showLabels ? void 0 : "Save",
285
+ isLoading: !showLabels && isSaving,
286
+ disabled: !canSave,
287
+ onMouseDown: keepFieldFocus,
288
+ className: cn("tw:transition-colors", showLabels ? labelButtonClass : iconButtonClass, !canSave && "tw:pointer-events-none"),
289
+ children: showLabels ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
290
+ className: cn(isSaving && "tw:invisible"),
291
+ children: "Save"
292
+ }), isSaving && /* @__PURE__ */ jsx(Loader2, { className: "tw:absolute tw:size-4 tw:animate-spin" })] }) : /* @__PURE__ */ jsx(Check, {})
293
+ })
294
+ })
295
+ }), /* @__PURE__ */ jsx(Tooltip, {
296
+ tooltip: /* @__PURE__ */ jsx(ShortcutLabel, {
297
+ label: "Cancel",
298
+ shortcut: "Esc"
299
+ }),
300
+ placement: "top",
301
+ triggerAsChild: true,
302
+ children: /* @__PURE__ */ jsx(Button, {
303
+ type: "button",
304
+ variant: "outline",
305
+ size: buttonSize,
306
+ "aria-label": showLabels ? void 0 : "Cancel",
307
+ disabled: isSaving,
308
+ className: cn("tw:transition-colors", showLabels ? labelButtonClass : iconButtonClass),
309
+ onMouseDown: keepFieldFocus,
310
+ onClick: (event) => {
311
+ event.stopPropagation();
312
+ onCancel();
313
+ },
314
+ children: showLabels ? "Cancel" : /* @__PURE__ */ jsx(X, {})
315
+ })
316
+ })]
317
+ });
318
+ return /* @__PURE__ */ jsxs("form", {
319
+ ref: formRef,
320
+ "data-slot": "inline-edit",
321
+ "data-state": isEditing ? "edit" : "view",
322
+ "data-expanded": fill && isEditing || void 0,
323
+ "aria-busy": isSaving || void 0,
324
+ className: cn("tw:leading-[inherit]", fill && isEditing ? "tw:flex tw:w-full tw:min-w-0 tw:items-start" : "tw:inline-flex tw:max-w-full tw:items-center", fill && isEditing && multiline && "tw:flex-wrap", truncate && !isEditing && "tw:flex tw:min-w-0", className),
325
+ onSubmit: (event) => {
326
+ event.preventDefault();
327
+ if (canSave) onSubmit();
328
+ },
329
+ onBlur: handleBlur,
330
+ onKeyDown: (event) => {
331
+ if (event.key !== "Escape" || !isEditing) return;
332
+ event.preventDefault();
333
+ event.stopPropagation();
334
+ if (!isSaving) onCancel();
335
+ },
336
+ children: [
337
+ /* @__PURE__ */ jsxs("div", {
338
+ ref: boxRef,
339
+ onPointerEnter: () => setIsPrimed(true),
340
+ onFocus: () => setIsPrimed(true),
341
+ className: cn(BOX_CLASS, sizing.box, "tw:min-w-0", fill && isEditing && "tw:flex-1", fill && isEditing && multiline && "tw:min-w-[min(100%,12rem)]", !isEditing && VIEW_BOX_CLASS, isEditing && (isValid ? "tw:border-ring tw:bg-input-background tw:ring-3 tw:ring-ring/25" : "tw:border-destructive tw:bg-input-background tw:ring-3 tw:ring-destructive/20"), isEditing && !fill && !multiline && "tw:inline-flex"),
342
+ children: [isEditing ? field : view, !fill && !multiline && (isPrimed || isEditing) && /* @__PURE__ */ jsx("span", {
343
+ "aria-hidden": true,
344
+ className: "tw:absolute tw:size-0 tw:overflow-hidden",
345
+ children: sizerElement
346
+ })]
347
+ }),
348
+ isEditing && invalidReason && /* @__PURE__ */ jsx("span", {
349
+ id: reasonId,
350
+ className: "tw:sr-only",
351
+ "aria-live": "polite",
352
+ children: invalidReason
353
+ }),
354
+ /* @__PURE__ */ jsx("div", {
355
+ ref: buttonsRef,
356
+ inert: !isEditing,
357
+ "aria-hidden": !isEditing || void 0,
358
+ className: cn(fill ? "tw:self-start" : "tw:self-center", !isEditing && "tw:max-w-0 tw:overflow-x-clip", stackButtons && isEditing && "tw:basis-full"),
359
+ children: /* @__PURE__ */ jsx(ArgoDesignContext, {
360
+ value: true,
361
+ children: buttons
362
+ })
363
+ })
364
+ ]
365
+ });
366
+ };
367
+ //#endregion
368
+ export { InlineEdit };
369
+
370
+ //# sourceMappingURL=InlineEdit-D5RdunZo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineEdit-D5RdunZo.js","names":[],"sources":["../src/blocks/InlineEdit/InlineEdit.tsx"],"sourcesContent":["import { useEffect, useId, useLayoutEffect, useRef, useState } from 'react';\nimport type { ChangeEvent, FocusEvent, KeyboardEvent, MouseEvent, ReactNode } from 'react';\n\nimport { Button } from '../../components/Button';\nimport { Kbd, keys } from '../../components/Kbd';\nimport { ArgoDesignContext } from '../../components/ThemeProvider/context';\nimport { Tooltip } from '../../components/Tooltip';\nimport { useAutosizeInput } from '../../hooks/useAutosizeInput';\nimport { Check, Loader2, X } from '../../icons';\nimport { cn } from '../../utils';\n\n/** A sized `fill` row at least this wide shows Save / Cancel as text; a narrower one as icons. */\nconst LABELLED_BUTTONS_MIN_WIDTH = 480;\n/** Below this a `multiline` field keeps the row and Save / Cancel move under it. */\nconst INLINE_BUTTONS_MIN_WIDTH = 320;\n/** How long the field and the buttons take to open and close. */\nconst EXPAND_MS = 200;\n\ntype Size = 'auto' | 'sm' | 'md' | 'lg' | 'title';\n\n/**\n * Box and button height per size; the font is always the surrounding one.\n *\n * - Buttons take the box's height, not the brand's own button height, so the row lines up.\n * - The box overhangs its line by the same amount it pads it, so the line box never changes.\n * - `auto` scales the icon buttons with the text instead of picking a fixed height.\n */\n// Class names are spelled out in full: Tailwind only generates the ones it can read here.\nconst SIZES = {\n auto: { box: 'tw:py-px tw:-my-[2px]', icon: 'icon-xs', label: 'medium', fit: '', iconFit: '' },\n sm: {\n box: 'tw:py-[max(1px,calc((1.5rem-1lh)/2-1px))] tw:-my-[max(2px,calc((1.5rem-1lh)/2))]',\n icon: 'icon-xs',\n label: 'small',\n fit: 'tw:h-6 tw:min-h-6 tw:max-h-6',\n iconFit: 'tw:size-6',\n },\n md: {\n box: 'tw:py-[max(1px,calc((2rem-1lh)/2-1px))] tw:-my-[max(2px,calc((2rem-1lh)/2))]',\n icon: 'icon-sm',\n label: 'small',\n fit: 'tw:h-8 tw:min-h-8 tw:max-h-8',\n iconFit: 'tw:size-8',\n },\n lg: {\n box: 'tw:py-[max(1px,calc((2.5rem-1lh)/2-1px))] tw:-my-[max(2px,calc((2.5rem-1lh)/2))]',\n icon: 'icon',\n label: 'medium',\n fit: 'tw:h-10 tw:min-h-10 tw:max-h-10',\n iconFit: 'tw:size-10',\n },\n title: {\n box: 'tw:py-[max(1px,calc((2.5rem-1lh)/2-1px))] tw:-my-[max(2px,calc((2.5rem-1lh)/2))]',\n icon: 'icon',\n label: 'medium',\n fit: 'tw:h-10 tw:min-h-10 tw:max-h-10',\n iconFit: 'tw:size-10',\n },\n} as const satisfies Record<\n Size,\n { box: string; icon: string; label: string; fit: string; iconFit: string }\n>;\n\n// One box in view and edit; only its colours change, so nothing moves and the change can animate.\n// - 1px border + 5px padding = the 6px the box shifts left, so the text stays where it was.\n// - A shift, not a negative margin: that would shrink the width a fit-content parent gives it.\n// - `leading-[inherit]` beats the 1.5 a Tooltip trigger's scoped preflight would set.\nconst BOX_CLASS = cn(\n 'tw:relative tw:-left-1.5 tw:rounded-md tw:border tw:px-[5px] tw:leading-[inherit]',\n 'tw:transition-[border-color,background-color,box-shadow] tw:duration-150 tw:ease-out',\n);\n\nconst VIEW_BOX_CLASS = cn(\n 'tw:border-transparent',\n 'tw:hover:border-input tw:hover:bg-muted-foreground/10',\n 'tw:has-[:focus-visible]:border-input tw:has-[:focus-visible]:bg-muted-foreground/10',\n);\n\n// The field takes the surrounding typography instead of the browser's form-control defaults.\nconst FIELD_CLASS = cn(\n 'tw:m-0 tw:block tw:border-0 tw:bg-transparent tw:p-0 tw:outline-hidden',\n 'tw:[font:inherit] tw:[letter-spacing:inherit] tw:[color:inherit]',\n 'tw:placeholder:text-muted-foreground',\n);\n\n// `auto` icon buttons scale with the text: 24px beside body copy, ~33px beside a page title.\nconst AUTO_ICON_BUTTON_CLASS = 'tw:size-[max(1.5rem,1.1em)] tw:text-[length:inherit]';\n\nconst ShortcutLabel = ({ label, shortcut }: { label: string; shortcut: string }) => (\n <span className=\"tw:inline-flex tw:items-center tw:gap-2\">\n {label}\n <Kbd variant=\"primary\">{shortcut}</Kbd>\n </span>\n);\n\n// Keeps focus in the field, so pressing a button never blurs it into an early save first.\nconst keepFieldFocus = (event: MouseEvent) => event.preventDefault();\n\ntype Props = {\n /** The text shown, and the draft while editing. */\n value: string;\n onChange: (value: string) => void;\n /** Enter, Save, or a blur with a valid change. */\n onSubmit: () => void;\n /** Escape, Cancel, or leaving the field with nothing changed. */\n onCancel: () => void;\n isEditing: boolean;\n /** Opens the editor from view mode; omit when the caller opens it some other way. */\n onEditStart?: () => void;\n /** Whether `value` differs from the saved value; nothing to save while false. */\n isChanged: boolean;\n /** A save is in flight: buttons and keys are held until it settles. */\n isSaving?: boolean;\n /** Why the draft can't be saved; disables Save and becomes its tooltip. */\n invalidReason?: string | null;\n /** Renders the value as plain text. */\n readOnly?: boolean;\n /** Fills the row while editing (default); `false` keeps the field as wide as its text. */\n fill?: boolean;\n /** Long text wraps and the field grows a line at a time; without it the field stays one line. */\n multiline?: boolean;\n /** Box height and buttons: sm 24, md 32, lg and title 40px, or `auto` to follow the text. */\n size?: Size;\n /** One line with an ellipsis in view mode; otherwise up to two lines. */\n truncate?: boolean;\n placeholder?: string;\n /** Tooltip on the value in view mode. */\n editTooltip?: ReactNode;\n tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';\n maxLength?: number;\n /** Accessible name of the field; defaults to `placeholder`. */\n 'aria-label'?: string;\n className?: string;\n};\n\n/**\n * Click-to-edit text: a page title, an entity name, a short label in a row.\n *\n * - The caller owns the draft and the editing flag, so it can validate, save and fail on its own terms.\n * - Enter saves a change and closes an unchanged edit; Escape cancels.\n * - Not for multi-paragraph or markdown text: use `MarkdownEditor`.\n */\nexport const InlineEdit = ({\n value,\n onChange,\n onSubmit,\n onCancel,\n isEditing,\n onEditStart,\n isChanged,\n isSaving = false,\n invalidReason = null,\n readOnly = false,\n fill = true,\n multiline = false,\n size = 'auto',\n truncate = false,\n placeholder = 'Click to edit',\n editTooltip = 'Click to edit',\n tooltipPlacement = 'top',\n maxLength,\n 'aria-label': ariaLabel,\n className,\n}: Props) => {\n const formRef = useRef<HTMLFormElement>(null);\n const viewButtonRef = useRef<HTMLButtonElement>(null);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const wasEditingRef = useRef(isEditing);\n const reasonId = useId();\n const { inputRef, inputStyle, sizerElement } = useAutosizeInput({ value, placeholder });\n const [rowWidth, setRowWidth] = useState(0);\n const boxRef = useRef<HTMLDivElement>(null);\n const buttonsRef = useRef<HTMLDivElement>(null);\n const boxWidthRef = useRef(0);\n // The width sizer mounts on first hover or focus, before the first open, not with every row.\n const [isPrimed, setIsPrimed] = useState(false);\n // Focus returning after an edit doesn't pop \"Click to edit\"; it shows again once the user moves on.\n const [isTipQuiet, setIsTipQuiet] = useState(false);\n\n const isValid = !invalidReason;\n const canSave = isChanged && isValid && !isSaving;\n // Text labels only beside a sized box: next to small `auto` text a 40px label would tower.\n const showLabels = fill && size !== 'auto' && rowWidth >= LABELLED_BUTTONS_MIN_WIDTH;\n const stackButtons = fill && multiline && rowWidth > 0 && rowWidth < INLINE_BUTTONS_MIN_WIDTH;\n const sizing = SIZES[size];\n\n useEffect(() => {\n const wasEditing = wasEditingRef.current;\n wasEditingRef.current = isEditing;\n\n if (isEditing) {\n const field = textareaRef.current ?? inputRef.current;\n field?.focus();\n field?.setSelectionRange(field.value.length, field.value.length);\n return;\n }\n\n if (!wasEditing) return;\n // oxlint-disable-next-line react-x/set-state-in-effect -- the close is a prop change, seen only here\n setIsTipQuiet(true);\n // Closing the editor removed the focused field; hand focus back to the value, not to <body>.\n if (!document.activeElement || document.activeElement === document.body) {\n viewButtonRef.current?.focus();\n }\n }, [isEditing, inputRef]);\n\n // Tracks the box's width, so a toggle knows where its animation starts.\n useLayoutEffect(() => {\n const box = boxRef.current;\n if (!box || typeof ResizeObserver === 'undefined') return;\n\n const observer = new ResizeObserver(() => {\n boxWidthRef.current = box.offsetWidth;\n });\n observer.observe(box);\n return () => observer.disconnect();\n }, []);\n\n // Grows the box from its text to the row and slides Save / Cancel open, then reverses both.\n // - Measured widths, not `fr` tracks: an `fr` track sized by its content doesn't transition.\n useLayoutEffect(() => {\n const box = boxRef.current;\n const buttons = buttonsRef.current;\n const from = boxWidthRef.current;\n if (!box || !buttons || !from) return;\n\n // A toggle mid-animation measures the box's own size, not the one the last animation holds.\n for (const running of box.getAnimations()) running.cancel();\n const to = box.offsetWidth;\n boxWidthRef.current = to;\n const reduceMotion = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;\n if (reduceMotion || typeof box.animate !== 'function') return;\n\n const timing = { duration: EXPAND_MS, easing: 'ease-out' };\n if (from !== to) {\n // An open `fill` box is a growing flex item, which ignores `width`; `max-width` holds it.\n const property = fill && isEditing ? 'maxWidth' : 'width';\n const field = textareaRef.current;\n // One line while it grows, so the text doesn't wrap and unwrap as the box widens.\n if (field) field.style.whiteSpace = 'nowrap';\n const animation = box.animate(\n [{ [property]: `${from}px` }, { [property]: `${to}px` }],\n timing,\n );\n // A closing `fill` field holds its row until it has shrunk:\n // - `data-expanded` stays on until the animation ends;\n // - `data-settled` then marks that a rename closed here, so what the row hid fades back in.\n const heldRow = fill && !isEditing ? formRef.current : null;\n if (heldRow) heldRow.dataset.expanded = 'true';\n animation.onfinish = () => {\n if (field) field.style.whiteSpace = '';\n if (!heldRow) return;\n delete heldRow.dataset.expanded;\n heldRow.dataset.settled = 'true';\n };\n }\n\n // - Clips only sideways, so buttons taller than the line keep their borders.\n // - Open buttons aren't clipped at all, so their focus rings show.\n for (const running of buttons.getAnimations()) running.cancel();\n const buttonsWidth = `${buttons.scrollWidth}px`;\n buttons.style.overflowX = 'clip';\n buttons.animate(\n isEditing\n ? [{ maxWidth: '0px' }, { maxWidth: buttonsWidth }]\n : [{ maxWidth: buttonsWidth }, { maxWidth: '0px' }],\n timing,\n ).onfinish = () => {\n buttons.style.overflowX = '';\n };\n }, [isEditing, fill]);\n\n useLayoutEffect(() => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n\n const fitHeight = () => {\n textarea.style.height = 'auto';\n textarea.style.height = `${textarea.scrollHeight}px`;\n };\n fitHeight();\n if (typeof ResizeObserver === 'undefined') return;\n\n const observer = new ResizeObserver(fitHeight);\n observer.observe(textarea);\n return () => observer.disconnect();\n }, [isEditing, value]);\n\n useLayoutEffect(() => {\n const form = formRef.current;\n if (!fill || !isEditing || !form) return;\n\n // Measured before paint, so the buttons never render at one size and settle at another.\n // `offsetWidth` is the layout width: a scale transform (an opening modal) doesn't change it.\n // oxlint-disable-next-line react-x/set-state-in-effect -- a layout read has to happen before paint\n const fitButtons = (width: number) => setRowWidth(width);\n fitButtons(form.offsetWidth);\n if (typeof ResizeObserver === 'undefined') return;\n\n const observer = new ResizeObserver(() => fitButtons(form.offsetWidth));\n observer.observe(form);\n return () => observer.disconnect();\n }, [fill, isEditing]);\n\n if (readOnly) {\n return <span className={cn(truncate && 'tw:block tw:truncate', className)}>{value}</span>;\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n event.stopPropagation();\n\n if (event.key === 'Escape') {\n event.preventDefault();\n if (!isSaving) onCancel();\n return;\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n if (isSaving) return;\n if (!isChanged) onCancel();\n else if (isValid) onSubmit();\n }\n };\n\n const handleBlur = (event: FocusEvent<HTMLFormElement>) => {\n if (!isEditing || isSaving) return;\n // Focus left the window (resizing it, switching apps), not the field: keep editing.\n if (!document.hasFocus()) return;\n const next = event.relatedTarget;\n if (next instanceof Node && event.currentTarget.contains(next)) return;\n if (!isChanged) onCancel();\n else if (isValid) onSubmit();\n };\n\n const handleChange = (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n onChange(multiline ? event.target.value.replace(/[\\r\\n]+/g, ' ') : event.target.value);\n };\n\n const fieldProps = {\n value,\n placeholder,\n maxLength,\n readOnly: isSaving,\n 'aria-label': ariaLabel ?? placeholder,\n 'aria-invalid': !isValid || undefined,\n 'aria-describedby': invalidReason ? reasonId : undefined,\n onChange: handleChange,\n onKeyDown: handleKeyDown,\n onKeyUp: (event: KeyboardEvent) => event.stopPropagation(),\n onClick: (event: MouseEvent) => event.stopPropagation(),\n };\n\n const saveTooltip = (() => {\n if (isSaving) return 'Saving…';\n if (!isChanged) return 'No changes to save';\n if (invalidReason) return invalidReason;\n return <ShortcutLabel label=\"Save\" shortcut={keys.enter.symbol} />;\n })();\n\n const iconButtonClass = size === 'auto' ? AUTO_ICON_BUTTON_CLASS : sizing.iconFit;\n // Labelled buttons match the box's height whatever the brand's own button height is.\n const labelButtonClass = sizing.fit;\n const buttonSize = showLabels ? sizing.label : sizing.icon;\n\n const view = (\n <Tooltip\n tooltip={editTooltip}\n placement={tooltipPlacement}\n forceHide={isTipQuiet}\n triggerAsChild\n >\n <button\n ref={viewButtonRef}\n type=\"button\"\n data-testid=\"inline-edit-trigger\"\n className={cn(\n 'tw:block tw:max-w-full tw:cursor-text tw:text-left tw:outline-hidden',\n 'tw:[font:inherit] tw:leading-[inherit] tw:[color:inherit]',\n // The whole box takes the click, not just the glyphs.\n 'tw:after:absolute tw:after:inset-0',\n truncate && 'tw:min-w-0 tw:truncate',\n )}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n onEditStart?.();\n }}\n onBlur={() => setIsTipQuiet(false)}\n onPointerLeave={() => setIsTipQuiet(false)}\n >\n {value ? (\n <span className={cn(!truncate && !multiline && 'tw:line-clamp-2', 'tw:break-words')}>\n {value}\n </span>\n ) : (\n <span className=\"tw:text-muted-foreground\">{placeholder}</span>\n )}\n </button>\n </Tooltip>\n );\n\n const field = multiline ? (\n <textarea\n ref={textareaRef}\n rows={1}\n className={cn(FIELD_CLASS, 'tw:w-full tw:resize-none tw:overflow-hidden tw:break-words')}\n {...fieldProps}\n />\n ) : (\n <input\n ref={inputRef}\n type=\"text\"\n className={cn(FIELD_CLASS, fill ? 'tw:w-full' : 'tw:max-w-full')}\n style={fill ? undefined : inputStyle}\n {...fieldProps}\n />\n );\n\n const buttons = (\n <div\n className={cn(\n 'tw:flex tw:items-center tw:gap-1',\n // - The gap lives inside the collapsing track, so a closed field leaves no trailing space.\n // - Beside the field the row is one line tall, so taller buttons overhang it evenly.\n stackButtons ? 'tw:pt-2' : 'tw:h-[1lh] tw:pl-2',\n 'tw:transition-opacity tw:duration-200 tw:ease-out',\n isEditing ? 'tw:opacity-100' : 'tw:opacity-0',\n )}\n >\n <Tooltip tooltip={saveTooltip} placement=\"top\" triggerAsChild>\n <span className={cn('tw:inline-flex', !canSave && 'tw:cursor-not-allowed')}>\n <Button\n type=\"submit\"\n variant=\"primary\"\n size={buttonSize}\n aria-label={showLabels ? undefined : 'Save'}\n isLoading={!showLabels && isSaving}\n disabled={!canSave}\n onMouseDown={keepFieldFocus}\n className={cn(\n 'tw:transition-colors',\n showLabels ? labelButtonClass : iconButtonClass,\n !canSave && 'tw:pointer-events-none',\n )}\n >\n {showLabels ? (\n // The spinner overlays the label, so Save keeps its width and Cancel stays put.\n <>\n <span className={cn(isSaving && 'tw:invisible')}>Save</span>\n {isSaving && <Loader2 className=\"tw:absolute tw:size-4 tw:animate-spin\" />}\n </>\n ) : (\n <Check />\n )}\n </Button>\n </span>\n </Tooltip>\n <Tooltip\n tooltip={<ShortcutLabel label=\"Cancel\" shortcut=\"Esc\" />}\n placement=\"top\"\n triggerAsChild\n >\n <Button\n type=\"button\"\n variant=\"outline\"\n size={buttonSize}\n aria-label={showLabels ? undefined : 'Cancel'}\n disabled={isSaving}\n className={cn('tw:transition-colors', showLabels ? labelButtonClass : iconButtonClass)}\n onMouseDown={keepFieldFocus}\n onClick={(event) => {\n event.stopPropagation();\n onCancel();\n }}\n >\n {showLabels ? 'Cancel' : <X />}\n </Button>\n </Tooltip>\n </div>\n );\n\n return (\n <form\n ref={formRef}\n data-slot=\"inline-edit\"\n data-state={isEditing ? 'edit' : 'view'}\n data-expanded={(fill && isEditing) || undefined}\n aria-busy={isSaving || undefined}\n className={cn(\n 'tw:leading-[inherit]',\n // Top-aligned: Save / Cancel sit on the first line however many lines the text wraps to.\n fill && isEditing\n ? 'tw:flex tw:w-full tw:min-w-0 tw:items-start'\n : 'tw:inline-flex tw:max-w-full tw:items-center',\n // Only a wrapping title moves Save / Cancel under the field; one line keeps them beside it.\n fill && isEditing && multiline && 'tw:flex-wrap',\n truncate && !isEditing && 'tw:flex tw:min-w-0',\n className,\n )}\n onSubmit={(event) => {\n event.preventDefault();\n if (canSave) onSubmit();\n }}\n onBlur={handleBlur}\n // Escape on Save / Cancel cancels too; the field handles its own keys first.\n onKeyDown={(event) => {\n if (event.key !== 'Escape' || !isEditing) return;\n event.preventDefault();\n event.stopPropagation();\n if (!isSaving) onCancel();\n }}\n >\n <div\n ref={boxRef}\n onPointerEnter={() => setIsPrimed(true)}\n onFocus={() => setIsPrimed(true)}\n className={cn(\n BOX_CLASS,\n sizing.box,\n 'tw:min-w-0',\n fill && isEditing && 'tw:flex-1',\n fill && isEditing && multiline && 'tw:min-w-[min(100%,12rem)]',\n !isEditing && VIEW_BOX_CLASS,\n isEditing &&\n (isValid\n ? 'tw:border-ring tw:bg-input-background tw:ring-3 tw:ring-ring/25'\n : 'tw:border-destructive tw:bg-input-background tw:ring-3 tw:ring-destructive/20'),\n isEditing && !fill && !multiline && 'tw:inline-flex',\n )}\n >\n {isEditing ? field : view}\n {/* Measures from first hover, so the first open already knows the field's width. */}\n {!fill && !multiline && (isPrimed || isEditing) && (\n <span aria-hidden className=\"tw:absolute tw:size-0 tw:overflow-hidden\">\n {sizerElement}\n </span>\n )}\n </div>\n {isEditing && invalidReason && (\n <span id={reasonId} className=\"tw:sr-only\" aria-live=\"polite\">\n {invalidReason}\n </span>\n )}\n {/* Stays mounted, inert while closed, so it can slide shut after Save / Cancel. */}\n <div\n ref={buttonsRef}\n inert={!isEditing}\n aria-hidden={!isEditing || undefined}\n className={cn(\n fill ? 'tw:self-start' : 'tw:self-center',\n !isEditing && 'tw:max-w-0 tw:overflow-x-clip',\n stackButtons && isEditing && 'tw:basis-full',\n )}\n >\n {/* Argo on every brand, so Save / Cancel look the same on legacy pages too. */}\n <ArgoDesignContext value>{buttons}</ArgoDesignContext>\n </div>\n </form>\n );\n};\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,6BAA6B;;AAEnC,MAAM,2BAA2B;;AAEjC,MAAM,YAAY;;;;;;;;AAYlB,MAAM,QAAQ;CACZ,MAAM;EAAE,KAAK;EAAyB,MAAM;EAAW,OAAO;EAAU,KAAK;EAAI,SAAS;CAAG;CAC7F,IAAI;EACF,KAAK;EACL,MAAM;EACN,OAAO;EACP,KAAK;EACL,SAAS;CACX;CACA,IAAI;EACF,KAAK;EACL,MAAM;EACN,OAAO;EACP,KAAK;EACL,SAAS;CACX;CACA,IAAI;EACF,KAAK;EACL,MAAM;EACN,OAAO;EACP,KAAK;EACL,SAAS;CACX;CACA,OAAO;EACL,KAAK;EACL,MAAM;EACN,OAAO;EACP,KAAK;EACL,SAAS;CACX;AACF;AASA,MAAM,YAAY,GAChB,qFACA,sFACF;AAEA,MAAM,iBAAiB,GACrB,yBACA,yDACA,qFACF;AAGA,MAAM,cAAc,GAClB,0EACA,oEACA,sCACF;AAGA,MAAM,yBAAyB;AAE/B,MAAM,iBAAiB,EAAE,OAAO,eAC9B,qBAAC,QAAD;CAAM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AM,IAAI;IAAU,WAAU;IAAa,aAAU;IAClD,UAAA;GACG,CAAA;GAGR,oBAAC,OAAD;IACE,KAAK;IACL,OAAO,CAAC;IACR,eAAa,CAAC,aAAa,KAAA;IAC3B,WAAW,GACT,OAAO,kBAAkB,kBACzB,CAAC,aAAa,iCACd,gBAAgB,aAAa,eAC/B;IAGA,UAAA,oBAAC,mBAAD;KAAmB,OAAA;KAAO,UAAA;IAA2B,CAAA;GAClD,CAAA;EACD;;AAEV"}
@@ -1,6 +1,6 @@
1
- import { cn } from "./classNames-BzrkDnOD.js";
1
+ import { cn } from "./classNames-DcGnTh2N.js";
2
2
  import { useArgoDesign } from "./context-U293r3v-.js";
3
- import { Button } from "./Button-B21oVcPU.js";
3
+ import { Button } from "./Button-D2JqBAq7.js";
4
4
  import { cva } from "class-variance-authority";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import TextareaAutosize from "react-textarea-autosize";
@@ -230,7 +230,7 @@ const inputGroupVariants = cva([
230
230
  "tw:bg-muted",
231
231
  "tw:border-input",
232
232
  "tw:text-foreground",
233
- "tw:has-[:is(input,textarea):disabled]:opacity-50",
233
+ "tw:has-[:is(input,textarea):disabled]:opacity-disabled",
234
234
  "tw:has-[:is(input,textarea)[readonly]]:bg-muted",
235
235
  "tw:has-[:is(input,textarea)[readonly]]:border-input",
236
236
  "tw:has-[:is(input,textarea)[readonly]:focus]:border-input",
@@ -296,4 +296,4 @@ InputGroup.Text = InputGroupText;
296
296
  //#endregion
297
297
  export { InputGroup };
298
298
 
299
- //# sourceMappingURL=InputGroup-CrlMRz4X.js.map
299
+ //# sourceMappingURL=InputGroup-Dm014ruw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputGroup-CrlMRz4X.js","names":[],"sources":["../src/components/InputGroup/InputGroupAddon.tsx","../src/components/InputGroup/InputGroupButton.tsx","../src/components/InputGroup/InputGroupInput.tsx","../src/components/InputGroup/InputGroupText.tsx","../src/components/InputGroup/InputGroupTextArea.tsx","../src/components/InputGroup/InputGroup.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\n\n// Padding only fires when the addon actually has content — keeps an empty\n// `<Addon>{maybeNull}</Addon>` from carving 16px out of the input row.\nconst addonVariants = cva(\n [\n 'tw:flex',\n 'tw:items-center',\n 'tw:gap-1',\n\n // Default size for nested Lucide icons in prefix/suffix slots; 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 align: 'inline-start',\n },\n variants: {\n align: {\n 'inline-start': ['tw:order-first', 'tw:shrink-0', 'tw:[&:not(:empty)]:pl-4'],\n 'inline-end': ['tw:order-last', 'tw:shrink-0', 'tw:[&:not(:empty)]:pr-4'],\n 'block-start': [\n 'tw:order-first',\n // `tw:w-full` needs to be empty-conditional too — when the addon\n // has no content the root stays in flex-row, and a 100%-wide\n // empty addon would claim half of the input row beside the input.\n 'tw:[&:not(:empty)]:w-full',\n 'tw:[&:not(:empty)]:px-4',\n 'tw:[&:not(:empty)]:py-1.5',\n ],\n 'block-end': [\n 'tw:order-last',\n 'tw:[&:not(:empty)]:w-full',\n 'tw:[&:not(:empty)]:px-4',\n 'tw:[&:not(:empty)]:py-1.5',\n ],\n },\n },\n },\n);\n\ntype Props = ComponentProps<'div'> & VariantProps<typeof addonVariants>;\n\nexport const InputGroupAddon = ({\n children,\n align = 'inline-start',\n className,\n ...props\n}: Props) => (\n <div {...props} data-align={align} className={cn(addonVariants({ align, className }))}>\n {children}\n </div>\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\n\ntype ButtonProps = ComponentProps<typeof Button>;\n\ntype Props = Omit<ButtonProps, 'size' | 'block' | 'variant'>;\n\nexport const InputGroupButton = ({ ref, className, tabIndex = -1, ...props }: Props) => (\n <Button\n {...props}\n tabIndex={tabIndex}\n ref={ref}\n variant=\"invisible\"\n size=\"icon-sm\"\n className={cn('tw:size-5', 'tw:[&_svg]:text-muted-foreground', className)}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'input'>;\n\nexport const InputGroupInput = ({ ref, className, ...inputProps }: Props) => (\n <input\n {...inputProps}\n ref={ref}\n className={cn(\n 'tw:flex-1',\n 'tw:min-w-0',\n 'tw:bg-transparent',\n 'tw:outline-hidden',\n\n // font\n 'tw:font-sans',\n 'tw:text-sm',\n\n // placeholder\n 'tw:placeholder:text-neutral-400',\n 'tw:placeholder:font-normal',\n\n // disabled\n 'tw:disabled:cursor-not-allowed',\n\n className,\n )}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'span'>;\n\nexport const InputGroupText = ({ className, ...props }: Props) => (\n <span\n className={cn(\n 'tw:flex',\n 'tw:items-center',\n 'tw:gap-2',\n 'tw:text-sm',\n 'tw:text-muted-foreground',\n 'tw:[&_svg]:pointer-events-none',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4',\n className,\n )}\n {...props}\n />\n);\n","import type { ChangeEventHandler, ComponentProps, FocusEventHandler } from 'react';\nimport TextareaAutosize from 'react-textarea-autosize';\n\nimport { cn } from '../../utils';\n\ntype TextareaNativeProps = Omit<\n ComponentProps<typeof TextareaAutosize>,\n 'value' | 'defaultValue' | 'rows' | 'maxRows'\n>;\n\ntype Props = TextareaNativeProps & {\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (value: string) => void;\n onValueBlur?: (value: string) => void;\n maxRows?: number | 'unlimited';\n disableResize?: boolean;\n};\n\nexport const InputGroupTextArea = ({\n ref,\n className,\n onChange,\n onValueChange,\n value,\n defaultValue,\n onBlur,\n onValueBlur,\n disableResize = false,\n minRows = 1,\n maxRows = 4,\n ...props\n}: Props) => {\n const handleChange: ChangeEventHandler<HTMLTextAreaElement> = (event) => {\n onValueChange?.(event.target.value);\n onChange?.(event);\n };\n\n const handleBlur: FocusEventHandler<HTMLTextAreaElement> = (event) => {\n onValueBlur?.(event.target.value);\n onBlur?.(event);\n };\n\n return (\n <TextareaAutosize\n {...props}\n ref={ref}\n value={value ?? undefined}\n defaultValue={defaultValue ?? undefined}\n onChange={handleChange}\n onBlur={handleBlur}\n minRows={minRows}\n maxRows={maxRows === 'unlimited' ? undefined : maxRows}\n className={cn(\n 'tw:w-full',\n 'tw:bg-transparent',\n 'tw:outline-hidden',\n 'tw:px-4',\n\n // font\n 'tw:font-sans',\n 'tw:text-sm',\n\n // placeholder\n 'tw:placeholder:text-neutral-400',\n 'tw:placeholder:font-normal',\n\n // disabled\n 'tw:disabled:cursor-not-allowed',\n {\n 'tw:resize-none': disableResize,\n },\n\n className,\n )}\n />\n );\n};\n","import type { ComponentPropsWithRef } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { InputGroupAddon } from './InputGroupAddon';\nimport { InputGroupButton } from './InputGroupButton';\nimport { InputGroupInput } from './InputGroupInput';\nimport { InputGroupText } from './InputGroupText';\nimport { InputGroupTextArea } from './InputGroupTextArea';\n\nconst inputGroupVariants = cva(\n [\n 'tailwindcss-preflight',\n 'tw:group',\n\n 'tw:overflow-hidden',\n 'tw:box-border',\n\n // positioning\n 'tw:flex',\n 'tw:items-center',\n // A flex item's default `min-width: auto` floors the group at its content's intrinsic width,\n // so a constrained row (several groups side by side) overflows rather than sharing the space.\n // The group clips its own content anyway, and the input inside already carries `min-w-0`.\n 'tw:min-w-0',\n\n // base — legacy (non-argo) chrome uses a fixed radius; argo overrides it with\n // the brand radius token in the `argo` variant below.\n 'tw:rounded',\n 'tw:border',\n 'tw:border-solid',\n // `border-input` and `text-foreground` follow the colour scheme.\n 'tw:border-input',\n 'tw:text-foreground',\n 'tw:transition',\n\n // focus\n 'tw:has-[:is(input,textarea):focus]:ring-4',\n\n // readonly\n 'tw:has-[:is(input,textarea)[readonly]]:bg-muted',\n 'tw:has-[:is(input,textarea)[readonly]]:focus-within:ring-0',\n 'tw:has-[:is(input,textarea)[readonly]]:border-input',\n\n // disabled cursor (opacity owned by variant)\n 'tw:has-[:is(input,textarea):disabled]:cursor-not-allowed',\n\n // textarea: top-align addons, allow vertical expansion, own its y-padding\n 'tw:has-[textarea]:items-start',\n\n 'tw:has-[[data-align=block-start]:not(:empty)]:flex-wrap',\n 'tw:has-[[data-align=block-end]:not(:empty)]:flex-wrap',\n 'tw:[&>input]:has-[[data-align=block-start]:not(:empty)]:w-auto',\n 'tw:[&>input]:has-[[data-align=block-start]:not(:empty)]:flex-1',\n 'tw:[&>input]:has-[[data-align=block-end]:not(:empty)]:w-auto',\n 'tw:[&>input]:has-[[data-align=block-end]:not(:empty)]:flex-1',\n\n 'tw:[&_input]:px-4',\n 'tw:[&>input]:has-[[data-align=inline-start]:not(:empty)]:pl-2',\n 'tw:[&>input]:has-[[data-align=inline-end]:not(:empty)]:pr-2',\n ],\n {\n defaultVariants: {\n variant: 'primary',\n state: 'default',\n sizing: 'medium',\n focusVariant: 'default',\n },\n compoundVariants: [\n {\n variant: 'secondary',\n state: 'error',\n // The fixed light fill needs pinned dark text — `foreground` is near-white in dark.\n className: ['tw:bg-error-100', 'tw:text-neutral-800'],\n },\n {\n variant: 'secondary',\n state: 'warning',\n // Same pin as `error` above.\n className: ['tw:bg-warning-100', 'tw:text-neutral-800'],\n },\n {\n variant: 'primary',\n state: 'default',\n focusVariant: 'off',\n className: ['tw:has-[:is(input,textarea):focus]:border-neutral-200'],\n },\n {\n variant: 'secondary',\n state: 'default',\n focusVariant: 'off',\n className: ['tw:has-[:is(input,textarea):focus]:border-secondary'],\n },\n {\n variant: ['primary', 'secondary'],\n state: 'error',\n focusVariant: 'on',\n className: ['tw:!border-error-500', 'tw:!ring-error-200'],\n },\n {\n variant: ['primary', 'secondary'],\n state: 'warning',\n focusVariant: 'on',\n className: ['tw:!border-warning-500', 'tw:!ring-warning-200'],\n },\n // --- argo ---\n {\n variant: 'argo',\n state: 'default',\n className: [\n 'tw:has-[:is(input,textarea):focus]:border-primary',\n 'tw:has-[:is(input,textarea):focus]:ring-ring/50',\n ],\n },\n {\n variant: 'argo',\n state: 'error',\n className: [\n 'tw:border-destructive',\n 'tw:has-[:is(input,textarea):focus]:border-destructive',\n 'tw:has-[:is(input,textarea):focus]:ring-destructive/20',\n ],\n },\n {\n variant: 'argo',\n focusVariant: 'on',\n className: ['tw:!border-primary', 'tw:!ring-ring/50'],\n },\n {\n variant: 'argo',\n state: 'error',\n focusVariant: 'on',\n className: ['tw:!border-destructive', 'tw:!ring-destructive/20'],\n },\n {\n variant: 'argo',\n state: 'default',\n focusVariant: 'off',\n className: ['tw:has-[:is(input,textarea):focus]:border-input'],\n },\n ],\n variants: {\n focusVariant: {\n default: [],\n on: ['tw:!border-ring', 'tw:!ring-ring/30', 'tw:!ring-4'],\n off: ['tw:has-[:is(input,textarea):focus]:!ring-0'],\n },\n variant: {\n primary: [\n // The field-surface token — white in the light scheme, so this is a\n // no-op there; the dark scheme gets a field fill, not a white slab.\n 'tw:bg-input-background',\n 'tw:text-foreground',\n 'tw:has-[:is(input,textarea):disabled]:opacity-40',\n // aria-invalid on the control surfaces the error chrome without a `state` prop — the\n // accessible path (mirrors the `state=\"error\"` legacy tokens). Higher specificity than\n // the default focus selector, so it wins without `!important`.\n 'tw:has-[:is(input,textarea)[aria-invalid=true]]:border-error-500',\n 'tw:has-[:is(input,textarea)[aria-invalid=true]:focus]:border-error-500',\n 'tw:has-[:is(input,textarea)[aria-invalid=true]:focus]:ring-error-200',\n ],\n secondary: [\n 'tw:bg-secondary',\n 'tw:border-secondary',\n 'tw:has-[:is(input,textarea):disabled]:opacity-40',\n 'tw:has-[:is(input,textarea)[aria-invalid=true]]:border-error-500',\n 'tw:has-[:is(input,textarea)[aria-invalid=true]:focus]:border-error-500',\n 'tw:has-[:is(input,textarea)[aria-invalid=true]:focus]:ring-error-200',\n ],\n argo: [\n // argo follows the brand radius token (overrides the static base)\n 'tw:rounded-[var(--radius-lg,0.25rem)]',\n // muted filled input surface — gray, distinct from white containers; not the app-background token.\n // Deliberately `muted`, not the `input-background` field token legacy uses: argo's field is a\n // grey inset by design. Converging the two is a brand-value decision, not a component one.\n 'tw:bg-muted',\n 'tw:border-input',\n 'tw:text-foreground',\n 'tw:has-[:is(input,textarea):disabled]:opacity-50',\n // readonly: muted fill, input border — same pair as the editable argo field.\n 'tw:has-[:is(input,textarea)[readonly]]:bg-muted',\n 'tw:has-[:is(input,textarea)[readonly]]:border-input',\n // higher specificity than has-[:is(input,textarea):focus] — prevents focus border on readonly\n 'tw:has-[:is(input,textarea)[readonly]:focus]:border-input',\n // aria-invalid on the control surfaces the error chrome without a `state` prop — the\n // accessible path (uses the themeable `destructive` status token).\n 'tw:has-[:is(input,textarea)[aria-invalid=true]]:border-destructive',\n 'tw:has-[:is(input,textarea)[aria-invalid=true]:focus]:border-destructive',\n 'tw:has-[:is(input,textarea)[aria-invalid=true]:focus]:ring-destructive/20',\n ],\n },\n sizing: {\n default: [\n 'tw:[&_:is(input,textarea)]:py-2.5',\n 'tw:[&_:is(input,textarea)]:leading-[18px]',\n 'tw:[&_textarea]:!min-h-[calc(2.5rem-2px)]',\n ],\n small: [\n 'tw:[&_:is(input,textarea)]:py-2',\n 'tw:[&_:is(input,textarea)]:leading-[16px]',\n 'tw:[&_textarea]:!min-h-[calc(2rem-2px)]',\n ],\n medium: [\n 'tw:[&_:is(input,textarea)]:py-2',\n 'tw:[&_:is(input,textarea)]:leading-[18px]',\n 'tw:[&_textarea]:!min-h-[calc(2.25rem-2px)]',\n ],\n },\n state: {\n default: [\n 'tw:has-[:is(input,textarea):focus]:border-ring',\n 'tw:has-[:is(input,textarea):focus]:ring-ring/30',\n ],\n error: [\n 'tw:border-error-500',\n 'tw:has-[:is(input,textarea):focus]:border-error-500',\n 'tw:has-[:is(input,textarea):focus]:ring-error-200',\n ],\n warning: [\n 'tw:border-warning-500',\n 'tw:has-[:is(input,textarea):focus]:border-warning-500',\n 'tw:has-[:is(input,textarea):focus]:ring-warning-200',\n ],\n },\n },\n },\n);\n\ntype Props = ComponentPropsWithRef<'div'> &\n Omit<VariantProps<typeof inputGroupVariants>, 'variant'> & {\n variant?: Exclude<VariantProps<typeof inputGroupVariants>['variant'], 'argo'>;\n };\n\nconst InputGroupRoot = ({\n ref,\n children,\n state,\n variant,\n sizing,\n focusVariant,\n className,\n ...props\n}: Props) => {\n const isArgo = useArgoDesign();\n const effectiveVariant = isArgo ? 'argo' : variant;\n const effectiveSizing = effectiveVariant === 'argo' ? 'medium' : sizing;\n return (\n <div\n {...props}\n ref={ref}\n className={cn(\n inputGroupVariants({\n state,\n variant: effectiveVariant,\n sizing: effectiveSizing,\n focusVariant,\n className,\n }),\n )}\n >\n {children}\n </div>\n );\n};\n\nexport const InputGroup = InputGroupRoot as typeof InputGroupRoot & {\n Input: typeof InputGroupInput;\n Addon: typeof InputGroupAddon;\n Button: typeof InputGroupButton;\n TextArea: typeof InputGroupTextArea;\n Text: typeof InputGroupText;\n};\n\nInputGroup.Input = InputGroupInput;\nInputGroup.Addon = InputGroupAddon;\nInputGroup.Button = InputGroupButton;\nInputGroup.TextArea = InputGroupTextArea;\nInputGroup.Text = InputGroupText;\n"],"mappings":";;;;;;;AAOA,MAAM,gBAAgB,IACpB;CACE;CACA;CACA;CAGA;CACA;AACF,GACA;CACE,iBAAiB,EACf,OAAO,eACT;CACA,UAAU,EACR,OAAO;EACL,gBAAgB;GAAC;GAAkB;GAAe;EAAyB;EAC3E,cAAc;GAAC;GAAiB;GAAe;EAAyB;EACxE,eAAe;GACb;GAIA;GACA;GACA;EACF;EACA,aAAa;GACX;GACA;GACA;GACA;EACF;CACF,EACF;AACF,CACF;AAIA,MAAa,mBAAmB,EAC9B,UACA,QAAQ,gBACR,WACA,GAAG,YAEH,oBAAC,OAAD;CAAK,GAAI;CAAO,cAAY;CAAO,WAAW,GAAG,cAAc;EAAE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ACA;CACA;CAEA;CACA;CACA;AACF,GACA;CACE,iBAAiB;EACf,SAAS;EACT,OAAO;EACP,QAAQ;EACR,cAAc;CAChB;CACA,kBAAkB;EAChB;GACE,SAAS;GACT,OAAO;GAEP,WAAW,CAAC,mBAAmB,qBAAqB;EACtD;EACA;GACE,SAAS;GACT,OAAO;GAEP,WAAW,CAAC,qBAAqB,qBAAqB;EACxD;EACA;GACE,SAAS;GACT,OAAO;GACP,cAAc;GACd,WAAW,CAAC,uDAAuD;EACrE;EACA;GACE,SAAS;GACT,OAAO;GACP,cAAc;GACd,WAAW,CAAC,qDAAqD;EACnE;EACA;GACE,SAAS,CAAC,WAAW,WAAW;GAChC,OAAO;GACP,cAAc;GACd,WAAW,CAAC,wBAAwB,oBAAoB;EAC1D;EACA;GACE,SAAS,CAAC,WAAW,WAAW;GAChC,OAAO;GACP,cAAc;GACd,WAAW,CAAC,0BAA0B,sBAAsB;EAC9D;EAEA;GACE,SAAS;GACT,OAAO;GACP,WAAW,CACT,qDACA,iDACF;EACF;EACA;GACE,SAAS;GACT,OAAO;GACP,WAAW;IACT;IACA;IACA;GACF;EACF;EACA;GACE,SAAS;GACT,cAAc;GACd,WAAW,CAAC,sBAAsB,kBAAkB;EACtD;EACA;GACE,SAAS;GACT,OAAO;GACP,cAAc;GACd,WAAW,CAAC,0BAA0B,yBAAyB;EACjE;EACA;GACE,SAAS;GACT,OAAO;GACP,cAAc;GACd,WAAW,CAAC,iDAAiD;EAC/D;CACF;CACA,UAAU;EACR,cAAc;GACZ,SAAS,CAAC;GACV,IAAI;IAAC;IAAmB;IAAoB;GAAY;GACxD,KAAK,CAAC,4CAA4C;EACpD;EACA,SAAS;GACP,SAAS;IAGP;IACA;IACA;IAIA;IACA;IACA;GACF;GACA,WAAW;IACT;IACA;IACA;IACA;IACA;IACA;GACF;GACA,MAAM;IAEJ;IAIA;IACA;IACA;IACA;IAEA;IACA;IAEA;IAGA;IACA;IACA;GACF;EACF;EACA,QAAQ;GACN,SAAS;IACP;IACA;IACA;GACF;GACA,OAAO;IACL;IACA;IACA;GACF;GACA,QAAQ;IACN;IACA;IACA;GACF;EACF;EACA,OAAO;GACL,SAAS,CACP,kDACA,iDACF;GACA,OAAO;IACL;IACA;IACA;GACF;GACA,SAAS;IACP;IACA;IACA;GACF;EACF;CACF;AACF,CACF;AAOA,MAAM,kBAAkB,EACtB,KACA,UACA,OACA,SACA,QACA,cACA,WACA,GAAG,YACQ;CAEX,MAAM,mBADS,cACe,IAAI,SAAS;CAC3C,MAAM,kBAAkB,qBAAqB,SAAS,WAAW;CACjE,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GACT,mBAAmB;GACjB;GACA,SAAS;GACT,QAAQ;GACR;GACA;EACF,CAAC,CACH;EAEC;CACE,CAAA;AAET;AAEA,MAAa,aAAa;AAQ1B,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,WAAW,WAAW;AACtB,WAAW,OAAO"}
1
+ {"version":3,"file":"InputGroup-Dm014ruw.js","names":[],"sources":["../src/components/InputGroup/InputGroupAddon.tsx","../src/components/InputGroup/InputGroupButton.tsx","../src/components/InputGroup/InputGroupInput.tsx","../src/components/InputGroup/InputGroupText.tsx","../src/components/InputGroup/InputGroupTextArea.tsx","../src/components/InputGroup/InputGroup.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\n\n// Padding only fires when the addon actually has content — keeps an empty\n// `<Addon>{maybeNull}</Addon>` from carving 16px out of the input row.\nconst addonVariants = cva(\n [\n 'tw:flex',\n 'tw:items-center',\n 'tw:gap-1',\n\n // Default size for nested Lucide icons in prefix/suffix slots; 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 align: 'inline-start',\n },\n variants: {\n align: {\n 'inline-start': ['tw:order-first', 'tw:shrink-0', 'tw:[&:not(:empty)]:pl-4'],\n 'inline-end': ['tw:order-last', 'tw:shrink-0', 'tw:[&:not(:empty)]:pr-4'],\n 'block-start': [\n 'tw:order-first',\n // `tw:w-full` needs to be empty-conditional too — when the addon\n // has no content the root stays in flex-row, and a 100%-wide\n // empty addon would claim half of the input row beside the input.\n 'tw:[&:not(:empty)]:w-full',\n 'tw:[&:not(:empty)]:px-4',\n 'tw:[&:not(:empty)]:py-1.5',\n ],\n 'block-end': [\n 'tw:order-last',\n 'tw:[&:not(:empty)]:w-full',\n 'tw:[&:not(:empty)]:px-4',\n 'tw:[&:not(:empty)]:py-1.5',\n ],\n },\n },\n },\n);\n\ntype Props = ComponentProps<'div'> & VariantProps<typeof addonVariants>;\n\nexport const InputGroupAddon = ({\n children,\n align = 'inline-start',\n className,\n ...props\n}: Props) => (\n <div {...props} data-align={align} className={cn(addonVariants({ align, className }))}>\n {children}\n </div>\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\n\ntype ButtonProps = ComponentProps<typeof Button>;\n\ntype Props = Omit<ButtonProps, 'size' | 'block' | 'variant'>;\n\nexport const InputGroupButton = ({ ref, className, tabIndex = -1, ...props }: Props) => (\n <Button\n {...props}\n tabIndex={tabIndex}\n ref={ref}\n variant=\"invisible\"\n size=\"icon-sm\"\n className={cn('tw:size-5', 'tw:[&_svg]:text-muted-foreground', className)}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'input'>;\n\nexport const InputGroupInput = ({ ref, className, ...inputProps }: Props) => (\n <input\n {...inputProps}\n ref={ref}\n className={cn(\n 'tw:flex-1',\n 'tw:min-w-0',\n 'tw:bg-transparent',\n 'tw:outline-hidden',\n\n // font\n 'tw:font-sans',\n 'tw:text-sm',\n\n // placeholder\n 'tw:placeholder:text-neutral-400',\n 'tw:placeholder:font-normal',\n\n // disabled\n 'tw:disabled:cursor-not-allowed',\n\n className,\n )}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'span'>;\n\nexport const InputGroupText = ({ className, ...props }: Props) => (\n <span\n className={cn(\n 'tw:flex',\n 'tw:items-center',\n 'tw:gap-2',\n 'tw:text-sm',\n 'tw:text-muted-foreground',\n 'tw:[&_svg]:pointer-events-none',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4',\n className,\n )}\n {...props}\n />\n);\n","import type { ChangeEventHandler, ComponentProps, FocusEventHandler } from 'react';\nimport TextareaAutosize from 'react-textarea-autosize';\n\nimport { cn } from '../../utils';\n\ntype TextareaNativeProps = Omit<\n ComponentProps<typeof TextareaAutosize>,\n 'value' | 'defaultValue' | 'rows' | 'maxRows'\n>;\n\ntype Props = TextareaNativeProps & {\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (value: string) => void;\n onValueBlur?: (value: string) => void;\n maxRows?: number | 'unlimited';\n disableResize?: boolean;\n};\n\nexport const InputGroupTextArea = ({\n ref,\n className,\n onChange,\n onValueChange,\n value,\n defaultValue,\n onBlur,\n onValueBlur,\n disableResize = false,\n minRows = 1,\n maxRows = 4,\n ...props\n}: Props) => {\n const handleChange: ChangeEventHandler<HTMLTextAreaElement> = (event) => {\n onValueChange?.(event.target.value);\n onChange?.(event);\n };\n\n const handleBlur: FocusEventHandler<HTMLTextAreaElement> = (event) => {\n onValueBlur?.(event.target.value);\n onBlur?.(event);\n };\n\n return (\n <TextareaAutosize\n {...props}\n ref={ref}\n value={value ?? undefined}\n defaultValue={defaultValue ?? undefined}\n onChange={handleChange}\n onBlur={handleBlur}\n minRows={minRows}\n maxRows={maxRows === 'unlimited' ? undefined : maxRows}\n className={cn(\n 'tw:w-full',\n 'tw:bg-transparent',\n 'tw:outline-hidden',\n 'tw:px-4',\n\n // font\n 'tw:font-sans',\n 'tw:text-sm',\n\n // placeholder\n 'tw:placeholder:text-neutral-400',\n 'tw:placeholder:font-normal',\n\n // disabled\n 'tw:disabled:cursor-not-allowed',\n {\n 'tw:resize-none': disableResize,\n },\n\n className,\n )}\n />\n );\n};\n","import type { ComponentPropsWithRef } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { InputGroupAddon } from './InputGroupAddon';\nimport { InputGroupButton } from './InputGroupButton';\nimport { InputGroupInput } from './InputGroupInput';\nimport { InputGroupText } from './InputGroupText';\nimport { InputGroupTextArea } from './InputGroupTextArea';\n\nconst inputGroupVariants = cva(\n [\n 'tailwindcss-preflight',\n 'tw:group',\n\n 'tw:overflow-hidden',\n 'tw:box-border',\n\n // positioning\n 'tw:flex',\n 'tw:items-center',\n // A flex item's default `min-width: auto` floors the group at its content's intrinsic width,\n // so a constrained row (several groups side by side) overflows rather than sharing the space.\n // The group clips its own content anyway, and the input inside already carries `min-w-0`.\n 'tw:min-w-0',\n\n // base — legacy (non-argo) chrome uses a fixed radius; argo overrides it with\n // the brand radius token in the `argo` variant below.\n 'tw:rounded',\n 'tw:border',\n 'tw:border-solid',\n // `border-input` and `text-foreground` follow the colour scheme.\n 'tw:border-input',\n 'tw:text-foreground',\n 'tw:transition',\n\n // focus\n 'tw:has-[:is(input,textarea):focus]:ring-4',\n\n // readonly\n 'tw:has-[:is(input,textarea)[readonly]]:bg-muted',\n 'tw:has-[:is(input,textarea)[readonly]]:focus-within:ring-0',\n 'tw:has-[:is(input,textarea)[readonly]]:border-input',\n\n // disabled cursor (opacity owned by variant)\n 'tw:has-[:is(input,textarea):disabled]:cursor-not-allowed',\n\n // textarea: top-align addons, allow vertical expansion, own its y-padding\n 'tw:has-[textarea]:items-start',\n\n 'tw:has-[[data-align=block-start]:not(:empty)]:flex-wrap',\n 'tw:has-[[data-align=block-end]:not(:empty)]:flex-wrap',\n 'tw:[&>input]:has-[[data-align=block-start]:not(:empty)]:w-auto',\n 'tw:[&>input]:has-[[data-align=block-start]:not(:empty)]:flex-1',\n 'tw:[&>input]:has-[[data-align=block-end]:not(:empty)]:w-auto',\n 'tw:[&>input]:has-[[data-align=block-end]:not(:empty)]:flex-1',\n\n 'tw:[&_input]:px-4',\n 'tw:[&>input]:has-[[data-align=inline-start]:not(:empty)]:pl-2',\n 'tw:[&>input]:has-[[data-align=inline-end]:not(:empty)]:pr-2',\n ],\n {\n defaultVariants: {\n variant: 'primary',\n state: 'default',\n sizing: 'medium',\n focusVariant: 'default',\n },\n compoundVariants: [\n {\n variant: 'secondary',\n state: 'error',\n // The fixed light fill needs pinned dark text — `foreground` is near-white in dark.\n className: ['tw:bg-error-100', 'tw:text-neutral-800'],\n },\n {\n variant: 'secondary',\n state: 'warning',\n // Same pin as `error` above.\n className: ['tw:bg-warning-100', 'tw:text-neutral-800'],\n },\n {\n variant: 'primary',\n state: 'default',\n focusVariant: 'off',\n className: ['tw:has-[:is(input,textarea):focus]:border-neutral-200'],\n },\n {\n variant: 'secondary',\n state: 'default',\n focusVariant: 'off',\n className: ['tw:has-[:is(input,textarea):focus]:border-secondary'],\n },\n {\n variant: ['primary', 'secondary'],\n state: 'error',\n focusVariant: 'on',\n className: ['tw:!border-error-500', 'tw:!ring-error-200'],\n },\n {\n variant: ['primary', 'secondary'],\n state: 'warning',\n focusVariant: 'on',\n className: ['tw:!border-warning-500', 'tw:!ring-warning-200'],\n },\n // --- argo ---\n {\n variant: 'argo',\n state: 'default',\n className: [\n 'tw:has-[:is(input,textarea):focus]:border-primary',\n 'tw:has-[:is(input,textarea):focus]:ring-ring/50',\n ],\n },\n {\n variant: 'argo',\n state: 'error',\n className: [\n 'tw:border-destructive',\n 'tw:has-[:is(input,textarea):focus]:border-destructive',\n 'tw:has-[:is(input,textarea):focus]:ring-destructive/20',\n ],\n },\n {\n variant: 'argo',\n focusVariant: 'on',\n className: ['tw:!border-primary', 'tw:!ring-ring/50'],\n },\n {\n variant: 'argo',\n state: 'error',\n focusVariant: 'on',\n className: ['tw:!border-destructive', 'tw:!ring-destructive/20'],\n },\n {\n variant: 'argo',\n state: 'default',\n focusVariant: 'off',\n className: ['tw:has-[:is(input,textarea):focus]:border-input'],\n },\n ],\n variants: {\n focusVariant: {\n default: [],\n on: ['tw:!border-ring', 'tw:!ring-ring/30', 'tw:!ring-4'],\n off: ['tw:has-[:is(input,textarea):focus]:!ring-0'],\n },\n variant: {\n primary: [\n // The field-surface token — white in the light scheme, so this is a\n // no-op there; the dark scheme gets a field fill, not a white slab.\n 'tw:bg-input-background',\n 'tw:text-foreground',\n 'tw:has-[:is(input,textarea):disabled]:opacity-40',\n // aria-invalid on the control surfaces the error chrome without a `state` prop — the\n // accessible path (mirrors the `state=\"error\"` legacy tokens). Higher specificity than\n // the default focus selector, so it wins without `!important`.\n 'tw:has-[:is(input,textarea)[aria-invalid=true]]:border-error-500',\n 'tw:has-[:is(input,textarea)[aria-invalid=true]:focus]:border-error-500',\n 'tw:has-[:is(input,textarea)[aria-invalid=true]:focus]:ring-error-200',\n ],\n secondary: [\n 'tw:bg-secondary',\n 'tw:border-secondary',\n 'tw:has-[:is(input,textarea):disabled]:opacity-40',\n 'tw:has-[:is(input,textarea)[aria-invalid=true]]:border-error-500',\n 'tw:has-[:is(input,textarea)[aria-invalid=true]:focus]:border-error-500',\n 'tw:has-[:is(input,textarea)[aria-invalid=true]:focus]:ring-error-200',\n ],\n argo: [\n // argo follows the brand radius token (overrides the static base)\n 'tw:rounded-[var(--radius-lg,0.25rem)]',\n // muted filled input surface — gray, distinct from white containers; not the app-background token.\n // Deliberately `muted`, not the `input-background` field token legacy uses: argo's field is a\n // grey inset by design. Converging the two is a brand-value decision, not a component one.\n 'tw:bg-muted',\n 'tw:border-input',\n 'tw:text-foreground',\n 'tw:has-[:is(input,textarea):disabled]:opacity-disabled',\n // readonly: muted fill, input border — same pair as the editable argo field.\n 'tw:has-[:is(input,textarea)[readonly]]:bg-muted',\n 'tw:has-[:is(input,textarea)[readonly]]:border-input',\n // higher specificity than has-[:is(input,textarea):focus] — prevents focus border on readonly\n 'tw:has-[:is(input,textarea)[readonly]:focus]:border-input',\n // aria-invalid on the control surfaces the error chrome without a `state` prop — the\n // accessible path (uses the themeable `destructive` status token).\n 'tw:has-[:is(input,textarea)[aria-invalid=true]]:border-destructive',\n 'tw:has-[:is(input,textarea)[aria-invalid=true]:focus]:border-destructive',\n 'tw:has-[:is(input,textarea)[aria-invalid=true]:focus]:ring-destructive/20',\n ],\n },\n sizing: {\n default: [\n 'tw:[&_:is(input,textarea)]:py-2.5',\n 'tw:[&_:is(input,textarea)]:leading-[18px]',\n 'tw:[&_textarea]:!min-h-[calc(2.5rem-2px)]',\n ],\n small: [\n 'tw:[&_:is(input,textarea)]:py-2',\n 'tw:[&_:is(input,textarea)]:leading-[16px]',\n 'tw:[&_textarea]:!min-h-[calc(2rem-2px)]',\n ],\n medium: [\n 'tw:[&_:is(input,textarea)]:py-2',\n 'tw:[&_:is(input,textarea)]:leading-[18px]',\n 'tw:[&_textarea]:!min-h-[calc(2.25rem-2px)]',\n ],\n },\n state: {\n default: [\n 'tw:has-[:is(input,textarea):focus]:border-ring',\n 'tw:has-[:is(input,textarea):focus]:ring-ring/30',\n ],\n error: [\n 'tw:border-error-500',\n 'tw:has-[:is(input,textarea):focus]:border-error-500',\n 'tw:has-[:is(input,textarea):focus]:ring-error-200',\n ],\n warning: [\n 'tw:border-warning-500',\n 'tw:has-[:is(input,textarea):focus]:border-warning-500',\n 'tw:has-[:is(input,textarea):focus]:ring-warning-200',\n ],\n },\n },\n },\n);\n\ntype Props = ComponentPropsWithRef<'div'> &\n Omit<VariantProps<typeof inputGroupVariants>, 'variant'> & {\n variant?: Exclude<VariantProps<typeof inputGroupVariants>['variant'], 'argo'>;\n };\n\nconst InputGroupRoot = ({\n ref,\n children,\n state,\n variant,\n sizing,\n focusVariant,\n className,\n ...props\n}: Props) => {\n const isArgo = useArgoDesign();\n const effectiveVariant = isArgo ? 'argo' : variant;\n const effectiveSizing = effectiveVariant === 'argo' ? 'medium' : sizing;\n return (\n <div\n {...props}\n ref={ref}\n className={cn(\n inputGroupVariants({\n state,\n variant: effectiveVariant,\n sizing: effectiveSizing,\n focusVariant,\n className,\n }),\n )}\n >\n {children}\n </div>\n );\n};\n\nexport const InputGroup = InputGroupRoot as typeof InputGroupRoot & {\n Input: typeof InputGroupInput;\n Addon: typeof InputGroupAddon;\n Button: typeof InputGroupButton;\n TextArea: typeof InputGroupTextArea;\n Text: typeof InputGroupText;\n};\n\nInputGroup.Input = InputGroupInput;\nInputGroup.Addon = InputGroupAddon;\nInputGroup.Button = InputGroupButton;\nInputGroup.TextArea = InputGroupTextArea;\nInputGroup.Text = InputGroupText;\n"],"mappings":";;;;;;;AAOA,MAAM,gBAAgB,IACpB;CACE;CACA;CACA;CAGA;CACA;AACF,GACA;CACE,iBAAiB,EACf,OAAO,eACT;CACA,UAAU,EACR,OAAO;EACL,gBAAgB;GAAC;GAAkB;GAAe;EAAyB;EAC3E,cAAc;GAAC;GAAiB;GAAe;EAAyB;EACxE,eAAe;GACb;GAIA;GACA;GACA;EACF;EACA,aAAa;GACX;GACA;GACA;GACA;EACF;CACF,EACF;AACF,CACF;AAIA,MAAa,mBAAmB,EAC9B,UACA,QAAQ,gBACR,WACA,GAAG,YAEH,oBAAC,OAAD;CAAK,GAAI;CAAO,cAAY;CAAO,WAAW,GAAG,cAAc;EAAE;EAAO;CAAU,CAAC,CAAC;CACjF;AACE,CAAA;;;AC9CP,MAAa,oBAAoB,EAAE,KAAK,WAAW,WAAW,IAAI,GAAG,YACnE,oBAAC,QAAD;CACE,GAAI;CACM;CACL;CACL,SAAQ;CACR,MAAK;CACL,WAAW,GAAG,aAAa,oCAAoC,SAAS;AACzE,CAAA;;;ACXH,MAAa,mBAAmB,EAAE,KAAK,WAAW,GAAG,iBACnD,oBAAC,SAAD;CACE,GAAI;CACC;CACL,WAAW,GACT,aACA,cACA,qBACA,qBAGA,gBACA,cAGA,mCACA,8BAGA,kCAEA,SACF;AACD,CAAA;;;ACvBH,MAAa,kBAAkB,EAAE,WAAW,GAAG,YA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;GACP,cAAc;GACd,WAAW,CAAC,wBAAwB,oBAAoB;EAC1D;EACA;GACE,SAAS,CAAC,WAAW,WAAW;GAChC,OAAO;GACP,cAAc;GACd,WAAW,CAAC,0BAA0B,sBAAsB;EAC9D;EAEA;GACE,SAAS;GACT,OAAO;GACP,WAAW,CACT,qDACA,iDACF;EACF;EACA;GACE,SAAS;GACT,OAAO;GACP,WAAW;IACT;IACA;IACA;GACF;EACF;EACA;GACE,SAAS;GACT,cAAc;GACd,WAAW,CAAC,sBAAsB,kBAAkB;EACtD;EACA;GACE,SAAS;GACT,OAAO;GACP,cAAc;GACd,WAAW,CAAC,0BAA0B,yBAAyB;EACjE;EACA;GACE,SAAS;GACT,OAAO;GACP,cAAc;GACd,WAAW,CAAC,iDAAiD;EAC/D;CACF;CACA,UAAU;EACR,cAAc;GACZ,SAAS,CAAC;GACV,IAAI;IAAC;IAAmB;IAAoB;GAAY;GACxD,KAAK,CAAC,4CAA4C;EACpD;EACA,SAAS;GACP,SAAS;IAGP;IACA;IACA;IAIA;IACA;IACA;GACF;GACA,WAAW;IACT;IACA;IACA;IACA;IACA;IACA;GACF;GACA,MAAM;IAEJ;IAIA;IACA;IACA;IACA;IAEA;IACA;IAEA;IAGA;IACA;IACA;GACF;EACF;EACA,QAAQ;GACN,SAAS;IACP;IACA;IACA;GACF;GACA,OAAO;IACL;IACA;IACA;GACF;GACA,QAAQ;IACN;IACA;IACA;GACF;EACF;EACA,OAAO;GACL,SAAS,CACP,kDACA,iDACF;GACA,OAAO;IACL;IACA;IACA;GACF;GACA,SAAS;IACP;IACA;IACA;GACF;EACF;CACF;AACF,CACF;AAOA,MAAM,kBAAkB,EACtB,KACA,UACA,OACA,SACA,QACA,cACA,WACA,GAAG,YACQ;CAEX,MAAM,mBADS,cACe,IAAI,SAAS;CAC3C,MAAM,kBAAkB,qBAAqB,SAAS,WAAW;CACjE,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GACT,mBAAmB;GACjB;GACA,SAAS;GACT,QAAQ;GACR;GACA;EACF,CAAC,CACH;EAEC;CACE,CAAA;AAET;AAEA,MAAa,aAAa;AAQ1B,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,WAAW,WAAW;AACtB,WAAW,OAAO"}
@@ -1,5 +1,5 @@
1
- import { cn } from "./classNames-BzrkDnOD.js";
2
- import { isMac } from "./utils-Bd28bWgm.js";
1
+ import { cn } from "./classNames-DcGnTh2N.js";
2
+ import { isMac } from "./utils-LQ4jJA-9.js";
3
3
  import { Children, Fragment } from "react";
4
4
  import { cva } from "class-variance-authority";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -128,4 +128,4 @@ const keys = createKeyboardKeys();
128
128
  //#endregion
129
129
  export { Kbd, kbdVariants, keys };
130
130
 
131
- //# sourceMappingURL=Kbd-J4n1J6i4.js.map
131
+ //# sourceMappingURL=Kbd-3YM7NQO4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Kbd-J4n1J6i4.js","names":[],"sources":["../src/components/Kbd/KbdSeparator.tsx","../src/components/Kbd/KbdGroup.tsx","../src/components/Kbd/styles.ts","../src/components/Kbd/Kbd.tsx","../src/components/Kbd/keyboardKeys.ts"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'span'>;\n\n/**\n * The `+` / `then` glue between two `Kbd` keys.\n *\n * - Follows the muted chrome token by default.\n * - Turns white inside the legacy dark tooltip, which sets `data-tooltip-content`.\n */\nexport const KbdSeparator = ({ className, ...props }: Props) => (\n <span\n {...props}\n className={cn(\n 'tw:text-xs tw:text-muted-foreground',\n 'tw:[[data-tooltip-content=true]_&]:text-white/70',\n className,\n )}\n />\n);\n","import { Children, Fragment } from 'react';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\nimport { KbdSeparator } from './KbdSeparator';\n\ntype Props = { separator?: string } & ComponentProps<'kbd'>;\n\nexport const KbdGroup = ({ ref, className, children, separator, ...props }: Props) => {\n return (\n <kbd\n {...props}\n ref={ref}\n className={cn('tw:inline-flex', 'tw:items-center', 'tw:gap-1', className)}\n >\n {separator\n ? // oxlint-disable-next-line react-x/no-children-to-array\n Children.toArray(children).map((child, index) => (\n // oxlint-disable-next-line\n <Fragment key={index}>\n {index > 0 && <KbdSeparator>{separator}</KbdSeparator>}\n {child}\n </Fragment>\n ))\n : children}\n </kbd>\n );\n};\n","import { cva } from 'class-variance-authority';\n\nexport const kbdVariants = cva(\n [\n 'tailwindcss-preflight',\n // style\n 'tw:pointer-events-none',\n 'tw:w-fit',\n 'tw:h-5',\n 'tw:min-w-5',\n\n // layout\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:gap-1',\n 'tw:shrink-0',\n\n // spacing\n 'tw:px-1',\n 'tw:[&_svg:not([class*=\"size-\"])]:size-2.5',\n\n 'tw:text-xs',\n 'tw:font-medium',\n\n 'tw:rounded',\n ],\n {\n defaultVariants: {\n variant: 'default',\n casing: 'upper',\n },\n variants: {\n // Uppercase like a keycap; `as-written` for layout-printed labels, where the transform\n // changes glyph count (`ß` → `SS`).\n casing: {\n upper: 'tw:uppercase',\n 'as-written': '',\n },\n variant: {\n default: 'tw:bg-muted tw:text-muted-foreground',\n // Tooltip shortcut key: white only inside the dark `data-tooltip-content` tooltip;\n // Argo's light tooltip sets no such attribute, so white there would be invisible.\n primary: [\n 'tw:bg-muted tw:text-muted-foreground',\n 'tw:[[data-tooltip-content=true]_&]:bg-white/20',\n 'tw:[[data-tooltip-content=true]_&]:text-white',\n ],\n },\n },\n },\n);\n","import type { ComponentProps } from 'react';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { KbdGroup } from './KbdGroup';\nimport { KbdSeparator } from './KbdSeparator';\nimport { kbdVariants } from './styles';\n\ntype Props = ComponentProps<'kbd'> & VariantProps<typeof kbdVariants>;\n\nexport const Kbd = ({ children, className, variant, casing, ...rest }: Props) => (\n <kbd {...rest} className={kbdVariants({ className, variant, casing })}>\n {children}\n </kbd>\n);\n\nKbd.Group = KbdGroup;\nKbd.Separator = KbdSeparator;\n","import { isMac } from '../../utils';\n\ntype KeyName = 'mod' | 'option' | 'shift' | 'enter';\ntype KeyRepresentation = { symbol: string; text: string };\n\ntype KeyDefinition = {\n mac: KeyRepresentation;\n windows: KeyRepresentation;\n};\n\nconst KEY_DEFINITIONS: Record<KeyName, KeyDefinition> = {\n mod: {\n mac: { symbol: '⌘', text: 'Command' },\n windows: { symbol: 'Ctrl', text: 'Ctrl' },\n },\n option: {\n mac: { symbol: '⌥', text: 'Option' },\n windows: { symbol: 'Alt', text: 'Alt' },\n },\n shift: {\n mac: { symbol: '⇧', text: 'Shift' },\n windows: { symbol: '⇧', text: 'Shift' },\n },\n enter: {\n mac: { symbol: '⏎', text: 'Enter' },\n windows: { symbol: '⏎', text: 'Enter' },\n },\n};\n\nconst createKeyboardKeys = () => {\n const keysObj: Record<KeyName, KeyRepresentation> = {} as Record<KeyName, KeyRepresentation>;\n\n for (const keyName of Object.keys(KEY_DEFINITIONS) as KeyName[]) {\n keysObj[keyName] = KEY_DEFINITIONS[keyName][isMac ? 'mac' : 'windows'];\n }\n\n return keysObj;\n};\n\nexport const keys = createKeyboardKeys();\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,gBAAgB,EAAE,WAAW,GAAG,YAC3C,oBAAC,QAAD;CACE,GAAI;CACJ,WAAW,GACT,uCACA,oDACA,SACF;AACD,CAAA;;;ACXH,MAAa,YAAY,EAAE,KAAK,WAAW,UAAU,WAAW,GAAG,YAAmB;CACpF,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,kBAAkB,mBAAmB,YAAY,SAAS;EAEvE,UAAA,YAEG,SAAS,QAAQ,QAAQ,CAAC,CAAC,KAAK,OAAO,UAErC,qBAAC,UAAD,EAAA,UAAA,CACG,QAAQ,KAAK,oBAAC,cAAD,EAAA,UAAe,UAAwB,CAAA,GACpD,KACO,EAAA,GA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d/KbdGroup.tsx","../src/components/Kbd/styles.ts","../src/components/Kbd/Kbd.tsx","../src/components/Kbd/keyboardKeys.ts"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'span'>;\n\n/**\n * The `+` / `then` glue between two `Kbd` keys.\n *\n * - Follows the muted chrome token by default.\n * - Turns white inside the legacy dark tooltip, which sets `data-tooltip-content`.\n */\nexport const KbdSeparator = ({ className, ...props }: Props) => (\n <span\n {...props}\n className={cn(\n 'tw:text-xs tw:text-muted-foreground',\n 'tw:[[data-tooltip-content=true]_&]:text-white/70',\n className,\n )}\n />\n);\n","import { Children, Fragment } from 'react';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\nimport { KbdSeparator } from './KbdSeparator';\n\ntype Props = { separator?: string } & ComponentProps<'kbd'>;\n\nexport const KbdGroup = ({ ref, className, children, separator, ...props }: Props) => {\n return (\n <kbd\n {...props}\n ref={ref}\n className={cn('tw:inline-flex', 'tw:items-center', 'tw:gap-1', className)}\n >\n {separator\n ? // oxlint-disable-next-line react-x/no-children-to-array\n Children.toArray(children).map((child, index) => (\n // oxlint-disable-next-line\n <Fragment key={index}>\n {index > 0 && <KbdSeparator>{separator}</KbdSeparator>}\n {child}\n </Fragment>\n ))\n : children}\n </kbd>\n );\n};\n","import { cva } from 'class-variance-authority';\n\nexport const kbdVariants = cva(\n [\n 'tailwindcss-preflight',\n // style\n 'tw:pointer-events-none',\n 'tw:w-fit',\n 'tw:h-5',\n 'tw:min-w-5',\n\n // layout\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:gap-1',\n 'tw:shrink-0',\n\n // spacing\n 'tw:px-1',\n 'tw:[&_svg:not([class*=\"size-\"])]:size-2.5',\n\n 'tw:text-xs',\n 'tw:font-medium',\n\n 'tw:rounded',\n ],\n {\n defaultVariants: {\n variant: 'default',\n casing: 'upper',\n },\n variants: {\n // Uppercase like a keycap; `as-written` for layout-printed labels, where the transform\n // changes glyph count (`ß` → `SS`).\n casing: {\n upper: 'tw:uppercase',\n 'as-written': '',\n },\n variant: {\n default: 'tw:bg-muted tw:text-muted-foreground',\n // Tooltip shortcut key: white only inside the dark `data-tooltip-content` tooltip;\n // Argo's light tooltip sets no such attribute, so white there would be invisible.\n primary: [\n 'tw:bg-muted tw:text-muted-foreground',\n 'tw:[[data-tooltip-content=true]_&]:bg-white/20',\n 'tw:[[data-tooltip-content=true]_&]:text-white',\n ],\n },\n },\n },\n);\n","import type { ComponentProps } from 'react';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { KbdGroup } from './KbdGroup';\nimport { KbdSeparator } from './KbdSeparator';\nimport { kbdVariants } from './styles';\n\ntype Props = ComponentProps<'kbd'> & VariantProps<typeof kbdVariants>;\n\nexport const Kbd = ({ children, className, variant, casing, ...rest }: Props) => (\n <kbd {...rest} className={kbdVariants({ className, variant, casing })}>\n {children}\n </kbd>\n);\n\nKbd.Group = KbdGroup;\nKbd.Separator = KbdSeparator;\n","import { isMac } from '../../utils';\n\ntype KeyName = 'mod' | 'option' | 'shift' | 'enter';\ntype KeyRepresentation = { symbol: string; text: string };\n\ntype KeyDefinition = {\n mac: KeyRepresentation;\n windows: KeyRepresentation;\n};\n\nconst KEY_DEFINITIONS: Record<KeyName, KeyDefinition> = {\n mod: {\n mac: { symbol: '⌘', text: 'Command' },\n windows: { symbol: 'Ctrl', text: 'Ctrl' },\n },\n option: {\n mac: { symbol: '⌥', text: 'Option' },\n windows: { symbol: 'Alt', text: 'Alt' },\n },\n shift: {\n mac: { symbol: '⇧', text: 'Shift' },\n windows: { symbol: '⇧', text: 'Shift' },\n },\n enter: {\n mac: { symbol: '⏎', text: 'Enter' },\n windows: { symbol: '⏎', text: 'Enter' },\n },\n};\n\nconst createKeyboardKeys = () => {\n const keysObj: Record<KeyName, KeyRepresentation> = {} as Record<KeyName, KeyRepresentation>;\n\n for (const keyName of Object.keys(KEY_DEFINITIONS) as KeyName[]) {\n keysObj[keyName] = KEY_DEFINITIONS[keyName][isMac ? 'mac' : 'windows'];\n }\n\n return keysObj;\n};\n\nexport const keys = createKeyboardKeys();\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,gBAAgB,EAAE,WAAW,GAAG,YAC3C,oBAAC,QAAD;CACE,GAAI;CACJ,WAAW,GACT,uCACA,oDACA,SACF;AACD,CAAA;;;ACXH,MAAa,YAAY,EAAE,KAAK,WAAW,UAAU,WAAW,GAAG,YAAmB;CACpF,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,kBAAkB,mBAAmB,YAAY,SAAS;EAEvE,UAAA,YAEG,SAAS,QAAQ,QAAQ,CAAC,CAAC,KAAK,OAAO,UAErC,qBAAC,UAAD,EAAA,UAAA,CACG,QAAQ,KAAK,oBAAC,cAAD,EAAA,UAAe,UAAwB,CAAA,GACpD,KACO,EAAA,GAHK,KAGL,CACX,IACD;CACD,CAAA;AAET;;;AC1BA,MAAa,cAAc,IACzB;CACE;CAEA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CAGA;CACA;CAEA;CACA;CAEA;AACF,GACA;CACE,iBAAiB;EACf,SAAS;EACT,QAAQ;CACV;CACA,UAAU;EAGR,QAAQ;GACN,OAAO;GACP,cAAc;EAChB;EACA,SAAS;GACP,SAAS;GAGT,SAAS;IACP;IACA;IACA;GACF;EACF;CACF;AACF,CACF;;;AC1CA,MAAa,OAAO,EAAE,UAAU,WAAW,SAAS,QAAQ,GAAG,WAC7D,oBAAC,OAAD;CAAK,GAAI;CAAM,WAAW,YAAY;EAAE;EAAW;EAAS;CAAO,CAAC;CACjE;AACE,CAAA;AAGP,IAAI,QAAQ;AACZ,IAAI,YAAY;;;ACNhB,MAAM,kBAAkD;CACtD,KAAK;EACH,KAAK;GAAE,QAAQ;GAAK,MAAM;EAAU;EACpC,SAAS;GAAE,QAAQ;GAAQ,MAAM;EAAO;CAC1C;CACA,QAAQ;EACN,KAAK;GAAE,QAAQ;GA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