@keboola/design 11.3.0 → 11.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/AGENTS.md +208 -1
  2. package/CHANGELOG.md +528 -0
  3. package/COMPONENT-API.md +68 -46
  4. package/dist/{AIKit-DaFT7p92.js → AIKit-CNX6aiKm.js} +338 -113
  5. package/dist/AIKit-CNX6aiKm.js.map +1 -0
  6. package/dist/{Alert-CseY3yAj.js → Alert-Ba5b2YPq.js} +3 -3
  7. package/dist/{Alert-CseY3yAj.js.map → Alert-Ba5b2YPq.js.map} +1 -1
  8. package/dist/{AlertModal-DQAGpsEy.js → AlertModal-BGJdaRRj.js} +3 -3
  9. package/dist/{AlertModal-DQAGpsEy.js.map → AlertModal-BGJdaRRj.js.map} +1 -1
  10. package/dist/{AppShell-BUoxM3fv.js → AppShell-DRgJxpXW.js} +2 -2
  11. package/dist/{AppShell-BUoxM3fv.js.map → AppShell-DRgJxpXW.js.map} +1 -1
  12. package/dist/{Badge-Ch26CXoP.js → Badge-D0pXdekt.js} +2 -2
  13. package/dist/Badge-D0pXdekt.js.map +1 -0
  14. package/dist/{BrandEditor-BnTLMRMp.js → BrandEditor-CSANsxUz.js} +8 -8
  15. package/dist/{BrandEditor-BnTLMRMp.js.map → BrandEditor-CSANsxUz.js.map} +1 -1
  16. package/dist/{BrandLogo-V2pRUAeO.js → BrandLogo-CoKBk4MI.js} +5 -5
  17. package/dist/BrandLogo-CoKBk4MI.js.map +1 -0
  18. package/dist/{Breadcrumb-CQTPn_KB.js → Breadcrumb-g_xn_-Nf.js} +3 -3
  19. package/dist/{Breadcrumb-CQTPn_KB.js.map → Breadcrumb-g_xn_-Nf.js.map} +1 -1
  20. package/dist/{Button-CPsEQuTN.js → Button-DsRrU5F1.js} +6 -5
  21. package/dist/Button-DsRrU5F1.js.map +1 -0
  22. package/dist/{Card-Cd5HSBmv.js → Card-Dyo7055Q.js} +2 -2
  23. package/dist/{Card-Cd5HSBmv.js.map → Card-Dyo7055Q.js.map} +1 -1
  24. package/dist/{Checkbox-5VNCcV7E.js → Checkbox-CUIn2jap.js} +3 -3
  25. package/dist/{Checkbox-5VNCcV7E.js.map → Checkbox-CUIn2jap.js.map} +1 -1
  26. package/dist/{Clipboard-B7rckqV_.js → Clipboard-BTW6C-b_.js} +2 -2
  27. package/dist/{Clipboard-B7rckqV_.js.map → Clipboard-BTW6C-b_.js.map} +1 -1
  28. package/dist/{ClipboardButton-CQ6Aewpg.js → ClipboardButton-CwZJdRaz.js} +3 -3
  29. package/dist/{ClipboardButton-CQ6Aewpg.js.map → ClipboardButton-CwZJdRaz.js.map} +1 -1
  30. package/dist/{CodeEditor-CUse8znx.js → CodeEditor-C9zy7PxK.js} +16 -27
  31. package/dist/CodeEditor-C9zy7PxK.js.map +1 -0
  32. package/dist/{ColorInput-Q1D9Vcc_.js → ColorInput-BZV-u_94.js} +3 -3
  33. package/dist/{ColorInput-Q1D9Vcc_.js.map → ColorInput-BZV-u_94.js.map} +1 -1
  34. package/dist/{ColorModeSwitch-B5PXCVqB.js → ColorModeSwitch-CsWLiTBX.js} +3 -3
  35. package/dist/{ColorModeSwitch-B5PXCVqB.js.map → ColorModeSwitch-CsWLiTBX.js.map} +1 -1
  36. package/dist/{Combobox-CyoRA7oY.js → Combobox-BfIfaVMA.js} +285 -109
  37. package/dist/Combobox-BfIfaVMA.js.map +1 -0
  38. package/dist/{Command-Ds68v2rX.js → Command-Bfa1kpbt.js} +6 -6
  39. package/dist/{Command-Ds68v2rX.js.map → Command-Bfa1kpbt.js.map} +1 -1
  40. package/dist/{CopyField-DI66uY_g.js → CopyField-DpT0Ngz1.js} +2 -2
  41. package/dist/{CopyField-DI66uY_g.js.map → CopyField-DpT0Ngz1.js.map} +1 -1
  42. package/dist/{DateInput-BPj2pzsn.js → DateInput-DiEd5uCL.js} +4 -4
  43. package/dist/{DateInput-BPj2pzsn.js.map → DateInput-DiEd5uCL.js.map} +1 -1
  44. package/dist/{DatePicker-DyEGuW9m.js → DatePicker-nA8YdE84.js} +2 -2
  45. package/dist/{DatePicker-DyEGuW9m.js.map → DatePicker-nA8YdE84.js.map} +1 -1
  46. package/dist/{DateRangeInput-u9DxNbHW.js → DateRangeInput-DPfVYchl.js} +4 -4
  47. package/dist/{DateRangeInput-u9DxNbHW.js.map → DateRangeInput-DPfVYchl.js.map} +1 -1
  48. package/dist/{DateRangePicker-CYYhX6S7.js → DateRangePicker-DjSUFjh4.js} +5 -5
  49. package/dist/{DateRangePicker-CYYhX6S7.js.map → DateRangePicker-DjSUFjh4.js.map} +1 -1
  50. package/dist/{DropdownMenu-DpMEcyCq.js → DropdownMenu-CASr-jgl.js} +2 -2
  51. package/dist/{DropdownMenu-DpMEcyCq.js.map → DropdownMenu-CASr-jgl.js.map} +1 -1
  52. package/dist/{FieldItem-qQKGU9lF.js → FieldItem-B7XMmZSz.js} +3 -3
  53. package/dist/{FieldItem-qQKGU9lF.js.map → FieldItem-B7XMmZSz.js.map} +1 -1
  54. package/dist/{FileUpload-C336MVnU.js → FileUpload-ABThVZyg.js} +2 -2
  55. package/dist/{FileUpload-C336MVnU.js.map → FileUpload-ABThVZyg.js.map} +1 -1
  56. package/dist/{Form-CTygENDc.js → Form-CsttTHn4.js} +8 -8
  57. package/dist/Form-CsttTHn4.js.map +1 -0
  58. package/dist/{FormGroup-BnwP0jNu.js → FormGroup-DHvTFdno.js} +3 -3
  59. package/dist/{FormGroup-BnwP0jNu.js.map → FormGroup-DHvTFdno.js.map} +1 -1
  60. package/dist/{FullScreenModal-j-M4aPFd.js → FullScreenModal-BvPuYibe.js} +3 -3
  61. package/dist/{FullScreenModal-j-M4aPFd.js.map → FullScreenModal-BvPuYibe.js.map} +1 -1
  62. package/dist/{HoverCard-yQq-O49c.js → HoverCard-B9ZMJxjn.js} +2 -2
  63. package/dist/{HoverCard-yQq-O49c.js.map → HoverCard-B9ZMJxjn.js.map} +1 -1
  64. package/dist/{InputGroup-D7zlmqPB.js → InputGroup-DcZRlVnN.js} +24 -16
  65. package/dist/InputGroup-DcZRlVnN.js.map +1 -0
  66. package/dist/{Kbd-D6LpR7G2.js → Kbd-Cvvt91Q8.js} +14 -4
  67. package/dist/Kbd-Cvvt91Q8.js.map +1 -0
  68. package/dist/MarkedText-DNGEUVWc.js +67 -0
  69. package/dist/MarkedText-DNGEUVWc.js.map +1 -0
  70. package/dist/{MermaidDiagram-JlvuGcY-.js → MermaidDiagram-CXG5tC6J.js} +19 -18
  71. package/dist/MermaidDiagram-CXG5tC6J.js.map +1 -0
  72. package/dist/{Modal-o4ATIexE.js → Modal-Coj-H02o.js} +16 -4
  73. package/dist/Modal-Coj-H02o.js.map +1 -0
  74. package/dist/{MultiActionButtonGroup-GTeFk-L8.js → MultiActionButtonGroup-DokHbPgM.js} +3 -3
  75. package/dist/{MultiActionButtonGroup-GTeFk-L8.js.map → MultiActionButtonGroup-DokHbPgM.js.map} +1 -1
  76. package/dist/{Navbar-CAQs4BZz.js → Navbar-Liy1TPI7.js} +7 -7
  77. package/dist/{Navbar-CAQs4BZz.js.map → Navbar-Liy1TPI7.js.map} +1 -1
  78. package/dist/PageHeader-Q3IpCnQd.js.map +1 -1
  79. package/dist/{PageToolbar-bG2YtSa3.js → PageToolbar-DExqEYGl.js} +4 -4
  80. package/dist/{PageToolbar-bG2YtSa3.js.map → PageToolbar-DExqEYGl.js.map} +1 -1
  81. package/dist/{Pagination-BB3X7ooY.js → Pagination-C_b7Xhey.js} +2 -2
  82. package/dist/{Pagination-BB3X7ooY.js.map → Pagination-C_b7Xhey.js.map} +1 -1
  83. package/dist/{Popconfirm-C2Ky5hJO.js → Popconfirm-5pBzT_HQ.js} +12 -13
  84. package/dist/{Popconfirm-C2Ky5hJO.js.map → Popconfirm-5pBzT_HQ.js.map} +1 -1
  85. package/dist/{Popover-DsbI2HKu.js → Popover-BEbQrC_P.js} +22 -19
  86. package/dist/Popover-BEbQrC_P.js.map +1 -0
  87. package/dist/{RadioGroup-BMxuZEbT.js → RadioGroup-DXPbSj8P.js} +3 -3
  88. package/dist/{RadioGroup-BMxuZEbT.js.map → RadioGroup-DXPbSj8P.js.map} +1 -1
  89. package/dist/{Search-DFeECt5D.js → Search-5uQAiNIP.js} +2 -2
  90. package/dist/{Search-DFeECt5D.js.map → Search-5uQAiNIP.js.map} +1 -1
  91. package/dist/{SearchInput-CCpdUego.js → SearchInput-D4UgAXJK.js} +3 -3
  92. package/dist/{SearchInput-CCpdUego.js.map → SearchInput-D4UgAXJK.js.map} +1 -1
  93. package/dist/{SectionNav-Bw_MVL0_.js → SectionNav-OkKCjSA-.js} +5 -5
  94. package/dist/{SectionNav-Bw_MVL0_.js.map → SectionNav-OkKCjSA-.js.map} +1 -1
  95. package/dist/{Select-D6IZVvwL.js → Select-DV3Hak_l.js} +31 -21
  96. package/dist/Select-DV3Hak_l.js.map +1 -0
  97. package/dist/{Sheet-BIzs2K2H.js → Sheet-Chf0kX1E.js} +3 -3
  98. package/dist/{Sheet-BIzs2K2H.js.map → Sheet-Chf0kX1E.js.map} +1 -1
  99. package/dist/{Sidebar-r1TW4g_b.js → Sidebar-D3cY1kha.js} +48 -22
  100. package/dist/Sidebar-D3cY1kha.js.map +1 -0
  101. package/dist/{Slider-CjxyfEty.js → Slider-CRf-bB4y.js} +3 -3
  102. package/dist/{Slider-CjxyfEty.js.map → Slider-CRf-bB4y.js.map} +1 -1
  103. package/dist/{Switch-BueTV03C.js → Switch-B0WdGSjz.js} +8 -8
  104. package/dist/{Switch-BueTV03C.js.map → Switch-B0WdGSjz.js.map} +1 -1
  105. package/dist/{Tabs-l72-WuhK.js → Tabs-eB974xJf.js} +2 -2
  106. package/dist/{Tabs-l72-WuhK.js.map → Tabs-eB974xJf.js.map} +1 -1
  107. package/dist/{TextInput-DhdRk8qm.js → TextInput-DH5SkbsE.js} +3 -3
  108. package/dist/{TextInput-DhdRk8qm.js.map → TextInput-DH5SkbsE.js.map} +1 -1
  109. package/dist/{ThemeProvider-DZfGdf1v.js → ThemeProvider-2RMdVGxO.js} +95 -15
  110. package/dist/ThemeProvider-2RMdVGxO.js.map +1 -0
  111. package/dist/{TimePicker-B6d2rAbX.js → TimePicker-BGeqc-Ed.js} +2 -2
  112. package/dist/{TimePicker-B6d2rAbX.js.map → TimePicker-BGeqc-Ed.js.map} +1 -1
  113. package/dist/{Timeline-6btyJl4D.js → Timeline-BG5Xogxh.js} +11 -11
  114. package/dist/{Timeline-6btyJl4D.js.map → Timeline-BG5Xogxh.js.map} +1 -1
  115. package/dist/{Toast-CxXUulYN.js → Toast-Dr6Uw7ao.js} +2 -2
  116. package/dist/{Toast-CxXUulYN.js.map → Toast-Dr6Uw7ao.js.map} +1 -1
  117. package/dist/{Workbench-BzE-Vvd9.js → Workbench-UR2FBC7I.js} +3 -1
  118. package/dist/Workbench-UR2FBC7I.js.map +1 -0
  119. package/dist/{ZoomableSvg-CNIzRHKH.js → ZoomableSvg-pooPb1Cu.js} +4 -4
  120. package/dist/{ZoomableSvg-CNIzRHKH.js.map → ZoomableSvg-pooPb1Cu.js.map} +1 -1
  121. package/dist/{context-BrNtMc1H.js → context-D7X470dy.js} +4 -3
  122. package/dist/context-D7X470dy.js.map +1 -0
  123. package/dist/{defaults-CTfvj2KB.js → defaults-i_xG2F_1.js} +2 -4
  124. package/dist/defaults-i_xG2F_1.js.map +1 -0
  125. package/dist/editors.js +5 -5
  126. package/dist/findLiteralMatches-BGBw8Vbl.js +62 -0
  127. package/dist/findLiteralMatches-BGBw8Vbl.js.map +1 -0
  128. package/dist/flint.js +134 -8
  129. package/dist/flint.js.map +1 -1
  130. package/dist/index.d.ts +1118 -566
  131. package/dist/index.js +64 -62
  132. package/dist/internal/blocks/AIKit.js +2 -2
  133. package/dist/internal/blocks/AppShell.js +1 -1
  134. package/dist/internal/blocks/AuthLayout.js +118 -0
  135. package/dist/internal/blocks/AuthLayout.js.map +1 -0
  136. package/dist/internal/blocks/BrandEditor.js +1 -1
  137. package/dist/internal/blocks/ChartPanel.js +1 -1
  138. package/dist/internal/blocks/ClipboardButton.js +1 -1
  139. package/dist/internal/blocks/ColorInput.js +1 -1
  140. package/dist/internal/blocks/ColorModeSwitch.js +1 -1
  141. package/dist/internal/blocks/Command.js +1 -1
  142. package/dist/internal/blocks/CopyField.js +1 -1
  143. package/dist/internal/blocks/DateInput.js +1 -1
  144. package/dist/internal/blocks/DateRangeInput.js +1 -1
  145. package/dist/internal/blocks/EmptyConfigurationActionCard.js +1 -1
  146. package/dist/internal/blocks/ErrorState.js +1 -1
  147. package/dist/internal/blocks/ExportMenu.js +5 -5
  148. package/dist/internal/blocks/ExportMenu.js.map +1 -1
  149. package/dist/internal/blocks/Form/connectors/MultiComboboxField.js +1 -1
  150. package/dist/internal/blocks/Form.js +1 -1
  151. package/dist/internal/blocks/FormGroup.js +1 -1
  152. package/dist/internal/blocks/MultiActionButtonGroup.js +1 -1
  153. package/dist/internal/blocks/MultiCombobox.js +116 -54
  154. package/dist/internal/blocks/MultiCombobox.js.map +1 -1
  155. package/dist/internal/blocks/NumberInput.js +1 -1
  156. package/dist/internal/blocks/PageToolbar.js +1 -1
  157. package/dist/internal/blocks/PasswordInput.js +2 -2
  158. package/dist/internal/blocks/SearchInput.js +1 -1
  159. package/dist/internal/blocks/SearchInputWithNavigation.js +3 -3
  160. package/dist/internal/blocks/SectionNav.js +1 -1
  161. package/dist/internal/blocks/SplitButton.js +2 -2
  162. package/dist/internal/blocks/StatCard.js +1 -1
  163. package/dist/internal/blocks/TextInput.js +1 -1
  164. package/dist/internal/blocks/Textarea.js +1 -1
  165. package/dist/internal/blocks/TimeInput.js +3 -3
  166. package/dist/internal/components/Alert.js +1 -1
  167. package/dist/internal/components/AlertModal.js +1 -1
  168. package/dist/internal/components/Avatar.js +1 -1
  169. package/dist/internal/components/Badge.js +1 -1
  170. package/dist/internal/components/BrandLogo.js +1 -1
  171. package/dist/internal/components/Breadcrumb.js +1 -1
  172. package/dist/internal/components/Button.js +1 -1
  173. package/dist/internal/components/Card.js +1 -1
  174. package/dist/internal/components/Checkbox.js +1 -1
  175. package/dist/internal/components/Clipboard.js +1 -1
  176. package/dist/internal/components/CollapsiblePanel.js +1 -1
  177. package/dist/internal/components/Combobox.js +2 -2
  178. package/dist/internal/components/DatePicker.js +1 -1
  179. package/dist/internal/components/DateRangePicker.js +1 -1
  180. package/dist/internal/components/DropdownMenu.js +1 -1
  181. package/dist/internal/components/FileUpload.js +1 -1
  182. package/dist/internal/components/FullScreenModal.js +1 -1
  183. package/dist/internal/components/HoverCard.js +1 -1
  184. package/dist/internal/components/InputGroup.js +1 -1
  185. package/dist/internal/components/Kbd.js +1 -1
  186. package/dist/internal/components/MarkedText.js +1 -1
  187. package/dist/internal/components/Modal.js +1 -1
  188. package/dist/internal/components/Navbar.js +1 -1
  189. package/dist/internal/components/Pagination.js +1 -1
  190. package/dist/internal/components/Popconfirm.js +1 -1
  191. package/dist/internal/components/Popover.js +1 -1
  192. package/dist/internal/components/RadioGroup.js +1 -1
  193. package/dist/internal/components/Search.js +1 -1
  194. package/dist/internal/components/Select.js +1 -1
  195. package/dist/internal/components/Sheet.js +1 -1
  196. package/dist/internal/components/Sidebar.js +1 -1
  197. package/dist/internal/components/Slider.js +1 -1
  198. package/dist/internal/components/Switch.js +1 -1
  199. package/dist/internal/components/Tabs.js +1 -1
  200. package/dist/internal/components/ThemeProvider.js +4 -4
  201. package/dist/internal/components/TimePicker.js +1 -1
  202. package/dist/internal/components/Timeline.js +1 -1
  203. package/dist/internal/components/Toast.js +2 -2
  204. package/dist/internal/components/Toggle.js +3 -3
  205. package/dist/internal/components/Toggle.js.map +1 -1
  206. package/dist/internal/components/Tooltip.js +1 -1
  207. package/dist/internal/components/Truncated.js +1 -1
  208. package/dist/internal/components/Workbench.js +1 -1
  209. package/dist/internal/components/ZoomableSvg.js +1 -1
  210. package/dist/internal/utils.js +3 -3
  211. package/dist/markdown-editor.js +32 -26
  212. package/dist/markdown-editor.js.map +1 -1
  213. package/dist/mermaid.js +1 -1
  214. package/dist/rjsf.js +24 -25
  215. package/dist/rjsf.js.map +1 -1
  216. package/dist/styles.css +1 -1
  217. package/dist/testing.js +4 -4
  218. package/dist/testing.js.map +1 -1
  219. package/dist/{useColorSchemeState-BJEk6esG.js → themeScopeContext-D7fSyb06.js} +17 -4
  220. package/dist/themeScopeContext-D7fSyb06.js.map +1 -0
  221. package/dist/{themeTokens-7T1AFLhq.js → themeTokens-qP1-55O7.js} +38 -11
  222. package/dist/themeTokens-qP1-55O7.js.map +1 -0
  223. package/dist/{toast-BweSoKn3.js → toast-DIC0iNRf.js} +2 -2
  224. package/dist/{toast-BweSoKn3.js.map → toast-DIC0iNRf.js.map} +1 -1
  225. package/dist/{utils-B-g7d_Jb.js → utils-DSvrhU8E.js} +7 -3
  226. package/dist/{utils-B-g7d_Jb.js.map → utils-DSvrhU8E.js.map} +1 -1
  227. package/dist/vega.d.ts +1 -1
  228. package/dist/vega.js +3 -3
  229. package/dist/vega.js.map +1 -1
  230. package/dist/{vegaTheme-FBXgAdHK.js → vegaTheme-CSvFEMBl.js} +6 -6
  231. package/dist/vegaTheme-CSvFEMBl.js.map +1 -0
  232. package/package.json +12 -10
  233. package/src/styles.css +3 -0
  234. package/dist/AIKit-DaFT7p92.js.map +0 -1
  235. package/dist/Badge-Ch26CXoP.js.map +0 -1
  236. package/dist/BrandLogo-V2pRUAeO.js.map +0 -1
  237. package/dist/Button-CPsEQuTN.js.map +0 -1
  238. package/dist/CodeEditor-CUse8znx.js.map +0 -1
  239. package/dist/Combobox-CyoRA7oY.js.map +0 -1
  240. package/dist/Form-CTygENDc.js.map +0 -1
  241. package/dist/InputGroup-D7zlmqPB.js.map +0 -1
  242. package/dist/Kbd-D6LpR7G2.js.map +0 -1
  243. package/dist/MarkedText-Ckbft5mw.js +0 -44
  244. package/dist/MarkedText-Ckbft5mw.js.map +0 -1
  245. package/dist/MermaidDiagram-JlvuGcY-.js.map +0 -1
  246. package/dist/Modal-o4ATIexE.js.map +0 -1
  247. package/dist/Popover-DsbI2HKu.js.map +0 -1
  248. package/dist/Select-D6IZVvwL.js.map +0 -1
  249. package/dist/Sidebar-r1TW4g_b.js.map +0 -1
  250. package/dist/ThemeProvider-DZfGdf1v.js.map +0 -1
  251. package/dist/Workbench-BzE-Vvd9.js.map +0 -1
  252. package/dist/context-BrNtMc1H.js.map +0 -1
  253. package/dist/defaults-CTfvj2KB.js.map +0 -1
  254. package/dist/escapeStringRegexp-8MxP2knR.js +0 -6
  255. package/dist/escapeStringRegexp-8MxP2knR.js.map +0 -1
  256. package/dist/themeTokens-7T1AFLhq.js.map +0 -1
  257. package/dist/useColorSchemeState-BJEk6esG.js.map +0 -1
  258. package/dist/vegaTheme-FBXgAdHK.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SectionNav-Bw_MVL0_.js","names":[],"sources":["../src/blocks/SectionNav/SectionNavItemContent.tsx","../src/blocks/SectionNav/SectionNavGroupRow.tsx","../src/blocks/SectionNav/SectionNav.tsx"],"sourcesContent":["import { Badge } from '../../components/Badge';\nimport { ChevronDown } from '../../icons';\nimport { cn } from '../../utils';\n\nimport type { SectionNavItem } from './types';\n\ntype Props = {\n item: SectionNavItem;\n /** Tints the title. */\n active: boolean;\n showDescription?: boolean;\n /** Group rows only — renders the chevron, pointing the way the list is about to move. */\n expanded?: boolean;\n /**\n * Sub-section rows pass `false`. A group's icon stands for the group, and repeating a glyph on\n * each indented child turns a short list into a column of competing marks: the indent and the\n * rule already say these belong to the row above. An item may still carry an `icon` for surfaces\n * that flatten the tree, such as a tab row, where every destination is top level.\n */\n showIcon?: boolean;\n};\n\n/**\n * One row's body, rendered identically in the tree and in the collapsed dropdown — same title, same\n * badge, same description. Shared rather than written twice so the two cannot drift.\n */\nexport const SectionNavItemContent = ({\n item,\n active,\n showDescription = false,\n expanded,\n showIcon = true,\n}: Props) => {\n const Icon = item.icon;\n\n return (\n <span className=\"tw:flex tw:min-w-0 tw:flex-1 tw:flex-col tw:gap-0.5\">\n <span className=\"tw:flex tw:items-center tw:gap-2\">\n {showIcon && Icon && <Icon className=\"tw:size-4 tw:shrink-0\" />}\n <span\n className={cn(\n 'tw:flex-1 tw:truncate tw:text-sm',\n active ? 'tw:font-medium tw:text-accent-foreground' : 'tw:text-foreground',\n )}\n >\n {item.title}\n </span>\n {item.isNew && (\n <Badge\n color=\"blue-inverse\"\n className=\"tw:min-h-0 tw:text-[10px]\"\n labelClassName=\"tw:px-1.5 tw:py-0\"\n >\n New\n </Badge>\n )}\n {expanded !== undefined && (\n <ChevronDown\n className={cn(\n 'tw:size-4 tw:shrink-0 tw:text-muted-foreground tw:transition-transform tw:duration-200',\n expanded && 'tw:rotate-180',\n )}\n />\n )}\n </span>\n {/* Descriptions wrap rather than truncate — they are the second line, not the label. A token\n with no break opportunity would still paint straight out of the 256px column, so break it. */}\n {showDescription && item.description && (\n <span className=\"tw:text-xs tw:break-words tw:text-muted-foreground\">\n {item.description}\n </span>\n )}\n </span>\n );\n};\n","import { useState } from 'react';\nimport type { MouseEvent, ReactNode } from 'react';\n\nimport { Collapsible } from '../../components/Collapsible';\nimport { cn, noop } from '../../utils';\n\nimport { SectionNavItemContent } from './SectionNavItemContent';\nimport type { SectionNavGroup, SectionNavItemRenderProps } from './types';\n\ntype Props = {\n group: SectionNavGroup;\n activeId: string | undefined;\n renderItem: (props: SectionNavItemRenderProps) => ReactNode;\n showDescriptions: boolean;\n};\n\n/**\n * The ring is **inset**, not an outline. A row is exactly as wide as the nav column, and\n * `PageLayout.Content nav` makes that column a scroll container (`overflow-y-auto`, which forces\n * `overflow-x` to `auto` too) — so there is 0px of slack for anything painted outside the border\n * box, and the browser's default `outline-offset: 1px` ring gets clipped on both edges. Painting\n * inside the box cannot be clipped, at any column width, by any ancestor.\n */\nconst FOCUS_RING =\n 'tw:focus-visible:outline-hidden tw:focus-visible:ring-2 tw:focus-visible:ring-inset tw:focus-visible:ring-ring';\n\nconst rowClass = (active: boolean) =>\n cn(\n 'tw:flex tw:w-full tw:cursor-pointer tw:items-center tw:gap-2 tw:rounded-md tw:border-none tw:px-3 tw:py-2 tw:text-left tw:text-sm tw:no-underline tw:transition-colors',\n FOCUS_RING,\n active\n ? 'tw:bg-accent tw:font-medium tw:text-accent-foreground'\n : 'tw:bg-transparent tw:text-foreground tw:hover:bg-muted',\n );\n\nconst childRowClass = (active: boolean) =>\n cn(\n 'tw:flex tw:w-full tw:cursor-pointer tw:rounded-md tw:border-none tw:px-3 tw:py-1.5 tw:text-left tw:no-underline tw:transition-colors',\n FOCUS_RING,\n active ? 'tw:bg-accent' : 'tw:bg-transparent tw:hover:bg-muted',\n );\n\n/**\n * One group row and its sub-sections. The row is a single control: it opens the group **and** goes to\n * its first section, and only collapses once you are already there — so the chevron never becomes a\n * separate thing to aim at, and one click always makes progress.\n */\nexport const SectionNavGroupRow = ({ group, activeId, renderItem, showDescriptions }: Props) => {\n // Open on arrival: the nav is short enough that hiding any of it costs more than it saves.\n const [open, setOpen] = useState(true);\n\n const hasChildren = group.children.length > 0;\n const targetId = group.children[0]?.id ?? group.id;\n const isCurrent = group.id === activeId;\n const holdsCurrent = isCurrent || group.children.some((child) => child.id === activeId);\n\n const onClick = (event: MouseEvent<HTMLElement>) => {\n if (!hasChildren) return;\n\n // Already on the row's target, so navigating would be a no-op and the only thing left for the\n // click to do is toggle. `preventDefault` is what tells the caller's link not to navigate.\n if (activeId === targetId) {\n event.preventDefault();\n setOpen((isOpen) => !isOpen);\n\n return;\n }\n\n setOpen(true);\n };\n\n return (\n <Collapsible open={open} onOpenChange={setOpen} className=\"tw:flex tw:flex-col tw:gap-0.5\">\n {renderItem({\n targetId,\n isActive: isCurrent,\n children: (\n <SectionNavItemContent\n item={group}\n active={holdsCurrent}\n expanded={hasChildren ? open : undefined}\n />\n ),\n itemProps: {\n className: rowClass(holdsCurrent),\n 'aria-current': isCurrent ? 'page' : undefined,\n 'aria-expanded': hasChildren ? open : undefined,\n 'data-active': holdsCurrent && !isCurrent ? true : undefined,\n onClick,\n },\n })}\n\n {hasChildren && (\n <Collapsible.Content>\n {/* `pl-1` keeps each row's background box off the group's rule — without it an active\n row's `bg-accent` sits flush against the line. 4px is also what lines the child titles\n (20 + 1 + 4 + 12 = 37px) up with the parent's, which its icon puts at 12 + 16 + 8 = 36px. */}\n {/* `my-0 mr-0` and not `m-0`: a host app emits its own `.tw\\:m-0` from its own source, and\n its stylesheet is the later one — shorthand and longhand at equal specificity means the\n app's `m-0` would land after this `ml-5` and flatten the indent. Longhands only, so\n nothing here can be overridden by a copy of a class this block also uses. */}\n <ul className=\"tw:my-0 tw:mr-0 tw:ml-5 tw:flex tw:list-none tw:flex-col tw:gap-0.5 tw:border-l tw:border-border tw:py-0.5 tw:pl-1\">\n {group.children.map((child) => {\n const active = child.id === activeId;\n\n return (\n <li key={child.id}>\n {renderItem({\n targetId: child.id,\n isActive: active,\n children: (\n <SectionNavItemContent\n item={child}\n active={active}\n showDescription={showDescriptions}\n showIcon={false}\n />\n ),\n itemProps: {\n className: childRowClass(active),\n 'aria-current': active ? 'page' : undefined,\n 'aria-expanded': undefined,\n 'data-active': undefined,\n onClick: noop,\n },\n })}\n </li>\n );\n })}\n {group.note && (\n <li className=\"tw:py-1 tw:pl-3 tw:text-xs tw:text-muted-foreground\">{group.note}</li>\n )}\n </ul>\n </Collapsible.Content>\n )}\n </Collapsible>\n );\n};\n","import type { ReactNode } from 'react';\n\nimport { Button } from '../../components/Button';\nimport { DropdownMenu } from '../../components/DropdownMenu';\nimport { ChevronDown } from '../../icons';\nimport { cn, noop } from '../../utils';\n\nimport { SectionNavGroupRow } from './SectionNavGroupRow';\nimport { SectionNavItemContent } from './SectionNavItemContent';\nimport type { SectionNavGroup, SectionNavItemRenderProps } from './types';\n\ntype Props = {\n /**\n * The sections to show, already filtered. Visibility, permissions and feature flags stay in the\n * app — this block renders exactly what it is handed, in order.\n */\n groups: SectionNavGroup[];\n /** `id` of the current section: a child's, or a childless group's. */\n activeId?: string;\n /**\n * Renders the clickable element for one row, so routing never enters the design system. Return a\n * `NavLink` / TanStack `Link` / `<a>` pointing at `targetId` and spread `itemProps` onto it.\n */\n renderItem: (props: SectionNavItemRenderProps) => ReactNode;\n /** Print each section's `description` under its title. Off — the tree stays scannable without it. */\n showDescriptions?: boolean;\n /** Accessible name for the tree's `<nav>`, and the collapsed label with nothing active. */\n label?: string;\n /** Applied to the tree's `<nav>`. The column's own geometry belongs to `PageLayout.Content nav`. */\n className?: string;\n};\n\n/**\n * In-page grouped navigation for one page's sections: a tree above the container's breakpoint, a\n * single dropdown below it. Both are rendered and CSS picks one, and both draw their rows through\n * the same renderer, so the two can never drift apart.\n *\n * **This is not `Sidebar`.** `Sidebar` is the app-level left rail — `SidebarProvider`, icon-collapse,\n * one per app shell, outside `PageLayout`. `SectionNav` is scoped to a single page's sections, lives\n * inside `PageLayout.Content`, and owns no global state. See `AGENTS.md`.\n *\n * **Router-agnostic:** `renderItem` is the seam. Pass it whatever your router calls a link.\n *\n * ```tsx\n * <PageLayout.Content nav={\n * <SectionNav\n * groups={groups}\n * activeId={activeId}\n * renderItem={({ targetId, children, itemProps }) => (\n * <Link to={targetId} {...itemProps}>{children}</Link>\n * )}\n * />\n * }>\n * {page}\n * </PageLayout.Content>\n * ```\n *\n * The tree↔dropdown switch is a **container** query on the content area's width, never the viewport\n * — a product sidebar or a chat panel narrows the page without the window resizing.\n * `PageLayout.Content nav={…}` names that container; standalone, put `tw:@container/section-nav` on\n * an ancestor yourself.\n *\n * @see RECIPES.md#section-nav\n */\nexport const SectionNav = ({\n groups,\n activeId,\n renderItem,\n showDescriptions = false,\n label = 'Sections',\n className,\n}: Props) => {\n /**\n * What the collapsed trigger names. A sub-section carries its group with it — \"Developer settings /\n * CLI agents\" — so the trigger says where you are, not just what page this is.\n */\n const activeChild = groups\n .flatMap((group) => group.children.map((child) => ({ group, child })))\n .find(({ child }) => child.id === activeId);\n const activeGroup = groups.find((group) => group.id === activeId);\n const current = activeChild\n ? {\n icon: activeChild.group.icon,\n title: activeChild.child.title,\n parent: activeChild.group.title,\n }\n : { icon: activeGroup?.icon, title: activeGroup?.title ?? label, parent: undefined };\n const CurrentIcon = current.icon;\n /** A group whose subtree holds the active section: tinted like the tree's row, but not `aria-current`. */\n const holdsActive = (group: SectionNavGroup) =>\n group.id === activeId || group.children.some((child) => child.id === activeId);\n\n return (\n <>\n {/* The reset is scoped (`.tailwindcss-preflight`, see `styles.css`), and the rows are\n caller-owned elements — `renderItem` returns the app's own `<a>`, which never inherits a\n scope this block does not open. Without it those rows are `content-box`, so the `w-full`\n + `px-3` in `rowClass` measures 24px wider than the 256px column and every row bleeds out\n of it. Opening the scope here covers the whole tree, rows included. */}\n {/* `display` is set by TWO container variants and never by a plain utility. A host app that\n emits `tw:flex` or `tw:hidden` from its own source ships an identical `.tw\\:flex` /\n `.tw\\:hidden` rule — same specificity, same layer, and its stylesheet is the later one, so\n whichever of the two this block wrote plainly would lose to the app's copy and the tree\n would be stuck visible or stuck hidden. Both variants are selectors only this block emits,\n and their queries are mutually exclusive, so nothing outside can outrank them. */}\n <nav\n aria-label={label}\n className={cn(\n 'tailwindcss-preflight',\n 'tw:w-full tw:flex-col tw:gap-0.5 tw:@[640px]/section-nav:flex tw:@max-[640px]/section-nav:hidden',\n className,\n )}\n >\n {groups.map((group) => (\n <SectionNavGroupRow\n key={group.id}\n group={group}\n activeId={activeId}\n renderItem={renderItem}\n showDescriptions={showDescriptions}\n />\n ))}\n </nav>\n\n <div className=\"tw:w-full tw:bg-background tw:@[640px]/section-nav:hidden tw:@max-[640px]/section-nav:block\">\n <DropdownMenu>\n <DropdownMenu.Trigger asChild>\n <Button variant=\"outline\" className=\"tw:w-full tw:justify-between\">\n <span className=\"tw:flex tw:min-w-0 tw:items-center tw:gap-2\">\n {CurrentIcon && <CurrentIcon className=\"tw:size-4 tw:shrink-0\" />}\n {current.parent && (\n <>\n <span className=\"tw:truncate tw:font-normal tw:text-muted-foreground\">\n {current.parent}\n </span>\n <span className=\"tw:text-border\">/</span>\n </>\n )}\n <span className=\"tw:truncate tw:font-medium tw:text-foreground\">\n {current.title}\n </span>\n </span>\n <ChevronDown className=\"tw:size-4 tw:shrink-0\" />\n </Button>\n </DropdownMenu.Trigger>\n\n <DropdownMenu.Content\n align=\"start\"\n className=\"tw:w-(--radix-dropdown-menu-trigger-width)\"\n >\n {groups.map((group) =>\n group.children.length > 0 ? (\n <DropdownMenu.Group key={group.id}>\n {/* A real item, not a label: it is a destination in the tree (it goes to the\n group's first section), so a menu that made it unclickable would be a different\n navigation, not a smaller one. Same row treatment as every other item. */}\n <DropdownMenu.Item asChild>\n {renderItem({\n targetId: group.children[0]?.id ?? group.id,\n isActive: false,\n children: <SectionNavItemContent item={group} active={holdsActive(group)} />,\n itemProps: {\n className: 'tw:no-underline',\n 'aria-current': undefined,\n 'aria-expanded': undefined,\n 'data-active': holdsActive(group) ? true : undefined,\n onClick: noop,\n },\n })}\n </DropdownMenu.Item>\n <div className=\"tw:ml-5 tw:border-l tw:border-border tw:py-0.5 tw:pl-1\">\n {group.children.map((child) => (\n <DropdownMenu.Item key={child.id} asChild>\n {renderItem({\n targetId: child.id,\n isActive: child.id === activeId,\n children: (\n <SectionNavItemContent\n item={child}\n active={child.id === activeId}\n showDescription={showDescriptions}\n showIcon={false}\n />\n ),\n itemProps: {\n className: 'tw:no-underline',\n 'aria-current': child.id === activeId ? 'page' : undefined,\n 'aria-expanded': undefined,\n 'data-active': undefined,\n onClick: noop,\n },\n })}\n </DropdownMenu.Item>\n ))}\n </div>\n </DropdownMenu.Group>\n ) : (\n <DropdownMenu.Item key={group.id} asChild>\n {renderItem({\n targetId: group.id,\n isActive: group.id === activeId,\n children: <SectionNavItemContent item={group} active={group.id === activeId} />,\n itemProps: {\n className: 'tw:no-underline',\n 'aria-current': group.id === activeId ? 'page' : undefined,\n 'aria-expanded': undefined,\n 'data-active': undefined,\n onClick: noop,\n },\n })}\n </DropdownMenu.Item>\n ),\n )}\n </DropdownMenu.Content>\n </DropdownMenu>\n </div>\n </>\n );\n};\n"],"mappings":";;;;;;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SectionNav/SectionNavItemContent.tsx","../src/blocks/SectionNav/SectionNavGroupRow.tsx","../src/blocks/SectionNav/SectionNav.tsx"],"sourcesContent":["import { Badge } from '../../components/Badge';\nimport { ChevronDown } from '../../icons';\nimport { cn } from '../../utils';\n\nimport type { SectionNavItem } from './types';\n\ntype Props = {\n item: SectionNavItem;\n /** Tints the title. */\n active: boolean;\n showDescription?: boolean;\n /** Group rows only — renders the chevron, pointing the way the list is about to move. */\n expanded?: boolean;\n /**\n * Sub-section rows pass `false`. A group's icon stands for the group, and repeating a glyph on\n * each indented child turns a short list into a column of competing marks: the indent and the\n * rule already say these belong to the row above. An item may still carry an `icon` for surfaces\n * that flatten the tree, such as a tab row, where every destination is top level.\n */\n showIcon?: boolean;\n};\n\n/**\n * One row's body, rendered identically in the tree and in the collapsed dropdown — same title, same\n * badge, same description. Shared rather than written twice so the two cannot drift.\n */\nexport const SectionNavItemContent = ({\n item,\n active,\n showDescription = false,\n expanded,\n showIcon = true,\n}: Props) => {\n const Icon = item.icon;\n\n return (\n <span className=\"tw:flex tw:min-w-0 tw:flex-1 tw:flex-col tw:gap-0.5\">\n <span className=\"tw:flex tw:items-center tw:gap-2\">\n {showIcon && Icon && <Icon className=\"tw:size-4 tw:shrink-0\" />}\n <span\n className={cn(\n 'tw:flex-1 tw:truncate tw:text-sm',\n active ? 'tw:font-medium tw:text-accent-foreground' : 'tw:text-foreground',\n )}\n >\n {item.title}\n </span>\n {item.isNew && (\n <Badge\n color=\"blue-inverse\"\n className=\"tw:min-h-0 tw:text-[10px]\"\n labelClassName=\"tw:px-1.5 tw:py-0\"\n >\n New\n </Badge>\n )}\n {expanded !== undefined && (\n <ChevronDown\n className={cn(\n 'tw:size-4 tw:shrink-0 tw:text-muted-foreground tw:transition-transform tw:duration-200',\n expanded && 'tw:rotate-180',\n )}\n />\n )}\n </span>\n {/* Descriptions wrap rather than truncate — they are the second line, not the label. A token\n with no break opportunity would still paint straight out of the 256px column, so break it. */}\n {showDescription && item.description && (\n <span className=\"tw:text-xs tw:break-words tw:text-muted-foreground\">\n {item.description}\n </span>\n )}\n </span>\n );\n};\n","import { useState } from 'react';\nimport type { MouseEvent, ReactNode } from 'react';\n\nimport { Collapsible } from '../../components/Collapsible';\nimport { cn, noop } from '../../utils';\n\nimport { SectionNavItemContent } from './SectionNavItemContent';\nimport type { SectionNavGroup, SectionNavItemRenderProps } from './types';\n\ntype Props = {\n group: SectionNavGroup;\n activeId: string | undefined;\n renderItem: (props: SectionNavItemRenderProps) => ReactNode;\n showDescriptions: boolean;\n};\n\n/**\n * The ring is **inset**, not an outline. A row is exactly as wide as the nav column, and\n * `PageLayout.Content nav` makes that column a scroll container (`overflow-y-auto`, which forces\n * `overflow-x` to `auto` too) — so there is 0px of slack for anything painted outside the border\n * box, and the browser's default `outline-offset: 1px` ring gets clipped on both edges. Painting\n * inside the box cannot be clipped, at any column width, by any ancestor.\n */\nconst FOCUS_RING =\n 'tw:focus-visible:outline-hidden tw:focus-visible:ring-2 tw:focus-visible:ring-inset tw:focus-visible:ring-ring';\n\nconst rowClass = (active: boolean) =>\n cn(\n 'tw:flex tw:w-full tw:cursor-pointer tw:items-center tw:gap-2 tw:rounded-md tw:border-none tw:px-3 tw:py-2 tw:text-left tw:text-sm tw:no-underline tw:transition-colors',\n FOCUS_RING,\n active\n ? 'tw:bg-accent tw:font-medium tw:text-accent-foreground'\n : 'tw:bg-transparent tw:text-foreground tw:hover:bg-muted',\n );\n\nconst childRowClass = (active: boolean) =>\n cn(\n 'tw:flex tw:w-full tw:cursor-pointer tw:rounded-md tw:border-none tw:px-3 tw:py-1.5 tw:text-left tw:no-underline tw:transition-colors',\n FOCUS_RING,\n active ? 'tw:bg-accent' : 'tw:bg-transparent tw:hover:bg-muted',\n );\n\n/**\n * One group row and its sub-sections. The row is a single control: it opens the group **and** goes to\n * its first section, and only collapses once you are already there — so the chevron never becomes a\n * separate thing to aim at, and one click always makes progress.\n */\nexport const SectionNavGroupRow = ({ group, activeId, renderItem, showDescriptions }: Props) => {\n // Open on arrival: the nav is short enough that hiding any of it costs more than it saves.\n const [open, setOpen] = useState(true);\n\n const hasChildren = group.children.length > 0;\n const targetId = group.children[0]?.id ?? group.id;\n const isCurrent = group.id === activeId;\n const holdsCurrent = isCurrent || group.children.some((child) => child.id === activeId);\n\n const onClick = (event: MouseEvent<HTMLElement>) => {\n if (!hasChildren) return;\n\n // Already on the row's target, so navigating would be a no-op and the only thing left for the\n // click to do is toggle. `preventDefault` is what tells the caller's link not to navigate.\n if (activeId === targetId) {\n event.preventDefault();\n setOpen((isOpen) => !isOpen);\n\n return;\n }\n\n setOpen(true);\n };\n\n return (\n <Collapsible open={open} onOpenChange={setOpen} className=\"tw:flex tw:flex-col tw:gap-0.5\">\n {renderItem({\n targetId,\n isActive: isCurrent,\n children: (\n <SectionNavItemContent\n item={group}\n active={holdsCurrent}\n expanded={hasChildren ? open : undefined}\n />\n ),\n itemProps: {\n className: rowClass(holdsCurrent),\n 'aria-current': isCurrent ? 'page' : undefined,\n 'aria-expanded': hasChildren ? open : undefined,\n 'data-active': holdsCurrent && !isCurrent ? true : undefined,\n onClick,\n },\n })}\n\n {hasChildren && (\n <Collapsible.Content>\n {/* `pl-1` keeps each row's background box off the group's rule — without it an active\n row's `bg-accent` sits flush against the line. 4px is also what lines the child titles\n (20 + 1 + 4 + 12 = 37px) up with the parent's, which its icon puts at 12 + 16 + 8 = 36px. */}\n {/* `my-0 mr-0` and not `m-0`: a host app emits its own `.tw\\:m-0` from its own source, and\n its stylesheet is the later one — shorthand and longhand at equal specificity means the\n app's `m-0` would land after this `ml-5` and flatten the indent. Longhands only, so\n nothing here can be overridden by a copy of a class this block also uses. */}\n <ul className=\"tw:my-0 tw:mr-0 tw:ml-5 tw:flex tw:list-none tw:flex-col tw:gap-0.5 tw:border-l tw:border-border tw:py-0.5 tw:pl-1\">\n {group.children.map((child) => {\n const active = child.id === activeId;\n\n return (\n <li key={child.id}>\n {renderItem({\n targetId: child.id,\n isActive: active,\n children: (\n <SectionNavItemContent\n item={child}\n active={active}\n showDescription={showDescriptions}\n showIcon={false}\n />\n ),\n itemProps: {\n className: childRowClass(active),\n 'aria-current': active ? 'page' : undefined,\n 'aria-expanded': undefined,\n 'data-active': undefined,\n onClick: noop,\n },\n })}\n </li>\n );\n })}\n {group.note && (\n <li className=\"tw:py-1 tw:pl-3 tw:text-xs tw:text-muted-foreground\">{group.note}</li>\n )}\n </ul>\n </Collapsible.Content>\n )}\n </Collapsible>\n );\n};\n","import type { ReactNode } from 'react';\n\nimport { Button } from '../../components/Button';\nimport { DropdownMenu } from '../../components/DropdownMenu';\nimport { ChevronDown } from '../../icons';\nimport { cn, noop } from '../../utils';\n\nimport { SectionNavGroupRow } from './SectionNavGroupRow';\nimport { SectionNavItemContent } from './SectionNavItemContent';\nimport type { SectionNavGroup, SectionNavItemRenderProps } from './types';\n\ntype Props = {\n /**\n * The sections to show, already filtered. Visibility, permissions and feature flags stay in the\n * app — this block renders exactly what it is handed, in order.\n */\n groups: SectionNavGroup[];\n /** `id` of the current section: a child's, or a childless group's. */\n activeId?: string;\n /**\n * Renders the clickable element for one row, so routing never enters the design system. Return a\n * `NavLink` / TanStack `Link` / `<a>` pointing at `targetId` and spread `itemProps` onto it.\n */\n renderItem: (props: SectionNavItemRenderProps) => ReactNode;\n /** Print each section's `description` under its title. Off — the tree stays scannable without it. */\n showDescriptions?: boolean;\n /** Accessible name for the tree's `<nav>`, and the collapsed label with nothing active. */\n label?: string;\n /** Applied to the tree's `<nav>`. The column's own geometry belongs to `PageLayout.Content nav`. */\n className?: string;\n};\n\n/**\n * In-page grouped navigation for one page's sections: a tree above the container's breakpoint, a\n * single dropdown below it. Both are rendered and CSS picks one, and both draw their rows through\n * the same renderer, so the two can never drift apart.\n *\n * **This is not `Sidebar`.** `Sidebar` is the app-level left rail — `SidebarProvider`, icon-collapse,\n * one per app shell, outside `PageLayout`. `SectionNav` is scoped to a single page's sections, lives\n * inside `PageLayout.Content`, and owns no global state. See `AGENTS.md`.\n *\n * **Router-agnostic:** `renderItem` is the seam. Pass it whatever your router calls a link.\n *\n * ```tsx\n * <PageLayout.Content nav={\n * <SectionNav\n * groups={groups}\n * activeId={activeId}\n * renderItem={({ targetId, children, itemProps }) => (\n * <Link to={targetId} {...itemProps}>{children}</Link>\n * )}\n * />\n * }>\n * {page}\n * </PageLayout.Content>\n * ```\n *\n * The tree↔dropdown switch is a **container** query on the content area's width, never the viewport\n * — a product sidebar or a chat panel narrows the page without the window resizing.\n * `PageLayout.Content nav={…}` names that container; standalone, put `tw:@container/section-nav` on\n * an ancestor yourself.\n *\n * @see RECIPES.md#section-nav\n */\nexport const SectionNav = ({\n groups,\n activeId,\n renderItem,\n showDescriptions = false,\n label = 'Sections',\n className,\n}: Props) => {\n /**\n * What the collapsed trigger names. A sub-section carries its group with it — \"Developer settings /\n * CLI agents\" — so the trigger says where you are, not just what page this is.\n */\n const activeChild = groups\n .flatMap((group) => group.children.map((child) => ({ group, child })))\n .find(({ child }) => child.id === activeId);\n const activeGroup = groups.find((group) => group.id === activeId);\n const current = activeChild\n ? {\n icon: activeChild.group.icon,\n title: activeChild.child.title,\n parent: activeChild.group.title,\n }\n : { icon: activeGroup?.icon, title: activeGroup?.title ?? label, parent: undefined };\n const CurrentIcon = current.icon;\n /** A group whose subtree holds the active section: tinted like the tree's row, but not `aria-current`. */\n const holdsActive = (group: SectionNavGroup) =>\n group.id === activeId || group.children.some((child) => child.id === activeId);\n\n return (\n <>\n {/* The reset is scoped (`.tailwindcss-preflight`, see `styles.css`), and the rows are\n caller-owned elements — `renderItem` returns the app's own `<a>`, which never inherits a\n scope this block does not open. Without it those rows are `content-box`, so the `w-full`\n + `px-3` in `rowClass` measures 24px wider than the 256px column and every row bleeds out\n of it. Opening the scope here covers the whole tree, rows included. */}\n {/* `display` is set by TWO container variants and never by a plain utility. A host app that\n emits `tw:flex` or `tw:hidden` from its own source ships an identical `.tw\\:flex` /\n `.tw\\:hidden` rule — same specificity, same layer, and its stylesheet is the later one, so\n whichever of the two this block wrote plainly would lose to the app's copy and the tree\n would be stuck visible or stuck hidden. Both variants are selectors only this block emits,\n and their queries are mutually exclusive, so nothing outside can outrank them. */}\n <nav\n aria-label={label}\n className={cn(\n 'tailwindcss-preflight',\n 'tw:w-full tw:flex-col tw:gap-0.5 tw:@[640px]/section-nav:flex tw:@max-[640px]/section-nav:hidden',\n className,\n )}\n >\n {groups.map((group) => (\n <SectionNavGroupRow\n key={group.id}\n group={group}\n activeId={activeId}\n renderItem={renderItem}\n showDescriptions={showDescriptions}\n />\n ))}\n </nav>\n\n <div className=\"tw:w-full tw:bg-background tw:@[640px]/section-nav:hidden tw:@max-[640px]/section-nav:block\">\n <DropdownMenu>\n <DropdownMenu.Trigger asChild>\n <Button variant=\"outline\" className=\"tw:w-full tw:justify-between\">\n <span className=\"tw:flex tw:min-w-0 tw:items-center tw:gap-2\">\n {CurrentIcon && <CurrentIcon className=\"tw:size-4 tw:shrink-0\" />}\n {current.parent && (\n <>\n <span className=\"tw:truncate tw:font-normal tw:text-muted-foreground\">\n {current.parent}\n </span>\n <span className=\"tw:text-border\">/</span>\n </>\n )}\n <span className=\"tw:truncate tw:font-medium tw:text-foreground\">\n {current.title}\n </span>\n </span>\n <ChevronDown className=\"tw:size-4 tw:shrink-0\" />\n </Button>\n </DropdownMenu.Trigger>\n\n <DropdownMenu.Content\n align=\"start\"\n className=\"tw:w-(--radix-dropdown-menu-trigger-width)\"\n >\n {groups.map((group) =>\n group.children.length > 0 ? (\n <DropdownMenu.Group key={group.id}>\n {/* A real item, not a label: it is a destination in the tree (it goes to the\n group's first section), so a menu that made it unclickable would be a different\n navigation, not a smaller one. Same row treatment as every other item. */}\n <DropdownMenu.Item asChild>\n {renderItem({\n targetId: group.children[0]?.id ?? group.id,\n isActive: false,\n children: <SectionNavItemContent item={group} active={holdsActive(group)} />,\n itemProps: {\n className: 'tw:no-underline',\n 'aria-current': undefined,\n 'aria-expanded': undefined,\n 'data-active': holdsActive(group) ? true : undefined,\n onClick: noop,\n },\n })}\n </DropdownMenu.Item>\n <div className=\"tw:ml-5 tw:border-l tw:border-border tw:py-0.5 tw:pl-1\">\n {group.children.map((child) => (\n <DropdownMenu.Item key={child.id} asChild>\n {renderItem({\n targetId: child.id,\n isActive: child.id === activeId,\n children: (\n <SectionNavItemContent\n item={child}\n active={child.id === activeId}\n showDescription={showDescriptions}\n showIcon={false}\n />\n ),\n itemProps: {\n className: 'tw:no-underline',\n 'aria-current': child.id === activeId ? 'page' : undefined,\n 'aria-expanded': undefined,\n 'data-active': undefined,\n onClick: noop,\n },\n })}\n </DropdownMenu.Item>\n ))}\n </div>\n </DropdownMenu.Group>\n ) : (\n <DropdownMenu.Item key={group.id} asChild>\n {renderItem({\n targetId: group.id,\n isActive: group.id === activeId,\n children: <SectionNavItemContent item={group} active={group.id === activeId} />,\n itemProps: {\n className: 'tw:no-underline',\n 'aria-current': group.id === activeId ? 'page' : undefined,\n 'aria-expanded': undefined,\n 'data-active': undefined,\n onClick: noop,\n },\n })}\n </DropdownMenu.Item>\n ),\n )}\n </DropdownMenu.Content>\n </DropdownMenu>\n </div>\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AA0BA,MAAa,yBAAyB,EACpC,MACA,QACA,kBAAkB,OAClB,UACA,WAAW,WACA;CACX,MAAM,OAAO,KAAK;CAElB,OACE,qBAAC,QAAD;EAAM,WAAU;EAAhB,UAAA,CACE,qBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA;IACG,YAAY,QAAQ,oBAAC,MAAD,EAAM,WAAU,wBAAyB,CAAA;IAC9D,oBAAC,QAAD;KACE,WAAW,GACT,oCACA,SAAS,6CAA6C,oBACxD;KAEC,UAAA,KAAK;IACF,CAAA;IACL,KAAK,SACJ,oBAAC,OAAD;KACE,OAAM;KACN,WAAU;KACV,gBAAe;KAChB,UAAA;IAEM,CAAA;IAER,aAAa,KAAA,KACZ,oBAAC,aAAD,EACE,WAAW,GACT,0FACA,YAAY,eACd,EACD,CAAA;GAE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,MAAM,OAAO;OACrB,iBAAiB;OACjB,UAAU;MACX,CAAA;MAEH,WAAW;OACT,WAAW;OACX,gBAAgB,MAAM,OAAO,WAAW,SAAS,KAAA;OACjD,iBAAiB,KAAA;OACjB,eAAe,KAAA;OACf,SAAS;MACX;KACF,CAAC;IACgB,GApBK,MAAM,EAoBX,CACpB;GACE,CAAA,CACa,EAAA,GA3CK,MAAM,EA2CX,IAEpB,oBAAC,aAAa,MAAd;IAAkC,SAAA;IAC/B,UAAA,WAAW;KACV,UAAU,MAAM;KAChB,UAAU,MAAM,OAAO;KACvB,UAAU,oBAAC,uBAAD;MAAuB,MAAM;MAAO,QAAQ,MAAM,OAAO;KAAW,CAAA;KAC9E,WAAW;MACT,WAAW;MACX,gBAAgB,MAAM,OAAO,WAAW,SAAS,KAAA;MACjD,iBAAiB,KAAA;MACjB,eAAe,KAAA;MACf,SAAS;KACX;IACF,CAAC;GACgB,GAbK,MAAM,EAaX,CAEvB;EACoB,CAAA,CACV,EAAA,CAAA;CACX,CAAA,CACL,EAAA,CAAA;AAEN"}
