@yewdiel21/motion-kit 0.17.0 → 0.19.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 +240 -199
- package/dist/auto/index.d.ts +19 -3
- package/dist/auto/index.js +35 -3
- package/dist/auto/index.js.map +1 -1
- package/dist/{chunk-QFBOHPWZ.js → chunk-CQP66AZK.js} +2 -2
- package/dist/{chunk-QP4QJOEN.js → chunk-H4STLMCM.js} +2 -2
- package/dist/{chunk-BZLMCHUD.js → chunk-KDIJX6G4.js} +3 -3
- package/dist/{chunk-DOOMULVV.js → chunk-OLT3CWDJ.js} +4 -2
- package/dist/chunk-OLT3CWDJ.js.map +1 -0
- package/dist/{chunk-VJFPTLAK.js → chunk-PEDYJ2TV.js} +8 -22
- package/dist/chunk-PEDYJ2TV.js.map +1 -0
- package/dist/{chunk-7IQTMF7Y.js → chunk-Y4GIBTRG.js} +5130 -2153
- package/dist/chunk-Y4GIBTRG.js.map +1 -0
- package/dist/css/components/badge-button.css +16 -0
- package/dist/css/components/bento-grid.css +13 -0
- package/dist/css/components/code-block.css +267 -0
- package/dist/css/components/command-search.css +274 -2
- package/dist/css/components/dialog.css +264 -0
- package/dist/css/components/drilldown-menu.css +11 -7
- package/dist/css/components/equalizer-slider.css +26 -0
- package/dist/css/components/handwriting-text.css +15 -0
- package/dist/css/components/heatmap-chart.css +267 -1
- package/dist/css/components/magnetize-button.css +18 -0
- package/dist/css/components/morphing-page-dots.css +13 -0
- package/dist/css/components/not-found.css +22 -0
- package/dist/css/components/notification-stack.css +42 -0
- package/dist/css/components/particle-button.css +14 -0
- package/dist/css/components/radio-group.css +29 -0
- package/dist/css/components/rating-scale.css +23 -0
- package/dist/css/components/scroll-area.css +261 -0
- package/dist/css/components/scroll-preview-dock.css +18 -0
- package/dist/css/components/select.css +300 -4
- package/dist/css/components/signature-pad.css +130 -103
- package/dist/css/components/stepper.css +36 -0
- package/dist/css/components/sticky-header.css +10 -0
- package/dist/css/components/temperature-slider.css +29 -0
- package/dist/css/components/voice-message-bubble.css +62 -45
- package/dist/css/components/waveform-player.css +49 -34
- package/dist/css/components/wheel-picker.css +16 -15
- package/dist/css/tokens.css +4 -0
- package/dist/elements/index.d.ts +217 -4
- package/dist/elements/index.js +614 -9
- package/dist/elements/index.js.map +1 -1
- package/dist/{engine-Bn6hC87X.d.ts → engine-D6XV-WNt.d.ts} +390 -1
- package/dist/gl/index.js +2 -2
- package/dist/index.css +886 -177
- package/dist/index.d.ts +23 -23
- package/dist/index.js +37 -5
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +126 -7
- package/dist/react/index.js +722 -7
- package/dist/react/index.js.map +1 -1
- package/dist/{reduced-YS6TZjpa.d.ts → reduced-4croIXl-.d.ts} +1 -1
- package/dist/{store-CZ6vdtIE.d.ts → store-CAHWkurn.d.ts} +1 -1
- package/package.json +110 -110
- package/registry.json +1357 -1160
- package/src/auto/auto-init.ts +341 -308
- package/src/components/badge-button/README.md +28 -0
- package/src/components/badge-button/badge-button.css +15 -0
- package/src/components/badge-button/element.ts +16 -0
- package/src/components/badge-button/engine.ts +85 -0
- package/src/components/badge-button/react.tsx +31 -0
- package/src/components/bento-grid/README.md +26 -0
- package/src/components/bento-grid/bento-grid.css +12 -0
- package/src/components/bento-grid/element.ts +22 -0
- package/src/components/bento-grid/engine.ts +153 -0
- package/src/components/bento-grid/react.tsx +25 -0
- package/src/components/code-block/README.md +1 -1
- package/src/components/code-block/code-block.css +5 -0
- package/src/components/code-block/engine.ts +5 -0
- package/src/components/command-search/README.md +1 -1
- package/src/components/command-search/command-search.css +12 -2
- package/src/components/command-search/engine.ts +6 -0
- package/src/components/dialog/README.md +104 -103
- package/src/components/dialog/dialog.css +2 -0
- package/src/components/dialog/engine.ts +465 -449
- package/src/components/drilldown-menu/drilldown-menu.css +11 -7
- package/src/components/drilldown-menu/engine.ts +44 -4
- package/src/components/equalizer-slider/README.md +43 -0
- package/src/components/equalizer-slider/element.ts +41 -0
- package/src/components/equalizer-slider/engine.ts +32 -0
- package/src/components/equalizer-slider/equalizer-slider.css +26 -0
- package/src/components/equalizer-slider/react.tsx +60 -0
- package/src/components/equalizer-slider/shared.ts +161 -0
- package/src/components/handwriting-text/README.md +29 -0
- package/src/components/handwriting-text/element.ts +14 -0
- package/src/components/handwriting-text/engine.ts +108 -0
- package/src/components/handwriting-text/glyphs.ts +71 -0
- package/src/components/handwriting-text/handwriting-text.css +14 -0
- package/src/components/handwriting-text/react.tsx +23 -0
- package/src/components/heatmap-chart/README.md +48 -48
- package/src/components/heatmap-chart/engine.ts +6 -1
- package/src/components/heatmap-chart/heatmap-chart.css +5 -1
- package/src/components/icons.ts +1 -0
- package/src/components/magnetize-button/README.md +26 -0
- package/src/components/magnetize-button/element.ts +13 -0
- package/src/components/magnetize-button/engine.ts +84 -0
- package/src/components/magnetize-button/magnetize-button.css +17 -0
- package/src/components/magnetize-button/react.tsx +22 -0
- package/src/components/morphing-page-dots/README.md +28 -0
- package/src/components/morphing-page-dots/element.ts +16 -0
- package/src/components/morphing-page-dots/engine.ts +89 -0
- package/src/components/morphing-page-dots/morphing-page-dots.css +12 -0
- package/src/components/morphing-page-dots/react.tsx +32 -0
- package/src/components/not-found/README.md +26 -0
- package/src/components/not-found/element.ts +15 -0
- package/src/components/not-found/engine.ts +57 -0
- package/src/components/not-found/not-found.css +21 -0
- package/src/components/not-found/react.tsx +23 -0
- package/src/components/notification-stack/README.md +24 -0
- package/src/components/notification-stack/element.ts +26 -0
- package/src/components/notification-stack/engine.ts +329 -0
- package/src/components/notification-stack/notification-stack.css +41 -0
- package/src/components/notification-stack/react.tsx +28 -0
- package/src/components/particle-button/README.md +26 -0
- package/src/components/particle-button/element.ts +13 -0
- package/src/components/particle-button/engine.ts +52 -0
- package/src/components/particle-button/particle-button.css +13 -0
- package/src/components/particle-button/react.tsx +22 -0
- package/src/components/radio-group/README.md +43 -0
- package/src/components/radio-group/element.ts +41 -0
- package/src/components/radio-group/engine.ts +11 -0
- package/src/components/radio-group/radio-group.css +28 -0
- package/src/components/radio-group/react.tsx +60 -0
- package/src/components/radio-group/shared.ts +118 -0
- package/src/components/rating-scale/README.md +43 -0
- package/src/components/rating-scale/element.ts +41 -0
- package/src/components/rating-scale/engine.ts +63 -0
- package/src/components/rating-scale/rating-scale.css +22 -0
- package/src/components/rating-scale/react.tsx +60 -0
- package/src/components/scroll-area/README.md +89 -0
- package/src/components/scroll-area/element.ts +35 -0
- package/src/components/scroll-area/engine.ts +528 -0
- package/src/components/scroll-area/react.tsx +67 -0
- package/src/components/scroll-area/scroll-area.css +260 -0
- package/src/components/scroll-preview-dock/README.md +24 -0
- package/src/components/scroll-preview-dock/element.ts +20 -0
- package/src/components/scroll-preview-dock/engine.ts +228 -0
- package/src/components/scroll-preview-dock/react.tsx +26 -0
- package/src/components/scroll-preview-dock/scroll-preview-dock.css +17 -0
- package/src/components/select/README.md +23 -9
- package/src/components/select/engine.ts +16 -4
- package/src/components/select/select.css +38 -4
- package/src/components/signature-pad/engine.ts +550 -437
- package/src/components/signature-pad/signature-pad.css +130 -103
- package/src/components/stepper/README.md +46 -0
- package/src/components/stepper/element.ts +42 -0
- package/src/components/stepper/engine.ts +103 -0
- package/src/components/stepper/react.tsx +60 -0
- package/src/components/stepper/stepper.css +35 -0
- package/src/components/sticky-header/README.md +30 -0
- package/src/components/sticky-header/element.ts +19 -0
- package/src/components/sticky-header/engine.ts +95 -0
- package/src/components/sticky-header/react.tsx +25 -0
- package/src/components/sticky-header/sticky-header.css +9 -0
- package/src/components/temperature-slider/README.md +42 -0
- package/src/components/temperature-slider/element.ts +53 -0
- package/src/components/temperature-slider/engine.ts +44 -0
- package/src/components/temperature-slider/react.tsx +66 -0
- package/src/components/temperature-slider/temperature-slider.css +29 -0
- package/src/components/voice-message-bubble/engine.ts +11 -0
- package/src/components/voice-message-bubble/voice-message-bubble.css +14 -12
- package/src/components/waveform-player/README.md +1 -1
- package/src/components/waveform-player/engine.ts +344 -261
- package/src/components/waveform-player/waveform-player.css +50 -35
- package/src/components/wheel-picker/README.md +3 -1
- package/src/components/wheel-picker/element.ts +12 -5
- package/src/components/wheel-picker/engine.ts +37 -8
- package/src/components/wheel-picker/wheel-picker.css +17 -16
- package/src/core/timing.ts +2 -0
- package/src/css/tokens.css +4 -0
- package/src/elements/index.ts +321 -273
- package/src/index.ts +312 -295
- package/src/motion/morph.ts +5 -2
- package/src/react/index.ts +17 -0
- package/dist/chunk-7IQTMF7Y.js.map +0 -1
- package/dist/chunk-DOOMULVV.js.map +0 -1
- package/dist/chunk-VJFPTLAK.js.map +0 -1
- /package/dist/{chunk-QFBOHPWZ.js.map → chunk-CQP66AZK.js.map} +0 -0
- /package/dist/{chunk-QP4QJOEN.js.map → chunk-H4STLMCM.js.map} +0 -0
- /package/dist/{chunk-BZLMCHUD.js.map → chunk-KDIJX6G4.js.map} +0 -0
package/src/auto/auto-init.ts
CHANGED
|
@@ -1,308 +1,341 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
106
|
-
import {
|
|
107
|
-
import {
|
|
108
|
-
import {
|
|
109
|
-
|
|
110
|
-
import {
|
|
111
|
-
|
|
112
|
-
import {
|
|
113
|
-
|
|
114
|
-
import {
|
|
115
|
-
|
|
116
|
-
import {
|
|
117
|
-
|
|
118
|
-
import {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
'
|
|
140
|
-
'
|
|
141
|
-
'
|
|
142
|
-
'
|
|
143
|
-
'
|
|
144
|
-
'
|
|
145
|
-
'
|
|
146
|
-
'
|
|
147
|
-
'
|
|
148
|
-
'
|
|
149
|
-
'
|
|
150
|
-
'
|
|
151
|
-
'
|
|
152
|
-
'
|
|
153
|
-
'
|
|
154
|
-
|
|
155
|
-
'
|
|
156
|
-
'
|
|
157
|
-
'
|
|
158
|
-
'
|
|
159
|
-
'
|
|
160
|
-
'
|
|
161
|
-
'
|
|
162
|
-
'
|
|
163
|
-
'
|
|
164
|
-
'
|
|
165
|
-
'
|
|
166
|
-
'
|
|
167
|
-
'
|
|
168
|
-
'
|
|
169
|
-
'
|
|
170
|
-
'
|
|
171
|
-
'
|
|
172
|
-
'
|
|
173
|
-
'
|
|
174
|
-
'
|
|
175
|
-
'
|
|
176
|
-
'
|
|
177
|
-
'
|
|
178
|
-
'
|
|
179
|
-
'
|
|
180
|
-
'
|
|
181
|
-
'
|
|
182
|
-
'
|
|
183
|
-
'
|
|
184
|
-
'
|
|
185
|
-
'
|
|
186
|
-
'
|
|
187
|
-
'
|
|
188
|
-
'
|
|
189
|
-
'
|
|
190
|
-
'
|
|
191
|
-
'
|
|
192
|
-
'
|
|
193
|
-
'
|
|
194
|
-
'
|
|
195
|
-
'
|
|
196
|
-
'
|
|
197
|
-
'
|
|
198
|
-
'
|
|
199
|
-
'
|
|
200
|
-
'
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
'
|
|
210
|
-
'
|
|
211
|
-
'
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
'
|
|
218
|
-
|
|
219
|
-
'
|
|
220
|
-
|
|
221
|
-
'
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
'
|
|
225
|
-
'
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
'
|
|
229
|
-
'
|
|
230
|
-
'
|
|
231
|
-
'
|
|
232
|
-
'
|
|
233
|
-
'
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
created.
|
|
307
|
-
};
|
|
308
|
-
|
|
1
|
+
import { createNotFound } from '../components/not-found/engine';
|
|
2
|
+
import { createMorphingPageDots } from '../components/morphing-page-dots/engine';
|
|
3
|
+
import { createBadgeButton } from '../components/badge-button/engine';
|
|
4
|
+
import { createMagnetizeButton } from '../components/magnetize-button/engine';
|
|
5
|
+
import { createParticleButton } from '../components/particle-button/engine';
|
|
6
|
+
import { createHandwritingText } from '../components/handwriting-text/engine';
|
|
7
|
+
import { createStickyHeader } from '../components/sticky-header/engine';
|
|
8
|
+
import { createScrollPreviewDock } from '../components/scroll-preview-dock/engine';
|
|
9
|
+
import { createBentoGrid } from '../components/bento-grid/engine';
|
|
10
|
+
import { createNotificationStack } from '../components/notification-stack/engine';
|
|
11
|
+
import { createRatingScale } from '../components/rating-scale/engine';
|
|
12
|
+
import { createTemperatureSlider } from '../components/temperature-slider/engine';
|
|
13
|
+
import { createEqualizerSlider } from '../components/equalizer-slider/engine';
|
|
14
|
+
import { createRadioGroup } from '../components/radio-group/engine';
|
|
15
|
+
import { createStepper } from '../components/stepper/engine';
|
|
16
|
+
import { createQuantity } from '../components/quantity/engine';
|
|
17
|
+
import { createPagination } from '../components/pagination/engine';
|
|
18
|
+
import { createHoverCard } from '../components/hover-card/engine';
|
|
19
|
+
import { createInputOtp } from '../components/input-otp/engine';
|
|
20
|
+
import { createJoinedCta } from '../recipes/joined-cta/create-joined-cta';
|
|
21
|
+
import { createImageZoom } from '../recipes/image-zoom/create-image-zoom';
|
|
22
|
+
import { createFontCycle } from '../recipes/font-cycle/create-font-cycle';
|
|
23
|
+
import { createThumbnailNav } from '../recipes/thumbnail-nav/create-thumbnail-nav';
|
|
24
|
+
import { createActionButton } from '../recipes/action-button/create-action-button';
|
|
25
|
+
import { createFilmHero } from '../recipes/film-hero/create-film-hero';
|
|
26
|
+
import { createEditorialReveal } from '../recipes/editorial-reveal/create-editorial-reveal';
|
|
27
|
+
import { createStudioDock } from '../components/studio-dock/engine';
|
|
28
|
+
import { createCalendar } from '../components/calendar/engine';
|
|
29
|
+
import { createSlotPicker } from '../components/slot-picker/engine';
|
|
30
|
+
import { createWeightHover } from '../recipes/weight-hover/create-weight-hover';
|
|
31
|
+
import { createSticker } from '../recipes/sticker/create-sticker';
|
|
32
|
+
import { createScrollDock } from '../recipes/scroll-dock/create-scroll-dock';
|
|
33
|
+
import { createLocalClock } from '../recipes/local-clock/create-local-clock';
|
|
34
|
+
import { createTrailer } from '../components/trailer/engine';
|
|
35
|
+
import { createCreditCard } from '../components/credit-card/engine';
|
|
36
|
+
import { createCommandSearch } from '../components/command-search/engine';
|
|
37
|
+
import { createHoldConfirm } from '../components/hold-confirm/engine';
|
|
38
|
+
import { createImagePreview } from '../components/image-preview/engine';
|
|
39
|
+
import { createLikeButton } from '../components/like-button/engine';
|
|
40
|
+
import { createNotificationBell } from '../components/notification-bell/engine';
|
|
41
|
+
import { createPasswordStrength } from '../components/password-strength/engine';
|
|
42
|
+
import { createScratchCard } from '../components/scratch-card/engine';
|
|
43
|
+
import { createStarRating } from '../components/star-rating/engine';
|
|
44
|
+
import { createSwipeActions } from '../components/swipe-actions/engine';
|
|
45
|
+
import { createAttachment } from '../components/attachment/engine';
|
|
46
|
+
import { createSkeleton } from '../components/skeleton/engine';
|
|
47
|
+
import { createQuestionnaire } from '../components/questionnaire/engine';
|
|
48
|
+
import { createCodeBlock } from '../components/code-block/engine';
|
|
49
|
+
import { createContextMenu } from '../components/context-menu/engine';
|
|
50
|
+
import { createDrawer } from '../components/drawer/engine';
|
|
51
|
+
import { createLinkPreview } from '../components/link-preview/engine';
|
|
52
|
+
import { createProgress } from '../components/progress/engine';
|
|
53
|
+
import { createRangeSlider } from '../components/range-slider/engine';
|
|
54
|
+
import { createChart } from '../components/chart/engine';
|
|
55
|
+
import { createColorSlider } from '../components/color-slider/engine';
|
|
56
|
+
import { createColorArea } from '../components/color-area/engine';
|
|
57
|
+
import { createColorField } from '../components/color-field/engine';
|
|
58
|
+
import { createColorPicker } from '../components/color-picker/engine';
|
|
59
|
+
import { createTimeField } from '../components/time-field/engine';
|
|
60
|
+
import { createRangeCalendar } from '../components/range-calendar/engine';
|
|
61
|
+
import { createDateRangePicker } from '../components/date-range-picker/engine';
|
|
62
|
+
import { createTooltip } from '../components/tooltip/engine';
|
|
63
|
+
import { createPopover } from '../components/popover/engine';
|
|
64
|
+
import { createLoadingButton } from '../components/loading-button/engine';
|
|
65
|
+
import { createBreadcrumb } from '../components/breadcrumb/engine';
|
|
66
|
+
import { createEmptyState } from '../components/empty-state/engine';
|
|
67
|
+
import { createStatCard } from '../components/stat-card/engine';
|
|
68
|
+
import { createChartTooltip } from '../components/chart-tooltip/engine';
|
|
69
|
+
import { createMultiSelect } from '../components/multi-select/engine';
|
|
70
|
+
import { createTagInput } from '../components/tag-input/engine';
|
|
71
|
+
import { createDateTimePicker } from '../components/date-time-picker/engine';
|
|
72
|
+
import { createFilterBuilder } from '../components/filter-builder/engine';
|
|
73
|
+
import { createTimeline } from '../components/timeline/engine';
|
|
74
|
+
import { createActivityFeed } from '../components/activity-feed/engine';
|
|
75
|
+
import { createTreeView } from '../components/tree-view/engine';
|
|
76
|
+
import { createFileExplorer } from '../components/file-explorer/engine';
|
|
77
|
+
import { createJsonViewer } from '../components/json-viewer/engine';
|
|
78
|
+
import { createVirtualList } from '../components/virtual-list/engine';
|
|
79
|
+
import { createResizablePanel } from '../components/resizable-panel/engine';
|
|
80
|
+
import { createSplitView } from '../components/split-view/engine';
|
|
81
|
+
import { createDataTable } from '../components/data-table/engine';
|
|
82
|
+
import { createEditableTable } from '../components/editable-table/engine';
|
|
83
|
+
import { createRichTextEditor } from '../components/rich-text-editor/engine';
|
|
84
|
+
import { createSelect } from '../components/select/engine';
|
|
85
|
+
import { createAddToCart } from '../components/add-to-cart/engine';
|
|
86
|
+
import { createScrollIsland } from '../components/scroll-island/engine';
|
|
87
|
+
import { createScrollArea } from '../components/scroll-area/engine';
|
|
88
|
+
import { ScrollTrigger } from '../core/gsap';
|
|
89
|
+
import { warnOnce, type Instance } from '../core/types';
|
|
90
|
+
import { createSpringCards } from '../recipes/spring-cards/create-spring-cards';
|
|
91
|
+
import { createCurvedCarousel } from '../recipes/curved-carousel/create-curved-carousel';
|
|
92
|
+
import { createPile } from '../recipes/pile/create-pile';
|
|
93
|
+
import { createWords } from '../recipes/words/create-words';
|
|
94
|
+
import { createFlow } from '../recipes/flow/create-flow';
|
|
95
|
+
import { createPop } from '../recipes/pop/create-pop';
|
|
96
|
+
import { createFitText } from '../recipes/fit-text/create-fit-text';
|
|
97
|
+
import { createStretchFooter } from '../recipes/stretch-footer/create-stretch-footer';
|
|
98
|
+
import { createRadialMenu } from '../recipes/radial-menu/create-radial-menu';
|
|
99
|
+
import { createTabs } from '../recipes/tabs/create-tabs';
|
|
100
|
+
import { createCounter } from '../recipes/counter/create-counter';
|
|
101
|
+
import { createDetails } from '../recipes/details/create-details';
|
|
102
|
+
import { createReveal } from '../recipes/reveal/create-reveal';
|
|
103
|
+
import { createReflow } from '../recipes/reflow/create-reflow';
|
|
104
|
+
import { createSlotText } from '../recipes/slot-text/create-slot-text';
|
|
105
|
+
import { createSortable } from '../recipes/sortable/create-sortable';
|
|
106
|
+
import { createMaskText } from '../recipes/mask-text/create-mask-text';
|
|
107
|
+
import { createCascade } from '../recipes/cascade/create-cascade';
|
|
108
|
+
import { createTextRoll } from '../recipes/text-roll/create-text-roll';
|
|
109
|
+
import { createLetters } from '../recipes/letters/create-letters';
|
|
110
|
+
import { createParallax } from '../recipes/parallax/create-parallax';
|
|
111
|
+
import { createDepthGrid } from '../recipes/depth-grid/create-depth-grid';
|
|
112
|
+
import { createFrameZoom } from '../recipes/frame-zoom/create-frame-zoom';
|
|
113
|
+
import { createContrast } from '../recipes/contrast/create-contrast';
|
|
114
|
+
import { createMarquee } from '../recipes/marquee/create-marquee';
|
|
115
|
+
import { createCardDock } from '../recipes/card-dock/create-card-dock';
|
|
116
|
+
import { createSnapStrip } from '../recipes/snap-strip/create-snap-strip';
|
|
117
|
+
import { createFillText } from '../recipes/fill-text/create-fill-text';
|
|
118
|
+
import { parseOptions } from './parse-options';
|
|
119
|
+
import { createTicketMenu } from '../recipes/ticket-menu/create-ticket-menu';
|
|
120
|
+
import { createInfiniteReel } from '../recipes/infinite-reel/create-infinite-reel';
|
|
121
|
+
import { createRepelBento } from '../recipes/repel-bento/create-repel-bento';
|
|
122
|
+
import { createRotator } from '../recipes/rotator/create-rotator';
|
|
123
|
+
import { createDragRuler } from '../recipes/drag-ruler/create-drag-ruler';
|
|
124
|
+
import { createDockPill } from '../recipes/dock-pill/create-dock-pill';
|
|
125
|
+
|
|
126
|
+
import { createSignaturePad } from '../components/signature-pad/engine';
|
|
127
|
+
|
|
128
|
+
import { createWaveformPlayer } from '../components/waveform-player/engine';
|
|
129
|
+
|
|
130
|
+
import { createVoiceMessageBubble } from '../components/voice-message-bubble/engine';
|
|
131
|
+
|
|
132
|
+
import { createDrilldownMenu } from '../components/drilldown-menu/engine';
|
|
133
|
+
|
|
134
|
+
import { createWheelPicker } from '../components/wheel-picker/engine';
|
|
135
|
+
|
|
136
|
+
type Factory = (el: HTMLElement, options: Record<string, unknown>) => Instance;
|
|
137
|
+
|
|
138
|
+
const factories = {
|
|
139
|
+
'stepper': createStepper,
|
|
140
|
+
'radio-group': createRadioGroup,
|
|
141
|
+
'equalizer-slider': createEqualizerSlider,
|
|
142
|
+
'temperature-slider': createTemperatureSlider,
|
|
143
|
+
'rating-scale': createRatingScale,
|
|
144
|
+
'notification-stack': createNotificationStack,
|
|
145
|
+
'bento-grid': createBentoGrid,
|
|
146
|
+
'scroll-preview-dock': createScrollPreviewDock,
|
|
147
|
+
'sticky-header': createStickyHeader,
|
|
148
|
+
'handwriting-text': createHandwritingText,
|
|
149
|
+
'particle-button': createParticleButton,
|
|
150
|
+
'magnetize-button': createMagnetizeButton,
|
|
151
|
+
'badge-button': createBadgeButton,
|
|
152
|
+
'morphing-page-dots': createMorphingPageDots,
|
|
153
|
+
'not-found': createNotFound,
|
|
154
|
+
|
|
155
|
+
'wheel-picker': createWheelPicker,
|
|
156
|
+
'drilldown-menu': createDrilldownMenu,
|
|
157
|
+
'voice-message-bubble': createVoiceMessageBubble,
|
|
158
|
+
'waveform-player': createWaveformPlayer,
|
|
159
|
+
'signature-pad': createSignaturePad,
|
|
160
|
+
'joined-cta': createJoinedCta,
|
|
161
|
+
'image-zoom': createImageZoom,
|
|
162
|
+
'font-cycle': createFontCycle,
|
|
163
|
+
'thumbnail-nav': createThumbnailNav,
|
|
164
|
+
'action-button': createActionButton,
|
|
165
|
+
'film-hero': createFilmHero,
|
|
166
|
+
'editorial-reveal': createEditorialReveal,
|
|
167
|
+
'studio-dock': createStudioDock,
|
|
168
|
+
'trailer': createTrailer,
|
|
169
|
+
'quantity': createQuantity,
|
|
170
|
+
'pagination': createPagination,
|
|
171
|
+
'hover-card': createHoverCard,
|
|
172
|
+
'input-otp': createInputOtp,
|
|
173
|
+
'calendar': createCalendar,
|
|
174
|
+
'slot-picker': createSlotPicker,
|
|
175
|
+
'credit-card': createCreditCard,
|
|
176
|
+
'command-search': createCommandSearch,
|
|
177
|
+
'hold-confirm': createHoldConfirm,
|
|
178
|
+
'image-preview': createImagePreview,
|
|
179
|
+
'like-button': createLikeButton,
|
|
180
|
+
'notification-bell': createNotificationBell,
|
|
181
|
+
'password-strength': createPasswordStrength,
|
|
182
|
+
'scratch-card': createScratchCard,
|
|
183
|
+
'star-rating': createStarRating,
|
|
184
|
+
'swipe-actions': createSwipeActions,
|
|
185
|
+
'attachment': createAttachment,
|
|
186
|
+
'skeleton': createSkeleton,
|
|
187
|
+
'questionnaire': createQuestionnaire,
|
|
188
|
+
'code-block': createCodeBlock,
|
|
189
|
+
'context-menu': createContextMenu,
|
|
190
|
+
'drawer': createDrawer,
|
|
191
|
+
'link-preview': createLinkPreview,
|
|
192
|
+
'progress': createProgress,
|
|
193
|
+
'range-slider': createRangeSlider,
|
|
194
|
+
'chart': createChart,
|
|
195
|
+
'color-slider': createColorSlider,
|
|
196
|
+
'color-area': createColorArea,
|
|
197
|
+
'color-field': createColorField,
|
|
198
|
+
'color-picker': createColorPicker,
|
|
199
|
+
'time-field': createTimeField,
|
|
200
|
+
'range-calendar': createRangeCalendar,
|
|
201
|
+
'date-range-picker': createDateRangePicker,
|
|
202
|
+
'tooltip': createTooltip,
|
|
203
|
+
'popover': createPopover,
|
|
204
|
+
'loading-button': createLoadingButton,
|
|
205
|
+
'breadcrumb': createBreadcrumb,
|
|
206
|
+
'empty-state': createEmptyState,
|
|
207
|
+
'stat-card': createStatCard,
|
|
208
|
+
'chart-tooltip': createChartTooltip,
|
|
209
|
+
'multi-select': createMultiSelect,
|
|
210
|
+
'tag-input': createTagInput,
|
|
211
|
+
'date-time-picker': createDateTimePicker,
|
|
212
|
+
'filter-builder': createFilterBuilder,
|
|
213
|
+
'timeline': createTimeline,
|
|
214
|
+
'activity-feed': createActivityFeed,
|
|
215
|
+
'tree-view': createTreeView,
|
|
216
|
+
'file-explorer': createFileExplorer,
|
|
217
|
+
'json-viewer': createJsonViewer,
|
|
218
|
+
'virtual-list': createVirtualList,
|
|
219
|
+
'resizable-panel': createResizablePanel,
|
|
220
|
+
'split-view': createSplitView,
|
|
221
|
+
'data-table': createDataTable,
|
|
222
|
+
'editable-table': createEditableTable,
|
|
223
|
+
'rich-text-editor': createRichTextEditor,
|
|
224
|
+
'select': createSelect,
|
|
225
|
+
'add-to-cart': createAddToCart,
|
|
226
|
+
'scroll-island': createScrollIsland,
|
|
227
|
+
'scroll-area': createScrollArea,
|
|
228
|
+
'weight-hover': createWeightHover,
|
|
229
|
+
'sticker': createSticker,
|
|
230
|
+
'scroll-dock': createScrollDock,
|
|
231
|
+
'local-clock': createLocalClock,
|
|
232
|
+
'spring-cards': createSpringCards,
|
|
233
|
+
'curved-carousel': (el, options) =>
|
|
234
|
+
createCurvedCarousel(el, {
|
|
235
|
+
...options,
|
|
236
|
+
onSelect: (index, slide) => el.dispatchEvent(new CustomEvent('mk:select', { detail: { index, slide }, bubbles: true })),
|
|
237
|
+
}),
|
|
238
|
+
pile: createPile,
|
|
239
|
+
words: createWords,
|
|
240
|
+
flow: createFlow,
|
|
241
|
+
pop: createPop,
|
|
242
|
+
'fit-text': createFitText,
|
|
243
|
+
'stretch-footer': createStretchFooter,
|
|
244
|
+
'radial-menu': createRadialMenu,
|
|
245
|
+
tabs: createTabs,
|
|
246
|
+
counter: createCounter,
|
|
247
|
+
details: (el) => createDetails(el),
|
|
248
|
+
reveal: createReveal,
|
|
249
|
+
reflow: createReflow,
|
|
250
|
+
'slot-text': createSlotText,
|
|
251
|
+
sortable: createSortable,
|
|
252
|
+
'mask-text': createMaskText,
|
|
253
|
+
cascade: createCascade,
|
|
254
|
+
'text-roll': createTextRoll,
|
|
255
|
+
letters: createLetters,
|
|
256
|
+
parallax: createParallax,
|
|
257
|
+
'depth-grid': createDepthGrid,
|
|
258
|
+
'frame-zoom': createFrameZoom,
|
|
259
|
+
contrast: createContrast,
|
|
260
|
+
marquee: createMarquee,
|
|
261
|
+
'card-dock': createCardDock,
|
|
262
|
+
'snap-strip': createSnapStrip,
|
|
263
|
+
'fill-text': createFillText,
|
|
264
|
+
'ticket-menu': createTicketMenu,
|
|
265
|
+
'infinite-reel': createInfiniteReel,
|
|
266
|
+
'repel-bento': createRepelBento,
|
|
267
|
+
'rotator': createRotator,
|
|
268
|
+
'drag-ruler': createDragRuler,
|
|
269
|
+
'dock-pill': createDockPill,
|
|
270
|
+
} satisfies Record<string, Factory>;
|
|
271
|
+
|
|
272
|
+
export type RecipeName = keyof typeof factories;
|
|
273
|
+
export const recipeNames = Object.keys(factories) as RecipeName[];
|
|
274
|
+
|
|
275
|
+
/** Measured text: wait for web fonts, fit before splitting into words. */
|
|
276
|
+
const AFTER_FONTS: RecipeName[] = ['fit-text', 'words', 'slot-text'];
|
|
277
|
+
|
|
278
|
+
const instances = new WeakMap<HTMLElement, Map<RecipeName, Instance>>();
|
|
279
|
+
|
|
280
|
+
export interface AutoInitOptions {
|
|
281
|
+
/** Only start these recipes. */
|
|
282
|
+
only?: RecipeName[];
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Start every `[data-mk]` recipe inside `root` (an element may list several:
|
|
287
|
+
* `data-mk="fit-text words"`). Options come from `data-mk-*` attributes.
|
|
288
|
+
* Returns a function that destroys what this call created. Safe to call again:
|
|
289
|
+
* elements that already run a recipe are skipped.
|
|
290
|
+
*/
|
|
291
|
+
export function autoInit(root: ParentNode = document, { only }: AutoInitOptions = {}): () => void {
|
|
292
|
+
if (typeof window === 'undefined') return () => {};
|
|
293
|
+
const created: Array<[HTMLElement, RecipeName, Instance]> = [];
|
|
294
|
+
let cancelled = false;
|
|
295
|
+
|
|
296
|
+
const elements = [...root.querySelectorAll<HTMLElement>('[data-mk]')];
|
|
297
|
+
if (root instanceof HTMLElement && root.matches('[data-mk]')) elements.unshift(root);
|
|
298
|
+
|
|
299
|
+
const start = (el: HTMLElement, name: RecipeName) => {
|
|
300
|
+
if (cancelled) return;
|
|
301
|
+
const running = instances.get(el) ?? new Map<RecipeName, Instance>();
|
|
302
|
+
if (running.has(name)) return;
|
|
303
|
+
const instance = (factories[name] as Factory)(el, parseOptions(el));
|
|
304
|
+
running.set(name, instance);
|
|
305
|
+
instances.set(el, running);
|
|
306
|
+
created.push([el, name, instance]);
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
const now: Array<[HTMLElement, RecipeName]> = [];
|
|
310
|
+
const later: Array<[HTMLElement, RecipeName]> = [];
|
|
311
|
+
for (const el of elements) {
|
|
312
|
+
for (const raw of (el.dataset.mk ?? '').split(/\s+/).filter(Boolean)) {
|
|
313
|
+
if (!(raw in factories)) {
|
|
314
|
+
warnOnce(`autoInit: unknown recipe "${raw}" (known: ${recipeNames.join(', ')})`);
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
const name = raw as RecipeName;
|
|
318
|
+
if (only && !only.includes(name)) continue;
|
|
319
|
+
(AFTER_FONTS.includes(name) ? later : now).push([el, name]);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
now.forEach(([el, name]) => start(el, name));
|
|
324
|
+
if (later.length) {
|
|
325
|
+
later.sort((a, b) => AFTER_FONTS.indexOf(a[1]) - AFTER_FONTS.indexOf(b[1]));
|
|
326
|
+
const fonts = document.fonts?.ready ?? Promise.resolve();
|
|
327
|
+
void Promise.race([fonts, new Promise((resolve) => setTimeout(resolve, 1500))]).then(() => {
|
|
328
|
+
later.forEach(([el, name]) => start(el, name));
|
|
329
|
+
if (!cancelled) ScrollTrigger.refresh();
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
return () => {
|
|
334
|
+
cancelled = true;
|
|
335
|
+
for (const [el, name, instance] of created.reverse()) {
|
|
336
|
+
instance.destroy();
|
|
337
|
+
instances.get(el)?.delete(name);
|
|
338
|
+
}
|
|
339
|
+
created.length = 0;
|
|
340
|
+
};
|
|
341
|
+
}
|