@krizaka/ui 3.63.0 → 3.64.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 (406) hide show
  1. package/dist/account-menu.d.ts +1 -1
  2. package/dist/account-menu.js +1 -1
  3. package/dist/account-settings.d.ts +61 -4
  4. package/dist/account-settings.js +207 -45
  5. package/dist/account-settings.js.map +1 -1
  6. package/dist/action-bar.js +4 -4
  7. package/dist/analysis-report.d.ts +274 -0
  8. package/dist/analysis-report.js +207 -0
  9. package/dist/analysis-report.js.map +1 -0
  10. package/dist/app-header.d.ts +3 -3
  11. package/dist/argument-card.d.ts +1 -1
  12. package/dist/argument-card.js +5 -5
  13. package/dist/avatar/defaults.d.ts +16 -5
  14. package/dist/avatar/defaults.js +15 -1
  15. package/dist/avatar/defaults.js.map +1 -1
  16. package/dist/{avatar-BL2iG_Js.d.ts → avatar-BdZcfkWR.d.ts} +11 -4
  17. package/dist/avatar.d.ts +16 -5
  18. package/dist/avatar.js +15 -1
  19. package/dist/avatar.js.map +1 -1
  20. package/dist/badge.js +4 -34
  21. package/dist/badge.js.map +1 -1
  22. package/dist/blocks.css +99 -8
  23. package/dist/button.js +1 -1
  24. package/dist/captcha.js +1 -1
  25. package/dist/chat.js +1 -1
  26. package/dist/chunk-5PFCELGW.js +41 -0
  27. package/dist/chunk-5PFCELGW.js.map +1 -0
  28. package/dist/chunk-5RWHDX5J.js +37 -0
  29. package/dist/chunk-5RWHDX5J.js.map +1 -0
  30. package/dist/{chunk-5LANVCK7.js → chunk-BG5APGX6.js} +2 -2
  31. package/dist/{chunk-WOZP3JLW.js → chunk-DJ5ZPPWL.js} +1 -1
  32. package/dist/chunk-DJ5ZPPWL.js.map +1 -0
  33. package/dist/{chunk-UV4HBVH7.js → chunk-EB45EVPJ.js} +2 -2
  34. package/dist/{chunk-SJS6RJIT.js.map → chunk-EB45EVPJ.js.map} +1 -1
  35. package/dist/chunk-EUJ7337V.js +137 -0
  36. package/dist/chunk-EUJ7337V.js.map +1 -0
  37. package/dist/{chunk-6EAHUURY.js → chunk-GHAN7OOE.js} +2 -2
  38. package/dist/chunk-HK525THY.js +139 -0
  39. package/dist/chunk-HK525THY.js.map +1 -0
  40. package/dist/chunk-JT7ZKZT5.js +1 -0
  41. package/dist/chunk-JT7ZKZT5.js.map +1 -0
  42. package/dist/{chunk-3DHNN5V7.js → chunk-M3GEYLMR.js} +2 -2
  43. package/dist/{chunk-3DHNN5V7.js.map → chunk-M3GEYLMR.js.map} +1 -1
  44. package/dist/{chunk-7J2L4HOD.js → chunk-MTVX4RRF.js} +2 -2
  45. package/dist/{chunk-7J2L4HOD.js.map → chunk-MTVX4RRF.js.map} +1 -1
  46. package/dist/{chunk-YKEIOYJ5.js → chunk-NPMGYLJV.js} +1 -1
  47. package/dist/chunk-NPMGYLJV.js.map +1 -0
  48. package/dist/{chunk-HEKDKM5Y.js → chunk-QVHSV6RA.js} +1 -1
  49. package/dist/{chunk-7JG3VR4C.js → chunk-RCKXJEDQ.js} +5 -5
  50. package/dist/{chunk-3D2YI63L.js → chunk-SHBYNQFS.js} +7 -2
  51. package/dist/{chunk-3D2YI63L.js.map → chunk-SHBYNQFS.js.map} +1 -1
  52. package/dist/chunk-U4XTZMB7.js +103 -0
  53. package/dist/chunk-U4XTZMB7.js.map +1 -0
  54. package/dist/{chunk-SJS6RJIT.js → chunk-V7W4RLRW.js} +2 -2
  55. package/dist/{chunk-UV4HBVH7.js.map → chunk-V7W4RLRW.js.map} +1 -1
  56. package/dist/command.js +2 -2
  57. package/dist/confirm-button.js +1 -1
  58. package/dist/continue-prompt.js +1 -1
  59. package/dist/continue-prompt.js.map +1 -1
  60. package/dist/cover-hero.js +1 -1
  61. package/dist/dashboard-layout.js +2 -1
  62. package/dist/dashboard-layout.js.map +1 -1
  63. package/dist/data-table.js +2 -2
  64. package/dist/date-picker.d.ts +15 -15
  65. package/dist/dialog.js +2 -2
  66. package/dist/docs-layout.js +1 -1
  67. package/dist/embed-facade.d.ts +37 -0
  68. package/dist/embed-facade.js +96 -0
  69. package/dist/embed-facade.js.map +1 -0
  70. package/dist/file-upload.d.ts +2 -2
  71. package/dist/force-update-screen.js +1 -1
  72. package/dist/genui.js +2 -2
  73. package/dist/kind-config-editor.js +1 -1
  74. package/dist/link-card.js +2 -2
  75. package/dist/maintenance-screen.js +1 -1
  76. package/dist/map.js +6 -0
  77. package/dist/map.js.map +1 -1
  78. package/dist/margin-layout.d.ts +71 -0
  79. package/dist/margin-layout.js +29 -0
  80. package/dist/margin-layout.js.map +1 -0
  81. package/dist/match-dialog.js +2 -2
  82. package/dist/media-grid.d.ts +8 -3
  83. package/dist/media-grid.js +2 -2
  84. package/dist/meter.js +2 -1
  85. package/dist/native/map.js +6 -0
  86. package/dist/native/map.js.map +1 -1
  87. package/dist/native.d.ts +96 -5
  88. package/dist/native.js +1718 -1529
  89. package/dist/native.js.map +1 -1
  90. package/dist/nav-bar.js +1 -1
  91. package/dist/page-DPHDmDAQ.d.ts +131 -0
  92. package/dist/page-hero.js +4 -4
  93. package/dist/page.d.ts +7 -125
  94. package/dist/page.js +13 -1
  95. package/dist/page.js.map +1 -1
  96. package/dist/quota-meter.js +2 -1
  97. package/dist/quota-meter.js.map +1 -1
  98. package/dist/retro-tv.d.ts +6 -3
  99. package/dist/retro-tv.js +6 -5
  100. package/dist/retro-tv.js.map +1 -1
  101. package/dist/reviews.d.ts +49 -0
  102. package/dist/reviews.js +66 -0
  103. package/dist/reviews.js.map +1 -0
  104. package/dist/separator.d.ts +26 -3
  105. package/dist/separator.js +19 -1
  106. package/dist/separator.js.map +1 -1
  107. package/dist/service-card.d.ts +56 -63
  108. package/dist/service-card.js +49 -10
  109. package/dist/service-card.js.map +1 -1
  110. package/dist/settings-layout.js +1 -1
  111. package/dist/site-cahier.js +1 -1
  112. package/dist/specimen-tag.d.ts +15 -3
  113. package/dist/specimen-tag.js +4 -27
  114. package/dist/specimen-tag.js.map +1 -1
  115. package/dist/stat.d.ts +87 -5
  116. package/dist/stat.js +9 -53
  117. package/dist/stat.js.map +1 -1
  118. package/dist/sticky-action.d.ts +7 -2
  119. package/dist/sticky-action.js +24 -3
  120. package/dist/sticky-action.js.map +1 -1
  121. package/dist/theme.js +1 -1
  122. package/dist/update-prompt.js +1 -1
  123. package/dist/usage.d.ts +229 -0
  124. package/dist/usage.js +189 -0
  125. package/dist/usage.js.map +1 -0
  126. package/dist/vertical-video.js +2 -2
  127. package/dist/wall.d.ts +24 -12
  128. package/dist/wall.js +106 -43
  129. package/dist/wall.js.map +1 -1
  130. package/package.json +92 -13
  131. package/registry/account-menu.json +1 -1
  132. package/registry/account-settings.json +67 -6
  133. package/registry/achievement.json +1 -1
  134. package/registry/action-bar.json +1 -1
  135. package/registry/activity-feed.json +1 -1
  136. package/registry/agenda.json +1 -1
  137. package/registry/alert.json +1 -1
  138. package/registry/analysis-report.json +445 -0
  139. package/registry/anatomy-plate.json +1 -1
  140. package/registry/app-header.json +1 -1
  141. package/registry/app-shell.json +1 -1
  142. package/registry/argument-card.json +3 -3
  143. package/registry/audio-player.json +1 -1
  144. package/registry/auth-layout.json +1 -1
  145. package/registry/avatar.json +6 -5
  146. package/registry/badge.json +1 -1
  147. package/registry/bird-plate.json +1 -1
  148. package/registry/button.json +2 -2
  149. package/registry/captcha.json +1 -1
  150. package/registry/card-grid.json +1 -1
  151. package/registry/card.json +1 -1
  152. package/registry/catalogue-page.json +1 -1
  153. package/registry/changelog-page.json +1 -1
  154. package/registry/chapter.json +1 -1
  155. package/registry/chat.json +1 -1
  156. package/registry/checkbox.json +1 -1
  157. package/registry/chip-link.json +1 -1
  158. package/registry/chip-row.json +1 -1
  159. package/registry/chip.json +1 -1
  160. package/registry/choice-grid.json +1 -1
  161. package/registry/code-block.json +1 -1
  162. package/registry/combobox.json +1 -1
  163. package/registry/command.json +1 -1
  164. package/registry/comparison-table.json +1 -1
  165. package/registry/component-page.json +1 -1
  166. package/registry/confirm-button.json +1 -1
  167. package/registry/contact-page.json +1 -1
  168. package/registry/continue-prompt.json +1 -1
  169. package/registry/countdown.json +1 -1
  170. package/registry/cover-hero.json +1 -1
  171. package/registry/cta-panel.json +1 -1
  172. package/registry/dashboard-layout.json +2 -2
  173. package/registry/data-table.json +1 -1
  174. package/registry/date-picker.json +1 -1
  175. package/registry/decision-list.json +1 -1
  176. package/registry/description-list.json +1 -1
  177. package/registry/detail-layout.json +1 -1
  178. package/registry/dialog.json +1 -1
  179. package/registry/docs-article-page.json +1 -1
  180. package/registry/docs-hub-page.json +1 -1
  181. package/registry/docs-layout.json +1 -1
  182. package/registry/docs-nav.json +1 -1
  183. package/registry/document-viewer.json +1 -1
  184. package/registry/doodle.json +1 -1
  185. package/registry/drop-overlay.json +1 -1
  186. package/registry/dropdown-menu.json +1 -1
  187. package/registry/elephant.json +2 -2
  188. package/registry/embed-facade.json +243 -0
  189. package/registry/empty-state.json +1 -1
  190. package/registry/engine-flow.json +1 -1
  191. package/registry/environment-notice.json +1 -1
  192. package/registry/error-page.json +1 -1
  193. package/registry/examples/account-settings/avatar-picker-folder.d.ts +4 -0
  194. package/registry/examples/account-settings/avatar-picker-folder.js +27 -0
  195. package/registry/examples/account-settings/avatar-picker-folder.tsx +23 -0
  196. package/registry/examples/analysis-report/document-validation.d.ts +4 -0
  197. package/registry/examples/analysis-report/document-validation.js +47 -0
  198. package/registry/examples/analysis-report/document-validation.tsx +29 -0
  199. package/registry/examples/analysis-report/native/document-validation.d.ts +4 -0
  200. package/registry/examples/analysis-report/native/document-validation.dark.png +0 -0
  201. package/registry/examples/analysis-report/native/document-validation.js +48 -0
  202. package/registry/examples/analysis-report/native/document-validation.light.png +0 -0
  203. package/registry/examples/analysis-report/native/document-validation.tsx +32 -0
  204. package/registry/examples/analysis-report/streaming.d.ts +4 -0
  205. package/registry/examples/analysis-report/streaming.js +42 -0
  206. package/registry/examples/analysis-report/streaming.tsx +23 -0
  207. package/registry/examples/embed-facade/tiktok.d.ts +4 -0
  208. package/registry/examples/embed-facade/tiktok.js +20 -0
  209. package/registry/examples/embed-facade/tiktok.tsx +16 -0
  210. package/registry/examples/embed-facade/youtube.d.ts +4 -0
  211. package/registry/examples/embed-facade/youtube.js +22 -0
  212. package/registry/examples/embed-facade/youtube.tsx +20 -0
  213. package/registry/examples/margin-layout/findings.d.ts +4 -0
  214. package/registry/examples/margin-layout/findings.js +15 -0
  215. package/registry/examples/margin-layout/findings.tsx +18 -0
  216. package/registry/examples/margin-layout/steps.d.ts +4 -0
  217. package/registry/examples/margin-layout/steps.js +15 -0
  218. package/registry/examples/margin-layout/steps.tsx +16 -0
  219. package/registry/examples/page/kraft.d.ts +4 -0
  220. package/registry/examples/page/kraft.js +14 -0
  221. package/registry/examples/page/kraft.tsx +12 -0
  222. package/registry/examples/page/papers.d.ts +4 -0
  223. package/registry/examples/page/papers.js +14 -0
  224. package/registry/examples/page/papers.tsx +13 -0
  225. package/registry/examples/retro-tv/facade.d.ts +4 -0
  226. package/registry/examples/retro-tv/facade.js +12 -0
  227. package/registry/examples/retro-tv/facade.tsx +13 -0
  228. package/registry/examples/reviews/card.d.ts +4 -0
  229. package/registry/examples/reviews/card.js +23 -0
  230. package/registry/examples/reviews/card.tsx +19 -0
  231. package/registry/examples/reviews/summary.d.ts +4 -0
  232. package/registry/examples/reviews/summary.js +23 -0
  233. package/registry/examples/reviews/summary.tsx +17 -0
  234. package/registry/examples/separator/hand.d.ts +4 -0
  235. package/registry/examples/separator/hand.js +19 -0
  236. package/registry/examples/separator/hand.tsx +16 -0
  237. package/registry/examples/service-card/index-card.d.ts +4 -0
  238. package/registry/examples/service-card/index-card.js +15 -0
  239. package/registry/examples/service-card/index-card.tsx +12 -0
  240. package/registry/examples/service-card/index-list.d.ts +4 -0
  241. package/registry/examples/service-card/index-list.js +14 -0
  242. package/registry/examples/service-card/index-list.tsx +11 -0
  243. package/registry/examples/specimen-tag/facts.d.ts +4 -0
  244. package/registry/examples/specimen-tag/facts.js +23 -0
  245. package/registry/examples/specimen-tag/facts.tsx +18 -0
  246. package/registry/examples/stat/strip.d.ts +4 -0
  247. package/registry/examples/stat/strip.js +25 -0
  248. package/registry/examples/stat/strip.tsx +25 -0
  249. package/registry/examples/sticky-action/hide-while-visible.d.ts +4 -0
  250. package/registry/examples/sticky-action/hide-while-visible.js +16 -0
  251. package/registry/examples/sticky-action/hide-while-visible.tsx +17 -0
  252. package/registry/examples/usage/credits-page.d.ts +4 -0
  253. package/registry/examples/usage/credits-page.js +45 -0
  254. package/registry/examples/usage/credits-page.tsx +40 -0
  255. package/registry/examples/usage/empty.d.ts +4 -0
  256. package/registry/examples/usage/empty.js +15 -0
  257. package/registry/examples/usage/empty.tsx +12 -0
  258. package/registry/examples/wall/brick.js +1 -1
  259. package/registry/examples/wall/brick.tsx +1 -1
  260. package/registry/examples/wall/composition-fr.js +1 -1
  261. package/registry/examples/wall/composition-fr.tsx +1 -1
  262. package/registry/examples/wall/composition.js +1 -1
  263. package/registry/examples/wall/composition.tsx +1 -1
  264. package/registry/examples/wall/pinned-note.js +2 -2
  265. package/registry/examples/wall/pinned-note.tsx +3 -2
  266. package/registry/examples/wall/plaster.js +1 -1
  267. package/registry/examples/wall/plaster.tsx +1 -1
  268. package/registry/examples/wall/ridge.js +1 -1
  269. package/registry/examples/wall/ridge.tsx +1 -1
  270. package/registry/examples/wall/shop-sign.js +5 -4
  271. package/registry/examples/wall/shop-sign.tsx +7 -4
  272. package/registry/examples/wall/zellige.js +1 -1
  273. package/registry/examples/wall/zellige.tsx +1 -1
  274. package/registry/field.json +1 -1
  275. package/registry/file-upload.json +1 -1
  276. package/registry/filter-bar.json +1 -1
  277. package/registry/flock.json +1 -1
  278. package/registry/footnote.json +1 -1
  279. package/registry/force-update-screen.json +1 -1
  280. package/registry/form.json +1 -1
  281. package/registry/gallery-page.json +1 -1
  282. package/registry/genui.json +1 -1
  283. package/registry/glossary-term.json +1 -1
  284. package/registry/glossary.json +1 -1
  285. package/registry/glow-card.json +1 -1
  286. package/registry/goal-gauge.json +1 -1
  287. package/registry/grade-stamp.json +1 -1
  288. package/registry/how-it-works-page.json +1 -1
  289. package/registry/image-cropper.json +1 -1
  290. package/registry/index.json +186 -18
  291. package/registry/iso.json +1 -1
  292. package/registry/kanban.json +1 -1
  293. package/registry/kbd.json +1 -1
  294. package/registry/kind-config-editor.json +1 -1
  295. package/registry/kpi-explained.json +1 -1
  296. package/registry/landing-page.json +1 -1
  297. package/registry/landscape.json +1 -1
  298. package/registry/language-switch.json +1 -1
  299. package/registry/legal-page.json +1 -1
  300. package/registry/link-card.json +1 -1
  301. package/registry/list.json +1 -1
  302. package/registry/loader.json +1 -1
  303. package/registry/longform-page.json +1 -1
  304. package/registry/maintenance-screen.json +1 -1
  305. package/registry/map.json +2 -2
  306. package/registry/margin-layout.json +200 -0
  307. package/registry/markdown.json +1 -1
  308. package/registry/marketing-layout.json +1 -1
  309. package/registry/marquee.json +1 -1
  310. package/registry/mascot-quote.json +1 -1
  311. package/registry/mascot-state.json +1 -1
  312. package/registry/mascots.json +1 -1
  313. package/registry/match-dialog.json +1 -1
  314. package/registry/media-capture.json +1 -1
  315. package/registry/media-gallery.json +1 -1
  316. package/registry/media-grid.json +1 -1
  317. package/registry/meta-row.json +1 -1
  318. package/registry/meter.json +1 -1
  319. package/registry/nav-bar.json +2 -2
  320. package/registry/next-actions.json +1 -1
  321. package/registry/notification-preferences.json +1 -1
  322. package/registry/number-ticker.json +1 -1
  323. package/registry/opening-hours.json +1 -1
  324. package/registry/page-header.json +1 -1
  325. package/registry/page-hero.json +1 -1
  326. package/registry/page-index.json +1 -1
  327. package/registry/page.json +53 -11
  328. package/registry/pagination.json +1 -1
  329. package/registry/photo-grid.json +1 -1
  330. package/registry/pointer-light.json +1 -1
  331. package/registry/popover.json +1 -1
  332. package/registry/pricing-page.json +1 -1
  333. package/registry/product-page.json +1 -1
  334. package/registry/profile-card.json +1 -1
  335. package/registry/progress.json +1 -1
  336. package/registry/promise-card.json +1 -1
  337. package/registry/quota-meter.json +1 -1
  338. package/registry/radio-group.json +1 -1
  339. package/registry/rail-nav.json +2 -2
  340. package/registry/recipes.json +1 -1
  341. package/registry/retro-tv.json +45 -29
  342. package/registry/reviews.json +361 -0
  343. package/registry/router.json +1 -1
  344. package/registry/scroll-stage.json +1 -1
  345. package/registry/search-field.json +1 -1
  346. package/registry/section-backdrop.json +1 -1
  347. package/registry/separator.json +71 -6
  348. package/registry/service-card.json +55 -6
  349. package/registry/settings-layout.json +1 -1
  350. package/registry/showcase.json +1 -1
  351. package/registry/signature.json +1 -1
  352. package/registry/site-cahier.json +1 -1
  353. package/registry/site-footer.json +2 -2
  354. package/registry/sites.json +1 -1
  355. package/registry/skeleton.json +1 -1
  356. package/registry/skip-link.json +1 -1
  357. package/registry/slider.json +1 -1
  358. package/registry/slot-picker.json +1 -1
  359. package/registry/slot.json +1 -1
  360. package/registry/specimen-tag.json +57 -5
  361. package/registry/speed-lines.json +1 -1
  362. package/registry/spinner.json +1 -1
  363. package/registry/split-view.json +1 -1
  364. package/registry/stage-banner.json +1 -1
  365. package/registry/stat.json +61 -9
  366. package/registry/status-chip.json +1 -1
  367. package/registry/status-page.json +1 -1
  368. package/registry/step-progress.json +1 -1
  369. package/registry/step-showcase.json +1 -1
  370. package/registry/stepper.json +1 -1
  371. package/registry/sticky-action.json +27 -4
  372. package/registry/stuck.json +1 -1
  373. package/registry/swipe-deck.json +1 -1
  374. package/registry/switch.json +1 -1
  375. package/registry/tabs.json +1 -1
  376. package/registry/tag-input.json +1 -1
  377. package/registry/tag-selector.json +1 -1
  378. package/registry/taped-photo.json +1 -1
  379. package/registry/terminal-replay.json +1 -1
  380. package/registry/text-style.json +1 -1
  381. package/registry/theme.json +1 -1
  382. package/registry/toast.json +1 -1
  383. package/registry/toc.json +1 -1
  384. package/registry/tooltip.json +1 -1
  385. package/registry/tree-view.json +1 -1
  386. package/registry/update-prompt.json +1 -1
  387. package/registry/upload-queue.json +1 -1
  388. package/registry/usage.json +542 -0
  389. package/registry/verified-badge.json +1 -1
  390. package/registry/versus-card.json +1 -1
  391. package/registry/vertical-video.json +1 -1
  392. package/registry/video-player.json +1 -1
  393. package/registry/video-trimmer.json +3 -3
  394. package/registry/virtual.json +1 -1
  395. package/registry/wall.json +128 -40
  396. package/registry/waveform.json +1 -1
  397. package/dist/chunk-7AZ23BUX.js +0 -88
  398. package/dist/chunk-7AZ23BUX.js.map +0 -1
  399. package/dist/chunk-PW2FVPTV.js +0 -85
  400. package/dist/chunk-PW2FVPTV.js.map +0 -1
  401. package/dist/chunk-WOZP3JLW.js.map +0 -1
  402. package/dist/chunk-YKEIOYJ5.js.map +0 -1
  403. /package/dist/{chunk-5LANVCK7.js.map → chunk-BG5APGX6.js.map} +0 -0
  404. /package/dist/{chunk-6EAHUURY.js.map → chunk-GHAN7OOE.js.map} +0 -0
  405. /package/dist/{chunk-HEKDKM5Y.js.map → chunk-QVHSV6RA.js.map} +0 -0
  406. /package/dist/{chunk-7JG3VR4C.js.map → chunk-RCKXJEDQ.js.map} +0 -0
