@krizaka/ui 3.67.0 → 3.68.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 (267) hide show
  1. package/dist/app-header.d.ts +3 -3
  2. package/dist/app-shell.js +2 -2
  3. package/dist/app-shell.js.map +1 -1
  4. package/dist/chunk-PZ4FJOD5.js +44 -0
  5. package/dist/chunk-PZ4FJOD5.js.map +1 -0
  6. package/dist/{chunk-6BMKLAZ7.js → chunk-Z47KIPCT.js} +7 -2
  7. package/dist/{chunk-6BMKLAZ7.js.map → chunk-Z47KIPCT.js.map} +1 -1
  8. package/dist/copy-button.d.ts +29 -0
  9. package/dist/copy-button.js +56 -0
  10. package/dist/copy-button.js.map +1 -0
  11. package/dist/date-picker.js +2 -1
  12. package/dist/date-picker.js.map +1 -1
  13. package/dist/desktop-window.js.map +1 -1
  14. package/dist/file-upload.d.ts +2 -2
  15. package/dist/filter-bar.d.ts +3 -3
  16. package/dist/flock.js +2 -1
  17. package/dist/flock.js.map +1 -1
  18. package/dist/index.js +3 -3
  19. package/dist/kind-config-editor.js +106 -129
  20. package/dist/kind-config-editor.js.map +1 -1
  21. package/dist/map.d.ts +2 -2
  22. package/dist/map.js +3 -3
  23. package/dist/map.js.map +1 -1
  24. package/dist/money-input.d.ts +29 -0
  25. package/dist/money-input.js +78 -0
  26. package/dist/money-input.js.map +1 -0
  27. package/dist/native/map.d.ts +2 -2
  28. package/dist/native/map.js +3 -3
  29. package/dist/native/map.js.map +1 -1
  30. package/dist/nav-bar.d.ts +28 -4
  31. package/dist/nav-bar.js +31 -14
  32. package/dist/nav-bar.js.map +1 -1
  33. package/dist/promo-code-field.d.ts +38 -0
  34. package/dist/promo-code-field.js +94 -0
  35. package/dist/promo-code-field.js.map +1 -0
  36. package/dist/radio-group.js +1 -1
  37. package/dist/retro-tv.d.ts +39 -4
  38. package/dist/retro-tv.js +217 -40
  39. package/dist/retro-tv.js.map +1 -1
  40. package/dist/status-chip.js +1 -1
  41. package/dist/terminal-replay.js +1 -1
  42. package/package.json +46 -3
  43. package/registry/account-menu.json +1 -1
  44. package/registry/account-settings.json +1 -1
  45. package/registry/achievement.json +1 -1
  46. package/registry/action-bar.json +1 -1
  47. package/registry/activity-feed.json +1 -1
  48. package/registry/agenda.json +1 -1
  49. package/registry/alert.json +1 -1
  50. package/registry/analysis-report.json +1 -1
  51. package/registry/anatomy-plate.json +1 -1
  52. package/registry/app-frame.json +34 -34
  53. package/registry/app-header.json +1 -1
  54. package/registry/app-shell.json +3 -3
  55. package/registry/argument-card.json +1 -1
  56. package/registry/audio-player.json +1 -1
  57. package/registry/auth-layout.json +1 -1
  58. package/registry/avatar.json +1 -1
  59. package/registry/badge.json +1 -1
  60. package/registry/bird-plate.json +1 -1
  61. package/registry/button.json +1 -1
  62. package/registry/captcha.json +1 -1
  63. package/registry/card-grid.json +1 -1
  64. package/registry/card.json +1 -1
  65. package/registry/catalogue-page.json +1 -1
  66. package/registry/changelog-page.json +1 -1
  67. package/registry/chapter.json +1 -1
  68. package/registry/chat.json +1 -1
  69. package/registry/checkbox.json +1 -1
  70. package/registry/chip-link.json +1 -1
  71. package/registry/chip-row.json +1 -1
  72. package/registry/chip.json +1 -1
  73. package/registry/choice-grid.json +1 -1
  74. package/registry/code-block.json +1 -1
  75. package/registry/collection-switcher.json +1 -1
  76. package/registry/combobox.json +1 -1
  77. package/registry/command.json +1 -1
  78. package/registry/comparison-table.json +1 -1
  79. package/registry/component-page.json +1 -1
  80. package/registry/confirm-button.json +1 -1
  81. package/registry/contact-page.json +1 -1
  82. package/registry/continue-prompt.json +1 -1
  83. package/registry/copy-button.json +382 -0
  84. package/registry/countdown.json +1 -1
  85. package/registry/cover-hero.json +1 -1
  86. package/registry/cta-panel.json +1 -1
  87. package/registry/dashboard-layout.json +1 -1
  88. package/registry/data-table.json +1 -1
  89. package/registry/date-picker.json +3 -3
  90. package/registry/decision-list.json +1 -1
  91. package/registry/description-list.json +1 -1
  92. package/registry/desktop-window.json +1 -1
  93. package/registry/detail-layout.json +1 -1
  94. package/registry/dialog.json +1 -1
  95. package/registry/docs-article-page.json +1 -1
  96. package/registry/docs-hub-page.json +1 -1
  97. package/registry/docs-layout.json +1 -1
  98. package/registry/docs-nav.json +1 -1
  99. package/registry/document-viewer.json +1 -1
  100. package/registry/doodle.json +1 -1
  101. package/registry/drop-overlay.json +1 -1
  102. package/registry/dropdown-menu.json +1 -1
  103. package/registry/elephant.json +2 -2
  104. package/registry/embed-facade.json +1 -1
  105. package/registry/empty-state.json +1 -1
  106. package/registry/engine-flow.json +1 -1
  107. package/registry/entity-header.json +1 -1
  108. package/registry/environment-notice.json +1 -1
  109. package/registry/error-page.json +1 -1
  110. package/registry/examples/copy-button/default.d.ts +4 -0
  111. package/registry/examples/copy-button/default.js +11 -0
  112. package/registry/examples/copy-button/default.tsx +7 -0
  113. package/registry/examples/copy-button/icon-only.d.ts +4 -0
  114. package/registry/examples/copy-button/icon-only.js +11 -0
  115. package/registry/examples/copy-button/icon-only.tsx +7 -0
  116. package/registry/examples/money-input/currencies.d.ts +4 -0
  117. package/registry/examples/money-input/currencies.js +18 -0
  118. package/registry/examples/money-input/currencies.tsx +16 -0
  119. package/registry/examples/money-input/default.d.ts +4 -0
  120. package/registry/examples/money-input/default.js +18 -0
  121. package/registry/examples/money-input/default.tsx +16 -0
  122. package/registry/examples/promo-code-field/applied.d.ts +4 -0
  123. package/registry/examples/promo-code-field/applied.js +11 -0
  124. package/registry/examples/promo-code-field/applied.tsx +7 -0
  125. package/registry/examples/promo-code-field/default.d.ts +4 -0
  126. package/registry/examples/promo-code-field/default.js +19 -0
  127. package/registry/examples/promo-code-field/default.tsx +14 -0
  128. package/registry/examples/promo-code-field/expired.d.ts +4 -0
  129. package/registry/examples/promo-code-field/expired.js +11 -0
  130. package/registry/examples/promo-code-field/expired.tsx +7 -0
  131. package/registry/examples/retro-tv/playlist-channel.d.ts +4 -0
  132. package/registry/examples/retro-tv/playlist-channel.js +15 -0
  133. package/registry/examples/retro-tv/playlist-channel.tsx +10 -0
  134. package/registry/examples/retro-tv/playlist-crossfade.d.ts +4 -0
  135. package/registry/examples/retro-tv/playlist-crossfade.js +15 -0
  136. package/registry/examples/retro-tv/playlist-crossfade.tsx +10 -0
  137. package/registry/examples/retro-tv/playlist-slide.d.ts +4 -0
  138. package/registry/examples/retro-tv/playlist-slide.js +15 -0
  139. package/registry/examples/retro-tv/playlist-slide.tsx +10 -0
  140. package/registry/field.json +1 -1
  141. package/registry/file-upload.json +1 -1
  142. package/registry/filter-bar.json +1 -1
  143. package/registry/flock.json +2 -2
  144. package/registry/footnote.json +1 -1
  145. package/registry/force-update-screen.json +1 -1
  146. package/registry/form.json +1 -1
  147. package/registry/gallery-page.json +1 -1
  148. package/registry/genui.json +1 -1
  149. package/registry/glossary-term.json +1 -1
  150. package/registry/glossary.json +1 -1
  151. package/registry/glow-card.json +1 -1
  152. package/registry/goal-gauge.json +1 -1
  153. package/registry/grade-stamp.json +1 -1
  154. package/registry/how-it-works-page.json +1 -1
  155. package/registry/image-cropper.json +1 -1
  156. package/registry/index.json +108 -9
  157. package/registry/iso.json +1 -1
  158. package/registry/kanban.json +1 -1
  159. package/registry/kbd.json +1 -1
  160. package/registry/kind-config-editor.json +1 -1
  161. package/registry/kpi-explained.json +1 -1
  162. package/registry/landing-page.json +1 -1
  163. package/registry/landscape.json +1 -1
  164. package/registry/language-switch.json +1 -1
  165. package/registry/legal-page.json +1 -1
  166. package/registry/link-card.json +1 -1
  167. package/registry/list.json +1 -1
  168. package/registry/loader.json +1 -1
  169. package/registry/longform-page.json +1 -1
  170. package/registry/maintenance-screen.json +1 -1
  171. package/registry/map.json +95 -95
  172. package/registry/margin-layout.json +1 -1
  173. package/registry/markdown.json +1 -1
  174. package/registry/marketing-layout.json +1 -1
  175. package/registry/marquee.json +1 -1
  176. package/registry/mascot-quote.json +1 -1
  177. package/registry/mascot-state.json +1 -1
  178. package/registry/mascots.json +1 -1
  179. package/registry/match-dialog.json +1 -1
  180. package/registry/media-capture.json +1 -1
  181. package/registry/media-gallery.json +1 -1
  182. package/registry/media-grid.json +1 -1
  183. package/registry/meta-row.json +1 -1
  184. package/registry/meter.json +1 -1
  185. package/registry/money-input.json +236 -0
  186. package/registry/nav-bar.json +55 -41
  187. package/registry/next-actions.json +1 -1
  188. package/registry/notification-preferences.json +1 -1
  189. package/registry/number-ticker.json +1 -1
  190. package/registry/opening-hours.json +1 -1
  191. package/registry/page-header.json +1 -1
  192. package/registry/page-hero.json +1 -1
  193. package/registry/page-index.json +1 -1
  194. package/registry/page.json +1 -1
  195. package/registry/pagination.json +1 -1
  196. package/registry/photo-grid.json +1 -1
  197. package/registry/pointer-light.json +1 -1
  198. package/registry/popover.json +1 -1
  199. package/registry/pricing-page.json +1 -1
  200. package/registry/product-page.json +1 -1
  201. package/registry/profile-card.json +1 -1
  202. package/registry/progress.json +1 -1
  203. package/registry/promise-card.json +1 -1
  204. package/registry/promo-code-field.json +258 -0
  205. package/registry/qr-code.json +1 -1
  206. package/registry/quota-meter.json +1 -1
  207. package/registry/radio-group.json +1 -1
  208. package/registry/rail-nav.json +34 -34
  209. package/registry/recipes.json +1 -1
  210. package/registry/retro-tv.json +120 -8
  211. package/registry/reviews.json +1 -1
  212. package/registry/router.json +1 -1
  213. package/registry/scroll-stage.json +1 -1
  214. package/registry/search-field.json +1 -1
  215. package/registry/section-backdrop.json +1 -1
  216. package/registry/separator.json +1 -1
  217. package/registry/service-card.json +1 -1
  218. package/registry/settings-layout.json +1 -1
  219. package/registry/shop-composer.json +1 -1
  220. package/registry/shop.json +2 -2
  221. package/registry/showcase.json +1 -1
  222. package/registry/signature.json +1 -1
  223. package/registry/site-cahier.json +1 -1
  224. package/registry/site-footer.json +34 -34
  225. package/registry/sites.json +1 -1
  226. package/registry/skeleton.json +1 -1
  227. package/registry/skip-link.json +1 -1
  228. package/registry/slider.json +1 -1
  229. package/registry/slot-picker.json +1 -1
  230. package/registry/slot.json +1 -1
  231. package/registry/specimen-tag.json +1 -1
  232. package/registry/speed-lines.json +1 -1
  233. package/registry/spinner.json +1 -1
  234. package/registry/split-view.json +1 -1
  235. package/registry/stage-banner.json +1 -1
  236. package/registry/stat.json +1 -1
  237. package/registry/status-chip.json +1 -1
  238. package/registry/status-page.json +1 -1
  239. package/registry/step-progress.json +1 -1
  240. package/registry/step-showcase.json +1 -1
  241. package/registry/stepper.json +1 -1
  242. package/registry/sticky-action.json +1 -1
  243. package/registry/stuck.json +1 -1
  244. package/registry/swipe-deck.json +1 -1
  245. package/registry/switch.json +1 -1
  246. package/registry/tabs.json +1 -1
  247. package/registry/tag-input.json +1 -1
  248. package/registry/tag-selector.json +1 -1
  249. package/registry/taped-photo.json +1 -1
  250. package/registry/terminal-replay.json +1 -1
  251. package/registry/text-style.json +1 -1
  252. package/registry/theme.json +1 -1
  253. package/registry/toast.json +1 -1
  254. package/registry/toc.json +1 -1
  255. package/registry/tooltip.json +1 -1
  256. package/registry/tree-view.json +1 -1
  257. package/registry/update-prompt.json +1 -1
  258. package/registry/upload-queue.json +1 -1
  259. package/registry/usage.json +1 -1
  260. package/registry/verified-badge.json +1 -1
  261. package/registry/versus-card.json +1 -1
  262. package/registry/vertical-video.json +1 -1
  263. package/registry/video-player.json +1 -1
  264. package/registry/video-trimmer.json +1 -1
  265. package/registry/virtual.json +1 -1
  266. package/registry/wall.json +1 -1
  267. package/registry/waveform.json +1 -1