@@ -1,7 +1,7 @@
1
1
  import { cn } from "./classNames-BzrkDnOD.js";
2
- import { useArgoDesign } from "./context-BrNtMc1H.js";
2
+ import { useArgoDesign } from "./context-D7X470dy.js";
3
3
  import { Check, ChevronDown, ChevronUp } from "./icons-Cek151jC.js";
4
- import { Button } from "./Button-CPsEQuTN.js";
4
+ import { Button } from "./Button-DsRrU5F1.js";
5
5
  import { overlayTriggerVariants } from "./styles-BAFscjSV.js";
6
6
  import { useId } from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -50,22 +50,31 @@ const SelectGroup = ({ className, ...props }) => /* @__PURE__ */ jsx(SelectPrimi
50
50
  });
51
51
  //#endregion
52
52
  //#region src/components/Select/SelectItem.tsx
53
- const SelectItem = ({ ref, className, children, icon, ...props }) => /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
54
- ...props,
55
- ref,
56
- className: cn("tw:group/select-item", "tw:relative", "tw:flex", "tw:flex-1", "tw:items-center", "tw:gap-2", "tw:py-2", "tw:px-2", "tw:group-data-[variant=default]/select-content:px-4", "tw:rounded-lg", "tw:group-data-[variant=default]/select-content:rounded-none", "tw:text-sm", "tw:select-none", "tw:cursor-default", "tw:outline-hidden", "tw:focus:outline-hidden", "tw:data-[highlighted]:bg-accent", "tw:group-data-[variant=default]/select-content:data-[highlighted]:bg-secondary", "tw:data-[highlighted]:text-accent-foreground", "tw:group-data-[variant=default]/select-content:data-[highlighted]:text-secondary-foreground", "tw:data-[disabled]:pointer-events-none", "tw:data-[disabled]:opacity-50", "tw:[&_svg]:pointer-events-none", "tw:[&_svg]:shrink-0", "tw:[&_svg]:text-muted-foreground", "tw:[&_svg:not([class*='tw:size-'])]:size-4", className),
57
- children: [
58
- icon,
59
- /* @__PURE__ */ jsx("span", {
60
- className: "tw:flex-1 tw:truncate",
61
- children: /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
62
- }),
63
- /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, {
64
- className: "tw:pointer-events-none",
65
- children: /* @__PURE__ */ jsx(Check, { className: "tw:size-4" })
66
- })
67
- ]
68
- });
53
+ const SelectItem = ({ ref, className, children, icon, hint, "aria-describedby": ariaDescribedBy, ...props }) => {
54
+ const hintId = useId();
55
+ return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
56
+ ...props,
57
+ ref,
58
+ "aria-describedby": [ariaDescribedBy, hint ? hintId : null].filter(Boolean).join(" ") || void 0,
59
+ className: cn("tw:group/select-item", "tw:relative", "tw:flex", "tw:flex-1", "tw:items-center", "tw:gap-2", "tw:py-2", "tw:px-2", "tw:group-data-[variant=default]/select-content:px-4", "tw:rounded-lg", "tw:group-data-[variant=default]/select-content:rounded-none", "tw:text-sm", "tw:select-none", "tw:cursor-default", "tw:outline-hidden", "tw:focus:outline-hidden", "tw:data-[highlighted]:bg-accent", "tw:group-data-[variant=default]/select-content:data-[highlighted]:bg-secondary", "tw:data-[highlighted]:text-accent-foreground", "tw:group-data-[variant=default]/select-content:data-[highlighted]:text-secondary-foreground", "tw:data-[disabled]:pointer-events-none", "tw:data-[disabled]:opacity-50", "tw:[&_svg]:pointer-events-none", "tw:[&_svg]:shrink-0", "tw:[&_svg]:text-muted-foreground", "tw:[&_svg:not([class*='tw:size-'])]:size-4", className),
60
+ children: [
61
+ icon,
62
+ /* @__PURE__ */ jsx("span", {
63
+ className: "tw:flex-1 tw:truncate",
64
+ children: /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
65
+ }),
66
+ hint && /* @__PURE__ */ jsx("span", {
67
+ id: hintId,
68
+ className: "tw:shrink-0 tw:text-xs tw:text-muted-foreground",
69
+ children: hint
70
+ }),
71
+ /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, {
72
+ className: "tw:pointer-events-none",
73
+ children: /* @__PURE__ */ jsx(Check, { className: "tw:size-4" })
74
+ })
75
+ ]
76
+ });
77
+ };
69
78
  //#endregion
