@krizaka/ui 4.7.0 → 4.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (933) hide show
  1. package/dist/{RotatingWord-D3tpDLE4.d.ts → RotatingWord-CkDcPH9x.d.ts} +2 -2
  2. package/dist/account-menu.js +2 -2
  3. package/dist/account-menu.js.map +1 -1
  4. package/dist/account-settings.d.ts +9 -9
  5. package/dist/account-settings.js +4 -4
  6. package/dist/account-settings.js.map +1 -1
  7. package/dist/achievement.d.ts +3 -3
  8. package/dist/achievement.js +1 -1
  9. package/dist/achievement.js.map +1 -1
  10. package/dist/action-bar.d.ts +1 -1
  11. package/dist/action-bar.js +5 -5
  12. package/dist/action-bar.js.map +1 -1
  13. package/dist/activity-feed.d.ts +2 -2
  14. package/dist/activity-feed.js +1 -1
  15. package/dist/activity-feed.js.map +1 -1
  16. package/dist/alert.d.ts +1 -1
  17. package/dist/alert.js.map +1 -1
  18. package/dist/analysis-report.d.ts +1 -1
  19. package/dist/analysis-report.js +4 -4
  20. package/dist/analysis-report.js.map +1 -1
  21. package/dist/anatomy-plate.d.ts +1 -1
  22. package/dist/anatomy-plate.js +1 -1
  23. package/dist/anatomy-plate.js.map +1 -1
  24. package/dist/app-header/search.d.ts +1 -1
  25. package/dist/app-header/search.js +2 -2
  26. package/dist/app-header/search.js.map +1 -1
  27. package/dist/app-header.d.ts +2 -2
  28. package/dist/app-header.js.map +1 -1
  29. package/dist/app-shell.d.ts +8 -8
  30. package/dist/app-shell.js +4 -4
  31. package/dist/app-shell.js.map +1 -1
  32. package/dist/architecture-diagram.d.ts +1 -1
  33. package/dist/architecture-diagram.js.map +1 -1
  34. package/dist/argument-card.d.ts +2 -2
  35. package/dist/argument-card.js +6 -6
  36. package/dist/argument-card.js.map +1 -1
  37. package/dist/auth-layout.d.ts +1 -1
  38. package/dist/auth-layout.js.map +1 -1
  39. package/dist/avatar.d.ts +2 -2
  40. package/dist/avatar.js.map +1 -1
  41. package/dist/badge.d.ts +1 -1
  42. package/dist/badge.js +1 -1
  43. package/dist/bird-plate.d.ts +1 -1
  44. package/dist/bird-plate.js +2 -2
  45. package/dist/bird-plate.js.map +1 -1
  46. package/dist/button.d.ts +2 -2
  47. package/dist/button.js +3 -3
  48. package/dist/captcha.d.ts +2 -2
  49. package/dist/captcha.js +3 -3
  50. package/dist/captcha.js.map +1 -1
  51. package/dist/card-grid.d.ts +1 -1
  52. package/dist/card-grid.js +1 -1
  53. package/dist/card-grid.js.map +1 -1
  54. package/dist/card.d.ts +9 -9
  55. package/dist/card.js +1 -1
  56. package/dist/card.js.map +1 -1
  57. package/dist/catalogue-page.d.ts +2 -2
  58. package/dist/catalogue-page.js.map +1 -1
  59. package/dist/changelog-page.d.ts +1 -1
  60. package/dist/changelog-page.js +2 -2
  61. package/dist/changelog-page.js.map +1 -1
  62. package/dist/chapter.d.ts +3 -3
  63. package/dist/chapter.js +2 -2
  64. package/dist/chapter.js.map +1 -1
  65. package/dist/chat.d.ts +3 -3
  66. package/dist/chat.js +1 -1
  67. package/dist/chat.js.map +1 -1
  68. package/dist/checkbox.d.ts +1 -1
  69. package/dist/checkbox.js.map +1 -1
  70. package/dist/chip-link.d.ts +1 -1
  71. package/dist/chip-link.js +1 -1
  72. package/dist/chip-row.d.ts +2 -2
  73. package/dist/chip-row.js +1 -1
  74. package/dist/chip-row.js.map +1 -1
  75. package/dist/chip.d.ts +4 -5
  76. package/dist/chip.js +2 -2
  77. package/dist/choice-grid.d.ts +1 -1
  78. package/dist/choice-grid.js +2 -2
  79. package/dist/choice-grid.js.map +1 -1
  80. package/dist/{chunk-S6NYGOJT.js → chunk-22IORLB5.js} +1 -1
  81. package/dist/chunk-22IORLB5.js.map +1 -0
  82. package/dist/{chunk-QA3WETWT.js → chunk-2P7Y3LNN.js} +1 -1
  83. package/dist/chunk-2P7Y3LNN.js.map +1 -0
  84. package/dist/{chunk-OGWB76BR.js → chunk-3CEMOJBL.js} +2 -2
  85. package/dist/chunk-3CEMOJBL.js.map +1 -0
  86. package/dist/{chunk-WC3SO4CE.js → chunk-3SWWUJJL.js} +2 -2
  87. package/dist/chunk-3SWWUJJL.js.map +1 -0
  88. package/dist/{chunk-S2O4NSN5.js → chunk-3TCHVNNB.js} +1 -1
  89. package/dist/chunk-3TCHVNNB.js.map +1 -0
  90. package/dist/{chunk-7P7I5OQV.js → chunk-5KBYZLU4.js} +2 -2
  91. package/dist/chunk-5KBYZLU4.js.map +1 -0
  92. package/dist/{chunk-WKQ5CB3I.js → chunk-6ARAO3TR.js} +1 -1
  93. package/dist/{chunk-WKQ5CB3I.js.map → chunk-6ARAO3TR.js.map} +1 -1
  94. package/dist/{chunk-QHVV2JGF.js → chunk-6LF6IZZM.js} +2 -2
  95. package/dist/chunk-6LF6IZZM.js.map +1 -0
  96. package/dist/{chunk-HP7BDMVK.js → chunk-7B5Q76JR.js} +2 -2
  97. package/dist/chunk-7B5Q76JR.js.map +1 -0
  98. package/dist/{chunk-F2UZ2WWL.js → chunk-7KIIAOQH.js} +1 -1
  99. package/dist/{chunk-F2UZ2WWL.js.map → chunk-7KIIAOQH.js.map} +1 -1
  100. package/dist/{chunk-ADRUEPYC.js → chunk-7MA3UODW.js} +2 -2
  101. package/dist/{chunk-ADRUEPYC.js.map → chunk-7MA3UODW.js.map} +1 -1
  102. package/dist/{chunk-KH3JOEPY.js → chunk-7PVLEALV.js} +1 -1
  103. package/dist/chunk-7PVLEALV.js.map +1 -0
  104. package/dist/{chunk-QVHSV6RA.js → chunk-7UBLUGNW.js} +1 -1
  105. package/dist/chunk-7UBLUGNW.js.map +1 -0
  106. package/dist/{chunk-YTYNKMNS.js → chunk-BKMHN4UA.js} +5 -5
  107. package/dist/chunk-BKMHN4UA.js.map +1 -0
  108. package/dist/{chunk-4QH6CP2Y.js → chunk-BRYRZWLV.js} +1 -1
  109. package/dist/{chunk-4QH6CP2Y.js.map → chunk-BRYRZWLV.js.map} +1 -1
  110. package/dist/{chunk-43PTCDTL.js → chunk-BVN7JFOP.js} +1 -1
  111. package/dist/chunk-BVN7JFOP.js.map +1 -0
  112. package/dist/{chunk-5RWHDX5J.js → chunk-BYKA3FHX.js} +2 -2
  113. package/dist/chunk-BYKA3FHX.js.map +1 -0
  114. package/dist/{chunk-5PFCELGW.js → chunk-DIOAQOR5.js} +1 -1
  115. package/dist/chunk-DIOAQOR5.js.map +1 -0
  116. package/dist/{chunk-HJFRHYCI.js → chunk-DTGRZXYO.js} +2 -2
  117. package/dist/{chunk-P7AFIKWG.js → chunk-DVC4YQI2.js} +2 -2
  118. package/dist/chunk-DVC4YQI2.js.map +1 -0
  119. package/dist/{chunk-V5RO6JYI.js → chunk-E3LFHTUV.js} +2 -2
  120. package/dist/chunk-E3LFHTUV.js.map +1 -0
  121. package/dist/{chunk-WEVYKZIF.js → chunk-EAXIDRMB.js} +1 -1
  122. package/dist/chunk-EAXIDRMB.js.map +1 -0
  123. package/dist/{chunk-WU4VLSEA.js → chunk-EYMS6VRF.js} +1 -1
  124. package/dist/chunk-EYMS6VRF.js.map +1 -0
  125. package/dist/{chunk-LH5J3VLZ.js → chunk-F7EJZV53.js} +1 -1
  126. package/dist/chunk-F7EJZV53.js.map +1 -0
  127. package/dist/{chunk-VPO27AFS.js → chunk-G3L7AKZJ.js} +1 -1
  128. package/dist/chunk-G3L7AKZJ.js.map +1 -0
  129. package/dist/{chunk-EB45EVPJ.js → chunk-G5NROYGK.js} +3 -3
  130. package/dist/chunk-G5NROYGK.js.map +1 -0
  131. package/dist/{chunk-HKEAYSFS.js → chunk-GQMINKT3.js} +1 -1
  132. package/dist/{chunk-ENOS6ETI.js.map → chunk-GQMINKT3.js.map} +1 -1
  133. package/dist/{chunk-3X3OF4TI.js → chunk-H4NXYAL7.js} +1 -1
  134. package/dist/{chunk-3X3OF4TI.js.map → chunk-H4NXYAL7.js.map} +1 -1
  135. package/dist/{chunk-KR2W4ONJ.js → chunk-H7I6YLI6.js} +1 -1
  136. package/dist/chunk-H7I6YLI6.js.map +1 -0
  137. package/dist/{chunk-PJNR4NTS.js → chunk-HC2TY45B.js} +4 -4
  138. package/dist/{chunk-NSLXEDIS.js → chunk-HHBTM4AU.js} +1 -1
  139. package/dist/chunk-HHBTM4AU.js.map +1 -0
  140. package/dist/{chunk-XVRKKYWU.js → chunk-HVUR3UNK.js} +2 -2
  141. package/dist/{chunk-XVRKKYWU.js.map → chunk-HVUR3UNK.js.map} +1 -1
  142. package/dist/{chunk-V7W4RLRW.js → chunk-HWIDTLLO.js} +3 -3
  143. package/dist/chunk-HWIDTLLO.js.map +1 -0
  144. package/dist/{chunk-W675RFOA.js → chunk-ISC2QBXJ.js} +1 -1
  145. package/dist/chunk-ISC2QBXJ.js.map +1 -0
  146. package/dist/{chunk-7DYZTEE3.js → chunk-IWPB6SSW.js} +1 -1
  147. package/dist/chunk-IWPB6SSW.js.map +1 -0
  148. package/dist/{chunk-TVLRE7S3.js → chunk-JDVWUF5W.js} +2 -2
  149. package/dist/{chunk-TVLRE7S3.js.map → chunk-JDVWUF5W.js.map} +1 -1
  150. package/dist/{chunk-757ZTGU5.js → chunk-JE2NY4XE.js} +4 -4
  151. package/dist/chunk-JE2NY4XE.js.map +1 -0
  152. package/dist/{chunk-HLEBSAGC.js → chunk-KBSZ6JRF.js} +2 -2
  153. package/dist/chunk-KBSZ6JRF.js.map +1 -0
  154. package/dist/{chunk-Y3P5B4XS.js → chunk-KCU45KQ3.js} +3 -3
  155. package/dist/chunk-KCU45KQ3.js.map +1 -0
  156. package/dist/{chunk-ST5P5HNI.js → chunk-L4YBG5US.js} +4 -4
  157. package/dist/{chunk-ST5P5HNI.js.map → chunk-L4YBG5US.js.map} +1 -1
  158. package/dist/{chunk-NG6G6V5E.js → chunk-LFH3LEWR.js} +1 -1
  159. package/dist/chunk-LFH3LEWR.js.map +1 -0
  160. package/dist/{chunk-YATTFMDV.js → chunk-LSQQSJ6J.js} +2 -2
  161. package/dist/{chunk-YATTFMDV.js.map → chunk-LSQQSJ6J.js.map} +1 -1
  162. package/dist/{chunk-LNAAWT4Y.js → chunk-MJWOZ3JI.js} +1 -1
  163. package/dist/chunk-MJWOZ3JI.js.map +1 -0
  164. package/dist/{chunk-KID32IRJ.js → chunk-MXHJMTZ5.js} +1 -1
  165. package/dist/{chunk-KID32IRJ.js.map → chunk-MXHJMTZ5.js.map} +1 -1
  166. package/dist/{chunk-GHAN7OOE.js → chunk-N6LAWI4F.js} +2 -2
  167. package/dist/chunk-N6LAWI4F.js.map +1 -0
  168. package/dist/{chunk-5VZ37TY3.js → chunk-NFJWD5BT.js} +2 -2
  169. package/dist/chunk-NFJWD5BT.js.map +1 -0
  170. package/dist/{chunk-ZPOVOEO3.js → chunk-NJLIHGU4.js} +2 -2
  171. package/dist/chunk-NJLIHGU4.js.map +1 -0
  172. package/dist/{chunk-PRD7JRQX.js → chunk-ONCQWOTH.js} +4 -4
  173. package/dist/{chunk-PRD7JRQX.js.map → chunk-ONCQWOTH.js.map} +1 -1
  174. package/dist/{chunk-ENOS6ETI.js → chunk-OZC6CDZF.js} +1 -1
  175. package/dist/{chunk-HKEAYSFS.js.map → chunk-OZC6CDZF.js.map} +1 -1
  176. package/dist/{chunk-TXFX4PMN.js → chunk-OZY4C4W5.js} +1 -1
  177. package/dist/{chunk-TXFX4PMN.js.map → chunk-OZY4C4W5.js.map} +1 -1
  178. package/dist/{chunk-NPMGYLJV.js → chunk-PIRYDEX2.js} +3 -3
  179. package/dist/chunk-PIRYDEX2.js.map +1 -0
  180. package/dist/{chunk-C57KK5VB.js → chunk-PM23USOC.js} +1 -1
  181. package/dist/chunk-PM23USOC.js.map +1 -0
  182. package/dist/{chunk-PGBF3UBX.js → chunk-QKL5TECH.js} +1 -1
  183. package/dist/chunk-QKL5TECH.js.map +1 -0
  184. package/dist/{chunk-Z47KIPCT.js → chunk-QY5JEUJT.js} +1 -1
  185. package/dist/chunk-QY5JEUJT.js.map +1 -0
  186. package/dist/{chunk-FVGFPB73.js → chunk-RPVKF4RR.js} +1 -1
  187. package/dist/{chunk-FVGFPB73.js.map → chunk-RPVKF4RR.js.map} +1 -1
  188. package/dist/{chunk-NM2DEHFZ.js → chunk-RXYKJIC4.js} +1 -1
  189. package/dist/chunk-RXYKJIC4.js.map +1 -0
  190. package/dist/{chunk-W64RAX4N.js → chunk-TKYNYIJS.js} +5 -5
  191. package/dist/chunk-TKYNYIJS.js.map +1 -0
  192. package/dist/{chunk-S4TLZRGZ.js → chunk-UMXWOA3I.js} +1 -1
  193. package/dist/chunk-UMXWOA3I.js.map +1 -0
  194. package/dist/{chunk-VA4NPCUQ.js → chunk-VD7QFUAP.js} +3 -3
  195. package/dist/chunk-VD7QFUAP.js.map +1 -0
  196. package/dist/{chunk-MDSP7DJR.js → chunk-VQELCPQJ.js} +5 -5
  197. package/dist/chunk-VQELCPQJ.js.map +1 -0
  198. package/dist/{chunk-2FCQCWIK.js → chunk-VXNBXW3P.js} +5 -5
  199. package/dist/chunk-VXNBXW3P.js.map +1 -0
  200. package/dist/{chunk-B47WSPMP.js → chunk-WPUDPH2Q.js} +1 -1
  201. package/dist/chunk-WPUDPH2Q.js.map +1 -0
  202. package/dist/{chunk-SG2RKUVJ.js → chunk-WTZUMVJI.js} +5 -5
  203. package/dist/chunk-WTZUMVJI.js.map +1 -0
  204. package/dist/{chunk-EDQLPCM4.js → chunk-WVZF6WK3.js} +2 -2
  205. package/dist/chunk-WVZF6WK3.js.map +1 -0
  206. package/dist/{chunk-5D7NMUF6.js → chunk-XDAETKWM.js} +2 -2
  207. package/dist/chunk-XDAETKWM.js.map +1 -0
  208. package/dist/{chunk-QD6SNXF5.js → chunk-XDWSGNL4.js} +3 -3
  209. package/dist/chunk-XDWSGNL4.js.map +1 -0
  210. package/dist/{chunk-SB5WSVPI.js → chunk-ZFH2BYXW.js} +2 -2
  211. package/dist/chunk-ZFH2BYXW.js.map +1 -0
  212. package/dist/{chunk-XVLWVTQA.js → chunk-ZI7K742O.js} +1 -1
  213. package/dist/{chunk-XVLWVTQA.js.map → chunk-ZI7K742O.js.map} +1 -1
  214. package/dist/{chunk-NQENOT6L.js → chunk-ZRRWSKV3.js} +8 -8
  215. package/dist/chunk-ZRRWSKV3.js.map +1 -0
  216. package/dist/cn.js +1 -1
  217. package/dist/code-block.d.ts +2 -2
  218. package/dist/code-block.js +2 -2
  219. package/dist/code-block.js.map +1 -1
  220. package/dist/collection-switcher.d.ts +1 -1
  221. package/dist/collection-switcher.js +1 -1
  222. package/dist/collection-switcher.js.map +1 -1
  223. package/dist/columns.d.ts +2 -2
  224. package/dist/columns.js.map +1 -1
  225. package/dist/combobox.js +4 -4
  226. package/dist/command.d.ts +10 -10
  227. package/dist/command.js +4 -4
  228. package/dist/command.js.map +1 -1
  229. package/dist/comparison-table.d.ts +1 -1
  230. package/dist/comparison-table.js +1 -1
  231. package/dist/comparison-table.js.map +1 -1
  232. package/dist/component-page.d.ts +1 -1
  233. package/dist/component-page.js.map +1 -1
  234. package/dist/confirm-button.d.ts +1 -1
  235. package/dist/confirm-button.js +4 -4
  236. package/dist/contact-page.d.ts +1 -1
  237. package/dist/contact-page.js.map +1 -1
  238. package/dist/continue-prompt.d.ts +1 -1
  239. package/dist/continue-prompt.js +1 -1
  240. package/dist/continue-prompt.js.map +1 -1
  241. package/dist/copy-button.d.ts +1 -1
  242. package/dist/copy-button.js +4 -4
  243. package/dist/copy-button.js.map +1 -1
  244. package/dist/countdown.d.ts +1 -1
  245. package/dist/countdown.js.map +1 -1
  246. package/dist/cover-hero.d.ts +1 -1
  247. package/dist/cover-hero.js +5 -5
  248. package/dist/cover-hero.js.map +1 -1
  249. package/dist/cta-panel.d.ts +1 -1
  250. package/dist/cta-panel.js +1 -1
  251. package/dist/cta-panel.js.map +1 -1
  252. package/dist/dashboard-layout.d.ts +2 -2
  253. package/dist/dashboard-layout.js.map +1 -1
  254. package/dist/data-table.d.ts +5 -5
  255. package/dist/data-table.js +9 -9
  256. package/dist/date-picker.d.ts +11 -11
  257. package/dist/date-picker.js +5 -5
  258. package/dist/date-picker.js.map +1 -1
  259. package/dist/decision-list.d.ts +1 -1
  260. package/dist/decision-list.js +2 -2
  261. package/dist/decision-list.js.map +1 -1
  262. package/dist/description-list.d.ts +2 -2
  263. package/dist/description-list.js.map +1 -1
  264. package/dist/detail-layout.d.ts +5 -5
  265. package/dist/detail-layout.js +1 -1
  266. package/dist/detail-layout.js.map +1 -1
  267. package/dist/{dialog-DpUwec2g.d.ts → dialog-CFnxFGyn.d.ts} +7 -7
  268. package/dist/dialog.d.ts +2 -2
  269. package/dist/dialog.js +4 -4
  270. package/dist/dialog.js.map +1 -1
  271. package/dist/docs-article-page.d.ts +1 -1
  272. package/dist/docs-article-page.js.map +1 -1
  273. package/dist/docs-hub-page.d.ts +1 -1
  274. package/dist/docs-hub-page.js.map +1 -1
  275. package/dist/docs-layout.d.ts +1 -1
  276. package/dist/docs-layout.js +1 -1
  277. package/dist/docs-layout.js.map +1 -1
  278. package/dist/docs-nav.d.ts +1 -1
  279. package/dist/docs-nav.js +1 -1
  280. package/dist/docs-nav.js.map +1 -1
  281. package/dist/document-viewer.d.ts +2 -2
  282. package/dist/document-viewer.js +3 -3
  283. package/dist/document-viewer.js.map +1 -1
  284. package/dist/doodle.d.ts +1 -1
  285. package/dist/doodle.js +1 -1
  286. package/dist/doodle.js.map +1 -1
  287. package/dist/drop-overlay.d.ts +1 -1
  288. package/dist/drop-overlay.js +1 -1
  289. package/dist/drop-overlay.js.map +1 -1
  290. package/dist/dropdown-menu.d.ts +8 -8
  291. package/dist/dropdown-menu.js +2 -2
  292. package/dist/embed-facade.js +1 -1
  293. package/dist/empty-state.d.ts +1 -1
  294. package/dist/empty-state.js.map +1 -1
  295. package/dist/engine-flow.d.ts +1 -1
  296. package/dist/engine-flow.js +1 -1
  297. package/dist/engine-flow.js.map +1 -1
  298. package/dist/entity-header.d.ts +1 -1
  299. package/dist/entity-header.js +1 -1
  300. package/dist/entity-header.js.map +1 -1
  301. package/dist/environment-notice.d.ts +1 -1
  302. package/dist/environment-notice.js.map +1 -1
  303. package/dist/error-page.d.ts +1 -1
  304. package/dist/error-page.js +1 -1
  305. package/dist/error-page.js.map +1 -1
  306. package/dist/field.d.ts +3 -3
  307. package/dist/field.js +1 -1
  308. package/dist/field.js.map +1 -1
  309. package/dist/file-upload.d.ts +1 -1
  310. package/dist/file-upload.js +1 -1
  311. package/dist/file-upload.js.map +1 -1
  312. package/dist/filter-bar.d.ts +2 -2
  313. package/dist/filter-bar.js +4 -4
  314. package/dist/flock.d.ts +1 -1
  315. package/dist/flock.js +2 -2
  316. package/dist/flock.js.map +1 -1
  317. package/dist/footnote.d.ts +3 -3
  318. package/dist/footnote.js +1 -1
  319. package/dist/footnote.js.map +1 -1
  320. package/dist/force-update-screen.d.ts +1 -1
  321. package/dist/force-update-screen.js +3 -3
  322. package/dist/force-update-screen.js.map +1 -1
  323. package/dist/form/server.js.map +1 -1
  324. package/dist/form.d.ts +12 -12
  325. package/dist/form.js +4 -4
  326. package/dist/form.js.map +1 -1
  327. package/dist/{frame-CmDztC_y.d.ts → frame-D5HU_cG8.d.ts} +2 -2
  328. package/dist/gallery-page.d.ts +1 -1
  329. package/dist/gallery-page.js +1 -1
  330. package/dist/gallery-page.js.map +1 -1
  331. package/dist/genui.d.ts +2 -2
  332. package/dist/genui.js +9 -9
  333. package/dist/genui.js.map +1 -1
  334. package/dist/glossary-term.js +2 -2
  335. package/dist/glow-card.d.ts +1 -1
  336. package/dist/glow-card.js +1 -1
  337. package/dist/glow-card.js.map +1 -1
  338. package/dist/goal-gauge.d.ts +1 -1
  339. package/dist/goal-gauge.js +1 -1
  340. package/dist/goal-gauge.js.map +1 -1
  341. package/dist/grade-stamp.d.ts +1 -1
  342. package/dist/grade-stamp.js +2 -2
  343. package/dist/grade-stamp.js.map +1 -1
  344. package/dist/identity-card.d.ts +1 -1
  345. package/dist/identity-card.js +5 -5
  346. package/dist/identity-card.js.map +1 -1
  347. package/dist/image-cropper.d.ts +1 -1
  348. package/dist/image-cropper.js +3 -3
  349. package/dist/image-cropper.js.map +1 -1
  350. package/dist/index.d.ts +5 -5
  351. package/dist/index.js +2 -2
  352. package/dist/index.js.map +1 -1
  353. package/dist/kanban.d.ts +1 -1
  354. package/dist/kanban.js.map +1 -1
  355. package/dist/kbd.d.ts +1 -1
  356. package/dist/kbd.js.map +1 -1
  357. package/dist/kind-config-editor.js +8 -8
  358. package/dist/kind-config-editor.js.map +1 -1
  359. package/dist/kpi-explained.js +1 -1
  360. package/dist/kpi-explained.js.map +1 -1
  361. package/dist/landing-page.d.ts +1 -1
  362. package/dist/landing-page.js.map +1 -1
  363. package/dist/landscape.d.ts +1 -1
  364. package/dist/landscape.js +2 -2
  365. package/dist/landscape.js.map +1 -1
  366. package/dist/language-switch.d.ts +10 -10
  367. package/dist/language-switch.js +1 -1
  368. package/dist/legal-page.d.ts +1 -1
  369. package/dist/legal-page.js.map +1 -1
  370. package/dist/{lightbox-MRB2YZEP.js → lightbox-JLWASIJC.js} +4 -4
  371. package/dist/link-card.d.ts +1 -1
  372. package/dist/link-card.js +4 -4
  373. package/dist/list.d.ts +1 -1
  374. package/dist/list.js +2 -2
  375. package/dist/list.js.map +1 -1
  376. package/dist/loader.d.ts +2 -2
  377. package/dist/loader.js +1 -1
  378. package/dist/loader.js.map +1 -1
  379. package/dist/longform-page.d.ts +1 -1
  380. package/dist/longform-page.js +1 -1
  381. package/dist/longform-page.js.map +1 -1
  382. package/dist/maintenance-screen.d.ts +1 -1
  383. package/dist/maintenance-screen.js +3 -3
  384. package/dist/maintenance-screen.js.map +1 -1
  385. package/dist/map/cards.d.ts +2 -2
  386. package/dist/map/cards.js +1 -1
  387. package/dist/map/cards.js.map +1 -1
  388. package/dist/map/pin.js +1 -1
  389. package/dist/map/sheet.d.ts +1 -1
  390. package/dist/map/sheet.js +1 -1
  391. package/dist/map/sheet.js.map +1 -1
  392. package/dist/map.d.ts +11 -11
  393. package/dist/map.js +4 -4
  394. package/dist/map.js.map +1 -1
  395. package/dist/margin-layout.d.ts +2 -2
  396. package/dist/margin-layout.js.map +1 -1
  397. package/dist/markdown.d.ts +1 -1
  398. package/dist/markdown.js.map +1 -1
  399. package/dist/marketing-layout.d.ts +1 -1
  400. package/dist/marketing-layout.js.map +1 -1
  401. package/dist/mascot-quote.d.ts +1 -1
  402. package/dist/mascot-quote.js +2 -2
  403. package/dist/mascot-quote.js.map +1 -1
  404. package/dist/mascot-state.d.ts +5 -5
  405. package/dist/mascot-state.js +1 -1
  406. package/dist/mascot-state.js.map +1 -1
  407. package/dist/mascots.d.ts +2 -2
  408. package/dist/mascots.js +2 -2
  409. package/dist/mascots.js.map +1 -1
  410. package/dist/match-dialog.d.ts +1 -1
  411. package/dist/match-dialog.js +4 -4
  412. package/dist/match-dialog.js.map +1 -1
  413. package/dist/media-capture.d.ts +1 -1
  414. package/dist/media-capture.js +1 -1
  415. package/dist/media-capture.js.map +1 -1
  416. package/dist/media-carousel.js +5 -5
  417. package/dist/media-carousel.js.map +1 -1
  418. package/dist/media-gallery.d.ts +1 -1
  419. package/dist/media-gallery.js +1 -1
  420. package/dist/media-gallery.js.map +1 -1
  421. package/dist/media-player.d.ts +1 -1
  422. package/dist/media-player.js +4 -4
  423. package/dist/meter.d.ts +2 -2
  424. package/dist/meter.js +1 -1
  425. package/dist/money-input.d.ts +1 -1
  426. package/dist/money-input.js +3 -3
  427. package/dist/motion.d.ts +1 -1
  428. package/dist/motion.js +1 -1
  429. package/dist/native/form.d.ts +12 -12
  430. package/dist/native/form.js +4 -4
  431. package/dist/native/form.js.map +1 -1
  432. package/dist/native/list.d.ts +1 -1
  433. package/dist/native/list.js.map +1 -1
  434. package/dist/native/map.d.ts +4 -4
  435. package/dist/native/map.js +2 -2
  436. package/dist/native/map.js.map +1 -1
  437. package/dist/native/markdown.js.map +1 -1
  438. package/dist/native/media-capture.d.ts +1 -1
  439. package/dist/native/media-capture.js.map +1 -1
  440. package/dist/native/media-picker.d.ts +1 -1
  441. package/dist/native/media-picker.js.map +1 -1
  442. package/dist/native/vertical-video.d.ts +2 -2
  443. package/dist/native/vertical-video.js.map +1 -1
  444. package/dist/native/video-player.d.ts +1 -1
  445. package/dist/native/video-player.js.map +1 -1
  446. package/dist/native.d.ts +95 -95
  447. package/dist/native.js +13 -13
  448. package/dist/native.js.map +1 -1
  449. package/dist/nav-bar.d.ts +13 -13
  450. package/dist/nav-bar.js +5 -5
  451. package/dist/nav-bar.js.map +1 -1
  452. package/dist/notification-preferences.js +3 -3
  453. package/dist/number-ticker.d.ts +1 -1
  454. package/dist/number-ticker.js +1 -1
  455. package/dist/number-ticker.js.map +1 -1
  456. package/dist/opening-hours.d.ts +1 -1
  457. package/dist/opening-hours.js +1 -1
  458. package/dist/opening-hours.js.map +1 -1
  459. package/dist/{page-DPHDmDAQ.d.ts → page-Ufnb5TrQ.d.ts} +5 -5
  460. package/dist/page-header.d.ts +1 -1
  461. package/dist/page-header.js.map +1 -1
  462. package/dist/page-hero.d.ts +1 -1
  463. package/dist/page-hero.js +5 -5
  464. package/dist/page-hero.js.map +1 -1
  465. package/dist/page-index.d.ts +1 -1
  466. package/dist/page-index.js +2 -2
  467. package/dist/page-index.js.map +1 -1
  468. package/dist/page.d.ts +1 -1
  469. package/dist/page.js +3 -3
  470. package/dist/pagination.d.ts +1 -1
  471. package/dist/pagination.js +1 -1
  472. package/dist/pagination.js.map +1 -1
  473. package/dist/pausable-loop.js +2 -2
  474. package/dist/{player-lightbox-BYQ57OXT.js → player-lightbox-SJR3GB7U.js} +5 -5
  475. package/dist/player-lightbox-SJR3GB7U.js.map +1 -0
  476. package/dist/pointer-light.d.ts +1 -1
  477. package/dist/pointer-light.js.map +1 -1
  478. package/dist/popover.d.ts +1 -1
  479. package/dist/popover.js +1 -1
  480. package/dist/popover.js.map +1 -1
  481. package/dist/price-catalogue-editor.js +8 -8
  482. package/dist/price-catalogue-editor.js.map +1 -1
  483. package/dist/pricing-page.d.ts +1 -1
  484. package/dist/pricing-page.js +1 -1
  485. package/dist/pricing-page.js.map +1 -1
  486. package/dist/product-page.d.ts +1 -1
  487. package/dist/product-page.js +1 -1
  488. package/dist/product-page.js.map +1 -1
  489. package/dist/profile-card.d.ts +3 -3
  490. package/dist/profile-card.js +1 -1
  491. package/dist/profile-card.js.map +1 -1
  492. package/dist/progress.d.ts +1 -1
  493. package/dist/progress.js.map +1 -1
  494. package/dist/promise-card.d.ts +1 -1
  495. package/dist/promise-card.js +1 -1
  496. package/dist/promise-card.js.map +1 -1
  497. package/dist/promo-code-field.js +4 -4
  498. package/dist/proposal.js +5 -5
  499. package/dist/qr-code.js +6 -6
  500. package/dist/qr-code.js.map +1 -1
  501. package/dist/quota-meter.d.ts +1 -1
  502. package/dist/quota-meter.js +1 -1
  503. package/dist/quota-meter.js.map +1 -1
  504. package/dist/radio-group.d.ts +5 -5
  505. package/dist/radio-group.js +3 -3
  506. package/dist/radio-group.js.map +1 -1
  507. package/dist/rail-nav.d.ts +4 -4
  508. package/dist/rail-nav.js +3 -3
  509. package/dist/rail-nav.js.map +1 -1
  510. package/dist/recipes.js +1 -1
  511. package/dist/recipes.js.map +1 -1
  512. package/dist/retro-tv-playlist.d.ts +1 -1
  513. package/dist/retro-tv-playlist.js.map +1 -1
  514. package/dist/retro-tv.js +6 -6
  515. package/dist/retro-tv.js.map +1 -1
  516. package/dist/reviews.js +3 -3
  517. package/dist/{schema-Dkn0uX72.d.ts → schema-Dd05m48Q.d.ts} +1 -1
  518. package/dist/schema-form.js +7 -7
  519. package/dist/schema-form.js.map +1 -1
  520. package/dist/scroll-stage.d.ts +2 -2
  521. package/dist/scroll-stage.js +2 -2
  522. package/dist/scroll-stage.js.map +1 -1
  523. package/dist/search-field.d.ts +1 -1
  524. package/dist/search-field.js +2 -2
  525. package/dist/section-backdrop.d.ts +1 -1
  526. package/dist/section-backdrop.js +1 -1
  527. package/dist/separator.d.ts +1 -1
  528. package/dist/separator.js.map +1 -1
  529. package/dist/service-card.d.ts +1 -1
  530. package/dist/service-card.js +6 -6
  531. package/dist/service-card.js.map +1 -1
  532. package/dist/settings-layout.d.ts +3 -3
  533. package/dist/settings-layout.js +2 -2
  534. package/dist/shop/booking.d.ts +1 -1
  535. package/dist/shop/booking.js +4 -4
  536. package/dist/shop/booking.js.map +1 -1
  537. package/dist/shop/bulletin.d.ts +1 -1
  538. package/dist/shop/bulletin.js +2 -2
  539. package/dist/shop/bulletin.js.map +1 -1
  540. package/dist/shop/faq.d.ts +1 -1
  541. package/dist/shop/faq.js +3 -3
  542. package/dist/shop/faq.js.map +1 -1
  543. package/dist/shop/gallery.d.ts +1 -1
  544. package/dist/shop/gallery.js +3 -3
  545. package/dist/shop/gallery.js.map +1 -1
  546. package/dist/shop/hero.d.ts +1 -1
  547. package/dist/shop/hero.js +2 -2
  548. package/dist/shop/hero.js.map +1 -1
  549. package/dist/shop/policies.d.ts +1 -1
  550. package/dist/shop/policies.js +2 -2
  551. package/dist/shop/policies.js.map +1 -1
  552. package/dist/shop/reviews.d.ts +1 -1
  553. package/dist/shop/reviews.js +2 -2
  554. package/dist/shop/reviews.js.map +1 -1
  555. package/dist/shop/services.d.ts +1 -1
  556. package/dist/shop/services.js +4 -4
  557. package/dist/shop/services.js.map +1 -1
  558. package/dist/shop/social.d.ts +1 -1
  559. package/dist/shop/social.js +2 -2
  560. package/dist/shop/social.js.map +1 -1
  561. package/dist/shop/story.d.ts +1 -1
  562. package/dist/shop/story.js +2 -2
  563. package/dist/shop/story.js.map +1 -1
  564. package/dist/shop/team.d.ts +1 -1
  565. package/dist/shop/team.js +2 -2
  566. package/dist/shop/team.js.map +1 -1
  567. package/dist/shop/video.d.ts +1 -1
  568. package/dist/shop/video.js +2 -2
  569. package/dist/shop/video.js.map +1 -1
  570. package/dist/shop/visit.d.ts +1 -1
  571. package/dist/shop/visit.js +2 -2
  572. package/dist/shop/visit.js.map +1 -1
  573. package/dist/shop-composer.js +2 -2
  574. package/dist/shop-composer.js.map +1 -1
  575. package/dist/shop-gallery.d.ts +1 -1
  576. package/dist/shop-gallery.js +2 -2
  577. package/dist/shop-gallery.js.map +1 -1
  578. package/dist/shop.d.ts +3 -3
  579. package/dist/shop.js +2 -2
  580. package/dist/showcase.d.ts +1 -1
  581. package/dist/showcase.js +6 -6
  582. package/dist/showcase.js.map +1 -1
  583. package/dist/signature.d.ts +1 -1
  584. package/dist/signature.js +2 -2
  585. package/dist/signature.js.map +1 -1
  586. package/dist/site-cahier.d.ts +3 -3
  587. package/dist/site-cahier.js +10 -10
  588. package/dist/site-cahier.js.map +1 -1
  589. package/dist/site-footer.d.ts +4 -4
  590. package/dist/site-footer.js +1 -1
  591. package/dist/site-footer.js.map +1 -1
  592. package/dist/skeleton.d.ts +3 -3
  593. package/dist/skeleton.js.map +1 -1
  594. package/dist/skip-link.d.ts +1 -1
  595. package/dist/skip-link.js +1 -1
  596. package/dist/slider.d.ts +1 -1
  597. package/dist/slider.js +2 -2
  598. package/dist/slider.js.map +1 -1
  599. package/dist/slot-picker.d.ts +1 -1
  600. package/dist/slot-picker.js +1 -1
  601. package/dist/slot-picker.js.map +1 -1
  602. package/dist/specimen-tag.d.ts +2 -2
  603. package/dist/specimen-tag.js +2 -2
  604. package/dist/speed-lines.d.ts +1 -1
  605. package/dist/speed-lines.js +1 -1
  606. package/dist/speed-lines.js.map +1 -1
  607. package/dist/spinner.d.ts +2 -2
  608. package/dist/spinner.js +1 -1
  609. package/dist/spinner.js.map +1 -1
  610. package/dist/split-view.d.ts +1 -1
  611. package/dist/split-view.js.map +1 -1
  612. package/dist/stage-banner.d.ts +1 -1
  613. package/dist/stage-banner.js +1 -1
  614. package/dist/stage-banner.js.map +1 -1
  615. package/dist/stat.d.ts +2 -2
  616. package/dist/stat.js +1 -1
  617. package/dist/status-chip.js +4 -4
  618. package/dist/status-chip.js.map +1 -1
  619. package/dist/status-page.d.ts +1 -1
  620. package/dist/status-page.js.map +1 -1
  621. package/dist/step-progress.d.ts +1 -1
  622. package/dist/step-progress.js.map +1 -1
  623. package/dist/step-showcase.d.ts +2 -2
  624. package/dist/step-showcase.js +3 -3
  625. package/dist/step-showcase.js.map +1 -1
  626. package/dist/stepper.d.ts +1 -1
  627. package/dist/stepper.js +1 -1
  628. package/dist/stepper.js.map +1 -1
  629. package/dist/sticky-action.d.ts +1 -1
  630. package/dist/sticky-action.js.map +1 -1
  631. package/dist/stuck.d.ts +1 -1
  632. package/dist/stuck.js +1 -1
  633. package/dist/stuck.js.map +1 -1
  634. package/dist/swipe-deck.d.ts +2 -2
  635. package/dist/swipe-deck.js.map +1 -1
  636. package/dist/switch.d.ts +1 -1
  637. package/dist/switch.js +1 -1
  638. package/dist/tabs.d.ts +6 -6
  639. package/dist/tabs.js +1 -1
  640. package/dist/tabs.js.map +1 -1
  641. package/dist/tag-input.d.ts +1 -1
  642. package/dist/tag-input.js +4 -4
  643. package/dist/tag-input.js.map +1 -1
  644. package/dist/tag-selector.d.ts +1 -1
  645. package/dist/tag-selector.js +3 -3
  646. package/dist/tag-selector.js.map +1 -1
  647. package/dist/taped-photo.d.ts +1 -1
  648. package/dist/taped-photo.js +2 -2
  649. package/dist/terminal-replay.d.ts +1 -1
  650. package/dist/terminal-replay.js +3 -3
  651. package/dist/terminal-replay.js.map +1 -1
  652. package/dist/text-style/server.d.ts +1 -1
  653. package/dist/text-style/server.js.map +1 -1
  654. package/dist/text-style.d.ts +2 -2
  655. package/dist/text-style.js.map +1 -1
  656. package/dist/theme.d.ts +3 -3
  657. package/dist/theme.js +3 -3
  658. package/dist/theme.js.map +1 -1
  659. package/dist/toast.d.ts +1 -1
  660. package/dist/toast.js +2 -2
  661. package/dist/toast.js.map +1 -1
  662. package/dist/toc.d.ts +2 -2
  663. package/dist/toc.js +1 -1
  664. package/dist/toc.js.map +1 -1
  665. package/dist/tooltip.d.ts +1 -1
  666. package/dist/tooltip.js +2 -2
  667. package/dist/tree-view.d.ts +1 -1
  668. package/dist/tree-view.js +2 -2
  669. package/dist/tree-view.js.map +1 -1
  670. package/dist/update-prompt.d.ts +1 -1
  671. package/dist/update-prompt.js +3 -3
  672. package/dist/update-prompt.js.map +1 -1
  673. package/dist/upload-queue.d.ts +2 -2
  674. package/dist/upload-queue.js +1 -1
  675. package/dist/upload-queue.js.map +1 -1
  676. package/dist/usage.d.ts +4 -4
  677. package/dist/usage.js +3 -3
  678. package/dist/usage.js.map +1 -1
  679. package/dist/verified-badge.d.ts +1 -1
  680. package/dist/verified-badge.js.map +1 -1
  681. package/dist/versus-card.d.ts +1 -1
  682. package/dist/versus-card.js +2 -2
  683. package/dist/versus-card.js.map +1 -1
  684. package/dist/vertical-video.d.ts +2 -2
  685. package/dist/vertical-video.js +6 -6
  686. package/dist/vertical-video.js.map +1 -1
  687. package/dist/video-player.d.ts +1 -1
  688. package/dist/video-player.js +5 -5
  689. package/dist/video-trimmer.d.ts +1 -1
  690. package/dist/video-trimmer.js.map +1 -1
  691. package/dist/virtual.d.ts +2 -2
  692. package/dist/virtual.js +1 -1
  693. package/dist/wall.js +2 -2
  694. package/dist/wall.js.map +1 -1
  695. package/dist/waveform.d.ts +1 -1
  696. package/dist/waveform.js.map +1 -1
  697. package/package.json +7 -7
  698. package/registry/account-settings.json +17 -17
  699. package/registry/achievement.json +1 -1
  700. package/registry/action-bar.json +3 -3
  701. package/registry/activity-feed.json +2 -2
  702. package/registry/alert.json +1 -1
  703. package/registry/analysis-report.json +1 -1
  704. package/registry/anatomy-plate.json +1 -1
  705. package/registry/app-frame.json +6 -6
  706. package/registry/app-header.json +4 -4
  707. package/registry/app-shell.json +2 -2
  708. package/registry/architecture-diagram.json +1 -1
  709. package/registry/argument-card.json +3 -3
  710. package/registry/auth-layout.json +1 -1
  711. package/registry/avatar.json +3 -3
  712. package/registry/badge.json +1 -1
  713. package/registry/bird-plate.json +1 -1
  714. package/registry/button.json +1 -1
  715. package/registry/captcha.json +1 -1
  716. package/registry/card-grid.json +1 -1
  717. package/registry/card.json +1 -1
  718. package/registry/catalogue-page.json +1 -1
  719. package/registry/changelog-page.json +2 -2
  720. package/registry/chapter.json +2 -2
  721. package/registry/chat.json +1 -1
  722. package/registry/checkbox.json +1 -1
  723. package/registry/chip-link.json +1 -1
  724. package/registry/chip-row.json +1 -1
  725. package/registry/chip.json +2 -2
  726. package/registry/choice-grid.json +2 -2
  727. package/registry/cn.json +1 -1
  728. package/registry/code-block.json +2 -2
  729. package/registry/collection-switcher.json +2 -2
  730. package/registry/columns.json +1 -1
  731. package/registry/combobox.json +2 -2
  732. package/registry/command.json +1 -1
  733. package/registry/comparison-table.json +1 -1
  734. package/registry/component-page.json +1 -1
  735. package/registry/confirm-button.json +1 -1
  736. package/registry/contact-page.json +1 -1
  737. package/registry/continue-prompt.json +1 -1
  738. package/registry/copy-button.json +2 -2
  739. package/registry/countdown.json +1 -1
  740. package/registry/cover-hero.json +3 -3
  741. package/registry/cta-panel.json +1 -1
  742. package/registry/dashboard-layout.json +2 -2
  743. package/registry/data-table.json +4 -4
  744. package/registry/date-picker.json +8 -8
  745. package/registry/decision-list.json +2 -2
  746. package/registry/description-list.json +1 -1
  747. package/registry/detail-layout.json +1 -1
  748. package/registry/dialog.json +2 -2
  749. package/registry/docs-article-page.json +1 -1
  750. package/registry/docs-hub-page.json +1 -1
  751. package/registry/docs-layout.json +2 -2
  752. package/registry/docs-nav.json +1 -1
  753. package/registry/document-viewer.json +2 -2
  754. package/registry/doodle.json +1 -1
  755. package/registry/drop-overlay.json +1 -1
  756. package/registry/dropdown-menu.json +1 -1
  757. package/registry/empty-state.json +1 -1
  758. package/registry/engine-flow.json +1 -1
  759. package/registry/entity-header.json +2 -2
  760. package/registry/environment-notice.json +1 -1
  761. package/registry/error-page.json +1 -1
  762. package/registry/field.json +1 -1
  763. package/registry/file-upload.json +2 -2
  764. package/registry/filter-bar.json +4 -4
  765. package/registry/flock.json +1 -1
  766. package/registry/footnote.json +1 -1
  767. package/registry/force-update-screen.json +1 -1
  768. package/registry/form.json +64 -64
  769. package/registry/gallery-page.json +1 -1
  770. package/registry/genui.json +2 -2
  771. package/registry/glow-card.json +1 -1
  772. package/registry/goal-gauge.json +1 -1
  773. package/registry/grade-stamp.json +1 -1
  774. package/registry/identity-card.json +1 -1
  775. package/registry/image-cropper.json +1 -1
  776. package/registry/index.json +8 -8
  777. package/registry/kanban.json +1 -1
  778. package/registry/kbd.json +1 -1
  779. package/registry/kind-config-editor.json +2 -2
  780. package/registry/kpi-explained.json +1 -1
  781. package/registry/landing-page.json +1 -1
  782. package/registry/landscape.json +1 -1
  783. package/registry/language-switch.json +1 -1
  784. package/registry/legal-page.json +1 -1
  785. package/registry/link-card.json +3 -3
  786. package/registry/list.json +2 -2
  787. package/registry/loader.json +1 -1
  788. package/registry/longform-page.json +1 -1
  789. package/registry/maintenance-screen.json +1 -1
  790. package/registry/map.json +7 -7
  791. package/registry/margin-layout.json +1 -1
  792. package/registry/markdown.json +1 -1
  793. package/registry/marketing-layout.json +1 -1
  794. package/registry/mascot-quote.json +1 -1
  795. package/registry/mascot-state.json +2 -2
  796. package/registry/mascots.json +3 -3
  797. package/registry/match-dialog.json +1 -1
  798. package/registry/media-capture.json +2 -2
  799. package/registry/media-gallery.json +4 -4
  800. package/registry/meter.json +1 -1
  801. package/registry/money-input.json +1 -1
  802. package/registry/nav-bar.json +8 -8
  803. package/registry/number-ticker.json +1 -1
  804. package/registry/opening-hours.json +2 -2
  805. package/registry/page-header.json +1 -1
  806. package/registry/page-hero.json +3 -3
  807. package/registry/page-index.json +2 -2
  808. package/registry/page.json +1 -1
  809. package/registry/pagination.json +2 -2
  810. package/registry/pointer-light.json +1 -1
  811. package/registry/popover.json +1 -1
  812. package/registry/price-catalogue-editor.json +1 -1
  813. package/registry/pricing-page.json +2 -2
  814. package/registry/product-page.json +1 -1
  815. package/registry/profile-card.json +3 -3
  816. package/registry/progress.json +1 -1
  817. package/registry/promise-card.json +1 -1
  818. package/registry/qr-code.json +2 -2
  819. package/registry/quota-meter.json +1 -1
  820. package/registry/radio-group.json +14 -14
  821. package/registry/rail-nav.json +8 -8
  822. package/registry/recipes.json +1 -1
  823. package/registry/retro-tv.json +3 -3
  824. package/registry/schema-form.json +1 -1
  825. package/registry/scroll-stage.json +1 -1
  826. package/registry/search-field.json +2 -2
  827. package/registry/section-backdrop.json +1 -1
  828. package/registry/separator.json +1 -1
  829. package/registry/service-card.json +3 -3
  830. package/registry/settings-layout.json +1 -1
  831. package/registry/shop-composer.json +3 -3
  832. package/registry/shop-gallery.json +1 -1
  833. package/registry/shop.json +17 -17
  834. package/registry/showcase.json +1 -1
  835. package/registry/signature.json +1 -1
  836. package/registry/site-cahier.json +2 -2
  837. package/registry/site-footer.json +10 -10
  838. package/registry/skeleton.json +1 -1
  839. package/registry/skip-link.json +1 -1
  840. package/registry/slider.json +1 -1
  841. package/registry/slot-picker.json +2 -2
  842. package/registry/specimen-tag.json +1 -1
  843. package/registry/speed-lines.json +1 -1
  844. package/registry/spinner.json +2 -2
  845. package/registry/split-view.json +1 -1
  846. package/registry/stage-banner.json +1 -1
  847. package/registry/stat.json +1 -1
  848. package/registry/status-chip.json +2 -2
  849. package/registry/status-page.json +1 -1
  850. package/registry/step-progress.json +1 -1
  851. package/registry/step-showcase.json +2 -2
  852. package/registry/stepper.json +1 -1
  853. package/registry/sticky-action.json +1 -1
  854. package/registry/stuck.json +1 -1
  855. package/registry/swipe-deck.json +1 -1
  856. package/registry/switch.json +1 -1
  857. package/registry/tabs.json +1 -1
  858. package/registry/tag-input.json +1 -1
  859. package/registry/tag-selector.json +1 -1
  860. package/registry/taped-photo.json +1 -1
  861. package/registry/terminal-replay.json +2 -2
  862. package/registry/text-style.json +8 -8
  863. package/registry/theme.json +1 -1
  864. package/registry/toast.json +1 -1
  865. package/registry/toc.json +1 -1
  866. package/registry/tooltip.json +1 -1
  867. package/registry/tree-view.json +2 -2
  868. package/registry/update-prompt.json +1 -1
  869. package/registry/upload-queue.json +1 -1
  870. package/registry/usage.json +2 -2
  871. package/registry/verified-badge.json +1 -1
  872. package/registry/versus-card.json +1 -1
  873. package/registry/vertical-video.json +2 -2
  874. package/registry/video-player.json +2 -2
  875. package/registry/video-trimmer.json +1 -1
  876. package/registry/virtual.json +3 -3
  877. package/registry/wall.json +1 -1
  878. package/registry/waveform.json +1 -1
  879. package/dist/chunk-2FCQCWIK.js.map +0 -1
  880. package/dist/chunk-43PTCDTL.js.map +0 -1
  881. package/dist/chunk-5D7NMUF6.js.map +0 -1
  882. package/dist/chunk-5PFCELGW.js.map +0 -1
  883. package/dist/chunk-5RWHDX5J.js.map +0 -1
  884. package/dist/chunk-5VZ37TY3.js.map +0 -1
  885. package/dist/chunk-757ZTGU5.js.map +0 -1
  886. package/dist/chunk-7DYZTEE3.js.map +0 -1
  887. package/dist/chunk-7P7I5OQV.js.map +0 -1
  888. package/dist/chunk-B47WSPMP.js.map +0 -1
  889. package/dist/chunk-C57KK5VB.js.map +0 -1
  890. package/dist/chunk-EB45EVPJ.js.map +0 -1
  891. package/dist/chunk-EDQLPCM4.js.map +0 -1
  892. package/dist/chunk-GHAN7OOE.js.map +0 -1
  893. package/dist/chunk-HLEBSAGC.js.map +0 -1
  894. package/dist/chunk-HP7BDMVK.js.map +0 -1
  895. package/dist/chunk-KH3JOEPY.js.map +0 -1
  896. package/dist/chunk-KR2W4ONJ.js.map +0 -1
  897. package/dist/chunk-LH5J3VLZ.js.map +0 -1
  898. package/dist/chunk-LNAAWT4Y.js.map +0 -1
  899. package/dist/chunk-MDSP7DJR.js.map +0 -1
  900. package/dist/chunk-NG6G6V5E.js.map +0 -1
  901. package/dist/chunk-NM2DEHFZ.js.map +0 -1
  902. package/dist/chunk-NPMGYLJV.js.map +0 -1
  903. package/dist/chunk-NQENOT6L.js.map +0 -1
  904. package/dist/chunk-NSLXEDIS.js.map +0 -1
  905. package/dist/chunk-OGWB76BR.js.map +0 -1
  906. package/dist/chunk-P7AFIKWG.js.map +0 -1
  907. package/dist/chunk-PGBF3UBX.js.map +0 -1
  908. package/dist/chunk-QA3WETWT.js.map +0 -1
  909. package/dist/chunk-QD6SNXF5.js.map +0 -1
  910. package/dist/chunk-QHVV2JGF.js.map +0 -1
  911. package/dist/chunk-QVHSV6RA.js.map +0 -1
  912. package/dist/chunk-S2O4NSN5.js.map +0 -1
  913. package/dist/chunk-S4TLZRGZ.js.map +0 -1
  914. package/dist/chunk-S6NYGOJT.js.map +0 -1
  915. package/dist/chunk-SB5WSVPI.js.map +0 -1
  916. package/dist/chunk-SG2RKUVJ.js.map +0 -1
  917. package/dist/chunk-V5RO6JYI.js.map +0 -1
  918. package/dist/chunk-V7W4RLRW.js.map +0 -1
  919. package/dist/chunk-VA4NPCUQ.js.map +0 -1
  920. package/dist/chunk-VPO27AFS.js.map +0 -1
  921. package/dist/chunk-W64RAX4N.js.map +0 -1
  922. package/dist/chunk-W675RFOA.js.map +0 -1
  923. package/dist/chunk-WC3SO4CE.js.map +0 -1
  924. package/dist/chunk-WEVYKZIF.js.map +0 -1
  925. package/dist/chunk-WU4VLSEA.js.map +0 -1
  926. package/dist/chunk-Y3P5B4XS.js.map +0 -1
  927. package/dist/chunk-YTYNKMNS.js.map +0 -1
  928. package/dist/chunk-Z47KIPCT.js.map +0 -1
  929. package/dist/chunk-ZPOVOEO3.js.map +0 -1
  930. package/dist/player-lightbox-BYQ57OXT.js.map +0 -1
  931. /package/dist/{chunk-HJFRHYCI.js.map → chunk-DTGRZXYO.js.map} +0 -0
  932. /package/dist/{chunk-PJNR4NTS.js.map → chunk-HC2TY45B.js.map} +0 -0
  933. /package/dist/{lightbox-MRB2YZEP.js.map → lightbox-JLWASIJC.js.map} +0 -0
