@kumix/ui 0.3.13 → 0.3.15

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 (541) hide show
  1. package/README.md +12 -12
  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 +5 -4
  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.d.ts.map +1 -1
  95. package/dist/components/motion/command-palette.js +3 -22
  96. package/dist/components/motion/command-palette.js.map +1 -1
  97. package/dist/components/motion/context-menu.js +1 -1
  98. package/dist/components/motion/context-menu.js.map +1 -1
  99. package/dist/components/motion/cylinder-carousel.js +1 -1
  100. package/dist/components/motion/cylinder-carousel.js.map +1 -1
  101. package/dist/components/motion/digit-swap.js +1 -1
  102. package/dist/components/motion/digit-swap.js.map +1 -1
  103. package/dist/components/motion/dock.js +1 -1
  104. package/dist/components/motion/dock.js.map +1 -1
  105. package/dist/components/motion/drawer.js +1 -1
  106. package/dist/components/motion/drawer.js.map +1 -1
  107. package/dist/components/motion/dynamic-island.js +1 -1
  108. package/dist/components/motion/dynamic-island.js.map +1 -1
  109. package/dist/components/motion/expandable-action-bar.js +1 -1
  110. package/dist/components/motion/expandable-action-bar.js.map +1 -1
  111. package/dist/components/motion/expandable-control.d.ts.map +1 -1
  112. package/dist/components/motion/expandable-control.js +1 -1
  113. package/dist/components/motion/expandable-control.js.map +1 -1
  114. package/dist/components/motion/expandable-tabs.js +1 -1
  115. package/dist/components/motion/expandable-tabs.js.map +1 -1
  116. package/dist/components/motion/expanding-arrow-button.js +1 -1
  117. package/dist/components/motion/expanding-arrow-button.js.map +1 -1
  118. package/dist/components/motion/feedback-widget.js +1 -1
  119. package/dist/components/motion/feedback-widget.js.map +1 -1
  120. package/dist/components/motion/file-tree.js +1 -1
  121. package/dist/components/motion/file-tree.js.map +1 -1
  122. package/dist/components/motion/file-upload.js +1 -1
  123. package/dist/components/motion/file-upload.js.map +1 -1
  124. package/dist/components/motion/hold-action-button.js +1 -1
  125. package/dist/components/motion/hold-action-button.js.map +1 -1
  126. package/dist/components/motion/infinite-masonry.js +1 -1
  127. package/dist/components/motion/infinite-masonry.js.map +1 -1
  128. package/dist/components/motion/input.d.ts.map +1 -1
  129. package/dist/components/motion/input.js +1 -1
  130. package/dist/components/motion/input.js.map +1 -1
  131. package/dist/components/motion/liquid.js +1 -1
  132. package/dist/components/motion/liquid.js.map +1 -1
  133. package/dist/components/motion/loader.js +1 -1
  134. package/dist/components/motion/loader.js.map +1 -1
  135. package/dist/components/motion/magnetic.js +1 -1
  136. package/dist/components/motion/magnetic.js.map +1 -1
  137. package/dist/components/motion/marquee.d.ts.map +1 -1
  138. package/dist/components/motion/marquee.js +1 -1
  139. package/dist/components/motion/marquee.js.map +1 -1
  140. package/dist/components/motion/morphing-modal.js +1 -1
  141. package/dist/components/motion/morphing-modal.js.map +1 -1
  142. package/dist/components/motion/morphing-search.js +1 -1
  143. package/dist/components/motion/morphing-search.js.map +1 -1
  144. package/dist/components/motion/morphing-tabs.js +1 -1
  145. package/dist/components/motion/morphing-tabs.js.map +1 -1
  146. package/dist/components/motion/multi-select/content.js +1 -1
  147. package/dist/components/motion/multi-select/content.js.map +1 -1
  148. package/dist/components/motion/multi-select/context.js +1 -1
  149. package/dist/components/motion/multi-select/context.js.map +1 -1
  150. package/dist/components/motion/multi-select/list.js +1 -1
  151. package/dist/components/motion/multi-select/list.js.map +1 -1
  152. package/dist/components/motion/multi-select/trigger.js +1 -1
  153. package/dist/components/motion/multi-select/trigger.js.map +1 -1
  154. package/dist/components/motion/not-found/magnetic.d.ts.map +1 -1
  155. package/dist/components/motion/not-found/magnetic.js +1 -1
  156. package/dist/components/motion/not-found/magnetic.js.map +1 -1
  157. package/dist/components/motion/not-found/shared.js +1 -1
  158. package/dist/components/motion/not-found/shared.js.map +1 -1
  159. package/dist/components/motion/not-found/spotlight.js +1 -1
  160. package/dist/components/motion/not-found/spotlight.js.map +1 -1
  161. package/dist/components/motion/notification-stack.js +1 -1
  162. package/dist/components/motion/notification-stack.js.map +1 -1
  163. package/dist/components/motion/number-ticker.js +1 -1
  164. package/dist/components/motion/number-ticker.js.map +1 -1
  165. package/dist/components/motion/otp-input.js +1 -1
  166. package/dist/components/motion/otp-input.js.map +1 -1
  167. package/dist/components/motion/overflow-actions.js +1 -1
  168. package/dist/components/motion/overflow-actions.js.map +1 -1
  169. package/dist/components/motion/parallax.d.ts.map +1 -1
  170. package/dist/components/motion/parallax.js +1 -1
  171. package/dist/components/motion/parallax.js.map +1 -1
  172. package/dist/components/motion/popover-morph.js +1 -1
  173. package/dist/components/motion/popover-morph.js.map +1 -1
  174. package/dist/components/motion/popover.js +1 -1
  175. package/dist/components/motion/popover.js.map +1 -1
  176. package/dist/components/motion/preview-rail.js +1 -1
  177. package/dist/components/motion/preview-rail.js.map +1 -1
  178. package/dist/components/motion/project-folder.js +1 -1
  179. package/dist/components/motion/project-folder.js.map +1 -1
  180. package/dist/components/motion/pull-to-refresh.js +1 -1
  181. package/dist/components/motion/pull-to-refresh.js.map +1 -1
  182. package/dist/components/motion/radio.js +1 -1
  183. package/dist/components/motion/radio.js.map +1 -1
  184. package/dist/components/motion/range-slider-bubble.js +1 -1
  185. package/dist/components/motion/range-slider-bubble.js.map +1 -1
  186. package/dist/components/motion/range-slider-fluid.js +1 -1
  187. package/dist/components/motion/range-slider-fluid.js.map +1 -1
  188. package/dist/components/motion/range-slider-inline.d.ts +18 -0
  189. package/dist/components/motion/range-slider-inline.d.ts.map +1 -0
  190. package/dist/components/motion/range-slider-inline.js +267 -0
  191. package/dist/components/motion/range-slider-inline.js.map +1 -0
  192. package/dist/components/motion/range-slider-ruler.js +1 -1
  193. package/dist/components/motion/range-slider-ruler.js.map +1 -1
  194. package/dist/components/motion/range-slider-wave.js +1 -1
  195. package/dist/components/motion/range-slider-wave.js.map +1 -1
  196. package/dist/components/motion/range-slider.d.ts.map +1 -1
  197. package/dist/components/motion/range-slider.js +27 -11
  198. package/dist/components/motion/range-slider.js.map +1 -1
  199. package/dist/components/motion/scroll-progress.js +1 -1
  200. package/dist/components/motion/scroll-progress.js.map +1 -1
  201. package/dist/components/motion/scroll-reveal.js +1 -1
  202. package/dist/components/motion/scroll-reveal.js.map +1 -1
  203. package/dist/components/motion/scroll-to.js +1 -1
  204. package/dist/components/motion/scroll-to.js.map +1 -1
  205. package/dist/components/motion/select-morph.d.ts.map +1 -1
  206. package/dist/components/motion/select-morph.js +1 -1
  207. package/dist/components/motion/select-morph.js.map +1 -1
  208. package/dist/components/motion/select.js +1 -1
  209. package/dist/components/motion/select.js.map +1 -1
  210. package/dist/components/motion/shader-background.d.ts.map +1 -1
  211. package/dist/components/motion/shader-background.js +1 -1
  212. package/dist/components/motion/shader-background.js.map +1 -1
  213. package/dist/components/motion/shared-layout-bg.js +1 -1
  214. package/dist/components/motion/shared-layout-bg.js.map +1 -1
  215. package/dist/components/motion/signup-form.js +1 -1
  216. package/dist/components/motion/signup-form.js.map +1 -1
  217. package/dist/components/motion/slide-action-button.js +1 -1
  218. package/dist/components/motion/slide-action-button.js.map +1 -1
  219. package/dist/components/motion/swipeable-list.js +1 -1
  220. package/dist/components/motion/swipeable-list.js.map +1 -1
  221. package/dist/components/motion/switch.d.ts.map +1 -1
  222. package/dist/components/motion/switch.js +1 -1
  223. package/dist/components/motion/switch.js.map +1 -1
  224. package/dist/components/motion/table/index.js +1 -1
  225. package/dist/components/motion/table/index.js.map +1 -1
  226. package/dist/components/motion/table/skeleton-rows.d.ts.map +1 -1
  227. package/dist/components/motion/table/skeleton-rows.js +1 -1
  228. package/dist/components/motion/table/skeleton-rows.js.map +1 -1
  229. package/dist/components/motion/table/table-header.js +1 -1
  230. package/dist/components/motion/table/table-header.js.map +1 -1
  231. package/dist/components/motion/table/table-menu.js +1 -1
  232. package/dist/components/motion/table/table-menu.js.map +1 -1
  233. package/dist/components/motion/tabs.js +2 -2
  234. package/dist/components/motion/tabs.js.map +1 -1
  235. package/dist/components/motion/text-reveal.js +1 -1
  236. package/dist/components/motion/text-reveal.js.map +1 -1
  237. package/dist/components/motion/text-scramble.d.ts.map +1 -1
  238. package/dist/components/motion/text-scramble.js +1 -1
  239. package/dist/components/motion/text-scramble.js.map +1 -1
  240. package/dist/components/motion/text-shimmer.js +1 -1
  241. package/dist/components/motion/text-shimmer.js.map +1 -1
  242. package/dist/components/motion/theme-toggle.js +1 -1
  243. package/dist/components/motion/theme-toggle.js.map +1 -1
  244. package/dist/components/motion/tilt-card.js +1 -1
  245. package/dist/components/motion/tilt-card.js.map +1 -1
  246. package/dist/components/motion/tooltip-surface.d.ts +12 -0
  247. package/dist/components/motion/tooltip-surface.d.ts.map +1 -0
  248. package/dist/components/motion/tooltip-surface.js +97 -0
  249. package/dist/components/motion/tooltip-surface.js.map +1 -0
  250. package/dist/components/motion/tooltip.d.ts +13 -3
  251. package/dist/components/motion/tooltip.d.ts.map +1 -1
  252. package/dist/components/motion/tooltip.js +75 -104
  253. package/dist/components/motion/tooltip.js.map +1 -1
  254. package/dist/components/motion/wheel-picker.js +1 -1
  255. package/dist/components/motion/wheel-picker.js.map +1 -1
  256. package/dist/components/reui/alert.d.ts +1 -1
  257. package/dist/components/reui/alert.d.ts.map +1 -1
  258. package/dist/components/reui/alert.js +1 -1
  259. package/dist/components/reui/alert.js.map +1 -1
  260. package/dist/components/reui/autocomplete.d.ts +1 -1
  261. package/dist/components/reui/autocomplete.d.ts.map +1 -1
  262. package/dist/components/reui/autocomplete.js +2 -2
  263. package/dist/components/reui/autocomplete.js.map +1 -1
  264. package/dist/components/reui/badge.d.ts +2 -2
  265. package/dist/components/reui/badge.d.ts.map +1 -1
  266. package/dist/components/reui/badge.js +1 -1
  267. package/dist/components/reui/badge.js.map +1 -1
  268. package/dist/components/reui/cascader/cascader-columns.js +1 -1
  269. package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
  270. package/dist/components/reui/cascader/cascader-footer.js +1 -1
  271. package/dist/components/reui/cascader/cascader-footer.js.map +1 -1
  272. package/dist/components/reui/cascader/cascader-item.js +1 -1
  273. package/dist/components/reui/cascader/cascader-item.js.map +1 -1
  274. package/dist/components/reui/cascader/cascader-nav.js +1 -1
  275. package/dist/components/reui/cascader/cascader-nav.js.map +1 -1
  276. package/dist/components/reui/cascader/cascader.js +1 -1
  277. package/dist/components/reui/cascader/cascader.js.map +1 -1
  278. package/dist/components/reui/code-block/code-block.js +1 -1
  279. package/dist/components/reui/code-block/code-block.js.map +1 -1
  280. package/dist/components/reui/data-grid/data-grid-cell-selection.js +1 -1
  281. package/dist/components/reui/data-grid/data-grid-cell-selection.js.map +1 -1
  282. package/dist/components/reui/data-grid/data-grid-column-filter.js +1 -1
  283. package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
  284. package/dist/components/reui/data-grid/data-grid-column-header.js +1 -1
  285. package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
  286. package/dist/components/reui/data-grid/data-grid-pagination.js +1 -1
  287. package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
  288. package/dist/components/reui/data-grid/data-grid-scroll-area.js +1 -1
  289. package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
  290. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +1 -1
  291. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
  292. package/dist/components/reui/data-grid/data-grid-table-virtual.js +1 -1
  293. package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
  294. package/dist/components/reui/data-grid/data-grid-table.js +1 -1
  295. package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
  296. package/dist/components/reui/data-grid/data-grid.js +1 -1
  297. package/dist/components/reui/data-grid/data-grid.js.map +1 -1
  298. package/dist/components/reui/date-selector.js +1 -1
  299. package/dist/components/reui/date-selector.js.map +1 -1
  300. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +1 -1
  301. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
  302. package/dist/components/reui/event-calendar/event-calendar-content.js +1 -1
  303. package/dist/components/reui/event-calendar/event-calendar-content.js.map +1 -1
  304. package/dist/components/reui/event-calendar/event-calendar-event.js +1 -1
  305. package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
  306. package/dist/components/reui/event-calendar/event-calendar-month-view.js +1 -1
  307. package/dist/components/reui/event-calendar/event-calendar-month-view.js.map +1 -1
  308. package/dist/components/reui/event-calendar/event-calendar-nav.js +1 -1
  309. package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
  310. package/dist/components/reui/event-calendar/event-calendar-resource-view.js +1 -1
  311. package/dist/components/reui/event-calendar/event-calendar-resource-view.js.map +1 -1
  312. package/dist/components/reui/event-calendar/event-calendar-time-grid.js +1 -1
  313. package/dist/components/reui/event-calendar/event-calendar-time-grid.js.map +1 -1
  314. package/dist/components/reui/event-calendar/event-calendar.js +1 -1
  315. package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
  316. package/dist/components/reui/filters/filters-advanced.js +1 -1
  317. package/dist/components/reui/filters/filters-advanced.js.map +1 -1
  318. package/dist/components/reui/filters/filters-builder.js +1 -1
  319. package/dist/components/reui/filters/filters-builder.js.map +1 -1
  320. package/dist/components/reui/filters/filters-chip.js +1 -1
  321. package/dist/components/reui/filters/filters-chip.js.map +1 -1
  322. package/dist/components/reui/filters/filters-editors.js +1 -1
  323. package/dist/components/reui/filters/filters-editors.js.map +1 -1
  324. package/dist/components/reui/filters/filters.js +1 -1
  325. package/dist/components/reui/filters/filters.js.map +1 -1
  326. package/dist/components/reui/frame.d.ts +6 -12
  327. package/dist/components/reui/frame.d.ts.map +1 -1
  328. package/dist/components/reui/frame.js +10 -17
  329. package/dist/components/reui/frame.js.map +1 -1
  330. package/dist/components/reui/gantt/gantt-bar.js +1 -1
  331. package/dist/components/reui/gantt/gantt-bar.js.map +1 -1
  332. package/dist/components/reui/gantt/gantt-nav.js +1 -1
  333. package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
  334. package/dist/components/reui/gantt/gantt-view.js +1 -1
  335. package/dist/components/reui/gantt/gantt-view.js.map +1 -1
  336. package/dist/components/reui/gantt/gantt.js +1 -1
  337. package/dist/components/reui/gantt/gantt.js.map +1 -1
  338. package/dist/components/reui/icon-stack.js +1 -1
  339. package/dist/components/reui/icon-stack.js.map +1 -1
  340. package/dist/components/reui/icon-tile.d.ts +2 -2
  341. package/dist/components/reui/icon-tile.d.ts.map +1 -1
  342. package/dist/components/reui/icon-tile.js +1 -1
  343. package/dist/components/reui/icon-tile.js.map +1 -1
  344. package/dist/components/reui/kanban.d.ts.map +1 -1
  345. package/dist/components/reui/kanban.js +1 -1
  346. package/dist/components/reui/kanban.js.map +1 -1
  347. package/dist/components/reui/number-field.d.ts +3 -3
  348. package/dist/components/reui/number-field.d.ts.map +1 -1
  349. package/dist/components/reui/number-field.js +4 -4
  350. package/dist/components/reui/number-field.js.map +1 -1
  351. package/dist/components/reui/phone-input.js +1 -1
  352. package/dist/components/reui/phone-input.js.map +1 -1
  353. package/dist/components/reui/rating.d.ts +1 -1
  354. package/dist/components/reui/rating.d.ts.map +1 -1
  355. package/dist/components/reui/rating.js +1 -1
  356. package/dist/components/reui/rating.js.map +1 -1
  357. package/dist/components/reui/sortable.d.ts.map +1 -1
  358. package/dist/components/reui/sortable.js +1 -1
  359. package/dist/components/reui/sortable.js.map +1 -1
  360. package/dist/components/reui/stepper.d.ts.map +1 -1
  361. package/dist/components/reui/stepper.js +1 -1
  362. package/dist/components/reui/stepper.js.map +1 -1
  363. package/dist/components/reui/timeline.d.ts.map +1 -1
  364. package/dist/components/reui/timeline.js +1 -1
  365. package/dist/components/reui/timeline.js.map +1 -1
  366. package/dist/components/reui/tree.d.ts.map +1 -1
  367. package/dist/components/reui/tree.js +1 -1
  368. package/dist/components/reui/tree.js.map +1 -1
  369. package/dist/components/ui/accordion.d.ts.map +1 -1
  370. package/dist/components/ui/accordion.js +1 -1
  371. package/dist/components/ui/accordion.js.map +1 -1
  372. package/dist/components/ui/alert-dialog.js +1 -1
  373. package/dist/components/ui/alert-dialog.js.map +1 -1
  374. package/dist/components/ui/alert.d.ts.map +1 -1
  375. package/dist/components/ui/alert.js +1 -1
  376. package/dist/components/ui/alert.js.map +1 -1
  377. package/dist/components/ui/aspect-ratio.js +1 -1
  378. package/dist/components/ui/aspect-ratio.js.map +1 -1
  379. package/dist/components/ui/attachment.d.ts +1 -1
  380. package/dist/components/ui/attachment.js +1 -1
  381. package/dist/components/ui/attachment.js.map +1 -1
  382. package/dist/components/ui/avatar.d.ts.map +1 -1
  383. package/dist/components/ui/avatar.js +1 -1
  384. package/dist/components/ui/avatar.js.map +1 -1
  385. package/dist/components/ui/badge.d.ts +1 -1
  386. package/dist/components/ui/badge.d.ts.map +1 -1
  387. package/dist/components/ui/badge.js +1 -1
  388. package/dist/components/ui/badge.js.map +1 -1
  389. package/dist/components/ui/breadcrumb.d.ts.map +1 -1
  390. package/dist/components/ui/breadcrumb.js +1 -1
  391. package/dist/components/ui/breadcrumb.js.map +1 -1
  392. package/dist/components/ui/bubble.d.ts +1 -1
  393. package/dist/components/ui/bubble.d.ts.map +1 -1
  394. package/dist/components/ui/bubble.js +1 -1
  395. package/dist/components/ui/bubble.js.map +1 -1
  396. package/dist/components/ui/button-group.js +1 -1
  397. package/dist/components/ui/button-group.js.map +1 -1
  398. package/dist/components/ui/button.d.ts +2 -2
  399. package/dist/components/ui/button.d.ts.map +1 -1
  400. package/dist/components/ui/button.js +1 -1
  401. package/dist/components/ui/button.js.map +1 -1
  402. package/dist/components/ui/calendar.js +1 -1
  403. package/dist/components/ui/calendar.js.map +1 -1
  404. package/dist/components/ui/card.d.ts.map +1 -1
  405. package/dist/components/ui/card.js +1 -1
  406. package/dist/components/ui/card.js.map +1 -1
  407. package/dist/components/ui/carousel.js +1 -1
  408. package/dist/components/ui/carousel.js.map +1 -1
  409. package/dist/components/ui/chart.d.ts.map +1 -1
  410. package/dist/components/ui/chart.js +1 -1
  411. package/dist/components/ui/chart.js.map +1 -1
  412. package/dist/components/ui/checkbox.d.ts.map +1 -1
  413. package/dist/components/ui/checkbox.js +1 -1
  414. package/dist/components/ui/checkbox.js.map +1 -1
  415. package/dist/components/ui/combobox.js +1 -1
  416. package/dist/components/ui/combobox.js.map +1 -1
  417. package/dist/components/ui/command.js +1 -1
  418. package/dist/components/ui/command.js.map +1 -1
  419. package/dist/components/ui/context-menu.d.ts.map +1 -1
  420. package/dist/components/ui/context-menu.js +1 -1
  421. package/dist/components/ui/context-menu.js.map +1 -1
  422. package/dist/components/ui/dialog.js +1 -1
  423. package/dist/components/ui/dialog.js.map +1 -1
  424. package/dist/components/ui/drawer.d.ts.map +1 -1
  425. package/dist/components/ui/drawer.js +1 -1
  426. package/dist/components/ui/drawer.js.map +1 -1
  427. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  428. package/dist/components/ui/dropdown-menu.js +1 -1
  429. package/dist/components/ui/dropdown-menu.js.map +1 -1
  430. package/dist/components/ui/empty.d.ts.map +1 -1
  431. package/dist/components/ui/empty.js +1 -1
  432. package/dist/components/ui/empty.js.map +1 -1
  433. package/dist/components/ui/field.js +1 -1
  434. package/dist/components/ui/field.js.map +1 -1
  435. package/dist/components/ui/hover-card.d.ts.map +1 -1
  436. package/dist/components/ui/hover-card.js +1 -1
  437. package/dist/components/ui/hover-card.js.map +1 -1
  438. package/dist/components/ui/input-group.d.ts +1 -1
  439. package/dist/components/ui/input-group.js +1 -1
  440. package/dist/components/ui/input-group.js.map +1 -1
  441. package/dist/components/ui/input-otp.d.ts.map +1 -1
  442. package/dist/components/ui/input-otp.js +1 -1
  443. package/dist/components/ui/input-otp.js.map +1 -1
  444. package/dist/components/ui/input.d.ts.map +1 -1
  445. package/dist/components/ui/input.js +1 -1
  446. package/dist/components/ui/input.js.map +1 -1
  447. package/dist/components/ui/item.d.ts +2 -2
  448. package/dist/components/ui/item.js +1 -1
  449. package/dist/components/ui/item.js.map +1 -1
  450. package/dist/components/ui/kbd.js +1 -1
  451. package/dist/components/ui/kbd.js.map +1 -1
  452. package/dist/components/ui/label.d.ts.map +1 -1
  453. package/dist/components/ui/label.js +1 -1
  454. package/dist/components/ui/label.js.map +1 -1
  455. package/dist/components/ui/marker.d.ts +1 -1
  456. package/dist/components/ui/marker.d.ts.map +1 -1
  457. package/dist/components/ui/marker.js +1 -1
  458. package/dist/components/ui/marker.js.map +1 -1
  459. package/dist/components/ui/menubar.js +1 -1
  460. package/dist/components/ui/menubar.js.map +1 -1
  461. package/dist/components/ui/message-scroller.js +1 -1
  462. package/dist/components/ui/message-scroller.js.map +1 -1
  463. package/dist/components/ui/message.d.ts.map +1 -1
  464. package/dist/components/ui/message.js +1 -1
  465. package/dist/components/ui/message.js.map +1 -1
  466. package/dist/components/ui/native-select.d.ts.map +1 -1
  467. package/dist/components/ui/native-select.js +1 -1
  468. package/dist/components/ui/native-select.js.map +1 -1
  469. package/dist/components/ui/navigation-menu.d.ts.map +1 -1
  470. package/dist/components/ui/navigation-menu.js +1 -1
  471. package/dist/components/ui/navigation-menu.js.map +1 -1
  472. package/dist/components/ui/pagination.js +1 -1
  473. package/dist/components/ui/pagination.js.map +1 -1
  474. package/dist/components/ui/popover.d.ts.map +1 -1
  475. package/dist/components/ui/popover.js +1 -1
  476. package/dist/components/ui/popover.js.map +1 -1
  477. package/dist/components/ui/progress.d.ts.map +1 -1
  478. package/dist/components/ui/progress.js +1 -1
  479. package/dist/components/ui/progress.js.map +1 -1
  480. package/dist/components/ui/questionnaire.js +1 -1
  481. package/dist/components/ui/questionnaire.js.map +1 -1
  482. package/dist/components/ui/radio-group.d.ts.map +1 -1
  483. package/dist/components/ui/radio-group.js +1 -1
  484. package/dist/components/ui/radio-group.js.map +1 -1
  485. package/dist/components/ui/resizable.d.ts.map +1 -1
  486. package/dist/components/ui/resizable.js +1 -1
  487. package/dist/components/ui/resizable.js.map +1 -1
  488. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  489. package/dist/components/ui/scroll-area.js +1 -1
  490. package/dist/components/ui/scroll-area.js.map +1 -1
  491. package/dist/components/ui/select.d.ts.map +1 -1
  492. package/dist/components/ui/select.js +1 -1
  493. package/dist/components/ui/select.js.map +1 -1
  494. package/dist/components/ui/separator.d.ts.map +1 -1
  495. package/dist/components/ui/separator.js +1 -1
  496. package/dist/components/ui/separator.js.map +1 -1
  497. package/dist/components/ui/sheet.js +1 -1
  498. package/dist/components/ui/sheet.js.map +1 -1
  499. package/dist/components/ui/sidebar.d.ts +1 -1
  500. package/dist/components/ui/sidebar.js +1 -1
  501. package/dist/components/ui/sidebar.js.map +1 -1
  502. package/dist/components/ui/skeleton.js +1 -1
  503. package/dist/components/ui/skeleton.js.map +1 -1
  504. package/dist/components/ui/slider.d.ts.map +1 -1
  505. package/dist/components/ui/slider.js +1 -1
  506. package/dist/components/ui/slider.js.map +1 -1
  507. package/dist/components/ui/spinner.d.ts.map +1 -1
  508. package/dist/components/ui/spinner.js +1 -1
  509. package/dist/components/ui/spinner.js.map +1 -1
  510. package/dist/components/ui/switch.d.ts.map +1 -1
  511. package/dist/components/ui/switch.js +1 -1
  512. package/dist/components/ui/switch.js.map +1 -1
  513. package/dist/components/ui/table.d.ts.map +1 -1
  514. package/dist/components/ui/table.js +1 -1
  515. package/dist/components/ui/table.js.map +1 -1
  516. package/dist/components/ui/tabs.d.ts +1 -1
  517. package/dist/components/ui/tabs.d.ts.map +1 -1
  518. package/dist/components/ui/tabs.js +1 -1
  519. package/dist/components/ui/tabs.js.map +1 -1
  520. package/dist/components/ui/textarea.d.ts.map +1 -1
  521. package/dist/components/ui/textarea.js +1 -1
  522. package/dist/components/ui/textarea.js.map +1 -1
  523. package/dist/components/ui/toast.js +1 -1
  524. package/dist/components/ui/toast.js.map +1 -1
  525. package/dist/components/ui/toggle-group.js +1 -1
  526. package/dist/components/ui/toggle-group.js.map +1 -1
  527. package/dist/components/ui/toggle.d.ts +1 -1
  528. package/dist/components/ui/toggle.d.ts.map +1 -1
  529. package/dist/components/ui/toggle.js +1 -1
  530. package/dist/components/ui/toggle.js.map +1 -1
  531. package/dist/components/ui/tooltip.d.ts.map +1 -1
  532. package/dist/components/ui/tooltip.js +1 -1
  533. package/dist/components/ui/tooltip.js.map +1 -1
  534. package/dist/hooks/use-dismiss.d.ts +1 -1
  535. package/dist/hooks/use-dismiss.d.ts.map +1 -1
  536. package/dist/hooks/use-dismiss.js.map +1 -1
  537. package/dist/lib/command-search.d.ts +10 -0
  538. package/dist/lib/command-search.d.ts.map +1 -0
  539. package/dist/lib/command-search.js +52 -0
  540. package/dist/lib/command-search.js.map +1 -0
  541. package/package.json +10 -12
