@krizaka/ui 3.62.0 → 3.63.1

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 (635) hide show
  1. package/README.md +13 -16
  2. package/dist/account-menu.d.ts +1 -1
  3. package/dist/account-menu.js +1 -1
  4. package/dist/account-settings.d.ts +1 -1
  5. package/dist/account-settings.js +2 -2
  6. package/dist/achievement.d.ts +2 -2
  7. package/dist/achievement.js +1 -1
  8. package/dist/achievement.js.map +1 -1
  9. package/dist/action-bar.js +4 -4
  10. package/dist/activity-feed.d.ts +1 -1
  11. package/dist/activity-feed.js.map +1 -1
  12. package/dist/analysis-report.d.ts +274 -0
  13. package/dist/analysis-report.js +207 -0
  14. package/dist/analysis-report.js.map +1 -0
  15. package/dist/app-shell.js.map +1 -1
  16. package/dist/argument-card.d.ts +1 -1
  17. package/dist/argument-card.js +5 -5
  18. package/dist/auth-layout.d.ts +1 -1
  19. package/dist/auth-layout.js.map +1 -1
  20. package/dist/avatar/defaults.d.ts +2 -1
  21. package/dist/avatar/defaults.js.map +1 -1
  22. package/dist/{avatar-iajODANU.d.ts → avatar-BL2iG_Js.d.ts} +2 -1
  23. package/dist/avatar.d.ts +3 -2
  24. package/dist/avatar.js.map +1 -1
  25. package/dist/badge.js +4 -34
  26. package/dist/badge.js.map +1 -1
  27. package/dist/bird-plate.d.ts +1 -1
  28. package/dist/bird-plate.js +1 -1
  29. package/dist/blocks.css +99 -8
  30. package/dist/button.js +1 -1
  31. package/dist/captcha.js +1 -1
  32. package/dist/chat.js +1 -1
  33. package/dist/choice-grid.d.ts +1 -1
  34. package/dist/choice-grid.js +1 -1
  35. package/dist/choice-grid.js.map +1 -1
  36. package/dist/chunk-5PFCELGW.js +41 -0
  37. package/dist/chunk-5PFCELGW.js.map +1 -0
  38. package/dist/chunk-5RWHDX5J.js +37 -0
  39. package/dist/chunk-5RWHDX5J.js.map +1 -0
  40. package/dist/{chunk-KB7OLYIJ.js → chunk-7AZ23BUX.js} +1 -1
  41. package/dist/chunk-7AZ23BUX.js.map +1 -0
  42. package/dist/{chunk-4E5IUZHR.js → chunk-B2HS5EAH.js} +1 -1
  43. package/dist/chunk-B2HS5EAH.js.map +1 -0
  44. package/dist/{chunk-5LANVCK7.js → chunk-BG5APGX6.js} +2 -2
  45. package/dist/{chunk-WOZP3JLW.js → chunk-DJ5ZPPWL.js} +1 -1
  46. package/dist/chunk-DJ5ZPPWL.js.map +1 -0
  47. package/dist/{chunk-MHUUNC5W.js → chunk-DRTIE44Z.js} +1 -1
  48. package/dist/chunk-DRTIE44Z.js.map +1 -0
  49. package/dist/{chunk-UV4HBVH7.js → chunk-EB45EVPJ.js} +2 -2
  50. package/dist/{chunk-SJS6RJIT.js.map → chunk-EB45EVPJ.js.map} +1 -1
  51. package/dist/{chunk-555LWYIN.js → chunk-EHTXLZSM.js} +1 -1
  52. package/dist/{chunk-555LWYIN.js.map → chunk-EHTXLZSM.js.map} +1 -1
  53. package/dist/{chunk-6EAHUURY.js → chunk-GHAN7OOE.js} +2 -2
  54. package/dist/chunk-JT7ZKZT5.js +1 -0
  55. package/dist/chunk-JT7ZKZT5.js.map +1 -0
  56. package/dist/{chunk-3DHNN5V7.js → chunk-M3GEYLMR.js} +2 -2
  57. package/dist/{chunk-3DHNN5V7.js.map → chunk-M3GEYLMR.js.map} +1 -1
  58. package/dist/{chunk-7J2L4HOD.js → chunk-MTVX4RRF.js} +2 -2
  59. package/dist/{chunk-7J2L4HOD.js.map → chunk-MTVX4RRF.js.map} +1 -1
  60. package/dist/{chunk-YKEIOYJ5.js → chunk-NPMGYLJV.js} +1 -1
  61. package/dist/chunk-NPMGYLJV.js.map +1 -0
  62. package/dist/{chunk-3RVFD3UX.js → chunk-PW2FVPTV.js} +1 -1
  63. package/dist/chunk-PW2FVPTV.js.map +1 -0
  64. package/dist/{chunk-HEKDKM5Y.js → chunk-QVHSV6RA.js} +1 -1
  65. package/dist/{chunk-MIMOTE4W.js → chunk-RCHKIOVV.js} +1 -1
  66. package/dist/chunk-RCHKIOVV.js.map +1 -0
  67. package/dist/{chunk-7JG3VR4C.js → chunk-RCKXJEDQ.js} +5 -5
  68. package/dist/{chunk-XVFQZ3ZG.js → chunk-TPITVAUW.js} +1 -1
  69. package/dist/{chunk-XVFQZ3ZG.js.map → chunk-TPITVAUW.js.map} +1 -1
  70. package/dist/chunk-U4XTZMB7.js +103 -0
  71. package/dist/chunk-U4XTZMB7.js.map +1 -0
  72. package/dist/{chunk-SJS6RJIT.js → chunk-V7W4RLRW.js} +2 -2
  73. package/dist/{chunk-UV4HBVH7.js.map → chunk-V7W4RLRW.js.map} +1 -1
  74. package/dist/{chunk-RBETQO2P.js → chunk-Y5YBTHVD.js} +9 -15
  75. package/dist/chunk-Y5YBTHVD.js.map +1 -0
  76. package/dist/command.js +2 -2
  77. package/dist/confirm-button.js +1 -1
  78. package/dist/continue-prompt.js +2 -2
  79. package/dist/continue-prompt.js.map +1 -1
  80. package/dist/cover-hero.js +1 -1
  81. package/dist/dashboard-layout.js.map +1 -1
  82. package/dist/data-table.js +2 -2
  83. package/dist/detail-layout.js.map +1 -1
  84. package/dist/dialog.js +2 -2
  85. package/dist/elephant.js.map +1 -1
  86. package/dist/embed-facade.d.ts +37 -0
  87. package/dist/embed-facade.js +96 -0
  88. package/dist/embed-facade.js.map +1 -0
  89. package/dist/engine-flow.d.ts +4 -4
  90. package/dist/engine-flow.js.map +1 -1
  91. package/dist/environment-notice.d.ts +110 -0
  92. package/dist/environment-notice.js +47 -0
  93. package/dist/environment-notice.js.map +1 -0
  94. package/dist/file-upload.d.ts +2 -2
  95. package/dist/flock.js +1 -1
  96. package/dist/force-update-screen.js +1 -1
  97. package/dist/genui.js +2 -2
  98. package/dist/{geometry-DZ4Q3hDQ.d.ts → geometry-DDlFDtiQ.d.ts} +3 -4
  99. package/dist/{geometry-DncHaYP8.d.ts → geometry-DuUQyHZ1.d.ts} +3 -4
  100. package/dist/goal-gauge.d.ts +1 -1
  101. package/dist/goal-gauge.js +1 -1
  102. package/dist/goal-gauge.js.map +1 -1
  103. package/dist/index.d.ts +15 -1
  104. package/dist/index.js +1 -1
  105. package/dist/kind-config-editor.js +1 -1
  106. package/dist/landing-page.d.ts +1 -1
  107. package/dist/landing-page.js.map +1 -1
  108. package/dist/language-switch.d.ts +9 -9
  109. package/dist/link-card.js +2 -2
  110. package/dist/loader.d.ts +1 -1
  111. package/dist/loader.js.map +1 -1
  112. package/dist/maintenance-screen.js +1 -1
  113. package/dist/map.js +6 -0
  114. package/dist/map.js.map +1 -1
  115. package/dist/margin-layout.d.ts +71 -0
  116. package/dist/margin-layout.js +29 -0
  117. package/dist/margin-layout.js.map +1 -0
  118. package/dist/mascot-quote.d.ts +1 -1
  119. package/dist/mascot-quote.js +1 -1
  120. package/dist/mascot-state.js +1 -1
  121. package/dist/mascots.d.ts +2 -2
  122. package/dist/mascots.js +1 -1
  123. package/dist/match-dialog.js +2 -2
  124. package/dist/media-grid.d.ts +1 -0
  125. package/dist/media-grid.js +2 -2
  126. package/dist/meter.js +2 -1
  127. package/dist/native/map.js +6 -0
  128. package/dist/native/map.js.map +1 -1
  129. package/dist/native.d.ts +125 -10
  130. package/dist/native.js +1690 -1517
  131. package/dist/native.js.map +1 -1
  132. package/dist/nav-bar.d.ts +1 -1
  133. package/dist/nav-bar.js +3 -3
  134. package/dist/page-DPHDmDAQ.d.ts +131 -0
  135. package/dist/page-hero.js +4 -4
  136. package/dist/page.d.ts +7 -125
  137. package/dist/page.js +13 -1
  138. package/dist/page.js.map +1 -1
  139. package/dist/product-page.d.ts +1 -1
  140. package/dist/product-page.js.map +1 -1
  141. package/dist/profile-card.d.ts +1 -1
  142. package/dist/profile-card.js +1 -1
  143. package/dist/profile-card.js.map +1 -1
  144. package/dist/promise-card.js +1 -1
  145. package/dist/quota-meter.js +2 -1
  146. package/dist/quota-meter.js.map +1 -1
  147. package/dist/rail-nav.d.ts +4 -0
  148. package/dist/retro-tv.d.ts +6 -3
  149. package/dist/retro-tv.js +6 -5
  150. package/dist/retro-tv.js.map +1 -1
  151. package/dist/reviews.d.ts +49 -0
  152. package/dist/reviews.js +66 -0
  153. package/dist/reviews.js.map +1 -0
  154. package/dist/scroll-stage.d.ts +1 -1
  155. package/dist/scroll-stage.js +1 -1
  156. package/dist/scroll-stage.js.map +1 -1
  157. package/dist/separator.d.ts +26 -3
  158. package/dist/separator.js +19 -1
  159. package/dist/separator.js.map +1 -1
  160. package/dist/service-card.d.ts +56 -63
  161. package/dist/service-card.js +49 -10
  162. package/dist/service-card.js.map +1 -1
  163. package/dist/settings-layout.js +1 -1
  164. package/dist/site-cahier.d.ts +10 -2
  165. package/dist/site-cahier.js +9 -15
  166. package/dist/site-cahier.js.map +1 -1
  167. package/dist/site-footer.d.ts +1 -1
  168. package/dist/site-footer.js +2 -2
  169. package/dist/{sites-BKz1beUK.d.ts → sites-CEnywB89.d.ts} +10 -2
  170. package/dist/sites.d.ts +13 -5
  171. package/dist/sites.js +7 -13
  172. package/dist/sites.js.map +1 -1
  173. package/dist/specimen-tag.d.ts +15 -3
  174. package/dist/specimen-tag.js +4 -27
  175. package/dist/specimen-tag.js.map +1 -1
  176. package/dist/stage-banner.d.ts +1 -1
  177. package/dist/stage-banner.js +1 -1
  178. package/dist/stage-banner.js.map +1 -1
  179. package/dist/stat.d.ts +87 -5
  180. package/dist/stat.js +9 -53
  181. package/dist/stat.js.map +1 -1
  182. package/dist/status-page.d.ts +1 -1
  183. package/dist/status-page.js.map +1 -1
  184. package/dist/sticky-action.d.ts +7 -2
  185. package/dist/sticky-action.js +24 -3
  186. package/dist/sticky-action.js.map +1 -1
  187. package/dist/theme.js +1 -1
  188. package/dist/update-prompt.js +1 -1
  189. package/dist/usage.d.ts +229 -0
  190. package/dist/usage.js +189 -0
  191. package/dist/usage.js.map +1 -0
  192. package/dist/versus-card.js +1 -1
  193. package/dist/vertical-video.js +2 -2
  194. package/dist/wall.d.ts +24 -12
  195. package/dist/wall.js +106 -43
  196. package/dist/wall.js.map +1 -1
  197. package/package.json +108 -17
  198. package/registry/account-menu.json +1 -1
  199. package/registry/account-settings.json +1 -1
  200. package/registry/achievement.json +8 -8
  201. package/registry/action-bar.json +1 -1
  202. package/registry/activity-feed.json +8 -8
  203. package/registry/agenda.json +1 -1
  204. package/registry/alert.json +1 -1
  205. package/registry/analysis-report.json +445 -0
  206. package/registry/anatomy-plate.json +1 -1
  207. package/registry/app-header.json +3 -3
  208. package/registry/app-shell.json +10 -10
  209. package/registry/argument-card.json +3 -3
  210. package/registry/audio-player.json +6 -6
  211. package/registry/auth-layout.json +9 -9
  212. package/registry/avatar.json +8 -8
  213. package/registry/badge.json +1 -1
  214. package/registry/bird-plate.json +1 -1
  215. package/registry/button.json +2 -2
  216. package/registry/captcha.json +1 -1
  217. package/registry/card-grid.json +6 -6
  218. package/registry/card.json +1 -1
  219. package/registry/catalogue-page.json +1 -1
  220. package/registry/changelog-page.json +1 -1
  221. package/registry/chapter.json +1 -1
  222. package/registry/chat.json +3 -3
  223. package/registry/checkbox.json +1 -1
  224. package/registry/chip-link.json +1 -1
  225. package/registry/chip-row.json +1 -1
  226. package/registry/chip.json +1 -1
  227. package/registry/choice-grid.json +6 -6
  228. package/registry/code-block.json +1 -1
  229. package/registry/combobox.json +1 -1
  230. package/registry/command.json +1 -1
  231. package/registry/comparison-table.json +1 -1
  232. package/registry/component-page.json +1 -1
  233. package/registry/confirm-button.json +1 -1
  234. package/registry/contact-page.json +1 -1
  235. package/registry/continue-prompt.json +2 -2
  236. package/registry/countdown.json +1 -1
  237. package/registry/cover-hero.json +1 -1
  238. package/registry/cta-panel.json +1 -1
  239. package/registry/dashboard-layout.json +2 -2
  240. package/registry/data-table.json +1 -1
  241. package/registry/date-picker.json +2 -2
  242. package/registry/decision-list.json +1 -1
  243. package/registry/description-list.json +1 -1
  244. package/registry/detail-layout.json +6 -6
  245. package/registry/dialog.json +1 -1
  246. package/registry/docs-article-page.json +1 -1
  247. package/registry/docs-hub-page.json +3 -3
  248. package/registry/docs-layout.json +1 -1
  249. package/registry/docs-nav.json +1 -1
  250. package/registry/document-viewer.json +1 -1
  251. package/registry/doodle.json +1 -1
  252. package/registry/drop-overlay.json +1 -1
  253. package/registry/dropdown-menu.json +1 -1
  254. package/registry/elephant.json +7 -7
  255. package/registry/embed-facade.json +243 -0
  256. package/registry/empty-state.json +2 -2
  257. package/registry/engine-flow.json +6 -6
  258. package/registry/environment-notice.json +270 -0
  259. package/registry/error-page.json +1 -1
  260. package/registry/examples/achievement/arcade.js +1 -1
  261. package/registry/examples/achievement/arcade.tsx +1 -1
  262. package/registry/examples/activity-feed/job-activity.tsx +1 -1
  263. package/registry/examples/analysis-report/document-validation.js +47 -0
  264. package/registry/examples/analysis-report/document-validation.tsx +29 -0
  265. package/registry/examples/analysis-report/native/document-validation.dark.png +0 -0
  266. package/registry/examples/analysis-report/native/document-validation.js +48 -0
  267. package/registry/examples/analysis-report/native/document-validation.light.png +0 -0
  268. package/registry/examples/analysis-report/native/document-validation.tsx +32 -0
  269. package/registry/examples/analysis-report/streaming.d.ts +4 -0
  270. package/registry/examples/analysis-report/streaming.js +42 -0
  271. package/registry/examples/analysis-report/streaming.tsx +23 -0
  272. package/registry/examples/app-shell/admin-console.js +1 -1
  273. package/registry/examples/app-shell/admin-console.tsx +2 -2
  274. package/registry/examples/app-shell/basic.js +1 -1
  275. package/registry/examples/app-shell/basic.tsx +1 -1
  276. package/registry/examples/app-shell/creator-studio.d.ts +4 -0
  277. package/registry/examples/app-shell/{orochia-studio.js → creator-studio.js} +6 -6
  278. package/registry/examples/app-shell/{orochia-studio.tsx → creator-studio.tsx} +4 -4
  279. package/registry/examples/audio-player/podcast.js +1 -1
  280. package/registry/examples/audio-player/podcast.tsx +1 -1
  281. package/registry/examples/audio-player/voice-note.js +1 -1
  282. package/registry/examples/audio-player/voice-note.tsx +1 -1
  283. package/registry/examples/auth-layout/onboarding.js +3 -3
  284. package/registry/examples/auth-layout/onboarding.tsx +3 -3
  285. package/registry/examples/auth-layout/sign-in.js +3 -3
  286. package/registry/examples/auth-layout/sign-in.tsx +3 -3
  287. package/registry/examples/avatar/default.js +1 -1
  288. package/registry/examples/avatar/default.tsx +1 -1
  289. package/registry/examples/card-grid/aligned.js +2 -2
  290. package/registry/examples/card-grid/aligned.tsx +2 -2
  291. package/registry/examples/card-grid/foundation.js +1 -2
  292. package/registry/examples/card-grid/foundation.tsx +1 -2
  293. package/registry/examples/card-grid/hover-quiet.js +1 -1
  294. package/registry/examples/card-grid/hover-quiet.tsx +1 -1
  295. package/registry/examples/card-grid/products.js +1 -1
  296. package/registry/examples/card-grid/products.tsx +1 -1
  297. package/registry/examples/choice-grid/line-up.js +1 -1
  298. package/registry/examples/choice-grid/line-up.tsx +1 -1
  299. package/registry/examples/detail-layout/checkout.js +1 -1
  300. package/registry/examples/detail-layout/checkout.tsx +2 -2
  301. package/registry/examples/detail-layout/video.js +1 -1
  302. package/registry/examples/detail-layout/video.tsx +2 -2
  303. package/registry/examples/docs-hub-page/krizaka.js +1 -1
  304. package/registry/examples/docs-hub-page/krizaka.tsx +1 -1
  305. package/registry/examples/embed-facade/tiktok.d.ts +4 -0
  306. package/registry/examples/embed-facade/tiktok.js +20 -0
  307. package/registry/examples/embed-facade/tiktok.tsx +16 -0
  308. package/registry/examples/embed-facade/youtube.d.ts +4 -0
  309. package/registry/examples/embed-facade/youtube.js +22 -0
  310. package/registry/examples/embed-facade/youtube.tsx +20 -0
  311. package/registry/examples/empty-state/library.js +1 -1
  312. package/registry/examples/empty-state/library.tsx +1 -1
  313. package/registry/examples/engine-flow/calm.js +1 -1
  314. package/registry/examples/engine-flow/calm.tsx +1 -1
  315. package/registry/examples/engine-flow/compact.js +4 -4
  316. package/registry/examples/engine-flow/compact.tsx +4 -4
  317. package/registry/examples/engine-flow/radial.js +2 -6
  318. package/registry/examples/engine-flow/radial.tsx +1 -5
  319. package/registry/examples/environment-notice/development.d.ts +4 -0
  320. package/registry/examples/environment-notice/development.js +15 -0
  321. package/registry/examples/environment-notice/development.tsx +13 -0
  322. package/registry/examples/environment-notice/native/development.d.ts +4 -0
  323. package/registry/examples/environment-notice/native/development.dark.png +0 -0
  324. package/registry/examples/environment-notice/native/development.js +21 -0
  325. package/registry/examples/environment-notice/native/development.light.png +0 -0
  326. package/registry/examples/environment-notice/native/development.tsx +17 -0
  327. package/registry/examples/environment-notice/staging.d.ts +4 -0
  328. package/registry/examples/environment-notice/staging.js +11 -0
  329. package/registry/examples/environment-notice/staging.tsx +6 -0
  330. package/registry/examples/force-update-screen/default.js +1 -1
  331. package/registry/examples/force-update-screen/default.tsx +1 -1
  332. package/registry/examples/force-update-screen/native/default.dark.png +0 -0
  333. package/registry/examples/force-update-screen/native/default.js +1 -1
  334. package/registry/examples/force-update-screen/native/default.light.png +0 -0
  335. package/registry/examples/force-update-screen/native/default.tsx +1 -1
  336. package/registry/examples/form/native/sign-up.js +2 -2
  337. package/registry/examples/form/native/sign-up.tsx +2 -2
  338. package/registry/examples/form/sign-up.js +1 -1
  339. package/registry/examples/form/sign-up.tsx +3 -3
  340. package/registry/examples/goal-gauge/arcade.js +1 -1
  341. package/registry/examples/goal-gauge/arcade.tsx +1 -1
  342. package/registry/examples/image-cropper/avatar.js +1 -1
  343. package/registry/examples/image-cropper/avatar.tsx +1 -1
  344. package/registry/examples/image-cropper/banner.js +1 -1
  345. package/registry/examples/image-cropper/banner.tsx +1 -1
  346. package/registry/examples/image-cropper/vertical-video.js +1 -2
  347. package/registry/examples/image-cropper/vertical-video.tsx +1 -3
  348. package/registry/examples/iso/creator-hero.d.ts +4 -0
  349. package/registry/examples/iso/{orochia-hero.js → creator-hero.js} +3 -3
  350. package/registry/examples/iso/{orochia-hero.tsx → creator-hero.tsx} +1 -1
  351. package/registry/examples/landing-page/krizaka.js +2 -2
  352. package/registry/examples/landing-page/krizaka.tsx +2 -2
  353. package/registry/examples/link-card/docs-hub.js +1 -1
  354. package/registry/examples/link-card/docs-hub.tsx +1 -1
  355. package/registry/examples/link-card/hover-quiet.js +1 -1
  356. package/registry/examples/link-card/hover-quiet.tsx +1 -1
  357. package/registry/examples/loader/branded.js +2 -2
  358. package/registry/examples/loader/branded.tsx +3 -3
  359. package/registry/examples/loader/native/branded.dark.png +0 -0
  360. package/registry/examples/loader/native/branded.js +1 -1
  361. package/registry/examples/loader/native/branded.light.png +0 -0
  362. package/registry/examples/loader/native/branded.tsx +2 -2
  363. package/registry/examples/longform-page/story.js +3 -3
  364. package/registry/examples/longform-page/story.tsx +3 -3
  365. package/registry/examples/margin-layout/findings.d.ts +4 -0
  366. package/registry/examples/margin-layout/findings.js +15 -0
  367. package/registry/examples/margin-layout/findings.tsx +18 -0
  368. package/registry/examples/margin-layout/steps.d.ts +4 -0
  369. package/registry/examples/margin-layout/steps.js +15 -0
  370. package/registry/examples/margin-layout/steps.tsx +16 -0
  371. package/registry/examples/marketing-layout/docs-hub.js +1 -1
  372. package/registry/examples/marketing-layout/docs-hub.tsx +1 -1
  373. package/registry/examples/mascots/flock.tsx +2 -2
  374. package/registry/examples/nav-bar/family-admin.js +5 -5
  375. package/registry/examples/nav-bar/family-admin.tsx +4 -4
  376. package/registry/examples/nav-bar/site.js +1 -1
  377. package/registry/examples/nav-bar/site.tsx +1 -1
  378. package/registry/examples/page/kraft.d.ts +4 -0
  379. package/registry/examples/page/kraft.js +14 -0
  380. package/registry/examples/page/kraft.tsx +12 -0
  381. package/registry/examples/page/papers.d.ts +4 -0
  382. package/registry/examples/page/papers.js +14 -0
  383. package/registry/examples/page/papers.tsx +13 -0
  384. package/registry/examples/permission-prompt/native/blocked.dark.png +0 -0
  385. package/registry/examples/permission-prompt/native/blocked.js +1 -1
  386. package/registry/examples/permission-prompt/native/blocked.tsx +1 -1
  387. package/registry/examples/permission-prompt/native/camera.dark.png +0 -0
  388. package/registry/examples/permission-prompt/native/camera.js +1 -1
  389. package/registry/examples/permission-prompt/native/camera.light.png +0 -0
  390. package/registry/examples/permission-prompt/native/camera.tsx +1 -1
  391. package/registry/examples/profile-card/match.js +1 -1
  392. package/registry/examples/profile-card/match.tsx +1 -1
  393. package/registry/examples/promise-card/arcade.js +1 -1
  394. package/registry/examples/promise-card/arcade.tsx +1 -1
  395. package/registry/examples/pull-to-refresh/native/branded.dark.png +0 -0
  396. package/registry/examples/pull-to-refresh/native/branded.js +1 -1
  397. package/registry/examples/pull-to-refresh/native/branded.light.png +0 -0
  398. package/registry/examples/pull-to-refresh/native/branded.tsx +1 -1
  399. package/registry/examples/rail-nav/expandable.js +3 -3
  400. package/registry/examples/rail-nav/expandable.tsx +3 -3
  401. package/registry/examples/retro-tv/cabinet.js +1 -2
  402. package/registry/examples/retro-tv/cabinet.tsx +1 -3
  403. package/registry/examples/retro-tv/facade.d.ts +4 -0
  404. package/registry/examples/retro-tv/facade.js +12 -0
  405. package/registry/examples/retro-tv/facade.tsx +13 -0
  406. package/registry/examples/retro-tv/portable.js +1 -2
  407. package/registry/examples/retro-tv/portable.tsx +1 -3
  408. package/registry/examples/reviews/card.d.ts +4 -0
  409. package/registry/examples/reviews/card.js +23 -0
  410. package/registry/examples/reviews/card.tsx +19 -0
  411. package/registry/examples/reviews/summary.d.ts +4 -0
  412. package/registry/examples/reviews/summary.js +23 -0
  413. package/registry/examples/reviews/summary.tsx +17 -0
  414. package/registry/examples/scroll-stage/arcade.js +1 -1
  415. package/registry/examples/scroll-stage/arcade.tsx +1 -1
  416. package/registry/examples/search-field/global.js +1 -1
  417. package/registry/examples/search-field/global.tsx +1 -1
  418. package/registry/examples/separator/hand.d.ts +4 -0
  419. package/registry/examples/separator/hand.js +19 -0
  420. package/registry/examples/separator/hand.tsx +16 -0
  421. package/registry/examples/service-card/index-card.d.ts +4 -0
  422. package/registry/examples/service-card/index-card.js +15 -0
  423. package/registry/examples/service-card/index-card.tsx +12 -0
  424. package/registry/examples/service-card/index-list.d.ts +4 -0
  425. package/registry/examples/service-card/index-list.js +14 -0
  426. package/registry/examples/service-card/index-list.tsx +11 -0
  427. package/registry/examples/sites/french.js +1 -1
  428. package/registry/examples/sites/french.tsx +1 -1
  429. package/registry/examples/specimen-tag/facts.d.ts +4 -0
  430. package/registry/examples/specimen-tag/facts.js +23 -0
  431. package/registry/examples/specimen-tag/facts.tsx +18 -0
  432. package/registry/examples/specimen-tag/wire.js +2 -2
  433. package/registry/examples/specimen-tag/wire.tsx +2 -2
  434. package/registry/examples/splash-handoff/native/default.dark.png +0 -0
  435. package/registry/examples/splash-handoff/native/default.js +1 -1
  436. package/registry/examples/splash-handoff/native/default.light.png +0 -0
  437. package/registry/examples/splash-handoff/native/default.tsx +1 -1
  438. package/registry/examples/split-view/messages.tsx +1 -1
  439. package/registry/examples/split-view/notifications.js +1 -1
  440. package/registry/examples/split-view/notifications.tsx +1 -1
  441. package/registry/examples/stat/strip.d.ts +4 -0
  442. package/registry/examples/stat/strip.js +25 -0
  443. package/registry/examples/stat/strip.tsx +25 -0
  444. package/registry/examples/status-page/building.js +2 -2
  445. package/registry/examples/status-page/building.tsx +2 -2
  446. package/registry/examples/status-page/operational.js +1 -1
  447. package/registry/examples/status-page/operational.tsx +1 -1
  448. package/registry/examples/sticky-action/hide-while-visible.d.ts +4 -0
  449. package/registry/examples/sticky-action/hide-while-visible.js +16 -0
  450. package/registry/examples/sticky-action/hide-while-visible.tsx +17 -0
  451. package/registry/examples/tab-bar/native/main-sections.tsx +1 -1
  452. package/registry/examples/tree-view/docs.js +1 -1
  453. package/registry/examples/tree-view/docs.tsx +1 -1
  454. package/registry/examples/usage/credits-page.d.ts +4 -0
  455. package/registry/examples/usage/credits-page.js +45 -0
  456. package/registry/examples/usage/credits-page.tsx +40 -0
  457. package/registry/examples/usage/empty.d.ts +4 -0
  458. package/registry/examples/usage/empty.js +15 -0
  459. package/registry/examples/usage/empty.tsx +12 -0
  460. package/registry/examples/video-player/default.js +1 -2
  461. package/registry/examples/video-player/default.tsx +1 -3
  462. package/registry/examples/video-player/gated.js +2 -3
  463. package/registry/examples/video-player/gated.tsx +2 -4
  464. package/registry/examples/video-player/native/default.dark.png +0 -0
  465. package/registry/examples/video-player/native/default.js +3 -3
  466. package/registry/examples/video-player/native/default.light.png +0 -0
  467. package/registry/examples/video-player/native/default.tsx +3 -3
  468. package/registry/examples/video-player/signed-source.js +2 -3
  469. package/registry/examples/video-player/signed-source.tsx +2 -4
  470. package/registry/examples/video-player/vertical.js +1 -2
  471. package/registry/examples/video-player/vertical.tsx +1 -3
  472. package/registry/examples/video-trimmer/filmstrip.js +10 -2
  473. package/registry/examples/video-trimmer/filmstrip.tsx +11 -2
  474. package/registry/examples/video-trimmer/playhead.js +8 -1
  475. package/registry/examples/video-trimmer/playhead.tsx +9 -1
  476. package/registry/examples/wall/brick.js +1 -1
  477. package/registry/examples/wall/brick.tsx +1 -1
  478. package/registry/examples/wall/composition-fr.js +1 -1
  479. package/registry/examples/wall/composition-fr.tsx +1 -1
  480. package/registry/examples/wall/composition.js +1 -1
  481. package/registry/examples/wall/composition.tsx +1 -1
  482. package/registry/examples/wall/pinned-note.js +2 -2
  483. package/registry/examples/wall/pinned-note.tsx +3 -2
  484. package/registry/examples/wall/plaster.js +1 -1
  485. package/registry/examples/wall/plaster.tsx +1 -1
  486. package/registry/examples/wall/ridge.js +1 -1
  487. package/registry/examples/wall/ridge.tsx +1 -1
  488. package/registry/examples/wall/shop-sign.js +5 -4
  489. package/registry/examples/wall/shop-sign.tsx +7 -4
  490. package/registry/examples/wall/zellige.js +1 -1
  491. package/registry/examples/wall/zellige.tsx +1 -1
  492. package/registry/field.json +1 -1
  493. package/registry/file-upload.json +2 -2
  494. package/registry/filter-bar.json +1 -1
  495. package/registry/flock.json +1 -1
  496. package/registry/footnote.json +1 -1
  497. package/registry/force-update-screen.json +4 -4
  498. package/registry/form.json +7 -7
  499. package/registry/gallery-page.json +1 -1
  500. package/registry/genui.json +2 -2
  501. package/registry/glossary-term.json +1 -1
  502. package/registry/glossary.json +1 -1
  503. package/registry/glow-card.json +1 -1
  504. package/registry/goal-gauge.json +6 -6
  505. package/registry/grade-stamp.json +1 -1
  506. package/registry/how-it-works-page.json +1 -1
  507. package/registry/image-cropper.json +5 -5
  508. package/registry/index.json +231 -35
  509. package/registry/iso.json +7 -7
  510. package/registry/kanban.json +3 -3
  511. package/registry/kbd.json +1 -1
  512. package/registry/kind-config-editor.json +1 -1
  513. package/registry/kpi-explained.json +2 -2
  514. package/registry/landing-page.json +6 -6
  515. package/registry/landscape.json +1 -1
  516. package/registry/language-switch.json +1 -1
  517. package/registry/legal-page.json +1 -1
  518. package/registry/link-card.json +4 -4
  519. package/registry/list.json +3 -3
  520. package/registry/loader.json +11 -11
  521. package/registry/longform-page.json +3 -3
  522. package/registry/maintenance-screen.json +1 -1
  523. package/registry/map.json +2 -2
  524. package/registry/margin-layout.json +200 -0
  525. package/registry/markdown.json +1 -1
  526. package/registry/marketing-layout.json +2 -2
  527. package/registry/marquee.json +1 -1
  528. package/registry/mascot-quote.json +1 -1
  529. package/registry/mascot-state.json +1 -1
  530. package/registry/mascots.json +5 -5
  531. package/registry/match-dialog.json +1 -1
  532. package/registry/media-capture.json +1 -1
  533. package/registry/media-gallery.json +1 -1
  534. package/registry/media-grid.json +3 -3
  535. package/registry/meta-row.json +1 -1
  536. package/registry/meter.json +1 -1
  537. package/registry/nav-bar.json +9 -9
  538. package/registry/next-actions.json +1 -1
  539. package/registry/notification-preferences.json +3 -3
  540. package/registry/number-ticker.json +1 -1
  541. package/registry/onboarding.json +1 -1
  542. package/registry/opening-hours.json +1 -1
  543. package/registry/page-header.json +1 -1
  544. package/registry/page-hero.json +1 -1
  545. package/registry/page-index.json +1 -1
  546. package/registry/page.json +53 -11
  547. package/registry/pagination.json +1 -1
  548. package/registry/permission-prompt.json +3 -3
  549. package/registry/photo-grid.json +1 -1
  550. package/registry/pointer-light.json +1 -1
  551. package/registry/popover.json +1 -1
  552. package/registry/pricing-page.json +1 -1
  553. package/registry/product-page.json +6 -6
  554. package/registry/profile-card.json +7 -7
  555. package/registry/progress.json +1 -1
  556. package/registry/promise-card.json +3 -3
  557. package/registry/pull-to-refresh.json +2 -2
  558. package/registry/quota-meter.json +1 -1
  559. package/registry/radio-group.json +1 -1
  560. package/registry/rail-nav.json +10 -10
  561. package/registry/recipes.json +1 -1
  562. package/registry/retro-tv.json +48 -32
  563. package/registry/reviews.json +361 -0
  564. package/registry/router.json +1 -1
  565. package/registry/scroll-stage.json +6 -6
  566. package/registry/search-field.json +3 -3
  567. package/registry/section-backdrop.json +1 -1
  568. package/registry/separator.json +71 -6
  569. package/registry/service-card.json +55 -6
  570. package/registry/settings-layout.json +1 -1
  571. package/registry/showcase.json +1 -1
  572. package/registry/signature.json +1 -1
  573. package/registry/site-cahier.json +1 -1
  574. package/registry/site-footer.json +7 -7
  575. package/registry/sites.json +4 -4
  576. package/registry/skeleton.json +1 -1
  577. package/registry/skip-link.json +1 -1
  578. package/registry/slider.json +1 -1
  579. package/registry/slot-picker.json +1 -1
  580. package/registry/slot.json +1 -1
  581. package/registry/specimen-tag.json +58 -6
  582. package/registry/speed-lines.json +1 -1
  583. package/registry/spinner.json +1 -1
  584. package/registry/splash-handoff.json +4 -4
  585. package/registry/split-view.json +4 -4
  586. package/registry/stage-banner.json +10 -6
  587. package/registry/stat.json +62 -10
  588. package/registry/status-chip.json +1 -1
  589. package/registry/status-page.json +9 -9
  590. package/registry/step-progress.json +1 -1
  591. package/registry/step-showcase.json +1 -1
  592. package/registry/stepper.json +1 -1
  593. package/registry/sticky-action.json +27 -4
  594. package/registry/stuck.json +1 -1
  595. package/registry/swipe-deck.json +1 -1
  596. package/registry/switch.json +1 -1
  597. package/registry/tab-bar.json +2 -2
  598. package/registry/tabs.json +1 -1
  599. package/registry/tag-input.json +1 -1
  600. package/registry/tag-selector.json +1 -1
  601. package/registry/taped-photo.json +1 -1
  602. package/registry/terminal-replay.json +1 -1
  603. package/registry/text-style.json +1 -1
  604. package/registry/theme.json +1 -1
  605. package/registry/toast.json +1 -1
  606. package/registry/toc.json +1 -1
  607. package/registry/tooltip.json +1 -1
  608. package/registry/tree-view.json +3 -3
  609. package/registry/update-prompt.json +1 -1
  610. package/registry/upload-queue.json +1 -1
  611. package/registry/usage.json +542 -0
  612. package/registry/verified-badge.json +1 -1
  613. package/registry/versus-card.json +1 -1
  614. package/registry/vertical-video.json +4 -4
  615. package/registry/video-player.json +7 -7
  616. package/registry/video-trimmer.json +8 -8
  617. package/registry/virtual.json +1 -1
  618. package/registry/wall.json +128 -40
  619. package/registry/waveform.json +1 -1
  620. package/skills/form/SKILL.md +1 -1
  621. package/skills/map/SKILL.md +2 -2
  622. package/dist/chunk-3RVFD3UX.js.map +0 -1
  623. package/dist/chunk-4E5IUZHR.js.map +0 -1
  624. package/dist/chunk-KB7OLYIJ.js.map +0 -1
  625. package/dist/chunk-MHUUNC5W.js.map +0 -1
  626. package/dist/chunk-MIMOTE4W.js.map +0 -1
  627. package/dist/chunk-RBETQO2P.js.map +0 -1
  628. package/dist/chunk-WOZP3JLW.js.map +0 -1
  629. package/dist/chunk-YKEIOYJ5.js.map +0 -1
  630. /package/dist/{chunk-5LANVCK7.js.map → chunk-BG5APGX6.js.map} +0 -0
  631. /package/dist/{chunk-6EAHUURY.js.map → chunk-GHAN7OOE.js.map} +0 -0
  632. /package/dist/{chunk-HEKDKM5Y.js.map → chunk-QVHSV6RA.js.map} +0 -0
  633. /package/dist/{chunk-7JG3VR4C.js.map → chunk-RCKXJEDQ.js.map} +0 -0
  634. /package/registry/examples/{app-shell/orochia-studio.d.ts → analysis-report/document-validation.d.ts} +0 -0
  635. /package/registry/examples/{iso/orochia-hero.d.ts → analysis-report/native/document-validation.d.ts} +0 -0
