@zonsh/ui 0.0.0 → 0.2.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 (388) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +75 -1
  3. package/assets/illustrations/drawing/bracket-construction-dark.svg +77 -0
  4. package/assets/illustrations/drawing/bracket-construction-filled-dark.svg +50 -0
  5. package/assets/illustrations/drawing/bracket-construction-filled.svg +50 -0
  6. package/assets/illustrations/drawing/bracket-construction.svg +77 -0
  7. package/assets/illustrations/drawing/crescent-dark.svg +28 -0
  8. package/assets/illustrations/drawing/crescent-guides-dark.svg +33 -0
  9. package/assets/illustrations/drawing/crescent-guides.svg +33 -0
  10. package/assets/illustrations/drawing/crescent.svg +28 -0
  11. package/assets/illustrations/drawing/eclipse-dark.svg +187 -0
  12. package/assets/illustrations/drawing/eclipse-guides-dark.svg +191 -0
  13. package/assets/illustrations/drawing/eclipse-guides.svg +191 -0
  14. package/assets/illustrations/drawing/eclipse.svg +187 -0
  15. package/assets/illustrations/drawing/elevation-guides-dark.svg +31 -0
  16. package/assets/illustrations/drawing/elevation-guides-plain-dark.svg +9 -0
  17. package/assets/illustrations/drawing/elevation-guides-plain.svg +9 -0
  18. package/assets/illustrations/drawing/elevation-guides.svg +31 -0
  19. package/assets/illustrations/drawing/horizon-dark.svg +30 -0
  20. package/assets/illustrations/drawing/horizon.svg +30 -0
  21. package/assets/illustrations/drawing/nib-study-dark.svg +107 -0
  22. package/assets/illustrations/drawing/nib-study-plain-dark.svg +93 -0
  23. package/assets/illustrations/drawing/nib-study-plain.svg +93 -0
  24. package/assets/illustrations/drawing/nib-study.svg +107 -0
  25. package/assets/illustrations/editorial/assistant-640.webp +0 -0
  26. package/assets/illustrations/editorial/assistant.webp +0 -0
  27. package/assets/illustrations/editorial/automation-640.webp +0 -0
  28. package/assets/illustrations/editorial/automation.webp +0 -0
  29. package/assets/illustrations/editorial/bracket-left-640.webp +0 -0
  30. package/assets/illustrations/editorial/bracket-left.webp +0 -0
  31. package/assets/illustrations/editorial/bracket-right-640.webp +0 -0
  32. package/assets/illustrations/editorial/bracket-right.webp +0 -0
  33. package/assets/illustrations/editorial/custom-software-640.webp +0 -0
  34. package/assets/illustrations/editorial/custom-software.webp +0 -0
  35. package/assets/illustrations/editorial/digitalization-640.webp +0 -0
  36. package/assets/illustrations/editorial/digitalization.webp +0 -0
  37. package/assets/illustrations/editorial/integration-640.webp +0 -0
  38. package/assets/illustrations/editorial/integration.webp +0 -0
  39. package/assets/illustrations/editorial/problem-640.webp +0 -0
  40. package/assets/illustrations/editorial/problem.webp +0 -0
  41. package/assets/illustrations/editorial/process-analysis-640.webp +0 -0
  42. package/assets/illustrations/editorial/process-analysis.webp +0 -0
  43. package/assets/illustrations/editorial/process-concept-640.webp +0 -0
  44. package/assets/illustrations/editorial/process-concept.webp +0 -0
  45. package/assets/illustrations/editorial/process-development-640.webp +0 -0
  46. package/assets/illustrations/editorial/process-development.webp +0 -0
  47. package/assets/illustrations/editorial/process-discovery-640.webp +0 -0
  48. package/assets/illustrations/editorial/process-discovery.webp +0 -0
  49. package/assets/illustrations/editorial/process-maintenance-640.webp +0 -0
  50. package/assets/illustrations/editorial/process-maintenance.webp +0 -0
  51. package/assets/illustrations/editorial/process-prototype-640.webp +0 -0
  52. package/assets/illustrations/editorial/process-prototype.webp +0 -0
  53. package/assets/illustrations/editorial/process-testing-640.webp +0 -0
  54. package/assets/illustrations/editorial/process-testing.webp +0 -0
  55. package/assets/illustrations/iso/automation-dark.svg +6 -0
  56. package/assets/illustrations/iso/automation.svg +6 -0
  57. package/assets/illustrations/iso/bar-chart-dark.svg +6 -0
  58. package/assets/illustrations/iso/bar-chart.svg +6 -0
  59. package/assets/illustrations/iso/brackets-classic-dark.svg +6 -0
  60. package/assets/illustrations/iso/brackets-classic.svg +6 -0
  61. package/assets/illustrations/iso/brackets-dark.svg +6 -0
  62. package/assets/illustrations/iso/brackets.svg +6 -0
  63. package/assets/illustrations/iso/city-dark.svg +6 -0
  64. package/assets/illustrations/iso/city.svg +6 -0
  65. package/assets/illustrations/iso/conveyor-dark.svg +6 -0
  66. package/assets/illustrations/iso/conveyor.svg +6 -0
  67. package/assets/illustrations/iso/database-dark.svg +6 -0
  68. package/assets/illustrations/iso/database.svg +6 -0
  69. package/assets/illustrations/iso/documents-dark.svg +6 -0
  70. package/assets/illustrations/iso/documents.svg +6 -0
  71. package/assets/illustrations/iso/inbox-dark.svg +6 -0
  72. package/assets/illustrations/iso/inbox.svg +6 -0
  73. package/assets/illustrations/iso/laptop-dark.svg +6 -0
  74. package/assets/illustrations/iso/laptop.svg +6 -0
  75. package/assets/illustrations/iso/monitor-dark.svg +6 -0
  76. package/assets/illustrations/iso/monitor.svg +6 -0
  77. package/assets/illustrations/iso/pipeline-dark.svg +6 -0
  78. package/assets/illustrations/iso/pipeline.svg +6 -0
  79. package/assets/illustrations/iso/platform-dark.svg +6 -0
  80. package/assets/illustrations/iso/platform.svg +6 -0
  81. package/assets/illustrations/iso/server-dark.svg +6 -0
  82. package/assets/illustrations/iso/server.svg +6 -0
  83. package/assets/illustrations/iso/spreadsheet-dark.svg +6 -0
  84. package/assets/illustrations/iso/spreadsheet.svg +6 -0
  85. package/assets/illustrations/iso/timeline-dark.svg +6 -0
  86. package/assets/illustrations/iso/timeline.svg +6 -0
  87. package/assets/illustrations/sheet/construction.svg +115 -0
  88. package/assets/illustrations/sheet/crescent.svg +40 -0
  89. package/assets/illustrations/sheet/limb.svg +42 -0
  90. package/assets/illustrations/sheet/stress-axis.svg +119 -0
  91. package/assets/illustrations/sheet/totality.svg +215 -0
  92. package/assets/illustrations/sheet/vertical-metrics.svg +43 -0
  93. package/assets/logo-left.svg +1 -0
  94. package/assets/logo-right.svg +1 -0
  95. package/assets/logo.svg +1 -0
  96. package/dist/components/_overlay.d.ts +47 -0
  97. package/dist/components/_overlay.js +59 -0
  98. package/dist/components/accordion.d.ts +32 -0
  99. package/dist/components/accordion.js +39 -0
  100. package/dist/components/alert-dialog.d.ts +45 -0
  101. package/dist/components/alert-dialog.js +56 -0
  102. package/dist/components/alert.d.ts +35 -0
  103. package/dist/components/alert.js +42 -0
  104. package/dist/components/ascii-field.d.ts +34 -0
  105. package/dist/components/ascii-field.js +410 -0
  106. package/dist/components/aspect-ratio.d.ts +14 -0
  107. package/dist/components/aspect-ratio.js +17 -0
  108. package/dist/components/avatar.d.ts +42 -0
  109. package/dist/components/avatar.js +55 -0
  110. package/dist/components/badge.d.ts +70 -0
  111. package/dist/components/badge.js +62 -0
  112. package/dist/components/breadcrumb.d.ts +22 -0
  113. package/dist/components/breadcrumb.js +32 -0
  114. package/dist/components/button-group.d.ts +30 -0
  115. package/dist/components/button-group.js +47 -0
  116. package/dist/components/button.d.ts +53 -0
  117. package/dist/components/button.js +130 -0
  118. package/dist/components/calendar.d.ts +26 -0
  119. package/dist/components/calendar.js +164 -0
  120. package/dist/components/card.d.ts +42 -0
  121. package/dist/components/card.js +76 -0
  122. package/dist/components/carousel.d.ts +90 -0
  123. package/dist/components/carousel.js +213 -0
  124. package/dist/components/chart.d.ts +180 -0
  125. package/dist/components/chart.js +286 -0
  126. package/dist/components/checkbox.d.ts +23 -0
  127. package/dist/components/checkbox.js +43 -0
  128. package/dist/components/code-block.d.ts +45 -0
  129. package/dist/components/code-block.js +58 -0
  130. package/dist/components/code-highlight.d.ts +13 -0
  131. package/dist/components/code-highlight.js +107 -0
  132. package/dist/components/collapsible.d.ts +20 -0
  133. package/dist/components/collapsible.js +32 -0
  134. package/dist/components/color-picker.d.ts +85 -0
  135. package/dist/components/color-picker.js +407 -0
  136. package/dist/components/combobox.d.ts +81 -0
  137. package/dist/components/combobox.js +100 -0
  138. package/dist/components/command.d.ts +112 -0
  139. package/dist/components/command.js +212 -0
  140. package/dist/components/context-menu.d.ts +29 -0
  141. package/dist/components/context-menu.js +35 -0
  142. package/dist/components/conversation.d.ts +27 -0
  143. package/dist/components/conversation.js +293 -0
  144. package/dist/components/copy-button.d.ts +46 -0
  145. package/dist/components/copy-button.js +118 -0
  146. package/dist/components/data-table.d.ts +175 -0
  147. package/dist/components/data-table.js +302 -0
  148. package/dist/components/date-picker.d.ts +91 -0
  149. package/dist/components/date-picker.js +207 -0
  150. package/dist/components/dialog.d.ts +48 -0
  151. package/dist/components/dialog.js +92 -0
  152. package/dist/components/direction.d.ts +16 -0
  153. package/dist/components/direction.js +18 -0
  154. package/dist/components/drawer.d.ts +60 -0
  155. package/dist/components/drawer.js +76 -0
  156. package/dist/components/empty.d.ts +31 -0
  157. package/dist/components/empty.js +50 -0
  158. package/dist/components/feature-list.d.ts +54 -0
  159. package/dist/components/feature-list.js +43 -0
  160. package/dist/components/field.d.ts +15 -0
  161. package/dist/components/field.js +36 -0
  162. package/dist/components/file-drop.d.ts +55 -0
  163. package/dist/components/file-drop.js +197 -0
  164. package/dist/components/filter-bar.d.ts +106 -0
  165. package/dist/components/filter-bar.js +296 -0
  166. package/dist/components/form.d.ts +33 -0
  167. package/dist/components/form.js +34 -0
  168. package/dist/components/graph.d.ts +105 -0
  169. package/dist/components/graph.js +786 -0
  170. package/dist/components/illustration.d.ts +85 -0
  171. package/dist/components/illustration.js +165 -0
  172. package/dist/components/input-group.d.ts +127 -0
  173. package/dist/components/input-group.js +292 -0
  174. package/dist/components/input.d.ts +16 -0
  175. package/dist/components/input.js +25 -0
  176. package/dist/components/item.d.ts +64 -0
  177. package/dist/components/item.js +116 -0
  178. package/dist/components/kbd.d.ts +33 -0
  179. package/dist/components/kbd.js +38 -0
  180. package/dist/components/label.d.ts +12 -0
  181. package/dist/components/label.js +24 -0
  182. package/dist/components/layout.d.ts +136 -0
  183. package/dist/components/layout.js +162 -0
  184. package/dist/components/logo.d.ts +54 -0
  185. package/dist/components/logo.js +96 -0
  186. package/dist/components/menu.d.ts +60 -0
  187. package/dist/components/menu.js +138 -0
  188. package/dist/components/menubar.d.ts +62 -0
  189. package/dist/components/menubar.js +223 -0
  190. package/dist/components/message.d.ts +42 -0
  191. package/dist/components/message.js +56 -0
  192. package/dist/components/meter.d.ts +31 -0
  193. package/dist/components/meter.js +25 -0
  194. package/dist/components/native-select.d.ts +26 -0
  195. package/dist/components/native-select.js +35 -0
  196. package/dist/components/navigation-menu.d.ts +42 -0
  197. package/dist/components/navigation-menu.js +97 -0
  198. package/dist/components/number-field.d.ts +36 -0
  199. package/dist/components/number-field.js +153 -0
  200. package/dist/components/otp-field.d.ts +35 -0
  201. package/dist/components/otp-field.js +94 -0
  202. package/dist/components/pagination.d.ts +31 -0
  203. package/dist/components/pagination.js +70 -0
  204. package/dist/components/pdf-viewer.d.ts +69 -0
  205. package/dist/components/pdf-viewer.js +929 -0
  206. package/dist/components/popover.d.ts +33 -0
  207. package/dist/components/popover.js +48 -0
  208. package/dist/components/preview-card.d.ts +25 -0
  209. package/dist/components/preview-card.js +22 -0
  210. package/dist/components/progress.d.ts +27 -0
  211. package/dist/components/progress.js +23 -0
  212. package/dist/components/prompt-input.d.ts +131 -0
  213. package/dist/components/prompt-input.js +403 -0
  214. package/dist/components/quote.d.ts +22 -0
  215. package/dist/components/quote.js +15 -0
  216. package/dist/components/radio-group.d.ts +18 -0
  217. package/dist/components/radio-group.js +34 -0
  218. package/dist/components/reasoning.d.ts +31 -0
  219. package/dist/components/reasoning.js +70 -0
  220. package/dist/components/resizable.d.ts +38 -0
  221. package/dist/components/resizable.js +41 -0
  222. package/dist/components/response.d.ts +30 -0
  223. package/dist/components/response.js +538 -0
  224. package/dist/components/scroll-area.d.ts +33 -0
  225. package/dist/components/scroll-area.js +31 -0
  226. package/dist/components/select.d.ts +35 -0
  227. package/dist/components/select.js +60 -0
  228. package/dist/components/separator.d.ts +14 -0
  229. package/dist/components/separator.js +17 -0
  230. package/dist/components/sidebar.d.ts +147 -0
  231. package/dist/components/sidebar.js +489 -0
  232. package/dist/components/site-header.d.ts +59 -0
  233. package/dist/components/site-header.js +67 -0
  234. package/dist/components/skeleton.d.ts +31 -0
  235. package/dist/components/skeleton.js +29 -0
  236. package/dist/components/slider.d.ts +24 -0
  237. package/dist/components/slider.js +129 -0
  238. package/dist/components/sources.d.ts +25 -0
  239. package/dist/components/sources.js +35 -0
  240. package/dist/components/spinner.d.ts +36 -0
  241. package/dist/components/spinner.js +72 -0
  242. package/dist/components/suggestions.d.ts +20 -0
  243. package/dist/components/suggestions.js +18 -0
  244. package/dist/components/switch.d.ts +14 -0
  245. package/dist/components/switch.js +26 -0
  246. package/dist/components/table.d.ts +162 -0
  247. package/dist/components/table.js +758 -0
  248. package/dist/components/tabs.d.ts +25 -0
  249. package/dist/components/tabs.js +162 -0
  250. package/dist/components/tag.d.ts +41 -0
  251. package/dist/components/tag.js +88 -0
  252. package/dist/components/tags-input.d.ts +40 -0
  253. package/dist/components/tags-input.js +239 -0
  254. package/dist/components/textarea.d.ts +13 -0
  255. package/dist/components/textarea.js +16 -0
  256. package/dist/components/theme.d.ts +41 -0
  257. package/dist/components/theme.js +112 -0
  258. package/dist/components/time-field.d.ts +51 -0
  259. package/dist/components/time-field.js +437 -0
  260. package/dist/components/timeline.d.ts +76 -0
  261. package/dist/components/timeline.js +99 -0
  262. package/dist/components/toast.d.ts +72 -0
  263. package/dist/components/toast.js +196 -0
  264. package/dist/components/toggle-group.d.ts +41 -0
  265. package/dist/components/toggle-group.js +140 -0
  266. package/dist/components/toggle.d.ts +23 -0
  267. package/dist/components/toggle.js +35 -0
  268. package/dist/components/tool-call.d.ts +52 -0
  269. package/dist/components/tool-call.js +57 -0
  270. package/dist/components/toolbar.d.ts +17 -0
  271. package/dist/components/toolbar.js +34 -0
  272. package/dist/components/tooltip.d.ts +42 -0
  273. package/dist/components/tooltip.js +47 -0
  274. package/dist/components/tree.d.ts +75 -0
  275. package/dist/components/tree.js +636 -0
  276. package/dist/components/typography.d.ts +134 -0
  277. package/dist/components/typography.js +176 -0
  278. package/dist/components/video-player.d.ts +276 -0
  279. package/dist/components/video-player.js +1352 -0
  280. package/dist/components/whiteboard.d.ts +80 -0
  281. package/dist/components/whiteboard.js +389 -0
  282. package/dist/index.d.ts +85 -0
  283. package/dist/index.js +86 -0
  284. package/dist/lib/cn.d.ts +20 -0
  285. package/dist/lib/cn.js +38 -0
  286. package/dist/lib/code-highlight.d.ts +31 -0
  287. package/dist/lib/code-highlight.js +24 -0
  288. package/dist/lib/code-theme.d.ts +19 -0
  289. package/dist/lib/code-theme.js +140 -0
  290. package/dist/lib/collapse-row.d.ts +9 -0
  291. package/dist/lib/collapse-row.js +129 -0
  292. package/dist/lib/digit-roll.d.ts +21 -0
  293. package/dist/lib/digit-roll.js +31 -0
  294. package/dist/lib/editorial-assets.d.ts +16 -0
  295. package/dist/lib/editorial-assets.js +56 -0
  296. package/dist/lib/figure/catalog.d.ts +127 -0
  297. package/dist/lib/figure/catalog.js +130 -0
  298. package/dist/lib/figure/figures/automation.d.ts +7 -0
  299. package/dist/lib/figure/figures/automation.js +143 -0
  300. package/dist/lib/figure/figures/bar-chart.d.ts +7 -0
  301. package/dist/lib/figure/figures/bar-chart.js +99 -0
  302. package/dist/lib/figure/figures/brackets-classic.d.ts +11 -0
  303. package/dist/lib/figure/figures/brackets-classic.js +170 -0
  304. package/dist/lib/figure/figures/brackets.d.ts +8 -0
  305. package/dist/lib/figure/figures/brackets.js +84 -0
  306. package/dist/lib/figure/figures/city.d.ts +7 -0
  307. package/dist/lib/figure/figures/city.js +93 -0
  308. package/dist/lib/figure/figures/conveyor.d.ts +7 -0
  309. package/dist/lib/figure/figures/conveyor.js +97 -0
  310. package/dist/lib/figure/figures/database.d.ts +7 -0
  311. package/dist/lib/figure/figures/database.js +65 -0
  312. package/dist/lib/figure/figures/documents.d.ts +7 -0
  313. package/dist/lib/figure/figures/documents.js +83 -0
  314. package/dist/lib/figure/figures/inbox.d.ts +7 -0
  315. package/dist/lib/figure/figures/inbox.js +92 -0
  316. package/dist/lib/figure/figures/laptop.d.ts +7 -0
  317. package/dist/lib/figure/figures/laptop.js +67 -0
  318. package/dist/lib/figure/figures/monitor.d.ts +7 -0
  319. package/dist/lib/figure/figures/monitor.js +59 -0
  320. package/dist/lib/figure/figures/pipeline.d.ts +8 -0
  321. package/dist/lib/figure/figures/pipeline.js +117 -0
  322. package/dist/lib/figure/figures/platform.d.ts +7 -0
  323. package/dist/lib/figure/figures/platform.js +117 -0
  324. package/dist/lib/figure/figures/server.d.ts +7 -0
  325. package/dist/lib/figure/figures/server.js +115 -0
  326. package/dist/lib/figure/figures/spreadsheet.d.ts +7 -0
  327. package/dist/lib/figure/figures/spreadsheet.js +87 -0
  328. package/dist/lib/figure/figures/timeline.d.ts +7 -0
  329. package/dist/lib/figure/figures/timeline.js +65 -0
  330. package/dist/lib/figure/kernel.d.ts +152 -0
  331. package/dist/lib/figure/kernel.js +576 -0
  332. package/dist/lib/figure/parts.d.ts +42 -0
  333. package/dist/lib/figure/parts.js +126 -0
  334. package/dist/lib/form-reset.d.ts +11 -0
  335. package/dist/lib/form-reset.js +22 -0
  336. package/dist/lib/glide.d.ts +53 -0
  337. package/dist/lib/glide.js +138 -0
  338. package/dist/lib/graph-layout.d.ts +58 -0
  339. package/dist/lib/graph-layout.js +200 -0
  340. package/dist/lib/illustration-drawings.d.ts +89 -0
  341. package/dist/lib/illustration-drawings.js +539 -0
  342. package/dist/lib/illustration-info.d.ts +37 -0
  343. package/dist/lib/illustration-info.js +22 -0
  344. package/dist/lib/illustration-library.d.ts +87 -0
  345. package/dist/lib/illustration-library.js +352 -0
  346. package/dist/lib/logo-geometry.d.ts +29 -0
  347. package/dist/lib/logo-geometry.js +67 -0
  348. package/dist/lib/markdown-guard.d.ts +16 -0
  349. package/dist/lib/markdown-guard.js +123 -0
  350. package/dist/lib/merge-refs.d.ts +10 -0
  351. package/dist/lib/merge-refs.js +26 -0
  352. package/dist/lib/motion.d.ts +6 -0
  353. package/dist/lib/motion.js +12 -0
  354. package/dist/lib/pdf-worker.d.ts +1 -0
  355. package/dist/lib/pdf-worker.js +6 -0
  356. package/dist/lib/pdf.d.ts +19 -0
  357. package/dist/lib/pdf.js +58 -0
  358. package/dist/lib/platform.d.ts +33 -0
  359. package/dist/lib/platform.js +68 -0
  360. package/dist/lib/room.d.ts +25 -0
  361. package/dist/lib/room.js +46 -0
  362. package/dist/lib/table-fit.d.ts +143 -0
  363. package/dist/lib/table-fit.js +577 -0
  364. package/dist/lib/theme-script.d.ts +18 -0
  365. package/dist/lib/theme-script.js +29 -0
  366. package/dist/styles/expressive.css +188 -0
  367. package/dist/styles/fonts.css +145 -0
  368. package/dist/styles/index.css +206 -0
  369. package/dist/styles/material.css +313 -0
  370. package/dist/styles/parts/ai.css +360 -0
  371. package/dist/styles/parts/brand.css +75 -0
  372. package/dist/styles/parts/controls.css +725 -0
  373. package/dist/styles/parts/data.css +222 -0
  374. package/dist/styles/parts/editorial.css +120 -0
  375. package/dist/styles/parts/feedback.css +273 -0
  376. package/dist/styles/parts/foundations.css +166 -0
  377. package/dist/styles/parts/graph.css +214 -0
  378. package/dist/styles/parts/inputs.css +261 -0
  379. package/dist/styles/parts/isometric.css +124 -0
  380. package/dist/styles/parts/navigation.css +232 -0
  381. package/dist/styles/parts/overlays.css +250 -0
  382. package/dist/styles/parts/pdf.css +154 -0
  383. package/dist/styles/parts/react-flow.css +519 -0
  384. package/dist/styles/parts/whiteboard.css +855 -0
  385. package/dist/styles/tokens.css +290 -0
  386. package/dist/vite.d.ts +116 -0
  387. package/dist/vite.js +129 -0
  388. package/package.json +188 -5