@@ -390,7 +390,7 @@
390
390
  },
391
391
  {
392
392
  "path": "tabs/tabs.tsx",
393
- "content": "// Client (a context). Radix Tabs does the roles (tablist, tab, tabpanel), the aria-selected / aria-controls wiring,\n// the roving focus (arrows, Home, End) and automatic activation: this file only holds the three looks.\nimport { Slot, Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { useRouteBinding } from \"../router\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\n\nexport const tabs = tv({\n slots: {\n root: \"flex gap-4 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:flex-row\",\n // One light glides from the active tab to the next (`before:`, placed by useSlidingIndicator); until it is placed\n // (server render), each trigger carries its own active style.\n list:\n \"group/tabs relative isolate flex shrink-0 data-[orientation=vertical]:flex-col \" +\n \"before:pointer-events-none before:absolute before:-z-10 before:opacity-0 before:transition-[translate,width,height,opacity] before:duration-300 \" +\n \"motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n trigger:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40\",\n content: \"kz-tabs-panel min-w-0 flex-1 rounded-lg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring data-[state=inactive]:hidden\",\n },\n variants: {\n variant: {\n /* The section of a page: a line under the list, the active tab underlined in the accent. */\n underline: {\n list:\n \"gap-1 border-border-default data-[orientation=horizontal]:border-b data-[orientation=vertical]:border-r before:rounded-sm before:bg-accent \" +\n \"data-[orientation=horizontal]:before:-bottom-px data-[orientation=horizontal]:before:left-0 data-[orientation=horizontal]:before:h-0.5 \" +\n \"data-[orientation=horizontal]:before:w-(--kz-ind-w) data-[orientation=horizontal]:before:translate-x-(--kz-ind-x) \" +\n \"data-[orientation=vertical]:before:-right-px data-[orientation=vertical]:before:top-0 data-[orientation=vertical]:before:w-0.5 \" +\n \"data-[orientation=vertical]:before:h-(--kz-ind-h) data-[orientation=vertical]:before:translate-y-(--kz-ind-y)\",\n trigger:\n \"relative rounded-md px-3 py-2.5 text-sm text-fg-secondary hover:text-fg data-[state=active]:text-fg \" +\n \"after:absolute after:rounded-sm after:bg-transparent data-[state=active]:after:bg-accent \" +\n \"data-[orientation=horizontal]:after:inset-x-2 data-[orientation=horizontal]:after:-bottom-px data-[orientation=horizontal]:after:h-0.5 \" +\n \"data-[orientation=vertical]:justify-start data-[orientation=vertical]:after:inset-y-1.5 data-[orientation=vertical]:after:-right-px data-[orientation=vertical]:after:w-0.5 \" +\n \"group-data-[indicator=on]/tabs:data-[state=active]:after:bg-transparent\",\n },\n /* A view switch: equal segments in a track, the active one filled. */\n segmented: {\n list:\n \"inline-grid auto-cols-fr grid-flow-col gap-1 self-start rounded-xl border border-border-default bg-surface-1 p-1 data-[orientation=vertical]:grid-flow-row \" +\n \"before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:bg-accent before:shadow-sm\",\n trigger:\n \"min-h-8 rounded-lg px-3 py-1.5 text-xs text-fg-secondary hover:bg-surface-2 hover:text-fg \" +\n \"data-[state=active]:bg-accent data-[state=active]:text-on-accent data-[state=active]:shadow-sm data-[state=active]:hover:bg-accent \" +\n \"transition-colors group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent group-data-[indicator=on]/tabs:data-[state=active]:shadow-none\",\n },\n /* Pills that scroll sideways on a phone: a feed's sections. */\n pills: {\n list:\n \"gap-1.5 overflow-x-auto overflow-y-hidden overscroll-x-contain pt-1 -mt-1 pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden \" +\n \"before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) \" +\n \"before:rounded-sm before:border before:border-accent before:bg-accent-soft\",\n trigger:\n \"h-9 rounded-sm border border-border-default bg-surface-1 px-4 text-xs text-fg-secondary hover:border-border-strong hover:text-fg \" +\n \"data-[state=active]:border-accent data-[state=active]:bg-accent-soft data-[state=active]:text-fg \" +\n \"group-data-[indicator=on]/tabs:data-[state=active]:border-transparent group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent\",\n },\n /*\n * Binder dividers (intercalaires, #648): organise collections, tags and statuses. Each tab is a divider with a\n * coloured top edge (`hue`), its words and a count; the active one is the page's colour and joins the content\n * under the list's line. Too many dividers scroll sideways, the edges fading. No paper texture: organisation only.\n */\n binder: {\n list:\n \"items-end gap-1 overflow-x-auto overflow-y-hidden overscroll-x-contain border-b border-border-default px-3 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden \" +\n \"[mask-image:linear-gradient(to_right,transparent,black_12px,black_calc(100%-12px),transparent)]\",\n trigger:\n \"relative -mb-px min-h-10 rounded-t-lg border border-b-0 border-border-default bg-surface-2 px-3.5 pb-2 pt-2.5 text-sm text-fg-secondary \" +\n \"before:absolute before:inset-x-0 before:-top-px before:h-1 before:rounded-t-lg before:bg-(--kz-hue,var(--kz-accent)) \" +\n \"hover:bg-surface-3 hover:text-fg data-[state=active]:z-[1] data-[state=active]:bg-surface-1 data-[state=active]:pb-2.5 data-[state=active]:text-fg \" +\n \"data-[state=active]:shadow-[0_1px_0_0_var(--kz-surface-1)] motion-reduce:transition-none\",\n },\n },\n },\n defaultVariants: { variant: \"underline\" },\n});\n\n/**\n * A divider's colour (`variant=\"binder\"`): the brand's accent by default, or a role of the theme — every one reads at 3:1 or\n * more on both themes. The colour is never the only signal: the words and the count say it.\n */\nexport type TabsHue = \"accent\" | \"success\" | \"warning\" | \"danger\" | \"neutral\";\n// The text roles where the fill role is too light on a light page (success, warning: 2:1): every edge reaches 3:1, tested.\nconst HUE: Record<TabsHue, string> = {\n accent: \"var(--kz-accent)\",\n success: \"var(--kz-success-text)\",\n warning: \"var(--kz-warning-text)\",\n danger: \"var(--kz-danger-text)\",\n neutral: \"var(--kz-text-muted)\",\n};\n/** The style that paints a divider's edge (`--kz-hue`), merged with the host's. */\nconst hueStyle = (hue: TabsHue | undefined, style: React.CSSProperties | undefined) =>\n hue ? { ...style, [\"--kz-hue\" as string]: HUE[hue] } : style;\n\n/** The count after a tab's words: part of its name (« Clients 12 »), muted, tabular. */\nfunction TabCount({ count }: Readonly<{ count: number | undefined }>) {\n if (count === undefined) return null;\n return <span data-tab-count=\"\" className=\"font-mono text-xs font-medium tabular-nums text-fg-secondary\">{count}</span>;\n}\n\n/** « + Intercalaire »: a button after the dividers (outside the tab list: a tablist holds only tabs). */\nfunction AddButton({ add }: Readonly<{ add: TabsAdd }>) {\n return (\n <button\n type=\"button\"\n onClick={add.onAdd}\n className=\"mb-1 ml-1 inline-flex min-h-9 shrink-0 items-center gap-1.5 rounded-lg px-2.5 text-sm font-medium text-fg-secondary hover:bg-surface-2 hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden focusable=\"false\">\n <path d=\"M12 5v14M5 12h14\" />\n </svg>\n {add.label}\n </button>\n );\n}\n\nexport type TabsAdd = {\n /** Its words (« Intercalaire », « New tag ») — passed translated. */\n label: string;\n /** Adds a divider (opens the host's form). */\n onAdd: () => void;\n};\n\nexport type TabsVariants = VariantProps<typeof tabs>;\ntype Variant = NonNullable<TabsVariants[\"variant\"]>;\n\nconst VariantContext = React.createContext<Variant>(\"underline\");\n\nexport type TabsRootProps = React.ComponentProps<typeof TabsPrimitive.Root> & {\n /** underline (the sections of a page) · segmented (a view switch) · pills (a feed's sections) · binder (dividers that organise collections, tags, statuses). */\n variant?: TabsVariants[\"variant\"];\n /** Binds the active tab to this search parameter of the URL (`?tab=…`): the URL is the state. Without it the state is local — only for an ephemeral choice. */\n routeKey?: string;\n /** The values the parameter may hold (the tabs' `value`s); the first is the default unless `defaultValue` says otherwise. */\n routeValues?: readonly string[];\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation` (horizontal by default), `variant` for the list. */\nexport function TabsRoot({ variant = \"underline\", className, routeKey, routeValues, ...rest }: TabsRootProps) {\n const props = useRouteBinding(routeKey, routeValues, rest);\n return (\n <VariantContext.Provider value={variant}>\n <TabsPrimitive.Root data-variant={variant} className={tabs({ variant }).root({ className })} {...props} />\n </VariantContext.Provider>\n );\n}\n\nexport type TabsListProps = React.ComponentProps<typeof TabsPrimitive.List> & {\n /** A « + » button after the tabs (`variant=\"binder\"`: « + Intercalaire »): its words and what it does. */\n add?: TabsAdd;\n};\n\n/** The tabs. Name it (`aria-label`) when no heading says what it switches. One light glides to the active tab. */\nexport function TabsList({ className, add, ...props }: TabsListProps) {\n const variant = React.useContext(VariantContext);\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=tab]\", active: \"[role=tab][data-state=active]\" });\n const list = <TabsPrimitive.List ref={ref} data-variant={variant} className={tabs({ variant }).list({ className: cn(add && \"min-w-0 flex-1 border-b-0\", className) })} {...props} />;\n if (!add) return list;\n return (\n <div data-tabs-row=\"\" className={cn(\"flex min-w-0 items-end\", variant === \"binder\" && \"border-b border-border-default\")}>\n {list}\n <AddButton add={add} />\n </div>\n );\n}\n\nexport type TabsTriggerProps = React.ComponentProps<typeof TabsPrimitive.Trigger> & {\n /** A count after the words (clients in a collection, unread): part of the tab's name. */\n count?: number;\n /** `variant=\"binder\"`: the divider's colour (the accent by default). */\n hue?: TabsHue;\n};\n\nexport function TabsTrigger({ className, count, hue, style, children, ...props }: TabsTriggerProps) {\n const variant = React.useContext(VariantContext);\n return (\n <TabsPrimitive.Trigger className={tabs({ variant }).trigger({ className })} style={hueStyle(hue, style)} data-hue={hue} {...props}>\n {children}\n <TabCount count={count} />\n </TabsPrimitive.Trigger>\n );\n}\n\nexport function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return <TabsPrimitive.Content className={tabs().content({ className })} {...props} />;\n}\n\n// ── Route mode: tabs that are links; the URL is the state (Oussama, 2026-10-22) ──────────────────────────────────────\n\n/**\n * Is the link `href` the tab of the route `current` (a path, with its search: `/docs/api?tab=x`)? The path must equal the\n * link's (a trailing slash, a locale-free comparison and the hash do not count); with `exact` false (the default) a deeper\n * path of the same section counts too (`/docs/api/x` is in `/docs/api`); every search parameter of the link must be in\n * `current`. The hub link (`/`) is only ever active on `/` itself.\n */\nexport function isTabActive(current: string, href: string, exact = false): boolean {\n const split = (value: string) => {\n const url = new URL(value.split(\"#\")[0]!, \"https://tabs.invalid\");\n return { path: url.pathname.replace(/\\/+$/, \"\") || \"/\", search: url.searchParams };\n };\n const here = split(current);\n const target = split(href);\n const samePath = here.path === target.path;\n const deeper = !exact && target.path !== \"/\" && here.path.startsWith(`${target.path}/`);\n if (!samePath && !deeper) return false;\n for (const [key, value] of target.search) if (here.search.get(key) !== value) return false;\n return true;\n}\n\ninterface NavState {\n current: string;\n variant: Variant;\n}\nconst NavContext = React.createContext<NavState | null>(null);\n\nexport type TabsNavProps = Omit<React.ComponentProps<\"nav\">, \"children\"> & {\n /** A « + » button after the tabs (`variant=\"binder\"`: « + Intercalaire »). */\n add?: TabsAdd;\n /** The navigation's accessible name (« Sections »). */\n label: string;\n /** The current route, passed in: the path with its search (`usePathname()` + `useSearchParams()`, `/docs?tab=api`). The active tab comes from it; no local state. */\n current: string;\n /** underline (the sections of a page) · segmented (a view switch) · pills (a feed's sections) · binder (dividers). */\n variant?: TabsVariants[\"variant\"];\n /** The tabs: `Tabs.NavLink`. */\n children: React.ReactNode;\n};\n\n/**\n * Tabs as routes: a `nav` of links, the URL is the state. Per WAI-ARIA these are links, not a tablist: each tab is an\n * anchor, the active one carries `aria-current=\"page\"`, the keyboard is the page's own (Tab walks the links, Enter\n * follows one) and there is no panel — the page is the panel. The same looks and the same gliding light as `Tabs.List`.\n */\nexport function TabsNav({ label, current, variant = \"underline\", add, className, children, ...props }: TabsNavProps) {\n const { ref } = useSlidingIndicator<HTMLElement>({ item: \"[data-tabs-link]\", active: \"[data-tabs-link][data-state=active]\" });\n const value = React.useMemo(() => ({ current, variant }), [current, variant]);\n const nav = (\n <nav ref={ref} aria-label={label} data-variant={variant} data-orientation=\"horizontal\" className={tabs({ variant }).list({ className: cn(add && \"min-w-0 flex-1 border-b-0\", className) })} {...props}>\n {children}\n </nav>\n );\n return (\n <NavContext.Provider value={value}>\n {add ? (\n <div data-tabs-row=\"\" className={cn(\"flex min-w-0 items-end\", variant === \"binder\" && \"border-b border-border-default\")}>\n {nav}\n <AddButton add={add} />\n </div>\n ) : (\n nav\n )}\n </NavContext.Provider>\n );\n}\n\nexport type TabsNavLinkProps = React.ComponentProps<\"a\"> & {\n /** Where the tab goes (`/docs/api`, `/docs?tab=api`). */\n href: string;\n /** Match this path only, not the pages below it. */\n exact?: boolean;\n /** Renders your router's `<Link>` (pass it as the only child; the `href` goes on this part and on the link). */\n asChild?: boolean;\n /** A count after the words (not with `asChild`: put it in your link). */\n count?: number;\n /** `variant=\"binder\"`: the divider's colour (the accent by default). */\n hue?: TabsHue;\n};\n\n/** One tab of `Tabs.Nav`: an anchor that is active when the current route is its `href`. */\nexport function TabsNavLink({ href, exact, asChild, count, hue, style, className, children, ...props }: TabsNavLinkProps) {\n const ctx = React.useContext(NavContext);\n if (!ctx) throw new Error(\"Tabs.NavLink must be inside <Tabs.Nav>\");\n const active = isTabActive(ctx.current, href, exact);\n const Comp = asChild ? Slot.Root : \"a\";\n return (\n <Comp\n data-tabs-link=\"\"\n data-state={active ? \"active\" : \"inactive\"}\n data-orientation=\"horizontal\"\n aria-current={active ? \"page\" : undefined}\n {...(asChild ? {} : { href })}\n data-hue={hue}\n style={hueStyle(hue, style)}\n className={cn(tabs({ variant: ctx.variant }).trigger(), \"no-underline\", className)}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n <TabCount count={count} />\n </>\n )}\n </Comp>\n );\n}\n\n/** `Tabs.Root/List/Trigger/Content` — `variant` underline · segmented · pills · binder on the root. `Tabs.Nav` + `Tabs.NavLink`: the same tabs as routes. */\nexport const Tabs = { Root: TabsRoot, List: TabsList, Trigger: TabsTrigger, Content: TabsContent, Nav: TabsNav, NavLink: TabsNavLink };\n"
393
+ "content": "// Client (a context). Radix Tabs does the roles (tablist, tab, tabpanel), the aria-selected / aria-controls wiring,\n// the roving focus (arrows, Home, End) and automatic activation: this file only holds the three looks.\nimport { Slot, Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { useRouteBinding } from \"../router\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\n\nexport const tabs = tv({\n slots: {\n root: \"flex gap-4 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:flex-row\",\n // One light glides from the active tab to the next (`before:`, placed by useSlidingIndicator); until it is placed\n // (server render), each trigger carries its own active style.\n list:\n \"group/tabs relative isolate flex shrink-0 data-[orientation=vertical]:flex-col \" +\n \"before:pointer-events-none before:absolute before:-z-10 before:opacity-0 before:transition-[translate,width,height,opacity] before:duration-300 \" +\n \"motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n trigger:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40\",\n content: \"kz-tabs-panel min-w-0 flex-1 rounded-lg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring data-[state=inactive]:hidden\",\n },\n variants: {\n variant: {\n /* The section of a page: a line under the list, the active tab underlined in the accent. */\n underline: {\n list:\n \"gap-1 border-border-default data-[orientation=horizontal]:border-b data-[orientation=vertical]:border-r before:rounded-sm before:bg-accent \" +\n \"data-[orientation=horizontal]:before:-bottom-px data-[orientation=horizontal]:before:left-0 data-[orientation=horizontal]:before:h-0.5 \" +\n \"data-[orientation=horizontal]:before:w-(--kz-ind-w) data-[orientation=horizontal]:before:translate-x-(--kz-ind-x) \" +\n \"data-[orientation=vertical]:before:-right-px data-[orientation=vertical]:before:top-0 data-[orientation=vertical]:before:w-0.5 \" +\n \"data-[orientation=vertical]:before:h-(--kz-ind-h) data-[orientation=vertical]:before:translate-y-(--kz-ind-y)\",\n trigger:\n \"relative rounded-md px-3 py-2.5 text-sm text-fg-secondary hover:text-fg data-[state=active]:text-fg \" +\n \"after:absolute after:rounded-sm after:bg-transparent data-[state=active]:after:bg-accent \" +\n \"data-[orientation=horizontal]:after:inset-x-2 data-[orientation=horizontal]:after:-bottom-px data-[orientation=horizontal]:after:h-0.5 \" +\n \"data-[orientation=vertical]:justify-start data-[orientation=vertical]:after:inset-y-1.5 data-[orientation=vertical]:after:-right-px data-[orientation=vertical]:after:w-0.5 \" +\n \"group-data-[indicator=on]/tabs:data-[state=active]:after:bg-transparent\",\n },\n /* A view switch: equal segments in a track, the active one filled. */\n segmented: {\n list:\n \"inline-grid auto-cols-fr grid-flow-col gap-1 self-start rounded-xl border border-border-default bg-surface-1 p-1 data-[orientation=vertical]:grid-flow-row \" +\n \"before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:bg-accent before:shadow-sm\",\n trigger:\n \"min-h-8 rounded-lg px-3 py-1.5 text-xs text-fg-secondary hover:bg-surface-2 hover:text-fg \" +\n \"data-[state=active]:bg-accent data-[state=active]:text-on-accent data-[state=active]:shadow-sm data-[state=active]:hover:bg-accent \" +\n \"transition-colors group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent group-data-[indicator=on]/tabs:data-[state=active]:shadow-none\",\n },\n /* Pills that scroll sideways on a phone: a feed's sections. */\n pills: {\n list:\n \"gap-1.5 overflow-x-auto overflow-y-hidden overscroll-x-contain pt-1 -mt-1 pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden \" +\n \"before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) \" +\n \"before:rounded-sm before:border before:border-accent before:bg-accent-soft\",\n trigger:\n \"h-9 rounded-sm border border-border-default bg-surface-1 px-4 text-xs text-fg-secondary hover:border-border-strong hover:text-fg \" +\n \"data-[state=active]:border-accent data-[state=active]:bg-accent-soft data-[state=active]:text-fg \" +\n \"group-data-[indicator=on]/tabs:data-[state=active]:border-transparent group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent\",\n },\n /*\n * Binder dividers (intercalaires, #648): organise collections, tags and statuses. Each tab is a divider with a\n * coloured top edge (`hue`), its words and a count; the active one is the page's colour and joins the content\n * under the list's line. Too many dividers scroll sideways, the edges fading. No paper texture: organisation only.\n */\n binder: {\n list:\n \"items-end gap-1 overflow-x-auto overflow-y-hidden overscroll-x-contain border-b border-border-default px-3 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden \" +\n \"[mask-image:linear-gradient(to_right,transparent,black_12px,black_calc(100%-12px),transparent)]\",\n trigger:\n \"relative -mb-px min-h-10 rounded-t-lg border border-b-0 border-border-default bg-surface-2 px-3.5 pb-2 pt-2.5 text-sm text-fg-secondary \" +\n \"before:absolute before:inset-x-0 before:-top-px before:h-1 before:rounded-t-lg before:bg-(--kz-hue,var(--kz-accent)) \" +\n \"hover:bg-surface-3 hover:text-fg data-[state=active]:z-[1] data-[state=active]:bg-surface-1 data-[state=active]:pb-2.5 data-[state=active]:text-fg \" +\n \"data-[state=active]:shadow-[0_1px_0_0_var(--kz-surface-1)] motion-reduce:transition-none\",\n },\n },\n },\n defaultVariants: { variant: \"underline\" },\n});\n\n/**\n * A divider's colour (`variant=\"binder\"`): the brand's accent by default, or a role of the theme — every one reads at 3:1 or\n * more on both themes. The colour is never the only signal: the words and the count say it.\n */\nexport type TabsHue = \"accent\" | \"success\" | \"warning\" | \"danger\" | \"neutral\";\n// The text roles where the fill role is too light on a light page (success, warning: 2:1): every edge reaches 3:1, tested.\nconst HUE: Record<TabsHue, string> = {\n accent: \"var(--kz-accent)\",\n success: \"var(--kz-success-text)\",\n warning: \"var(--kz-warning-text)\",\n danger: \"var(--kz-danger-text)\",\n neutral: \"var(--kz-text-muted)\",\n};\n/** The style that paints a divider's edge (`--kz-hue`), merged with the host's. */\nconst hueStyle = (hue: TabsHue | undefined, style: React.CSSProperties | undefined) =>\n hue ? { ...style, [\"--kz-hue\" as string]: HUE[hue] } : style;\n\n/** The count after a tab's words: part of its name (« Clients 12 »), muted, tabular. */\nfunction TabCount({ count }: Readonly<{ count: number | undefined }>) {\n if (count === undefined) return null;\n return <span data-tab-count=\"\" className=\"font-mono text-xs font-medium tabular-nums text-fg-secondary\">{count}</span>;\n}\n\n/** « + Intercalaire »: a button after the dividers (outside the tab list: a tablist holds only tabs). */\nfunction AddButton({ add }: Readonly<{ add: TabsAdd }>) {\n return (\n <button\n type=\"button\"\n onClick={add.onAdd}\n className=\"mb-1 ml-1 inline-flex min-h-9 shrink-0 items-center gap-1.5 rounded-lg px-2.5 text-sm font-medium text-fg-secondary hover:bg-surface-2 hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden focusable=\"false\">\n <path d=\"M12 5v14M5 12h14\" />\n </svg>\n {add.label}\n </button>\n );\n}\n\nexport type TabsAdd = {\n /** Its words (« Intercalaire », « New tag ») — passed translated. */\n label: string;\n /** Adds a divider (opens the host's form). */\n onAdd: () => void;\n};\n\nexport type TabsVariants = VariantProps<typeof tabs>;\ntype Variant = NonNullable<TabsVariants[\"variant\"]>;\n\nconst VariantContext = React.createContext<Variant>(\"underline\");\n\nexport type TabsRootProps = React.ComponentProps<typeof TabsPrimitive.Root> & {\n /** underline (the sections of a page) · segmented (a view switch) · pills (a feed's sections) · binder (dividers that organise collections, tags, statuses). */\n variant?: TabsVariants[\"variant\"];\n /** Binds the active tab to this search parameter of the URL (`?tab=…`): the URL is the state. Without it the state is local — only for an ephemeral choice. */\n routeKey?: string;\n /** The values the parameter may hold (the tabs' `value`s); the first is the default unless `defaultValue` says otherwise. */\n routeValues?: readonly string[];\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation` (horizontal by default), `variant` for the list. */\nexport function TabsRoot({ variant = \"underline\", className, routeKey, routeValues, ...rest }: Readonly<TabsRootProps>) {\n const props = useRouteBinding(routeKey, routeValues, rest);\n return (\n <VariantContext.Provider value={variant}>\n <TabsPrimitive.Root data-variant={variant} className={tabs({ variant }).root({ className })} {...props} />\n </VariantContext.Provider>\n );\n}\n\nexport type TabsListProps = React.ComponentProps<typeof TabsPrimitive.List> & {\n /** A « + » button after the tabs (`variant=\"binder\"`: « + Intercalaire »): its words and what it does. */\n add?: TabsAdd;\n};\n\n/** The tabs. Name it (`aria-label`) when no heading says what it switches. One light glides to the active tab. */\nexport function TabsList({ className, add, ...props }: Readonly<TabsListProps>) {\n const variant = React.useContext(VariantContext);\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=tab]\", active: \"[role=tab][data-state=active]\" });\n const list = <TabsPrimitive.List ref={ref} data-variant={variant} className={tabs({ variant }).list({ className: cn(add && \"min-w-0 flex-1 border-b-0\", className) })} {...props} />;\n if (!add) return list;\n return (\n <div data-tabs-row=\"\" className={cn(\"flex min-w-0 items-end\", variant === \"binder\" && \"border-b border-border-default\")}>\n {list}\n <AddButton add={add} />\n </div>\n );\n}\n\nexport type TabsTriggerProps = React.ComponentProps<typeof TabsPrimitive.Trigger> & {\n /** A count after the words (clients in a collection, unread): part of the tab's name. */\n count?: number;\n /** `variant=\"binder\"`: the divider's colour (the accent by default). */\n hue?: TabsHue;\n};\n\nexport function TabsTrigger({ className, count, hue, style, children, ...props }: Readonly<TabsTriggerProps>) {\n const variant = React.useContext(VariantContext);\n return (\n <TabsPrimitive.Trigger className={tabs({ variant }).trigger({ className })} style={hueStyle(hue, style)} data-hue={hue} {...props}>\n {children}\n <TabCount count={count} />\n </TabsPrimitive.Trigger>\n );\n}\n\nexport function TabsContent({ className, ...props }: Readonly<React.ComponentProps<typeof TabsPrimitive.Content>>) {\n return <TabsPrimitive.Content className={tabs().content({ className })} {...props} />;\n}\n\n// ── Route mode: tabs that are links; the URL is the state (Oussama, 2026-10-22) ──────────────────────────────────────\n\n/**\n * Is the link `href` the tab of the route `current` (a path, with its search: `/docs/api?tab=x`)? The path must equal the\n * link's (a trailing slash, a locale-free comparison and the hash do not count); with `exact` false (the default) a deeper\n * path of the same section counts too (`/docs/api/x` is in `/docs/api`); every search parameter of the link must be in\n * `current`. The hub link (`/`) is only ever active on `/` itself.\n */\nexport function isTabActive(current: string, href: string, exact = false): boolean {\n const split = (value: string) => {\n const url = new URL(value.split(\"#\")[0]!, \"https://tabs.invalid\");\n return { path: url.pathname.replace(/\\/+$/, \"\") || \"/\", search: url.searchParams };\n };\n const here = split(current);\n const target = split(href);\n const samePath = here.path === target.path;\n const deeper = !exact && target.path !== \"/\" && here.path.startsWith(`${target.path}/`);\n if (!samePath && !deeper) return false;\n for (const [key, value] of target.search) if (here.search.get(key) !== value) return false;\n return true;\n}\n\ninterface NavState {\n current: string;\n variant: Variant;\n}\nconst NavContext = React.createContext<NavState | null>(null);\n\nexport type TabsNavProps = Omit<React.ComponentProps<\"nav\">, \"children\"> & {\n /** A « + » button after the tabs (`variant=\"binder\"`: « + Intercalaire »). */\n add?: TabsAdd;\n /** The navigation's accessible name (« Sections »). */\n label: string;\n /** The current route, passed in: the path with its search (`usePathname()` + `useSearchParams()`, `/docs?tab=api`). The active tab comes from it; no local state. */\n current: string;\n /** underline (the sections of a page) · segmented (a view switch) · pills (a feed's sections) · binder (dividers). */\n variant?: TabsVariants[\"variant\"];\n /** The tabs: `Tabs.NavLink`. */\n children: React.ReactNode;\n};\n\n/**\n * Tabs as routes: a `nav` of links, the URL is the state. Per WAI-ARIA these are links, not a tablist: each tab is an\n * anchor, the active one carries `aria-current=\"page\"`, the keyboard is the page's own (Tab walks the links, Enter\n * follows one) and there is no panel — the page is the panel. The same looks and the same gliding light as `Tabs.List`.\n */\nexport function TabsNav({ label, current, variant = \"underline\", add, className, children, ...props }: Readonly<TabsNavProps>) {\n const { ref } = useSlidingIndicator<HTMLElement>({ item: \"[data-tabs-link]\", active: \"[data-tabs-link][data-state=active]\" });\n const value = React.useMemo(() => ({ current, variant }), [current, variant]);\n const nav = (\n <nav ref={ref} aria-label={label} data-variant={variant} data-orientation=\"horizontal\" className={tabs({ variant }).list({ className: cn(add && \"min-w-0 flex-1 border-b-0\", className) })} {...props}>\n {children}\n </nav>\n );\n return (\n <NavContext.Provider value={value}>\n {add ? (\n <div data-tabs-row=\"\" className={cn(\"flex min-w-0 items-end\", variant === \"binder\" && \"border-b border-border-default\")}>\n {nav}\n <AddButton add={add} />\n </div>\n ) : (\n nav\n )}\n </NavContext.Provider>\n );\n}\n\nexport type TabsNavLinkProps = React.ComponentProps<\"a\"> & {\n /** Where the tab goes (`/docs/api`, `/docs?tab=api`). */\n href: string;\n /** Match this path only, not the pages below it. */\n exact?: boolean;\n /** Renders your router's `<Link>` (pass it as the only child; the `href` goes on this part and on the link). */\n asChild?: boolean;\n /** A count after the words (not with `asChild`: put it in your link). */\n count?: number;\n /** `variant=\"binder\"`: the divider's colour (the accent by default). */\n hue?: TabsHue;\n};\n\n/** One tab of `Tabs.Nav`: an anchor that is active when the current route is its `href`. */\nexport function TabsNavLink({ href, exact, asChild, count, hue, style, className, children, ...props }: Readonly<TabsNavLinkProps>) {\n const ctx = React.useContext(NavContext);\n if (!ctx) throw new Error(\"Tabs.NavLink must be inside <Tabs.Nav>\");\n const active = isTabActive(ctx.current, href, exact);\n const Comp = asChild ? Slot.Root : \"a\";\n return (\n <Comp\n data-tabs-link=\"\"\n data-state={active ? \"active\" : \"inactive\"}\n data-orientation=\"horizontal\"\n aria-current={active ? \"page\" : undefined}\n {...(asChild ? {} : { href })}\n data-hue={hue}\n style={hueStyle(hue, style)}\n className={cn(tabs({ variant: ctx.variant }).trigger(), \"no-underline\", className)}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n <TabCount count={count} />\n </>\n )}\n </Comp>\n );\n}\n\n/** `Tabs.Root/List/Trigger/Content` — `variant` underline · segmented · pills · binder on the root. `Tabs.Nav` + `Tabs.NavLink`: the same tabs as routes. */\nexport const Tabs = { Root: TabsRoot, List: TabsList, Trigger: TabsTrigger, Content: TabsContent, Nav: TabsNav, NavLink: TabsNavLink };\n"
394
394
  }