package/dist/stat.d.ts CHANGED
@@ -94,14 +94,96 @@ declare const statGrid: tailwind_variants.TVReturnType<{
94
94
  false: "gap-6 p-5";
95
95
  };
96
96
  }, undefined>>;
97
- type StatGridProps = React.ComponentProps<"div"> & {
97
+ type StatGridCommonProps = Omit<React.ComponentProps<"div">, "children">;
98
+ type StatGridDefaultProps = React.ComponentProps<"div"> & {
99
+ /** `grid` (default): figures that wrap, hairlines between them. */
100
+ variant?: "grid";
98
101
  /** Hairlines between the stats (default) or space only. */
99
102
  divided?: boolean;
100
103
  /** The narrowest a stat may be before the row wraps, in rem. Default 11. */
101
104
  minWidth?: number;
102
105
  };
103
- /** A row of key figures that wraps with the width: a dashboard's head. The stats are its children. */
104
- declare function StatGrid({ divided, minWidth, className, style, ...props }: StatGridProps): React.JSX.Element;
106
+ /** One figure of the strip. */
107
+ type StatStripItem = {
108
+ id: string;
109
+ /** What the figure is; truncated in the strip, its full text stays the item's `title`. */
110
+ label: string;
111
+ value: React.ReactNode;
112
+ trend?: StatTrend;
113
+ /** The change in words ("+12 % vs the previous 30 d"). */
114
+ trendLabel?: React.ReactNode;
115
+ /** A `Sparkline` of @krizaka/charts (64 × 18). */
116
+ chart?: React.ReactNode;
117
+ };
118
+ type StatStripProps = StatGridCommonProps & {
119
+ /** `strip`: the discreet row, 2 to 4 figures with their sparkline, as a description list. */
120
+ variant: "strip";
121
+ /** 2 to 4 figures, in one row from 320 px. */
122
+ items: readonly StatStripItem[];
123
+ /** The period switch (7 · 30 · 90 d), above the row. */
124
+ period?: React.ReactNode;
125
+ };
126
+ type StatGridProps = StatGridDefaultProps | StatStripProps;
127
+ declare const statStrip: tailwind_variants.TVReturnType<{
128
+ trend: {
129
+ up: {
130
+ trend: string;
131
+ };
132
+ down: {
133
+ trend: string;
134
+ };
135
+ flat: {};
136
+ };
137
+ }, {
138
+ root: string;
139
+ list: string;
140
+ item: string;
141
+ label: string;
142
+ value: string;
143
+ trend: string;
144
+ chart: string;
145
+ }, undefined, {
146
+ trend: {
147
+ up: {
148
+ trend: string;
149
+ };
150
+ down: {
151
+ trend: string;
152
+ };
153
+ flat: {};
154
+ };
155
+ }, {
156
+ root: string;
157
+ list: string;
158
+ item: string;
159
+ label: string;
160
+ value: string;
161
+ trend: string;
162
+ chart: string;
163
+ }, tailwind_variants.TVReturnTypeLike<{
164
+ trend: {
165
+ up: {
166
+ trend: string;
167
+ };
168
+ down: {
169
+ trend: string;
170
+ };
171
+ flat: {};
172
+ };
173
+ }, {
174
+ root: string;
175
+ list: string;
176
+ item: string;
177
+ label: string;
178
+ value: string;
179
+ trend: string;
180
+ chart: string;
181
+ }>>;
182
+ /**
183
+ * A row of key figures. The default grid wraps with the width (a dashboard's head, the stats are its children);
184
+ * `variant="strip"` is the discreet one: 2 to 4 figures in one row, as a `dl`, each with its sparkline and its trend in words.
185
+ */
186
+ declare function StatGrid(props: StatGridProps): React.JSX.Element;
105
187
 
106
- export { Stat, StatGrid, stat, statGrid };
107
- export type { StatGridProps, StatProps, StatTrend };
188
+ export { Stat, StatGrid, stat, statGrid, statStrip };
189
+ export type { StatGridProps, StatProps, StatStripItem, StatStripProps, StatTrend };
package/dist/stat.js CHANGED
@@ -1,59 +1,15 @@
1
- // src/stat/stat.tsx
2
- import { tv } from "tailwind-variants";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- var stat = tv({
5
- slots: {
6
- root: "flex min-w-0 flex-col gap-1",
7
- label: "text-xs font-semibold text-fg-secondary",
8
- value: "kz-stat-value font-display text-2xl font-black tabular-nums text-fg",
9
- meta: "flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",
10
- // The status tokens are too light for small text on a light surface: the words stay a text role, the arrow carries
11
- // the direction's colour.
12
- trend: "inline-flex items-center gap-1 font-semibold text-fg [&>svg]:h-3.5 [&>svg]:w-3.5 [&>svg]:shrink-0",
13
- hint: "text-fg-secondary",
14
- chart: "mt-2 h-10 w-full min-w-0"
15
- },
16
- variants: {
17
- trend: {
18
- up: { trend: "[&>svg]:text-success" },
19
- down: { trend: "[&>svg]:text-danger" },
20
- flat: { trend: "[&>svg]:text-fg-secondary" }
21
- }
22
- }
23
- });
24
- var ARROW = { up: "M7 17 17 7M8 7h9v9", down: "M7 7l10 10M17 8v9H8", flat: "M5 12h14M13 6l6 6-6 6" };
25
- function Stat({ label, value, hint, trend, trendLabel, chart, className, ...props }) {
26
- const s = stat({ trend });
27
- return /* @__PURE__ */ jsxs("div", { "data-trend": trend, className: s.root({ className }), ...props, children: [
28
- /* @__PURE__ */ jsx("p", { className: s.label(), children: label }),
29
- /* @__PURE__ */ jsx("p", { className: s.value(), children: value }),
30
- (trendLabel || hint) && /* @__PURE__ */ jsxs("p", { className: s.meta(), children: [
31
- trend && trendLabel && /* @__PURE__ */ jsxs("span", { className: s.trend(), children: [
32
- /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: ARROW[trend] }) }),
33
- trendLabel
34
- ] }),
35
- hint && /* @__PURE__ */ jsx("span", { className: s.hint(), children: hint })
36
- ] }),
37
- chart ? /* @__PURE__ */ jsx("div", { className: s.chart(), children: chart }) : null
38
- ] });
39
- }
40
- var statGrid = tv({
41
- base: "grid w-full grid-cols-[repeat(auto-fit,minmax(var(--kz-stat-min,11rem),1fr))] overflow-hidden rounded-xl border border-border-default bg-surface-1",
42
- variants: {
43
- divided: {
44
- true: "gap-px bg-border-subtle [&>*]:bg-surface-1 [&>*]:p-5",
45
- false: "gap-6 p-5"
46
- }
47
- },
48
- defaultVariants: { divided: true }
49
- });
50
- function StatGrid({ divided, minWidth = 11, className, style, ...props }) {
51
- return /* @__PURE__ */ jsx("div", { className: statGrid({ divided, className }), style: { ...style, ["--kz-stat-min"]: `${minWidth}rem` }, ...props });
52
- }
1
+ import {
2
+ Stat,
3
+ StatGrid,
4
+ stat,
5
+ statGrid,
6
+ statStrip
7
+ } from "./chunk-U4XTZMB7.js";
53
8
  export {
54
9
  Stat,
55
10
  StatGrid,
56
11
  stat,
57
- statGrid
12
+ statGrid,
13
+ statStrip
58
14
  };
