@kumix/ui 0.3.13 → 0.3.14

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 (522) hide show
  1. package/README.md +2 -2
  2. package/dist/components/agents/agent-activity/activity-row.js +1 -1
  3. package/dist/components/agents/agent-activity/activity-row.js.map +1 -1
  4. package/dist/components/agents/agent-activity/index.js +1 -1
  5. package/dist/components/agents/agent-activity/index.js.map +1 -1
  6. package/dist/components/agents/agent-code.d.ts.map +1 -1
  7. package/dist/components/agents/agent-code.js +1 -1
  8. package/dist/components/agents/agent-code.js.map +1 -1
  9. package/dist/components/agents/agent-disclosure.js +1 -1
  10. package/dist/components/agents/agent-disclosure.js.map +1 -1
  11. package/dist/components/agents/ai-sidebar.js +1 -1
  12. package/dist/components/agents/ai-sidebar.js.map +1 -1
  13. package/dist/components/agents/approval-card/index.js +1 -1
  14. package/dist/components/agents/approval-card/index.js.map +1 -1
  15. package/dist/components/agents/chat-app.js +1 -1
  16. package/dist/components/agents/chat-app.js.map +1 -1
  17. package/dist/components/agents/citations.js +1 -1
  18. package/dist/components/agents/citations.js.map +1 -1
  19. package/dist/components/agents/code-block.js +1 -1
  20. package/dist/components/agents/code-block.js.map +1 -1
  21. package/dist/components/agents/file-diff.js +1 -1
  22. package/dist/components/agents/file-diff.js.map +1 -1
  23. package/dist/components/agents/image-generation.js +1 -1
  24. package/dist/components/agents/image-generation.js.map +1 -1
  25. package/dist/components/agents/loading-states/agent-progress.js +1 -1
  26. package/dist/components/agents/loading-states/agent-progress.js.map +1 -1
  27. package/dist/components/agents/loading-states/reasoning-text.js +1 -1
  28. package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
  29. package/dist/components/agents/loading-states/thinking-shimmer.js +1 -1
  30. package/dist/components/agents/loading-states/thinking-shimmer.js.map +1 -1
  31. package/dist/components/agents/message-bubble.js +1 -1
  32. package/dist/components/agents/message-bubble.js.map +1 -1
  33. package/dist/components/agents/message-scroller.js +1 -1
  34. package/dist/components/agents/message-scroller.js.map +1 -1
  35. package/dist/components/agents/message.js +1 -1
  36. package/dist/components/agents/message.js.map +1 -1
  37. package/dist/components/agents/prompt-input.js +1 -1
  38. package/dist/components/agents/prompt-input.js.map +1 -1
  39. package/dist/components/agents/streaming-response.js +1 -1
  40. package/dist/components/agents/streaming-response.js.map +1 -1
  41. package/dist/components/agents/todo-list.js +1 -1
  42. package/dist/components/agents/todo-list.js.map +1 -1
  43. package/dist/components/agents/tool-approval.js +1 -1
  44. package/dist/components/agents/tool-approval.js.map +1 -1
  45. package/dist/components/agents/tool-result.js +1 -1
  46. package/dist/components/agents/tool-result.js.map +1 -1
  47. package/dist/components/motion/action-swap.js +1 -1
  48. package/dist/components/motion/action-swap.js.map +1 -1
  49. package/dist/components/motion/adaptive-stepper.js +1 -1
  50. package/dist/components/motion/adaptive-stepper.js.map +1 -1
  51. package/dist/components/motion/animated-badge.js +1 -1
  52. package/dist/components/motion/animated-badge.js.map +1 -1
  53. package/dist/components/motion/animated-number.js +1 -1
  54. package/dist/components/motion/animated-number.js.map +1 -1
  55. package/dist/components/motion/animated-sidebar.js +1 -1
  56. package/dist/components/motion/animated-sidebar.js.map +1 -1
  57. package/dist/components/motion/animated-toast-stack.js +1 -1
  58. package/dist/components/motion/animated-toast-stack.js.map +1 -1
  59. package/dist/components/motion/attachment-upload.js +1 -1
  60. package/dist/components/motion/attachment-upload.js.map +1 -1
  61. package/dist/components/motion/availability-scheduler/icon-button.js +1 -1
  62. package/dist/components/motion/availability-scheduler/icon-button.js.map +1 -1
  63. package/dist/components/motion/availability-scheduler/index.js +1 -1
  64. package/dist/components/motion/availability-scheduler/index.js.map +1 -1
  65. package/dist/components/motion/bloom-menu.js +1 -1
  66. package/dist/components/motion/bloom-menu.js.map +1 -1
  67. package/dist/components/motion/bottom-sheet.js +1 -1
  68. package/dist/components/motion/bottom-sheet.js.map +1 -1
  69. package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
  70. package/dist/components/motion/bounce-sidebar.js +1 -1
  71. package/dist/components/motion/bounce-sidebar.js.map +1 -1
  72. package/dist/components/motion/bouncy-accordion.js +1 -1
  73. package/dist/components/motion/bouncy-accordion.js.map +1 -1
  74. package/dist/components/motion/button/base.js +1 -1
  75. package/dist/components/motion/button/base.js.map +1 -1
  76. package/dist/components/motion/button/metallic.js +1 -1
  77. package/dist/components/motion/button/metallic.js.map +1 -1
  78. package/dist/components/motion/card-folder.js +1 -1
  79. package/dist/components/motion/card-folder.js.map +1 -1
  80. package/dist/components/motion/center-morph-modal.js +1 -1
  81. package/dist/components/motion/center-morph-modal.js.map +1 -1
  82. package/dist/components/motion/checkbox.js +1 -1
  83. package/dist/components/motion/checkbox.js.map +1 -1
  84. package/dist/components/motion/chromatic-text-reveal.js +1 -1
  85. package/dist/components/motion/chromatic-text-reveal.js.map +1 -1
  86. package/dist/components/motion/combobox/content.js +1 -1
  87. package/dist/components/motion/combobox/content.js.map +1 -1
  88. package/dist/components/motion/combobox/context.js +1 -1
  89. package/dist/components/motion/combobox/context.js.map +1 -1
  90. package/dist/components/motion/combobox/list.js +1 -1
  91. package/dist/components/motion/combobox/list.js.map +1 -1
  92. package/dist/components/motion/combobox/trigger.js +1 -1
  93. package/dist/components/motion/combobox/trigger.js.map +1 -1
  94. package/dist/components/motion/command-palette.js +1 -1
  95. package/dist/components/motion/command-palette.js.map +1 -1
  96. package/dist/components/motion/context-menu.js +1 -1
  97. package/dist/components/motion/context-menu.js.map +1 -1
  98. package/dist/components/motion/cylinder-carousel.js +1 -1
  99. package/dist/components/motion/cylinder-carousel.js.map +1 -1
  100. package/dist/components/motion/digit-swap.js +1 -1
  101. package/dist/components/motion/digit-swap.js.map +1 -1
  102. package/dist/components/motion/dock.js +1 -1
  103. package/dist/components/motion/dock.js.map +1 -1
  104. package/dist/components/motion/drawer.js +1 -1
  105. package/dist/components/motion/drawer.js.map +1 -1
  106. package/dist/components/motion/dynamic-island.js +1 -1
  107. package/dist/components/motion/dynamic-island.js.map +1 -1
  108. package/dist/components/motion/expandable-action-bar.js +1 -1
  109. package/dist/components/motion/expandable-action-bar.js.map +1 -1
  110. package/dist/components/motion/expandable-control.d.ts.map +1 -1
  111. package/dist/components/motion/expandable-control.js +1 -1
  112. package/dist/components/motion/expandable-control.js.map +1 -1
  113. package/dist/components/motion/expandable-tabs.js +1 -1
  114. package/dist/components/motion/expandable-tabs.js.map +1 -1
  115. package/dist/components/motion/expanding-arrow-button.js +1 -1
  116. package/dist/components/motion/expanding-arrow-button.js.map +1 -1
  117. package/dist/components/motion/feedback-widget.js +1 -1
  118. package/dist/components/motion/feedback-widget.js.map +1 -1
  119. package/dist/components/motion/file-tree.js +1 -1
  120. package/dist/components/motion/file-tree.js.map +1 -1
  121. package/dist/components/motion/file-upload.js +1 -1
  122. package/dist/components/motion/file-upload.js.map +1 -1
  123. package/dist/components/motion/hold-action-button.js +1 -1
  124. package/dist/components/motion/hold-action-button.js.map +1 -1
  125. package/dist/components/motion/infinite-masonry.js +1 -1
  126. package/dist/components/motion/infinite-masonry.js.map +1 -1
  127. package/dist/components/motion/input.d.ts.map +1 -1
  128. package/dist/components/motion/input.js +1 -1
  129. package/dist/components/motion/input.js.map +1 -1
  130. package/dist/components/motion/liquid.js +1 -1
  131. package/dist/components/motion/liquid.js.map +1 -1
  132. package/dist/components/motion/loader.js +1 -1
  133. package/dist/components/motion/loader.js.map +1 -1
  134. package/dist/components/motion/magnetic.js +1 -1
  135. package/dist/components/motion/magnetic.js.map +1 -1
  136. package/dist/components/motion/marquee.d.ts.map +1 -1
  137. package/dist/components/motion/marquee.js +1 -1
  138. package/dist/components/motion/marquee.js.map +1 -1
  139. package/dist/components/motion/morphing-modal.js +1 -1
  140. package/dist/components/motion/morphing-modal.js.map +1 -1
  141. package/dist/components/motion/morphing-search.js +1 -1
  142. package/dist/components/motion/morphing-search.js.map +1 -1
  143. package/dist/components/motion/morphing-tabs.js +1 -1
  144. package/dist/components/motion/morphing-tabs.js.map +1 -1
  145. package/dist/components/motion/multi-select/content.js +1 -1
  146. package/dist/components/motion/multi-select/content.js.map +1 -1
  147. package/dist/components/motion/multi-select/context.js +1 -1
  148. package/dist/components/motion/multi-select/context.js.map +1 -1
  149. package/dist/components/motion/multi-select/list.js +1 -1
  150. package/dist/components/motion/multi-select/list.js.map +1 -1
  151. package/dist/components/motion/multi-select/trigger.js +1 -1
  152. package/dist/components/motion/multi-select/trigger.js.map +1 -1
  153. package/dist/components/motion/not-found/magnetic.d.ts.map +1 -1
  154. package/dist/components/motion/not-found/magnetic.js +1 -1
  155. package/dist/components/motion/not-found/magnetic.js.map +1 -1
  156. package/dist/components/motion/not-found/shared.js +1 -1
  157. package/dist/components/motion/not-found/shared.js.map +1 -1
  158. package/dist/components/motion/not-found/spotlight.js +1 -1
  159. package/dist/components/motion/not-found/spotlight.js.map +1 -1
  160. package/dist/components/motion/notification-stack.js +1 -1
  161. package/dist/components/motion/notification-stack.js.map +1 -1
  162. package/dist/components/motion/number-ticker.js +1 -1
  163. package/dist/components/motion/number-ticker.js.map +1 -1
  164. package/dist/components/motion/otp-input.js +1 -1
  165. package/dist/components/motion/otp-input.js.map +1 -1
  166. package/dist/components/motion/overflow-actions.js +1 -1
  167. package/dist/components/motion/overflow-actions.js.map +1 -1
  168. package/dist/components/motion/parallax.d.ts.map +1 -1
  169. package/dist/components/motion/parallax.js +1 -1
  170. package/dist/components/motion/parallax.js.map +1 -1
  171. package/dist/components/motion/popover-morph.js +1 -1
  172. package/dist/components/motion/popover-morph.js.map +1 -1
  173. package/dist/components/motion/popover.js +1 -1
  174. package/dist/components/motion/popover.js.map +1 -1
  175. package/dist/components/motion/preview-rail.js +1 -1
  176. package/dist/components/motion/preview-rail.js.map +1 -1
  177. package/dist/components/motion/project-folder.js +1 -1
  178. package/dist/components/motion/project-folder.js.map +1 -1
  179. package/dist/components/motion/pull-to-refresh.js +1 -1
  180. package/dist/components/motion/pull-to-refresh.js.map +1 -1
  181. package/dist/components/motion/radio.js +1 -1
  182. package/dist/components/motion/radio.js.map +1 -1
  183. package/dist/components/motion/range-slider-bubble.js +1 -1
  184. package/dist/components/motion/range-slider-bubble.js.map +1 -1
  185. package/dist/components/motion/range-slider-fluid.js +1 -1
  186. package/dist/components/motion/range-slider-fluid.js.map +1 -1
  187. package/dist/components/motion/range-slider-inline.d.ts +18 -0
  188. package/dist/components/motion/range-slider-inline.d.ts.map +1 -0
  189. package/dist/components/motion/range-slider-inline.js +267 -0
  190. package/dist/components/motion/range-slider-inline.js.map +1 -0
  191. package/dist/components/motion/range-slider-ruler.js +1 -1
  192. package/dist/components/motion/range-slider-ruler.js.map +1 -1
  193. package/dist/components/motion/range-slider-wave.js +1 -1
  194. package/dist/components/motion/range-slider-wave.js.map +1 -1
  195. package/dist/components/motion/range-slider.d.ts.map +1 -1
  196. package/dist/components/motion/range-slider.js +27 -11
  197. package/dist/components/motion/range-slider.js.map +1 -1
  198. package/dist/components/motion/scroll-progress.js +1 -1
  199. package/dist/components/motion/scroll-progress.js.map +1 -1
  200. package/dist/components/motion/scroll-reveal.js +1 -1
  201. package/dist/components/motion/scroll-reveal.js.map +1 -1
  202. package/dist/components/motion/scroll-to.js +1 -1
  203. package/dist/components/motion/scroll-to.js.map +1 -1
  204. package/dist/components/motion/select-morph.d.ts.map +1 -1
  205. package/dist/components/motion/select-morph.js +1 -1
  206. package/dist/components/motion/select-morph.js.map +1 -1
  207. package/dist/components/motion/select.js +1 -1
  208. package/dist/components/motion/select.js.map +1 -1
  209. package/dist/components/motion/shader-background.d.ts.map +1 -1
  210. package/dist/components/motion/shader-background.js +1 -1
  211. package/dist/components/motion/shader-background.js.map +1 -1
  212. package/dist/components/motion/shared-layout-bg.js +1 -1
  213. package/dist/components/motion/shared-layout-bg.js.map +1 -1
  214. package/dist/components/motion/signup-form.js +1 -1
  215. package/dist/components/motion/signup-form.js.map +1 -1
  216. package/dist/components/motion/slide-action-button.js +1 -1
  217. package/dist/components/motion/slide-action-button.js.map +1 -1
  218. package/dist/components/motion/swipeable-list.js +1 -1
  219. package/dist/components/motion/swipeable-list.js.map +1 -1
  220. package/dist/components/motion/switch.d.ts.map +1 -1
  221. package/dist/components/motion/switch.js +1 -1
  222. package/dist/components/motion/switch.js.map +1 -1
  223. package/dist/components/motion/table/index.js +1 -1
  224. package/dist/components/motion/table/index.js.map +1 -1
  225. package/dist/components/motion/table/skeleton-rows.d.ts.map +1 -1
  226. package/dist/components/motion/table/skeleton-rows.js +1 -1
  227. package/dist/components/motion/table/skeleton-rows.js.map +1 -1
  228. package/dist/components/motion/table/table-header.js +1 -1
  229. package/dist/components/motion/table/table-header.js.map +1 -1
  230. package/dist/components/motion/table/table-menu.js +1 -1
  231. package/dist/components/motion/table/table-menu.js.map +1 -1
  232. package/dist/components/motion/tabs.js +1 -1
  233. package/dist/components/motion/tabs.js.map +1 -1
  234. package/dist/components/motion/text-reveal.js +1 -1
  235. package/dist/components/motion/text-reveal.js.map +1 -1
  236. package/dist/components/motion/text-scramble.d.ts.map +1 -1
  237. package/dist/components/motion/text-scramble.js +1 -1
  238. package/dist/components/motion/text-scramble.js.map +1 -1
  239. package/dist/components/motion/text-shimmer.js +1 -1
  240. package/dist/components/motion/text-shimmer.js.map +1 -1
  241. package/dist/components/motion/theme-toggle.js +1 -1
  242. package/dist/components/motion/theme-toggle.js.map +1 -1
  243. package/dist/components/motion/tilt-card.js +1 -1
  244. package/dist/components/motion/tilt-card.js.map +1 -1
  245. package/dist/components/motion/tooltip.js +1 -1
  246. package/dist/components/motion/tooltip.js.map +1 -1
  247. package/dist/components/motion/wheel-picker.js +1 -1
  248. package/dist/components/motion/wheel-picker.js.map +1 -1
  249. package/dist/components/reui/alert.d.ts +1 -1
  250. package/dist/components/reui/alert.d.ts.map +1 -1
  251. package/dist/components/reui/alert.js +1 -1
  252. package/dist/components/reui/alert.js.map +1 -1
  253. package/dist/components/reui/autocomplete.d.ts +1 -1
  254. package/dist/components/reui/autocomplete.js +1 -1
  255. package/dist/components/reui/autocomplete.js.map +1 -1
  256. package/dist/components/reui/badge.d.ts +2 -2
  257. package/dist/components/reui/badge.d.ts.map +1 -1
  258. package/dist/components/reui/badge.js +1 -1
  259. package/dist/components/reui/badge.js.map +1 -1
  260. package/dist/components/reui/cascader/cascader-columns.js +1 -1
  261. package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
  262. package/dist/components/reui/cascader/cascader-footer.js +1 -1
  263. package/dist/components/reui/cascader/cascader-footer.js.map +1 -1
  264. package/dist/components/reui/cascader/cascader-item.js +1 -1
  265. package/dist/components/reui/cascader/cascader-item.js.map +1 -1
  266. package/dist/components/reui/cascader/cascader-nav.js +1 -1
  267. package/dist/components/reui/cascader/cascader-nav.js.map +1 -1
  268. package/dist/components/reui/cascader/cascader.js +1 -1
  269. package/dist/components/reui/cascader/cascader.js.map +1 -1
  270. package/dist/components/reui/code-block/code-block.js +1 -1
  271. package/dist/components/reui/code-block/code-block.js.map +1 -1
  272. package/dist/components/reui/data-grid/data-grid-cell-selection.js +1 -1
  273. package/dist/components/reui/data-grid/data-grid-cell-selection.js.map +1 -1
  274. package/dist/components/reui/data-grid/data-grid-column-filter.js +1 -1
  275. package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
  276. package/dist/components/reui/data-grid/data-grid-column-header.js +1 -1
  277. package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
  278. package/dist/components/reui/data-grid/data-grid-pagination.js +1 -1
  279. package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
  280. package/dist/components/reui/data-grid/data-grid-scroll-area.js +1 -1
  281. package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
  282. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +1 -1
  283. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
  284. package/dist/components/reui/data-grid/data-grid-table-virtual.js +1 -1
  285. package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
  286. package/dist/components/reui/data-grid/data-grid-table.js +1 -1
  287. package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
  288. package/dist/components/reui/data-grid/data-grid.js +1 -1
  289. package/dist/components/reui/data-grid/data-grid.js.map +1 -1
  290. package/dist/components/reui/date-selector.js +1 -1
  291. package/dist/components/reui/date-selector.js.map +1 -1
  292. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +1 -1
  293. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
  294. package/dist/components/reui/event-calendar/event-calendar-content.js +1 -1
  295. package/dist/components/reui/event-calendar/event-calendar-content.js.map +1 -1
  296. package/dist/components/reui/event-calendar/event-calendar-event.js +1 -1
  297. package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
  298. package/dist/components/reui/event-calendar/event-calendar-month-view.js +1 -1
  299. package/dist/components/reui/event-calendar/event-calendar-month-view.js.map +1 -1
  300. package/dist/components/reui/event-calendar/event-calendar-nav.js +1 -1
  301. package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
  302. package/dist/components/reui/event-calendar/event-calendar-resource-view.js +1 -1
  303. package/dist/components/reui/event-calendar/event-calendar-resource-view.js.map +1 -1
  304. package/dist/components/reui/event-calendar/event-calendar-time-grid.js +1 -1
  305. package/dist/components/reui/event-calendar/event-calendar-time-grid.js.map +1 -1
  306. package/dist/components/reui/event-calendar/event-calendar.js +1 -1
  307. package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
  308. package/dist/components/reui/filters/filters-advanced.js +1 -1
  309. package/dist/components/reui/filters/filters-advanced.js.map +1 -1
  310. package/dist/components/reui/filters/filters-builder.js +2 -2
  311. package/dist/components/reui/filters/filters-builder.js.map +1 -1
  312. package/dist/components/reui/filters/filters-chip.js +1 -1
  313. package/dist/components/reui/filters/filters-chip.js.map +1 -1
  314. package/dist/components/reui/filters/filters-editors.js +2 -2
  315. package/dist/components/reui/filters/filters-editors.js.map +1 -1
  316. package/dist/components/reui/filters/filters.js +1 -1
  317. package/dist/components/reui/filters/filters.js.map +1 -1
  318. package/dist/components/reui/frame.d.ts +2 -2
  319. package/dist/components/reui/frame.d.ts.map +1 -1
  320. package/dist/components/reui/frame.js +1 -1
  321. package/dist/components/reui/frame.js.map +1 -1
  322. package/dist/components/reui/gantt/gantt-bar.js +1 -1
  323. package/dist/components/reui/gantt/gantt-bar.js.map +1 -1
  324. package/dist/components/reui/gantt/gantt-nav.js +1 -1
  325. package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
  326. package/dist/components/reui/gantt/gantt-view.js +1 -1
  327. package/dist/components/reui/gantt/gantt-view.js.map +1 -1
  328. package/dist/components/reui/gantt/gantt.js +1 -1
  329. package/dist/components/reui/gantt/gantt.js.map +1 -1
  330. package/dist/components/reui/icon-stack.js +1 -1
  331. package/dist/components/reui/icon-stack.js.map +1 -1
  332. package/dist/components/reui/icon-tile.d.ts +2 -2
  333. package/dist/components/reui/icon-tile.d.ts.map +1 -1
  334. package/dist/components/reui/icon-tile.js +1 -1
  335. package/dist/components/reui/icon-tile.js.map +1 -1
  336. package/dist/components/reui/kanban.d.ts.map +1 -1
  337. package/dist/components/reui/kanban.js +1 -1
  338. package/dist/components/reui/kanban.js.map +1 -1
  339. package/dist/components/reui/number-field.d.ts +3 -3
  340. package/dist/components/reui/number-field.js +1 -1
  341. package/dist/components/reui/number-field.js.map +1 -1
  342. package/dist/components/reui/phone-input.js +1 -1
  343. package/dist/components/reui/phone-input.js.map +1 -1
  344. package/dist/components/reui/rating.d.ts +1 -1
  345. package/dist/components/reui/rating.d.ts.map +1 -1
  346. package/dist/components/reui/rating.js +1 -1
  347. package/dist/components/reui/rating.js.map +1 -1
  348. package/dist/components/reui/sortable.d.ts.map +1 -1
  349. package/dist/components/reui/sortable.js +1 -1
  350. package/dist/components/reui/sortable.js.map +1 -1
  351. package/dist/components/reui/stepper.d.ts.map +1 -1
  352. package/dist/components/reui/stepper.js +1 -1
  353. package/dist/components/reui/stepper.js.map +1 -1
  354. package/dist/components/reui/timeline.d.ts.map +1 -1
  355. package/dist/components/reui/timeline.js +1 -1
  356. package/dist/components/reui/timeline.js.map +1 -1
  357. package/dist/components/reui/tree.d.ts.map +1 -1
  358. package/dist/components/reui/tree.js +1 -1
  359. package/dist/components/reui/tree.js.map +1 -1
  360. package/dist/components/ui/accordion.d.ts.map +1 -1
  361. package/dist/components/ui/accordion.js +1 -1
  362. package/dist/components/ui/accordion.js.map +1 -1
  363. package/dist/components/ui/alert-dialog.js +1 -1
  364. package/dist/components/ui/alert-dialog.js.map +1 -1
  365. package/dist/components/ui/alert.d.ts.map +1 -1
  366. package/dist/components/ui/alert.js +1 -1
  367. package/dist/components/ui/alert.js.map +1 -1
  368. package/dist/components/ui/aspect-ratio.js +1 -1
  369. package/dist/components/ui/aspect-ratio.js.map +1 -1
  370. package/dist/components/ui/attachment.d.ts +1 -1
  371. package/dist/components/ui/attachment.js +1 -1
  372. package/dist/components/ui/attachment.js.map +1 -1
  373. package/dist/components/ui/avatar.d.ts.map +1 -1
  374. package/dist/components/ui/avatar.js +1 -1
  375. package/dist/components/ui/avatar.js.map +1 -1
  376. package/dist/components/ui/badge.d.ts +1 -1
  377. package/dist/components/ui/badge.d.ts.map +1 -1
  378. package/dist/components/ui/badge.js +1 -1
  379. package/dist/components/ui/badge.js.map +1 -1
  380. package/dist/components/ui/breadcrumb.d.ts.map +1 -1
  381. package/dist/components/ui/breadcrumb.js +1 -1
  382. package/dist/components/ui/breadcrumb.js.map +1 -1
  383. package/dist/components/ui/bubble.d.ts +1 -1
  384. package/dist/components/ui/bubble.d.ts.map +1 -1
  385. package/dist/components/ui/bubble.js +1 -1
  386. package/dist/components/ui/bubble.js.map +1 -1
  387. package/dist/components/ui/button-group.js +1 -1
  388. package/dist/components/ui/button-group.js.map +1 -1
  389. package/dist/components/ui/button.d.ts +2 -2
  390. package/dist/components/ui/button.d.ts.map +1 -1
  391. package/dist/components/ui/button.js +1 -1
  392. package/dist/components/ui/button.js.map +1 -1
  393. package/dist/components/ui/calendar.js +1 -1
  394. package/dist/components/ui/calendar.js.map +1 -1
  395. package/dist/components/ui/card.d.ts.map +1 -1
  396. package/dist/components/ui/card.js +1 -1
  397. package/dist/components/ui/card.js.map +1 -1
  398. package/dist/components/ui/carousel.js +1 -1
  399. package/dist/components/ui/carousel.js.map +1 -1
  400. package/dist/components/ui/chart.d.ts.map +1 -1
  401. package/dist/components/ui/chart.js +1 -1
  402. package/dist/components/ui/chart.js.map +1 -1
  403. package/dist/components/ui/checkbox.d.ts.map +1 -1
  404. package/dist/components/ui/checkbox.js +1 -1
  405. package/dist/components/ui/checkbox.js.map +1 -1
  406. package/dist/components/ui/combobox.js +1 -1
  407. package/dist/components/ui/combobox.js.map +1 -1
  408. package/dist/components/ui/command.js +1 -1
  409. package/dist/components/ui/command.js.map +1 -1
  410. package/dist/components/ui/context-menu.d.ts.map +1 -1
  411. package/dist/components/ui/context-menu.js +1 -1
  412. package/dist/components/ui/context-menu.js.map +1 -1
  413. package/dist/components/ui/dialog.js +1 -1
  414. package/dist/components/ui/dialog.js.map +1 -1
  415. package/dist/components/ui/drawer.d.ts.map +1 -1
  416. package/dist/components/ui/drawer.js +1 -1
  417. package/dist/components/ui/drawer.js.map +1 -1
  418. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  419. package/dist/components/ui/dropdown-menu.js +1 -1
  420. package/dist/components/ui/dropdown-menu.js.map +1 -1
  421. package/dist/components/ui/empty.d.ts.map +1 -1
  422. package/dist/components/ui/empty.js +1 -1
  423. package/dist/components/ui/empty.js.map +1 -1
  424. package/dist/components/ui/field.js +1 -1
  425. package/dist/components/ui/field.js.map +1 -1
  426. package/dist/components/ui/hover-card.d.ts.map +1 -1
  427. package/dist/components/ui/hover-card.js +1 -1
  428. package/dist/components/ui/hover-card.js.map +1 -1
  429. package/dist/components/ui/input-group.js +1 -1
  430. package/dist/components/ui/input-group.js.map +1 -1
  431. package/dist/components/ui/input-otp.d.ts.map +1 -1
  432. package/dist/components/ui/input-otp.js +1 -1
  433. package/dist/components/ui/input-otp.js.map +1 -1
  434. package/dist/components/ui/input.d.ts.map +1 -1
  435. package/dist/components/ui/input.js +1 -1
  436. package/dist/components/ui/input.js.map +1 -1
  437. package/dist/components/ui/item.d.ts +2 -2
  438. package/dist/components/ui/item.js +1 -1
  439. package/dist/components/ui/item.js.map +1 -1
  440. package/dist/components/ui/kbd.js +1 -1
  441. package/dist/components/ui/kbd.js.map +1 -1
  442. package/dist/components/ui/label.d.ts.map +1 -1
  443. package/dist/components/ui/label.js +1 -1
  444. package/dist/components/ui/label.js.map +1 -1
  445. package/dist/components/ui/marker.d.ts.map +1 -1
  446. package/dist/components/ui/marker.js +1 -1
  447. package/dist/components/ui/marker.js.map +1 -1
  448. package/dist/components/ui/menubar.js +1 -1
  449. package/dist/components/ui/menubar.js.map +1 -1
  450. package/dist/components/ui/message-scroller.js +1 -1
  451. package/dist/components/ui/message-scroller.js.map +1 -1
  452. package/dist/components/ui/message.d.ts.map +1 -1
  453. package/dist/components/ui/message.js +1 -1
  454. package/dist/components/ui/message.js.map +1 -1
  455. package/dist/components/ui/native-select.d.ts.map +1 -1
  456. package/dist/components/ui/native-select.js +1 -1
  457. package/dist/components/ui/native-select.js.map +1 -1
  458. package/dist/components/ui/navigation-menu.d.ts.map +1 -1
  459. package/dist/components/ui/navigation-menu.js +1 -1
  460. package/dist/components/ui/navigation-menu.js.map +1 -1
  461. package/dist/components/ui/pagination.js +1 -1
  462. package/dist/components/ui/pagination.js.map +1 -1
  463. package/dist/components/ui/popover.d.ts.map +1 -1
  464. package/dist/components/ui/popover.js +1 -1
  465. package/dist/components/ui/popover.js.map +1 -1
  466. package/dist/components/ui/progress.d.ts.map +1 -1
  467. package/dist/components/ui/progress.js +1 -1
  468. package/dist/components/ui/progress.js.map +1 -1
  469. package/dist/components/ui/questionnaire.js +1 -1
  470. package/dist/components/ui/questionnaire.js.map +1 -1
  471. package/dist/components/ui/radio-group.d.ts.map +1 -1
  472. package/dist/components/ui/radio-group.js +1 -1
  473. package/dist/components/ui/radio-group.js.map +1 -1
  474. package/dist/components/ui/resizable.d.ts.map +1 -1
  475. package/dist/components/ui/resizable.js +1 -1
  476. package/dist/components/ui/resizable.js.map +1 -1
  477. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  478. package/dist/components/ui/scroll-area.js +1 -1
  479. package/dist/components/ui/scroll-area.js.map +1 -1
  480. package/dist/components/ui/select.d.ts.map +1 -1
  481. package/dist/components/ui/select.js +1 -1
  482. package/dist/components/ui/select.js.map +1 -1
  483. package/dist/components/ui/separator.d.ts.map +1 -1
  484. package/dist/components/ui/separator.js +1 -1
  485. package/dist/components/ui/separator.js.map +1 -1
  486. package/dist/components/ui/sheet.js +1 -1
  487. package/dist/components/ui/sheet.js.map +1 -1
  488. package/dist/components/ui/sidebar.d.ts +2 -2
  489. package/dist/components/ui/sidebar.js +1 -1
  490. package/dist/components/ui/sidebar.js.map +1 -1
  491. package/dist/components/ui/skeleton.js +1 -1
  492. package/dist/components/ui/skeleton.js.map +1 -1
  493. package/dist/components/ui/slider.d.ts.map +1 -1
  494. package/dist/components/ui/slider.js +1 -1
  495. package/dist/components/ui/slider.js.map +1 -1
  496. package/dist/components/ui/spinner.d.ts.map +1 -1
  497. package/dist/components/ui/spinner.js +1 -1
  498. package/dist/components/ui/spinner.js.map +1 -1
  499. package/dist/components/ui/switch.d.ts.map +1 -1
  500. package/dist/components/ui/switch.js +1 -1
  501. package/dist/components/ui/switch.js.map +1 -1
  502. package/dist/components/ui/table.d.ts.map +1 -1
  503. package/dist/components/ui/table.js +1 -1
  504. package/dist/components/ui/table.js.map +1 -1
  505. package/dist/components/ui/tabs.d.ts.map +1 -1
  506. package/dist/components/ui/tabs.js +1 -1
  507. package/dist/components/ui/tabs.js.map +1 -1
  508. package/dist/components/ui/textarea.d.ts.map +1 -1
  509. package/dist/components/ui/textarea.js +1 -1
  510. package/dist/components/ui/textarea.js.map +1 -1
  511. package/dist/components/ui/toast.js +1 -1
  512. package/dist/components/ui/toast.js.map +1 -1
  513. package/dist/components/ui/toggle-group.js +1 -1
  514. package/dist/components/ui/toggle-group.js.map +1 -1
  515. package/dist/components/ui/toggle.d.ts +2 -2
  516. package/dist/components/ui/toggle.d.ts.map +1 -1
  517. package/dist/components/ui/toggle.js +1 -1
  518. package/dist/components/ui/toggle.js.map +1 -1
  519. package/dist/components/ui/tooltip.d.ts.map +1 -1
  520. package/dist/components/ui/tooltip.js +1 -1
  521. package/dist/components/ui/tooltip.js.map +1 -1
  522. package/package.json +8 -10