@@ -39,6 +39,8 @@
39
39
  "Give the player a title, poster and translated `labels`; pass WebVTT captions as `tracks`.",
40
40
  "Keep autoplay muted; it starts only while the player is on screen and waits under reduced motion.",
41
41
  "Use `off` for the static screen; the video is not loaded or played in this state.",
42
+ "`playlist` plays the programmes in order, then loops; `transition` is `channel`, `crossfade` or `slide` and is a plain cut under reduced motion. Sound starts off: remember the visitor's choice from `onMutedChange`.",
43
+ "A programme without `src` is a slot: fill it with `renderEmbed` (an `EmbedFacade` behind its consent click); the library loads no third-party script.",
42
44
  "A platform's short video (TikTok, YouTube Shorts, Instagram) goes in as `children`, an `EmbedFacade`: the television's screen shows the facade, and nothing is requested from the platform before the visitor's click."
43
45
  ],
44
46
  "accessibility": {
@@ -47,6 +49,18 @@
47
49
  "keys": "Space / K",
48
50
  "action": "Play or pause the focused video."
49
51
  },
52
+ {
53
+ "keys": "N / P",
54
+ "action": "Next or previous programme of a playlist."
55
+ },
56
+ {
57
+ "keys": "M",
58
+ "action": "Turn the sound on or off."
59
+ },
60
+ {
61
+ "keys": "Arrow left / right",
62
+ "action": "Seek 5 seconds."
63
+ },
50
64
  {
51
65
  "keys": "Tab",
52
66
  "action": "Move through the player's named controls."
@@ -116,9 +130,9 @@
116
130
  },
117
131
  {
118
132
  "name": "labels",
119
- "type": "Partial<VideoPlayerLabels>",
133
+ "type": "Partial<RetroTvLabels>",
120
134
  "default": null,
121
- "description": "The words, passed translated; English by default.",
135
+ "description": "The controls' words; `retroTvLabelsFr` for French.",
122
136
  "required": false
123
137
  },
124
138
  {
@@ -163,6 +177,20 @@
163
177
  "description": "Called when the video cannot play (a network failure, an expired address).",
164
178
  "required": false
165
179
  },
180
+ {
181
+ "name": "onIndexChange",
182
+ "type": "((index: number) => void)",
183
+ "default": null,
184
+ "description": "Told when another programme starts.",
185
+ "required": false
186
+ },
187
+ {
188
+ "name": "onMutedChange",
189
+ "type": "((muted: boolean) => void)",
190
+ "default": null,
191
+ "description": "Told when the visitor turns the sound on or off, so the host can remember the choice.",
192
+ "required": false
193
+ },
166
194
  {
167
195
  "name": "onPause",
168
196
  "type": "(() => void)",
@@ -205,6 +233,13 @@
205
233
  "description": "The speeds offered by the speed button. Default `[0.5, 1, 1.25, 1.5, 2]`.",
206
234
  "required": false
207
235
  },
236
+ {
237
+ "name": "playlist",
238
+ "type": "readonly RetroTvSource[]",
239
+ "default": null,
240
+ "description": "Programmes played in order, then again from the first. Replaces `src` and `children`.",
241
+ "required": false
242
+ },
208
243
  {
209
244
  "name": "poster",
210
245
  "type": "string",
@@ -219,6 +254,13 @@
219
254
  "description": "How much to fetch before playback. Default `none` for lazy loading.",
220
255
  "required": false
221
256
  },
257
+ {
258
+ "name": "renderEmbed",
259
+ "type": "((source: RetroTvSource) => ReactNode)",
260
+ "default": null,
261
+ "description": "The host fills the screen of a source that has no `src` (an embed behind its own consent gate); the library loads no third-party script.",
262
+ "required": false
263
+ },
222
264
  {
223
265
  "name": "src",
224
266
  "type": "string | (() => Promise<string>)",
@@ -233,6 +275,13 @@
233
275
  "description": "Subtitles or captions (WebVTT): the C key and a button cycle through them.",
234
276
  "required": false
235
277
  },
278
+ {
279
+ "name": "transition",
280
+ "type": "RetroTvTransition",
281
+ "default": "channel",
282
+ "description": "How one programme gives way to the next; a cut under reduced motion. Default `channel`.",
283
+ "required": false
284
+ },
236
285
  {
237
286
  "name": "type",
238
287
  "type": "\"auto\" | \"file\" | \"hls\"",
@@ -267,6 +316,30 @@
267
316
  "module": "@krizaka/ui/registry/examples/retro-tv/portable",
268
317
  "code": "import { RetroTv } from \"@krizaka/ui/retro-tv\";\n\nexport default function RetroTvPortable() {\n return <div className=\"w-72 max-w-full\"><RetroTv variant=\"portable\" title=\"Film: the world of Krizaka\" src=\"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.aa28980db3.mp4\" poster=\"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.8133fbbaa5.jpg\" channel=\"CH 3 · Plateau\" /></div>;\n}\n"
269
318
  },
