@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
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { SPRING_PRESS } from "../../../lib/ease.js";
3
- import { cn } from "cn";
3
+ import { cn } from "@kumix/utils";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import { motion } from "motion/react";
6
6
  //#region src/components/motion/availability-scheduler/icon-button.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button.js","names":[],"sources":["../../../../src/components/motion/availability-scheduler/icon-button.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { cn } from \"cn\";\nimport { motion } from \"motion/react\";\n\nimport { SPRING_PRESS } from \"../../../lib/ease\";\n\nexport function IconButton({\n onClick,\n label,\n disabled,\n expanded,\n reduce,\n children,\n className,\n // Rest props let a wrapping Tooltip inject its hover/focus handlers.\n ...rest\n}: {\n onClick: () => void;\n label: string;\n disabled?: boolean;\n expanded?: boolean;\n reduce: boolean;\n children: ReactNode;\n className?: string;\n [key: string]: unknown;\n}) {\n return (\n <motion.button\n {...rest}\n type=\"button\"\n aria-label={label}\n aria-expanded={expanded}\n onClick={onClick}\n disabled={disabled}\n whileTap={reduce || disabled ? undefined : { scale: 0.86 }}\n transition={SPRING_PRESS}\n className={cn(\n \"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40\",\n className,\n )}\n >\n {children}\n </motion.button>\n );\n}\n"],"mappings":";;;;;;AAQA,SAAgB,WAAW,EACzB,SACA,OACA,UACA,UACA,QACA,UACA,WAEA,GAAG,QAUF;CACD,OACE,oBAAC,OAAO,QAAR;EACE,GAAI;EACJ,MAAK;EACL,cAAY;EACZ,iBAAe;EACN;EACC;EACV,UAAU,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;EACzD,YAAY;EACZ,WAAW,GACT,+PACA,SACF;EAEC;CACY,CAAA;AAEnB"}
1
+ {"version":3,"file":"icon-button.js","names":[],"sources":["../../../../src/components/motion/availability-scheduler/icon-button.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { motion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { SPRING_PRESS } from \"../../../lib/ease\";\n\nexport function IconButton({\n onClick,\n label,\n disabled,\n expanded,\n reduce,\n children,\n className,\n // Rest props let a wrapping Tooltip inject its hover/focus handlers.\n ...rest\n}: {\n onClick: () => void;\n label: string;\n disabled?: boolean;\n expanded?: boolean;\n reduce: boolean;\n children: ReactNode;\n className?: string;\n [key: string]: unknown;\n}) {\n return (\n <motion.button\n {...rest}\n type=\"button\"\n aria-label={label}\n aria-expanded={expanded}\n onClick={onClick}\n disabled={disabled}\n whileTap={reduce || disabled ? undefined : { scale: 0.86 }}\n transition={SPRING_PRESS}\n className={cn(\n \"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40\",\n className,\n )}\n >\n {children}\n </motion.button>\n );\n}\n"],"mappings":";;;;;;AAQA,SAAgB,WAAW,EACzB,SACA,OACA,UACA,UACA,QACA,UACA,WAEA,GAAG,QAUF;CACD,OACE,oBAAC,OAAO,QAAR;EACE,GAAI;EACJ,MAAK;EACL,cAAY;EACZ,iBAAe;EACN;EACC;EACV,UAAU,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;EACzD,YAAY;EACZ,WAAW,GACT,+PACA,SACF;EAEC;CACY,CAAA;AAEnB"}
@@ -2,7 +2,7 @@
2
2
  import { a as defaultWeek, n as WEEKDAYS, r as buildOptions, s as panelKey } from "../../../copy-menu-C5GaT4Z-.js";
3
3
  import { DayRow } from "./day-row.js";
4
4
  import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
5
- import { cn } from "cn";
5
+ import { cn } from "@kumix/utils";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { LayoutGroup, useReducedMotion } from "motion/react";
8
8
  //#region src/components/motion/availability-scheduler/index.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/motion/availability-scheduler/index.tsx"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport { cn } from \"cn\";\nimport { LayoutGroup, useReducedMotion } from \"motion/react\";\n\nimport { DayRow } from \"./day-row\";\nimport {\n buildOptions,\n type DayAvailability,\n type DayKey,\n defaultWeek,\n panelKey,\n WEEKDAYS,\n type WeekAvailability,\n} from \"./types\";\n\nexport type {\n DayAvailability,\n DayKey,\n TimeRange,\n WeekAvailability,\n} from \"./types\";\nexport { defaultWeek } from \"./types\";\n\nexport interface AvailabilitySchedulerProps {\n value?: WeekAvailability;\n defaultValue?: WeekAvailability;\n onChange?: (value: WeekAvailability) => void;\n /** Minutes between selectable times. Default 30. */\n step?: number;\n className?: string;\n}\n\nexport function AvailabilityScheduler({\n value,\n defaultValue,\n onChange,\n step = 30,\n className,\n}: AvailabilitySchedulerProps) {\n const reduce = useReducedMotion() ?? false;\n const groupId = useId();\n const options = useMemo(() => buildOptions(step), [step]);\n const idRef = useRef(0);\n\n const [internal, setInternal] = useState<WeekAvailability>(() => defaultValue ?? defaultWeek());\n // The row that last opened a dropdown paints above the rest — see DayRow.\n const [openDay, setOpenDay] = useState<DayKey | null>(null);\n // Exactly one time panel is open at a time, and the scheduler is the one that\n // knows which. A panel is absolutely positioned inside its own field, so two\n // open at once paint over each other's options — and nothing else can close\n // the first: a Select only dismisses on an outside *pointerdown*, which\n // keyboard and assistive-technology activation never fires.\n const [openPanel, setOpenPanel] = useState<string | null>(null);\n const controlled = value !== undefined;\n const week = controlled ? value : internal;\n\n // Which panels the week currently puts on screen. A field that leaves — its\n // day switched off, its range removed — never reports its panel closed: the\n // only thing that dismisses a controlled Select is an outside pointerdown,\n // and a field on its way out is no longer there to hear one. Keeping its id\n // would reopen the panel the moment the same range came back.\n const livePanels = useMemo(() => {\n const ids = new Set<string>();\n for (const { key } of WEEKDAYS) {\n if (!week[key].enabled) continue;\n for (const range of week[key].ranges) {\n ids.add(panelKey(key, range.id, \"start\"));\n ids.add(panelKey(key, range.id, \"end\"));\n }\n }\n return ids;\n }, [week]);\n\n useEffect(() => {\n if (openPanel !== null && !livePanels.has(openPanel)) setOpenPanel(null);\n }, [livePanels, openPanel]);\n\n const commit = useCallback(\n (next: WeekAvailability) => {\n if (!controlled) setInternal(next);\n onChange?.(next);\n },\n [controlled, onChange],\n );\n\n const setDay = useCallback(\n (day: DayKey, next: DayAvailability) => {\n commit({ ...week, [day]: next });\n },\n [commit, week],\n );\n\n const panelOpenChange = useCallback((day: DayKey, id: string, open: boolean) => {\n setOpenPanel((current) => (open ? id : current === id ? null : current));\n // Elevation stays on the row that opened last so the panel's collapse\n // animation finishes above its neighbours.\n if (open) setOpenDay(day);\n }, []);\n\n const copyDay = useCallback(\n (from: DayKey, targets: DayKey[]) => {\n const source = week[from];\n const next = { ...week };\n for (const t of targets) {\n next[t] = {\n enabled: source.enabled,\n ranges: source.ranges.map((r) => ({\n ...r,\n id: `${t}-c${idRef.current++}`,\n })),\n };\n }\n commit(next);\n },\n [commit, week],\n );\n\n return (\n <LayoutGroup id={groupId}>\n <div className={cn(\"w-full max-w-xl divide-y divide-border\", className)}>\n {WEEKDAYS.map(({ key, label }) => (\n <DayRow\n key={key}\n day={key}\n label={label}\n state={week[key]}\n options={options}\n reduce={reduce}\n elevated={openDay === key}\n openPanel={openPanel}\n onChange={(next) => setDay(key, next)}\n onCopy={(targets) => copyDay(key, targets)}\n onPanelOpenChange={(id, open) => panelOpenChange(key, id, open)}\n />\n ))}\n </div>\n </LayoutGroup>\n );\n}\n"],"mappings":";;;;;;;;AAkCA,SAAgB,sBAAsB,EACpC,OACA,cACA,UACA,OAAO,IACP,aAC6B;CAC7B,MAAM,SAAS,iBAAiB,KAAK;CACrC,MAAM,UAAU,MAAM;CACtB,MAAM,UAAU,cAAc,aAAa,IAAI,GAAG,CAAC,IAAI,CAAC;CACxD,MAAM,QAAQ,OAAO,CAAC;CAEtB,MAAM,CAAC,UAAU,eAAe,eAAiC,gBAAgB,YAAY,CAAC;CAE9F,MAAM,CAAC,SAAS,cAAc,SAAwB,IAAI;CAM1D,MAAM,CAAC,WAAW,gBAAgB,SAAwB,IAAI;CAC9D,MAAM,aAAa,UAAU,KAAA;CAC7B,MAAM,OAAO,aAAa,QAAQ;CAOlC,MAAM,aAAa,cAAc;EAC/B,MAAM,sBAAM,IAAI,IAAY;EAC5B,KAAK,MAAM,EAAE,SAAS,UAAU;GAC9B,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS;GACxB,KAAK,MAAM,SAAS,KAAK,IAAI,CAAC,QAAQ;IACpC,IAAI,IAAI,SAAS,KAAK,MAAM,IAAI,OAAO,CAAC;IACxC,IAAI,IAAI,SAAS,KAAK,MAAM,IAAI,KAAK,CAAC;GACxC;EACF;EACA,OAAO;CACT,GAAG,CAAC,IAAI,CAAC;CAET,gBAAgB;EACd,IAAI,cAAc,QAAQ,CAAC,WAAW,IAAI,SAAS,GAAG,aAAa,IAAI;CACzE,GAAG,CAAC,YAAY,SAAS,CAAC;CAE1B,MAAM,SAAS,aACZ,SAA2B;EAC1B,IAAI,CAAC,YAAY,YAAY,IAAI;EACjC,WAAW,IAAI;CACjB,GACA,CAAC,YAAY,QAAQ,CACvB;CAEA,MAAM,SAAS,aACZ,KAAa,SAA0B;EACtC,OAAO;GAAE,GAAG;IAAO,MAAM;EAAK,CAAC;CACjC,GACA,CAAC,QAAQ,IAAI,CACf;CAEA,MAAM,kBAAkB,aAAa,KAAa,IAAY,SAAkB;EAC9E,cAAc,YAAa,OAAO,KAAK,YAAY,KAAK,OAAO,OAAQ;EAGvE,IAAI,MAAM,WAAW,GAAG;CAC1B,GAAG,CAAC,CAAC;CAEL,MAAM,UAAU,aACb,MAAc,YAAsB;EACnC,MAAM,SAAS,KAAK;EACpB,MAAM,OAAO,EAAE,GAAG,KAAK;EACvB,KAAK,MAAM,KAAK,SACd,KAAK,KAAK;GACR,SAAS,OAAO;GAChB,QAAQ,OAAO,OAAO,KAAK,OAAO;IAChC,GAAG;IACH,IAAI,GAAG,EAAE,IAAI,MAAM;GACrB,EAAE;EACJ;EAEF,OAAO,IAAI;CACb,GACA,CAAC,QAAQ,IAAI,CACf;CAEA,OACE,oBAAC,aAAD;EAAa,IAAI;EACf,UAAA,oBAAC,OAAD;GAAK,WAAW,GAAG,0CAA0C,SAAS;GACnE,UAAA,SAAS,KAAK,EAAE,KAAK,YACpB,oBAAC,QAAD;IAEE,KAAK;IACE;IACP,OAAO,KAAK;IACH;IACD;IACR,UAAU,YAAY;IACX;IACX,WAAW,SAAS,OAAO,KAAK,IAAI;IACpC,SAAS,YAAY,QAAQ,KAAK,OAAO;IACzC,oBAAoB,IAAI,SAAS,gBAAgB,KAAK,IAAI,IAAI;GAC/D,GAXM,GAWN,CACF;EACE,CAAA;CACM,CAAA;AAEjB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/motion/availability-scheduler/index.tsx"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport { LayoutGroup, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { DayRow } from \"./day-row\";\nimport {\n buildOptions,\n type DayAvailability,\n type DayKey,\n defaultWeek,\n panelKey,\n WEEKDAYS,\n type WeekAvailability,\n} from \"./types\";\n\nexport type {\n DayAvailability,\n DayKey,\n TimeRange,\n WeekAvailability,\n} from \"./types\";\nexport { defaultWeek } from \"./types\";\n\nexport interface AvailabilitySchedulerProps {\n value?: WeekAvailability;\n defaultValue?: WeekAvailability;\n onChange?: (value: WeekAvailability) => void;\n /** Minutes between selectable times. Default 30. */\n step?: number;\n className?: string;\n}\n\nexport function AvailabilityScheduler({\n value,\n defaultValue,\n onChange,\n step = 30,\n className,\n}: AvailabilitySchedulerProps) {\n const reduce = useReducedMotion() ?? false;\n const groupId = useId();\n const options = useMemo(() => buildOptions(step), [step]);\n const idRef = useRef(0);\n\n const [internal, setInternal] = useState<WeekAvailability>(() => defaultValue ?? defaultWeek());\n // The row that last opened a dropdown paints above the rest — see DayRow.\n const [openDay, setOpenDay] = useState<DayKey | null>(null);\n // Exactly one time panel is open at a time, and the scheduler is the one that\n // knows which. A panel is absolutely positioned inside its own field, so two\n // open at once paint over each other's options — and nothing else can close\n // the first: a Select only dismisses on an outside *pointerdown*, which\n // keyboard and assistive-technology activation never fires.\n const [openPanel, setOpenPanel] = useState<string | null>(null);\n const controlled = value !== undefined;\n const week = controlled ? value : internal;\n\n // Which panels the week currently puts on screen. A field that leaves — its\n // day switched off, its range removed — never reports its panel closed: the\n // only thing that dismisses a controlled Select is an outside pointerdown,\n // and a field on its way out is no longer there to hear one. Keeping its id\n // would reopen the panel the moment the same range came back.\n const livePanels = useMemo(() => {\n const ids = new Set<string>();\n for (const { key } of WEEKDAYS) {\n if (!week[key].enabled) continue;\n for (const range of week[key].ranges) {\n ids.add(panelKey(key, range.id, \"start\"));\n ids.add(panelKey(key, range.id, \"end\"));\n }\n }\n return ids;\n }, [week]);\n\n useEffect(() => {\n if (openPanel !== null && !livePanels.has(openPanel)) setOpenPanel(null);\n }, [livePanels, openPanel]);\n\n const commit = useCallback(\n (next: WeekAvailability) => {\n if (!controlled) setInternal(next);\n onChange?.(next);\n },\n [controlled, onChange],\n );\n\n const setDay = useCallback(\n (day: DayKey, next: DayAvailability) => {\n commit({ ...week, [day]: next });\n },\n [commit, week],\n );\n\n const panelOpenChange = useCallback((day: DayKey, id: string, open: boolean) => {\n setOpenPanel((current) => (open ? id : current === id ? null : current));\n // Elevation stays on the row that opened last so the panel's collapse\n // animation finishes above its neighbours.\n if (open) setOpenDay(day);\n }, []);\n\n const copyDay = useCallback(\n (from: DayKey, targets: DayKey[]) => {\n const source = week[from];\n const next = { ...week };\n for (const t of targets) {\n next[t] = {\n enabled: source.enabled,\n ranges: source.ranges.map((r) => ({\n ...r,\n id: `${t}-c${idRef.current++}`,\n })),\n };\n }\n commit(next);\n },\n [commit, week],\n );\n\n return (\n <LayoutGroup id={groupId}>\n <div className={cn(\"w-full max-w-xl divide-y divide-border\", className)}>\n {WEEKDAYS.map(({ key, label }) => (\n <DayRow\n key={key}\n day={key}\n label={label}\n state={week[key]}\n options={options}\n reduce={reduce}\n elevated={openDay === key}\n openPanel={openPanel}\n onChange={(next) => setDay(key, next)}\n onCopy={(targets) => copyDay(key, targets)}\n onPanelOpenChange={(id, open) => panelOpenChange(key, id, open)}\n />\n ))}\n </div>\n </LayoutGroup>\n );\n}\n"],"mappings":";;;;;;;;AAkCA,SAAgB,sBAAsB,EACpC,OACA,cACA,UACA,OAAO,IACP,aAC6B;CAC7B,MAAM,SAAS,iBAAiB,KAAK;CACrC,MAAM,UAAU,MAAM;CACtB,MAAM,UAAU,cAAc,aAAa,IAAI,GAAG,CAAC,IAAI,CAAC;CACxD,MAAM,QAAQ,OAAO,CAAC;CAEtB,MAAM,CAAC,UAAU,eAAe,eAAiC,gBAAgB,YAAY,CAAC;CAE9F,MAAM,CAAC,SAAS,cAAc,SAAwB,IAAI;CAM1D,MAAM,CAAC,WAAW,gBAAgB,SAAwB,IAAI;CAC9D,MAAM,aAAa,UAAU,KAAA;CAC7B,MAAM,OAAO,aAAa,QAAQ;CAOlC,MAAM,aAAa,cAAc;EAC/B,MAAM,sBAAM,IAAI,IAAY;EAC5B,KAAK,MAAM,EAAE,S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AAD;IAEE,KAAK;IACE;IACP,OAAO,KAAK;IACH;IACD;IACR,UAAU,YAAY;IACX;IACX,WAAW,SAAS,OAAO,KAAK,IAAI;IACpC,SAAS,YAAY,QAAQ,KAAK,OAAO;IACzC,oBAAoB,IAAI,SAAS,gBAAgB,KAAK,IAAI,IAAI;GAC/D,GAXM,GAWN,CACF;EACE,CAAA;CACM,CAAA;AAEjB"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { EASE_OUT } from "../../lib/ease.js";