395
395
  ],
396
396
  "dependencies": [
@@ -238,7 +238,7 @@
238
238
  },
239
239
  {
240
240
  "path": "tag-input/tag-input.tsx",
241
- "content": "// Client. Free words as chips — the multiple, creatable `Combobox` on strings: Enter or a separator adds the word,\n// a paste of \"a, b, c\" adds three, Backspace on an empty input removes the last, suggestions complete as you type.\n// `normalize` cleans a word (lower case, no `#`), `validate` refuses one with a reason read aloud.\nimport * as React from \"react\";\n\nimport { Combobox, type ComboboxLabels, type ComboboxOption } from \"../combobox\";\nimport { useControllable } from \"../media\";\n\nexport type TagInputProps = {\n /** The visible label, passed translated (also the accessible name). */\n label: string;\n /** Hides the label visually, keeping it as the accessible name. */\n hideLabel?: boolean;\n /** The tags (controlled). */\n value?: readonly string[];\n /** The tags at first, uncontrolled. */\n defaultValue?: readonly string[];\n /** Called with every tag after a change. */\n onValueChange?: (tags: string[]) => void;\n /** Words offered as the person types (their own history, a curated list). */\n suggestions?: readonly string[];\n /** Cleans a word before it is added (`(t) => t.toLowerCase().replace(/^#/, \"\")`). An empty result is ignored. */\n normalize?: (tag: string) => string;\n /** Refuses a word: return the reason (passed translated), shown and read as the field's error; `null` accepts it. */\n validate?: (tag: string, tags: readonly string[]) => string | null;\n /** Most tags; the field stops offering more past it. */\n max?: number;\n /** Keys that add the word, besides Enter. Default `[\",\"]`. */\n separators?: readonly string[];\n /** The input's placeholder, passed translated. */\n placeholder?: string;\n /** A help text under the field (\"Up to 10 tags, separated by commas\"). */\n hint?: string;\n /** An error from the app (a server refusal); `validate`'s own errors show here too. */\n error?: string;\n /** Not available. */\n disabled?: boolean;\n /** The name of the hidden inputs, for a plain `<form>` post (one per tag). */\n name?: string;\n /** The words of the field, passed translated; English by default. */\n labels?: Partial<Pick<ComboboxLabels, \"create\" | \"remove\" | \"empty\" | \"results\" | \"toggle\">>;\n /** Classes merged on the root. */\n className?: string;\n};\n\nconst toOption = (tag: string): ComboboxOption => ({ value: tag, label: tag });\n\n/** Words as removable chips — tags, keywords, e-mail recipients — with suggestions, cleaning and validation. */\nexport function TagInput({\n value,\n defaultValue = [],\n onValueChange,\n suggestions = [],\n normalize = (tag) => tag.trim(),\n validate,\n max,\n separators = [\",\"],\n error,\n labels,\n ...props\n}: TagInputProps) {\n const [tags, setTags] = useControllable<readonly string[]>(value, defaultValue, onValueChange as (next: readonly string[]) => void);\n const [refusal, setRefusal] = React.useState<string | null>(null);\n\n const change = (options: ComboboxOption[]) => {\n const next: string[] = [];\n for (const option of options) {\n const tag = normalize(option.value);\n if (!tag || next.includes(tag)) continue;\n if (!tags.includes(tag)) {\n const reason = validate?.(tag, next) ?? null;\n if (reason) {\n setRefusal(reason);\n continue;\n }\n }\n next.push(tag);\n }\n if (next.length >= options.length || options.length < tags.length) setRefusal(null);\n setTags(next);\n };\n\n return (\n <Combobox\n {...props}\n multiple\n creatable\n separators={separators}\n maxSelected={max}\n value={tags.map(toOption)}\n onValueChange={change}\n options={suggestions.map(toOption)}\n error={refusal ?? error}\n labels={{ empty: \"\", results: () => \"\", ...labels }}\n />\n );\n}\n"
241
+ "content": "// Client. Free words as chips — the multiple, creatable `Combobox` on strings: Enter or a separator adds the word,\n// a paste of \"a, b, c\" adds three, Backspace on an empty input removes the last, suggestions complete as you type.\n// `normalize` cleans a word (lower case, no `#`), `validate` refuses one with a reason read aloud.\nimport * as React from \"react\";\n\nimport { Combobox, type ComboboxLabels, type ComboboxOption } from \"../combobox\";\nimport { useControllable } from \"../media\";\n\nexport type TagInputProps = {\n /** The visible label, passed translated (also the accessible name). */\n label: string;\n /** Hides the label visually, keeping it as the accessible name. */\n hideLabel?: boolean;\n /** The tags (controlled). */\n value?: readonly string[];\n /** The tags at first, uncontrolled. */\n defaultValue?: readonly string[];\n /** Called with every tag after a change. */\n onValueChange?: (tags: string[]) => void;\n /** Words offered as the person types (their own history, a curated list). */\n suggestions?: readonly string[];\n /** Cleans a word before it is added (`(t) => t.toLowerCase().replace(/^#/, \"\")`). An empty result is ignored. */\n normalize?: (tag: string) => string;\n /** Refuses a word: return the reason (passed translated), shown and read as the field's error; `null` accepts it. */\n validate?: (tag: string, tags: readonly string[]) => string | null;\n /** Most tags; the field stops offering more past it. */\n max?: number;\n /** Keys that add the word, besides Enter. Default `[\",\"]`. */\n separators?: readonly string[];\n /** The input's placeholder, passed translated. */\n placeholder?: string;\n /** A help text under the field (\"Up to 10 tags, separated by commas\"). */\n hint?: string;\n /** An error from the app (a server refusal); `validate`'s own errors show here too. */\n error?: string;\n /** Not available. */\n disabled?: boolean;\n /** The name of the hidden inputs, for a plain `<form>` post (one per tag). */\n name?: string;\n /** The words of the field, passed translated; English by default. */\n labels?: Partial<Pick<ComboboxLabels, \"create\" | \"remove\" | \"empty\" | \"results\" | \"toggle\">>;\n /** Classes merged on the root. */\n className?: string;\n};\n\nconst toOption = (tag: string): ComboboxOption => ({ value: tag, label: tag });\n\n/** Words as removable chips — tags, keywords, e-mail recipients — with suggestions, cleaning and validation. */\nexport function TagInput({\n value,\n defaultValue = [],\n onValueChange,\n suggestions = [],\n normalize = (tag) => tag.trim(),\n validate,\n max,\n separators = [\",\"],\n error,\n labels,\n ...props\n}: Readonly<TagInputProps>) {\n const [tags, setTags] = useControllable<readonly string[]>(value, defaultValue, onValueChange as (next: readonly string[]) => void);\n const [refusal, setRefusal] = React.useState<string | null>(null);\n\n const change = (options: ComboboxOption[]) => {\n const next: string[] = [];\n for (const option of options) {\n const tag = normalize(option.value);\n if (!tag || next.includes(tag)) continue;\n if (!tags.includes(tag)) {\n const reason = validate?.(tag, next) ?? null;\n if (reason) {\n setRefusal(reason);\n continue;\n }\n }\n next.push(tag);\n }\n if (next.length >= options.length || options.length < tags.length) setRefusal(null);\n setTags(next);\n };\n\n return (\n <Combobox\n {...props}\n multiple\n creatable\n separators={separators}\n maxSelected={max}\n value={tags.map(toOption)}\n onValueChange={change}\n options={suggestions.map(toOption)}\n error={refusal ?? error}\n labels={{ empty: \"\", results: () => \"\", ...labels }}\n />\n );\n}\n"
242
242
  }