59
15
  //# sourceMappingURL=stat.js.map
package/dist/stat.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/stat/stat.tsx"],"sourcesContent":["// Server-safe. A key figure: a label, the value in tabular digits, a hint, a trend. Every word is a prop.\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const stat = tv({\n slots: {\n root: \"flex min-w-0 flex-col gap-1\",\n label: \"text-xs font-semibold text-fg-secondary\",\n value: \"kz-stat-value font-display text-2xl font-black tabular-nums text-fg\",\n meta: \"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs\",\n // The status tokens are too light for small text on a light surface: the words stay a text role, the arrow carries\n // the direction's colour.\n trend: \"inline-flex items-center gap-1 font-semibold text-fg [&>svg]:h-3.5 [&>svg]:w-3.5 [&>svg]:shrink-0\",\n hint: \"text-fg-secondary\",\n chart: \"mt-2 h-10 w-full min-w-0\",\n },\n variants: {\n trend: {\n up: { trend: \"[&>svg]:text-success\" },\n down: { trend: \"[&>svg]:text-danger\" },\n flat: { trend: \"[&>svg]:text-fg-secondary\" },\n },\n },\n});\n\nexport type StatTrend = \"up\" | \"down\" | \"flat\";\n\nconst ARROW: Record<StatTrend, string> = { up: \"M7 17 17 7M8 7h9v9\", down: \"M7 7l10 10M17 8v9H8\", flat: \"M5 12h14M13 6l6 6-6 6\" };\n\nexport type StatProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n /** What the figure is (\"Revenue\"), above it. */\n label: React.ReactNode;\n /** The figure, formatted by the app, in tabular digits. */\n value: React.ReactNode;\n /** A line under the value: the period, the comparison. */\n hint?: React.ReactNode;\n /** The direction of the change; its arrow is decorative. */\n trend?: StatTrend;\n /** The change, in words, as read and shown (e.g. \"+12 % vs last week\") — the arrow alone says nothing. */\n trendLabel?: React.ReactNode;\n /** Under the figure: a `Sparkline` of @krizaka/charts (its own accessible summary), a `Meter`. */\n chart?: React.ReactNode;\n};\n\nexport function Stat({ label, value, hint, trend, trendLabel, chart, className, ...props }: StatProps) {\n const s = stat({ trend });\n return (\n <div data-trend={trend} className={s.root({ className })} {...props}>\n <p className={s.label()}>{label}</p>\n <p className={s.value()}>{value}</p>\n {(trendLabel || hint) && (\n <p className={s.meta()}>\n {trend && trendLabel && (\n <span className={s.trend()}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d={ARROW[trend]} />\n </svg>\n {trendLabel}\n </span>\n )}\n {hint && <span className={s.hint()}>{hint}</span>}\n </p>\n )}\n {chart ? <div className={s.chart()}>{chart}</div> : null}\n </div>\n );\n}\n\nexport const statGrid = tv({\n base: \"grid w-full grid-cols-[repeat(auto-fit,minmax(var(--kz-stat-min,11rem),1fr))] overflow-hidden rounded-xl border border-border-default bg-surface-1\",\n variants: {\n divided: {\n true: \"gap-px bg-border-subtle [&>*]:bg-surface-1 [&>*]:p-5\",\n false: \"gap-6 p-5\",\n },\n },\n defaultVariants: { divided: true },\n});\n\nexport type StatGridProps = React.ComponentProps<\"div\"> & {\n /** Hairlines between the stats (default) or space only. */\n divided?: boolean;\n /** The narrowest a stat may be before the row wraps, in rem. Default 11. */\n minWidth?: number;\n};\n\n/** A row of key figures that wraps with the width: a dashboard's head. The stats are its children. */\nexport function StatGrid({ divided, minWidth = 11, className, style, ...props }: StatGridProps) {\n return <div className={statGrid({ divided, className })} style={{ ...style, [\"--kz-stat-min\" as string]: `${minWidth}rem` }} {...props} />;\n}\n"],"mappings":";AAEA,SAAS,UAAU;AA8Cb,cAKM,YALN;AA5CC,IAAM,OAAO,GAAG;AAAA,EACrB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA;AAAA;AAAA,IAGN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,MACL,IAAI,EAAE,OAAO,uBAAuB;AAAA,MACpC,MAAM,EAAE,OAAO,sBAAsB;AAAA,MACrC,MAAM,EAAE,OAAO,4BAA4B;AAAA,IAC7C;AAAA,EACF;AACF,CAAC;AAID,IAAM,QAAmC,EAAE,IAAI,sBAAsB,MAAM,uBAAuB,MAAM,wBAAwB;AAiBzH,SAAS,KAAK,EAAE,OAAO,OAAO,MAAM,OAAO,YAAY,OAAO,WAAW,GAAG,MAAM,GAAc;AACrG,QAAM,IAAI,KAAK,EAAE,MAAM,CAAC;AACxB,SACE,qBAAC,SAAI,cAAY,OAAO,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OAC5D;AAAA,wBAAC,OAAE,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,IAChC,oBAAC,OAAE,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,KAC9B,cAAc,SACd,qBAAC,OAAE,WAAW,EAAE,KAAK,GAClB;AAAA,eAAS,cACR,qBAAC,UAAK,WAAW,EAAE,MAAM,GACvB;AAAA,4BAAC,SAAI,SAAQ,aAAY,MAAK,QAAO,QAAO,gBAAe,aAAY,OAAM,eAAc,SAAQ,gBAAe,SAAQ,eAAW,MACnI,8BAAC,UAAK,GAAG,MAAM,KAAK,GAAG,GACzB;AAAA,QACC;AAAA,SACH;AAAA,MAED,QAAQ,oBAAC,UAAK,WAAW,EAAE,KAAK,GAAI,gBAAK;AAAA,OAC5C;AAAA,IAED,QAAQ,oBAAC,SAAI,WAAW,EAAE,MAAM,GAAI,iBAAM,IAAS;AAAA,KACtD;AAEJ;AAEO,IAAM,WAAW,GAAG;AAAA,EACzB,MAAM;AAAA,EACN,UAAU;AAAA,IACR,SAAS;AAAA,MACP,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,KAAK;AACnC,CAAC;AAUM,SAAS,SAAS,EAAE,SAAS,WAAW,IAAI,WAAW,OAAO,GAAG,MAAM,GAAkB;AAC9F,SAAO,oBAAC,SAAI,WAAW,SAAS,EAAE,SAAS,UAAU,CAAC,GAAG,OAAO,EAAE,GAAG,OAAO,CAAC,eAAyB,GAAG,GAAG,QAAQ,MAAM,GAAI,GAAG,OAAO;AAC1I;","names":[]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -6,7 +6,7 @@ declare const stickyAction: tailwind_variants.TVReturnType<{
6
6
  phone: "md:hidden";
