@zonsh/ui 0.4.1 → 0.6.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 (562) hide show
  1. package/CHANGELOG.md +639 -0
  2. package/README.md +49 -21
  3. package/dist/brand.d.ts +3 -0
  4. package/dist/brand.js +7 -0
  5. package/dist/components/_breadcrumb-more.d.ts +6 -0
  6. package/dist/components/_breadcrumb-more.js +5 -0
  7. package/dist/components/_drawing-svg.d.ts +11 -0
  8. package/dist/components/_drawing-svg.js +30 -0
  9. package/dist/components/_media.d.ts +159 -0
  10. package/dist/components/_media.js +266 -0
  11. package/dist/components/_overlay.d.ts +8 -5
  12. package/dist/components/_overlay.js +11 -6
  13. package/dist/components/_scheduler-calendar.d.ts +71 -0
  14. package/dist/components/_scheduler-calendar.js +940 -0
  15. package/dist/components/_scheduler-editor.d.ts +29 -0
  16. package/dist/components/_scheduler-editor.js +111 -0
  17. package/dist/components/_scheduler-menu.d.ts +16 -0
  18. package/dist/components/_scheduler-menu.js +18 -0
  19. package/dist/components/_scheduler-parts.d.ts +164 -0
  20. package/dist/components/_scheduler-parts.js +327 -0
  21. package/dist/components/_suggest-list.d.ts +142 -0
  22. package/dist/components/_suggest-list.js +159 -0
  23. package/dist/components/_toolbar-more.d.ts +24 -0
  24. package/dist/components/_toolbar-more.js +25 -0
  25. package/dist/components/accordion.d.ts +1 -1
  26. package/dist/components/accordion.js +7 -7
  27. package/dist/components/action-sheet.d.ts +88 -0
  28. package/dist/components/action-sheet.js +124 -0
  29. package/dist/components/alert-dialog.js +3 -1
  30. package/dist/components/alert.d.ts +11 -18
  31. package/dist/components/alert.js +9 -6
  32. package/dist/components/app-bar.d.ts +93 -0
  33. package/dist/components/app-bar.js +175 -0
  34. package/dist/components/ascii-field.js +2 -1
  35. package/dist/components/audio-player.d.ts +134 -0
  36. package/dist/components/audio-player.js +618 -0
  37. package/dist/components/avatar.d.ts +6 -6
  38. package/dist/components/avatar.js +13 -11
  39. package/dist/components/badge.d.ts +12 -12
  40. package/dist/components/badge.js +7 -5
  41. package/dist/components/bottom-nav.d.ts +53 -11
  42. package/dist/components/bottom-nav.js +389 -24
  43. package/dist/components/breadcrumb.d.ts +11 -2
  44. package/dist/components/breadcrumb.js +60 -6
  45. package/dist/components/button-group.js +5 -1
  46. package/dist/components/button.d.ts +23 -6
  47. package/dist/components/button.js +64 -8
  48. package/dist/components/calendar.js +8 -6
  49. package/dist/components/card.d.ts +10 -8
  50. package/dist/components/card.js +15 -14
  51. package/dist/components/carousel.d.ts +2 -2
  52. package/dist/components/carousel.js +21 -8
  53. package/dist/components/chart.d.ts +38 -1
  54. package/dist/components/chart.js +27 -5
  55. package/dist/components/checkbox.js +2 -2
  56. package/dist/components/code-block.d.ts +9 -2
  57. package/dist/components/code-block.js +26 -7
  58. package/dist/components/collapsible.js +4 -4
  59. package/dist/components/color-picker.d.ts +2 -2
  60. package/dist/components/color-picker.js +5 -5
  61. package/dist/components/combobox.d.ts +26 -7
  62. package/dist/components/combobox.js +32 -13
  63. package/dist/components/command.d.ts +29 -5
  64. package/dist/components/command.js +37 -12
  65. package/dist/components/context-menu.d.ts +5 -2
  66. package/dist/components/context-menu.js +24 -3
  67. package/dist/components/conversation.d.ts +1 -1
  68. package/dist/components/conversation.js +77 -16
  69. package/dist/components/copy-button.d.ts +1 -1
  70. package/dist/components/copy-button.js +8 -6
  71. package/dist/components/data-table.d.ts +6 -6
  72. package/dist/components/data-table.js +41 -15
  73. package/dist/components/date-picker.d.ts +31 -9
  74. package/dist/components/date-picker.js +100 -18
  75. package/dist/components/dialog.d.ts +17 -10
  76. package/dist/components/dialog.js +20 -13
  77. package/dist/components/drawer.d.ts +26 -8
  78. package/dist/components/drawer.js +75 -16
  79. package/dist/components/drawing.d.ts +25 -0
  80. package/dist/components/drawing.js +32 -0
  81. package/dist/components/empty.js +2 -2
  82. package/dist/components/feature-list.d.ts +65 -13
  83. package/dist/components/feature-list.js +116 -15
  84. package/dist/components/field.js +2 -2
  85. package/dist/components/file-drop.d.ts +9 -7
  86. package/dist/components/file-drop.js +8 -43
  87. package/dist/components/filter-bar.d.ts +10 -9
  88. package/dist/components/filter-bar.js +42 -25
  89. package/dist/components/graph.d.ts +19 -3
  90. package/dist/components/graph.js +190 -28
  91. package/dist/components/illustration.js +53 -31
  92. package/dist/components/input-group.d.ts +6 -11
  93. package/dist/components/input-group.js +21 -19
  94. package/dist/components/input.d.ts +2 -2
  95. package/dist/components/input.js +3 -3
  96. package/dist/components/item.d.ts +9 -6
  97. package/dist/components/item.js +13 -8
  98. package/dist/components/kbd.d.ts +1 -1
  99. package/dist/components/kbd.js +1 -1
  100. package/dist/components/layout.d.ts +2 -1
  101. package/dist/components/layout.js +55 -11
  102. package/dist/components/lightbox.d.ts +76 -9
  103. package/dist/components/lightbox.js +354 -48
  104. package/dist/components/locale.d.ts +6 -6
  105. package/dist/components/logo.d.ts +21 -1
  106. package/dist/components/logo.js +32 -2
  107. package/dist/components/markdown-editor.d.ts +275 -0
  108. package/dist/components/markdown-editor.js +831 -0
  109. package/dist/components/mentions.d.ts +153 -0
  110. package/dist/components/mentions.js +507 -0
  111. package/dist/components/menu.d.ts +2 -1
  112. package/dist/components/menu.js +5 -4
  113. package/dist/components/menubar.d.ts +23 -5
  114. package/dist/components/menubar.js +153 -31
  115. package/dist/components/message.d.ts +62 -11
  116. package/dist/components/message.js +51 -14
  117. package/dist/components/meter.js +1 -1
  118. package/dist/components/money-input.d.ts +1 -1
  119. package/dist/components/money-input.js +1 -1
  120. package/dist/components/native-select.d.ts +2 -2
  121. package/dist/components/native-select.js +4 -4
  122. package/dist/components/navigation-menu.d.ts +3 -1
  123. package/dist/components/navigation-menu.js +23 -10
  124. package/dist/components/number-field.d.ts +2 -9
  125. package/dist/components/number-field.js +90 -26
  126. package/dist/components/number-roll.d.ts +26 -0
  127. package/dist/components/number-roll.js +81 -0
  128. package/dist/components/otp-field.d.ts +1 -1
  129. package/dist/components/otp-field.js +24 -3
  130. package/dist/components/pagination.d.ts +11 -3
  131. package/dist/components/pagination.js +59 -13
  132. package/dist/components/pdf-viewer.d.ts +1 -1
  133. package/dist/components/pdf-viewer.js +8 -8
  134. package/dist/components/phone-input.d.ts +1 -1
  135. package/dist/components/phone-input.js +2 -2
  136. package/dist/components/popover.js +5 -3
  137. package/dist/components/preview-card.d.ts +37 -2
  138. package/dist/components/preview-card.js +226 -2
  139. package/dist/components/progress.js +1 -1
  140. package/dist/components/prompt-input.d.ts +1 -1
  141. package/dist/components/prompt-input.js +35 -17
  142. package/dist/components/pull-to-refresh.d.ts +50 -0
  143. package/dist/components/pull-to-refresh.js +189 -0
  144. package/dist/components/quote.d.ts +6 -1
  145. package/dist/components/quote.js +3 -2
  146. package/dist/components/radio-group.js +8 -3
  147. package/dist/components/rating.d.ts +4 -1
  148. package/dist/components/rating.js +131 -10
  149. package/dist/components/reasoning.d.ts +1 -1
  150. package/dist/components/reasoning.js +7 -3
  151. package/dist/components/resizable.d.ts +1 -1
  152. package/dist/components/resizable.js +2 -2
  153. package/dist/components/response.d.ts +4 -3
  154. package/dist/components/response.js +39 -15
  155. package/dist/components/scheduler.d.ts +352 -0
  156. package/dist/components/scheduler.js +1717 -0
  157. package/dist/components/scroll-area.js +1 -1
  158. package/dist/components/select.d.ts +17 -4
  159. package/dist/components/select.js +140 -9
  160. package/dist/components/separator.d.ts +1 -1
  161. package/dist/components/separator.js +3 -3
  162. package/dist/components/sidebar.d.ts +44 -3
  163. package/dist/components/sidebar.js +90 -31
  164. package/dist/components/site-header.d.ts +18 -13
  165. package/dist/components/site-header.js +26 -9
  166. package/dist/components/skeleton.d.ts +18 -8
  167. package/dist/components/skeleton.js +23 -8
  168. package/dist/components/slider.js +2 -2
  169. package/dist/components/sortable.d.ts +55 -4
  170. package/dist/components/sortable.js +187 -94
  171. package/dist/components/sources.d.ts +1 -1
  172. package/dist/components/sources.js +2 -2
  173. package/dist/components/spinner.d.ts +4 -4
  174. package/dist/components/spinner.js +4 -4
  175. package/dist/components/stat.d.ts +21 -4
  176. package/dist/components/stat.js +17 -8
  177. package/dist/components/stepper.d.ts +1 -1
  178. package/dist/components/stepper.js +8 -7
  179. package/dist/components/suggestions.d.ts +11 -3
  180. package/dist/components/suggestions.js +10 -4
  181. package/dist/components/swipe-actions.d.ts +66 -0
  182. package/dist/components/swipe-actions.js +292 -0
  183. package/dist/components/switch.js +1 -1
  184. package/dist/components/table.d.ts +13 -7
  185. package/dist/components/table.js +124 -23
  186. package/dist/components/tabs.js +15 -8
  187. package/dist/components/tag.d.ts +19 -20
  188. package/dist/components/tag.js +9 -5
  189. package/dist/components/tags-input.d.ts +2 -7
  190. package/dist/components/tags-input.js +11 -8
  191. package/dist/components/textarea.d.ts +3 -2
  192. package/dist/components/textarea.js +4 -3
  193. package/dist/components/theme.d.ts +50 -7
  194. package/dist/components/theme.js +168 -12
  195. package/dist/components/time-field.d.ts +6 -10
  196. package/dist/components/time-field.js +19 -9
  197. package/dist/components/timeline.d.ts +19 -3
  198. package/dist/components/timeline.js +21 -9
  199. package/dist/components/tippy.d.ts +17 -1
  200. package/dist/components/tippy.js +95 -15
  201. package/dist/components/toast.d.ts +2 -7
  202. package/dist/components/toast.js +12 -8
  203. package/dist/components/toggle-group.d.ts +7 -1
  204. package/dist/components/toggle-group.js +17 -5
  205. package/dist/components/toggle.d.ts +2 -2
  206. package/dist/components/toggle.js +3 -2
  207. package/dist/components/tool-call.d.ts +1 -1
  208. package/dist/components/tool-call.js +8 -3
  209. package/dist/components/toolbar.d.ts +57 -4
  210. package/dist/components/toolbar.js +219 -16
  211. package/dist/components/tooltip.d.ts +5 -3
  212. package/dist/components/tooltip.js +14 -6
  213. package/dist/components/tour.d.ts +1 -1
  214. package/dist/components/tour.js +70 -24
  215. package/dist/components/tree.js +33 -10
  216. package/dist/components/typography.d.ts +31 -8
  217. package/dist/components/typography.js +21 -10
  218. package/dist/components/video-player.d.ts +7 -2
  219. package/dist/components/video-player.js +182 -225
  220. package/dist/index.d.ts +99 -92
  221. package/dist/index.js +99 -92
  222. package/dist/lib/calendar.d.ts +153 -0
  223. package/dist/lib/calendar.js +312 -0
  224. package/dist/lib/cn.d.ts +3 -1
  225. package/dist/lib/cn.js +5 -0
  226. package/dist/lib/code-highlight.d.ts +14 -0
  227. package/dist/lib/code-highlight.js +81 -18
  228. package/dist/lib/drag.d.ts +39 -0
  229. package/dist/lib/drag.js +96 -0
  230. package/dist/lib/editorial-assets.js +16 -8
  231. package/dist/lib/figure/figures/automation.js +25 -6
  232. package/dist/lib/figure/figures/bar-chart.js +6 -1
  233. package/dist/lib/figure/figures/brackets-classic.js +4 -1
  234. package/dist/lib/figure/figures/city.js +12 -2
  235. package/dist/lib/figure/figures/conveyor.js +17 -4
  236. package/dist/lib/figure/figures/database.js +5 -2
  237. package/dist/lib/figure/figures/documents.js +11 -3
  238. package/dist/lib/figure/figures/inbox.js +5 -2
  239. package/dist/lib/figure/figures/laptop.js +3 -1
  240. package/dist/lib/figure/figures/pipeline.js +45 -10
  241. package/dist/lib/figure/figures/platform.js +62 -7
  242. package/dist/lib/figure/figures/server.js +21 -5
  243. package/dist/lib/figure/figures/spreadsheet.js +29 -5
  244. package/dist/lib/figure/kernel.d.ts +4 -2
  245. package/dist/lib/figure/kernel.js +10 -5
  246. package/dist/lib/figure/parts.js +6 -2
  247. package/dist/lib/files.d.ts +31 -0
  248. package/dist/lib/files.js +60 -0
  249. package/dist/lib/gesture.d.ts +70 -0
  250. package/dist/lib/gesture.js +141 -0
  251. package/dist/lib/glide.d.ts +10 -4
  252. package/dist/lib/glide.js +14 -5
  253. package/dist/lib/icons.d.ts +1 -0
  254. package/dist/lib/icons.js +6 -0
  255. package/dist/lib/illustration-library.js +1 -6
  256. package/dist/lib/markdown-edit.d.ts +112 -0
  257. package/dist/lib/markdown-edit.js +557 -0
  258. package/dist/lib/markdown-rich-editor.d.ts +188 -0
  259. package/dist/lib/markdown-rich-editor.js +1153 -0
  260. package/dist/lib/markdown-rich.d.ts +63 -0
  261. package/dist/lib/markdown-rich.js +534 -0
  262. package/dist/lib/mentions.d.ts +100 -0
  263. package/dist/lib/mentions.js +246 -0
  264. package/dist/lib/motion.d.ts +18 -0
  265. package/dist/lib/motion.js +43 -5
  266. package/dist/lib/number-roll.d.ts +89 -0
  267. package/dist/lib/number-roll.js +391 -0
  268. package/dist/lib/platform.d.ts +6 -0
  269. package/dist/lib/platform.js +14 -0
  270. package/dist/lib/portal-container.d.ts +9 -0
  271. package/dist/lib/portal-container.js +10 -0
  272. package/dist/lib/press.d.ts +5 -0
  273. package/dist/lib/press.js +186 -0
  274. package/dist/lib/scheduler.d.ts +128 -0
  275. package/dist/lib/scheduler.js +272 -0
  276. package/dist/lib/scroll-edges.d.ts +9 -0
  277. package/dist/lib/scroll-edges.js +50 -0
  278. package/dist/lib/table-fit.d.ts +4 -3
  279. package/dist/lib/table-fit.js +92 -25
  280. package/dist/lib/theme-preset.d.ts +267 -0
  281. package/dist/lib/theme-preset.js +1046 -0
  282. package/dist/lib/theme-script.d.ts +23 -3
  283. package/dist/lib/theme-script.js +17 -5
  284. package/dist/lib/tippy/sprite.d.ts +36 -4
  285. package/dist/lib/tippy/sprite.js +188 -15
  286. package/dist/lib/tone.d.ts +4 -0
  287. package/dist/lib/tone.js +1 -0
  288. package/dist/messages/de.d.ts +3 -3
  289. package/dist/messages/de.js +274 -3
  290. package/dist/skills/zon-ui/SKILL.md +279 -0
  291. package/dist/skills/zon-ui/references/authoring.md +265 -0
  292. package/dist/skills/zon-ui/references/brand.md +416 -0
  293. package/dist/skills/zon-ui/references/components/accordion.md +199 -0
  294. package/dist/skills/zon-ui/references/components/action-sheet.md +268 -0
  295. package/dist/skills/zon-ui/references/components/alert-dialog.md +276 -0
  296. package/dist/skills/zon-ui/references/components/alert.md +167 -0
  297. package/dist/skills/zon-ui/references/components/app-bar.md +307 -0
  298. package/dist/skills/zon-ui/references/components/ascii-field.md +121 -0
  299. package/dist/skills/zon-ui/references/components/aspect-ratio.md +112 -0
  300. package/dist/skills/zon-ui/references/components/audio-player.md +231 -0
  301. package/dist/skills/zon-ui/references/components/avatar.md +98 -0
  302. package/dist/skills/zon-ui/references/components/badge.md +227 -0
  303. package/dist/skills/zon-ui/references/components/bottom-nav.md +709 -0
  304. package/dist/skills/zon-ui/references/components/breadcrumb.md +143 -0
  305. package/dist/skills/zon-ui/references/components/button-group.md +216 -0
  306. package/dist/skills/zon-ui/references/components/button.md +309 -0
  307. package/dist/skills/zon-ui/references/components/calendar.md +296 -0
  308. package/dist/skills/zon-ui/references/components/card.md +158 -0
  309. package/dist/skills/zon-ui/references/components/carousel.md +297 -0
  310. package/dist/skills/zon-ui/references/components/chart.md +739 -0
  311. package/dist/skills/zon-ui/references/components/chat.md +417 -0
  312. package/dist/skills/zon-ui/references/components/checkbox.md +219 -0
  313. package/dist/skills/zon-ui/references/components/code-block.md +143 -0
  314. package/dist/skills/zon-ui/references/components/code-highlight.md +118 -0
  315. package/dist/skills/zon-ui/references/components/collapsible.md +146 -0
  316. package/dist/skills/zon-ui/references/components/color-picker.md +200 -0
  317. package/dist/skills/zon-ui/references/components/combobox.md +455 -0
  318. package/dist/skills/zon-ui/references/components/command.md +326 -0
  319. package/dist/skills/zon-ui/references/components/contact-form.md +562 -0
  320. package/dist/skills/zon-ui/references/components/context-menu.md +159 -0
  321. package/dist/skills/zon-ui/references/components/conversation.md +146 -0
  322. package/dist/skills/zon-ui/references/components/copy-button.md +162 -0
  323. package/dist/skills/zon-ui/references/components/crm.md +1022 -0
  324. package/dist/skills/zon-ui/references/components/dashboard.md +612 -0
  325. package/dist/skills/zon-ui/references/components/data-table.md +776 -0
  326. package/dist/skills/zon-ui/references/components/date-picker.md +444 -0
  327. package/dist/skills/zon-ui/references/components/dialog.md +335 -0
  328. package/dist/skills/zon-ui/references/components/direction.md +165 -0
  329. package/dist/skills/zon-ui/references/components/drawer.md +276 -0
  330. package/dist/skills/zon-ui/references/components/drawing.md +94 -0
  331. package/dist/skills/zon-ui/references/components/empty.md +225 -0
  332. package/dist/skills/zon-ui/references/components/feature-list.md +412 -0
  333. package/dist/skills/zon-ui/references/components/field.md +209 -0
  334. package/dist/skills/zon-ui/references/components/file-drop.md +234 -0
  335. package/dist/skills/zon-ui/references/components/filter-bar.md +485 -0
  336. package/dist/skills/zon-ui/references/components/form.md +970 -0
  337. package/dist/skills/zon-ui/references/components/graph.md +339 -0
  338. package/dist/skills/zon-ui/references/components/illustration.md +497 -0
  339. package/dist/skills/zon-ui/references/components/inbox.md +263 -0
  340. package/dist/skills/zon-ui/references/components/input-group.md +339 -0
  341. package/dist/skills/zon-ui/references/components/input.md +189 -0
  342. package/dist/skills/zon-ui/references/components/item.md +277 -0
  343. package/dist/skills/zon-ui/references/components/kanban.md +626 -0
  344. package/dist/skills/zon-ui/references/components/kbd.md +116 -0
  345. package/dist/skills/zon-ui/references/components/label.md +104 -0
  346. package/dist/skills/zon-ui/references/components/layout.md +291 -0
  347. package/dist/skills/zon-ui/references/components/lightbox.md +235 -0
  348. package/dist/skills/zon-ui/references/components/locale.md +279 -0
  349. package/dist/skills/zon-ui/references/components/logo.md +257 -0
  350. package/dist/skills/zon-ui/references/components/markdown-editor.md +558 -0
  351. package/dist/skills/zon-ui/references/components/mentions.md +512 -0
  352. package/dist/skills/zon-ui/references/components/menu.md +218 -0
  353. package/dist/skills/zon-ui/references/components/menubar.md +292 -0
  354. package/dist/skills/zon-ui/references/components/message.md +243 -0
  355. package/dist/skills/zon-ui/references/components/meter.md +105 -0
  356. package/dist/skills/zon-ui/references/components/money-input.md +333 -0
  357. package/dist/skills/zon-ui/references/components/native-select.md +197 -0
  358. package/dist/skills/zon-ui/references/components/navigation-menu.md +253 -0
  359. package/dist/skills/zon-ui/references/components/number-field.md +210 -0
  360. package/dist/skills/zon-ui/references/components/number-roll.md +175 -0
  361. package/dist/skills/zon-ui/references/components/onboarding.md +896 -0
  362. package/dist/skills/zon-ui/references/components/otp-field.md +166 -0
  363. package/dist/skills/zon-ui/references/components/pagination.md +109 -0
  364. package/dist/skills/zon-ui/references/components/pdf-viewer.md +177 -0
  365. package/dist/skills/zon-ui/references/components/phone-input.md +252 -0
  366. package/dist/skills/zon-ui/references/components/popover.md +176 -0
  367. package/dist/skills/zon-ui/references/components/preview-card.md +193 -0
  368. package/dist/skills/zon-ui/references/components/pricing.md +724 -0
  369. package/dist/skills/zon-ui/references/components/progress.md +92 -0
  370. package/dist/skills/zon-ui/references/components/prompt-input.md +307 -0
  371. package/dist/skills/zon-ui/references/components/pull-to-refresh.md +188 -0
  372. package/dist/skills/zon-ui/references/components/quote.md +115 -0
  373. package/dist/skills/zon-ui/references/components/radio-group.md +215 -0
  374. package/dist/skills/zon-ui/references/components/rating.md +260 -0
  375. package/dist/skills/zon-ui/references/components/reasoning.md +102 -0
  376. package/dist/skills/zon-ui/references/components/resizable.md +213 -0
  377. package/dist/skills/zon-ui/references/components/response.md +170 -0
  378. package/dist/skills/zon-ui/references/components/scheduler.md +732 -0
  379. package/dist/skills/zon-ui/references/components/scroll-area.md +122 -0
  380. package/dist/skills/zon-ui/references/components/select.md +351 -0
  381. package/dist/skills/zon-ui/references/components/separator.md +103 -0
  382. package/dist/skills/zon-ui/references/components/settings.md +793 -0
  383. package/dist/skills/zon-ui/references/components/shop.md +1715 -0
  384. package/dist/skills/zon-ui/references/components/sidebar.md +813 -0
  385. package/dist/skills/zon-ui/references/components/sign-in.md +1639 -0
  386. package/dist/skills/zon-ui/references/components/site-header.md +303 -0
  387. package/dist/skills/zon-ui/references/components/skeleton.md +256 -0
  388. package/dist/skills/zon-ui/references/components/slider.md +172 -0
  389. package/dist/skills/zon-ui/references/components/sortable.md +405 -0
  390. package/dist/skills/zon-ui/references/components/sources.md +106 -0
  391. package/dist/skills/zon-ui/references/components/spinner.md +222 -0
  392. package/dist/skills/zon-ui/references/components/stat.md +267 -0
  393. package/dist/skills/zon-ui/references/components/stepper.md +285 -0
  394. package/dist/skills/zon-ui/references/components/suggestions.md +146 -0
  395. package/dist/skills/zon-ui/references/components/swipe-actions.md +344 -0
  396. package/dist/skills/zon-ui/references/components/switch.md +160 -0
  397. package/dist/skills/zon-ui/references/components/table.md +999 -0
  398. package/dist/skills/zon-ui/references/components/tabs.md +258 -0
  399. package/dist/skills/zon-ui/references/components/tag.md +115 -0
  400. package/dist/skills/zon-ui/references/components/tags-input.md +216 -0
  401. package/dist/skills/zon-ui/references/components/textarea.md +95 -0
  402. package/dist/skills/zon-ui/references/components/theme-editor.md +3940 -0
  403. package/dist/skills/zon-ui/references/components/theme.md +362 -0
  404. package/dist/skills/zon-ui/references/components/time-field.md +222 -0
  405. package/dist/skills/zon-ui/references/components/timeline.md +285 -0
  406. package/dist/skills/zon-ui/references/components/tippy.md +243 -0
  407. package/dist/skills/zon-ui/references/components/toast.md +220 -0
  408. package/dist/skills/zon-ui/references/components/toggle-group.md +261 -0
  409. package/dist/skills/zon-ui/references/components/toggle.md +167 -0
  410. package/dist/skills/zon-ui/references/components/tool-call.md +146 -0
  411. package/dist/skills/zon-ui/references/components/toolbar.md +260 -0
  412. package/dist/skills/zon-ui/references/components/tooltip.md +172 -0
  413. package/dist/skills/zon-ui/references/components/tour.md +423 -0
  414. package/dist/skills/zon-ui/references/components/tree.md +481 -0
  415. package/dist/skills/zon-ui/references/components/typography.md +347 -0
  416. package/dist/skills/zon-ui/references/components/video-player.md +386 -0
  417. package/dist/skills/zon-ui/references/marketing.md +467 -0
  418. package/dist/skills/zon-ui/references/motion.md +455 -0
  419. package/dist/skills/zon-ui/references/recipes.md +1232 -0
  420. package/dist/skills/zon-ui/references/tokens.md +866 -0
  421. package/dist/sources/accordion.css +4 -0
  422. package/dist/sources/action-sheet.css +11 -0
  423. package/dist/sources/alert-dialog.css +6 -0
  424. package/dist/sources/alert.css +3 -0
  425. package/dist/sources/app-bar.css +14 -0
  426. package/dist/sources/ascii-field.css +3 -0
  427. package/dist/sources/aspect-ratio.css +3 -0
  428. package/dist/sources/audio-player.css +20 -0
  429. package/dist/sources/avatar.css +3 -0
  430. package/dist/sources/badge.css +3 -0
  431. package/dist/sources/bottom-nav.css +9 -0
  432. package/dist/sources/breadcrumb.css +14 -0
  433. package/dist/sources/button-group.css +3 -0
  434. package/dist/sources/button.css +9 -0
  435. package/dist/sources/calendar.css +13 -0
  436. package/dist/sources/card.css +3 -0
  437. package/dist/sources/carousel.css +11 -0
  438. package/dist/sources/chart.css +5 -0
  439. package/dist/sources/checkbox.css +6 -0
  440. package/dist/sources/code-block.css +13 -0
  441. package/dist/sources/collapsible.css +4 -0
  442. package/dist/sources/color-picker.css +13 -0
  443. package/dist/sources/combobox.css +13 -0
  444. package/dist/sources/command.css +13 -0
  445. package/dist/sources/context-menu.css +12 -0
  446. package/dist/sources/conversation.css +10 -0
  447. package/dist/sources/copy-button.css +10 -0
  448. package/dist/sources/data-table.css +27 -0
  449. package/dist/sources/date-picker.css +20 -0
  450. package/dist/sources/dialog.css +9 -0
  451. package/dist/sources/direction.css +2 -0
  452. package/dist/sources/drawer.css +9 -0
  453. package/dist/sources/drawing.css +5 -0
  454. package/dist/sources/empty.css +3 -0
  455. package/dist/sources/feature-list.css +4 -0
  456. package/dist/sources/field.css +4 -0
  457. package/dist/sources/file-drop.css +15 -0
  458. package/dist/sources/filter-bar.css +30 -0
  459. package/dist/sources/form.css +4 -0
  460. package/dist/sources/graph.css +19 -0
  461. package/dist/sources/illustration.css +28 -0
  462. package/dist/sources/input-group.css +7 -0
  463. package/dist/sources/input.css +3 -0
  464. package/dist/sources/item.css +4 -0
  465. package/dist/sources/kbd.css +5 -0
  466. package/dist/sources/label.css +3 -0
  467. package/dist/sources/layout.css +3 -0
  468. package/dist/sources/lightbox.css +33 -0
  469. package/dist/sources/locale.css +2 -0
  470. package/dist/sources/logo.css +4 -0
  471. package/dist/sources/markdown-editor.css +41 -0
  472. package/dist/sources/mentions.css +13 -0
  473. package/dist/sources/menu.css +11 -0
  474. package/dist/sources/menubar.css +14 -0
  475. package/dist/sources/message.css +16 -0
  476. package/dist/sources/meter.css +4 -0
  477. package/dist/sources/money-input.css +10 -0
  478. package/dist/sources/native-select.css +4 -0
  479. package/dist/sources/navigation-menu.css +8 -0
  480. package/dist/sources/number-field.css +8 -0
  481. package/dist/sources/number-roll.css +6 -0
  482. package/dist/sources/otp-field.css +5 -0
  483. package/dist/sources/pagination.css +11 -0
  484. package/dist/sources/pdf-viewer.css +30 -0
  485. package/dist/sources/phone-input.css +20 -0
  486. package/dist/sources/popover.css +7 -0
  487. package/dist/sources/preview-card.css +7 -0
  488. package/dist/sources/progress.css +4 -0
  489. package/dist/sources/prompt-input.css +15 -0
  490. package/dist/sources/pull-to-refresh.css +14 -0
  491. package/dist/sources/quote.css +3 -0
  492. package/dist/sources/radio-group.css +5 -0
  493. package/dist/sources/rating.css +6 -0
  494. package/dist/sources/reasoning.css +6 -0
  495. package/dist/sources/resizable.css +4 -0
  496. package/dist/sources/response.css +16 -0
  497. package/dist/sources/scheduler.css +44 -0
  498. package/dist/sources/scroll-area.css +3 -0
  499. package/dist/sources/select.css +12 -0
  500. package/dist/sources/separator.css +3 -0
  501. package/dist/sources/sidebar.css +19 -0
  502. package/dist/sources/site-header.css +15 -0
  503. package/dist/sources/skeleton.css +3 -0
  504. package/dist/sources/slider.css +6 -0
  505. package/dist/sources/sortable.css +12 -0
  506. package/dist/sources/sources.css +6 -0
  507. package/dist/sources/spinner.css +6 -0
  508. package/dist/sources/stat.css +9 -0
  509. package/dist/sources/stepper.css +6 -0
  510. package/dist/sources/suggestions.css +10 -0
  511. package/dist/sources/swipe-actions.css +20 -0
  512. package/dist/sources/switch.css +5 -0
  513. package/dist/sources/table.css +7 -0
  514. package/dist/sources/tabs.css +5 -0
  515. package/dist/sources/tag.css +3 -0
  516. package/dist/sources/tags-input.css +6 -0
  517. package/dist/sources/textarea.css +3 -0
  518. package/dist/sources/theme.css +13 -0
  519. package/dist/sources/time-field.css +7 -0
  520. package/dist/sources/timeline.css +7 -0
  521. package/dist/sources/tippy.css +6 -0
  522. package/dist/sources/toast.css +6 -0
  523. package/dist/sources/toggle-group.css +5 -0
  524. package/dist/sources/toggle.css +3 -0
  525. package/dist/sources/tool-call.css +16 -0
  526. package/dist/sources/toolbar.css +14 -0
  527. package/dist/sources/tooltip.css +6 -0
  528. package/dist/sources/tour.css +14 -0
  529. package/dist/sources/tree.css +6 -0
  530. package/dist/sources/typography.css +4 -0
  531. package/dist/sources/video-player.css +21 -0
  532. package/dist/styles/ai.css +3 -0
  533. package/dist/styles/brand.css +98 -0
  534. package/dist/styles/core.css +266 -0
  535. package/dist/styles/editor.css +3 -0
  536. package/dist/styles/expressive.css +75 -77
  537. package/dist/styles/fonts.css +61 -117
  538. package/dist/styles/graph.css +4 -0
  539. package/dist/styles/illustration.css +4 -0
  540. package/dist/styles/index.css +11 -193
  541. package/dist/styles/material.css +177 -31
  542. package/dist/styles/parts/ai.css +20 -14
  543. package/dist/styles/parts/brand.css +2 -2
  544. package/dist/styles/parts/controls.css +51 -38
  545. package/dist/styles/parts/data.css +43 -11
  546. package/dist/styles/parts/editor.css +372 -0
  547. package/dist/styles/parts/feedback.css +75 -15
  548. package/dist/styles/parts/foundations.css +12 -7
  549. package/dist/styles/parts/graph.css +25 -9
  550. package/dist/styles/parts/inputs.css +172 -9
  551. package/dist/styles/parts/isometric.css +6 -5
  552. package/dist/styles/parts/navigation.css +237 -25
  553. package/dist/styles/parts/overlays.css +110 -8
  554. package/dist/styles/parts/pdf.css +15 -9
  555. package/dist/styles/pdf.css +3 -0
  556. package/dist/styles/prose.css +3 -0
  557. package/dist/styles/tokens.css +105 -15
  558. package/dist/theme.d.ts +1 -0
  559. package/dist/theme.js +5 -0
  560. package/dist/vite.d.ts +48 -59
  561. package/dist/vite.js +54 -21
  562. package/package.json +69 -2