243
243
  ],
244
244
  "dependencies": [],
@@ -327,7 +327,7 @@
327
327
  },
328
328
  {
329
329
  "path": "tag-selector/tag-selector.tsx",
330
- "content": "// Client. Interests, languages, a workspace's tags: toggle chips with a limit and a count; once it is reached the others\n// rest (disabled) and the count says so. An option with a `marker` is a tag with a colour beside its name (`TagChip`).\n// `creatable` adds a field: Enter takes the typed word — the tag of that name if it exists, else a new one the host creates\n// (`onCreate`, with the marker chosen from the closed palette) — and the typed word narrows the tags offered.\nimport * as React from \"react\";\n\nimport { Chip, type Marker, MarkerPicker, TagChip } from \"../chip\";\n\nexport type TagOption = {\n value: string;\n label: string;\n /** A tag's colour: a name of the closed palette (`@krizaka/organize` `MARKERS`). Without it, a plain chip. */\n marker?: Marker;\n};\n\ntype CreatableProps = {\n /** Adds a field: Enter chooses the tag typed, or asks the host to create it. */\n creatable?: boolean;\n /** Called with the new name (trimmed, as typed) and the marker chosen; the host creates the tag (it may refuse), adds the option and chooses it. */\n onCreate?: (name: string, marker: Marker) => void;\n /** The field's accessible name (\"Add a tag\"), passed translated. */\n inputLabel?: string;\n /** The field's placeholder, passed translated. */\n placeholder?: string;\n /** The create button: `(name) => \"Create “\" + name + \"”\"`, passed translated. */\n createLabel?: (name: string) => string;\n /** The name of each colour, passed translated: shows the colour choice beside the field. */\n markerNames?: Readonly<Record<Marker, string>>;\n /** The colour choice's accessible name (\"Colour of the new tag\"). */\n markerLabel?: string;\n /** The colour a new tag starts with (default `blue`). */\n defaultMarker?: Marker;\n /** The most characters of a name (default 80, the contract's `NAME_MAX`). */\n maxLength?: number;\n /** What is said when nothing matches and creating is not offered (“No tag of that name”), passed translated. */\n emptyLabel?: string;\n};\n\nexport type TagSelectorProps = CreatableProps & {\n /** The group's name (“Interests”) — passed translated. */\n label: string;\n /** The tags offered. */\n options: readonly TagOption[];\n /** The tags chosen. */\n value: readonly string[];\n /** Called with the tags chosen. */\n onValueChange: (value: string[]) => void;\n /** The most that can be chosen. */\n max?: number;\n /** The count under the tags: `(n, max) => n + \" of \" + max`. */\n countLabel?: (count: number, max: number) => string;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** The options whose label holds the typed text, and those already chosen. */\nconst matching = (options: readonly TagOption[], needle: string, value: readonly string[]) =>\n options.filter((o) => o.label.toLocaleLowerCase().includes(needle) || value.includes(o.value));\n\n/** One toggle chip: a marked tag wears its marker; the others rest once the limit is reached. */\nfunction OptionChip({ option, on, full, onToggle }: { option: TagOption; on: boolean; full: boolean; onToggle: (next: boolean) => void }) {\n const props = { selected: on, disabled: !on && full, onSelectedChange: onToggle };\n return option.marker ? (\n <TagChip marker={option.marker} {...props}>\n {option.label}\n </TagChip>\n ) : (\n <Chip {...props}>{option.label}</Chip>\n );\n}\n\ntype FieldKeyContext = {\n draft: string;\n value: readonly string[];\n commit: () => void;\n onValueChange: (next: string[]) => void;\n setDraft: (next: string) => void;\n};\n\n/** The typed field's keys: Enter commits, Backspace on an empty field takes the last tag back, Escape clears the draft. */\nfunction fieldKey(event: React.KeyboardEvent<HTMLInputElement>, { draft, value, commit, onValueChange, setDraft }: FieldKeyContext) {\n if (event.key === \"Enter\") {\n event.preventDefault();\n commit();\n } else if (event.key === \"Backspace\" && !draft && value.length > 0) {\n onValueChange(value.slice(0, -1));\n } else if (event.key === \"Escape\" && draft) {\n event.stopPropagation();\n setDraft(\"\");\n }\n}\n\nconst reached = (max: number | undefined, count: number) => max !== undefined && count >= max;\n\ntype CommitArgs = {\n typed: string;\n exact: TagOption | undefined;\n canCreate: boolean;\n full: boolean;\n value: readonly string[];\n marker: Marker;\n onValueChange: (value: string[]) => void;\n onCreate?: (name: string, marker: Marker) => void;\n setDraft: (draft: string) => void;\n};\n\n/** Enter or the button: pick the option the text names, or create it; nothing happens when neither applies. */\nfunction commitDraft({ typed, exact, canCreate, full, value, marker, onValueChange, onCreate, setDraft }: CommitArgs) {\n if (!typed) return;\n if (exact) {\n if (value.includes(exact.value) || full) {\n setDraft(\"\");\n return;\n }\n onValueChange([...value, exact.value]);\n } else if (canCreate) {\n onCreate?.(typed, marker);\n } else return;\n setDraft(\"\");\n}\n\n/** Toggle chips with a limit and a count — the others rest once the limit is reached; `creatable` types a new one. */\nexport function TagSelector({\n label,\n options,\n value,\n onValueChange,\n max,\n countLabel,\n className,\n creatable,\n onCreate,\n inputLabel,\n placeholder,\n createLabel = (name) => `Create “${name}”`,\n markerNames,\n markerLabel,\n defaultMarker = \"blue\",\n maxLength = 80,\n emptyLabel,\n}: TagSelectorProps) {\n const full = reached(max, value.length);\n const [draft, setDraft] = React.useState(\"\");\n const [marker, setMarker] = React.useState<Marker>(defaultMarker);\n const typed = draft.replace(/\\s+/g, \" \").trim();\n const needle = typed.toLocaleLowerCase();\n const exact = options.find((o) => o.label.toLocaleLowerCase() === needle);\n const shown = creatable && needle ? matching(options, needle, value) : options;\n const canCreate = Boolean(creatable && onCreate && typed && !exact && !full);\n const toggle = (option: TagOption, on: boolean) => onValueChange(on ? [...value, option.value] : value.filter((v) => v !== option.value));\n\n const commit = () => commitDraft({ typed, exact, canCreate, full, value, marker, onValueChange, onCreate, setDraft });\n const listId = React.useId();\n\n return (\n <div className={[\"flex flex-col gap-2\", className].filter(Boolean).join(\" \")}>\n <div role=\"group\" aria-label={label} id={listId} className=\"flex flex-wrap gap-2\">\n {shown.map((option) => (\n <OptionChip key={option.value} option={option} on={value.includes(option.value)} full={full} onToggle={(next) => toggle(option, next)} />\n ))}\n {creatable && needle && shown.length === 0 && !canCreate && emptyLabel ? <p className=\"m-0 text-xs text-fg-secondary\">{emptyLabel}</p> : null}\n </div>\n {creatable ? (\n <div className=\"flex flex-wrap items-center gap-2\">\n <input\n type=\"text\"\n value={draft}\n maxLength={maxLength}\n aria-label={inputLabel ?? label}\n aria-controls={listId}\n placeholder={placeholder}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={(event) => fieldKey(event, { draft, value, commit, onValueChange, setDraft })}\n className=\"h-9 min-w-40 flex-1 rounded-md border border-border-control bg-surface-1 px-3 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n />\n {canCreate ? (\n <>\n {markerNames ? <MarkerPicker label={markerLabel ?? label} names={markerNames} value={marker} onValueChange={setMarker} /> : null}\n <button\n type=\"button\"\n onClick={commit}\n className=\"inline-flex h-9 items-center rounded-md border border-accent bg-accent-soft px-3 text-xs font-semibold text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {createLabel(typed)}\n </button>\n </>\n ) : null}\n </div>\n ) : null}\n {max !== undefined && countLabel ? (\n <p className={[\"m-0 text-xs\", full ? \"font-semibold text-fg-accent\" : \"text-fg-secondary\"].join(\" \")} aria-live=\"polite\">\n {countLabel(value.length, max)}\n </p>\n ) : null}\n </div>\n );\n}\n"
330
+ "content": "// Client. Interests, languages, a workspace's tags: toggle chips with a limit and a count; once it is reached the others\n// rest (disabled) and the count says so. An option with a `marker` is a tag with a colour beside its name (`TagChip`).\n// `creatable` adds a field: Enter takes the typed word — the tag of that name if it exists, else a new one the host creates\n// (`onCreate`, with the marker chosen from the closed palette) — and the typed word narrows the tags offered.\nimport * as React from \"react\";\n\nimport { Chip, type Marker, MarkerPicker, TagChip } from \"../chip\";\n\nexport type TagOption = {\n value: string;\n label: string;\n /** A tag's colour: a name of the closed palette (`@krizaka/organize` `MARKERS`). Without it, a plain chip. */\n marker?: Marker;\n};\n\ntype CreatableProps = {\n /** Adds a field: Enter chooses the tag typed, or asks the host to create it. */\n creatable?: boolean;\n /** Called with the new name (trimmed, as typed) and the marker chosen; the host creates the tag (it may refuse), adds the option and chooses it. */\n onCreate?: (name: string, marker: Marker) => void;\n /** The field's accessible name (\"Add a tag\"), passed translated. */\n inputLabel?: string;\n /** The field's placeholder, passed translated. */\n placeholder?: string;\n /** The create button: `(name) => \"Create “\" + name + \"”\"`, passed translated. */\n createLabel?: (name: string) => string;\n /** The name of each colour, passed translated: shows the colour choice beside the field. */\n markerNames?: Readonly<Record<Marker, string>>;\n /** The colour choice's accessible name (\"Colour of the new tag\"). */\n markerLabel?: string;\n /** The colour a new tag starts with (default `blue`). */\n defaultMarker?: Marker;\n /** The most characters of a name (default 80, the contract's `NAME_MAX`). */\n maxLength?: number;\n /** What is said when nothing matches and creating is not offered (“No tag of that name”), passed translated. */\n emptyLabel?: string;\n};\n\nexport type TagSelectorProps = CreatableProps & {\n /** The group's name (“Interests”) — passed translated. */\n label: string;\n /** The tags offered. */\n options: readonly TagOption[];\n /** The tags chosen. */\n value: readonly string[];\n /** Called with the tags chosen. */\n onValueChange: (value: string[]) => void;\n /** The most that can be chosen. */\n max?: number;\n /** The count under the tags: `(n, max) => n + \" of \" + max`. */\n countLabel?: (count: number, max: number) => string;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** The options whose label holds the typed text, and those already chosen. */\nconst matching = (options: readonly TagOption[], needle: string, value: readonly string[]) =>\n options.filter((o) => o.label.toLocaleLowerCase().includes(needle) || value.includes(o.value));\n\n/** One toggle chip: a marked tag wears its marker; the others rest once the limit is reached. */\nfunction OptionChip({ option, on, full, onToggle }: Readonly<{ option: TagOption; on: boolean; full: boolean; onToggle: (next: boolean) => void }>) {\n const props = { selected: on, disabled: !on && full, onSelectedChange: onToggle };\n return option.marker ? (\n <TagChip marker={option.marker} {...props}>\n {option.label}\n </TagChip>\n ) : (\n <Chip {...props}>{option.label}</Chip>\n );\n}\n\ntype FieldKeyContext = {\n draft: string;\n value: readonly string[];\n commit: () => void;\n onValueChange: (next: string[]) => void;\n setDraft: (next: string) => void;\n};\n\n/** The typed field's keys: Enter commits, Backspace on an empty field takes the last tag back, Escape clears the draft. */\nfunction fieldKey(event: React.KeyboardEvent<HTMLInputElement>, { draft, value, commit, onValueChange, setDraft }: FieldKeyContext) {\n if (event.key === \"Enter\") {\n event.preventDefault();\n commit();\n } else if (event.key === \"Backspace\" && !draft && value.length > 0) {\n onValueChange(value.slice(0, -1));\n } else if (event.key === \"Escape\" && draft) {\n event.stopPropagation();\n setDraft(\"\");\n }\n}\n\nconst reached = (max: number | undefined, count: number) => max !== undefined && count >= max;\n\ntype CommitArgs = {\n typed: string;\n exact: TagOption | undefined;\n canCreate: boolean;\n full: boolean;\n value: readonly string[];\n marker: Marker;\n onValueChange: (value: string[]) => void;\n onCreate?: (name: string, marker: Marker) => void;\n setDraft: (draft: string) => void;\n};\n\n/** Enter or the button: pick the option the text names, or create it; nothing happens when neither applies. */\nfunction commitDraft({ typed, exact, canCreate, full, value, marker, onValueChange, onCreate, setDraft }: CommitArgs) {\n if (!typed) return;\n if (exact) {\n if (value.includes(exact.value) || full) {\n setDraft(\"\");\n return;\n }\n onValueChange([...value, exact.value]);\n } else if (canCreate) {\n onCreate?.(typed, marker);\n } else return;\n setDraft(\"\");\n}\n\n/** Toggle chips with a limit and a count — the others rest once the limit is reached; `creatable` types a new one. */\nexport function TagSelector({\n label,\n options,\n value,\n onValueChange,\n max,\n countLabel,\n className,\n creatable,\n onCreate,\n inputLabel,\n placeholder,\n createLabel = (name) => `Create “${name}”`,\n markerNames,\n markerLabel,\n defaultMarker = \"blue\",\n maxLength = 80,\n emptyLabel,\n}: Readonly<TagSelectorProps>) {\n const full = reached(max, value.length);\n const [draft, setDraft] = React.useState(\"\");\n const [marker, setMarker] = React.useState<Marker>(defaultMarker);\n const typed = draft.replaceAll(/\\s+/g, \" \").trim();\n const needle = typed.toLocaleLowerCase();\n const exact = options.find((o) => o.label.toLocaleLowerCase() === needle);\n const shown = creatable && needle ? matching(options, needle, value) : options;\n const canCreate = Boolean(creatable && onCreate && typed && !exact && !full);\n const toggle = (option: TagOption, on: boolean) => onValueChange(on ? [...value, option.value] : value.filter((v) => v !== option.value));\n\n const commit = () => commitDraft({ typed, exact, canCreate, full, value, marker, onValueChange, onCreate, setDraft });\n const listId = React.useId();\n\n return (\n <div className={[\"flex flex-col gap-2\", className].filter(Boolean).join(\" \")}>\n <div role=\"group\" aria-label={label} id={listId} className=\"flex flex-wrap gap-2\">\n {shown.map((option) => (\n <OptionChip key={option.value} option={option} on={value.includes(option.value)} full={full} onToggle={(next) => toggle(option, next)} />\n ))}\n {creatable && needle && shown.length === 0 && !canCreate && emptyLabel ? <p className=\"m-0 text-xs text-fg-secondary\">{emptyLabel}</p> : null}\n </div>\n {creatable ? (\n <div className=\"flex flex-wrap items-center gap-2\">\n <input\n type=\"text\"\n value={draft}\n maxLength={maxLength}\n aria-label={inputLabel ?? label}\n aria-controls={listId}\n placeholder={placeholder}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={(event) => fieldKey(event, { draft, value, commit, onValueChange, setDraft })}\n className=\"h-9 min-w-40 flex-1 rounded-md border border-border-control bg-surface-1 px-3 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n />\n {canCreate ? (\n <>\n {markerNames ? <MarkerPicker label={markerLabel ?? label} names={markerNames} value={marker} onValueChange={setMarker} /> : null}\n <button\n type=\"button\"\n onClick={commit}\n className=\"inline-flex h-9 items-center rounded-md border border-accent bg-accent-soft px-3 text-xs font-semibold text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {createLabel(typed)}\n </button>\n </>\n ) : null}\n </div>\n ) : null}\n {max !== undefined && countLabel ? (\n <p className={[\"m-0 text-xs\", full ? \"font-semibold text-fg-accent\" : \"text-fg-secondary\"].join(\" \")} aria-live=\"polite\">\n {countLabel(value.length, max)}\n </p>\n ) : null}\n </div>\n );\n}\n"
331
331
  }
