@antheo/morph 0.0.0-stage → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (464) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +266 -2
  3. package/SKILL.md +61 -0
  4. package/dist/ai/cli-provider.d.ts +80 -0
  5. package/dist/ai/cli-provider.js +250 -0
  6. package/dist/ai/gate.d.ts +39 -0
  7. package/dist/ai/gate.js +124 -0
  8. package/dist/ai/provider.d.ts +36 -0
  9. package/dist/ai/provider.js +168 -0
  10. package/dist/ai/repair.d.ts +90 -0
  11. package/dist/ai/repair.js +172 -0
  12. package/dist/analyzer/deps.d.ts +30 -0
  13. package/dist/analyzer/deps.js +265 -0
  14. package/dist/analyzer/manifest.d.ts +5 -0
  15. package/dist/analyzer/manifest.js +119 -0
  16. package/dist/analyzer/parse.d.ts +21 -0
  17. package/dist/analyzer/parse.js +29 -0
  18. package/dist/batch-worker.d.ts +16 -0
  19. package/dist/batch-worker.js +10 -0
  20. package/dist/batch.d.ts +26 -0
  21. package/dist/batch.js +227 -0
  22. package/dist/bridge/index.d.ts +26 -0
  23. package/dist/bridge/index.js +138 -0
  24. package/dist/bridge/props.d.ts +56 -0
  25. package/dist/bridge/props.js +191 -0
  26. package/dist/bridge/wrappers.d.ts +24 -0
  27. package/dist/bridge/wrappers.js +276 -0
  28. package/dist/cli/format.d.ts +7 -0
  29. package/dist/cli/format.js +30 -0
  30. package/dist/cli.d.ts +2 -0
  31. package/dist/cli.js +492 -0
  32. package/dist/fonts/carry.d.ts +34 -0
  33. package/dist/fonts/carry.js +113 -0
  34. package/dist/fonts/fallback.d.ts +11 -0
  35. package/dist/fonts/fallback.js +21 -0
  36. package/dist/fonts/google.d.ts +65 -0
  37. package/dist/fonts/google.js +343 -0
  38. package/dist/fonts/index.d.ts +27 -0
  39. package/dist/fonts/index.js +48 -0
  40. package/dist/fonts/local.d.ts +46 -0
  41. package/dist/fonts/local.js +150 -0
  42. package/dist/fonts/sfnt.d.ts +19 -0
  43. package/dist/fonts/sfnt.js +174 -0
  44. package/dist/fonts/shim.d.ts +14 -0
  45. package/dist/fonts/shim.js +96 -0
  46. package/dist/gate.d.ts +105 -0
  47. package/dist/gate.js +157 -0
  48. package/dist/index.d.ts +55 -0
  49. package/dist/index.js +74 -0
  50. package/dist/ir/annotate.d.ts +16 -0
  51. package/dist/ir/annotate.js +145 -0
  52. package/dist/ir/as-child.d.ts +18 -0
  53. package/dist/ir/as-child.js +239 -0
  54. package/dist/ir/compounds.d.ts +27 -0
  55. package/dist/ir/compounds.js +183 -0
  56. package/dist/ir/contexts.d.ts +26 -0
  57. package/dist/ir/contexts.js +185 -0
  58. package/dist/ir/dom.d.ts +11 -0
  59. package/dist/ir/dom.js +60 -0
  60. package/dist/ir/effect-returns.d.ts +10 -0
  61. package/dist/ir/effect-returns.js +25 -0
  62. package/dist/ir/extract-ui-types.d.ts +33 -0
  63. package/dist/ir/extract-ui-types.js +224 -0
  64. package/dist/ir/extract-ui.d.ts +34 -0
  65. package/dist/ir/extract-ui.js +567 -0
  66. package/dist/ir/falsy.d.ts +13 -0
  67. package/dist/ir/falsy.js +66 -0
  68. package/dist/ir/forward-refs.d.ts +11 -0
  69. package/dist/ir/forward-refs.js +155 -0
  70. package/dist/ir/fragment-source.d.ts +4 -0
  71. package/dist/ir/fragment-source.js +13 -0
  72. package/dist/ir/fragments.d.ts +32 -0
  73. package/dist/ir/fragments.js +192 -0
  74. package/dist/ir/helper-snippets.d.ts +30 -0
  75. package/dist/ir/helper-snippets.js +550 -0
  76. package/dist/ir/latest-refs.d.ts +11 -0
  77. package/dist/ir/latest-refs.js +187 -0
  78. package/dist/ir/live-args.d.ts +26 -0
  79. package/dist/ir/live-args.js +335 -0
  80. package/dist/ir/lower.d.ts +83 -0
  81. package/dist/ir/lower.js +6016 -0
  82. package/dist/ir/markup-values.d.ts +16 -0
  83. package/dist/ir/markup-values.js +188 -0
  84. package/dist/ir/model.d.ts +605 -0
  85. package/dist/ir/model.js +1 -0
  86. package/dist/ir/oracle.d.ts +91 -0
  87. package/dist/ir/oracle.js +610 -0
  88. package/dist/ir/radix.d.ts +122 -0
  89. package/dist/ir/radix.js +344 -0
  90. package/dist/ir/rename.d.ts +15 -0
  91. package/dist/ir/rename.js +151 -0
  92. package/dist/ir/render-props.d.ts +31 -0
  93. package/dist/ir/render-props.js +67 -0
  94. package/dist/ir/rewrite.d.ts +44 -0
  95. package/dist/ir/rewrite.js +381 -0
  96. package/dist/ir/running-index.d.ts +11 -0
  97. package/dist/ir/running-index.js +217 -0
  98. package/dist/ir/snapshots.d.ts +12 -0
  99. package/dist/ir/snapshots.js +140 -0
  100. package/dist/ir/style.d.ts +19 -0
  101. package/dist/ir/style.js +76 -0
  102. package/dist/ir/types.d.ts +42 -0
  103. package/dist/ir/types.js +271 -0
  104. package/dist/ir/walk.d.ts +11 -0
  105. package/dist/ir/walk.js +18 -0
  106. package/dist/mcp/server.d.ts +81 -0
  107. package/dist/mcp/server.js +518 -0
  108. package/dist/pipeline.d.ts +26 -0
  109. package/dist/pipeline.js +750 -0
  110. package/dist/registry/add.d.ts +91 -0
  111. package/dist/registry/add.js +273 -0
  112. package/dist/registry/fetch.d.ts +40 -0
  113. package/dist/registry/fetch.js +186 -0
  114. package/dist/registry/ip.d.ts +18 -0
  115. package/dist/registry/ip.js +153 -0
  116. package/dist/registry/item.d.ts +39 -0
  117. package/dist/registry/item.js +131 -0
  118. package/dist/registry/load.d.ts +35 -0
  119. package/dist/registry/load.js +106 -0
  120. package/dist/registry/paths.d.ts +8 -0
  121. package/dist/registry/paths.js +43 -0
  122. package/dist/registry/publish.d.ts +119 -0
  123. package/dist/registry/publish.js +439 -0
  124. package/dist/targets/angular/bank/bank.d.ts +39 -0
  125. package/dist/targets/angular/bank/bank.js +61 -0
  126. package/dist/targets/angular/bank/helpers.d.ts +64 -0
  127. package/dist/targets/angular/bank/helpers.js +246 -0
  128. package/dist/targets/angular/bank/kept.d.ts +98 -0
  129. package/dist/targets/angular/bank/kept.js +791 -0
  130. package/dist/targets/angular/bank/plan-helpers.d.ts +17 -0
  131. package/dist/targets/angular/bank/plan-helpers.js +286 -0
  132. package/dist/targets/angular/bank/plan.d.ts +22 -0
  133. package/dist/targets/angular/bank/plan.js +152 -0
  134. package/dist/targets/angular/bank/receivers.d.ts +66 -0
  135. package/dist/targets/angular/bank/receivers.js +293 -0
  136. package/dist/targets/angular/bank/runtime.d.ts +14 -0
  137. package/dist/targets/angular/bank/runtime.js +152 -0
  138. package/dist/targets/angular/controlled.d.ts +7 -0
  139. package/dist/targets/angular/controlled.js +37 -0
  140. package/dist/targets/angular/dynamic-tags.d.ts +34 -0
  141. package/dist/targets/angular/dynamic-tags.js +192 -0
  142. package/dist/targets/angular/emit.d.ts +41 -0
  143. package/dist/targets/angular/emit.js +5970 -0
  144. package/dist/targets/angular/exports.d.ts +48 -0
  145. package/dist/targets/angular/exports.js +243 -0
  146. package/dist/targets/angular/helpers.d.ts +15 -0
  147. package/dist/targets/angular/helpers.js +33 -0
  148. package/dist/targets/angular/host-boundary.d.ts +5 -0
  149. package/dist/targets/angular/host-boundary.js +166 -0
  150. package/dist/targets/angular/host-form.d.ts +150 -0
  151. package/dist/targets/angular/host-form.js +727 -0
  152. package/dist/targets/angular/markup-values.d.ts +58 -0
  153. package/dist/targets/angular/markup-values.js +661 -0
  154. package/dist/targets/angular/motion-directive.d.ts +12 -0
  155. package/dist/targets/angular/motion-directive.js +257 -0
  156. package/dist/targets/angular/motion-hooks.d.ts +73 -0
  157. package/dist/targets/angular/motion-hooks.js +293 -0
  158. package/dist/targets/angular/motion-layout.d.ts +14 -0
  159. package/dist/targets/angular/motion-layout.js +74 -0
  160. package/dist/targets/angular/motion-templates.d.ts +10 -0
  161. package/dist/targets/angular/motion-templates.js +65 -0
  162. package/dist/targets/angular/motion.d.ts +57 -0
  163. package/dist/targets/angular/motion.js +202 -0
  164. package/dist/targets/angular/narrowing.d.ts +24 -0
  165. package/dist/targets/angular/narrowing.js +205 -0
  166. package/dist/targets/angular/ngc.d.ts +23 -0
  167. package/dist/targets/angular/ngc.js +134 -0
  168. package/dist/targets/angular/passed-handle.d.ts +39 -0
  169. package/dist/targets/angular/passed-handle.js +154 -0
  170. package/dist/targets/angular/projected.d.ts +9 -0
  171. package/dist/targets/angular/projected.js +63 -0
  172. package/dist/targets/angular/radix/cores/alert-dialog.d.ts +13 -0
  173. package/dist/targets/angular/radix/cores/alert-dialog.js +388 -0
  174. package/dist/targets/angular/radix/cores/index.d.ts +17 -0
  175. package/dist/targets/angular/radix/cores/index.js +50 -0
  176. package/dist/targets/angular/radix/cores/slider.d.ts +8 -0
  177. package/dist/targets/angular/radix/cores/slider.js +202 -0
  178. package/dist/targets/angular/radix/index.d.ts +21 -0
  179. package/dist/targets/angular/radix/index.js +35 -0
  180. package/dist/targets/angular/radix/packages.d.ts +3 -0
  181. package/dist/targets/angular/radix/packages.js +558 -0
  182. package/dist/targets/angular/radix/part.d.ts +236 -0
  183. package/dist/targets/angular/radix/part.js +71 -0
  184. package/dist/targets/angular/radix/prepare.d.ts +66 -0
  185. package/dist/targets/angular/radix/prepare.js +548 -0
  186. package/dist/targets/angular/radix/template.d.ts +43 -0
  187. package/dist/targets/angular/radix/template.js +172 -0
  188. package/dist/targets/angular/refs.d.ts +68 -0
  189. package/dist/targets/angular/refs.js +443 -0
  190. package/dist/targets/angular/slots.d.ts +22 -0
  191. package/dist/targets/angular/slots.js +60 -0
  192. package/dist/targets/angular/source-types.d.ts +10 -0
  193. package/dist/targets/angular/source-types.js +45 -0
  194. package/dist/targets/angular/spread-forward.d.ts +24 -0
  195. package/dist/targets/angular/spread-forward.js +72 -0
  196. package/dist/targets/angular/spread.d.ts +32 -0
  197. package/dist/targets/angular/spread.js +182 -0
  198. package/dist/targets/angular/svg-hosts.d.ts +25 -0
  199. package/dist/targets/angular/svg-hosts.js +107 -0
  200. package/dist/targets/angular/template-expr.d.ts +36 -0
  201. package/dist/targets/angular/template-expr.js +287 -0
  202. package/dist/targets/angular/types.d.ts +9 -0
  203. package/dist/targets/angular/types.js +63 -0
  204. package/dist/targets/angular/walk.d.ts +11 -0
  205. package/dist/targets/angular/walk.js +26 -0
  206. package/dist/targets/react-native/emit.d.ts +14 -0
  207. package/dist/targets/react-native/emit.js +585 -0
  208. package/dist/targets/react-native/fidelity.d.ts +5 -0
  209. package/dist/targets/react-native/fidelity.js +43 -0
  210. package/dist/targets/react-native/motion.d.ts +10 -0
  211. package/dist/targets/react-native/motion.js +290 -0
  212. package/dist/targets/react-native/skia.d.ts +30 -0
  213. package/dist/targets/react-native/skia.js +358 -0
  214. package/dist/targets/shared/context.d.ts +47 -0
  215. package/dist/targets/shared/context.js +195 -0
  216. package/dist/targets/shared/foreign.d.ts +10 -0
  217. package/dist/targets/shared/foreign.js +72 -0
  218. package/dist/targets/shared/fragments.d.ts +21 -0
  219. package/dist/targets/shared/fragments.js +309 -0
  220. package/dist/targets/shared/handles.d.ts +65 -0
  221. package/dist/targets/shared/handles.js +299 -0
  222. package/dist/targets/shared/inline.d.ts +53 -0
  223. package/dist/targets/shared/inline.js +524 -0
  224. package/dist/targets/shared/layout.d.ts +70 -0
  225. package/dist/targets/shared/layout.js +224 -0
  226. package/dist/targets/shared/markup.d.ts +26 -0
  227. package/dist/targets/shared/markup.js +65 -0
  228. package/dist/targets/shared/module.d.ts +84 -0
  229. package/dist/targets/shared/module.js +468 -0
  230. package/dist/targets/shared/motion-hooks.d.ts +37 -0
  231. package/dist/targets/shared/motion-hooks.js +87 -0
  232. package/dist/targets/shared/motion-layout.d.ts +70 -0
  233. package/dist/targets/shared/motion-layout.js +392 -0
  234. package/dist/targets/shared/portal.d.ts +10 -0
  235. package/dist/targets/shared/portal.js +23 -0
  236. package/dist/targets/shared/prop-writes.d.ts +11 -0
  237. package/dist/targets/shared/prop-writes.js +32 -0
  238. package/dist/targets/shared/prune.d.ts +54 -0
  239. package/dist/targets/shared/prune.js +405 -0
  240. package/dist/targets/shared/react-libs.d.ts +25 -0
  241. package/dist/targets/shared/react-libs.js +142 -0
  242. package/dist/targets/shared/react-types.d.ts +16 -0
  243. package/dist/targets/shared/react-types.js +374 -0
  244. package/dist/targets/shared/react-values.d.ts +20 -0
  245. package/dist/targets/shared/react-values.js +145 -0
  246. package/dist/targets/shared/ref-callback.d.ts +16 -0
  247. package/dist/targets/shared/ref-callback.js +114 -0
  248. package/dist/targets/shared/script.d.ts +65 -0
  249. package/dist/targets/shared/script.js +406 -0
  250. package/dist/targets/shared/unused.d.ts +12 -0
  251. package/dist/targets/shared/unused.js +146 -0
  252. package/dist/targets/svelte/dom-spread.d.ts +27 -0
  253. package/dist/targets/svelte/dom-spread.js +146 -0
  254. package/dist/targets/svelte/emit.d.ts +15 -0
  255. package/dist/targets/svelte/emit.js +3784 -0
  256. package/dist/targets/svelte/handle-branches.d.ts +22 -0
  257. package/dist/targets/svelte/handle-branches.js +146 -0
  258. package/dist/targets/svelte/html-keys.d.ts +9 -0
  259. package/dist/targets/svelte/html-keys.js +40 -0
  260. package/dist/targets/svelte/markup-data/data.d.ts +51 -0
  261. package/dist/targets/svelte/markup-data/data.js +305 -0
  262. package/dist/targets/svelte/markup-data/helper.d.ts +12 -0
  263. package/dist/targets/svelte/markup-data/helper.js +81 -0
  264. package/dist/targets/svelte/markup-data/module-data.d.ts +21 -0
  265. package/dist/targets/svelte/markup-data/module-data.js +473 -0
  266. package/dist/targets/svelte/markup-data/sites.d.ts +52 -0
  267. package/dist/targets/svelte/markup-data/sites.js +303 -0
  268. package/dist/targets/svelte/motion-layout.d.ts +13 -0
  269. package/dist/targets/svelte/motion-layout.js +70 -0
  270. package/dist/targets/svelte/motion-table.d.ts +14 -0
  271. package/dist/targets/svelte/motion-table.js +308 -0
  272. package/dist/targets/svelte/motion.d.ts +46 -0
  273. package/dist/targets/svelte/motion.js +405 -0
  274. package/dist/targets/svelte/presence.d.ts +71 -0
  275. package/dist/targets/svelte/presence.js +318 -0
  276. package/dist/targets/svelte/radix/accordion.d.ts +9 -0
  277. package/dist/targets/svelte/radix/accordion.js +24 -0
  278. package/dist/targets/svelte/radix/aspect-ratio.d.ts +6 -0
  279. package/dist/targets/svelte/radix/aspect-ratio.js +8 -0
  280. package/dist/targets/svelte/radix/avatar.d.ts +6 -0
  281. package/dist/targets/svelte/radix/avatar.js +10 -0
  282. package/dist/targets/svelte/radix/checkbox.d.ts +10 -0
  283. package/dist/targets/svelte/radix/checkbox.js +24 -0
  284. package/dist/targets/svelte/radix/collapsible.d.ts +7 -0
  285. package/dist/targets/svelte/radix/collapsible.js +16 -0
  286. package/dist/targets/svelte/radix/context-menu.d.ts +8 -0
  287. package/dist/targets/svelte/radix/context-menu.js +49 -0
  288. package/dist/targets/svelte/radix/cores/alert-dialog.d.ts +17 -0
  289. package/dist/targets/svelte/radix/cores/alert-dialog.js +449 -0
  290. package/dist/targets/svelte/radix/cores/collapsible.d.ts +12 -0
  291. package/dist/targets/svelte/radix/cores/collapsible.js +214 -0
  292. package/dist/targets/svelte/radix/cores/core.d.ts +32 -0
  293. package/dist/targets/svelte/radix/cores/core.js +80 -0
  294. package/dist/targets/svelte/radix/cores/direction.d.ts +10 -0
  295. package/dist/targets/svelte/radix/cores/direction.js +64 -0
  296. package/dist/targets/svelte/radix/cores/index.d.ts +19 -0
  297. package/dist/targets/svelte/radix/cores/index.js +85 -0
  298. package/dist/targets/svelte/radix/cores/modal-layer.d.ts +11 -0
  299. package/dist/targets/svelte/radix/cores/modal-layer.js +244 -0
  300. package/dist/targets/svelte/radix/cores/presence.d.ts +12 -0
  301. package/dist/targets/svelte/radix/cores/presence.js +129 -0
  302. package/dist/targets/svelte/radix/cores/slider-logic.d.ts +10 -0
  303. package/dist/targets/svelte/radix/cores/slider-logic.js +287 -0
  304. package/dist/targets/svelte/radix/cores/slider.d.ts +13 -0
  305. package/dist/targets/svelte/radix/cores/slider.js +267 -0
  306. package/dist/targets/svelte/radix/dialog.d.ts +8 -0
  307. package/dist/targets/svelte/radix/dialog.js +20 -0
  308. package/dist/targets/svelte/radix/dropdown-menu.d.ts +9 -0
  309. package/dist/targets/svelte/radix/dropdown-menu.js +38 -0
  310. package/dist/targets/svelte/radix/emit.d.ts +12 -0
  311. package/dist/targets/svelte/radix/emit.js +1339 -0
  312. package/dist/targets/svelte/radix/hover-card.d.ts +7 -0
  313. package/dist/targets/svelte/radix/hover-card.js +22 -0
  314. package/dist/targets/svelte/radix/index.d.ts +12 -0
  315. package/dist/targets/svelte/radix/index.js +28 -0
  316. package/dist/targets/svelte/radix/label.d.ts +3 -0
  317. package/dist/targets/svelte/radix/label.js +5 -0
  318. package/dist/targets/svelte/radix/menubar.d.ts +7 -0
  319. package/dist/targets/svelte/radix/menubar.js +34 -0
  320. package/dist/targets/svelte/radix/navigation-menu.d.ts +8 -0
  321. package/dist/targets/svelte/radix/navigation-menu.js +25 -0
  322. package/dist/targets/svelte/radix/packages.d.ts +34 -0
  323. package/dist/targets/svelte/radix/packages.js +100 -0
  324. package/dist/targets/svelte/radix/part.d.ts +161 -0
  325. package/dist/targets/svelte/radix/part.js +85 -0
  326. package/dist/targets/svelte/radix/popover.d.ts +7 -0
  327. package/dist/targets/svelte/radix/popover.js +15 -0
  328. package/dist/targets/svelte/radix/progress.d.ts +11 -0
  329. package/dist/targets/svelte/radix/progress.js +27 -0
  330. package/dist/targets/svelte/radix/radio-group.d.ts +9 -0
  331. package/dist/targets/svelte/radix/radio-group.js +26 -0
  332. package/dist/targets/svelte/radix/scroll-area.d.ts +7 -0
  333. package/dist/targets/svelte/radix/scroll-area.js +19 -0
  334. package/dist/targets/svelte/radix/select.d.ts +13 -0
  335. package/dist/targets/svelte/radix/select.js +81 -0
  336. package/dist/targets/svelte/radix/separator.d.ts +3 -0
  337. package/dist/targets/svelte/radix/separator.js +5 -0
  338. package/dist/targets/svelte/radix/slider.d.ts +6 -0
  339. package/dist/targets/svelte/radix/slider.js +8 -0
  340. package/dist/targets/svelte/radix/switch.d.ts +6 -0
  341. package/dist/targets/svelte/radix/switch.js +10 -0
  342. package/dist/targets/svelte/radix/tabs.d.ts +8 -0
  343. package/dist/targets/svelte/radix/tabs.js +15 -0
  344. package/dist/targets/svelte/radix/toggle-group.d.ts +9 -0
  345. package/dist/targets/svelte/radix/toggle-group.js +17 -0
  346. package/dist/targets/svelte/radix/toggle.d.ts +6 -0
  347. package/dist/targets/svelte/radix/toggle.js +9 -0
  348. package/dist/targets/svelte/radix/tooltip.d.ts +6 -0
  349. package/dist/targets/svelte/radix/tooltip.js +24 -0
  350. package/dist/targets/svelte/strip.d.ts +2 -0
  351. package/dist/targets/svelte/strip.js +5 -0
  352. package/dist/targets/vue/emit.d.ts +15 -0
  353. package/dist/targets/vue/emit.js +4092 -0
  354. package/dist/targets/vue/events.d.ts +11 -0
  355. package/dist/targets/vue/events.js +13 -0
  356. package/dist/targets/vue/module-builders.d.ts +28 -0
  357. package/dist/targets/vue/module-builders.js +258 -0
  358. package/dist/targets/vue/motion-layout.d.ts +19 -0
  359. package/dist/targets/vue/motion-layout.js +79 -0
  360. package/dist/targets/vue/motion.d.ts +12 -0
  361. package/dist/targets/vue/motion.js +46 -0
  362. package/dist/targets/vue/radix/accordion.d.ts +3 -0
  363. package/dist/targets/vue/radix/accordion.js +12 -0
  364. package/dist/targets/vue/radix/alert-dialog.d.ts +6 -0
  365. package/dist/targets/vue/radix/alert-dialog.js +18 -0
  366. package/dist/targets/vue/radix/aspect-ratio.d.ts +6 -0
  367. package/dist/targets/vue/radix/aspect-ratio.js +8 -0
  368. package/dist/targets/vue/radix/avatar.d.ts +3 -0
  369. package/dist/targets/vue/radix/avatar.js +7 -0
  370. package/dist/targets/vue/radix/checkbox.d.ts +3 -0
  371. package/dist/targets/vue/radix/checkbox.js +9 -0
  372. package/dist/targets/vue/radix/collapsible.d.ts +7 -0
  373. package/dist/targets/vue/radix/collapsible.js +11 -0
  374. package/dist/targets/vue/radix/context-menu.d.ts +3 -0
  375. package/dist/targets/vue/radix/context-menu.js +30 -0
  376. package/dist/targets/vue/radix/dialog.d.ts +3 -0
  377. package/dist/targets/vue/radix/dialog.js +12 -0
  378. package/dist/targets/vue/radix/direction.d.ts +7 -0
  379. package/dist/targets/vue/radix/direction.js +9 -0
  380. package/dist/targets/vue/radix/dropdown-menu.d.ts +3 -0
  381. package/dist/targets/vue/radix/dropdown-menu.js +29 -0
  382. package/dist/targets/vue/radix/hover-card.d.ts +3 -0
  383. package/dist/targets/vue/radix/hover-card.js +11 -0
  384. package/dist/targets/vue/radix/index.d.ts +65 -0
  385. package/dist/targets/vue/radix/index.js +225 -0
  386. package/dist/targets/vue/radix/label.d.ts +3 -0
  387. package/dist/targets/vue/radix/label.js +5 -0
  388. package/dist/targets/vue/radix/menubar.d.ts +6 -0
  389. package/dist/targets/vue/radix/menubar.js +29 -0
  390. package/dist/targets/vue/radix/navigation-menu.d.ts +6 -0
  391. package/dist/targets/vue/radix/navigation-menu.js +21 -0
  392. package/dist/targets/vue/radix/part.d.ts +41 -0
  393. package/dist/targets/vue/radix/part.js +46 -0
  394. package/dist/targets/vue/radix/popover.d.ts +3 -0
  395. package/dist/targets/vue/radix/popover.js +11 -0
  396. package/dist/targets/vue/radix/progress.d.ts +3 -0
  397. package/dist/targets/vue/radix/progress.js +6 -0
  398. package/dist/targets/vue/radix/radio-group.d.ts +3 -0
  399. package/dist/targets/vue/radix/radio-group.js +10 -0
  400. package/dist/targets/vue/radix/scroll-area.d.ts +3 -0
  401. package/dist/targets/vue/radix/scroll-area.js +11 -0
  402. package/dist/targets/vue/radix/select.d.ts +3 -0
  403. package/dist/targets/vue/radix/select.js +29 -0
  404. package/dist/targets/vue/radix/separator.d.ts +3 -0
  405. package/dist/targets/vue/radix/separator.js +5 -0
  406. package/dist/targets/vue/radix/slider.d.ts +3 -0
  407. package/dist/targets/vue/radix/slider.js +13 -0
  408. package/dist/targets/vue/radix/switch.d.ts +3 -0
  409. package/dist/targets/vue/radix/switch.js +9 -0
  410. package/dist/targets/vue/radix/tabs.d.ts +3 -0
  411. package/dist/targets/vue/radix/tabs.js +12 -0
  412. package/dist/targets/vue/radix/toggle-group.d.ts +3 -0
  413. package/dist/targets/vue/radix/toggle-group.js +10 -0
  414. package/dist/targets/vue/radix/toggle.d.ts +3 -0
  415. package/dist/targets/vue/radix/toggle.js +8 -0
  416. package/dist/targets/vue/radix/tooltip.d.ts +3 -0
  417. package/dist/targets/vue/radix/tooltip.js +14 -0
  418. package/dist/targets/vue/render-fn/h.d.ts +52 -0
  419. package/dist/targets/vue/render-fn/h.js +442 -0
  420. package/dist/targets/vue/render-fn.d.ts +21 -0
  421. package/dist/targets/vue/render-fn.js +357 -0
  422. package/dist/targets/vue/slot.d.ts +9 -0
  423. package/dist/targets/vue/slot.js +57 -0
  424. package/dist/typecheck/host.d.ts +45 -0
  425. package/dist/typecheck/host.js +309 -0
  426. package/dist/typecheck/index.d.ts +16 -0
  427. package/dist/typecheck/index.js +17 -0
  428. package/dist/typecheck/lucide.d.ts +8 -0
  429. package/dist/typecheck/lucide.js +45 -0
  430. package/dist/typecheck/sourcemap.d.ts +9 -0
  431. package/dist/typecheck/sourcemap.js +54 -0
  432. package/dist/typecheck/svelte.d.ts +9 -0
  433. package/dist/typecheck/svelte.js +116 -0
  434. package/dist/typecheck/vue.d.ts +8 -0
  435. package/dist/typecheck/vue.js +78 -0
  436. package/dist/types.d.ts +446 -0
  437. package/dist/types.js +11 -0
  438. package/dist/utils/cleanup.d.ts +32 -0
  439. package/dist/utils/cleanup.js +119 -0
  440. package/dist/utils/errors.d.ts +7 -0
  441. package/dist/utils/errors.js +15 -0
  442. package/dist/utils/fs-safe.d.ts +14 -0
  443. package/dist/utils/fs-safe.js +64 -0
  444. package/dist/validate.d.ts +16 -0
  445. package/dist/validate.js +204 -0
  446. package/dist/verify/auto-steps.d.ts +107 -0
  447. package/dist/verify/auto-steps.js +471 -0
  448. package/dist/verify/bundle.d.ts +68 -0
  449. package/dist/verify/bundle.js +548 -0
  450. package/dist/verify/diff.d.ts +31 -0
  451. package/dist/verify/diff.js +133 -0
  452. package/dist/verify/leaks.d.ts +25 -0
  453. package/dist/verify/leaks.js +261 -0
  454. package/dist/verify/link-worker.d.ts +1 -0
  455. package/dist/verify/link-worker.js +27 -0
  456. package/dist/verify/runner.d.ts +57 -0
  457. package/dist/verify/runner.js +867 -0
  458. package/dist/verify/sandbox.d.ts +40 -0
  459. package/dist/verify/sandbox.js +496 -0
  460. package/dist/verify/steps.d.ts +42 -0
  461. package/dist/verify/steps.js +475 -0
  462. package/dist/verify/verdict.d.ts +15 -0
  463. package/dist/verify/verdict.js +19 -0
  464. package/package.json +118 -4
