@krizaka/ui 3.64.1 → 3.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (388) hide show
  1. package/README.md +3 -0
  2. package/dist/account-menu.d.ts +7 -3
  3. package/dist/account-menu.js +14 -10
  4. package/dist/account-menu.js.map +1 -1
  5. package/dist/account-settings.js +1 -1
  6. package/dist/action-bar.js +1 -1
  7. package/dist/app-frame/server.d.ts +123 -0
  8. package/dist/app-frame/server.js +109 -0
  9. package/dist/app-frame/server.js.map +1 -0
  10. package/dist/app-frame.d.ts +210 -0
  11. package/dist/app-frame.js +220 -0
  12. package/dist/app-frame.js.map +1 -0
  13. package/dist/app-header/search.js +1 -1
  14. package/dist/app-header.d.ts +3 -3
  15. package/dist/app-shell.js +1 -1
  16. package/dist/argument-card.js +2 -2
  17. package/dist/audio-player.js +1 -1
  18. package/dist/{chunk-5QEXOGO2.js → chunk-6BMKLAZ7.js} +1 -1
  19. package/dist/{chunk-XCBVFMNV.js.map → chunk-6BMKLAZ7.js.map} +1 -1
  20. package/dist/{chunk-SHBYNQFS.js → chunk-7DYZTEE3.js} +1 -1
  21. package/dist/{chunk-SHBYNQFS.js.map → chunk-7DYZTEE3.js.map} +1 -1
  22. package/dist/{chunk-YCZ7N6Q6.js → chunk-7MQNG35Q.js} +2 -2
  23. package/dist/{chunk-XCBVFMNV.js → chunk-C57KK5VB.js} +7 -2
  24. package/dist/chunk-C57KK5VB.js.map +1 -0
  25. package/dist/{chunk-VB7MWE2N.js → chunk-DSDFXPL6.js} +2 -2
  26. package/dist/{chunk-P7GZR5CU.js → chunk-GFRUTPGG.js} +1 -1
  27. package/dist/{chunk-P7GZR5CU.js.map → chunk-GFRUTPGG.js.map} +1 -1
  28. package/dist/{chunk-4GQH27IT.js → chunk-GW5EI7MI.js} +2 -2
  29. package/dist/{chunk-F6JTHPHE.js → chunk-I6EOLPSH.js} +2 -2
  30. package/dist/chunk-NG6G6V5E.js +33 -0
  31. package/dist/{chunk-5QEXOGO2.js.map → chunk-NG6G6V5E.js.map} +1 -1
  32. package/dist/{chunk-CPA5CF35.js → chunk-PGBF3UBX.js} +1 -1
  33. package/dist/{chunk-CPA5CF35.js.map → chunk-PGBF3UBX.js.map} +1 -1
  34. package/dist/{chunk-BG5APGX6.js → chunk-Q5DYWQ6S.js} +4 -4
  35. package/dist/{chunk-RCKXJEDQ.js → chunk-ST5P5HNI.js} +2 -2
  36. package/dist/code-block.js +1 -1
  37. package/dist/collection-switcher.d.ts +68 -0
  38. package/dist/collection-switcher.js +131 -0
  39. package/dist/collection-switcher.js.map +1 -0
  40. package/dist/combobox.js +2 -2
  41. package/dist/cover-hero.js +1 -1
  42. package/dist/data-table.js +4 -4
  43. package/dist/date-picker.js +1 -1
  44. package/dist/decision-list.js +1 -1
  45. package/dist/default-avatar-D9kiSFNB.d.ts +26 -0
  46. package/dist/desktop-window.d.ts +223 -0
  47. package/dist/desktop-window.js +261 -0
  48. package/dist/desktop-window.js.map +1 -0
  49. package/dist/docs-layout.js +1 -1
  50. package/dist/entity-header.d.ts +92 -0
  51. package/dist/entity-header.js +165 -0
  52. package/dist/entity-header.js.map +1 -0
  53. package/dist/file-upload.d.ts +2 -2
  54. package/dist/file-upload.js +1 -1
  55. package/dist/filter-bar.d.ts +3 -3
  56. package/dist/filter-bar.js +2 -2
  57. package/dist/genui.js +4 -4
  58. package/dist/language-switch.d.ts +9 -9
  59. package/dist/link-card.js +2 -2
  60. package/dist/list.js +1 -1
  61. package/dist/media-capture.js +1 -1
  62. package/dist/native.d.ts +337 -4
  63. package/dist/native.js +2841 -2111
  64. package/dist/native.js.map +1 -1
  65. package/dist/opening-hours.js +1 -1
  66. package/dist/page-hero.js +1 -1
  67. package/dist/pagination.js +1 -1
  68. package/dist/photo-grid.js +1 -1
  69. package/dist/pricing-page.js.map +1 -1
  70. package/dist/qr-code.d.ts +42 -0
  71. package/dist/qr-code.js +350 -0
  72. package/dist/qr-code.js.map +1 -0
  73. package/dist/radio-group.js +1 -1
  74. package/dist/rail-nav.js +1 -1
  75. package/dist/retro-tv.js +2 -2
  76. package/dist/search-field.js +2 -2
  77. package/dist/service-card.js +1 -1
  78. package/dist/shop-composer.js +1 -1
  79. package/dist/shop-composer.js.map +1 -1
  80. package/dist/site-cahier.js +1 -1
  81. package/dist/status-chip.js +1 -1
  82. package/dist/tag-input.js +2 -2
  83. package/dist/terminal-replay.js +1 -1
  84. package/dist/theme.d.ts +3 -1
  85. package/dist/theme.js +4 -0
  86. package/dist/theme.js.map +1 -1
  87. package/dist/tree-view.js +1 -1
  88. package/dist/video-player.js +2 -2
  89. package/dist/virtual.d.ts +3 -3
  90. package/package.json +91 -6
  91. package/registry/account-menu.json +22 -8
  92. package/registry/account-settings.json +2 -2
  93. package/registry/achievement.json +1 -1
  94. package/registry/action-bar.json +2 -2
  95. package/registry/activity-feed.json +1 -1
  96. package/registry/agenda.json +1 -1
  97. package/registry/alert.json +1 -1
  98. package/registry/analysis-report.json +1 -1
  99. package/registry/anatomy-plate.json +1 -1
  100. package/registry/app-frame.json +564 -0
  101. package/registry/app-header.json +2 -2
  102. package/registry/app-shell.json +2 -2
  103. package/registry/argument-card.json +2 -2
  104. package/registry/audio-player.json +2 -2
  105. package/registry/auth-layout.json +1 -1
  106. package/registry/avatar.json +1 -1
  107. package/registry/badge.json +1 -1
  108. package/registry/bird-plate.json +1 -1
  109. package/registry/button.json +1 -1
  110. package/registry/captcha.json +1 -1
  111. package/registry/card-grid.json +1 -1
  112. package/registry/card.json +1 -1
  113. package/registry/catalogue-page.json +1 -1
  114. package/registry/changelog-page.json +1 -1
  115. package/registry/chapter.json +1 -1
  116. package/registry/chat.json +1 -1
  117. package/registry/checkbox.json +1 -1
  118. package/registry/chip-link.json +1 -1
  119. package/registry/chip-row.json +1 -1
  120. package/registry/chip.json +1 -1
  121. package/registry/choice-grid.json +1 -1
  122. package/registry/code-block.json +2 -2
  123. package/registry/collection-switcher.json +436 -0
  124. package/registry/combobox.json +2 -2
  125. package/registry/command.json +1 -1
  126. package/registry/comparison-table.json +1 -1
  127. package/registry/component-page.json +1 -1
  128. package/registry/confirm-button.json +1 -1
  129. package/registry/contact-page.json +1 -1
  130. package/registry/continue-prompt.json +1 -1
  131. package/registry/countdown.json +1 -1
  132. package/registry/cover-hero.json +2 -2
  133. package/registry/cta-panel.json +1 -1
  134. package/registry/dashboard-layout.json +1 -1
  135. package/registry/data-table.json +2 -2
  136. package/registry/date-picker.json +4 -4
  137. package/registry/decision-list.json +2 -2
  138. package/registry/description-list.json +1 -1
  139. package/registry/desktop-window.json +407 -0
  140. package/registry/detail-layout.json +1 -1
  141. package/registry/dialog.json +1 -1
  142. package/registry/docs-article-page.json +1 -1
  143. package/registry/docs-hub-page.json +1 -1
  144. package/registry/docs-layout.json +2 -2
  145. package/registry/docs-nav.json +1 -1
  146. package/registry/document-viewer.json +1 -1
  147. package/registry/doodle.json +1 -1
  148. package/registry/drop-overlay.json +1 -1
  149. package/registry/dropdown-menu.json +1 -1
  150. package/registry/elephant.json +2 -2
  151. package/registry/embed-facade.json +1 -1
  152. package/registry/empty-state.json +1 -1
  153. package/registry/engine-flow.json +1 -1
  154. package/registry/entity-header.json +502 -0
  155. package/registry/environment-notice.json +1 -1
  156. package/registry/error-page.json +1 -1
  157. package/registry/examples/app-frame/admin.d.ts +4 -0
  158. package/registry/examples/app-frame/admin.js +32 -0
  159. package/registry/examples/app-frame/admin.tsx +33 -0
  160. package/registry/examples/app-frame/app.d.ts +4 -0
  161. package/registry/examples/app-frame/app.js +53 -0
  162. package/registry/examples/app-frame/app.tsx +56 -0
  163. package/registry/examples/collection-switcher/entity.d.ts +4 -0
  164. package/registry/examples/collection-switcher/entity.js +17 -0
  165. package/registry/examples/collection-switcher/entity.tsx +13 -0
  166. package/registry/examples/collection-switcher/list.d.ts +4 -0
  167. package/registry/examples/collection-switcher/list.js +32 -0
  168. package/registry/examples/collection-switcher/list.tsx +27 -0
  169. package/registry/examples/collection-switcher/native/list.d.ts +4 -0
  170. package/registry/examples/collection-switcher/native/list.dark.png +0 -0
  171. package/registry/examples/collection-switcher/native/list.js +18 -0
  172. package/registry/examples/collection-switcher/native/list.light.png +0 -0
  173. package/registry/examples/collection-switcher/native/list.tsx +14 -0
  174. package/registry/examples/collection-switcher/tree.d.ts +4 -0
  175. package/registry/examples/collection-switcher/tree.js +19 -0
  176. package/registry/examples/collection-switcher/tree.tsx +15 -0
  177. package/registry/examples/desktop-window/library.d.ts +4 -0
  178. package/registry/examples/desktop-window/library.js +49 -0
  179. package/registry/examples/desktop-window/library.tsx +58 -0
  180. package/registry/examples/entity-header/basic.d.ts +4 -0
  181. package/registry/examples/entity-header/basic.js +31 -0
  182. package/registry/examples/entity-header/basic.tsx +25 -0
  183. package/registry/examples/entity-header/native/basic.d.ts +4 -0
  184. package/registry/examples/entity-header/native/basic.dark.png +0 -0
  185. package/registry/examples/entity-header/native/basic.js +17 -0
  186. package/registry/examples/entity-header/native/basic.light.png +0 -0
  187. package/registry/examples/entity-header/native/basic.tsx +12 -0
  188. package/registry/examples/form-flow/native/signup.d.ts +4 -0
  189. package/registry/examples/form-flow/native/signup.dark.png +0 -0
  190. package/registry/examples/form-flow/native/signup.js +26 -0
  191. package/registry/examples/form-flow/native/signup.light.png +0 -0
  192. package/registry/examples/form-flow/native/signup.tsx +23 -0
  193. package/registry/examples/grid/native/columns.d.ts +4 -0
  194. package/registry/examples/grid/native/columns.dark.png +0 -0
  195. package/registry/examples/grid/native/columns.js +23 -0
  196. package/registry/examples/grid/native/columns.light.png +0 -0
  197. package/registry/examples/grid/native/columns.tsx +20 -0
  198. package/registry/examples/grid/native/photos.d.ts +4 -0
  199. package/registry/examples/grid/native/photos.dark.png +0 -0
  200. package/registry/examples/grid/native/photos.js +14 -0
  201. package/registry/examples/grid/native/photos.light.png +0 -0
  202. package/registry/examples/grid/native/photos.tsx +18 -0
  203. package/registry/examples/grid/native/stats.d.ts +4 -0
  204. package/registry/examples/grid/native/stats.dark.png +0 -0
  205. package/registry/examples/grid/native/stats.js +22 -0
  206. package/registry/examples/grid/native/stats.light.png +0 -0
  207. package/registry/examples/grid/native/stats.tsx +24 -0
  208. package/registry/examples/list-detail/native/inbox.d.ts +4 -0
  209. package/registry/examples/list-detail/native/inbox.dark.png +0 -0
  210. package/registry/examples/list-detail/native/inbox.js +35 -0
  211. package/registry/examples/list-detail/native/inbox.light.png +0 -0
  212. package/registry/examples/list-detail/native/inbox.tsx +35 -0
  213. package/registry/examples/qr-code/basic.d.ts +4 -0
  214. package/registry/examples/qr-code/basic.js +11 -0
  215. package/registry/examples/qr-code/basic.tsx +6 -0
  216. package/registry/examples/qr-code/calendar-feed.d.ts +4 -0
  217. package/registry/examples/qr-code/calendar-feed.js +24 -0
  218. package/registry/examples/qr-code/calendar-feed.tsx +18 -0
  219. package/registry/examples/qr-code/native/calendar-feed.d.ts +4 -0
  220. package/registry/examples/qr-code/native/calendar-feed.dark.png +0 -0
  221. package/registry/examples/qr-code/native/calendar-feed.js +25 -0
  222. package/registry/examples/qr-code/native/calendar-feed.light.png +0 -0
  223. package/registry/examples/qr-code/native/calendar-feed.tsx +19 -0
  224. package/registry/examples/screen/native/dashboard.d.ts +4 -0
  225. package/registry/examples/screen/native/dashboard.dark.png +0 -0
  226. package/registry/examples/screen/native/dashboard.js +48 -0
  227. package/registry/examples/screen/native/dashboard.light.png +0 -0
  228. package/registry/examples/screen/native/dashboard.tsx +52 -0
  229. package/registry/examples/screen/native/settings-home.d.ts +4 -0
  230. package/registry/examples/screen/native/settings-home.dark.png +0 -0
  231. package/registry/examples/screen/native/settings-home.js +26 -0
  232. package/registry/examples/screen/native/settings-home.light.png +0 -0
  233. package/registry/examples/screen/native/settings-home.tsx +25 -0
  234. package/registry/examples/shop/hero-tv.js +1 -1
  235. package/registry/examples/shop/hero-tv.tsx +1 -1
  236. package/registry/examples/state-screen/native/empty.d.ts +4 -0
  237. package/registry/examples/state-screen/native/empty.dark.png +0 -0
  238. package/registry/examples/state-screen/native/empty.js +12 -0
  239. package/registry/examples/state-screen/native/empty.light.png +0 -0
  240. package/registry/examples/state-screen/native/empty.tsx +11 -0
  241. package/registry/examples/state-screen/native/error.d.ts +4 -0
  242. package/registry/examples/state-screen/native/error.dark.png +0 -0
  243. package/registry/examples/state-screen/native/error.js +21 -0
  244. package/registry/examples/state-screen/native/error.light.png +0 -0
  245. package/registry/examples/state-screen/native/error.tsx +17 -0
  246. package/registry/examples/state-screen/native/offline.d.ts +4 -0
  247. package/registry/examples/state-screen/native/offline.dark.png +0 -0
  248. package/registry/examples/state-screen/native/offline.js +15 -0
  249. package/registry/examples/state-screen/native/offline.light.png +0 -0
  250. package/registry/examples/state-screen/native/offline.tsx +12 -0
  251. package/registry/field.json +1 -1
  252. package/registry/file-upload.json +2 -2
  253. package/registry/filter-bar.json +2 -2
  254. package/registry/flock.json +1 -1
  255. package/registry/footnote.json +1 -1
  256. package/registry/force-update-screen.json +1 -1
  257. package/registry/form-flow.json +152 -0
  258. package/registry/form.json +1 -1
  259. package/registry/gallery-page.json +1 -1
  260. package/registry/genui.json +1 -1
  261. package/registry/glossary-term.json +1 -1
  262. package/registry/glossary.json +1 -1
  263. package/registry/glow-card.json +1 -1
  264. package/registry/goal-gauge.json +1 -1
  265. package/registry/grade-stamp.json +1 -1
  266. package/registry/grid.json +262 -0
  267. package/registry/how-it-works-page.json +1 -1
  268. package/registry/image-cropper.json +1 -1
  269. package/registry/index.json +408 -12
  270. package/registry/iso.json +1 -1
  271. package/registry/kanban.json +1 -1
  272. package/registry/kbd.json +1 -1
  273. package/registry/kind-config-editor.json +1 -1
  274. package/registry/kpi-explained.json +1 -1
  275. package/registry/landing-page.json +1 -1
  276. package/registry/landscape.json +1 -1
  277. package/registry/language-switch.json +1 -1
  278. package/registry/legal-page.json +1 -1
  279. package/registry/link-card.json +2 -2
  280. package/registry/list-detail.json +188 -0
  281. package/registry/list.json +2 -2
  282. package/registry/loader.json +1 -1
  283. package/registry/longform-page.json +1 -1
  284. package/registry/maintenance-screen.json +1 -1
  285. package/registry/map.json +2 -2
  286. package/registry/margin-layout.json +1 -1
  287. package/registry/markdown.json +1 -1
  288. package/registry/marketing-layout.json +1 -1
  289. package/registry/marquee.json +1 -1
  290. package/registry/mascot-quote.json +1 -1
  291. package/registry/mascot-state.json +1 -1
  292. package/registry/mascots.json +1 -1
  293. package/registry/match-dialog.json +1 -1
  294. package/registry/media-capture.json +2 -2
  295. package/registry/media-gallery.json +1 -1
  296. package/registry/media-grid.json +1 -1
  297. package/registry/meta-row.json +1 -1
  298. package/registry/meter.json +1 -1
  299. package/registry/nav-bar.json +2 -2
  300. package/registry/next-actions.json +1 -1
  301. package/registry/notification-preferences.json +1 -1
  302. package/registry/number-ticker.json +1 -1
  303. package/registry/onboarding.json +3 -0
  304. package/registry/opening-hours.json +2 -2
  305. package/registry/page-header.json +1 -1
  306. package/registry/page-hero.json +2 -2
  307. package/registry/page-index.json +1 -1
  308. package/registry/page.json +1 -1
  309. package/registry/pagination.json +2 -2
  310. package/registry/photo-grid.json +2 -2
  311. package/registry/pointer-light.json +1 -1
  312. package/registry/popover.json +1 -1
  313. package/registry/pricing-page.json +2 -2
  314. package/registry/product-page.json +1 -1
  315. package/registry/profile-card.json +1 -1
  316. package/registry/progress.json +1 -1
  317. package/registry/promise-card.json +1 -1
  318. package/registry/qr-code.json +343 -0
  319. package/registry/quota-meter.json +1 -1
  320. package/registry/radio-group.json +2 -2
  321. package/registry/rail-nav.json +3 -3
  322. package/registry/recipes.json +1 -1
  323. package/registry/retro-tv.json +1 -1
  324. package/registry/reviews.json +1 -1
  325. package/registry/router.json +1 -1
  326. package/registry/screen.json +68 -4
  327. package/registry/scroll-stage.json +1 -1
  328. package/registry/search-field.json +2 -2
  329. package/registry/section-backdrop.json +1 -1
  330. package/registry/separator.json +1 -1
  331. package/registry/service-card.json +2 -2
  332. package/registry/settings-layout.json +5 -2
  333. package/registry/shop-composer.json +2 -2
  334. package/registry/shop.json +3 -3
  335. package/registry/showcase.json +1 -1
  336. package/registry/signature.json +1 -1
  337. package/registry/site-cahier.json +1 -1
  338. package/registry/site-footer.json +4 -4
  339. package/registry/sites.json +1 -1
  340. package/registry/skeleton.json +1 -1
  341. package/registry/skip-link.json +1 -1
  342. package/registry/slider.json +1 -1
  343. package/registry/slot-picker.json +1 -1
  344. package/registry/slot.json +1 -1
  345. package/registry/specimen-tag.json +1 -1
  346. package/registry/speed-lines.json +1 -1
  347. package/registry/spinner.json +1 -1
  348. package/registry/split-view.json +1 -1
  349. package/registry/stage-banner.json +1 -1
  350. package/registry/stat.json +1 -1
  351. package/registry/state-screen.json +224 -0
  352. package/registry/status-chip.json +2 -2
  353. package/registry/status-page.json +1 -1
  354. package/registry/step-progress.json +1 -1
  355. package/registry/step-showcase.json +1 -1
  356. package/registry/stepper.json +1 -1
  357. package/registry/sticky-action.json +1 -1
  358. package/registry/stuck.json +1 -1
  359. package/registry/swipe-deck.json +1 -1
  360. package/registry/switch.json +1 -1
  361. package/registry/tabs.json +1 -1
  362. package/registry/tag-input.json +1 -1
  363. package/registry/tag-selector.json +1 -1
  364. package/registry/taped-photo.json +1 -1
  365. package/registry/terminal-replay.json +2 -2
  366. package/registry/text-style.json +1 -1
  367. package/registry/theme.json +3 -3
  368. package/registry/toast.json +1 -1
  369. package/registry/toc.json +1 -1
  370. package/registry/tooltip.json +1 -1
  371. package/registry/tree-view.json +2 -2
  372. package/registry/update-prompt.json +1 -1
  373. package/registry/upload-queue.json +1 -1
  374. package/registry/usage.json +1 -1
  375. package/registry/verified-badge.json +1 -1
  376. package/registry/versus-card.json +1 -1
  377. package/registry/vertical-video.json +1 -1
  378. package/registry/video-player.json +2 -2
  379. package/registry/video-trimmer.json +1 -1
  380. package/registry/virtual.json +1 -1
  381. package/registry/wall.json +1 -1
  382. package/registry/waveform.json +1 -1
  383. /package/dist/{chunk-YCZ7N6Q6.js.map → chunk-7MQNG35Q.js.map} +0 -0
  384. /package/dist/{chunk-VB7MWE2N.js.map → chunk-DSDFXPL6.js.map} +0 -0
  385. /package/dist/{chunk-4GQH27IT.js.map → chunk-GW5EI7MI.js.map} +0 -0
  386. /package/dist/{chunk-F6JTHPHE.js.map → chunk-I6EOLPSH.js.map} +0 -0
  387. /package/dist/{chunk-BG5APGX6.js.map → chunk-Q5DYWQ6S.js.map} +0 -0
  388. /package/dist/{chunk-RCKXJEDQ.js.map → chunk-ST5P5HNI.js.map} +0 -0
