@krizaka/ui 4.5.0 → 4.7.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 (248) hide show
  1. package/README.md +1 -0
  2. package/dist/account-settings.js +56 -43
  3. package/dist/account-settings.js.map +1 -1
  4. package/dist/architecture-diagram.d.ts +46 -0
  5. package/dist/architecture-diagram.js +324 -0
  6. package/dist/architecture-diagram.js.map +1 -0
  7. package/dist/argument-card.js +3 -3
  8. package/dist/blocks.css +33 -0
  9. package/dist/{chunk-CZHPWLNW.js → chunk-WKQ5CB3I.js} +18 -5
  10. package/dist/chunk-WKQ5CB3I.js.map +1 -0
  11. package/dist/columns.js +3 -1
  12. package/dist/columns.js.map +1 -1
  13. package/dist/comparison-table.js +3 -3
  14. package/dist/comparison-table.js.map +1 -1
  15. package/dist/filter-bar.d.ts +3 -3
  16. package/dist/kind-config-editor.js +1 -1
  17. package/dist/language-switch.d.ts +9 -9
  18. package/dist/map.d.ts +6 -6
  19. package/dist/nav-bar.d.ts +1 -1
  20. package/dist/notification-preferences.js +1 -1
  21. package/dist/router.js +2 -2
  22. package/dist/router.js.map +1 -1
  23. package/dist/{schema-Dd05m48Q.d.ts → schema-Dkn0uX72.d.ts} +1 -1
  24. package/dist/schema-form.js +1 -1
  25. package/dist/shop-composer.d.ts +2 -2
  26. package/dist/shop.d.ts +2 -2
  27. package/dist/site-cahier.d.ts +2 -0
  28. package/dist/site-cahier.js +2 -1
  29. package/dist/site-cahier.js.map +1 -1
  30. package/dist/site-footer.d.ts +52 -6
  31. package/dist/site-footer.js +98 -60
  32. package/dist/site-footer.js.map +1 -1
  33. package/dist/{sites-iJkCPeiH.d.ts → sites-BPshUouf.d.ts} +2 -2
  34. package/dist/switch.d.ts +25 -3
  35. package/dist/switch.js +1 -1
  36. package/dist/virtual.d.ts +3 -3
  37. package/package.json +30 -11
  38. package/registry/account-menu.json +1 -1
  39. package/registry/account-settings.json +1 -1
  40. package/registry/achievement.json +1 -1
  41. package/registry/action-bar.json +1 -1
  42. package/registry/activity-feed.json +1 -1
  43. package/registry/agenda.json +1 -1
  44. package/registry/alert.json +1 -1
  45. package/registry/analysis-report.json +1 -1
  46. package/registry/anatomy-plate.json +1 -1
  47. package/registry/app-frame.json +2 -2
  48. package/registry/app-header.json +1 -1
  49. package/registry/app-shell.json +1 -1
  50. package/registry/architecture-diagram.json +239 -0
  51. package/registry/argument-card.json +1 -1
  52. package/registry/auth-layout.json +1 -1
  53. package/registry/avatar.json +1 -1
  54. package/registry/badge.json +1 -1
  55. package/registry/bird-plate.json +1 -1
  56. package/registry/button.json +1 -1
  57. package/registry/captcha.json +1 -1
  58. package/registry/card-grid.json +1 -1
  59. package/registry/card.json +1 -1
  60. package/registry/catalogue-page.json +1 -1
  61. package/registry/changelog-page.json +1 -1
  62. package/registry/chapter.json +1 -1
  63. package/registry/chat.json +1 -1
  64. package/registry/checkbox.json +1 -1
  65. package/registry/chip-link.json +1 -1
  66. package/registry/chip-row.json +1 -1
  67. package/registry/chip.json +1 -1
  68. package/registry/choice-grid.json +1 -1
  69. package/registry/code-block.json +1 -1
  70. package/registry/collection-switcher.json +1 -1
  71. package/registry/columns.json +2 -2
  72. package/registry/combobox.json +1 -1
  73. package/registry/command.json +1 -1
  74. package/registry/comparison-table.json +2 -2
  75. package/registry/component-page.json +1 -1
  76. package/registry/confirm-button.json +1 -1
  77. package/registry/contact-page.json +1 -1
  78. package/registry/continue-prompt.json +1 -1
  79. package/registry/copy-button.json +1 -1
  80. package/registry/countdown.json +1 -1
  81. package/registry/cover-hero.json +1 -1
  82. package/registry/cta-panel.json +1 -1
  83. package/registry/dashboard-layout.json +1 -1
  84. package/registry/data-table.json +1 -1
  85. package/registry/date-picker.json +1 -1
  86. package/registry/decision-list.json +1 -1
  87. package/registry/description-list.json +1 -1
  88. package/registry/desktop-window.json +1 -1
  89. package/registry/detail-layout.json +1 -1
  90. package/registry/dialog.json +1 -1
  91. package/registry/docs-article-page.json +1 -1
  92. package/registry/docs-hub-page.json +1 -1
  93. package/registry/docs-layout.json +1 -1
  94. package/registry/docs-nav.json +1 -1
  95. package/registry/document-viewer.json +1 -1
  96. package/registry/doodle.json +1 -1
  97. package/registry/drop-overlay.json +1 -1
  98. package/registry/dropdown-menu.json +1 -1
  99. package/registry/elephant.json +1 -1
  100. package/registry/embed-facade.json +1 -1
  101. package/registry/empty-state.json +1 -1
  102. package/registry/engine-flow.json +1 -1
  103. package/registry/entity-header.json +1 -1
  104. package/registry/environment-notice.json +1 -1
  105. package/registry/error-page.json +1 -1
  106. package/registry/examples/architecture-diagram/containers.d.ts +4 -0
  107. package/registry/examples/architecture-diagram/containers.js +28 -0
  108. package/registry/examples/architecture-diagram/containers.tsx +24 -0
  109. package/registry/examples/architecture-diagram/context.d.ts +4 -0
  110. package/registry/examples/architecture-diagram/context.js +26 -0
  111. package/registry/examples/architecture-diagram/context.tsx +22 -0
  112. package/registry/examples/architecture-diagram/dynamic.d.ts +4 -0
  113. package/registry/examples/architecture-diagram/dynamic.js +27 -0
  114. package/registry/examples/architecture-diagram/dynamic.tsx +23 -0
  115. package/registry/examples/site-footer/family.d.ts +4 -0
  116. package/registry/examples/site-footer/family.js +25 -0
  117. package/registry/examples/site-footer/family.tsx +28 -0
  118. package/registry/examples/switch/row.d.ts +4 -0
  119. package/registry/examples/switch/row.js +14 -0
  120. package/registry/examples/switch/row.tsx +13 -0
  121. package/registry/field.json +1 -1
  122. package/registry/file-upload.json +1 -1
  123. package/registry/filter-bar.json +1 -1
  124. package/registry/flock.json +1 -1
  125. package/registry/footnote.json +1 -1
  126. package/registry/force-update-screen.json +1 -1
  127. package/registry/form.json +1 -1
  128. package/registry/gallery-page.json +1 -1
  129. package/registry/genui.json +1 -1
  130. package/registry/glossary-term.json +1 -1
  131. package/registry/glossary.json +1 -1
  132. package/registry/glow-card.json +1 -1
  133. package/registry/goal-gauge.json +1 -1
  134. package/registry/grade-stamp.json +1 -1
  135. package/registry/identity-card.json +1 -1
  136. package/registry/image-cropper.json +1 -1
  137. package/registry/index.json +38 -9
  138. package/registry/kanban.json +1 -1
  139. package/registry/kbd.json +1 -1
  140. package/registry/kind-config-editor.json +1 -1
  141. package/registry/kpi-explained.json +1 -1
  142. package/registry/landing-page.json +1 -1
  143. package/registry/landscape.json +1 -1
  144. package/registry/language-switch.json +1 -1
  145. package/registry/legal-page.json +1 -1
  146. package/registry/link-card.json +1 -1
  147. package/registry/list.json +1 -1
  148. package/registry/loader.json +1 -1
  149. package/registry/longform-page.json +1 -1
  150. package/registry/maintenance-screen.json +1 -1
  151. package/registry/map.json +2 -2
  152. package/registry/margin-layout.json +1 -1
  153. package/registry/markdown.json +1 -1
  154. package/registry/marketing-layout.json +1 -1
  155. package/registry/mascot-quote.json +1 -1
  156. package/registry/mascot-state.json +1 -1
  157. package/registry/mascots.json +1 -1
  158. package/registry/match-dialog.json +1 -1
  159. package/registry/media-capture.json +1 -1
  160. package/registry/media-gallery.json +1 -1
  161. package/registry/meter.json +1 -1
  162. package/registry/money-input.json +1 -1
  163. package/registry/nav-bar.json +2 -2
  164. package/registry/next-actions.json +1 -1
  165. package/registry/notification-preferences.json +1 -1
  166. package/registry/number-ticker.json +1 -1
  167. package/registry/opening-hours.json +1 -1
  168. package/registry/page-header.json +1 -1
  169. package/registry/page-hero.json +1 -1
  170. package/registry/page-index.json +1 -1
  171. package/registry/page.json +1 -1
  172. package/registry/pagination.json +1 -1
  173. package/registry/pointer-light.json +1 -1
  174. package/registry/popover.json +1 -1
  175. package/registry/price-catalogue-editor.json +1 -1
  176. package/registry/pricing-page.json +1 -1
  177. package/registry/product-page.json +1 -1
  178. package/registry/profile-card.json +1 -1
  179. package/registry/progress.json +1 -1
  180. package/registry/promise-card.json +1 -1
  181. package/registry/promo-code-field.json +1 -1
  182. package/registry/proposal.json +1 -1
  183. package/registry/qr-code.json +1 -1
  184. package/registry/quota-meter.json +1 -1
  185. package/registry/radio-group.json +1 -1
  186. package/registry/rail-nav.json +2 -2
  187. package/registry/recipes.json +1 -1
  188. package/registry/retro-tv.json +1 -1
  189. package/registry/reviews.json +1 -1
  190. package/registry/router.json +2 -2
  191. package/registry/schema-form.json +1 -1
  192. package/registry/scroll-stage.json +1 -1
  193. package/registry/search-field.json +1 -1
  194. package/registry/section-backdrop.json +1 -1
  195. package/registry/separator.json +1 -1
  196. package/registry/service-card.json +1 -1
  197. package/registry/settings-layout.json +1 -1
  198. package/registry/shop-composer.json +1 -1
  199. package/registry/shop-gallery.json +1 -1
  200. package/registry/shop.json +2 -2
  201. package/registry/showcase.json +1 -1
  202. package/registry/signature.json +1 -1
  203. package/registry/site-cahier.json +1 -1
  204. package/registry/site-footer.json +307 -6
  205. package/registry/sites.json +1 -1
  206. package/registry/skeleton.json +1 -1
  207. package/registry/skip-link.json +1 -1
  208. package/registry/slider.json +1 -1
  209. package/registry/slot-picker.json +1 -1
  210. package/registry/slot.json +1 -1
  211. package/registry/specimen-tag.json +1 -1
  212. package/registry/speed-lines.json +1 -1
  213. package/registry/spinner.json +1 -1
  214. package/registry/split-view.json +1 -1
  215. package/registry/stage-banner.json +1 -1
  216. package/registry/stat.json +1 -1
  217. package/registry/status-chip.json +1 -1
  218. package/registry/status-page.json +1 -1
  219. package/registry/step-progress.json +1 -1
  220. package/registry/step-showcase.json +1 -1
  221. package/registry/stepper.json +1 -1
  222. package/registry/sticky-action.json +1 -1
  223. package/registry/stuck.json +1 -1
  224. package/registry/swipe-deck.json +1 -1
  225. package/registry/switch.json +44 -7
  226. package/registry/tabs.json +1 -1
  227. package/registry/tag-input.json +1 -1
  228. package/registry/tag-selector.json +1 -1
  229. package/registry/taped-photo.json +1 -1
  230. package/registry/terminal-replay.json +1 -1
  231. package/registry/text-style.json +1 -1
  232. package/registry/theme.json +1 -1
  233. package/registry/toast.json +1 -1
  234. package/registry/toc.json +1 -1
  235. package/registry/tooltip.json +1 -1
  236. package/registry/tree-view.json +1 -1
  237. package/registry/update-prompt.json +1 -1
  238. package/registry/upload-queue.json +1 -1
  239. package/registry/usage.json +1 -1
  240. package/registry/verified-badge.json +1 -1
  241. package/registry/versus-card.json +1 -1
  242. package/registry/vertical-video.json +1 -1
  243. package/registry/video-player.json +1 -1
  244. package/registry/video-trimmer.json +1 -1
  245. package/registry/virtual.json +1 -1
  246. package/registry/wall.json +1 -1
  247. package/registry/waveform.json +1 -1
  248. package/dist/chunk-CZHPWLNW.js.map +0 -1