@@ -1,18 +1,21 @@
1
1
  "use client";
2
2
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { applyEdgeChanges, applyNodeChanges, Background, BackgroundVariant, BaseEdge, ConnectionLineType, EdgeLabelRenderer, getSmoothStepPath, getStraightPath, getViewportForBounds, Handle, MiniMap, Panel, Position, ReactFlow, ReactFlowProvider, useInternalNode, useReactFlow, } from "@xyflow/react";
4
- import { ArrowLeftRightIcon, CircleDotIcon, MaximizeIcon, MinusIcon, PencilIcon, PlusIcon, Trash2Icon, WandSparklesIcon, } from "lucide-react";
4
+ import { ArrowLeftRightIcon, ArrowRightIcon, CircleDotIcon, MaximizeIcon, MinusIcon, PencilIcon, PlusIcon, Trash2Icon, WandSparklesIcon, } from "../lib/icons.js";
5
5
  import * as React from "react";
6
6
  import { cn } from "../lib/cn.js";
7
- import { cssDuration } from "../lib/motion.js";
7
+ import { cssDuration, cssEase } from "../lib/motion.js";
8
+ import { useShortcutKeys } from "../lib/platform.js";
8
9
  import { LANE_HEADER, lanes, layered, network, dragSimulation, } from "../lib/graph-layout.js";
