@kumix/ui 0.2.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/README.md +32 -10
  2. package/dist/components/motion/action-swap-blur.d.ts +11 -0
  3. package/dist/components/motion/action-swap-blur.d.ts.map +1 -0
  4. package/dist/components/motion/action-swap-blur.js +26 -0
  5. package/dist/components/motion/action-swap-blur.js.map +1 -0
  6. package/dist/components/motion/action-swap-cascade.d.ts +11 -0
  7. package/dist/components/motion/action-swap-cascade.d.ts.map +1 -0
  8. package/dist/components/motion/action-swap-cascade.js +26 -0
  9. package/dist/components/motion/action-swap-cascade.js.map +1 -0
  10. package/dist/components/motion/action-swap-roll.d.ts +11 -0
  11. package/dist/components/motion/action-swap-roll.d.ts.map +1 -0
  12. package/dist/components/motion/action-swap-roll.js +26 -0
  13. package/dist/components/motion/action-swap-roll.js.map +1 -0
  14. package/dist/components/motion/action-swap.d.ts +41 -0
  15. package/dist/components/motion/action-swap.d.ts.map +1 -0
  16. package/dist/components/motion/action-swap.js +261 -0
  17. package/dist/components/motion/action-swap.js.map +1 -0
  18. package/dist/components/motion/animated-badge.d.ts +18 -0
  19. package/dist/components/motion/animated-badge.d.ts.map +1 -0
  20. package/dist/components/motion/animated-badge.js +206 -0
  21. package/dist/components/motion/animated-badge.js.map +1 -0
  22. package/dist/components/motion/animated-number.d.ts +12 -0
  23. package/dist/components/motion/animated-number.d.ts.map +1 -0
  24. package/dist/components/motion/animated-number.js +47 -0
  25. package/dist/components/motion/animated-number.js.map +1 -0
  26. package/dist/components/motion/animated-sidebar.d.ts +97 -0
  27. package/dist/components/motion/animated-sidebar.d.ts.map +1 -0
  28. package/dist/components/motion/animated-sidebar.js +611 -0
  29. package/dist/components/motion/animated-sidebar.js.map +1 -0
  30. package/dist/components/motion/animated-toast-stack.d.ts +65 -0
  31. package/dist/components/motion/animated-toast-stack.d.ts.map +1 -0
  32. package/dist/components/motion/animated-toast-stack.js +303 -0
  33. package/dist/components/motion/animated-toast-stack.js.map +1 -0
  34. package/dist/components/motion/bottom-sheet.d.ts +19 -0
  35. package/dist/components/motion/bottom-sheet.d.ts.map +1 -0
  36. package/dist/components/motion/bottom-sheet.js +146 -0
  37. package/dist/components/motion/bottom-sheet.js.map +1 -0
  38. package/dist/components/motion/bounce-sidebar.d.ts +26 -0
  39. package/dist/components/motion/bounce-sidebar.d.ts.map +1 -0
  40. package/dist/components/motion/bounce-sidebar.js +164 -0
  41. package/dist/components/motion/bounce-sidebar.js.map +1 -0
  42. package/dist/components/motion/bouncy-accordion.d.ts +32 -0
  43. package/dist/components/motion/bouncy-accordion.d.ts.map +1 -0
  44. package/dist/components/motion/bouncy-accordion.js +172 -0
  45. package/dist/components/motion/bouncy-accordion.js.map +1 -0
  46. package/dist/components/motion/button/base.d.ts +17 -0
  47. package/dist/components/motion/button/base.d.ts.map +1 -0
  48. package/dist/components/motion/button/base.js +86 -0
  49. package/dist/components/motion/button/base.js.map +1 -0
  50. package/dist/components/motion/button/magnetic.d.ts +12 -0
  51. package/dist/components/motion/button/magnetic.d.ts.map +1 -0
  52. package/dist/components/motion/button/magnetic.js +21 -0
  53. package/dist/components/motion/button/magnetic.js.map +1 -0
  54. package/dist/components/motion/button/stateful.d.ts +16 -0
  55. package/dist/components/motion/button/stateful.d.ts.map +1 -0
  56. package/dist/components/motion/button/stateful.js +190 -0
  57. package/dist/components/motion/button/stateful.js.map +1 -0
  58. package/dist/components/motion/center-morph-modal.d.ts +43 -0
  59. package/dist/components/motion/center-morph-modal.d.ts.map +1 -0
  60. package/dist/components/motion/center-morph-modal.js +238 -0
  61. package/dist/components/motion/center-morph-modal.js.map +1 -0
  62. package/dist/components/motion/checkbox.d.ts +15 -0
  63. package/dist/components/motion/checkbox.d.ts.map +1 -0
  64. package/dist/components/motion/checkbox.js +81 -0
  65. package/dist/components/motion/checkbox.js.map +1 -0
  66. package/dist/components/motion/chromatic-text-reveal.d.ts +31 -0
  67. package/dist/components/motion/chromatic-text-reveal.d.ts.map +1 -0
  68. package/dist/components/motion/chromatic-text-reveal.js +132 -0
  69. package/dist/components/motion/chromatic-text-reveal.js.map +1 -0
  70. package/dist/components/motion/context-menu.d.ts +71 -0
  71. package/dist/components/motion/context-menu.d.ts.map +1 -0
  72. package/dist/components/motion/context-menu.js +454 -0
  73. package/dist/components/motion/context-menu.js.map +1 -0
  74. package/dist/components/motion/cylinder-carousel.d.ts +40 -0
  75. package/dist/components/motion/cylinder-carousel.d.ts.map +1 -0
  76. package/dist/components/motion/cylinder-carousel.js +274 -0
  77. package/dist/components/motion/cylinder-carousel.js.map +1 -0
  78. package/dist/components/motion/dock.d.ts +24 -0
  79. package/dist/components/motion/dock.d.ts.map +1 -0
  80. package/dist/components/motion/dock.js +62 -0
  81. package/dist/components/motion/dock.js.map +1 -0
  82. package/dist/components/motion/drawer.d.ts +19 -0
  83. package/dist/components/motion/drawer.d.ts.map +1 -0
  84. package/dist/components/motion/drawer.js +58 -0
  85. package/dist/components/motion/drawer.js.map +1 -0
  86. package/dist/components/motion/hold-action-button.d.ts +17 -0
  87. package/dist/components/motion/hold-action-button.d.ts.map +1 -0
  88. package/dist/components/motion/hold-action-button.js +158 -0
  89. package/dist/components/motion/hold-action-button.js.map +1 -0
  90. package/dist/components/motion/input.d.ts +29 -0
  91. package/dist/components/motion/input.d.ts.map +1 -0
  92. package/dist/components/motion/input.js +126 -0
  93. package/dist/components/motion/input.js.map +1 -0
  94. package/dist/components/motion/loader.d.ts +17 -0
  95. package/dist/components/motion/loader.d.ts.map +1 -0
  96. package/dist/components/motion/loader.js +791 -0
  97. package/dist/components/motion/loader.js.map +1 -0
  98. package/dist/components/motion/magnetic.d.ts +11 -0
  99. package/dist/components/motion/magnetic.d.ts.map +1 -0
  100. package/dist/components/motion/magnetic.js +44 -0
  101. package/dist/components/motion/magnetic.js.map +1 -0
  102. package/dist/components/motion/marquee.d.ts +15 -0
  103. package/dist/components/motion/marquee.d.ts.map +1 -0
  104. package/dist/components/motion/marquee.js +35 -0
  105. package/dist/components/motion/marquee.js.map +1 -0
  106. package/dist/components/motion/morphing-modal.d.ts +15 -0
  107. package/dist/components/motion/morphing-modal.d.ts.map +1 -0
  108. package/dist/components/motion/morphing-modal.js +117 -0
  109. package/dist/components/motion/morphing-modal.js.map +1 -0
  110. package/dist/components/motion/number-ticker.d.ts +26 -0
  111. package/dist/components/motion/number-ticker.d.ts.map +1 -0
  112. package/dist/components/motion/number-ticker.js +129 -0
  113. package/dist/components/motion/number-ticker.js.map +1 -0
  114. package/dist/components/motion/parallax.d.ts +21 -0
  115. package/dist/components/motion/parallax.d.ts.map +1 -0
  116. package/dist/components/motion/parallax.js +35 -0
  117. package/dist/components/motion/parallax.js.map +1 -0
  118. package/dist/components/motion/popover-morph.d.ts +38 -0
  119. package/dist/components/motion/popover-morph.d.ts.map +1 -0
  120. package/dist/components/motion/popover-morph.js +167 -0
  121. package/dist/components/motion/popover-morph.js.map +1 -0
  122. package/dist/components/motion/popover.d.ts +40 -0
  123. package/dist/components/motion/popover.d.ts.map +1 -0
  124. package/dist/components/motion/popover.js +393 -0
  125. package/dist/components/motion/popover.js.map +1 -0
  126. package/dist/components/motion/preview-rail.d.ts +26 -0
  127. package/dist/components/motion/preview-rail.d.ts.map +1 -0
  128. package/dist/components/motion/preview-rail.js +134 -0
  129. package/dist/components/motion/preview-rail.js.map +1 -0
  130. package/dist/components/motion/pull-to-refresh.d.ts +28 -0
  131. package/dist/components/motion/pull-to-refresh.d.ts.map +1 -0
  132. package/dist/components/motion/pull-to-refresh.js +389 -0
  133. package/dist/components/motion/pull-to-refresh.js.map +1 -0
  134. package/dist/components/motion/radio.d.ts +22 -0
  135. package/dist/components/motion/radio.d.ts.map +1 -0
  136. package/dist/components/motion/radio.js +79 -0
  137. package/dist/components/motion/radio.js.map +1 -0
  138. package/dist/components/motion/range-slider-bubble.d.ts +16 -0
  139. package/dist/components/motion/range-slider-bubble.d.ts.map +1 -0
  140. package/dist/components/motion/range-slider-bubble.js +117 -0
  141. package/dist/components/motion/range-slider-bubble.js.map +1 -0
  142. package/dist/components/motion/range-slider-fluid.d.ts +18 -0
  143. package/dist/components/motion/range-slider-fluid.d.ts.map +1 -0
  144. package/dist/components/motion/range-slider-fluid.js +63 -0
  145. package/dist/components/motion/range-slider-fluid.js.map +1 -0
  146. package/dist/components/motion/range-slider-ruler.d.ts +19 -0
  147. package/dist/components/motion/range-slider-ruler.d.ts.map +1 -0
  148. package/dist/components/motion/range-slider-ruler.js +142 -0
  149. package/dist/components/motion/range-slider-ruler.js.map +1 -0
  150. package/dist/components/motion/range-slider-wave.d.ts +16 -0
  151. package/dist/components/motion/range-slider-wave.d.ts.map +1 -0
  152. package/dist/components/motion/range-slider-wave.js +57 -0
  153. package/dist/components/motion/range-slider-wave.js.map +1 -0
  154. package/dist/components/motion/range-slider.d.ts +11 -0
  155. package/dist/components/motion/range-slider.d.ts.map +1 -0
  156. package/dist/components/motion/range-slider.js +63 -0
  157. package/dist/components/motion/range-slider.js.map +1 -0
  158. package/dist/components/motion/scroll-progress.d.ts +29 -0
  159. package/dist/components/motion/scroll-progress.d.ts.map +1 -0
  160. package/dist/components/motion/scroll-progress.js +71 -0
  161. package/dist/components/motion/scroll-progress.js.map +1 -0
  162. package/dist/components/motion/scroll-reveal.d.ts +23 -0
  163. package/dist/components/motion/scroll-reveal.d.ts.map +1 -0
  164. package/dist/components/motion/scroll-reveal.js +42 -0
  165. package/dist/components/motion/scroll-reveal.js.map +1 -0
  166. package/dist/components/motion/scroll-to.d.ts +21 -0
  167. package/dist/components/motion/scroll-to.d.ts.map +1 -0
  168. package/dist/components/motion/scroll-to.js +27 -0
  169. package/dist/components/motion/scroll-to.js.map +1 -0
  170. package/dist/components/motion/select-morph.d.ts +41 -0
  171. package/dist/components/motion/select-morph.d.ts.map +1 -0
  172. package/dist/components/motion/select-morph.js +251 -0
  173. package/dist/components/motion/select-morph.js.map +1 -0
  174. package/dist/components/motion/select.d.ts +36 -0
  175. package/dist/components/motion/select.d.ts.map +1 -0
  176. package/dist/components/motion/select.js +319 -0
  177. package/dist/components/motion/select.js.map +1 -0
  178. package/dist/components/motion/shader-background.d.ts +38 -0
  179. package/dist/components/motion/shader-background.d.ts.map +1 -0
  180. package/dist/components/motion/shader-background.js +49 -0
  181. package/dist/components/motion/shader-background.js.map +1 -0
  182. package/dist/components/motion/shared-layout-bg.d.ts +17 -0
  183. package/dist/components/motion/shared-layout-bg.d.ts.map +1 -0
  184. package/dist/components/motion/shared-layout-bg.js +88 -0
  185. package/dist/components/motion/shared-layout-bg.js.map +1 -0
  186. package/dist/components/motion/slide-action-button.d.ts +15 -0
  187. package/dist/components/motion/slide-action-button.d.ts.map +1 -0
  188. package/dist/components/motion/slide-action-button.js +146 -0
  189. package/dist/components/motion/slide-action-button.js.map +1 -0
  190. package/dist/components/motion/smooth-scroll.d.ts +47 -0
  191. package/dist/components/motion/smooth-scroll.d.ts.map +1 -0
  192. package/dist/components/motion/smooth-scroll.js +182 -0
  193. package/dist/components/motion/smooth-scroll.js.map +1 -0
  194. package/dist/components/motion/switch.d.ts +13 -0
  195. package/dist/components/motion/switch.d.ts.map +1 -0
  196. package/dist/components/motion/switch.js +76 -0
  197. package/dist/components/motion/switch.js.map +1 -0
  198. package/dist/components/motion/table/editable-cell.d.ts +9 -0
  199. package/dist/components/motion/table/editable-cell.d.ts.map +1 -0
  200. package/dist/components/motion/table/editable-cell.js +17 -0
  201. package/dist/components/motion/table/editable-cell.js.map +1 -0
  202. package/dist/components/motion/table/index.d.ts +6 -0
  203. package/dist/components/motion/table/index.d.ts.map +1 -0
  204. package/dist/components/motion/table/index.js +420 -0
  205. package/dist/components/motion/table/index.js.map +1 -0
  206. package/dist/components/motion/table/row-handle.d.ts +15 -0
  207. package/dist/components/motion/table/row-handle.d.ts.map +1 -0
  208. package/dist/components/motion/table/row-handle.js +51 -0
  209. package/dist/components/motion/table/row-handle.js.map +1 -0
  210. package/dist/components/motion/table/skeleton-rows.d.ts +11 -0
  211. package/dist/components/motion/table/skeleton-rows.d.ts.map +1 -0
  212. package/dist/components/motion/table/skeleton-rows.js +23 -0
  213. package/dist/components/motion/table/skeleton-rows.js.map +1 -0
  214. package/dist/components/motion/table/table-header.d.ts +35 -0
  215. package/dist/components/motion/table/table-header.d.ts.map +1 -0
  216. package/dist/components/motion/table/table-header.js +167 -0
  217. package/dist/components/motion/table/table-header.js.map +1 -0
  218. package/dist/components/motion/table/table-menu.d.ts +17 -0
  219. package/dist/components/motion/table/table-menu.d.ts.map +1 -0
  220. package/dist/components/motion/table/table-menu.js +92 -0
  221. package/dist/components/motion/table/table-menu.js.map +1 -0
  222. package/dist/components/motion/tabs.d.ts +29 -0
  223. package/dist/components/motion/tabs.d.ts.map +1 -0
  224. package/dist/components/motion/tabs.js +125 -0
  225. package/dist/components/motion/tabs.js.map +1 -0
  226. package/dist/components/motion/text-cascade.d.ts +15 -0
  227. package/dist/components/motion/text-cascade.d.ts.map +1 -0
  228. package/dist/components/motion/text-cascade.js +21 -0
  229. package/dist/components/motion/text-cascade.js.map +1 -0
  230. package/dist/components/motion/text-reveal.d.ts +25 -0
  231. package/dist/components/motion/text-reveal.d.ts.map +1 -0
  232. package/dist/components/motion/text-reveal.js +94 -0
  233. package/dist/components/motion/text-reveal.js.map +1 -0
  234. package/dist/components/motion/text-shimmer.d.ts +12 -0
  235. package/dist/components/motion/text-shimmer.d.ts.map +1 -0
  236. package/dist/components/motion/text-shimmer.js +15 -0
  237. package/dist/components/motion/text-shimmer.js.map +1 -0
  238. package/dist/components/motion/theme-toggle.d.ts +23 -0
  239. package/dist/components/motion/theme-toggle.d.ts.map +1 -0
  240. package/dist/components/motion/theme-toggle.js +160 -0
  241. package/dist/components/motion/theme-toggle.js.map +1 -0
  242. package/dist/components/motion/tilt-card.d.ts +12 -0
  243. package/dist/components/motion/tilt-card.d.ts.map +1 -0
  244. package/dist/components/motion/tilt-card.js +56 -0
  245. package/dist/components/motion/tilt-card.js.map +1 -0
  246. package/dist/components/motion/tooltip.d.ts +17 -0
  247. package/dist/components/motion/tooltip.d.ts.map +1 -0
  248. package/dist/components/motion/tooltip.js +194 -0
  249. package/dist/components/motion/tooltip.js.map +1 -0
  250. package/dist/components/motion/wheel-picker.d.ts +24 -0
  251. package/dist/components/motion/wheel-picker.d.ts.map +1 -0
  252. package/dist/components/motion/wheel-picker.js +442 -0
  253. package/dist/components/motion/wheel-picker.js.map +1 -0
  254. package/dist/components/reui/alert.d.ts +1 -1
  255. package/dist/components/reui/alert.js +1 -1
  256. package/dist/components/reui/autocomplete.js +2 -2
  257. package/dist/components/reui/badge.d.ts +2 -2
  258. package/dist/components/reui/badge.js +10 -9
  259. package/dist/components/reui/badge.js.map +1 -1
  260. package/dist/components/reui/data-grid/data-grid-table-dnd.js +21 -19
  261. package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
  262. package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts +1 -1
  263. package/dist/components/reui/data-grid/data-grid-table-virtual.js +1 -1
  264. package/dist/components/reui/data-grid/data-grid-table.js +4 -2
  265. package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
  266. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +2 -1
  267. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
  268. package/dist/components/reui/event-calendar/event-calendar-content.js +8 -7
  269. package/dist/components/reui/event-calendar/event-calendar-content.js.map +1 -1
  270. package/dist/components/reui/event-calendar/event-calendar-dnd.js +7 -4
  271. package/dist/components/reui/event-calendar/event-calendar-dnd.js.map +1 -1
  272. package/dist/components/reui/event-calendar/event-calendar-event.js +49 -47
  273. package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
  274. package/dist/components/reui/event-calendar/event-calendar-lib.js +3 -2
  275. package/dist/components/reui/event-calendar/event-calendar-lib.js.map +1 -1
  276. package/dist/components/reui/event-calendar/event-calendar-nav.js +37 -31
  277. package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
  278. package/dist/components/reui/event-calendar/event-calendar-time-grid.js +2 -1
  279. package/dist/components/reui/event-calendar/event-calendar-time-grid.js.map +1 -1
  280. package/dist/components/reui/event-calendar/event-calendar.js +2 -1
  281. package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
  282. package/dist/components/reui/filters.js +5 -3
  283. package/dist/components/reui/filters.js.map +1 -1
  284. package/dist/components/reui/frame.d.ts +2 -2
  285. package/dist/components/reui/frame.js +1 -1
  286. package/dist/components/reui/gantt/gantt-bar.js +52 -51
  287. package/dist/components/reui/gantt/gantt-bar.js.map +1 -1
  288. package/dist/components/reui/gantt/gantt-lib.js +3 -2
  289. package/dist/components/reui/gantt/gantt-lib.js.map +1 -1
  290. package/dist/components/reui/gantt/gantt-nav.js +34 -30
  291. package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
  292. package/dist/components/reui/gantt/gantt-recurrence.js +2 -2
  293. package/dist/components/reui/gantt/gantt-recurrence.js.map +1 -1
  294. package/dist/components/reui/gantt/gantt-view.js +175 -171
  295. package/dist/components/reui/gantt/gantt-view.js.map +1 -1
  296. package/dist/components/reui/icon-tile.d.ts +1 -1
  297. package/dist/components/reui/icon-tile.js +12 -11
  298. package/dist/components/reui/icon-tile.js.map +1 -1
  299. package/dist/components/reui/kanban.js +42 -37
  300. package/dist/components/reui/kanban.js.map +1 -1
  301. package/dist/components/reui/number-field.js +1 -1
  302. package/dist/components/reui/rating.js +1 -1
  303. package/dist/components/reui/sortable.js +10 -9
  304. package/dist/components/reui/sortable.js.map +1 -1
  305. package/dist/components/reui/stepper.js +16 -16
  306. package/dist/components/reui/stepper.js.map +1 -1
  307. package/dist/components/reui/timeline.js +45 -38
  308. package/dist/components/reui/timeline.js.map +1 -1
  309. package/dist/components/reui/tree.js +2 -1
  310. package/dist/components/reui/tree.js.map +1 -1
  311. package/dist/components/ui/alert.js +1 -1
  312. package/dist/components/ui/attachment.d.ts +1 -1
  313. package/dist/components/ui/attachment.js +1 -1
  314. package/dist/components/ui/badge.d.ts +1 -1
  315. package/dist/components/ui/bubble.d.ts +1 -1
  316. package/dist/components/ui/bubble.js +1 -1
  317. package/dist/components/ui/button-group.js +1 -1
  318. package/dist/components/ui/button.d.ts +2 -2
  319. package/dist/components/ui/button.js +1 -1
  320. package/dist/components/ui/empty.d.ts +1 -1
  321. package/dist/components/ui/empty.js +1 -1
  322. package/dist/components/ui/field.js +1 -1
  323. package/dist/components/ui/input-group.js +1 -1
  324. package/dist/components/ui/item.d.ts +2 -2
  325. package/dist/components/ui/item.js +1 -1
  326. package/dist/components/ui/marker.js +1 -1
  327. package/dist/components/ui/navigation-menu.js +1 -1
  328. package/dist/components/ui/sidebar.d.ts +1 -1
  329. package/dist/components/ui/sidebar.js +2 -2
  330. package/dist/components/ui/sidebar.js.map +1 -1
  331. package/dist/components/ui/tabs.js +1 -1
  332. package/dist/components/ui/toggle.d.ts +1 -1
  333. package/dist/components/ui/toggle.js +1 -1
  334. package/dist/hooks/use-hover-capable.d.ts +10 -0
  335. package/dist/hooks/use-hover-capable.d.ts.map +1 -0
  336. package/dist/hooks/use-hover-capable.js +24 -0
  337. package/dist/hooks/use-hover-capable.js.map +1 -0
  338. package/dist/hooks/use-mobile.js +1 -1
  339. package/dist/hooks/use-mobile.js.map +1 -1
  340. package/dist/hooks/use-slider.d.ts +58 -0
  341. package/dist/hooks/use-slider.d.ts.map +1 -0
  342. package/dist/hooks/use-slider.js +133 -0
  343. package/dist/hooks/use-slider.js.map +1 -0
  344. package/dist/lib/ease.d.ts +50 -0
  345. package/dist/lib/ease.d.ts.map +1 -0
  346. package/dist/lib/ease.js +66 -0
  347. package/dist/lib/ease.js.map +1 -0
  348. package/dist/lib/tick-sound.d.ts +17 -0
  349. package/dist/lib/tick-sound.d.ts.map +1 -0
  350. package/dist/lib/tick-sound.js +120 -0
  351. package/dist/lib/tick-sound.js.map +1 -0
  352. package/dist/popover-position-BUqYCq8X.js +54 -0
  353. package/dist/popover-position-BUqYCq8X.js.map +1 -0
  354. package/dist/types-Bah5NY44.d.ts +81 -0
  355. package/dist/types-Bah5NY44.d.ts.map +1 -0
  356. package/dist/utils-DQ7OpbYQ.js +25 -0
  357. package/dist/utils-DQ7OpbYQ.js.map +1 -0
  358. package/package.json +17 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animated-sidebar.js","names":[],"sources":["../../../src/components/motion/animated-sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ButtonHTMLAttributes,\n type CSSProperties,\n createContext,\n forwardRef,\n type HTMLAttributes,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\";\nimport { ChevronRight } from \"lucide-react\";\nimport {\n AnimatePresence,\n type HTMLMotionProps,\n motion,\n useReducedMotion,\n type Variants,\n} from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_DRAWER, EASE_OUT, SPRING_LAYOUT, SPRING_PRESS } from \"../../lib/ease\";\nimport { SharedLayoutBg } from \"./shared-layout-bg\";\n\ntype SidebarState = \"expanded\" | \"collapsed\";\ntype SidebarSide = \"left\" | \"right\";\ntype SidebarVariant = \"sidebar\" | \"floating\" | \"inset\";\ntype SidebarCollapsible = \"offcanvas\" | \"icon\" | \"none\";\n\nconst MOBILE_QUERY = \"(max-width: 767px)\";\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\n\nconst PANEL_TRANSITION = {\n duration: 0.36,\n ease: EASE_DRAWER,\n} as const;\n\n// The desktop rail is one surface changing shape, so a lightly underdamped\n// spring makes the width settle without scaling or stretching its contents.\nconst SIDEBAR_MORPH_TRANSITION = {\n type: \"spring\",\n stiffness: 380,\n damping: 28,\n mass: 0.75,\n} as const;\n\nconst LABEL_ENTER_TRANSITION = {\n duration: 0.2,\n delay: 0.08,\n ease: EASE_OUT,\n} as const;\n\nconst LABEL_EXIT_TRANSITION = {\n duration: 0.12,\n ease: EASE_OUT,\n} as const;\n\nconst SUBMENU_TRANSITION = {\n duration: 0.18,\n ease: EASE_OUT,\n} as const;\n\nconst SUBMENU_VARIANTS: Variants = {\n closed: {\n opacity: 0,\n clipPath: \"inset(0 0 100% 0 round 8px)\",\n transition: {\n duration: 0.14,\n ease: EASE_OUT,\n staggerChildren: 0.025,\n staggerDirection: -1,\n },\n },\n open: {\n opacity: 1,\n clipPath: \"inset(0 0 0% 0 round 8px)\",\n transition: {\n duration: 0.2,\n delayChildren: 0.035,\n ease: EASE_OUT,\n staggerChildren: 0.045,\n },\n },\n};\n\nconst SUBMENU_ITEM_VARIANTS: Variants = {\n closed: {\n opacity: 0,\n y: -6,\n filter: \"blur(3px)\",\n },\n open: {\n opacity: 1,\n y: 0,\n filter: \"blur(0px)\",\n transition: SUBMENU_TRANSITION,\n },\n};\n\nconst REDUCED_TRANSITION = {\n duration: 0.16,\n ease: EASE_OUT,\n} as const;\n\nconst FOCUSABLE_SELECTOR = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"[tabindex]:not([tabindex='-1'])\",\n].join(\",\");\n\nfunction subscribeToMobileQuery(callback: () => void) {\n const query = window.matchMedia(MOBILE_QUERY);\n query.addEventListener(\"change\", callback);\n return () => query.removeEventListener(\"change\", callback);\n}\n\nfunction getMobileSnapshot() {\n return window.matchMedia(MOBILE_QUERY).matches;\n}\n\nfunction getServerMobileSnapshot() {\n return false;\n}\n\nfunction useIsMobile() {\n return useSyncExternalStore(subscribeToMobileQuery, getMobileSnapshot, getServerMobileSnapshot);\n}\n\ninterface AnimatedSidebarContextValue {\n isMobile: boolean;\n layoutId: string;\n open: boolean;\n openMobile: boolean;\n reduce: boolean;\n setOpen: (open: boolean) => void;\n setOpenMobile: (open: boolean) => void;\n state: SidebarState;\n toggleSidebar: () => void;\n triggerRef: React.RefObject<HTMLButtonElement | null>;\n}\n\nconst AnimatedSidebarContext = createContext<AnimatedSidebarContextValue | null>(null);\n\ninterface AnimatedSidebarPanelContextValue {\n collapsed: boolean;\n collapsible: SidebarCollapsible;\n side: SidebarSide;\n}\n\nconst AnimatedSidebarPanelContext = createContext<AnimatedSidebarPanelContextValue | null>(null);\n\nexport function useAnimatedSidebar() {\n const context = useContext(AnimatedSidebarContext);\n if (!context) {\n throw new Error(\"useAnimatedSidebar must be used inside AnimatedSidebarProvider.\");\n }\n return context;\n}\n\nfunction useAnimatedSidebarPanel() {\n const context = useContext(AnimatedSidebarPanelContext);\n if (!context) {\n throw new Error(\"Animated Sidebar parts must be used inside AnimatedSidebar.\");\n }\n return context;\n}\n\ntype SidebarProviderStyle = CSSProperties & {\n \"--sidebar-width\"?: string;\n \"--sidebar-width-icon\"?: string;\n \"--sidebar-width-mobile\"?: string;\n};\n\nexport interface AnimatedSidebarProviderProps extends HTMLAttributes<HTMLDivElement> {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n openMobile?: boolean;\n defaultOpenMobile?: boolean;\n onOpenMobileChange?: (open: boolean) => void;\n style?: SidebarProviderStyle;\n}\n\nexport function AnimatedSidebarProvider({\n children,\n open,\n defaultOpen = true,\n onOpenChange,\n openMobile,\n defaultOpenMobile = false,\n onOpenMobileChange,\n className,\n style,\n ...props\n}: AnimatedSidebarProviderProps) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalOpenMobile, setInternalOpenMobile] = useState(defaultOpenMobile);\n const isMobile = useIsMobile();\n const reduce = useReducedMotion() ?? false;\n const generatedId = useId();\n const triggerRef = useRef<HTMLButtonElement>(null);\n const desktopOpen = open ?? internalOpen;\n const mobileOpen = openMobile ?? internalOpenMobile;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (open === undefined) setInternalOpen(nextOpen);\n onOpenChange?.(nextOpen);\n },\n [onOpenChange, open],\n );\n\n const setOpenMobile = useCallback(\n (nextOpen: boolean) => {\n if (openMobile === undefined) setInternalOpenMobile(nextOpen);\n onOpenMobileChange?.(nextOpen);\n },\n [onOpenMobileChange, openMobile],\n );\n\n const toggleSidebar = useCallback(() => {\n if (isMobile) setOpenMobile(!mobileOpen);\n else setOpen(!desktopOpen);\n }, [desktopOpen, isMobile, mobileOpen, setOpen, setOpenMobile]);\n\n useEffect(() => {\n const handleShortcut = (event: KeyboardEvent) => {\n if (\n event.key.toLowerCase() === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener(\"keydown\", handleShortcut);\n return () => window.removeEventListener(\"keydown\", handleShortcut);\n }, [toggleSidebar]);\n\n return (\n <AnimatedSidebarContext.Provider\n value={{\n isMobile,\n layoutId: `${generatedId}-active`,\n open: desktopOpen,\n openMobile: mobileOpen,\n reduce,\n setOpen,\n setOpenMobile,\n state: desktopOpen ? \"expanded\" : \"collapsed\",\n toggleSidebar,\n triggerRef,\n }}\n >\n <div\n {...props}\n data-slot=\"sidebar-wrapper\"\n data-state={desktopOpen ? \"expanded\" : \"collapsed\"}\n style={{\n \"--sidebar-width\": \"16rem\",\n \"--sidebar-width-icon\": \"4.25rem\",\n \"--sidebar-width-mobile\": \"18rem\",\n ...style,\n }}\n className={cn(\"group/sidebar-wrapper flex min-h-svh w-full min-w-0\", className)}\n >\n {children}\n </div>\n </AnimatedSidebarContext.Provider>\n );\n}\n\nfunction MobileSidebar({\n ariaLabel,\n children,\n className,\n side,\n}: {\n ariaLabel: string;\n children: ReactNode;\n className?: string;\n side: SidebarSide;\n}) {\n const context = useAnimatedSidebar();\n const panelRef = useRef<HTMLDivElement>(null);\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => setMounted(true), []);\n\n useEffect(() => {\n if (!context.openMobile) return;\n\n const body = document.body;\n const scrollY = window.scrollY;\n const previousBodyStyles = {\n left: body.style.left,\n overflow: body.style.overflow,\n position: body.style.position,\n right: body.style.right,\n top: body.style.top,\n };\n\n body.style.position = \"fixed\";\n body.style.top = `-${scrollY}px`;\n body.style.left = \"0\";\n body.style.right = \"0\";\n body.style.overflow = \"hidden\";\n\n const focusFrame = requestAnimationFrame(() => {\n const firstFocusable = panelRef.current?.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n (firstFocusable ?? panelRef.current)?.focus({ preventScroll: true });\n });\n\n return () => {\n cancelAnimationFrame(focusFrame);\n body.style.position = previousBodyStyles.position;\n body.style.top = previousBodyStyles.top;\n body.style.left = previousBodyStyles.left;\n body.style.right = previousBodyStyles.right;\n body.style.overflow = previousBodyStyles.overflow;\n window.scrollTo(0, scrollY);\n context.triggerRef.current?.focus({ preventScroll: true });\n };\n }, [context.openMobile, context.triggerRef]);\n\n if (!mounted) return null;\n\n return createPortal(\n <div\n className={cn(\n \"pointer-events-none fixed inset-0 z-50 md:hidden\",\n context.openMobile ? \"visible\" : \"invisible\",\n )}\n >\n <motion.button\n type=\"button\"\n aria-label=\"Close sidebar\"\n tabIndex={context.openMobile ? 0 : -1}\n initial={false}\n animate={{ opacity: context.openMobile ? 1 : 0 }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n onClick={() => context.setOpenMobile(false)}\n className={cn(\n \"absolute inset-0 bg-black/40\",\n context.openMobile ? \"pointer-events-auto\" : \"pointer-events-none\",\n )}\n />\n\n <motion.div\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={ariaLabel}\n aria-hidden={!context.openMobile}\n inert={!context.openMobile}\n tabIndex={-1}\n data-mobile=\"true\"\n data-state={context.openMobile ? \"expanded\" : \"collapsed\"}\n data-side={side}\n initial={false}\n animate={{\n opacity: context.reduce ? (context.openMobile ? 1 : 0) : 1,\n x: context.reduce ? 0 : context.openMobile ? \"0%\" : side === \"left\" ? \"-100%\" : \"100%\",\n }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n context.setOpenMobile(false);\n return;\n }\n\n if (event.key !== \"Tab\") return;\n const focusable = panelRef.current\n ? Array.from(panelRef.current.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR))\n : [];\n\n if (focusable.length === 0) {\n event.preventDefault();\n panelRef.current?.focus();\n return;\n }\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n if (event.shiftKey && document.activeElement === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n }}\n className={cn(\n \"pointer-events-auto absolute inset-y-0 flex h-dvh w-(--sidebar-width-mobile) max-w-[88vw] flex-col overflow-hidden\",\n \"border-border bg-background shadow-2xl will-change-transform\",\n side === \"left\" ? \"left-0 border-r\" : \"right-0 border-l\",\n !context.openMobile && \"pointer-events-none\",\n className,\n )}\n >\n <AnimatedSidebarPanelContext.Provider\n value={{ collapsed: false, collapsible: \"none\", side }}\n >\n {children}\n </AnimatedSidebarPanelContext.Provider>\n </motion.div>\n </div>,\n document.body,\n );\n}\n\nexport interface AnimatedSidebarProps extends Omit<HTMLMotionProps<\"aside\">, \"children\"> {\n children?: ReactNode;\n side?: SidebarSide;\n variant?: SidebarVariant;\n collapsible?: SidebarCollapsible;\n ariaLabel?: string;\n panelClassName?: string;\n}\n\nexport const AnimatedSidebar = forwardRef<HTMLElement, AnimatedSidebarProps>(\n function AnimatedSidebar(\n {\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"icon\",\n ariaLabel = \"Sidebar\",\n children,\n className,\n panelClassName,\n style,\n ...props\n },\n forwardedRef,\n ) {\n const context = useAnimatedSidebar();\n const collapsed = collapsible !== \"none\" && !context.open;\n const offcanvas = collapsed && collapsible === \"offcanvas\";\n const width = offcanvas\n ? \"0px\"\n : collapsed\n ? \"var(--sidebar-width-icon)\"\n : \"var(--sidebar-width)\";\n\n if (context.isMobile) {\n return (\n <MobileSidebar ariaLabel={ariaLabel} className={className} side={side}>\n {children}\n </MobileSidebar>\n );\n }\n\n return (\n <motion.aside\n {...props}\n ref={forwardedRef}\n initial={false}\n aria-label={ariaLabel}\n data-slot=\"sidebar\"\n data-state={collapsed ? \"collapsed\" : \"expanded\"}\n data-collapsible={collapsible}\n data-variant={variant}\n data-side={side}\n animate={{ width }}\n transition={context.reduce ? { duration: 0 } : SIDEBAR_MORPH_TRANSITION}\n style={style}\n className={cn(\n \"group/sidebar relative hidden h-auto shrink-0 will-change-[width] md:block\",\n \"peer\",\n side === \"right\" && \"order-last\",\n className,\n )}\n >\n <motion.div\n initial={false}\n animate={{\n opacity: offcanvas ? 0 : 1,\n x: offcanvas ? (side === \"left\" ? \"-100%\" : \"100%\") : \"0%\",\n }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n className={cn(\n \"sticky top-0 flex h-svh w-full flex-col overflow-hidden bg-background\",\n variant === \"sidebar\" &&\n (side === \"left\" ? \"border-border border-r\" : \"border-border border-l\"),\n variant === \"floating\" &&\n \"m-2 h-[calc(100svh-1rem)] rounded-2xl border border-border shadow-sm\",\n variant === \"inset\" && \"m-2 h-[calc(100svh-1rem)] rounded-2xl\",\n panelClassName,\n )}\n >\n <AnimatedSidebarPanelContext.Provider value={{ collapsed, collapsible, side }}>\n {children}\n </AnimatedSidebarPanelContext.Provider>\n </motion.div>\n </motion.aside>\n );\n },\n);\n\nexport interface AnimatedSidebarTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarTrigger = forwardRef<HTMLButtonElement, AnimatedSidebarTriggerProps>(\n function AnimatedSidebarTrigger({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const expanded = context.isMobile ? context.openMobile : context.open;\n\n return (\n <button\n {...props}\n ref={(node) => {\n context.triggerRef.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n }}\n type={type}\n aria-label={props[\"aria-label\"] ?? \"Toggle sidebar\"}\n aria-expanded={expanded}\n data-slot=\"sidebar-trigger\"\n data-state={expanded ? \"expanded\" : \"collapsed\"}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) context.toggleSidebar();\n }}\n className={cn(\n \"inline-flex size-10 shrink-0 items-center justify-center rounded-xl outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarCloseProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarClose = forwardRef<HTMLButtonElement, AnimatedSidebarCloseProps>(\n function AnimatedSidebarClose({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n\n return (\n <button\n {...props}\n ref={forwardedRef}\n type={type}\n aria-label={props[\"aria-label\"] ?? \"Close sidebar\"}\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n if (context.isMobile) context.setOpenMobile(false);\n else context.setOpen(false);\n }}\n className={cn(\n \"inline-flex size-10 shrink-0 items-center justify-center rounded-xl outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-ring\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarRailProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarRail = forwardRef<HTMLButtonElement, AnimatedSidebarRailProps>(\n function AnimatedSidebarRail({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n\n return (\n <button\n {...props}\n ref={forwardedRef}\n type={type}\n data-side={panel.side}\n aria-label={props[\"aria-label\"] ?? \"Toggle sidebar\"}\n title=\"Toggle sidebar\"\n tabIndex={-1}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) context.toggleSidebar();\n }}\n className={cn(\n \"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 outline-none md:block\",\n \"after:absolute after:inset-y-0 after:left-1/2 after:w-px after:bg-transparent after:transition-colors hover:after:bg-border\",\n \"data-[side=right]:right-0 data-[side=left]:left-full data-[side=right]:translate-x-1/2\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarInsetProps extends HTMLMotionProps<\"main\"> {}\n\nexport const AnimatedSidebarInset = forwardRef<HTMLElement, AnimatedSidebarInsetProps>(\n function AnimatedSidebarInset({ className, ...props }, forwardedRef) {\n return (\n <motion.main\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-inset\"\n className={cn(\n \"relative flex min-h-svh min-w-0 flex-1 flex-col bg-background\",\n \"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-2xl md:peer-data-[variant=inset]:shadow-sm\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarHeader({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-header\"\n className={cn(\"flex shrink-0 flex-col gap-2 p-3\", className)}\n />\n );\n },\n);\n\nexport const AnimatedSidebarContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarContent({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden overscroll-contain px-2 py-2\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarFooter = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarFooter({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-footer\"\n className={cn(\n \"flex shrink-0 flex-col gap-2 border-border border-t p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarGroup = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarGroup({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-group\"\n className={cn(\"flex w-full min-w-0 flex-col px-1 py-1.5\", className)}\n />\n );\n },\n);\n\nexport const AnimatedSidebarGroupLabel = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarGroupLabel({ children, className, ...props }, forwardedRef) {\n const { collapsed } = useAnimatedSidebarPanel();\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n aria-hidden={collapsed}\n data-slot=\"sidebar-group-label\"\n className={cn(\n \"mb-1 h-7 overflow-hidden px-2 font-medium text-[10px] text-muted-foreground uppercase tracking-[0.14em] transition-opacity\",\n collapsed ? \"opacity-0\" : \"opacity-100\",\n className,\n )}\n >\n {children}\n </div>\n );\n },\n);\n\nexport const AnimatedSidebarGroupContent = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement>\n>(function AnimatedSidebarGroupContent({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-group-content\"\n className={cn(\"w-full min-w-0\", className)}\n />\n );\n});\n\nexport const AnimatedSidebarMenu = forwardRef<HTMLUListElement, HTMLAttributes<HTMLUListElement>>(\n function AnimatedSidebarMenu({ children, className, ...props }, forwardedRef) {\n return (\n <SharedLayoutBg\n {...props}\n ref={forwardedRef as React.Ref<HTMLElement>}\n as=\"ul\"\n inset={0}\n pillClassName=\"rounded-xl bg-muted/70\"\n pillContainerClassName=\"inset-y-auto top-0 h-9\"\n data-slot=\"sidebar-menu\"\n className={cn(\"flex w-full min-w-0 list-none flex-col gap-0.5\", className)}\n >\n {children}\n </SharedLayoutBg>\n );\n },\n);\n\nexport const AnimatedSidebarMenuItem = forwardRef<HTMLLIElement, HTMLMotionProps<\"li\">>(\n function AnimatedSidebarMenuItem({ className, ...props }, forwardedRef) {\n return (\n <motion.li\n {...props}\n ref={forwardedRef}\n layout=\"position\"\n transition={SPRING_LAYOUT}\n data-slot=\"sidebar-menu-item\"\n className={cn(\"relative\", className)}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarMenuSubProps extends Omit<HTMLMotionProps<\"ul\">, \"children\"> {\n open: boolean;\n children?: ReactNode;\n}\n\nexport const AnimatedSidebarMenuSub = forwardRef<HTMLUListElement, AnimatedSidebarMenuSubProps>(\n function AnimatedSidebarMenuSub({ open, children, className, ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n\n return (\n <AnimatePresence initial={false} mode=\"popLayout\">\n {open && !panel.collapsed ? (\n <motion.ul\n {...props}\n ref={forwardedRef}\n key=\"sidebar-submenu\"\n variants={context.reduce ? undefined : SUBMENU_VARIANTS}\n initial={context.reduce ? false : \"closed\"}\n animate={context.reduce ? { opacity: 1 } : \"open\"}\n exit={context.reduce ? { opacity: 0 } : \"closed\"}\n transition={context.reduce ? { duration: 0.12 } : undefined}\n data-slot=\"sidebar-menu-sub\"\n className={cn(\n \"relative mt-1 ml-5 flex min-w-0 flex-col gap-0.5 border-border border-l pl-3\",\n className,\n )}\n >\n {children}\n </motion.ul>\n ) : null}\n </AnimatePresence>\n );\n },\n);\n\nexport const AnimatedSidebarMenuSubItem = forwardRef<HTMLLIElement, HTMLMotionProps<\"li\">>(\n function AnimatedSidebarMenuSubItem({ className, ...props }, forwardedRef) {\n return (\n <motion.li\n {...props}\n ref={forwardedRef}\n variants={SUBMENU_ITEM_VARIANTS}\n data-slot=\"sidebar-menu-sub-item\"\n className={cn(\"relative min-w-0\", className)}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarMenuSubButtonProps {\n children: ReactNode;\n icon?: ReactNode;\n href?: string;\n isActive?: boolean;\n disabled?: boolean;\n closeOnSelect?: boolean;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n rel?: string;\n onSelect?: () => void;\n className?: string;\n}\n\nexport function AnimatedSidebarMenuSubButton({\n children,\n icon,\n href,\n isActive = false,\n disabled = false,\n closeOnSelect = true,\n target,\n rel,\n onSelect,\n className,\n}: AnimatedSidebarMenuSubButtonProps) {\n const context = useAnimatedSidebar();\n\n const select = (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onSelect?.();\n if (context.isMobile && closeOnSelect) context.setOpenMobile(false);\n };\n\n const content = (\n <>\n <span aria-hidden=\"true\" className=\"grid size-4 shrink-0 place-items-center\">\n {icon ?? <span className=\"size-1 rounded-full bg-current\" />}\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n </>\n );\n\n const interactiveClassName = cn(\n \"flex min-h-8 w-full min-w-0 items-center gap-2 rounded-lg px-2 text-left text-xs outline-none\",\n \"text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground\",\n \"focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring\",\n isActive && \"bg-muted/70 text-foreground\",\n disabled && \"cursor-not-allowed opacity-40\",\n className,\n );\n\n return href ? (\n <motion.a\n href={href}\n target={target}\n rel={rel ?? (target === \"_blank\" ? \"noreferrer noopener\" : undefined)}\n aria-current={isActive ? \"page\" : undefined}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.a>\n ) : (\n <motion.button\n type=\"button\"\n disabled={disabled}\n aria-current={isActive ? \"page\" : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.button>\n );\n}\n\nexport interface AnimatedSidebarMenuButtonProps {\n children: ReactNode;\n icon?: ReactNode;\n badge?: ReactNode;\n href?: string;\n isActive?: boolean;\n ariaExpanded?: boolean;\n disabled?: boolean;\n closeOnSelect?: boolean;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n rel?: string;\n onSelect?: () => void;\n className?: string;\n}\n\nexport function AnimatedSidebarMenuButton({\n children,\n icon,\n badge,\n href,\n isActive = false,\n ariaExpanded,\n disabled = false,\n closeOnSelect,\n target,\n rel,\n onSelect,\n className,\n}: AnimatedSidebarMenuButtonProps) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n const textLabel = typeof children === \"string\" ? children : undefined;\n\n const select = (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onSelect?.();\n const shouldCloseOnSelect = closeOnSelect ?? ariaExpanded === undefined;\n if (context.isMobile && shouldCloseOnSelect) {\n context.setOpenMobile(false);\n }\n };\n\n const content = (\n <>\n {isActive ? (\n <motion.span\n layoutId={context.layoutId}\n transition={context.reduce ? { duration: 0 } : SPRING_LAYOUT}\n className=\"absolute inset-0 rounded-xl bg-muted\"\n />\n ) : null}\n {icon ? (\n <span aria-hidden=\"true\" className=\"relative z-10 grid size-5 shrink-0 place-items-center\">\n {icon}\n </span>\n ) : null}\n <motion.span\n initial={false}\n animate={{\n opacity: panel.collapsed ? 0 : 1,\n x: panel.collapsed ? -4 : 0,\n }}\n transition={\n context.reduce\n ? REDUCED_TRANSITION\n : panel.collapsed\n ? LABEL_EXIT_TRANSITION\n : LABEL_ENTER_TRANSITION\n }\n aria-hidden={panel.collapsed}\n className={cn(\n \"relative z-10 min-w-0 flex-1 truncate\",\n panel.collapsed && \"pointer-events-none\",\n )}\n >\n {children}\n </motion.span>\n {badge && !panel.collapsed ? (\n <span className=\"relative z-10 shrink-0 text-muted-foreground text-xs\">{badge}</span>\n ) : null}\n {ariaExpanded !== undefined ? (\n <motion.span\n aria-hidden=\"true\"\n initial={false}\n animate={{\n opacity: panel.collapsed ? 0 : 1,\n rotate: ariaExpanded ? 90 : 0,\n x: panel.collapsed ? 4 : 0,\n }}\n transition={context.reduce ? { duration: 0 } : SPRING_LAYOUT}\n className=\"relative z-10 grid size-4 shrink-0 place-items-center text-muted-foreground\"\n >\n <ChevronRight className=\"size-3.5\" />\n </motion.span>\n ) : null}\n </>\n );\n\n const interactiveClassName = cn(\n \"relative flex min-h-9 w-full min-w-0 items-center gap-2.5 overflow-hidden rounded-xl px-3 text-left font-medium text-sm outline-none\",\n \"text-muted-foreground transition-colors hover:text-foreground\",\n \"focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring\",\n isActive && \"text-foreground\",\n disabled && \"cursor-not-allowed opacity-40\",\n className,\n );\n\n return href ? (\n <motion.a\n href={href}\n target={target}\n rel={rel ?? (target === \"_blank\" ? \"noreferrer noopener\" : undefined)}\n aria-current={isActive ? \"page\" : undefined}\n aria-expanded={ariaExpanded}\n aria-disabled={disabled || undefined}\n aria-label={panel.collapsed ? textLabel : undefined}\n title={panel.collapsed ? textLabel : undefined}\n tabIndex={disabled ? -1 : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.a>\n ) : (\n <motion.button\n type=\"button\"\n disabled={disabled}\n aria-current={isActive ? \"page\" : undefined}\n aria-expanded={ariaExpanded}\n aria-label={panel.collapsed ? textLabel : undefined}\n title={panel.collapsed ? textLabel : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.button>\n );\n}\n"],"mappings":";;;;;;;;;;AAoCA,MAAM,eAAe;AACrB,MAAM,4BAA4B;AAElC,MAAM,mBAAmB;CACvB,UAAU;CACV,MAAM;AACR;AAIA,MAAM,2BAA2B;CAC/B,MAAM;CACN,WAAW;CACX,SAAS;CACT,MAAM;AACR;AAEA,MAAM,yBAAyB;CAC7B,UAAU;CACV,OAAO;CACP,MAAM;AACR;AAEA,MAAM,wBAAwB;CAC5B,UAAU;CACV,MAAM;AACR;AAEA,MAAM,q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,UAAU,EAAE,IAAI;GAC/C,WAAU;GAEV,UAAA,oBAAC,cAAD,EAAc,WAAU,WAAY,CAAA;EACzB,CAAA,IACX;CACJ,EAAA,CAAA;CAGJ,MAAM,uBAAuB,GAC3B,wIACA,iEACA,0EACA,YAAY,mBACZ,YAAY,iCACZ,SACF;CAEA,OAAO,OACL,oBAAC,OAAO,GAAR;EACQ;EACE;EACR,KAAK,QAAQ,WAAW,WAAW,wBAAwB,KAAA;EAC3D,gBAAc,WAAW,SAAS,KAAA;EAClC,iBAAe;EACf,iBAAe,YAAY,KAAA;EAC3B,cAAY,MAAM,YAAY,YAAY,KAAA;EAC1C,OAAO,MAAM,YAAY,YAAY,KAAA;EACrC,UAAU,WAAW,KAAK,KAAA;EAC1B,SAAS;EACT,UAAU,QAAQ,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;EACjE,YAAY;EACZ,WAAW;EAEV,UAAA;CACO,CAAA,IAEV,oBAAC,OAAO,QAAR;EACE,MAAK;EACK;EACV,gBAAc,WAAW,SAAS,KAAA;EAClC,iBAAe;EACf,cAAY,MAAM,YAAY,YAAY,KAAA;EAC1C,OAAO,MAAM,YAAY,YAAY,KAAA;EACrC,SAAS;EACT,UAAU,QAAQ,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;EACjE,YAAY;EACZ,WAAW;EAEV,UAAA;CACY,CAAA;AAEnB"}
