@krizaka/ui 3.73.0 → 3.75.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 (369) hide show
  1. package/README.md +4 -10
  2. package/dist/{RotatingWord-COSabR2c.d.ts → RotatingWord-D3tpDLE4.d.ts} +1 -1
  3. package/dist/account-menu.d.ts +1 -1
  4. package/dist/account-menu.js +1 -1
  5. package/dist/account-settings.d.ts +1 -1
  6. package/dist/account-settings.js +1 -1
  7. package/dist/app-frame.d.ts +2 -5
  8. package/dist/avatar/defaults.d.ts +2 -2
  9. package/dist/avatar/defaults.js +1 -5
  10. package/dist/avatar/defaults.js.map +1 -1
  11. package/dist/{avatar-B_na7r1U.d.ts → avatar-CNV6ld8l.d.ts} +2 -2
  12. package/dist/avatar.d.ts +2 -2
  13. package/dist/avatar.js +1 -5
  14. package/dist/avatar.js.map +1 -1
  15. package/dist/blocks.css +4 -4
  16. package/dist/chat.js +1 -1
  17. package/dist/{chunk-5MPPIGCB.js → chunk-E46AEUPH.js} +1 -5
  18. package/dist/chunk-E46AEUPH.js.map +1 -0
  19. package/dist/{chunk-TISDOZH3.js → chunk-IOTY5HYG.js} +1 -5
  20. package/dist/chunk-IOTY5HYG.js.map +1 -0
  21. package/dist/chunk-PGPNYYE2.js +286 -0
  22. package/dist/chunk-PGPNYYE2.js.map +1 -0
  23. package/dist/{chunk-GRVIZTT2.js → chunk-RI3AA2E3.js} +3 -3
  24. package/dist/{chunk-Y5YBTHVD.js → chunk-SG3QJJXE.js} +6 -12
  25. package/dist/chunk-SG3QJJXE.js.map +1 -0
  26. package/dist/{chunk-4JO5GSSD.js → chunk-VA4NPCUQ.js} +2 -2
  27. package/dist/chunk-VA4NPCUQ.js.map +1 -0
  28. package/dist/{chunk-E4FMPPDL.js → chunk-WC3SO4CE.js} +2 -2
  29. package/dist/{chunk-T5NZSKWT.js → chunk-YQWYGQTV.js} +38 -41
  30. package/dist/chunk-YQWYGQTV.js.map +1 -0
  31. package/dist/{chunk-M3GEYLMR.js → chunk-ZPOVOEO3.js} +1 -2
  32. package/dist/collection-switcher.d.ts +1 -1
  33. package/dist/data-table.js +3 -3
  34. package/dist/{default-avatar-BL0nJFti.d.ts → default-avatar-Bh4atFDo.d.ts} +2 -2
  35. package/dist/elephant.d.ts +2 -2
  36. package/dist/elephant.js +2 -3
  37. package/dist/elephant.js.map +1 -1
  38. package/dist/engine-flow.js +29 -21
  39. package/dist/engine-flow.js.map +1 -1
  40. package/dist/entity-header.d.ts +1 -1
  41. package/dist/filter-bar.d.ts +9 -1
  42. package/dist/filter-bar.js +1 -1
  43. package/dist/gallery-page.js +3 -3
  44. package/dist/genui.js +101 -35
  45. package/dist/genui.js.map +1 -1
  46. package/dist/index.d.ts +7 -51
  47. package/dist/index.js +2 -12
  48. package/dist/index.js.map +1 -1
  49. package/dist/{lightbox-D5NAHFEA.js → lightbox-Q45BZ3HW.js} +3 -3
  50. package/dist/map.js +0 -120
  51. package/dist/map.js.map +1 -1
  52. package/dist/match-dialog.js +3 -3
  53. package/dist/motion.css +3 -120
  54. package/dist/motion.d.ts +1 -1
  55. package/dist/motion.js +1 -1
  56. package/dist/native/list.js +1 -1
  57. package/dist/native/list.js.map +1 -1
  58. package/dist/native/map.js +0 -120
  59. package/dist/native/map.js.map +1 -1
  60. package/dist/native.d.ts +7 -111
  61. package/dist/native.js +988 -1436
  62. package/dist/native.js.map +1 -1
  63. package/dist/nav-bar.d.ts +1 -1
  64. package/dist/nav-bar.js +2 -2
  65. package/dist/product-page.js +3 -3
  66. package/dist/rail-nav.d.ts +2 -5
  67. package/dist/shop-gallery.js +1 -1
  68. package/dist/site-cahier.d.ts +3 -11
  69. package/dist/site-cahier.js +126 -367
  70. package/dist/site-cahier.js.map +1 -1
  71. package/dist/site-footer.d.ts +1 -1
  72. package/dist/site-footer.js +2 -2
  73. package/dist/{sites-CEnywB89.d.ts → sites-CVNSirrg.d.ts} +3 -11
  74. package/dist/sites.d.ts +7 -15
  75. package/dist/sites.js +4 -10
  76. package/dist/sites.js.map +1 -1
  77. package/dist/tag-selector.js +28 -21
  78. package/dist/tag-selector.js.map +1 -1
  79. package/dist/vertical-video.js +2 -2
  80. package/dist/waveform.js.map +1 -1
  81. package/package.json +5 -109
  82. package/registry/account-menu.json +1 -1
  83. package/registry/account-settings.json +1 -1
  84. package/registry/achievement.json +1 -1
  85. package/registry/action-bar.json +1 -1
  86. package/registry/activity-feed.json +1 -1
  87. package/registry/agenda.json +1 -1
  88. package/registry/alert.json +1 -1
  89. package/registry/analysis-report.json +1 -1
  90. package/registry/anatomy-plate.json +1 -1
  91. package/registry/app-frame.json +6 -38
  92. package/registry/app-header.json +1 -1
  93. package/registry/app-shell.json +1 -1
  94. package/registry/argument-card.json +1 -1
  95. package/registry/auth-layout.json +1 -1
  96. package/registry/avatar.json +2 -2
  97. package/registry/badge.json +1 -1
  98. package/registry/bird-plate.json +1 -1
  99. package/registry/button.json +1 -1
  100. package/registry/captcha.json +1 -1
  101. package/registry/card-grid.json +1 -1
  102. package/registry/card.json +1 -1
  103. package/registry/catalogue-page.json +1 -1
  104. package/registry/changelog-page.json +1 -1
  105. package/registry/chapter.json +1 -1
  106. package/registry/chat.json +3 -3
  107. package/registry/checkbox.json +1 -1
  108. package/registry/chip-link.json +1 -1
  109. package/registry/chip-row.json +1 -1
  110. package/registry/chip.json +1 -1
  111. package/registry/choice-grid.json +1 -1
  112. package/registry/code-block.json +1 -1
  113. package/registry/collection-switcher.json +1 -1
  114. package/registry/combobox.json +1 -1
  115. package/registry/command.json +1 -1
  116. package/registry/comparison-table.json +1 -1
  117. package/registry/component-page.json +1 -1
  118. package/registry/confirm-button.json +1 -1
  119. package/registry/contact-page.json +1 -1
  120. package/registry/continue-prompt.json +1 -1
  121. package/registry/copy-button.json +1 -1
  122. package/registry/countdown.json +1 -1
  123. package/registry/cover-hero.json +1 -1
  124. package/registry/cta-panel.json +1 -1
  125. package/registry/dashboard-layout.json +1 -1
  126. package/registry/data-table.json +1 -1
  127. package/registry/date-picker.json +1 -1
  128. package/registry/decision-list.json +1 -1
  129. package/registry/description-list.json +1 -1
  130. package/registry/desktop-window.json +1 -1
  131. package/registry/detail-layout.json +1 -1
  132. package/registry/dialog.json +1 -1
  133. package/registry/docs-article-page.json +1 -1
  134. package/registry/docs-hub-page.json +1 -1
  135. package/registry/docs-layout.json +1 -1
  136. package/registry/docs-nav.json +1 -1
  137. package/registry/document-viewer.json +1 -1
  138. package/registry/doodle.json +1 -1
  139. package/registry/drop-overlay.json +1 -1
  140. package/registry/dropdown-menu.json +1 -1
  141. package/registry/elephant.json +3 -5
  142. package/registry/embed-facade.json +1 -1
  143. package/registry/empty-state.json +1 -1
  144. package/registry/engine-flow.json +3 -4
  145. package/registry/entity-header.json +1 -1
  146. package/registry/environment-notice.json +1 -1
  147. package/registry/error-page.json +1 -1
  148. package/registry/field.json +1 -1
  149. package/registry/file-upload.json +1 -1
  150. package/registry/filter-bar.json +2 -2
  151. package/registry/flock.json +1 -1
  152. package/registry/footnote.json +1 -1
  153. package/registry/force-update-screen.json +1 -1
  154. package/registry/form.json +1 -1
  155. package/registry/gallery-page.json +1 -1
  156. package/registry/genui.json +1 -1
  157. package/registry/glossary-term.json +1 -1
  158. package/registry/glossary.json +1 -1
  159. package/registry/glow-card.json +1 -1
  160. package/registry/goal-gauge.json +1 -1
  161. package/registry/grade-stamp.json +1 -1
  162. package/registry/image-cropper.json +1 -1
  163. package/registry/index.json +11 -246
  164. package/registry/kanban.json +1 -1
  165. package/registry/kbd.json +1 -1
  166. package/registry/kind-config-editor.json +1 -1
  167. package/registry/kpi-explained.json +1 -1
  168. package/registry/landing-page.json +1 -1
  169. package/registry/landscape.json +1 -1
  170. package/registry/language-switch.json +1 -1
  171. package/registry/legal-page.json +1 -1
  172. package/registry/link-card.json +1 -1
  173. package/registry/list.json +1 -1
  174. package/registry/loader.json +1 -1
  175. package/registry/longform-page.json +1 -1
  176. package/registry/maintenance-screen.json +1 -1
  177. package/registry/map.json +2 -2
  178. package/registry/margin-layout.json +1 -1
  179. package/registry/markdown.json +1 -1
  180. package/registry/marketing-layout.json +1 -1
  181. package/registry/mascot-quote.json +1 -1
  182. package/registry/mascot-state.json +1 -1
  183. package/registry/mascots.json +1 -1
  184. package/registry/match-dialog.json +3 -3
  185. package/registry/media-capture.json +1 -1
  186. package/registry/media-gallery.json +3 -14
  187. package/registry/meter.json +1 -1
  188. package/registry/money-input.json +1 -1
  189. package/registry/nav-bar.json +6 -38
  190. package/registry/next-actions.json +1 -1
  191. package/registry/notification-preferences.json +1 -1
  192. package/registry/number-ticker.json +1 -1
  193. package/registry/opening-hours.json +3 -4
  194. package/registry/page-header.json +1 -1
  195. package/registry/page-hero.json +1 -1
  196. package/registry/page-index.json +1 -1
  197. package/registry/page.json +1 -1
  198. package/registry/pagination.json +1 -1
  199. package/registry/pointer-light.json +1 -1
  200. package/registry/popover.json +1 -1
  201. package/registry/price-catalogue-editor.json +1 -1
  202. package/registry/pricing-page.json +1 -1
  203. package/registry/product-page.json +2 -6
  204. package/registry/profile-card.json +1 -1
  205. package/registry/progress.json +1 -1
  206. package/registry/promise-card.json +1 -1
  207. package/registry/promo-code-field.json +1 -1
  208. package/registry/proposal.json +1 -1
  209. package/registry/qr-code.json +1 -1
  210. package/registry/quota-meter.json +1 -1
  211. package/registry/radio-group.json +1 -1
  212. package/registry/rail-nav.json +6 -38
  213. package/registry/recipes.json +1 -1
  214. package/registry/retro-tv.json +2 -3
  215. package/registry/reviews.json +1 -1
  216. package/registry/router.json +1 -1
  217. package/registry/schema-form.json +1 -1
  218. package/registry/scroll-stage.json +1 -1
  219. package/registry/search-field.json +1 -1
  220. package/registry/section-backdrop.json +1 -1
  221. package/registry/separator.json +1 -1
  222. package/registry/service-card.json +1 -1
  223. package/registry/settings-layout.json +1 -1
  224. package/registry/shop-composer.json +1 -1
  225. package/registry/shop-gallery.json +3 -8
  226. package/registry/shop.json +2 -2
  227. package/registry/showcase.json +2 -7
  228. package/registry/signature.json +1 -1
  229. package/registry/site-cahier.json +1 -1
  230. package/registry/site-footer.json +6 -38
  231. package/registry/sites.json +3 -3
  232. package/registry/skeleton.json +1 -1
  233. package/registry/skip-link.json +1 -1
  234. package/registry/slider.json +1 -1
  235. package/registry/slot-picker.json +1 -1
  236. package/registry/slot.json +1 -1
  237. package/registry/specimen-tag.json +1 -1
  238. package/registry/speed-lines.json +1 -1
  239. package/registry/spinner.json +1 -1
  240. package/registry/split-view.json +1 -1
  241. package/registry/stage-banner.json +1 -1
  242. package/registry/stat.json +1 -1
  243. package/registry/status-chip.json +1 -1
  244. package/registry/status-page.json +1 -1
  245. package/registry/step-progress.json +1 -1
  246. package/registry/step-showcase.json +1 -1
  247. package/registry/stepper.json +1 -1
  248. package/registry/sticky-action.json +1 -1
  249. package/registry/stuck.json +1 -1
  250. package/registry/swipe-deck.json +4 -5
  251. package/registry/switch.json +1 -1
  252. package/registry/tabs.json +1 -1
  253. package/registry/tag-input.json +1 -1
  254. package/registry/tag-selector.json +2 -2
  255. package/registry/taped-photo.json +1 -1
  256. package/registry/terminal-replay.json +1 -1
  257. package/registry/text-style.json +1 -1
  258. package/registry/theme.json +1 -1
  259. package/registry/toast.json +1 -1
  260. package/registry/toc.json +1 -1
  261. package/registry/tooltip.json +1 -1
  262. package/registry/tree-view.json +1 -1
  263. package/registry/update-prompt.json +1 -1
  264. package/registry/upload-queue.json +1 -1
  265. package/registry/usage.json +1 -1
  266. package/registry/verified-badge.json +1 -1
  267. package/registry/versus-card.json +1 -1
  268. package/registry/vertical-video.json +2 -6
  269. package/registry/video-player.json +2 -7
  270. package/registry/video-trimmer.json +3 -4
  271. package/registry/virtual.json +1 -1
  272. package/registry/wall.json +3 -9
  273. package/registry/waveform.json +4 -9
  274. package/dist/audio-player.d.ts +0 -115
  275. package/dist/audio-player.js +0 -211
  276. package/dist/audio-player.js.map +0 -1
  277. package/dist/chunk-4JO5GSSD.js.map +0 -1
  278. package/dist/chunk-5MPPIGCB.js.map +0 -1
  279. package/dist/chunk-B2HS5EAH.js +0 -527
  280. package/dist/chunk-B2HS5EAH.js.map +0 -1
  281. package/dist/chunk-T5NZSKWT.js.map +0 -1
  282. package/dist/chunk-TISDOZH3.js.map +0 -1
  283. package/dist/chunk-Y5YBTHVD.js.map +0 -1
  284. package/dist/chunk-YKOLME7R.js +0 -126
  285. package/dist/chunk-YKOLME7R.js.map +0 -1
  286. package/dist/how-it-works-page.d.ts +0 -49
  287. package/dist/how-it-works-page.js +0 -28
  288. package/dist/how-it-works-page.js.map +0 -1
  289. package/dist/iso.d.ts +0 -401
  290. package/dist/iso.js +0 -363
  291. package/dist/iso.js.map +0 -1
  292. package/dist/marquee.d.ts +0 -34
  293. package/dist/marquee.js +0 -52
  294. package/dist/marquee.js.map +0 -1
  295. package/dist/media-grid.d.ts +0 -246
  296. package/dist/media-grid.js +0 -468
  297. package/dist/media-grid.js.map +0 -1
  298. package/dist/meta-row.d.ts +0 -55
  299. package/dist/meta-row.js +0 -35
  300. package/dist/meta-row.js.map +0 -1
  301. package/dist/photo-grid.d.ts +0 -123
  302. package/dist/photo-grid.js +0 -94
  303. package/dist/photo-grid.js.map +0 -1
  304. package/registry/audio-player.json +0 -300
  305. package/registry/examples/audio-player/podcast.d.ts +0 -4
  306. package/registry/examples/audio-player/podcast.js +0 -22
  307. package/registry/examples/audio-player/podcast.tsx +0 -19
  308. package/registry/examples/audio-player/voice-note.d.ts +0 -4
  309. package/registry/examples/audio-player/voice-note.js +0 -12
  310. package/registry/examples/audio-player/voice-note.tsx +0 -12
  311. package/registry/examples/how-it-works-page/orazaka.d.ts +0 -4
  312. package/registry/examples/how-it-works-page/orazaka.js +0 -30
  313. package/registry/examples/how-it-works-page/orazaka.tsx +0 -26
  314. package/registry/examples/iso/compose.d.ts +0 -4
  315. package/registry/examples/iso/compose.js +0 -22
  316. package/registry/examples/iso/compose.tsx +0 -19
  317. package/registry/examples/iso/creator-hero.d.ts +0 -4
  318. package/registry/examples/iso/creator-hero.js +0 -29
  319. package/registry/examples/iso/creator-hero.tsx +0 -23
  320. package/registry/examples/iso/orazaka-hero.d.ts +0 -4
  321. package/registry/examples/iso/orazaka-hero.js +0 -26
  322. package/registry/examples/iso/orazaka-hero.tsx +0 -21
  323. package/registry/examples/iso/still.d.ts +0 -4
  324. package/registry/examples/iso/still.js +0 -21
  325. package/registry/examples/iso/still.tsx +0 -15
  326. package/registry/examples/marquee/cards.d.ts +0 -4
  327. package/registry/examples/marquee/cards.js +0 -23
  328. package/registry/examples/marquee/cards.tsx +0 -21
  329. package/registry/examples/marquee/logos.d.ts +0 -4
  330. package/registry/examples/marquee/logos.js +0 -12
  331. package/registry/examples/marquee/logos.tsx +0 -17
  332. package/registry/examples/media-grid/feed.d.ts +0 -4
  333. package/registry/examples/media-grid/feed.js +0 -32
  334. package/registry/examples/media-grid/feed.tsx +0 -31
  335. package/registry/examples/media-grid/loading.d.ts +0 -4
  336. package/registry/examples/media-grid/loading.js +0 -28
  337. package/registry/examples/media-grid/loading.tsx +0 -25
  338. package/registry/examples/media-grid/uniform.d.ts +0 -4
  339. package/registry/examples/media-grid/uniform.js +0 -29
  340. package/registry/examples/media-grid/uniform.tsx +0 -26
  341. package/registry/examples/meta-row/native/video.d.ts +0 -4
  342. package/registry/examples/meta-row/native/video.dark.png +0 -0
  343. package/registry/examples/meta-row/native/video.js +0 -11
  344. package/registry/examples/meta-row/native/video.light.png +0 -0
  345. package/registry/examples/meta-row/native/video.tsx +0 -5
  346. package/registry/examples/meta-row/status.d.ts +0 -4
  347. package/registry/examples/meta-row/status.js +0 -12
  348. package/registry/examples/meta-row/status.tsx +0 -7
  349. package/registry/examples/meta-row/video.d.ts +0 -4
  350. package/registry/examples/meta-row/video.js +0 -12
  351. package/registry/examples/meta-row/video.tsx +0 -7
  352. package/registry/examples/photo-grid/native/profile-photos.d.ts +0 -4
  353. package/registry/examples/photo-grid/native/profile-photos.dark.png +0 -0
  354. package/registry/examples/photo-grid/native/profile-photos.js +0 -27
  355. package/registry/examples/photo-grid/native/profile-photos.light.png +0 -0
  356. package/registry/examples/photo-grid/native/profile-photos.tsx +0 -24
  357. package/registry/examples/photo-grid/profile-photos.d.ts +0 -4
  358. package/registry/examples/photo-grid/profile-photos.js +0 -28
  359. package/registry/examples/photo-grid/profile-photos.tsx +0 -25
  360. package/registry/how-it-works-page.json +0 -258
  361. package/registry/iso.json +0 -1371
  362. package/registry/marquee.json +0 -241
  363. package/registry/media-grid.json +0 -1034
  364. package/registry/meta-row.json +0 -218
  365. package/registry/photo-grid.json +0 -316
  366. /package/dist/{chunk-GRVIZTT2.js.map → chunk-RI3AA2E3.js.map} +0 -0
  367. /package/dist/{chunk-E4FMPPDL.js.map → chunk-WC3SO4CE.js.map} +0 -0
  368. /package/dist/{chunk-M3GEYLMR.js.map → chunk-ZPOVOEO3.js.map} +0 -0
  369. /package/dist/{lightbox-D5NAHFEA.js.map → lightbox-Q45BZ3HW.js.map} +0 -0