3
3
  import { useEffect, useId, 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 { AnimatePresence, motion, useReducedMotion } from "motion/react";
7
7
  import { Bell, FileText, FolderClosed, LayoutGrid, Link, Plus, Table, X } from "lucide-react";
@@ -1 +1 @@
1
- {"version":3,"file":"bloom-menu.js","names":[],"sources":["../../../src/components/motion/bloom-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentType, useEffect, useId, useRef, useState } from \"react\";\nimport { cn } from \"cn\";\nimport { Bell, FileText, FolderClosed, LayoutGrid, Link, Plus, Table, X } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { EASE_OUT } from \"../../lib/ease\";\n\ntype MenuItem = { label: string; icon: ComponentType<{ className?: string }> };\n\nconst ITEMS: MenuItem[] = [\n { label: \"Doc\", icon: FileText },\n { label: \"Board\", icon: LayoutGrid },\n { label: \"Table\", icon: Table },\n { label: \"Folder\", icon: FolderClosed },\n { label: \"Reminder\", icon: Bell },\n { label: \"Link\", icon: Link },\n];\n\n// Folder-open feel: a touch of overshoot as the panel expands, kept subtle.\nconst SPRING_FOLDER = {\n type: \"spring\",\n stiffness: 300,\n damping: 32,\n mass: 0.9,\n} as const;\n\nexport interface BloomMenuProps {\n items?: MenuItem[];\n onSelect?: (label: string) => void;\n className?: string;\n}\n\nexport function BloomMenu({ items = ITEMS, onSelect, className }: BloomMenuProps) {\n const [open, setOpen] = useState(false);\n const reduce = useReducedMotion();\n const layoutId = useId();\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") setOpen(false);\n };\n const onPointer = (e: PointerEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false);\n };\n window.addEventListener(\"keydown\", onKey);\n window.addEventListener(\"pointerdown\", onPointer);\n return () => {\n window.removeEventListener(\"keydown\", onKey);\n window.removeEventListener(\"pointerdown\", onPointer);\n };\n }, [open]);\n\n const morph = reduce ? { duration: 0.15 } : SPRING_FOLDER;\n\n return (\n <div ref={ref} className={cn(\"relative inline-flex\", className)}>\n {/* spacer fixes the anchor to the trigger size */}\n <div className=\"h-11 w-36\" aria-hidden />\n\n {/* Centering box sized to the OPEN panel and centered on the trigger.\n place-items-center only centers an item that fits its cell, so the cell\n must be as wide as the panel — otherwise the overflow left-anchors and\n the panel expands rightward. The box is a fixed size per viewport (vw\n doesn't change mid-animation), so its -translate centering never drifts\n the way a content-sized wrapper would. Both states share its center, so\n the morph grows from the middle outward in every direction. */}\n <div className=\"pointer-events-none absolute top-1/2 left-1/2 z-30 grid h-[300px] w-[min(86vw,420px)] -translate-x-1/2 -translate-y-1/2 place-items-center *:pointer-events-auto\">\n {/* popLayout pulls the exiting trigger out of grid flow at once, so the\n grid never briefly holds two rows and shoves the panel off-center */}\n <AnimatePresence initial={false} mode=\"popLayout\">\n {open ? (\n <motion.div\n key=\"panel\"\n layoutId={layoutId}\n transition={morph}\n style={{ borderRadius: 16 }}\n className=\"w-[min(86vw,420px)] overflow-hidden border border-border bg-card\"\n >\n <motion.div\n // `layout` lets framer undo the box's morph scaling so this\n // content stays crisp instead of stretching with the resize.\n layout\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ delay: reduce ? 0 : 0.12, duration: 0.2 }}\n >\n {/* header */}\n <div className=\"flex items-center justify-between border-border border-b px-4 py-3\">\n <span className=\"font-medium text-muted-foreground text-sm\">Create</span>\n <button\n type=\"button\"\n onClick={() => setOpen(false)}\n aria-label=\"Close menu\"\n className=\"text-muted-foreground transition-colors hover:text-foreground\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n\n {/* grid */}\n <motion.div\n // Iris reveal: start as a small box at the grid center and open\n // outward to all four corners, so the menu grows from the middle\n // in every direction instead of wiping top-down.\n initial={reduce ? false : { clipPath: \"inset(45% 34% 45% 34%)\" }}\n animate={{ clipPath: \"inset(0% 0% 0% 0%)\" }}\n transition={{\n delay: reduce ? 0 : 0.08,\n duration: 0.45,\n ease: EASE_OUT,\n }}\n className=\"grid grid-cols-3\"\n >\n {items.map((item, i) => {\n // Radial stagger: delay each item by its distance from the\n // grid center so the four corners animate together and the\n // open reads as center-out, not corner-by-corner.\n const cols = 3;\n const rows = Math.ceil(items.length / cols);\n const col = i % cols;\n const row = Math.floor(i / cols);\n const dist = Math.hypot(col - (cols - 1) / 2, row - (rows - 1) / 2);\n return (\n <button\n key={item.label}\n type=\"button\"\n onClick={() => {\n onSelect?.(item.label);\n setOpen(false);\n }}\n // Static cell with hairline borders (no animated fill) so\n // the grid lines never flicker as items stagger in. Only the\n // inner content animates.\n className={cn(\n \"flex items-center justify-center px-3 py-6 text-muted-foreground transition-colors hover:text-foreground\",\n i % 3 !== 2 && \"border-border border-r\",\n i < 3 && \"border-border border-b\",\n )}\n >\n <motion.span\n initial={\n reduce\n ? { opacity: 0 }\n : { opacity: 0, scale: 0.85, filter: \"blur(6px)\" }\n }\n animate={{ opacity: 1, scale: 1, filter: \"blur(0px)\" }}\n transition={{\n delay: reduce ? 0 : 0.1 + dist * 0.07,\n type: \"spring\",\n stiffness: 440,\n damping: 34,\n }}\n className=\"flex flex-col items-center gap-2\"\n >\n <item.icon className=\"h-5 w-5\" />\n <span className=\"font-medium text-sm\">{item.label}</span>\n </motion.span>\n </button>\n );\n })}\n </motion.div>\n </motion.div>\n </motion.div>\n ) : (\n <motion.button\n key=\"trigger\"\n type=\"button\"\n layoutId={layoutId}\n transition={morph}\n style={{ borderRadius: 16 }}\n onClick={() => setOpen(true)}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n whileTap={reduce ? undefined : { scale: 0.97 }}\n className=\"inline-flex h-11 w-36 items-center justify-center border border-border bg-card font-medium text-foreground text-sm\"\n >\n {/* own `layout` counter-scales the label so it stays crisp while the\n button box morphs, instead of stretching with it */}\n <motion.span layout className=\"inline-flex items-center gap-2 whitespace-nowrap\">\n Create\n <Plus className=\"h-4 w-4\" />\n </motion.span>\n </motion.button>\n )}\n </AnimatePresence>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAWA,MAAM,QAAoB;CACxB;EAAE,OAAO;EAAO,MAAM;CAAS;CAC/B;EAAE,OAAO;EAAS,MAAM;CAAW;CACnC;EAAE,OAAO;EAAS,MAAM;CAAM;CAC9B;EAAE,OAAO;EAAU,MAAM;CAAa;CACtC;EAAE,OAAO;EAAY,MAAM;CAAK;CAChC;EAAE,OAAO;EAAQ,MAAM;CAAK;AAC9B;AAGA,MAAM,gBAAgB;CACpB,MAAM;CACN,WAAW;CACX,SAAS;CACT,MAAM;AACR;AAQA,SAAgB,UAAU,EAAE,QAAQ,OAAO,UAAU,aAA6B;CAChF,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,MAAM,SAAS,iBAAiB;CAChC,MAAM,WAAW,MAAM;CACvB,MAAM,MAAM,OAAuB,IAAI;CAEvC,gBAAgB;EACd,IAAI,CAAC,MAAM;EACX,MAAM,SAAS,MAAqB;GAClC,IAAI,EAAE,QAAQ,UAAU,QAAQ,KAAK;EACvC;EACA,MAAM,aAAa,MAAoB;GACrC,IAAI,IAAI,WAAW,CAAC,IAAI,QAAQ,SAAS,EAAE,MAAc,GAAG,QAAQ,KAAK;EAC3E;EACA,OAAO,iBAAiB,WAAW,KAAK;EACxC,OAAO,iBAAiB,eAAe,SAAS;EAChD,aA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QAC/B,MAAM,OAAO,KAAK,MAAM,MAAM,GAAgB,OAAO,OAAO,KAAK,CAAC;QAClE,OACE,oBAAC,UAAD;SAEE,MAAK;SACL,eAAe;UACb,WAAW,KAAK,KAAK;UACrB,QAAQ,KAAK;SACf;SAIA,WAAW,GACT,4GACA,IAAI,MAAM,KAAK,0BACf,IAAI,KAAK,wBACX;SAEA,UAAA,qBAAC,OAAO,MAAR;UACE,SACE,SACI,EAAE,SAAS,EAAE,IACb;WAAE,SAAS;WAAG,OAAO;WAAM,QAAQ;UAAY;UAErD,SAAS;WAAE,SAAS;WAAG,OAAO;WAAG,QAAQ;UAAY;UACrD,YAAY;WACV,OAAO,SAAS,IAAI,KAAM,OAAO;WACjC,MAAM;WACN,WAAW;WACX,SAAS;UACX;UACA,WAAU;UAbZ,UAAA,CAeE,oBAAC,KAAK,MAAN,EAAW,WAAU,UAAW,CAAA,GAChC,oBAAC,QAAD;WAAM,WAAU;WAAuB,UAAA,KAAK;UAAY,CAAA,CAC7C;;QACP,GAjCD,KAAK,KAiCJ;OAEZ,CAAC;MACS,CAAA,CACF;;IACF,GA1FN,OA0FM,IAEZ,oBAAC,OAAO,QAAR;KAEE,MAAK;KACK;KACV,YAAY;KACZ,OAAO,EAAE,cAAc,GAAG;KAC1B,eAAe,QAAQ,IAAI;KAC3B,iBAAc;KACd,iBAAe;KACf,UAAU,SAAS,KAAA,IAAY,EAAE,OAAO,IAAK;KAC7C,WAAU;KAIV,UAAA,qBAAC,OAAO,MAAR;MAAa,QAAA;MAAO,WAAU;MAA9B,UAAA,CAAiF,UAE/E,oBAAC,MAAD,EAAM,WAAU,UAAW,CAAA,CAChB;;IACA,GAjBT,SAiBS;GAEF,CAAA;EACd,CAAA,CACF;;AAET"}
1
+ {"version":3,"file":"bloom-menu.js","names":[],"sources":["../../../src/components/motion/bloom-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentType, useEffect, useId, useRef, useState } from \"react\";\nimport { Bell, FileText, FolderClosed, LayoutGrid, Link, Plus, Table, X } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT } from \"../../lib/ease\";\n\ntype MenuItem = { label: string; icon: ComponentType<{ className?: string }> };\n\nconst ITEMS: MenuItem[] = [\n { label: \"Doc\", icon: FileText },\n { label: \"Board\", icon: LayoutGrid },\n { label: \"Table\", icon: Table },\n { label: \"Folder\", icon: FolderClosed },\n { label: \"Reminder\", icon: Bell },\n { label: \"Link\", icon: Link },\n];\n\n// Folder-open feel: a touch of overshoot as the panel expands, kept subtle.\nconst SPRING_FOLDER = {\n type: \"spring\",\n stiffness: 300,\n damping: 32,\n mass: 0.9,\n} as const;\n\nexport interface BloomMenuProps {\n items?: MenuItem[];\n onSelect?: (label: string) => void;\n className?: string;\n}\n\nexport function BloomMenu({ items = ITEMS, onSelect, className }: BloomMenuProps) {\n const [open, setOpen] = useState(false);\n const reduce = useReducedMotion();\n const layoutId = useId();\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") setOpen(false);\n };\n const onPointer = (e: PointerEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false);\n };\n window.addEventListener(\"keydown\", onKey);\n window.addEventListener(\"pointerdown\", onPointer);\n return () => {\n window.removeEventListener(\"keydown\", onKey);\n window.removeEventListener(\"pointerdown\", onPointer);\n };\n }, [open]);\n\n const morph = reduce ? { duration: 0.15 } : SPRING_FOLDER;\n\n return (\n <div ref={ref} className={cn(\"relative inline-flex\", className)}>\n {/* spacer fixes the anchor to the trigger size */}\n <div className=\"h-11 w-36\" aria-hidden />\n\n {/* Centering box sized to the OPEN panel and centered on the trigger.\n place-items-center only centers an item that fits its cell, so the cell\n must be as wide as the panel — otherwise the overflow left-anchors and\n the panel expands rightward. The box is a fixed size per viewport (vw\n doesn't change mid-animation), so its -translate centering never drifts\n the way a content-sized wrapper would. Both states share its center, so\n the morph grows from the middle outward in every direction. */}\n <div className=\"pointer-events-none absolute top-1/2 left-1/2 z-30 grid h-[300px] w-[min(86vw,420px)] -translate-x-1/2 -translate-y-1/2 place-items-center *:pointer-events-auto\">\n {/* popLayout pulls the exiting trigger out of grid flow at once, so the\n grid never briefly holds two rows and shoves the panel off-center */}\n <AnimatePresence initial={false} mode=\"popLayout\">\n {open ? (\n <motion.div\n key=\"panel\"\n layoutId={layoutId}\n transition={morph}\n style={{ borderRadius: 16 }}\n className=\"w-[min(86vw,420px)] overflow-hidden border border-border bg-card\"\n >\n <motion.div\n // `layout` lets framer undo the box's morph scaling so this\n // content stays crisp instead of stretching with the resize.\n layout\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ delay: reduce ? 0 : 0.12, duration: 0.2 }}\n >\n {/* header */}\n <div className=\"flex items-center justify-between border-border border-b px-4 py-3\">\n <span className=\"font-medium text-muted-foreground text-sm\">Create</span>\n <button\n type=\"button\"\n onClick={() => setOpen(false)}\n aria-label=\"Close menu\"\n className=\"text-muted-foreground transition-colors hover:text-foreground\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n\n {/* grid */}\n <motion.div\n // Iris reveal: start as a small box at the grid center and open\n // outward to all four corners, so the menu grows from the middle\n // in every direction instead of wiping top-down.\n initial={reduce ? false : { clipPath: \"inset(45% 34% 45% 34%)\" }}\n animate={{ clipPath: \"inset(0% 0% 0% 0%)\" }}\n transition={{\n delay: reduce ? 0 : 0.08,\n duration: 0.45,\n ease: EASE_OUT,\n }}\n className=\"grid grid-cols-3\"\n >\n {items.map((item, i) => {\n // Radial stagger: delay each item by its distance from the\n // grid center so the four corners animate together and the\n // open reads as center-out, not corner-by-corner.\n const cols = 3;\n const rows = Math.ceil(items.length / cols);\n const col = i % cols;\n const row = Math.floor(i / cols);\n const dist = Math.hypot(col - (cols - 1) / 2, row - (rows - 1) / 2);\n return (\n <button\n key={item.label}\n type=\"button\"\n onClick={() => {\n onSelect?.(item.label);\n setOpen(false);\n }}\n // Static cell with hairline borders (no animated fill) so\n // the grid lines never flicker as items stagger in. Only the\n // inner content animates.\n className={cn(\n \"flex items-center justify-center px-3 py-6 text-muted-foreground transition-colors hover:text-foreground\",\n i % 3 !== 2 && \"border-border border-r\",\n i < 3 && \"border-border border-b\",\n )}\n >\n <motion.span\n initial={\n reduce\n ? { opacity: 0 }\n : { opacity: 0, scale: 0.85, filter: \"blur(6px)\" }\n }\n animate={{ opacity: 1, scale: 1, filter: \"blur(0px)\" }}\n transition={{\n delay: reduce ? 0 : 0.1 + dist * 0.07,\n type: \"spring\",\n stiffness: 440,\n damping: 34,\n }}\n className=\"flex flex-col items-center gap-2\"\n >\n <item.icon className=\"h-5 w-5\" />\n <span className=\"font-medium text-sm\">{item.label}</span>\n </motion.span>\n </button>\n );\n })}\n </motion.div>\n </motion.div>\n </motion.div>\n ) : (\n <motion.button\n key=\"trigger\"\n type=\"button\"\n layoutId={layoutId}\n transition={morph}\n style={{ borderRadius: 16 }}\n onClick={() => setOpen(true)}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n whileTap={reduce ? undefined : { scale: 0.97 }}\n className=\"inline-flex h-11 w-36 items-center justify-center border border-border bg-card font-medium text-foreground text-sm\"\n >\n {/* own `layout` counter-scales the label so it stays crisp while the\n button box morphs, instead of stretching with it */}\n <motion.span layout className=\"inline-flex items-center gap-2 whitespace-nowrap\">\n Create\n <Plus className=\"h-4 w-4\" />\n </motion.span>\n </motion.button>\n )}\n </AnimatePresence>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAWA,MAAM,QAAoB;CACxB;EAAE,OAAO;EAAO,MAAM;CAAS;CAC/B;EAAE,OAAO;EAAS,MAAM;CAAW;CACnC;EAAE,OAAO;EAAS,MAAM;CAAM;CAC9B;EAAE,OAAO;EAAU,MAAM;CAAa;CACtC;EAAE,OAAO;EAAY,MAAM;CAAK;CAChC;EAAE,OAAO;EAAQ,MAAM;CAAK;AA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,GA1FN,OA0FM,IAEZ,oBAAC,OAAO,QAAR;KAEE,MAAK;KACK;KACV,YAAY;KACZ,OAAO,EAAE,cAAc,GAAG;KAC1B,eAAe,QAAQ,IAAI;KAC3B,iBAAc;KACd,iBAAe;KACf,UAAU,SAAS,KAAA,IAAY,EAAE,OAAO,IAAK;KAC7C,WAAU;KAIV,UAAA,qBAAC,OAAO,MAAR;MAAa,QAAA;MAAO,WAAU;MAA9B,UAAA,CAAiF,UAE/E,oBAAC,MAAD,EAAM,WAAU,UAAW,CAAA,CAChB;;IACA,GAjBT,SAiBS;GAEF,CAAA;EACd,CAAA,CACF;;AAET"}
@@ -3,7 +3,7 @@ import { TOUCH_GESTURE_CONTENT_CLASS } from "../../lib/touch.js";
3
3
  import { EASE_DRAWER } from "../../lib/ease.js";
4
4
  import { t as PresenceGate } from "../../presence-gate-BekdC4Bo.js";
5
5
  import { useEffect, useId, useRef, useState } from "react";
6
- import { cn } from "cn";
6
+ import { cn } from "@kumix/utils";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  import { AnimatePresence, motion, useDragControls, useReducedMotion } from "motion/react";
9
9
  import { createPortal } from "react-dom";