332
332
  ],
333
333
  "dependencies": [],
@@ -124,7 +124,7 @@
124
124
  },
125
125
  {
126
126
  "path": "taped-photo/taped-photo.tsx",
127
- "content": "// The taped photo of the Cahier (ADR-004, blocks.css): a print stuck in the notebook — slightly tilted, a thin white print\n// border, a soft paper shadow (layered, never a glow), strips of tape. Whatever it holds (an image, a video, a live scene)\n// is its picture; the tilt is a transform, so nothing shifts and the picture keeps its own box. Server-safe: no state.\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type TapedPhotoProps = React.HTMLAttributes<HTMLElement> & {\n /** The picture: an `img`, a `video`, a scene. It fills the print. */\n children: React.ReactNode;\n /** A line written under the picture, on the print. */\n caption?: React.ReactNode;\n /** The tilt in degrees (negative leans left); eased on a phone. @default -1.6 */\n tilt?: number;\n /** Where the tape holds it: two opposite `corners`, one strip at the `top`, or `none`. @default \"corners\" */\n tape?: \"corners\" | \"top\" | \"none\";\n};\n\n/** A print taped in the notebook: tilted, a white border, a paper shadow, tape at two corners or at the top. */\nexport function TapedPhoto({ children, caption, tilt = -1.6, tape = \"corners\", className, style, ...props }: TapedPhotoProps) {\n return (\n <figure\n className={cn(\"kz-taped\", className)}\n data-tape={tape === \"corners\" ? undefined : tape}\n style={{ ...style, [\"--kz-taped-tilt\" as string]: `${tilt}deg` }}\n {...props}\n >\n <div className=\"kz-taped-picture\">{children}</div>\n {caption ? <figcaption className=\"kz-taped-caption\">{caption}</figcaption> : null}\n </figure>\n );\n}\n"
127
+ "content": "// The taped photo of the Cahier (ADR-004, blocks.css): a print stuck in the notebook — slightly tilted, a thin white print\n// border, a soft paper shadow (layered, never a glow), strips of tape. Whatever it holds (an image, a video, a live scene)\n// is its picture; the tilt is a transform, so nothing shifts and the picture keeps its own box. Server-safe: no state.\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type TapedPhotoProps = React.HTMLAttributes<HTMLElement> & {\n /** The picture: an `img`, a `video`, a scene. It fills the print. */\n children: React.ReactNode;\n /** A line written under the picture, on the print. */\n caption?: React.ReactNode;\n /** The tilt in degrees (negative leans left); eased on a phone. @default -1.6 */\n tilt?: number;\n /** Where the tape holds it: two opposite `corners`, one strip at the `top`, or `none`. @default \"corners\" */\n tape?: \"corners\" | \"top\" | \"none\";\n};\n\n/** A print taped in the notebook: tilted, a white border, a paper shadow, tape at two corners or at the top. */\nexport function TapedPhoto({ children, caption, tilt = -1.6, tape = \"corners\", className, style, ...props }: Readonly<TapedPhotoProps>) {\n return (\n <figure\n className={cn(\"kz-taped\", className)}\n data-tape={tape === \"corners\" ? undefined : tape}\n style={{ ...style, [\"--kz-taped-tilt\" as string]: `${tilt}deg` }}\n {...props}\n >\n <div className=\"kz-taped-picture\">{children}</div>\n {caption ? <figcaption className=\"kz-taped-caption\">{caption}</figcaption> : null}\n </figure>\n );\n}\n"
128
128
  }
129
129
  ],
130
130
  "dependencies": [],
@@ -213,7 +213,7 @@
213
213
  },
214
214
  {
215
215
  "path": "glyphs.tsx",
216
- "content": "// The small line glyphs the data and media primitives draw (play, volume, search, chevrons…): decorative, 24-unit\n// box, `currentColor`, sized by the caller's class. Shared by the entries that need them; never exported on its own —\n// a product draws its own icons with @krizaka/icons.\nimport type * as React from \"react\";\n\ntype GlyphProps = { className?: string };\n\nfunction Glyph({ className = \"h-4 w-4\", fill, children }: GlyphProps & { fill?: boolean; children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n className={className}\n fill={fill ? \"currentColor\" : \"none\"}\n stroke={fill ? \"none\" : \"currentColor\"}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n {children}\n </svg>\n );\n}\n\nexport const PlayGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <path d=\"M8 5.5v13a1 1 0 0 0 1.5.86l10.4-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z\" />\n </Glyph>\n);\nexport const PauseGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n <rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n </Glyph>\n);\nexport const VolumeGlyph = ({ muted, ...p }: GlyphProps & { muted?: boolean }) => (\n <Glyph {...p}>\n <path d=\"M11 5 6 9H3v6h3l5 4V5Z\" />\n {muted ? <path d=\"m22 9-6 6m0-6 6 6\" /> : <path d=\"M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13\" />}\n </Glyph>\n);\nexport const FullscreenGlyph = ({ exit, ...p }: GlyphProps & { exit?: boolean }) => (\n <Glyph {...p}>\n {exit ? <path d=\"M9 4v5H4m11-5v5h5M9 20v-5H4m11 5v-5h5\" /> : <path d=\"M4 9V4h5m6 0h5v5M4 15v5h5m11-5v5h-5\" />}\n </Glyph>\n);\nexport const CaptionsGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M17 10.5a2 2 0 1 0 0 3\" />\n </Glyph>\n);\nexport const PipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <rect x=\"12\" y=\"12\" width=\"6\" height=\"4\" rx=\"1\" />\n </Glyph>\n);\nexport const SearchGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </Glyph>\n);\nexport const CloseGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </Glyph>\n);\nexport const ChevronGlyph = ({ direction = \"down\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" | \"up\" | \"down\" }) => (\n <Glyph {...p}>\n <path d={{ left: \"m15 6-6 6 6 6\", right: \"m9 6 6 6-6 6\", up: \"m6 15 6-6 6 6\", down: \"m6 9 6 6 6-6\" }[direction]} />\n </Glyph>\n);\nexport const CheckGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Glyph>\n);\nexport const PlusGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 5v14M5 12h14\" />\n </Glyph>\n);\nexport const CalendarGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M3 10h18M8 3v4M16 3v4\" />\n </Glyph>\n);\nexport const UploadGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 16V4m0 0L7 9m5-5 5 5\" />\n <path d=\"M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </Glyph>\n);\nexport const FileGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z\" />\n <path d=\"M14 3v5h5\" />\n </Glyph>\n);\nexport const CameraGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z\" />\n <circle cx=\"12\" cy=\"13.5\" r=\"3.5\" />\n </Glyph>\n);\nexport const FlipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3\" />\n <path d=\"M18 3v4h-4M6 21v-4h4\" />\n </Glyph>\n);\nexport const RetryGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 1 0 2.3-5.7L4 8.5\" />\n <path d=\"M4 4v4.5h4.5\" />\n </Glyph>\n);\nexport const SortGlyph = ({ direction, ...p }: GlyphProps & { direction?: \"ascending\" | \"descending\" }) => (\n <Glyph {...p}>\n {direction === \"ascending\" ? <path d=\"m7 14 5-5 5 5\" /> : direction === \"descending\" ? <path d=\"m7 10 5 5 5-5\" /> : <path d=\"m8 9 4-4 4 4M8 15l4 4 4-4\" />}\n </Glyph>\n);\nexport const ArrowGlyph = ({ direction = \"right\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" }) => (\n <Glyph {...p}>\n <path d={direction === \"left\" ? \"M19 12H5m0 0 6-6m-6 6 6 6\" : \"M5 12h14m0 0-6-6m6 6-6 6\"} />\n </Glyph>\n);\nexport const ExternalGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 4h6v6M20 4l-9 9\" />\n <path d=\"M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4\" />\n </Glyph>\n);\nexport const WarningGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 4 2.5 20h19L12 4Z\" />\n <path d=\"M12 10v4M12 17.2v.1\" />\n </Glyph>\n);\nexport const CopyGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3\" />\n </Glyph>\n);\nexport const PencilGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 20h4L19 9a2.8 2.8 0 0 0-4-4L4 16v4zM13.5 6.5l4 4\" />\n </Glyph>\n);\n"
216
+ "content": "// The small line glyphs the data and media primitives draw (play, volume, search, chevrons…): decorative, 24-unit\n// box, `currentColor`, sized by the caller's class. Shared by the entries that need them; never exported on its own —\n// a product draws its own icons with @krizaka/icons.\nimport type * as React from \"react\";\n\ntype GlyphProps = { className?: string };\n\nfunction Glyph({ className = \"h-4 w-4\", fill, children }: Readonly<GlyphProps & { fill?: boolean; children: React.ReactNode }>) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n className={className}\n fill={fill ? \"currentColor\" : \"none\"}\n stroke={fill ? \"none\" : \"currentColor\"}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n {children}\n </svg>\n );\n}\n\nexport const PlayGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p} fill>\n <path d=\"M8 5.5v13a1 1 0 0 0 1.5.86l10.4-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z\" />\n </Glyph>\n);\nexport const PauseGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p} fill>\n <rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n <rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n </Glyph>\n);\nexport const VolumeGlyph = ({ muted, ...p }: Readonly<GlyphProps & { muted?: boolean }>) => (\n <Glyph {...p}>\n <path d=\"M11 5 6 9H3v6h3l5 4V5Z\" />\n {muted ? <path d=\"m22 9-6 6m0-6 6 6\" /> : <path d=\"M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13\" />}\n </Glyph>\n);\nexport const FullscreenGlyph = ({ exit, ...p }: Readonly<GlyphProps & { exit?: boolean }>) => (\n <Glyph {...p}>\n {exit ? <path d=\"M9 4v5H4m11-5v5h5M9 20v-5H4m11 5v-5h5\" /> : <path d=\"M4 9V4h5m6 0h5v5M4 15v5h5m11-5v5h-5\" />}\n </Glyph>\n);\nexport const CaptionsGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M17 10.5a2 2 0 1 0 0 3\" />\n </Glyph>\n);\nexport const PipGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <rect x=\"12\" y=\"12\" width=\"6\" height=\"4\" rx=\"1\" />\n </Glyph>\n);\nexport const SearchGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </Glyph>\n);\nexport const CloseGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </Glyph>\n);\nexport const ChevronGlyph = ({ direction = \"down\", ...p }: Readonly<GlyphProps & { direction?: \"left\" | \"right\" | \"up\" | \"down\" }>) => (\n <Glyph {...p}>\n <path d={{ left: \"m15 6-6 6 6 6\", right: \"m9 6 6 6-6 6\", up: \"m6 15 6-6 6 6\", down: \"m6 9 6 6 6-6\" }[direction]} />\n </Glyph>\n);\nexport const CheckGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Glyph>\n);\nexport const PlusGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M12 5v14M5 12h14\" />\n </Glyph>\n);\nexport const CalendarGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M3 10h18M8 3v4M16 3v4\" />\n </Glyph>\n);\nexport const UploadGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M12 16V4m0 0L7 9m5-5 5 5\" />\n <path d=\"M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </Glyph>\n);\nexport const FileGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z\" />\n <path d=\"M14 3v5h5\" />\n </Glyph>\n);\nexport const CameraGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z\" />\n <circle cx=\"12\" cy=\"13.5\" r=\"3.5\" />\n </Glyph>\n);\nexport const FlipGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3\" />\n <path d=\"M18 3v4h-4M6 21v-4h4\" />\n </Glyph>\n);\nexport const RetryGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 1 0 2.3-5.7L4 8.5\" />\n <path d=\"M4 4v4.5h4.5\" />\n </Glyph>\n);\nexport const SortGlyph = ({ direction, ...p }: Readonly<GlyphProps & { direction?: \"ascending\" | \"descending\" }>) => (\n <Glyph {...p}>\n {direction === \"ascending\" ? <path d=\"m7 14 5-5 5 5\" /> : direction === \"descending\" ? <path d=\"m7 10 5 5 5-5\" /> : <path d=\"m8 9 4-4 4 4M8 15l4 4 4-4\" />}\n </Glyph>\n);\nexport const ArrowGlyph = ({ direction = \"right\", ...p }: Readonly<GlyphProps & { direction?: \"left\" | \"right\" }>) => (\n <Glyph {...p}>\n <path d={direction === \"left\" ? \"M19 12H5m0 0 6-6m-6 6 6 6\" : \"M5 12h14m0 0-6-6m6 6-6 6\"} />\n </Glyph>\n);\nexport const ExternalGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M14 4h6v6M20 4l-9 9\" />\n <path d=\"M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4\" />\n </Glyph>\n);\nexport const WarningGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M12 4 2.5 20h19L12 4Z\" />\n <path d=\"M12 10v4M12 17.2v.1\" />\n </Glyph>\n);\nexport const CopyGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3\" />\n </Glyph>\n);\nexport const PencilGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M4 20h4L19 9a2.8 2.8 0 0 0-4-4L4 16v4zM13.5 6.5l4 4\" />\n </Glyph>\n);\n"
217
217
  },
218
218
  {
219
219
  "path": "meta.ts",
@@ -229,7 +229,7 @@
229
229
  },
230
230
  {
231
231
  "path": "terminal-replay/terminal-replay.tsx",
232
- "content": "// Client (a timer, an observer). A terminal session played back: each command is typed at the prompt, its output\n// arrives line by line, the screen follows the last line like a real terminal. What a reader sees without the motion\n// is the session itself: the server renders it whole (no JavaScript, reduced motion and assistive technology all get\n// the full transcript), the screen has a fixed height (no layout shift while it plays), the replay starts when it\n// scrolls into view, waits while it is off screen, and pauses or replays on demand (WCAG 2.2.2). A bounded chain of\n// timeouts, never a permanent animation frame.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { warnDeprecated } from \"../deprecated\";\nimport { CheckGlyph, PauseGlyph, PlayGlyph, RetryGlyph } from \"../glyphs\";\n\n/** The colour of an output line — the tokens' text roles, all AA on the screen: secondary, accent, success, warning, danger. */\nexport type TerminalTone = \"muted\" | \"accent\" | \"success\" | \"warning\" | \"danger\";\n\nexport interface TerminalLine {\n /** The line as the program printed it (no colour codes). */\n text: string;\n /** Its colour, when the program coloured it. */\n tone?: TerminalTone;\n}\n\nexport interface TerminalStep {\n /** What is typed at the prompt (`npx sovkora install`). */\n command: string;\n /** What it printed, line by line. */\n output?: readonly (string | TerminalLine)[];\n}\n\nexport type TerminalReplayProps = Omit<React.ComponentProps<\"figure\">, \"children\" | \"title\"> & {\n /** The session, in order. */\n steps: readonly TerminalStep[];\n /** The accessible name of the screen (“Terminal session: install, start, dev”) — passed translated. */\n label: string;\n /** The window's title, shown in its bar (`~/projects — zsh`). */\n title?: React.ReactNode;\n /**\n * What the prompt shows before each command.\n * @default \"$\"\n */\n prompt?: string;\n /** The play button's words (the replay is waiting or paused). */\n playLabel: string;\n /** The pause button's words (the replay is running). */\n pauseLabel: string;\n /** The replay button's words (the session is shown whole). */\n replayLabel: string;\n /** The copy button's words: it copies the commands, one per line. Without it, no copy button. */\n copyLabel?: string;\n /** What the copy button says once the commands are copied (announced politely). */\n copiedLabel?: string;\n /**\n * Milliseconds per typed character.\n * @default 34\n */\n typingSpeed?: number;\n /**\n * Milliseconds between two output lines.\n * @default 70\n */\n lineDelay?: number;\n /**\n * Milliseconds between a command's last line and the next command.\n * @default 900\n */\n stepDelay?: number;\n /**\n * A multiplier on every delay (the motion vocabulary's `speed`): 2 plays twice as fast, 0.5 half as fast.\n * @default 1\n */\n speed?: number;\n /**\n * The screen's height, in lines; longer sessions scroll.\n * @default 18\n */\n rows?: number;\n /**\n * Plays the first time it scrolls into view. `false`: the session rests whole until the reader presses play.\n * @default true\n */\n autoPlay?: boolean;\n};\n\ntype Phase = \"final\" | \"idle\" | \"playing\" | \"paused\" | \"done\";\ninterface Position {\n step: number;\n chars: number;\n lines: number;\n}\n\nconst TONE: Record<TerminalTone, string> = {\n muted: \"text-fg-secondary\",\n accent: \"text-fg-accent\",\n success: \"text-fg-success\",\n warning: \"text-fg-warning\",\n danger: \"text-fg-danger\",\n};\n\nconst line = (entry: string | TerminalLine): TerminalLine => (typeof entry === \"string\" ? { text: entry } : entry);\n\n/** The next position of the replay and how long to wait for it; null at the end of the session. */\nfunction advance(steps: readonly TerminalStep[], pos: Position, timing: { typing: number; line: number; step: number }): [Position, number] | null {\n const current = steps[pos.step];\n if (!current) return null;\n const output = current.output ?? [];\n if (pos.chars < current.command.length) {\n // A space is a beat longer: the rhythm of someone typing, not of a printer.\n const pause = current.command[pos.chars] === \" \" ? timing.typing * 2 : timing.typing;\n return [{ ...pos, chars: pos.chars + 1 }, pause];\n }\n if (pos.lines < output.length) return [{ ...pos, lines: pos.lines + 1 }, pos.lines === 0 ? timing.line * 4 : timing.line];\n if (pos.step < steps.length - 1) return [{ step: pos.step + 1, chars: 0, lines: 0 }, timing.step];\n return null;\n}\n\n/**\n * A terminal session played back: commands typed at the prompt, their output line by line — or the whole session at rest.\n * @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.\n */\nexport function TerminalReplay({\n steps,\n label,\n title,\n prompt = \"$\",\n playLabel,\n pauseLabel,\n replayLabel,\n copyLabel,\n copiedLabel,\n typingSpeed = 34,\n lineDelay = 70,\n stepDelay = 900,\n speed = 1,\n rows = 18,\n autoPlay = true,\n className,\n style,\n ...props\n}: TerminalReplayProps) {\n warnDeprecated(\"terminal-replay\");\n const root = React.useRef<HTMLElement>(null);\n const screenRef = React.useRef<HTMLDivElement>(null);\n // The server renders the session whole; the client takes it over unless the reader asked for less motion.\n const [phase, setPhase] = React.useState<Phase>(\"final\");\n const [pos, setPos] = React.useState<Position>({ step: 0, chars: 0, lines: 0 });\n const [visible, setVisible] = React.useState(false);\n const [copied, setCopied] = React.useState(false);\n\n React.useEffect(() => {\n const el = root.current;\n if (!el || !autoPlay || window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n setPhase(\"idle\");\n // Starts the first time it is seen; off screen, it waits where it is.\n const io = new IntersectionObserver(\n ([entry]) => {\n const seen = Boolean(entry?.isIntersecting);\n setVisible(seen);\n if (seen) setPhase((current) => (current === \"idle\" ? \"playing\" : current));\n },\n { threshold: 0.35 },\n );\n io.observe(el);\n return () => io.disconnect();\n }, [autoPlay]);\n\n const rate = Math.max(0.1, speed);\n const timing = React.useMemo(() => ({ typing: typingSpeed / rate, line: lineDelay / rate, step: stepDelay / rate }), [typingSpeed, lineDelay, stepDelay, rate]);\n const ended = phase === \"playing\" && !advance(steps, pos, timing);\n // The end of the session is where the replay stands, not an event: derived, never set from an effect.\n const state: Phase = ended ? \"done\" : phase;\n\n React.useEffect(() => {\n if (phase !== \"playing\" || !visible) return;\n const next = advance(steps, pos, timing);\n if (!next) return;\n const timer = setTimeout(() => setPos(next[0]), next[1]);\n return () => clearTimeout(timer);\n }, [phase, visible, pos, steps, timing]);\n\n // The screen follows the last line while it plays, like a terminal.\n React.useEffect(() => {\n const el = screenRef.current;\n if (el && state === \"playing\") el.scrollTop = el.scrollHeight;\n }, [pos, state]);\n\n React.useEffect(() => {\n if (!copied) return;\n const timer = setTimeout(() => setCopied(false), 1800);\n return () => clearTimeout(timer);\n }, [copied]);\n\n const whole = state === \"final\" || state === \"done\";\n const shown = whole ? steps.length - 1 : pos.step;\n const toggle = () => {\n if (state === \"playing\") setPhase(\"paused\");\n else if (state === \"paused\" || state === \"idle\") setPhase(\"playing\");\n else {\n // Played on demand — also under reduced motion: the reader asked for it. Off screen it would wait: it is on screen.\n setVisible(true);\n setPos({ step: 0, chars: 0, lines: 0 });\n setPhase(\"playing\");\n }\n };\n const control =\n state === \"playing\"\n ? { text: pauseLabel, Glyph: PauseGlyph }\n : state === \"done\"\n ? { text: replayLabel, Glyph: RetryGlyph }\n : { text: playLabel, Glyph: PlayGlyph };\n const commands = steps.map((s) => s.command).join(\"\\n\");\n const transcript = steps.map((s) => [`${prompt} ${s.command}`, ...(s.output ?? []).map((o) => line(o).text)].join(\"\\n\")).join(\"\\n\\n\");\n\n return (\n <figure\n ref={root}\n data-state={state}\n data-autoplay={autoPlay ? \"\" : undefined}\n className={cn(\"kz-replay overflow-hidden rounded-xl border border-border-default bg-surface-1 shadow-md\", className)}\n style={{ \"--kz-replay-rows\": rows, ...style } as React.CSSProperties}\n {...props}\n >\n <figcaption className=\"flex items-center gap-3 border-b border-border-subtle bg-surface-2 px-3 py-2 text-xs text-fg-secondary\">\n <span aria-hidden className=\"flex shrink-0 gap-1.5\">\n <span className=\"h-2.5 w-2.5 rounded-full bg-border-strong\" />\n <span className=\"h-2.5 w-2.5 rounded-full bg-border-strong\" />\n <span className=\"h-2.5 w-2.5 rounded-full bg-border-strong\" />\n </span>\n <span className=\"min-w-0 flex-1 truncate font-mono\">{title}</span>\n <button\n type=\"button\"\n onClick={toggle}\n className=\"inline-flex shrink-0 items-center gap-1.5 rounded-md px-2 py-1 font-medium text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg focus-visible:outline-2 focus-visible:outline-ring\"\n >\n <control.Glyph className=\"h-3.5 w-3.5\" />\n {control.text}\n </button>\n {copyLabel && (\n <button\n type=\"button\"\n onClick={() => navigator.clipboard?.writeText(commands).then(() => setCopied(true))}\n data-copied={copied ? \"\" : undefined}\n className=\"inline-flex shrink-0 items-center gap-1.5 rounded-md px-2 py-1 font-medium text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg focus-visible:outline-2 focus-visible:outline-ring\"\n >\n {copied ? <CheckGlyph className=\"h-3.5 w-3.5\" /> : <CopyGlyph />}\n <span aria-live=\"polite\">{copied ? (copiedLabel ?? copyLabel) : copyLabel}</span>\n </button>\n )}\n </figcaption>\n <div\n ref={screenRef}\n role=\"region\"\n aria-label={label}\n tabIndex={0}\n className=\"kz-replay-screen relative overflow-auto bg-surface-0 px-4 py-3 font-mono text-[0.8125rem] leading-relaxed text-fg focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring\"\n >\n <div aria-hidden className=\"kz-replay-live\">\n {steps.slice(0, state === \"idle\" ? 0 : shown + 1).map((step, i) => {\n const current = !whole && i === shown;\n const typed = current ? step.command.slice(0, pos.chars) : step.command;\n const output = (step.output ?? []).slice(0, current ? pos.lines : undefined);\n const typing = current && pos.chars < step.command.length;\n return (\n <div key={i} className={i > 0 ? \"mt-3\" : undefined}>\n <div className=\"whitespace-pre\">\n <span className=\"text-fg-accent select-none\">{prompt} </span>\n <span className=\"font-medium\">{typed}</span>\n {typing && <span className=\"kz-replay-caret\" />}\n </div>\n {output.map((entry, j) => {\n const { text, tone } = line(entry);\n return (\n <div key={j} className={cn(\"min-h-[1lh] whitespace-pre\", tone ? TONE[tone] : \"text-fg\")}>\n {text}\n </div>\n );\n })}\n </div>\n );\n })}\n {(state === \"idle\" || whole) && (\n <div className={cn(\"whitespace-pre\", state !== \"idle\" && \"mt-3\")}>\n <span className=\"text-fg-accent select-none\">{prompt} </span>\n <span className=\"kz-replay-caret\" />\n </div>\n )}\n </div>\n <pre className=\"sr-only\">{transcript}</pre>\n </div>\n </figure>\n );\n}\n\n/** Two sheets, one over the other: copy. Drawn here, like the other glyphs of the primitives (decorative). */\nfunction CopyGlyph() {\n return (\n <svg viewBox=\"0 0 24 24\" className=\"h-3.5 w-3.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden focusable=\"false\">\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M5 15V6a2 2 0 0 1 2-2h8\" />\n </svg>\n );\n}\n"
232
+ "content": "// Client (a timer, an observer). A terminal session played back: each command is typed at the prompt, its output\n// arrives line by line, the screen follows the last line like a real terminal. What a reader sees without the motion\n// is the session itself: the server renders it whole (no JavaScript, reduced motion and assistive technology all get\n// the full transcript), the screen has a fixed height (no layout shift while it plays), the replay starts when it\n// scrolls into view, waits while it is off screen, and pauses or replays on demand (WCAG 2.2.2). A bounded chain of\n// timeouts, never a permanent animation frame.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { warnDeprecated } from \"../deprecated\";\nimport { CheckGlyph, PauseGlyph, PlayGlyph, RetryGlyph } from \"../glyphs\";\n\n/** The colour of an output line — the tokens' text roles, all AA on the screen: secondary, accent, success, warning, danger. */\nexport type TerminalTone = \"muted\" | \"accent\" | \"success\" | \"warning\" | \"danger\";\n\nexport interface TerminalLine {\n /** The line as the program printed it (no colour codes). */\n text: string;\n /** Its colour, when the program coloured it. */\n tone?: TerminalTone;\n}\n\nexport interface TerminalStep {\n /** What is typed at the prompt (`npx sovkora install`). */\n command: string;\n /** What it printed, line by line. */\n output?: readonly (string | TerminalLine)[];\n}\n\nexport type TerminalReplayProps = Omit<React.ComponentProps<\"figure\">, \"children\" | \"title\"> & {\n /** The session, in order. */\n steps: readonly TerminalStep[];\n /** The accessible name of the screen (“Terminal session: install, start, dev”) — passed translated. */\n label: string;\n /** The window's title, shown in its bar (`~/projects — zsh`). */\n title?: React.ReactNode;\n /**\n * What the prompt shows before each command.\n * @default \"$\"\n */\n prompt?: string;\n /** The play button's words (the replay is waiting or paused). */\n playLabel: string;\n /** The pause button's words (the replay is running). */\n pauseLabel: string;\n /** The replay button's words (the session is shown whole). */\n replayLabel: string;\n /** The copy button's words: it copies the commands, one per line. Without it, no copy button. */\n copyLabel?: string;\n /** What the copy button says once the commands are copied (announced politely). */\n copiedLabel?: string;\n /**\n * Milliseconds per typed character.\n * @default 34\n */\n typingSpeed?: number;\n /**\n * Milliseconds between two output lines.\n * @default 70\n */\n lineDelay?: number;\n /**\n * Milliseconds between a command's last line and the next command.\n * @default 900\n */\n stepDelay?: number;\n /**\n * A multiplier on every delay (the motion vocabulary's `speed`): 2 plays twice as fast, 0.5 half as fast.\n * @default 1\n */\n speed?: number;\n /**\n * The screen's height, in lines; longer sessions scroll.\n * @default 18\n */\n rows?: number;\n /**\n * Plays the first time it scrolls into view. `false`: the session rests whole until the reader presses play.\n * @default true\n */\n autoPlay?: boolean;\n};\n\ntype Phase = \"final\" | \"idle\" | \"playing\" | \"paused\" | \"done\";\ninterface Position {\n step: number;\n chars: number;\n lines: number;\n}\n\nconst TONE: Record<TerminalTone, string> = {\n muted: \"text-fg-secondary\",\n accent: \"text-fg-accent\",\n success: \"text-fg-success\",\n warning: \"text-fg-warning\",\n danger: \"text-fg-danger\",\n};\n\nconst line = (entry: string | TerminalLine): TerminalLine => (typeof entry === \"string\" ? { text: entry } : entry);\n\n/** The next position of the replay and how long to wait for it; null at the end of the session. */\nfunction advance(steps: readonly TerminalStep[], pos: Position, timing: { typing: number; line: number; step: number }): [Position, number] | null {\n const current = steps[pos.step];\n if (!current) return null;\n const output = current.output ?? [];\n if (pos.chars < current.command.length) {\n // A space is a beat longer: the rhythm of someone typing, not of a printer.\n const pause = current.command[pos.chars] === \" \" ? timing.typing * 2 : timing.typing;\n return [{ ...pos, chars: pos.chars + 1 }, pause];\n }\n if (pos.lines < output.length) return [{ ...pos, lines: pos.lines + 1 }, pos.lines === 0 ? timing.line * 4 : timing.line];\n if (pos.step < steps.length - 1) return [{ step: pos.step + 1, chars: 0, lines: 0 }, timing.step];\n return null;\n}\n\n/**\n * A terminal session played back: commands typed at the prompt, their output line by line — or the whole session at rest.\n * @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.\n */\nexport function TerminalReplay({\n steps,\n label,\n title,\n prompt = \"$\",\n playLabel,\n pauseLabel,\n replayLabel,\n copyLabel,\n copiedLabel,\n typingSpeed = 34,\n lineDelay = 70,\n stepDelay = 900,\n speed = 1,\n rows = 18,\n autoPlay = true,\n className,\n style,\n ...props\n}: Readonly<TerminalReplayProps>) {\n warnDeprecated(\"terminal-replay\");\n const root = React.useRef<HTMLElement>(null);\n const screenRef = React.useRef<HTMLDivElement>(null);\n // The server renders the session whole; the client takes it over unless the reader asked for less motion.\n const [phase, setPhase] = React.useState<Phase>(\"final\");\n const [pos, setPos] = React.useState<Position>({ step: 0, chars: 0, lines: 0 });\n const [visible, setVisible] = React.useState(false);\n const [copied, setCopied] = React.useState(false);\n\n React.useEffect(() => {\n const el = root.current;\n if (!el || !autoPlay || globalThis.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n setPhase(\"idle\");\n // Starts the first time it is seen; off screen, it waits where it is.\n const io = new IntersectionObserver(\n ([entry]) => {\n const seen = Boolean(entry?.isIntersecting);\n setVisible(seen);\n if (seen) setPhase((current) => (current === \"idle\" ? \"playing\" : current));\n },\n { threshold: 0.35 },\n );\n io.observe(el);\n return () => io.disconnect();\n }, [autoPlay]);\n\n const rate = Math.max(0.1, speed);\n const timing = React.useMemo(() => ({ typing: typingSpeed / rate, line: lineDelay / rate, step: stepDelay / rate }), [typingSpeed, lineDelay, stepDelay, rate]);\n const ended = phase === \"playing\" && !advance(steps, pos, timing);\n // The end of the session is where the replay stands, not an event: derived, never set from an effect.\n const state: Phase = ended ? \"done\" : phase;\n\n React.useEffect(() => {\n if (phase !== \"playing\" || !visible) return;\n const next = advance(steps, pos, timing);\n if (!next) return;\n const timer = setTimeout(() => setPos(next[0]), next[1]);\n return () => clearTimeout(timer);\n }, [phase, visible, pos, steps, timing]);\n\n // The screen follows the last line while it plays, like a terminal.\n React.useEffect(() => {\n const el = screenRef.current;\n if (el && state === \"playing\") el.scrollTop = el.scrollHeight;\n }, [pos, state]);\n\n React.useEffect(() => {\n if (!copied) return;\n const timer = setTimeout(() => setCopied(false), 1800);\n return () => clearTimeout(timer);\n }, [copied]);\n\n const whole = state === \"final\" || state === \"done\";\n const shown = whole ? steps.length - 1 : pos.step;\n const toggle = () => {\n if (state === \"playing\") setPhase(\"paused\");\n else if (state === \"paused\" || state === \"idle\") setPhase(\"playing\");\n else {\n // Played on demand — also under reduced motion: the reader asked for it. Off screen it would wait: it is on screen.\n setVisible(true);\n setPos({ step: 0, chars: 0, lines: 0 });\n setPhase(\"playing\");\n }\n };\n const control =\n state === \"playing\"\n ? { text: pauseLabel, Glyph: PauseGlyph }\n : state === \"done\"\n ? { text: replayLabel, Glyph: RetryGlyph }\n : { text: playLabel, Glyph: PlayGlyph };\n const commands = steps.map((s) => s.command).join(\"\\n\");\n const transcript = steps.map((s) => [`${prompt} ${s.command}`, ...(s.output ?? []).map((o) => line(o).text)].join(\"\\n\")).join(\"\\n\\n\");\n\n return (\n <figure\n ref={root}\n data-state={state}\n data-autoplay={autoPlay ? \"\" : undefined}\n className={cn(\"kz-replay overflow-hidden rounded-xl border border-border-default bg-surface-1 shadow-md\", className)}\n style={{ \"--kz-replay-rows\": rows, ...style } as React.CSSProperties}\n {...props}\n >\n <figcaption className=\"flex items-center gap-3 border-b border-border-subtle bg-surface-2 px-3 py-2 text-xs text-fg-secondary\">\n <span aria-hidden className=\"flex shrink-0 gap-1.5\">\n <span className=\"h-2.5 w-2.5 rounded-full bg-border-strong\" />\n <span className=\"h-2.5 w-2.5 rounded-full bg-border-strong\" />\n <span className=\"h-2.5 w-2.5 rounded-full bg-border-strong\" />\n </span>\n <span className=\"min-w-0 flex-1 truncate font-mono\">{title}</span>\n <button\n type=\"button\"\n onClick={toggle}\n className=\"inline-flex shrink-0 items-center gap-1.5 rounded-md px-2 py-1 font-medium text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg focus-visible:outline-2 focus-visible:outline-ring\"\n >\n <control.Glyph className=\"h-3.5 w-3.5\" />\n {control.text}\n </button>\n {copyLabel && (\n <button\n type=\"button\"\n onClick={() => navigator.clipboard?.writeText(commands).then(() => setCopied(true))}\n data-copied={copied ? \"\" : undefined}\n className=\"inline-flex shrink-0 items-center gap-1.5 rounded-md px-2 py-1 font-medium text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg focus-visible:outline-2 focus-visible:outline-ring\"\n >\n {copied ? <CheckGlyph className=\"h-3.5 w-3.5\" /> : <CopyGlyph />}\n <span aria-live=\"polite\">{copied ? (copiedLabel ?? copyLabel) : copyLabel}</span>\n </button>\n )}\n </figcaption>\n <div\n ref={screenRef}\n role=\"region\"\n aria-label={label}\n tabIndex={0}\n className=\"kz-replay-screen relative overflow-auto bg-surface-0 px-4 py-3 font-mono text-[0.8125rem] leading-relaxed text-fg focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring\"\n >\n <div aria-hidden className=\"kz-replay-live\">\n {steps.slice(0, state === \"idle\" ? 0 : shown + 1).map((step, i) => {\n const current = !whole && i === shown;\n const typed = current ? step.command.slice(0, pos.chars) : step.command;\n const output = (step.output ?? []).slice(0, current ? pos.lines : undefined);\n const typing = current && pos.chars < step.command.length;\n return (\n <div key={i} className={i > 0 ? \"mt-3\" : undefined}>\n <div className=\"whitespace-pre\">\n <span className=\"text-fg-accent select-none\">{prompt} </span>\n <span className=\"font-medium\">{typed}</span>\n {typing && <span className=\"kz-replay-caret\" />}\n </div>\n {output.map((entry, j) => {\n const { text, tone } = line(entry);\n return (\n <div key={j} className={cn(\"min-h-[1lh] whitespace-pre\", tone ? TONE[tone] : \"text-fg\")}>\n {text}\n </div>\n );\n })}\n </div>\n );\n })}\n {(state === \"idle\" || whole) && (\n <div className={cn(\"whitespace-pre\", state !== \"idle\" && \"mt-3\")}>\n <span className=\"text-fg-accent select-none\">{prompt} </span>\n <span className=\"kz-replay-caret\" />\n </div>\n )}\n </div>\n <pre className=\"sr-only\">{transcript}</pre>\n </div>\n </figure>\n );\n}\n\n/** Two sheets, one over the other: copy. Drawn here, like the other glyphs of the primitives (decorative). */\nfunction CopyGlyph() {\n return (\n <svg viewBox=\"0 0 24 24\" className=\"h-3.5 w-3.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden focusable=\"false\">\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M5 15V6a2 2 0 0 1 2-2h8\" />\n </svg>\n );\n}\n"
233
233
  }
234
234
  ],