319
+ {
320
+ "name": "playlist-channel",
321
+ "title": "Playlist, channel switch",
322
+ "description": "`playlist` with `transition=\"channel\"`: static and a roll between programmes, in order, then looping.",
323
+ "path": "examples/retro-tv/playlist-channel.tsx",
324
+ "module": "@krizaka/ui/registry/examples/retro-tv/playlist-channel",
325
+ "code": "import { RetroTv } from \"@krizaka/ui/retro-tv\";\n\nconst playlist = [\n { id: \"film\", title: \"Film: the world of Krizaka\", src: \"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.aa28980db3.mp4\", poster: \"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.8133fbbaa5.jpg\" },\n { id: \"film-again\", title: \"Film: the world of Krizaka, again\", src: \"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.aa28980db3.mp4\", poster: \"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.8133fbbaa5.jpg\" },\n];\n\nexport default function RetroTvPlaylistChannel() {\n return <div className=\"w-full max-w-4xl\"><RetroTv title=\"Short videos\" playlist={playlist} transition=\"channel\" channel=\"CH 3 · Plateau\" /></div>;\n}\n"
326
+ },
327
+ {
328
+ "name": "playlist-crossfade",
329
+ "title": "Playlist, crossfade",
330
+ "description": "`transition=\"crossfade\"`: one programme dissolves into the next.",
331
+ "path": "examples/retro-tv/playlist-crossfade.tsx",
332
+ "module": "@krizaka/ui/registry/examples/retro-tv/playlist-crossfade",
333
+ "code": "import { RetroTv } from \"@krizaka/ui/retro-tv\";\n\nconst playlist = [\n { id: \"film\", title: \"Film: the world of Krizaka\", src: \"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.aa28980db3.mp4\", poster: \"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.8133fbbaa5.jpg\" },\n { id: \"film-again\", title: \"Film: the world of Krizaka, again\", src: \"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.aa28980db3.mp4\", poster: \"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.8133fbbaa5.jpg\" },\n];\n\nexport default function RetroTvPlaylistCrossfade() {\n return <div className=\"w-full max-w-4xl\"><RetroTv title=\"Short videos\" playlist={playlist} transition=\"crossfade\" channel=\"CH 3 · Plateau\" /></div>;\n}\n"
334
+ },
335
+ {
336
+ "name": "playlist-slide",
337
+ "title": "Playlist, slide",
338
+ "description": "`transition=\"slide\"`: the next programme pushes the last one out.",
339
+ "path": "examples/retro-tv/playlist-slide.tsx",
340
+ "module": "@krizaka/ui/registry/examples/retro-tv/playlist-slide",
341
+ "code": "import { RetroTv } from \"@krizaka/ui/retro-tv\";\n\nconst playlist = [\n { id: \"film\", title: \"Film: the world of Krizaka\", src: \"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.aa28980db3.mp4\", poster: \"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.8133fbbaa5.jpg\" },\n { id: \"film-again\", title: \"Film: the world of Krizaka, again\", src: \"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.aa28980db3.mp4\", poster: \"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.8133fbbaa5.jpg\" },\n];\n\nexport default function RetroTvPlaylistSlide() {\n return <div className=\"w-full max-w-4xl\"><RetroTv title=\"Short videos\" playlist={playlist} transition=\"slide\" channel=\"CH 3 · Plateau\" /></div>;\n}\n"
342
+ },
270
343
  {
271
344
  "name": "facade",
272
345
  "title": "A platform's reel behind a facade",
@@ -279,25 +352,29 @@
279
352
  },
280
353
  "native": null,
