@still-void/ui 0.0.0-canary-20261202214749

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 (309) hide show
  1. package/CHANGELOG.md +350 -0
  2. package/LICENSE +21 -0
  3. package/README.md +330 -0
  4. package/dist/css/app-shell.css +129 -0
  5. package/dist/css/base.css +27 -0
  6. package/dist/css/content.css +726 -0
  7. package/dist/css/controls.css +383 -0
  8. package/dist/css/data.css +190 -0
  9. package/dist/css/forms.css +318 -0
  10. package/dist/css/motion.css +49 -0
  11. package/dist/css/overlays.css +488 -0
  12. package/dist/css/toast.css +170 -0
  13. package/dist/react/_modules/behaviors/themeManager.js +10 -0
  14. package/dist/react/_modules/behaviors/themeManager.js.map +1 -0
  15. package/dist/react/_modules/components/ui/alert.js +14 -0
  16. package/dist/react/_modules/components/ui/alert.js.map +1 -0
  17. package/dist/react/_modules/components/ui/badge.js +9 -0
  18. package/dist/react/_modules/components/ui/badge.js.map +1 -0
  19. package/dist/react/_modules/components/ui/button.js +9 -0
  20. package/dist/react/_modules/components/ui/button.js.map +1 -0
  21. package/dist/react/_modules/components/ui/card.js +19 -0
  22. package/dist/react/_modules/components/ui/card.js.map +1 -0
  23. package/dist/react/_modules/components/ui/chart.js +18 -0
  24. package/dist/react/_modules/components/ui/chart.js.map +1 -0
  25. package/dist/react/_modules/components/ui/checkbox.js +8 -0
  26. package/dist/react/_modules/components/ui/checkbox.js.map +1 -0
  27. package/dist/react/_modules/components/ui/field.js +9 -0
  28. package/dist/react/_modules/components/ui/field.js.map +1 -0
  29. package/dist/react/_modules/components/ui/file-input.js +10 -0
  30. package/dist/react/_modules/components/ui/file-input.js.map +1 -0
  31. package/dist/react/_modules/components/ui/icon-set.js +11 -0
  32. package/dist/react/_modules/components/ui/icon-set.js.map +1 -0
  33. package/dist/react/_modules/components/ui/icon.js +9 -0
  34. package/dist/react/_modules/components/ui/icon.js.map +1 -0
  35. package/dist/react/_modules/components/ui/input.js +10 -0
  36. package/dist/react/_modules/components/ui/input.js.map +1 -0
  37. package/dist/react/_modules/components/ui/native-select.js +10 -0
  38. package/dist/react/_modules/components/ui/native-select.js.map +1 -0
  39. package/dist/react/_modules/components/ui/pagination.js +23 -0
  40. package/dist/react/_modules/components/ui/pagination.js.map +1 -0
  41. package/dist/react/_modules/components/ui/progress.js +8 -0
  42. package/dist/react/_modules/components/ui/progress.js.map +1 -0
  43. package/dist/react/_modules/components/ui/radio-group.js +12 -0
  44. package/dist/react/_modules/components/ui/radio-group.js.map +1 -0
  45. package/dist/react/_modules/components/ui/separator.js +8 -0
  46. package/dist/react/_modules/components/ui/separator.js.map +1 -0
  47. package/dist/react/_modules/components/ui/slot.js +7 -0
  48. package/dist/react/_modules/components/ui/slot.js.map +1 -0
  49. package/dist/react/_modules/components/ui/table.js +23 -0
  50. package/dist/react/_modules/components/ui/table.js.map +1 -0
  51. package/dist/react/_modules/components/ui/text-link.js +10 -0
  52. package/dist/react/_modules/components/ui/text-link.js.map +1 -0
  53. package/dist/react/_modules/components/ui/textarea.js +10 -0
  54. package/dist/react/_modules/components/ui/textarea.js.map +1 -0
  55. package/dist/react/_modules/lib/safe-href.js +9 -0
  56. package/dist/react/_modules/lib/safe-href.js.map +1 -0
  57. package/dist/react/_modules/lib/utils.js +7 -0
  58. package/dist/react/_modules/lib/utils.js.map +1 -0
  59. package/dist/react/_modules/react/components/Article.js +17 -0
  60. package/dist/react/_modules/react/components/Article.js.map +1 -0
  61. package/dist/react/_modules/react/components/Content.js +30 -0
  62. package/dist/react/_modules/react/components/Content.js.map +1 -0
  63. package/dist/react/_modules/react/components/PageHeader.js +8 -0
  64. package/dist/react/_modules/react/components/PageHeader.js.map +1 -0
  65. package/dist/react/_modules/react/components/Shell.js +17 -0
  66. package/dist/react/_modules/react/components/Shell.js.map +1 -0
  67. package/dist/react/_modules/react/components/ThemeScript.js +9 -0
  68. package/dist/react/_modules/react/components/ThemeScript.js.map +1 -0
  69. package/dist/react/_modules/recipes/article.js +34 -0
  70. package/dist/react/_modules/recipes/article.js.map +1 -0
  71. package/dist/react/_modules/recipes/content.js +34 -0
  72. package/dist/react/_modules/recipes/content.js.map +1 -0
  73. package/dist/react/_modules/recipes/cx.js +7 -0
  74. package/dist/react/_modules/recipes/cx.js.map +1 -0
  75. package/dist/react/_modules/recipes/field.js +12 -0
  76. package/dist/react/_modules/recipes/field.js.map +1 -0
  77. package/dist/react/_modules/recipes/shell.js +18 -0
  78. package/dist/react/_modules/recipes/shell.js.map +1 -0
  79. package/dist/react/_modules/recipes/table.js +9 -0
  80. package/dist/react/_modules/recipes/table.js.map +1 -0
  81. package/dist/react/_modules/tokens/categories.js +12 -0
  82. package/dist/react/_modules/tokens/categories.js.map +1 -0
  83. package/dist/react/_modules/tokens/colors.js +23 -0
  84. package/dist/react/_modules/tokens/colors.js.map +1 -0
  85. package/dist/react/_modules/tokens/motion.js +9 -0
  86. package/dist/react/_modules/tokens/motion.js.map +1 -0
  87. package/dist/react/_modules/tokens/spacing.js +9 -0
  88. package/dist/react/_modules/tokens/spacing.js.map +1 -0
  89. package/dist/react/_modules/tokens/typography.js +15 -0
  90. package/dist/react/_modules/tokens/typography.js.map +1 -0
  91. package/dist/react/_modules/tokens/zIndex.js +7 -0
  92. package/dist/react/_modules/tokens/zIndex.js.map +1 -0
  93. package/dist/react/chunk-2QRW4J2C.js +29 -0
  94. package/dist/react/chunk-2QRW4J2C.js.map +1 -0
  95. package/dist/react/chunk-3BWBG3BR.js +82 -0
  96. package/dist/react/chunk-3BWBG3BR.js.map +1 -0
  97. package/dist/react/chunk-563PKHIJ.js +48 -0
  98. package/dist/react/chunk-563PKHIJ.js.map +1 -0
  99. package/dist/react/chunk-5RPXXOD7.js +50 -0
  100. package/dist/react/chunk-5RPXXOD7.js.map +1 -0
  101. package/dist/react/chunk-6PF2SFKH.js +54 -0
  102. package/dist/react/chunk-6PF2SFKH.js.map +1 -0
  103. package/dist/react/chunk-7JIE3YAY.js +109 -0
  104. package/dist/react/chunk-7JIE3YAY.js.map +1 -0
  105. package/dist/react/chunk-7ZVSFBDK.js +26 -0
  106. package/dist/react/chunk-7ZVSFBDK.js.map +1 -0
  107. package/dist/react/chunk-AVAJOAL5.js +10 -0
  108. package/dist/react/chunk-AVAJOAL5.js.map +1 -0
  109. package/dist/react/chunk-BXKXO6FU.js +34 -0
  110. package/dist/react/chunk-BXKXO6FU.js.map +1 -0
  111. package/dist/react/chunk-CN3PNEZL.js +80 -0
  112. package/dist/react/chunk-CN3PNEZL.js.map +1 -0
  113. package/dist/react/chunk-EHJDOUXR.js +144 -0
  114. package/dist/react/chunk-EHJDOUXR.js.map +1 -0
  115. package/dist/react/chunk-FX2E23UV.js +28 -0
  116. package/dist/react/chunk-FX2E23UV.js.map +1 -0
  117. package/dist/react/chunk-GYGMM6RW.js +20 -0
  118. package/dist/react/chunk-GYGMM6RW.js.map +1 -0
  119. package/dist/react/chunk-H7DEOO3V.js +29 -0
  120. package/dist/react/chunk-H7DEOO3V.js.map +1 -0
  121. package/dist/react/chunk-HD7O5FNH.js +39 -0
  122. package/dist/react/chunk-HD7O5FNH.js.map +1 -0
  123. package/dist/react/chunk-HYLCMS2U.js +28 -0
  124. package/dist/react/chunk-HYLCMS2U.js.map +1 -0
  125. package/dist/react/chunk-HYXG2WF4.js +73 -0
  126. package/dist/react/chunk-HYXG2WF4.js.map +1 -0
  127. package/dist/react/chunk-KQK7SZ3K.js +52 -0
  128. package/dist/react/chunk-KQK7SZ3K.js.map +1 -0
  129. package/dist/react/chunk-KQZBK3XX.js +24 -0
  130. package/dist/react/chunk-KQZBK3XX.js.map +1 -0
  131. package/dist/react/chunk-L6WPFLSD.js +39 -0
  132. package/dist/react/chunk-L6WPFLSD.js.map +1 -0
  133. package/dist/react/chunk-LOVNG6RF.js +9 -0
  134. package/dist/react/chunk-LOVNG6RF.js.map +1 -0
  135. package/dist/react/chunk-M5FFVQKK.js +41 -0
  136. package/dist/react/chunk-M5FFVQKK.js.map +1 -0
  137. package/dist/react/chunk-MZEFPODP.js +77 -0
  138. package/dist/react/chunk-MZEFPODP.js.map +1 -0
  139. package/dist/react/chunk-NJQN37EG.js +37 -0
  140. package/dist/react/chunk-NJQN37EG.js.map +1 -0
  141. package/dist/react/chunk-OEFJMV7G.js +144 -0
  142. package/dist/react/chunk-OEFJMV7G.js.map +1 -0
  143. package/dist/react/chunk-P4M4LEI2.js +62 -0
  144. package/dist/react/chunk-P4M4LEI2.js.map +1 -0
  145. package/dist/react/chunk-PGDHKADW.js +60 -0
  146. package/dist/react/chunk-PGDHKADW.js.map +1 -0
  147. package/dist/react/chunk-QTVPXQ43.js +29 -0
  148. package/dist/react/chunk-QTVPXQ43.js.map +1 -0
  149. package/dist/react/chunk-QVOZHMVF.js +14 -0
  150. package/dist/react/chunk-QVOZHMVF.js.map +1 -0
  151. package/dist/react/chunk-SJ2YK4NJ.js +27 -0
  152. package/dist/react/chunk-SJ2YK4NJ.js.map +1 -0
  153. package/dist/react/chunk-SSMGCYPH.js +79 -0
  154. package/dist/react/chunk-SSMGCYPH.js.map +1 -0
  155. package/dist/react/chunk-SUT4G3TE.js +29 -0
  156. package/dist/react/chunk-SUT4G3TE.js.map +1 -0
  157. package/dist/react/chunk-SVLIJGBZ.js +14 -0
  158. package/dist/react/chunk-SVLIJGBZ.js.map +1 -0
  159. package/dist/react/chunk-SY7EEIC3.js +100 -0
  160. package/dist/react/chunk-SY7EEIC3.js.map +1 -0
  161. package/dist/react/chunk-TI3OPDCN.js +25 -0
  162. package/dist/react/chunk-TI3OPDCN.js.map +1 -0
  163. package/dist/react/chunk-U6L6J73Y.js +27 -0
  164. package/dist/react/chunk-U6L6J73Y.js.map +1 -0
  165. package/dist/react/chunk-VD5O66DN.js +54 -0
  166. package/dist/react/chunk-VD5O66DN.js.map +1 -0
  167. package/dist/react/chunk-YDGOXO6Q.js +74 -0
  168. package/dist/react/chunk-YDGOXO6Q.js.map +1 -0
  169. package/dist/react/chunk-YTTFCX3E.js +16 -0
  170. package/dist/react/chunk-YTTFCX3E.js.map +1 -0
  171. package/dist/react/chunk-YXV3UEL5.js +27 -0
  172. package/dist/react/chunk-YXV3UEL5.js.map +1 -0
  173. package/dist/react/client/_modules/behaviors/clipboard.js +8 -0
  174. package/dist/react/client/_modules/behaviors/clipboard.js.map +1 -0
  175. package/dist/react/client/_modules/behaviors/mediaQuery.js +8 -0
  176. package/dist/react/client/_modules/behaviors/mediaQuery.js.map +1 -0
  177. package/dist/react/client/_modules/behaviors/readingProgress.js +10 -0
  178. package/dist/react/client/_modules/behaviors/readingProgress.js.map +1 -0
  179. package/dist/react/client/_modules/behaviors/scrollSpy.js +8 -0
  180. package/dist/react/client/_modules/behaviors/scrollSpy.js.map +1 -0
  181. package/dist/react/client/_modules/behaviors/themeManager.js +11 -0
  182. package/dist/react/client/_modules/behaviors/themeManager.js.map +1 -0
  183. package/dist/react/client/_modules/components/ui/alert-dialog.js +30 -0
  184. package/dist/react/client/_modules/components/ui/alert-dialog.js.map +1 -0
  185. package/dist/react/client/_modules/components/ui/bottom-sheet.js +28 -0
  186. package/dist/react/client/_modules/components/ui/bottom-sheet.js.map +1 -0
  187. package/dist/react/client/_modules/components/ui/combobox.js +13 -0
  188. package/dist/react/client/_modules/components/ui/combobox.js.map +1 -0
  189. package/dist/react/client/_modules/components/ui/dialog.js +30 -0
  190. package/dist/react/client/_modules/components/ui/dialog.js.map +1 -0
  191. package/dist/react/client/_modules/components/ui/dropdown-menu.js +39 -0
  192. package/dist/react/client/_modules/components/ui/dropdown-menu.js.map +1 -0
  193. package/dist/react/client/_modules/components/ui/icon-set.js +12 -0
  194. package/dist/react/client/_modules/components/ui/icon-set.js.map +1 -0
  195. package/dist/react/client/_modules/components/ui/icon.js +10 -0
  196. package/dist/react/client/_modules/components/ui/icon.js.map +1 -0
  197. package/dist/react/client/_modules/components/ui/restore-focus.js +8 -0
  198. package/dist/react/client/_modules/components/ui/restore-focus.js.map +1 -0
  199. package/dist/react/client/_modules/components/ui/select.js +29 -0
  200. package/dist/react/client/_modules/components/ui/select.js.map +1 -0
  201. package/dist/react/client/_modules/components/ui/tabs.js +15 -0
  202. package/dist/react/client/_modules/components/ui/tabs.js.map +1 -0
  203. package/dist/react/client/_modules/components/ui/tooltip.js +15 -0
  204. package/dist/react/client/_modules/components/ui/tooltip.js.map +1 -0
  205. package/dist/react/client/_modules/lib/utils.js +8 -0
  206. package/dist/react/client/_modules/lib/utils.js.map +1 -0
  207. package/dist/react/client/_modules/react/client/CopyButton.js +11 -0
  208. package/dist/react/client/_modules/react/client/CopyButton.js.map +1 -0
  209. package/dist/react/client/_modules/react/client/ReadingProgress.js +14 -0
  210. package/dist/react/client/_modules/react/client/ReadingProgress.js.map +1 -0
  211. package/dist/react/client/_modules/react/client/SidebarProvider.js +26 -0
  212. package/dist/react/client/_modules/react/client/SidebarProvider.js.map +1 -0
  213. package/dist/react/client/_modules/react/client/TableOfContents.js +14 -0
  214. package/dist/react/client/_modules/react/client/TableOfContents.js.map +1 -0
  215. package/dist/react/client/_modules/react/client/ThemeProvider.js +12 -0
  216. package/dist/react/client/_modules/react/client/ThemeProvider.js.map +1 -0
  217. package/dist/react/client/_modules/react/client/ThemeToggle.js +14 -0
  218. package/dist/react/client/_modules/react/client/ThemeToggle.js.map +1 -0
  219. package/dist/react/client/_modules/react/client/ToastProvider.js +14 -0
  220. package/dist/react/client/_modules/react/client/ToastProvider.js.map +1 -0
  221. package/dist/react/client/_modules/react/client/hooks.js +17 -0
  222. package/dist/react/client/_modules/react/client/hooks.js.map +1 -0
  223. package/dist/react/client/_modules/react/client/shadcn.js +160 -0
  224. package/dist/react/client/_modules/react/client/shadcn.js.map +1 -0
  225. package/dist/react/client/_modules/recipes/article.js +35 -0
  226. package/dist/react/client/_modules/recipes/article.js.map +1 -0
  227. package/dist/react/client/_modules/recipes/cx.js +8 -0
  228. package/dist/react/client/_modules/recipes/cx.js.map +1 -0
  229. package/dist/react/client/_modules/recipes/field.js +13 -0
  230. package/dist/react/client/_modules/recipes/field.js.map +1 -0
  231. package/dist/react/client/_modules/tokens/colors.js +24 -0
  232. package/dist/react/client/_modules/tokens/colors.js.map +1 -0
  233. package/dist/react/client/chunk-3MVZ2ES4.js +83 -0
  234. package/dist/react/client/chunk-3MVZ2ES4.js.map +1 -0
  235. package/dist/react/client/chunk-7AU2DPOL.js +35 -0
  236. package/dist/react/client/chunk-7AU2DPOL.js.map +1 -0
  237. package/dist/react/client/chunk-ABWCVXOO.js +11 -0
  238. package/dist/react/client/chunk-ABWCVXOO.js.map +1 -0
  239. package/dist/react/client/chunk-AEXJWMUV.js +52 -0
  240. package/dist/react/client/chunk-AEXJWMUV.js.map +1 -0
  241. package/dist/react/client/chunk-CJQZ4BGO.js +125 -0
  242. package/dist/react/client/chunk-CJQZ4BGO.js.map +1 -0
  243. package/dist/react/client/chunk-CMMPIPNC.js +30 -0
  244. package/dist/react/client/chunk-CMMPIPNC.js.map +1 -0
  245. package/dist/react/client/chunk-CWA3N5RK.js +123 -0
  246. package/dist/react/client/chunk-CWA3N5RK.js.map +1 -0
  247. package/dist/react/client/chunk-ECOPTUZT.js +102 -0
  248. package/dist/react/client/chunk-ECOPTUZT.js.map +1 -0
  249. package/dist/react/client/chunk-GD7XJWKF.js +102 -0
  250. package/dist/react/client/chunk-GD7XJWKF.js.map +1 -0
  251. package/dist/react/client/chunk-JVVNV4DF.js +95 -0
  252. package/dist/react/client/chunk-JVVNV4DF.js.map +1 -0
  253. package/dist/react/client/chunk-LDOUB5IA.js +40 -0
  254. package/dist/react/client/chunk-LDOUB5IA.js.map +1 -0
  255. package/dist/react/client/chunk-M5QFSQYC.js +40 -0
  256. package/dist/react/client/chunk-M5QFSQYC.js.map +1 -0
  257. package/dist/react/client/chunk-MGR4F2BJ.js +67 -0
  258. package/dist/react/client/chunk-MGR4F2BJ.js.map +1 -0
  259. package/dist/react/client/chunk-MYTOL2RH.js +61 -0
  260. package/dist/react/client/chunk-MYTOL2RH.js.map +1 -0
  261. package/dist/react/client/chunk-N64GC5ZU.js +12 -0
  262. package/dist/react/client/chunk-N64GC5ZU.js.map +1 -0
  263. package/dist/react/client/chunk-NEAL74VV.js +130 -0
  264. package/dist/react/client/chunk-NEAL74VV.js.map +1 -0
  265. package/dist/react/client/chunk-OF6BMW2X.js +30 -0
  266. package/dist/react/client/chunk-OF6BMW2X.js.map +1 -0
  267. package/dist/react/client/chunk-OILITPDP.js +72 -0
  268. package/dist/react/client/chunk-OILITPDP.js.map +1 -0
  269. package/dist/react/client/chunk-OU4ACOFA.js +75 -0
  270. package/dist/react/client/chunk-OU4ACOFA.js.map +1 -0
  271. package/dist/react/client/chunk-OVMH25G3.js +23 -0
  272. package/dist/react/client/chunk-OVMH25G3.js.map +1 -0
  273. package/dist/react/client/chunk-P2UPL6Y3.js +205 -0
  274. package/dist/react/client/chunk-P2UPL6Y3.js.map +1 -0
  275. package/dist/react/client/chunk-PAOYY55O.js +41 -0
  276. package/dist/react/client/chunk-PAOYY55O.js.map +1 -0
  277. package/dist/react/client/chunk-PYG5NCEU.js +54 -0
  278. package/dist/react/client/chunk-PYG5NCEU.js.map +1 -0
  279. package/dist/react/client/chunk-RCZS37V5.js +239 -0
  280. package/dist/react/client/chunk-RCZS37V5.js.map +1 -0
  281. package/dist/react/client/chunk-RJFN4KXE.js +36 -0
  282. package/dist/react/client/chunk-RJFN4KXE.js.map +1 -0
  283. package/dist/react/client/chunk-RNMQZ6T2.js +62 -0
  284. package/dist/react/client/chunk-RNMQZ6T2.js.map +1 -0
  285. package/dist/react/client/chunk-TXL2US4Z.js +53 -0
  286. package/dist/react/client/chunk-TXL2US4Z.js.map +1 -0
  287. package/dist/react/client/chunk-U6FMZ32G.js +192 -0
  288. package/dist/react/client/chunk-U6FMZ32G.js.map +1 -0
  289. package/dist/react/client/chunk-WR7KQGBM.js +2 -0
  290. package/dist/react/client/chunk-WR7KQGBM.js.map +1 -0
  291. package/dist/react/client/chunk-XHL4YEVA.js +17 -0
  292. package/dist/react/client/chunk-XHL4YEVA.js.map +1 -0
  293. package/dist/react/client/index.cjs +1924 -0
  294. package/dist/react/client/index.cjs.map +1 -0
  295. package/dist/react/client/index.d.cts +588 -0
  296. package/dist/react/client/index.d.ts +588 -0
  297. package/dist/react/client/index.js +233 -0
  298. package/dist/react/client/index.js.map +1 -0
  299. package/dist/react/index.cjs +1682 -0
  300. package/dist/react/index.cjs.map +1 -0
  301. package/dist/react/index.d.cts +994 -0
  302. package/dist/react/index.d.ts +994 -0
  303. package/dist/react/index.js +333 -0
  304. package/dist/react/index.js.map +1 -0
  305. package/dist/shadcn-overrides.css +112 -0
  306. package/dist/style.css +2480 -0
  307. package/dist/tailwind.css +73 -0
  308. package/dist/theme.css +346 -0
  309. package/package.json +171 -0
