@yewdiel21/motion-kit 0.9.1 → 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.
- package/README.md +93 -83
- package/dist/auto/index.d.ts +22 -3
- package/dist/auto/index.js +41 -3
- package/dist/auto/index.js.map +1 -1
- package/dist/{chunk-BFC27F2G.js → chunk-IKQ5FODN.js} +2 -2
- package/dist/{chunk-JQMJQSXD.js → chunk-TFNRIZHU.js} +1614 -11
- package/dist/chunk-TFNRIZHU.js.map +1 -0
- package/dist/{chunk-XDWBVFHQ.js → chunk-XAKC2QY7.js} +1202 -3
- package/dist/chunk-XAKC2QY7.js.map +1 -0
- package/dist/css/components/calendar.css +159 -0
- package/dist/css/components/hover-card.css +14 -0
- package/dist/css/components/input-otp.css +10 -0
- package/dist/css/components/pagination.css +11 -0
- package/dist/css/components/quantity.css +16 -0
- package/dist/css/components/slot-picker.css +126 -0
- package/dist/css/components/studio-dock.css +35 -0
- package/dist/css/components/trailer.css +37 -0
- package/dist/css/controls.css +65 -0
- package/dist/elements/index.d.ts +72 -4
- package/dist/elements/index.js +170 -4
- package/dist/elements/index.js.map +1 -1
- package/dist/index.css +1017 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +45 -3
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +105 -6
- package/dist/react/index.js +350 -3
- package/dist/react/index.js.map +1 -1
- package/dist/{reduced-B98f8LPs.d.ts → reduced-BmBzKH94.d.ts} +199 -2
- package/dist/{reveal-C0hCDcB_.d.ts → reveal-jsX-uwUz.d.ts} +211 -1
- package/dist/{store-pHiUvxP8.d.ts → store-DYb3tTsZ.d.ts} +1 -1
- package/package.json +1 -1
- package/registry.json +178 -104
- package/skills/motion-kit/SKILL.md +209 -189
- package/src/auto/auto-init.ts +38 -0
- package/src/components/calendar/README.md +82 -0
- package/src/components/calendar/calendar.css +158 -0
- package/src/components/calendar/element.ts +27 -0
- package/src/components/calendar/engine.ts +412 -0
- package/src/components/calendar/react.tsx +69 -0
- package/src/components/hover-card/README.md +16 -0
- package/src/components/hover-card/element.ts +8 -0
- package/src/components/hover-card/engine.ts +69 -0
- package/src/components/hover-card/hover-card.css +13 -0
- package/src/components/hover-card/react.tsx +19 -0
- package/src/components/input-otp/README.md +18 -0
- package/src/components/input-otp/element.ts +14 -0
- package/src/components/input-otp/engine.ts +106 -0
- package/src/components/input-otp/input-otp.css +9 -0
- package/src/components/input-otp/react.tsx +21 -0
- package/src/components/pagination/README.md +17 -0
- package/src/components/pagination/element.ts +14 -0
- package/src/components/pagination/engine.ts +102 -0
- package/src/components/pagination/pagination.css +10 -0
- package/src/components/pagination/react.tsx +22 -0
- package/src/components/quantity/README.md +20 -0
- package/src/components/quantity/element.ts +14 -0
- package/src/components/quantity/engine.ts +85 -0
- package/src/components/quantity/quantity.css +15 -0
- package/src/components/quantity/react.tsx +21 -0
- package/src/components/slot-picker/README.md +68 -0
- package/src/components/slot-picker/element.ts +27 -0
- package/src/components/slot-picker/engine.ts +412 -0
- package/src/components/slot-picker/react.tsx +76 -0
- package/src/components/slot-picker/slot-picker.css +125 -0
- package/src/components/studio-dock/README.md +44 -0
- package/src/components/studio-dock/element.ts +11 -0
- package/src/components/studio-dock/engine.ts +212 -0
- package/src/components/studio-dock/react.tsx +23 -0
- package/src/components/studio-dock/studio-dock.css +34 -0
- package/src/components/trailer/README.md +28 -0
- package/src/components/trailer/element.ts +13 -0
- package/src/components/trailer/engine.ts +189 -0
- package/src/components/trailer/react.tsx +16 -0
- package/src/components/trailer/trailer.css +36 -0
- package/src/core/dates.ts +98 -0
- package/src/css/controls/README.md +14 -0
- package/src/css/controls/status.css +63 -0
- package/src/elements/index.ts +24 -0
- package/src/index.ts +25 -0
- package/src/react/index.ts +21 -0
- package/src/react/use-action-button.ts +6 -0
- package/src/react/use-editorial-reveal.ts +7 -0
- package/src/react/use-film-hero.ts +6 -0
- package/src/react/use-font-cycle.ts +7 -0
- package/src/react/use-image-zoom.ts +5 -0
- package/src/react/use-joined-cta.ts +5 -0
- package/src/react/use-local-clock.ts +5 -0
- package/src/react/use-scroll-dock.ts +5 -0
- package/src/react/use-sticker.ts +5 -0
- package/src/react/use-studio-dock.ts +8 -0
- package/src/react/use-thumbnail-nav.ts +7 -0
- package/src/react/use-trailer.ts +6 -0
- package/src/react/use-weight-hover.ts +5 -0
- package/src/recipes/action-button/README.md +31 -0
- package/src/recipes/action-button/action-button.css +113 -0
- package/src/recipes/action-button/create-action-button.ts +56 -0
- package/src/recipes/editorial-reveal/README.md +35 -0
- package/src/recipes/editorial-reveal/create-editorial-reveal.ts +91 -0
- package/src/recipes/editorial-reveal/editorial-reveal.css +17 -0
- package/src/recipes/film-hero/README.md +23 -0
- package/src/recipes/film-hero/create-film-hero.ts +65 -0
- package/src/recipes/film-hero/film-hero.css +29 -0
- package/src/recipes/font-cycle/README.md +11 -0
- package/src/recipes/font-cycle/create-font-cycle.ts +126 -0
- package/src/recipes/font-cycle/font-cycle.css +36 -0
- package/src/recipes/image-zoom/README.md +16 -0
- package/src/recipes/image-zoom/create-image-zoom.ts +27 -0
- package/src/recipes/image-zoom/image-zoom.css +7 -0
- package/src/recipes/joined-cta/README.md +13 -0
- package/src/recipes/joined-cta/create-joined-cta.ts +22 -0
- package/src/recipes/joined-cta/joined-cta.css +17 -0
- package/src/recipes/local-clock/README.md +31 -0
- package/src/recipes/local-clock/create-local-clock.ts +61 -0
- package/src/recipes/scroll-dock/README.md +46 -0
- package/src/recipes/scroll-dock/create-scroll-dock.ts +72 -0
- package/src/recipes/scroll-dock/scroll-dock.css +70 -0
- package/src/recipes/sticker/README.md +59 -0
- package/src/recipes/sticker/create-sticker.ts +490 -0
- package/src/recipes/sticker/sticker.css +112 -0
- package/src/recipes/thumbnail-nav/README.md +16 -0
- package/src/recipes/thumbnail-nav/create-thumbnail-nav.ts +165 -0
- package/src/recipes/thumbnail-nav/thumbnail-nav.css +108 -0
- package/src/recipes/weight-hover/README.md +37 -0
- package/src/recipes/weight-hover/create-weight-hover.ts +136 -0
- package/src/recipes/weight-hover/weight-hover.css +7 -0
- package/dist/chunk-JQMJQSXD.js.map +0 -1
- package/dist/chunk-XDWBVFHQ.js.map +0 -1
- /package/dist/{chunk-BFC27F2G.js.map → chunk-IKQ5FODN.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { D as DialogInstance,
|
|
2
|
-
export {
|
|
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-
|
|
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
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';
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
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-
|
|
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-
|
|
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,9 +175,10 @@ import {
|
|
|
155
175
|
stepChannel,
|
|
156
176
|
stopMorph,
|
|
157
177
|
takeMovement,
|
|
178
|
+
toDate,
|
|
158
179
|
transparentColor,
|
|
159
180
|
tweenNumber
|
|
160
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-TFNRIZHU.js";
|
|
161
182
|
import "./chunk-RVSKEBIC.js";
|
|
162
183
|
import {
|
|
163
184
|
clamp,
|
|
@@ -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: 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":"
|
|
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":[]}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { useLayoutEffect, RefObject, DependencyList, ReactNode, CSSProperties, Component, ButtonHTMLAttributes, DialogHTMLAttributes, HTMLAttributes, MutableRefObject, ContextType, TextareaHTMLAttributes, MouseEvent } from 'react';
|
|
3
3
|
import { I as Instance } from '../types-BkS_raL8.js';
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
6
|
-
import { M as MenuInstance,
|
|
4
|
+
import { b5 as SpringCardsOptions, a3 as CurvedCarouselOptions, C as CurvedCarouselInstance, aJ as PileOptions, bk as WordsOptions, bj as WordsInstance, ak as FlowOptions, aj as FlowInstance, aL as PopOptions, aK as PopInstance, ah as FitTextOptions, ag as FitTextInstance, ba as StretchFooterOptions, aN as RadialMenuOptions, aM as RadialMenuInstance, bc as TabsOptions, bb as TabsInstance, a2 as CounterOptions, a1 as CounterInstance, aU as RevealRecipeOptions, aT as RevealInstance, aP as ReflowOptions, aO as ReflowInstance, a_ as SlotTextOptions, aZ as SlotTextInstance, b3 as SortableOptions, b1 as SortableInstance, aE as MaskTextOptions, aD as MaskTextInstance, _ as CascadeOptions, Z as CascadeInstance, be as TextRollOptions, bd as TextRollInstance, ay as LettersOptions, ax as LettersInstance, aG as ParallaxOptions, aF as ParallaxInstance, a5 as DepthGridOptions, a4 as DepthGridInstance, aq as FrameZoomOptions, ap as FrameZoomInstance, a0 as ContrastOptions, $ as ContrastInstance, aC as MarqueeOptions, aB as MarqueeInstance, Y as CardDockOptions, X as CardDockInstance, b0 as SnapStripOptions, a$ as SnapStripInstance, ad as FillTextOptions, ac as FillTextInstance, T as TicketMenuOptions, au as InfiniteReelOptions, at as InfiniteReelInstance, aS as RepelBentoOptions, aR as RepelBentoInstance, aW as RotatorOptions, aV as RotatorInstance, a9 as DragRulerOptions, a8 as DragRulerInstance, a7 as DockPillOptions, a6 as DockPillInstance, aw as JoinedCtaOptions, av as JoinedCtaInstance, as as ImageZoomOptions, ar as ImageZoomInstance, ao as FontCycleOptions, an as FontCycleInstance, bg as ThumbnailNavOptions, bf as ThumbnailNavInstance, V as ActionButtonOptions, U as ActionButtonInstance, af as FilmHeroOptions, ae as FilmHeroInstance, ab as EditorialRevealOptions, aa as EditorialRevealInstance, bi as WeightHoverOptions, bh as WeightHoverInstance, b7 as StickerOptions, b6 as StickerInstance, aY as ScrollDockOptions, aX as ScrollDockInstance, aA as LocalClockOptions, az as LocalClockInstance } from '../reduced-BmBzKH94.js';
|
|
5
|
+
export { S as MK_HEAD_SCRIPT, aI as PileLayer, aQ as ReorderDetail, bq as moveItem, br as pileLayers, bs as pileStyle } from '../reduced-BmBzKH94.js';
|
|
6
|
+
import { M as MenuInstance, s as DialogOptions, D as DialogInstance, z as QuantityOptions, y as PaginationOptions, v as HoverCardOptions, w as InputOtpOptions, K as StudioDockOptions, S as StudioDockInstance, O as TrailerOptions, T as TrailerInstance, n as CalendarOptions, F as SlotPickerOptions } from '../reveal-jsX-uwUz.js';
|
|
7
7
|
import { LiquidBlendOptions, ShaderEffectInstance, MatcapOptions, ShaderGrainOptions, ShaderBlurOptions, ParticleHeroOptions, ParticleHeroInstance } from '../gl/index.js';
|
|
8
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
9
|
import { T as ThemeState, s as setTheme, a as setMode, I as InitThemeOptions, b as ThemeMode } from '../theme-Bjf9qIIy.js';
|
|
10
10
|
export { M as MK_THEME_HEAD_SCRIPT, t as themeHeadScript } from '../theme-Bjf9qIIy.js';
|
|
11
|
-
import { n as ThemePickerOptions, s as ToasterLabels, e as ChatLabels, C as ChatInstance, v as capturePending, b as ChatRole, c as NavStyle, h as CursorVariant, g as CursorOptions, i as IslandOptions, I as IslandInstance } from '../store-
|
|
12
|
-
export { j as NAV_STYLES, o as ToastAction, q as ToastOptions, r as ToastTone, x as clearToasts, F as dismissToast, t as toast } from '../store-
|
|
11
|
+
import { n as ThemePickerOptions, s as ToasterLabels, e as ChatLabels, C as ChatInstance, v as capturePending, b as ChatRole, c as NavStyle, h as CursorVariant, g as CursorOptions, i as IslandOptions, I as IslandInstance } from '../store-DYb3tTsZ.js';
|
|
12
|
+
export { j as NAV_STYLES, o as ToastAction, q as ToastOptions, r as ToastTone, x as clearToasts, F as dismissToast, t as toast } from '../store-DYb3tTsZ.js';
|
|
13
13
|
import { C as CapturedLayout } from '../confetti-BSX1CLLV.js';
|
|
14
14
|
export { A as ANIMATIONS, b as AnimationName, d as ConfettiOptions, e as animate, g as confetti, l as leave } from '../confetti-BSX1CLLV.js';
|
|
15
15
|
import 'gsap/SplitText';
|
|
@@ -473,4 +473,103 @@ declare function IslandDots(): react_jsx_runtime.JSX.Element;
|
|
|
473
473
|
/** floating navbar. */
|
|
474
474
|
declare function Island({ brand, cta, panels, contained, entrance, closeOnScroll, closeOnNavigate, focusOnOpen, onChange, instanceRef, className, ...props }: IslandProps): react_jsx_runtime.JSX.Element;
|
|
475
475
|
|
|
476
|
-
|
|
476
|
+
interface QuantityProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'>, QuantityOptions {
|
|
477
|
+
label?: string;
|
|
478
|
+
decreaseLabel?: string;
|
|
479
|
+
increaseLabel?: string;
|
|
480
|
+
name?: string;
|
|
481
|
+
}
|
|
482
|
+
declare function Quantity({ min, max, step, value, disabled, onChange, label, decreaseLabel, increaseLabel, name, className, ...props }: QuantityProps): react_jsx_runtime.JSX.Element;
|
|
483
|
+
|
|
484
|
+
interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'>, PaginationOptions {
|
|
485
|
+
previousLabel?: string;
|
|
486
|
+
nextLabel?: string;
|
|
487
|
+
}
|
|
488
|
+
declare function Pagination({ totalPages, page, siblings, pageLabel, onChange, previousLabel, nextLabel, className, ...props }: PaginationProps): react_jsx_runtime.JSX.Element;
|
|
489
|
+
|
|
490
|
+
interface HoverCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>, HoverCardOptions {
|
|
491
|
+
trigger: ReactNode;
|
|
492
|
+
children: ReactNode;
|
|
493
|
+
triggerLabel?: string;
|
|
494
|
+
panelLabel?: string;
|
|
495
|
+
}
|
|
496
|
+
declare function HoverCard({ trigger, children, triggerLabel, panelLabel, openDelay, closeDelay, placement, onOpenChange, className, ...props }: HoverCardProps): react_jsx_runtime.JSX.Element;
|
|
497
|
+
|
|
498
|
+
interface InputOtpProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'onComplete' | 'defaultValue'>, InputOtpOptions {
|
|
499
|
+
label?: string;
|
|
500
|
+
name?: string;
|
|
501
|
+
disabled?: boolean;
|
|
502
|
+
required?: boolean;
|
|
503
|
+
invalid?: boolean;
|
|
504
|
+
defaultValue?: string;
|
|
505
|
+
}
|
|
506
|
+
declare function InputOtp({ length, value, defaultValue, mask, onChange, onComplete, label, name, disabled, required, invalid, className, ...props }: InputOtpProps): react_jsx_runtime.JSX.Element;
|
|
507
|
+
|
|
508
|
+
declare const useJoinedCta: (ref: RefObject<HTMLElement | null>, options?: JoinedCtaOptions, deps?: DependencyList) => RefObject<JoinedCtaInstance | null>;
|
|
509
|
+
|
|
510
|
+
declare const useImageZoom: (ref: RefObject<HTMLElement | null>, options?: ImageZoomOptions, deps?: DependencyList) => RefObject<ImageZoomInstance | null>;
|
|
511
|
+
|
|
512
|
+
declare const useFontCycle: (ref: RefObject<HTMLElement | null>, options?: FontCycleOptions, deps?: DependencyList) => RefObject<FontCycleInstance | null>;
|
|
513
|
+
|
|
514
|
+
declare const useThumbnailNav: (ref: RefObject<HTMLElement | null>, options?: ThumbnailNavOptions, deps?: DependencyList) => RefObject<ThumbnailNavInstance | null>;
|
|
515
|
+
|
|
516
|
+
declare const useActionButton: (ref: RefObject<HTMLElement | null>, options?: ActionButtonOptions, deps?: DependencyList) => RefObject<ActionButtonInstance | null>;
|
|
517
|
+
|
|
518
|
+
declare const useFilmHero: (ref: RefObject<HTMLElement | null>, options?: FilmHeroOptions, deps?: DependencyList) => RefObject<FilmHeroInstance | null>;
|
|
519
|
+
|
|
520
|
+
declare function useEditorialReveal(ref: RefObject<HTMLElement | null>, options?: EditorialRevealOptions, deps?: DependencyList): RefObject<EditorialRevealInstance | null>;
|
|
521
|
+
|
|
522
|
+
declare function useStudioDock(ref: RefObject<HTMLElement | null>, options?: StudioDockOptions, deps?: DependencyList): RefObject<StudioDockInstance | null>;
|
|
523
|
+
|
|
524
|
+
declare const useTrailer: (ref: RefObject<HTMLElement | null>, options?: TrailerOptions, deps?: DependencyList) => RefObject<TrailerInstance | null>;
|
|
525
|
+
|
|
526
|
+
interface StudioDockProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>, StudioDockOptions {
|
|
527
|
+
/** Default stays inside its positioned demo/app panel. */
|
|
528
|
+
fixed?: boolean;
|
|
529
|
+
instanceRef?: {
|
|
530
|
+
current: StudioDockInstance | null;
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
/** Composable light-DOM shell; use the data-mk-studio-* slots shown in the README. */
|
|
534
|
+
declare function StudioDock({ duration, ease, focusOnOpen, trapFocus, onChange, fixed, instanceRef, className, children, ...props }: StudioDockProps): react_jsx_runtime.JSX.Element;
|
|
535
|
+
|
|
536
|
+
interface TrailerProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, 'open' | 'onClose'> {
|
|
537
|
+
options?: TrailerOptions;
|
|
538
|
+
}
|
|
539
|
+
/** Consumer supplies <video>, optional controls and tracks; no remote media is injected. */
|
|
540
|
+
declare function Trailer({ options, className, children, ...props }: TrailerProps): react_jsx_runtime.JSX.Element;
|
|
541
|
+
|
|
542
|
+
interface CalendarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'>, CalendarOptions {
|
|
543
|
+
/** Hide the month/week switch. */
|
|
544
|
+
hideViews?: boolean;
|
|
545
|
+
labels?: CalendarOptions['labels'] & {
|
|
546
|
+
previous?: string;
|
|
547
|
+
next?: string;
|
|
548
|
+
today?: string;
|
|
549
|
+
month?: string;
|
|
550
|
+
week?: string;
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
declare function Calendar({ date, view, firstDay, locale, events, maxEvents, selected, today, labels, onSelect, onEventClick, onNavigate, hideViews, className, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
554
|
+
|
|
555
|
+
interface SlotPickerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>, SlotPickerOptions {
|
|
556
|
+
/** Form field name: a hidden input carries "YYYY-MM-DDTHH:mm". */
|
|
557
|
+
name?: string;
|
|
558
|
+
labels?: SlotPickerOptions['labels'] & {
|
|
559
|
+
previous?: string;
|
|
560
|
+
next?: string;
|
|
561
|
+
};
|
|
562
|
+
/** Rendered under the times (e.g. a submit button). */
|
|
563
|
+
actions?: ReactNode;
|
|
564
|
+
}
|
|
565
|
+
declare function SlotPicker({ date, value, slots, min, max, closedDays, isDisabled, firstDay, locale, labels, onChange, onDateChange, name, actions, className, ...props }: SlotPickerProps): react_jsx_runtime.JSX.Element;
|
|
566
|
+
|
|
567
|
+
declare const useWeightHover: (ref: RefObject<HTMLElement | null>, options?: WeightHoverOptions, deps?: DependencyList) => RefObject<WeightHoverInstance | null>;
|
|
568
|
+
|
|
569
|
+
declare const useSticker: (ref: RefObject<HTMLElement | null>, options?: StickerOptions, deps?: DependencyList) => RefObject<StickerInstance | null>;
|
|
570
|
+
|
|
571
|
+
declare const useScrollDock: (ref: RefObject<HTMLElement | null>, options?: ScrollDockOptions, deps?: DependencyList) => RefObject<ScrollDockInstance | null>;
|
|
572
|
+
|
|
573
|
+
declare const useLocalClock: (ref: RefObject<HTMLElement | null>, options?: LocalClockOptions, deps?: DependencyList) => RefObject<LocalClockInstance | null>;
|
|
574
|
+
|
|
575
|
+
export { AnimatedNumber, type AnimatedNumberProps, Calendar, type CalendarProps, Chat, ChatBackground, type ChatBackgroundProps, type ChatComposerProps, type ChatMessageProps, type ChatMessagesProps, type ChatRootProps, Cursor, type CursorProps, Dialog, type DialogContentProps, FlipGroup, type FlipGroupProps, Frost, type FrostProps, HoverCard, type HoverCardProps, InputOtp, type InputOtpProps, Island, IslandDots, type IslandPanel, type IslandProps, Menu, type MenuRootProps, MkIcon, Nav, type NavItem, type NavProps, NavStyle, Pagination, type PaginationProps, Quantity, type QuantityProps, SlotPicker, type SlotPickerProps, SlotText, type SlotTextProps, Steps, type StepsProps, StudioDock, type StudioDockProps, type SurfaceRootProps, type ThemeContextValue, ThemePicker, type ThemePickerProps, ThemeProvider, type ThemeProviderProps, Toaster, type ToasterProps, Trailer, type TrailerProps, type UseStretchFooterOptions, useActionButton, useCardDock, useCascade, useChat, useContrast, useCounter, useCurvedCarousel, useDepthGrid, useDetails, useDialog, useDockPill, useDragRuler, useEditorialReveal, useFillText, useFilmHero, useFitText, useFlow, useFontCycle, useFrameZoom, useImageZoom, useInfiniteReel, useIsomorphicLayoutEffect, useJoinedCta, useLatest, useLetters, useLiquidBlend, useLocalClock, useMarquee, useMaskText, useMatcap, useParallax, useParticleHero, usePile, usePop, useRadialMenu, useRecipe, useReflow, useRepelBento, useReveal, useRotator, useScrollDock, useShaderBlur, useShaderGrain, useSlotText, useSnapStrip, useSortable, useSpringCards, useSticker, useStretchFooter, useStudioDock, useTabs, useTextRoll, useTheme, useThumbnailNav, useTicketMenu, useTrailer, useWeightHover, useWords };
|