281
354
  "files": [
355
+ {
356
+ "path": "glyphs.tsx",
357
+ "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"
358
+ },
282
359
  {
283
360
  "path": "media.ts",
284
361
  "content": "// Shared by the data and media primitives (client): the clock format, the reduced-motion preference, the\n// in-view observer, a debounced callback. Never an entry of its own.\nimport * as React from \"react\";\n\n/** Seconds as a clock: `75` → `1:15`, `3725` → `1:02:05`. Negative or unknown values read `0:00`. */\nexport function formatClock(seconds: number): string {\n const s = Number.isFinite(seconds) && seconds > 0 ? Math.floor(seconds) : 0;\n const h = Math.floor(s / 3600);\n const m = Math.floor((s % 3600) / 60);\n const rest = String(s % 60).padStart(2, \"0\");\n return h > 0 ? `${h}:${String(m).padStart(2, \"0\")}:${rest}` : `${m}:${rest}`;\n}\n\n/** Clamps `value` between `min` and `max`. */\nexport const clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\n\nconst REDUCE = \"(prefers-reduced-motion: reduce)\";\nconst subscribeReduce = (notify: () => void) => {\n if (typeof window === \"undefined\" || !window.matchMedia) return () => undefined;\n const query = window.matchMedia(REDUCE);\n query.addEventListener?.(\"change\", notify);\n return () => query.removeEventListener?.(\"change\", notify);\n};\n\n/** `true` when the person asked for less motion (`prefers-reduced-motion: reduce`); follows a change of the setting. */\nexport function usePrefersReducedMotion(): boolean {\n return React.useSyncExternalStore(\n subscribeReduce,\n () => (typeof window !== \"undefined\" && window.matchMedia ? window.matchMedia(REDUCE).matches : false),\n () => false,\n );\n}\n\n/** The latest value of a callback, for an effect or an event that must not re-subscribe when it changes. */\nexport function useLatest<T>(value: T) {\n const ref = React.useRef(value);\n React.useLayoutEffect(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/** Calls `onChange(visible)` when at least `threshold` of the element enters or leaves the viewport. */\nexport function useInView(ref: React.RefObject<Element | null>, onChange: (visible: boolean) => void, enabled = true, threshold = 0.25) {\n const latest = useLatest(onChange);\n React.useEffect(() => {\n const element = ref.current;\n if (!enabled || !element || typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(([entry]) => entry && latest.current(entry.isIntersecting), { threshold });\n observer.observe(element);\n return () => observer.disconnect();\n }, [ref, enabled, threshold, latest]);\n}\n\n/** A value controlled by a prop when it is given, held inside otherwise; `set` calls `onChange` either way. */\nexport function useControllable<T>(value: T | undefined, defaultValue: T, onChange?: (next: T) => void) {\n const [inner, setInner] = React.useState(defaultValue);\n const controlled = value !== undefined;\n const current = controlled ? value : inner;\n const set = React.useCallback(\n (next: T) => {\n if (!controlled) setInner(next);\n onChange?.(next);\n },\n [controlled, onChange],\n );\n return [current, set] as const;\n}\n\n/** Starts a media element without an unhandled rejection (autoplay refused, the source replaced meanwhile). */\nexport function playSafely(media: HTMLMediaElement | null | undefined) {\n try {\n const started = media?.play() as Promise<void> | undefined;\n started?.catch?.(() => undefined);\n } catch {\n // Not playable here (no media support): the controls stay as they are.\n }\n}\n"
285
362
  },
286
363
  {
287
364
  "path": "meta.ts",
288
- "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"
365
+ "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 | \"copy-button\"\n | \"money-input\"\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 | \"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"
289
366
  },
290
367
  {
291
368
  "path": "retro-tv/index.ts",
292
- "content": "/** @krizaka/ui/retro-tv — `RetroTv`, a vertical `VideoPlayer` in a CSS-and-SVG television cabinet. Client. */\nexport { RetroTv, type RetroTvProps } from \"./retro-tv\";\n"
369
+ "content": "/** @krizaka/ui/retro-tv — `RetroTv`: a playlist of vertical videos (or host-filled embeds) in a CSS-and-SVG television cabinet. Client. */\nexport { RetroTv, type RetroTvLabels, retroTvLabels, retroTvLabelsFr, type RetroTvProps, type RetroTvSource, type RetroTvTransition } from \"./retro-tv\";\n"
293
370
  },
294
371
  {
295
372
  "path": "retro-tv/meta.ts",
296
- "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Retro TV\",\n summary: \"A vertical video presented in a detailed television cabinet, with an accessible player, channel label, scanlines and an animated off-state.\",\n status: \"beta\",\n category: \"media\",\n platforms: \"web\",\n parity: {\n native: { status: \"n/a\", reason: \"The CSS cabinet and SVG static belong to the web presentation; use the native video player for mobile playback.\", use: \"video-player\" },\n desktop: \"web\",\n },\n whenToUse: [\n \"To give a shop's latest reel or story a place on its wall, while keeping the video itself the focus.\",\n \"For a vertical clip whose presentation should feel like a television, in either cabinet or portable style.\",\n ],\n whenNotToUse: [\n { when: \"For video without a decorative television frame: use the accessible video player.\", use: \"video-player\" },\n { when: \"For a feed of creator clips with an action rail and caption: use vertical video.\", use: \"vertical-video\" },\n ],\n bestPractices: [\n \"Give the player a title, poster and translated `labels`; pass WebVTT captions as `tracks`.\",\n \"Keep autoplay muted; it starts only while the player is on screen and waits under reduced motion.\",\n \"Use `off` for the static screen; the video is not loaded or played in this state.\",\n \"A platform's short video (TikTok, YouTube Shorts, Instagram) goes in as `children`, an `EmbedFacade`: the television's screen shows the facade, and nothing is requested from the platform before the visitor's click.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Space / K\", action: \"Play or pause the focused video.\" },\n { keys: \"Tab\", action: \"Move through the player's named controls.\" },\n ],\n notes: [\n \"The cabinet, scanlines and static are decorative; the embedded video player keeps its named region and keyboard-accessible controls.\",\n \"The focus ring remains visible around the screen, and the channel name is visible text.\",\n \"Under reduced motion the power-on and static effects stop, and autoplay waits for a gesture.\",\n ],\n },\n related: [\"video-player\", \"vertical-video\", \"audio-player\", \"embed-facade\"],\n web: {\n imports: [\"RetroTv\"],\n examples: [\n { name: \"cabinet\", title: \"Wood cabinet\", description: \"A vertical shop story in the cabinet television, with its channel label and player controls.\" },\n { name: \"portable\", title: \"Portable set\", description: \"The same vertical story in a compact cream television cabinet.\" },\n { name: \"facade\", title: \"A platform's reel behind a facade\", description: \"`children`: an `EmbedFacade` on the screen, nothing loaded until the click.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
373
+ "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Retro TV\",\n summary: \"A vertical video presented in a detailed television cabinet, with an accessible player, channel label, scanlines and an animated off-state.\",\n status: \"beta\",\n category: \"media\",\n platforms: \"web\",\n parity: {\n native: { status: \"n/a\", reason: \"The CSS cabinet and SVG static belong to the web presentation; use the native video player for mobile playback.\", use: \"video-player\" },\n desktop: \"web\",\n },\n whenToUse: [\n \"To give a shop's latest reel or story a place on its wall, while keeping the video itself the focus.\",\n \"For a vertical clip whose presentation should feel like a television, in either cabinet or portable style.\",\n ],\n whenNotToUse: [\n { when: \"For video without a decorative television frame: use the accessible video player.\", use: \"video-player\" },\n { when: \"For a feed of creator clips with an action rail and caption: use vertical video.\", use: \"vertical-video\" },\n ],\n bestPractices: [\n \"Give the player a title, poster and translated `labels`; pass WebVTT captions as `tracks`.\",\n \"Keep autoplay muted; it starts only while the player is on screen and waits under reduced motion.\",\n \"Use `off` for the static screen; the video is not loaded or played in this state.\",\n \"`playlist` plays the programmes in order, then loops; `transition` is `channel`, `crossfade` or `slide` and is a plain cut under reduced motion. Sound starts off: remember the visitor's choice from `onMutedChange`.\",\n \"A programme without `src` is a slot: fill it with `renderEmbed` (an `EmbedFacade` behind its consent click); the library loads no third-party script.\",\n \"A platform's short video (TikTok, YouTube Shorts, Instagram) goes in as `children`, an `EmbedFacade`: the television's screen shows the facade, and nothing is requested from the platform before the visitor's click.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Space / K\", action: \"Play or pause the focused video.\" },\n { keys: \"N / P\", action: \"Next or previous programme of a playlist.\" },\n { keys: \"M\", action: \"Turn the sound on or off.\" },\n { keys: \"Arrow left / right\", action: \"Seek 5 seconds.\" },\n { keys: \"Tab\", action: \"Move through the player's named controls.\" },\n ],\n notes: [\n \"The cabinet, scanlines and static are decorative; the embedded video player keeps its named region and keyboard-accessible controls.\",\n \"The focus ring remains visible around the screen, and the channel name is visible text.\",\n \"Under reduced motion the power-on and static effects stop, and autoplay waits for a gesture.\",\n ],\n },\n related: [\"video-player\", \"vertical-video\", \"audio-player\", \"embed-facade\"],\n web: {\n imports: [\"RetroTv\"],\n examples: [\n { name: \"cabinet\", title: \"Wood cabinet\", description: \"A vertical shop story in the cabinet television, with its channel label and player controls.\" },\n { name: \"portable\", title: \"Portable set\", description: \"The same vertical story in a compact cream television cabinet.\" },\n { name: \"playlist-channel\", title: \"Playlist, channel switch\", description: \"`playlist` with `transition=\\\"channel\\\"`: static and a roll between programmes, in order, then looping.\" },\n { name: \"playlist-crossfade\", title: \"Playlist, crossfade\", description: \"`transition=\\\"crossfade\\\"`: one programme dissolves into the next.\" },\n { name: \"playlist-slide\", title: \"Playlist, slide\", description: \"`transition=\\\"slide\\\"`: the next programme pushes the last one out.\" },\n { name: \"facade\", title: \"A platform's reel behind a facade\", description: \"`children`: an `EmbedFacade` on the screen, nothing loaded until the click.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
297
374
  },
298
375
  {
299
376
  "path": "retro-tv/retro-tv.tsx",
300
- "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { useInView, usePrefersReducedMotion } from \"../media\";\nimport { VideoPlayer, type VideoPlayerProps } from \"../video-player/video-player\";\n\nconst styles = `\n.kz-rtv{position:relative;isolation:isolate;width:100%;aspect-ratio:4/5;max-width:100%;color:var(--kz-text-primary)}\n.kz-rtv-cabinet{position:absolute;inset:0;overflow:hidden}\n.kz-rtv-body{position:absolute;inset:4% 4% 16%;border:1px solid var(--kz-border-strong);border-radius:8% / 6%;background:linear-gradient(145deg,var(--kz-surface-sheen),transparent 35%),linear-gradient(145deg,color-mix(in srgb,var(--kz-warning) 18%,var(--kz-surface-3)),color-mix(in srgb,var(--kz-warning-text) 10%,var(--kz-surface-2)) 48%,var(--kz-surface-1));box-shadow:inset 0 1px 0 var(--kz-surface-sheen),inset 0 -3px 6px color-mix(in srgb,var(--kz-scrim-strong) 30%,transparent),0 1.2rem 2rem color-mix(in srgb,var(--kz-scrim-strong) 24%,transparent)}\n.kz-rtv[data-variant=portable] .kz-rtv-body{border-radius:12% / 8%;background:linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-2) 55%,var(--kz-surface-3))}\n.kz-rtv-body:after{position:absolute;inset:0;border-radius:inherit;background:repeating-linear-gradient(115deg,transparent 0 7px,color-mix(in srgb,var(--kz-border-subtle) 35%,transparent) 8px 9px);content:\"\";opacity:.4;pointer-events:none}\n.kz-rtv-bezel{position:absolute;top:0;bottom:0;left:6%;width:61%;border:1px solid var(--kz-border-strong);border-radius:14% / 7%;background:linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-3));box-shadow:inset 0 2px 5px color-mix(in srgb,var(--kz-scrim-strong) 35%,transparent),0 1px 2px color-mix(in srgb,var(--kz-surface-sheen) 60%,transparent)}\n.kz-rtv[data-variant=portable] .kz-rtv-bezel{border-radius:19% / 9%;background:linear-gradient(145deg,var(--kz-surface-0),var(--kz-surface-2))}\n.kz-rtv-controls{position:absolute;top:16%;right:7%;display:flex;width:23%;flex-direction:column;align-items:center;gap:1.1rem}\n.kz-rtv-knob{position:relative;display:block;width:2.3rem;max-width:70%;aspect-ratio:1;border:2px solid var(--kz-border-strong);border-radius:50%;background:radial-gradient(circle at 35% 28%,var(--kz-surface-sheen),transparent 30%),linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-3));box-shadow:inset 0 -2px 3px color-mix(in srgb,var(--kz-scrim-strong) 35%,transparent),0 2px 4px color-mix(in srgb,var(--kz-scrim-strong) 25%,transparent);color:var(--kz-accent)}\n.kz-rtv-knob[data-hue=accent]{background:radial-gradient(circle at 35% 28%,var(--kz-surface-sheen),transparent 30%),linear-gradient(145deg,var(--kz-accent-text),var(--kz-accent))}\n.kz-rtv-knob:after{position:absolute;top:14%;left:calc(50% - 1px);width:2px;height:27%;border-radius:2px;background:var(--kz-on-accent);content:\"\"}\n.kz-rtv[data-variant=portable] .kz-rtv-knob{width:1.9rem}\n.kz-rtv-speaker{position:absolute;right:7%;bottom:9%;display:flex;width:23%;flex-direction:column;gap:3px}\n.kz-rtv-speaker i{height:2px;border-radius:2px;background:var(--kz-border-strong);box-shadow:0 1px 0 var(--kz-surface-sheen)}\n.kz-rtv[data-variant=portable] .kz-rtv-speaker{display:none}\n.kz-rtv-stand{position:absolute;bottom:4%;left:36%;width:28%;height:12%;border-bottom:1px solid var(--kz-border-strong);border-radius:0 0 30% 30%;background:linear-gradient(180deg,var(--kz-surface-2),var(--kz-surface-3));clip-path:polygon(25% 0,75% 0,88% 78%,100% 100%,0 100%,12% 78%)}\n.kz-rtv[data-variant=portable] .kz-rtv-stand{left:40%;width:20%;height:8%;border-radius:50%;clip-path:ellipse(50% 50% at 50% 50%)}\n.kz-rtv-screen{position:absolute;top:4%;left:9.5%;width:56%;height:80%;overflow:hidden;border:2px solid color-mix(in srgb,var(--kz-border-strong) 72%,var(--kz-accent));border-radius:13% / 7%;background:var(--kz-scrim-strong);box-shadow:0 0 1.1rem color-mix(in srgb,var(--kz-accent) 30%,transparent),inset 0 0 1.2rem var(--kz-scrim-strong)}\n.kz-rtv[data-variant=portable] .kz-rtv-screen{border-radius:18% / 9%}\n.kz-rtv-screen .kz-rtv-player{height:100%;width:100%;border-radius:inherit}\n.kz-rtv-screen .kz-embed{height:100%;width:100%;aspect-ratio:auto;border-radius:inherit}\n.kz-rtv-player video,.kz-rtv-player img{object-fit:cover}\n.kz-rtv-effects{position:absolute;z-index:5;inset:0;overflow:hidden;border-radius:inherit;pointer-events:none}\n.kz-rtv-effects:before{position:absolute;inset:0;background:repeating-linear-gradient(to bottom,transparent 0 3px,color-mix(in srgb,var(--kz-scrim-strong) 25%,transparent) 4px 5px);content:\"\";opacity:.46}\n.kz-rtv-effects:after{position:absolute;inset:-1px;background:radial-gradient(ellipse at center,transparent 55%,var(--kz-scrim-strong) 100%);content:\"\";opacity:.52}\n.kz-rtv-glow{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 45%,color-mix(in srgb,var(--kz-accent) 14%,transparent),transparent 68%);opacity:.7}\n.kz-rtv-noise{position:absolute;inset:0;height:100%;width:100%;opacity:.55;filter:contrast(1.3) brightness(.85)}\n.kz-rtv-glass{position:absolute;inset:0;height:100%;width:100%;opacity:.28}\n.kz-rtv-power{position:absolute;inset:0;background:var(--kz-text-on-media);opacity:0;transform:scaleY(.01);transform-origin:center;pointer-events:none}\n.kz-rtv[data-powered=true] .kz-rtv-power{animation:kz-rtv-power .65s ease-out both}\n.kz-rtv-channel{position:absolute;z-index:7;top:9%;right:5%;width:28%;overflow:hidden;color:var(--kz-text-primary);font:600 clamp(.42rem,1.2vw,.55rem)/1.2 var(--kz-font-mono,monospace);text-align:center;text-overflow:ellipsis;white-space:nowrap}\n.kz-rtv[data-variant=portable] .kz-rtv-channel{top:7%}\n.kz-rtv:focus-within .kz-rtv-screen{outline:2px solid var(--kz-ring);outline-offset:3px}\n@keyframes kz-rtv-power{0%{opacity:1;transform:scaleY(.01)}45%{opacity:.9;transform:scaleY(1)}100%{opacity:0;transform:scaleY(1)}}\n@keyframes kz-rtv-noise{0%,100%{opacity:.38}50%{opacity:.62}}\n@media (prefers-reduced-motion:no-preference){.kz-rtv[data-off=true] .kz-rtv-noise{animation:kz-rtv-noise .18s steps(2,end) infinite}}\n@media (prefers-reduced-motion:reduce){.kz-rtv-power{display:none!important}.kz-rtv-noise{animation:none!important}}\n`;\n\n/** A vertical video in a CSS-and-SVG television cabinet. */\nexport interface RetroTvProps extends Omit<VideoPlayerProps, \"aspectRatio\" | \"autoPlay\" | \"className\" | \"loop\" | \"muted\" | \"preload\" | \"src\"> {\n /** The video's address. Optional when the screen shows `children`. */\n src?: VideoPlayerProps[\"src\"];\n /** What the screen shows instead of the video player: an `EmbedFacade` for a platform's short video. */\n children?: React.ReactNode;\n /** The cabinet style. */\n variant?: \"cabinet\" | \"portable\";\n /** A short channel label shown on the cabinet, for example `\"CH 3 · Plateau\"`. */\n channel?: string;\n /** Shows animated static instead of loading or playing the video. */\n off?: boolean;\n /** Starts muted and plays only while on screen; reduced motion waits for a gesture. Default `true`. */\n autoPlay?: boolean;\n /** Starts the player muted. Default `true`. */\n muted?: boolean;\n /** Plays the video again from the start when it ends. Default `true`. */\n loop?: boolean;\n /** How much to fetch before playback. Default `none` for lazy loading. */\n preload?: VideoPlayerProps[\"preload\"];\n /** Additional classes on the television frame. */\n className?: string;\n}\n\n/**\n * A vertical video presented in an old-school television; the existing player remains fully accessible.\n */\nexport function RetroTv({\n variant = \"cabinet\",\n channel,\n off = false,\n autoPlay = true,\n muted = true,\n loop = true,\n preload = \"none\",\n className,\n children,\n src,\n ...playerProps\n}: RetroTvProps) {\n const root = React.useRef<HTMLDivElement>(null);\n const [powered, setPowered] = React.useState(false);\n const reducedMotion = usePrefersReducedMotion();\n const uid = React.useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const noiseId = `${uid}-noise`;\n const glassId = `${uid}-glass`;\n const shineId = `${uid}-shine`;\n\n useInView(root, setPowered);\n const player = src ? <VideoPlayer {...playerProps} src={src} className=\"kz-rtv-player\" aspectRatio=\"9 / 16\" autoPlay={autoPlay} muted={muted} loop={loop} preload={preload} /> : null;\n const screen = children ?? player;\n\n return (\n <div ref={root} className={[\"kz-rtv\", className].filter(Boolean).join(\" \")} data-variant={variant} data-powered={powered && !reducedMotion ? \"true\" : undefined} data-off={off ? \"true\" : undefined}>\n <style>{styles}</style>\n <div className=\"kz-rtv-cabinet\" aria-hidden=\"true\">\n <div className=\"kz-rtv-body\">\n <div className=\"kz-rtv-bezel\" />\n <div className=\"kz-rtv-controls\">\n <span className=\"kz-rtv-knob\" data-hue=\"accent\" />\n <span className=\"kz-rtv-knob\" data-hue=\"accent\" />\n </div>\n <div className=\"kz-rtv-speaker\">{Array.from({ length: 7 }, (_, index) => <i key={index} />)}</div>\n </div>\n <div className=\"kz-rtv-stand\" />\n </div>\n {channel && <span className=\"kz-rtv-channel\">{channel}</span>}\n <div className=\"kz-rtv-screen\">\n {off ? (\n <svg className=\"kz-rtv-noise\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\n <filter id={noiseId}><feTurbulence type=\"fractalNoise\" baseFrequency=\".85\" numOctaves=\"2\" stitchTiles=\"stitch\" /><feColorMatrix type=\"saturate\" values=\"0\" /></filter>\n <rect width=\"100%\" height=\"100%\" filter={`url(#${noiseId})`} />\n </svg>\n ) : (\n screen\n )}\n <div className=\"kz-rtv-effects\" aria-hidden=\"true\">\n <svg className=\"kz-rtv-glass\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\">\n <defs>\n <radialGradient id={shineId} cx=\"50%\" cy=\"42%\" r=\"68%\">\n <stop offset=\"0\" stopColor=\"var(--kz-surface-sheen)\" stopOpacity=\".12\" />\n <stop offset=\"1\" stopColor=\"var(--kz-scrim-strong)\" stopOpacity=\".2\" />\n </radialGradient>\n <filter id={glassId}>\n <feTurbulence baseFrequency=\".01 .04\" numOctaves=\"1\" seed=\"2\" result=\"curve\" />\n <feDisplacementMap in=\"SourceGraphic\" in2=\"curve\" scale=\"1.2\" xChannelSelector=\"R\" yChannelSelector=\"G\" />\n </filter>\n </defs>\n <rect width=\"100\" height=\"100\" fill={`url(#${shineId})`} filter={`url(#${glassId})`} />\n </svg>\n <span className=\"kz-rtv-glow\" />\n <span className=\"kz-rtv-power\" />\n </div>\n </div>\n {off && <span className=\"sr-only\">{playerProps.title}</span>}\n </div>\n );\n}\n"
377
+ "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { CaptionsGlyph, PauseGlyph, PlayGlyph, VolumeGlyph } from \"../glyphs\";\nimport { formatClock, playSafely, useInView, usePrefersReducedMotion } from \"../media\";\nimport { VideoPlayer, type VideoPlayerProps } from \"../video-player/video-player\";\n\nconst styles = `\n.kz-rtv{container-type:inline-size;width:100%;max-width:100%;color:var(--kz-text-primary)}\n.kz-rtv-frame{position:relative;isolation:isolate;width:100%;aspect-ratio:4/5}\n@container (min-width:44rem){.kz-rtv-frame{aspect-ratio:16/10}.kz-rtv-bezel{width:72%}.kz-rtv-screen{width:66%}.kz-rtv-controls{width:18%;right:5%}.kz-rtv-speaker{width:18%;right:5%}}\n.kz-rtv-cabinet{position:absolute;inset:0;overflow:hidden}\n.kz-rtv-body{position:absolute;inset:4% 4% 16%;border:1px solid var(--kz-border-strong);border-radius:8% / 6%;background:linear-gradient(145deg,var(--kz-surface-sheen),transparent 35%),linear-gradient(145deg,color-mix(in srgb,var(--kz-warning) 18%,var(--kz-surface-3)),color-mix(in srgb,var(--kz-warning-text) 10%,var(--kz-surface-2)) 48%,var(--kz-surface-1));box-shadow:inset 0 1px 0 var(--kz-surface-sheen),inset 0 -3px 6px color-mix(in srgb,var(--kz-scrim-strong) 30%,transparent),0 1.2rem 2rem color-mix(in srgb,var(--kz-scrim-strong) 24%,transparent)}\n.kz-rtv[data-variant=portable] .kz-rtv-body{border-radius:12% / 8%;background:linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-2) 55%,var(--kz-surface-3))}\n.kz-rtv-body:after{position:absolute;inset:0;border-radius:inherit;background:repeating-linear-gradient(115deg,transparent 0 7px,color-mix(in srgb,var(--kz-border-subtle) 35%,transparent) 8px 9px);content:\"\";opacity:.4;pointer-events:none}\n.kz-rtv-bezel{position:absolute;top:0;bottom:0;left:6%;width:61%;border:1px solid var(--kz-border-strong);border-radius:14% / 7%;background:linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-3));box-shadow:inset 0 2px 5px color-mix(in srgb,var(--kz-scrim-strong) 35%,transparent),0 1px 2px color-mix(in srgb,var(--kz-surface-sheen) 60%,transparent)}\n.kz-rtv[data-variant=portable] .kz-rtv-bezel{border-radius:19% / 9%;background:linear-gradient(145deg,var(--kz-surface-0),var(--kz-surface-2))}\n.kz-rtv-controls{position:absolute;top:16%;right:7%;display:flex;width:23%;flex-direction:column;align-items:center;gap:1.1rem}\n.kz-rtv-knob{position:relative;display:block;width:2.3rem;max-width:70%;aspect-ratio:1;border:2px solid var(--kz-border-strong);border-radius:50%;background:radial-gradient(circle at 35% 28%,var(--kz-surface-sheen),transparent 30%),linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-3));box-shadow:inset 0 -2px 3px color-mix(in srgb,var(--kz-scrim-strong) 35%,transparent),0 2px 4px color-mix(in srgb,var(--kz-scrim-strong) 25%,transparent);color:var(--kz-accent)}\n.kz-rtv-knob[data-hue=accent]{background:radial-gradient(circle at 35% 28%,var(--kz-surface-sheen),transparent 30%),linear-gradient(145deg,var(--kz-accent-text),var(--kz-accent))}\n.kz-rtv-knob{transform:rotate(var(--kz-rtv-angle,0deg));transition:transform .4s cubic-bezier(.3,1.4,.5,1)}\n.kz-rtv-knob:before{position:absolute;inset:-.35rem;border-radius:50%;background:repeating-conic-gradient(from -135deg,var(--kz-border-strong) 0 2deg,transparent 2deg 27deg);content:\"\";-webkit-mask:radial-gradient(circle,transparent 62%,#000 64%);mask:radial-gradient(circle,transparent 62%,#000 64%);transform:rotate(calc(var(--kz-rtv-angle,0deg)*-1))}\n.kz-rtv-knob:after{position:absolute;top:14%;left:calc(50% - 1px);width:2px;height:27%;border-radius:2px;background:var(--kz-on-accent);content:\"\"}\n.kz-rtv[data-variant=portable] .kz-rtv-knob{width:1.9rem}\n.kz-rtv-speaker{position:absolute;right:7%;bottom:9%;display:flex;width:23%;flex-direction:column;gap:3px}\n.kz-rtv-speaker i{height:2px;border-radius:2px;background:var(--kz-border-strong);box-shadow:0 1px 0 var(--kz-surface-sheen)}\n.kz-rtv[data-variant=portable] .kz-rtv-speaker{display:none}\n.kz-rtv-stand{position:absolute;bottom:4%;left:36%;width:28%;height:12%;border-bottom:1px solid var(--kz-border-strong);border-radius:0 0 30% 30%;background:linear-gradient(180deg,var(--kz-surface-2),var(--kz-surface-3));clip-path:polygon(25% 0,75% 0,88% 78%,100% 100%,0 100%,12% 78%)}\n.kz-rtv[data-variant=portable] .kz-rtv-stand{left:40%;width:20%;height:8%;border-radius:50%;clip-path:ellipse(50% 50% at 50% 50%)}\n.kz-rtv-screen{position:absolute;top:4%;left:9.5%;width:56%;height:80%;overflow:hidden;border:2px solid color-mix(in srgb,var(--kz-border-strong) 72%,var(--kz-accent));border-radius:13% / 7%;background:var(--kz-scrim-strong);box-shadow:0 0 1.1rem color-mix(in srgb,var(--kz-accent) 30%,transparent),inset 0 0 1.2rem var(--kz-scrim-strong)}\n.kz-rtv[data-variant=portable] .kz-rtv-screen{border-radius:18% / 9%}\n.kz-rtv-screen .kz-rtv-player{height:100%;width:100%;border-radius:inherit}\n.kz-rtv-screen .kz-embed{height:100%;width:100%;aspect-ratio:auto;border-radius:inherit}\n.kz-rtv-player video,.kz-rtv-player img{object-fit:cover}\n.kz-rtv-effects{position:absolute;z-index:5;inset:0;overflow:hidden;border-radius:inherit;pointer-events:none}\n.kz-rtv-effects:before{position:absolute;inset:0;background:repeating-linear-gradient(to bottom,transparent 0 3px,color-mix(in srgb,var(--kz-scrim-strong) 25%,transparent) 4px 5px);content:\"\";opacity:.46}\n.kz-rtv-effects:after{position:absolute;inset:-1px;background:radial-gradient(ellipse at center,transparent 55%,var(--kz-scrim-strong) 100%);content:\"\";opacity:.52}\n.kz-rtv-glow{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 45%,color-mix(in srgb,var(--kz-accent) 14%,transparent),transparent 68%);opacity:.7}\n.kz-rtv-noise{position:absolute;inset:0;height:100%;width:100%;opacity:.55;filter:contrast(1.3) brightness(.85)}\n.kz-rtv-glass{position:absolute;inset:0;height:100%;width:100%;opacity:.28}\n.kz-rtv-power{position:absolute;inset:0;background:var(--kz-text-on-media);opacity:0;transform:scaleY(.01);transform-origin:center;pointer-events:none}\n.kz-rtv[data-powered=true] .kz-rtv-power{animation:kz-rtv-power .65s ease-out both}\n.kz-rtv-channel{position:absolute;z-index:7;top:8%;right:5%;width:24%;overflow:hidden;padding:.25em .4em;border:1px solid var(--kz-border-strong);border-radius:3px;background:var(--kz-surface-1);box-shadow:inset 0 1px 0 var(--kz-surface-sheen);color:var(--kz-text-primary);font:700 clamp(.5rem,1.4cqw,.7rem)/1.2 var(--kz-font-mono,monospace);letter-spacing:.12em;text-transform:uppercase;text-align:center;text-overflow:ellipsis;white-space:nowrap}\n.kz-rtv[data-variant=portable] .kz-rtv-channel{top:7%}\n.kz-rtv-layer{position:absolute;inset:0;background:var(--kz-scrim-strong)}\n.kz-rtv-layer video,.kz-rtv-layer img,.kz-rtv-layer .kz-embed{width:100%;height:100%;object-fit:contain;aspect-ratio:auto}\n.kz-rtv-layer[data-role=out]{z-index:1}.kz-rtv-layer[data-role=in]{z-index:2}\n.kz-rtv-static{position:absolute;inset:0;z-index:4;overflow:hidden;pointer-events:none}\n.kz-rtv-static:after{position:absolute;inset:-20% 0 auto;height:18%;background:linear-gradient(transparent,color-mix(in srgb,var(--kz-text-on-media) 55%,transparent),transparent);content:\"\"}\n.kz-rtv-chip,.kz-rtv-bar button{display:inline-flex;min-width:2.25rem;min-height:2.25rem;align-items:center;justify-content:center;gap:.35rem;padding:0 .55rem;border:1px solid color-mix(in srgb,var(--kz-text-on-media) 30%,transparent);border-radius:999px;background:color-mix(in srgb,var(--kz-scrim-strong) 82%,transparent);color:var(--kz-text-on-media);font:600 .72rem/1 var(--kz-font-mono,monospace);cursor:pointer}\n.kz-rtv-chip{position:absolute;z-index:8;top:.5rem;left:.5rem}\n.kz-rtv-chip:focus-visible,.kz-rtv-bar button:focus-visible,.kz-rtv-seek:focus-visible{outline:2px solid var(--kz-ring);outline-offset:2px}\n.kz-rtv-bar{position:absolute;z-index:8;inset:auto 0 0;display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;padding:1.6rem .6rem .6rem;background:linear-gradient(transparent,color-mix(in srgb,var(--kz-scrim-strong) 85%,transparent));opacity:0;transition:opacity .25s}\n.kz-rtv-screen[data-active=true] .kz-rtv-bar,.kz-rtv-screen:focus-within .kz-rtv-bar,.kz-rtv-screen:hover .kz-rtv-bar{opacity:1}\n.kz-rtv-bar svg{width:1rem;height:1rem}\n.kz-rtv-time{padding:.2rem .45rem;border-radius:4px;background:var(--kz-scrim-strong);color:var(--kz-text-on-media);font:600 .75rem/1 var(--kz-font-mono,monospace);font-variant-numeric:tabular-nums}\n.kz-rtv-seek{flex:1 1 6rem;min-width:5rem;height:1.5rem;accent-color:var(--kz-accent);cursor:pointer}\n.kz-rtv-progress{position:absolute;z-index:7;inset:auto 0 0;height:3px;background:color-mix(in srgb,var(--kz-text-on-media) 25%,transparent)}\n.kz-rtv-progress i{display:block;height:100%;background:var(--kz-accent);transform-origin:left;transform:scaleX(var(--kz-rtv-p,0))}\n@media (prefers-reduced-motion:no-preference){\n.kz-rtv-layer[data-role=in][data-tr=crossfade]{animation:kz-rtv-in .6s both}.kz-rtv-layer[data-role=out][data-tr=crossfade]{animation:kz-rtv-out .6s both}\n.kz-rtv-layer[data-role=in][data-tr=slide]{animation:kz-rtv-sin .5s ease-out both}.kz-rtv-layer[data-role=out][data-tr=slide]{animation:kz-rtv-sout .5s ease-out both}\n.kz-rtv-layer[data-role=in][data-tr=channel]{animation:kz-rtv-tune .55s steps(8,end) both}\n.kz-rtv-static{animation:kz-rtv-in .55s reverse both}.kz-rtv-static:after{animation:kz-rtv-roll .55s linear both}}\n@keyframes kz-rtv-in{from{opacity:0}to{opacity:1}}@keyframes kz-rtv-out{from{opacity:1}to{opacity:0}}\n@keyframes kz-rtv-sin{from{transform:translateX(100%)}to{transform:none}}@keyframes kz-rtv-sout{from{transform:none}to{transform:translateX(-100%)}}\n@keyframes kz-rtv-tune{0%{transform:translateY(-12%) scaleY(1.15);filter:contrast(2) brightness(1.6)}100%{transform:none;filter:none}}\n@keyframes kz-rtv-roll{from{transform:translateY(0)}to{transform:translateY(700%)}}\n.kz-rtv:focus-within .kz-rtv-screen{outline:2px solid var(--kz-ring);outline-offset:3px}\n@keyframes kz-rtv-power{0%{opacity:1;transform:scaleY(.01)}45%{opacity:.9;transform:scaleY(1)}100%{opacity:0;transform:scaleY(1)}}\n@keyframes kz-rtv-noise{0%,100%{opacity:.38}50%{opacity:.62}}\n@media (prefers-reduced-motion:no-preference){.kz-rtv[data-off=true] .kz-rtv-noise{animation:kz-rtv-noise .18s steps(2,end) infinite}}\n@media (prefers-reduced-motion:reduce){.kz-rtv-power{display:none!important}.kz-rtv-noise{animation:none!important}}\n`;\n\n\n/** One programme of the playlist: an uploaded video (`src`) or, without `src`, a slot the host fills with `renderEmbed`. */\nexport interface RetroTvSource {\n id: string;\n title: string;\n src?: string;\n poster?: string;\n /** WebVTT captions of this video. */\n tracks?: VideoPlayerProps[\"tracks\"];\n}\nexport type RetroTvTransition = \"channel\" | \"crossfade\" | \"slide\";\nexport interface RetroTvLabels { play: string; pause: string; next: string; previous: string; soundOff: string; soundOn: string; captions: string; seek: string; nowPlaying: string }\nexport const retroTvLabels: RetroTvLabels = { play: \"Play\", pause: \"Pause\", next: \"Next video\", previous: \"Previous video\", soundOff: \"Sound off: turn on\", soundOn: \"Sound on: turn off\", captions: \"Captions\", seek: \"Seek\", nowPlaying: \"Now playing\" };\nexport const retroTvLabelsFr: RetroTvLabels = { play: \"Lecture\", pause: \"Pause\", next: \"Vidéo suivante\", previous: \"Vidéo précédente\", soundOff: \"Son coupé : activer\", soundOn: \"Son activé : couper\", captions: \"Sous-titres\", seek: \"Position\", nowPlaying: \"En cours\" };\n\ntype PlaylistProps = { playlist: readonly RetroTvSource[]; transition: RetroTvTransition; labels: RetroTvLabels; muted: boolean; autoPlay: boolean; renderEmbed?: (source: RetroTvSource) => React.ReactNode; onMutedChange?: (muted: boolean) => void; onIndexChange?: (index: number) => void; title?: string; reduced: boolean; setMutedState: (m: boolean) => void; setIndex: (i: number) => void; index: number };\n\nfunction PlaylistScreen({ playlist, transition, labels, muted, autoPlay, renderEmbed, onMutedChange, onIndexChange, title, reduced, setMutedState, setIndex, index }: PlaylistProps) {\n const region = React.useRef<HTMLDivElement>(null);\n const video = React.useRef<HTMLVideoElement>(null);\n const [prev, setPrev] = React.useState<number | null>(null);\n const [seen, setSeen] = React.useState(false);\n const [playing, setPlaying] = React.useState(false);\n const [time, setTime] = React.useState({ t: 0, d: 0 });\n const [active, setActive] = React.useState(false);\n const [captionsOn, setCaptionsOn] = React.useState(false);\n const n = playlist.length;\n const current = playlist[index];\n const wake = React.useCallback(() => setActive(true), []);\n\n useInView(region, (v) => { if (v) setSeen(true); else video.current?.pause(); });\n React.useEffect(() => { if (!active) return; const id = setTimeout(() => setActive(false), 2500); return () => clearTimeout(id); }, [active]);\n React.useEffect(() => { if (prev === null) return; const id = setTimeout(() => setPrev(null), reduced ? 0 : 650); return () => clearTimeout(id); }, [prev, reduced]);\n React.useEffect(() => { if (seen && autoPlay && !reduced && current?.src) playSafely(video.current); }, [seen, autoPlay, reduced, index, current?.src]);\n React.useEffect(() => { const list = video.current?.textTracks; if (list) Array.from(list).forEach((track, i) => { track.mode = captionsOn && i === 0 ? \"showing\" : \"disabled\"; }); }, [captionsOn, index]);\n\n const go = (to: number) => {\n const next = ((to % n) + n) % n;\n if (next === index && n > 1) return;\n if (!reduced && n > 1) setPrev(index);\n setIndex(next);\n setTime({ t: 0, d: 0 });\n onIndexChange?.(next);\n };\n const toggle = () => { const v = video.current; if (!v) return; if (v.paused) playSafely(v); else v.pause(); };\n const setMuted = (m: boolean) => { setMutedState(m); onMutedChange?.(m); };\n const onKey = (e: React.KeyboardEvent) => {\n if (e.target !== e.currentTarget) return;\n const v = video.current;\n const act: Record<string, () => void> = { \" \": toggle, k: toggle, m: () => setMuted(!muted), n: () => go(index + 1), p: () => go(index - 1), ArrowRight: () => { if (v) v.currentTime += 5; }, ArrowLeft: () => { if (v) v.currentTime -= 5; } };\n const fn = act[e.key.length === 1 ? e.key.toLowerCase() : e.key];\n if (fn) { e.preventDefault(); fn(); wake(); }\n };\n const layer = (i: number, role: \"in\" | \"out\") => {\n const src = playlist[i];\n if (!src) return null;\n return (\n <div className=\"kz-rtv-layer\" key={src.id} data-role={role} data-tr={transition}>\n {src.src ? (\n role === \"in\" ? (\n <video ref={video} src={seen ? src.src : undefined} poster={src.poster} muted={muted} playsInline preload={seen ? \"auto\" : \"none\"} loop={n === 1} aria-label={src.title}\n onPlay={() => setPlaying(true)} onPause={() => setPlaying(false)} onEnded={() => { if (n > 1) go(index + 1); }}\n onTimeUpdate={(e) => setTime({ t: e.currentTarget.currentTime, d: e.currentTarget.duration || 0 })} onLoadedMetadata={(e) => setTime({ t: 0, d: e.currentTarget.duration || 0 })}>\n {src.tracks?.map((t) => <track key={t.src} kind=\"captions\" src={t.src} srcLang={t.srcLang} label={t.label} />)}\n </video>\n ) : src.poster ? <img src={src.poster} alt=\"\" /> : null\n ) : role === \"in\" ? renderEmbed?.(src) : null}\n </div>\n );\n };\n const p = time.d ? Math.min(1, time.t / time.d) : 0;\n const hasCaptions = !!current?.tracks?.length;\n return (\n <div ref={region} role=\"region\" aria-label={title ?? current?.title} tabIndex={0} className=\"kz-rtv-playlist\" data-active={active ? \"true\" : undefined} onKeyDown={onKey} onPointerMove={wake} onPointerDown={wake} onFocus={wake} style={{ position: \"absolute\", inset: 0, \"--kz-rtv-p\": p } as React.CSSProperties}>\n {prev !== null && layer(prev, \"out\")}\n {layer(index, \"in\")}\n {prev !== null && transition === \"channel\" && <div className=\"kz-rtv-static\" aria-hidden=\"true\"><span className=\"kz-rtv-noise\" style={{ position: \"absolute\", inset: 0, background: \"repeating-linear-gradient(0deg,var(--kz-text-on-media) 0 1px,var(--kz-scrim-strong) 1px 3px)\" }} /></div>}\n <button type=\"button\" className=\"kz-rtv-chip\" aria-pressed={!muted} aria-label={muted ? labels.soundOff : labels.soundOn} onClick={() => setMuted(!muted)}><VolumeGlyph muted={muted} /></button>\n <div className=\"kz-rtv-progress\" aria-hidden=\"true\"><i /></div>\n <div className=\"kz-rtv-bar\">\n <button type=\"button\" aria-label={labels.previous} onClick={() => go(index - 1)} disabled={n < 2}>«</button>\n <button type=\"button\" aria-label={playing ? labels.pause : labels.play} onClick={toggle} disabled={!current?.src}>{playing ? <PauseGlyph /> : <PlayGlyph />}</button>\n <button type=\"button\" aria-label={labels.next} onClick={() => go(index + 1)} disabled={n < 2}>»</button>\n <span className=\"kz-rtv-time\">{formatClock(time.t)} / {formatClock(time.d)}</span>\n <input className=\"kz-rtv-seek\" type=\"range\" aria-label={labels.seek} min={0} max={Math.max(1, Math.floor(time.d))} value={Math.floor(time.t)} disabled={!time.d} onChange={(e) => { if (video.current) video.current.currentTime = Number(e.target.value); }} />\n {hasCaptions && <button type=\"button\" aria-label={labels.captions} aria-pressed={captionsOn} onClick={() => setCaptionsOn(!captionsOn)}><CaptionsGlyph /></button>}\n </div>\n <span className=\"sr-only\" aria-live=\"polite\">{labels.nowPlaying}: {current?.title} ({index + 1}/{n})</span>\n </div>\n );\n}\n\n/** A vertical video in a CSS-and-SVG television cabinet. */\nexport interface RetroTvProps extends Omit<VideoPlayerProps, \"aspectRatio\" | \"labels\" | \"autoPlay\" | \"className\" | \"loop\" | \"muted\" | \"preload\" | \"src\"> {\n /** The video's address. Optional when the screen shows `children`. */\n src?: VideoPlayerProps[\"src\"];\n /** What the screen shows instead of the video player: an `EmbedFacade` for a platform's short video. */\n children?: React.ReactNode;\n /** The cabinet style. */\n variant?: \"cabinet\" | \"portable\";\n /** A short channel label shown on the cabinet, for example `\"CH 3 · Plateau\"`. */\n channel?: string;\n /** Shows animated static instead of loading or playing the video. */\n off?: boolean;\n /** Starts muted and plays only while on screen; reduced motion waits for a gesture. Default `true`. */\n autoPlay?: boolean;\n /** Starts the player muted. Default `true`. */\n muted?: boolean;\n /** Plays the video again from the start when it ends. Default `true`. */\n loop?: boolean;\n /** How much to fetch before playback. Default `none` for lazy loading. */\n preload?: VideoPlayerProps[\"preload\"];\n /** Additional classes on the television frame. */\n className?: string;\n /** Programmes played in order, then again from the first. Replaces `src` and `children`. */\n playlist?: readonly RetroTvSource[];\n /** How one programme gives way to the next; a cut under reduced motion. Default `channel`. */\n transition?: RetroTvTransition;\n /** The host fills the screen of a source that has no `src` (an embed behind its own consent gate); the library loads no third-party script. */\n renderEmbed?: (source: RetroTvSource) => React.ReactNode;\n /** Told when the visitor turns the sound on or off, so the host can remember the choice. */\n onMutedChange?: (muted: boolean) => void;\n /** Told when another programme starts. */\n onIndexChange?: (index: number) => void;\n /** The controls' words; `retroTvLabelsFr` for French. */\n labels?: Partial<RetroTvLabels>;\n}\n\n/**\n * A vertical video presented in an old-school television; the existing player remains fully accessible.\n */\nexport function RetroTv({\n variant = \"cabinet\",\n channel,\n off = false,\n autoPlay = true,\n muted = true,\n loop = true,\n preload = \"none\",\n className,\n children,\n src,\n playlist,\n transition = \"channel\",\n renderEmbed,\n onMutedChange,\n onIndexChange,\n labels,\n ...playerProps\n}: RetroTvProps) {\n const [index, setIndex] = React.useState(0);\n const [mutedState, setMutedState] = React.useState(muted);\n const root = React.useRef<HTMLDivElement>(null);\n const [powered, setPowered] = React.useState(false);\n const reducedMotion = usePrefersReducedMotion();\n const uid = React.useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const noiseId = `${uid}-noise`;\n const glassId = `${uid}-glass`;\n const shineId = `${uid}-shine`;\n\n useInView(root, setPowered);\n const player = src ? <VideoPlayer {...playerProps} src={src} className=\"kz-rtv-player\" aspectRatio=\"9 / 16\" autoPlay={autoPlay} muted={muted} loop={loop} preload={preload} /> : null;\n const knob = { channel: index * 50, sound: mutedState ? -50 : 50 };\n const screen = playlist?.length ? (\n <PlaylistScreen playlist={playlist} transition={transition} labels={{ ...retroTvLabels, ...labels }} muted={mutedState} autoPlay={autoPlay} renderEmbed={renderEmbed} onMutedChange={onMutedChange} onIndexChange={onIndexChange} title={playerProps.title} reduced={reducedMotion} setMutedState={setMutedState} setIndex={setIndex} index={index} />\n ) : children ?? player;\n\n return (\n <div ref={root} className={[\"kz-rtv\", className].filter(Boolean).join(\" \")} data-variant={variant} data-powered={powered && !reducedMotion ? \"true\" : undefined} data-off={off ? \"true\" : undefined}>\n <style>{styles}</style>\n <div className=\"kz-rtv-frame\">\n <div className=\"kz-rtv-cabinet\" aria-hidden=\"true\">\n <div className=\"kz-rtv-body\">\n <div className=\"kz-rtv-bezel\" />\n <div className=\"kz-rtv-controls\">\n <span className=\"kz-rtv-knob\" data-hue=\"accent\" style={{ \"--kz-rtv-angle\": `${knob.channel}deg` } as React.CSSProperties} />\n <span className=\"kz-rtv-knob\" data-hue=\"accent\" style={{ \"--kz-rtv-angle\": `${knob.sound}deg` } as React.CSSProperties} />\n </div>\n <div className=\"kz-rtv-speaker\">{Array.from({ length: 7 }, (_, index) => <i key={index} />)}</div>\n </div>\n <div className=\"kz-rtv-stand\" />\n </div>\n {channel && <span className=\"kz-rtv-channel\">{channel}</span>}\n <div className=\"kz-rtv-screen\">\n {off ? (\n <svg className=\"kz-rtv-noise\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\n <filter id={noiseId}><feTurbulence type=\"fractalNoise\" baseFrequency=\".85\" numOctaves=\"2\" stitchTiles=\"stitch\" /><feColorMatrix type=\"saturate\" values=\"0\" /></filter>\n <rect width=\"100%\" height=\"100%\" filter={`url(#${noiseId})`} />\n </svg>\n ) : (\n screen\n )}\n <div className=\"kz-rtv-effects\" aria-hidden=\"true\">\n <svg className=\"kz-rtv-glass\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\">\n <defs>\n <radialGradient id={shineId} cx=\"50%\" cy=\"42%\" r=\"68%\">\n <stop offset=\"0\" stopColor=\"var(--kz-surface-sheen)\" stopOpacity=\".12\" />\n <stop offset=\"1\" stopColor=\"var(--kz-scrim-strong)\" stopOpacity=\".2\" />\n </radialGradient>\n <filter id={glassId}>\n <feTurbulence baseFrequency=\".01 .04\" numOctaves=\"1\" seed=\"2\" result=\"curve\" />\n <feDisplacementMap in=\"SourceGraphic\" in2=\"curve\" scale=\"1.2\" xChannelSelector=\"R\" yChannelSelector=\"G\" />\n </filter>\n </defs>\n <rect width=\"100\" height=\"100\" fill={`url(#${shineId})`} filter={`url(#${glassId})`} />\n </svg>\n <span className=\"kz-rtv-glow\" />\n <span className=\"kz-rtv-power\" />\n </div>\n </div>\n {off && <span className=\"sr-only\">{playerProps.title}</span>}\n </div>\n </div>\n );\n}\n"
301
378
  }
302
379
  ],