9
10
  import { Avatar } from "./avatar.js";
10
11
  import { useMessages } from "./locale.js";
11
- import { ContextMenu, ContextMenuContent, ContextMenuGroup, ContextMenuGroupLabel, ContextMenuItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuTrigger, } from "./context-menu.js";
12
+ import { ContextMenu, ContextMenuContent, ContextMenuGroup, ContextMenuGroupLabel, ContextMenuItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, } from "./context-menu.js";
12
13
  import { Toolbar, ToolbarButton, ToolbarGroup, ToolbarSeparator } from "./toolbar.js";
13
14
  import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
14
15
  /** Networks of up to this many nodes settle live around a dragged node. */
15
16
  const LIVE_DRAG_MAX = 300;
17
+ /** One d3-force tick: the simulation is tuned for one per frame at 60Hz. */
18
+ const TICK_MS = 1000 / 60;
16
19
  const newNodes = {
17
20
  task: "New step",
18
21
  start: "Start",
@@ -52,6 +55,7 @@ const defaultMessages = {
52
55
  addLabel: "Add a label",
53
56
  reverse: "Reverse direction",
54
57
  removeConnection: "Remove connection",
58
+ connectTo: "Connect to",
55
59
  enterKey: "Enter",
56
60
  deleteKey: "Del",
57
61
  connection: (from, to, directed) => `${from} ${directed ? "to" : "and"} ${to}`,
@@ -62,6 +66,9 @@ const defaultMessages = {
62
66
  edgeHelp: "Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.",
63
67
  handle: "Handle",
64
68
  moved: (direction, x, y) => `Moved selected node ${direction}. New position, x: ${x}, y: ${y}`,
69
+ touchHint: "Use two fingers to move the graph",
70
+ empty: "Nothing to show yet.",
71
+ emptyEditable: "Nothing here yet. Add a node to start.",
65
72
  };
66
73
  const GraphContext = React.createContext(null);
67
74
  const useGraph = () => React.useContext(GraphContext);
@@ -251,15 +258,15 @@ function NodeView({ id, data }) {
251
258
  const state = { "data-dim": data.dim ? "" : undefined, "data-lit": data.lit ? "" : undefined };
252
259
  // Shapes whose name sits under them: events and gateways.
253
260
  if (kind === "start" || kind === "end" || kind === "event" || kind === "gateway") {
254
- return (_jsxs("div", { "data-slot": "graph-node", "data-kind": kind, ...state, className: "relative size-full", children: [_jsx(Handles, {}), _jsx("div", { "data-slot": "graph-shape", className: "grid size-full place-items-center", children: kind === "gateway" && (_jsx("span", { className: "font-mono text-[18px] leading-none text-foreground", children: glyph[n.gateway ?? "exclusive"] })) }), _jsx("div", { className: "pointer-events-none absolute top-full left-1/2 mt-2 w-max max-w-40 -translate-x-1/2 text-center font-mono text-[11px] leading-tight text-muted-foreground", children: _jsx(Label, { kind: "node", id: id, value: n.label, className: "pointer-events-auto" }) })] }));
261
+ return (_jsxs("div", { "data-slot": "graph-node", "data-kind": kind, ...state, className: "relative size-full", children: [_jsx(Handles, {}), _jsx("div", { "data-slot": "graph-shape", className: "grid size-full place-items-center", children: kind === "gateway" && (_jsx("span", { className: "font-mono text-18 leading-none text-foreground", children: glyph[n.gateway ?? "exclusive"] })) }), _jsx("div", { className: "pointer-events-none absolute top-full left-1/2 mt-2 w-max max-w-40 -translate-x-1/2 text-center font-mono text-11 leading-tight text-muted-foreground", children: _jsx(Label, { kind: "node", id: id, value: n.label, className: "pointer-events-auto" }) })] }));
255
262
  }
256
263
  if (kind === "note") {
257
- return (_jsxs("div", { "data-slot": "graph-node", "data-kind": "note", ...state, className: "flex size-full items-center ps-3 text-[13px] leading-snug text-muted-foreground", children: [_jsx(Handles, {}), _jsx(Label, { kind: "node", id: id, value: n.label, className: "line-clamp-2 whitespace-normal" })] }));
264
+ return (_jsxs("div", { "data-slot": "graph-node", "data-kind": "note", ...state, className: "flex size-full items-center ps-3 text-13 leading-snug text-muted-foreground", children: [_jsx(Handles, {}), _jsx(Label, { kind: "node", id: id, value: n.label, className: "line-clamp-2 whitespace-normal" })] }));
258
265
  }
259
266
  if (kind === "person") {
260
- return (_jsxs("div", { "data-slot": "graph-node", "data-kind": "person", ...state, className: "flex size-full flex-col items-center gap-1.5 pt-1 text-center", children: [_jsx(Handles, {}), _jsx(Avatar, { "data-slot": "graph-avatar", src: n.image, name: n.label, size: "lg" }), _jsxs("div", { className: "flex w-full min-w-0 flex-col items-center gap-0.5", children: [_jsx(Label, { kind: "node", id: id, value: n.label, className: "max-w-full text-[13px] font-medium text-foreground" }), n.meta && (_jsx("span", { className: "max-w-full truncate font-mono text-[11px] text-muted-foreground", children: n.meta }))] })] }));
267
+ return (_jsxs("div", { "data-slot": "graph-node", "data-kind": "person", ...state, className: "flex size-full flex-col items-center gap-1.5 pt-1 text-center", children: [_jsx(Handles, {}), _jsx(Avatar, { "data-slot": "graph-avatar", src: n.image, name: n.label, size: "lg" }), _jsxs("div", { className: "flex w-full min-w-0 flex-col items-center gap-0.5", children: [_jsx(Label, { kind: "node", id: id, value: n.label, className: "max-w-full text-13 font-medium text-foreground" }), n.meta && (_jsx("span", { className: "max-w-full truncate font-mono text-11 text-muted-foreground", children: n.meta }))] })] }));
261
268
  }
262
- return (_jsxs("div", { "data-slot": "graph-node", "data-kind": kind, ...state, className: cn("flex size-full min-w-0 items-center gap-2.5 material-raised text-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted-foreground", kind === "entity" ? "rounded-full px-3.5 text-[13px]" : "rounded-button px-3.5 text-[14px]"), children: [_jsx(Handles, {}), n.icon, _jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx(Label, { kind: "node", id: id, value: n.label, className: "leading-tight" }), n.meta && kind === "task" && (_jsx("span", { className: "mt-1 truncate font-mono text-[11px] leading-none text-muted-foreground", children: n.meta }))] })] }));
269
+ return (_jsxs("div", { "data-slot": "graph-node", "data-kind": kind, ...state, className: cn("flex size-full min-w-0 items-center gap-2.5 material-raised text-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted-foreground", kind === "entity" ? "rounded-full px-3.5 text-13" : "rounded-button px-3.5 text-14"), children: [_jsx(Handles, {}), n.icon, _jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx(Label, { kind: "node", id: id, value: n.label, className: "leading-tight" }), n.meta && kind === "task" && (_jsx("span", { className: "mt-1 truncate font-mono text-11 leading-normal text-muted-foreground", children: n.meta }))] })] }));
263
270
  }