@@ -2,7 +2,7 @@
2
2
  import { TOUCH_GESTURE_CLASS, capturePointer, releasePointer } from "../../lib/touch.js";
3
3
  import { EASE_OUT, SPRING_PRESS } from "../../lib/ease.js";
4
4
  import { forwardRef, useRef, useState } from "react";
5
- import { cn } from "cn";
5
+ import { cn } from "@kumix/utils";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { motion, useReducedMotion } from "motion/react";
8
8
  //#region src/components/motion/hold-action-button.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"hold-action-button.js","names":[],"sources":["../../../src/components/motion/hold-action-button.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n forwardRef,\n type KeyboardEvent,\n type PointerEvent,\n type ReactNode,\n useRef,\n useState,\n} from \"react\";\nimport { cn } from \"cn\";\nimport { type HTMLMotionProps, motion, useReducedMotion } from \"motion/react\";\n\nimport { EASE_OUT, SPRING_PRESS } from \"../../lib/ease\";\nimport { capturePointer, releasePointer, TOUCH_GESTURE_CLASS } from \"../../lib/touch\";\n\nexport interface HoldActionButtonProps\n extends Omit<\n HTMLMotionProps<\"button\">,\n | \"children\"\n | \"type\"\n | \"onClick\"\n | \"onPointerDown\"\n | \"onPointerUp\"\n | \"onPointerCancel\"\n | \"onPointerLeave\"\n | \"onPointerMove\"\n | \"onKeyDown\"\n | \"onKeyUp\"\n > {\n children: ReactNode;\n type?: \"vertical\" | \"horizontal\";\n holdingLabel?: ReactNode;\n completeLabel?: ReactNode;\n holdDuration?: number;\n onHoldComplete?: () => void;\n fillClassName?: string;\n labelClassName?: string;\n}\n\nexport const HoldActionButton = forwardRef<HTMLButtonElement, HoldActionButtonProps>(\n function HoldActionButton(\n {\n children,\n type = \"vertical\",\n holdingLabel = \"Keep holding\",\n completeLabel = \"Done\",\n holdDuration = 1600,\n onHoldComplete,\n fillClassName,\n labelClassName,\n className,\n disabled,\n ...rest\n },\n ref,\n ) {\n const reduce = useReducedMotion();\n const completedRef = useRef(false);\n const [holding, setHolding] = useState(false);\n const [completed, setCompleted] = useState(false);\n\n const startHold = () => {\n if (disabled || holding) return;\n completedRef.current = false;\n setCompleted(false);\n setHolding(true);\n };\n\n const cancelHold = () => {\n setHolding(false);\n setCompleted(false);\n };\n\n const handlePointerDown = (event: PointerEvent<HTMLButtonElement>) => {\n if (event.button !== 0) return;\n // Start first: capture is a convenience, and a browser that refuses it\n // must not take the hold down with it.\n startHold();\n capturePointer(event.currentTarget, event.pointerId);\n };\n\n const handlePointerUp = (event: PointerEvent<HTMLButtonElement>) => {\n releasePointer(event.currentTarget, event.pointerId);\n cancelHold();\n };\n\n const handlePointerLeave = (event: PointerEvent<HTMLButtonElement>) => {\n // Only reached when the capture below was refused: a captured pointer gets\n // no boundary events at all. A finger does not get this reading either way\n // — WebKit fires leave repeatedly for a touch that never moved, which\n // would cancel every hold on the frame it started.\n if (event.pointerType !== \"touch\") cancelHold();\n };\n\n const handlePointerMove = (event: PointerEvent<HTMLButtonElement>) => {\n // Leaving the button abandons the hold, and while the pointer is captured\n // nothing announces that: no boundary events, and `touch-none` means a\n // finger sliding off cannot scroll and so cannot cancel either. Measure it\n // instead — off the button ends the hold, wherever the pointer then goes.\n if (!holding) return;\n\n const rect = event.currentTarget.getBoundingClientRect();\n const outside =\n event.clientX < rect.left ||\n event.clientX > rect.right ||\n event.clientY < rect.top ||\n event.clientY > rect.bottom;\n\n if (outside) cancelHold();\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if ((event.key === \" \" || event.key === \"Enter\") && !event.repeat) {\n event.preventDefault();\n startHold();\n }\n };\n\n const handleKeyUp = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === \" \" || event.key === \"Enter\") {\n event.preventDefault();\n cancelHold();\n }\n };\n\n const handleFillComplete = () => {\n if (!holding || completedRef.current) return;\n completedRef.current = true;\n setCompleted(true);\n onHoldComplete?.();\n };\n\n const active = holding || completed;\n const activeTransform = type === \"horizontal\" ? \"translateX(0%)\" : \"translateY(0%)\";\n const idleTransform = type === \"horizontal\" ? \"translateX(-100%)\" : \"translateY(115%)\";\n\n return (\n <motion.button\n ref={ref}\n type=\"button\"\n disabled={disabled}\n aria-label={typeof children === \"string\" ? children : undefined}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={cancelHold}\n onPointerLeave={handlePointerLeave}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n onContextMenu={(event) => event.preventDefault()}\n whileTap={reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={cn(\n \"relative inline-grid h-16 min-w-72 touch-none place-items-center overflow-hidden rounded-(--hold-radius) bg-primary px-8 text-primary-foreground\",\n \"[--hold-radius:22px]\",\n TOUCH_GESTURE_CLASS,\n \"outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n className,\n )}\n {...rest}\n >\n {/* Safari hands the fill its own compositing layer and then stops\n applying the button's rounded overflow clip to it, so the liquid\n bleeds past the corners. clip-path survives compositing. It lives on\n this static layer rather than the button so it never cuts the focus\n ring, and reads the same radius so the two cannot drift apart. */}\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0 [clip-path:inset(0_round_var(--hold-radius))]\"\n >\n <motion.span\n aria-hidden=\"true\"\n initial={false}\n animate={\n reduce\n ? { opacity: active ? 1 : 0, transform: \"none\" }\n : {\n opacity: 1,\n transform: active ? activeTransform : idleTransform,\n }\n }\n transition={\n active\n ? { duration: holdDuration / 1000, ease: \"linear\" }\n : { duration: reduce ? 0.15 : 0.24, ease: EASE_OUT }\n }\n onAnimationComplete={handleFillComplete}\n className={cn(\n \"absolute inset-0 bg-sky-400 will-change-[opacity,transform]\",\n fillClassName,\n )}\n >\n {!reduce ? (\n type === \"horizontal\" ? (\n <motion.svg\n viewBox=\"0 0 24 240\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n animate={{\n transform: active ? \"translateY(-50%)\" : \"translateY(0%)\",\n }}\n transition={{\n duration: 1.1,\n ease: \"linear\",\n repeat: active ? Number.POSITIVE_INFINITY : 0,\n }}\n className=\"absolute top-0 -right-5 h-[200%] w-6 text-sky-400\"\n >\n <path\n d=\"M0 0h12C2 20 2 40 12 60s10 40 0 60-10 40 0 60 10 40 0 60H0Z\"\n fill=\"currentColor\"\n />\n </motion.svg>\n ) : (\n <motion.svg\n viewBox=\"0 0 240 24\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n animate={{\n transform: active ? \"translateX(-50%)\" : \"translateX(0%)\",\n }}\n transition={{\n duration: 1.1,\n ease: \"linear\",\n repeat: active ? Number.POSITIVE_INFINITY : 0,\n }}\n className=\"absolute -top-5 left-0 h-6 w-[200%] text-sky-400\"\n >\n <path\n d=\"M0 12C20 2 40 2 60 12s40 10 60 0 40-10 60 0 40 10 60 0v12H0Z\"\n fill=\"currentColor\"\n />\n </motion.svg>\n )\n ) : null}\n </motion.span>\n </span>\n\n <span\n className={cn(\n \"relative z-10 grid place-items-center font-medium text-base tracking-[-0.01em]\",\n labelClassName,\n )}\n >\n <motion.span\n animate={{ opacity: active ? 0 : 1 }}\n transition={{ duration: reduce ? 0 : 0.12, ease: EASE_OUT }}\n className=\"col-start-1 row-start-1\"\n >\n {children}\n </motion.span>\n <motion.span\n aria-hidden={!holding || completed}\n animate={{ opacity: holding && !completed ? 1 : 0 }}\n transition={{ duration: reduce ? 0 : 0.12, ease: EASE_OUT }}\n className=\"col-start-1 row-start-1\"\n >\n {holdingLabel}\n </motion.span>\n <motion.span\n aria-hidden={!completed}\n animate={{ opacity: completed ? 1 : 0 }}\n transition={{ duration: reduce ? 0 : 0.12, ease: EASE_OUT }}\n className=\"col-start-1 row-start-1\"\n >\n {completeLabel}\n </motion.span>\n </span>\n </motion.button>\n );\n },\n);\n"],"mappings":";;;;;;;;AAwCA,MAAa,mBAAmB,WAC9B,SAAS,iBACP,EACE,UACA,OAAO,YACP,eAAe,gBACf,gBAAgB,QAChB,eAAe,MACf,gBACA,eACA,gBACA,WACA,UACA,GAAG,QAEL,KACA;CACA,MAAM,SAAS,iBAAiB;CAChC,MAAM,eAAe,OAAO,KAAK;CACjC,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAC5C,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;CAEhD,MAAM,kBAAkB;EACtB,IAAI,YAAY,SAAS;EACzB,aAAa,UAAU;EACvB,aAAa,KAAK;EAClB,WAAW,IAAI;CACjB;CAEA,MAAM,mBAAmB;EACvB,WAAW,KAAK;EAChB,aAAa,KAAK;CACpB;CAEA,MAAM,qBAAqB,UAA2C;EACpE,IAAI,MAAM,WAAW,GAAG;EAGxB,UAAU;EACV,eAAe,MAAM,eAAe,MAAM,SAAS;CACrD;CAEA,MAAM,mBAAmB,UAA2C;EAClE,eAAe,MAAM,eAAe,MAAM,SAAS;EACnD,WAAW;CACb;CAEA,MAAM,sBAAsB,UAA2C;EAKrE,IAAI,MAAM,gBAAgB,SAAS,WAAW;CAChD;CAEA,MAAM,qBAAqB,UAA2C;EAKpE,IAAI,CAAC,SAAS;EAEd,MAAM,OAAO,MAAM,cAAc,sBAAsB;EAOvD,IALE,MAAM,UAAU,KAAK,QACrB,MAAM,UAAU,KAAK,SACrB,MAAM,UAAU,KAAK,OACrB,MAAM,UAAU,KAAK,QAEV,WAAW;CAC1B;CAEA,MAAM,iBAAiB,UAA4C;EACjE,KAAK,MAAM,QAAQ,OAAO,MAAM,QAAQ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iBAC3C;KACA,YAAY;MACV,UAAU;MACV,MAAM;MACN,QAAQ,SAAS,OAAO,oBAAoB;KAC9C;KACA,WAAU;KAEV,UAAA,oBAAC,QAAD;MACE,GAAE;MACF,MAAK;KACN,CAAA;IACS,CAAA,IAEZ,oBAAC,OAAO,KAAR;KACE,SAAQ;KACR,qBAAoB;KACpB,eAAY;KACZ,SAAS,EACP,WAAW,SAAS,qBAAqB,iBAC3C;KACA,YAAY;MACV,UAAU;MACV,MAAM;MACN,QAAQ,SAAS,OAAO,oBAAoB;KAC9C;KACA,WAAU;KAEV,UAAA,oBAAC,QAAD;MACE,GAAE;MACF,MAAK;KACN,CAAA;IACS,CAAA,IAEZ;GACO,CAAA;EACT,CAAA,GAEN,qBAAC,QAAD;GACE,WAAW,GACT,kFACA,cACF;GAJF,UAAA;IAME,oBAAC,OAAO,MAAR;KACE,SAAS,EAAE,SAAS,SAAS,IAAI,EAAE;KACnC,YAAY;MAAE,UAAU,SAAS,IAAI;MAAM,MAAM;KAAS;KAC1D,WAAU;KAET;IACU,CAAA;IACb,oBAAC,OAAO,MAAR;KACE,eAAa,CAAC,WAAW;KACzB,SAAS,EAAE,SAAS,WAAW,CAAC,YAAY,IAAI,EAAE;KAClD,YAAY;MAAE,UAAU,SAAS,IAAI;MAAM,MAAM;KAAS;KAC1D,WAAU;KAET,UAAA;IACU,CAAA;IACb,oBAAC,OAAO,MAAR;KACE,eAAa,CAAC;KACd,SAAS,EAAE,SAAS,YAAY,IAAI,EAAE;KACtC,YAAY;MAAE,UAAU,SAAS,IAAI;MAAM,MAAM;KAAS;KAC1D,WAAU;KAET,UAAA;IACU,CAAA;GACT;EACO,CAAA,CAAA;;AAEnB,CACF"}
