@yewdiel21/motion-kit 0.9.1 → 0.14.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 (458) hide show
  1. package/README.md +72 -0
  2. package/dist/auto/index.d.ts +72 -3
  3. package/dist/auto/index.js +139 -3
  4. package/dist/auto/index.js.map +1 -1
  5. package/dist/{chunk-BFC27F2G.js → chunk-6P4P7NU6.js} +2 -218
  6. package/dist/chunk-6P4P7NU6.js.map +1 -0
  7. package/dist/chunk-CU6SXW3E.js +20334 -0
  8. package/dist/chunk-CU6SXW3E.js.map +1 -0
  9. package/dist/{chunk-XDWBVFHQ.js → chunk-EY4BJKC4.js} +1203 -29
  10. package/dist/chunk-EY4BJKC4.js.map +1 -0
  11. package/dist/chunk-QP4QJOEN.js +72 -0
  12. package/dist/chunk-QP4QJOEN.js.map +1 -0
  13. package/dist/css/components/activity-feed.css +240 -0
  14. package/dist/css/components/attachment.css +266 -0
  15. package/dist/css/components/breadcrumb.css +110 -0
  16. package/dist/css/components/calendar.css +159 -0
  17. package/dist/css/components/chart-tooltip.css +168 -0
  18. package/dist/css/components/chart.css +296 -0
  19. package/dist/css/components/code-block.css +264 -0
  20. package/dist/css/components/color-area.css +82 -0
  21. package/dist/css/components/color-field.css +67 -0
  22. package/dist/css/components/color-picker.css +131 -0
  23. package/dist/css/components/color-slider.css +113 -0
  24. package/dist/css/components/command-search.css +252 -0
  25. package/dist/css/components/context-menu.css +23 -0
  26. package/dist/css/components/credit-card.css +288 -0
  27. package/dist/css/components/data-table.css +591 -0
  28. package/dist/css/components/date-range-picker.css +168 -0
  29. package/dist/css/components/date-time-picker.css +178 -0
  30. package/dist/css/components/drawer.css +58 -0
  31. package/dist/css/components/editable-table.css +201 -0
  32. package/dist/css/components/empty-state.css +61 -0
  33. package/dist/css/components/file-explorer.css +633 -0
  34. package/dist/css/components/filter-builder.css +232 -0
  35. package/dist/css/components/hold-confirm.css +87 -0
  36. package/dist/css/components/hover-card.css +20 -0
  37. package/dist/css/components/image-preview.css +195 -0
  38. package/dist/css/components/input-otp.css +10 -0
  39. package/dist/css/components/json-viewer.css +272 -0
  40. package/dist/css/components/like-button.css +78 -0
  41. package/dist/css/components/link-preview.css +275 -0
  42. package/dist/css/components/loading-button.css +77 -0
  43. package/dist/css/components/multi-select.css +267 -0
  44. package/dist/css/components/notification-bell.css +127 -0
  45. package/dist/css/components/pagination.css +11 -0
  46. package/dist/css/components/password-strength.css +183 -0
  47. package/dist/css/components/popover.css +25 -0
  48. package/dist/css/components/progress.css +140 -0
  49. package/dist/css/components/quantity.css +16 -0
  50. package/dist/css/components/questionnaire.css +217 -0
  51. package/dist/css/components/range-calendar.css +186 -0
  52. package/dist/css/components/range-slider.css +192 -0
  53. package/dist/css/components/resizable-panel.css +243 -0
  54. package/dist/css/components/rich-text-editor.css +284 -0
  55. package/dist/css/components/scratch-card.css +75 -0
  56. package/dist/css/components/skeleton.css +108 -0
  57. package/dist/css/components/slot-picker.css +126 -0
  58. package/dist/css/components/split-view.css +19 -0
  59. package/dist/css/components/star-rating.css +80 -0
  60. package/dist/css/components/stat-card.css +164 -0
  61. package/dist/css/components/studio-dock.css +35 -0
  62. package/dist/css/components/swipe-actions.css +105 -0
  63. package/dist/css/components/tag-input.css +244 -0
  64. package/dist/css/components/time-field.css +88 -0
  65. package/dist/css/components/timeline.css +219 -0
  66. package/dist/css/components/tooltip.css +79 -0
  67. package/dist/css/components/trailer.css +37 -0
  68. package/dist/css/components/tree-view.css +210 -0
  69. package/dist/css/components/virtual-list.css +195 -0
  70. package/dist/css/controls.css +65 -0
  71. package/dist/css/tokens.css +185 -181
  72. package/dist/elements/index.d.ts +742 -5
  73. package/dist/elements/index.js +1527 -8
  74. package/dist/elements/index.js.map +1 -1
  75. package/dist/{engine-GDGwQnJE.d.ts → engine-Cn6IhE3z.d.ts} +1 -1
  76. package/dist/engine-QECQnGz1.d.ts +33 -0
  77. package/dist/index.css +10113 -181
  78. package/dist/index.d.ts +89 -5
  79. package/dist/index.js +285 -9
  80. package/dist/index.js.map +1 -1
  81. package/dist/react/index.d.ts +678 -23
  82. package/dist/react/index.js +2389 -7
  83. package/dist/react/index.js.map +1 -1
  84. package/dist/{reduced-B98f8LPs.d.ts → reduced-BBUusld6.d.ts} +206 -2
  85. package/dist/reveal-DEvp6U6T.d.ts +2381 -0
  86. package/dist/{store-pHiUvxP8.d.ts → store-DjkTBX7f.d.ts} +2 -2
  87. package/package.json +1 -1
  88. package/registry.json +583 -104
  89. package/skills/motion-kit/SKILL.md +209 -189
  90. package/src/auto/auto-init.ts +136 -0
  91. package/src/components/activity-feed/README.md +56 -0
  92. package/src/components/activity-feed/activity-feed.css +239 -0
  93. package/src/components/activity-feed/element.ts +36 -0
  94. package/src/components/activity-feed/engine.ts +351 -0
  95. package/src/components/activity-feed/react.tsx +32 -0
  96. package/src/components/attachment/README.md +27 -0
  97. package/src/components/attachment/attachment.css +265 -0
  98. package/src/components/attachment/element.ts +50 -0
  99. package/src/components/attachment/engine.ts +469 -0
  100. package/src/components/attachment/react.tsx +65 -0
  101. package/src/components/breadcrumb/README.md +38 -0
  102. package/src/components/breadcrumb/breadcrumb.css +109 -0
  103. package/src/components/breadcrumb/element.ts +27 -0
  104. package/src/components/breadcrumb/engine.ts +249 -0
  105. package/src/components/breadcrumb/react.tsx +30 -0
  106. package/src/components/calendar/README.md +82 -0
  107. package/src/components/calendar/calendar.css +158 -0
  108. package/src/components/calendar/element.ts +27 -0
  109. package/src/components/calendar/engine.ts +412 -0
  110. package/src/components/calendar/react.tsx +69 -0
  111. package/src/components/chart/README.md +24 -0
  112. package/src/components/chart/chart.css +295 -0
  113. package/src/components/chart/element.ts +41 -0
  114. package/src/components/chart/engine.ts +811 -0
  115. package/src/components/chart/react.tsx +50 -0
  116. package/src/components/chart-tooltip/README.md +53 -0
  117. package/src/components/chart-tooltip/chart-tooltip.css +167 -0
  118. package/src/components/chart-tooltip/element.ts +37 -0
  119. package/src/components/chart-tooltip/engine.ts +442 -0
  120. package/src/components/chart-tooltip/react.tsx +47 -0
  121. package/src/components/code-block/README.md +19 -0
  122. package/src/components/code-block/code-block.css +263 -0
  123. package/src/components/code-block/element.ts +34 -0
  124. package/src/components/code-block/engine.ts +254 -0
  125. package/src/components/code-block/highlight.ts +244 -0
  126. package/src/components/code-block/react.tsx +94 -0
  127. package/src/components/color-area/README.md +50 -0
  128. package/src/components/color-area/color-area.css +81 -0
  129. package/src/components/color-area/element.ts +26 -0
  130. package/src/components/color-area/engine.ts +246 -0
  131. package/src/components/color-area/react.tsx +42 -0
  132. package/src/components/color-field/README.md +43 -0
  133. package/src/components/color-field/color-field.css +66 -0
  134. package/src/components/color-field/element.ts +26 -0
  135. package/src/components/color-field/engine.ts +174 -0
  136. package/src/components/color-field/react.tsx +42 -0
  137. package/src/components/color-picker/README.md +45 -0
  138. package/src/components/color-picker/color-picker.css +130 -0
  139. package/src/components/color-picker/element.ts +45 -0
  140. package/src/components/color-picker/engine.ts +314 -0
  141. package/src/components/color-picker/react.tsx +47 -0
  142. package/src/components/color-slider/README.md +55 -0
  143. package/src/components/color-slider/color-slider.css +112 -0
  144. package/src/components/color-slider/element.ts +26 -0
  145. package/src/components/color-slider/engine.ts +234 -0
  146. package/src/components/color-slider/react.tsx +45 -0
  147. package/src/components/command-search/README.md +15 -0
  148. package/src/components/command-search/command-search.css +251 -0
  149. package/src/components/command-search/element.ts +36 -0
  150. package/src/components/command-search/engine.ts +356 -0
  151. package/src/components/command-search/match.ts +53 -0
  152. package/src/components/command-search/react.tsx +66 -0
  153. package/src/components/context-menu/README.md +31 -0
  154. package/src/components/context-menu/context-menu.css +22 -0
  155. package/src/components/context-menu/element.ts +40 -0
  156. package/src/components/context-menu/engine.ts +153 -0
  157. package/src/components/context-menu/react.tsx +57 -0
  158. package/src/components/credit-card/README.md +20 -0
  159. package/src/components/credit-card/card.ts +77 -0
  160. package/src/components/credit-card/credit-card.css +287 -0
  161. package/src/components/credit-card/element.ts +33 -0
  162. package/src/components/credit-card/engine.ts +410 -0
  163. package/src/components/credit-card/react.tsx +36 -0
  164. package/src/components/data-table/README.md +83 -0
  165. package/src/components/data-table/data-table.css +590 -0
  166. package/src/components/data-table/element.ts +54 -0
  167. package/src/components/data-table/engine.ts +1059 -0
  168. package/src/components/data-table/react.tsx +94 -0
  169. package/src/components/date-range-picker/README.md +51 -0
  170. package/src/components/date-range-picker/date-range-picker.css +167 -0
  171. package/src/components/date-range-picker/element.ts +52 -0
  172. package/src/components/date-range-picker/engine.ts +352 -0
  173. package/src/components/date-range-picker/react.tsx +57 -0
  174. package/src/components/date-time-picker/README.md +48 -0
  175. package/src/components/date-time-picker/date-time-picker.css +177 -0
  176. package/src/components/date-time-picker/element.ts +47 -0
  177. package/src/components/date-time-picker/engine.ts +350 -0
  178. package/src/components/date-time-picker/react.tsx +54 -0
  179. package/src/components/dialog/README.md +103 -102
  180. package/src/components/dialog/element.ts +123 -118
  181. package/src/components/dialog/engine.ts +449 -432
  182. package/src/components/drawer/README.md +28 -0
  183. package/src/components/drawer/drawer.css +57 -0
  184. package/src/components/drawer/element.ts +21 -0
  185. package/src/components/drawer/engine.ts +56 -0
  186. package/src/components/drawer/react.tsx +85 -0
  187. package/src/components/editable-table/README.md +67 -0
  188. package/src/components/editable-table/editable-table.css +200 -0
  189. package/src/components/editable-table/element.ts +45 -0
  190. package/src/components/editable-table/engine.ts +775 -0
  191. package/src/components/editable-table/react.tsx +79 -0
  192. package/src/components/empty-state/README.md +41 -0
  193. package/src/components/empty-state/element.ts +23 -0
  194. package/src/components/empty-state/empty-state.css +60 -0
  195. package/src/components/empty-state/engine.ts +232 -0
  196. package/src/components/empty-state/react.tsx +34 -0
  197. package/src/components/file-explorer/README.md +67 -0
  198. package/src/components/file-explorer/element.ts +39 -0
  199. package/src/components/file-explorer/engine.ts +1307 -0
  200. package/src/components/file-explorer/file-explorer.css +632 -0
  201. package/src/components/file-explorer/react.tsx +77 -0
  202. package/src/components/filter-builder/README.md +47 -0
  203. package/src/components/filter-builder/element.ts +34 -0
  204. package/src/components/filter-builder/engine.ts +365 -0
  205. package/src/components/filter-builder/filter-builder.css +231 -0
  206. package/src/components/filter-builder/react.tsx +36 -0
  207. package/src/components/hold-confirm/README.md +13 -0
  208. package/src/components/hold-confirm/element.ts +24 -0
  209. package/src/components/hold-confirm/engine.ts +216 -0
  210. package/src/components/hold-confirm/hold-confirm.css +86 -0
  211. package/src/components/hold-confirm/react.tsx +28 -0
  212. package/src/components/hover-card/README.md +20 -0
  213. package/src/components/hover-card/element.ts +8 -0
  214. package/src/components/hover-card/engine.ts +131 -0
  215. package/src/components/hover-card/hover-card.css +19 -0
  216. package/src/components/hover-card/react.tsx +19 -0
  217. package/src/components/image-preview/README.md +16 -0
  218. package/src/components/image-preview/element.ts +26 -0
  219. package/src/components/image-preview/engine.ts +325 -0
  220. package/src/components/image-preview/image-preview.css +194 -0
  221. package/src/components/image-preview/react.tsx +43 -0
  222. package/src/components/input-otp/README.md +18 -0
  223. package/src/components/input-otp/element.ts +14 -0
  224. package/src/components/input-otp/engine.ts +106 -0
  225. package/src/components/input-otp/input-otp.css +9 -0
  226. package/src/components/input-otp/react.tsx +21 -0
  227. package/src/components/json-viewer/README.md +56 -0
  228. package/src/components/json-viewer/element.ts +37 -0
  229. package/src/components/json-viewer/engine.ts +440 -0
  230. package/src/components/json-viewer/json-viewer.css +271 -0
  231. package/src/components/json-viewer/react.tsx +56 -0
  232. package/src/components/like-button/README.md +13 -0
  233. package/src/components/like-button/element.ts +47 -0
  234. package/src/components/like-button/engine.ts +145 -0
  235. package/src/components/like-button/like-button.css +77 -0
  236. package/src/components/like-button/react.tsx +39 -0
  237. package/src/components/link-preview/README.md +19 -0
  238. package/src/components/link-preview/element.ts +29 -0
  239. package/src/components/link-preview/engine.ts +192 -0
  240. package/src/components/link-preview/link-preview.css +274 -0
  241. package/src/components/link-preview/react.tsx +101 -0
  242. package/src/components/loading-button/README.md +45 -0
  243. package/src/components/loading-button/element.ts +34 -0
  244. package/src/components/loading-button/engine.ts +201 -0
  245. package/src/components/loading-button/loading-button.css +76 -0
  246. package/src/components/loading-button/react.tsx +43 -0
  247. package/src/components/multi-select/README.md +48 -0
  248. package/src/components/multi-select/element.ts +28 -0
  249. package/src/components/multi-select/engine.ts +294 -0
  250. package/src/components/multi-select/multi-select.css +266 -0
  251. package/src/components/multi-select/react.tsx +39 -0
  252. package/src/components/notification-bell/README.md +14 -0
  253. package/src/components/notification-bell/element.ts +48 -0
  254. package/src/components/notification-bell/engine.ts +202 -0
  255. package/src/components/notification-bell/notification-bell.css +126 -0
  256. package/src/components/notification-bell/react.tsx +57 -0
  257. package/src/components/pagination/README.md +17 -0
  258. package/src/components/pagination/element.ts +14 -0
  259. package/src/components/pagination/engine.ts +102 -0
  260. package/src/components/pagination/pagination.css +10 -0
  261. package/src/components/pagination/react.tsx +22 -0
  262. package/src/components/password-strength/README.md +17 -0
  263. package/src/components/password-strength/element.ts +22 -0
  264. package/src/components/password-strength/engine.ts +212 -0
  265. package/src/components/password-strength/password-strength.css +182 -0
  266. package/src/components/password-strength/react.tsx +36 -0
  267. package/src/components/password-strength/score.ts +62 -0
  268. package/src/components/popover/README.md +44 -0
  269. package/src/components/popover/element.ts +31 -0
  270. package/src/components/popover/engine.ts +114 -0
  271. package/src/components/popover/popover.css +24 -0
  272. package/src/components/popover/react.tsx +50 -0
  273. package/src/components/progress/README.md +17 -0
  274. package/src/components/progress/element.ts +30 -0
  275. package/src/components/progress/engine.ts +173 -0
  276. package/src/components/progress/progress.css +139 -0
  277. package/src/components/progress/react.tsx +35 -0
  278. package/src/components/quantity/README.md +20 -0
  279. package/src/components/quantity/element.ts +14 -0
  280. package/src/components/quantity/engine.ts +85 -0
  281. package/src/components/quantity/quantity.css +15 -0
  282. package/src/components/quantity/react.tsx +21 -0
  283. package/src/components/questionnaire/README.md +32 -0
  284. package/src/components/questionnaire/element.ts +118 -0
  285. package/src/components/questionnaire/engine.ts +255 -0
  286. package/src/components/questionnaire/questionnaire.css +216 -0
  287. package/src/components/questionnaire/react.tsx +140 -0
  288. package/src/components/range-calendar/README.md +58 -0
  289. package/src/components/range-calendar/element.ts +42 -0
  290. package/src/components/range-calendar/engine.ts +390 -0
  291. package/src/components/range-calendar/range-calendar.css +185 -0
  292. package/src/components/range-calendar/react.tsx +56 -0
  293. package/src/components/range-slider/README.md +23 -0
  294. package/src/components/range-slider/element.ts +53 -0
  295. package/src/components/range-slider/engine.ts +316 -0
  296. package/src/components/range-slider/range-slider.css +191 -0
  297. package/src/components/range-slider/react.tsx +66 -0
  298. package/src/components/resizable-panel/README.md +61 -0
  299. package/src/components/resizable-panel/element.ts +36 -0
  300. package/src/components/resizable-panel/engine.ts +551 -0
  301. package/src/components/resizable-panel/react.tsx +74 -0
  302. package/src/components/resizable-panel/resizable-panel.css +242 -0
  303. package/src/components/rich-text-editor/README.md +57 -0
  304. package/src/components/rich-text-editor/element.ts +34 -0
  305. package/src/components/rich-text-editor/engine.ts +673 -0
  306. package/src/components/rich-text-editor/react.tsx +60 -0
  307. package/src/components/rich-text-editor/rich-text-editor.css +283 -0
  308. package/src/components/scratch-card/README.md +15 -0
  309. package/src/components/scratch-card/element.ts +30 -0
  310. package/src/components/scratch-card/engine.ts +257 -0
  311. package/src/components/scratch-card/react.tsx +40 -0
  312. package/src/components/scratch-card/scratch-card.css +74 -0
  313. package/src/components/skeleton/README.md +15 -0
  314. package/src/components/skeleton/element.ts +32 -0
  315. package/src/components/skeleton/engine.ts +104 -0
  316. package/src/components/skeleton/react.tsx +41 -0
  317. package/src/components/skeleton/skeleton.css +107 -0
  318. package/src/components/slot-picker/README.md +68 -0
  319. package/src/components/slot-picker/element.ts +27 -0
  320. package/src/components/slot-picker/engine.ts +412 -0
  321. package/src/components/slot-picker/react.tsx +76 -0
  322. package/src/components/slot-picker/slot-picker.css +125 -0
  323. package/src/components/split-view/README.md +50 -0
  324. package/src/components/split-view/element.ts +34 -0
  325. package/src/components/split-view/engine.ts +114 -0
  326. package/src/components/split-view/react.tsx +63 -0
  327. package/src/components/split-view/split-view.css +18 -0
  328. package/src/components/star-rating/README.md +14 -0
  329. package/src/components/star-rating/element.ts +26 -0
  330. package/src/components/star-rating/engine.ts +217 -0
  331. package/src/components/star-rating/react.tsx +33 -0
  332. package/src/components/star-rating/star-rating.css +79 -0
  333. package/src/components/stat-card/README.md +42 -0
  334. package/src/components/stat-card/element.ts +40 -0
  335. package/src/components/stat-card/engine.ts +283 -0
  336. package/src/components/stat-card/react.tsx +36 -0
  337. package/src/components/stat-card/stat-card.css +163 -0
  338. package/src/components/studio-dock/README.md +44 -0
  339. package/src/components/studio-dock/element.ts +11 -0
  340. package/src/components/studio-dock/engine.ts +212 -0
  341. package/src/components/studio-dock/react.tsx +23 -0
  342. package/src/components/studio-dock/studio-dock.css +34 -0
  343. package/src/components/swipe-actions/README.md +19 -0
  344. package/src/components/swipe-actions/element.ts +26 -0
  345. package/src/components/swipe-actions/engine.ts +260 -0
  346. package/src/components/swipe-actions/react.tsx +80 -0
  347. package/src/components/swipe-actions/swipe-actions.css +104 -0
  348. package/src/components/tag-input/README.md +42 -0
  349. package/src/components/tag-input/element.ts +39 -0
  350. package/src/components/tag-input/engine.ts +313 -0
  351. package/src/components/tag-input/react.tsx +54 -0
  352. package/src/components/tag-input/tag-input.css +243 -0
  353. package/src/components/time-field/README.md +54 -0
  354. package/src/components/time-field/element.ts +38 -0
  355. package/src/components/time-field/engine.ts +110 -0
  356. package/src/components/time-field/react.tsx +45 -0
  357. package/src/components/time-field/time-field.css +87 -0
  358. package/src/components/timeline/README.md +57 -0
  359. package/src/components/timeline/element.ts +31 -0
  360. package/src/components/timeline/engine.ts +300 -0
  361. package/src/components/timeline/react.tsx +59 -0
  362. package/src/components/timeline/timeline.css +218 -0
  363. package/src/components/tooltip/README.md +46 -0
  364. package/src/components/tooltip/element.ts +22 -0
  365. package/src/components/tooltip/engine.ts +288 -0
  366. package/src/components/tooltip/react.tsx +30 -0
  367. package/src/components/tooltip/tooltip.css +78 -0
  368. package/src/components/trailer/README.md +28 -0
  369. package/src/components/trailer/element.ts +13 -0
  370. package/src/components/trailer/engine.ts +189 -0
  371. package/src/components/trailer/react.tsx +16 -0
  372. package/src/components/trailer/trailer.css +36 -0
  373. package/src/components/tree-view/README.md +61 -0
  374. package/src/components/tree-view/element.ts +32 -0
  375. package/src/components/tree-view/engine.ts +569 -0
  376. package/src/components/tree-view/react.tsx +78 -0
  377. package/src/components/tree-view/tree-view.css +209 -0
  378. package/src/components/virtual-list/README.md +81 -0
  379. package/src/components/virtual-list/element.ts +42 -0
  380. package/src/components/virtual-list/engine.ts +678 -0
  381. package/src/components/virtual-list/react.tsx +101 -0
  382. package/src/components/virtual-list/virtual-list.css +194 -0
  383. package/src/core/chips.ts +196 -0
  384. package/src/core/color.ts +304 -0
  385. package/src/core/date-range.ts +67 -0
  386. package/src/core/dates.ts +108 -0
  387. package/src/core/files.ts +107 -0
  388. package/src/core/filter.ts +229 -0
  389. package/src/core/gsap.ts +80 -65
  390. package/src/core/listbox.ts +332 -0
  391. package/src/core/mark.ts +29 -0
  392. package/src/core/position.ts +89 -0
  393. package/src/core/relative-time.ts +77 -0
  394. package/src/core/segment-field.ts +373 -0
  395. package/src/core/segments.ts +153 -0
  396. package/src/core/tree.ts +116 -0
  397. package/src/core/virtual.ts +79 -0
  398. package/src/css/controls/README.md +14 -0
  399. package/src/css/controls/status.css +63 -0
  400. package/src/css/tokens.css +186 -182
  401. package/src/elements/index.ts +171 -0
  402. package/src/index.ts +97 -0
  403. package/src/motion/micro.ts +248 -0
  404. package/src/motion/sheet.ts +88 -65
  405. package/src/motion/surface.ts +9 -0
  406. package/src/react/index.ts +78 -0
  407. package/src/react/use-action-button.ts +6 -0
  408. package/src/react/use-editorial-reveal.ts +7 -0
  409. package/src/react/use-film-hero.ts +6 -0
  410. package/src/react/use-font-cycle.ts +7 -0
  411. package/src/react/use-image-zoom.ts +5 -0
  412. package/src/react/use-joined-cta.ts +5 -0
  413. package/src/react/use-local-clock.ts +5 -0
  414. package/src/react/use-scroll-dock.ts +5 -0
  415. package/src/react/use-sticker.ts +5 -0
  416. package/src/react/use-studio-dock.ts +8 -0
  417. package/src/react/use-thumbnail-nav.ts +7 -0
  418. package/src/react/use-trailer.ts +6 -0
  419. package/src/react/use-weight-hover.ts +5 -0
  420. package/src/recipes/action-button/README.md +31 -0
  421. package/src/recipes/action-button/action-button.css +113 -0
  422. package/src/recipes/action-button/create-action-button.ts +56 -0
  423. package/src/recipes/editorial-reveal/README.md +35 -0
  424. package/src/recipes/editorial-reveal/create-editorial-reveal.ts +91 -0
  425. package/src/recipes/editorial-reveal/editorial-reveal.css +17 -0
  426. package/src/recipes/film-hero/README.md +23 -0
  427. package/src/recipes/film-hero/create-film-hero.ts +65 -0
  428. package/src/recipes/film-hero/film-hero.css +29 -0
  429. package/src/recipes/font-cycle/README.md +11 -0
  430. package/src/recipes/font-cycle/create-font-cycle.ts +126 -0
  431. package/src/recipes/font-cycle/font-cycle.css +36 -0
  432. package/src/recipes/image-zoom/README.md +16 -0
  433. package/src/recipes/image-zoom/create-image-zoom.ts +27 -0
  434. package/src/recipes/image-zoom/image-zoom.css +7 -0
  435. package/src/recipes/joined-cta/README.md +13 -0
  436. package/src/recipes/joined-cta/create-joined-cta.ts +22 -0
  437. package/src/recipes/joined-cta/joined-cta.css +17 -0
  438. package/src/recipes/local-clock/README.md +31 -0
  439. package/src/recipes/local-clock/create-local-clock.ts +61 -0
  440. package/src/recipes/scroll-dock/README.md +46 -0
  441. package/src/recipes/scroll-dock/create-scroll-dock.ts +72 -0
  442. package/src/recipes/scroll-dock/scroll-dock.css +70 -0
  443. package/src/recipes/sticker/README.md +59 -0
  444. package/src/recipes/sticker/create-sticker.ts +490 -0
  445. package/src/recipes/sticker/sticker.css +112 -0
  446. package/src/recipes/thumbnail-nav/README.md +16 -0
  447. package/src/recipes/thumbnail-nav/create-thumbnail-nav.ts +165 -0
  448. package/src/recipes/thumbnail-nav/thumbnail-nav.css +108 -0
  449. package/src/recipes/weight-hover/README.md +37 -0
  450. package/src/recipes/weight-hover/create-weight-hover.ts +136 -0
  451. package/src/recipes/weight-hover/weight-hover.css +7 -0
  452. package/dist/chunk-BFC27F2G.js.map +0 -1
  453. package/dist/chunk-J6OCFNGU.js +0 -177
  454. package/dist/chunk-J6OCFNGU.js.map +0 -1
  455. package/dist/chunk-JQMJQSXD.js +0 -2374
  456. package/dist/chunk-JQMJQSXD.js.map +0 -1
  457. package/dist/chunk-XDWBVFHQ.js.map +0 -1
  458. package/dist/reveal-C0hCDcB_.d.ts +0 -415
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  ANIMATIONS,
4
4
  animate,