264
271
  function GroupView({ id, data }) {
265
272
  // A swimlane: a band with its name in a strip at the start, set along the flow.
@@ -429,7 +436,16 @@ const edgeTypes = { zon: EdgeView };
429
436
  export function Graph(props) {
430
437
  return (_jsx(ReactFlowProvider, { children: _jsx(GraphCanvas, { ...props }) }));
431
438
  }
432
- function GraphCanvas({ nodes: nodesProp, edges: edgesProp, layout = "flow", direction: directionProp, editable = false, onChange, onSelect, newNodeKind, minimap = false, controls = true, background = "dots", variant = "region", labels, className, ...props }) {
439
+ /** Under this frame width (px) a flow with no `direction` reads down and the minimap is left out. */
440
+ const NARROW_FRAME = 480;
441
+ /**
442
+ * How "fit" frames the graph: a margin all round, and room at the bottom for the controls, which
443
+ * float over the canvas there — a tall graph fitted by its height would end under them.
444
+ */
445
+ const fitWithControls = { padding: { top: 0.18, x: 0.18, bottom: "84px" }, maxZoom: 1.15 };
446
+ const fitBare = { padding: 0.18, maxZoom: 1.15 };
447
+ const fitFrame = (controls) => (controls ? fitWithControls : fitBare);
448
+ function GraphCanvas({ nodes: nodesProp, edges: edgesProp, layout = "flow", direction: directionProp, editable = false, onChange, onSelect, newNodeKind, minimap = false, controls = true, background = "dots", variant = "region", emptyMessage, labels, className, ...props }) {
433
449
  const text = useMessages("graph", defaultMessages, labels);
434
450
  const textRef = React.useRef(text);
435
451
  textRef.current = text;
@@ -440,22 +456,95 @@ function GraphCanvas({ nodes: nodesProp, edges: edgesProp, layout = "flow", dire
440
456
  "handle.ariaLabel": text.handle,
441
457
  "minimap.ariaLabel": text.minimap,
442
458
  }), [text]);
443
- const direction = directionProp ?? (layout === "tree" ? "down" : "right");
459
+ const frame = React.useRef(null);
460
+ // A narrow frame, as on a phone. There a flow without a direction of its own reads down — laid
461
+ // out to the right it would be a thin strip, too small to read when it fits and cut off when
462
+ // not — and the minimap stays out of the way of the controls it would cover.
463
+ const [narrow, setNarrow] = React.useState(false);
464
+ React.useLayoutEffect(() => {
465
+ const el = frame.current;
466
+ if (!el || typeof ResizeObserver === "undefined")
467
+ return;
468
+ const measure = (width) => setNarrow(width > 0 && width < NARROW_FRAME);
469
+ measure(el.getBoundingClientRect().width);
470
+ const observer = new ResizeObserver(() => measure(el.getBoundingClientRect().width));
471
+ observer.observe(el);
472
+ return () => observer.disconnect();
473
+ }, []);
474
+ // On a touch-only device the graph lets the page scroll, as a map does: one finger scrolls the
475
+ // page, two fingers pan and pinch the graph. A graph is most of a phone's screen; panning on one
476
+ // finger would leave the page little to scroll by. Editable, one finger still drags a node.
477
+ const touchOnly = !useShortcutKeys().hasKeyboard;
478
+ const [touchHint, setTouchHint] = React.useState(false);
479
+ React.useEffect(() => {
480
+ const el = frame.current;
481
+ if (!el || !touchOnly)
482
+ return;
483
+ let from = null;
484
+ let timer;
485
+ // React Flow does not pan from a touch inside `.nopan`: the frame wears it while one finger is
486
+ // down and drops it as a second lands, so a two-finger gesture pans and zooms.
487
+ const start = (event) => {
488
+ const target = event.target;
489
+ const own = target.closest(".react-flow__panel, .react-flow__minimap");
490
+ const drags = editable && target.closest(".react-flow__node, .react-flow__handle");
491
+ if (event.touches.length === 1 && !own && !drags) {
492
+ el.classList.add("nopan");
493
+ from = { x: event.touches[0].clientX, y: event.touches[0].clientY };
494
+ }
495
+ else {
496
+ el.classList.remove("nopan");
497
+ from = null;
498
+ setTouchHint(false);
499
+ }
500
+ };
501
+ const move = (event) => {
502
+ const t = event.touches[0];
503
+ if (!from || !t || event.touches.length > 1)
504
+ return;
505
+ if (Math.hypot(t.clientX - from.x, t.clientY - from.y) < 10)
506
+ return;
507
+ from = null;
508
+ setTouchHint(true);
509
+ clearTimeout(timer);
510
+ timer = setTimeout(() => setTouchHint(false), 1600);
511
+ };
512
+ const end = (event) => {
513
+ if (event.touches.length)
514
+ return;
515
+ el.classList.remove("nopan");
516
+ from = null;
517
+ };
518
+ const options = { capture: true, passive: true };
519
+ el.addEventListener("touchstart", start, options);
520
+ el.addEventListener("touchmove", move, options);
521
+ el.addEventListener("touchend", end, options);
522
+ el.addEventListener("touchcancel", end, options);
523
+ return () => {
524
+ clearTimeout(timer);
525
+ el.classList.remove("nopan");
526
+ el.removeEventListener("touchstart", start, options);
527
+ el.removeEventListener("touchmove", move, options);
528
+ el.removeEventListener("touchend", end, options);
529
+ el.removeEventListener("touchcancel", end, options);
530
+ };
531
+ }, [touchOnly, editable]);
532
+ const direction = directionProp ?? (layout === "tree" || (layout === "flow" && narrow) ? "down" : "right");
444
533
  const flow = useReactFlow();
445
534
  const markers = React.useId().replace(/[^a-zA-Z0-9]/g, "");
446
- const frame = React.useRef(null);
447
535
  const describedBy = `${markers}-connections`;
448
536
  const [state, setState] = React.useState(() => build({ nodes: nodesProp, edges: edgesProp }, layout, direction));
449
537
  const latest = React.useRef(state);
450
538
  latest.current = state;
451
539
  // The value last sent out: when it comes back as props, it is not laid out again.
452
540
  const sent = React.useRef(null);
453
- React.useEffect(() => {
541
+ // Before paint: a flow that turns down in a narrow frame is never drawn the other way first.
542
+ React.useLayoutEffect(() => {
454
543
  if (sent.current && sent.current.nodes === nodesProp && sent.current.edges === edgesProp)
455
544
  return;
456
545
  setState(build({ nodes: nodesProp, edges: edgesProp }, layout, direction));
457
- requestAnimationFrame(() => void flow.fitView({ padding: 0.18, maxZoom: 1.15, duration: 0 }));
458
- }, [nodesProp, edgesProp, layout, direction, flow]);
546
+ requestAnimationFrame(() => void flow.fitView({ ...fitFrame(controls), duration: 0 }));
547
+ }, [nodesProp, edgesProp, layout, direction, flow, controls]);
459
548
  const emit = React.useCallback((next) => {
460
549
  if (!onChange)
461
550
  return;
@@ -609,9 +698,10 @@ function GraphCanvas({ nodes: nodesProp, edges: edgesProp, layout = "flow", dire
609
698
  const value = toValue(from.nodes, from.edges);
610
699
  const next = build({ nodes: value.nodes.map(({ position: _p, size: _s, ...n }) => n), edges: value.edges }, layout, direction);
611
700
  const el = frame.current;
612
- const duration = el ? cssDuration(el) * 3 : 0;
701
+ // Twice --duration: a move the interface makes on its own, ended within 300ms.
702
+ const duration = el ? cssDuration(el) * 2 : 0;
613
703
  // Without motion (reduced motion) the camera jumps too.
614
- const fit = () => requestAnimationFrame(() => void flow.fitView({ padding: 0.18, maxZoom: 1.15, duration: duration ? 280 : 0 }));
704
+ const fit = () => requestAnimationFrame(() => void flow.fitView({ ...fitFrame(controls), duration }));
615
705
  if (!el || !duration) {
616
706
  setState(next);
617
707
  emit(next);
@@ -625,7 +715,8 @@ function GraphCanvas({ nodes: nodesProp, edges: edgesProp, layout = "flow", dire
625
715
  const camera1 = pane
626
716
  ? getViewportForBounds(boxAround(next.nodes.filter((n) => !n.parentId)), pane.clientWidth, pane.clientHeight, 0.2, 1.15, 0.18)
627
717
  : null;
628
- const ease = getComputedStyle(el).getPropertyValue("--ease").trim() || "ease-out";
718
+ // The interface moves the nodes from A to B on its own: ease in and out.
719
+ const ease = cssEase("--ease-move", el);
629
720
  // No keyframes: the animation only keeps the clock; its progress places the nodes.
630
721
  const clock = el.animate([], { duration, easing: ease });
631
722
  let raf = 0;
@@ -672,7 +763,7 @@ function GraphCanvas({ nodes: nodesProp, edges: edgesProp, layout = "flow", dire
672
763
  emit(latest.current);
673
764
  },
674
765
  };
675
- }, [direction, emit, flow, layout]);
766
+ }, [controls, direction, emit, flow, layout]);
676
767
  /* Networks: a dragged node pulls its neighbours along, and the rest settles around it. */
677
768
  const physics = React.useRef(null);
678
769
  const reduce = () => typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
@@ -699,8 +790,21 @@ function GraphCanvas({ nodes: nodesProp, edges: edgesProp, layout = "flow", dire
699
790
  const sizes = new Map(s.nodes.map((n) => [n.id, { w: n.width ?? 0, h: n.height ?? 0 }]));
700
791
  const byId = new Map(sim.map((d) => [d.id, d]));
701
792
  const held = new Set([node.id]);
702
- const step = () => {
703
- simulation.tick();
793
+ // d3-force is tuned for one tick per 60Hz frame: tick by the time that has passed, so a
794
+ // 120Hz screen does not settle twice as fast and a dropped frame does not stall it.
795
+ let last = 0;
796
+ let owed = 0;
797
+ const step = (now) => {
798
+ owed += last ? Math.min(now - last, 50) / TICK_MS : 1;
799
+ last = now;
800
+ // One to three ticks a frame; time beyond that (a long stall) is dropped, not caught up.
801
+ const ticks = Math.min(3, Math.floor(owed));
802
+ owed = ticks === 3 ? 0 : owed - ticks;
803
+ if (!ticks) {
804
+ frame = requestAnimationFrame(step);
805
+ return;
806
+ }
807
+ simulation.tick(ticks);
704
808
  setState((prev) => {
705
809
  const next = {
706
810
  ...prev,
@@ -785,6 +889,44 @@ function GraphCanvas({ nodes: nodesProp, edges: edgesProp, layout = "flow", dire
785
889
  else
786
890
  setTarget({ type: "pane", at: flow.screenToFlowPosition({ x: event.clientX, y: event.clientY }) });
787
891
  };
892
+ /*
893
+ * Moving around from the keyboard, while the focus is on a node, a connection or the canvas
894
+ * (not the controls, the map or a label being edited): the arrows pan the view — 40px, or
895
+ * 160px with Shift — and + and − zoom it. Where a node can move (`editable`) and the focused
896
+ * node is selected, the arrows are React Flow's and move the selection, so the two never clash.
897
+ * Without `editable` the arrows never move a node.
898
+ */
899
+ const onCanvasKey = (event) => {
900
+ if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey)
901
+ return;
902
+ const el = event.target;
903
+ if (el.closest("input, textarea, [contenteditable], .react-flow__panel, .react-flow__minimap"))
904
+ return;
905
+ if (!el.closest(".react-flow") && el !== event.currentTarget)
906
+ return;
907
+ const pan = { ArrowLeft: [1, 0], ArrowRight: [-1, 0], ArrowUp: [0, 1], ArrowDown: [0, -1] }[event.key];
908
+ if (pan) {
909
+ const moving = editable &&
910
+ (el.closest(".react-flow__nodesselection") ||
911
+ el.closest(".react-flow__node")?.classList.contains("selected"));
912
+ if (moving)
913
+ return;
914
+ event.preventDefault();
915
+ // Before React Flow's own handler on the node, which would move it.
916
+ event.stopPropagation();
917
+ const step = event.shiftKey ? 160 : 40;
918
+ const { x, y, zoom } = flow.getViewport();
919
+ void flow.setViewport({ x: x + pan[0] * step, y: y + pan[1] * step, zoom });
920
+ }
921
+ else if (event.key === "+" || event.key === "=") {
922
+ event.preventDefault();
923
+ void flow.zoomIn();
924
+ }
925
+ else if (event.key === "-" || event.key === "_") {
926
+ event.preventDefault();
927
+ void flow.zoomOut();
928
+ }
929
+ };
788
930
  const removeNode = (id) => onNodesChange([{ type: "remove", id }]);
789
931
  const removeEdge = (id) => onEdgesChange([{ type: "remove", id }]);
790
932
  const reverse = (id) => {
@@ -804,22 +946,42 @@ function GraphCanvas({ nodes: nodesProp, edges: edgesProp, layout = "flow", dire
804
946
  emit(next);
805
947
  };
806
948
  const targetEdge = target?.type === "edge" ? state.edges.find((e) => e.id === target.id) : undefined;
949
+ // The nodes the targeted node can be connected to: every other node it isn't yet connected to.
950
+ const connectable = target?.type === "node"
951
+ ? state.nodes.filter((n) => n.type !== "zon-group" &&
952
+ n.id !== target.id &&
953
+ !state.edges.some((e) => (e.source === target.id && e.target === n.id) ||
954
+ (e.source === n.id && e.target === target.id)))
955
+ : [];
807
956
  const stepped = layout === "flow" || layout === "tree";
808
957
  const nodeLabels = React.useMemo(() => new Map(state.nodes.map((n) => [n.id, n.data.node.label])), [state.nodes]);
809
- const canvas = (_jsxs(ReactFlow, { nodes: shown.nodes, edges: shown.edges, nodeTypes: nodeTypes, edgeTypes: edgeTypes, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, onConnect: editable ? onConnect : undefined, onConnectEnd: editable ? onConnectEnd : undefined, onNodeMouseEnter: (_, n) => n.type !== "zon-group" && setHovered(n.id), onNodeMouseLeave: () => setHovered(null), onNodeDragStart: onNodeDragStart, onNodeDrag: onNodeDrag, onNodeDragStop: onNodeDragStop, onSelectionChange: onSelectionChange, nodesConnectable: editable, edgesReconnectable: false, deleteKeyCode: editable ? ["Backspace", "Delete"] : null, connectionLineType: stepped ? ConnectionLineType.SmoothStep : ConnectionLineType.Straight, fitView: true, fitViewOptions: { padding: 0.18, maxZoom: 1.15 }, minZoom: 0.2, maxZoom: 2, proOptions: { hideAttribution: true }, ariaLabelConfig: ariaLabelConfig, "aria-describedby": describedBy, children: [background !== "none" && (_jsx(Background, { variant: background === "lines" ? BackgroundVariant.Lines : BackgroundVariant.Dots, gap: background === "lines" ? 32 : 20, size: 1 })), minimap && (_jsx(MiniMap, { position: "bottom-right", style: { width: 152, height: 100 }, pannable: true, zoomable: true, nodeBorderRadius: 4, ariaLabel: text.minimap })), controls && (_jsx(Panel, { position: "bottom-left", children: _jsx(GraphControls, { text: text, editable: editable, tidy: layout === "none" ? undefined : tidy, add: () => addNode() }) }))] }));
810
- return (_jsx(GraphContext.Provider, { value: context, children: _jsxs("div", { ref: frame, "data-slot": "graph", "data-layout": layout, "data-editable": editable ? "" : undefined, className: cn("relative h-[min(40rem,80svh)] w-full overflow-hidden", variant === "card" ? "surface-card [--card-padding:0]" : "surface-container", className), onKeyDown: (event) => {
811
- // Editable: Enter on a focused node opens its label.
812
- const node = event.target.closest(".react-flow__node");
813
- if (!editable || event.key !== "Enter" || !node?.dataset.id || editing)
958
+ const canvas = (_jsxs(ReactFlow, { nodes: shown.nodes, edges: shown.edges, nodeTypes: nodeTypes, edgeTypes: edgeTypes, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, onConnect: editable ? onConnect : undefined, onConnectEnd: editable ? onConnectEnd : undefined, onNodeMouseEnter: (_, n) => n.type !== "zon-group" && setHovered(n.id), onNodeMouseLeave: () => setHovered(null), onNodeDragStart: onNodeDragStart, onNodeDrag: onNodeDrag, onNodeDragStop: onNodeDragStop, onSelectionChange: onSelectionChange, nodesConnectable: editable, nodesDraggable: editable || !touchOnly, edgesReconnectable: false, deleteKeyCode: editable ? ["Backspace", "Delete"] : null, connectionLineType: stepped ? ConnectionLineType.SmoothStep : ConnectionLineType.Straight, fitView: true, fitViewOptions: fitFrame(controls), minZoom: 0.2, maxZoom: 2, proOptions: { hideAttribution: true }, ariaLabelConfig: ariaLabelConfig, "aria-describedby": describedBy, children: [background !== "none" && (_jsx(Background, { variant: background === "lines" ? BackgroundVariant.Lines : BackgroundVariant.Dots, gap: background === "lines" ? 32 : 20, size: 1 })), minimap && !narrow && (_jsx(MiniMap, { position: "bottom-right", style: { width: 152, height: 100 }, pannable: true, zoomable: true, nodeBorderRadius: 4, ariaLabel: text.minimap })), controls && (_jsx(Panel, { position: "bottom-left", children: _jsx(GraphControls, { text: text, editable: editable, tidy: layout === "none" ? undefined : tidy, add: () => addNode() }) }))] }));
959
+ return (_jsx(GraphContext.Provider, { value: context, children: _jsxs("div", { ref: frame, "data-slot": "graph", "data-layout": layout, "data-editable": editable ? "" : undefined, "data-touch": touchOnly ? "" : undefined, "data-empty": state.nodes.length === 0 ? "" : undefined, className: cn("relative h-[min(40rem,80svh)] w-full overflow-hidden", variant === "card" ? "surface-card [--card-padding:0]" : "surface-container", className), onKeyDownCapture: onCanvasKey, onKeyDown: (event) => {
960
+ // Editable: Enter on a focused node or connection opens its label.
961
+ if (!editable || event.key !== "Enter" || editing)
814
962
  return;
815
- event.preventDefault();
816
- setEditing({ kind: "node", id: node.dataset.id });
817
- }, ...props, children: [_jsx("svg", { "aria-hidden": true, className: "absolute size-0", children: _jsx("defs", { children: ["rest", "lit"].map((tone) => (_jsx("marker", { id: `${markers}-${tone}`, viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "7", markerHeight: "7", orient: "auto-start-reverse", children: _jsx("path", { d: "M1 1.5 L9 5 L1 8.5 Z", "data-tone": tone, className: "zon-graph-arrow" }) }, tone))) }) }), editable ? (_jsxs(ContextMenu, { children: [_jsx(ContextMenuTrigger, { className: "absolute inset-0", onContextMenuCapture: pick, children: canvas }), _jsxs(ContextMenuContent, { children: [target?.type === "pane" && (_jsxs(_Fragment, { children: [_jsxs(ContextMenuGroup, { children: [_jsx(ContextMenuGroupLabel, { children: text.addHere }), addable[layout].map((kind) => (_jsxs(ContextMenuItem, { onClick: () => addNode(target.at, kind), children: [_jsx(PlusIcon, {}), text.kind(kind)] }, kind)))] }), _jsx(ContextMenuSeparator, {}), layout !== "none" && (_jsxs(ContextMenuItem, { onClick: tidy, children: [_jsx(WandSparklesIcon, {}), text.tidy] })), _jsxs(ContextMenuItem, { onClick: () => void flow.fitView({ padding: 0.18, maxZoom: 1.15, duration: 280 }), children: [_jsx(MaximizeIcon, {}), text.fit] })] })), (target?.type === "node" || target?.type === "group") && (_jsxs(_Fragment, { children: [_jsxs(ContextMenuItem, { onClick: () => setEditing({ kind: "node", id: target.id }), children: [_jsx(PencilIcon, {}), text.rename, _jsx(ContextMenuShortcut, { children: text.enterKey })] }), target.type === "node" && (_jsxs(_Fragment, { children: [_jsx(ContextMenuSeparator, {}), _jsxs(ContextMenuItem, { variant: "destructive", onClick: () => removeNode(target.id), children: [_jsx(Trash2Icon, {}), text.delete, _jsx(ContextMenuShortcut, { children: text.deleteKey })] })] }))] })), target?.type === "edge" && (_jsxs(_Fragment, { children: [_jsxs(ContextMenuItem, { onClick: () => setEditing({ kind: "edge", id: target.id }), children: [_jsx(PencilIcon, {}), targetEdge?.data?.edge.label ? text.renameLabel : text.addLabel] }), targetEdge && isDirected(targetEdge.data.edge, layout) && (_jsxs(ContextMenuItem, { onClick: () => reverse(target.id), children: [_jsx(ArrowLeftRightIcon, {}), text.reverse] })), _jsx(ContextMenuSeparator, {}), _jsxs(ContextMenuItem, { variant: "destructive", onClick: () => removeEdge(target.id), children: [_jsx(Trash2Icon, {}), text.removeConnection, _jsx(ContextMenuShortcut, { children: text.deleteKey })] })] }))] })] })) : (canvas), _jsx("ul", { id: describedBy, className: "sr-only", children: state.edges.map((e) => (_jsxs("li", { children: [text.connection(nodeLabels.get(e.source) ?? e.source, nodeLabels.get(e.target) ?? e.target, isDirected(e.data.edge, layout)), e.data.edge.label ? `: ${e.data.edge.label}` : ""] }, e.id))) })] }) }));
963
+ const el = event.target;
964
+ const node = el.closest(".react-flow__node");
965
+ const edge = el.closest(".react-flow__edge");
966
+ if (node?.dataset.id) {
967
+ event.preventDefault();
968
+ setEditing({ kind: "node", id: node.dataset.id });
969
+ }
970
+ else if (edge?.dataset.id) {
971
+ event.preventDefault();
972
+ setEditing({ kind: "edge", id: edge.dataset.id });
973
+ }
974
+ }, ...props, children: [_jsx("svg", { "aria-hidden": true, className: "absolute size-0", children: _jsx("defs", { children: ["rest", "lit"].map((tone) => (_jsx("marker", { id: `${markers}-${tone}`, viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "7", markerHeight: "7", orient: "auto-start-reverse", children: _jsx("path", { d: "M1 1.5 L9 5 L1 8.5 Z", "data-tone": tone, className: "zon-graph-arrow" }) }, tone))) }) }), touchOnly && (_jsx("div", { "aria-hidden": true, "data-slot": "graph-touch-hint", "data-shown": touchHint ? "" : undefined, className: "pointer-events-none absolute inset-x-4 top-1/2 z-10 flex -translate-y-1/2 justify-center opacity-0 transition-opacity duration-(--duration-fade) ease-(--ease) data-shown:opacity-100", children: _jsx("p", { className: "rounded-button material-menu px-3 py-2 text-center text-sm text-foreground", children: text.touchHint }) })), editable ? (_jsxs(ContextMenu, { children: [_jsx(ContextMenuTrigger, { className: "absolute inset-0", onContextMenuCapture: pick, children: canvas }), _jsxs(ContextMenuContent, { children: [target?.type === "pane" && (_jsxs(_Fragment, { children: [_jsxs(ContextMenuGroup, { children: [_jsx(ContextMenuGroupLabel, { children: text.addHere }), addable[layout].map((kind) => (_jsxs(ContextMenuItem, { onClick: () => addNode(target.at, kind), children: [_jsx(PlusIcon, {}), text.kind(kind)] }, kind)))] }), _jsx(ContextMenuSeparator, {}), layout !== "none" && (_jsxs(ContextMenuItem, { onClick: tidy, children: [_jsx(WandSparklesIcon, {}), text.tidy] })), _jsxs(ContextMenuItem, { onClick: () => void flow.fitView({ ...fitFrame(controls), duration: cssDuration() * 2 }), children: [_jsx(MaximizeIcon, {}), text.fit] })] })), (target?.type === "node" || target?.type === "group") && (_jsxs(_Fragment, { children: [_jsxs(ContextMenuItem, { onClick: () => setEditing({ kind: "node", id: target.id }), children: [_jsx(PencilIcon, {}), text.rename, _jsx(ContextMenuShortcut, { children: text.enterKey })] }), target.type === "node" && connectable.length > 0 && (_jsxs(ContextMenuSub, { children: [_jsxs(ContextMenuSubTrigger, { children: [_jsx(ArrowRightIcon, { className: "rtl:-scale-x-100" }), text.connectTo] }), _jsx(ContextMenuSubContent, { children: connectable.map((n) => (_jsx(ContextMenuItem, { onClick: () => onConnect({
975
+ source: target.id,
976
+ target: n.id,
977
+ sourceHandle: null,
978
+ targetHandle: null,
979
+ }), children: n.data.node.label }, n.id))) })] })), target.type === "node" && (_jsxs(_Fragment, { children: [_jsx(ContextMenuSeparator, {}), _jsxs(ContextMenuItem, { variant: "destructive", onClick: () => removeNode(target.id), children: [_jsx(Trash2Icon, {}), text.delete, _jsx(ContextMenuShortcut, { children: text.deleteKey })] })] }))] })), target?.type === "edge" && (_jsxs(_Fragment, { children: [_jsxs(ContextMenuItem, { onClick: () => setEditing({ kind: "edge", id: target.id }), children: [_jsx(PencilIcon, {}), targetEdge?.data?.edge.label ? text.renameLabel : text.addLabel] }), targetEdge && isDirected(targetEdge.data.edge, layout) && (_jsxs(ContextMenuItem, { onClick: () => reverse(target.id), children: [_jsx(ArrowLeftRightIcon, {}), text.reverse] })), _jsx(ContextMenuSeparator, {}), _jsxs(ContextMenuItem, { variant: "destructive", onClick: () => removeEdge(target.id), children: [_jsx(Trash2Icon, {}), text.removeConnection, _jsx(ContextMenuShortcut, { children: text.deleteKey })] })] }))] })] })) : (canvas), state.nodes.length === 0 && (_jsx("div", { "data-slot": "graph-empty", className: "pointer-events-none absolute inset-x-6 top-1/2 z-5 flex -translate-y-1/2 justify-center", children: _jsx("p", { className: "m-0 max-w-sm text-center text-sm text-balance text-muted-foreground", children: emptyMessage ?? (editable ? text.emptyEditable : text.empty) }) })), _jsx("ul", { id: describedBy, className: "sr-only", children: state.edges.map((e) => (_jsxs("li", { children: [text.connection(nodeLabels.get(e.source) ?? e.source, nodeLabels.get(e.target) ?? e.target, isDirected(e.data.edge, layout)), e.data.edge.label ? `: ${e.data.edge.label}` : ""] }, e.id))) })] }) }));
818
980
  }
819
981
  function ControlButton({ label, onClick, children, }) {
820
982
  return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: _jsx(ToolbarButton, { "aria-label": label, onClick: onClick }), children: children }), _jsx(TooltipContent, { side: "top", children: label })] }));
821
983
  }
822
984
  function GraphControls({ text, editable, tidy, add, }) {
823
985
  const flow = useReactFlow();
824
- return (_jsxs(Toolbar, { "aria-label": text.controls, "data-slot": "graph-controls", children: [_jsxs(ToolbarGroup, { children: [_jsx(ControlButton, { label: text.zoomIn, onClick: () => void flow.zoomIn({ duration: 200 }), children: _jsx(PlusIcon, {}) }), _jsx(ControlButton, { label: text.zoomOut, onClick: () => void flow.zoomOut({ duration: 200 }), children: _jsx(MinusIcon, {}) }), _jsx(ControlButton, { label: text.fit, onClick: () => void flow.fitView({ padding: 0.18, maxZoom: 1.15, duration: 280 }), children: _jsx(MaximizeIcon, {}) })] }), (editable || tidy) && _jsx(ToolbarSeparator, {}), _jsxs(ToolbarGroup, { children: [editable && (_jsx(ControlButton, { label: text.addNode, onClick: add, children: _jsx(CircleDotIcon, {}) })), tidy && (_jsx(ControlButton, { label: text.tidy, onClick: tidy, children: _jsx(WandSparklesIcon, {}) }))] })] }));
986
+ return (_jsxs(Toolbar, { "aria-label": text.controls, "data-slot": "graph-controls", children: [_jsxs(ToolbarGroup, { children: [_jsx(ControlButton, { label: text.zoomIn, onClick: () => void flow.zoomIn({ duration: cssDuration() * 2 }), children: _jsx(PlusIcon, {}) }), _jsx(ControlButton, { label: text.zoomOut, onClick: () => void flow.zoomOut({ duration: cssDuration() * 2 }), children: _jsx(MinusIcon, {}) }), _jsx(ControlButton, { label: text.fit, onClick: () => void flow.fitView({ ...fitFrame(true), duration: cssDuration() * 2 }), children: _jsx(MaximizeIcon, {}) })] }), (editable || tidy) && _jsx(ToolbarSeparator, {}), _jsxs(ToolbarGroup, { children: [editable && (_jsx(ControlButton, { label: text.addNode, onClick: add, children: _jsx(CircleDotIcon, {}) })), tidy && (_jsx(ControlButton, { label: text.tidy, onClick: tidy, children: _jsx(WandSparklesIcon, {}) }))] })] }));
825
987
  }
@@ -3,9 +3,9 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
3
3
  import * as React from "react";
4
4
  import { cn } from "../lib/cn.js";
5
5
  import { editorialSource } from "../lib/editorial-assets.js";
6
- import { INLINE_INK } from "../lib/illustration-drawings.js";
7
6
  import { getIllustration, } from "../lib/illustration-library.js";
8
7
  import { mountFigure } from "../lib/figure/kernel.js";
8
+ import { DrawingSvg as DrawingSvgBase } from "./_drawing-svg.js";
9
9
  /* ── Metadata ───────────────────────────────────────────────────────────────── */
10
10
  export { illustrationKinds, illustrations } from "../lib/illustration-info.js";
11
11
  /**
@@ -60,33 +60,8 @@ function IsoFigure({ entry, animate, active, title, className, style, }) {
60
60
  return (_jsx("svg", { ref: ref, "data-slot": "illustration", "data-kind": "iso", "data-name": entry.id, "data-static": animate ? undefined : "", "data-active": active ? "" : undefined, viewBox: "0 0 400 320", fill: "none", role: title ? "img" : undefined, "aria-label": title, "aria-hidden": title ? undefined : true, focusable: "false", className: cn("block aspect-[5/4] h-auto w-full max-w-full overflow-visible select-none", className), style: style }));
61
61
  }
62
62
  /* ── Drawings ───────────────────────────────────────────────────────────────── */
63
- const reactAttr = (k) => k === "class"
64
- ? "className"
65
- : /^(data|aria)-/.test(k)
66
- ? k
67
- : k.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
68
- function toReact(node, key) {
69
- if (!node)
70
- return null;
71
- if (typeof node === "string")
72
- return node;
73
- if (Array.isArray(node))
74
- return node.map((c, i) => toReact(c, i));
75
- const props = { key };
76
- for (const [k, v] of Object.entries(node.attrs)) {
77
- if (v === undefined || v === null || v === false)
78
- continue;
79
- props[reactAttr(k)] = v;
80
- }
81
- return React.createElement(node.tag, props, ...node.children.map((c, i) => toReact(c, i)));
82
- }
83
- function useUid(prefix) {
84
- return prefix + React.useId().replace(/[^a-zA-Z0-9_-]/g, "");
85
- }
86
- function DrawingSvg({ entry, variant, title, className, style, }) {
87
- const uid = useUid(`ep-${entry.name}`);
88
- const d = entry.draw({ uid, ink: INLINE_INK, variant });
89
- return (_jsxs("svg", { "data-slot": "illustration", "data-kind": entry.kind, "data-name": entry.id, "data-variant": variant, viewBox: d.viewBox, preserveAspectRatio: d.preserveAspectRatio ?? "xMidYMid meet", fill: "none", role: title ? "img" : undefined, "aria-label": title, "aria-hidden": title ? undefined : true, focusable: "false", className: cn("block h-auto max-h-full w-full select-none", className), style: style, children: [title && _jsx("title", { children: title }), d.body.map((c, i) => toReact(c, i))] }));
63
+ function DrawingSvg({ entry, variant, ...props }) {
64
+ return _jsx(DrawingSvgBase, { name: entry.name, draw: entry.draw, variant: variant, ...props });
90
65
  }
91
66
  /* ── Sheets ─────────────────────────────────────────────────────────────────── */
92
67
  function SheetFigure({ entry, title, className, style }) {
@@ -114,20 +89,67 @@ function EditorialImage({ entry, priority, title, className, style, }) {
114
89
  function CornerMark({ className }) {
115
90
  return (_jsx("svg", { "aria-hidden": true, focusable: "false", viewBox: "0 0 13 13", className: cn("pointer-events-none absolute z-3 size-[13px] text-(--sheet-mark)", className), children: _jsx("path", { d: "M6.5 0v13M0 6.5h13", stroke: "currentColor", strokeWidth: "1", shapeRendering: "crispEdges" }) }));
116
91
  }
92
+ const sheetLights = new WeakMap();
93
+ /**
94
+ * One frame of a sheet's light: read the pointer against the sheet once, however many moves came
95
+ * in, and close most of the way to it by the time since the last frame — the same at any refresh
96
+ * rate. It eases after the pointer like a light, rather than sticking to it like a cursor, and
97
+ * stops once it is there.
98
+ */
99
+ function stepLight(el, now) {
100
+ const l = sheetLights.get(el);
101
+ if (!l)
102
+ return;
103
+ const rect = el.getBoundingClientRect();
104
+ const tx = rect.width ? ((l.cx - rect.left) / rect.width) * 100 : 0;
105
+ const ty = rect.height ? ((l.cy - rect.top) / rect.height) * 100 : 0;
106
+ if (!l.placed) {
107
+ l.placed = true;
108
+ l.x = tx;
109
+ l.y = ty;
110
+ }
111
+ const dt = l.last ? Math.min(64, now - l.last) : 16;
112
+ l.last = now;
113
+ const k = 1 - Math.exp(-dt / 70);
114
+ l.x += (tx - l.x) * k;
115
+ l.y += (ty - l.y) * k;
116
+ const done = Math.abs(tx - l.x) < 0.05 && Math.abs(ty - l.y) < 0.05;
117
+ if (done) {
118
+ l.x = tx;
119
+ l.y = ty;
120
+ }
121
+ el.style.setProperty("--lx", `${l.x.toFixed(2)}%`);
122
+ el.style.setProperty("--ly", `${l.y.toFixed(2)}%`);
123
+ if (done) {
124
+ l.frame = 0;
125
+ l.last = 0;
126
+ }
127
+ else
128
+ l.frame = requestAnimationFrame((t) => stepLight(el, t));
129
+ }
117
130
  function setLight(event, lit) {
118
131
  const el = event.currentTarget;
119
132
  if (event.pointerType !== "mouse" && event.pointerType !== "pen")
120
133
  return;
121
134
  if (window.matchMedia("(prefers-reduced-motion: reduce)").matches)
122
135
  return;
136
+ let l = sheetLights.get(el);
137
+ if (!l)
138
+ sheetLights.set(el, (l = { x: 0, y: 0, cx: 0, cy: 0, last: 0, frame: 0, placed: false }));
123
139
  if (!lit) {
140
+ // The light fades out where it is; the next entry places it afresh.
141
+ cancelAnimationFrame(l.frame);
142
+ l.frame = 0;
143
+ l.last = 0;
144
+ l.placed = false;
124
145
  el.dataset.lit = "false";
125
146
  return;
126
147
  }
127
- const rect = el.getBoundingClientRect();
128
- el.style.setProperty("--lx", `${(((event.clientX - rect.left) / rect.width) * 100).toFixed(2)}%`);
129
- el.style.setProperty("--ly", `${(((event.clientY - rect.top) / rect.height) * 100).toFixed(2)}%`);
148
+ l.cx = event.clientX;
149
+ l.cy = event.clientY;
130
150
  el.dataset.lit = "true";
151
+ if (!l.frame)
152
+ l.frame = requestAnimationFrame((t) => stepLight(el, t));
131
153
  }
132
154
  /**
133
155
  * SpecSheet — the frame of the `sheet/…` entries, for your own sheets and walls: a square-cornered
@@ -9,13 +9,13 @@ export interface InputGroupMessages {
9
9
  clear: string;
10
10
  }
11
11
  declare module "./locale" {
12
- interface Messages {
12
+ interface LocaleMessages {
13
13
  inputGroup: InputGroupMessages;
14
14
  }
15
15
  }
16
16
  declare const groupSizes: {
17
- readonly sm: "min-h-(--control-h-sm) text-[13px]";
18
- readonly default: "min-h-(--control-h) text-base sm:text-[15px]";
17
+ readonly sm: "min-h-(--control-h-sm) text-13 pointer-coarse:text-base";
18
+ readonly default: "min-h-(--control-h) text-base sm:text-15";
19
19
  };
20
20
  export interface InputGroupProps extends React.ComponentProps<"div"> {
21
21
  /** `sm` (30px) for dense surfaces; `default` (38px) everywhere else. */
@@ -77,7 +77,7 @@ declare const buttonSizes: {
77
77
  /** 24px — fits the dense group, or a quiet action in the default one. */
78
78
  readonly sm: "min-h-(--control-inset-sm) gap-1 rounded-(--input-group-button-radius) px-2 text-xs leading-none";
79
79
  /** 30px — fits the 38px group with a 3px inset, like a segment. */
80
- readonly default: "min-h-(--control-inset) gap-1.5 rounded-(--input-group-button-radius) px-2.5 text-[13px] leading-none";
80
+ readonly default: "min-h-(--control-inset) gap-1.5 rounded-(--input-group-button-radius) px-2.5 text-13 leading-none";
81
81
  readonly "icon-sm": "size-(--control-inset-sm) rounded-full p-0 [&_svg:not([class*='size-'])]:size-[min(14px,calc(var(--control-inset-sm)-4px))]";
82
82
  readonly icon: "size-(--control-inset) rounded-full p-0";
83
83
  };
@@ -104,11 +104,6 @@ export interface InputGroupPasswordToggleProps extends Omit<InputGroupButtonProp
104
104
  * Default "Show password", or `messages.inputGroup.showPassword` from a LocaleProvider.
105
105
  */
106
106
  label?: string;
107
- /** @deprecated A toggle keeps one name: use `label`. Only `show` is read, as that name. */
108
- labels?: {
109
- show?: string;
110
- hide?: string;
111
- };
112
107
  }
113
108
  /**
114
109
  * InputGroupPasswordToggle — the show/hide button for a password: a ghost icon button with an
@@ -118,7 +113,7 @@ export interface InputGroupPasswordToggleProps extends Omit<InputGroupButtonProp
118
113
  * `aria-pressed` while the password is shown — a toggle's name never changes with its state.
119
114
  * Switch the input's `type` with `visible`.
120
115
  */
121
- export declare function InputGroupPasswordToggle({ visible, onVisibleChange, label, labels, ref, onClick, ...props }: InputGroupPasswordToggleProps): React.JSX.Element;
116
+ export declare function InputGroupPasswordToggle({ visible, onVisibleChange, label, ref, onClick, ...props }: InputGroupPasswordToggleProps): React.JSX.Element;
122
117
  export interface InputGroupClearButtonProps extends Omit<InputGroupButtonProps, "variant" | "size" | "children" | "onClick"> {
123
118
  /**
124
119
  * Clear your state (`setQuery("")`). Without it, the button empties the field itself and fires
@@ -132,7 +127,7 @@ export interface InputGroupClearButtonProps extends Omit<InputGroupButtonProps,
132
127
  * InputGroupClearButton — empties the field it sits in, smoothly: the text is erased right to
133
128
  * left behind a soft edge, as if typed away, then the value clears and focus returns to the
134
129
  * field. The button fades out while the field is empty and back in when there is text, instead of
135
- * popping in and out. Reduced motion clears at once.
130
+ * popping in and out. The keyboard (Enter, Space) and reduced motion clear at once.
136
131
  */
137
132
  export declare function InputGroupClearButton({ onClear, label, ref, className, ...props }: InputGroupClearButtonProps): React.JSX.Element;
138
133
  export {};