@kumix/ui 0.2.4 → 0.3.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 (358) hide show
  1. package/README.md +32 -10
  2. package/dist/components/motion/action-swap-blur.d.ts +11 -0
  3. package/dist/components/motion/action-swap-blur.d.ts.map +1 -0
  4. package/dist/components/motion/action-swap-blur.js +26 -0
  5. package/dist/components/motion/action-swap-blur.js.map +1 -0
  6. package/dist/components/motion/action-swap-cascade.d.ts +11 -0
  7. package/dist/components/motion/action-swap-cascade.d.ts.map +1 -0
  8. package/dist/components/motion/action-swap-cascade.js +26 -0
  9. package/dist/components/motion/action-swap-cascade.js.map +1 -0
  10. package/dist/components/motion/action-swap-roll.d.ts +11 -0
  11. package/dist/components/motion/action-swap-roll.d.ts.map +1 -0
  12. package/dist/components/motion/action-swap-roll.js +26 -0
  13. package/dist/components/motion/action-swap-roll.js.map +1 -0
  14. package/dist/components/motion/action-swap.d.ts +41 -0
  15. package/dist/components/motion/action-swap.d.ts.map +1 -0
  16. package/dist/components/motion/action-swap.js +261 -0
  17. package/dist/components/motion/action-swap.js.map +1 -0
  18. package/dist/components/motion/animated-badge.d.ts +18 -0
  19. package/dist/components/motion/animated-badge.d.ts.map +1 -0
  20. package/dist/components/motion/animated-badge.js +206 -0
  21. package/dist/components/motion/animated-badge.js.map +1 -0
  22. package/dist/components/motion/animated-number.d.ts +12 -0
  23. package/dist/components/motion/animated-number.d.ts.map +1 -0
  24. package/dist/components/motion/animated-number.js +47 -0
  25. package/dist/components/motion/animated-number.js.map +1 -0
  26. package/dist/components/motion/animated-sidebar.d.ts +97 -0
  27. package/dist/components/motion/animated-sidebar.d.ts.map +1 -0
  28. package/dist/components/motion/animated-sidebar.js +611 -0
  29. package/dist/components/motion/animated-sidebar.js.map +1 -0
  30. package/dist/components/motion/animated-toast-stack.d.ts +65 -0
  31. package/dist/components/motion/animated-toast-stack.d.ts.map +1 -0
  32. package/dist/components/motion/animated-toast-stack.js +303 -0
  33. package/dist/components/motion/animated-toast-stack.js.map +1 -0
  34. package/dist/components/motion/bottom-sheet.d.ts +19 -0
  35. package/dist/components/motion/bottom-sheet.d.ts.map +1 -0
  36. package/dist/components/motion/bottom-sheet.js +146 -0
  37. package/dist/components/motion/bottom-sheet.js.map +1 -0
  38. package/dist/components/motion/bounce-sidebar.d.ts +26 -0
  39. package/dist/components/motion/bounce-sidebar.d.ts.map +1 -0
  40. package/dist/components/motion/bounce-sidebar.js +164 -0
  41. package/dist/components/motion/bounce-sidebar.js.map +1 -0
  42. package/dist/components/motion/bouncy-accordion.d.ts +32 -0
  43. package/dist/components/motion/bouncy-accordion.d.ts.map +1 -0
  44. package/dist/components/motion/bouncy-accordion.js +172 -0
  45. package/dist/components/motion/bouncy-accordion.js.map +1 -0
  46. package/dist/components/motion/button/base.d.ts +17 -0
  47. package/dist/components/motion/button/base.d.ts.map +1 -0
  48. package/dist/components/motion/button/base.js +86 -0
  49. package/dist/components/motion/button/base.js.map +1 -0
  50. package/dist/components/motion/button/magnetic.d.ts +12 -0
  51. package/dist/components/motion/button/magnetic.d.ts.map +1 -0
  52. package/dist/components/motion/button/magnetic.js +21 -0
  53. package/dist/components/motion/button/magnetic.js.map +1 -0
  54. package/dist/components/motion/button/stateful.d.ts +16 -0
  55. package/dist/components/motion/button/stateful.d.ts.map +1 -0
  56. package/dist/components/motion/button/stateful.js +190 -0
  57. package/dist/components/motion/button/stateful.js.map +1 -0
  58. package/dist/components/motion/center-morph-modal.d.ts +43 -0
  59. package/dist/components/motion/center-morph-modal.d.ts.map +1 -0
  60. package/dist/components/motion/center-morph-modal.js +238 -0
  61. package/dist/components/motion/center-morph-modal.js.map +1 -0
  62. package/dist/components/motion/checkbox.d.ts +15 -0
  63. package/dist/components/motion/checkbox.d.ts.map +1 -0
  64. package/dist/components/motion/checkbox.js +81 -0
  65. package/dist/components/motion/checkbox.js.map +1 -0
  66. package/dist/components/motion/chromatic-text-reveal.d.ts +31 -0
  67. package/dist/components/motion/chromatic-text-reveal.d.ts.map +1 -0
  68. package/dist/components/motion/chromatic-text-reveal.js +132 -0
  69. package/dist/components/motion/chromatic-text-reveal.js.map +1 -0
  70. package/dist/components/motion/context-menu.d.ts +71 -0
  71. package/dist/components/motion/context-menu.d.ts.map +1 -0
  72. package/dist/components/motion/context-menu.js +454 -0
  73. package/dist/components/motion/context-menu.js.map +1 -0
  74. package/dist/components/motion/cylinder-carousel.d.ts +40 -0
  75. package/dist/components/motion/cylinder-carousel.d.ts.map +1 -0
  76. package/dist/components/motion/cylinder-carousel.js +274 -0
  77. package/dist/components/motion/cylinder-carousel.js.map +1 -0
  78. package/dist/components/motion/dock.d.ts +24 -0
  79. package/dist/components/motion/dock.d.ts.map +1 -0
  80. package/dist/components/motion/dock.js +62 -0
  81. package/dist/components/motion/dock.js.map +1 -0
  82. package/dist/components/motion/drawer.d.ts +19 -0
  83. package/dist/components/motion/drawer.d.ts.map +1 -0
  84. package/dist/components/motion/drawer.js +58 -0
  85. package/dist/components/motion/drawer.js.map +1 -0
  86. package/dist/components/motion/hold-action-button.d.ts +17 -0
  87. package/dist/components/motion/hold-action-button.d.ts.map +1 -0
  88. package/dist/components/motion/hold-action-button.js +158 -0
  89. package/dist/components/motion/hold-action-button.js.map +1 -0
  90. package/dist/components/motion/input.d.ts +29 -0
  91. package/dist/components/motion/input.d.ts.map +1 -0
  92. package/dist/components/motion/input.js +126 -0
  93. package/dist/components/motion/input.js.map +1 -0
  94. package/dist/components/motion/loader.d.ts +17 -0
  95. package/dist/components/motion/loader.d.ts.map +1 -0
  96. package/dist/components/motion/loader.js +791 -0
  97. package/dist/components/motion/loader.js.map +1 -0
  98. package/dist/components/motion/magnetic.d.ts +11 -0
  99. package/dist/components/motion/magnetic.d.ts.map +1 -0
  100. package/dist/components/motion/magnetic.js +44 -0
  101. package/dist/components/motion/magnetic.js.map +1 -0
  102. package/dist/components/motion/marquee.d.ts +15 -0
  103. package/dist/components/motion/marquee.d.ts.map +1 -0
  104. package/dist/components/motion/marquee.js +35 -0
  105. package/dist/components/motion/marquee.js.map +1 -0
  106. package/dist/components/motion/morphing-modal.d.ts +15 -0
  107. package/dist/components/motion/morphing-modal.d.ts.map +1 -0
  108. package/dist/components/motion/morphing-modal.js +117 -0
  109. package/dist/components/motion/morphing-modal.js.map +1 -0
  110. package/dist/components/motion/number-ticker.d.ts +26 -0
  111. package/dist/components/motion/number-ticker.d.ts.map +1 -0
  112. package/dist/components/motion/number-ticker.js +129 -0
  113. package/dist/components/motion/number-ticker.js.map +1 -0
  114. package/dist/components/motion/parallax.d.ts +21 -0
  115. package/dist/components/motion/parallax.d.ts.map +1 -0
  116. package/dist/components/motion/parallax.js +35 -0
  117. package/dist/components/motion/parallax.js.map +1 -0
  118. package/dist/components/motion/popover-morph.d.ts +38 -0
  119. package/dist/components/motion/popover-morph.d.ts.map +1 -0
  120. package/dist/components/motion/popover-morph.js +167 -0
  121. package/dist/components/motion/popover-morph.js.map +1 -0
  122. package/dist/components/motion/popover.d.ts +40 -0
  123. package/dist/components/motion/popover.d.ts.map +1 -0
  124. package/dist/components/motion/popover.js +393 -0
  125. package/dist/components/motion/popover.js.map +1 -0
  126. package/dist/components/motion/preview-rail.d.ts +26 -0
  127. package/dist/components/motion/preview-rail.d.ts.map +1 -0
  128. package/dist/components/motion/preview-rail.js +134 -0
  129. package/dist/components/motion/preview-rail.js.map +1 -0
  130. package/dist/components/motion/pull-to-refresh.d.ts +28 -0
  131. package/dist/components/motion/pull-to-refresh.d.ts.map +1 -0
  132. package/dist/components/motion/pull-to-refresh.js +389 -0
  133. package/dist/components/motion/pull-to-refresh.js.map +1 -0
  134. package/dist/components/motion/radio.d.ts +22 -0
  135. package/dist/components/motion/radio.d.ts.map +1 -0
  136. package/dist/components/motion/radio.js +79 -0
  137. package/dist/components/motion/radio.js.map +1 -0
  138. package/dist/components/motion/range-slider-bubble.d.ts +16 -0
  139. package/dist/components/motion/range-slider-bubble.d.ts.map +1 -0
  140. package/dist/components/motion/range-slider-bubble.js +117 -0
  141. package/dist/components/motion/range-slider-bubble.js.map +1 -0
  142. package/dist/components/motion/range-slider-fluid.d.ts +18 -0
  143. package/dist/components/motion/range-slider-fluid.d.ts.map +1 -0
  144. package/dist/components/motion/range-slider-fluid.js +63 -0
  145. package/dist/components/motion/range-slider-fluid.js.map +1 -0
  146. package/dist/components/motion/range-slider-ruler.d.ts +19 -0
  147. package/dist/components/motion/range-slider-ruler.d.ts.map +1 -0
  148. package/dist/components/motion/range-slider-ruler.js +142 -0
  149. package/dist/components/motion/range-slider-ruler.js.map +1 -0
  150. package/dist/components/motion/range-slider-wave.d.ts +16 -0
  151. package/dist/components/motion/range-slider-wave.d.ts.map +1 -0
  152. package/dist/components/motion/range-slider-wave.js +57 -0
  153. package/dist/components/motion/range-slider-wave.js.map +1 -0
  154. package/dist/components/motion/range-slider.d.ts +11 -0
  155. package/dist/components/motion/range-slider.d.ts.map +1 -0
  156. package/dist/components/motion/range-slider.js +63 -0
  157. package/dist/components/motion/range-slider.js.map +1 -0
  158. package/dist/components/motion/scroll-progress.d.ts +29 -0
  159. package/dist/components/motion/scroll-progress.d.ts.map +1 -0
  160. package/dist/components/motion/scroll-progress.js +71 -0
  161. package/dist/components/motion/scroll-progress.js.map +1 -0
  162. package/dist/components/motion/scroll-reveal.d.ts +23 -0
  163. package/dist/components/motion/scroll-reveal.d.ts.map +1 -0
  164. package/dist/components/motion/scroll-reveal.js +42 -0
  165. package/dist/components/motion/scroll-reveal.js.map +1 -0
  166. package/dist/components/motion/scroll-to.d.ts +21 -0
  167. package/dist/components/motion/scroll-to.d.ts.map +1 -0
  168. package/dist/components/motion/scroll-to.js +27 -0
  169. package/dist/components/motion/scroll-to.js.map +1 -0
  170. package/dist/components/motion/select-morph.d.ts +41 -0
  171. package/dist/components/motion/select-morph.d.ts.map +1 -0
  172. package/dist/components/motion/select-morph.js +251 -0
  173. package/dist/components/motion/select-morph.js.map +1 -0
  174. package/dist/components/motion/select.d.ts +36 -0
  175. package/dist/components/motion/select.d.ts.map +1 -0
  176. package/dist/components/motion/select.js +319 -0
  177. package/dist/components/motion/select.js.map +1 -0
  178. package/dist/components/motion/shader-background.d.ts +38 -0
  179. package/dist/components/motion/shader-background.d.ts.map +1 -0
  180. package/dist/components/motion/shader-background.js +49 -0
  181. package/dist/components/motion/shader-background.js.map +1 -0
  182. package/dist/components/motion/shared-layout-bg.d.ts +17 -0
  183. package/dist/components/motion/shared-layout-bg.d.ts.map +1 -0
  184. package/dist/components/motion/shared-layout-bg.js +88 -0
  185. package/dist/components/motion/shared-layout-bg.js.map +1 -0
  186. package/dist/components/motion/slide-action-button.d.ts +15 -0
  187. package/dist/components/motion/slide-action-button.d.ts.map +1 -0
  188. package/dist/components/motion/slide-action-button.js +146 -0
  189. package/dist/components/motion/slide-action-button.js.map +1 -0
  190. package/dist/components/motion/smooth-scroll.d.ts +47 -0
  191. package/dist/components/motion/smooth-scroll.d.ts.map +1 -0
  192. package/dist/components/motion/smooth-scroll.js +182 -0
  193. package/dist/components/motion/smooth-scroll.js.map +1 -0
  194. package/dist/components/motion/switch.d.ts +13 -0
  195. package/dist/components/motion/switch.d.ts.map +1 -0
  196. package/dist/components/motion/switch.js +76 -0
  197. package/dist/components/motion/switch.js.map +1 -0
  198. package/dist/components/motion/table/editable-cell.d.ts +9 -0
  199. package/dist/components/motion/table/editable-cell.d.ts.map +1 -0
  200. package/dist/components/motion/table/editable-cell.js +17 -0
  201. package/dist/components/motion/table/editable-cell.js.map +1 -0
  202. package/dist/components/motion/table/index.d.ts +6 -0
  203. package/dist/components/motion/table/index.d.ts.map +1 -0
  204. package/dist/components/motion/table/index.js +420 -0
  205. package/dist/components/motion/table/index.js.map +1 -0
  206. package/dist/components/motion/table/row-handle.d.ts +15 -0
  207. package/dist/components/motion/table/row-handle.d.ts.map +1 -0
  208. package/dist/components/motion/table/row-handle.js +51 -0
  209. package/dist/components/motion/table/row-handle.js.map +1 -0
  210. package/dist/components/motion/table/skeleton-rows.d.ts +11 -0
  211. package/dist/components/motion/table/skeleton-rows.d.ts.map +1 -0
  212. package/dist/components/motion/table/skeleton-rows.js +23 -0
  213. package/dist/components/motion/table/skeleton-rows.js.map +1 -0
  214. package/dist/components/motion/table/table-header.d.ts +35 -0
  215. package/dist/components/motion/table/table-header.d.ts.map +1 -0
  216. package/dist/components/motion/table/table-header.js +167 -0
  217. package/dist/components/motion/table/table-header.js.map +1 -0
  218. package/dist/components/motion/table/table-menu.d.ts +17 -0
  219. package/dist/components/motion/table/table-menu.d.ts.map +1 -0
  220. package/dist/components/motion/table/table-menu.js +92 -0
  221. package/dist/components/motion/table/table-menu.js.map +1 -0
  222. package/dist/components/motion/tabs.d.ts +29 -0
  223. package/dist/components/motion/tabs.d.ts.map +1 -0
  224. package/dist/components/motion/tabs.js +125 -0
  225. package/dist/components/motion/tabs.js.map +1 -0
  226. package/dist/components/motion/text-cascade.d.ts +15 -0
  227. package/dist/components/motion/text-cascade.d.ts.map +1 -0
  228. package/dist/components/motion/text-cascade.js +21 -0
  229. package/dist/components/motion/text-cascade.js.map +1 -0
  230. package/dist/components/motion/text-reveal.d.ts +25 -0
  231. package/dist/components/motion/text-reveal.d.ts.map +1 -0
  232. package/dist/components/motion/text-reveal.js +94 -0
  233. package/dist/components/motion/text-reveal.js.map +1 -0
  234. package/dist/components/motion/text-shimmer.d.ts +12 -0
  235. package/dist/components/motion/text-shimmer.d.ts.map +1 -0
  236. package/dist/components/motion/text-shimmer.js +15 -0
  237. package/dist/components/motion/text-shimmer.js.map +1 -0
  238. package/dist/components/motion/theme-toggle.d.ts +23 -0
  239. package/dist/components/motion/theme-toggle.d.ts.map +1 -0
  240. package/dist/components/motion/theme-toggle.js +160 -0
  241. package/dist/components/motion/theme-toggle.js.map +1 -0
  242. package/dist/components/motion/tilt-card.d.ts +12 -0
  243. package/dist/components/motion/tilt-card.d.ts.map +1 -0
  244. package/dist/components/motion/tilt-card.js +56 -0
  245. package/dist/components/motion/tilt-card.js.map +1 -0
  246. package/dist/components/motion/tooltip.d.ts +17 -0
  247. package/dist/components/motion/tooltip.d.ts.map +1 -0
  248. package/dist/components/motion/tooltip.js +194 -0
  249. package/dist/components/motion/tooltip.js.map +1 -0
  250. package/dist/components/motion/wheel-picker.d.ts +24 -0
  251. package/dist/components/motion/wheel-picker.d.ts.map +1 -0
  252. package/dist/components/motion/wheel-picker.js +442 -0
  253. package/dist/components/motion/wheel-picker.js.map +1 -0
  254. package/dist/components/reui/alert.d.ts +1 -1
  255. package/dist/components/reui/alert.js +1 -1
  256. package/dist/components/reui/autocomplete.js +2 -2
  257. package/dist/components/reui/badge.d.ts +2 -2
  258. package/dist/components/reui/badge.js +10 -9
  259. package/dist/components/reui/badge.js.map +1 -1
  260. package/dist/components/reui/data-grid/data-grid-table-dnd.js +21 -19
  261. package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
  262. package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts +1 -1
  263. package/dist/components/reui/data-grid/data-grid-table-virtual.js +1 -1
  264. package/dist/components/reui/data-grid/data-grid-table.js +4 -2
  265. package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
  266. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +2 -1
  267. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
  268. package/dist/components/reui/event-calendar/event-calendar-content.js +8 -7
  269. package/dist/components/reui/event-calendar/event-calendar-content.js.map +1 -1
  270. package/dist/components/reui/event-calendar/event-calendar-dnd.js +7 -4
  271. package/dist/components/reui/event-calendar/event-calendar-dnd.js.map +1 -1
  272. package/dist/components/reui/event-calendar/event-calendar-event.js +49 -47
  273. package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
  274. package/dist/components/reui/event-calendar/event-calendar-lib.js +3 -2
  275. package/dist/components/reui/event-calendar/event-calendar-lib.js.map +1 -1
  276. package/dist/components/reui/event-calendar/event-calendar-nav.js +37 -31
  277. package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
  278. package/dist/components/reui/event-calendar/event-calendar-time-grid.js +2 -1
  279. package/dist/components/reui/event-calendar/event-calendar-time-grid.js.map +1 -1
  280. package/dist/components/reui/event-calendar/event-calendar.js +2 -1
  281. package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
  282. package/dist/components/reui/filters.js +5 -3
  283. package/dist/components/reui/filters.js.map +1 -1
  284. package/dist/components/reui/frame.d.ts +2 -2
  285. package/dist/components/reui/frame.js +1 -1
  286. package/dist/components/reui/gantt/gantt-bar.js +52 -51
  287. package/dist/components/reui/gantt/gantt-bar.js.map +1 -1
  288. package/dist/components/reui/gantt/gantt-lib.js +3 -2
  289. package/dist/components/reui/gantt/gantt-lib.js.map +1 -1
  290. package/dist/components/reui/gantt/gantt-nav.js +34 -30
  291. package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
  292. package/dist/components/reui/gantt/gantt-recurrence.js +2 -2
  293. package/dist/components/reui/gantt/gantt-recurrence.js.map +1 -1
  294. package/dist/components/reui/gantt/gantt-view.js +175 -171
  295. package/dist/components/reui/gantt/gantt-view.js.map +1 -1
  296. package/dist/components/reui/icon-tile.d.ts +1 -1
  297. package/dist/components/reui/icon-tile.js +12 -11
  298. package/dist/components/reui/icon-tile.js.map +1 -1
  299. package/dist/components/reui/kanban.js +42 -37
  300. package/dist/components/reui/kanban.js.map +1 -1
  301. package/dist/components/reui/number-field.js +1 -1
  302. package/dist/components/reui/rating.js +1 -1
  303. package/dist/components/reui/sortable.js +10 -9
  304. package/dist/components/reui/sortable.js.map +1 -1
  305. package/dist/components/reui/stepper.js +16 -16
  306. package/dist/components/reui/stepper.js.map +1 -1
  307. package/dist/components/reui/timeline.js +45 -38
  308. package/dist/components/reui/timeline.js.map +1 -1
  309. package/dist/components/reui/tree.js +2 -1
  310. package/dist/components/reui/tree.js.map +1 -1
  311. package/dist/components/ui/alert.js +1 -1
  312. package/dist/components/ui/attachment.d.ts +1 -1
  313. package/dist/components/ui/attachment.js +1 -1
  314. package/dist/components/ui/badge.d.ts +1 -1
  315. package/dist/components/ui/bubble.d.ts +1 -1
  316. package/dist/components/ui/bubble.js +1 -1
  317. package/dist/components/ui/button-group.js +1 -1
  318. package/dist/components/ui/button.d.ts +2 -2
  319. package/dist/components/ui/button.js +1 -1
  320. package/dist/components/ui/empty.d.ts +1 -1
  321. package/dist/components/ui/empty.js +1 -1
  322. package/dist/components/ui/field.js +1 -1
  323. package/dist/components/ui/input-group.js +1 -1
  324. package/dist/components/ui/item.d.ts +2 -2
  325. package/dist/components/ui/item.js +1 -1
  326. package/dist/components/ui/marker.js +1 -1
  327. package/dist/components/ui/navigation-menu.js +1 -1
  328. package/dist/components/ui/sidebar.d.ts +1 -1
  329. package/dist/components/ui/sidebar.js +2 -2
  330. package/dist/components/ui/sidebar.js.map +1 -1
  331. package/dist/components/ui/tabs.js +1 -1
  332. package/dist/components/ui/toggle.d.ts +1 -1
  333. package/dist/components/ui/toggle.js +1 -1
  334. package/dist/hooks/use-hover-capable.d.ts +10 -0
  335. package/dist/hooks/use-hover-capable.d.ts.map +1 -0
  336. package/dist/hooks/use-hover-capable.js +24 -0
  337. package/dist/hooks/use-hover-capable.js.map +1 -0
  338. package/dist/hooks/use-mobile.js +1 -1
  339. package/dist/hooks/use-mobile.js.map +1 -1
  340. package/dist/hooks/use-slider.d.ts +58 -0
  341. package/dist/hooks/use-slider.d.ts.map +1 -0
  342. package/dist/hooks/use-slider.js +133 -0
  343. package/dist/hooks/use-slider.js.map +1 -0
  344. package/dist/lib/ease.d.ts +50 -0
  345. package/dist/lib/ease.d.ts.map +1 -0
  346. package/dist/lib/ease.js +66 -0
  347. package/dist/lib/ease.js.map +1 -0
  348. package/dist/lib/tick-sound.d.ts +17 -0
  349. package/dist/lib/tick-sound.d.ts.map +1 -0
  350. package/dist/lib/tick-sound.js +120 -0
  351. package/dist/lib/tick-sound.js.map +1 -0
  352. package/dist/popover-position-BUqYCq8X.js +54 -0
  353. package/dist/popover-position-BUqYCq8X.js.map +1 -0
  354. package/dist/types-Bah5NY44.d.ts +81 -0
  355. package/dist/types-Bah5NY44.d.ts.map +1 -0
  356. package/dist/utils-DQ7OpbYQ.js +25 -0
  357. package/dist/utils-DQ7OpbYQ.js.map +1 -0
  358. package/package.json +17 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.js","names":[],"sources":["../../../src/components/motion/tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n cloneElement,\n isValidElement,\n type ReactElement,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { AnimatePresence, motion, useReducedMotion, type Variants } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useHoverCapable } from \"../../hooks/use-hover-capable\";\nimport { EASE_OUT } from \"../../lib/ease\";\n\ntype Side = \"top\" | \"right\" | \"bottom\" | \"left\";\n\nexport interface TooltipProps {\n content: ReactNode;\n children: ReactElement;\n side?: Side;\n /** Delay before showing (ms). Default 120. */\n delay?: number;\n className?: string;\n /** Classes for the outer wrapper span. Use to fix baseline / fill parent. */\n wrapperClassName?: string;\n}\n\n// Gap between trigger and tooltip, in px.\nconst GAP = 8;\n\n// Centering transform for the fixed-positioned anchor point, per side.\nconst anchorTransform: Record<Side, string> = {\n top: \"translate(-50%, -100%)\",\n bottom: \"translate(-50%, 0)\",\n left: \"translate(-100%, -50%)\",\n right: \"translate(0, -50%)\",\n};\n\nconst transformOrigin: Record<Side, string> = {\n top: \"center bottom\",\n bottom: \"center top\",\n left: \"right center\",\n right: \"left center\",\n};\n\n// Offset is in the direction *away* from the trigger — content originates near\n// the trigger and rises into resting position.\nconst offsetFrom: Record<Side, { x?: number; y?: number }> = {\n top: { y: 8 },\n bottom: { y: -8 },\n left: { x: 8 },\n right: { x: -8 },\n};\n\nfunction buildVariants(side: Side): Variants {\n const o = offsetFrom[side];\n return {\n initial: {\n opacity: 0,\n scale: 0.9,\n filter: \"blur(5px)\",\n x: o.x ?? 0,\n y: o.y ?? 0,\n },\n animate: {\n opacity: 1,\n scale: 1,\n filter: \"blur(0px)\",\n x: 0,\n y: 0,\n transition: {\n type: \"spring\",\n stiffness: 380,\n damping: 30,\n mass: 0.7,\n opacity: { duration: 0.14, ease: EASE_OUT },\n filter: { duration: 0.18, ease: EASE_OUT },\n },\n },\n exit: {\n opacity: 0,\n scale: 0.94,\n filter: \"blur(3px)\",\n x: (o.x ?? 0) * 0.6,\n y: (o.y ?? 0) * 0.6,\n transition: { duration: 0.12, ease: EASE_OUT },\n },\n };\n}\n\nconst REDUCED_VARIANTS: Variants = {\n initial: { opacity: 0 },\n animate: { opacity: 1, transition: { duration: 0.14, ease: EASE_OUT } },\n exit: { opacity: 0, transition: { duration: 0.1, ease: EASE_OUT } },\n};\n\n// Once any tooltip has just closed, neighbouring tooltips open without the\n// initial delay — moving along a toolbar feels instant after the first one.\nconst WARM_WINDOW_MS = 300;\nlet lastHiddenAt = 0;\n\nexport function Tooltip({\n content,\n children,\n side = \"top\",\n delay = 120,\n className,\n wrapperClassName,\n}: TooltipProps) {\n const [open, setOpen] = useState(false);\n const [coords, setCoords] = useState<{ top: number; left: number } | null>(null);\n const id = useId();\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const anchorRef = useRef<HTMLSpanElement>(null);\n const reduce = useReducedMotion();\n const canHover = useHoverCapable();\n\n // Anchor point in viewport coords, on the edge of the trigger facing `side`.\n // Position:fixed means these viewport coords place the tooltip directly, so\n // it escapes every ancestor's stacking context and overflow.\n const place = useCallback(() => {\n const el = anchorRef.current;\n if (!el) return;\n const r = el.getBoundingClientRect();\n const cx = r.left + r.width / 2;\n const cy = r.top + r.height / 2;\n const point: Record<Side, { top: number; left: number }> = {\n top: { top: r.top - GAP, left: cx },\n bottom: { top: r.bottom + GAP, left: cx },\n left: { top: cy, left: r.left - GAP },\n right: { top: cy, left: r.right + GAP },\n };\n setCoords(point[side]);\n }, [side]);\n\n const show = useCallback(() => {\n if (!canHover) return;\n if (timer.current) clearTimeout(timer.current);\n const warm = Date.now() - lastHiddenAt < WARM_WINDOW_MS;\n timer.current = setTimeout(\n () => {\n place();\n setOpen(true);\n },\n warm ? 0 : delay,\n );\n }, [canHover, delay, place]);\n\n const hide = useCallback(() => {\n if (timer.current) {\n clearTimeout(timer.current);\n timer.current = null;\n }\n if (open) lastHiddenAt = Date.now();\n setOpen(false);\n }, [open]);\n\n // Keep the tooltip pinned to the trigger while it's open and the page scrolls\n // or resizes (fixed coords are viewport-relative).\n useEffect(() => {\n if (!open) return;\n const onMove = () => place();\n window.addEventListener(\"scroll\", onMove, true);\n window.addEventListener(\"resize\", onMove);\n return () => {\n window.removeEventListener(\"scroll\", onMove, true);\n window.removeEventListener(\"resize\", onMove);\n };\n }, [open, place]);\n\n const variants = useMemo(() => (reduce ? REDUCED_VARIANTS : buildVariants(side)), [reduce, side]);\n\n if (!isValidElement(children)) return children;\n\n const trigger = cloneElement(children as ReactElement<Record<string, unknown>>, {\n onMouseEnter: show,\n onMouseLeave: hide,\n onFocus: show,\n onBlur: hide,\n \"aria-describedby\": id,\n });\n\n return (\n <>\n <span ref={anchorRef} className={cn(\"relative inline-flex align-middle\", wrapperClassName)}>\n {trigger}\n </span>\n {typeof document !== \"undefined\"\n ? createPortal(\n <AnimatePresence>\n {open && coords ? (\n <span\n aria-hidden\n className=\"pointer-events-none fixed z-9999\"\n style={{\n top: coords.top,\n left: coords.left,\n transform: anchorTransform[side],\n }}\n >\n <motion.span\n id={id}\n role=\"tooltip\"\n variants={variants}\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n style={{ transformOrigin: transformOrigin[side] }}\n className={cn(\n \"block whitespace-nowrap rounded-lg border border-border bg-background px-2.5 py-1 font-medium text-foreground text-xs shadow-lg\",\n className,\n )}\n >\n {content}\n </motion.span>\n </span>\n ) : null}\n </AnimatePresence>,\n document.body,\n )\n : null}\n </>\n );\n}\n"],"mappings":";;;;;;;;;AAmCA,MAAM,MAAM;AAGZ,MAA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UAAU,QAAQ,IAAI;GACjD,OAAO,oBAAoB,UAAU,MAAM;EAC7C;CACF,GAAG,CAAC,MAAM,KAAK,CAAC;CAEhB,MAAM,WAAW,cAAe,SAAS,mBAAmB,cAAc,IAAI,GAAI,CAAC,QAAQ,IAAI,CAAC;CAEhG,IAAI,CAAC,eAAe,QAAQ,GAAG,OAAO;CAEtC,MAAM,UAAU,aAAa,UAAmD;EAC9E,cAAc;EACd,cAAc;EACd,SAAS;EACT,QAAQ;EACR,oBAAoB;CACtB,CAAC;CAED,OACE,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,QAAD;EAAM,KAAK;EAAW,WAAW,GAAG,qCAAqC,gBAAgB;EACtF,UAAA;CACG,CAAA,GACL,OAAO,aAAa,cACjB,aACE,oBAAC,iBAAD,EAAA,UACG,QAAQ,SACP,oBAAC,QAAD;EACE,eAAA;EACA,WAAU;EACV,OAAO;GACL,KAAK,OAAO;GACZ,MAAM,OAAO;GACb,WAAW,gBAAgB;EAC7B;EAEA,UAAA,oBAAC,OAAO,MAAR;GACM;GACJ,MAAK;GACK;GACV,SAAQ;GACR,SAAQ;GACR,MAAK;GACL,OAAO,EAAE,iBAAiB,gBAAgB,MAAM;GAChD,WAAW,GACT,mIACA,SACF;GAEC,UAAA;EACU,CAAA;CACT,CAAA,IACJ,KACW,CAAA,GACjB,SAAS,IACX,IACA,IACJ,EAAA,CAAA;AAEN"}
