@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,254 @@
1
+ "use client";
2
+ import { useCallback, useEffect, useRef, useState } from "react";
3
+ import { cn } from "@kumix/utils";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { animate, motion, useMotionValue, useReducedMotion } from "motion/react";
6
+ //#region src/components/motion/swipeable-list.tsx
7
+ const ROW_SETTLE = {
8
+ type: "spring",
9
+ stiffness: 560,
10
+ damping: 48,
11
+ mass: .82,
12
+ restDelta: .5,
13
+ restSpeed: 8
14
+ };
15
+ const OPEN_DISTANCE_RATIO = .46;
16
+ const CLOSE_DISTANCE_RATIO = .72;
17
+ const OPEN_VELOCITY = 720;
18
+ const CLOSE_VELOCITY = 320;
19
+ const FLING_DISTANCE = 14;
20
+ const RELEASE_VELOCITY_LIMIT = 1500;
21
+ const ACTION_TONE_CLASS = {
22
+ neutral: "text-muted-foreground group-hover:text-foreground",
23
+ primary: "text-foreground",
24
+ success: "text-emerald-600 dark:text-emerald-400",
25
+ warning: "text-amber-600 dark:text-amber-400",
26
+ danger: "text-destructive"
27
+ };
28
+ function useControllableSwipeValue({ value, defaultValue, onValueChange }) {
29
+ const [internalValue, setInternalValue] = useState(defaultValue ?? null);
30
+ const isControlled = value !== void 0;
31
+ return [value ?? internalValue, useCallback((next) => {
32
+ if (!isControlled) setInternalValue(next);
33
+ onValueChange?.(next);
34
+ }, [isControlled, onValueChange])];
35
+ }
36
+ function isActionableSide(value, sideWidth) {
37
+ return sideWidth > 0 && Math.abs(value) > 0;
38
+ }
39
+ function clampReleaseVelocity(velocity) {
40
+ return Math.max(-1500, Math.min(RELEASE_VELOCITY_LIMIT, velocity));
41
+ }
42
+ function SwipeActionButton({ action, actionWidth, side, focusable, onAction, className }) {
43
+ return /* @__PURE__ */ jsxs("button", {
44
+ type: "button",
45
+ disabled: action.disabled,
46
+ tabIndex: focusable ? 0 : -1,
47
+ "aria-label": typeof action.label === "string" ? action.label : void 0,
48
+ onClick: () => onAction(action, side),
49
+ className: cn("group flex h-full shrink-0 items-center justify-center outline-none", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", "disabled:pointer-events-none disabled:opacity-50", className),
50
+ style: { width: actionWidth },
51
+ children: [/* @__PURE__ */ jsx("span", {
52
+ className: cn("grid h-9 w-9 place-items-center rounded-full transition-[background-color,color,transform] duration-150 group-hover:bg-background group-active:scale-95", ACTION_TONE_CLASS[action.tone ?? "neutral"]),
53
+ children: action.icon
54
+ }), /* @__PURE__ */ jsx("span", {
55
+ className: "sr-only",
56
+ children: action.label
57
+ })]
58
+ });
59
+ }
60
+ function SwipeableListRow({ item, actionWidth, revealThreshold, openValue, setOpenValue, closeOnAction, onAction, classNames, renderItem }) {
61
+ const reduce = useReducedMotion();
62
+ const x = useMotionValue(0);
63
+ const animationRef = useRef(null);
64
+ const commandedTargetRef = useRef(0);
65
+ const leftActions = item.leftActions ?? [];
66
+ const rightActions = item.rightActions ?? [];
67
+ const leftWidth = leftActions.length * actionWidth;
68
+ const rightWidth = rightActions.length * actionWidth;
69
+ const openSide = openValue?.id === item.id ? openValue.side : null;
70
+ const targetX = openSide === "left" ? leftWidth : openSide === "right" ? -rightWidth : 0;
71
+ const settleX = useCallback((nextX, velocity = 0) => {
72
+ commandedTargetRef.current = nextX;
73
+ animationRef.current?.stop();
74
+ if (reduce) {
75
+ x.set(nextX);
76
+ return;
77
+ }
78
+ animationRef.current = animate(x, nextX, {
79
+ ...ROW_SETTLE,
80
+ velocity: clampReleaseVelocity(velocity),
81
+ onComplete: () => x.set(nextX)
82
+ });
83
+ }, [reduce, x]);
84
+ useEffect(() => {
85
+ return () => animationRef.current?.stop();
86
+ }, []);
87
+ useEffect(() => {
88
+ if (commandedTargetRef.current === targetX) return;
89
+ settleX(targetX);
90
+ }, [settleX, targetX]);
91
+ const getTargetX = useCallback((side) => side === "left" ? leftWidth : side === "right" ? -rightWidth : 0, [leftWidth, rightWidth]);
92
+ const snapTo = useCallback((side, velocity = 0) => {
93
+ setOpenValue(side ? {
94
+ id: item.id,
95
+ side
96
+ } : null);
97
+ settleX(getTargetX(side), velocity);
98
+ }, [
99
+ getTargetX,
100
+ item.id,
101
+ setOpenValue,
102
+ settleX
103
+ ]);
104
+ const onDragStart = useCallback(() => {
105
+ animationRef.current?.stop();
106
+ if (openValue && openValue.id !== item.id) setOpenValue(null);
107
+ }, [
108
+ item.id,
109
+ openValue,
110
+ setOpenValue
111
+ ]);
112
+ const onDragEnd = useCallback((_, info) => {
113
+ const velocity = info.velocity.x;
114
+ const latest = x.get();
115
+ const leftOpenThreshold = Math.max(revealThreshold, leftWidth * OPEN_DISTANCE_RATIO);
116
+ const rightOpenThreshold = Math.max(revealThreshold, rightWidth * OPEN_DISTANCE_RATIO);
117
+ if (openSide === "left") {
118
+ if (latest < leftWidth * CLOSE_DISTANCE_RATIO || velocity < -320) {
119
+ snapTo(null, velocity);
120
+ return;
121
+ }
122
+ snapTo("left", velocity);
123
+ return;
124
+ }
125
+ if (openSide === "right") {
126
+ if (Math.abs(latest) < rightWidth * CLOSE_DISTANCE_RATIO || velocity > CLOSE_VELOCITY) {
127
+ snapTo(null, velocity);
128
+ return;
129
+ }
130
+ snapTo("right", velocity);
131
+ return;
132
+ }
133
+ if (isActionableSide(latest, leftWidth) && (latest > leftOpenThreshold || velocity > OPEN_VELOCITY && latest > FLING_DISTANCE)) {
134
+ snapTo("left", velocity);
135
+ return;
136
+ }
137
+ if (isActionableSide(latest, rightWidth) && (latest < -rightOpenThreshold || velocity < -720 && latest < -14)) {
138
+ snapTo("right", velocity);
139
+ return;
140
+ }
141
+ snapTo(null, velocity);
142
+ }, [
143
+ leftWidth,
144
+ openSide,
145
+ revealThreshold,
146
+ rightWidth,
147
+ snapTo,
148
+ x
149
+ ]);
150
+ const handleAction = useCallback((action, side) => {
151
+ action.onClick?.(item);
152
+ onAction?.({
153
+ item,
154
+ action,
155
+ side
156
+ });
157
+ if (closeOnAction) snapTo(null);
158
+ }, [
159
+ closeOnAction,
160
+ item,
161
+ onAction,
162
+ snapTo
163
+ ]);
164
+ const defaultContent = /* @__PURE__ */ jsxs("div", {
165
+ className: "flex min-w-0 items-center gap-3",
166
+ children: [
167
+ item.leading ? /* @__PURE__ */ jsx("div", {
168
+ className: cn("shrink-0", classNames?.leading),
169
+ children: item.leading
170
+ }) : null,
171
+ /* @__PURE__ */ jsxs("div", {
172
+ className: cn("min-w-0 flex-1", classNames?.content),
173
+ children: [item.title ? /* @__PURE__ */ jsx("div", {
174
+ className: cn("truncate font-medium text-foreground text-sm", classNames?.title),
175
+ children: item.title
176
+ }) : null, item.description ? /* @__PURE__ */ jsx("div", {
177
+ className: cn("mt-0.5 truncate text-muted-foreground text-xs", classNames?.description),
178
+ children: item.description
179
+ }) : null]
180
+ }),
181
+ item.meta ? /* @__PURE__ */ jsx("div", {
182
+ className: cn("shrink-0 font-medium text-muted-foreground text-xs", classNames?.meta),
183
+ children: item.meta
184
+ }) : null
185
+ ]
186
+ });
187
+ return /* @__PURE__ */ jsxs("div", {
188
+ className: cn("relative isolate overflow-hidden rounded-2xl bg-muted", item.disabled && "opacity-60", classNames?.item),
189
+ children: [/* @__PURE__ */ jsxs("div", {
190
+ "aria-hidden": !openSide,
191
+ inert: !openSide,
192
+ className: cn("absolute inset-0 z-0 flex overflow-hidden rounded-2xl", classNames?.rail),
193
+ children: [/* @__PURE__ */ jsx("div", {
194
+ className: "flex h-full overflow-hidden rounded-l-2xl",
195
+ children: leftActions.map((action) => /* @__PURE__ */ jsx(SwipeActionButton, {
196
+ action,
197
+ actionWidth,
198
+ className: classNames?.action,
199
+ focusable: openSide === "left",
200
+ onAction: handleAction,
201
+ side: "left"
202
+ }, action.id))
203
+ }), /* @__PURE__ */ jsx("div", {
204
+ className: "ml-auto flex h-full overflow-hidden rounded-r-2xl",
205
+ children: rightActions.map((action) => /* @__PURE__ */ jsx(SwipeActionButton, {
206
+ action,
207
+ actionWidth,
208
+ className: classNames?.action,
209
+ focusable: openSide === "right",
210
+ onAction: handleAction,
211
+ side: "right"
212
+ }, action.id))
213
+ })]
214
+ }), /* @__PURE__ */ jsx(motion.div, {
215
+ drag: item.disabled ? false : "x",
216
+ dragConstraints: {
217
+ left: -rightWidth,
218
+ right: leftWidth
219
+ },
220
+ dragElastic: .04,
221
+ dragMomentum: false,
222
+ onDragStart,
223
+ onDragEnd,
224
+ style: { x },
225
+ className: cn("relative z-10 min-h-[72px] cursor-grab touch-pan-y select-none rounded-2xl border border-border bg-card px-4 py-3 shadow-sm active:cursor-grabbing", classNames?.surface),
226
+ children: renderItem ? renderItem(item) : item.content ?? defaultContent
227
+ })]
228
+ });
229
+ }
230
+ function SwipeableList({ items, value, defaultValue = null, onValueChange, onAction, actionWidth = 56, revealThreshold = 34, closeOnAction = true, className, classNames, renderItem }) {
231
+ const [openValue, setOpenValue] = useControllableSwipeValue({
232
+ value,
233
+ defaultValue,
234
+ onValueChange
235
+ });
236
+ return /* @__PURE__ */ jsx("div", {
237
+ className: cn("flex w-full flex-col gap-2", className, classNames?.root),
238
+ children: items.map((item) => /* @__PURE__ */ jsx(SwipeableListRow, {
239
+ item,
240
+ actionWidth,
241
+ revealThreshold,
242
+ openValue,
243
+ setOpenValue,
244
+ closeOnAction,
245
+ onAction,
246
+ classNames,
247
+ renderItem
248
+ }, item.id))
249
+ });
250
+ }
251
+ //#endregion
252
+ export { SwipeableList };
253
+
254
+ //# sourceMappingURL=swipeable-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swipeable-list.js","names":[],"sources":["../../../src/components/motion/swipeable-list.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useCallback, useEffect, useRef, useState } from \"react\";\nimport { animate, motion, type PanInfo, useMotionValue, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\n\nexport type SwipeSide = \"left\" | \"right\";\n\nexport type SwipeableListValue = {\n id: string;\n side: SwipeSide;\n};\n\nexport type SwipeActionTone = \"neutral\" | \"primary\" | \"success\" | \"warning\" | \"danger\";\n\nexport type SwipeAction = {\n id: string;\n label: ReactNode;\n icon: ReactNode;\n tone?: SwipeActionTone;\n disabled?: boolean;\n onClick?: (item: SwipeableListItem) => void;\n};\n\nexport type SwipeableListItem = {\n id: string;\n title?: ReactNode;\n description?: ReactNode;\n meta?: ReactNode;\n leading?: ReactNode;\n content?: ReactNode;\n leftActions?: SwipeAction[];\n rightActions?: SwipeAction[];\n disabled?: boolean;\n};\n\nexport type SwipeableListClassNames = {\n root?: string;\n item?: string;\n rail?: string;\n action?: string;\n surface?: string;\n leading?: string;\n content?: string;\n title?: string;\n description?: string;\n meta?: string;\n};\n\nexport interface SwipeableListProps {\n items: SwipeableListItem[];\n value?: SwipeableListValue | null;\n defaultValue?: SwipeableListValue | null;\n onValueChange?: (value: SwipeableListValue | null) => void;\n onAction?: (payload: { item: SwipeableListItem; action: SwipeAction; side: SwipeSide }) => void;\n actionWidth?: number;\n revealThreshold?: number;\n closeOnAction?: boolean;\n className?: string;\n classNames?: SwipeableListClassNames;\n renderItem?: (item: SwipeableListItem) => ReactNode;\n}\n\n// Distance-based release spring keeps short rebounds and full reveals feeling\n// equally direct, closer to native mobile list interactions.\nconst ROW_SETTLE = {\n type: \"spring\",\n stiffness: 560,\n damping: 48,\n mass: 0.82,\n restDelta: 0.5,\n restSpeed: 8,\n} as const;\nconst OPEN_DISTANCE_RATIO = 0.46;\nconst CLOSE_DISTANCE_RATIO = 0.72;\nconst OPEN_VELOCITY = 720;\nconst CLOSE_VELOCITY = 320;\nconst FLING_DISTANCE = 14;\nconst RELEASE_VELOCITY_LIMIT = 1500;\n\nconst ACTION_TONE_CLASS: Record<SwipeActionTone, string> = {\n neutral: \"text-muted-foreground group-hover:text-foreground\",\n primary: \"text-foreground\",\n success: \"text-emerald-600 dark:text-emerald-400\",\n warning: \"text-amber-600 dark:text-amber-400\",\n danger: \"text-destructive\",\n};\n\nfunction useControllableSwipeValue({\n value,\n defaultValue,\n onValueChange,\n}: {\n value?: SwipeableListValue | null;\n defaultValue?: SwipeableListValue | null;\n onValueChange?: (value: SwipeableListValue | null) => void;\n}) {\n const [internalValue, setInternalValue] = useState(defaultValue ?? null);\n const isControlled = value !== undefined;\n const currentValue = value ?? internalValue;\n\n const setValue = useCallback(\n (next: SwipeableListValue | null) => {\n if (!isControlled) {\n setInternalValue(next);\n }\n\n onValueChange?.(next);\n },\n [isControlled, onValueChange],\n );\n\n return [currentValue, setValue] as const;\n}\n\nfunction isActionableSide(value: number, sideWidth: number) {\n return sideWidth > 0 && Math.abs(value) > 0;\n}\n\nfunction clampReleaseVelocity(velocity: number) {\n return Math.max(-RELEASE_VELOCITY_LIMIT, Math.min(RELEASE_VELOCITY_LIMIT, velocity));\n}\n\nfunction SwipeActionButton({\n action,\n actionWidth,\n side,\n focusable,\n onAction,\n className,\n}: {\n action: SwipeAction;\n actionWidth: number;\n side: SwipeSide;\n focusable: boolean;\n onAction: (action: SwipeAction, side: SwipeSide) => void;\n className?: string;\n}) {\n return (\n <button\n type=\"button\"\n disabled={action.disabled}\n tabIndex={focusable ? 0 : -1}\n aria-label={typeof action.label === \"string\" ? action.label : undefined}\n onClick={() => onAction(action, side)}\n className={cn(\n \"group flex h-full shrink-0 items-center justify-center outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n className,\n )}\n style={{ width: actionWidth }}\n >\n <span\n className={cn(\n \"grid h-9 w-9 place-items-center rounded-full transition-[background-color,color,transform] duration-150 group-hover:bg-background group-active:scale-95\",\n ACTION_TONE_CLASS[action.tone ?? \"neutral\"],\n )}\n >\n {action.icon}\n </span>\n <span className=\"sr-only\">{action.label}</span>\n </button>\n );\n}\n\nfunction SwipeableListRow({\n item,\n actionWidth,\n revealThreshold,\n openValue,\n setOpenValue,\n closeOnAction,\n onAction,\n classNames,\n renderItem,\n}: {\n item: SwipeableListItem;\n actionWidth: number;\n revealThreshold: number;\n openValue: SwipeableListValue | null;\n setOpenValue: (value: SwipeableListValue | null) => void;\n closeOnAction: boolean;\n onAction?: SwipeableListProps[\"onAction\"];\n classNames?: SwipeableListClassNames;\n renderItem?: (item: SwipeableListItem) => ReactNode;\n}) {\n const reduce = useReducedMotion();\n const x = useMotionValue(0);\n const animationRef = useRef<{ stop: () => void } | null>(null);\n const commandedTargetRef = useRef(0);\n const leftActions = item.leftActions ?? [];\n const rightActions = item.rightActions ?? [];\n const leftWidth = leftActions.length * actionWidth;\n const rightWidth = rightActions.length * actionWidth;\n const openSide = openValue?.id === item.id ? openValue.side : null;\n const targetX = openSide === \"left\" ? leftWidth : openSide === \"right\" ? -rightWidth : 0;\n\n const settleX = useCallback(\n (nextX: number, velocity = 0) => {\n commandedTargetRef.current = nextX;\n animationRef.current?.stop();\n\n if (reduce) {\n x.set(nextX);\n return;\n }\n\n animationRef.current = animate(x, nextX, {\n ...ROW_SETTLE,\n velocity: clampReleaseVelocity(velocity),\n onComplete: () => x.set(nextX),\n });\n },\n [reduce, x],\n );\n\n useEffect(() => {\n return () => animationRef.current?.stop();\n }, []);\n\n useEffect(() => {\n if (commandedTargetRef.current === targetX) {\n return;\n }\n\n settleX(targetX);\n }, [settleX, targetX]);\n\n const getTargetX = useCallback(\n (side: SwipeSide | null) => (side === \"left\" ? leftWidth : side === \"right\" ? -rightWidth : 0),\n [leftWidth, rightWidth],\n );\n\n const snapTo = useCallback(\n (side: SwipeSide | null, velocity = 0) => {\n setOpenValue(side ? { id: item.id, side } : null);\n settleX(getTargetX(side), velocity);\n },\n [getTargetX, item.id, setOpenValue, settleX],\n );\n\n const onDragStart = useCallback(() => {\n animationRef.current?.stop();\n\n if (openValue && openValue.id !== item.id) {\n setOpenValue(null);\n }\n }, [item.id, openValue, setOpenValue]);\n\n const onDragEnd = useCallback(\n (_: PointerEvent, info: PanInfo) => {\n const velocity = info.velocity.x;\n const latest = x.get();\n const leftOpenThreshold = Math.max(revealThreshold, leftWidth * OPEN_DISTANCE_RATIO);\n const rightOpenThreshold = Math.max(revealThreshold, rightWidth * OPEN_DISTANCE_RATIO);\n\n if (openSide === \"left\") {\n if (latest < leftWidth * CLOSE_DISTANCE_RATIO || velocity < -CLOSE_VELOCITY) {\n snapTo(null, velocity);\n return;\n }\n\n snapTo(\"left\", velocity);\n return;\n }\n\n if (openSide === \"right\") {\n if (Math.abs(latest) < rightWidth * CLOSE_DISTANCE_RATIO || velocity > CLOSE_VELOCITY) {\n snapTo(null, velocity);\n return;\n }\n\n snapTo(\"right\", velocity);\n return;\n }\n\n if (\n isActionableSide(latest, leftWidth) &&\n (latest > leftOpenThreshold || (velocity > OPEN_VELOCITY && latest > FLING_DISTANCE))\n ) {\n snapTo(\"left\", velocity);\n return;\n }\n\n if (\n isActionableSide(latest, rightWidth) &&\n (latest < -rightOpenThreshold || (velocity < -OPEN_VELOCITY && latest < -FLING_DISTANCE))\n ) {\n snapTo(\"right\", velocity);\n return;\n }\n\n snapTo(null, velocity);\n },\n [leftWidth, openSide, revealThreshold, rightWidth, snapTo, x],\n );\n\n const handleAction = useCallback(\n (action: SwipeAction, side: SwipeSide) => {\n action.onClick?.(item);\n onAction?.({ item, action, side });\n\n if (closeOnAction) {\n snapTo(null);\n }\n },\n [closeOnAction, item, onAction, snapTo],\n );\n\n const defaultContent = (\n <div className=\"flex min-w-0 items-center gap-3\">\n {item.leading ? (\n <div className={cn(\"shrink-0\", classNames?.leading)}>{item.leading}</div>\n ) : null}\n <div className={cn(\"min-w-0 flex-1\", classNames?.content)}>\n {item.title ? (\n <div className={cn(\"truncate font-medium text-foreground text-sm\", classNames?.title)}>\n {item.title}\n </div>\n ) : null}\n {item.description ? (\n <div\n className={cn(\"mt-0.5 truncate text-muted-foreground text-xs\", classNames?.description)}\n >\n {item.description}\n </div>\n ) : null}\n </div>\n {item.meta ? (\n <div className={cn(\"shrink-0 font-medium text-muted-foreground text-xs\", classNames?.meta)}>\n {item.meta}\n </div>\n ) : null}\n </div>\n );\n\n return (\n <div\n className={cn(\n \"relative isolate overflow-hidden rounded-2xl bg-muted\",\n item.disabled && \"opacity-60\",\n classNames?.item,\n )}\n >\n <div\n aria-hidden={!openSide}\n inert={!openSide}\n className={cn(\"absolute inset-0 z-0 flex overflow-hidden rounded-2xl\", classNames?.rail)}\n >\n <div className=\"flex h-full overflow-hidden rounded-l-2xl\">\n {leftActions.map((action) => (\n <SwipeActionButton\n key={action.id}\n action={action}\n actionWidth={actionWidth}\n className={classNames?.action}\n focusable={openSide === \"left\"}\n onAction={handleAction}\n side=\"left\"\n />\n ))}\n </div>\n <div className=\"ml-auto flex h-full overflow-hidden rounded-r-2xl\">\n {rightActions.map((action) => (\n <SwipeActionButton\n key={action.id}\n action={action}\n actionWidth={actionWidth}\n className={classNames?.action}\n focusable={openSide === \"right\"}\n onAction={handleAction}\n side=\"right\"\n />\n ))}\n </div>\n </div>\n\n <motion.div\n drag={item.disabled ? false : \"x\"}\n dragConstraints={{ left: -rightWidth, right: leftWidth }}\n dragElastic={0.04}\n dragMomentum={false}\n onDragStart={onDragStart}\n onDragEnd={onDragEnd}\n style={{ x }}\n className={cn(\n \"relative z-10 min-h-[72px] cursor-grab touch-pan-y select-none rounded-2xl border border-border bg-card px-4 py-3 shadow-sm active:cursor-grabbing\",\n classNames?.surface,\n )}\n >\n {renderItem ? renderItem(item) : (item.content ?? defaultContent)}\n </motion.div>\n </div>\n );\n}\n\nexport function SwipeableList({\n items,\n value,\n defaultValue = null,\n onValueChange,\n onAction,\n actionWidth = 56,\n revealThreshold = 34,\n closeOnAction = true,\n className,\n classNames,\n renderItem,\n}: SwipeableListProps) {\n const [openValue, setOpenValue] = useControllableSwipeValue({\n value,\n defaultValue,\n onValueChange,\n });\n\n return (\n <div className={cn(\"flex w-full flex-col gap-2\", className, classNames?.root)}>\n {items.map((item) => (\n <SwipeableListRow\n key={item.id}\n item={item}\n actionWidth={actionWidth}\n revealThreshold={revealThreshold}\n openValue={openValue}\n setOpenValue={setOpenValue}\n closeOnAction={closeOnAction}\n onAction={onAction}\n classNames={classNames}\n renderItem={renderItem}\n />\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;AAkEA,MAAM,aAAa;CACjB,MAAM;CACN,WAAW;CACX,SAAS;CACT,MAAM;CACN,WAAW;CACX,WAAW;AACb;AACA,MAAM,sBAAsB;AAC5B,MAAM,uBAAuB;AAC7B,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;AACvB,MAAM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A,YACA,cACqB;CACrB,MAAM,CAAC,WAAW,gBAAgB,0BAA0B;EAC1D;EACA;EACA;CACF,CAAC;CAED,OACE,oBAAC,OAAD;EAAK,WAAW,GAAG,8BAA8B,WAAW,YAAY,IAAI;EACzE,UAAA,MAAM,KAAK,SACV,oBAAC,kBAAD;GAEQ;GACO;GACI;GACN;GACG;GACC;GACL;GACE;GACA;EACb,GAVM,KAAK,EAUX,CACF;CACE,CAAA;AAET"}
@@ -0,0 +1,13 @@
1
+ //#region src/components/motion/switch.d.ts
2
+ interface SwitchProps {
3
+ checked: boolean;
4
+ onCheckedChange: (checked: boolean) => void;
5
+ disabled?: boolean;
6
+ label?: string;
7
+ ariaLabel?: string;
8
+ className?: string;
9
+ }
10
+ declare function Switch({ checked, onCheckedChange, disabled, label, ariaLabel, className }: SwitchProps): import("react").JSX.Element;
11
+ //#endregion
12
+ export { Switch, SwitchProps };
13
+ //# sourceMappingURL=switch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.d.ts","names":[],"sources":["../../../src/components/motion/switch.tsx"],"mappings":";UAUiB;EACf;EACA,kBAAkB;EAClB;EACA;EACA;EACA;;iBAGc,SACd,SACA,iBACA,UACA,OACA,WACA,aACC,8BAAW,IAAA"}
@@ -0,0 +1,76 @@
1
+ "use client";
2
+ import { useEffect, useId, useRef, useState } from "react";
3
+ import { cn } from "@kumix/utils";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { MotionConfig, animate, motion, useReducedMotion } from "motion/react";
6
+ //#region src/components/motion/switch.tsx
7
+ const THUMB_SPRING = {
8
+ type: "spring",
9
+ stiffness: 800,
10
+ damping: 80,
11
+ mass: 4
12
+ };
13
+ function Switch({ checked, onCheckedChange, disabled, label, ariaLabel, className }) {
14
+ const id = useId();
15
+ const thumbRef = useRef(null);
16
+ const reduce = useReducedMotion();
17
+ const [isPressed, setIsPressed] = useState(false);
18
+ const [isPointer, setIsPointer] = useState(false);
19
+ useEffect(() => {
20
+ if (!thumbRef.current || reduce) return;
21
+ if (disabled && isPressed) animate(thumbRef.current, { x: [
22
+ 0,
23
+ -2,
24
+ 2,
25
+ -1,
26
+ 0
27
+ ] }, {
28
+ delay: .2,
29
+ duration: .6
30
+ });
31
+ }, [
32
+ disabled,
33
+ isPressed,
34
+ reduce
35
+ ]);
36
+ const squish = !disabled && isPointer && isPressed && !reduce;
37
+ return /* @__PURE__ */ jsx(MotionConfig, {
38
+ transition: reduce ? { duration: 0 } : THUMB_SPRING,
39
+ children: /* @__PURE__ */ jsxs("span", {
40
+ className: cn("inline-flex items-center gap-3", className),
41
+ children: [/* @__PURE__ */ jsx(motion.button, {
42
+ id,
43
+ type: "button",
44
+ role: "switch",
45
+ "aria-checked": checked,
46
+ "aria-label": ariaLabel,
47
+ disabled,
48
+ onClick: () => !disabled && onCheckedChange(!checked),
49
+ onPointerDown: (e) => {
50
+ setIsPressed(true);
51
+ setIsPointer(e.type.startsWith("pointer"));
52
+ },
53
+ onPointerUp: () => setIsPressed(false),
54
+ onPointerLeave: () => setIsPressed(false),
55
+ initial: false,
56
+ "data-state": checked ? "checked" : "unchecked",
57
+ className: cn("group peer inline-flex h-7 w-12 shrink-0 cursor-pointer items-center rounded-full px-1 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", checked ? "justify-end bg-primary" : "justify-start bg-muted-foreground/60"),
58
+ children: /* @__PURE__ */ jsx(motion.div, {
59
+ ref: thumbRef,
60
+ layout: true,
61
+ animate: { scale: squish ? .9 : 1 },
62
+ className: "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-md",
63
+ children: /* @__PURE__ */ jsx("div", { className: cn("size-5", squish && (checked ? "ml-1" : "mr-1")) })
64
+ })
65
+ }), label ? /* @__PURE__ */ jsx("label", {
66
+ htmlFor: id,
67
+ className: "cursor-pointer text-foreground text-sm",
68
+ children: label
69
+ }) : null]
70
+ })
71
+ });
72
+ }
73
+ //#endregion
74
+ export { Switch };
75
+
76
+ //# sourceMappingURL=switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.js","names":[],"sources":["../../../src/components/motion/switch.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useId, useRef, useState } from \"react\";\nimport { animate, MotionConfig, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\n\n// Heavy, deliberate thumb — high mass keeps the travel weighty without wobble.\nconst THUMB_SPRING = { type: \"spring\", stiffness: 800, damping: 80, mass: 4 } as const;\n\nexport interface SwitchProps {\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n disabled?: boolean;\n label?: string;\n ariaLabel?: string;\n className?: string;\n}\n\nexport function Switch({\n checked,\n onCheckedChange,\n disabled,\n label,\n ariaLabel,\n className,\n}: SwitchProps) {\n const id = useId();\n const thumbRef = useRef<HTMLDivElement>(null);\n const reduce = useReducedMotion();\n const [isPressed, setIsPressed] = useState(false);\n const [isPointer, setIsPointer] = useState(false);\n\n // Disabled shake feedback when pressed.\n useEffect(() => {\n if (!thumbRef.current || reduce) return;\n if (disabled && isPressed) {\n animate(thumbRef.current, { x: [0, -2, 2, -1, 0] }, { delay: 0.2, duration: 0.6 });\n }\n }, [disabled, isPressed, reduce]);\n\n const squish = !disabled && isPointer && isPressed && !reduce;\n\n return (\n <MotionConfig transition={reduce ? { duration: 0 } : THUMB_SPRING}>\n <span className={cn(\"inline-flex items-center gap-3\", className)}>\n <motion.button\n id={id}\n type=\"button\"\n role=\"switch\"\n aria-checked={checked}\n aria-label={ariaLabel}\n disabled={disabled}\n onClick={() => !disabled && onCheckedChange(!checked)}\n onPointerDown={(e) => {\n setIsPressed(true);\n setIsPointer(e.type.startsWith(\"pointer\"));\n }}\n onPointerUp={() => setIsPressed(false)}\n onPointerLeave={() => setIsPressed(false)}\n initial={false}\n data-state={checked ? \"checked\" : \"unchecked\"}\n className={cn(\n \"group peer inline-flex h-7 w-12 shrink-0 cursor-pointer items-center rounded-full px-1 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 checked ? \"justify-end bg-primary\" : \"justify-start bg-muted-foreground/60\",\n )}\n >\n <motion.div\n ref={thumbRef}\n layout\n animate={{ scale: squish ? 0.9 : 1 }}\n className=\"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-md\"\n >\n {/* Stretch toward the destination while active. */}\n <div className={cn(\"size-5\", squish && (checked ? \"ml-1\" : \"mr-1\"))} />\n </motion.div>\n </motion.button>\n {label ? (\n <label htmlFor={id} className=\"cursor-pointer text-foreground text-sm\">\n {label}\n </label>\n ) : null}\n </span>\n </MotionConfig>\n );\n}\n"],"mappings":";;;;;;AAQA,MAAM,eAAe;CAAE,MAAM;CAAU,WAAW;CAAK,SAAS;CAAI,MAAM;AAAE;AAW5E,SAAgB,OAAO,EACrB,SACA,iBACA,UACA,OACA,WACA,aACc;CACd,MAAM,KAAK,MAAM;CACjB,MAAM,WAAW,OAAuB,IAAI;CAC5C,MAAM,SAAS,iBAAiB;CAChC,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;CAChD,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;CAGhD,gBAAgB;EACd,IAAI,CAAC,SAAS,WAAW,QAAQ;EACjC,IAAI,YAAY,WACd,QAAQ,SAAS,SAAS,EAAE,GAAG;GAAC;GAAG;GAAI;GAAG;GAAI;EAAC,EAAE,GAAG;GAAE,OAAO;GAAK,UAAU;EAAI,CAAC;CAErF,GAAG;EAAC;EAAU;EAAW;CAAM,CAAC;CAEhC,MAAM,SAAS,CAAC,YAAY,aAAa,aAAa,CAAC;CAEvD,OACE,oBAAC,cAAD;EAAc,YAAY,SAAS,EAAE,UAAU,EAAE,IAAI;EACnD,UAAA,qBAAC,QAAD;GAAM,WAAW,GAAG,kCAAkC,SAAS;GAA/D,UAAA,CACE,oBAAC,OAAO,QAAR;IACM;IACJ,MAAK;IACL,MAAK;IACL,gBAAc;IACd,cAAY;IACF;IACV,eAAe,CAAC,YAAY,gBAAgB,CAAC,OAAO;IACpD,gBAAgB,MAAM;KACpB,aAAa,IAAI;KACjB,aAAa,EAAE,KAAK,WAAW,SAAS,CAAC;IAC3C;IACA,mBAAmB,aAAa,KAAK;IACrC,sBAAsB,aAAa,KAAK;IACxC,SAAS;IACT,cAAY,UAAU,YAAY;IAClC,WAAW,GACT,sIACA,iHACA,mDACA,UAAU,2BAA2B,sCACvC;IAEA,UAAA,oBAAC,OAAO,KAAR;KACE,KAAK;KACL,QAAA;KACA,SAAS,EAAE,OAAO,SAAS,KAAM,EAAE;KACnC,WAAU;KAGV,UAAA,oBAAC,OAAD,EAAK,WAAW,GAAG,UAAU,WAAW,UAAU,SAAS,OAAO,EAAI,CAAA;IAC5D,CAAA;GACC,CAAA,GACd,QACC,oBAAC,SAAD;IAAO,SAAS;IAAI,WAAU;IAC3B,UAAA;GACI,CAAA,IACL,IACA;;CACM,CAAA;AAElB"}
@@ -0,0 +1,9 @@
1
+ //#region src/components/motion/table/editable-cell.d.ts
2
+ declare function EditableCell({ value, label, onChange }: {
3
+ value: string;
4
+ label: string;
5
+ onChange: (next: string) => void;
6
+ }): import("react").JSX.Element;
7
+ //#endregion
8
+ export { EditableCell };
9
+ //# sourceMappingURL=editable-cell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editable-cell.d.ts","names":[],"sources":["../../../../src/components/motion/table/editable-cell.tsx"],"mappings":";iBAEgB,eACd,OACA,OACA;EAEA;EACA;EACA,WAAW;oBACZ,IAAA"}
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/motion/table/editable-cell.tsx
4
+ function EditableCell({ value, label, onChange }) {
5
+ return /* @__PURE__ */ jsx("input", {
6
+ value,
7
+ "aria-label": label,
8
+ size: 1,
9
+ onChange: (e) => onChange(e.target.value),
10
+ placeholder: "Empty",
11
+ className: "-mx-2 w-full min-w-0 appearance-none rounded-md border-0 bg-transparent px-2 py-1 text-foreground outline-none transition-colors placeholder:text-muted-foreground/40 focus:bg-muted focus:ring-1 focus:ring-ring"
12
+ });
13
+ }
14
+ //#endregion
15
+ export { EditableCell };
16
+
17
+ //# sourceMappingURL=editable-cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editable-cell.js","names":[],"sources":["../../../../src/components/motion/table/editable-cell.tsx"],"sourcesContent":["\"use client\";\n\nexport function EditableCell({\n value,\n label,\n onChange,\n}: {\n value: string;\n label: string;\n onChange: (next: string) => void;\n}) {\n return (\n <input\n value={value}\n aria-label={label}\n size={1}\n onChange={(e) => onChange(e.target.value)}\n placeholder=\"Empty\"\n className=\"-mx-2 w-full min-w-0 appearance-none rounded-md border-0 bg-transparent px-2 py-1 text-foreground outline-none transition-colors placeholder:text-muted-foreground/40 focus:bg-muted focus:ring-1 focus:ring-ring\"\n />\n );\n}\n"],"mappings":";;;AAEA,SAAgB,aAAa,EAC3B,OACA,OACA,YAKC;CACD,OACE,oBAAC,SAAD;EACS;EACP,cAAY;EACZ,MAAM;EACN,WAAW,MAAM,SAAS,EAAE,OAAO,KAAK;EACxC,aAAY;EACZ,WAAU;CACX,CAAA;AAEL"}
@@ -0,0 +1,6 @@
1
+ import { a as TableColumn, i as SortState, o as TableProps, r as SortDirection } from "../../../types-Bah5NY44.js";
2
+ //#region src/components/motion/table/index.d.ts
3
+ declare function Table<T>({ data, columns, getRowId, selectable, selectedRowIds, defaultSelectedRowIds, onSelectionChange, sort: sortProp, defaultSort, onSortChange, resizable, minColumnWidth, onColumnResize, reorderable, onColumnOrderChange, onCellEdit, onColumnRename, onInsertRow, onDeleteRow, onInsertColumn, onDeleteColumn, rowHeight, height, overscan, onEndReached, loading, skeletonRows, emptyState, className }: TableProps<T>): import("react").JSX.Element;
4
+ //#endregion
5
+ export { type SortDirection, type SortState, Table, type TableColumn, type TableProps };
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/components/motion/table/index.tsx"],"mappings":";;iBA0BgB,MAAM,KACpB,MACA,SACA,UACA,YACA,gBACA,uBACA,mBACA,MAAM,UACN,aACA,cACA,WACA,gBACA,gBACA,aACA,qBACA,YACA,gBACA,aACA,aACA,gBACA,gBACA,WACA,QACA,UACA,cACA,SACA,cACA,YACA,aACC,WAAW,qBAAE,IAAA"}