7
7
  task: "";
8
8
  };
9
- }, undefined, "sticky bottom-0 z-30 border-t border-border-subtle bg-surface-1 px-4 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3", {
9
+ }, undefined, string, {
10
10
  mode: {
11
11
  phone: "md:hidden";
12
12
  task: "";
@@ -25,11 +25,16 @@ type StickyActionProps = React.ComponentProps<"div"> & {
25
25
  mode?: "phone" | "task";
26
26
  /** `task` only: what the action commits (`Total 1 250,00 $`), at the left of the action; stacked above it on a phone. */
27
27
  summary?: React.ReactNode;
28
+ /**
29
+ * A CSS selector of the page's own action (`#hero-book`): while it is on screen the bar is hidden, so a phone never shows
30
+ * two « Book » at once. The bar keeps its place (no layout shift), cannot be focused or pressed while hidden.
31
+ */
32
+ hideWhileVisible?: string;
28
33
  /** The action: one `ButtonLink` (full width is added on a phone). */
29
34
  children: React.ReactNode;
30
35
  };
31
36
  /** The one action of a page, held at the bottom edge of a phone — or, in `task` mode, of the form on every width. */
32
- declare function StickyAction({ mode, summary, className, children, ...props }: StickyActionProps): React.JSX.Element;
37
+ declare function StickyAction({ mode, summary, hideWhileVisible, className, children, ...props }: StickyActionProps): React.JSX.Element;
33
38
 
34
39
  export { StickyAction, stickyAction };
35
40
  export type { StickyActionProps };
@@ -1,14 +1,35 @@
1
+ "use client";
2
+
1
3
  // src/sticky-action/sticky-action.tsx
4
+ import * as React from "react";
2
5
  import { tv } from "tailwind-variants";
3
6
  import { jsx, jsxs } from "react/jsx-runtime";
4
7
  var stickyAction = tv({
5
- base: "sticky bottom-0 z-30 border-t border-border-subtle bg-surface-1 px-4 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3",
8
+ base: "sticky bottom-0 z-30 border-t border-border-subtle bg-surface-1 px-4 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3 transition-[opacity,translate] duration-150 data-[hidden]:pointer-events-none data-[hidden]:translate-y-3 data-[hidden]:opacity-0 motion-reduce:data-[hidden]:translate-y-0",
6
9
  variants: { mode: { phone: "md:hidden", task: "" } },
7
10
  defaultVariants: { mode: "phone" }
8
11
  });
9
- function StickyAction({ mode = "phone", summary, className, children, ...props }) {
12
+ function StickyAction({ mode = "phone", summary, hideWhileVisible, className, children, ...props }) {
10
13
  const task = mode === "task";
11
- return /* @__PURE__ */ jsx("div", { className: stickyAction({ mode, className }), ...props, children: task ? /* @__PURE__ */ jsxs("div", { className: "mx-auto flex max-w-5xl flex-col gap-2 md:flex-row md:items-center md:justify-between md:gap-6 [&>*:last-child]:w-full md:[&>*:last-child]:w-auto", children: [
14
+ const [hidden, setHidden] = React.useState(false);
15
+ React.useEffect(() => {
16
+ if (!hideWhileVisible || typeof IntersectionObserver === "undefined") return;
17
+ const target = (() => {
18
+ try {
19
+ return document.querySelector(hideWhileVisible);
20
+ } catch {
21
+ return null;
22
+ }
23
+ })();
24
+ if (!target) return;
25
+ const observer = new IntersectionObserver((entries) => setHidden(entries.some((entry) => entry.isIntersecting)));
26
+ observer.observe(target);
27
+ return () => {
28
+ observer.disconnect();
29
+ setHidden(false);
30
+ };
31
+ }, [hideWhileVisible]);
32
+ return /* @__PURE__ */ jsx("div", { className: stickyAction({ mode, className }), "data-hidden": hidden ? "" : void 0, "aria-hidden": hidden ? true : void 0, inert: hidden, ...props, children: task ? /* @__PURE__ */ jsxs("div", { className: "mx-auto flex max-w-5xl flex-col gap-2 md:flex-row md:items-center md:justify-between md:gap-6 [&>*:last-child]:w-full md:[&>*:last-child]:w-auto", children: [
12
33
  summary && /* @__PURE__ */ jsx("p", { className: "m-0 text-sm font-semibold tabular-nums text-fg", children: summary }),
13
34
  children
14
35
  ] }) : /* @__PURE__ */ jsx("div", { className: "mx-auto flex max-w-md flex-col [&>*]:w-full", children }) });
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/sticky-action/sticky-action.tsx"],"sourcesContent":["// Server-safe: pure CSS. The main action of a page, stuck to the bottom of a phone's screen while the page scrolls: put it\n// as the last child of the page's `main` (a sticky element holds the viewport's edge inside its container). From `md` up it\n// is not drawn — the page's own buttons are within reach. In `task` mode (a form to finish: a new invoice) it stays on every\n// width, with the `summary` (the total) at its left, so the action and what it commits are always in view.\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const stickyAction = tv({\n base: \"sticky bottom-0 z-30 border-t border-border-subtle bg-surface-1 px-4 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3\",\n variants: { mode: { phone: \"md:hidden\", task: \"\" } },\n defaultVariants: { mode: \"phone\" },\n});\n\nexport type StickyActionProps = React.ComponentProps<\"div\"> & {\n /**\n * `phone`: the bar of a phone only. `task`: on every width, for a form the person is finishing.\n * @default \"phone\"\n */\n mode?: \"phone\" | \"task\";\n /** `task` only: what the action commits (`Total 1 250,00 $`), at the left of the action; stacked above it on a phone. */\n summary?: React.ReactNode;\n /** The action: one `ButtonLink` (full width is added on a phone). */\n children: React.ReactNode;\n};\n\n/** The one action of a page, held at the bottom edge of a phone — or, in `task` mode, of the form on every width. */\nexport function StickyAction({ mode = \"phone\", summary, className, children, ...props }: StickyActionProps) {\n const task = mode === \"task\";\n return (\n <div className={stickyAction({ mode, className })} {...props}>\n {task ? (\n <div className=\"mx-auto flex max-w-5xl flex-col gap-2 md:flex-row md:items-center md:justify-between md:gap-6 [&>*:last-child]:w-full md:[&>*:last-child]:w-auto\">\n {summary && <p className=\"m-0 text-sm font-semibold tabular-nums text-fg\">{summary}</p>}\n {children}\n </div>\n ) : (\n <div className=\"mx-auto flex max-w-md flex-col [&>*]:w-full\">{children}</div>\n )}\n </div>\n );\n}\n"],"mappings":";AAKA,SAAS,UAAU;AA0BX,SACc,KADd;AAxBD,IAAM,eAAe,GAAG;AAAA,EAC7B,MAAM;AAAA,EACN,UAAU,EAAE,MAAM,EAAE,OAAO,aAAa,MAAM,GAAG,EAAE;AAAA,EACnD,iBAAiB,EAAE,MAAM,QAAQ;AACnC,CAAC;AAeM,SAAS,aAAa,EAAE,OAAO,SAAS,SAAS,WAAW,UAAU,GAAG,MAAM,GAAsB;AAC1G,QAAM,OAAO,SAAS;AACtB,SACE,oBAAC,SAAI,WAAW,aAAa,EAAE,MAAM,UAAU,CAAC,GAAI,GAAG,OACpD,iBACC,qBAAC,SAAI,WAAU,oJACZ;AAAA,eAAW,oBAAC,OAAE,WAAU,kDAAkD,mBAAQ;AAAA,IAClF;AAAA,KACH,IAEA,oBAAC,SAAI,WAAU,+CAA+C,UAAS,GAE3E;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/sticky-action/sticky-action.tsx"],"sourcesContent":["\"use client\";\n\n// The main action of a page, stuck to the bottom of a phone's screen while the page scrolls: put it\n// as the last child of the page's `main` (a sticky element holds the viewport's edge inside its container). From `md` up it\n// is not drawn — the page's own buttons are within reach. In `task` mode (a form to finish: a new invoice) it stays on every\n// width, with the `summary` (the total) at its left, so the action and what it commits are always in view.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const stickyAction = tv({\n base:\n \"sticky bottom-0 z-30 border-t border-border-subtle bg-surface-1 px-4 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3 \" +\n // `hideWhileVisible`: the bar keeps its place (no layout shift) and only fades and slides; under reduced motion, only the fade.\n \"transition-[opacity,translate] duration-150 data-[hidden]:pointer-events-none data-[hidden]:translate-y-3 data-[hidden]:opacity-0 motion-reduce:data-[hidden]:translate-y-0\",\n variants: { mode: { phone: \"md:hidden\", task: \"\" } },\n defaultVariants: { mode: \"phone\" },\n});\n\nexport type StickyActionProps = React.ComponentProps<\"div\"> & {\n /**\n * `phone`: the bar of a phone only. `task`: on every width, for a form the person is finishing.\n * @default \"phone\"\n */\n mode?: \"phone\" | \"task\";\n /** `task` only: what the action commits (`Total 1 250,00 $`), at the left of the action; stacked above it on a phone. */\n summary?: React.ReactNode;\n /**\n * A CSS selector of the page's own action (`#hero-book`): while it is on screen the bar is hidden, so a phone never shows\n * two « Book » at once. The bar keeps its place (no layout shift), cannot be focused or pressed while hidden.\n */\n hideWhileVisible?: string;\n /** The action: one `ButtonLink` (full width is added on a phone). */\n children: React.ReactNode;\n};\n\n/** The one action of a page, held at the bottom edge of a phone — or, in `task` mode, of the form on every width. */\nexport function StickyAction({ mode = \"phone\", summary, hideWhileVisible, className, children, ...props }: StickyActionProps) {\n const task = mode === \"task\";\n const [hidden, setHidden] = React.useState(false);\n React.useEffect(() => {\n if (!hideWhileVisible || typeof IntersectionObserver === \"undefined\") return;\n const target = ((): Element | null => {\n try {\n return document.querySelector(hideWhileVisible);\n } catch {\n return null;\n }\n })();\n if (!target) return;\n const observer = new IntersectionObserver((entries) => setHidden(entries.some((entry) => entry.isIntersecting)));\n observer.observe(target);\n return () => {\n observer.disconnect();\n setHidden(false);\n };\n }, [hideWhileVisible]);\n return (\n <div className={stickyAction({ mode, className })} data-hidden={hidden ? \"\" : undefined} aria-hidden={hidden ? true : undefined} inert={hidden} {...props}>\n {task ? (\n <div className=\"mx-auto flex max-w-5xl flex-col gap-2 md:flex-row md:items-center md:justify-between md:gap-6 [&>*:last-child]:w-full md:[&>*:last-child]:w-auto\">\n {summary && <p className=\"m-0 text-sm font-semibold tabular-nums text-fg\">{summary}</p>}\n {children}\n </div>\n ) : (\n <div className=\"mx-auto flex max-w-md flex-col [&>*]:w-full\">{children}</div>\n )}\n </div>\n );\n}\n"],"mappings":";;;AAMA,YAAY,WAAW;AACvB,SAAS,UAAU;AAoDX,SACc,KADd;AAlDD,IAAM,eAAe,GAAG;AAAA,EAC7B,MACE;AAAA,EAGF,UAAU,EAAE,MAAM,EAAE,OAAO,aAAa,MAAM,GAAG,EAAE;AAAA,EACnD,iBAAiB,EAAE,MAAM,QAAQ;AACnC,CAAC;AAoBM,SAAS,aAAa,EAAE,OAAO,SAAS,SAAS,kBAAkB,WAAW,UAAU,GAAG,MAAM,GAAsB;AAC5H,QAAM,OAAO,SAAS;AACtB,QAAM,CAAC,QAAQ,SAAS,IAAU,eAAS,KAAK;AAChD,EAAM,gBAAU,MAAM;AACpB,QAAI,CAAC,oBAAoB,OAAO,yBAAyB,YAAa;AACtE,UAAM,UAAU,MAAsB;AACpC,UAAI;AACF,eAAO,SAAS,cAAc,gBAAgB;AAAA,MAChD,QAAQ;AACN,eAAO;AAAA,MACT;AAAA,IACF,GAAG;AACH,QAAI,CAAC,OAAQ;AACb,UAAM,WAAW,IAAI,qBAAqB,CAAC,YAAY,UAAU,QAAQ,KAAK,CAAC,UAAU,MAAM,cAAc,CAAC,CAAC;AAC/G,aAAS,QAAQ,MAAM;AACvB,WAAO,MAAM;AACX,eAAS,WAAW;AACpB,gBAAU,KAAK;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,gBAAgB,CAAC;AACrB,SACE,oBAAC,SAAI,WAAW,aAAa,EAAE,MAAM,UAAU,CAAC,GAAG,eAAa,SAAS,KAAK,QAAW,eAAa,SAAS,OAAO,QAAW,OAAO,QAAS,GAAG,OACjJ,iBACC,qBAAC,SAAI,WAAU,oJACZ;AAAA,eAAW,oBAAC,OAAE,WAAU,kDAAkD,mBAAQ;AAAA,IAClF;AAAA,KACH,IAEA,oBAAC,SAAI,WAAU,+CAA+C,UAAS,GAE3E;AAEJ;","names":[]}
package/dist/theme.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  buttonVariants
4
- } from "./chunk-SJS6RJIT.js";
4
+ } from "./chunk-V7W4RLRW.js";
5
5
  import "./chunk-D3T54RSL.js";
6
6
  import "./chunk-WEVYKZIF.js";
7
7
  import "./chunk-NSLXEDIS.js";
@@ -4,7 +4,7 @@ import {
4
4
  import "./chunk-TDG7ED2W.js";
5
5
  import {
6
6
  Button
7
- } from "./chunk-UV4HBVH7.js";
7
+ } from "./chunk-EB45EVPJ.js";
8
8
  import "./chunk-43PTCDTL.js";
9
9
  import "./chunk-2VNYHG4E.js";
10
10
  import "./chunk-W675RFOA.js";
@@ -0,0 +1,229 @@
1
+ import * as React from 'react';
2
+ import { StatStripItem } from './stat.js';
3
+ import * as tailwind_variants from 'tailwind-variants';
4
+ import { LinkComponent } from './chapter.js';
5
+
6
+ /** The periods a usage page offers, in days. */
7
+ declare const USAGE_PERIODS: readonly [7, 30, 90];
8
+ type UsagePeriod = (typeof USAGE_PERIODS)[number];
9
+ /** Reads `?period=` back: anything but an offered period is the default, so the address can never break the page. */
10
+ declare function parsePeriod(raw: string | string[] | null | undefined, allowed?: readonly number[], fallback?: number): number;
11
+ /** The address of a period: the same path with `period` set, every other parameter kept. */
12
+ declare function periodHref(base: string, period: number, param?: string): string;
13
+ type UsageWords = {
14
+ /** The change against the previous period; `{change}` is replaced by the signed percentage. */
15
+ vsPrevious: string;
16
+ /** When the figure did not move. */
17
+ same: string;
18
+ };
19
+ interface UsageTileInput {
20
+ id: string;
21
+ label: string;
22
+ value: number;
23
+ /** The same figure for the previous period: the trend is computed from it. */
24
+ previous?: number;
25
+ /** Which direction is good news (latency, failures: `down`). Default `up`. */
26
+ good?: "up" | "down";
27
+ /** The shape of the period, rendered by the app (a `Sparkline` of @krizaka/charts, 64 × 18). */
28
+ chart?: React.ReactNode;
29
+ /** Digits of the figure. Default 0. */
30
+ digits?: number;
31
+ }
32
+ interface UsageTileOptions {
33
+ /** Default `fr-CA`: French figures and words with no props. */
34
+ /** The language of the figures and the words. Default `fr-CA`. */
35
+ locale?: string;
36
+ /** Your own words for the change: `{change}` is the percentage. */
37
+ words?: Partial<UsageWords>;
38
+ }
39
+ /** One strip figure: the value written for the locale, the change against the previous period said in words. */
40
+ declare function usageTile(input: UsageTileInput, { locale, words }?: UsageTileOptions): StatStripItem;
41
+ /** One bar of the usage chart: a day, its counts by outcome. */
42
+ interface UsageDay {
43
+ /** The day, written by the app (`3 nov.`). */
44
+ label: string;
45
+ values: Readonly<Partial<Record<string, number>>>;
46
+ }
47
+ interface UsageOutcome {
48
+ id: string;
49
+ label: string;
50
+ /** `accent`, `success`, `warning`, `danger` or `muted`: tones of the tokens, never a colour. */
51
+ tone: "accent" | "success" | "warning" | "danger" | "muted";
52
+ }
53
+
54
+ declare const usage: tailwind_variants.TVReturnType<{
55
+ tone: {
56
+ accent: {
57
+ swatch: string;
58
+ };
59
+ success: {
60
+ swatch: string;
61
+ };
62
+ warning: {
63
+ swatch: string;
64
+ };
65
+ danger: {
66
+ swatch: string;
67
+ };
68
+ muted: {
69
+ swatch: string;
70
+ };
71
+ };
72
+ }, {
73
+ credits: string;
74
+ creditsHead: string;
75
+ creditsTitle: string;
76
+ creditsFigure: string;
77
+ creditsFoot: string;
78
+ switchList: string;
79
+ switchLink: string;
80
+ chart: string;
81
+ chartTitle: string;
82
+ plot: string;
83
+ column: string;
84
+ bar: string;
85
+ legend: string;
86
+ swatch: string;
87
+ state: string;
88
+ skeleton: string;
89
+ }, undefined, {
90
+ tone: {
91
+ accent: {
92
+ swatch: string;
93
+ };
94
+ success: {
95
+ swatch: string;
96
+ };
97
+ warning: {
98
+ swatch: string;
99
+ };
100
+ danger: {
101
+ swatch: string;
102
+ };
103
+ muted: {
104
+ swatch: string;
105
+ };
106
+ };
107
+ }, {
108
+ credits: string;
109
+ creditsHead: string;
110
+ creditsTitle: string;
111
+ creditsFigure: string;
112
+ creditsFoot: string;
113
+ switchList: string;
114
+ switchLink: string;
115
+ chart: string;
116
+ chartTitle: string;
117
+ plot: string;
118
+ column: string;
119
+ bar: string;
120
+ legend: string;
121
+ swatch: string;
122
+ state: string;
123
+ skeleton: string;
124
+ }, tailwind_variants.TVReturnTypeLike<{
125
+ tone: {
126
+ accent: {
127
+ swatch: string;
128
+ };
129
+ success: {
130
+ swatch: string;
131
+ };
132
+ warning: {
133
+ swatch: string;
134
+ };
135
+ danger: {
136
+ swatch: string;
137
+ };
138
+ muted: {
139
+ swatch: string;
140
+ };
141
+ };
142
+ }, {
143
+ credits: string;
144
+ creditsHead: string;
145
+ creditsTitle: string;
146
+ creditsFigure: string;
147
+ creditsFoot: string;
148
+ switchList: string;
149
+ switchLink: string;
150
+ chart: string;
151
+ chartTitle: string;
152
+ plot: string;
153
+ column: string;
154
+ bar: string;
155
+ legend: string;
156
+ swatch: string;
157
+ state: string;
158
+ skeleton: string;
159
+ }>>;
160
+ type CreditsMeterProps = Omit<React.ComponentProps<"section">, "children"> & {
161
+ /** What the balance is (« Crédits »): the heading and the meter's name. */
162
+ label: string;
163
+ /** Credits left. */
164
+ balance: number;
165
+ /** The allowance of the period; the meter fills with what is left. */
166
+ total: number;
167
+ /** The renewal, written by the app (« Renouvelés le 1er novembre »). */
168
+ renewal?: React.ReactNode;
169
+ /** The way to buy more: a link or a button. */
170
+ action?: React.ReactNode;
171
+ /** Default `fr-CA`. */
172
+ locale?: string;
173
+ };
174
+ /** The balance: the figure large, a meter that turns to warning then danger as it runs low, the renewal and the way to buy. */
175
+ declare function CreditsMeter({ label, balance, total, renewal, action, locale, className, ...props }: CreditsMeterProps): React.JSX.Element;
176
+ type PeriodSwitchProps = Omit<React.ComponentProps<"nav">, "children"> & {
177
+ /** The accessible name (« Période »). */
178
+ label: string;
179
+ /** The period shown, from `parsePeriod(searchParams.period)`. */
180
+ value: number;
181
+ /** The page's path (and any other parameters); each period is a link to it with `?period=`. */
182
+ href: string;
183
+ /** The periods offered, in days. Default 7 · 30 · 90. */
184
+ periods?: readonly number[];
185
+ /** The query parameter. Default `period`. */
186
+ param?: string;
187
+ /** The text of a period. Default `7 j` (`7 d` for an English locale). */
188
+ periodLabel?: (days: number) => string;
189
+ /** Default `fr-CA`. */
190
+ locale?: string;
191
+ /** The app's router link (Next's `Link`); default a plain `<a>`. */
192
+ linkAs?: LinkComponent;
193
+ };
194
+ /** 7 · 30 · 90 d: links, so the address holds the period (`?period=30`) and the server renders it. */
195
+ declare function PeriodSwitch({ label, value, href, periods, param, periodLabel, locale, linkAs, className, ...props }: PeriodSwitchProps): React.JSX.Element;
196
+ type UsageTilesProps = Omit<React.ComponentProps<"div">, "children"> & {
197
+ /** 2 to 4 figures. */
198
+ tiles: readonly UsageTileInput[];
199
+ /** The period switch, above the row. */
200
+ period?: React.ReactNode;
201
+ /** The data is on its way: the row keeps its height. */
202
+ loading?: boolean;
203
+ } & UsageTileOptions;
204
+ /** The figures of the period on the strip, each compared with the previous period in words. */
205
+ declare function UsageTiles({ tiles, period, loading, locale, words, className, ...props }: UsageTilesProps): React.JSX.Element;
206
+ type UsageChartProps = Omit<React.ComponentProps<"figure">, "children"> & {
207
+ /** What it draws (« Activité par résultat »). */
208
+ title: string;
209
+ /** The days, oldest first. */
210
+ days: readonly UsageDay[];
211
+ /** The outcomes stacked in each bar, bottom first. */
212
+ outcomes: readonly UsageOutcome[];
213
+ /** Said when there is nothing in the period. */
214
+ emptyLabel: string;
215
+ /** The text version's column headings: the day, the total. */
216
+ columns: {
217
+ day: string;
218
+ total: string;
219
+ };
220
+ /** The data is on its way: a skeleton keeps the height. */
221
+ loading?: boolean;
222
+ /** Default `fr-CA`. */
223
+ locale?: string;
224
+ };
225
+ /** The activity of the period, one bar per day stacked by outcome — with its legend and its text version (a table). */
226
+ declare function UsageChart({ title, days, outcomes, emptyLabel, columns, loading, locale, className, ...props }: UsageChartProps): React.JSX.Element;
227
+
228
+ export { CreditsMeter, PeriodSwitch, USAGE_PERIODS, UsageChart, UsageTiles, parsePeriod, periodHref, usage, usageTile };
229
+ export type { CreditsMeterProps, PeriodSwitchProps, UsageChartProps, UsageDay, UsageOutcome, UsagePeriod, UsageTileInput, UsageTileOptions, UsageTilesProps, UsageWords };