@@ -2,11 +2,11 @@
2
2
  import { useDismiss } from "../../hooks/use-dismiss.js";
3
3
  import { useHoverGesture } from "../../hooks/use-hover-gesture.js";
4
4
  import { useTapGesture } from "../../hooks/use-tap-gesture.js";
5
- import { EASE_OUT } from "../../lib/ease.js";
6
- import { cloneElement, isValidElement, useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
7
- import { cn } from "cn";
5
+ import { TooltipSurface } from "./tooltip-surface.js";
6
+ import { cloneElement, isValidElement, useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
7
+ import { cn } from "@kumix/utils";
8
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
- import { AnimatePresence, motion, useReducedMotion } from "motion/react";
9
+ import { AnimatePresence } from "motion/react";
10
10
  import { createPortal } from "react-dom";
11
11
  //#region src/components/motion/tooltip.tsx
12
12
  const GAP = 8;
@@ -22,109 +22,73 @@ const transformOrigin = {
22
22
  left: "right center",
23
23
  right: "left center"
24
24
  };
25
- const offsetFrom = {
26
- top: { y: 8 },
27
- bottom: { y: -8 },
28
- left: { x: 8 },
29
- right: { x: -8 }
30
- };
31
- function buildVariants(side) {
32
- const o = offsetFrom[side];
33
- return {
34
- initial: {
35
- opacity: 0,
36
- scale: .9,
37
- filter: "blur(5px)",
38
- x: o.x ?? 0,
39
- y: o.y ?? 0
40
- },
41
- animate: {
42
- opacity: 1,
43
- scale: 1,
44
- filter: "blur(0px)",
45
- x: 0,
46
- y: 0,
47
- transition: {
48
- type: "spring",
49
- stiffness: 380,
50
- damping: 30,
51
- mass: .7,
52
- opacity: {
53
- duration: .14,
54
- ease: EASE_OUT
55
- },
56
- filter: {
57
- duration: .18,
58
- ease: EASE_OUT
59
- }
60
- }
61
- },
62
- exit: {
63
- opacity: 0,
64
- scale: .94,
65
- filter: "blur(3px)",
66
- x: (o.x ?? 0) * .6,
67
- y: (o.y ?? 0) * .6,
68
- transition: {
69
- duration: .12,
70
- ease: EASE_OUT
71
- }
72
- }
73
- };
74
- }
75
- const REDUCED_VARIANTS = {
76
- initial: { opacity: 0 },
77
- animate: {
78
- opacity: 1,
79
- transition: {
80
- duration: .14,
81
- ease: EASE_OUT
82
- }
83
- },
84
- exit: {
85
- opacity: 0,
86
- transition: {
87
- duration: .1,
88
- ease: EASE_OUT
89
- }
90
- }
91
- };
92
25
  const WARM_WINDOW_MS = 300;
93
26
  let lastHiddenAt = 0;
94
- function Tooltip({ content, children, side = "top", delay = 120, className, wrapperClassName }) {
95
- const [open, setOpen] = useState(false);
27
+ function Tooltip({ content, children, side = "top", delay = 120, className, wrapperClassName, anchorRef: externalAnchorRef, anchorPoint, open: controlledOpen, onOpenChange, id: providedId }) {
28
+ const [internalOpen, setInternalOpen] = useState(false);
29
+ const open = controlledOpen ?? internalOpen;
30
+ const setOpen = useCallback((next) => {
31
+ if (controlledOpen === void 0) setInternalOpen(next);
32
+ onOpenChange?.(next);
33
+ }, [controlledOpen, onOpenChange]);
96
34
  const [coords, setCoords] = useState(null);
97
- const id = useId();
35
+ const generatedId = useId();
36
+ const id = providedId ?? generatedId;
98
37
  const timer = useRef(null);
99
- const anchorRef = useRef(null);
38
+ const wrapperRef = useRef(null);
39
+ const anchorRef = externalAnchorRef ?? wrapperRef;
100
40
  const hover = useHoverGesture();
101
- const reduce = useReducedMotion();
41
+ const surfaceRef = useRef(null);
102
42
  const place = useCallback(() => {
103
43
  const el = anchorRef.current;
104
44
  if (!el) return;
105
45
  const r = el.getBoundingClientRect();
106
- const cx = r.left + r.width / 2;
107
- const cy = r.top + r.height / 2;
108
- const point = {
46
+ const cx = r.left + r.width * (anchorPoint?.x ?? .5);
47
+ const cy = r.top + r.height * (anchorPoint?.y ?? .5);
48
+ const next = {
109
49
  top: {
110
- top: r.top - GAP,
50
+ top: (anchorPoint ? cy : r.top) - GAP,
111
51
  left: cx
112
52
  },
113
53
  bottom: {
114
- top: r.bottom + GAP,
54
+ top: (anchorPoint ? cy : r.bottom) + GAP,
115
55
  left: cx
116
56
  },
117
57
  left: {
118
58
  top: cy,
119
- left: r.left - GAP
59
+ left: (anchorPoint ? cx : r.left) - GAP
120
60
  },
121
61
  right: {
122
62
  top: cy,
123
- left: r.right + GAP
63
+ left: (anchorPoint ? cx : r.right) + GAP
124
64
  }
125
- };
126
- setCoords(point[side]);
127
- }, [side]);
65
+ }[side];
66
+ const width = surfaceRef.current?.offsetWidth ?? 0;
67
+ const height = surfaceRef.current?.offsetHeight ?? 0;
68
+ const dx = side === "left" ? width : side === "right" ? 0 : width / 2;
69
+ const dy = side === "top" ? height : side === "bottom" ? 0 : height / 2;
70
+ next.left = Math.max(GAP + dx, Math.min(next.left, window.innerWidth - GAP - width + dx));
71
+ next.top = Math.max(GAP + dy, Math.min(next.top, window.innerHeight - GAP - height + dy));
72
+ setCoords((previous) => previous?.top === next.top && previous.left === next.left ? previous : next);
73
+ }, [
74
+ side,
75
+ anchorRef,
76
+ anchorPoint
77
+ ]);
78
+ const positioned = coords !== null;
79
+ useLayoutEffect(() => {
80
+ if (!open) return;
81
+ place();
82
+ const observer = new ResizeObserver(place);
83
+ if (anchorRef.current) observer.observe(anchorRef.current);
84
+ if (positioned && surfaceRef.current) observer.observe(surfaceRef.current);
85
+ return () => observer.disconnect();
86
+ }, [
87
+ open,
88
+ place,
89
+ anchorRef,
90
+ positioned
91
+ ]);
128
92
  const show = useCallback(() => {
129
93
  if (timer.current) clearTimeout(timer.current);
130
94
  const warm = Date.now() - lastHiddenAt < WARM_WINDOW_MS;
@@ -132,7 +96,11 @@ function Tooltip({ content, children, side = "top", delay = 120, className, wrap
132
96
  place();
133
97
  setOpen(true);
134
98
  }, warm ? 0 : delay);
135
- }, [delay, place]);
99
+ }, [
100
+ delay,
101
+ place,
102
+ setOpen
103
+ ]);
136
104
  const hide = useCallback(() => {
137
105
  if (timer.current) {
138
106
  clearTimeout(timer.current);
@@ -140,7 +108,7 @@ function Tooltip({ content, children, side = "top", delay = 120, className, wrap
140
108
  }
141
109
  if (open) lastHiddenAt = Date.now();
142
110
  setOpen(false);
143
- }, [open]);
111
+ }, [open, setOpen]);
144
112
  const tap = useTapGesture();
