@krizaka/ui 4.4.0 → 4.5.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 (408) hide show
  1. package/README.md +1 -0
  2. package/dist/account-menu.d.ts +1 -1
  3. package/dist/account-menu.js +1 -1
  4. package/dist/account-menu.js.map +1 -1
  5. package/dist/account-settings.d.ts +1 -1
  6. package/dist/account-settings.js +13 -6
  7. package/dist/account-settings.js.map +1 -1
  8. package/dist/agenda.d.ts +1 -1
  9. package/dist/agenda.js +2 -1
  10. package/dist/agenda.js.map +1 -1
  11. package/dist/analysis-report.js +19 -11
  12. package/dist/analysis-report.js.map +1 -1
  13. package/dist/app-frame.d.ts +1 -1
  14. package/dist/app-frame.js.map +1 -1
  15. package/dist/app-header/search.js +2 -2
  16. package/dist/app-header/search.js.map +1 -1
  17. package/dist/avatar/defaults.js +3 -1
  18. package/dist/avatar/defaults.js.map +1 -1
  19. package/dist/avatar.js +3 -1
  20. package/dist/avatar.js.map +1 -1
  21. package/dist/bird-plate.js +8 -2
  22. package/dist/bird-plate.js.map +1 -1
  23. package/dist/chapter.js +7 -4
  24. package/dist/chapter.js.map +1 -1
  25. package/dist/chat.js +1 -1
  26. package/dist/chip.d.ts +1 -1
  27. package/dist/chip.js +1 -1
  28. package/dist/{chunk-SNSQLGGS.js → chunk-5VZ37TY3.js} +1 -1
  29. package/dist/{chunk-XWJDBQU7.js.map → chunk-5VZ37TY3.js.map} +1 -1
  30. package/dist/{chunk-MTVX4RRF.js → chunk-HP7BDMVK.js} +11 -3
  31. package/dist/chunk-HP7BDMVK.js.map +1 -0
  32. package/dist/{chunk-PK3L6WQT.js → chunk-LNAAWT4Y.js} +4 -2
  33. package/dist/{chunk-PK3L6WQT.js.map → chunk-LNAAWT4Y.js.map} +1 -1
  34. package/dist/{chunk-UIP3WX5O.js → chunk-MDSP7DJR.js} +2 -2
  35. package/dist/chunk-MDSP7DJR.js.map +1 -0
  36. package/dist/{chunk-IEGTRCDI.js → chunk-NQENOT6L.js} +2 -2
  37. package/dist/{chunk-IEGTRCDI.js.map → chunk-NQENOT6L.js.map} +1 -1
  38. package/dist/{chunk-FM42KOAU.js → chunk-P7AFIKWG.js} +5 -3
  39. package/dist/chunk-P7AFIKWG.js.map +1 -0
  40. package/dist/{chunk-BCD2CRFG.js → chunk-PJNR4NTS.js} +2 -2
  41. package/dist/chunk-PJNR4NTS.js.map +1 -0
  42. package/dist/{chunk-ZFR6ZNXD.js → chunk-PVQ2KKPZ.js} +1 -1
  43. package/dist/chunk-PVQ2KKPZ.js.map +1 -0
  44. package/dist/{chunk-U4XTZMB7.js → chunk-QA3WETWT.js} +1 -1
  45. package/dist/{chunk-U4XTZMB7.js.map → chunk-QA3WETWT.js.map} +1 -1
  46. package/dist/{chunk-YXETEQQJ.js → chunk-SG2RKUVJ.js} +2 -2
  47. package/dist/{chunk-EOWV6BNQ.js → chunk-TXFX4PMN.js} +4 -2
  48. package/dist/{chunk-EOWV6BNQ.js.map → chunk-TXFX4PMN.js.map} +1 -1
  49. package/dist/{chunk-XWJDBQU7.js → chunk-V5RO6JYI.js} +1 -1
  50. package/dist/{chunk-SNSQLGGS.js.map → chunk-V5RO6JYI.js.map} +1 -1
  51. package/dist/{chunk-VUD4IEVJ.js → chunk-VZ6ZALIJ.js} +1 -1
  52. package/dist/chunk-VZ6ZALIJ.js.map +1 -0
  53. package/dist/{chunk-2DHL7NJW.js → chunk-XVRKKYWU.js} +5 -3
  54. package/dist/{chunk-2DHL7NJW.js.map → chunk-XVRKKYWU.js.map} +1 -1
  55. package/dist/{chunk-CDNOT2KR.js → chunk-YTYNKMNS.js} +1 -1
  56. package/dist/chunk-YTYNKMNS.js.map +1 -0
  57. package/dist/code-block.js.map +1 -1
  58. package/dist/columns.d.ts +132 -0
  59. package/dist/columns.js +89 -0
  60. package/dist/columns.js.map +1 -0
  61. package/dist/combobox.js +2 -2
  62. package/dist/copy-button.js +2 -2
  63. package/dist/copy-button.js.map +1 -1
  64. package/dist/data-table.js +3 -3
  65. package/dist/desktop-window.d.ts +1 -1
  66. package/dist/desktop-window.js +3 -1
  67. package/dist/desktop-window.js.map +1 -1
  68. package/dist/drop-overlay.js +8 -8
  69. package/dist/drop-overlay.js.map +1 -1
  70. package/dist/elephant.d.ts +1 -1
  71. package/dist/elephant.js.map +1 -1
  72. package/dist/embed-facade.d.ts +1 -1
  73. package/dist/embed-facade.js +3 -1
  74. package/dist/embed-facade.js.map +1 -1
  75. package/dist/engine-flow.js +7 -2
  76. package/dist/engine-flow.js.map +1 -1
  77. package/dist/entity-header.js +9 -3
  78. package/dist/entity-header.js.map +1 -1
  79. package/dist/file-upload.d.ts +1 -1
  80. package/dist/file-upload.js.map +1 -1
  81. package/dist/filter-bar.d.ts +4 -4
  82. package/dist/filter-bar.js +2 -2
  83. package/dist/flock.js +9 -6
  84. package/dist/flock.js.map +1 -1
  85. package/dist/form.d.ts +3 -3
  86. package/dist/form.js.map +1 -1
  87. package/dist/genui.js +3 -3
  88. package/dist/glossary-term.d.ts +1 -1
  89. package/dist/glossary-term.js.map +1 -1
  90. package/dist/glossary.d.ts +1 -1
  91. package/dist/glossary.js.map +1 -1
  92. package/dist/identity-card.js +1 -1
  93. package/dist/index.js +1 -1
  94. package/dist/kind-config-editor.d.ts +2 -2
  95. package/dist/kind-config-editor.js +1 -1
  96. package/dist/kind-config-editor.js.map +1 -1
  97. package/dist/kpi-explained.d.ts +1 -1
  98. package/dist/kpi-explained.js +4 -4
  99. package/dist/kpi-explained.js.map +1 -1
  100. package/dist/landing-page.js +1 -1
  101. package/dist/{lightbox-Q45BZ3HW.js → lightbox-MRB2YZEP.js} +1 -1
  102. package/dist/lightbox-MRB2YZEP.js.map +1 -0
  103. package/dist/map/cards.js +4 -2
  104. package/dist/map/cards.js.map +1 -1
  105. package/dist/map/pin.js +2 -1
  106. package/dist/map/pin.js.map +1 -1
  107. package/dist/map.d.ts +1 -1
  108. package/dist/map.js.map +1 -1
  109. package/dist/mascot-quote.js +1 -1
  110. package/dist/mascot-state.js +1 -1
  111. package/dist/mascots.js +1 -1
  112. package/dist/match-dialog.js +1 -1
  113. package/dist/motion.d.ts +1 -1
  114. package/dist/motion.js.map +1 -1
  115. package/dist/native/form.d.ts +3 -3
  116. package/dist/native/form.js.map +1 -1
  117. package/dist/native/markdown.d.ts +1 -1
  118. package/dist/native/markdown.js.map +1 -1
  119. package/dist/native/vertical-video.js.map +1 -1
  120. package/dist/native.d.ts +12 -12
  121. package/dist/native.js +12 -7
  122. package/dist/native.js.map +1 -1
  123. package/dist/nav-bar.d.ts +2 -2
  124. package/dist/nav-bar.js +1 -1
  125. package/dist/nav-bar.js.map +1 -1
  126. package/dist/next-actions.d.ts +1 -1
  127. package/dist/next-actions.js.map +1 -1
  128. package/dist/notification-preferences.d.ts +1 -1
  129. package/dist/notification-preferences.js +5 -2
  130. package/dist/notification-preferences.js.map +1 -1
  131. package/dist/page-index.js +2 -2
  132. package/dist/page-index.js.map +1 -1
  133. package/dist/product-page.js +1 -1
  134. package/dist/promo-code-field.d.ts +1 -1
  135. package/dist/promo-code-field.js.map +1 -1
  136. package/dist/qr-code.d.ts +1 -1
  137. package/dist/qr-code.js +1 -1
  138. package/dist/rail-nav.js +3 -3
  139. package/dist/rail-nav.js.map +1 -1
  140. package/dist/retro-tv.d.ts +1 -1
  141. package/dist/retro-tv.js.map +1 -1
  142. package/dist/reviews.d.ts +2 -2
  143. package/dist/reviews.js.map +1 -1
  144. package/dist/router.d.ts +1 -1
  145. package/dist/router.js +8 -8
  146. package/dist/router.js.map +1 -1
  147. package/dist/{schema-CL7t7xqb.d.ts → schema-Dd05m48Q.d.ts} +9 -9
  148. package/dist/service-card.js +22 -13
  149. package/dist/service-card.js.map +1 -1
  150. package/dist/settings-layout.js +1 -1
  151. package/dist/shop/booking.js.map +1 -1
  152. package/dist/shop/gallery.js +7 -6
  153. package/dist/shop/gallery.js.map +1 -1
  154. package/dist/shop/hero.js.map +1 -1
  155. package/dist/shop/look.d.ts +2 -2
  156. package/dist/shop/look.js +1 -1
  157. package/dist/shop/look.js.map +1 -1
  158. package/dist/shop/map-gate.d.ts +1 -1
  159. package/dist/shop/map-gate.js +2 -2
  160. package/dist/shop/map-gate.js.map +1 -1
  161. package/dist/shop/services.js.map +1 -1
  162. package/dist/shop-composer.d.ts +10 -10
  163. package/dist/shop-composer.js +27 -14
  164. package/dist/shop-composer.js.map +1 -1
  165. package/dist/shop-gallery.js +1 -1
  166. package/dist/shop.d.ts +2 -2
  167. package/dist/shop.js +2 -2
  168. package/dist/shop.js.map +1 -1
  169. package/dist/signature.js +2 -1
  170. package/dist/signature.js.map +1 -1
  171. package/dist/site-cahier.js +7 -3
  172. package/dist/site-cahier.js.map +1 -1
  173. package/dist/site-footer.js +6 -2
  174. package/dist/site-footer.js.map +1 -1
  175. package/dist/slot-picker.js +5 -2
  176. package/dist/slot-picker.js.map +1 -1
  177. package/dist/stat.js +1 -1
  178. package/dist/status-chip.d.ts +1 -1
  179. package/dist/status-chip.js.map +1 -1
  180. package/dist/tabs.js.map +1 -1
  181. package/dist/tag-input.js +2 -2
  182. package/dist/tag-selector.js +1 -1
  183. package/dist/text-style.js +4 -3
  184. package/dist/text-style.js.map +1 -1
  185. package/dist/usage.js +8 -3
  186. package/dist/usage.js.map +1 -1
  187. package/dist/versus-card.js +1 -1
  188. package/dist/versus-card.js.map +1 -1
  189. package/dist/vertical-video.js +1 -1
  190. package/dist/vertical-video.js.map +1 -1
  191. package/dist/virtual.d.ts +3 -3
  192. package/dist/wall.d.ts +4 -4
  193. package/dist/wall.js +1 -1
  194. package/dist/wall.js.map +1 -1
  195. package/package.json +20 -6
  196. package/registry/account-menu.json +2 -2
  197. package/registry/account-settings.json +3 -3
  198. package/registry/achievement.json +1 -1
  199. package/registry/action-bar.json +1 -1
  200. package/registry/activity-feed.json +1 -1
  201. package/registry/agenda.json +2 -2
  202. package/registry/alert.json +1 -1
  203. package/registry/analysis-report.json +3 -3
  204. package/registry/anatomy-plate.json +1 -1
  205. package/registry/app-frame.json +4 -4
  206. package/registry/app-header.json +2 -2
  207. package/registry/app-shell.json +1 -1
  208. package/registry/argument-card.json +1 -1
  209. package/registry/auth-layout.json +1 -1
  210. package/registry/avatar.json +2 -2
  211. package/registry/badge.json +3 -3
  212. package/registry/bird-plate.json +2 -2
  213. package/registry/button.json +1 -1
  214. package/registry/captcha.json +1 -1
  215. package/registry/card-grid.json +1 -1
  216. package/registry/card.json +1 -1
  217. package/registry/catalogue-page.json +1 -1
  218. package/registry/changelog-page.json +1 -1
  219. package/registry/chapter.json +2 -2
  220. package/registry/chat.json +1 -1
  221. package/registry/checkbox.json +1 -1
  222. package/registry/chip-link.json +1 -1
  223. package/registry/chip-row.json +1 -1
  224. package/registry/chip.json +2 -2
  225. package/registry/choice-grid.json +1 -1
  226. package/registry/code-block.json +1 -1
  227. package/registry/collection-switcher.json +1 -1
  228. package/registry/columns.json +319 -0
  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 +1 -1
  236. package/registry/copy-button.json +2 -2
  237. package/registry/countdown.json +1 -1
  238. package/registry/cover-hero.json +1 -1
  239. package/registry/cta-panel.json +1 -1
  240. package/registry/dashboard-layout.json +1 -1
  241. package/registry/data-table.json +2 -2
  242. package/registry/date-picker.json +1 -1
  243. package/registry/decision-list.json +1 -1
  244. package/registry/description-list.json +1 -1
  245. package/registry/desktop-window.json +2 -2
  246. package/registry/detail-layout.json +1 -1
  247. package/registry/dialog.json +1 -1
  248. package/registry/docs-article-page.json +1 -1
  249. package/registry/docs-hub-page.json +1 -1
  250. package/registry/docs-layout.json +1 -1
  251. package/registry/docs-nav.json +1 -1
  252. package/registry/document-viewer.json +1 -1
  253. package/registry/doodle.json +1 -1
  254. package/registry/drop-overlay.json +2 -2
  255. package/registry/dropdown-menu.json +1 -1
  256. package/registry/elephant.json +2 -2
  257. package/registry/embed-facade.json +3 -3
  258. package/registry/empty-state.json +1 -1
  259. package/registry/engine-flow.json +3 -3
  260. package/registry/entity-header.json +2 -2
  261. package/registry/environment-notice.json +1 -1
  262. package/registry/error-page.json +1 -1
  263. package/registry/examples/columns/columns.d.ts +4 -0
  264. package/registry/examples/columns/columns.js +21 -0
  265. package/registry/examples/columns/columns.tsx +18 -0
  266. package/registry/examples/columns/photos.d.ts +4 -0
  267. package/registry/examples/columns/photos.js +12 -0
  268. package/registry/examples/columns/photos.tsx +16 -0
  269. package/registry/examples/columns/stats.d.ts +4 -0
  270. package/registry/examples/columns/stats.js +20 -0
  271. package/registry/examples/columns/stats.tsx +22 -0
  272. package/registry/field.json +1 -1
  273. package/registry/file-upload.json +2 -2
  274. package/registry/filter-bar.json +2 -2
  275. package/registry/flock.json +3 -3
  276. package/registry/footnote.json +1 -1
  277. package/registry/force-update-screen.json +1 -1
  278. package/registry/form.json +8 -8
  279. package/registry/gallery-page.json +1 -1
  280. package/registry/genui.json +1 -1
  281. package/registry/glossary-term.json +2 -2
  282. package/registry/glossary.json +2 -2
  283. package/registry/glow-card.json +1 -1
  284. package/registry/goal-gauge.json +1 -1
  285. package/registry/grade-stamp.json +1 -1
  286. package/registry/grid.json +4 -3
  287. package/registry/identity-card.json +1 -1
  288. package/registry/image-cropper.json +1 -1
  289. package/registry/index.json +40 -9
  290. package/registry/kanban.json +1 -1
  291. package/registry/kbd.json +1 -1
  292. package/registry/kind-config-editor.json +2 -2
  293. package/registry/kpi-explained.json +2 -2
  294. package/registry/landing-page.json +1 -1
  295. package/registry/landscape.json +1 -1
  296. package/registry/language-switch.json +1 -1
  297. package/registry/legal-page.json +1 -1
  298. package/registry/link-card.json +1 -1
  299. package/registry/list.json +1 -1
  300. package/registry/loader.json +1 -1
  301. package/registry/longform-page.json +1 -1
  302. package/registry/maintenance-screen.json +1 -1
  303. package/registry/map.json +5 -5
  304. package/registry/margin-layout.json +1 -1
  305. package/registry/markdown.json +1 -1
  306. package/registry/marketing-layout.json +1 -1
  307. package/registry/mascot-quote.json +1 -1
  308. package/registry/mascot-state.json +2 -2
  309. package/registry/mascots.json +3 -3
  310. package/registry/match-dialog.json +1 -1
  311. package/registry/media-capture.json +1 -1
  312. package/registry/media-gallery.json +1 -1
  313. package/registry/meter.json +1 -1
  314. package/registry/money-input.json +1 -1
  315. package/registry/nav-bar.json +5 -5
  316. package/registry/next-actions.json +2 -2
  317. package/registry/notification-preferences.json +2 -2
  318. package/registry/number-ticker.json +1 -1
  319. package/registry/opening-hours.json +1 -1
  320. package/registry/page-header.json +1 -1
  321. package/registry/page-hero.json +1 -1
  322. package/registry/page-index.json +2 -2
  323. package/registry/page.json +2 -2
  324. package/registry/pagination.json +1 -1
  325. package/registry/pointer-light.json +1 -1
  326. package/registry/popover.json +1 -1
  327. package/registry/price-catalogue-editor.json +1 -1
  328. package/registry/pricing-page.json +1 -1
  329. package/registry/product-page.json +1 -1
  330. package/registry/profile-card.json +1 -1
  331. package/registry/progress.json +1 -1
  332. package/registry/promise-card.json +1 -1
  333. package/registry/promo-code-field.json +2 -2
  334. package/registry/proposal.json +1 -1
  335. package/registry/qr-code.json +3 -3
  336. package/registry/quota-meter.json +1 -1
  337. package/registry/radio-group.json +1 -1
  338. package/registry/rail-nav.json +4 -4
  339. package/registry/recipes.json +1 -1
  340. package/registry/retro-tv.json +2 -2
  341. package/registry/reviews.json +2 -2
  342. package/registry/router.json +2 -2
  343. package/registry/schema-form.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 +1 -1
  348. package/registry/service-card.json +2 -2
  349. package/registry/settings-layout.json +2 -2
  350. package/registry/shop-composer.json +8 -8
  351. package/registry/shop-gallery.json +2 -2
  352. package/registry/shop.json +12 -12
  353. package/registry/showcase.json +1 -1
  354. package/registry/signature.json +2 -2
  355. package/registry/site-cahier.json +2 -2
  356. package/registry/site-footer.json +4 -4
  357. package/registry/sites.json +1 -1
  358. package/registry/skeleton.json +1 -1
  359. package/registry/skip-link.json +1 -1
  360. package/registry/slider.json +1 -1
  361. package/registry/slot-picker.json +2 -2
  362. package/registry/slot.json +1 -1
  363. package/registry/specimen-tag.json +1 -1
  364. package/registry/speed-lines.json +1 -1
  365. package/registry/spinner.json +1 -1
  366. package/registry/split-view.json +1 -1
  367. package/registry/stage-banner.json +1 -1
  368. package/registry/stat.json +2 -2
  369. package/registry/status-chip.json +2 -2
  370. package/registry/status-page.json +1 -1
  371. package/registry/step-progress.json +1 -1
  372. package/registry/step-showcase.json +1 -1
  373. package/registry/stepper.json +1 -1
  374. package/registry/sticky-action.json +1 -1
  375. package/registry/stuck.json +1 -1
  376. package/registry/swipe-deck.json +1 -1
  377. package/registry/switch.json +1 -1
  378. package/registry/tabs.json +2 -2
  379. package/registry/tag-input.json +1 -1
  380. package/registry/tag-selector.json +1 -1
  381. package/registry/taped-photo.json +1 -1
  382. package/registry/terminal-replay.json +1 -1
  383. package/registry/text-style.json +2 -2
  384. package/registry/theme.json +1 -1
  385. package/registry/toast.json +1 -1
  386. package/registry/toc.json +1 -1
  387. package/registry/tooltip.json +1 -1
  388. package/registry/tree-view.json +1 -1
  389. package/registry/update-prompt.json +1 -1
  390. package/registry/upload-queue.json +1 -1
  391. package/registry/usage.json +3 -3
  392. package/registry/verified-badge.json +1 -1
  393. package/registry/versus-card.json +2 -2
  394. package/registry/vertical-video.json +2 -2
  395. package/registry/video-player.json +1 -1
  396. package/registry/video-trimmer.json +1 -1
  397. package/registry/virtual.json +1 -1
  398. package/registry/wall.json +6 -6
  399. package/registry/waveform.json +3 -3
  400. package/dist/chunk-BCD2CRFG.js.map +0 -1
  401. package/dist/chunk-CDNOT2KR.js.map +0 -1
  402. package/dist/chunk-FM42KOAU.js.map +0 -1
  403. package/dist/chunk-MTVX4RRF.js.map +0 -1
  404. package/dist/chunk-UIP3WX5O.js.map +0 -1
  405. package/dist/chunk-VUD4IEVJ.js.map +0 -1
  406. package/dist/chunk-ZFR6ZNXD.js.map +0 -1
  407. package/dist/lightbox-Q45BZ3HW.js.map +0 -1
  408. /package/dist/{chunk-YXETEQQJ.js.map → chunk-SG2RKUVJ.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/badge/badge.tsx","../src/badge/recipe.ts","../src/account-settings/account-profile-card.tsx","../src/account-settings/appearance-settings.tsx","../src/field/field.tsx","../src/radio-group/radio-group.tsx","../src/sliding-indicator.ts","../src/tv.ts","../src/switch/switch.tsx","../src/account-settings/language-picker.tsx","../src/account-settings/group-head.tsx","../src/account-settings/avatar-picker.tsx","../src/file-upload/file-upload.tsx","../src/account-settings/choice-cards.tsx"],"sourcesContent":["// Server-safe: no hook, no context.\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { badgeRecipe } from \"./recipe\";\n\n// Status tones are soft (a tint, a coloured dot, a text role): the invariant status tokens are too light to carry\n// small text on a light surface, or to sit under white text (WCAG AA).\nexport const badgeVariants = tv(badgeRecipe);\n\nexport type BadgeVariants = VariantProps<typeof badgeVariants>;\n\nexport type BadgeProps = React.ComponentProps<\"span\"> &\n BadgeVariants & {\n /**\n * neutral · accent · success · warning · danger (soft tints, the text stays a text role) · scrim (on a media).\n * @default \"neutral\"\n */\n tone?: BadgeVariants[\"tone\"];\n /**\n * sm · md.\n * @default \"sm\"\n */\n size?: BadgeVariants[\"size\"];\n /** Makes the `dot` pulse (stopped under reduced motion). */\n pulse?: BadgeVariants[\"pulse\"];\n /** A small dot before the text, in the tone's colour (pulsing with `pulse`). */\n dot?: boolean;\n };\n\nexport function Badge({ tone, size, pulse, dot, className, children, ...props }: BadgeProps) {\n return (\n <span data-tone={tone ?? \"neutral\"} className={badgeVariants({ tone, size, pulse, className })} {...props}>\n {dot && <span data-dot=\"\" aria-hidden className=\"h-1.5 w-1.5 rounded-full bg-current\" />}\n {children}\n </span>\n );\n}\n","// The badge's tones and sizes, written once as classes of the Krizaka tokens: the web wears them with `tv(badgeRecipe)`,\n// React Native reads the same classes into styles (native/badge.tsx). Status tones are soft (a tint, a coloured dot, a\n// text role): the invariant status tokens are too light to carry small text on a light surface, or to sit under white\n// text (WCAG AA).\nimport { defineRecipe } from \"../recipes/define\";\n\nexport const badgeRecipe = defineRecipe({\n base: \"inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm font-semibold \",\n variants: {\n tone: {\n neutral: \"bg-surface-3 text-fg-secondary\",\n accent: \"bg-accent-soft text-fg ring-1 ring-inset ring-accent/40 [&>[data-dot]]:bg-accent\",\n success: \"bg-success/15 text-fg ring-1 ring-inset ring-success/40 [&>[data-dot]]:bg-success\",\n warning: \"bg-warning/15 text-fg ring-1 ring-inset ring-warning/40 [&>[data-dot]]:bg-warning\",\n danger: \"bg-danger/15 text-fg ring-1 ring-inset ring-danger/40 [&>[data-dot]]:bg-danger\",\n /** On a media: veil and text invariant, identical in both themes. */\n scrim: \"bg-scrim text-fg-on-media backdrop-blur-md\",\n },\n size: { sm: \"px-2 py-0.5 text-[10px]\", md: \"px-2.5 py-1 text-[11px]\" },\n pulse: { true: \"[&>[data-dot]]:motion-safe:animate-pulse\" },\n },\n defaultVariants: { tone: \"neutral\", size: \"sm\" },\n});\n","// Server-safe. Who the account is, at a glance: the picture with its change action, the name, the e-mail and whether it is\n// verified, since when. The head of a profile section.\nimport type * as React from \"react\";\n\nimport { Avatar, type AvatarProps } from \"../avatar/avatar\";\nimport { Badge } from \"../badge/badge\";\nimport { cn } from \"../cn\";\n\nexport type AccountProfileCardProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** The name (the card's heading). */\n name: string;\n /** The e-mail address. */\n email: string;\n /** Whether the address is verified. */\n verified: boolean;\n /** “Verified” — passed translated. */\n verifiedLabel: string;\n /** “Not verified” — passed translated. */\n unverifiedLabel: string;\n /** “Member since October 2026” — formatted by the app, in the viewer's language. */\n memberSince?: string;\n /** The picture: the person's photo, or the default avatar of the brand. */\n avatar?: Pick<AvatarProps, \"src\" | \"defaultAvatar\" | \"fallback\">;\n /** Beside the picture: the change action (a `Button`). */\n action?: React.ReactNode;\n /**\n * One calm line for a settings row: a medium picture beside the name and the e-mail, no wrapping.\n * @default false\n */\n compact?: boolean;\n};\n\n/** The account's identity card: picture, name, verified e-mail, member since. */\nexport function AccountProfileCard({ name, email, verified, verifiedLabel, unverifiedLabel, memberSince, avatar, action, compact, className, ...props }: AccountProfileCardProps) {\n return (\n <section aria-label={name} className={cn(\"flex items-center gap-3\", !compact && \"flex-col items-start gap-4 sm:flex-row sm:gap-5\", className)} {...props}>\n <div className=\"flex shrink-0 flex-col items-center gap-2\">\n <Avatar size={compact ? \"md\" : \"xl\"} alt=\"\" fallback={name.slice(0, 1)} {...avatar} />\n {action}\n </div>\n <div className=\"flex min-w-0 flex-col gap-1\">\n <h2 className={cn(\"m-0 truncate font-bold text-fg\", compact ? \"text-sm font-medium\" : \"text-lg\")}>{name}</h2>\n <p className=\"m-0 flex flex-wrap items-center gap-2 text-sm text-fg-secondary\">\n <span className=\"min-w-0 truncate\">{email}</span>\n <Badge tone={verified ? \"success\" : \"warning\"} dot>\n {verified ? verifiedLabel : unverifiedLabel}\n </Badge>\n </p>\n {memberSince ? <p className=\"text-sm text-fg-secondary\">{memberSince}</p> : null}\n </div>\n </section>\n );\n}\n","// Client (radio groups). How the workspace looks (ADR-006 §4, krizaka-ui#657): theme cards — a radio group of live miniatures\n// drawn from the tokens' own colours, one check on the chosen card —, then rows for the accent, the density, the language and, when the\n// product offers it, the sound (off by default, never under reduced motion). Driven by data: the product passes the themes it offers\n// (a subset of `appearance.themes` of @krizaka/tokens, at least system · light · dark), the accents that read on all of them, the values\n// and `onChange`s. It changes nothing by itself: `useAppearance()` of `@krizaka/ui/theme` applies the choice at once and keeps it in\n// the browser; the product saves it in the account too. Paper themes never belong here.\nimport * as React from \"react\";\n\nimport { Field } from \"../field\";\nimport { RadioGroup } from \"../radio-group\";\nimport { SettingsRow } from \"../settings-layout\";\nimport { Switch } from \"../switch\";\nimport { type LanguageOption, LanguagePicker } from \"./language-picker\";\n\n/** The colours a theme's miniature is drawn with (`appearance.themes[i].preview` of @krizaka/tokens). */\nexport type ThemePreview = { surface0: string; surface1: string; surface2: string; text: string; muted: string };\n\nexport type ThemeCardOption = {\n /** `system`, `light`, `dark`, `blueprint`, `carbone`. */\n id: string;\n /** Its name, passed translated. */\n label: string;\n /** One line: what it is, passed translated. */\n description?: string;\n /** Its colours; null for `system`, whose miniature is half light, half dark. */\n preview: ThemePreview | null;\n /** The two halves of the System miniature (`appearance.themes` light and dark previews). */\n halves?: readonly [ThemePreview, ThemePreview];\n};\n\nexport type AccentOption = {\n /** The brand id (`data-accent`). */\n id: string;\n /** Its name, passed translated (\"Forest green\"). */\n label: string;\n /** Its fill, for the swatch (`appearance.accents[i].dark.accent`). */\n color: string;\n};\n\nexport type AppearanceLabels = {\n /** The theme row: its name. */\n theme: string;\n /** One line under it. */\n themeHint: string;\n /** The accent row: its name. */\n accent: string;\n /** One line under it. */\n accentHint: string;\n /** The density row: its name. */\n density: string;\n /** One line under it. */\n densityHint: string;\n /** The language row: its name. */\n language: string;\n /** One line under it. */\n languageHint: string;\n /** The sound row: its name. */\n sound: string;\n /** One line under it. */\n soundHint: string;\n};\n\nexport const appearanceLabels: AppearanceLabels = {\n theme: \"Theme\",\n themeHint: \"The look of the workspace. System follows your device.\",\n accent: \"Accent colour\",\n accentHint: \"The colour of buttons and highlights.\",\n density: \"Density\",\n densityHint: \"How much fits on a screen.\",\n language: \"Language\",\n languageHint: \"The whole interface.\",\n sound: \"Sound\",\n soundHint: \"Small sounds when something is done. Off unless you turn it on, and never with reduced motion.\",\n};\n\nexport type AppearanceSettingsProps = {\n /** The themes offered: at least system, light and dark. */\n themes: readonly ThemeCardOption[];\n /** The id of the theme chosen. */\n theme: string;\n /** Called with the id chosen. */\n onThemeChange: (id: string) => void;\n /** The accents offered (the product's own first). Without it the row is not shown. */\n accents?: readonly AccentOption[];\n /** The id of the accent chosen; null for the product's own. */\n accent?: string | null;\n /** Called with the id chosen. */\n onAccentChange?: (id: string) => void;\n /** The densities offered, with their names (`standard`, `compact`). */\n densities?: readonly { value: string; label: string }[];\n /** The density chosen. */\n density?: string;\n /** Called with the density chosen. */\n onDensityChange?: (density: string) => void;\n /** The languages offered, each named in its own language. */\n languages?: readonly LanguageOption[];\n /** The code of the language chosen. */\n language?: string;\n /** Called with the code chosen. */\n onLanguageChange?: (code: string) => void;\n /** Shown only when given: the sound is opt-in. */\n sound?: boolean;\n /** Called with the new state. */\n onSoundChange?: (on: boolean) => void;\n /** The words, passed translated (English by default). */\n labels?: Partial<AppearanceLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\nfunction Miniature({ preview }: { preview: ThemePreview }) {\n return (\n <span\n aria-hidden\n className=\"flex h-16 w-full overflow-hidden rounded-md border border-border-default\"\n style={{ background: preview.surface0 }}\n >\n <span className=\"m-1.5 flex w-1/3 flex-col gap-1 rounded-sm p-1\" style={{ background: preview.surface1 }}>\n <span className=\"h-1 w-3/4 rounded-full\" style={{ background: preview.text }} />\n <span className=\"h-1 w-1/2 rounded-full\" style={{ background: preview.muted }} />\n </span>\n <span className=\"my-1.5 mr-1.5 flex flex-1 flex-col gap-1 rounded-sm p-1.5\" style={{ background: preview.surface2 }}>\n <span className=\"h-1.5 w-2/3 rounded-full\" style={{ background: preview.text }} />\n <span className=\"h-1 w-full rounded-full\" style={{ background: preview.muted }} />\n <span className=\"h-1 w-5/6 rounded-full\" style={{ background: preview.muted }} />\n <span className=\"mt-auto h-2 w-1/3 rounded-sm bg-accent\" />\n </span>\n </span>\n );\n}\n\n/** The appearance rows of a settings page: theme cards, accent, density, language, sound. */\nexport function AppearanceSettings({\n themes,\n theme,\n onThemeChange,\n accents,\n accent,\n onAccentChange,\n densities,\n density,\n onDensityChange,\n languages,\n language,\n onLanguageChange,\n sound,\n onSoundChange,\n labels: given,\n className,\n}: AppearanceSettingsProps) {\n const labels = { ...appearanceLabels, ...given };\n const id = React.useId();\n return (\n <div className={className}>\n <SettingsRow label={labels.theme} description={labels.themeHint}>\n <RadioGroup.Root variant=\"cards\" label={labels.theme} value={theme} onValueChange={onThemeChange} className=\"grid w-full grid-cols-2 gap-3 sm:grid-cols-3\">\n {themes.map((option) => (\n <RadioGroup.Card key={option.id} value={option.id} aria-describedby={option.description ? `${id}-${option.id}` : undefined}>\n {option.preview ? (\n <Miniature preview={option.preview} />\n ) : option.halves ? (\n <span aria-hidden className=\"grid h-16 w-full grid-cols-2 overflow-hidden rounded-md border border-border-default\">\n <Miniature preview={option.halves[0]} />\n <Miniature preview={option.halves[1]} />\n </span>\n ) : null}\n <span className=\"font-semibold text-fg\">{option.label}</span>\n {option.description ? (\n <span id={`${id}-${option.id}`} className=\"text-xs font-normal text-fg-secondary\">\n {option.description}\n </span>\n ) : null}\n </RadioGroup.Card>\n ))}\n </RadioGroup.Root>\n </SettingsRow>\n {accents && accents.length > 0 && onAccentChange ? (\n <SettingsRow label={labels.accent} description={labels.accentHint} htmlFor={`${id}-accent`}>\n <span className=\"flex items-center gap-2\">\n <span aria-hidden className=\"h-4 w-4 rounded-full border border-border-default\" style={{ background: accents.find((a) => a.id === accent)?.color ?? accents[0]?.color }} />\n <Field.Root>\n <select\n id={`${id}-accent`}\n value={accent ?? accents[0]?.id}\n onChange={(event) => onAccentChange(event.target.value)}\n className=\"h-10 rounded-lg border border-border-control bg-surface-2 px-3 text-sm text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {accents.map((option) => (\n <option key={option.id} value={option.id}>\n {option.label}\n </option>\n ))}\n </select>\n </Field.Root>\n </span>\n </SettingsRow>\n ) : null}\n {densities && densities.length > 0 && onDensityChange ? (\n <SettingsRow label={labels.density} description={labels.densityHint}>\n <RadioGroup.Root variant=\"segmented\" label={labels.density} value={density} onValueChange={onDensityChange}>\n {densities.map((option) => (\n <RadioGroup.Segment key={option.value} value={option.value}>\n {option.label}\n </RadioGroup.Segment>\n ))}\n </RadioGroup.Root>\n </SettingsRow>\n ) : null}\n {languages && languages.length > 0 && onLanguageChange ? (\n <SettingsRow label={labels.language} description={labels.languageHint}>\n <LanguagePicker label={labels.language} showLabel={false} languages={languages} value={language ?? \"\"} onValueChange={onLanguageChange} />\n </SettingsRow>\n ) : null}\n {onSoundChange ? (\n <SettingsRow label={labels.sound} description={labels.soundHint}>\n <Switch label={labels.sound} checked={Boolean(sound)} onCheckedChange={onSoundChange} />\n </SettingsRow>\n ) : null}\n </div>\n );\n}\n","// Server-safe. The label ↔ control wiring is HTML (htmlFor / id, aria-describedby): no context.\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\n\nexport const field = tv({\n slots: {\n root: \"flex flex-col gap-1.5\",\n label: \"text-xs font-semibold text-fg-secondary\",\n control:\n \"flex h-11 w-full rounded-lg border border-border-control bg-surface-2 px-3 text-sm text-fg placeholder:text-fg-muted \" +\n \"transition-[border-color,box-shadow] focus-visible:border-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-danger aria-invalid:ring-danger/30\",\n hint: \"text-xs text-fg-secondary\",\n // The message reads in the danger text role (≥ 4.5:1 on every surface, both themes); the dot is the danger fill.\n error: \"flex items-center gap-1.5 text-xs font-medium text-fg-danger before:h-1.5 before:w-1.5 before:shrink-0 before:rounded-full before:bg-danger\",\n selectWrap: \"relative flex w-full\",\n chevron: \"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-fg-secondary\",\n },\n});\nconst s = field();\n\nexport const Field = {\n Root: ({ className, ...props }: React.ComponentProps<\"div\">) => <div className={s.root({ className })} {...props} />,\n Label: ({ className, ...props }: React.ComponentProps<\"label\">) => <label className={s.label({ className })} {...props} />,\n Hint: ({ className, ...props }: React.ComponentProps<\"p\">) => <p className={s.hint({ className })} {...props} />,\n Error: ({ className, ...props }: React.ComponentProps<\"p\">) => <p role=\"alert\" className={s.error({ className })} {...props} />,\n};\n\ntype ControlProps = {\n /** Marks the control invalid: aria-invalid and data-invalid (pair it with a `Field.Error` in aria-describedby). */\n invalid?: boolean;\n};\n\nconst invalidProps = (invalid?: boolean) => (invalid ? { \"aria-invalid\": true as const, \"data-invalid\": \"\" } : {});\n\nexport function Input({ invalid, className, ...props }: React.ComponentProps<\"input\"> & ControlProps) {\n return <input {...invalidProps(invalid)} className={s.control({ className })} {...props} />;\n}\n\nexport function Textarea({ invalid, className, ...props }: React.ComponentProps<\"textarea\"> & ControlProps) {\n return <textarea {...invalidProps(invalid)} className={s.control({ className: cn(\"h-auto min-h-24 py-2\", className) })} {...props} />;\n}\n\n/** A native <select>, styled like the other controls (the platform's menu: accessible and right on phones). */\nexport function Select({ invalid, className, ...props }: React.ComponentProps<\"select\"> & ControlProps) {\n return (\n <span className={s.selectWrap()}>\n <select {...invalidProps(invalid)} className={s.control({ className: cn(\"appearance-none pr-9\", className) })} {...props} />\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden className={s.chevron()}>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </span>\n );\n}\n","// Client (a context). Radix RadioGroup: role=\"radiogroup\" / \"radio\", one tab stop, the arrows move and select, a\n// hidden input inside a form. Four looks, one behaviour:\n// - `RadioGroup.Item`: a dot and its words (a settings list);\n// - `RadioGroup.Card`: a whole card is the radio — an amount, a pack, a plan — its check lit when chosen;\n// - `RadioGroup.Button`: a tactile key that presses in — raised on a ledge, sunk when chosen (a size, a tip, a level);\n// - `RadioGroup.Segment` in `<RadioGroup.Root variant=\"segmented\">`: a segmented control, one light gliding to the choice.\nimport { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { CheckGlyph } from \"../glyphs\";\nimport { useRouteBinding } from \"../router\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\nimport { tv } from \"../tv\";\n\nexport const radioGroup = tv({\n slots: {\n root: \"grid gap-2 data-[orientation=horizontal]:flex data-[orientation=horizontal]:flex-wrap\",\n item:\n \"peer inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-border-control bg-surface-1 inset-shadow-well transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring hover:border-accent disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:shadow-glow aria-invalid:border-danger\",\n dot: \"h-2 w-2 rounded-full bg-on-accent\",\n label: \"flex cursor-pointer items-start gap-3 text-sm text-fg has-disabled:cursor-not-allowed has-disabled:opacity-70\",\n card:\n \"group relative flex min-w-0 flex-col items-start gap-1 rounded-2xl border border-border-default bg-surface-1 bg-sheen p-4 pr-10 text-left text-sm text-fg inset-shadow-edge \" +\n \"transition-[border-color,background-color,box-shadow,transform] duration-200 hover:border-border-strong active:scale-[0.99] motion-reduce:transition-none motion-reduce:active:scale-100 \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent-soft data-[state=checked]:shadow-glow\",\n // The card's check: an empty ring at rest, the accent filled with its check once chosen.\n cardCheck:\n \"absolute right-3.5 top-3.5 inline-flex h-5 w-5 items-center justify-center rounded-full border border-border-control bg-surface-1 text-on-accent transition-colors \" +\n \"group-data-[state=checked]:border-accent group-data-[state=checked]:bg-accent\",\n // The tactile key: on a ledge (its lower edge), its hairline stronger on hover, pressed in while held and once chosen.\n button:\n \"relative inline-flex min-h-12 min-w-12 select-none flex-col items-center justify-center gap-0.5 rounded-xl border border-border-default bg-surface-2 bg-sheen px-4 py-2 \" +\n \"text-sm font-semibold text-fg inset-shadow-edge shadow-[0_4px_0_0_var(--kz-border-strong)] \" +\n \"transition-[transform,box-shadow,background-color,border-color,color] duration-100 ease-out motion-reduce:transition-none \" +\n \"hover:border-border-strong \" +\n \"active:translate-y-[3px] active:shadow-[0_1px_0_0_var(--kz-border-strong)] \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:translate-y-[3px] data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:bg-fill-shade \" +\n \"data-[state=checked]:text-on-accent data-[state=checked]:inset-shadow-edge-fill data-[state=checked]:shadow-[0_1px_0_0_var(--kz-accent-hover)]\",\n buttonHint: \"text-[11px] font-medium text-fg-secondary group-data-[state=checked]:text-on-accent\",\n segmented:\n \"relative isolate inline-grid auto-cols-fr grid-flow-col gap-1 rounded-xl border border-border-default bg-surface-2 p-1 inset-shadow-well \" +\n \"before:pointer-events-none before:absolute before:left-0 before:top-0 before:-z-10 before:h-(--kz-ind-h) before:w-(--kz-ind-w) \" +\n \"before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:border before:border-border-default before:bg-surface-0 before:bg-sheen \" +\n \"before:opacity-0 before:shadow-raised before:transition-[translate,width,height,opacity] before:duration-300 motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n segment:\n \"inline-flex min-h-9 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-lg px-3.5 text-sm font-semibold text-fg-secondary transition-colors \" +\n \"hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border data-[state=checked]:border-border-default data-[state=checked]:bg-surface-0 data-[state=checked]:text-fg data-[state=checked]:shadow-raised \" +\n \"group-data-[indicator=on]/seg:data-[state=checked]:border-transparent group-data-[indicator=on]/seg:data-[state=checked]:bg-transparent group-data-[indicator=on]/seg:data-[state=checked]:shadow-none\",\n },\n variants: {\n variant: {\n list: {},\n cards: { root: \"grid-cols-[repeat(auto-fit,minmax(10rem,1fr))] gap-3\" },\n buttons: { root: \"flex flex-wrap gap-2.5 pb-1\" },\n segmented: {},\n },\n },\n defaultVariants: { variant: \"list\" },\n});\nconst s = radioGroup();\n\nexport type RadioGroupRootProps = React.ComponentProps<typeof RadioGroupPrimitive.Root> & {\n /** The group's accessible name — passed translated (or `aria-labelledby` a visible heading). */\n label?: string;\n /** Marks every radio invalid: aria-invalid (pair it with a `Field.Error`). */\n invalid?: boolean;\n /**\n * The layout of the radios: `list` (dots), `cards` (a grid of `Card`s), `buttons` (a row of tactile `Button`s), or\n * `segmented` (a track of `Segment`s, one light gliding to the choice).\n * @default \"list\"\n */\n variant?: \"list\" | \"cards\" | \"buttons\" | \"segmented\";\n /** Binds the choice to this search parameter of the URL (`?kind=…`): the URL is the state — for a view's selection (a segmented switch), not a form field. */\n routeKey?: string;\n /** The values the parameter may hold (the radios' `value`s); the first is the default unless `defaultValue` says otherwise. */\n routeValues?: readonly string[];\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation`, `required`, `name` for a form, `variant` for the layout. */\nexport function RadioGroupRoot({ label, invalid, variant = \"list\", className, routeKey, routeValues, ...rest }: RadioGroupRootProps) {\n const props = useRouteBinding(routeKey, routeValues, rest);\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=radio]\", active: \"[role=radio][data-state=checked]\" });\n const segmented = variant === \"segmented\";\n return (\n <RadioGroupPrimitive.Root\n ref={segmented ? ref : undefined}\n aria-label={label}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? \"\" : undefined}\n data-variant={variant}\n orientation={segmented ? \"horizontal\" : props.orientation}\n className={segmented ? s.segmented({ className: [\"group/seg\", className].filter(Boolean).join(\" \") }) : radioGroup({ variant }).root({ className })}\n {...props}\n />\n );\n}\n\nexport type RadioGroupItemProps = Omit<React.ComponentProps<typeof RadioGroupPrimitive.Item>, \"children\"> & {\n /** The words next to the dot, clickable. Otherwise name it with `Field.Label htmlFor` or `aria-label`. */\n children?: React.ReactNode;\n};\n\n/** A radio: a dot, and its words when given. */\nexport function RadioGroupItem({ className, children, ...props }: RadioGroupItemProps) {\n const item = (\n <RadioGroupPrimitive.Item className={s.item({ className: children ? \"mt-0.5\" : className })} {...props}>\n <RadioGroupPrimitive.Indicator className={s.dot()} />\n </RadioGroupPrimitive.Item>\n );\n if (!children) return item;\n return (\n <label className={s.label({ className })}>\n {item}\n <span className=\"min-w-0\">{children}</span>\n </label>\n );\n}\n\n/** A whole card as the radio: its content is the radio's name; its check lights up when chosen. */\nexport function RadioGroupCard({ className, children, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return (\n <RadioGroupPrimitive.Item className={s.card({ className })} {...props}>\n {children}\n <span aria-hidden className={s.cardCheck()}>\n <RadioGroupPrimitive.Indicator forceMount className=\"inline-flex data-[state=unchecked]:hidden\">\n <CheckGlyph className=\"h-3 w-3\" />\n </RadioGroupPrimitive.Indicator>\n </span>\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport type RadioGroupButtonProps = React.ComponentProps<typeof RadioGroupPrimitive.Item> & {\n /** A second line under the words (\"+15 %\"), part of the radio's name. */\n hint?: React.ReactNode;\n};\n\n/** A tactile key: raised on its ledge, pressed in while held and once chosen — sizes, a tip, a level. */\nexport function RadioGroupButton({ className, children, hint, ...props }: RadioGroupButtonProps) {\n return (\n <RadioGroupPrimitive.Item className={s.button({ className: [\"group\", className].filter(Boolean).join(\" \") })} {...props}>\n <span>{children}</span>\n {hint ? <span className={s.buttonHint()}>{hint}</span> : null}\n </RadioGroupPrimitive.Item>\n );\n}\n\n/** A segment of a `variant=\"segmented\"` group: equal widths, one light gliding to the choice. */\nexport function RadioGroupSegment({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return <RadioGroupPrimitive.Item className={s.segment({ className })} {...props} />;\n}\n\n/** `RadioGroup.Root/Item/Card/Button/Segment`. */\nexport const RadioGroup = { Root: RadioGroupRoot, Item: RadioGroupItem, Card: RadioGroupCard, Button: RadioGroupButton, Segment: RadioGroupSegment };\n","// The shared sliding indicator (NavBar, Tabs): one element that glides from item to item instead of each item lighting\n// up on its own. It writes the target's box as CSS variables on the list (`--kz-ind-x/y/w/h`) and `data-indicator=\"on\"`\n// — no re-render, no animation frame: the glide is a CSS transition (none under reduced motion). Before hydration the\n// items keep their own active style, so nothing flashes.\nimport * as React from \"react\";\n\nconst useIsoLayoutEffect = typeof window === \"undefined\" ? React.useEffect : React.useLayoutEffect;\n\n/**\n * `item`: the selector of an item; `active`: of the current one, where the light rests; `prefer`: an item that, when\n * present, holds the light before the current one (the NavBar's open menu); `follow`: the light follows the pointer\n * and the focus — over anything that is not an item (an open menu's panel) it goes back to rest.\n */\nexport function useSlidingIndicator<T extends HTMLElement>({ item, active, prefer, follow = false }: { item: string; active: string; prefer?: string; follow?: boolean }) {\n const ref = React.useRef<T>(null);\n const place = React.useCallback((target: Element | null) => {\n const list = ref.current;\n if (!list) return;\n if (!(target instanceof HTMLElement) || !list.contains(target)) {\n list.removeAttribute(\"data-indicator\");\n return;\n }\n const a = target.getBoundingClientRect();\n const b = list.getBoundingClientRect();\n list.style.setProperty(\"--kz-ind-x\", `${a.left - b.left + list.scrollLeft}px`);\n list.style.setProperty(\"--kz-ind-y\", `${a.top - b.top + list.scrollTop}px`);\n list.style.setProperty(\"--kz-ind-w\", `${a.width}px`);\n list.style.setProperty(\"--kz-ind-h\", `${a.height}px`);\n list.setAttribute(\"data-indicator\", \"on\");\n }, []);\n const rest = React.useCallback(\n () => {\n const list = ref.current;\n // An item re-rendered under a resting pointer (a menu closing) keeps the light the pointer gave it.\n const hovered = follow ? list?.querySelector(`${item}:hover`) : null;\n place((prefer ? list?.querySelector(prefer) : null) ?? hovered ?? list?.querySelector(active) ?? null);\n },\n [place, active, prefer, item, follow],\n );\n const follow_ = React.useCallback((target: EventTarget) => {\n const hit = target instanceof Element ? target.closest(item) : null;\n if (hit && ref.current?.contains(hit)) place(hit);\n else rest();\n }, [item, place, rest]);\n\n useIsoLayoutEffect(() => {\n const list = ref.current;\n if (!list) return;\n rest();\n const resize = new ResizeObserver(rest);\n resize.observe(list);\n const changes = new MutationObserver(rest);\n changes.observe(list, { subtree: true, attributes: true, attributeFilter: [\"data-state\", \"aria-current\", \"data-active\"] });\n return () => {\n resize.disconnect();\n changes.disconnect();\n };\n }, [rest]);\n\n const handlers = follow\n ? {\n onPointerOver: (e: React.PointerEvent) => follow_(e.target),\n onPointerLeave: rest,\n onFocus: (e: React.FocusEvent) => follow_(e.target),\n onBlur: rest,\n }\n : {};\n return { ref, handlers };\n}\n","import { createTV } from \"tailwind-variants\";\n\nimport { twMergeConfig } from \"./cn\";\n\n/** `tv` with the preset's utilities known to the merge engine (`twMergeConfig`): what a primitive wearing the material is styled with. */\nexport const tv = createTV({ twMergeConfig });\n","// Client. Radix Switch: role=\"switch\", aria-checked, Space and Enter toggle, a hidden input inside a form.\nimport { Switch as SwitchPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const switchVariants = tv({\n slots: {\n root:\n \"peer relative inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent bg-fg-muted transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 \" +\n \"disabled:cursor-not-allowed disabled:opacity-40 data-[state=checked]:bg-accent aria-invalid:border-danger\",\n thumb:\n \"pointer-events-none block rounded-full bg-fg-on-media shadow-sm transition-transform data-[state=unchecked]:translate-x-0.5 motion-reduce:transition-none\",\n },\n variants: {\n size: {\n sm: { root: \"h-5 w-9\", thumb: \"h-4 w-4 data-[state=checked]:translate-x-[1.125rem]\" },\n md: { root: \"h-6 w-11\", thumb: \"h-5 w-5 data-[state=checked]:translate-x-[1.375rem]\" },\n },\n },\n defaultVariants: { size: \"md\" },\n});\n\nexport type SwitchVariants = VariantProps<typeof switchVariants>;\n\ntype Named =\n | {\n /** The accessible name — required when no visible label names it, passed translated. */\n label: string;\n }\n /** Named by a visible `<label htmlFor={id}>` (e.g. `Field.Label`). */\n | { label?: undefined; id: string }\n /** Named by another element. */\n | { label?: undefined; \"aria-labelledby\": string };\n\nexport type SwitchProps = Omit<React.ComponentProps<typeof SwitchPrimitive.Root>, \"children\"> &\n SwitchVariants &\n Named & {\n /**\n * sm · md.\n * @default \"md\"\n */\n size?: SwitchVariants[\"size\"];\n /** Marks it invalid: aria-invalid and data-invalid. */\n invalid?: boolean;\n };\n\n/** An on/off switch: `checked`/`defaultChecked` + `onCheckedChange`. */\nexport function Switch({ label, size, invalid, className, ...props }: SwitchProps) {\n const s = switchVariants({ size });\n return (\n <SwitchPrimitive.Root\n aria-label={label}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? \"\" : undefined}\n className={s.root({ className })}\n {...props}\n >\n <SwitchPrimitive.Thumb className={s.thumb()} />\n </SwitchPrimitive.Root>\n );\n}\n","// Client (a radio group). The language of the account, labelled, each language named in its own language, saved per user\n// (the caller saves on change or with its section). Segmented: one light gliding to the choice.\nimport * as React from \"react\";\n\nimport { RadioGroup } from \"../radio-group\";\nimport { GroupHead } from \"./group-head\";\n\nexport interface LanguageOption {\n /** The BCP 47 code (`fr`, `en`): the value, and the `lang` of the name. */\n code: string;\n /** Its native name (`Français`, `English`) — never the current language's name for it. */\n name: string;\n}\n\nexport type LanguagePickerProps = Omit<React.ComponentProps<typeof RadioGroup.Root>, \"children\" | \"variant\" | \"label\" | \"aria-labelledby\"> & {\n /** The visible label (“Language”) — passed translated. */\n label: React.ReactNode;\n /**\n * Shows the label above the control; `false` when a `SettingsRow` already says it (the group keeps its accessible name).\n * @default true\n */\n showLabel?: boolean;\n /** One line under it: what it changes. */\n description?: React.ReactNode;\n /** The languages offered. */\n languages: readonly LanguageOption[];\n /** The chosen code (controlled). */\n value?: string;\n /** The viewer chooses another language. */\n onValueChange?: (code: string) => void;\n};\n\n/** The language control of an account page: a labelled segmented choice, native names. */\nexport function LanguagePicker({ label, showLabel = true, description, languages, className, ...props }: LanguagePickerProps) {\n const id = React.useId();\n return (\n <div className={[\"flex flex-col gap-2\", className].filter(Boolean).join(\" \")}>\n {showLabel ? <GroupHead id={`${id}-label`} label={label} description={description} /> : null}\n <RadioGroup.Root variant=\"segmented\" aria-label={showLabel ? undefined : String(label)} aria-labelledby={showLabel ? `${id}-label` : undefined} {...props}>\n {languages.map((language) => (\n <RadioGroup.Segment key={language.code} value={language.code} lang={language.code}>\n {language.name}\n </RadioGroup.Segment>\n ))}\n </RadioGroup.Root>\n </div>\n );\n}\n","import type * as React from \"react\";\n\n/** The visible label (and one line of help) of a radio group: the group's `aria-labelledby` points at it. */\nexport function GroupHead({ id, label, description }: { id: string; label: React.ReactNode; description?: React.ReactNode }) {\n return (\n <div className=\"flex flex-col gap-0.5\">\n <span id={id} className=\"text-sm font-medium text-fg\">\n {label}\n </span>\n {description ? <span className=\"text-sm text-fg-secondary\">{description}</span> : null}\n </div>\n );\n}\n","// Client (a radio group). The pictures of a person to choose from — the family's default avatars, a few photos — as a grid of\n// round tiles: one named radiogroup, one tab stop, the arrows choose, a ring and a check on the chosen one.\nimport { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { DEFAULT_AVATAR_TONES,type DefaultAvatar, type DefaultAvatarBrand, type DefaultAvatarEntityKind, defaultAvatarUrl } from \"../avatar/default-avatar\";\nimport { cn } from \"../cn\";\nimport { Dropzone, type DropzoneProps } from \"../file-upload\";\nimport { CheckGlyph } from \"../glyphs\";\nimport { GroupHead } from \"./group-head\";\n\n/** The value of the « no picture » tile (`noneLabel`). */\nexport const AVATAR_NONE = \"none\";\n\nexport interface AvatarOption {\n /** The value of the choice. */\n id: string;\n /** Its name for assistive technology (“Teinte 3”) — passed translated. */\n label: string;\n /** A picture's address; otherwise `defaultAvatar` draws one of the family's pictures. */\n src?: string;\n /** One of Krizaka's default pictures (`{ brand, tone }`). */\n defaultAvatar?: DefaultAvatar;\n /** What this picture is of; a picker of another `kind` never lists it. Read from `defaultAvatar.kind` when not given (`plain` is a person's). */\n kind?: DefaultAvatarEntityKind;\n}\n\n/** What an option is of, when it says: its own `kind`, else its default picture's. */\nexport function avatarOptionKind(option: AvatarOption): DefaultAvatarEntityKind | undefined {\n const kind = option.kind ?? option.defaultAvatar?.kind;\n return kind === \"plain\" ? \"person\" : kind;\n}\n\n/** The pictures that fit `kind`: an option of another kind is dropped, so a folder is never offered a person. Options that do not say what they are stay. */\nexport function optionsOfKind(options: readonly AvatarOption[], kind: DefaultAvatarEntityKind): AvatarOption[] {\n return options.filter((option) => {\n const own = avatarOptionKind(option);\n return own === undefined || own === kind;\n });\n}\n\n/** The pictures drawn here for a kind: the brand's six tones, no request. Used when the app passes no `options`. */\nexport function builtInAvatarOptions(kind: DefaultAvatarEntityKind, brand: DefaultAvatarBrand, label: (tone: number) => string): AvatarOption[] {\n return Array.from({ length: DEFAULT_AVATAR_TONES }, (_, i) => ({ id: `${kind}-${i + 1}`, label: label(i + 1), kind, defaultAvatar: { brand, kind, tone: i + 1 } }));\n}\n\nexport type AvatarPickerProps = Omit<React.ComponentProps<typeof RadioGroupPrimitive.Root>, \"children\" | \"onChange\" | \"dir\"> & {\n /** The group's accessible name (“Profile picture”) — passed translated. */\n label: string;\n /**\n * Smaller tiles, for a settings row.\n * @default false\n */\n dense?: boolean;\n /** Shows the label above the grid, with `description` under it. */\n showLabel?: boolean;\n /** One line under the visible label: what it changes. */\n description?: React.ReactNode;\n /**\n * What the pictures are of: `person` (default), `folder`, `organisation` or `shop`. Only the options of this kind are listed.\n * @default \"person\"\n */\n kind?: DefaultAvatarEntityKind;\n /** The pictures — the central set of the kind (`listDefaults(kind)` of `@krizaka/org`) turned into options, with `src`. */\n options: readonly AvatarOption[];\n /** Adds a « no picture » tile first, chosen with the value `AVATAR_NONE`; the words of the tile, passed translated. */\n noneLabel?: string;\n /** The library's upload control under the grid: a `Dropzone` (a real file input), for a picture of one's own. */\n uploadFile?: Pick<DropzoneProps, \"title\" | \"browseLabel\" | \"hint\" | \"accept\" | \"maxSize\" | \"disabled\" | \"refusalLabel\" | \"onReject\"> & { onFile: (file: File) => void };\n /** The chosen id (controlled). */\n value?: string;\n /** The viewer chooses another picture. */\n onValueChange?: (id: string) => void;\n /** After the pictures, in the grid: the upload action (a `Button`, a file input's label). Not a radio. */\n upload?: React.ReactNode;\n};\n\nconst pictureOf = (option: AvatarOption) => option.src ?? (option.defaultAvatar ? defaultAvatarUrl(option.defaultAvatar, { size: 256 }) : undefined);\n\n/** A grid of pictures to choose from, with an upload beside them: a radio group, never a row of loose radios. */\nexport function AvatarPicker({ label, showLabel, description, dense, kind = \"person\", options, noneLabel, uploadFile, upload, className, ...props }: AvatarPickerProps) {\n const id = React.useId();\n const listed = optionsOfKind(options, kind);\n const tile = cn(\n \"group/avatar relative shrink-0 rounded-full\",\n dense ? \"h-12 w-12\" : \"aspect-square w-full\",\n \"outline-none transition-shadow duration-200 motion-reduce:transition-none\",\n \"ring-1 ring-border-default hover:ring-border-strong focus-visible:focus-ring data-[state=checked]:ring-2 data-[state=checked]:ring-accent\",\n );\n const check = (\n <span\n aria-hidden\n className=\"absolute -bottom-0.5 -right-0.5 hidden h-5 w-5 items-center justify-center rounded-full border-2 border-surface-1 bg-accent text-on-accent group-data-[state=checked]/avatar:inline-flex\"\n >\n <CheckGlyph className=\"h-3 w-3\" />\n </span>\n );\n const group = (\n <RadioGroupPrimitive.Root aria-label={label} aria-labelledby={showLabel ? id : undefined} className={cn(dense ? \"flex flex-wrap gap-2.5\" : \"grid grid-cols-[repeat(auto-fill,minmax(4.25rem,1fr))] gap-3\", !showLabel && !uploadFile && className)} {...props}>\n {noneLabel ? (\n <RadioGroupPrimitive.Item value={AVATAR_NONE} aria-label={noneLabel} className={tile}>\n <span aria-hidden className=\"flex h-full w-full items-center justify-center rounded-full bg-surface-3 text-fg-secondary\">\n <svg viewBox=\"0 0 24 24\" className=\"h-1/2 w-1/2\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"8\" />\n <path d=\"M6.5 17.5l11-11\" />\n </svg>\n </span>\n {check}\n </RadioGroupPrimitive.Item>\n ) : null}\n {listed.map((option) => (\n <RadioGroupPrimitive.Item key={option.id} value={option.id} aria-label={option.label} className={tile}>\n <img src={pictureOf(option)} alt=\"\" draggable={false} className=\"h-full w-full rounded-full bg-surface-3 object-cover\" />\n {check}\n </RadioGroupPrimitive.Item>\n ))}\n {upload ? <div className=\"flex aspect-square w-full items-center justify-center\">{upload}</div> : null}\n </RadioGroupPrimitive.Root>\n );\n const withUpload = uploadFile ? (\n <div className={cn(\"flex flex-col gap-3\", !showLabel && className)}>\n {group}\n <Dropzone {...uploadFile} onFiles={(files) => files[0] && uploadFile.onFile(files[0])} />\n </div>\n ) : (\n group\n );\n if (!showLabel) return withUpload;\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n <GroupHead id={id} label={label} description={description} />\n {withUpload}\n </div>\n );\n}\n","// Client. Three parts that work alone or together:\n// - `Dropzone`: drop files on it or pick them with its button (a real `<input type=\"file\">`, so the keyboard and the\n// phone's camera / files sheet work); it checks the type, the size and the count, and hands over the accepted files\n// and the refused ones with their reason;\n// - `UploadList`: each file with its preview, size, progress, speed, and the actions its state allows (pause, resume,\n// retry, cancel, remove); the progress is a `progressbar`, a failure is announced;\n// - `useUploadQueue`: runs the app's `upload(file, { signal, onProgress, resumed })` with a concurrency, pauses by\n// aborting the signal and resumes by calling it again with `resumed: true` — what a Tus client (tus-js-client's\n// `abort()` / `start()`) or a multipart upload needs, without depending on either. The line (concurrency, retries\n// with backoff, pause per file) is `createQueue` of @krizaka/pacer.\nimport { getNumberFormat } from \"@krizaka/intl\";\nimport { type QueueOptions } from \"@krizaka/pacer\";\nimport { useQueue, useQueueSnapshot } from \"@krizaka/pacer/react\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { CloseGlyph, FileGlyph, PauseGlyph, PlayGlyph, RetryGlyph, UploadGlyph } from \"../glyphs\";\nimport { useLatest } from \"../media\";\nimport { Progress } from \"../progress\";\n\nexport const fileUpload = tv({\n slots: {\n zone:\n \"relative flex w-full flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed border-border-default bg-surface-1 px-6 py-10 text-center \" +\n \"transition-colors data-[dragging]:border-accent data-[dragging]:bg-accent-soft data-[disabled]:opacity-50 has-[:focus-visible]:border-accent\",\n zoneIcon: \"flex h-12 w-12 items-center justify-center rounded-full bg-surface-3 text-fg-secondary\",\n zoneTitle: \"text-sm font-semibold text-fg\",\n zoneHint: \"text-xs text-fg-secondary\",\n browse:\n \"inline-flex h-9 items-center justify-center rounded-lg bg-accent px-4 text-sm font-semibold text-on-accent transition-colors hover:bg-accent-hover \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 disabled:pointer-events-none\",\n refusals: \"w-full text-left text-xs font-medium text-fg-danger\",\n list: \"flex w-full flex-col gap-2\",\n item: \"flex items-center gap-3 rounded-xl border border-border-default bg-surface-1 p-3 data-[status=error]:border-danger/60\",\n preview: \"flex h-12 w-12 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-surface-3 text-fg-secondary\",\n body: \"flex min-w-0 flex-1 flex-col gap-1.5\",\n name: \"truncate text-sm font-semibold text-fg\",\n meta: \"flex flex-wrap gap-x-2 text-xs tabular-nums text-fg-secondary\",\n error: \"text-xs font-medium text-fg-danger\",\n actions: \"flex shrink-0 items-center gap-1\",\n action:\n \"inline-flex h-8 w-8 items-center justify-center rounded-md text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n },\n});\n\n/** Why a file was refused. */\nexport type FileRejection = { file: File; reason: \"type\" | \"size\" | \"count\" };\n\n/** Whether a file matches an `accept` list (`\"video/*,.mov,image/png\"`). */\nexport function acceptsFile(file: File, accept?: string): boolean {\n if (!accept) return true;\n const name = file.name.toLowerCase();\n const type = file.type.toLowerCase();\n return accept\n .split(\",\")\n .map((rule) => rule.trim().toLowerCase())\n .filter(Boolean)\n .some((rule) => (rule.startsWith(\".\") ? name.endsWith(rule) : rule.endsWith(\"/*\") ? type.startsWith(rule.slice(0, -1)) : type === rule));\n}\n\n/** A size in the locale's words (`\"1.4 GB\"`, `\"820 kB\"`), through `@krizaka/intl`. */\nexport function formatBytes(bytes: number, locale = \"en\"): string {\n const units = [\"byte\", \"kilobyte\", \"megabyte\", \"gigabyte\", \"terabyte\"] as const;\n let value = Math.max(0, bytes);\n let unit = 0;\n while (value >= 1000 && unit < units.length - 1) {\n value /= 1000;\n unit += 1;\n }\n return getNumberFormat(locale, { style: \"unit\", unit: units[unit], unitDisplay: \"short\", maximumFractionDigits: value < 10 && unit > 0 ? 1 : 0 }).format(value);\n}\n\nexport type DropzoneProps = {\n /** The title in the zone (\"Drop your video here\"), passed translated. */\n title: string;\n /** The button that opens the file picker (\"Choose a file\"), passed translated. */\n browseLabel: string;\n /** What is accepted, in words (\"MP4 or MOV, up to 4 GB\"). */\n hint?: string;\n /** The types accepted, as the `accept` attribute (`\"video/*\"`, `\"image/png,.pdf\"`). */\n accept?: string;\n /** The largest file, in bytes. */\n maxSize?: number;\n /** The most files at once (1 unless `multiple`). */\n maxFiles?: number;\n /** Several files at once. */\n multiple?: boolean;\n /** Not available (an upload is running). */\n disabled?: boolean;\n /** On a phone, opens the camera directly (`\"environment\"` the back one, `\"user\"` the front one). */\n capture?: \"user\" | \"environment\";\n /** Called with the files accepted (never empty). */\n onFiles: (files: File[]) => void;\n /** Called with the files refused and why (show `refusalLabel`'s words, or your own). */\n onReject?: (rejections: FileRejection[]) => void;\n /** The words of a refusal, shown in the zone: `(r) => r.file.name + \" is too large\"`. Without it, nothing is shown. */\n refusalLabel?: (rejection: FileRejection) => string;\n /** The accessible name of the file input, passed translated. Defaults to `title`. */\n inputLabel?: string;\n /** An icon instead of the upload glyph. */\n icon?: React.ReactNode;\n /** Classes merged on the zone. */\n className?: string;\n};\n\n/** A zone to drop files on, with a button that opens the picker: checks type, size and count. */\nexport function Dropzone({\n title,\n browseLabel,\n hint,\n accept,\n maxSize,\n maxFiles,\n multiple,\n disabled,\n capture,\n onFiles,\n onReject,\n refusalLabel,\n inputLabel,\n icon,\n className,\n}: DropzoneProps) {\n const s = fileUpload();\n const input = React.useRef<HTMLInputElement>(null);\n const [dragging, setDragging] = React.useState(false);\n const [refused, setRefused] = React.useState<FileRejection[]>([]);\n const depth = React.useRef(0);\n const id = React.useId();\n const limit = maxFiles ?? (multiple ? Infinity : 1);\n\n const take = (list: FileList | File[]) => {\n const files = [...list];\n const accepted: File[] = [];\n const rejections: FileRejection[] = [];\n for (const file of files) {\n if (!acceptsFile(file, accept)) rejections.push({ file, reason: \"type\" });\n else if (maxSize !== undefined && file.size > maxSize) rejections.push({ file, reason: \"size\" });\n else if (accepted.length >= limit) rejections.push({ file, reason: \"count\" });\n else accepted.push(file);\n }\n setRefused(rejections);\n if (accepted.length) onFiles(accepted);\n if (rejections.length) onReject?.(rejections);\n };\n\n return (\n <div\n className={s.zone({ className })}\n data-dragging={dragging ? \"\" : undefined}\n data-disabled={disabled ? \"\" : undefined}\n onDragEnter={(event) => {\n if (disabled) return;\n event.preventDefault();\n depth.current += 1;\n setDragging(true);\n }}\n onDragOver={(event) => {\n if (disabled) return;\n event.preventDefault();\n event.dataTransfer.dropEffect = \"copy\";\n }}\n onDragLeave={() => {\n depth.current = Math.max(0, depth.current - 1);\n if (depth.current === 0) setDragging(false);\n }}\n onDrop={(event) => {\n if (disabled) return;\n event.preventDefault();\n depth.current = 0;\n setDragging(false);\n take(event.dataTransfer.files);\n }}\n >\n <span className={s.zoneIcon()} aria-hidden>\n {icon ?? <UploadGlyph className=\"h-6 w-6\" />}\n </span>\n <p id={`${id}-title`} className={s.zoneTitle()}>\n {title}\n </p>\n {hint ? (\n <p id={`${id}-hint`} className={s.zoneHint()}>\n {hint}\n </p>\n ) : null}\n <button\n type=\"button\"\n className={s.browse()}\n disabled={disabled}\n aria-describedby={[`${id}-title`, hint ? `${id}-hint` : null].filter(Boolean).join(\" \")}\n onClick={() => input.current?.click()}\n >\n {browseLabel}\n </button>\n <input\n ref={input}\n type=\"file\"\n tabIndex={-1}\n aria-hidden\n aria-label={inputLabel ?? title}\n className=\"sr-only\"\n accept={accept}\n multiple={multiple}\n capture={capture}\n disabled={disabled}\n onChange={(event) => {\n if (event.target.files?.length) take(event.target.files);\n event.target.value = \"\";\n }}\n />\n {refusalLabel && refused.length > 0 ? (\n <ul role=\"alert\" className={s.refusals()}>\n {refused.map((r) => (\n <li key={`${r.file.name}-${r.reason}`}>{refusalLabel(r)}</li>\n ))}\n </ul>\n ) : null}\n </div>\n );\n}\n\nexport type UploadStatus = \"queued\" | \"uploading\" | \"paused\" | \"done\" | \"error\";\n\nexport type UploadItem = {\n /** A stable id. */\n id: string;\n /** The file's name. */\n name: string;\n /** Its size, in bytes. */\n size: number;\n /** Its MIME type (`video/mp4`): picks the preview. */\n type?: string;\n /** Sent so far, between 0 and 1. */\n progress: number;\n /** Where it stands. */\n status: UploadStatus;\n /** Why it failed, passed translated. */\n error?: string;\n /** A preview (an object URL of the file, a thumbnail from the server). */\n previewUrl?: string;\n /** Bytes per second, for the speed and the time left. */\n speed?: number;\n};\n\nexport type UploadListLabels = {\n /** The list's accessible name (\"Uploads\"). */\n list: string;\n pause: (name: string) => string;\n resume: (name: string) => string;\n retry: (name: string) => string;\n cancel: (name: string) => string;\n remove: (name: string) => string;\n /** A state in words: `(status) => \"Paused\"`… */\n status: (status: UploadStatus) => string;\n /** The time left: `(seconds) => \"2 min left\"`. */\n remaining: (seconds: number) => string;\n};\n\nexport const uploadListLabels: UploadListLabels = {\n list: \"Uploads\",\n pause: (name) => `Pause ${name}`,\n resume: (name) => `Resume ${name}`,\n retry: (name) => `Retry ${name}`,\n cancel: (name) => `Cancel ${name}`,\n remove: (name) => `Remove ${name}`,\n status: (status) => ({ queued: \"Waiting\", uploading: \"Uploading\", paused: \"Paused\", done: \"Uploaded\", error: \"Failed\" })[status],\n remaining: (seconds) => (seconds < 60 ? `${Math.ceil(seconds)} s left` : `${Math.ceil(seconds / 60)} min left`),\n};\n\nexport type UploadListProps = {\n /** The uploads, as `useUploadQueue` gives them (or your own state). */\n items: readonly UploadItem[];\n /** Pauses an upload (shown while it uploads, when given). */\n onPause?: (id: string) => void;\n /** Resumes a paused one. */\n onResume?: (id: string) => void;\n /** Tries a failed one again. */\n onRetry?: (id: string) => void;\n /** Stops an upload under way and drops it. */\n onCancel?: (id: string) => void;\n /** Drops a finished or failed one from the list. */\n onRemove?: (id: string) => void;\n /** The locale of sizes and speeds. Default `\"en\"`. */\n locale?: string;\n /** The words, passed translated; English by default. */\n labels?: Partial<UploadListLabels>;\n /** Classes merged on the list. */\n className?: string;\n};\n\nfunction Preview({ item }: { item: UploadItem }) {\n if (item.previewUrl && item.type?.startsWith(\"image/\")) return <img src={item.previewUrl} alt=\"\" className=\"h-full w-full object-cover\" />;\n if (item.previewUrl && item.type?.startsWith(\"video/\")) return <video src={item.previewUrl} muted playsInline preload=\"metadata\" className=\"h-full w-full object-cover\" aria-hidden />;\n return <FileGlyph className=\"h-5 w-5\" />;\n}\n\n/** The files being sent: preview, size, progress, speed and time left, and the actions each state allows. */\nexport function UploadList({ items, onPause, onResume, onRetry, onCancel, onRemove, locale = \"en\", labels: given, className }: UploadListProps) {\n const labels = { ...uploadListLabels, ...given };\n const s = fileUpload();\n const action = (label: string, run: () => void, glyph: React.ReactNode) => (\n <button type=\"button\" className={s.action()} aria-label={label} title={label} onClick={run}>\n {glyph}\n </button>\n );\n return (\n <ul aria-label={labels.list} className={s.list({ className })}>\n {items.map((item) => {\n const left = item.status === \"uploading\" && item.speed ? ((1 - item.progress) * item.size) / item.speed : null;\n return (\n <li key={item.id} className={s.item()} data-status={item.status}>\n <span className={s.preview()}>\n <Preview item={item} />\n </span>\n <div className={s.body()}>\n <p className={s.name()}>{item.name}</p>\n {item.status !== \"done\" && item.status !== \"error\" ? (\n <Progress size=\"sm\" label={item.name} value={item.status === \"queued\" ? null : Math.round(item.progress * 100)} />\n ) : null}\n <p className={s.meta()}>\n <span>{labels.status(item.status)}</span>\n <span>{item.status === \"done\" ? formatBytes(item.size, locale) : `${formatBytes(item.progress * item.size, locale)} / ${formatBytes(item.size, locale)}`}</span>\n {item.status === \"uploading\" && item.speed ? <span>{formatBytes(item.speed, locale)}/s</span> : null}\n {left !== null ? <span>{labels.remaining(left)}</span> : null}\n </p>\n {item.status === \"error\" && item.error ? (\n <p role=\"alert\" className={s.error()}>\n {item.error}\n </p>\n ) : null}\n </div>\n <div className={s.actions()}>\n {item.status === \"uploading\" && onPause && action(labels.pause(item.name), () => onPause(item.id), <PauseGlyph className=\"h-4 w-4\" />)}\n {item.status === \"paused\" && onResume && action(labels.resume(item.name), () => onResume(item.id), <PlayGlyph className=\"h-4 w-4\" />)}\n {item.status === \"error\" && onRetry && action(labels.retry(item.name), () => onRetry(item.id), <RetryGlyph className=\"h-4 w-4\" />)}\n {(item.status === \"done\" || item.status === \"error\") && onRemove\n ? action(labels.remove(item.name), () => onRemove(item.id), <CloseGlyph className=\"h-4 w-4\" />)\n : item.status !== \"done\" && onCancel\n ? action(labels.cancel(item.name), () => onCancel(item.id), <CloseGlyph className=\"h-4 w-4\" />)\n : null}\n </div>\n </li>\n );\n })}\n </ul>\n );\n}\n\nexport type UploadContext = {\n /** Aborted on pause and cancel: stop sending (`tusUpload.abort()`, `xhr.abort()`). */\n signal: AbortSignal;\n /** Report the bytes sent so far. */\n onProgress: (sent: number) => void;\n /** `true` when this call resumes a paused or failed upload (a Tus client then continues from its offset). */\n resumed: boolean;\n};\n\nexport type UploadQueueOptions = {\n /** Sends one file; resolves when it is done, rejects on failure (its `message` becomes the item's error). */\n upload: (file: File, context: UploadContext) => Promise<void>;\n /** How many files go at once. Default 2. */\n concurrency?: number;\n /** How many times a failed upload is tried again by itself (with `backoff`) before it shows its error. Default 0. */\n retries?: number;\n /** The wait between retries: exponential from 1 s by default (`@krizaka/pacer`). */\n backoff?: QueueOptions[\"backoff\"];\n /** Whether an error deserves another try (a 4xx never does). Default: every error does, up to `retries`. */\n shouldRetry?: QueueOptions[\"shouldRetry\"];\n /** Makes an object URL for each file to preview (revoked when it leaves). Default `true`. */\n previews?: boolean;\n};\n\n/** What the screen reads of an upload besides its status: the file, how far it got, how fast. */\ntype UploadMeta = { file: File; progress: number; speed?: number; previewUrl?: string; last?: { at: number; sent: number } };\n\n/**\n * The state of an upload queue around the app's `upload` function: `add`, `pause`, `resume`, `retry`, `cancel`, `remove`.\n * The line itself — concurrency, retries with backoff, pause by aborting the signal — is `createQueue` of\n * `@krizaka/pacer`; this hook adds the files, their previews, their progress and their speed.\n */\nexport function useUploadQueue(options: UploadQueueOptions) {\n const { concurrency, retries, backoff, shouldRetry } = options;\n const latest = useLatest(options);\n const queue = useQueue<UploadMeta>({ concurrency: concurrency ?? 2, retries, backoff, shouldRetry });\n const jobs = useQueueSnapshot(queue);\n const metas = useLatest(new Map(jobs.map((job) => [job.id, job.meta])));\n\n const add = React.useCallback(\n (files: readonly File[]) => {\n const { previews = true } = latest.current;\n for (const file of files) {\n const id = `${file.name}-${file.size}-${Math.random().toString(36).slice(2, 8)}`;\n const previewUrl = previews && typeof URL.createObjectURL === \"function\" ? URL.createObjectURL(file) : undefined;\n queue.add(\n async ({ signal, resumed }) => {\n queue.update(id, (m) => ({ ...m, last: { at: Date.now(), sent: m.progress * file.size } }));\n try {\n await latest.current.upload(file, {\n signal,\n resumed,\n onProgress: (sent) => {\n if (signal.aborted) return;\n queue.update(id, (m) => {\n const now = Date.now();\n const last = m.last ?? { at: now, sent };\n const fresh = now - last.at > 400;\n return { ...m, progress: file.size ? Math.min(1, sent / file.size) : 0, speed: fresh ? ((sent - last.sent) / (now - last.at)) * 1000 : m.speed, last: fresh ? { at: now, sent } : last };\n });\n },\n });\n if (!signal.aborted) queue.update(id, (m) => ({ ...m, progress: 1, speed: undefined }));\n } catch (error) {\n if (!signal.aborted) queue.update(id, (m) => ({ ...m, speed: undefined }));\n throw error;\n }\n },\n { id, meta: { file, progress: 0, previewUrl } },\n );\n }\n },\n [latest, queue],\n );\n const forget = React.useCallback(\n (id: string) => {\n const url = metas.current.get(id)?.previewUrl;\n if (url) URL.revokeObjectURL(url);\n queue.cancel(id);\n },\n [metas, queue],\n );\n React.useEffect(\n () => () => {\n for (const meta of metas.current.values()) if (meta.previewUrl) URL.revokeObjectURL(meta.previewUrl);\n },\n [metas],\n );\n const pause = React.useCallback(\n (id: string) => {\n queue.pause(id);\n queue.update(id, (m) => ({ ...m, speed: undefined }));\n },\n [queue],\n );\n\n const items = React.useMemo<UploadItem[]>(\n () =>\n jobs.map(({ id, status, error, meta }) => ({\n id,\n name: meta.file.name,\n size: meta.file.size,\n type: meta.file.type,\n progress: meta.progress,\n status: status === \"running\" ? \"uploading\" : status,\n error: error?.message,\n previewUrl: meta.previewUrl,\n speed: status === \"running\" ? meta.speed : undefined,\n })),\n [jobs],\n );\n return { items, add, pause, resume: queue.resume, retry: queue.retry, cancel: forget, remove: forget };\n}\n","// Client (a radio group). A single choice as selectable cards — an icon, a title, one line: the side of a lease, a plan, a\n// way to get the answer. Built on `RadioGroup.Card`, so the arrows choose, the card is the radio, the check lights up.\nimport * as React from \"react\";\n\nimport { RadioGroup } from \"../radio-group\";\nimport { GroupHead } from \"./group-head\";\n\nexport interface ChoiceCardOption {\n /** The value of the choice. */\n id: string;\n /** Its name, short. */\n title: React.ReactNode;\n /** One line under the title: what it means. It describes the radio. */\n description?: React.ReactNode;\n /** A glyph before the title (decorative). */\n icon?: React.ReactNode;\n disabled?: boolean;\n}\n\nexport type ChoiceCardsProps = Omit<React.ComponentProps<typeof RadioGroup.Root>, \"children\" | \"variant\" | \"label\"> & {\n /** The question (“Which side of the lease are you?”) — the group's accessible name, passed translated. */\n label: string;\n /** Shows the question above the cards, with `description` under it. */\n showLabel?: boolean;\n /** One line under the visible question. */\n description?: React.ReactNode;\n /** The choices. */\n options: readonly ChoiceCardOption[];\n /** The chosen id (controlled). */\n value?: string;\n /** The viewer chooses another card. */\n onValueChange?: (id: string) => void;\n};\n\n/** Cards to choose one from: a radio group where each card has an icon, a title and a description. */\nexport function ChoiceCards({ label, showLabel, description, options, className, ...props }: ChoiceCardsProps) {\n const base = React.useId();\n const group = (\n <RadioGroup.Root variant=\"cards\" label={label} aria-labelledby={showLabel ? `${base}-label` : undefined} className={[\"grid grid-cols-1 gap-3 sm:grid-cols-2\", !showLabel && className].filter(Boolean).join(\" \")} {...props}>\n {options.map((option) => {\n const describedBy = option.description ? `${base}-${option.id}` : undefined;\n return (\n <RadioGroup.Card key={option.id} value={option.id} disabled={option.disabled} aria-describedby={describedBy}>\n <span className=\"flex items-center gap-2.5 font-semibold text-fg [&>svg]:h-5 [&>svg]:w-5 [&>svg]:text-accent\">\n {option.icon}\n {option.title}\n </span>\n {option.description ? (\n <span id={describedBy} className=\"text-sm font-normal text-fg-secondary\">\n {option.description}\n </span>\n ) : null}\n </RadioGroup.Card>\n );\n })}\n </RadioGroup.Root>\n );\n if (!showLabel) return group;\n return (\n <div className={[\"flex flex-col gap-3\", className].filter(Boolean).join(\" \")}>\n <GroupHead id={`${base}-label`} label={label} description={description} />\n {group}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAEA,SAAS,UAA6B;;;ACI/B,IAAM,cAAc,aAAa;AAAA,EACtC,MAAM;AAAA,EACN,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,SAAS;AAAA,MACT,QAAQ;AAAA;AAAA,MAER,OAAO;AAAA,IACT;AAAA,IACA,MAAM,EAAE,IAAI,2BAA2B,IAAI,0BAA0B;AAAA,IACrE,OAAO,EAAE,MAAM,2CAA2C;AAAA,EAC5D;AAAA,EACA,iBAAiB,EAAE,MAAM,WAAW,MAAM,KAAK;AACjD,CA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AE,KAAK;AAClE,WACE,gBAAAC,OAAC,WAAW,MAAX,EAAgC,OAAO,OAAO,IAAI,UAAU,OAAO,UAAU,oBAAkB,aAC9F;AAAA,sBAAAA,OAAC,UAAK,WAAU,+FACb;AAAA,eAAO;AAAA,QACP,OAAO;AAAA,SACV;AAAA,MACC,OAAO,cACN,gBAAAD,MAAC,UAAK,IAAI,aAAa,WAAU,yCAC9B,iBAAO,aACV,IACE;AAAA,SATgB,OAAO,EAU7B;AAAA,EAEJ,CAAC,GACH;AAEF,MAAI,CAAC,UAAW,QAAO;AACvB,SACE,gBAAAC,OAAC,SAAI,WAAW,CAAC,uBAAuB,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GACzE;AAAA,oBAAAD,MAAC,aAAU,IAAI,GAAG,IAAI,UAAU,OAAc,aAA0B;AAAA,IACvE;AAAA,KACH;AAEJ;","names":["jsx","jsxs","React","tv","jsx","jsxs","tv","tv","jsx","jsxs","tv","s","tv","jsx","s","React","jsx","jsxs","jsx","jsxs","jsx","jsxs","RadioGroupPrimitive","React","React","tv","jsx","jsxs","tv","s","jsxs","jsx","jsx","jsxs","RadioGroupPrimitive","React","jsx","jsxs"]}
1
+ {"version":3,"sources":["../src/badge/badge.tsx","../src/badge/recipe.ts","../src/account-settings/account-profile-card.tsx","../src/account-settings/appearance-settings.tsx","../src/field/field.tsx","../src/radio-group/radio-group.tsx","../src/sliding-indicator.ts","../src/tv.ts","../src/switch/switch.tsx","../src/account-settings/language-picker.tsx","../src/account-settings/group-head.tsx","../src/account-settings/avatar-picker.tsx","../src/file-upload/file-upload.tsx","../src/account-settings/choice-cards.tsx"],"sourcesContent":["// Server-safe: no hook, no context.\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { badgeRecipe } from \"./recipe\";\n\n// Status tones are soft (a tint, a coloured dot, a text role): the invariant status tokens are too light to carry\n// small text on a light surface, or to sit under white text (WCAG AA).\nexport const badgeVariants = tv(badgeRecipe);\n\nexport type BadgeVariants = VariantProps<typeof badgeVariants>;\n\nexport type BadgeProps = React.ComponentProps<\"span\"> &\n BadgeVariants & {\n /**\n * neutral · accent · success · warning · danger (soft tints, the text stays a text role) · scrim (on a media).\n * @default \"neutral\"\n */\n tone?: BadgeVariants[\"tone\"];\n /**\n * sm · md.\n * @default \"sm\"\n */\n size?: BadgeVariants[\"size\"];\n /** Makes the `dot` pulse (stopped under reduced motion). */\n pulse?: BadgeVariants[\"pulse\"];\n /** A small dot before the text, in the tone's colour (pulsing with `pulse`). */\n dot?: boolean;\n };\n\nexport function Badge({ tone, size, pulse, dot, className, children, ...props }: BadgeProps) {\n return (\n <span data-tone={tone ?? \"neutral\"} className={badgeVariants({ tone, size, pulse, className })} {...props}>\n {dot && <span data-dot=\"\" aria-hidden className=\"h-1.5 w-1.5 rounded-full bg-current\" />}\n {children}\n </span>\n );\n}\n","// The badge's tones and sizes, written once as classes of the Krizaka tokens: the web wears them with `tv(badgeRecipe)`,\n// React Native reads the same classes into styles (native/badge.tsx). Status tones are soft (a tint, a coloured dot, a\n// text role): the invariant status tokens are too light to carry small text on a light surface, or to sit under white\n// text (WCAG AA).\nimport { defineRecipe } from \"../recipes/define\";\n\nexport const badgeRecipe = defineRecipe({\n base: \"inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm font-semibold \",\n variants: {\n tone: {\n neutral: \"bg-surface-3 text-fg-secondary\",\n accent: \"bg-accent-soft text-fg ring-1 ring-inset ring-accent/40 [&>[data-dot]]:bg-accent\",\n success: \"bg-success/15 text-fg ring-1 ring-inset ring-success/40 [&>[data-dot]]:bg-success\",\n warning: \"bg-warning/15 text-fg ring-1 ring-inset ring-warning/40 [&>[data-dot]]:bg-warning\",\n danger: \"bg-danger/15 text-fg ring-1 ring-inset ring-danger/40 [&>[data-dot]]:bg-danger\",\n /** On a media: veil and text invariant, identical in both themes. */\n scrim: \"bg-scrim text-fg-on-media backdrop-blur-md\",\n },\n size: { sm: \"px-2 py-0.5 text-[10px]\", md: \"px-2.5 py-1 text-[11px]\" },\n pulse: { true: \"[&>[data-dot]]:motion-safe:animate-pulse\" },\n },\n defaultVariants: { tone: \"neutral\", size: \"sm\" },\n});\n","// Server-safe. Who the account is, at a glance: the picture with its change action, the name, the e-mail and whether it is\n// verified, since when. The head of a profile section.\nimport type * as React from \"react\";\n\nimport { Avatar, type AvatarProps } from \"../avatar/avatar\";\nimport { Badge } from \"../badge/badge\";\nimport { cn } from \"../cn\";\n\nexport type AccountProfileCardProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** The name (the card's heading). */\n name: string;\n /** The e-mail address. */\n email: string;\n /** Whether the address is verified. */\n verified: boolean;\n /** “Verified” — passed translated. */\n verifiedLabel: string;\n /** “Not verified” — passed translated. */\n unverifiedLabel: string;\n /** “Member since October 2026” — formatted by the app, in the viewer's language. */\n memberSince?: string;\n /** The picture: the person's photo, or the default avatar of the brand. */\n avatar?: Pick<AvatarProps, \"src\" | \"defaultAvatar\" | \"fallback\">;\n /** Beside the picture: the change action (a `Button`). */\n action?: React.ReactNode;\n /**\n * One calm line for a settings row: a medium picture beside the name and the e-mail, no wrapping.\n * @default false\n */\n compact?: boolean;\n};\n\n/** The account's identity card: picture, name, verified e-mail, member since. */\nexport function AccountProfileCard({ name, email, verified, verifiedLabel, unverifiedLabel, memberSince, avatar, action, compact, className, ...props }: AccountProfileCardProps) {\n return (\n <section aria-label={name} className={cn(\"flex items-center gap-3\", !compact && \"flex-col items-start gap-4 sm:flex-row sm:gap-5\", className)} {...props}>\n <div className=\"flex shrink-0 flex-col items-center gap-2\">\n <Avatar size={compact ? \"md\" : \"xl\"} alt=\"\" fallback={name.slice(0, 1)} {...avatar} />\n {action}\n </div>\n <div className=\"flex min-w-0 flex-col gap-1\">\n <h2 className={cn(\"m-0 truncate font-bold text-fg\", compact ? \"text-sm font-medium\" : \"text-lg\")}>{name}</h2>\n <p className=\"m-0 flex flex-wrap items-center gap-2 text-sm text-fg-secondary\">\n <span className=\"min-w-0 truncate\">{email}</span>\n <Badge tone={verified ? \"success\" : \"warning\"} dot>\n {verified ? verifiedLabel : unverifiedLabel}\n </Badge>\n </p>\n {memberSince ? <p className=\"text-sm text-fg-secondary\">{memberSince}</p> : null}\n </div>\n </section>\n );\n}\n","// Client (radio groups). How the workspace looks (ADR-006 §4, krizaka-ui#657): theme cards — a radio group of live miniatures\n// drawn from the tokens' own colours, one check on the chosen card —, then rows for the accent, the density, the language and, when the\n// product offers it, the sound (off by default, never under reduced motion). Driven by data: the product passes the themes it offers\n// (a subset of `appearance.themes` of @krizaka/tokens, at least system · light · dark), the accents that read on all of them, the values\n// and `onChange`s. It changes nothing by itself: `useAppearance()` of `@krizaka/ui/theme` applies the choice at once and keeps it in\n// the browser; the product saves it in the account too. Paper themes never belong here.\nimport * as React from \"react\";\n\nimport { Field } from \"../field\";\nimport { RadioGroup } from \"../radio-group\";\nimport { SettingsRow } from \"../settings-layout\";\nimport { Switch } from \"../switch\";\nimport { type LanguageOption, LanguagePicker } from \"./language-picker\";\n\n/** The colours a theme's miniature is drawn with (`appearance.themes[i].preview` of @krizaka/tokens). */\nexport type ThemePreview = { surface0: string; surface1: string; surface2: string; text: string; muted: string };\n\nexport type ThemeCardOption = {\n /** `system`, `light`, `dark`, `blueprint`, `carbone`. */\n id: string;\n /** Its name, passed translated. */\n label: string;\n /** One line: what it is, passed translated. */\n description?: string;\n /** Its colours; null for `system`, whose miniature is half light, half dark. */\n preview: ThemePreview | null;\n /** The two halves of the System miniature (`appearance.themes` light and dark previews). */\n halves?: readonly [ThemePreview, ThemePreview];\n};\n\nexport type AccentOption = {\n /** The brand id (`data-accent`). */\n id: string;\n /** Its name, passed translated (\"Forest green\"). */\n label: string;\n /** Its fill, for the swatch (`appearance.accents[i].dark.accent`). */\n color: string;\n};\n\nexport type AppearanceLabels = {\n /** The theme row: its name. */\n theme: string;\n /** One line under it. */\n themeHint: string;\n /** The accent row: its name. */\n accent: string;\n /** One line under it. */\n accentHint: string;\n /** The density row: its name. */\n density: string;\n /** One line under it. */\n densityHint: string;\n /** The language row: its name. */\n language: string;\n /** One line under it. */\n languageHint: string;\n /** The sound row: its name. */\n sound: string;\n /** One line under it. */\n soundHint: string;\n};\n\nexport const appearanceLabels: AppearanceLabels = {\n theme: \"Theme\",\n themeHint: \"The look of the workspace. System follows your device.\",\n accent: \"Accent colour\",\n accentHint: \"The colour of buttons and highlights.\",\n density: \"Density\",\n densityHint: \"How much fits on a screen.\",\n language: \"Language\",\n languageHint: \"The whole interface.\",\n sound: \"Sound\",\n soundHint: \"Small sounds when something is done. Off unless you turn it on, and never with reduced motion.\",\n};\n\nexport type AppearanceSettingsProps = {\n /** The themes offered: at least system, light and dark. */\n themes: readonly ThemeCardOption[];\n /** The id of the theme chosen. */\n theme: string;\n /** Called with the id chosen. */\n onThemeChange: (id: string) => void;\n /** The accents offered (the product's own first). Without it the row is not shown. */\n accents?: readonly AccentOption[];\n /** The id of the accent chosen; null for the product's own. */\n accent?: string | null;\n /** Called with the id chosen. */\n onAccentChange?: (id: string) => void;\n /** The densities offered, with their names (`standard`, `compact`). */\n densities?: readonly { value: string; label: string }[];\n /** The density chosen. */\n density?: string;\n /** Called with the density chosen. */\n onDensityChange?: (density: string) => void;\n /** The languages offered, each named in its own language. */\n languages?: readonly LanguageOption[];\n /** The code of the language chosen. */\n language?: string;\n /** Called with the code chosen. */\n onLanguageChange?: (code: string) => void;\n /** Shown only when given: the sound is opt-in. */\n sound?: boolean;\n /** Called with the new state. */\n onSoundChange?: (on: boolean) => void;\n /** The words, passed translated (English by default). */\n labels?: Partial<AppearanceLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\nfunction Miniature({ preview }: Readonly<{ preview: ThemePreview }>) {\n return (\n <span\n aria-hidden\n className=\"flex h-16 w-full overflow-hidden rounded-md border border-border-default\"\n style={{ background: preview.surface0 }}\n >\n <span className=\"m-1.5 flex w-1/3 flex-col gap-1 rounded-sm p-1\" style={{ background: preview.surface1 }}>\n <span className=\"h-1 w-3/4 rounded-full\" style={{ background: preview.text }} />\n <span className=\"h-1 w-1/2 rounded-full\" style={{ background: preview.muted }} />\n </span>\n <span className=\"my-1.5 mr-1.5 flex flex-1 flex-col gap-1 rounded-sm p-1.5\" style={{ background: preview.surface2 }}>\n <span className=\"h-1.5 w-2/3 rounded-full\" style={{ background: preview.text }} />\n <span className=\"h-1 w-full rounded-full\" style={{ background: preview.muted }} />\n <span className=\"h-1 w-5/6 rounded-full\" style={{ background: preview.muted }} />\n <span className=\"mt-auto h-2 w-1/3 rounded-sm bg-accent\" />\n </span>\n </span>\n );\n}\n\n/** The picture of a theme card: its miniature, or the two halves of the System one. */\nfunction themeArt(option: ThemeCardOption) {\n if (option.preview) return <Miniature preview={option.preview} />;\n if (option.halves) {\n return (\n <span aria-hidden className=\"grid h-16 w-full grid-cols-2 overflow-hidden rounded-md border border-border-default\">\n <Miniature preview={option.halves[0]} />\n <Miniature preview={option.halves[1]} />\n </span>\n );\n }\n return null;\n}\n\n/** The appearance rows of a settings page: theme cards, accent, density, language, sound. */\nexport function AppearanceSettings({\n themes,\n theme,\n onThemeChange,\n accents,\n accent,\n onAccentChange,\n densities,\n density,\n onDensityChange,\n languages,\n language,\n onLanguageChange,\n sound,\n onSoundChange,\n labels: given,\n className,\n}: Readonly<AppearanceSettingsProps>) {\n const labels = { ...appearanceLabels, ...given };\n const id = React.useId();\n return (\n <div className={className}>\n <SettingsRow label={labels.theme} description={labels.themeHint}>\n <RadioGroup.Root variant=\"cards\" label={labels.theme} value={theme} onValueChange={onThemeChange} className=\"grid w-full grid-cols-2 gap-3 sm:grid-cols-3\">\n {themes.map((option) => (\n <RadioGroup.Card key={option.id} value={option.id} aria-describedby={option.description ? `${id}-${option.id}` : undefined}>\n {themeArt(option)}\n <span className=\"font-semibold text-fg\">{option.label}</span>\n {option.description ? (\n <span id={`${id}-${option.id}`} className=\"text-xs font-normal text-fg-secondary\">\n {option.description}\n </span>\n ) : null}\n </RadioGroup.Card>\n ))}\n </RadioGroup.Root>\n </SettingsRow>\n {accents && accents.length > 0 && onAccentChange ? (\n <SettingsRow label={labels.accent} description={labels.accentHint} htmlFor={`${id}-accent`}>\n <span className=\"flex items-center gap-2\">\n <span aria-hidden className=\"h-4 w-4 rounded-full border border-border-default\" style={{ background: accents.find((a) => a.id === accent)?.color ?? accents[0]?.color }} />\n <Field.Root>\n <select\n id={`${id}-accent`}\n value={accent ?? accents[0]?.id}\n onChange={(event) => onAccentChange(event.target.value)}\n className=\"h-10 rounded-lg border border-border-control bg-surface-2 px-3 text-sm text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {accents.map((option) => (\n <option key={option.id} value={option.id}>\n {option.label}\n </option>\n ))}\n </select>\n </Field.Root>\n </span>\n </SettingsRow>\n ) : null}\n {densities && densities.length > 0 && onDensityChange ? (\n <SettingsRow label={labels.density} description={labels.densityHint}>\n <RadioGroup.Root variant=\"segmented\" label={labels.density} value={density} onValueChange={onDensityChange}>\n {densities.map((option) => (\n <RadioGroup.Segment key={option.value} value={option.value}>\n {option.label}\n </RadioGroup.Segment>\n ))}\n </RadioGroup.Root>\n </SettingsRow>\n ) : null}\n {languages && languages.length > 0 && onLanguageChange ? (\n <SettingsRow label={labels.language} description={labels.languageHint}>\n <LanguagePicker label={labels.language} showLabel={false} languages={languages} value={language ?? \"\"} onValueChange={onLanguageChange} />\n </SettingsRow>\n ) : null}\n {onSoundChange ? (\n <SettingsRow label={labels.sound} description={labels.soundHint}>\n <Switch label={labels.sound} checked={Boolean(sound)} onCheckedChange={onSoundChange} />\n </SettingsRow>\n ) : null}\n </div>\n );\n}\n","// Server-safe. The label ↔ control wiring is HTML (htmlFor / id, aria-describedby): no context.\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\n\nexport const field = tv({\n slots: {\n root: \"flex flex-col gap-1.5\",\n label: \"text-xs font-semibold text-fg-secondary\",\n control:\n \"flex h-11 w-full rounded-lg border border-border-control bg-surface-2 px-3 text-sm text-fg placeholder:text-fg-muted \" +\n \"transition-[border-color,box-shadow] focus-visible:border-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-danger aria-invalid:ring-danger/30\",\n hint: \"text-xs text-fg-secondary\",\n // The message reads in the danger text role (≥ 4.5:1 on every surface, both themes); the dot is the danger fill.\n error: \"flex items-center gap-1.5 text-xs font-medium text-fg-danger before:h-1.5 before:w-1.5 before:shrink-0 before:rounded-full before:bg-danger\",\n selectWrap: \"relative flex w-full\",\n chevron: \"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-fg-secondary\",\n },\n});\nconst s = field();\n\nexport const Field = {\n Root: ({ className, ...props }: React.ComponentProps<\"div\">) => <div className={s.root({ className })} {...props} />,\n Label: ({ className, ...props }: React.ComponentProps<\"label\">) => <label className={s.label({ className })} {...props} />,\n Hint: ({ className, ...props }: React.ComponentProps<\"p\">) => <p className={s.hint({ className })} {...props} />,\n Error: ({ className, ...props }: React.ComponentProps<\"p\">) => <p role=\"alert\" className={s.error({ className })} {...props} />,\n};\n\ntype ControlProps = {\n /** Marks the control invalid: aria-invalid and data-invalid (pair it with a `Field.Error` in aria-describedby). */\n invalid?: boolean;\n};\n\nconst invalidProps = (invalid?: boolean) => (invalid ? { \"aria-invalid\": true as const, \"data-invalid\": \"\" } : {});\n\nexport function Input({ invalid, className, ...props }: React.ComponentProps<\"input\"> & ControlProps) {\n return <input {...invalidProps(invalid)} className={s.control({ className })} {...props} />;\n}\n\nexport function Textarea({ invalid, className, ...props }: React.ComponentProps<\"textarea\"> & ControlProps) {\n return <textarea {...invalidProps(invalid)} className={s.control({ className: cn(\"h-auto min-h-24 py-2\", className) })} {...props} />;\n}\n\n/** A native <select>, styled like the other controls (the platform's menu: accessible and right on phones). */\nexport function Select({ invalid, className, ...props }: React.ComponentProps<\"select\"> & ControlProps) {\n return (\n <span className={s.selectWrap()}>\n <select {...invalidProps(invalid)} className={s.control({ className: cn(\"appearance-none pr-9\", className) })} {...props} />\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden className={s.chevron()}>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </span>\n );\n}\n","// Client (a context). Radix RadioGroup: role=\"radiogroup\" / \"radio\", one tab stop, the arrows move and select, a\n// hidden input inside a form. Four looks, one behaviour:\n// - `RadioGroup.Item`: a dot and its words (a settings list);\n// - `RadioGroup.Card`: a whole card is the radio — an amount, a pack, a plan — its check lit when chosen;\n// - `RadioGroup.Button`: a tactile key that presses in — raised on a ledge, sunk when chosen (a size, a tip, a level);\n// - `RadioGroup.Segment` in `<RadioGroup.Root variant=\"segmented\">`: a segmented control, one light gliding to the choice.\nimport { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { CheckGlyph } from \"../glyphs\";\nimport { useRouteBinding } from \"../router\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\nimport { tv } from \"../tv\";\n\nexport const radioGroup = tv({\n slots: {\n root: \"grid gap-2 data-[orientation=horizontal]:flex data-[orientation=horizontal]:flex-wrap\",\n item:\n \"peer inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-border-control bg-surface-1 inset-shadow-well transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring hover:border-accent disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:shadow-glow aria-invalid:border-danger\",\n dot: \"h-2 w-2 rounded-full bg-on-accent\",\n label: \"flex cursor-pointer items-start gap-3 text-sm text-fg has-disabled:cursor-not-allowed has-disabled:opacity-70\",\n card:\n \"group relative flex min-w-0 flex-col items-start gap-1 rounded-2xl border border-border-default bg-surface-1 bg-sheen p-4 pr-10 text-left text-sm text-fg inset-shadow-edge \" +\n \"transition-[border-color,background-color,box-shadow,transform] duration-200 hover:border-border-strong active:scale-[0.99] motion-reduce:transition-none motion-reduce:active:scale-100 \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent-soft data-[state=checked]:shadow-glow\",\n // The card's check: an empty ring at rest, the accent filled with its check once chosen.\n cardCheck:\n \"absolute right-3.5 top-3.5 inline-flex h-5 w-5 items-center justify-center rounded-full border border-border-control bg-surface-1 text-on-accent transition-colors \" +\n \"group-data-[state=checked]:border-accent group-data-[state=checked]:bg-accent\",\n // The tactile key: on a ledge (its lower edge), its hairline stronger on hover, pressed in while held and once chosen.\n button:\n \"relative inline-flex min-h-12 min-w-12 select-none flex-col items-center justify-center gap-0.5 rounded-xl border border-border-default bg-surface-2 bg-sheen px-4 py-2 \" +\n \"text-sm font-semibold text-fg inset-shadow-edge shadow-[0_4px_0_0_var(--kz-border-strong)] \" +\n \"transition-[transform,box-shadow,background-color,border-color,color] duration-100 ease-out motion-reduce:transition-none \" +\n \"hover:border-border-strong \" +\n \"active:translate-y-[3px] active:shadow-[0_1px_0_0_var(--kz-border-strong)] \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:translate-y-[3px] data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:bg-fill-shade \" +\n \"data-[state=checked]:text-on-accent data-[state=checked]:inset-shadow-edge-fill data-[state=checked]:shadow-[0_1px_0_0_var(--kz-accent-hover)]\",\n buttonHint: \"text-[11px] font-medium text-fg-secondary group-data-[state=checked]:text-on-accent\",\n segmented:\n \"relative isolate inline-grid auto-cols-fr grid-flow-col gap-1 rounded-xl border border-border-default bg-surface-2 p-1 inset-shadow-well \" +\n \"before:pointer-events-none before:absolute before:left-0 before:top-0 before:-z-10 before:h-(--kz-ind-h) before:w-(--kz-ind-w) \" +\n \"before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:border before:border-border-default before:bg-surface-0 before:bg-sheen \" +\n \"before:opacity-0 before:shadow-raised before:transition-[translate,width,height,opacity] before:duration-300 motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n segment:\n \"inline-flex min-h-9 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-lg px-3.5 text-sm font-semibold text-fg-secondary transition-colors \" +\n \"hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border data-[state=checked]:border-border-default data-[state=checked]:bg-surface-0 data-[state=checked]:text-fg data-[state=checked]:shadow-raised \" +\n \"group-data-[indicator=on]/seg:data-[state=checked]:border-transparent group-data-[indicator=on]/seg:data-[state=checked]:bg-transparent group-data-[indicator=on]/seg:data-[state=checked]:shadow-none\",\n },\n variants: {\n variant: {\n list: {},\n cards: { root: \"grid-cols-[repeat(auto-fit,minmax(10rem,1fr))] gap-3\" },\n buttons: { root: \"flex flex-wrap gap-2.5 pb-1\" },\n segmented: {},\n },\n },\n defaultVariants: { variant: \"list\" },\n});\nconst s = radioGroup();\n\nexport type RadioGroupRootProps = React.ComponentProps<typeof RadioGroupPrimitive.Root> & {\n /** The group's accessible name — passed translated (or `aria-labelledby` a visible heading). */\n label?: string;\n /** Marks every radio invalid: aria-invalid (pair it with a `Field.Error`). */\n invalid?: boolean;\n /**\n * The layout of the radios: `list` (dots), `cards` (a grid of `Card`s), `buttons` (a row of tactile `Button`s), or\n * `segmented` (a track of `Segment`s, one light gliding to the choice).\n * @default \"list\"\n */\n variant?: \"list\" | \"cards\" | \"buttons\" | \"segmented\";\n /** Binds the choice to this search parameter of the URL (`?kind=…`): the URL is the state — for a view's selection (a segmented switch), not a form field. */\n routeKey?: string;\n /** The values the parameter may hold (the radios' `value`s); the first is the default unless `defaultValue` says otherwise. */\n routeValues?: readonly string[];\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation`, `required`, `name` for a form, `variant` for the layout. */\nexport function RadioGroupRoot({ label, invalid, variant = \"list\", className, routeKey, routeValues, ...rest }: RadioGroupRootProps) {\n const props = useRouteBinding(routeKey, routeValues, rest);\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=radio]\", active: \"[role=radio][data-state=checked]\" });\n const segmented = variant === \"segmented\";\n return (\n <RadioGroupPrimitive.Root\n ref={segmented ? ref : undefined}\n aria-label={label}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? \"\" : undefined}\n data-variant={variant}\n orientation={segmented ? \"horizontal\" : props.orientation}\n className={segmented ? s.segmented({ className: [\"group/seg\", className].filter(Boolean).join(\" \") }) : radioGroup({ variant }).root({ className })}\n {...props}\n />\n );\n}\n\nexport type RadioGroupItemProps = Omit<React.ComponentProps<typeof RadioGroupPrimitive.Item>, \"children\"> & {\n /** The words next to the dot, clickable. Otherwise name it with `Field.Label htmlFor` or `aria-label`. */\n children?: React.ReactNode;\n};\n\n/** A radio: a dot, and its words when given. */\nexport function RadioGroupItem({ className, children, ...props }: RadioGroupItemProps) {\n const item = (\n <RadioGroupPrimitive.Item className={s.item({ className: children ? \"mt-0.5\" : className })} {...props}>\n <RadioGroupPrimitive.Indicator className={s.dot()} />\n </RadioGroupPrimitive.Item>\n );\n if (!children) return item;\n return (\n <label className={s.label({ className })}>\n {item}\n <span className=\"min-w-0\">{children}</span>\n </label>\n );\n}\n\n/** A whole card as the radio: its content is the radio's name; its check lights up when chosen. */\nexport function RadioGroupCard({ className, children, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return (\n <RadioGroupPrimitive.Item className={s.card({ className })} {...props}>\n {children}\n <span aria-hidden className={s.cardCheck()}>\n <RadioGroupPrimitive.Indicator forceMount className=\"inline-flex data-[state=unchecked]:hidden\">\n <CheckGlyph className=\"h-3 w-3\" />\n </RadioGroupPrimitive.Indicator>\n </span>\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport type RadioGroupButtonProps = React.ComponentProps<typeof RadioGroupPrimitive.Item> & {\n /** A second line under the words (\"+15 %\"), part of the radio's name. */\n hint?: React.ReactNode;\n};\n\n/** A tactile key: raised on its ledge, pressed in while held and once chosen — sizes, a tip, a level. */\nexport function RadioGroupButton({ className, children, hint, ...props }: RadioGroupButtonProps) {\n return (\n <RadioGroupPrimitive.Item className={s.button({ className: [\"group\", className].filter(Boolean).join(\" \") })} {...props}>\n <span>{children}</span>\n {hint ? <span className={s.buttonHint()}>{hint}</span> : null}\n </RadioGroupPrimitive.Item>\n );\n}\n\n/** A segment of a `variant=\"segmented\"` group: equal widths, one light gliding to the choice. */\nexport function RadioGroupSegment({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return <RadioGroupPrimitive.Item className={s.segment({ className })} {...props} />;\n}\n\n/** `RadioGroup.Root/Item/Card/Button/Segment`. */\nexport const RadioGroup = { Root: RadioGroupRoot, Item: RadioGroupItem, Card: RadioGroupCard, Button: RadioGroupButton, Segment: RadioGroupSegment };\n","// The shared sliding indicator (NavBar, Tabs): one element that glides from item to item instead of each item lighting\n// up on its own. It writes the target's box as CSS variables on the list (`--kz-ind-x/y/w/h`) and `data-indicator=\"on\"`\n// — no re-render, no animation frame: the glide is a CSS transition (none under reduced motion). Before hydration the\n// items keep their own active style, so nothing flashes.\nimport * as React from \"react\";\n\nconst useIsoLayoutEffect = typeof window === \"undefined\" ? React.useEffect : React.useLayoutEffect;\n\n/**\n * `item`: the selector of an item; `active`: of the current one, where the light rests; `prefer`: an item that, when\n * present, holds the light before the current one (the NavBar's open menu); `follow`: the light follows the pointer\n * and the focus — over anything that is not an item (an open menu's panel) it goes back to rest.\n */\nexport function useSlidingIndicator<T extends HTMLElement>({ item, active, prefer, follow = false }: { item: string; active: string; prefer?: string; follow?: boolean }) {\n const ref = React.useRef<T>(null);\n const place = React.useCallback((target: Element | null) => {\n const list = ref.current;\n if (!list) return;\n if (!(target instanceof HTMLElement) || !list.contains(target)) {\n list.removeAttribute(\"data-indicator\");\n return;\n }\n const a = target.getBoundingClientRect();\n const b = list.getBoundingClientRect();\n list.style.setProperty(\"--kz-ind-x\", `${a.left - b.left + list.scrollLeft}px`);\n list.style.setProperty(\"--kz-ind-y\", `${a.top - b.top + list.scrollTop}px`);\n list.style.setProperty(\"--kz-ind-w\", `${a.width}px`);\n list.style.setProperty(\"--kz-ind-h\", `${a.height}px`);\n list.setAttribute(\"data-indicator\", \"on\");\n }, []);\n const rest = React.useCallback(\n () => {\n const list = ref.current;\n // An item re-rendered under a resting pointer (a menu closing) keeps the light the pointer gave it.\n const hovered = follow ? list?.querySelector(`${item}:hover`) : null;\n place((prefer ? list?.querySelector(prefer) : null) ?? hovered ?? list?.querySelector(active) ?? null);\n },\n [place, active, prefer, item, follow],\n );\n const follow_ = React.useCallback((target: EventTarget) => {\n const hit = target instanceof Element ? target.closest(item) : null;\n if (hit && ref.current?.contains(hit)) place(hit);\n else rest();\n }, [item, place, rest]);\n\n useIsoLayoutEffect(() => {\n const list = ref.current;\n if (!list) return;\n rest();\n const resize = new ResizeObserver(rest);\n resize.observe(list);\n const changes = new MutationObserver(rest);\n changes.observe(list, { subtree: true, attributes: true, attributeFilter: [\"data-state\", \"aria-current\", \"data-active\"] });\n return () => {\n resize.disconnect();\n changes.disconnect();\n };\n }, [rest]);\n\n const handlers = follow\n ? {\n onPointerOver: (e: React.PointerEvent) => follow_(e.target),\n onPointerLeave: rest,\n onFocus: (e: React.FocusEvent) => follow_(e.target),\n onBlur: rest,\n }\n : {};\n return { ref, handlers };\n}\n","import { createTV } from \"tailwind-variants\";\n\nimport { twMergeConfig } from \"./cn\";\n\n/** `tv` with the preset's utilities known to the merge engine (`twMergeConfig`): what a primitive wearing the material is styled with. */\nexport const tv = createTV({ twMergeConfig });\n","// Client. Radix Switch: role=\"switch\", aria-checked, Space and Enter toggle, a hidden input inside a form.\nimport { Switch as SwitchPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const switchVariants = tv({\n slots: {\n root:\n \"peer relative inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent bg-fg-muted transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 \" +\n \"disabled:cursor-not-allowed disabled:opacity-40 data-[state=checked]:bg-accent aria-invalid:border-danger\",\n thumb:\n \"pointer-events-none block rounded-full bg-fg-on-media shadow-sm transition-transform data-[state=unchecked]:translate-x-0.5 motion-reduce:transition-none\",\n },\n variants: {\n size: {\n sm: { root: \"h-5 w-9\", thumb: \"h-4 w-4 data-[state=checked]:translate-x-[1.125rem]\" },\n md: { root: \"h-6 w-11\", thumb: \"h-5 w-5 data-[state=checked]:translate-x-[1.375rem]\" },\n },\n },\n defaultVariants: { size: \"md\" },\n});\n\nexport type SwitchVariants = VariantProps<typeof switchVariants>;\n\ntype Named =\n | {\n /** The accessible name — required when no visible label names it, passed translated. */\n label: string;\n }\n /** Named by a visible `<label htmlFor={id}>` (e.g. `Field.Label`). */\n | { label?: undefined; id: string }\n /** Named by another element. */\n | { label?: undefined; \"aria-labelledby\": string };\n\nexport type SwitchProps = Omit<React.ComponentProps<typeof SwitchPrimitive.Root>, \"children\"> &\n SwitchVariants &\n Named & {\n /**\n * sm · md.\n * @default \"md\"\n */\n size?: SwitchVariants[\"size\"];\n /** Marks it invalid: aria-invalid and data-invalid. */\n invalid?: boolean;\n };\n\n/** An on/off switch: `checked`/`defaultChecked` + `onCheckedChange`. */\nexport function Switch({ label, size, invalid, className, ...props }: SwitchProps) {\n const s = switchVariants({ size });\n return (\n <SwitchPrimitive.Root\n aria-label={label}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? \"\" : undefined}\n className={s.root({ className })}\n {...props}\n >\n <SwitchPrimitive.Thumb className={s.thumb()} />\n </SwitchPrimitive.Root>\n );\n}\n","// Client (a radio group). The language of the account, labelled, each language named in its own language, saved per user\n// (the caller saves on change or with its section). Segmented: one light gliding to the choice.\nimport * as React from \"react\";\n\nimport { RadioGroup } from \"../radio-group\";\nimport { GroupHead } from \"./group-head\";\n\nexport interface LanguageOption {\n /** The BCP 47 code (`fr`, `en`): the value, and the `lang` of the name. */\n code: string;\n /** Its native name (`Français`, `English`) — never the current language's name for it. */\n name: string;\n}\n\nexport type LanguagePickerProps = Omit<React.ComponentProps<typeof RadioGroup.Root>, \"children\" | \"variant\" | \"label\" | \"aria-labelledby\"> & {\n /** The visible label (“Language”) — passed translated. */\n label: React.ReactNode;\n /**\n * Shows the label above the control; `false` when a `SettingsRow` already says it (the group keeps its accessible name).\n * @default true\n */\n showLabel?: boolean;\n /** One line under it: what it changes. */\n description?: React.ReactNode;\n /** The languages offered. */\n languages: readonly LanguageOption[];\n /** The chosen code (controlled). */\n value?: string;\n /** The viewer chooses another language. */\n onValueChange?: (code: string) => void;\n};\n\n/** The language control of an account page: a labelled segmented choice, native names. */\nexport function LanguagePicker({ label, showLabel = true, description, languages, className, ...props }: LanguagePickerProps) {\n const id = React.useId();\n return (\n <div className={[\"flex flex-col gap-2\", className].filter(Boolean).join(\" \")}>\n {showLabel ? <GroupHead id={`${id}-label`} label={label} description={description} /> : null}\n <RadioGroup.Root variant=\"segmented\" aria-label={showLabel ? undefined : String(label)} aria-labelledby={showLabel ? `${id}-label` : undefined} {...props}>\n {languages.map((language) => (\n <RadioGroup.Segment key={language.code} value={language.code} lang={language.code}>\n {language.name}\n </RadioGroup.Segment>\n ))}\n </RadioGroup.Root>\n </div>\n );\n}\n","import type * as React from \"react\";\n\n/** The visible label (and one line of help) of a radio group: the group's `aria-labelledby` points at it. */\nexport function GroupHead({ id, label, description }: Readonly<{ id: string; label: React.ReactNode; description?: React.ReactNode }>) {\n return (\n <div className=\"flex flex-col gap-0.5\">\n <span id={id} className=\"text-sm font-medium text-fg\">\n {label}\n </span>\n {description ? <span className=\"text-sm text-fg-secondary\">{description}</span> : null}\n </div>\n );\n}\n","// Client (a radio group). The pictures of a person to choose from — the family's default avatars, a few photos — as a grid of\n// round tiles: one named radiogroup, one tab stop, the arrows choose, a ring and a check on the chosen one.\nimport { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { DEFAULT_AVATAR_TONES,type DefaultAvatar, type DefaultAvatarBrand, type DefaultAvatarEntityKind, defaultAvatarUrl } from \"../avatar/default-avatar\";\nimport { cn } from \"../cn\";\nimport { Dropzone, type DropzoneProps } from \"../file-upload\";\nimport { CheckGlyph } from \"../glyphs\";\nimport { GroupHead } from \"./group-head\";\n\n/** The value of the « no picture » tile (`noneLabel`). */\nexport const AVATAR_NONE = \"none\";\n\nexport interface AvatarOption {\n /** The value of the choice. */\n id: string;\n /** Its name for assistive technology (“Teinte 3”) — passed translated. */\n label: string;\n /** A picture's address; otherwise `defaultAvatar` draws one of the family's pictures. */\n src?: string;\n /** One of Krizaka's default pictures (`{ brand, tone }`). */\n defaultAvatar?: DefaultAvatar;\n /** What this picture is of; a picker of another `kind` never lists it. Read from `defaultAvatar.kind` when not given (`plain` is a person's). */\n kind?: DefaultAvatarEntityKind;\n}\n\n/** What an option is of, when it says: its own `kind`, else its default picture's. */\nexport function avatarOptionKind(option: AvatarOption): DefaultAvatarEntityKind | undefined {\n const kind = option.kind ?? option.defaultAvatar?.kind;\n return kind === \"plain\" ? \"person\" : kind;\n}\n\n/** The pictures that fit `kind`: an option of another kind is dropped, so a folder is never offered a person. Options that do not say what they are stay. */\nexport function optionsOfKind(options: readonly AvatarOption[], kind: DefaultAvatarEntityKind): AvatarOption[] {\n return options.filter((option) => {\n const own = avatarOptionKind(option);\n return own === undefined || own === kind;\n });\n}\n\n/** The pictures drawn here for a kind: the brand's six tones, no request. Used when the app passes no `options`. */\nexport function builtInAvatarOptions(kind: DefaultAvatarEntityKind, brand: DefaultAvatarBrand, label: (tone: number) => string): AvatarOption[] {\n return Array.from({ length: DEFAULT_AVATAR_TONES }, (_, i) => ({ id: `${kind}-${i + 1}`, label: label(i + 1), kind, defaultAvatar: { brand, kind, tone: i + 1 } }));\n}\n\nexport type AvatarPickerProps = Omit<React.ComponentProps<typeof RadioGroupPrimitive.Root>, \"children\" | \"onChange\" | \"dir\"> & {\n /** The group's accessible name (“Profile picture”) — passed translated. */\n label: string;\n /**\n * Smaller tiles, for a settings row.\n * @default false\n */\n dense?: boolean;\n /** Shows the label above the grid, with `description` under it. */\n showLabel?: boolean;\n /** One line under the visible label: what it changes. */\n description?: React.ReactNode;\n /**\n * What the pictures are of: `person` (default), `folder`, `organisation` or `shop`. Only the options of this kind are listed.\n * @default \"person\"\n */\n kind?: DefaultAvatarEntityKind;\n /** The pictures — the central set of the kind (`listDefaults(kind)` of `@krizaka/org`) turned into options, with `src`. */\n options: readonly AvatarOption[];\n /** Adds a « no picture » tile first, chosen with the value `AVATAR_NONE`; the words of the tile, passed translated. */\n noneLabel?: string;\n /** The library's upload control under the grid: a `Dropzone` (a real file input), for a picture of one's own. */\n uploadFile?: Pick<DropzoneProps, \"title\" | \"browseLabel\" | \"hint\" | \"accept\" | \"maxSize\" | \"disabled\" | \"refusalLabel\" | \"onReject\"> & { onFile: (file: File) => void };\n /** The chosen id (controlled). */\n value?: string;\n /** The viewer chooses another picture. */\n onValueChange?: (id: string) => void;\n /** After the pictures, in the grid: the upload action (a `Button`, a file input's label). Not a radio. */\n upload?: React.ReactNode;\n};\n\nconst pictureOf = (option: AvatarOption) => option.src ?? (option.defaultAvatar ? defaultAvatarUrl(option.defaultAvatar, { size: 256 }) : undefined);\n\n/** A grid of pictures to choose from, with an upload beside them: a radio group, never a row of loose radios. */\nexport function AvatarPicker({ label, showLabel, description, dense, kind = \"person\", options, noneLabel, uploadFile, upload, className, ...props }: AvatarPickerProps) {\n const id = React.useId();\n const listed = optionsOfKind(options, kind);\n const tile = cn(\n \"group/avatar relative shrink-0 rounded-full\",\n dense ? \"h-12 w-12\" : \"aspect-square w-full\",\n \"outline-none transition-shadow duration-200 motion-reduce:transition-none\",\n \"ring-1 ring-border-default hover:ring-border-strong focus-visible:focus-ring data-[state=checked]:ring-2 data-[state=checked]:ring-accent\",\n );\n const check = (\n <span\n aria-hidden\n className=\"absolute -bottom-0.5 -right-0.5 hidden h-5 w-5 items-center justify-center rounded-full border-2 border-surface-1 bg-accent text-on-accent group-data-[state=checked]/avatar:inline-flex\"\n >\n <CheckGlyph className=\"h-3 w-3\" />\n </span>\n );\n const group = (\n <RadioGroupPrimitive.Root aria-label={label} aria-labelledby={showLabel ? id : undefined} className={cn(dense ? \"flex flex-wrap gap-2.5\" : \"grid grid-cols-[repeat(auto-fill,minmax(4.25rem,1fr))] gap-3\", !showLabel && !uploadFile && className)} {...props}>\n {noneLabel ? (\n <RadioGroupPrimitive.Item value={AVATAR_NONE} aria-label={noneLabel} className={tile}>\n <span aria-hidden className=\"flex h-full w-full items-center justify-center rounded-full bg-surface-3 text-fg-secondary\">\n <svg viewBox=\"0 0 24 24\" className=\"h-1/2 w-1/2\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"8\" />\n <path d=\"M6.5 17.5l11-11\" />\n </svg>\n </span>\n {check}\n </RadioGroupPrimitive.Item>\n ) : null}\n {listed.map((option) => (\n <RadioGroupPrimitive.Item key={option.id} value={option.id} aria-label={option.label} className={tile}>\n <img src={pictureOf(option)} alt=\"\" draggable={false} className=\"h-full w-full rounded-full bg-surface-3 object-cover\" />\n {check}\n </RadioGroupPrimitive.Item>\n ))}\n {upload ? <div className=\"flex aspect-square w-full items-center justify-center\">{upload}</div> : null}\n </RadioGroupPrimitive.Root>\n );\n const withUpload = uploadFile ? (\n <div className={cn(\"flex flex-col gap-3\", !showLabel && className)}>\n {group}\n <Dropzone {...uploadFile} onFiles={(files) => files[0] && uploadFile.onFile(files[0])} />\n </div>\n ) : (\n group\n );\n if (!showLabel) return withUpload;\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n <GroupHead id={id} label={label} description={description} />\n {withUpload}\n </div>\n );\n}\n","// Client. Three parts that work alone or together:\n// - `Dropzone`: drop files on it or pick them with its button (a real `<input type=\"file\">`, so the keyboard and the\n// phone's camera / files sheet work); it checks the type, the size and the count, and hands over the accepted files\n// and the refused ones with their reason;\n// - `UploadList`: each file with its preview, size, progress, speed, and the actions its state allows (pause, resume,\n// retry, cancel, remove); the progress is a `progressbar`, a failure is announced;\n// - `useUploadQueue`: runs the app's `upload(file, { signal, onProgress, resumed })` with a concurrency, pauses by\n// aborting the signal and resumes by calling it again with `resumed: true` — what a Tus client (tus-js-client's\n// `abort()` / `start()`) or a multipart upload needs, without depending on either. The line (concurrency, retries\n// with backoff, pause per file) is `createQueue` of @krizaka/pacer.\nimport { getNumberFormat } from \"@krizaka/intl\";\nimport { type QueueOptions } from \"@krizaka/pacer\";\nimport { useQueue, useQueueSnapshot } from \"@krizaka/pacer/react\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { CloseGlyph, FileGlyph, PauseGlyph, PlayGlyph, RetryGlyph, UploadGlyph } from \"../glyphs\";\nimport { useLatest } from \"../media\";\nimport { Progress } from \"../progress\";\n\nexport const fileUpload = tv({\n slots: {\n zone:\n \"relative flex w-full flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed border-border-default bg-surface-1 px-6 py-10 text-center \" +\n \"transition-colors data-[dragging]:border-accent data-[dragging]:bg-accent-soft data-[disabled]:opacity-50 has-[:focus-visible]:border-accent\",\n zoneIcon: \"flex h-12 w-12 items-center justify-center rounded-full bg-surface-3 text-fg-secondary\",\n zoneTitle: \"text-sm font-semibold text-fg\",\n zoneHint: \"text-xs text-fg-secondary\",\n browse:\n \"inline-flex h-9 items-center justify-center rounded-lg bg-accent px-4 text-sm font-semibold text-on-accent transition-colors hover:bg-accent-hover \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 disabled:pointer-events-none\",\n refusals: \"w-full text-left text-xs font-medium text-fg-danger\",\n list: \"flex w-full flex-col gap-2\",\n item: \"flex items-center gap-3 rounded-xl border border-border-default bg-surface-1 p-3 data-[status=error]:border-danger/60\",\n preview: \"flex h-12 w-12 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-surface-3 text-fg-secondary\",\n body: \"flex min-w-0 flex-1 flex-col gap-1.5\",\n name: \"truncate text-sm font-semibold text-fg\",\n meta: \"flex flex-wrap gap-x-2 text-xs tabular-nums text-fg-secondary\",\n error: \"text-xs font-medium text-fg-danger\",\n actions: \"flex shrink-0 items-center gap-1\",\n action:\n \"inline-flex h-8 w-8 items-center justify-center rounded-md text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n },\n});\n\n/** Why a file was refused. */\nexport type FileRejection = { file: File; reason: \"type\" | \"size\" | \"count\" };\n\n/** Whether a file matches an `accept` list (`\"video/*,.mov,image/png\"`). */\nexport function acceptsFile(file: File, accept?: string): boolean {\n if (!accept) return true;\n const name = file.name.toLowerCase();\n const type = file.type.toLowerCase();\n return accept\n .split(\",\")\n .map((rule) => rule.trim().toLowerCase())\n .filter(Boolean)\n .some((rule) => (rule.startsWith(\".\") ? name.endsWith(rule) : rule.endsWith(\"/*\") ? type.startsWith(rule.slice(0, -1)) : type === rule));\n}\n\n/** A size in the locale's words (`\"1.4 GB\"`, `\"820 kB\"`), through `@krizaka/intl`. */\nexport function formatBytes(bytes: number, locale = \"en\"): string {\n const units = [\"byte\", \"kilobyte\", \"megabyte\", \"gigabyte\", \"terabyte\"] as const;\n let value = Math.max(0, bytes);\n let unit = 0;\n while (value >= 1000 && unit < units.length - 1) {\n value /= 1000;\n unit += 1;\n }\n return getNumberFormat(locale, { style: \"unit\", unit: units[unit], unitDisplay: \"short\", maximumFractionDigits: value < 10 && unit > 0 ? 1 : 0 }).format(value);\n}\n\nexport type DropzoneProps = {\n /** The title in the zone (\"Drop your video here\"), passed translated. */\n title: string;\n /** The button that opens the file picker (\"Choose a file\"), passed translated. */\n browseLabel: string;\n /** What is accepted, in words (\"MP4 or MOV, up to 4 GB\"). */\n hint?: string;\n /** The types accepted, as the `accept` attribute (`\"video/*\"`, `\"image/png,.pdf\"`). */\n accept?: string;\n /** The largest file, in bytes. */\n maxSize?: number;\n /** The most files at once (1 unless `multiple`). */\n maxFiles?: number;\n /** Several files at once. */\n multiple?: boolean;\n /** Not available (an upload is running). */\n disabled?: boolean;\n /** On a phone, opens the camera directly (`\"environment\"` the back one, `\"user\"` the front one). */\n capture?: \"user\" | \"environment\";\n /** Called with the files accepted (never empty). */\n onFiles: (files: File[]) => void;\n /** Called with the files refused and why (show `refusalLabel`'s words, or your own). */\n onReject?: (rejections: FileRejection[]) => void;\n /** The words of a refusal, shown in the zone: `(r) => r.file.name + \" is too large\"`. Without it, nothing is shown. */\n refusalLabel?: (rejection: FileRejection) => string;\n /** The accessible name of the file input, passed translated. Defaults to `title`. */\n inputLabel?: string;\n /** An icon instead of the upload glyph. */\n icon?: React.ReactNode;\n /** Classes merged on the zone. */\n className?: string;\n};\n\n/** A zone to drop files on, with a button that opens the picker: checks type, size and count. */\nexport function Dropzone({\n title,\n browseLabel,\n hint,\n accept,\n maxSize,\n maxFiles,\n multiple,\n disabled,\n capture,\n onFiles,\n onReject,\n refusalLabel,\n inputLabel,\n icon,\n className,\n}: Readonly<DropzoneProps>) {\n const s = fileUpload();\n const input = React.useRef<HTMLInputElement>(null);\n const [dragging, setDragging] = React.useState(false);\n const [refused, setRefused] = React.useState<FileRejection[]>([]);\n const depth = React.useRef(0);\n const id = React.useId();\n const limit = maxFiles ?? (multiple ? Infinity : 1);\n\n const take = (list: FileList | File[]) => {\n const files = [...list];\n const accepted: File[] = [];\n const rejections: FileRejection[] = [];\n for (const file of files) {\n if (!acceptsFile(file, accept)) rejections.push({ file, reason: \"type\" });\n else if (maxSize !== undefined && file.size > maxSize) rejections.push({ file, reason: \"size\" });\n else if (accepted.length >= limit) rejections.push({ file, reason: \"count\" });\n else accepted.push(file);\n }\n setRefused(rejections);\n if (accepted.length) onFiles(accepted);\n if (rejections.length) onReject?.(rejections);\n };\n\n return (\n <div\n className={s.zone({ className })}\n data-dragging={dragging ? \"\" : undefined}\n data-disabled={disabled ? \"\" : undefined}\n onDragEnter={(event) => {\n if (disabled) return;\n event.preventDefault();\n depth.current += 1;\n setDragging(true);\n }}\n onDragOver={(event) => {\n if (disabled) return;\n event.preventDefault();\n event.dataTransfer.dropEffect = \"copy\";\n }}\n onDragLeave={() => {\n depth.current = Math.max(0, depth.current - 1);\n if (depth.current === 0) setDragging(false);\n }}\n onDrop={(event) => {\n if (disabled) return;\n event.preventDefault();\n depth.current = 0;\n setDragging(false);\n take(event.dataTransfer.files);\n }}\n >\n <span className={s.zoneIcon()} aria-hidden>\n {icon ?? <UploadGlyph className=\"h-6 w-6\" />}\n </span>\n <p id={`${id}-title`} className={s.zoneTitle()}>\n {title}\n </p>\n {hint ? (\n <p id={`${id}-hint`} className={s.zoneHint()}>\n {hint}\n </p>\n ) : null}\n <button\n type=\"button\"\n className={s.browse()}\n disabled={disabled}\n aria-describedby={[`${id}-title`, hint ? `${id}-hint` : null].filter(Boolean).join(\" \")}\n onClick={() => input.current?.click()}\n >\n {browseLabel}\n </button>\n <input\n ref={input}\n type=\"file\"\n tabIndex={-1}\n aria-hidden\n aria-label={inputLabel ?? title}\n className=\"sr-only\"\n accept={accept}\n multiple={multiple}\n capture={capture}\n disabled={disabled}\n onChange={(event) => {\n if (event.target.files?.length) take(event.target.files);\n event.target.value = \"\";\n }}\n />\n {refusalLabel && refused.length > 0 ? (\n <ul role=\"alert\" className={s.refusals()}>\n {refused.map((r) => (\n <li key={`${r.file.name}-${r.reason}`}>{refusalLabel(r)}</li>\n ))}\n </ul>\n ) : null}\n </div>\n );\n}\n\nexport type UploadStatus = \"queued\" | \"uploading\" | \"paused\" | \"done\" | \"error\";\n\nexport type UploadItem = {\n /** A stable id. */\n id: string;\n /** The file's name. */\n name: string;\n /** Its size, in bytes. */\n size: number;\n /** Its MIME type (`video/mp4`): picks the preview. */\n type?: string;\n /** Sent so far, between 0 and 1. */\n progress: number;\n /** Where it stands. */\n status: UploadStatus;\n /** Why it failed, passed translated. */\n error?: string;\n /** A preview (an object URL of the file, a thumbnail from the server). */\n previewUrl?: string;\n /** Bytes per second, for the speed and the time left. */\n speed?: number;\n};\n\nexport type UploadListLabels = {\n /** The list's accessible name (\"Uploads\"). */\n list: string;\n pause: (name: string) => string;\n resume: (name: string) => string;\n retry: (name: string) => string;\n cancel: (name: string) => string;\n remove: (name: string) => string;\n /** A state in words: `(status) => \"Paused\"`… */\n status: (status: UploadStatus) => string;\n /** The time left: `(seconds) => \"2 min left\"`. */\n remaining: (seconds: number) => string;\n};\n\nexport const uploadListLabels: UploadListLabels = {\n list: \"Uploads\",\n pause: (name) => `Pause ${name}`,\n resume: (name) => `Resume ${name}`,\n retry: (name) => `Retry ${name}`,\n cancel: (name) => `Cancel ${name}`,\n remove: (name) => `Remove ${name}`,\n status: (status) => ({ queued: \"Waiting\", uploading: \"Uploading\", paused: \"Paused\", done: \"Uploaded\", error: \"Failed\" })[status],\n remaining: (seconds) => (seconds < 60 ? `${Math.ceil(seconds)} s left` : `${Math.ceil(seconds / 60)} min left`),\n};\n\nexport type UploadListProps = {\n /** The uploads, as `useUploadQueue` gives them (or your own state). */\n items: readonly UploadItem[];\n /** Pauses an upload (shown while it uploads, when given). */\n onPause?: (id: string) => void;\n /** Resumes a paused one. */\n onResume?: (id: string) => void;\n /** Tries a failed one again. */\n onRetry?: (id: string) => void;\n /** Stops an upload under way and drops it. */\n onCancel?: (id: string) => void;\n /** Drops a finished or failed one from the list. */\n onRemove?: (id: string) => void;\n /** The locale of sizes and speeds. Default `\"en\"`. */\n locale?: string;\n /** The words, passed translated; English by default. */\n labels?: Partial<UploadListLabels>;\n /** Classes merged on the list. */\n className?: string;\n};\n\nfunction Preview({ item }: { item: UploadItem }) {\n if (item.previewUrl && item.type?.startsWith(\"image/\")) return <img src={item.previewUrl} alt=\"\" className=\"h-full w-full object-cover\" />;\n if (item.previewUrl && item.type?.startsWith(\"video/\")) return <video src={item.previewUrl} muted playsInline preload=\"metadata\" className=\"h-full w-full object-cover\" aria-hidden />;\n return <FileGlyph className=\"h-5 w-5\" />;\n}\n\n/** The files being sent: preview, size, progress, speed and time left, and the actions each state allows. */\nexport function UploadList({ items, onPause, onResume, onRetry, onCancel, onRemove, locale = \"en\", labels: given, className }: UploadListProps) {\n const labels = { ...uploadListLabels, ...given };\n const s = fileUpload();\n const action = (label: string, run: () => void, glyph: React.ReactNode) => (\n <button type=\"button\" className={s.action()} aria-label={label} title={label} onClick={run}>\n {glyph}\n </button>\n );\n return (\n <ul aria-label={labels.list} className={s.list({ className })}>\n {items.map((item) => {\n const left = item.status === \"uploading\" && item.speed ? ((1 - item.progress) * item.size) / item.speed : null;\n return (\n <li key={item.id} className={s.item()} data-status={item.status}>\n <span className={s.preview()}>\n <Preview item={item} />\n </span>\n <div className={s.body()}>\n <p className={s.name()}>{item.name}</p>\n {item.status !== \"done\" && item.status !== \"error\" ? (\n <Progress size=\"sm\" label={item.name} value={item.status === \"queued\" ? null : Math.round(item.progress * 100)} />\n ) : null}\n <p className={s.meta()}>\n <span>{labels.status(item.status)}</span>\n <span>{item.status === \"done\" ? formatBytes(item.size, locale) : `${formatBytes(item.progress * item.size, locale)} / ${formatBytes(item.size, locale)}`}</span>\n {item.status === \"uploading\" && item.speed ? <span>{formatBytes(item.speed, locale)}/s</span> : null}\n {left !== null ? <span>{labels.remaining(left)}</span> : null}\n </p>\n {item.status === \"error\" && item.error ? (\n <p role=\"alert\" className={s.error()}>\n {item.error}\n </p>\n ) : null}\n </div>\n <div className={s.actions()}>\n {item.status === \"uploading\" && onPause && action(labels.pause(item.name), () => onPause(item.id), <PauseGlyph className=\"h-4 w-4\" />)}\n {item.status === \"paused\" && onResume && action(labels.resume(item.name), () => onResume(item.id), <PlayGlyph className=\"h-4 w-4\" />)}\n {item.status === \"error\" && onRetry && action(labels.retry(item.name), () => onRetry(item.id), <RetryGlyph className=\"h-4 w-4\" />)}\n {(item.status === \"done\" || item.status === \"error\") && onRemove\n ? action(labels.remove(item.name), () => onRemove(item.id), <CloseGlyph className=\"h-4 w-4\" />)\n : item.status !== \"done\" && onCancel\n ? action(labels.cancel(item.name), () => onCancel(item.id), <CloseGlyph className=\"h-4 w-4\" />)\n : null}\n </div>\n </li>\n );\n })}\n </ul>\n );\n}\n\nexport type UploadContext = {\n /** Aborted on pause and cancel: stop sending (`tusUpload.abort()`, `xhr.abort()`). */\n signal: AbortSignal;\n /** Report the bytes sent so far. */\n onProgress: (sent: number) => void;\n /** `true` when this call resumes a paused or failed upload (a Tus client then continues from its offset). */\n resumed: boolean;\n};\n\nexport type UploadQueueOptions = {\n /** Sends one file; resolves when it is done, rejects on failure (its `message` becomes the item's error). */\n upload: (file: File, context: UploadContext) => Promise<void>;\n /** How many files go at once. Default 2. */\n concurrency?: number;\n /** How many times a failed upload is tried again by itself (with `backoff`) before it shows its error. Default 0. */\n retries?: number;\n /** The wait between retries: exponential from 1 s by default (`@krizaka/pacer`). */\n backoff?: QueueOptions[\"backoff\"];\n /** Whether an error deserves another try (a 4xx never does). Default: every error does, up to `retries`. */\n shouldRetry?: QueueOptions[\"shouldRetry\"];\n /** Makes an object URL for each file to preview (revoked when it leaves). Default `true`. */\n previews?: boolean;\n};\n\n/** What the screen reads of an upload besides its status: the file, how far it got, how fast. */\ntype UploadMeta = { file: File; progress: number; speed?: number; previewUrl?: string; last?: { at: number; sent: number } };\n\n/**\n * The state of an upload queue around the app's `upload` function: `add`, `pause`, `resume`, `retry`, `cancel`, `remove`.\n * The line itself — concurrency, retries with backoff, pause by aborting the signal — is `createQueue` of\n * `@krizaka/pacer`; this hook adds the files, their previews, their progress and their speed.\n */\nexport function useUploadQueue(options: UploadQueueOptions) {\n const { concurrency, retries, backoff, shouldRetry } = options;\n const latest = useLatest(options);\n const queue = useQueue<UploadMeta>({ concurrency: concurrency ?? 2, retries, backoff, shouldRetry });\n const jobs = useQueueSnapshot(queue);\n const metas = useLatest(new Map(jobs.map((job) => [job.id, job.meta])));\n\n const add = React.useCallback(\n (files: readonly File[]) => {\n const { previews = true } = latest.current;\n for (const file of files) {\n const id = `${file.name}-${file.size}-${Math.random().toString(36).slice(2, 8)}`;\n const previewUrl = previews && typeof URL.createObjectURL === \"function\" ? URL.createObjectURL(file) : undefined;\n queue.add(\n async ({ signal, resumed }) => {\n queue.update(id, (m) => ({ ...m, last: { at: Date.now(), sent: m.progress * file.size } }));\n try {\n await latest.current.upload(file, {\n signal,\n resumed,\n onProgress: (sent) => {\n if (signal.aborted) return;\n queue.update(id, (m) => {\n const now = Date.now();\n const last = m.last ?? { at: now, sent };\n const fresh = now - last.at > 400;\n return { ...m, progress: file.size ? Math.min(1, sent / file.size) : 0, speed: fresh ? ((sent - last.sent) / (now - last.at)) * 1000 : m.speed, last: fresh ? { at: now, sent } : last };\n });\n },\n });\n if (!signal.aborted) queue.update(id, (m) => ({ ...m, progress: 1, speed: undefined }));\n } catch (error) {\n if (!signal.aborted) queue.update(id, (m) => ({ ...m, speed: undefined }));\n throw error;\n }\n },\n { id, meta: { file, progress: 0, previewUrl } },\n );\n }\n },\n [latest, queue],\n );\n const forget = React.useCallback(\n (id: string) => {\n const url = metas.current.get(id)?.previewUrl;\n if (url) URL.revokeObjectURL(url);\n queue.cancel(id);\n },\n [metas, queue],\n );\n React.useEffect(\n () => () => {\n for (const meta of metas.current.values()) if (meta.previewUrl) URL.revokeObjectURL(meta.previewUrl);\n },\n [metas],\n );\n const pause = React.useCallback(\n (id: string) => {\n queue.pause(id);\n queue.update(id, (m) => ({ ...m, speed: undefined }));\n },\n [queue],\n );\n\n const items = React.useMemo<UploadItem[]>(\n () =>\n jobs.map(({ id, status, error, meta }) => ({\n id,\n name: meta.file.name,\n size: meta.file.size,\n type: meta.file.type,\n progress: meta.progress,\n status: status === \"running\" ? \"uploading\" : status,\n error: error?.message,\n previewUrl: meta.previewUrl,\n speed: status === \"running\" ? meta.speed : undefined,\n })),\n [jobs],\n );\n return { items, add, pause, resume: queue.resume, retry: queue.retry, cancel: forget, remove: forget };\n}\n","// Client (a radio group). A single choice as selectable cards — an icon, a title, one line: the side of a lease, a plan, a\n// way to get the answer. Built on `RadioGroup.Card`, so the arrows choose, the card is the radio, the check lights up.\nimport * as React from \"react\";\n\nimport { RadioGroup } from \"../radio-group\";\nimport { GroupHead } from \"./group-head\";\n\nexport interface ChoiceCardOption {\n /** The value of the choice. */\n id: string;\n /** Its name, short. */\n title: React.ReactNode;\n /** One line under the title: what it means. It describes the radio. */\n description?: React.ReactNode;\n /** A glyph before the title (decorative). */\n icon?: React.ReactNode;\n disabled?: boolean;\n}\n\nexport type ChoiceCardsProps = Omit<React.ComponentProps<typeof RadioGroup.Root>, \"children\" | \"variant\" | \"label\"> & {\n /** The question (“Which side of the lease are you?”) — the group's accessible name, passed translated. */\n label: string;\n /** Shows the question above the cards, with `description` under it. */\n showLabel?: boolean;\n /** One line under the visible question. */\n description?: React.ReactNode;\n /** The choices. */\n options: readonly ChoiceCardOption[];\n /** The chosen id (controlled). */\n value?: string;\n /** The viewer chooses another card. */\n onValueChange?: (id: string) => void;\n};\n\n/** Cards to choose one from: a radio group where each card has an icon, a title and a description. */\nexport function ChoiceCards({ label, showLabel, description, options, className, ...props }: ChoiceCardsProps) {\n const base = React.useId();\n const group = (\n <RadioGroup.Root variant=\"cards\" label={label} aria-labelledby={showLabel ? `${base}-label` : undefined} className={[\"grid grid-cols-1 gap-3 sm:grid-cols-2\", !showLabel && className].filter(Boolean).join(\" \")} {...props}>\n {options.map((option) => {\n const describedBy = option.description ? `${base}-${option.id}` : undefined;\n return (\n <RadioGroup.Card key={option.id} value={option.id} disabled={option.disabled} aria-describedby={describedBy}>\n <span className=\"flex items-center gap-2.5 font-semibold text-fg [&>svg]:h-5 [&>svg]:w-5 [&>svg]:text-accent\">\n {option.icon}\n {option.title}\n </span>\n {option.description ? (\n <span id={describedBy} className=\"text-sm font-normal text-fg-secondary\">\n {option.description}\n </span>\n ) : null}\n </RadioGroup.Card>\n );\n })}\n </RadioGroup.Root>\n );\n if (!showLabel) return group;\n return (\n <div className={[\"flex flex-col gap-3\", className].filter(Boolean).join(\" \")}>\n <GroupHead id={`${base}-label`} label={label} description={description} />\n {group}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAEA,SAAS,UAA6B;;;ACI/B,IAAM,cAAc,aAAa;AAAA,EACtC,MAAM;AAAA,EACN,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,SAAS;AAAA,MACT,QAAQ;AAAA;AAAA,MAER,OAAO;AAAA,IACT;AAAA,IACA,MAAM,EAAE,IAAI,2BAA2B,IAAI,0BAA0B;AAAA,IACrE,OAAO,EAAE,MAAM,2CAA2C;AAAA,EAC5D;AAAA,EACA,iBAAiB,EAAE,MAAM,WAAW,MAAM,KAAK;AACjD,CAAC;;;ADUG,SACU,KADV;AAxBG,IAAM,gBAAgB,GAAG,WAAW;AAsBpC,SAAS,MAAM,EAAE,MAAM,MAAM,OAAO,KAAK,WAAW,UAAU,GAAG,MAAM,GAAe;AAC3F,SACE,qBAAC,UAAK,aAAW,QAAQ,WAAW,WAAW,cAAc,EAAE,MAAM,MAAM,OAAO,UAAU,CAAC,GAAI,GAAG,OACjG;AAAA,WAAO,oBAAC,UAAK,YAAS,IAAG,eAAW,MAAC,WAAU,uCAAsC;AAAA,IACrF;AAAA,KACH;AAEJ;;;AEDM,SACE,OAAAA,MADF,QAAAC,aAAA;AAHC,SAAS,mBAAmB,EAAE,MAAM,OAAO,UAAU,eAAe,iBAAiB,aAAa,QAAQ,QAAQ,SAAS,WAAW,GAAG,MAAM,GAA4B;AAChL,SACE,gBAAAA,MAAC,aAAQ,cAAY,MAAM,WAAW,GAAG,2BAA2B,CAA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AAD,MAAC,aAAU,IAAI,GAAG,IAAI,UAAU,OAAc,aAA0B;AAAA,IACvE;AAAA,KACH;AAEJ;","names":["jsx","jsxs","React","tv","jsx","jsxs","tv","tv","jsx","jsxs","tv","s","tv","jsx","s","React","jsx","jsxs","jsx","jsxs","jsx","jsxs","RadioGroupPrimitive","React","React","tv","jsx","jsxs","tv","s","jsxs","jsx","jsx","jsxs","RadioGroupPrimitive","React","jsx","jsxs"]}
package/dist/agenda.d.ts CHANGED
@@ -131,7 +131,7 @@ type AgendaProps<T extends AgendaItem> = {
131
131
  /** Classes merged on the list. */
132
132
  className?: string;
133
133
  };
134
- declare function Agenda<T extends AgendaItem>({ items, locale, timeZone, now, selectedId, onSelect, linkAs, action, labels: given, empty, className, "aria-label": label }: AgendaProps<T>): React.JSX.Element | null;
134
+ declare function Agenda<T extends AgendaItem>({ items, locale, timeZone, now, selectedId, onSelect, linkAs, action, labels: given, empty, className, "aria-label": label }: Readonly<AgendaProps<T>>): React.JSX.Element | null;
135
135
 
136
136
  export { Agenda, agenda, agendaLabels };
137
137
  export type { AgendaItem, AgendaLabels, AgendaProps, AgendaTone };
package/dist/agenda.js CHANGED
@@ -44,7 +44,8 @@ function Agenda({ items, locale = "en-US", timeZone, now, selectedId, onSelect,
44
44
  if (sorted.length === 0) return empty ? /* @__PURE__ */ jsx("div", { className: s.empty(), children: empty }) : null;
45
45
  const at = now ? now.getTime() : null;
46
46
  const upcoming = at === null ? -1 : sorted.findIndex((i) => stamp(i.start) > at);
47
- const lineBefore = at === null ? -1 : upcoming === -1 ? sorted.length : upcoming;
47
+ let lineBefore = -1;
48
+ if (at !== null) lineBefore = upcoming === -1 ? sorted.length : upcoming;
48
49
  const Link = linkAs ?? "a";
49
50
  const row = (item) => {
50
51
  const begun = at !== null && stamp(item.start) <= at;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/agenda/agenda.tsx"],"sourcesContent":["// Server-safe. One day's agenda: the appointments in time order, the times in tabular sans figures, a « now » line\n// placed between them, the past dimmed. The row is one link or button (the app's selection, its URL); its action is a\n// sibling control, never nested. Words are props; the app passes `now` (null hides the line).\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const agenda = tv({\n slots: {\n root: \"m-0 flex list-none flex-col p-0\",\n item: \"relative flex items-stretch gap-1 border-b border-border-subtle last:border-b-0\",\n main: \"group flex min-w-0 flex-1 items-center gap-3 rounded-md px-2 py-3 text-left outline-none transition-colors hover:bg-surface-1 focus-visible:ring-2 focus-visible:ring-focus data-[selected=true]:bg-surface-2\",\n times: \"flex w-16 shrink-0 flex-col text-sm tabular-nums text-fg\",\n start: \"font-semibold\",\n end: \"text-xs text-fg-secondary\",\n marker: \"h-2.5 w-2.5 shrink-0 rounded-full bg-[var(--kz-ag-tone)] ring-4 ring-surface-0\",\n leading: \"shrink-0\",\n text: \"flex min-w-0 flex-1 flex-col\",\n title: \"truncate text-sm font-semibold text-fg\",\n description: \"truncate text-xs text-fg-secondary\",\n status: \"shrink-0\",\n action: \"flex shrink-0 items-center pr-1\",\n now: \"relative flex items-center gap-2 py-1 text-xs font-semibold text-fg-accent\",\n nowLine: \"h-px flex-1 bg-accent\",\n nowDot: \"h-2 w-2 shrink-0 rounded-full bg-accent\",\n empty: \"py-6\",\n },\n variants: {\n past: { true: { times: \"text-fg-secondary\", title: \"font-medium text-fg-secondary\", marker: \"opacity-60\" } },\n },\n});\n\nexport type AgendaTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\" | \"info\";\nconst TONE: Record<AgendaTone, string> = {\n neutral: \"var(--kz-border-strong)\",\n accent: \"var(--kz-accent)\",\n success: \"var(--kz-success)\",\n warning: \"var(--kz-warning)\",\n danger: \"var(--kz-danger)\",\n info: \"var(--kz-info)\",\n};\n\nexport type AgendaItem = {\n id: string;\n /** ISO instant. */\n start: string;\n /** ISO instant; shown under the start and used to know which one is current. */\n end?: string;\n /** The client, the subject. */\n title: React.ReactNode;\n /** The service, the stylist: one muted line. */\n description?: React.ReactNode;\n /** The colour of the rail's dot; the status chip carries the word. */\n tone?: AgendaTone;\n /** Before the text: an `Avatar`. */\n leading?: React.ReactNode;\n /** After the text: a `Badge` with the status, in words. */\n status?: React.ReactNode;\n /** An address for the row (the app's URL state, `?appointment=…`); rendered with `linkAs`. */\n href?: string;\n};\n\nexport type AgendaLabels = {\n /** The « now » line: `(time) => \"Now · 10:42\"`. */\n now: (time: string) => string;\n};\nexport const agendaLabels: AgendaLabels = { now: (time) => `Now · ${time}` };\n\nexport type AgendaProps<T extends AgendaItem> = {\n /** The day's appointments, in any order: the agenda sorts them by start. */\n items: readonly T[];\n /** The agenda's accessible name (« Appointments of Monday »). */\n \"aria-label\": string;\n /** The locale of the times. Default `en-US`. */\n locale?: string;\n /** The time zone of the shop, so the times read the same on the server and on the phone. */\n timeZone?: string;\n /** The instant of the « now » line; `null` or absent hides it (a day that is not today). */\n now?: Date | null;\n /** The open item: marked `aria-current`. */\n selectedId?: string | null;\n /** Called with the item pressed, for items with no `href`. */\n onSelect?: (item: T) => void;\n /** The router's link for items with an `href` (`next/link`). Default `a`. */\n linkAs?: React.ElementType;\n /** A small control after the row (Start, End), outside the row's link. */\n action?: (item: T) => React.ReactNode;\n /** The words, passed translated (the « now » line). */\n labels?: Partial<AgendaLabels>;\n /** Shown when there is no item (an `EmptyState`). */\n empty?: React.ReactNode;\n /** Classes merged on the list. */\n className?: string;\n};\n\nconst stamp = (value: string) => Date.parse(value);\n\nexport function Agenda<T extends AgendaItem>({ items, locale = \"en-US\", timeZone, now, selectedId, onSelect, linkAs, action, labels: given, empty, className, \"aria-label\": label }: AgendaProps<T>) {\n const labels = { ...agendaLabels, ...given };\n const s = agenda();\n const clock = new Intl.DateTimeFormat(locale, { hour: \"numeric\", minute: \"2-digit\", timeZone });\n const time = (value: string | Date) => clock.format(typeof value === \"string\" ? new Date(value) : value);\n const sorted = [...items].sort((a, b) => stamp(a.start) - stamp(b.start));\n if (sorted.length === 0) return empty ? <div className={s.empty()}>{empty}</div> : null;\n const at = now ? now.getTime() : null;\n // The line goes before the first item still to come, and after the last when every one has begun.\n const upcoming = at === null ? -1 : sorted.findIndex((i) => stamp(i.start) > at);\n const lineBefore = at === null ? -1 : upcoming === -1 ? sorted.length : upcoming;\n const Link = (linkAs ?? \"a\") as React.ElementType;\n\n const row = (item: T) => {\n const begun = at !== null && stamp(item.start) <= at;\n const over = begun && item.end !== undefined && stamp(item.end) <= at!;\n const rowStyle = agenda({ past: over });\n const inner = (\n <>\n <span className={rowStyle.times()}>\n <span className={s.start()}>{time(item.start)}</span>\n {item.end ? <span className={s.end()}>{time(item.end)}</span> : null}\n </span>\n <span aria-hidden className={rowStyle.marker()} style={{ [\"--kz-ag-tone\" as string]: TONE[item.tone ?? \"neutral\"] }} />\n {item.leading ? <span className={s.leading()}>{item.leading}</span> : null}\n <span className={s.text()}>\n <span className={rowStyle.title()}>{item.title}</span>\n {item.description ? <span className={s.description()}>{item.description}</span> : null}\n </span>\n {item.status ? <span className={s.status()}>{item.status}</span> : null}\n </>\n );\n const common = { className: s.main(), \"data-selected\": selectedId === item.id, \"data-current\": begun && !over, \"aria-current\": selectedId === item.id ? (\"true\" as const) : undefined };\n return (\n <li key={item.id} className={s.item()}>\n {item.href ? (\n <Link href={item.href} {...common}>\n {inner}\n </Link>\n ) : (\n <button type=\"button\" onClick={() => onSelect?.(item)} {...common}>\n {inner}\n </button>\n )}\n {action ? <div className={s.action()}>{action(item)}</div> : null}\n </li>\n );\n };\n\n const nowLine =\n at === null ? null : (\n <li key=\"now\" className={s.now()} data-agenda-now>\n <span aria-hidden className={s.nowDot()} />\n <span>{labels.now(time(now!))}</span>\n <span aria-hidden className={s.nowLine()} />\n </li>\n );\n\n const rows: React.ReactNode[] = [];\n sorted.forEach((item, index) => {\n if (index === lineBefore) rows.push(nowLine);\n rows.push(row(item));\n });\n if (lineBefore === sorted.length) rows.push(nowLine);\n\n return (\n <ol aria-label={label} className={s.root({ className })}>\n {rows}\n </ol>\n );\n}\n"],"mappings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AAK,WAAW,EAAE,OAAO,GAAI,eAAK,QAAO,IAAU;AAAA,OACrE;AAEF,UAAM,SAAS,EAAE,WAAW,EAAE,KAAK,GAAG,iBAAiB,eAAe,KAAK,IAAI,gBAAgB,SAAS,CAAC,MAAM,gBAAgB,eAAe,KAAK,KAAM,SAAmB,OAAU;AACtL,WACE,qBAAC,QAAiB,WAAW,EAAE,KAAK,GACjC;AAAA,WAAK,OACJ,oBAAC,QAAK,MAAM,KAAK,MAAO,GAAG,QACxB,iBACH,IAEA,oBAAC,YAAO,MAAK,UAAS,SAAS,MAAM,WAAW,IAAI,GAAI,GAAG,QACxD,iBACH;AAAA,MAED,SAAS,oBAAC,SAAI,WAAW,EAAE,OAAO,GAAI,iBAAO,IAAI,GAAE,IAAS;AAAA,SAVtD,KAAK,EAWd;AAAA,EAEJ;AAEA,QAAM,UACJ,OAAO,OAAO,OACZ,qBAAC,QAAa,WAAW,EAAE,IAAI,GAAG,mBAAe,MAC/C;AAAA,wBAAC,UAAK,eAAW,MAAC,WAAW,EAAE,OAAO,GAAG;AAAA,IACzC,oBAAC,UAAM,iBAAO,IAAI,KAAK,GAAI,CAAC,GAAE;AAAA,IAC9B,oBAAC,UAAK,eAAW,MAAC,WAAW,EAAE,QAAQ,GAAG;AAAA,OAHpC,KAIR;AAGJ,QAAM,OAA0B,CAAC;AACjC,SAAO,QAAQ,CAAC,MAAM,UAAU;AAC9B,QAAI,UAAU,WAAY,MAAK,KAAK,OAAO;AAC3C,SAAK,KAAK,IAAI,IAAI,CAAC;AAAA,EACrB,CAAC;AACD,MAAI,eAAe,OAAO,OAAQ,MAAK,KAAK,OAAO;AAEnD,SACE,oBAAC,QAAG,cAAY,OAAO,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GACnD,gBACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/agenda/agenda.tsx"],"sourcesContent":["// Server-safe. One day's agenda: the appointments in time order, the times in tabular sans figures, a « now » line\n// placed between them, the past dimmed. The row is one link or button (the app's selection, its URL); its action is a\n// sibling control, never nested. Words are props; the app passes `now` (null hides the line).\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const agenda = tv({\n slots: {\n root: \"m-0 flex list-none flex-col p-0\",\n item: \"relative flex items-stretch gap-1 border-b border-border-subtle last:border-b-0\",\n main: \"group flex min-w-0 flex-1 items-center gap-3 rounded-md px-2 py-3 text-left outline-none transition-colors hover:bg-surface-1 focus-visible:ring-2 focus-visible:ring-focus data-[selected=true]:bg-surface-2\",\n times: \"flex w-16 shrink-0 flex-col text-sm tabular-nums text-fg\",\n start: \"font-semibold\",\n end: \"text-xs text-fg-secondary\",\n marker: \"h-2.5 w-2.5 shrink-0 rounded-full bg-[var(--kz-ag-tone)] ring-4 ring-surface-0\",\n leading: \"shrink-0\",\n text: \"flex min-w-0 flex-1 flex-col\",\n title: \"truncate text-sm font-semibold text-fg\",\n description: \"truncate text-xs text-fg-secondary\",\n status: \"shrink-0\",\n action: \"flex shrink-0 items-center pr-1\",\n now: \"relative flex items-center gap-2 py-1 text-xs font-semibold text-fg-accent\",\n nowLine: \"h-px flex-1 bg-accent\",\n nowDot: \"h-2 w-2 shrink-0 rounded-full bg-accent\",\n empty: \"py-6\",\n },\n variants: {\n past: { true: { times: \"text-fg-secondary\", title: \"font-medium text-fg-secondary\", marker: \"opacity-60\" } },\n },\n});\n\nexport type AgendaTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\" | \"info\";\nconst TONE: Record<AgendaTone, string> = {\n neutral: \"var(--kz-border-strong)\",\n accent: \"var(--kz-accent)\",\n success: \"var(--kz-success)\",\n warning: \"var(--kz-warning)\",\n danger: \"var(--kz-danger)\",\n info: \"var(--kz-info)\",\n};\n\nexport type AgendaItem = {\n id: string;\n /** ISO instant. */\n start: string;\n /** ISO instant; shown under the start and used to know which one is current. */\n end?: string;\n /** The client, the subject. */\n title: React.ReactNode;\n /** The service, the stylist: one muted line. */\n description?: React.ReactNode;\n /** The colour of the rail's dot; the status chip carries the word. */\n tone?: AgendaTone;\n /** Before the text: an `Avatar`. */\n leading?: React.ReactNode;\n /** After the text: a `Badge` with the status, in words. */\n status?: React.ReactNode;\n /** An address for the row (the app's URL state, `?appointment=…`); rendered with `linkAs`. */\n href?: string;\n};\n\nexport type AgendaLabels = {\n /** The « now » line: `(time) => \"Now · 10:42\"`. */\n now: (time: string) => string;\n};\nexport const agendaLabels: AgendaLabels = { now: (time) => `Now · ${time}` };\n\nexport type AgendaProps<T extends AgendaItem> = {\n /** The day's appointments, in any order: the agenda sorts them by start. */\n items: readonly T[];\n /** The agenda's accessible name (« Appointments of Monday »). */\n \"aria-label\": string;\n /** The locale of the times. Default `en-US`. */\n locale?: string;\n /** The time zone of the shop, so the times read the same on the server and on the phone. */\n timeZone?: string;\n /** The instant of the « now » line; `null` or absent hides it (a day that is not today). */\n now?: Date | null;\n /** The open item: marked `aria-current`. */\n selectedId?: string | null;\n /** Called with the item pressed, for items with no `href`. */\n onSelect?: (item: T) => void;\n /** The router's link for items with an `href` (`next/link`). Default `a`. */\n linkAs?: React.ElementType;\n /** A small control after the row (Start, End), outside the row's link. */\n action?: (item: T) => React.ReactNode;\n /** The words, passed translated (the « now » line). */\n labels?: Partial<AgendaLabels>;\n /** Shown when there is no item (an `EmptyState`). */\n empty?: React.ReactNode;\n /** Classes merged on the list. */\n className?: string;\n};\n\nconst stamp = (value: string) => Date.parse(value);\n\nexport function Agenda<T extends AgendaItem>({ items, locale = \"en-US\", timeZone, now, selectedId, onSelect, linkAs, action, labels: given, empty, className, \"aria-label\": label }: Readonly<AgendaProps<T>>) {\n const labels = { ...agendaLabels, ...given };\n const s = agenda();\n const clock = new Intl.DateTimeFormat(locale, { hour: \"numeric\", minute: \"2-digit\", timeZone });\n const time = (value: string | Date) => clock.format(typeof value === \"string\" ? new Date(value) : value);\n const sorted = [...items].sort((a, b) => stamp(a.start) - stamp(b.start));\n if (sorted.length === 0) return empty ? <div className={s.empty()}>{empty}</div> : null;\n const at = now ? now.getTime() : null;\n // The line goes before the first item still to come, and after the last when every one has begun.\n const upcoming = at === null ? -1 : sorted.findIndex((i) => stamp(i.start) > at);\n let lineBefore = -1;\n if (at !== null) lineBefore = upcoming === -1 ? sorted.length : upcoming;\n const Link = (linkAs ?? \"a\") as React.ElementType;\n\n const row = (item: T) => {\n const begun = at !== null && stamp(item.start) <= at;\n const over = begun && item.end !== undefined && stamp(item.end) <= at!;\n const rowStyle = agenda({ past: over });\n const inner = (\n <>\n <span className={rowStyle.times()}>\n <span className={s.start()}>{time(item.start)}</span>\n {item.end ? <span className={s.end()}>{time(item.end)}</span> : null}\n </span>\n <span aria-hidden className={rowStyle.marker()} style={{ [\"--kz-ag-tone\" as string]: TONE[item.tone ?? \"neutral\"] }} />\n {item.leading ? <span className={s.leading()}>{item.leading}</span> : null}\n <span className={s.text()}>\n <span className={rowStyle.title()}>{item.title}</span>\n {item.description ? <span className={s.description()}>{item.description}</span> : null}\n </span>\n {item.status ? <span className={s.status()}>{item.status}</span> : null}\n </>\n );\n const common = { className: s.main(), \"data-selected\": selectedId === item.id, \"data-current\": begun && !over, \"aria-current\": selectedId === item.id ? (\"true\" as const) : undefined };\n return (\n <li key={item.id} className={s.item()}>\n {item.href ? (\n <Link href={item.href} {...common}>\n {inner}\n </Link>\n ) : (\n <button type=\"button\" onClick={() => onSelect?.(item)} {...common}>\n {inner}\n </button>\n )}\n {action ? <div className={s.action()}>{action(item)}</div> : null}\n </li>\n );\n };\n\n const nowLine =\n at === null ? null : (\n <li key=\"now\" className={s.now()} data-agenda-now>\n <span aria-hidden className={s.nowDot()} />\n <span>{labels.now(time(now!))}</span>\n <span aria-hidden className={s.nowLine()} />\n </li>\n );\n\n const rows: React.ReactNode[] = [];\n sorted.forEach((item, index) => {\n if (index === lineBefore) rows.push(nowLine);\n rows.push(row(item));\n });\n if (lineBefore === sorted.length) rows.push(nowLine);\n\n return (\n <ol aria-label={label} className={s.root({ className })}>\n {rows}\n </ol>\n );\n}\n"],"mappings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S,oBAAC,UAAK,WAAW,EAAE,OAAO,GAAI,eAAK,QAAO,IAAU;AAAA,OACrE;AAEF,UAAM,SAAS,EAAE,WAAW,EAAE,KAAK,GAAG,iBAAiB,eAAe,KAAK,IAAI,gBAAgB,SAAS,CAAC,MAAM,gBAAgB,eAAe,KAAK,KAAM,SAAmB,OAAU;AACtL,WACE,qBAAC,QAAiB,WAAW,EAAE,KAAK,GACjC;AAAA,WAAK,OACJ,oBAAC,QAAK,MAAM,KAAK,MAAO,GAAG,QACxB,iBACH,IAEA,oBAAC,YAAO,MAAK,UAAS,SAAS,MAAM,WAAW,IAAI,GAAI,GAAG,QACxD,iBACH;AAAA,MAED,SAAS,oBAAC,SAAI,WAAW,EAAE,OAAO,GAAI,iBAAO,IAAI,GAAE,IAAS;AAAA,SAVtD,KAAK,EAWd;AAAA,EAEJ;AAEA,QAAM,UACJ,OAAO,OAAO,OACZ,qBAAC,QAAa,WAAW,EAAE,IAAI,GAAG,mBAAe,MAC/C;AAAA,wBAAC,UAAK,eAAW,MAAC,WAAW,EAAE,OAAO,GAAG;AAAA,IACzC,oBAAC,UAAM,iBAAO,IAAI,KAAK,GAAI,CAAC,GAAE;AAAA,IAC9B,oBAAC,UAAK,eAAW,MAAC,WAAW,EAAE,QAAQ,GAAG;AAAA,OAHpC,KAIR;AAGJ,QAAM,OAA0B,CAAC;AACjC,SAAO,QAAQ,CAAC,MAAM,UAAU;AAC9B,QAAI,UAAU,WAAY,MAAK,KAAK,OAAO;AAC3C,SAAK,KAAK,IAAI,IAAI,CAAC;AAAA,EACrB,CAAC;AACD,MAAI,eAAe,OAAO,OAAQ,MAAK,KAAK,OAAO;AAEnD,SACE,oBAAC,QAAG,cAAY,OAAO,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GACnD,gBACH;AAEJ;","names":[]}
@@ -27,7 +27,8 @@ function reportToJson(report) {
27
27
  }
28
28
  var bullets = (items) => items.map((i) => `- ${i}`);
29
29
  function findingLines(f, labels) {
30
- const head = `### ${f.code ? `\`${f.code}\` \xB7 ` : ""}${f.title}`;
30
+ const code = f.code ? `\`${f.code}\` \xB7 ` : "";
31
+ const head = `### ${code}${f.title}`;
31
32
  return [
32
33
  head,
33
34
  ...f.observation ? ["", f.observation] : [],
@@ -102,6 +103,18 @@ var analysisReportStyles = tv({
102
103
  var TONE = { inconsistent: "danger", attention: "warning", unverified: "neutral", consistent: "success" };
103
104
  function FindingCard({ finding, labels, onLocate }) {
104
105
  const s = analysisReportStyles();
106
+ let locationSlot = null;
107
+ if (finding.location) {
108
+ locationSlot = onLocate ? /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", className: s.locate(), onClick: () => onLocate(finding), children: [
109
+ labels.location,
110
+ " ",
111
+ finding.location
112
+ ] }) : /* @__PURE__ */ jsxs("p", { className: s.muted(), children: [
113
+ /* @__PURE__ */ jsx("span", { className: s.term(), children: labels.location }),
114
+ " ",
115
+ finding.location
116
+ ] });
117
+ }
105
118
  return /* @__PURE__ */ jsxs("li", { className: s.finding(), children: [
106
119
  /* @__PURE__ */ jsxs("div", { className: s.findingHead(), children: [
107
120
  /* @__PURE__ */ jsx(Badge, { tone: TONE[finding.status], dot: true, children: labels.status[finding.status] }),
@@ -120,15 +133,7 @@ function FindingCard({ finding, labels, onLocate }) {
120
133
  " \xBB"
121
134
  ] }) : null,
122
135
  finding.reference ? /* @__PURE__ */ jsx("p", { className: s.reference(), children: finding.reference.href ? /* @__PURE__ */ jsx("a", { href: finding.reference.href, className: s.referenceLink(), children: finding.reference.label }) : finding.reference.label }) : null,
123
- finding.location ? onLocate ? /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", className: s.locate(), onClick: () => onLocate(finding), children: [
124
- labels.location,
125
- " ",
126
- finding.location
127
- ] }) : /* @__PURE__ */ jsxs("p", { className: s.muted(), children: [
128
- /* @__PURE__ */ jsx("span", { className: s.term(), children: labels.location }),
129
- " ",
130
- finding.location
131
- ] }) : null,
136
+ locationSlot,
132
137
  finding.evidence ? /* @__PURE__ */ jsxs("details", { className: s.fold(), children: [
133
138
  /* @__PURE__ */ jsx("summary", { className: s.foldSummary(), children: labels.evidence }),
134
139
  /* @__PURE__ */ jsx("pre", { tabIndex: 0, className: s.evidence(), children: /* @__PURE__ */ jsx("code", { children: finding.evidence }) })
@@ -168,6 +173,9 @@ function AnalysisReport({ title, summary, status, findings, limits, nextSteps, p
168
173
  const report = { title, summary, status, findings, limits, nextSteps, provenance };
169
174
  const counts = countByStatus(findings);
170
175
  const heading = React.useId();
176
+ let announcement = "";
177
+ if (copied) announcement = labels.copied;
178
+ else if (streaming) announcement = labels.streaming;
171
179
  const copy = (kind) => {
172
180
  const text = exportReport(kind, report, labels);
173
181
  void navigator.clipboard?.writeText(text).then(() => setCopied(kind));
@@ -193,7 +201,7 @@ function AnalysisReport({ title, summary, status, findings, limits, nextSteps, p
193
201
  /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: () => copy("markdown"), children: labels.copyMarkdown })
194
202
  ] })
195
203
  ] }),
196
- /* @__PURE__ */ jsx("p", { role: "status", className: "sr-only", children: copied ? labels.copied : streaming ? labels.streaming : "" }),
204
+ /* @__PURE__ */ jsx("p", { role: "status", className: "sr-only", children: announcement }),
197
205
  /* @__PURE__ */ jsxs("div", { "aria-live": streaming ? "polite" : void 0, className: "flex flex-col gap-6", children: [
198
206
  findings.length === 0 && !streaming ? /* @__PURE__ */ jsx("p", { className: s.live(), children: labels.noFindings }) : null,
199
207
  groupFindings(findings).map((g) => {