@@ -0,0 +1,24 @@
1
+ //#region src/components/motion/wheel-picker.d.ts
2
+ type WheelPickerOption = string | {
3
+ label: string;
4
+ value: string;
5
+ };
6
+ interface WheelPickerProps {
7
+ options: WheelPickerOption[];
8
+ value?: string;
9
+ defaultValue?: string;
10
+ onValueChange?: (value: string) => void;
11
+ /** Rows visible through the window, odd. More = flatter curve. Default 5. */
12
+ visibleCount?: number;
13
+ /** Row height in px. Default 36. */
14
+ itemHeight?: number;
15
+ disabled?: boolean;
16
+ /** Play a short tick each time the selected value changes. Default false. */
17
+ sound?: boolean;
18
+ className?: string;
19
+ "aria-label"?: string;
20
+ }
21
+ declare function WheelPicker({ options, value, defaultValue, onValueChange, visibleCount, itemHeight, disabled, sound, className, "aria-label": ariaLabel }: WheelPickerProps): import("react").JSX.Element;
22
+ //#endregion
23
+ export { WheelPicker, WheelPickerOption, WheelPickerProps };
24
+ //# sourceMappingURL=wheel-picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wheel-picker.d.ts","names":[],"sources":["../../../src/components/motion/wheel-picker.tsx"],"mappings":";KAgBY;EAA+B;EAAe;;UAEzC;EACf,SAAS;EACT;EACA;EACA,iBAAiB;;EAEjB;;EAEA;EACA;;EAEA;EACA;EACA;;iBA2Bc,cACd,SACA,OACA,cACA,eACA,cACA,YACA,UACA,OACA,yBACc,aACb,mCAAgB,IAAA"}
@@ -0,0 +1,442 @@
1
+ "use client";
2
+ import { createTickPlayer } from "../../lib/tick-sound.js";
3
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
4
+ import { cn } from "@kumix/utils";
5
+ import { useReducedMotion } from "motion/react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/motion/wheel-picker.tsx
8
+ const DEG = Math.PI / 180;
9
+ const DECELERATION = 42e-5;
10
+ const MAX_VELOCITY = .18;
11
+ const VELOCITY_WINDOW = 90;
12
+ const WHEEL_SENS = .012;
13
+ const WHEEL_SETTLE = 110;
14
+ const easeOutCubic = (p) => 1 - (1 - p) ** 3;
15
+ const BACK = 1.35;
16
+ const easeOutBack = (p) => 1 + 2.35 * (p - 1) ** 3 + BACK * (p - 1) ** 2;
17
+ const clamp = (v, lo, hi) => Math.max(lo, Math.min(v, hi));
18
+ function optionValue(option) {
19
+ return typeof option === "string" ? option : option.value;
20
+ }
21
+ function optionLabel(option) {
22
+ return typeof option === "string" ? option : option.label;
23
+ }
24
+ function WheelPicker({ options, value, defaultValue, onValueChange, visibleCount = 5, itemHeight = 36, disabled = false, sound = false, className, "aria-label": ariaLabel }) {
25
+ const reduce = useReducedMotion() ?? false;
26
+ const controlled = value !== void 0;
27
+ const last = options.length - 1;
28
+ const indexOf = useCallback((v) => {
29
+ const i = options.findIndex((o) => optionValue(o) === v);
30
+ return i < 0 ? 0 : i;
31
+ }, [options]);
32
+ const [internal, setInternal] = useState(() => defaultValue ?? value);
33
+ const currentValue = controlled ? value : internal;
34
+ const [grabbing, setGrabbing] = useState(false);
35
+ const { itemAngle, radius, height, hideBeyond } = useMemo(() => {
36
+ const rowsEachSide = Math.max(1, Math.floor(visibleCount / 2));
37
+ const cutoff = rowsEachSide + 1;
38
+ const angle = 90 / cutoff;
39
+ const r = itemHeight / Math.tan(angle * DEG);
40
+ return {
41
+ itemAngle: angle,
42
+ radius: r,
43
+ hideBeyond: cutoff,
44
+ height: Math.round(2 * r * Math.sin(rowsEachSide * angle * DEG) + itemHeight)
45
+ };
46
+ }, [visibleCount, itemHeight]);
47
+ const container = useRef(null);
48
+ const drumRef = useRef(null);
49
+ const bandRef = useRef(null);
50
+ const scroll = useRef(indexOf(currentValue));
51
+ const raf = useRef(0);
52
+ const emitted = useRef(currentValue);
53
+ const tickPlayer = useRef(null);
54
+ const lastTick = useRef(indexOf(currentValue));
55
+ const paint = useCallback((s) => {
56
+ const drum = drumRef.current;
57
+ const band = bandRef.current;
58
+ if (drum) {
59
+ drum.style.transform = `translateZ(${-radius}px) rotateX(${itemAngle * s}deg)`;
60
+ for (const node of Array.from(drum.children)) {
61
+ const li = node;
62
+ const i = Number(li.dataset.index);
63
+ const want = Math.abs(i - s) > hideBeyond ? "hidden" : "visible";
64
+ if (li.style.visibility !== want) li.style.visibility = want;
65
+ }
66
+ }
67
+ if (band) {
68
+ band.style.transform = `translateZ(${-radius}px) rotateX(${itemAngle * s}deg)`;
69
+ for (const node of Array.from(band.children)) {
70
+ const li = node;
71
+ const i = Number(li.dataset.index);
72
+ const want = Math.abs(i - s) > hideBeyond ? "hidden" : "visible";
73
+ if (li.style.visibility !== want) li.style.visibility = want;
74
+ }
75
+ }
76
+ }, [
77
+ radius,
78
+ itemAngle,
79
+ hideBeyond
80
+ ]);
81
+ const getPlayer = useCallback(() => {
82
+ if (!tickPlayer.current) tickPlayer.current = createTickPlayer();
83
+ return tickPlayer.current;
84
+ }, []);
85
+ const emit = useCallback((i) => {
86
+ const v = optionValue(options[clamp(i, 0, last)]);
87
+ if (v === emitted.current) return;
88
+ emitted.current = v;
89
+ if (sound && reduce) getPlayer().play();
90
+ if (!controlled) setInternal(v);
91
+ onValueChange?.(v);
92
+ }, [
93
+ options,
94
+ last,
95
+ controlled,
96
+ onValueChange,
97
+ sound,
98
+ reduce,
99
+ getPlayer
100
+ ]);
101
+ const maybeTick = useCallback((pos) => {
102
+ const row = clamp(Math.round(pos), 0, last);
103
+ if (!sound || reduce) {
104
+ lastTick.current = row;
105
+ return;
106
+ }
107
+ if (row === lastTick.current) return;
108
+ lastTick.current = row;
109
+ getPlayer().play();
110
+ }, [
111
+ sound,
112
+ reduce,
113
+ last,
114
+ getPlayer
115
+ ]);
116
+ const stop = useCallback(() => cancelAnimationFrame(raf.current), []);
117
+ const glide = useCallback((to, duration, ease = easeOutCubic) => {
118
+ stop();
119
+ const from = scroll.current;
120
+ const dist = to - from;
121
+ if (!dist || duration <= 0) {
122
+ scroll.current = to;
123
+ paint(to);
124
+ maybeTick(to);
125
+ emit(to);
126
+ return;
127
+ }
128
+ const start = performance.now();
129
+ const tick = (now) => {
130
+ const p = (now - start) / duration;
131
+ if (p >= 1) {
132
+ scroll.current = to;
133
+ paint(to);
134
+ maybeTick(to);
135
+ emit(to);
136
+ return;
137
+ }
138
+ scroll.current = from + dist * ease(p);
139
+ paint(scroll.current);
140
+ maybeTick(scroll.current);
141
+ raf.current = requestAnimationFrame(tick);
142
+ };
143
+ raf.current = requestAnimationFrame(tick);
144
+ }, [
145
+ stop,
146
+ paint,
147
+ emit,
148
+ maybeTick
149
+ ]);
150
+ const fling = useCallback((velocity) => {
151
+ const from = scroll.current;
152
+ if (from < 0 || from > last) {
153
+ glide(clamp(Math.round(from), 0, last), 260);
154
+ return;
155
+ }
156
+ const dir = Math.sign(velocity);
157
+ const coast = velocity * velocity / (2 * DECELERATION) * dir;
158
+ const to = clamp(Math.round(from + coast), 0, last);
159
+ const duration = clamp(Math.sqrt(Math.abs(to - from)) * 300 + 240, 280, 1700);
160
+ glide(to, duration, easeOutBack);
161
+ }, [glide, last]);
162
+ const step = useCallback((by) => glide(clamp(Math.round(scroll.current) + by, 0, last), 300, easeOutBack), [glide, last]);
163
+ const drag = useRef(null);
164
+ const dragFrame = useRef(0);
165
+ const latestY = useRef(0);
166
+ const beginDrag = useCallback((y) => {
167
+ stop();
168
+ if (sound) getPlayer().prepare();
169
+ setGrabbing(true);
170
+ drag.current = {
171
+ y,
172
+ scroll: scroll.current,
173
+ pts: [[y, performance.now()]]
174
+ };
175
+ }, [
176
+ stop,
177
+ sound,
178
+ getPlayer
179
+ ]);
180
+ const moveDrag = useCallback((y) => {
181
+ const d = drag.current;
182
+ if (!d) return;
183
+ latestY.current = y;
184
+ d.pts.push([y, performance.now()]);
185
+ if (d.pts.length > 8) d.pts.shift();
186
+ if (dragFrame.current) return;
187
+ dragFrame.current = requestAnimationFrame(() => {
188
+ dragFrame.current = 0;
189
+ const dd = drag.current;
190
+ if (!dd) return;
191
+ let next = dd.scroll + (dd.y - latestY.current) / itemHeight;
192
+ if (next < 0) next *= .3;
193
+ else if (next > last) next = last + (next - last) * .3;
194
+ scroll.current = next;
195
+ paint(next);
196
+ maybeTick(next);
197
+ emit(Math.round(clamp(next, 0, last)));
198
+ });
199
+ }, [
200
+ itemHeight,
201
+ last,
202
+ paint,
203
+ emit,
204
+ maybeTick
205
+ ]);
206
+ const endDrag = useCallback(() => {
207
+ const d = drag.current;
208
+ if (!d) return;
209
+ if (dragFrame.current) {
210
+ cancelAnimationFrame(dragFrame.current);
211
+ dragFrame.current = 0;
212
+ }
213
+ drag.current = null;
214
+ setGrabbing(false);
215
+ const pts = d.pts;
216
+ let v = 0;
217
+ if (pts.length > 1) {
218
+ const latest = pts[pts.length - 1];
219
+ let ref = pts[0];
220
+ for (const p of pts) if (latest[1] - p[1] <= VELOCITY_WINDOW) {
221
+ ref = p;
222
+ break;
223
+ }
224
+ const dt = latest[1] - ref[1];
225
+ if (dt > 0) {
226
+ const raw = (ref[0] - latest[0]) / itemHeight / dt;
227
+ v = clamp(raw, -.18, MAX_VELOCITY);
228
+ }
229
+ }
230
+ fling(v);
231
+ }, [itemHeight, fling]);
232
+ const onPointerDown = useCallback((event) => {
233
+ if (disabled || reduce || event.pointerType === "touch") return;
234
+ event.currentTarget.setPointerCapture(event.pointerId);
235
+ beginDrag(event.clientY);
236
+ }, [
237
+ disabled,
238
+ reduce,
239
+ beginDrag
240
+ ]);
241
+ const onPointerMove = useCallback((event) => {
242
+ if (event.pointerType === "touch") return;
243
+ moveDrag(event.clientY);
244
+ }, [moveDrag]);
245
+ const onPointerUp = useCallback((event) => {
246
+ if (event.pointerType === "touch") return;
247
+ event.currentTarget.releasePointerCapture?.(event.pointerId);
248
+ endDrag();
249
+ }, [endDrag]);
250
+ const wheelSnap = useRef(null);
251
+ const onWheel = useCallback((event) => {
252
+ if (disabled || reduce) return;
253
+ event.preventDefault();
254
+ if (sound) getPlayer().prepare();
255
+ stop();
256
+ const px = event.deltaMode === 1 ? event.deltaY * 16 : event.deltaY;
257
+ const next = clamp(scroll.current + px * WHEEL_SENS, 0, last);
258
+ scroll.current = next;
259
+ paint(next);
260
+ maybeTick(next);
261
+ emit(Math.round(next));
262
+ if (wheelSnap.current) clearTimeout(wheelSnap.current);
263
+ wheelSnap.current = setTimeout(() => {
264
+ glide(clamp(Math.round(scroll.current), 0, last), 240, easeOutBack);
265
+ }, WHEEL_SETTLE);
266
+ }, [
267
+ disabled,
268
+ reduce,
269
+ sound,
270
+ last,
271
+ paint,
272
+ emit,
273
+ stop,
274
+ glide,
275
+ maybeTick,
276
+ getPlayer
277
+ ]);
278
+ const onKeyDown = useCallback((event) => {
279
+ if (disabled) return;
280
+ const at = Math.round(scroll.current);
281
+ const map = {
282
+ ArrowUp: -1,
283
+ ArrowDown: 1,
284
+ Home: -at,
285
+ End: last - at
286
+ };
287
+ if (event.key in map) {
288
+ event.preventDefault();
289
+ if (sound) getPlayer().prepare();
290
+ step(map[event.key]);
291
+ }
292
+ }, [
293
+ disabled,
294
+ sound,
295
+ last,
296
+ step,
297
+ getPlayer
298
+ ]);
299
+ useEffect(() => {
300
+ if (drag.current) return;
301
+ const target = indexOf(currentValue);
302
+ emitted.current = currentValue;
303
+ if (Math.abs(Math.round(scroll.current) - target) < .001) {
304
+ paint(scroll.current);
305
+ return;
306
+ }
307
+ glide(target, 260);
308
+ }, [
309
+ currentValue,
310
+ indexOf,
311
+ paint,
312
+ glide
313
+ ]);
314
+ useEffect(() => () => {
315
+ cancelAnimationFrame(raf.current);
316
+ cancelAnimationFrame(dragFrame.current);
317
+ if (wheelSnap.current) clearTimeout(wheelSnap.current);
318
+ tickPlayer.current?.dispose();
319
+ }, []);
320
+ useEffect(() => {
321
+ const el = container.current;
322
+ if (!el || reduce || disabled) return;
323
+ const onStart = (e) => {
324
+ const t = e.touches[0];
325
+ if (t) beginDrag(t.clientY);
326
+ };
327
+ const onMove = (e) => {
328
+ const t = e.touches[0];
329
+ if (!t || !drag.current) return;
330
+ e.preventDefault();
331
+ moveDrag(t.clientY);
332
+ };
333
+ const onEnd = () => endDrag();
334
+ el.addEventListener("touchstart", onStart, { passive: true });
335
+ el.addEventListener("touchmove", onMove, { passive: false });
336
+ el.addEventListener("touchend", onEnd);
337
+ el.addEventListener("touchcancel", onEnd);
338
+ el.addEventListener("wheel", onWheel, { passive: false });
339
+ return () => {
340
+ el.removeEventListener("touchstart", onStart);
341
+ el.removeEventListener("touchmove", onMove);
342
+ el.removeEventListener("touchend", onEnd);
343
+ el.removeEventListener("touchcancel", onEnd);
344
+ el.removeEventListener("wheel", onWheel);
345
+ };
346
+ }, [
347
+ reduce,
348
+ disabled,
349
+ beginDrag,
350
+ moveDrag,
351
+ endDrag,
352
+ onWheel
353
+ ]);
354
+ const maskFade = "[mask-image:linear-gradient(to_bottom,transparent,#000_22%,#000_78%,transparent)]";
355
+ if (reduce) {
356
+ const pad = (height - itemHeight) / 2;
357
+ return /* @__PURE__ */ jsxs("div", {
358
+ className: cn("relative overflow-hidden rounded-2xl border border-border bg-card", disabled && "pointer-events-none opacity-50", className),
359
+ style: { height },
360
+ children: [/* @__PURE__ */ jsx("div", {
361
+ className: "pointer-events-none absolute inset-x-0 top-1/2 z-10 -translate-y-1/2 border-border border-y bg-foreground/4",
362
+ style: { height: itemHeight }
363
+ }), /* @__PURE__ */ jsx("ul", {
364
+ className: cn("h-full snap-y snap-mandatory overflow-y-auto scroll-smooth [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", maskFade),
365
+ style: {
366
+ paddingTop: pad,
367
+ paddingBottom: pad
368
+ },
369
+ children: options.map((option) => {
370
+ const v = optionValue(option);
371
+ return /* @__PURE__ */ jsx("li", {
372
+ className: "snap-center",
373
+ children: /* @__PURE__ */ jsx("button", {
374
+ type: "button",
375
+ disabled,
376
+ onClick: () => emit(options.indexOf(option)),
377
+ className: cn("flex w-full items-center justify-center font-medium", v === currentValue ? "text-foreground" : "text-muted-foreground"),
378
+ style: { height: itemHeight },
379
+ children: optionLabel(option)
380
+ })
381
+ }, v);
382
+ })
383
+ })]
384
+ });
385
+ }
386
+ return /* @__PURE__ */ jsxs("div", {
387
+ ref: container,
388
+ role: "listbox",
389
+ "aria-label": ariaLabel,
390
+ tabIndex: disabled ? -1 : 0,
391
+ onKeyDown,
392
+ onPointerDown,
393
+ onPointerMove,
394
+ onPointerUp,
395
+ onPointerCancel: onPointerUp,
396
+ className: cn("relative touch-none select-none overflow-hidden rounded-2xl border border-border bg-card outline-none focus-visible:ring-2 focus-visible:ring-foreground/20", grabbing ? "cursor-grabbing" : "cursor-grab", disabled && "pointer-events-none opacity-50", maskFade, className),
397
+ style: {
398
+ height,
399
+ perspective: 1e3
400
+ },
401
+ children: [/* @__PURE__ */ jsx("ul", {
402
+ ref: drumRef,
403
+ "aria-hidden": true,
404
+ className: "backface-hidden transform-3d absolute inset-x-0 top-1/2 m-0 h-0 list-none p-0 will-change-transform",
405
+ children: options.map((option, i) => /* @__PURE__ */ jsx("li", {
406
+ "data-index": i,
407
+ className: "absolute inset-x-0 flex items-center justify-center font-medium text-muted-foreground",
408
+ style: {
409
+ top: -itemHeight / 2,
410
+ height: itemHeight,
411
+ transform: `rotateX(${-itemAngle * i}deg) translateZ(${radius}px)`
412
+ },
413
+ children: optionLabel(option)
414
+ }, optionValue(option)))
415
+ }), /* @__PURE__ */ jsx("div", {
416
+ className: "pointer-events-none absolute inset-x-0 top-1/2 z-10 -translate-y-1/2 overflow-hidden rounded-md bg-foreground/4",
417
+ style: {
418
+ height: itemHeight,
419
+ perspective: 1e3
420
+ },
421
+ children: /* @__PURE__ */ jsx("ul", {
422
+ ref: bandRef,
423
+ "aria-hidden": true,
424
+ className: "backface-hidden transform-3d absolute inset-x-0 top-1/2 m-0 h-0 list-none p-0 will-change-transform",
425
+ children: options.map((option, i) => /* @__PURE__ */ jsx("li", {
426
+ "data-index": i,
427
+ className: "absolute inset-x-0 flex items-center justify-center font-medium text-foreground",
428
+ style: {
429
+ top: -itemHeight / 2,
430
+ height: itemHeight,
431
+ transform: `rotateX(${-itemAngle * i}deg) translateZ(${radius}px)`
432
+ },
433
+ children: optionLabel(option)
434
+ }, optionValue(option)))
435
+ })
436
+ })]
437
+ });
438
+ }
439
+ //#endregion
440
+ export { WheelPicker };
441
+
442
+ //# sourceMappingURL=wheel-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wheel-picker.js","names":[],"sources":["../../../src/components/motion/wheel-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type KeyboardEvent,\n type PointerEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { createTickPlayer } from \"../../lib/tick-sound\";\n\nexport type WheelPickerOption = string | { label: string; value: string };\n\nexport interface WheelPickerProps {\n options: WheelPickerOption[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Rows visible through the window, odd. More = flatter curve. Default 5. */\n visibleCount?: number;\n /** Row height in px. Default 36. */\n itemHeight?: number;\n disabled?: boolean;\n /** Play a short tick each time the selected value changes. Default false. */\n sound?: boolean;\n className?: string;\n \"aria-label\"?: string;\n}\n\nconst DEG = Math.PI / 180;\n// Physics constants, tuned for an iOS-like flick rather than reused from the\n// shared spring tokens: the wheel coasts in whole-row units and springs to an\n// integer detent, which a layout spring can't express cleanly.\nconst DECELERATION = 0.00042; // rows per ms², how fast a flick bleeds off (lower = freer)\nconst MAX_VELOCITY = 0.18; // rows per ms, caps a hard fling\nconst VELOCITY_WINDOW = 90; // ms of recent drag to average a release velocity over\nconst WHEEL_SENS = 0.012; // rows per pixel of wheel delta\nconst WHEEL_SETTLE = 110; // ms of wheel idle before snapping to a row\nconst easeOutCubic = (p: number) => 1 - (1 - p) ** 3;\n// Overshoots the target by a few percent then settles — the little spring\n// bounce as a row snaps home. `BACK` sets how far it drifts past.\nconst BACK = 1.35;\nconst easeOutBack = (p: number) => 1 + (BACK + 1) * (p - 1) ** 3 + BACK * (p - 1) ** 2;\n\nconst clamp = (v: number, lo: number, hi: number) => Math.max(lo, Math.min(v, hi));\n\nfunction optionValue(option: WheelPickerOption) {\n return typeof option === \"string\" ? option : option.value;\n}\nfunction optionLabel(option: WheelPickerOption) {\n return typeof option === \"string\" ? option : option.label;\n}\n\nexport function WheelPicker({\n options,\n value,\n defaultValue,\n onValueChange,\n visibleCount = 5,\n itemHeight = 36,\n disabled = false,\n sound = false,\n className,\n \"aria-label\": ariaLabel,\n}: WheelPickerProps) {\n const reduce = useReducedMotion() ?? false;\n const controlled = value !== undefined;\n const last = options.length - 1;\n\n const indexOf = useCallback(\n (v: string | undefined) => {\n const i = options.findIndex((o) => optionValue(o) === v);\n return i < 0 ? 0 : i;\n },\n [options],\n );\n\n const [internal, setInternal] = useState(() => defaultValue ?? value);\n const currentValue = controlled ? value : internal;\n const [grabbing, setGrabbing] = useState(false);\n\n // Cylinder geometry. Each row spans `itemAngle`; `radius` seats the rows on\n // the drum; rows past `hideBeyond` sit behind the horizon and are dropped.\n const { itemAngle, radius, height, hideBeyond } = useMemo(() => {\n const rowsEachSide = Math.max(1, Math.floor(visibleCount / 2));\n const cutoff = rowsEachSide + 1;\n const angle = 90 / cutoff;\n const r = itemHeight / Math.tan(angle * DEG);\n return {\n itemAngle: angle,\n radius: r,\n hideBeyond: cutoff,\n height: Math.round(2 * r * Math.sin(rowsEachSide * angle * DEG) + itemHeight),\n };\n }, [visibleCount, itemHeight]);\n\n const container = useRef<HTMLDivElement>(null);\n const drumRef = useRef<HTMLUListElement>(null);\n const bandRef = useRef<HTMLUListElement>(null);\n // Scroll position measured in rows (a float index). One source of truth for\n // both layers: the drum rotates by `itemAngle·scroll`, the crisp band slides\n // by `itemHeight·scroll`.\n const scroll = useRef(indexOf(currentValue));\n const raf = useRef(0);\n const emitted = useRef(currentValue);\n const tickPlayer = useRef<ReturnType<typeof createTickPlayer> | null>(null);\n const lastTick = useRef(indexOf(currentValue));\n\n const paint = useCallback(\n (s: number) => {\n const drum = drumRef.current;\n const band = bandRef.current;\n if (drum) {\n drum.style.transform = `translateZ(${-radius}px) rotateX(${itemAngle * s}deg)`;\n for (const node of Array.from(drum.children)) {\n const li = node as HTMLLIElement;\n const i = Number(li.dataset.index);\n const want = Math.abs(i - s) > hideBeyond ? \"hidden\" : \"visible\";\n // Write only on change — an unconditional write every frame thrashes\n // style recalc and is what made the drag feel draggy on mobile.\n if (li.style.visibility !== want) li.style.visibility = want;\n }\n }\n // The band is the SAME drum, clipped to the centre row — driven by the\n // identical transform so the crisp copy sits exactly on the dimmed one,\n // with no parallax ghost as rows cross the window. It needs the same\n // horizon cull, or the row on the back of the drum bleeds into the front.\n if (band) {\n band.style.transform = `translateZ(${-radius}px) rotateX(${itemAngle * s}deg)`;\n for (const node of Array.from(band.children)) {\n const li = node as HTMLLIElement;\n const i = Number(li.dataset.index);\n const want = Math.abs(i - s) > hideBeyond ? \"hidden\" : \"visible\";\n if (li.style.visibility !== want) li.style.visibility = want;\n }\n }\n },\n [radius, itemAngle, hideBeyond],\n );\n\n const getPlayer = useCallback(() => {\n if (!tickPlayer.current) tickPlayer.current = createTickPlayer();\n return tickPlayer.current;\n }, []);\n\n const emit = useCallback(\n (i: number) => {\n const v = optionValue(options[clamp(i, 0, last)]);\n if (v === emitted.current) return;\n emitted.current = v;\n // Reduced motion has no drum/glide path to tick from — it's an\n // onClick straight into emit, so the tick lives here instead.\n if (sound && reduce) getPlayer().play();\n if (!controlled) setInternal(v);\n onValueChange?.(v);\n },\n [options, last, controlled, onValueChange, sound, reduce, getPlayer],\n );\n\n // Drum path: fires a tick whenever the nearest row changes, independent of\n // `emit` (which only fires on settle during a glide/fling, not per row\n // crossed). Gated on `!reduce` since the reduced render never calls this.\n const maybeTick = useCallback(\n (pos: number) => {\n const row = clamp(Math.round(pos), 0, last);\n if (!sound || reduce) {\n lastTick.current = row;\n return;\n }\n if (row === lastTick.current) return;\n lastTick.current = row;\n getPlayer().play();\n },\n [sound, reduce, last, getPlayer],\n );\n\n const stop = useCallback(() => cancelAnimationFrame(raf.current), []);\n\n // Ease `scroll` from where it is to an integer detent over `duration`. The\n // easing may overshoot (spring bounce) before it resolves exactly on `to`.\n const glide = useCallback(\n (to: number, duration: number, ease: (p: number) => number = easeOutCubic) => {\n stop();\n const from = scroll.current;\n const dist = to - from;\n if (!dist || duration <= 0) {\n scroll.current = to;\n paint(to);\n maybeTick(to);\n emit(to);\n return;\n }\n const start = performance.now();\n const tick = (now: number) => {\n const p = (now - start) / duration;\n if (p >= 1) {\n scroll.current = to;\n paint(to);\n maybeTick(to);\n emit(to);\n return;\n }\n scroll.current = from + dist * ease(p);\n paint(scroll.current);\n maybeTick(scroll.current);\n raf.current = requestAnimationFrame(tick);\n };\n raf.current = requestAnimationFrame(tick);\n },\n [stop, paint, emit, maybeTick],\n );\n\n // Project where a flick of `velocity` (rows/ms) coasts to, snap to a row.\n const fling = useCallback(\n (velocity: number) => {\n const from = scroll.current;\n if (from < 0 || from > last) {\n glide(clamp(Math.round(from), 0, last), 260); // rubber-band back\n return;\n }\n const dir = Math.sign(velocity);\n const coast = ((velocity * velocity) / (2 * DECELERATION)) * dir;\n const to = clamp(Math.round(from + coast), 0, last);\n // Long, spring-tipped settle so a hard flick reads as free momentum\n // coasting to rest with a gentle bounce, never a clipped stop.\n const duration = clamp(Math.sqrt(Math.abs(to - from)) * 300 + 240, 280, 1700);\n glide(to, duration, easeOutBack);\n },\n [glide, last],\n );\n\n const step = useCallback(\n (by: number) => glide(clamp(Math.round(scroll.current) + by, 0, last), 300, easeOutBack),\n [glide, last],\n );\n\n // Drag: track recent points for a release velocity; rubber-band past the ends.\n const drag = useRef<{\n y: number;\n scroll: number;\n pts: [number, number][];\n } | null>(null);\n // Coalesce touch/pointer moves to one paint per animation frame — raw move\n // events fire several times per frame (and off-frame) on high-refresh\n // screens, and painting each one is what made the drag feel choppy.\n const dragFrame = useRef(0);\n const latestY = useRef(0);\n // Shared drag core, driven by a Y coordinate from either a mouse pointer or a\n // native touch. Touch is bound with non-passive listeners in the effect below\n // so the move can preventDefault the page scroll — React's synthetic touch\n // events are passive and can't, which is why finger-drag did nothing on\n // mobile.\n const beginDrag = useCallback(\n (y: number) => {\n stop();\n if (sound) getPlayer().prepare();\n setGrabbing(true);\n drag.current = {\n y,\n scroll: scroll.current,\n pts: [[y, performance.now()]],\n };\n },\n [stop, sound, getPlayer],\n );\n const moveDrag = useCallback(\n (y: number) => {\n const d = drag.current;\n if (!d) return;\n // Record every sample for an accurate release velocity, but only render\n // the newest position once per frame.\n latestY.current = y;\n d.pts.push([y, performance.now()]);\n if (d.pts.length > 8) d.pts.shift();\n if (dragFrame.current) return;\n dragFrame.current = requestAnimationFrame(() => {\n dragFrame.current = 0;\n const dd = drag.current;\n if (!dd) return;\n let next = dd.scroll + (dd.y - latestY.current) / itemHeight;\n if (next < 0) next *= 0.3;\n else if (next > last) next = last + (next - last) * 0.3;\n scroll.current = next;\n paint(next);\n maybeTick(next);\n emit(Math.round(clamp(next, 0, last)));\n });\n },\n [itemHeight, last, paint, emit, maybeTick],\n );\n const endDrag = useCallback(() => {\n const d = drag.current;\n if (!d) return;\n if (dragFrame.current) {\n cancelAnimationFrame(dragFrame.current);\n dragFrame.current = 0;\n }\n drag.current = null;\n setGrabbing(false);\n // Average velocity over the last `VELOCITY_WINDOW` ms of movement rather\n // than the final two samples — a single noisy frame otherwise makes an\n // even flick feel like it caught or slipped.\n const pts = d.pts;\n let v = 0;\n if (pts.length > 1) {\n const latest = pts[pts.length - 1];\n let ref = pts[0];\n for (const p of pts) {\n if (latest[1] - p[1] <= VELOCITY_WINDOW) {\n ref = p;\n break;\n }\n }\n const dt = latest[1] - ref[1];\n if (dt > 0) {\n const raw = (ref[0] - latest[0]) / itemHeight / dt;\n v = clamp(raw, -MAX_VELOCITY, MAX_VELOCITY);\n }\n }\n fling(v);\n }, [itemHeight, fling]);\n\n // Mouse / pen only — touch runs through the native listeners in the effect.\n const onPointerDown = useCallback(\n (event: PointerEvent<HTMLDivElement>) => {\n if (disabled || reduce || event.pointerType === \"touch\") return;\n event.currentTarget.setPointerCapture(event.pointerId);\n beginDrag(event.clientY);\n },\n [disabled, reduce, beginDrag],\n );\n const onPointerMove = useCallback(\n (event: PointerEvent<HTMLDivElement>) => {\n if (event.pointerType === \"touch\") return;\n moveDrag(event.clientY);\n },\n [moveDrag],\n );\n const onPointerUp = useCallback(\n (event: PointerEvent<HTMLDivElement>) => {\n if (event.pointerType === \"touch\") return;\n event.currentTarget.releasePointerCapture?.(event.pointerId);\n endDrag();\n },\n [endDrag],\n );\n\n // Wheel drives `scroll` continuously — like a drag — then snaps once it goes\n // idle. Firing a fresh eased step per notch instead stacks overlapping\n // animations that keep interrupting each other, which read as lag.\n const wheelSnap = useRef<ReturnType<typeof setTimeout> | null>(null);\n const onWheel = useCallback(\n (event: globalThis.WheelEvent) => {\n // Native (non-passive) so preventDefault actually stops the page from\n // scrolling behind the wheel — React's synthetic wheel listener is\n // passive, so a handler on the element cannot cancel the scroll.\n if (disabled || reduce) return;\n event.preventDefault();\n if (sound) getPlayer().prepare();\n stop();\n const px = event.deltaMode === 1 ? event.deltaY * 16 : event.deltaY;\n const next = clamp(scroll.current + px * WHEEL_SENS, 0, last);\n scroll.current = next;\n paint(next);\n maybeTick(next);\n emit(Math.round(next));\n if (wheelSnap.current) clearTimeout(wheelSnap.current);\n wheelSnap.current = setTimeout(() => {\n glide(clamp(Math.round(scroll.current), 0, last), 240, easeOutBack);\n }, WHEEL_SETTLE);\n },\n [disabled, reduce, sound, last, paint, emit, stop, glide, maybeTick, getPlayer],\n );\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (disabled) return;\n const at = Math.round(scroll.current);\n const map: Record<string, number> = {\n ArrowUp: -1,\n ArrowDown: 1,\n Home: -at,\n End: last - at,\n };\n if (event.key in map) {\n event.preventDefault();\n if (sound) getPlayer().prepare();\n step(map[event.key]);\n }\n },\n [disabled, sound, last, step, getPlayer],\n );\n\n // Paint the starting frame, and follow controlled/value changes from outside\n // unless a gesture is mid-flight.\n useEffect(() => {\n if (drag.current) return;\n const target = indexOf(currentValue);\n emitted.current = currentValue;\n if (Math.abs(Math.round(scroll.current) - target) < 0.001) {\n paint(scroll.current);\n return;\n }\n glide(target, 260);\n }, [currentValue, indexOf, paint, glide]);\n\n useEffect(\n () => () => {\n cancelAnimationFrame(raf.current);\n cancelAnimationFrame(dragFrame.current);\n if (wheelSnap.current) clearTimeout(wheelSnap.current);\n tickPlayer.current?.dispose();\n },\n [],\n );\n\n // Native touch + wheel listeners, bound non-passively so touchmove and wheel\n // can block the page from scrolling while the wheel spins. React's synthetic\n // touch/wheel handlers are passive, so preventDefault there is a no-op and the\n // gesture scrolls the page instead of driving the drum.\n useEffect(() => {\n const el = container.current;\n if (!el || reduce || disabled) return;\n const onStart = (e: TouchEvent) => {\n const t = e.touches[0];\n if (t) beginDrag(t.clientY);\n };\n const onMove = (e: TouchEvent) => {\n const t = e.touches[0];\n if (!t || !drag.current) return;\n e.preventDefault();\n moveDrag(t.clientY);\n };\n const onEnd = () => endDrag();\n el.addEventListener(\"touchstart\", onStart, { passive: true });\n el.addEventListener(\"touchmove\", onMove, { passive: false });\n el.addEventListener(\"touchend\", onEnd);\n el.addEventListener(\"touchcancel\", onEnd);\n el.addEventListener(\"wheel\", onWheel, { passive: false });\n return () => {\n el.removeEventListener(\"touchstart\", onStart);\n el.removeEventListener(\"touchmove\", onMove);\n el.removeEventListener(\"touchend\", onEnd);\n el.removeEventListener(\"touchcancel\", onEnd);\n el.removeEventListener(\"wheel\", onWheel);\n };\n }, [reduce, disabled, beginDrag, moveDrag, endDrag, onWheel]);\n\n const maskFade =\n \"[mask-image:linear-gradient(to_bottom,transparent,#000_22%,#000_78%,transparent)]\";\n\n if (reduce) {\n const pad = (height - itemHeight) / 2;\n return (\n <div\n className={cn(\n \"relative overflow-hidden rounded-2xl border border-border bg-card\",\n disabled && \"pointer-events-none opacity-50\",\n className,\n )}\n style={{ height }}\n >\n <div\n className=\"pointer-events-none absolute inset-x-0 top-1/2 z-10 -translate-y-1/2 border-border border-y bg-foreground/4\"\n style={{ height: itemHeight }}\n />\n <ul\n className={cn(\n \"h-full snap-y snap-mandatory overflow-y-auto scroll-smooth [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n maskFade,\n )}\n style={{ paddingTop: pad, paddingBottom: pad }}\n >\n {options.map((option) => {\n const v = optionValue(option);\n return (\n <li key={v} className=\"snap-center\">\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => emit(options.indexOf(option))}\n className={cn(\n \"flex w-full items-center justify-center font-medium\",\n v === currentValue ? \"text-foreground\" : \"text-muted-foreground\",\n )}\n style={{ height: itemHeight }}\n >\n {optionLabel(option)}\n </button>\n </li>\n );\n })}\n </ul>\n </div>\n );\n }\n\n return (\n <div\n ref={container}\n role=\"listbox\"\n aria-label={ariaLabel}\n tabIndex={disabled ? -1 : 0}\n onKeyDown={onKeyDown}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n onPointerCancel={onPointerUp}\n className={cn(\n \"relative touch-none select-none overflow-hidden rounded-2xl border border-border bg-card outline-none focus-visible:ring-2 focus-visible:ring-foreground/20\",\n grabbing ? \"cursor-grabbing\" : \"cursor-grab\",\n disabled && \"pointer-events-none opacity-50\",\n maskFade,\n className,\n )}\n style={{ height, perspective: 1000 }}\n >\n {/* Curved drum of dimmed rows. */}\n <ul\n ref={drumRef}\n aria-hidden\n className=\"backface-hidden transform-3d absolute inset-x-0 top-1/2 m-0 h-0 list-none p-0 will-change-transform\"\n >\n {options.map((option, i) => (\n <li\n key={optionValue(option)}\n data-index={i}\n className=\"absolute inset-x-0 flex items-center justify-center font-medium text-muted-foreground\"\n style={{\n top: -itemHeight / 2,\n height: itemHeight,\n transform: `rotateX(${-itemAngle * i}deg) translateZ(${radius}px)`,\n }}\n >\n {optionLabel(option)}\n </li>\n ))}\n </ul>\n\n {/* Center band: the very same drum, clipped to one row and drawn crisp.\n Its own perspective, centred on the container middle, matches the main\n drum's projection so the two copies register exactly. */}\n <div\n className=\"pointer-events-none absolute inset-x-0 top-1/2 z-10 -translate-y-1/2 overflow-hidden rounded-md bg-foreground/4\"\n style={{ height: itemHeight, perspective: 1000 }}\n >\n <ul\n ref={bandRef}\n aria-hidden\n className=\"backface-hidden transform-3d absolute inset-x-0 top-1/2 m-0 h-0 list-none p-0 will-change-transform\"\n >\n {options.map((option, i) => (\n <li\n key={optionValue(option)}\n data-index={i}\n className=\"absolute inset-x-0 flex items-center justify-center font-medium text-foreground\"\n style={{\n top: -itemHeight / 2,\n height: it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ACL,KAAK,CAAC,aAAa;KACnB,QAAQ;KACR,WAAW,WAAW,CAAC,YAAY,EAAE,kBAAkB,OAAO;IAChE;IAEC,UAAA,YAAY,MAAM;GACjB,GAVG,YAAY,MAAM,CAUrB,CACL;EACC,CAAA,GAKJ,oBAAC,OAAD;GACE,WAAU;GACV,OAAO;IAAE,QAAQ;IAAY,aAAa;GAAK;GAE/C,UAAA,oBAAC,MAAD;IACE,KAAK;IACL,eAAA;IACA,WAAU;IAET,UAAA,QAAQ,KAAK,QAAQ,MACpB,oBAAC,MAAD;KAEE,cAAY;KACZ,WAAU;KACV,OAAO;MACL,KAAK,CAAC,aAAa;MACnB,QAAQ;MACR,WAAW,WAAW,CAAC,YAAY,EAAE,kBAAkB,OAAO;KAChE;KAEC,UAAA,YAAY,MAAM;IACjB,GAVG,YAAY,MAAM,CAUrB,CACL;GACC,CAAA;EACD,CAAA,CACF;;AAET"}
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from "class-variance-authority";
2
2
  //#region src/components/reui/alert.d.ts
