@jbpark/ui-kit 10.1.0 → 10.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/dist/Alert.d.mts +24 -0
  2. package/dist/Alert.d.mts.map +1 -0
  3. package/dist/Alert.mjs +68 -0
  4. package/dist/Alert.mjs.map +1 -0
  5. package/dist/Anchor.d.mts +29 -0
  6. package/dist/Anchor.d.mts.map +1 -0
  7. package/dist/Anchor.mjs +120 -0
  8. package/dist/Anchor.mjs.map +1 -0
  9. package/dist/AutoComplete.d.mts +34 -0
  10. package/dist/AutoComplete.d.mts.map +1 -0
  11. package/dist/AutoComplete.mjs +82 -0
  12. package/dist/AutoComplete.mjs.map +1 -0
  13. package/dist/Avatar.d.mts +19 -0
  14. package/dist/Avatar.d.mts.map +1 -0
  15. package/dist/Avatar.mjs +43 -0
  16. package/dist/Avatar.mjs.map +1 -0
  17. package/dist/Badge.d.mts +23 -0
  18. package/dist/Badge.d.mts.map +1 -0
  19. package/dist/Badge.mjs +41 -0
  20. package/dist/Badge.mjs.map +1 -0
  21. package/dist/Breadcrumb.d.mts +3 -3
  22. package/dist/Breadcrumb.d.mts.map +1 -1
  23. package/dist/Breadcrumb.mjs +1 -1
  24. package/dist/Breadcrumb.mjs.map +1 -1
  25. package/dist/Button.d.mts +3 -3
  26. package/dist/Button.d.mts.map +1 -1
  27. package/dist/Button.mjs +1 -1
  28. package/dist/Calendar.d.mts +28 -0
  29. package/dist/Calendar.d.mts.map +1 -0
  30. package/dist/Calendar.mjs +64 -0
  31. package/dist/Calendar.mjs.map +1 -0
  32. package/dist/Card.d.mts +2 -2
  33. package/dist/Card.d.mts.map +1 -1
  34. package/dist/Cascader.d.mts +34 -0
  35. package/dist/Cascader.d.mts.map +1 -0
  36. package/dist/Cascader.mjs +144 -0
  37. package/dist/Cascader.mjs.map +1 -0
  38. package/dist/CodeEditor.d.mts +2 -2
  39. package/dist/CodeEditor.d.mts.map +1 -1
  40. package/dist/ContextMenu.d.mts +33 -0
  41. package/dist/ContextMenu.d.mts.map +1 -0
  42. package/dist/ContextMenu.mjs +92 -0
  43. package/dist/ContextMenu.mjs.map +1 -0
  44. package/dist/Descriptions.d.mts +31 -0
  45. package/dist/Descriptions.d.mts.map +1 -0
  46. package/dist/Descriptions.mjs +67 -0
  47. package/dist/Descriptions.mjs.map +1 -0
  48. package/dist/Divider.d.mts +18 -0
  49. package/dist/Divider.d.mts.map +1 -0
  50. package/dist/Divider.mjs +44 -0
  51. package/dist/Divider.mjs.map +1 -0
  52. package/dist/Form.d.mts +12 -0
  53. package/dist/Form.d.mts.map +1 -0
  54. package/dist/Form.mjs +11 -0
  55. package/dist/Form.mjs.map +1 -0
  56. package/dist/Layout.d.mts.map +1 -1
  57. package/dist/Mentions.d.mts +34 -0
  58. package/dist/Mentions.d.mts.map +1 -0
  59. package/dist/Mentions.mjs +207 -0
  60. package/dist/Mentions.mjs.map +1 -0
  61. package/dist/Menu.mjs +1 -2
  62. package/dist/Pagination.d.mts +2 -2
  63. package/dist/Pagination.d.mts.map +1 -1
  64. package/dist/Pagination.mjs +1 -1
  65. package/dist/Popconfirm.d.mts +33 -0
  66. package/dist/Popconfirm.d.mts.map +1 -0
  67. package/dist/Popconfirm.mjs +119 -0
  68. package/dist/Popconfirm.mjs.map +1 -0
  69. package/dist/Rate.d.mts +27 -0
  70. package/dist/Rate.d.mts.map +1 -0
  71. package/dist/Rate.mjs +81 -0
  72. package/dist/Rate.mjs.map +1 -0
  73. package/dist/Reveals.d.mts.map +1 -1
  74. package/dist/ScrollArea.d.mts +8 -0
  75. package/dist/ScrollArea.d.mts.map +1 -0
  76. package/dist/ScrollArea.mjs +11 -0
  77. package/dist/ScrollArea.mjs.map +1 -0
  78. package/dist/Segmented.d.mts +26 -0
  79. package/dist/Segmented.d.mts.map +1 -0
  80. package/dist/Segmented.mjs +57 -0
  81. package/dist/Segmented.mjs.map +1 -0
  82. package/dist/Space.d.mts +2 -2
  83. package/dist/Space.d.mts.map +1 -1
  84. package/dist/Statistic.d.mts +22 -0
  85. package/dist/Statistic.d.mts.map +1 -0
  86. package/dist/Statistic.mjs +53 -0
  87. package/dist/Statistic.mjs.map +1 -0
  88. package/dist/Steps.d.mts +28 -0
  89. package/dist/Steps.d.mts.map +1 -0
  90. package/dist/Steps.mjs +70 -0
  91. package/dist/Steps.mjs.map +1 -0
  92. package/dist/Table.d.mts +4 -4
  93. package/dist/Table.d.mts.map +1 -1
  94. package/dist/Tag.d.mts +3 -3
  95. package/dist/Tag.d.mts.map +1 -1
  96. package/dist/TimePicker.d.mts +26 -0
  97. package/dist/TimePicker.d.mts.map +1 -0
  98. package/dist/TimePicker.mjs +77 -0
  99. package/dist/TimePicker.mjs.map +1 -0
  100. package/dist/Timeline.d.mts +35 -0
  101. package/dist/Timeline.d.mts.map +1 -0
  102. package/dist/Timeline.mjs +59 -0
  103. package/dist/Timeline.mjs.map +1 -0
  104. package/dist/Tour.d.mts +37 -0
  105. package/dist/Tour.d.mts.map +1 -0
  106. package/dist/Tour.mjs +192 -0
  107. package/dist/Tour.mjs.map +1 -0
  108. package/dist/Transfer.d.mts +36 -0
  109. package/dist/Transfer.d.mts.map +1 -0
  110. package/dist/Transfer.mjs +147 -0
  111. package/dist/Transfer.mjs.map +1 -0
  112. package/dist/Tree.d.mts +62 -0
  113. package/dist/Tree.d.mts.map +1 -0
  114. package/dist/Tree.mjs +462 -0
  115. package/dist/Tree.mjs.map +1 -0
  116. package/dist/TreeSelect.d.mts +34 -0
  117. package/dist/TreeSelect.d.mts.map +1 -0
  118. package/dist/TreeSelect.mjs +135 -0
  119. package/dist/TreeSelect.mjs.map +1 -0
  120. package/dist/Typography.d.mts.map +1 -1
  121. package/dist/components/atoms/checkbox/checkbox.d.mts +5 -3
  122. package/dist/components/atoms/checkbox/checkbox.d.mts.map +1 -1
  123. package/dist/components/atoms/checkbox/checkbox.mjs +8 -4
  124. package/dist/components/atoms/checkbox/checkbox.mjs.map +1 -1
  125. package/dist/components/atoms/checkbox/group.d.mts +2 -2
  126. package/dist/components/atoms/checkbox/group.d.mts.map +1 -1
  127. package/dist/components/atoms/checkbox/index.d.mts.map +1 -1
  128. package/dist/components/atoms/color-picker.d.mts +2 -2
  129. package/dist/components/atoms/color-picker.d.mts.map +1 -1
  130. package/dist/components/atoms/date-picker.d.mts +5 -1
  131. package/dist/components/atoms/date-picker.d.mts.map +1 -1
  132. package/dist/components/atoms/date-picker.mjs +54 -10
  133. package/dist/components/atoms/date-picker.mjs.map +1 -1
  134. package/dist/components/atoms/float-button/back-top.d.mts +2 -2
  135. package/dist/components/atoms/float-button/back-top.d.mts.map +1 -1
  136. package/dist/components/atoms/float-button/back-top.mjs +1 -1
  137. package/dist/components/atoms/float-button/float-button.d.mts +2 -2
  138. package/dist/components/atoms/float-button/float-button.d.mts.map +1 -1
  139. package/dist/components/atoms/float-button/index.d.mts.map +1 -1
  140. package/dist/components/atoms/index.d.mts +13 -2
  141. package/dist/components/atoms/input/index.d.mts +5 -1
  142. package/dist/components/atoms/input/index.d.mts.map +1 -1
  143. package/dist/components/atoms/input/index.mjs +5 -1
  144. package/dist/components/atoms/input/index.mjs.map +1 -1
  145. package/dist/components/atoms/input/number.d.mts +23 -0
  146. package/dist/components/atoms/input/number.d.mts.map +1 -0
  147. package/dist/components/atoms/input/number.mjs +71 -0
  148. package/dist/components/atoms/input/number.mjs.map +1 -0
  149. package/dist/components/atoms/input/otp.d.mts +26 -0
  150. package/dist/components/atoms/input/otp.d.mts.map +1 -0
  151. package/dist/components/atoms/input/otp.mjs +52 -0
  152. package/dist/components/atoms/input/otp.mjs.map +1 -0
  153. package/dist/components/atoms/input/search.d.mts +2 -7
  154. package/dist/components/atoms/input/search.d.mts.map +1 -1
  155. package/dist/components/atoms/input/search.mjs +6 -8
  156. package/dist/components/atoms/input/search.mjs.map +1 -1
  157. package/dist/components/atoms/mentions-token.mjs +31 -0
  158. package/dist/components/atoms/mentions-token.mjs.map +1 -0
  159. package/dist/components/atoms/option-group.d.mts +4 -5
  160. package/dist/components/atoms/option-group.d.mts.map +1 -1
  161. package/dist/components/atoms/popover.d.mts +2 -2
  162. package/dist/components/atoms/popover.d.mts.map +1 -1
  163. package/dist/components/atoms/progress.d.mts +5 -3
  164. package/dist/components/atoms/progress.d.mts.map +1 -1
  165. package/dist/components/atoms/progress.mjs +2 -2
  166. package/dist/components/atoms/progress.mjs.map +1 -1
  167. package/dist/components/atoms/radio/group.d.mts +2 -2
  168. package/dist/components/atoms/radio/group.d.mts.map +1 -1
  169. package/dist/components/atoms/radio/group.mjs +1 -1
  170. package/dist/components/atoms/radio/index.d.mts.map +1 -1
  171. package/dist/components/atoms/radio/radio.d.mts +2 -2
  172. package/dist/components/atoms/radio/radio.d.mts.map +1 -1
  173. package/dist/components/atoms/radio/radio.mjs +1 -1
  174. package/dist/components/atoms/rich-text-editor/rich-text-editor.d.mts +8 -3
  175. package/dist/components/atoms/rich-text-editor/rich-text-editor.d.mts.map +1 -1
  176. package/dist/components/atoms/rich-text-editor/rich-text-editor.mjs +7 -2
  177. package/dist/components/atoms/rich-text-editor/rich-text-editor.mjs.map +1 -1
  178. package/dist/components/atoms/rich-text-editor/toolbar-presets.mjs +2 -2
  179. package/dist/components/atoms/rich-text-editor/types.d.mts +2 -3
  180. package/dist/components/atoms/rich-text-editor/types.d.mts.map +1 -1
  181. package/dist/components/atoms/select-multiple.d.mts +2 -3
  182. package/dist/components/atoms/select-multiple.d.mts.map +1 -1
  183. package/dist/components/atoms/select-multiple.mjs +4 -3
  184. package/dist/components/atoms/select-multiple.mjs.map +1 -1
  185. package/dist/components/atoms/select-searchable-options.d.mts +3 -4
  186. package/dist/components/atoms/select-searchable-options.d.mts.map +1 -1
  187. package/dist/components/atoms/select-searchable.d.mts +2 -3
  188. package/dist/components/atoms/select-searchable.d.mts.map +1 -1
  189. package/dist/components/atoms/select-searchable.mjs +4 -3
  190. package/dist/components/atoms/select-searchable.mjs.map +1 -1
  191. package/dist/components/atoms/select.d.mts +4 -4
  192. package/dist/components/atoms/select.d.mts.map +1 -1
  193. package/dist/components/atoms/select.mjs +1 -1
  194. package/dist/components/atoms/select.mjs.map +1 -1
  195. package/dist/components/atoms/skeleton/button.d.mts.map +1 -1
  196. package/dist/components/atoms/skeleton/index.d.mts.map +1 -1
  197. package/dist/components/atoms/skeleton/node.d.mts.map +1 -1
  198. package/dist/components/atoms/skeleton/skeleton.d.mts +5 -3
  199. package/dist/components/atoms/skeleton/skeleton.d.mts.map +1 -1
  200. package/dist/components/atoms/skeleton/skeleton.mjs +2 -2
  201. package/dist/components/atoms/skeleton/skeleton.mjs.map +1 -1
  202. package/dist/components/atoms/slider/slider.d.mts +3 -3
  203. package/dist/components/atoms/slider/slider.d.mts.map +1 -1
  204. package/dist/components/atoms/spin.d.mts +2 -2
  205. package/dist/components/atoms/spin.d.mts.map +1 -1
  206. package/dist/components/atoms/spin.mjs +1 -1
  207. package/dist/components/atoms/switch.d.mts +2 -2
  208. package/dist/components/atoms/switch.d.mts.map +1 -1
  209. package/dist/components/atoms/tooltip.d.mts +2 -2
  210. package/dist/components/atoms/tooltip.d.mts.map +1 -1
  211. package/dist/components/atoms/typography/link.d.mts +2 -2
  212. package/dist/components/atoms/typography/link.d.mts.map +1 -1
  213. package/dist/components/atoms/typography/paragraph.d.mts +2 -2
  214. package/dist/components/atoms/typography/paragraph.d.mts.map +1 -1
  215. package/dist/components/atoms/typography/text.d.mts +2 -2
  216. package/dist/components/atoms/typography/text.d.mts.map +1 -1
  217. package/dist/components/atoms/typography/title.d.mts +2 -2
  218. package/dist/components/atoms/typography/title.d.mts.map +1 -1
  219. package/dist/components/atoms/typography/typography.d.mts +2 -2
  220. package/dist/components/atoms/typography/typography.d.mts.map +1 -1
  221. package/dist/components/molecules/collapse.d.mts +9 -9
  222. package/dist/components/molecules/collapse.d.mts.map +1 -1
  223. package/dist/components/molecules/collapse.mjs +11 -2
  224. package/dist/components/molecules/collapse.mjs.map +1 -1
  225. package/dist/components/molecules/dropdown.d.mts +2 -2
  226. package/dist/components/molecules/dropdown.d.mts.map +1 -1
  227. package/dist/components/molecules/index.d.mts +23 -13
  228. package/dist/components/molecules/marquees/index.d.mts.map +1 -1
  229. package/dist/components/molecules/marquees/item.d.mts +4 -4
  230. package/dist/components/molecules/marquees/item.d.mts.map +1 -1
  231. package/dist/components/molecules/marquees/item.mjs +5 -5
  232. package/dist/components/molecules/marquees/item.mjs.map +1 -1
  233. package/dist/components/molecules/marquees/marquees.d.mts +2 -2
  234. package/dist/components/molecules/marquees/marquees.d.mts.map +1 -1
  235. package/dist/components/molecules/marquees/marquees.mjs +4 -5
  236. package/dist/components/molecules/marquees/marquees.mjs.map +1 -1
  237. package/dist/components/molecules/menu/item/item.mjs +1 -1
  238. package/dist/components/molecules/menu/menu.d.mts +9 -9
  239. package/dist/components/molecules/menu/menu.d.mts.map +1 -1
  240. package/dist/components/molecules/menu/menu.mjs +3 -1
  241. package/dist/components/molecules/menu/menu.mjs.map +1 -1
  242. package/dist/components/molecules/reveals/item.d.mts +2 -2
  243. package/dist/components/molecules/reveals/item.d.mts.map +1 -1
  244. package/dist/components/molecules/reveals/reveals.d.mts +5 -5
  245. package/dist/components/molecules/reveals/reveals.d.mts.map +1 -1
  246. package/dist/components/molecules/splitter/index.d.mts.map +1 -1
  247. package/dist/components/molecules/splitter/panel.d.mts +3 -3
  248. package/dist/components/molecules/splitter/panel.d.mts.map +1 -1
  249. package/dist/components/molecules/splitter/splitter.d.mts +3 -3
  250. package/dist/components/molecules/splitter/splitter.d.mts.map +1 -1
  251. package/dist/components/molecules/tabs.d.mts +9 -5
  252. package/dist/components/molecules/tabs.d.mts.map +1 -1
  253. package/dist/components/molecules/tabs.mjs +5 -1
  254. package/dist/components/molecules/tabs.mjs.map +1 -1
  255. package/dist/components/molecules/upload.d.mts +3 -3
  256. package/dist/components/molecules/upload.d.mts.map +1 -1
  257. package/dist/components/molecules/upload.mjs +1 -1
  258. package/dist/components/organisms/drawer.d.mts +3 -3
  259. package/dist/components/organisms/drawer.d.mts.map +1 -1
  260. package/dist/components/organisms/drawer.mjs +4 -3
  261. package/dist/components/organisms/drawer.mjs.map +1 -1
  262. package/dist/components/organisms/form/context.d.mts +4 -0
  263. package/dist/components/organisms/form/context.d.mts.map +1 -0
  264. package/dist/components/organisms/form/context.mjs +9 -0
  265. package/dist/components/organisms/form/context.mjs.map +1 -0
  266. package/dist/components/organisms/form/control.d.mts +11 -0
  267. package/dist/components/organisms/form/control.d.mts.map +1 -0
  268. package/dist/components/organisms/form/control.mjs +19 -0
  269. package/dist/components/organisms/form/control.mjs.map +1 -0
  270. package/dist/components/organisms/form/field.d.mts +25 -0
  271. package/dist/components/organisms/form/field.d.mts.map +1 -0
  272. package/dist/components/organisms/form/field.mjs +54 -0
  273. package/dist/components/organisms/form/field.mjs.map +1 -0
  274. package/dist/components/organisms/form/form.d.mts +14 -0
  275. package/dist/components/organisms/form/form.d.mts.map +1 -0
  276. package/dist/components/organisms/form/form.mjs +23 -0
  277. package/dist/components/organisms/form/form.mjs.map +1 -0
  278. package/dist/components/organisms/index.d.mts +14 -6
  279. package/dist/components/organisms/list/index.d.mts.map +1 -1
  280. package/dist/components/organisms/list/list.d.mts +2 -2
  281. package/dist/components/organisms/list/list.d.mts.map +1 -1
  282. package/dist/components/organisms/modal.d.mts +6 -3
  283. package/dist/components/organisms/modal.d.mts.map +1 -1
  284. package/dist/components/organisms/modal.mjs +25 -18
  285. package/dist/components/organisms/modal.mjs.map +1 -1
  286. package/dist/components/organisms/swiper/index.d.mts.map +1 -1
  287. package/dist/components/organisms/swiper/swiper.d.mts +2 -2
  288. package/dist/components/organisms/swiper/swiper.d.mts.map +1 -1
  289. package/dist/components/organisms/toast.d.mts +2 -2
  290. package/dist/components/organisms/toast.d.mts.map +1 -1
  291. package/dist/components/organisms/toast.mjs +1 -1
  292. package/dist/components/templates/container.d.mts +2 -2
  293. package/dist/components/templates/container.d.mts.map +1 -1
  294. package/dist/components/templates/empty.d.mts +2 -2
  295. package/dist/components/templates/empty.d.mts.map +1 -1
  296. package/dist/components/templates/empty.mjs +1 -1
  297. package/dist/components/templates/grid/col.d.mts +2 -2
  298. package/dist/components/templates/grid/col.d.mts.map +1 -1
  299. package/dist/components/templates/grid/row.d.mts +2 -2
  300. package/dist/components/templates/grid/row.d.mts.map +1 -1
  301. package/dist/components/templates/layout/content.d.mts +2 -2
  302. package/dist/components/templates/layout/content.d.mts.map +1 -1
  303. package/dist/components/templates/layout/footer.d.mts +2 -2
  304. package/dist/components/templates/layout/footer.d.mts.map +1 -1
  305. package/dist/components/templates/layout/header.d.mts +2 -2
  306. package/dist/components/templates/layout/header.d.mts.map +1 -1
  307. package/dist/components/templates/layout/layout.d.mts +2 -2
  308. package/dist/components/templates/layout/layout.d.mts.map +1 -1
  309. package/dist/components/templates/layout/sider.d.mts +2 -2
  310. package/dist/components/templates/layout/sider.d.mts.map +1 -1
  311. package/dist/components/templates/layout/sider.mjs +1 -1
  312. package/dist/components/templates/page-header.d.mts +2 -2
  313. package/dist/components/templates/page-header.d.mts.map +1 -1
  314. package/dist/components/templates/page-header.mjs +1 -1
  315. package/dist/components/templates/result.d.mts +2 -2
  316. package/dist/components/templates/result.d.mts.map +1 -1
  317. package/dist/components/templates/result.mjs +1 -1
  318. package/dist/core/accordion.mjs +1 -1
  319. package/dist/core/autocomplete.d.mts +2 -0
  320. package/dist/core/autocomplete.mjs +48 -0
  321. package/dist/core/autocomplete.mjs.map +1 -0
  322. package/dist/core/badge.d.mts +5 -3
  323. package/dist/core/badge.d.mts.map +1 -1
  324. package/dist/core/button.d.mts +6 -4
  325. package/dist/core/button.d.mts.map +1 -1
  326. package/dist/core/calendar.d.mts +13 -3
  327. package/dist/core/calendar.d.mts.map +1 -0
  328. package/dist/core/calendar.mjs +1 -1
  329. package/dist/core/checkbox.mjs +11 -8
  330. package/dist/core/checkbox.mjs.map +1 -1
  331. package/dist/core/combobox.d.mts +26 -4
  332. package/dist/core/combobox.d.mts.map +1 -1
  333. package/dist/core/combobox.mjs +2 -2
  334. package/dist/core/combobox.mjs.map +1 -1
  335. package/dist/core/dialog.mjs +2 -2
  336. package/dist/core/dialog.mjs.map +1 -1
  337. package/dist/core/form.d.mts +8 -0
  338. package/dist/core/form.d.mts.map +1 -0
  339. package/dist/core/form.mjs +3 -0
  340. package/dist/core/index.d.mts +13 -9
  341. package/dist/core/popover.mjs +10 -2
  342. package/dist/core/popover.mjs.map +1 -1
  343. package/dist/core/radio-group.mjs +1 -1
  344. package/dist/core/resizable.d.mts +7 -2
  345. package/dist/core/resizable.d.mts.map +1 -1
  346. package/dist/core/resizable.mjs +1 -1
  347. package/dist/core/scroll-area.d.mts +20 -0
  348. package/dist/core/scroll-area.d.mts.map +1 -0
  349. package/dist/core/scroll-area.mjs +57 -0
  350. package/dist/core/scroll-area.mjs.map +1 -0
  351. package/dist/core/select.d.mts +24 -2
  352. package/dist/core/select.d.mts.map +1 -1
  353. package/dist/core/select.mjs +1 -1
  354. package/dist/core/separator.d.mts +13 -2
  355. package/dist/core/separator.d.mts.map +1 -0
  356. package/dist/core/tabs.d.mts +16 -2
  357. package/dist/core/tabs.d.mts.map +1 -1
  358. package/dist/index.d.mts +63 -34
  359. package/dist/index.mjs +29 -5
  360. package/dist/lib/colors.d.mts +2 -3
  361. package/dist/lib/colors.d.mts.map +1 -1
  362. package/dist/providers/config/context.d.mts +2 -3
  363. package/dist/providers/config/context.d.mts.map +1 -1
  364. package/dist/providers/config/context.mjs +3 -1
  365. package/dist/providers/config/context.mjs.map +1 -1
  366. package/dist/providers/config/registry.d.mts +2 -3
  367. package/dist/providers/config/registry.d.mts.map +1 -1
  368. package/dist/providers/config/types.d.mts +8 -7
  369. package/dist/providers/config/types.d.mts.map +1 -1
  370. package/dist/style.css +838 -288
  371. package/dist/utils.d.mts +2 -3
  372. package/dist/utils.d.mts.map +1 -1
  373. package/package.json +147 -26
  374. package/dist/components/molecules/marquees/use-pause-on-hover.mjs +0 -26
  375. package/dist/components/molecules/marquees/use-pause-on-hover.mjs.map +0 -1