@@ -0,0 +1,542 @@
1
+ {
2
+ "name": "usage",
3
+ "type": "primitive",
4
+ "title": "Usage",
5
+ "summary": "The blocks of a « Credits & usage » page: the balance on a meter, the period switch (the address holds it), the figures on a strip with their trend in words, and the activity stacked by outcome.",
6
+ "description": "The blocks of a « Credits & usage » page: the balance on a meter, the period switch (the address holds it), the figures on a strip with their trend in words, and the activity stacked by outcome.",
7
+ "status": "beta",
8
+ "deprecated": null,
9
+ "category": "data-display",
10
+ "platforms": "web",
11
+ "parity": {
12
+ "web": {
13
+ "state": "yes"
14
+ },
15
+ "native": {
16
+ "state": "gap",
17
+ "reason": "The phone apps show their credits through Meter and Stat by hand; a native twin of the blocks follows the first app that moves onto them.",
18
+ "issue": "krizaka/krizaka-ui#728"
19
+ },
20
+ "desktop": {
21
+ "state": "yes"
22
+ }
23
+ },
24
+ "whenToUse": [
25
+ "A « Credits & usage » page or panel: what is left, how it was used over 7, 30 or 90 days, and what happened to each run.",
26
+ "Any metered product (checks, runs, storage) that bills or limits by credits."
27
+ ],
28
+ "whenNotToUse": [
29
+ {
30
+ "when": "A single quota against a plan, with no period.",
31
+ "use": "quota-meter"
32
+ },
33
+ {
34
+ "when": "A free-form dashboard of charts.",
35
+ "use": "dashboard-layout"
36
+ },
37
+ {
38
+ "when": "A single key figure.",
39
+ "use": "stat"
40
+ }
41
+ ],
42
+ "bestPractices": [
43
+ "Read the period with `parsePeriod(searchParams.period)` and pass it to `PeriodSwitch` and to the query: the server renders the period, the address can be shared.",
44
+ "`UsageTiles` computes the change against the previous period from `previous` and says it in words (« +12 % vs période précédente »); French and `fr-CA` figures are the default, `locale=\"en\"` switches both.",
45
+ "Put a `Sparkline` of @krizaka/charts (64 × 18) in a tile's `chart`; the tiles stay on the strip, never four full-width stats.",
46
+ "Pass `outcomes` in the order they should stack, bottom first; tones are the tokens' (`success`, `danger`…), never colours.",
47
+ "Show `loading` while the data is on its way and give an `emptyLabel` that says what to do next."
48
+ ],
49
+ "accessibility": {
50
+ "keyboard": [
51
+ {
52
+ "keys": "Tab / Enter",
53
+ "action": "Moves through the periods; each is a link."
54
+ }
55
+ ],
56
+ "notes": [
57
+ "`CreditsMeter` is a `role=meter` named by its label, its value in words (« 820 sur 1 000 »); its tone is never the only signal.",
58
+ "`PeriodSwitch` is a navigation of links; the shown period is `aria-current=\"page\"`.",
59
+ "`UsageChart` is a figure with a caption; the bars are decorative and the text version is a table with every day and outcome.",
60
+ "Loading is `aria-busy`; the skeleton does not animate under reduced motion."
61
+ ]
62
+ },
63
+ "related": [
64
+ "meter",
65
+ "stat",
66
+ "quota-meter",
67
+ "dashboard-layout"
68
+ ],
69
+ "web": {
70
+ "entry": "@krizaka/ui/usage",
71
+ "import": "import { CreditsMeter, PeriodSwitch, UsageTiles, UsageChart, parsePeriod } from \"@krizaka/ui/usage\";",
72
+ "props": [
73
+ {
74
+ "component": "USAGE_PERIODS",
75
+ "description": "The periods a usage page offers, in days.",
76
+ "props": []
77
+ },
78
+ {
79
+ "component": "CreditsMeter",
80
+ "description": "The balance: the figure large, a meter that turns to warning then danger as it runs low, the renewal and the way to buy.",
81
+ "props": [
82
+ {
83
+ "name": "balance",
84
+ "type": "number",
85
+ "default": null,
86
+ "description": "Credits left.",
87
+ "required": true
88
+ },
89
+ {
90
+ "name": "label",
91
+ "type": "string",
92
+ "default": null,
93
+ "description": "What the balance is (« Crédits »): the heading and the meter's name.",
94
+ "required": true
95
+ },
96
+ {
97
+ "name": "total",
98
+ "type": "number",
99
+ "default": null,
100
+ "description": "The allowance of the period; the meter fills with what is left.",
101
+ "required": true
102
+ },
103
+ {
104
+ "name": "action",
105
+ "type": "ReactNode",
106
+ "default": null,
107
+ "description": "The way to buy more: a link or a button.",
108
+ "required": false
109
+ },
110
+ {
111
+ "name": "locale",
112
+ "type": "string",
113
+ "default": "fr-CA",
114
+ "description": "Default `fr-CA`.",
115
+ "required": false
116
+ },
117
+ {
118
+ "name": "renewal",
119
+ "type": "ReactNode",
120
+ "default": null,
121
+ "description": "The renewal, written by the app (« Renouvelés le 1er novembre »).",
122
+ "required": false
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ "component": "PeriodSwitch",
128
+ "description": "7 · 30 · 90 d: links, so the address holds the period (`?period=30`) and the server renders it.",
129
+ "props": [
130
+ {
131
+ "name": "href",
132
+ "type": "string",
133
+ "default": null,
134
+ "description": "The page's path (and any other parameters); each period is a link to it with `?period=`.",
135
+ "required": true
136
+ },
137
+ {
138
+ "name": "label",
139
+ "type": "string",
140
+ "default": null,
141
+ "description": "The accessible name (« Période »).",
142
+ "required": true
143
+ },
144
+ {
145
+ "name": "value",
146
+ "type": "number",
147
+ "default": null,
148
+ "description": "The period shown, from `parsePeriod(searchParams.period)`.",
149
+ "required": true
150
+ },
151
+ {
152
+ "name": "linkAs",
153
+ "type": "LinkComponent",
154
+ "default": null,
155
+ "description": "The app's router link (Next's `Link`); default a plain `<a>`.",
156
+ "required": false
157
+ },
158
+ {
159
+ "name": "locale",
160
+ "type": "string",
161
+ "default": "fr-CA",
162
+ "description": "Default `fr-CA`.",
163
+ "required": false
164
+ },
165
+ {
166
+ "name": "param",
167
+ "type": "string",
168
+ "default": "period",
169
+ "description": "The query parameter. Default `period`.",
170
+ "required": false
171
+ },
172
+ {
173
+ "name": "periodLabel",
174
+ "type": "((days: number) => string)",
175
+ "default": null,
176
+ "description": "The text of a period. Default `7 j` (`7 d` for an English locale).",
177
+ "required": false
178
+ },
179
+ {
180
+ "name": "periods",
181
+ "type": "readonly number[]",
182
+ "default": "[7, 30, 90] as const",
183
+ "description": "The periods offered, in days. Default 7 · 30 · 90.",
184
+ "required": false
185
+ }
186
+ ]
187
+ },
188
+ {
189
+ "component": "UsageChart",
190
+ "description": "The activity of the period, one bar per day stacked by outcome — with its legend and its text version (a table).",
191
+ "props": [
192
+ {
193
+ "name": "columns",
194
+ "type": "{ day: string; total: string; }",
195
+ "default": null,
196
+ "description": "The text version's column headings: the day, the total.",
197
+ "required": true
198
+ },
199
+ {
200
+ "name": "days",
201
+ "type": "readonly UsageDay[]",
202
+ "default": null,
203
+ "description": "The days, oldest first.",
204
+ "required": true
205
+ },
206
+ {
207
+ "name": "emptyLabel",
208
+ "type": "string",
209
+ "default": null,
210
+ "description": "Said when there is nothing in the period.",
211
+ "required": true
212
+ },
213
+ {
214
+ "name": "outcomes",
215
+ "type": "readonly UsageOutcome[]",
216
+ "default": null,
217
+ "description": "The outcomes stacked in each bar, bottom first.",
218
+ "required": true
219
+ },
220
+ {
221
+ "name": "loading",
222
+ "type": "boolean",
223
+ "default": null,
224
+ "description": "The data is on its way: a skeleton keeps the height.",
225
+ "required": false
226
+ },
227
+ {
228
+ "name": "locale",
229
+ "type": "string",
230
+ "default": "fr-CA",
231
+ "description": "Default `fr-CA`.",
232
+ "required": false
233
+ }
234
+ ]
235
+ },
236
+ {
237
+ "component": "UsageTiles",
238
+ "description": "The figures of the period on the strip, each compared with the previous period in words.",
239
+ "props": [
240
+ {
241
+ "name": "tiles",
242
+ "type": "readonly UsageTileInput[]",
243
+ "default": null,
244
+ "description": "2 to 4 figures.",
245
+ "required": true
246
+ },
247
+ {
248
+ "name": "loading",
249
+ "type": "boolean",
250
+ "default": null,
251
+ "description": "The data is on its way: the row keeps its height.",
252
+ "required": false
253
+ },
254
+ {
255
+ "name": "locale",
256
+ "type": "string",
257
+ "default": null,
258
+ "description": "The language of the figures and the words. Default `fr-CA`.",
259
+ "required": false
260
+ },
261
+ {
262
+ "name": "period",
263
+ "type": "ReactNode",
264
+ "default": null,
265
+ "description": "The period switch, above the row.",
266
+ "required": false
267
+ },
268
+ {
269
+ "name": "words",
270
+ "type": "Partial<UsageWords>",
271
+ "default": null,
272
+ "description": "Your own words for the change: `{change}` is the percentage.",
273
+ "required": false
274
+ }
275
+ ]
276
+ }
277
+ ],
278
+ "examples": [
279
+ {
280
+ "name": "credits-page",
281
+ "title": "Credits & usage",
282
+ "description": "The balance, the period switch, the strip of figures and the activity by outcome (demo data).",
283
+ "path": "examples/usage/credits-page.tsx",
284
+ "module": "@krizaka/ui/registry/examples/usage/credits-page",
285
+ "code": "import { CreditsMeter, PeriodSwitch, UsageChart, UsageTiles } from \"@krizaka/ui/usage\";\n\nconst spark = (data: number[]) => (\n <svg viewBox=\"0 0 64 18\" width={64} height={18} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" aria-hidden>\n <polyline points={data.map((v, i) => `${(i * 64) / (data.length - 1)},${17 - v}`).join(\" \")} />\n </svg>\n);\nconst days = [\n { label: \"1 nov.\", values: { done: 8, flagged: 2, failed: 0 } },\n { label: \"2 nov.\", values: { done: 11, flagged: 1, failed: 1 } },\n { label: \"3 nov.\", values: { done: 6, flagged: 3, failed: 0 } },\n];\n\n// A « Credits & usage » page in French (the default), demo data. A `Sparkline` of @krizaka/charts goes in `chart`; a line stands in.\nexport default function CreditsPage() {\n const period = <PeriodSwitch label=\"Période\" value={30} href=\"/credits\" />;\n return (\n <div className=\"flex w-full max-w-2xl flex-col gap-4\">\n <CreditsMeter label=\"Crédits\" balance={820} total={1000} renewal=\"Renouvelés le 1er décembre\" action={<a href=\"/credits/acheter\">Acheter des crédits</a>} />\n <UsageTiles\n period={period}\n tiles={[\n { id: \"runs\", label: \"Vérifications\", value: 128, previous: 114, chart: spark([4, 6, 5, 8, 9, 12]) },\n { id: \"flagged\", label: \"Signalées\", value: 8, previous: 10, good: \"down\", chart: spark([3, 2, 2, 1, 1, 1]) },\n { id: \"credits\", label: \"Crédits utilisés\", value: 180, previous: 180, chart: spark([3, 3, 3, 3, 3, 3]) },\n ]}\n />\n <UsageChart\n title=\"Activité par résultat\"\n days={days}\n columns={{ day: \"Jour\", total: \"Total\" }} emptyLabel=\"Aucune activité sur cette période.\"\n outcomes={[\n { id: \"done\", label: \"Terminées\", tone: \"success\" },\n { id: \"flagged\", label: \"Signalées\", tone: \"warning\" },\n { id: \"failed\", label: \"Échouées\", tone: \"danger\" },\n ]}\n />\n </div>\n );\n}\n"
286
+ },
287
+ {
288
+ "name": "empty",
289
+ "title": "Loading and empty",
290
+ "description": "The skeletons while the data is on its way, then the empty state.",
291
+ "path": "examples/usage/empty.tsx",
292
+ "module": "@krizaka/ui/registry/examples/usage/empty",
293
+ "code": "import { UsageChart, UsageTiles } from \"@krizaka/ui/usage\";\n\n// While the data is on its way (`loading`), then when the period has nothing in it.\nexport default function UsageEmpty() {\n return (\n <div className=\"flex w-full max-w-2xl flex-col gap-4\">\n <UsageTiles loading tiles={[]} />\n <UsageChart loading title=\"Activité par résultat\" days={[]} outcomes={[]} columns={{ day: \"Jour\", total: \"Total\" }} emptyLabel=\"\" />\n <UsageChart title=\"Activité par résultat\" days={[{ label: \"1 nov.\", values: {} }]} outcomes={[{ id: \"done\", label: \"Terminées\", tone: \"success\" }]} columns={{ day: \"Jour\", total: \"Total\" }} emptyLabel=\"Aucune activité sur cette période.\" />\n </div>\n );\n}\n"
294
+ }
295
+ ]
296
+ },
297
+ "native": null,
298
+ "files": [
299
+ {
300
+ "path": "block-link.tsx",
301
+ "content": "// The links of the page blocks (PageHero's back link, LinkCard, ArgumentCard, ActionBar): an internal path renders\n// through the app's router link (`linkAs`, e.g. Next's `Link`), anything else is an `<a>` that opens in a new tab.\n// Shared by the block entries; never exported on its own.\nimport type * as React from \"react\";\n\n/** The app's link component (Next's `Link`, React Router's `Link`…): receives `href`, `className` and the children. */\nexport type LinkComponent = React.ElementType<{ href: string; className?: string; children?: React.ReactNode; \"aria-label\"?: string; \"aria-describedby\"?: string }>;\n\n/** An address that leaves the app: an absolute URL or a protocol (`mailto:`). */\nexport const isExternal = (href: string) => /^[a-z][a-z0-9+.-]*:/i.test(href);\n\nexport function BlockLink({\n href,\n linkAs: Link = \"a\",\n external = isExternal(href),\n rel,\n ...props\n}: Omit<React.ComponentProps<\"a\">, \"href\"> & { href: string; linkAs?: LinkComponent; external?: boolean }) {\n if (external) return <a href={href} target=\"_blank\" rel={rel ?? \"noopener noreferrer\"} {...props} />;\n const Comp = Link as React.ElementType;\n return <Comp href={href} rel={rel} {...props} />;\n}\n"
302
+ },
303
+ {
304
+ "path": "meta.ts",
305
+ "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-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 | \"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 | \"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"
306
+ },
307
+ {
308
+ "path": "usage/index.ts",
309
+ "content": "/** @krizaka/ui/usage — the blocks of a « Credits & usage » page: `CreditsMeter`, `PeriodSwitch` (`?period=`), `UsageTiles` (the strip), `UsageChart`; `parsePeriod`, `usageTile`. Server-safe. */\nexport {\n parsePeriod,\n periodHref,\n USAGE_PERIODS,\n type UsageDay,\n type UsageOutcome,\n type UsagePeriod,\n usageTile,\n type UsageTileInput,\n type UsageTileOptions,\n type UsageWords,\n} from \"./model\";\nexport { CreditsMeter, type CreditsMeterProps, PeriodSwitch, type PeriodSwitchProps, usage, UsageChart, type UsageChartProps, UsageTiles, type UsageTilesProps } from \"./usage\";\n"
310
+ },
311
+ {
312
+ "path": "usage/meta.ts",
313
+ "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Usage\",\n summary: \"The blocks of a « Credits & usage » page: the balance on a meter, the period switch (the address holds it), the figures on a strip with their trend in words, and the activity stacked by outcome.\",\n status: \"beta\",\n category: \"data-display\",\n platforms: \"web\",\n parity: { native: { status: \"gap\", issue: \"krizaka/krizaka-ui#728\", reason: \"The phone apps show their credits through Meter and Stat by hand; a native twin of the blocks follows the first app that moves onto them.\" }, desktop: \"web\" },\n whenToUse: [\n \"A « Credits & usage » page or panel: what is left, how it was used over 7, 30 or 90 days, and what happened to each run.\",\n \"Any metered product (checks, runs, storage) that bills or limits by credits.\",\n ],\n whenNotToUse: [\n { when: \"A single quota against a plan, with no period.\", use: \"quota-meter\" },\n { when: \"A free-form dashboard of charts.\", use: \"dashboard-layout\" },\n { when: \"A single key figure.\", use: \"stat\" },\n ],\n bestPractices: [\n \"Read the period with `parsePeriod(searchParams.period)` and pass it to `PeriodSwitch` and to the query: the server renders the period, the address can be shared.\",\n \"`UsageTiles` computes the change against the previous period from `previous` and says it in words (« +12 % vs période précédente »); French and `fr-CA` figures are the default, `locale=\\\"en\\\"` switches both.\",\n \"Put a `Sparkline` of @krizaka/charts (64 × 18) in a tile's `chart`; the tiles stay on the strip, never four full-width stats.\",\n \"Pass `outcomes` in the order they should stack, bottom first; tones are the tokens' (`success`, `danger`…), never colours.\",\n \"Show `loading` while the data is on its way and give an `emptyLabel` that says what to do next.\",\n ],\n accessibility: {\n keyboard: [{ keys: \"Tab / Enter\", action: \"Moves through the periods; each is a link.\" }],\n notes: [\n \"`CreditsMeter` is a `role=meter` named by its label, its value in words (« 820 sur 1 000 »); its tone is never the only signal.\",\n \"`PeriodSwitch` is a navigation of links; the shown period is `aria-current=\\\"page\\\"`.\",\n \"`UsageChart` is a figure with a caption; the bars are decorative and the text version is a table with every day and outcome.\",\n \"Loading is `aria-busy`; the skeleton does not animate under reduced motion.\",\n ],\n },\n related: [\"meter\", \"stat\", \"quota-meter\", \"dashboard-layout\"],\n web: {\n imports: [\"CreditsMeter\", \"PeriodSwitch\", \"UsageTiles\", \"UsageChart\", \"parsePeriod\"],\n examples: [\n { name: \"credits-page\", title: \"Credits & usage\", description: \"The balance, the period switch, the strip of figures and the activity by outcome (demo data).\" },\n { name: \"empty\", title: \"Loading and empty\", description: \"The skeletons while the data is on its way, then the empty state.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
314
+ },
315
+ {
316
+ "path": "usage/model.ts",
317
+ "content": "// Headless: the arithmetic and the words of the usage blocks (period, tiles, chart rows), read by the web entry.\nimport { formatNumber, formatPercent } from \"@krizaka/intl\";\nimport type * as React from \"react\";\n\nimport type { StatStripItem, StatTrend } from \"../stat\";\n\n/** The periods a usage page offers, in days. */\nexport const USAGE_PERIODS = [7, 30, 90] as const;\nexport type UsagePeriod = (typeof USAGE_PERIODS)[number];\n\n/** Reads `?period=` back: anything but an offered period is the default, so the address can never break the page. */\nexport function parsePeriod(raw: string | string[] | null | undefined, allowed: readonly number[] = USAGE_PERIODS, fallback = 30): number {\n const value = Number(Array.isArray(raw) ? raw[0] : raw);\n return allowed.includes(value) ? value : fallback;\n}\n\n/** The address of a period: the same path with `period` set, every other parameter kept. */\nexport function periodHref(base: string, period: number, param = \"period\"): string {\n const [path = \"\", query = \"\"] = base.split(\"?\");\n const params = new URLSearchParams(query);\n params.set(param, String(period));\n return `${path}?${params.toString()}`;\n}\n\nconst WORDS = {\n fr: { vsPrevious: \"{change} vs période précédente\", same: \"stable\", up: \"en hausse\", down: \"en baisse\" },\n en: { vsPrevious: \"{change} vs previous period\", same: \"steady\", up: \"up\", down: \"down\" },\n} as const;\n\nexport type UsageWords = {\n /** The change against the previous period; `{change}` is replaced by the signed percentage. */\n vsPrevious: string;\n /** When the figure did not move. */\n same: string;\n};\n\nconst FLAT = 0.005;\n\nexport interface UsageTileInput {\n id: string;\n label: string;\n value: number;\n /** The same figure for the previous period: the trend is computed from it. */\n previous?: number;\n /** Which direction is good news (latency, failures: `down`). Default `up`. */\n good?: \"up\" | \"down\";\n /** The shape of the period, rendered by the app (a `Sparkline` of @krizaka/charts, 64 × 18). */\n chart?: React.ReactNode;\n /** Digits of the figure. Default 0. */\n digits?: number;\n}\n\nexport interface UsageTileOptions {\n /** Default `fr-CA`: French figures and words with no props. */\n /** The language of the figures and the words. Default `fr-CA`. */\n locale?: string;\n /** Your own words for the change: `{change}` is the percentage. */\n words?: Partial<UsageWords>;\n}\n\nconst wordsOf = (locale: string): (typeof WORDS)[keyof typeof WORDS] => (locale.toLowerCase().startsWith(\"en\") ? WORDS.en : WORDS.fr);\n\nfunction direction(change: number | null): StatTrend | undefined {\n if (change === null) return undefined;\n if (Math.abs(change) < FLAT) return \"flat\";\n return change > 0 ? \"up\" : \"down\";\n}\n\nfunction changeOf(value: number, previous: number | undefined): number | null {\n if (previous === undefined) return null;\n if (previous === 0) return value === 0 ? 0 : null;\n return value / previous - 1;\n}\n\n/** One strip figure: the value written for the locale, the change against the previous period said in words. */\nexport function usageTile(input: UsageTileInput, { locale = \"fr-CA\", words }: UsageTileOptions = {}): StatStripItem {\n const w = { ...wordsOf(locale), ...words };\n const change = changeOf(input.value, input.previous);\n const trend = direction(change);\n const text = change === null ? undefined : trend === \"flat\" ? w.same : w.vsPrevious.replace(\"{change}\", formatPercent(change, { locale, signDisplay: \"exceptZero\", maximumFractionDigits: 0 }));\n return {\n id: input.id,\n label: input.label,\n value: formatNumber(input.value, { locale, maximumFractionDigits: input.digits ?? 0 }),\n trend,\n trendLabel: text,\n chart: input.chart,\n };\n}\n\n/** One bar of the usage chart: a day, its counts by outcome. */\nexport interface UsageDay {\n /** The day, written by the app (`3 nov.`). */\n label: string;\n values: Readonly<Partial<Record<string, number>>>;\n}\n\nexport interface UsageOutcome {\n id: string;\n label: string;\n /** `accent`, `success`, `warning`, `danger` or `muted`: tones of the tokens, never a colour. */\n tone: \"accent\" | \"success\" | \"warning\" | \"danger\" | \"muted\";\n}\n\nexport interface UsageBar {\n label: string;\n total: number;\n /** Height of the whole bar, 0–1 of the tallest day. */\n height: number;\n segments: { id: string; value: number; share: number }[];\n}\n\n/** The bars of the chart: heights relative to the tallest day, segments as shares of their bar. */\nexport function usageBars(days: readonly UsageDay[], outcomes: readonly UsageOutcome[]): UsageBar[] {\n const totals = days.map((d) => outcomes.reduce((sum, o) => sum + (d.values[o.id] ?? 0), 0));\n const max = Math.max(1, ...totals);\n return days.map((d, i) => {\n const total = totals[i] ?? 0;\n return {\n label: d.label,\n total,\n height: total / max,\n segments: outcomes.map((o) => ({ id: o.id, value: d.values[o.id] ?? 0, share: total === 0 ? 0 : (d.values[o.id] ?? 0) / total })),\n };\n });\n}\n"
318
+ },
319
+ {
320
+ "path": "usage/usage.tsx",
321
+ "content": "// Server-safe. The blocks of a « Credits & usage » page: the balance on a Meter, the period switch (the address holds it),\n// the figures on the strip, the activity stacked by outcome. Words are props (French by default for the few built in);\n// figures are written with @krizaka/intl. Demo data only in the examples.\nimport { formatNumber } from \"@krizaka/intl\";\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\nimport { Meter } from \"../meter\";\nimport { StatGrid } from \"../stat\";\nimport { periodHref, USAGE_PERIODS, type UsageBar, usageBars, type UsageDay, type UsageOutcome, usageTile,type UsageTileInput, type UsageTileOptions } from \"./model\";\n\nexport const usage = tv({\n slots: {\n credits: \"flex w-full min-w-0 flex-col gap-3 rounded-xl border border-border-default bg-surface-1 p-5\",\n creditsHead: \"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1\",\n creditsTitle: \"m-0 text-sm font-semibold text-fg-secondary\",\n creditsFigure: \"m-0 font-display text-3xl font-bold tabular-nums text-fg\",\n creditsFoot: \"m-0 flex flex-wrap items-center justify-between gap-x-4 gap-y-2 text-xs text-fg-secondary\",\n switchList: \"m-0 inline-flex list-none gap-1 rounded-lg border border-border-default bg-surface-1 p-1\",\n switchLink:\n \"inline-flex min-h-9 min-w-11 items-center justify-center rounded-md px-3 text-sm font-semibold tabular-nums text-fg-secondary no-underline transition-colors \" +\n \"hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-[current=page]:bg-accent-soft aria-[current=page]:text-fg\",\n chart: \"m-0 flex w-full min-w-0 flex-col gap-3 rounded-xl border border-border-default bg-surface-1 p-5\",\n chartTitle: \"text-sm font-semibold text-fg\",\n plot: \"flex h-40 w-full items-end gap-1\",\n column: \"flex h-full min-w-0 flex-1 flex-col justify-end\",\n bar: \"flex w-full flex-col-reverse overflow-hidden rounded-sm\",\n legend: \"m-0 flex list-none flex-wrap gap-x-4 gap-y-1 p-0 text-xs text-fg-secondary\",\n swatch: \"mr-1.5 inline-block h-2 w-2 rounded-full align-baseline\",\n state: \"m-0 flex h-40 items-center justify-center rounded-lg border border-dashed border-border-default px-4 text-center text-sm text-fg-secondary\",\n skeleton: \"h-40 w-full animate-pulse rounded-lg bg-surface-3 motion-reduce:animate-none\",\n },\n variants: {\n tone: {\n accent: { swatch: \"bg-accent\" },\n success: { swatch: \"bg-success\" },\n warning: { swatch: \"bg-warning\" },\n danger: { swatch: \"bg-danger\" },\n muted: { swatch: \"bg-border-strong\" },\n },\n },\n});\n\nconst FILL: Record<UsageOutcome[\"tone\"], string> = { accent: \"bg-accent\", success: \"bg-success\", warning: \"bg-warning\", danger: \"bg-danger\", muted: \"bg-border-strong\" };\n\nconst CREDIT_WORDS = {\n fr: { of: \"sur\", left: \"restants\" },\n en: { of: \"of\", left: \"left\" },\n} as const;\n\nexport type CreditsMeterProps = Omit<React.ComponentProps<\"section\">, \"children\"> & {\n /** What the balance is (« Crédits »): the heading and the meter's name. */\n label: string;\n /** Credits left. */\n balance: number;\n /** The allowance of the period; the meter fills with what is left. */\n total: number;\n /** The renewal, written by the app (« Renouvelés le 1er novembre »). */\n renewal?: React.ReactNode;\n /** The way to buy more: a link or a button. */\n action?: React.ReactNode;\n /** Default `fr-CA`. */\n locale?: string;\n};\n\n/** The balance: the figure large, a meter that turns to warning then danger as it runs low, the renewal and the way to buy. */\nexport function CreditsMeter({ label, balance, total, renewal, action, locale = \"fr-CA\", className, ...props }: CreditsMeterProps) {\n const s = usage();\n const w = locale.toLowerCase().startsWith(\"en\") ? CREDIT_WORDS.en : CREDIT_WORDS.fr;\n const write = (n: number) => formatNumber(n, { locale });\n const words = `${write(balance)} ${w.of} ${write(total)}`;\n return (\n <section aria-label={label} className={s.credits({ className })} {...props}>\n <div className={s.creditsHead()}>\n <h3 className={s.creditsTitle()}>{label}</h3>\n <p className={s.creditsFigure()}>\n {write(balance)} <span className=\"sr-only\">{w.left}</span>\n </p>\n </div>\n <Meter label={label} value={balance} max={Math.max(1, total)} valueText={words} optimum=\"high\" thresholds={{ low: 0.2, high: 0.5 }} size=\"lg\" />\n <p className={s.creditsFoot()}>\n <span>{words}</span>\n {renewal ? <span>{renewal}</span> : null}\n {action}\n </p>\n </section>\n );\n}\n\nexport type PeriodSwitchProps = Omit<React.ComponentProps<\"nav\">, \"children\"> & {\n /** The accessible name (« Période »). */\n label: string;\n /** The period shown, from `parsePeriod(searchParams.period)`. */\n value: number;\n /** The page's path (and any other parameters); each period is a link to it with `?period=`. */\n href: string;\n /** The periods offered, in days. Default 7 · 30 · 90. */\n periods?: readonly number[];\n /** The query parameter. Default `period`. */\n param?: string;\n /** The text of a period. Default `7 j` (`7 d` for an English locale). */\n periodLabel?: (days: number) => string;\n /** Default `fr-CA`. */\n locale?: string;\n /** The app's router link (Next's `Link`); default a plain `<a>`. */\n linkAs?: LinkComponent;\n};\n\n/** 7 · 30 · 90 d: links, so the address holds the period (`?period=30`) and the server renders it. */\nexport function PeriodSwitch({ label, value, href, periods = USAGE_PERIODS, param = \"period\", periodLabel, locale = \"fr-CA\", linkAs, className, ...props }: PeriodSwitchProps) {\n const s = usage();\n const unit = locale.toLowerCase().startsWith(\"en\") ? \"d\" : \"j\";\n const text = periodLabel ?? ((days: number) => `${days} ${unit}`);\n return (\n <nav aria-label={label} className={className} {...props}>\n <ul className={s.switchList()}>\n {periods.map((days) => (\n <li key={days}>\n <BlockLink href={periodHref(href, days, param)} linkAs={linkAs} className={s.switchLink()} aria-current={days === value ? \"page\" : undefined}>\n {text(days)}\n </BlockLink>\n </li>\n ))}\n </ul>\n </nav>\n );\n}\n\nexport type UsageTilesProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n /** 2 to 4 figures. */\n tiles: readonly UsageTileInput[];\n /** The period switch, above the row. */\n period?: React.ReactNode;\n /** The data is on its way: the row keeps its height. */\n loading?: boolean;\n} & UsageTileOptions;\n\n/** The figures of the period on the strip, each compared with the previous period in words. */\nexport function UsageTiles({ tiles, period, loading, locale, words, className, ...props }: UsageTilesProps) {\n const s = usage();\n if (loading) return <div aria-busy=\"true\" className={s.skeleton({ className: [\"h-20\", className].filter(Boolean).join(\" \") })} {...props} />;\n return <StatGrid variant=\"strip\" items={tiles.map((t) => usageTile(t, { locale, words }))} period={period} className={className} {...props} />;\n}\n\nexport type UsageChartProps = Omit<React.ComponentProps<\"figure\">, \"children\"> & {\n /** What it draws (« Activité par résultat »). */\n title: string;\n /** The days, oldest first. */\n days: readonly UsageDay[];\n /** The outcomes stacked in each bar, bottom first. */\n outcomes: readonly UsageOutcome[];\n /** Said when there is nothing in the period. */\n emptyLabel: string;\n /** The text version's column headings: the day, the total. */\n columns: { day: string; total: string };\n /** The data is on its way: a skeleton keeps the height. */\n loading?: boolean;\n /** Default `fr-CA`. */\n locale?: string;\n};\n\nfunction Column({ bar, outcomes }: { bar: UsageBar; outcomes: readonly UsageOutcome[] }) {\n const s = usage();\n return (\n <div className={s.column()}>\n <div className={s.bar()} style={{ height: `${bar.height * 100}%` }}>\n {bar.segments.map((seg, i) =>\n seg.value > 0 ? <span key={seg.id} className={FILL[outcomes[i]?.tone ?? \"muted\"]} style={{ height: `${seg.share * 100}%` }} /> : null,\n )}\n </div>\n </div>\n );\n}\n\n/** The activity of the period, one bar per day stacked by outcome — with its legend and its text version (a table). */\nexport function UsageChart({ title, days, outcomes, emptyLabel, columns, loading, locale = \"fr-CA\", className, ...props }: UsageChartProps) {\n const s = usage();\n const bars = usageBars(days, outcomes);\n const sum = (id: string) => days.reduce((n, d) => n + (d.values[id] ?? 0), 0);\n const empty = bars.every((b) => b.total === 0);\n const write = (n: number) => formatNumber(n, { locale });\n return (\n <figure aria-busy={loading || undefined} className={s.chart({ className })} {...props}>\n <figcaption className={s.chartTitle()}>{title}</figcaption>\n {loading ? (\n <div className={s.skeleton()} />\n ) : empty ? (\n <p className={s.state()}>{emptyLabel}</p>\n ) : (\n <>\n <div aria-hidden className={s.plot()}>\n {bars.map((bar) => (\n <Column key={bar.label} bar={bar} outcomes={outcomes} />\n ))}\n </div>\n <ul className={s.legend()}>\n {outcomes.map((o) => (\n <li key={o.id}>\n <span aria-hidden className={s.swatch({ tone: o.tone })} />\n {o.label} <span className=\"tabular-nums text-fg\">{write(sum(o.id))}</span>\n </li>\n ))}\n </ul>\n <table className=\"sr-only\">\n <caption>{title}</caption>\n <thead>\n <tr>\n <th scope=\"col\">{columns.day}</th>\n {outcomes.map((o) => (\n <th key={o.id} scope=\"col\">\n {o.label}\n </th>\n ))}\n <th scope=\"col\">{columns.total}</th>\n </tr>\n </thead>\n <tbody>\n {days.map((d, i) => (\n <tr key={d.label}>\n <th scope=\"row\">{d.label}</th>\n {outcomes.map((o) => (\n <td key={o.id}>{write(d.values[o.id] ?? 0)}</td>\n ))}\n <td>{write(bars[i]?.total ?? 0)}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </>\n )}\n </figure>\n );\n}\n"
322
+ }
323
+ ],
324
+ "dependencies": [
325
+ "@krizaka/intl@^0.4.1",
326
+ "tailwind-variants@^3.3.1"
327
+ ],
328
+ "registryDependencies": [
329
+ "meter",
330
+ "stat"
331
+ ],
332
+ "demo": {
333
+ "path": "examples/usage/credits-page.tsx",
334
+ "content": "import { CreditsMeter, PeriodSwitch, UsageChart, UsageTiles } from \"@krizaka/ui/usage\";\n\nconst spark = (data: number[]) => (\n <svg viewBox=\"0 0 64 18\" width={64} height={18} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" aria-hidden>\n <polyline points={data.map((v, i) => `${(i * 64) / (data.length - 1)},${17 - v}`).join(\" \")} />\n </svg>\n);\nconst days = [\n { label: \"1 nov.\", values: { done: 8, flagged: 2, failed: 0 } },\n { label: \"2 nov.\", values: { done: 11, flagged: 1, failed: 1 } },\n { label: \"3 nov.\", values: { done: 6, flagged: 3, failed: 0 } },\n];\n\n// A « Credits & usage » page in French (the default), demo data. A `Sparkline` of @krizaka/charts goes in `chart`; a line stands in.\nexport default function CreditsPage() {\n const period = <PeriodSwitch label=\"Période\" value={30} href=\"/credits\" />;\n return (\n <div className=\"flex w-full max-w-2xl flex-col gap-4\">\n <CreditsMeter label=\"Crédits\" balance={820} total={1000} renewal=\"Renouvelés le 1er décembre\" action={<a href=\"/credits/acheter\">Acheter des crédits</a>} />\n <UsageTiles\n period={period}\n tiles={[\n { id: \"runs\", label: \"Vérifications\", value: 128, previous: 114, chart: spark([4, 6, 5, 8, 9, 12]) },\n { id: \"flagged\", label: \"Signalées\", value: 8, previous: 10, good: \"down\", chart: spark([3, 2, 2, 1, 1, 1]) },\n { id: \"credits\", label: \"Crédits utilisés\", value: 180, previous: 180, chart: spark([3, 3, 3, 3, 3, 3]) },\n ]}\n />\n <UsageChart\n title=\"Activité par résultat\"\n days={days}\n columns={{ day: \"Jour\", total: \"Total\" }} emptyLabel=\"Aucune activité sur cette période.\"\n outcomes={[\n { id: \"done\", label: \"Terminées\", tone: \"success\" },\n { id: \"flagged\", label: \"Signalées\", tone: \"warning\" },\n { id: \"failed\", label: \"Échouées\", tone: \"danger\" },\n ]}\n />\n </div>\n );\n}\n"
335
+ },
336
+ "props": [
337
+ {
338
+ "component": "USAGE_PERIODS",
339
+ "description": "The periods a usage page offers, in days.",
340
+ "props": []
341
+ },
342
+ {
343
+ "component": "CreditsMeter",
344
+ "description": "The balance: the figure large, a meter that turns to warning then danger as it runs low, the renewal and the way to buy.",
345
+ "props": [
346
+ {
347
+ "name": "balance",
348
+ "type": "number",
349
+ "default": null,
350
+ "description": "Credits left.",
351
+ "required": true
352
+ },
353
+ {
354
+ "name": "label",
355
+ "type": "string",
356
+ "default": null,
357
+ "description": "What the balance is (« Crédits »): the heading and the meter's name.",
358
+ "required": true
359
+ },
360
+ {
361
+ "name": "total",
362
+ "type": "number",
363
+ "default": null,
364
+ "description": "The allowance of the period; the meter fills with what is left.",
365
+ "required": true
366
+ },
367
+ {
368
+ "name": "action",
369
+ "type": "ReactNode",
370
+ "default": null,
371
+ "description": "The way to buy more: a link or a button.",
372
+ "required": false
373
+ },
374
+ {
375
+ "name": "locale",
376
+ "type": "string",
377
+ "default": "fr-CA",
378
+ "description": "Default `fr-CA`.",
379
+ "required": false
380
+ },
381
+ {
382
+ "name": "renewal",
383
+ "type": "ReactNode",
384
+ "default": null,
385
+ "description": "The renewal, written by the app (« Renouvelés le 1er novembre »).",
386
+ "required": false
387
+ }
388
+ ]
389
+ },
390
+ {
391
+ "component": "PeriodSwitch",
392
+ "description": "7 · 30 · 90 d: links, so the address holds the period (`?period=30`) and the server renders it.",
393
+ "props": [
394
+ {
395
+ "name": "href",
396
+ "type": "string",
397
+ "default": null,
398
+ "description": "The page's path (and any other parameters); each period is a link to it with `?period=`.",
399
+ "required": true
400
+ },
401
+ {
402
+ "name": "label",
403
+ "type": "string",
404
+ "default": null,
405
+ "description": "The accessible name (« Période »).",
406
+ "required": true
407
+ },
408
+ {
409
+ "name": "value",
410
+ "type": "number",
411
+ "default": null,
412
+ "description": "The period shown, from `parsePeriod(searchParams.period)`.",
413
+ "required": true
414
+ },
415
+ {
416
+ "name": "linkAs",
417
+ "type": "LinkComponent",
418
+ "default": null,
419
+ "description": "The app's router link (Next's `Link`); default a plain `<a>`.",
420
+ "required": false
421
+ },
422
+ {
423
+ "name": "locale",
424
+ "type": "string",
425
+ "default": "fr-CA",
426
+ "description": "Default `fr-CA`.",
427
+ "required": false
428
+ },
429
+ {
430
+ "name": "param",
431
+ "type": "string",
432
+ "default": "period",
433
+ "description": "The query parameter. Default `period`.",
434
+ "required": false
435
+ },
436
+ {
437
+ "name": "periodLabel",
438
+ "type": "((days: number) => string)",
439
+ "default": null,
440
+ "description": "The text of a period. Default `7 j` (`7 d` for an English locale).",
441
+ "required": false
442
+ },
443
+ {
444
+ "name": "periods",
445
+ "type": "readonly number[]",
446
+ "default": "[7, 30, 90] as const",
447
+ "description": "The periods offered, in days. Default 7 · 30 · 90.",
448
+ "required": false
449
+ }
450
+ ]
451
+ },
452
+ {
453
+ "component": "UsageChart",
454
+ "description": "The activity of the period, one bar per day stacked by outcome — with its legend and its text version (a table).",
455
+ "props": [
456
+ {
457
+ "name": "columns",
458
+ "type": "{ day: string; total: string; }",
459
+ "default": null,
460
+ "description": "The text version's column headings: the day, the total.",
461
+ "required": true
462
+ },
463
+ {
464
+ "name": "days",
465
+ "type": "readonly UsageDay[]",
466
+ "default": null,
467
+ "description": "The days, oldest first.",
468
+ "required": true
469
+ },
470
+ {
471
+ "name": "emptyLabel",
472
+ "type": "string",
473
+ "default": null,
474
+ "description": "Said when there is nothing in the period.",
475
+ "required": true
476
+ },
477
+ {
478
+ "name": "outcomes",
479
+ "type": "readonly UsageOutcome[]",
480
+ "default": null,
481
+ "description": "The outcomes stacked in each bar, bottom first.",
482
+ "required": true
483
+ },
484
+ {
485
+ "name": "loading",
486
+ "type": "boolean",
487
+ "default": null,
488
+ "description": "The data is on its way: a skeleton keeps the height.",
489
+ "required": false
490
+ },
491
+ {
492
+ "name": "locale",
493
+ "type": "string",
494
+ "default": "fr-CA",
495
+ "description": "Default `fr-CA`.",
496
+ "required": false
497
+ }
498
+ ]
499
+ },
500
+ {
501
+ "component": "UsageTiles",
502
+ "description": "The figures of the period on the strip, each compared with the previous period in words.",
503
+ "props": [
504
+ {
505
+ "name": "tiles",
506
+ "type": "readonly UsageTileInput[]",
507
+ "default": null,
508
+ "description": "2 to 4 figures.",
509
+ "required": true
510
+ },
511
+ {
512
+ "name": "loading",
513
+ "type": "boolean",
514
+ "default": null,
515
+ "description": "The data is on its way: the row keeps its height.",
516
+ "required": false
517
+ },
518
+ {
519
+ "name": "locale",
520
+ "type": "string",
521
+ "default": null,
522
+ "description": "The language of the figures and the words. Default `fr-CA`.",
523
+ "required": false
524
+ },
525
+ {
526
+ "name": "period",
527
+ "type": "ReactNode",
528
+ "default": null,
529
+ "description": "The period switch, above the row.",
530
+ "required": false
531
+ },
532
+ {
533
+ "name": "words",
534
+ "type": "Partial<UsageWords>",
535
+ "default": null,
536
+ "description": "Your own words for the change: `{change}` is the percentage.",
537
+ "required": false
538
+ }
539
+ ]
540
+ }
541
+ ]
542
+ }