@@ -1,300 +0,0 @@
1
- {
2
- "name": "audio-player",
3
- "type": "primitive",
4
- "title": "Audio player",
5
- "summary": "A sound with a waveform you seek on — the peaks given by the server or computed once with Web Audio — play, time and speed, paused when it leaves the screen.",
6
- "description": "A sound with a waveform you seek on — the peaks given by the server or computed once with Web Audio — play, time and speed, paused when it leaves the screen.",
7
- "status": "beta",
8
- "deprecated": null,
9
- "category": "media",
10
- "domain": "media",
11
- "adoption": null,
12
- "platforms": "web",
13
- "parity": {
14
- "web": {
15
- "state": "yes"
16
- },
17
- "native": {
18
- "state": "gap",
19
- "reason": "Needs an Expo audio module as an optional peer; voice notes will need it.",
20
- "issue": "krizaka/krizaka-ui#278"
21
- },
22
- "desktop": {
23
- "state": "yes"
24
- }
25
- },
26
- "whenToUse": [
27
- "For a voice note, a podcast extract, a generated voice, a music preview.",
28
- "When the shape of the sound helps to find a moment (speech and silences)."
29
- ],
30
- "whenNotToUse": [
31
- {
32
- "when": "For a sound with a picture: the video player.",
33
- "use": "video-player"
34
- },
35
- {
36
- "when": "To show a value along a bar without a sound: a progress bar.",
37
- "use": "progress"
38
- }
39
- ],
40
- "bestPractices": [
41
- "Compute the peaks on the server once (`peaks`); `computePeaks` downloads and decodes the whole file in the browser.",
42
- "Give `duration` when you know it: the time shows before the metadata arrives.",
43
- "Name the player by its content (“Voice note from Eric, 0:42”)."
44
- ],
45
- "accessibility": {
46
- "keyboard": [
47
- {
48
- "keys": "Arrow keys",
49
- "action": "Back or forward 5 seconds on the waveform."
50
- },
51
- {
52
- "keys": "Page Up / Page Down",
53
- "action": "Back or forward 30 seconds."
54
- },
55
- {
56
- "keys": "Home / End",
57
- "action": "The start or the end."
58
- }
59
- ],
60
- "notes": [
61
- "A `group` named by `title`; the waveform is a `slider` whose value is read as a time (“0:42 of 3:10”).",
62
- "The play button says its state (“Pause” while playing); the speed button its speed.",
63
- "The bars are decorative; only the colour of the played part changes, nothing moves."
64
- ]
65
- },
66
- "related": [
67
- "video-player",
68
- "slider",
69
- "progress"
70
- ],
71
- "web": {
72
- "entry": "@krizaka/ui/audio-player",
73
- "import": "import { AudioPlayer, resamplePeaks, computeAudioPeaks } from \"@krizaka/ui/audio-player\";",
74
- "props": [
75
- {
76
- "component": "AudioPlayer",
77
- "description": "A sound with a seekable waveform: play / pause, time, speed — a voice note, a podcast clip, a track.",
78
- "props": [
79
- {
80
- "name": "src",
81
- "type": "string",
82
- "default": null,
83
- "description": "The address of the sound.",
84
- "required": true
85
- },
86
- {
87
- "name": "title",
88
- "type": "string",
89
- "default": null,
90
- "description": "What it is (\"Voice note — Eric, 0:42\"): shown, and the accessible name of the player.",
91
- "required": true
92
- },
93
- {
94
- "name": "bars",
95
- "type": "number",
96
- "default": "48",
97
- "description": "How many bars. Default 48.",
98
- "required": false
99
- },
100
- {
101
- "name": "className",
102
- "type": "string",
103
- "default": null,
104
- "description": "Classes merged on the root.",
105
- "required": false
106
- },
107
- {
108
- "name": "computePeaks",
109
- "type": "boolean",
110
- "default": null,
111
- "description": "Without `peaks`: fetches the file and computes them with Web Audio at the first play (same-origin or CORS).",
112
- "required": false
113
- },
114
- {
115
- "name": "duration",
116
- "type": "number",
117
- "default": "0",
118
- "description": "The length, in seconds, before the metadata is loaded (from the server).",
119
- "required": false
120
- },
121
- {
122
- "name": "labels",
123
- "type": "Partial<AudioPlayerLabels>",
124
- "default": null,
125
- "description": "The words, passed translated; English by default.",
126
- "required": false
127
- },
128
- {
129
- "name": "onPlayingChange",
130
- "type": "((playing: boolean) => void)",
131
- "default": null,
132
- "description": "Called when playback starts, pauses, ends.",
133
- "required": false
134
- },
135
- {
136
- "name": "pauseWhenHidden",
137
- "type": "boolean",
138
- "default": "true",
139
- "description": "Pauses when it leaves the screen. Default `true`.",
140
- "required": false
141
- },
142
- {
143
- "name": "peaks",
144
- "type": "readonly number[]",
145
- "default": null,
146
- "description": "The peaks, between 0 and 1, as many as you like (they are resampled to `bars`).",
147
- "required": false
148
- },
149
- {
150
- "name": "playbackRates",
151
- "type": "readonly number[]",
152
- "default": "[1, 1.5, 2]",
153
- "description": "The speeds of the speed button. Default `[1, 1.5, 2]`; `[]` hides it.",
154
- "required": false
155
- }
156
- ]
157
- }
158
- ],
159
- "examples": [
160
- {
161
- "name": "voice-note",
162
- "title": "Voice note",
163
- "description": "Peaks from the server, a short note.",
164
- "path": "examples/audio-player/voice-note.tsx",
165
- "module": "@krizaka/ui/registry/examples/audio-player/voice-note",
166
- "code": "import { AudioPlayer } from \"@krizaka/ui/audio-player\";\n\n// Peaks computed once on the server: 64 values between 0 and 1.\nconst PEAKS = Array.from({ length: 64 }, (_, i) => 0.2 + Math.abs(Math.sin(i * 0.45) * Math.cos(i * 0.13)) * 0.8);\n\nexport default function AudioPlayerVoiceNote() {\n return (\n <div className=\"w-full max-w-md\">\n <AudioPlayer title=\"The world of Krizaka, narrated\" src=\"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16-en.a78c24ce48.mp4\" peaks={PEAKS} duration={42} />\n </div>\n );\n}\n"
167
- },
168
- {
169
- "name": "podcast",
170
- "title": "Podcast extract",
171
- "description": "More bars and four speeds.",
172
- "path": "examples/audio-player/podcast.tsx",
173
- "module": "@krizaka/ui/registry/examples/audio-player/podcast",
174
- "code": "import { AudioPlayer } from \"@krizaka/ui/audio-player\";\n\nconst PEAKS = Array.from({ length: 200 }, (_, i) => (i % 37 < 3 ? 0.05 : 0.3 + Math.abs(Math.sin(i * 0.31)) * 0.7));\n\n// A longer extract: more bars, four speeds, the time before the metadata arrives.\nexport default function AudioPlayerPodcast() {\n return (\n <div className=\"w-full max-w-lg\">\n <AudioPlayer\n title=\"Creators' hour — episode 12, extract\"\n src=\"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-16x9-en.9391096007.mp4\"\n peaks={PEAKS}\n bars={72}\n duration={190}\n playbackRates={[1, 1.25, 1.5, 2]}\n />\n </div>\n );\n}\n"
175
- }
176
- ]
177
- },
178
- "native": null,
179
- "files": [
180
- {
181
- "path": "audio-player/audio-player.tsx",
182
- "content": "// Client. An `<audio>` with a waveform you can seek on: the bars are the sound's peaks (given by the server, or\n// computed here from the file with Web Audio when `computePeaks` — once, on demand), the played part in the accent.\n// The waveform is a `slider` (arrows ± 5 s, Page keys ± 30 s, Home / End) whose value is read as a time; the play\n// button and the speed are named by props. No animation but the played part's colour, and it pauses off screen.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { PauseGlyph, PlayGlyph } from \"../glyphs\";\nimport { clamp, formatClock, playSafely, useInView } from \"../media\";\nimport { resamplePeaks } from \"../waveform/bars\";\n\nexport { resamplePeaks };\n\nexport const audioPlayer = tv({\n slots: {\n root: \"flex w-full items-center gap-3 rounded-xl border border-border-default bg-surface-1 p-3\",\n play:\n \"inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-accent text-on-accent transition-colors hover:bg-accent-hover \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-1\",\n body: \"flex min-w-0 flex-1 flex-col gap-1\",\n title: \"truncate text-sm font-semibold text-fg\",\n wave:\n \"relative flex h-10 w-full cursor-pointer touch-none items-center gap-[2px] rounded-md \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n bar: \"min-w-[2px] flex-1 rounded-full bg-border-strong data-[played]:bg-accent\",\n meta: \"flex items-center justify-between font-mono text-[11px] tabular-nums text-fg-secondary\",\n speed:\n \"shrink-0 rounded-md px-2 py-1 text-xs font-semibold tabular-nums text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n },\n});\n\nexport type AudioPlayerLabels = {\n play: string;\n pause: string;\n /** The waveform slider (\"Seek\"). */\n seek: string;\n /** The speed button: `(rate) => \"Speed \" + rate + \"×\"`. */\n speed: (rate: number) => string;\n /** The slider's value: `(time, duration) => \"0:42 of 3:10\"`. */\n time: (time: string, duration: string) => string;\n};\n\nexport const audioPlayerLabels: AudioPlayerLabels = {\n play: \"Play\",\n pause: \"Pause\",\n seek: \"Seek\",\n speed: (rate) => `Speed ${rate}×`,\n time: (time, duration) => `${time} of ${duration}`,\n};\n\nexport type AudioPlayerProps = {\n /** The address of the sound. */\n src: string;\n /** What it is (\"Voice note — Eric, 0:42\"): shown, and the accessible name of the player. */\n title: string;\n /** The peaks, between 0 and 1, as many as you like (they are resampled to `bars`). */\n peaks?: readonly number[];\n /** Without `peaks`: fetches the file and computes them with Web Audio at the first play (same-origin or CORS). */\n computePeaks?: boolean;\n /** How many bars. Default 48. */\n bars?: number;\n /** The speeds of the speed button. Default `[1, 1.5, 2]`; `[]` hides it. */\n playbackRates?: readonly number[];\n /** Pauses when it leaves the screen. Default `true`. */\n pauseWhenHidden?: boolean;\n /** The length, in seconds, before the metadata is loaded (from the server). */\n duration?: number;\n /** Called when playback starts, pauses, ends. */\n onPlayingChange?: (playing: boolean) => void;\n /** The words, passed translated; English by default. */\n labels?: Partial<AudioPlayerLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** The peaks of a sound file, computed with Web Audio (`count` of them). */\nexport async function computeAudioPeaks(src: string, count = 200, signal?: AbortSignal): Promise<number[]> {\n const response = await fetch(src, { signal });\n const data = await response.arrayBuffer();\n const Context = window.AudioContext ?? (window as unknown as { webkitAudioContext: typeof AudioContext }).webkitAudioContext;\n const context = new Context();\n try {\n const buffer = await context.decodeAudioData(data);\n const channel = buffer.getChannelData(0);\n const size = Math.max(1, Math.floor(channel.length / count));\n return Array.from({ length: count }, (_, i) => {\n let peak = 0;\n for (let j = i * size; j < Math.min(channel.length, (i + 1) * size); j += 1) peak = Math.max(peak, Math.abs(channel[j]!));\n return peak;\n });\n } finally {\n void context.close();\n }\n}\n\n/** A sound with a seekable waveform: play / pause, time, speed — a voice note, a podcast clip, a track. */\nexport function AudioPlayer({\n src,\n title,\n peaks: given,\n computePeaks,\n bars = 48,\n playbackRates = [1, 1.5, 2],\n pauseWhenHidden = true,\n duration: knownDuration = 0,\n onPlayingChange,\n labels: words,\n className,\n}: AudioPlayerProps) {\n const labels = { ...audioPlayerLabels, ...words };\n const s = audioPlayer();\n const audio = React.useRef<HTMLAudioElement>(null);\n const root = React.useRef<HTMLDivElement>(null);\n const wave = React.useRef<HTMLDivElement>(null);\n const dragging = React.useRef(false);\n const [playing, setPlaying] = React.useState(false);\n const [time, setTime] = React.useState(0);\n const [duration, setDuration] = React.useState(knownDuration);\n const [rate, setRate] = React.useState(playbackRates[0] ?? 1);\n const [computed, setComputed] = React.useState<number[] | null>(null);\n const [wantPeaks, setWantPeaks] = React.useState(false);\n\n React.useEffect(() => {\n if (given || !computePeaks || !wantPeaks) return;\n const controller = new AbortController();\n computeAudioPeaks(src, 200, controller.signal).then(setComputed, () => undefined);\n return () => controller.abort();\n }, [given, computePeaks, wantPeaks, src]);\n\n useInView(root, (visible) => !visible && audio.current && !audio.current.paused && audio.current.pause(), pauseWhenHidden);\n\n const shape = React.useMemo(() => resamplePeaks(given ?? computed ?? [], bars), [given, computed, bars]);\n const progress = duration > 0 ? time / duration : 0;\n\n const seek = (to: number) => {\n if (!audio.current) return;\n const next = clamp(to, 0, duration || audio.current.duration || 0);\n audio.current.currentTime = next;\n setTime(next);\n };\n const at = (clientX: number) => {\n const box = wave.current?.getBoundingClientRect();\n return box && box.width ? ((clientX - box.left) / box.width) * duration : 0;\n };\n const toggle = () => {\n setWantPeaks(true);\n if (!audio.current) return;\n if (audio.current.paused) playSafely(audio.current);\n else audio.current.pause();\n };\n\n return (\n <div ref={root} role=\"group\" aria-label={title} className={s.root({ className })}>\n <audio\n ref={audio}\n src={src}\n preload=\"metadata\"\n onPlay={() => {\n setPlaying(true);\n onPlayingChange?.(true);\n }}\n onPause={() => {\n setPlaying(false);\n onPlayingChange?.(false);\n }}\n onTimeUpdate={(event) => setTime(event.currentTarget.currentTime)}\n onDurationChange={(event) => Number.isFinite(event.currentTarget.duration) && setDuration(event.currentTarget.duration)}\n />\n <button type=\"button\" className={s.play()} aria-label={playing ? labels.pause : labels.play} onClick={toggle}>\n {playing ? <PauseGlyph className=\"h-5 w-5\" /> : <PlayGlyph className=\"ml-0.5 h-5 w-5\" />}\n </button>\n <div className={s.body()}>\n <p className={s.title()} aria-hidden>\n {title}\n </p>\n <div\n ref={wave}\n role=\"slider\"\n tabIndex={0}\n aria-label={labels.seek}\n aria-valuemin={0}\n aria-valuemax={Math.round(duration)}\n aria-valuenow={Math.round(time)}\n aria-valuetext={labels.time(formatClock(time), formatClock(duration))}\n className={s.wave()}\n onPointerDown={(event) => {\n dragging.current = true;\n wave.current?.setPointerCapture?.(event.pointerId);\n seek(at(event.clientX));\n }}\n onPointerMove={(event) => dragging.current && seek(at(event.clientX))}\n onPointerUp={() => {\n dragging.current = false;\n }}\n onKeyDown={(event) => {\n const moves: Record<string, number> = {\n ArrowLeft: time - 5,\n ArrowDown: time - 5,\n ArrowRight: time + 5,\n ArrowUp: time + 5,\n PageDown: time - 30,\n PageUp: time + 30,\n Home: 0,\n End: duration,\n };\n const to = moves[event.key];\n if (to === undefined) return;\n event.preventDefault();\n seek(to);\n }}\n >\n {shape.map((peak, i) => (\n <span key={i} aria-hidden data-played={(i + 0.5) / bars <= progress ? \"\" : undefined} className={s.bar()} style={{ height: `${Math.round(peak * 100)}%` }} />\n ))}\n </div>\n <div className={s.meta()} aria-hidden>\n <span>{formatClock(time)}</span>\n <span>{formatClock(duration)}</span>\n </div>\n </div>\n {playbackRates.length > 1 && (\n <button\n type=\"button\"\n className={s.speed()}\n aria-label={labels.speed(rate)}\n onClick={() => {\n const next = playbackRates[(playbackRates.indexOf(rate) + 1) % playbackRates.length] ?? 1;\n if (audio.current) audio.current.playbackRate = next;\n setRate(next);\n }}\n >\n {rate}×\n </button>\n )}\n </div>\n );\n}\n"
183
- },
184
- {
185
- "path": "audio-player/index.ts",
186
- "content": "/** @krizaka/ui/audio-player — `AudioPlayer` (a seekable waveform, speed, pause off screen), `resamplePeaks`, `computeAudioPeaks`, `audioPlayer` (the slots). Client (\"use client\"). */\nexport { AudioPlayer, audioPlayer, type AudioPlayerLabels, audioPlayerLabels, type AudioPlayerProps, computeAudioPeaks, resamplePeaks } from \"./audio-player\";\n"
187
- },
188
- {
189
- "path": "audio-player/meta.ts",
190
- "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Audio player\",\n summary: \"A sound with a waveform you seek on — the peaks given by the server or computed once with Web Audio — play, time and speed, paused when it leaves the screen.\",\n status: \"beta\",\n category: \"media\",\n domain: \"media\",\n platforms: \"web\",\n parity: { native: { status: \"gap\", issue: \"krizaka/krizaka-ui#278\", reason: \"Needs an Expo audio module as an optional peer; voice notes will need it.\" }, desktop: \"web\" },\n whenToUse: [\n \"For a voice note, a podcast extract, a generated voice, a music preview.\",\n \"When the shape of the sound helps to find a moment (speech and silences).\",\n ],\n whenNotToUse: [\n { when: \"For a sound with a picture: the video player.\", use: \"video-player\" },\n { when: \"To show a value along a bar without a sound: a progress bar.\", use: \"progress\" },\n ],\n bestPractices: [\n \"Compute the peaks on the server once (`peaks`); `computePeaks` downloads and decodes the whole file in the browser.\",\n \"Give `duration` when you know it: the time shows before the metadata arrives.\",\n \"Name the player by its content (“Voice note from Eric, 0:42”).\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Arrow keys\", action: \"Back or forward 5 seconds on the waveform.\" },\n { keys: \"Page Up / Page Down\", action: \"Back or forward 30 seconds.\" },\n { keys: \"Home / End\", action: \"The start or the end.\" },\n ],\n notes: [\n \"A `group` named by `title`; the waveform is a `slider` whose value is read as a time (“0:42 of 3:10”).\",\n \"The play button says its state (“Pause” while playing); the speed button its speed.\",\n \"The bars are decorative; only the colour of the played part changes, nothing moves.\",\n ],\n },\n related: [\"video-player\", \"slider\", \"progress\"],\n web: {\n imports: [\"AudioPlayer\", \"resamplePeaks\", \"computeAudioPeaks\"],\n examples: [\n { name: \"voice-note\", title: \"Voice note\", description: \"Peaks from the server, a short note.\" },\n { name: \"podcast\", title: \"Podcast extract\", description: \"More bars and four speeds.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
191
- },
192
- {
193
- "path": "glyphs.tsx",
194
- "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"
195
- },
196
- {
197
- "path": "media.ts",
198
- "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"
199
- },
200
- {
201
- "path": "meta.ts",
202
- "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 | \"price-catalogue-editor\"\n | \"promo-code-field\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"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 | \"proposal\"\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 | \"shop-gallery\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"schema-form\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the 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 * `experimental`: created for a filed need (ADR-008 §4), it may change or go in any minor until its first consumer imports it; `adoption`\n * names that consumer's issue. `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"experimental\" | \"stable\" | \"beta\" | \"deprecated\";\n\n/**\n * What a component is for (ADR-008 §3): the twelve domains the documentation, the size budgets and the guards are\n * organised by. The domain is metadata: the entries stay flat (`@krizaka/ui/<name>`). `cahier` is the sites' register\n * (ADR-004): a product never imports it.\n */\nexport type Domain =\n | \"foundations\"\n | \"forms\"\n | \"data-display\"\n | \"navigation-shell\"\n | \"feedback\"\n | \"maps\"\n | \"media\"\n | \"commerce\"\n | \"identity\"\n | \"conversation\"\n | \"page-blocks\"\n | \"cahier\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** What it is for: one of the twelve domains (ADR-008 §3). */\n readonly domain: Domain;\n /** The `<repo>#<n>` issue of its first consumer: required for, and only for, an `experimental` component. */\n readonly adoption?: string;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
203
- }
204
- ],
205
- "dependencies": [
206
- "tailwind-variants@^3.3.1"
207
- ],
208
- "registryDependencies": [
209
- "waveform"
210
- ],
211
- "demo": {
212
- "path": "examples/audio-player/voice-note.tsx",
213
- "content": "import { AudioPlayer } from \"@krizaka/ui/audio-player\";\n\n// Peaks computed once on the server: 64 values between 0 and 1.\nconst PEAKS = Array.from({ length: 64 }, (_, i) => 0.2 + Math.abs(Math.sin(i * 0.45) * Math.cos(i * 0.13)) * 0.8);\n\nexport default function AudioPlayerVoiceNote() {\n return (\n <div className=\"w-full max-w-md\">\n <AudioPlayer title=\"The world of Krizaka, narrated\" src=\"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16-en.a78c24ce48.mp4\" peaks={PEAKS} duration={42} />\n </div>\n );\n}\n"
214
- },
215
- "props": [
216
- {
217
- "component": "AudioPlayer",
218
- "description": "A sound with a seekable waveform: play / pause, time, speed — a voice note, a podcast clip, a track.",
219
- "props": [
220
- {
221
- "name": "src",
222
- "type": "string",
223
- "default": null,
224
- "description": "The address of the sound.",
225
- "required": true
226
- },
227
- {
228
- "name": "title",
229
- "type": "string",
230
- "default": null,
231
- "description": "What it is (\"Voice note — Eric, 0:42\"): shown, and the accessible name of the player.",
232
- "required": true
233
- },
234
- {
235
- "name": "bars",
236
- "type": "number",
237
- "default": "48",
238
- "description": "How many bars. Default 48.",
239
- "required": false
240
- },
241
- {
242
- "name": "className",
243
- "type": "string",
244
- "default": null,
245
- "description": "Classes merged on the root.",
246
- "required": false
247
- },
248
- {
249
- "name": "computePeaks",
250
- "type": "boolean",
251
- "default": null,
252
- "description": "Without `peaks`: fetches the file and computes them with Web Audio at the first play (same-origin or CORS).",
253
- "required": false
254
- },
255
- {
256
- "name": "duration",
257
- "type": "number",
258
- "default": "0",
259
- "description": "The length, in seconds, before the metadata is loaded (from the server).",
260
- "required": false
261
- },
262
- {
263
- "name": "labels",
264
- "type": "Partial<AudioPlayerLabels>",
265
- "default": null,
266
- "description": "The words, passed translated; English by default.",
267
- "required": false
268
- },
269
- {
270
- "name": "onPlayingChange",
271
- "type": "((playing: boolean) => void)",
272
- "default": null,
273
- "description": "Called when playback starts, pauses, ends.",
274
- "required": false
275
- },
276
- {
277
- "name": "pauseWhenHidden",
278
- "type": "boolean",
279
- "default": "true",
280
- "description": "Pauses when it leaves the screen. Default `true`.",
281
- "required": false
282
- },
283
- {
284
- "name": "peaks",
285
- "type": "readonly number[]",
286
- "default": null,
287
- "description": "The peaks, between 0 and 1, as many as you like (they are resampled to `bars`).",
288
- "required": false
289
- },
290
- {
291
- "name": "playbackRates",
292
- "type": "readonly number[]",
293
- "default": "[1, 1.5, 2]",
294
- "description": "The speeds of the speed button. Default `[1, 1.5, 2]`; `[]` hides it.",
295
- "required": false
296
- }
297
- ]
298
- }
299
- ]
300
- }
@@ -1,4 +0,0 @@
1
- import type { ComponentType } from "react";
2
- /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
- declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
- export default Example;
@@ -1,22 +0,0 @@
1
- "use client";
2
-
3
- // registry/examples/audio-player/podcast.tsx
4
- import { AudioPlayer } from "@krizaka/ui/audio-player";
5
- import { jsx } from "react/jsx-runtime";
6
- var PEAKS = Array.from({ length: 200 }, (_, i) => i % 37 < 3 ? 0.05 : 0.3 + Math.abs(Math.sin(i * 0.31)) * 0.7);
7
- function AudioPlayerPodcast() {
8
- return /* @__PURE__ */ jsx("div", { className: "w-full max-w-lg", children: /* @__PURE__ */ jsx(
9
- AudioPlayer,
10
- {
11
- title: "Creators' hour \u2014 episode 12, extract",
12
- src: "https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-16x9-en.9391096007.mp4",
13
- peaks: PEAKS,
14
- bars: 72,
15
- duration: 190,
16
- playbackRates: [1, 1.25, 1.5, 2]
17
- }
18
- ) });
19
- }
20
- export {
21
- AudioPlayerPodcast as default
22
- };
@@ -1,19 +0,0 @@
1
- import { AudioPlayer } from "@krizaka/ui/audio-player";
2
-
3
- const PEAKS = Array.from({ length: 200 }, (_, i) => (i % 37 < 3 ? 0.05 : 0.3 + Math.abs(Math.sin(i * 0.31)) * 0.7));
4
-
5
- // A longer extract: more bars, four speeds, the time before the metadata arrives.
6
- export default function AudioPlayerPodcast() {
7
- return (
8
- <div className="w-full max-w-lg">
9
- <AudioPlayer
10
- title="Creators' hour — episode 12, extract"
11
- src="https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-16x9-en.9391096007.mp4"
12
- peaks={PEAKS}
13
- bars={72}
14
- duration={190}
15
- playbackRates={[1, 1.25, 1.5, 2]}
16
- />
17
- </div>
18
- );
19
- }
@@ -1,4 +0,0 @@
1
- import type { ComponentType } from "react";
2
- /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
- declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
- export default Example;
@@ -1,12 +0,0 @@
1
- "use client";
2
-
3
- // registry/examples/audio-player/voice-note.tsx
4
- import { AudioPlayer } from "@krizaka/ui/audio-player";
5
- import { jsx } from "react/jsx-runtime";
6
- var PEAKS = Array.from({ length: 64 }, (_, i) => 0.2 + Math.abs(Math.sin(i * 0.45) * Math.cos(i * 0.13)) * 0.8);
7
- function AudioPlayerVoiceNote() {
8
- return /* @__PURE__ */ jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsx(AudioPlayer, { title: "The world of Krizaka, narrated", src: "https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16-en.a78c24ce48.mp4", peaks: PEAKS, duration: 42 }) });
9
- }
10
- export {
11
- AudioPlayerVoiceNote as default
12
- };
@@ -1,12 +0,0 @@
1
- import { AudioPlayer } from "@krizaka/ui/audio-player";
2
-
3
- // Peaks computed once on the server: 64 values between 0 and 1.
4
- const PEAKS = Array.from({ length: 64 }, (_, i) => 0.2 + Math.abs(Math.sin(i * 0.45) * Math.cos(i * 0.13)) * 0.8);
5
-
6
- export default function AudioPlayerVoiceNote() {
7
- return (
8
- <div className="w-full max-w-md">
9
- <AudioPlayer title="The world of Krizaka, narrated" src="https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16-en.a78c24ce48.mp4" peaks={PEAKS} duration={42} />
10
- </div>
11
- );
12
- }
@@ -1,4 +0,0 @@
1
- import type { ComponentType } from "react";
2
- /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
- declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
- export default Example;
@@ -1,30 +0,0 @@
1
- "use client";
2
-
3
- // registry/examples/how-it-works-page/orazaka.tsx
4
- import { CodeBlock } from "@krizaka/ui/code-block";
5
- import { HowItWorksPage } from "@krizaka/ui/how-it-works-page";
6
- import { Mascot } from "@krizaka/ui/mascots";
7
- import { jsx } from "react/jsx-runtime";
8
- var copy = { copyLabel: "Copy", copiedLabel: "Copied" };
9
- function HowItWorksPageOrazaka() {
10
- return /* @__PURE__ */ jsx(
11
- HowItWorksPage,
12
- {
13
- brand: "orazaka",
14
- back: { href: "#orazaka", label: "Orazaka" },
15
- eyebrow: "How it works",
16
- title: "The journey of a request",
17
- lead: "Six stages, the same for every request \u2014 and none of them leaves your server.",
18
- aside: /* @__PURE__ */ jsx(Mascot, { bird: "duck", mood: "thinking", size: 112 }),
19
- stepsLabel: "The steps",
20
- steps: [
21
- { id: "install", title: "Install", text: "One command pulls the engine, the models you choose and the console.", visual: /* @__PURE__ */ jsx(CodeBlock, { code: "npx orazaka install", language: "bash", file: "Terminal", ...copy }) },
22
- { id: "guard", title: "Guard", text: "Every request crosses the same interceptors: identity, quotas, the rules of your workspace.", visual: /* @__PURE__ */ jsx(CodeBlock, { code: "orazaka rules add --deny pii-export", language: "bash", file: "Terminal", ...copy }) },
23
- { id: "answer", title: "Answer", text: "The best local model answers; the answer is checked before it is shown.", visual: /* @__PURE__ */ jsx(CodeBlock, { code: "orazaka chat --model llama3.3", language: "bash", file: "Terminal", ...copy }) }
24
- ]
25
- }
26
- );
27
- }
28
- export {
29
- HowItWorksPageOrazaka as default
30
- };
@@ -1,26 +0,0 @@
1
- import { CodeBlock } from "@krizaka/ui/code-block";
2
- import { HowItWorksPage } from "@krizaka/ui/how-it-works-page";
3
- import { Mascot } from "@krizaka/ui/mascots";
4
-
5
- const copy = { copyLabel: "Copy", copiedLabel: "Copied" };
6
-
7
- // TEMPLATE — how a product works, in steps along a line (Orazaka's journey of a request): each step its words beside
8
- // its visual, the sides alternating on a wide screen, one column on a phone.
9
- export default function HowItWorksPageOrazaka() {
10
- return (
11
- <HowItWorksPage
12
- brand="orazaka"
13
- back={{ href: "#orazaka", label: "Orazaka" }}
14
- eyebrow="How it works"
15
- title="The journey of a request"
16
- lead="Six stages, the same for every request — and none of them leaves your server."
17
- aside={<Mascot bird="duck" mood="thinking" size={112} />}
18
- stepsLabel="The steps"
19
- steps={[
20
- { id: "install", title: "Install", text: "One command pulls the engine, the models you choose and the console.", visual: <CodeBlock code="npx orazaka install" language="bash" file="Terminal" {...copy} /> },
21
- { id: "guard", title: "Guard", text: "Every request crosses the same interceptors: identity, quotas, the rules of your workspace.", visual: <CodeBlock code="orazaka rules add --deny pii-export" language="bash" file="Terminal" {...copy} /> },
22
- { id: "answer", title: "Answer", text: "The best local model answers; the answer is checked before it is shown.", visual: <CodeBlock code="orazaka chat --model llama3.3" language="bash" file="Terminal" {...copy} /> },
23
- ]}
24
- />
25
- );
26
- }
@@ -1,4 +0,0 @@
1
- import type { ComponentType } from "react";
2
- /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
- declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
- export default Example;
@@ -1,22 +0,0 @@
1
- "use client";
2
-
3
- // registry/examples/iso/compose.tsx
4
- import { IsoDome, IsoLink, IsoNode, IsoPrism, IsoScene, IsoTile } from "@krizaka/ui/iso";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- function IsoCompose() {
7
- return /* @__PURE__ */ jsxs(IsoScene, { label: "A model served from one node", className: "w-full max-w-md", extent: 230, top: 190, viewBox: "-260 -250 520 360", children: [
8
- /* @__PURE__ */ jsx(IsoLink, { from: [-40, -190], to: [-40, -60], label: "Prompt" }),
9
- /* @__PURE__ */ jsx(IsoLink, { from: [60, 0], to: [190, 0], direction: "out", label: "Answer" }),
10
- /* @__PURE__ */ jsx(IsoDome, { radius: 110, part: "rim" }),
11
- /* @__PURE__ */ jsx(IsoTile, { at: [-40, -190], z: 70, glyph: "dots", label: "Chat", index: 0 }),
12
- /* @__PURE__ */ jsx(IsoPrism, { shape: "hex", size: 170, height: 12, index: 1 }),
13
- /* @__PURE__ */ jsx(IsoPrism, { size: 92, z: 16, height: 34, strip: true, label: "Model", index: 2 }),
14
- /* @__PURE__ */ jsx(IsoPrism, { shape: "hex", size: 44, z: 54, height: 14, material: "accent", index: 3 }),
15
- /* @__PURE__ */ jsx(IsoNode, { z: 78, index: 4 }),
16
- /* @__PURE__ */ jsx(IsoDome, { radius: 110, height: 170, part: "arc" }),
17
- /* @__PURE__ */ jsx(IsoTile, { at: [190, 0], z: 56, glyph: "lines", material: "glass", label: "Document", index: 5 })
18
- ] });
19
- }
20
- export {
21
- IsoCompose as default
22
- };
@@ -1,19 +0,0 @@
1
- import { IsoDome, IsoLink, IsoNode, IsoPrism, IsoScene, IsoTile } from "@krizaka/ui/iso";
2
-
3
- // The primitives, composed by hand: painted back to front, each object rising in turn (`index`).
4
- export default function IsoCompose() {
5
- return (
6
- <IsoScene label="A model served from one node" className="w-full max-w-md" extent={230} top={190} viewBox="-260 -250 520 360">
7
- <IsoLink from={[-40, -190]} to={[-40, -60]} label="Prompt" />
8
- <IsoLink from={[60, 0]} to={[190, 0]} direction="out" label="Answer" />
9
- <IsoDome radius={110} part="rim" />
10
- <IsoTile at={[-40, -190]} z={70} glyph="dots" label="Chat" index={0} />
11
- <IsoPrism shape="hex" size={170} height={12} index={1} />
12
- <IsoPrism size={92} z={16} height={34} strip label="Model" index={2} />
13
- <IsoPrism shape="hex" size={44} z={54} height={14} material="accent" index={3} />
14
- <IsoNode z={78} index={4} />
15
- <IsoDome radius={110} height={170} part="arc" />
16
- <IsoTile at={[190, 0]} z={56} glyph="lines" material="glass" label="Document" index={5} />
17
- </IsoScene>
18
- );
19
- }
@@ -1,4 +0,0 @@
1
- import type { ComponentType } from "react";
2
- /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
- declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
- export default Example;
@@ -1,29 +0,0 @@
1
- "use client";
2
-
3
- // registry/examples/iso/creator-hero.tsx
4
- import { IsoHub } from "@krizaka/ui/iso";
5
- import { jsx } from "react/jsx-runtime";
6
- function IsoCreatorHero() {
7
- return /* @__PURE__ */ jsx(
8
- IsoHub,
9
- {
10
- label: "Every support flows to the creator",
11
- description: "A creator at the centre receives tips, unlocks, auction bids and challenge pledges; 90 % of each goes to them.",
12
- className: "w-full max-w-xl",
13
- shape: "hex",
14
- size: 110,
15
- layers: [{ label: "Community", height: 16 }, { label: "Creator", height: 44, material: "accent2" }],
16
- core: "Payouts",
17
- highlight: { strong: "90 %", text: "to the creator" },
18
- satellites: [
19
- { label: "Tips", glyph: "coin", value: "+ \u20AC5" },
20
- { label: "Unlocks", glyph: "lock", value: "+ \u20AC3" },
21
- { label: "Auctions", glyph: "arrow", value: "\u20AC120" },
22
- { label: "Challenges", glyph: "flag", value: "\u20AC40" }
23
- ]
24
- }
25
- );
26
- }
27
- export {
28
- IsoCreatorHero as default
29
- };