70
79
  //#region src/components/Select/SelectLabel.tsx
71
80
  const SelectLabel = ({ className, ...props }) => /* @__PURE__ */ jsx(SelectPrimitive.Label, {
@@ -130,11 +139,12 @@ const isGroup = (itemOrGroup) => "items" in itemOrGroup;
130
139
  * for forms with validation. Use the compound parts (`Select.Root`, `Select.Trigger`, `Select.Content`,
131
140
  * `Select.Item`) for custom item layouts; the top-level `Select` covers the common cases.
132
141
  */
133
- const Select = ({ value, defaultValue, onValueChange, disabled, name, required, open, defaultOpen, onOpenChange, dir, autoComplete, form, variant, state, sizing, placeholder, id, className, onBlur, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, items = [] }) => {
142
+ const Select = ({ value, defaultValue, onValueChange, disabled, name, required, open, defaultOpen, onOpenChange, dir, autoComplete, form, variant, state, sizing, placeholder, className, onBlur, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, items = [], ...accessibleName }) => {
134
143
  const groupKeyId = useId();
135
144
  const renderItem = (item) => /* @__PURE__ */ jsx(SelectItem, {
136
145
  value: item.value,
137
146
  icon: item.icon,
147
+ hint: item.hint,
138
148
  disabled: item.disabled,
139
149
  children: item.label
140
150
  }, item.value);
@@ -152,11 +162,11 @@ const Select = ({ value, defaultValue, onValueChange, disabled, name, required,
152
162
  autoComplete,
153
163
  form,
154
164
  children: [/* @__PURE__ */ jsx(SelectTrigger, {
165
+ ...accessibleName,
155
166
  variant,
156
167
  state,
157
168
  sizing,
158
169
  placeholder,
159
- id,
160
170
  className,
161
171
  onBlur,
162
172
  "aria-describedby": ariaDescribedBy,
@@ -178,4 +188,4 @@ Select.Separator = SelectSeparator;
178
188
  //#endregion
179
189
  export { Select };
180
190
 
181
- //# sourceMappingURL=Select-D6IZVvwL.js.map
191
+ //# sourceMappingURL=Select-DV3Hak_l.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select-DV3Hak_l.js","names":["SelectItemComponent"],"sources":["../src/components/Select/SelectContent.tsx","../src/components/Select/SelectGroup.tsx","../src/components/Select/SelectItem.tsx","../src/components/Select/SelectLabel.tsx","../src/components/Select/SelectRoot.tsx","../src/components/Select/SelectSeparator.tsx","../src/components/Select/SelectTrigger.tsx","../src/components/Select/Select.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\n\nimport { ChevronDown, ChevronUp } from '../../icons';\nimport { cn } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nconst scrollButtonStyles = cn(\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:rounded-sm',\n 'tw:p-1',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-5',\n);\n\ntype Variant = 'default' | 'argo';\n\n/**\n * Props for `Select.Content`. `container` portals the listbox into a custom element (useful inside modals).\n */\ntype Props = ComponentProps<typeof SelectPrimitive.Content> & {\n container?: HTMLElement | null;\n};\n\n/**\n * Listbox container for `Select`. Portals items into a popover sized to the trigger.\n * Normally rendered implicitly by `Select`; use directly only when composing custom item layouts via\n * the `Select.Root` / `Select.Trigger` / `Select.Content` compound parts.\n */\nexport const SelectContent = ({\n ref,\n className,\n children,\n container,\n position = 'popper',\n sideOffset = 4,\n ...props\n}: Props) => {\n const effectiveVariant: Variant = useArgoDesign() ? 'argo' : 'default';\n return (\n <SelectPrimitive.Portal container={container}>\n <SelectPrimitive.Content\n {...props}\n ref={ref}\n position={position}\n sideOffset={sideOffset}\n data-variant={effectiveVariant}\n className={cn(\n 'tailwindcss-preflight',\n 'tw:group/select-content',\n // Floating tier above Modal (1051): Tooltip 1060 / Combobox·Popover·Select 1055 / Modal 1051 / DropdownMenu.SubContent 1041 / FullScreenModal 1039\n 'tw:z-[1055]',\n\n // layout\n 'tw:flex tw:flex-col',\n 'tw:p-1',\n 'tw:data-[variant=default]:p-0',\n 'tw:overflow-hidden',\n 'tw:origin-(--radix-select-content-transform-origin)',\n\n // sizing\n 'tw:max-h-[var(--radix-select-content-available-height)]',\n 'tw:min-w-[var(--radix-select-trigger-width)]',\n\n // appearance\n 'tw:bg-popover',\n 'tw:text-popover-foreground',\n 'tw:shadow-md',\n 'tw:ring-1',\n 'tw:ring-foreground/10',\n 'tw:rounded-lg',\n 'tw:data-[variant=default]:rounded',\n\n // open animation\n 'tw:data-[state=open]:animate-in',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=open]:zoom-in-95',\n\n // closed animation\n 'tw:data-[state=closed]:animate-out',\n 'tw:data-[state=closed]:fade-out-0',\n 'tw:data-[state=closed]:zoom-out-95',\n\n // position animations\n 'tw:data-[side=bottom]:slide-in-from-top-2',\n 'tw:data-[side=left]:slide-in-from-right-2',\n 'tw:data-[side=right]:slide-in-from-left-2',\n 'tw:data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n >\n <SelectPrimitive.ScrollUpButton className={scrollButtonStyles}>\n <ChevronUp />\n </SelectPrimitive.ScrollUpButton>\n\n <SelectPrimitive.Viewport\n className={cn({\n 'tw:h-[var(--radix-select-trigger-height)] tw:w-full tw:min-w-[var(--radix-select-trigger-width)]':\n position === 'popper',\n })}\n >\n {children}\n </SelectPrimitive.Viewport>\n\n <SelectPrimitive.ScrollDownButton className={scrollButtonStyles}>\n <ChevronDown />\n </SelectPrimitive.ScrollDownButton>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n};\n","import type { ComponentProps } from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof SelectPrimitive.Group>;\n\nexport const SelectGroup = ({ className, ...props }: Props) => (\n <SelectPrimitive.Group {...props} className={cn('tw:flex tw:flex-col tw:gap-0.5', className)} />\n);\n","import { useId } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\n\nimport { Check } from '../../icons';\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof SelectPrimitive.Item> & {\n icon?: ReactNode;\n hint?: ReactNode;\n};\n\nexport const SelectItem = ({\n ref,\n className,\n children,\n icon,\n hint,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}: Props) => {\n const hintId = useId();\n\n return (\n <SelectPrimitive.Item\n {...props}\n ref={ref}\n // Radix names the option from `ItemText` alone (`aria-labelledby`), so the hint is\n // described rather than named — it reaches a screen reader without joining the label.\n aria-describedby={\n [ariaDescribedBy, hint ? hintId : null].filter(Boolean).join(' ') || undefined\n }\n className={cn(\n 'tw:group/select-item',\n\n // layout\n 'tw:relative',\n 'tw:flex',\n 'tw:flex-1',\n 'tw:items-center',\n 'tw:gap-2',\n\n // spacing — default variant uses tighter radius and wider horizontal padding\n 'tw:py-2',\n 'tw:px-2',\n 'tw:group-data-[variant=default]/select-content:px-4',\n 'tw:rounded-lg',\n 'tw:group-data-[variant=default]/select-content:rounded-none',\n\n // typography\n 'tw:text-sm',\n 'tw:select-none',\n 'tw:cursor-default',\n 'tw:outline-hidden',\n\n // highlighted (keyboard / hover)\n 'tw:focus:outline-hidden',\n 'tw:data-[highlighted]:bg-accent',\n // The legacy highlight is a neutral step, not the argo accent.\n //\n // - `secondary` carries its own foreground, so fill and ink move together.\n // - `muted` is unusable: in dark it equals `popover`, so the band would disappear\n // into the listbox.\n 'tw:group-data-[variant=default]/select-content:data-[highlighted]:bg-secondary',\n 'tw:data-[highlighted]:text-accent-foreground',\n 'tw:group-data-[variant=default]/select-content:data-[highlighted]:text-secondary-foreground',\n\n // disabled\n 'tw:data-[disabled]:pointer-events-none',\n 'tw:data-[disabled]:opacity-50',\n\n // child svg defaults\n 'tw:[&_svg]:pointer-events-none',\n 'tw:[&_svg]:shrink-0',\n 'tw:[&_svg]:text-muted-foreground',\n \"tw:[&_svg:not([class*='tw:size-'])]:size-4\",\n className,\n )}\n >\n {icon}\n <span className=\"tw:flex-1 tw:truncate\">\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </span>\n {/* Outside `ItemText`, so the trigger shows the label alone once the option is picked. */}\n {hint && (\n <span id={hintId} className=\"tw:shrink-0 tw:text-xs tw:text-muted-foreground\">\n {hint}\n </span>\n )}\n <SelectPrimitive.ItemIndicator className=\"tw:pointer-events-none\">\n <Check className=\"tw:size-4\" />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n );\n};\n","import type { ComponentProps } from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof SelectPrimitive.Label>;\n\nexport const SelectLabel = ({ className, ...props }: Props) => (\n <SelectPrimitive.Label\n {...props}\n className={cn(\n // Base (argo variant) — soft gray section label\n 'tw:px-2',\n 'tw:py-1.5',\n 'tw:text-xs',\n 'tw:font-medium',\n 'tw:leading-none',\n 'tw:text-muted-foreground',\n\n // Default variant — uppercase tracked label, matches Combobox default\n 'tw:group-data-[variant=default]/select-content:uppercase',\n 'tw:group-data-[variant=default]/select-content:font-semibold',\n 'tw:group-data-[variant=default]/select-content:tracking-wider',\n 'tw:group-data-[variant=default]/select-content:text-[11px]',\n 'tw:group-data-[variant=default]/select-content:text-black',\n 'tw:group-data-[variant=default]/select-content:pt-2',\n 'tw:group-data-[variant=default]/select-content:px-4',\n\n className,\n )}\n />\n);\n","import type { ReactNode } from 'react';\nimport { Root } from '@radix-ui/react-select';\n\n// Mirror Radix's `SelectProps` as an explicit list. We can't infer via\n// `ComponentProps<typeof Root>` or reuse Radix's `SelectProps` directly: both\n// transitively reference the un-exported `SelectSharedProps` interface, and\n// TS4023 fires when DTS emits anything that consumes it (e.g. `useAppForm`).\n// Keep this in sync with `@radix-ui/react-select`'s `SelectProps` shape.\nexport type SelectRootProps = {\n // SelectSharedProps\n children?: ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n dir?: 'ltr' | 'rtl';\n name?: string;\n autoComplete?: string;\n disabled?: boolean;\n required?: boolean;\n form?: string;\n // SelectProps\n value?: string;\n defaultValue?: string;\n onValueChange?(value: string): void;\n};\n\nexport const SelectRoot = (props: SelectRootProps) => <Root {...props} />;\n","import type { ComponentProps } from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof SelectPrimitive.Separator>;\n\nexport const SelectSeparator = ({ className, ...props }: Props) => (\n <SelectPrimitive.Separator\n {...props}\n className={cn('tw:mx-2 tw:my-1 tw:h-px tw:bg-border', className)}\n />\n);\n","import type { ComponentProps } from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { type VariantProps } from 'class-variance-authority';\n\nimport { ChevronDown } from '../../icons';\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\nimport { overlayTriggerVariants } from '../OverlayTrigger/styles';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\ntype BaseProps = ComponentProps<typeof SelectPrimitive.Trigger> &\n Omit<VariantProps<typeof overlayTriggerVariants>, 'variant'> & {\n variant?: Exclude<VariantProps<typeof overlayTriggerVariants>['variant'], 'argo'> | 'inline';\n } & Pick<ComponentProps<typeof SelectPrimitive.Value>, 'placeholder'>;\n\n/**\n * The trigger needs an accessible name, so one of the three routes to one is required.\n *\n * - `role=\"combobox\"` is not a name-from-content role: neither the selected item's label nor the\n * `placeholder` names it.\n * - `id` counts only when a `<Label htmlFor>` points at it — the type cannot check that pair.\n * - Passing more than one is allowed; `aria-label` wins over a `<Label htmlFor>`.\n */\ntype SelectTriggerProps = BaseProps &\n (\n | Required<Pick<BaseProps, 'aria-label'>>\n | Required<Pick<BaseProps, 'aria-labelledby'>>\n | Required<Pick<BaseProps, 'id'>>\n );\n\nexport const SelectTrigger = ({\n ref,\n className,\n variant,\n state,\n sizing,\n placeholder,\n ...props\n}: SelectTriggerProps) => {\n const isArgoDesign = useArgoDesign();\n const effectiveVariant = (() => {\n if (variant === 'inline') return 'inline';\n if (isArgoDesign) return 'argo';\n return variant;\n })();\n const isInlineVariant = effectiveVariant === 'inline';\n\n if (isInlineVariant)\n return (\n <SelectPrimitive.Trigger {...props} ref={ref} className={cn(className)} asChild>\n <Button variant=\"inline\">\n <SelectPrimitive.Value placeholder={placeholder} />\n <SelectPrimitive.Icon asChild>\n <ChevronDown />\n </SelectPrimitive.Icon>\n </Button>\n </SelectPrimitive.Trigger>\n );\n\n return (\n <SelectPrimitive.Trigger\n {...props}\n ref={ref}\n className={cn(\n overlayTriggerVariants({ variant: effectiveVariant, state, sizing }),\n className,\n )}\n >\n <SelectPrimitive.Value placeholder={placeholder} />\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"tw:size-4 tw:text-muted-foreground\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n};\n","import { useId } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { SelectContent } from './SelectContent';\nimport { SelectGroup } from './SelectGroup';\nimport { SelectItem as SelectItemComponent } from './SelectItem';\nimport { SelectLabel } from './SelectLabel';\nimport { SelectRoot, type SelectRootProps } from './SelectRoot';\nimport { SelectSeparator } from './SelectSeparator';\nimport { SelectTrigger } from './SelectTrigger';\n\nexport type SelectItem = {\n value: string;\n label: ReactNode;\n icon?: ReactNode;\n /** Trailing muted note shown in the listbox only — never in the trigger. */\n hint?: ReactNode;\n disabled?: boolean;\n};\n\nexport type SelectItemGroup = {\n label?: ReactNode;\n items: readonly SelectItem[];\n};\n\nconst isGroup = (itemOrGroup: SelectItem | SelectItemGroup): itemOrGroup is SelectItemGroup =>\n 'items' in itemOrGroup;\n\ntype TriggerProps = ComponentProps<typeof SelectTrigger>;\n\ntype BaseProps = Pick<\n SelectRootProps,\n | 'value'\n | 'defaultValue'\n | 'onValueChange'\n | 'disabled'\n | 'name'\n | 'required'\n | 'open'\n | 'defaultOpen'\n | 'onOpenChange'\n | 'dir'\n | 'autoComplete'\n | 'form'\n> &\n Pick<\n TriggerProps,\n | 'variant'\n | 'state'\n | 'sizing'\n | 'placeholder'\n | 'id'\n | 'className'\n | 'onBlur'\n | 'aria-label'\n | 'aria-labelledby'\n | 'aria-describedby'\n | 'aria-invalid'\n | 'aria-required'\n > & {\n items?: readonly (SelectItem | SelectItemGroup)[];\n };\n\n/**\n * A `Select` needs an accessible name, so one of the three routes to one is required.\n *\n * - `role=\"combobox\"` is not a name-from-content role: neither the selected item's label nor the\n * `placeholder` names the trigger.\n * - `id` counts only when a `<Label htmlFor>` points at it — the type cannot check that pair.\n * - Passing more than one is allowed; `aria-label` wins over a `<Label htmlFor>`.\n */\nexport type SelectProps = BaseProps &\n (\n | Required<Pick<BaseProps, 'aria-label'>>\n | Required<Pick<BaseProps, 'aria-labelledby'>>\n | Required<Pick<BaseProps, 'id'>>\n );\n\n/**\n * Single selection from a short enumerated list. Built on Radix Select.\n *\n * **When to use:** picking one value from ~10 or fewer options where search adds no value (status,\n * region, role). Pass a flat `items` array or grouped arrays with optional labels for headings.\n * **When NOT to use:** for longer lists with search use `Combobox`; for multi-select use `MultiCombobox`.\n * **Composition:** wrap in `FormGroup` for label + help text, or use `useAppForm` + `field.SelectField`\n * for forms with validation. Use the compound parts (`Select.Root`, `Select.Trigger`, `Select.Content`,\n * `Select.Item`) for custom item layouts; the top-level `Select` covers the common cases.\n */\nexport const Select = ({\n // root\n value,\n defaultValue,\n onValueChange,\n disabled,\n name,\n required,\n open,\n defaultOpen,\n onOpenChange,\n dir,\n autoComplete,\n form,\n // trigger\n variant,\n state,\n sizing,\n placeholder,\n className,\n onBlur,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'aria-required': ariaRequired,\n // items\n items = [],\n // `id` / `aria-label` / `aria-labelledby` stay grouped: the trigger requires one of them, and\n // destructuring them apart would hand it three independently optional props instead.\n ...accessibleName\n}: SelectProps) => {\n const groupKeyId = useId();\n\n const renderItem = (item: SelectItem) => (\n <SelectItemComponent\n key={item.value}\n value={item.value}\n icon={item.icon}\n hint={item.hint}\n disabled={item.disabled}\n >\n {item.label}\n </SelectItemComponent>\n );\n\n return (\n <SelectRoot\n value={value}\n defaultValue={defaultValue}\n onValueChange={onValueChange}\n disabled={disabled}\n name={name}\n required={required}\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n dir={dir}\n autoComplete={autoComplete}\n form={form}\n >\n <SelectTrigger\n {...accessibleName}\n variant={variant}\n state={state}\n sizing={sizing}\n placeholder={placeholder}\n className={className}\n onBlur={onBlur}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n aria-required={ariaRequired}\n />\n <SelectContent>\n {items.map((itemOrGroup, index) => {\n if (isGroup(itemOrGroup)) {\n return (\n <SelectGroup key={`${groupKeyId}-group-${index}`}>\n {itemOrGroup.label && <SelectLabel>{itemOrGroup.label}</SelectLabel>}\n {itemOrGroup.items.map(renderItem)}\n </SelectGroup>\n );\n }\n\n return renderItem(itemOrGroup);\n })}\n </SelectContent>\n </SelectRoot>\n );\n};\n\nSelect.Root = SelectRoot;\nSelect.Trigger = SelectTrigger;\nSelect.Content = SelectContent;\nSelect.Item = SelectItemComponent;\nSelect.Group = SelectGroup;\nSelect.Label = SelectLabel;\nSelect.Separator = SelectSeparator;\n"],"mappings":";;;;;;;;;;AAOA,MAAM,qBAAqB,GACzB,WACA,mBACA,qBACA,iBACA,UACA,8CACF;;;;;;AAgBA,MAAa,iBAAiB,EAC5B,KACA,WACA,UACA,WACA,WAAW,UACX,aAAa,GACb,GAAG,YACQ;CACX,MAAM,mBAA4B,cAAc,IAAI,SAAS;CAC7D,OACE,oBAAC,gBAAgB,QAAjB;EAAmC;EACjC,UAAA,qBAAC,gBAAgB,SAAjB;GACE,GAAI;GACC;GACK;GACE;GACZ,gBAAc;GACd,WAAW,GACT,yBACA,2BAEA,eAGA,uBACA,UACA,iCACA,sBACA,uDAGA,2DACA,gDAGA,iBACA,8BACA,gBACA,aACA,yBACA,iBACA,qCAGA,mCACA,kCACA,mCAGA,sCACA,qCACA,sCAGA,6CACA,6CACA,6CACA,6CACA,SACF;GAhDF,UAAA;IAkDE,oBAAC,gBAAgB,gBAAjB;KAAgC,WAAW;KACzC,UAAA,oBAAC,WAAD,CAAY,CAAA;IACkB,CAAA;IAEhC,oBAAC,gBAAgB,UAAjB;KACE,WAAW,GAAG,EACZ,oGACE,aAAa,SACjB,CAAC;KAEA;IACuB,CAAA;IAE1B,oBAAC,gBAAgB,kBAAjB;KAAkC,WAAW;KAC3C,UAAA,oBAAC,aAAD,CAAc,CAAA;IACkB,CAAA;GACX;;CACH,CAAA;AAE5B;;;ACxGA,MAAa,eAAe,EAAE,WAAW,GAAG,YAC1C,oBAAC,gBAAgB,OAAjB;CAAuB,GAAI;CAAO,WAAW,GAAG,kCAAkC,SAAS;AAAI,CAAA;;;ACIjG,MAAa,cAAc,EACzB,KACA,WACA,UACA,MACA,MACA,oBAAoB,iBACpB,GAAG,YACQ;CACX,MAAM,SAAS,MAAM;CAErB,OACE,qBAAC,gBAAgB,MAAjB;EACE,GAAI;EACC;EAGL,oBACE,CAAC,iBAAiB,OAAO,SAAS,IAAI,CAAC,CAAC,O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A,CACG,YAAY,SAAS,oBAAC,aAAD,EAAA,UAAc,YAAY,MAAmB,CAAA,GAClE,YAAY,MAAM,IAAI,UAAU,CACtB,EAAA,GAHK,GAAG,WAAW,SAAS,OAG5B;GAIjB,OAAO,WAAW,WAAW;EAC/B,CAAC,EACY,CAAA,CACL;;AAEhB;AAEA,OAAO,OAAO;AACd,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,OAAOA;AACd,OAAO,QAAQ;AACf,OAAO,QAAQ;AACf,OAAO,YAAY"}
@@ -1,7 +1,7 @@
1
1
  import { cn } from "./classNames-BzrkDnOD.js";
2
- import { useArgoDesign } from "./context-BrNtMc1H.js";
2
+ import { useArgoDesign } from "./context-D7X470dy.js";
3
3
  import { X } from "./icons-Cek151jC.js";
4
- import { Button } from "./Button-CPsEQuTN.js";
4
+ import { Button } from "./Button-DsRrU5F1.js";
5
5
  import { ModalDescription, ModalOverlay, ModalTitle } from "./ModalTitle-C76ke2eo.js";
6
6
  import { cva } from "class-variance-authority";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -166,4 +166,4 @@ Sheet.Body = SheetBody;
166
166
  //#endregion
167
167
  export { Sheet };
168
168
 
169
- //# sourceMappingURL=Sheet-BIzs2K2H.js.map
169
+ //# sourceMappingURL=Sheet-Chf0kX1E.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet-BIzs2K2H.js","names":[],"sources":["../src/components/Sheet/SheetBody.tsx","../src/components/Sheet/SheetOverlay.tsx","../src/components/Sheet/SheetContent.tsx","../src/components/Sheet/SheetFooter.tsx","../src/components/Sheet/SheetHeader.tsx","../src/components/Sheet/SheetTitle.tsx","../src/components/Sheet/Sheet.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const SheetBody = ({ className, ...rest }: Props) => (\n <div\n {...rest}\n className={cn('tw:flex', 'tw:flex-col', 'tw:overflow-x-hidden', 'tw:px-4', className)}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { ModalOverlay } from '../Modal/ModalOverlay';\n\ntype Props = ComponentProps<typeof ModalOverlay>;\n\n// Assuming it should have the same style as standard modal, if not remove the modal dependency and style it separately.\nexport const SheetOverlay = ({ ref, ...props }: Props) => <ModalOverlay ref={ref} {...props} />;\n","import type { ComponentProps } from 'react';\nimport { Content, Portal } from '@radix-ui/react-dialog';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { SheetOverlay } from './SheetOverlay';\n\nconst sheetContentVariants = cva(\n [\n // reset\n 'tailwindcss-preflight',\n\n // positioning\n 'tw:fixed',\n\n // Use standard tailwindcss class when, global override in tooltip.less file is removed.\n 'tw:z-[1051]',\n\n 'tw:flex',\n 'tw:flex-col',\n\n 'tw:bg-card',\n 'tw:text-card-foreground',\n 'tw:shadow-lg',\n\n // argo chrome overrides\n 'tw:data-[argo=true]:border',\n 'tw:data-[argo=true]:border-border',\n 'tw:data-[argo=true]:focus-visible:outline-hidden',\n 'tw:data-[argo=true]:focus-visible:ring-2',\n 'tw:data-[argo=true]:focus-visible:ring-ring/50',\n\n 'tw:ease-in-out',\n // opening animation\n 'tw:data-[state=open]:duration-200',\n\n // close animation\n 'tw:data-[state=closed]:duration-200',\n ],\n {\n defaultVariants: {\n side: 'right',\n disableTransition: false,\n },\n variants: {\n disableTransition: {\n true: [],\n false: ['tw:data-[state=open]:animate-in', 'tw:data-[state=closed]:animate-out'],\n },\n side: {\n top: [\n 'tw:inset-x-0',\n 'tw:top-0',\n 'tw:h-auto',\n 'tw:data-[state=closed]:slide-out-to-top',\n 'tw:data-[state=open]:slide-in-from-top',\n 'tw:data-[argo=true]:rounded-b-lg',\n ],\n right: [\n 'tw:inset-y-0',\n 'tw:right-0',\n 'tw:h-full',\n 'tw:data-[state=closed]:slide-out-to-right',\n 'tw:data-[state=open]:slide-in-from-right',\n 'tw:data-[argo=true]:rounded-l-lg',\n ],\n\n bottom: [\n 'tw:inset-x-0',\n 'tw:bottom-0',\n 'tw:h-auto',\n 'tw:data-[state=closed]:slide-out-to-bottom',\n 'tw:data-[state=open]:slide-in-from-bottom',\n 'tw:drop-shadow-2xl', // standard tailwindcss shadow is invisible for a bottom sheet because of positioning\n 'tw:data-[argo=true]:rounded-t-lg',\n ],\n\n left: [\n 'tw:inset-y-0',\n 'tw:left-0',\n 'tw:h-full',\n 'tw:data-[state=closed]:slide-out-to-left',\n 'tw:data-[state=open]:slide-in-from-left',\n 'tw:data-[argo=true]:rounded-r-lg',\n ],\n },\n },\n },\n);\n\ntype Props = ComponentProps<typeof Content> & {\n side?: 'top' | 'right' | 'bottom' | 'left';\n hideOverlay?: boolean;\n keepOpenOnPointerDownOutside?: boolean;\n} & VariantProps<typeof sheetContentVariants> &\n Pick<ComponentProps<typeof Portal>, 'container'>;\n\nexport const SheetContent = ({\n className,\n children,\n side = 'right',\n disableTransition = false,\n hideOverlay = false,\n keepOpenOnPointerDownOutside = false,\n onPointerDownOutside,\n onInteractOutside,\n container,\n ...props\n}: Props) => {\n const renderArgo = useArgoDesign();\n\n const handleOnPointerDownOutside: ComponentProps<typeof Content>['onPointerDownOutside'] = (\n event,\n ) => {\n if (keepOpenOnPointerDownOutside) event.preventDefault();\n onPointerDownOutside?.(event);\n };\n\n const handleOnInteractOutside: ComponentProps<typeof Content>['onInteractOutside'] = (event) => {\n if (keepOpenOnPointerDownOutside) event.preventDefault();\n onInteractOutside?.(event);\n };\n\n return (\n <Portal container={container}>\n {!hideOverlay && <SheetOverlay disableTransition={disableTransition ?? false} />}\n <Content\n {...props}\n /**\n * Intentionally set undefined to avoid warning as suggested in docs, (https://www.radix-ui.com/primitives/docs/components/dialog#description)\n * as of now we don't use modal description anywhere, if we decide to fix this issue, we fix it everywhere at once.\n */\n aria-describedby={undefined}\n className={cn(sheetContentVariants({ side, className, disableTransition }))}\n onPointerDownOutside={handleOnPointerDownOutside}\n onInteractOutside={handleOnInteractOutside}\n data-side={side}\n data-argo={renderArgo}\n >\n {children}\n </Content>\n </Portal>\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const SheetFooter = ({ className, ...props }: Props) => (\n <div className={cn('tw:mt-auto tw:flex tw:flex-col tw:gap-2 tw:p-4', className)} {...props} />\n);\n","import type { ComponentProps, ReactNode } from 'react';\nimport { Close } from '@radix-ui/react-dialog';\n\nimport { X } from '../../icons';\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\nimport { ModalDescription } from '../Modal/ModalDescription';\nimport { ModalTitle } from '../Modal/ModalTitle';\n\ntype Props = {\n title?: ReactNode;\n description?: ReactNode;\n hideCloseIcon?: boolean;\n} & ComponentProps<'div'>;\n\nexport const SheetHeader = ({\n className,\n children,\n hideCloseIcon = false,\n title,\n description,\n ...props\n}: Props) => {\n const isHeaderRendered = title || description || !hideCloseIcon;\n\n return (\n <div className={cn('tw:flex', 'tw:flex-col', 'tw:gap-1.5', 'tw:p-4', className)} {...props}>\n {isHeaderRendered && (\n <div className=\"tw:flex tw:flex-col\">\n <div className=\"tw:flex tw:justify-end tw:gap-2\">\n {title && <ModalTitle>{title}</ModalTitle>}\n {!hideCloseIcon && (\n <Close asChild>\n <Button variant=\"invisible\" size=\"icon-sm\">\n <X />\n <span className=\"tw:sr-only\">Close</span>\n </Button>\n </Close>\n )}\n </div>\n {description && <ModalDescription>{description}</ModalDescription>}\n </div>\n )}\n\n {children}\n </div>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Title } from '@radix-ui/react-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof Title> & {\n visuallyHidden?: boolean;\n};\n\nexport const SheetTitle = ({ className, visuallyHidden = false, ...props }: Props) => (\n <Title className={cn({ 'tw:sr-only': visuallyHidden }, className)} {...props} />\n);\n","import type { ComponentProps } from 'react';\nimport { Close, Root, Trigger } from '@radix-ui/react-dialog';\n\nimport { SheetBody } from './SheetBody';\nimport { SheetContent } from './SheetContent';\nimport { SheetFooter } from './SheetFooter';\nimport { SheetHeader } from './SheetHeader';\nimport { SheetTitle } from './SheetTitle';\n\ntype Props = ComponentProps<typeof Root>;\n\nexport const Sheet = (props: Props) => <Root {...props} />;\n\nSheet.Close = Close;\nSheet.Trigger = Trigger;\nSheet.Content = SheetContent;\nSheet.Title = SheetTitle;\n\nSheet.Header = SheetHeader;\nSheet.Footer = SheetFooter;\nSheet.Body = SheetBody;\n"],"mappings":";;;;;;;;;AAMA,MAAa,aAAa,EAAE,WAAW,GAAG,WACxC,oBAAC,OAAD;CACE,GAAI;CACJ,WAAW,GAAG,WAAW,eAAe,wBAAwB,WAAW,SAAS;AACrF,CAAA;;;ACHH,MAAa,gBAAgB,EAAE,KAAK,GAAG,YAAmB,oBAAC,cAAD;CAAmB;CAAK,GAAI;AAAQ,CAAA;;;ACG9F,MAAM,uBAAuB,IAC3B;CAEE;CAGA;CAGA;CAEA;CACA;CAEA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CAEA;CAEA;CAGA;AACF,GACA;CACE,iBAAiB;EACf,MAAM;EACN,mBAAmB;CACrB;CACA,UAAU;EACR,mBAAmB;GACjB,MAAM,CAAC;GACP,OAAO,CAAC,mCAAmC,oCAAoC;EACjF;EACA,MAAM;GACJ,KAAK;IACH;IACA;IACA;IACA;IACA;IACA;GACF;GACA,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;GACF;GAEA,QAAQ;IACN;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GAEA,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;GACF;EACF;CACF;AACF,CACF;AASA,MAAa,gBAAgB,EAC3B,WACA,UACA,OAAO,SACP,oBAAoB,OACpB,cAAc,OACd,+BAA+B,OAC/B,sBACA,mBACA,WACA,GAAG,YACQ;CACX,MAAM,aAAa,cAAc;CAEjC,MAAM,8BACJ,UACG;EACH,IAAI,8BAA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;ACtCA,MAAa,cAAc,EAAE,WAAW,iBAAiB,OAAO,GAAG,YACjE,oBAAC,OAAD;CAAO,WAAW,GAAG,EAAE,cAAc,eAAe,GAAG,SAAS;CAAG,GAAI;AAAQ,CAAA;;;ACCjF,MAAa,SAAS,UAAiB,oBAAC,MAAD,EAAM,GAAI,MAAQ,CAAA;AAEzD,MAAM,QAAQ;AACd,MAAM,UAAU;AAChB,MAAM,UAAU;AAChB,MAAM,QAAQ;AAEd,MAAM,SAAS;AACf,MAAM,SAAS;AACf,MAAM,OAAO"}
1
+ {"version":3,"file":"Sheet-Chf0kX1E.js","names":[],"sources":["../src/components/Sheet/SheetBody.tsx","../src/components/Sheet/SheetOverlay.tsx","../src/components/Sheet/SheetContent.tsx","../src/components/Sheet/SheetFooter.tsx","../src/components/Sheet/SheetHeader.tsx","../src/components/Sheet/SheetTitle.tsx","../src/components/Sheet/Sheet.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const SheetBody = ({ className, ...rest }: Props) => (\n <div\n {...rest}\n className={cn('tw:flex', 'tw:flex-col', 'tw:overflow-x-hidden', 'tw:px-4', className)}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { ModalOverlay } from '../Modal/ModalOverlay';\n\ntype Props = ComponentProps<typeof ModalOverlay>;\n\n// Assuming it should have the same style as standard modal, if not remove the modal dependency and style it separately.\nexport const SheetOverlay = ({ ref, ...props }: Props) => <ModalOverlay ref={ref} {...props} />;\n","import type { ComponentProps } from 'react';\nimport { Content, Portal } from '@radix-ui/react-dialog';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { SheetOverlay } from './SheetOverlay';\n\nconst sheetContentVariants = cva(\n [\n // reset\n 'tailwindcss-preflight',\n\n // positioning\n 'tw:fixed',\n\n // Use standard tailwindcss class when, global override in tooltip.less file is removed.\n 'tw:z-[1051]',\n\n 'tw:flex',\n 'tw:flex-col',\n\n 'tw:bg-card',\n 'tw:text-card-foreground',\n 'tw:shadow-lg',\n\n // argo chrome overrides\n 'tw:data-[argo=true]:border',\n 'tw:data-[argo=true]:border-border',\n 'tw:data-[argo=true]:focus-visible:outline-hidden',\n 'tw:data-[argo=true]:focus-visible:ring-2',\n 'tw:data-[argo=true]:focus-visible:ring-ring/50',\n\n 'tw:ease-in-out',\n // opening animation\n 'tw:data-[state=open]:duration-200',\n\n // close animation\n 'tw:data-[state=closed]:duration-200',\n ],\n {\n defaultVariants: {\n side: 'right',\n disableTransition: false,\n },\n variants: {\n disableTransition: {\n true: [],\n false: ['tw:data-[state=open]:animate-in', 'tw:data-[state=closed]:animate-out'],\n },\n side: {\n top: [\n 'tw:inset-x-0',\n 'tw:top-0',\n 'tw:h-auto',\n 'tw:data-[state=closed]:slide-out-to-top',\n 'tw:data-[state=open]:slide-in-from-top',\n 'tw:data-[argo=true]:rounded-b-lg',\n ],\n right: [\n 'tw:inset-y-0',\n 'tw:right-0',\n 'tw:h-full',\n 'tw:data-[state=closed]:slide-out-to-right',\n 'tw:data-[state=open]:slide-in-from-right',\n 'tw:data-[argo=true]:rounded-l-lg',\n ],\n\n bottom: [\n 'tw:inset-x-0',\n 'tw:bottom-0',\n 'tw:h-auto',\n 'tw:data-[state=closed]:slide-out-to-bottom',\n 'tw:data-[state=open]:slide-in-from-bottom',\n 'tw:drop-shadow-2xl', // standard tailwindcss shadow is invisible for a bottom sheet because of positioning\n 'tw:data-[argo=true]:rounded-t-lg',\n ],\n\n left: [\n 'tw:inset-y-0',\n 'tw:left-0',\n 'tw:h-full',\n 'tw:data-[state=closed]:slide-out-to-left',\n 'tw:data-[state=open]:slide-in-from-left',\n 'tw:data-[argo=true]:rounded-r-lg',\n ],\n },\n },\n },\n);\n\ntype Props = ComponentProps<typeof Content> & {\n side?: 'top' | 'right' | 'bottom' | 'left';\n hideOverlay?: boolean;\n keepOpenOnPointerDownOutside?: boolean;\n} & VariantProps<typeof sheetContentVariants> &\n Pick<ComponentProps<typeof Portal>, 'container'>;\n\nexport const SheetContent = ({\n className,\n children,\n side = 'right',\n disableTransition = false,\n hideOverlay = false,\n keepOpenOnPointerDownOutside = false,\n onPointerDownOutside,\n onInteractOutside,\n container,\n ...props\n}: Props) => {\n const renderArgo = useArgoDesign();\n\n const handleOnPointerDownOutside: ComponentProps<typeof Content>['onPointerDownOutside'] = (\n event,\n ) => {\n if (keepOpenOnPointerDownOutside) event.preventDefault();\n onPointerDownOutside?.(event);\n };\n\n const handleOnInteractOutside: ComponentProps<typeof Content>['onInteractOutside'] = (event) => {\n if (keepOpenOnPointerDownOutside) event.preventDefault();\n onInteractOutside?.(event);\n };\n\n return (\n <Portal container={container}>\n {!hideOverlay && <SheetOverlay disableTransition={disableTransition ?? false} />}\n <Content\n {...props}\n /**\n * Intentionally set undefined to avoid warning as suggested in docs, (https://www.radix-ui.com/primitives/docs/components/dialog#description)\n * as of now we don't use modal description anywhere, if we decide to fix this issue, we fix it everywhere at once.\n */\n aria-describedby={undefined}\n className={cn(sheetContentVariants({ side, className, disableTransition }))}\n onPointerDownOutside={handleOnPointerDownOutside}\n onInteractOutside={handleOnInteractOutside}\n data-side={side}\n data-argo={renderArgo}\n >\n {children}\n </Content>\n </Portal>\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const SheetFooter = ({ className, ...props }: Props) => (\n <div className={cn('tw:mt-auto tw:flex tw:flex-col tw:gap-2 tw:p-4', className)} {...props} />\n);\n","import type { ComponentProps, ReactNode } from 'react';\nimport { Close } from '@radix-ui/react-dialog';\n\nimport { X } from '../../icons';\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\nimport { ModalDescription } from '../Modal/ModalDescription';\nimport { ModalTitle } from '../Modal/ModalTitle';\n\ntype Props = {\n title?: ReactNode;\n description?: ReactNode;\n hideCloseIcon?: boolean;\n} & ComponentProps<'div'>;\n\nexport const SheetHeader = ({\n className,\n children,\n hideCloseIcon = false,\n title,\n description,\n ...props\n}: Props) => {\n const isHeaderRendered = title || description || !hideCloseIcon;\n\n return (\n <div className={cn('tw:flex', 'tw:flex-col', 'tw:gap-1.5', 'tw:p-4', className)} {...props}>\n {isHeaderRendered && (\n <div className=\"tw:flex tw:flex-col\">\n <div className=\"tw:flex tw:justify-end tw:gap-2\">\n {title && <ModalTitle>{title}</ModalTitle>}\n {!hideCloseIcon && (\n <Close asChild>\n <Button variant=\"invisible\" size=\"icon-sm\">\n <X />\n <span className=\"tw:sr-only\">Close</span>\n </Button>\n </Close>\n )}\n </div>\n {description && <ModalDescription>{description}</ModalDescription>}\n </div>\n )}\n\n {children}\n </div>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Title } from '@radix-ui/react-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof Title> & {\n visuallyHidden?: boolean;\n};\n\nexport const SheetTitle = ({ className, visuallyHidden = false, ...props }: Props) => (\n <Title className={cn({ 'tw:sr-only': visuallyHidden }, className)} {...props} />\n);\n","import type { ComponentProps } from 'react';\nimport { Close, Root, Trigger } from '@radix-ui/react-dialog';\n\nimport { SheetBody } from './SheetBody';\nimport { SheetContent } from './SheetContent';\nimport { SheetFooter } from './SheetFooter';\nimport { SheetHeader } from './SheetHeader';\nimport { SheetTitle } from './SheetTitle';\n\ntype Props = ComponentProps<typeof Root>;\n\nexport const Sheet = (props: Props) => <Root {...props} />;\n\nSheet.Close = Close;\nSheet.Trigger = Trigger;\nSheet.Content = SheetContent;\nSheet.Title = SheetTitle;\n\nSheet.Header = SheetHeader;\nSheet.Footer = SheetFooter;\nSheet.Body = SheetBody;\n"],"mappings":";;;;;;;;;AAMA,MAAa,aAAa,EAAE,WAAW,GAAG,WACxC,oBAAC,OAAD;CACE,GAAI;CACJ,WAAW,GAAG,WAAW,eAAe,wBAAwB,WAAW,SAAS;AACrF,CAAA;;;AC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1C,oBAAC,OAAD;CAAK,WAAW,GAAG,kDAAkD,SAAS;CAAG,GAAI;AAAQ,CAAA;;;ACQ/F,MAAa,eAAe,EAC1B,WACA,UACA,gBAAgB,OAChB,OACA,aACA,GAAG,YACQ;CACX,MAAM,mBAAmB,SAAS,eAAe,CAAC;CAElD,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,WAAW,eAAe,cAAc,UAAU,SAAS;EAAG,GAAI;EAArF,UAAA,CACG,oBACC,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACG,SAAS,oBAAC,YAAD,EAAA,UAAa,MAAkB,CAAA,GACxC,CAAC,iBACA,oBAAC,OAAD;KAAO,SAAA;KACL,UAAA,qBAAC,QAAD;MAAQ,SAAQ;MAAY,MAAK;MAAjC,UAAA,CACE,oBAAC,GAAD,CAAI,CAAA,GACJ,oBAAC,QAAD;OAAM,WAAU;OAAa,UAAA;MAAW,CAAA,CAClC;;IACH,CAAA,CAEN;GACJ,CAAA,GAAA,eAAe,oBAAC,kBAAD,EAAA,UAAmB,YAA8B,CAAA,CAC9D;EAGN,CAAA,GAAA,QACE;;AAET;;;ACtCA,MAAa,cAAc,EAAE,WAAW,iBAAiB,OAAO,GAAG,YACjE,oBAAC,OAAD;CAAO,WAAW,GAAG,EAAE,cAAc,eAAe,GAAG,SAAS;CAAG,GAAI;AAAQ,CAAA;;;ACCjF,MAAa,SAAS,UAAiB,oBAAC,MAAD,EAAM,GAAI,MAAQ,CAAA;AAEzD,MAAM,QAAQ;AACd,MAAM,UAAU;AAChB,MAAM,UAAU;AAChB,MAAM,QAAQ;AAEd,MAAM,SAAS;AACf,MAAM,SAAS;AACf,MAAM,OAAO"}
@@ -1,13 +1,13 @@
1
1
  import { cn } from "./classNames-BzrkDnOD.js";
2
- import { Tooltip, TooltipProvider } from "./utils-B-g7d_Jb.js";
2
+ import { Tooltip, TooltipProvider } from "./utils-DSvrhU8E.js";
3
3
  import { mergeRefs } from "./internal/utils/mergeRefs.js";
4
4
  import { ChevronDown, Search } from "./icons-Cek151jC.js";
5
- import { DropdownMenu } from "./DropdownMenu-DpMEcyCq.js";
5
+ import { DropdownMenu } from "./DropdownMenu-CASr-jgl.js";
6
6
  import { ScrollArea } from "./internal/components/ScrollArea.js";
7
7
  import { Separator } from "./internal/components/Separator.js";
8
- import { HoverCard } from "./HoverCard-yQq-O49c.js";
8
+ import { HoverCard } from "./HoverCard-B9ZMJxjn.js";
9
9
  import { Collapsible } from "./Collapsible-BQXWEOBC.js";
10
- import { BrandLogo } from "./BrandLogo-V2pRUAeO.js";
10
+ import { BrandLogo } from "./BrandLogo-CoKBk4MI.js";
11
11
  import { useElement } from "./useElement-DkF6esWL.js";
12
12
  import { useScrollbarPosition } from "./internal/hooks/useScrollbarPosition.js";
13
13
  import { Root, Slot, Slottable } from "@radix-ui/react-slot";
@@ -15,27 +15,44 @@ import { createContext, use, useCallback, useEffect, useLayoutEffect, useMemo, u
15
15
  import { jsx, jsxs } from "react/jsx-runtime";
16
16
  //#region src/components/Sidebar/SidebarProvider/useTransitionPresence.ts
17
17
  const FALLBACK_TIMEOUT_MS = 500;
18
+ /** Under reduced motion there is no `transitionend` to wait for, so the mount is not deferred. */
19
+ const prefersReducedMotion = () => typeof window !== "undefined" && (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false);
18
20
  const reducer = (state, event) => {
19
21
  switch (event) {
20
22
  case "MOUNT": return "mounted";
21
- case "TRANSITION_OUT": return state === "mounted" ? "unmountSuspended" : state;
22
- case "TRANSITION_END": return state === "unmountSuspended" ? "unmounted" : state;
23
+ case "ENTER": return state === "unmounted" ? "enterSuspended" : "mounted";
24
+ case "TRANSITION_OUT":
25
+ if (state === "enterSuspended") return "unmounted";
26
+ return state === "mounted" ? "unmountSuspended" : state;
27
+ case "TRANSITION_END":
28
+ if (state === "unmountSuspended") return "unmounted";
29
+ if (state === "enterSuspended") return "mounted";
30
+ return state;
23
31
  default: return state;
24
32
  }
25
33
  };
26
- const useTransitionPresence = ({ mounted, keepMounted = false }) => {
34
+ const useTransitionPresence = ({ mounted, keepMounted = false, mountAfterEnter = false }) => {
27
35
  const [state, send] = useReducer(reducer, mounted ? "mounted" : "unmounted");
28
36
  useLayoutEffect(() => {
29
37
  if (keepMounted) return;
30
- mounted ? send("MOUNT") : send("TRANSITION_OUT");
31
- }, [mounted, keepMounted]);
38
+ if (!mounted) {
39
+ send("TRANSITION_OUT");
40
+ return;
41
+ }
42
+ send(mountAfterEnter && !prefersReducedMotion() ? "ENTER" : "MOUNT");
43
+ }, [
44
+ mounted,
45
+ keepMounted,
46
+ mountAfterEnter
47
+ ]);
32
48
  useEffect(() => {
33
- if (state !== "unmountSuspended") return;
49
+ if (state !== "unmountSuspended" && state !== "enterSuspended") return;
34
50
  const id = setTimeout(() => send("TRANSITION_END"), FALLBACK_TIMEOUT_MS);
35
51
  return () => clearTimeout(id);
36
52
  }, [state]);
37
53
  return useMemo(() => ({
38
- isMounted: keepMounted || state !== "unmounted",
54
+ isMounted: keepMounted || state === "mounted" || state === "unmountSuspended",
55
+ /** Resolves whichever transition the subtree is waiting on. */
39
56
  completeUnmount: () => send("TRANSITION_END")
40
57
  }), [state, keepMounted]);
41
58
  };
@@ -224,11 +241,14 @@ const SidebarProvider = ({ children, defaultLeftMode = DEFAULT_SIDEBAR_MODE, lef
224
241
  });
225
242
  const toggleLeftFill = useCallback(() => setFilledSide((prev) => prev === "left" ? null : "left"), []);
226
243
  const toggleRightFill = useCallback(() => setFilledSide((prev) => prev === "right" ? null : "right"), []);
244
+ const setLeftFill = useCallback((fill) => setFilledSide((prev) => fill ? "left" : prev === "left" ? null : prev), []);
245
+ const setRightFill = useCallback((fill) => setFilledSide((prev) => fill ? "right" : prev === "right" ? null : prev), []);
227
246
  const value = useMemo(() => ({
228
247
  left: {
229
248
  ...leftState,
230
249
  isFill: filledSide === "left",
231
250
  toggleFill: toggleLeftFill,
251
+ setFill: setLeftFill,
232
252
  widths: calcEffectiveWidths({
233
253
  variant: leftVariant,
234
254
  width: leftDragWidth ?? leftWidth,
@@ -248,6 +268,7 @@ const SidebarProvider = ({ children, defaultLeftMode = DEFAULT_SIDEBAR_MODE, lef
248
268
  ...rightState,
249
269
  isFill: filledSide === "right",
250
270
  toggleFill: toggleRightFill,
271
+ setFill: setRightFill,
251
272
  widths: calcEffectiveWidths({
252
273
  variant: rightVariant,
253
274
  width: rightDragWidth ?? rightWidth,
@@ -267,6 +288,7 @@ const SidebarProvider = ({ children, defaultLeftMode = DEFAULT_SIDEBAR_MODE, lef
267
288
  leftState,
268
289
  filledSide,
269
290
  toggleLeftFill,
291
+ setLeftFill,
270
292
  leftVariant,
271
293
  leftWidth,
272
294
  leftDragWidth,
@@ -275,6 +297,7 @@ const SidebarProvider = ({ children, defaultLeftMode = DEFAULT_SIDEBAR_MODE, lef
275
297
  isLeftDragging,
276
298
  rightState,
277
299
  toggleRightFill,
300
+ setRightFill,
278
301
  rightVariant,
279
302
  rightWidth,
280
303
  rightDragWidth,
@@ -339,9 +362,9 @@ const SidebarGroupLabel = ({ ref, className, children, ...props }) => /* @__PURE
339
362
  children: [/* @__PURE__ */ jsx(Separator, {
340
363
  orientation: "horizontal",
341
364
  size: "3/4",
342
- className: cn("tw:opacity-0", "tw:group-data-[state=collapsed]/sidebar:opacity-100", "tw:absolute", "tw:w-full", "tw:left-0", "tw:top-1/2 tw:-translate-y-1/2", "tw:transition-opacity", "tw:duration-200", "tw:ease-linear")
365
+ className: cn("tw:opacity-0", "tw:group-data-[state=collapsed]/sidebar:opacity-100", "tw:absolute", "tw:w-full", "tw:left-0", "tw:top-1/2 tw:-translate-y-1/2", "tw:transition-opacity", "tw:duration-(--sidebar-motion-duration)", "tw:ease-(--sidebar-motion-easing)", "tw:motion-reduce:transition-none")
343
366
  }), /* @__PURE__ */ jsx("span", {
344
- className: cn("tw:flex", "tw:group-data-[state=collapsed]/sidebar:opacity-0", "tw:items-center", "tw:flex-1", "tw:text-muted-foreground", "tw:whitespace-nowrap", "tw:transition-opacity", "tw:duration-200", "tw:ease-linear"),
367
+ className: cn("tw:flex", "tw:group-data-[state=collapsed]/sidebar:opacity-0", "tw:items-center", "tw:flex-1", "tw:text-muted-foreground", "tw:whitespace-nowrap", "tw:transition-opacity", "tw:duration-(--sidebar-motion-duration)", "tw:ease-(--sidebar-motion-easing)", "tw:motion-reduce:transition-none"),
345
368
  children
346
369
  })]
347
370
  });
@@ -372,7 +395,7 @@ const SidebarHeader = ({ className, children, ...props }) => {
372
395
  //#region src/components/Sidebar/SidebarMenu/SidebarMenu.tsx
373
396
  const SidebarMenu = ({ className, ...props }) => /* @__PURE__ */ jsx("ul", {
374
397
  "data-sidebar": "menu",
375
- className: cn("tw:flex", "tw:w-full", "tw:min-w-0", "tw:flex-col", "tw:gap-1", "tw:transition-[margin,opacity]", "tw:duration-200", "tw:ease-linear", "tw:pl-0", className),
398
+ className: cn("tw:flex", "tw:w-full", "tw:min-w-0", "tw:flex-col", "tw:gap-1", "tw:transition-[margin,opacity]", "tw:duration-(--sidebar-motion-duration)", "tw:ease-(--sidebar-motion-easing)", "tw:motion-reduce:transition-none", "tw:pl-0", className),
376
399
  ...props
377
400
  });
378
401
  //#endregion
@@ -474,7 +497,7 @@ const SidebarMenuCard = ({ children, className, icon, title, ...rest }) => {
474
497
  ...rest,
475
498
  "data-slot": "sidebar-menu-card",
476
499
  tabIndex: isExpanded ? -1 : 0,
477
- className: cn("tw:group/sidebar-menu-card", "tw:peer/sidebar-menu-card", "tw:overflow-hidden", "tw:border", "tw:border-sidebar-border", "tw:rounded-2xl", "tw:grid", "tw:grid-rows-[1fr]", "tw:flex-1", "tw:p-4", "tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:p-2", "tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:border-transparent", "tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:grid-rows-[18px]", "tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:rounded-md", "tw:outline-hidden", "tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:hover:bg-sidebar-accent", "tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:focus-visible:ring-2", "tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:focus-visible:ring-sidebar-ring/50", "tw:transition-[padding,border]", "tw:duration-200", "tw:ease-linear"),
500
+ className: cn("tw:group/sidebar-menu-card", "tw:peer/sidebar-menu-card", "tw:overflow-hidden", "tw:border", "tw:border-sidebar-border", "tw:rounded-2xl", "tw:grid", "tw:grid-rows-[1fr]", "tw:flex-1", "tw:p-4", "tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:p-2", "tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:border-transparent", "tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:grid-rows-[18px]", "tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:rounded-md", "tw:outline-hidden", "tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:hover:bg-sidebar-accent", "tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:focus-visible:ring-2", "tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:focus-visible:ring-sidebar-ring/50", "tw:transition-[padding,border]", "tw:duration-(--sidebar-motion-duration)", "tw:ease-(--sidebar-motion-easing)", "tw:motion-reduce:transition-none"),
478
501
  children: /* @__PURE__ */ jsxs("div", {
479
502
  className: "tw:flex tw:flex-col tw:gap-2",
480
503
  children: [/* @__PURE__ */ jsxs(Title, { children: [/* @__PURE__ */ jsx(SidebarMenuIcon, {
@@ -505,7 +528,7 @@ const SidebarMenuBadge = ({ ref, className, ...props }) => {
505
528
  ref,
506
529
  "data-slot": "sidebar-menu-badge",
507
530
  "data-sidebar": "menu-badge",
508
- className: cn("tw:flex", "tw:items-center", "tw:justify-center", "tw:z-20", "tw:absolute", "tw:peer-[]/sidebar-menu-button:right-2", "tw:peer-[]/sidebar-menu-card:right-4", "tw:peer-[]/sidebar-menu-card:top-4", "tw:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:right-0", "tw:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:-top-1", "tw:text-xs", "tw:text-sidebar-primary-foreground", "tw:bg-sidebar-primary", "tw:px-1", "tw:min-w-5", "tw:h-5", "tw:rounded-full", "tw:pointer-events-none", "tw:font-medium", "tw:tabular-nums", "tw:select-none", "tw:transition-[top,right]", "tw:delay-50", "tw:ease-linear", className),
531
+ className: cn("tw:flex", "tw:items-center", "tw:justify-center", "tw:z-20", "tw:absolute", "tw:peer-[]/sidebar-menu-button:right-2", "tw:peer-[]/sidebar-menu-card:right-4", "tw:peer-[]/sidebar-menu-card:top-4", "tw:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:right-0", "tw:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:-top-1", "tw:text-xs", "tw:text-sidebar-primary-foreground", "tw:bg-sidebar-primary", "tw:px-1", "tw:min-w-5", "tw:h-5", "tw:rounded-full", "tw:pointer-events-none", "tw:font-medium", "tw:tabular-nums", "tw:select-none", "tw:transition-[top,right]", "tw:delay-50", "tw:duration-(--sidebar-motion-duration)", "tw:ease-(--sidebar-motion-easing)", "tw:motion-reduce:transition-none", className),
509
532
  ...props
510
533
  });
511
534
  };
@@ -715,12 +738,13 @@ const SidebarTrigger = ({ side = "left", onClick, hideWhenCollapsed = false, cla
715
738
  };
716
739
  //#endregion
717
740
  //#region src/components/Sidebar/Sidebar.tsx
718
- const Sidebar = ({ children, className, id, side = "left", style, container = false, keepMounted, resizable = false }) => {
741
+ const Sidebar = ({ children, className, id, side = "left", style, container = false, keepMounted, mountAfterEnter, resizable = false, ...rest }) => {
719
742
  const oppositeSide = side === "left" ? "right" : "left";
720
743
  const { setSidebarElement, state, mode, isFill, widths, collapsible, variant, isDragging } = useSidebar(side);
721
744
  const { isMounted, completeUnmount } = useTransitionPresence({
722
745
  mounted: collapsible !== "off-canvas" || mode !== "collapsed",
723
- keepMounted
746
+ keepMounted,
747
+ mountAfterEnter
724
748
  });
725
749
  const { widths: oppositeWidths } = useSidebar(oppositeSide);
726
750
  const sidebarInstanceContextValue = useMemo(() => ({
@@ -737,6 +761,7 @@ const Sidebar = ({ children, className, id, side = "left", style, container = fa
737
761
  completeUnmount();
738
762
  };
739
763
  const styles = {
764
+ ...style,
740
765
  "--sidebar-floating-padding": `${SidebarWidthInPx.FLOATING_VARIANT_PADDING}px`,
741
766
  "--sidebar-width": `${widths.sidebar}px`,
742
767
  "--sidebar-width-gap": `${widths.gap}px`,
@@ -746,6 +771,7 @@ const Sidebar = ({ children, className, id, side = "left", style, container = fa
746
771
  return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(SidebarInstanceContext, {
747
772
  value: sidebarInstanceContextValue,
748
773
  children: /* @__PURE__ */ jsxs("div", {
774
+ ...rest,
749
775
  id,
750
776
  ref: setSidebarElement,
751
777
  "data-state": state,
@@ -755,14 +781,14 @@ const Sidebar = ({ children, className, id, side = "left", style, container = fa
755
781
  "data-variant": variant,
756
782
  "data-fill": isFill,
757
783
  style: styles,
758
- className: cn("tailwindcss-preflight", "tw:flex", "tw:relative", mode === "expand-on-hover" ? "tw:z-[51]" : "tw:z-50", { "tw:group/sidebar tw:peer/sidebar": !container }, "tw:[&>[data-slot=gap]]:w-(--sidebar-width-gap)", "tw:[&[data-side=right]>[data-slot=gap]]:rotate-180", "tw:[&>[data-slot=sidebar-wrapper]]:w-(--sidebar-width)", "tw:[&[data-side=left]>[data-slot=sidebar-wrapper]]:left-0", "tw:[&[data-side=right]>[data-slot=sidebar-wrapper]]:right-0", "tw:[&[data-state=collapsed][data-collapsible=off-canvas][data-side=left]>[data-slot=sidebar-wrapper]]:-translate-x-full", "tw:[&[data-state=collapsed][data-collapsible=off-canvas][data-side=right]>[data-slot=sidebar-wrapper]]:translate-x-full", "tw:[&[data-variant=sided-floating]>[data-slot=sidebar-wrapper]]:pt-(--sidebar-floating-padding)", "tw:[&[data-variant=sided-floating][data-side=left]>[data-slot=sidebar-wrapper]]:pr-(--sidebar-floating-padding)", "tw:[&[data-variant=sided-floating][data-side=right]>[data-slot=sidebar-wrapper]]:pl-(--sidebar-floating-padding)", "tw:[&[data-variant=floating]>[data-slot=sidebar-wrapper]]:p-(--sidebar-floating-padding)", "tw:[&[data-fill=true]>[data-slot=sidebar-wrapper]]:!w-[calc(100svw-var(--opposite-sidebar-width))]", "tw:[&[data-fill=true][data-variant=floating]>[data-slot=sidebar-wrapper]]:!p-(--sidebar-floating-padding)", "tw:[&[data-fill=true][data-variant=sided-floating][data-side=left]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:!rounded-tr-xl", "tw:[&[data-fill=true][data-variant=sided-floating][data-side=right]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:!rounded-tl-xl", "tw:[&[data-variant=inset][data-side=left]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:border-r", "tw:[&[data-variant=inset][data-side=right]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:border-l", "tw:[&[data-variant=floating]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:shadow", "tw:[&[data-variant=floating]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:rounded-xl", "tw:[&[data-variant=sided-floating]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:shadow", "tw:[&[data-variant=sided-floating][data-side=left]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:rounded-tr-xl", "tw:[&[data-variant=sided-floating][data-side=right]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:rounded-tl-xl", "tw:[&[data-variant=sided-floating][data-side=left]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:border-r", "tw:[&[data-variant=sided-floating][data-side=right]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:border-l", isDragging ? "tw:transition-none" : "tw:transition-[width,translate,transform] tw:duration-200 tw:ease-linear"),
784
+ className: cn("tailwindcss-preflight", "tw:flex", "tw:relative", mode === "expand-on-hover" ? "tw:z-[51]" : "tw:z-50", { "tw:group/sidebar tw:peer/sidebar": !container }, "tw:[&>[data-slot=gap]]:w-(--sidebar-width-gap)", "tw:[&[data-side=right]>[data-slot=gap]]:rotate-180", "tw:[&>[data-slot=sidebar-wrapper]]:w-(--sidebar-width)", "tw:[&[data-side=left]>[data-slot=sidebar-wrapper]]:left-0", "tw:[&[data-side=right]>[data-slot=sidebar-wrapper]]:right-0", "tw:[&[data-state=collapsed][data-collapsible=off-canvas][data-side=left]>[data-slot=sidebar-wrapper]]:-translate-x-full", "tw:[&[data-state=collapsed][data-collapsible=off-canvas][data-side=right]>[data-slot=sidebar-wrapper]]:translate-x-full", "tw:[&[data-variant=sided-floating]>[data-slot=sidebar-wrapper]]:pt-(--sidebar-floating-padding)", "tw:[&[data-variant=sided-floating][data-side=left]>[data-slot=sidebar-wrapper]]:pr-(--sidebar-floating-padding)", "tw:[&[data-variant=sided-floating][data-side=right]>[data-slot=sidebar-wrapper]]:pl-(--sidebar-floating-padding)", "tw:[&[data-variant=floating]>[data-slot=sidebar-wrapper]]:p-(--sidebar-floating-padding)", "tw:[&[data-fill=true]>[data-slot=sidebar-wrapper]]:!w-[calc(100svw-var(--opposite-sidebar-width))]", "tw:[&[data-fill=true][data-variant=floating]>[data-slot=sidebar-wrapper]]:!p-(--sidebar-floating-padding)", "tw:[&[data-fill=true][data-variant=sided-floating][data-side=left]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:!rounded-tr-xl", "tw:[&[data-fill=true][data-variant=sided-floating][data-side=right]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:!rounded-tl-xl", "tw:[&[data-variant=inset][data-side=left]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:border-r", "tw:[&[data-variant=inset][data-side=right]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:border-l", "tw:[&[data-variant=floating]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:shadow", "tw:[&[data-variant=floating]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:rounded-xl", "tw:[&[data-variant=sided-floating]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:shadow", "tw:[&[data-variant=sided-floating][data-side=left]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:rounded-tr-xl", "tw:[&[data-variant=sided-floating][data-side=right]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:rounded-tl-xl", "tw:[&[data-variant=sided-floating][data-side=left]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:border-r", "tw:[&[data-variant=sided-floating][data-side=right]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:border-l", isDragging ? "tw:transition-none" : "tw:transition-[width,translate,transform] tw:duration-(--sidebar-motion-duration) tw:ease-(--sidebar-motion-easing) tw:motion-reduce:transition-none"),
759
785
  children: [/* @__PURE__ */ jsx("div", {
760
786
  "data-slot": "gap",
761
- className: cn("tw:bg-transparent", isDragging ? "" : "tw:transition-[width] tw:duration-200 tw:ease-linear")
787
+ className: cn("tw:bg-transparent", isDragging ? "" : "tw:transition-[width] tw:duration-(--sidebar-motion-duration) tw:ease-(--sidebar-motion-easing) tw:motion-reduce:transition-none")
762
788
  }), /* @__PURE__ */ jsxs("div", {
763
789
  "data-slot": "sidebar-wrapper",
764
790
  onTransitionEnd: handleTransitionEnd,
765
- className: cn("tw:fixed", "tw:inset-y-0", "tw:border-neutral-100", isDragging ? "tw:transition-none" : "tw:transition-[width,translate,transform] tw:duration-200 tw:ease-linear", className),
791
+ className: cn("tw:fixed", "tw:inset-y-0", "tw:border-border", isDragging ? "tw:transition-none" : "tw:transition-[width,translate,transform] tw:duration-(--sidebar-motion-duration) tw:ease-(--sidebar-motion-easing) tw:motion-reduce:transition-none", "tw:transform-gpu", className),
766
792
  style,
767
793
  children: [resizable && /* @__PURE__ */ jsx(SidebarResizeHandle, { side }), /* @__PURE__ */ jsx("div", {
768
794
  "data-slot": "sidebar",
@@ -796,4 +822,4 @@ Sidebar.SubItem = SidebarMenuSubItem;
796
822
  //#endregion
797
823
  export { Sidebar, SidebarProvider, useOptionalSidebar, useSidebar };
798
824
 
799
- //# sourceMappingURL=Sidebar-r1TW4g_b.js.map
825
+ //# sourceMappingURL=Sidebar-D3cY1kha.js.map