5
- confetti,
6
5
  leave
7
- } from "../chunk-J6OCFNGU.js";
6
+ } from "../chunk-QP4QJOEN.js";
8
7
  import {
9
8
  captureLayout,
9
+ createActionButton,
10
10
  createCardDock,
11
11
  createCascade,
12
12
  createContrast,
@@ -16,12 +16,18 @@ import {
16
16
  createDetails,
17
17
  createDockPill,
18
18
  createDragRuler,
19
+ createEditorialReveal,
19
20
  createFillText,
21
+ createFilmHero,
20
22
  createFitText,
21
23
  createFlow,
24
+ createFontCycle,
22
25
  createFrameZoom,
26
+ createImageZoom,
23
27
  createInfiniteReel,
28
+ createJoinedCta,
24
29
  createLetters,
30
+ createLocalClock,
25
31
  createMarquee,
26
32
  createMaskText,
27
33
  createParallax,
@@ -32,20 +38,24 @@ import {
32
38
  createRepelBento,
33
39
  createReveal,
34
40
  createRotator,
41
+ createScrollDock,
35
42
  createSlotText,
36
43
  createSnapStrip,
37
44
  createSortable,
38
45
  createSpringCards,
46
+ createSticker,
39
47
  createStretchFooter,
40
48
  createTabs,
41
49
  createTextRoll,
50
+ createThumbnailNav,
42
51
  createTicketMenu,
52
+ createWeightHover,
43
53
  createWords,
44
54
  moveItem,
45
55
  pileLayers,
46
56
  pileStyle,
47
57
  reflowLayout
48
- } from "../chunk-XDWBVFHQ.js";
58
+ } from "../chunk-EY4BJKC4.js";
49
59
  import {
50
60
  ICON_PATHS,
51
61
  NAV_STYLES,
@@ -53,22 +63,93 @@ import {
53
63
  capturePending,
54
64
  clearToasts,
55
65
  createChat,
56
- createChatBackground,
57
66
  createCursor,
58
67
  createIsland,
59
- createSteps,
60
68
  createThemePicker,
61
69
  createToaster,
62
70
  dismissToast,
63
71
  morphPendingToReply,
64
72
  revealShell,
65
73
  toast
66
- } from "../chunk-BFC27F2G.js";
74
+ } from "../chunk-6P4P7NU6.js";
67
75
  import {
76
+ confetti,
77
+ createActivityFeed,
78
+ createAttachment,
79
+ createBreadcrumb,
80
+ createCalendar,
81
+ createChart,
82
+ createChartTooltip,
83
+ createChatBackground,
84
+ createCodeBlock,
85
+ createColorArea,
86
+ createColorField,
87
+ createColorPicker,
88
+ createColorSlider,
89
+ createCommandSearch,
90
+ createContextMenu,
91
+ createCreditCard,
92
+ createDataTable,
93
+ createDateRangePicker,
94
+ createDateTimePicker,
68
95
  createDialog,
96
+ createDrawer,
97
+ createEditableTable,
98
+ createEmptyState,
99
+ createFileExplorer,
100
+ createFilterBuilder,
101
+ createHoldConfirm,
102
+ createHoverCard,
103
+ createImagePreview,
104
+ createInputOtp,
105
+ createJsonViewer,
106
+ createLikeButton,
107
+ createLoadingButton,
69
108
  createMenu,
109
+ createMultiSelect,
110
+ createNotificationBell,
111
+ createPagination,
112
+ createPasswordStrength,
113
+ createPopover,
114
+ createProgress,
115
+ createQuantity,
116
+ createQuestionnaire,
117
+ createRangeCalendar,
118
+ createRangeSlider,
119
+ createResizablePanel,
120
+ createRichTextEditor,
121
+ createScratchCard,
122
+ createSkeleton,
123
+ createSlotPicker,
124
+ createSplitView,
125
+ createStarRating,
126
+ createStatCard,
127
+ createSteps,
128
+ createStudioDock,
129
+ createSwipeActions,
130
+ createTagInput,
131
+ createTimeField,
132
+ createTimeline,
133
+ createTooltip,
134
+ createTrailer,
135
+ createTreeView,
136
+ createVirtualList,
137
+ dateTimeKey,
138
+ flowLines,
139
+ languageFamily,
140
+ linkDomain,
141
+ rangeKeys,
142
+ safeHref,
143
+ safeImage,
144
+ skeletonBones,
145
+ toDateTimeValue,
146
+ toHex,
147
+ toHsva,
148
+ toRange,
149
+ tokenLines,
150
+ tokenize,
70
151
  tweenNumber
71
- } from "../chunk-JQMJQSXD.js";
152
+ } from "../chunk-CU6SXW3E.js";
72
153
  import {
73
154
  DEFAULT_THEME,
74
155
  MK_THEME_HEAD_SCRIPT,
@@ -888,28 +969,2315 @@ function Island({
888
969
  ] })
889
970
  ] });
890
971
  }