@@ -1,13 +1,13 @@
1
1
  import React from "react";
2
2
  //#region src/components/molecules/collapse.d.ts
3
- interface Item {
4
- key: React.Key;
3
+ interface Item<Key extends React.Key = string> {
4
+ key: Key;
5
5
  label: React.ReactNode;
6
6
  disabled?: boolean;
7
7
  children: React.ReactNode;
8
8
  }
9
- interface Props extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange' | 'defaultValue' | 'value' | 'dir'> {
10
- items?: Item[];
9
+ export interface Props<Key extends React.Key = string> extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange' | 'defaultValue' | 'value' | 'dir'> {
10
+ items?: Item<Key>[];
11
11
  accordion?: boolean;
12
12
  expandIcon?: React.ReactNode;
13
13
  classNames?: {
@@ -15,11 +15,11 @@ interface Props extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange' |
15
15
  header?: string;
16
16
  body?: string;
17
17
  };
18
- defaultActiveKey?: string[] | number[];
19
- activeKey?: string[] | number[];
20
- onChange?: (keys: string[]) => void;
18
+ defaultActiveKey?: Key[];
19
+ activeKey?: Key[];
20
+ onChange?: (keys: Key[]) => void;
21
21
  }
22
- declare const Collapse: ({ expandIcon, accordion, items, className, classNames, defaultActiveKey, activeKey: _activeKey, onChange: _onChange, ...props }: Props) => React.JSX.Element;
22
+ declare const Collapse: <Key extends React.Key = string>({ expandIcon, accordion, items, className, classNames, defaultActiveKey, activeKey: _activeKey, onChange: _onChange, ...props }: Props<Key>) => React.JSX.Element;
23
23
  //#endregion