3
3
  declare const alertVariants: (props?: ({
4
- variant?: "default" | "destructive" | "invert" | "info" | "success" | "warning" | null | undefined;
4
+ variant?: "success" | "default" | "destructive" | "info" | "warning" | "invert" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): import("react").JSX.Element;
7
7
  declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { cn } from "@kumix/utils";
3
- import { cva } from "class-variance-authority";
4
3
  import { jsx } from "react/jsx-runtime";
4
+ import { cva } from "class-variance-authority";
5
5
  //#region src/components/reui/alert.tsx
6
6
  const alertVariants = cva([
7
7
  "relative grid w-full grid-cols-[0_1fr] items-center gap-y-0.5 border text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*3)_1fr] [&>svg:not([class*=size-])]:size-4",
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { ScrollArea } from "../ui/scroll-area.js";
3
3
  import { cn } from "@kumix/utils";
4
- import { cva } from "class-variance-authority";
5
4
  import { jsx, jsxs } from "react/jsx-runtime";
6
- import { Autocomplete as Autocomplete$1 } from "@base-ui/react/autocomplete";
7
5
  import { ChevronsUpDownIcon, XIcon } from "lucide-react";
6
+ import { cva } from "class-variance-authority";
7
+ import { Autocomplete as Autocomplete$1 } from "@base-ui/react/autocomplete";
8
8
  //#region src/components/reui/autocomplete.tsx
9
9
  const inputVariants = cva("flex w-full rounded-lg border border-input bg-transparent text-foreground text-sm outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [[readonly]]:cursor-not-allowed [[readonly]]:bg-muted/80", {
10
10
  variants: { size: {
@@ -2,8 +2,8 @@ import { VariantProps } from "class-variance-authority";
2
2
  import { useRender } from "@base-ui/react/use-render";
3
3
  //#region src/components/reui/badge.d.ts
4
4
  declare const badgeVariants: (props?: ({
5
- variant?: "outline" | "secondary" | "default" | "destructive" | "invert" | "info" | "success" | "warning" | "focus" | "primary-light" | "warning-light" | "success-light" | "info-light" | "destructive-light" | "invert-light" | "focus-light" | "primary-outline" | "warning-outline" | "success-outline" | "info-outline" | "destructive-outline" | "invert-outline" | "focus-outline" | null | undefined;
6
- size?: "default" | "sm" | "xs" | "lg" | "xl" | null | undefined;
5
+ variant?: "success" | "default" | "destructive" | "info" | "warning" | "invert" | "outline" | "secondary" | "focus" | "primary-light" | "warning-light" | "success-light" | "info-light" | "destructive-light" | "invert-light" | "focus-light" | "primary-outline" | "warning-outline" | "success-outline" | "info-outline" | "destructive-outline" | "invert-outline" | "focus-outline" | null | undefined;
6
+ size?: "default" | "sm" | "lg" | "xs" | "xl" | null | undefined;
7
7
  radius?: "default" | "full" | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
9
  interface BadgeProps extends useRender.ComponentProps<"span"> {
@@ -55,18 +55,19 @@ const badgeVariants = cva([
55
55
  }
56
56
  });
57
57
  function Badge({ className, variant, size, radius, render, ...props }) {
58
+ const defaultProps = {
59
+ "data-slot": "badge",
60
+ className: cn(badgeVariants({
61
+ variant,
62
+ size,
63
+ radius,
64
+ className
65
+ }))
66
+ };
58
67
  return useRender({
59
68
  defaultTagName: "span",
60
69
  render,
61
- props: mergeProps({
62
- "data-slot": "badge",
63
- className: cn(badgeVariants({
64
- variant,
65
- size,
66
- radius,
67
- className
68
- }))
69
- }, props)
70
+ props: mergeProps(defaultProps, props)
70
71
  });
71
72
  }
72
73
  //#endregion