303
380
  "dependencies": [],
@@ -357,9 +434,9 @@
357
434
  },
358
435
  {
359
436
  "name": "labels",
360
- "type": "Partial<VideoPlayerLabels>",
437
+ "type": "Partial<RetroTvLabels>",
361
438
  "default": null,
362
- "description": "The words, passed translated; English by default.",
439
+ "description": "The controls' words; `retroTvLabelsFr` for French.",
363
440
  "required": false
364
441
  },
365
442
  {
@@ -404,6 +481,20 @@
404
481
  "description": "Called when the video cannot play (a network failure, an expired address).",
405
482
  "required": false
406
483
  },
484
+ {
485
+ "name": "onIndexChange",
486
+ "type": "((index: number) => void)",
487
+ "default": null,
488
+ "description": "Told when another programme starts.",
489
+ "required": false
490
+ },
491
+ {
492
+ "name": "onMutedChange",
493
+ "type": "((muted: boolean) => void)",
494
+ "default": null,
495
+ "description": "Told when the visitor turns the sound on or off, so the host can remember the choice.",
496
+ "required": false
497
+ },
407
498
  {
408
499
  "name": "onPause",
409
500
  "type": "(() => void)",
@@ -446,6 +537,13 @@
446
537
  "description": "The speeds offered by the speed button. Default `[0.5, 1, 1.25, 1.5, 2]`.",
447
538
  "required": false
448
539
  },