@@ -0,0 +1,65 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/components/motion/animated-toast-stack.d.ts
3
+ type ToastStatus = "neutral" | "info" | "loading" | "success" | "error";
4
+ type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
5
+ type AnimatedToastAction = {
6
+ label: ReactNode;
7
+ onClick: (toast: AnimatedToast) => void;
8
+ };
9
+ type AnimatedToast = {
10
+ id: string;
11
+ title: ReactNode;
12
+ description?: ReactNode;
13
+ status?: ToastStatus;
14
+ icon?: ReactNode;
15
+ action?: AnimatedToastAction;
16
+ duration?: number;
17
+ dismissible?: boolean;
18
+ createdAt?: number;
19
+ };
20
+ type ToastInput = Omit<AnimatedToast, "id" | "createdAt"> & {
21
+ id?: string;
22
+ };
23
+ type ToastClassNames = {
24
+ root?: string;
25
+ item?: string;
26
+ surface?: string;
27
+ iconWrap?: string;
28
+ content?: string;
29
+ title?: string;
30
+ description?: string;
31
+ action?: string;
32
+ close?: string;
33
+ progress?: string;
34
+ };
35
+ interface AnimatedToastStackProps {
36
+ toasts: AnimatedToast[];
37
+ onDismiss?: (id: string) => void;
38
+ position?: ToastPosition;
39
+ placement?: "static" | "fixed" | "absolute";
40
+ fixed?: boolean;
41
+ portal?: boolean;
42
+ portalRoot?: Element | null;
43
+ maxVisible?: number;
44
+ className?: string;
45
+ classNames?: ToastClassNames;
46
+ icons?: Partial<Record<ToastStatus, ReactNode>>;
47
+ renderToast?: (toast: AnimatedToast) => ReactNode;
48
+ }
49
+ interface UseAnimatedToastStackOptions {
50
+ initialToasts?: ToastInput[];
51
+ defaultDuration?: number;
52
+ limit?: number;
53
+ }
54
+ declare function useAnimatedToastStack({ initialToasts, defaultDuration, limit }?: UseAnimatedToastStackOptions): {
55
+ toasts: AnimatedToast[];
56
+ showToast: (input: ToastInput) => string;
57
+ updateToast: (id: string, patch: Partial<ToastInput>) => void;
58
+ dismissToast: (id: string) => void;
59
+ clearToasts: () => void;
60
+ setToasts: import("react").Dispatch<import("react").SetStateAction<AnimatedToast[]>>;
61
+ };
62
+ declare function AnimatedToastStack({ toasts, onDismiss, position, placement, fixed, portal, portalRoot, maxVisible, className, classNames, icons, renderToast }: AnimatedToastStackProps): import("react").JSX.Element | null;
63
+ //#endregion
64
+ export { AnimatedToast, AnimatedToastAction, AnimatedToastStack, AnimatedToastStackProps, ToastClassNames, ToastInput, ToastPosition, ToastStatus, UseAnimatedToastStackOptions, useAnimatedToastStack };
65
+ //# sourceMappingURL=animated-toast-stack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animated-toast-stack.d.ts","names":[],"sources":["../../../src/components/motion/animated-toast-stack.tsx"],"mappings":";;KAUY;KACA;KAQA;EACV,OAAO;EACP,UAAU,OAAO;;KAGP;EACV;EACA,OAAO;EACP,cAAc;EACd,SAAS;EACT,OAAO;EACP,SAAS;EACT;EACA;EACA;;KAGU,aAAa,KAAK;EAC5B;;KAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,QAAQ;EACR,aAAa;EACb,WAAW;EACX;EACA;EACA;EACA,aAAa;EACb;EACA;EACA,aAAa;EACb,QAAQ,QAAQ,OAAO,aAAa;EACpC,eAAe,OAAO,kBAAkB;;UAGzB;EACf,gBAAgB;EAChB;EACA;;iBAoDc,wBACd,eACA,iBACA,UACC;;EAeS,YAAA,OAAA;EAW2B,cAAA,YAAM,OAAS,QAAQ;EApBtB,eAAA;;;;iBAuGxB,qBACd,QACA,WACA,UACA,WACA,OACA,QACA,YACA,YACA,WACA,YACA,OACA,eACC,0CAAuB,IAAA"}
@@ -0,0 +1,303 @@
1
+ "use client";
2
+ import { EASE_OUT } from "../../lib/ease.js";
3
+ import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
4
+ import { cn } from "@kumix/utils";
5
+ import { AnimatePresence, motion, useReducedMotion } from "motion/react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { AlertCircle, Bell, Check, Info, LoaderCircle, X } from "lucide-react";
8
+ import { createPortal } from "react-dom";
9
+ //#region src/components/motion/animated-toast-stack.tsx
10
+ const STACK_SPRING = {
11
+ type: "spring",
12
+ stiffness: 420,
13
+ damping: 34,
14
+ mass: .75
15
+ };
16
+ const CONTENT_TRANSITION = {
17
+ duration: .28,
18
+ ease: EASE_OUT
19
+ };
20
+ const STATUS_ICON = {
21
+ neutral: Bell,
22
+ info: Info,
23
+ loading: LoaderCircle,
24
+ success: Check,
25
+ error: AlertCircle
26
+ };
27
+ const STATUS_CLASS = {
28
+ neutral: "text-muted-foreground bg-primary/[0.05]",
29
+ info: "text-primary bg-primary/10",
30
+ loading: "text-primary bg-primary/10",
31
+ success: "text-emerald-600 bg-emerald-500/10 dark:text-emerald-400",
32
+ error: "text-destructive bg-destructive/10"
33
+ };
34
+ const POSITION_CLASS = {
35
+ "top-left": "left-4 top-4",
36
+ "top-center": "left-1/2 top-4 -translate-x-1/2",
37
+ "top-right": "right-4 top-4",
38
+ "bottom-left": "bottom-6 left-4",
39
+ "bottom-center": "bottom-6 left-1/2 -translate-x-1/2",
40
+ "bottom-right": "bottom-6 right-4"
41
+ };
42
+ let idSeed = 0;
43
+ function createToast(input, defaultDuration) {
44
+ return {
45
+ duration: defaultDuration,
46
+ dismissible: true,
47
+ ...input,
48
+ id: input.id ?? `toast-${Date.now()}-${idSeed++}`,
49
+ createdAt: Date.now()
50
+ };
51
+ }
52
+ function useAnimatedToastStack({ initialToasts = [], defaultDuration = 4200, limit } = {}) {
53
+ const toastTimers = useRef(/* @__PURE__ */ new Map());
54
+ const [toasts, setToasts] = useState(() => initialToasts.map((toast) => createToast(toast, defaultDuration)));
55
+ const dismissToast = useCallback((id) => {
56
+ setToasts((current) => current.filter((toast) => toast.id !== id));
57
+ }, []);
58
+ const clearToasts = useCallback(() => {
59
+ setToasts([]);
60
+ }, []);
61
+ const showToast = useCallback((input) => {
62
+ const toast = createToast(input, defaultDuration);
63
+ setToasts((current) => {
64
+ const next = [...current, toast];
65
+ return typeof limit === "number" ? next.slice(-limit) : next;
66
+ });
67
+ return toast.id;
68
+ }, [defaultDuration, limit]);
69
+ const updateToast = useCallback((id, patch) => {
70
+ setToasts((current) => current.map((toast) => toast.id === id ? {
71
+ ...toast,
72
+ ...patch,
73
+ id,
74
+ createdAt: patch.duration === void 0 ? toast.createdAt : Date.now()
75
+ } : toast));
76
+ }, []);
77
+ useEffect(() => {
78
+ const activeIds = new Set(toasts.map((toast) => toast.id));
79
+ toastTimers.current.forEach((entry, id) => {
80
+ if (!activeIds.has(id)) {
81
+ window.clearTimeout(entry.timer);
82
+ toastTimers.current.delete(id);
83
+ }
84
+ });
85
+ toasts.forEach((toast) => {
86
+ const duration = toast.duration ?? defaultDuration;
87
+ const existing = toastTimers.current.get(toast.id);
88
+ if (duration <= 0) {
89
+ if (existing) {
90
+ window.clearTimeout(existing.timer);
91
+ toastTimers.current.delete(toast.id);
92
+ }
93
+ return;
94
+ }
95
+ const createdAt = toast.createdAt ?? Date.now();
96
+ const signature = `${createdAt}:${duration}`;
97
+ if (existing?.signature === signature) return;
98
+ if (existing) window.clearTimeout(existing.timer);
99
+ const elapsed = Date.now() - createdAt;
100
+ const remaining = Math.max(duration - elapsed, 0);
101
+ const timer = window.setTimeout(() => {
102
+ toastTimers.current.delete(toast.id);
103
+ dismissToast(toast.id);
104
+ }, remaining);
105
+ toastTimers.current.set(toast.id, {
106
+ timer,
107
+ signature
108
+ });
109
+ });
110
+ }, [
111
+ defaultDuration,
112
+ dismissToast,
113
+ toasts
114
+ ]);
115
+ useEffect(() => {
116
+ const timers = toastTimers.current;
117
+ return () => {
118
+ timers.forEach((entry) => {
119
+ window.clearTimeout(entry.timer);
120
+ });
121
+ timers.clear();
122
+ };
123
+ }, []);
124
+ return useMemo(() => ({
125
+ toasts,
126
+ showToast,
127
+ updateToast,
128
+ dismissToast,
129
+ clearToasts,
130
+ setToasts
131
+ }), [
132
+ clearToasts,
133
+ dismissToast,
134
+ showToast,
135
+ toasts,
136
+ updateToast
137
+ ]);
138
+ }
139
+ function AnimatedToastStack({ toasts, onDismiss, position = "bottom-right", placement, fixed = false, portal, portalRoot, maxVisible = 4, className, classNames, icons, renderToast }) {
140
+ const [portalTarget, setPortalTarget] = useState(null);
141
+ const visibleToasts = toasts.slice(-maxVisible);
142
+ const isBottom = position.startsWith("bottom");
143
+ const resolvedPlacement = placement ?? (fixed ? "fixed" : "static");
144
+ const shouldPortal = portal ?? resolvedPlacement === "fixed";
145
+ useEffect(() => {
146
+ setPortalTarget(shouldPortal ? portalRoot ?? document.body : null);
147
+ }, [portalRoot, shouldPortal]);
148
+ const stack = /* @__PURE__ */ jsx("ol", {
149
+ "aria-live": "polite",
150
+ "aria-atomic": "false",
151
+ className: cn("pointer-events-none flex w-[calc(100vw-2rem)] max-w-sm gap-2", isBottom ? "flex-col-reverse" : "flex-col", resolvedPlacement === "fixed" && "fixed z-90", resolvedPlacement === "absolute" && "absolute z-20", resolvedPlacement !== "static" && POSITION_CLASS[position], classNames?.root, className),
152
+ children: /* @__PURE__ */ jsx(AnimatePresence, {
153
+ initial: false,
154
+ mode: "popLayout",
155
+ children: visibleToasts.map((toast, index) => /* @__PURE__ */ jsx(ToastItem, {
156
+ toast,
157
+ index,
158
+ onDismiss,
159
+ classNames,
160
+ icons,
161
+ renderToast
162
+ }, toast.id))
163
+ })
164
+ });
165
+ if (shouldPortal && !portalTarget) return null;
166
+ if (shouldPortal && portalTarget) return createPortal(stack, portalTarget);
167
+ return stack;
168
+ }
169
+ const ToastItem = memo(function ToastItem({ toast, index, onDismiss, classNames, icons, renderToast }) {
170
+ const reduce = useReducedMotion();
171
+ const status = toast.status ?? "neutral";
172
+ const Icon = STATUS_ICON[status];
173
+ const iconNode = icons?.[status] ?? toast.icon ?? /* @__PURE__ */ jsx(Icon, { className: "h-3.5 w-3.5" });
174
+ const canDismiss = toast.dismissible !== false && Boolean(onDismiss);
175
+ return /* @__PURE__ */ jsx(motion.li, {
176
+ layout: true,
177
+ initial: reduce ? { opacity: 0 } : {
178
+ opacity: 0,
179
+ y: 22,
180
+ scale: .96,
181
+ filter: "blur(10px)"
182
+ },
183
+ animate: reduce ? { opacity: 1 } : {
184
+ opacity: 1,
185
+ y: 0,
186
+ scale: 1,
187
+ filter: "blur(0px)"
188
+ },
189
+ exit: reduce ? { opacity: 0 } : {
190
+ opacity: 0,
191
+ x: 32,
192
+ scale: .96,
193
+ filter: "blur(8px)",
194
+ transition: {
195
+ duration: .18,
196
+ ease: EASE_OUT
197
+ }
198
+ },
199
+ transition: STACK_SPRING,
200
+ drag: canDismiss && !reduce ? "x" : false,
201
+ dragConstraints: {
202
+ left: 0,
203
+ right: 0
204
+ },
205
+ dragElastic: .18,
206
+ onDragEnd: (_, info) => {
207
+ if (!canDismiss || !onDismiss) return;
208
+ if (Math.abs(info.offset.x) > 72 || Math.abs(info.velocity.x) > 520) onDismiss(toast.id);
209
+ },
210
+ className: cn("pointer-events-auto relative will-change-transform", classNames?.item),
211
+ style: { zIndex: 20 - index },
212
+ children: /* @__PURE__ */ jsx("div", {
213
+ className: cn("relative overflow-hidden rounded-2xl border border-border bg-card/95 p-3 shadow-2xl backdrop-blur-xl", classNames?.surface),
214
+ children: renderToast ? renderToast(toast) : /* @__PURE__ */ jsxs("div", {
215
+ className: "flex items-start gap-3",
216
+ children: [
217
+ /* @__PURE__ */ jsx(motion.span, {
218
+ layout: true,
219
+ className: cn("mt-0.5 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full", STATUS_CLASS[status], classNames?.iconWrap),
220
+ children: /* @__PURE__ */ jsx(AnimatePresence, {
221
+ mode: "popLayout",
222
+ initial: false,
223
+ children: /* @__PURE__ */ jsx(motion.span, {
224
+ initial: reduce ? { opacity: 0 } : {
225
+ opacity: 0,
226
+ y: 8,
227
+ scale: .8,
228
+ filter: "blur(6px)"
229
+ },
230
+ animate: reduce ? { opacity: 1 } : {
231
+ opacity: 1,
232
+ y: 0,
233
+ scale: 1,
234
+ filter: "blur(0px)"
235
+ },
236
+ exit: reduce ? { opacity: 0 } : {
237
+ opacity: 0,
238
+ y: -8,
239
+ scale: .9,
240
+ filter: "blur(6px)"
241
+ },
242
+ transition: CONTENT_TRANSITION,
243
+ className: "inline-flex",
244
+ children: status === "loading" ? /* @__PURE__ */ jsx("span", {
245
+ className: "inline-flex animate-spin",
246
+ children: iconNode
247
+ }) : iconNode
248
+ }, status)
249
+ })
250
+ }),
251
+ /* @__PURE__ */ jsxs("div", {
252
+ className: cn("min-w-0 flex-1", classNames?.content),
253
+ children: [/* @__PURE__ */ jsx(AnimatePresence, {
254
+ mode: "popLayout",
255
+ initial: false,
256
+ children: /* @__PURE__ */ jsxs(motion.div, {
257
+ initial: reduce ? { opacity: 0 } : {
258
+ opacity: 0,
259
+ y: 8,
260
+ filter: "blur(6px)"
261
+ },
262
+ animate: reduce ? { opacity: 1 } : {
263
+ opacity: 1,
264
+ y: 0,
265
+ filter: "blur(0px)"
266
+ },
267
+ exit: reduce ? { opacity: 0 } : {
268
+ opacity: 0,
269
+ y: -8,
270
+ filter: "blur(6px)"
271
+ },
272
+ transition: CONTENT_TRANSITION,
273
+ children: [/* @__PURE__ */ jsx("p", {
274
+ className: cn("truncate font-medium text-foreground text-sm leading-5", classNames?.title),
275
+ children: toast.title
276
+ }), toast.description ? /* @__PURE__ */ jsx("p", {
277
+ className: cn("mt-0.5 line-clamp-2 text-muted-foreground text-xs leading-4", classNames?.description),
278
+ children: toast.description
279
+ }) : null]
280
+ }, `${toast.id}-${status}-${String(toast.title)}`)
281
+ }), toast.action ? /* @__PURE__ */ jsx("button", {
282
+ type: "button",
283
+ onClick: () => toast.action?.onClick(toast),
284
+ className: cn("mt-2 inline-flex h-7 items-center rounded-full bg-primary/6 px-3 font-medium text-foreground text-xs transition-colors hover:bg-primary/10", classNames?.action),
285
+ children: toast.action.label
286
+ }) : null]
287
+ }),
288
+ canDismiss ? /* @__PURE__ */ jsx("button", {
289
+ type: "button",
290
+ onClick: () => onDismiss?.(toast.id),
291
+ "aria-label": "Dismiss toast",
292
+ className: cn("inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-primary/6 hover:text-foreground", classNames?.close),
293
+ children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" })
294
+ }) : null
295
+ ]
296
+ })
297
+ })
298
+ });
299
+ });
300
+ //#endregion
301
+ export { AnimatedToastStack, useAnimatedToastStack };
302
+
303
+ //# sourceMappingURL=animated-toast-stack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animated-toast-stack.js","names":[],"sources":["../../../src/components/motion/animated-toast-stack.tsx"],"sourcesContent":["\"use client\";\n\nimport { memo, type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { AlertCircle, Bell, Check, Info, LoaderCircle, type LucideIcon, X } from \"lucide-react\";\nimport { AnimatePresence, motion, type Transition, useReducedMotion } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT } from \"../../lib/ease\";\n\nexport type ToastStatus = \"neutral\" | \"info\" | \"loading\" | \"success\" | \"error\";\nexport type ToastPosition =\n | \"top-left\"\n | \"top-center\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-center\"\n | \"bottom-right\";\n\nexport type AnimatedToastAction = {\n label: ReactNode;\n onClick: (toast: AnimatedToast) => void;\n};\n\nexport type AnimatedToast = {\n id: string;\n title: ReactNode;\n description?: ReactNode;\n status?: ToastStatus;\n icon?: ReactNode;\n action?: AnimatedToastAction;\n duration?: number;\n dismissible?: boolean;\n createdAt?: number;\n};\n\nexport type ToastInput = Omit<AnimatedToast, \"id\" | \"createdAt\"> & {\n id?: string;\n};\n\nexport type ToastClassNames = {\n root?: string;\n item?: string;\n surface?: string;\n iconWrap?: string;\n content?: string;\n title?: string;\n description?: string;\n action?: string;\n close?: string;\n progress?: string;\n};\n\nexport interface AnimatedToastStackProps {\n toasts: AnimatedToast[];\n onDismiss?: (id: string) => void;\n position?: ToastPosition;\n placement?: \"static\" | \"fixed\" | \"absolute\";\n fixed?: boolean;\n portal?: boolean;\n portalRoot?: Element | null;\n maxVisible?: number;\n className?: string;\n classNames?: ToastClassNames;\n icons?: Partial<Record<ToastStatus, ReactNode>>;\n renderToast?: (toast: AnimatedToast) => ReactNode;\n}\n\nexport interface UseAnimatedToastStackOptions {\n initialToasts?: ToastInput[];\n defaultDuration?: number;\n limit?: number;\n}\n\nconst STACK_SPRING: Transition = {\n type: \"spring\",\n stiffness: 420,\n damping: 34,\n mass: 0.75,\n};\n\nconst CONTENT_TRANSITION = {\n duration: 0.28,\n ease: EASE_OUT,\n} as const;\n\nconst STATUS_ICON: Record<ToastStatus, LucideIcon> = {\n neutral: Bell,\n info: Info,\n loading: LoaderCircle,\n success: Check,\n error: AlertCircle,\n};\n\nconst STATUS_CLASS: Record<ToastStatus, string> = {\n neutral: \"text-muted-foreground bg-primary/[0.05]\",\n info: \"text-primary bg-primary/10\",\n loading: \"text-primary bg-primary/10\",\n success: \"text-emerald-600 bg-emerald-500/10 dark:text-emerald-400\",\n error: \"text-destructive bg-destructive/10\",\n};\n\nconst POSITION_CLASS: Record<ToastPosition, string> = {\n \"top-left\": \"left-4 top-4\",\n \"top-center\": \"left-1/2 top-4 -translate-x-1/2\",\n \"top-right\": \"right-4 top-4\",\n \"bottom-left\": \"bottom-6 left-4\",\n \"bottom-center\": \"bottom-6 left-1/2 -translate-x-1/2\",\n \"bottom-right\": \"bottom-6 right-4\",\n};\n\nlet idSeed = 0;\n\nfunction createToast(input: ToastInput, defaultDuration: number): AnimatedToast {\n return {\n duration: defaultDuration,\n dismissible: true,\n ...input,\n id: input.id ?? `toast-${Date.now()}-${idSeed++}`,\n createdAt: Date.now(),\n };\n}\n\nexport function useAnimatedToastStack({\n initialToasts = [],\n defaultDuration = 4200,\n limit,\n}: UseAnimatedToastStackOptions = {}) {\n const toastTimers = useRef<Map<string, { timer: number; signature: string }>>(new Map());\n const [toasts, setToasts] = useState<AnimatedToast[]>(() =>\n initialToasts.map((toast) => createToast(toast, defaultDuration)),\n );\n\n const dismissToast = useCallback((id: string) => {\n setToasts((current) => current.filter((toast) => toast.id !== id));\n }, []);\n\n const clearToasts = useCallback(() => {\n setToasts([]);\n }, []);\n\n const showToast = useCallback(\n (input: ToastInput) => {\n const toast = createToast(input, defaultDuration);\n setToasts((current) => {\n const next = [...current, toast];\n return typeof limit === \"number\" ? next.slice(-limit) : next;\n });\n return toast.id;\n },\n [defaultDuration, limit],\n );\n\n const updateToast = useCallback((id: string, patch: Partial<ToastInput>) => {\n setToasts((current) =>\n current.map((toast) =>\n toast.id === id\n ? {\n ...toast,\n ...patch,\n id,\n createdAt: patch.duration === undefined ? toast.createdAt : Date.now(),\n }\n : toast,\n ),\n );\n }, []);\n\n useEffect(() => {\n const activeIds = new Set(toasts.map((toast) => toast.id));\n\n toastTimers.current.forEach((entry, id) => {\n if (!activeIds.has(id)) {\n window.clearTimeout(entry.timer);\n toastTimers.current.delete(id);\n }\n });\n\n toasts.forEach((toast) => {\n const duration = toast.duration ?? defaultDuration;\n const existing = toastTimers.current.get(toast.id);\n\n if (duration <= 0) {\n if (existing) {\n window.clearTimeout(existing.timer);\n toastTimers.current.delete(toast.id);\n }\n return;\n }\n\n const createdAt = toast.createdAt ?? Date.now();\n const signature = `${createdAt}:${duration}`;\n\n if (existing?.signature === signature) {\n return;\n }\n\n if (existing) {\n window.clearTimeout(existing.timer);\n }\n\n const elapsed = Date.now() - createdAt;\n const remaining = Math.max(duration - elapsed, 0);\n const timer = window.setTimeout(() => {\n toastTimers.current.delete(toast.id);\n dismissToast(toast.id);\n }, remaining);\n\n toastTimers.current.set(toast.id, { timer, signature });\n });\n }, [defaultDuration, dismissToast, toasts]);\n\n useEffect(() => {\n const timers = toastTimers.current;\n\n return () => {\n timers.forEach((entry) => {\n window.clearTimeout(entry.timer);\n });\n timers.clear();\n };\n }, []);\n\n return useMemo(\n () => ({\n toasts,\n showToast,\n updateToast,\n dismissToast,\n clearToasts,\n setToasts,\n }),\n [clearToasts, dismissToast, showToast, toasts, updateToast],\n );\n}\n\nexport function AnimatedToastStack({\n toasts,\n onDismiss,\n position = \"bottom-right\",\n placement,\n fixed = false,\n portal,\n portalRoot,\n maxVisible = 4,\n className,\n classNames,\n icons,\n renderToast,\n}: AnimatedToastStackProps) {\n const [portalTarget, setPortalTarget] = useState<Element | null>(null);\n const visibleToasts = toasts.slice(-maxVisible);\n const isBottom = position.startsWith(\"bottom\");\n const resolvedPlacement = placement ?? (fixed ? \"fixed\" : \"static\");\n const shouldPortal = portal ?? resolvedPlacement === \"fixed\";\n\n useEffect(() => {\n setPortalTarget(shouldPortal ? (portalRoot ?? document.body) : null);\n }, [portalRoot, shouldPortal]);\n\n const stack = (\n <ol\n aria-live=\"polite\"\n aria-atomic=\"false\"\n className={cn(\n \"pointer-events-none flex w-[calc(100vw-2rem)] max-w-sm gap-2\",\n isBottom ? \"flex-col-reverse\" : \"flex-col\",\n resolvedPlacement === \"fixed\" && \"fixed z-90\",\n resolvedPlacement === \"absolute\" && \"absolute z-20\",\n resolvedPlacement !== \"static\" && POSITION_CLASS[position],\n classNames?.root,\n className,\n )}\n >\n <AnimatePresence initial={false} mode=\"popLayout\">\n {visibleToasts.map((toast, index) => (\n <ToastItem\n key={toast.id}\n toast={toast}\n index={index}\n onDismiss={onDismiss}\n classNames={classNames}\n icons={icons}\n renderToast={renderToast}\n />\n ))}\n </AnimatePresence>\n </ol>\n );\n\n if (shouldPortal && !portalTarget) {\n return null;\n }\n\n if (shouldPortal && portalTarget) {\n return createPortal(stack, portalTarget);\n }\n\n return stack;\n}\n\nconst ToastItem = memo(function ToastItem({\n toast,\n index,\n onDismiss,\n classNames,\n icons,\n renderToast,\n}: {\n toast: AnimatedToast;\n index: number;\n onDismiss?: (id: string) => void;\n classNames?: ToastClassNames;\n icons?: Partial<Record<ToastStatus, ReactNode>>;\n renderToast?: (toast: AnimatedToast) => ReactNode;\n}) {\n const reduce = useReducedMotion();\n const status = toast.status ?? \"neutral\";\n const Icon = STATUS_ICON[status];\n const iconNode = icons?.[status] ?? toast.icon ?? <Icon className=\"h-3.5 w-3.5\" />;\n const canDismiss = toast.dismissible !== false && Boolean(onDismiss);\n\n return (\n <motion.li\n layout\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: 22, scale: 0.96, filter: \"blur(10px)\" }}\n animate={reduce ? { opacity: 1 } : { opacity: 1, y: 0, scale: 1, filter: \"blur(0px)\" }}\n exit={\n reduce\n ? { opacity: 0 }\n : {\n opacity: 0,\n x: 32,\n scale: 0.96,\n filter: \"blur(8px)\",\n transition: { duration: 0.18, ease: EASE_OUT },\n }\n }\n transition={STACK_SPRING}\n drag={canDismiss && !reduce ? \"x\" : false}\n dragConstraints={{ left: 0, right: 0 }}\n dragElastic={0.18}\n onDragEnd={(_, info) => {\n if (!canDismiss || !onDismiss) return;\n if (Math.abs(info.offset.x) > 72 || Math.abs(info.velocity.x) > 520) {\n onDismiss(toast.id);\n }\n }}\n className={cn(\"pointer-events-auto relative will-change-transform\", classNames?.item)}\n style={{ zIndex: 20 - index }}\n >\n <div\n className={cn(\n \"relative overflow-hidden rounded-2xl border border-border bg-card/95 p-3 shadow-2xl backdrop-blur-xl\",\n classNames?.surface,\n )}\n >\n {renderToast ? (\n renderToast(toast)\n ) : (\n <div className=\"flex items-start gap-3\">\n <motion.span\n layout\n className={cn(\n \"mt-0.5 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full\",\n STATUS_CLASS[status],\n classNames?.iconWrap,\n )}\n >\n <AnimatePresence mode=\"popLayout\" initial={false}>\n <motion.span\n key={status}\n initial={\n reduce ? { opacity: 0 } : { opacity: 0, y: 8, scale: 0.8, filter: \"blur(6px)\" }\n }\n animate={\n reduce ? { opacity: 1 } : { opacity: 1, y: 0, scale: 1, filter: \"blur(0px)\" }\n }\n exit={\n reduce ? { opacity: 0 } : { opacity: 0, y: -8, scale: 0.9, filter: \"blur(6px)\" }\n }\n transition={CONTENT_TRANSITION}\n className=\"inline-flex\"\n >\n {status === \"loading\" ? (\n <span className=\"inline-flex animate-spin\">{iconNode}</span>\n ) : (\n iconNode\n )}\n </motion.span>\n </AnimatePresence>\n </motion.span>\n\n <div className={cn(\"min-w-0 flex-1\", classNames?.content)}>\n <AnimatePresence mode=\"popLayout\" initial={false}>\n <motion.div\n key={`${toast.id}-${status}-${String(toast.title)}`}\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: 8, filter: \"blur(6px)\" }}\n animate={reduce ? { opacity: 1 } : { opacity: 1, y: 0, filter: \"blur(0px)\" }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, y: -8, filter: \"blur(6px)\" }}\n transition={CONTENT_TRANSITION}\n >\n <p\n className={cn(\n \"truncate font-medium text-foreground text-sm leading-5\",\n classNames?.title,\n )}\n >\n {toast.title}\n </p>\n {toast.description ? (\n <p\n className={cn(\n \"mt-0.5 line-clamp-2 text-muted-foreground text-xs leading-4\",\n classNames?.description,\n )}\n >\n {toast.description}\n </p>\n ) : null}\n </motion.div>\n </AnimatePresence>\n\n {toast.action ? (\n <button\n type=\"button\"\n onClick={() => toast.action?.onClick(toast)}\n className={cn(\n \"mt-2 inline-flex h-7 items-center rounded-full bg-primary/6 px-3 font-medium text-foreground text-xs transition-colors hover:bg-primary/10\",\n classNames?.action,\n )}\n >\n {toast.action.label}\n </button>\n ) : null}\n </div>\n\n {canDismiss ? (\n <button\n type=\"button\"\n onClick={() => onDismiss?.(toast.id)}\n aria-label=\"Dismiss toast\"\n className={cn(\n \"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-primary/6 hover:text-foreground\",\n classNames?.close,\n )}\n >\n <X className=\"h-3.5 w-3.5\" />\n </button>\n ) : null}\n </div>\n )}\n </div>\n </motion.li>\n );\n});\n"],"mappings":";;;;;;;;;AA0EA,MAAM,eAA2B;CAC/B,MAAM;CACN,WAAW;CACX,SAAS;CACT,MAAM;AACR;AAEA,MAAM,qBAAqB;CACzB,UAAU;CACV,MAAM;AACR;AAEA,MAAM,cAA+C;CACnD,SAAS;CACT,MAAM;CACN,SAAS;CACT,SAAS;CACT,OAAO;AACT;AAEA,MAAM,eAA4C;CAChD,SAAS;CACT,MAAM;CACN,SAAS;CACT,SAAS;CACT,OAAO;AACT;AAEA,MAAM,iBAAgD;CACpD,YAAY;CACZ,cAAc;CACd,aAAa;CACb,eAAe;CACf,iBAAiB;CACjB,gBAAgB;AAClB;AAEA,IAAI,SAAS;AAEb,SAAS,YAAY,OAAmB,iBAAwC;CAC9E,OAAO;EACL,UAAU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AAS;OACzC,UAAA,qBAAC,OAAO,KAAR;QAEE,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI;SAAE,SAAS;SAAG,GAAG;SAAG,QAAQ;QAAY;QAC3E,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI;SAAE,SAAS;SAAG,GAAG;SAAG,QAAQ;QAAY;QAC3E,MAAM,SAAS,EAAE,SAAS,EAAE,IAAI;SAAE,SAAS;SAAG,GAAG;SAAI,QAAQ;QAAY;QACzE,YAAY;QALd,UAAA,CAOE,oBAAC,KAAD;SACE,WAAW,GACT,0DACA,YAAY,KACd;SAEC,UAAA,MAAM;QACN,CAAA,GACF,MAAM,cACL,oBAAC,KAAD;SACE,WAAW,GACT,+DACA,YAAY,WACd;SAEC,UAAA,MAAM;QACN,CAAA,IACD,IACM;OAxBL,GAAA,GAAG,MAAM,GAAG,GAAG,OAAO,GAAG,OAAO,MAAM,KAAK,GAwBtC;MACG,CAAA,GAEhB,MAAM,SACL,oBAAC,UAAD;OACE,MAAK;OACL,eAAe,MAAM,QAAQ,QAAQ,KAAK;OAC1C,WAAW,GACT,8IACA,YAAY,MACd;OAEC,UAAA,MAAM,OAAO;MACR,CAAA,IACN,IACD;;KAEJ,aACC,oBAAC,UAAD;MACE,MAAK;MACL,eAAe,YAAY,MAAM,EAAE;MACnC,cAAW;MACX,WAAW,GACT,0JACA,YAAY,KACd;MAEA,UAAA,oBAAC,GAAD,EAAG,WAAU,cAAe,CAAA;KACtB,CAAA,IACN;IACD;;EAEJ,CAAA;CACI,CAAA;AAEf,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/components/motion/bottom-sheet.d.ts
3
+ interface BottomSheetProps {
4
+ open: boolean;
5
+ onOpenChange: (open: boolean) => void;
6
+ /** Heights (0-1 = fraction of viewport, or "auto"). First entry is default. */
7
+ snapPoints?: (number | "auto")[];
8
+ defaultSnap?: number;
9
+ title?: string;
10
+ description?: string;
11
+ children?: ReactNode;
12
+ className?: string;
13
+ /** Min drag distance (px) past current snap to dismiss. */
14
+ dismissThreshold?: number;
15
+ }
16
+ declare function BottomSheet({ open, onOpenChange, snapPoints, defaultSnap, title, description, children, className, dismissThreshold }: BottomSheetProps): import("react").ReactPortal | null;
17
+ //#endregion
18
+ export { BottomSheet, BottomSheetProps };
19
+ //# sourceMappingURL=bottom-sheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bottom-sheet.d.ts","names":[],"sources":["../../../src/components/motion/bottom-sheet.tsx"],"mappings":";;UAoBiB;EACf;EACA,eAAe;;EAEf;EACA;EACA;EACA;EACA,WAAW;EACX;;EAEA;;iBAGc,cACd,MACA,cACA,YACA,aACA,OACA,aACA,UACA,WACA,oBACC,mCAAgB"}