@@ -0,0 +1,130 @@
1
+ 'use client';
2
+ import {
3
+ Icon
4
+ } from "./chunk-LDOUB5IA.js";
5
+ import {
6
+ cn
7
+ } from "./chunk-N64GC5ZU.js";
8
+
9
+ // src/components/ui/dropdown-menu.tsx
10
+ import * as React from "react";
11
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
12
+ import { jsx, jsxs } from "react/jsx-runtime";
13
+ var DropdownMenu = DropdownMenuPrimitive.Root;
14
+ var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
15
+ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
16
+ var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
17
+ var DropdownMenuSub = DropdownMenuPrimitive.Sub;
18
+ var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
19
+ var DropdownMenuSubTrigger = React.forwardRef(
20
+ ({ className, inset, children, icon = /* @__PURE__ */ jsx(Icon, { name: "chevron-right" }), ...props }, ref) => /* @__PURE__ */ jsxs(
21
+ DropdownMenuPrimitive.SubTrigger,
22
+ {
23
+ ref,
24
+ className: cn("sv-menu-item", inset && "sv-menu-item--inset", className),
25
+ ...props,
26
+ children: [
27
+ children,
28
+ icon
29
+ ]
30
+ }
31
+ )
32
+ );
33
+ DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
34
+ var DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
35
+ DropdownMenuPrimitive.SubContent,
36
+ {
37
+ ref,
38
+ className: cn("sv-pop", className),
39
+ ...props
40
+ }
41
+ ));
42
+ DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
43
+ var DropdownMenuContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
44
+ DropdownMenuPrimitive.Content,
45
+ {
46
+ ref,
47
+ className: cn("sv-pop", className),
48
+ ...props
49
+ }
50
+ ) }));
51
+ DropdownMenuContent.displayName = "DropdownMenuContent";
52
+ var DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
53
+ DropdownMenuPrimitive.Item,
54
+ {
55
+ ref,
56
+ className: cn("sv-menu-item", inset && "sv-menu-item--inset", className),
57
+ ...props
58
+ }
59
+ ));
60
+ DropdownMenuItem.displayName = "DropdownMenuItem";
61
+ var DropdownMenuCheckboxItem = React.forwardRef(({ className, children, icon = /* @__PURE__ */ jsx(Icon, { name: "check" }), ...props }, ref) => /* @__PURE__ */ jsxs(
62
+ DropdownMenuPrimitive.CheckboxItem,
63
+ {
64
+ ref,
65
+ className: cn("sv-menu-item", className),
66
+ ...props,
67
+ children: [
68
+ icon === null ? null : /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { className: "sv-menu-item__indicator", children: icon }),
69
+ children
70
+ ]
71
+ }
72
+ ));
73
+ DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
74
+ var DropdownMenuRadioItem = React.forwardRef(
75
+ ({ className, children, icon = /* @__PURE__ */ jsx("span", { className: "sv-menu-item__dot" }), ...props }, ref) => /* @__PURE__ */ jsxs(
76
+ DropdownMenuPrimitive.RadioItem,
77
+ {
78
+ ref,
79
+ className: cn("sv-menu-item", className),
80
+ ...props,
81
+ children: [
82
+ icon === null ? null : /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { className: "sv-menu-item__indicator", children: icon }),
83
+ children
84
+ ]
85
+ }
86
+ )
87
+ );
88
+ DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
89
+ var DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
90
+ DropdownMenuPrimitive.Label,
91
+ {
92
+ ref,
93
+ className: cn("sv-menu-label", inset && "sv-menu-item--inset", className),
94
+ ...props
95
+ }
96
+ ));
97
+ DropdownMenuLabel.displayName = "DropdownMenuLabel";
98
+ var DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
99
+ DropdownMenuPrimitive.Separator,
100
+ {
101
+ ref,
102
+ className: cn("sv-menu-separator", className),
103
+ ...props
104
+ }
105
+ ));
106
+ DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
107
+ var DropdownMenuShortcut = ({
108
+ className,
109
+ ...props
110
+ }) => /* @__PURE__ */ jsx("span", { className: cn("sv-menu-shortcut", className), ...props });
111
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
112
+
113
+ export {
114
+ DropdownMenu,
115
+ DropdownMenuTrigger,
116
+ DropdownMenuGroup,
117
+ DropdownMenuPortal,
118
+ DropdownMenuSub,
119
+ DropdownMenuRadioGroup,
120
+ DropdownMenuSubTrigger,
121
+ DropdownMenuSubContent,
122
+ DropdownMenuContent,
123
+ DropdownMenuItem,
124
+ DropdownMenuCheckboxItem,
125
+ DropdownMenuRadioItem,
126
+ DropdownMenuLabel,
127
+ DropdownMenuSeparator,
128
+ DropdownMenuShortcut
129
+ };
130
+ //# sourceMappingURL=chunk-NEAL74VV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ui/dropdown-menu.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { cn } from \"../../lib/utils\"\nimport { Icon } from \"./icon\"\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\n/**\n * `icon` is the same contract as Select's (CLIENT-14): omit it and the system\n * icon renders, pass a node and that node takes the slot, pass `null` and the\n * slot collapses. The default lives in the parameter, not a fallback\n * expression, so it only fires on `undefined` — `null` has to stay `null`.\n */\nexport interface DropdownMenuSubTriggerProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> {\n inset?: boolean\n icon?: React.ReactNode\n}\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n DropdownMenuSubTriggerProps\n>(\n (\n { className, inset, children, icon = <Icon name=\"chevron-right\" />, ...props },\n ref\n ) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\"sv-menu-item\", inset && \"sv-menu-item--inset\", className)}\n {...props}\n >\n {children}\n {icon}\n </DropdownMenuPrimitive.SubTrigger>\n )\n)\nDropdownMenuSubTrigger.displayName = \"DropdownMenuSubTrigger\"\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\"sv-pop\", className)}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName = \"DropdownMenuSubContent\"\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n className={cn(\"sv-pop\", className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = \"DropdownMenuContent\"\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\"sv-menu-item\", inset && \"sv-menu-item--inset\", className)}\n {...props}\n />\n))\nDropdownMenuItem.displayName = \"DropdownMenuItem\"\n\nexport interface DropdownMenuCheckboxItemProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem> {\n icon?: React.ReactNode\n}\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n DropdownMenuCheckboxItemProps\n>(({ className, children, icon = <Icon name=\"check\" />, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\"sv-menu-item\", className)}\n {...props}\n >\n {icon === null ? null : (\n <DropdownMenuPrimitive.ItemIndicator className=\"sv-menu-item__indicator\">\n {icon}\n </DropdownMenuPrimitive.ItemIndicator>\n )}\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName = \"DropdownMenuCheckboxItem\"\n\nexport interface DropdownMenuRadioItemProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem> {\n icon?: React.ReactNode\n}\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n DropdownMenuRadioItemProps\n>(\n (\n { className, children, icon = <span className=\"sv-menu-item__dot\" />, ...props },\n ref\n ) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\"sv-menu-item\", className)}\n {...props}\n >\n {icon === null ? null : (\n <DropdownMenuPrimitive.ItemIndicator className=\"sv-menu-item__indicator\">\n {icon}\n </DropdownMenuPrimitive.ItemIndicator>\n )}\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n)\nDropdownMenuRadioItem.displayName = \"DropdownMenuRadioItem\"\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\"sv-menu-label\", inset && \"sv-menu-item--inset\", className)}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = \"DropdownMenuLabel\"\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"sv-menu-separator\", className)}\n {...props}\n />\n))\nDropdownMenuSeparator.displayName = \"DropdownMenuSeparator\"\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span className={cn(\"sv-menu-shortcut\", className)} {...props} />\n)\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\"\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n"],"mappings":";;;;;;;;;AAAA,YAAY,WAAW;AACvB,YAAY,2BAA2B;AA4BE,cAG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ip.tsx
7
+ import * as React from "react";
8
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
9
+ import { jsx } from "react/jsx-runtime";
10
+ var TooltipProvider = TooltipPrimitive.Provider;
11
+ var Tooltip = TooltipPrimitive.Root;
12
+ var TooltipTrigger = TooltipPrimitive.Trigger;
13
+ var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
14
+ TooltipPrimitive.Content,
15
+ {
16
+ ref,
17
+ sideOffset,
18
+ className: cn("sv-pop", "sv-tooltip", className),
19
+ ...props
20
+ }
21
+ ));
22
+ TooltipContent.displayName = "TooltipContent";
23
+
24
+ export {
25
+ TooltipProvider,
26
+ Tooltip,
27
+ TooltipTrigger,
28
+ TooltipContent
29
+ };
30
+ //# sourceMappingURL=chunk-OF6BMW2X.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ui/tooltip.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\nimport { cn } from \"../../lib/utils\"\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"sv-pop\", \"sv-tooltip\", className)}\n {...props}\n />\n))\nTooltipContent.displayName = \"TooltipContent\"\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n"],"mappings":";;;;;;AAAA,YAAY,WAAW;AACvB,YAAY,sBAAsB;AAahC;AAVF,IAAM,kBAAmC;AAEzC,IAAM,UAA2B;AAEjC,IAAM,iBAAkC;AAExC,IAAM,iBAAuB,iBAG3B,CAAC,EAAE,WAAW,aAAa,GAAG,GAAG,MAAM,GAAG,QAC1C;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW,GAAG,UAAU,cAAc,SAAS;AAAA,IAC9C,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAAc;","names":[]}
@@ -0,0 +1,72 @@
1
+ 'use client';
2
+
3
+ // src/behaviors/mediaQuery.ts
4
+ function createMediaQuery(query) {
5
+ if (typeof window === "undefined" || !window.matchMedia) {
6
+ return {
7
+ getSnapshot: () => false,
8
+ subscribe: () => () => {
9
+ },
10
+ // no-op unsubscribe
11
+ destroy: () => {
12
+ }
13
+ // no-op
14
+ };
15
+ }
16
+ const mql = window.matchMedia(query);
17
+ const listeners = [];
18
+ let currentMatches = mql.matches;
19
+ let attached = false;
20
+ const handleChange = () => {
21
+ const newMatches = mql.matches;
22
+ if (newMatches !== currentMatches) {
23
+ currentMatches = newMatches;
24
+ for (const listener of [...listeners]) {
25
+ listener();
26
+ }
27
+ }
28
+ };
29
+ const attachListener = () => {
30
+ if (attached) return;
31
+ attached = true;
32
+ if (mql.addEventListener) {
33
+ mql.addEventListener("change", handleChange);
34
+ } else if (mql.addListener) {
35
+ mql.addListener(handleChange);
36
+ }
37
+ };
38
+ const detachListener = () => {
39
+ if (!attached) return;
40
+ attached = false;
41
+ if (mql.removeEventListener) {
42
+ mql.removeEventListener("change", handleChange);
43
+ } else if (mql.removeListener) {
44
+ mql.removeListener(handleChange);
45
+ }
46
+ };
47
+ return {
48
+ getSnapshot: () => mql.matches,
49
+ subscribe: (listener) => {
50
+ listeners.push(listener);
51
+ attachListener();
52
+ return () => {
53
+ const index = listeners.indexOf(listener);
54
+ if (index >= 0) {
55
+ listeners.splice(index, 1);
56
+ }
57
+ if (listeners.length === 0) {
58
+ detachListener();
59
+ }
60
+ };
61
+ },
62
+ destroy: () => {
63
+ listeners.length = 0;
64
+ detachListener();
65
+ }
66
+ };
67
+ }
68
+
69
+ export {
70
+ createMediaQuery
71
+ };
72
+ //# sourceMappingURL=chunk-OILITPDP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/behaviors/mediaQuery.ts"],"sourcesContent":["/**\n * Source external state (media query match) for React's useSyncExternalStore.\n * Framework-agnostic core used by useMediaQuery.\n */\n\nexport interface MediaQueryController {\n /** Get current media query match state. */\n getSnapshot(): boolean;\n /** Subscribe to changes. Returns unsubscribe function. */\n subscribe(listener: () => void): () => void;\n /** Cleanup: remove all listeners. */\n destroy(): void;\n}\n\n/**\n * Create a media query controller that notifies listeners on transitions.\n * If matchMedia is unavailable, returns an inert controller (always false, subscribe is no-op).\n *\n * @example\n * const mq = createMediaQuery('(min-width: 1024px)');\n * const unsubscribe = mq.subscribe(() => console.log('changed'));\n * console.log(mq.getSnapshot()); // boolean\n * unsubscribe();\n * mq.destroy();\n */\nexport function createMediaQuery(query: string): MediaQueryController {\n // Fallback if matchMedia is not available (e.g., jsdom without stub)\n if (typeof window === 'undefined' || !window.matchMedia) {\n return {\n getSnapshot: () => false,\n subscribe: () => () => {}, // no-op unsubscribe\n destroy: () => {}, // no-op\n };\n }\n\n const mql = window.matchMedia(query);\n const listeners: (() => void)[] = [];\n let currentMatches = mql.matches;\n let attached = false;\n\n // Unified handler for both addEventListener and addListener (deprecated)\n const handleChange = () => {\n const newMatches = mql.matches;\n // Only notify if there's an actual transition\n if (newMatches !== currentMatches) {\n currentMatches = newMatches;\n // Notify a snapshot: a listener unsubscribing mid-loop must not skip\n // the next listener via the live array shifting under `splice`.\n for (const listener of [...listeners]) {\n listener();\n }\n }\n };\n\n const attachListener = () => {\n if (attached) return;\n attached = true;\n\n // Use addEventListener (modern) with fallback to addListener (deprecated)\n if (mql.addEventListener) {\n mql.addEventListener('change', handleChange);\n } else if (mql.addListener) {\n // Fallback for older browsers (addListener is deprecated, not implemented in modern jsdom)\n mql.addListener(handleChange as Parameters<MediaQueryList['addListener']>[0]);\n }\n };\n\n const detachListener = () => {\n if (!attached) return;\n attached = false;\n\n if (mql.removeEventListener) {\n mql.removeEventListener('change', handleChange);\n } else if (mql.removeListener) {\n // Fallback for older browsers (removeListener is deprecated, not implemented in modern jsdom)\n mql.removeListener(handleChange as Parameters<MediaQueryList['removeListener']>[0]);\n }\n };\n\n return {\n getSnapshot: () => mql.matches,\n\n subscribe: (listener: () => void) => {\n listeners.push(listener);\n attachListener();\n\n // Return unsubscribe function\n return () => {\n const index = listeners.indexOf(listener);\n if (index >= 0) {\n listeners.splice(index, 1);\n }\n\n // Detach if no more listeners\n if (listeners.length === 0) {\n detachListener();\n }\n };\n },\n\n destroy: () => {\n listeners.length = 0;\n detachListener();\n },\n };\n}\n"],"mappings":";;;AAyBO,SAAS,iBAAiB,OAAqC;AAEpE,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,YAAY;AACvD,WAAO;AAAA,MACL,aAAa,MAAM;AAAA,MACnB,WAAW,MAAM,MAAM;AAAA,MAAC;AAAA;AAAA,MACxB,SAAS,MAAM;AAAA,MAAC;AAAA;AAAA,IAClB;AAAA,EACF;AAEA,QAAM,MAAM,OAAO,WAAW,KAAK;AACnC,QAAM,YAA4B,CAAC;AACnC,MAAI,iBAAiB,IAAI;AACzB,MAAI,WAAW;AAGf,QAAM,eAAe,MAAM;AACzB,UAAM,aAAa,IAAI;AAEvB,QAAI,eAAe,gBAAgB;AACjC,uBAAiB;AAGjB,iBAAW,YAAY,CAAC,GAAG,SAAS,GAAG;AACrC,iBAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAEA,QAAM,iBAAiB,MAAM;AAC3B,QAAI,SAAU;AACd,eAAW;AAGX,QAAI,IAAI,kBAAkB;AACxB,UAAI,iBAAiB,UAAU,YAAY;AAAA,IAC7C,WAAW,IAAI,aAAa;AAE1B,UAAI,YAAY,YAA4D;AAAA,IAC9E;AAAA,EACF;AAEA,QAAM,iBAAiB,MAAM;AAC3B,QAAI,CAAC,SAAU;AACf,eAAW;AAEX,QAAI,IAAI,qBAAqB;AAC3B,UAAI,oBAAoB,UAAU,YAAY;AAAA,IAChD,WAAW,IAAI,gBAAgB;AAE7B,UAAI,eAAe,YAA+D;AAAA,IACpF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,aAAa,MAAM,IAAI;AAAA,IAEvB,WAAW,CAAC,aAAyB;AACnC,gBAAU,KAAK,QAAQ;AACvB,qBAAe;AAGf,aAAO,MAAM;AACX,cAAM,QAAQ,UAAU,QAAQ,QAAQ;AACxC,YAAI,SAAS,GAAG;AACd,oBAAU,OAAO,OAAO,CAAC;AAAA,QAC3B;AAGA,YAAI,UAAU,WAAW,GAAG;AAC1B,yBAAe;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAAA,IAEA,SAAS,MAAM;AACb,gBAAU,SAAS;AACnB,qBAAe;AAAA,IACjB;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,75 @@
1
+ 'use client';
2
+ import {
3
+ cx
4
+ } from "./chunk-ABWCVXOO.js";
5
+
6
+ // src/recipes/article.ts
7
+ function codeBlock() {
8
+ return "sv-code-block";
9
+ }
10
+ var codeBlockClasses = {
11
+ header: "sv-code-block__header",
12
+ pre: "sv-code-block__pre",
13
+ copy: "sv-code-block__copy",
14
+ copyCopied: cx("sv-code-block__copy", "sv-code-block__copy--copied")
15
+ };
16
+ function callout(kind) {
17
+ return cx("sv-callout", `sv-callout--${kind}`);
18
+ }
19
+ var calloutClasses = {
20
+ label: "sv-callout__label"
21
+ };
22
+ var calloutLabels = {
23
+ note: "Note",
24
+ warn: "Warn",
25
+ aha: "Aha!"
26
+ };
27
+ function tableOfContents() {
28
+ return "sv-toc";
29
+ }
30
+ function tocLink(options = {}) {
31
+ return cx(
32
+ "sv-toc__link",
33
+ options.active && "sv-toc__link--active",
34
+ options.depth === 3 && "sv-toc__link--depth-3"
35
+ );
36
+ }
37
+ function readingProgress() {
38
+ return "sv-reading-progress";
39
+ }
40
+ var readingProgressClasses = {
41
+ bar: "sv-reading-progress__bar"
42
+ };
43
+ var READING_PROGRESS_VAR = "--sv-reading-progress";
44
+ function articleHeader() {
45
+ return "sv-article-header";
46
+ }
47
+ var articleHeaderClasses = {
48
+ title: "sv-article-header__title",
49
+ meta: "sv-article-header__meta",
50
+ author: "sv-article-header__author"
51
+ };
52
+ function prose() {
53
+ return "sv-prose";
54
+ }
55
+ var proseClasses = {
56
+ lead: "sv-prose__lead"
57
+ };
58
+
59
+ export {
60
+ codeBlock,
61
+ codeBlockClasses,
62
+ callout,
63
+ calloutClasses,
64
+ calloutLabels,
65
+ tableOfContents,
66
+ tocLink,
67
+ readingProgress,
68
+ readingProgressClasses,
69
+ READING_PROGRESS_VAR,
70
+ articleHeader,
71
+ articleHeaderClasses,
72
+ prose,
73
+ proseClasses
74
+ };
75
+ //# sourceMappingURL=chunk-OU4ACOFA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/recipes/article.ts"],"sourcesContent":["import { cx } from './cx';\n\n/**\n * Article recipes: CodeBlock, Callout, TableOfContents, ReadingProgress,\n * ArticleHeader, Prose. Pure functions — Server Component safe.\n */\n\nexport function codeBlock(): string {\n return 'sv-code-block';\n}\n\nexport const codeBlockClasses = {\n header: 'sv-code-block__header',\n pre: 'sv-code-block__pre',\n copy: 'sv-code-block__copy',\n copyCopied: cx('sv-code-block__copy', 'sv-code-block__copy--copied'),\n} as const;\n\nexport type CalloutKind = 'note' | 'warn' | 'aha';\n\nexport function callout(kind: CalloutKind): string {\n return cx('sv-callout', `sv-callout--${kind}`);\n}\n\nexport const calloutClasses = {\n label: 'sv-callout__label',\n} as const;\n\nexport const calloutLabels: Record<CalloutKind, string> = {\n note: 'Note',\n warn: 'Warn',\n aha: 'Aha!',\n};\n\nexport function tableOfContents(): string {\n return 'sv-toc';\n}\n\nexport interface TocLinkOptions {\n active?: boolean;\n /** Heading depth, 2 (h2) or 3 (h3). Depth 3 indents. */\n depth?: 2 | 3;\n}\n\nexport function tocLink(options: TocLinkOptions = {}): string {\n return cx(\n 'sv-toc__link',\n options.active && 'sv-toc__link--active',\n options.depth === 3 && 'sv-toc__link--depth-3',\n );\n}\n\nexport function readingProgress(): string {\n return 'sv-reading-progress';\n}\n\nexport const readingProgressClasses = {\n bar: 'sv-reading-progress__bar',\n} as const;\n\n/** CSS var read by `.sv-reading-progress__bar` (0 → 1). */\nexport const READING_PROGRESS_VAR = '--sv-reading-progress';\n\nexport function articleHeader(): string {\n return 'sv-article-header';\n}\n\nexport const articleHeaderClasses = {\n title: 'sv-article-header__title',\n meta: 'sv-article-header__meta',\n author: 'sv-article-header__author',\n} as const;\n\nexport function prose(): string {\n return 'sv-prose';\n}\n\nexport const proseClasses = {\n lead: 'sv-prose__lead',\n} as const;\n"],"mappings":";;;;;;AAOO,SAAS,YAAoB;AAClC,SAAO;AACT;AAEO,IAAM,mBAAmB;AAAA,EAC9B,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,MAAM;AAAA,EACN,YAAY,GAAG,uBAAuB,6BAA6B;AACrE;AAIO,SAAS,QAAQ,MAA2B;AACjD,SAAO,GAAG,cAAc,eAAe,IAAI,EAAE;AAC/C;AAEO,IAAM,iBAAiB;AAAA,EAC5B,OAAO;AACT;AAEO,IAAM,gBAA6C;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,KAAK;AACP;AAEO,SAAS,kBAA0B;AACxC,SAAO;AACT;AAQO,SAAS,QAAQ,UAA0B,CAAC,GAAW;AAC5D,SAAO;AAAA,IACL;AAAA,IACA,QAAQ,UAAU;AAAA,IAClB,QAAQ,UAAU,KAAK;AAAA,EACzB;AACF;AAEO,SAAS,kBAA0B;AACxC,SAAO;AACT;AAEO,IAAM,yBAAyB;AAAA,EACpC,KAAK;AACP;AAGO,IAAM,uBAAuB;AAE7B,SAAS,gBAAwB;AACtC,SAAO;AACT;AAEO,IAAM,uBAAuB;AAAA,EAClC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AACV;AAEO,SAAS,QAAgB;AAC9B,SAAO;AACT;AAEO,IAAM,eAAe;AAAA,EAC1B,MAAM;AACR;","names":[]}
@@ -0,0 +1,23 @@
1
+ 'use client';
2
+
3
+ // src/components/ui/restore-focus.ts
4
+ import * as React from "react";
5
+ function useRestoreFocus(onCloseAutoFocus) {
6
+ const [opener] = React.useState(() => {
7
+ if (typeof document === "undefined") return null;
8
+ const active = document.activeElement;
9
+ return active instanceof HTMLElement && active !== document.body ? active : null;
10
+ });
11
+ return (event) => {
12
+ onCloseAutoFocus?.(event);
13
+ if (event.defaultPrevented) return;
14
+ if (opener === null || !opener.isConnected) return;
15
+ event.preventDefault();
16
+ opener.focus({ preventScroll: true });
17
+ };
18
+ }
19
+
20
+ export {
21
+ useRestoreFocus
22
+ };
23
+ //# sourceMappingURL=chunk-OVMH25G3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ui/restore-focus.ts"],"sourcesContent":["import * as React from \"react\"\n\n/**\n * Focus restoration for the modal family (Dialog, AlertDialog, BottomSheet).\n *\n * Radix's Dialog restores focus on close to *its own* `Dialog.Trigger`. A\n * dialog opened without one — controlled `open` from a menu item, a table\n * row, an effect — or one the parent simply unmounts, has no trigger ref, so\n * focus fell back to `<body>` and keyboard/screen-reader users lost their\n * place (estomasystech kept a manual `previouslyFocused?.focus()` effect for\n * exactly this).\n *\n * This records the element that had focus when the content first rendered\n * (before Radix moves focus inside) and, on close or unmount, returns focus\n * there — as long as that element is still in the document and focusable.\n * Otherwise Radix's default (its trigger) runs untouched. A consumer's own\n * `onCloseAutoFocus` runs first and can still `preventDefault()` to take over.\n */\nexport function useRestoreFocus(\n onCloseAutoFocus: ((event: Event) => void) | undefined,\n): (event: Event) => void {\n const [opener] = React.useState<HTMLElement | null>(() => {\n // Server render: no document, and `instanceof HTMLElement` would throw a\n // ReferenceError there (the right-hand side is evaluated even for null).\n if (typeof document === \"undefined\") return null\n const active = document.activeElement\n return active instanceof HTMLElement && active !== document.body ? active : null\n })\n\n return (event: Event) => {\n onCloseAutoFocus?.(event)\n if (event.defaultPrevented) return\n if (opener === null || !opener.isConnected) return\n event.preventDefault()\n opener.focus({ preventScroll: true })\n }\n}\n"],"mappings":";;;AAAA,YAAY,WAAW;AAkBhB,SAAS,gBACd,kBACwB;AACxB,QAAM,CAAC,MAAM,IAAU,eAA6B,MAAM;AAGxD,QAAI,OAAO,aAAa,YAAa,QAAO;AAC5C,UAAM,SAAS,SAAS;AACxB,WAAO,kBAAkB,eAAe,WAAW,SAAS,OAAO,SAAS;AAAA,EAC9E,CAAC;AAED,SAAO,CAAC,UAAiB;AACvB,uBAAmB,KAAK;AACxB,QAAI,MAAM,iBAAkB;AAC5B,QAAI,WAAW,QAAQ,CAAC,OAAO,YAAa;AAC5C,UAAM,eAAe;AACrB,WAAO,MAAM,EAAE,eAAe,KAAK,CAAC;AAAA,EACtC;AACF;","names":[]}
@@ -0,0 +1,205 @@
1
+ 'use client';
2
+ import {
3
+ Icon
4
+ } from "./chunk-LDOUB5IA.js";
5
+ import {
6
+ useMediaQuery
7
+ } from "./chunk-MGR4F2BJ.js";
8
+ import {
9
+ cn
10
+ } from "./chunk-N64GC5ZU.js";
11
+
12
+ // src/react/client/SidebarProvider.tsx
13
+ import {
14
+ createContext,
15
+ useContext,
16
+ useId,
17
+ useState,
18
+ useCallback,
19
+ useRef,
20
+ useSyncExternalStore,
21
+ forwardRef
22
+ } from "react";
23
+ import * as Dialog from "@radix-ui/react-dialog";
24
+ import { jsx, jsxs } from "react/jsx-runtime";
25
+ function composeRefs(...refs) {
26
+ return (node) => {
27
+ for (const ref of refs) {
28
+ if (typeof ref === "function") {
29
+ ref(node);
30
+ } else if (ref !== null && ref !== void 0) {
31
+ ;
32
+ ref.current = node;
33
+ }
34
+ }
35
+ };
36
+ }
37
+ var DEFAULT_BREAKPOINT = 1024;
38
+ var noopSubscribe = () => () => {
39
+ };
40
+ function useHydrated() {
41
+ return useSyncExternalStore(
42
+ noopSubscribe,
43
+ () => true,
44
+ () => false
45
+ );
46
+ }
47
+ var SidebarContext = createContext(null);
48
+ function SidebarProvider({
49
+ children,
50
+ defaultOpen = true,
51
+ open: controlledOpen,
52
+ onOpenChange,
53
+ collapsible: collapsibleProp = "offcanvas",
54
+ breakpoint: breakpointProp
55
+ }) {
56
+ const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
57
+ const panelId = useId();
58
+ const triggerRef = useRef(null);
59
+ const breakpoint = (() => {
60
+ if (breakpointProp === void 0 || breakpointProp === 0 || breakpointProp < 0 || Number.isNaN(breakpointProp) || !Number.isFinite(breakpointProp)) {
61
+ return DEFAULT_BREAKPOINT;
62
+ }
63
+ return breakpointProp;
64
+ })();
65
+ const hydrated = useHydrated();
66
+ const matchesDesktop = useMediaQuery(`(min-width: ${breakpoint}px)`);
67
+ const isMobile = hydrated ? !matchesDesktop : false;
68
+ const isControlled = controlledOpen !== void 0;
69
+ const open = isControlled ? controlledOpen : uncontrolledOpen;
70
+ const setOpen = useCallback(
71
+ (newOpen) => {
72
+ if (collapsibleProp === "none") return;
73
+ if (isControlled) {
74
+ onOpenChange?.(newOpen);
75
+ } else {
76
+ setUncontrolledOpen(newOpen);
77
+ }
78
+ },
79
+ [collapsibleProp, isControlled, onOpenChange]
80
+ );
81
+ const toggle = useCallback(() => {
82
+ if (collapsibleProp === "none") return;
83
+ if (isControlled) {
84
+ onOpenChange?.(!controlledOpen);
85
+ } else {
86
+ setUncontrolledOpen((prev) => !prev);
87
+ }
88
+ }, [collapsibleProp, isControlled, controlledOpen, onOpenChange]);
89
+ const contextValue = {
90
+ open,
91
+ setOpen,
92
+ toggle,
93
+ isMobile,
94
+ collapsible: collapsibleProp,
95
+ panelId,
96
+ triggerRef
97
+ };
98
+ return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(
99
+ "div",
100
+ {
101
+ className: "sv-app-shell",
102
+ "data-state": open ? "open" : "closed",
103
+ "data-collapsible": collapsibleProp,
104
+ "data-mobile": hydrated ? isMobile : void 0,
105
+ "data-breakpoint": breakpoint === DEFAULT_BREAKPOINT ? void 0 : breakpoint,
106
+ children: [
107
+ !hydrated && breakpoint !== DEFAULT_BREAKPOINT ? /* @__PURE__ */ jsx(SidebarBreakpointStyle, { breakpoint }) : null,
108
+ children
109
+ ]
110
+ }
111
+ ) });
112
+ }
113
+ function SidebarBreakpointStyle({ breakpoint }) {
114
+ const scope = `.sv-app-shell[data-breakpoint="${breakpoint}"]:not([data-mobile]):not([data-collapsible='none'])`;
115
+ return /* @__PURE__ */ jsx("style", { children: `@media (width < ${breakpoint}px){${scope} .sv-app-sidebar{display:none}}` });
116
+ }
117
+ function useSidebar() {
118
+ const context = useContext(SidebarContext);
119
+ if (!context) {
120
+ throw new Error("useSidebar must be used within SidebarProvider");
121
+ }
122
+ return context;
123
+ }
124
+ var SidebarPanel = forwardRef(
125
+ function SidebarPanel2({ className, title = "Navigation", closeLabel = "Close sidebar", children, ...props }, ref) {
126
+ const { open, setOpen, isMobile, collapsible, panelId, triggerRef } = useSidebar();
127
+ if (isMobile && collapsible !== "none") {
128
+ return /* @__PURE__ */ jsx(Dialog.Root, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
129
+ /* @__PURE__ */ jsx(Dialog.Overlay, { className: "sv-overlay" }),
130
+ /* @__PURE__ */ jsxs(
131
+ Dialog.Content,
132
+ {
133
+ ref,
134
+ className: cn("sv-app-sidebar sv-app-sidebar__drawer", className),
135
+ role: "dialog",
136
+ "aria-modal": "true",
137
+ id: panelId,
138
+ onCloseAutoFocus: (event) => {
139
+ event.preventDefault();
140
+ triggerRef.current?.focus();
141
+ },
142
+ ...props,
143
+ children: [
144
+ /* @__PURE__ */ jsx(Dialog.Title, { className: "sv-sr-only", children: title }),
145
+ /* @__PURE__ */ jsx("div", { className: "sv-app-sidebar__body", children }),
146
+ /* @__PURE__ */ jsx(Dialog.Close, { className: "sv-dialog__close", asChild: true, children: /* @__PURE__ */ jsx("button", { type: "button", "aria-label": closeLabel, children: /* @__PURE__ */ jsx(Icon, { name: "x" }) }) })
147
+ ]
148
+ }
149
+ )
150
+ ] }) });
151
+ }
152
+ return /* @__PURE__ */ jsx(
153
+ "aside",
154
+ {
155
+ ref,
156
+ className: cn("sv-app-sidebar", className),
157
+ id: panelId,
158
+ ...props,
159
+ children: /* @__PURE__ */ jsx("div", { className: "sv-app-sidebar__body", children })
160
+ }
161
+ );
162
+ }
163
+ );
164
+ SidebarPanel.displayName = "SidebarPanel";
165
+ var SidebarTrigger = forwardRef(
166
+ function SidebarTrigger2({ className, label, children, onClick, ...props }, ref) {
167
+ const { open, toggle, collapsible, panelId, triggerRef } = useSidebar();
168
+ if (collapsible === "none") {
169
+ return null;
170
+ }
171
+ return /* @__PURE__ */ jsx(
172
+ "button",
173
+ {
174
+ ref: composeRefs(ref, triggerRef),
175
+ type: "button",
176
+ ...props,
177
+ className: cn("sv-app-sidebar-trigger", className),
178
+ "aria-expanded": open,
179
+ "aria-controls": panelId,
180
+ "aria-label": label || "Toggle sidebar",
181
+ onClick: (event) => {
182
+ onClick?.(event);
183
+ toggle();
184
+ },
185
+ children: children || /* @__PURE__ */ jsx(Icon, { name: "menu" })
186
+ }
187
+ );
188
+ }
189
+ );
190
+ SidebarTrigger.displayName = "SidebarTrigger";
191
+ var SidebarInset = forwardRef(
192
+ function SidebarInset2({ className, ...props }, ref) {
193
+ return /* @__PURE__ */ jsx("main", { ref, className: cn("sv-app-sidebar-inset", className), ...props });
194
+ }
195
+ );
196
+ SidebarInset.displayName = "SidebarInset";
197
+
198
+ export {
199
+ SidebarProvider,
200
+ useSidebar,
201
+ SidebarPanel,
202
+ SidebarTrigger,
203
+ SidebarInset
204
+ };
205
+ //# sourceMappingURL=chunk-P2UPL6Y3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/react/client/SidebarProvider.tsx"],"sourcesContent":["'use client'\n\nimport {\n createContext,\n useContext,\n useId,\n useState,\n useCallback,\n useRef,\n useSyncExternalStore,\n type ReactNode,\n type ComponentPropsWithoutRef,\n type Ref,\n type RefObject,\n type MutableRefObject,\n forwardRef,\n} from 'react'\nimport * as Dialog from '@radix-ui/react-dialog'\nimport { useMediaQuery } from './hooks'\nimport { Icon } from '../../components/ui/icon'\nimport { cn } from '../../lib/utils'\n\n/**\n * R5-02, R5-03: Sidebar state provider and context\n */\n\n/**\n * Same ref-merge as `src/components/ui/slot.tsx`'s `composeRefs`, inlined\n * here rather than imported: that file's version is a *local*, unexported\n * helper (its own docstring explains why — a server-safety concern that\n * doesn't apply to this already-`'use client'` module), and this component\n * needs to merge SidebarTrigger's own forwarded ref with the internal\n * `triggerRef` the provider uses to restore focus after the drawer closes.\n */\nfunction composeRefs<T>(...refs: (Ref<T> | null | undefined)[]) {\n return (node: T) => {\n for (const ref of refs) {\n if (typeof ref === 'function') {\n ref(node)\n } else if (ref !== null && ref !== undefined) {\n ;(ref as MutableRefObject<T | null>).current = node\n }\n }\n }\n}\n\nexport type SidebarCollapsible = 'offcanvas' | 'icon' | 'none'\n\n/** Default breakpoint (px): desktop at `min-width: 1024px` (= 64rem). */\nconst DEFAULT_BREAKPOINT = 1024\n\nconst noopSubscribe = () => () => {}\n\n/**\n * `false` on the server and during the hydration render, `true` afterwards —\n * and `true` straight away for a provider that mounts on the client without\n * hydrating (client-side navigation). Lets the first render match the server\n * HTML exactly, then switch to the viewport-driven branch.\n */\nfunction useHydrated(): boolean {\n return useSyncExternalStore(\n noopSubscribe,\n () => true,\n () => false,\n )\n}\n\nexport interface SidebarContextValue {\n open: boolean\n setOpen: (open: boolean) => void\n toggle: () => void\n isMobile: boolean\n collapsible: SidebarCollapsible\n panelId: string\n /**\n * R5-02 AC-5: SidebarTrigger is a plain button, not Radix's own\n * `Dialog.Trigger` (structurally it can't be — Dialog.Root only exists\n * inside SidebarPanel's conditional drawer render, and SidebarTrigger is\n * that component's sibling, not its child) — so Radix's built-in\n * \"restore focus to the trigger that opened the dialog\" behavior has no\n * trigger ref to restore to. SidebarPanel's Dialog.Content reads this ref\n * directly in its own `onCloseAutoFocus` to do that restoration itself.\n */\n triggerRef: RefObject<HTMLButtonElement | null>\n}\n\nconst SidebarContext = createContext<SidebarContextValue | null>(null)\n\nexport interface SidebarProviderProps {\n children: ReactNode\n defaultOpen?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n collapsible?: SidebarCollapsible\n breakpoint?: number\n}\n\n/**\n * Wrapper component that provides sidebar state to the tree.\n * Renders as <div class=\"sv-app-shell\" data-state data-collapsible data-mobile>\n */\nexport function SidebarProvider({\n children,\n defaultOpen = true,\n open: controlledOpen,\n onOpenChange,\n collapsible: collapsibleProp = 'offcanvas',\n breakpoint: breakpointProp,\n}: SidebarProviderProps) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen)\n const panelId = useId()\n const triggerRef = useRef<HTMLButtonElement>(null)\n\n // Normalize breakpoint: invalid values (0, negative, NaN, Infinity) fall back to 1024\n const breakpoint = (() => {\n if (\n breakpointProp === undefined ||\n breakpointProp === 0 ||\n breakpointProp < 0 ||\n Number.isNaN(breakpointProp) ||\n !Number.isFinite(breakpointProp)\n ) {\n return DEFAULT_BREAKPOINT\n }\n return breakpointProp\n })()\n\n // CSS-first first paint. The server cannot know the viewport, so the server\n // render (and the hydration render that must match it) always emits the\n // in-flow desktop <aside>, and a media query in style.css hides it below the\n // breakpoint until JS takes over. Up to 3.5.1 this assumed *mobile* instead\n // (useMediaQuery's server snapshot), so every desktop page painted without\n // the sidebar and the content jumped sideways after hydration (CLS).\n // After hydration the real media query decides, exactly as before.\n const hydrated = useHydrated()\n const matchesDesktop = useMediaQuery(`(min-width: ${breakpoint}px)`)\n const isMobile = hydrated ? !matchesDesktop : false\n\n // Determine if controlled or uncontrolled\n const isControlled = controlledOpen !== undefined\n const open = isControlled ? controlledOpen : uncontrolledOpen\n\n const setOpen = useCallback(\n (newOpen: boolean) => {\n // R5-03 AC-4: collapsible=\"none\" means always expanded, setOpen is no-op\n if (collapsibleProp === 'none') return\n\n if (isControlled) {\n onOpenChange?.(newOpen)\n } else {\n setUncontrolledOpen(newOpen)\n }\n },\n [collapsibleProp, isControlled, onOpenChange],\n )\n\n const toggle = useCallback(() => {\n // R5-03 AC-4: collapsible=\"none\" means always expanded, toggle is no-op\n if (collapsibleProp === 'none') return\n\n if (isControlled) {\n onOpenChange?.(!controlledOpen)\n } else {\n setUncontrolledOpen((prev) => !prev)\n }\n }, [collapsibleProp, isControlled, controlledOpen, onOpenChange])\n\n const contextValue: SidebarContextValue = {\n open,\n setOpen,\n toggle,\n isMobile,\n collapsible: collapsibleProp,\n panelId,\n triggerRef,\n }\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <div\n className=\"sv-app-shell\"\n data-state={open ? 'open' : 'closed'}\n data-collapsible={collapsibleProp}\n // Absent until hydrated: `.sv-app-shell:not([data-mobile])` is the\n // pre-hydration state the CSS media query handles.\n data-mobile={hydrated ? isMobile : undefined}\n data-breakpoint={breakpoint === DEFAULT_BREAKPOINT ? undefined : breakpoint}\n >\n {!hydrated && breakpoint !== DEFAULT_BREAKPOINT ? (\n <SidebarBreakpointStyle breakpoint={breakpoint} />\n ) : null}\n {children}\n </div>\n </SidebarContext.Provider>\n )\n}\n\n/**\n * style.css hides the pre-hydration <aside> below the default 1024px. A custom\n * `breakpoint` cannot reach a static media query, so the provider emits the\n * same rule for its own value, scoped by `data-breakpoint`. Rendered only\n * until hydration; identical output on server and client, so no mismatch.\n */\nfunction SidebarBreakpointStyle({ breakpoint }: { breakpoint: number }) {\n const scope = `.sv-app-shell[data-breakpoint=\"${breakpoint}\"]:not([data-mobile]):not([data-collapsible='none'])`\n return (\n <style>{`@media (width < ${breakpoint}px){${scope} .sv-app-sidebar{display:none}}`}</style>\n )\n}\n\n/**\n * Hook to access sidebar state.\n * Throws if called outside SidebarProvider.\n */\nexport function useSidebar(): SidebarContextValue {\n const context = useContext(SidebarContext)\n if (!context) {\n throw new Error('useSidebar must be used within SidebarProvider')\n }\n return context\n}\n\n/**\n * R5-02: Sidebar panel that is static in-flow above breakpoint,\n * drawer in portal below breakpoint.\n */\nexport interface SidebarPanelProps extends ComponentPropsWithoutRef<'aside'> {\n /** Accessible title of the mobile drawer. Defaults to `\"Navigation\"`. */\n title?: string\n /** Accessible name of the drawer's close button. Defaults to `\"Close sidebar\"`. */\n closeLabel?: string\n}\n\nexport const SidebarPanel = forwardRef<HTMLElement, SidebarPanelProps>(\n function SidebarPanel(\n { className, title = 'Navigation', closeLabel = 'Close sidebar', children, ...props },\n ref,\n ) {\n const { open, setOpen, isMobile, collapsible, panelId, triggerRef } = useSidebar()\n\n // R5-03 AC-4: collapsible=\"none\" is always expanded in flow — never a\n // dismissable drawer, even below the breakpoint. Without this guard,\n // toggle/setOpen are no-ops (see SidebarProvider) and SidebarTrigger\n // renders null, so a mobile drawer here would have no control to close it.\n if (isMobile && collapsible !== 'none') {\n // Below breakpoint: drawer in portal\n return (\n <Dialog.Root open={open} onOpenChange={setOpen}>\n <Dialog.Portal>\n <Dialog.Overlay className=\"sv-overlay\" />\n <Dialog.Content\n // Dialog.Content's ref type is Ref<HTMLDivElement> (Radix's\n // primitive always renders a div); the consumer-facing ref\n // here is typed HTMLElement to also cover the desktop\n // <aside> branch below, so this cast documents that the\n // underlying node genuinely is a div in the drawer branch.\n ref={ref as Ref<HTMLDivElement>}\n className={cn('sv-app-sidebar sv-app-sidebar__drawer', className)}\n role=\"dialog\"\n aria-modal=\"true\"\n id={panelId}\n // R5-02 AC-5: restore focus to SidebarTrigger on close. Radix's\n // own default tries `context.triggerRef.current?.focus()`, but\n // that's Radix's *own* Dialog.Trigger ref — SidebarTrigger\n // isn't one (see the SidebarContextValue.triggerRef docstring\n // for why it structurally can't be), so that ref is always\n // null and focus would otherwise fall back to <body>.\n onCloseAutoFocus={(event) => {\n event.preventDefault()\n triggerRef.current?.focus()\n }}\n {...props}\n >\n <Dialog.Title className=\"sv-sr-only\">{title}</Dialog.Title>\n <div className=\"sv-app-sidebar__body\">{children}</div>\n <Dialog.Close className=\"sv-dialog__close\" asChild>\n <button type=\"button\" aria-label={closeLabel}>\n <Icon name=\"x\" />\n </button>\n </Dialog.Close>\n </Dialog.Content>\n </Dialog.Portal>\n </Dialog.Root>\n )\n }\n\n // Above breakpoint: in flow\n return (\n <aside\n ref={ref}\n className={cn('sv-app-sidebar', className)}\n id={panelId}\n {...props}\n >\n <div className=\"sv-app-sidebar__body\">{children}</div>\n </aside>\n )\n },\n)\nSidebarPanel.displayName = 'SidebarPanel'\n\n/**\n * R5-02: Trigger button to open/close sidebar.\n * Renders as menu icon by default, or custom children.\n * aria-expanded and aria-controls are derived and override props.\n */\nexport interface SidebarTriggerProps extends ComponentPropsWithoutRef<'button'> {\n /** Accessible name. Defaults to `\"Toggle sidebar\"`. */\n label?: string\n}\n\nexport const SidebarTrigger = forwardRef<HTMLButtonElement, SidebarTriggerProps>(\n function SidebarTrigger({ className, label, children, onClick, ...props }, ref) {\n const { open, toggle, collapsible, panelId, triggerRef } = useSidebar()\n\n // collapsible=\"none\" → render nothing\n if (collapsible === 'none') {\n return null\n }\n\n return (\n <button\n ref={composeRefs(ref, triggerRef)}\n type=\"button\"\n {...props}\n className={cn('sv-app-sidebar-trigger', className)}\n aria-expanded={open}\n aria-controls={panelId}\n aria-label={label || 'Toggle sidebar'}\n onClick={(event) => {\n onClick?.(event)\n toggle()\n }}\n >\n {children || <Icon name=\"menu\" />}\n </button>\n )\n },\n)\nSidebarTrigger.displayName = 'SidebarTrigger'\n\n/**\n * R5-04: Inset container that adjusts to sidebar state via CSS.\n * Does not read context — state is read by CSS selectors on the wrapper.\n */\nexport interface SidebarInsetProps extends ComponentPropsWithoutRef<'main'> {}\n\nexport const SidebarInset = forwardRef<HTMLElement, SidebarInsetProps>(\n function SidebarInset({ className, ...props }, ref) {\n return (\n <main ref={ref} className={cn('sv-app-sidebar-inset', className)} {...props} />\n )\n },\n)\nSidebarInset.displayName = 'SidebarInset'\n"],"mappings":";;;;;;;;;;;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA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