@@ -402,7 +402,7 @@
402
402
  },
403
403
  {
404
404
  "path": "meta.ts",
405
- "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"columns\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"copy-button\"\n | \"money-input\"\n | \"price-catalogue-editor\"\n | \"promo-code-field\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"waveform\"\n | \"proposal\"\n | \"qr-code\"\n | \"identity-card\"\n | \"entity-header\"\n | \"collection-switcher\"\n | \"marketing-layout\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"shop-gallery\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"schema-form\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Sovkora Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `experimental`: created for a filed need (ADR-008 §4), it may change or go in any minor until its first consumer imports it; `adoption`\n * names that consumer's issue. `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"experimental\" | \"stable\" | \"beta\" | \"deprecated\";\n\n/**\n * What a component is for (ADR-008 §3): the thirteen domains the documentation, the size budgets and the guards are\n * organised by. The domain is metadata: the entries stay flat (`@krizaka/ui/<name>`). `cahier` is the sites' register\n * (ADR-004): a product never imports it.\n */\nexport type Domain =\n | \"foundations\"\n | \"forms\"\n | \"data-display\"\n | \"navigation-shell\"\n | \"feedback\"\n | \"maps\"\n | \"media\"\n | \"commerce\"\n | \"identity\"\n | \"abuse\"\n | \"conversation\"\n | \"page-blocks\"\n | \"cahier\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** What it is for: one of the twelve domains (ADR-008 §3). */\n readonly domain: Domain;\n /** The `<repo>#<n>` issue of its first consumer: required for, and only for, an `experimental` component. */\n readonly adoption?: string;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
405
+ "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"architecture-diagram\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"columns\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"copy-button\"\n | \"money-input\"\n | \"price-catalogue-editor\"\n | \"promo-code-field\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"waveform\"\n | \"proposal\"\n | \"qr-code\"\n | \"identity-card\"\n | \"entity-header\"\n | \"collection-switcher\"\n | \"marketing-layout\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"shop-gallery\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"schema-form\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Sovkora Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `experimental`: created for a filed need (ADR-008 §4), it may change or go in any minor until its first consumer imports it; `adoption`\n * names that consumer's issue. `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"experimental\" | \"stable\" | \"beta\" | \"deprecated\";\n\n/**\n * What a component is for (ADR-008 §3): the thirteen domains the documentation, the size budgets and the guards are\n * organised by. The domain is metadata: the entries stay flat (`@krizaka/ui/<name>`). `cahier` is the sites' register\n * (ADR-004): a product never imports it.\n */\nexport type Domain =\n | \"foundations\"\n | \"forms\"\n | \"data-display\"\n | \"navigation-shell\"\n | \"feedback\"\n | \"maps\"\n | \"media\"\n | \"commerce\"\n | \"identity\"\n | \"abuse\"\n | \"conversation\"\n | \"page-blocks\"\n | \"cahier\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** What it is for: one of the twelve domains (ADR-008 §3). */\n readonly domain: Domain;\n /** The `<repo>#<n>` issue of its first consumer: required for, and only for, an `experimental` component. */\n readonly adoption?: string;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
406
406
  }
