@krizaka/ui 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (498) hide show
  1. package/README.md +33 -8
  2. package/dist/audio-player.d.ts +113 -0
  3. package/dist/audio-player.js +207 -0
  4. package/dist/audio-player.js.map +1 -0
  5. package/dist/{button-Cgfkg_3y.d.ts → button-BMAO7dKF.d.ts} +29 -2
  6. package/dist/button.d.ts +32 -5
  7. package/dist/button.js +62 -9
  8. package/dist/button.js.map +1 -1
  9. package/dist/chip-link.d.ts +53 -0
  10. package/dist/chip-link.js +32 -0
  11. package/dist/chip-link.js.map +1 -0
  12. package/dist/chunk-2USC2YT6.js +17 -0
  13. package/dist/chunk-2USC2YT6.js.map +1 -0
  14. package/dist/chunk-43PTCDTL.js +31 -0
  15. package/dist/chunk-43PTCDTL.js.map +1 -0
  16. package/dist/chunk-6ISW63JI.js +11 -0
  17. package/dist/chunk-6ISW63JI.js.map +1 -0
  18. package/dist/chunk-EUPTXKH7.js +95 -0
  19. package/dist/chunk-EUPTXKH7.js.map +1 -0
  20. package/dist/chunk-HAQWKORZ.js +117 -0
  21. package/dist/chunk-HAQWKORZ.js.map +1 -0
  22. package/dist/{chunk-FHYZSO2S.js → chunk-R6SDS7JM.js} +5 -3
  23. package/dist/chunk-R6SDS7JM.js.map +1 -0
  24. package/dist/chunk-RUPNPMP3.js +103 -0
  25. package/dist/chunk-RUPNPMP3.js.map +1 -0
  26. package/dist/chunk-RUPRYJ45.js +82 -0
  27. package/dist/chunk-RUPRYJ45.js.map +1 -0
  28. package/dist/chunk-VDR2EP6K.js +49 -0
  29. package/dist/chunk-VDR2EP6K.js.map +1 -0
  30. package/dist/chunk-WEVYKZIF.js +33 -0
  31. package/dist/chunk-WEVYKZIF.js.map +1 -0
  32. package/dist/chunk-XUMJA5ZI.js +283 -0
  33. package/dist/chunk-XUMJA5ZI.js.map +1 -0
  34. package/dist/chunk-YH4LMWRU.js +92 -0
  35. package/dist/chunk-YH4LMWRU.js.map +1 -0
  36. package/dist/chunk-YX6CNVJA.js +94 -0
  37. package/dist/chunk-YX6CNVJA.js.map +1 -0
  38. package/dist/chunk-ZIXB33X7.js +95 -0
  39. package/dist/chunk-ZIXB33X7.js.map +1 -0
  40. package/dist/combobox.d.ts +188 -0
  41. package/dist/combobox.js +16 -0
  42. package/dist/combobox.js.map +1 -0
  43. package/dist/command.d.ts +7 -7
  44. package/dist/command.js +3 -2
  45. package/dist/command.js.map +1 -1
  46. package/dist/confirm-button.d.ts +1 -1
  47. package/dist/confirm-button.js +2 -1
  48. package/dist/confirm-button.js.map +1 -1
  49. package/dist/data-table.d.ts +246 -0
  50. package/dist/data-table.js +290 -0
  51. package/dist/data-table.js.map +1 -0
  52. package/dist/date-picker.d.ts +288 -0
  53. package/dist/date-picker.js +364 -0
  54. package/dist/date-picker.js.map +1 -0
  55. package/dist/{dialog-GQ4Nvuyf.d.ts → dialog-D42QwYb_.d.ts} +11 -1
  56. package/dist/dialog.d.ts +1 -1
  57. package/dist/dialog.js +3 -2
  58. package/dist/dialog.js.map +1 -1
  59. package/dist/file-upload.d.ts +238 -0
  60. package/dist/file-upload.js +437 -0
  61. package/dist/file-upload.js.map +1 -0
  62. package/dist/filter-bar.d.ts +139 -0
  63. package/dist/filter-bar.js +155 -0
  64. package/dist/filter-bar.js.map +1 -0
  65. package/dist/glow-card.d.ts +20 -0
  66. package/dist/glow-card.js +30 -0
  67. package/dist/glow-card.js.map +1 -0
  68. package/dist/image-cropper.d.ts +115 -0
  69. package/dist/image-cropper.js +166 -0
  70. package/dist/image-cropper.js.map +1 -0
  71. package/dist/index.d.ts +2 -20
  72. package/dist/index.js +7 -64
  73. package/dist/index.js.map +1 -1
  74. package/dist/iso.d.ts +400 -0
  75. package/dist/iso.js +363 -0
  76. package/dist/iso.js.map +1 -0
  77. package/dist/loader.d.ts +206 -0
  78. package/dist/loader.js +138 -0
  79. package/dist/loader.js.map +1 -0
  80. package/dist/marquee.d.ts +33 -0
  81. package/dist/marquee.js +52 -0
  82. package/dist/marquee.js.map +1 -0
  83. package/dist/media-capture.d.ts +155 -0
  84. package/dist/media-capture.js +242 -0
  85. package/dist/media-capture.js.map +1 -0
  86. package/dist/meter.d.ts +146 -0
  87. package/dist/meter.js +107 -0
  88. package/dist/meter.js.map +1 -0
  89. package/dist/motion.css +394 -3
  90. package/dist/motion.d.ts +46 -0
  91. package/dist/motion.js +10 -0
  92. package/dist/motion.js.map +1 -0
  93. package/dist/native/media-capture.d.ts +49 -0
  94. package/dist/native/media-capture.js +113 -0
  95. package/dist/native/media-capture.js.map +1 -0
  96. package/dist/native/video-player.d.ts +50 -0
  97. package/dist/native/video-player.js +69 -0
  98. package/dist/native/video-player.js.map +1 -0
  99. package/dist/native.d.ts +66 -2
  100. package/dist/native.js +166 -68
  101. package/dist/native.js.map +1 -1
  102. package/dist/nav-bar.d.ts +178 -0
  103. package/dist/nav-bar.js +157 -0
  104. package/dist/nav-bar.js.map +1 -0
  105. package/dist/number-ticker.d.ts +32 -0
  106. package/dist/number-ticker.js +61 -0
  107. package/dist/number-ticker.js.map +1 -0
  108. package/dist/pagination.d.ts +141 -0
  109. package/dist/pagination.js +165 -0
  110. package/dist/pagination.js.map +1 -0
  111. package/dist/progress.d.ts +56 -1
  112. package/dist/progress.js +72 -25
  113. package/dist/progress.js.map +1 -1
  114. package/dist/search-field.d.ts +100 -0
  115. package/dist/search-field.js +167 -0
  116. package/dist/search-field.js.map +1 -0
  117. package/dist/skeleton.d.ts +18 -3
  118. package/dist/skeleton.js +9 -1
  119. package/dist/skeleton.js.map +1 -1
  120. package/dist/spinner.d.ts +21 -5
  121. package/dist/spinner.js +13 -12
  122. package/dist/spinner.js.map +1 -1
  123. package/dist/stepper.d.ts +112 -0
  124. package/dist/stepper.js +67 -0
  125. package/dist/stepper.js.map +1 -0
  126. package/dist/tabs.d.ts +1 -1
  127. package/dist/tabs.js +14 -8
  128. package/dist/tabs.js.map +1 -1
  129. package/dist/tag-input.d.ts +44 -0
  130. package/dist/tag-input.js +67 -0
  131. package/dist/tag-input.js.map +1 -0
  132. package/dist/theme.d.ts +1 -1
  133. package/dist/theme.js +2 -1
  134. package/dist/theme.js.map +1 -1
  135. package/dist/toast.d.ts +39 -4
  136. package/dist/toast.js +81 -7
  137. package/dist/toast.js.map +1 -1
  138. package/dist/video-player.d.ts +204 -0
  139. package/dist/video-player.js +371 -0
  140. package/dist/video-player.js.map +1 -0
  141. package/dist/video-trimmer.d.ts +142 -0
  142. package/dist/video-trimmer.js +193 -0
  143. package/dist/video-trimmer.js.map +1 -0
  144. package/package.json +375 -7
  145. package/registry/alert.json +1 -1
  146. package/registry/audio-player.json +282 -0
  147. package/registry/avatar.json +1 -1
  148. package/registry/badge.json +1 -1
  149. package/registry/button.json +232 -26
  150. package/registry/card.json +1 -1
  151. package/registry/checkbox.json +1 -1
  152. package/registry/chip-link.json +158 -0
  153. package/registry/chip.json +1 -1
  154. package/registry/combobox.json +475 -0
  155. package/registry/command.json +1 -1
  156. package/registry/confirm-button.json +91 -7
  157. package/registry/countdown.json +1 -1
  158. package/registry/data-table.json +500 -0
  159. package/registry/date-picker.json +978 -0
  160. package/registry/dialog.json +15 -7
  161. package/registry/dropdown-menu.json +1 -1
  162. package/registry/empty-state.json +1 -1
  163. package/registry/examples/audio-player/podcast.js +22 -0
  164. package/registry/examples/audio-player/podcast.tsx +19 -0
  165. package/registry/examples/audio-player/voice-note.d.ts +4 -0
  166. package/registry/examples/audio-player/voice-note.js +12 -0
  167. package/registry/examples/audio-player/voice-note.tsx +12 -0
  168. package/registry/examples/button/error.d.ts +4 -0
  169. package/registry/examples/button/error.js +11 -0
  170. package/registry/examples/button/error.tsx +10 -0
  171. package/registry/examples/button/loading.tsx +1 -1
  172. package/registry/examples/button/save-flow.d.ts +4 -0
  173. package/registry/examples/button/save-flow.js +28 -0
  174. package/registry/examples/button/save-flow.tsx +24 -0
  175. package/registry/examples/button/signature.d.ts +4 -0
  176. package/registry/examples/button/signature.js +17 -0
  177. package/registry/examples/button/signature.tsx +19 -0
  178. package/registry/examples/button/upload-progress.d.ts +4 -0
  179. package/registry/examples/button/upload-progress.js +23 -0
  180. package/registry/examples/button/upload-progress.tsx +26 -0
  181. package/registry/examples/chip-link/filters.d.ts +4 -0
  182. package/registry/examples/chip-link/filters.js +12 -0
  183. package/registry/examples/chip-link/filters.tsx +17 -0
  184. package/registry/examples/combobox/async.d.ts +4 -0
  185. package/registry/examples/combobox/async.js +23 -0
  186. package/registry/examples/combobox/async.tsx +22 -0
  187. package/registry/examples/combobox/creatable.d.ts +4 -0
  188. package/registry/examples/combobox/creatable.js +32 -0
  189. package/registry/examples/combobox/creatable.tsx +28 -0
  190. package/registry/examples/combobox/invalid.d.ts +4 -0
  191. package/registry/examples/combobox/invalid.js +23 -0
  192. package/registry/examples/combobox/invalid.tsx +17 -0
  193. package/registry/examples/combobox/multiple.d.ts +4 -0
  194. package/registry/examples/combobox/multiple.js +29 -0
  195. package/registry/examples/combobox/multiple.tsx +26 -0
  196. package/registry/examples/data-table/cards.d.ts +4 -0
  197. package/registry/examples/data-table/cards.js +21 -0
  198. package/registry/examples/data-table/cards.tsx +20 -0
  199. package/registry/examples/data-table/empty.d.ts +4 -0
  200. package/registry/examples/data-table/empty.js +26 -0
  201. package/registry/examples/data-table/empty.tsx +21 -0
  202. package/registry/examples/data-table/error.d.ts +4 -0
  203. package/registry/examples/data-table/error.js +28 -0
  204. package/registry/examples/data-table/error.tsx +29 -0
  205. package/registry/examples/data-table/jobs.d.ts +4 -0
  206. package/registry/examples/data-table/jobs.js +37 -0
  207. package/registry/examples/data-table/jobs.tsx +36 -0
  208. package/registry/examples/data-table/loading.d.ts +4 -0
  209. package/registry/examples/data-table/loading.js +16 -0
  210. package/registry/examples/data-table/loading.tsx +12 -0
  211. package/registry/examples/data-table/virtualized.d.ts +4 -0
  212. package/registry/examples/data-table/virtualized.js +21 -0
  213. package/registry/examples/data-table/virtualized.tsx +20 -0
  214. package/registry/examples/date-picker/calendar.d.ts +4 -0
  215. package/registry/examples/date-picker/calendar.js +14 -0
  216. package/registry/examples/date-picker/calendar.tsx +16 -0
  217. package/registry/examples/date-picker/french.d.ts +4 -0
  218. package/registry/examples/date-picker/french.js +20 -0
  219. package/registry/examples/date-picker/french.tsx +14 -0
  220. package/registry/examples/date-picker/open.d.ts +4 -0
  221. package/registry/examples/date-picker/open.js +11 -0
  222. package/registry/examples/date-picker/open.tsx +8 -0
  223. package/registry/examples/date-picker/range.d.ts +4 -0
  224. package/registry/examples/date-picker/range.js +29 -0
  225. package/registry/examples/date-picker/range.tsx +25 -0
  226. package/registry/examples/date-picker/schedule.d.ts +4 -0
  227. package/registry/examples/date-picker/schedule.js +26 -0
  228. package/registry/examples/date-picker/schedule.tsx +22 -0
  229. package/registry/examples/dialog/left.d.ts +4 -0
  230. package/registry/examples/dialog/left.js +22 -0
  231. package/registry/examples/dialog/left.tsx +32 -0
  232. package/registry/examples/file-upload/images.d.ts +4 -0
  233. package/registry/examples/file-upload/images.js +32 -0
  234. package/registry/examples/file-upload/images.tsx +25 -0
  235. package/registry/examples/file-upload/states.d.ts +4 -0
  236. package/registry/examples/file-upload/states.js +28 -0
  237. package/registry/examples/file-upload/states.tsx +23 -0
  238. package/registry/examples/file-upload/tus.d.ts +4 -0
  239. package/registry/examples/file-upload/tus.js +23 -0
  240. package/registry/examples/file-upload/tus.tsx +26 -0
  241. package/registry/examples/file-upload/video.d.ts +4 -0
  242. package/registry/examples/file-upload/video.js +39 -0
  243. package/registry/examples/file-upload/video.tsx +36 -0
  244. package/registry/examples/filter-bar/address.d.ts +4 -0
  245. package/registry/examples/filter-bar/address.js +29 -0
  246. package/registry/examples/filter-bar/address.tsx +27 -0
  247. package/registry/examples/filter-bar/jobs.d.ts +4 -0
  248. package/registry/examples/filter-bar/jobs.js +37 -0
  249. package/registry/examples/filter-bar/jobs.tsx +37 -0
  250. package/registry/examples/filter-bar/menu.d.ts +4 -0
  251. package/registry/examples/filter-bar/menu.js +27 -0
  252. package/registry/examples/filter-bar/menu.tsx +23 -0
  253. package/registry/examples/glow-card/link-card.d.ts +4 -0
  254. package/registry/examples/glow-card/link-card.js +14 -0
  255. package/registry/examples/glow-card/link-card.tsx +13 -0
  256. package/registry/examples/glow-card/plans.d.ts +4 -0
  257. package/registry/examples/glow-card/plans.js +25 -0
  258. package/registry/examples/glow-card/plans.tsx +26 -0
  259. package/registry/examples/glow-card/spotlight.d.ts +4 -0
  260. package/registry/examples/glow-card/spotlight.js +14 -0
  261. package/registry/examples/glow-card/spotlight.tsx +15 -0
  262. package/registry/examples/image-cropper/avatar.d.ts +4 -0
  263. package/registry/examples/image-cropper/avatar.js +13 -0
  264. package/registry/examples/image-cropper/avatar.tsx +14 -0
  265. package/registry/examples/image-cropper/banner.d.ts +4 -0
  266. package/registry/examples/image-cropper/banner.js +11 -0
  267. package/registry/examples/image-cropper/banner.tsx +10 -0
  268. package/registry/examples/image-cropper/vertical-video.d.ts +4 -0
  269. package/registry/examples/image-cropper/vertical-video.js +12 -0
  270. package/registry/examples/image-cropper/vertical-video.tsx +16 -0
  271. package/registry/examples/iso/compose.d.ts +4 -0
  272. package/registry/examples/iso/compose.js +22 -0
  273. package/registry/examples/iso/compose.tsx +19 -0
  274. package/registry/examples/iso/orazaka-hero.d.ts +4 -0
  275. package/registry/examples/iso/orazaka-hero.js +26 -0
  276. package/registry/examples/iso/orazaka-hero.tsx +21 -0
  277. package/registry/examples/iso/orochia-hero.d.ts +4 -0
  278. package/registry/examples/iso/orochia-hero.js +29 -0
  279. package/registry/examples/iso/orochia-hero.tsx +23 -0
  280. package/registry/examples/iso/still.d.ts +4 -0
  281. package/registry/examples/iso/still.js +21 -0
  282. package/registry/examples/iso/still.tsx +15 -0
  283. package/registry/examples/loader/endings.d.ts +4 -0
  284. package/registry/examples/loader/endings.js +14 -0
  285. package/registry/examples/loader/endings.tsx +11 -0
  286. package/registry/examples/loader/fetch-flow.d.ts +4 -0
  287. package/registry/examples/loader/fetch-flow.js +24 -0
  288. package/registry/examples/loader/fetch-flow.tsx +24 -0
  289. package/registry/examples/loader/minimal.d.ts +4 -0
  290. package/registry/examples/loader/minimal.js +11 -0
  291. package/registry/examples/loader/minimal.tsx +6 -0
  292. package/registry/examples/loader/overlay.d.ts +4 -0
  293. package/registry/examples/loader/overlay.js +16 -0
  294. package/registry/examples/loader/overlay.tsx +13 -0
  295. package/registry/examples/loader/region-handover.d.ts +4 -0
  296. package/registry/examples/loader/region-handover.js +42 -0
  297. package/registry/examples/loader/region-handover.tsx +29 -0
  298. package/registry/examples/loader/upload-eta.d.ts +4 -0
  299. package/registry/examples/loader/upload-eta.js +11 -0
  300. package/registry/examples/loader/upload-eta.tsx +10 -0
  301. package/registry/examples/marquee/cards.d.ts +4 -0
  302. package/registry/examples/marquee/cards.js +23 -0
  303. package/registry/examples/marquee/cards.tsx +21 -0
  304. package/registry/examples/marquee/logos.d.ts +4 -0
  305. package/registry/examples/marquee/logos.js +12 -0
  306. package/registry/examples/marquee/logos.tsx +17 -0
  307. package/registry/examples/media-capture/clip.d.ts +4 -0
  308. package/registry/examples/media-capture/clip.js +20 -0
  309. package/registry/examples/media-capture/clip.tsx +18 -0
  310. package/registry/examples/media-capture/native/photo.d.ts +4 -0
  311. package/registry/examples/media-capture/native/photo.dark.png +0 -0
  312. package/registry/examples/media-capture/native/photo.js +27 -0
  313. package/registry/examples/media-capture/native/photo.light.png +0 -0
  314. package/registry/examples/media-capture/native/photo.tsx +20 -0
  315. package/registry/examples/media-capture/profile-photo.d.ts +4 -0
  316. package/registry/examples/media-capture/profile-photo.js +24 -0
  317. package/registry/examples/media-capture/profile-photo.tsx +20 -0
  318. package/registry/examples/meter/balance.d.ts +4 -0
  319. package/registry/examples/meter/balance.js +14 -0
  320. package/registry/examples/meter/balance.tsx +15 -0
  321. package/registry/examples/meter/quota.d.ts +4 -0
  322. package/registry/examples/meter/quota.js +15 -0
  323. package/registry/examples/meter/quota.tsx +12 -0
  324. package/registry/examples/meter/split.d.ts +4 -0
  325. package/registry/examples/meter/split.js +18 -0
  326. package/registry/examples/meter/split.tsx +18 -0
  327. package/registry/examples/nav-bar/app-bar.d.ts +4 -0
  328. package/registry/examples/nav-bar/app-bar.js +22 -0
  329. package/registry/examples/nav-bar/app-bar.tsx +21 -0
  330. package/registry/examples/nav-bar/menu-open.d.ts +4 -0
  331. package/registry/examples/nav-bar/menu-open.js +26 -0
  332. package/registry/examples/nav-bar/menu-open.tsx +26 -0
  333. package/registry/examples/nav-bar/site.d.ts +4 -0
  334. package/registry/examples/nav-bar/site.js +31 -0
  335. package/registry/examples/nav-bar/site.tsx +36 -0
  336. package/registry/examples/number-ticker/gradient.d.ts +4 -0
  337. package/registry/examples/number-ticker/gradient.js +11 -0
  338. package/registry/examples/number-ticker/gradient.tsx +10 -0
  339. package/registry/examples/number-ticker/live-total.d.ts +4 -0
  340. package/registry/examples/number-ticker/live-total.js +17 -0
  341. package/registry/examples/number-ticker/live-total.tsx +21 -0
  342. package/registry/examples/number-ticker/stats.d.ts +4 -0
  343. package/registry/examples/number-ticker/stats.js +19 -0
  344. package/registry/examples/number-ticker/stats.tsx +23 -0
  345. package/registry/examples/pagination/cursor.d.ts +4 -0
  346. package/registry/examples/pagination/cursor.js +24 -0
  347. package/registry/examples/pagination/cursor.tsx +20 -0
  348. package/registry/examples/pagination/links.d.ts +4 -0
  349. package/registry/examples/pagination/links.js +11 -0
  350. package/registry/examples/pagination/links.tsx +6 -0
  351. package/registry/examples/pagination/native/cursor.d.ts +4 -0
  352. package/registry/examples/pagination/native/cursor.dark.png +0 -0
  353. package/registry/examples/pagination/native/cursor.js +19 -0
  354. package/registry/examples/pagination/native/cursor.light.png +0 -0
  355. package/registry/examples/pagination/native/cursor.tsx +13 -0
  356. package/registry/examples/pagination/native/pages.d.ts +4 -0
  357. package/registry/examples/pagination/native/pages.dark.png +0 -0
  358. package/registry/examples/pagination/native/pages.js +21 -0
  359. package/registry/examples/pagination/native/pages.light.png +0 -0
  360. package/registry/examples/pagination/native/pages.tsx +14 -0
  361. package/registry/examples/pagination/results.d.ts +4 -0
  362. package/registry/examples/pagination/results.js +23 -0
  363. package/registry/examples/pagination/results.tsx +19 -0
  364. package/registry/examples/pagination/table-footer.d.ts +4 -0
  365. package/registry/examples/pagination/table-footer.js +31 -0
  366. package/registry/examples/pagination/table-footer.tsx +27 -0
  367. package/registry/examples/progress/buffer.d.ts +4 -0
  368. package/registry/examples/progress/buffer.js +11 -0
  369. package/registry/examples/progress/buffer.tsx +10 -0
  370. package/registry/examples/progress/statuses.d.ts +4 -0
  371. package/registry/examples/progress/statuses.js +14 -0
  372. package/registry/examples/progress/statuses.tsx +11 -0
  373. package/registry/examples/progress/steps.d.ts +4 -0
  374. package/registry/examples/progress/steps.js +14 -0
  375. package/registry/examples/progress/steps.tsx +13 -0
  376. package/registry/examples/progress/upload.d.ts +4 -0
  377. package/registry/examples/progress/upload.js +11 -0
  378. package/registry/examples/progress/upload.tsx +10 -0
  379. package/registry/examples/search-field/global.d.ts +4 -0
  380. package/registry/examples/search-field/global.js +19 -0
  381. package/registry/examples/search-field/global.tsx +15 -0
  382. package/registry/examples/search-field/native/default.d.ts +4 -0
  383. package/registry/examples/search-field/native/default.dark.png +0 -0
  384. package/registry/examples/search-field/native/default.js +13 -0
  385. package/registry/examples/search-field/native/default.light.png +0 -0
  386. package/registry/examples/search-field/native/default.tsx +7 -0
  387. package/registry/examples/search-field/suggestions.d.ts +4 -0
  388. package/registry/examples/search-field/suggestions.js +30 -0
  389. package/registry/examples/search-field/suggestions.tsx +27 -0
  390. package/registry/examples/search-field/toolbar.d.ts +4 -0
  391. package/registry/examples/search-field/toolbar.js +17 -0
  392. package/registry/examples/search-field/toolbar.tsx +21 -0
  393. package/registry/examples/skeleton/paragraph.d.ts +4 -0
  394. package/registry/examples/skeleton/paragraph.js +14 -0
  395. package/registry/examples/skeleton/paragraph.tsx +12 -0
  396. package/registry/examples/skeleton/shape-of-content.d.ts +4 -0
  397. package/registry/examples/skeleton/shape-of-content.js +23 -0
  398. package/registry/examples/skeleton/shape-of-content.tsx +26 -0
  399. package/registry/examples/spinner/default.js +5 -2
  400. package/registry/examples/spinner/default.tsx +7 -1
  401. package/registry/examples/spinner/sizes.js +2 -1
  402. package/registry/examples/spinner/sizes.tsx +2 -0
  403. package/registry/examples/spinner/value.d.ts +4 -0
  404. package/registry/examples/spinner/value.js +11 -0
  405. package/registry/examples/spinner/value.tsx +12 -0
  406. package/registry/examples/stepper/checkout.d.ts +4 -0
  407. package/registry/examples/stepper/checkout.js +22 -0
  408. package/registry/examples/stepper/checkout.tsx +17 -0
  409. package/registry/examples/stepper/failed.d.ts +4 -0
  410. package/registry/examples/stepper/failed.js +26 -0
  411. package/registry/examples/stepper/failed.tsx +21 -0
  412. package/registry/examples/stepper/job.d.ts +4 -0
  413. package/registry/examples/stepper/job.js +32 -0
  414. package/registry/examples/stepper/job.tsx +28 -0
  415. package/registry/examples/tag-input/recipients.d.ts +4 -0
  416. package/registry/examples/tag-input/recipients.js +23 -0
  417. package/registry/examples/tag-input/recipients.tsx +20 -0
  418. package/registry/examples/tag-input/video-tags.d.ts +4 -0
  419. package/registry/examples/tag-input/video-tags.js +26 -0
  420. package/registry/examples/tag-input/video-tags.tsx +22 -0
  421. package/registry/examples/toast/grouped.d.ts +4 -0
  422. package/registry/examples/toast/grouped.js +21 -0
  423. package/registry/examples/toast/grouped.tsx +23 -0
  424. package/registry/examples/toast/undo.d.ts +4 -0
  425. package/registry/examples/toast/undo.js +29 -0
  426. package/registry/examples/toast/undo.tsx +30 -0
  427. package/registry/examples/toast/upload-progress.d.ts +4 -0
  428. package/registry/examples/toast/upload-progress.js +29 -0
  429. package/registry/examples/toast/upload-progress.tsx +31 -0
  430. package/registry/examples/video-player/default.d.ts +4 -0
  431. package/registry/examples/video-player/default.js +12 -0
  432. package/registry/examples/video-player/default.tsx +8 -0
  433. package/registry/examples/video-player/gated.d.ts +4 -0
  434. package/registry/examples/video-player/gated.js +26 -0
  435. package/registry/examples/video-player/gated.tsx +23 -0
  436. package/registry/examples/video-player/native/default.d.ts +4 -0
  437. package/registry/examples/video-player/native/default.dark.png +0 -0
  438. package/registry/examples/video-player/native/default.js +18 -0
  439. package/registry/examples/video-player/native/default.light.png +0 -0
  440. package/registry/examples/video-player/native/default.tsx +12 -0
  441. package/registry/examples/video-player/signed-source.d.ts +4 -0
  442. package/registry/examples/video-player/signed-source.js +16 -0
  443. package/registry/examples/video-player/signed-source.tsx +15 -0
  444. package/registry/examples/video-player/vertical.d.ts +4 -0
  445. package/registry/examples/video-player/vertical.js +12 -0
  446. package/registry/examples/video-player/vertical.tsx +12 -0
  447. package/registry/examples/video-trimmer/custom.d.ts +4 -0
  448. package/registry/examples/video-trimmer/custom.js +24 -0
  449. package/registry/examples/video-trimmer/custom.tsx +26 -0
  450. package/registry/examples/video-trimmer/filmstrip.d.ts +4 -0
  451. package/registry/examples/video-trimmer/filmstrip.js +15 -0
  452. package/registry/examples/video-trimmer/filmstrip.tsx +13 -0
  453. package/registry/examples/video-trimmer/playhead.d.ts +4 -0
  454. package/registry/examples/video-trimmer/playhead.js +15 -0
  455. package/registry/examples/video-trimmer/playhead.tsx +13 -0
  456. package/registry/field.json +1 -1
  457. package/registry/file-upload.json +471 -0
  458. package/registry/filter-bar.json +347 -0
  459. package/registry/glow-card.json +162 -0
  460. package/registry/image-cropper.json +313 -0
  461. package/registry/index.json +445 -20
  462. package/registry/iso.json +1355 -0
  463. package/registry/kbd.json +1 -1
  464. package/registry/loader.json +399 -0
  465. package/registry/marquee.json +225 -0
  466. package/registry/mascots.json +3 -3
  467. package/registry/media-capture.json +347 -0
  468. package/registry/meter.json +324 -0
  469. package/registry/nav-bar.json +480 -0
  470. package/registry/number-ticker.json +219 -0
  471. package/registry/page-header.json +1 -1
  472. package/registry/pagination.json +475 -0
  473. package/registry/popover.json +1 -1
  474. package/registry/progress.json +114 -9
  475. package/registry/radio-group.json +1 -1
  476. package/registry/search-field.json +436 -0
  477. package/registry/section-backdrop.json +1 -1
  478. package/registry/separator.json +1 -1
  479. package/registry/skeleton.json +69 -13
  480. package/registry/slider.json +1 -1
  481. package/registry/slot.json +1 -1
  482. package/registry/spinner.json +91 -27
  483. package/registry/stat.json +1 -1
  484. package/registry/stepper.json +174 -0
  485. package/registry/switch.json +1 -1
  486. package/registry/tabs.json +11 -7
  487. package/registry/tag-input.json +363 -0
  488. package/registry/theme.json +3 -3
  489. package/registry/toast.json +41 -13
  490. package/registry/tooltip.json +1 -1
  491. package/registry/video-player.json +598 -0
  492. package/registry/video-trimmer.json +385 -0
  493. package/dist/chunk-FHYZSO2S.js.map +0 -1
  494. package/dist/chunk-PESA2R4U.js +0 -51
  495. package/dist/chunk-PESA2R4U.js.map +0 -1
  496. package/registry/examples/spinner/muted.js +0 -11
  497. package/registry/examples/spinner/muted.tsx +0 -6
  498. /package/registry/examples/{spinner/muted.d.ts → audio-player/podcast.d.ts} +0 -0