@@ -1 +1 @@
1
- {"version":3,"file":"bottom-sheet.js","names":[],"sources":["../../../src/components/motion/bottom-sheet.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useEffect, useId, useRef, useState } from \"react\";\nimport { cn } from \"cn\";\nimport {\n AnimatePresence,\n motion,\n type PanInfo,\n useDragControls,\n useReducedMotion,\n} from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { EASE_DRAWER } from \"../../lib/ease\";\nimport { PresenceGate } from \"../../lib/presence-gate\";\nimport { TOUCH_GESTURE_CONTENT_CLASS } from \"../../lib/touch\";\n\n// Vaul-style glide: a long, fully-damped tween reads smoother than a spring on\n// open — no settle/overshoot, just one clean decel. Same curve drives the\n// backdrop fade so the surface and scrim move as one.\nconst DRAWER = { duration: 0.5, ease: EASE_DRAWER } as const;\n\nexport interface BottomSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** Heights (0-1 = fraction of viewport, or \"auto\"). First entry is default. */\n snapPoints?: (number | \"auto\")[];\n defaultSnap?: number;\n title?: string;\n description?: string;\n children?: ReactNode;\n className?: string;\n /** Min drag distance (px) past current snap to dismiss. */\n dismissThreshold?: number;\n}\n\nexport function BottomSheet({\n open,\n onOpenChange,\n snapPoints = [0.5, 0.92],\n defaultSnap = 0,\n title,\n description,\n children,\n className,\n dismissThreshold = 120,\n}: BottomSheetProps) {\n const [snap, setSnap] = useState(defaultSnap);\n const [mounted, setMounted] = useState(false);\n const dragControls = useDragControls();\n const sheetRef = useRef<HTMLDivElement>(null);\n const reduce = useReducedMotion();\n const heightRef = useRef(0);\n const uid = useId();\n const titleId = `${uid}-title`;\n const descriptionId = `${uid}-description`;\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n useEffect(() => {\n if (open) setSnap(defaultSnap);\n }, [open, defaultSnap]);\n\n // Lock background scroll while open. overflow:hidden alone is ignored by\n // iOS Safari — boundary scrolls inside the sheet chain to the page, which\n // scrolls underneath and ends up somewhere else on close. position:fixed\n // is the lock that actually holds; restore the scroll position after.\n useEffect(() => {\n if (!open) return;\n const body = document.body;\n const scrollY = window.scrollY;\n const prev = {\n position: body.style.position,\n top: body.style.top,\n left: body.style.left,\n right: body.style.right,\n overflow: body.style.overflow,\n };\n body.style.position = \"fixed\";\n body.style.top = `-${scrollY}px`;\n body.style.left = \"0\";\n body.style.right = \"0\";\n body.style.overflow = \"hidden\";\n\n const onKey = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n onOpenChange(false);\n }\n };\n window.addEventListener(\"keydown\", onKey);\n\n return () => {\n window.removeEventListener(\"keydown\", onKey);\n body.style.position = prev.position;\n body.style.top = prev.top;\n body.style.left = prev.left;\n body.style.right = prev.right;\n body.style.overflow = prev.overflow;\n window.scrollTo(0, scrollY);\n };\n }, [open, onOpenChange]);\n\n const onDragEnd = (_: unknown, info: PanInfo) => {\n const velocity = info.velocity.y;\n const offset = info.offset.y;\n\n // Strong downward fling or large drag → dismiss.\n if (velocity > 600 || offset > dismissThreshold) {\n const smaller = snapPoints.map((_, i) => i).filter((i) => i < snap);\n if (smaller.length && velocity < 800 && offset < dismissThreshold * 1.6) {\n setSnap(smaller[smaller.length - 1]);\n } else {\n onOpenChange(false);\n }\n return;\n }\n\n // Strong upward fling → next snap.\n if (velocity < -500) {\n setSnap((current) => Math.min(snapPoints.length - 1, current + 1));\n return;\n }\n\n // Otherwise snap to nearest by current offset.\n setSnap((current) => {\n if (offset > 80 && current > 0) return current - 1;\n if (offset < -80 && current < snapPoints.length - 1) return current + 1;\n return current;\n });\n };\n\n const snapValue = snapPoints[snap];\n const heightStyle =\n snapValue === \"auto\" ? { maxHeight: \"92vh\" } : { height: `${snapValue * 100}vh` };\n\n // Portal to <body>: an ancestor with backdrop-filter or transform becomes\n // the containing block for fixed descendants, which would position the\n // sheet against that ancestor instead of the viewport.\n if (!mounted) return null;\n\n // Two fixed siblings, no wrapper: the scrim spans the viewport edges but\n // carries a colour, and the sheet is pinned to the bottom, stops short of the\n // top edge at every snap point the component ships, and paints an opaque\n // surface either way. Both hang off `PresenceGate`, so interaction releases in\n // the same commit that starts the exit rather than when it ends. See\n return createPortal(\n <AnimatePresence>\n {open ? (\n <PresenceGate key=\"backdrop\">\n {({ gate }) => (\n <motion.button\n type=\"button\"\n aria-label=\"Close bottom sheet\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={DRAWER}\n {...gate}\n onClick={() => onOpenChange(false)}\n // A dim scrim with a light blur. backdrop-blur is GPU-expensive and\n // re-rasterizes every frame the sheet drags over it; a small radius\n // plus more opacity keeps the glass look without the jank.\n className=\"pointer-events-auto fixed inset-0 z-50 bg-background/40 backdrop-blur-sm\"\n />\n )}\n </PresenceGate>\n ) : null}\n {open ? (\n <PresenceGate key=\"sheet\">\n {({ gate }) => (\n <motion.div\n ref={sheetRef}\n drag=\"y\"\n dragControls={dragControls}\n dragListener={false}\n dragConstraints={{ top: 0, bottom: 0 }}\n dragElastic={{ top: 0.02, bottom: 0.4 }}\n dragMomentum={false}\n onDragEnd={onDragEnd}\n initial={reduce ? { y: 0, opacity: 0 } : { y: \"100%\" }}\n animate={reduce ? { y: 0, opacity: 1 } : { y: 0 }}\n exit={reduce ? { y: 0, opacity: 0 } : { y: \"100%\" }}\n transition={reduce ? { duration: 0.18, ease: EASE_DRAWER } : DRAWER}\n onAnimationComplete={() => {\n if (sheetRef.current) heightRef.current = sheetRef.current.offsetHeight;\n }}\n {...gate}\n style={{ ...heightStyle, ...gate.style }}\n className={cn(\n \"pointer-events-auto fixed right-0 bottom-0 left-0 z-50 mx-auto flex max-w-2xl flex-col overflow-hidden rounded-t-3xl will-change-transform\",\n \"border border-border bg-background shadow-xl\",\n className,\n )}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title ? titleId : undefined}\n aria-describedby={description ? descriptionId : undefined}\n aria-label={title ? undefined : \"Bottom sheet\"}\n >\n <div className=\"flex flex-col items-center px-4 pt-3 pb-2\">\n {/* Drag only the pill so the title and description stay selectable. */}\n <div\n onPointerDown={(event) => dragControls.start(event)}\n // A slow pull must not hand the gesture to iOS's callout,\n // which would leave the sheet frozen mid-drag.\n className={cn(\n \"flex cursor-grab touch-none items-center justify-center py-1 active:cursor-grabbing\",\n TOUCH_GESTURE_CONTENT_CLASS,\n )}\n >\n <div className=\"h-1.5 w-10 rounded-full bg-muted-foreground/40\" />\n </div>\n {title || description ? (\n <div className=\"mt-2 w-full\">\n {title ? (\n <h2 id={titleId} className=\"font-semibold text-base text-foreground\">\n {title}\n </h2>\n ) : null}\n {description ? (\n <p id={descriptionId} className=\"mt-0.5 text-muted-foreground text-sm\">\n {description}\n </p>\n ) : null}\n </div>\n ) : null}\n </div>\n {/* overscroll-contain stops boundary scrolls from chaining to the page. */}\n <div className=\"flex-1 overflow-y-auto overscroll-contain px-4 pb-6\">{children}</div>\n </motion.div>\n )}\n </PresenceGate>\n ) : null}\n </AnimatePresence>,\n document.body,\n );\n}\n"],"mappings":";;;;;;;;;;AAoBA,MAAM,SAAS;CAAE,UAAU;CAAK,MAAM;AAAY;AAgBlD,SAAgB,YAAY,EAC1B,MACA,cACA,aAAa,CAAC,IAAK,GAAI,GACvB,cAAc,GACd,OACA,aACA,UACA,WACA,mBAAmB,OACA;CACnB,MAAM,CAAC,MAAM,WAAW,SAAS,WAAW;CAC5C,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAC5C,MAAM,eAAe,gBAAgB;CACrC,MAAM,WAAW,OAAuB,IAAI;CAC5C,MAAM,SAAS,iBAAiB;CAChC,MAAM,YAAY,OAAO,CAAC;CAC1B,MAAM,MAAM,MAAM;CAClB,MAAM,UAAU,GAAG,IAAI;CACvB,MAAM,gBAAgB,GAAG,IAAI;CAE7B,gBAAgB;EACd,WAAW,IAAI;CACjB,GAAG,CAAC,CAAC;CAEL,gBAAgB;EACd,IAAI,MAAM,QAAQ,WAAW;CAC/B,GAAG,CAAC,MAAM,WAAW,CAAC;CAMtB,gBAAgB;EACd,IAAI,CAAC,MAAM;EACX,MAAM,OAAO,SAAS;EACtB,MAAM,UAAU,OAAO;EACvB,MAAM,OAAO;GACX,UAAU,KAAK,MAAM;GACrB,KAAK,KAAK,MAAM;GAChB,MAAM,KAAK,MAAM;GACjB,OAAO,KAAK,MAAM;GAClB,UAAU,KAAK,MAAM;EACvB;EACA,KAAK,MAAM,WAAW;EACtB,KAAK,MAAM,MAAM,IAAI,QAAQ;EAC7B,KAAK,MAAM,OAAO;EAClB,KAAK,MAAM,QAAQ;EACnB,KAAK,MAAM,WAAW;EAEtB,MAAM,SAAS,UAAyB;GACtC,IAAI,MAAM,QAAQ,UAAU;IAC1B,MAAM,eAAe;IACrB,aAAa,KAAK;GACpB;EACF;EACA,OAAO,iBAAiB,WAAW,KAAK;EAExC,aAAa;GACX,OAAO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7B,UAAA;IACA,CAAA,IACD,IACD;GACH,CAAA,IAAA,IACD;EAEL,CAAA,GAAA,oBAAC,OAAD;GAAK,WAAU;GAAuD;EAAc,CAAA,CAC1E;CAEF,CAAA,EAAA,GA/DI,OA+DJ,IACZ,IACW,EAAA,CAAA,GACjB,SAAS,IACX;AACF"}
1
+ {"version":3,"file":"bottom-sheet.js","names":[],"sources":["../../../src/components/motion/bottom-sheet.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useEffect, useId, useRef, useState } from \"react\";\nimport {\n AnimatePresence,\n motion,\n type PanInfo,\n useDragControls,\n useReducedMotion,\n} from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_DRAWER } from \"../../lib/ease\";\nimport { PresenceGate } from \"../../lib/presence-gate\";\nimport { TOUCH_GESTURE_CONTENT_CLASS } from \"../../lib/touch\";\n\n// Vaul-style glide: a long, fully-damped tween reads smoother than a spring on\n// open — no settle/overshoot, just one clean decel. Same curve drives the\n// backdrop fade so the surface and scrim move as one.\nconst DRAWER = { duration: 0.5, ease: EASE_DRAWER } as const;\n\nexport interface BottomSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** Heights (0-1 = fraction of viewport, or \"auto\"). First entry is default. */\n snapPoints?: (number | \"auto\")[];\n defaultSnap?: number;\n title?: string;\n description?: string;\n children?: ReactNode;\n className?: string;\n /** Min drag distance (px) past current snap to dismiss. */\n dismissThreshold?: number;\n}\n\nexport function BottomSheet({\n open,\n onOpenChange,\n snapPoints = [0.5, 0.92],\n defaultSnap = 0,\n title,\n description,\n children,\n className,\n dismissThreshold = 120,\n}: BottomSheetProps) {\n const [snap, setSnap] = useState(defaultSnap);\n const [mounted, setMounted] = useState(false);\n const dragControls = useDragControls();\n const sheetRef = useRef<HTMLDivElement>(null);\n const reduce = useReducedMotion();\n const heightRef = useRef(0);\n const uid = useId();\n const titleId = `${uid}-title`;\n const descriptionId = `${uid}-description`;\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n useEffect(() => {\n if (open) setSnap(defaultSnap);\n }, [open, defaultSnap]);\n\n // Lock background scroll while open. overflow:hidden alone is ignored by\n // iOS Safari — boundary scrolls inside the sheet chain to the page, which\n // scrolls underneath and ends up somewhere else on close. position:fixed\n // is the lock that actually holds; restore the scroll position after.\n useEffect(() => {\n if (!open) return;\n const body = document.body;\n const scrollY = window.scrollY;\n const prev = {\n position: body.style.position,\n top: body.style.top,\n left: body.style.left,\n right: body.style.right,\n overflow: body.style.overflow,\n };\n body.style.position = \"fixed\";\n body.style.top = `-${scrollY}px`;\n body.style.left = \"0\";\n body.style.right = \"0\";\n body.style.overflow = \"hidden\";\n\n const onKey = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n onOpenChange(false);\n }\n };\n window.addEventListener(\"keydown\", onKey);\n\n return () => {\n window.removeEventListener(\"keydown\", onKey);\n body.style.position = prev.position;\n body.style.top = prev.top;\n body.style.left = prev.left;\n body.style.right = prev.right;\n body.style.overflow = prev.overflow;\n window.scrollTo(0, scrollY);\n };\n }, [open, onOpenChange]);\n\n const onDragEnd = (_: unknown, info: PanInfo) => {\n const velocity = info.velocity.y;\n const offset = info.offset.y;\n\n // Strong downward fling or large drag → dismiss.\n if (velocity > 600 || offset > dismissThreshold) {\n const smaller = snapPoints.map((_, i) => i).filter((i) => i < snap);\n if (smaller.length && velocity < 800 && offset < dismissThreshold * 1.6) {\n setSnap(smaller[smaller.length - 1]);\n } else {\n onOpenChange(false);\n }\n return;\n }\n\n // Strong upward fling → next snap.\n if (velocity < -500) {\n setSnap((current) => Math.min(snapPoints.length - 1, current + 1));\n return;\n }\n\n // Otherwise snap to nearest by current offset.\n setSnap((current) => {\n if (offset > 80 && current > 0) return current - 1;\n if (offset < -80 && current < snapPoints.length - 1) return current + 1;\n return current;\n });\n };\n\n const snapValue = snapPoints[snap];\n const heightStyle =\n snapValue === \"auto\" ? { maxHeight: \"92vh\" } : { height: `${snapValue * 100}vh` };\n\n // Portal to <body>: an ancestor with backdrop-filter or transform becomes\n // the containing block for fixed descendants, which would position the\n // sheet against that ancestor instead of the viewport.\n if (!mounted) return null;\n\n // Two fixed siblings, no wrapper: the scrim spans the viewport edges but\n // carries a colour, and the sheet is pinned to the bottom, stops short of the\n // top edge at every snap point the component ships, and paints an opaque\n // surface either way. Both hang off `PresenceGate`, so interaction releases in\n // the same commit that starts the exit rather than when it ends. See\n return createPortal(\n <AnimatePresence>\n {open ? (\n <PresenceGate key=\"backdrop\">\n {({ gate }) => (\n <motion.button\n type=\"button\"\n aria-label=\"Close bottom sheet\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={DRAWER}\n {...gate}\n onClick={() => onOpenChange(false)}\n // A dim scrim with a light blur. backdrop-blur is GPU-expensive and\n // re-rasterizes every frame the sheet drags over it; a small radius\n // plus more opacity keeps the glass look without the jank.\n className=\"pointer-events-auto fixed inset-0 z-50 bg-background/40 backdrop-blur-sm\"\n />\n )}\n </PresenceGate>\n ) : null}\n {open ? (\n <PresenceGate key=\"sheet\">\n {({ gate }) => (\n <motion.div\n ref={sheetRef}\n drag=\"y\"\n dragControls={dragControls}\n dragListener={false}\n dragConstraints={{ top: 0, bottom: 0 }}\n dragElastic={{ top: 0.02, bottom: 0.4 }}\n dragMomentum={false}\n onDragEnd={onDragEnd}\n initial={reduce ? { y: 0, opacity: 0 } : { y: \"100%\" }}\n animate={reduce ? { y: 0, opacity: 1 } : { y: 0 }}\n exit={reduce ? { y: 0, opacity: 0 } : { y: \"100%\" }}\n transition={reduce ? { duration: 0.18, ease: EASE_DRAWER } : DRAWER}\n onAnimationComplete={() => {\n if (sheetRef.current) heightRef.current = sheetRef.current.offsetHeight;\n }}\n {...gate}\n style={{ ...heightStyle, ...gate.style }}\n className={cn(\n \"pointer-events-auto fixed right-0 bottom-0 left-0 z-50 mx-auto flex max-w-2xl flex-col overflow-hidden rounded-t-3xl will-change-transform\",\n \"border border-border bg-background shadow-xl\",\n className,\n )}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title ? titleId : undefined}\n aria-describedby={description ? descriptionId : undefined}\n aria-label={title ? undefined : \"Bottom sheet\"}\n >\n <div className=\"flex flex-col items-center px-4 pt-3 pb-2\">\n {/* Drag only the pill so the title and description stay selectable. */}\n <div\n onPointerDown={(event) => dragControls.start(event)}\n // A slow pull must not hand the gesture to iOS's callout,\n // which would leave the sheet frozen mid-drag.\n className={cn(\n \"flex cursor-grab touch-none items-center justify-center py-1 active:cursor-grabbing\",\n TOUCH_GESTURE_CONTENT_CLASS,\n )}\n >\n <div className=\"h-1.5 w-10 rounded-full bg-muted-foreground/40\" />\n </div>\n {title || description ? (\n <div className=\"mt-2 w-full\">\n {title ? (\n <h2 id={titleId} className=\"font-semibold text-base text-foreground\">\n {title}\n </h2>\n ) : null}\n {description ? (\n <p id={descriptionId} className=\"mt-0.5 text-muted-foreground text-sm\">\n {description}\n </p>\n ) : null}\n </div>\n ) : null}\n </div>\n {/* overscroll-contain stops boundary scrolls from chaining to the page. */}\n <div className=\"flex-1 overflow-y-auto overscroll-contain px-4 pb-6\">{children}</div>\n </motion.div>\n )}\n </PresenceGate>\n ) : null}\n </AnimatePresence>,\n document.body,\n );\n}\n"],"mappings":";;;;;;;;;;AAoBA,MAAM,SAAS;CAAE,UAAU;CAAK,MAAM;AAAY;AAgBlD,SAAgB,YAAY,EAC1B,MACA,cACA,aAAa,CAAC,IAAK,GAAI,GACvB,cAAc,GACd,OACA,aACA,UACA,WACA,mBAAmB,OACA;CACnB,MAAM,CAAC,MAAM,WAAW,SAAS,WAAW;CAC5C,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAC5C,MAAM,eAAe,gBAAgB;CACrC,MAAM,WAAW,OAAuB,IAAI;CAC5C,MAAM,SAAS,iBAAiB;CAChC,MAAM,YAAY,OAAO,CAAC;CAC1B,MAAM,MAAM,MAAM;CAClB,MAAM,UAAU,G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AAU;GAAM,MAAM;EAAY,IAAI;EAC7D,2BAA2B;GACzB,IAAI,SAAS,SAAS,UAAU,UAAU,SAAS,QAAQ;EAC7D;EACA,GAAI;EACJ,OAAO;GAAE,GAAG;GAAa,GAAG,KAAK;EAAM;EACvC,WAAW,GACT,8IACA,gDACA,SACF;EACA,MAAK;EACL,cAAW;EACX,mBAAiB,QAAQ,UAAU,KAAA;EACnC,oBAAkB,cAAc,gBAAgB,KAAA;EAChD,cAAY,QAAQ,KAAA,IAAY;EA3BlC,UAAA,CA6BE,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CAEE,oBAAC,OAAD;IACE,gBAAgB,UAAU,aAAa,MAAM,KAAK;IAGlD,WAAW,GACT,uFACA,2BACF;IAEA,UAAA,oBAAC,OAAD,EAAK,WAAU,iDAAkD,CAAA;GAC9D,CAAA,GACJ,SAAS,cACR,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACG,QACC,oBAAC,MAAD;KAAI,IAAI;KAAS,WAAU;KACxB,UAAA;IACC,CAAA,IACF,MACH,cACC,oBAAC,KAAD;KAAG,IAAI;KAAe,WAAU;KAC7B,UAAA;IACA,CAAA,IACD,IACD;GACH,CAAA,IAAA,IACD;EAEL,CAAA,GAAA,oBAAC,OAAD;GAAK,WAAU;GAAuD;EAAc,CAAA,CAC1E;CAEF,CAAA,EAAA,GA/DI,OA+DJ,IACZ,IACW,EAAA,CAAA,GACjB,SAAS,IACX;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"bounce-sidebar.d.ts","names":[],"sources":["../../../src/components/motion/bounce-sidebar.tsx"],"mappings":";;iBAMiB;EACf;EACA,OAAO;EACP;EACA,OAAO;EACP;EACA;EACA;;iBAGe;EACf,OAAO;EACP;EACA;EACA,iBAAiB;EACjB;EACA;EACA;EACA;EACA;;wBAqBc,gBACd,OACA,OACA,cACA,eACA,WACA,WACA,eACA,eACA,sBACC,qCAAkB,IAAA"}
1
+ {"version":3,"file":"bounce-sidebar.d.ts","names":[],"sources":["../../../src/components/motion/bounce-sidebar.tsx"],"mappings":";;iBAOiB;EACf;EACA,OAAO;EACP;EACA,OAAO;EACP;EACA;EACA;;iBAGe;EACf,OAAO;EACP;EACA;EACA,iBAAiB;EACjB;EACA;EACA;EACA;EACA;;wBAqBc,gBACd,OACA,OACA,cACA,eACA,WACA,WACA,eACA,eACA,sBACC,qCAAkB,IAAA"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { useCallback, useLayoutEffect, useRef, useState } from "react";
3
- import { cn } from "cn";
3
+ import { cn } from "@kumix/utils";
4
4
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
5
5
  import { animate, motion, useMotionValue, useReducedMotion } from "motion/react";
6
6
  //#region src/components/motion/bounce-sidebar.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"bounce-sidebar.js","names":[],"sources":["../../../src/components/motion/bounce-sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useCallback, useLayoutEffect, useRef, useState } from \"react\";\nimport { cn } from \"cn\";\nimport { animate, motion, useMotionValue, useReducedMotion } from \"motion/react\";\n\nexport interface BounceSidebarItem {\n id: string;\n label: ReactNode;\n href?: string;\n icon?: ReactNode;\n disabled?: boolean;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n rel?: string;\n}\n\nexport interface BounceSidebarProps {\n items: BounceSidebarItem[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n ariaLabel?: string;\n className?: string;\n listClassName?: string;\n itemClassName?: string;\n indicatorClassName?: string;\n}\n\nconst DOT_SIZE = 6;\n\n// A compact, lightly underdamped spring gives the dot a quick landing without\n// turning the sidebar into a playful toy. The sideways arc carries the bounce.\nconst BOUNCE_SPRING = {\n type: \"spring\",\n stiffness: 280,\n damping: 18,\n mass: 0.3,\n} as const;\n\nfunction quadraticBezier(start: number, control: number, end: number, progress: number) {\n const remaining = 1 - progress;\n return (\n remaining * remaining * start + 2 * remaining * progress * control + progress * progress * end\n );\n}\n\nexport function BounceSidebar({\n items,\n value,\n defaultValue,\n onValueChange,\n ariaLabel = \"Sidebar navigation\",\n className,\n listClassName,\n itemClassName,\n indicatorClassName,\n}: BounceSidebarProps) {\n const reduce = useReducedMotion();\n const [internalValue, setInternalValue] = useState(defaultValue ?? items[0]?.id ?? \"\");\n const requestedValue = value ?? internalValue;\n const selectedValue = items.some((item) => item.id === requestedValue)\n ? requestedValue\n : (items[0]?.id ?? \"\");\n const selectedIndex = items.findIndex((item) => item.id === selectedValue);\n const listRef = useRef<HTMLUListElement>(null);\n const itemRefs = useRef(new Map<string, HTMLLIElement>());\n const selectedValueRef = useRef(selectedValue);\n const previousIndexRef = useRef(selectedIndex);\n const hasPositionRef = useRef(false);\n const animationRef = useRef<ReturnType<typeof animate> | null>(null);\n const x = useMotionValue(0);\n const y = useMotionValue(0);\n selectedValueRef.current = selectedValue;\n\n const snapIndicator = useCallback(() => {\n const selectedItem = itemRefs.current.get(selectedValueRef.current);\n if (!selectedItem) return;\n\n animationRef.current?.stop();\n x.set(0);\n y.set(selectedItem.offsetTop + (selectedItem.offsetHeight - DOT_SIZE) / 2);\n hasPositionRef.current = true;\n }, [x, y]);\n\n const positionIndicator = useCallback(\n (shouldAnimate: boolean) => {\n const selectedItem = itemRefs.current.get(selectedValue);\n if (!selectedItem) return;\n\n const destinationY = selectedItem.offsetTop + (selectedItem.offsetHeight - DOT_SIZE) / 2;\n\n animationRef.current?.stop();\n\n if (!hasPositionRef.current || reduce || !shouldAnimate) {\n x.set(0);\n y.set(destinationY);\n hasPositionRef.current = true;\n previousIndexRef.current = selectedIndex;\n return;\n }\n\n const startY = y.get();\n const distance = destinationY - startY;\n const travel = Math.abs(distance);\n const longJumpProgress = Math.min(1, Math.max(0, (travel - 48) / 120));\n const controlX = -Math.min(40, Math.max(8, travel * 0.25));\n const midpointY = (startY + destinationY) / 2;\n const controlY = destinationY + (midpointY - destinationY) * longJumpProgress;\n\n animationRef.current = animate(0, 1, {\n ...BOUNCE_SPRING,\n stiffness: BOUNCE_SPRING.stiffness - 60 * longJumpProgress,\n damping: BOUNCE_SPRING.damping + longJumpProgress,\n mass: BOUNCE_SPRING.mass + 0.15 * longJumpProgress,\n onUpdate: (progress) => {\n x.set(quadraticBezier(0, controlX, 0, progress));\n y.set(quadraticBezier(startY, controlY, destinationY, progress));\n },\n onComplete: () => {\n x.set(0);\n y.set(destinationY);\n },\n });\n\n previousIndexRef.current = selectedIndex;\n },\n [reduce, selectedIndex, selectedValue, x, y],\n );\n\n useLayoutEffect(() => {\n const shouldAnimate = hasPositionRef.current && previousIndexRef.current !== selectedIndex;\n positionIndicator(shouldAnimate);\n }, [positionIndicator, selectedIndex]);\n\n useLayoutEffect(() => {\n const list = listRef.current;\n if (!list || typeof ResizeObserver === \"undefined\") return;\n\n const observer = new ResizeObserver(snapIndicator);\n observer.observe(list);\n return () => observer.disconnect();\n }, [snapIndicator]);\n\n useLayoutEffect(\n () => () => {\n animationRef.current?.stop();\n },\n [],\n );\n\n const selectItem = (id: string) => {\n if (value === undefined) setInternalValue(id);\n onValueChange?.(id);\n };\n\n return (\n <nav aria-label={ariaLabel} className={cn(\"relative\", className)}>\n <ul\n ref={listRef}\n className={cn(\"relative flex list-none flex-col gap-1.5 pl-6\", listClassName)}\n >\n {selectedIndex >= 0 ? (\n <li\n aria-hidden=\"true\"\n role=\"presentation\"\n className=\"pointer-events-none absolute inset-0\"\n >\n <motion.span\n style={{ x, y }}\n className={cn(\n \"absolute top-0 left-3 h-1.5 w-1.5 rounded-full bg-primary\",\n indicatorClassName,\n )}\n />\n </li>\n ) : null}\n\n {items.map((item) => {\n const active = item.id === selectedValue;\n const content = (\n <>\n {item.icon ? (\n <span aria-hidden=\"true\" className=\"shrink-0\">\n {item.icon}\n </span>\n ) : null}\n <span>{item.label}</span>\n </>\n );\n const interactiveClasses = cn(\n \"flex min-h-9 w-full items-center gap-2 rounded-lg px-2 text-left font-medium text-sm outline-none transition-colors\",\n \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n active ? \"text-foreground\" : \"text-muted-foreground hover:text-foreground\",\n item.disabled ? \"cursor-not-allowed opacity-40\" : undefined,\n itemClassName,\n );\n\n return (\n <li\n key={item.id}\n ref={(node) => {\n if (node) itemRefs.current.set(item.id, node);\n else itemRefs.current.delete(item.id);\n }}\n className=\"relative\"\n >\n {item.href ? (\n <a\n href={item.href}\n target={item.target}\n rel={item.rel ?? (item.target === \"_blank\" ? \"noreferrer noopener\" : undefined)}\n aria-current={active ? \"page\" : undefined}\n aria-disabled={item.disabled || undefined}\n data-active={active || undefined}\n tabIndex={item.disabled ? -1 : undefined}\n onClick={(event) => {\n if (item.disabled) {\n event.preventDefault();\n return;\n }\n selectItem(item.id);\n }}\n className={interactiveClasses}\n >\n {content}\n </a>\n ) : (\n <button\n type=\"button\"\n disabled={item.disabled}\n aria-current={active ? \"page\" : undefined}\n data-active={active || undefined}\n onClick={() => selectItem(item.id)}\n className={interactiveClasses}\n >\n {content}\n </button>\n )}\n </li>\n );\n })}\n </ul>\n </nav>\n );\n}\n"],"mappings":";;;;;;AA4BA,MAAM,WAAW;AAIjB,MAAM,gBAAgB;CACpB,MAAM;CACN,WAAW;CACX,SAAS;CACT,MAAM;AACR;AAEA,SAAS,gBAAgB,OAAe,SAAiB,KAAa,UAAkB;CACtF,MAAM,YAAY,IAAI;CACtB,OACE,YAAY,YAAY,QAAQ,IAAI,YAAY,WAAW,UAAU,WAAW,WAAW;AAE/F;AAEA,SAAgB,cAAc,EAC5B,OACA,OACA,cACA,eACA,YAAY,sBACZ,WACA,eACA,eACA,sBACqB;CACrB,MAAM,SAAS,iBAAiB;CAChC,MAAM,CAAC,eAAe,oBAAoB,SAAS,gBAAgB,MAAM,EAAE,EAAE,MAAM,EAAE;CACrF,MAAM,iBAAiB,SAAS;CAChC,MAAM,gBAAgB,MAAM,MAAM,SAAS,KAAK,OAAO,cAAc,IACjE,iBACC,MAAM,EA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;IACD,CAAA;GACC,CAAA,IACF,MAEH,MAAM,KAAK,SAAS;IACnB,MAAM,SAAS,KAAK,OAAO;IAC3B,MAAM,UACJ,qBAAA,YAAA,EAAA,UAAA,CACG,KAAK,OACJ,oBAAC,QAAD;KAAM,eAAY;KAAO,WAAU;KAChC,UAAA,KAAK;IACF,CAAA,IACJ,MACJ,oBAAC,QAAD,EAAA,UAAO,KAAK,MAAY,CAAA,CACxB,EAAA,CAAA;IAEJ,MAAM,qBAAqB,GACzB,uHACA,iHACA,SAAS,oBAAoB,+CAC7B,KAAK,WAAW,kCAAkC,KAAA,GAClD,aACF;IAEA,OACE,oBAAC,MAAD;KAEE,MAAM,SAAS;MACb,IAAI,MAAM,SAAS,QAAQ,IAAI,KAAK,IAAI,IAAI;WACvC,SAAS,QAAQ,OAAO,KAAK,EAAE;KACtC;KACA,WAAU;KAET,UAAA,KAAK,OACJ,oBAAC,KAAD;MACE,MAAM,KAAK;MACX,QAAQ,KAAK;MACb,KAAK,KAAK,QAAQ,KAAK,WAAW,WAAW,wBAAwB,KAAA;MACrE,gBAAc,SAAS,SAAS,KAAA;MAChC,iBAAe,KAAK,YAAY,KAAA;MAChC,eAAa,UAAU,KAAA;MACvB,UAAU,KAAK,WAAW,KAAK,KAAA;MAC/B,UAAU,UAAU;OAClB,IAAI,KAAK,UAAU;QACjB,MAAM,eAAe;QACrB;OACF;OACA,WAAW,KAAK,EAAE;MACpB;MACA,WAAW;MAEV,UAAA;KACA,CAAA,IAEH,oBAAC,UAAD;MACE,MAAK;MACL,UAAU,KAAK;MACf,gBAAc,SAAS,SAAS,KAAA;MAChC,eAAa,UAAU,KAAA;MACvB,eAAe,WAAW,KAAK,EAAE;MACjC,WAAW;MAEV,UAAA;KACK,CAAA;IAER,GAvCG,KAAK,EAuCR;GAER,CAAC,CACC;;CACD,CAAA;AAET"}
1
+ {"version":3,"file":"bounce-sidebar.js","names":[],"sources":["../../../src/components/motion/bounce-sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useCallback, useLayoutEffect, useRef, useState } from \"react\";\nimport { animate, motion, useMotionValue, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\n\nexport interface BounceSidebarItem {\n id: string;\n label: ReactNode;\n href?: string;\n icon?: ReactNode;\n disabled?: boolean;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n rel?: string;\n}\n\nexport interface BounceSidebarProps {\n items: BounceSidebarItem[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n ariaLabel?: string;\n className?: string;\n listClassName?: string;\n itemClassName?: string;\n indicatorClassName?: string;\n}\n\nconst DOT_SIZE = 6;\n\n// A compact, lightly underdamped spring gives the dot a quick landing without\n// turning the sidebar into a playful toy. The sideways arc carries the bounce.\nconst BOUNCE_SPRING = {\n type: \"spring\",\n stiffness: 280,\n damping: 18,\n mass: 0.3,\n} as const;\n\nfunction quadraticBezier(start: number, control: number, end: number, progress: number) {\n const remaining = 1 - progress;\n return (\n remaining * remaining * start + 2 * remaining * progress * control + progress * progress * end\n );\n}\n\nexport function BounceSidebar({\n items,\n value,\n defaultValue,\n onValueChange,\n ariaLabel = \"Sidebar navigation\",\n className,\n listClassName,\n itemClassName,\n indicatorClassName,\n}: BounceSidebarProps) {\n const reduce = useReducedMotion();\n const [internalValue, setInternalValue] = useState(defaultValue ?? items[0]?.id ?? \"\");\n const requestedValue = value ?? internalValue;\n const selectedValue = items.some((item) => item.id === requestedValue)\n ? requestedValue\n : (items[0]?.id ?? \"\");\n const selectedIndex = items.findIndex((item) => item.id === selectedValue);\n const listRef = useRef<HTMLUListElement>(null);\n const itemRefs = useRef(new Map<string, HTMLLIElement>());\n const selectedValueRef = useRef(selectedValue);\n const previousIndexRef = useRef(selectedIndex);\n const hasPositionRef = useRef(false);\n const animationRef = useRef<ReturnType<typeof animate> | null>(null);\n const x = useMotionValue(0);\n const y = useMotionValue(0);\n selectedValueRef.current = selectedValue;\n\n const snapIndicator = useCallback(() => {\n const selectedItem = itemRefs.current.get(selectedValueRef.current);\n if (!selectedItem) return;\n\n animationRef.current?.stop();\n x.set(0);\n y.set(selectedItem.offsetTop + (selectedItem.offsetHeight - DOT_SIZE) / 2);\n hasPositionRef.current = true;\n }, [x, y]);\n\n const positionIndicator = useCallback(\n (shouldAnimate: boolean) => {\n const selectedItem = itemRefs.current.get(selectedValue);\n if (!selectedItem) return;\n\n const destinationY = selectedItem.offsetTop + (selectedItem.offsetHeight - DOT_SIZE) / 2;\n\n animationRef.current?.stop();\n\n if (!hasPositionRef.current || reduce || !shouldAnimate) {\n x.set(0);\n y.set(destinationY);\n hasPositionRef.current = true;\n previousIndexRef.current = selectedIndex;\n return;\n }\n\n const startY = y.get();\n const distance = destinationY - startY;\n const travel = Math.abs(distance);\n const longJumpProgress = Math.min(1, Math.max(0, (travel - 48) / 120));\n const controlX = -Math.min(40, Math.max(8, travel * 0.25));\n const midpointY = (startY + destinationY) / 2;\n const controlY = destinationY + (midpointY - destinationY) * longJumpProgress;\n\n animationRef.current = animate(0, 1, {\n ...BOUNCE_SPRING,\n stiffness: BOUNCE_SPRING.stiffness - 60 * longJumpProgress,\n damping: BOUNCE_SPRING.damping + longJumpProgress,\n mass: BOUNCE_SPRING.mass + 0.15 * longJumpProgress,\n onUpdate: (progress) => {\n x.set(quadraticBezier(0, controlX, 0, progress));\n y.set(quadraticBezier(startY, controlY, destinationY, progress));\n },\n onComplete: () => {\n x.set(0);\n y.set(destinationY);\n },\n });\n\n previousIndexRef.current = selectedIndex;\n },\n [reduce, selectedIndex, selectedValue, x, y],\n );\n\n useLayoutEffect(() => {\n const shouldAnimate = hasPositionRef.current && previousIndexRef.current !== selectedIndex;\n positionIndicator(shouldAnimate);\n }, [positionIndicator, selectedIndex]);\n\n useLayoutEffect(() => {\n const list = listRef.current;\n if (!list || typeof ResizeObserver === \"undefined\") return;\n\n const observer = new ResizeObserver(snapIndicator);\n observer.observe(list);\n return () => observer.disconnect();\n }, [snapIndicator]);\n\n useLayoutEffect(\n () => () => {\n animationRef.current?.stop();\n },\n [],\n );\n\n const selectItem = (id: string) => {\n if (value === undefined) setInternalValue(id);\n onValueChange?.(id);\n };\n\n return (\n <nav aria-label={ariaLabel} className={cn(\"relative\", className)}>\n <ul\n ref={listRef}\n className={cn(\"relative flex list-none flex-col gap-1.5 pl-6\", listClassName)}\n >\n {selectedIndex >= 0 ? (\n <li\n aria-hidden=\"true\"\n role=\"presentation\"\n className=\"pointer-events-none absolute inset-0\"\n >\n <motion.span\n style={{ x, y }}\n className={cn(\n \"absolute top-0 left-3 h-1.5 w-1.5 rounded-full bg-primary\",\n indicatorClassName,\n )}\n />\n </li>\n ) : null}\n\n {items.map((item) => {\n const active = item.id === selectedValue;\n const content = (\n <>\n {item.icon ? (\n <span aria-hidden=\"true\" className=\"shrink-0\">\n {item.icon}\n </span>\n ) : null}\n <span>{item.label}</span>\n </>\n );\n const interactiveClasses = cn(\n \"flex min-h-9 w-full items-center gap-2 rounded-lg px-2 text-left font-medium text-sm outline-none transition-colors\",\n \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n active ? \"text-foreground\" : \"text-muted-foreground hover:text-foreground\",\n item.disabled ? \"cursor-not-allowed opacity-40\" : undefined,\n itemClassName,\n );\n\n return (\n <li\n key={item.id}\n ref={(node) => {\n if (node) itemRefs.current.set(item.id, node);\n else itemRefs.current.delete(item.id);\n }}\n className=\"relative\"\n >\n {item.href ? (\n <a\n href={item.href}\n target={item.target}\n rel={item.rel ?? (item.target === \"_blank\" ? \"noreferrer noopener\" : undefined)}\n aria-current={active ? \"page\" : undefined}\n aria-disabled={item.disabled || undefined}\n data-active={active || undefined}\n tabIndex={item.disabled ? -1 : undefined}\n onClick={(event) => {\n if (item.disabled) {\n event.preventDefault();\n return;\n }\n selectItem(item.id);\n }}\n className={interactiveClasses}\n >\n {content}\n </a>\n ) : (\n <button\n type=\"button\"\n disabled={item.disabled}\n aria-current={active ? \"page\" : undefined}\n data-active={active || undefined}\n onClick={() => selectItem(item.id)}\n className={interactiveClasses}\n >\n {content}\n </button>\n )}\n </li>\n );\n })}\n </ul>\n </nav>\n );\n}\n"],"mappings":";;;;;;AA6BA,MAAM,WAAW;AAIjB,MAAM,gBAAgB;CACpB,MAAM;CACN,WAAW;CACX,SAAS;CACT,MAAM;AACR;AAEA,SAAS,gBAAgB,OAAe,SAAiB,KAAa,UAAkB;CACtF,MAAM,YAAY,IAAI;CACtB,OACE,YAAY,YAAY,QAAQ,IAAI,YAAY,WAAW,UAAU,WAAW,WAAW;AAE/F;AAEA,SAAgB,cAAc,EAC5B,OACA,OACA,cACA,eACA,YAAY,sBACZ,WACA,eACA,eACA,sBACqB;CACrB,MAAM,SAAS,iBAAiB;CAChC,MAAM,CAAC,eAAe,oBAAoB,SAAS,gBAAgB,MAAM,EAAE,EAAE,MAAM,EAAE;CACrF,MAAM,iBAAiB,SAAS;CAChC,MAAM,gBAAgB,MAAM,MAAM,SAAS,KAAK,OAAO,cAAc,IACjE,iBACC,MAAM,EAAE,EAAE,MAAM;CACrB,MAAM,gBAAgB,MAAM,WAAW,SAAS,KAAK,OAAO,aAAa;CACzE,MAAM,UAAU,OAAyB,IAAI;CAC7C,MAAM,WAAW,uBAAO,IAAI,IAA2B,CAAC;CACxD,MAAM,mBAAmB,OAAO,aAAa;CAC7C,MAAM,mBAAmB,OAAO,aAAa;CAC7C,MAAM,iBAAiB,OAAO,KAAK;CACnC,MAAM,eAAe,OAA0C,IAAI;CACnE,MAAM,IAAI,eAAe,CAAC;CAC1B,MAAM,IAAI,eAAe,CAAC;CAC1B,iBAAiB,UAAU;CAE3B,MAAM,gBAAgB,kBAAkB;EACtC,MAAM,eAAe,SAAS,QAAQ,IAAI,iBAAiB,OAAO;EAClE,IAAI,CAAC,cAAc;EAEnB,aAAa,SAAS,KAAK;EAC3B,EAAE,IAAI,CAAC;EACP,EAAE,IAAI,aAAa,aAAa,aAAa,eAAe,YAAY,CAAC;EACzE,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,KAAK;MACX,QAAQ,KAAK;MACb,KAAK,KAAK,QAAQ,KAAK,WAAW,WAAW,wBAAwB,KAAA;MACrE,gBAAc,SAAS,SAAS,KAAA;MAChC,iBAAe,KAAK,YAAY,KAAA;MAChC,eAAa,UAAU,KAAA;MACvB,UAAU,KAAK,WAAW,KAAK,KAAA;MAC/B,UAAU,UAAU;OAClB,IAAI,KAAK,UAAU;QACjB,MAAM,eAAe;QACrB;OACF;OACA,WAAW,KAAK,EAAE;MACpB;MACA,WAAW;MAEV,UAAA;KACA,CAAA,IAEH,oBAAC,UAAD;MACE,MAAK;MACL,UAAU,KAAK;MACf,gBAAc,SAAS,SAAS,KAAA;MAChC,eAAa,UAAU,KAAA;MACvB,eAAe,WAAW,KAAK,EAAE;MACjC,WAAW;MAEV,UAAA;KACK,CAAA;IAER,GAvCG,KAAK,EAuCR;GAER,CAAC,CACC;;CACD,CAAA;AAET"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { EASE_OUT } from "../../lib/ease.js";
3
3
  import { useCallback, useId, useLayoutEffect, 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 { ChevronDown } from "lucide-react";
@@ -1 +1 @@
1
- {"version":3,"file":"bouncy-accordion.js","names":[],"sources":["../../../src/components/motion/bouncy-accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useCallback, useId, useLayoutEffect, useRef, useState } from \"react\";\nimport { cn } from \"cn\";\nimport { ChevronDown } from \"lucide-react\";\nimport { motion, type Transition, useReducedMotion } from \"motion/react\";\n\nimport { EASE_OUT } from \"../../lib/ease\";\n\nexport type BouncyAccordionItem = {\n id: string;\n title: ReactNode;\n description?: ReactNode;\n icon?: ReactNode;\n disabled?: boolean;\n};\n\nexport type BouncyAccordionClassNames = {\n root?: string;\n item?: string;\n trigger?: string;\n icon?: string;\n title?: string;\n chevron?: string;\n content?: string;\n description?: string;\n};\n\nexport interface BouncyAccordionProps {\n items: BouncyAccordionItem[];\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (value: string | null) => void;\n collapsible?: boolean;\n className?: string;\n classNames?: BouncyAccordionClassNames;\n}\n\n// Local springs keep the accordion's connected groups moving together while\n// avoiding scale projection on text-heavy row contents.\n// Gap spring: must not overshoot y — positive y overshoot drifts items below\n// their mt-3 resting point and briefly overlaps the next item.\nconst ROW_TRANSITION: Transition = {\n type: \"spring\",\n duration: 0.55,\n bounce: 0.38,\n};\n\nconst CONTENT_OPEN_TRANSITION: Transition = {\n type: \"spring\",\n duration: 0.58,\n bounce: 0.32,\n};\n\nconst CONTENT_CLOSE_TRANSITION: Transition = {\n type: \"spring\",\n duration: 0.46,\n bounce: 0.26,\n};\n\nconst DESCRIPTION_TRANSITION: Transition = {\n duration: 0.18,\n ease: EASE_OUT,\n};\n\nconst CHEVRON_TRANSITION: Transition = {\n type: \"spring\",\n duration: 0.42,\n bounce: 0.28,\n};\n\nfunction useControllableAccordionValue({\n value,\n defaultValue,\n onValueChange,\n}: {\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (value: string | null) => void;\n}) {\n const [internalValue, setInternalValue] = useState(defaultValue ?? null);\n const isControlled = value !== undefined;\n const currentValue = value ?? internalValue;\n\n const setValue = useCallback(\n (next: string | null) => {\n if (!isControlled) {\n setInternalValue(next);\n }\n\n onValueChange?.(next);\n },\n [isControlled, onValueChange],\n );\n\n return [currentValue, setValue] as const;\n}\n\nfunction BouncyAccordionRow({\n item,\n open,\n startsGroup,\n endsGroup,\n separatedFromPrevious,\n contentId,\n triggerId,\n reduce,\n classNames,\n onToggle,\n}: {\n item: BouncyAccordionItem;\n open: boolean;\n startsGroup: boolean;\n endsGroup: boolean;\n separatedFromPrevious: boolean;\n contentId: string;\n triggerId: string;\n reduce: boolean | null;\n classNames?: BouncyAccordionClassNames;\n onToggle: () => void;\n}) {\n const contentRef = useRef<HTMLDivElement>(null);\n const [contentHeight, setContentHeight] = useState(0);\n\n useLayoutEffect(() => {\n const node = contentRef.current;\n if (!node) return;\n\n const updateHeight = () => {\n setContentHeight(node.offsetHeight);\n };\n\n updateHeight();\n\n const observer = new ResizeObserver(updateHeight);\n observer.observe(node);\n\n return () => {\n observer.disconnect();\n };\n }, []);\n\n return (\n <motion.div\n layout=\"position\"\n initial={false}\n style={{ marginTop: separatedFromPrevious ? 12 : 0 }}\n transition={reduce ? { duration: 0 } : ROW_TRANSITION}\n >\n <motion.div\n data-state={open ? \"open\" : \"closed\"}\n initial={false}\n animate={{\n borderTopLeftRadius: startsGroup ? 28 : 0,\n borderTopRightRadius: startsGroup ? 28 : 0,\n borderBottomLeftRadius: endsGroup ? 28 : 0,\n borderBottomRightRadius: endsGroup ? 28 : 0,\n }}\n transition={reduce ? { duration: 0 } : ROW_TRANSITION}\n className={cn(\n \"overflow-hidden bg-card text-card-foreground\",\n item.disabled && \"opacity-50\",\n classNames?.item,\n )}\n >\n <button\n id={triggerId}\n type=\"button\"\n disabled={item.disabled}\n aria-expanded={open}\n aria-controls={contentId}\n onClick={onToggle}\n className={cn(\n \"flex min-h-[54px] w-full items-center gap-4 px-5 text-left outline-none transition-colors\",\n \"focus-visible:bg-muted/25\",\n \"disabled:pointer-events-none\",\n classNames?.trigger,\n )}\n >\n {item.icon ? (\n <span\n className={cn(\n \"grid h-7 w-7 shrink-0 place-items-center text-muted-foreground\",\n classNames?.icon,\n )}\n >\n {item.icon}\n </span>\n ) : null}\n <span\n className={cn(\n \"min-w-0 flex-1 truncate font-medium text-[15px] text-foreground\",\n classNames?.title,\n )}\n >\n {item.title}\n </span>\n <motion.span\n aria-hidden\n animate={{ rotate: open ? 180 : 0 }}\n transition={reduce ? { duration: 0 } : CHEVRON_TRANSITION}\n className={cn(\n \"grid h-6 w-6 shrink-0 place-items-center text-muted-foreground\",\n classNames?.chevron,\n )}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </motion.span>\n </button>\n\n <motion.div\n layout=\"size\"\n id={contentId}\n role=\"region\"\n aria-labelledby={triggerId}\n aria-hidden={!open}\n inert={!open}\n initial={false}\n style={{ height: open && item.description ? contentHeight : 0 }}\n transition={\n reduce ? { duration: 0 } : open ? CONTENT_OPEN_TRANSITION : CONTENT_CLOSE_TRANSITION\n }\n className={cn(\"overflow-hidden\", classNames?.content)}\n >\n <motion.div\n ref={contentRef}\n animate={{\n opacity: open ? 1 : 0,\n }}\n transition={reduce ? { duration: 0 } : DESCRIPTION_TRANSITION}\n className=\"px-5 pb-5\"\n >\n <div\n className={cn(\"text-[15px] text-muted-foreground leading-6\", classNames?.description)}\n >\n {item.description}\n </div>\n </motion.div>\n </motion.div>\n </motion.div>\n </motion.div>\n );\n}\n\nexport function BouncyAccordion({\n items,\n value,\n defaultValue = null,\n onValueChange,\n collapsible = true,\n className,\n classNames,\n}: BouncyAccordionProps) {\n const reduce = useReducedMotion();\n const baseId = useId();\n const [activeValue, setActiveValue] = useControllableAccordionValue({\n value,\n defaultValue,\n onValueChange,\n });\n const activeIndex = items.findIndex((item) => item.id === activeValue);\n\n const toggleItem = useCallback(\n (id: string) => {\n if (activeValue === id) {\n if (collapsible) {\n setActiveValue(null);\n }\n return;\n }\n\n setActiveValue(id);\n },\n [activeValue, collapsible, setActiveValue],\n );\n\n return (\n <div className={cn(\"w-full\", className, classNames?.root)}>\n {items.map((item, index) => {\n const open = activeValue === item.id;\n const previousIsOpen = activeIndex === index - 1;\n const nextIsOpen = activeIndex === index + 1;\n const startsGroup = open || index === 0 || previousIsOpen;\n const endsGroup = open || index === items.length - 1 || nextIsOpen;\n const separatedFromPrevious = index > 0 && (open || previousIsOpen);\n const contentId = `${baseId}-${item.id}-content`;\n const triggerId = `${baseId}-${item.id}-trigger`;\n\n return (\n <BouncyAccordionRow\n key={item.id}\n item={item}\n open={open}\n startsGroup={startsGroup}\n endsGroup={endsGroup}\n separatedFromPrevious={separatedFromPrevious}\n contentId={contentId}\n triggerId={triggerId}\n reduce={reduce}\n classNames={classNames}\n onToggle={() => toggleItem(item.id)}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AA0CA,MAAM,iBAA6B;CACjC,MAAM;CACN,UAAU;CACV,QAAQ;AACV;AAEA,MAAM,0BAAsC;CAC1C,MAAM;CACN,UAAU;CACV,QAAQ;AACV;AAEA,MAAM,2BAAuC;CAC3C,MAAM;CACN,UAAU;CACV,QAAQ;AACV;AAEA,MAAM,yBAAqC;CACzC,UAAU;CACV,MAAM;AACR;AAEA,MAAM,qBAAiC;CACrC,MAAM;CACN,UAAU;CACV,QAAQ;AACV;AAEA,SAAS,8BAA8B,EACrC,OACA,cACA,iBAKC;CACD,MAAM,CAAC,eAAe,oBAAoB,SAAS,gBAAgB,IAAI;CACvE,MAAM,eAAe,UAAU,KAAA;CAc/B,OAAO,CAbc,SAAS,eAEb,aACd,SAAwB;EACvB,IAAI,CAAC,cACH,iBAAiB,IAAI;EAGvB,gBAAgB,IAAI;CACtB,GACA,CAAC,cAAc,aAAa,CAGD,CAAC;AAChC;AAEA,SAAS,mBAAmB,EAC1B,MACA,MACA,aACA,WACA,uBACA,WACA,WACA,QACA,YACA,YAYC;CACD,MAAM,aAAa,OAAuB,IAAI;CAC9C,MAAM,CAAC,eAAe,oBAAoB,SAAS,CAAC;CAEpD,sBAAsB;EACpB,MAAM,OAAO,WAAW;EACxB,IAAI,CAAC,MAAM;EAEX,MAAM,qBAAqB;GACzB,iBAAiB,KAAK,YAAY;EACpC;EAEA,aAAa;EAEb,MAAM,WAAW,IAAI,eAAe,YAAY;EAChD,SAAS,QAAQ,IAAI;EAErB,aAAa;GACX,SAAS,WAAW;EACtB;CACF,GAAG,CAAC,CAAC;CAEL,OACE,oBAAC,OAAO,KAAR;EACE,QAAO;EACP,SAAS;EACT,OAAO,EAAE,WAAW,wBAAwB,KAAK,EAAE;EACnD,YAAY,SAAS,EAAE,UAAU,EAAE,IAAI;EAEvC,UAAA,qBAAC,OAAO,KAAR;G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AEV,UAAA,oBAAC,OAAD;MACE,WAAW,GAAG,+CAA+C,YAAY,WAAW;MAEnF,UAAA,KAAK;KACH,CAAA;IACK,CAAA;GACF,CAAA,CACF;;CACF,CAAA;AAEhB;AAEA,SAAgB,gBAAgB,EAC9B,OACA,OACA,eAAe,MACf,eACA,cAAc,MACd,WACA,cACuB;CACvB,MAAM,SAAS,iBAAiB;CAChC,MAAM,SAAS,MAAM;CACrB,MAAM,CAAC,aAAa,kBAAkB,8BAA8B;EAClE;EACA;EACA;CACF,CAAC;CACD,MAAM,cAAc,MAAM,WAAW,SAAS,KAAK,OAAO,WAAW;CAErE,MAAM,aAAa,aAChB,OAAe;EACd,IAAI,gBAAgB,IAAI;GACtB,IAAI,aACF,eAAe,IAAI;GAErB;EACF;EAEA,eAAe,EAAE;CACnB,GACA;EAAC;EAAa;EAAa;CAAc,CAC3C;CAEA,OACE,oBAAC,OAAD;EAAK,WAAW,GAAG,UAAU,WAAW,YAAY,IAAI;EACrD,UAAA,MAAM,KAAK,MAAM,UAAU;GAC1B,MAAM,OAAO,gBAAgB,KAAK;GAClC,MAAM,iBAAiB,gBAAgB,QAAQ;GAC/C,MAAM,aAAa,gBAAgB,QAAQ;GAC3C,MAAM,cAAc,QAAQ,UAAU,KAAK;GAC3C,MAAM,YAAY,QAAQ,UAAU,MAAM,SAAS,KAAK;GACxD,MAAM,wBAAwB,QAAQ,MAAM,QAAQ;GACpD,MAAM,YAAY,GAAG,OAAO,GAAG,KAAK,GAAG;GACvC,MAAM,YAAY,GAAG,OAAO,GAAG,KAAK,GAAG;GAEvC,OACE,oBAAC,oBAAD;IAEQ;IACA;IACO;IACF;IACY;IACZ;IACA;IACH;IACI;IACZ,gBAAgB,WAAW,KAAK,EAAE;GACnC,GAXM,KAAK,EAWX;EAEL,CAAC;CACE,CAAA;AAET"}
1
+ {"version":3,"file":"bouncy-accordion.js","names":[],"sources":["../../../src/components/motion/bouncy-accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useCallback, useId, useLayoutEffect, useRef, useState } from \"react\";\nimport { ChevronDown } from \"lucide-react\";\nimport { motion, type Transition, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT } from \"../../lib/ease\";\n\nexport type BouncyAccordionItem = {\n id: string;\n title: ReactNode;\n description?: ReactNode;\n icon?: ReactNode;\n disabled?: boolean;\n};\n\nexport type BouncyAccordionClassNames = {\n root?: string;\n item?: string;\n trigger?: string;\n icon?: string;\n title?: string;\n chevron?: string;\n content?: string;\n description?: string;\n};\n\nexport interface BouncyAccordionProps {\n items: BouncyAccordionItem[];\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (value: string | null) => void;\n collapsible?: boolean;\n className?: string;\n classNames?: BouncyAccordionClassNames;\n}\n\n// Local springs keep the accordion's connected groups moving together while\n// avoiding scale projection on text-heavy row contents.\n// Gap spring: must not overshoot y — positive y overshoot drifts items below\n// their mt-3 resting point and briefly overlaps the next item.\nconst ROW_TRANSITION: Transition = {\n type: \"spring\",\n duration: 0.55,\n bounce: 0.38,\n};\n\nconst CONTENT_OPEN_TRANSITION: Transition = {\n type: \"spring\",\n duration: 0.58,\n bounce: 0.32,\n};\n\nconst CONTENT_CLOSE_TRANSITION: Transition = {\n type: \"spring\",\n duration: 0.46,\n bounce: 0.26,\n};\n\nconst DESCRIPTION_TRANSITION: Transition = {\n duration: 0.18,\n ease: EASE_OUT,\n};\n\nconst CHEVRON_TRANSITION: Transition = {\n type: \"spring\",\n duration: 0.42,\n bounce: 0.28,\n};\n\nfunction useControllableAccordionValue({\n value,\n defaultValue,\n onValueChange,\n}: {\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (value: string | null) => void;\n}) {\n const [internalValue, setInternalValue] = useState(defaultValue ?? null);\n const isControlled = value !== undefined;\n const currentValue = value ?? internalValue;\n\n const setValue = useCallback(\n (next: string | null) => {\n if (!isControlled) {\n setInternalValue(next);\n }\n\n onValueChange?.(next);\n },\n [isControlled, onValueChange],\n );\n\n return [currentValue, setValue] as const;\n}\n\nfunction BouncyAccordionRow({\n item,\n open,\n startsGroup,\n endsGroup,\n separatedFromPrevious,\n contentId,\n triggerId,\n reduce,\n classNames,\n onToggle,\n}: {\n item: BouncyAccordionItem;\n open: boolean;\n startsGroup: boolean;\n endsGroup: boolean;\n separatedFromPrevious: boolean;\n contentId: string;\n triggerId: string;\n reduce: boolean | null;\n classNames?: BouncyAccordionClassNames;\n onToggle: () => void;\n}) {\n const contentRef = useRef<HTMLDivElement>(null);\n const [contentHeight, setContentHeight] = useState(0);\n\n useLayoutEffect(() => {\n const node = contentRef.current;\n if (!node) return;\n\n const updateHeight = () => {\n setContentHeight(node.offsetHeight);\n };\n\n updateHeight();\n\n const observer = new ResizeObserver(updateHeight);\n observer.observe(node);\n\n return () => {\n observer.disconnect();\n };\n }, []);\n\n return (\n <motion.div\n layout=\"position\"\n initial={false}\n style={{ marginTop: separatedFromPrevious ? 12 : 0 }}\n transition={reduce ? { duration: 0 } : ROW_TRANSITION}\n >\n <motion.div\n data-state={open ? \"open\" : \"closed\"}\n initial={false}\n animate={{\n borderTopLeftRadius: startsGroup ? 28 : 0,\n borderTopRightRadius: startsGroup ? 28 : 0,\n borderBottomLeftRadius: endsGroup ? 28 : 0,\n borderBottomRightRadius: endsGroup ? 28 : 0,\n }}\n transition={reduce ? { duration: 0 } : ROW_TRANSITION}\n className={cn(\n \"overflow-hidden bg-card text-card-foreground\",\n item.disabled && \"opacity-50\",\n classNames?.item,\n )}\n >\n <button\n id={triggerId}\n type=\"button\"\n disabled={item.disabled}\n aria-expanded={open}\n aria-controls={contentId}\n onClick={onToggle}\n className={cn(\n \"flex min-h-[54px] w-full items-center gap-4 px-5 text-left outline-none transition-colors\",\n \"focus-visible:bg-muted/25\",\n \"disabled:pointer-events-none\",\n classNames?.trigger,\n )}\n >\n {item.icon ? (\n <span\n className={cn(\n \"grid h-7 w-7 shrink-0 place-items-center text-muted-foreground\",\n classNames?.icon,\n )}\n >\n {item.icon}\n </span>\n ) : null}\n <span\n className={cn(\n \"min-w-0 flex-1 truncate font-medium text-[15px] text-foreground\",\n classNames?.title,\n )}\n >\n {item.title}\n </span>\n <motion.span\n aria-hidden\n animate={{ rotate: open ? 180 : 0 }}\n transition={reduce ? { duration: 0 } : CHEVRON_TRANSITION}\n className={cn(\n \"grid h-6 w-6 shrink-0 place-items-center text-muted-foreground\",\n classNames?.chevron,\n )}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </motion.span>\n </button>\n\n <motion.div\n layout=\"size\"\n id={contentId}\n role=\"region\"\n aria-labelledby={triggerId}\n aria-hidden={!open}\n inert={!open}\n initial={false}\n style={{ height: open && item.description ? contentHeight : 0 }}\n transition={\n reduce ? { duration: 0 } : open ? CONTENT_OPEN_TRANSITION : CONTENT_CLOSE_TRANSITION\n }\n className={cn(\"overflow-hidden\", classNames?.content)}\n >\n <motion.div\n ref={contentRef}\n animate={{\n opacity: open ? 1 : 0,\n }}\n transition={reduce ? { duration: 0 } : DESCRIPTION_TRANSITION}\n className=\"px-5 pb-5\"\n >\n <div\n className={cn(\"text-[15px] text-muted-foreground leading-6\", classNames?.description)}\n >\n {item.description}\n </div>\n </motion.div>\n </motion.div>\n </motion.div>\n </motion.div>\n );\n}\n\nexport function BouncyAccordion({\n items,\n value,\n defaultValue = null,\n onValueChange,\n collapsible = true,\n className,\n classNames,\n}: BouncyAccordionProps) {\n const reduce = useReducedMotion();\n const baseId = useId();\n const [activeValue, setActiveValue] = useControllableAccordionValue({\n value,\n defaultValue,\n onValueChange,\n });\n const activeIndex = items.findIndex((item) => item.id === activeValue);\n\n const toggleItem = useCallback(\n (id: string) => {\n if (activeValue === id) {\n if (collapsible) {\n setActiveValue(null);\n }\n return;\n }\n\n setActiveValue(id);\n },\n [activeValue, collapsible, setActiveValue],\n );\n\n return (\n <div className={cn(\"w-full\", className, classNames?.root)}>\n {items.map((item, index) => {\n const open = activeValue === item.id;\n const previousIsOpen = activeIndex === index - 1;\n const nextIsOpen = activeIndex === index + 1;\n const startsGroup = open || index === 0 || previousIsOpen;\n const endsGroup = open || index === items.length - 1 || nextIsOpen;\n const separatedFromPrevious = index > 0 && (open || previousIsOpen);\n const contentId = `${baseId}-${item.id}-content`;\n const triggerId = `${baseId}-${item.id}-trigger`;\n\n return (\n <BouncyAccordionRow\n key={item.id}\n item={item}\n open={open}\n startsGroup={startsGroup}\n endsGroup={endsGroup}\n separatedFromPrevious={separatedFromPrevious}\n contentId={contentId}\n triggerId={triggerId}\n reduce={reduce}\n classNames={classNames}\n onToggle={() => toggleItem(item.id)}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AA0CA,MAAM,iBAA6B;CACjC,MAAM;CACN,UAAU;CACV,QAAQ;AACV;AAEA,MAAM,0BAAsC;CAC1C,MAAM;CACN,UAAU;CACV,QAAQ;AACV;AAEA,MAAM,2BAAuC;CAC3C,MAAM;CACN,UAAU;CACV,QAAQ;AACV;AAEA,MAAM,yBAAqC;CACzC,UAAU;CACV,MAAM;AACR;AAEA,MAAM,qBAAiC;CACrC,MAAM;CACN,UAAU;CACV,QAAQ;AACV;AAEA,SAAS,8BAA8B,EACrC,OACA,cACA,iBAKC;CACD,MAAM,CAAC,eAAe,oBAAoB,SAAS,gBAAgB,IAAI;CACvE,MAAM,eAAe,UAAU,KAAA;CAc/B,OAAO,CAbc,SAAS,eAEb,aACd,SAAwB;EACvB,IAAI,CAAC,cACH,iBAAiB,IAAI;EAGvB,gBAAgB,IAAI;CACtB,GACA,CAAC,cAAc,aAAa,CAGD,CAAC;AAChC;AAEA,SAAS,mBAAmB,EAC1B,MACA,MACA,aACA,WACA,uBACA,WACA,WACA,QACA,YACA,YAYC;CACD,MAAM,aAAa,OAAuB,IAAI;CAC9C,MAAM,CAAC,eAAe,oBAAoB,SAAS,CAAC;CAEpD,sBAAsB;EACpB,MAAM,OAAO,WAAW;EACxB,IAAI,CAAC,MAAM;EAEX,MAAM,qBAAqB;GACzB,iBAAiB,KAA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K,GAAG;GACvC,MAAM,YAAY,GAAG,OAAO,GAAG,KAAK,GAAG;GAEvC,OACE,oBAAC,oBAAD;IAEQ;IACA;IACO;IACF;IACY;IACZ;IACA;IACH;IACI;IACZ,gBAAgB,WAAW,KAAK,EAAE;GACnC,GAXM,KAAK,EAWX;EAEL,CAAC;CACE,CAAA;AAET"}
@@ -2,7 +2,7 @@
2
2
  import { useHoverCapable } from "../../../hooks/use-hover-capable.js";
3
3
  import { EASE_OUT, SPRING_PRESS } from "../../../lib/ease.js";
4
4
  import { forwardRef, useCallback, 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 { AnimatePresence, motion, useReducedMotion } from "motion/react";
8
8
  //#region src/components/motion/button/base.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","names":[],"sources":["../../../../src/components/motion/button/base.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n forwardRef,\n type PointerEvent,\n type ReactNode,\n useCallback,\n useRef,\n useState,\n} from \"react\";\nimport { cn } from \"cn\";\nimport { AnimatePresence, type HTMLMotionProps, motion, useReducedMotion } from \"motion/react\";\n\nimport { useHoverCapable } from \"../../../hooks/use-hover-capable\";\nimport { EASE_OUT, SPRING_PRESS } from \"../../../lib/ease\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"ghost\" | \"outline\";\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\" | \"icon\";\n\nexport interface ButtonProps extends Omit<HTMLMotionProps<\"button\">, \"children\"> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n pressScale?: number;\n /** Spawn a Material-style ripple from the press point. Off by default. */\n ripple?: boolean;\n children?: ReactNode;\n}\n\nexport interface ButtonLinkProps extends Omit<HTMLMotionProps<\"a\">, \"children\"> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n pressScale?: number;\n children?: ReactNode;\n}\n\ntype Ripple = { id: number; x: number; y: number; size: number };\n\nconst VARIANT_CLASS: Record<ButtonVariant, string> = {\n primary: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n secondary: \"border border-border bg-card text-foreground hover:border-border\",\n ghost: \"text-muted-foreground hover:text-foreground hover:bg-primary/5\",\n outline: \"border border-border bg-transparent text-foreground hover:bg-primary/5\",\n};\n\nconst SIZE_CLASS: Record<ButtonSize, string> = {\n sm: \"h-8 px-3 text-xs gap-1.5 rounded-full\",\n md: \"h-10 px-5 text-sm gap-2 rounded-full\",\n lg: \"h-12 px-6 text-base gap-2 rounded-full\",\n icon: \"h-8 w-8 rounded-lg\",\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = \"primary\",\n size = \"md\",\n pressScale = 0.93,\n ripple = false,\n className,\n children,\n onPointerDown,\n ...rest\n },\n ref,\n) {\n const reduce = useReducedMotion();\n const canHover = useHoverCapable();\n const [ripples, setRipples] = useState<Ripple[]>([]);\n const nextId = useRef(0);\n\n const handlePointerDown = useCallback(\n (event: PointerEvent<HTMLButtonElement>) => {\n if (ripple && !reduce) {\n const rect = event.currentTarget.getBoundingClientRect();\n const size = Math.max(rect.width, rect.height) * 2;\n const id = nextId.current++;\n setRipples((prev) => [\n ...prev,\n {\n id,\n x: event.clientX - rect.left,\n y: event.clientY - rect.top,\n size,\n },\n ]);\n }\n onPointerDown?.(event);\n },\n [ripple, reduce, onPointerDown],\n );\n\n return (\n <motion.button\n ref={ref}\n type=\"button\"\n whileTap={reduce ? undefined : { scale: pressScale }}\n whileHover={reduce || !canHover ? undefined : { scale: 1.02 }}\n transition={SPRING_PRESS}\n onPointerDown={handlePointerDown}\n className={cn(\n \"inline-flex select-none items-center justify-center font-medium\",\n \"transition-colors\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n ripple && \"relative overflow-hidden\",\n VARIANT_CLASS[variant],\n SIZE_CLASS[size],\n className,\n )}\n {...rest}\n >\n {ripple && !reduce ? (\n <span className=\"pointer-events-none absolute inset-0 overflow-hidden rounded-[inherit]\">\n <AnimatePresence>\n {ripples.map((r) => (\n <motion.span\n key={r.id}\n className=\"absolute rounded-full bg-current\"\n style={{\n left: r.x,\n top: r.y,\n width: r.size,\n height: r.size,\n x: \"-50%\",\n y: \"-50%\",\n }}\n initial={{ scale: 0.05, opacity: 0.3 }}\n animate={{ scale: 1, opacity: 0 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 1.6, ease: EASE_OUT }}\n onAnimationComplete={() => setRipples((prev) => prev.filter((x) => x.id !== r.id))}\n />\n ))}\n </AnimatePresence>\n </span>\n ) : null}\n {children}\n </motion.button>\n );\n});\n\nexport const ButtonLink = forwardRef<HTMLAnchorElement, ButtonLinkProps>(function ButtonLink(\n { variant = \"primary\", size = \"md\", pressScale = 0.93, className, children, ...rest },\n ref,\n) {\n const reduce = useReducedMotion();\n const canHover = useHoverCapable();\n\n return (\n <motion.a\n ref={ref}\n whileTap={reduce ? undefined : { scale: pressScale }}\n whileHover={reduce || !canHover ? undefined : { scale: 1.02 }}\n transition={SPRING_PRESS}\n className={cn(\n \"inline-flex select-none items-center justify-center font-medium\",\n \"transition-colors\",\n VARIANT_CLASS[variant],\n SIZE_CLASS[size],\n className,\n )}\n {...rest}\n >\n {children}\n </motion.a>\n );\n});\n"],"mappings":";;;;;;;;AAqCA,MAAM,gBAA+C;CACnD,SAAS;CACT,WAAW;CACX,OAAO;CACP,SAAS;AACX;AAEA,MAAM,aAAyC;CAC7C,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;AACR;AAEA,MAAa,SAAS,WAA2C,SAAS,OACxE,EACE,UAAU,WACV,OAAO,MACP,aAAa,KACb,SAAS,OACT,WACA,UACA,eACA,GAAG,QAEL,KACA;CACA,MAAM,SAAS,iBAAiB;CAChC,MAAM,WAAW,gBAAgB;CACjC,MAAM,CAAC,SAAS,cAAc,SAAmB,CAAC,CAAC;CACnD,MAAM,SAAS,OAAO,CAAC;CAEvB,MAAM,oBAAoB,aACvB,UAA2C;EAC1C,IA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a,KAAM,WAAW,UAAU,GAAG,QAC/E,KACA;CACA,MAAM,SAAS,iBAAiB;CAChC,MAAM,WAAW,gBAAgB;CAEjC,OACE,oBAAC,OAAO,GAAR;EACO;EACL,UAAU,SAAS,KAAA,IAAY,EAAE,OAAO,WAAW;EACnD,YAAY,UAAU,CAAC,WAAW,KAAA,IAAY,EAAE,OAAO,KAAK;EAC5D,YAAY;EACZ,WAAW,GACT,mEACA,qBACA,cAAc,UACd,WAAW,OACX,SACF;EACA,GAAI;EAEH;CACO,CAAA;AAEd,CAAC"}
1
+ {"version":3,"file":"base.js","names":[],"sources":["../../../../src/components/motion/button/base.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n forwardRef,\n type PointerEvent,\n type ReactNode,\n useCallback,\n useRef,\n useState,\n} from \"react\";\nimport { AnimatePresence, type HTMLMotionProps, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useHoverCapable } from \"../../../hooks/use-hover-capable\";\nimport { EASE_OUT, SPRING_PRESS } from \"../../../lib/ease\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"ghost\" | \"outline\";\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\" | \"icon\";\n\nexport interface ButtonProps extends Omit<HTMLMotionProps<\"button\">, \"children\"> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n pressScale?: number;\n /** Spawn a Material-style ripple from the press point. Off by default. */\n ripple?: boolean;\n children?: ReactNode;\n}\n\nexport interface ButtonLinkProps extends Omit<HTMLMotionProps<\"a\">, \"children\"> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n pressScale?: number;\n children?: ReactNode;\n}\n\ntype Ripple = { id: number; x: number; y: number; size: number };\n\nconst VARIANT_CLASS: Record<ButtonVariant, string> = {\n primary: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n secondary: \"border border-border bg-card text-foreground hover:border-border\",\n ghost: \"text-muted-foreground hover:text-foreground hover:bg-primary/5\",\n outline: \"border border-border bg-transparent text-foreground hover:bg-primary/5\",\n};\n\nconst SIZE_CLASS: Record<ButtonSize, string> = {\n sm: \"h-8 px-3 text-xs gap-1.5 rounded-full\",\n md: \"h-10 px-5 text-sm gap-2 rounded-full\",\n lg: \"h-12 px-6 text-base gap-2 rounded-full\",\n icon: \"h-8 w-8 rounded-lg\",\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = \"primary\",\n size = \"md\",\n pressScale = 0.93,\n ripple = false,\n className,\n children,\n onPointerDown,\n ...rest\n },\n ref,\n) {\n const reduce = useReducedMotion();\n const canHover = useHoverCapable();\n const [ripples, setRipples] = useState<Ripple[]>([]);\n const nextId = useRef(0);\n\n const handlePointerDown = useCallback(\n (event: PointerEvent<HTMLButtonElement>) => {\n if (ripple && !reduce) {\n const rect = event.currentTarget.getBoundingClientRect();\n const size = Math.max(rect.width, rect.height) * 2;\n const id = nextId.current++;\n setRipples((prev) => [\n ...prev,\n {\n id,\n x: event.clientX - rect.left,\n y: event.clientY - rect.top,\n size,\n },\n ]);\n }\n onPointerDown?.(event);\n },\n [ripple, reduce, onPointerDown],\n );\n\n return (\n <motion.button\n ref={ref}\n type=\"button\"\n whileTap={reduce ? undefined : { scale: pressScale }}\n whileHover={reduce || !canHover ? undefined : { scale: 1.02 }}\n transition={SPRING_PRESS}\n onPointerDown={handlePointerDown}\n className={cn(\n \"inline-flex select-none items-center justify-center font-medium\",\n \"transition-colors\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n ripple && \"relative overflow-hidden\",\n VARIANT_CLASS[variant],\n SIZE_CLASS[size],\n className,\n )}\n {...rest}\n >\n {ripple && !reduce ? (\n <span className=\"pointer-events-none absolute inset-0 overflow-hidden rounded-[inherit]\">\n <AnimatePresence>\n {ripples.map((r) => (\n <motion.span\n key={r.id}\n className=\"absolute rounded-full bg-current\"\n style={{\n left: r.x,\n top: r.y,\n width: r.size,\n height: r.size,\n x: \"-50%\",\n y: \"-50%\",\n }}\n initial={{ scale: 0.05, opacity: 0.3 }}\n animate={{ scale: 1, opacity: 0 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 1.6, ease: EASE_OUT }}\n onAnimationComplete={() => setRipples((prev) => prev.filter((x) => x.id !== r.id))}\n />\n ))}\n </AnimatePresence>\n </span>\n ) : null}\n {children}\n </motion.button>\n );\n});\n\nexport const ButtonLink = forwardRef<HTMLAnchorElement, ButtonLinkProps>(function ButtonLink(\n { variant = \"primary\", size = \"md\", pressScale = 0.93, className, children, ...rest },\n ref,\n) {\n const reduce = useReducedMotion();\n const canHover = useHoverCapable();\n\n return (\n <motion.a\n ref={ref}\n whileTap={reduce ? undefined : { scale: pressScale }}\n whileHover={reduce || !canHover ? undefined : { scale: 1.02 }}\n transition={SPRING_PRESS}\n className={cn(\n \"inline-flex select-none items-center justify-center font-medium\",\n \"transition-colors\",\n VARIANT_CLASS[variant],\n SIZE_CLASS[size],\n className,\n )}\n {...rest}\n >\n {children}\n </motion.a>\n );\n});\n"],"mappings":";;;;;;;;AAqCA,MAAM,gBAA+C;CACnD,SAAS;CACT,WAAW;CACX,OAAO;CACP,SAAS;AACX;AAEA,MAAM,aAAyC;CAC7C,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;AACR;AAEA,MAAa,SAAS,WAA2C,SAAS,OACxE,EACE,UAAU,WACV,OAAO,MACP,aAAa,KACb,SAAS,OACT,WACA,UACA,eACA,GAAG,QAEL,KACA;CACA,MAAM,SAAS,iBAAiB;CAChC,MAAM,WAAW,gBAAgB;CACjC,MAAM,CAAC,SAAS,cAAc,SAAmB,CAAC,CAAC;CACnD,MAAM,SAAS,OAAO,CAAC;CAEvB,MAAM,oBAAoB,aACvB,UAA2C;EAC1C,IAAI,UAAU,CAAC,QAAQ;GACrB,MAAM,OAAO,MAAM,cAAc,sBAAsB;GACvD,MAAM,OAAO,KAAK,IAAI,KAAK,OAAO,KAAK,MAAM,IAAI;GACjD,MAAM,KAAK,OAAO;GAClB,YAAY,SAAS,CACnB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AAW;EACnD,YAAY,UAAU,CAAC,WAAW,KAAA,IAAY,EAAE,OAAO,KAAK;EAC5D,YAAY;EACZ,WAAW,GACT,mEACA,qBACA,cAAc,UACd,WAAW,OACX,SACF;EACA,GAAI;EAEH;CACO,CAAA;AAEd,CAAC"}
@@ -2,7 +2,7 @@
2
2
  import { EASE_IN_OUT } from "../../../lib/ease.js";
3
3
  import { Button } from "./base.js";
4
4
  import { forwardRef, 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/button/metallic.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"metallic.js","names":[],"sources":["../../../../src/components/motion/button/metallic.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, useState } from \"react\";\nimport { cn } from \"cn\";\nimport { motion, useReducedMotion } from \"motion/react\";\n\nimport { EASE_IN_OUT } from \"../../../lib/ease\";\nimport { Button, type ButtonProps } from \"./base\";\n\nexport interface MetallicButtonProps extends Omit<ButtonProps, \"ripple\" | \"variant\"> {\n /** Stops the traveling reflection while preserving the chrome rim. */\n paused?: boolean;\n}\n\n// The rim and highlight drift separately so the material stays quiet and reflective.\nconst SILVER_DRIFT = {\n duration: 8,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n};\n\nconst CHROME_SHIMMER = {\n duration: 2.4,\n ease: EASE_IN_OUT,\n};\n\nexport const MetallicButton = forwardRef<HTMLButtonElement, MetallicButtonProps>(\n function MetallicButton(\n { size = \"md\", paused = false, className, children, onHoverStart, onHoverEnd, ...rest },\n ref,\n ) {\n const reduce = useReducedMotion();\n const still = paused || Boolean(reduce);\n const [hovered, setHovered] = useState(false);\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size={size}\n onHoverStart={(event, info) => {\n setHovered(true);\n onHoverStart?.(event, info);\n }}\n onHoverEnd={(event, info) => {\n setHovered(false);\n onHoverEnd?.(event, info);\n }}\n className={cn(\n \"group relative isolate overflow-hidden border-0 bg-transparent text-foreground\",\n \"hover:bg-transparent hover:text-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n \"shadow-[0_8px_22px_rgba(0,0,0,0.16)]\",\n size === \"icon\" && \"rounded-full\",\n className,\n )}\n {...rest}\n >\n <motion.span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-y-0 left-[-18%] z-0 w-[136%] rounded-[inherit] bg-[linear-gradient(105deg,#111_0%,#737373_14%,#fafafa_26%,#525252_38%,#0a0a0a_50%,#a3a3a3_64%,#fff_75%,#404040_87%,#111_100%)]\"\n animate={still ? undefined : { x: [\"0%\", \"13%\", \"0%\"] }}\n transition={still ? undefined : SILVER_DRIFT}\n />\n\n <motion.span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-y-0 left-[-58%] z-1 w-[52%] -skew-x-12 bg-[linear-gradient(90deg,transparent,rgba(255,255,255,0.5)_48%,transparent)] opacity-50 mix-blend-screen blur-[3px]\"\n animate={still ? undefined : { x: hovered ? \"310%\" : \"0%\" }}\n transition={still ? undefined : CHROME_SHIMMER}\n />\n\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-[2px] z-2 rounded-[inherit] bg-background transition-colors group-hover:bg-muted/40\"\n />\n\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-[2px] z-3 rounded-[inherit] shadow-[inset_0_1px_0_rgba(255,255,255,0.28),inset_0_-1px_0_rgba(0,0,0,0.16)]\"\n />\n\n <span className=\"relative z-10 inline-flex items-center justify-center gap-2\">\n {children}\n </span>\n </Button>\n );\n },\n);\n"],"mappings":";;;;;;;;AAeA,MAAM,eAAe;CACnB,UAAU;CACV,MAAM;CACN,QAAQ;AACV;AAEA,MAAM,iBAAiB;CACrB,UAAU;CACV,MAAM;AACR;AAEA,MAAa,iBAAiB,WAC5B,SAAS,eACP,EAAE,OAAO,MAAM,SAAS,OAAO,WAAW,UAAU,cAAc,YAAY,GAAG,QACjF,KACA;CACA,MAAM,SAAS,iBAAiB;CAChC,MAAM,QAAQ,UAAU,QAAQ,MAAM;CACtC,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAE5C,OACE,qBAAC,QAAD;EACO;EACL,SAAQ;EACF;EACN,eAAe,OAAO,SAAS;GAC7B,WAAW,IAAI;GACf,eAAe,OAAO,IAAI;EAC5B;EACA,aAAa,OAAO,SAAS;GAC3B,WAAW,KAAK;GAChB,aAAa,OAAO,IAAI;EAC1B;EACA,WAAW,GACT,kFACA,8CACA,uGACA,wCACA,SAAS,UAAU,gBACnB,SACF;EACA,GAAI;EApBN,UAAA;GAsBE,oBAAC,OAAO,MAAR;IACE,eAAY;IACZ,WAAU;IACV,SAAS,QAAQ,KAAA,IAAY,EAAE,GAAG;KAAC;KAAM;KAAO;IAAI,EAAE;IACtD,YAAY,QAAQ,KAAA,IAAY;GACjC,CAAA;GAED,oBAAC,OAAO,MAAR;IACE,eAAY;IACZ,WAAU;IACV,SAAS,QAAQ,KAAA,IAAY,EAAE,GAAG,UAAU,SAAS,KAAK;IAC1D,YAAY,QAAQ,KAAA,IAAY;GACjC,CAAA;GAED,oBAAC,QAAD;IACE,eAAY;IACZ,WAAU;GACX,CAAA;GAED,oBAAC,QAAD;IACE,eAAY;IACZ,WAAU;GACX,CAAA;GAED,oBAAC,QAAD;IAAM,WAAU;IACb;GACG,CAAA;EACA;;AAEZ,CACF"}
1
+ {"version":3,"file":"metallic.js","names":[],"sources":["../../../../src/components/motion/button/metallic.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, useState } from \"react\";\nimport { motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_IN_OUT } from \"../../../lib/ease\";\nimport { Button, type ButtonProps } from \"./base\";\n\nexport interface MetallicButtonProps extends Omit<ButtonProps, \"ripple\" | \"variant\"> {\n /** Stops the traveling reflection while preserving the chrome rim. */\n paused?: boolean;\n}\n\n// The rim and highlight drift separately so the material stays quiet and reflective.\nconst SILVER_DRIFT = {\n duration: 8,\n ease: EASE_IN_OUT,\n repeat: Infinity,\n};\n\nconst CHROME_SHIMMER = {\n duration: 2.4,\n ease: EASE_IN_OUT,\n};\n\nexport const MetallicButton = forwardRef<HTMLButtonElement, MetallicButtonProps>(\n function MetallicButton(\n { size = \"md\", paused = false, className, children, onHoverStart, onHoverEnd, ...rest },\n ref,\n ) {\n const reduce = useReducedMotion();\n const still = paused || Boolean(reduce);\n const [hovered, setHovered] = useState(false);\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size={size}\n onHoverStart={(event, info) => {\n setHovered(true);\n onHoverStart?.(event, info);\n }}\n onHoverEnd={(event, info) => {\n setHovered(false);\n onHoverEnd?.(event, info);\n }}\n className={cn(\n \"group relative isolate overflow-hidden border-0 bg-transparent text-foreground\",\n \"hover:bg-transparent hover:text-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n \"shadow-[0_8px_22px_rgba(0,0,0,0.16)]\",\n size === \"icon\" && \"rounded-full\",\n className,\n )}\n {...rest}\n >\n <motion.span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-y-0 left-[-18%] z-0 w-[136%] rounded-[inherit] bg-[linear-gradient(105deg,#111_0%,#737373_14%,#fafafa_26%,#525252_38%,#0a0a0a_50%,#a3a3a3_64%,#fff_75%,#404040_87%,#111_100%)]\"\n animate={still ? undefined : { x: [\"0%\", \"13%\", \"0%\"] }}\n transition={still ? undefined : SILVER_DRIFT}\n />\n\n <motion.span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-y-0 left-[-58%] z-1 w-[52%] -skew-x-12 bg-[linear-gradient(90deg,transparent,rgba(255,255,255,0.5)_48%,transparent)] opacity-50 mix-blend-screen blur-[3px]\"\n animate={still ? undefined : { x: hovered ? \"310%\" : \"0%\" }}\n transition={still ? undefined : CHROME_SHIMMER}\n />\n\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-[2px] z-2 rounded-[inherit] bg-background transition-colors group-hover:bg-muted/40\"\n />\n\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-[2px] z-3 rounded-[inherit] shadow-[inset_0_1px_0_rgba(255,255,255,0.28),inset_0_-1px_0_rgba(0,0,0,0.16)]\"\n />\n\n <span className=\"relative z-10 inline-flex items-center justify-center gap-2\">\n {children}\n </span>\n </Button>\n );\n },\n);\n"],"mappings":";;;;;;;;AAeA,MAAM,eAAe;CACnB,UAAU;CACV,MAAM;CACN,QAAQ;AACV;AAEA,MAAM,iBAAiB;CACrB,UAAU;CACV,MAAM;AACR;AAEA,MAAa,iBAAiB,WAC5B,SAAS,eACP,EAAE,OAAO,MAAM,SAAS,OAAO,WAAW,UAAU,cAAc,YAAY,GAAG,QACjF,KACA;CACA,MAAM,SAAS,iBAAiB;CAChC,MAAM,QAAQ,UAAU,QAAQ,MAAM;CACtC,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAE5C,OACE,qBAAC,QAAD;EACO;EACL,SAAQ;EACF;EACN,eAAe,OAAO,SAAS;GAC7B,WAAW,IAAI;GACf,eAAe,OAAO,IAAI;EAC5B;EACA,aAAa,OAAO,SAAS;GAC3B,WAAW,KAAK;GAChB,aAAa,OAAO,IAAI;EAC1B;EACA,WAAW,GACT,kFACA,8CACA,uGACA,wCACA,SAAS,UAAU,gBACnB,SACF;EACA,GAAI;EApBN,UAAA;GAsBE,oBAAC,OAAO,MAAR;IACE,eAAY;IACZ,WAAU;IACV,SAAS,QAAQ,KAAA,IAAY,EAAE,GAAG;KAAC;KAAM;KAAO;IAAI,EAAE;IACtD,YAAY,QAAQ,KAAA,IAAY;GACjC,CAAA;GAED,oBAAC,OAAO,MAAR;IACE,eAAY;IACZ,WAAU;IACV,SAAS,QAAQ,KAAA,IAAY,EAAE,GAAG,UAAU,SAAS,KAAK;IAC1D,YAAY,QAAQ,KAAA,IAAY;GACjC,CAAA;GAED,oBAAC,QAAD;IACE,eAAY;IACZ,WAAU;GACX,CAAA;GAED,oBAAC,QAAD;IACE,eAAY;IACZ,WAAU;GACX,CAAA;GAED,oBAAC,QAAD;IAAM,WAAU;IACb;GACG,CAAA;EACA;;AAEZ,CACF"}
@@ -2,7 +2,7 @@
2
2
  import { EASE_IN_OUT, EASE_OUT, SPRING_LAYOUT, SPRING_PRESS } from "../../lib/ease.js";
3
3
  import { DigitSwap } from "./digit-swap.js";
4
4
  import { useCallback, useEffect, 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 { AnimatePresence, animate, motion, useMotionValue, useReducedMotion, useTransform } from "motion/react";
8
8
  import { EllipsisVertical, Eye, EyeOff } from "lucide-react";
@@ -1 +1 @@
1
- {"version":3,"file":"card-folder.js","names":[],"sources":["../../../src/components/motion/card-folder.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useCallback, useEffect, useState } from \"react\";\nimport { cn } from \"cn\";\nimport { EllipsisVertical, Eye, EyeOff } from \"lucide-react\";\nimport {\n AnimatePresence,\n animate,\n motion,\n useMotionValue,\n useReducedMotion,\n useTransform,\n} from \"motion/react\";\n\nimport { EASE_IN_OUT, EASE_OUT, SPRING_LAYOUT, SPRING_PRESS } from \"../../lib/ease\";\nimport { DigitSwap } from \"./digit-swap\";\n\n// The two purse layers collapse as one material surface after the card starts\n// moving, then reverse immediately so closing feels like the card is caught.\nconst PURSE_MORPH_TRANSITION = {\n duration: 0.28,\n ease: EASE_IN_OUT,\n} as const;\nconst PURSE_REDUCED_TRANSITION = {\n duration: 0.16,\n ease: EASE_OUT,\n} as const;\n\nexport interface CardFolderProps {\n title: string;\n cardNumber: string;\n expiry: string;\n cvv: string;\n card: ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n detailsVisible?: boolean;\n defaultDetailsVisible?: boolean;\n onDetailsVisibleChange?: (visible: boolean) => void;\n onClick?: () => void;\n onAction?: () => void;\n ariaLabel?: string;\n actionLabel?: string;\n disabled?: boolean;\n className?: string;\n cardClassName?: string;\n}\n\n/**\n * A landscape card tucked into an animated folder sleeve. Pressing the folder\n * lifts the card forward while the purse compresses into its bottom seam; a\n * separate privacy control reveals its number and CVV.\n */\nexport function CardFolder({\n title,\n cardNumber,\n expiry,\n cvv,\n card,\n open,\n defaultOpen = false,\n onOpenChange,\n detailsVisible,\n defaultDetailsVisible = false,\n onDetailsVisibleChange,\n onClick,\n onAction,\n ariaLabel,\n actionLabel,\n disabled = false,\n className,\n cardClassName,\n}: CardFolderProps) {\n const reduce = useReducedMotion();\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalDetailsVisible, setInternalDetailsVisible] = useState(defaultDetailsVisible);\n const openControlled = open !== undefined;\n const detailsControlled = detailsVisible !== undefined;\n const isOpen = open ?? internalOpen;\n const areDetailsVisible = detailsVisible ?? internalDetailsVisible;\n const transition = reduce ? { duration: 0 } : SPRING_LAYOUT;\n const normalizedCardNumber = cardNumber.replace(/\\D/g, \"\");\n const visibleLastFour = normalizedCardNumber.slice(-4).padStart(4, \"•\");\n const revealedCardNumber = normalizedCardNumber.match(/.{1,4}/g)?.join(\" \") ?? visibleLastFour;\n const maskedCvv = \"•\".repeat(Math.max(3, cvv.length));\n const defaultAriaLabel = `${isOpen ? \"Close\" : \"Open\"} ${title}, card ending in ${visibleLastFour}, expires ${expiry}`;\n const progress = useMotionValue(isOpen ? 1 : 0);\n const cardTransform = useTransform(progress, (value) => {\n const boundedProgress = Math.min(1, Math.max(0, value));\n const lift = Math.sin(Math.PI * boundedProgress);\n return `translateY(${-8 * lift}%) scale(${1 + 0.01 * lift})`;\n });\n const backTransform = useTransform(\n progress,\n [0, 1],\n [\"translateY(0%) scaleY(1)\", \"translateY(18%) scaleY(0.18)\"],\n );\n const frontTransform = useTransform(\n progress,\n [0, 1],\n [\"translateY(0%) rotateX(0deg)\", \"translateY(18%) rotateX(-72deg)\"],\n );\n const purseOpacity = useTransform(progress, [0, 0.76, 1], [1, 1, 0]);\n\n useEffect(() => {\n const controls = animate(\n progress,\n isOpen ? 1 : 0,\n reduce ? { duration: 0 } : PURSE_MORPH_TRANSITION,\n );\n return () => controls.stop();\n }, [isOpen, progress, reduce]);\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (disabled) return;\n if (!openControlled) setInternalOpen(nextOpen);\n onOpenChange?.(nextOpen);\n },\n [disabled, onOpenChange, openControlled],\n );\n\n const handleClick = () => {\n setOpen(!isOpen);\n onClick?.();\n };\n\n const toggleDetails = () => {\n if (disabled) return;\n const nextVisible = !areDetailsVisible;\n if (!detailsControlled) setInternalDetailsVisible(nextVisible);\n onDetailsVisibleChange?.(nextVisible);\n };\n\n return (\n <div\n data-open={isOpen ? \"true\" : \"false\"}\n data-details-visible={areDetailsVisible ? \"true\" : \"false\"}\n className={cn(\n \"perspective-[1200px] relative aspect-1029/592 w-96 max-w-full select-none\",\n className,\n )}\n >\n <motion.button\n type=\"button\"\n disabled={disabled}\n aria-label={ariaLabel ?? defaultAriaLabel}\n aria-expanded={isOpen}\n onClick={handleClick}\n whileTap={reduce || disabled ? undefined : { scale: 0.96 }}\n transition={reduce ? { duration: 0 } : SPRING_PRESS}\n className=\"absolute inset-0 block rounded-2xl text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-4 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <motion.span\n data-slot=\"card-folder-back\"\n aria-hidden=\"true\"\n initial={false}\n animate={reduce ? { opacity: isOpen ? 0 : 1 } : undefined}\n transition={PURSE_REDUCED_TRANSITION}\n style={reduce ? undefined : { opacity: purseOpacity, transform: backTransform }}\n className=\"absolute inset-x-0 top-[10%] bottom-0 origin-[center_bottom] rounded-2xl border border-foreground/10 bg-background\"\n />\n\n <motion.span\n aria-hidden=\"true\"\n initial={false}\n animate={reduce ? { transform: \"translateY(0%) scale(1)\" } : undefined}\n style={reduce ? undefined : { transform: cardTransform }}\n className={cn(\n \"absolute top-0 right-[4.7%] left-[4.7%] z-10 aspect-[1.586/1] origin-[center_bottom] overflow-hidden rounded-xl border border-foreground/10 bg-background will-change-transform\",\n cardClassName,\n )}\n >\n {card}\n </motion.span>\n </motion.button>\n\n <motion.span\n aria-hidden={isOpen}\n inert={isOpen}\n initial={false}\n animate={reduce ? { opacity: isOpen ? 0 : 1 } : undefined}\n transition={PURSE_REDUCED_TRANSITION}\n style={reduce ? undefined : { opacity: purseOpacity, transform: frontTransform }}\n className=\"backface-hidden pointer-events-none absolute inset-x-0 top-1/2 bottom-0 z-20 origin-[center_bottom]\"\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 384 110\"\n preserveAspectRatio=\"none\"\n className=\"absolute inset-0 size-full overflow-visible\"\n >\n <path\n d=\"M0 17C15 7 31 4 49 4H87C110 4 126 17 144 32L158 44C176 59 206 59 225 43L240 30C257 16 271 4 295 4H335C354 4 370 8 384 18V94C384 103 377 110 368 110H16C7 110 0 103 0 94Z\"\n fill=\"var(--background)\"\n stroke=\"var(--foreground)\"\n strokeOpacity=\"0.12\"\n vectorEffect=\"non-scaling-stroke\"\n />\n <path\n d=\"M10 21C22 13 35 11 51 11H85C105 11 120 23 137 37L153 50C175 68 208 68 231 49L246 36C262 23 275 11 297 11H333C350 11 363 14 374 22V89C374 97 369 101 360 101H24C15 101 10 96 10 89Z\"\n fill=\"none\"\n stroke=\"var(--foreground)\"\n strokeDasharray=\"5 5\"\n strokeLinecap=\"round\"\n strokeOpacity=\"0.22\"\n vectorEffect=\"non-scaling-stroke\"\n />\n </svg>\n\n <span className=\"absolute inset-x-[5%] inset-y-0 z-10 flex min-w-0 flex-col justify-between py-4\">\n <span className=\"flex items-start justify-between pr-2\">\n <motion.button\n key=\"card-details-visibility\"\n type=\"button\"\n disabled={disabled}\n tabIndex={isOpen ? -1 : undefined}\n aria-label={areDetailsVisible ? \"Hide card details\" : \"Show card details\"}\n aria-pressed={areDetailsVisible}\n onClick={toggleDetails}\n whileTap={reduce || disabled ? undefined : { scale: 0.96 }}\n transition={reduce ? { duration: 0.12 } : SPRING_PRESS}\n className={cn(\n \"z-30 flex size-10 shrink-0 items-center justify-center rounded-full text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset disabled:cursor-not-allowed disabled:opacity-50\",\n isOpen ? \"pointer-events-none\" : \"pointer-events-auto\",\n )}\n >\n <AnimatePresence initial={false} mode=\"popLayout\">\n <motion.span\n key={areDetailsVisible ? \"hide\" : \"show\"}\n initial={\n reduce ? { opacity: 0 } : { opacity: 0, scale: 0.25, filter: \"blur(4px)\" }\n }\n animate={{ opacity: 1, scale: 1, filter: \"blur(0px)\" }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, scale: 0.25, filter: \"blur(4px)\" }}\n transition={\n reduce ? { duration: 0.12 } : { type: \"spring\", duration: 0.3, bounce: 0 }\n }\n className=\"flex items-center justify-center\"\n >\n {areDetailsVisible ? (\n <EyeOff className=\"size-4\" aria-hidden=\"true\" />\n ) : (\n <Eye className=\"size-4\" aria-hidden=\"true\" />\n )}\n </motion.span>\n </AnimatePresence>\n </motion.button>\n\n <span className=\"flex shrink-0 items-end gap-3.5 pt-2\">\n <span className=\"flex flex-col gap-0.5\">\n <span className=\"font-medium text-[9px] text-muted-foreground/65 uppercase tracking-[0.12em]\">\n Expiry\n </span>\n <span className=\"font-medium text-foreground text-xs tabular-nums\">{expiry}</span>\n </span>\n <span className=\"flex flex-col gap-0.5\">\n <span className=\"font-medium text-[9px] text-muted-foreground/65 uppercase tracking-[0.12em]\">\n CVV\n </span>\n <DigitSwap\n value={areDetailsVisible ? cvv : maskedCvv}\n animationKey={areDetailsVisible ? \"revealed\" : \"masked\"}\n direction={areDetailsVisible ? \"up\" : \"down\"}\n className=\"font-medium text-foreground text-xs tabular-nums\"\n />\n </span>\n </span>\n </span>\n <span className=\"flex min-w-0 items-baseline justify-between gap-4\">\n <span className=\"truncate font-medium text-foreground text-lg leading-tight\">\n {title}\n </span>\n <DigitSwap\n value={areDetailsVisible ? revealedCardNumber : `•••• •••• •••• ${visibleLastFour}`}\n animationKey={areDetailsVisible ? \"revealed\" : \"masked\"}\n direction={areDetailsVisible ? \"up\" : \"down\"}\n suffixLength={4}\n glyphClassName={areDetailsVisible ? \"text-foreground\" : \"text-muted-foreground\"}\n suffixClassName=\"text-foreground\"\n className=\"truncate font-mono text-xs tabular-nums tracking-[0.08em]\"\n />\n </span>\n </span>\n </motion.span>\n\n {onAction ? (\n <motion.button\n type=\"button\"\n disabled={disabled}\n aria-label={actionLabel ?? `Open actions for ${title}`}\n onClick={onAction}\n animate={{ y: isOpen && !reduce ? -14 : 0 }}\n whileTap={reduce || disabled ? undefined : { scale: 0.96 }}\n transition={transition}\n className=\"absolute top-[10%] right-[2.6%] z-10 flex size-10 -translate-y-1/2 items-center justify-center rounded-full text-white/65 outline-none transition-colors hover:bg-white/10 hover:text-white focus-visible:ring-2 focus-visible:ring-white disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <EllipsisVertical className=\"size-4\" aria-hidden=\"true\" />\n </motion.button>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAmBA,MAAM,yBAAyB;CAC7B,UAAU;CACV,MAAM;AACR;AACA,MAAM,2BAA2B;CAC/B,UAAU;CACV,MAAM;AACR;;;;;;AA4BA,SAAgB,WAAW,EACzB,OACA,YACA,QACA,KACA,MACA,MACA,cAAc,OACd,cACA,gBACA,wBAAwB,OACxB,wBACA,SACA,UACA,WACA,aACA,WAAW,OACX,WACA,iBACkB;CAClB,MAAM,SAAS,iBAAiB;CAChC,MAAM,CAAC,cAAc,mBAAmB,SAAS,WAAW;CAC5D,MAAM,CAAC,wBAAwB,6BAA6B,SAAS,qBAAqB;CAC1F,MAAM,iBAAiB,SAAS,KAAA;CAChC,MAAM,oBAAoB,mBAAmB,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E,qBAAC,QAAD;QAAM,WAAU;QAAhB,UAAA,CACE,oBAAC,QAAD;SAAM,WAAU;SAA8E,UAAA;QAExF,CAAA,GACN,oBAAC,QAAD;SAAM,WAAU;SAAoD,UAAA;QAAa,CAAA,CAC7E;OACN,CAAA,GAAA,qBAAC,QAAD;QAAM,WAAU;QAAhB,UAAA,CACE,oBAAC,QAAD;SAAM,WAAU;SAA8E,UAAA;QAExF,CAAA,GACN,oBAAC,WAAD;SACE,OAAO,oBAAoB,MAAM;SACjC,cAAc,oBAAoB,aAAa;SAC/C,WAAW,oBAAoB,OAAO;SACtC,WAAU;QACX,CAAA,CACG;OACF,CAAA,CAAA;MACF,CAAA,CAAA;KACN,CAAA,GAAA,qBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA,CACE,oBAAC,QAAD;OAAM,WAAU;OACb,UAAA;MACG,CAAA,GACN,oBAAC,WAAD;OACE,OAAO,oBAAoB,qBAAqB,kBAAkB;OAClE,cAAc,oBAAoB,aAAa;OAC/C,WAAW,oBAAoB,OAAO;OACtC,cAAc;OACd,gBAAgB,oBAAoB,oBAAoB;OACxD,iBAAgB;OAChB,WAAU;MACX,CAAA,CACG;KACF,CAAA,CAAA;IACK,CAAA,CAAA;;GAEZ,WACC,oBAAC,OAAO,QAAR;IACE,MAAK;IACK;IACV,cAAY,eAAe,oBAAoB;IAC/C,SAAS;IACT,SAAS,EAAE,GAAG,UAAU,CAAC,SAAS,MAAM,EAAE;IAC1C,UAAU,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;IAC7C;IACZ,WAAU;IAEV,UAAA,oBAAC,kBAAD;KAAkB,WAAU;KAAS,eAAY;IAAQ,CAAA;GAC5C,CAAA,IACb;EACD;;AAET"}
1
+ {"version":3,"file":"card-folder.js","names":[],"sources":["../../../src/components/motion/card-folder.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useCallback, useEffect, useState } from \"react\";\nimport { EllipsisVertical, Eye, EyeOff } from \"lucide-react\";\nimport {\n AnimatePresence,\n animate,\n motion,\n useMotionValue,\n useReducedMotion,\n useTransform,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_IN_OUT, EASE_OUT, SPRING_LAYOUT, SPRING_PRESS } from \"../../lib/ease\";\nimport { DigitSwap } from \"./digit-swap\";\n\n// The two purse layers collapse as one material surface after the card starts\n// moving, then reverse immediately so closing feels like the card is caught.\nconst PURSE_MORPH_TRANSITION = {\n duration: 0.28,\n ease: EASE_IN_OUT,\n} as const;\nconst PURSE_REDUCED_TRANSITION = {\n duration: 0.16,\n ease: EASE_OUT,\n} as const;\n\nexport interface CardFolderProps {\n title: string;\n cardNumber: string;\n expiry: string;\n cvv: string;\n card: ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n detailsVisible?: boolean;\n defaultDetailsVisible?: boolean;\n onDetailsVisibleChange?: (visible: boolean) => void;\n onClick?: () => void;\n onAction?: () => void;\n ariaLabel?: string;\n actionLabel?: string;\n disabled?: boolean;\n className?: string;\n cardClassName?: string;\n}\n\n/**\n * A landscape card tucked into an animated folder sleeve. Pressing the folder\n * lifts the card forward while the purse compresses into its bottom seam; a\n * separate privacy control reveals its number and CVV.\n */\nexport function CardFolder({\n title,\n cardNumber,\n expiry,\n cvv,\n card,\n open,\n defaultOpen = false,\n onOpenChange,\n detailsVisible,\n defaultDetailsVisible = false,\n onDetailsVisibleChange,\n onClick,\n onAction,\n ariaLabel,\n actionLabel,\n disabled = false,\n className,\n cardClassName,\n}: CardFolderProps) {\n const reduce = useReducedMotion();\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalDetailsVisible, setInternalDetailsVisible] = useState(defaultDetailsVisible);\n const openControlled = open !== undefined;\n const detailsControlled = detailsVisible !== undefined;\n const isOpen = open ?? internalOpen;\n const areDetailsVisible = detailsVisible ?? internalDetailsVisible;\n const transition = reduce ? { duration: 0 } : SPRING_LAYOUT;\n const normalizedCardNumber = cardNumber.replace(/\\D/g, \"\");\n const visibleLastFour = normalizedCardNumber.slice(-4).padStart(4, \"•\");\n const revealedCardNumber = normalizedCardNumber.match(/.{1,4}/g)?.join(\" \") ?? visibleLastFour;\n const maskedCvv = \"•\".repeat(Math.max(3, cvv.length));\n const defaultAriaLabel = `${isOpen ? \"Close\" : \"Open\"} ${title}, card ending in ${visibleLastFour}, expires ${expiry}`;\n const progress = useMotionValue(isOpen ? 1 : 0);\n const cardTransform = useTransform(progress, (value) => {\n const boundedProgress = Math.min(1, Math.max(0, value));\n const lift = Math.sin(Math.PI * boundedProgress);\n return `translateY(${-8 * lift}%) scale(${1 + 0.01 * lift})`;\n });\n const backTransform = useTransform(\n progress,\n [0, 1],\n [\"translateY(0%) scaleY(1)\", \"translateY(18%) scaleY(0.18)\"],\n );\n const frontTransform = useTransform(\n progress,\n [0, 1],\n [\"translateY(0%) rotateX(0deg)\", \"translateY(18%) rotateX(-72deg)\"],\n );\n const purseOpacity = useTransform(progress, [0, 0.76, 1], [1, 1, 0]);\n\n useEffect(() => {\n const controls = animate(\n progress,\n isOpen ? 1 : 0,\n reduce ? { duration: 0 } : PURSE_MORPH_TRANSITION,\n );\n return () => controls.stop();\n }, [isOpen, progress, reduce]);\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (disabled) return;\n if (!openControlled) setInternalOpen(nextOpen);\n onOpenChange?.(nextOpen);\n },\n [disabled, onOpenChange, openControlled],\n );\n\n const handleClick = () => {\n setOpen(!isOpen);\n onClick?.();\n };\n\n const toggleDetails = () => {\n if (disabled) return;\n const nextVisible = !areDetailsVisible;\n if (!detailsControlled) setInternalDetailsVisible(nextVisible);\n onDetailsVisibleChange?.(nextVisible);\n };\n\n return (\n <div\n data-open={isOpen ? \"true\" : \"false\"}\n data-details-visible={areDetailsVisible ? \"true\" : \"false\"}\n className={cn(\n \"perspective-[1200px] relative aspect-1029/592 w-96 max-w-full select-none\",\n className,\n )}\n >\n <motion.button\n type=\"button\"\n disabled={disabled}\n aria-label={ariaLabel ?? defaultAriaLabel}\n aria-expanded={isOpen}\n onClick={handleClick}\n whileTap={reduce || disabled ? undefined : { scale: 0.96 }}\n transition={reduce ? { duration: 0 } : SPRING_PRESS}\n className=\"absolute inset-0 block rounded-2xl text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-4 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <motion.span\n data-slot=\"card-folder-back\"\n aria-hidden=\"true\"\n initial={false}\n animate={reduce ? { opacity: isOpen ? 0 : 1 } : undefined}\n transition={PURSE_REDUCED_TRANSITION}\n style={reduce ? undefined : { opacity: purseOpacity, transform: backTransform }}\n className=\"absolute inset-x-0 top-[10%] bottom-0 origin-[center_bottom] rounded-2xl border border-foreground/10 bg-background\"\n />\n\n <motion.span\n aria-hidden=\"true\"\n initial={false}\n animate={reduce ? { transform: \"translateY(0%) scale(1)\" } : undefined}\n style={reduce ? undefined : { transform: cardTransform }}\n className={cn(\n \"absolute top-0 right-[4.7%] left-[4.7%] z-10 aspect-[1.586/1] origin-[center_bottom] overflow-hidden rounded-xl border border-foreground/10 bg-background will-change-transform\",\n cardClassName,\n )}\n >\n {card}\n </motion.span>\n </motion.button>\n\n <motion.span\n aria-hidden={isOpen}\n inert={isOpen}\n initial={false}\n animate={reduce ? { opacity: isOpen ? 0 : 1 } : undefined}\n transition={PURSE_REDUCED_TRANSITION}\n style={reduce ? undefined : { opacity: purseOpacity, transform: frontTransform }}\n className=\"backface-hidden pointer-events-none absolute inset-x-0 top-1/2 bottom-0 z-20 origin-[center_bottom]\"\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 384 110\"\n preserveAspectRatio=\"none\"\n className=\"absolute inset-0 size-full overflow-visible\"\n >\n <path\n d=\"M0 17C15 7 31 4 49 4H87C110 4 126 17 144 32L158 44C176 59 206 59 225 43L240 30C257 16 271 4 295 4H335C354 4 370 8 384 18V94C384 103 377 110 368 110H16C7 110 0 103 0 94Z\"\n fill=\"var(--background)\"\n stroke=\"var(--foreground)\"\n strokeOpacity=\"0.12\"\n vectorEffect=\"non-scaling-stroke\"\n />\n <path\n d=\"M10 21C22 13 35 11 51 11H85C105 11 120 23 137 37L153 50C175 68 208 68 231 49L246 36C262 23 275 11 297 11H333C350 11 363 14 374 22V89C374 97 369 101 360 101H24C15 101 10 96 10 89Z\"\n fill=\"none\"\n stroke=\"var(--foreground)\"\n strokeDasharray=\"5 5\"\n strokeLinecap=\"round\"\n strokeOpacity=\"0.22\"\n vectorEffect=\"non-scaling-stroke\"\n />\n </svg>\n\n <span className=\"absolute inset-x-[5%] inset-y-0 z-10 flex min-w-0 flex-col justify-between py-4\">\n <span className=\"flex items-start justify-between pr-2\">\n <motion.button\n key=\"card-details-visibility\"\n type=\"button\"\n disabled={disabled}\n tabIndex={isOpen ? -1 : undefined}\n aria-label={areDetailsVisible ? \"Hide card details\" : \"Show card details\"}\n aria-pressed={areDetailsVisible}\n onClick={toggleDetails}\n whileTap={reduce || disabled ? undefined : { scale: 0.96 }}\n transition={reduce ? { duration: 0.12 } : SPRING_PRESS}\n className={cn(\n \"z-30 flex size-10 shrink-0 items-center justify-center rounded-full text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset disabled:cursor-not-allowed disabled:opacity-50\",\n isOpen ? \"pointer-events-none\" : \"pointer-events-auto\",\n )}\n >\n <AnimatePresence initial={false} mode=\"popLayout\">\n <motion.span\n key={areDetailsVisible ? \"hide\" : \"show\"}\n initial={\n reduce ? { opacity: 0 } : { opacity: 0, scale: 0.25, filter: \"blur(4px)\" }\n }\n animate={{ opacity: 1, scale: 1, filter: \"blur(0px)\" }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, scale: 0.25, filter: \"blur(4px)\" }}\n transition={\n reduce ? { duration: 0.12 } : { type: \"spring\", duration: 0.3, bounce: 0 }\n }\n className=\"flex items-center justify-center\"\n >\n {areDetailsVisible ? (\n <EyeOff className=\"size-4\" aria-hidden=\"true\" />\n ) : (\n <Eye className=\"size-4\" aria-hidden=\"true\" />\n )}\n </motion.span>\n </AnimatePresence>\n </motion.button>\n\n <span className=\"flex shrink-0 items-end gap-3.5 pt-2\">\n <span className=\"flex flex-col gap-0.5\">\n <span className=\"font-medium text-[9px] text-muted-foreground/65 uppercase tracking-[0.12em]\">\n Expiry\n </span>\n <span className=\"font-medium text-foreground text-xs tabular-nums\">{expiry}</span>\n </span>\n <span className=\"flex flex-col gap-0.5\">\n <span className=\"font-medium text-[9px] text-muted-foreground/65 uppercase tracking-[0.12em]\">\n CVV\n </span>\n <DigitSwap\n value={areDetailsVisible ? cvv : maskedCvv}\n animationKey={areDetailsVisible ? \"revealed\" : \"masked\"}\n direction={areDetailsVisible ? \"up\" : \"down\"}\n className=\"font-medium text-foreground text-xs tabular-nums\"\n />\n </span>\n </span>\n </span>\n <span className=\"flex min-w-0 items-baseline justify-between gap-4\">\n <span className=\"truncate font-medium text-foreground text-lg leading-tight\">\n {title}\n </span>\n <DigitSwap\n value={areDetailsVisible ? revealedCardNumber : `•••• •••• •••• ${visibleLastFour}`}\n animationKey={areDetailsVisible ? \"revealed\" : \"masked\"}\n direction={areDetailsVisible ? \"up\" : \"down\"}\n suffixLength={4}\n glyphClassName={areDetailsVisible ? \"text-foreground\" : \"text-muted-foreground\"}\n suffixClassName=\"text-foreground\"\n className=\"truncate font-mono text-xs tabular-nums tracking-[0.08em]\"\n />\n </span>\n </span>\n </motion.span>\n\n {onAction ? (\n <motion.button\n type=\"button\"\n disabled={disabled}\n aria-label={actionLabel ?? `Open actions for ${title}`}\n onClick={onAction}\n animate={{ y: isOpen && !reduce ? -14 : 0 }}\n whileTap={reduce || disabled ? undefined : { scale: 0.96 }}\n transition={transition}\n className=\"absolute top-[10%] right-[2.6%] z-10 flex size-10 -translate-y-1/2 items-center justify-center rounded-full text-white/65 outline-none transition-colors hover:bg-white/10 hover:text-white focus-visible:ring-2 focus-visible:ring-white disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <EllipsisVertical className=\"size-4\" aria-hidden=\"true\" />\n </motion.button>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAmBA,MAAM,yBAAyB;CAC7B,UAAU;CACV,MAAM;AACR;AACA,MAAM,2BAA2B;CAC/B,UAAU;CACV,MAAM;AACR;;;;;;AA4BA,SAAgB,WAAW,EACzB,OACA,YACA,QACA,KACA,MACA,MACA,cAAc,OACd,cACA,gBACA,wBAAwB,OACxB,wBACA,SACA,UACA,WACA,aACA,WAAW,OACX,WACA,iBACkB;CAClB,MAAM,SAAS,iBAAiB;CAChC,MAAM,CAAC,cAAc,mBAAmB,SAAS,WAAW;CAC5D,MAAM,CAAC,wBAAwB,6BAA6B,SAAS,qBAAqB;CAC1F,MAAM,iBAAiB,SAAS,KAAA;CAChC,MAAM,oBAAoB,mBAAmB,KAAA;CAC7C,MAAM,SAAS,QAAQ;CACvB,MAAM,oBAAoB,kBAAkB;CAC5C,MAAM,aAAa,SAAS,EAAE,UAAU,EAAE,IAAI;CAC9C,MAAM,uBAAuB,WAAW,QAAQ,OAAO,EAAE;CACzD,MAAM,kBAAkB,qBAAqB,MAAM,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;CACtE,MAAM,qBAAqB,qBAAqB,MAAM,SAAS,CAAC,EAAE,KAAK,GAAG,KAAK;CAC/E,MAAM,YAAY,IAAI,OAAO,KAAK,IAAI,GAAG,IAAI,MAAM,CAAC;CACpD,MAAM,mBAAmB,GAAG,SAAS,UAAU,OAAO,GAAG,MAAM,mBAAmB,gBAAgB,YAAY;CAC9G,MAAM,WAAW,eAAe,SAAS,IAAI,CAAC;CAC9C,MAAM,gBAAgB,aAAa,WAAW,UAAU;EAEtD,MAAM,OAAO,KAAK,IAAI,KAAK,KADH,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,CACP,CAAC;EAC/C,OAAO,cAAc,KAAK,KAAK,WAAW,IAAI,MAAO,KAAK;CAC5D,CAAC;C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AAgB;OAChB,WAAU;MACX,CAAA,CACG;KACF,CAAA,CAAA;IACK,CAAA,CAAA;;GAEZ,WACC,oBAAC,OAAO,QAAR;IACE,MAAK;IACK;IACV,cAAY,eAAe,oBAAoB;IAC/C,SAAS;IACT,SAAS,EAAE,GAAG,UAAU,CAAC,SAAS,MAAM,EAAE;IAC1C,UAAU,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;IAC7C;IACZ,WAAU;IAEV,UAAA,oBAAC,kBAAD;KAAkB,WAAU;KAAS,eAAY;IAAQ,CAAA;GAC5C,CAAA,IACb;EACD;;AAET"}
@@ -2,7 +2,7 @@
2
2
  import { EASE_OUT } from "../../lib/ease.js";
3
3
  import { t as PresenceGate } from "../../presence-gate-BekdC4Bo.js";
4
4
  import { cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
5
- import { cn } from "cn";
5
+ import { cn } from "@kumix/utils";
6
6
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { AnimatePresence, motion, useReducedMotion } from "motion/react";
8
8
  import { X } from "lucide-react";