@@ -0,0 +1,502 @@
1
+ {
2
+ "name": "entity-header",
3
+ "type": "primitive",
4
+ "title": "Entity header",
5
+ "summary": "The head of an entity (a collection, a shop, a studio): its picture, its name and description edited where they are read, its tags, and a refusal said with the product's own words.",
6
+ "description": "The head of an entity (a collection, a shop, a studio): its picture, its name and description edited where they are read, its tags, and a refusal said with the product's own words.",
7
+ "status": "beta",
8
+ "deprecated": null,
9
+ "category": "blocks",
10
+ "platforms": "both",
11
+ "parity": {
12
+ "web": {
13
+ "state": "yes"
14
+ },
15
+ "native": {
16
+ "state": "yes"
17
+ },
18
+ "desktop": {
19
+ "state": "yes"
20
+ }
21
+ },
22
+ "whenToUse": [
23
+ "At the top of the page of one collection, shop or studio, where the owner renames it, describes it and changes its picture.",
24
+ "When the server answers with a refusal code (`NAME_TAKEN`, `AVATAR_NOT_ALLOWED`, `DEFAULT_COLLECTION`) and the page must say it in words."
25
+ ],
26
+ "whenNotToUse": [
27
+ {
28
+ "when": "For the signed-in person's own profile and picture.",
29
+ "use": "account-settings"
30
+ },
31
+ {
32
+ "when": "To move between collections.",
33
+ "use": "collection-switcher"
34
+ }
35
+ ],
36
+ "bestPractices": [
37
+ "Give `onNameChange` only when the viewer may rename: without it the name is plain text, not a button.",
38
+ "Throw an error with a `code` from `onNameChange` to show `refusals[code]`; the field stays open with the text typed.",
39
+ "Pass `refusals` for the codes your product can get; a code without a message says nothing, so the product never shows raw codes."
40
+ ],
41
+ "accessibility": {
42
+ "keyboard": [
43
+ {
44
+ "keys": "Enter",
45
+ "action": "On the name or description: opens the field. In the field: saves."
46
+ },
47
+ {
48
+ "keys": "Escape",
49
+ "action": "In the field: gives back the previous text."
50
+ },
51
+ {
52
+ "keys": "Tab",
53
+ "action": "Leaves the field, which saves it."
54
+ }
55
+ ],
56
+ "notes": [
57
+ "The name is the page's `h1`; the button inside it is named by `nameLabel`.",
58
+ "A refusal is announced as an alert, in the product's words.",
59
+ "The picture's button is named by `triggerLabel`; the picker inside it is the library's radio group."
60
+ ]
61
+ },
62
+ "related": [
63
+ "account-settings",
64
+ "collection-switcher",
65
+ "tag-selector"
66
+ ],
67
+ "web": {
68
+ "entry": "@krizaka/ui/entity-header",
69
+ "import": "import { EntityHeader } from \"@krizaka/ui/entity-header\";",
70
+ "props": [
71
+ {
72
+ "component": "EntityHeader",
73
+ "description": "The head of an entity: picture, name and description editable in place, tags, a refusal said in words, actions.",
74
+ "props": [
75
+ {
76
+ "name": "name",
77
+ "type": "string",
78
+ "default": null,
79
+ "description": "The entity's name.",
80
+ "required": true
81
+ },
82
+ {
83
+ "name": "actions",
84
+ "type": "ReactNode",
85
+ "default": null,
86
+ "description": "After the text: the actions of the entity (a menu, a button).",
87
+ "required": false
88
+ },
89
+ {
90
+ "name": "avatar",
91
+ "type": "EntityAvatar",
92
+ "default": null,
93
+ "description": "The picture.",
94
+ "required": false
95
+ },
96
+ {
97
+ "name": "avatarPicker",
98
+ "type": "{ label: string; kind?: DefaultAvatarEntityKind; options: readonly EntityAvatarOption[]; noneLabel?: string; value?: string | undefined; onValueChange?: ((id: string) => void) | undefined; triggerLabel: string; } | undefined",
99
+ "default": null,
100
+ "description": "Makes the picture changeable: a button over it opens the library's `AvatarPicker`.",
101
+ "required": false
102
+ },
103
+ {
104
+ "name": "className",
105
+ "type": "string",
106
+ "default": null,
107
+ "description": "Classes merged last, on the header.",
108
+ "required": false
109
+ },
110
+ {
111
+ "name": "description",
112
+ "type": "string",
113
+ "default": null,
114
+ "description": "One line under the name.",
115
+ "required": false
116
+ },
117
+ {
118
+ "name": "descriptionLabel",
119
+ "type": "string",
120
+ "default": "Description",
121
+ "description": "What editing the description does (“Edit the description”), passed translated: the field's name, and the button's after the visible text.",
122
+ "required": false
123
+ },
124
+ {
125
+ "name": "descriptionPlaceholder",
126
+ "type": "string",
127
+ "default": null,
128
+ "description": "Shown when there is no description and it is editable (“Add a description”), passed translated.",
129
+ "required": false
130
+ },
131
+ {
132
+ "name": "nameLabel",
133
+ "type": "string",
134
+ "default": null,
135
+ "description": "What editing the name does (“Rename the collection”), passed translated: the field's name, and the button's after the visible name.",
136
+ "required": false
137
+ },
138
+ {
139
+ "name": "onDescriptionChange",
140
+ "type": "((description: string) => void | Promise<void>)",
141
+ "default": null,
142
+ "description": "Makes the description editable in place. Same contract as `onNameChange`.",
143
+ "required": false
144
+ },
145
+ {
146
+ "name": "onNameChange",
147
+ "type": "((name: string) => void | Promise<void>)",
148
+ "default": null,
149
+ "description": "Makes the name editable in place: called with the trimmed new name. Throw (or reject with) an error carrying a `code` to show its refusal.",
150
+ "required": false
151
+ },
152
+ {
153
+ "name": "onTagRemove",
154
+ "type": "((id: string) => void)",
155
+ "default": null,
156
+ "description": "Lets the viewer remove a tag: each `TagChip` gets a remove button. Without it the tags are read-only labels.",
157
+ "required": false
158
+ },
159
+ {
160
+ "name": "refusal",
161
+ "type": "{ code: OrganizeCode; } | null",
162
+ "default": null,
163
+ "description": "A refusal to say now (the last answer of the server), by its code.",
164
+ "required": false
165
+ },
166
+ {
167
+ "name": "refusals",
168
+ "type": "Partial<Record<OrganizeCode, string>>",
169
+ "default": null,
170
+ "description": "The messages by refusal code: `NAME_TAKEN`, `AVATAR_NOT_ALLOWED`, `DEFAULT_COLLECTION`, … A code with no message says nothing.",
171
+ "required": false
172
+ },
173
+ {
174
+ "name": "tagRemoveLabel",
175
+ "type": "((label: string) => string)",
176
+ "default": null,
177
+ "description": "The remove button's accessible name for a tag (“Remove Seasonal”), passed translated.",
178
+ "required": false
179
+ },
180
+ {
181
+ "name": "tags",
182
+ "type": "readonly EntityTag[]",
183
+ "default": null,
184
+ "description": "The entity's tags.",
185
+ "required": false
186
+ },
187
+ {
188
+ "name": "tagsLabel",
189
+ "type": "string",
190
+ "default": null,
191
+ "description": "The accessible name of the tags' list (“Tags”), passed translated.",
192
+ "required": false
193
+ }
194
+ ]
195
+ }
196
+ ],
197
+ "examples": [
198
+ {
199
+ "name": "basic",
200
+ "title": "Rename in place",
201
+ "description": "Name and description edited where they are read; a taken name is refused in words.",
202
+ "path": "examples/entity-header/basic.tsx",
203
+ "module": "@krizaka/ui/registry/examples/entity-header/basic",
204
+ "code": "import { EntityHeader } from \"@krizaka/ui/entity-header\";\nimport * as React from \"react\";\n\n// A collection's head: rename it in place (Enter saves, Escape gives it back). A taken name comes back as a code, and the page says it in its words.\nexport default function EntityHeaderBasic() {\n const [name, setName] = React.useState(\"Spring bookings\");\n return (\n <EntityHeader\n name={name}\n nameLabel=\"Rename the collection\"\n onNameChange={async (next) => {\n if (next === \"Archive\") throw Object.assign(new Error(\"taken\"), { code: \"NAME_TAKEN\" });\n setName(next);\n }}\n description=\"Everything booked from March to May.\"\n avatar={{ defaultAvatar: { brand: \"krizaka\", kind: \"folder\", tone: 3 } }}\n tags={[\n { id: \"1\", label: \"Seasonal\", marker: \"blue\" },\n { id: \"2\", label: \"Priority\", marker: \"amber\" },\n ]}\n tagsLabel=\"Tags\"\n refusals={{ NAME_TAKEN: \"Another collection already has this name.\" }}\n />\n );\n}\n"
205
+ }
206
+ ]
207
+ },
208
+ "native": {
209
+ "entry": "@krizaka/ui/native",
210
+ "import": "import { EntityHeader } from \"@krizaka/ui/native\";",
211
+ "differences": [
212
+ "Same data. The picture is a button (`onAvatarPress`, `avatarLabel`): the app opens its own picker. The name and description edit in a text field on a tap."
213
+ ],
214
+ "deprecated": null,
215
+ "props": [
216
+ {
217
+ "component": "EntityHeader",
218
+ "description": "The head of an entity: picture, name and description editable in place, tags, a refusal said in words, actions.",
219
+ "props": [
220
+ {
221
+ "name": "name",
222
+ "type": "string",
223
+ "default": null,
224
+ "description": "The entity's name.",
225
+ "required": true
226
+ },
227
+ {
228
+ "name": "actions",
229
+ "type": "ReactNode",
230
+ "default": null,
231
+ "description": "After the text: the actions of the entity (a menu, a button).",
232
+ "required": false
233
+ },
234
+ {
235
+ "name": "avatar",
236
+ "type": "EntityAvatar",
237
+ "default": null,
238
+ "description": "The picture.",
239
+ "required": false
240
+ },
241
+ {
242
+ "name": "avatarLabel",
243
+ "type": "string",
244
+ "default": null,
245
+ "description": "The accessible name of the picture's button (“Change the picture”), passed translated.",
246
+ "required": false
247
+ },
248
+ {
249
+ "name": "description",
250
+ "type": "string",
251
+ "default": null,
252
+ "description": "One line under the name.",
253
+ "required": false
254
+ },
255
+ {
256
+ "name": "descriptionLabel",
257
+ "type": "string",
258
+ "default": "Description",
259
+ "description": "What editing the description does (“Edit the description”), passed translated: the field's name, and the button's after the visible text.",
260
+ "required": false
261
+ },
262
+ {
263
+ "name": "descriptionPlaceholder",
264
+ "type": "string",
265
+ "default": null,
266
+ "description": "Shown when there is no description and it is editable (“Add a description”), passed translated.",
267
+ "required": false
268
+ },
269
+ {
270
+ "name": "nameLabel",
271
+ "type": "string",
272
+ "default": null,
273
+ "description": "What editing the name does (“Rename the collection”), passed translated: the field's name, and the button's after the visible name.",
274
+ "required": false
275
+ },
276
+ {
277
+ "name": "onAvatarPress",
278
+ "type": "(() => void)",
279
+ "default": null,
280
+ "description": "Makes the picture a button; the app opens its picker.",
281
+ "required": false
282
+ },
283
+ {
284
+ "name": "onDescriptionChange",
285
+ "type": "((description: string) => void | Promise<void>)",
286
+ "default": null,
287
+ "description": "Makes the description editable in place. Same contract as `onNameChange`.",
288
+ "required": false
289
+ },
290
+ {
291
+ "name": "onNameChange",
292
+ "type": "((name: string) => void | Promise<void>)",
293
+ "default": null,
294
+ "description": "Makes the name editable in place: called with the trimmed new name. Throw (or reject with) an error carrying a `code` to show its refusal.",
295
+ "required": false
296
+ },
297
+ {
298
+ "name": "refusal",
299
+ "type": "{ code: OrganizeCode; } | null",
300
+ "default": null,
301
+ "description": "A refusal to say now (the last answer of the server), by its code.",
302
+ "required": false
303
+ },
304
+ {
305
+ "name": "refusals",
306
+ "type": "Partial<Record<OrganizeCode, string>>",
307
+ "default": null,
308
+ "description": "The messages by refusal code: `NAME_TAKEN`, `AVATAR_NOT_ALLOWED`, `DEFAULT_COLLECTION`, … A code with no message says nothing.",
309
+ "required": false
310
+ },
311
+ {
312
+ "name": "tags",
313
+ "type": "readonly EntityTag[]",
314
+ "default": null,
315
+ "description": "The entity's tags.",
316
+ "required": false
317
+ }
318
+ ]
319
+ }
320
+ ],
321
+ "examples": [
322
+ {
323
+ "name": "basic",
324
+ "title": "Rename in place",
325
+ "description": "Tap the name to rename it; a taken name is refused in words.",
326
+ "path": "examples/entity-header/native/basic.tsx",
327
+ "module": "@krizaka/ui/registry/examples/entity-header/native/basic",
328
+ "code": "import { EntityHeader } from \"@krizaka/ui/native\";\nimport * as React from \"react\";\n\n// Tap the name to rename it; the same refusal codes as the web, said in the page's words.\nexport default function NativeEntityHeaderBasic() {\n const [name, setName] = React.useState(\"Weddings\");\n const rename = async (next: string) => {\n if (next === \"Archive\") throw Object.assign(new Error(\"taken\"), { code: \"NAME_TAKEN\" });\n setName(next);\n };\n return <EntityHeader name={name} nameLabel=\"Rename\" onNameChange={rename} description=\"Ceremonies and receptions.\" refusals={{ NAME_TAKEN: \"This name is taken.\" }} />;\n}\n",
329
+ "screenshots": {
330
+ "dark": "examples/entity-header/native/basic.dark.png",
331
+ "light": "examples/entity-header/native/basic.light.png"
332
+ }
333
+ }
334
+ ]
335
+ },
336
+ "files": [
337
+ {
338
+ "path": "entity-header/entity-header.tsx",
339
+ "content": "// Client (inline editing, the avatar popover). The head of an entity — a collection, a shop, a studio: its picture, its\n// name and description edited where they are read, its tags. Plain data in (the shapes of `@krizaka/organize/contract`),\n// a refusal `code` out, mapped to the message the product passes.\nimport { AvatarPicker } from \"@krizaka/ui/account-settings\";\nimport { Avatar } from \"@krizaka/ui/avatar\";\nimport { TagChip, TagMarker } from \"@krizaka/ui/chip\";\nimport { cn } from \"@krizaka/ui/cn\";\nimport { Popover } from \"@krizaka/ui/popover\";\nimport * as React from \"react\";\n\nimport { PencilGlyph } from \"../glyphs\";\nimport { type EditableBase, editName, type EntityAvatarOption, type EntityHeaderBase, type EntityRefusals, type EntityTag, useEditable, useRefusal } from \"./shared\";\n\nexport type { EntityRefusals, EntityTag };\n\nexport type EntityHeaderProps = EntityHeaderBase & {\n /** Makes the picture changeable: a button over it opens the library's `AvatarPicker`. */\n avatarPicker?: {\n /** The picker's accessible name (“Profile picture”), passed translated. */\n label: string;\n /** What the pictures are of: `folder`, `organisation`, `shop`, `person`. */\n kind?: EntityAvatarOption[\"kind\"];\n /** The pictures to choose from. */\n options: readonly EntityAvatarOption[];\n /** Adds a « no picture » tile first, with these words, passed translated. */\n noneLabel?: string;\n /** The chosen id. */\n value?: string;\n /** The viewer chooses another picture. */\n onValueChange?: (id: string) => void;\n /** The accessible name of the picture's button (“Change the picture”), passed translated. */\n triggerLabel: string;\n };\n /** The accessible name of the tags' list (“Tags”), passed translated. */\n tagsLabel?: string;\n /** Lets the viewer remove a tag: each `TagChip` gets a remove button. Without it the tags are read-only labels. */\n onTagRemove?: (id: string) => void;\n /** The remove button's accessible name for a tag (“Remove Seasonal”), passed translated. */\n tagRemoveLabel?: (label: string) => string;\n /** Classes merged last, on the header. */\n className?: string;\n};\n\ntype EditableProps = EditableBase & { className: string; inputClassName: string; multiline?: boolean };\n\n/** Text that reads as text and edits in place: Enter saves, Escape gives it back, leaving the field saves. */\nfunction Editable({ value, label, placeholder, onCommit, onRefusal, className, inputClassName, required, multiline }: EditableProps) {\n const { editing, draft, setDraft, pending, open, stop, commit } = useEditable(value, onCommit, onRefusal, required);\n const input = React.useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n React.useEffect(() => {\n if (editing) input.current?.focus();\n }, [editing, pending]);\n if (!onCommit) return value ? <p className={className}>{value}</p> : null;\n\n if (!editing) {\n return (\n <button\n type=\"button\"\n aria-label={editName(value, placeholder, label)}\n onClick={open}\n className={cn(className, \"group/edit -mx-1 inline-flex max-w-full items-center gap-2 rounded-md px-1 text-start hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\")}\n >\n <span className={cn(\"min-w-0 truncate\", !value && \"text-fg-muted\")}>{value || placeholder}</span>\n <PencilGlyph aria-hidden className=\"h-3.5 w-3.5 shrink-0 text-fg-muted opacity-0 group-hover/edit:opacity-100 group-focus-visible/edit:opacity-100 [@media(hover:none)]:opacity-100\" />\n </button>\n );\n }\n const shared = {\n ref: input as never,\n value: draft,\n \"aria-label\": label,\n disabled: pending,\n onChange: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => setDraft(event.target.value),\n onBlur: () => void commit(),\n onKeyDown: (event: React.KeyboardEvent) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n stop();\n } else if (event.key === \"Enter\" && !(multiline && event.shiftKey)) {\n event.preventDefault();\n void commit();\n }\n },\n className: cn(inputClassName, \"w-full rounded-md border border-border-control bg-surface-1 px-2 py-1 outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring\"),\n };\n return multiline ? <textarea rows={2} {...shared} /> : <input type=\"text\" {...shared} />;\n}\n\n/** The head of an entity: picture, name and description editable in place, tags, a refusal said in words, actions. */\nexport function EntityHeader({\n name,\n onNameChange,\n nameLabel = name,\n description,\n onDescriptionChange,\n descriptionLabel = \"Description\",\n descriptionPlaceholder,\n avatar,\n avatarPicker,\n tags,\n tagsLabel,\n onTagRemove,\n tagRemoveLabel,\n refusal,\n refusals,\n actions,\n className,\n}: EntityHeaderProps) {\n const { message, setLocal } = useRefusal(refusal, refusals);\n const picture = <Avatar size=\"xl\" alt=\"\" {...avatar} />;\n const errorId = React.useId();\n\n return (\n <header className={cn(\"flex flex-wrap items-start gap-4\", className)} data-entity-header>\n {avatarPicker ? (\n <Popover.Root>\n <Popover.Trigger asChild>\n <button type=\"button\" aria-label={avatarPicker.triggerLabel} className=\"shrink-0 rounded-full focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\">\n {picture}\n </button>\n </Popover.Trigger>\n <Popover.Content className=\"w-80\" align=\"start\">\n <AvatarPicker {...avatarPicker} dense />\n </Popover.Content>\n </Popover.Root>\n ) : avatar ? (\n <span className=\"shrink-0\">{picture}</span>\n ) : null}\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <h1 className=\"m-0 min-w-0 text-xl font-semibold text-fg-title\">\n <Editable\n value={name}\n label={nameLabel}\n onCommit={onNameChange}\n onRefusal={setLocal}\n className=\"text-xl font-semibold text-fg-title\"\n inputClassName=\"text-xl font-semibold text-fg-title\"\n required\n />\n </h1>\n {description || onDescriptionChange ? (\n <Editable\n value={description ?? \"\"}\n label={descriptionLabel}\n placeholder={descriptionPlaceholder}\n onCommit={onDescriptionChange}\n onRefusal={setLocal}\n className=\"text-sm text-fg-secondary\"\n inputClassName=\"text-sm text-fg-secondary\"\n multiline\n />\n ) : null}\n {tags?.length ? (\n <ul aria-label={tagsLabel} className=\"m-0 mt-1 flex list-none flex-wrap gap-1.5 p-0\">\n {tags.map((tag) => (\n <li key={tag.id}>\n {onTagRemove ? (\n <TagChip marker={tag.marker} removable removeLabel={tagRemoveLabel?.(tag.label) ?? tag.label} onRemove={() => onTagRemove(tag.id)}>\n {tag.label}\n </TagChip>\n ) : (\n <span className=\"inline-flex items-center gap-1.5 rounded-full border border-border-default px-2.5 py-0.5 text-xs text-fg\">\n <TagMarker marker={tag.marker} />\n {tag.label}\n </span>\n )}\n </li>\n ))}\n </ul>\n ) : null}\n {message ? (\n <p id={errorId} role=\"alert\" className=\"m-0 text-sm text-danger-text\">\n {message}\n </p>\n ) : null}\n </div>\n {actions ? <div className=\"flex shrink-0 items-center gap-2\">{actions}</div> : null}\n </header>\n );\n}\n"
340
+ },
341
+ {
342
+ "path": "entity-header/index.ts",
343
+ "content": "/** @krizaka/ui/entity-header — `EntityHeader`: the head of an entity (a collection, a shop, a studio) — picture, name and description edited in place, tags, a refusal `code` said with the product's words. Client (\"use client\"). */\nexport { EntityHeader, type EntityHeaderProps, type EntityRefusals, type EntityTag } from \"./entity-header\";\n"
344
+ },
345
+ {
346
+ "path": "entity-header/meta.ts",
347
+ "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Entity header\",\n summary:\n \"The head of an entity (a collection, a shop, a studio): its picture, its name and description edited where they are read, its tags, and a refusal said with the product's own words.\",\n status: \"beta\",\n category: \"blocks\",\n platforms: \"both\",\n parity: { desktop: \"web\" },\n whenToUse: [\n \"At the top of the page of one collection, shop or studio, where the owner renames it, describes it and changes its picture.\",\n \"When the server answers with a refusal code (`NAME_TAKEN`, `AVATAR_NOT_ALLOWED`, `DEFAULT_COLLECTION`) and the page must say it in words.\",\n ],\n whenNotToUse: [\n { when: \"For the signed-in person's own profile and picture.\", use: \"account-settings\" },\n { when: \"To move between collections.\", use: \"collection-switcher\" },\n ],\n bestPractices: [\n \"Give `onNameChange` only when the viewer may rename: without it the name is plain text, not a button.\",\n \"Throw an error with a `code` from `onNameChange` to show `refusals[code]`; the field stays open with the text typed.\",\n \"Pass `refusals` for the codes your product can get; a code without a message says nothing, so the product never shows raw codes.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Enter\", action: \"On the name or description: opens the field. In the field: saves.\" },\n { keys: \"Escape\", action: \"In the field: gives back the previous text.\" },\n { keys: \"Tab\", action: \"Leaves the field, which saves it.\" },\n ],\n notes: [\n \"The name is the page's `h1`; the button inside it is named by `nameLabel`.\",\n \"A refusal is announced as an alert, in the product's words.\",\n \"The picture's button is named by `triggerLabel`; the picker inside it is the library's radio group.\",\n ],\n },\n related: [\"account-settings\", \"collection-switcher\", \"tag-selector\"],\n web: {\n imports: [\"EntityHeader\"],\n examples: [{ name: \"basic\", title: \"Rename in place\", description: \"Name and description edited where they are read; a taken name is refused in words.\" }],\n },\n native: {\n imports: [\"EntityHeader\"],\n differences: [\n \"Same data. The picture is a button (`onAvatarPress`, `avatarLabel`): the app opens its own picker. The name and description edit in a text field on a tap.\",\n ],\n examples: [{ name: \"basic\", title: \"Rename in place\", description: \"Tap the name to rename it; a taken name is refused in words.\" }],\n },\n} satisfies ComponentMeta;\n"
348
+ },
349
+ {
350
+ "path": "entity-header/shared.ts",
351
+ "content": "// What the web and the native EntityHeader share: plain data, the refusal vocabulary, the code of a thrown refusal.\n// No component and no web import, so the native bundle never reaches the web files.\nimport type { Marker, OrganizeCode } from \"@krizaka/organize/contract\";\nimport * as React from \"react\";\n\nimport type { DefaultAvatar, DefaultAvatarEntityKind } from \"../avatar/default-avatar\";\n\n/** The refusals a header knows how to say: the product passes the words (translated) for the codes it can get. */\nexport type EntityRefusals = Partial<Record<OrganizeCode, string>>;\n\n/** The entity's picture: an address, or one of Krizaka's default pictures. */\nexport type EntityAvatar = { src?: string | null; defaultAvatar?: DefaultAvatar; fallback?: React.ReactNode };\n\n/** One picture to choose from (the shape of `AvatarPicker`'s options). */\nexport type EntityAvatarOption = {\n /** The value of the choice. */\n id: string;\n /** Its name for assistive technology, passed translated. */\n label: string;\n /** A picture's address; otherwise `defaultAvatar` draws one of the family's pictures. */\n src?: string;\n /** One of Krizaka's default pictures. */\n defaultAvatar?: DefaultAvatar;\n /** What this picture is of. */\n kind?: DefaultAvatarEntityKind;\n};\n\nexport type EntityTag = { id: string; label: string; marker: Marker };\n\n/** The refusal `code` carried by a thrown error (an `OrganizeError`, or any error with a string `code`). */\nexport function refusalCode(error: unknown): OrganizeCode | undefined {\n const code = typeof error === \"object\" && error !== null ? (error as { code?: unknown }).code : undefined;\n return typeof code === \"string\" ? (code as OrganizeCode) : undefined;\n}\n\n/** The props both platforms take: plain data, the editing callbacks, the refusals. */\nexport type EntityHeaderBase = {\n /** The entity's name. */\n name: string;\n /** Makes the name editable in place: called with the trimmed new name. Throw (or reject with) an error carrying a `code` to show its refusal. */\n onNameChange?: (name: string) => void | Promise<void>;\n /** What editing the name does (“Rename the collection”), passed translated: the field's name, and the button's after the visible name. */\n nameLabel?: string;\n /** One line under the name. */\n description?: string;\n /** Makes the description editable in place. Same contract as `onNameChange`. */\n onDescriptionChange?: (description: string) => void | Promise<void>;\n /** What editing the description does (“Edit the description”), passed translated: the field's name, and the button's after the visible text. */\n descriptionLabel?: string;\n /** Shown when there is no description and it is editable (“Add a description”), passed translated. */\n descriptionPlaceholder?: string;\n /** The picture. */\n avatar?: EntityAvatar;\n /** The entity's tags. */\n tags?: readonly EntityTag[];\n /** A refusal to say now (the last answer of the server), by its code. */\n refusal?: { code: OrganizeCode } | null;\n /** The messages by refusal code: `NAME_TAKEN`, `AVATAR_NOT_ALLOWED`, `DEFAULT_COLLECTION`, … A code with no message says nothing. */\n refusals?: EntityRefusals;\n /** After the text: the actions of the entity (a menu, a button). */\n actions?: React.ReactNode;\n};\n\n/** The text a button label reads: the visible text first, then what the button does (the accessible name contains the visible text). */\nexport const editName = (visible: string, placeholder: string | undefined, label: string) => `${visible || placeholder || \"\"} (${label})`.trim();\n\n/**\n * The state of a field edited in place: Enter or blur saves (a trimmed text, never an empty one when `required`),\n * Escape gives the text back, a thrown refusal keeps the field open and is reported by its code.\n */\nexport function useEditable(value: string, onCommit: ((value: string) => void | Promise<void>) | undefined, onRefusal: (code: OrganizeCode | undefined) => void, required?: boolean) {\n const [editing, setEditing] = React.useState(false);\n const [draft, setDraft] = React.useState(value);\n const [pending, setPending] = React.useState(false);\n const open = () => {\n setDraft(value);\n setEditing(true);\n };\n const stop = () => {\n setEditing(false);\n setDraft(value);\n };\n const commit = async () => {\n if (pending) return;\n const next = draft.trim();\n if (!onCommit || next === value || (required && next === \"\")) return stop();\n setPending(true);\n try {\n await onCommit(next);\n onRefusal(undefined);\n setEditing(false);\n } catch (error) {\n onRefusal(refusalCode(error));\n } finally {\n setPending(false);\n }\n };\n return { editing, draft, setDraft, pending, open, stop, commit };\n}\n\n/** The refusal to say: the one a save just raised, else the one the page passes, in the product's words (none when it has none). */\nexport function useRefusal(refusal: EntityHeaderBase[\"refusal\"], refusals: EntityRefusals | undefined) {\n const [local, setLocal] = React.useState<OrganizeCode | undefined>();\n const code = local ?? refusal?.code;\n return { message: code ? refusals?.[code] : undefined, setLocal };\n}\n\n/** The props of a field edited in place, on both platforms. */\nexport type EditableBase = {\n value: string;\n label: string;\n placeholder?: string;\n onCommit?: (value: string) => void | Promise<void>;\n onRefusal: (code: OrganizeCode | undefined) => void;\n required?: boolean;\n};\n"
352
+ },
353
+ {
354
+ "path": "glyphs.tsx",
355
+ "content": "// The small line glyphs the data and media primitives draw (play, volume, search, chevrons…): decorative, 24-unit\n// box, `currentColor`, sized by the caller's class. Shared by the entries that need them; never exported on its own —\n// a product draws its own icons with @krizaka/icons.\nimport type * as React from \"react\";\n\ntype GlyphProps = { className?: string };\n\nfunction Glyph({ className = \"h-4 w-4\", fill, children }: GlyphProps & { fill?: boolean; children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n className={className}\n fill={fill ? \"currentColor\" : \"none\"}\n stroke={fill ? \"none\" : \"currentColor\"}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n {children}\n </svg>\n );\n}\n\nexport const PlayGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <path d=\"M8 5.5v13a1 1 0 0 0 1.5.86l10.4-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z\" />\n </Glyph>\n);\nexport const PauseGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n <rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n </Glyph>\n);\nexport const VolumeGlyph = ({ muted, ...p }: GlyphProps & { muted?: boolean }) => (\n <Glyph {...p}>\n <path d=\"M11 5 6 9H3v6h3l5 4V5Z\" />\n {muted ? <path d=\"m22 9-6 6m0-6 6 6\" /> : <path d=\"M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13\" />}\n </Glyph>\n);\nexport const FullscreenGlyph = ({ exit, ...p }: GlyphProps & { exit?: boolean }) => (\n <Glyph {...p}>\n {exit ? <path d=\"M9 4v5H4m11-5v5h5M9 20v-5H4m11 5v-5h5\" /> : <path d=\"M4 9V4h5m6 0h5v5M4 15v5h5m11-5v5h-5\" />}\n </Glyph>\n);\nexport const CaptionsGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M17 10.5a2 2 0 1 0 0 3\" />\n </Glyph>\n);\nexport const PipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <rect x=\"12\" y=\"12\" width=\"6\" height=\"4\" rx=\"1\" />\n </Glyph>\n);\nexport const SearchGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </Glyph>\n);\nexport const CloseGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </Glyph>\n);\nexport const ChevronGlyph = ({ direction = \"down\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" | \"up\" | \"down\" }) => (\n <Glyph {...p}>\n <path d={{ left: \"m15 6-6 6 6 6\", right: \"m9 6 6 6-6 6\", up: \"m6 15 6-6 6 6\", down: \"m6 9 6 6 6-6\" }[direction]} />\n </Glyph>\n);\nexport const CheckGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Glyph>\n);\nexport const PlusGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 5v14M5 12h14\" />\n </Glyph>\n);\nexport const CalendarGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M3 10h18M8 3v4M16 3v4\" />\n </Glyph>\n);\nexport const UploadGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 16V4m0 0L7 9m5-5 5 5\" />\n <path d=\"M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </Glyph>\n);\nexport const FileGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z\" />\n <path d=\"M14 3v5h5\" />\n </Glyph>\n);\nexport const CameraGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z\" />\n <circle cx=\"12\" cy=\"13.5\" r=\"3.5\" />\n </Glyph>\n);\nexport const FlipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3\" />\n <path d=\"M18 3v4h-4M6 21v-4h4\" />\n </Glyph>\n);\nexport const RetryGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 1 0 2.3-5.7L4 8.5\" />\n <path d=\"M4 4v4.5h4.5\" />\n </Glyph>\n);\nexport const SortGlyph = ({ direction, ...p }: GlyphProps & { direction?: \"ascending\" | \"descending\" }) => (\n <Glyph {...p}>\n {direction === \"ascending\" ? <path d=\"m7 14 5-5 5 5\" /> : direction === \"descending\" ? <path d=\"m7 10 5 5 5-5\" /> : <path d=\"m8 9 4-4 4 4M8 15l4 4 4-4\" />}\n </Glyph>\n);\nexport const ArrowGlyph = ({ direction = \"right\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" }) => (\n <Glyph {...p}>\n <path d={direction === \"left\" ? \"M19 12H5m0 0 6-6m-6 6 6 6\" : \"M5 12h14m0 0-6-6m6 6-6 6\"} />\n </Glyph>\n);\nexport const ExternalGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 4h6v6M20 4l-9 9\" />\n <path d=\"M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4\" />\n </Glyph>\n);\nexport const WarningGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 4 2.5 20h19L12 4Z\" />\n <path d=\"M12 10v4M12 17.2v.1\" />\n </Glyph>\n);\nexport const CopyGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3\" />\n </Glyph>\n);\nexport const PencilGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 20h4L19 9a2.8 2.8 0 0 0-4-4L4 16v4zM13.5 6.5l4 4\" />\n </Glyph>\n);\n"
356
+ },
357
+ {
358
+ "path": "meta.ts",
359
+ "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 | \"audio-player\"\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 | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\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 | \"how-it-works-page\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"iso\"\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 | \"meta-row\"\n | \"waveform\"\n | \"qr-code\"\n | \"entity-header\"\n | \"collection-switcher\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"media-grid\"\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 | \"photo-grid\"\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 | \"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 | \"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 Orazaka 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 * `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 = \"stable\" | \"beta\" | \"deprecated\";\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 /** 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"
360
+ }
361
+ ],
362
+ "dependencies": [
363
+ "@krizaka/organize@^0.4.0"
364
+ ],
365
+ "registryDependencies": [
366
+ "account-settings",
367
+ "avatar",
368
+ "chip",
369
+ "popover"
370
+ ],
371
+ "demo": {
372
+ "path": "examples/entity-header/basic.tsx",
373
+ "content": "import { EntityHeader } from \"@krizaka/ui/entity-header\";\nimport * as React from \"react\";\n\n// A collection's head: rename it in place (Enter saves, Escape gives it back). A taken name comes back as a code, and the page says it in its words.\nexport default function EntityHeaderBasic() {\n const [name, setName] = React.useState(\"Spring bookings\");\n return (\n <EntityHeader\n name={name}\n nameLabel=\"Rename the collection\"\n onNameChange={async (next) => {\n if (next === \"Archive\") throw Object.assign(new Error(\"taken\"), { code: \"NAME_TAKEN\" });\n setName(next);\n }}\n description=\"Everything booked from March to May.\"\n avatar={{ defaultAvatar: { brand: \"krizaka\", kind: \"folder\", tone: 3 } }}\n tags={[\n { id: \"1\", label: \"Seasonal\", marker: \"blue\" },\n { id: \"2\", label: \"Priority\", marker: \"amber\" },\n ]}\n tagsLabel=\"Tags\"\n refusals={{ NAME_TAKEN: \"Another collection already has this name.\" }}\n />\n );\n}\n"
374
+ },
375
+ "props": [
376
+ {
377
+ "component": "EntityHeader",
378
+ "description": "The head of an entity: picture, name and description editable in place, tags, a refusal said in words, actions.",
379
+ "props": [
380
+ {
381
+ "name": "name",
382
+ "type": "string",
383
+ "default": null,
384
+ "description": "The entity's name.",
385
+ "required": true
386
+ },
387
+ {
388
+ "name": "actions",
389
+ "type": "ReactNode",
390
+ "default": null,
391
+ "description": "After the text: the actions of the entity (a menu, a button).",
392
+ "required": false
393
+ },
394
+ {
395
+ "name": "avatar",
396
+ "type": "EntityAvatar",
397
+ "default": null,
398
+ "description": "The picture.",
399
+ "required": false
400
+ },
401
+ {
402
+ "name": "avatarPicker",
403
+ "type": "{ label: string; kind?: DefaultAvatarEntityKind; options: readonly EntityAvatarOption[]; noneLabel?: string; value?: string | undefined; onValueChange?: ((id: string) => void) | undefined; triggerLabel: string; } | undefined",
404
+ "default": null,
405
+ "description": "Makes the picture changeable: a button over it opens the library's `AvatarPicker`.",
406
+ "required": false
407
+ },
408
+ {
409
+ "name": "className",
410
+ "type": "string",
411
+ "default": null,
412
+ "description": "Classes merged last, on the header.",
413
+ "required": false
414
+ },
415
+ {
416
+ "name": "description",
417
+ "type": "string",
418
+ "default": null,
419
+ "description": "One line under the name.",
420
+ "required": false
421
+ },
422
+ {
423
+ "name": "descriptionLabel",
424
+ "type": "string",
425
+ "default": "Description",
426
+ "description": "What editing the description does (“Edit the description”), passed translated: the field's name, and the button's after the visible text.",
427
+ "required": false
428
+ },
429
+ {
430
+ "name": "descriptionPlaceholder",
431
+ "type": "string",
432
+ "default": null,
433
+ "description": "Shown when there is no description and it is editable (“Add a description”), passed translated.",
434
+ "required": false
435
+ },
436
+ {
437
+ "name": "nameLabel",
438
+ "type": "string",
439
+ "default": null,
440
+ "description": "What editing the name does (“Rename the collection”), passed translated: the field's name, and the button's after the visible name.",
441
+ "required": false
442
+ },
443
+ {
444
+ "name": "onDescriptionChange",
445
+ "type": "((description: string) => void | Promise<void>)",
446
+ "default": null,
447
+ "description": "Makes the description editable in place. Same contract as `onNameChange`.",
448
+ "required": false
449
+ },
450
+ {
451
+ "name": "onNameChange",
452
+ "type": "((name: string) => void | Promise<void>)",
453
+ "default": null,
454
+ "description": "Makes the name editable in place: called with the trimmed new name. Throw (or reject with) an error carrying a `code` to show its refusal.",
455
+ "required": false
456
+ },
457
+ {
458
+ "name": "onTagRemove",
459
+ "type": "((id: string) => void)",
460
+ "default": null,
461
+ "description": "Lets the viewer remove a tag: each `TagChip` gets a remove button. Without it the tags are read-only labels.",
462
+ "required": false
463
+ },
464
+ {
465
+ "name": "refusal",
466
+ "type": "{ code: OrganizeCode; } | null",
467
+ "default": null,
468
+ "description": "A refusal to say now (the last answer of the server), by its code.",
469
+ "required": false
470
+ },
471
+ {
472
+ "name": "refusals",
473
+ "type": "Partial<Record<OrganizeCode, string>>",
474
+ "default": null,
475
+ "description": "The messages by refusal code: `NAME_TAKEN`, `AVATAR_NOT_ALLOWED`, `DEFAULT_COLLECTION`, … A code with no message says nothing.",
476
+ "required": false
477
+ },
478
+ {
479
+ "name": "tagRemoveLabel",
480
+ "type": "((label: string) => string)",
481
+ "default": null,
482
+ "description": "The remove button's accessible name for a tag (“Remove Seasonal”), passed translated.",
483
+ "required": false
484
+ },
485
+ {
486
+ "name": "tags",
487
+ "type": "readonly EntityTag[]",
488
+ "default": null,
489
+ "description": "The entity's tags.",
490
+ "required": false
491
+ },
492
+ {
493
+ "name": "tagsLabel",
494
+ "type": "string",
495
+ "default": null,
496
+ "description": "The accessible name of the tags' list (“Tags”), passed translated.",
497
+ "required": false
498
+ }
499
+ ]
500
+ }
501
+ ]
502
+ }