407
407
  ],
408
408
  "dependencies": [
@@ -0,0 +1,239 @@
1
+ {
2
+ "name": "architecture-diagram",
3
+ "type": "primitive",
4
+ "title": "Architecture diagram",
5
+ "summary": "One laid-out C4 view (context, containers, components or a dynamic flow) drawn on the plate in the page's tokens — groups, elements by shape, labelled edges, numbered steps — with its full text version.",
6
+ "description": "One laid-out C4 view (context, containers, components or a dynamic flow) drawn on the plate in the page's tokens — groups, elements by shape, labelled edges, numbered steps — with its full text version.",
7
+ "status": "experimental",
8
+ "deprecated": null,
9
+ "category": "data-display",
10
+ "domain": "data-display",
11
+ "adoption": "krizaka-blog#340",
12
+ "platforms": "web",
13
+ "parity": {
14
+ "web": {
15
+ "state": "yes"
16
+ },
17
+ "native": {
18
+ "state": "n/a",
19
+ "reason": "A figure of a reading page (a post, a docs site); an app screen lists the same elements and relations.",
20
+ "use": "list"
21
+ },
22
+ "desktop": {
23
+ "state": "yes"
24
+ }
25
+ },
26
+ "whenToUse": [
27
+ "A post or a docs page that shows how a system is built: its context, its containers, its components.",
28
+ "A dynamic view: the numbered steps of one flow (a request, a release, a pull request's life).",
29
+ "A cockpit page that shows the architecture the code was checked against."
30
+ ],
31
+ "whenNotToUse": [
32
+ {
33
+ "when": "An engine and the apps it serves, with what travels between them, on a landing.",
34
+ "use": "engine-flow"
35
+ },
36
+ {
37
+ "when": "A sequence of steps a person goes through.",
38
+ "use": "stepper"
39
+ },
40
+ {
41
+ "when": "Facts about one element.",
42
+ "use": "description-list"
43
+ }
44
+ ],
45
+ "bestPractices": [
46
+ "Pass the view `@krizaka/architecture` laid out, unchanged: the component draws, it never lays out, so the drawing is the model's.",
47
+ "One view per figure, under its view title; the `subtitle` says the level (`C4 · level 2`) or the source.",
48
+ "Pass `links` by element id for the elements that have a page: they become links in the text version.",
49
+ "Pass `words` in the page's language: the text version's headings are props."
50
+ ],
51
+ "accessibility": {
52
+ "keyboard": [
53
+ {
54
+ "keys": "Arrow keys",
55
+ "action": "Scroll the drawing in its frame (once the frame has focus) when it is wider than the screen."
56
+ }
57
+ ],
58
+ "notes": [
59
+ "The drawing is one image (`role=\"img\"`) named by the view's title (`aria-label`); its text version is a `<details>` built from the same view: the elements (nested in their groups), then the relations or, in a dynamic view, the ordered steps.",
60
+ "Every label is a text child, never markup: a hostile title renders as its characters.",
61
+ "A link is only an `http:`/`https:` address, a same-site path or an anchor (`safeHref`); any other scheme is dropped.",
62
+ "On a phone the drawing keeps a legible size and scrolls in its frame, which takes the keyboard focus; the text version is the phone reading."
63
+ ]
64
+ },
65
+ "related": [
66
+ "engine-flow",
67
+ "description-list",
68
+ "stepper"
69
+ ],
70
+ "web": {
71
+ "entry": "@krizaka/ui/architecture-diagram",
72
+ "import": "import { ArchitectureDiagram } from \"@krizaka/ui/architecture-diagram\";",
73
+ "props": [
74
+ {
75
+ "component": "ArchitectureDiagram",
76
+ "description": "One laid-out C4 view (context, containers, components, or a dynamic flow) drawn on the plate: groups, elements by\nshape, edges with their labels and, in a dynamic view, numbered steps. The full text version follows it.",
77
+ "props": [
78
+ {
79
+ "name": "view",
80
+ "type": "ArchView",
81
+ "default": null,
82
+ "description": "One laid-out view, as `@krizaka/architecture` emits it: the component draws it and lays out nothing.",
83
+ "required": true
84
+ },
85
+ {
86
+ "name": "links",
87
+ "type": "Readonly<Record<string, string>>",
88
+ "default": null,
89
+ "description": "Links of the elements, by node id: each title of the text version becomes a link. Only `http:`/`https:` addresses\nand same-site paths are kept (`safeHref`); any other is dropped and the title stays plain text.",
90
+ "required": false
91
+ },
92
+ {
93
+ "name": "subtitle",
94
+ "type": "ReactNode",
95
+ "default": null,
96
+ "description": "One line beside the title: the view's scope, its source.",
97
+ "required": false
98
+ },
99
+ {
100
+ "name": "textOpen",
101
+ "type": "boolean",
102
+ "default": "false",
103
+ "description": "Opens the text version from the start (a page where the words are the main reading).",
104
+ "required": false
105
+ },
106
+ {
107
+ "name": "title",
108
+ "type": "string",
109
+ "default": "view.title",
110
+ "description": "The figure's title, shown above the drawing and read as the image's name.",
111
+ "required": false
112
+ },
113
+ {
114
+ "name": "words",
115
+ "type": "Partial<ArchitectureDiagramWords>",
116
+ "default": null,
117
+ "description": "The words of the text version.",
118
+ "required": false
119
+ }
120
+ ]
121
+ },
122
+ {
123
+ "component": "ArchNode",
124
+ "description": "A node of a laid-out view (pixels, rounded). `compound` nodes hold others (their `parent` points at them).",
125
+ "props": []
126
+ }
127
+ ],
128
+ "examples": [
129
+ {
130
+ "name": "context",
131
+ "title": "Context",
132
+ "description": "Who uses the system and what it relies on outside: a person, a browser, an external store.",
133
+ "path": "examples/architecture-diagram/context.tsx",
134
+ "module": "@krizaka/ui/registry/examples/architecture-diagram/context",
135
+ "code": "import { ArchitectureDiagram, type ArchView } from \"@krizaka/ui/architecture-diagram\";\n\n/** A context view as @krizaka/architecture lays it out: who uses the system, and what it relies on outside. */\nconst view = {\n id: \"blog_context\",\n title: \"The blog · context\",\n dynamic: false,\n bounds: { x: 0, y: 0, width: 520, height: 470 },\n nodes: [\n { id: \"reader\", parent: null, kind: \"person\", shape: \"person\", title: \"Reader\", technology: null, description: \"Reads the posts on a phone or a laptop.\", compound: false, x: 150, y: 0, width: 220, height: 100 },\n { id: \"blog\", parent: null, kind: \"system\", shape: \"browser\", title: \"Blog\", technology: \"Next.js, static export\", description: \"Publishes the posts and their diagrams.\", compound: false, x: 130, y: 180, width: 260, height: 110 },\n { id: \"cdn\", parent: null, kind: \"external\", shape: \"storage\", title: \"Media CDN\", technology: \"Bunny\", description: \"Serves the images and the fonts.\", compound: false, x: 150, y: 370, width: 220, height: 100 },\n ],\n edges: [\n { id: \"reads\", source: \"reader\", target: \"blog\", label: \"reads\", points: [[260, 100], [260, 127], [260, 153], [260, 180]], labelBBox: { x: 272, y: 131, width: 44, height: 18 }, step: null, back: false },\n { id: \"loads\", source: \"blog\", target: \"cdn\", label: \"loads images from\", points: [[260, 290], [260, 317], [260, 343], [260, 370]], labelBBox: { x: 272, y: 321, width: 140, height: 18 }, step: null, back: false },\n ],\n} satisfies ArchView;\n\nexport default function ContextExample() {\n return <ArchitectureDiagram view={view} subtitle=\"C4 · level 1\" links={{ blog: \"https://blog.krizaka.com\" }} />;\n}\n"
136
+ },
137
+ {
138
+ "name": "containers",
139
+ "title": "Containers",
140
+ "description": "The system as a group, its containers inside, a database below.",
141
+ "path": "examples/architecture-diagram/containers.tsx",
142
+ "module": "@krizaka/ui/registry/examples/architecture-diagram/containers",
143
+ "code": "import { ArchitectureDiagram, type ArchView } from \"@krizaka/ui/architecture-diagram\";\n\n/** A container view: the system is a group (a compound node) and its containers sit inside it. */\nconst view = {\n id: \"shop_containers\",\n title: \"The shop · containers\",\n dynamic: false,\n bounds: { x: 0, y: 0, width: 660, height: 420 },\n nodes: [\n { id: \"shop\", parent: null, kind: \"system\", shape: \"rectangle\", title: \"Shop\", technology: null, description: \"Sells and books.\", compound: true, x: 0, y: 0, width: 660, height: 260 },\n { id: \"shop.web\", parent: \"shop\", kind: \"container\", shape: \"browser\", title: \"Storefront\", technology: \"Next.js\", description: \"The pages a customer sees.\", compound: false, x: 40, y: 70, width: 240, height: 150 },\n { id: \"shop.jobs\", parent: \"shop\", kind: \"container\", shape: \"queue\", title: \"Booking jobs\", technology: \"PostgreSQL queue\", description: \"Confirms and reminds.\", compound: false, x: 380, y: 100, width: 240, height: 90 },\n { id: \"db\", parent: null, kind: \"container\", shape: \"storage\", title: \"Database\", technology: \"PostgreSQL 18\", description: \"Orders, bookings, customers.\", compound: false, x: 210, y: 320, width: 240, height: 100 },\n ],\n edges: [\n { id: \"enqueue\", source: \"shop.web\", target: \"shop.jobs\", label: \"enqueues\", points: [[280, 145], [313, 145], [347, 145], [380, 145]], labelBBox: { x: 296, y: 120, width: 70, height: 18 }, step: null, back: false },\n { id: \"store\", source: \"shop.web\", target: \"db\", label: \"reads and writes\", points: [[160, 220], [180, 270], [250, 290], [290, 320]], labelBBox: { x: 60, y: 276, width: 130, height: 18 }, step: null, back: false },\n { id: \"jobs-db\", source: \"shop.jobs\", target: \"db\", label: null, points: [[500, 190], [480, 250], [420, 290], [390, 320]], labelBBox: null, step: null, back: false },\n ],\n} satisfies ArchView;\n\nexport default function ContainersExample() {\n return <ArchitectureDiagram view={view} subtitle=\"C4 · level 2\" />;\n}\n"
144
+ },
145
+ {
146
+ "name": "dynamic",
147
+ "title": "Dynamic flow",
148
+ "description": "`dynamic: true`: the edges are numbered steps, and the text version lists them in order.",
149
+ "path": "examples/architecture-diagram/dynamic.tsx",
150
+ "module": "@krizaka/ui/registry/examples/architecture-diagram/dynamic",
151
+ "code": "import { ArchitectureDiagram, type ArchView } from \"@krizaka/ui/architecture-diagram\";\n\n/** A dynamic view: the edges are the steps of one flow, numbered in the model's order. */\nconst view = {\n id: \"pr_life\",\n title: \"A pull request's life\",\n dynamic: true,\n bounds: { x: 0, y: 0, width: 640, height: 400 },\n nodes: [\n { id: \"agent\", parent: null, kind: \"person\", shape: \"person\", title: \"Agent\", technology: null, description: \"Writes the change and its tests.\", compound: false, x: 0, y: 20, width: 200, height: 100 },\n { id: \"ci\", parent: null, kind: \"external\", shape: \"rectangle\", title: \"CI\", technology: \"GitHub Actions\", description: \"Runs every check.\", compound: false, x: 440, y: 20, width: 200, height: 100 },\n { id: \"train\", parent: null, kind: \"container\", shape: \"queue\", title: \"Merge train\", technology: \"Python\", description: \"Lands green pull requests one by one.\", compound: false, x: 210, y: 300, width: 220, height: 100 },\n ],\n edges: [\n { id: \"step-01\", source: \"agent\", target: \"ci\", label: \"opens the pull request\", points: [[200, 70], [280, 70], [360, 70], [440, 70]], labelBBox: { x: 248, y: 40, width: 170, height: 18 }, step: 1, back: false },\n { id: \"step-02\", source: \"ci\", target: \"train\", label: \"reports green\", points: [[540, 120], [540, 220], [480, 300], [430, 330]], labelBBox: { x: 500, y: 210, width: 110, height: 18 }, step: 2, back: false },\n { id: \"step-03\", source: \"train\", target: \"agent\", label: \"merges, tells the agent\", points: [[210, 350], [120, 330], [100, 200], [100, 120]], labelBBox: { x: 20, y: 220, width: 180, height: 18 }, step: 3, back: false },\n ],\n} satisfies ArchView;\n\nexport default function DynamicExample() {\n return <ArchitectureDiagram view={view} subtitle=\"dynamic view\" />;\n}\n"
152
+ }
153
+ ]
154
+ },
155
+ "native": null,
156
+ "files": [
157
+ {
158
+ "path": "architecture-diagram/architecture-diagram.tsx",
159
+ "content": "// Server-safe. One laid-out C4 view drawn as a figure of the plate (blocks.css: `kz-plate`, `kz-arch-*`): the layout\n// comes from @krizaka/architecture, this file only draws it. Safe by construction: every SVG element is written here\n// from typed fields; no tag or attribute name is read from the view, every word is a React text child, and a link is\n// only an href the host passes, checked by `safeHref`. The drawing is an image (`role=\"img\"`, named by `aria-label`: an\n// SVG `<title>` would count as a second document title for the sites' SEO check); its full text version\n// (elements, relations or the numbered steps) is a `<details>` built from the same view.\nimport type { ArchEdge, ArchNode, ArchView, Box, Point } from \"@krizaka/architecture\";\nimport type * as React from \"react\";\n\nimport { cx } from \"../cx\";\n\n/* Every size of the drawing, in the layout's units (the view's pixels): the SVG scales them with its column. */\nconst SIZE = {\n /** The room around the view's bounds. */\n margin: 24,\n /** The offset of the paper shadow under each element. */\n shadow: 5,\n /** The title, the technology and the edge label's font sizes. */\n title: 21,\n technology: 15,\n label: 14,\n /** Line heights, as a multiple of the font size. */\n titleLeading: 1.2,\n technologyLeading: 1.3,\n /** Where the first baseline sits under the top of its line, as a multiple of the font size. */\n ascent: 0.85,\n /** The room between the title and the technology. */\n gap: 10,\n /** The words' side padding in a box, and in a queue (its rounded ends take room). */\n pad: 12,\n queuePad: 30,\n /** The average glyph width as a share of the font size, to wrap words without measuring them. */\n sansEm: 0.54,\n monoEm: 0.6,\n /** The fewest characters a wrapped line may hold. */\n minLine: 4,\n /** A person's head, a browser's bar and its three dots, a component's two tabs. */\n head: 11,\n browserBar: 20,\n browserDots: [14, 28, 42],\n browserDot: 3.5,\n tab: { width: 20, height: 14, at: [0.3, 0.55] },\n /** A cylinder's lid, and a queue's rounded ends. */\n lid: 14,\n lidRoom: 18,\n queueEnd: 16,\n /** A phone's corner and its home dot. */\n phoneCorner: 14,\n phoneDot: 4,\n /** A group's title, from its top left corner. */\n groupTitle: { dx: 18, dy: 30 },\n /** The arrowhead: its length and its half-angle (radians). */\n arrow: 16,\n arrowAngle: 0.42,\n /** The plate under an edge's label. */\n labelPad: 4,\n /** A step's numbered badge. */\n badge: 13,\n badgeText: 14,\n badgeGap: 6,\n /** The narrowest the drawing may shrink to fit its column, as a share of its own width: below, it scrolls in its frame. */\n minScale: 0.6,\n} as const;\n\n/** The shapes the component draws: anything else in the view is drawn as a box. */\ntype Shape = \"box\" | \"person\" | \"browser\" | \"mobile\" | \"storage\" | \"queue\" | \"component\";\nconst SHAPES: ReadonlyMap<string, Shape> = new Map([\n [\"rectangle\", \"box\"],\n [\"person\", \"person\"],\n [\"browser\", \"browser\"],\n [\"mobile\", \"mobile\"],\n [\"storage\", \"storage\"],\n [\"cylinder\", \"storage\"],\n [\"queue\", \"queue\"],\n [\"component\", \"component\"],\n]);\n/** The kinds drawn as outside the system (a paler body). */\nconst OUTSIDE: ReadonlySet<string> = new Set([\"external\"]);\n\n/** The words of the text version: props, never translated here. */\nexport interface ArchitectureDiagramWords {\n /** The disclosure that opens the text version. @default \"The diagram in words\" */\n summary: string;\n /** The heading of the elements. @default \"Elements\" */\n elements: string;\n /** The heading of a static view's relations. @default \"Relations\" */\n relations: string;\n /** The heading of a dynamic view's ordered steps. @default \"Steps\" */\n steps: string;\n}\n\n/* The frame scrolls sideways on a narrow screen: it takes the keyboard focus so the arrow keys can scroll it (axe: scrollable-region-focusable). */\nconst SCROLL_FOCUS = { tabIndex: 0 } as const;\n\nconst WORDS: ArchitectureDiagramWords = {\n summary: \"The diagram in words\",\n elements: \"Elements\",\n relations: \"Relations\",\n steps: \"Steps\",\n};\n\nexport type ArchitectureDiagramProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"children\"> & {\n /** One laid-out view, as `@krizaka/architecture` emits it: the component draws it and lays out nothing. */\n view: ArchView;\n /** The figure's title, shown above the drawing and read as the image's name. @default view.title */\n title?: string;\n /** One line beside the title: the view's scope, its source. */\n subtitle?: React.ReactNode;\n /**\n * Links of the elements, by node id: each title of the text version becomes a link. Only `http:`/`https:` addresses\n * and same-site paths are kept (`safeHref`); any other is dropped and the title stays plain text.\n */\n links?: Readonly<Record<string, string>>;\n /** The words of the text version. */\n words?: Partial<ArchitectureDiagramWords>;\n /** Opens the text version from the start (a page where the words are the main reading). @default false */\n textOpen?: boolean;\n};\n\nconst RELATIVE_BASE = \"https://relative.invalid\";\n\n/**\n * The address a link may point at, or `undefined`: an `http:`/`https:` URL, a path on the same site (read from its root)\n * or an anchor of the page. Any other scheme (`javascript:`, `data:`, `mailto:`) is refused; a protocol-relative\n * `//host` is read as `https:`. The returned value is the parsed address, never the raw string.\n */\nexport function safeHref(href: string): string | undefined {\n if (!URL.canParse(href, RELATIVE_BASE)) return undefined;\n const url = new URL(href, RELATIVE_BASE);\n if (url.origin === RELATIVE_BASE) return href.startsWith(\"#\") ? url.hash : `${url.pathname}${url.search}${url.hash}`;\n return url.protocol === \"https:\" || url.protocol === \"http:\" ? url.href : undefined;\n}\n\n/** Words wrapped to lines no wider than `width`, for a font of `size` whose average glyph is `em` of it. */\nfunction wrap(text: string, width: number, size: number, em: number): string[] {\n const max = Math.max(SIZE.minLine, Math.floor(width / (size * em)));\n const rows: string[] = [];\n /* French quotes stay with their word: a line never starts with « » » nor ends with « « ». */\n const glued = text.replaceAll(\"« \", \"« \").replaceAll(\" »\", \" »\");\n for (const word of glued.split(/\\s+/).filter(Boolean)) {\n const last = rows.at(-1);\n if (last !== undefined && last.length + 1 + word.length <= max) rows[rows.length - 1] = `${last} ${word}`;\n else rows.push(word);\n }\n return rows;\n}\n\n/** The SVG path of the layout's edge points: a start, then cubic Bézier segments of three points each (else a polyline). */\nfunction pathOf(points: readonly Point[]): string {\n const [first, ...rest] = points;\n if (!first || rest.length === 0) return \"\";\n const parts = [`M${first[0]},${first[1]}`];\n if (rest.length % 3 === 0) {\n for (let i = 0; i < rest.length; i += 3) parts.push(`C${rest[i]!.join(\",\")} ${rest[i + 1]!.join(\",\")} ${rest[i + 2]!.join(\",\")}`);\n } else {\n for (const [x, y] of rest) parts.push(`L${x},${y}`);\n }\n return parts.join(\" \");\n}\n\n/** The arrowhead at the last point, pointing along the last segment. */\nfunction arrowOf(points: readonly Point[]): string | null {\n const tip = points.at(-1);\n const from = points.at(-2);\n if (!tip || !from) return null;\n const angle = Math.atan2(tip[1] - from[1], tip[0] - from[0]);\n const wing = (da: number) => `${tip[0] - SIZE.arrow * Math.cos(angle + da)},${tip[1] - SIZE.arrow * Math.sin(angle + da)}`;\n return `${tip[0]},${tip[1]} ${wing(SIZE.arrowAngle)} ${wing(-SIZE.arrowAngle)}`;\n}\n\n/** Lines of text, one `<text>` each, centred on `x`. */\nfunction Lines({ rows, x, y, size, leading, className }: Readonly<{ rows: string[]; x: number; y: number; size: number; leading: number; className: string }>) {\n /* A row's text is its identity: the same line twice in one block is told apart by its place. */\n return rows.map((row, i) => (\n <text key={`${i}:${row}`} x={x} y={y + i * size * leading} fontSize={size} textAnchor=\"middle\" className={className}>\n {row}\n </text>\n ));\n}\n\nfunction ShapeOf({ node, shape }: Readonly<{ node: ArchNode; shape: Shape }>) {\n const { x, y, width: w, height: h } = node;\n const s = SIZE.shadow;\n const rect = <rect x={x} y={y} width={w} height={h} className=\"kz-arch-body\" />;\n const shadow = <rect x={x + s} y={y + s} width={w} height={h} className=\"kz-arch-shadow\" />;\n switch (shape) {\n case \"person\":\n return (\n <>\n {shadow}\n {rect}\n <circle cx={x + w / 2} cy={y} r={SIZE.head} className=\"kz-arch-body\" />\n </>\n );\n case \"browser\":\n return (\n <>\n {shadow}\n {rect}\n <line x1={x} y1={y + SIZE.browserBar} x2={x + w} y2={y + SIZE.browserBar} className=\"kz-arch-detail\" />\n {SIZE.browserDots.map((dx) => (\n <circle key={dx} cx={x + dx} cy={y + SIZE.browserBar / 2} r={SIZE.browserDot} className=\"kz-arch-dot\" />\n ))}\n </>\n );\n case \"mobile\":\n return (\n <>\n <rect x={x + s} y={y + s} width={w} height={h} rx={SIZE.phoneCorner} className=\"kz-arch-shadow\" />\n <rect x={x} y={y} width={w} height={h} rx={SIZE.phoneCorner} className=\"kz-arch-body\" />\n <circle cx={x + w / 2} cy={y + h - SIZE.phoneCorner / 2} r={SIZE.phoneDot} className=\"kz-arch-dot\" />\n </>\n );\n case \"storage\": {\n const ry = SIZE.lid;\n const d = `M${x},${y + ry} A${w / 2},${ry} 0 0 1 ${x + w},${y + ry} V${y + h - ry} A${w / 2},${ry} 0 0 1 ${x},${y + h - ry} Z`;\n return (\n <>\n <path d={d} transform={`translate(${s},${s})`} className=\"kz-arch-shadow\" />\n <path d={d} className=\"kz-arch-body\" />\n <path d={`M${x},${y + ry} A${w / 2},${ry} 0 0 0 ${x + w},${y + ry}`} className=\"kz-arch-detail\" />\n </>\n );\n }\n case \"queue\": {\n const rx = SIZE.queueEnd;\n const d = `M${x + rx},${y} H${x + w - rx} A${rx},${h / 2} 0 0 1 ${x + w - rx},${y + h} H${x + rx} A${rx},${h / 2} 0 0 1 ${x + rx},${y} Z`;\n return (\n <>\n <path d={d} transform={`translate(${s},${s})`} className=\"kz-arch-shadow\" />\n <path d={d} className=\"kz-arch-body\" />\n <path d={`M${x + w - rx},${y} A${rx},${h / 2} 0 0 0 ${x + w - rx},${y + h}`} className=\"kz-arch-detail\" />\n </>\n );\n }\n case \"component\":\n return (\n <>\n {shadow}\n {rect}\n {SIZE.tab.at.map((k) => (\n <rect\n key={k}\n x={x - SIZE.tab.width / 2}\n y={y + h * k}\n width={SIZE.tab.width}\n height={SIZE.tab.height}\n className=\"kz-arch-body kz-arch-tab\"\n />\n ))}\n </>\n );\n case \"box\":\n return (\n <>\n {shadow}\n {rect}\n </>\n );\n }\n}\n\n/** A group (a compound node): a dashed frame and its name in capitals at the top left. */\nfunction Group({ node }: Readonly<{ node: ArchNode }>) {\n return (\n <g className=\"kz-arch-group\">\n <rect x={node.x} y={node.y} width={node.width} height={node.height} className=\"kz-arch-group-frame\" />\n <text x={node.x + SIZE.groupTitle.dx} y={node.y + SIZE.groupTitle.dy} fontSize={SIZE.technology} className=\"kz-arch-group-title\">\n {node.title}\n </text>\n </g>\n );\n}\n\n/** An element: its shape, its title and its technology centred in it. */\nfunction Element({ node }: Readonly<{ node: ArchNode }>) {\n const shape = SHAPES.get(node.shape) ?? \"box\";\n const pad = shape === \"queue\" ? SIZE.queuePad : SIZE.pad;\n const room = node.width - 2 * pad;\n const title = wrap(node.title, room, SIZE.title, SIZE.sansEm);\n const tech = node.technology ? wrap(node.technology, room, SIZE.technology, SIZE.monoEm) : [];\n const titleHeight = title.length * SIZE.title * SIZE.titleLeading;\n const block = titleHeight + (tech.length ? SIZE.gap + tech.length * SIZE.technology * SIZE.technologyLeading : 0);\n /* A cylinder's lid takes the top of its box: the words sit under it. */\n const lid = shape === \"storage\" ? SIZE.lidRoom : 0;\n const top = node.y + lid + (node.height - lid - block) / 2 + SIZE.title * SIZE.ascent;\n const cx = node.x + node.width / 2;\n return (\n <g className=\"kz-arch-element\" data-shape={shape} data-outside={OUTSIDE.has(node.kind) || undefined}>\n <ShapeOf node={node} shape={shape} />\n <Lines rows={title} x={cx} y={top} size={SIZE.title} leading={SIZE.titleLeading} className=\"kz-arch-title\" />\n <Lines rows={tech} x={cx} y={top + titleHeight + SIZE.gap} size={SIZE.technology} leading={SIZE.technologyLeading} className=\"kz-arch-technology\" />\n </g>\n );\n}\n\n/** The middle of an edge's points: where its step badge goes when it has no label. */\nfunction middleOf(points: readonly Point[]): Point | undefined {\n return points[Math.floor(points.length / 2)];\n}\n\n/** An edge's line and arrowhead (drawn under the elements). */\nfunction Stroke({ edge, dynamic }: Readonly<{ edge: ArchEdge; dynamic: boolean }>) {\n const arrow = arrowOf(edge.back ? [...edge.points].reverse() : edge.points);\n return (\n <g className=\"kz-arch-edge\" data-dynamic={dynamic || undefined}>\n <path d={pathOf(edge.points)} className=\"kz-arch-line\" />\n {arrow && <polygon points={arrow} className=\"kz-arch-arrow\" />}\n </g>\n );\n}\n\n/** An edge's label on its plate and, in a dynamic view, its numbered badge (drawn over the elements). */\nfunction EdgeLabel({ edge, dynamic }: Readonly<{ edge: ArchEdge; dynamic: boolean }>) {\n const step = dynamic ? edge.step : null;\n const box: Box | null = edge.labelBBox;\n const rows = edge.label && box ? wrap(edge.label, box.width + 2 * SIZE.labelPad, SIZE.label, SIZE.monoEm) : [];\n if (rows.length === 0 && step === null) return null;\n const centre = box ? ([box.x + box.width / 2, box.y + box.height / 2] as const) : middleOf(edge.points);\n if (!centre) return null;\n const [cx, cy] = centre;\n const width = (box?.width ?? 0) + 4 * SIZE.labelPad;\n const height = rows.length * SIZE.label * SIZE.technologyLeading + 2 * SIZE.labelPad;\n const badgeX = rows.length ? cx - width / 2 - SIZE.badgeGap - SIZE.badge : cx;\n return (\n <g className=\"kz-arch-label\">\n {rows.length > 0 && (\n <>\n <rect x={cx - width / 2} y={cy - height / 2} width={width} height={height} className=\"kz-arch-label-plate\" />\n <Lines\n rows={rows}\n x={cx}\n y={cy - height / 2 + SIZE.labelPad + SIZE.label * SIZE.ascent}\n size={SIZE.label}\n leading={SIZE.technologyLeading}\n className=\"kz-arch-label-text\"\n />\n </>\n )}\n {step !== null && (\n <g className=\"kz-arch-step\" data-step={step}>\n <circle cx={badgeX} cy={cy} r={SIZE.badge} className=\"kz-arch-step-badge\" />\n <text x={badgeX} y={cy} fontSize={SIZE.badgeText} textAnchor=\"middle\" dominantBaseline=\"central\" className=\"kz-arch-step-number\">\n {step}\n </text>\n </g>\n )}\n </g>\n );\n}\n\n/** An element's line of the text version: its title (a link when the host gave a safe one), technology, description. */\nfunction ElementText({ node, links }: Readonly<{ node: ArchNode; links: Readonly<Record<string, string>> | undefined }>) {\n const given = links && Object.hasOwn(links, node.id) ? links[node.id] : undefined;\n const href = given === undefined ? undefined : safeHref(given);\n return (\n <>\n {href ? <a href={href}>{node.title}</a> : <b>{node.title}</b>}\n {node.technology && <span className=\"kz-arch-text-tech\"> ({node.technology})</span>}\n {node.description && <>: {node.description}</>}\n </>\n );\n}\n\n/** The elements as nested lists: a group lists the elements inside it. */\nfunction ElementList({ nodes, parent, links }: Readonly<{ nodes: readonly ArchNode[]; parent: string | null; links: Readonly<Record<string, string>> | undefined }>) {\n const ids = new Set(nodes.map((n) => n.id));\n const here = nodes.filter((n) => (parent === null ? n.parent === null || !ids.has(n.parent) : n.parent === parent));\n if (here.length === 0) return null;\n return (\n <ul className=\"kz-arch-text-list\">\n {here.map((n) => (\n <li key={n.id}>\n <ElementText node={n} links={links} />\n {n.compound && <ElementList nodes={nodes} parent={n.id} links={links} />}\n </li>\n ))}\n </ul>\n );\n}\n\n/** One relation in words: `Source → Target: label`. */\nfunction relationText(edge: ArchEdge, titles: ReadonlyMap<string, string>): string {\n const said = edge.label ? `: ${edge.label}` : \"\";\n return `${titles.get(edge.source) ?? edge.source} → ${titles.get(edge.target) ?? edge.target}${said}`;\n}\n\n/**\n * One laid-out C4 view (context, containers, components, or a dynamic flow) drawn on the plate: groups, elements by\n * shape, edges with their labels and, in a dynamic view, numbered steps. The full text version follows it.\n */\nexport function ArchitectureDiagram({ view, title, subtitle, links, words, textOpen = false, className, ...props }: ArchitectureDiagramProps) {\n const w = { ...WORDS, ...words };\n const name = title ?? view.title;\n const m = SIZE.margin;\n const { x, y, width, height } = view.bounds;\n const vbWidth = width + 2 * m + SIZE.shadow;\n const vbHeight = height + 2 * m + SIZE.shadow;\n const groups = view.nodes.filter((n) => n.compound);\n const elements = view.nodes.filter((n) => !n.compound);\n const titles = new Map(view.nodes.map((n) => [n.id, n.title]));\n const relations = view.dynamic\n ? [...view.edges].sort((a, b) => (a.step ?? Number.MAX_SAFE_INTEGER) - (b.step ?? Number.MAX_SAFE_INTEGER))\n : view.edges;\n return (\n <figure className={cx(\"kz-plate kz-arch\", className)} data-dynamic={view.dynamic || undefined} {...props}>\n <figcaption className=\"kz-plate-head\">\n <span className=\"kz-plate-title\">{name}</span>\n {subtitle && <span className=\"kz-plate-sub\">{subtitle}</span>}\n </figcaption>\n <section className=\"kz-arch-frame\" aria-label={name} {...SCROLL_FOCUS}>\n <svg\n viewBox={`${x - m} ${y - m} ${vbWidth} ${vbHeight}`}\n role=\"img\"\n aria-label={name}\n className=\"kz-arch-svg\"\n style={{ minWidth: vbWidth * SIZE.minScale, maxWidth: vbWidth }}\n >\n {groups.map((n) => (\n <Group key={n.id} node={n} />\n ))}\n {view.edges.map((e) => (\n <Stroke key={e.id} edge={e} dynamic={view.dynamic} />\n ))}\n {elements.map((n) => (\n <Element key={n.id} node={n} />\n ))}\n {view.edges.map((e) => (\n <EdgeLabel key={e.id} edge={e} dynamic={view.dynamic} />\n ))}\n </svg>\n </section>\n <details className=\"kz-arch-text\" open={textOpen}>\n <summary>{w.summary}</summary>\n <p className=\"kz-arch-text-head\">{w.elements}</p>\n <ElementList nodes={view.nodes} parent={null} links={links} />\n {relations.length > 0 && (\n <>\n <p className=\"kz-arch-text-head\">{view.dynamic ? w.steps : w.relations}</p>\n {view.dynamic ? (\n <ol className=\"kz-arch-text-list\">\n {relations.map((e, i) => (\n <li key={e.id} value={e.step ?? i + 1}>\n {relationText(e, titles)}\n </li>\n ))}\n </ol>\n ) : (\n <ul className=\"kz-arch-text-list\">\n {relations.map((e) => (\n <li key={e.id}>{relationText(e, titles)}</li>\n ))}\n </ul>\n )}\n </>\n )}\n </details>\n </figure>\n );\n}\n"
160
+ },
161
+ {
162
+ "path": "architecture-diagram/index.ts",
163
+ "content": "/** @krizaka/ui/architecture-diagram — `ArchitectureDiagram`: one laid-out C4 view on the plate, with its text version. Server-safe. */\nexport { ArchitectureDiagram, type ArchitectureDiagramProps, type ArchitectureDiagramWords, safeHref } from \"./architecture-diagram\";\nexport type { ArchEdge, ArchNode, ArchView, Box, Point } from \"@krizaka/architecture\";\n"
164
+ },
165
+ {
166
+ "path": "architecture-diagram/meta.ts",
167
+ "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Architecture diagram\",\n summary:\n \"One laid-out C4 view (context, containers, components or a dynamic flow) drawn on the plate in the page's tokens — groups, elements by shape, labelled edges, numbered steps — with its full text version.\",\n status: \"experimental\",\n adoption: \"krizaka-blog#340\",\n category: \"data-display\",\n domain: \"data-display\",\n platforms: \"web\",\n parity: {\n native: { status: \"n/a\", reason: \"A figure of a reading page (a post, a docs site); an app screen lists the same elements and relations.\", use: \"list\" },\n desktop: \"web\",\n },\n whenToUse: [\n \"A post or a docs page that shows how a system is built: its context, its containers, its components.\",\n \"A dynamic view: the numbered steps of one flow (a request, a release, a pull request's life).\",\n \"A cockpit page that shows the architecture the code was checked against.\",\n ],\n whenNotToUse: [\n { when: \"An engine and the apps it serves, with what travels between them, on a landing.\", use: \"engine-flow\" },\n { when: \"A sequence of steps a person goes through.\", use: \"stepper\" },\n { when: \"Facts about one element.\", use: \"description-list\" },\n ],\n bestPractices: [\n \"Pass the view `@krizaka/architecture` laid out, unchanged: the component draws, it never lays out, so the drawing is the model's.\",\n \"One view per figure, under its view title; the `subtitle` says the level (`C4 · level 2`) or the source.\",\n \"Pass `links` by element id for the elements that have a page: they become links in the text version.\",\n \"Pass `words` in the page's language: the text version's headings are props.\",\n ],\n accessibility: {\n keyboard: [{ keys: \"Arrow keys\", action: \"Scroll the drawing in its frame (once the frame has focus) when it is wider than the screen.\" }],\n notes: [\n \"The drawing is one image (`role=\\\"img\\\"`) named by the view's title (`aria-label`); its text version is a `<details>` built from the same view: the elements (nested in their groups), then the relations or, in a dynamic view, the ordered steps.\",\n \"Every label is a text child, never markup: a hostile title renders as its characters.\",\n \"A link is only an `http:`/`https:` address, a same-site path or an anchor (`safeHref`); any other scheme is dropped.\",\n \"On a phone the drawing keeps a legible size and scrolls in its frame, which takes the keyboard focus; the text version is the phone reading.\",\n ],\n },\n related: [\"engine-flow\", \"description-list\", \"stepper\"],\n web: {\n imports: [\"ArchitectureDiagram\"],\n examples: [\n { name: \"context\", title: \"Context\", description: \"Who uses the system and what it relies on outside: a person, a browser, an external store.\" },\n { name: \"containers\", title: \"Containers\", description: \"The system as a group, its containers inside, a database below.\" },\n { name: \"dynamic\", title: \"Dynamic flow\", description: \"`dynamic: true`: the edges are numbered steps, and the text version lists them in order.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
168
+ },
169
+ {
170
+ "path": "cx.ts",
171
+ "content": "/** Joins class names, skipping the falsy ones. */\nexport function cx(...parts: Array<string | false | null | undefined>): string {\n return parts.filter(Boolean).join(\" \");\n}\n"
172
+ },
173
+ {
174
+ "path": "meta.ts",
175
+ "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"architecture-diagram\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"columns\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"copy-button\"\n | \"money-input\"\n | \"price-catalogue-editor\"\n | \"promo-code-field\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"waveform\"\n | \"proposal\"\n | \"qr-code\"\n | \"identity-card\"\n | \"entity-header\"\n | \"collection-switcher\"\n | \"marketing-layout\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"shop-gallery\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"schema-form\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Sovkora Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `experimental`: created for a filed need (ADR-008 §4), it may change or go in any minor until its first consumer imports it; `adoption`\n * names that consumer's issue. `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"experimental\" | \"stable\" | \"beta\" | \"deprecated\";\n\n/**\n * What a component is for (ADR-008 §3): the thirteen domains the documentation, the size budgets and the guards are\n * organised by. The domain is metadata: the entries stay flat (`@krizaka/ui/<name>`). `cahier` is the sites' register\n * (ADR-004): a product never imports it.\n */\nexport type Domain =\n | \"foundations\"\n | \"forms\"\n | \"data-display\"\n | \"navigation-shell\"\n | \"feedback\"\n | \"maps\"\n | \"media\"\n | \"commerce\"\n | \"identity\"\n | \"abuse\"\n | \"conversation\"\n | \"page-blocks\"\n | \"cahier\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** What it is for: one of the twelve domains (ADR-008 §3). */\n readonly domain: Domain;\n /** The `<repo>#<n>` issue of its first consumer: required for, and only for, an `experimental` component. */\n readonly adoption?: string;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
176
+ }
177
+ ],
178
+ "dependencies": [],
179
+ "registryDependencies": [],
180
+ "demo": {
181
+ "path": "examples/architecture-diagram/context.tsx",
182
+ "content": "import { ArchitectureDiagram, type ArchView } from \"@krizaka/ui/architecture-diagram\";\n\n/** A context view as @krizaka/architecture lays it out: who uses the system, and what it relies on outside. */\nconst view = {\n id: \"blog_context\",\n title: \"The blog · context\",\n dynamic: false,\n bounds: { x: 0, y: 0, width: 520, height: 470 },\n nodes: [\n { id: \"reader\", parent: null, kind: \"person\", shape: \"person\", title: \"Reader\", technology: null, description: \"Reads the posts on a phone or a laptop.\", compound: false, x: 150, y: 0, width: 220, height: 100 },\n { id: \"blog\", parent: null, kind: \"system\", shape: \"browser\", title: \"Blog\", technology: \"Next.js, static export\", description: \"Publishes the posts and their diagrams.\", compound: false, x: 130, y: 180, width: 260, height: 110 },\n { id: \"cdn\", parent: null, kind: \"external\", shape: \"storage\", title: \"Media CDN\", technology: \"Bunny\", description: \"Serves the images and the fonts.\", compound: false, x: 150, y: 370, width: 220, height: 100 },\n ],\n edges: [\n { id: \"reads\", source: \"reader\", target: \"blog\", label: \"reads\", points: [[260, 100], [260, 127], [260, 153], [260, 180]], labelBBox: { x: 272, y: 131, width: 44, height: 18 }, step: null, back: false },\n { id: \"loads\", source: \"blog\", target: \"cdn\", label: \"loads images from\", points: [[260, 290], [260, 317], [260, 343], [260, 370]], labelBBox: { x: 272, y: 321, width: 140, height: 18 }, step: null, back: false },\n ],\n} satisfies ArchView;\n\nexport default function ContextExample() {\n return <ArchitectureDiagram view={view} subtitle=\"C4 · level 1\" links={{ blog: \"https://blog.krizaka.com\" }} />;\n}\n"
183
+ },
184
+ "props": [
185
+ {
186
+ "component": "ArchitectureDiagram",
187
+ "description": "One laid-out C4 view (context, containers, components, or a dynamic flow) drawn on the plate: groups, elements by\nshape, edges with their labels and, in a dynamic view, numbered steps. The full text version follows it.",
188
+ "props": [
189
+ {
190
+ "name": "view",
191
+ "type": "ArchView",
192
+ "default": null,
193
+ "description": "One laid-out view, as `@krizaka/architecture` emits it: the component draws it and lays out nothing.",
194
+ "required": true
195
+ },
196
+ {
197
+ "name": "links",
198
+ "type": "Readonly<Record<string, string>>",
199
+ "default": null,
200
+ "description": "Links of the elements, by node id: each title of the text version becomes a link. Only `http:`/`https:` addresses\nand same-site paths are kept (`safeHref`); any other is dropped and the title stays plain text.",
201
+ "required": false
202
+ },
203
+ {
204
+ "name": "subtitle",
205
+ "type": "ReactNode",
206
+ "default": null,
207
+ "description": "One line beside the title: the view's scope, its source.",
208
+ "required": false
209
+ },
210
+ {
211
+ "name": "textOpen",
212
+ "type": "boolean",
213
+ "default": "false",
214
+ "description": "Opens the text version from the start (a page where the words are the main reading).",
215
+ "required": false
216
+ },
217
+ {
218
+ "name": "title",
219
+ "type": "string",
220
+ "default": "view.title",
221
+ "description": "The figure's title, shown above the drawing and read as the image's name.",
222
+ "required": false
223
+ },
224
+ {
225
+ "name": "words",
226
+ "type": "Partial<ArchitectureDiagramWords>",
227
+ "default": null,
228
+ "description": "The words of the text version.",
229
+ "required": false
230
+ }
231
+ ]
232
+ },
233
+ {
234
+ "component": "ArchNode",
235
+ "description": "A node of a laid-out view (pixels, rounded). `compound` nodes hold others (their `parent` points at them).",
236
+ "props": []
237
+ }
238
+ ]
239
+ }
@@ -238,7 +238,7 @@
238
238
  },