1
+ {"version":3,"file":"hold-action-button.js","names":[],"sources":["../../../src/components/motion/hold-action-button.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n forwardRef,\n type KeyboardEvent,\n type PointerEvent,\n type ReactNode,\n useRef,\n useState,\n} from \"react\";\nimport { type HTMLMotionProps, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_PRESS } from \"../../lib/ease\";\nimport { capturePointer, releasePointer, TOUCH_GESTURE_CLASS } from \"../../lib/touch\";\n\nexport interface HoldActionButtonProps\n extends Omit<\n HTMLMotionProps<\"button\">,\n | \"children\"\n | \"type\"\n | \"onClick\"\n | \"onPointerDown\"\n | \"onPointerUp\"\n | \"onPointerCancel\"\n | \"onPointerLeave\"\n | \"onPointerMove\"\n | \"onKeyDown\"\n | \"onKeyUp\"\n > {\n children: ReactNode;\n type?: \"vertical\" | \"horizontal\";\n holdingLabel?: ReactNode;\n completeLabel?: ReactNode;\n holdDuration?: number;\n onHoldComplete?: () => void;\n fillClassName?: string;\n labelClassName?: string;\n}\n\nexport const HoldActionButton = forwardRef<HTMLButtonElement, HoldActionButtonProps>(\n function HoldActionButton(\n {\n children,\n type = \"vertical\",\n holdingLabel = \"Keep holding\",\n completeLabel = \"Done\",\n holdDuration = 1600,\n onHoldComplete,\n fillClassName,\n labelClassName,\n className,\n disabled,\n ...rest\n },\n ref,\n ) {\n const reduce = useReducedMotion();\n const completedRef = useRef(false);\n const [holding, setHolding] = useState(false);\n const [completed, setCompleted] = useState(false);\n\n const startHold = () => {\n if (disabled || holding) return;\n completedRef.current = false;\n setCompleted(false);\n setHolding(true);\n };\n\n const cancelHold = () => {\n setHolding(false);\n setCompleted(false);\n };\n\n const handlePointerDown = (event: PointerEvent<HTMLButtonElement>) => {\n if (event.button !== 0) return;\n // Start first: capture is a convenience, and a browser that refuses it\n // must not take the hold down with it.\n startHold();\n capturePointer(event.currentTarget, event.pointerId);\n };\n\n const handlePointerUp = (event: PointerEvent<HTMLButtonElement>) => {\n releasePointer(event.currentTarget, event.pointerId);\n cancelHold();\n };\n\n const handlePointerLeave = (event: PointerEvent<HTMLButtonElement>) => {\n // Only reached when the capture below was refused: a captured pointer gets\n // no boundary events at all. A finger does not get this reading either way\n // — WebKit fires leave repeatedly for a touch that never moved, which\n // would cancel every hold on the frame it started.\n if (event.pointerType !== \"touch\") cancelHold();\n };\n\n const handlePointerMove = (event: PointerEvent<HTMLButtonElement>) => {\n // Leaving the button abandons the hold, and while the pointer is captured\n // nothing announces that: no boundary events, and `touch-none` means a\n // finger sliding off cannot scroll and so cannot cancel either. Measure it\n // instead — off the button ends the hold, wherever the pointer then goes.\n if (!holding) return;\n\n const rect = event.currentTarget.getBoundingClientRect();\n const outside =\n event.clientX < rect.left ||\n event.clientX > rect.right ||\n event.clientY < rect.top ||\n event.clientY > rect.bottom;\n\n if (outside) cancelHold();\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if ((event.key === \" \" || event.key === \"Enter\") && !event.repeat) {\n event.preventDefault();\n startHold();\n }\n };\n\n const handleKeyUp = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === \" \" || event.key === \"Enter\") {\n event.preventDefault();\n cancelHold();\n }\n };\n\n const handleFillComplete = () => {\n if (!holding || completedRef.current) return;\n completedRef.current = true;\n setCompleted(true);\n onHoldComplete?.();\n };\n\n const active = holding || completed;\n const activeTransform = type === \"horizontal\" ? \"translateX(0%)\" : \"translateY(0%)\";\n const idleTransform = type === \"horizontal\" ? \"translateX(-100%)\" : \"translateY(115%)\";\n\n return (\n <motion.button\n ref={ref}\n type=\"button\"\n disabled={disabled}\n aria-label={typeof children === \"string\" ? children : undefined}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={cancelHold}\n onPointerLeave={handlePointerLeave}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n onContextMenu={(event) => event.preventDefault()}\n whileTap={reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={cn(\n \"relative inline-grid h-16 min-w-72 touch-none place-items-center overflow-hidden rounded-(--hold-radius) bg-primary px-8 text-primary-foreground\",\n \"[--hold-radius:22px]\",\n TOUCH_GESTURE_CLASS,\n \"outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n className,\n )}\n {...rest}\n >\n {/* Safari hands the fill its own compositing layer and then stops\n applying the button's rounded overflow clip to it, so the liquid\n bleeds past the corners. clip-path survives compositing. It lives on\n this static layer rather than the button so it never cuts the focus\n ring, and reads the same radius so the two cannot drift apart. */}\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0 [clip-path:inset(0_round_var(--hold-radius))]\"\n >\n <motion.span\n aria-hidden=\"true\"\n initial={false}\n animate={\n reduce\n ? { opacity: active ? 1 : 0, transform: \"none\" }\n : {\n opacity: 1,\n transform: active ? activeTransform : idleTransform,\n }\n }\n transition={\n active\n ? { duration: holdDuration / 1000, ease: \"linear\" }\n : { duration: reduce ? 0.15 : 0.24, ease: EASE_OUT }\n }\n onAnimationComplete={handleFillComplete}\n className={cn(\n \"absolute inset-0 bg-sky-400 will-change-[opacity,transform]\",\n fillClassName,\n )}\n >\n {!reduce ? (\n type === \"horizontal\" ? (\n <motion.svg\n viewBox=\"0 0 24 240\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n animate={{\n transform: active ? \"translateY(-50%)\" : \"translateY(0%)\",\n }}\n transition={{\n duration: 1.1,\n ease: \"linear\",\n repeat: active ? Number.POSITIVE_INFINITY : 0,\n }}\n className=\"absolute top-0 -right-5 h-[200%] w-6 text-sky-400\"\n >\n <path\n d=\"M0 0h12C2 20 2 40 12 60s10 40 0 60-10 40 0 60 10 40 0 60H0Z\"\n fill=\"currentColor\"\n />\n </motion.svg>\n ) : (\n <motion.svg\n viewBox=\"0 0 240 24\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n animate={{\n transform: active ? \"translateX(-50%)\" : \"translateX(0%)\",\n }}\n transition={{\n duration: 1.1,\n ease: \"linear\",\n repeat: active ? Number.POSITIVE_INFINITY : 0,\n }}\n className=\"absolute -top-5 left-0 h-6 w-[200%] text-sky-400\"\n >\n <path\n d=\"M0 12C20 2 40 2 60 12s40 10 60 0 40-10 60 0 40 10 60 0v12H0Z\"\n fill=\"currentColor\"\n />\n </motion.svg>\n )\n ) : null}\n </motion.span>\n </span>\n\n <span\n className={cn(\n \"relative z-10 grid place-items-center font-medium text-base tracking-[-0.01em]\",\n labelClassName,\n )}\n >\n <motion.span\n animate={{ opacity: active ? 0 : 1 }}\n transition={{ duration: reduce ? 0 : 0.12, ease: EASE_OUT }}\n className=\"col-start-1 row-start-1\"\n >\n {children}\n </motion.span>\n <motion.span\n aria-hidden={!holding || completed}\n animate={{ opacity: holding && !completed ? 1 : 0 }}\n transition={{ duration: reduce ? 0 : 0.12, ease: EASE_OUT }}\n className=\"col-start-1 row-start-1\"\n >\n {holdingLabel}\n </motion.span>\n <motion.span\n aria-hidden={!completed}\n animate={{ opacity: completed ? 1 : 0 }}\n transition={{ duration: reduce ? 0 : 0.12, ease: EASE_OUT }}\n className=\"col-start-1 row-start-1\"\n >\n {completeLabel}\n </motion.span>\n </span>\n </motion.button>\n );\n },\n);\n"],"mappings":";;;;;;;;AAwCA,MAAa,mBAAmB,WAC9B,SAAS,iBACP,EACE,UACA,OAAO,YACP,eAAe,gBACf,gBAAgB,QAChB,eAAe,MACf,gBACA,eACA,gBACA,WACA,UACA,GAAG,QAEL,KACA;CACA,MAAM,SAAS,iBAAiB;CAChC,MAAM,eAAe,OAAO,KAAK;CACjC,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAC5C,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;CAEhD,MAAM,kBAAkB;EACtB,IAAI,YAAY,SAAS;EACzB,aAAa,UAAU;EACvB,aAAa,KAAK;EAClB,WAAW,IAAI;CACjB;CAEA,MAAM,mBAAmB;EACvB,WAAW,KAAK;EAChB,aAAa,KAAK;CACpB;CAEA,MAAM,qBAAqB,UAA2C;EACpE,IAAI,MAAM,WAAW,GAAG;EAGxB,UAAU;E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E;KAClD,YAAY;MAAE,UAAU,SAAS,IAAI;MAAM,MAAM;KAAS;KAC1D,WAAU;KAET,UAAA;IACU,CAAA;IACb,oBAAC,OAAO,MAAR;KACE,eAAa,CAAC;KACd,SAAS,EAAE,SAAS,YAAY,IAAI,EAAE;KACtC,YAAY;MAAE,UAAU,SAAS,IAAI;MAAM,MAAM;KAAS;KAC1D,WAAU;KAET,UAAA;IACU,CAAA;GACT;EACO,CAAA,CAAA;;AAEnB,CACF"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { EASE_OUT, SPRING_PANEL } from "../../lib/ease.js";
3
3
  import { useEffect, useRef, useState } from "react";
4
- import { cn } from "cn";
4
+ import { cn } from "@kumix/utils";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { motion, useReducedMotion } from "motion/react";
7
7
  import { AlertCircle, Inbox } from "lucide-react";
@@ -1 +1 @@
1
- {"version":3,"file":"infinite-masonry.js","names":[],"sources":["../../../src/components/motion/infinite-masonry.tsx"],"sourcesContent":["\"use client\";\n\nimport { type MutableRefObject, type ReactNode, useEffect, useRef, useState } from \"react\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { cn } from \"cn\";\nimport { AlertCircle, Inbox } from \"lucide-react\";\nimport { motion, useReducedMotion } from \"motion/react\";\n\nimport { EASE_OUT, SPRING_PANEL } from \"../../lib/ease\";\n\nexport type InfiniteMasonryKey = string | number | bigint;\n\nexport interface InfiniteMasonryProps<T> {\n items: readonly T[];\n getItemKey: (item: T, index: number) => InfiniteMasonryKey;\n renderItem: (item: T, index: number) => ReactNode;\n onLoadMore: () => void | Promise<void>;\n hasMore: boolean;\n loading?: boolean;\n error?: ReactNode;\n onRetry?: () => void;\n estimateSize?: (item: T, index: number) => number;\n renderLoadingItem?: (index: number) => ReactNode;\n emptyState?: ReactNode;\n endState?: ReactNode;\n minColumnWidth?: number;\n maxColumns?: number;\n gap?: number;\n overscan?: number;\n prefetch?: number;\n animateItems?: boolean;\n ariaLabel?: string;\n className?: string;\n contentClassName?: string;\n itemClassName?: string;\n}\n\ntype MasonryMetrics = {\n columns: number;\n width: number;\n};\n\nfunction useMasonryMetrics({\n elementRef,\n gap,\n maxColumns,\n minColumnWidth,\n}: {\n elementRef: React.RefObject<HTMLDivElement | null>;\n gap: number;\n maxColumns: number;\n minColumnWidth: number;\n}) {\n const [metrics, setMetrics] = useState<MasonryMetrics>({\n columns: 1,\n width: 0,\n });\n\n useEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n\n const update = (width: number) => {\n const columns = Math.min(\n maxColumns,\n Math.max(1, Math.floor((width + gap) / (minColumnWidth + gap))),\n );\n\n setMetrics((current) =>\n current.columns === columns && current.width === width ? current : { columns, width },\n );\n };\n\n update(element.getBoundingClientRect().width);\n\n const observer = new ResizeObserver(([entry]) => {\n update(entry.contentRect.width);\n });\n observer.observe(element);\n\n return () => observer.disconnect();\n }, [elementRef, gap, maxColumns, minColumnWidth]);\n\n return metrics;\n}\n\nfunction DefaultLoadingItem({ index }: { index: number }) {\n return (\n <div\n aria-hidden=\"true\"\n className=\"animate-pulse rounded-2xl border border-border bg-card p-3\"\n style={{ minHeight: 144 + (index % 3) * 36 }}\n >\n <div className=\"h-3 w-2/3 rounded-full bg-muted\" />\n <div className=\"mt-3 h-2 w-full rounded-full bg-muted\" />\n <div className=\"mt-2 h-2 w-4/5 rounded-full bg-muted\" />\n </div>\n );\n}\n\nfunction DefaultEmptyState() {\n return (\n <div className=\"flex h-full min-h-64 flex-col items-center justify-center px-6 text-center\">\n <Inbox className=\"size-8 text-muted-foreground\" aria-hidden=\"true\" />\n <p className=\"mt-3 font-medium text-foreground text-sm\">No items yet</p>\n <p className=\"mt-1 max-w-xs text-muted-foreground text-xs leading-5\">\n New items will appear here when they become available.\n </p>\n </div>\n );\n}\n\nfunction MasonryItemReveal({\n itemKey,\n lane,\n revealedKeys,\n animate,\n children,\n}: {\n itemKey: InfiniteMasonryKey;\n lane: number;\n revealedKeys: MutableRefObject<Set<InfiniteMasonryKey>>;\n animate: boolean;\n children: ReactNode;\n}) {\n const [shouldReveal] = useState(() => animate && !revealedKeys.current.has(itemKey));\n\n useEffect(() => {\n revealedKeys.current.add(itemKey);\n }, [itemKey, revealedKeys]);\n\n const delay = Math.min(lane, 3) * 0.04;\n\n return (\n <motion.div\n initial={shouldReveal ? { opacity: 0, y: 12 } : false}\n animate={{ opacity: 1, y: 0 }}\n transition={{\n y: { ...SPRING_PANEL, delay },\n opacity: { duration: 0.2, ease: EASE_OUT, delay },\n }}\n >\n {children}\n </motion.div>\n );\n}\n\nexport function InfiniteMasonry<T>({\n items,\n getItemKey,\n renderItem,\n onLoadMore,\n hasMore,\n loading = false,\n error,\n onRetry,\n estimateSize = () => 240,\n renderLoadingItem = (index) => <DefaultLoadingItem index={index} />,\n emptyState = <DefaultEmptyState />,\n endState,\n minColumnWidth = 208,\n maxColumns = 4,\n gap = 12,\n overscan = 4,\n prefetch = 3,\n animateItems = true,\n ariaLabel = \"Infinite masonry feed\",\n className,\n contentClassName,\n itemClassName,\n}: InfiniteMasonryProps<T>) {\n const reduceMotion = useReducedMotion();\n const scrollRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const loadMoreRef = useRef(onLoadMore);\n const loadPendingRef = useRef(false);\n const initialItemCountRef = useRef(items.length);\n const revealedKeysRef = useRef(new Set<InfiniteMasonryKey>());\n const { columns, width } = useMasonryMetrics({\n elementRef: contentRef,\n gap,\n maxColumns,\n minColumnWidth,\n });\n\n useEffect(() => {\n loadMoreRef.current = onLoadMore;\n }, [onLoadMore]);\n\n useEffect(() => {\n if (!loading) loadPendingRef.current = false;\n }, [loading]);\n\n const hasError = error !== undefined && error !== null;\n const tailCount = hasError ? 1 : loading ? columns : 0;\n const virtualizer = useVirtualizer({\n count: items.length + tailCount,\n getScrollElement: () => scrollRef.current,\n getItemKey: (index) =>\n index < items.length\n ? getItemKey(items[index], index)\n : `masonry-tail-${index - items.length}`,\n estimateSize: (index) =>\n index < items.length\n ? estimateSize(items[index], index)\n : 144 + ((index - items.length) % 3) * 36,\n gap,\n lanes: columns,\n overscan: overscan * columns,\n });\n\n const virtualItems = virtualizer.getVirtualItems();\n const viewportEnd = (virtualizer.scrollOffset ?? 0) + (virtualizer.scrollRect?.height ?? 0);\n const lastVisibleIndex = virtualItems.reduce(\n (lastIndex, item) => (item.start < viewportEnd ? Math.max(lastIndex, item.index) : lastIndex),\n -1,\n );\n\n useEffect(() => {\n if (\n hasError ||\n loading ||\n !hasMore ||\n loadPendingRef.current ||\n lastVisibleIndex < Math.max(0, items.length - prefetch)\n ) {\n return;\n }\n\n loadPendingRef.current = true;\n void Promise.resolve(loadMoreRef.current()).finally(() => {\n loadPendingRef.current = false;\n });\n }, [hasError, hasMore, items.length, lastVisibleIndex, loading, prefetch]);\n\n if (items.length === 0 && !hasMore && !loading && !hasError) {\n return (\n <section\n aria-label={ariaLabel}\n className={cn(\n \"w-full overflow-hidden rounded-3xl border border-border bg-background\",\n className,\n )}\n >\n {emptyState}\n </section>\n );\n }\n\n const columnWidth = columns > 0 ? Math.max(0, (width - gap * (columns - 1)) / columns) : 0;\n\n return (\n <section\n ref={scrollRef}\n aria-label={ariaLabel}\n aria-busy={loading}\n className={cn(\n \"contain-[layout_paint] w-full overflow-y-auto overscroll-none rounded-3xl border border-border bg-background p-3 [overflow-anchor:none] [scrollbar-gutter:stable]\",\n className,\n )}\n >\n <div\n ref={contentRef}\n className={cn(\"relative w-full\", contentClassName)}\n style={{ height: virtualizer.getTotalSize() }}\n >\n {virtualItems.map((virtualItem) => {\n const isTail = virtualItem.index >= items.length;\n const tailIndex = virtualItem.index - items.length;\n\n return (\n <div\n key={virtualItem.key}\n ref={virtualizer.measureElement}\n data-index={virtualItem.index}\n className={cn(\n \"absolute top-0 left-0 will-change-transform\",\n !isTail && itemClassName,\n )}\n style={{\n width: columnWidth,\n transform: `translate3d(${virtualItem.lane * (columnWidth + gap)}px, ${virtualItem.start}px, 0)`,\n }}\n >\n {isTail ? (\n hasError ? (\n <div className=\"flex min-h-36 flex-col items-start justify-center rounded-2xl border border-destructive/20 bg-destructive/5 p-4\">\n <div className=\"flex items-center gap-2 text-destructive\">\n <AlertCircle className=\"size-4\" aria-hidden=\"true\" />\n <p className=\"font-medium text-sm\">Couldn&apos;t load more</p>\n </div>\n <div className=\"mt-2 text-muted-foreground text-xs leading-5\">{error}</div>\n {onRetry ? (\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"mt-3 min-h-10 rounded-full border border-border bg-background px-4 font-medium text-foreground text-xs outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n >\n Try again\n </button>\n ) : null}\n </div>\n ) : (\n renderLoadingItem(tailIndex)\n )\n ) : (\n <MasonryItemReveal\n itemKey={virtualItem.key}\n lane={virtualItem.lane}\n revealedKeys={revealedKeysRef}\n animate={\n animateItems &&\n !reduceMotion &&\n virtualItem.index >= initialItemCountRef.current\n }\n >\n {renderItem(items[virtualItem.index], virtualItem.index)}\n </MasonryItemReveal>\n )}\n </div>\n );\n })}\n </div>\n\n {!hasMore && items.length > 0 && endState ? (\n <div className=\"py-4 text-center text-muted-foreground text-xs\">{endState}</div>\n ) : null}\n <span className=\"sr-only\" aria-live=\"polite\">\n {loading ? \"Loading more items\" : null}\n </span>\n </section>\n );\n}\n"],"mappings":";;;;;;;;;AA0CA,SAAS,kBAAkB,EACzB,YACA,KACA,YACA,kBAMC;CACD,MAAM,CAAC,SAAS,cAAc,SAAyB;EACrD,SAAS;EACT,OAAO;CACT,CAAC;CAED,gBAAgB;EACd,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EAEd,MAAM,UAAU,UAAkB;GAChC,MAAM,UAAU,KAAK,IACnB,YACA,KAAK,IAAI,GAAG,KAAK,OAAO,QAAQ,QAAQ,iBAAiB,IAAI,CAAC,CAChE;GAEA,YAAY,YACV,QAAQ,YAAY,WAAW,QAAQ,UAAU,QAAQ,UAA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,SACC,WACE,qBAAC,OAAD;OAAK,WAAU;OAAf,UAAA;QACE,qBAAC,OAAD;SAAK,WAAU;SAAf,UAAA,CACE,oBAAC,aAAD;UAAa,WAAU;UAAS,eAAY;SAAQ,CAAA,GACpD,oBAAC,KAAD;UAAG,WAAU;UAAsB,UAAA;SAA0B,CAAA,CAC1D;;QACL,oBAAC,OAAD;SAAK,WAAU;SAAgD,UAAA;QAAW,CAAA;QACzE,UACC,oBAAC,UAAD;SACE,MAAK;SACL,SAAS;SACT,WAAU;SACX,UAAA;QAEO,CAAA,IACN;OACD;MAEL,CAAA,IAAA,kBAAkB,SAAS,IAG7B,oBAAC,mBAAD;OACE,SAAS,YAAY;OACrB,MAAM,YAAY;OAClB,cAAc;OACd,SACE,gBACA,CAAC,gBACD,YAAY,SAAS,oBAAoB;OAG1C,UAAA,WAAW,MAAM,YAAY,QAAQ,YAAY,KAAK;MACtC,CAAA;KAElB,GA/CE,YAAY,GA+Cd;IAET,CAAC;GACE,CAAA;GAEJ,CAAC,WAAW,MAAM,SAAS,KAAK,WAC/B,oBAAC,OAAD;IAAK,WAAU;IAAkD,UAAA;GAAc,CAAA,IAC7E;GACJ,oBAAC,QAAD;IAAM,WAAU;IAAU,aAAU;IACjC,UAAA,UAAU,uBAAuB;GAC9B,CAAA;EACC;;AAEb"}
1
+ {"version":3,"file":"infinite-masonry.js","names":[],"sources":["../../../src/components/motion/infinite-masonry.tsx"],"sourcesContent":["\"use client\";\n\nimport { type MutableRefObject, type ReactNode, useEffect, useRef, useState } from \"react\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { AlertCircle, Inbox } from \"lucide-react\";\nimport { motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_PANEL } from \"../../lib/ease\";\n\nexport type InfiniteMasonryKey = string | number | bigint;\n\nexport interface InfiniteMasonryProps<T> {\n items: readonly T[];\n getItemKey: (item: T, index: number) => InfiniteMasonryKey;\n renderItem: (item: T, index: number) => ReactNode;\n onLoadMore: () => void | Promise<void>;\n hasMore: boolean;\n loading?: boolean;\n error?: ReactNode;\n onRetry?: () => void;\n estimateSize?: (item: T, index: number) => number;\n renderLoadingItem?: (index: number) => ReactNode;\n emptyState?: ReactNode;\n endState?: ReactNode;\n minColumnWidth?: number;\n maxColumns?: number;\n gap?: number;\n overscan?: number;\n prefetch?: number;\n animateItems?: boolean;\n ariaLabel?: string;\n className?: string;\n contentClassName?: string;\n itemClassName?: string;\n}\n\ntype MasonryMetrics = {\n columns: number;\n width: number;\n};\n\nfunction useMasonryMetrics({\n elementRef,\n gap,\n maxColumns,\n minColumnWidth,\n}: {\n elementRef: React.RefObject<HTMLDivElement | null>;\n gap: number;\n maxColumns: number;\n minColumnWidth: number;\n}) {\n const [metrics, setMetrics] = useState<MasonryMetrics>({\n columns: 1,\n width: 0,\n });\n\n useEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n\n const update = (width: number) => {\n const columns = Math.min(\n maxColumns,\n Math.max(1, Math.floor((width + gap) / (minColumnWidth + gap))),\n );\n\n setMetrics((current) =>\n current.columns === columns && current.width === width ? current : { columns, width },\n );\n };\n\n update(element.getBoundingClientRect().width);\n\n const observer = new ResizeObserver(([entry]) => {\n update(entry.contentRect.width);\n });\n observer.observe(element);\n\n return () => observer.disconnect();\n }, [elementRef, gap, maxColumns, minColumnWidth]);\n\n return metrics;\n}\n\nfunction DefaultLoadingItem({ index }: { index: number }) {\n return (\n <div\n aria-hidden=\"true\"\n className=\"animate-pulse rounded-2xl border border-border bg-card p-3\"\n style={{ minHeight: 144 + (index % 3) * 36 }}\n >\n <div className=\"h-3 w-2/3 rounded-full bg-muted\" />\n <div className=\"mt-3 h-2 w-full rounded-full bg-muted\" />\n <div className=\"mt-2 h-2 w-4/5 rounded-full bg-muted\" />\n </div>\n );\n}\n\nfunction DefaultEmptyState() {\n return (\n <div className=\"flex h-full min-h-64 flex-col items-center justify-center px-6 text-center\">\n <Inbox className=\"size-8 text-muted-foreground\" aria-hidden=\"true\" />\n <p className=\"mt-3 font-medium text-foreground text-sm\">No items yet</p>\n <p className=\"mt-1 max-w-xs text-muted-foreground text-xs leading-5\">\n New items will appear here when they become available.\n </p>\n </div>\n );\n}\n\nfunction MasonryItemReveal({\n itemKey,\n lane,\n revealedKeys,\n animate,\n children,\n}: {\n itemKey: InfiniteMasonryKey;\n lane: number;\n revealedKeys: MutableRefObject<Set<InfiniteMasonryKey>>;\n animate: boolean;\n children: ReactNode;\n}) {\n const [shouldReveal] = useState(() => animate && !revealedKeys.current.has(itemKey));\n\n useEffect(() => {\n revealedKeys.current.add(itemKey);\n }, [itemKey, revealedKeys]);\n\n const delay = Math.min(lane, 3) * 0.04;\n\n return (\n <motion.div\n initial={shouldReveal ? { opacity: 0, y: 12 } : false}\n animate={{ opacity: 1, y: 0 }}\n transition={{\n y: { ...SPRING_PANEL, delay },\n opacity: { duration: 0.2, ease: EASE_OUT, delay },\n }}\n >\n {children}\n </motion.div>\n );\n}\n\nexport function InfiniteMasonry<T>({\n items,\n getItemKey,\n renderItem,\n onLoadMore,\n hasMore,\n loading = false,\n error,\n onRetry,\n estimateSize = () => 240,\n renderLoadingItem = (index) => <DefaultLoadingItem index={index} />,\n emptyState = <DefaultEmptyState />,\n endState,\n minColumnWidth = 208,\n maxColumns = 4,\n gap = 12,\n overscan = 4,\n prefetch = 3,\n animateItems = true,\n ariaLabel = \"Infinite masonry feed\",\n className,\n contentClassName,\n itemClassName,\n}: InfiniteMasonryProps<T>) {\n const reduceMotion = useReducedMotion();\n const scrollRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const loadMoreRef = useRef(onLoadMore);\n const loadPendingRef = useRef(false);\n const initialItemCountRef = useRef(items.length);\n const revealedKeysRef = useRef(new Set<InfiniteMasonryKey>());\n const { columns, width } = useMasonryMetrics({\n elementRef: contentRef,\n gap,\n maxColumns,\n minColumnWidth,\n });\n\n useEffect(() => {\n loadMoreRef.current = onLoadMore;\n }, [onLoadMore]);\n\n useEffect(() => {\n if (!loading) loadPendingRef.current = false;\n }, [loading]);\n\n const hasError = error !== undefined && error !== null;\n const tailCount = hasError ? 1 : loading ? columns : 0;\n const virtualizer = useVirtualizer({\n count: items.length + tailCount,\n getScrollElement: () => scrollRef.current,\n getItemKey: (index) =>\n index < items.length\n ? getItemKey(items[index], index)\n : `masonry-tail-${index - items.length}`,\n estimateSize: (index) =>\n index < items.length\n ? estimateSize(items[index], index)\n : 144 + ((index - items.length) % 3) * 36,\n gap,\n lanes: columns,\n overscan: overscan * columns,\n });\n\n const virtualItems = virtualizer.getVirtualItems();\n const viewportEnd = (virtualizer.scrollOffset ?? 0) + (virtualizer.scrollRect?.height ?? 0);\n const lastVisibleIndex = virtualItems.reduce(\n (lastIndex, item) => (item.start < viewportEnd ? Math.max(lastIndex, item.index) : lastIndex),\n -1,\n );\n\n useEffect(() => {\n if (\n hasError ||\n loading ||\n !hasMore ||\n loadPendingRef.current ||\n lastVisibleIndex < Math.max(0, items.length - prefetch)\n ) {\n return;\n }\n\n loadPendingRef.current = true;\n void Promise.resolve(loadMoreRef.current()).finally(() => {\n loadPendingRef.current = false;\n });\n }, [hasError, hasMore, items.length, lastVisibleIndex, loading, prefetch]);\n\n if (items.length === 0 && !hasMore && !loading && !hasError) {\n return (\n <section\n aria-label={ariaLabel}\n className={cn(\n \"w-full overflow-hidden rounded-3xl border border-border bg-background\",\n className,\n )}\n >\n {emptyState}\n </section>\n );\n }\n\n const columnWidth = columns > 0 ? Math.max(0, (width - gap * (columns - 1)) / columns) : 0;\n\n return (\n <section\n ref={scrollRef}\n aria-label={ariaLabel}\n aria-busy={loading}\n className={cn(\n \"contain-[layout_paint] w-full overflow-y-auto overscroll-none rounded-3xl border border-border bg-background p-3 [overflow-anchor:none] [scrollbar-gutter:stable]\",\n className,\n )}\n >\n <div\n ref={contentRef}\n className={cn(\"relative w-full\", contentClassName)}\n style={{ height: virtualizer.getTotalSize() }}\n >\n {virtualItems.map((virtualItem) => {\n const isTail = virtualItem.index >= items.length;\n const tailIndex = virtualItem.index - items.length;\n\n return (\n <div\n key={virtualItem.key}\n ref={virtualizer.measureElement}\n data-index={virtualItem.index}\n className={cn(\n \"absolute top-0 left-0 will-change-transform\",\n !isTail && itemClassName,\n )}\n style={{\n width: columnWidth,\n transform: `translate3d(${virtualItem.lane * (columnWidth + gap)}px, ${virtualItem.start}px, 0)`,\n }}\n >\n {isTail ? (\n hasError ? (\n <div className=\"flex min-h-36 flex-col items-start justify-center rounded-2xl border border-destructive/20 bg-destructive/5 p-4\">\n <div className=\"flex items-center gap-2 text-destructive\">\n <AlertCircle className=\"size-4\" aria-hidden=\"true\" />\n <p className=\"font-medium text-sm\">Couldn&apos;t load more</p>\n </div>\n <div className=\"mt-2 text-muted-foreground text-xs leading-5\">{error}</div>\n {onRetry ? (\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"mt-3 min-h-10 rounded-full border border-border bg-background px-4 font-medium text-foreground text-xs outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n >\n Try again\n </button>\n ) : null}\n </div>\n ) : (\n renderLoadingItem(tailIndex)\n )\n ) : (\n <MasonryItemReveal\n itemKey={virtualItem.key}\n lane={virtualItem.lane}\n revealedKeys={revealedKeysRef}\n animate={\n animateItems &&\n !reduceMotion &&\n virtualItem.index >= initialItemCountRef.current\n }\n >\n {renderItem(items[virtualItem.index], virtualItem.index)}\n </MasonryItemReveal>\n )}\n </div>\n );\n })}\n </div>\n\n {!hasMore && items.length > 0 && endState ? (\n <div className=\"py-4 text-center text-muted-foreground text-xs\">{endState}</div>\n ) : null}\n <span className=\"sr-only\" aria-live=\"polite\">\n {loading ? \"Loading more items\" : null}\n </span>\n </section>\n );\n}\n"],"mappings":";;;;;;;;;AA0CA,SAAS,kBAAkB,EACzB,YACA,KACA,YACA,kBAMC;CACD,MAAM,CAAC,SAAS,cAAc,SAAyB;EACrD,SAAS;EACT,OAAO;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SAAS,YAAY,SAAS,MAAM;KAC1C,MAAM,YAAY,YAAY,QAAQ,MAAM;KAE5C,OACE,oBAAC,OAAD;MAEE,KAAK,YAAY;MACjB,cAAY,YAAY;MACxB,WAAW,GACT,+CACA,CAAC,UAAU,aACb;MACA,OAAO;OACL,OAAO;OACP,WAAW,eAAe,YAAY,QAAQ,cAAc,KAAK,MAAM,YAAY,MAAM;MAC3F;MAEC,UAAA,SACC,WACE,qBAAC,OAAD;OAAK,WAAU;OAAf,UAAA;QACE,qBAAC,OAAD;SAAK,WAAU;SAAf,UAAA,CACE,oBAAC,aAAD;UAAa,WAAU;UAAS,eAAY;SAAQ,CAAA,GACpD,oBAAC,KAAD;UAAG,WAAU;UAAsB,UAAA;SAA0B,CAAA,CAC1D;;QACL,oBAAC,OAAD;SAAK,WAAU;SAAgD,UAAA;QAAW,CAAA;QACzE,UACC,oBAAC,UAAD;SACE,MAAK;SACL,SAAS;SACT,WAAU;SACX,UAAA;QAEO,CAAA,IACN;OACD;MAEL,CAAA,IAAA,kBAAkB,SAAS,IAG7B,oBAAC,mBAAD;OACE,SAAS,YAAY;OACrB,MAAM,YAAY;OAClB,cAAc;OACd,SACE,gBACA,CAAC,gBACD,YAAY,SAAS,oBAAoB;OAG1C,UAAA,WAAW,MAAM,YAAY,QAAQ,YAAY,KAAK;MACtC,CAAA;KAElB,GA/CE,YAAY,GA+Cd;IAET,CAAC;GACE,CAAA;GAEJ,CAAC,WAAW,MAAM,SAAS,KAAK,WAC/B,oBAAC,OAAD;IAAK,WAAU;IAAkD,UAAA;GAAc,CAAA,IAC7E;GACJ,oBAAC,QAAD;IAAM,WAAU;IAAU,aAAU;IACjC,UAAA,UAAU,uBAAuB;GAC9B,CAAA;EACC;;AAEb"}
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","names":[],"sources":["../../../src/components/motion/input.tsx"],"mappings":";;YAcY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,mBACP,KAAK,oBAAoB;EACjC;EACA;EACA;EACA,YAAY;;EAEZ;;EAEA;EACA;EACA,WAAW;EACX,YAAY;EACZ;EACA,aAAa;;qBAGF,uBAAK,0BAAA,6BAAA,cAAA"}
1
+ {"version":3,"file":"input.d.ts","names":[],"sources":["../../../src/components/motion/input.tsx"],"mappings":";;YAeY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,mBACP,KAAK,oBAAoB;EACjC;EACA;EACA;EACA,YAAY;;EAEZ;;EAEA;EACA;EACA,WAAW;EACX,YAAY;EACZ;EACA,aAAa;;qBAGF,uBAAK,0BAAA,6BAAA,cAAA"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { forwardRef, useEffect, useId, useRef, useState } from "react";
3
- import { cn } from "cn";
3
+ import { cn } from "@kumix/utils";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { AnimatePresence, animate, motion, useReducedMotion } from "motion/react";
6
6
  //#region src/components/motion/input.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","names":[],"sources":["../../../src/components/motion/input.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n forwardRef,\n type InputHTMLAttributes,\n type ReactNode,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\";\nimport { cn } from \"cn\";\nimport { AnimatePresence, animate, motion, useReducedMotion } from \"motion/react\";\n\nexport type InputClassNames = {\n root?: string;\n label?: string;\n field?: string;\n input?: string;\n leftIcon?: string;\n rightIcon?: string;\n successIcon?: string;\n errorMessage?: string;\n};\n\nexport interface InputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"value\" | \"defaultValue\" | \"onChange\"> {\n label?: string;\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n /** Truthy error triggers a shake, red border and (if a string) a message. */\n error?: string | boolean;\n /** Reserve one message line so validation does not shift nearby content. */\n reserveErrorLine?: boolean;\n success?: boolean;\n leftIcon?: ReactNode;\n rightIcon?: ReactNode;\n className?: string;\n classNames?: InputClassNames;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n {\n label,\n value: valueProp,\n defaultValue,\n onChange,\n onFocus,\n onBlur,\n error,\n reserveErrorLine = false,\n success,\n leftIcon,\n rightIcon,\n className,\n classNames,\n disabled,\n id: idProp,\n type,\n ...rest\n },\n ref,\n) {\n const reactId = useId();\n const id = idProp ?? reactId;\n const reduce = useReducedMotion();\n\n const controlled = valueProp !== undefined;\n const [internal, setInternal] = useState(defaultValue ?? \"\");\n const value = controlled ? (valueProp ?? \"\") : internal;\n\n const [focused, setFocused] = useState(false);\n\n const fieldRef = useRef<HTMLDivElement>(null);\n\n const hasError = Boolean(error);\n const errorMessage = typeof error === \"string\" ? error : null;\n\n // Right edge shows the success check, otherwise the caller's right icon.\n const rightSlot = success ? null : rightIcon;\n\n // Shake the field when an error appears.\n useEffect(() => {\n if (!fieldRef.current || reduce || !hasError) return;\n animate(fieldRef.current, { x: [0, -6, 6, -4, 4, -2, 0] }, { duration: 0.45 });\n }, [hasError, reduce]);\n\n const handleChange = (next: string) => {\n if (!controlled) setInternal(next);\n onChange?.(next);\n };\n\n return (\n <div className={cn(\"flex flex-col gap-1.5\", className, classNames?.root)}>\n {label ? (\n <label\n htmlFor={id}\n className={cn(\"px-1 font-medium text-foreground text-sm\", classNames?.label)}\n >\n {label}\n </label>\n ) : null}\n\n <div\n ref={fieldRef}\n data-state={hasError ? \"error\" : success ? \"success\" : focused ? \"focused\" : \"idle\"}\n className={cn(\n \"relative h-11 overflow-hidden rounded-full border transition-colors duration-200\",\n \"border-border\",\n focused && !hasError && \"border-foreground/40 ring-2 ring-ring/40\",\n hasError && \"border-destructive ring-2 ring-destructive/25\",\n disabled && \"opacity-60\",\n classNames?.field,\n )}\n >\n {leftIcon ? (\n <span\n className={cn(\n \"pointer-events-none absolute top-1/2 left-3 flex -translate-y-1/2 items-center text-muted-foreground [&_svg]:h-4 [&_svg]:w-4\",\n classNames?.leftIcon,\n )}\n >\n {leftIcon}\n </span>\n ) : null}\n\n <input\n ref={ref}\n id={id}\n type={type}\n value={value}\n disabled={disabled}\n aria-invalid={hasError || undefined}\n aria-describedby={errorMessage ? `${id}-error` : undefined}\n {...rest}\n onChange={(e) => handleChange(e.target.value)}\n onFocus={(event) => {\n setFocused(true);\n onFocus?.(event);\n }}\n onBlur={(event) => {\n setFocused(false);\n onBlur?.(event);\n }}\n className={cn(\n \"peer h-full w-full bg-transparent text-base text-foreground leading-6 caret-foreground outline-none\",\n \"placeholder:text-muted-foreground/60\",\n leftIcon ? \"pl-10\" : \"pl-3.5\",\n rightSlot || success ? \"pr-10\" : \"pr-3.5\",\n disabled && \"cursor-not-allowed\",\n classNames?.input,\n )}\n />\n\n {success ? (\n <motion.svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n className={cn(\n \"absolute top-1/2 right-3.5 h-5 w-5 -translate-y-1/2 text-(--color-success)\",\n classNames?.successIcon,\n )}\n >\n <motion.path\n d=\"M5 12.5l4.5 4.5L19 7.5\"\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n initial={reduce ? { pathLength: 1 } : { pathLength: 0 }}\n animate={{ pathLength: 1 }}\n transition={{ duration: 0.35, ease: \"easeOut\" }}\n />\n </motion.svg>\n ) : rightSlot ? (\n <span\n className={cn(\n \"absolute top-0 right-0 flex h-full items-center text-muted-foreground [&_button]:grid [&_button]:size-11 [&_button]:place-items-center [&_svg]:h-4 [&_svg]:w-4\",\n classNames?.rightIcon,\n )}\n >\n {rightSlot}\n </span>\n ) : null}\n </div>\n\n <div className={reserveErrorLine ? \"min-h-4\" : \"contents\"}>\n <AnimatePresence initial={false}>\n {errorMessage ? (\n <motion.p\n id={`${id}-error`}\n role=\"alert\"\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: -4, filter: \"blur(4px)\" }}\n animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, y: -4, filter: \"blur(4px)\" }}\n transition={{ duration: 0.2 }}\n className={cn(\"px-1 text-destructive text-xs\", classNames?.errorMessage)}\n >\n {errorMessage}\n </motion.p>\n ) : null}\n </AnimatePresence>\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;;AA0CA,MAAa,QAAQ,WAAyC,SAAS,MACrE,EACE,OACA,OAAO,WACP,cACA,UACA,SACA,QACA,OACA,mBAAmB,OACnB,SACA,UACA,WACA,WACA,YACA,UACA,IAAI,QACJ,MACA,GAAG,QAEL,KACA;CACA,MAAM,UAAU,MAAM;CACtB,MAAM,KAAK,UAAU;CACrB,MAAM,SAAS,iBAAiB;CAEhC,MAAM,aAAa,cAAc,KAAA;CACjC,MAAM,CAAC,UAAU,eAAe,SAAS,gBAAgB,EAAE;CAC3D,MAAM,QAAQ,aAAc,aAAa,KAAM;CAE/C,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAE5C,MAAM,WAAW,OAAuB,IAAI;CAE5C,MAAM,WAAW,QAAQ,KAAK;CAC9B,MAAM,eAAe,OAAO,UAAU,WAAW,QAAQ;CAGzD,MAAM,YAAY,UAAU,OAAO;CAGnC,gBAAgB;EACd,IAAI,CAAC,SAAS,WAAW,UAAU,CAAC,UAAU;EAC9C,QAAQ,SAAS,SAAS,EAAE,GAAG;GAAC;GAAG;GAAI;GAAG;GAAI;GAAG;GAAI;EAAC,EAAE,GAAG,EAAE,UAAU,IAAK,CAAC;CAC/E,GAAG,CAAC,UAAU,MAAM,CAAC;CAErB,MAAM,gBAAgB,SAAiB;EACrC,IAAI,CAAC,YAAY,YAAY,IAAI;EACjC,WAAW,IAAI;CACjB;CAEA,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,yBAAyB,WAAW,YAAY,IAAI;EAAvE,UAAA;GACG,QACC,oBAAC,SAAD;IACE,SAAS;IACT,WAAW,GAAG,4CAA4C,YAAY,KAAK;IAE1E,UAAA;GACI,CAAA,IACL;GAEJ,qBAAC,OAAD;IACE,KAAK;IACL,cAAY,W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AAE,SAAS;OAAG,GAAG;OAAI,QAAQ;MAAY;MAC5E,SAAS;OAAE,SAAS;OAAG,GAAG;OAAG,QAAQ;MAAY;MACjD,MAAM,SAAS,EAAE,SAAS,EAAE,IAAI;OAAE,SAAS;OAAG,GAAG;OAAI,QAAQ;MAAY;MACzE,YAAY,EAAE,UAAU,GAAI;MAC5B,WAAW,GAAG,iCAAiC,YAAY,YAAY;MAEtE,UAAA;KACO,CAAA,IACR;IACW,CAAA;GACd,CAAA;EACF;;AAET,CAAC"}
1
+ {"version":3,"file":"input.js","names":[],"sources":["../../../src/components/motion/input.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n forwardRef,\n type InputHTMLAttributes,\n type ReactNode,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\";\nimport { AnimatePresence, animate, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\n\nexport type InputClassNames = {\n root?: string;\n label?: string;\n field?: string;\n input?: string;\n leftIcon?: string;\n rightIcon?: string;\n successIcon?: string;\n errorMessage?: string;\n};\n\nexport interface InputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"value\" | \"defaultValue\" | \"onChange\"> {\n label?: string;\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n /** Truthy error triggers a shake, red border and (if a string) a message. */\n error?: string | boolean;\n /** Reserve one message line so validation does not shift nearby content. */\n reserveErrorLine?: boolean;\n success?: boolean;\n leftIcon?: ReactNode;\n rightIcon?: ReactNode;\n className?: string;\n classNames?: InputClassNames;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n {\n label,\n value: valueProp,\n defaultValue,\n onChange,\n onFocus,\n onBlur,\n error,\n reserveErrorLine = false,\n success,\n leftIcon,\n rightIcon,\n className,\n classNames,\n disabled,\n id: idProp,\n type,\n ...rest\n },\n ref,\n) {\n const reactId = useId();\n const id = idProp ?? reactId;\n const reduce = useReducedMotion();\n\n const controlled = valueProp !== undefined;\n const [internal, setInternal] = useState(defaultValue ?? \"\");\n const value = controlled ? (valueProp ?? \"\") : internal;\n\n const [focused, setFocused] = useState(false);\n\n const fieldRef = useRef<HTMLDivElement>(null);\n\n const hasError = Boolean(error);\n const errorMessage = typeof error === \"string\" ? error : null;\n\n // Right edge shows the success check, otherwise the caller's right icon.\n const rightSlot = success ? null : rightIcon;\n\n // Shake the field when an error appears.\n useEffect(() => {\n if (!fieldRef.current || reduce || !hasError) return;\n animate(fieldRef.current, { x: [0, -6, 6, -4, 4, -2, 0] }, { duration: 0.45 });\n }, [hasError, reduce]);\n\n const handleChange = (next: string) => {\n if (!controlled) setInternal(next);\n onChange?.(next);\n };\n\n return (\n <div className={cn(\"flex flex-col gap-1.5\", className, classNames?.root)}>\n {label ? (\n <label\n htmlFor={id}\n className={cn(\"px-1 font-medium text-foreground text-sm\", classNames?.label)}\n >\n {label}\n </label>\n ) : null}\n\n <div\n ref={fieldRef}\n data-state={hasError ? \"error\" : success ? \"success\" : focused ? \"focused\" : \"idle\"}\n className={cn(\n \"relative h-11 overflow-hidden rounded-full border transition-colors duration-200\",\n \"border-border\",\n focused && !hasError && \"border-foreground/40 ring-2 ring-ring/40\",\n hasError && \"border-destructive ring-2 ring-destructive/25\",\n disabled && \"opacity-60\",\n classNames?.field,\n )}\n >\n {leftIcon ? (\n <span\n className={cn(\n \"pointer-events-none absolute top-1/2 left-3 flex -translate-y-1/2 items-center text-muted-foreground [&_svg]:h-4 [&_svg]:w-4\",\n classNames?.leftIcon,\n )}\n >\n {leftIcon}\n </span>\n ) : null}\n\n <input\n ref={ref}\n id={id}\n type={type}\n value={value}\n disabled={disabled}\n aria-invalid={hasError || undefined}\n aria-describedby={errorMessage ? `${id}-error` : undefined}\n {...rest}\n onChange={(e) => handleChange(e.target.value)}\n onFocus={(event) => {\n setFocused(true);\n onFocus?.(event);\n }}\n onBlur={(event) => {\n setFocused(false);\n onBlur?.(event);\n }}\n className={cn(\n \"peer h-full w-full bg-transparent text-base text-foreground leading-6 caret-foreground outline-none\",\n \"placeholder:text-muted-foreground/60\",\n leftIcon ? \"pl-10\" : \"pl-3.5\",\n rightSlot || success ? \"pr-10\" : \"pr-3.5\",\n disabled && \"cursor-not-allowed\",\n classNames?.input,\n )}\n />\n\n {success ? (\n <motion.svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n className={cn(\n \"absolute top-1/2 right-3.5 h-5 w-5 -translate-y-1/2 text-(--color-success)\",\n classNames?.successIcon,\n )}\n >\n <motion.path\n d=\"M5 12.5l4.5 4.5L19 7.5\"\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n initial={reduce ? { pathLength: 1 } : { pathLength: 0 }}\n animate={{ pathLength: 1 }}\n transition={{ duration: 0.35, ease: \"easeOut\" }}\n />\n </motion.svg>\n ) : rightSlot ? (\n <span\n className={cn(\n \"absolute top-0 right-0 flex h-full items-center text-muted-foreground [&_button]:grid [&_button]:size-11 [&_button]:place-items-center [&_svg]:h-4 [&_svg]:w-4\",\n classNames?.rightIcon,\n )}\n >\n {rightSlot}\n </span>\n ) : null}\n </div>\n\n <div className={reserveErrorLine ? \"min-h-4\" : \"contents\"}>\n <AnimatePresence initial={false}>\n {errorMessage ? (\n <motion.p\n id={`${id}-error`}\n role=\"alert\"\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: -4, filter: \"blur(4px)\" }}\n animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, y: -4, filter: \"blur(4px)\" }}\n transition={{ duration: 0.2 }}\n className={cn(\"px-1 text-destructive text-xs\", classNames?.errorMessage)}\n >\n {errorMessage}\n </motion.p>\n ) : null}\n </AnimatePresence>\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;;AA2CA,MAAa,QAAQ,WAAyC,SAAS,MACrE,EACE,OACA,OAAO,WACP,cACA,UACA,SACA,QACA,OACA,mBAAmB,OACnB,SACA,UACA,WACA,WACA,YACA,UACA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ACW,CAAA;GACd,CAAA;EACF;;AAET,CAAC"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { EASE_OUT } from "../../lib/ease.js";
3
3
  import { createContext, forwardRef, useCallback, useContext, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
4
- import { cn } from "cn";
4
+ import { cn } from "@kumix/utils";
5
5
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
6
  import { useReducedMotion } from "motion/react";
7
7
  //#region src/components/motion/liquid.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"liquid.js","names":[],"sources":["../../../src/components/motion/liquid.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n forwardRef,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n useCallback,\n useContext,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { cn } from \"cn\";\nimport { useReducedMotion } from \"motion/react\";\n\nimport { EASE_OUT } from \"../../lib/ease\";\n\ntype LiquidContextValue = {\n getRoot: () => HTMLDivElement | null;\n getPortal: () => SVGGElement | null;\n};\n\nconst LiquidContext = createContext<LiquidContextValue | null>(null);\n\nfunction useLiquidContext() {\n const context = useContext(LiquidContext);\n if (!context) throw new Error(\"LiquidItem must be used within <Liquid>\");\n return context;\n}\n\nexport type LiquidEase = readonly [number, number, number, number];\n\nexport type LiquidTransition = {\n duration?: number;\n ease?: LiquidEase;\n};\n\nexport interface LiquidProps extends HTMLAttributes<HTMLDivElement> {\n blur?: number;\n contrast?: number;\n fill?: string;\n edgeColor?: string;\n edgeOpacity?: number;\n edgeWidth?: number;\n filterPadding?: number;\n}\n\nexport const Liquid = forwardRef<HTMLDivElement, LiquidProps>(function Liquid(\n {\n blur = 6,\n contrast = 18,\n fill = \"var(--background)\",\n edgeColor = \"var(--foreground)\",\n edgeOpacity = 0.08,\n edgeWidth = 1,\n filterPadding = 24,\n className,\n style,\n children,\n ...props\n },\n forwardedRef: Ref<HTMLDivElement>,\n) {\n const rootRef = useRef<HTMLDivElement>(null);\n const portalRef = useRef<SVGGElement>(null);\n const [size, setSize] = useState({ width: 0, height: 0 });\n const filterId = `liquid-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const intercept = Math.round((0.5 - contrast * (5 / 12)) * 100) / 100;\n const padding = Math.ceil(blur * 3 + filterPadding);\n\n const setRootRef = useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n\n useLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n\n const measure = () => {\n const next = {\n width: root.offsetWidth,\n height: root.offsetHeight,\n };\n setSize((current) =>\n current.width === next.width && current.height === next.height ? current : next,\n );\n };\n\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(root);\n return () => observer.disconnect();\n }, []);\n\n const context = useMemo<LiquidContextValue>(\n () => ({\n getRoot: () => rootRef.current,\n getPortal: () => portalRef.current,\n }),\n [],\n );\n\n return (\n <div {...props} ref={setRootRef} className={cn(\"relative isolate\", className)} style={style}>\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n className=\"pointer-events-none absolute inset-0 z-0 size-full overflow-visible\"\n >\n <defs>\n <filter\n id={filterId}\n x={-padding}\n y={-padding}\n width={size.width + padding * 2}\n height={size.height + padding * 2}\n filterUnits=\"userSpaceOnUse\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur in=\"SourceGraphic\" stdDeviation={blur} result=\"blur\" />\n <feColorMatrix\n in=\"blur\"\n type=\"matrix\"\n values={`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${contrast} ${intercept}`}\n result=\"goo\"\n />\n <feComposite in=\"SourceGraphic\" in2=\"goo\" operator=\"atop\" result=\"shape\" />\n {edgeWidth > 0 ? (\n <>\n <feColorMatrix\n in=\"shape\"\n type=\"matrix\"\n values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 60 -29.5\"\n result=\"solid-shape\"\n />\n <feMorphology\n in=\"solid-shape\"\n operator=\"erode\"\n radius={edgeWidth}\n result=\"inset-shape\"\n />\n <feComposite in=\"solid-shape\" in2=\"inset-shape\" operator=\"out\" result=\"edge-mask\" />\n <feFlood floodColor={edgeColor} floodOpacity={edgeOpacity} result=\"edge-color\" />\n <feComposite in=\"edge-color\" in2=\"edge-mask\" operator=\"in\" result=\"edge\" />\n <feMerge>\n <feMergeNode in=\"shape\" />\n <feMergeNode in=\"edge\" />\n </feMerge>\n </>\n ) : null}\n </filter>\n </defs>\n <g ref={portalRef} fill={fill} filter={`url(#${filterId})`} />\n </svg>\n <LiquidContext.Provider value={context}>{children}</LiquidContext.Provider>\n </div>\n );\n});\n\ntype LiquidBox = {\n x: number;\n y: number;\n width: number;\n height: number;\n radius: number;\n};\n\nexport interface LiquidItemProps extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n children: ReactNode;\n x: number;\n y: number;\n width: number;\n height: number;\n radius?: number;\n transition?: LiquidTransition;\n}\n\nfunction mix(from: number, to: number, progress: number) {\n return from + (to - from) * progress;\n}\n\nfunction cubicBezier([x1, y1, x2, y2]: LiquidEase) {\n return (progress: number) => {\n if (progress <= 0) return 0;\n if (progress >= 1) return 1;\n\n let lower = 0;\n let upper = 1;\n for (let index = 0; index < 20; index++) {\n const time = (lower + upper) / 2;\n const inverse = 1 - time;\n const x = 3 * inverse * inverse * time * x1 + 3 * inverse * time * time * x2 + time ** 3;\n if (x < progress) lower = time;\n else upper = time;\n }\n\n const time = (lower + upper) / 2;\n const inverse = 1 - time;\n return 3 * inverse * inverse * time * y1 + 3 * inverse * time * time * y2 + time ** 3;\n };\n}\n\nexport function LiquidItem({\n children,\n x,\n y,\n width,\n height,\n radius = Math.min(width, height) / 2,\n transition,\n className,\n style,\n ...props\n}: LiquidItemProps) {\n const context = useLiquidContext();\n const reduce = useReducedMotion() ?? false;\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [blob, setBlob] = useState<SVGRectElement | null>(null);\n const currentRef = useRef<LiquidBox | null>(null);\n const duration = reduce ? 0 : (transition?.duration ?? 280);\n const ease = transition?.ease ?? EASE_OUT;\n const [x1, y1, x2, y2] = ease;\n\n useLayoutEffect(() => {\n const portal = context.getPortal();\n if (!portal) return;\n\n const blob = document.createElementNS(\"http://www.w3.org/2000/svg\", \"rect\");\n blob.setAttribute(\"x\", \"0\");\n blob.setAttribute(\"y\", \"0\");\n blob.style.transformBox = \"fill-box\";\n blob.style.transformOrigin = \"center\";\n blob.style.willChange = \"transform\";\n portal.append(blob);\n setBlob(blob);\n\n return () => {\n blob.remove();\n };\n }, [context]);\n\n useLayoutEffect(() => {\n const wrapper = wrapperRef.current;\n if (!wrapper || !blob || !context.getRoot()) return;\n\n const target = { x, y, width, height, radius };\n const write = (box: LiquidBox) => {\n // Keep the interactive surface and its filtered silhouette on the same\n // frame so neither can visually outrun the other during a morph.\n const transform = `translate(${box.x}px, ${box.y}px)`;\n wrapper.style.transform = transform;\n wrapper.style.width = `${box.width}px`;\n wrapper.style.height = `${box.height}px`;\n blob.style.transform = transform;\n blob.setAttribute(\"width\", String(box.width));\n blob.setAttribute(\"height\", String(box.height));\n blob.setAttribute(\"rx\", String(box.radius));\n };\n\n const from = currentRef.current;\n if (!from || duration === 0) {\n currentRef.current = target;\n write(target);\n return;\n }\n\n const easing = cubicBezier([x1, y1, x2, y2]);\n const startedAt = performance.now();\n let frame = 0;\n\n const tick = (now: number) => {\n const progress = Math.min(1, (now - startedAt) / duration);\n const eased = easing(progress);\n const current = {\n x: mix(from.x, target.x, eased),\n y: mix(from.y, target.y, eased),\n width: mix(from.width, target.width, eased),\n height: mix(from.height, target.height, eased),\n radius: mix(from.radius, target.radius, eased),\n };\n currentRef.current = current;\n write(current);\n if (progress < 1) frame = requestAnimationFrame(tick);\n };\n\n frame = requestAnimationFrame(tick);\n return () => cancelAnimationFrame(frame);\n }, [blob, context, duration, height, radius, width, x, x1, x2, y, y1, y2]);\n\n return (\n <div\n {...props}\n ref={wrapperRef}\n className={cn(\"absolute top-0 left-0 z-10\", className)}\n style={{ ...style, willChange: \"transform, width, height\" }}\n >\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;AA0BA,MAAM,gBAAgB,cAAyC,IAAI;AAEnE,SAAS,mBAAmB;CAC1B,MAAM,UAAU,WAAW,aAAa;CACxC,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,yCAAyC;CACvE,OAAO;AACT;AAmBA,MAAa,SAAS,WAAwC,SAAS,OACrE,EACE,OAAO,GACP,WAAW,IACX,OAAO,qBACP,YAAY,qBACZ,cAAc,KACd,YAAY,GACZ,gBAAgB,IAChB,WACA,OACA,UACA,GAAG,SAEL,cACA;CACA,MAAM,UAAU,OAAuB,IAAI;CAC3C,MAAM,YAAY,OAAoB,IAAI;CAC1C,MAAM,CAAC,MAAM,WAAW,SAAS;EAAE,OAAO;EAAG,QAAQ;CAAE,CAAC;CACxD,MAAM,WAAW,UAAU,MAAM,CAAC,CAAC,QAAQ,mBAAmB,EAAE;CAChE,MAAM,YAAY,KAAK,OAAO,KAAM,YAAY,IAAI,OAAO,GAAG,IAAI;CAClE,MAAM,UAAU,KAAK,KAAK,OAAO,IAAI,aAAa;CAElD,MAAM,aAAa,aAChB,SAAgC;EAC/B,QAAQ,UAAU;EAClB,IAAI,OAAO,iBAAiB,YAAY,aAAa,IAAI;OACpD,IAAI,cAAc,aAAa,UAAU;CAChD,GACA,CAAC,YAAY,CACf;CAEA,sBAAsB;EACpB,MAAM,OAAO,QAAQ;EACrB,IAAI,CAAC,MAAM;EAEX,MAAM,gBAAgB;GACpB,MAAM,OAAO;IACX,OAAO,KAAK;IACZ,QAAQ,KAAK;GACf;GACA,SAAS,YACP,QAAQ,UAAU,KAAK,SAAS,QAAQ,WAAW,KAAK,SAAS,UAAU,IAC7E;EACF;EAEA,QAAQ;EACR,MAAM,WAAW,IAAI,eAAe,OAAO;EAC3C,SAAS,Q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AAW,KAAK,IAAI,IAAI,MAAM,aAAa,QAAQ;GACzD,MAAM,QAAQ,OAAO,QAAQ;GAC7B,MAAM,UAAU;IACd,GAAG,IAAI,KAAK,GAAG,OAAO,GAAG,KAAK;IAC9B,GAAG,IAAI,KAAK,GAAG,OAAO,GAAG,KAAK;IAC9B,OAAO,IAAI,KAAK,OAAO,OAAO,OAAO,KAAK;IAC1C,QAAQ,IAAI,KAAK,QAAQ,OAAO,QAAQ,KAAK;IAC7C,QAAQ,IAAI,KAAK,QAAQ,OAAO,QAAQ,KAAK;GAC/C;GACA,WAAW,UAAU;GACrB,MAAM,OAAO;GACb,IAAI,WAAW,GAAG,QAAQ,sBAAsB,IAAI;EACtD;EAEA,QAAQ,sBAAsB,IAAI;EAClC,aAAa,qBAAqB,KAAK;CACzC,GAAG;EAAC;EAAM;EAAS;EAAU;EAAQ;EAAQ;EAAO;EAAG;EAAI;EAAI;EAAG;EAAI;CAAE,CAAC;CAEzE,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,KAAK;EACL,WAAW,GAAG,8BAA8B,SAAS;EACrD,OAAO;GAAE,GAAG;GAAO,YAAY;EAA2B;EAEzD;CACE,CAAA;AAET"}
1
+ {"version":3,"file":"liquid.js","names":[],"sources":["../../../src/components/motion/liquid.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n forwardRef,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n useCallback,\n useContext,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT } from \"../../lib/ease\";\n\ntype LiquidContextValue = {\n getRoot: () => HTMLDivElement | null;\n getPortal: () => SVGGElement | null;\n};\n\nconst LiquidContext = createContext<LiquidContextValue | null>(null);\n\nfunction useLiquidContext() {\n const context = useContext(LiquidContext);\n if (!context) throw new Error(\"LiquidItem must be used within <Liquid>\");\n return context;\n}\n\nexport type LiquidEase = readonly [number, number, number, number];\n\nexport type LiquidTransition = {\n duration?: number;\n ease?: LiquidEase;\n};\n\nexport interface LiquidProps extends HTMLAttributes<HTMLDivElement> {\n blur?: number;\n contrast?: number;\n fill?: string;\n edgeColor?: string;\n edgeOpacity?: number;\n edgeWidth?: number;\n filterPadding?: number;\n}\n\nexport const Liquid = forwardRef<HTMLDivElement, LiquidProps>(function Liquid(\n {\n blur = 6,\n contrast = 18,\n fill = \"var(--background)\",\n edgeColor = \"var(--foreground)\",\n edgeOpacity = 0.08,\n edgeWidth = 1,\n filterPadding = 24,\n className,\n style,\n children,\n ...props\n },\n forwardedRef: Ref<HTMLDivElement>,\n) {\n const rootRef = useRef<HTMLDivElement>(null);\n const portalRef = useRef<SVGGElement>(null);\n const [size, setSize] = useState({ width: 0, height: 0 });\n const filterId = `liquid-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const intercept = Math.round((0.5 - contrast * (5 / 12)) * 100) / 100;\n const padding = Math.ceil(blur * 3 + filterPadding);\n\n const setRootRef = useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n\n useLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n\n const measure = () => {\n const next = {\n width: root.offsetWidth,\n height: root.offsetHeight,\n };\n setSize((current) =>\n current.width === next.width && current.height === next.height ? current : next,\n );\n };\n\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(root);\n return () => observer.disconnect();\n }, []);\n\n const context = useMemo<LiquidContextValue>(\n () => ({\n getRoot: () => rootRef.current,\n getPortal: () => portalRef.current,\n }),\n [],\n );\n\n return (\n <div {...props} ref={setRootRef} className={cn(\"relative isolate\", className)} style={style}>\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n className=\"pointer-events-none absolute inset-0 z-0 size-full overflow-visible\"\n >\n <defs>\n <filter\n id={filterId}\n x={-padding}\n y={-padding}\n width={size.width + padding * 2}\n height={size.height + padding * 2}\n filterUnits=\"userSpaceOnUse\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur in=\"SourceGraphic\" stdDeviation={blur} result=\"blur\" />\n <feColorMatrix\n in=\"blur\"\n type=\"matrix\"\n values={`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${contrast} ${intercept}`}\n result=\"goo\"\n />\n <feComposite in=\"SourceGraphic\" in2=\"goo\" operator=\"atop\" result=\"shape\" />\n {edgeWidth > 0 ? (\n <>\n <feColorMatrix\n in=\"shape\"\n type=\"matrix\"\n values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 60 -29.5\"\n result=\"solid-shape\"\n />\n <feMorphology\n in=\"solid-shape\"\n operator=\"erode\"\n radius={edgeWidth}\n result=\"inset-shape\"\n />\n <feComposite in=\"solid-shape\" in2=\"inset-shape\" operator=\"out\" result=\"edge-mask\" />\n <feFlood floodColor={edgeColor} floodOpacity={edgeOpacity} result=\"edge-color\" />\n <feComposite in=\"edge-color\" in2=\"edge-mask\" operator=\"in\" result=\"edge\" />\n <feMerge>\n <feMergeNode in=\"shape\" />\n <feMergeNode in=\"edge\" />\n </feMerge>\n </>\n ) : null}\n </filter>\n </defs>\n <g ref={portalRef} fill={fill} filter={`url(#${filterId})`} />\n </svg>\n <LiquidContext.Provider value={context}>{children}</LiquidContext.Provider>\n </div>\n );\n});\n\ntype LiquidBox = {\n x: number;\n y: number;\n width: number;\n height: number;\n radius: number;\n};\n\nexport interface LiquidItemProps extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n children: ReactNode;\n x: number;\n y: number;\n width: number;\n height: number;\n radius?: number;\n transition?: LiquidTransition;\n}\n\nfunction mix(from: number, to: number, progress: number) {\n return from + (to - from) * progress;\n}\n\nfunction cubicBezier([x1, y1, x2, y2]: LiquidEase) {\n return (progress: number) => {\n if (progress <= 0) return 0;\n if (progress >= 1) return 1;\n\n let lower = 0;\n let upper = 1;\n for (let index = 0; index < 20; index++) {\n const time = (lower + upper) / 2;\n const inverse = 1 - time;\n const x = 3 * inverse * inverse * time * x1 + 3 * inverse * time * time * x2 + time ** 3;\n if (x < progress) lower = time;\n else upper = time;\n }\n\n const time = (lower + upper) / 2;\n const inverse = 1 - time;\n return 3 * inverse * inverse * time * y1 + 3 * inverse * time * time * y2 + time ** 3;\n };\n}\n\nexport function LiquidItem({\n children,\n x,\n y,\n width,\n height,\n radius = Math.min(width, height) / 2,\n transition,\n className,\n style,\n ...props\n}: LiquidItemProps) {\n const context = useLiquidContext();\n const reduce = useReducedMotion() ?? false;\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [blob, setBlob] = useState<SVGRectElement | null>(null);\n const currentRef = useRef<LiquidBox | null>(null);\n const duration = reduce ? 0 : (transition?.duration ?? 280);\n const ease = transition?.ease ?? EASE_OUT;\n const [x1, y1, x2, y2] = ease;\n\n useLayoutEffect(() => {\n const portal = context.getPortal();\n if (!portal) return;\n\n const blob = document.createElementNS(\"http://www.w3.org/2000/svg\", \"rect\");\n blob.setAttribute(\"x\", \"0\");\n blob.setAttribute(\"y\", \"0\");\n blob.style.transformBox = \"fill-box\";\n blob.style.transformOrigin = \"center\";\n blob.style.willChange = \"transform\";\n portal.append(blob);\n setBlob(blob);\n\n return () => {\n blob.remove();\n };\n }, [context]);\n\n useLayoutEffect(() => {\n const wrapper = wrapperRef.current;\n if (!wrapper || !blob || !context.getRoot()) return;\n\n const target = { x, y, width, height, radius };\n const write = (box: LiquidBox) => {\n // Keep the interactive surface and its filtered silhouette on the same\n // frame so neither can visually outrun the other during a morph.\n const transform = `translate(${box.x}px, ${box.y}px)`;\n wrapper.style.transform = transform;\n wrapper.style.width = `${box.width}px`;\n wrapper.style.height = `${box.height}px`;\n blob.style.transform = transform;\n blob.setAttribute(\"width\", String(box.width));\n blob.setAttribute(\"height\", String(box.height));\n blob.setAttribute(\"rx\", String(box.radius));\n };\n\n const from = currentRef.current;\n if (!from || duration === 0) {\n currentRef.current = target;\n write(target);\n return;\n }\n\n const easing = cubicBezier([x1, y1, x2, y2]);\n const startedAt = performance.now();\n let frame = 0;\n\n const tick = (now: number) => {\n const progress = Math.min(1, (now - startedAt) / duration);\n const eased = easing(progress);\n const current = {\n x: mix(from.x, target.x, eased),\n y: mix(from.y, target.y, eased),\n width: mix(from.width, target.width, eased),\n height: mix(from.height, target.height, eased),\n radius: mix(from.radius, target.radius, eased),\n };\n currentRef.current = current;\n write(current);\n if (progress < 1) frame = requestAnimationFrame(tick);\n };\n\n frame = requestAnimationFrame(tick);\n return () => cancelAnimationFrame(frame);\n }, [blob, context, duration, height, radius, width, x, x1, x2, y, y1, y2]);\n\n return (\n <div\n {...props}\n ref={wrapperRef}\n className={cn(\"absolute top-0 left-0 z-10\", className)}\n style={{ ...style, willChange: \"transform, width, height\" }}\n >\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;AA0BA,MAAM,gBAAgB,cAAyC,IAAI;AAEnE,SAAS,mBAAmB;CAC1B,MAAM,UAAU,WAAW,aAAa;CACxC,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,yCAAyC;CACvE,OAAO;AACT;AAmBA,MAAa,SAAS,WAAwC,SAAS,OACrE,EACE,OAAO,GACP,WAAW,IACX,OAAO,qBACP,YAAY,qBACZ,cAAc,KACd,YAAY,GACZ,gBAAgB,IAChB,WACA,OACA,UACA,GAAG,SAEL,cACA;CACA,MAAM,UAAU,OAAuB,IAAI;CAC3C,MAAM,YAAY,OAAoB,IAAI;CAC1C,MAAM,CAAC,MAAM,WAAW,SAAS;EAAE,OAAO;EAAG,QAAQ;CAAE,CAAC;CACxD,MAAM,WAAW,UAAU,MAAM,CAAC,CAAC,QAAQ,mBAAmB,EAAE;CAChE,MAAM,YAAY,KAAK,OAAO,KAAM,YAAY,IAAI,OAAO,GAAG,IAAI;CAClE,MAAM,UAAU,KAAK,KAAK,OAAO,IAAI,aAAa;CAElD,MAAM,aAAa,aAChB,SAAg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Effect, useId, useState } from "react";
4
- import { cn } from "cn";
4
+ import { cn } from "@kumix/utils";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { motion, useReducedMotion } from "motion/react";
7
7
  //#region src/components/motion/loader.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","names":[],"sources":["../../../src/components/motion/loader.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useId, useState } from \"react\";\nimport { cn } from \"cn\";\nimport { motion, useReducedMotion } from \"motion/react\";\n\nimport { EASE_IN_OUT } from \"../../lib/ease\";\n\nexport type LoaderVariant =\n | \"spinner\"\n | \"dots\"\n | \"bars\"\n | \"dot-matrix\"\n | \"dither\"\n | \"ascii\"\n | \"ascii-line\"\n | \"ascii-braille\"\n | \"ascii-blocks\"\n | \"ascii-bounce\"\n | \"morph\"\n | \"comet\"\n | \"scramble\"\n | \"metaballs\"\n | \"newton\"\n | \"helix\"\n | \"percent\";\n\n// Terminal-style frame sets — the loaders CLI AI agents cycle through.\nconst ASCII_SETS: Record<string, string[]> = {\n ascii: [\"⠋\", \"⠙\", \"⠹\", \"⠸\", \"⠼\", \"⠴\", \"⠦\", \"⠧\", \"⠇\", \"⠏\"],\n \"ascii-line\": [\"|\", \"/\", \"-\", \"\\\\\"],\n \"ascii-braille\": [\"⣾\", \"⣽\", \"⣻\", \"⢿\", \"⡿\", \"⣟\", \"⣯\", \"⣷\"],\n \"ascii-blocks\": [\"▁\", \"▂\", \"▃\", \"▄\", \"▅\", \"▆\", \"▇\", \"█\", \"▇\", \"▆\", \"▅\", \"▄\", \"▃\", \"▂\"],\n \"ascii-bounce\": [\"⠁\", \"⠂\", \"⠄\", \"⡀\", \"⢀\", \"⠠\", \"⠐\", \"⠈\"],\n};\n\nexport interface LoaderProps {\n /** Which animation to render. */\n variant?: LoaderVariant;\n /** Base square size in px. Everything scales from this. */\n size?: number;\n /** Seconds per animation cycle. */\n speed?: number;\n /** Accessible label announced to screen readers. */\n label?: string;\n className?: string;\n}\n\n// Reduced motion keeps a calm opacity pulse and drops every transform.\nconst REDUCED = {\n animate: { opacity: [1, 0.4, 1] },\n transition: { duration: 1.4, ease: EASE_IN_OUT, repeat: Infinity },\n};\n\nexport function Loader({\n variant = \"spinner\",\n size = 32,\n speed = 1,\n label = \"Loading\",\n className,\n}: LoaderProps) {\n const reduce = useReducedMotion() ?? false;\n\n return (\n <span\n role=\"status\"\n aria-label={label}\n className={cn(\"inline-flex items-center justify-center text-foreground\", className)}\n >\n {variant === \"spinner\" && <Spinner size={size} speed={speed} reduce={reduce} />}\n {variant === \"dots\" && <Dots size={size} speed={speed} reduce={reduce} />}\n {variant === \"bars\" && <Bars size={size} speed={speed} reduce={reduce} />}\n {variant === \"dot-matrix\" && <DotMatrix size={size} speed={speed} reduce={reduce} />}\n {variant === \"dither\" && <Dither size={size} speed={speed} reduce={reduce} />}\n {ASCII_SETS[variant] && (\n <Ascii frames={ASCII_SETS[variant]} size={size} speed={speed} reduce={reduce} />\n )}\n {variant === \"morph\" && <Morph size={size} speed={speed} reduce={reduce} />}\n {variant === \"comet\" && <Comet size={size} speed={speed} reduce={reduce} />}\n {variant === \"scramble\" && <Scramble size={size} speed={speed} reduce={reduce} />}\n {variant === \"metaballs\" && <Metaballs size={size} speed={speed} reduce={reduce} />}\n {variant === \"newton\" && <Newton size={size} speed={speed} reduce={reduce} />}\n {variant === \"helix\" && <Helix size={size} speed={speed} reduce={reduce} />}\n {variant === \"percent\" && <Percent size={size} speed={speed} reduce={reduce} />}\n <span className=\"sr-only\">{label}</span>\n </span>\n );\n}\n\ninterface PartProps {\n size: number;\n speed: number;\n reduce: boolean;\n}\n\nfunction Spinner({ size, speed, reduce }: PartProps) {\n const stroke = Math.max(2, size * 0.09);\n const r = (size - stroke) / 2;\n return (\n <motion.svg\n width={size}\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n animate={reduce ? REDUCED.animate : { rotate: 360 }}\n transition={\n reduce ? REDUCED.transition : { duration: speed, ease: \"linear\", repeat: Infinity }\n }\n >\n <circle\n cx={size / 2}\n cy={size / 2}\n r={r}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeOpacity={0.2}\n strokeWidth={stroke}\n />\n <path\n d={`M ${size / 2} ${size / 2 - r} A ${r} ${r} 0 0 1 ${size / 2 + r} ${size / 2}`}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={stroke}\n strokeLinecap=\"round\"\n />\n </motion.svg>\n );\n}\n\nfunction Dots({ size, speed, reduce }: PartProps) {\n const dot = size * 0.24;\n return (\n <span className=\"flex items-center\" style={{ gap: size * 0.14 }}>\n {[0, 1, 2].map((i) => (\n <motion.span\n key={i}\n className=\"rounded-full bg-current\"\n style={{ width: dot, height: dot }}\n animate={\n reduce ? { opacity: [0.4, 1, 0.4] } : { y: [0, -size * 0.3, 0], opacity: [0.5, 1, 0.5] }\n }\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay: i * speed * 0.16,\n }}\n />\n ))}\n </span>\n );\n}\n\nfunction Ascii({ frames, size, speed, reduce }: PartProps & { frames: string[] }) {\n const [frame, setFrame] = useState(0);\n useEffect(() => {\n // Reduced motion slows the cycle rather than stopping it — it's a glyph\n // swap, not on-screen movement.\n const step = ((reduce ? speed * 2.5 : speed) / frames.length) * 1000;\n const id = setInterval(() => setFrame((f) => (f + 1) % frames.length), step);\n return () => clearInterval(id);\n }, [frames.length, speed, reduce]);\n\n return (\n <span className=\"font-mono tabular-nums leading-none\" style={{ fontSize: size, lineHeight: 1 }}>\n {frames[frame % frames.length]}\n </span>\n );\n}\n\n// Each shape is sampled at the same number of points and emitted as an SVG\n// path with identical command structure, so framer tweens the `d` attribute\n// point-to-point — a real morph, not a snap. (clip-path polygon strings don't\n// interpolate reliably in framer, which left the shapes broken.)\nconst MORPH_POINTS = 24;\n\nfunction ngonRadius(ang: number, n: number, phase = 0) {\n const seg = (2 * Math.PI) / n;\n const a = ang - phase;\n const local = (((a % seg) + seg) % seg) - seg / 2;\n return Math.cos(Math.PI / n) / Math.cos(local);\n}\n\nfunction morphPath(radiusAt: (ang: number) => number) {\n const parts: string[] = [];\n for (let i = 0; i < MORPH_POINTS; i++) {\n const ang = (i / MORPH_POINTS) * 2 * Math.PI - Math.PI / 2;\n const r = Math.min(1.05, radiusAt(ang));\n const x = (50 + Math.cos(ang) * 46 * r).toFixed(2);\n const y = (50 + Math.sin(ang) * 46 * r).toFixed(2);\n parts.push(`${i === 0 ? \"M\" : \"L\"}${x} ${y}`);\n }\n return `${parts.join(\" \")} Z`;\n}\n\nconst MORPH_PATHS = [\n morphPath(() => 1), // circle\n morphPath((a) => ngonRadius(a, 4, Math.PI / 4)), // square\n morphPath((a) => ngonRadius(a, 3)), // triangle\n morphPath((a) => ngonRadius(a, 6)), // hexagon\n morphPath((a) => ngonRadius(a, 4)), // diamond\n];\n\n// Each shape appears twice in a row so it fully forms and HOLDS before the\n// next morph. Even keyframe spacing then alternates hold / morph segments.\nconst MORPH_SEQ = [...MORPH_PATHS.flatMap((p) => [p, p]), MORPH_PATHS[0]];\n// Rotation and scale only change across the morph segments, staying put on the\n// holds, so a settled shape sits still.\nconst MORPH_ROT = [0, 0, 72, 72, 144, 144, 216, 216, 288, 288, 360];\nconst MORPH_SCALE = [1, 1, 0.88, 0.88, 1, 1, 0.88, 0.88, 1, 1, 1];\n\nfunction Morph({ size, speed, reduce }: PartProps) {\n return (\n <motion.svg\n width={size}\n height={size}\n viewBox=\"0 0 100 100\"\n role=\"img\"\n animate={reduce ? { opacity: [1, 0.4, 1] } : { rotate: MORPH_ROT, scale: MORPH_SCALE }}\n transition={\n reduce\n ? { duration: 1.4, ease: EASE_IN_OUT, repeat: Infinity }\n : { duration: speed * 5, ease: EASE_IN_OUT, repeat: Infinity }\n }\n >\n <title>Loading</title>\n <motion.path\n fill=\"currentColor\"\n d={MORPH_PATHS[0]}\n animate={reduce ? undefined : { d: MORPH_SEQ }}\n transition={\n reduce ? undefined : { duration: speed * 5, ease: EASE_IN_OUT, repeat: Infinity }\n }\n />\n </motion.svg>\n );\n}\n\nconst COMET_TRAIL = [0, 1, 2, 3, 4, 5];\n\nfunction Comet({ size, speed, reduce }: PartProps) {\n const head = size * 0.2;\n const r = size / 2 - head / 2;\n return (\n <span className=\"relative\" style={{ width: size, height: size }}>\n <motion.span\n className=\"absolute inset-0\"\n animate={reduce ? REDUCED.animate : { rotate: 360 }}\n transition={\n reduce ? REDUCED.transition : { duration: speed, ease: \"linear\", repeat: Infinity }\n }\n >\n {COMET_TRAIL.map((i) => {\n const scale = 1 - i * 0.13;\n const sz = head * scale;\n return (\n <span\n key={i}\n className=\"absolute top-1/2 left-1/2 rounded-full bg-current\"\n style={{\n width: sz,\n height: sz,\n marginLeft: -sz / 2,\n marginTop: -sz / 2,\n opacity: 1 - i * 0.16,\n transform: `rotate(${-i * 15}deg) translateY(${-r}px)`,\n }}\n />\n );\n })}\n </motion.span>\n </span>\n );\n}\n\nconst SCRAMBLE_TARGET = \"LOADING\";\nconst SCRAMBLE_GLYPHS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>/*#@\";\n\nfunction Scramble({ size, speed, reduce }: PartProps) {\n const [text, setText] = useState(SCRAMBLE_TARGET);\n useEffect(() => {\n if (reduce) {\n setText(SCRAMBLE_TARGET);\n return;\n }\n let tick = 0;\n const total = SCRAMBLE_TARGET.length + 4;\n const id = setInterval(\n () => {\n const reveal = tick % total;\n let s = \"\";\n for (let i = 0; i < SCRAMBLE_TARGET.length; i++) {\n s +=\n i < reveal\n ? SCRAMBLE_TARGET[i]\n : SCRAMBLE_GLYPHS[Math.floor(Math.random() * SCRAMBLE_GLYPHS.length)];\n }\n setText(s);\n tick++;\n },\n (speed / SCRAMBLE_TARGET.length) * 1000 * 0.55,\n );\n return () => clearInterval(id);\n }, [speed, reduce]);\n\n return (\n <span\n className=\"font-medium font-mono tabular-nums tracking-[0.2em]\"\n style={{ fontSize: size * 0.42 }}\n >\n {text}\n </span>\n );\n}\n\nfunction Metaballs({ size, speed, reduce }: PartProps) {\n const id = useId().replace(/:/g, \"\");\n return (\n <svg width={size} height={size} viewBox=\"0 0 100 100\" role=\"img\">\n <title>Loading</title>\n <defs>\n <filter id={id}>\n <feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"5\" result=\"b\" />\n <feColorMatrix in=\"b\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -8\" />\n </filter>\n </defs>\n <g filter={`url(#${id})`} fill=\"currentColor\">\n <motion.circle\n cy=\"50\"\n r=\"15\"\n animate={reduce ? { opacity: [0.4, 1, 0.4] } : { cx: [30, 70, 30] }}\n transition={{ duration: speed * 1.6, ease: EASE_IN_OUT, repeat: Infinity }}\n cx={reduce ? 40 : 30}\n />\n <motion.circle\n cy=\"50\"\n r=\"15\"\n animate={reduce ? { opacity: [0.4, 1, 0.4] } : { cx: [70, 30, 70] }}\n transition={{ duration: speed * 1.6, ease: EASE_IN_OUT, repeat: Infinity }}\n cx={reduce ? 60 : 70}\n />\n </g>\n </svg>\n );\n}\n\nconst NEWTON_BALLS = [0, 1, 2, 3, 4];\n\nfunction Newton({ size, speed, reduce }: PartProps) {\n const d = size * 0.2;\n const out = d * 1.1;\n // Only the end balls move: the left slides out and back on the first half,\n // then the right on the second half — the impact appears to jump the three\n // still middle balls. Pure horizontal slide, no swing, no strings.\n const moves: Record<number, { x: number[]; times: number[] }> = {\n 0: { x: [0, -out, 0, 0], times: [0, 0.28, 0.5, 1] },\n 4: { x: [0, 0, out, 0], times: [0, 0.5, 0.78, 1] },\n };\n\n return (\n <span className=\"flex items-center justify-center\" style={{ height: d }}>\n {NEWTON_BALLS.map((i) => {\n const move = moves[i];\n return (\n <motion.span\n key={i}\n className=\"rounded-full bg-current\"\n style={{ width: d, height: d }}\n animate={reduce || !move ? undefined : { x: move.x }}\n transition={\n reduce || !move\n ? undefined\n : {\n duration: speed * 1.5,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n times: move.times,\n }\n }\n />\n );\n })}\n </span>\n );\n}\n\nfunction Helix({ size, speed, reduce }: PartProps) {\n const rows = 7;\n const dot = size * 0.14;\n const amp = size * 0.32;\n return (\n <span className=\"relative\" style={{ width: size, height: size }}>\n {Array.from({ length: rows }, (_, r) => {\n const top = (r / (rows - 1)) * (size - dot);\n const delay = (r / rows) * speed;\n return (\n <span key={`row-${top}`}>\n <motion.span\n className=\"absolute rounded-full bg-current\"\n style={{ width: dot, height: dot, left: size / 2 - dot / 2, top }}\n animate={\n reduce\n ? { opacity: [0.4, 1, 0.4] }\n : {\n x: [amp, -amp, amp],\n scale: [1, 0.5, 1],\n opacity: [1, 0.45, 1],\n }\n }\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay,\n }}\n />\n <motion.span\n className=\"absolute rounded-full bg-current\"\n style={{ width: dot, height: dot, left: size / 2 - dot / 2, top }}\n animate={\n reduce\n ? { opacity: [0.4, 1, 0.4] }\n : {\n x: [-amp, amp, -amp],\n scale: [0.5, 1, 0.5],\n opacity: [0.45, 1, 0.45],\n }\n }\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay,\n }}\n />\n </span>\n );\n })}\n </span>\n );\n}\n\nfunction Percent({ size, speed, reduce }: PartProps) {\n const [p, setP] = useState(0);\n useEffect(() => {\n const dur = (reduce ? speed * 2 : speed) * 1000;\n const start = { t: 0 };\n const tickMs = 40;\n const id = setInterval(() => {\n start.t += tickMs;\n const next = Math.min(100, Math.round((start.t / dur) * 100));\n setP(next);\n if (next >= 100) start.t = 0;\n }, tickMs);\n return () => clearInterval(id);\n }, [speed, reduce]);\n\n return (\n <span className=\"flex flex-col items-center\" style={{ gap: size * 0.14, width: size * 1.4 }}>\n <span\n className=\"font-medium font-mono tabular-nums\"\n style={{ fontSize: size * 0.42, lineHeight: 1 }}\n >\n {p}%\n </span>\n <span\n className=\"w-full overflow-hidden rounded-full bg-current/15\"\n style={{ height: Math.max(3, size * 0.1) }}\n >\n <span className=\"block h-full rounded-full bg-current\" style={{ width: `${p}%` }} />\n </span>\n </span>\n );\n}\n\nfunction Bars({ size, speed, reduce }: PartProps) {\n const bar = size * 0.16;\n return (\n <span className=\"flex items-center\" style={{ gap: size * 0.1, height: size }}>\n {[0, 1, 2, 3].map((i) => (\n <motion.span\n key={i}\n className=\"rounded-full bg-current\"\n style={{ width: bar, height: size, originY: 1 }}\n animate={reduce ? { opacity: [0.4, 1, 0.4] } : { scaleY: [0.3, 1, 0.3] }}\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay: i * speed * 0.12,\n }}\n />\n ))}\n </span>\n );\n}\n\nfunction DotMatrix({ size, speed, reduce }: PartProps) {\n const n = 3;\n const gap = size * 0.14;\n const dot = (size - gap * (n - 1)) / n;\n const cells = Array.from({ length: n * n }, (_, idx) => idx);\n return (\n <span\n className=\"grid\"\n style={{\n gap,\n gridTemplateColumns: `repeat(${n}, ${dot}px)`,\n }}\n >\n {cells.map((idx) => {\n const x = idx % n;\n const y = Math.floor(idx / n);\n // Diagonal wave: cells light in order of their distance from the corner.\n const delay = ((x + y) / (2 * (n - 1))) * speed;\n return (\n <motion.span\n key={idx}\n className=\"rounded-full bg-current\"\n style={{ width: dot, height: dot }}\n animate={\n reduce ? { opacity: [0.3, 1, 0.3] } : { opacity: [0.2, 1, 0.2], scale: [0.7, 1, 0.7] }\n }\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay,\n }}\n />\n );\n })}\n </span>\n );\n}\n\n// Ordered Bayer 4x4 matrix — the classic dithering threshold pattern. Cells\n// light in this order, so the fill shimmers like a dissolving halftone.\nconst BAYER_4 = [0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5];\n\nfunction Dither({ size, speed, reduce }: PartProps) {\n const n = 4;\n const gap = Math.max(1, size * 0.05);\n const cell = (size - gap * (n - 1)) / n;\n return (\n <span className=\"grid\" style={{ gap, gridTemplateColumns: `repeat(${n}, ${cell}px)` }}>\n {BAYER_4.map((order, idx) => (\n <motion.span\n key={idx}\n className=\"bg-current\"\n style={{ width: cell, height: cell }}\n animate={reduce ? { opacity: [0.3, 1, 0.3] } : { opacity: [0.1, 1, 0.1] }}\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay: (order / BAYER_4.length) * speed,\n }}\n />\n ))}\n </span>\n );\n}\n"],"mappings":";;;;;;;AA4BA,MAAM,aAAuC;CAC3C,OAAO;EAAC;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;CAAG;CACxD,cAAc;EAAC;EAAK;EAAK;EAAK;CAAI;CAClC,iBAAiB;EAAC;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;CAAG;CACxD,gBAAgB;EAAC;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;CAAG;CACrF,gBAAgB;EAAC;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;CAAG;AACzD;AAeA,MAAM,UAAU;CACd,SAAS,EAAE,SAAS;EAAC;EAAG;EAAK;CAAC,EAAE;CAChC,YAAY;EAAE,UAAU;EAAK,MAAM;EAAa,QAAQ;CAAS;AACnE;AAEA,SAAgB,OAAO,EACrB,UAAU,WACV,OAAO,IACP,QAAQ,GACR,QAAQ,WACR,aACc;CACd,MAAM,SAAS,iBAAiB,KAAK;CAErC,OACE,qBAAC,QAAD;EACE,MAAK;EACL,cAAY;EACZ,WAAW,GAAG,2DAA2D,SAAS;EAHpF,UAAA;GAKG,YAAY,aAAa,oBAAC,SAAD;IAAe;IAAa;IAAe;GAAS,CAAA;GAC7E,YAAY,UAAU,oBAAC,MAAD;IAAY;IAAa;IAAe;GAAS,CAAA;GACvE,YAAY,UAAU,oBAAC,MAAD;IAAY;IAAa;IAAe;GAAS,CAAA;GACvE,YAAY,gBAAgB,oBAAC,WAAD;IAAiB;IAAa;IAAe;GAA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AAE,OAAO;IAAM,QAAQ;GAAK;GACnC,SAAS,SAAS,EAAE,SAAS;IAAC;IAAK;IAAG;GAAG,EAAE,IAAI,EAAE,SAAS;IAAC;IAAK;IAAG;GAAG,EAAE;GACxE,YAAY;IACV,UAAU;IACV,MAAM;IACN,QAAQ;IACR,OAAQ,QAAQ,QAAQ,SAAU;GACpC;EACD,GAVM,GAUN,CACF;CACG,CAAA;AAEV"}
1
+ {"version":3,"file":"loader.js","names":[],"sources":["../../../src/components/motion/loader.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useId, useState } from \"react\";\nimport { motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_IN_OUT } from \"../../lib/ease\";\n\nexport type LoaderVariant =\n | \"spinner\"\n | \"dots\"\n | \"bars\"\n | \"dot-matrix\"\n | \"dither\"\n | \"ascii\"\n | \"ascii-line\"\n | \"ascii-braille\"\n | \"ascii-blocks\"\n | \"ascii-bounce\"\n | \"morph\"\n | \"comet\"\n | \"scramble\"\n | \"metaballs\"\n | \"newton\"\n | \"helix\"\n | \"percent\";\n\n// Terminal-style frame sets — the loaders CLI AI agents cycle through.\nconst ASCII_SETS: Record<string, string[]> = {\n ascii: [\"⠋\", \"⠙\", \"⠹\", \"⠸\", \"⠼\", \"⠴\", \"⠦\", \"⠧\", \"⠇\", \"⠏\"],\n \"ascii-line\": [\"|\", \"/\", \"-\", \"\\\\\"],\n \"ascii-braille\": [\"⣾\", \"⣽\", \"⣻\", \"⢿\", \"⡿\", \"⣟\", \"⣯\", \"⣷\"],\n \"ascii-blocks\": [\"▁\", \"▂\", \"▃\", \"▄\", \"▅\", \"▆\", \"▇\", \"█\", \"▇\", \"▆\", \"▅\", \"▄\", \"▃\", \"▂\"],\n \"ascii-bounce\": [\"⠁\", \"⠂\", \"⠄\", \"⡀\", \"⢀\", \"⠠\", \"⠐\", \"⠈\"],\n};\n\nexport interface LoaderProps {\n /** Which animation to render. */\n variant?: LoaderVariant;\n /** Base square size in px. Everything scales from this. */\n size?: number;\n /** Seconds per animation cycle. */\n speed?: number;\n /** Accessible label announced to screen readers. */\n label?: string;\n className?: string;\n}\n\n// Reduced motion keeps a calm opacity pulse and drops every transform.\nconst REDUCED = {\n animate: { opacity: [1, 0.4, 1] },\n transition: { duration: 1.4, ease: EASE_IN_OUT, repeat: Infinity },\n};\n\nexport function Loader({\n variant = \"spinner\",\n size = 32,\n speed = 1,\n label = \"Loading\",\n className,\n}: LoaderProps) {\n const reduce = useReducedMotion() ?? false;\n\n return (\n <span\n role=\"status\"\n aria-label={label}\n className={cn(\"inline-flex items-center justify-center text-foreground\", className)}\n >\n {variant === \"spinner\" && <Spinner size={size} speed={speed} reduce={reduce} />}\n {variant === \"dots\" && <Dots size={size} speed={speed} reduce={reduce} />}\n {variant === \"bars\" && <Bars size={size} speed={speed} reduce={reduce} />}\n {variant === \"dot-matrix\" && <DotMatrix size={size} speed={speed} reduce={reduce} />}\n {variant === \"dither\" && <Dither size={size} speed={speed} reduce={reduce} />}\n {ASCII_SETS[variant] && (\n <Ascii frames={ASCII_SETS[variant]} size={size} speed={speed} reduce={reduce} />\n )}\n {variant === \"morph\" && <Morph size={size} speed={speed} reduce={reduce} />}\n {variant === \"comet\" && <Comet size={size} speed={speed} reduce={reduce} />}\n {variant === \"scramble\" && <Scramble size={size} speed={speed} reduce={reduce} />}\n {variant === \"metaballs\" && <Metaballs size={size} speed={speed} reduce={reduce} />}\n {variant === \"newton\" && <Newton size={size} speed={speed} reduce={reduce} />}\n {variant === \"helix\" && <Helix size={size} speed={speed} reduce={reduce} />}\n {variant === \"percent\" && <Percent size={size} speed={speed} reduce={reduce} />}\n <span className=\"sr-only\">{label}</span>\n </span>\n );\n}\n\ninterface PartProps {\n size: number;\n speed: number;\n reduce: boolean;\n}\n\nfunction Spinner({ size, speed, reduce }: PartProps) {\n const stroke = Math.max(2, size * 0.09);\n const r = (size - stroke) / 2;\n return (\n <motion.svg\n width={size}\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n animate={reduce ? REDUCED.animate : { rotate: 360 }}\n transition={\n reduce ? REDUCED.transition : { duration: speed, ease: \"linear\", repeat: Infinity }\n }\n >\n <circle\n cx={size / 2}\n cy={size / 2}\n r={r}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeOpacity={0.2}\n strokeWidth={stroke}\n />\n <path\n d={`M ${size / 2} ${size / 2 - r} A ${r} ${r} 0 0 1 ${size / 2 + r} ${size / 2}`}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={stroke}\n strokeLinecap=\"round\"\n />\n </motion.svg>\n );\n}\n\nfunction Dots({ size, speed, reduce }: PartProps) {\n const dot = size * 0.24;\n return (\n <span className=\"flex items-center\" style={{ gap: size * 0.14 }}>\n {[0, 1, 2].map((i) => (\n <motion.span\n key={i}\n className=\"rounded-full bg-current\"\n style={{ width: dot, height: dot }}\n animate={\n reduce ? { opacity: [0.4, 1, 0.4] } : { y: [0, -size * 0.3, 0], opacity: [0.5, 1, 0.5] }\n }\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay: i * speed * 0.16,\n }}\n />\n ))}\n </span>\n );\n}\n\nfunction Ascii({ frames, size, speed, reduce }: PartProps & { frames: string[] }) {\n const [frame, setFrame] = useState(0);\n useEffect(() => {\n // Reduced motion slows the cycle rather than stopping it — it's a glyph\n // swap, not on-screen movement.\n const step = ((reduce ? speed * 2.5 : speed) / frames.length) * 1000;\n const id = setInterval(() => setFrame((f) => (f + 1) % frames.length), step);\n return () => clearInterval(id);\n }, [frames.length, speed, reduce]);\n\n return (\n <span className=\"font-mono tabular-nums leading-none\" style={{ fontSize: size, lineHeight: 1 }}>\n {frames[frame % frames.length]}\n </span>\n );\n}\n\n// Each shape is sampled at the same number of points and emitted as an SVG\n// path with identical command structure, so framer tweens the `d` attribute\n// point-to-point — a real morph, not a snap. (clip-path polygon strings don't\n// interpolate reliably in framer, which left the shapes broken.)\nconst MORPH_POINTS = 24;\n\nfunction ngonRadius(ang: number, n: number, phase = 0) {\n const seg = (2 * Math.PI) / n;\n const a = ang - phase;\n const local = (((a % seg) + seg) % seg) - seg / 2;\n return Math.cos(Math.PI / n) / Math.cos(local);\n}\n\nfunction morphPath(radiusAt: (ang: number) => number) {\n const parts: string[] = [];\n for (let i = 0; i < MORPH_POINTS; i++) {\n const ang = (i / MORPH_POINTS) * 2 * Math.PI - Math.PI / 2;\n const r = Math.min(1.05, radiusAt(ang));\n const x = (50 + Math.cos(ang) * 46 * r).toFixed(2);\n const y = (50 + Math.sin(ang) * 46 * r).toFixed(2);\n parts.push(`${i === 0 ? \"M\" : \"L\"}${x} ${y}`);\n }\n return `${parts.join(\" \")} Z`;\n}\n\nconst MORPH_PATHS = [\n morphPath(() => 1), // circle\n morphPath((a) => ngonRadius(a, 4, Math.PI / 4)), // square\n morphPath((a) => ngonRadius(a, 3)), // triangle\n morphPath((a) => ngonRadius(a, 6)), // hexagon\n morphPath((a) => ngonRadius(a, 4)), // diamond\n];\n\n// Each shape appears twice in a row so it fully forms and HOLDS before the\n// next morph. Even keyframe spacing then alternates hold / morph segments.\nconst MORPH_SEQ = [...MORPH_PATHS.flatMap((p) => [p, p]), MORPH_PATHS[0]];\n// Rotation and scale only change across the morph segments, staying put on the\n// holds, so a settled shape sits still.\nconst MORPH_ROT = [0, 0, 72, 72, 144, 144, 216, 216, 288, 288, 360];\nconst MORPH_SCALE = [1, 1, 0.88, 0.88, 1, 1, 0.88, 0.88, 1, 1, 1];\n\nfunction Morph({ size, speed, reduce }: PartProps) {\n return (\n <motion.svg\n width={size}\n height={size}\n viewBox=\"0 0 100 100\"\n role=\"img\"\n animate={reduce ? { opacity: [1, 0.4, 1] } : { rotate: MORPH_ROT, scale: MORPH_SCALE }}\n transition={\n reduce\n ? { duration: 1.4, ease: EASE_IN_OUT, repeat: Infinity }\n : { duration: speed * 5, ease: EASE_IN_OUT, repeat: Infinity }\n }\n >\n <title>Loading</title>\n <motion.path\n fill=\"currentColor\"\n d={MORPH_PATHS[0]}\n animate={reduce ? undefined : { d: MORPH_SEQ }}\n transition={\n reduce ? undefined : { duration: speed * 5, ease: EASE_IN_OUT, repeat: Infinity }\n }\n />\n </motion.svg>\n );\n}\n\nconst COMET_TRAIL = [0, 1, 2, 3, 4, 5];\n\nfunction Comet({ size, speed, reduce }: PartProps) {\n const head = size * 0.2;\n const r = size / 2 - head / 2;\n return (\n <span className=\"relative\" style={{ width: size, height: size }}>\n <motion.span\n className=\"absolute inset-0\"\n animate={reduce ? REDUCED.animate : { rotate: 360 }}\n transition={\n reduce ? REDUCED.transition : { duration: speed, ease: \"linear\", repeat: Infinity }\n }\n >\n {COMET_TRAIL.map((i) => {\n const scale = 1 - i * 0.13;\n const sz = head * scale;\n return (\n <span\n key={i}\n className=\"absolute top-1/2 left-1/2 rounded-full bg-current\"\n style={{\n width: sz,\n height: sz,\n marginLeft: -sz / 2,\n marginTop: -sz / 2,\n opacity: 1 - i * 0.16,\n transform: `rotate(${-i * 15}deg) translateY(${-r}px)`,\n }}\n />\n );\n })}\n </motion.span>\n </span>\n );\n}\n\nconst SCRAMBLE_TARGET = \"LOADING\";\nconst SCRAMBLE_GLYPHS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>/*#@\";\n\nfunction Scramble({ size, speed, reduce }: PartProps) {\n const [text, setText] = useState(SCRAMBLE_TARGET);\n useEffect(() => {\n if (reduce) {\n setText(SCRAMBLE_TARGET);\n return;\n }\n let tick = 0;\n const total = SCRAMBLE_TARGET.length + 4;\n const id = setInterval(\n () => {\n const reveal = tick % total;\n let s = \"\";\n for (let i = 0; i < SCRAMBLE_TARGET.length; i++) {\n s +=\n i < reveal\n ? SCRAMBLE_TARGET[i]\n : SCRAMBLE_GLYPHS[Math.floor(Math.random() * SCRAMBLE_GLYPHS.length)];\n }\n setText(s);\n tick++;\n },\n (speed / SCRAMBLE_TARGET.length) * 1000 * 0.55,\n );\n return () => clearInterval(id);\n }, [speed, reduce]);\n\n return (\n <span\n className=\"font-medium font-mono tabular-nums tracking-[0.2em]\"\n style={{ fontSize: size * 0.42 }}\n >\n {text}\n </span>\n );\n}\n\nfunction Metaballs({ size, speed, reduce }: PartProps) {\n const id = useId().replace(/:/g, \"\");\n return (\n <svg width={size} height={size} viewBox=\"0 0 100 100\" role=\"img\">\n <title>Loading</title>\n <defs>\n <filter id={id}>\n <feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"5\" result=\"b\" />\n <feColorMatrix in=\"b\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -8\" />\n </filter>\n </defs>\n <g filter={`url(#${id})`} fill=\"currentColor\">\n <motion.circle\n cy=\"50\"\n r=\"15\"\n animate={reduce ? { opacity: [0.4, 1, 0.4] } : { cx: [30, 70, 30] }}\n transition={{ duration: speed * 1.6, ease: EASE_IN_OUT, repeat: Infinity }}\n cx={reduce ? 40 : 30}\n />\n <motion.circle\n cy=\"50\"\n r=\"15\"\n animate={reduce ? { opacity: [0.4, 1, 0.4] } : { cx: [70, 30, 70] }}\n transition={{ duration: speed * 1.6, ease: EASE_IN_OUT, repeat: Infinity }}\n cx={reduce ? 60 : 70}\n />\n </g>\n </svg>\n );\n}\n\nconst NEWTON_BALLS = [0, 1, 2, 3, 4];\n\nfunction Newton({ size, speed, reduce }: PartProps) {\n const d = size * 0.2;\n const out = d * 1.1;\n // Only the end balls move: the left slides out and back on the first half,\n // then the right on the second half — the impact appears to jump the three\n // still middle balls. Pure horizontal slide, no swing, no strings.\n const moves: Record<number, { x: number[]; times: number[] }> = {\n 0: { x: [0, -out, 0, 0], times: [0, 0.28, 0.5, 1] },\n 4: { x: [0, 0, out, 0], times: [0, 0.5, 0.78, 1] },\n };\n\n return (\n <span className=\"flex items-center justify-center\" style={{ height: d }}>\n {NEWTON_BALLS.map((i) => {\n const move = moves[i];\n return (\n <motion.span\n key={i}\n className=\"rounded-full bg-current\"\n style={{ width: d, height: d }}\n animate={reduce || !move ? undefined : { x: move.x }}\n transition={\n reduce || !move\n ? undefined\n : {\n duration: speed * 1.5,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n times: move.times,\n }\n }\n />\n );\n })}\n </span>\n );\n}\n\nfunction Helix({ size, speed, reduce }: PartProps) {\n const rows = 7;\n const dot = size * 0.14;\n const amp = size * 0.32;\n return (\n <span className=\"relative\" style={{ width: size, height: size }}>\n {Array.from({ length: rows }, (_, r) => {\n const top = (r / (rows - 1)) * (size - dot);\n const delay = (r / rows) * speed;\n return (\n <span key={`row-${top}`}>\n <motion.span\n className=\"absolute rounded-full bg-current\"\n style={{ width: dot, height: dot, left: size / 2 - dot / 2, top }}\n animate={\n reduce\n ? { opacity: [0.4, 1, 0.4] }\n : {\n x: [amp, -amp, amp],\n scale: [1, 0.5, 1],\n opacity: [1, 0.45, 1],\n }\n }\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay,\n }}\n />\n <motion.span\n className=\"absolute rounded-full bg-current\"\n style={{ width: dot, height: dot, left: size / 2 - dot / 2, top }}\n animate={\n reduce\n ? { opacity: [0.4, 1, 0.4] }\n : {\n x: [-amp, amp, -amp],\n scale: [0.5, 1, 0.5],\n opacity: [0.45, 1, 0.45],\n }\n }\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay,\n }}\n />\n </span>\n );\n })}\n </span>\n );\n}\n\nfunction Percent({ size, speed, reduce }: PartProps) {\n const [p, setP] = useState(0);\n useEffect(() => {\n const dur = (reduce ? speed * 2 : speed) * 1000;\n const start = { t: 0 };\n const tickMs = 40;\n const id = setInterval(() => {\n start.t += tickMs;\n const next = Math.min(100, Math.round((start.t / dur) * 100));\n setP(next);\n if (next >= 100) start.t = 0;\n }, tickMs);\n return () => clearInterval(id);\n }, [speed, reduce]);\n\n return (\n <span className=\"flex flex-col items-center\" style={{ gap: size * 0.14, width: size * 1.4 }}>\n <span\n className=\"font-medium font-mono tabular-nums\"\n style={{ fontSize: size * 0.42, lineHeight: 1 }}\n >\n {p}%\n </span>\n <span\n className=\"w-full overflow-hidden rounded-full bg-current/15\"\n style={{ height: Math.max(3, size * 0.1) }}\n >\n <span className=\"block h-full rounded-full bg-current\" style={{ width: `${p}%` }} />\n </span>\n </span>\n );\n}\n\nfunction Bars({ size, speed, reduce }: PartProps) {\n const bar = size * 0.16;\n return (\n <span className=\"flex items-center\" style={{ gap: size * 0.1, height: size }}>\n {[0, 1, 2, 3].map((i) => (\n <motion.span\n key={i}\n className=\"rounded-full bg-current\"\n style={{ width: bar, height: size, originY: 1 }}\n animate={reduce ? { opacity: [0.4, 1, 0.4] } : { scaleY: [0.3, 1, 0.3] }}\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay: i * speed * 0.12,\n }}\n />\n ))}\n </span>\n );\n}\n\nfunction DotMatrix({ size, speed, reduce }: PartProps) {\n const n = 3;\n const gap = size * 0.14;\n const dot = (size - gap * (n - 1)) / n;\n const cells = Array.from({ length: n * n }, (_, idx) => idx);\n return (\n <span\n className=\"grid\"\n style={{\n gap,\n gridTemplateColumns: `repeat(${n}, ${dot}px)`,\n }}\n >\n {cells.map((idx) => {\n const x = idx % n;\n const y = Math.floor(idx / n);\n // Diagonal wave: cells light in order of their distance from the corner.\n const delay = ((x + y) / (2 * (n - 1))) * speed;\n return (\n <motion.span\n key={idx}\n className=\"rounded-full bg-current\"\n style={{ width: dot, height: dot }}\n animate={\n reduce ? { opacity: [0.3, 1, 0.3] } : { opacity: [0.2, 1, 0.2], scale: [0.7, 1, 0.7] }\n }\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay,\n }}\n />\n );\n })}\n </span>\n );\n}\n\n// Ordered Bayer 4x4 matrix — the classic dithering threshold pattern. Cells\n// light in this order, so the fill shimmers like a dissolving halftone.\nconst BAYER_4 = [0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5];\n\nfunction Dither({ size, speed, reduce }: PartProps) {\n const n = 4;\n const gap = Math.max(1, size * 0.05);\n const cell = (size - gap * (n - 1)) / n;\n return (\n <span className=\"grid\" style={{ gap, gridTemplateColumns: `repeat(${n}, ${cell}px)` }}>\n {BAYER_4.map((order, idx) => (\n <motion.span\n key={idx}\n className=\"bg-current\"\n style={{ width: cell, height: cell }}\n animate={reduce ? { opacity: [0.3, 1, 0.3] } : { opacity: [0.1, 1, 0.1] }}\n transition={{\n duration: speed,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n delay: (order / BAYER_4.length) * speed,\n }}\n />\n ))}\n </span>\n );\n}\n"],"mappings":";;;;;;;AA4BA,MAAM,aAAuC;CAC3C,OAAO;EAAC;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;CAAG;CACxD,cAAc;EAAC;EAAK;EAAK;EAAK;CAAI;CAClC,iBAAiB;EAAC;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;CAAG;CACxD,gBAAgB;EAAC;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;CAAG;CACrF,gBAAgB;EAAC;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;CAAG;AACzD;AAeA,MAAM,UAAU;CACd,SAAS,EAAE,SAAS;EAAC;EAAG;EAAK;CAAC,EAAE;CAChC,YAAY;EAAE,UAAU;EAAK,MAAM;EAAa,QAAQ;CAAS;AACnE;AAEA,SAAgB,OAAO,EACrB,UAAU,WACV,OAAO,IACP,QAAQ,GACR,QAAQ,WACR,aACc;CACd,MAAM,SAAS,iBAAiB,KAAK;CAErC,OACE,qBAAC,QAAD;EACE,MAAK;EACL,cAAY;EACZ,WAAW,GAAG,2DAA2D,SAAS;EAHpF,UAAA;GAKG,YAAY,aAAa,oBAAC,SAAD;IAAe;IAAa;IAAe;GAAS,CAAA;GAC7E,YAAY,UAAU,oBAAC,MAAD;IAAY;IAAa;IAAe;GAAS,CAAA;GACvE,YAAY,U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EAAE,IAAI,KAAK;EAAK;EACjF,UAAA,QAAQ,KAAK,OAAO,QACnB,oBAAC,OAAO,MAAR;GAEE,WAAU;GACV,OAAO;IAAE,OAAO;IAAM,QAAQ;GAAK;GACnC,SAAS,SAAS,EAAE,SAAS;IAAC;IAAK;IAAG;GAAG,EAAE,IAAI,EAAE,SAAS;IAAC;IAAK;IAAG;GAAG,EAAE;GACxE,YAAY;IACV,UAAU;IACV,MAAM;IACN,QAAQ;IACR,OAAQ,QAAQ,QAAQ,SAAU;GACpC;EACD,GAVM,GAUN,CACF;CACG,CAAA;AAEV"}
@@ -2,7 +2,7 @@
2
2
  import { useHoverCapable } from "../../hooks/use-hover-capable.js";
3
3
  import { SPRING_MOUSE } from "../../lib/ease.js";
4
4
  import { useRef } from "react";
5
- import { cn } from "cn";
5
+ import { cn } from "@kumix/utils";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { motion, useMotionValue, useReducedMotion, useSpring } from "motion/react";
8
8
  //#region src/components/motion/magnetic.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"magnetic.js","names":[],"sources":["../../../src/components/motion/magnetic.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useRef } from \"react\";\nimport { cn } from \"cn\";\nimport { motion, useMotionValue, useReducedMotion, useSpring } from \"motion/react\";\n\nimport { useHoverCapable } from \"../../hooks/use-hover-capable\";\nimport { SPRING_MOUSE } from \"../../lib/ease\";\n\nexport interface MagneticProps {\n children: ReactNode;\n strength?: number;\n className?: string;\n}\n\nexport function Magnetic({ children, strength = 0.35, className }: MagneticProps) {\n const ref = useRef<HTMLDivElement>(null);\n const reduce = useReducedMotion();\n const canHover = useHoverCapable();\n // Decorative cursor-follow: skip on touch (phantom hover) and reduced motion.\n const enabled = !reduce && canHover;\n const x = useMotionValue(0);\n const y = useMotionValue(0);\n const sx = useSpring(x, SPRING_MOUSE);\n const sy = useSpring(y, SPRING_MOUSE);\n\n const onMove = (e: React.MouseEvent<HTMLDivElement>) => {\n const el = ref.current;\n if (!el || !enabled) return;\n const rect = el.getBoundingClientRect();\n x.set((e.clientX - rect.left - rect.width / 2) * strength);\n y.set((e.clientY - rect.top - rect.height / 2) * strength);\n };\n\n const onLeave = () => {\n x.set(0);\n y.set(0);\n };\n\n return (\n <motion.div\n ref={ref}\n onMouseMove={onMove}\n onMouseLeave={onLeave}\n style={{ x: sx, y: sy }}\n className={cn(\"inline-block\", className)}\n >\n {children}\n </motion.div>\n );\n}\n"],"mappings":";;;;;;;;AAeA,SAAgB,SAAS,EAAE,UAAU,WAAW,KAAM,aAA4B;CAChF,MAAM,MAAM,OAAuB,IAAI;CACvC,MAAM,SAAS,iBAAiB;CAChC,MAAM,WAAW,gBAAgB;CAEjC,MAAM,UAAU,CAAC,UAAU;CAC3B,MAAM,IAAI,eAAe,CAAC;CAC1B,MAAM,IAAI,eAAe,CAAC;CAC1B,MAAM,KAAK,UAAU,GAAG,YAAY;CACpC,MAAM,KAAK,UAAU,GAAG,YAAY;CAEpC,MAAM,UAAU,MAAwC;EACtD,MAAM,KAAK,IAAI;EACf,IAAI,CAAC,MAAM,CAAC,SAAS;EACrB,MAAM,OAAO,GAAG,sBAAsB;EACtC,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,KAAK,QAAQ,KAAK,QAAQ;EACzD,EAAE,KAAK,EAAE,UAAU,KAAK,MAAM,KAAK,SAAS,KAAK,QAAQ;CAC3D;CAEA,MAAM,gBAAgB;EACpB,EAAE,IAAI,CAAC;EACP,EAAE,IAAI,CAAC;CACT;CAEA,OACE,oBAAC,OAAO,KAAR;EACO;EACL,aAAa;EACb,cAAc;EACd,OAAO;GAAE,GAAG;GAAI,GAAG;EAAG;EACtB,WAAW,GAAG,gBAAgB,SAAS;EAEtC;CACS,CAAA;AAEhB"}
1
+ {"version":3,"file":"magnetic.js","names":[],"sources":["../../../src/components/motion/magnetic.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useRef } from \"react\";\nimport { motion, useMotionValue, useReducedMotion, useSpring } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useHoverCapable } from \"../../hooks/use-hover-capable\";\nimport { SPRING_MOUSE } from \"../../lib/ease\";\n\nexport interface MagneticProps {\n children: ReactNode;\n strength?: number;\n className?: string;\n}\n\nexport function Magnetic({ children, strength = 0.35, className }: MagneticProps) {\n const ref = useRef<HTMLDivElement>(null);\n const reduce = useReducedMotion();\n const canHover = useHoverCapable();\n // Decorative cursor-follow: skip on touch (phantom hover) and reduced motion.\n const enabled = !reduce && canHover;\n const x = useMotionValue(0);\n const y = useMotionValue(0);\n const sx = useSpring(x, SPRING_MOUSE);\n const sy = useSpring(y, SPRING_MOUSE);\n\n const onMove = (e: React.MouseEvent<HTMLDivElement>) => {\n const el = ref.current;\n if (!el || !enabled) return;\n const rect = el.getBoundingClientRect();\n x.set((e.clientX - rect.left - rect.width / 2) * strength);\n y.set((e.clientY - rect.top - rect.height / 2) * strength);\n };\n\n const onLeave = () => {\n x.set(0);\n y.set(0);\n };\n\n return (\n <motion.div\n ref={ref}\n onMouseMove={onMove}\n onMouseLeave={onLeave}\n style={{ x: sx, y: sy }}\n className={cn(\"inline-block\", className)}\n >\n {children}\n </motion.div>\n );\n}\n"],"mappings":";;;;;;;;AAeA,SAAgB,SAAS,EAAE,UAAU,WAAW,KAAM,aAA4B;CAChF,MAAM,MAAM,OAAuB,IAAI;CACvC,MAAM,SAAS,iBAAiB;CAChC,MAAM,WAAW,gBAAgB;CAEjC,MAAM,UAAU,CAAC,UAAU;CAC3B,MAAM,IAAI,eAAe,CAAC;CAC1B,MAAM,IAAI,eAAe,CAAC;CAC1B,MAAM,KAAK,UAAU,GAAG,YAAY;CACpC,MAAM,KAAK,UAAU,GAAG,YAAY;CAEpC,MAAM,UAAU,MAAwC;EACtD,MAAM,KAAK,IAAI;EACf,IAAI,CAAC,MAAM,CAAC,SAAS;EACrB,MAAM,OAAO,GAAG,sBAAsB;EACtC,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,KAAK,QAAQ,KAAK,QAAQ;EACzD,EAAE,KAAK,EAAE,UAAU,KAAK,MAAM,KAAK,SAAS,KAAK,QAAQ;CAC3D;CAEA,MAAM,gBAAgB;EACpB,EAAE,IAAI,CAAC;EACP,EAAE,IAAI,CAAC;CACT;CAEA,OACE,oBAAC,OAAO,KAAR;EACO;EACL,aAAa;EACb,cAAc;EACd,OAAO;GAAE,GAAG;GAAI,GAAG;EAAG;EACtB,WAAW,GAAG,gBAAgB,SAAS;EAEtC;CACS,CAAA;AAEhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"marquee.d.ts","names":[],"sources":["../../../src/components/motion/marquee.tsx"],"mappings":";;iBAKiB;EACf,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;;wBAGc,UACd,UACA,WACA,OACA,cACA,KACA,WACA,QACC,+BAAY,IAAA"}
1
+ {"version":3,"file":"marquee.d.ts","names":[],"sources":["../../../src/components/motion/marquee.tsx"],"mappings":";;iBAMiB;EACf,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;;wBAGc,UACd,UACA,WACA,OACA,cACA,KACA,WACA,QACC,+BAAY,IAAA"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { Children } from "react";
3
- import { cn } from "cn";
3
+ import { cn } from "@kumix/utils";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/components/motion/marquee.tsx
6
6
  function Marquee({ children, direction = "left", speed = 30, pauseOnHover = true, gap = "1rem", className, fade = true }) {
@@ -1 +1 @@
1
- {"version":3,"file":"marquee.js","names":[],"sources":["../../../src/components/motion/marquee.tsx"],"sourcesContent":["\"use client\";\n\nimport { Children, type ReactNode } from \"react\";\nimport { cn } from \"cn\";\n\nexport interface MarqueeProps {\n children: ReactNode;\n direction?: \"left\" | \"right\" | \"up\" | \"down\";\n speed?: number;\n pauseOnHover?: boolean;\n gap?: string;\n className?: string;\n fade?: boolean;\n}\n\nexport function Marquee({\n children,\n direction = \"left\",\n speed = 30,\n pauseOnHover = true,\n gap = \"1rem\",\n className,\n fade = true,\n}: MarqueeProps) {\n const vertical = direction === \"up\" || direction === \"down\";\n const reverse = direction === \"right\" || direction === \"down\";\n const items = Children.toArray(children);\n\n return (\n <div\n className={cn(\n \"group relative flex overflow-hidden\",\n vertical ? \"flex-col\" : \"flex-row\",\n fade &&\n !vertical &&\n \"mask-[linear-gradient(to_right,transparent,black_12%,black_88%,transparent)]\",\n fade &&\n vertical &&\n \"mask-[linear-gradient(to_bottom,transparent,black_12%,black_88%,transparent)]\",\n className,\n )}\n // gap on the wrapper too, so the seam between the two tracks matches the\n // spacing between items and the loop stays even.\n style={{ \"--gap\": gap, gap } as React.CSSProperties}\n >\n {[0, 1].map((dup) => (\n <div\n key={dup}\n aria-hidden={dup === 1}\n inert={dup === 1}\n style={{\n animationDuration: `${speed}s`,\n animationDirection: reverse ? \"reverse\" : \"normal\",\n gap,\n }}\n className={cn(\n \"flex shrink-0 items-center\",\n vertical ? \"animate-marquee-vertical flex-col\" : \"animate-marquee flex-row\",\n pauseOnHover && \"group-hover:paused\",\n )}\n >\n {items.map((child, i) => (\n <div key={i} className=\"shrink-0\">\n {child}\n </div>\n ))}\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;AAeA,SAAgB,QAAQ,EACtB,UACA,YAAY,QACZ,QAAQ,IACR,eAAe,MACf,MAAM,QACN,WACA,OAAO,QACQ;CACf,MAAM,WAAW,cAAc,QAAQ,cAAc;CACrD,MAAM,UAAU,cAAc,WAAW,cAAc;CACvD,MAAM,QAAQ,SAAS,QAAQ,QAAQ;CAEvC,OACE,oBAAC,OAAD;EACE,WAAW,GACT,uCACA,WAAW,aAAa,YACxB,QACE,CAAC,YACD,gFACF,QACE,YACA,iFACF,SACF;EAGA,OAAO;GAAE,SAAS;GAAK;EAAI;EAE1B,UAAA,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,QACX,oBAAC,OAAD;GAEE,eAAa,QAAQ;GACrB,OAAO,QAAQ;GACf,OAAO;IACL,mBAAmB,GAAG,MAAM;IAC5B,oBAAoB,UAAU,YAAY;IAC1C;GACF;GACA,WAAW,GACT,8BACA,WAAW,sCAAsC,4BACjD,gBAAgB,oBAClB;GAEC,UAAA,MAAM,KAAK,OAAO,MACjB,oBAAC,OAAD;IAAa,WAAU;IACpB,UAAA;GACE,GAFK,CAEL,CACN;EACE,GAnBE,GAmBF,CACN;CACE,CAAA;AAET"}
1
+ {"version":3,"file":"marquee.js","names":[],"sources":["../../../src/components/motion/marquee.tsx"],"sourcesContent":["\"use client\";\n\nimport { Children, type ReactNode } from \"react\";\n\nimport { cn } from \"@kumix/utils\";\n\nexport interface MarqueeProps {\n children: ReactNode;\n direction?: \"left\" | \"right\" | \"up\" | \"down\";\n speed?: number;\n pauseOnHover?: boolean;\n gap?: string;\n className?: string;\n fade?: boolean;\n}\n\nexport function Marquee({\n children,\n direction = \"left\",\n speed = 30,\n pauseOnHover = true,\n gap = \"1rem\",\n className,\n fade = true,\n}: MarqueeProps) {\n const vertical = direction === \"up\" || direction === \"down\";\n const reverse = direction === \"right\" || direction === \"down\";\n const items = Children.toArray(children);\n\n return (\n <div\n className={cn(\n \"group relative flex overflow-hidden\",\n vertical ? \"flex-col\" : \"flex-row\",\n fade &&\n !vertical &&\n \"mask-[linear-gradient(to_right,transparent,black_12%,black_88%,transparent)]\",\n fade &&\n vertical &&\n \"mask-[linear-gradient(to_bottom,transparent,black_12%,black_88%,transparent)]\",\n className,\n )}\n // gap on the wrapper too, so the seam between the two tracks matches the\n // spacing between items and the loop stays even.\n style={{ \"--gap\": gap, gap } as React.CSSProperties}\n >\n {[0, 1].map((dup) => (\n <div\n key={dup}\n aria-hidden={dup === 1}\n inert={dup === 1}\n style={{\n animationDuration: `${speed}s`,\n animationDirection: reverse ? \"reverse\" : \"normal\",\n gap,\n }}\n className={cn(\n \"flex shrink-0 items-center\",\n vertical ? \"animate-marquee-vertical flex-col\" : \"animate-marquee flex-row\",\n pauseOnHover && \"group-hover:paused\",\n )}\n >\n {items.map((child, i) => (\n <div key={i} className=\"shrink-0\">\n {child}\n </div>\n ))}\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;AAgBA,SAAgB,QAAQ,EACtB,UACA,YAAY,QACZ,QAAQ,IACR,eAAe,MACf,MAAM,QACN,WACA,OAAO,QACQ;CACf,MAAM,WAAW,cAAc,QAAQ,cAAc;CACrD,MAAM,UAAU,cAAc,WAAW,cAAc;CACvD,MAAM,QAAQ,SAAS,QAAQ,QAAQ;CAEvC,OACE,oBAAC,OAAD;EACE,WAAW,GACT,uCACA,WAAW,aAAa,YACxB,QACE,CAAC,YACD,gFACF,QACE,YACA,iFACF,SACF;EAGA,OAAO;GAAE,SAAS;GAAK;EAAI;EAE1B,UAAA,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,QACX,oBAAC,OAAD;GAEE,eAAa,QAAQ;GACrB,OAAO,QAAQ;GACf,OAAO;IACL,mBAAmB,GAAG,MAAM;IAC5B,oBAAoB,UAAU,YAAY;IAC1C;GACF;GACA,WAAW,GACT,8BACA,WAAW,sCAAsC,4BACjD,gBAAgB,oBAClB;GAEC,UAAA,MAAM,KAAK,OAAO,MACjB,oBAAC,OAAD;IAAa,WAAU;IACpB,UAAA;GACE,GAFK,CAEL,CACN;EACE,GAnBE,GAmBF,CACN;CACE,CAAA;AAET"}
@@ -2,7 +2,7 @@
2
2
  import { EASE_OUT, SPRING_PANEL } from "../../lib/ease.js";
3
3
  import { t as PresenceGate } from "../../presence-gate-BekdC4Bo.js";
4
4
  import { useEffect } from "react";
5
- import { cn } from "cn";
5
+ import { cn } from "@kumix/utils";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { AnimatePresence, motion, useReducedMotion } from "motion/react";
8
8
  //#region src/components/motion/morphing-modal.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"morphing-modal.js","names":[],"sources":["../../../src/components/motion/morphing-modal.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useEffect } from \"react\";\nimport { cn } from \"cn\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { EASE_OUT, SPRING_PANEL } from \"../../lib/ease\";\nimport { PresenceGate } from \"../../lib/presence-gate\";\n\nexport interface MorphingModalProps {\n /** Which view is currently shown. `null` closes the modal. */\n viewId: string | null;\n onClose: () => void;\n children: ReactNode;\n /** \"bottom\" anchors to the viewport bottom (mobile-like). \"center\" centers vertically. */\n placement?: \"bottom\" | \"center\";\n className?: string;\n}\n\nexport function MorphingModal({\n viewId,\n onClose,\n children,\n placement = \"bottom\",\n className,\n}: MorphingModalProps) {\n const open = viewId !== null;\n const reduce = useReducedMotion();\n const enterY = reduce ? 0 : placement === \"bottom\" ? 40 : 20;\n const enterScale = reduce ? 1 : 0.97;\n\n useEffect(() => {\n if (!open) return;\n const prev = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n return () => {\n document.body.style.overflow = prev;\n };\n }, [open]);\n\n // Mounted only while open, and while open the chrome is two fixed siblings\n // rather than one wrapper: the backdrop spans the viewport edges but carries\n // the scrim colour, and the layer positioning the panel sits inset off every\n // edge (`inset-4`, with the bottom placement's `pb-4` on top of it). Both hang\n // off `PresenceGate`, so interaction releases in the same commit that starts\n // the exit rather than when it ends — `open` is already false for those\n return (\n <AnimatePresence initial={false}>\n {open ? (\n <PresenceGate key=\"backdrop\">\n {({ gate }) => (\n <motion.button\n type=\"button\"\n aria-label=\"Close modal\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.2, ease: EASE_OUT }}\n {...gate}\n onClick={onClose}\n className=\"pointer-events-auto fixed inset-0 z-80 bg-background/5 [-webkit-backdrop-filter:blur(14px)_saturate(140%)] [backdrop-filter:blur(14px)_saturate(140%)]\"\n />\n )}\n </PresenceGate>\n ) : null}\n\n {open ? (\n <PresenceGate key=\"panel-layer\">\n {({ isPresent, gate }) => (\n // The layer itself never takes pointer events, so it carries\n // `inert` alone rather than the gate's pointer-events value.\n <div\n inert={!isPresent}\n className={cn(\n \"pointer-events-none fixed inset-4 z-80 flex justify-center\",\n placement === \"bottom\" ? \"items-end pb-4\" : \"items-center\",\n )}\n >\n <motion.div\n key=\"panel\"\n layout\n initial={{ opacity: 0, y: enterY, scale: enterScale }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{\n opacity: 0,\n y: enterY,\n scale: reduce ? 1 : 0.98,\n transition: { duration: 0.18, ease: EASE_OUT },\n }}\n transition={SPRING_PANEL}\n {...gate}\n className={cn(\n \"pointer-events-auto relative w-full max-w-sm overflow-hidden rounded-3xl border border-border bg-background shadow-2xl will-change-transform\",\n className,\n )}\n >\n <motion.div layout=\"position\" className=\"p-5\">\n <AnimatePresence mode=\"popLayout\" initial={false}>\n <motion.div\n key={viewId}\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: 8, filter: \"blur(4px)\" }}\n animate={\n reduce\n ? {\n opacity: 1,\n transition: {\n duration: 0.18,\n ease: EASE_OUT,\n },\n }\n : {\n opacity: 1,\n y: 0,\n filter: \"blur(0px)\",\n transition: {\n duration: 0.24,\n ease: EASE_OUT,\n },\n }\n }\n exit={\n reduce\n ? {\n opacity: 0,\n transition: {\n duration: 0.14,\n ease: EASE_OUT,\n },\n }\n : {\n opacity: 0,\n y: -8,\n filter: \"blur(4px)\",\n transition: {\n duration: 0.16,\n ease: EASE_OUT,\n },\n }\n }\n >\n {children}\n </motion.div>\n </AnimatePresence>\n </motion.div>\n </motion.div>\n </div>\n )}\n </PresenceGate>\n ) : null}\n </AnimatePresence>\n );\n}\n"],"mappings":";;;;;;;;AAmBA,SAAgB,cAAc,EAC5B,QACA,SACA,UACA,YAAY,UACZ,aACqB;CACrB,MAAM,OAAO,WAAW;CACxB,MAAM,SAAS,iBAAiB;CAChC,MAAM,SAAS,SAAS,IAAI,cAAc,WAAW,KAAK;CAC1D,MAAM,aAAa,SAAS,IAAI;CAEhC,gBAAgB;EACd,IAAI,CAAC,MAAM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;QACT,GAAG;QACH,QAAQ;QACR,YAAY;SACV,UAAU;SACV,MAAM;QACR;OACF;OAEN,MACE,SACI;QACE,SAAS;QACT,YAAY;SACV,UAAU;SACV,MAAM;QACR;OACF,IACA;QACE,SAAS;QACT,GAAG;QACH,QAAQ;QACR,YAAY;SACV,UAAU;SACV,MAAM;QACR;OACF;OAGL;MACS,GA1CL,MA0CK;KACG,CAAA;IACP,CAAA;GACF,GAjEN,OAiEM;EACT,CAAA,EAEK,GAhFI,aAgFJ,IACZ,IACW;;AAErB"}
1
+ {"version":3,"file":"morphing-modal.js","names":[],"sources":["../../../src/components/motion/morphing-modal.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useEffect } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_PANEL } from \"../../lib/ease\";\nimport { PresenceGate } from \"../../lib/presence-gate\";\n\nexport interface MorphingModalProps {\n /** Which view is currently shown. `null` closes the modal. */\n viewId: string | null;\n onClose: () => void;\n children: ReactNode;\n /** \"bottom\" anchors to the viewport bottom (mobile-like). \"center\" centers vertically. */\n placement?: \"bottom\" | \"center\";\n className?: string;\n}\n\nexport function MorphingModal({\n viewId,\n onClose,\n children,\n placement = \"bottom\",\n className,\n}: MorphingModalProps) {\n const open = viewId !== null;\n const reduce = useReducedMotion();\n const enterY = reduce ? 0 : placement === \"bottom\" ? 40 : 20;\n const enterScale = reduce ? 1 : 0.97;\n\n useEffect(() => {\n if (!open) return;\n const prev = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n return () => {\n document.body.style.overflow = prev;\n };\n }, [open]);\n\n // Mounted only while open, and while open the chrome is two fixed siblings\n // rather than one wrapper: the backdrop spans the viewport edges but carries\n // the scrim colour, and the layer positioning the panel sits inset off every\n // edge (`inset-4`, with the bottom placement's `pb-4` on top of it). Both hang\n // off `PresenceGate`, so interaction releases in the same commit that starts\n // the exit rather than when it ends — `open` is already false for those\n return (\n <AnimatePresence initial={false}>\n {open ? (\n <PresenceGate key=\"backdrop\">\n {({ gate }) => (\n <motion.button\n type=\"button\"\n aria-label=\"Close modal\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.2, ease: EASE_OUT }}\n {...gate}\n onClick={onClose}\n className=\"pointer-events-auto fixed inset-0 z-80 bg-background/5 [-webkit-backdrop-filter:blur(14px)_saturate(140%)] [backdrop-filter:blur(14px)_saturate(140%)]\"\n />\n )}\n </PresenceGate>\n ) : null}\n\n {open ? (\n <PresenceGate key=\"panel-layer\">\n {({ isPresent, gate }) => (\n // The layer itself never takes pointer events, so it carries\n // `inert` alone rather than the gate's pointer-events value.\n <div\n inert={!isPresent}\n className={cn(\n \"pointer-events-none fixed inset-4 z-80 flex justify-center\",\n placement === \"bottom\" ? \"items-end pb-4\" : \"items-center\",\n )}\n >\n <motion.div\n key=\"panel\"\n layout\n initial={{ opacity: 0, y: enterY, scale: enterScale }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{\n opacity: 0,\n y: enterY,\n scale: reduce ? 1 : 0.98,\n transition: { duration: 0.18, ease: EASE_OUT },\n }}\n transition={SPRING_PANEL}\n {...gate}\n className={cn(\n \"pointer-events-auto relative w-full max-w-sm overflow-hidden rounded-3xl border border-border bg-background shadow-2xl will-change-transform\",\n className,\n )}\n >\n <motion.div layout=\"position\" className=\"p-5\">\n <AnimatePresence mode=\"popLayout\" initial={false}>\n <motion.div\n key={viewId}\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: 8, filter: \"blur(4px)\" }}\n animate={\n reduce\n ? {\n opacity: 1,\n transition: {\n duration: 0.18,\n ease: EASE_OUT,\n },\n }\n : {\n opacity: 1,\n y: 0,\n filter: \"blur(0px)\",\n transition: {\n duration: 0.24,\n ease: EASE_OUT,\n },\n }\n }\n exit={\n reduce\n ? {\n opacity: 0,\n transition: {\n duration: 0.14,\n ease: EASE_OUT,\n },\n }\n : {\n opacity: 0,\n y: -8,\n filter: \"blur(4px)\",\n transition: {\n duration: 0.16,\n ease: EASE_OUT,\n },\n }\n }\n >\n {children}\n </motion.div>\n </AnimatePresence>\n </motion.div>\n </motion.div>\n </div>\n )}\n </PresenceGate>\n ) : null}\n </AnimatePresence>\n );\n}\n"],"mappings":";;;;;;;;AAmBA,SAAgB,cAAc,EAC5B,QACA,SACA,UACA,YAAY,UACZ,aACqB;CACrB,MAAM,OAAO,WAAW;CACxB,MAAM,SAAS,iBAAiB;CAChC,MAAM,SAAS,SAAS,IAAI,cAAc,WAAW,KAAK;CAC1D,MAAM,aAAa,SAAS,IAAI;CAEhC,gBAAgB;EACd,IAAI,CAAC,MAAM;EACX,MAAM,OAAO,SAAS,KAAK,MAAM;EACjC,SAAS,KAAK,MAAM,WAAW;EAC/B,aAAa;GACX,SAAS,KAAK,MAAM,WAAW;EACjC;CACF,GAAG,CAAC,IAAI,CAAC;CAQT,OACE,qBAAC,iBAAD;EAAiB,SAAS;EAA1B,UAAA,CACG,OACC,oBAAC,cAAD,EAAA,WACI,EAAE,WACF,oBAAC,OAAO,QAAR;GACE,MAAK;GACL,cAAW;GACX,SAAS,EAAE,SAAS,EAAE;GACtB,SAAS,EAAE,SAAS,EAAE;GACtB,MAAM,EAAE,SAAS,EAAE;GACnB,YAAY;IAAE,UAAU;IAAK,MAAM;GAAS;GAC5C,GAAI;GACJ,SAAS;GACT,WAAU;EACX,CAAA,EAES,GAdI,UAcJ,IACZ,MAEH,OACC,oBAAC,cAAD,EAAA,WACI,EAAE,WAAW,WAGb,oBAAC,OAAD;GACE,OAAO,CAAC;GACR,WAAW,GACT,8DACA,cAAc,WAAW,mBAAmB,cAC9C;GAEA,UAAA,oBAAC,OAAO,KAAR;IAEE,QAAA;IACA,SAAS;KAAE,SAAS;KAAG,GAAG;KAAQ,OAAO;IAAW;IACpD,SAAS;KAAE,SAAS;KAAG,GAAG;KAAG,OAAO;IAAE;IACtC,MAAM;KACJ,S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