@@ -0,0 +1,7 @@
1
+ import { type BitsPartMap } from './part.js';
2
+ /**
3
+ * Radix HoverCard → bits-ui LinkPreview, bits-ui's hover card (both open after 700 ms and close after 300 ms by
4
+ * default; both triggers render an `<a>`). The content takes Radix's escape and outside-press callbacks under bits-ui's
5
+ * names; Radix's `--radix-hover-card-*` custom properties are bits-ui's `--bits-floating-*` (see index: cssVariable).
6
+ */
7
+ export declare const hoverCard: Readonly<Record<string, BitsPartMap>>;
@@ -0,0 +1,22 @@
1
+ import { bitsPart, POPPER_PROPS, portal, state } from './part.js';
2
+ const open = state('open');
3
+ /** bits-ui's LinkPreview content takes Radix's Popper placement props but not updatePositionStrategy */
4
+ const PLACEMENT = Object.fromEntries(Object.entries(POPPER_PROPS).filter(([key]) => key !== 'updatePositionStrategy'));
5
+ /**
6
+ * Radix HoverCard → bits-ui LinkPreview, bits-ui's hover card (both open after 700 ms and close after 300 ms by
7
+ * default; both triggers render an `<a>`). The content takes Radix's escape and outside-press callbacks under bits-ui's
8
+ * names; Radix's `--radix-hover-card-*` custom properties are bits-ui's `--bits-floating-*` (see index: cssVariable).
9
+ */
10
+ export const hoverCard = {
11
+ Root: bitsPart('LinkPreview.Root', { element: false, props: { ...open.props, openDelay: 'openDelay', closeDelay: 'closeDelay' }, events: open.events }),
12
+ Trigger: bitsPart('LinkPreview.Trigger', {
13
+ differs: 'bits-ui gives the trigger role="button" with aria-haspopup and aria-expanded, so assistive technology announces the link as a button, where Radix leaves it a link',
14
+ }),
15
+ Portal: portal('LinkPreview'),
16
+ Content: bitsPart('LinkPreview.Content', {
17
+ props: { forceMount: 'forceMount', ...PLACEMENT },
18
+ events: { onEscapeKeyDown: 'onEscapeKeydown', onPointerDownOutside: 'onInteractOutside', onFocusOutside: 'onFocusOutside' },
19
+ }),
20
+ // Radix's own svg inside bits-ui's positioned span, as for Tooltip and Popover
21
+ Arrow: { ...bitsPart('LinkPreview.Arrow'), radixArrow: true },
22
+ };
@@ -0,0 +1,12 @@
1
+ import type { RadixTarget } from '../../../ir/radix.js';
2
+ export type { BitsPartMap, SynthPart } from './part.js';
3
+ export { BITS_GATED, BITS_PACKAGES, BITS_REFUSED, SVELTE_PACKAGES, bitsPartName, bitsPartOf } from './packages.js';
4
+ export { SVELTE_CORES, SVELTE_CORES_FILE, svelteCoreFiles } from './cores/index.js';
5
+ export { passesBitsChild, prepareSvelteRadix } from './emit.js';
6
+ /**
7
+ * Radix's CSS custom properties by bits-ui's names for them: each mapped part's (BitsPartMap.cssVars), and every
8
+ * floating content's, which bits-ui sets under one set of names (`--bits-floating-*`).
9
+ */
10
+ export declare const CSS_VARIABLES: ReadonlyMap<string, string>;
11
+ /** Svelte's map of Radix (ir/radix): bits-ui, the Svelte 5 headless library Radix's parts have counterparts in. */
12
+ export declare const svelteRadix: RadixTarget;
@@ -0,0 +1,28 @@
1
+ import { BITS_GATED, BITS_PACKAGES, SVELTE_PACKAGES, bitsPartOf } from './packages.js';
2
+ import { SVELTE_CORES } from './cores/index.js';
3
+ import { popperVars } from './part.js';
4
+ export { BITS_GATED, BITS_PACKAGES, BITS_REFUSED, SVELTE_PACKAGES, bitsPartName, bitsPartOf } from './packages.js';
5
+ export { SVELTE_CORES, SVELTE_CORES_FILE, svelteCoreFiles } from './cores/index.js';
6
+ export { passesBitsChild, prepareSvelteRadix } from './emit.js';
7
+ /**
8
+ * Radix's CSS custom properties by bits-ui's names for them: each mapped part's (BitsPartMap.cssVars), and every
9
+ * floating content's, which bits-ui sets under one set of names (`--bits-floating-*`).
10
+ */
11
+ export const CSS_VARIABLES = new Map([
12
+ ...Object.entries(BITS_PACKAGES)
13
+ .filter(([pkg]) => !Object.hasOwn(SVELTE_CORES, pkg))
14
+ .flatMap(([, p]) => Object.values(p.parts).flatMap((part) => Object.entries(part.cssVars ?? {}))),
15
+ // (M3: a core sets Radix's own variables under Radix's names)
16
+ ...Object.values(SVELTE_CORES).flatMap((c) => (c.core.cssVariables ?? []).map((name) => [name, name])),
17
+ ...['popover', 'tooltip', 'dropdown-menu', 'hover-card', 'context-menu', 'menubar'].flatMap((radix) => Object.entries(popperVars(radix))),
18
+ ]);
19
+ /** Svelte's map of Radix (ir/radix): bits-ui, the Svelte 5 headless library Radix's parts have counterparts in. */
20
+ export const svelteRadix = {
21
+ label: 'Svelte',
22
+ library: 'bits-ui',
23
+ // a refused package has no map and a gated one is left out, so neither is claimed: claimRadix reports it, and
24
+ // prepareSvelteRadix says why (BITS_REFUSED, BITS_GATED)
25
+ packages: new Set(Object.keys(SVELTE_PACKAGES).filter((pkg) => !Object.hasOwn(BITS_GATED, pkg))),
26
+ mapRadixPart: bitsPartOf,
27
+ cssVariable: (name) => CSS_VARIABLES.get(name),
28
+ };
@@ -0,0 +1,3 @@
1
+ import { type BitsPartMap } from './part.js';
2
+ /** Radix Label → bits-ui Label (a `label` element in both). */
3
+ export declare const label: Readonly<Record<string, BitsPartMap>>;
@@ -0,0 +1,5 @@
1
+ import { bitsPart } from './part.js';
2
+ /** Radix Label → bits-ui Label (a `label` element in both). */
3
+ export const label = {
4
+ Root: bitsPart('Label.Root'),
5
+ };
@@ -0,0 +1,7 @@
1
+ import { type BitsPartMap } from './part.js';
2
+ /**
3
+ * Radix Menubar → bits-ui Menubar (bits-ui's Menu parts, as DropdownMenu's). The open menu's value is bits-ui's
4
+ * `value`. Label is Radix's plain div (bits-ui's GroupHeading must sit in a Group). ItemIndicator is Radix's span,
5
+ * written inside its item's `children` snippet (see part: menuItemIndicator).
6
+ */
7
+ export declare const menubar: Readonly<Record<string, BitsPartMap>>;
@@ -0,0 +1,34 @@
1
+ import { bitsPart, LAYER_EVENTS, menuItemIndicator, POPPER_PROPS, portal, state } from './part.js';
2
+ const value = state('value');
3
+ const open = state('open');
4
+ const checked = state('checked');
5
+ const without = (map, ...names) => Object.fromEntries(Object.entries(map).filter(([k]) => !names.includes(k)));
6
+ /** a menu content has no open auto-focus callback in Radix */
7
+ const MENU_EVENTS = without(LAYER_EVENTS, 'onOpenAutoFocus');
8
+ /** a sub-content has no focus callback and no `side` (it opens beside its trigger) */
9
+ const SUB_EVENTS = without(MENU_EVENTS, 'onCloseAutoFocus');
10
+ const SUB_POPPER = without(POPPER_PROPS, 'side');
11
+ /**
12
+ * Radix Menubar → bits-ui Menubar (bits-ui's Menu parts, as DropdownMenu's). The open menu's value is bits-ui's
13
+ * `value`. Label is Radix's plain div (bits-ui's GroupHeading must sit in a Group). ItemIndicator is Radix's span,
14
+ * written inside its item's `children` snippet (see part: menuItemIndicator).
15
+ */
16
+ export const menubar = {
17
+ Root: { ...bitsPart('Menubar.Root', { props: { ...value.props, loop: 'loop', dir: 'dir' }, events: value.events }), fallbacks: { value: '' } },
18
+ Menu: bitsPart('Menubar.Menu', { element: false, props: { value: 'value' } }),
19
+ Trigger: bitsPart('Menubar.Trigger', { props: { disabled: 'disabled' } }),
20
+ Portal: portal('Menubar'),
21
+ Content: bitsPart('Menubar.Content', { props: { forceMount: 'forceMount', loop: 'loop', ...POPPER_PROPS }, events: MENU_EVENTS }),
22
+ Group: bitsPart('Menubar.Group'),
23
+ Label: { ...bitsPart('Menubar.Group'), plain: 'div' },
24
+ Item: bitsPart('Menubar.Item', { props: { disabled: 'disabled', textValue: 'textValue' }, events: { onSelect: 'onSelect' } }),
25
+ CheckboxItem: bitsPart('Menubar.CheckboxItem', { props: { ...checked.props, disabled: 'disabled', textValue: 'textValue' }, events: { ...checked.events, onSelect: 'onSelect' }, indeterminate: 'indeterminate' }),
26
+ RadioGroup: { ...bitsPart('Menubar.RadioGroup', { props: { value: 'value' }, events: { onValueChange: 'onValueChange' } }), fallbacks: { value: '' } },
27
+ RadioItem: bitsPart('Menubar.RadioItem', { props: { value: 'value', disabled: 'disabled', textValue: 'textValue' }, events: { onSelect: 'onSelect' } }),
28
+ ItemIndicator: menuItemIndicator('Menubar'),
29
+ Separator: bitsPart('Menubar.Separator'),
30
+ Arrow: bitsPart('Menubar.Arrow'),
31
+ Sub: bitsPart('Menubar.Sub', { element: false, props: open.props, events: open.events }),
32
+ SubTrigger: bitsPart('Menubar.SubTrigger', { props: { disabled: 'disabled', textValue: 'textValue' } }),
33
+ SubContent: bitsPart('Menubar.SubContent', { props: { forceMount: 'forceMount', loop: 'loop', ...SUB_POPPER }, events: SUB_EVENTS }),
34
+ };
@@ -0,0 +1,8 @@
1
+ import { type BitsPartMap } from './part.js';
2
+ /**
3
+ * Radix NavigationMenu → bits-ui NavigationMenu. The content takes Radix's escape and outside-press callbacks under
4
+ * bits-ui's names (bits-ui's `onInteractOutside` is the pointer press outside, Radix's `onPointerDownOutside`). bits-ui
5
+ * sets the viewport's size as `--bits-navigation-menu-viewport-width` / `-height`; the Viewport is given Radix's names
6
+ * as aliases, which shadcn's viewport classes read.
7
+ */
8
+ export declare const navigationMenu: Readonly<Record<string, BitsPartMap>>;
@@ -0,0 +1,25 @@
1
+ import { bitsPart, state } from './part.js';
2
+ const value = state('value');
3
+ /**
4
+ * Radix NavigationMenu → bits-ui NavigationMenu. The content takes Radix's escape and outside-press callbacks under
5
+ * bits-ui's names (bits-ui's `onInteractOutside` is the pointer press outside, Radix's `onPointerDownOutside`). bits-ui
6
+ * sets the viewport's size as `--bits-navigation-menu-viewport-width` / `-height`; the Viewport is given Radix's names
7
+ * as aliases, which shadcn's viewport classes read.
8
+ */
9
+ export const navigationMenu = {
10
+ Root: { ...bitsPart('NavigationMenu.Root', { props: { ...value.props, dir: 'dir', orientation: 'orientation', delayDuration: 'delayDuration', skipDelayDuration: 'skipDelayDuration' }, events: value.events }), fallbacks: { value: '' } },
11
+ Sub: { ...bitsPart('NavigationMenu.Sub', { props: { ...value.props, orientation: 'orientation' }, events: value.events }), fallbacks: { value: '' } },
12
+ List: bitsPart('NavigationMenu.List'),
13
+ Item: bitsPart('NavigationMenu.Item', { props: { value: 'value' } }),
14
+ Trigger: bitsPart('NavigationMenu.Trigger', { props: { disabled: 'disabled' } }),
15
+ Link: bitsPart('NavigationMenu.Link', { props: { active: 'active' }, events: { onSelect: 'onSelect' } }),
16
+ Indicator: bitsPart('NavigationMenu.Indicator', { props: { forceMount: 'forceMount' } }),
17
+ Content: bitsPart('NavigationMenu.Content', {
18
+ props: { forceMount: 'forceMount' },
19
+ events: { onEscapeKeyDown: 'onEscapeKeydown', onPointerDownOutside: 'onInteractOutside', onFocusOutside: 'onFocusOutside' },
20
+ }),
21
+ Viewport: bitsPart('NavigationMenu.Viewport', {
22
+ props: { forceMount: 'forceMount' },
23
+ cssVars: { '--radix-navigation-menu-viewport-width': '--bits-navigation-menu-viewport-width', '--radix-navigation-menu-viewport-height': '--bits-navigation-menu-viewport-height' },
24
+ }),
25
+ };
@@ -0,0 +1,34 @@
1
+ import type { BitsPartMap } from './part.js';
2
+ /** Each Radix package morph maps for Svelte: its bits-ui namespace and its parts, by Radix part name. */
3
+ export declare const BITS_PACKAGES: Readonly<Record<string, {
4
+ ns: string;
5
+ parts: Readonly<Record<string, BitsPartMap>>;
6
+ }>>;
7
+ /**
8
+ * M3: every Radix package Svelte converts, by the parts that convert it: morph's own headless cores (./cores), which
9
+ * take the place of bits-ui's map where both exist (collapsible: bits-ui keeps a closed content's children in the page),
10
+ * then bits-ui's maps.
11
+ */
12
+ export declare const SVELTE_PACKAGES: Readonly<Record<string, {
13
+ ns: string;
14
+ parts: Readonly<Record<string, BitsPartMap>>;
15
+ }>>;
16
+ /**
17
+ * Mapped packages whose browser proof (tests/visual/radix.test.ts) has not passed on Svelte: their maps stay in
18
+ * BITS_PACKAGES (checked against the type declarations), but they are not claimed, so each is refused, with what was
19
+ * measured, until its proof passes.
20
+ */
21
+ export declare const BITS_GATED: Readonly<Record<string, string>>;
22
+ /**
23
+ * Radix packages bits-ui has parts for whose behaviour differs where it shows, and no prop of bits-ui's makes up for:
24
+ * not converted, each with why (said where the package is used). They have no map in BITS_PACKAGES: claimRadix refuses
25
+ * each of their elements as an unmapped package.
26
+ */
27
+ export declare const BITS_REFUSED: Readonly<Record<string, string>>;
28
+ /**
29
+ * A Radix part's name as the package exports it: `Content`, or its long alias (`DialogContent`), or the package's own
30
+ * name for its Root (`Dialog`, `Separator`).
31
+ */
32
+ export declare function bitsPartName(pkg: string, part: string): string | null;
33
+ /** bits-ui's part for a Radix part (undefined: none). */
34
+ export declare function bitsPartOf(pkg: string, part: string): BitsPartMap | undefined;
@@ -0,0 +1,100 @@
1
+ import { accordion } from './accordion.js';
2
+ import { checkbox } from './checkbox.js';
3
+ import { dialog } from './dialog.js';
4
+ import { avatar } from './avatar.js';
5
+ import { dropdownMenu } from './dropdown-menu.js';
6
+ import { label } from './label.js';
7
+ import { popover } from './popover.js';
8
+ import { progress } from './progress.js';
9
+ import { separator } from './separator.js';
10
+ import { tooltip } from './tooltip.js';
11
+ import { switchParts } from './switch.js';
12
+ import { tabs } from './tabs.js';
13
+ import { aspectRatio } from './aspect-ratio.js';
14
+ import { collapsible } from './collapsible.js';
15
+ import { radioGroup } from './radio-group.js';
16
+ import { toggle } from './toggle.js';
17
+ import { toggleGroup } from './toggle-group.js';
18
+ import { hoverCard } from './hover-card.js';
19
+ import { scrollArea } from './scroll-area.js';
20
+ import { contextMenu } from './context-menu.js';
21
+ import { menubar } from './menubar.js';
22
+ import { navigationMenu } from './navigation-menu.js';
23
+ import { SVELTE_CORES } from './cores/index.js';
24
+ /** Each Radix package morph maps for Svelte: its bits-ui namespace and its parts, by Radix part name. */
25
+ export const BITS_PACKAGES = {
26
+ dialog: { ns: 'Dialog', parts: dialog },
27
+ popover: { ns: 'Popover', parts: popover },
28
+ 'dropdown-menu': { ns: 'DropdownMenu', parts: dropdownMenu },
29
+ tabs: { ns: 'Tabs', parts: tabs },
30
+ accordion: { ns: 'Accordion', parts: accordion },
31
+ switch: { ns: 'Switch', parts: switchParts },
32
+ checkbox: { ns: 'Checkbox', parts: checkbox },
33
+ tooltip: { ns: 'Tooltip', parts: tooltip },
34
+ progress: { ns: 'Progress', parts: progress },
35
+ avatar: { ns: 'Avatar', parts: avatar },
36
+ separator: { ns: 'Separator', parts: separator },
37
+ label: { ns: 'Label', parts: label },
38
+ 'aspect-ratio': { ns: 'AspectRatio', parts: aspectRatio },
39
+ toggle: { ns: 'Toggle', parts: toggle },
40
+ collapsible: { ns: 'Collapsible', parts: collapsible },
41
+ 'radio-group': { ns: 'RadioGroup', parts: radioGroup },
42
+ 'toggle-group': { ns: 'ToggleGroup', parts: toggleGroup },
43
+ // bits-ui's hover card is its LinkPreview
44
+ 'hover-card': { ns: 'LinkPreview', parts: hoverCard },
45
+ 'scroll-area': { ns: 'ScrollArea', parts: scrollArea },
46
+ 'context-menu': { ns: 'ContextMenu', parts: contextMenu },
47
+ menubar: { ns: 'Menubar', parts: menubar },
48
+ 'navigation-menu': { ns: 'NavigationMenu', parts: navigationMenu },
49
+ };
50
+ /**
51
+ * M3: every Radix package Svelte converts, by the parts that convert it: morph's own headless cores (./cores), which
52
+ * take the place of bits-ui's map where both exist (collapsible: bits-ui keeps a closed content's children in the page),
53
+ * then bits-ui's maps.
54
+ */
55
+ export const SVELTE_PACKAGES = {
56
+ ...BITS_PACKAGES,
57
+ ...Object.fromEntries(Object.entries(SVELTE_CORES).map(([pkg, c]) => [pkg, { ns: c.core.ns, parts: c.parts }])),
58
+ };
59
+ /**
60
+ * Mapped packages whose browser proof (tests/visual/radix.test.ts) has not passed on Svelte: their maps stay in
61
+ * BITS_PACKAGES (checked against the type declarations), but they are not claimed, so each is refused, with what was
62
+ * measured, until its proof passes.
63
+ */
64
+ export const BITS_GATED = {
65
+ 'hover-card': "mapped, browser proof not passed: the open card matched React at 50.55% after a hover and 59.64% after a focus (re-measured 3 December, afternoon: every glyph of bits-ui's open LinkPreview content differs while the page around it matches, with no whole-pixel shift between the two cards, so the text is rasterised differently (cause not found), and bits-ui's trigger is a button with aria-expanded where Radix's is a plain link)",
66
+ menubar: 'mapped, browser proof not passed: an open menu differs from the first click (76.01%), and after ArrowRight bits-ui focuses the first item of the next menu where Radix focuses the menu itself (93.50%), with focus left on another trigger after picks (44.18% to 69.82% on the later steps)',
67
+ 'navigation-menu': "mapped, browser proof not passed: a click on the open trigger the pointer is over closes the menu in Radix, while bits-ui keeps it open, as reka-ui does (0.00% on that step; Enter, Escape, Tab, hover, leave and the first click matched at 100%), and bits-ui has no prop that changes this",
68
+ };
69
+ /**
70
+ * Radix packages bits-ui has parts for whose behaviour differs where it shows, and no prop of bits-ui's makes up for:
71
+ * not converted, each with why (said where the package is used). They have no map in BITS_PACKAGES: claimRadix refuses
72
+ * each of their elements as an unmapped package.
73
+ */
74
+ export const BITS_REFUSED = {
75
+ select: "Radix's Select moves focus into the open list, onto the item the arrow keys reach, so the trigger loses its focus ring and the item's focus styles (shadcn's focus:bg-accent) show; bits-ui's Select keeps focus on the trigger and points at the item with aria-activedescendant, so in Svelte the trigger keeps its keyboard focus ring and the highlighted item shows no focus style, and bits-ui has no prop that moves focus into the list",
76
+ };
77
+ /**
78
+ * A Radix part's name as the package exports it: `Content`, or its long alias (`DialogContent`), or the package's own
79
+ * name for its Root (`Dialog`, `Separator`).
80
+ */
81
+ export function bitsPartName(pkg, part) {
82
+ const entry = SVELTE_PACKAGES[pkg];
83
+ if (!entry)
84
+ return null;
85
+ if (part in entry.parts)
86
+ return part;
87
+ if (part === entry.ns)
88
+ return 'Root' in entry.parts ? 'Root' : null;
89
+ if (part.startsWith(entry.ns)) {
90
+ const rest = part.slice(entry.ns.length);
91
+ if (rest in entry.parts)
92
+ return rest;
93
+ }
94
+ return null;
95
+ }
96
+ /** bits-ui's part for a Radix part (undefined: none). */
97
+ export function bitsPartOf(pkg, part) {
98
+ const name = bitsPartName(pkg, part);
99
+ return name ? SVELTE_PACKAGES[pkg]?.parts[name] : undefined;
100
+ }
@@ -0,0 +1,161 @@
1
+ import type { RadixDrop, RadixPartMap } from '../../../ir/radix.js';
2
+ /**
3
+ * A bits-ui part. `name` is the namespace and its member as Svelte markup writes it (`Dialog.Root`): bits-ui exports one
4
+ * namespace per component (`import { Dialog } from 'bits-ui'`). Every part that renders an element takes the `child`
5
+ * snippet (bits-ui's form of Radix's `asChild`), and `ref` as a bindable prop; a part without an element takes neither.
6
+ */
7
+ export interface BitsPartMap extends RadixPartMap {
8
+ /**
9
+ * Radix renders this part, bits-ui has no component for it but gives what it shows to its parent's `children` snippet
10
+ * (`Checkbox.Indicator`: the Root's `{ checked, indeterminate }`): the emitter writes the element Radix renders, inside
11
+ * that snippet (see ./synth).
12
+ */
13
+ synth?: SynthPart;
14
+ /**
15
+ * As `synth`, for a part that may sit in more than one parent, each giving its own snippet values
16
+ * (DropdownMenu.ItemIndicator: a CheckboxItem's `{ checked, indeterminate }`, a RadioItem's `{ checked }`), by the
17
+ * parent's Radix part name.
18
+ */
19
+ synthIn?: Record<string, SynthPart>;
20
+ /**
21
+ * CSS custom properties Radix sets that bits-ui sets under its own name (`--radix-accordion-content-height` →
22
+ * `--bits-accordion-content-height`): the part is given each Radix name as an alias of bits-ui's, so a class that
23
+ * reads the Radix name (shadcn's animations) reads the same value.
24
+ */
25
+ cssVars?: Record<string, string>;
26
+ /**
27
+ * `data-*` attributes that differ on this part: one of Radix and bits-ui sets it and the other does not, or they set
28
+ * other values. A class name of the part that reads one (`data-[state=open]:bg-accent`) is said in a diagnostic.
29
+ */
30
+ dataDiffers?: string[];
31
+ /**
32
+ * Radix's value of this part may be 'indeterminate' (`checked: boolean | 'indeterminate'`); bits-ui takes that as a
33
+ * boolean prop of this name beside the value.
34
+ */
35
+ indeterminate?: string;
36
+ /**
37
+ * The value's type follows another prop (Accordion's `value` is a string for `type="single"`, a list for "multiple"):
38
+ * a component that spreads its rest props onto the part cannot hold the state for its callers, who then give bits-ui
39
+ * the value themselves (see the emitter's callers).
40
+ */
41
+ discriminated?: boolean;
42
+ /** what bits-ui's part does differently from Radix's that the map cannot make up for: said as a warning where the part is used */
43
+ differs?: string;
44
+ /**
45
+ * Radix renders this part as a plain element with the props it is given and nothing else (DropdownMenu.Label:
46
+ * `<Primitive.div {...props}>`), and bits-ui has no part of that shape: the emitter writes that element.
47
+ */
48
+ plain?: string;
49
+ /**
50
+ * bits-ui's fallback of a bindable state prop other than `false` (Tabs' `value = $bindable("")`): a state the emitter
51
+ * keeps for a wrapper starts there when no default is given, as binding `undefined` to a prop with a fallback throws.
52
+ */
53
+ fallbacks?: Record<string, string>;
54
+ /**
55
+ * Radix's Popper arrow: Radix renders its own svg (10 by 5, `display: block`) inside a positioned span and gives the
56
+ * part's props to the svg; bits-ui's Arrow gives them to its span. The emitter writes Radix's svg, with the props, as
57
+ * bits-ui's children, so a class that rotates or sizes the arrow (shadcn's) applies to the same element as in Radix.
58
+ */
59
+ radixArrow?: boolean;
60
+ /**
61
+ * Radix's default of a prop where bits-ui's differs (Progress.Root's `value`: Radix `null`, indeterminate; bits-ui
62
+ * `0`), as an expression: the part is given the prop as the source resolves it (see emit: propValue), the default
63
+ * when that is undefined, as Radix's own destructuring default does.
64
+ */
65
+ defaults?: Record<string, string>;
66
+ /**
67
+ * What bits-ui's part does differently where a prop of these names may carry a value (Progress.Root, given a value):
68
+ * said as a radix-data warning only then, as nothing differs while the prop keeps Radix's default.
69
+ */
70
+ differsWith?: {
71
+ props: string[];
72
+ why: string;
73
+ };
74
+ /**
75
+ * Radix's element for this part takes no focus (no tabindex), where bits-ui's has `tabindex="-1"`, which a click
76
+ * focuses and a closing layer then returns focus to (ContextMenu.Trigger): the part is given the tabindex the source
77
+ * gives it, else `null`, which bits-ui's props take over its own -1, so no tabindex is rendered, as in Radix.
78
+ */
79
+ noFocus?: boolean;
80
+ /**
81
+ * Inline style Radix puts on this part under the style it is given (`{ outline: 'none', ...props.style }` on a menu's
82
+ * content), which bits-ui does not set: written first, so a style the source gives is joined after it (a static one)
83
+ * or, through a spread, replaces it (said as a warning).
84
+ */
85
+ radixStyle?: string;
86
+ /**
87
+ * M3: the part is morph's own (radix cores, see ./cores), not bits-ui's: it takes Radix's props and callbacks under
88
+ * their own names, so no state is bound and nothing renamed, and the namespace is imported from the cores' barrel.
89
+ */
90
+ core?: true;
91
+ }
92
+ /** A Radix part bits-ui renders through its parent's `children` snippet (see BitsPartMap.synth). */
93
+ export interface SynthPart {
94
+ /** the element Radix renders */
95
+ tag: string;
96
+ /** the parent part that gives the snippet, by its Radix part name (`Root`) */
97
+ parent: string;
98
+ /** the snippet's parameters bits-ui gives (`checked`, `indeterminate`), checked against its declarations */
99
+ params: string[];
100
+ /**
101
+ * bits-ui's parent gives no snippet values (Progress.Root): each parameter is instead the parent's prop of that name
102
+ * as the source gives it, or Radix's default (this map's value) when it is undefined.
103
+ */
104
+ fromProps?: Record<string, string>;
105
+ /** while what holds the part renders (Radix's Presence), in terms of the parameters; unset: always */
106
+ when?: string;
107
+ /** the attributes Radix sets on it, in terms of the parameters (`data-state`) */
108
+ attrs: Record<string, string>;
109
+ /** inline style Radix sets on it */
110
+ style?: Record<string, string>;
111
+ /** Radix sets no data-disabled on it, even when its parent is disabled (a menu's ItemIndicator) */
112
+ noDisabled?: true;
113
+ }
114
+ interface PartOptions {
115
+ props?: Record<string, string | RadixDrop>;
116
+ events?: Record<string, string>;
117
+ /** false for a part that renders no element of its own (Root, Portal, Provider) */
118
+ element?: boolean;
119
+ notes?: string[];
120
+ cssVars?: Record<string, string>;
121
+ dataDiffers?: string[];
122
+ indeterminate?: string;
123
+ discriminated?: boolean;
124
+ differs?: string;
125
+ pressFocus?: boolean;
126
+ /** the part renders an element but bits-ui's takes no `child` snippet (ScrollArea.Viewport): Radix's asChild is refused */
127
+ noChild?: boolean;
128
+ }
129
+ export declare function bitsPart(name: string, options?: PartOptions): BitsPartMap;
130
+ /**
131
+ * Radix's controlled state as bits-ui takes it: `open` and `defaultOpen` are both bits-ui's `open` (the emitter tells
132
+ * them apart: a controlled value is a function binding, a default a plain prop), and the change callback keeps its name.
133
+ */
134
+ export declare function state(prop: string, change?: string): {
135
+ props: Record<string, string>;
136
+ events: Record<string, string>;
137
+ };
138
+ /**
139
+ * Radix's DismissableLayer and FocusScope callbacks on a layered content (dialog, popover, menu): bits-ui spells the
140
+ * escape key `onEscapeKeydown`, and its `onInteractOutside` is the pointer press outside (a PointerEvent), which is
141
+ * Radix's `onPointerDownOutside`. Radix's own `onInteractOutside` (a press or a focus outside) has no single
142
+ * counterpart and stays unmapped.
143
+ */
144
+ export declare const LAYER_EVENTS: Record<string, string>;
145
+ /** Radix's Popper placement props, which bits-ui's floating contents take under the same names. */
146
+ export declare const POPPER_PROPS: Record<string, string>;
147
+ /**
148
+ * Radix's menu ItemIndicator (DropdownMenu, ContextMenu, Menubar): bits-ui has no such part, its CheckboxItem gives
149
+ * `{ checked, indeterminate }` and its RadioItem `{ checked }` to the item's `children` snippet. The emitter writes
150
+ * Radix's span there, as Radix renders it: while the item is checked (or the checkbox indeterminate), with data-state
151
+ * and no data-disabled.
152
+ */
153
+ export declare function menuItemIndicator(ns: string): BitsPartMap;
154
+ /** A Radix Portal: its `container` is bits-ui's `to` (an element or a selector). */
155
+ export declare function portal(ns: string): BitsPartMap;
156
+ /**
157
+ * The CSS custom properties Radix's Popper sets on a floating content (`--radix-select-content-transform-origin`, the
158
+ * available sizes, the trigger's size), by bits-ui's one set of names for every floating content: shadcn reads them.
159
+ */
160
+ export declare function popperVars(radix: string): Record<string, string>;
161
+ export {};
@@ -0,0 +1,85 @@
1
+ export function bitsPart(name, options = {}) {
2
+ const element = options.element ?? true;
3
+ return {
4
+ from: 'bits-ui',
5
+ name,
6
+ props: options.props ?? {},
7
+ events: options.events ?? {},
8
+ element,
9
+ ...(element && !options.noChild ? { asChild: 'child' } : {}),
10
+ ...(options.notes ? { notes: options.notes } : {}),
11
+ ...(options.cssVars ? { cssVars: options.cssVars } : {}),
12
+ ...(options.dataDiffers ? { dataDiffers: options.dataDiffers } : {}),
13
+ ...(options.indeterminate ? { indeterminate: options.indeterminate } : {}),
14
+ ...(options.discriminated ? { discriminated: true } : {}),
15
+ ...(options.differs ? { differs: options.differs } : {}),
16
+ ...(options.pressFocus ? { pressFocus: true } : {}),
17
+ };
18
+ }
19
+ /**
20
+ * Radix's controlled state as bits-ui takes it: `open` and `defaultOpen` are both bits-ui's `open` (the emitter tells
21
+ * them apart: a controlled value is a function binding, a default a plain prop), and the change callback keeps its name.
22
+ */
23
+ export function state(prop, change = `on${prop.charAt(0).toUpperCase()}${prop.slice(1)}Change`) {
24
+ const def = `default${prop.charAt(0).toUpperCase()}${prop.slice(1)}`;
25
+ return { props: { [prop]: prop, [def]: prop }, events: { [change]: change } };
26
+ }
27
+ /**
28
+ * Radix's DismissableLayer and FocusScope callbacks on a layered content (dialog, popover, menu): bits-ui spells the
29
+ * escape key `onEscapeKeydown`, and its `onInteractOutside` is the pointer press outside (a PointerEvent), which is
30
+ * Radix's `onPointerDownOutside`. Radix's own `onInteractOutside` (a press or a focus outside) has no single
31
+ * counterpart and stays unmapped.
32
+ */
33
+ export const LAYER_EVENTS = {
34
+ onEscapeKeyDown: 'onEscapeKeydown',
35
+ onPointerDownOutside: 'onInteractOutside',
36
+ onFocusOutside: 'onFocusOutside',
37
+ onOpenAutoFocus: 'onOpenAutoFocus',
38
+ onCloseAutoFocus: 'onCloseAutoFocus',
39
+ };
40
+ /** Radix's Popper placement props, which bits-ui's floating contents take under the same names. */
41
+ export const POPPER_PROPS = {
42
+ side: 'side',
43
+ sideOffset: 'sideOffset',
44
+ align: 'align',
45
+ alignOffset: 'alignOffset',
46
+ avoidCollisions: 'avoidCollisions',
47
+ collisionBoundary: 'collisionBoundary',
48
+ collisionPadding: 'collisionPadding',
49
+ arrowPadding: 'arrowPadding',
50
+ sticky: 'sticky',
51
+ hideWhenDetached: 'hideWhenDetached',
52
+ updatePositionStrategy: 'updatePositionStrategy',
53
+ };
54
+ /**
55
+ * Radix's menu ItemIndicator (DropdownMenu, ContextMenu, Menubar): bits-ui has no such part, its CheckboxItem gives
56
+ * `{ checked, indeterminate }` and its RadioItem `{ checked }` to the item's `children` snippet. The emitter writes
57
+ * Radix's span there, as Radix renders it: while the item is checked (or the checkbox indeterminate), with data-state
58
+ * and no data-disabled.
59
+ */
60
+ export function menuItemIndicator(ns) {
61
+ return {
62
+ ...bitsPart(`${ns}.CheckboxItem`, { props: { forceMount: 'forceMount' } }),
63
+ synthIn: {
64
+ CheckboxItem: { tag: 'span', parent: 'CheckboxItem', params: ['checked', 'indeterminate'], when: 'indeterminate || checked', attrs: { 'data-state': "indeterminate ? 'indeterminate' : checked ? 'checked' : 'unchecked'" }, noDisabled: true },
65
+ RadioItem: { tag: 'span', parent: 'RadioItem', params: ['checked'], when: 'checked', attrs: { 'data-state': "checked ? 'checked' : 'unchecked'" }, noDisabled: true },
66
+ },
67
+ };
68
+ }
69
+ /** A Radix Portal: its `container` is bits-ui's `to` (an element or a selector). */
70
+ export function portal(ns) {
71
+ return bitsPart(`${ns}.Portal`, { element: false, props: { container: 'to' } });
72
+ }
73
+ /**
74
+ * The CSS custom properties Radix's Popper sets on a floating content (`--radix-select-content-transform-origin`, the
75
+ * available sizes, the trigger's size), by bits-ui's one set of names for every floating content: shadcn reads them.
76
+ */
77
+ export function popperVars(radix) {
78
+ return {
79
+ [`--radix-${radix}-content-transform-origin`]: '--bits-floating-transform-origin',
80
+ [`--radix-${radix}-content-available-width`]: '--bits-floating-available-width',
81
+ [`--radix-${radix}-content-available-height`]: '--bits-floating-available-height',
82
+ [`--radix-${radix}-trigger-width`]: '--bits-floating-anchor-width',
83
+ [`--radix-${radix}-trigger-height`]: '--bits-floating-anchor-height',
84
+ };
85
+ }
@@ -0,0 +1,7 @@
1
+ import { type BitsPartMap } from './part.js';
2
+ /**
3
+ * Radix Popover → bits-ui Popover. `modal` is not mapped (bits-ui's popover has no modal mode). Anchor, Title and
4
+ * Description have no bits-ui part (bits-ui anchors a content with its `customAnchor` prop). Radix's
5
+ * `--radix-popover-*` custom properties a class reads are bits-ui's `--bits-floating-*` (see index: cssVariable).
6
+ */
7
+ export declare const popover: Readonly<Record<string, BitsPartMap>>;
@@ -0,0 +1,15 @@
1
+ import { bitsPart, LAYER_EVENTS, POPPER_PROPS, portal, state } from './part.js';
2
+ const open = state('open');
3
+ /**
4
+ * Radix Popover → bits-ui Popover. `modal` is not mapped (bits-ui's popover has no modal mode). Anchor, Title and
5
+ * Description have no bits-ui part (bits-ui anchors a content with its `customAnchor` prop). Radix's
6
+ * `--radix-popover-*` custom properties a class reads are bits-ui's `--bits-floating-*` (see index: cssVariable).
7
+ */
8
+ export const popover = {
9
+ Root: bitsPart('Popover.Root', { element: false, props: open.props, events: open.events }),
10
+ Trigger: bitsPart('Popover.Trigger'),
11
+ Portal: portal('Popover'),
12
+ Content: bitsPart('Popover.Content', { props: { forceMount: 'forceMount', ...POPPER_PROPS }, events: LAYER_EVENTS }),
13
+ Close: bitsPart('Popover.Close'),
14
+ Arrow: bitsPart('Popover.Arrow'),
15
+ };
@@ -0,0 +1,11 @@
1
+ import { type BitsPartMap } from './part.js';
2
+ /**
3
+ * Radix Progress → bits-ui Progress. Radix's value defaults to `null` (indeterminate) where bits-ui's defaults to `0`:
4
+ * the Root is given Radix's default (BitsPartMap.defaults). bits-ui has no Indicator: Radix's is a div with data-state,
5
+ * data-value and data-max from the Root's value and max, which the emitter writes from the Root's props as the source
6
+ * gives them (SynthPart.fromProps). Given a number, bits-ui's Root says data-state "loaded" where Radix says "complete"
7
+ * and sets no aria-valuetext: said where a value may reach it. `getValueLabel` (Radix's aria-valuetext) is not mapped.
8
+ * Radix replaces an invalid max (not above 0) by 100 and an out-of-range value by null, with a console error; the map
9
+ * passes them as given.
10
+ */
11
+ export declare const progress: Readonly<Record<string, BitsPartMap>>;
@@ -0,0 +1,27 @@
1
+ import { bitsPart } from './part.js';
2
+ /**
3
+ * Radix Progress → bits-ui Progress. Radix's value defaults to `null` (indeterminate) where bits-ui's defaults to `0`:
4
+ * the Root is given Radix's default (BitsPartMap.defaults). bits-ui has no Indicator: Radix's is a div with data-state,
5
+ * data-value and data-max from the Root's value and max, which the emitter writes from the Root's props as the source
6
+ * gives them (SynthPart.fromProps). Given a number, bits-ui's Root says data-state "loaded" where Radix says "complete"
7
+ * and sets no aria-valuetext: said where a value may reach it. `getValueLabel` (Radix's aria-valuetext) is not mapped.
8
+ * Radix replaces an invalid max (not above 0) by 100 and an out-of-range value by null, with a console error; the map
9
+ * passes them as given.
10
+ */
11
+ export const progress = {
12
+ Root: {
13
+ ...bitsPart('Progress.Root', { props: { value: 'value', max: 'max' } }),
14
+ defaults: { value: 'null' },
15
+ differsWith: { props: ['value'], why: 'given a number, bits-ui\'s Progress.Root says data-state="loaded" at its max where Radix says "complete", and sets no aria-valuetext where Radix sets the percentage' },
16
+ },
17
+ Indicator: {
18
+ ...bitsPart('Progress.Root'),
19
+ synth: {
20
+ tag: 'div',
21
+ parent: 'Root',
22
+ params: ['value', 'max'],
23
+ fromProps: { value: 'null', max: '100' },
24
+ attrs: { 'data-state': "value == null ? 'indeterminate' : value === max ? 'complete' : 'loading'", 'data-value': 'value ?? undefined', 'data-max': 'max' },
25
+ },
26
+ },
27
+ };
@@ -0,0 +1,9 @@
1
+ import { type BitsPartMap } from './part.js';
2
+ /**
3
+ * Radix RadioGroup → bits-ui RadioGroup. `dir` is not a bits-ui prop: it stays the root's attribute, as Radix sets it,
4
+ * and bits-ui's arrow keys follow the root's computed direction, as Radix's follow `dir`. bits-ui has no
5
+ * Indicator component: its Item gives `{ checked }` to its `children` snippet, and the emitter writes Radix's Indicator
6
+ * there, as Radix renders it (a span with data-state while the item is checked, and data-disabled when the item is given
7
+ * disabled). data-state (checked / unchecked) and data-disabled on Item are the same.
8
+ */
9
+ export declare const radioGroup: Readonly<Record<string, BitsPartMap>>;