@krizaka/ui 3.3.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (477) hide show
  1. package/dist/activity-feed.d.ts +199 -0
  2. package/dist/activity-feed.js +155 -0
  3. package/dist/activity-feed.js.map +1 -0
  4. package/dist/chat.d.ts +187 -0
  5. package/dist/chat.js +132 -0
  6. package/dist/chat.js.map +1 -0
  7. package/dist/chunk-7Z4KHPFC.js +42 -0
  8. package/dist/chunk-7Z4KHPFC.js.map +1 -0
  9. package/dist/chunk-ECSCA3CN.js +128 -0
  10. package/dist/chunk-ECSCA3CN.js.map +1 -0
  11. package/dist/chunk-F2GKFIYK.js +47 -0
  12. package/dist/chunk-F2GKFIYK.js.map +1 -0
  13. package/dist/data-table.js +84 -231
  14. package/dist/data-table.js.map +1 -1
  15. package/dist/description-list.d.ts +105 -0
  16. package/dist/description-list.js +49 -0
  17. package/dist/description-list.js.map +1 -0
  18. package/dist/index.js +13 -66
  19. package/dist/index.js.map +1 -1
  20. package/dist/kanban.d.ts +132 -0
  21. package/dist/kanban.js +187 -0
  22. package/dist/kanban.js.map +1 -0
  23. package/dist/list.d.ts +153 -0
  24. package/dist/list.js +130 -0
  25. package/dist/list.js.map +1 -0
  26. package/dist/map.d.ts +463 -0
  27. package/dist/map.js +952 -0
  28. package/dist/map.js.map +1 -0
  29. package/dist/match-dialog.d.ts +30 -0
  30. package/dist/match-dialog.js +146 -0
  31. package/dist/match-dialog.js.map +1 -0
  32. package/dist/motion.css +12 -1
  33. package/dist/native/map.d.ts +200 -0
  34. package/dist/native/map.js +673 -0
  35. package/dist/native/map.js.map +1 -0
  36. package/dist/native/media-picker.d.ts +58 -0
  37. package/dist/native/media-picker.js +63 -0
  38. package/dist/native/media-picker.js.map +1 -0
  39. package/dist/native.d.ts +952 -75
  40. package/dist/native.js +2572 -889
  41. package/dist/native.js.map +1 -1
  42. package/dist/photo-grid.d.ts +122 -0
  43. package/dist/photo-grid.js +94 -0
  44. package/dist/photo-grid.js.map +1 -0
  45. package/dist/stat.d.ts +31 -2
  46. package/dist/stat.js +21 -4
  47. package/dist/stat.js.map +1 -1
  48. package/dist/step-progress.d.ts +20 -0
  49. package/dist/step-progress.js +17 -0
  50. package/dist/step-progress.js.map +1 -0
  51. package/dist/swipe-deck.d.ts +183 -0
  52. package/dist/swipe-deck.js +144 -0
  53. package/dist/swipe-deck.js.map +1 -0
  54. package/dist/tag-selector.d.ts +26 -0
  55. package/dist/tag-selector.js +21 -0
  56. package/dist/tag-selector.js.map +1 -0
  57. package/dist/tree-view.d.ts +111 -0
  58. package/dist/tree-view.js +154 -0
  59. package/dist/tree-view.js.map +1 -0
  60. package/dist/verified-badge.d.ts +16 -0
  61. package/dist/verified-badge.js +23 -0
  62. package/dist/verified-badge.js.map +1 -0
  63. package/package.json +245 -10
  64. package/registry/achievement.json +1 -1
  65. package/registry/action-bar.json +1 -1
  66. package/registry/action-sheet.json +121 -0
  67. package/registry/activity-feed.json +468 -0
  68. package/registry/alert.json +1 -1
  69. package/registry/app-shell.json +1 -1
  70. package/registry/argument-card.json +1 -1
  71. package/registry/audio-player.json +1 -1
  72. package/registry/auth-layout.json +1 -1
  73. package/registry/avatar.json +58 -3
  74. package/registry/badge.json +1 -1
  75. package/registry/button.json +1 -1
  76. package/registry/card-grid.json +1 -1
  77. package/registry/card.json +1 -1
  78. package/registry/catalogue-page.json +1 -1
  79. package/registry/changelog-page.json +1 -1
  80. package/registry/chat.json +917 -0
  81. package/registry/checkbox.json +1 -1
  82. package/registry/chip-link.json +1 -1
  83. package/registry/chip.json +1 -1
  84. package/registry/choice-grid.json +1 -1
  85. package/registry/code-block.json +1 -1
  86. package/registry/combobox.json +1 -1
  87. package/registry/command.json +1 -1
  88. package/registry/component-page.json +1 -1
  89. package/registry/confirm-button.json +1 -1
  90. package/registry/contact-page.json +1 -1
  91. package/registry/continue-prompt.json +1 -1
  92. package/registry/countdown.json +1 -1
  93. package/registry/cta-panel.json +1 -1
  94. package/registry/dashboard-layout.json +1 -1
  95. package/registry/data-table.json +1 -1
  96. package/registry/date-picker.json +2 -2
  97. package/registry/decision-list.json +1 -1
  98. package/registry/description-list.json +232 -0
  99. package/registry/detail-layout.json +1 -1
  100. package/registry/dialog.json +1 -1
  101. package/registry/docs-article-page.json +1 -1
  102. package/registry/docs-hub-page.json +1 -1
  103. package/registry/docs-layout.json +1 -1
  104. package/registry/dropdown-menu.json +1 -1
  105. package/registry/empty-state.json +1 -1
  106. package/registry/error-page.json +1 -1
  107. package/registry/examples/action-sheet/native/video-actions.d.ts +4 -0
  108. package/registry/examples/action-sheet/native/video-actions.dark.png +0 -0
  109. package/registry/examples/action-sheet/native/video-actions.js +30 -0
  110. package/registry/examples/action-sheet/native/video-actions.light.png +0 -0
  111. package/registry/examples/action-sheet/native/video-actions.tsx +24 -0
  112. package/registry/examples/activity-feed/job-activity.d.ts +4 -0
  113. package/registry/examples/activity-feed/job-activity.js +21 -0
  114. package/registry/examples/activity-feed/job-activity.tsx +17 -0
  115. package/registry/examples/activity-feed/live.d.ts +4 -0
  116. package/registry/examples/activity-feed/live.js +23 -0
  117. package/registry/examples/activity-feed/live.tsx +24 -0
  118. package/registry/examples/activity-feed/native/notifications.d.ts +4 -0
  119. package/registry/examples/activity-feed/native/notifications.dark.png +0 -0
  120. package/registry/examples/activity-feed/native/notifications.js +18 -0
  121. package/registry/examples/activity-feed/native/notifications.light.png +0 -0
  122. package/registry/examples/activity-feed/native/notifications.tsx +18 -0
  123. package/registry/examples/activity-feed/timeline.d.ts +4 -0
  124. package/registry/examples/activity-feed/timeline.js +25 -0
  125. package/registry/examples/activity-feed/timeline.tsx +19 -0
  126. package/registry/examples/avatar/native/presence.d.ts +4 -0
  127. package/registry/examples/avatar/native/presence.dark.png +0 -0
  128. package/registry/examples/avatar/native/presence.js +18 -0
  129. package/registry/examples/avatar/native/presence.light.png +0 -0
  130. package/registry/examples/avatar/native/presence.tsx +15 -0
  131. package/registry/examples/chat/conversation.d.ts +4 -0
  132. package/registry/examples/chat/conversation.js +22 -0
  133. package/registry/examples/chat/conversation.tsx +21 -0
  134. package/registry/examples/chat/inbox.d.ts +4 -0
  135. package/registry/examples/chat/inbox.js +15 -0
  136. package/registry/examples/chat/inbox.tsx +12 -0
  137. package/registry/examples/chat/native/conversation.d.ts +4 -0
  138. package/registry/examples/chat/native/conversation.dark.png +0 -0
  139. package/registry/examples/chat/native/conversation.js +23 -0
  140. package/registry/examples/chat/native/conversation.light.png +0 -0
  141. package/registry/examples/chat/native/conversation.tsx +20 -0
  142. package/registry/examples/chat/native/inbox.d.ts +4 -0
  143. package/registry/examples/chat/native/inbox.dark.png +0 -0
  144. package/registry/examples/chat/native/inbox.js +16 -0
  145. package/registry/examples/chat/native/inbox.light.png +0 -0
  146. package/registry/examples/chat/native/inbox.tsx +13 -0
  147. package/registry/examples/description-list/job-details.d.ts +4 -0
  148. package/registry/examples/description-list/job-details.js +23 -0
  149. package/registry/examples/description-list/job-details.tsx +17 -0
  150. package/registry/examples/description-list/key-value-grid.d.ts +4 -0
  151. package/registry/examples/description-list/key-value-grid.js +22 -0
  152. package/registry/examples/description-list/key-value-grid.tsx +16 -0
  153. package/registry/examples/description-list/native/job-details.d.ts +4 -0
  154. package/registry/examples/description-list/native/job-details.dark.png +0 -0
  155. package/registry/examples/description-list/native/job-details.js +33 -0
  156. package/registry/examples/description-list/native/job-details.light.png +0 -0
  157. package/registry/examples/description-list/native/job-details.tsx +24 -0
  158. package/registry/examples/description-list/receipt.d.ts +4 -0
  159. package/registry/examples/description-list/receipt.js +23 -0
  160. package/registry/examples/description-list/receipt.tsx +17 -0
  161. package/registry/examples/fab/native/extended.d.ts +4 -0
  162. package/registry/examples/fab/native/extended.dark.png +0 -0
  163. package/registry/examples/fab/native/extended.js +18 -0
  164. package/registry/examples/fab/native/extended.light.png +0 -0
  165. package/registry/examples/fab/native/extended.tsx +23 -0
  166. package/registry/examples/header/native/large-title.d.ts +4 -0
  167. package/registry/examples/header/native/large-title.dark.png +0 -0
  168. package/registry/examples/header/native/large-title.js +23 -0
  169. package/registry/examples/header/native/large-title.light.png +0 -0
  170. package/registry/examples/header/native/large-title.tsx +31 -0
  171. package/registry/examples/image-viewer/native/gallery.d.ts +4 -0
  172. package/registry/examples/image-viewer/native/gallery.dark.png +0 -0
  173. package/registry/examples/image-viewer/native/gallery.js +22 -0
  174. package/registry/examples/image-viewer/native/gallery.light.png +0 -0
  175. package/registry/examples/image-viewer/native/gallery.tsx +21 -0
  176. package/registry/examples/kanban/moderation.d.ts +4 -0
  177. package/registry/examples/kanban/moderation.js +35 -0
  178. package/registry/examples/kanban/moderation.tsx +37 -0
  179. package/registry/examples/list/jobs.d.ts +4 -0
  180. package/registry/examples/list/jobs.js +35 -0
  181. package/registry/examples/list/jobs.tsx +33 -0
  182. package/registry/examples/list/selectable.d.ts +4 -0
  183. package/registry/examples/list/selectable.js +33 -0
  184. package/registry/examples/list/selectable.tsx +30 -0
  185. package/registry/examples/list/virtualized.d.ts +4 -0
  186. package/registry/examples/list/virtualized.js +22 -0
  187. package/registry/examples/list/virtualized.tsx +17 -0
  188. package/registry/examples/loader/native/block.d.ts +4 -0
  189. package/registry/examples/loader/native/block.dark.png +0 -0
  190. package/registry/examples/loader/native/block.js +12 -0
  191. package/registry/examples/loader/native/block.light.png +0 -0
  192. package/registry/examples/loader/native/block.tsx +11 -0
  193. package/registry/examples/loader/native/job-wait.d.ts +4 -0
  194. package/registry/examples/loader/native/job-wait.dark.png +0 -0
  195. package/registry/examples/loader/native/job-wait.js +17 -0
  196. package/registry/examples/loader/native/job-wait.light.png +0 -0
  197. package/registry/examples/loader/native/job-wait.tsx +14 -0
  198. package/registry/examples/map/cluster.d.ts +4 -0
  199. package/registry/examples/map/cluster.js +16 -0
  200. package/registry/examples/map/cluster.tsx +18 -0
  201. package/registry/examples/map/location-picker.d.ts +4 -0
  202. package/registry/examples/map/location-picker.js +24 -0
  203. package/registry/examples/map/location-picker.tsx +22 -0
  204. package/registry/examples/map/native/location-picker.d.ts +4 -0
  205. package/registry/examples/map/native/location-picker.dark.png +0 -0
  206. package/registry/examples/map/native/location-picker.js +14 -0
  207. package/registry/examples/map/native/location-picker.light.png +0 -0
  208. package/registry/examples/map/native/location-picker.tsx +13 -0
  209. package/registry/examples/map/native/places.d.ts +4 -0
  210. package/registry/examples/map/native/places.dark.png +0 -0
  211. package/registry/examples/map/native/places.js +25 -0
  212. package/registry/examples/map/native/places.light.png +0 -0
  213. package/registry/examples/map/native/places.tsx +27 -0
  214. package/registry/examples/map/places.d.ts +4 -0
  215. package/registry/examples/map/places.js +28 -0
  216. package/registry/examples/map/places.tsx +28 -0
  217. package/registry/examples/map/static.d.ts +4 -0
  218. package/registry/examples/map/static.js +22 -0
  219. package/registry/examples/map/static.tsx +18 -0
  220. package/registry/examples/match-dialog/its-a-match.d.ts +4 -0
  221. package/registry/examples/match-dialog/its-a-match.js +29 -0
  222. package/registry/examples/match-dialog/its-a-match.tsx +25 -0
  223. package/registry/examples/match-dialog/native/its-a-match.d.ts +4 -0
  224. package/registry/examples/match-dialog/native/its-a-match.dark.png +0 -0
  225. package/registry/examples/match-dialog/native/its-a-match.js +28 -0
  226. package/registry/examples/match-dialog/native/its-a-match.light.png +0 -0
  227. package/registry/examples/match-dialog/native/its-a-match.tsx +22 -0
  228. package/registry/examples/media-picker/native/story.d.ts +4 -0
  229. package/registry/examples/media-picker/native/story.dark.png +0 -0
  230. package/registry/examples/media-picker/native/story.js +30 -0
  231. package/registry/examples/media-picker/native/story.light.png +0 -0
  232. package/registry/examples/media-picker/native/story.tsx +26 -0
  233. package/registry/examples/meter/native/credits.d.ts +4 -0
  234. package/registry/examples/meter/native/credits.dark.png +0 -0
  235. package/registry/examples/meter/native/credits.js +15 -0
  236. package/registry/examples/meter/native/credits.light.png +0 -0
  237. package/registry/examples/meter/native/credits.tsx +12 -0
  238. package/registry/examples/meter/native/split-ring.d.ts +4 -0
  239. package/registry/examples/meter/native/split-ring.dark.png +0 -0
  240. package/registry/examples/meter/native/split-ring.js +24 -0
  241. package/registry/examples/meter/native/split-ring.light.png +0 -0
  242. package/registry/examples/meter/native/split-ring.tsx +19 -0
  243. package/registry/examples/number-ticker/native/balance.d.ts +4 -0
  244. package/registry/examples/number-ticker/native/balance.dark.png +0 -0
  245. package/registry/examples/number-ticker/native/balance.js +18 -0
  246. package/registry/examples/number-ticker/native/balance.light.png +0 -0
  247. package/registry/examples/number-ticker/native/balance.tsx +17 -0
  248. package/registry/examples/onboarding/native/first-launch.d.ts +4 -0
  249. package/registry/examples/onboarding/native/first-launch.dark.png +0 -0
  250. package/registry/examples/onboarding/native/first-launch.js +23 -0
  251. package/registry/examples/onboarding/native/first-launch.light.png +0 -0
  252. package/registry/examples/onboarding/native/first-launch.tsx +19 -0
  253. package/registry/examples/otp-input/native/invalid.d.ts +4 -0
  254. package/registry/examples/otp-input/native/invalid.dark.png +0 -0
  255. package/registry/examples/otp-input/native/invalid.js +15 -0
  256. package/registry/examples/otp-input/native/invalid.light.png +0 -0
  257. package/registry/examples/otp-input/native/invalid.tsx +14 -0
  258. package/registry/examples/otp-input/native/verify.d.ts +4 -0
  259. package/registry/examples/otp-input/native/verify.dark.png +0 -0
  260. package/registry/examples/otp-input/native/verify.js +17 -0
  261. package/registry/examples/otp-input/native/verify.light.png +0 -0
  262. package/registry/examples/otp-input/native/verify.tsx +14 -0
  263. package/registry/examples/permission-prompt/native/blocked.d.ts +4 -0
  264. package/registry/examples/permission-prompt/native/blocked.dark.png +0 -0
  265. package/registry/examples/permission-prompt/native/blocked.js +25 -0
  266. package/registry/examples/permission-prompt/native/blocked.light.png +0 -0
  267. package/registry/examples/permission-prompt/native/blocked.tsx +21 -0
  268. package/registry/examples/permission-prompt/native/camera.d.ts +4 -0
  269. package/registry/examples/permission-prompt/native/camera.dark.png +0 -0
  270. package/registry/examples/permission-prompt/native/camera.js +25 -0
  271. package/registry/examples/permission-prompt/native/camera.light.png +0 -0
  272. package/registry/examples/permission-prompt/native/camera.tsx +21 -0
  273. package/registry/examples/photo-grid/native/profile-photos.d.ts +4 -0
  274. package/registry/examples/photo-grid/native/profile-photos.dark.png +0 -0
  275. package/registry/examples/photo-grid/native/profile-photos.js +27 -0
  276. package/registry/examples/photo-grid/native/profile-photos.light.png +0 -0
  277. package/registry/examples/photo-grid/native/profile-photos.tsx +24 -0
  278. package/registry/examples/photo-grid/profile-photos.d.ts +4 -0
  279. package/registry/examples/photo-grid/profile-photos.js +28 -0
  280. package/registry/examples/photo-grid/profile-photos.tsx +25 -0
  281. package/registry/examples/pull-to-refresh/native/feed.d.ts +4 -0
  282. package/registry/examples/pull-to-refresh/native/feed.dark.png +0 -0
  283. package/registry/examples/pull-to-refresh/native/feed.js +14 -0
  284. package/registry/examples/pull-to-refresh/native/feed.light.png +0 -0
  285. package/registry/examples/pull-to-refresh/native/feed.tsx +19 -0
  286. package/registry/examples/screen/native/app-shell.d.ts +4 -0
  287. package/registry/examples/screen/native/app-shell.dark.png +0 -0
  288. package/registry/examples/screen/native/app-shell.js +25 -0
  289. package/registry/examples/screen/native/app-shell.light.png +0 -0
  290. package/registry/examples/screen/native/app-shell.tsx +33 -0
  291. package/registry/examples/screen/native/auth.d.ts +4 -0
  292. package/registry/examples/screen/native/auth.dark.png +0 -0
  293. package/registry/examples/screen/native/auth.js +24 -0
  294. package/registry/examples/screen/native/auth.light.png +0 -0
  295. package/registry/examples/screen/native/auth.tsx +20 -0
  296. package/registry/examples/screen/native/chat.d.ts +4 -0
  297. package/registry/examples/screen/native/chat.dark.png +0 -0
  298. package/registry/examples/screen/native/chat.js +27 -0
  299. package/registry/examples/screen/native/chat.light.png +0 -0
  300. package/registry/examples/screen/native/chat.tsx +22 -0
  301. package/registry/examples/screen/native/feed.d.ts +4 -0
  302. package/registry/examples/screen/native/feed.dark.png +0 -0
  303. package/registry/examples/screen/native/feed.js +24 -0
  304. package/registry/examples/screen/native/feed.light.png +0 -0
  305. package/registry/examples/screen/native/feed.tsx +34 -0
  306. package/registry/examples/screen/native/profile.d.ts +4 -0
  307. package/registry/examples/screen/native/profile.dark.png +0 -0
  308. package/registry/examples/screen/native/profile.js +29 -0
  309. package/registry/examples/screen/native/profile.light.png +0 -0
  310. package/registry/examples/screen/native/profile.tsx +27 -0
  311. package/registry/examples/screen/native/settings.d.ts +4 -0
  312. package/registry/examples/screen/native/settings.dark.png +0 -0
  313. package/registry/examples/screen/native/settings.js +20 -0
  314. package/registry/examples/screen/native/settings.light.png +0 -0
  315. package/registry/examples/screen/native/settings.tsx +19 -0
  316. package/registry/examples/search-field/native/cancel.d.ts +4 -0
  317. package/registry/examples/search-field/native/cancel.dark.png +0 -0
  318. package/registry/examples/search-field/native/cancel.js +14 -0
  319. package/registry/examples/search-field/native/cancel.light.png +0 -0
  320. package/registry/examples/search-field/native/cancel.tsx +13 -0
  321. package/registry/examples/stat/grid.d.ts +4 -0
  322. package/registry/examples/stat/grid.js +17 -0
  323. package/registry/examples/stat/grid.tsx +14 -0
  324. package/registry/examples/step-progress/native/sign-up.d.ts +4 -0
  325. package/registry/examples/step-progress/native/sign-up.dark.png +0 -0
  326. package/registry/examples/step-progress/native/sign-up.js +12 -0
  327. package/registry/examples/step-progress/native/sign-up.light.png +0 -0
  328. package/registry/examples/step-progress/native/sign-up.tsx +11 -0
  329. package/registry/examples/step-progress/sign-up.d.ts +4 -0
  330. package/registry/examples/step-progress/sign-up.js +22 -0
  331. package/registry/examples/step-progress/sign-up.tsx +16 -0
  332. package/registry/examples/stepper/native/run.d.ts +4 -0
  333. package/registry/examples/stepper/native/run.dark.png +0 -0
  334. package/registry/examples/stepper/native/run.js +24 -0
  335. package/registry/examples/stepper/native/run.light.png +0 -0
  336. package/registry/examples/stepper/native/run.tsx +20 -0
  337. package/registry/examples/swipe-deck/discover.d.ts +4 -0
  338. package/registry/examples/swipe-deck/discover.js +41 -0
  339. package/registry/examples/swipe-deck/discover.tsx +37 -0
  340. package/registry/examples/swipe-deck/native/discover.d.ts +4 -0
  341. package/registry/examples/swipe-deck/native/discover.dark.png +0 -0
  342. package/registry/examples/swipe-deck/native/discover.js +39 -0
  343. package/registry/examples/swipe-deck/native/discover.light.png +0 -0
  344. package/registry/examples/swipe-deck/native/discover.tsx +35 -0
  345. package/registry/examples/swipeable-row/native/conversation.d.ts +4 -0
  346. package/registry/examples/swipeable-row/native/conversation.dark.png +0 -0
  347. package/registry/examples/swipeable-row/native/conversation.js +30 -0
  348. package/registry/examples/swipeable-row/native/conversation.light.png +0 -0
  349. package/registry/examples/swipeable-row/native/conversation.tsx +27 -0
  350. package/registry/examples/tab-bar/native/main-sections.d.ts +4 -0
  351. package/registry/examples/tab-bar/native/main-sections.dark.png +0 -0
  352. package/registry/examples/tab-bar/native/main-sections.js +29 -0
  353. package/registry/examples/tab-bar/native/main-sections.light.png +0 -0
  354. package/registry/examples/tab-bar/native/main-sections.tsx +30 -0
  355. package/registry/examples/tabs/native/sections.d.ts +4 -0
  356. package/registry/examples/tabs/native/sections.dark.png +0 -0
  357. package/registry/examples/tabs/native/sections.js +23 -0
  358. package/registry/examples/tabs/native/sections.light.png +0 -0
  359. package/registry/examples/tabs/native/sections.tsx +19 -0
  360. package/registry/examples/tabs/native/segmented.d.ts +4 -0
  361. package/registry/examples/tabs/native/segmented.dark.png +0 -0
  362. package/registry/examples/tabs/native/segmented.js +22 -0
  363. package/registry/examples/tabs/native/segmented.light.png +0 -0
  364. package/registry/examples/tabs/native/segmented.tsx +18 -0
  365. package/registry/examples/tag-selector/interests.d.ts +4 -0
  366. package/registry/examples/tag-selector/interests.js +14 -0
  367. package/registry/examples/tag-selector/interests.tsx +12 -0
  368. package/registry/examples/tag-selector/native/interests.d.ts +4 -0
  369. package/registry/examples/tag-selector/native/interests.dark.png +0 -0
  370. package/registry/examples/tag-selector/native/interests.js +15 -0
  371. package/registry/examples/tag-selector/native/interests.light.png +0 -0
  372. package/registry/examples/tag-selector/native/interests.tsx +15 -0
  373. package/registry/examples/toast/native/snackbar.d.ts +4 -0
  374. package/registry/examples/toast/native/snackbar.dark.png +0 -0
  375. package/registry/examples/toast/native/snackbar.js +23 -0
  376. package/registry/examples/toast/native/snackbar.light.png +0 -0
  377. package/registry/examples/toast/native/snackbar.tsx +21 -0
  378. package/registry/examples/tree-view/docs.d.ts +4 -0
  379. package/registry/examples/tree-view/docs.js +24 -0
  380. package/registry/examples/tree-view/docs.tsx +22 -0
  381. package/registry/examples/tree-view/lazy.d.ts +4 -0
  382. package/registry/examples/tree-view/lazy.js +21 -0
  383. package/registry/examples/tree-view/lazy.tsx +19 -0
  384. package/registry/examples/verified-badge/native/verified.d.ts +4 -0
  385. package/registry/examples/verified-badge/native/verified.dark.png +0 -0
  386. package/registry/examples/verified-badge/native/verified.js +18 -0
  387. package/registry/examples/verified-badge/native/verified.light.png +0 -0
  388. package/registry/examples/verified-badge/native/verified.tsx +15 -0
  389. package/registry/examples/verified-badge/verified.d.ts +4 -0
  390. package/registry/examples/verified-badge/verified.js +17 -0
  391. package/registry/examples/verified-badge/verified.tsx +13 -0
  392. package/registry/fab.json +122 -0
  393. package/registry/field.json +1 -1
  394. package/registry/file-upload.json +2 -2
  395. package/registry/filter-bar.json +1 -1
  396. package/registry/form.json +2 -2
  397. package/registry/gallery-page.json +1 -1
  398. package/registry/glow-card.json +1 -1
  399. package/registry/goal-gauge.json +1 -1
  400. package/registry/header.json +137 -0
  401. package/registry/how-it-works-page.json +1 -1
  402. package/registry/image-cropper.json +1 -1
  403. package/registry/image-viewer.json +107 -0
  404. package/registry/index.json +441 -25
  405. package/registry/iso.json +1 -1
  406. package/registry/kanban.json +253 -0
  407. package/registry/kbd.json +1 -1
  408. package/registry/landing-page.json +1 -1
  409. package/registry/landscape.json +1 -1
  410. package/registry/legal-page.json +1 -1
  411. package/registry/link-card.json +1 -1
  412. package/registry/list.json +367 -30
  413. package/registry/loader.json +157 -4
  414. package/registry/longform-page.json +1 -1
  415. package/registry/map.json +1368 -0
  416. package/registry/marketing-layout.json +1 -1
  417. package/registry/marquee.json +1 -1
  418. package/registry/mascot-quote.json +1 -1
  419. package/registry/mascot-state.json +1 -1
  420. package/registry/mascots.json +1 -1
  421. package/registry/match-dialog.json +300 -0
  422. package/registry/media-capture.json +1 -1
  423. package/registry/media-picker.json +129 -0
  424. package/registry/meter.json +136 -4
  425. package/registry/nav-bar.json +1 -1
  426. package/registry/number-ticker.json +96 -4
  427. package/registry/onboarding.json +95 -0
  428. package/registry/otp-input.json +150 -0
  429. package/registry/page-header.json +1 -1
  430. package/registry/page-hero.json +1 -1
  431. package/registry/page.json +1 -1
  432. package/registry/pagination.json +1 -1
  433. package/registry/permission-prompt.json +172 -0
  434. package/registry/photo-grid.json +302 -0
  435. package/registry/pointer-light.json +1 -1
  436. package/registry/popover.json +1 -1
  437. package/registry/pricing-page.json +1 -1
  438. package/registry/product-page.json +1 -1
  439. package/registry/profile-card.json +1 -1
  440. package/registry/progress.json +2 -2
  441. package/registry/promise-card.json +1 -1
  442. package/registry/pull-to-refresh.json +74 -0
  443. package/registry/radio-group.json +1 -1
  444. package/registry/screen.json +184 -0
  445. package/registry/scroll-stage.json +1 -1
  446. package/registry/search-field.json +30 -3
  447. package/registry/section-backdrop.json +1 -1
  448. package/registry/separator.json +1 -1
  449. package/registry/settings-layout.json +1 -1
  450. package/registry/skeleton.json +1 -1
  451. package/registry/slider.json +1 -1
  452. package/registry/slot.json +1 -1
  453. package/registry/spinner.json +1 -1
  454. package/registry/split-view.json +1 -1
  455. package/registry/stage-banner.json +1 -1
  456. package/registry/stat.json +68 -5
  457. package/registry/status-page.json +1 -1
  458. package/registry/step-progress.json +255 -0
  459. package/registry/stepper.json +75 -4
  460. package/registry/swipe-deck.json +512 -0
  461. package/registry/swipeable-row.json +124 -0
  462. package/registry/switch.json +1 -1
  463. package/registry/tab-bar.json +115 -0
  464. package/registry/tabs.json +94 -4
  465. package/registry/tag-input.json +1 -1
  466. package/registry/tag-selector.json +276 -0
  467. package/registry/terminal-replay.json +1 -1
  468. package/registry/theme.json +8 -1
  469. package/registry/toast.json +17 -3
  470. package/registry/toc.json +1 -1
  471. package/registry/tooltip.json +1 -1
  472. package/registry/tree-view.json +291 -0
  473. package/registry/verified-badge.json +202 -0
  474. package/registry/video-player.json +1 -1
  475. package/registry/video-trimmer.json +1 -1
  476. package/registry/virtual.json +1 -1
  477. package/skills/map/SKILL.md +35 -0
