@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,385 @@
1
+ {
2
+ "name": "video-trimmer",
3
+ "type": "primitive",
4
+ "title": "Video trimmer",
5
+ "summary": "The trim timeline of a video editor: two edge handles over a filmstrip frame the part kept, the outside dimmed, a playhead to scrub — every part stylable, the keyboard included.",
6
+ "description": "The trim timeline of a video editor: two edge handles over a filmstrip frame the part kept, the outside dimmed, a playhead to scrub — every part stylable, the keyboard included.",
7
+ "status": "beta",
8
+ "category": "media",
9
+ "platforms": "web",
10
+ "whenToUse": [
11
+ "To keep a part of a clip before publishing it: a story, a highlight, a reply.",
12
+ "To choose a segment of any timeline (a sound with a waveform as `children`, a recording)."
13
+ ],
14
+ "whenNotToUse": [
15
+ {
16
+ "when": "For one value or a range of numbers without a media: a slider.",
17
+ "use": "slider"
18
+ },
19
+ {
20
+ "when": "To play a video: the video player.",
21
+ "use": "video-player"
22
+ }
23
+ ],
24
+ "bestPractices": [
25
+ "Render the preview on `onValueCommit` (the end of a drag), not on every move.",
26
+ "Set `minLength` to the shortest clip the product accepts, and `largeStep` to a second.",
27
+ "Make the filmstrip from a few frames of the clip (8 to 12), the same width each.",
28
+ "Restyle any part with `classNames` and the handles with `renderHandle`; the alignment stays (each handle on its value by its outer edge)."
29
+ ],
30
+ "accessibility": {
31
+ "keyboard": [
32
+ {
33
+ "keys": "Arrow keys",
34
+ "action": "Move the focused handle (or the playhead) by `step`; with Shift by `largeStep`."
35
+ },
36
+ {
37
+ "keys": "Page Up / Page Down",
38
+ "action": "Move by `largeStep`."
39
+ },
40
+ {
41
+ "keys": "Home / End",
42
+ "action": "To the start or the end, as far as the other handle allows."
43
+ }
44
+ ],
45
+ "notes": [
46
+ "Each handle is a `slider` named by a prop (“Start”, “End”), its bounds set by the other handle and `minLength`.",
47
+ "The values are read as times (`aria-valuetext`, `formatTime`), not as seconds.",
48
+ "The playhead is a slider too when `onSeek` is given; read-only otherwise."
49
+ ]
50
+ },
51
+ "related": [
52
+ "slider",
53
+ "video-player",
54
+ "audio-player"
55
+ ],
56
+ "web": {
57
+ "entry": "@krizaka/ui/video-trimmer",
58
+ "import": "import { VideoTrimmer } from \"@krizaka/ui/video-trimmer\";",
59
+ "props": [
60
+ {
61
+ "component": "VideoTrimmer",
62
+ "description": "Keeps a part of a clip between two handles over its filmstrip, with a playhead to scrub — the keyboard included.",
63
+ "props": [
64
+ {
65
+ "name": "duration",
66
+ "type": "number",
67
+ "default": null,
68
+ "description": "The length of the clip, in seconds.",
69
+ "required": true
70
+ },
71
+ {
72
+ "name": "children",
73
+ "type": "ReactNode",
74
+ "default": null,
75
+ "description": "Track content instead of the filmstrip (a waveform, a coloured band).",
76
+ "required": false
77
+ },
78
+ {
79
+ "name": "classNames",
80
+ "type": "Partial<Record<\"root\" | \"base\" | \"header\" | \"track\" | \"range\" | \"frame\" | \"kept\" | \"strip\" | \"shade\" | \"grip\" | \"handle\" | \"playhead\", string>>",
81
+ "default": "{}",
82
+ "description": "Classes per part: `root`, `header`, `kept`, `track`, `strip`, `frame`, `shade`, `range`, `handle`, `grip`, `playhead`.",
83
+ "required": false
84
+ },
85
+ {
86
+ "name": "defaultValue",
87
+ "type": "readonly [number, number]",
88
+ "default": null,
89
+ "description": "The part kept at first, uncontrolled. Default: the whole clip.",
90
+ "required": false
91
+ },
92
+ {
93
+ "name": "disabled",
94
+ "type": "boolean",
95
+ "default": null,
96
+ "description": "Not available (a render is running).",
97
+ "required": false
98
+ },
99
+ {
100
+ "name": "formatTime",
101
+ "type": "((seconds: number) => string)",
102
+ "default": "(seconds: number) => `${formatClock(seconds)}.${Math.floor((Math.max(0, seconds) % 1) * 10)}`",
103
+ "description": "A time as read and shown. Default `m:ss` with tenths.",
104
+ "required": false
105
+ },
106
+ {
107
+ "name": "frames",
108
+ "type": "readonly string[]",
109
+ "default": null,
110
+ "description": "Pictures of the clip, in order: the filmstrip.",
111
+ "required": false
112
+ },
113
+ {
114
+ "name": "labels",
115
+ "type": "Partial<VideoTrimmerLabels>",
116
+ "default": null,
117
+ "description": "The words, passed translated; English by default.",
118
+ "required": false
119
+ },
120
+ {
121
+ "name": "largeStep",
122
+ "type": "number",
123
+ "default": "1",
124
+ "description": "Shift + arrow, Page Up / Page Down, in seconds. Default 1.",
125
+ "required": false
126
+ },
127
+ {
128
+ "name": "minLength",
129
+ "type": "number",
130
+ "default": "0.5",
131
+ "description": "The shortest part that can be kept, in seconds. Default 0.5.",
132
+ "required": false
133
+ },
134
+ {
135
+ "name": "onSeek",
136
+ "type": "((time: number) => void)",
137
+ "default": null,
138
+ "description": "Called when the playhead is moved (a drag on the track, the arrows on the playhead).",
139
+ "required": false
140
+ },
141
+ {
142
+ "name": "onValueChange",
143
+ "type": "((value: [number, number]) => void)",
144
+ "default": null,
145
+ "description": "Called on every move of a handle.",
146
+ "required": false
147
+ },
148
+ {
149
+ "name": "onValueCommit",
150
+ "type": "((value: [number, number]) => void)",
151
+ "default": null,
152
+ "description": "Called once a drag or a key press ends: render a preview, save.",
153
+ "required": false
154
+ },
155
+ {
156
+ "name": "renderHandle",
157
+ "type": "((edge: \"start\" | \"end\") => ReactNode)",
158
+ "default": null,
159
+ "description": "The content of a handle (default: two grip lines).",
160
+ "required": false
161
+ },
162
+ {
163
+ "name": "showHeader",
164
+ "type": "boolean",
165
+ "default": "true",
166
+ "description": "Shows the times and the length kept above the track. Default `true`.",
167
+ "required": false
168
+ },
169
+ {
170
+ "name": "step",
171
+ "type": "number",
172
+ "default": "0.1",
173
+ "description": "One arrow press, in seconds. Default 0.1.",
174
+ "required": false
175
+ },
176
+ {
177
+ "name": "time",
178
+ "type": "number",
179
+ "default": null,
180
+ "description": "The time played, in seconds: shows the playhead.",
181
+ "required": false
182
+ },
183
+ {
184
+ "name": "value",
185
+ "type": "readonly [number, number]",
186
+ "default": null,
187
+ "description": "The part kept, `[start, end]` in seconds (controlled).",
188
+ "required": false
189
+ }
190
+ ]
191
+ }
192
+ ],
193
+ "examples": [
194
+ {
195
+ "name": "filmstrip",
196
+ "title": "Filmstrip",
197
+ "description": "A 42-second clip, 12 seconds kept, frames in the track.",
198
+ "path": "examples/video-trimmer/filmstrip.tsx",
199
+ "module": "@krizaka/ui/registry/examples/video-trimmer/filmstrip",
200
+ "code": "\"use client\";\n\nimport { VideoTrimmer } from \"@krizaka/ui/video-trimmer\";\nimport * as React from \"react\";\n\nconst TOUR = \"https://www.krizaka.com/assets/orochia/tour\";\nconst FRAMES = [\"alex-discover\", \"alex-story\", \"alex-bid\", \"elena-earnings\", \"elena-publish\", \"alex-unlock\", \"elena-live\", \"alex-back\"].map((n) => `${TOUR}/${n}.jpg`);\n\n// A 42-second clip: keep 12 seconds of it. Render the preview on commit, not on every move.\nexport default function VideoTrimmerFilmstrip() {\n const [kept, setKept] = React.useState<[number, number]>([8, 20]);\n return <VideoTrimmer duration={42} value={kept} onValueChange={setKept} frames={FRAMES} labels={{ kept: (length) => `${length} kept` }} />;\n}\n"
201
+ },
202
+ {
203
+ "name": "playhead",
204
+ "title": "With the playhead",
205
+ "description": "`time` and `onSeek`: the playhead stays within the part kept.",
206
+ "path": "examples/video-trimmer/playhead.tsx",
207
+ "module": "@krizaka/ui/registry/examples/video-trimmer/playhead",
208
+ "code": "\"use client\";\n\nimport { VideoTrimmer } from \"@krizaka/ui/video-trimmer\";\nimport * as React from \"react\";\n\nconst FRAMES = [\"alex-discover\", \"alex-story\", \"alex-bid\", \"elena-earnings\", \"elena-publish\", \"alex-unlock\"].map((n) => `https://www.krizaka.com/assets/orochia/tour/${n}.jpg`);\n\n// The playhead follows the video's time; a drag on the track (or its arrows) seeks within the part kept.\nexport default function VideoTrimmerPlayhead() {\n const [kept, setKept] = React.useState<[number, number]>([3, 24]);\n const [time, setTime] = React.useState(11.5);\n return <VideoTrimmer duration={30} value={kept} onValueChange={setKept} time={time} onSeek={setTime} frames={FRAMES} minLength={2} />;\n}\n"
209
+ },
210
+ {
211
+ "name": "custom",
212
+ "title": "Custom parts",
213
+ "description": "`classNames` and `renderHandle`: thin handles over a waveform band.",
214
+ "path": "examples/video-trimmer/custom.tsx",
215
+ "module": "@krizaka/ui/registry/examples/video-trimmer/custom",
216
+ "code": "\"use client\";\n\nimport { VideoTrimmer } from \"@krizaka/ui/video-trimmer\";\n\nconst BARS = Array.from({ length: 64 }, (_, i) => 0.25 + Math.abs(Math.sin(i * 0.7)) * 0.75);\n\n// Every part takes its own classes: thin handles, a shorter track, a waveform as its content.\nexport default function VideoTrimmerCustom() {\n return (\n <VideoTrimmer\n duration={180}\n defaultValue={[42, 96]}\n step={1}\n largeStep={10}\n classNames={{ track: \"h-12 bg-surface-1\", handle: \"w-3 bg-fg-accent\", range: \"border-y-2 border-fg-accent\" }}\n renderHandle={() => <span className=\"h-5 w-0.5 rounded-full bg-surface-0\" />}\n labels={{ start: \"Start of the extract\", end: \"End of the extract\", kept: (length) => `Extract: ${length}` }}\n >\n <div className=\"flex h-full w-full items-center gap-[2px] px-1\">\n {BARS.map((peak, i) => (\n <span key={i} className=\"flex-1 rounded-full bg-border-strong\" style={{ height: `${peak * 80}%` }} />\n ))}\n </div>\n </VideoTrimmer>\n );\n}\n"
217
+ }
218
+ ]
219
+ },
220
+ "native": null,
221
+ "files": [
222
+ {
223
+ "path": "media.ts",
224
+ "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"
225
+ },
226
+ {
227
+ "path": "meta.ts",
228
+ "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"
229
+ },
230
+ {
231
+ "path": "video-trimmer/index.ts",
232
+ "content": "/** @krizaka/ui/video-trimmer — `VideoTrimmer` (two edge handles over a filmstrip, a playhead, every part stylable), `videoTrimmer` (the slots). Client (\"use client\"). */\nexport { VideoTrimmer, videoTrimmer, type VideoTrimmerLabels, videoTrimmerLabels, type VideoTrimmerProps } from \"./video-trimmer\";\n"
233
+ },
234
+ {
235
+ "path": "video-trimmer/meta.ts",
236
+ "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Video trimmer\",\n summary: \"The trim timeline of a video editor: two edge handles over a filmstrip frame the part kept, the outside dimmed, a playhead to scrub — every part stylable, the keyboard included.\",\n status: \"beta\",\n category: \"media\",\n platforms: \"web\",\n whenToUse: [\n \"To keep a part of a clip before publishing it: a story, a highlight, a reply.\",\n \"To choose a segment of any timeline (a sound with a waveform as `children`, a recording).\",\n ],\n whenNotToUse: [\n { when: \"For one value or a range of numbers without a media: a slider.\", use: \"slider\" },\n { when: \"To play a video: the video player.\", use: \"video-player\" },\n ],\n bestPractices: [\n \"Render the preview on `onValueCommit` (the end of a drag), not on every move.\",\n \"Set `minLength` to the shortest clip the product accepts, and `largeStep` to a second.\",\n \"Make the filmstrip from a few frames of the clip (8 to 12), the same width each.\",\n \"Restyle any part with `classNames` and the handles with `renderHandle`; the alignment stays (each handle on its value by its outer edge).\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Arrow keys\", action: \"Move the focused handle (or the playhead) by `step`; with Shift by `largeStep`.\" },\n { keys: \"Page Up / Page Down\", action: \"Move by `largeStep`.\" },\n { keys: \"Home / End\", action: \"To the start or the end, as far as the other handle allows.\" },\n ],\n notes: [\n \"Each handle is a `slider` named by a prop (“Start”, “End”), its bounds set by the other handle and `minLength`.\",\n \"The values are read as times (`aria-valuetext`, `formatTime`), not as seconds.\",\n \"The playhead is a slider too when `onSeek` is given; read-only otherwise.\",\n ],\n },\n related: [\"slider\", \"video-player\", \"audio-player\"],\n web: {\n imports: [\"VideoTrimmer\"],\n examples: [\n { name: \"filmstrip\", title: \"Filmstrip\", description: \"A 42-second clip, 12 seconds kept, frames in the track.\" },\n { name: \"playhead\", title: \"With the playhead\", description: \"`time` and `onSeek`: the playhead stays within the part kept.\" },\n { name: \"custom\", title: \"Custom parts\", description: \"`classNames` and `renderHandle`: thin handles over a waveform band.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
237
+ },
238
+ {
239
+ "path": "video-trimmer/video-trimmer.tsx",
240
+ "content": "// Client. The trim timeline of a video editor: the clip as a filmstrip (or any track content), the part kept framed\n// between two edge handles — each a `slider` named by a prop, its value read as a time, never past the other one —\n// the outside dimmed, and a playhead to scrub. The handles sit on their value by their outer edge (the start handle\n// to the right of its value, the end handle to its left), so the frame encloses exactly what is kept. Every part\n// takes its own classes (`classNames`) and the handles their own content (`renderHandle`).\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { clamp, formatClock } from \"../media\";\n\nexport const videoTrimmer = tv({\n slots: {\n root: \"w-full select-none\",\n header: \"mb-2 flex items-center justify-between font-mono text-[11px] tabular-nums text-fg-secondary\",\n kept: \"rounded-full bg-accent-soft px-2.5 py-0.5 font-sans text-xs font-semibold text-fg\",\n track: \"relative h-16 touch-none rounded-xl bg-surface-2 data-[disabled]:opacity-50\",\n strip: \"pointer-events-none absolute inset-0 flex overflow-hidden rounded-xl\",\n frame: \"h-full min-w-0 flex-1 object-cover\",\n shade: \"pointer-events-none absolute inset-y-0 bg-scrim-strong\",\n range: \"pointer-events-none absolute inset-y-0 border-y-[3px] border-accent\",\n handle:\n \"absolute inset-y-0 z-10 flex w-6 cursor-ew-resize items-center justify-center bg-accent text-on-accent shadow-md \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 \" +\n \"data-[edge=start]:rounded-l-xl data-[edge=end]:-translate-x-full data-[edge=end]:rounded-r-xl\",\n grip: \"flex gap-[3px] [&>span]:h-5 [&>span]:w-[2px] [&>span]:rounded-sm [&>span]:bg-on-accent/70\",\n playhead:\n \"absolute -inset-y-1.5 z-20 w-[3px] -translate-x-1/2 cursor-ew-resize rounded-full bg-fg shadow-md \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n },\n});\n\ntype Part = keyof ReturnType<typeof videoTrimmer>;\n\nexport type VideoTrimmerLabels = {\n /** The start handle (\"Start\"). */\n start: string;\n /** The end handle (\"End\"). */\n end: string;\n /** The playhead (\"Playhead\"). */\n playhead: string;\n /** The length kept, above the track: `(length) => length + \" kept\"` (the length already formatted). */\n kept: (length: string) => string;\n};\n\nexport const videoTrimmerLabels: VideoTrimmerLabels = {\n start: \"Start\",\n end: \"End\",\n playhead: \"Playhead\",\n kept: (length) => `${length} kept`,\n};\n\nexport type VideoTrimmerProps = {\n /** The length of the clip, in seconds. */\n duration: number;\n /** The part kept, `[start, end]` in seconds (controlled). */\n value?: readonly [number, number];\n /** The part kept at first, uncontrolled. Default: the whole clip. */\n defaultValue?: readonly [number, number];\n /** Called on every move of a handle. */\n onValueChange?: (value: [number, number]) => void;\n /** Called once a drag or a key press ends: render a preview, save. */\n onValueCommit?: (value: [number, number]) => void;\n /** The time played, in seconds: shows the playhead. */\n time?: number;\n /** Called when the playhead is moved (a drag on the track, the arrows on the playhead). */\n onSeek?: (time: number) => void;\n /** The shortest part that can be kept, in seconds. Default 0.5. */\n minLength?: number;\n /** One arrow press, in seconds. Default 0.1. */\n step?: number;\n /** Shift + arrow, Page Up / Page Down, in seconds. Default 1. */\n largeStep?: number;\n /** Pictures of the clip, in order: the filmstrip. */\n frames?: readonly string[];\n /** Track content instead of the filmstrip (a waveform, a coloured band). */\n children?: React.ReactNode;\n /** A time as read and shown. Default `m:ss` with tenths. */\n formatTime?: (seconds: number) => string;\n /** Shows the times and the length kept above the track. Default `true`. */\n showHeader?: boolean;\n /** Not available (a render is running). */\n disabled?: boolean;\n /** Classes per part: `root`, `header`, `kept`, `track`, `strip`, `frame`, `shade`, `range`, `handle`, `grip`, `playhead`. */\n classNames?: Partial<Record<Part, string>>;\n /** The content of a handle (default: two grip lines). */\n renderHandle?: (edge: \"start\" | \"end\") => React.ReactNode;\n /** The words, passed translated; English by default. */\n labels?: Partial<VideoTrimmerLabels>;\n};\n\nconst tenths = (seconds: number) => `${formatClock(seconds)}.${Math.floor((Math.max(0, seconds) % 1) * 10)}`;\n\ntype Grip = \"start\" | \"end\" | \"playhead\";\n\n/** Keeps a part of a clip between two handles over its filmstrip, with a playhead to scrub — the keyboard included. */\nexport function VideoTrimmer({\n duration,\n value: valueProp,\n defaultValue,\n onValueChange,\n onValueCommit,\n time,\n onSeek,\n minLength = 0.5,\n step = 0.1,\n largeStep = 1,\n frames,\n children,\n formatTime = tenths,\n showHeader = true,\n disabled,\n classNames = {},\n renderHandle,\n labels: given,\n}: VideoTrimmerProps) {\n const labels = { ...videoTrimmerLabels, ...given };\n const s = videoTrimmer();\n const track = React.useRef<HTMLDivElement>(null);\n const grip = React.useRef<Grip | null>(null);\n const [inner, setInner] = React.useState<[number, number]>(() => [defaultValue?.[0] ?? 0, defaultValue?.[1] ?? duration]);\n const [start, end] = valueProp ?? inner;\n const total = duration > 0 ? duration : 1;\n const pct = (seconds: number) => (clamp(seconds, 0, total) / total) * 100;\n\n const set = (next: [number, number], commit = false) => {\n if (!valueProp) setInner(next);\n onValueChange?.(next);\n if (commit) onValueCommit?.(next);\n };\n const move = (edge: \"start\" | \"end\", to: number, commit = false) => {\n const next: [number, number] =\n edge === \"start\" ? [clamp(to, 0, end - minLength), end] : [start, clamp(to, start + minLength, duration)];\n set([Math.round(next[0] * 1000) / 1000, Math.round(next[1] * 1000) / 1000], commit);\n };\n const seek = (to: number) => onSeek?.(clamp(to, start, Math.max(start, end - 0.05)));\n\n const at = (clientX: number) => {\n const box = track.current?.getBoundingClientRect();\n if (!box || box.width === 0) return 0;\n return clamp(((clientX - box.left) / box.width) * duration, 0, duration);\n };\n\n const keys = (which: Grip) => (event: React.KeyboardEvent) => {\n const current = which === \"start\" ? start : which === \"end\" ? end : (time ?? start);\n const big = largeStep;\n const small = event.shiftKey ? largeStep : step;\n const target: Record<string, number> = {\n ArrowLeft: current - small,\n ArrowDown: current - small,\n ArrowRight: current + small,\n ArrowUp: current + small,\n PageDown: current - big,\n PageUp: current + big,\n Home: 0,\n End: duration,\n };\n const to = target[event.key];\n if (to === undefined || disabled) return;\n event.preventDefault();\n if (which === \"playhead\") seek(to);\n else move(which, to, true);\n };\n\n const handle = (edge: \"start\" | \"end\") => {\n const own = edge === \"start\" ? start : end;\n return (\n <div\n key={edge}\n role=\"slider\"\n tabIndex={disabled ? -1 : 0}\n aria-label={edge === \"start\" ? labels.start : labels.end}\n aria-valuemin={edge === \"start\" ? 0 : Math.round((start + minLength) * 10) / 10}\n aria-valuemax={edge === \"start\" ? Math.round((end - minLength) * 10) / 10 : Math.round(duration * 10) / 10}\n aria-valuenow={Math.round(own * 10) / 10}\n aria-valuetext={formatTime(own)}\n aria-disabled={disabled || undefined}\n data-edge={edge}\n className={s.handle({ className: classNames.handle })}\n style={{ left: `${pct(own)}%` }}\n onPointerDown={(event) => {\n if (disabled) return;\n event.stopPropagation();\n track.current?.setPointerCapture?.(event.pointerId);\n grip.current = edge;\n }}\n onKeyDown={keys(edge)}\n >\n {renderHandle ? (\n renderHandle(edge)\n ) : (\n <span className={s.grip({ className: classNames.grip })}>\n <span />\n <span />\n </span>\n )}\n </div>\n );\n };\n\n return (\n <div className={s.root({ className: classNames.root })}>\n {showHeader && (\n <div className={s.header({ className: classNames.header })}>\n <span>{formatTime(start)}</span>\n <span className={s.kept({ className: classNames.kept })}>{labels.kept(formatTime(end - start))}</span>\n <span>{formatTime(end)}</span>\n </div>\n )}\n <div\n ref={track}\n className={s.track({ className: classNames.track })}\n data-disabled={disabled ? \"\" : undefined}\n onPointerDown={(event) => {\n if (disabled) return;\n track.current?.setPointerCapture?.(event.pointerId);\n const t = at(event.clientX);\n grip.current = onSeek ? \"playhead\" : Math.abs(t - start) < Math.abs(t - end) ? \"start\" : \"end\";\n if (grip.current === \"playhead\") seek(t);\n else move(grip.current, t);\n }}\n onPointerMove={(event) => {\n if (!grip.current) return;\n const t = at(event.clientX);\n if (grip.current === \"playhead\") seek(t);\n else move(grip.current, t);\n }}\n onPointerUp={() => {\n if (grip.current && grip.current !== \"playhead\") onValueCommit?.([start, end]);\n grip.current = null;\n }}\n onPointerCancel={() => {\n grip.current = null;\n }}\n >\n <div className={s.strip({ className: classNames.strip })}>\n {children ?? frames?.map((src, i) => <img key={`${i}-${src}`} src={src} alt=\"\" draggable={false} className={s.frame({ className: classNames.frame })} />)}\n </div>\n <div className={s.shade({ className: classNames.shade })} style={{ left: 0, width: `${pct(start)}%`, borderRadius: \"0.75rem 0 0 0.75rem\" }} />\n <div className={s.shade({ className: classNames.shade })} style={{ right: 0, width: `${100 - pct(end)}%`, borderRadius: \"0 0.75rem 0.75rem 0\" }} />\n <div className={s.range({ className: classNames.range })} style={{ left: `${pct(start)}%`, right: `${100 - pct(end)}%` }} />\n {time !== undefined && (\n <div\n role=\"slider\"\n tabIndex={disabled || !onSeek ? -1 : 0}\n aria-label={labels.playhead}\n aria-valuemin={Math.round(start * 10) / 10}\n aria-valuemax={Math.round(end * 10) / 10}\n aria-valuenow={Math.round(time * 10) / 10}\n aria-valuetext={formatTime(time)}\n aria-readonly={!onSeek || undefined}\n className={s.playhead({ className: classNames.playhead })}\n style={{ left: `${pct(time)}%` }}\n onKeyDown={onSeek ? keys(\"playhead\") : undefined}\n />\n )}\n {handle(\"start\")}\n {handle(\"end\")}\n </div>\n </div>\n );\n}\n"
241
+ }
242
+ ],
243
+ "dependencies": [
244
+ "tailwind-variants@^3.3.1"
245
+ ],
246
+ "registryDependencies": [],
247
+ "demo": {
248
+ "path": "examples/video-trimmer/filmstrip.tsx",
249
+ "content": "\"use client\";\n\nimport { VideoTrimmer } from \"@krizaka/ui/video-trimmer\";\nimport * as React from \"react\";\n\nconst TOUR = \"https://www.krizaka.com/assets/orochia/tour\";\nconst FRAMES = [\"alex-discover\", \"alex-story\", \"alex-bid\", \"elena-earnings\", \"elena-publish\", \"alex-unlock\", \"elena-live\", \"alex-back\"].map((n) => `${TOUR}/${n}.jpg`);\n\n// A 42-second clip: keep 12 seconds of it. Render the preview on commit, not on every move.\nexport default function VideoTrimmerFilmstrip() {\n const [kept, setKept] = React.useState<[number, number]>([8, 20]);\n return <VideoTrimmer duration={42} value={kept} onValueChange={setKept} frames={FRAMES} labels={{ kept: (length) => `${length} kept` }} />;\n}\n"
250
+ },
251
+ "props": [
252
+ {
253
+ "component": "VideoTrimmer",
254
+ "description": "Keeps a part of a clip between two handles over its filmstrip, with a playhead to scrub — the keyboard included.",
255
+ "props": [
256
+ {
257
+ "name": "duration",
258
+ "type": "number",
259
+ "default": null,
260
+ "description": "The length of the clip, in seconds.",
261
+ "required": true
262
+ },
263
+ {
264
+ "name": "children",
265
+ "type": "ReactNode",
266
+ "default": null,
267
+ "description": "Track content instead of the filmstrip (a waveform, a coloured band).",
268
+ "required": false
269
+ },
270
+ {
271
+ "name": "classNames",
272
+ "type": "Partial<Record<\"root\" | \"base\" | \"header\" | \"track\" | \"range\" | \"frame\" | \"kept\" | \"strip\" | \"shade\" | \"grip\" | \"handle\" | \"playhead\", string>>",
273
+ "default": "{}",
274
+ "description": "Classes per part: `root`, `header`, `kept`, `track`, `strip`, `frame`, `shade`, `range`, `handle`, `grip`, `playhead`.",
275
+ "required": false
276
+ },
277
+ {
278
+ "name": "defaultValue",
279
+ "type": "readonly [number, number]",
280
+ "default": null,
281
+ "description": "The part kept at first, uncontrolled. Default: the whole clip.",
282
+ "required": false
283
+ },
284
+ {
285
+ "name": "disabled",
286
+ "type": "boolean",
287
+ "default": null,
288
+ "description": "Not available (a render is running).",
289
+ "required": false
290
+ },
291
+ {
292
+ "name": "formatTime",
293
+ "type": "((seconds: number) => string)",
294
+ "default": "(seconds: number) => `${formatClock(seconds)}.${Math.floor((Math.max(0, seconds) % 1) * 10)}`",
295
+ "description": "A time as read and shown. Default `m:ss` with tenths.",
296
+ "required": false
297
+ },
298
+ {
299
+ "name": "frames",
300
+ "type": "readonly string[]",
301
+ "default": null,
302
+ "description": "Pictures of the clip, in order: the filmstrip.",
303
+ "required": false
304
+ },
305
+ {
306
+ "name": "labels",
307
+ "type": "Partial<VideoTrimmerLabels>",
308
+ "default": null,
309
+ "description": "The words, passed translated; English by default.",
310
+ "required": false
311
+ },
312
+ {
313
+ "name": "largeStep",
314
+ "type": "number",
315
+ "default": "1",
316
+ "description": "Shift + arrow, Page Up / Page Down, in seconds. Default 1.",
317
+ "required": false
318
+ },
319
+ {
320
+ "name": "minLength",
321
+ "type": "number",
322
+ "default": "0.5",
323
+ "description": "The shortest part that can be kept, in seconds. Default 0.5.",
324
+ "required": false
325
+ },
326
+ {
327
+ "name": "onSeek",
328
+ "type": "((time: number) => void)",
329
+ "default": null,
330
+ "description": "Called when the playhead is moved (a drag on the track, the arrows on the playhead).",
331
+ "required": false
332
+ },
333
+ {
334
+ "name": "onValueChange",
335
+ "type": "((value: [number, number]) => void)",
336
+ "default": null,
337
+ "description": "Called on every move of a handle.",
338
+ "required": false
339
+ },
340
+ {
341
+ "name": "onValueCommit",
342
+ "type": "((value: [number, number]) => void)",
343
+ "default": null,
344
+ "description": "Called once a drag or a key press ends: render a preview, save.",
345
+ "required": false
346
+ },
347
+ {
348
+ "name": "renderHandle",
349
+ "type": "((edge: \"start\" | \"end\") => ReactNode)",
350
+ "default": null,
351
+ "description": "The content of a handle (default: two grip lines).",
352
+ "required": false
353
+ },
354
+ {
355
+ "name": "showHeader",
356
+ "type": "boolean",
357
+ "default": "true",
358
+ "description": "Shows the times and the length kept above the track. Default `true`.",
359
+ "required": false
360
+ },
361
+ {
362
+ "name": "step",
363
+ "type": "number",
364
+ "default": "0.1",
365
+ "description": "One arrow press, in seconds. Default 0.1.",
366
+ "required": false
367
+ },
368
+ {
369
+ "name": "time",
370
+ "type": "number",
371
+ "default": null,
372
+ "description": "The time played, in seconds: shows the playhead.",
373
+ "required": false
374
+ },
375
+ {
376
+ "name": "value",
377
+ "type": "readonly [number, number]",
378
+ "default": null,
379
+ "description": "The part kept, `[start, end]` in seconds (controlled).",
380
+ "required": false
381
+ }
382
+ ]
383
+ }
384
+ ]
385
+ }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/dialog/dialog.tsx"],"sourcesContent":["// Client (a portal). Radix does the focus trap, the scroll lock, Escape, the outside click, aria-modal, the\n// aria-labelledby / aria-describedby wiring and the focus return: this file only holds the shape.\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { IconButton } from \"../button/button\";\n\nexport const dialog = tv({\n slots: {\n overlay: \"kz-overlay fixed inset-0 z-50 bg-overlay backdrop-blur-xs\",\n content:\n \"kz-dialog fixed z-50 flex flex-col overflow-hidden border border-border-default bg-surface-1 text-fg shadow-lg focus:outline-hidden\",\n close: \"absolute right-3 top-3 h-9 w-9\",\n header: \"flex flex-col gap-1 px-5 pb-2 pr-14 pt-5\",\n title: \"text-base font-bold text-fg\",\n description: \"text-sm text-fg-secondary\",\n body: \"min-h-0 flex-1 overflow-y-auto px-5 pb-5\",\n footer:\n \"flex flex-wrap items-center justify-end gap-2 border-t border-border-subtle px-5 py-4 pb-[max(1rem,env(safe-area-inset-bottom))]\",\n },\n variants: {\n placement: {\n center: { content: \"left-1/2 top-1/2 max-h-[85dvh] w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl\" },\n /* A sheet: anchored at the bottom on a phone, centred from `sm` up. */\n bottom: {\n content:\n \"inset-x-0 bottom-0 max-h-[92dvh] rounded-t-[1.75rem] sm:bottom-auto sm:left-1/2 sm:top-1/2 sm:w-full \" +\n \"sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-[1.75rem]\",\n },\n right: { content: \"inset-y-0 right-0 h-full w-full max-w-md rounded-none border-y-0 border-r-0\" },\n },\n size: { sm: { content: \"sm:max-w-sm\" }, md: { content: \"sm:max-w-md\" }, lg: { content: \"sm:max-w-2xl\" } },\n },\n defaultVariants: { placement: \"center\", size: \"md\" },\n});\nconst s = dialog();\n\nexport type DialogVariants = VariantProps<typeof dialog>;\n\nfunction CloseIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n );\n}\n\ntype CloseButtonProps =\n | {\n /** The accessible name of the close button — passed translated. */\n closeLabel: string;\n /** Leaves the close button out (the content brings its own way out, or none: see `dismissible`). */\n hideClose?: false;\n }\n | { closeLabel?: string; hideClose: true };\n\nexport type DialogContentProps = React.ComponentProps<typeof DialogPrimitive.Content> &\n DialogVariants &\n CloseButtonProps & {\n /**\n * center · bottom (a sheet on a phone, centred from `sm` up) · right (a side panel, full height).\n * @default \"center\"\n */\n placement?: DialogVariants[\"placement\"];\n /**\n * sm · md · lg: the width of the dialog.\n * @default \"md\"\n */\n size?: DialogVariants[\"size\"];\n /**\n * `false`: Escape and a click outside do not close it (a gate the user must answer: age, terms). It still closes\n * through `open` / `onOpenChange` and any `Dialog.Close` inside. Default `true`.\n */\n dismissible?: boolean;\n /** The element the portal renders into (default: document.body). */\n container?: HTMLElement | null;\n };\n\nconst prevent = (event: Event) => event.preventDefault();\n\n/** The dialog itself, portalled over a dimmed overlay, with a close button. Give it a `Dialog.Title`. */\nexport function DialogContent({\n placement,\n size,\n closeLabel,\n hideClose,\n dismissible = true,\n container,\n className,\n children,\n onEscapeKeyDown,\n onPointerDownOutside,\n onInteractOutside,\n ...props\n}: DialogContentProps) {\n const v = dialog({ placement, size });\n return (\n <DialogPrimitive.Portal container={container}>\n <DialogPrimitive.Overlay className={v.overlay()} />\n <DialogPrimitive.Content\n data-placement={placement ?? \"center\"}\n data-dismissible={dismissible ? undefined : \"false\"}\n className={v.content({ className })}\n onEscapeKeyDown={dismissible ? onEscapeKeyDown : chain(onEscapeKeyDown, prevent)}\n onPointerDownOutside={dismissible ? onPointerDownOutside : chain(onPointerDownOutside, prevent)}\n onInteractOutside={dismissible ? onInteractOutside : chain(onInteractOutside, prevent)}\n {...props}\n >\n {children}\n {!hideClose && (\n <DialogPrimitive.Close asChild>\n <IconButton label={closeLabel as string} variant=\"ghost\" shape=\"pill\" className={v.close()}>\n <CloseIcon />\n </IconButton>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n}\n\nfunction chain<E extends Event>(handler: ((event: E) => void) | undefined, then: (event: E) => void) {\n return (event: E) => {\n handler?.(event);\n then(event);\n };\n}\n\nexport function DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={s.header({ className })} {...props} />;\n}\n\nexport function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return <DialogPrimitive.Title className={s.title({ className })} {...props} />;\n}\n\nexport function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return <DialogPrimitive.Description className={s.description({ className })} {...props} />;\n}\n\nexport function DialogBody({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={s.body({ className })} {...props} />;\n}\n\nexport function DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={s.footer({ className })} {...props} />;\n}\n\n/** `Dialog.Root/Trigger/Content/Header/Title/Description/Body/Footer/Close`. `open`/`defaultOpen` + `onOpenChange`. */\nexport const Dialog = {\n Root: DialogPrimitive.Root,\n Trigger: DialogPrimitive.Trigger,\n Close: DialogPrimitive.Close,\n Content: DialogContent,\n Header: DialogHeader,\n Title: DialogTitle,\n Description: DialogDescription,\n Body: DialogBody,\n Footer: DialogFooter,\n};\n\n/** `Omit` that keeps the close-button union (`closeLabel` required unless `hideClose`). */\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;\n\nexport type SheetProps = DistributiveOmit<DialogContentProps, \"placement\">;\n\n/** A sheet is a dialog anchored at the bottom (centred from `sm` up): `Dialog.Content placement=\"bottom\"`. */\nexport function Sheet(props: SheetProps) {\n return <DialogContent placement=\"bottom\" {...props} />;\n}\n"],"mappings":";;;;;;AAEA,SAAS,UAAU,uBAAuB;AAE1C,SAAS,UAA6B;AAuChC,cAyDA,YAzDA;AAnCC,IAAM,SAAS,GAAG;AAAA,EACvB,OAAO;AAAA,IACL,SAAS;AAAA,IACT,SACE;AAAA,IACF,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,QACE;AAAA,EACJ;AAAA,EACA,UAAU;AAAA,IACR,WAAW;AAAA,MACT,QAAQ,EAAE,SAAS,kGAAkG;AAAA;AAAA,MAErH,QAAQ;AAAA,QACN,SACE;AAAA,MAEJ;AAAA,MACA,OAAO,EAAE,SAAS,8EAA8E;AAAA,IAClG;AAAA,IACA,MAAM,EAAE,IAAI,EAAE,SAAS,cAAc,GAAG,IAAI,EAAE,SAAS,cAAc,GAAG,IAAI,EAAE,SAAS,eAAe,EAAE;AAAA,EAC1G;AAAA,EACA,iBAAiB,EAAE,WAAW,UAAU,MAAM,KAAK;AACrD,CAAC;AACD,IAAM,IAAI,OAAO;AAIjB,SAAS,YAAY;AACnB,SACE,oBAAC,SAAI,SAAQ,aAAY,WAAU,WAAU,MAAK,QAAO,QAAO,gBAAe,aAAY,KAAI,eAAc,SAAQ,eAAW,MAC9H,8BAAC,UAAK,GAAE,wBAAuB,GACjC;AAEJ;AAiCA,IAAM,UAAU,CAAC,UAAiB,MAAM,eAAe;AAGhD,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAuB;AACrB,QAAM,IAAI,OAAO,EAAE,WAAW,KAAK,CAAC;AACpC,SACE,qBAAC,gBAAgB,QAAhB,EAAuB,WACtB;AAAA,wBAAC,gBAAgB,SAAhB,EAAwB,WAAW,EAAE,QAAQ,GAAG;AAAA,IACjD;AAAA,MAAC,gBAAgB;AAAA,MAAhB;AAAA,QACC,kBAAgB,aAAa;AAAA,QAC7B,oBAAkB,cAAc,SAAY;AAAA,QAC5C,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAC;AAAA,QAClC,iBAAiB,cAAc,kBAAkB,MAAM,iBAAiB,OAAO;AAAA,QAC/E,sBAAsB,cAAc,uBAAuB,MAAM,sBAAsB,OAAO;AAAA,QAC9F,mBAAmB,cAAc,oBAAoB,MAAM,mBAAmB,OAAO;AAAA,QACpF,GAAG;AAAA,QAEH;AAAA;AAAA,UACA,CAAC,aACA,oBAAC,gBAAgB,OAAhB,EAAsB,SAAO,MAC5B,8BAAC,cAAW,OAAO,YAAsB,SAAQ,SAAQ,OAAM,QAAO,WAAW,EAAE,MAAM,GACvF,8BAAC,aAAU,GACb,GACF;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF;AAEJ;AAEA,SAAS,MAAuB,SAA2C,MAA0B;AACnG,SAAO,CAAC,UAAa;AACnB,cAAU,KAAK;AACf,SAAK,KAAK;AAAA,EACZ;AACF;AAEO,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAAgC;AACjF,SAAO,oBAAC,SAAI,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AAC7D;AAEO,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAAuD;AACvG,SAAO,oBAAC,gBAAgB,OAAhB,EAAsB,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AAC9E;AAEO,SAAS,kBAAkB,EAAE,WAAW,GAAG,MAAM,GAA6D;AACnH,SAAO,oBAAC,gBAAgB,aAAhB,EAA4B,WAAW,EAAE,YAAY,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AAC1F;AAEO,SAAS,WAAW,EAAE,WAAW,GAAG,MAAM,GAAgC;AAC/E,SAAO,oBAAC,SAAI,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AAC3D;AAEO,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAAgC;AACjF,SAAO,oBAAC,SAAI,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AAC7D;AAGO,IAAM,SAAS;AAAA,EACpB,MAAM,gBAAgB;AAAA,EACtB,SAAS,gBAAgB;AAAA,EACzB,OAAO,gBAAgB;AAAA,EACvB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,QAAQ;AACV;AAQO,SAAS,MAAM,OAAmB;AACvC,SAAO,oBAAC,iBAAc,WAAU,UAAU,GAAG,OAAO;AACtD;","names":[]}
@@ -1,51 +0,0 @@
1
- "use client";
2
-
3
- // src/button/button.tsx
4
- import { Slot } from "radix-ui";
5
- import { tv } from "tailwind-variants";
6
- import { jsx } from "react/jsx-runtime";
7
- var buttonVariants = tv({
8
- base: "inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 disabled:pointer-events-none disabled:opacity-40 data-loading:cursor-progress active:scale-[0.98]",
9
- variants: {
10
- variant: {
11
- primary: "bg-accent text-on-accent shadow-sm hover:bg-accent-hover",
12
- // The brand's signature: accent → accent-2 (on-accent reads on both stops, tested in @krizaka/tokens).
13
- gradient: "bg-linear-to-r from-accent to-accent-2 text-on-accent shadow-sm hover:brightness-110",
14
- secondary: "border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3",
15
- outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent",
16
- ghost: "text-fg-secondary hover:bg-surface-2 hover:text-fg",
17
- // The border and the tint carry the danger; the label stays the primary text role, legible on the tint at rest
18
- // and hovered over every surface (`text-fg-danger` is for text set directly on a surface).
19
- danger: "border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20"
20
- },
21
- size: { sm: "h-8 px-3 text-xs", md: "h-10 px-4 text-sm", lg: "h-12 px-6 text-sm", icon: "h-10 w-10" },
22
- shape: { rounded: "rounded-lg", pill: "rounded-full" }
23
- },
24
- defaultVariants: { variant: "secondary", size: "md", shape: "rounded" }
25
- });
26
- function Button({ asChild, loading, variant, size, shape, className, disabled, ...props }) {
27
- const Comp = asChild ? Slot.Root : "button";
28
- return /* @__PURE__ */ jsx(
29
- Comp,
30
- {
31
- type: asChild ? void 0 : "button",
32
- "aria-busy": loading || void 0,
33
- "data-loading": loading ? "" : void 0,
34
- "data-variant": variant ?? "secondary",
35
- disabled: asChild ? void 0 : disabled || loading,
36
- "aria-disabled": asChild && (disabled || loading) ? true : void 0,
37
- className: buttonVariants({ variant, size, shape, className }),
38
- ...props
39
- }
40
- );
41
- }
42
- function IconButton({ label, size = "icon", ...props }) {
43
- return /* @__PURE__ */ jsx(Button, { "aria-label": label, title: label, size, ...props });
44
- }
45
-
46
- export {
47
- buttonVariants,
48
- Button,
49
- IconButton
50
- };
51
- //# sourceMappingURL=chunk-PESA2R4U.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/button/button.tsx"],"sourcesContent":["// Server-safe: no hook, no context. `buttonVariants` styles a <Link> or a Server Component without the component.\nimport { Slot } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const buttonVariants = tv({\n base:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-all \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 \" +\n \"disabled:pointer-events-none disabled:opacity-40 data-loading:cursor-progress active:scale-[0.98]\",\n variants: {\n variant: {\n primary: \"bg-accent text-on-accent shadow-sm hover:bg-accent-hover\",\n // The brand's signature: accent → accent-2 (on-accent reads on both stops, tested in @krizaka/tokens).\n gradient: \"bg-linear-to-r from-accent to-accent-2 text-on-accent shadow-sm hover:brightness-110\",\n secondary: \"border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3\",\n outline: \"border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent\",\n ghost: \"text-fg-secondary hover:bg-surface-2 hover:text-fg\",\n // The border and the tint carry the danger; the label stays the primary text role, legible on the tint at rest\n // and hovered over every surface (`text-fg-danger` is for text set directly on a surface).\n danger: \"border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20\",\n },\n size: { sm: \"h-8 px-3 text-xs\", md: \"h-10 px-4 text-sm\", lg: \"h-12 px-6 text-sm\", icon: \"h-10 w-10\" },\n shape: { rounded: \"rounded-lg\", pill: \"rounded-full\" },\n },\n defaultVariants: { variant: \"secondary\", size: \"md\", shape: \"rounded\" },\n});\n\nexport type ButtonVariants = VariantProps<typeof buttonVariants>;\n\nexport type ButtonProps = React.ComponentProps<\"button\"> &\n ButtonVariants & {\n /**\n * The look: `primary` (the accent), `gradient` (accent → accent-2), `secondary` (a raised surface), `outline`,\n * `ghost`, `danger`.\n * @default \"secondary\"\n */\n variant?: ButtonVariants[\"variant\"];\n /**\n * sm · md · lg, or `icon` (a square).\n * @default \"md\"\n */\n size?: ButtonVariants[\"size\"];\n /**\n * rounded · pill.\n * @default \"rounded\"\n */\n shape?: ButtonVariants[\"shape\"];\n /** Renders the child (e.g. a <Link>) instead of the <button>, with props, classes and ref merged. */\n asChild?: boolean;\n /** Disables and signals the wait (aria-busy, data-loading) — the product adds a spinner if it wants one. */\n loading?: boolean;\n };\n\nexport function Button({ asChild, loading, variant, size, shape, className, disabled, ...props }: ButtonProps) {\n const Comp = asChild ? Slot.Root : \"button\";\n return (\n <Comp\n type={asChild ? undefined : \"button\"}\n aria-busy={loading || undefined}\n data-loading={loading ? \"\" : undefined}\n data-variant={variant ?? \"secondary\"}\n disabled={asChild ? undefined : disabled || loading}\n aria-disabled={asChild && (disabled || loading) ? true : undefined}\n className={buttonVariants({ variant, size, shape, className })}\n {...props}\n />\n );\n}\n\nexport type IconButtonProps = Omit<ButtonProps, \"size\"> & {\n /** The accessible name (and tooltip) of the button — required, passed translated. */\n label: string;\n /**\n * sm · md · lg, or `icon` (a square).\n * @default \"icon\"\n */\n size?: ButtonProps[\"size\"];\n};\n\n/** An icon-only button: `label` is required, it is its accessible name. */\nexport function IconButton({ label, size = \"icon\", ...props }: IconButtonProps) {\n return <Button aria-label={label} title={label} size={size} {...props} />;\n}\n"],"mappings":";;;AACA,SAAS,YAAY;AAErB,SAAS,UAA6B;AAsDlC;AApDG,IAAM,iBAAiB,GAAG;AAAA,EAC/B,MACE;AAAA,EAGF,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA;AAAA,MAET,UAAU;AAAA,MACV,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA;AAAA;AAAA,MAGP,QAAQ;AAAA,IACV;AAAA,IACA,MAAM,EAAE,IAAI,oBAAoB,IAAI,qBAAqB,IAAI,qBAAqB,MAAM,YAAY;AAAA,IACpG,OAAO,EAAE,SAAS,cAAc,MAAM,eAAe;AAAA,EACvD;AAAA,EACA,iBAAiB,EAAE,SAAS,aAAa,MAAM,MAAM,OAAO,UAAU;AACxE,CAAC;AA4BM,SAAS,OAAO,EAAE,SAAS,SAAS,SAAS,MAAM,OAAO,WAAW,UAAU,GAAG,MAAM,GAAgB;AAC7G,QAAM,OAAO,UAAU,KAAK,OAAO;AACnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,UAAU,SAAY;AAAA,MAC5B,aAAW,WAAW;AAAA,MACtB,gBAAc,UAAU,KAAK;AAAA,MAC7B,gBAAc,WAAW;AAAA,MACzB,UAAU,UAAU,SAAY,YAAY;AAAA,MAC5C,iBAAe,YAAY,YAAY,WAAW,OAAO;AAAA,MACzD,WAAW,eAAe,EAAE,SAAS,MAAM,OAAO,UAAU,CAAC;AAAA,MAC5D,GAAG;AAAA;AAAA,EACN;AAEJ;AAaO,SAAS,WAAW,EAAE,OAAO,OAAO,QAAQ,GAAG,MAAM,GAAoB;AAC9E,SAAO,oBAAC,UAAO,cAAY,OAAO,OAAO,OAAO,MAAa,GAAG,OAAO;AACzE;","names":[]}
@@ -1,11 +0,0 @@
1
- "use client";
2
-
3
- // registry/examples/spinner/muted.tsx
4
- import { Spinner } from "@krizaka/ui/spinner";
5
- import { jsx } from "react/jsx-runtime";
6
- function SpinnerMuted() {
7
- return /* @__PURE__ */ jsx(Spinner, { label: "Loading", className: "text-fg-secondary" });
8
- }
9
- export {
10
- SpinnerMuted as default
11
- };
@@ -1,6 +0,0 @@
1
- import { Spinner } from "@krizaka/ui/spinner";
2
-
3
- // The colour follows `className` (here a text role).
4
- export default function SpinnerMuted() {
5
- return <Spinner label="Loading" className="text-fg-secondary" />;
6
- }