145
113
  const toggleOnTap = useCallback(() => {
146
114
  const gesture = tap.take();
@@ -155,7 +123,8 @@ function Tooltip({ content, children, side = "top", delay = 120, className, wrap
155
123
  }, [
156
124
  hide,
157
125
  place,
158
- tap
126
+ tap,
127
+ setOpen
159
128
  ]);
160
129
  useDismiss(open, hide, anchorRef);
161
130
  useEffect(() => {
@@ -168,11 +137,13 @@ function Tooltip({ content, children, side = "top", delay = 120, className, wrap
168
137
  window.removeEventListener("resize", onMove);
169
138
  };
170
139
  }, [open, place]);
171
- const variants = useMemo(() => reduce ? REDUCED_VARIANTS : buildVariants(side), [reduce, side]);
172
- if (!isValidElement(children)) return children;
173
- const trigger = cloneElement(children, { "aria-describedby": id });
174
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
175
- ref: anchorRef,
140
+ useEffect(() => () => {
141
+ if (timer.current) clearTimeout(timer.current);
142
+ }, []);
143
+ if (!externalAnchorRef && !isValidElement(children)) return children;
144
+ const trigger = isValidElement(children) ? cloneElement(children, { "aria-describedby": id }) : null;
145
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [!externalAnchorRef ? /* @__PURE__ */ jsx("span", {
146
+ ref: wrapperRef,
176
147
  className: cn("relative inline-flex align-middle", wrapperClassName),
177
148
  onPointerEnter: (event) => {
178
149
  if (hover.enter(event)) show();
@@ -187,23 +158,23 @@ function Tooltip({ content, children, side = "top", delay = 120, className, wrap
187
158
  onKeyDown: tap.drop,
188
159
  onClick: toggleOnTap,
189
160
  children: trigger
190
- }), typeof document !== "undefined" ? createPortal(/* @__PURE__ */ jsx(AnimatePresence, { children: open && coords ? /* @__PURE__ */ jsx("span", {
191
- "aria-hidden": true,
161
+ }) : null, typeof document !== "undefined" ? createPortal(/* @__PURE__ */ jsx(AnimatePresence, { children: open && coords ? /* @__PURE__ */ jsx("span", {
192
162
  className: "pointer-events-none fixed z-9999",
193
163
  style: {
194
164
  top: coords.top,
195
165
  left: coords.left,
196
166
  transform: anchorTransform[side]
197
167
  },
198
- children: /* @__PURE__ */ jsx(motion.span, {
168
+ children: /* @__PURE__ */ jsx(TooltipSurface, {
169
+ ref: surfaceRef,
199
170
  id,
200
- role: "tooltip",
201
- variants,
202
- initial: "initial",
203
- animate: "animate",
204
- exit: "exit",
205
- style: { transformOrigin: transformOrigin[side] },
206
- className: cn("block whitespace-nowrap rounded-lg border border-border bg-background px-2.5 py-1 font-medium text-foreground text-xs shadow-lg", className),
171
+ side,
172
+ style: {
173
+ transformOrigin: transformOrigin[side],
174
+ maxWidth: "calc(100vw - 16px)",
175
+ whiteSpace: "normal"
176
+ },
177
+ className,
207
178
  children: content
208
179
  })
209
180
  }) : null }), document.body) : null] });
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","names":[],"sources":["../../../src/components/motion/tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n cloneElement,\n isValidElement,\n type PointerEvent,\n type ReactElement,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { cn } from \"cn\";\nimport { AnimatePresence, motion, useReducedMotion, type Variants } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { useDismiss } from \"../../hooks/use-dismiss\";\nimport { useHoverGesture } from \"../../hooks/use-hover-gesture\";\nimport { useTapGesture } from \"../../hooks/use-tap-gesture\";\nimport { EASE_OUT } from \"../../lib/ease\";\n\ntype Side = \"top\" | \"right\" | \"bottom\" | \"left\";\n\nexport interface TooltipProps {\n content: ReactNode;\n children: ReactElement;\n side?: Side;\n /** Delay before showing (ms). Default 120. */\n delay?: number;\n className?: string;\n /** Classes for the outer wrapper span. Use to fix baseline / fill parent. */\n wrapperClassName?: string;\n}\n\n// Gap between trigger and tooltip, in px.\nconst GAP = 8;\n\n// Centering transform for the fixed-positioned anchor point, per side.\nconst anchorTransform: Record<Side, string> = {\n top: \"translate(-50%, -100%)\",\n bottom: \"translate(-50%, 0)\",\n left: \"translate(-100%, -50%)\",\n right: \"translate(0, -50%)\",\n};\n\nconst transformOrigin: Record<Side, string> = {\n top: \"center bottom\",\n bottom: \"center top\",\n left: \"right center\",\n right: \"left center\",\n};\n\n// Offset is in the direction *away* from the trigger — content originates near\n// the trigger and rises into resting position.\nconst offsetFrom: Record<Side, { x?: number; y?: number }> = {\n top: { y: 8 },\n bottom: { y: -8 },\n left: { x: 8 },\n right: { x: -8 },\n};\n\nfunction buildVariants(side: Side): Variants {\n const o = offsetFrom[side];\n return {\n initial: {\n opacity: 0,\n scale: 0.9,\n filter: \"blur(5px)\",\n x: o.x ?? 0,\n y: o.y ?? 0,\n },\n animate: {\n opacity: 1,\n scale: 1,\n filter: \"blur(0px)\",\n x: 0,\n y: 0,\n transition: {\n type: \"spring\",\n stiffness: 380,\n damping: 30,\n mass: 0.7,\n opacity: { duration: 0.14, ease: EASE_OUT },\n filter: { duration: 0.18, ease: EASE_OUT },\n },\n },\n exit: {\n opacity: 0,\n scale: 0.94,\n filter: \"blur(3px)\",\n x: (o.x ?? 0) * 0.6,\n y: (o.y ?? 0) * 0.6,\n transition: { duration: 0.12, ease: EASE_OUT },\n },\n };\n}\n\nconst REDUCED_VARIANTS: Variants = {\n initial: { opacity: 0 },\n animate: { opacity: 1, transition: { duration: 0.14, ease: EASE_OUT } },\n exit: { opacity: 0, transition: { duration: 0.1, ease: EASE_OUT } },\n};\n\n// Once any tooltip has just closed, neighbouring tooltips open without the\n// initial delay — moving along a toolbar feels instant after the first one.\nconst WARM_WINDOW_MS = 300;\nlet lastHiddenAt = 0;\n\nexport function Tooltip({\n content,\n children,\n side = \"top\",\n delay = 120,\n className,\n wrapperClassName,\n}: TooltipProps) {\n const [open, setOpen] = useState(false);\n const [coords, setCoords] = useState<{ top: number; left: number } | null>(null);\n const id = useId();\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const anchorRef = useRef<HTMLSpanElement>(null);\n const hover = useHoverGesture();\n const reduce = useReducedMotion();\n\n // Anchor point in viewport coords, on the edge of the trigger facing `side`.\n // Position:fixed means these viewport coords place the tooltip directly, so\n // it escapes every ancestor's stacking context and overflow.\n const place = useCallback(() => {\n const el = anchorRef.current;\n if (!el) return;\n const r = el.getBoundingClientRect();\n const cx = r.left + r.width / 2;\n const cy = r.top + r.height / 2;\n const point: Record<Side, { top: number; left: number }> = {\n top: { top: r.top - GAP, left: cx },\n bottom: { top: r.bottom + GAP, left: cx },\n left: { top: cy, left: r.left - GAP },\n right: { top: cy, left: r.right + GAP },\n };\n setCoords(point[side]);\n }, [side]);\n\n const show = useCallback(() => {\n if (timer.current) clearTimeout(timer.current);\n const warm = Date.now() - lastHiddenAt < WARM_WINDOW_MS;\n timer.current = setTimeout(\n () => {\n place();\n setOpen(true);\n },\n warm ? 0 : delay,\n );\n }, [delay, place]);\n\n const hide = useCallback(() => {\n if (timer.current) {\n clearTimeout(timer.current);\n timer.current = null;\n }\n if (open) lastHiddenAt = Date.now();\n setOpen(false);\n }, [open]);\n\n // A finger never hovers, and Safari does not focus a button on tap either, so\n // the label is only reachable if the tap itself opens the tooltip. A click\n // carries no pointerType, so the pointerdown that preceded it is what says\n // whether this was a tap; keyboard activation arrives with no pointerdown at\n // all, and focus has already shown the label there.\n const tap = useTapGesture<boolean>();\n\n const toggleOnTap = useCallback(() => {\n const gesture = tap.take();\n if (!gesture || gesture.pointerType === \"mouse\") return;\n if (gesture.state) {\n hide();\n return;\n }\n if (timer.current) clearTimeout(timer.current);\n place();\n setOpen(true);\n }, [hide, place, tap]);\n\n // ...and closed again by the next tap that lands somewhere else. The label\n // covers nothing interactive, so that tap passes through to what it hit.\n useDismiss(open, hide, anchorRef);\n\n // Keep the tooltip pinned to the trigger while it's open and the page scrolls\n // or resizes (fixed coords are viewport-relative).\n useEffect(() => {\n if (!open) return;\n const onMove = () => place();\n window.addEventListener(\"scroll\", onMove, true);\n window.addEventListener(\"resize\", onMove);\n return () => {\n window.removeEventListener(\"scroll\", onMove, true);\n window.removeEventListener(\"resize\", onMove);\n };\n }, [open, place]);\n\n const variants = useMemo(() => (reduce ? REDUCED_VARIANTS : buildVariants(side)), [reduce, side]);\n\n if (!isValidElement(children)) return children;\n\n // The label describes the trigger, so it has to name the trigger itself.\n // Everything else the tooltip needs is read off the anchor below instead of\n // cloned on: a handler written onto the child is the child's handler as far\n // as that child can tell, and a component that owns its activation —\n // hard-wiring onClick and spreading the rest of its props over it, as\n // ThemeToggle does — then runs the tooltip's instead of its own. Composing\n // with `props.onClick` cannot save it either, because a component element's\n // props hold nothing the component does internally.\n const trigger = cloneElement(children as ReactElement<Record<string, unknown>>, {\n \"aria-describedby\": id,\n });\n\n return (\n <>\n <span\n ref={anchorRef}\n className={cn(\"relative inline-flex align-middle\", wrapperClassName)}\n // Pointer events, not the mouse pair: a tap fires compatibility\n // mouseenter/mouseleave that carry no pointerType, which raced the tap\n // path into opening and closing the same label.\n onPointerEnter={(event: PointerEvent) => {\n if (hover.enter(event)) show();\n }}\n onPointerLeave={(event: PointerEvent) => {\n if (hover.leave(event)) hide();\n }}\n onFocus={show}\n onBlur={hide}\n onPointerDown={(event: PointerEvent) => tap.start(event, open)}\n // A gesture the platform took away sends no click, and a key press\n // starts an activation that never had a pointer behind it. Either way\n // the record has to go, or the next click reads a finger that has long\n // since lifted.\n onPointerCancel={tap.drop}\n onKeyDown={tap.drop}\n onClick={toggleOnTap}\n >\n {trigger}\n </span>\n {typeof document !== \"undefined\"\n ? createPortal(\n <AnimatePresence>\n {open && coords ? (\n <span\n aria-hidden\n className=\"pointer-events-none fixed z-9999\"\n style={{\n top: coords.top,\n left: coords.left,\n transform: anchorTransform[side],\n }}\n >\n <motion.span\n id={id}\n role=\"tooltip\"\n variants={variants}\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n style={{ transformOrigin: transformOrigin[side] }}\n className={cn(\n \"block whitespace-nowrap rounded-lg border border-border bg-background px-2.5 py-1 font-medium text-foreground text-xs shadow-lg\",\n className,\n )}\n >\n {content}\n </motion.span>\n </span>\n ) : null}\n </AnimatePresence>,\n document.body,\n )\n : null}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;AAsCA,MAAM,MAAM;AAGZ,MAAM,kBAAwC;CAC5C,KAAK;CACL,QAAQ;CACR,MAAM;CACN,OAAO;AACT;AAEA,MAAM,kBAAwC;CAC5C,KAAK;CACL,QAAQ;CACR,MAAM;CACN,OAAO;AACT;AAIA,MAAM,aAAuD;CAC3D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"file":"tooltip.js","names":[],"sources":["../../../src/components/motion/tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n cloneElement,\n isValidElement,\n type PointerEvent,\n type ReactElement,\n type ReactNode,\n type RefObject,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport { AnimatePresence } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useDismiss } from \"../../hooks/use-dismiss\";\nimport { useHoverGesture } from \"../../hooks/use-hover-gesture\";\nimport { useTapGesture } from \"../../hooks/use-tap-gesture\";\nimport { TooltipSurface } from \"./tooltip-surface\";\n\ntype Side = \"top\" | \"right\" | \"bottom\" | \"left\";\n\nexport interface TooltipProps {\n content: ReactNode;\n children?: ReactElement;\n /** Existing trigger for controlled integrations such as chart cells. */\n anchorRef?: RefObject<HTMLElement | SVGElement | null>;\n /** Point within the anchor, as fractions of its rendered width and height. */\n anchorPoint?: { x: number; y: number };\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n id?: string;\n side?: Side;\n /** Delay before showing (ms). Default 120. */\n delay?: number;\n className?: string;\n /** Classes for the outer wrapper span. Use to fix baseline / fill parent. */\n wrapperClassName?: string;\n}\n\n// Gap between trigger and tooltip, in px.\nconst GAP = 8;\n\n// Centering transform for the fixed-positioned anchor point, per side.\nconst anchorTransform: Record<Side, string> = {\n top: \"translate(-50%, -100%)\",\n bottom: \"translate(-50%, 0)\",\n left: \"translate(-100%, -50%)\",\n right: \"translate(0, -50%)\",\n};\n\nconst transformOrigin: Record<Side, string> = {\n top: \"center bottom\",\n bottom: \"center top\",\n left: \"right center\",\n right: \"left center\",\n};\n\n// Once any tooltip has just closed, neighbouring tooltips open without the\n// initial delay — moving along a toolbar feels instant after the first one.\nconst WARM_WINDOW_MS = 300;\nlet lastHiddenAt = 0;\n\nexport function Tooltip({\n content,\n children,\n side = \"top\",\n delay = 120,\n className,\n wrapperClassName,\n anchorRef: externalAnchorRef,\n anchorPoint,\n open: controlledOpen,\n onOpenChange,\n id: providedId,\n}: TooltipProps) {\n const [internalOpen, setInternalOpen] = useState(false);\n const open = controlledOpen ?? internalOpen;\n const setOpen = useCallback(\n (next: boolean) => {\n if (controlledOpen === undefined) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [controlledOpen, onOpenChange],\n );\n const [coords, setCoords] = useState<{ top: number; left: number } | null>(null);\n const generatedId = useId();\n const id = providedId ?? generatedId;\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const wrapperRef = useRef<HTMLSpanElement>(null);\n const anchorRef = externalAnchorRef ?? wrapperRef;\n const hover = useHoverGesture();\n const surfaceRef = useRef<HTMLSpanElement>(null);\n\n // Anchor point in viewport coords, on the edge of the trigger facing `side`.\n // Position:fixed means these viewport coords place the tooltip directly, so\n // it escapes every ancestor's stacking context and overflow.\n const place = useCallback(() => {\n const el = anchorRef.current;\n if (!el) return;\n const r = el.getBoundingClientRect();\n const cx = r.left + r.width * (anchorPoint?.x ?? 0.5);\n const cy = r.top + r.height * (anchorPoint?.y ?? 0.5);\n const point: Record<Side, { top: number; left: number }> = {\n top: { top: (anchorPoint ? cy : r.top) - GAP, left: cx },\n bottom: { top: (anchorPoint ? cy : r.bottom) + GAP, left: cx },\n left: { top: cy, left: (anchorPoint ? cx : r.left) - GAP },\n right: { top: cy, left: (anchorPoint ? cx : r.right) + GAP },\n };\n const next = point[side];\n const width = surfaceRef.current?.offsetWidth ?? 0;\n const height = surfaceRef.current?.offsetHeight ?? 0;\n const dx = side === \"left\" ? width : side === \"right\" ? 0 : width / 2;\n const dy = side === \"top\" ? height : side === \"bottom\" ? 0 : height / 2;\n next.left = Math.max(GAP + dx, Math.min(next.left, window.innerWidth - GAP - width + dx));\n next.top = Math.max(GAP + dy, Math.min(next.top, window.innerHeight - GAP - height + dy));\n setCoords((previous) =>\n previous?.top === next.top && previous.left === next.left ? previous : next,\n );\n }, [side, anchorRef, anchorPoint]);\n\n const positioned = coords !== null;\n useLayoutEffect(() => {\n if (!open) return;\n place();\n const observer = new ResizeObserver(place);\n if (anchorRef.current) observer.observe(anchorRef.current);\n if (positioned && surfaceRef.current) observer.observe(surfaceRef.current);\n return () => observer.disconnect();\n }, [open, place, anchorRef, positioned]);\n\n const show = useCallback(() => {\n if (timer.current) clearTimeout(timer.current);\n const warm = Date.now() - lastHiddenAt < WARM_WINDOW_MS;\n timer.current = setTimeout(\n () => {\n place();\n setOpen(true);\n },\n warm ? 0 : delay,\n );\n }, [delay, place, setOpen]);\n\n const hide = useCallback(() => {\n if (timer.current) {\n clearTimeout(timer.current);\n timer.current = null;\n }\n if (open) lastHiddenAt = Date.now();\n setOpen(false);\n }, [open, setOpen]);\n\n // A finger never hovers, and Safari does not focus a button on tap either, so\n // the label is only reachable if the tap itself opens the tooltip. A click\n // carries no pointerType, so the pointerdown that preceded it is what says\n // whether this was a tap; keyboard activation arrives with no pointerdown at\n // all, and focus has already shown the label there.\n const tap = useTapGesture<boolean>();\n\n const toggleOnTap = useCallback(() => {\n const gesture = tap.take();\n if (!gesture || gesture.pointerType === \"mouse\") return;\n if (gesture.state) {\n hide();\n return;\n }\n if (timer.current) clearTimeout(timer.current);\n place();\n setOpen(true);\n }, [hide, place, tap, setOpen]);\n\n // ...and closed again by the next tap that lands somewhere else. The label\n // covers nothing interactive, so that tap passes through to what it hit.\n useDismiss(open, hide, anchorRef);\n\n // Keep the tooltip pinned to the trigger while it's open and the page scrolls\n // or resizes (fixed coords are viewport-relative).\n useEffect(() => {\n if (!open) return;\n const onMove = () => place();\n window.addEventListener(\"scroll\", onMove, true);\n window.addEventListener(\"resize\", onMove);\n return () => {\n window.removeEventListener(\"scroll\", onMove, true);\n window.removeEventListener(\"resize\", onMove);\n };\n }, [open, place]);\n\n useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current);\n },\n [],\n );\n\n if (!externalAnchorRef && !isValidElement(children)) return children;\n\n // The label describes the trigger, so it has to name the trigger itself.\n // Everything else the tooltip needs is read off the anchor below instead of\n // cloned on: a handler written onto the child is the child's handler as far\n // as that child can tell, and a component that owns its activation —\n // hard-wiring onClick and spreading the rest of its props over it, as\n // ThemeToggle does — then runs the tooltip's instead of its own. Composing\n // with `props.onClick` cannot save it either, because a component element's\n // props hold nothing the component does internally.\n const trigger = isValidElement(children)\n ? cloneElement(children as ReactElement<Record<string, unknown>>, {\n \"aria-describedby\": id,\n })\n : null;\n\n return (\n <>\n {!externalAnchorRef ? (\n <span\n ref={wrapperRef}\n className={cn(\"relative inline-flex align-middle\", wrapperClassName)}\n // Pointer events, not the mouse pair: a tap fires compatibility\n // mouseenter/mouseleave that carry no pointerType, which raced the tap\n // path into opening and closing the same label.\n onPointerEnter={(event: PointerEvent) => {\n if (hover.enter(event)) show();\n }}\n onPointerLeave={(event: PointerEvent) => {\n if (hover.leave(event)) hide();\n }}\n onFocus={show}\n onBlur={hide}\n onPointerDown={(event: PointerEvent) => tap.start(event, open)}\n // A gesture the platform took away sends no click, and a key press\n // starts an activation that never had a pointer behind it. Either way\n // the record has to go, or the next click reads a finger that has long\n // since lifted.\n onPointerCancel={tap.drop}\n onKeyDown={tap.drop}\n onClick={toggleOnTap}\n >\n {trigger}\n </span>\n ) : null}\n {typeof document !== \"undefined\"\n ? createPortal(\n <AnimatePresence>\n {open && coords ? (\n <span\n className=\"pointer-events-none fixed z-9999\"\n style={{\n top: coords.top,\n left: coords.left,\n transform: anchorTransform[side],\n }}\n >\n <TooltipSurface\n ref={surfaceRef}\n id={id}\n side={side}\n style={{\n transformOrigin: transformOrigin[side],\n maxWidth: \"calc(100vw - 16px)\",\n whiteSpace: \"normal\",\n }}\n className={className}\n >\n {content}\n </TooltipSurface>\n </span>\n ) : null}\n </AnimatePresence>,\n document.body,\n )\n : null}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;AA8CA,MAAM,MAAM;AAGZ,MAAM,kBAAwC;CAC5C,KAAK;CACL,QAAQ;CACR,MAAM;CACN,OAAO;AACT;AAEA,MAAM,kB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,QAAD;EACE,WAAU;EACV,OAAO;GACL,KAAK,OAAO;GACZ,MAAM,OAAO;GACb,WAAW,gBAAgB;EAC7B;EAEA,UAAA,oBAAC,gBAAD;GACE,KAAK;GACD;GACE;GACN,OAAO;IACL,iBAAiB,gBAAgB;IACjC,UAAU;IACV,YAAY;GACd;GACW;GAEV,UAAA;EACa,CAAA;CACZ,CAAA,IACJ,KACW,CAAA,GACjB,SAAS,IACX,IACA,IACJ,EAAA,CAAA;AAEN"}
@@ -2,7 +2,7 @@
2
2
  import { TOUCH_GESTURE_CLASS, capturePointer, releasePointer } from "../../lib/touch.js";
3
3
  import { createTickPlayer } from "../../lib/tick-sound.js";
4
4
  import { useCallback, useEffect, useMemo, 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 { useReducedMotion } from "motion/react";
8
8
  //#region src/components/motion/wheel-picker.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"wheel-picker.js","names":[],"sources":["../../../src/components/motion/wheel-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type KeyboardEvent,\n type PointerEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { cn } from \"cn\";\nimport { useReducedMotion } from \"motion/react\";\n\nimport { createTickPlayer } from \"../../lib/tick-sound\";\nimport { capturePointer, releasePointer, TOUCH_GESTURE_CLASS } from \"../../lib/touch\";\n\nexport type WheelPickerOption = string | { label: string; value: string };\n\nexport interface WheelPickerProps {\n options: WheelPickerOption[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Rows visible through the window, odd. More = flatter curve. Default 5. */\n visibleCount?: number;\n /** Row height in px. Default 36. */\n itemHeight?: number;\n disabled?: boolean;\n /** Play a short tick each time the selected value changes. Default false. */\n sound?: boolean;\n className?: string;\n \"aria-label\"?: string;\n}\n\nconst DEG = Math.PI / 180;\n// Physics constants, tuned for an iOS-like flick rather than reused from the\n// shared spring tokens: the wheel coasts in whole-row units and springs to an\n// integer detent, which a layout spring can't express cleanly.\nconst DECELERATION = 0.00042; // rows per ms², how fast a flick bleeds off (lower = freer)\nconst MAX_VELOCITY = 0.18; // rows per ms, caps a hard fling\nconst VELOCITY_WINDOW = 90; // ms of recent drag to average a release velocity over\nconst WHEEL_SENS = 0.012; // rows per pixel of wheel delta\nconst WHEEL_SETTLE = 110; // ms of wheel idle before snapping to a row\nconst easeOutCubic = (p: number) => 1 - (1 - p) ** 3;\n// Overshoots the target by a few percent then settles — the little spring\n// bounce as a row snaps home. `BACK` sets how far it drifts past.\nconst BACK = 1.35;\nconst easeOutBack = (p: number) => 1 + (BACK + 1) * (p - 1) ** 3 + BACK * (p - 1) ** 2;\n\nconst clamp = (v: number, lo: number, hi: number) => Math.max(lo, Math.min(v, hi));\n\nfunction optionValue(option: WheelPickerOption) {\n return typeof option === \"string\" ? option : option.value;\n}\nfunction optionLabel(option: WheelPickerOption) {\n return typeof option === \"string\" ? option : option.label;\n}\n\nexport function WheelPicker({\n options,\n value,\n defaultValue,\n onValueChange,\n visibleCount = 5,\n itemHeight = 36,\n disabled = false,\n sound = false,\n className,\n \"aria-label\": ariaLabel,\n}: WheelPickerProps) {\n const reduce = useReducedMotion() ?? false;\n const controlled = value !== undefined;\n const last = options.length - 1;\n\n const indexOf = useCallback(\n (v: string | undefined) => {\n const i = options.findIndex((o) => optionValue(o) === v);\n return i < 0 ? 0 : i;\n },\n [options],\n );\n\n const [internal, setInternal] = useState(() => defaultValue ?? value);\n const currentValue = controlled ? value : internal;\n const [grabbing, setGrabbing] = useState(false);\n\n // Cylinder geometry. Each row spans `itemAngle`; `radius` seats the rows on\n // the drum; rows past `hideBeyond` sit behind the horizon and are dropped.\n const { itemAngle, radius, height, hideBeyond } = useMemo(() => {\n const rowsEachSide = Math.max(1, Math.floor(visibleCount / 2));\n const cutoff = rowsEachSide + 1;\n const angle = 90 / cutoff;\n const r = itemHeight / Math.tan(angle * DEG);\n return {\n itemAngle: angle,\n radius: r,\n hideBeyond: cutoff,\n height: Math.round(2 * r * Math.sin(rowsEachSide * angle * DEG) + itemHeight),\n };\n }, [visibleCount, itemHeight]);\n\n const container = useRef<HTMLDivElement>(null);\n const drumRef = useRef<HTMLUListElement>(null);\n const bandRef = useRef<HTMLUListElement>(null);\n // Scroll position measured in rows (a float index). One source of truth for\n // both layers: the drum rotates by `itemAngle·scroll`, the crisp band slides\n // by `itemHeight·scroll`.\n const scroll = useRef(indexOf(currentValue));\n const raf = useRef(0);\n const emitted = useRef(currentValue);\n const tickPlayer = useRef<ReturnType<typeof createTickPlayer> | null>(null);\n const lastTick = useRef(indexOf(currentValue));\n\n const paint = useCallback(\n (s: number) => {\n const drum = drumRef.current;\n const band = bandRef.current;\n if (drum) {\n drum.style.transform = `translateZ(${-radius}px) rotateX(${itemAngle * s}deg)`;\n for (const node of Array.from(drum.children)) {\n const li = node as HTMLLIElement;\n const i = Number(li.dataset.index);\n const want = Math.abs(i - s) > hideBeyond ? \"hidden\" : \"visible\";\n // Write only on change — an unconditional write every frame thrashes\n // style recalc and is what made the drag feel draggy on mobile.\n if (li.style.visibility !== want) li.style.visibility = want;\n }\n }\n // The band is the SAME drum, clipped to the centre row — driven by the\n // identical transform so the crisp copy sits exactly on the dimmed one,\n // with no parallax ghost as rows cross the window. It needs the same\n // horizon cull, or the row on the back of the drum bleeds into the front.\n if (band) {\n band.style.transform = `translateZ(${-radius}px) rotateX(${itemAngle * s}deg)`;\n for (const node of Array.from(band.children)) {\n const li = node as HTMLLIElement;\n const i = Number(li.dataset.index);\n const want = Math.abs(i - s) > hideBeyond ? \"hidden\" : \"visible\";\n if (li.style.visibility !== want) li.style.visibility = want;\n }\n }\n },\n [radius, itemAngle, hideBeyond],\n );\n\n const getPlayer = useCallback(() => {\n if (!tickPlayer.current) tickPlayer.current = createTickPlayer();\n return tickPlayer.current;\n }, []);\n\n const emit = useCallback(\n (i: number) => {\n const v = optionValue(options[clamp(i, 0, last)]);\n if (v === emitted.current) return;\n emitted.current = v;\n // Reduced motion has no drum/glide path to tick from — it's an\n // onClick straight into emit, so the tick lives here instead.\n if (sound && reduce) getPlayer().play();\n if (!controlled) setInternal(v);\n onValueChange?.(v);\n },\n [options, last, controlled, onValueChange, sound, reduce, getPlayer],\n );\n\n // Drum path: fires a tick whenever the nearest row changes, independent of\n // `emit` (which only fires on settle during a glide/fling, not per row\n // crossed). Gated on `!reduce` since the reduced render never calls this.\n const maybeTick = useCallback(\n (pos: number) => {\n const row = clamp(Math.round(pos), 0, last);\n if (!sound || reduce) {\n lastTick.current = row;\n return;\n }\n if (row === lastTick.current) return;\n lastTick.current = row;\n getPlayer().play();\n },\n [sound, reduce, last, getPlayer],\n );\n\n const stop = useCallback(() => cancelAnimationFrame(raf.current), []);\n\n // Ease `scroll` from where it is to an integer detent over `duration`. The\n // easing may overshoot (spring bounce) before it resolves exactly on `to`.\n const glide = useCallback(\n (to: number, duration: number, ease: (p: number) => number = easeOutCubic) => {\n stop();\n const from = scroll.current;\n const dist = to - from;\n if (!dist || duration <= 0) {\n scroll.current = to;\n paint(to);\n maybeTick(to);\n emit(to);\n return;\n }\n const start = performance.now();\n const tick = (now: number) => {\n const p = (now - start) / duration;\n if (p >= 1) {\n scroll.current = to;\n paint(to);\n maybeTick(to);\n emit(to);\n return;\n }\n scroll.current = from + dist * ease(p);\n paint(scroll.current);\n maybeTick(scroll.current);\n raf.current = requestAnimationFrame(tick);\n };\n raf.current = requestAnimationFrame(tick);\n },\n [stop, paint, emit, maybeTick],\n );\n\n // Project where a flick of `velocity` (rows/ms) coasts to, snap to a row.\n const fling = useCallback(\n (velocity: number) => {\n const from = scroll.current;\n if (from < 0 || from > last) {\n glide(clamp(Math.round(from), 0, last), 260); // rubber-band back\n return;\n }\n const dir = Math.sign(velocity);\n const coast = ((velocity * velocity) / (2 * DECELERATION)) * dir;\n const to = clamp(Math.round(from + coast), 0, last);\n // Long, spring-tipped settle so a hard flick reads as free momentum\n // coasting to rest with a gentle bounce, never a clipped stop.\n const duration = clamp(Math.sqrt(Math.abs(to - from)) * 300 + 240, 280, 1700);\n glide(to, duration, easeOutBack);\n },\n [glide, last],\n );\n\n const step = useCallback(\n (by: number) => glide(clamp(Math.round(scroll.current) + by, 0, last), 300, easeOutBack),\n [glide, last],\n );\n\n // Drag: track recent points for a release velocity; rubber-band past the ends.\n const drag = useRef<{\n y: number;\n scroll: number;\n pts: [number, number][];\n } | null>(null);\n // Coalesce touch/pointer moves to one paint per animation frame — raw move\n // events fire several times per frame (and off-frame) on high-refresh\n // screens, and painting each one is what made the drag feel choppy.\n const dragFrame = useRef(0);\n const latestY = useRef(0);\n // Shared drag core, driven by a Y coordinate from either a mouse pointer or a\n // native touch. Touch is bound with non-passive listeners in the effect below\n // so the move can preventDefault the page scroll — React's synthetic touch\n // events are passive and can't, which is why finger-drag did nothing on\n // mobile.\n const beginDrag = useCallback(\n (y: number) => {\n stop();\n if (sound) getPlayer().prepare();\n setGrabbing(true);\n drag.current = {\n y,\n scroll: scroll.current,\n pts: [[y, performance.now()]],\n };\n },\n [stop, sound, getPlayer],\n );\n const moveDrag = useCallback(\n (y: number) => {\n const d = drag.current;\n if (!d) return;\n // Record every sample for an accurate release velocity, but only render\n // the newest position once per frame.\n latestY.current = y;\n d.pts.push([y, performance.now()]);\n if (d.pts.length > 8) d.pts.shift();\n if (dragFrame.current) return;\n dragFrame.current = requestAnimationFrame(() => {\n dragFrame.current = 0;\n const dd = drag.current;\n if (!dd) return;\n let next = dd.scroll + (dd.y - latestY.current) / itemHeight;\n if (next < 0) next *= 0.3;\n else if (next > last) next = last + (next - last) * 0.3;\n scroll.current = next;\n paint(next);\n maybeTick(next);\n emit(Math.round(clamp(next, 0, last)));\n });\n },\n [itemHeight, last, paint, emit, maybeTick],\n );\n const endDrag = useCallback(() => {\n const d = drag.current;\n if (!d) return;\n if (dragFrame.current) {\n cancelAnimationFrame(dragFrame.current);\n dragFrame.current = 0;\n }\n drag.current = null;\n setGrabbing(false);\n // Average velocity over the last `VELOCITY_WINDOW` ms of movement rather\n // than the final two samples — a single noisy frame otherwise makes an\n // even flick feel like it caught or slipped.\n const pts = d.pts;\n let v = 0;\n if (pts.length > 1) {\n const latest = pts[pts.length - 1];\n let ref = pts[0];\n for (const p of pts) {\n if (latest[1] - p[1] <= VELOCITY_WINDOW) {\n ref = p;\n break;\n }\n }\n const dt = latest[1] - ref[1];\n if (dt > 0) {\n const raw = (ref[0] - latest[0]) / itemHeight / dt;\n v = clamp(raw, -MAX_VELOCITY, MAX_VELOCITY);\n }\n }\n fling(v);\n }, [itemHeight, fling]);\n\n // Mouse / pen only — touch runs through the native listeners in the effect.\n const onPointerDown = useCallback(\n (event: PointerEvent<HTMLDivElement>) => {\n if (disabled || reduce || event.pointerType === \"touch\") return;\n beginDrag(event.clientY);\n capturePointer(event.currentTarget, event.pointerId);\n },\n [disabled, reduce, beginDrag],\n );\n const onPointerMove = useCallback(\n (event: PointerEvent<HTMLDivElement>) => {\n if (event.pointerType === \"touch\") return;\n moveDrag(event.clientY);\n },\n [moveDrag],\n );\n const onPointerUp = useCallback(\n (event: PointerEvent<HTMLDivElement>) => {\n if (event.pointerType === \"touch\") return;\n // Also the pointercancel handler, where the capture is already gone —\n // an unguarded release throws there and the drum never settles.\n releasePointer(event.currentTarget, event.pointerId);\n endDrag();\n },\n [endDrag],\n );\n\n // Wheel drives `scroll` continuously — like a drag — then snaps once it goes\n // idle. Firing a fresh eased step per notch instead stacks overlapping\n // animations that keep interrupting each other, which read as lag.\n const wheelSnap = useRef<ReturnType<typeof setTimeout> | null>(null);\n const onWheel = useCallback(\n (event: globalThis.WheelEvent) => {\n // Native (non-passive) so preventDefault actually stops the page from\n // scrolling behind the wheel — React's synthetic wheel listener is\n // passive, so a handler on the element cannot cancel the scroll.\n if (disabled || reduce) return;\n event.preventDefault();\n if (sound) getPlayer().prepare();\n stop();\n const px = event.deltaMode === 1 ? event.deltaY * 16 : event.deltaY;\n const next = clamp(scroll.current + px * WHEEL_SENS, 0, last);\n scroll.current = next;\n paint(next);\n maybeTick(next);\n emit(Math.round(next));\n if (wheelSnap.current) clearTimeout(wheelSnap.current);\n wheelSnap.current = setTimeout(() => {\n glide(clamp(Math.round(scroll.current), 0, last), 240, easeOutBack);\n }, WHEEL_SETTLE);\n },\n [disabled, reduce, sound, last, paint, emit, stop, glide, maybeTick, getPlayer],\n );\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (disabled) return;\n const at = Math.round(scroll.current);\n const map: Record<string, number> = {\n ArrowUp: -1,\n ArrowDown: 1,\n Home: -at,\n End: last - at,\n };\n if (event.key in map) {\n event.preventDefault();\n if (sound) getPlayer().prepare();\n step(map[event.key]);\n }\n },\n [disabled, sound, last, step, getPlayer],\n );\n\n // Paint the starting frame, and follow controlled/value changes from outside\n // unless a gesture is mid-flight.\n useEffect(() => {\n if (drag.current) return;\n const target = indexOf(currentValue);\n emitted.current = currentValue;\n if (Math.abs(Math.round(scroll.current) - target) < 0.001) {\n paint(scroll.current);\n return;\n }\n glide(target, 260);\n }, [currentValue, indexOf, paint, glide]);\n\n useEffect(\n () => () => {\n cancelAnimationFrame(raf.current);\n cancelAnimationFrame(dragFrame.current);\n if (wheelSnap.current) clearTimeout(wheelSnap.current);\n tickPlayer.current?.dispose();\n },\n [],\n );\n\n // Native touch + wheel listeners, bound non-passively so touchmove and wheel\n // can block the page from scrolling while the wheel spins. React's synthetic\n // touch/wheel handlers are passive, so preventDefault there is a no-op and the\n // gesture scrolls the page instead of driving the drum.\n useEffect(() => {\n const el = container.current;\n if (!el || reduce || disabled) return;\n const onStart = (e: TouchEvent) => {\n const t = e.touches[0];\n if (t) beginDrag(t.clientY);\n };\n const onMove = (e: TouchEvent) => {\n const t = e.touches[0];\n if (!t || !drag.current) return;\n e.preventDefault();\n moveDrag(t.clientY);\n };\n const onEnd = () => endDrag();\n el.addEventListener(\"touchstart\", onStart, { passive: true });\n el.addEventListener(\"touchmove\", onMove, { passive: false });\n el.addEventListener(\"touchend\", onEnd);\n el.addEventListener(\"touchcancel\", onEnd);\n el.addEventListener(\"wheel\", onWheel, { passive: false });\n return () => {\n el.removeEventListener(\"touchstart\", onStart);\n el.removeEventListener(\"touchmove\", onMove);\n el.removeEventListener(\"touchend\", onEnd);\n el.removeEventListener(\"touchcancel\", onEnd);\n el.removeEventListener(\"wheel\", onWheel);\n };\n }, [reduce, disabled, beginDrag, moveDrag, endDrag, onWheel]);\n\n const maskFade =\n \"[mask-image:linear-gradient(to_bottom,transparent,#000_22%,#000_78%,transparent)]\";\n\n if (reduce) {\n const pad = (height - itemHeight) / 2;\n return (\n <div\n className={cn(\n \"relative overflow-hidden rounded-2xl border border-border bg-card\",\n disabled && \"pointer-events-none opacity-50\",\n className,\n )}\n style={{ height }}\n >\n <div\n className=\"pointer-events-none absolute inset-x-0 top-1/2 z-10 -translate-y-1/2 border-border border-y bg-foreground/4\"\n style={{ height: itemHeight }}\n />\n <ul\n className={cn(\n \"h-full snap-y snap-mandatory overflow-y-auto scroll-smooth [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n maskFade,\n )}\n style={{ paddingTop: pad, paddingBottom: pad }}\n >\n {options.map((option) => {\n const v = optionValue(option);\n return (\n <li key={v} className=\"snap-center\">\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => emit(options.indexOf(option))}\n className={cn(\n \"flex w-full items-center justify-center font-medium\",\n v === currentValue ? \"text-foreground\" : \"text-muted-foreground\",\n )}\n style={{ height: itemHeight }}\n >\n {optionLabel(option)}\n </button>\n </li>\n );\n })}\n </ul>\n </div>\n );\n }\n\n return (\n <div\n ref={container}\n role=\"listbox\"\n aria-label={ariaLabel}\n tabIndex={disabled ? -1 : 0}\n onKeyDown={onKeyDown}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n onPointerCancel={onPointerUp}\n className={cn(\n \"relative touch-none overflow-hidden rounded-2xl border border-border bg-card outline-none focus-visible:ring-2 focus-visible:ring-foreground/20\",\n // The drum owns the whole gesture; iOS must not open its callout or\n // start a drag out of the same press and cancel ours.\n TOUCH_GESTURE_CLASS,\n grabbing ? \"cursor-grabbing\" : \"cursor-grab\",\n disabled && \"pointer-events-none opacity-50\",\n maskFade,\n className,\n )}\n style={{ height, perspective: 1000 }}\n >\n {/* Curved drum of dimmed rows. */}\n <ul\n ref={drumRef}\n aria-hidden\n className=\"backface-hidden transform-3d absolute inset-x-0 top-1/2 m-0 h-0 list-none p-0 will-change-transform\"\n >\n {options.map((option, i) => (\n <li\n key={optionValue(option)}\n data-index={i}\n className=\"absolute inset-x-0 flex items-center justify-center font-medium text-muted-foreground\"\n style={{\n top: -itemHeight / 2,\n height: itemHeight,\n transform: `rotateX(${-itemAngle * i}deg) translateZ(${radius}px)`,\n }}\n >\n {optionLabel(option)}\n </li>\n ))}\n </ul>\n\n {/* Center band: the very same drum, clipped to one row and drawn crisp.\n Its own perspective, centred on the container middle, matches the main\n drum's projection so the two copies register exactly. */}\n <div\n className=\"pointer-events-none absolute inset-x-0 top-1/2 z-10 -translate-y-1/2 overflow-hidden rounded-md bg-foreground/4\"\n style={{ height: itemHeight, perspective: 1000 }}\n >\n <ul\n ref={bandRef}\n aria-hidden\n className=\"backface-hidden transform-3d absolute inset-x-0 top-1/2 m-0 h-0 list-none p-0 will-change-transform\"\n >\n {options.map((option, i) => (\n <li\n key={optionValue(option)}\n data-index={i}\n className=\"absolute inset-x-0 flex items-center justify-center font-medium text-foreground\"\n style={{\n top: -itemHeight / 2,\n height: itemHeight,\n transform: `rotateX(${-itemAngle * i}deg) translateZ(${radius}px)`,\n }}\n >\n {optionLabel(option)}\n </li>\n ))}\n </ul>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAmCA,MAAM,MAAM,KAAK,KAAK;AAItB,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,aAAa;AACnB,MAAM,eAAe;A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MAAD;IACE,KAAK;IACL,eAAA;IACA,WAAU;IAET,UAAA,QAAQ,KAAK,QAAQ,MACpB,oBAAC,MAAD;KAEE,cAAY;KACZ,WAAU;KACV,OAAO;MACL,KAAK,CAAC,aAAa;MACnB,QAAQ;MACR,WAAW,WAAW,CAAC,YAAY,EAAE,kBAAkB,OAAO;KAChE;KAEC,UAAA,YAAY,MAAM;IACjB,GAVG,YAAY,MAAM,CAUrB,CACL;GACC,CAAA;EACD,CAAA,CACF;;AAET"}
1
+ {"version":3,"file":"wheel-picker.js","names":[],"sources":["../../../src/components/motion/wheel-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type KeyboardEvent,\n type PointerEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { createTickPlayer } from \"../../lib/tick-sound\";\nimport { capturePointer, releasePointer, TOUCH_GESTURE_CLASS } from \"../../lib/touch\";\n\nexport type WheelPickerOption = string | { label: string; value: string };\n\nexport interface WheelPickerProps {\n options: WheelPickerOption[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Rows visible through the window, odd. More = flatter curve. Default 5. */\n visibleCount?: number;\n /** Row height in px. Default 36. */\n itemHeight?: number;\n disabled?: boolean;\n /** Play a short tick each time the selected value changes. Default false. */\n sound?: boolean;\n className?: string;\n \"aria-label\"?: string;\n}\n\nconst DEG = Math.PI / 180;\n// Physics constants, tuned for an iOS-like flick rather than reused from the\n// shared spring tokens: the wheel coasts in whole-row units and springs to an\n// integer detent, which a layout spring can't express cleanly.\nconst DECELERATION = 0.00042; // rows per ms², how fast a flick bleeds off (lower = freer)\nconst MAX_VELOCITY = 0.18; // rows per ms, caps a hard fling\nconst VELOCITY_WINDOW = 90; // ms of recent drag to average a release velocity over\nconst WHEEL_SENS = 0.012; // rows per pixel of wheel delta\nconst WHEEL_SETTLE = 110; // ms of wheel idle before snapping to a row\nconst easeOutCubic = (p: number) => 1 - (1 - p) ** 3;\n// Overshoots the target by a few percent then settles — the little spring\n// bounce as a row snaps home. `BACK` sets how far it drifts past.\nconst BACK = 1.35;\nconst easeOutBack = (p: number) => 1 + (BACK + 1) * (p - 1) ** 3 + BACK * (p - 1) ** 2;\n\nconst clamp = (v: number, lo: number, hi: number) => Math.max(lo, Math.min(v, hi));\n\nfunction optionValue(option: WheelPickerOption) {\n return typeof option === \"string\" ? option : option.value;\n}\nfunction optionLabel(option: WheelPickerOption) {\n return typeof option === \"string\" ? option : option.label;\n}\n\nexport function WheelPicker({\n options,\n value,\n defaultValue,\n onValueChange,\n visibleCount = 5,\n itemHeight = 36,\n disabled = false,\n sound = false,\n className,\n \"aria-label\": ariaLabel,\n}: WheelPickerProps) {\n const reduce = useReducedMotion() ?? false;\n const controlled = value !== undefined;\n const last = options.length - 1;\n\n const indexOf = useCallback(\n (v: string | undefined) => {\n const i = options.findIndex((o) => optionValue(o) === v);\n return i < 0 ? 0 : i;\n },\n [options],\n );\n\n const [internal, setInternal] = useState(() => defaultValue ?? value);\n const currentValue = controlled ? value : internal;\n const [grabbing, setGrabbing] = useState(false);\n\n // Cylinder geometry. Each row spans `itemAngle`; `radius` seats the rows on\n // the drum; rows past `hideBeyond` sit behind the horizon and are dropped.\n const { itemAngle, radius, height, hideBeyond } = useMemo(() => {\n const rowsEachSide = Math.max(1, Math.floor(visibleCount / 2));\n const cutoff = rowsEachSide + 1;\n const angle = 90 / cutoff;\n const r = itemHeight / Math.tan(angle * DEG);\n return {\n itemAngle: angle,\n radius: r,\n hideBeyond: cutoff,\n height: Math.round(2 * r * Math.sin(rowsEachSide * angle * DEG) + itemHeight),\n };\n }, [visibleCount, itemHeight]);\n\n const container = useRef<HTMLDivElement>(null);\n const drumRef = useRef<HTMLUListElement>(null);\n const bandRef = useRef<HTMLUListElement>(null);\n // Scroll position measured in rows (a float index). One source of truth for\n // both layers: the drum rotates by `itemAngle·scroll`, the crisp band slides\n // by `itemHeight·scroll`.\n const scroll = useRef(indexOf(currentValue));\n const raf = useRef(0);\n const emitted = useRef(currentValue);\n const tickPlayer = useRef<ReturnType<typeof createTickPlayer> | null>(null);\n const lastTick = useRef(indexOf(currentValue));\n\n const paint = useCallback(\n (s: number) => {\n const drum = drumRef.current;\n const band = bandRef.current;\n if (drum) {\n drum.style.transform = `translateZ(${-radius}px) rotateX(${itemAngle * s}deg)`;\n for (const node of Array.from(drum.children)) {\n const li = node as HTMLLIElement;\n const i = Number(li.dataset.index);\n const want = Math.abs(i - s) > hideBeyond ? \"hidden\" : \"visible\";\n // Write only on change — an unconditional write every frame thrashes\n // style recalc and is what made the drag feel draggy on mobile.\n if (li.style.visibility !== want) li.style.visibility = want;\n }\n }\n // The band is the SAME drum, clipped to the centre row — driven by the\n // identical transform so the crisp copy sits exactly on the dimmed one,\n // with no parallax ghost as rows cross the window. It needs the same\n // horizon cull, or the row on the back of the drum bleeds into the front.\n if (band) {\n band.style.transform = `translateZ(${-radius}px) rotateX(${itemAngle * s}deg)`;\n for (const node of Array.from(band.children)) {\n const li = node as HTMLLIElement;\n const i = Number(li.dataset.index);\n const want = Math.abs(i - s) > hideBeyond ? \"hidden\" : \"visible\";\n if (li.style.visibility !== want) li.style.visibility = want;\n }\n }\n },\n [radius, itemAngle, hideBeyond],\n );\n\n const getPlayer = useCallback(() => {\n if (!tickPlayer.current) tickPlayer.current = createTickPlayer();\n return tickPlayer.current;\n }, []);\n\n const emit = useCallback(\n (i: number) => {\n const v = optionValue(options[clamp(i, 0, last)]);\n if (v === emitted.current) return;\n emitted.current = v;\n // Reduced motion has no drum/glide path to tick from — it's an\n // onClick straight into emit, so the tick lives here instead.\n if (sound && reduce) getPlayer().play();\n if (!controlled) setInternal(v);\n onValueChange?.(v);\n },\n [options, last, controlled, onValueChange, sound, reduce, getPlayer],\n );\n\n // Drum path: fires a tick whenever the nearest row changes, independent of\n // `emit` (which only fires on settle during a glide/fling, not per row\n // crossed). Gated on `!reduce` since the reduced render never calls this.\n const maybeTick = useCallback(\n (pos: number) => {\n const row = clamp(Math.round(pos), 0, last);\n if (!sound || reduce) {\n lastTick.current = row;\n return;\n }\n if (row === lastTick.current) return;\n lastTick.current = row;\n getPlayer().play();\n },\n [sound, reduce, last, getPlayer],\n );\n\n const stop = useCallback(() => cancelAnimationFrame(raf.current), []);\n\n // Ease `scroll` from where it is to an integer detent over `duration`. The\n // easing may overshoot (spring bounce) before it resolves exactly on `to`.\n const glide = useCallback(\n (to: number, duration: number, ease: (p: number) => number = easeOutCubic) => {\n stop();\n const from = scroll.current;\n const dist = to - from;\n if (!dist || duration <= 0) {\n scroll.current = to;\n paint(to);\n maybeTick(to);\n emit(to);\n return;\n }\n const start = performance.now();\n const tick = (now: number) => {\n const p = (now - start) / duration;\n if (p >= 1) {\n scroll.current = to;\n paint(to);\n maybeTick(to);\n emit(to);\n return;\n }\n scroll.current = from + dist * ease(p);\n paint(scroll.current);\n maybeTick(scroll.current);\n raf.current = requestAnimationFrame(tick);\n };\n raf.current = requestAnimationFrame(tick);\n },\n [stop, paint, emit, maybeTick],\n );\n\n // Project where a flick of `velocity` (rows/ms) coasts to, snap to a row.\n const fling = useCallback(\n (velocity: number) => {\n const from = scroll.current;\n if (from < 0 || from > last) {\n glide(clamp(Math.round(from), 0, last), 260); // rubber-band back\n return;\n }\n const dir = Math.sign(velocity);\n const coast = ((velocity * velocity) / (2 * DECELERATION)) * dir;\n const to = clamp(Math.round(from + coast), 0, last);\n // Long, spring-tipped settle so a hard flick reads as free momentum\n // coasting to rest with a gentle bounce, never a clipped stop.\n const duration = clamp(Math.sqrt(Math.abs(to - from)) * 300 + 240, 280, 1700);\n glide(to, duration, easeOutBack);\n },\n [glide, last],\n );\n\n const step = useCallback(\n (by: number) => glide(clamp(Math.round(scroll.current) + by, 0, last), 300, easeOutBack),\n [glide, last],\n );\n\n // Drag: track recent points for a release velocity; rubber-band past the ends.\n const drag = useRef<{\n y: number;\n scroll: number;\n pts: [number, number][];\n } | null>(null);\n // Coalesce touch/pointer moves to one paint per animation frame — raw move\n // events fire several times per frame (and off-frame) on high-refresh\n // screens, and painting each one is what made the drag feel choppy.\n const dragFrame = useRef(0);\n const latestY = useRef(0);\n // Shared drag core, driven by a Y coordinate from either a mouse pointer or a\n // native touch. Touch is bound with non-passive listeners in the effect below\n // so the move can preventDefault the page scroll — React's synthetic touch\n // events are passive and can't, which is why finger-drag did nothing on\n // mobile.\n const beginDrag = useCallback(\n (y: number) => {\n stop();\n if (sound) getPlayer().prepare();\n setGrabbing(true);\n drag.current = {\n y,\n scroll: scroll.current,\n pts: [[y, performance.now()]],\n };\n },\n [stop, sound, getPlayer],\n );\n const moveDrag = useCallback(\n (y: number) => {\n const d = drag.current;\n if (!d) return;\n // Record every sample for an accurate release velocity, but only render\n // the newest position once per frame.\n latestY.current = y;\n d.pts.push([y, performance.now()]);\n if (d.pts.length > 8) d.pts.shift();\n if (dragFrame.current) return;\n dragFrame.current = requestAnimationFrame(() => {\n dragFrame.current = 0;\n const dd = drag.current;\n if (!dd) return;\n let next = dd.scroll + (dd.y - latestY.current) / itemHeight;\n if (next < 0) next *= 0.3;\n else if (next > last) next = last + (next - last) * 0.3;\n scroll.current = next;\n paint(next);\n maybeTick(next);\n emit(Math.round(clamp(next, 0, last)));\n });\n },\n [itemHeight, last, paint, emit, maybeTick],\n );\n const endDrag = useCallback(() => {\n const d = drag.current;\n if (!d) return;\n if (dragFrame.current) {\n cancelAnimationFrame(dragFrame.current);\n dragFrame.current = 0;\n }\n drag.current = null;\n setGrabbing(false);\n // Average velocity over the last `VELOCITY_WINDOW` ms of movement rather\n // than the final two samples — a single noisy frame otherwise makes an\n // even flick feel like it caught or slipped.\n const pts = d.pts;\n let v = 0;\n if (pts.length > 1) {\n const latest = pts[pts.length - 1];\n let ref = pts[0];\n for (const p of pts) {\n if (latest[1] - p[1] <= VELOCITY_WINDOW) {\n ref = p;\n break;\n }\n }\n const dt = latest[1] - ref[1];\n if (dt > 0) {\n const raw = (ref[0] - latest[0]) / itemHeight / dt;\n v = clamp(raw, -MAX_VELOCITY, MAX_VELOCITY);\n }\n }\n fling(v);\n }, [itemHeight, fling]);\n\n // Mouse / pen only — touch runs through the native listeners in the effect.\n const onPointerDown = useCallback(\n (event: PointerEvent<HTMLDivElement>) => {\n if (disabled || reduce || event.pointerType === \"touch\") return;\n beginDrag(event.clientY);\n capturePointer(event.currentTarget, event.pointerId);\n },\n [disabled, reduce, beginDrag],\n );\n const onPointerMove = useCallback(\n (event: PointerEvent<HTMLDivElement>) => {\n if (event.pointerType === \"touch\") return;\n moveDrag(event.clientY);\n },\n [moveDrag],\n );\n const onPointerUp = useCallback(\n (event: PointerEvent<HTMLDivElement>) => {\n if (event.pointerType === \"touch\") return;\n // Also the pointercancel handler, where the capture is already gone —\n // an unguarded release throws there and the drum never settles.\n releasePointer(event.currentTarget, event.pointerId);\n endDrag();\n },\n [endDrag],\n );\n\n // Wheel drives `scroll` continuously — like a drag — then snaps once it goes\n // idle. Firing a fresh eased step per notch instead stacks overlapping\n // animations that keep interrupting each other, which read as lag.\n const wheelSnap = useRef<ReturnType<typeof setTimeout> | null>(null);\n const onWheel = useCallback(\n (event: globalThis.WheelEvent) => {\n // Native (non-passive) so preventDefault actually stops the page from\n // scrolling behind the wheel — React's synthetic wheel listener is\n // passive, so a handler on the element cannot cancel the scroll.\n if (disabled || reduce) return;\n event.preventDefault();\n if (sound) getPlayer().prepare();\n stop();\n const px = event.deltaMode === 1 ? event.deltaY * 16 : event.deltaY;\n const next = clamp(scroll.current + px * WHEEL_SENS, 0, last);\n scroll.current = next;\n paint(next);\n maybeTick(next);\n emit(Math.round(next));\n if (wheelSnap.current) clearTimeout(wheelSnap.current);\n wheelSnap.current = setTimeout(() => {\n glide(clamp(Math.round(scroll.current), 0, last), 240, easeOutBack);\n }, WHEEL_SETTLE);\n },\n [disabled, reduce, sound, last, paint, emit, stop, glide, maybeTick, getPlayer],\n );\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (disabled) return;\n const at = Math.round(scroll.current);\n const map: Record<string, number> = {\n ArrowUp: -1,\n ArrowDown: 1,\n Home: -at,\n End: last - at,\n };\n if (event.key in map) {\n event.preventDefault();\n if (sound) getPlayer().prepare();\n step(map[event.key]);\n }\n },\n [disabled, sound, last, step, getPlayer],\n );\n\n // Paint the starting frame, and follow controlled/value changes from outside\n // unless a gesture is mid-flight.\n useEffect(() => {\n if (drag.current) return;\n const target = indexOf(currentValue);\n emitted.current = currentValue;\n if (Math.abs(Math.round(scroll.current) - target) < 0.001) {\n paint(scroll.current);\n return;\n }\n glide(target, 260);\n }, [currentValue, indexOf, paint, glide]);\n\n useEffect(\n () => () => {\n cancelAnimationFrame(raf.current);\n cancelAnimationFrame(dragFrame.current);\n if (wheelSnap.current) clearTimeout(wheelSnap.current);\n tickPlayer.current?.dispose();\n },\n [],\n );\n\n // Native touch + wheel listeners, bound non-passively so touchmove and wheel\n // can block the page from scrolling while the wheel spins. React's synthetic\n // touch/wheel handlers are passive, so preventDefault there is a no-op and the\n // gesture scrolls the page instead of driving the drum.\n useEffect(() => {\n const el = container.current;\n if (!el || reduce || disabled) return;\n const onStart = (e: TouchEvent) => {\n const t = e.touches[0];\n if (t) beginDrag(t.clientY);\n };\n const onMove = (e: TouchEvent) => {\n const t = e.touches[0];\n if (!t || !drag.current) return;\n e.preventDefault();\n moveDrag(t.clientY);\n };\n const onEnd = () => endDrag();\n el.addEventListener(\"touchstart\", onStart, { passive: true });\n el.addEventListener(\"touchmove\", onMove, { passive: false });\n el.addEventListener(\"touchend\", onEnd);\n el.addEventListener(\"touchcancel\", onEnd);\n el.addEventListener(\"wheel\", onWheel, { passive: false });\n return () => {\n el.removeEventListener(\"touchstart\", onStart);\n el.removeEventListener(\"touchmove\", onMove);\n el.removeEventListener(\"touchend\", onEnd);\n el.removeEventListener(\"touchcancel\", onEnd);\n el.removeEventListener(\"wheel\", onWheel);\n };\n }, [reduce, disabled, beginDrag, moveDrag, endDrag, onWheel]);\n\n const maskFade =\n \"[mask-image:linear-gradient(to_bottom,transparent,#000_22%,#000_78%,transparent)]\";\n\n if (reduce) {\n const pad = (height - itemHeight) / 2;\n return (\n <div\n className={cn(\n \"relative overflow-hidden rounded-2xl border border-border bg-card\",\n disabled && \"pointer-events-none opacity-50\",\n className,\n )}\n style={{ height }}\n >\n <div\n className=\"pointer-events-none absolute inset-x-0 top-1/2 z-10 -translate-y-1/2 border-border border-y bg-foreground/4\"\n style={{ height: itemHeight }}\n />\n <ul\n className={cn(\n \"h-full snap-y snap-mandatory overflow-y-auto scroll-smooth [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n maskFade,\n )}\n style={{ paddingTop: pad, paddingBottom: pad }}\n >\n {options.map((option) => {\n const v = optionValue(option);\n return (\n <li key={v} className=\"snap-center\">\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => emit(options.indexOf(option))}\n className={cn(\n \"flex w-full items-center justify-center font-medium\",\n v === currentValue ? \"text-foreground\" : \"text-muted-foreground\",\n )}\n style={{ height: itemHeight }}\n >\n {optionLabel(option)}\n </button>\n </li>\n );\n })}\n </ul>\n </div>\n );\n }\n\n return (\n <div\n ref={container}\n role=\"listbox\"\n aria-label={ariaLabel}\n tabIndex={disabled ? -1 : 0}\n onKeyDown={onKeyDown}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n onPointerCancel={onPointerUp}\n className={cn(\n \"relative touch-none overflow-hidden rounded-2xl border border-border bg-card outline-none focus-visible:ring-2 focus-visible:ring-foreground/20\",\n // The drum owns the whole gesture; iOS must not open its callout or\n // start a drag out of the same press and cancel ours.\n TOUCH_GESTURE_CLASS,\n grabbing ? \"cursor-grabbing\" : \"cursor-grab\",\n disabled && \"pointer-events-none opacity-50\",\n maskFade,\n className,\n )}\n style={{ height, perspective: 1000 }}\n >\n {/* Curved drum of dimmed rows. */}\n <ul\n ref={drumRef}\n aria-hidden\n className=\"backface-hidden transform-3d absolute inset-x-0 top-1/2 m-0 h-0 list-none p-0 will-change-transform\"\n >\n {options.map((option, i) => (\n <li\n key={optionValue(option)}\n data-index={i}\n className=\"absolute inset-x-0 flex items-center justify-center font-medium text-muted-foreground\"\n style={{\n top: -itemHeight / 2,\n height: itemHeight,\n transform: `rotateX(${-itemAngle * i}deg) translateZ(${radius}px)`,\n }}\n >\n {optionLabel(option)}\n </li>\n ))}\n </ul>\n\n {/* Center band: the very same drum, clipped to one row and drawn crisp.\n Its own perspective, centred on the container middle, matches the main\n drum's projection so the two copies register exactly. */}\n <div\n className=\"pointer-events-none absolute inset-x-0 top-1/2 z-10 -translate-y-1/2 overflow-hidden rounded-md bg-foreground/4\"\n style={{ height: itemHeight, perspective: 1000 }}\n >\n <ul\n ref={bandRef}\n aria-hidden\n className=\"backface-hidden transform-3d absolute inset-x-0 top-1/2 m-0 h-0 list-none p-0 will-change-transform\"\n >\n {options.map((option, i) => (\n <li\n key={optionValue(option)}\n data-index={i}\n className=\"absolute inset-x-0 flex items-center justify-center font-medium text-foreground\"\n style={{\n top: -itemHeight / 2,\n height: itemHeight,\n transform: `rotateX(${-itemAngle * i}deg) translateZ(${radius}px)`,\n }}\n >\n {optionLabel(option)}\n </li>\n ))}\n </ul>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAmCA,MAAM,MAAM,KAAK,KAAK;AAItB,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,aAAa;AACnB,MAAM,eAAe;AACrB,MAAM,gBAAgB,MAAc,KAAK,IAAI,MAAM;AAGnD,MAAM,OAAO;AACb,MAAM,eAAe,MAAc,IAAK,QAAa,IAAI,MAAM,IAAI,QAAQ,IAAI,MAAM;AAErF,MAAM,SAAS,GAAW,IAAY,OAAe,KAAK,IAAI,IAAI,KAAK,IAAI,GAAG,EAAE,CAAC;AAEjF,SAAS,YAAY,QAA2B;CAC9C,OAAO,OAAO,WAAW,WAAW,SAAS,OAAO;A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,CAAA,CACF;;AAET"}
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from "class-variance-authority";
2
2
  //#region src/components/reui/alert.d.ts
3
3
  declare const alertVariants: (props?: ({
4
- variant?: "default" | "destructive" | "info" | "success" | "warning" | "invert" | null | undefined;
4
+ variant?: "default" | "destructive" | "success" | "info" | "warning" | "invert" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): import("react").JSX.Element;
7
7
  declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"alert.d.ts","names":[],"sources":["../../../src/components/reui/alert.tsx"],"mappings":";;cAKM,gBAAa;;6CA2BlB;iBAEQ,QACP,WACA,YACG,SACF,MAAM,wBAAwB,oBAAoB,iCAAc,IAAA;iBAW1D,aAAa,cAAc,SAAS,MAAM,wCAAqB,IAAA;iBAU/D,mBAAmB,cAAc,SAAS,MAAM,wCAAqB,IAAA;iBAarE,cAAc,cAAc,SAAS,MAAM,wCAAqB,IAAA"}
1
+ {"version":3,"file":"alert.d.ts","names":[],"sources":["../../../src/components/reui/alert.tsx"],"mappings":";;cAMM,gBAAa;;6CA2BlB;iBAEQ,QACP,WACA,YACG,SACF,MAAM,wBAAwB,oBAAoB,iCAAc,IAAA;iBAW1D,aAAa,cAAc,SAAS,MAAM,wCAAqB,IAAA;iBAU/D,mBAAmB,cAAc,SAAS,MAAM,wCAAqB,IAAA;iBAarE,cAAc,cAAc,SAAS,MAAM,wCAAqB,IAAA"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from "cn";
2
+ import { cn } from "@kumix/utils";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { cva } from "class-variance-authority";
5
5
  //#region src/components/reui/alert.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","names":[],"sources":["../../../src/components/reui/alert.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"cn\";\n\nconst alertVariants = cva(\n [\n \"relative grid w-full grid-cols-[0_1fr] items-center gap-y-0.5 border text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*3)_1fr] [&>svg:not([class*=size-])]:size-4\",\n \"has-[>[data-slot=alert-title]+[data-slot=alert-description]]:[&_[data-slot=alert-action]]:sm:row-end-3\",\n \"has-[>[data-slot=alert-title]+[data-slot=alert-description]]:items-start\",\n \"has-[>[data-slot=alert-title]+[data-slot=alert-description]]:[&_svg]:translate-y-0.5\",\n \"rounded-lg\",\n \"px-3\",\n \"py-2.5\",\n \"has-[>svg]:gap-x-2.5\",\n ],\n {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground\",\n destructive: \"border-destructive/30 bg-destructive/4 [&>svg]:text-destructive\",\n info: \"border-info/30 bg-info/4 [&>svg]:text-info\",\n success: \"border-success/30 bg-success/4 [&>svg]:text-success\",\n warning: \"border-warning/30 bg-warning/4 [&>svg]:text-warning\",\n invert:\n \"border-invert bg-invert text-invert-foreground [&_[data-slot=alert-description]]:text-invert-foreground/70\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nfunction Alert({\n className,\n variant,\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof alertVariants>) {\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nfunction AlertTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-title\"\n className={cn(\"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight\", className)}\n {...props}\n />\n );\n}\n\nfunction AlertDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-description\"\n className={cn(\n \"col-start-2 grid justify-items-start gap-1 text-muted-foreground text-sm [&_p]:leading-relaxed\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AlertAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-action\"\n className={cn(\n \"flex gap-1.5 max-sm:col-start-2 max-sm:mt-2 max-sm:justify-start sm:col-start-3 sm:row-start-1 sm:justify-end sm:self-center\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Alert, AlertAction, AlertDescription, AlertTitle };\n"],"mappings":";;;;;AAKA,MAAM,gBAAgB,IACpB;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GACA;CACE,UAAU,EACR,SAAS;EACP,SAAS;EACT,aAAa;EACb,MAAM;EACN,SAAS;EACT,SAAS;EACT,QACE;CACJ,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CACF;AAEA,SAAS,MAAM,EACb,WACA,SACA,GAAG,SACgE;CACnE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,MAAK;EACL,WAAW,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,SAAS;EACnD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACxE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,+DAA+D,SAAS;EACtF,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAsC;CAC9E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,kGACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,gIACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"alert.js","names":[],"sources":["../../../src/components/reui/alert.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@kumix/utils\";\n\nconst alertVariants = cva(\n [\n \"relative grid w-full grid-cols-[0_1fr] items-center gap-y-0.5 border text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*3)_1fr] [&>svg:not([class*=size-])]:size-4\",\n \"has-[>[data-slot=alert-title]+[data-slot=alert-description]]:[&_[data-slot=alert-action]]:sm:row-end-3\",\n \"has-[>[data-slot=alert-title]+[data-slot=alert-description]]:items-start\",\n \"has-[>[data-slot=alert-title]+[data-slot=alert-description]]:[&_svg]:translate-y-0.5\",\n \"rounded-lg\",\n \"px-3\",\n \"py-2.5\",\n \"has-[>svg]:gap-x-2.5\",\n ],\n {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground\",\n destructive: \"border-destructive/30 bg-destructive/4 [&>svg]:text-destructive\",\n info: \"border-info/30 bg-info/4 [&>svg]:text-info\",\n success: \"border-success/30 bg-success/4 [&>svg]:text-success\",\n warning: \"border-warning/30 bg-warning/4 [&>svg]:text-warning\",\n invert:\n \"border-invert bg-invert text-invert-foreground [&_[data-slot=alert-description]]:text-invert-foreground/70\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nfunction Alert({\n className,\n variant,\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof alertVariants>) {\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nfunction AlertTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-title\"\n className={cn(\"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight\", className)}\n {...props}\n />\n );\n}\n\nfunction AlertDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-description\"\n className={cn(\n \"col-start-2 grid justify-items-start gap-1 text-muted-foreground text-sm [&_p]:leading-relaxed\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AlertAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-action\"\n className={cn(\n \"flex gap-1.5 max-sm:col-start-2 max-sm:mt-2 max-sm:justify-start sm:col-start-3 sm:row-start-1 sm:justify-end sm:self-center\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Alert, AlertAction, AlertDescription, AlertTitle };\n"],"mappings":";;;;;AAMA,MAAM,gBAAgB,IACpB;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GACA;CACE,UAAU,EACR,SAAS;EACP,SAAS;EACT,aAAa;EACb,MAAM;EACN,SAAS;EACT,SAAS;EACT,QACE;CACJ,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CACF;AAEA,SAAS,MAAM,EACb,WACA,SACA,GAAG,SACgE;CACnE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,MAAK;EACL,WAAW,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,SAAS;EACnD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACxE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,+DAA+D,SAAS;EACtF,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAsC;CAC9E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,kGACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,gIACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
@@ -2,7 +2,7 @@ import { VariantProps } from "class-variance-authority";
2
2
  import { Autocomplete as Autocomplete$1 } from "@base-ui/react/autocomplete";
3
3
  //#region src/components/reui/autocomplete.d.ts
4
4
  declare const inputVariants: (props?: ({
5
- size?: "default" | "sm" | "lg" | null | undefined;
5
+ size?: "sm" | "default" | "lg" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  declare const Autocomplete: typeof Autocomplete$1.Root;
8
8
  declare function AutocompleteValue({ ...props }: Autocomplete$1.Value.Props): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete.d.ts","names":[],"sources":["../../../src/components/reui/autocomplete.tsx"],"mappings":";;;cASM,gBAAa;;6CAelB;cAEK,qBAAY,eAAA;iBAET,uBAAuB,SAAS,eAAsB,MAAM,wBAAK,IAAA;iBAIjE,oBACP,WACA,MACA,WACA,gBACG,SACF,KAAK,eAAsB,MAAM,iBAClC,oBAAoB;EAClB;EACA;oBACD,IAAA;iBAeM,qBAAqB,cAAc,SAAS,eAAsB,OAAO,wBAAK,IAAA;iBAU9E,wBAAwB,SAAS,eAAsB,OAAO,wBAAK,IAAA;iBAInE,0BAA0B,SAAS,eAAsB,SAAS,wBAAK,IAAA;iBAIvE,yBAAyB,cAAc,SAAS,eAAsB,WAAW,wBAAK,IAAA;iBAUtF,mBACP,WACA,wBACG,SACF,eAAsB,KAAK;EAC5B;EACA;EACA;oBACD,IAAA;iBAoBQ,4BACJ,SACF,MAAM,sBAAsB,eAAsB,8BAAW,IAAA;iBAIvD,kBACP,cACG,SACF,MAAM,sBAAsB,eAAsB,uBAAI,IAAA;iBAUhD,mBACP,cACG,SACF,MAAM,sBAAsB,eAAsB,wBAAK,IAAA;iBAgBzC,iCACP,MAAM,sBAAsB,eAAsB;EAC1D,QAAQ,eAAsB,WAAW;EACzC,aAAa,eAAsB,WAAW;EAC9C,cAAc,eAAsB,WAAW;EAC/C,OAAO,eAAsB,WAAW;EACxC,SAAS,eAAsB,WAAW;EAC1C;;iBAGO,sBACP,WACA,UACA,cACA,OACA,YACA,aACA,MACA,WACG,SACF,2CAAwB,IAAA;iBA4BlB,uBAAuB,SAAS,MAAM,sBAAsB,eAAsB,yBAAM,IAAA;iBAIxF,yBACP,cACG,SACF,MAAM,sBAAsB,eAAsB,8BAAW,IAAA;iBAUvD,oBACP,cACG,SACF,MAAM,sBAAsB,eAAsB,yBAAM,IAAA;iBAalD,oBACP,cACG,SACF,MAAM,sBAAsB,eAAsB,yBAAM,IAAA;iBAelD,sBACP,cACG,SACF,MAAM,sBAAsB,eAAsB,2BAAQ,IAAA;iBAepD,uBAAuB,SAAS,MAAM,sBAAsB,eAAsB,yBAAM,IAAA;iBAIxF,wBACP,cACG,SACF,MAAM,sBAAsB,eAAsB,6BAAU,IAAA"}
1
+ {"version":3,"file":"autocomplete.d.ts","names":[],"sources":["../../../src/components/reui/autocomplete.tsx"],"mappings":";;;cASM,gBAAa;;6CAelB;cAEK,qBAAY,eAAA;iBAET,uBAAuB,SAAS,eAAsB,MAAM,wBAAK,IAAA;iBAIjE,oBACP,WACA,MACA,WACA,gBACG,SACF,KAAK,eAAsB,MAAM,iBAClC,oBAAoB;EAClB;EACA;oBACD,IAAA;iBAeM,qBAAqB,cAAc,SAAS,eAAsB,OAAO,wBAAK,IAAA;iBAU9E,wBAAwB,SAAS,eAAsB,OAAO,wBAAK,IAAA;iBAInE,0BAA0B,SAAS,eAAsB,SAAS,wBAAK,IAAA;iBAIvE,yBAAyB,cAAc,SAAS,eAAsB,WAAW,wBAAK,IAAA;iBAUtF,mBACP,WACA,wBACG,SACF,eAAsB,KAAK;EAC5B;EACA;EACA;oBACD,IAAA;iBAoBQ,4BACJ,SACF,MAAM,sBAAsB,eAAsB,8BAAW,IAAA;iBAIvD,kBACP,cACG,SACF,MAAM,sBAAsB,eAAsB,uBAAI,IAAA;iBAUhD,mBACP,cACG,SACF,MAAM,sBAAsB,eAAsB,wBAAK,IAAA;iBAkBzC,iCACP,MAAM,sBAAsB,eAAsB;EAC1D,QAAQ,eAAsB,WAAW;EACzC,aAAa,eAAsB,WAAW;EAC9C,cAAc,eAAsB,WAAW;EAC/C,OAAO,eAAsB,WAAW;EACxC,SAAS,eAAsB,WAAW;EAC1C;;iBAGO,sBACP,WACA,UACA,cACA,OACA,YACA,aACA,MACA,WACG,SACF,2CAAwB,IAAA;iBA4BlB,uBAAuB,SAAS,MAAM,sBAAsB,eAAsB,yBAAM,IAAA;iBAIxF,yBACP,cACG,SACF,MAAM,sBAAsB,eAAsB,8BAAW,IAAA;iBAUvD,oBACP,cACG,SACF,MAAM,sBAAsB,eAAsB,yBAAM,IAAA;iBAalD,oBACP,cACG,SACF,MAAM,sBAAsB,eAAsB,yBAAM,IAAA;iBAelD,sBACP,cACG,SACF,MAAM,sBAAsB,eAAsB,2BAAQ,IAAA;iBAepD,uBAAuB,SAAS,MAAM,sBAAsB,eAAsB,yBAAM,IAAA;iBAIxF,wBACP,cACG,SACF,MAAM,sBAAsB,eAAsB,6BAAU,IAAA"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { ScrollArea } from "../ui/scroll-area.js";
3
- import { cn } from "cn";
3
+ import { cn } from "@kumix/utils";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { ChevronsUpDownIcon, XIcon } from "lucide-react";
6
6
  import { cva } from "class-variance-authority";
@@ -88,7 +88,7 @@ function AutocompleteRow({ className, ...props }) {
88
88
  function AutocompleteItem({ className, ...props }) {
89
89
  return /* @__PURE__ */ jsx(Autocomplete$1.Item, {
90
90
  "data-slot": "autocomplete-item",
91
- className: cn("gap-1.5 text-foreground data-highlighted:text-foreground data-highlighted:before:bg-accent", "rounded-md", "data-highlighted:before:rounded-md", "([class*='size-'])]:size-4 ([class*='size-'])]:size-4 ([class*='size-'])]:size-4 ([class*='size-'])]:size-3.5 ([class*='size-'])]:size-4 ([class*='size-'])]:size-3.5 relative flex cursor-default select-none items-center px-1.5 py-1 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-highlighted:relative data-highlighted:z-0 data-disabled:opacity-50 data-highlighted:before:absolute data-highlighted:before:inset-x-0 data-highlighted:before:inset-y-0 data-highlighted:before:z-[-1] [&_svg:not([class*='size-'])]:size-4 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
91
+ className: cn("gap-1.5 text-foreground data-highlighted:text-foreground data-highlighted:before:bg-accent", "rounded-md", "data-highlighted:before:rounded-md", "relative flex cursor-default select-none items-center px-1.5 py-1 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-highlighted:relative data-highlighted:z-0 data-disabled:opacity-50 data-highlighted:before:absolute data-highlighted:before:inset-x-0 data-highlighted:before:inset-y-0 data-highlighted:before:z-[-1] [&_svg:not([class*='size-'])]:size-4 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
92
92
  ...props
93
93
  });
94
94
  }