@yewdiel21/motion-kit 0.9.0 → 0.10.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 (399) hide show
  1. package/NOTICE +3 -35
  2. package/README.md +93 -81
  3. package/dist/auto/index.d.ts +22 -3
  4. package/dist/auto/index.js +43 -5
  5. package/dist/auto/index.js.map +1 -1
  6. package/dist/{chunk-KLY5BRRI.js → chunk-34EZ7DF4.js} +1 -1
  7. package/dist/chunk-34EZ7DF4.js.map +1 -0
  8. package/dist/{chunk-RFDIZYFX.js → chunk-DOOMULVV.js} +20 -20
  9. package/dist/chunk-DOOMULVV.js.map +1 -0
  10. package/dist/{chunk-ABNRDDO7.js → chunk-I3DXF2KQ.js} +2 -2
  11. package/dist/{chunk-Q4LVFNLN.js → chunk-IKQ5FODN.js} +4 -4
  12. package/dist/chunk-IKQ5FODN.js.map +1 -0
  13. package/dist/{chunk-2BQGFOA7.js → chunk-J6OCFNGU.js} +2 -2
  14. package/dist/chunk-J6OCFNGU.js.map +1 -0
  15. package/dist/{chunk-6OJAP6ZL.js → chunk-QFBOHPWZ.js} +3 -3
  16. package/dist/chunk-QFBOHPWZ.js.map +1 -0
  17. package/dist/{chunk-J27KH2A2.js → chunk-RVSKEBIC.js} +1 -1
  18. package/dist/chunk-RVSKEBIC.js.map +1 -0
  19. package/dist/{chunk-34XYOXHG.js → chunk-TFNRIZHU.js} +1615 -12
  20. package/dist/chunk-TFNRIZHU.js.map +1 -0
  21. package/dist/{chunk-FS2HJVVY.js → chunk-XAKC2QY7.js} +1204 -5
  22. package/dist/chunk-XAKC2QY7.js.map +1 -0
  23. package/dist/css/components/calendar.css +159 -0
  24. package/dist/css/components/chat-background.css +2 -2
  25. package/dist/css/components/chat.css +1 -1
  26. package/dist/css/components/cursor.css +3 -3
  27. package/dist/css/components/dialog.css +3 -3
  28. package/dist/css/components/hover-card.css +14 -0
  29. package/dist/css/components/input-otp.css +10 -0
  30. package/dist/css/components/island.css +1 -1
  31. package/dist/css/components/menu.css +1 -1
  32. package/dist/css/components/nav.css +1 -5
  33. package/dist/css/components/pagination.css +11 -0
  34. package/dist/css/components/quantity.css +16 -0
  35. package/dist/css/components/slot-picker.css +126 -0
  36. package/dist/css/components/steps.css +2 -2
  37. package/dist/css/components/studio-dock.css +35 -0
  38. package/dist/css/components/theme-picker.css +1 -1
  39. package/dist/css/components/toast.css +1 -1
  40. package/dist/css/components/trailer.css +37 -0
  41. package/dist/css/controls.css +78 -13
  42. package/dist/css/effects.css +8 -8
  43. package/dist/css/fonts.css +1 -1
  44. package/dist/css/themes/black-green.css +1 -1
  45. package/dist/css/themes/black.css +1 -1
  46. package/dist/css/themes/blue.css +1 -1
  47. package/dist/css/themes/brown.css +1 -1
  48. package/dist/css/themes/cold-blue.css +1 -1
  49. package/dist/css/themes/funny.css +1 -1
  50. package/dist/css/themes/gray.css +1 -1
  51. package/dist/css/themes/green.css +1 -1
  52. package/dist/css/themes/modern-1.css +1 -1
  53. package/dist/css/themes/neogreen.css +1 -1
  54. package/dist/css/themes/new.css +1 -1
  55. package/dist/css/themes/new2.css +1 -1
  56. package/dist/css/themes/oled.css +1 -1
  57. package/dist/css/themes/orange.css +1 -1
  58. package/dist/css/themes/pastel-pink.css +1 -1
  59. package/dist/css/themes/pink.css +1 -1
  60. package/dist/css/themes/purple.css +1 -1
  61. package/dist/css/themes/red.css +1 -1
  62. package/dist/css/themes/super-blue.css +1 -1
  63. package/dist/css/themes.css +19 -19
  64. package/dist/css/tokens.css +9 -9
  65. package/dist/elements/index.d.ts +75 -7
  66. package/dist/elements/index.js +172 -6
  67. package/dist/elements/index.js.map +1 -1
  68. package/dist/{engine-CUr9QijM.d.ts → engine-GDGwQnJE.d.ts} +2 -2
  69. package/dist/gl/index.js +3 -3
  70. package/dist/index.css +1076 -63
  71. package/dist/index.d.ts +17 -17
  72. package/dist/index.js +49 -7
  73. package/dist/index.js.map +1 -1
  74. package/dist/react/index.d.ts +139 -40
  75. package/dist/react/index.js +355 -8
  76. package/dist/react/index.js.map +1 -1
  77. package/dist/{reduced-BM4Ls0g5.d.ts → reduced-BmBzKH94.d.ts} +215 -18
  78. package/dist/{reveal-WFUWDrei.d.ts → reveal-jsX-uwUz.d.ts} +233 -24
  79. package/dist/{store-Bqy_obnD.d.ts → store-DYb3tTsZ.d.ts} +5 -5
  80. package/dist/theme/generate.d.ts +1 -1
  81. package/dist/theme/generate.js +2 -2
  82. package/dist/theme/generate.js.map +1 -1
  83. package/dist/theme/index.d.ts +2 -2
  84. package/dist/theme/index.js +2 -2
  85. package/dist/{theme-BFMoCzi6.d.ts → theme-Bjf9qIIy.d.ts} +1 -1
  86. package/package.json +2 -2
  87. package/registry.json +230 -156
  88. package/skills/motion-kit/SKILL.md +209 -189
  89. package/skills/motion-kit/reference/components.md +5 -5
  90. package/skills/motion-kit/reference/design.md +14 -14
  91. package/skills/motion-kit/reference/recipes.md +48 -49
  92. package/src/auto/auto-init.ts +38 -0
  93. package/src/components/calendar/README.md +82 -0
  94. package/src/components/calendar/calendar.css +158 -0
  95. package/src/components/calendar/element.ts +27 -0
  96. package/src/components/calendar/engine.ts +412 -0
  97. package/src/components/calendar/react.tsx +69 -0
  98. package/src/components/chat/README.md +1 -3
  99. package/src/components/chat/chat.css +1 -1
  100. package/src/components/chat/engine.ts +1 -1
  101. package/src/components/chat/react.tsx +1 -1
  102. package/src/components/chat-background/README.md +1 -3
  103. package/src/components/chat-background/audio.ts +1 -1
  104. package/src/components/chat-background/chat-background.css +2 -2
  105. package/src/components/chat-background/engine.ts +1 -1
  106. package/src/components/chat-background/react.tsx +1 -1
  107. package/src/components/cursor/README.md +3 -5
  108. package/src/components/cursor/cursor.css +3 -3
  109. package/src/components/cursor/element.ts +2 -2
  110. package/src/components/cursor/engine.ts +5 -5
  111. package/src/components/cursor/react.tsx +1 -1
  112. package/src/components/dialog/README.md +4 -8
  113. package/src/components/dialog/dialog.css +3 -3
  114. package/src/components/dialog/engine.ts +2 -2
  115. package/src/components/dialog/react.tsx +1 -1
  116. package/src/components/hover-card/README.md +16 -0
  117. package/src/components/hover-card/element.ts +8 -0
  118. package/src/components/hover-card/engine.ts +69 -0
  119. package/src/components/hover-card/hover-card.css +13 -0
  120. package/src/components/hover-card/react.tsx +19 -0
  121. package/src/components/input-otp/README.md +18 -0
  122. package/src/components/input-otp/element.ts +14 -0
  123. package/src/components/input-otp/engine.ts +106 -0
  124. package/src/components/input-otp/input-otp.css +9 -0
  125. package/src/components/input-otp/react.tsx +21 -0
  126. package/src/components/island/README.md +7 -7
  127. package/src/components/island/engine.ts +3 -3
  128. package/src/components/island/island.css +1 -1
  129. package/src/components/island/react.tsx +3 -3
  130. package/src/components/menu/README.md +2 -4
  131. package/src/components/menu/engine.ts +1 -1
  132. package/src/components/menu/menu.css +1 -1
  133. package/src/components/menu/react.tsx +1 -1
  134. package/src/components/nav/README.md +12 -14
  135. package/src/components/nav/engine.ts +5 -5
  136. package/src/components/nav/nav.css +1 -5
  137. package/src/components/nav/react.tsx +3 -3
  138. package/src/components/pagination/README.md +17 -0
  139. package/src/components/pagination/element.ts +14 -0
  140. package/src/components/pagination/engine.ts +102 -0
  141. package/src/components/pagination/pagination.css +10 -0
  142. package/src/components/pagination/react.tsx +22 -0
  143. package/src/components/quantity/README.md +20 -0
  144. package/src/components/quantity/element.ts +14 -0
  145. package/src/components/quantity/engine.ts +85 -0
  146. package/src/components/quantity/quantity.css +15 -0
  147. package/src/components/quantity/react.tsx +21 -0
  148. package/src/components/slot-picker/README.md +68 -0
  149. package/src/components/slot-picker/element.ts +27 -0
  150. package/src/components/slot-picker/engine.ts +412 -0
  151. package/src/components/slot-picker/react.tsx +76 -0
  152. package/src/components/slot-picker/slot-picker.css +125 -0
  153. package/src/components/steps/README.md +1 -3
  154. package/src/components/steps/engine.ts +3 -3
  155. package/src/components/steps/react.tsx +2 -2
  156. package/src/components/steps/steps.css +2 -2
  157. package/src/components/studio-dock/README.md +44 -0
  158. package/src/components/studio-dock/element.ts +11 -0
  159. package/src/components/studio-dock/engine.ts +212 -0
  160. package/src/components/studio-dock/react.tsx +23 -0
  161. package/src/components/studio-dock/studio-dock.css +34 -0
  162. package/src/components/theme-picker/README.md +3 -5
  163. package/src/components/theme-picker/engine.ts +2 -2
  164. package/src/components/theme-picker/react.tsx +1 -1
  165. package/src/components/theme-picker/theme-picker.css +1 -1
  166. package/src/components/toast/README.md +1 -3
  167. package/src/components/toast/engine.ts +2 -2
  168. package/src/components/toast/react.tsx +1 -1
  169. package/src/components/toast/store.ts +1 -2
  170. package/src/components/toast/toast.css +1 -1
  171. package/src/components/trailer/README.md +28 -0
  172. package/src/components/trailer/element.ts +13 -0
  173. package/src/components/trailer/engine.ts +189 -0
  174. package/src/components/trailer/react.tsx +16 -0
  175. package/src/components/trailer/trailer.css +36 -0
  176. package/src/core/channels.ts +3 -3
  177. package/src/core/curves.ts +3 -3
  178. package/src/core/dates.ts +98 -0
  179. package/src/core/gsap.ts +2 -2
  180. package/src/core/loop.ts +1 -1
  181. package/src/core/math.ts +1 -1
  182. package/src/core/physics-spring.ts +2 -2
  183. package/src/core/scroll-track.ts +2 -4
  184. package/src/core/spring.ts +1 -1
  185. package/src/core/timing.ts +21 -22
  186. package/src/css/controls/README.md +24 -20
  187. package/src/css/controls/burger.css +1 -1
  188. package/src/css/controls/button.css +4 -4
  189. package/src/css/controls/checkbox.css +1 -1
  190. package/src/css/controls/chip.css +1 -1
  191. package/src/css/controls/field.css +2 -2
  192. package/src/css/controls/glass.css +4 -4
  193. package/src/css/controls/status.css +63 -0
  194. package/src/css/default-theme.css +1 -1
  195. package/src/css/effects/README.md +19 -21
  196. package/src/css/effects/anim.css +1 -1
  197. package/src/css/effects/fade.css +1 -1
  198. package/src/css/effects/float.css +1 -1
  199. package/src/css/effects/frost.css +1 -1
  200. package/src/css/effects/grain.css +1 -1
  201. package/src/css/effects/loading.css +1 -1
  202. package/src/css/effects/success.css +1 -1
  203. package/src/css/effects/text.css +1 -1
  204. package/src/css/fonts.css +1 -1
  205. package/src/css/states.css +1 -1
  206. package/src/css/themes/black-green.css +1 -1
  207. package/src/css/themes/black.css +1 -1
  208. package/src/css/themes/blue.css +1 -1
  209. package/src/css/themes/brown.css +1 -1
  210. package/src/css/themes/cold-blue.css +1 -1
  211. package/src/css/themes/funny.css +1 -1
  212. package/src/css/themes/gray.css +1 -1
  213. package/src/css/themes/green.css +1 -1
  214. package/src/css/themes/modern-1.css +1 -1
  215. package/src/css/themes/neogreen.css +1 -1
  216. package/src/css/themes/new.css +1 -1
  217. package/src/css/themes/new2.css +1 -1
  218. package/src/css/themes/oled.css +1 -1
  219. package/src/css/themes/orange.css +1 -1
  220. package/src/css/themes/pastel-pink.css +1 -1
  221. package/src/css/themes/pink.css +1 -1
  222. package/src/css/themes/purple.css +1 -1
  223. package/src/css/themes/red.css +1 -1
  224. package/src/css/themes/super-blue.css +1 -1
  225. package/src/css/tokens.css +8 -8
  226. package/src/elements/index.ts +24 -0
  227. package/src/gl/liquid-blend/README.md +3 -3
  228. package/src/gl/matcap/README.md +3 -3
  229. package/src/gl/particle-hero/README.md +1 -1
  230. package/src/gl/particle-hero/create-particle-hero.ts +3 -5
  231. package/src/gl/particle-hero/shaders.ts +1 -1
  232. package/src/gl/shader-blur/README.md +3 -3
  233. package/src/gl/shader-grain/README.md +3 -3
  234. package/src/index.ts +25 -0
  235. package/src/motion/chat.ts +2 -2
  236. package/src/motion/confetti.ts +1 -1
  237. package/src/motion/count.ts +1 -1
  238. package/src/motion/details.ts +1 -1
  239. package/src/motion/drag-dismiss.ts +1 -1
  240. package/src/motion/effects.ts +1 -1
  241. package/src/motion/entrances.ts +1 -1
  242. package/src/motion/floating.ts +1 -1
  243. package/src/motion/flow.ts +2 -2
  244. package/src/motion/indicator.ts +1 -1
  245. package/src/motion/layout.ts +1 -1
  246. package/src/motion/liquid.ts +1 -1
  247. package/src/motion/morph.ts +2 -2
  248. package/src/motion/reveal.ts +1 -1
  249. package/src/motion/sheet.ts +1 -1
  250. package/src/motion/surface.ts +1 -1
  251. package/src/react/animated-number.tsx +2 -2
  252. package/src/react/flip-group.tsx +1 -1
  253. package/src/react/frost.tsx +1 -1
  254. package/src/react/index.ts +21 -0
  255. package/src/react/slot-text.tsx +1 -1
  256. package/src/react/use-action-button.ts +6 -0
  257. package/src/react/use-card-dock.ts +1 -1
  258. package/src/react/use-cascade.ts +1 -1
  259. package/src/react/use-contrast.ts +1 -1
  260. package/src/react/use-depth-grid.ts +1 -1
  261. package/src/react/use-editorial-reveal.ts +7 -0
  262. package/src/react/use-fill-text.ts +1 -1
  263. package/src/react/use-film-hero.ts +6 -0
  264. package/src/react/use-font-cycle.ts +7 -0
  265. package/src/react/use-frame-zoom.ts +1 -1
  266. package/src/react/use-image-zoom.ts +5 -0
  267. package/src/react/use-joined-cta.ts +5 -0
  268. package/src/react/use-letters.ts +1 -1
  269. package/src/react/use-local-clock.ts +5 -0
  270. package/src/react/use-marquee.ts +1 -1
  271. package/src/react/use-mask-text.ts +1 -1
  272. package/src/react/use-parallax.ts +1 -1
  273. package/src/react/use-particle-hero.ts +1 -1
  274. package/src/react/use-scroll-dock.ts +5 -0
  275. package/src/react/use-snap-strip.ts +1 -1
  276. package/src/react/use-sticker.ts +5 -0
  277. package/src/react/use-studio-dock.ts +8 -0
  278. package/src/react/use-text-roll.ts +1 -1
  279. package/src/react/use-thumbnail-nav.ts +7 -0
  280. package/src/react/use-trailer.ts +6 -0
  281. package/src/react/use-weight-hover.ts +5 -0
  282. package/src/recipes/action-button/README.md +31 -0
  283. package/src/recipes/action-button/action-button.css +113 -0
  284. package/src/recipes/action-button/create-action-button.ts +56 -0
  285. package/src/recipes/card-dock/README.md +1 -1
  286. package/src/recipes/card-dock/card-dock.css +1 -1
  287. package/src/recipes/card-dock/create-card-dock.ts +2 -2
  288. package/src/recipes/cascade/README.md +1 -3
  289. package/src/recipes/cascade/create-cascade.ts +3 -3
  290. package/src/recipes/contrast/README.md +0 -2
  291. package/src/recipes/contrast/create-contrast.ts +1 -1
  292. package/src/recipes/counter/README.md +0 -2
  293. package/src/recipes/counter/create-counter.ts +1 -1
  294. package/src/recipes/curved-carousel/README.md +0 -2
  295. package/src/recipes/curved-carousel/create-curved-carousel.ts +2 -2
  296. package/src/recipes/curved-carousel/curved-carousel.css +1 -1
  297. package/src/recipes/depth-grid/README.md +0 -2
  298. package/src/recipes/depth-grid/create-depth-grid.ts +3 -4
  299. package/src/recipes/details/README.md +0 -2
  300. package/src/recipes/details/create-details.ts +1 -1
  301. package/src/recipes/dock-pill/README.md +3 -3
  302. package/src/recipes/drag-ruler/README.md +3 -3
  303. package/src/recipes/editorial-reveal/README.md +35 -0
  304. package/src/recipes/editorial-reveal/create-editorial-reveal.ts +91 -0
  305. package/src/recipes/editorial-reveal/editorial-reveal.css +17 -0
  306. package/src/recipes/fill-text/README.md +1 -1
  307. package/src/recipes/fill-text/create-fill-text.ts +1 -1
  308. package/src/recipes/film-hero/README.md +23 -0
  309. package/src/recipes/film-hero/create-film-hero.ts +65 -0
  310. package/src/recipes/film-hero/film-hero.css +29 -0
  311. package/src/recipes/fit-text/README.md +0 -2
  312. package/src/recipes/flow/README.md +0 -2
  313. package/src/recipes/flow/create-flow.ts +1 -1
  314. package/src/recipes/font-cycle/README.md +11 -0
  315. package/src/recipes/font-cycle/create-font-cycle.ts +126 -0
  316. package/src/recipes/font-cycle/font-cycle.css +36 -0
  317. package/src/recipes/frame-zoom/README.md +1 -3
  318. package/src/recipes/frame-zoom/create-frame-zoom.ts +2 -2
  319. package/src/recipes/image-zoom/README.md +16 -0
  320. package/src/recipes/image-zoom/create-image-zoom.ts +27 -0
  321. package/src/recipes/image-zoom/image-zoom.css +7 -0
  322. package/src/recipes/infinite-reel/README.md +3 -3
  323. package/src/recipes/joined-cta/README.md +13 -0
  324. package/src/recipes/joined-cta/create-joined-cta.ts +22 -0
  325. package/src/recipes/joined-cta/joined-cta.css +17 -0
  326. package/src/recipes/letters/README.md +2 -4
  327. package/src/recipes/letters/create-letters.ts +3 -3
  328. package/src/recipes/local-clock/README.md +31 -0
  329. package/src/recipes/local-clock/create-local-clock.ts +61 -0
  330. package/src/recipes/marquee/README.md +0 -2
  331. package/src/recipes/marquee/create-marquee.ts +3 -3
  332. package/src/recipes/marquee/marquee.css +1 -1
  333. package/src/recipes/mask-text/README.md +3 -5
  334. package/src/recipes/mask-text/create-mask-text.ts +4 -4
  335. package/src/recipes/parallax/README.md +1 -3
  336. package/src/recipes/parallax/create-parallax.ts +1 -1
  337. package/src/recipes/pile/README.md +0 -2
  338. package/src/recipes/pile/create-pile.ts +1 -1
  339. package/src/recipes/pile/pile-math.ts +1 -1
  340. package/src/recipes/pile/pile.css +1 -1
  341. package/src/recipes/pill/README.md +0 -2
  342. package/src/recipes/pill/pill.css +2 -2
  343. package/src/recipes/pop/README.md +0 -2
  344. package/src/recipes/pop/create-pop.ts +1 -1
  345. package/src/recipes/radial-menu/README.md +0 -2
  346. package/src/recipes/radial-menu/create-radial-menu.ts +1 -1
  347. package/src/recipes/radial-menu/radial-menu.css +1 -1
  348. package/src/recipes/reflow/README.md +3 -5
  349. package/src/recipes/reflow/create-reflow.ts +1 -1
  350. package/src/recipes/repel-bento/README.md +3 -3
  351. package/src/recipes/reveal/README.md +0 -2
  352. package/src/recipes/reveal/create-reveal.ts +1 -1
  353. package/src/recipes/rotator/README.md +3 -3
  354. package/src/recipes/scroll-dock/README.md +46 -0
  355. package/src/recipes/scroll-dock/create-scroll-dock.ts +72 -0
  356. package/src/recipes/scroll-dock/scroll-dock.css +70 -0
  357. package/src/recipes/slot-text/README.md +0 -2
  358. package/src/recipes/slot-text/create-slot-text.ts +1 -1
  359. package/src/recipes/snap-strip/README.md +1 -1
  360. package/src/recipes/snap-strip/create-snap-strip.ts +5 -6
  361. package/src/recipes/snap-strip/snap-strip.css +1 -1
  362. package/src/recipes/sortable/README.md +3 -5
  363. package/src/recipes/sortable/create-sortable.ts +4 -4
  364. package/src/recipes/sortable/sortable.css +1 -1
  365. package/src/recipes/spring-cards/README.md +0 -2
  366. package/src/recipes/spring-cards/create-spring-cards.ts +1 -1
  367. package/src/recipes/spring-cards/spring-cards.css +1 -1
  368. package/src/recipes/sticker/README.md +59 -0
  369. package/src/recipes/sticker/create-sticker.ts +490 -0
  370. package/src/recipes/sticker/sticker.css +112 -0
  371. package/src/recipes/stretch-footer/README.md +0 -2
  372. package/src/recipes/stretch-footer/create-stretch-footer.ts +1 -1
  373. package/src/recipes/stretch-footer/stretch-footer.css +1 -1
  374. package/src/recipes/tabs/README.md +0 -2
  375. package/src/recipes/tabs/create-tabs.ts +1 -1
  376. package/src/recipes/text-roll/README.md +1 -3
  377. package/src/recipes/text-roll/create-text-roll.ts +3 -3
  378. package/src/recipes/text-roll/text-roll.css +1 -1
  379. package/src/recipes/thumbnail-nav/README.md +16 -0
  380. package/src/recipes/thumbnail-nav/create-thumbnail-nav.ts +165 -0
  381. package/src/recipes/thumbnail-nav/thumbnail-nav.css +108 -0
  382. package/src/recipes/ticket-menu/README.md +3 -3
  383. package/src/recipes/weight-hover/README.md +37 -0
  384. package/src/recipes/weight-hover/create-weight-hover.ts +136 -0
  385. package/src/recipes/weight-hover/weight-hover.css +7 -0
  386. package/src/recipes/words/README.md +0 -2
  387. package/src/recipes/words/create-words.ts +1 -1
  388. package/src/theme/generate.ts +1 -1
  389. package/src/theme/presets.ts +2 -2
  390. package/src/theme/theme.ts +1 -2
  391. package/dist/chunk-2BQGFOA7.js.map +0 -1
  392. package/dist/chunk-34XYOXHG.js.map +0 -1
  393. package/dist/chunk-6OJAP6ZL.js.map +0 -1
  394. package/dist/chunk-FS2HJVVY.js.map +0 -1
  395. package/dist/chunk-J27KH2A2.js.map +0 -1
  396. package/dist/chunk-KLY5BRRI.js.map +0 -1
  397. package/dist/chunk-Q4LVFNLN.js.map +0 -1
  398. package/dist/chunk-RFDIZYFX.js.map +0 -1
  399. /package/dist/{chunk-ABNRDDO7.js.map → chunk-I3DXF2KQ.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- export { D as DialogInstance, a as DialogLabels, b as DialogOptions, c as DialogPlacement, d as DialogVariant, M as MenuInstance, e as MenuOptions, R as RevealHandle, f as RevealOptions, g as RevealSpeed, T as TIMING, h as createDialog, i as createMenu, r as revealFrom } from './reveal-WFUWDrei.js';
2
- export { H as CardDockInstance, I as CardDockOptions, J as CascadeInstance, K as CascadeOptions, L as ContrastInstance, N as ContrastOptions, O as CounterInstance, P as CounterOptions, C as CurvedCarouselInstance, Q as CurvedCarouselOptions, R as DepthGridInstance, S as DepthGridOptions, U as DockPillInstance, V as DockPillOptions, W as DragRulerInstance, X as DragRulerOptions, Y as FillTextInstance, Z as FillTextOptions, _ as FitTextInstance, $ as FitTextOptions, a0 as FlowInOptions, a1 as FlowInstance, a2 as FlowOptions, a3 as FlowOutOptions, a4 as FrameZoomInstance, a5 as FrameZoomOptions, a6 as InfiniteReelInstance, a7 as InfiniteReelOptions, a8 as LettersInstance, a9 as LettersOptions, M as MK_HEAD_SCRIPT, aa as MarqueeInstance, ab as MarqueeOptions, ac as MaskTextInstance, ad as MaskTextOptions, ae as ParallaxInstance, af as ParallaxOptions, ag as PileInstance, ah as PileLayer, ai as PileOptions, aj as PopInstance, ak as PopOptions, al as RadialMenuInstance, am as RadialMenuOptions, an as ReflowInstance, ao as ReflowOptions, ap as ReorderDetail, aq as RepelBentoInstance, ar as RepelBentoOptions, as as RevealInstance, at as RevealRecipeOptions, au as RotatorInstance, av as RotatorOptions, aw as SlotTextInstance, ax as SlotTextOptions, ay as SnapStripInstance, az as SnapStripOptions, aA as SortableInstance, aB as SortableLabels, aC as SortableOptions, aD as SpringCardsInstance, aE as SpringCardsOptions, aF as StretchFooterInstance, aG as StretchFooterOptions, aH as TabsInstance, aI as TabsOptions, aJ as TextRollInstance, aK as TextRollOptions, A as TicketMenuInstance, T as TicketMenuOptions, aL as WordsInstance, aM as WordsOptions, x as createCardDock, p as createCascade, v as createContrast, j as createCounter, aN as createCurvedCarousel, t as createDepthGrid, G as createDockPill, F as createDragRuler, z as createFillText, f as createFitText, d as createFlow, u as createFrameZoom, B as createInfiniteReel, r as createLetters, w as createMarquee, o as createMaskText, s as createParallax, a as createPile, e as createPop, h as createRadialMenu, l as createReflow, D as createRepelBento, k as createReveal, E as createRotator, m as createSlotText, y as createSnapStrip, n as createSortable, c as createSpringCards, g as createStretchFooter, i as createTabs, q as createTextRoll, aO as createTicketMenu, b as createWords, aP as entrances, aQ as flowIn, aR as flowOut, aS as moveItem, aT as pileLayers, aU as pileStyle, aV as reduced, aW as stepChange } from './reduced-BM4Ls0g5.js';
1
+ export { k as CalendarEvent, l as CalendarEventStatus, C as CalendarInstance, m as CalendarLabels, n as CalendarOptions, o as CalendarRange, p as CalendarView, q as DateInput, D as DialogInstance, r as DialogLabels, s as DialogOptions, t as DialogPlacement, u as DialogVariant, H as HoverCardInstance, v as HoverCardOptions, I as InputOtpInstance, w as InputOtpOptions, M as MenuInstance, x as MenuOptions, P as PaginationInstance, y as PaginationOptions, Q as QuantityInstance, z as QuantityOptions, R as RevealHandle, A as RevealOptions, B as RevealSpeed, j as SlotPickerInstance, E as SlotPickerLabels, F as SlotPickerOptions, G as SlotSource, J as SlotValue, S as StudioDockInstance, K as StudioDockOptions, L as StudioDockState, i as StudioDockView, N as TIMING, T as TrailerInstance, O as TrailerOptions, g as createCalendar, U as createDialog, e as createHoverCard, f as createInputOtp, V as createMenu, d as createPagination, b as createQuantity, h as createSlotPicker, c as createStudioDock, a as createTrailer, W as dayKey, X as revealFrom, Y as toDate } from './reveal-jsX-uwUz.js';
2
+ export { U as ActionButtonInstance, V as ActionButtonOptions, W as ActionButtonVariant, X as CardDockInstance, Y as CardDockOptions, Z as CascadeInstance, _ as CascadeOptions, $ as ContrastInstance, a0 as ContrastOptions, a1 as CounterInstance, a2 as CounterOptions, C as CurvedCarouselInstance, a3 as CurvedCarouselOptions, a4 as DepthGridInstance, a5 as DepthGridOptions, a6 as DockPillInstance, a7 as DockPillOptions, a8 as DragRulerInstance, a9 as DragRulerOptions, aa as EditorialRevealInstance, ab as EditorialRevealOptions, ac as FillTextInstance, ad as FillTextOptions, ae as FilmHeroInstance, af as FilmHeroOptions, ag as FitTextInstance, ah as FitTextOptions, ai as FlowInOptions, aj as FlowInstance, ak as FlowOptions, al as FlowOutOptions, am as FontCycleFace, an as FontCycleInstance, ao as FontCycleOptions, ap as FrameZoomInstance, aq as FrameZoomOptions, ar as ImageZoomInstance, as as ImageZoomOptions, at as InfiniteReelInstance, au as InfiniteReelOptions, av as JoinedCtaInstance, aw as JoinedCtaOptions, ax as LettersInstance, ay as LettersOptions, az as LocalClockInstance, aA as LocalClockOptions, S as MK_HEAD_SCRIPT, aB as MarqueeInstance, aC as MarqueeOptions, aD as MaskTextInstance, aE as MaskTextOptions, aF as ParallaxInstance, aG as ParallaxOptions, aH as PileInstance, aI as PileLayer, aJ as PileOptions, aK as PopInstance, aL as PopOptions, aM as RadialMenuInstance, aN as RadialMenuOptions, aO as ReflowInstance, aP as ReflowOptions, aQ as ReorderDetail, aR as RepelBentoInstance, aS as RepelBentoOptions, aT as RevealInstance, aU as RevealRecipeOptions, aV as RotatorInstance, aW as RotatorOptions, aX as ScrollDockInstance, aY as ScrollDockOptions, aZ as SlotTextInstance, a_ as SlotTextOptions, a$ as SnapStripInstance, b0 as SnapStripOptions, b1 as SortableInstance, b2 as SortableLabels, b3 as SortableOptions, b4 as SpringCardsInstance, b5 as SpringCardsOptions, b6 as StickerInstance, b7 as StickerOptions, b8 as StickerState, b9 as StretchFooterInstance, ba as StretchFooterOptions, bb as TabsInstance, bc as TabsOptions, bd as TextRollInstance, be as TextRollOptions, bf as ThumbnailNavInstance, bg as ThumbnailNavOptions, M as TicketMenuInstance, T as TicketMenuOptions, bh as WeightHoverInstance, bi as WeightHoverOptions, bj as WordsInstance, bk as WordsOptions, e as createActionButton, J as createCardDock, A as createCascade, H as createContrast, u as createCounter, bl as createCurvedCarousel, F as createDepthGrid, R as createDockPill, Q as createDragRuler, g as createEditorialReveal, L as createFillText, f as createFilmHero, q as createFitText, o as createFlow, b as createFontCycle, G as createFrameZoom, a as createImageZoom, N as createInfiniteReel, c as createJoinedCta, D as createLetters, k as createLocalClock, I as createMarquee, z as createMaskText, E as createParallax, m as createPile, p as createPop, s as createRadialMenu, w as createReflow, O as createRepelBento, v as createReveal, P as createRotator, j as createScrollDock, x as createSlotText, K as createSnapStrip, y as createSortable, l as createSpringCards, i as createSticker, r as createStretchFooter, t as createTabs, B as createTextRoll, d as createThumbnailNav, bm as createTicketMenu, h as createWeightHover, n as createWords, bn as entrances, bo as flowIn, bp as flowOut, bq as moveItem, br as pileLayers, bs as pileStyle, bt as reduced, bu as stepChange } from './reduced-BmBzKH94.js';
3
3
  export { A as ANIMATIONS, a as AnimateOptions, b as AnimationName, C as CapturedLayout, c as ConfettiHandle, d as ConfettiOptions, E as ExitName, L as LeaveOptions, e as animate, f as captureLayout, g as confetti, l as leave, r as reflowLayout } from './confetti-BSX1CLLV.js';
4
4
  import { C as Cleanup, I as Instance } from './types-BkS_raL8.js';
5
- export { C as ChatInstance, e as ChatLabels, f as ChatOptions, b as ChatRole, d as CursorInstance, g as CursorOptions, h as CursorVariant, I as IslandInstance, i as IslandOptions, j as NAV_STYLES, N as NavInstance, k as NavOptions, c as NavStyle, l as NavigateDetail, P as PENDING_ID, m as TOAST_LIMIT, T as ThemePickerInstance, n as ThemePickerOptions, o as ToastAction, p as ToastItem, q as ToastOptions, r as ToastTone, a as ToasterInstance, s as ToasterLabels, u as ToasterOptions, v as capturePending, w as chatMessage, x as clearToasts, y as createChat, z as createCursor, A as createIsland, B as createNav, D as createThemePicker, E as createToaster, F as dismissToast, G as getToasts, H as morphPendingToReply, J as removeToast, K as revealShell, L as subscribeToasts, t as toast, M as toastTimers } from './store-Bqy_obnD.js';
6
- export { C as ChatBackgroundInstance, a as ChatBackgroundOptions, b as StepDetail, S as StepsInstance, c as StepsOptions, d as chatBackgroundOf, e as createChatBackground, f as createSteps } from './engine-CUr9QijM.js';
5
+ export { C as ChatInstance, e as ChatLabels, f as ChatOptions, b as ChatRole, d as CursorInstance, g as CursorOptions, h as CursorVariant, I as IslandInstance, i as IslandOptions, j as NAV_STYLES, N as NavInstance, k as NavOptions, c as NavStyle, l as NavigateDetail, P as PENDING_ID, m as TOAST_LIMIT, T as ThemePickerInstance, n as ThemePickerOptions, o as ToastAction, p as ToastItem, q as ToastOptions, r as ToastTone, a as ToasterInstance, s as ToasterLabels, u as ToasterOptions, v as capturePending, w as chatMessage, x as clearToasts, y as createChat, z as createCursor, A as createIsland, B as createNav, D as createThemePicker, E as createToaster, F as dismissToast, G as getToasts, H as morphPendingToReply, J as removeToast, K as revealShell, L as subscribeToasts, t as toast, M as toastTimers } from './store-DYb3tTsZ.js';
6
+ export { C as ChatBackgroundInstance, a as ChatBackgroundOptions, b as StepDetail, S as StepsInstance, c as StepsOptions, d as chatBackgroundOf, e as createChatBackground, f as createSteps } from './engine-GDGwQnJE.js';
7
7
  export { CustomEase } from 'gsap/CustomEase';
8
8
  export { Flip } from 'gsap/Flip';
9
9
  export { ScrollTrigger } from 'gsap/ScrollTrigger';
10
10
  export { SplitText } from 'gsap/SplitText';
11
11
  export { gsap } from 'gsap';
12
12
 
13
- /** Spencer's elastic overshoot; close to the `--mk-ease-elastic` CSS curve. */
13
+ /** elastic overshoot; close to the `--mk-ease-elastic` CSS curve. */
14
14
  declare const ELASTIC = "elastic.out(1, 0.45)";
15
- /** Custom eases registered by `registerMotion()` (Stepbro curves). Use the names as GSAP `ease` values. */
15
+ /** Custom eases registered by `registerMotion()`. Use the names as GSAP `ease` values. */
16
16
  declare const EASE: {
17
17
  readonly signature: "mk-signature";
18
18
  readonly flow: "mk-flow";
@@ -37,7 +37,7 @@ declare const EASE: {
37
37
  /** Register plugins and eases once. Safe to call from every recipe and during SSR (no-op). */
38
38
  declare function registerMotion(): void;
39
39
 
40
- /** Stepbro's curve paths (CustomEase SVG syntax). */
40
+ /** curve paths (CustomEase SVG syntax). */
41
41
  declare const PATHS: {
42
42
  /** The signature: a strong deceleration that is not a plain ease-out. */
43
43
  readonly signature: "M0,0 C0.308,0.19 0.107,0.633 0.288,0.866 0.382,0.987 0.656,1 1,1";
@@ -47,18 +47,18 @@ declare const PATHS: {
47
47
  readonly chatScroll: "M0,0 C0.308,0.19 0.318,0.567 0.5,0.8 0.593,0.921 0.656,1 1,1";
48
48
  };
49
49
  /**
50
- * A damped spring sampled as an ease path (Stepbro's `FA`): `ratio` below 1
50
+ * A damped spring sampled as an ease path: `ratio` below 1
51
51
  * overshoots and settles, `velocity` is the starting speed.
52
52
  */
53
53
  declare function springPath(ratio: number, velocity?: number, steps?: number): string;
54
54
  /**
55
- * Stepbro's own linear() sampling of the signature curve (its backdrop tint),
55
+ * own linear() sampling of the signature curve (its backdrop tint),
56
56
  * for CSS and the Web Animations API.
57
57
  */
58
58
  declare const SIGNATURE_LINEAR = "linear(0 0%, .017 2.5%, .037 5%, .061 7.5%, .091 10%, .13 12.5%, .184 15%, .275 17.5%, .562 20%, .733 22.5%, .803 25%, .848 27.5%, .88 30%, .902 32.5%, .942 40%, .97 50%, .985 60%, .993 70%, .998 80%, 1 90%, 1 100%)";
59
59
 
60
60
  /**
61
- * Stepbro's per-property motion channels (ported from Kayro's spring-channels):
61
+ * per-property motion channels:
62
62
  * each value moves toward its target either on a spring (stiffness, damping, an
63
63
  * initial kick) or on an eased duration, all stepped on GSAP's ticker. Used by
64
64
  * surfaces that grow out of a control (liquid dialog, toasts) and floating windows.
@@ -87,7 +87,7 @@ interface ChannelState {
87
87
  declare const easeOut: (t: number) => number;
88
88
  declare const easeOutCubic: (t: number) => number;
89
89
  declare const easeInCubic: (t: number) => number;
90
- /** A cubic-bezier as a function of progress (Stepbro's `cr.bezier`). */
90
+ /** A cubic-bezier as a function of progress. */
91
91
  declare function bezier(x1: number, y1: number, x2: number, y2: number): (progress: number) => number;
92
92
  declare const spring: (stiffness: number, damping: number, extra?: {
93
93
  mass?: number;
@@ -105,7 +105,7 @@ declare function channels<K extends string>(start: Record<K, number>, onChange:
105
105
  animate(targets: Partial<Record<K, number>>, configs: Partial<Record<K, Channel>>): Promise<void>;
106
106
  stop(): void;
107
107
  };
108
- /** A damped spring as an ease function of progress (Stepbro's `Vw`). */
108
+ /** A damped spring as an ease function of progress. */
109
109
  declare function springEase(ratio: number, velocity?: number): (progress: number) => number;
110
110
 
111
111
  /**
@@ -228,12 +228,12 @@ interface EnterMessagesOptions {
228
228
  declare function enterMessages(bubbles: HTMLElement[], { textSelector }?: EnterMessagesOptions): gsap.core.Timeline | null;
229
229
  /** A message box grows or shrinks to its text (0.18 s, power2.out), from `min` px. */
230
230
  declare function fitComposer(field: HTMLTextAreaElement, min?: number): gsap.core.Tween | null;
231
- /** Scroll a conversation to its newest message (0.35 s, Stepbro's chat scroll curve). */
231
+ /** Scroll a conversation to its newest message. */
232
232
  declare function scrollToLatest(scroller: HTMLElement): gsap.core.Tween | null;
233
233
 
234
234
  /** Called every frame with dt = 1 at 60 Hz. */
235
235
  type Tick = (dt: number) => void;
236
- /** One shared ticker callback for every recipe (spencergabor.com's single rAF loop). */
236
+ /** One shared ticker callback for every recipe. */
237
237
  declare function subscribe(fn: Tick): () => void;
238
238
  /** Run `fn` every frame only while `el` is near the viewport. */
239
239
  declare function whileVisible(el: Element, fn: Tick, rootMargin?: string): () => void;
@@ -248,12 +248,12 @@ interface Spring {
248
248
  velocity: Vec;
249
249
  update(dt?: number): void;
250
250
  }
251
- /** Spencer Gabor's spring (stiffness .05, friction .8), normalised so dt = 1 is one 60 Hz frame. */
251
+ /** spring (stiffness .05, friction .8), normalised so dt = 1 is one 60 Hz frame. */
252
252
  declare function createSpring(stiffness?: number, friction?: number): Spring;
253
253
 
254
254
  declare const clamp: (v: number, min: number, max: number) => number;
255
255
  declare const lerp: (a: number, b: number, t: number) => number;
256
- /** Spencer's frame-rate independent smoothing: lerp by 1 - e^(-lambda·dt). */
256
+ /** frame-rate independent smoothing: lerp by 1 - e^(-lambda·dt). */
257
257
  declare const damp: (a: number, b: number, lambda: number, dt: number) => number;
258
258
  declare const wrap: (v: number, length: number) => number;
259
259
  declare function mapRange(v: number, inMin: number, inMax: number, outMin: number, outMax: number, clamped?: boolean): number;
@@ -306,7 +306,7 @@ type DialogLike = HTMLElement & Partial<Pick<HTMLDialogElement, 'showModal' | 's
306
306
  declare function openModal(dialog: DialogLike, modal?: boolean): void;
307
307
  declare function closeModal(dialog: DialogLike): void;
308
308
  /**
309
- * Fade a modal <dialog>'s ::backdrop in (Stepbro's tint: 0.5 s on the signature
309
+ * Fade a modal <dialog>'s ::backdrop in (tint: 0.5 s on the signature
310
310
  * curve) or out (linear). Resolves at once without the Web Animations API.
311
311
  */
312
312
  declare function fadeBackdrop(dialog: HTMLElement, direction: 'in' | 'out'): Promise<void>;
package/dist/index.js CHANGED
@@ -3,9 +3,10 @@ import {
3
3
  animate,
4
4
  confetti,
5
5
  leave
6
- } from "./chunk-2BQGFOA7.js";
6
+ } from "./chunk-J6OCFNGU.js";
7
7
  import {
8
8
  captureLayout,
9
+ createActionButton,
9
10
  createCardDock,
10
11
  createCascade,
11
12
  createContrast,
@@ -15,12 +16,18 @@ import {
15
16
  createDetails,
16
17
  createDockPill,
17
18
  createDragRuler,
19
+ createEditorialReveal,
18
20
  createFillText,
21
+ createFilmHero,
19
22
  createFitText,
20
23
  createFlow,
24
+ createFontCycle,
21
25
  createFrameZoom,
26
+ createImageZoom,
22
27
  createInfiniteReel,
28
+ createJoinedCta,
23
29
  createLetters,
30
+ createLocalClock,
24
31
  createMarquee,
25
32
  createMaskText,
26
33
  createParallax,
@@ -31,15 +38,19 @@ import {
31
38
  createRepelBento,
32
39
  createReveal,
33
40
  createRotator,
41
+ createScrollDock,
34
42
  createSlotText,
35
43
  createSnapStrip,
36
44
  createSortable,
37
45
  createSpring,
38
46
  createSpringCards,
47
+ createSticker,
39
48
  createStretchFooter,
40
49
  createTabs,
41
50
  createTextRoll,
51
+ createThumbnailNav,
42
52
  createTicketMenu,
53
+ createWeightHover,
43
54
  createWords,
44
55
  installDetailsMotion,
45
56
  moveItem,
@@ -49,7 +60,7 @@ import {
49
60
  slideIndicator,
50
61
  toggleDetails,
51
62
  trackScroll
52
- } from "./chunk-FS2HJVVY.js";
63
+ } from "./chunk-XAKC2QY7.js";
53
64
  import {
54
65
  NAV_STYLES,
55
66
  PENDING_ID,
@@ -77,7 +88,7 @@ import {
77
88
  subscribeToasts,
78
89
  toast,
79
90
  toastTimers
80
- } from "./chunk-Q4LVFNLN.js";
91
+ } from "./chunk-IKQ5FODN.js";
81
92
  import {
82
93
  CustomEase,
83
94
  EASE,
@@ -100,9 +111,18 @@ import {
100
111
  clearStyles,
101
112
  closeModal,
102
113
  countTo,
114
+ createCalendar,
103
115
  createChannelState,
104
116
  createDialog,
117
+ createHoverCard,
118
+ createInputOtp,
105
119
  createMenu,
120
+ createPagination,
121
+ createQuantity,
122
+ createSlotPicker,
123
+ createStudioDock,
124
+ createTrailer,
125
+ dayKey,
106
126
  dockWindow,
107
127
  easeInCubic,
108
128
  easeOut,
@@ -155,17 +175,18 @@ import {
155
175
  stepChannel,
156
176
  stopMorph,
157
177
  takeMovement,
178
+ toDate,
158
179
  transparentColor,
159
180
  tweenNumber
160
- } from "./chunk-34XYOXHG.js";
161
- import "./chunk-J27KH2A2.js";
181
+ } from "./chunk-TFNRIZHU.js";
182
+ import "./chunk-RVSKEBIC.js";
162
183
  import {
163
184
  clamp,
164
185
  damp,
165
186
  lerp,
166
187
  mapRange,
167
188
  wrap
168
- } from "./chunk-KLY5BRRI.js";
189
+ } from "./chunk-34EZ7DF4.js";
169
190
  import {
170
191
  MK_HEAD_SCRIPT,
171
192
  TIMING,
@@ -174,7 +195,7 @@ import {
174
195
  reduced,
175
196
  subscribe,
176
197
  whileVisible
177
- } from "./chunk-RFDIZYFX.js";
198
+ } from "./chunk-DOOMULVV.js";
178
199
  import "./chunk-TGV27ZWM.js";
179
200
 
180
201
  // src/components/chat-background/audio.ts
@@ -257,6 +278,8 @@ export {
257
278
  closeModal,
258
279
  confetti,
259
280
  countTo,
281
+ createActionButton,
282
+ createCalendar,
260
283
  createCardDock,
261
284
  createCascade,
262
285
  createChannelState,
@@ -271,40 +294,58 @@ export {
271
294
  createDialog,
272
295
  createDockPill,
273
296
  createDragRuler,
297
+ createEditorialReveal,
274
298
  createFillText,
299
+ createFilmHero,
275
300
  createFitText,
276
301
  createFlow,
302
+ createFontCycle,
277
303
  createFrameZoom,
304
+ createHoverCard,
305
+ createImageZoom,
278
306
  createInfiniteReel,
307
+ createInputOtp,
279
308
  createIsland,
309
+ createJoinedCta,
280
310
  createLetters,
311
+ createLocalClock,
281
312
  createMarquee,
282
313
  createMaskText,
283
314
  createMenu,
284
315
  createNav,
316
+ createPagination,
285
317
  createParallax,
286
318
  createPile,
287
319
  createPop,
320
+ createQuantity,
288
321
  createRadialMenu,
289
322
  createReflow,
290
323
  createRepelBento,
291
324
  createReveal,
292
325
  createRotator,
293
326
  createScope,
327
+ createScrollDock,
328
+ createSlotPicker,
294
329
  createSlotText,
295
330
  createSnapStrip,
296
331
  createSortable,
297
332
  createSpring,
298
333
  createSpringCards,
299
334
  createSteps,
335
+ createSticker,
300
336
  createStretchFooter,
337
+ createStudioDock,
301
338
  createTabs,
302
339
  createTextRoll,
303
340
  createThemePicker,
341
+ createThumbnailNav,
304
342
  createTicketMenu,
305
343
  createToaster,
344
+ createTrailer,
345
+ createWeightHover,
306
346
  createWords,
307
347
  damp,
348
+ dayKey,
308
349
  dismissToast,
309
350
  dockWindow,
310
351
  easeInCubic,
@@ -378,6 +419,7 @@ export {
378
419
  subscribe,
379
420
  subscribeToasts,
380
421
  takeMovement,
422
+ toDate,
381
423
  toast,
382
424
  toastTimers,
383
425
  toggleDetails,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/chat-background/audio.ts"],"sourcesContent":["/*\n * Microphone energy for the chat background (Stepbro's analyser): FFT 256,\n * smoothing .3, −90…−10 dB; the lowest 40 % of the bins, ×3, clamped to 1, with\n * attack .8 and release .15. The caller passes a MediaStream it already has\n * permission for: this never asks for the microphone.\n */\n\nexport interface AudioEnergy {\n stop(): void;\n}\n\nexport function audioEnergy(\n stream: MediaStream,\n onEnergy: (energy: number) => void,\n { fftSize = 256, smoothing = 0.3 }: { fftSize?: number; smoothing?: number } = {},\n): AudioEnergy {\n const AudioCtor = (globalThis as { AudioContext?: typeof AudioContext }).AudioContext;\n if (!AudioCtor) {\n onEnergy(0);\n return { stop() {} };\n }\n const context = new AudioCtor();\n const analyser = context.createAnalyser();\n analyser.fftSize = fftSize;\n analyser.smoothingTimeConstant = smoothing;\n analyser.minDecibels = -90;\n analyser.maxDecibels = -10;\n const input = context.createMediaStreamSource(stream);\n input.connect(analyser);\n const bins = new Uint8Array(analyser.frequencyBinCount);\n let energy = 0;\n let frame = 0;\n let stopped = false;\n const tick = () => {\n if (stopped) return;\n analyser.getByteFrequencyData(bins);\n const count = Math.ceil(bins.length * 0.4);\n let sum = 0;\n for (let i = 0; i < count; i++) sum += bins[i] ?? 0;\n const target = Math.min(((sum / (count * 255)) * 3), 1);\n energy += (target - energy) * (target > energy ? 0.8 : 0.15);\n onEnergy(energy);\n frame = requestAnimationFrame(tick);\n };\n tick();\n return {\n stop() {\n if (stopped) return;\n stopped = true;\n cancelAnimationFrame(frame);\n input.disconnect();\n void context.close();\n onEnergy(0);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,YACd,QACA,UACA,EAAE,UAAU,KAAK,YAAY,IAAI,IAA8C,CAAC,GACnE;AACb,QAAM,YAAa,WAAsD;AACzE,MAAI,CAAC,WAAW;AACd,aAAS,CAAC;AACV,WAAO,EAAE,OAAO;AAAA,IAAC,EAAE;AAAA,EACrB;AACA,QAAM,UAAU,IAAI,UAAU;AAC9B,QAAM,WAAW,QAAQ,eAAe;AACxC,WAAS,UAAU;AACnB,WAAS,wBAAwB;AACjC,WAAS,cAAc;AACvB,WAAS,cAAc;AACvB,QAAM,QAAQ,QAAQ,wBAAwB,MAAM;AACpD,QAAM,QAAQ,QAAQ;AACtB,QAAM,OAAO,IAAI,WAAW,SAAS,iBAAiB;AACtD,MAAI,SAAS;AACb,MAAI,QAAQ;AACZ,MAAI,UAAU;AACd,QAAM,OAAO,MAAM;AACjB,QAAI,QAAS;AACb,aAAS,qBAAqB,IAAI;AAClC,UAAM,QAAQ,KAAK,KAAK,KAAK,SAAS,GAAG;AACzC,QAAI,MAAM;AACV,aAAS,IAAI,GAAG,IAAI,OAAO,IAAK,QAAO,KAAK,CAAC,KAAK;AAClD,UAAM,SAAS,KAAK,IAAM,OAAO,QAAQ,OAAQ,GAAI,CAAC;AACtD,eAAW,SAAS,WAAW,SAAS,SAAS,MAAM;AACvD,aAAS,MAAM;AACf,YAAQ,sBAAsB,IAAI;AAAA,EACpC;AACA,OAAK;AACL,SAAO;AAAA,IACL,OAAO;AACL,UAAI,QAAS;AACb,gBAAU;AACV,2BAAqB,KAAK;AAC1B,YAAM,WAAW;AACjB,WAAK,QAAQ,MAAM;AACnB,eAAS,CAAC;AAAA,IACZ;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/components/chat-background/audio.ts"],"sourcesContent":["/*\n * Microphone energy for the chat background: FFT 256,\n * smoothing .3, −90…−10 dB; the lowest 40 % of the bins, ×3, clamped to 1, with\n * attack .8 and release .15. The caller passes a MediaStream it already has\n * permission for: this never asks for the microphone.\n */\n\nexport interface AudioEnergy {\n stop(): void;\n}\n\nexport function audioEnergy(\n stream: MediaStream,\n onEnergy: (energy: number) => void,\n { fftSize = 256, smoothing = 0.3 }: { fftSize?: number; smoothing?: number } = {},\n): AudioEnergy {\n const AudioCtor = (globalThis as { AudioContext?: typeof AudioContext }).AudioContext;\n if (!AudioCtor) {\n onEnergy(0);\n return { stop() {} };\n }\n const context = new AudioCtor();\n const analyser = context.createAnalyser();\n analyser.fftSize = fftSize;\n analyser.smoothingTimeConstant = smoothing;\n analyser.minDecibels = -90;\n analyser.maxDecibels = -10;\n const input = context.createMediaStreamSource(stream);\n input.connect(analyser);\n const bins = new Uint8Array(analyser.frequencyBinCount);\n let energy = 0;\n let frame = 0;\n let stopped = false;\n const tick = () => {\n if (stopped) return;\n analyser.getByteFrequencyData(bins);\n const count = Math.ceil(bins.length * 0.4);\n let sum = 0;\n for (let i = 0; i < count; i++) sum += bins[i] ?? 0;\n const target = Math.min(((sum / (count * 255)) * 3), 1);\n energy += (target - energy) * (target > energy ? 0.8 : 0.15);\n onEnergy(energy);\n frame = requestAnimationFrame(tick);\n };\n tick();\n return {\n stop() {\n if (stopped) return;\n stopped = true;\n cancelAnimationFrame(frame);\n input.disconnect();\n void context.close();\n onEnergy(0);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,YACd,QACA,UACA,EAAE,UAAU,KAAK,YAAY,IAAI,IAA8C,CAAC,GACnE;AACb,QAAM,YAAa,WAAsD;AACzE,MAAI,CAAC,WAAW;AACd,aAAS,CAAC;AACV,WAAO,EAAE,OAAO;AAAA,IAAC,EAAE;AAAA,EACrB;AACA,QAAM,UAAU,IAAI,UAAU;AAC9B,QAAM,WAAW,QAAQ,eAAe;AACxC,WAAS,UAAU;AACnB,WAAS,wBAAwB;AACjC,WAAS,cAAc;AACvB,WAAS,cAAc;AACvB,QAAM,QAAQ,QAAQ,wBAAwB,MAAM;AACpD,QAAM,QAAQ,QAAQ;AACtB,QAAM,OAAO,IAAI,WAAW,SAAS,iBAAiB;AACtD,MAAI,SAAS;AACb,MAAI,QAAQ;AACZ,MAAI,UAAU;AACd,QAAM,OAAO,MAAM;AACjB,QAAI,QAAS;AACb,aAAS,qBAAqB,IAAI;AAClC,UAAM,QAAQ,KAAK,KAAK,KAAK,SAAS,GAAG;AACzC,QAAI,MAAM;AACV,aAAS,IAAI,GAAG,IAAI,OAAO,IAAK,QAAO,KAAK,CAAC,KAAK;AAClD,UAAM,SAAS,KAAK,IAAM,OAAO,QAAQ,OAAQ,GAAI,CAAC;AACtD,eAAW,SAAS,WAAW,SAAS,SAAS,MAAM;AACvD,aAAS,MAAM;AACf,YAAQ,sBAAsB,IAAI;AAAA,EACpC;AACA,OAAK;AACL,SAAO;AAAA,IACL,OAAO;AACL,UAAI,QAAS;AACb,gBAAU;AACV,2BAAqB,KAAK;AAC1B,YAAM,WAAW;AACjB,WAAK,QAAQ,MAAM;AACnB,eAAS,CAAC;AAAA,IACZ;AAAA,EACF;AACF;","names":[]}