@kumix/ui 0.2.4 → 0.3.1

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 (483) hide show
  1. package/README.md +45 -10
  2. package/dist/components/custom/confirm-dialog.d.ts +16 -0
  3. package/dist/components/custom/confirm-dialog.d.ts.map +1 -0
  4. package/dist/components/custom/confirm-dialog.js +93 -0
  5. package/dist/components/custom/confirm-dialog.js.map +1 -0
  6. package/dist/components/custom/toast.d.ts +20 -0
  7. package/dist/components/custom/toast.d.ts.map +1 -0
  8. package/dist/components/custom/toast.js +73 -0
  9. package/dist/components/custom/toast.js.map +1 -0
  10. package/dist/components/motion/action-swap-blur.d.ts +11 -0
  11. package/dist/components/motion/action-swap-blur.d.ts.map +1 -0
  12. package/dist/components/motion/action-swap-blur.js +26 -0
  13. package/dist/components/motion/action-swap-blur.js.map +1 -0
  14. package/dist/components/motion/action-swap-cascade.d.ts +11 -0
  15. package/dist/components/motion/action-swap-cascade.d.ts.map +1 -0
  16. package/dist/components/motion/action-swap-cascade.js +26 -0
  17. package/dist/components/motion/action-swap-cascade.js.map +1 -0
  18. package/dist/components/motion/action-swap-roll.d.ts +11 -0
  19. package/dist/components/motion/action-swap-roll.d.ts.map +1 -0
  20. package/dist/components/motion/action-swap-roll.js +26 -0
  21. package/dist/components/motion/action-swap-roll.js.map +1 -0
  22. package/dist/components/motion/action-swap.d.ts +41 -0
  23. package/dist/components/motion/action-swap.d.ts.map +1 -0
  24. package/dist/components/motion/action-swap.js +261 -0
  25. package/dist/components/motion/action-swap.js.map +1 -0
  26. package/dist/components/motion/animated-badge.d.ts +18 -0
  27. package/dist/components/motion/animated-badge.d.ts.map +1 -0
  28. package/dist/components/motion/animated-badge.js +206 -0
  29. package/dist/components/motion/animated-badge.js.map +1 -0
  30. package/dist/components/motion/animated-number.d.ts +12 -0
  31. package/dist/components/motion/animated-number.d.ts.map +1 -0
  32. package/dist/components/motion/animated-number.js +47 -0
  33. package/dist/components/motion/animated-number.js.map +1 -0
  34. package/dist/components/motion/animated-sidebar.d.ts +97 -0
  35. package/dist/components/motion/animated-sidebar.d.ts.map +1 -0
  36. package/dist/components/motion/animated-sidebar.js +611 -0
  37. package/dist/components/motion/animated-sidebar.js.map +1 -0
  38. package/dist/components/motion/animated-toast-stack.d.ts +65 -0
  39. package/dist/components/motion/animated-toast-stack.d.ts.map +1 -0
  40. package/dist/components/motion/animated-toast-stack.js +303 -0
  41. package/dist/components/motion/animated-toast-stack.js.map +1 -0
  42. package/dist/components/motion/attachment-upload.d.ts +47 -0
  43. package/dist/components/motion/attachment-upload.d.ts.map +1 -0
  44. package/dist/components/motion/attachment-upload.js +737 -0
  45. package/dist/components/motion/attachment-upload.js.map +1 -0
  46. package/dist/components/motion/availability-scheduler/copy-menu.d.ts +10 -0
  47. package/dist/components/motion/availability-scheduler/copy-menu.d.ts.map +1 -0
  48. package/dist/components/motion/availability-scheduler/copy-menu.js +3 -0
  49. package/dist/components/motion/availability-scheduler/day-row.d.ts +15 -0
  50. package/dist/components/motion/availability-scheduler/day-row.d.ts.map +1 -0
  51. package/dist/components/motion/availability-scheduler/day-row.js +181 -0
  52. package/dist/components/motion/availability-scheduler/day-row.js.map +1 -0
  53. package/dist/components/motion/availability-scheduler/icon-button.d.ts +15 -0
  54. package/dist/components/motion/availability-scheduler/icon-button.d.ts.map +1 -0
  55. package/dist/components/motion/availability-scheduler/icon-button.js +24 -0
  56. package/dist/components/motion/availability-scheduler/icon-button.js.map +1 -0
  57. package/dist/components/motion/availability-scheduler/index.d.ts +14 -0
  58. package/dist/components/motion/availability-scheduler/index.d.ts.map +1 -0
  59. package/dist/components/motion/availability-scheduler/index.js +59 -0
  60. package/dist/components/motion/availability-scheduler/index.js.map +1 -0
  61. package/dist/components/motion/availability-scheduler/time-select.d.ts +10 -0
  62. package/dist/components/motion/availability-scheduler/time-select.d.ts.map +1 -0
  63. package/dist/components/motion/availability-scheduler/time-select.js +26 -0
  64. package/dist/components/motion/availability-scheduler/time-select.js.map +1 -0
  65. package/dist/components/motion/bloom-menu.d.ts +17 -0
  66. package/dist/components/motion/bloom-menu.d.ts.map +1 -0
  67. package/dist/components/motion/bloom-menu.js +170 -0
  68. package/dist/components/motion/bloom-menu.js.map +1 -0
  69. package/dist/components/motion/bottom-sheet.d.ts +19 -0
  70. package/dist/components/motion/bottom-sheet.d.ts.map +1 -0
  71. package/dist/components/motion/bottom-sheet.js +146 -0
  72. package/dist/components/motion/bottom-sheet.js.map +1 -0
  73. package/dist/components/motion/bounce-sidebar.d.ts +26 -0
  74. package/dist/components/motion/bounce-sidebar.d.ts.map +1 -0
  75. package/dist/components/motion/bounce-sidebar.js +164 -0
  76. package/dist/components/motion/bounce-sidebar.js.map +1 -0
  77. package/dist/components/motion/bouncy-accordion.d.ts +32 -0
  78. package/dist/components/motion/bouncy-accordion.d.ts.map +1 -0
  79. package/dist/components/motion/bouncy-accordion.js +172 -0
  80. package/dist/components/motion/bouncy-accordion.js.map +1 -0
  81. package/dist/components/motion/button/base.d.ts +17 -0
  82. package/dist/components/motion/button/base.d.ts.map +1 -0
  83. package/dist/components/motion/button/base.js +86 -0
  84. package/dist/components/motion/button/base.js.map +1 -0
  85. package/dist/components/motion/button/index.d.ts +4 -0
  86. package/dist/components/motion/button/index.js +5 -0
  87. package/dist/components/motion/button/magnetic.d.ts +12 -0
  88. package/dist/components/motion/button/magnetic.d.ts.map +1 -0
  89. package/dist/components/motion/button/magnetic.js +21 -0
  90. package/dist/components/motion/button/magnetic.js.map +1 -0
  91. package/dist/components/motion/button/stateful.d.ts +16 -0
  92. package/dist/components/motion/button/stateful.d.ts.map +1 -0
  93. package/dist/components/motion/button/stateful.js +190 -0
  94. package/dist/components/motion/button/stateful.js.map +1 -0
  95. package/dist/components/motion/center-morph-modal.d.ts +43 -0
  96. package/dist/components/motion/center-morph-modal.d.ts.map +1 -0
  97. package/dist/components/motion/center-morph-modal.js +238 -0
  98. package/dist/components/motion/center-morph-modal.js.map +1 -0
  99. package/dist/components/motion/checkbox.d.ts +15 -0
  100. package/dist/components/motion/checkbox.d.ts.map +1 -0
  101. package/dist/components/motion/checkbox.js +81 -0
  102. package/dist/components/motion/checkbox.js.map +1 -0
  103. package/dist/components/motion/chromatic-text-reveal.d.ts +31 -0
  104. package/dist/components/motion/chromatic-text-reveal.d.ts.map +1 -0
  105. package/dist/components/motion/chromatic-text-reveal.js +132 -0
  106. package/dist/components/motion/chromatic-text-reveal.js.map +1 -0
  107. package/dist/components/motion/command-palette.d.ts +26 -0
  108. package/dist/components/motion/command-palette.d.ts.map +1 -0
  109. package/dist/components/motion/command-palette.js +246 -0
  110. package/dist/components/motion/command-palette.js.map +1 -0
  111. package/dist/components/motion/context-menu.d.ts +71 -0
  112. package/dist/components/motion/context-menu.d.ts.map +1 -0
  113. package/dist/components/motion/context-menu.js +454 -0
  114. package/dist/components/motion/context-menu.js.map +1 -0
  115. package/dist/components/motion/cylinder-carousel.d.ts +40 -0
  116. package/dist/components/motion/cylinder-carousel.d.ts.map +1 -0
  117. package/dist/components/motion/cylinder-carousel.js +274 -0
  118. package/dist/components/motion/cylinder-carousel.js.map +1 -0
  119. package/dist/components/motion/dock.d.ts +24 -0
  120. package/dist/components/motion/dock.d.ts.map +1 -0
  121. package/dist/components/motion/dock.js +62 -0
  122. package/dist/components/motion/dock.js.map +1 -0
  123. package/dist/components/motion/drawer.d.ts +19 -0
  124. package/dist/components/motion/drawer.d.ts.map +1 -0
  125. package/dist/components/motion/drawer.js +58 -0
  126. package/dist/components/motion/drawer.js.map +1 -0
  127. package/dist/components/motion/dynamic-island.d.ts +22 -0
  128. package/dist/components/motion/dynamic-island.d.ts.map +1 -0
  129. package/dist/components/motion/dynamic-island.js +143 -0
  130. package/dist/components/motion/dynamic-island.js.map +1 -0
  131. package/dist/components/motion/expandable-action-bar.d.ts +52 -0
  132. package/dist/components/motion/expandable-action-bar.d.ts.map +1 -0
  133. package/dist/components/motion/expandable-action-bar.js +191 -0
  134. package/dist/components/motion/expandable-action-bar.js.map +1 -0
  135. package/dist/components/motion/expandable-tabs.d.ts +33 -0
  136. package/dist/components/motion/expandable-tabs.d.ts.map +1 -0
  137. package/dist/components/motion/expandable-tabs.js +291 -0
  138. package/dist/components/motion/expandable-tabs.js.map +1 -0
  139. package/dist/components/motion/feedback-widget.d.ts +18 -0
  140. package/dist/components/motion/feedback-widget.d.ts.map +1 -0
  141. package/dist/components/motion/feedback-widget.js +413 -0
  142. package/dist/components/motion/feedback-widget.js.map +1 -0
  143. package/dist/components/motion/file-upload.d.ts +48 -0
  144. package/dist/components/motion/file-upload.d.ts.map +1 -0
  145. package/dist/components/motion/file-upload.js +382 -0
  146. package/dist/components/motion/file-upload.js.map +1 -0
  147. package/dist/components/motion/hold-action-button.d.ts +17 -0
  148. package/dist/components/motion/hold-action-button.d.ts.map +1 -0
  149. package/dist/components/motion/hold-action-button.js +158 -0
  150. package/dist/components/motion/hold-action-button.js.map +1 -0
  151. package/dist/components/motion/infinite-masonry.d.ts +31 -0
  152. package/dist/components/motion/infinite-masonry.d.ts.map +1 -0
  153. package/dist/components/motion/infinite-masonry.js +223 -0
  154. package/dist/components/motion/infinite-masonry.js.map +1 -0
  155. package/dist/components/motion/input.d.ts +29 -0
  156. package/dist/components/motion/input.d.ts.map +1 -0
  157. package/dist/components/motion/input.js +126 -0
  158. package/dist/components/motion/input.js.map +1 -0
  159. package/dist/components/motion/loader.d.ts +17 -0
  160. package/dist/components/motion/loader.d.ts.map +1 -0
  161. package/dist/components/motion/loader.js +791 -0
  162. package/dist/components/motion/loader.js.map +1 -0
  163. package/dist/components/motion/magnetic.d.ts +11 -0
  164. package/dist/components/motion/magnetic.d.ts.map +1 -0
  165. package/dist/components/motion/magnetic.js +44 -0
  166. package/dist/components/motion/magnetic.js.map +1 -0
  167. package/dist/components/motion/marquee.d.ts +15 -0
  168. package/dist/components/motion/marquee.d.ts.map +1 -0
  169. package/dist/components/motion/marquee.js +35 -0
  170. package/dist/components/motion/marquee.js.map +1 -0
  171. package/dist/components/motion/morphing-modal.d.ts +15 -0
  172. package/dist/components/motion/morphing-modal.d.ts.map +1 -0
  173. package/dist/components/motion/morphing-modal.js +117 -0
  174. package/dist/components/motion/morphing-modal.js.map +1 -0
  175. package/dist/components/motion/not-found/glitch.d.ts +6 -0
  176. package/dist/components/motion/not-found/glitch.d.ts.map +1 -0
  177. package/dist/components/motion/not-found/glitch.js +90 -0
  178. package/dist/components/motion/not-found/glitch.js.map +1 -0
  179. package/dist/components/motion/not-found/magnetic.d.ts +6 -0
  180. package/dist/components/motion/not-found/magnetic.d.ts.map +1 -0
  181. package/dist/components/motion/not-found/magnetic.js +47 -0
  182. package/dist/components/motion/not-found/magnetic.js.map +1 -0
  183. package/dist/components/motion/not-found/shared.d.ts +32 -0
  184. package/dist/components/motion/not-found/shared.d.ts.map +1 -0
  185. package/dist/components/motion/not-found/shared.js +52 -0
  186. package/dist/components/motion/not-found/shared.js.map +1 -0
  187. package/dist/components/motion/not-found/spotlight.d.ts +6 -0
  188. package/dist/components/motion/not-found/spotlight.d.ts.map +1 -0
  189. package/dist/components/motion/not-found/spotlight.js +70 -0
  190. package/dist/components/motion/not-found/spotlight.js.map +1 -0
  191. package/dist/components/motion/not-found/stacked.d.ts +6 -0
  192. package/dist/components/motion/not-found/stacked.d.ts.map +1 -0
  193. package/dist/components/motion/not-found/stacked.js +95 -0
  194. package/dist/components/motion/not-found/stacked.js.map +1 -0
  195. package/dist/components/motion/not-found/terminal.d.ts +6 -0
  196. package/dist/components/motion/not-found/terminal.d.ts.map +1 -0
  197. package/dist/components/motion/not-found/terminal.js +90 -0
  198. package/dist/components/motion/not-found/terminal.js.map +1 -0
  199. package/dist/components/motion/notification-stack.d.ts +35 -0
  200. package/dist/components/motion/notification-stack.d.ts.map +1 -0
  201. package/dist/components/motion/notification-stack.js +187 -0
  202. package/dist/components/motion/notification-stack.js.map +1 -0
  203. package/dist/components/motion/number-ticker.d.ts +26 -0
  204. package/dist/components/motion/number-ticker.d.ts.map +1 -0
  205. package/dist/components/motion/number-ticker.js +129 -0
  206. package/dist/components/motion/number-ticker.js.map +1 -0
  207. package/dist/components/motion/otp-input.d.ts +32 -0
  208. package/dist/components/motion/otp-input.d.ts.map +1 -0
  209. package/dist/components/motion/otp-input.js +272 -0
  210. package/dist/components/motion/otp-input.js.map +1 -0
  211. package/dist/components/motion/overflow-actions.d.ts +39 -0
  212. package/dist/components/motion/overflow-actions.d.ts.map +1 -0
  213. package/dist/components/motion/overflow-actions.js +220 -0
  214. package/dist/components/motion/overflow-actions.js.map +1 -0
  215. package/dist/components/motion/parallax.d.ts +21 -0
  216. package/dist/components/motion/parallax.d.ts.map +1 -0
  217. package/dist/components/motion/parallax.js +35 -0
  218. package/dist/components/motion/parallax.js.map +1 -0
  219. package/dist/components/motion/popover-morph.d.ts +38 -0
  220. package/dist/components/motion/popover-morph.d.ts.map +1 -0
  221. package/dist/components/motion/popover-morph.js +167 -0
  222. package/dist/components/motion/popover-morph.js.map +1 -0
  223. package/dist/components/motion/popover.d.ts +40 -0
  224. package/dist/components/motion/popover.d.ts.map +1 -0
  225. package/dist/components/motion/popover.js +393 -0
  226. package/dist/components/motion/popover.js.map +1 -0
  227. package/dist/components/motion/preview-rail.d.ts +26 -0
  228. package/dist/components/motion/preview-rail.d.ts.map +1 -0
  229. package/dist/components/motion/preview-rail.js +134 -0
  230. package/dist/components/motion/preview-rail.js.map +1 -0
  231. package/dist/components/motion/pull-to-refresh.d.ts +28 -0
  232. package/dist/components/motion/pull-to-refresh.d.ts.map +1 -0
  233. package/dist/components/motion/pull-to-refresh.js +389 -0
  234. package/dist/components/motion/pull-to-refresh.js.map +1 -0
  235. package/dist/components/motion/radio.d.ts +22 -0
  236. package/dist/components/motion/radio.d.ts.map +1 -0
  237. package/dist/components/motion/radio.js +79 -0
  238. package/dist/components/motion/radio.js.map +1 -0
  239. package/dist/components/motion/range-slider-bubble.d.ts +16 -0
  240. package/dist/components/motion/range-slider-bubble.d.ts.map +1 -0
  241. package/dist/components/motion/range-slider-bubble.js +117 -0
  242. package/dist/components/motion/range-slider-bubble.js.map +1 -0
  243. package/dist/components/motion/range-slider-fluid.d.ts +18 -0
  244. package/dist/components/motion/range-slider-fluid.d.ts.map +1 -0
  245. package/dist/components/motion/range-slider-fluid.js +63 -0
  246. package/dist/components/motion/range-slider-fluid.js.map +1 -0
  247. package/dist/components/motion/range-slider-ruler.d.ts +19 -0
  248. package/dist/components/motion/range-slider-ruler.d.ts.map +1 -0
  249. package/dist/components/motion/range-slider-ruler.js +142 -0
  250. package/dist/components/motion/range-slider-ruler.js.map +1 -0
  251. package/dist/components/motion/range-slider-wave.d.ts +16 -0
  252. package/dist/components/motion/range-slider-wave.d.ts.map +1 -0
  253. package/dist/components/motion/range-slider-wave.js +57 -0
  254. package/dist/components/motion/range-slider-wave.js.map +1 -0
  255. package/dist/components/motion/range-slider.d.ts +11 -0
  256. package/dist/components/motion/range-slider.d.ts.map +1 -0
  257. package/dist/components/motion/range-slider.js +63 -0
  258. package/dist/components/motion/range-slider.js.map +1 -0
  259. package/dist/components/motion/scroll-progress.d.ts +29 -0
  260. package/dist/components/motion/scroll-progress.d.ts.map +1 -0
  261. package/dist/components/motion/scroll-progress.js +71 -0
  262. package/dist/components/motion/scroll-progress.js.map +1 -0
  263. package/dist/components/motion/scroll-reveal.d.ts +23 -0
  264. package/dist/components/motion/scroll-reveal.d.ts.map +1 -0
  265. package/dist/components/motion/scroll-reveal.js +42 -0
  266. package/dist/components/motion/scroll-reveal.js.map +1 -0
  267. package/dist/components/motion/scroll-to.d.ts +21 -0
  268. package/dist/components/motion/scroll-to.d.ts.map +1 -0
  269. package/dist/components/motion/scroll-to.js +27 -0
  270. package/dist/components/motion/scroll-to.js.map +1 -0
  271. package/dist/components/motion/select-morph.d.ts +41 -0
  272. package/dist/components/motion/select-morph.d.ts.map +1 -0
  273. package/dist/components/motion/select-morph.js +251 -0
  274. package/dist/components/motion/select-morph.js.map +1 -0
  275. package/dist/components/motion/select.d.ts +36 -0
  276. package/dist/components/motion/select.d.ts.map +1 -0
  277. package/dist/components/motion/select.js +319 -0
  278. package/dist/components/motion/select.js.map +1 -0
  279. package/dist/components/motion/shader-background.d.ts +38 -0
  280. package/dist/components/motion/shader-background.d.ts.map +1 -0
  281. package/dist/components/motion/shader-background.js +49 -0
  282. package/dist/components/motion/shader-background.js.map +1 -0
  283. package/dist/components/motion/shared-layout-bg.d.ts +17 -0
  284. package/dist/components/motion/shared-layout-bg.d.ts.map +1 -0
  285. package/dist/components/motion/shared-layout-bg.js +88 -0
  286. package/dist/components/motion/shared-layout-bg.js.map +1 -0
  287. package/dist/components/motion/slide-action-button.d.ts +15 -0
  288. package/dist/components/motion/slide-action-button.d.ts.map +1 -0
  289. package/dist/components/motion/slide-action-button.js +146 -0
  290. package/dist/components/motion/slide-action-button.js.map +1 -0
  291. package/dist/components/motion/smooth-scroll.d.ts +47 -0
  292. package/dist/components/motion/smooth-scroll.d.ts.map +1 -0
  293. package/dist/components/motion/smooth-scroll.js +182 -0
  294. package/dist/components/motion/smooth-scroll.js.map +1 -0
  295. package/dist/components/motion/swipeable-list.d.ts +60 -0
  296. package/dist/components/motion/swipeable-list.d.ts.map +1 -0
  297. package/dist/components/motion/swipeable-list.js +254 -0
  298. package/dist/components/motion/swipeable-list.js.map +1 -0
  299. package/dist/components/motion/switch.d.ts +13 -0
  300. package/dist/components/motion/switch.d.ts.map +1 -0
  301. package/dist/components/motion/switch.js +76 -0
  302. package/dist/components/motion/switch.js.map +1 -0
  303. package/dist/components/motion/table/editable-cell.d.ts +9 -0
  304. package/dist/components/motion/table/editable-cell.d.ts.map +1 -0
  305. package/dist/components/motion/table/editable-cell.js +17 -0
  306. package/dist/components/motion/table/editable-cell.js.map +1 -0
  307. package/dist/components/motion/table/index.d.ts +6 -0
  308. package/dist/components/motion/table/index.d.ts.map +1 -0
  309. package/dist/components/motion/table/index.js +420 -0
  310. package/dist/components/motion/table/index.js.map +1 -0
  311. package/dist/components/motion/table/row-handle.d.ts +15 -0
  312. package/dist/components/motion/table/row-handle.d.ts.map +1 -0
  313. package/dist/components/motion/table/row-handle.js +51 -0
  314. package/dist/components/motion/table/row-handle.js.map +1 -0
  315. package/dist/components/motion/table/skeleton-rows.d.ts +11 -0
  316. package/dist/components/motion/table/skeleton-rows.d.ts.map +1 -0
  317. package/dist/components/motion/table/skeleton-rows.js +23 -0
  318. package/dist/components/motion/table/skeleton-rows.js.map +1 -0
  319. package/dist/components/motion/table/table-header.d.ts +35 -0
  320. package/dist/components/motion/table/table-header.d.ts.map +1 -0
  321. package/dist/components/motion/table/table-header.js +167 -0
  322. package/dist/components/motion/table/table-header.js.map +1 -0
  323. package/dist/components/motion/table/table-menu.d.ts +17 -0
  324. package/dist/components/motion/table/table-menu.d.ts.map +1 -0
  325. package/dist/components/motion/table/table-menu.js +92 -0
  326. package/dist/components/motion/table/table-menu.js.map +1 -0
  327. package/dist/components/motion/tabs.d.ts +29 -0
  328. package/dist/components/motion/tabs.d.ts.map +1 -0
  329. package/dist/components/motion/tabs.js +125 -0
  330. package/dist/components/motion/tabs.js.map +1 -0
  331. package/dist/components/motion/text-cascade.d.ts +15 -0
  332. package/dist/components/motion/text-cascade.d.ts.map +1 -0
  333. package/dist/components/motion/text-cascade.js +21 -0
  334. package/dist/components/motion/text-cascade.js.map +1 -0
  335. package/dist/components/motion/text-reveal.d.ts +25 -0
  336. package/dist/components/motion/text-reveal.d.ts.map +1 -0
  337. package/dist/components/motion/text-reveal.js +94 -0
  338. package/dist/components/motion/text-reveal.js.map +1 -0
  339. package/dist/components/motion/text-shimmer.d.ts +12 -0
  340. package/dist/components/motion/text-shimmer.d.ts.map +1 -0
  341. package/dist/components/motion/text-shimmer.js +15 -0
  342. package/dist/components/motion/text-shimmer.js.map +1 -0
  343. package/dist/components/motion/theme-toggle.d.ts +23 -0
  344. package/dist/components/motion/theme-toggle.d.ts.map +1 -0
  345. package/dist/components/motion/theme-toggle.js +160 -0
  346. package/dist/components/motion/theme-toggle.js.map +1 -0
  347. package/dist/components/motion/tilt-card.d.ts +12 -0
  348. package/dist/components/motion/tilt-card.d.ts.map +1 -0
  349. package/dist/components/motion/tilt-card.js +56 -0
  350. package/dist/components/motion/tilt-card.js.map +1 -0
  351. package/dist/components/motion/tooltip.d.ts +17 -0
  352. package/dist/components/motion/tooltip.d.ts.map +1 -0
  353. package/dist/components/motion/tooltip.js +194 -0
  354. package/dist/components/motion/tooltip.js.map +1 -0
  355. package/dist/components/motion/wheel-picker.d.ts +24 -0
  356. package/dist/components/motion/wheel-picker.d.ts.map +1 -0
  357. package/dist/components/motion/wheel-picker.js +442 -0
  358. package/dist/components/motion/wheel-picker.js.map +1 -0
  359. package/dist/components/reui/alert.d.ts +1 -1
  360. package/dist/components/reui/autocomplete.js +1 -1
  361. package/dist/components/reui/badge.d.ts +2 -2
  362. package/dist/components/reui/badge.js +10 -9
  363. package/dist/components/reui/badge.js.map +1 -1
  364. package/dist/components/reui/data-grid/data-grid-column-filter.js +2 -2
  365. package/dist/components/reui/data-grid/data-grid-column-header.js +1 -1
  366. package/dist/components/reui/data-grid/data-grid-pagination.js +1 -1
  367. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +1 -1
  368. package/dist/components/reui/data-grid/data-grid-table-dnd.js +22 -20
  369. package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
  370. package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts +1 -1
  371. package/dist/components/reui/data-grid/data-grid-table-virtual.js +1 -1
  372. package/dist/components/reui/data-grid/data-grid-table.js +5 -3
  373. package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
  374. package/dist/components/reui/date-selector.js +2 -2
  375. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +3 -2
  376. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
  377. package/dist/components/reui/event-calendar/event-calendar-content.js +8 -7
  378. package/dist/components/reui/event-calendar/event-calendar-content.js.map +1 -1
  379. package/dist/components/reui/event-calendar/event-calendar-dnd.js +7 -4
  380. package/dist/components/reui/event-calendar/event-calendar-dnd.js.map +1 -1
  381. package/dist/components/reui/event-calendar/event-calendar-event.js +50 -48
  382. package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
  383. package/dist/components/reui/event-calendar/event-calendar-lib.js +3 -2
  384. package/dist/components/reui/event-calendar/event-calendar-lib.js.map +1 -1
  385. package/dist/components/reui/event-calendar/event-calendar-month-view.js +1 -1
  386. package/dist/components/reui/event-calendar/event-calendar-nav.js +38 -32
  387. package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
  388. package/dist/components/reui/event-calendar/event-calendar-time-grid.js +2 -1
  389. package/dist/components/reui/event-calendar/event-calendar-time-grid.js.map +1 -1
  390. package/dist/components/reui/event-calendar/event-calendar.js +2 -1
  391. package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
  392. package/dist/components/reui/filters.js +6 -4
  393. package/dist/components/reui/filters.js.map +1 -1
  394. package/dist/components/reui/frame.d.ts +1 -1
  395. package/dist/components/reui/gantt/gantt-bar.js +53 -52
  396. package/dist/components/reui/gantt/gantt-bar.js.map +1 -1
  397. package/dist/components/reui/gantt/gantt-lib.js +3 -2
  398. package/dist/components/reui/gantt/gantt-lib.js.map +1 -1
  399. package/dist/components/reui/gantt/gantt-nav.js +35 -31
  400. package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
  401. package/dist/components/reui/gantt/gantt-recurrence.js +2 -2
  402. package/dist/components/reui/gantt/gantt-recurrence.js.map +1 -1
  403. package/dist/components/reui/gantt/gantt-view.js +177 -173
  404. package/dist/components/reui/gantt/gantt-view.js.map +1 -1
  405. package/dist/components/reui/icon-tile.d.ts +1 -1
  406. package/dist/components/reui/icon-tile.js +12 -11
  407. package/dist/components/reui/icon-tile.js.map +1 -1
  408. package/dist/components/reui/kanban.js +42 -37
  409. package/dist/components/reui/kanban.js.map +1 -1
  410. package/dist/components/reui/number-field.js +1 -1
  411. package/dist/components/reui/phone-input.js +2 -2
  412. package/dist/components/reui/rating.js +1 -1
  413. package/dist/components/reui/sortable.js +10 -9
  414. package/dist/components/reui/sortable.js.map +1 -1
  415. package/dist/components/reui/stepper.js +16 -16
  416. package/dist/components/reui/stepper.js.map +1 -1
  417. package/dist/components/reui/timeline.js +45 -38
  418. package/dist/components/reui/timeline.js.map +1 -1
  419. package/dist/components/reui/tree.js +3 -2
  420. package/dist/components/reui/tree.js.map +1 -1
  421. package/dist/components/ui/accordion.js +1 -1
  422. package/dist/components/ui/alert-dialog.js +1 -1
  423. package/dist/components/ui/attachment.d.ts +2 -2
  424. package/dist/components/ui/badge.d.ts +1 -1
  425. package/dist/components/ui/breadcrumb.js +1 -1
  426. package/dist/components/ui/bubble.d.ts +1 -1
  427. package/dist/components/ui/button-group.d.ts +1 -1
  428. package/dist/components/ui/button.d.ts +3 -3
  429. package/dist/components/ui/button.js +1 -1
  430. package/dist/components/ui/calendar.js +1 -1
  431. package/dist/components/ui/carousel.js +1 -1
  432. package/dist/components/ui/checkbox.js +1 -1
  433. package/dist/components/ui/combobox.js +1 -1
  434. package/dist/components/ui/command.js +1 -1
  435. package/dist/components/ui/context-menu.js +1 -1
  436. package/dist/components/ui/dialog.js +1 -1
  437. package/dist/components/ui/dropdown-menu.js +1 -1
  438. package/dist/components/ui/empty.d.ts +1 -1
  439. package/dist/components/ui/field.d.ts +1 -1
  440. package/dist/components/ui/input-otp.js +1 -1
  441. package/dist/components/ui/item.d.ts +1 -1
  442. package/dist/components/ui/marker.d.ts +1 -1
  443. package/dist/components/ui/menubar.js +1 -1
  444. package/dist/components/ui/message-scroller.js +1 -1
  445. package/dist/components/ui/native-select.js +1 -1
  446. package/dist/components/ui/navigation-menu.js +1 -1
  447. package/dist/components/ui/pagination.js +1 -1
  448. package/dist/components/ui/select.js +1 -1
  449. package/dist/components/ui/sheet.js +1 -1
  450. package/dist/components/ui/sidebar.js +2 -2
  451. package/dist/components/ui/sidebar.js.map +1 -1
  452. package/dist/components/ui/sonner.js +1 -1
  453. package/dist/components/ui/spinner.js +1 -1
  454. package/dist/components/ui/toast.js +1 -1
  455. package/dist/copy-menu-BJ-MXnkN.js +201 -0
  456. package/dist/copy-menu-BJ-MXnkN.js.map +1 -0
  457. package/dist/hooks/use-hover-capable.d.ts +10 -0
  458. package/dist/hooks/use-hover-capable.d.ts.map +1 -0
  459. package/dist/hooks/use-hover-capable.js +24 -0
  460. package/dist/hooks/use-hover-capable.js.map +1 -0
  461. package/dist/hooks/use-mobile.js +1 -1
  462. package/dist/hooks/use-mobile.js.map +1 -1
  463. package/dist/hooks/use-slider.d.ts +58 -0
  464. package/dist/hooks/use-slider.d.ts.map +1 -0
  465. package/dist/hooks/use-slider.js +133 -0
  466. package/dist/hooks/use-slider.js.map +1 -0
  467. package/dist/lib/ease.d.ts +50 -0
  468. package/dist/lib/ease.d.ts.map +1 -0
  469. package/dist/lib/ease.js +66 -0
  470. package/dist/lib/ease.js.map +1 -0
  471. package/dist/lib/tick-sound.d.ts +17 -0
  472. package/dist/lib/tick-sound.d.ts.map +1 -0
  473. package/dist/lib/tick-sound.js +120 -0
  474. package/dist/lib/tick-sound.js.map +1 -0
  475. package/dist/popover-position-BUqYCq8X.js +54 -0
  476. package/dist/popover-position-BUqYCq8X.js.map +1 -0
  477. package/dist/types-Bah5NY44.d.ts +81 -0
  478. package/dist/types-Bah5NY44.d.ts.map +1 -0
  479. package/dist/types-smkWN_7x.d.ts +20 -0
  480. package/dist/types-smkWN_7x.d.ts.map +1 -0
  481. package/dist/utils-DQ7OpbYQ.js +25 -0
  482. package/dist/utils-DQ7OpbYQ.js.map +1 -0
  483. package/package.json +17 -6
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/components/motion/pull-to-refresh.d.ts
3
+ type PullToRefreshStatus = "idle" | "pulling" | "ready" | "refreshing";
4
+ interface PullToRefreshProps {
5
+ /** Runs after the user pulls beyond the threshold and releases. */
6
+ onRefresh: () => void | Promise<void>;
7
+ children: ReactNode;
8
+ /** Keeps the indicator active while an externally managed refresh runs. */
9
+ refreshing?: boolean;
10
+ disabled?: boolean;
11
+ /** Resisted pull distance in pixels required to refresh. */
12
+ threshold?: number;
13
+ /** Maximum resisted pull distance in pixels. */
14
+ maxPull?: number;
15
+ /** Content offset in pixels while refreshing. */
16
+ holdDistance?: number;
17
+ pullingLabel?: ReactNode;
18
+ releaseLabel?: ReactNode;
19
+ refreshingLabel?: ReactNode;
20
+ ariaLabel?: string;
21
+ className?: string;
22
+ contentClassName?: string;
23
+ indicatorClassName?: string;
24
+ }
25
+ declare function PullToRefresh({ onRefresh, children, refreshing, disabled, threshold, maxPull, holdDistance, pullingLabel, releaseLabel, refreshingLabel, ariaLabel, className, contentClassName, indicatorClassName }: PullToRefreshProps): import("react").JSX.Element;
26
+ //#endregion
27
+ export { PullToRefresh, PullToRefreshProps, PullToRefreshStatus };
28
+ //# sourceMappingURL=pull-to-refresh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pull-to-refresh.d.ts","names":[],"sources":["../../../src/components/motion/pull-to-refresh.tsx"],"mappings":";;KAuBY;UAEK;;EAEf,wBAAwB;EACxB,UAAU;;EAEV;EACA;;EAEA;;EAEA;;EAEA;EACA,eAAe;EACf,eAAe;EACf,kBAAkB;EAClB;EACA;EACA;EACA;;iBAsJc,gBACd,WACA,UACA,YACA,UACA,WACA,SACA,cACA,cACA,cACA,iBACA,WACA,WACA,kBACA,sBACC,qCAAkB,IAAA"}
@@ -0,0 +1,389 @@
1
+ "use client";
2
+ import { EASE_IN_OUT, EASE_OUT, SPRING_PANEL, SPRING_SWAP } from "../../lib/ease.js";
3
+ import { useCallback, useEffect, useRef, useState } from "react";
4
+ import { cn } from "@kumix/utils";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { AnimatePresence, animate, motion, useMotionValue, useReducedMotion, useTransform } from "motion/react";
7
+ //#region src/components/motion/pull-to-refresh.tsx
8
+ const EMPTY_GESTURE = {
9
+ active: false,
10
+ startX: 0,
11
+ startY: 0,
12
+ pointerId: null
13
+ };
14
+ const CHARACTER_LOOP = {
15
+ duration: .9,
16
+ ease: EASE_IN_OUT,
17
+ repeat: Number.POSITIVE_INFINITY
18
+ };
19
+ const CALM_PULSE = {
20
+ duration: 1.2,
21
+ ease: EASE_IN_OUT,
22
+ repeat: Number.POSITIVE_INFINITY
23
+ };
24
+ const LABEL_SWAP = {
25
+ duration: .16,
26
+ ease: EASE_OUT
27
+ };
28
+ function resistedDistance(distance, maxPull) {
29
+ return maxPull * (1 - Math.exp(-Math.max(0, distance) / maxPull));
30
+ }
31
+ function RefreshBuddy({ progress, status, reduce }) {
32
+ const lift = useTransform(progress, [0, 1], [-7, 0]);
33
+ const tilt = useTransform(progress, [0, 1], [-10, 0]);
34
+ const stretch = useTransform(progress, [
35
+ 0,
36
+ .55,
37
+ 1
38
+ ], [
39
+ .68,
40
+ 1.1,
41
+ .92
42
+ ]);
43
+ const ready = status === "ready";
44
+ const refreshing = status === "refreshing";
45
+ return /* @__PURE__ */ jsx(motion.span, {
46
+ style: reduce ? void 0 : {
47
+ y: lift,
48
+ rotate: tilt,
49
+ scaleY: stretch
50
+ },
51
+ className: "block h-9 w-9 origin-bottom",
52
+ children: /* @__PURE__ */ jsxs(motion.svg, {
53
+ "aria-hidden": "true",
54
+ viewBox: "0 0 36 36",
55
+ style: { opacity: 1 },
56
+ className: "h-full w-full overflow-visible",
57
+ animate: refreshing ? reduce ? { opacity: [
58
+ .55,
59
+ 1,
60
+ .55
61
+ ] } : {
62
+ y: [
63
+ 0,
64
+ -2,
65
+ 0
66
+ ],
67
+ rotate: [
68
+ -3,
69
+ 3,
70
+ -3
71
+ ]
72
+ } : reduce ? { opacity: 1 } : {
73
+ y: 0,
74
+ rotate: 0,
75
+ scale: ready ? 1.08 : 1
76
+ },
77
+ transition: refreshing ? reduce ? CALM_PULSE : CHARACTER_LOOP : SPRING_SWAP,
78
+ children: [
79
+ /* @__PURE__ */ jsxs(motion.g, {
80
+ style: { transformOrigin: "18px 18px" },
81
+ animate: refreshing && !reduce ? { rotate: [0, 360] } : reduce ? void 0 : { rotate: ready ? 0 : -35 },
82
+ transition: refreshing ? reduce ? CALM_PULSE : CHARACTER_LOOP : SPRING_SWAP,
83
+ className: cn("transition-opacity duration-150", ready || refreshing ? "opacity-100" : "opacity-0"),
84
+ children: [/* @__PURE__ */ jsx("path", {
85
+ d: "M18 2.5a15.5 15.5 0 0 1 12.7 6.6",
86
+ fill: "none",
87
+ stroke: "currentColor",
88
+ strokeWidth: "1.5",
89
+ strokeLinecap: "round",
90
+ className: "text-muted-foreground"
91
+ }), /* @__PURE__ */ jsx("circle", {
92
+ cx: "31.3",
93
+ cy: "10.2",
94
+ r: "2.2",
95
+ className: "fill-foreground"
96
+ })]
97
+ }),
98
+ /* @__PURE__ */ jsx("rect", {
99
+ x: "7",
100
+ y: "7",
101
+ width: "22",
102
+ height: "22",
103
+ rx: "9",
104
+ className: "fill-foreground"
105
+ }),
106
+ /* @__PURE__ */ jsxs(motion.g, {
107
+ style: {
108
+ opacity: 1,
109
+ transformOrigin: "18px 16px"
110
+ },
111
+ animate: refreshing && !reduce ? { scaleY: [
112
+ 1,
113
+ 1,
114
+ .15,
115
+ 1,
116
+ 1
117
+ ] } : reduce ? { opacity: 1 } : { scaleY: ready ? 1.18 : 1 },
118
+ transition: refreshing && !reduce ? CHARACTER_LOOP : SPRING_SWAP,
119
+ children: [/* @__PURE__ */ jsx("circle", {
120
+ cx: "14.2",
121
+ cy: "16",
122
+ r: "1.45",
123
+ className: "fill-background"
124
+ }), /* @__PURE__ */ jsx("circle", {
125
+ cx: "21.8",
126
+ cy: "16",
127
+ r: "1.45",
128
+ className: "fill-background"
129
+ })]
130
+ }),
131
+ /* @__PURE__ */ jsx("path", {
132
+ d: "M14.5 21h7",
133
+ fill: "none",
134
+ stroke: "currentColor",
135
+ strokeWidth: "1.5",
136
+ strokeLinecap: "round",
137
+ className: cn("text-background transition-opacity duration-150", ready || refreshing ? "opacity-0" : "opacity-100")
138
+ }),
139
+ /* @__PURE__ */ jsx("path", {
140
+ d: "M14 20.5c1 2.4 7 2.4 8 0",
141
+ fill: "none",
142
+ stroke: "currentColor",
143
+ strokeWidth: "1.5",
144
+ strokeLinecap: "round",
145
+ className: cn("text-background transition-opacity duration-150", ready ? "opacity-100" : "opacity-0")
146
+ }),
147
+ /* @__PURE__ */ jsx("circle", {
148
+ cx: "18",
149
+ cy: "21",
150
+ r: "1.6",
151
+ className: cn("fill-background transition-opacity duration-150", refreshing ? "opacity-100" : "opacity-0")
152
+ })
153
+ ]
154
+ })
155
+ });
156
+ }
157
+ function PullToRefresh({ onRefresh, children, refreshing = false, disabled = false, threshold = 76, maxPull = 132, holdDistance = 68, pullingLabel = "Pull to refresh", releaseLabel = "Release to refresh", refreshingLabel = "Refreshing", ariaLabel = "Refreshable content", className, contentClassName, indicatorClassName }) {
158
+ const rootRef = useRef(null);
159
+ const gestureRef = useRef({ ...EMPTY_GESTURE });
160
+ const animationRef = useRef(null);
161
+ const statusRef = useRef("idle");
162
+ const disabledRef = useRef(disabled);
163
+ const externalRefreshingRef = useRef(refreshing);
164
+ const refreshingRef = useRef(refreshing);
165
+ const [status, setStatusState] = useState("idle");
166
+ const [internalRefreshing, setInternalRefreshing] = useState(false);
167
+ const reduce = useReducedMotion();
168
+ const pullThreshold = Math.max(24, threshold);
169
+ const pullLimit = Math.max(maxPull, pullThreshold + 24);
170
+ const restingDistance = Math.min(Math.max(0, holdDistance), pullThreshold);
171
+ const y = useMotionValue(0);
172
+ const progress = useTransform(y, [0, pullThreshold], [0, 1]);
173
+ const indicatorOpacity = useTransform(y, [
174
+ 0,
175
+ 10,
176
+ pullThreshold
177
+ ], [
178
+ 0,
179
+ .45,
180
+ 1
181
+ ]);
182
+ const indicatorScale = useTransform(y, [0, pullThreshold], [.86, 1]);
183
+ const isRefreshing = refreshing || internalRefreshing;
184
+ disabledRef.current = disabled;
185
+ externalRefreshingRef.current = refreshing;
186
+ refreshingRef.current = isRefreshing;
187
+ const setStatus = useCallback((next) => {
188
+ if (statusRef.current === next) return;
189
+ statusRef.current = next;
190
+ setStatusState(next);
191
+ }, []);
192
+ const settle = useCallback((target) => {
193
+ animationRef.current?.stop();
194
+ if (reduce) {
195
+ y.set(target);
196
+ return;
197
+ }
198
+ animationRef.current = animate(y, target, SPRING_PANEL);
199
+ }, [reduce, y]);
200
+ const updatePull = useCallback((distance) => {
201
+ if (disabledRef.current || refreshingRef.current) return;
202
+ animationRef.current?.stop();
203
+ const next = resistedDistance(distance, pullLimit);
204
+ y.set(next);
205
+ setStatus(next >= pullThreshold ? "ready" : "pulling");
206
+ }, [
207
+ pullLimit,
208
+ pullThreshold,
209
+ setStatus,
210
+ y
211
+ ]);
212
+ const runRefresh = useCallback(async () => {
213
+ if (disabledRef.current || refreshingRef.current) return;
214
+ setInternalRefreshing(true);
215
+ setStatus("refreshing");
216
+ settle(restingDistance);
217
+ try {
218
+ await onRefresh();
219
+ } finally {
220
+ setInternalRefreshing(false);
221
+ if (!externalRefreshingRef.current) {
222
+ setStatus("idle");
223
+ settle(0);
224
+ }
225
+ }
226
+ }, [
227
+ onRefresh,
228
+ restingDistance,
229
+ setStatus,
230
+ settle
231
+ ]);
232
+ const finishPull = useCallback(() => {
233
+ const shouldRefresh = y.get() >= pullThreshold && !disabledRef.current && !refreshingRef.current;
234
+ gestureRef.current = { ...EMPTY_GESTURE };
235
+ if (shouldRefresh) {
236
+ runRefresh();
237
+ return;
238
+ }
239
+ setStatus("idle");
240
+ settle(0);
241
+ }, [
242
+ pullThreshold,
243
+ runRefresh,
244
+ setStatus,
245
+ settle,
246
+ y
247
+ ]);
248
+ useEffect(() => {
249
+ if (isRefreshing) {
250
+ setStatus("refreshing");
251
+ settle(restingDistance);
252
+ return;
253
+ }
254
+ if (statusRef.current === "refreshing") {
255
+ setStatus("idle");
256
+ settle(0);
257
+ }
258
+ }, [
259
+ isRefreshing,
260
+ restingDistance,
261
+ setStatus,
262
+ settle
263
+ ]);
264
+ useEffect(() => {
265
+ const root = rootRef.current;
266
+ if (!root) return;
267
+ const onTouchStart = (event) => {
268
+ if (event.touches.length !== 1 || root.scrollTop > 0 || disabledRef.current || refreshingRef.current) return;
269
+ const touch = event.touches[0];
270
+ gestureRef.current = {
271
+ active: true,
272
+ startX: touch.clientX,
273
+ startY: touch.clientY,
274
+ pointerId: null
275
+ };
276
+ };
277
+ const onTouchMove = (event) => {
278
+ const gesture = gestureRef.current;
279
+ const touch = event.touches[0];
280
+ if (!gesture.active || !touch) return;
281
+ const deltaX = touch.clientX - gesture.startX;
282
+ const deltaY = touch.clientY - gesture.startY;
283
+ if (root.scrollTop > 0 || deltaY < 0) {
284
+ gestureRef.current = { ...EMPTY_GESTURE };
285
+ return;
286
+ }
287
+ if (Math.abs(deltaX) > deltaY) return;
288
+ event.preventDefault();
289
+ updatePull(deltaY);
290
+ };
291
+ const onTouchEnd = () => {
292
+ if (gestureRef.current.active) finishPull();
293
+ };
294
+ root.addEventListener("touchstart", onTouchStart, { passive: true });
295
+ root.addEventListener("touchmove", onTouchMove, { passive: false });
296
+ root.addEventListener("touchend", onTouchEnd);
297
+ root.addEventListener("touchcancel", onTouchEnd);
298
+ return () => {
299
+ root.removeEventListener("touchstart", onTouchStart);
300
+ root.removeEventListener("touchmove", onTouchMove);
301
+ root.removeEventListener("touchend", onTouchEnd);
302
+ root.removeEventListener("touchcancel", onTouchEnd);
303
+ };
304
+ }, [finishPull, updatePull]);
305
+ useEffect(() => {
306
+ return () => animationRef.current?.stop();
307
+ }, []);
308
+ const startMousePull = (event) => {
309
+ if (event.pointerType !== "mouse" || event.button !== 0 || event.currentTarget.scrollTop > 0 || disabled || isRefreshing) return;
310
+ event.currentTarget.setPointerCapture(event.pointerId);
311
+ gestureRef.current = {
312
+ active: true,
313
+ startX: event.clientX,
314
+ startY: event.clientY,
315
+ pointerId: event.pointerId
316
+ };
317
+ };
318
+ const moveMousePull = (event) => {
319
+ const gesture = gestureRef.current;
320
+ if (!gesture.active || gesture.pointerId !== event.pointerId) return;
321
+ const deltaX = event.clientX - gesture.startX;
322
+ const deltaY = event.clientY - gesture.startY;
323
+ if (deltaY < 0 || Math.abs(deltaX) > deltaY) return;
324
+ event.preventDefault();
325
+ updatePull(deltaY);
326
+ };
327
+ const label = status === "refreshing" ? refreshingLabel : status === "ready" ? releaseLabel : pullingLabel;
328
+ return /* @__PURE__ */ jsxs("section", {
329
+ ref: rootRef,
330
+ "aria-label": ariaLabel,
331
+ "aria-busy": isRefreshing,
332
+ "data-state": status,
333
+ "data-disabled": disabled || void 0,
334
+ onPointerDown: startMousePull,
335
+ onPointerMove: moveMousePull,
336
+ onPointerUp: (event) => {
337
+ if (gestureRef.current.pointerId === event.pointerId) finishPull();
338
+ },
339
+ onPointerCancel: (event) => {
340
+ if (gestureRef.current.pointerId === event.pointerId) finishPull();
341
+ },
342
+ className: cn("relative w-full overflow-y-auto overscroll-contain bg-background", status === "pulling" || status === "ready" ? "cursor-grabbing select-none" : "cursor-grab", (disabled || isRefreshing) && "cursor-default", className),
343
+ children: [/* @__PURE__ */ jsxs(motion.div, {
344
+ "aria-live": "polite",
345
+ "aria-atomic": "true",
346
+ style: reduce ? { opacity: indicatorOpacity } : {
347
+ opacity: indicatorOpacity,
348
+ scale: indicatorScale
349
+ },
350
+ className: cn("pointer-events-none absolute inset-x-0 top-0 z-20 flex h-[4.25rem] flex-col items-center justify-center gap-0.5 bg-linear-to-b from-background via-background/95 to-transparent font-medium text-[11px] text-muted-foreground", indicatorClassName),
351
+ children: [/* @__PURE__ */ jsx(RefreshBuddy, {
352
+ progress,
353
+ status,
354
+ reduce: Boolean(reduce)
355
+ }), /* @__PURE__ */ jsx("span", {
356
+ className: "relative h-4 min-w-24 text-center",
357
+ children: /* @__PURE__ */ jsx(AnimatePresence, {
358
+ initial: false,
359
+ mode: "wait",
360
+ children: /* @__PURE__ */ jsx(motion.span, {
361
+ initial: reduce ? { opacity: 0 } : {
362
+ opacity: 0,
363
+ y: 3
364
+ },
365
+ animate: reduce ? { opacity: 1 } : {
366
+ opacity: 1,
367
+ y: 0
368
+ },
369
+ exit: reduce ? { opacity: 0 } : {
370
+ opacity: 0,
371
+ y: -3
372
+ },
373
+ transition: LABEL_SWAP,
374
+ className: "absolute inset-x-0 whitespace-nowrap",
375
+ children: label
376
+ }, status)
377
+ })
378
+ })]
379
+ }), /* @__PURE__ */ jsx(motion.div, {
380
+ style: reduce ? void 0 : { y },
381
+ className: cn("relative z-10 min-h-full bg-inherit will-change-transform", contentClassName),
382
+ children
383
+ })]
384
+ });
385
+ }
386
+ //#endregion
387
+ export { PullToRefresh };
388
+
389
+ //# sourceMappingURL=pull-to-refresh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pull-to-refresh.js","names":[],"sources":["../../../src/components/motion/pull-to-refresh.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ReactNode,\n type PointerEvent as ReactPointerEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport {\n AnimatePresence,\n animate,\n type MotionValue,\n motion,\n useMotionValue,\n useReducedMotion,\n useTransform,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_IN_OUT, EASE_OUT, SPRING_PANEL, SPRING_SWAP } from \"../../lib/ease\";\n\nexport type PullToRefreshStatus = \"idle\" | \"pulling\" | \"ready\" | \"refreshing\";\n\nexport interface PullToRefreshProps {\n /** Runs after the user pulls beyond the threshold and releases. */\n onRefresh: () => void | Promise<void>;\n children: ReactNode;\n /** Keeps the indicator active while an externally managed refresh runs. */\n refreshing?: boolean;\n disabled?: boolean;\n /** Resisted pull distance in pixels required to refresh. */\n threshold?: number;\n /** Maximum resisted pull distance in pixels. */\n maxPull?: number;\n /** Content offset in pixels while refreshing. */\n holdDistance?: number;\n pullingLabel?: ReactNode;\n releaseLabel?: ReactNode;\n refreshingLabel?: ReactNode;\n ariaLabel?: string;\n className?: string;\n contentClassName?: string;\n indicatorClassName?: string;\n}\n\ntype Gesture = {\n active: boolean;\n startX: number;\n startY: number;\n pointerId: number | null;\n};\n\nconst EMPTY_GESTURE: Gesture = {\n active: false,\n startX: 0,\n startY: 0,\n pointerId: null,\n};\n\n// This character needs a compact repeating rhythm rather than a settling\n// spring: a small orbit and blink that read as activity without feeling busy.\nconst CHARACTER_LOOP = {\n duration: 0.9,\n ease: EASE_IN_OUT,\n repeat: Number.POSITIVE_INFINITY,\n} as const;\nconst CALM_PULSE = {\n duration: 1.2,\n ease: EASE_IN_OUT,\n repeat: Number.POSITIVE_INFINITY,\n} as const;\nconst LABEL_SWAP = { duration: 0.16, ease: EASE_OUT } as const;\n\nfunction resistedDistance(distance: number, maxPull: number) {\n return maxPull * (1 - Math.exp(-Math.max(0, distance) / maxPull));\n}\n\nfunction RefreshBuddy({\n progress,\n status,\n reduce,\n}: {\n progress: MotionValue<number>;\n status: PullToRefreshStatus;\n reduce: boolean;\n}) {\n const lift = useTransform(progress, [0, 1], [-7, 0]);\n const tilt = useTransform(progress, [0, 1], [-10, 0]);\n const stretch = useTransform(progress, [0, 0.55, 1], [0.68, 1.1, 0.92]);\n const ready = status === \"ready\";\n const refreshing = status === \"refreshing\";\n\n return (\n <motion.span\n style={reduce ? undefined : { y: lift, rotate: tilt, scaleY: stretch }}\n className=\"block h-9 w-9 origin-bottom\"\n >\n <motion.svg\n aria-hidden=\"true\"\n viewBox=\"0 0 36 36\"\n style={{ opacity: 1 }}\n className=\"h-full w-full overflow-visible\"\n animate={\n refreshing\n ? reduce\n ? { opacity: [0.55, 1, 0.55] }\n : { y: [0, -2, 0], rotate: [-3, 3, -3] }\n : reduce\n ? { opacity: 1 }\n : { y: 0, rotate: 0, scale: ready ? 1.08 : 1 }\n }\n transition={refreshing ? (reduce ? CALM_PULSE : CHARACTER_LOOP) : SPRING_SWAP}\n >\n <motion.g\n style={{ transformOrigin: \"18px 18px\" }}\n animate={\n refreshing && !reduce\n ? { rotate: [0, 360] }\n : reduce\n ? undefined\n : { rotate: ready ? 0 : -35 }\n }\n transition={refreshing ? (reduce ? CALM_PULSE : CHARACTER_LOOP) : SPRING_SWAP}\n className={cn(\n \"transition-opacity duration-150\",\n ready || refreshing ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n <path\n d=\"M18 2.5a15.5 15.5 0 0 1 12.7 6.6\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n className=\"text-muted-foreground\"\n />\n <circle cx=\"31.3\" cy=\"10.2\" r=\"2.2\" className=\"fill-foreground\" />\n </motion.g>\n\n <rect x=\"7\" y=\"7\" width=\"22\" height=\"22\" rx=\"9\" className=\"fill-foreground\" />\n\n <motion.g\n style={{ opacity: 1, transformOrigin: \"18px 16px\" }}\n animate={\n refreshing && !reduce\n ? { scaleY: [1, 1, 0.15, 1, 1] }\n : reduce\n ? { opacity: 1 }\n : { scaleY: ready ? 1.18 : 1 }\n }\n transition={refreshing && !reduce ? CHARACTER_LOOP : SPRING_SWAP}\n >\n <circle cx=\"14.2\" cy=\"16\" r=\"1.45\" className=\"fill-background\" />\n <circle cx=\"21.8\" cy=\"16\" r=\"1.45\" className=\"fill-background\" />\n </motion.g>\n\n <path\n d=\"M14.5 21h7\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n className={cn(\n \"text-background transition-opacity duration-150\",\n ready || refreshing ? \"opacity-0\" : \"opacity-100\",\n )}\n />\n <path\n d=\"M14 20.5c1 2.4 7 2.4 8 0\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n className={cn(\n \"text-background transition-opacity duration-150\",\n ready ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n <circle\n cx=\"18\"\n cy=\"21\"\n r=\"1.6\"\n className={cn(\n \"fill-background transition-opacity duration-150\",\n refreshing ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n </motion.svg>\n </motion.span>\n );\n}\n\nexport function PullToRefresh({\n onRefresh,\n children,\n refreshing = false,\n disabled = false,\n threshold = 76,\n maxPull = 132,\n holdDistance = 68,\n pullingLabel = \"Pull to refresh\",\n releaseLabel = \"Release to refresh\",\n refreshingLabel = \"Refreshing\",\n ariaLabel = \"Refreshable content\",\n className,\n contentClassName,\n indicatorClassName,\n}: PullToRefreshProps) {\n const rootRef = useRef<HTMLElement>(null);\n const gestureRef = useRef<Gesture>({ ...EMPTY_GESTURE });\n const animationRef = useRef<{ stop: () => void } | null>(null);\n const statusRef = useRef<PullToRefreshStatus>(\"idle\");\n const disabledRef = useRef(disabled);\n const externalRefreshingRef = useRef(refreshing);\n const refreshingRef = useRef(refreshing);\n const [status, setStatusState] = useState<PullToRefreshStatus>(\"idle\");\n const [internalRefreshing, setInternalRefreshing] = useState(false);\n const reduce = useReducedMotion();\n const pullThreshold = Math.max(24, threshold);\n const pullLimit = Math.max(maxPull, pullThreshold + 24);\n const restingDistance = Math.min(Math.max(0, holdDistance), pullThreshold);\n const y = useMotionValue(0);\n const progress = useTransform(y, [0, pullThreshold], [0, 1]);\n const indicatorOpacity = useTransform(y, [0, 10, pullThreshold], [0, 0.45, 1]);\n const indicatorScale = useTransform(y, [0, pullThreshold], [0.86, 1]);\n const isRefreshing = refreshing || internalRefreshing;\n\n disabledRef.current = disabled;\n externalRefreshingRef.current = refreshing;\n refreshingRef.current = isRefreshing;\n\n const setStatus = useCallback((next: PullToRefreshStatus) => {\n if (statusRef.current === next) return;\n statusRef.current = next;\n setStatusState(next);\n }, []);\n\n const settle = useCallback(\n (target: number) => {\n animationRef.current?.stop();\n\n if (reduce) {\n y.set(target);\n return;\n }\n\n animationRef.current = animate(y, target, SPRING_PANEL);\n },\n [reduce, y],\n );\n\n const updatePull = useCallback(\n (distance: number) => {\n if (disabledRef.current || refreshingRef.current) return;\n animationRef.current?.stop();\n\n const next = resistedDistance(distance, pullLimit);\n y.set(next);\n setStatus(next >= pullThreshold ? \"ready\" : \"pulling\");\n },\n [pullLimit, pullThreshold, setStatus, y],\n );\n\n const runRefresh = useCallback(async () => {\n if (disabledRef.current || refreshingRef.current) return;\n\n setInternalRefreshing(true);\n setStatus(\"refreshing\");\n settle(restingDistance);\n\n try {\n await onRefresh();\n } finally {\n setInternalRefreshing(false);\n\n // A synchronous refresh can resolve before React commits the temporary\n // internal state, so release here instead of relying only on the effect.\n if (!externalRefreshingRef.current) {\n setStatus(\"idle\");\n settle(0);\n }\n }\n }, [onRefresh, restingDistance, setStatus, settle]);\n\n const finishPull = useCallback(() => {\n const shouldRefresh =\n y.get() >= pullThreshold && !disabledRef.current && !refreshingRef.current;\n\n gestureRef.current = { ...EMPTY_GESTURE };\n\n if (shouldRefresh) {\n void runRefresh();\n return;\n }\n\n setStatus(\"idle\");\n settle(0);\n }, [pullThreshold, runRefresh, setStatus, settle, y]);\n\n useEffect(() => {\n if (isRefreshing) {\n setStatus(\"refreshing\");\n settle(restingDistance);\n return;\n }\n\n if (statusRef.current === \"refreshing\") {\n setStatus(\"idle\");\n settle(0);\n }\n }, [isRefreshing, restingDistance, setStatus, settle]);\n\n useEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n\n const onTouchStart = (event: TouchEvent) => {\n if (\n event.touches.length !== 1 ||\n root.scrollTop > 0 ||\n disabledRef.current ||\n refreshingRef.current\n ) {\n return;\n }\n\n const touch = event.touches[0];\n gestureRef.current = {\n active: true,\n startX: touch.clientX,\n startY: touch.clientY,\n pointerId: null,\n };\n };\n\n const onTouchMove = (event: TouchEvent) => {\n const gesture = gestureRef.current;\n const touch = event.touches[0];\n if (!gesture.active || !touch) return;\n\n const deltaX = touch.clientX - gesture.startX;\n const deltaY = touch.clientY - gesture.startY;\n\n if (root.scrollTop > 0 || deltaY < 0) {\n gestureRef.current = { ...EMPTY_GESTURE };\n return;\n }\n\n if (Math.abs(deltaX) > deltaY) return;\n\n event.preventDefault();\n updatePull(deltaY);\n };\n\n const onTouchEnd = () => {\n if (gestureRef.current.active) finishPull();\n };\n\n root.addEventListener(\"touchstart\", onTouchStart, { passive: true });\n root.addEventListener(\"touchmove\", onTouchMove, { passive: false });\n root.addEventListener(\"touchend\", onTouchEnd);\n root.addEventListener(\"touchcancel\", onTouchEnd);\n\n return () => {\n root.removeEventListener(\"touchstart\", onTouchStart);\n root.removeEventListener(\"touchmove\", onTouchMove);\n root.removeEventListener(\"touchend\", onTouchEnd);\n root.removeEventListener(\"touchcancel\", onTouchEnd);\n };\n }, [finishPull, updatePull]);\n\n useEffect(() => {\n return () => animationRef.current?.stop();\n }, []);\n\n const startMousePull = (event: ReactPointerEvent<HTMLElement>) => {\n if (\n event.pointerType !== \"mouse\" ||\n event.button !== 0 ||\n event.currentTarget.scrollTop > 0 ||\n disabled ||\n isRefreshing\n ) {\n return;\n }\n\n event.currentTarget.setPointerCapture(event.pointerId);\n gestureRef.current = {\n active: true,\n startX: event.clientX,\n startY: event.clientY,\n pointerId: event.pointerId,\n };\n };\n\n const moveMousePull = (event: ReactPointerEvent<HTMLElement>) => {\n const gesture = gestureRef.current;\n if (!gesture.active || gesture.pointerId !== event.pointerId) return;\n\n const deltaX = event.clientX - gesture.startX;\n const deltaY = event.clientY - gesture.startY;\n if (deltaY < 0 || Math.abs(deltaX) > deltaY) return;\n\n event.preventDefault();\n updatePull(deltaY);\n };\n\n const label =\n status === \"refreshing\" ? refreshingLabel : status === \"ready\" ? releaseLabel : pullingLabel;\n\n return (\n <section\n ref={rootRef}\n aria-label={ariaLabel}\n aria-busy={isRefreshing}\n data-state={status}\n data-disabled={disabled || undefined}\n onPointerDown={startMousePull}\n onPointerMove={moveMousePull}\n onPointerUp={(event) => {\n if (gestureRef.current.pointerId === event.pointerId) finishPull();\n }}\n onPointerCancel={(event) => {\n if (gestureRef.current.pointerId === event.pointerId) finishPull();\n }}\n className={cn(\n \"relative w-full overflow-y-auto overscroll-contain bg-background\",\n status === \"pulling\" || status === \"ready\" ? \"cursor-grabbing select-none\" : \"cursor-grab\",\n (disabled || isRefreshing) && \"cursor-default\",\n className,\n )}\n >\n <motion.div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n style={\n reduce\n ? { opacity: indicatorOpacity }\n : { opacity: indicatorOpacity, scale: indicatorScale }\n }\n className={cn(\n \"pointer-events-none absolute inset-x-0 top-0 z-20 flex h-[4.25rem] flex-col items-center justify-center gap-0.5 bg-linear-to-b from-background via-background/95 to-transparent font-medium text-[11px] text-muted-foreground\",\n indicatorClassName,\n )}\n >\n <RefreshBuddy progress={progress} status={status} reduce={Boolean(reduce)} />\n <span className=\"relative h-4 min-w-24 text-center\">\n <AnimatePresence initial={false} mode=\"wait\">\n <motion.span\n key={status}\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: 3 }}\n animate={reduce ? { opacity: 1 } : { opacity: 1, y: 0 }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, y: -3 }}\n transition={LABEL_SWAP}\n className=\"absolute inset-x-0 whitespace-nowrap\"\n >\n {label}\n </motion.span>\n </AnimatePresence>\n </span>\n </motion.div>\n\n <motion.div\n style={reduce ? undefined : { y }}\n className={cn(\n \"relative z-10 min-h-full bg-inherit will-change-transform\",\n contentClassName,\n )}\n >\n {children}\n </motion.div>\n </section>\n );\n}\n"],"mappings":";;;;;;;AAsDA,MAAM,gBAAyB;CAC7B,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,WAAW;AACb;AAIA,MAAM,iBAAiB;CACrB,UAAU;CACV,MAAM;CACN,QAAQ,OAAO;AACjB;AACA,MAAM,aAAa;CACjB,UAAU;CACV,MAAM;CACN,QAAQ,OAAO;AACjB;AACA,MAAM,aAAa;CAAE,UAAU;CAAM,MAAM;AAAS;AAEpD,SAAS,iBAAiB,UAAkB,SAAiB;CAC3D,OAAO,WAAW,IAAI,KAAK,IAAI,CAAC,KAAK,IAAI,GAAG,QAAQ,IAAI,OAAO;AACjE;AAEA,SAAS,aAAa,EACpB,UACA,QACA,UAKC;CACD,MAAM,OAAO,aAAa,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;CACnD,MAAM,OAAO,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ACL;;AAEb"}
@@ -0,0 +1,22 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/components/motion/radio.d.ts
3
+ interface RadioGroupProps {
4
+ value?: string;
5
+ defaultValue?: string;
6
+ onValueChange?: (value: string) => void;
7
+ children: ReactNode;
8
+ className?: string;
9
+ orientation?: "vertical" | "horizontal";
10
+ }
11
+ declare function RadioGroup({ value, defaultValue, onValueChange, children, className, orientation }: RadioGroupProps): import("react").JSX.Element;
12
+ interface RadioGroupItemProps {
13
+ value: string;
14
+ label?: string;
15
+ disabled?: boolean;
16
+ className?: string;
17
+ id?: string;
18
+ }
19
+ declare function RadioGroupItem({ value, label, disabled, className, id: idProp }: RadioGroupItemProps): import("react").JSX.Element;
20
+ //#endregion
21
+ export { RadioGroup, RadioGroupItem, RadioGroupItemProps, RadioGroupProps };
22
+ //# sourceMappingURL=radio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio.d.ts","names":[],"sources":["../../../src/components/motion/radio.tsx"],"mappings":";;UAgCiB;EACf;EACA;EACA,iBAAiB;EACjB,UAAU;EACV;EACA;;iBAGc,aACd,OACA,cACA,eACA,UACA,WACA,eACC,kCAAe,IAAA;UAoCD;EACf;EACA;EACA;EACA;EACA;;iBAGc,iBACd,OACA,OACA,UACA,WACA,IAAI,UACH,sCAAmB,IAAA"}
@@ -0,0 +1,79 @@
1
+ "use client";
2
+ import { SPRING_LAYOUT, SPRING_PRESS } from "../../lib/ease.js";
3
+ import { createContext, useCallback, useContext, useId, useMemo, useState } from "react";
4
+ import { cn } from "@kumix/utils";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { MotionConfig, motion, useReducedMotion } from "motion/react";
7
+ //#region src/components/motion/radio.tsx
8
+ const RadioCtx = createContext(null);
9
+ function useRadioGroup() {
10
+ const ctx = useContext(RadioCtx);
11
+ if (!ctx) throw new Error("RadioGroupItem must be used inside <RadioGroup>");
12
+ return ctx;
13
+ }
14
+ function RadioGroup({ value, defaultValue = "", onValueChange, children, className, orientation = "vertical" }) {
15
+ const [internal, setInternal] = useState(defaultValue);
16
+ const layoutId = useId();
17
+ const reduce = useReducedMotion();
18
+ const controlled = value !== void 0;
19
+ const current = controlled ? value : internal;
20
+ const setValue = useCallback((next) => {
21
+ if (!controlled) setInternal(next);
22
+ onValueChange?.(next);
23
+ }, [controlled, onValueChange]);
24
+ const contextValue = useMemo(() => ({
25
+ value: current,
26
+ setValue,
27
+ layoutId
28
+ }), [
29
+ current,
30
+ layoutId,
31
+ setValue
32
+ ]);
33
+ return /* @__PURE__ */ jsx(MotionConfig, {
34
+ transition: reduce ? { duration: 0 } : SPRING_LAYOUT,
35
+ children: /* @__PURE__ */ jsx(RadioCtx.Provider, {
36
+ value: contextValue,
37
+ children: /* @__PURE__ */ jsx("div", {
38
+ role: "radiogroup",
39
+ className: cn("flex gap-3", orientation === "vertical" ? "flex-col" : "flex-row flex-wrap", className),
40
+ children
41
+ })
42
+ })
43
+ });
44
+ }
45
+ function RadioGroupItem({ value, label, disabled, className, id: idProp }) {
46
+ const { value: groupValue, setValue, layoutId } = useRadioGroup();
47
+ const autoId = useId();
48
+ const id = idProp ?? autoId;
49
+ const reduce = useReducedMotion();
50
+ const selected = groupValue === value;
51
+ return /* @__PURE__ */ jsxs("label", {
52
+ htmlFor: id,
53
+ className: cn("inline-flex items-center gap-3", disabled ? "cursor-not-allowed" : "cursor-pointer", className),
54
+ children: [/* @__PURE__ */ jsx(motion.button, {
55
+ id,
56
+ type: "button",
57
+ role: "radio",
58
+ "aria-checked": selected,
59
+ disabled,
60
+ onClick: () => !disabled && setValue(value),
61
+ whileTap: reduce || disabled ? void 0 : { scale: .92 },
62
+ transition: SPRING_PRESS,
63
+ "data-state": selected ? "checked" : "unchecked",
64
+ className: cn("relative inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 outline-none transition-colors duration-200", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", "disabled:cursor-not-allowed disabled:opacity-60", selected ? "border-primary" : "border-muted-foreground/50 hover:border-muted-foreground"),
65
+ children: selected ? /* @__PURE__ */ jsx(motion.span, {
66
+ layoutId,
67
+ className: "absolute inset-1 rounded-full bg-primary",
68
+ transition: reduce ? { duration: 0 } : SPRING_LAYOUT
69
+ }) : null
70
+ }), label ? /* @__PURE__ */ jsx("span", {
71
+ className: cn("select-none text-foreground text-sm", disabled && "opacity-60"),
72
+ children: label
73
+ }) : null]
74
+ });
75
+ }
76
+ //#endregion
77
+ export { RadioGroup, RadioGroupItem };
78
+
79
+ //# sourceMappingURL=radio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio.js","names":[],"sources":["../../../src/components/motion/radio.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useId,\n useMemo,\n useState,\n} from \"react\";\nimport { MotionConfig, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { SPRING_LAYOUT, SPRING_PRESS } from \"../../lib/ease\";\n\ntype RadioCtx = {\n value: string;\n setValue: (value: string) => void;\n layoutId: string;\n};\n\nconst RadioCtx = createContext<RadioCtx | null>(null);\n\nfunction useRadioGroup() {\n const ctx = useContext(RadioCtx);\n if (!ctx) {\n throw new Error(\"RadioGroupItem must be used inside <RadioGroup>\");\n }\n return ctx;\n}\n\nexport interface RadioGroupProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n children: ReactNode;\n className?: string;\n orientation?: \"vertical\" | \"horizontal\";\n}\n\nexport function RadioGroup({\n value,\n defaultValue = \"\",\n onValueChange,\n children,\n className,\n orientation = \"vertical\",\n}: RadioGroupProps) {\n const [internal, setInternal] = useState(defaultValue);\n const layoutId = useId();\n const reduce = useReducedMotion();\n const controlled = value !== undefined;\n const current = controlled ? value : internal;\n const setValue = useCallback(\n (next: string) => {\n if (!controlled) setInternal(next);\n onValueChange?.(next);\n },\n [controlled, onValueChange],\n );\n const contextValue = useMemo(\n () => ({ value: current, setValue, layoutId }),\n [current, layoutId, setValue],\n );\n\n return (\n <MotionConfig transition={reduce ? { duration: 0 } : SPRING_LAYOUT}>\n <RadioCtx.Provider value={contextValue}>\n <div\n role=\"radiogroup\"\n className={cn(\n \"flex gap-3\",\n orientation === \"vertical\" ? \"flex-col\" : \"flex-row flex-wrap\",\n className,\n )}\n >\n {children}\n </div>\n </RadioCtx.Provider>\n </MotionConfig>\n );\n}\n\nexport interface RadioGroupItemProps {\n value: string;\n label?: string;\n disabled?: boolean;\n className?: string;\n id?: string;\n}\n\nexport function RadioGroupItem({\n value,\n label,\n disabled,\n className,\n id: idProp,\n}: RadioGroupItemProps) {\n const { value: groupValue, setValue, layoutId } = useRadioGroup();\n const autoId = useId();\n const id = idProp ?? autoId;\n const reduce = useReducedMotion();\n const selected = groupValue === value;\n\n return (\n <label\n htmlFor={id}\n className={cn(\n \"inline-flex items-center gap-3\",\n disabled ? \"cursor-not-allowed\" : \"cursor-pointer\",\n className,\n )}\n >\n <motion.button\n id={id}\n type=\"button\"\n role=\"radio\"\n aria-checked={selected}\n disabled={disabled}\n onClick={() => !disabled && setValue(value)}\n whileTap={reduce || disabled ? undefined : { scale: 0.92 }}\n transition={SPRING_PRESS}\n data-state={selected ? \"checked\" : \"unchecked\"}\n className={cn(\n \"relative inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 outline-none transition-colors duration-200\",\n \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n \"disabled:cursor-not-allowed disabled:opacity-60\",\n selected ? \"border-primary\" : \"border-muted-foreground/50 hover:border-muted-foreground\",\n )}\n >\n {selected ? (\n <motion.span\n layoutId={layoutId}\n className=\"absolute inset-1 rounded-full bg-primary\"\n transition={reduce ? { duration: 0 } : SPRING_LAYOUT}\n />\n ) : null}\n </motion.button>\n {label ? (\n <span className={cn(\"select-none text-foreground text-sm\", disabled && \"opacity-60\")}>\n {label}\n </span>\n ) :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Ac;GACJ;GACV,eAAe,CAAC,YAAY,SAAS,KAAK;GAC1C,UAAU,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;GACzD,YAAY;GACZ,cAAY,WAAW,YAAY;GACnC,WAAW,GACT,uIACA,iHACA,mDACA,WAAW,mBAAmB,0DAChC;GAEC,UAAA,WACC,oBAAC,OAAO,MAAR;IACY;IACV,WAAU;IACV,YAAY,SAAS,EAAE,UAAU,EAAE,IAAI;GACxC,CAAA,IACC;EACS,CAAA,GACd,QACC,oBAAC,QAAD;GAAM,WAAW,GAAG,uCAAuC,YAAY,YAAY;GAChF,UAAA;EACG,CAAA,IACJ,IACC;;AAEX"}
@@ -0,0 +1,16 @@
1
+ import { SliderOptions } from "../../hooks/use-slider.js";
2
+ //#region src/components/motion/range-slider-bubble.d.ts
3
+ interface BubbleSliderProps extends SliderOptions {
4
+ /** Formats the value shown in the bubble. */
5
+ format?: (value: number) => string;
6
+ className?: string;
7
+ }
8
+ /**
9
+ * Slider with a value bubble that pops out of the thumb on grab and reacts to
10
+ * how fast you drag: it leans into the direction of travel and squashes along
11
+ * the way, then settles upright when you let go.
12
+ */
13
+ declare function BubbleSlider({ format, className, ...options }: BubbleSliderProps): import("react").JSX.Element;
14
+ //#endregion
15
+ export { BubbleSlider, BubbleSliderProps };
16
+ //# sourceMappingURL=range-slider-bubble.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range-slider-bubble.d.ts","names":[],"sources":["../../../src/components/motion/range-slider-bubble.tsx"],"mappings":";;UAuBiB,0BAA0B;;EAEzC,UAAU;EACV;;;;;;;iBAQc,eAAe,QAAQ,cAAc,WAAW,oCAAiB,IAAA"}