@kumix/ui 0.2.3 → 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 (369) 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 +1 -1
  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 +1 -1
  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.js +12 -11
  297. package/dist/components/reui/icon-tile.js.map +1 -1
  298. package/dist/components/reui/kanban.js +42 -37
  299. package/dist/components/reui/kanban.js.map +1 -1
  300. package/dist/components/reui/number-field.js +1 -1
  301. package/dist/components/reui/rating.js +1 -1
  302. package/dist/components/reui/sortable.js +10 -9
  303. package/dist/components/reui/sortable.js.map +1 -1
  304. package/dist/components/reui/stepper.js +16 -16
  305. package/dist/components/reui/stepper.js.map +1 -1
  306. package/dist/components/reui/timeline.js +45 -38
  307. package/dist/components/reui/timeline.js.map +1 -1
  308. package/dist/components/reui/tree.js +2 -1
  309. package/dist/components/reui/tree.js.map +1 -1
  310. package/dist/components/ui/alert-dialog.js +1 -1
  311. package/dist/components/ui/alert-dialog.js.map +1 -1
  312. package/dist/components/ui/alert.js +1 -1
  313. package/dist/components/ui/attachment.d.ts +1 -1
  314. package/dist/components/ui/attachment.js +1 -1
  315. package/dist/components/ui/badge.d.ts +1 -1
  316. package/dist/components/ui/bubble.d.ts +1 -1
  317. package/dist/components/ui/bubble.js +1 -1
  318. package/dist/components/ui/button-group.js +1 -1
  319. package/dist/components/ui/button.d.ts +2 -2
  320. package/dist/components/ui/button.js +1 -1
  321. package/dist/components/ui/card.js +1 -1
  322. package/dist/components/ui/card.js.map +1 -1
  323. package/dist/components/ui/dialog.js +1 -1
  324. package/dist/components/ui/dialog.js.map +1 -1
  325. package/dist/components/ui/drawer.js +1 -1
  326. package/dist/components/ui/drawer.js.map +1 -1
  327. package/dist/components/ui/empty.d.ts +1 -1
  328. package/dist/components/ui/empty.js +2 -2
  329. package/dist/components/ui/empty.js.map +1 -1
  330. package/dist/components/ui/field.js +1 -1
  331. package/dist/components/ui/input-group.js +1 -1
  332. package/dist/components/ui/item.d.ts +2 -2
  333. package/dist/components/ui/item.js +1 -1
  334. package/dist/components/ui/marker.js +1 -1
  335. package/dist/components/ui/navigation-menu.js +1 -1
  336. package/dist/components/ui/sheet.js +1 -1
  337. package/dist/components/ui/sheet.js.map +1 -1
  338. package/dist/components/ui/sidebar.d.ts +1 -1
  339. package/dist/components/ui/sidebar.js +2 -2
  340. package/dist/components/ui/sidebar.js.map +1 -1
  341. package/dist/components/ui/tabs.js +1 -1
  342. package/dist/components/ui/toggle.d.ts +1 -1
  343. package/dist/components/ui/toggle.js +1 -1
  344. package/dist/hooks/use-hover-capable.d.ts +10 -0
  345. package/dist/hooks/use-hover-capable.d.ts.map +1 -0
  346. package/dist/hooks/use-hover-capable.js +24 -0
  347. package/dist/hooks/use-hover-capable.js.map +1 -0
  348. package/dist/hooks/use-mobile.js +1 -1
  349. package/dist/hooks/use-mobile.js.map +1 -1
  350. package/dist/hooks/use-slider.d.ts +58 -0
  351. package/dist/hooks/use-slider.d.ts.map +1 -0
  352. package/dist/hooks/use-slider.js +133 -0
  353. package/dist/hooks/use-slider.js.map +1 -0
  354. package/dist/lib/ease.d.ts +50 -0
  355. package/dist/lib/ease.d.ts.map +1 -0
  356. package/dist/lib/ease.js +66 -0
  357. package/dist/lib/ease.js.map +1 -0
  358. package/dist/lib/tick-sound.d.ts +17 -0
  359. package/dist/lib/tick-sound.d.ts.map +1 -0
  360. package/dist/lib/tick-sound.js +120 -0
  361. package/dist/lib/tick-sound.js.map +1 -0
  362. package/dist/popover-position-BUqYCq8X.js +54 -0
  363. package/dist/popover-position-BUqYCq8X.js.map +1 -0
  364. package/dist/theme.css +18 -58
  365. package/dist/types-Bah5NY44.d.ts +81 -0
  366. package/dist/types-Bah5NY44.d.ts.map +1 -0
  367. package/dist/utils-DQ7OpbYQ.js +25 -0
  368. package/dist/utils-DQ7OpbYQ.js.map +1 -0
  369. package/package.json +17 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.js","names":[],"sources":["../../../src/components/motion/loader.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useId, useState } from \"react\";\nimport { motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_IN_OUT } from \"../../lib/ease\";\n\nexport type LoaderVariant =\n | \"spinner\"\n | \"dots\"\n | \"bars\"\n | \"dot-matrix\"\n | \"dither\"\n | \"ascii\"\n | \"ascii-line\"\n | \"ascii-braille\"\n | \"ascii-blocks\"\n | \"ascii-bounce\"\n | \"morph\"\n | \"comet\"\n | \"scramble\"\n | \"metaballs\"\n | \"newton\"\n | \"helix\"\n | \"percent\";\n\n// Terminal-style frame sets — the loaders CLI AI agents cycle through.\nconst ASCII_SETS: Record<string, string[]> = {\n ascii: [\"⠋\", \"⠙\", \"⠹\", \"⠸\", \"⠼\", \"⠴\", \"⠦\", \"⠧\", \"⠇\", \"⠏\"],\n \"ascii-line\": [\"|\", \"/\", \"-\", \"\\\\\"],\n \"ascii-braille\": [\"⣾\", \"⣽\", \"⣻\", \"⢿\", \"⡿\", \"⣟\", \"⣯\", \"⣷\"],\n \"ascii-blocks\": [\"▁\", \"▂\", \"▃\", \"▄\", \"▅\", \"▆\", \"▇\", \"█\", \"▇\", \"▆\", \"▅\", \"▄\", \"▃\", \"▂\"],\n \"ascii-bounce\": [\"⠁\", \"⠂\", \"⠄\", \"⡀\", \"⢀\", \"⠠\", \"⠐\", \"⠈\"],\n};\n\nexport interface LoaderProps {\n /** Which animation to render. */\n variant?: LoaderVariant;\n /** Base square size in px. Everything scales from this. */\n size?: number;\n /** Seconds per animation cycle. */\n speed?: number;\n /** Accessible label announced to screen readers. */\n label?: string;\n className?: string;\n}\n\n// Reduced motion keeps a calm opacity pulse and drops every transform.\nconst REDUCED = {\n animate: { opacity: [1, 0.4, 1] },\n transition: { duration: 1.4, ease: EASE_IN_OUT, repeat: Infinity },\n};\n\nexport function Loader({\n variant = \"spinner\",\n size = 32,\n speed = 1,\n label = \"Loading\",\n className,\n}: LoaderProps) {\n const reduce = useReducedMotion() ?? false;\n\n return (\n <span\n role=\"status\"\n aria-label={label}\n className={cn(\"inline-flex items-center justify-center text-foreground\", className)}\n >\n {variant === \"spinner\" && <Spinner size={size} speed={speed} reduce={reduce} />}\n {variant === \"dots\" && <Dots size={size} speed={speed} reduce={reduce} />}\n {variant === \"bars\" && <Bars size={size} speed={speed} reduce={reduce} />}\n {variant === \"dot-matrix\" && <DotMatrix size={size} speed={speed} reduce={reduce} />}\n {variant === \"dither\" && <Dither size={size} speed={speed} reduce={reduce} />}\n {ASCII_SETS[variant] && (\n <Ascii frames={ASCII_SETS[variant]} size={size} speed={speed} reduce={reduce} />\n )}\n {variant === \"morph\" && <Morph size={size} speed={speed} reduce={reduce} />}\n {variant === \"comet\" && <Comet size={size} speed={speed} reduce={reduce} />}\n {variant === \"scramble\" && <Scramble size={size} speed={speed} reduce={reduce} />}\n {variant === \"metaballs\" && <Metaballs size={size} speed={speed} reduce={reduce} />}\n {variant === \"newton\" && <Newton size={size} speed={speed} reduce={reduce} />}\n {variant === \"helix\" && <Helix size={size} speed={speed} reduce={reduce} />}\n {variant === \"percent\" && <Percent size={size} speed={speed} reduce={reduce} />}\n <span className=\"sr-only\">{label}</span>\n </span>\n );\n}\n\ninterface PartProps {\n size: number;\n speed: number;\n reduce: boolean;\n}\n\nfunction Spinner({ size, speed, reduce }: PartProps) {\n const stroke = Math.max(2, size * 0.09);\n const r = (size - stroke) / 2;\n return (\n <motion.svg\n width={size}\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n animate={reduce ? REDUCED.animate : { rotate: 360 }}\n transition={\n reduce ? REDUCED.transition : { duration: speed, ease: \"linear\", repeat: Infinity }\n }\n >\n <circle\n cx={size / 2}\n cy={size / 2}\n r={r}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeOpacity={0.2}\n strokeWidth={stroke}\n />\n <path\n d={`M ${size / 2} ${size / 2 - r} A ${r} ${r} 0 0 1 ${size / 2 + r} ${size / 2}`}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={stroke}\n strokeLinecap=\"round\"\n />\n </motion.svg>\n );\n}\n\nfunction Dots({ size, speed, reduce }: PartProps) {\n const dot = size * 0.24;\n return (\n <span className=\"flex items-center\" style={{ gap: size * 0.14 }}>\n {[0, 1, 2].map((i) => (\n <motion.span\n key={i}\n className=\"rounded-full bg-current\"\n style={{ width: dot, height: dot }}\n animate={\n reduce ? { opacity: [0.4, 1, 0.4] } : { y: [0, -size * 0.3, 0], opacity: [0.5, 1, 0.5] }\n }\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay: i * speed * 0.16,\n }}\n />\n ))}\n </span>\n );\n}\n\nfunction Ascii({ frames, size, speed, reduce }: PartProps & { frames: string[] }) {\n const [frame, setFrame] = useState(0);\n useEffect(() => {\n // Reduced motion slows the cycle rather than stopping it — it's a glyph\n // swap, not on-screen movement.\n const step = ((reduce ? speed * 2.5 : speed) / frames.length) * 1000;\n const id = setInterval(() => setFrame((f) => (f + 1) % frames.length), step);\n return () => clearInterval(id);\n }, [frames.length, speed, reduce]);\n\n return (\n <span className=\"font-mono tabular-nums leading-none\" style={{ fontSize: size, lineHeight: 1 }}>\n {frames[frame % frames.length]}\n </span>\n );\n}\n\n// Each shape is sampled at the same number of points and emitted as an SVG\n// path with identical command structure, so framer tweens the `d` attribute\n// point-to-point — a real morph, not a snap. (clip-path polygon strings don't\n// interpolate reliably in framer, which left the shapes broken.)\nconst MORPH_POINTS = 24;\n\nfunction ngonRadius(ang: number, n: number, phase = 0) {\n const seg = (2 * Math.PI) / n;\n const a = ang - phase;\n const local = (((a % seg) + seg) % seg) - seg / 2;\n return Math.cos(Math.PI / n) / Math.cos(local);\n}\n\nfunction morphPath(radiusAt: (ang: number) => number) {\n const parts: string[] = [];\n for (let i = 0; i < MORPH_POINTS; i++) {\n const ang = (i / MORPH_POINTS) * 2 * Math.PI - Math.PI / 2;\n const r = Math.min(1.05, radiusAt(ang));\n const x = (50 + Math.cos(ang) * 46 * r).toFixed(2);\n const y = (50 + Math.sin(ang) * 46 * r).toFixed(2);\n parts.push(`${i === 0 ? \"M\" : \"L\"}${x} ${y}`);\n }\n return `${parts.join(\" \")} Z`;\n}\n\nconst MORPH_PATHS = [\n morphPath(() => 1), // circle\n morphPath((a) => ngonRadius(a, 4, Math.PI / 4)), // square\n morphPath((a) => ngonRadius(a, 3)), // triangle\n morphPath((a) => ngonRadius(a, 6)), // hexagon\n morphPath((a) => ngonRadius(a, 4)), // diamond\n];\n\n// Each shape appears twice in a row so it fully forms and HOLDS before the\n// next morph. Even keyframe spacing then alternates hold / morph segments.\nconst MORPH_SEQ = [...MORPH_PATHS.flatMap((p) => [p, p]), MORPH_PATHS[0]];\n// Rotation and scale only change across the morph segments, staying put on the\n// holds, so a settled shape sits still.\nconst MORPH_ROT = [0, 0, 72, 72, 144, 144, 216, 216, 288, 288, 360];\nconst MORPH_SCALE = [1, 1, 0.88, 0.88, 1, 1, 0.88, 0.88, 1, 1, 1];\n\nfunction Morph({ size, speed, reduce }: PartProps) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 100 100\" role=\"img\">\n <title>Loading</title>\n <motion.path\n fill=\"currentColor\"\n d={MORPH_PATHS[0]}\n initial={false}\n style={{ transformBox: \"fill-box\", transformOrigin: \"center\" }}\n animate={\n reduce\n ? { opacity: [1, 0.4, 1] }\n : { d: MORPH_SEQ, rotate: MORPH_ROT, scale: MORPH_SCALE }\n }\n transition={\n reduce\n ? { duration: 1.4, ease: EASE_IN_OUT, repeat: Infinity }\n : { duration: speed * 5, ease: EASE_IN_OUT, repeat: Infinity }\n }\n />\n </svg>\n );\n}\n\nconst COMET_TRAIL = [0, 1, 2, 3, 4, 5];\n\nfunction Comet({ size, speed, reduce }: PartProps) {\n const head = size * 0.2;\n const r = size / 2 - head / 2;\n return (\n <span className=\"relative\" style={{ width: size, height: size }}>\n <motion.span\n className=\"absolute inset-0\"\n animate={reduce ? REDUCED.animate : { rotate: 360 }}\n transition={\n reduce ? REDUCED.transition : { duration: speed, ease: \"linear\", repeat: Infinity }\n }\n >\n {COMET_TRAIL.map((i) => {\n const scale = 1 - i * 0.13;\n const sz = head * scale;\n return (\n <span\n key={i}\n className=\"absolute top-1/2 left-1/2 rounded-full bg-current\"\n style={{\n width: sz,\n height: sz,\n marginLeft: -sz / 2,\n marginTop: -sz / 2,\n opacity: 1 - i * 0.16,\n transform: `rotate(${-i * 15}deg) translateY(${-r}px)`,\n }}\n />\n );\n })}\n </motion.span>\n </span>\n );\n}\n\nconst SCRAMBLE_TARGET = \"LOADING\";\nconst SCRAMBLE_GLYPHS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>/*#@\";\n\nfunction Scramble({ size, speed, reduce }: PartProps) {\n const [text, setText] = useState(SCRAMBLE_TARGET);\n useEffect(() => {\n if (reduce) {\n setText(SCRAMBLE_TARGET);\n return;\n }\n let tick = 0;\n const total = SCRAMBLE_TARGET.length + 4;\n const id = setInterval(\n () => {\n const reveal = tick % total;\n let s = \"\";\n for (let i = 0; i < SCRAMBLE_TARGET.length; i++) {\n s +=\n i < reveal\n ? SCRAMBLE_TARGET[i]\n : SCRAMBLE_GLYPHS[Math.floor(Math.random() * SCRAMBLE_GLYPHS.length)];\n }\n setText(s);\n tick++;\n },\n (speed / SCRAMBLE_TARGET.length) * 1000 * 0.55,\n );\n return () => clearInterval(id);\n }, [speed, reduce]);\n\n return (\n <span\n className=\"font-medium font-mono tabular-nums tracking-[0.2em]\"\n style={{ fontSize: size * 0.42 }}\n >\n {text}\n </span>\n );\n}\n\nfunction Metaballs({ size, speed, reduce }: PartProps) {\n const id = useId().replace(/:/g, \"\");\n return (\n <svg width={size} height={size} viewBox=\"0 0 100 100\" role=\"img\">\n <title>Loading</title>\n <defs>\n <filter id={id}>\n <feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"5\" result=\"b\" />\n <feColorMatrix in=\"b\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -8\" />\n </filter>\n </defs>\n <g filter={`url(#${id})`} fill=\"currentColor\">\n <motion.circle\n cy=\"50\"\n r=\"15\"\n initial={false}\n animate={reduce ? { opacity: [0.4, 1, 0.4] } : { cx: [30, 70, 30] }}\n transition={{ duration: speed * 1.6, ease: EASE_IN_OUT, repeat: Infinity }}\n cx={reduce ? 40 : 30}\n />\n <motion.circle\n cy=\"50\"\n r=\"15\"\n initial={false}\n animate={reduce ? { opacity: [0.4, 1, 0.4] } : { cx: [70, 30, 70] }}\n transition={{ duration: speed * 1.6, ease: EASE_IN_OUT, repeat: Infinity }}\n cx={reduce ? 60 : 70}\n />\n </g>\n </svg>\n );\n}\n\nconst NEWTON_BALLS = [0, 1, 2, 3, 4];\n\nfunction Newton({ size, speed, reduce }: PartProps) {\n const d = size * 0.2;\n const out = d * 1.1;\n // Only the end balls move: the left slides out and back on the first half,\n // then the right on the second half — the impact appears to jump the three\n // still middle balls. Pure horizontal slide, no swing, no strings.\n const moves: Record<number, { x: number[]; times: number[] }> = {\n 0: { x: [0, -out, 0, 0], times: [0, 0.28, 0.5, 1] },\n 4: { x: [0, 0, out, 0], times: [0, 0.5, 0.78, 1] },\n };\n\n return (\n <span className=\"flex items-center justify-center\" style={{ height: d }}>\n {NEWTON_BALLS.map((i) => {\n const move = moves[i];\n return (\n <motion.span\n key={i}\n className=\"rounded-full bg-current\"\n style={{ width: d, height: d }}\n animate={reduce || !move ? undefined : { x: move.x }}\n transition={\n reduce || !move\n ? undefined\n : {\n duration: speed * 1.5,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n times: move.times,\n }\n }\n />\n );\n })}\n </span>\n );\n}\n\nfunction Helix({ size, speed, reduce }: PartProps) {\n const rows = 7;\n const dot = size * 0.14;\n const amp = size * 0.32;\n return (\n <span className=\"relative\" style={{ width: size, height: size }}>\n {Array.from({ length: rows }, (_, r) => {\n const top = (r / (rows - 1)) * (size - dot);\n const delay = (r / rows) * speed;\n return (\n <span key={`row-${top}`}>\n <motion.span\n className=\"absolute rounded-full bg-current\"\n style={{ width: dot, height: dot, left: size / 2 - dot / 2, top }}\n animate={\n reduce\n ? { opacity: [0.4, 1, 0.4] }\n : {\n x: [amp, -amp, amp],\n scale: [1, 0.5, 1],\n opacity: [1, 0.45, 1],\n }\n }\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay,\n }}\n />\n <motion.span\n className=\"absolute rounded-full bg-current\"\n style={{ width: dot, height: dot, left: size / 2 - dot / 2, top }}\n animate={\n reduce\n ? { opacity: [0.4, 1, 0.4] }\n : {\n x: [-amp, amp, -amp],\n scale: [0.5, 1, 0.5],\n opacity: [0.45, 1, 0.45],\n }\n }\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay,\n }}\n />\n </span>\n );\n })}\n </span>\n );\n}\n\nfunction Percent({ size, speed, reduce }: PartProps) {\n const [p, setP] = useState(0);\n useEffect(() => {\n const dur = (reduce ? speed * 2 : speed) * 1000;\n const start = { t: 0 };\n const tickMs = 40;\n const id = setInterval(() => {\n start.t += tickMs;\n const next = Math.min(100, Math.round((start.t / dur) * 100));\n setP(next);\n if (next >= 100) start.t = 0;\n }, tickMs);\n return () => clearInterval(id);\n }, [speed, reduce]);\n\n return (\n <span className=\"flex flex-col items-center\" style={{ gap: size * 0.14, width: size * 1.4 }}>\n <span\n className=\"font-medium font-mono tabular-nums\"\n style={{ fontSize: size * 0.42, lineHeight: 1 }}\n >\n {p}%\n </span>\n <span\n className=\"w-full overflow-hidden rounded-full bg-current/15\"\n style={{ height: Math.max(3, size * 0.1) }}\n >\n <span className=\"block h-full rounded-full bg-current\" style={{ width: `${p}%` }} />\n </span>\n </span>\n );\n}\n\nfunction Bars({ size, speed, reduce }: PartProps) {\n const bar = size * 0.16;\n return (\n <span className=\"flex items-center\" style={{ gap: size * 0.1, height: size }}>\n {[0, 1, 2, 3].map((i) => (\n <motion.span\n key={i}\n className=\"rounded-full bg-current\"\n style={{ width: bar, height: size, originY: 1 }}\n animate={reduce ? { opacity: [0.4, 1, 0.4] } : { scaleY: [0.3, 1, 0.3] }}\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay: i * speed * 0.12,\n }}\n />\n ))}\n </span>\n );\n}\n\nfunction DotMatrix({ size, speed, reduce }: PartProps) {\n const n = 3;\n const gap = size * 0.14;\n const dot = (size - gap * (n - 1)) / n;\n const cells = Array.from({ length: n * n }, (_, idx) => idx);\n return (\n <span\n className=\"grid\"\n style={{\n gap,\n gridTemplateColumns: `repeat(${n}, ${dot}px)`,\n }}\n >\n {cells.map((idx) => {\n const x = idx % n;\n const y = Math.floor(idx / n);\n // Diagonal wave: cells light in order of their distance from the corner.\n const delay = ((x + y) / (2 * (n - 1))) * speed;\n return (\n <motion.span\n key={idx}\n className=\"rounded-full bg-current\"\n style={{ width: dot, height: dot }}\n animate={\n reduce ? { opacity: [0.3, 1, 0.3] } : { opacity: [0.2, 1, 0.2], scale: [0.7, 1, 0.7] }\n }\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay,\n }}\n />\n );\n })}\n </span>\n );\n}\n\n// Ordered Bayer 4x4 matrix — the classic dithering threshold pattern. Cells\n// light in this order, so the fill shimmers like a dissolving halftone.\nconst BAYER_4 = [0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5];\n\nfunction Dither({ size, speed, reduce }: PartProps) {\n const n = 4;\n const gap = Math.max(1, size * 0.05);\n const cell = (size - gap * (n - 1)) / n;\n return (\n <span className=\"grid\" style={{ gap, gridTemplateColumns: `repeat(${n}, ${cell}px)` }}>\n {BAYER_4.map((order, idx) => (\n <motion.span\n key={idx}\n className=\"bg-current\"\n style={{ width: cell, height: cell }}\n animate={reduce ? { opacity: [0.3, 1, 0.3] } : { opacity: [0.1, 1, 0.1] }}\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay: (order / BAYER_4.length) * speed,\n }}\n />\n ))}\n </span>\n );\n}\n"],"mappings":";;;;;;;AA4BA,MAAM,aAAuC;CAC3C,OAAO;EAAC;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;CAAG;CACxD,cAAc;EAAC;EAAK;EAAK;EAAK;CAAI;CAClC,iBAAiB;EAAC;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;CAAG;CACxD,gBAAgB;EAAC;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;CAAG;CACrF,gBAAgB;EAAC;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;CAAG;AACzD;AAeA,MAAM,UAAU;CACd,SAAS,EAAE,SAAS;EAAC;EAAG;EAAK;CAAC,EAAE;CAChC,YAAY;EAAE,UAAU;EAAK,MAAM;EAAa,QAAQ;CAAS;AACnE;AAEA,SAAgB,OAAO,EACrB,UAAU,WACV,OAAO,IACP,QAAQ,GACR,QAAQ,WACR,aACc;CACd,MAAM,SAAS,iBAAiB,KAAK;CAErC,OACE,qBAAC,QAAD;EACE,MA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MAAM,MAAM,KAAK,IAAI,GAAG,OAAO,GAAI;CACnC,MAAM,QAAQ,OAAO,MAAO,KAAU;CACtC,OACE,oBAAC,QAAD;EAAM,WAAU;EAAO,OAAO;GAAE;GAAK,qBAAqB,UAAU,EAAE,IAAI,KAAK;EAAK;EACjF,UAAA,QAAQ,KAAK,OAAO,QACnB,oBAAC,OAAO,MAAR;GAEE,WAAU;GACV,OAAO;IAAE,OAAO;IAAM,QAAQ;GAAK;GACnC,SAAS,SAAS,EAAE,SAAS;IAAC;IAAK;IAAG;GAAG,EAAE,IAAI,EAAE,SAAS;IAAC;IAAK;IAAG;GAAG,EAAE;GACxE,YAAY;IACV,UAAU;IACV,MAAM;IACN,QAAQ;IACR,OAAQ,QAAQ,QAAQ,SAAU;GACpC;EACD,GAVM,GAUN,CACF;CACG,CAAA;AAEV"}
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/components/motion/magnetic.d.ts
3
+ interface MagneticProps {
4
+ children: ReactNode;
5
+ strength?: number;
6
+ className?: string;
7
+ }
8
+ declare function Magnetic({ children, strength, className }: MagneticProps): import("react").JSX.Element;
9
+ //#endregion
10
+ export { Magnetic, MagneticProps };
11
+ //# sourceMappingURL=magnetic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"magnetic.d.ts","names":[],"sources":["../../../src/components/motion/magnetic.tsx"],"mappings":";;UASiB;EACf,UAAU;EACV;EACA;;iBAGc,WAAW,UAAU,UAAiB,aAAa,gCAAa,IAAA"}
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ import { useHoverCapable } from "../../hooks/use-hover-capable.js";
3
+ import { SPRING_MOUSE } from "../../lib/ease.js";
4
+ import { useRef } from "react";
5
+ import { cn } from "@kumix/utils";
6
+ import { motion, useMotionValue, useReducedMotion, useSpring } from "motion/react";
7
+ import { jsx } from "react/jsx-runtime";
8
+ //#region src/components/motion/magnetic.tsx
9
+ function Magnetic({ children, strength = .35, className }) {
10
+ const ref = useRef(null);
11
+ const reduce = useReducedMotion();
12
+ const canHover = useHoverCapable();
13
+ const enabled = !reduce && canHover;
14
+ const x = useMotionValue(0);
15
+ const y = useMotionValue(0);
16
+ const sx = useSpring(x, SPRING_MOUSE);
17
+ const sy = useSpring(y, SPRING_MOUSE);
18
+ const onMove = (e) => {
19
+ const el = ref.current;
20
+ if (!el || !enabled) return;
21
+ const rect = el.getBoundingClientRect();
22
+ x.set((e.clientX - rect.left - rect.width / 2) * strength);
23
+ y.set((e.clientY - rect.top - rect.height / 2) * strength);
24
+ };
25
+ const onLeave = () => {
26
+ x.set(0);
27
+ y.set(0);
28
+ };
29
+ return /* @__PURE__ */ jsx(motion.div, {
30
+ ref,
31
+ onMouseMove: onMove,
32
+ onMouseLeave: onLeave,
33
+ style: {
34
+ x: sx,
35
+ y: sy
36
+ },
37
+ className: cn("inline-block", className),
38
+ children
39
+ });
40
+ }
41
+ //#endregion
42
+ export { Magnetic };
43
+
44
+ //# sourceMappingURL=magnetic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"magnetic.js","names":[],"sources":["../../../src/components/motion/magnetic.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useRef } from \"react\";\nimport { motion, useMotionValue, useReducedMotion, useSpring } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useHoverCapable } from \"../../hooks/use-hover-capable\";\nimport { SPRING_MOUSE } from \"../../lib/ease\";\n\nexport interface MagneticProps {\n children: ReactNode;\n strength?: number;\n className?: string;\n}\n\nexport function Magnetic({ children, strength = 0.35, className }: MagneticProps) {\n const ref = useRef<HTMLDivElement>(null);\n const reduce = useReducedMotion();\n const canHover = useHoverCapable();\n // Decorative cursor-follow: skip on touch (phantom hover) and reduced motion.\n const enabled = !reduce && canHover;\n const x = useMotionValue(0);\n const y = useMotionValue(0);\n const sx = useSpring(x, SPRING_MOUSE);\n const sy = useSpring(y, SPRING_MOUSE);\n\n const onMove = (e: React.MouseEvent<HTMLDivElement>) => {\n const el = ref.current;\n if (!el || !enabled) return;\n const rect = el.getBoundingClientRect();\n x.set((e.clientX - rect.left - rect.width / 2) * strength);\n y.set((e.clientY - rect.top - rect.height / 2) * strength);\n };\n\n const onLeave = () => {\n x.set(0);\n y.set(0);\n };\n\n return (\n <motion.div\n ref={ref}\n onMouseMove={onMove}\n onMouseLeave={onLeave}\n style={{ x: sx, y: sy }}\n className={cn(\"inline-block\", className)}\n >\n {children}\n </motion.div>\n );\n}\n"],"mappings":";;;;;;;;AAeA,SAAgB,SAAS,EAAE,UAAU,WAAW,KAAM,aAA4B;CAChF,MAAM,MAAM,OAAuB,IAAI;CACvC,MAAM,SAAS,iBAAiB;CAChC,MAAM,WAAW,gBAAgB;CAEjC,MAAM,UAAU,CAAC,UAAU;CAC3B,MAAM,IAAI,eAAe,CAAC;CAC1B,MAAM,IAAI,eAAe,CAAC;CAC1B,MAAM,KAAK,UAAU,GAAG,YAAY;CACpC,MAAM,KAAK,UAAU,GAAG,YAAY;CAEpC,MAAM,UAAU,MAAwC;EACtD,MAAM,KAAK,IAAI;EACf,IAAI,CAAC,MAAM,CAAC,SAAS;EACrB,MAAM,OAAO,GAAG,sBAAsB;EACtC,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,KAAK,QAAQ,KAAK,QAAQ;EACzD,EAAE,KAAK,EAAE,UAAU,KAAK,MAAM,KAAK,SAAS,KAAK,QAAQ;CAC3D;CAEA,MAAM,gBAAgB;EACpB,EAAE,IAAI,CAAC;EACP,EAAE,IAAI,CAAC;CACT;CAEA,OACE,oBAAC,OAAO,KAAR;EACO;EACL,aAAa;EACb,cAAc;EACd,OAAO;GAAE,GAAG;GAAI,GAAG;EAAG;EACtB,WAAW,GAAG,gBAAgB,SAAS;EAEtC;CACS,CAAA;AAEhB"}
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/components/motion/marquee.d.ts
3
+ interface MarqueeProps {
4
+ children: ReactNode;
5
+ direction?: "left" | "right" | "up" | "down";
6
+ speed?: number;
7
+ pauseOnHover?: boolean;
8
+ gap?: string;
9
+ className?: string;
10
+ fade?: boolean;
11
+ }
12
+ declare function Marquee({ children, direction, speed, pauseOnHover, gap, className, fade }: MarqueeProps): import("react").JSX.Element;
13
+ //#endregion
14
+ export { Marquee, MarqueeProps };
15
+ //# sourceMappingURL=marquee.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marquee.d.ts","names":[],"sources":["../../../src/components/motion/marquee.tsx"],"mappings":";;UAMiB;EACf,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;;iBAGc,UACd,UACA,WACA,OACA,cACA,KACA,WACA,QACC,+BAAY,IAAA"}
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { Children } from "react";
3
+ import { cn } from "@kumix/utils";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/components/motion/marquee.tsx
6
+ function Marquee({ children, direction = "left", speed = 30, pauseOnHover = true, gap = "1rem", className, fade = true }) {
7
+ const vertical = direction === "up" || direction === "down";
8
+ const reverse = direction === "right" || direction === "down";
9
+ const items = Children.toArray(children);
10
+ return /* @__PURE__ */ jsx("div", {
11
+ className: cn("group relative flex overflow-hidden", vertical ? "flex-col" : "flex-row", fade && !vertical && "mask-[linear-gradient(to_right,transparent,black_12%,black_88%,transparent)]", fade && vertical && "mask-[linear-gradient(to_bottom,transparent,black_12%,black_88%,transparent)]", className),
12
+ style: {
13
+ "--gap": gap,
14
+ gap
15
+ },
16
+ children: [0, 1].map((dup) => /* @__PURE__ */ jsx("div", {
17
+ "aria-hidden": dup === 1,
18
+ inert: dup === 1,
19
+ style: {
20
+ animationDuration: `${speed}s`,
21
+ animationDirection: reverse ? "reverse" : "normal",
22
+ gap
23
+ },
24
+ className: cn("flex shrink-0 items-center", vertical ? "animate-marquee-vertical flex-col" : "animate-marquee flex-row", pauseOnHover && "group-hover:paused"),
25
+ children: items.map((child, i) => /* @__PURE__ */ jsx("div", {
26
+ className: "shrink-0",
27
+ children: child
28
+ }, i))
29
+ }, dup))
30
+ });
31
+ }
32
+ //#endregion
33
+ export { Marquee };
34
+
35
+ //# sourceMappingURL=marquee.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marquee.js","names":[],"sources":["../../../src/components/motion/marquee.tsx"],"sourcesContent":["\"use client\";\n\nimport { Children, type ReactNode } from \"react\";\n\nimport { cn } from \"@kumix/utils\";\n\nexport interface MarqueeProps {\n children: ReactNode;\n direction?: \"left\" | \"right\" | \"up\" | \"down\";\n speed?: number;\n pauseOnHover?: boolean;\n gap?: string;\n className?: string;\n fade?: boolean;\n}\n\nexport function Marquee({\n children,\n direction = \"left\",\n speed = 30,\n pauseOnHover = true,\n gap = \"1rem\",\n className,\n fade = true,\n}: MarqueeProps) {\n const vertical = direction === \"up\" || direction === \"down\";\n const reverse = direction === \"right\" || direction === \"down\";\n const items = Children.toArray(children);\n\n return (\n <div\n className={cn(\n \"group relative flex overflow-hidden\",\n vertical ? \"flex-col\" : \"flex-row\",\n fade &&\n !vertical &&\n \"mask-[linear-gradient(to_right,transparent,black_12%,black_88%,transparent)]\",\n fade &&\n vertical &&\n \"mask-[linear-gradient(to_bottom,transparent,black_12%,black_88%,transparent)]\",\n className,\n )}\n // gap on the wrapper too, so the seam between the two tracks matches the\n // spacing between items and the loop stays even.\n style={{ \"--gap\": gap, gap } as React.CSSProperties}\n >\n {[0, 1].map((dup) => (\n <div\n key={dup}\n aria-hidden={dup === 1}\n inert={dup === 1}\n style={{\n animationDuration: `${speed}s`,\n animationDirection: reverse ? \"reverse\" : \"normal\",\n gap,\n }}\n className={cn(\n \"flex shrink-0 items-center\",\n vertical ? \"animate-marquee-vertical flex-col\" : \"animate-marquee flex-row\",\n pauseOnHover && \"group-hover:paused\",\n )}\n >\n {items.map((child, i) => (\n <div key={i} className=\"shrink-0\">\n {child}\n </div>\n ))}\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;AAgBA,SAAgB,QAAQ,EACtB,UACA,YAAY,QACZ,QAAQ,IACR,eAAe,MACf,MAAM,QACN,WACA,OAAO,QACQ;CACf,MAAM,WAAW,cAAc,QAAQ,cAAc;CACrD,MAAM,UAAU,cAAc,WAAW,cAAc;CACvD,MAAM,QAAQ,SAAS,QAAQ,QAAQ;CAEvC,OACE,oBAAC,OAAD;EACE,WAAW,GACT,uCACA,WAAW,aAAa,YACxB,QACE,CAAC,YACD,gFACF,QACE,YACA,iFACF,SACF;EAGA,OAAO;GAAE,SAAS;GAAK;EAAI;EAE1B,UAAA,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,QACX,oBAAC,OAAD;GAEE,eAAa,QAAQ;GACrB,OAAO,QAAQ;GACf,OAAO;IACL,mBAAmB,GAAG,MAAM;IAC5B,oBAAoB,UAAU,YAAY;IAC1C;GACF;GACA,WAAW,GACT,8BACA,WAAW,sCAAsC,4BACjD,gBAAgB,oBAClB;GAEC,UAAA,MAAM,KAAK,OAAO,MACjB,oBAAC,OAAD;IAAa,WAAU;IACpB,UAAA;GACE,GAFK,CAEL,CACN;EACE,GAnBE,GAmBF,CACN;CACE,CAAA;AAET"}
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/components/motion/morphing-modal.d.ts
3
+ interface MorphingModalProps {
4
+ /** Which view is currently shown. `null` closes the modal. */
5
+ viewId: string | null;
6
+ onClose: () => void;
7
+ children: ReactNode;
8
+ /** "bottom" anchors to the viewport bottom (mobile-like). "center" centers vertically. */
9
+ placement?: "bottom" | "center";
10
+ className?: string;
11
+ }
12
+ declare function MorphingModal({ viewId, onClose, children, placement, className }: MorphingModalProps): import("react").JSX.Element;
13
+ //#endregion
14
+ export { MorphingModal, MorphingModalProps };
15
+ //# sourceMappingURL=morphing-modal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"morphing-modal.d.ts","names":[],"sources":["../../../src/components/motion/morphing-modal.tsx"],"mappings":";;UAQiB;;EAEf;EACA;EACA,UAAU;;EAEV;EACA;;iBAGc,gBACd,QACA,SACA,UACA,WACA,aACC,qCAAkB,IAAA"}
@@ -0,0 +1,117 @@
1
+ "use client";
2
+ import { EASE_OUT, SPRING_PANEL } from "../../lib/ease.js";
3
+ import { useEffect } from "react";
4
+ import { cn } from "@kumix/utils";
5
+ import { AnimatePresence, motion, useReducedMotion } from "motion/react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/motion/morphing-modal.tsx
8
+ function MorphingModal({ viewId, onClose, children, placement = "bottom", className }) {
9
+ const open = viewId !== null;
10
+ const reduce = useReducedMotion();
11
+ const enterY = reduce ? 0 : placement === "bottom" ? 40 : 20;
12
+ const enterScale = reduce ? 1 : .97;
13
+ useEffect(() => {
14
+ if (!open) return;
15
+ const prev = document.body.style.overflow;
16
+ document.body.style.overflow = "hidden";
17
+ return () => {
18
+ document.body.style.overflow = prev;
19
+ };
20
+ }, [open]);
21
+ return /* @__PURE__ */ jsxs("div", {
22
+ "aria-hidden": !open,
23
+ inert: !open,
24
+ className: cn("fixed inset-0 z-80", open ? "pointer-events-auto" : "pointer-events-none"),
25
+ children: [/* @__PURE__ */ jsx(motion.button, {
26
+ type: "button",
27
+ "aria-label": "Close modal",
28
+ initial: false,
29
+ animate: { opacity: open ? 1 : 0 },
30
+ transition: {
31
+ duration: .2,
32
+ ease: EASE_OUT
33
+ },
34
+ onClick: onClose,
35
+ className: cn("absolute inset-0 bg-background/5 [-webkit-backdrop-filter:blur(14px)_saturate(140%)] [backdrop-filter:blur(14px)_saturate(140%)]", open ? "pointer-events-auto" : "pointer-events-none")
36
+ }), /* @__PURE__ */ jsx("div", {
37
+ className: cn("pointer-events-none absolute inset-0 flex justify-center px-4", placement === "bottom" ? "items-end pb-8" : "items-center"),
38
+ children: /* @__PURE__ */ jsx(AnimatePresence, {
39
+ initial: false,
40
+ children: open ? /* @__PURE__ */ jsx(motion.div, {
41
+ layout: true,
42
+ initial: {
43
+ opacity: 0,
44
+ y: enterY,
45
+ scale: enterScale
46
+ },
47
+ animate: {
48
+ opacity: 1,
49
+ y: 0,
50
+ scale: 1
51
+ },
52
+ exit: {
53
+ opacity: 0,
54
+ y: enterY,
55
+ scale: reduce ? 1 : .98,
56
+ transition: {
57
+ duration: .18,
58
+ ease: EASE_OUT
59
+ }
60
+ },
61
+ transition: SPRING_PANEL,
62
+ className: cn("pointer-events-auto relative w-full max-w-sm overflow-hidden rounded-3xl border border-border bg-background shadow-2xl will-change-transform", className),
63
+ children: /* @__PURE__ */ jsx(motion.div, {
64
+ layout: "position",
65
+ className: "p-5",
66
+ children: /* @__PURE__ */ jsx(AnimatePresence, {
67
+ mode: "popLayout",
68
+ initial: false,
69
+ children: /* @__PURE__ */ jsx(motion.div, {
70
+ initial: reduce ? { opacity: 0 } : {
71
+ opacity: 0,
72
+ y: 8,
73
+ filter: "blur(4px)"
74
+ },
75
+ animate: reduce ? {
76
+ opacity: 1,
77
+ transition: {
78
+ duration: .18,
79
+ ease: EASE_OUT
80
+ }
81
+ } : {
82
+ opacity: 1,
83
+ y: 0,
84
+ filter: "blur(0px)",
85
+ transition: {
86
+ duration: .24,
87
+ ease: EASE_OUT
88
+ }
89
+ },
90
+ exit: reduce ? {
91
+ opacity: 0,
92
+ transition: {
93
+ duration: .14,
94
+ ease: EASE_OUT
95
+ }
96
+ } : {
97
+ opacity: 0,
98
+ y: -8,
99
+ filter: "blur(4px)",
100
+ transition: {
101
+ duration: .16,
102
+ ease: EASE_OUT
103
+ }
104
+ },
105
+ children
106
+ }, viewId)
107
+ })
108
+ })
109
+ }, "panel") : null
110
+ })
111
+ })]
112
+ });
113
+ }
114
+ //#endregion
115
+ export { MorphingModal };
116
+
117
+ //# sourceMappingURL=morphing-modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"morphing-modal.js","names":[],"sources":["../../../src/components/motion/morphing-modal.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useEffect } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_PANEL } from \"../../lib/ease\";\n\nexport interface MorphingModalProps {\n /** Which view is currently shown. `null` closes the modal. */\n viewId: string | null;\n onClose: () => void;\n children: ReactNode;\n /** \"bottom\" anchors to the viewport bottom (mobile-like). \"center\" centers vertically. */\n placement?: \"bottom\" | \"center\";\n className?: string;\n}\n\nexport function MorphingModal({\n viewId,\n onClose,\n children,\n placement = \"bottom\",\n className,\n}: MorphingModalProps) {\n const open = viewId !== null;\n const reduce = useReducedMotion();\n const enterY = reduce ? 0 : placement === \"bottom\" ? 40 : 20;\n const enterScale = reduce ? 1 : 0.97;\n\n useEffect(() => {\n if (!open) return;\n const prev = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n return () => {\n document.body.style.overflow = prev;\n };\n }, [open]);\n\n return (\n <div\n aria-hidden={!open}\n inert={!open}\n className={cn(\"fixed inset-0 z-80\", open ? \"pointer-events-auto\" : \"pointer-events-none\")}\n >\n <motion.button\n type=\"button\"\n aria-label=\"Close modal\"\n initial={false}\n animate={{ opacity: open ? 1 : 0 }}\n transition={{ duration: 0.2, ease: EASE_OUT }}\n onClick={onClose}\n className={cn(\n \"absolute inset-0 bg-background/5 [-webkit-backdrop-filter:blur(14px)_saturate(140%)] [backdrop-filter:blur(14px)_saturate(140%)]\",\n open ? \"pointer-events-auto\" : \"pointer-events-none\",\n )}\n />\n\n <div\n className={cn(\n \"pointer-events-none absolute inset-0 flex justify-center px-4\",\n placement === \"bottom\" ? \"items-end pb-8\" : \"items-center\",\n )}\n >\n <AnimatePresence initial={false}>\n {open ? (\n <motion.div\n key=\"panel\"\n layout\n initial={{ opacity: 0, y: enterY, scale: enterScale }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{\n opacity: 0,\n y: enterY,\n scale: reduce ? 1 : 0.98,\n transition: { duration: 0.18, ease: EASE_OUT },\n }}\n transition={SPRING_PANEL}\n className={cn(\n \"pointer-events-auto relative w-full max-w-sm overflow-hidden rounded-3xl border border-border bg-background shadow-2xl will-change-transform\",\n className,\n )}\n >\n <motion.div layout=\"position\" className=\"p-5\">\n <AnimatePresence mode=\"popLayout\" initial={false}>\n <motion.div\n key={viewId}\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: 8, filter: \"blur(4px)\" }}\n animate={\n reduce\n ? {\n opacity: 1,\n transition: {\n duration: 0.18,\n ease: EASE_OUT,\n },\n }\n : {\n opacity: 1,\n y: 0,\n filter: \"blur(0px)\",\n transition: {\n duration: 0.24,\n ease: EASE_OUT,\n },\n }\n }\n exit={\n reduce\n ? {\n opacity: 0,\n transition: {\n duration: 0.14,\n ease: EASE_OUT,\n },\n }\n : {\n opacity: 0,\n y: -8,\n filter: \"blur(4px)\",\n transition: {\n duration: 0.16,\n ease: EASE_OUT,\n },\n }\n }\n >\n {children}\n </motion.div>\n </AnimatePresence>\n </motion.div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAkBA,SAAgB,cAAc,EAC5B,QACA,SACA,UACA,YAAY,UACZ,aACqB;CACrB,MAAM,OAAO,WAAW;CACxB,MAAM,SAAS,iBAAiB;CAChC,MAAM,SAAS,SAAS,IAAI,cAAc,WAAW,KAAK;CAC1D,MAAM,aAAa,SAAS,IAAI;CAEhC,gBAAgB;EACd,IAAI,CAAC,MAAM;EACX,MAAM,OAAO,SAAS,KAAK,MAAM;EACjC,SAAS,KAAK,MAAM,WAAW;EAC/B,aAAa;GACX,SAAS,KAAK,MAAM,WAAW;EACjC;CACF,GAAG,CAAC,IAAI,CAAC;CAET,OACE,qBAAC,OAAD;EACE,eAAa,CAAC;EACd,OAAO,CAAC;EACR,WAAW,GAAG,sBAAsB,OAAO,wBAAwB,qBAAqB;EAH1F,UAAA,CAKE,oBAAC,OAAO,QAAR;GACE,MAAK;GACL,cAAW;GACX,SAAS;GACT,SAAS,EAAE,SAAS,OAAO,IAAI,EAAE;GACjC,YAAY;IAAE,UAAU;IAAK,MAAM;GAAS;GAC5C,SAAS;GACT,WAAW,GACT,oIACA,OAAO,wBAAwB,qBACjC;EACD,CAAA,GAED,oBAAC,OAAD;GACE,WAAW,GACT,iEACA,cAAc,WAAW,mBAAmB,cAC9C;GAEA,UAAA,oBAAC,iBAAD;IAAiB,SAAS;IACvB,UAAA,OACC,oBAAC,OAAO,KAAR;KAEE,QAAA;KACA,SAAS;MAAE,SAAS;MAAG,GAAG;MAAQ,OAAO;KAAW;KACpD,SAAS;MAAE,SAAS;MAAG,GAAG;MAAG,OAAO;KAAE;KACtC,MAAM;MACJ,SAAS;MACT,GAAG;MACH,OAAO,SAAS,IAAI;MACpB,YAAY;OAAE,UAAU;OAAM,MAAM;MAAS;KAC/C;KACA,YAAY;KACZ,WAAW,GACT,gJACA,SACF;KAEA,UAAA,oBAAC,OAAO,KAAR;MAAY,QAAO;MAAW,WAAU;MACtC,UAAA,oBAAC,iBAAD;OAAiB,MAAK;OAAY,SAAS;OACzC,UAAA,oBAAC,OAAO,KAAR;QAEE,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI;SAAE,SAAS;SAAG,GAAG;SAAG,QAAQ;QAAY;QAC3E,SACE,SACI;SACE,SAAS;SACT,YAAY;UACV,UAAU;UACV,MAAM;SACR;QACF,IACA;SACE,SAAS;SACT,GAAG;SACH,QAAQ;SACR,YAAY;UACV,UAAU;UACV,MAAM;SACR;QACF;QAEN,MACE,SACI;SACE,SAAS;SACT,YAAY;UACV,UAAU;UACV,MAAM;SACR;QACF,IACA;SACE,SAAS;SACT,GAAG;SACH,QAAQ;SACR,YAAY;UACV,UAAU;UACV,MAAM;SACR;QACF;QAGL;OACS,GA1CL,MA0CK;MACG,CAAA;KACP,CAAA;IACF,GAhEN,OAgEM,IACV;GACW,CAAA;EACd,CAAA,CACF;;AAET"}
@@ -0,0 +1,26 @@
1
+ //#region src/components/motion/number-ticker.d.ts
2
+ interface NumberTickerProps {
3
+ value: number;
4
+ /** Digits to pad to (left). */
5
+ pad?: number;
6
+ /** Per-digit roll duration in seconds. */
7
+ duration?: number;
8
+ /** Stagger between digits. */
9
+ stagger?: number;
10
+ /** Render only after the element enters the viewport. */
11
+ startOnView?: boolean;
12
+ prefix?: string;
13
+ suffix?: string;
14
+ /** Add a small blur during digit rolls. */
15
+ blur?: boolean;
16
+ className?: string;
17
+ digitClassName?: string;
18
+ /** Insert locale group separators (commas). Server-component safe. */
19
+ locale?: boolean;
20
+ /** Custom formatter. Client-only — server components must use `locale` instead. */
21
+ format?: (value: number) => string;
22
+ }
23
+ declare function NumberTicker({ value, pad, duration, stagger, startOnView, prefix, suffix, blur, className, digitClassName, locale, format }: NumberTickerProps): import("react").JSX.Element;
24
+ //#endregion
25
+ export { NumberTicker, NumberTickerProps };
26
+ //# sourceMappingURL=number-ticker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-ticker.d.ts","names":[],"sources":["../../../src/components/motion/number-ticker.tsx"],"mappings":";UAQiB;EACf;;EAEA;;EAEA;;EAEA;;EAEA;EACA;EACA;;EAEA;EACA;EACA;;EAEA;;EAEA,UAAU;;iBAMI,eACd,OACA,KACA,UACA,SACA,aACA,QACA,QACA,MACA,WACA,gBACA,QACA,UACC,oCAAiB,IAAA"}
@@ -0,0 +1,129 @@
1
+ "use client";
2
+ import { EASE_OUT } from "../../lib/ease.js";
3
+ import { useEffect, useMemo, useRef, useState } from "react";
4
+ import { cn } from "@kumix/utils";
5
+ import { animate, motion, useInView, useReducedMotion } from "motion/react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/motion/number-ticker.tsx
8
+ const DIGIT_HEIGHT_EM = 1.1;
9
+ const DIGITS = Array.from({ length: 10 }, (_, n) => n);
10
+ function NumberTicker({ value, pad, duration = .9, stagger = .04, startOnView = true, prefix, suffix, blur = false, className, digitClassName, locale, format }) {
11
+ const containerRef = useRef(null);
12
+ const inView = useInView(containerRef, {
13
+ once: true,
14
+ amount: .6
15
+ });
16
+ const [armed, setArmed] = useState(!startOnView);
17
+ useEffect(() => {
18
+ if (startOnView && inView) setArmed(true);
19
+ }, [startOnView, inView]);
20
+ const text = useMemo(() => {
21
+ const rounded = Math.round(value);
22
+ const formatted = format ? format(rounded) : locale ? rounded.toLocaleString() : rounded.toString();
23
+ return pad ? formatted.padStart(pad, "0") : formatted;
24
+ }, [
25
+ value,
26
+ pad,
27
+ format,
28
+ locale
29
+ ]);
30
+ const glyphs = useMemo(() => {
31
+ const chars = text.split("");
32
+ return chars.map((char, i) => ({
33
+ char,
34
+ id: `g-${chars.length - 1 - i}`
35
+ }));
36
+ }, [text]);
37
+ const readableText = `${prefix ?? ""}${text}${suffix ?? ""}`;
38
+ const [entered, setEntered] = useState(false);
39
+ useEffect(() => {
40
+ if (!armed || entered) return;
41
+ const total = (duration + glyphs.length * stagger) * 1e3;
42
+ const t = window.setTimeout(() => setEntered(true), total);
43
+ return () => window.clearTimeout(t);
44
+ }, [
45
+ armed,
46
+ entered,
47
+ duration,
48
+ stagger,
49
+ glyphs.length
50
+ ]);
51
+ return /* @__PURE__ */ jsxs("span", {
52
+ ref: containerRef,
53
+ className: cn("inline-flex items-center tabular-nums", className),
54
+ children: [/* @__PURE__ */ jsx("span", {
55
+ className: "sr-only",
56
+ children: readableText
57
+ }), /* @__PURE__ */ jsxs("span", {
58
+ "aria-hidden": "true",
59
+ className: "inline-flex items-center",
60
+ children: [
61
+ prefix ? /* @__PURE__ */ jsx("span", { children: prefix }) : null,
62
+ glyphs.map(({ char, id }, i) => {
63
+ if (!/\d/.test(char)) return /* @__PURE__ */ jsx("span", {
64
+ className: "inline-block",
65
+ children: char
66
+ }, id);
67
+ const digit = Number(char);
68
+ return /* @__PURE__ */ jsx(Digit, {
69
+ digit: armed ? digit : 0,
70
+ delay: entered ? 0 : i * stagger,
71
+ duration,
72
+ blur,
73
+ className: digitClassName
74
+ }, id);
75
+ }),
76
+ suffix ? /* @__PURE__ */ jsx("span", { children: suffix }) : null
77
+ ]
78
+ })]
79
+ });
80
+ }
81
+ function Digit({ digit, delay, duration, blur, className }) {
82
+ const reduce = useReducedMotion();
83
+ const columnRef = useRef(null);
84
+ useEffect(() => {
85
+ if (reduce || !blur || !columnRef.current || !Number.isFinite(digit)) return;
86
+ const node = columnRef.current;
87
+ const controls = animate(node, { filter: ["blur(10px)", "blur(0px)"] }, {
88
+ duration: Math.min(duration * .75, .32),
89
+ delay,
90
+ ease: EASE_OUT
91
+ });
92
+ return () => {
93
+ controls.stop();
94
+ node.style.filter = "blur(0px)";
95
+ };
96
+ }, [
97
+ blur,
98
+ delay,
99
+ digit,
100
+ duration,
101
+ reduce
102
+ ]);
103
+ return /* @__PURE__ */ jsx("span", {
104
+ className: cn("relative inline-block overflow-hidden", className),
105
+ style: {
106
+ height: `${DIGIT_HEIGHT_EM}em`,
107
+ width: "1ch"
108
+ },
109
+ children: /* @__PURE__ */ jsx(motion.span, {
110
+ ref: columnRef,
111
+ initial: { y: 0 },
112
+ animate: { y: `-${digit * DIGIT_HEIGHT_EM}em` },
113
+ transition: reduce ? { duration: 0 } : {
114
+ duration,
115
+ delay,
116
+ ease: EASE_OUT
117
+ },
118
+ className: "absolute inset-x-0 top-0 flex flex-col items-center will-change-[transform,filter]",
119
+ children: DIGITS.map((n) => /* @__PURE__ */ jsx("span", {
120
+ className: "flex h-[1.1em] items-center justify-center leading-none",
121
+ children: n
122
+ }, n))
123
+ })
124
+ });
125
+ }
126
+ //#endregion
127
+ export { NumberTicker };
128
+
129
+ //# sourceMappingURL=number-ticker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-ticker.js","names":[],"sources":["../../../src/components/motion/number-ticker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport { animate, motion, useInView, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT } from \"../../lib/ease\";\n\nexport interface NumberTickerProps {\n value: number;\n /** Digits to pad to (left). */\n pad?: number;\n /** Per-digit roll duration in seconds. */\n duration?: number;\n /** Stagger between digits. */\n stagger?: number;\n /** Render only after the element enters the viewport. */\n startOnView?: boolean;\n prefix?: string;\n suffix?: string;\n /** Add a small blur during digit rolls. */\n blur?: boolean;\n className?: string;\n digitClassName?: string;\n /** Insert locale group separators (commas). Server-component safe. */\n locale?: boolean;\n /** Custom formatter. Client-only — server components must use `locale` instead. */\n format?: (value: number) => string;\n}\n\nconst DIGIT_HEIGHT_EM = 1.1;\nconst DIGITS = Array.from({ length: 10 }, (_, n) => n);\n\nexport function NumberTicker({\n value,\n pad,\n duration = 0.9,\n stagger = 0.04,\n startOnView = true,\n prefix,\n suffix,\n blur = false,\n className,\n digitClassName,\n locale,\n format,\n}: NumberTickerProps) {\n const containerRef = useRef<HTMLSpanElement>(null);\n const inView = useInView(containerRef, { once: true, amount: 0.6 });\n const [armed, setArmed] = useState(!startOnView);\n\n useEffect(() => {\n if (startOnView && inView) setArmed(true);\n }, [startOnView, inView]);\n\n const text = useMemo(() => {\n const rounded = Math.round(value);\n const formatted = format\n ? format(rounded)\n : locale\n ? rounded.toLocaleString()\n : rounded.toString();\n return pad ? formatted.padStart(pad, \"0\") : formatted;\n }, [value, pad, format, locale]);\n const glyphs = useMemo(() => {\n const chars = text.split(\"\");\n // Key by place value (position from the right): a changing digit keeps its\n // identity and rolls to the new value instead of remounting and replaying\n // from 0. Growing numbers add glyphs on the left without re-keying the\n // ones, tens, hundreds already on screen.\n return chars.map((char, i) => ({ char, id: `g-${chars.length - 1 - i}` }));\n }, [text]);\n const readableText = `${prefix ?? \"\"}${text}${suffix ?? \"\"}`;\n\n // Stagger is an entrance flourish. Once the reveal has played, value\n // changes roll every digit immediately — a per-digit delay on live updates\n // reads as lag.\n const [entered, setEntered] = useState(false);\n useEffect(() => {\n if (!armed || entered) return;\n const total = (duration + glyphs.length * stagger) * 1000;\n const t = window.setTimeout(() => setEntered(true), total);\n return () => window.clearTimeout(t);\n }, [armed, entered, duration, stagger, glyphs.length]);\n\n return (\n <span ref={containerRef} className={cn(\"inline-flex items-center tabular-nums\", className)}>\n <span className=\"sr-only\">{readableText}</span>\n <span aria-hidden=\"true\" className=\"inline-flex items-center\">\n {prefix ? <span>{prefix}</span> : null}\n {glyphs.map(({ char, id }, i) => {\n const isDigit = /\\d/.test(char);\n if (!isDigit) {\n return (\n <span key={id} className=\"inline-block\">\n {char}\n </span>\n );\n }\n const digit = Number(char);\n return (\n <Digit\n key={id}\n digit={armed ? digit : 0}\n delay={entered ? 0 : i * stagger}\n duration={duration}\n blur={blur}\n className={digitClassName}\n />\n );\n })}\n {suffix ? <span>{suffix}</span> : null}\n </span>\n </span>\n );\n}\n\nfunction Digit({\n digit,\n delay,\n duration,\n blur,\n className,\n}: {\n digit: number;\n delay: number;\n duration: number;\n blur: boolean;\n className?: string;\n}) {\n const reduce = useReducedMotion();\n const columnRef = useRef<HTMLSpanElement>(null);\n\n useEffect(() => {\n if (reduce || !blur || !columnRef.current || !Number.isFinite(digit)) {\n return;\n }\n\n const node = columnRef.current;\n const controls = animate(\n node,\n { filter: [\"blur(10px)\", \"blur(0px)\"] },\n {\n duration: Math.min(duration * 0.75, 0.32),\n delay,\n ease: EASE_OUT,\n },\n );\n\n return () => {\n controls.stop();\n node.style.filter = \"blur(0px)\";\n };\n }, [blur, delay, digit, duration, reduce]);\n\n return (\n <span\n className={cn(\"relative inline-block overflow-hidden\", className)}\n style={{ height: `${DIGIT_HEIGHT_EM}em`, width: \"1ch\" }}\n >\n <motion.span\n ref={columnRef}\n initial={{ y: 0 }}\n animate={{ y: `-${digit * DIGIT_HEIGHT_EM}em` }}\n transition={reduce ? { duration: 0 } : { duration, delay, ease: EASE_OUT }}\n className=\"absolute inset-x-0 top-0 flex flex-col items-center will-change-[transform,filter]\"\n >\n {DIGITS.map((n) => (\n <span key={n} className=\"flex h-[1.1em] items-center justify-center leading-none\">\n {n}\n </span>\n ))}\n </motion.span>\n </span>\n );\n}\n"],"mappings":";;;;;;;AA8BA,MAAM,kBAAkB;AACxB,MAAM,SAAS,MAAM,KAA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QAAQ,gBAAgB,IAAI;GAC9C,YAAY,SAAS,EAAE,UAAU,EAAE,IAAI;IAAE;IAAU;IAAO,MAAM;GAAS;GACzE,WAAU;GAET,UAAA,OAAO,KAAK,MACX,oBAAC,QAAD;IAAc,WAAU;IACrB,UAAA;GACG,GAFK,CAEL,CACP;EACU,CAAA;CACT,CAAA;AAEV"}
@@ -0,0 +1,21 @@
1
+ import { ReactNode, RefObject } from "react";
2
+ //#region src/components/motion/parallax.d.ts
3
+ interface ParallaxProps {
4
+ children: ReactNode;
5
+ /**
6
+ * Drift as a fraction of the element's travel through the viewport.
7
+ * Positive moves with the scroll (foreground), negative against it
8
+ * (background). ~0.1–0.5 reads best.
9
+ */
10
+ speed?: number;
11
+ axis?: "x" | "y";
12
+ /** Scroll container for contained scroll areas. Defaults to the viewport. */
13
+ container?: RefObject<HTMLElement | null>;
14
+ /** Spring-smooth the drift. Disabled automatically under reduced motion. */
15
+ spring?: boolean;
16
+ className?: string;
17
+ }
18
+ declare function Parallax({ children, speed, axis, container, spring, className }: ParallaxProps): import("react").JSX.Element;
19
+ //#endregion
20
+ export { Parallax, ParallaxProps };
21
+ //# sourceMappingURL=parallax.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallax.d.ts","names":[],"sources":["../../../src/components/motion/parallax.tsx"],"mappings":";;UAkBiB;EACf,UAAU;;;;;;EAMV;EACA;;EAEA,YAAY,UAAU;;EAEtB;EACA;;iBAGc,WACd,UACA,OACA,MACA,WACA,QACA,aACC,gCAAa,IAAA"}
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { useRef } from "react";
3
+ import { cn } from "@kumix/utils";
4
+ import { motion, useReducedMotion, useScroll, useSpring, useTransform } from "motion/react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/components/motion/parallax.tsx
7
+ const PARALLAX_SPRING = {
8
+ stiffness: 120,
9
+ damping: 30,
10
+ mass: .6
11
+ };
12
+ function Parallax({ children, speed = .3, axis = "y", container, spring = true, className }) {
13
+ const reduce = useReducedMotion();
14
+ const ref = useRef(null);
15
+ const { scrollYProgress } = useScroll({
16
+ target: ref,
17
+ container,
18
+ offset: ["start end", "end start"]
19
+ });
20
+ const travel = speed * 100;
21
+ const drift = useTransform(scrollYProgress, [0, 1], [travel, -travel]);
22
+ const smoothed = useSpring(drift, PARALLAX_SPRING);
23
+ const value = spring && !reduce ? smoothed : drift;
24
+ const style = reduce ? {} : axis === "x" ? { x: value } : { y: value };
25
+ return /* @__PURE__ */ jsx(motion.div, {
26
+ ref,
27
+ style,
28
+ className: cn(className),
29
+ children
30
+ });
31
+ }
32
+ //#endregion
33
+ export { Parallax };
34
+
35
+ //# sourceMappingURL=parallax.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallax.js","names":[],"sources":["../../../src/components/motion/parallax.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, type RefObject, useRef } from \"react\";\nimport {\n type MotionStyle,\n motion,\n useReducedMotion,\n useScroll,\n useSpring,\n useTransform,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\n\n// Soft follow so the drift trails the scroll smoothly; looser than the UI\n// springs in lib/ease.ts on purpose.\nconst PARALLAX_SPRING = { stiffness: 120, damping: 30, mass: 0.6 };\n\nexport interface ParallaxProps {\n children: ReactNode;\n /**\n * Drift as a fraction of the element's travel through the viewport.\n * Positive moves with the scroll (foreground), negative against it\n * (background). ~0.1–0.5 reads best.\n */\n speed?: number;\n axis?: \"x\" | \"y\";\n /** Scroll container for contained scroll areas. Defaults to the viewport. */\n container?: RefObject<HTMLElement | null>;\n /** Spring-smooth the drift. Disabled automatically under reduced motion. */\n spring?: boolean;\n className?: string;\n}\n\nexport function Parallax({\n children,\n speed = 0.3,\n axis = \"y\",\n container,\n spring = true,\n className,\n}: ParallaxProps) {\n const reduce = useReducedMotion();\n const ref = useRef<HTMLDivElement>(null);\n const { scrollYProgress } = useScroll({\n target: ref,\n container,\n offset: [\"start end\", \"end start\"],\n // Run after paint so a container ref defined higher in the tree is hydrated;\n // otherwise framer falls back to the document and only the page scroll works.\n // layoutEffect: false,\n });\n\n // progress 0→1 as the element crosses the viewport; map to a symmetric drift.\n const travel = speed * 100;\n const drift = useTransform(scrollYProgress, [0, 1], [travel, -travel]);\n const smoothed = useSpring(drift, PARALLAX_SPRING);\n const value = spring && !reduce ? smoothed : drift;\n\n const style: MotionStyle = reduce ? {} : axis === \"x\" ? { x: value } : { y: value };\n\n return (\n <motion.div ref={ref} style={style} className={cn(className)}>\n {children}\n </motion.div>\n );\n}\n"],"mappings":";;;;;;AAgBA,MAAM,kBAAkB;CAAE,WAAW;CAAK,SAAS;CAAI,MAAM;AAAI;AAkBjE,SAAgB,SAAS,EACvB,UACA,QAAQ,IACR,OAAO,KACP,WACA,SAAS,MACT,aACgB;CAChB,MAAM,SAAS,iBAAiB;CAChC,MAAM,MAAM,OAAuB,IAAI;CACvC,MAAM,EAAE,oBAAoB,UAAU;EACpC,QAAQ;EACR;EACA,QAAQ,CAAC,aAAa,WAAW;CAInC,CAAC;CAGD,MAAM,SAAS,QAAQ;CACvB,MAAM,QAAQ,aAAa,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC;CACrE,MAAM,WAAW,UAAU,OAAO,eAAe;CACjD,MAAM,QAAQ,UAAU,CAAC,SAAS,WAAW;CAE7C,MAAM,QAAqB,SAAS,CAAC,IAAI,SAAS,MAAM,EAAE,GAAG,MAAM,IAAI,EAAE,GAAG,MAAM;CAElF,OACE,oBAAC,OAAO,KAAR;EAAiB;EAAY;EAAO,WAAW,GAAG,SAAS;EACxD;CACS,CAAA;AAEhB"}