972
+
973
+ // src/components/quantity/react.tsx
974
+ import { useRef as useRef14 } from "react";
975
+ import { jsx as jsx16, jsxs as jsxs6 } from "react/jsx-runtime";
976
+ function Quantity({ min, max, step, value, disabled, onChange, label = "Cantidad", decreaseLabel = "Disminuir", increaseLabel = "Aumentar", name, className, ...props }) {
977
+ const ref = useRef14(null);
978
+ const edited = useRef14(void 0);
979
+ const change = useLatest(onChange);
980
+ useIsomorphicLayoutEffect(() => {
981
+ const instance = createQuantity(ref.current, { min, max, step, value: value ?? edited.current, disabled, onChange: (n) => change.current?.(n) });
982
+ return () => {
983
+ edited.current = instance.value;
984
+ instance.destroy();
985
+ };
986
+ }, [min, max, step, value, disabled]);
987
+ return /* @__PURE__ */ jsxs6("div", { ...props, ref, className: ["mk-quantity", className].filter(Boolean).join(" "), role: "group", "aria-label": label, children: [
988
+ /* @__PURE__ */ jsx16("button", { type: "button", "data-mk-quantity-decrease": true, "aria-label": decreaseLabel, children: "\u2212" }),
989
+ /* @__PURE__ */ jsx16("input", { "data-mk-quantity-input": true, type: "number", "aria-label": label, name, defaultValue: value ?? min ?? 1, disabled }),
990
+ /* @__PURE__ */ jsx16("button", { type: "button", "data-mk-quantity-increase": true, "aria-label": increaseLabel, children: "+" })
991
+ ] });
992
+ }
993
+
994
+ // src/components/pagination/react.tsx
995
+ import { useRef as useRef15 } from "react";
996
+ import { jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
997
+ function Pagination({ totalPages, page, siblings, pageLabel, onChange, previousLabel = "P\xE1gina anterior", nextLabel = "P\xE1gina siguiente", className, ...props }) {
998
+ const ref = useRef15(null);
999
+ const selected = useRef15(void 0);
1000
+ const change = useLatest(onChange);
1001
+ const label = useLatest(pageLabel);
1002
+ useIsomorphicLayoutEffect(() => {
1003
+ const instance = createPagination(ref.current, { totalPages, page: page ?? selected.current, siblings, pageLabel: (n) => label.current?.(n) ?? `P\xE1gina ${n}`, onChange: (n) => change.current?.(n) });
1004
+ return () => {
1005
+ selected.current = instance.page;
1006
+ instance.destroy();
1007
+ };
1008
+ }, [totalPages, page, siblings, pageLabel]);
1009
+ return /* @__PURE__ */ jsxs7("nav", { "aria-label": "Paginaci\xF3n", ...props, ref, className: ["mk-pagination", className].filter(Boolean).join(" "), children: [
1010
+ /* @__PURE__ */ jsx17("button", { type: "button", "data-mk-pagination-previous": true, "aria-label": previousLabel, children: "\u2190" }),
1011
+ /* @__PURE__ */ jsx17("span", { "data-mk-pagination-pages": true }),
1012
+ /* @__PURE__ */ jsx17("button", { type: "button", "data-mk-pagination-next": true, "aria-label": nextLabel, children: "\u2192" })
1013
+ ] });
1014
+ }
1015
+
1016
+ // src/components/hover-card/react.tsx
1017
+ import { useRef as useRef16 } from "react";
1018
+ import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
1019
+ function HoverCard({ trigger, children, triggerLabel, panelLabel = "Vista previa", openDelay, closeDelay, placement, onOpenChange, className, ...props }) {
1020
+ const ref = useRef16(null);
1021
+ const change = useLatest(onOpenChange);
1022
+ useIsomorphicLayoutEffect(() => {
1023
+ const instance = createHoverCard(ref.current, { openDelay, closeDelay, placement, onOpenChange: (n) => change.current?.(n) });
1024
+ return () => instance.destroy();
1025
+ }, [openDelay, closeDelay, placement]);
1026
+ return /* @__PURE__ */ jsxs8("div", { ...props, ref, className: ["mk-hover-card", className].filter(Boolean).join(" "), children: [
1027
+ /* @__PURE__ */ jsx18("button", { type: "button", className: "mk-button mk-button--tonal", "data-mk-hover-trigger": true, "aria-label": triggerLabel, "aria-expanded": "false", children: trigger }),
1028
+ /* @__PURE__ */ jsx18("div", { "data-mk-hover-panel": true, role: "region", "aria-label": panelLabel, hidden: true, children })
1029
+ ] });
1030
+ }
1031
+
1032
+ // src/components/input-otp/react.tsx
1033
+ import { useRef as useRef17 } from "react";
1034
+ import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
1035
+ function InputOtp({ length, value, defaultValue, mask, onChange, onComplete, label = "C\xF3digo de verificaci\xF3n", name, disabled, required, invalid, className, ...props }) {
1036
+ const ref = useRef17(null);
1037
+ const edited = useRef17(void 0);
1038
+ const change = useLatest(onChange);
1039
+ const complete = useLatest(onComplete);
1040
+ useIsomorphicLayoutEffect(() => {
1041
+ const instance = createInputOtp(ref.current, { length, value: value ?? edited.current, mask, onChange: (n) => change.current?.(n), onComplete: (n) => complete.current?.(n) });
1042
+ return () => {
1043
+ edited.current = instance.value;
1044
+ instance.destroy();
1045
+ };
1046
+ }, [length, value, mask]);
1047
+ return /* @__PURE__ */ jsxs9("div", { ...props, ref, className: ["mk-input-otp", className].filter(Boolean).join(" "), children: [
1048
+ /* @__PURE__ */ jsx19("span", { "data-mk-otp-slots": true, "aria-hidden": "true" }),
1049
+ /* @__PURE__ */ jsx19("input", { "data-mk-otp-input": true, type: "text", "aria-label": label, name, defaultValue: value ?? defaultValue ?? "", disabled, required, "aria-invalid": invalid || void 0 })
1050
+ ] });
1051
+ }
1052
+
1053
+ // src/react/use-joined-cta.ts
1054
+ var useJoinedCta = (ref, options, deps) => useRecipe(ref, createJoinedCta, options, deps);
1055
+
1056
+ // src/react/use-image-zoom.ts
1057
+ var useImageZoom = (ref, options, deps) => useRecipe(ref, createImageZoom, options, deps);
1058
+
1059
+ // src/react/use-font-cycle.ts
1060
+ var useFontCycle = (ref, options, deps) => useRecipe(ref, createFontCycle, options, deps);
1061
+
1062
+ // src/react/use-thumbnail-nav.ts
1063
+ var useThumbnailNav = (ref, options, deps) => useRecipe(ref, createThumbnailNav, options, deps);
1064
+
1065
+ // src/react/use-action-button.ts
1066
+ var useActionButton = (ref, options, deps) => useRecipe(ref, createActionButton, options, deps);
1067
+
1068
+ // src/react/use-film-hero.ts
1069
+ var useFilmHero = (ref, options, deps) => useRecipe(ref, createFilmHero, options, deps);
1070
+
1071
+ // src/react/use-editorial-reveal.ts
1072
+ function useEditorialReveal(ref, options = {}, deps) {
1073
+ return useRecipe(ref, createEditorialReveal, options, deps);
1074
+ }
1075
+
1076
+ // src/react/use-studio-dock.ts
1077
+ function useStudioDock(ref, options = {}, deps) {
1078
+ const change = useLatest(options.onChange);
1079
+ return useRecipe(ref, createStudioDock, { ...options, onChange: (state) => change.current?.(state) }, deps);
1080
+ }
1081
+
1082
+ // src/react/use-trailer.ts
1083
+ var useTrailer = (ref, options, deps) => useRecipe(ref, createTrailer, options, deps);
1084
+
1085
+ // src/components/studio-dock/react.tsx
1086
+ import { useRef as useRef18 } from "react";
1087
+ import { jsx as jsx20 } from "react/jsx-runtime";
1088
+ function StudioDock({ duration, ease, focusOnOpen, trapFocus, onChange, fixed = false, instanceRef, className, children, ...props }) {
1089
+ const ref = useRef18(null);
1090
+ const change = useLatest(onChange);
1091
+ useIsomorphicLayoutEffect(() => {
1092
+ const instance = createStudioDock(ref.current, { duration, ease, focusOnOpen, trapFocus, onChange: (state) => change.current?.(state) });
1093
+ if (instanceRef) instanceRef.current = instance;
1094
+ return () => {
1095
+ instance.destroy();
1096
+ if (instanceRef) instanceRef.current = null;
1097
+ };
1098
+ }, [duration, ease, focusOnOpen, trapFocus]);
1099
+ return /* @__PURE__ */ jsx20("div", { ...props, ref, className: ["mk-studio-dock", fixed && "mk-studio-dock--fixed", className].filter(Boolean).join(" "), children });
1100
+ }
1101
+
1102
+ // src/components/trailer/react.tsx
1103
+ import { useRef as useRef19 } from "react";
1104
+ import { jsx as jsx21 } from "react/jsx-runtime";
1105
+ function Trailer({ options, className, children, ...props }) {
1106
+ const ref = useRef19(null);
1107
+ useRecipe(ref, createTrailer, options);
1108
+ return /* @__PURE__ */ jsx21("dialog", { ...props, ref, className: ["mk-trailer", className].filter(Boolean).join(" "), children });
1109
+ }
1110
+
1111
+ // src/components/calendar/react.tsx
1112
+ import { useRef as useRef20 } from "react";
1113
+ import { jsx as jsx22, jsxs as jsxs10 } from "react/jsx-runtime";
1114
+ function Calendar({
1115
+ date,
1116
+ view,
1117
+ firstDay,
1118
+ locale,
1119
+ events,
1120
+ maxEvents,
1121
+ selected,
1122
+ today,
1123
+ labels,
1124
+ onSelect,
1125
+ onEventClick,
1126
+ onNavigate,
1127
+ hideViews,
1128
+ className,
1129
+ ...props
1130
+ }) {
1131
+ const ref = useRef20(null);
1132
+ const instance = useRef20(null);
1133
+ const kept = useRef20({});
1134
+ const select = useLatest(onSelect);
1135
+ const eventClick = useLatest(onEventClick);
1136
+ const navigate = useLatest(onNavigate);
1137
+ useIsomorphicLayoutEffect(() => {
1138
+ const created = createCalendar(ref.current, {
1139
+ date: date ?? kept.current.date,
1140
+ view: view ?? kept.current.view,
1141
+ selected: selected !== void 0 ? selected : kept.current.selected,
1142
+ firstDay,
1143
+ locale,
1144
+ events,
1145
+ maxEvents,
1146
+ today,
1147
+ labels,
1148
+ onSelect: (d) => select.current?.(d),
1149
+ onEventClick: (e) => eventClick.current?.(e),
1150
+ onNavigate: (r) => navigate.current?.(r)
1151
+ });
1152
+ instance.current = created;
1153
+ return () => {
1154
+ kept.current = { date: created.date, view: created.view, selected: created.selected };
1155
+ created.destroy();
1156
+ instance.current = null;
1157
+ };
1158
+ }, [date, view, firstDay, locale, maxEvents, today]);
1159
+ const eventsKey = JSON.stringify(events ?? []);
1160
+ const firstEvents = useRef20(true);
1161
+ useIsomorphicLayoutEffect(() => {
1162
+ if (firstEvents.current) {
1163
+ firstEvents.current = false;
1164
+ return;
1165
+ }
1166
+ instance.current?.setEvents(events ?? []);
1167
+ }, [eventsKey]);
1168
+ useIsomorphicLayoutEffect(() => {
1169
+ if (selected !== void 0) instance.current?.select(selected, false);
1170
+ }, [selected]);
1171
+ return /* @__PURE__ */ jsxs10("div", { ...props, ref, className: ["mk-calendar", className].filter(Boolean).join(" "), children: [
1172
+ /* @__PURE__ */ jsxs10("div", { className: "mk-calendar__header", children: [
1173
+ /* @__PURE__ */ jsx22("h3", { className: "mk-calendar__title", "data-mk-calendar-title": true }),
1174
+ !hideViews && /* @__PURE__ */ jsxs10("div", { className: "mk-calendar__views", role: "group", "aria-label": "Vista", children: [
1175
+ /* @__PURE__ */ jsx22("button", { type: "button", "data-mk-calendar-view": "month", children: labels?.month ?? "Mes" }),
1176
+ /* @__PURE__ */ jsx22("button", { type: "button", "data-mk-calendar-view": "week", children: labels?.week ?? "Semana" })
1177
+ ] }),
1178
+ /* @__PURE__ */ jsx22("button", { type: "button", className: "mk-calendar__nav", "data-mk-calendar-prev": true, "aria-label": labels?.previous ?? "Anterior", children: "\u2190" }),
1179
+ /* @__PURE__ */ jsx22("button", { type: "button", className: "mk-calendar__nav", "data-mk-calendar-today": true, children: labels?.today ?? "Hoy" }),
1180
+ /* @__PURE__ */ jsx22("button", { type: "button", className: "mk-calendar__nav", "data-mk-calendar-next": true, "aria-label": labels?.next ?? "Siguiente", children: "\u2192" })
1181
+ ] }),
1182
+ /* @__PURE__ */ jsx22("div", { "data-mk-calendar-grid": true })
1183
+ ] });
1184
+ }
1185
+
1186
+ // src/components/slot-picker/react.tsx
1187
+ import { useRef as useRef21 } from "react";
1188
+ import { jsx as jsx23, jsxs as jsxs11 } from "react/jsx-runtime";
1189
+ function SlotPicker({
1190
+ date,
1191
+ value,
1192
+ slots,
1193
+ min,
1194
+ max,
1195
+ closedDays,
1196
+ isDisabled,
1197
+ firstDay,
1198
+ locale,
1199
+ labels,
1200
+ onChange,
1201
+ onDateChange,
1202
+ name,
1203
+ actions,
1204
+ className,
1205
+ ...props
1206
+ }) {
1207
+ const ref = useRef21(null);
1208
+ const instance = useRef21(null);
1209
+ const kept = useRef21(null);
1210
+ const change = useLatest(onChange);
1211
+ const dateChange = useLatest(onDateChange);
1212
+ const disabledFn = useLatest(isDisabled);
1213
+ const source = useLatest(slots);
1214
+ const slotsKey = typeof slots === "function" ? "function" : JSON.stringify(slots ?? []);
1215
+ const stable = () => {
1216
+ const current = source.current;
1217
+ return typeof current === "function" ? (d) => source.current(d) : current ?? [];
1218
+ };
1219
+ useIsomorphicLayoutEffect(() => {
1220
+ const keep = kept.current;
1221
+ const created = createSlotPicker(ref.current, {
1222
+ date: date ?? (keep instanceof Date ? keep : void 0),
1223
+ value: value !== void 0 ? value : typeof keep === "string" ? keep : void 0,
1224
+ slots: stable(),
1225
+ min,
1226
+ max,
1227
+ closedDays,
1228
+ firstDay,
1229
+ locale,
1230
+ labels,
1231
+ isDisabled: (d) => disabledFn.current?.(d) ?? false,
1232
+ onChange: (v) => change.current?.(v),
1233
+ onDateChange: (d) => dateChange.current?.(d)
1234
+ });
1235
+ instance.current = created;
1236
+ return () => {
1237
+ kept.current = created.value ?? created.date;
1238
+ created.destroy();
1239
+ instance.current = null;
1240
+ };
1241
+ }, [date, value, min, max, firstDay, locale, JSON.stringify(closedDays ?? [])]);
1242
+ const firstSlots = useRef21(true);
1243
+ useIsomorphicLayoutEffect(() => {
1244
+ if (firstSlots.current) {
1245
+ firstSlots.current = false;
1246
+ return;
1247
+ }
1248
+ instance.current?.setSlots(stable());
1249
+ }, [slotsKey]);
1250
+ return /* @__PURE__ */ jsxs11("div", { ...props, ref, className: ["mk-slot-picker", className].filter(Boolean).join(" "), children: [
1251
+ /* @__PURE__ */ jsxs11("div", { className: "mk-slot-picker__calendar", children: [
1252
+ /* @__PURE__ */ jsxs11("div", { className: "mk-slot-picker__month", children: [
1253
+ /* @__PURE__ */ jsx23("h3", { className: "mk-slot-picker__title", "data-mk-slot-title": true }),
1254
+ /* @__PURE__ */ jsx23("button", { type: "button", className: "mk-slot-picker__nav", "data-mk-slot-prev": true, "aria-label": labels?.previous ?? "Mes anterior", children: "\u2190" }),
1255
+ /* @__PURE__ */ jsx23("button", { type: "button", className: "mk-slot-picker__nav", "data-mk-slot-next": true, "aria-label": labels?.next ?? "Mes siguiente", children: "\u2192" })
1256
+ ] }),
1257
+ /* @__PURE__ */ jsx23("div", { "data-mk-slot-days": true })
1258
+ ] }),
1259
+ /* @__PURE__ */ jsxs11("div", { className: "mk-slot-picker__panel", children: [
1260
+ /* @__PURE__ */ jsx23("p", { className: "mk-slot-picker__heading", "data-mk-slot-heading": true }),
1261
+ /* @__PURE__ */ jsx23("div", { "data-mk-slot-times": true }),
1262
+ name && /* @__PURE__ */ jsx23("input", { type: "hidden", name, "data-mk-slot-value": true }),
1263
+ actions && /* @__PURE__ */ jsx23("div", { className: "mk-slot-picker__actions", children: actions })
1264
+ ] })
1265
+ ] });
1266
+ }
1267
+
1268
+ // src/react/use-weight-hover.ts
1269
+ var useWeightHover = (ref, options, deps) => useRecipe(ref, createWeightHover, options, deps);
1270
+
1271
+ // src/react/use-sticker.ts
1272
+ var useSticker = (ref, options, deps) => useRecipe(ref, createSticker, options, deps);
1273
+
1274
+ // src/react/use-scroll-dock.ts
1275
+ var useScrollDock = (ref, options, deps) => useRecipe(ref, createScrollDock, options, deps);
1276
+
1277
+ // src/react/use-local-clock.ts
1278
+ var useLocalClock = (ref, options, deps) => useRecipe(ref, createLocalClock, options, deps);
1279
+
1280
+ // src/components/attachment/react.tsx
1281
+ import { useRef as useRef22 } from "react";
1282
+ import { jsx as jsx24 } from "react/jsx-runtime";
1283
+ function Attachment({ accept, multiple, maxFiles, maxSize, disabled, name, initialFiles, hint, labels, onFiles, onRemove, onReject, uploads, instanceRef, className, ...props }) {
1284
+ const ref = useRef22(null);
1285
+ const instance = useRef22(null);
1286
+ const kept = useRef22(void 0);
1287
+ const files = useLatest(onFiles);
1288
+ const removed = useLatest(onRemove);
1289
+ const rejected = useLatest(onReject);
1290
+ const latestUploads = useLatest(uploads);
1291
+ const seed = useLatest(initialFiles);
1292
+ const labelKey = JSON.stringify(labels ?? {});
1293
+ useIsomorphicLayoutEffect(() => {
1294
+ const created = createAttachment(ref.current, {
1295
+ accept,
1296
+ multiple,
1297
+ maxFiles,
1298
+ maxSize,
1299
+ disabled,
1300
+ name,
1301
+ hint,
1302
+ labels,
1303
+ initialFiles: kept.current ?? seed.current,
1304
+ onFiles: (added, all) => files.current?.(added, all),
1305
+ onRemove: (file, all) => removed.current?.(file, all),
1306
+ onReject: (list) => rejected.current?.(list)
1307
+ });
1308
+ for (const [id, upload] of Object.entries(latestUploads.current ?? {})) created.setProgress(id, upload.progress, upload.status);
1309
+ instance.current = created;
1310
+ if (instanceRef) instanceRef.current = created;
1311
+ return () => {
1312
+ kept.current = created.files;
1313
+ created.destroy();
1314
+ instance.current = null;
1315
+ if (instanceRef) instanceRef.current = null;
1316
+ };
1317
+ }, [accept, multiple, maxFiles, maxSize, disabled, name, hint, labelKey]);
1318
+ const uploadKey = JSON.stringify(uploads ?? {});
1319
+ useIsomorphicLayoutEffect(() => {
1320
+ for (const [id, upload] of Object.entries(uploads ?? {})) instance.current?.setProgress(id, upload.progress, upload.status);
1321
+ }, [uploadKey]);
1322
+ return /* @__PURE__ */ jsx24("div", { ...props, ref, className: ["mk-attachment", className].filter(Boolean).join(" ") });
1323
+ }
1324
+
1325
+ // src/components/skeleton/react.tsx
1326
+ import { useRef as useRef23 } from "react";
1327
+ import { jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
1328
+ function Skeleton({ loading = true, animation, shape = "text", lines, label, placeholder, children, className, ...props }) {
1329
+ const ref = useRef23(null);
1330
+ const instance = useRef23(null);
1331
+ const current = useRef23(loading);
1332
+ current.current = loading;
1333
+ useIsomorphicLayoutEffect(() => {
1334
+ const created = createSkeleton(ref.current, { loading: current.current, animation, shape, lines, label });
1335
+ instance.current = created;
1336
+ return () => {
1337
+ created.destroy();
1338
+ instance.current = null;
1339
+ };
1340
+ }, [animation, shape, lines, label]);
1341
+ useIsomorphicLayoutEffect(() => {
1342
+ instance.current?.setLoading(loading);
1343
+ }, [loading]);
1344
+ return /* @__PURE__ */ jsxs12("div", { ...props, ref, className: ["mk-skeleton", className].filter(Boolean).join(" "), "data-mk-ssr-loading": loading ? "" : void 0, children: [
1345
+ /* @__PURE__ */ jsx25("div", { "data-mk-skeleton-placeholder": "", "data-mk-shape": shape, children: placeholder ?? skeletonBones(shape, lines).map((bone, i) => /* @__PURE__ */ jsx25("span", { "data-mk-bone": bone }, i)) }),
1346
+ /* @__PURE__ */ jsx25("div", { "data-mk-skeleton-content": "", children })
1347
+ ] });
1348
+ }
1349
+
1350
+ // src/components/questionnaire/react.tsx
1351
+ import { useRef as useRef24, useState as useState5 } from "react";
1352
+ import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
1353
+ var optionOf = (option) => typeof option === "string" ? { value: option, label: option } : option;
1354
+ function Questionnaire({ questions, defaultAnswers = {}, labels = {}, onChange, onComplete, complete, instanceRef, className, ...props }) {
1355
+ const ref = useRef24(null);
1356
+ const [answers, setAnswers] = useState5(null);
1357
+ const change = useLatest(onChange);
1358
+ const completed = useLatest(onComplete);
1359
+ const key = JSON.stringify(questions.map(({ id, type, required: required2, options }) => [id, type, required2, options]));
1360
+ const { required, choice } = labels;
1361
+ useIsomorphicLayoutEffect(() => {
1362
+ const created = createQuestionnaire(ref.current, {
1363
+ labels: { required, choice },
1364
+ onChange: (index, current) => change.current?.(index, current),
1365
+ onComplete: (current) => {
1366
+ setAnswers(current);
1367
+ completed.current?.(current);
1368
+ }
1369
+ });
1370
+ if (instanceRef) instanceRef.current = created;
1371
+ return () => {
1372
+ created.destroy();
1373
+ if (instanceRef) instanceRef.current = null;
1374
+ };
1375
+ }, [key, required, choice]);
1376
+ const count = questions.length;
1377
+ const defaults = (id) => defaultAnswers[id];
1378
+ return /* @__PURE__ */ jsxs13("form", { ...props, ref, noValidate: true, className: ["mk-questionnaire", className].filter(Boolean).join(" "), onReset: () => setAnswers(null), children: [
1379
+ /* @__PURE__ */ jsx26("div", { "data-mk-question-progress": "", "aria-hidden": "true", children: /* @__PURE__ */ jsx26("span", { "data-mk-question-bar": "" }) }),
1380
+ questions.map((question, i) => {
1381
+ const titleId = `${question.id}-title`;
1382
+ const describedBy = question.description ? `${question.id}-description` : void 0;
1383
+ const value = defaults(question.id);
1384
+ return /* @__PURE__ */ jsxs13("section", { "data-mk-question": "", "data-mk-step": "", hidden: i !== 0, "aria-labelledby": titleId, children: [
1385
+ /* @__PURE__ */ jsx26("p", { "data-mk-question-step": "", children: labels.step ? labels.step(i, count) : `Pregunta ${i + 1} de ${count}` }),
1386
+ /* @__PURE__ */ jsxs13("h3", { id: titleId, "data-mk-step-title": "", "data-mk-flow-item": "", children: [
1387
+ question.label,
1388
+ question.required ? /* @__PURE__ */ jsx26("span", { "data-mk-question-required": "", "aria-hidden": "true", children: " *" }) : null
1389
+ ] }),
1390
+ question.description && /* @__PURE__ */ jsx26("p", { id: describedBy, "data-mk-question-description": "", "data-mk-flow-item": "", children: question.description }),
1391
+ /* @__PURE__ */ jsxs13("div", { "data-mk-question-field": "", "data-mk-flow-item": "", children: [
1392
+ question.type === "text" && /* @__PURE__ */ jsx26("input", { name: question.id, type: "text", required: question.required, "aria-labelledby": titleId, "aria-describedby": describedBy, placeholder: question.placeholder, defaultValue: typeof value === "string" ? value : "" }),
1393
+ question.type === "textarea" && /* @__PURE__ */ jsx26("textarea", { name: question.id, rows: 4, required: question.required, "aria-labelledby": titleId, "aria-describedby": describedBy, placeholder: question.placeholder, defaultValue: typeof value === "string" ? value : "" }),
1394
+ (question.type === "single" || question.type === "multiple") && /* @__PURE__ */ jsx26("div", { role: question.type === "single" ? "radiogroup" : "group", "aria-labelledby": titleId, "aria-describedby": describedBy, "data-mk-question-options": "", children: (question.options ?? []).map(optionOf).map((option) => /* @__PURE__ */ jsxs13("label", { "data-mk-question-option": "", children: [
1395
+ /* @__PURE__ */ jsx26(
1396
+ "input",
1397
+ {
1398
+ type: question.type === "single" ? "radio" : "checkbox",
1399
+ name: question.id,
1400
+ value: option.value,
1401
+ required: question.required,
1402
+ defaultChecked: Array.isArray(value) ? value.includes(option.value) : value === option.value
1403
+ }
1404
+ ),
1405
+ /* @__PURE__ */ jsx26("span", { children: option.label })
1406
+ ] }, option.value)) })
1407
+ ] }),
1408
+ /* @__PURE__ */ jsxs13("div", { "data-mk-question-actions": "", "data-mk-flow-item": "", children: [
1409
+ i > 0 && /* @__PURE__ */ jsx26("button", { type: "button", className: "mk-button mk-button--text", "data-mk-question-prev": "", children: labels.prev ?? "Anterior" }),
1410
+ i < count - 1 ? /* @__PURE__ */ jsx26("button", { type: "button", className: "mk-button", "data-mk-question-next": "", children: labels.next ?? "Siguiente" }) : /* @__PURE__ */ jsx26("button", { type: "submit", className: "mk-button", children: labels.finish ?? "Finalizar" })
1411
+ ] })
1412
+ ] }, question.id);
1413
+ }),
1414
+ /* @__PURE__ */ jsx26("p", { "data-mk-question-error": "", role: "alert" }),
1415
+ /* @__PURE__ */ jsxs13("div", { "data-mk-question-complete": "", hidden: true, children: [
1416
+ answers && (typeof complete === "function" ? complete(answers) : complete),
1417
+ /* @__PURE__ */ jsx26("button", { type: "reset", className: "mk-button mk-button--tonal", children: labels.restart ?? "Empezar de nuevo" })
1418
+ ] })
1419
+ ] });
1420
+ }
1421
+
1422
+ // src/components/code-block/react.tsx
1423
+ import { Fragment as Fragment3, useMemo as useMemo3, useRef as useRef25 } from "react";
1424
+ import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
1425
+ function CodeBlock({ code, language, title, lineNumbers, highlight, highlightLines, copyLabel = "Copiar", copiedLabel, errorLabel, onCopy, className, ...props }) {
1426
+ const ref = useRef25(null);
1427
+ const instance = useRef25(null);
1428
+ const copied = useLatest(onCopy);
1429
+ const latest = useLatest(code);
1430
+ useIsomorphicLayoutEffect(() => {
1431
+ const created = createCodeBlock(ref.current, { copyLabel, copiedLabel, errorLabel, onCopy: (ok) => copied.current?.(ok) });
1432
+ created.setCode(latest.current);
1433
+ instance.current = created;
1434
+ return () => {
1435
+ created.destroy();
1436
+ instance.current = null;
1437
+ };
1438
+ }, [copyLabel, copiedLabel, errorLabel]);
1439
+ useIsomorphicLayoutEffect(() => {
1440
+ instance.current?.setCode(code);
1441
+ }, [code]);
1442
+ const first = useRef25(true);
1443
+ useIsomorphicLayoutEffect(() => {
1444
+ if (first.current) {
1445
+ first.current = false;
1446
+ return;
1447
+ }
1448
+ const animation = flowLines(ref.current?.querySelector("code") ?? null);
1449
+ return () => {
1450
+ animation?.progress(1).kill();
1451
+ };
1452
+ }, [code, language]);
1453
+ const colour = highlight ?? languageFamily(language) !== "plain";
1454
+ const lines = useMemo3(() => tokenLines(tokenize(code, colour ? language : void 0)), [code, language, colour]);
1455
+ const trailing = lines.length > 1 && !lines[lines.length - 1].length;
1456
+ const shown = trailing ? lines.slice(0, -1) : lines;
1457
+ const marked = new Set(highlightLines ?? []);
1458
+ return /* @__PURE__ */ jsxs14("div", { ...props, ref, className: ["mk-code-block", className].filter(Boolean).join(" "), "data-mk-language": language, "data-mk-line-numbers": lineNumbers ? "" : void 0, children: [
1459
+ /* @__PURE__ */ jsxs14("div", { "data-mk-code-header": "", children: [
1460
+ /* @__PURE__ */ jsxs14("span", { "data-mk-code-dots": "", "aria-hidden": "true", children: [
1461
+ /* @__PURE__ */ jsx27("i", {}),
1462
+ /* @__PURE__ */ jsx27("i", {}),
1463
+ /* @__PURE__ */ jsx27("i", {})
1464
+ ] }),
1465
+ /* @__PURE__ */ jsx27("span", { "data-mk-code-title": "", children: title }),
1466
+ language && /* @__PURE__ */ jsx27("span", { "data-mk-code-language": "", children: language }),
1467
+ /* @__PURE__ */ jsxs14("button", { type: "button", "data-mk-code-copy": "", children: [
1468
+ /* @__PURE__ */ jsxs14("svg", { "aria-hidden": "true", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
1469
+ /* @__PURE__ */ jsx27("rect", { x: "9", y: "9", width: "11", height: "11", rx: "2.5" }),
1470
+ /* @__PURE__ */ jsx27("path", { d: "M5 15V6a2 2 0 0 1 2-2h8" })
1471
+ ] }),
1472
+ /* @__PURE__ */ jsx27("span", { "data-mk-code-copy-text": "", children: copyLabel })
1473
+ ] })
1474
+ ] }),
1475
+ /* @__PURE__ */ jsx27("pre", { tabIndex: 0, children: /* @__PURE__ */ jsxs14("code", { children: [
1476
+ shown.map((line, i) => /* @__PURE__ */ jsxs14(Fragment3, { children: [
1477
+ i ? "\n" : null,
1478
+ /* @__PURE__ */ jsx27("span", { "data-mk-code-line": "", "data-mk-highlight": marked.has(i + 1) ? "" : void 0, children: line.map(
1479
+ (token, k) => token.type === "plain" ? /* @__PURE__ */ jsx27(Fragment3, { children: token.text }, k) : /* @__PURE__ */ jsx27("span", { "data-mk-token": token.type, children: token.text }, k)
1480
+ ) })
1481
+ ] }, i)),
1482
+ trailing ? "\n" : null
1483
+ ] }) }),
1484
+ /* @__PURE__ */ jsx27("span", { "data-mk-code-status": "", className: "mk-sr-only", role: "status" })
1485
+ ] });
1486
+ }
1487
+
1488
+ // src/components/context-menu/react.tsx
1489
+ import { useRef as useRef26 } from "react";
1490
+ import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
1491
+ function Root5({ menu, label = "Acciones", onSelect, onOpenChange, closeOnSelect = true, overrideEditable, longPress, variant, instanceRef, className, children, ...props }) {
1492
+ const ref = useRef26(null);
1493
+ const select = useLatest(onSelect);
1494
+ const change = useLatest(onOpenChange);
1495
+ useIsomorphicLayoutEffect(() => {
1496
+ const created = createContextMenu(ref.current, {
1497
+ closeOnSelect,
1498
+ overrideEditable,
1499
+ longPress,
1500
+ variant,
1501
+ onSelect: (value, item) => select.current?.(value, item),
1502
+ onOpenChange: (open) => change.current?.(open)
1503
+ });
1504
+ if (instanceRef) instanceRef.current = created;
1505
+ return () => {
1506
+ created.destroy();
1507
+ if (instanceRef) instanceRef.current = null;
1508
+ };
1509
+ }, [closeOnSelect, overrideEditable, longPress, variant]);
1510
+ return /* @__PURE__ */ jsxs15("div", { ...props, ref, className: ["mk-context-menu", className].filter(Boolean).join(" "), "data-mk-context-trigger": "", children: [
1511
+ children,
1512
+ /* @__PURE__ */ jsx28("dialog", { "data-mk-context-menu": "", className: "mk-dialog mk-menu", "aria-label": label, children: menu })
1513
+ ] });
1514
+ }
1515
+ var ContextMenu = Object.assign(Root5, { Item: Menu.Item, Separator: Menu.Separator });
1516
+
1517
+ // src/components/drawer/react.tsx
1518
+ import { createContext as createContext6, useContext as useContext6, useMemo as useMemo4 } from "react";
1519
+ import { jsx as jsx29 } from "react/jsx-runtime";
1520
+ var DrawerContext = createContext6(null);
1521
+ function useDrawerContext(part) {
1522
+ const value = useContext6(DrawerContext);
1523
+ if (!value) throw new Error(`<Drawer.${part}> must be inside <Drawer.Root>`);
1524
+ return value;
1525
+ }
1526
+ function Root6({ side = "right", children, ...props }) {
1527
+ const surface = useSurfaceRoot(props);
1528
+ return /* @__PURE__ */ jsx29(DrawerContext.Provider, { value: { ...surface, side }, children });
1529
+ }
1530
+ function Trigger3({ onClick, children, ...props }) {
1531
+ const context = useDrawerContext("Trigger");
1532
+ return /* @__PURE__ */ jsx29(
1533
+ "button",
1534
+ {
1535
+ type: "button",
1536
+ "aria-haspopup": "dialog",
1537
+ "aria-expanded": context.open,
1538
+ ...props,
1539
+ onClick: (event) => {
1540
+ onClick?.(event);
1541
+ if (event.defaultPrevented) return;
1542
+ context.origin.current = event.currentTarget;
1543
+ context.setOpen(!context.open);
1544
+ },
1545
+ children
1546
+ }
1547
+ );
1548
+ }
1549
+ function Content3({ className, children, ...props }) {
1550
+ const context = useDrawerContext("Content");
1551
+ const options = useMemo4(() => ({ ...context.options, side: context.side }), [context.options, context.side]);
1552
+ const ref = useSurfaceEngine({ ...context, options }, (dialog, engineOptions) => createDrawer(dialog, engineOptions));
1553
+ return /* @__PURE__ */ jsx29("dialog", { ref, className: ["mk-dialog mk-drawer", className].filter(Boolean).join(" "), ...props, children });
1554
+ }
1555
+ var Drawer = {
1556
+ Root: Root6,
1557
+ Trigger: Trigger3,
1558
+ Content: Content3,
1559
+ Header: Dialog.Header,
1560
+ Title: Dialog.Title,
1561
+ Description: Dialog.Description,
1562
+ Actions: Dialog.Actions,
1563
+ Body: Dialog.Body,
1564
+ Footer: Dialog.Footer,
1565
+ Close: Dialog.Close
1566
+ };
1567
+ function useDrawer() {
1568
+ const context = useDrawerContext("useDrawer");
1569
+ return { open: context.open, setOpen: context.setOpen, side: context.side, instance: context.instance };
1570
+ }
1571
+
1572
+ // src/components/link-preview/react.tsx
1573
+ import { useEffect as useEffect3, useId, useRef as useRef27, useState as useState6 } from "react";
1574
+ import { Fragment as Fragment4, jsx as jsx30, jsxs as jsxs16 } from "react/jsx-runtime";
1575
+ function Card({ url, title, description, image, imageAlt, siteName, target }) {
1576
+ const id = useId();
1577
+ const href = safeHref(url);
1578
+ const domain = linkDomain(href);
1579
+ const source = safeImage(image);
1580
+ const [failed, setFailed] = useState6(false);
1581
+ useEffect3(() => setFailed(false), [source]);
1582
+ const site = [siteName, domain].filter(Boolean).filter((value, i, all) => all.indexOf(value) === i).join(" \xB7 ");
1583
+ const content = /* @__PURE__ */ jsxs16(Fragment4, { children: [
1584
+ /* @__PURE__ */ jsxs16("span", { "data-mk-part": "media", children: [
1585
+ /* @__PURE__ */ jsx30("span", { "data-mk-part": "fallback", "aria-hidden": "true", children: (siteName || domain || title || "?").trim().charAt(0).toUpperCase() }),
1586
+ source && !failed ? /* @__PURE__ */ jsx30("img", { "data-mk-link-image": "", src: source, alt: imageAlt ?? "", loading: "lazy", decoding: "async", onError: () => setFailed(true) }) : null
1587
+ ] }),
1588
+ /* @__PURE__ */ jsxs16("span", { "data-mk-part": "text", children: [
1589
+ site && /* @__PURE__ */ jsxs16("span", { "data-mk-part": "meta", children: [
1590
+ /* @__PURE__ */ jsx30("span", { "data-mk-part": "favicon", "aria-hidden": "true", children: (siteName || domain).trim().charAt(0).toUpperCase() }),
1591
+ /* @__PURE__ */ jsx30("span", { "data-mk-part": "site", children: site })
1592
+ ] }),
1593
+ /* @__PURE__ */ jsx30("span", { "data-mk-part": "title", id: `${id}-title`, children: title || domain || href }),
1594
+ description && /* @__PURE__ */ jsx30("span", { "data-mk-part": "description", id: `${id}-description`, children: description })
1595
+ ] }),
1596
+ /* @__PURE__ */ jsx30("span", { "data-mk-part": "go", "aria-hidden": "true", children: /* @__PURE__ */ jsx30("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx30("path", { d: "M7 17L17 7M9 7h8v8" }) }) })
1597
+ ] });
1598
+ const labelled = { "aria-labelledby": `${id}-title`, "aria-describedby": description ? `${id}-description` : void 0 };
1599
+ return href ? /* @__PURE__ */ jsx30("a", { "data-mk-link-card": "", href, target, rel: target === "_blank" ? "noopener noreferrer" : void 0, ...labelled, children: content }) : /* @__PURE__ */ jsx30("span", { "data-mk-link-card": "", ...labelled, children: content });
1600
+ }
1601
+ function LinkPreview({ url, title, description, image, imageAlt, siteName, variant = "card", label, target, openDelay, closeDelay, placement, onOpenChange, className, ...props }) {
1602
+ const ref = useRef27(null);
1603
+ const change = useLatest(onOpenChange);
1604
+ const href = safeHref(url);
1605
+ const hover = variant === "hover";
1606
+ useIsomorphicLayoutEffect(() => {
1607
+ if (!hover) return;
1608
+ const instance = createHoverCard(ref.current, { openDelay, closeDelay, placement, onOpenChange: (open) => change.current?.(open) });
1609
+ return () => instance.destroy();
1610
+ }, [hover, openDelay, closeDelay, placement]);
1611
+ const card = /* @__PURE__ */ jsx30(Card, { url, title, description, image, imageAlt, siteName, target });
1612
+ if (!hover) {
1613
+ return /* @__PURE__ */ jsx30("div", { ...props, className: ["mk-link-preview", className].filter(Boolean).join(" "), "data-mk-link-variant": variant === "row" ? "row" : "card", children: card });
1614
+ }
1615
+ const text = label || title || linkDomain(href) || href;
1616
+ return /* @__PURE__ */ jsxs16("span", { ...props, ref, className: ["mk-link-preview mk-hover-card", className].filter(Boolean).join(" "), "data-mk-link-variant": "hover", children: [
1617
+ href ? /* @__PURE__ */ jsx30("a", { "data-mk-hover-trigger": "", href, target, rel: target === "_blank" ? "noopener noreferrer" : void 0, children: text }) : /* @__PURE__ */ jsx30("span", { "data-mk-hover-trigger": "", tabIndex: 0, children: text }),
1618
+ /* @__PURE__ */ jsx30("span", { "data-mk-hover-panel": "", role: "region", "aria-label": `Vista previa: ${title || linkDomain(href)}`, hidden: true, children: card })
1619
+ ] });
1620
+ }
1621
+
1622
+ // src/components/progress/react.tsx
1623
+ import { useRef as useRef28 } from "react";
1624
+ import { jsx as jsx31 } from "react/jsx-runtime";
1625
+ function Progress({ value, min, max, label, variant, showValue, formatValue, className, ...props }) {
1626
+ const ref = useRef28(null);
1627
+ const instance = useRef28(null);
1628
+ const current = useLatest(value);
1629
+ const format = useLatest(formatValue);
1630
+ const formatted = formatValue !== void 0;
1631
+ useIsomorphicLayoutEffect(() => {
1632
+ const created = createProgress(ref.current, {
1633
+ value: current.current,
1634
+ min,
1635
+ max,
1636
+ label,
1637
+ variant,
1638
+ showValue,
1639
+ formatValue: formatted ? (n, ratio) => format.current?.(n, ratio) ?? "" : void 0
1640
+ });
1641
+ instance.current = created;
1642
+ return () => {
1643
+ created.destroy();
1644
+ instance.current = null;
1645
+ };
1646
+ }, [min, max, label, variant, showValue, formatted]);
1647
+ useIsomorphicLayoutEffect(() => {
1648
+ instance.current?.setValue(value === void 0 ? min ?? 0 : value);
1649
+ }, [value]);
1650
+ return /* @__PURE__ */ jsx31("div", { ...props, ref, className: ["mk-progress", className].filter(Boolean).join(" ") });
1651
+ }
1652
+
1653
+ // src/components/range-slider/react.tsx
1654
+ import { useRef as useRef29 } from "react";
1655
+ import { jsx as jsx32, jsxs as jsxs17 } from "react/jsx-runtime";
1656
+ function RangeSlider({ min, max, step, value, defaultValue, disabled, name, label, formatValue, onInput, onChange, showOutput = true, className, ...props }) {
1657
+ const ref = useRef29(null);
1658
+ const instance = useRef29(null);
1659
+ const edited = useRef29(void 0);
1660
+ const input = useLatest(onInput);
1661
+ const change = useLatest(onChange);
1662
+ const format = useLatest(formatValue);
1663
+ const formatted = formatValue !== void 0;
1664
+ const start = value ?? defaultValue;
1665
+ const count = Array.isArray(start) ? 2 : 1;
1666
+ const current = useLatest(value);
1667
+ useIsomorphicLayoutEffect(() => {
1668
+ const created = createRangeSlider(ref.current, {
1669
+ min,
1670
+ max,
1671
+ step,
1672
+ disabled,
1673
+ name,
1674
+ label,
1675
+ value: current.current ?? edited.current ?? start,
1676
+ formatValue: formatted ? (n) => format.current?.(n) ?? String(n) : void 0,
1677
+ onInput: (next) => input.current?.(next),
1678
+ onChange: (next) => change.current?.(next)
1679
+ });
1680
+ instance.current = created;
1681
+ return () => {
1682
+ edited.current = created.value;
1683
+ created.destroy();
1684
+ instance.current = null;
1685
+ };
1686
+ }, [min, max, step, disabled, name, label, formatted, count]);
1687
+ const valueKey = JSON.stringify(value);
1688
+ useIsomorphicLayoutEffect(() => {
1689
+ if (value !== void 0) instance.current?.setValue(value, false);
1690
+ }, [valueKey]);
1691
+ const initial = Array.isArray(start) ? start : [start ?? min ?? 0];
1692
+ return /* @__PURE__ */ jsxs17("div", { ...props, ref, className: ["mk-range-slider", className].filter(Boolean).join(" "), children: [
1693
+ /* @__PURE__ */ jsx32("div", { "data-mk-range-track": "", children: initial.map((n, i) => /* @__PURE__ */ jsx32("input", { type: "range", "data-mk-range-input": "", defaultValue: n }, i)) }),
1694
+ showOutput && /* @__PURE__ */ jsx32("output", { "data-mk-range-output": "" })
1695
+ ] });
1696
+ }
1697
+
1698
+ // src/components/chart/react.tsx
1699
+ import { useRef as useRef30 } from "react";
1700
+ import { jsx as jsx33 } from "react/jsx-runtime";
1701
+ function Chart({ type, labels, series, points, stacked, formatValue, label, height, emptyLabel, legend, tooltip, onSelect, instanceRef, className, ...props }) {
1702
+ const ref = useRef30(null);
1703
+ const instance = useRef30(null);
1704
+ const format = useLatest(formatValue);
1705
+ const select = useLatest(onSelect);
1706
+ const formatted = formatValue !== void 0;
1707
+ const data = { type, labels, series, points, stacked, label, height, emptyLabel, legend, tooltip };
1708
+ const key = JSON.stringify(data);
1709
+ const latest = useLatest(data);
1710
+ const options = () => ({
1711
+ ...latest.current,
1712
+ formatValue: formatted ? (value) => format.current?.(value) ?? String(value) : void 0,
1713
+ onSelect: (index) => select.current?.(index)
1714
+ });
1715
+ useIsomorphicLayoutEffect(() => {
1716
+ const created = createChart(ref.current, options());
1717
+ instance.current = created;
1718
+ if (instanceRef) instanceRef.current = created;
1719
+ return () => {
1720
+ created.destroy();
1721
+ instance.current = null;
1722
+ if (instanceRef) instanceRef.current = null;
1723
+ };
1724
+ }, []);
1725
+ const first = useRef30(true);
1726
+ useIsomorphicLayoutEffect(() => {
1727
+ if (first.current) {
1728
+ first.current = false;
1729
+ return;
1730
+ }
1731
+ instance.current?.update(options());
1732
+ }, [key, formatted]);
1733
+ return /* @__PURE__ */ jsx33("div", { ...props, ref, className: ["mk-chart", className].filter(Boolean).join(" ") });
1734
+ }
1735
+
1736
+ // src/components/credit-card/react.tsx
1737
+ import { useRef as useRef31 } from "react";
1738
+ import { jsx as jsx34 } from "react/jsx-runtime";
1739
+ function CreditCard({ labels, names, tilt, onChange, onComplete, instanceRef, className, ...props }) {
1740
+ const ref = useRef31(null);
1741
+ const change = useLatest(onChange);
1742
+ const complete = useLatest(onComplete);
1743
+ const key = JSON.stringify([labels ?? {}, names ?? {}]);
1744
+ useIsomorphicLayoutEffect(() => {
1745
+ const created = createCreditCard(ref.current, {
1746
+ labels,
1747
+ names,
1748
+ tilt,
1749
+ onChange: (state) => change.current?.(state),
1750
+ onComplete: () => complete.current?.()
1751
+ });
1752
+ if (instanceRef) instanceRef.current = created;
1753
+ return () => {
1754
+ created.destroy();
1755
+ if (instanceRef) instanceRef.current = null;
1756
+ };
1757
+ }, [key, tilt]);
1758
+ return /* @__PURE__ */ jsx34("div", { ...props, ref, className: ["mk-credit-card", className].filter(Boolean).join(" ") });
1759
+ }
1760
+
1761
+ // src/components/command-search/react.tsx
1762
+ import { useRef as useRef32 } from "react";
1763
+ import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs18 } from "react/jsx-runtime";
1764
+ function CommandSearch({ items, placeholder, emptyLabel, label, shortcut, limit, trigger, onSelect, onOpenChange, instanceRef, className, ...props }) {
1765
+ const ref = useRef32(null);
1766
+ const instance = useRef32(null);
1767
+ const select = useLatest(onSelect);
1768
+ const change = useLatest(onOpenChange);
1769
+ const latest = useLatest(items);
1770
+ useIsomorphicLayoutEffect(() => {
1771
+ const created = createCommandSearch(ref.current, {
1772
+ items: latest.current,
1773
+ placeholder,
1774
+ emptyLabel,
1775
+ label,
1776
+ shortcut,
1777
+ limit,
1778
+ onSelect: (item) => select.current?.(item),
1779
+ onOpenChange: (open) => change.current?.(open)
1780
+ });
1781
+ instance.current = created;
1782
+ if (instanceRef) instanceRef.current = created;
1783
+ return () => {
1784
+ created.destroy();
1785
+ instance.current = null;
1786
+ if (instanceRef) instanceRef.current = null;
1787
+ };
1788
+ }, [placeholder, emptyLabel, label, shortcut, limit]);
1789
+ const key = JSON.stringify(items);
1790
+ useIsomorphicLayoutEffect(() => {
1791
+ instance.current?.setItems(latest.current);
1792
+ }, [key]);
1793
+ return /* @__PURE__ */ jsx35("span", { ...props, ref, className: ["mk-command-search", className].filter(Boolean).join(" "), children: trigger === null ? null : /* @__PURE__ */ jsx35("button", { type: "button", "data-mk-command-open": "", "aria-haspopup": "dialog", children: trigger ?? /* @__PURE__ */ jsxs18(Fragment5, { children: [
1794
+ /* @__PURE__ */ jsx35("span", { children: "Buscar\u2026" }),
1795
+ /* @__PURE__ */ jsx35("kbd", { "aria-hidden": "true", children: "\u2318K" })
1796
+ ] }) }) });
1797
+ }
1798
+
1799
+ // src/components/hold-confirm/react.tsx
1800
+ import { useRef as useRef33 } from "react";
1801
+ import { jsx as jsx36 } from "react/jsx-runtime";
1802
+ function HoldConfirm({ duration, resetAfter, holdingLabel, doneLabel, hint, disabled, onConfirm, className, children, ...props }) {
1803
+ const ref = useRef33(null);
1804
+ const confirm = useLatest(onConfirm);
1805
+ useIsomorphicLayoutEffect(() => {
1806
+ const instance = createHoldConfirm(ref.current, { duration, resetAfter, holdingLabel, doneLabel, hint, disabled, onConfirm: () => confirm.current?.() });
1807
+ return () => instance.destroy();
1808
+ }, [duration, resetAfter, holdingLabel, doneLabel, hint, disabled]);
1809
+ return /* @__PURE__ */ jsx36("span", { ref, className: ["mk-hold-confirm", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx36("button", { type: "button", ...props, children: /* @__PURE__ */ jsx36("span", { "data-mk-hold-text": "", children }) }) });
1810
+ }
1811
+
1812
+ // src/components/image-preview/react.tsx
1813
+ import { useRef as useRef34 } from "react";
1814
+ import { jsx as jsx37 } from "react/jsx-runtime";
1815
+ function ImagePreview({ images, labels, loop, onChange, onOpenChange, instanceRef, className, ...props }) {
1816
+ const ref = useRef34(null);
1817
+ const change = useLatest(onChange);
1818
+ const openChange = useLatest(onOpenChange);
1819
+ const key = JSON.stringify(labels ?? {});
1820
+ useIsomorphicLayoutEffect(() => {
1821
+ const created = createImagePreview(ref.current, { labels, loop, onChange: (i) => change.current?.(i), onOpenChange: (open) => openChange.current?.(open) });
1822
+ if (instanceRef) instanceRef.current = created;
1823
+ return () => {
1824
+ created.destroy();
1825
+ if (instanceRef) instanceRef.current = null;
1826
+ };
1827
+ }, [key, loop]);
1828
+ return /* @__PURE__ */ jsx37("div", { ...props, ref, className: ["mk-image-preview", className].filter(Boolean).join(" "), children: images.map((image, i) => /* @__PURE__ */ jsx37("button", { type: "button", "data-mk-image": "", "data-mk-src": image.src, "data-mk-caption": image.caption, "aria-label": `Ver ${image.alt}`, children: /* @__PURE__ */ jsx37("img", { src: image.thumb ?? image.src, alt: image.alt, loading: "lazy", decoding: "async" }) }, `${image.src}-${i}`)) });
1829
+ }
1830
+
1831
+ // src/components/like-button/react.tsx
1832
+ import { useRef as useRef35 } from "react";
1833
+ import { jsx as jsx38 } from "react/jsx-runtime";
1834
+ function LikeButton({ liked, defaultLiked, count = 0, label, hideCount, onChange, className, ...props }) {
1835
+ const ref = useRef35(null);
1836
+ const instance = useRef35(null);
1837
+ const change = useLatest(onChange);
1838
+ const start = useRef35({ liked: liked ?? defaultLiked ?? false, count });
1839
+ useIsomorphicLayoutEffect(() => {
1840
+ const created = createLikeButton(ref.current, { ...start.current, label, hideCount, onChange: (next, total) => change.current?.(next, total) });
1841
+ instance.current = created;
1842
+ return () => {
1843
+ start.current = { liked: created.liked, count: created.count };
1844
+ created.destroy();
1845
+ instance.current = null;
1846
+ };
1847
+ }, [label, hideCount]);
1848
+ useIsomorphicLayoutEffect(() => {
1849
+ if (liked !== void 0 && instance.current && instance.current.liked !== liked) instance.current.setLiked(liked, false);
1850
+ }, [liked]);
1851
+ useIsomorphicLayoutEffect(() => {
1852
+ if (instance.current && instance.current.count !== count) instance.current.setCount(count);
1853
+ }, [count]);
1854
+ return /* @__PURE__ */ jsx38("button", { type: "button", ...props, ref, className: ["mk-like-button", className].filter(Boolean).join(" ") });
1855
+ }
1856
+
1857
+ // src/components/notification-bell/react.tsx
1858
+ import { useRef as useRef36 } from "react";
1859
+ import { jsx as jsx39 } from "react/jsx-runtime";
1860
+ function NotificationBell({ count = 0, message, label, messageDuration, max, onOpen, instanceRef, className, ...props }) {
1861
+ const ref = useRef36(null);
1862
+ const instance = useRef36(null);
1863
+ const open = useLatest(onOpen);
1864
+ const initial = useRef36(count);
1865
+ useIsomorphicLayoutEffect(() => {
1866
+ const created = createNotificationBell(ref.current, { count: initial.current, label, messageDuration, max, onOpen: () => open.current?.() });
1867
+ instance.current = created;
1868
+ if (instanceRef) instanceRef.current = created;
1869
+ return () => {
1870
+ initial.current = created.count;
1871
+ created.destroy();
1872
+ instance.current = null;
1873
+ if (instanceRef) instanceRef.current = null;
1874
+ };
1875
+ }, [label, messageDuration, max]);
1876
+ const seen = useRef36({ count, message });
1877
+ useIsomorphicLayoutEffect(() => {
1878
+ const bell = instance.current;
1879
+ if (!bell) return;
1880
+ const before = seen.current;
1881
+ seen.current = { count, message };
1882
+ const fresh = message !== void 0 && message !== before.message;
1883
+ if (count > bell.count) {
1884
+ bell.setCount(count - 1);
1885
+ bell.notify(fresh ? message : void 0);
1886
+ } else {
1887
+ bell.setCount(count);
1888
+ if (fresh && message) bell.notify(message);
1889
+ }
1890
+ }, [count, message]);
1891
+ return /* @__PURE__ */ jsx39("span", { ref, className: ["mk-notification-bell", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx39("button", { type: "button", ...props }) });
1892
+ }
1893
+
1894
+ // src/components/password-strength/react.tsx
1895
+ import { useRef as useRef37 } from "react";
1896
+ import { jsx as jsx40 } from "react/jsx-runtime";
1897
+ function PasswordStrength({ minLength, score, requireScore, labels, onStrength, onValueChange, className, ...props }) {
1898
+ const ref = useRef37(null);
1899
+ const strength = useLatest(onStrength);
1900
+ const value = useLatest(onValueChange);
1901
+ const scorer = useLatest(score);
1902
+ const custom = score !== void 0;
1903
+ const key = JSON.stringify(labels ?? {});
1904
+ useIsomorphicLayoutEffect(() => {
1905
+ const instance = createPasswordStrength(ref.current, {
1906
+ minLength,
1907
+ requireScore,
1908
+ labels,
1909
+ score: custom ? (text) => scorer.current(text) : void 0,
1910
+ onChange: (result) => strength.current?.(result)
1911
+ });
1912
+ return () => instance.destroy();
1913
+ }, [minLength, requireScore, key, custom]);
1914
+ return /* @__PURE__ */ jsx40("div", { ref, className: ["mk-password-strength", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx40("input", { autoComplete: "new-password", "aria-label": "Contrase\xF1a", ...props, type: "password", onInput: (event) => value.current?.(event.currentTarget.value) }) });
1915
+ }
1916
+
1917
+ // src/components/scratch-card/react.tsx
1918
+ import { useRef as useRef38 } from "react";
1919
+ import { jsx as jsx41 } from "react/jsx-runtime";
1920
+ function ScratchCard({ threshold, brush, coverLabel, revealLabel, revealedLabel, celebrate, onProgress, onReveal, instanceRef, className, children, ...props }) {
1921
+ const ref = useRef38(null);
1922
+ const progress = useLatest(onProgress);
1923
+ const reveal = useLatest(onReveal);
1924
+ useIsomorphicLayoutEffect(() => {
1925
+ const created = createScratchCard(ref.current, {
1926
+ threshold,
1927
+ brush,
1928
+ coverLabel,
1929
+ revealLabel,
1930
+ revealedLabel,
1931
+ celebrate,
1932
+ onProgress: (value) => progress.current?.(value),
1933
+ onReveal: () => reveal.current?.()
1934
+ });
1935
+ if (instanceRef) instanceRef.current = created;
1936
+ return () => {
1937
+ created.destroy();
1938
+ if (instanceRef) instanceRef.current = null;
1939
+ };
1940
+ }, [threshold, brush, coverLabel, revealLabel, revealedLabel, celebrate]);
1941
+ return /* @__PURE__ */ jsx41("div", { ...props, ref, className: ["mk-scratch-card", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx41("div", { "data-mk-scratch-content": "", children }) });
1942
+ }
1943
+
1944
+ // src/components/star-rating/react.tsx
1945
+ import { useRef as useRef39 } from "react";
1946
+ import { jsx as jsx42 } from "react/jsx-runtime";
1947
+ function StarRating({ value, defaultValue, max, name, label, labels, readonly, allowClear, disabled, onChange, className, ...props }) {
1948
+ const ref = useRef39(null);
1949
+ const instance = useRef39(null);
1950
+ const change = useLatest(onChange);
1951
+ const start = useRef39(value ?? defaultValue ?? 0);
1952
+ const key = JSON.stringify(labels ?? null);
1953
+ useIsomorphicLayoutEffect(() => {
1954
+ const created = createStarRating(ref.current, { value: value ?? start.current, max, name, label, labels, readonly, allowClear, disabled, onChange: (next) => change.current?.(next) });
1955
+ instance.current = created;
1956
+ return () => {
1957
+ start.current = created.value;
1958
+ created.destroy();
1959
+ instance.current = null;
1960
+ };
1961
+ }, [max, name, label, key, readonly, allowClear, disabled]);
1962
+ useIsomorphicLayoutEffect(() => {
1963
+ if (value !== void 0 && instance.current && instance.current.value !== value) instance.current.setValue(value);
1964
+ }, [value]);
1965
+ return /* @__PURE__ */ jsx42("div", { ...props, ref, className: ["mk-star-rating", className].filter(Boolean).join(" ") });
1966
+ }
1967
+
1968
+ // src/components/swipe-actions/react.tsx
1969
+ import { useRef as useRef40 } from "react";
1970
+ import { jsx as jsx43, jsxs as jsxs19 } from "react/jsx-runtime";
1971
+ function Actions({ side, actions }) {
1972
+ return /* @__PURE__ */ jsx43("div", { "data-mk-swipe-actions": side, children: actions.map((action) => /* @__PURE__ */ jsx43(
1973
+ "button",
1974
+ {
1975
+ type: "button",
1976
+ "data-mk-swipe-action": action.id,
1977
+ "data-mk-tone": action.tone,
1978
+ "data-mk-swipe-remove": action.remove ? "" : void 0,
1979
+ "data-mk-swipe-primary": action.primary ? "" : void 0,
1980
+ "aria-label": action.label,
1981
+ children: action.icon ?? action.label
1982
+ },
1983
+ action.id
1984
+ )) });
1985
+ }
1986
+ function Row({ left, right, children, ...props }) {
1987
+ return /* @__PURE__ */ jsxs19("li", { ...props, "data-mk-swipe-row": "", children: [
1988
+ left?.length ? /* @__PURE__ */ jsx43(Actions, { side: "left", actions: left }) : null,
1989
+ /* @__PURE__ */ jsx43("div", { "data-mk-swipe-content": "", children }),
1990
+ right?.length ? /* @__PURE__ */ jsx43(Actions, { side: "right", actions: right }) : null
1991
+ ] });
1992
+ }
1993
+ function Root7({ fullSwipe, onAction, className, children, ...props }) {
1994
+ const ref = useRef40(null);
1995
+ const action = useLatest(onAction);
1996
+ useIsomorphicLayoutEffect(() => {
1997
+ const instance = createSwipeActions(ref.current, { fullSwipe, onAction: (id, row) => action.current?.(id, row) });
1998
+ return () => instance.destroy();
1999
+ }, [fullSwipe]);
2000
+ return /* @__PURE__ */ jsx43("ul", { ...props, ref, className: ["mk-swipe-actions", className].filter(Boolean).join(" "), children });
2001
+ }
2002
+ var SwipeActions = Object.assign(Root7, { Row });
2003
+
2004
+ // src/components/color-slider/react.tsx
2005
+ import { useRef as useRef41 } from "react";
2006
+ import { jsx as jsx44 } from "react/jsx-runtime";
2007
+ function ColorSlider({ value, defaultValue, channel, label, orientation, step, showValue, name, disabled, onInput, onChange, className, ...props }) {
2008
+ const ref = useRef41(null);
2009
+ const instance = useRef41(null);
2010
+ const input = useLatest(onInput);
2011
+ const change = useLatest(onChange);
2012
+ const start = useRef41(value ?? defaultValue);
2013
+ useIsomorphicLayoutEffect(() => {
2014
+ const created = createColorSlider(ref.current, {
2015
+ value: value ?? start.current,
2016
+ channel,
2017
+ label,
2018
+ orientation,
2019
+ step,
2020
+ showValue,
2021
+ name,
2022
+ disabled,
2023
+ onInput: (hex, color) => input.current?.(hex, color),
2024
+ onChange: (hex, color) => change.current?.(hex, color)
2025
+ });
2026
+ instance.current = created;
2027
+ return () => {
2028
+ start.current = created.value;
2029
+ created.destroy();
2030
+ instance.current = null;
2031
+ };
2032
+ }, [channel, label, orientation, step, showValue, name, disabled]);
2033
+ useIsomorphicLayoutEffect(() => {
2034
+ if (value !== void 0 && instance.current && instance.current.value !== toHex(toHsva(value))) instance.current.setColor(value, false);
2035
+ }, [value]);
2036
+ return /* @__PURE__ */ jsx44("div", { ...props, ref, className: ["mk-color-slider", className].filter(Boolean).join(" ") });
2037
+ }
2038
+
2039
+ // src/components/color-area/react.tsx
2040
+ import { useRef as useRef42 } from "react";
2041
+ import { jsx as jsx45 } from "react/jsx-runtime";
2042
+ function ColorArea({ value, defaultValue, label, step, name, disabled, onInput, onChange, className, ...props }) {
2043
+ const ref = useRef42(null);
2044
+ const instance = useRef42(null);
2045
+ const input = useLatest(onInput);
2046
+ const change = useLatest(onChange);
2047
+ const start = useRef42(value ?? defaultValue);
2048
+ useIsomorphicLayoutEffect(() => {
2049
+ const created = createColorArea(ref.current, {
2050
+ value: value ?? start.current,
2051
+ label,
2052
+ step,
2053
+ name,
2054
+ disabled,
2055
+ onInput: (hex, color) => input.current?.(hex, color),
2056
+ onChange: (hex, color) => change.current?.(hex, color)
2057
+ });
2058
+ instance.current = created;
2059
+ return () => {
2060
+ start.current = created.value;
2061
+ created.destroy();
2062
+ instance.current = null;
2063
+ };
2064
+ }, [label, step, name, disabled]);
2065
+ useIsomorphicLayoutEffect(() => {
2066
+ if (value !== void 0 && instance.current && instance.current.value !== toHex(toHsva(value))) instance.current.setColor(value, false);
2067
+ }, [value]);
2068
+ return /* @__PURE__ */ jsx45("div", { ...props, ref, className: ["mk-color-area", className].filter(Boolean).join(" ") });
2069
+ }
2070
+
2071
+ // src/components/color-field/react.tsx
2072
+ import { useRef as useRef43 } from "react";
2073
+ import { jsx as jsx46 } from "react/jsx-runtime";
2074
+ function ColorField({ value, defaultValue, format, alpha, label, name, disabled, readOnly, onChange, className, ...props }) {
2075
+ const ref = useRef43(null);
2076
+ const instance = useRef43(null);
2077
+ const change = useLatest(onChange);
2078
+ const start = useRef43(value ?? defaultValue);
2079
+ useIsomorphicLayoutEffect(() => {
2080
+ const created = createColorField(ref.current, {
2081
+ value: value ?? start.current,
2082
+ format,
2083
+ alpha,
2084
+ label,
2085
+ name,
2086
+ disabled,
2087
+ readOnly,
2088
+ onChange: (hex, color) => change.current?.(hex, color)
2089
+ });
2090
+ instance.current = created;
2091
+ return () => {
2092
+ start.current = created.value;
2093
+ created.destroy();
2094
+ instance.current = null;
2095
+ };
2096
+ }, [format, alpha, label, name, disabled, readOnly]);
2097
+ useIsomorphicLayoutEffect(() => {
2098
+ if (value !== void 0 && instance.current && instance.current.value !== toHex(toHsva(value))) instance.current.setColor(value, false);
2099
+ }, [value]);
2100
+ return /* @__PURE__ */ jsx46("div", { ...props, ref, className: ["mk-color-field", className].filter(Boolean).join(" ") });
2101
+ }
2102
+
2103
+ // src/components/color-picker/react.tsx
2104
+ import { useRef as useRef44 } from "react";
2105
+ import { jsx as jsx47 } from "react/jsx-runtime";
2106
+ function ColorPicker({ value, defaultValue, alpha, format, swatches, label, name, disabled, inline, eyedropper, onInput, onChange, className, ...props }) {
2107
+ const ref = useRef44(null);
2108
+ const instance = useRef44(null);
2109
+ const input = useLatest(onInput);
2110
+ const change = useLatest(onChange);
2111
+ const start = useRef44(value ?? defaultValue);
2112
+ const key = JSON.stringify(swatches ?? null);
2113
+ useIsomorphicLayoutEffect(() => {
2114
+ const created = createColorPicker(ref.current, {
2115
+ value: value ?? start.current,
2116
+ alpha,
2117
+ format,
2118
+ swatches,
2119
+ label,
2120
+ name,
2121
+ disabled,
2122
+ inline,
2123
+ eyedropper,
2124
+ onInput: (hex, color) => input.current?.(hex, color),
2125
+ onChange: (hex, color) => change.current?.(hex, color)
2126
+ });
2127
+ instance.current = created;
2128
+ return () => {
2129
+ start.current = created.value;
2130
+ created.destroy();
2131
+ instance.current = null;
2132
+ };
2133
+ }, [alpha, format, key, label, name, disabled, inline, eyedropper]);
2134
+ useIsomorphicLayoutEffect(() => {
2135
+ if (value !== void 0 && instance.current && instance.current.value !== toHex(toHsva(value))) instance.current.setColor(value, false);
2136
+ }, [value]);
2137
+ return /* @__PURE__ */ jsx47("div", { ...props, ref, className: ["mk-color-picker", className].filter(Boolean).join(" ") });
2138
+ }
2139
+
2140
+ // src/components/time-field/react.tsx
2141
+ import { useRef as useRef45 } from "react";
2142
+ import { jsx as jsx48 } from "react/jsx-runtime";
2143
+ function TimeField({ value, defaultValue, locale, hourCycle, seconds, minuteStep, min, max, label, name, disabled, readOnly, onChange, className, ...props }) {
2144
+ const ref = useRef45(null);
2145
+ const instance = useRef45(null);
2146
+ const change = useLatest(onChange);
2147
+ const start = useRef45(value !== void 0 ? value : defaultValue ?? null);
2148
+ useIsomorphicLayoutEffect(() => {
2149
+ const created = createTimeField(ref.current, {
2150
+ value: value !== void 0 ? value : start.current,
2151
+ locale,
2152
+ hourCycle,
2153
+ seconds,
2154
+ minuteStep,
2155
+ min,
2156
+ max,
2157
+ label,
2158
+ name,
2159
+ disabled,
2160
+ readOnly,
2161
+ onChange: (next) => change.current?.(next)
2162
+ });
2163
+ instance.current = created;
2164
+ return () => {
2165
+ start.current = created.value;
2166
+ created.destroy();
2167
+ instance.current = null;
2168
+ };
2169
+ }, [locale, hourCycle, seconds, minuteStep, min, max, label, name, disabled, readOnly]);
2170
+ useIsomorphicLayoutEffect(() => {
2171
+ if (value !== void 0 && instance.current && instance.current.value !== value) instance.current.setValue(value);
2172
+ }, [value]);
2173
+ return /* @__PURE__ */ jsx48("div", { ...props, ref, className: ["mk-time-field", className].filter(Boolean).join(" ") });
2174
+ }
2175
+
2176
+ // src/components/range-calendar/react.tsx
2177
+ import { useRef as useRef46 } from "react";
2178
+ import { jsx as jsx49 } from "react/jsx-runtime";
2179
+ var keyOf = (value) => {
2180
+ const range = toRange(value);
2181
+ return range ? JSON.stringify(rangeKeys(range)) : "null";
2182
+ };
2183
+ function RangeCalendar({ value, defaultValue, month, visibleMonths, firstDay, min, max, unavailable, locale, today, labels, onChange, className, ...props }) {
2184
+ const ref = useRef46(null);
2185
+ const instance = useRef46(null);
2186
+ const change = useLatest(onChange);
2187
+ const test = useLatest(unavailable);
2188
+ const start = useRef46(value !== void 0 ? value : defaultValue ?? null);
2189
+ const rules = typeof unavailable === "function" ? "function" : JSON.stringify(unavailable ?? null);
2190
+ useIsomorphicLayoutEffect(() => {
2191
+ const created = createRangeCalendar(ref.current, {
2192
+ value: value !== void 0 ? value : start.current,
2193
+ month,
2194
+ visibleMonths,
2195
+ firstDay,
2196
+ min,
2197
+ max,
2198
+ // A function is read through a ref so a new closure each render does not rebuild the calendar.
2199
+ unavailable: typeof unavailable === "function" ? (day) => typeof test.current === "function" ? test.current(day) : false : unavailable,
2200
+ locale,
2201
+ today,
2202
+ labels,
2203
+ onChange: (range) => change.current?.(range)
2204
+ });
2205
+ instance.current = created;
2206
+ return () => {
2207
+ start.current = created.value;
2208
+ created.destroy();
2209
+ instance.current = null;
2210
+ };
2211
+ }, [String(month ?? ""), visibleMonths, firstDay, String(min ?? ""), String(max ?? ""), rules, locale, String(today ?? "")]);
2212
+ useIsomorphicLayoutEffect(() => {
2213
+ if (value !== void 0 && instance.current && keyOf(value) !== keyOf(instance.current.value)) instance.current.setValue(value);
2214
+ }, [keyOf(value)]);
2215
+ return /* @__PURE__ */ jsx49("div", { ...props, ref, className: ["mk-range-calendar", className].filter(Boolean).join(" ") });
2216
+ }
2217
+
2218
+ // src/components/date-range-picker/react.tsx
2219
+ import { useRef as useRef47 } from "react";
2220
+ import { jsx as jsx50 } from "react/jsx-runtime";
2221
+ var keyOf2 = (value) => {
2222
+ const range = toRange(value);
2223
+ return range ? JSON.stringify(rangeKeys(range)) : "null";
2224
+ };
2225
+ function DateRangePicker({ value, defaultValue, min, max, unavailable, firstDay, locale, today, label, name, presets, disabled, onChange, className, ...props }) {
2226
+ const ref = useRef47(null);
2227
+ const instance = useRef47(null);
2228
+ const change = useLatest(onChange);
2229
+ const test = useLatest(unavailable);
2230
+ const start = useRef47(value !== void 0 ? value : defaultValue ?? null);
2231
+ const rules = typeof unavailable === "function" ? "function" : JSON.stringify(unavailable ?? null);
2232
+ const presetKey = JSON.stringify(presets ?? null);
2233
+ useIsomorphicLayoutEffect(() => {
2234
+ const created = createDateRangePicker(ref.current, {
2235
+ value: value !== void 0 ? value : start.current,
2236
+ min,
2237
+ max,
2238
+ unavailable: typeof unavailable === "function" ? (day) => typeof test.current === "function" ? test.current(day) : false : unavailable,
2239
+ firstDay,
2240
+ locale,
2241
+ today,
2242
+ label,
2243
+ name,
2244
+ presets,
2245
+ disabled,
2246
+ onChange: (range) => change.current?.(range)
2247
+ });
2248
+ instance.current = created;
2249
+ return () => {
2250
+ start.current = created.value;
2251
+ created.destroy();
2252
+ instance.current = null;
2253
+ };
2254
+ }, [String(min ?? ""), String(max ?? ""), rules, firstDay, locale, String(today ?? ""), label, name, presetKey, disabled]);
2255
+ useIsomorphicLayoutEffect(() => {
2256
+ if (value !== void 0 && instance.current && keyOf2(value) !== keyOf2(instance.current.value)) instance.current.setValue(value);
2257
+ }, [keyOf2(value)]);
2258
+ return /* @__PURE__ */ jsx50("div", { ...props, ref, className: ["mk-date-range-picker", className].filter(Boolean).join(" ") });
2259
+ }
2260
+
2261
+ // src/components/tooltip/react.tsx
2262
+ import { useRef as useRef48 } from "react";
2263
+ import { jsx as jsx51 } from "react/jsx-runtime";
2264
+ function Tooltip({ content, placement, openDelay, closeDelay, interactive, arrow, onOpenChange, className, children, ...props }) {
2265
+ const ref = useRef48(null);
2266
+ const instance = useRef48(null);
2267
+ const change = useLatest(onOpenChange);
2268
+ useIsomorphicLayoutEffect(() => {
2269
+ const created = createTooltip(ref.current, { content, placement, openDelay, closeDelay, interactive, arrow, onOpenChange: (open) => change.current?.(open) });
2270
+ instance.current = created;
2271
+ return () => {
2272
+ created.destroy();
2273
+ instance.current = null;
2274
+ };
2275
+ }, [placement, openDelay, closeDelay, interactive, arrow]);
2276
+ useIsomorphicLayoutEffect(() => {
2277
+ instance.current?.setContent(content ?? "");
2278
+ }, [content]);
2279
+ return /* @__PURE__ */ jsx51("span", { ...props, ref, className: ["mk-tooltip", className].filter(Boolean).join(" "), children });
2280
+ }
2281
+
2282
+ // src/components/popover/react.tsx
2283
+ import { forwardRef, useImperativeHandle, useRef as useRef49 } from "react";
2284
+ import { jsx as jsx52, jsxs as jsxs20 } from "react/jsx-runtime";
2285
+ var Popover = forwardRef(function Popover2({ trigger, open, label, onOpenChange, panelClassName, className, children, ...props }, handle) {
2286
+ const ref = useRef49(null);
2287
+ const instance = useRef49(null);
2288
+ const change = useLatest(onOpenChange);
2289
+ useImperativeHandle(handle, () => ({ open: () => instance.current?.open(), close: () => instance.current?.close() }), []);
2290
+ useIsomorphicLayoutEffect(() => {
2291
+ const created = createPopover(ref.current, { label, onOpenChange: (value) => change.current?.(value) });
2292
+ instance.current = created;
2293
+ return () => {
2294
+ created.destroy();
2295
+ instance.current = null;
2296
+ };
2297
+ }, [label]);
2298
+ useIsomorphicLayoutEffect(() => {
2299
+ if (open === void 0 || !instance.current || instance.current.isOpen === open) return;
2300
+ if (open) instance.current.open();
2301
+ else instance.current.close();
2302
+ }, [open]);
2303
+ return /* @__PURE__ */ jsxs20("div", { ...props, ref, className: ["mk-popover", className].filter(Boolean).join(" "), children: [
2304
+ /* @__PURE__ */ jsx52("span", { "data-mk-popover-trigger-slot": "", style: { display: "contents" }, children: trigger }),
2305
+ /* @__PURE__ */ jsx52("dialog", { "data-mk-popover-panel": "", className: panelClassName, children })
2306
+ ] });
2307
+ });
2308
+
2309
+ // src/components/loading-button/react.tsx
2310
+ import { useRef as useRef50 } from "react";
2311
+ import { jsx as jsx53 } from "react/jsx-runtime";
2312
+ function LoadingButton({ action, state, labels, compact, resetAfter, onStateChange, className, children, type = "button", ...props }) {
2313
+ const ref = useRef50(null);
2314
+ const instance = useRef50(null);
2315
+ const run = useLatest(action);
2316
+ const change = useLatest(onStateChange);
2317
+ const key = JSON.stringify(labels ?? null);
2318
+ useIsomorphicLayoutEffect(() => {
2319
+ const created = createLoadingButton(ref.current, {
2320
+ labels,
2321
+ compact,
2322
+ resetAfter,
2323
+ action: action ? () => run.current?.() : void 0,
2324
+ onStateChange: (next) => change.current?.(next)
2325
+ });
2326
+ instance.current = created;
2327
+ return () => {
2328
+ created.destroy();
2329
+ instance.current = null;
2330
+ };
2331
+ }, [key, compact, resetAfter, Boolean(action)]);
2332
+ useIsomorphicLayoutEffect(() => {
2333
+ if (state && instance.current && instance.current.state !== state) instance.current.setState(state);
2334
+ }, [state]);
2335
+ return /* @__PURE__ */ jsx53("button", { ...props, type, ref, className: ["mk-loading-button", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx53("span", { "data-mk-loading-label": "", children }) });
2336
+ }
2337
+
2338
+ // src/components/breadcrumb/react.tsx
2339
+ import { useRef as useRef51 } from "react";
2340
+ import { jsx as jsx54 } from "react/jsx-runtime";
2341
+ function Breadcrumb({ items, label, maxItems, onNavigate, className, ...props }) {
2342
+ const ref = useRef51(null);
2343
+ const instance = useRef51(null);
2344
+ const navigate = useLatest(onNavigate);
2345
+ const key = JSON.stringify(items);
2346
+ useIsomorphicLayoutEffect(() => {
2347
+ const created = createBreadcrumb(ref.current, { items, label, maxItems, onNavigate: (item, index, event) => navigate.current?.(item, index, event) });
2348
+ instance.current = created;
2349
+ return () => {
2350
+ created.destroy();
2351
+ instance.current = null;
2352
+ };
2353
+ }, [label, maxItems]);
2354
+ useIsomorphicLayoutEffect(() => {
2355
+ if (instance.current && JSON.stringify(instance.current.items) !== key) instance.current.setItems(items);
2356
+ }, [key]);
2357
+ return /* @__PURE__ */ jsx54("div", { ...props, ref, className: ["mk-breadcrumb", className].filter(Boolean).join(" ") });
2358
+ }
2359
+
2360
+ // src/components/empty-state/react.tsx
2361
+ import { useRef as useRef52 } from "react";
2362
+ import { jsx as jsx55 } from "react/jsx-runtime";
2363
+ function EmptyState({ illustration, title, description, actions, loop, onAction, className, ...props }) {
2364
+ const ref = useRef52(null);
2365
+ const instance = useRef52(null);
2366
+ const action = useLatest(onAction);
2367
+ const content = { illustration, title, description, actions };
2368
+ const key = JSON.stringify(content);
2369
+ useIsomorphicLayoutEffect(() => {
2370
+ const created = createEmptyState(ref.current, { ...content, loop, onAction: (id, event) => action.current?.(id, event) });
2371
+ instance.current = created;
2372
+ return () => {
2373
+ created.destroy();
2374
+ instance.current = null;
2375
+ };
2376
+ }, [loop]);
2377
+ const first = useRef52(true);
2378
+ useIsomorphicLayoutEffect(() => {
2379
+ if (first.current) {
2380
+ first.current = false;
2381
+ return;
2382
+ }
2383
+ instance.current?.update(content);
2384
+ }, [key]);
2385
+ return /* @__PURE__ */ jsx55("div", { ...props, ref, className: ["mk-empty-state", className].filter(Boolean).join(" ") });
2386
+ }
2387
+
2388
+ // src/components/stat-card/react.tsx
2389
+ import { useRef as useRef53 } from "react";
2390
+ import { jsx as jsx56 } from "react/jsx-runtime";
2391
+ function StatCard({ label, value, previous, format, locale, positive, comparison, series, target, countOnView, className, ...props }) {
2392
+ const ref = useRef53(null);
2393
+ const instance = useRef53(null);
2394
+ const formatter = useLatest(format);
2395
+ const custom = typeof format === "function";
2396
+ const data = { label, value, previous, positive, comparison, series, target, format: custom ? void 0 : format };
2397
+ const key = JSON.stringify(data);
2398
+ const options = () => ({ ...data, format: custom ? (n) => formatter.current(n) : data.format });
2399
+ useIsomorphicLayoutEffect(() => {
2400
+ const created = createStatCard(ref.current, { ...options(), locale, countOnView });
2401
+ instance.current = created;
2402
+ return () => {
2403
+ created.destroy();
2404
+ instance.current = null;
2405
+ };
2406
+ }, [locale, countOnView]);
2407
+ const first = useRef53(true);
2408
+ useIsomorphicLayoutEffect(() => {
2409
+ if (first.current) {
2410
+ first.current = false;
2411
+ return;
2412
+ }
2413
+ instance.current?.update(options());
2414
+ }, [key, custom]);
2415
+ return /* @__PURE__ */ jsx56("div", { ...props, ref, className: ["mk-stat-card", className].filter(Boolean).join(" ") });
2416
+ }
2417
+
2418
+ // src/components/chart-tooltip/react.tsx
2419
+ import { useRef as useRef54 } from "react";
2420
+ import { jsx as jsx57 } from "react/jsx-runtime";
2421
+ function ChartTooltip({ labels, series, align, inset, min, max, formatValue, delta, share, total, sort, pin, label, onIndexChange, className, children, ...props }) {
2422
+ const ref = useRef54(null);
2423
+ const instance = useRef54(null);
2424
+ const format = useLatest(formatValue);
2425
+ const change = useLatest(onIndexChange);
2426
+ const data = { labels, series, align, inset, min, max, delta, share, total, sort, pin, label };
2427
+ const key = JSON.stringify(data);
2428
+ const options = () => ({
2429
+ ...data,
2430
+ formatValue: formatValue ? (value) => format.current?.(value) ?? String(value) : void 0,
2431
+ onIndexChange: (index) => change.current?.(index)
2432
+ });
2433
+ useIsomorphicLayoutEffect(() => {
2434
+ const created = createChartTooltip(ref.current, options());
2435
+ instance.current = created;
2436
+ return () => {
2437
+ created.destroy();
2438
+ instance.current = null;
2439
+ };
2440
+ }, []);
2441
+ const first = useRef54(true);
2442
+ useIsomorphicLayoutEffect(() => {
2443
+ if (first.current) {
2444
+ first.current = false;
2445
+ return;
2446
+ }
2447
+ instance.current?.update(options());
2448
+ }, [key, Boolean(formatValue)]);
2449
+ return /* @__PURE__ */ jsx57("div", { ...props, ref, className: ["mk-chart-tooltip", className].filter(Boolean).join(" "), children });
2450
+ }
2451
+
2452
+ // src/components/multi-select/react.tsx
2453
+ import { useRef as useRef55 } from "react";
2454
+ import { jsx as jsx58 } from "react/jsx-runtime";
2455
+ function MultiSelect({ options, value, defaultValue, placeholder, label, name, max, closeOnSelect, disabled, onChange, className, ...props }) {
2456
+ const ref = useRef55(null);
2457
+ const instance = useRef55(null);
2458
+ const change = useLatest(onChange);
2459
+ const start = useRef55(value ?? defaultValue ?? []);
2460
+ const optionsKey = JSON.stringify(options ?? null);
2461
+ useIsomorphicLayoutEffect(() => {
2462
+ const created = createMultiSelect(ref.current, { options, value: value ?? start.current, placeholder, label, name, max, closeOnSelect, disabled, onChange: (next) => change.current?.(next) });
2463
+ instance.current = created;
2464
+ return () => {
2465
+ start.current = created.value;
2466
+ created.destroy();
2467
+ instance.current = null;
2468
+ };
2469
+ }, [placeholder, label, name, max, closeOnSelect, disabled]);
2470
+ useIsomorphicLayoutEffect(() => {
2471
+ if (options && instance.current) instance.current.setOptions(options);
2472
+ }, [optionsKey]);
2473
+ const valueKey = JSON.stringify(value ?? null);
2474
+ useIsomorphicLayoutEffect(() => {
2475
+ if (value && instance.current && JSON.stringify(instance.current.value) !== valueKey) instance.current.setValue(value);
2476
+ }, [valueKey]);
2477
+ return /* @__PURE__ */ jsx58("div", { ...props, ref, className: ["mk-multi-select", className].filter(Boolean).join(" ") });
2478
+ }
2479
+
2480
+ // src/components/tag-input/react.tsx
2481
+ import { useRef as useRef56 } from "react";
2482
+ import { jsx as jsx59 } from "react/jsx-runtime";
2483
+ function TagInput({ value, defaultValue, suggestions, placeholder, label, name, max, restrict, allowDuplicates, validate, transform, disabled, onChange, className, ...props }) {
2484
+ const ref = useRef56(null);
2485
+ const instance = useRef56(null);
2486
+ const change = useLatest(onChange);
2487
+ const check = useLatest(validate);
2488
+ const shape = useLatest(transform);
2489
+ const start = useRef56(value ?? defaultValue ?? []);
2490
+ useIsomorphicLayoutEffect(() => {
2491
+ const created = createTagInput(ref.current, {
2492
+ value: value ?? start.current,
2493
+ suggestions,
2494
+ placeholder,
2495
+ label,
2496
+ name,
2497
+ max,
2498
+ restrict,
2499
+ allowDuplicates,
2500
+ disabled,
2501
+ validate: validate ? (tag, tags) => check.current?.(tag, tags) : void 0,
2502
+ transform: transform ? (tag) => shape.current?.(tag) ?? tag : void 0,
2503
+ onChange: (next) => change.current?.(next)
2504
+ });
2505
+ instance.current = created;
2506
+ return () => {
2507
+ start.current = created.value;
2508
+ created.destroy();
2509
+ instance.current = null;
2510
+ };
2511
+ }, [placeholder, label, name, max, restrict, allowDuplicates, disabled, Boolean(validate), Boolean(transform)]);
2512
+ const suggestionsKey = JSON.stringify(suggestions ?? null);
2513
+ useIsomorphicLayoutEffect(() => {
2514
+ if (suggestions) instance.current?.setSuggestions(suggestions);
2515
+ }, [suggestionsKey]);
2516
+ const valueKey = JSON.stringify(value ?? null);
2517
+ useIsomorphicLayoutEffect(() => {
2518
+ if (value && instance.current && JSON.stringify(instance.current.value) !== valueKey) instance.current.setValue(value);
2519
+ }, [valueKey]);
2520
+ return /* @__PURE__ */ jsx59("div", { ...props, ref, className: ["mk-tag-input", className].filter(Boolean).join(" ") });
2521
+ }
2522
+
2523
+ // src/components/date-time-picker/react.tsx
2524
+ import { useRef as useRef57 } from "react";
2525
+ import { jsx as jsx60 } from "react/jsx-runtime";
2526
+ var keyOf3 = (value) => {
2527
+ const date = toDateTimeValue(value);
2528
+ return date ? dateTimeKey(date) : "null";
2529
+ };
2530
+ function DateTimePicker({ value, defaultValue, min, max, locale, hourCycle, minuteStep, firstDay, unavailable, today, label, name, disabled, onChange, className, ...props }) {
2531
+ const ref = useRef57(null);
2532
+ const instance = useRef57(null);
2533
+ const change = useLatest(onChange);
2534
+ const test = useLatest(unavailable);
2535
+ const start = useRef57(value !== void 0 ? value : defaultValue ?? null);
2536
+ const rules = typeof unavailable === "function" ? "function" : JSON.stringify(unavailable ?? null);
2537
+ useIsomorphicLayoutEffect(() => {
2538
+ const created = createDateTimePicker(ref.current, {
2539
+ value: value !== void 0 ? value : start.current,
2540
+ min,
2541
+ max,
2542
+ locale,
2543
+ hourCycle,
2544
+ minuteStep,
2545
+ firstDay,
2546
+ unavailable: typeof unavailable === "function" ? (day) => typeof test.current === "function" ? test.current(day) : false : unavailable,
2547
+ today,
2548
+ label,
2549
+ name,
2550
+ disabled,
2551
+ onChange: (next) => change.current?.(next)
2552
+ });
2553
+ instance.current = created;
2554
+ return () => {
2555
+ start.current = created.value;
2556
+ created.destroy();
2557
+ instance.current = null;
2558
+ };
2559
+ }, [String(min ?? ""), String(max ?? ""), locale, hourCycle, minuteStep, firstDay, rules, String(today ?? ""), label, name, disabled]);
2560
+ useIsomorphicLayoutEffect(() => {
2561
+ if (value !== void 0 && instance.current && keyOf3(value) !== keyOf3(instance.current.value)) instance.current.setValue(value);
2562
+ }, [keyOf3(value)]);
2563
+ return /* @__PURE__ */ jsx60("div", { ...props, ref, className: ["mk-date-time-picker", className].filter(Boolean).join(" ") });
2564
+ }
2565
+
2566
+ // src/components/filter-builder/react.tsx
2567
+ import { useRef as useRef58 } from "react";
2568
+ import { jsx as jsx61 } from "react/jsx-runtime";
2569
+ function FilterBuilder({ fields, value, defaultValue, maxDepth, label, summary, onChange, className, ...props }) {
2570
+ const ref = useRef58(null);
2571
+ const instance = useRef58(null);
2572
+ const change = useLatest(onChange);
2573
+ const start = useRef58(value ?? defaultValue);
2574
+ const fieldsKey = JSON.stringify(fields);
2575
+ useIsomorphicLayoutEffect(() => {
2576
+ const created = createFilterBuilder(ref.current, { fields, value: value ?? start.current, maxDepth, label, summary, onChange: (next) => change.current?.(next) });
2577
+ instance.current = created;
2578
+ return () => {
2579
+ start.current = created.value;
2580
+ created.destroy();
2581
+ instance.current = null;
2582
+ };
2583
+ }, [fieldsKey, maxDepth, label, summary]);
2584
+ const valueKey = JSON.stringify(value ?? null);
2585
+ useIsomorphicLayoutEffect(() => {
2586
+ if (value && instance.current && JSON.stringify(instance.current.value) !== valueKey) instance.current.setValue(value);
2587
+ }, [valueKey]);
2588
+ return /* @__PURE__ */ jsx61("div", { ...props, ref, className: ["mk-filter-builder", className].filter(Boolean).join(" ") });
2589
+ }
2590
+
2591
+ // src/components/timeline/react.tsx
2592
+ import { useRef as useRef59 } from "react";
2593
+ import { jsx as jsx62 } from "react/jsx-runtime";
2594
+ function Timeline({ events, layout, group, relative, locale, label, className, ...props }) {
2595
+ const ref = useRef59(null);
2596
+ const instance = useRef59(null);
2597
+ const shown = useRef59(events);
2598
+ useIsomorphicLayoutEffect(() => {
2599
+ const created = createTimeline(ref.current, { events: shown.current, layout, group, relative, locale, label });
2600
+ instance.current = created;
2601
+ return () => {
2602
+ created.destroy();
2603
+ instance.current = null;
2604
+ };
2605
+ }, [layout, group, relative, locale, label]);
2606
+ const key = JSON.stringify(events);
2607
+ useIsomorphicLayoutEffect(() => {
2608
+ const timeline = instance.current;
2609
+ const before = shown.current;
2610
+ shown.current = events;
2611
+ if (!timeline || JSON.stringify(timeline.events) === key) return;
2612
+ const ids = new Set(before.map((event) => event.id));
2613
+ const fresh = events.filter((event) => !ids.has(event.id));
2614
+ const kept = events.filter((event) => ids.has(event.id));
2615
+ const gone = before.filter((old) => !events.some((event) => event.id === old.id));
2616
+ const stayed = before.filter((old) => !gone.includes(old));
2617
+ const sameOrder = kept.every((event, i) => stayed[i]?.id === event.id);
2618
+ const patch = () => {
2619
+ for (const event of kept) {
2620
+ const old = before.find((entry) => entry.id === event.id);
2621
+ if (old && JSON.stringify(old) !== JSON.stringify(event)) timeline.update(event.id, { ...Object.fromEntries(Object.keys(old).map((name) => [name, void 0])), ...event });
2622
+ }
2623
+ };
2624
+ const first = events[0]?.id;
2625
+ const last = events[events.length - 1]?.id;
2626
+ if (sameOrder && !gone.length && fresh.length === 1 && (fresh[0].id === first || fresh[0].id === last)) {
2627
+ patch();
2628
+ timeline.add(fresh[0], fresh[0].id === first ? "start" : "end");
2629
+ } else if (sameOrder && !fresh.length && gone.length <= 1) {
2630
+ patch();
2631
+ if (gone[0]) timeline.remove(gone[0].id);
2632
+ } else timeline.setEvents(events);
2633
+ }, [key]);
2634
+ return /* @__PURE__ */ jsx62("div", { ...props, ref, className: ["mk-timeline", className].filter(Boolean).join(" ") });
2635
+ }
2636
+
2637
+ // src/components/activity-feed/react.tsx
2638
+ import { forwardRef as forwardRef2, useImperativeHandle as useImperativeHandle2, useRef as useRef60 } from "react";
2639
+ import { jsx as jsx63 } from "react/jsx-runtime";
2640
+ var ActivityFeed = forwardRef2(function ActivityFeed2({ items, locale, label, emptyLabel, onLoadMore, className, ...props }, handle) {
2641
+ const ref = useRef60(null);
2642
+ const instance = useRef60(null);
2643
+ const load = useLatest(onLoadMore);
2644
+ useImperativeHandle2(handle, () => ({ prepend: (next) => instance.current?.prepend(next), append: (next) => instance.current?.append(next) }), []);
2645
+ useIsomorphicLayoutEffect(() => {
2646
+ const created = createActivityFeed(ref.current, { items, locale, label, emptyLabel, onLoadMore: onLoadMore ? () => load.current?.() ?? [] : void 0 });
2647
+ instance.current = created;
2648
+ return () => {
2649
+ created.destroy();
2650
+ instance.current = null;
2651
+ };
2652
+ }, [locale, label, emptyLabel, Boolean(onLoadMore)]);
2653
+ return /* @__PURE__ */ jsx63("div", { ...props, ref, className: ["mk-activity-feed", className].filter(Boolean).join(" ") });
2654
+ });
2655
+
2656
+ // src/components/tree-view/react.tsx
2657
+ import { forwardRef as forwardRef3, useImperativeHandle as useImperativeHandle3, useRef as useRef61 } from "react";
2658
+ import { jsx as jsx64 } from "react/jsx-runtime";
2659
+ var TreeView = forwardRef3(function TreeView2({ nodes, checkable, checked, expanded, selected, search, label, loadChildren, renderLabel, searchText, onSelect, onCheck, onExpand, className, ...props }, handle) {
2660
+ const ref = useRef61(null);
2661
+ const instance = useRef61(null);
2662
+ const select = useLatest(onSelect);
2663
+ const check = useLatest(onCheck);
2664
+ const expand = useLatest(onExpand);
2665
+ const load = useLatest(loadChildren);
2666
+ const draw = useLatest(renderLabel);
2667
+ const text = useLatest(searchText);
2668
+ useImperativeHandle3(
2669
+ handle,
2670
+ () => ({
2671
+ expand: (id, animate2) => instance.current?.expand(id, animate2),
2672
+ collapse: (id, animate2) => instance.current?.collapse(id, animate2),
2673
+ expandAll: () => instance.current?.expandAll(),
2674
+ collapseAll: () => instance.current?.collapseAll(),
2675
+ reveal: (id) => instance.current?.reveal(id),
2676
+ filter: (query) => instance.current?.filter(query)
2677
+ }),
2678
+ []
2679
+ );
2680
+ const nodesKey = JSON.stringify(nodes);
2681
+ useIsomorphicLayoutEffect(() => {
2682
+ const created = createTreeView(ref.current, {
2683
+ nodes: JSON.parse(nodesKey),
2684
+ checkable,
2685
+ checked,
2686
+ expanded,
2687
+ selected,
2688
+ search,
2689
+ label,
2690
+ loadChildren: loadChildren ? (node) => load.current?.(node) ?? [] : void 0,
2691
+ renderLabel: renderLabel ? (node, element, query) => draw.current?.(node, element, query) : void 0,
2692
+ searchText: searchText ? (node) => text.current?.(node) ?? node.label : void 0,
2693
+ onSelect: (node) => select.current?.(node),
2694
+ onCheck: (ids) => check.current?.(ids),
2695
+ onExpand: (node, open) => expand.current?.(node, open)
2696
+ });
2697
+ instance.current = created;
2698
+ return () => {
2699
+ created.destroy();
2700
+ instance.current = null;
2701
+ };
2702
+ }, [checkable, String(search), label, Boolean(loadChildren), Boolean(renderLabel), Boolean(searchText)]);
2703
+ const first = useRef61(true);
2704
+ useIsomorphicLayoutEffect(() => {
2705
+ if (first.current) {
2706
+ first.current = false;
2707
+ return;
2708
+ }
2709
+ instance.current?.setNodes(JSON.parse(nodesKey));
2710
+ }, [nodesKey]);
2711
+ const checkedKey = JSON.stringify(checked ?? null);
2712
+ useIsomorphicLayoutEffect(() => {
2713
+ if (checked && instance.current && JSON.stringify([...instance.current.checked].sort()) !== JSON.stringify([...checked].sort())) instance.current.setChecked(checked);
2714
+ }, [checkedKey]);
2715
+ useIsomorphicLayoutEffect(() => {
2716
+ if (selected !== void 0 && instance.current && instance.current.selected !== selected) instance.current.select(selected);
2717
+ }, [selected]);
2718
+ return /* @__PURE__ */ jsx64("div", { ...props, ref, className: ["mk-tree-view", className].filter(Boolean).join(" ") });
2719
+ });
2720
+
2721
+ // src/components/file-explorer/react.tsx
2722
+ import { forwardRef as forwardRef4, useImperativeHandle as useImperativeHandle4, useRef as useRef62 } from "react";
2723
+ import { jsx as jsx65 } from "react/jsx-runtime";
2724
+ var FileExplorer = forwardRef4(function FileExplorer2({ files, rootLabel, folder, view, tree, readOnly, locale, label, onOpen, onNavigate, onSelectionChange, onViewChange, onChange, className, ...props }, handle) {
2725
+ const ref = useRef62(null);
2726
+ const instance = useRef62(null);
2727
+ const open = useLatest(onOpen);
2728
+ const navigate = useLatest(onNavigate);
2729
+ const select = useLatest(onSelectionChange);
2730
+ const switchView = useLatest(onViewChange);
2731
+ const change = useLatest(onChange);
2732
+ useImperativeHandle4(
2733
+ handle,
2734
+ () => ({
2735
+ open: (id) => instance.current?.open(id),
2736
+ up: () => instance.current?.up(),
2737
+ setView: (next) => instance.current?.setView(next),
2738
+ select: (ids) => instance.current?.select(ids),
2739
+ createFolder: (name) => instance.current?.createFolder(name) ?? null,
2740
+ rename: (id, name) => instance.current?.rename(id, name),
2741
+ remove: (ids) => instance.current?.remove(ids),
2742
+ move: (ids, to) => instance.current?.move(ids, to)
2743
+ }),
2744
+ []
2745
+ );
2746
+ const filesKey = JSON.stringify(files);
2747
+ useIsomorphicLayoutEffect(() => {
2748
+ const created = createFileExplorer(ref.current, {
2749
+ files: JSON.parse(filesKey),
2750
+ rootLabel,
2751
+ folder,
2752
+ view,
2753
+ tree,
2754
+ readOnly,
2755
+ locale,
2756
+ label,
2757
+ onOpen: (entry) => open.current?.(entry),
2758
+ onNavigate: (entry) => navigate.current?.(entry),
2759
+ onSelectionChange: (ids) => select.current?.(ids),
2760
+ onViewChange: (next) => switchView.current?.(next),
2761
+ onChange: (next, detail) => change.current?.(next, detail)
2762
+ });
2763
+ instance.current = created;
2764
+ return () => {
2765
+ created.destroy();
2766
+ instance.current = null;
2767
+ };
2768
+ }, [rootLabel, tree, readOnly, locale, label]);
2769
+ useIsomorphicLayoutEffect(() => {
2770
+ const explorer = instance.current;
2771
+ if (explorer && JSON.stringify(explorer.files) !== filesKey) explorer.setFiles(JSON.parse(filesKey));
2772
+ }, [filesKey]);
2773
+ useIsomorphicLayoutEffect(() => {
2774
+ if (view && instance.current && instance.current.view !== view) instance.current.setView(view);
2775
+ }, [view]);
2776
+ useIsomorphicLayoutEffect(() => {
2777
+ if (folder && instance.current && instance.current.folder !== folder) instance.current.open(folder);
2778
+ }, [folder]);
2779
+ return /* @__PURE__ */ jsx65("div", { ...props, ref, className: ["mk-file-explorer", className].filter(Boolean).join(" ") });
2780
+ });
2781
+
2782
+ // src/components/json-viewer/react.tsx
2783
+ import { forwardRef as forwardRef5, useImperativeHandle as useImperativeHandle5, useRef as useRef63 } from "react";
2784
+ import { jsx as jsx66 } from "react/jsx-runtime";
2785
+ var JsonViewer = forwardRef5(function JsonViewer2({ data, expandDepth, rootName, search, toolbar, sortKeys, label, onSelect, onCopy, className, ...props }, handle) {
2786
+ const ref = useRef63(null);
2787
+ const instance = useRef63(null);
2788
+ const select = useLatest(onSelect);
2789
+ const copied = useLatest(onCopy);
2790
+ const shown = useRef63(data);
2791
+ useImperativeHandle5(
2792
+ handle,
2793
+ () => ({
2794
+ expandAll: () => instance.current?.expandAll(),
2795
+ collapseAll: () => instance.current?.collapseAll(),
2796
+ reveal: (path) => instance.current?.reveal(path),
2797
+ filter: (query) => instance.current?.filter(query),
2798
+ copy: (path) => instance.current?.copy(path) ?? Promise.resolve(false)
2799
+ }),
2800
+ []
2801
+ );
2802
+ useIsomorphicLayoutEffect(() => {
2803
+ const created = createJsonViewer(ref.current, {
2804
+ data: shown.current,
2805
+ expandDepth,
2806
+ rootName,
2807
+ search,
2808
+ toolbar,
2809
+ sortKeys,
2810
+ label,
2811
+ onSelect: (path, value) => select.current?.(path, value),
2812
+ onCopy: (text, path) => copied.current?.(text, path)
2813
+ });
2814
+ instance.current = created;
2815
+ return () => {
2816
+ created.destroy();
2817
+ instance.current = null;
2818
+ };
2819
+ }, [expandDepth, rootName, String(search), toolbar, sortKeys, label]);
2820
+ useIsomorphicLayoutEffect(() => {
2821
+ if (shown.current === data) return;
2822
+ shown.current = data;
2823
+ instance.current?.setData(data);
2824
+ }, [data]);
2825
+ return /* @__PURE__ */ jsx66("div", { ...props, ref, className: ["mk-json-viewer", className].filter(Boolean).join(" ") });
2826
+ });
2827
+
2828
+ // src/components/virtual-list/react.tsx
2829
+ import { forwardRef as forwardRef6, useImperativeHandle as useImperativeHandle6, useRef as useRef64, useState as useState7 } from "react";
2830
+ import { jsx as jsx67 } from "react/jsx-runtime";
2831
+ var keyFor = (getKey, item, index) => {
2832
+ if (getKey) return getKey(item, index);
2833
+ const id = item && typeof item === "object" ? item.id : void 0;
2834
+ return typeof id === "string" || typeof id === "number" ? id : index;
2835
+ };
2836
+ function VirtualListInner({ items, renderItem, itemHeight, estimatedHeight, overscan, itemText, getKey, selectable, selected, label, emptyLabel, locale, onSelect, onActivate, onEndReached, className, ...props }, handle) {
2837
+ const ref = useRef64(null);
2838
+ const instance = useRef64(null);
2839
+ const [range, setRange] = useState7({ start: 0, end: 0 });
2840
+ const shown = useRef64(items);
2841
+ const select = useLatest(onSelect);
2842
+ const activate = useLatest(onActivate);
2843
+ const more = useLatest(onEndReached);
2844
+ const text = useLatest(itemText);
2845
+ const key = useLatest(getKey);
2846
+ useImperativeHandle6(handle, () => ({ scrollToIndex: (index, options) => instance.current?.scrollToIndex(index, options) }), []);
2847
+ const custom = Boolean(renderItem);
2848
+ useIsomorphicLayoutEffect(() => {
2849
+ const created = createVirtualList(ref.current, {
2850
+ items: shown.current,
2851
+ itemHeight,
2852
+ estimatedHeight,
2853
+ overscan,
2854
+ selectable,
2855
+ selected,
2856
+ label,
2857
+ emptyLabel,
2858
+ locale,
2859
+ itemText: itemText ? (item) => text.current?.(item) ?? "" : void 0,
2860
+ getKey: (item, index) => keyFor(key.current, item, index),
2861
+ onSelect: (keys, chosen) => select.current?.(keys, chosen),
2862
+ onActivate: (item, index) => activate.current?.(item, index),
2863
+ onEndReached: onEndReached ? () => more.current?.() : void 0,
2864
+ onRange: custom ? setRange : void 0
2865
+ });
2866
+ instance.current = created;
2867
+ return () => {
2868
+ created.destroy();
2869
+ instance.current = null;
2870
+ };
2871
+ }, [itemHeight, estimatedHeight, overscan, String(selectable), label, emptyLabel, locale, custom, Boolean(onEndReached), Boolean(itemText)]);
2872
+ useIsomorphicLayoutEffect(() => {
2873
+ if (shown.current === items) return;
2874
+ shown.current = items;
2875
+ instance.current?.setItems(items);
2876
+ }, [items]);
2877
+ const selectedKey = JSON.stringify(selected ?? null);
2878
+ useIsomorphicLayoutEffect(() => {
2879
+ if (selected && instance.current && JSON.stringify(instance.current.selected) !== JSON.stringify(selected)) instance.current.select(selected);
2880
+ }, [selectedKey]);
2881
+ useIsomorphicLayoutEffect(() => {
2882
+ if (custom) instance.current?.refresh();
2883
+ });
2884
+ return /* @__PURE__ */ jsx67("div", { ...props, ref, className: ["mk-virtual-list", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx67("div", { "data-mk-vl-viewport": "", children: /* @__PURE__ */ jsx67("div", { "data-mk-vl-spacer": "", children: renderItem ? items.slice(range.start, Math.min(range.end, items.length)).map((item, i) => {
2885
+ const index = range.start + i;
2886
+ return /* @__PURE__ */ jsx67("div", { "data-mk-vl-item": "", "data-index": index, children: renderItem(item, index) }, keyFor(getKey, item, index));
2887
+ }) : null }) }) });
2888
+ }
2889
+ var VirtualList = forwardRef6(VirtualListInner);
2890
+
2891
+ // src/components/resizable-panel/react.tsx
2892
+ import { Children as Children2, forwardRef as forwardRef7, useImperativeHandle as useImperativeHandle7, useRef as useRef65 } from "react";
2893
+ import { jsx as jsx68 } from "react/jsx-runtime";
2894
+ var ResizablePanel = forwardRef7(function ResizablePanel2({ orientation, sizes, min, max, collapsible, collapsed, step, storageKey, handleButtons, labels, onResize, onResizeEnd, onCollapse, className, children, ...props }, handle) {
2895
+ const ref = useRef65(null);
2896
+ const instance = useRef65(null);
2897
+ const resize = useLatest(onResize);
2898
+ const resizeEnd = useLatest(onResizeEnd);
2899
+ const collapse = useLatest(onCollapse);
2900
+ const shown = useRef65(sizes);
2901
+ useImperativeHandle7(
2902
+ handle,
2903
+ () => ({
2904
+ setSizes: (next, animate2) => instance.current?.setSizes(next, animate2),
2905
+ collapse: (index) => instance.current?.collapse(index),
2906
+ expand: (index) => instance.current?.expand(index),
2907
+ toggle: (index) => instance.current?.toggle(index),
2908
+ reset: () => instance.current?.reset()
2909
+ }),
2910
+ []
2911
+ );
2912
+ const count = Children2.count(children);
2913
+ useIsomorphicLayoutEffect(() => {
2914
+ const created = createResizablePanel(ref.current, {
2915
+ orientation,
2916
+ sizes: shown.current,
2917
+ min,
2918
+ max,
2919
+ collapsible,
2920
+ collapsed,
2921
+ step,
2922
+ storageKey,
2923
+ handleButtons,
2924
+ labels,
2925
+ onResize: (next) => resize.current?.(next),
2926
+ onResizeEnd: (next) => resizeEnd.current?.(next),
2927
+ onCollapse: (index, shut) => collapse.current?.(index, shut)
2928
+ });
2929
+ instance.current = created;
2930
+ return () => {
2931
+ created.destroy();
2932
+ instance.current = null;
2933
+ };
2934
+ }, [count, min, max, String(collapsible), step, storageKey, handleButtons, String(labels)]);
2935
+ useIsomorphicLayoutEffect(() => {
2936
+ if (orientation) instance.current?.setOrientation(orientation);
2937
+ }, [orientation]);
2938
+ const sizesKey = JSON.stringify(sizes ?? null);
2939
+ useIsomorphicLayoutEffect(() => {
2940
+ if (!sizes || JSON.stringify(shown.current ?? null) === sizesKey) return;
2941
+ shown.current = sizes;
2942
+ instance.current?.setSizes(sizes);
2943
+ }, [sizesKey]);
2944
+ return /* @__PURE__ */ jsx68("div", { ...props, ref, className: ["mk-resizable-panel", className].filter(Boolean).join(" "), children });
2945
+ });
2946
+
2947
+ // src/components/split-view/react.tsx
2948
+ import { forwardRef as forwardRef8, useImperativeHandle as useImperativeHandle8, useRef as useRef66 } from "react";
2949
+ import { jsxs as jsxs21 } from "react/jsx-runtime";
2950
+ var SplitView = forwardRef8(function SplitView2({ orientation, ratio, min, collapsible, stackBelow, storageKey, labels, onChange, onCollapse, className, children, ...props }, handle) {
2951
+ const ref = useRef66(null);
2952
+ const instance = useRef66(null);
2953
+ const change = useLatest(onChange);
2954
+ const collapse = useLatest(onCollapse);
2955
+ const shown = useRef66(ratio);
2956
+ useImperativeHandle8(
2957
+ handle,
2958
+ () => ({
2959
+ setRatio: (next, animate2) => instance.current?.setRatio(next, animate2),
2960
+ collapse: (side) => instance.current?.collapse(side),
2961
+ expand: () => instance.current?.expand(),
2962
+ toggle: (side) => instance.current?.toggle(side)
2963
+ }),
2964
+ []
2965
+ );
2966
+ useIsomorphicLayoutEffect(() => {
2967
+ const created = createSplitView(ref.current, {
2968
+ orientation,
2969
+ ratio: shown.current,
2970
+ min,
2971
+ collapsible,
2972
+ stackBelow,
2973
+ storageKey,
2974
+ labels,
2975
+ onChange: (next) => change.current?.(next),
2976
+ onCollapse: (side) => collapse.current?.(side)
2977
+ });
2978
+ instance.current = created;
2979
+ return () => {
2980
+ created.destroy();
2981
+ instance.current = null;
2982
+ };
2983
+ }, [orientation, min, String(collapsible), stackBelow, storageKey, String(labels)]);
2984
+ useIsomorphicLayoutEffect(() => {
2985
+ if (ratio === void 0 || ratio === shown.current) return;
2986
+ shown.current = ratio;
2987
+ instance.current?.setRatio(ratio);
2988
+ }, [ratio]);
2989
+ return /* @__PURE__ */ jsxs21("div", { ...props, ref, className: ["mk-split-view", className].filter(Boolean).join(" "), children: [
2990
+ children[0],
2991
+ children[1]
2992
+ ] });
2993
+ });
2994
+
2995
+ // src/components/data-table/react.tsx
2996
+ import { forwardRef as forwardRef9, useImperativeHandle as useImperativeHandle9, useRef as useRef67 } from "react";
2997
+ import { jsx as jsx69 } from "react/jsx-runtime";
2998
+ function DataTableInner({
2999
+ columns,
3000
+ rows,
3001
+ rowKey,
3002
+ caption,
3003
+ pageSize,
3004
+ pageSizes,
3005
+ selectable,
3006
+ search,
3007
+ filters,
3008
+ filter,
3009
+ columnsMenu,
3010
+ actions,
3011
+ bulkActions,
3012
+ sort,
3013
+ loading,
3014
+ emptyTitle,
3015
+ emptyDescription,
3016
+ locale,
3017
+ onSortChange,
3018
+ onSelectionChange,
3019
+ onAction,
3020
+ onBulkAction,
3021
+ onPageChange,
3022
+ onFilterChange,
3023
+ onRender,
3024
+ className,
3025
+ ...props
3026
+ }, handle) {
3027
+ const ref = useRef67(null);
3028
+ const instance = useRef67(null);
3029
+ const shown = useRef67(rows);
3030
+ const callbacks = useLatest({ onSortChange, onSelectionChange, onAction, onBulkAction, onPageChange, onFilterChange, onRender });
3031
+ useImperativeHandle9(
3032
+ handle,
3033
+ () => ({
3034
+ sortBy: (key, direction) => instance.current?.sortBy(key, direction),
3035
+ setPage: (page) => instance.current?.setPage(page),
3036
+ setPageSize: (size) => instance.current?.setPageSize(size),
3037
+ setQuery: (query) => instance.current?.setQuery(query),
3038
+ setFilter: (next) => instance.current?.setFilter(next),
3039
+ setColumnVisible: (key, visible) => instance.current?.setColumnVisible(key, visible),
3040
+ select: (ids) => instance.current?.select(ids),
3041
+ removeRows: (ids) => instance.current?.removeRows(ids),
3042
+ updateRow: (id, patch) => instance.current?.updateRow(id, patch)
3043
+ }),
3044
+ []
3045
+ );
3046
+ const columnsKey = JSON.stringify((columns ?? []).map(({ key, label, type, hidden, sortable, filterable, align, width, options: choices }) => [key, label, type, hidden, sortable, filterable, align, width, choices]));
3047
+ const setupKey = JSON.stringify([columnsKey, rowKey, caption, pageSize, pageSizes, selectable, search, filters, columnsMenu, actions, bulkActions, emptyTitle, emptyDescription, locale]);
3048
+ useIsomorphicLayoutEffect(() => {
3049
+ const created = createDataTable(ref.current, {
3050
+ columns,
3051
+ rows: shown.current,
3052
+ rowKey,
3053
+ caption,
3054
+ pageSize,
3055
+ pageSizes,
3056
+ selectable,
3057
+ search,
3058
+ filters,
3059
+ filter,
3060
+ columnsMenu,
3061
+ actions,
3062
+ bulkActions,
3063
+ sort,
3064
+ loading,
3065
+ emptyTitle,
3066
+ emptyDescription,
3067
+ locale,
3068
+ onSortChange: (next) => callbacks.current.onSortChange?.(next),
3069
+ onSelectionChange: (ids, chosen) => callbacks.current.onSelectionChange?.(ids, chosen),
3070
+ onAction: (action, row) => callbacks.current.onAction?.(action, row),
3071
+ onBulkAction: (action, chosen) => callbacks.current.onBulkAction?.(action, chosen),
3072
+ onPageChange: (page) => callbacks.current.onPageChange?.(page),
3073
+ onFilterChange: (next, query) => callbacks.current.onFilterChange?.(next, query),
3074
+ onRender: (body) => callbacks.current.onRender?.(body)
3075
+ });
3076
+ instance.current = created;
3077
+ return () => {
3078
+ created.destroy();
3079
+ instance.current = null;
3080
+ };
3081
+ }, [setupKey]);
3082
+ useIsomorphicLayoutEffect(() => {
3083
+ if (shown.current === rows) return;
3084
+ shown.current = rows;
3085
+ instance.current?.setRows(rows);
3086
+ }, [rows]);
3087
+ useIsomorphicLayoutEffect(() => {
3088
+ instance.current?.setLoading(Boolean(loading));
3089
+ }, [loading]);
3090
+ return /* @__PURE__ */ jsx69("div", { ...props, ref, className: ["mk-data-table", className].filter(Boolean).join(" ") });
3091
+ }
3092
+ var DataTable = forwardRef9(DataTableInner);
3093
+
3094
+ // src/components/editable-table/react.tsx
3095
+ import { forwardRef as forwardRef10, useImperativeHandle as useImperativeHandle10, useRef as useRef68 } from "react";
3096
+ import { jsx as jsx70 } from "react/jsx-runtime";
3097
+ function EditableTableInner({ columns, rows, rowKey, caption, pageSize, pageSizes, selectable, search, filters, columnsMenu, actions, bulkActions, sort, emptyTitle, emptyDescription, locale, onSave, onChange, newRow, onAction, onBulkAction, onSelectionChange, className, ...props }, handle) {
3098
+ const ref = useRef68(null);
3099
+ const instance = useRef68(null);
3100
+ const shown = useRef68(rows);
3101
+ const callbacks = useLatest({ onSave, onChange, newRow, onAction, onBulkAction, onSelectionChange });
3102
+ useImperativeHandle10(
3103
+ handle,
3104
+ () => ({
3105
+ edit: (id, key) => instance.current?.edit(id, key),
3106
+ setValue: (id, key, value) => instance.current?.setValue(id, key, value) ?? false,
3107
+ addRow: (values) => instance.current?.addRow(values) ?? "",
3108
+ removeRows: (ids) => instance.current?.removeRows(ids),
3109
+ save: () => instance.current?.save() ?? Promise.resolve(false),
3110
+ discard: () => instance.current?.discard()
3111
+ }),
3112
+ []
3113
+ );
3114
+ const columnsKey = JSON.stringify((columns ?? []).map(({ key, label, type, editable, editor, required, min, max, hidden, options: choices }) => [key, label, type, editable, editor, required, min, max, hidden, choices]));
3115
+ const setupKey = JSON.stringify([columnsKey, rowKey, caption, pageSize, pageSizes, selectable, search, filters, columnsMenu, actions, bulkActions, emptyTitle, emptyDescription, locale, Boolean(newRow)]);
3116
+ useIsomorphicLayoutEffect(() => {
3117
+ const created = createEditableTable(ref.current, {
3118
+ columns,
3119
+ rows: shown.current,
3120
+ rowKey,
3121
+ caption,
3122
+ pageSize,
3123
+ pageSizes,
3124
+ selectable,
3125
+ search,
3126
+ filters,
3127
+ columnsMenu,
3128
+ actions,
3129
+ bulkActions,
3130
+ sort,
3131
+ emptyTitle,
3132
+ emptyDescription,
3133
+ locale,
3134
+ onSave: (changes, next) => callbacks.current.onSave?.(changes, next),
3135
+ onChange: (changes) => callbacks.current.onChange?.(changes),
3136
+ newRow: newRow ? () => callbacks.current.newRow?.() ?? {} : void 0,
3137
+ onAction: (action, row) => callbacks.current.onAction?.(action, row),
3138
+ onBulkAction: (action, chosen) => callbacks.current.onBulkAction?.(action, chosen),
3139
+ onSelectionChange: (ids, chosen) => callbacks.current.onSelectionChange?.(ids, chosen)
3140
+ });
3141
+ instance.current = created;
3142
+ return () => {
3143
+ created.destroy();
3144
+ instance.current = null;
3145
+ };
3146
+ }, [setupKey]);
3147
+ useIsomorphicLayoutEffect(() => {
3148
+ if (shown.current === rows) return;
3149
+ shown.current = rows;
3150
+ instance.current?.setRows(rows);
3151
+ }, [rows]);
3152
+ return /* @__PURE__ */ jsx70("div", { ...props, ref, className: ["mk-data-table", "mk-editable-table", className].filter(Boolean).join(" ") });
3153
+ }
3154
+ var EditableTable = forwardRef10(EditableTableInner);
3155
+
3156
+ // src/components/rich-text-editor/react.tsx
3157
+ import { forwardRef as forwardRef11, useImperativeHandle as useImperativeHandle11, useRef as useRef69 } from "react";
3158
+ import { jsx as jsx71 } from "react/jsx-runtime";
3159
+ var RichTextEditor = forwardRef11(function RichTextEditor2({ value, placeholder, toolbar, maxLength, counter, name, label, readOnly, markdown, onChange, className, ...props }, handle) {
3160
+ const ref = useRef69(null);
3161
+ const instance = useRef69(null);
3162
+ const change = useLatest(onChange);
3163
+ const shown = useRef69(value);
3164
+ useImperativeHandle11(
3165
+ handle,
3166
+ () => ({
3167
+ focus: () => instance.current?.focus(),
3168
+ exec: (command, argument) => instance.current?.exec(command, argument),
3169
+ setValue: (html) => instance.current?.setValue(html)
3170
+ }),
3171
+ []
3172
+ );
3173
+ useIsomorphicLayoutEffect(() => {
3174
+ const created = createRichTextEditor(ref.current, {
3175
+ value: shown.current,
3176
+ placeholder,
3177
+ toolbar,
3178
+ maxLength,
3179
+ counter,
3180
+ name,
3181
+ label,
3182
+ readOnly,
3183
+ markdown,
3184
+ onChange: (html, text) => {
3185
+ shown.current = html;
3186
+ change.current?.(html, text);
3187
+ }
3188
+ });
3189
+ instance.current = created;
3190
+ return () => {
3191
+ created.destroy();
3192
+ instance.current = null;
3193
+ };
3194
+ }, [placeholder, String(toolbar), maxLength, String(counter), name, label, readOnly, markdown]);
3195
+ useIsomorphicLayoutEffect(() => {
3196
+ if (value === void 0 || value === shown.current) return;
3197
+ shown.current = value;
3198
+ instance.current?.setValue(value);
3199
+ }, [value]);
3200
+ return /* @__PURE__ */ jsx71("div", { ...props, ref, className: ["mk-rich-text-editor", className].filter(Boolean).join(" ") });
3201
+ });
891
3202
  export {
892
3203
  ANIMATIONS,
3204
+ ActivityFeed,
893
3205
  AnimatedNumber,
3206
+ Attachment,
3207
+ Breadcrumb,
3208
+ Calendar,
3209
+ Chart,
3210
+ ChartTooltip,
894
3211
  Chat,
895
3212
  ChatBackground,
3213
+ CodeBlock,
3214
+ ColorArea,
3215
+ ColorField,
3216
+ ColorPicker,
3217
+ ColorSlider,
3218
+ CommandSearch,
3219
+ ContextMenu,
3220
+ CreditCard,
896
3221
  Cursor,
3222
+ DataTable,
3223
+ DateRangePicker,
3224
+ DateTimePicker,
897
3225
  Dialog,
3226
+ Drawer,
3227
+ EditableTable,
3228
+ EmptyState,
3229
+ FileExplorer,
3230
+ FilterBuilder,
898
3231
  FlipGroup,
899
3232
  Frost,
3233
+ HoldConfirm,
3234
+ HoverCard,
3235
+ ImagePreview,
3236
+ InputOtp,
900
3237
  Island,
901
3238
  IslandDots,
3239
+ JsonViewer,
3240
+ LikeButton,
3241
+ LinkPreview,
3242
+ LoadingButton,
902
3243
  MK_HEAD_SCRIPT,
903
3244
  MK_THEME_HEAD_SCRIPT,
904
3245
  Menu,
905
3246
  MkIcon,
3247
+ MultiSelect,
906
3248
  NAV_STYLES,
907
3249
  Nav,
3250
+ NotificationBell,
3251
+ Pagination,
3252
+ PasswordStrength,
3253
+ Popover,
3254
+ Progress,
3255
+ Quantity,
3256
+ Questionnaire,
3257
+ RangeCalendar,
3258
+ RangeSlider,
3259
+ ResizablePanel,
3260
+ RichTextEditor,
3261
+ ScratchCard,
3262
+ Skeleton,
3263
+ SlotPicker,
908
3264
  SlotText,
3265
+ SplitView,
3266
+ StarRating,
3267
+ StatCard,
909
3268
  Steps,
3269
+ StudioDock,
3270
+ SwipeActions,
3271
+ TagInput,
910
3272
  ThemePicker,
911
3273
  ThemeProvider,
3274
+ TimeField,
3275
+ Timeline,
912
3276
  Toaster,
3277
+ Tooltip,
3278
+ Trailer,
3279
+ TreeView,
3280
+ VirtualList,
913
3281
  animate,
914
3282
  clearToasts,
915
3283
  confetti,
@@ -920,6 +3288,7 @@ export {
920
3288
  pileStyle,
921
3289
  themeHeadScript,
922
3290
  toast,
3291
+ useActionButton,
923
3292
  useCardDock,
924
3293
  useCascade,
925
3294
  useChat,
@@ -931,15 +3300,22 @@ export {
931
3300
  useDialog,
932
3301
  useDockPill,
933
3302
  useDragRuler,
3303
+ useDrawer,
3304
+ useEditorialReveal,
934
3305
  useFillText,
3306
+ useFilmHero,
935
3307
  useFitText,
936
3308
  useFlow,
3309
+ useFontCycle,
937
3310
  useFrameZoom,
3311
+ useImageZoom,
938
3312
  useInfiniteReel,
939
3313
  useIsomorphicLayoutEffect,
3314
+ useJoinedCta,
940
3315
  useLatest,
941
3316
  useLetters,
942
3317
  useLiquidBlend,
3318
+ useLocalClock,
943
3319
  useMarquee,
944
3320
  useMaskText,
945
3321
  useMatcap,
@@ -953,17 +3329,23 @@ export {
953
3329
  useRepelBento,
954
3330
  useReveal,
955
3331
  useRotator,
3332
+ useScrollDock,
956
3333
  useShaderBlur,
957
3334
  useShaderGrain,
958
3335
  useSlotText,
959
3336
  useSnapStrip,
960
3337
  useSortable,
961
3338
  useSpringCards,
3339
+ useSticker,
962
3340
  useStretchFooter,
3341
+ useStudioDock,
963
3342
  useTabs,
964
3343
  useTextRoll,
965
3344
  useTheme,
3345
+ useThumbnailNav,
966
3346
  useTicketMenu,
3347
+ useTrailer,
3348
+ useWeightHover,
967
3349
  useWords
968
3350
  };
969
3351
  //# sourceMappingURL=index.js.map