@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
@@ -1,65 +1,88 @@
1
- import { gsap, EASE, registerMotion } from '../core/gsap';
2
- import { motionSpring } from '../core/physics-spring';
3
- import { reduced } from '../core/reduced';
4
- import { clearStyles } from '../core/styles';
5
- import { TIMING } from '../core/timing';
6
- import { backdropVeil, ghostOf } from './surface';
7
-
8
- /*
9
- * project sheet: the surface rises from below the screen (0.72 s,
10
- * cubic(.16,1,.3,1)) while the page behind ([data-mk-underlay]) sinks to
11
- * scale .98 / opacity .4 on a 300/30 spring. It closes through an inert copy
12
- * that drops away, so focus returns at once.
13
- */
14
-
15
- const UNDERLAY_STYLES = ['transform', 'translate', 'rotate', 'scale', 'transform-origin', 'opacity'];
16
-
17
- export function sheetOpen(surface: HTMLElement) {
18
- if (reduced()) return null;
19
- registerMotion();
20
- return gsap.fromTo(surface, { yPercent: 100 }, { yPercent: 0, duration: TIMING.sheet.open, ease: EASE.sheet, clearProps: 'transform' });
21
- }
22
-
23
- /** Drop a copy of the (still open) sheet off the bottom of the screen. */
24
- export function sheetClose(surface: HTMLElement, { inPlace = false }: { inPlace?: boolean } = {}) {
25
- registerMotion();
26
- const dragged = inPlace ? Number(gsap.getProperty(surface, 'y')) || 0 : 0;
27
- gsap.killTweensOf(surface);
28
- clearStyles([surface], ['transform', 'translate', 'rotate', 'scale']);
29
- const ghost = reduced() ? null : ghostOf(surface);
30
- if (!ghost) return null;
31
- const veil = backdropVeil(surface);
32
- document.body.append(veil, ghost);
33
- gsap.to(veil, { opacity: 0, duration: TIMING.sheet.close, ease: 'power3.in', onComplete: () => veil.remove() });
34
- return gsap.fromTo(
35
- ghost,
36
- { y: dragged, yPercent: 0 },
37
- { yPercent: 100, duration: TIMING.sheet.close, ease: EASE.sheet, onComplete: () => ghost.remove() },
38
- );
39
- }
40
-
41
- export function pushUnderlay(elements: HTMLElement[]) {
42
- if (!elements.length || reduced()) return;
43
- registerMotion();
44
- const { ease, duration } = motionSpring(...TIMING.springs.underlay);
45
- gsap.to(elements, {
46
- scale: TIMING.sheet.underlayScale,
47
- opacity: TIMING.sheet.underlayOpacity,
48
- transformOrigin: '50% 0',
49
- duration,
50
- ease,
51
- overwrite: 'auto',
52
- });
53
- }
54
-
55
- export function releaseUnderlay(elements: HTMLElement[], animated = true) {
56
- if (!elements.length) return;
57
- const restore = () => clearStyles(elements, UNDERLAY_STYLES);
58
- if (!animated || reduced()) {
59
- gsap.killTweensOf(elements);
60
- restore();
61
- return;
62
- }
63
- const { ease, duration } = motionSpring(...TIMING.springs.underlay);
64
- gsap.to(elements, { scale: 1, opacity: 1, duration, ease, overwrite: 'auto', onComplete: restore });
65
- }
1
+ import { gsap, EASE, registerMotion } from '../core/gsap';
2
+ import { motionSpring } from '../core/physics-spring';
3
+ import { reduced } from '../core/reduced';
4
+ import { clearStyles } from '../core/styles';
5
+ import { TIMING } from '../core/timing';
6
+ import { backdropVeil, ghostOf } from './surface';
7
+
8
+ /*
9
+ * project sheet: the surface rises from below the screen (0.72 s,
10
+ * cubic(.16,1,.3,1)) while the page behind ([data-mk-underlay]) sinks to
11
+ * scale .98 / opacity .4 on a 300/30 spring. It closes through an inert copy
12
+ * that drops away, so focus returns at once.
13
+ */
14
+
15
+ const UNDERLAY_STYLES = ['transform', 'translate', 'rotate', 'scale', 'transform-origin', 'opacity'];
16
+
17
+ export function sheetOpen(surface: HTMLElement) {
18
+ if (reduced()) return null;
19
+ registerMotion();
20
+ return gsap.fromTo(surface, { yPercent: 100 }, { yPercent: 0, duration: TIMING.sheet.open, ease: EASE.sheet, clearProps: 'transform' });
21
+ }
22
+
23
+ /** Side of a drawer surface: data-mk-drawer="left", else right. */
24
+ const slideFrom = (surface: HTMLElement) => (surface.dataset.mkDrawer === 'left' ? -1 : 1);
25
+
26
+ /** Drawer: the surface slides in from its side on the sheet curve. */
27
+ export function slideOpen(surface: HTMLElement) {
28
+ if (reduced()) return null;
29
+ registerMotion();
30
+ return gsap.fromTo(surface, { xPercent: 104 * slideFrom(surface) }, { xPercent: 0, duration: TIMING.sheet.open, ease: EASE.sheet, clearProps: 'transform' });
31
+ }
32
+
33
+ /** Slide a copy of the (still open) drawer back off its side, so focus returns at once. */
34
+ export function slideClose(surface: HTMLElement) {
35
+ registerMotion();
36
+ gsap.killTweensOf(surface);
37
+ clearStyles([surface], ['transform', 'translate', 'rotate', 'scale']);
38
+ const ghost = reduced() ? null : ghostOf(surface);
39
+ if (!ghost) return null;
40
+ const veil = backdropVeil(surface);
41
+ document.body.append(veil, ghost);
42
+ gsap.to(veil, { opacity: 0, duration: TIMING.sheet.close * 0.8, ease: 'power3.in', onComplete: () => veil.remove() });
43
+ return gsap.to(ghost, { xPercent: 104 * slideFrom(surface), duration: TIMING.sheet.close * 0.8, ease: 'power3.in', onComplete: () => ghost.remove() });
44
+ }
45
+
46
+ /** Drop a copy of the (still open) sheet off the bottom of the screen. */
47
+ export function sheetClose(surface: HTMLElement, { inPlace = false }: { inPlace?: boolean } = {}) {
48
+ registerMotion();
49
+ const dragged = inPlace ? Number(gsap.getProperty(surface, 'y')) || 0 : 0;
50
+ gsap.killTweensOf(surface);
51
+ clearStyles([surface], ['transform', 'translate', 'rotate', 'scale']);
52
+ const ghost = reduced() ? null : ghostOf(surface);
53
+ if (!ghost) return null;
54
+ const veil = backdropVeil(surface);
55
+ document.body.append(veil, ghost);
56
+ gsap.to(veil, { opacity: 0, duration: TIMING.sheet.close, ease: 'power3.in', onComplete: () => veil.remove() });
57
+ return gsap.fromTo(
58
+ ghost,
59
+ { y: dragged, yPercent: 0 },
60
+ { yPercent: 100, duration: TIMING.sheet.close, ease: EASE.sheet, onComplete: () => ghost.remove() },
61
+ );
62
+ }
63
+
64
+ export function pushUnderlay(elements: HTMLElement[]) {
65
+ if (!elements.length || reduced()) return;
66
+ registerMotion();
67
+ const { ease, duration } = motionSpring(...TIMING.springs.underlay);
68
+ gsap.to(elements, {
69
+ scale: TIMING.sheet.underlayScale,
70
+ opacity: TIMING.sheet.underlayOpacity,
71
+ transformOrigin: '50% 0',
72
+ duration,
73
+ ease,
74
+ overwrite: 'auto',
75
+ });
76
+ }
77
+
78
+ export function releaseUnderlay(elements: HTMLElement[], animated = true) {
79
+ if (!elements.length) return;
80
+ const restore = () => clearStyles(elements, UNDERLAY_STYLES);
81
+ if (!animated || reduced()) {
82
+ gsap.killTweensOf(elements);
83
+ restore();
84
+ return;
85
+ }
86
+ const { ease, duration } = motionSpring(...TIMING.springs.underlay);
87
+ gsap.to(elements, { scale: 1, opacity: 1, duration, ease, overwrite: 'auto', onComplete: restore });
88
+ }
@@ -78,6 +78,15 @@ export function ghostOf(surface: HTMLElement): HTMLElement | null {
78
78
  const ghost = document.createElement('div');
79
79
  ghost.className = surface.className;
80
80
  ghost.innerHTML = surface.innerHTML;
81
+ // The markup carries attributes, not what was typed or chosen since: copy the live values too.
82
+ const live = surface.querySelectorAll<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>('input, textarea, select');
83
+ ghost.querySelectorAll<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>('input, textarea, select').forEach((copy, i) => {
84
+ const source = live[i];
85
+ if (!source) return;
86
+ if (copy instanceof HTMLSelectElement) copy.selectedIndex = (source as HTMLSelectElement).selectedIndex;
87
+ else copy.value = source.value;
88
+ if (copy instanceof HTMLInputElement && source instanceof HTMLInputElement) copy.checked = source.checked;
89
+ });
81
90
  ghost.setAttribute('aria-hidden', 'true');
82
91
  ghost.inert = true;
83
92
  ghost.dataset.mkGhost = '';
@@ -78,3 +78,81 @@ export { confetti, type ConfettiOptions } from '../motion/confetti';
78
78
  export { MK_HEAD_SCRIPT } from '../core/reduced';
79
79
  export { MK_THEME_HEAD_SCRIPT, themeHeadScript } from '../theme/theme';
80
80
  export { Island, IslandDots, type IslandProps, type IslandPanel } from '../components/island/react';
81
+ export { Quantity, type QuantityProps } from '../components/quantity/react';
82
+ export { Pagination, type PaginationProps } from '../components/pagination/react';
83
+ export { HoverCard, type HoverCardProps } from '../components/hover-card/react';
84
+ export { InputOtp, type InputOtpProps } from '../components/input-otp/react';
85
+ export { useJoinedCta } from './use-joined-cta';
86
+ export { useImageZoom } from './use-image-zoom';
87
+ export { useFontCycle } from './use-font-cycle';
88
+ export { useThumbnailNav } from './use-thumbnail-nav';
89
+ export { useActionButton } from './use-action-button';
90
+ export { useFilmHero } from './use-film-hero';
91
+ export { useEditorialReveal } from './use-editorial-reveal';
92
+ export { useStudioDock } from './use-studio-dock';
93
+ export { useTrailer } from './use-trailer';
94
+ export { StudioDock, type StudioDockProps } from '../components/studio-dock/react';
95
+ export { Trailer, type TrailerProps } from '../components/trailer/react';
96
+ export { Calendar, type CalendarProps } from '../components/calendar/react';
97
+ export { SlotPicker, type SlotPickerProps } from '../components/slot-picker/react';
98
+ export { useWeightHover } from './use-weight-hover';
99
+ export { useSticker } from './use-sticker';
100
+ export { useScrollDock } from './use-scroll-dock';
101
+ export { useLocalClock } from './use-local-clock';
102
+ export { Attachment, type AttachmentProps, type AttachmentUpload } from '../components/attachment/react';
103
+ export { Skeleton, type SkeletonProps } from '../components/skeleton/react';
104
+ export { Questionnaire, type QuestionnaireProps, type Question, type QuestionType, type QuestionOption } from '../components/questionnaire/react';
105
+ export { CodeBlock, type CodeBlockProps } from '../components/code-block/react';
106
+ export { ContextMenu, type ContextMenuProps } from '../components/context-menu/react';
107
+ export { Drawer, useDrawer, type DrawerRootProps } from '../components/drawer/react';
108
+ export { LinkPreview, type LinkPreviewProps } from '../components/link-preview/react';
109
+ export { Progress, type ProgressProps } from '../components/progress/react';
110
+ export { RangeSlider, type RangeSliderProps } from '../components/range-slider/react';
111
+ export { Chart, type ChartProps } from '../components/chart/react';
112
+ export { CreditCard, type CreditCardProps } from '../components/credit-card/react';
113
+ export { CommandSearch, type CommandSearchProps } from '../components/command-search/react';
114
+ export type { CommandItem } from '../components/command-search/engine';
115
+ export { HoldConfirm, type HoldConfirmProps } from '../components/hold-confirm/react';
116
+ export { ImagePreview, type ImagePreviewProps, type PreviewImage } from '../components/image-preview/react';
117
+ export { LikeButton, type LikeButtonProps } from '../components/like-button/react';
118
+ export { NotificationBell, type NotificationBellProps } from '../components/notification-bell/react';
119
+ export { PasswordStrength, type PasswordStrengthProps } from '../components/password-strength/react';
120
+ export { ScratchCard, type ScratchCardProps } from '../components/scratch-card/react';
121
+ export { StarRating, type StarRatingProps } from '../components/star-rating/react';
122
+ export { SwipeActions, type SwipeActionsProps, type SwipeRowProps, type SwipeAction } from '../components/swipe-actions/react';
123
+ export { ColorSlider, type ColorSliderProps } from '../components/color-slider/react';
124
+ export { ColorArea, type ColorAreaProps } from '../components/color-area/react';
125
+ export { ColorField, type ColorFieldProps } from '../components/color-field/react';
126
+ export { ColorPicker, type ColorPickerProps } from '../components/color-picker/react';
127
+ export { TimeField, type TimeFieldProps } from '../components/time-field/react';
128
+ export { RangeCalendar, type RangeCalendarProps } from '../components/range-calendar/react';
129
+ export { DateRangePicker, type DateRangePickerProps } from '../components/date-range-picker/react';
130
+ export { Tooltip, type TooltipProps } from '../components/tooltip/react';
131
+ export { Popover, type PopoverProps } from '../components/popover/react';
132
+ export { LoadingButton, type LoadingButtonProps } from '../components/loading-button/react';
133
+ export { Breadcrumb, type BreadcrumbProps } from '../components/breadcrumb/react';
134
+ export { EmptyState, type EmptyStateProps } from '../components/empty-state/react';
135
+ export { StatCard, type StatCardProps } from '../components/stat-card/react';
136
+ export { ChartTooltip, type ChartTooltipProps } from '../components/chart-tooltip/react';
137
+ export { MultiSelect, type MultiSelectProps } from '../components/multi-select/react';
138
+ export { TagInput, type TagInputProps } from '../components/tag-input/react';
139
+ export { DateTimePicker, type DateTimePickerProps } from '../components/date-time-picker/react';
140
+ export { FilterBuilder, type FilterBuilderProps } from '../components/filter-builder/react';
141
+ export { Timeline, type TimelineProps } from '../components/timeline/react';
142
+ export type { TimelineEvent, TimelineStatus } from '../components/timeline/engine';
143
+ export { ActivityFeed, type ActivityFeedProps, type ActivityFeedHandle } from '../components/activity-feed/react';
144
+ export type { ActivityItem, ActivityActor, ActivityKind } from '../components/activity-feed/engine';
145
+ export { TreeView, type TreeViewProps, type TreeViewHandle } from '../components/tree-view/react';
146
+ export type { TreeNode } from '../core/tree';
147
+ export { FileExplorer, type FileExplorerProps, type FileExplorerHandle } from '../components/file-explorer/react';
148
+ export type { FileEntry, FileView, FileChange } from '../components/file-explorer/engine';
149
+ export { JsonViewer, type JsonViewerProps, type JsonViewerHandle } from '../components/json-viewer/react';
150
+ export { VirtualList, type VirtualListProps, type VirtualListHandle } from '../components/virtual-list/react';
151
+ export { ResizablePanel, type ResizablePanelProps, type ResizablePanelHandle } from '../components/resizable-panel/react';
152
+ export { SplitView, type SplitViewProps, type SplitViewHandle } from '../components/split-view/react';
153
+ export { DataTable, type DataTableProps, type DataTableHandle } from '../components/data-table/react';
154
+ export type { DataColumn, DataAction, DataRow, DataSort, RowId } from '../components/data-table/engine';
155
+ export { EditableTable, type EditableTableProps, type EditableTableHandle } from '../components/editable-table/react';
156
+ export type { EditableColumn, RowChange, EditorKind } from '../components/editable-table/engine';
157
+ export { RichTextEditor, type RichTextEditorProps, type RichTextEditorHandle } from '../components/rich-text-editor/react';
158
+ export type { RichCommand } from '../components/rich-text-editor/engine';
@@ -0,0 +1,6 @@
1
+ 'use client';
2
+ import type { DependencyList, RefObject } from 'react';
3
+ import { useRecipe } from './use-recipe';
4
+ import { createActionButton, type ActionButtonOptions } from '../recipes/action-button/create-action-button';
5
+ export const useActionButton = (ref: RefObject<HTMLElement | null>, options?: ActionButtonOptions, deps?: DependencyList) =>
6
+ useRecipe(ref, createActionButton, options, deps);
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import type { DependencyList, RefObject } from 'react';
3
+ import { useRecipe } from './use-recipe';
4
+ import { createEditorialReveal, type EditorialRevealOptions } from '../recipes/editorial-reveal/create-editorial-reveal';
5
+ export function useEditorialReveal(ref: RefObject<HTMLElement | null>, options: EditorialRevealOptions = {}, deps?: DependencyList) {
6
+ return useRecipe(ref, createEditorialReveal, options, deps);
7
+ }
@@ -0,0 +1,6 @@
1
+ 'use client';
2
+ import type { DependencyList, RefObject } from 'react';
3
+ import { useRecipe } from './use-recipe';
4
+ import { createFilmHero, type FilmHeroOptions } from '../recipes/film-hero/create-film-hero';
5
+ export const useFilmHero = (ref: RefObject<HTMLElement | null>, options?: FilmHeroOptions, deps?: DependencyList) =>
6
+ useRecipe(ref, createFilmHero, options, deps);
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import type { DependencyList, RefObject } from 'react';
3
+ import { useRecipe } from './use-recipe';
4
+ import { createFontCycle, type FontCycleOptions } from '../recipes/font-cycle/create-font-cycle';
5
+
6
+ export const useFontCycle = (ref: RefObject<HTMLElement | null>, options?: FontCycleOptions, deps?: DependencyList) =>
7
+ useRecipe(ref, createFontCycle, options, deps);
@@ -0,0 +1,5 @@
1
+ 'use client';
2
+ import type { RefObject, DependencyList } from 'react';
3
+ import { useRecipe } from './use-recipe';
4
+ import { createImageZoom, type ImageZoomOptions } from '../recipes/image-zoom/create-image-zoom';
5
+ export const useImageZoom = (ref: RefObject<HTMLElement | null>, options?: ImageZoomOptions, deps?: DependencyList) => useRecipe(ref, createImageZoom, options, deps);
@@ -0,0 +1,5 @@
1
+ 'use client';
2
+ import type { RefObject, DependencyList } from 'react';
3
+ import { useRecipe } from './use-recipe';
4
+ import { createJoinedCta, type JoinedCtaOptions } from '../recipes/joined-cta/create-joined-cta';
5
+ export const useJoinedCta = (ref: RefObject<HTMLElement | null>, options?: JoinedCtaOptions, deps?: DependencyList) => useRecipe(ref, createJoinedCta, options, deps);
@@ -0,0 +1,5 @@
1
+ 'use client';
2
+ import type { RefObject, DependencyList } from 'react';
3
+ import { useRecipe } from './use-recipe';
4
+ import { createLocalClock, type LocalClockOptions } from '../recipes/local-clock/create-local-clock';
5
+ export const useLocalClock = (ref: RefObject<HTMLElement | null>, options?: LocalClockOptions, deps?: DependencyList) => useRecipe(ref, createLocalClock, options, deps);
@@ -0,0 +1,5 @@
1
+ 'use client';
2
+ import type { RefObject, DependencyList } from 'react';
3
+ import { useRecipe } from './use-recipe';
4
+ import { createScrollDock, type ScrollDockOptions } from '../recipes/scroll-dock/create-scroll-dock';
5
+ export const useScrollDock = (ref: RefObject<HTMLElement | null>, options?: ScrollDockOptions, deps?: DependencyList) => useRecipe(ref, createScrollDock, options, deps);
@@ -0,0 +1,5 @@
1
+ 'use client';
2
+ import type { RefObject, DependencyList } from 'react';
3
+ import { useRecipe } from './use-recipe';
4
+ import { createSticker, type StickerOptions } from '../recipes/sticker/create-sticker';
5
+ export const useSticker = (ref: RefObject<HTMLElement | null>, options?: StickerOptions, deps?: DependencyList) => useRecipe(ref, createSticker, options, deps);
@@ -0,0 +1,8 @@
1
+ 'use client';
2
+ import type { DependencyList, RefObject } from 'react';
3
+ import { useLatest, useRecipe } from './use-recipe';
4
+ import { createStudioDock, type StudioDockOptions } from '../components/studio-dock/engine';
5
+ export function useStudioDock(ref: RefObject<HTMLElement | null>, options: StudioDockOptions = {}, deps?: DependencyList) {
6
+ const change = useLatest(options.onChange);
7
+ return useRecipe(ref, createStudioDock, { ...options, onChange: state => change.current?.(state) }, deps);
8
+ }
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import type { DependencyList, RefObject } from 'react';
3
+ import { useRecipe } from './use-recipe';
4
+ import { createThumbnailNav, type ThumbnailNavOptions } from '../recipes/thumbnail-nav/create-thumbnail-nav';
5
+
6
+ export const useThumbnailNav = (ref: RefObject<HTMLElement | null>, options?: ThumbnailNavOptions, deps?: DependencyList) =>
7
+ useRecipe(ref, createThumbnailNav, options, deps);
@@ -0,0 +1,6 @@
1
+ 'use client';
2
+ import type { DependencyList, RefObject } from 'react';
3
+ import { useRecipe } from './use-recipe';
4
+ import { createTrailer, type TrailerOptions } from '../components/trailer/engine';
5
+ export const useTrailer = (ref: RefObject<HTMLElement | null>, options?: TrailerOptions, deps?: DependencyList) =>
6
+ useRecipe(ref, createTrailer, options, deps);
@@ -0,0 +1,5 @@
1
+ 'use client';
2
+ import type { RefObject, DependencyList } from 'react';
3
+ import { useRecipe } from './use-recipe';
4
+ import { createWeightHover, type WeightHoverOptions } from '../recipes/weight-hover/create-weight-hover';
5
+ export const useWeightHover = (ref: RefObject<HTMLElement | null>, options?: WeightHoverOptions, deps?: DependencyList) => useRecipe(ref, createWeightHover, options, deps);
@@ -0,0 +1,31 @@
1
+ # action-button
2
+
3
+ Botones con sombra firme inspirados en Don't Look Up y etiquetas en máscara inspiradas en la ficha A24.
4
+
5
+ ## HTML / Astro
6
+
7
+ ```html
8
+ <button class="mk-action-button" data-mk="action-button" data-mk-variant="primary">Empezar</button>
9
+ <button class="mk-action-button" data-mk="action-button" data-mk-variant="film">
10
+ <span data-mk-action-label>Ver trailer ↗</span>
11
+ </button>
12
+ ```
13
+
14
+ ```ts
15
+ const button = createActionButton(element, {
16
+ variant: 'icon', toggle: true,
17
+ onPressedChange: value => console.log(value),
18
+ });
19
+ button.setPressed(true);
20
+ button.destroy();
21
+ ```
22
+
23
+ React: `useActionButton(ref, options, deps?)`. Conserva botones/enlaces semánticos escritos por el consumidor; la receta no ejecuta navegación ni reproduce sonidos. Variantes: `primary`, `secondary`, `icon`, `stepper`, `film`. Las variantes también pueden usarse sólo con CSS mediante `data-mk-action-variant`; `film` necesita el motor para duplicar su etiqueta marcada.
24
+
25
+ ## Movimiento / accesibilidad
26
+
27
+ Press 130ms ease-out, color150ms ease. Hover baja3px y reduce sombra; active5×6px. Film usa clip.4s/translate.35s/scale.3s y copia retrasada75ms. Es una adaptación reusable; no reproduce todos los overrides particulares del juego original ni su lógica económica.
28
+
29
+ `toggle` es opt-in y usa `aria-pressed`; controles disabled y `aria-disabled` no cambian el estado. Un icono necesita `aria-label`. La copia rolling tiene `aria-hidden`, el nodo original se conserva. Focus visible explícito. Reduced-motion elimina las transiciones y la duplicación visual; los gestos de botón siguen indicando estado. `destroy()` restaura nodos/atributos y retira listeners.
30
+
31
+ Tokens: `--mk-action-ink`, `--mk-action-paper`, `--mk-action-lift`, `--mk-action-tilt`, `--mk-action-focus`, `--mk-film-font`.
@@ -0,0 +1,113 @@
1
+ .mk-action-button {
2
+ --mk-action-ink: var(--mk-text, #171713);
3
+ --mk-action-paper: var(--mk-surface, #f7f5ee);
4
+ --mk-action-lift: 5px;
5
+ --mk-action-tilt: -1.2deg;
6
+ appearance: none;
7
+ position: relative;
8
+ display: inline-flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ gap: .6em;
12
+ min-height: 44px;
13
+ padding: .65em 1.5em;
14
+ border: 3px solid var(--mk-action-paper);
15
+ border-radius: 24px 30px 22px 28px / 30px 22px 28px 24px;
16
+ background: var(--mk-action-ink);
17
+ color: var(--mk-action-paper);
18
+ box-shadow: var(--mk-action-lift) calc(var(--mk-action-lift) + 1px) 0 var(--mk-action-ink);
19
+ transform: rotate(var(--mk-action-tilt));
20
+ font: 700 .85rem/1.15 var(--mk-font, sans-serif);
21
+ letter-spacing: .045em;
22
+ text-transform: uppercase;
23
+ text-decoration: none;
24
+ cursor: pointer;
25
+ touch-action: manipulation;
26
+ transition: transform 130ms ease-out, box-shadow 130ms ease-out, background-color 150ms ease, color 150ms ease, border-color 150ms ease;
27
+ }
28
+ .mk-action-button[data-mk-action-variant="secondary"],
29
+ .mk-action-button[data-mk-action-variant="icon"] {
30
+ --mk-action-tilt: 1.1deg;
31
+ background: var(--mk-action-paper);
32
+ border-color: var(--mk-action-ink);
33
+ color: var(--mk-action-ink);
34
+ }
35
+ .mk-action-button[data-mk-action-variant="icon"] {
36
+ width: 44px;
37
+ padding: 8px;
38
+ border-radius: 16px 20px 15px 19px / 20px 15px 19px 16px;
39
+ }
40
+ .mk-action-button svg { width: 1.25em; height: 1.25em; flex: none; }
41
+ .mk-action-button[data-mk-action-variant="stepper"] {
42
+ --mk-action-tilt: 0deg;
43
+ min-width: 44px;
44
+ padding: .5em;
45
+ border: 2px solid var(--mk-action-ink);
46
+ border-radius: 11px;
47
+ background: var(--mk-action-paper);
48
+ color: var(--mk-action-ink);
49
+ box-shadow: none;
50
+ }
51
+ .mk-action-button[data-mk-action-variant="film"] {
52
+ --mk-action-tilt: 0deg;
53
+ border: 0;
54
+ border-radius: 0;
55
+ background: transparent;
56
+ color: inherit;
57
+ box-shadow: none;
58
+ padding: .5em 0;
59
+ font-family: var(--mk-film-font, Georgia, serif);
60
+ font-size: 1.25rem;
61
+ }
62
+ .mk-action-button[data-mk-action-variant="film"]::before,
63
+ .mk-action-button[data-mk-action-variant="film"]::after {
64
+ content: "";
65
+ position: absolute;
66
+ inset: 0 0 auto;
67
+ height: 1px;
68
+ background: currentColor;
69
+ transition: transform .4s cubic-bezier(.32,.72,0,1);
70
+ }
71
+ .mk-action-button[data-mk-action-variant="film"]::after { inset: auto 0 0; }
72
+ [data-mk-action-label] { display: inline-grid; overflow: clip; }
73
+ .mk-action-button__line, .mk-action-button__copy {
74
+ grid-area: 1 / 1;
75
+ transition: clip-path .4s cubic-bezier(.32,.72,0,1), translate .35s cubic-bezier(.32,.72,0,1), scale .3s cubic-bezier(.34,2.27,.64,1);
76
+ }
77
+ .mk-action-button__line { clip-path: inset(0); transform-origin: bottom; }
78
+ .mk-action-button__copy { clip-path: inset(0 0 100%); translate: 0 -.25em; scale: 1.05; transform-origin: top; }
79
+ @media (hover: hover) {
80
+ .mk-action-button:not(:disabled):not([aria-disabled="true"]):hover {
81
+ transform: rotate(var(--mk-action-tilt)) translate(3px, 3px);
82
+ box-shadow: 2px 3px 0 var(--mk-action-ink);
83
+ }
84
+ .mk-action-button:is([data-mk-action-variant="secondary"], [data-mk-action-variant="icon"], [data-mk-action-variant="stepper"]):not(:disabled):not([aria-disabled="true"]):hover {
85
+ background: var(--mk-action-ink);
86
+ border-color: var(--mk-action-paper);
87
+ color: var(--mk-action-paper);
88
+ }
89
+ .mk-action-button[data-mk-action-variant="stepper"]:not(:disabled):not([aria-disabled="true"]):hover { transform: none; box-shadow: none; }
90
+ }
91
+ .mk-action-button:not(:disabled):not([aria-disabled="true"]):active,
92
+ .mk-action-button[aria-pressed="true"] {
93
+ transform: rotate(var(--mk-action-tilt)) translate(var(--mk-action-lift), calc(var(--mk-action-lift) + 1px));
94
+ box-shadow: 0 0 0 var(--mk-action-ink);
95
+ }
96
+ .mk-action-button[aria-pressed="true"] { background: var(--mk-action-ink); color: var(--mk-action-paper); }
97
+ .mk-action-button[aria-pressed="true"]:not(:disabled):not([aria-disabled="true"]):hover { transform: rotate(var(--mk-action-tilt)) translate(var(--mk-action-lift), calc(var(--mk-action-lift) + 1px)); box-shadow: none; }
98
+ .mk-action-button[data-mk-action-variant="stepper"]:not(:disabled):not([aria-disabled="true"]):active { transform: translateY(1px); box-shadow: none; }
99
+ .mk-action-button[data-mk-action-variant="film"]:is(:hover, :focus-visible):not(:disabled):not([aria-disabled="true"]) {
100
+ transform: scale(1.03) rotate(-.75deg);
101
+ box-shadow: none;
102
+ }
103
+ .mk-action-button[data-mk-action-variant="film"]:is(:hover, :focus-visible):not(:disabled):not([aria-disabled="true"]) .mk-action-button__line { clip-path: inset(100% 0 0); translate: 0 .25em; scale: .95; }
104
+ .mk-action-button[data-mk-action-variant="film"]:is(:hover, :focus-visible):not(:disabled):not([aria-disabled="true"]) .mk-action-button__copy { clip-path: inset(0); translate: 0; scale: 1; transition-delay: 75ms; }
105
+ .mk-action-button[data-mk-action-variant="film"]:active:not(:disabled) { transform: scale(.97); }
106
+ .mk-action-button:focus-visible { outline: 3px solid var(--mk-action-focus, #356bdf); outline-offset: 7px; }
107
+ .mk-action-button:disabled, .mk-action-button[aria-disabled="true"] { opacity: .35; cursor: default; }
108
+ @media (prefers-reduced-motion: reduce) {
109
+ .mk-action-button, .mk-action-button *, .mk-action-button::before, .mk-action-button::after { transition: none; }
110
+ .mk-action-button[data-mk-action-variant="film"]:is(:hover, :focus-visible):not(:disabled):not([aria-disabled="true"]) { transform: none; }
111
+ .mk-action-button[data-mk-action-variant="film"]:is(:hover, :focus-visible):not(:disabled):not([aria-disabled="true"]) .mk-action-button__line { clip-path: none; translate: none; scale: 1; }
112
+ .mk-action-button__copy { display: none; }
113
+ }
@@ -0,0 +1,56 @@
1
+ import { createScope } from '../../core/scope';
2
+ import { inert, type Instance } from '../../core/types';
3
+
4
+ export type ActionButtonVariant = 'primary' | 'secondary' | 'icon' | 'stepper' | 'film';
5
+ export interface ActionButtonOptions {
6
+ variant?: ActionButtonVariant;
7
+ /** Toggle aria-pressed on activation. Ordinary action buttons leave it unset. */
8
+ toggle?: boolean;
9
+ pressed?: boolean;
10
+ onPressedChange?: (pressed: boolean) => void;
11
+ }
12
+ export interface ActionButtonInstance extends Instance {
13
+ setPressed(pressed: boolean): void;
14
+ readonly pressed: boolean;
15
+ }
16
+
17
+ /** Drawn press buttons and a masked rolling-label film variant. Uses native activation. */
18
+ export function createActionButton(root: HTMLElement | null, options: ActionButtonOptions = {}): ActionButtonInstance {
19
+ if (!root) return inert({ setPressed() {}, pressed: false });
20
+ const scope = createScope();
21
+ const variant = options.variant ?? (root.getAttribute('data-mk-action-variant') as ActionButtonVariant | null) ?? 'primary';
22
+ scope.attr(root, 'data-mk-action-variant', variant);
23
+ scope.attr(root, 'data-mk-action-ready', '');
24
+ const label = root.querySelector<HTMLElement>('[data-mk-action-label]');
25
+ if (label && variant === 'film') {
26
+ const nodes = [...label.childNodes];
27
+ const line = document.createElement('span');
28
+ line.className = 'mk-action-button__line';
29
+ line.append(...nodes);
30
+ const copy = document.createElement('span');
31
+ copy.className = 'mk-action-button__copy';
32
+ copy.setAttribute('aria-hidden', 'true');
33
+ // Plain text prevents duplicate interactive controls or IDs inside the label.
34
+ copy.textContent = line.textContent;
35
+ label.append(line, copy);
36
+ scope.add(() => { label.replaceChildren(...nodes); });
37
+ }
38
+ let pressed = options.pressed ?? root.getAttribute('aria-pressed') === 'true';
39
+ if (options.toggle || options.pressed !== undefined) scope.attr(root, 'aria-pressed', String(pressed));
40
+ const setPressed = (next: boolean) => {
41
+ if (scope.disposed || next === pressed) return;
42
+ pressed = next;
43
+ scope.attr(root, 'aria-pressed', String(pressed));
44
+ options.onPressedChange?.(pressed);
45
+ root.dispatchEvent(new CustomEvent('mk:action-change', { bubbles: true, detail: { pressed } }));
46
+ };
47
+ scope.on(root, 'click', (event) => {
48
+ if (event.defaultPrevented) return;
49
+ if (root.hasAttribute('disabled') || root.getAttribute('aria-disabled') === 'true') {
50
+ event.preventDefault();
51
+ return;
52
+ }
53
+ if (options.toggle) setPressed(!pressed);
54
+ });
55
+ return { setPressed, get pressed() { return pressed; }, destroy: () => scope.dispose() };
56
+ }
@@ -0,0 +1,35 @@
1
+ # editorial-reveal
2
+
3
+ Composición de títulos enmascarados, tarjetas, CTA con flecha duplicada, cursor decorativo y grupos de contacto escalonados. Referencia conductual: CoMinVi. Reutiliza `mask-text`, `cascade`, `parallax` y `contrast` sin copiar assets ni código de la referencia.
4
+
5
+ ```html
6
+ <section class="mk-editorial-reveal" data-mk="editorial-reveal">
7
+ <header data-mk-editorial-header>Estudio</header>
8
+ <section data-mk-tone="light">
9
+ <h1 data-mk-editorial-title>Un nuevo punto de vista.</h1>
10
+ <a href="/story" data-mk-editorial-card>
11
+ <img data-mk-editorial-card-image src="/your-image.webp" alt="Paisaje">
12
+ <h2>Explorar la historia</h2>
13
+ </a>
14
+ <a href="/story" data-mk-editorial-button><span data-mk-editorial-button-content>Leer</span></a>
15
+ </section>
16
+ <div data-mk-editorial-group>
17
+ <h2 data-mk-cascade="rise">Conversemos</h2>
18
+ <label data-mk-cascade="fade">Correo <input type="email"></label>
19
+ </div>
20
+ <span data-mk-editorial-cursor hidden>Leer ↗</span>
21
+ </section>
22
+ ```
23
+
24
+ ```ts
25
+ import { createEditorialReveal } from '@yewdiel21/motion-kit';
26
+ import { useEditorialReveal } from '@yewdiel21/motion-kit/react';
27
+ const motion = createEditorialReveal(root, { trigger: 'manual' });
28
+ motion.play(); motion.reset(); motion.destroy();
29
+ ```
30
+
31
+ Opciones: `trigger` (`scroll` por defecto, `load`, `manual`), `duration` 1.2 s, `stagger` .03 s, `y` 110 %, `ease` curva `(0.6,0,0,1)`, `hoverDuration` .5 s, `buttonShift` 2.25 em, `imageScale` 1.04 y `parallax` true. Los grupos mantienen el easing `expo.out` de `cascade`; la curva de referencia se aplica a títulos, CTA e imágenes. La entrada se reproduce una vez. `reset()` permite repetirla manualmente.
32
+
33
+ Marca un marco opcional con `[data-mk-editorial-image]` y su hijo con `[data-mk-parallax-target]` para un parallax de intensidad .25. El header observa únicamente las secciones de su propia instancia. El estado de tarjeta se activa tanto con puntero como con foco; el cursor es decorativo, se oculta en touch y con movimiento reducido, y nunca sustituye al cursor del sistema. Sin JavaScript el contenido sigue visible.
34
+
35
+ Con movimiento reducido el título queda entero, las entradas no ocultan campos y las interacciones conservan sus estados sin desplazamiento. `destroy()` es idempotente y restaura atributos/estilos propios y los helpers. El formulario, navegación y assets son responsabilidad de quien compone el contenido.