@@ -0,0 +1,512 @@
1
+ {
2
+ "name": "swipe-deck",
3
+ "type": "primitive",
4
+ "title": "Swipe deck",
5
+ "summary": "Cards decided one by one — drag right to like, left to pass, or the buttons (← → on the web) — with `PersonCard`: a person's photos, name, age, seal, distance, bio and interests.",
6
+ "description": "Cards decided one by one — drag right to like, left to pass, or the buttons (← → on the web) — with `PersonCard`: a person's photos, name, age, seal, distance, bio and interests.",
7
+ "status": "beta",
8
+ "category": "data-display",
9
+ "platforms": "both",
10
+ "whenToUse": [
11
+ "Discover in a dating app: like or pass, one profile at a time.",
12
+ "Any one-by-one decision: approve or reject, keep or skip."
13
+ ],
14
+ "whenNotToUse": [
15
+ {
16
+ "when": "To browse many items side by side.",
17
+ "use": "list"
18
+ }
19
+ ],
20
+ "bestPractices": [
21
+ "Remove the decided card from `items` in `onSwipe`; keep two or three loaded ahead.",
22
+ "Always keep the buttons: a swipe is never the only way.",
23
+ "Say the decision (`decided`) so a screen reader hears it."
24
+ ],
25
+ "accessibility": {
26
+ "keyboard": [
27
+ {
28
+ "keys": "Arrow Right / Arrow Left",
29
+ "action": "On the focused deck: like or pass the top card."
30
+ },
31
+ {
32
+ "keys": "Tab",
33
+ "action": "Reaches the card's photo buttons and the like and pass buttons."
34
+ }
35
+ ],
36
+ "notes": [
37
+ "The top card is the only one exposed; the next waits hidden from assistive technology.",
38
+ "React Native offers Like and Pass as accessibility actions of the card.",
39
+ "Under reduced motion the card leaves without flying."
40
+ ]
41
+ },
42
+ "related": [
43
+ "verified-badge",
44
+ "match-dialog",
45
+ "photo-grid"
46
+ ],
47
+ "web": {
48
+ "entry": "@krizaka/ui/swipe-deck",
49
+ "import": "import { SwipeDeck, PersonCard } from \"@krizaka/ui/swipe-deck\";",
50
+ "props": [
51
+ {
52
+ "component": "PersonCard",
53
+ "description": "A person on a card: photos full bleed (a side to change), name and age over a scrim, a line, a bio, chips.",
54
+ "props": [
55
+ {
56
+ "name": "name",
57
+ "type": "string",
58
+ "default": null,
59
+ "description": "The name.",
60
+ "required": true
61
+ },
62
+ {
63
+ "name": "photos",
64
+ "type": "readonly { src: string; alt?: string | undefined; }[]",
65
+ "default": null,
66
+ "description": "The person's photos (URLs), the first shown first; click a side, or its buttons, to move between them.",
67
+ "required": true
68
+ },
69
+ {
70
+ "name": "age",
71
+ "type": "number",
72
+ "default": null,
73
+ "description": "The age, written after the name.",
74
+ "required": false
75
+ },
76
+ {
77
+ "name": "badge",
78
+ "type": "ReactNode",
79
+ "default": null,
80
+ "description": "Beside the name: a `VerifiedBadge`.",
81
+ "required": false
82
+ },
83
+ {
84
+ "name": "bio",
85
+ "type": "string",
86
+ "default": null,
87
+ "description": "A sentence about the person.",
88
+ "required": false
89
+ },
90
+ {
91
+ "name": "className",
92
+ "type": "string",
93
+ "default": null,
94
+ "description": "Classes merged on the card.",
95
+ "required": false
96
+ },
97
+ {
98
+ "name": "footer",
99
+ "type": "ReactNode",
100
+ "default": null,
101
+ "description": "At the bottom: the interests as chips.",
102
+ "required": false
103
+ },
104
+ {
105
+ "name": "meta",
106
+ "type": "ReactNode",
107
+ "default": null,
108
+ "description": "A line under the name: a distance, a job.",
109
+ "required": false
110
+ },
111
+ {
112
+ "name": "photoLabels",
113
+ "type": "{ previous: string; next: string; }",
114
+ "default": "{ previous: \"Previous photo\", next: \"Next photo\" }",
115
+ "description": "The photo buttons' words: `{ previous: \"Previous photo\", next: \"Next photo\" }` — passed translated.",
116
+ "required": false
117
+ }
118
+ ]
119
+ },
120
+ {
121
+ "component": "SwipeDeck",
122
+ "description": "A deck of cards decided one by one: drag, the buttons, or ← → — each decision announced.",
123
+ "props": [
124
+ {
125
+ "name": "getId",
126
+ "type": "(item: T) => string",
127
+ "default": null,
128
+ "description": "A card's id.",
129
+ "required": true
130
+ },
131
+ {
132
+ "name": "getName",
133
+ "type": "(item: T) => string",
134
+ "default": null,
135
+ "description": "A card's name, for the announcements.",
136
+ "required": true
137
+ },
138
+ {
139
+ "name": "items",
140
+ "type": "readonly T[]",
141
+ "default": null,
142
+ "description": "The cards still to decide, the first on top.",
143
+ "required": true
144
+ },
145
+ {
146
+ "name": "labels",
147
+ "type": "SwipeDeckLabels",
148
+ "default": null,
149
+ "description": "The words, passed translated.",
150
+ "required": true
151
+ },
152
+ {
153
+ "name": "onSwipe",
154
+ "type": "(item: T, direction: SwipeDirection) => void",
155
+ "default": null,
156
+ "description": "Called with the card decided and the decision; remove it from `items`.",
157
+ "required": true
158
+ },
159
+ {
160
+ "name": "renderCard",
161
+ "type": "(item: T) => ReactNode",
162
+ "default": null,
163
+ "description": "A card (usually a `PersonCard`).",
164
+ "required": true
165
+ },
166
+ {
167
+ "name": "className",
168
+ "type": "string",
169
+ "default": null,
170
+ "description": "Classes merged on the root.",
171
+ "required": false
172
+ },
173
+ {
174
+ "name": "empty",
175
+ "type": "ReactNode",
176
+ "default": null,
177
+ "description": "Shown when there is no card left (an `EmptyState`).",
178
+ "required": false
179
+ }
180
+ ]
181
+ }
182
+ ],
183
+ "examples": [
184
+ {
185
+ "name": "discover",
186
+ "title": "Discover",
187
+ "description": "Two profiles, photos to page through, the deck decided by drag, buttons or keys.",
188
+ "path": "examples/swipe-deck/discover.tsx",
189
+ "module": "@krizaka/ui/registry/examples/swipe-deck/discover",
190
+ "code": "\"use client\";\n\nimport { Badge } from \"@krizaka/ui/badge\";\nimport { PersonCard, SwipeDeck } from \"@krizaka/ui/swipe-deck\";\nimport { VerifiedBadge } from \"@krizaka/ui/verified-badge\";\nimport { useState } from \"react\";\n\nconst png = (data: string) => `data:image/png;base64,${data}`;\nconst PEOPLE = [\n { id: \"e\", name: \"Elena\", age: 29, km: 3.2, bio: \"Sunsets, vinyl and long walks.\", tags: [\"Music\", \"Surf\"], photos: [png(\"iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAIAAACtAwlQAAABaklEQVR42mWMy24UQQxF7arqlwLhIbJhwZZf5I/4IISEBIsIRSKTMOmZnp7uqrJ9zYIeIeCsrqzjw+vHDwYCCM6wbfy5gABKatsysJqLuoHciZ2dGE4ApSrbnyidVn06lVyQUrweur5pmAJAqVQGSEGnRb79mD5/H6dzuRq6929fv7t5MTSd+6VUK3Zj/XQ7frkblyJ926jwkIab6yZw3Eq58rzaz6nMq1RVA+3nMmd73nMMfCkJiRBA7u5O7g6QCFfhyLyVRJg89U3bxKiGJsQ+te6pCge+lETYPT3rujalotqkNLSdexRhJk6lshjOWXeH+WE6Z1HAi+p+Pr+czuxtG0PKlZesd+P09f5xd5iKqrlX1cfpGCiqhDdXr9Ja8DSX24f9/eG4VDGAiAzIIrvpwJ6C96FUXrId15Ivxm8MKCpzKUvRUCpXJTOHO/2Nu6uhqocqLMr4V9iAkxoHMzZjgP7XnMjBZvQLMEROG5iV3IMAAAAASUVORK5CYII=\"), png(\"iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAIAAACtAwlQAAABZklEQVR42m3MzW4TUQyGYZ8zZzJpwp8UiQ0SEvfMLXETICqoKrXQdDohyZwZ258/FpPCAryyrUdv6j99ZDAiSALLFhFkULhcLAAWFEEA7ggEhYkiImQwWNx84WY+Vh0OZzVvcn657bq25MQIFlOLYCDOY/1+23/59uN0mrZX3Yf3u3dvX6+7VvhcMvXH/vT5+u7rzcM02XrVOvyqbXZvNjmlYmoMqtpY5+EwjqOae4CHX7XWWTerktOl5OYwR5AkKSSXp6sxP5fcPJHrVWlLA0Rpctc2iYQ5/5RgEHLTlbY0qt6WZrsuQrp5SlJMzRG16r4/98M4qyM4m/eH+mqzyilWTVNUfZr0bn+8vn16eDqqeZDm2A9jEgawe7Eu8zQPx+nmfrh/PNbZERQRBCf1n0NtkhQym/lU59N5nu0ilkFQDaeqddLsamZwB/+Cy5CEhzuym8M9KP8iEQkSjgwAAP9LhCQB/AYQ5Y+kAv/RXgAAAABJRU5ErkJggg==\")] },\n { id: \"n\", name: \"Noah\", age: 31, km: 12, bio: \"Cook, climber, bad puns.\", tags: [\"Climbing\"], photos: [png(\"iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAIAAACtAwlQAAABaUlEQVR42mWRzW5TQRSDZ+bOTdMoFMGCFWx4SR6OF0EgQVWECmqbNOnNvTPnHNssIn6kemVZn+yF84eP30mKFEWCZwMmnROKrAAIShSIAOECKaWUkhIlkTXMzxDdbT614z7M8jCsNi+G8UI5nyEjKKKfpuOP6931Z5uO4+X26t377Zu3w2otqYY5SZjNu/uHr5/2N1+it7paR0QZLy9evs651DAjCes2n9ph58uMcIH9+Njn07De5jL8bXJ4kJSUJEkU4BFmuQzVzUTCXUplXJdhJFCGWuqFlMIjJ1aYE0SEpLrelDpmtzKMw2ojJpinnGuYMcLavOzv2+MDrItAdHvatc3VKqUyjDV697YsD7fT7bf2eIewJCK8H+6VMoBx86paa/1pP/26WXY/oy+JSCklAt774U65kLm4mS/N5+k8lP5IBMJimaK1AnO6E5HOf/0vSQGElzBHhEilZ1ASRXgUAAD0vOYfhd832o14udpJswAAAABJRU5ErkJggg==\")] },\n];\n\n// Discover: drag right to like, left to pass, the buttons, or ← → on the focused deck.\nexport default function SwipeDeckDiscover() {\n const [people, setPeople] = useState(PEOPLE);\n return (\n <SwipeDeck\n items={people}\n getId={(p) => p.id}\n getName={(p) => p.name}\n onSwipe={(p) => setPeople((all) => all.filter((x) => x.id !== p.id))}\n labels={{ like: \"Like\", pass: \"Pass\", deck: \"Profiles. Right arrow to like, left arrow to pass.\", likeStamp: \"Like\", passStamp: \"Nope\" }}\n renderCard={(p) => (\n <PersonCard\n photos={p.photos.map((src) => ({ src }))}\n name={p.name}\n age={p.age}\n badge={<VerifiedBadge label=\"Verified\" onMedia size=\"lg\" />}\n meta={<span className=\"text-xs font-semibold\">{`${p.km} km away`}</span>}\n bio={p.bio}\n footer={p.tags.map((t) => <Badge key={t} tone=\"scrim\">{t}</Badge>)}\n />\n )}\n />\n );\n}\n"
191
+ }
192
+ ]
193
+ },
194
+ "native": {
195
+ "entry": "@krizaka/ui/native",
196
+ "import": "import { SwipeDeck, PersonCard } from \"@krizaka/ui/native\";",
197
+ "differences": [
198
+ "The card tilts with the finger and a stamp (LIKE / NOPE) says the decision; a medium tick marks it.",
199
+ "`PersonCard` pages its photos with a tap on a side; screen readers swipe up and down."
200
+ ],
201
+ "props": [
202
+ {
203
+ "component": "PersonCard",
204
+ "description": "A person on a card: the photos full bleed (tap a side to change), the name and age over a scrim, a line, a bio, chips.",
205
+ "props": [
206
+ {
207
+ "name": "name",
208
+ "type": "string",
209
+ "default": null,
210
+ "description": "The name.",
211
+ "required": true
212
+ },
213
+ {
214
+ "name": "photos",
215
+ "type": "readonly { uri: string; alt?: string | undefined; }[]",
216
+ "default": null,
217
+ "description": "The person's photos (URIs), the first shown first; tap the left or right side to move between them.",
218
+ "required": true
219
+ },
220
+ {
221
+ "name": "age",
222
+ "type": "number",
223
+ "default": null,
224
+ "description": "The age, written after the name.",
225
+ "required": false
226
+ },
227
+ {
228
+ "name": "badge",
229
+ "type": "ReactNode",
230
+ "default": null,
231
+ "description": "Beside the name: a `VerifiedBadge`.",
232
+ "required": false
233
+ },
234
+ {
235
+ "name": "bio",
236
+ "type": "string",
237
+ "default": null,
238
+ "description": "A sentence about the person.",
239
+ "required": false
240
+ },
241
+ {
242
+ "name": "footer",
243
+ "type": "ReactNode",
244
+ "default": null,
245
+ "description": "At the bottom: the interests as chips.",
246
+ "required": false
247
+ },
248
+ {
249
+ "name": "meta",
250
+ "type": "ReactNode",
251
+ "default": null,
252
+ "description": "A line under the name: a `DistanceChip`, a job.",
253
+ "required": false
254
+ },
255
+ {
256
+ "name": "photoLabel",
257
+ "type": "((position: number, total: number) => string)",
258
+ "default": "(n, t) => `Photo ${n} of ${t}`",
259
+ "description": "The photo position, read: `(n, total) => \"Photo \" + n + \" of \" + total`.",
260
+ "required": false
261
+ },
262
+ {
263
+ "name": "style",
264
+ "type": "StyleProp<ViewStyle>",
265
+ "default": null,
266
+ "description": "Styles merged last.",
267
+ "required": false
268
+ }
269
+ ]
270
+ },
271
+ {
272
+ "component": "SwipeDeck",
273
+ "description": "A deck of cards to decide one by one: drag the top card right to like, left to pass (it tilts, a stamp says what it\nwill do, past a third of the screen it flies off), or press the buttons; a tick marks the decision. Screen readers\nget “Like” and “Pass” as actions of the card. Under reduced motion the card leaves without flying.",
274
+ "props": [
275
+ {
276
+ "name": "getId",
277
+ "type": "(item: T) => string",
278
+ "default": null,
279
+ "description": "A card's id.",
280
+ "required": true
281
+ },
282
+ {
283
+ "name": "items",
284
+ "type": "readonly T[]",
285
+ "default": null,
286
+ "description": "The cards still to decide, the first on top.",
287
+ "required": true
288
+ },
289
+ {
290
+ "name": "labels",
291
+ "type": "SwipeDeckLabels",
292
+ "default": null,
293
+ "description": "The words, passed translated.",
294
+ "required": true
295
+ },
296
+ {
297
+ "name": "onSwipe",
298
+ "type": "(item: T, direction: SwipeDirection) => void",
299
+ "default": null,
300
+ "description": "Called with the card decided and the decision; remove it from `items`.",
301
+ "required": true
302
+ },
303
+ {
304
+ "name": "renderCard",
305
+ "type": "(item: T) => ReactNode",
306
+ "default": null,
307
+ "description": "A card (usually a `PersonCard`).",
308
+ "required": true
309
+ },
310
+ {
311
+ "name": "empty",
312
+ "type": "ReactNode",
313
+ "default": null,
314
+ "description": "Shown when there is no card left (an `EmptyState`).",
315
+ "required": false
316
+ },
317
+ {
318
+ "name": "hideButtons",
319
+ "type": "boolean",
320
+ "default": null,
321
+ "description": "Hide the like and pass buttons (the app draws its own).",
322
+ "required": false
323
+ },
324
+ {
325
+ "name": "style",
326
+ "type": "StyleProp<ViewStyle>",
327
+ "default": null,
328
+ "description": "Styles merged last.",
329
+ "required": false
330
+ }
331
+ ]
332
+ }
333
+ ],
334
+ "examples": [
335
+ {
336
+ "name": "discover",
337
+ "title": "Discover",
338
+ "description": "Two profiles: drag, stamps, buttons.",
339
+ "path": "examples/swipe-deck/native/discover.tsx",
340
+ "module": "@krizaka/ui/registry/examples/swipe-deck/native/discover",
341
+ "code": "import { Badge, PersonCard, SwipeDeck, Txt, VerifiedBadge } from \"@krizaka/ui/native\";\nimport { useState } from \"react\";\nimport { View } from \"react-native\";\n\nconst png = (data: string) => `data:image/png;base64,${data}`;\nconst PEOPLE = [\n { id: \"e\", name: \"Elena\", age: 29, km: 3.2, bio: \"Sunsets, vinyl and long walks.\", tags: [\"Music\", \"Surf\"], photos: [png(\"iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAIAAACtAwlQAAABaklEQVR42mWMy24UQQxF7arqlwLhIbJhwZZf5I/4IISEBIsIRSKTMOmZnp7uqrJ9zYIeIeCsrqzjw+vHDwYCCM6wbfy5gABKatsysJqLuoHciZ2dGE4ApSrbnyidVn06lVyQUrweur5pmAJAqVQGSEGnRb79mD5/H6dzuRq6929fv7t5MTSd+6VUK3Zj/XQ7frkblyJ926jwkIab6yZw3Eq58rzaz6nMq1RVA+3nMmd73nMMfCkJiRBA7u5O7g6QCFfhyLyVRJg89U3bxKiGJsQ+te6pCge+lETYPT3rujalotqkNLSdexRhJk6lshjOWXeH+WE6Z1HAi+p+Pr+czuxtG0PKlZesd+P09f5xd5iKqrlX1cfpGCiqhDdXr9Ja8DSX24f9/eG4VDGAiAzIIrvpwJ6C96FUXrId15Ivxm8MKCpzKUvRUCpXJTOHO/2Nu6uhqocqLMr4V9iAkxoHMzZjgP7XnMjBZvQLMEROG5iV3IMAAAAASUVORK5CYII=\"), png(\"iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAIAAACtAwlQAAABZklEQVR42m3MzW4TUQyGYZ8zZzJpwp8UiQ0SEvfMLXETICqoKrXQdDohyZwZ258/FpPCAryyrUdv6j99ZDAiSALLFhFkULhcLAAWFEEA7ggEhYkiImQwWNx84WY+Vh0OZzVvcn657bq25MQIFlOLYCDOY/1+23/59uN0mrZX3Yf3u3dvX6+7VvhcMvXH/vT5+u7rzcM02XrVOvyqbXZvNjmlYmoMqtpY5+EwjqOae4CHX7XWWTerktOl5OYwR5AkKSSXp6sxP5fcPJHrVWlLA0Rpctc2iYQ5/5RgEHLTlbY0qt6WZrsuQrp5SlJMzRG16r4/98M4qyM4m/eH+mqzyilWTVNUfZr0bn+8vn16eDqqeZDm2A9jEgawe7Eu8zQPx+nmfrh/PNbZERQRBCf1n0NtkhQym/lU59N5nu0ilkFQDaeqddLsamZwB/+Cy5CEhzuym8M9KP8iEQkSjgwAAP9LhCQB/AYQ5Y+kAv/RXgAAAABJRU5ErkJggg==\")] },\n { id: \"n\", name: \"Noah\", age: 31, km: 12, bio: \"Cook, climber, bad puns.\", tags: [\"Climbing\"], photos: [png(\"iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAIAAACtAwlQAAABaUlEQVR42mWRzW5TQRSDZ+bOTdMoFMGCFWx4SR6OF0EgQVWECmqbNOnNvTPnHNssIn6kemVZn+yF84eP30mKFEWCZwMmnROKrAAIShSIAOECKaWUkhIlkTXMzxDdbT614z7M8jCsNi+G8UI5nyEjKKKfpuOP6931Z5uO4+X26t377Zu3w2otqYY5SZjNu/uHr5/2N1+it7paR0QZLy9evs651DAjCes2n9ph58uMcIH9+Njn07De5jL8bXJ4kJSUJEkU4BFmuQzVzUTCXUplXJdhJFCGWuqFlMIjJ1aYE0SEpLrelDpmtzKMw2ojJpinnGuYMcLavOzv2+MDrItAdHvatc3VKqUyjDV697YsD7fT7bf2eIewJCK8H+6VMoBx86paa/1pP/26WXY/oy+JSCklAt774U65kLm4mS/N5+k8lP5IBMJimaK1AnO6E5HOf/0vSQGElzBHhEilZ1ASRXgUAAD0vOYfhd832o14udpJswAAAABJRU5ErkJggg==\")] },\n];\n\n// Discover: drag right to like, left to pass — or the buttons; the next card waits under.\nexport default function NativeSwipeDeckDiscover() {\n const [people, setPeople] = useState(PEOPLE);\n return (\n <View style={{ width: 340, height: 560 }}>\n <SwipeDeck\n items={people}\n getId={(p) => p.id}\n onSwipe={(p) => setPeople((all) => all.filter((x) => x.id !== p.id))}\n labels={{ like: \"Like\", pass: \"Pass\", likeStamp: \"LIKE\", passStamp: \"NOPE\" }}\n renderCard={(p) => (\n <PersonCard\n photos={p.photos.map((uri) => ({ uri }))}\n name={p.name}\n age={p.age}\n badge={<VerifiedBadge label=\"Verified\" on=\"media\" size={20} />}\n meta={<Txt tone=\"onMedia\" variant=\"caption\">{`${p.km} km away`}</Txt>}\n bio={p.bio}\n footer={p.tags.map((t) => <Badge key={t} tone=\"scrim\">{t}</Badge>)}\n />\n )}\n />\n </View>\n );\n}\n",
342
+ "screenshots": {
343
+ "dark": "examples/swipe-deck/native/discover.dark.png",
344
+ "light": "examples/swipe-deck/native/discover.light.png"
345
+ }
346
+ }
347
+ ]
348
+ },
349
+ "files": [
350
+ {
351
+ "path": "media.ts",
352
+ "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"
353
+ },
354
+ {
355
+ "path": "meta.ts",
356
+ "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 | \"achievement\"\n | \"action-bar\"\n | \"activity-feed\"\n | \"action-sheet\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"form\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"iso\"\n | \"kanban\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"map\"\n | \"longform-page\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"photo-grid\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"radio-group\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"verified-badge\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\";\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/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"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 * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\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"
357
+ },
358
+ {
359
+ "path": "swipe-deck/index.ts",
360
+ "content": "/** @krizaka/ui/swipe-deck — `SwipeDeck` (drag, buttons or ← →, each decision announced) and `PersonCard`. */\nexport { PersonCard, type PersonCardProps, SwipeDeck, swipeDeck, type SwipeDeckLabels, type SwipeDeckProps, type SwipeDirection } from \"./swipe-deck\";\n"
361
+ },
362
+ {
363
+ "path": "swipe-deck/meta.ts",
364
+ "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Swipe deck\",\n summary: \"Cards decided one by one — drag right to like, left to pass, or the buttons (← → on the web) — with `PersonCard`: a person's photos, name, age, seal, distance, bio and interests.\",\n status: \"beta\",\n category: \"data-display\",\n platforms: \"both\",\n whenToUse: [\"Discover in a dating app: like or pass, one profile at a time.\", \"Any one-by-one decision: approve or reject, keep or skip.\"],\n whenNotToUse: [\n { when: \"To browse many items side by side.\", use: \"list\" },\n ],\n bestPractices: [\"Remove the decided card from `items` in `onSwipe`; keep two or three loaded ahead.\", \"Always keep the buttons: a swipe is never the only way.\", \"Say the decision (`decided`) so a screen reader hears it.\"],\n accessibility: {\n keyboard: [{ keys: \"Arrow Right / Arrow Left\", action: \"On the focused deck: like or pass the top card.\" },\n { keys: \"Tab\", action: \"Reaches the card's photo buttons and the like and pass buttons.\" }],\n notes: [\"The top card is the only one exposed; the next waits hidden from assistive technology.\", \"React Native offers Like and Pass as accessibility actions of the card.\", \"Under reduced motion the card leaves without flying.\"],\n },\n related: [\"verified-badge\", \"match-dialog\", \"photo-grid\"],\n web: {\n imports: [\"SwipeDeck\", \"PersonCard\"],\n examples: [\n { name: \"discover\", title: \"Discover\", description: \"Two profiles, photos to page through, the deck decided by drag, buttons or keys.\" },\n ],\n },\n native: {\n imports: [\"SwipeDeck\", \"PersonCard\"],\n differences: [\"The card tilts with the finger and a stamp (LIKE / NOPE) says the decision; a medium tick marks it.\", \"`PersonCard` pages its photos with a tap on a side; screen readers swipe up and down.\"],\n examples: [\n { name: \"discover\", title: \"Discover\", description: \"Two profiles: drag, stamps, buttons.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
365
+ },
366
+ {
367
+ "path": "swipe-deck/swipe-deck.tsx",
368
+ "content": "// Client (the drag, the decision). A deck of cards decided one by one — drag right to like, left to pass, or the\n// buttons, or ← → on the focused deck — and `PersonCard`, a person on a card. Reduced motion: the card leaves without\n// flying.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { usePrefersReducedMotion } from \"../media\";\n\nexport const swipeDeck = tv({\n slots: {\n root: \"flex w-full flex-col items-center gap-5\",\n stack: \"relative aspect-[3/4] w-full max-w-sm outline-hidden focus-visible:rounded-2xl focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-4 focus-visible:ring-offset-surface-0\",\n layer: \"absolute inset-0 touch-pan-y select-none\",\n stamp: \"pointer-events-none absolute top-8 rounded-lg border-[3px] px-2.5 py-0.5 font-display text-2xl font-black uppercase tracking-wide\",\n buttons: \"flex items-center gap-7\",\n button:\n \"inline-flex h-16 w-16 items-center justify-center rounded-full border-2 bg-surface-1 shadow-md transition-transform active:scale-90 \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40 motion-reduce:transition-none [&>svg]:h-7 [&>svg]:w-7\",\n card: \"relative h-full w-full overflow-hidden rounded-2xl bg-surface-3 shadow-lg\",\n photo: \"absolute inset-0 h-full w-full object-cover\",\n bars: \"absolute inset-x-2 top-2 flex gap-1\",\n bar: \"h-[3px] flex-1 rounded-full bg-fg-on-media opacity-40 data-[on]:opacity-100\",\n half: \"absolute top-0 bottom-2/5 w-2/5 cursor-pointer outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring\",\n info: \"absolute inset-x-0 bottom-0 flex flex-col gap-1.5 bg-gradient-to-t from-scrim-strong via-scrim-strong/80 to-transparent p-4 pt-24 text-fg-on-media\",\n name: \"flex items-center gap-2 font-display text-3xl font-black\",\n age: \"font-sans text-2xl font-normal\",\n bio: \"line-clamp-2 text-sm\",\n footer: \"mt-1 flex flex-wrap gap-1.5\",\n },\n});\n\nexport type PersonCardProps = {\n /** The person's photos (URLs), the first shown first; click a side, or its buttons, to move between them. */\n photos: readonly { src: string; alt?: string }[];\n /** The name. */\n name: string;\n /** The age, written after the name. */\n age?: number;\n /** Beside the name: a `VerifiedBadge`. */\n badge?: React.ReactNode;\n /** A line under the name: a distance, a job. */\n meta?: React.ReactNode;\n /** A sentence about the person. */\n bio?: string;\n /** At the bottom: the interests as chips. */\n footer?: React.ReactNode;\n /** The photo buttons' words: `{ previous: \"Previous photo\", next: \"Next photo\" }` — passed translated. */\n photoLabels?: { previous: string; next: string };\n /** Classes merged on the card. */\n className?: string;\n};\n\n/** A person on a card: photos full bleed (a side to change), name and age over a scrim, a line, a bio, chips. */\nexport function PersonCard({ photos, name, age, badge, meta, bio, footer, photoLabels = { previous: \"Previous photo\", next: \"Next photo\" }, className }: PersonCardProps) {\n const s = swipeDeck();\n const [index, setIndex] = React.useState(0);\n const photo = photos[index];\n return (\n <article aria-label={age !== undefined ? `${name}, ${age}` : name} className={s.card({ className })}>\n {photo ? <img src={photo.src} alt={photo.alt ?? \"\"} className={s.photo()} draggable={false} /> : null}\n {photos.length > 1 ? (\n <>\n <div className={s.bars()} aria-hidden>\n {photos.map((_, i) => (\n <span key={i} className={s.bar()} data-on={i === index || undefined} />\n ))}\n </div>\n <button type=\"button\" aria-label={photoLabels.previous} disabled={index === 0} className={s.half({ className: \"left-0\" })} onClick={() => setIndex((i) => Math.max(0, i - 1))} />\n <button type=\"button\" aria-label={photoLabels.next} disabled={index === photos.length - 1} className={s.half({ className: \"right-0\" })} onClick={() => setIndex((i) => Math.min(photos.length - 1, i + 1))} />\n </>\n ) : null}\n <div className={s.info()}>\n <h3 className={s.name()}>\n <span className=\"truncate\">\n {name}\n {age !== undefined ? <span className={s.age()}>{` ${age}`}</span> : null}\n </span>\n {badge}\n </h3>\n {meta}\n {bio ? <p className={s.bio()}>{bio}</p> : null}\n {footer ? <div className={s.footer()}>{footer}</div> : null}\n </div>\n </article>\n );\n}\n\nexport type SwipeDirection = \"like\" | \"pass\";\n\nexport type SwipeDeckLabels = {\n /** The like button (“Like”). */\n like: string;\n /** The pass button (“Pass”). */\n pass: string;\n /** The deck's name and its keyboard hint (“Profiles. Right arrow to like, left arrow to pass.”). */\n deck: string;\n /** The stamp while dragging right (“LIKE”). */\n likeStamp?: string;\n /** The stamp while dragging left (“NOPE”). */\n passStamp?: string;\n /** Announced after a decision: `(name, direction) => …`. */\n decided?: (name: string, direction: SwipeDirection) => string;\n};\n\nexport type SwipeDeckProps<T> = {\n /** The cards still to decide, the first on top. */\n items: readonly T[];\n /** A card's id. */\n getId: (item: T) => string;\n /** A card's name, for the announcements. */\n getName: (item: T) => string;\n /** A card (usually a `PersonCard`). */\n renderCard: (item: T) => React.ReactNode;\n /** Called with the card decided and the decision; remove it from `items`. */\n onSwipe: (item: T, direction: SwipeDirection) => void;\n /** Shown when there is no card left (an `EmptyState`). */\n empty?: React.ReactNode;\n /** The words, passed translated. */\n labels: SwipeDeckLabels;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** A deck of cards decided one by one: drag, the buttons, or ← → — each decision announced. */\nexport function SwipeDeck<T>({ items, getId, getName, renderCard, onSwipe, empty, labels, className }: SwipeDeckProps<T>) {\n const s = swipeDeck();\n const reduce = usePrefersReducedMotion();\n const [dx, setDx] = React.useState(0);\n const [leaving, setLeaving] = React.useState<SwipeDirection | null>(null);\n const [message, setMessage] = React.useState(\"\");\n const start = React.useRef<{ x: number; width: number } | null>(null);\n const [dragging, setDragging] = React.useState(false);\n const top = items[0];\n const decide = (direction: SwipeDirection) => {\n if (!top || leaving) return;\n const finish = () => {\n setLeaving(null);\n setDx(0);\n setMessage(labels.decided ? labels.decided(getName(top), direction) : `${getName(top)}: ${direction === \"like\" ? labels.like : labels.pass}`);\n onSwipe(top, direction);\n };\n if (reduce) return finish();\n setLeaving(direction);\n setTimeout(finish, 220);\n };\n const offset = leaving ? (leaving === \"like\" ? 1 : -1) * 900 : dx;\n const stampOpacity = (dir: 1 | -1) => Math.max(0, Math.min(1, (dir * offset) / 120));\n return (\n <div className={s.root({ className })}>\n <p className=\"sr-only\" aria-live=\"polite\">\n {message}\n </p>\n <div\n role=\"group\"\n aria-label={labels.deck}\n tabIndex={top ? 0 : -1}\n className={s.stack()}\n onKeyDown={(e) => {\n if (e.key === \"ArrowRight\") decide(\"like\");\n if (e.key === \"ArrowLeft\") decide(\"pass\");\n }}\n >\n {!top ? empty : null}\n {items\n .slice(0, 2)\n .reverse()\n .map((item) => {\n const isTop = item === top;\n return (\n <div\n key={getId(item)}\n aria-hidden={!isTop || undefined}\n inert={!isTop || undefined}\n className={s.layer()}\n style={\n isTop\n ? { transform: `translateX(${offset}px) rotate(${offset / 22}deg)`, transition: dragging && !leaving ? \"none\" : reduce ? \"none\" : \"transform 220ms var(--kz-ease, ease-out)\" }\n : { transform: \"scale(0.96)\", opacity: 0.9 }\n }\n onPointerDown={(e) => {\n if (!isTop || (e.target as HTMLElement).closest(\"button\")) return;\n start.current = { x: e.clientX, width: e.currentTarget.offsetWidth };\n e.currentTarget.setPointerCapture(e.pointerId);\n setDragging(true);\n }}\n onPointerMove={(e) => {\n if (start.current) setDx(e.clientX - start.current.x);\n }}\n onPointerUp={() => {\n const width = start.current?.width ?? 300;\n start.current = null;\n setDragging(false);\n if (dx > width / 3) decide(\"like\");\n else if (dx < -width / 3) decide(\"pass\");\n else setDx(0);\n }}\n >\n {renderCard(item)}\n {isTop ? (\n <>\n <span aria-hidden className={s.stamp({ className: \"left-6 -rotate-12 border-success text-fg-success\" })} style={{ opacity: stampOpacity(1) }}>\n {labels.likeStamp ?? labels.like}\n </span>\n <span aria-hidden className={s.stamp({ className: \"right-6 rotate-12 border-danger text-fg-danger\" })} style={{ opacity: stampOpacity(-1) }}>\n {labels.passStamp ?? labels.pass}\n </span>\n </>\n ) : null}\n </div>\n );\n })}\n </div>\n <div className={s.buttons()}>\n <button type=\"button\" aria-label={labels.pass} disabled={!top} onClick={() => decide(\"pass\")} className={s.button({ className: \"border-danger text-fg-danger\" })}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"3\" strokeLinecap=\"round\" aria-hidden>\n <path d=\"M6 6l12 12M18 6 6 18\" />\n </svg>\n </button>\n <button type=\"button\" aria-label={labels.like} disabled={!top} onClick={() => decide(\"like\")} className={s.button({ className: \"border-success text-fg-success\" })}>\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden>\n <path d=\"M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z\" />\n </svg>\n </button>\n </div>\n </div>\n );\n}\n"
369
+ }
370
+ ],
371
+ "dependencies": [
372
+ "tailwind-variants@^3.3.1"
373
+ ],
374
+ "registryDependencies": [],
375
+ "demo": {
376
+ "path": "examples/swipe-deck/discover.tsx",
377
+ "content": "\"use client\";\n\nimport { Badge } from \"@krizaka/ui/badge\";\nimport { PersonCard, SwipeDeck } from \"@krizaka/ui/swipe-deck\";\nimport { VerifiedBadge } from \"@krizaka/ui/verified-badge\";\nimport { useState } from \"react\";\n\nconst png = (data: string) => `data:image/png;base64,${data}`;\nconst PEOPLE = [\n { id: \"e\", name: \"Elena\", age: 29, km: 3.2, bio: \"Sunsets, vinyl and long walks.\", tags: [\"Music\", \"Surf\"], photos: [png(\"iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAIAAACtAwlQAAABaklEQVR42mWMy24UQQxF7arqlwLhIbJhwZZf5I/4IISEBIsIRSKTMOmZnp7uqrJ9zYIeIeCsrqzjw+vHDwYCCM6wbfy5gABKatsysJqLuoHciZ2dGE4ApSrbnyidVn06lVyQUrweur5pmAJAqVQGSEGnRb79mD5/H6dzuRq6929fv7t5MTSd+6VUK3Zj/XQ7frkblyJ926jwkIab6yZw3Eq58rzaz6nMq1RVA+3nMmd73nMMfCkJiRBA7u5O7g6QCFfhyLyVRJg89U3bxKiGJsQ+te6pCge+lETYPT3rujalotqkNLSdexRhJk6lshjOWXeH+WE6Z1HAi+p+Pr+czuxtG0PKlZesd+P09f5xd5iKqrlX1cfpGCiqhDdXr9Ja8DSX24f9/eG4VDGAiAzIIrvpwJ6C96FUXrId15Ivxm8MKCpzKUvRUCpXJTOHO/2Nu6uhqocqLMr4V9iAkxoHMzZjgP7XnMjBZvQLMEROG5iV3IMAAAAASUVORK5CYII=\"), png(\"iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAIAAACtAwlQAAABZklEQVR42m3MzW4TUQyGYZ8zZzJpwp8UiQ0SEvfMLXETICqoKrXQdDohyZwZ258/FpPCAryyrUdv6j99ZDAiSALLFhFkULhcLAAWFEEA7ggEhYkiImQwWNx84WY+Vh0OZzVvcn657bq25MQIFlOLYCDOY/1+23/59uN0mrZX3Yf3u3dvX6+7VvhcMvXH/vT5+u7rzcM02XrVOvyqbXZvNjmlYmoMqtpY5+EwjqOae4CHX7XWWTerktOl5OYwR5AkKSSXp6sxP5fcPJHrVWlLA0Rpctc2iYQ5/5RgEHLTlbY0qt6WZrsuQrp5SlJMzRG16r4/98M4qyM4m/eH+mqzyilWTVNUfZr0bn+8vn16eDqqeZDm2A9jEgawe7Eu8zQPx+nmfrh/PNbZERQRBCf1n0NtkhQym/lU59N5nu0ilkFQDaeqddLsamZwB/+Cy5CEhzuym8M9KP8iEQkSjgwAAP9LhCQB/AYQ5Y+kAv/RXgAAAABJRU5ErkJggg==\")] },\n { id: \"n\", name: \"Noah\", age: 31, km: 12, bio: \"Cook, climber, bad puns.\", tags: [\"Climbing\"], photos: [png(\"iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAIAAACtAwlQAAABaUlEQVR42mWRzW5TQRSDZ+bOTdMoFMGCFWx4SR6OF0EgQVWECmqbNOnNvTPnHNssIn6kemVZn+yF84eP30mKFEWCZwMmnROKrAAIShSIAOECKaWUkhIlkTXMzxDdbT614z7M8jCsNi+G8UI5nyEjKKKfpuOP6931Z5uO4+X26t377Zu3w2otqYY5SZjNu/uHr5/2N1+it7paR0QZLy9evs651DAjCes2n9ph58uMcIH9+Njn07De5jL8bXJ4kJSUJEkU4BFmuQzVzUTCXUplXJdhJFCGWuqFlMIjJ1aYE0SEpLrelDpmtzKMw2ojJpinnGuYMcLavOzv2+MDrItAdHvatc3VKqUyjDV697YsD7fT7bf2eIewJCK8H+6VMoBx86paa/1pP/26WXY/oy+JSCklAt774U65kLm4mS/N5+k8lP5IBMJimaK1AnO6E5HOf/0vSQGElzBHhEilZ1ASRXgUAAD0vOYfhd832o14udpJswAAAABJRU5ErkJggg==\")] },\n];\n\n// Discover: drag right to like, left to pass, the buttons, or ← → on the focused deck.\nexport default function SwipeDeckDiscover() {\n const [people, setPeople] = useState(PEOPLE);\n return (\n <SwipeDeck\n items={people}\n getId={(p) => p.id}\n getName={(p) => p.name}\n onSwipe={(p) => setPeople((all) => all.filter((x) => x.id !== p.id))}\n labels={{ like: \"Like\", pass: \"Pass\", deck: \"Profiles. Right arrow to like, left arrow to pass.\", likeStamp: \"Like\", passStamp: \"Nope\" }}\n renderCard={(p) => (\n <PersonCard\n photos={p.photos.map((src) => ({ src }))}\n name={p.name}\n age={p.age}\n badge={<VerifiedBadge label=\"Verified\" onMedia size=\"lg\" />}\n meta={<span className=\"text-xs font-semibold\">{`${p.km} km away`}</span>}\n bio={p.bio}\n footer={p.tags.map((t) => <Badge key={t} tone=\"scrim\">{t}</Badge>)}\n />\n )}\n />\n );\n}\n"
378
+ },
379
+ "props": [
380
+ {
381
+ "component": "PersonCard",
382
+ "description": "A person on a card: photos full bleed (a side to change), name and age over a scrim, a line, a bio, chips.",
383
+ "props": [
384
+ {
385
+ "name": "name",
386
+ "type": "string",
387
+ "default": null,
388
+ "description": "The name.",
389
+ "required": true
390
+ },
391
+ {
392
+ "name": "photos",
393
+ "type": "readonly { src: string; alt?: string | undefined; }[]",
394
+ "default": null,
395
+ "description": "The person's photos (URLs), the first shown first; click a side, or its buttons, to move between them.",
396
+ "required": true
397
+ },
398
+ {
399
+ "name": "age",
400
+ "type": "number",
401
+ "default": null,
402
+ "description": "The age, written after the name.",
403
+ "required": false
404
+ },
405
+ {
406
+ "name": "badge",
407
+ "type": "ReactNode",
408
+ "default": null,
409
+ "description": "Beside the name: a `VerifiedBadge`.",
410
+ "required": false
411
+ },
412
+ {
413
+ "name": "bio",
414
+ "type": "string",
415
+ "default": null,
416
+ "description": "A sentence about the person.",
417
+ "required": false
418
+ },
419
+ {
420
+ "name": "className",
421
+ "type": "string",
422
+ "default": null,
423
+ "description": "Classes merged on the card.",
424
+ "required": false
425
+ },
426
+ {
427
+ "name": "footer",
428
+ "type": "ReactNode",
429
+ "default": null,
430
+ "description": "At the bottom: the interests as chips.",
431
+ "required": false
432
+ },
433
+ {
434
+ "name": "meta",
435
+ "type": "ReactNode",
436
+ "default": null,
437
+ "description": "A line under the name: a distance, a job.",
438
+ "required": false
439
+ },
440
+ {
441
+ "name": "photoLabels",
442
+ "type": "{ previous: string; next: string; }",
443
+ "default": "{ previous: \"Previous photo\", next: \"Next photo\" }",
444
+ "description": "The photo buttons' words: `{ previous: \"Previous photo\", next: \"Next photo\" }` — passed translated.",
445
+ "required": false
446
+ }
447
+ ]
448
+ },
449
+ {
450
+ "component": "SwipeDeck",
451
+ "description": "A deck of cards decided one by one: drag, the buttons, or ← → — each decision announced.",
452
+ "props": [
453
+ {
454
+ "name": "getId",
455
+ "type": "(item: T) => string",
456
+ "default": null,
457
+ "description": "A card's id.",
458
+ "required": true
459
+ },
460
+ {
461
+ "name": "getName",
462
+ "type": "(item: T) => string",
463
+ "default": null,
464
+ "description": "A card's name, for the announcements.",
465
+ "required": true
466
+ },
467
+ {
468
+ "name": "items",
469
+ "type": "readonly T[]",
470
+ "default": null,
471
+ "description": "The cards still to decide, the first on top.",
472
+ "required": true
473
+ },
474
+ {
475
+ "name": "labels",
476
+ "type": "SwipeDeckLabels",
477
+ "default": null,
478
+ "description": "The words, passed translated.",
479
+ "required": true
480
+ },
481
+ {
482
+ "name": "onSwipe",
483
+ "type": "(item: T, direction: SwipeDirection) => void",
484
+ "default": null,
485
+ "description": "Called with the card decided and the decision; remove it from `items`.",
486
+ "required": true
487
+ },
488
+ {
489
+ "name": "renderCard",
490
+ "type": "(item: T) => ReactNode",
491
+ "default": null,
492
+ "description": "A card (usually a `PersonCard`).",
493
+ "required": true
494
+ },
495
+ {
496
+ "name": "className",
497
+ "type": "string",
498
+ "default": null,
499
+ "description": "Classes merged on the root.",
500
+ "required": false
501
+ },
502
+ {
503
+ "name": "empty",
504
+ "type": "ReactNode",
505
+ "default": null,
506
+ "description": "Shown when there is no card left (an `EmptyState`).",
507
+ "required": false
508
+ }
509
+ ]
510
+ }
511
+ ]
512
+ }