24
- export { Props, Collapse as default };
24
+ export { Collapse as default };
25
25
  //# sourceMappingURL=collapse.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapse.d.mts","names":[],"sources":["../../../src/components/molecules/collapse.tsx"],"mappings":";;UAWU;EACR,KAAK,MAAM;EACX,OAAO,MAAM;EACb;EACA,UAAU,MAAM;;UAGD,cAAc,KAC7B,MAAM;EAGN,QAAQ;EACR;EACA,aAAa,MAAM;EACnB;IACE;IACA;IACA;;EAEF;EACA;EACA,YAAY;;cAGR,aAAY,YAAA,WAAA,OAAA,WAAA,YAAA,kBAAA,WAAA,YAAA,UAAA,cAAA,SAUf,UAAK,MAAA,IAAA"}
1
+ {"version":3,"file":"collapse.d.mts","names":[],"sources":["../../../src/components/molecules/collapse.tsx"],"mappings":";;UAWU,KAAK,YAAY,MAAM;EAC/B,KAAK;EACL,OAAO,MAAM;EACb;EACA,UAAU,MAAM;;iBAGD,MAAM,YAAY,MAAM,sBAAsB,KAC7D,MAAM;EAGN,QAAQ,KAAK;EACb;EACA,aAAa,MAAM;EACnB;IACE;IACA;IACA;;EAEF,mBAAmB;EACnB,YAAY;EACZ,YAAY,MAAM;;cAGd,WAAY,YAAY,MAAM,gBAAc,YAAA,WAAA,OAAA,WAAA,YAAA,kBAAA,WAAA,YAAA,UAAA,cAAA,SAU/C,MAAM,SAAI,MAAA,IAAA"}
@@ -6,12 +6,21 @@ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/components/molecules/collapse.tsx
7
7
  const { Accordion, AccordionItem, AccordionTrigger, AccordionContent } = accordion_exports;