239
239
  {
240
240
  "path": "meta.ts",
241
- "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"columns\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"copy-button\"\n | \"money-input\"\n | \"price-catalogue-editor\"\n | \"promo-code-field\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"waveform\"\n | \"proposal\"\n | \"qr-code\"\n | \"identity-card\"\n | \"entity-header\"\n | \"collection-switcher\"\n | \"marketing-layout\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"shop-gallery\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"schema-form\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Sovkora Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `experimental`: created for a filed need (ADR-008 §4), it may change or go in any minor until its first consumer imports it; `adoption`\n * names that consumer's issue. `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"experimental\" | \"stable\" | \"beta\" | \"deprecated\";\n\n/**\n * What a component is for (ADR-008 §3): the thirteen domains the documentation, the size budgets and the guards are\n * organised by. The domain is metadata: the entries stay flat (`@krizaka/ui/<name>`). `cahier` is the sites' register\n * (ADR-004): a product never imports it.\n */\nexport type Domain =\n | \"foundations\"\n | \"forms\"\n | \"data-display\"\n | \"navigation-shell\"\n | \"feedback\"\n | \"maps\"\n | \"media\"\n | \"commerce\"\n | \"identity\"\n | \"abuse\"\n | \"conversation\"\n | \"page-blocks\"\n | \"cahier\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** What it is for: one of the twelve domains (ADR-008 §3). */\n readonly domain: Domain;\n /** The `<repo>#<n>` issue of its first consumer: required for, and only for, an `experimental` component. */\n readonly adoption?: string;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
241
+ "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"architecture-diagram\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"columns\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"copy-button\"\n | \"money-input\"\n | \"price-catalogue-editor\"\n | \"promo-code-field\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"waveform\"\n | \"proposal\"\n | \"qr-code\"\n | \"identity-card\"\n | \"entity-header\"\n | \"collection-switcher\"\n | \"marketing-layout\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"shop-gallery\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"schema-form\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Sovkora Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `experimental`: created for a filed need (ADR-008 §4), it may change or go in any minor until its first consumer imports it; `adoption`\n * names that consumer's issue. `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"experimental\" | \"stable\" | \"beta\" | \"deprecated\";\n\n/**\n * What a component is for (ADR-008 §3): the thirteen domains the documentation, the size budgets and the guards are\n * organised by. The domain is metadata: the entries stay flat (`@krizaka/ui/<name>`). `cahier` is the sites' register\n * (ADR-004): a product never imports it.\n */\nexport type Domain =\n | \"foundations\"\n | \"forms\"\n | \"data-display\"\n | \"navigation-shell\"\n | \"feedback\"\n | \"maps\"\n | \"media\"\n | \"commerce\"\n | \"identity\"\n | \"abuse\"\n | \"conversation\"\n | \"page-blocks\"\n | \"cahier\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** What it is for: one of the twelve domains (ADR-008 §3). */\n readonly domain: Domain;\n /** The `<repo>#<n>` issue of its first consumer: required for, and only for, an `experimental` component. */\n readonly adoption?: string;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
242
242
  }
243
243
  ],
244
244
  "dependencies": [],