@@ -0,0 +1,20 @@
1
+ import { type ClassValue } from "clsx";
2
+ /**
3
+ * A trigger's `data-slot`, left off when it renders another element: that element keeps its own
4
+ * slot and the styles keyed on it — a `ToolbarButton`, `Toggle` or `Switch` inside a `TooltipTrigger`
5
+ * would otherwise lose its material, because our parts spread incoming props over their slot.
6
+ */
7
+ export declare function triggerSlot(slot: string, render: unknown): {
8
+ "data-slot"?: string;
9
+ };
10
+ /** Merge class names; later Tailwind classes win over earlier ones. */
11
+ export declare function cn(...inputs: ClassValue[]): string;
12
+ /** Base UI parts accept `className` as a string or `(state) => string`. */
13
+ export type StateClassName<S> = string | ((state: S) => string | undefined) | undefined;
14
+ /**
15
+ * Compose our classes with a consumer's `className` (string or state function) into the
16
+ * function form Base UI accepts. Consumer classes always win.
17
+ *
18
+ * className={sx("material-raised px-4", className)}
19
+ */
20
+ export declare function sx<S>(base: ClassValue, className?: StateClassName<S>): (state: S) => string;
package/dist/lib/cn.js ADDED
@@ -0,0 +1,38 @@
1
+ import { clsx } from "clsx";
2
+ import { extendTailwindMerge } from "tailwind-merge";
3
+ const twMerge = extendTailwindMerge({
4
+ extend: {
5
+ classGroups: {
6
+ material: [
7
+ "material-primary",
8
+ "material-raised",
9
+ "material-row",
10
+ "material-field",
11
+ "material-menu",
12
+ "surface-container",
13
+ "surface-card",
14
+ ],
15
+ },
16
+ },
17
+ });
18
+ /**
19
+ * A trigger's `data-slot`, left off when it renders another element: that element keeps its own
20
+ * slot and the styles keyed on it — a `ToolbarButton`, `Toggle` or `Switch` inside a `TooltipTrigger`
21
+ * would otherwise lose its material, because our parts spread incoming props over their slot.
22
+ */
23
+ export function triggerSlot(slot, render) {
24
+ return render ? {} : { "data-slot": slot };
25
+ }
26
+ /** Merge class names; later Tailwind classes win over earlier ones. */
27
+ export function cn(...inputs) {
28
+ return twMerge(clsx(inputs));
29
+ }
30
+ /**
31
+ * Compose our classes with a consumer's `className` (string or state function) into the
32
+ * function form Base UI accepts. Consumer classes always win.
33
+ *
34
+ * className={sx("material-raised px-4", className)}
35
+ */
36
+ export function sx(base, className) {
37
+ return (state) => cn(base, typeof className === "function" ? className(state) : className);
38
+ }
@@ -0,0 +1,31 @@
1
+ import * as React from "react";
2
+ /** One run of source text in one colour, as the highlighter splits a line. */
3
+ export interface CodeToken {
4
+ content: string;
5
+ /** A CSS colour — in the zon theme a `var(--code-…)` that follows light and dark. */
6
+ color?: string;
7
+ /** Italic, bold and underline as Shiki's FontStyle bit flags (1, 2, 4). */
8
+ fontStyle?: number;
9
+ }
10
+ /**
11
+ * What CodeBlock needs from a highlighter: a way to load a language, then to split code into
12
+ * coloured tokens synchronously, so a block that changes on every frame (a streaming reply)
13
+ * colours as it renders. `@zonsh/ui/code-highlight` supplies one, on Shiki; the main entry only
14
+ * knows this shape, so it never pulls Shiki in.
15
+ */
16
+ export interface CodeHighlighter {
17
+ /** Resolves `true` once `language` can be tokenised, `false` if it is unknown. */
18
+ load(language: string): Promise<boolean>;
19
+ /** The code as lines of tokens, or `null` while `language` is not loaded. */
20
+ tokenize(code: string, language: string): CodeToken[][] | null;
21
+ }
22
+ export declare const CodeHighlighterContext: React.Context<CodeHighlighter | null>;
23
+ /**
24
+ * The tokens for `code` once its language has loaded, and `null` until then (or when there is no
25
+ * highlighter, no language, or `enabled` is false), so the block shows plain mono meanwhile.
26
+ * `pending` is true while colours are on their way, false once they are in or never will be.
27
+ */
28
+ export declare function useCodeTokens(code: string, language: string | undefined, enabled: boolean): {
29
+ tokens: CodeToken[][] | null;
30
+ pending: boolean;
31
+ };
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ export const CodeHighlighterContext = React.createContext(null);
3
+ /**
4
+ * The tokens for `code` once its language has loaded, and `null` until then (or when there is no
5
+ * highlighter, no language, or `enabled` is false), so the block shows plain mono meanwhile.
6
+ * `pending` is true while colours are on their way, false once they are in or never will be.
7
+ */
8
+ export function useCodeTokens(code, language, enabled) {
9
+ const highlighter = React.useContext(CodeHighlighterContext);
10
+ const [loaded, setLoaded] = React.useState(null);
11
+ const [failed, setFailed] = React.useState(null);
12
+ React.useEffect(() => {
13
+ if (!enabled || !highlighter || !language)
14
+ return;
15
+ let live = true;
16
+ highlighter.load(language).then((ok) => live && (ok ? setLoaded(language) : setFailed(language)), () => live && setFailed(language));
17
+ return () => {
18
+ live = false;
19
+ };
20
+ }, [enabled, highlighter, language]);
21
+ const tokens = React.useMemo(() => (enabled && highlighter && language && loaded === language ? highlighter.tokenize(code, language) : null), [enabled, loaded, language, highlighter, code]);
22
+ const pending = enabled && highlighter != null && !!language && loaded !== language && failed !== language;
23
+ return { tokens, pending };
24
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The zon code theme for Shiki, to render highlighted HTML yourself (e.g. on the server with
3
+ * `codeToHtml`). Its colours are `var(--code-…)`; the stylesheet sets them on CodeBlock and on any
4
+ * `pre.shiki`, so Shiki's own output takes them too.
5
+ */
6
+ export declare const zonCodeTheme: {
7
+ name: string;
8
+ type: "light" | "dark";
9
+ fg: string;
10
+ bg: string;
11
+ settings: {
12
+ scope?: string[];
13
+ settings: {
14
+ foreground?: string;
15
+ background?: string;
16
+ fontStyle?: string;
17
+ };
18
+ }[];
19
+ };
@@ -0,0 +1,140 @@
1
+ /*
2
+ * The zon code theme. Its colours are custom properties, not hex values, so one theme follows
3
+ * light and dark: --code-* map to the category tones in the stylesheet (foundations.css). Each tone is
4
+ * one kind of token — keywords violet, strings lime, numbers and constants orange, functions
5
+ * blue, types aqua, tags magenta — and added and removed lines take the status colours.
6
+ *
7
+ * Plain data in a plain module, so the package index can name it for server components (the
8
+ * CodeHighlightProvider module, which exports it too, is a client module). Its type is spelled
9
+ * out rather than taken from Shiki, so the index needs no Shiki.
10
+ */
11
+ const v = (name) => `var(--code-${name})`;
12
+ /**
13
+ * The zon code theme for Shiki, to render highlighted HTML yourself (e.g. on the server with
14
+ * `codeToHtml`). Its colours are `var(--code-…)`; the stylesheet sets them on CodeBlock and on any
15
+ * `pre.shiki`, so Shiki's own output takes them too.
16
+ */
17
+ export const zonCodeTheme = {
18
+ name: "zon",
19
+ type: "light",
20
+ fg: v("foreground"),
21
+ bg: "transparent",
22
+ settings: [
23
+ { settings: { foreground: v("foreground"), background: "transparent" } },
24
+ {
25
+ scope: ["comment", "punctuation.definition.comment", "string.quoted.docstring"],
26
+ settings: { foreground: v("comment") },
27
+ },
28
+ {
29
+ scope: [
30
+ "keyword",
31
+ "storage",
32
+ "storage.type",
33
+ "storage.modifier",
34
+ "keyword.operator.new",
35
+ "keyword.operator.expression",
36
+ "keyword.operator.logical.python",
37
+ "variable.language.this",
38
+ "variable.language.super",
39
+ ],
40
+ settings: { foreground: v("keyword") },
41
+ },
42
+ {
43
+ scope: ["keyword.operator", "punctuation", "meta.brace", "meta.delimiter"],
44
+ settings: { foreground: v("punctuation") },
45
+ },
46
+ {
47
+ scope: [
48
+ "string",
49
+ "string.template",
50
+ "markup.inline.raw",
51
+ "markup.raw",
52
+ "punctuation.definition.string",
53
+ ],
54
+ settings: { foreground: v("string") },
55
+ },
56
+ {
57
+ scope: [
58
+ "punctuation.definition.template-expression",
59
+ "punctuation.section.embedded",
60
+ "string.regexp",
61
+ "constant.character.escape",
62
+ ],
63
+ settings: { foreground: v("string-expression") },
64
+ },
65
+ {
66
+ scope: [
67
+ "constant",
68
+ "constant.numeric",
69
+ "constant.language",
70
+ "constant.character",
71
+ "support.constant",
72
+ "variable.other.constant",
73
+ "variable.other.enummember",
74
+ ],
75
+ settings: { foreground: v("constant") },
76
+ },
77
+ {
78
+ scope: [
79
+ "entity.name.function",
80
+ "support.function",
81
+ "meta.function-call entity.name.function",
82
+ "variable.function",
83
+ ],
84
+ settings: { foreground: v("function") },
85
+ },
86
+ {
87
+ scope: [
88
+ "entity.name.type",
89
+ "entity.name.class",
90
+ "entity.name.namespace",
91
+ "entity.other.inherited-class",
92
+ "support.type",
93
+ "support.class",
94
+ "meta.type.annotation entity.name.type",
95
+ "storage.type.primitive",
96
+ ],
97
+ settings: { foreground: v("type") },
98
+ },
99
+ {
100
+ scope: [
101
+ "entity.name.tag",
102
+ "support.class.component",
103
+ "punctuation.definition.tag",
104
+ "entity.name.tag.css",
105
+ ],
106
+ settings: { foreground: v("tag") },
107
+ },
108
+ {
109
+ scope: [
110
+ "entity.other.attribute-name",
111
+ "support.type.property-name",
112
+ "meta.object-literal.key",
113
+ "support.type.property-name.json",
114
+ "entity.other.attribute-name.class.css",
115
+ "entity.other.attribute-name.id.css",
116
+ ],
117
+ settings: { foreground: v("attribute") },
118
+ },
119
+ {
120
+ scope: ["variable", "variable.parameter", "variable.other.property", "meta.definition.variable"],
121
+ settings: { foreground: v("foreground") },
122
+ },
123
+ { scope: ["markup.heading", "entity.name.section"], settings: { foreground: v("function") } },
124
+ { scope: ["markup.bold"], settings: { fontStyle: "bold" } },
125
+ { scope: ["markup.italic"], settings: { fontStyle: "italic" } },
126
+ {
127
+ scope: ["markup.underline.link", "string.other.link"],
128
+ settings: { foreground: v("string-expression") },
129
+ },
130
+ {
131
+ scope: ["markup.inserted", "punctuation.definition.inserted"],
132
+ settings: { foreground: v("inserted") },
133
+ },
134
+ { scope: ["markup.deleted", "punctuation.definition.deleted"], settings: { foreground: v("deleted") } },
135
+ {
136
+ scope: ["markup.changed", "meta.diff.range", "meta.diff.header"],
137
+ settings: { foreground: v("comment") },
138
+ },
139
+ ],
140
+ };
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Whether a collapsible button should show only its icon now. Joins the button's row while
4
+ * `enabled`; `ready` turns true after the first decision, so the first one is drawn without motion.
5
+ */
6
+ export declare function useCollapsible(ref: React.RefObject<HTMLElement | null>, enabled: boolean): {
7
+ collapsed: boolean;
8
+ ready: boolean;
9
+ };
@@ -0,0 +1,129 @@
1
+ import * as React from "react";
2
+ const rows = new Map();
3
+ const px = (value) => {
4
+ const n = Number.parseFloat(value);
5
+ return Number.isFinite(n) ? n : 0;
6
+ };
7
+ /** A length from a custom property: px or rem. */
8
+ const length = (value) => {
9
+ const v = value.trim();
10
+ if (v.endsWith("rem"))
11
+ return px(v) * px(getComputedStyle(document.documentElement).fontSize);
12
+ return px(v);
13
+ };
14
+ /** The room the row's children ask for: fixed children at their width, growing ones at their min. */
15
+ function contentWidth(row) {
16
+ const children = [...row.children].filter((child) => {
17
+ if (!(child instanceof HTMLElement))
18
+ return false;
19
+ const style = getComputedStyle(child);
20
+ return style.display !== "none" && style.position !== "absolute" && style.position !== "fixed";
21
+ });
22
+ const style = getComputedStyle(row);
23
+ const gap = px(style.columnGap) * Math.max(0, children.length - 1);
24
+ return (gap +
25
+ children.reduce((sum, child) => {
26
+ const s = getComputedStyle(child);
27
+ return (sum +
28
+ (px(s.flexGrow) > 0
29
+ ? Math.max(px(s.minWidth), length(s.getPropertyValue("--collapse-min")))
30
+ : child.getBoundingClientRect().width));
31
+ }, 0));
32
+ }
33
+ const settled = (el) => el.getAnimations({ subtree: true }).length === 0;
34
+ function layout(row) {
35
+ row.frame = 0;
36
+ const members = [...row.members].sort((a, b) => a.el.compareDocumentPosition(b.el) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1);
37
+ for (const m of members) {
38
+ if (!m.collapsed && settled(m.el))
39
+ m.full = m.el.getBoundingClientRect().width;
40
+ }
41
+ const style = getComputedStyle(row.el);
42
+ const room = row.el.clientWidth - px(style.paddingLeft) - px(style.paddingRight);
43
+ // Everything expanded: today's content with each button's live width swapped for its full one.
44
+ let excess = contentWidth(row.el) +
45
+ members.reduce((sum, m) => sum + m.full - m.el.getBoundingClientRect().width, 0) -
46
+ room;
47
+ const next = new Map();
48
+ for (const m of [...members].reverse()) {
49
+ const compact = m.el.getBoundingClientRect().height;
50
+ const fold = excess > 0.5;
51
+ next.set(m, fold);
52
+ if (fold)
53
+ excess -= Math.max(0, m.full - compact);
54
+ }
55
+ row.el.toggleAttribute("data-collapse-overflow", excess > 0.5);
56
+ for (const [m, fold] of next) {
57
+ if (m.collapsed !== fold) {
58
+ m.collapsed = fold;
59
+ m.set(fold);
60
+ }
61
+ }
62
+ }
63
+ function schedule(row) {
64
+ if (!row.frame)
65
+ row.frame = requestAnimationFrame(() => layout(row));
66
+ }
67
+ function join(el, member) {
68
+ const rowEl = el.parentElement?.closest("[data-collapse-row]") ?? el.parentElement;
69
+ if (!rowEl)
70
+ return () => { };
71
+ let row = rows.get(rowEl);
72
+ if (!row) {
73
+ const created = {
74
+ el: rowEl,
75
+ members: new Set(),
76
+ observer: new ResizeObserver(() => schedule(created)),
77
+ frame: 0,
78
+ };
79
+ created.observer.observe(rowEl);
80
+ rows.set(rowEl, created);
81
+ row = created;
82
+ }
83
+ const current = row;
84
+ current.members.add(member);
85
+ // A button's own size changes too (a font loading, a new label): measure again.
86
+ current.observer.observe(el);
87
+ // The first decision lands before the first paint, so a tight row never animates on load.
88
+ layout(current);
89
+ return () => {
90
+ current.members.delete(member);
91
+ current.observer.unobserve(el);
92
+ if (current.members.size === 0) {
93
+ rowEl.removeAttribute("data-collapse-overflow");
94
+ current.observer.disconnect();
95
+ cancelAnimationFrame(current.frame);
96
+ rows.delete(rowEl);
97
+ }
98
+ else
99
+ schedule(current);
100
+ };
101
+ }
102
+ /**
103
+ * Whether a collapsible button should show only its icon now. Joins the button's row while
104
+ * `enabled`; `ready` turns true after the first decision, so the first one is drawn without motion.
105
+ */
106
+ export function useCollapsible(ref, enabled) {
107
+ const [collapsed, setCollapsed] = React.useState(false);
108
+ const [ready, setReady] = React.useState(false);
109
+ React.useLayoutEffect(() => {
110
+ const el = ref.current;
111
+ if (!enabled || !el)
112
+ return;
113
+ const member = {
114
+ el,
115
+ set: setCollapsed,
116
+ collapsed: false,
117
+ full: el.getBoundingClientRect().width,
118
+ };
119
+ const leave = join(el, member);
120
+ const frame = requestAnimationFrame(() => setReady(true));
121
+ return () => {
122
+ cancelAnimationFrame(frame);
123
+ leave();
124
+ setCollapsed(false);
125
+ setReady(false);
126
+ };
127
+ }, [enabled, ref]);
128
+ return { collapsed: enabled && collapsed, ready };
129
+ }
@@ -0,0 +1,21 @@
1
+ import * as React from "react";
2
+ /** One step to animate: the text before and after it, and which way the digits travel. */
3
+ export type Roll = {
4
+ from: string;
5
+ to: string;
6
+ dir: 1 | -1;
7
+ key: number;
8
+ };
9
+ export declare const reducedMotion: () => boolean;
10
+ /**
11
+ * The digit roll drawn over a value while a step animates (aria-hidden; the element underneath
12
+ * keeps the value and the accessible name). The two values are lined up from the right, so units,
13
+ * tens and hundreds meet their own places; only characters that differ move. Shared by NumberField
14
+ * and TimeField; the keyframes live in parts/inputs.css, keyed on the `slot`.
15
+ */
16
+ export declare function DigitRoll({ roll, slot, className, onDone, }: {
17
+ roll: Roll;
18
+ slot: "number-field-roll" | "time-field-roll";
19
+ className?: string;
20
+ onDone: () => void;
21
+ }): React.JSX.Element;
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "./cn.js";
4
+ export const reducedMotion = () => typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
5
+ /**
6
+ * The digit roll drawn over a value while a step animates (aria-hidden; the element underneath
7
+ * keeps the value and the accessible name). The two values are lined up from the right, so units,
8
+ * tens and hundreds meet their own places; only characters that differ move. Shared by NumberField
9
+ * and TimeField; the keyframes live in parts/inputs.css, keyed on the `slot`.
10
+ */
11
+ export function DigitRoll({ roll, slot, className, onDone, }) {
12
+ const width = Math.max(roll.from.length, roll.to.length);
13
+ const from = roll.from.padStart(width, " ");
14
+ const to = roll.to.padStart(width, " ");
15
+ React.useEffect(() => {
16
+ // A fallback for when no animation runs (or its end event is missed).
17
+ const t = setTimeout(onDone, 1000);
18
+ return () => clearTimeout(t);
19
+ }, [onDone]);
20
+ return (_jsx("span", { "aria-hidden": true, "data-slot": slot,
21
+ // One flex item per character: in a right-to-left page they would line up backwards.
22
+ dir: "ltr", className: cn("pointer-events-none absolute inset-0 flex items-center justify-center overflow-hidden font-mono whitespace-pre text-foreground tabular-nums", className), style: { "--roll-dir": roll.dir }, onAnimationEnd: (e) => {
23
+ if (e.target.hasAttribute("data-new"))
24
+ onDone();
25
+ }, children: [...to].map((next, i) => {
26
+ const prev = from[i];
27
+ if (prev === next)
28
+ return _jsx("span", { children: next }, i);
29
+ return (_jsxs("span", { "data-roll": "", "data-grow": prev === " " ? "" : undefined, "data-shrink": next === " " ? "" : undefined, children: [_jsx("span", { "data-old": "", children: prev }), _jsx("span", { "data-new": "", children: next })] }, i));
30
+ }) }));
31
+ }
@@ -0,0 +1,16 @@
1
+ import type { EditorialName } from "./illustration-library.js";
2
+ export interface EditorialAsset {
3
+ /** The 1254px file. */
4
+ src: string;
5
+ /** The 640px file, for 1x displays. */
6
+ small: string;
7
+ /** Pixel widths for `srcSet`, when the files are not the square 1254 / 640. */
8
+ width?: number;
9
+ smallWidth?: number;
10
+ }
11
+ export declare const EDITORIAL_ASSETS: Record<EditorialName, EditorialAsset>;
12
+ /** `src` and `srcSet` for an editorial entry, from its name. */
13
+ export declare function editorialSource(name: EditorialName): {
14
+ src: string;
15
+ srcSet: string;
16
+ };
@@ -0,0 +1,56 @@
1
+ const assistant = new URL("../../assets/illustrations/editorial/assistant.webp", import.meta.url).href;
2
+ const assistantSmall = new URL("../../assets/illustrations/editorial/assistant-640.webp", import.meta.url).href;
3
+ const automation = new URL("../../assets/illustrations/editorial/automation.webp", import.meta.url).href;
4
+ const automationSmall = new URL("../../assets/illustrations/editorial/automation-640.webp", import.meta.url).href;
5
+ const bracketLeft = new URL("../../assets/illustrations/editorial/bracket-left.webp", import.meta.url).href;
6
+ const bracketLeftSmall = new URL("../../assets/illustrations/editorial/bracket-left-640.webp", import.meta.url).href;
7
+ const bracketRight = new URL("../../assets/illustrations/editorial/bracket-right.webp", import.meta.url).href;
8
+ const bracketRightSmall = new URL("../../assets/illustrations/editorial/bracket-right-640.webp", import.meta.url).href;
9
+ const customSoftware = new URL("../../assets/illustrations/editorial/custom-software.webp", import.meta.url).href;
10
+ const customSoftwareSmall = new URL("../../assets/illustrations/editorial/custom-software-640.webp", import.meta.url).href;
11
+ const digitalization = new URL("../../assets/illustrations/editorial/digitalization.webp", import.meta.url).href;
12
+ const digitalizationSmall = new URL("../../assets/illustrations/editorial/digitalization-640.webp", import.meta.url).href;
13
+ const integration = new URL("../../assets/illustrations/editorial/integration.webp", import.meta.url).href;
14
+ const integrationSmall = new URL("../../assets/illustrations/editorial/integration-640.webp", import.meta.url).href;
15
+ const problem = new URL("../../assets/illustrations/editorial/problem.webp", import.meta.url).href;
16
+ const problemSmall = new URL("../../assets/illustrations/editorial/problem-640.webp", import.meta.url).href;
17
+ const processAnalysis = new URL("../../assets/illustrations/editorial/process-analysis.webp", import.meta.url).href;
18
+ const processAnalysisSmall = new URL("../../assets/illustrations/editorial/process-analysis-640.webp", import.meta.url).href;
19
+ const processConcept = new URL("../../assets/illustrations/editorial/process-concept.webp", import.meta.url).href;
20
+ const processConceptSmall = new URL("../../assets/illustrations/editorial/process-concept-640.webp", import.meta.url).href;
21
+ const processDevelopment = new URL("../../assets/illustrations/editorial/process-development.webp", import.meta.url).href;
22
+ const processDevelopmentSmall = new URL("../../assets/illustrations/editorial/process-development-640.webp", import.meta.url).href;
23
+ const processDiscovery = new URL("../../assets/illustrations/editorial/process-discovery.webp", import.meta.url).href;
24
+ const processDiscoverySmall = new URL("../../assets/illustrations/editorial/process-discovery-640.webp", import.meta.url).href;
25
+ const processMaintenance = new URL("../../assets/illustrations/editorial/process-maintenance.webp", import.meta.url).href;
26
+ const processMaintenanceSmall = new URL("../../assets/illustrations/editorial/process-maintenance-640.webp", import.meta.url).href;
27
+ const processPrototype = new URL("../../assets/illustrations/editorial/process-prototype.webp", import.meta.url).href;
28
+ const processPrototypeSmall = new URL("../../assets/illustrations/editorial/process-prototype-640.webp", import.meta.url).href;
29
+ const processTesting = new URL("../../assets/illustrations/editorial/process-testing.webp", import.meta.url).href;
30
+ const processTestingSmall = new URL("../../assets/illustrations/editorial/process-testing-640.webp", import.meta.url).href;
31
+ export const EDITORIAL_ASSETS = {
32
+ assistant: { src: assistant, small: assistantSmall },
33
+ automation: { src: automation, small: automationSmall },
34
+ "bracket-left": { src: bracketLeft, small: bracketLeftSmall, width: 383, smallWidth: 251 },
35
+ "bracket-right": { src: bracketRight, small: bracketRightSmall, width: 387, smallWidth: 254 },
36
+ "custom-software": { src: customSoftware, small: customSoftwareSmall },
37
+ digitalization: { src: digitalization, small: digitalizationSmall },
38
+ integration: { src: integration, small: integrationSmall },
39
+ problem: { src: problem, small: problemSmall },
40
+ "process-analysis": { src: processAnalysis, small: processAnalysisSmall },
41
+ "process-concept": { src: processConcept, small: processConceptSmall },
42
+ "process-development": { src: processDevelopment, small: processDevelopmentSmall },
43
+ "process-discovery": { src: processDiscovery, small: processDiscoverySmall },
44
+ "process-maintenance": { src: processMaintenance, small: processMaintenanceSmall },
45
+ "process-prototype": { src: processPrototype, small: processPrototypeSmall },
46
+ "process-testing": { src: processTesting, small: processTestingSmall },
47
+ };
48
+ /** `src` and `srcSet` for an editorial entry, from its name. */
49
+ export function editorialSource(name) {
50
+ // Every editorial entry is listed above; the record is typed by `EditorialName`.
51
+ const asset = EDITORIAL_ASSETS[name];
52
+ return {
53
+ src: asset.src,
54
+ srcSet: `${asset.small} ${asset.smallWidth ?? 640}w, ${asset.src} ${asset.width ?? 1254}w`,
55
+ };
56
+ }