@@ -0,0 +1,475 @@
1
+ {
2
+ "name": "combobox",
3
+ "type": "primitive",
4
+ "title": "Combobox",
5
+ "summary": "A text field that suggests and completes — one value or several as chips, from a static list or a server, with values created from what was typed.",
6
+ "description": "A text field that suggests and completes — one value or several as chips, from a static list or a server, with values created from what was typed.",
7
+ "status": "beta",
8
+ "category": "forms",
9
+ "platforms": "web",
10
+ "whenToUse": [
11
+ "To choose among many values the person knows by name: a creator, a country, a model, a playlist.",
12
+ "With `onSearch` when the values live on a server (debounced, the previous request aborted).",
13
+ "With `multiple` for several values (collaborators, categories), and `creatable` when a new one can be added."
14
+ ],
15
+ "whenNotToUse": [
16
+ {
17
+ "when": "For fewer than about seven options known in advance: radios or a select.",
18
+ "use": "radio-group"
19
+ },
20
+ {
21
+ "when": "For free words without a closed list (tags, keywords): a tag input.",
22
+ "use": "tag-input"
23
+ },
24
+ {
25
+ "when": "To run a search and show results: a search field.",
26
+ "use": "search-field"
27
+ }
28
+ ],
29
+ "bestPractices": [
30
+ "Write `label` as the question (“Collaborators”), the `placeholder` as an example (“Type a name”).",
31
+ "Return at most 20 options from `onSearch`; put the best match first.",
32
+ "Give options a `description` when names collide (two creators named Eric: their handles).",
33
+ "Set `maxSelected` when the product has a limit, and say it in `hint`."
34
+ ],
35
+ "accessibility": {
36
+ "keyboard": [
37
+ {
38
+ "keys": "Arrow Down / Arrow Up",
39
+ "action": "Open the list and move the active option."
40
+ },
41
+ {
42
+ "keys": "Home / End",
43
+ "action": "First or last option, when the list is open."
44
+ },
45
+ {
46
+ "keys": "Enter",
47
+ "action": "Choose the active option (or create the typed value)."
48
+ },
49
+ {
50
+ "keys": "Esc",
51
+ "action": "Close the list; for one value, restore its label."
52
+ },
53
+ {
54
+ "keys": "Backspace",
55
+ "action": "In an empty input, remove the last chip."
56
+ }
57
+ ],
58
+ "notes": [
59
+ "The ARIA 1.2 combobox pattern: the focus stays in the input, `aria-activedescendant` points at the active option of the `listbox`.",
60
+ "The number of results is announced in a polite live region (`labels.results`).",
61
+ "Chosen options carry `aria-selected`; each chip's remove button is named (“Remove Eric”).",
62
+ "The label is a real `<label>`; `hint` and `error` are wired with `aria-describedby`, `error` sets `aria-invalid`."
63
+ ]
64
+ },
65
+ "related": [
66
+ "tag-input",
67
+ "search-field",
68
+ "field",
69
+ "chip",
70
+ "command"
71
+ ],
72
+ "web": {
73
+ "entry": "@krizaka/ui/combobox",
74
+ "import": "import { Combobox } from \"@krizaka/ui/combobox\";",
75
+ "props": [
76
+ {
77
+ "component": "Combobox",
78
+ "description": "A text field that suggests, filters and completes: one value or several (chips), static or fetched, creatable.",
79
+ "props": [
80
+ {
81
+ "name": "label",
82
+ "type": "string",
83
+ "default": null,
84
+ "description": "The visible label of the field, passed translated (also its accessible name).",
85
+ "required": true
86
+ },
87
+ {
88
+ "name": "className",
89
+ "type": "string",
90
+ "default": null,
91
+ "description": "Classes merged on the root.",
92
+ "required": false
93
+ },
94
+ {
95
+ "name": "creatable",
96
+ "type": "boolean",
97
+ "default": null,
98
+ "description": "Offers to create the query as a new value when no option has that exact label.",
99
+ "required": false
100
+ },
101
+ {
102
+ "name": "debounce",
103
+ "type": "number",
104
+ "default": null,
105
+ "description": "The wait, in ms, between the last key and `onSearch`. Default 250.",
106
+ "required": false
107
+ },
108
+ {
109
+ "name": "defaultValue",
110
+ "type": "ComboboxOption | readonly ComboboxOption[] | null",
111
+ "default": null,
112
+ "description": "The chosen option at first, uncontrolled.\nThe chosen options at first, uncontrolled.",
113
+ "required": false
114
+ },
115
+ {
116
+ "name": "disabled",
117
+ "type": "boolean",
118
+ "default": null,
119
+ "description": "Not available.",
120
+ "required": false
121
+ },
122
+ {
123
+ "name": "error",
124
+ "type": "string",
125
+ "default": null,
126
+ "description": "An error under the field: marks it invalid and is read with it.",
127
+ "required": false
128
+ },
129
+ {
130
+ "name": "filter",
131
+ "type": "((option: ComboboxOption, query: string) => boolean)",
132
+ "default": null,
133
+ "description": "Whether an option matches a query. Default: its label contains the query, ignoring case and accents.",
134
+ "required": false
135
+ },
136
+ {
137
+ "name": "hideLabel",
138
+ "type": "boolean",
139
+ "default": null,
140
+ "description": "Hides the label visually, keeping it as the accessible name (a search bar with its own context).",
141
+ "required": false
142
+ },
143
+ {
144
+ "name": "hint",
145
+ "type": "string",
146
+ "default": null,
147
+ "description": "A help text under the field.",
148
+ "required": false
149
+ },
150
+ {
151
+ "name": "id",
152
+ "type": "string",
153
+ "default": null,
154
+ "description": "The id of the text input (default: generated).",
155
+ "required": false
156
+ },
157
+ {
158
+ "name": "labels",
159
+ "type": "Partial<ComboboxLabels>",
160
+ "default": null,
161
+ "description": "The words, passed translated; English by default.",
162
+ "required": false
163
+ },
164
+ {
165
+ "name": "maxSelected",
166
+ "type": "number",
167
+ "default": null,
168
+ "description": "Most options that can be chosen (several values only).\nMost options that can be chosen; the list stops offering more past it.",
169
+ "required": false
170
+ },
171
+ {
172
+ "name": "multiple",
173
+ "type": "boolean",
174
+ "default": null,
175
+ "description": "One value (default) or several.\nSeveral values, shown as chips.",
176
+ "required": false
177
+ },
178
+ {
179
+ "name": "name",
180
+ "type": "string",
181
+ "default": null,
182
+ "description": "The name of a hidden input holding the value(s), for a plain `<form>` post.",
183
+ "required": false
184
+ },
185
+ {
186
+ "name": "onCreate",
187
+ "type": "((query: string) => ComboboxOption)",
188
+ "default": null,
189
+ "description": "Turns a query into the created option (an id from the server…). Default `{ value: query, label: query }`.",
190
+ "required": false
191
+ },
192
+ {
193
+ "name": "onSearch",
194
+ "type": "((query: string, signal: AbortSignal) => Promise<readonly ComboboxOption[]>)",
195
+ "default": null,
196
+ "description": "Fetches the options for a query (debounced by `debounce`); the `signal` aborts when a newer query starts.",
197
+ "required": false
198
+ },
199
+ {
200
+ "name": "onValueChange",
201
+ "type": "((value: ComboboxOption | null) => void) | ((value: ComboboxOption[]) => void)",
202
+ "default": null,
203
+ "description": "Called with the chosen option, or `null` when it is cleared.\nCalled with every chosen option.",
204
+ "required": false
205
+ },
206
+ {
207
+ "name": "options",
208
+ "type": "readonly ComboboxOption[]",
209
+ "default": null,
210
+ "description": "The options, filtered as the person types (by `filter`).",
211
+ "required": false
212
+ },
213
+ {
214
+ "name": "placeholder",
215
+ "type": "string",
216
+ "default": null,
217
+ "description": "The input's placeholder, passed translated.",
218
+ "required": false
219
+ },
220
+ {
221
+ "name": "separators",
222
+ "type": "readonly string[]",
223
+ "default": null,
224
+ "description": "Keys that create the query at once, as Enter does (`[\",\"]` for tags); a paste is split on them too.",
225
+ "required": false
226
+ },
227
+ {
228
+ "name": "value",
229
+ "type": "ComboboxOption | readonly ComboboxOption[] | null",
230
+ "default": null,
231
+ "description": "The chosen option (controlled), `null` for none.\nThe chosen options (controlled).",
232
+ "required": false
233
+ }
234
+ ]
235
+ }
236
+ ],
237
+ "examples": [
238
+ {
239
+ "name": "async",
240
+ "title": "From a server",
241
+ "description": "`onSearch`: creators fetched as you type, debounced, the stale request aborted.",
242
+ "path": "examples/combobox/async.tsx",
243
+ "module": "@krizaka/ui/registry/examples/combobox/async",
244
+ "code": "\"use client\";\n\nimport { Combobox, type ComboboxOption } from \"@krizaka/ui/combobox\";\n\nconst CREATORS: ComboboxOption[] = [\n { value: \"u1\", label: \"Eric Tremblay\", description: \"@eric.films\" },\n { value: \"u2\", label: \"Erica Moreau\", description: \"@erica\" },\n { value: \"u3\", label: \"Inès Haddad\", description: \"@ines.draws\" },\n { value: \"u4\", label: \"Jonas Weber\", description: \"@jonas\" },\n];\n\n// Your API in place of this one: it receives the query and an AbortSignal.\nasync function searchCreators(query: string, signal: AbortSignal) {\n await new Promise((resolve) => setTimeout(resolve, 300));\n if (signal.aborted) return [];\n const q = query.toLowerCase();\n return CREATORS.filter((c) => c.label.toLowerCase().includes(q) || c.description?.includes(q));\n}\n\nexport default function ComboboxAsync() {\n return <Combobox label=\"Creator\" placeholder=\"Type a name or a handle\" onSearch={searchCreators} />;\n}\n"
245
+ },
246
+ {
247
+ "name": "multiple",
248
+ "title": "Several values",
249
+ "description": "Collaborators as chips; Backspace removes the last one, at most three.",
250
+ "path": "examples/combobox/multiple.tsx",
251
+ "module": "@krizaka/ui/registry/examples/combobox/multiple",
252
+ "code": "\"use client\";\n\nimport { Combobox } from \"@krizaka/ui/combobox\";\n\nconst PEOPLE = [\n { value: \"eric\", label: \"Eric\" },\n { value: \"ines\", label: \"Inès\" },\n { value: \"jonas\", label: \"Jonas\" },\n { value: \"mia\", label: \"Mia\" },\n { value: \"noah\", label: \"Noah\" },\n];\n\n// Several values as chips; Backspace in the empty input removes the last one.\nexport default function ComboboxMultiple() {\n return (\n <Combobox\n multiple\n label=\"Collaborators\"\n placeholder=\"Add a collaborator\"\n options={PEOPLE}\n defaultValue={[PEOPLE[0]!, PEOPLE[1]!]}\n maxSelected={3}\n hint=\"Up to three collaborators share the revenue of this video.\"\n />\n );\n}\n"
253
+ },
254
+ {
255
+ "name": "creatable",
256
+ "title": "Create a value",
257
+ "description": "Pick a playlist or create one from what was typed.",
258
+ "path": "examples/combobox/creatable.tsx",
259
+ "module": "@krizaka/ui/registry/examples/combobox/creatable",
260
+ "code": "\"use client\";\n\nimport { Combobox, type ComboboxOption } from \"@krizaka/ui/combobox\";\nimport * as React from \"react\";\n\n// Pick a playlist, or type a new name and create it.\nexport default function ComboboxCreatable() {\n const [playlists, setPlaylists] = React.useState<ComboboxOption[]>([\n { value: \"p1\", label: \"Travel diaries\" },\n { value: \"p2\", label: \"Studio sessions\" },\n ]);\n const [value, setValue] = React.useState<ComboboxOption | null>(playlists[1]!);\n return (\n <Combobox\n label=\"Playlist\"\n options={playlists}\n value={value}\n onValueChange={setValue}\n creatable\n onCreate={(name) => {\n const created = { value: `p${playlists.length + 1}`, label: name };\n setPlaylists((all) => [...all, created]);\n return created;\n }}\n labels={{ create: (name) => `Create the playlist “${name}”` }}\n />\n );\n}\n"
261
+ },
262
+ {
263
+ "name": "invalid",
264
+ "title": "With an error",
265
+ "description": "A required choice left empty: the error is read with the field.",
266
+ "path": "examples/combobox/invalid.tsx",
267
+ "module": "@krizaka/ui/registry/examples/combobox/invalid",
268
+ "code": "import { Combobox } from \"@krizaka/ui/combobox\";\n\n// A required choice left empty: the error is shown and read with the field.\nexport default function ComboboxInvalid() {\n return (\n <Combobox\n label=\"Country of residence\"\n placeholder=\"Choose a country\"\n options={[\n { value: \"CA\", label: \"Canada\" },\n { value: \"FR\", label: \"France\" },\n { value: \"BE\", label: \"Belgium\" },\n ]}\n error=\"Choose your country to receive payouts.\"\n />\n );\n}\n"
269
+ }
270
+ ]
271
+ },
272
+ "native": null,
273
+ "files": [
274
+ {
275
+ "path": "combobox/combobox.tsx",
276
+ "content": "// Client. The ARIA 1.2 combobox (`../listbox`): a text input that filters a listbox, the focus never leaves the input\n// (`aria-activedescendant`), the number of results announced in a polite live region. Static options filtered here,\n// or `onSearch` (debounced, the previous request aborted) for a server's; one value or several (chips, Backspace\n// removes the last), and new values created from the query when `creatable`.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { Chip } from \"../chip\";\nimport { CheckGlyph, ChevronGlyph, CloseGlyph, PlusGlyph } from \"../glyphs\";\nimport { useListbox } from \"../listbox\";\nimport { useControllable, useDebouncedCallback } from \"../media\";\n\nexport const combobox = tv({\n slots: {\n root: \"relative flex w-full flex-col gap-1.5\",\n label: \"text-xs font-semibold text-fg-secondary\",\n control:\n \"flex min-h-11 w-full flex-wrap items-center gap-1.5 rounded-lg border border-border-default bg-surface-2 py-1.5 pl-2 pr-1 text-sm text-fg \" +\n \"transition-[border-color,box-shadow] focus-within:border-accent focus-within:ring-2 focus-within:ring-ring \" +\n \"data-[invalid]:border-danger data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\",\n input: \"h-8 min-w-24 flex-1 bg-transparent px-1 text-sm text-fg outline-hidden placeholder:text-fg-muted disabled:cursor-not-allowed\",\n icon:\n \"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n list: \"absolute inset-x-0 top-full z-50 mt-1 max-h-64 overflow-y-auto rounded-lg border border-border-default bg-surface-2 p-1 shadow-lg\",\n option:\n \"flex cursor-pointer select-none items-center gap-2.5 rounded-md px-2.5 py-2 text-sm text-fg \" +\n \"data-[active]:bg-surface-3 aria-disabled:cursor-not-allowed aria-disabled:opacity-40\",\n check: \"h-4 w-4 shrink-0 text-fg-accent\",\n description: \"block text-xs text-fg-secondary\",\n status: \"px-2.5 py-3 text-sm text-fg-secondary\",\n hint: \"text-xs text-fg-secondary\",\n error: \"flex items-center gap-1.5 text-xs font-medium text-fg-danger before:h-1.5 before:w-1.5 before:shrink-0 before:rounded-full before:bg-danger\",\n },\n});\n\nexport type ComboboxOption = {\n /** What the app stores. */\n value: string;\n /** What the person reads, passed translated. */\n label: string;\n /** A second line under the label. */\n description?: string;\n /** Shown but not choosable. */\n disabled?: boolean;\n};\n\nexport type ComboboxLabels = {\n /** No option matches (\"No results\"). */\n empty: string;\n /** While `onSearch` runs (\"Searching…\"). */\n loading: string;\n /** `onSearch` failed (\"Search unavailable\"). */\n error: string;\n /** The option that creates a value: `(query) => \"Create “\" + query + \"”\"`. */\n create: (query: string) => string;\n /** A chip's remove button: `(label) => \"Remove \" + label`. */\n remove: (label: string) => string;\n /** The button that empties a single choice (\"Clear\"). */\n clear: string;\n /** The button that opens the list (\"Show options\"). */\n toggle: string;\n /** Announced when the results change: `(n) => n + \" results\"`. */\n results: (count: number) => string;\n};\n\nexport const comboboxLabels: ComboboxLabels = {\n empty: \"No results\",\n loading: \"Searching…\",\n error: \"Search unavailable\",\n create: (query) => `Create “${query}”`,\n remove: (label) => `Remove ${label}`,\n clear: \"Clear\",\n toggle: \"Show options\",\n results: (count) => (count === 1 ? \"1 result\" : `${count} results`),\n};\n\ntype BaseProps = {\n /** The visible label of the field, passed translated (also its accessible name). */\n label: string;\n /** Hides the label visually, keeping it as the accessible name (a search bar with its own context). */\n hideLabel?: boolean;\n /** The options, filtered as the person types (by `filter`). */\n options?: readonly ComboboxOption[];\n /** Fetches the options for a query (debounced by `debounce`); the `signal` aborts when a newer query starts. */\n onSearch?: (query: string, signal: AbortSignal) => Promise<readonly ComboboxOption[]>;\n /** The wait, in ms, between the last key and `onSearch`. Default 250. */\n debounce?: number;\n /** Whether an option matches a query. Default: its label contains the query, ignoring case and accents. */\n filter?: (option: ComboboxOption, query: string) => boolean;\n /** Offers to create the query as a new value when no option has that exact label. */\n creatable?: boolean;\n /** Turns a query into the created option (an id from the server…). Default `{ value: query, label: query }`. */\n onCreate?: (query: string) => ComboboxOption;\n /** Keys that create the query at once, as Enter does (`[\",\"]` for tags); a paste is split on them too. */\n separators?: readonly string[];\n /** The input's placeholder, passed translated. */\n placeholder?: string;\n /** A help text under the field. */\n hint?: string;\n /** An error under the field: marks it invalid and is read with it. */\n error?: string;\n /** Not available. */\n disabled?: boolean;\n /** The name of a hidden input holding the value(s), for a plain `<form>` post. */\n name?: string;\n /** The words, passed translated; English by default. */\n labels?: Partial<ComboboxLabels>;\n /** Classes merged on the root. */\n className?: string;\n /** The id of the text input (default: generated). */\n id?: string;\n};\n\ntype SingleProps = BaseProps & {\n /** One value (default) or several. */\n multiple?: false;\n /** The chosen option (controlled), `null` for none. */\n value?: ComboboxOption | null;\n /** The chosen option at first, uncontrolled. */\n defaultValue?: ComboboxOption | null;\n /** Called with the chosen option, or `null` when it is cleared. */\n onValueChange?: (value: ComboboxOption | null) => void;\n /** Most options that can be chosen (several values only). */\n maxSelected?: never;\n};\n\ntype MultipleProps = BaseProps & {\n /** Several values, shown as chips. */\n multiple: true;\n /** The chosen options (controlled). */\n value?: readonly ComboboxOption[];\n /** The chosen options at first, uncontrolled. */\n defaultValue?: readonly ComboboxOption[];\n /** Called with every chosen option. */\n onValueChange?: (value: ComboboxOption[]) => void;\n /** Most options that can be chosen; the list stops offering more past it. */\n maxSelected?: number;\n};\n\nexport type ComboboxProps = SingleProps | MultipleProps;\n\nconst fold = (text: string) => text.normalize(\"NFD\").replace(/\\p{Diacritic}/gu, \"\").toLowerCase();\nconst defaultFilter = (option: ComboboxOption, query: string) => fold(option.label).includes(fold(query.trim()));\n\ntype Item = { kind: \"option\"; option: ComboboxOption } | { kind: \"create\"; query: string };\n\n/** A text field that suggests, filters and completes: one value or several (chips), static or fetched, creatable. */\nexport function Combobox(props: ComboboxProps) {\n const {\n label,\n hideLabel,\n options,\n onSearch,\n debounce = 250,\n filter = defaultFilter,\n creatable,\n onCreate = (query: string) => ({ value: query, label: query }),\n separators,\n placeholder,\n hint,\n error,\n disabled,\n name,\n labels: given,\n className,\n id: givenId,\n } = props;\n const labels = { ...comboboxLabels, ...given };\n const s = combobox();\n const autoId = React.useId();\n const inputId = givenId ?? `${autoId}-input`;\n const hintId = `${autoId}-hint`;\n const errorId = `${autoId}-error`;\n const multiple = props.multiple === true;\n\n const [values, setValues] = useControllable<readonly ComboboxOption[]>(\n props.value === undefined ? undefined : multiple ? (props.value as readonly ComboboxOption[]) : props.value ? [props.value as ComboboxOption] : [],\n multiple ? ((props.defaultValue as readonly ComboboxOption[]) ?? []) : props.defaultValue ? [props.defaultValue as ComboboxOption] : [],\n (next) => (multiple ? (props.onValueChange as ((v: ComboboxOption[]) => void) | undefined)?.([...next]) : (props.onValueChange as ((v: ComboboxOption | null) => void) | undefined)?.(next[0] ?? null)),\n );\n const single = multiple ? null : (values[0] ?? null);\n const [query, setQuery] = React.useState(single?.label ?? \"\");\n const [editing, setEditing] = React.useState(false);\n const [open, setOpenState] = React.useState(false);\n const [remote, setRemote] = React.useState<{ query: string; options: readonly ComboboxOption[]; state: \"idle\" | \"loading\" | \"error\" }>({ query: \"\", options: [], state: \"idle\" });\n const request = React.useRef<AbortController | null>(null);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n // The single choice's label shows in the input while the person is not typing.\n const shownQuery = !multiple && !editing ? (single?.label ?? \"\") : query;\n const searchQuery = editing ? query : \"\";\n\n const search = useDebouncedCallback((text: string) => {\n if (!onSearch) return;\n request.current?.abort();\n const controller = new AbortController();\n request.current = controller;\n onSearch(text, controller.signal).then(\n (found) => !controller.signal.aborted && setRemote({ query: text, options: found, state: \"idle\" }),\n () => !controller.signal.aborted && setRemote({ query: text, options: [], state: \"error\" }),\n );\n }, debounce);\n React.useEffect(() => () => request.current?.abort(), []);\n\n const setOpen = (next: boolean) => {\n if (next && onSearch && remote.state === \"idle\" && remote.query !== searchQuery) {\n setRemote((r) => ({ ...r, state: \"loading\" }));\n search(searchQuery);\n }\n setOpenState(next);\n };\n\n const chosen = new Set(values.map((v) => v.value));\n const source = onSearch ? remote.options : (options ?? []).filter((o) => !searchQuery.trim() || filter(o, searchQuery));\n const full = multiple && props.maxSelected !== undefined && values.length >= props.maxSelected;\n const trimmed = searchQuery.trim();\n const exact = [...source, ...values].some((o) => fold(o.label) === fold(trimmed));\n const items: Item[] = [\n ...source.map((option) => ({ kind: \"option\" as const, option })),\n ...(creatable && trimmed && !exact && !full ? [{ kind: \"create\" as const, query: trimmed }] : []),\n ];\n const isDisabled = (i: number) => {\n const item = items[i];\n if (!item) return true;\n if (item.kind === \"create\") return false;\n return Boolean(item.option.disabled) || (full && !chosen.has(item.option.value));\n };\n\n const commit = (option: ComboboxOption) => {\n if (multiple) {\n setValues(chosen.has(option.value) ? values.filter((v) => v.value !== option.value) : [...values, option]);\n setQuery(\"\");\n listbox.setActive(-1);\n } else {\n setValues([option]);\n setQuery(option.label);\n setEditing(false);\n setOpenState(false);\n }\n };\n const create = (text: string) => {\n const clean = text.trim();\n if (!clean || full) return;\n const existing = [...source, ...values].find((o) => fold(o.label) === fold(clean));\n if (multiple && existing && chosen.has(existing.value)) {\n setQuery(\"\");\n return;\n }\n commit(existing ?? onCreate(clean));\n };\n const pick = (i: number) => {\n const item = items[i];\n if (!item) return;\n if (item.kind === \"create\") create(item.query);\n else commit(item.option);\n };\n\n const listbox = useListbox({ count: items.length, isDisabled, onPick: pick, open, setOpen });\n\n const onChange = (text: string) => {\n setQuery(text);\n setEditing(true);\n listbox.setActive(-1);\n if (onSearch) {\n setRemote((r) => ({ ...r, state: \"loading\" }));\n search(text);\n }\n setOpenState(true);\n if (!multiple && text === \"\" && single) setValues([]);\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (separators?.includes(event.key) && query.trim()) {\n event.preventDefault();\n create(query);\n return;\n }\n if (listbox.onKeyDown(event)) return;\n if (event.key === \"Enter\" && creatable && query.trim()) {\n event.preventDefault();\n create(query);\n } else if (event.key === \"Backspace\" && multiple && query === \"\" && values.length > 0) {\n setValues(values.slice(0, -1));\n } else if (event.key === \"Escape\" && !multiple && editing) {\n setEditing(false);\n setQuery(single?.label ?? \"\");\n }\n };\n\n const onPaste = (event: React.ClipboardEvent<HTMLInputElement>) => {\n if (!separators?.length || !multiple) return;\n const text = event.clipboardData.getData(\"text\");\n const parts = text.split(new RegExp(`[${separators.map((c) => c.replace(/[\\\\\\]^-]/g, \"\\\\$&\")).join(\"\")}\\\\n]`)).map((p) => p.trim()).filter(Boolean);\n if (parts.length < 2) return;\n event.preventDefault();\n const next = [...values];\n for (const part of parts) {\n if (props.maxSelected !== undefined && next.length >= props.maxSelected) break;\n if (next.some((v) => fold(v.label) === fold(part))) continue;\n next.push((options ?? []).find((o) => fold(o.label) === fold(part)) ?? onCreate(part));\n }\n setValues(next);\n };\n\n const loading = Boolean(onSearch) && remote.state === \"loading\";\n const failed = Boolean(onSearch) && remote.state === \"error\";\n const describedBy = [hint ? hintId : null, error ? errorId : null].filter(Boolean).join(\" \") || undefined;\n\n return (\n <div\n className={s.root({ className })}\n onBlur={(event) => {\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return;\n setOpenState(false);\n if (!multiple) {\n setEditing(false);\n setQuery(single?.label ?? \"\");\n }\n }}\n >\n <label htmlFor={inputId} className={hideLabel ? \"sr-only\" : s.label()}>\n {label}\n </label>\n <div className={s.control()} data-invalid={error ? \"\" : undefined} data-disabled={disabled ? \"\" : undefined} onMouseDown={(event) => {\n if (event.target === event.currentTarget) {\n event.preventDefault();\n inputRef.current?.focus();\n }\n }}>\n {multiple &&\n values.map((option) => (\n <Chip key={option.value} size=\"sm\" removable removeLabel={labels.remove(option.label)} disabled={disabled} onRemove={() => setValues(values.filter((v) => v.value !== option.value))}>\n {option.label}\n </Chip>\n ))}\n <input\n ref={inputRef}\n id={inputId}\n type=\"text\"\n autoComplete=\"off\"\n spellCheck={false}\n {...listbox.inputProps}\n aria-describedby={describedBy}\n aria-invalid={error ? true : undefined}\n aria-busy={loading || undefined}\n value={shownQuery}\n placeholder={multiple && values.length > 0 ? undefined : placeholder}\n disabled={disabled}\n className={s.input()}\n onChange={(event) => onChange(event.target.value)}\n onKeyDown={onKeyDown}\n onPaste={onPaste}\n onClick={() => !open && setOpen(true)}\n />\n {!multiple && single && !disabled ? (\n <button type=\"button\" aria-label={labels.clear} className={s.icon()} onClick={() => {\n setValues([]);\n setQuery(\"\");\n inputRef.current?.focus();\n }}>\n <CloseGlyph className=\"h-4 w-4\" />\n </button>\n ) : null}\n <button type=\"button\" tabIndex={-1} aria-label={labels.toggle} aria-expanded={open} aria-controls={listbox.listId} disabled={disabled} className={s.icon()} onClick={() => {\n setOpen(!open);\n inputRef.current?.focus();\n }}>\n <ChevronGlyph direction={open ? \"up\" : \"down\"} className=\"h-4 w-4\" />\n </button>\n </div>\n {name && values.map((v) => <input key={v.value} type=\"hidden\" name={name} value={v.value} />)}\n <div id={listbox.listId} role=\"listbox\" aria-label={label} aria-multiselectable={multiple || undefined} hidden={!open || (items.length === 0 && !loading && !failed && !labels.empty)} className={s.list()}>\n {open && loading && items.length === 0 ? <div className={s.status()}>{labels.loading}</div> : null}\n {open && failed ? <div className={s.status()}>{labels.error}</div> : null}\n {open && !loading && !failed && items.length === 0 && labels.empty ? <div className={s.status()}>{labels.empty}</div> : null}\n {open &&\n items.map((item, i) =>\n item.kind === \"create\" ? (\n <div key=\"__create\" {...listbox.optionProps(i, false)} className={s.option()}>\n <PlusGlyph className={s.check()} />\n {labels.create(item.query)}\n </div>\n ) : (\n <div key={item.option.value} {...listbox.optionProps(i, chosen.has(item.option.value))} className={s.option()}>\n <span className=\"flex h-4 w-4 shrink-0 items-center justify-center\">{chosen.has(item.option.value) ? <CheckGlyph className={s.check()} /> : null}</span>\n <span className=\"min-w-0 flex-1\">\n {item.option.label}\n {item.option.description ? <span className={s.description()}>{item.option.description}</span> : null}\n </span>\n </div>\n ),\n )}\n </div>\n <span className=\"sr-only\" aria-live=\"polite\" aria-atomic>\n {open && !loading ? labels.results(items.length) : \"\"}\n </span>\n {hint ? (\n <p id={hintId} className={s.hint()}>\n {hint}\n </p>\n ) : null}\n {error ? (\n <p id={errorId} className={s.error()}>\n {error}\n </p>\n ) : null}\n </div>\n );\n}\n"
277
+ },
278
+ {
279
+ "path": "combobox/index.ts",
280
+ "content": "/** @krizaka/ui/combobox — `Combobox` (autocomplete: one value or several in chips, static or fetched, creatable), `combobox` (the slots). Client (\"use client\"). */\nexport { Combobox, combobox, type ComboboxLabels, comboboxLabels, type ComboboxOption, type ComboboxProps } from \"./combobox\";\n"
281
+ },
282
+ {
283
+ "path": "combobox/meta.ts",
284
+ "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Combobox\",\n summary: \"A text field that suggests and completes — one value or several as chips, from a static list or a server, with values created from what was typed.\",\n status: \"beta\",\n category: \"forms\",\n platforms: \"web\",\n whenToUse: [\n \"To choose among many values the person knows by name: a creator, a country, a model, a playlist.\",\n \"With `onSearch` when the values live on a server (debounced, the previous request aborted).\",\n \"With `multiple` for several values (collaborators, categories), and `creatable` when a new one can be added.\",\n ],\n whenNotToUse: [\n { when: \"For fewer than about seven options known in advance: radios or a select.\", use: \"radio-group\" },\n { when: \"For free words without a closed list (tags, keywords): a tag input.\", use: \"tag-input\" },\n { when: \"To run a search and show results: a search field.\", use: \"search-field\" },\n ],\n bestPractices: [\n \"Write `label` as the question (“Collaborators”), the `placeholder` as an example (“Type a name”).\",\n \"Return at most 20 options from `onSearch`; put the best match first.\",\n \"Give options a `description` when names collide (two creators named Eric: their handles).\",\n \"Set `maxSelected` when the product has a limit, and say it in `hint`.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Arrow Down / Arrow Up\", action: \"Open the list and move the active option.\" },\n { keys: \"Home / End\", action: \"First or last option, when the list is open.\" },\n { keys: \"Enter\", action: \"Choose the active option (or create the typed value).\" },\n { keys: \"Esc\", action: \"Close the list; for one value, restore its label.\" },\n { keys: \"Backspace\", action: \"In an empty input, remove the last chip.\" },\n ],\n notes: [\n \"The ARIA 1.2 combobox pattern: the focus stays in the input, `aria-activedescendant` points at the active option of the `listbox`.\",\n \"The number of results is announced in a polite live region (`labels.results`).\",\n \"Chosen options carry `aria-selected`; each chip's remove button is named (“Remove Eric”).\",\n \"The label is a real `<label>`; `hint` and `error` are wired with `aria-describedby`, `error` sets `aria-invalid`.\",\n ],\n },\n related: [\"tag-input\", \"search-field\", \"field\", \"chip\", \"command\"],\n web: {\n imports: [\"Combobox\"],\n examples: [\n { name: \"async\", title: \"From a server\", description: \"`onSearch`: creators fetched as you type, debounced, the stale request aborted.\" },\n { name: \"multiple\", title: \"Several values\", description: \"Collaborators as chips; Backspace removes the last one, at most three.\" },\n { name: \"creatable\", title: \"Create a value\", description: \"Pick a playlist or create one from what was typed.\" },\n { name: \"invalid\", title: \"With an error\", description: \"A required choice left empty: the error is read with the field.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
285
+ },
286
+ {
287
+ "path": "glyphs.tsx",
288
+ "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);\n"
289
+ },
290
+ {
291
+ "path": "listbox.ts",
292
+ "content": "// The ARIA 1.2 combobox engine shared by `combobox`, `tag-input` and `search-field` (client): the focus stays in the\n// text input, the active option is pointed at by `aria-activedescendant`, the arrows walk the enabled options, Enter\n// picks, Escape closes. The caller renders the input and the options; this hook gives them their ARIA and keys.\nimport * as React from \"react\";\n\nexport type ListboxOptions = {\n /** How many options are shown. */\n count: number;\n /** Whether option `i` can be picked. */\n isDisabled?: (index: number) => boolean;\n /** Called when option `i` is picked (Enter or a click). */\n onPick: (index: number) => void;\n /** Whether the list is shown. */\n open: boolean;\n /** Opens or closes the list. */\n setOpen: (open: boolean) => void;\n};\n\nexport function useListbox({ count, isDisabled = () => false, onPick, open, setOpen }: ListboxOptions) {\n const id = React.useId();\n const listId = `${id}-list`;\n const [chosen, setActive] = React.useState(-1);\n // The active option is cleared when the list closes and stays inside it when it shrinks.\n const active = open ? Math.min(chosen, count - 1) : -1;\n const optionId = (index: number) => `${id}-opt-${index}`;\n\n const step = (from: number, delta: 1 | -1) => {\n for (let i = 1; i <= count; i += 1) {\n const next = (from + delta * i + count * 2) % count;\n if (!isDisabled(next)) return next;\n }\n return -1;\n };\n const first = () => step(-1, 1);\n const last = () => step(count, -1);\n\n /** Keys of the text input. Returns `true` when the key was handled (the caller then does nothing else with it). */\n const onKeyDown = (event: React.KeyboardEvent): boolean => {\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault();\n if (!open) {\n setOpen(true);\n setActive(event.altKey ? -1 : first());\n } else setActive(active < 0 ? first() : step(active, 1));\n return true;\n case \"ArrowUp\":\n event.preventDefault();\n if (!open) {\n setOpen(true);\n setActive(last());\n } else setActive(active < 0 ? last() : step(active, -1));\n return true;\n case \"Home\":\n case \"End\":\n if (!open || count === 0) return false;\n event.preventDefault();\n setActive(event.key === \"Home\" ? first() : last());\n return true;\n case \"Enter\":\n if (!open || active < 0) return false;\n event.preventDefault();\n onPick(active);\n return true;\n case \"Escape\":\n if (!open) return false;\n event.preventDefault();\n event.stopPropagation();\n setOpen(false);\n return true;\n case \"Tab\":\n if (open) setOpen(false);\n return false;\n default:\n return false;\n }\n };\n\n // Keeps the active option in view while the arrows walk a long list.\n React.useEffect(() => {\n if (active < 0 || typeof document === \"undefined\") return;\n document.getElementById(`${id}-opt-${active}`)?.scrollIntoView?.({ block: \"nearest\" });\n }, [active, id]);\n\n return {\n listId,\n active,\n setActive,\n optionId,\n onKeyDown,\n /** The ARIA of the text input. */\n inputProps: {\n role: \"combobox\" as const,\n \"aria-expanded\": open,\n \"aria-controls\": listId,\n \"aria-autocomplete\": \"list\" as const,\n \"aria-activedescendant\": open && active >= 0 ? optionId(active) : undefined,\n },\n /** The ARIA and pointer handlers of option `i` (a mouse down keeps the focus in the input). */\n optionProps: (index: number, selected: boolean) => ({\n id: optionId(index),\n role: \"option\" as const,\n \"aria-selected\": selected,\n \"aria-disabled\": isDisabled(index) || undefined,\n \"data-active\": index === active ? \"\" : undefined,\n onMouseDown: (event: React.MouseEvent) => event.preventDefault(),\n onMouseMove: () => !isDisabled(index) && index !== active && setActive(index),\n onClick: () => !isDisabled(index) && onPick(index),\n }),\n };\n}\n"
293
+ },
294
+ {
295
+ "path": "media.ts",
296
+ "content": "// Shared by the data and media primitives (client): the clock format, the reduced-motion preference, the\n// in-view observer, a debounced callback. Never an entry of its own.\nimport * as React from \"react\";\n\n/** Seconds as a clock: `75` → `1:15`, `3725` → `1:02:05`. Negative or unknown values read `0:00`. */\nexport function formatClock(seconds: number): string {\n const s = Number.isFinite(seconds) && seconds > 0 ? Math.floor(seconds) : 0;\n const h = Math.floor(s / 3600);\n const m = Math.floor((s % 3600) / 60);\n const rest = String(s % 60).padStart(2, \"0\");\n return h > 0 ? `${h}:${String(m).padStart(2, \"0\")}:${rest}` : `${m}:${rest}`;\n}\n\n/** Clamps `value` between `min` and `max`. */\nexport const clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\n\nconst REDUCE = \"(prefers-reduced-motion: reduce)\";\nconst subscribeReduce = (notify: () => void) => {\n if (typeof window === \"undefined\" || !window.matchMedia) return () => undefined;\n const query = window.matchMedia(REDUCE);\n query.addEventListener?.(\"change\", notify);\n return () => query.removeEventListener?.(\"change\", notify);\n};\n\n/** `true` when the person asked for less motion (`prefers-reduced-motion: reduce`); follows a change of the setting. */\nexport function usePrefersReducedMotion(): boolean {\n return React.useSyncExternalStore(\n subscribeReduce,\n () => (typeof window !== \"undefined\" && window.matchMedia ? window.matchMedia(REDUCE).matches : false),\n () => false,\n );\n}\n\n/** The latest value of a callback, for an effect or an event that must not re-subscribe when it changes. */\nexport function useLatest<T>(value: T) {\n const ref = React.useRef(value);\n React.useLayoutEffect(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/** Calls `onChange(visible)` when at least `threshold` of the element enters or leaves the viewport. */\nexport function useInView(ref: React.RefObject<Element | null>, onChange: (visible: boolean) => void, enabled = true, threshold = 0.25) {\n const latest = useLatest(onChange);\n React.useEffect(() => {\n const element = ref.current;\n if (!enabled || !element || typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(([entry]) => entry && latest.current(entry.isIntersecting), { threshold });\n observer.observe(element);\n return () => observer.disconnect();\n }, [ref, enabled, threshold, latest]);\n}\n\n/** A stable function that runs `callback` once `delay` ms have passed without a new call; `cancel()` drops the pending one. */\nexport function useDebouncedCallback<A extends unknown[]>(callback: (...args: A) => void, delay: number) {\n const latest = useLatest(callback);\n const [debounced] = React.useState(() => {\n let timer: ReturnType<typeof setTimeout> | undefined;\n let wait = delay;\n const run = (...args: A) => {\n clearTimeout(timer);\n if (wait <= 0) latest.current(...args);\n else timer = setTimeout(() => latest.current(...args), wait);\n };\n return Object.assign(run, {\n cancel: () => clearTimeout(timer),\n setDelay: (next: number) => {\n wait = next;\n },\n });\n });\n React.useEffect(() => debounced.setDelay(delay), [debounced, delay]);\n React.useEffect(() => () => debounced.cancel(), [debounced]);\n return debounced;\n}\n\n/** A value controlled by a prop when it is given, held inside otherwise; `set` calls `onChange` either way. */\nexport function useControllable<T>(value: T | undefined, defaultValue: T, onChange?: (next: T) => void) {\n const [inner, setInner] = React.useState(defaultValue);\n const controlled = value !== undefined;\n const current = controlled ? value : inner;\n const set = React.useCallback(\n (next: T) => {\n if (!controlled) setInner(next);\n onChange?.(next);\n },\n [controlled, onChange],\n );\n return [current, set] as const;\n}\n\n/** Starts a media element without an unhandled rejection (autoplay refused, the source replaced meanwhile). */\nexport function playSafely(media: HTMLMediaElement | null | undefined) {\n try {\n const started = media?.play() as Promise<void> | undefined;\n started?.catch?.(() => undefined);\n } catch {\n // Not playable here (no media support): the controls stay as they are.\n }\n}\n"
297
+ },
298
+ {
299
+ "path": "meta.ts",
300
+ "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"alert\"\n | \"audio-player\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"cn\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"data-table\"\n | \"date-picker\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"loader\"\n | \"marquee\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page-header\"\n | \"pagination\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"theme\"\n | \"toast\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/** The group of the catalogue. `media`: video, sound, camera, files, cropping. */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
301
+ }
302
+ ],
303
+ "dependencies": [
304
+ "tailwind-variants@^3.3.1"
305
+ ],
306
+ "registryDependencies": [
307
+ "chip"
308
+ ],
309
+ "demo": {
310
+ "path": "examples/combobox/async.tsx",
311
+ "content": "\"use client\";\n\nimport { Combobox, type ComboboxOption } from \"@krizaka/ui/combobox\";\n\nconst CREATORS: ComboboxOption[] = [\n { value: \"u1\", label: \"Eric Tremblay\", description: \"@eric.films\" },\n { value: \"u2\", label: \"Erica Moreau\", description: \"@erica\" },\n { value: \"u3\", label: \"Inès Haddad\", description: \"@ines.draws\" },\n { value: \"u4\", label: \"Jonas Weber\", description: \"@jonas\" },\n];\n\n// Your API in place of this one: it receives the query and an AbortSignal.\nasync function searchCreators(query: string, signal: AbortSignal) {\n await new Promise((resolve) => setTimeout(resolve, 300));\n if (signal.aborted) return [];\n const q = query.toLowerCase();\n return CREATORS.filter((c) => c.label.toLowerCase().includes(q) || c.description?.includes(q));\n}\n\nexport default function ComboboxAsync() {\n return <Combobox label=\"Creator\" placeholder=\"Type a name or a handle\" onSearch={searchCreators} />;\n}\n"
312
+ },
313
+ "props": [
314
+ {
315
+ "component": "Combobox",
316
+ "description": "A text field that suggests, filters and completes: one value or several (chips), static or fetched, creatable.",
317
+ "props": [
318
+ {
319
+ "name": "label",
320
+ "type": "string",
321
+ "default": null,
322
+ "description": "The visible label of the field, passed translated (also its accessible name).",
323
+ "required": true
324
+ },
325
+ {
326
+ "name": "className",
327
+ "type": "string",
328
+ "default": null,
329
+ "description": "Classes merged on the root.",
330
+ "required": false
331
+ },
332
+ {
333
+ "name": "creatable",
334
+ "type": "boolean",
335
+ "default": null,
336
+ "description": "Offers to create the query as a new value when no option has that exact label.",
337
+ "required": false
338
+ },
339
+ {
340
+ "name": "debounce",
341
+ "type": "number",
342
+ "default": null,
343
+ "description": "The wait, in ms, between the last key and `onSearch`. Default 250.",
344
+ "required": false
345
+ },
346
+ {
347
+ "name": "defaultValue",
348
+ "type": "ComboboxOption | readonly ComboboxOption[] | null",
349
+ "default": null,
350
+ "description": "The chosen option at first, uncontrolled.\nThe chosen options at first, uncontrolled.",
351
+ "required": false
352
+ },
353
+ {
354
+ "name": "disabled",
355
+ "type": "boolean",
356
+ "default": null,
357
+ "description": "Not available.",
358
+ "required": false
359
+ },
360
+ {
361
+ "name": "error",
362
+ "type": "string",
363
+ "default": null,
364
+ "description": "An error under the field: marks it invalid and is read with it.",
365
+ "required": false
366
+ },
367
+ {
368
+ "name": "filter",
369
+ "type": "((option: ComboboxOption, query: string) => boolean)",
370
+ "default": null,
371
+ "description": "Whether an option matches a query. Default: its label contains the query, ignoring case and accents.",
372
+ "required": false
373
+ },
374
+ {
375
+ "name": "hideLabel",
376
+ "type": "boolean",
377
+ "default": null,
378
+ "description": "Hides the label visually, keeping it as the accessible name (a search bar with its own context).",
379
+ "required": false
380
+ },
381
+ {
382
+ "name": "hint",
383
+ "type": "string",
384
+ "default": null,
385
+ "description": "A help text under the field.",
386
+ "required": false
387
+ },
388
+ {
389
+ "name": "id",
390
+ "type": "string",
391
+ "default": null,
392
+ "description": "The id of the text input (default: generated).",
393
+ "required": false
394
+ },
395
+ {
396
+ "name": "labels",
397
+ "type": "Partial<ComboboxLabels>",
398
+ "default": null,
399
+ "description": "The words, passed translated; English by default.",
400
+ "required": false
401
+ },
402
+ {
403
+ "name": "maxSelected",
404
+ "type": "number",
405
+ "default": null,
406
+ "description": "Most options that can be chosen (several values only).\nMost options that can be chosen; the list stops offering more past it.",
407
+ "required": false
408
+ },
409
+ {
410
+ "name": "multiple",
411
+ "type": "boolean",
412
+ "default": null,
413
+ "description": "One value (default) or several.\nSeveral values, shown as chips.",
414
+ "required": false
415
+ },
416
+ {
417
+ "name": "name",
418
+ "type": "string",
419
+ "default": null,
420
+ "description": "The name of a hidden input holding the value(s), for a plain `<form>` post.",
421
+ "required": false
422
+ },
423
+ {
424
+ "name": "onCreate",
425
+ "type": "((query: string) => ComboboxOption)",
426
+ "default": null,
427
+ "description": "Turns a query into the created option (an id from the server…). Default `{ value: query, label: query }`.",
428
+ "required": false
429
+ },
430
+ {
431
+ "name": "onSearch",
432
+ "type": "((query: string, signal: AbortSignal) => Promise<readonly ComboboxOption[]>)",
433
+ "default": null,
434
+ "description": "Fetches the options for a query (debounced by `debounce`); the `signal` aborts when a newer query starts.",
435
+ "required": false
436
+ },
437
+ {
438
+ "name": "onValueChange",
439
+ "type": "((value: ComboboxOption | null) => void) | ((value: ComboboxOption[]) => void)",
440
+ "default": null,
441
+ "description": "Called with the chosen option, or `null` when it is cleared.\nCalled with every chosen option.",
442
+ "required": false
443
+ },
444
+ {
445
+ "name": "options",
446
+ "type": "readonly ComboboxOption[]",
447
+ "default": null,
448
+ "description": "The options, filtered as the person types (by `filter`).",
449
+ "required": false
450
+ },
451
+ {
452
+ "name": "placeholder",
453
+ "type": "string",
454
+ "default": null,
455
+ "description": "The input's placeholder, passed translated.",
456
+ "required": false
457
+ },
458
+ {
459
+ "name": "separators",
460
+ "type": "readonly string[]",
461
+ "default": null,
462
+ "description": "Keys that create the query at once, as Enter does (`[\",\"]` for tags); a paste is split on them too.",
463
+ "required": false
464
+ },
465
+ {
466
+ "name": "value",
467
+ "type": "ComboboxOption | readonly ComboboxOption[] | null",
468
+ "default": null,
469
+ "description": "The chosen option (controlled), `null` for none.\nThe chosen options (controlled).",
470
+ "required": false
471
+ }
472
+ ]
473
+ }
474
+ ]
475
+ }
@@ -243,7 +243,7 @@
243
243
  },
244
244
  {
245
245
  "path": "meta.ts",
246
- "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"alert\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"cn\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"kbd\"\n | \"mascots\"\n | \"page-header\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"switch\"\n | \"tabs\"\n | \"theme\"\n | \"toast\"\n | \"tooltip\"\n | \"txt\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/** The group of the catalogue. */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
246
+ "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"alert\"\n | \"audio-player\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"cn\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"data-table\"\n | \"date-picker\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"loader\"\n | \"marquee\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page-header\"\n | \"pagination\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"theme\"\n | \"toast\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/** The group of the catalogue. `media`: video, sound, camera, files, cropping. */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
247
247
  }
248
248
  ],
249
249
  "dependencies": [