235
235
  "dependencies": [],
@@ -84,21 +84,21 @@
84
84
  "props": [
85
85
  {
86
86
  "name": "as",
87
- "type": "ElementType<any, keyof IntrinsicElements>",
87
+ "type": "any",
88
88
  "default": null,
89
89
  "description": "The element drawn: `h1`…`h6`, `p`, `span`, `div`.",
90
90
  "required": false
91
91
  },
92
92
  {
93
93
  "name": "className",
94
- "type": "string",
94
+ "type": "any",
95
95
  "default": null,
96
96
  "description": "Merged after the style's own class.",
97
97
  "required": false
98
98
  },
99
99
  {
100
100
  "name": "value",
101
- "type": "unknown",
101
+ "type": "any",
102
102
  "default": null,
103
103
  "description": "The stored text style — validated here: anything invalid draws the default.",
104
104
  "required": false
@@ -240,11 +240,11 @@
240
240
  },
241
241
  {
242
242
  "path": "text-style/styled-text.tsx",
243
- "content": "// Server-safe: a text drawn with a stored text style. Whatever is passed as `value` goes through `parseTextStyle`.\nimport * as React from \"react\";\n\nimport { cx } from \"../cx\";\nimport { textStyleProps } from \"./text-style\";\n\nexport type StyledTextProps<T extends React.ElementType = \"p\"> = {\n /** The element drawn: `h1`…`h6`, `p`, `span`, `div`. */\n as?: T;\n /** The stored text style — validated here: anything invalid draws the default. */\n value?: unknown;\n /** Merged after the style's own class. */\n className?: string;\n children?: React.ReactNode;\n} & Omit<React.ComponentPropsWithoutRef<T>, \"as\" | \"value\" | \"className\" | \"style\" | \"children\">;\n\n/** A text role drawn from a `TextStyle`: its font, size, weight, spacing, alignment, case and tone, all from CSS variables. */\nexport function StyledText<T extends React.ElementType = \"p\">({ as, value, className, children, ...rest }: StyledTextProps<T>) {\n const Tag: React.ElementType = as ?? \"p\";\n const props = textStyleProps(value);\n return (\n <Tag {...rest} className={cx(props.className, className)} style={props.style}>\n {children}\n </Tag>\n );\n}\n"
243
+ "content": "// Server-safe: a text drawn with a stored text style. Whatever is passed as `value` goes through `parseTextStyle`.\nimport * as React from \"react\";\n\nimport { cx } from \"../cx\";\nimport { textStyleProps } from \"./text-style\";\n\nexport type StyledTextProps<T extends React.ElementType = \"p\"> = {\n /** The element drawn: `h1`…`h6`, `p`, `span`, `div`. */\n as?: T;\n /** The stored text style — validated here: anything invalid draws the default. */\n value?: unknown;\n /** Merged after the style's own class. */\n className?: string;\n children?: React.ReactNode;\n} & Omit<React.ComponentPropsWithoutRef<T>, \"as\" | \"value\" | \"className\" | \"style\" | \"children\">;\n\n/** A text role drawn from a `TextStyle`: its font, size, weight, spacing, alignment, case and tone, all from CSS variables. */\nexport function StyledText<T extends React.ElementType = \"p\">({ as, value, className, children, ...rest }: Readonly<StyledTextProps<T>>) {\n const Tag: React.ElementType = as ?? \"p\";\n const props = textStyleProps(value);\n return (\n <Tag {...rest} className={cx(props.className, className)} style={props.style}>\n {children}\n </Tag>\n );\n}\n"
244
244
  },
245
245
  {
246
246
  "path": "text-style/text-style-picker.tsx",
247
- "content": "// Client (state, an observer). A control for the look of one text role — font, size, weight, spacing, alignment, case,\n// italic, tone — over the primitives: the font as a radio group whose options are drawn in their own face, the size as\n// a step slider, the choices as segmented radio groups, italic as a switch, the tone as swatches. It is controlled, shows\n// a live preview, and warns (never clamps) when the tone lacks contrast on the surface or body text is too small.\nimport { Button } from \"@krizaka/ui/button\";\nimport { RadioGroup } from \"@krizaka/ui/radio-group\";\nimport { Slider } from \"@krizaka/ui/slider\";\nimport { Switch } from \"@krizaka/ui/switch\";\nimport { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { cx } from \"../cx\";\nimport { StyledText } from \"./styled-text\";\nimport {\n type Align,\n aligns,\n type Case,\n cases,\n contrastRatio,\n type FontId,\n fontIds,\n fontVariable,\n fontWeights,\n isUnderMinimumSize,\n type Leading,\n leadings,\n parseColor,\n parseTextStyle,\n type SizeStep,\n sizeSteps,\n type TextStyle,\n type TextWeight,\n textWeights,\n type ToneId,\n toneIds,\n toneVariable,\n type Tracking,\n trackings,\n} from \"./text-style\";\n\n/** The controls of the picker, in the order they are drawn. */\nexport const textStyleFields = [\"font\", \"size\", \"weight\", \"leading\", \"tracking\", \"align\", \"case\", \"italic\", \"tone\"] as const;\nexport type TextStyleField = (typeof textStyleFields)[number];\n\nexport type TextStyleLabels = {\n /** The name of the whole control. */\n picker: string;\n font: string;\n size: string;\n weight: string;\n leading: string;\n tracking: string;\n align: string;\n case: string;\n italic: string;\n tone: string;\n presets: string;\n preview: string;\n fonts: Record<FontId, string>;\n weights: Record<TextWeight, string>;\n leadings: Record<Leading, string>;\n trackings: Record<Tracking, string>;\n aligns: Record<Align, string>;\n cases: Record<Case, string>;\n tones: Record<ToneId, string>;\n /** The contrast warning: `{ratio}` is what the tone reaches, `{min}` what it must. */\n contrastWarning: string;\n /** The small-text warning: `{size}` is the smallest step advised for body text. */\n minSizeWarning: string;\n};\n\n/** The English words. */\nexport const textStyleLabels: TextStyleLabels = {\n picker: \"Text style\",\n font: \"Font\",\n size: \"Size\",\n weight: \"Weight\",\n leading: \"Line height\",\n tracking: \"Letter spacing\",\n align: \"Alignment\",\n case: \"Case\",\n italic: \"Italic\",\n tone: \"Colour\",\n presets: \"Presets\",\n preview: \"Preview\",\n fonts: { display: \"Display\", text: \"Text\", mono: \"Typewriter\", cahier: \"Pen\" },\n weights: { 400: \"Regular\", 500: \"Medium\", 600: \"Semibold\", 700: \"Bold\" },\n leadings: { tight: \"Tight\", normal: \"Normal\", relaxed: \"Relaxed\" },\n trackings: { tight: \"Tight\", normal: \"Normal\", wide: \"Wide\" },\n aligns: { start: \"Start\", center: \"Centre\", end: \"End\" },\n cases: { none: \"Aa\", upper: \"AA\", \"small-caps\": \"Small caps\" },\n tones: { primary: \"Primary\", secondary: \"Secondary\", muted: \"Muted\", accent: \"Accent\" },\n contrastWarning: \"This colour reaches only {ratio}:1 on the background; {min}:1 is needed to read it comfortably.\",\n minSizeWarning: \"Body text under “{size}” is hard to read.\",\n};\n\n/** The French words. */\nexport const textStyleLabelsFr: TextStyleLabels = {\n picker: \"Style du texte\",\n font: \"Police\",\n size: \"Taille\",\n weight: \"Graisse\",\n leading: \"Interligne\",\n tracking: \"Espacement des lettres\",\n align: \"Alignement\",\n case: \"Casse\",\n italic: \"Italique\",\n tone: \"Couleur\",\n presets: \"Préréglages\",\n preview: \"Aperçu\",\n fonts: { display: \"Titre\", text: \"Texte\", mono: \"Machine à écrire\", cahier: \"Stylo\" },\n weights: { 400: \"Normal\", 500: \"Moyen\", 600: \"Demi-gras\", 700: \"Gras\" },\n leadings: { tight: \"Serré\", normal: \"Normal\", relaxed: \"Aéré\" },\n trackings: { tight: \"Serré\", normal: \"Normal\", wide: \"Large\" },\n aligns: { start: \"Début\", center: \"Centré\", end: \"Fin\" },\n cases: { none: \"Aa\", upper: \"AA\", \"small-caps\": \"Petites capitales\" },\n tones: { primary: \"Principale\", secondary: \"Secondaire\", muted: \"Discrète\", accent: \"Accent\" },\n contrastWarning: \"Cette couleur n’atteint que {ratio}:1 sur le fond ; {min}:1 est nécessaire pour la lire confortablement.\",\n minSizeWarning: \"Un texte courant sous « {size} » se lit mal.\",\n};\n\nexport type TextStylePreset = {\n /** A stable key. */\n id: string;\n /** The name on the button, passed translated (« Titre », « Prix »…). */\n label: string;\n /** The style it applies; what it does not say takes the default. Validated when applied. */\n value: Partial<TextStyle>;\n};\n\nexport type TextStylePickerProps = {\n /** The text style, controlled. Validated by `parseTextStyle`: anything invalid shows the default. */\n value: TextStyle;\n /** Called with the whole new text style at each change. */\n onChange: (value: TextStyle) => void;\n /** The sample the preview shows, passed translated (\"Boulangerie Martin\"). */\n previewText: string;\n /** Styles the person can start from, as data. */\n presets?: readonly TextStylePreset[];\n /** The controls to show, in the order of `textStyleFields` (just `[\"font\", \"size\"]`). A preset then changes only these. */\n fields?: readonly TextStyleField[];\n /** A denser form for a popover from a toolbar. */\n compact?: boolean;\n /** The words, passed translated: `textStyleLabels` (EN) or `textStyleLabelsFr`, or the host's own. */\n labels?: Partial<TextStyleLabels>;\n /** The colour the text will sit on, for the preview and the contrast check (a CSS colour). By default the page's own surface. */\n surface?: string;\n /**\n * What the text is for: `body` (reading text, which `minBodySize` guards) or `title` (a heading, which may be small).\n * @default \"body\"\n */\n role?: \"body\" | \"title\";\n /**\n * The smallest step advised for body text: under it, a warning shows — the size is never forced.\n * @default \"sm\"\n */\n minBodySize?: SizeStep;\n /** Merged last on the root. */\n className?: string;\n};\n\ntype Rgb = [number, number, number];\ntype Rgba = [number, number, number, number];\n\nfunction parseColorWithAlpha(text: string): Rgba | null {\n const value = text.trim().toLowerCase();\n if (value === \"transparent\") return [0, 0, 0, 0];\n const color = parseColor(value);\n if (!color) return null;\n\n const hex = /^#([0-9a-f]{4}|[0-9a-f]{8})$/.exec(value)?.[1];\n if (hex) {\n const alpha = hex.length === 4 ? Number.parseInt(hex[3]! + hex[3]!, 16) : Number.parseInt(hex.slice(6, 8), 16);\n return [...color, alpha / 255];\n }\n\n const components =\n /^rgba?\\(([^)]+)\\)$/.exec(value)?.[1] ??\n /^color\\(srgb\\s+([^)]+)\\)$/.exec(value)?.[1];\n if (!components) return [...color, 1];\n\n const [channels, slashAlpha] = components.split(\"/\");\n const parts = channels!.trim().split(/[\\s,]+/).filter(Boolean);\n const alpha = slashAlpha?.trim() ?? (parts.length === 4 ? parts[3] : undefined);\n if (alpha === undefined) return [...color, 1];\n const parsed = alpha.endsWith(\"%\") ? Number.parseFloat(alpha) / 100 : Number.parseFloat(alpha);\n return Number.isFinite(parsed) && parsed >= 0 && parsed <= 1 ? [...color, parsed] : null;\n}\n\nconst over = (foreground: Rgba, background: Rgba): Rgba => {\n const alpha = foreground[3] + background[3] * (1 - foreground[3]);\n if (alpha === 0) return [0, 0, 0, 0];\n return [\n (foreground[0] * foreground[3] + background[0] * background[3] * (1 - foreground[3])) / alpha,\n (foreground[1] * foreground[3] + background[1] * background[3] * (1 - foreground[3])) / alpha,\n (foreground[2] * foreground[3] + background[2] * background[3] * (1 - foreground[3])) / alpha,\n alpha,\n ];\n};\n\n/** The composited colour behind an element, or null when a background layer cannot be read. */\nfunction surfaceOf(element: HTMLElement): Rgb | null {\n const layers: HTMLElement[] = [];\n for (let node: HTMLElement | null = element; node; node = node.parentElement) {\n layers.push(node);\n if (node === document.documentElement) break;\n }\n let background: Rgba = [0, 0, 0, 0];\n for (const node of layers.reverse()) {\n const color = getComputedStyle(node).backgroundColor;\n const layer: Rgba | null = color ? parseColorWithAlpha(color) : [0, 0, 0, 0];\n if (!layer) return null;\n background = over(layer, background);\n }\n const [red, green, blue, alpha] = background;\n return alpha >= 1 ? [red, green, blue] : null;\n}\n\n/** What the tone reaches on its surface, measured on the preview as it is drawn (the theme and the product's tokens included). */\nfunction useContrast(ref: React.RefObject<HTMLElement | null>, key: string): { ratio: number; required: number } | null {\n const [measurement, setMeasurement] = React.useState<{ ratio: number; required: number } | null>(null);\n React.useEffect(() => {\n const element = ref.current;\n if (!element) return;\n const measure = () => {\n const sample = element.querySelector<HTMLElement>(\"[data-text-style-sample]\") ?? element;\n const computed = getComputedStyle(sample);\n const foreground = parseColor(computed.color);\n const background = surfaceOf(sample);\n const fontSize = Number.parseFloat(computed.fontSize);\n const fontWeight = Number.parseFloat(computed.fontWeight);\n const required = fontSize >= 24 || (fontSize >= 18.66 && fontWeight >= 700) ? 3 : 4.5;\n setMeasurement(foreground && background && Number.isFinite(fontSize) && Number.isFinite(fontWeight) ? { ratio: contrastRatio(foreground, background), required } : null);\n };\n measure();\n if (typeof MutationObserver === \"undefined\") return;\n const observer = new MutationObserver(measure);\n for (let node: HTMLElement | null = element; node; node = node.parentElement) {\n observer.observe(node, { attributes: true, attributeFilter: [\"class\", \"style\", \"data-theme\"] });\n if (node === document.documentElement) break;\n }\n return () => observer.disconnect();\n }, [ref, key]);\n return measurement;\n}\n\nconst nearest = (weights: readonly TextWeight[], weight: TextWeight): TextWeight =>\n weights.reduce((best, w) => (Math.abs(w - weight) < Math.abs(best - weight) ? w : best), weights[0]!);\n\n/** The control of a text style: font, size, weight, spacing, alignment, case, italic and tone, with a live preview. */\nexport function TextStylePicker({\n value,\n onChange,\n previewText,\n presets,\n fields = textStyleFields,\n compact,\n labels: given,\n surface,\n role = \"body\",\n minBodySize = \"sm\",\n className,\n}: TextStylePickerProps) {\n const labels = { ...textStyleLabels, ...given };\n const style = parseTextStyle(value);\n const shown = (field: TextStyleField) => fields.includes(field);\n const id = React.useId();\n const previewRef = React.useRef<HTMLDivElement>(null);\n const measurement = useContrast(previewRef, `${style.font}|${style.size}|${style.weight}|${style.tone}|${surface ?? \"\"}`);\n\n const set = (patch: Partial<TextStyle>) => onChange(parseTextStyle({ ...style, ...patch }));\n const setFont = (font: FontId) => set({ font, weight: nearest(fontWeights[font], style.weight) });\n const applyPreset = (preset: TextStylePreset) => {\n const next = parseTextStyle(preset.value);\n const patch = Object.fromEntries(textStyleFields.filter(shown).map((f) => [f, next[f]])) as Partial<TextStyle>;\n if (patch.font !== undefined || patch.weight !== undefined) {\n const font = patch.font ?? style.font;\n const weight = patch.weight ?? style.weight;\n set({ ...patch, weight: nearest(fontWeights[font], weight) });\n } else {\n set(patch);\n }\n };\n\n const warnings: string[] = [];\n if (measurement && measurement.ratio < measurement.required) {\n warnings.push(labels.contrastWarning.replace(\"{ratio}\", measurement.ratio.toFixed(1)).replace(\"{min}\", String(measurement.required)));\n }\n if (role === \"body\" && isUnderMinimumSize(style.size, minBodySize)) warnings.push(labels.minSizeWarning.replace(\"{size}\", minBodySize));\n\n const group = (field: TextStyleField, title: string, control: React.ReactNode, className?: string) => (\n <div key={field} className={cx(\"flex min-w-0 flex-col gap-2\", className)} data-field={field}>\n <span id={`${id}-${field}`} className=\"text-xs font-semibold text-fg-secondary\">\n {title}\n </span>\n {control}\n </div>\n );\n const segmented = <T extends string | number>(field: TextStyleField, title: string, items: readonly T[], current: T, text: (item: T) => string, choose: (item: T) => void, disabled?: (item: T) => boolean) =>\n group(\n field,\n title,\n <RadioGroup.Root variant=\"segmented\" aria-labelledby={`${id}-${field}`} value={String(current)} onValueChange={(next) => choose(items.find((item) => String(item) === next)!)} className=\"w-full max-w-full\">\n {items.map((item) => (\n <RadioGroup.Segment key={item} value={String(item)} disabled={disabled?.(item)} className=\"min-w-0 px-1 text-xs\">\n {text(item)}\n </RadioGroup.Segment>\n ))}\n </RadioGroup.Root>,\n \"sm:col-span-2\",\n );\n\n const controls: Record<TextStyleField, () => React.ReactNode> = {\n font: () =>\n group(\n \"font\",\n labels.font,\n <RadioGroup.Root variant=\"cards\" aria-labelledby={`${id}-font`} value={style.font} onValueChange={(next) => setFont(next as FontId)} className=\"grid-cols-[repeat(auto-fit,minmax(9rem,1fr))]\">\n {fontIds.map((font) => (\n <RadioGroup.Card key={font} value={font} style={{ fontFamily: fontVariable[font] }}>\n {labels.fonts[font]}\n </RadioGroup.Card>\n ))}\n </RadioGroup.Root>,\n ),\n size: () =>\n group(\n \"size\",\n labels.size,\n <Slider\n label={labels.size}\n min={0}\n max={sizeSteps.length - 1}\n step={1}\n ticks\n value={sizeSteps.indexOf(style.size)}\n onValueChange={(index) => set({ size: sizeSteps[index]! })}\n formatValue={(index) => sizeSteps[index]!}\n floatingValue\n />,\n ),\n weight: () => segmented(\"weight\", labels.weight, textWeights, style.weight, (w) => labels.weights[w], (weight) => set({ weight }), (w) => !fontWeights[style.font].includes(w)),\n leading: () => segmented(\"leading\", labels.leading, leadings, style.leading, (l) => labels.leadings[l], (leading) => set({ leading })),\n tracking: () => segmented(\"tracking\", labels.tracking, trackings, style.tracking, (t) => labels.trackings[t], (tracking) => set({ tracking })),\n align: () => segmented(\"align\", labels.align, aligns, style.align, (a) => labels.aligns[a], (align) => set({ align })),\n case: () => segmented(\"case\", labels.case, cases, style.case, (c) => labels.cases[c], (next) => set({ case: next })),\n italic: () => (\n <div key=\"italic\" className=\"flex min-w-0 items-center justify-between gap-3\" data-field=\"italic\">\n <span id={`${id}-italic`} className=\"text-xs font-semibold text-fg-secondary\">\n {labels.italic}\n </span>\n <Switch aria-labelledby={`${id}-italic`} checked={style.italic} onCheckedChange={(italic) => set({ italic })} />\n </div>\n ),\n tone: () =>\n group(\n \"tone\",\n labels.tone,\n <RadioGroupPrimitive.Root aria-labelledby={`${id}-tone`} value={style.tone} onValueChange={(next) => set({ tone: next as ToneId })} orientation=\"horizontal\" className=\"flex flex-wrap gap-3\">\n {toneIds.map((tone) => (\n <RadioGroupPrimitive.Item\n key={tone}\n value={tone}\n aria-label={labels.tones[tone]}\n title={labels.tones[tone]}\n style={{ backgroundColor: toneVariable(tone) }}\n className=\"h-8 w-8 rounded-full border border-border-strong focus-visible:outline-hidden focus-visible:focus-ring data-[state=checked]:ring-2 data-[state=checked]:ring-accent data-[state=checked]:ring-offset-2 data-[state=checked]:ring-offset-surface-0\"\n />\n ))}\n </RadioGroupPrimitive.Root>,\n ),\n };\n\n return (\n <div role=\"group\" aria-label={labels.picker} data-compact={compact ? \"\" : undefined} className={cx(\"flex min-w-0 flex-col\", compact ? \"gap-3\" : \"gap-5\", className)}>\n <div\n ref={previewRef}\n data-preview=\"\"\n aria-label={labels.preview}\n role=\"group\"\n style={surface ? { backgroundColor: surface } : undefined}\n className={cx(\"min-w-0 overflow-hidden rounded-xl border border-border-default\", surface ? \"\" : \"bg-surface-1\", compact ? \"p-3\" : \"p-5\")}\n >\n <StyledText as=\"p\" value={style} className=\"break-words\" data-text-style-sample=\"\">\n {previewText}\n </StyledText>\n </div>\n <div role=\"status\" aria-live=\"polite\" data-warnings=\"\">\n {warnings.map((warning) => (\n <p key={warning} className=\"text-xs font-medium text-fg-warning\">\n {warning}\n </p>\n ))}\n </div>\n {presets?.length ? (\n <div role=\"group\" aria-label={labels.presets} className=\"flex flex-wrap gap-2\">\n {presets.map((preset) => (\n <Button key={preset.id} type=\"button\" size=\"sm\" variant=\"outline\" onClick={() => applyPreset(preset)}>\n {preset.label}\n </Button>\n ))}\n </div>\n ) : null}\n <div className={cx(\"grid grid-cols-1 gap-x-6\", compact ? \"gap-y-3\" : \"gap-y-5 sm:grid-cols-2\")}>\n {textStyleFields.filter(shown).map((field) => (\n <React.Fragment key={field}>{controls[field]()}</React.Fragment>\n ))}\n </div>\n </div>\n );\n}\n"
247
+ "content": "// Client (state, an observer). A control for the look of one text role — font, size, weight, spacing, alignment, case,\n// italic, tone — over the primitives: the font as a radio group whose options are drawn in their own face, the size as\n// a step slider, the choices as segmented radio groups, italic as a switch, the tone as swatches. It is controlled, shows\n// a live preview, and warns (never clamps) when the tone lacks contrast on the surface or body text is too small.\nimport { Button } from \"@krizaka/ui/button\";\nimport { RadioGroup } from \"@krizaka/ui/radio-group\";\nimport { Slider } from \"@krizaka/ui/slider\";\nimport { Switch } from \"@krizaka/ui/switch\";\nimport { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { cx } from \"../cx\";\nimport { StyledText } from \"./styled-text\";\nimport {\n type Align,\n aligns,\n type Case,\n cases,\n contrastRatio,\n type FontId,\n fontIds,\n fontVariable,\n fontWeights,\n isUnderMinimumSize,\n type Leading,\n leadings,\n parseColor,\n parseTextStyle,\n type SizeStep,\n sizeSteps,\n type TextStyle,\n type TextWeight,\n textWeights,\n type ToneId,\n toneIds,\n toneVariable,\n type Tracking,\n trackings,\n} from \"./text-style\";\n\n/** The controls of the picker, in the order they are drawn. */\nexport const textStyleFields = [\"font\", \"size\", \"weight\", \"leading\", \"tracking\", \"align\", \"case\", \"italic\", \"tone\"] as const;\nexport type TextStyleField = (typeof textStyleFields)[number];\n\nexport type TextStyleLabels = {\n /** The name of the whole control. */\n picker: string;\n font: string;\n size: string;\n weight: string;\n leading: string;\n tracking: string;\n align: string;\n case: string;\n italic: string;\n tone: string;\n presets: string;\n preview: string;\n fonts: Record<FontId, string>;\n weights: Record<TextWeight, string>;\n leadings: Record<Leading, string>;\n trackings: Record<Tracking, string>;\n aligns: Record<Align, string>;\n cases: Record<Case, string>;\n tones: Record<ToneId, string>;\n /** The contrast warning: `{ratio}` is what the tone reaches, `{min}` what it must. */\n contrastWarning: string;\n /** The small-text warning: `{size}` is the smallest step advised for body text. */\n minSizeWarning: string;\n};\n\n/** The English words. */\nexport const textStyleLabels: TextStyleLabels = {\n picker: \"Text style\",\n font: \"Font\",\n size: \"Size\",\n weight: \"Weight\",\n leading: \"Line height\",\n tracking: \"Letter spacing\",\n align: \"Alignment\",\n case: \"Case\",\n italic: \"Italic\",\n tone: \"Colour\",\n presets: \"Presets\",\n preview: \"Preview\",\n fonts: { display: \"Display\", text: \"Text\", mono: \"Typewriter\", cahier: \"Pen\" },\n weights: { 400: \"Regular\", 500: \"Medium\", 600: \"Semibold\", 700: \"Bold\" },\n leadings: { tight: \"Tight\", normal: \"Normal\", relaxed: \"Relaxed\" },\n trackings: { tight: \"Tight\", normal: \"Normal\", wide: \"Wide\" },\n aligns: { start: \"Start\", center: \"Centre\", end: \"End\" },\n cases: { none: \"Aa\", upper: \"AA\", \"small-caps\": \"Small caps\" },\n tones: { primary: \"Primary\", secondary: \"Secondary\", muted: \"Muted\", accent: \"Accent\" },\n contrastWarning: \"This colour reaches only {ratio}:1 on the background; {min}:1 is needed to read it comfortably.\",\n minSizeWarning: \"Body text under “{size}” is hard to read.\",\n};\n\n/** The French words. */\nexport const textStyleLabelsFr: TextStyleLabels = {\n picker: \"Style du texte\",\n font: \"Police\",\n size: \"Taille\",\n weight: \"Graisse\",\n leading: \"Interligne\",\n tracking: \"Espacement des lettres\",\n align: \"Alignement\",\n case: \"Casse\",\n italic: \"Italique\",\n tone: \"Couleur\",\n presets: \"Préréglages\",\n preview: \"Aperçu\",\n fonts: { display: \"Titre\", text: \"Texte\", mono: \"Machine à écrire\", cahier: \"Stylo\" },\n weights: { 400: \"Normal\", 500: \"Moyen\", 600: \"Demi-gras\", 700: \"Gras\" },\n leadings: { tight: \"Serré\", normal: \"Normal\", relaxed: \"Aéré\" },\n trackings: { tight: \"Serré\", normal: \"Normal\", wide: \"Large\" },\n aligns: { start: \"Début\", center: \"Centré\", end: \"Fin\" },\n cases: { none: \"Aa\", upper: \"AA\", \"small-caps\": \"Petites capitales\" },\n tones: { primary: \"Principale\", secondary: \"Secondaire\", muted: \"Discrète\", accent: \"Accent\" },\n contrastWarning: \"Cette couleur n’atteint que {ratio}:1 sur le fond ; {min}:1 est nécessaire pour la lire confortablement.\",\n minSizeWarning: \"Un texte courant sous « {size} » se lit mal.\",\n};\n\nexport type TextStylePreset = {\n /** A stable key. */\n id: string;\n /** The name on the button, passed translated (« Titre », « Prix »…). */\n label: string;\n /** The style it applies; what it does not say takes the default. Validated when applied. */\n value: Partial<TextStyle>;\n};\n\nexport type TextStylePickerProps = {\n /** The text style, controlled. Validated by `parseTextStyle`: anything invalid shows the default. */\n value: TextStyle;\n /** Called with the whole new text style at each change. */\n onChange: (value: TextStyle) => void;\n /** The sample the preview shows, passed translated (\"Boulangerie Martin\"). */\n previewText: string;\n /** Styles the person can start from, as data. */\n presets?: readonly TextStylePreset[];\n /** The controls to show, in the order of `textStyleFields` (just `[\"font\", \"size\"]`). A preset then changes only these. */\n fields?: readonly TextStyleField[];\n /** A denser form for a popover from a toolbar. */\n compact?: boolean;\n /** The words, passed translated: `textStyleLabels` (EN) or `textStyleLabelsFr`, or the host's own. */\n labels?: Partial<TextStyleLabels>;\n /** The colour the text will sit on, for the preview and the contrast check (a CSS colour). By default the page's own surface. */\n surface?: string;\n /**\n * What the text is for: `body` (reading text, which `minBodySize` guards) or `title` (a heading, which may be small).\n * @default \"body\"\n */\n role?: \"body\" | \"title\";\n /**\n * The smallest step advised for body text: under it, a warning shows — the size is never forced.\n * @default \"sm\"\n */\n minBodySize?: SizeStep;\n /** Merged last on the root. */\n className?: string;\n};\n\ntype Rgb = [number, number, number];\ntype Rgba = [number, number, number, number];\n\nfunction parseColorWithAlpha(text: string): Rgba | null {\n const value = text.trim().toLowerCase();\n if (value === \"transparent\") return [0, 0, 0, 0];\n const color = parseColor(value);\n if (!color) return null;\n\n const hex = /^#([0-9a-f]{4}|[0-9a-f]{8})$/.exec(value)?.[1];\n if (hex) {\n const alpha = hex.length === 4 ? Number.parseInt(hex[3]! + hex[3]!, 16) : Number.parseInt(hex.slice(6, 8), 16);\n return [...color, alpha / 255];\n }\n\n const components =\n /^rgba?\\(([^)]+)\\)$/.exec(value)?.[1] ??\n /^color\\(srgb\\s+([^)]+)\\)$/.exec(value)?.[1];\n if (!components) return [...color, 1];\n\n const [channels, slashAlpha] = components.split(\"/\");\n const parts = channels!.trim().split(/[\\s,]+/).filter(Boolean);\n const alpha = slashAlpha?.trim() ?? (parts.length === 4 ? parts[3] : undefined);\n if (alpha === undefined) return [...color, 1];\n const parsed = alpha.endsWith(\"%\") ? Number.parseFloat(alpha) / 100 : Number.parseFloat(alpha);\n return Number.isFinite(parsed) && parsed >= 0 && parsed <= 1 ? [...color, parsed] : null;\n}\n\nconst over = (foreground: Rgba, background: Rgba): Rgba => {\n const alpha = foreground[3] + background[3] * (1 - foreground[3]);\n if (alpha === 0) return [0, 0, 0, 0];\n return [\n (foreground[0] * foreground[3] + background[0] * background[3] * (1 - foreground[3])) / alpha,\n (foreground[1] * foreground[3] + background[1] * background[3] * (1 - foreground[3])) / alpha,\n (foreground[2] * foreground[3] + background[2] * background[3] * (1 - foreground[3])) / alpha,\n alpha,\n ];\n};\n\n/** The composited colour behind an element, or null when a background layer cannot be read. */\nfunction surfaceOf(element: HTMLElement): Rgb | null {\n const layers: HTMLElement[] = [];\n for (let node: HTMLElement | null = element; node; node = node.parentElement) {\n layers.push(node);\n if (node === document.documentElement) break;\n }\n let background: Rgba = [0, 0, 0, 0];\n for (const node of layers.reverse()) {\n const color = getComputedStyle(node).backgroundColor;\n const layer: Rgba | null = color ? parseColorWithAlpha(color) : [0, 0, 0, 0];\n if (!layer) return null;\n background = over(layer, background);\n }\n const [red, green, blue, alpha] = background;\n return alpha >= 1 ? [red, green, blue] : null;\n}\n\n/** What the tone reaches on its surface, measured on the preview as it is drawn (the theme and the product's tokens included). */\nfunction useContrast(ref: React.RefObject<HTMLElement | null>, key: string): { ratio: number; required: number } | null {\n const [measurement, setMeasurement] = React.useState<{ ratio: number; required: number } | null>(null);\n React.useEffect(() => {\n const element = ref.current;\n if (!element) return;\n const measure = () => {\n const sample = element.querySelector<HTMLElement>(\"[data-text-style-sample]\") ?? element;\n const computed = getComputedStyle(sample);\n const foreground = parseColor(computed.color);\n const background = surfaceOf(sample);\n const fontSize = Number.parseFloat(computed.fontSize);\n const fontWeight = Number.parseFloat(computed.fontWeight);\n const required = fontSize >= 24 || (fontSize >= 18.66 && fontWeight >= 700) ? 3 : 4.5;\n setMeasurement(foreground && background && Number.isFinite(fontSize) && Number.isFinite(fontWeight) ? { ratio: contrastRatio(foreground, background), required } : null);\n };\n measure();\n if (typeof MutationObserver === \"undefined\") return;\n const observer = new MutationObserver(measure);\n for (let node: HTMLElement | null = element; node; node = node.parentElement) {\n observer.observe(node, { attributes: true, attributeFilter: [\"class\", \"style\", \"data-theme\"] });\n if (node === document.documentElement) break;\n }\n return () => observer.disconnect();\n }, [ref, key]);\n return measurement;\n}\n\nconst nearest = (weights: readonly TextWeight[], weight: TextWeight): TextWeight =>\n weights.reduce((best, w) => (Math.abs(w - weight) < Math.abs(best - weight) ? w : best), weights[0]!);\n\n/** The control of a text style: font, size, weight, spacing, alignment, case, italic and tone, with a live preview. */\nexport function TextStylePicker({\n value,\n onChange,\n previewText,\n presets,\n fields = textStyleFields,\n compact,\n labels: given,\n surface,\n role = \"body\",\n minBodySize = \"sm\",\n className,\n}: Readonly<TextStylePickerProps>) {\n const labels = { ...textStyleLabels, ...given };\n const style = parseTextStyle(value);\n const shown = (field: TextStyleField) => fields.includes(field);\n const id = React.useId();\n const previewRef = React.useRef<HTMLDivElement>(null);\n const measurement = useContrast(previewRef, `${style.font}|${style.size}|${style.weight}|${style.tone}|${surface ?? \"\"}`);\n\n const set = (patch: Partial<TextStyle>) => onChange(parseTextStyle({ ...style, ...patch }));\n const setFont = (font: FontId) => set({ font, weight: nearest(fontWeights[font], style.weight) });\n const applyPreset = (preset: TextStylePreset) => {\n const next = parseTextStyle(preset.value);\n const patch = Object.fromEntries(textStyleFields.filter(shown).map((f) => [f, next[f]])) as Partial<TextStyle>;\n if (patch.font !== undefined || patch.weight !== undefined) {\n const font = patch.font ?? style.font;\n const weight = patch.weight ?? style.weight;\n set({ ...patch, weight: nearest(fontWeights[font], weight) });\n } else {\n set(patch);\n }\n };\n\n const warnings: string[] = [];\n if (measurement && measurement.ratio < measurement.required) {\n warnings.push(labels.contrastWarning.replace(\"{ratio}\", measurement.ratio.toFixed(1)).replace(\"{min}\", String(measurement.required)));\n }\n if (role === \"body\" && isUnderMinimumSize(style.size, minBodySize)) warnings.push(labels.minSizeWarning.replace(\"{size}\", minBodySize));\n\n const group = (field: TextStyleField, title: string, control: React.ReactNode, className?: string) => (\n <div key={field} className={cx(\"flex min-w-0 flex-col gap-2\", className)} data-field={field}>\n <span id={`${id}-${field}`} className=\"text-xs font-semibold text-fg-secondary\">\n {title}\n </span>\n {control}\n </div>\n );\n const segmented = <T extends string | number>(field: TextStyleField, title: string, items: readonly T[], current: T, text: (item: T) => string, choose: (item: T) => void, disabled?: (item: T) => boolean) =>\n group(\n field,\n title,\n <RadioGroup.Root variant=\"segmented\" aria-labelledby={`${id}-${field}`} value={String(current)} onValueChange={(next) => choose(items.find((item) => String(item) === next)!)} className=\"w-full max-w-full\">\n {items.map((item) => (\n <RadioGroup.Segment key={item} value={String(item)} disabled={disabled?.(item)} className=\"min-w-0 px-1 text-xs\">\n {text(item)}\n </RadioGroup.Segment>\n ))}\n </RadioGroup.Root>,\n \"sm:col-span-2\",\n );\n\n const controls: Record<TextStyleField, () => React.ReactNode> = {\n font: () =>\n group(\n \"font\",\n labels.font,\n <RadioGroup.Root variant=\"cards\" aria-labelledby={`${id}-font`} value={style.font} onValueChange={(next) => setFont(next as FontId)} className=\"grid-cols-[repeat(auto-fit,minmax(9rem,1fr))]\">\n {fontIds.map((font) => (\n <RadioGroup.Card key={font} value={font} style={{ fontFamily: fontVariable[font] }}>\n {labels.fonts[font]}\n </RadioGroup.Card>\n ))}\n </RadioGroup.Root>,\n ),\n size: () =>\n group(\n \"size\",\n labels.size,\n <Slider\n label={labels.size}\n min={0}\n max={sizeSteps.length - 1}\n step={1}\n ticks\n value={sizeSteps.indexOf(style.size)}\n onValueChange={(index) => set({ size: sizeSteps[index]! })}\n formatValue={(index) => sizeSteps[index]!}\n floatingValue\n />,\n ),\n weight: () => segmented(\"weight\", labels.weight, textWeights, style.weight, (w) => labels.weights[w], (weight) => set({ weight }), (w) => !fontWeights[style.font].includes(w)),\n leading: () => segmented(\"leading\", labels.leading, leadings, style.leading, (l) => labels.leadings[l], (leading) => set({ leading })),\n tracking: () => segmented(\"tracking\", labels.tracking, trackings, style.tracking, (t) => labels.trackings[t], (tracking) => set({ tracking })),\n align: () => segmented(\"align\", labels.align, aligns, style.align, (a) => labels.aligns[a], (align) => set({ align })),\n case: () => segmented(\"case\", labels.case, cases, style.case, (c) => labels.cases[c], (next) => set({ case: next })),\n italic: () => (\n <div key=\"italic\" className=\"flex min-w-0 items-center justify-between gap-3\" data-field=\"italic\">\n <span id={`${id}-italic`} className=\"text-xs font-semibold text-fg-secondary\">\n {labels.italic}\n </span>\n <Switch aria-labelledby={`${id}-italic`} checked={style.italic} onCheckedChange={(italic) => set({ italic })} />\n </div>\n ),\n tone: () =>\n group(\n \"tone\",\n labels.tone,\n <RadioGroupPrimitive.Root aria-labelledby={`${id}-tone`} value={style.tone} onValueChange={(next) => set({ tone: next as ToneId })} orientation=\"horizontal\" className=\"flex flex-wrap gap-3\">\n {toneIds.map((tone) => (\n <RadioGroupPrimitive.Item\n key={tone}\n value={tone}\n aria-label={labels.tones[tone]}\n title={labels.tones[tone]}\n style={{ backgroundColor: toneVariable(tone) }}\n className=\"h-8 w-8 rounded-full border border-border-strong focus-visible:outline-hidden focus-visible:focus-ring data-[state=checked]:ring-2 data-[state=checked]:ring-accent data-[state=checked]:ring-offset-2 data-[state=checked]:ring-offset-surface-0\"\n />\n ))}\n </RadioGroupPrimitive.Root>,\n ),\n };\n\n return (\n <div role=\"group\" aria-label={labels.picker} data-compact={compact ? \"\" : undefined} className={cx(\"flex min-w-0 flex-col\", compact ? \"gap-3\" : \"gap-5\", className)}>\n <div\n ref={previewRef}\n data-preview=\"\"\n aria-label={labels.preview}\n role=\"group\"\n style={surface ? { backgroundColor: surface } : undefined}\n className={cx(\"min-w-0 overflow-hidden rounded-xl border border-border-default\", surface ? \"\" : \"bg-surface-1\", compact ? \"p-3\" : \"p-5\")}\n >\n <StyledText as=\"p\" value={style} className=\"break-words\" data-text-style-sample=\"\">\n {previewText}\n </StyledText>\n </div>\n <div role=\"status\" aria-live=\"polite\" data-warnings=\"\">\n {warnings.map((warning) => (\n <p key={warning} className=\"text-xs font-medium text-fg-warning\">\n {warning}\n </p>\n ))}\n </div>\n {presets?.length ? (\n <div role=\"group\" aria-label={labels.presets} className=\"flex flex-wrap gap-2\">\n {presets.map((preset) => (\n <Button key={preset.id} type=\"button\" size=\"sm\" variant=\"outline\" onClick={() => applyPreset(preset)}>\n {preset.label}\n </Button>\n ))}\n </div>\n ) : null}\n <div className={cx(\"grid grid-cols-1 gap-x-6\", compact ? \"gap-y-3\" : \"gap-y-5 sm:grid-cols-2\")}>\n {textStyleFields.filter(shown).map((field) => (\n <React.Fragment key={field}>{controls[field]()}</React.Fragment>\n ))}\n </div>\n </div>\n );\n}\n"
248
248
  },
249
249
  {
250
250
  "path": "text-style/text-style.ts",
@@ -272,21 +272,21 @@
272
272
  "props": [
273
273
  {
274
274
  "name": "as",
275
- "type": "ElementType<any, keyof IntrinsicElements>",
275
+ "type": "any",
276
276
  "default": null,
277
277
  "description": "The element drawn: `h1`…`h6`, `p`, `span`, `div`.",
278
278
  "required": false
279
279
  },
280
280
  {
281
281
  "name": "className",
282
- "type": "string",
282
+ "type": "any",
283
283
  "default": null,
284
284
  "description": "Merged after the style's own class.",
285
285
  "required": false
286
286
  },
287
287
  {
288
288
  "name": "value",
289
- "type": "unknown",
289
+ "type": "any",
290
290
  "default": null,
291
291
  "description": "The stored text style — validated here: anything invalid draws the default.",
292
292
  "required": false
@@ -232,7 +232,7 @@
232
232
  },
233
233
  {
234
234
  "path": "theme/theme.tsx",
235
- "content": "// Client. ONE mechanism for the whole organisation: dark by default, `html.light` for light, `html.theme-<name>` for a\n// named theme, persisted in localStorage (`kz-theme` for the mode, `kz-theme-name` for the named theme).\nimport * as React from \"react\";\n\nimport { type ButtonVariants, buttonVariants } from \"../button/button\";\n\nexport type Mode = \"dark\" | \"light\" | \"system\";\n\nconst MODE_KEY = \"kz-theme\";\nconst NAME_KEY = \"kz-theme-name\";\nconst ACCENT_KEY = \"kz-accent\";\nconst DENSITY_KEY = \"kz-density\";\nconst MODES: readonly Mode[] = [\"dark\", \"light\", \"system\"];\nconst DARK_QUERY = \"(prefers-color-scheme: dark)\";\n\nconst isMode = (value: unknown): value is Mode => MODES.includes(value as Mode);\n\n// Storage blocked (private mode, sandbox): the choice lives in memory for the page.\nconst memory = new Map<string, string>();\n\nfunction read(key: string): string | null {\n try {\n return localStorage.getItem(key);\n } catch {\n return memory.get(key) ?? null;\n }\n}\n\nfunction write(key: string, value: string | null) {\n if (value === null) memory.delete(key);\n else memory.set(key, value);\n try {\n if (value === null) localStorage.removeItem(key);\n else localStorage.setItem(key, value);\n } catch {\n // storage blocked: memory holds it\n }\n}\n\n// The persisted choice is an external store: every provider and tab reads the same value, the server reads none.\nconst listeners = new Set<() => void>();\nconst notify = () => listeners.forEach((listener) => listener());\nfunction subscribe(listener: () => void) {\n listeners.add(listener);\n window.addEventListener(\"storage\", listener);\n return () => {\n listeners.delete(listener);\n window.removeEventListener(\"storage\", listener);\n };\n}\n\nfunction applyMode(mode: Mode) {\n const dark = window.matchMedia(DARK_QUERY).matches;\n document.documentElement.classList.toggle(\"light\", mode === \"light\" || (mode === \"system\" && !dark));\n}\n\nfunction applyName(previous: string | null, next: string | null) {\n const classes = document.documentElement.classList;\n if (previous) classes.remove(`theme-${previous}`);\n if (next) classes.add(`theme-${next}`);\n}\n\nexport type ThemeScriptProps = {\n /** The nonce of a strict Content-Security-Policy (`script-src 'nonce-…'`). */\n nonce?: string;\n /**\n * The mode before the visitor chooses one — pass the same value as `ThemeProvider`'s `defaultMode`. A persisted\n * choice (`kz-theme`) always wins.\n * @default \"system\"\n */\n defaultMode?: Mode;\n};\n\n/** The readable flag cookie of a session (`kz-session=1`, kept by `@krizaka/auth`): a hint, never the proof. */\nconst SESSION_HINT_COOKIE = \"kz-session\";\n\n/**\n * In <head>, before anything renders: applies the persisted mode (else `defaultMode`) and named theme, so the page\n * never flashes. It also sets `html[data-session]` when the readable `kz-session` hint cookie says a session exists, so\n * `blocks.css` hides the bar's signed-out-only actions from the first paint (krizaka-ui#827). `nonce` for a strict\n * Content-Security-Policy.\n */\nexport function ThemeScript({ nonce, defaultMode = \"system\" }: ThemeScriptProps) {\n const fallback = isMode(defaultMode) ? defaultMode : \"system\";\n const js =\n `(function(){try{if(/(?:^|;\\\\s*)${SESSION_HINT_COOKIE}=1(?:;|$)/.test(document.cookie))document.documentElement.setAttribute(\"data-session\",\"\")}catch(e){}try{var m=localStorage.getItem(\"${MODE_KEY}\");if(m!==\"dark\"&&m!==\"light\"&&m!==\"system\")m=\"${fallback}\";` +\n `var n=localStorage.getItem(\"${NAME_KEY}\");var d=matchMedia(\"${DARK_QUERY}\").matches;var c=document.documentElement.classList;` +\n `c.toggle(\"light\",m===\"light\"||(m===\"system\"&&!d));if(n)c.add(\"theme-\"+n);var a=localStorage.getItem(\"${ACCENT_KEY}\");if(a)document.documentElement.setAttribute(\"data-accent\",a);var y=localStorage.getItem(\"${DENSITY_KEY}\");if(y)document.documentElement.setAttribute(\"data-density\",y)}catch(e){}})()`;\n return <script nonce={nonce} dangerouslySetInnerHTML={{ __html: js }} />;\n}\n\nexport type ThemeContextValue = {\n /** The chosen mode: dark, light or follow the system. */\n mode: Mode;\n setMode: (mode: Mode) => void;\n /** The named theme (`html.theme-<name>`), or null. */\n theme: string | null;\n setTheme: (theme: string | null) => void;\n};\n\nconst ThemeContext = React.createContext<ThemeContextValue | null>(null);\n\nexport type ThemeProviderProps = {\n children: React.ReactNode;\n /**\n * The mode before the visitor chooses one (nothing persisted as `kz-theme`) — pass the same value to `ThemeScript`.\n * @default \"system\"\n */\n defaultMode?: Mode;\n};\n\nexport function ThemeProvider({ children, defaultMode = \"system\" }: ThemeProviderProps) {\n // Before hydration the server knows nothing persisted (ThemeScript has already applied it to <html>).\n const stored = React.useSyncExternalStore(subscribe, () => read(MODE_KEY), () => null);\n const mode: Mode = isMode(stored) ? stored : defaultMode;\n const theme = React.useSyncExternalStore(subscribe, () => read(NAME_KEY), () => null);\n\n // The same resolution as ThemeScript (a no-op after it), for an app that renders the provider without the script.\n React.useEffect(() => {\n const persisted = read(MODE_KEY);\n applyMode(isMode(persisted) ? persisted : defaultMode);\n }, [defaultMode]);\n\n // \"system\" follows the operating system while the page is open.\n React.useEffect(() => {\n if (mode !== \"system\") return;\n const query = window.matchMedia(DARK_QUERY);\n const onChange = () => applyMode(\"system\");\n query.addEventListener?.(\"change\", onChange);\n return () => query.removeEventListener?.(\"change\", onChange);\n }, [mode]);\n\n const setMode = React.useCallback((next: Mode) => {\n write(MODE_KEY, next);\n applyMode(next);\n notify();\n }, []);\n\n const setTheme = React.useCallback((next: string | null) => {\n applyName(read(NAME_KEY), next);\n write(NAME_KEY, next);\n notify();\n }, []);\n\n const value = React.useMemo(() => ({ mode, setMode, theme, setTheme }), [mode, setMode, theme, setTheme]);\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n\n/** The theme context, or `null` outside a `ThemeProvider` (a frame that offers the theme only when the app has one). */\nexport function useOptionalTheme(): ThemeContextValue | null {\n return React.useContext(ThemeContext);\n}\n\nexport function useTheme(): ThemeContextValue {\n const context = React.useContext(ThemeContext);\n if (!context) throw new Error(\"useTheme: wrap the app in <ThemeProvider>\");\n return context;\n}\n\nconst ICONS: Record<Mode, React.ReactNode> = {\n dark: <path d=\"M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5Z\" />,\n light: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4\" />\n </>\n ),\n system: (\n <>\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"12\" rx=\"2\" />\n <path d=\"M8 20h8M12 16v4\" />\n </>\n ),\n};\n\nexport type ThemeToggleProps = Omit<React.ComponentProps<\"button\">, \"onClick\" | \"children\"> &\n Pick<ButtonVariants, \"variant\" | \"shape\"> & {\n /** Any `Button` variant. */\n variant?: ButtonVariants[\"variant\"];\n /**\n * rounded · pill.\n * @default \"rounded\"\n */\n shape?: ButtonVariants[\"shape\"];\n /** The accessible name — a string, or one per current mode (e.g. `(mode) => t(\"theme.\" + mode)`). */\n label: string | ((mode: Mode) => string);\n };\n\n/**\n * An icon button (styled as `IconButton`, without its Slot) that cycles dark → light → system. Needs a\n * <ThemeProvider> above it. State: `data-mode`.\n */\nexport function ThemeToggle({ label, variant = \"ghost\", shape, className, ...props }: ThemeToggleProps) {\n const { mode, setMode } = useTheme();\n const next = MODES[(MODES.indexOf(mode) + 1) % MODES.length] as Mode;\n const name = typeof label === \"function\" ? label(mode) : label;\n return (\n <button\n type=\"button\"\n aria-label={name}\n title={name}\n data-mode={mode}\n onClick={() => setMode(next)}\n className={buttonVariants({ variant, shape, size: \"icon\", className })}\n {...props}\n >\n <svg viewBox=\"0 0 24 24\" className=\"h-5 w-5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n {ICONS[mode]}\n </svg>\n </button>\n );\n}\n\n/** The choices of the Appearance block (ADR-006 §4): the theme (`system · light · dark`, then a surface set), the accent, the density. */\nexport type AppearanceState = {\n /** `system`, `light`, `dark`, or the surface set (`blueprint`, `carbone`) — which is dark. */\n themeId: string;\n setThemeId: (id: string) => void;\n /** A brand's accent (`data-accent` on `<html>`), or null: the product's own. */\n accent: string | null;\n setAccent: (accent: string | null) => void;\n /** `standard` or `compact` (`data-density` on `<html>`, the token layer: rows and gaps one step down). */\n density: string;\n setDensity: (density: string) => void;\n};\n\nfunction applyAttribute(name: string, value: string | null) {\n if (value === null) document.documentElement.removeAttribute(name);\n else document.documentElement.setAttribute(name, value);\n}\n\n/**\n * The state of the Appearance block, applied at once and kept in the browser (`kz-theme`, `kz-theme-name`, `kz-accent`,\n * `kz-density`; `ThemeScript` restores them before paint). A product with an account also saves what `onChange` of the block\n * reports, so the choice follows the person. Needs a `ThemeProvider`.\n * @param surfaceSets the themes that are a dark surface set (default `blueprint`, `carbone`)\n */\nexport function useAppearance(surfaceSets: readonly string[] = [\"blueprint\", \"carbone\"]): AppearanceState {\n const { mode, setMode, theme, setTheme } = useTheme();\n const accent = React.useSyncExternalStore(subscribe, () => read(ACCENT_KEY), () => null);\n const density = React.useSyncExternalStore(subscribe, () => read(DENSITY_KEY), () => null) ?? \"standard\";\n const themeId = theme && surfaceSets.includes(theme) && mode === \"dark\" ? theme : mode;\n const setThemeId = React.useCallback(\n (id: string) => {\n if (surfaceSets.includes(id)) {\n setMode(\"dark\");\n setTheme(id);\n } else {\n setTheme(null);\n setMode(id as Mode);\n }\n },\n [setMode, setTheme, surfaceSets],\n );\n const setAccent = React.useCallback((next: string | null) => {\n applyAttribute(\"data-accent\", next);\n write(ACCENT_KEY, next);\n notify();\n }, []);\n const setDensity = React.useCallback((next: string) => {\n applyAttribute(\"data-density\", next === \"standard\" ? null : next);\n write(DENSITY_KEY, next === \"standard\" ? null : next);\n notify();\n }, []);\n return { themeId, setThemeId, accent, setAccent, density, setDensity };\n}\n"
235
+ "content": "// Client. ONE mechanism for the whole organisation: dark by default, `html.light` for light, `html.theme-<name>` for a\n// named theme, persisted in localStorage (`kz-theme` for the mode, `kz-theme-name` for the named theme).\nimport * as React from \"react\";\n\nimport { type ButtonVariants, buttonVariants } from \"../button/button\";\n\nexport type Mode = \"dark\" | \"light\" | \"system\";\n\nconst MODE_KEY = \"kz-theme\";\nconst NAME_KEY = \"kz-theme-name\";\nconst ACCENT_KEY = \"kz-accent\";\nconst DENSITY_KEY = \"kz-density\";\nconst MODES: readonly Mode[] = [\"dark\", \"light\", \"system\"];\nconst DARK_QUERY = \"(prefers-color-scheme: dark)\";\n\nconst isMode = (value: unknown): value is Mode => MODES.includes(value as Mode);\n\n// Storage blocked (private mode, sandbox): the choice lives in memory for the page.\nconst memory = new Map<string, string>();\n\nfunction read(key: string): string | null {\n try {\n return localStorage.getItem(key);\n } catch {\n return memory.get(key) ?? null;\n }\n}\n\nfunction write(key: string, value: string | null) {\n if (value === null) memory.delete(key);\n else memory.set(key, value);\n try {\n if (value === null) localStorage.removeItem(key);\n else localStorage.setItem(key, value);\n } catch {\n // storage blocked: memory holds it\n }\n}\n\n// The persisted choice is an external store: every provider and tab reads the same value, the server reads none.\nconst listeners = new Set<() => void>();\nconst notify = () => listeners.forEach((listener) => listener());\nfunction subscribe(listener: () => void) {\n listeners.add(listener);\n window.addEventListener(\"storage\", listener);\n return () => {\n listeners.delete(listener);\n window.removeEventListener(\"storage\", listener);\n };\n}\n\nfunction applyMode(mode: Mode) {\n const dark = window.matchMedia(DARK_QUERY).matches;\n document.documentElement.classList.toggle(\"light\", mode === \"light\" || (mode === \"system\" && !dark));\n}\n\nfunction applyName(previous: string | null, next: string | null) {\n const classes = document.documentElement.classList;\n if (previous) classes.remove(`theme-${previous}`);\n if (next) classes.add(`theme-${next}`);\n}\n\nexport type ThemeScriptProps = {\n /** The nonce of a strict Content-Security-Policy (`script-src 'nonce-…'`). */\n nonce?: string;\n /**\n * The mode before the visitor chooses one — pass the same value as `ThemeProvider`'s `defaultMode`. A persisted\n * choice (`kz-theme`) always wins.\n * @default \"system\"\n */\n defaultMode?: Mode;\n};\n\n/** The readable flag cookie of a session (`kz-session=1`, kept by `@krizaka/auth`): a hint, never the proof. */\nconst SESSION_HINT_COOKIE = \"kz-session\";\n\n/**\n * In <head>, before anything renders: applies the persisted mode (else `defaultMode`) and named theme, so the page\n * never flashes. It also sets `html[data-session]` when the readable `kz-session` hint cookie says a session exists, so\n * `blocks.css` hides the bar's signed-out-only actions from the first paint (krizaka-ui#827). `nonce` for a strict\n * Content-Security-Policy.\n */\nexport function ThemeScript({ nonce, defaultMode = \"system\" }: Readonly<ThemeScriptProps>) {\n const fallback = isMode(defaultMode) ? defaultMode : \"system\";\n const js =\n `(function(){try{if(/(?:^|;\\\\s*)${SESSION_HINT_COOKIE}=1(?:;|$)/.test(document.cookie))document.documentElement.setAttribute(\"data-session\",\"\")}catch(e){}try{var m=localStorage.getItem(\"${MODE_KEY}\");if(m!==\"dark\"&&m!==\"light\"&&m!==\"system\")m=\"${fallback}\";` +\n `var n=localStorage.getItem(\"${NAME_KEY}\");var d=matchMedia(\"${DARK_QUERY}\").matches;var c=document.documentElement.classList;` +\n `c.toggle(\"light\",m===\"light\"||(m===\"system\"&&!d));if(n)c.add(\"theme-\"+n);var a=localStorage.getItem(\"${ACCENT_KEY}\");if(a)document.documentElement.setAttribute(\"data-accent\",a);var y=localStorage.getItem(\"${DENSITY_KEY}\");if(y)document.documentElement.setAttribute(\"data-density\",y)}catch(e){}})()`;\n return <script nonce={nonce} dangerouslySetInnerHTML={{ __html: js }} />;\n}\n\nexport type ThemeContextValue = {\n /** The chosen mode: dark, light or follow the system. */\n mode: Mode;\n setMode: (mode: Mode) => void;\n /** The named theme (`html.theme-<name>`), or null. */\n theme: string | null;\n setTheme: (theme: string | null) => void;\n};\n\nconst ThemeContext = React.createContext<ThemeContextValue | null>(null);\n\nexport type ThemeProviderProps = {\n children: React.ReactNode;\n /**\n * The mode before the visitor chooses one (nothing persisted as `kz-theme`) — pass the same value to `ThemeScript`.\n * @default \"system\"\n */\n defaultMode?: Mode;\n};\n\nexport function ThemeProvider({ children, defaultMode = \"system\" }: Readonly<ThemeProviderProps>) {\n // Before hydration the server knows nothing persisted (ThemeScript has already applied it to <html>).\n const stored = React.useSyncExternalStore(subscribe, () => read(MODE_KEY), () => null);\n const mode: Mode = isMode(stored) ? stored : defaultMode;\n const theme = React.useSyncExternalStore(subscribe, () => read(NAME_KEY), () => null);\n\n // The same resolution as ThemeScript (a no-op after it), for an app that renders the provider without the script.\n React.useEffect(() => {\n const persisted = read(MODE_KEY);\n applyMode(isMode(persisted) ? persisted : defaultMode);\n }, [defaultMode]);\n\n // \"system\" follows the operating system while the page is open.\n React.useEffect(() => {\n if (mode !== \"system\") return;\n const query = window.matchMedia(DARK_QUERY);\n const onChange = () => applyMode(\"system\");\n query.addEventListener?.(\"change\", onChange);\n return () => query.removeEventListener?.(\"change\", onChange);\n }, [mode]);\n\n const setMode = React.useCallback((next: Mode) => {\n write(MODE_KEY, next);\n applyMode(next);\n notify();\n }, []);\n\n const setTheme = React.useCallback((next: string | null) => {\n applyName(read(NAME_KEY), next);\n write(NAME_KEY, next);\n notify();\n }, []);\n\n const value = React.useMemo(() => ({ mode, setMode, theme, setTheme }), [mode, setMode, theme, setTheme]);\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n\n/** The theme context, or `null` outside a `ThemeProvider` (a frame that offers the theme only when the app has one). */\nexport function useOptionalTheme(): ThemeContextValue | null {\n return React.useContext(ThemeContext);\n}\n\nexport function useTheme(): ThemeContextValue {\n const context = React.useContext(ThemeContext);\n if (!context) throw new Error(\"useTheme: wrap the app in <ThemeProvider>\");\n return context;\n}\n\nconst ICONS: Record<Mode, React.ReactNode> = {\n dark: <path d=\"M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5Z\" />,\n light: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4\" />\n </>\n ),\n system: (\n <>\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"12\" rx=\"2\" />\n <path d=\"M8 20h8M12 16v4\" />\n </>\n ),\n};\n\nexport type ThemeToggleProps = Omit<React.ComponentProps<\"button\">, \"onClick\" | \"children\"> &\n Pick<ButtonVariants, \"variant\" | \"shape\"> & {\n /** Any `Button` variant. */\n variant?: ButtonVariants[\"variant\"];\n /**\n * rounded · pill.\n * @default \"rounded\"\n */\n shape?: ButtonVariants[\"shape\"];\n /** The accessible name — a string, or one per current mode (e.g. `(mode) => t(\"theme.\" + mode)`). */\n label: string | ((mode: Mode) => string);\n };\n\n/**\n * An icon button (styled as `IconButton`, without its Slot) that cycles dark → light → system. Needs a\n * <ThemeProvider> above it. State: `data-mode`.\n */\nexport function ThemeToggle({ label, variant = \"ghost\", shape, className, ...props }: Readonly<ThemeToggleProps>) {\n const { mode, setMode } = useTheme();\n const next = MODES[(MODES.indexOf(mode) + 1) % MODES.length] as Mode;\n const name = typeof label === \"function\" ? label(mode) : label;\n return (\n <button\n type=\"button\"\n aria-label={name}\n title={name}\n data-mode={mode}\n onClick={() => setMode(next)}\n className={buttonVariants({ variant, shape, size: \"icon\", className })}\n {...props}\n >\n <svg viewBox=\"0 0 24 24\" className=\"h-5 w-5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n {ICONS[mode]}\n </svg>\n </button>\n );\n}\n\n/** The choices of the Appearance block (ADR-006 §4): the theme (`system · light · dark`, then a surface set), the accent, the density. */\nexport type AppearanceState = {\n /** `system`, `light`, `dark`, or the surface set (`blueprint`, `carbone`) — which is dark. */\n themeId: string;\n setThemeId: (id: string) => void;\n /** A brand's accent (`data-accent` on `<html>`), or null: the product's own. */\n accent: string | null;\n setAccent: (accent: string | null) => void;\n /** `standard` or `compact` (`data-density` on `<html>`, the token layer: rows and gaps one step down). */\n density: string;\n setDensity: (density: string) => void;\n};\n\nfunction applyAttribute(name: string, value: string | null) {\n if (value === null) document.documentElement.removeAttribute(name);\n else document.documentElement.setAttribute(name, value);\n}\n\n/**\n * The state of the Appearance block, applied at once and kept in the browser (`kz-theme`, `kz-theme-name`, `kz-accent`,\n * `kz-density`; `ThemeScript` restores them before paint). A product with an account also saves what `onChange` of the block\n * reports, so the choice follows the person. Needs a `ThemeProvider`.\n * @param surfaceSets the themes that are a dark surface set (default `blueprint`, `carbone`)\n */\nexport function useAppearance(surfaceSets: readonly string[] = [\"blueprint\", \"carbone\"]): AppearanceState {\n const { mode, setMode, theme, setTheme } = useTheme();\n const accent = React.useSyncExternalStore(subscribe, () => read(ACCENT_KEY), () => null);\n const density = React.useSyncExternalStore(subscribe, () => read(DENSITY_KEY), () => null) ?? \"standard\";\n const themeId = theme && surfaceSets.includes(theme) && mode === \"dark\" ? theme : mode;\n const setThemeId = React.useCallback(\n (id: string) => {\n if (surfaceSets.includes(id)) {\n setMode(\"dark\");\n setTheme(id);\n } else {\n setTheme(null);\n setMode(id as Mode);\n }\n },\n [setMode, setTheme, surfaceSets],\n );\n const setAccent = React.useCallback((next: string | null) => {\n applyAttribute(\"data-accent\", next);\n write(ACCENT_KEY, next);\n notify();\n }, []);\n const setDensity = React.useCallback((next: string) => {\n applyAttribute(\"data-density\", next === \"standard\" ? null : next);\n write(DENSITY_KEY, next === \"standard\" ? null : next);\n notify();\n }, []);\n return { themeId, setThemeId, accent, setAccent, density, setDensity };\n}\n"
236
236
  }
237
237
  ],
238
238
  "dependencies": [],