8
8
  const Collapse = ({ expandIcon, accordion = false, items = [], className, classNames, defaultActiveKey, activeKey: _activeKey, onChange: _onChange, ...props }) => {
9
+ const controlled = _activeKey !== void 0;
10
+ const keysByValue = new Map([
11
+ ...defaultActiveKey ?? [],
12
+ ..._activeKey ?? [],
13
+ ...items.map((item) => item.key)
14
+ ].map((key) => [String(key), key]));
9
15
  const accordionProps = {
10
16
  multiple: !accordion,
11
17
  onValueChange: (values) => {
12
- _onChange?.(values);
18
+ _onChange?.(values.flatMap((value) => {
19
+ const key = keysByValue.get(value);
20
+ return key === void 0 ? [] : [key];
21
+ }));
13
22
  },
14
- ..._activeKey !== void 0 ? { value: (_activeKey ?? []).map((key) => `${key}`) } : { defaultValue: (defaultActiveKey ?? []).map((key) => `${key}`) }
23
+ ...controlled ? { value: (_activeKey ?? []).map((key) => String(key)) } : { defaultValue: (defaultActiveKey ?? []).map((key) => String(key)) }
15
24
  };
16
25
  return /* @__PURE__ */ jsx(Accordion, {
17
26
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"collapse.mjs","names":["accordion"],"sources":["../../../src/components/molecules/collapse.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\n\nimport { cn } from '@repo/ui/utils';\n\nimport { accordion } from '../../core';\n\nconst { Accordion, AccordionItem, AccordionTrigger, AccordionContent } =\n accordion;\n\ninterface Item {\n key: React.Key;\n label: React.ReactNode;\n disabled?: boolean;\n children: React.ReactNode;\n}\n\nexport interface Props extends Omit<\n React.ComponentPropsWithoutRef<'div'>,\n 'onChange' | 'defaultValue' | 'value' | 'dir'\n> {\n items?: Item[];\n accordion?: boolean;\n expandIcon?: React.ReactNode;\n classNames?: {\n item?: string;\n header?: string;\n body?: string;\n };\n defaultActiveKey?: string[] | number[];\n activeKey?: string[] | number[];\n onChange?: (keys: string[]) => void;\n}\n\nconst Collapse = ({\n expandIcon,\n accordion = false,\n items = [],\n className,\n classNames,\n defaultActiveKey,\n activeKey: _activeKey,\n onChange: _onChange,\n ...props\n}: Props) => {\n const controlled = _activeKey !== undefined;\n\n // Base UI's accordion has no `type` and always models the open set as an\n // array; `multiple` (default false) is the only single-vs-multiple switch.\n // `accordion` here means \"one panel open at a time\", so `multiple = !accordion`.\n const accordionProps = {\n multiple: !accordion,\n onValueChange: (values: string[]) => {\n _onChange?.(values);\n },\n ...(controlled\n ? { value: (_activeKey ?? []).map(key => `${key}`) }\n : { defaultValue: (defaultActiveKey ?? []).map(key => `${key}`) }),\n };\n\n return (\n <Accordion {...props} className={className} {...accordionProps}>\n {items.map(({ key, label, children, disabled }) => (\n <AccordionItem\n key={key}\n value={String(key)}\n className={cn(\n 'border-none',\n classNames?.item,\n //\n )}\n disabled={disabled}\n >\n <AccordionTrigger\n className={cn(\n 'hover:no-underline',\n classNames?.header,\n disabled && 'cursor-no-drop opacity-50',\n //\n )}\n expandIcon={expandIcon}\n disabled={disabled}\n >\n {label}\n </AccordionTrigger>\n <AccordionContent\n className={cn(\n classNames?.body,\n //\n )}\n >\n {children}\n </AccordionContent>\n </AccordionItem>\n ))}\n </Accordion>\n );\n};\n\nexport default Collapse;\n"],"mappings":";;;;;;AAQA,MAAM,EAAE,WAAW,eAAe,kBAAkB,qBAClDA;AA0BF,MAAM,YAAY,EAChB,YACA,YAAY,OACZ,QAAQ,CAAC,GACT,WACA,YACA,kBACA,WAAW,YACX,UAAU,WACV,GAAG,YACQ;CAMX,MAAM,iBAAiB;EACrB,UAAU,CAAC;EACX,gBAAgB,WAAqB;GACnC,YAAY,MAAM;EACpB;EACA,GAViB,eAAe,KAAA,IAW5B,EAAE,QAAQ,cAAc,CAAC,EAAA,CAAG,KAAI,QAAO,GAAG,KAAK,EAAE,IACjD,EAAE,eAAe,oBAAoB,CAAC,EAAA,CAAG,KAAI,QAAO,GAAG,KAAK,EAAE;CACpE;CAEA,OACE,oBAAC,WAAD;EAAW,GAAI;EAAkB;EAAW,GAAI;EAC7C,UAAA,MAAM,KAAK,EAAE,KAAK,OAAO,UAAU,eAClC,qBAAC,eAAD;GAEE,OAAO,OAAO,GAAG;GACjB,WAAW,GACT,eACA,YAAY,IAEd;GACU;GARZ,UAAA,CAUE,oBAAC,kBAAD;IACE,WAAW,GACT,sBACA,YAAY,QACZ,YAAY,2BAEd;IACY;IACF;IAET,UAAA;GACe,CAAA,GAClB,oBAAC,kBAAD;IACE,WAAW,GACT,YAAY,IAEd;IAEC;GACe,CAAA,CACL;EA7BR,GAAA,GA6BQ,CAChB;CACQ,CAAA;AAEf"}
1
+ {"version":3,"file":"collapse.mjs","names":["accordion"],"sources":["../../../src/components/molecules/collapse.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\n\nimport { cn } from '@repo/ui/utils';\n\nimport { accordion } from '../../core';\n\nconst { Accordion, AccordionItem, AccordionTrigger, AccordionContent } =\n accordion;\n\ninterface Item<Key extends React.Key = string> {\n key: Key;\n label: React.ReactNode;\n disabled?: boolean;\n children: React.ReactNode;\n}\n\nexport interface Props<Key extends React.Key = string> extends Omit<\n React.ComponentPropsWithoutRef<'div'>,\n 'onChange' | 'defaultValue' | 'value' | 'dir'\n> {\n items?: Item<Key>[];\n accordion?: boolean;\n expandIcon?: React.ReactNode;\n classNames?: {\n item?: string;\n header?: string;\n body?: string;\n };\n defaultActiveKey?: Key[];\n activeKey?: Key[];\n onChange?: (keys: Key[]) => void;\n}\n\nconst Collapse = <Key extends React.Key = string>({\n expandIcon,\n accordion = false,\n items = [],\n className,\n classNames,\n defaultActiveKey,\n activeKey: _activeKey,\n onChange: _onChange,\n ...props\n}: Props<Key>) => {\n const controlled = _activeKey !== undefined;\n const keysByValue = new Map<string, Key>(\n [\n ...(defaultActiveKey ?? []),\n ...(_activeKey ?? []),\n ...items.map(item => item.key),\n ].map(key => [String(key), key]),\n );\n\n // Base UI's accordion has no `type` and always models the open set as an\n // array; `multiple` (default false) is the only single-vs-multiple switch.\n // `accordion` here means \"one panel open at a time\", so `multiple = !accordion`.\n const accordionProps = {\n multiple: !accordion,\n onValueChange: (values: string[]) => {\n _onChange?.(\n values.flatMap(value => {\n const key = keysByValue.get(value);\n\n return key === undefined ? [] : [key];\n }),\n );\n },\n ...(controlled\n ? { value: (_activeKey ?? []).map(key => String(key)) }\n : { defaultValue: (defaultActiveKey ?? []).map(key => String(key)) }),\n };\n\n return (\n <Accordion {...props} className={className} {...accordionProps}>\n {items.map(({ key, label, children, disabled }) => (\n <AccordionItem\n key={key}\n value={String(key)}\n className={cn(\n 'border-none',\n classNames?.item,\n //\n )}\n disabled={disabled}\n >\n <AccordionTrigger\n className={cn(\n 'hover:no-underline',\n classNames?.header,\n disabled && 'cursor-no-drop opacity-50',\n //\n )}\n expandIcon={expandIcon}\n disabled={disabled}\n >\n {label}\n </AccordionTrigger>\n <AccordionContent\n className={cn(\n classNames?.body,\n //\n )}\n >\n {children}\n </AccordionContent>\n </AccordionItem>\n ))}\n </Accordion>\n );\n};\n\nex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enuProps } from "./menu/menu.mjs";
2
2
  //#region src/components/molecules/dropdown.d.ts
3
3
  type ChangeEventHandler = (open: boolean) => void;
4
- interface Props extends React.ComponentPropsWithoutRef<'div'> {
4
+ export interface Props extends React.ComponentPropsWithoutRef<'div'> {
5
5
  open?: boolean;
6
6
  trigger?: 'hover' | 'click';
7
7
  menu?: MenuProps;
@@ -9,5 +9,5 @@ interface Props extends React.ComponentPropsWithoutRef<'div'> {
9
9
  }
10
10
  declare const Dropdown: ({ children, menu, trigger, open: _open, onOpenChange: _onOpenChange, className, onMouseEnter, onMouseLeave, ...props }: Props) => import("react").JSX.Element;
11
11
  //#endregion
12
- export { Props, Dropdown as default };
12
+ export { Dropdown as default };
13
13
  //# sourceMappingURL=dropdown.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.d.mts","names":[],"sources":["../../../src/components/molecules/dropdown.tsx"],"mappings":";;KAYK,sBAAsB;UAEV,cAAc,MAAM;EACnC;EACA;EACA,OAAO;EACP,eAAe;;cAGX,aAAY,UAAA,MAAA,SAAA,MAAA,OAAA,cAAA,eAAA,WAAA,cAAA,iBAAA,SAUf,0BAAK,IAAA"}
1
+ {"version":3,"file":"dropdown.d.mts","names":[],"sources":["../../../src/components/molecules/dropdown.tsx"],"mappings":";;KAYK,sBAAsB;iBAEV,cAAc,MAAM;EACnC;EACA;EACA,OAAO;EACP,eAAe;;cAGX,aAAY,UAAA,MAAA,SAAA,MAAA,OAAA,cAAA,eAAA,WAAA,cAAA,iBAAA,SAUf,0BAAK,IAAA"}
@@ -1,16 +1,26 @@
1
- import Breadcrumb, { Props } from "../../Breadcrumb.mjs";
2
- import Card, { Props as Props$1 } from "../../Card.mjs";
3
- import Menu, { Props as Props$2 } from "./menu/menu.mjs";
4
- import Pagination, { Props as Props$3 } from "../../Pagination.mjs";
5
- import { Props as Props$4 } from "./reveals/reveals.mjs";
1
+ import Alert, { Props } from "../../Alert.mjs";
2
+ import Anchor, { Item, Props as Props$1 } from "../../Anchor.mjs";
3
+ import Breadcrumb, { Props as Props$2 } from "../../Breadcrumb.mjs";
4
+ import Card, { Props as Props$3 } from "../../Card.mjs";
5
+ import ContextMenu, { Item as Item$1, Props as Props$4 } from "../../ContextMenu.mjs";
6
+ import Descriptions, { Columns, Item as Item$2, Props as Props$5 } from "../../Descriptions.mjs";
7
+ import Menu, { Props as Props$6 } from "./menu/menu.mjs";
8
+ import Pagination, { Props as Props$7 } from "../../Pagination.mjs";
9
+ import Popconfirm, { Props as Props$8 } from "../../Popconfirm.mjs";
10
+ import { Props as Props$9 } from "./reveals/reveals.mjs";
6
11
  import Reveals from "../../Reveals.mjs";
7
- import Space, { Props as Props$5 } from "../../Space.mjs";
8
- import Collapse, { Props as Props$6 } from "./collapse.mjs";
9
- import Dropdown, { Props as Props$7 } from "./dropdown.mjs";
10
- import { Props as Props$8 } from "./marquees/marquees.mjs";
12
+ import ScrollArea, { Props as Props$10 } from "../../ScrollArea.mjs";
13
+ import Space, { Props as Props$11 } from "../../Space.mjs";
14
+ import Statistic, { Props as Props$12 } from "../../Statistic.mjs";
15
+ import Steps, { Item as Item$3, Props as Props$13 } from "../../Steps.mjs";
16
+ import Timeline, { Item as Item$4, Props as Props$14, Timestamp } from "../../Timeline.mjs";
17
+ import Transfer, { Item as Item$5, Props as Props$15 } from "../../Transfer.mjs";
18
+ import Collapse, { Props as Props$16 } from "./collapse.mjs";
19
+ import Dropdown, { Props as Props$17 } from "./dropdown.mjs";
20
+ import { Props as Props$18 } from "./marquees/marquees.mjs";
11
21
  import Marquees from "./marquees/index.mjs";
12
- import { Props as Props$9 } from "./splitter/splitter.mjs";
22
+ import { Props as Props$19 } from "./splitter/splitter.mjs";
13
23
  import Splitter from "./splitter/index.mjs";
14
- import Tabs, { Props as Props$10 } from "./tabs.mjs";
15
- import Upload, { Props as Props$11, UploadFile } from "./upload.mjs";
16
- export { Breadcrumb, type Props as BreadcrumbProps, Card, type Props$1 as CardProps, Collapse, type Props$6 as CollapseProps, Dropdown, type Props$7 as DropdownProps, Marquees, type Props$8 as MarqueesProps, Menu, type Props$2 as MenuProps, Pagination, type Props$3 as PaginationProps, Reveals, type Props$4 as RevealsProps, Space, type Props$5 as SpaceProps, Splitter, type Props$9 as SplitterProps, Tabs, type Props$10 as TabsProps, Upload, type UploadFile, type Props$11 as UploadProps };
24
+ import Tabs, { Props as Props$20 } from "./tabs.mjs";
25
+ import Upload, { Props as Props$21, UploadFile } from "./upload.mjs";
26
+ export { Alert, type Props as AlertProps, Anchor, type Item as AnchorItem, type Props$1 as AnchorProps, Breadcrumb, type Props$2 as BreadcrumbProps, Card, type Props$3 as CardProps, Collapse, type Props$16 as CollapseProps, ContextMenu, type Item$1 as ContextMenuItem, type Props$4 as ContextMenuProps, type Item$2 as DescriptionItem, Descriptions, type Columns as DescriptionsColumns, type Props$5 as DescriptionsProps, Dropdown, type Props$17 as DropdownProps, Marquees, type Props$18 as MarqueesProps, Menu, type Props$6 as MenuProps, Pagination, type Props$7 as PaginationProps, Popconfirm, type Props$8 as PopconfirmProps, Reveals, type Props$9 as RevealsProps, ScrollArea, type Props$10 as ScrollAreaProps, Space, type Props$11 as SpaceProps, Splitter, type Props$19 as SplitterProps, Statistic, type Props$12 as StatisticProps, type Item$3 as StepItem, Steps, type Props$13 as StepsProps, Tabs, type Props$20 as TabsProps, Timeline, type Item$4 as TimelineItem, type Props$14 as TimelineProps, type Timestamp as TimelineTimestamp, Transfer, type Item$5 as TransferItem, type Props$15 as TransferProps, Upload, type UploadFile, type Props$21 as UploadProps };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/components/molecules/marquees/index.ts"],"mappings":";;;KAGK,2BAA2B;EAAiB,aAAa;;cAExD,UAA2B"}
1
+ {"version":3,"file":"index.d.mts","names":["MarqueesImpl"],"sources":["../../../../src/components/molecules/marquees/index.ts"],"mappings":";;;KAGK,2BAA2BA;EAAiB,aAAa;;cAExD,UAA2B"}
@@ -1,5 +1,5 @@
1
1
  //#region src/components/molecules/marquees/item.d.ts
2
- interface ItemProps {
2
+ export interface ItemProps {
3
3
  key?: React.Key;
4
4
  speed?: number;
5
5
  autoFill?: boolean | number;
@@ -8,10 +8,10 @@ interface ItemProps {
8
8
  gap?: number;
9
9
  children?: React.ReactNode;
10
10
  }
11
- interface Props extends Omit<React.ComponentPropsWithoutRef<'div'>, 'key'>, ItemProps {
11
+ export interface Props extends Omit<React.ComponentPropsWithoutRef<'div'>, 'key'>, ItemProps {
12
12
  width: string | number;
13
13
  }
14
- declare const Item: ({ width: _width, speed, autoFill, pause: _pause, pauseOnHover, gap, children }: Props) => import("react").JSX.Element;
14
+ declare const Item: ({ width: _width, speed, autoFill, pause, pauseOnHover, gap, children }: Props) => import("react").JSX.Element;
15
15
  //#endregion
16
- export { ItemProps, Props, Item as default };
16
+ export { Item as default };
17
17
  //# sourceMappingURL=item.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"item.d.mts","names":[],"sources":["../../../../src/components/molecules/marquees/item.tsx"],"mappings":";UASiB;EACf,MAAM,MAAM;EACZ;EACA;EACA;EACA;EACA;EACA,WAAW,MAAM;;UAGF,cACP,KAAK,MAAM,yCAAyC;EAC5D;;cAoBI,SAAQ,OAAA,QAAA,OAAA,UAAA,OAAA,QAAA,cAAA,KAAA,YAQX,0BAAK,IAAA"}
1
+ {"version":3,"file":"item.d.mts","names":[],"sources":["../../../../src/components/molecules/marquees/item.tsx"],"mappings":";iBAQiB;EACf,MAAM,MAAM;EACZ;EACA;EACA;EACA;EACA;EACA,WAAW,MAAM;;iBAGF,cACP,KAAK,MAAM,yCAAyC;EAC5D;;cAoBI,SAAQ,OAAA,QAAA,OAAA,UAAA,OAAA,cAAA,KAAA,YAQX,0BAAK,IAAA"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import usePauseOnHover from "./use-pause-on-hover.mjs";
3
2
  import { useEffect, useRef, useState } from "react";
3
+ import { useHoverOrFocusWithin } from "@jbpark/use-hooks";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { useGSAP } from "@gsap/react";
6
6
  import { gsap } from "gsap";
@@ -10,12 +10,12 @@ const resolveInitialRepeatCount = (autoFill) => {
10
10
  if (!autoFill) return 0;
11
11
  return typeof autoFill === "boolean" ? INITIAL_AUTO_FILL_GUESS : autoFill;
12
12
  };
13
- const Item = ({ width: _width, speed = 100, autoFill = false, pause: _pause = false, pauseOnHover = false, gap = 0, children }) => {
13
+ const Item = ({ width: _width, speed = 100, autoFill = false, pause = false, pauseOnHover = false, gap = 0, children }) => {
14
14
  const itemRefs = useRef([]);
15
15
  const containerRef = useRef(null);
16
16
  const tweenRef = useRef(null);
17
17
  const [width, setWidth] = useState(_width);
18
- const { pause, hoverEvents } = usePauseOnHover(pauseOnHover);
18
+ const { active: isHoverOrFocusPaused, handlers } = useHoverOrFocusWithin({ enabled: pauseOnHover });
19
19
  const [repeatCount, setRepeatCount] = useState(resolveInitialRepeatCount(autoFill));
20
20
  const [prevWidthProp, setPrevWidthProp] = useState(_width);
21
21
  const [prevAutoFill, setPrevAutoFill] = useState(autoFill);
@@ -33,7 +33,7 @@ const Item = ({ width: _width, speed = 100, autoFill = false, pause: _pause = fa
33
33
  setWidth(_width);
34
34
  setRepeatCount(resolveInitialRepeatCount(autoFill));
35
35
  }
36
- const isPaused = _pause || pause;
36
+ const isPaused = pause || isHoverOrFocusPaused;
37
37
  useEffect(() => {
38
38
  if (!autoFill || !children || !itemRefs.current[0] || typeof width === "string") return;
39
39
  const itemWidth = itemRefs.current[0].offsetWidth;
@@ -79,7 +79,7 @@ const Item = ({ width: _width, speed = 100, autoFill = false, pause: _pause = fa
79
79
  }, [isPaused]);
80
80
  return /* @__PURE__ */ jsx("div", {
81
81
  className: "flex overflow-hidden",
82
- ...hoverEvents,
82
+ ...handlers,
83
83
  children: /* @__PURE__ */ jsx("div", {
84
84
  ref: containerRef,
85
85
  className: "flex flex-nowrap",
@@ -1 +1 @@
1
- {"version":3,"file":"item.mjs","names":[],"sources":["../../../../src/components/molecules/marquees/item.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { useGSAP } from '@gsap/react';\nimport { gsap } from 'gsap';\n\nimport usePauseOnHover from './use-pause-on-hover';\n\nexport interface ItemProps {\n key?: React.Key;\n speed?: number;\n autoFill?: boolean | number;\n pause?: boolean;\n pauseOnHover?: boolean;\n gap?: number;\n children?: React.ReactNode;\n}\n\nexport interface Props\n extends Omit<React.ComponentPropsWithoutRef<'div'>, 'key'>, ItemProps {\n width: string | number;\n}\n\n// `autoFill={true}` (the default on `Marquees`) needs *some* repeat count\n// before the item can be measured and the real count computed — this is\n// only ever visible for that one render, but rendering 100 copies (200\n// with the 2x loop duplication) up front was needlessly heavy for the\n// common case. A modest guess still avoids visible gaps for typical\n// item/container width ratios while cutting the worst-case default\n// render by ~90%.\nconst INITIAL_AUTO_FILL_GUESS = 10;\n\nconst resolveInitialRepeatCount = (autoFill: boolean | number) => {\n if (!autoFill) {\n return 0;\n }\n\n return typeof autoFill === 'boolean' ? INITIAL_AUTO_FILL_GUESS : autoFill;\n};\n\nconst Item = ({\n width: _width,\n speed = 100,\n autoFill = false,\n pause: _pause = false,\n pauseOnHover = false,\n gap = 0,\n children,\n}: Props) => {\n const itemRefs = useRef<HTMLDivElement[]>([]);\n const containerRef = useRef<HTMLDivElement>(null);\n const tweenRef = useRef<gsap.core.Tween | null>(null);\n\n const [width, setWidth] = useState<string | number>(_width);\n const { pause, hoverEvents } = usePauseOnHover(pauseOnHover);\n const [repeatCount, setRepeatCount] = useState(\n resolveInitialRepeatCount(autoFill),\n );\n const [prevWidthProp, setPrevWidthProp] = useState(_width);\n const [prevAutoFill, setPrevAutoFill] = useState(autoFill);\n const [prevGap, setPrevGap] = useState(gap);\n\n // Adjusted directly in render (React's \"adjust state during render\"\n // pattern) instead of an effect, so `width`/`repeatCount` re-sync with\n // the prop in the same render it changes rather than the render after.\n if (_width !== prevWidthProp) {\n setPrevWidthProp(_width);\n setWidth(_width);\n }\n\n if (autoFill !== prevAutoFill) {\n setPrevAutoFill(autoFill);\n setRepeatCount(resolveInitialRepeatCount(autoFill));\n }\n\n // `gap` widens every copy, so both the measured item width and the repeat\n // count derived from it are stale. Rewind `width` to the container width\n // so the measuring effect below recomputes the loop distance from scratch.\n if (gap !== prevGap) {\n setPrevGap(gap);\n setWidth(_width);\n setRepeatCount(resolveInitialRepeatCount(autoFill));\n }\n\n const isPaused = _pause || pause;\n\n useEffect(() => {\n if (\n !autoFill ||\n !children ||\n !itemRefs.current[0] ||\n typeof width === 'string'\n ) {\n return;\n }\n\n // `offsetWidth` is the border-box width, so it already includes the\n // `gap` padding each copy carries — the loop distance stays exact\n // without adding `gap` back in here.\n const itemWidth = itemRefs.current[0].offsetWidth;\n\n if (itemWidth >= width) {\n setWidth(itemWidth);\n setRepeatCount(0);\n return;\n }\n\n let totalWidth = 0;\n let repeatCount = 0;\n\n while (totalWidth < width) {\n totalWidth += itemWidth;\n repeatCount += 1;\n }\n\n setWidth(totalWidth);\n setRepeatCount(repeatCount - 1);\n }, [autoFill, width, children, gap]);\n\n useGSAP(\n () => {\n if (!containerRef.current || typeof width === 'string') {\n return;\n }\n\n if (tweenRef.current) {\n tweenRef.current.kill();\n }\n\n tweenRef.current = gsap.fromTo(\n containerRef.current,\n { x: 0 },\n {\n x: -width,\n duration: width / speed,\n repeat: -1,\n ease: 'linear',\n },\n );\n\n return () => {\n tweenRef.current?.kill();\n };\n },\n {\n scope: containerRef,\n dependencies: [width, speed],\n },\n );\n\n useEffect(() => {\n if (!tweenRef.current) {\n return;\n }\n\n if (isPaused) {\n tweenRef.current.pause();\n } else {\n tweenRef.current.play();\n }\n }, [isPaused]);\n\n return (\n <div\n className=\"flex overflow-hidden\"\n {...hoverEvents}\n //\n >\n <div ref={containerRef} className=\"flex flex-nowrap\">\n {[...Array(2)].map((_, index) => (\n <div\n key={index}\n style={{ minWidth: width }}\n className=\"flex flex-nowrap\"\n >\n {/* Every copy carries the same trailing `gap`, so the spacing is\n uniform at the seam between copies and between the two loop\n halves — no special-casing at either boundary. */}\n <div\n ref={el => {\n if (el) {\n itemRefs.current[index] = el;\n }\n }}\n style={{ paddingRight: gap }}\n >\n {children}\n </div>\n {[\n ...Array(typeof autoFill === 'number' ? autoFill : repeatCount),\n ].map((_, i) => (\n <div key={i} style={{ paddingRight: gap }}>\n {children}\n </div>\n ))}\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nexport default Item;\n"],"mappings":";;;;;;;AA+BA,MAAM,0BAA0B;AAEhC,MAAM,6BAA6B,aAA+B;CAChE,IAAI,CAAC,UACH,OAAO;CAGT,OAAO,OAAO,aAAa,YAAY,0BAA0B;AACnE;AAEA,MAAM,QAAQ,EACZ,OAAO,QACP,QAAQ,KACR,WAAW,OACX,OAAO,SAAS,OAChB,eAAe,OACf,MAAM,GACN,eACW;CACX,MAAM,WAAW,OAAyB,CAAC,CAAC;CAC5C,MAAM,eAAe,OAAuB,IAAI;CAChD,MAAM,WAAW,OAA+B,IAAI;CAEpD,MAAM,CAAC,OAAO,YAAY,SAA0B,MAAM;CAC1D,MAAM,EAAE,OAAO,gBAAgB,gBAAgB,YAAY;CAC3D,MAAM,CAAC,aAAa,kBAAkB,SACpC,0BAA0B,QAAQ,CACpC;CACA,MAAM,CAAC,eAAe,oBAAoB,SAAS,MAAM;CACzD,MAAM,CAAC,cAAc,mBAAmB,SAAS,QAAQ;CACzD,MAAM,CAAC,SAAS,cAAc,SAAS,GAAG;CAK1C,IAAI,WAAW,eAAe;EAC5B,iBAAiB,MAAM;EACvB,SAAS,MAAM;CACjB;CAEA,IAAI,aAAa,cAAc;EAC7B,gBAAgB,QAAQ;EACxB,eAAe,0BAA0B,QAAQ,CAAC;CACpD;CAKA,IAAI,QAAQ,SAAS;EACnB,WAAW,GAAG;EACd,SAAS,MAAM;EACf,eAAe,0BAA0B,QAAQ,CAAC;CACpD;CAEA,MAAM,WAAW,UAAU;CAE3B,gBAAgB;EACd,IACE,CAAC,YACD,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W,WAAW,WAAW,CAChE,CAAC,CAAC,KAAK,GAAG,MACR,oBAAC,OAAD;KAAa,OAAO,EAAE,cAAc,IAAI;KACrC;IACE,GAFK,CAEL,CACN,CACE;GAxBE,GAAA,KAwBF,CACN;EACE,CAAA;CACF,CAAA;AAET"}
1
+ {"version":3,"file":"item.mjs","names":[],"sources":["../../../../src/components/molecules/marquees/item.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { useGSAP } from '@gsap/react';\nimport { useHoverOrFocusWithin } from '@jbpark/use-hooks';\nimport { gsap } from 'gsap';\n\nexport interface ItemProps {\n key?: React.Key;\n speed?: number;\n autoFill?: boolean | number;\n pause?: boolean;\n pauseOnHover?: boolean;\n gap?: number;\n children?: React.ReactNode;\n}\n\nexport interface Props\n extends Omit<React.ComponentPropsWithoutRef<'div'>, 'key'>, ItemProps {\n width: string | number;\n}\n\n// `autoFill={true}` (the default on `Marquees`) needs *some* repeat count\n// before the item can be measured and the real count computed — this is\n// only ever visible for that one render, but rendering 100 copies (200\n// with the 2x loop duplication) up front was needlessly heavy for the\n// common case. A modest guess still avoids visible gaps for typical\n// item/container width ratios while cutting the worst-case default\n// render by ~90%.\nconst INITIAL_AUTO_FILL_GUESS = 10;\n\nconst resolveInitialRepeatCount = (autoFill: boolean | number) => {\n if (!autoFill) {\n return 0;\n }\n\n return typeof autoFill === 'boolean' ? INITIAL_AUTO_FILL_GUESS : autoFill;\n};\n\nconst Item = ({\n width: _width,\n speed = 100,\n autoFill = false,\n pause = false,\n pauseOnHover = false,\n gap = 0,\n children,\n}: Props) => {\n const itemRefs = useRef<HTMLDivElement[]>([]);\n const containerRef = useRef<HTMLDivElement>(null);\n const tweenRef = useRef<gsap.core.Tween | null>(null);\n\n const [width, setWidth] = useState<string | number>(_width);\n const { active: isHoverOrFocusPaused, handlers } = useHoverOrFocusWithin({\n enabled: pauseOnHover,\n });\n const [repeatCount, setRepeatCount] = useState(\n resolveInitialRepeatCount(autoFill),\n );\n const [prevWidthProp, setPrevWidthProp] = useState(_width);\n const [prevAutoFill, setPrevAutoFill] = useState(autoFill);\n const [prevGap, setPrevGap] = useState(gap);\n\n // Adjusted directly in render (React's \"adjust state during render\"\n // pattern) instead of an effect, so `width`/`repeatCount` re-sync with\n // the prop in the same render it changes rather than the render after.\n if (_width !== prevWidthProp) {\n setPrevWidthProp(_width);\n setWidth(_width);\n }\n\n if (autoFill !== prevAutoFill) {\n setPrevAutoFill(autoFill);\n setRepeatCount(resolveInitialRepeatCount(autoFill));\n }\n\n // `gap` widens every copy, so both the measured item width and the repeat\n // count derived from it are stale. Rewind `width` to the container width\n // so the measuring effect below recomputes the loop distance from scratch.\n if (gap !== prevGap) {\n setPrevGap(gap);\n setWidth(_width);\n setRepeatCount(resolveInitialRepeatCount(autoFill));\n }\n\n const isPaused = pause || isHoverOrFocusPaused;\n\n useEffect(() => {\n if (\n !autoFill ||\n !children ||\n !itemRefs.current[0] ||\n typeof width === 'string'\n ) {\n return;\n }\n\n // `offsetWidth` is the border-box width, so it already includes the\n // `gap` padding each copy carries — the loop distance stays exact\n // without adding `gap` back in here.\n const itemWidth = itemRefs.current[0].offsetWidth;\n\n if (itemWidth >= width) {\n setWidth(itemWidth);\n setRepeatCount(0);\n return;\n }\n\n let totalWidth = 0;\n let repeatCount = 0;\n\n while (totalWidth < width) {\n totalWidth += itemWidth;\n repeatCount += 1;\n }\n\n setWidth(totalWidth);\n setRepeatCount(repeatCount - 1);\n }, [autoFill, width, children, gap]);\n\n useGSAP(\n () => {\n if (!containerRef.current || typeof width === 'string') {\n return;\n }\n\n if (tweenRef.current) {\n tweenRef.current.kill();\n }\n\n tweenRef.current = gsap.fromTo(\n containerRef.current,\n { x: 0 },\n {\n x: -width,\n duration: width / speed,\n repeat: -1,\n ease: 'linear',\n },\n );\n\n return () => {\n tweenRef.current?.kill();\n };\n },\n {\n scope: containerRef,\n dependencies: [width, speed],\n },\n );\n\n useEffect(() => {\n if (!tweenRef.current) {\n return;\n }\n\n if (isPaused) {\n tweenRef.current.pause();\n } else {\n tweenRef.current.play();\n }\n }, [isPaused]);\n\n return (\n <div\n className=\"flex overflow-hidden\"\n {...handlers}\n //\n >\n <div ref={containerRef} className=\"flex flex-nowrap\">\n {[...Array(2)].map((_, index) => (\n <div\n key={index}\n style={{ minWidth: width }}\n className=\"flex flex-nowrap\"\n >\n {/* Every copy carries the same trailing `gap`, so the spacing is\n uniform at the seam between copies and between the two loop\n halves — no special-casing at either boundary. */}\n <div\n ref={el => {\n if (el) {\n itemRefs.current[index] = el;\n }\n }}\n style={{ paddingRight: gap }}\n >\n {children}\n </div>\n {[\n ...Array(typeof autoFill === 'number' ? autoFill : repeatCount),\n ].map((_, i) => (\n <div key={i} style={{ paddingRight: gap }}>\n {children}\n </div>\n ))}\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nexport default Item;\n"],"mappings":";;;;;;;AA8BA,MAAM,0BAA0B;AAEhC,MAAM,6BAA6B,aAA+B;CAChE,IAAI,CAAC,UACH,OAAO;CAGT,OAAO,OAAO,aAAa,YAAY,0BAA0B;AACnE;AAEA,MAAM,QAAQ,EACZ,OAAO,QACP,QAAQ,KACR,WAAW,OACX,QAAQ,OACR,eAAe,OACf,MAAM,GACN,eACW;CACX,MAAM,WAAW,OAAyB,CAAC,CAAC;CAC5C,MAAM,eAAe,OAAuB,IAAI;CAChD,MAAM,WAAW,OAA+B,IAAI;CAEpD,MAAM,CAAC,OAAO,YAAY,SAA0B,MAAM;CAC1D,MAAM,EAAE,QAAQ,sBAAsB,aAAa,sBAAsB,EACvE,SAAS,aACX,CAAC;CACD,MAAM,CAAC,aAAa,kBAAkB,SACpC,0BAA0B,QAAQ,CACpC;CACA,MAAM,CAAC,eAAe,oBAAoB,SAAS,MAAM;CACzD,MAAM,CAAC,cAAc,mBAAmB,SAAS,QAAQ;CACzD,MAAM,CAAC,SAAS,cAAc,SAAS,GAAG;CAK1C,IAAI,WAAW,eAAe;EAC5B,iBAAiB,MAAM;EAC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AAC,CAAC,CAAC,KAAK,GAAG,UACrB,qBAAC,OAAD;IAEE,OAAO,EAAE,UAAU,MAAM;IACzB,WAAU;IAHZ,UAAA,CAQE,oBAAC,OAAD;KACE,MAAK,OAAM;MACT,IAAI,IACF,SAAS,QAAQ,SAAS;KAE9B;KACA,OAAO,EAAE,cAAc,IAAI;KAE1B;IACE,CAAA,GACJ,CACC,GAAG,MAAM,OAAO,aAAa,WAAW,WAAW,WAAW,CAChE,CAAC,CAAC,KAAK,GAAG,MACR,oBAAC,OAAD;KAAa,OAAO,EAAE,cAAc,IAAI;KACrC;IACE,GAFK,CAEL,CACN,CACE;GAxBE,GAAA,KAwBF,CACN;EACE,CAAA;CACF,CAAA;AAET"}
@@ -1,6 +1,6 @@
1
1
  import { ItemProps } from "./item.mjs";
2
2
  //#region src/components/molecules/marquees/marquees.d.ts
3
- interface Props extends React.ComponentPropsWithoutRef<'div'> {
3
+ export interface Props extends React.ComponentPropsWithoutRef<'div'> {
4
4
  speed?: number;
5
5
  autoFill?: boolean | number;
6
6
  pauseOnHover?: boolean;
@@ -9,5 +9,5 @@ interface Props extends React.ComponentPropsWithoutRef<'div'> {
9
9
  }
10
10
  declare const Marquees: ({ className, items, speed, pauseOnHover, autoFill, gap, ...props }: Props) => import("react").JSX.Element;
11
11
  //#endregion
12
- export { Props, Marquees as default };
12
+ export { Marquees as default };
13
13
  //# sourceMappingURL=marquees.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"marquees.d.mts","names":[],"sources":["../../../../src/components/molecules/marquees/marquees.tsx"],"mappings":";;UAeiB,cAAc,MAAM;EACnC;EACA;EACA;EACA;EACA,QAAQ;;cAGJ,aAAY,WAAA,OAAA,OAAA,cAAA,UAAA,QAAA,SAQf,0BAAK,IAAA"}
1
+ {"version":3,"file":"marquees.d.mts","names":[],"sources":["../../../../src/components/molecules/marquees/marquees.tsx"],"mappings":";;iBAeiB,cAAc,MAAM;EACnC;EACA;EACA;EACA;EACA,QAAQ;;cAGJ,aAAY,WAAA,OAAA,OAAA,cAAA,UAAA,QAAA,SAQf,0BAAK,IAAA"}
@@ -1,15 +1,14 @@
1
1
  "use client";
2
2
  import { cn } from "../../../utils.mjs";
3
- import usePauseOnHover from "./use-pause-on-hover.mjs";
4
3
  import Item from "./item.mjs";
5
4
  import { useEffect, useRef, useState } from "react";
6
- import { useMergedRef, useResponsiveSize, useThrottledValue } from "@jbpark/use-hooks";
5
+ import { useHoverOrFocusWithin, useMergedRef, useResponsiveSize, useThrottledValue } from "@jbpark/use-hooks";
7
6
  import { jsx } from "react/jsx-runtime";
8
7
  //#region src/components/molecules/marquees/marquees.tsx
9
8
  const Marquees = ({ className, items, speed, pauseOnHover = true, autoFill = true, gap, ...props }) => {
10
9
  const [width, setWidth] = useState("100%");
11
10
  const [padding, setPadding] = useState(0);
12
- const { pause, hoverEvents } = usePauseOnHover(pauseOnHover);
11
+ const { active: isPaused, handlers } = useHoverOrFocusWithin({ enabled: pauseOnHover });
13
12
  const throttledWidth = useThrottledValue(width, 200);
14
13
  const { size, ref: responsiveRef } = useResponsiveSize();
15
14
  const containerRef = useRef(null);
@@ -25,14 +24,14 @@ const Marquees = ({ className, items, speed, pauseOnHover = true, autoFill = tru
25
24
  return /* @__PURE__ */ jsx("div", {
26
25
  ref: setContainerRef,
27
26
  className: cn(className),
28
- ...hoverEvents,
27
+ ...handlers,
29
28
  ...props,
30
29
  children: /* @__PURE__ */ jsx("div", {
31
30
  className: cn("flex flex-col gap-y-5", "overflow-hidden", "whitespace-nowrap", "bg-inherit"),
32
31
  style: { width: typeof throttledWidth === "number" ? throttledWidth - padding : throttledWidth },
33
32
  children: items?.map(({ children, key: itemKey, ...item }, key) => /* @__PURE__ */ jsx(Item, {
34
33
  width: throttledWidth,
35
- pause,
34
+ pause: isPaused,
36
35
  speed,
37
36
  autoFill,
38
37
  gap,
@@ -1 +1 @@
1
- {"version":3,"file":"marquees.mjs","names":[],"sources":["../../../../src/components/molecules/marquees/marquees.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport {\n useMergedRef,\n useResponsiveSize,\n useThrottledValue,\n} from '@jbpark/use-hooks';\n\nimport { cn } from '@repo/ui/utils';\n\nimport Item, { type ItemProps } from './item';\nimport usePauseOnHover from './use-pause-on-hover';\n\nexport interface Props extends React.ComponentPropsWithoutRef<'div'> {\n speed?: number;\n autoFill?: boolean | number;\n pauseOnHover?: boolean;\n gap?: number;\n items?: ItemProps[];\n}\n\nconst Marquees = ({\n className,\n items,\n speed,\n pauseOnHover = true,\n autoFill = true,\n gap,\n ...props\n}: Props) => {\n // The container's own width, not the viewport's. `useResponsiveSize`\n // measures in a layout effect, but this component copies the result into\n // state in a passive effect and then throttles it, so the seed is what\n // paints for the first ~200ms. `100vw` overflowed every padded or columned\n // layout for that window — on the docs page it drew the track 1280px wide\n // inside a 703px column, briefly showing the whole track and giving the\n // page a horizontal scrollbar. `100%` resolves to the same value the\n // measurement lands on, so there is nothing left to snap.\n const [width, setWidth] = useState<string | number>(\n '100%',\n //\n );\n const [padding, setPadding] = useState(0);\n const { pause, hoverEvents } = usePauseOnHover(pauseOnHover);\n\n const throttledWidth = useThrottledValue(width, 200);\n\n const { size, ref: responsiveRef } = useResponsiveSize<HTMLDivElement>();\n const containerRef = useRef<HTMLDivElement | null>(null);\n const setContainerRef = useMergedRef(containerRef, responsiveRef);\n\n useEffect(() => {\n if (!size.width || !containerRef.current) {\n return;\n }\n\n const computedStyle = getComputedStyle(containerRef.current);\n const paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;\n const paddingRight = parseFloat(computedStyle.paddingRight) || 0;\n\n setPadding(paddingLeft + paddingRight);\n\n setWidth(size.width);\n }, [size]);\n\n return (\n <div\n ref={setContainerRef}\n className={cn(\n className,\n //\n )}\n {...hoverEvents}\n {...props}\n >\n <div\n className={cn(\n 'flex flex-col gap-y-5',\n 'overflow-hidden',\n 'whitespace-nowrap',\n 'bg-inherit',\n //\n )}\n style={{\n width:\n typeof throttledWidth === 'number'\n ? throttledWidth - padding\n : throttledWidth,\n }}\n >\n {items?.map(({ children, key: itemKey, ...item }: ItemProps, key) => (\n <Item\n key={itemKey || key}\n width={throttledWidth}\n pause={pause}\n speed={speed}\n autoFill={autoFill}\n gap={gap}\n {...item}\n >\n {children}\n </Item>\n ))}\n </div>\n </div>\n );\n};\n\nexport default Marquees;\n"],"mappings":";;;;;;;;AAuBA,MAAM,YAAY,EAChB,WACA,OACA,OACA,eAAe,MACf,WAAW,MACX,KACA,GAAG,YACQ;CASX,MAAM,CAAC,OAAO,YAAY,SACxB,MAEF;CACA,MAAM,CAAC,SAAS,cAAc,SAAS,CAAC;CACxC,MAAM,EAAE,OAAO,gBAAgB,gBAAgB,YAAY;CAE3D,MAAM,iBAAiB,kBAAkB,OAAO,GAAG;CAEnD,MAAM,EAAE,MAAM,KAAK,kBAAkB,kBAAkC;CACvE,MAAM,eAAe,OAA8B,IAAI;CACvD,MAAM,kBAAkB,aAAa,cAAc,aAAa;CAEhE,gBAAgB;EACd,IAAI,CAAC,KAAK,SAAS,CAAC,aAAa,SAC/B;EAGF,MAAM,gBAAgB,iBAAiB,aAAa,OAAO;EAC3D,MAAM,cAAc,WAAW,cAAc,WAAW,KAAK;EAC7D,MAAM,eAAe,WAAW,cAAc,YAAY,KAAK;EAE/D,WAAW,cAAc,YAAY;EAErC,SAAS,KAAK,KAAK;CACrB,GAAG,CAAC,IAAI,CAAC;CAET,OACE,oBAAC,OAAD;EACE,KAAK;EACL,WAAW,GACT,SAEF;EACA,GAAI;EACJ,GAAI;EAEJ,UAAA,oBAAC,OAAD;GACE,WAAW,GACT,yBACA,mBACA,qBACA,YAEF;GACA,OAAO,EACL,OACE,OAAO,mBAAmB,WACtB,iBAAiB,UACjB,eACR;GAEC,UAAA,OAAO,KAAK,EAAE,UAAU,KAAK,SAAS,GAAG,QAAmB,QAC3D,oBAAC,MAAD;IAEE,OAAO;IACA;IACA;IACG;IACL;IACL,GAAI;IAEH;GACG,GATC,WAAW,GASZ,CACP;EACE,CAAA;CACF,CAAA;AAET"}
1
+ {"version":3,"file":"marquees.mjs","names":[],"sources":["../../../../src/components/molecules/marquees/marquees.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport {\n useHoverOrFocusWithin,\n useMergedRef,\n useResponsiveSize,\n useThrottledValue,\n} from '@jbpark/use-hooks';\n\nimport { cn } from '@repo/ui/utils';\n\nimport Item, { type ItemProps } from './item';\n\nexport interface Props extends React.ComponentPropsWithoutRef<'div'> {\n speed?: number;\n autoFill?: boolean | number;\n pauseOnHover?: boolean;\n gap?: number;\n items?: ItemProps[];\n}\n\nconst Marquees = ({\n className,\n items,\n speed,\n pauseOnHover = true,\n autoFill = true,\n gap,\n ...props\n}: Props) => {\n // The container's own width, not the viewport's. `useResponsiveSize`\n // measures in a layout effect, but this component copies the result into\n // state in a passive effect and then throttles it, so the seed is what\n // paints for the first ~200ms. `100vw` overflowed every padded or columned\n // layout for that window — on the docs page it drew the track 1280px wide\n // inside a 703px column, briefly showing the whole track and giving the\n // page a horizontal scrollbar. `100%` resolves to the same value the\n // measurement lands on, so there is nothing left to snap.\n const [width, setWidth] = useState<string | number>(\n '100%',\n //\n );\n const [padding, setPadding] = useState(0);\n const { active: isPaused, handlers } = useHoverOrFocusWithin({\n enabled: pauseOnHover,\n });\n\n const throttledWidth = useThrottledValue(width, 200);\n\n const { size, ref: responsiveRef } = useResponsiveSize<HTMLDivElement>();\n const containerRef = useRef<HTMLDivElement | null>(null);\n const setContainerRef = useMergedRef(containerRef, responsiveRef);\n\n useEffect(() => {\n if (!size.width || !containerRef.current) {\n return;\n }\n\n const computedStyle = getComputedStyle(containerRef.current);\n const paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;\n const paddingRight = parseFloat(computedStyle.paddingRight) || 0;\n\n setPadding(paddingLeft + paddingRight);\n\n setWidth(size.width);\n }, [size]);\n\n return (\n <div\n ref={setContainerRef}\n className={cn(\n className,\n //\n )}\n {...handlers}\n {...props}\n >\n <div\n className={cn(\n 'flex flex-col gap-y-5',\n 'overflow-hidden',\n 'whitespace-nowrap',\n 'bg-inherit',\n //\n )}\n style={{\n width:\n typeof throttledWidth === 'number'\n ? throttledWidth - padding\n : throttledWidth,\n }}\n >\n {items?.map(({ children, key: itemKey, ...item }: ItemProps, key) => (\n <Item\n key={itemKey || key}\n width={throttledWidth}\n pause={isPaused}\n speed={speed}\n autoFill={autoFill}\n gap={gap}\n {...item}\n >\n {children}\n </Item>\n ))}\n </div>\n </div>\n );\n};\n\nexport default Marquees;\n"],"mappings":";;;;;;;AAuBA,MAAM,YAAY,EAChB,WACA,OACA,OACA,eAAe,MACf,WAAW,MACX,KACA,GAAG,YACQ;CASX,MAAM,CAAC,OAAO,YAAY,SACxB,MAEF;CACA,MAAM,CAAC,SAAS,cAAc,SAAS,CAAC;CACxC,MAAM,EAAE,QAAQ,UAAU,aAAa,sBAAsB,EAC3D,SAAS,aACX,CAAC;CAED,MAAM,iBAAiB,kBAAkB,OAAO,GAAG;CAEnD,MAAM,EAAE,MAAM,KAAK,kBAAkB,kBAAkC;CACvE,MAAM,eAAe,OAA8B,IAAI;CACvD,MAAM,kBAAkB,aAAa,cAAc,aAAa;CAEhE,gBAAgB;EACd,IAAI,CAAC,KAAK,SAAS,CAAC,aAAa,SAC/B;EAGF,MAAM,gBAAgB,iBAAiB,aAAa,OAAO;EAC3D,MAAM,cAAc,WAAW,cAAc,WAAW,KAAK;EAC7D,MAAM,eAAe,WAAW,cAAc,YAAY,KAAK;EAE/D,WAAW,cAAc,YAAY;EAErC,SAAS,KAAK,KAAK;CACrB,GAAG,CAAC,IAAI,CAAC;CAET,OACE,oBAAC,OAAD;EACE,KAAK;EACL,WAAW,GACT,SAEF;EACA,GAAI;EACJ,GAAI;EAEJ,UAAA,oBAAC,OAAD;GACE,WAAW,GACT,yBACA,mBACA,qBACA,YAEF;GACA,OAAO,EACL,OACE,OAAO,mBAAmB,WACtB,iBAAiB,UACjB,eACR;GAEC,UAAA,OAAO,KAAK,EAAE,UAAU,KAAK,SAAS,GAAG,QAAmB,QAC3D,oBAAC,MAAD;IAEE,OAAO;IACP,OAAO;IACA;IACG;IACL;IACL,GAAI;IAEH;GACG,GATC,WAAW,GASZ,CACP;EACE,CAAA;CACF,CAAA;AAET"}
@@ -3,8 +3,8 @@ import { cn } from "../../../../utils.mjs";
3
3
  import Label from "./label.mjs";
4
4
  import { MENU_CLASSNAMES } from "../menu.mjs";
5
5
  import { createElement, useRef, useState } from "react";
6
- import { ChevronDown } from "lucide-react";
7
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { ChevronDown } from "lucide-react";
8
8
  import { AnimatePresence, motion } from "motion/react";
9
9
  //#region src/components/molecules/menu/item/item.tsx
10
10
  const OFFSET = [8, 8];
@@ -1,12 +1,12 @@
1
1
  //#region src/components/molecules/menu/menu.d.ts
2
- interface MenuItem {
2
+ export interface MenuItem {
3
3
  label: React.ReactNode;
4
4
  key: React.Key;
5
5
  type?: string;
6
6
  path?: string;
7
7
  children?: MenuItem[];
8
8
  }
9
- interface Props {
9
+ export interface Props {
10
10
  mode?: 'horizontal' | 'vertical' | 'inline';
11
11
  selectedKeys?: React.Key[];
12
12
  defaultSelectedKeys?: React.Key[];
@@ -28,20 +28,20 @@ interface Props {
28
28
  onClick?: ClickEventHandler;
29
29
  onSelect?: ClickEventHandler;
30
30
  }
31
- interface MenuProps extends Props, Omit<React.ComponentPropsWithoutRef<'ul'>, 'onClick' | 'onSelect'> {
31
+ export interface MenuProps extends Omit<Props, 'selectionMap'>, Omit<React.ComponentPropsWithoutRef<'ul'>, 'onClick' | 'onSelect'> {
32
32
  items?: MenuItem[];
33
33
  }
34
- type ClickEventHandler = (params: {
34
+ export type ClickEventHandler = (params: {
35
35
  domEvent: React.SyntheticEvent;
36
36
  key: React.Key;
37
37
  keyPath: React.Key[];
38
38
  item: MenuItem;
39
39
  }) => void;
40
- declare const MENU_CLASSNAMES: string[];
41
- type SelectionMap = ReadonlyMap<React.Key, boolean>;
42
- declare const buildSelectionMap: (items: MenuItem[], selectedKeysSet: ReadonlySet<React.Key>) => SelectionMap;
43
- declare const findKey: (menu: MenuItem, targetKeys: ReadonlySet<React.Key>) => boolean;
40
+ export declare const MENU_CLASSNAMES: string[];
41
+ export type SelectionMap = ReadonlyMap<React.Key, boolean>;
42
+ export declare const buildSelectionMap: (items: MenuItem[], selectedKeysSet: ReadonlySet<React.Key>) => SelectionMap;
43
+ export declare const findKey: (menu: MenuItem, targetKeys: ReadonlySet<React.Key>) => boolean;
44
44
  declare const Menu: ({ items, mode, defaultSelectedKeys, selectedKeys: _selectedKeys, className, classNames, styles, offset, inlineOffset, onClick, onSelect: _onSelect, ...props }: MenuProps) => import("react").JSX.Element;
45
45
  //#endregion
46
- export { ClickEventHandler, MENU_CLASSNAMES, MenuItem, MenuProps, Props, SelectionMap, buildSelectionMap, Menu as default, findKey };
46
+ export { Menu as default };
47
47
  //# sourceMappingURL=menu.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu.d.mts","names":[],"sources":["../../../../src/components/molecules/menu/menu.tsx"],"mappings":";UAUiB;EACf,OAAO,MAAM;EACb,KAAK,MAAM;EACX;EACA;EACA,WAAW;;UAGI;EACf;EACA,eAAe,MAAM;EACrB,sBAAsB,MAAM;EAC5B,eAAe;EACf;EACA;EACA;IACE;IACA;IACA;IACA;;EAEF;IACE,WAAW,MAAM;IACjB,UAAU,MAAM;IAChB,OAAO,MAAM;IACb,QAAQ,MAAM;;EAEhB,UAAU;EACV,WAAW;;UAGI,kBAEb,OACA,KAAK,MAAM;EACb,QAAQ;;KAGE,qBAAqB;EAC/B,UAAU,MAAM;EAChB,KAAK,MAAM;EACX,SAAS,MAAM;EACf,MAAM;;cAGK;KAWD,eAAe,YAAY,MAAM;cAEhC,oBACX,OAAO,YACP,iBAAiB,YAAY,MAAM,SAClC;cAeU,UACX,MAAM,UACN,YAAY,YAAY,MAAM;cAiB1B,SAAQ,OAAA,MAAA,qBAAA,cAAA,eAAA,WAAA,YAAA,QAAA,QAAA,cAAA,SAAA,UAAA,cAAA,SAaX,8BAAS,IAAA"}
1
+ {"version":3,"file":"menu.d.mts","names":[],"sources":["../../../../src/components/molecules/menu/menu.tsx"],"mappings":";iBAUiB;EACf,OAAO,MAAM;EACb,KAAK,MAAM;EACX;EACA;EACA,WAAW;;iBAGI;EACf;EACA,eAAe,MAAM;EACrB,sBAAsB,MAAM;EAC5B,eAAe;EACf;EACA;EACA;IACE;IACA;IACA;IACA;;EAEF;IACE,WAAW,MAAM;IACjB,UAAU,MAAM;IAChB,OAAO,MAAM;IACb,QAAQ,MAAM;;EAEhB,UAAU;EACV,WAAW;;iBAGI,kBAEb,KAAK,wBACL,KAAK,MAAM;EACb,QAAQ;;YAGE,qBAAqB;EAC/B,UAAU,MAAM;EAChB,KAAK,MAAM;EACX,SAAS,MAAM;EACf,MAAM;;qBAGK;YAWD,eAAe,YAAY,MAAM;qBAEhC,oBACX,OAAO,YACP,iBAAiB,YAAY,MAAM,SAClC;qBAeU,UACX,MAAM,UACN,YAAY,YAAY,MAAM;cAiB1B,SAAQ,OAAA,MAAA,qBAAA,cAAA,eAAA,WAAA,YAAA,QAAA,QAAA,cAAA,SAAA,UAAA,cAAA,SAaX,8BAAS,IAAA"}
@@ -40,6 +40,8 @@ const Menu = ({ items, mode = "vertical", defaultSelectedKeys = [], selectedKeys
40
40
  });
41
41
  const selectedKeysSet = useMemo(() => new Set(selectedKeys ?? []), [selectedKeys]);
42
42
  const selectionMap = useMemo(() => buildSelectionMap(items ?? [], selectedKeysSet), [items, selectedKeysSet]);
43
+ const rootProps = { ...props };
44
+ Reflect.deleteProperty(rootProps, "selectionMap");
43
45
  const onSelect = (params) => {
44
46
  setSelectedKeys([params.key]);
45
47
  _onSelect?.(params);
@@ -48,7 +50,7 @@ const Menu = ({ items, mode = "vertical", defaultSelectedKeys = [], selectedKeys
48
50
  "data-slot": "menu",
49
51
  role: "menu",
50
52
  className: cn(MENU_CLASSNAMES, mode === "horizontal" ? "flex" : "inline-block", className),
51
- ...props,
53
+ ...rootProps,
52
54
  children: items?.map((item, index) => /* @__PURE__ */ createElement(Item, {
53
55
  root: true,
54
56
  ...item,
@@ -1 +1 @@
1
- {"version":3,"file":"menu.mjs","names":[],"sources":["../../../../src/components/molecules/menu/menu.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nimport { useControllableState } from '@jbpark/use-hooks';\n\nimport { cn } from '@repo/ui/utils';\n\nimport Item from './item';\n\nexport interface MenuItem {\n label: React.ReactNode;\n key: React.Key;\n type?: string;\n path?: string;\n children?: MenuItem[];\n}\n\nexport interface Props {\n mode?: 'horizontal' | 'vertical' | 'inline';\n selectedKeys?: React.Key[];\n defaultSelectedKeys?: React.Key[];\n selectionMap?: SelectionMap;\n offset?: [number, number];\n inlineOffset?: number;\n classNames?: {\n rootItem?: string;\n subMenu?: string;\n item?: string;\n label?: string;\n };\n styles?: {\n rootItem?: React.CSSProperties;\n subMenu?: React.CSSProperties;\n item?: React.CSSProperties;\n label?: React.CSSProperties;\n };\n onClick?: ClickEventHandler;\n onSelect?: ClickEventHandler;\n}\n\nexport interface MenuProps\n extends\n Props,\n Omit<React.ComponentPropsWithoutRef<'ul'>, 'onClick' | 'onSelect'> {\n items?: MenuItem[];\n}\n\nexport type ClickEventHandler = (params: {\n domEvent: React.SyntheticEvent;\n key: React.Key;\n keyPath: React.Key[];\n item: MenuItem;\n}) => void;\n\nexport const MENU_CLASSNAMES = [\n 'm-0',\n 'list-none',\n 'p-0',\n 'bg-popover',\n 'text-popover-foreground',\n 'shadow-md',\n 'rounded-md',\n //\n];\n\nexport type SelectionMap = ReadonlyMap<React.Key, boolean>;\n\nexport const buildSelectionMap = (\n items: MenuItem[],\n selectedKeysSet: ReadonlySet<React.Key>,\n): SelectionMap => {\n const map = new Map<React.Key, boolean>();\n\n const dfs = (node: MenuItem): boolean => {\n const self = selectedKeysSet.has(node.key);\n const hasSelectedChild = node.children?.some(child => dfs(child)) ?? false;\n const isSelected = self || hasSelectedChild;\n map.set(node.key, isSelected);\n return isSelected;\n };\n\n items.forEach(dfs);\n return map;\n};\n\nexport const findKey = (\n menu: MenuItem,\n targetKeys: ReadonlySet<React.Key>,\n): boolean => {\n if (targetKeys.has(menu.key)) {\n return true;\n }\n\n if (menu.children && Array.isArray(menu.children)) {\n for (const child of menu.children) {\n if (findKey(child, targetKeys)) {\n return true;\n }\n }\n }\n\n return false;\n};\n\nconst Menu = ({\n items,\n mode = 'vertical',\n defaultSelectedKeys = [],\n selectedKeys: _selectedKeys,\n className,\n classNames,\n styles,\n offset,\n inlineOffset,\n onClick,\n onSelect: _onSelect,\n ...props\n}: MenuProps) => {\n const [selectedKeys, setSelectedKeys] = useControllableState<React.Key[]>({\n value: _selectedKeys,\n defaultValue: defaultSelectedKeys ?? [],\n });\n\n const selectedKeysSet = useMemo(\n () => new Set<React.Key>(selectedKeys ?? []),\n [selectedKeys],\n );\n\n const selectionMap = useMemo(\n () => buildSelectionMap(items ?? [], selectedKeysSet),\n [items, selectedKeysSet],\n );\n\n const onSelect = (params: {\n domEvent: React.SyntheticEvent;\n key: React.Key;\n keyPath: React.Key[];\n item: MenuItem;\n }) => {\n setSelectedKeys([params.key]);\n _onSelect?.(params);\n };\n\n return (\n <ul\n data-slot=\"menu\"\n role=\"menu\"\n className={cn(\n MENU_CLASSNAMES,\n mode === 'horizontal' ? 'flex' : 'inline-block',\n className,\n )}\n {...props}\n >\n {items?.map((item, index) => (\n <Item\n root\n {...item}\n key={item.key}\n itemKey={item.key}\n keyPath={[item.key]}\n index={index}\n selectionMap={selectionMap}\n mode={mode}\n classNames={classNames}\n styles={styles}\n offset={offset}\n inlineOffset={inlineOffset}\n onClick={onClick}\n onSelect={onSelect}\n />\n ))}\n </ul>\n );\n};\n\nexport default Menu;\n"],"mappings":";;;;;;;AAuDA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;AAIA,MAAa,qBACX,OAC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AAG;GACX;GACO;GACR;GACM;GACJ;GACA;GACM;GACL;GACC;EACX,CAAA,CACF;CACC,CAAA;AAER"}
1
+ {"version":3,"file":"menu.mjs","names":[],"sources":["../../../../src/components/molecules/menu/menu.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nimport { useControllableState } from '@jbpark/use-hooks';\n\nimport { cn } from '@repo/ui/utils';\n\nimport Item from './item';\n\nexport interface MenuItem {\n label: React.ReactNode;\n key: React.Key;\n type?: string;\n path?: string;\n children?: MenuItem[];\n}\n\nexport interface Props {\n mode?: 'horizontal' | 'vertical' | 'inline';\n selectedKeys?: React.Key[];\n defaultSelectedKeys?: React.Key[];\n selectionMap?: SelectionMap;\n offset?: [number, number];\n inlineOffset?: number;\n classNames?: {\n rootItem?: string;\n subMenu?: string;\n item?: string;\n label?: string;\n };\n styles?: {\n rootItem?: React.CSSProperties;\n subMenu?: React.CSSProperties;\n item?: React.CSSProperties;\n label?: React.CSSProperties;\n };\n onClick?: ClickEventHandler;\n onSelect?: ClickEventHandler;\n}\n\nexport interface MenuProps\n extends\n Omit<Props, 'selectionMap'>,\n Omit<React.ComponentPropsWithoutRef<'ul'>, 'onClick' | 'onSelect'> {\n items?: MenuItem[];\n}\n\nexport type ClickEventHandler = (params: {\n domEvent: React.SyntheticEvent;\n key: React.Key;\n keyPath: React.Key[];\n item: MenuItem;\n}) => void;\n\nexport const MENU_CLASSNAMES = [\n 'm-0',\n 'list-none',\n 'p-0',\n 'bg-popover',\n 'text-popover-foreground',\n 'shadow-md',\n 'rounded-md',\n //\n];\n\nexport type SelectionMap = ReadonlyMap<React.Key, boolean>;\n\nexport const buildSelectionMap = (\n items: MenuItem[],\n selectedKeysSet: ReadonlySet<React.Key>,\n): SelectionMap => {\n const map = new Map<React.Key, boolean>();\n\n const dfs = (node: MenuItem): boolean => {\n const self = selectedKeysSet.has(node.key);\n const hasSelectedChild = node.children?.some(child => dfs(child)) ?? false;\n const isSelected = self || hasSelectedChild;\n map.set(node.key, isSelected);\n return isSelected;\n };\n\n items.forEach(dfs);\n return map;\n};\n\nexport const findKey = (\n menu: MenuItem,\n targetKeys: ReadonlySet<React.Key>,\n): boolean => {\n if (targetKeys.has(menu.key)) {\n return true;\n }\n\n if (menu.children && Array.isArray(menu.children)) {\n for (const child of menu.children) {\n if (findKey(child, targetKeys)) {\n return true;\n }\n }\n }\n\n return false;\n};\n\nconst Menu = ({\n items,\n mode = 'vertical',\n defaultSelectedKeys = [],\n selectedKeys: _selectedKeys,\n className,\n classNames,\n styles,\n offset,\n inlineOffset,\n onClick,\n onSelect: _onSelect,\n ...props\n}: MenuProps) => {\n const [selectedKeys, setSelectedKeys] = useControllableState<React.Key[]>({\n value: _selectedKeys,\n defaultValue: defaultSelectedKeys ?? [],\n });\n\n const selectedKeysSet = useMemo(\n () => new Set<React.Key>(selectedKeys ?? []),\n [selectedKeys],\n );\n\n const selectionMap = useMemo(\n () => buildSelectionMap(items ?? [], selectedKeysSet),\n [items, selectedKeysSet],\n );\n const rootProps = { ...props };\n\n // Ignore stale JavaScript callers that still supply this internal prop.\n Reflect.deleteProperty(rootProps, 'selectionMap');\n\n const onSelect = (params: {\n domEvent: React.SyntheticEvent;\n key: React.Key;\n keyPath: React.Key[];\n item: MenuItem;\n }) => {\n setSelectedKeys([params.key]);\n _onSelect?.(params);\n };\n\n return (\n <ul\n data-slot=\"menu\"\n role=\"menu\"\n className={cn(\n MENU_CLASSNAMES,\n mode === 'horizontal' ? 'flex' : 'inline-block',\n className,\n )}\n {...rootProps}\n >\n {items?.map((item, index) => (\n <Item\n root\n {...item}\n key={item.key}\n itemKey={item.key}\n keyPath={[item.key]}\n index={index}\n selectionMap={selectionMap}\n mode={mode}\n classNames={classNames}\n styles={styles}\n offset={offset}\n inlineOffset={inlineOffset}\n onClick={onClick}\n onSelect={onSelect}\n />\n ))}\n </ul>\n );\n};\n\nexport default Menu;\n"],"mappings":";;;;;;;AAuDA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA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AAK,MAAM,UACjB,8BAAC,MAAD;GACE,MAAA;GACA,GAAI;GACJ,KAAK,KAAK;GACV,SAAS,KAAK;GACd,SAAS,CAAC,KAAK,GAAG;GACX;GACO;GACR;GACM;GACJ;GACA;GACM;GACL;GACC;EACX,CAAA,CACF;CACC,CAAA;AAER"}
@@ -30,7 +30,7 @@ declare const effectVariants: {
30
30
  };
31
31
  };
32
32
  };
33
- interface ItemProps {
33
+ export interface ItemProps {
34
34
  effect?: keyof typeof effectVariants;
35
35
  delay?: number;
36
36
  once?: boolean;
@@ -43,5 +43,5 @@ interface ItemProps {
43
43
  }
44
44
  declare const Item: ({ effect, children, once, viewport, variants, duration, delay, transition, className, ...props }: ItemProps) => import("react").JSX.Element;
45
45
  //#endregion
46
- export { ItemProps, Item as default };
46
+ export { Item as default };
47
47
  //# sourceMappingURL=item.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"item.d.mts","names":[],"sources":["../../../../src/components/molecules/reveals/item.tsx"],"mappings":";;cAMM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAeW;EACf,sBAAsB;EACtB;EACA;EACA;EACA;EACA,WAAW,MAAM;EACjB,WAAW;EACX,WAAW;EACX,aAAa;;cAGT,SAAQ,QAAA,UAAA,MAAA,UAAA,UAAA,UAAA,OAAA,YAAA,cAAA,SAWX,8BAAS,IAAA"}
1
+ {"version":3,"file":"item.d.mts","names":[],"sources":["../../../../src/components/molecules/reveals/item.tsx"],"mappings":";;cAMM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAeW;EACf,sBAAsB;EACtB;EACA;EACA;EACA;EACA,WAAW,MAAM;EACjB,WAAW;EACX,WAAW;EACX,aAAa;;cAGT,SAAQ,QAAA,UAAA,MAAA,UAAA,UAAA,UAAA,OAAA,YAAA,cAAA,SAWX,8BAAS,IAAA"}
@@ -1,6 +1,6 @@
1
1
  import { ItemProps } from "./item.mjs";
2
2
  //#region src/components/molecules/reveals/reveals.d.ts
3
- interface Props extends React.ComponentPropsWithoutRef<'div'>, ItemProps {
3
+ export interface Props extends React.ComponentPropsWithoutRef<'div'>, ItemProps {
4
4
  cascade?: number;
5
5
  classNames?: {
6
6
  root?: string;
@@ -9,10 +9,10 @@ interface Props extends React.ComponentPropsWithoutRef<'div'>, ItemProps {
9
9
  once?: boolean;
10
10
  items?: ItemProps[];
11
11
  }
12
- declare const DURATION = 0.6;
13
- declare const DELAY = 0;
14
- declare const CASCADE = 0.1;
12
+ export declare const DURATION = 0.6;
13
+ export declare const DELAY = 0;
14
+ export declare const CASCADE = 0.1;
15
15
  declare const Reveals: ({ children, className, classNames, items, cascade, duration, delay, effect, once, viewport, variants, transition, ...props }: Props) => import("react").JSX.Element;
16
16
  //#endregion
17
- export { CASCADE, DELAY, DURATION, Props, Reveals as default };
17
+ export { Reveals as default };
18
18
  //# sourceMappingURL=reveals.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reveals.d.mts","names":[],"sources":["../../../../src/components/molecules/reveals/reveals.tsx"],"mappings":";;UAMiB,cACP,MAAM,iCAAiC;EAC/C;EACA;IACE;IACA;;EAEF;EACA,QAAQ;;cAGG;cACA;cACA;cAEP,YAAW,UAAA,WAAA,YAAA,OAAA,SAAA,UAAA,OAAA,QAAA,MAAA,UAAA,UAAA,eAAA,SAcd,0BAAK,IAAA"}
1
+ {"version":3,"file":"reveals.d.mts","names":[],"sources":["../../../../src/components/molecules/reveals/reveals.tsx"],"mappings":";;iBAMiB,cACP,MAAM,iCAAiC;EAC/C;EACA;IACE;IACA;;EAEF;EACA,QAAQ;;qBAGG;qBACA;qBACA;cAEP,YAAW,UAAA,WAAA,YAAA,OAAA,SAAA,UAAA,OAAA,QAAA,MAAA,UAAA,UAAA,eAAA,SAcd,0BAAK,IAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/components/molecules/splitter/index.ts"],"mappings":";;;KAGK,2BAA2B;EAAiB,cAAc;;cAEzD,UAA2B"}
1
+ {"version":3,"file":"index.d.mts","names":["SplitterImpl"],"sources":["../../../../src/components/molecules/splitter/index.ts"],"mappings":";;;KAGK,2BAA2BA;EAAiB,cAAc;;cAEzD,UAA2B"}
@@ -1,11 +1,11 @@
1
- import { ResizablePanel as ResizablePanel$1 } from "../../../core/resizable.mjs";
1
+ import { ResizablePanel as ResizablePanel$1, resizable_d_exports } from "../../../core/resizable.mjs";
2
2
  import "../../../core/index.mjs";
3
3
  //#region src/components/molecules/splitter/panel.d.ts
4
4
  declare const ResizablePanel: typeof ResizablePanel$1;
5
- interface Props extends React.ComponentProps<typeof ResizablePanel> {
5
+ export interface Props extends React.ComponentProps<typeof ResizablePanel> {
6
6
  children: React.ReactNode;
7
7
  }
8
8
  declare const Panel: ({ children, className, ...props }: Props) => import("react").JSX.Element;
9
9
  //#endregion
10
- export { Props, Panel as default };
10
+ export { Panel as default };
11
11
  //# sourceMappingURL=panel.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"panel.d.mts","names":[],"sources":["../../../../src/components/molecules/splitter/panel.tsx"],"mappings":";;;cAIQ,uBAAc;UAEL,cAAc,MAAM,sBAAsB;EACzD,UAAU,MAAM;;cAGZ,UAAS,UAAA,cAAA,SAAmC,0BAAK,IAAA"}
1
+ {"version":3,"file":"panel.d.mts","names":["resizable","resizable.ResizablePanel"],"sources":["../../../../src/components/molecules/splitter/panel.tsx"],"mappings":";;;cAIQ,uBAAcC;iBAEL,cAAc,MAAM,sBAAsB;EACzD,UAAU,MAAM;;cAGZ,UAAS,UAAA,cAAA,SAAmC,0BAAK,IAAA"}
@@ -1,9 +1,9 @@
1
- import { ResizablePanelGroup as ResizablePanelGroup$1 } from "../../../core/resizable.mjs";
1
+ import { ResizablePanelGroup as ResizablePanelGroup$1, resizable_d_exports } from "../../../core/resizable.mjs";
2
2
  import "../../../core/index.mjs";
3
3
  //#region src/components/molecules/splitter/splitter.d.ts
4
4
  declare const ResizablePanelGroup: typeof ResizablePanelGroup$1;
5
5
  type SplitterLayout = Parameters<NonNullable<React.ComponentProps<typeof ResizablePanelGroup>['onLayoutChanged']>>[0];
6
- interface Props extends Omit<React.ComponentProps<typeof ResizablePanelGroup>, 'children' | 'orientation' | 'onLayoutChange' | 'onLayoutChanged' | 'onResize'> {
6
+ export interface Props extends Omit<React.ComponentProps<typeof ResizablePanelGroup>, 'children' | 'orientation' | 'onLayoutChange' | 'onLayoutChanged' | 'onResize'> {
7
7
  children: React.ReactNode;
8
8
  orientation?: 'horizontal' | 'vertical';
9
9
  withHandle?: boolean;
@@ -14,5 +14,5 @@ interface Props extends Omit<React.ComponentProps<typeof ResizablePanelGroup>, '
14
14
  }
15
15
  declare const Splitter: ({ children, className, orientation, withHandle, handle, handleClassName, onResize, onResizeEnd, ...props }: Props) => import("react").JSX.Element;
16
16
  //#endregion
17
- export { Props, Splitter as default };
17
+ export { Splitter as default };
18
18
  //# sourceMappingURL=splitter.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"splitter.d.mts","names":[],"sources":["../../../../src/components/molecules/splitter/splitter.tsx"],"mappings":";;;cAQyB,4BAAmB;KAEvC,iBAAiB,WACpB,YACE,MAAM,sBAAsB;UAIf,cAAc,KAC7B,MAAM,sBAAsB;EAG5B,UAAU,MAAM;EAChB;EACA;EACA,SAAS,MAAM;EACf;EACA,YAAY,QAAQ;EACpB,eAAe,QAAQ;;cAGnB,aAAY,UAAA,WAAA,aAAA,YAAA,QAAA,iBAAA,UAAA,gBAAA,SAUf,0BAAK,IAAA"}
1
+ {"version":3,"file":"splitter.d.mts","names":["resizable","resizable.ResizablePanelGroup"],"sources":["../../../../src/components/molecules/splitter/splitter.tsx"],"mappings":";;;cAQyB,4BAAmBC;KAEvC,iBAAiB,WACpB,YACE,MAAM,sBAAsB;iBAIf,cAAc,KAC7B,MAAM,sBAAsB;EAG5B,UAAU,MAAM;EAChB;EACA;EACA,SAAS,MAAM;EACf;EACA,YAAY,QAAQ;EACpB,eAAe,QAAQ;;cAGnB,aAAY,UAAA,WAAA,aAAA,YAAA,QAAA,iBAAA,UAAA,gBAAA,SAUf,0BAAK,IAAA"}
@@ -1,9 +1,9 @@
1
- import { Tabs as Tabs$1 } from "../../core/tabs.mjs";
1
+ import { Tabs as Tabs$1, tabs_d_exports } from "../../core/tabs.mjs";
2
2
  import "../../core/index.mjs";
3
3
  import { ReactNode } from "react";
4
4
  //#region src/components/molecules/tabs.d.ts
5
5
  declare const Core: typeof Tabs$1;
6
- interface Item {
6
+ export interface Item {
7
7
  key: string;
8
8
  label: ReactNode;
9
9
  children: ReactNode;
@@ -11,8 +11,12 @@ interface Item {
11
11
  /** Decorative icon rendered before the label with consistent spacing. */
12
12
  icon?: ReactNode;
13
13
  }
14
- interface Props extends Omit<React.ComponentProps<typeof Core>, 'children'> {
14
+ export interface Props extends Omit<React.ComponentProps<typeof Core>, 'children' | 'onChange'> {
15
15
  items: Item[];
16
+ /** Called when the selected tab changes. */
17
+ onChange?: (value: string | number | null) => void;
18
+ /** @deprecated Use `onChange` for the selected value. */
19
+ onValueChange?: React.ComponentProps<typeof Core>['onValueChange'];
16
20
  listLabel?: string;
17
21
  /** Preserve inactive panel DOM and local state. */
18
22
  keepMounted?: boolean;
@@ -31,7 +35,7 @@ interface Props extends Omit<React.ComponentProps<typeof Core>, 'children'> {
31
35
  extra?: string;
32
36
  };
33
37
  }
34
- declare const Tabs: ({ items, listLabel, keepMounted, activateOnFocus, scrollable, fitted, extra, classNames, defaultValue, orientation, ...props }: Props) => import("react").JSX.Element;
38
+ declare const Tabs: ({ items, listLabel, keepMounted, activateOnFocus, scrollable, fitted, extra, classNames, defaultValue, onChange, onValueChange, orientation, ...props }: Props) => import("react").JSX.Element;
35
39
  //#endregion
36
- export { Item, Props, Tabs as default };
40
+ export { Tabs as default };
37
41
  //# sourceMappingURL=tabs.d.mts.map