540
+ {
541
+ "name": "playlist",
542
+ "type": "readonly RetroTvSource[]",
543
+ "default": null,
544
+ "description": "Programmes played in order, then again from the first. Replaces `src` and `children`.",
545
+ "required": false
546
+ },
449
547
  {
450
548
  "name": "poster",
451
549
  "type": "string",
@@ -460,6 +558,13 @@
460
558
  "description": "How much to fetch before playback. Default `none` for lazy loading.",
461
559
  "required": false
462
560
  },
561
+ {
562
+ "name": "renderEmbed",
563
+ "type": "((source: RetroTvSource) => ReactNode)",
564
+ "default": null,
565
+ "description": "The host fills the screen of a source that has no `src` (an embed behind its own consent gate); the library loads no third-party script.",
566
+ "required": false
567
+ },
463
568
  {
464
569
  "name": "src",
465
570
  "type": "string | (() => Promise<string>)",
@@ -474,6 +579,13 @@
474
579
  "description": "Subtitles or captions (WebVTT): the C key and a button cycle through them.",
475
580
  "required": false
476
581
  },
582
+ {
583
+ "name": "transition",
584
+ "type": "RetroTvTransition",
585
+ "default": "channel",
586
+ "description": "How one programme gives way to the next; a cut under reduced motion. Default `channel`.",
587
+ "required": false
588
+ },
477
589
  {
478
590
  "name": "type",
479
591
  "type": "\"auto\" | \"file\" | \"hls\"",
@@ -207,7 +207,7 @@
207
207
  "files": [
208
208
  {
209
209
  "path": "meta.ts",
210
- "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"
210
+ "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 | \"copy-button\"\n | \"money-input\"\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 | \"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"
211
211
  },
212
212
  {
213
213
  "path": "reviews/index.ts",