@appfunnel-dev/sdk 0.5.0 → 0.7.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/dist/chunk-EVUYCLVY.cjs +1326 -0
- package/dist/chunk-EVUYCLVY.cjs.map +1 -0
- package/dist/chunk-H3KHXZSI.js +1321 -0
- package/dist/chunk-H3KHXZSI.js.map +1 -0
- package/dist/chunk-P4SLDMWY.js +104 -0
- package/dist/chunk-P4SLDMWY.js.map +1 -0
- package/dist/chunk-XP44I2MU.cjs +108 -0
- package/dist/chunk-XP44I2MU.cjs.map +1 -0
- package/dist/elements/index.cjs +12172 -0
- package/dist/elements/index.cjs.map +1 -0
- package/dist/elements/index.d.cts +602 -0
- package/dist/elements/index.d.ts +602 -0
- package/dist/elements/index.js +12137 -0
- package/dist/elements/index.js.map +1 -0
- package/dist/index.cjs +590 -371
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +132 -14
- package/dist/index.d.ts +132 -14
- package/dist/index.js +555 -355
- package/dist/index.js.map +1 -1
- package/dist/internal-C7seLJBr.d.cts +516 -0
- package/dist/internal-C7seLJBr.d.ts +516 -0
- package/dist/internal.cjs +5 -1196
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +2 -204
- package/dist/internal.d.ts +2 -204
- package/dist/internal.js +1 -1199
- package/dist/internal.js.map +1 -1
- package/package.json +17 -2
- package/dist/types-ChorYUCl.d.cts +0 -255
- package/dist/types-ChorYUCl.d.ts +0 -255
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
export { motion } from 'framer-motion';
|
|
5
|
+
|
|
6
|
+
type EasingType = 'linear' | 'easeIn' | 'easeOut' | 'easeInOut';
|
|
7
|
+
|
|
8
|
+
interface ProgressBarCheckpoint {
|
|
9
|
+
/** Percentage (0–100) at which this checkpoint fires */
|
|
10
|
+
at: number;
|
|
11
|
+
/** If true, the progress bar pauses at this checkpoint until resumed */
|
|
12
|
+
pause?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface ProgressBarHandle {
|
|
15
|
+
/** Start the progress animation from the beginning */
|
|
16
|
+
start: () => void;
|
|
17
|
+
/** Pause the progress animation */
|
|
18
|
+
pause: () => void;
|
|
19
|
+
/** Resume after a pause */
|
|
20
|
+
resume: () => void;
|
|
21
|
+
/** Reset to 0 without starting */
|
|
22
|
+
reset: () => void;
|
|
23
|
+
}
|
|
24
|
+
interface ProgressBarProps {
|
|
25
|
+
/** Duration of the full animation in milliseconds (default: 5000) */
|
|
26
|
+
duration?: number;
|
|
27
|
+
/** Track (background) color (default: #e5e7eb) */
|
|
28
|
+
trackColor?: string;
|
|
29
|
+
/** Fill (progress) color (default: #3b82f6) */
|
|
30
|
+
fillColor?: string;
|
|
31
|
+
/** Border radius of the bar (default: 9999px) */
|
|
32
|
+
borderRadius?: string | number;
|
|
33
|
+
/** Start automatically on mount (default: true) */
|
|
34
|
+
autoStart?: boolean;
|
|
35
|
+
/** Easing curve for the animation (default: linear) */
|
|
36
|
+
animation?: EasingType;
|
|
37
|
+
/** Checkpoints that fire callbacks or pause the animation */
|
|
38
|
+
checkpoints?: ProgressBarCheckpoint[];
|
|
39
|
+
/** Called on each checkpoint hit with the checkpoint percentage */
|
|
40
|
+
onCheckpoint?: (percentage: number) => void;
|
|
41
|
+
/** Called on every whole-number progress change (0–100) */
|
|
42
|
+
onProgress?: (percentage: number) => void;
|
|
43
|
+
/** Called when progress reaches 100% */
|
|
44
|
+
onComplete?: () => void;
|
|
45
|
+
/** Container style */
|
|
46
|
+
style?: CSSProperties;
|
|
47
|
+
/** Container className */
|
|
48
|
+
className?: string;
|
|
49
|
+
/** Fill bar style overrides */
|
|
50
|
+
fillStyle?: CSSProperties;
|
|
51
|
+
/** Fill bar className */
|
|
52
|
+
fillClassName?: string;
|
|
53
|
+
/** Children rendered inside the container (e.g., a label overlay) */
|
|
54
|
+
children?: ReactNode;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* An animated horizontal progress bar with easing, checkpoints, and pause/resume control.
|
|
58
|
+
*
|
|
59
|
+
* @example Auto-starting progress bar
|
|
60
|
+
* ```tsx
|
|
61
|
+
* <ProgressBar
|
|
62
|
+
* duration={3000}
|
|
63
|
+
* fillColor="#2FAD39"
|
|
64
|
+
* animation="easeOut"
|
|
65
|
+
* onComplete={() => goToNextPage()}
|
|
66
|
+
* />
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @example With checkpoints and ref control
|
|
70
|
+
* ```tsx
|
|
71
|
+
* const barRef = useRef<ProgressBarHandle>(null)
|
|
72
|
+
*
|
|
73
|
+
* <ProgressBar
|
|
74
|
+
* ref={barRef}
|
|
75
|
+
* duration={5000}
|
|
76
|
+
* autoStart={false}
|
|
77
|
+
* fillColor="#3b82f6"
|
|
78
|
+
* checkpoints={[
|
|
79
|
+
* { at: 25, pause: true },
|
|
80
|
+
* { at: 50, pause: true },
|
|
81
|
+
* ]}
|
|
82
|
+
* onCheckpoint={(pct) => console.log(`Reached ${pct}%`)}
|
|
83
|
+
* onProgress={(pct) => setLabel(`${pct}%`)}
|
|
84
|
+
* />
|
|
85
|
+
*
|
|
86
|
+
* <button onClick={() => barRef.current?.start()}>Start</button>
|
|
87
|
+
* <button onClick={() => barRef.current?.resume()}>Resume</button>
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
declare const ProgressBar: react.ForwardRefExoticComponent<ProgressBarProps & react.RefAttributes<ProgressBarHandle>>;
|
|
91
|
+
|
|
92
|
+
interface ProgressCircleCheckpoint {
|
|
93
|
+
/** Percentage (0–100) at which this checkpoint fires */
|
|
94
|
+
at: number;
|
|
95
|
+
/** If true, the progress pauses at this checkpoint until resumed */
|
|
96
|
+
pause?: boolean;
|
|
97
|
+
}
|
|
98
|
+
interface ProgressCircleHandle {
|
|
99
|
+
/** Start the progress animation from the beginning */
|
|
100
|
+
start: () => void;
|
|
101
|
+
/** Pause the progress animation */
|
|
102
|
+
pause: () => void;
|
|
103
|
+
/** Resume after a pause */
|
|
104
|
+
resume: () => void;
|
|
105
|
+
/** Reset to 0 without starting */
|
|
106
|
+
reset: () => void;
|
|
107
|
+
}
|
|
108
|
+
interface ProgressCircleProps {
|
|
109
|
+
/** Duration of the full animation in milliseconds (default: 5000) */
|
|
110
|
+
duration?: number;
|
|
111
|
+
/** Track (background) color (default: #e5e7eb) */
|
|
112
|
+
trackColor?: string;
|
|
113
|
+
/** Fill (progress) color (default: #3b82f6) */
|
|
114
|
+
fillColor?: string;
|
|
115
|
+
/** Track stroke width (default: 8) */
|
|
116
|
+
trackWidth?: number;
|
|
117
|
+
/** Fill stroke width (default: 8) */
|
|
118
|
+
fillWidth?: number;
|
|
119
|
+
/** Stroke line cap (default: round) */
|
|
120
|
+
lineCap?: 'round' | 'butt' | 'square';
|
|
121
|
+
/** Start automatically on mount (default: true) */
|
|
122
|
+
autoStart?: boolean;
|
|
123
|
+
/** Easing curve for the animation (default: linear) */
|
|
124
|
+
animation?: EasingType;
|
|
125
|
+
/** Checkpoints that fire callbacks or pause the animation */
|
|
126
|
+
checkpoints?: ProgressCircleCheckpoint[];
|
|
127
|
+
/** Called on each checkpoint hit */
|
|
128
|
+
onCheckpoint?: (percentage: number) => void;
|
|
129
|
+
/** Called on every whole-number progress change (0–100) */
|
|
130
|
+
onProgress?: (percentage: number) => void;
|
|
131
|
+
/** Called when progress reaches 100% */
|
|
132
|
+
onComplete?: () => void;
|
|
133
|
+
/** Size of the SVG viewBox (default: 100) */
|
|
134
|
+
size?: number;
|
|
135
|
+
/** Container style */
|
|
136
|
+
style?: CSSProperties;
|
|
137
|
+
/** Container className */
|
|
138
|
+
className?: string;
|
|
139
|
+
/** Render custom content centered inside the circle — receives current progress (0–100) */
|
|
140
|
+
renderInner?: (progress: number) => ReactNode;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* A circular SVG progress indicator with easing, checkpoints, and inner content.
|
|
144
|
+
*
|
|
145
|
+
* @example Loading screen with percentage
|
|
146
|
+
* ```tsx
|
|
147
|
+
* <ProgressCircle
|
|
148
|
+
* duration={5000}
|
|
149
|
+
* fillColor="#2FAD39"
|
|
150
|
+
* trackColor="#ededed"
|
|
151
|
+
* animation="easeOut"
|
|
152
|
+
* onComplete={() => goToNextPage()}
|
|
153
|
+
* renderInner={(progress) => <span>{progress}%</span>}
|
|
154
|
+
* />
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* @example Manual control with ref
|
|
158
|
+
* ```tsx
|
|
159
|
+
* const circleRef = useRef<ProgressCircleHandle>(null)
|
|
160
|
+
*
|
|
161
|
+
* <ProgressCircle
|
|
162
|
+
* ref={circleRef}
|
|
163
|
+
* duration={3000}
|
|
164
|
+
* autoStart={false}
|
|
165
|
+
* fillColor="#3b82f6"
|
|
166
|
+
* trackWidth={6}
|
|
167
|
+
* fillWidth={6}
|
|
168
|
+
* onProgress={(pct) => updateSteps(pct)}
|
|
169
|
+
* />
|
|
170
|
+
*
|
|
171
|
+
* <button onClick={() => circleRef.current?.start()}>Start</button>
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
declare const ProgressCircle: react.ForwardRefExoticComponent<ProgressCircleProps & react.RefAttributes<ProgressCircleHandle>>;
|
|
175
|
+
|
|
176
|
+
interface CountUpHandle {
|
|
177
|
+
/** Start the animation from `from` to `to` */
|
|
178
|
+
start: () => void;
|
|
179
|
+
/** Reset to the `from` value without animating */
|
|
180
|
+
reset: () => void;
|
|
181
|
+
}
|
|
182
|
+
interface CountUpProps {
|
|
183
|
+
/** Starting value (default: 0) */
|
|
184
|
+
from?: number;
|
|
185
|
+
/** Target value (default: 100) */
|
|
186
|
+
to?: number;
|
|
187
|
+
/** Animation duration in milliseconds (default: 2000) */
|
|
188
|
+
duration?: number;
|
|
189
|
+
/** Number of decimal places (default: 0) */
|
|
190
|
+
decimals?: number;
|
|
191
|
+
/** Text before the number */
|
|
192
|
+
prefix?: string;
|
|
193
|
+
/** Text after the number */
|
|
194
|
+
suffix?: string;
|
|
195
|
+
/** When true, starts the animation when the element scrolls into view. When false, only starts via ref.start() (default: true) */
|
|
196
|
+
autoStart?: boolean;
|
|
197
|
+
/** Container style */
|
|
198
|
+
style?: CSSProperties;
|
|
199
|
+
/** Container className */
|
|
200
|
+
className?: string;
|
|
201
|
+
/** Custom formatter — receives the current number, return a string */
|
|
202
|
+
formatter?: (value: number) => string;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* A spring-animated number counter that smoothly counts from one value to another.
|
|
206
|
+
*
|
|
207
|
+
* Uses framer-motion springs for natural-feeling animations.
|
|
208
|
+
* When `autoStart` is true (default), the animation triggers when the element
|
|
209
|
+
* becomes visible via IntersectionObserver.
|
|
210
|
+
*
|
|
211
|
+
* @example Basic count up on scroll
|
|
212
|
+
* ```tsx
|
|
213
|
+
* <CountUp from={0} to={1573} prefix="$" duration={2000} />
|
|
214
|
+
* ```
|
|
215
|
+
*
|
|
216
|
+
* @example With decimals and manual trigger
|
|
217
|
+
* ```tsx
|
|
218
|
+
* const countRef = useRef<CountUpHandle>(null)
|
|
219
|
+
*
|
|
220
|
+
* <CountUp
|
|
221
|
+
* ref={countRef}
|
|
222
|
+
* from={0}
|
|
223
|
+
* to={99.9}
|
|
224
|
+
* decimals={1}
|
|
225
|
+
* suffix="%"
|
|
226
|
+
* autoStart={false}
|
|
227
|
+
* />
|
|
228
|
+
*
|
|
229
|
+
* <button onClick={() => countRef.current?.start()}>Animate</button>
|
|
230
|
+
* ```
|
|
231
|
+
*
|
|
232
|
+
* @example Custom formatter
|
|
233
|
+
* ```tsx
|
|
234
|
+
* <CountUp
|
|
235
|
+
* from={0}
|
|
236
|
+
* to={50000}
|
|
237
|
+
* duration={3000}
|
|
238
|
+
* formatter={(v) => v.toLocaleString('en-US', { style: 'currency', currency: 'USD' })}
|
|
239
|
+
* />
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
declare const CountUp: react.ForwardRefExoticComponent<CountUpProps & react.RefAttributes<CountUpHandle>>;
|
|
243
|
+
|
|
244
|
+
interface SpinnerSegment {
|
|
245
|
+
/** Unique id for the segment */
|
|
246
|
+
id: string;
|
|
247
|
+
/** Display label on the wheel (used as SVG text when `item` is not provided) */
|
|
248
|
+
label: string;
|
|
249
|
+
/** Value returned on completion */
|
|
250
|
+
value: string;
|
|
251
|
+
/** Segment background color */
|
|
252
|
+
color: string;
|
|
253
|
+
/** Label text color (auto-detected from background if omitted) */
|
|
254
|
+
textColor?: string;
|
|
255
|
+
/** Custom ReactNode to render instead of the text label — rendered via foreignObject */
|
|
256
|
+
item?: ReactNode;
|
|
257
|
+
}
|
|
258
|
+
interface SpinnerWheelHandle {
|
|
259
|
+
/**
|
|
260
|
+
* Spin the wheel.
|
|
261
|
+
* @param targetIndex - index of the segment to land on (random if omitted)
|
|
262
|
+
*/
|
|
263
|
+
spin: (targetIndex?: number) => void;
|
|
264
|
+
}
|
|
265
|
+
interface SpinnerWheelProps {
|
|
266
|
+
/** Wheel segments */
|
|
267
|
+
segments: SpinnerSegment[];
|
|
268
|
+
/** Spin animation duration in ms (default: 4000) */
|
|
269
|
+
duration?: number;
|
|
270
|
+
/** Number of full rotations before landing (default: 3) */
|
|
271
|
+
rotations?: number;
|
|
272
|
+
/** Mode: 'trigger' = spin on demand; 'continuous' = spins on mount, call spin() to land (default: trigger) */
|
|
273
|
+
mode?: 'trigger' | 'continuous';
|
|
274
|
+
/** Called when the wheel lands on a segment */
|
|
275
|
+
onComplete?: (segment: SpinnerSegment) => void;
|
|
276
|
+
/** Pointer / center accent color (default: #22c55e) */
|
|
277
|
+
pointerColor?: string;
|
|
278
|
+
/** Segment border color (default: #ffffff) */
|
|
279
|
+
strokeColor?: string;
|
|
280
|
+
/** Segment border width (default: 2) */
|
|
281
|
+
strokeWidth?: number;
|
|
282
|
+
/** Center circle radius (default: 14) */
|
|
283
|
+
centerRadius?: number;
|
|
284
|
+
/** Center circle color (default: #ffffff) */
|
|
285
|
+
centerColor?: string;
|
|
286
|
+
/** Container style */
|
|
287
|
+
style?: CSSProperties;
|
|
288
|
+
/** Container className */
|
|
289
|
+
className?: string;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* A prize/fortune spinner wheel with configurable segments, spin animation,
|
|
293
|
+
* and optional React content inside each segment.
|
|
294
|
+
*
|
|
295
|
+
* @example Basic spinner with callback
|
|
296
|
+
* ```tsx
|
|
297
|
+
* const wheelRef = useRef<SpinnerWheelHandle>(null)
|
|
298
|
+
*
|
|
299
|
+
* <SpinnerWheel
|
|
300
|
+
* ref={wheelRef}
|
|
301
|
+
* segments={[
|
|
302
|
+
* { id: '1', label: '10% OFF', value: 10, color: '#FF6B6B' },
|
|
303
|
+
* { id: '2', label: '25% OFF', value: 25, color: '#4ECDC4' },
|
|
304
|
+
* { id: '3', label: '50% OFF', value: 50, color: '#45B7D1' },
|
|
305
|
+
* { id: '4', label: '75% OFF', value: 75, color: '#96CEB4' },
|
|
306
|
+
* ]}
|
|
307
|
+
* onComplete={(segment) => alert(`You won ${segment.label}!`)}
|
|
308
|
+
* />
|
|
309
|
+
*
|
|
310
|
+
* <button onClick={() => wheelRef.current?.spin(3)}>Spin to 75% OFF</button>
|
|
311
|
+
* ```
|
|
312
|
+
*
|
|
313
|
+
* @example With custom React content in segments
|
|
314
|
+
* ```tsx
|
|
315
|
+
* <SpinnerWheel
|
|
316
|
+
* ref={wheelRef}
|
|
317
|
+
* segments={[
|
|
318
|
+
* { id: '1', label: '10%', value: 10, color: '#FF6B6B',
|
|
319
|
+
* item: <div style={{ textAlign: 'center' }}>🎁<br/>10%</div> },
|
|
320
|
+
* { id: '2', label: '25%', value: 25, color: '#4ECDC4',
|
|
321
|
+
* item: <div style={{ textAlign: 'center' }}>🎉<br/>25%</div> },
|
|
322
|
+
* ]}
|
|
323
|
+
* duration={5000}
|
|
324
|
+
* rotations={5}
|
|
325
|
+
* />
|
|
326
|
+
* ```
|
|
327
|
+
*/
|
|
328
|
+
declare const SpinnerWheel: react.ForwardRefExoticComponent<SpinnerWheelProps & react.RefAttributes<SpinnerWheelHandle>>;
|
|
329
|
+
|
|
330
|
+
interface DialogHandle {
|
|
331
|
+
/** Open the dialog */
|
|
332
|
+
open: () => void;
|
|
333
|
+
/** Close the dialog */
|
|
334
|
+
close: () => void;
|
|
335
|
+
}
|
|
336
|
+
interface DialogProps {
|
|
337
|
+
/** Controlled open state. If provided, the dialog is controlled externally. */
|
|
338
|
+
open?: boolean;
|
|
339
|
+
/** Called when open state changes (for controlled mode or close events) */
|
|
340
|
+
onOpenChange?: (open: boolean) => void;
|
|
341
|
+
/** Called when the dialog finishes closing */
|
|
342
|
+
onClose?: () => void;
|
|
343
|
+
/** Dialog content */
|
|
344
|
+
children: ReactNode;
|
|
345
|
+
/** Optional trigger element that opens the dialog */
|
|
346
|
+
trigger?: ReactNode;
|
|
347
|
+
/** Dialog title (rendered in header, required for accessibility) */
|
|
348
|
+
title?: string;
|
|
349
|
+
/** Whether to show the close (X) button (default: true) */
|
|
350
|
+
showClose?: boolean;
|
|
351
|
+
/** Whether clicking the overlay closes the dialog (default: true) */
|
|
352
|
+
closeOnOverlayClick?: boolean;
|
|
353
|
+
/** Overlay background color (default: rgba(0,0,0,0.5)) */
|
|
354
|
+
overlayColor?: string;
|
|
355
|
+
/** Dialog panel background color (default: #ffffff) */
|
|
356
|
+
backgroundColor?: string;
|
|
357
|
+
/** Dialog panel border radius (default: 16px) */
|
|
358
|
+
borderRadius?: string | number;
|
|
359
|
+
/** Dialog max width (default: 500px) */
|
|
360
|
+
maxWidth?: string | number;
|
|
361
|
+
/** Dialog panel padding (default: 24px) */
|
|
362
|
+
padding?: string | number;
|
|
363
|
+
/** Additional style for the dialog panel */
|
|
364
|
+
style?: CSSProperties;
|
|
365
|
+
/** Additional className for the dialog panel */
|
|
366
|
+
className?: string;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* A pre-styled centered modal dialog with overlay, close button, and accessibility built in.
|
|
370
|
+
*
|
|
371
|
+
* Supports both controlled and uncontrolled usage.
|
|
372
|
+
*
|
|
373
|
+
* @example Uncontrolled with trigger
|
|
374
|
+
* ```tsx
|
|
375
|
+
* <Dialog
|
|
376
|
+
* trigger={<button>Open</button>}
|
|
377
|
+
* title="Confirm purchase"
|
|
378
|
+
* description="You will be charged $9.99"
|
|
379
|
+
* >
|
|
380
|
+
* <button onClick={() => alert('Confirmed!')}>Confirm</button>
|
|
381
|
+
* </Dialog>
|
|
382
|
+
* ```
|
|
383
|
+
*
|
|
384
|
+
* @example Controlled with ref
|
|
385
|
+
* ```tsx
|
|
386
|
+
* const dialogRef = useRef<DialogHandle>(null)
|
|
387
|
+
*
|
|
388
|
+
* <Dialog ref={dialogRef} title="Checkout" onClose={() => console.log('closed')}>
|
|
389
|
+
* <StripePaymentForm onSuccess={() => dialogRef.current?.close()} />
|
|
390
|
+
* </Dialog>
|
|
391
|
+
*
|
|
392
|
+
* <button onClick={() => dialogRef.current?.open()}>Pay now</button>
|
|
393
|
+
* ```
|
|
394
|
+
*
|
|
395
|
+
* @example Controlled with state
|
|
396
|
+
* ```tsx
|
|
397
|
+
* const [open, setOpen] = useState(false)
|
|
398
|
+
*
|
|
399
|
+
* <Dialog open={open} onOpenChange={setOpen} title="Settings">
|
|
400
|
+
* <p>Dialog content here</p>
|
|
401
|
+
* </Dialog>
|
|
402
|
+
*
|
|
403
|
+
* <button onClick={() => setOpen(true)}>Open settings</button>
|
|
404
|
+
* ```
|
|
405
|
+
*/
|
|
406
|
+
declare const Dialog: react.ForwardRefExoticComponent<DialogProps & react.RefAttributes<DialogHandle>>;
|
|
407
|
+
|
|
408
|
+
interface DrawerHandle {
|
|
409
|
+
/** Open the drawer */
|
|
410
|
+
open: () => void;
|
|
411
|
+
/** Close the drawer */
|
|
412
|
+
close: () => void;
|
|
413
|
+
}
|
|
414
|
+
interface DrawerProps {
|
|
415
|
+
/** Controlled open state */
|
|
416
|
+
open?: boolean;
|
|
417
|
+
/** Called when open state changes */
|
|
418
|
+
onOpenChange?: (open: boolean) => void;
|
|
419
|
+
/** Called when the drawer closes */
|
|
420
|
+
onClose?: () => void;
|
|
421
|
+
/** Drawer content */
|
|
422
|
+
children: ReactNode;
|
|
423
|
+
/** Optional trigger element */
|
|
424
|
+
trigger?: ReactNode;
|
|
425
|
+
/** Drawer height — CSS value like "50vh", "auto", or a number in px (default: 50vh) */
|
|
426
|
+
height?: string | number;
|
|
427
|
+
/** Whether dragging down to dismiss is enabled (default: true) */
|
|
428
|
+
dragToClose?: boolean;
|
|
429
|
+
/** Drag distance threshold to trigger close in px (default: 100) */
|
|
430
|
+
dragThreshold?: number;
|
|
431
|
+
/** Whether clicking overlay closes the drawer (default: true) */
|
|
432
|
+
closeOnOverlayClick?: boolean;
|
|
433
|
+
/** Whether to show the drag handle indicator (default: true) */
|
|
434
|
+
showHandle?: boolean;
|
|
435
|
+
/** Overlay background color (default: rgba(0,0,0,0.5)) */
|
|
436
|
+
overlayColor?: string;
|
|
437
|
+
/** Drawer background color (default: #ffffff) */
|
|
438
|
+
backgroundColor?: string;
|
|
439
|
+
/** Drawer border radius (default: 16) */
|
|
440
|
+
borderRadius?: number;
|
|
441
|
+
/** Drawer panel padding (default: 0) */
|
|
442
|
+
padding?: string | number;
|
|
443
|
+
/** Additional style for the drawer panel */
|
|
444
|
+
style?: CSSProperties;
|
|
445
|
+
/** Additional className for the drawer panel */
|
|
446
|
+
className?: string;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* A bottom sheet drawer with drag-to-close, spring animations,
|
|
450
|
+
* and full accessibility via Radix UI.
|
|
451
|
+
*
|
|
452
|
+
* @example Bottom sheet with trigger
|
|
453
|
+
* ```tsx
|
|
454
|
+
* <Drawer trigger={<button>Show filters</button>} size="60vh">
|
|
455
|
+
* <div style={{ padding: 24 }}>
|
|
456
|
+
* <h2>Filters</h2>
|
|
457
|
+
* </div>
|
|
458
|
+
* </Drawer>
|
|
459
|
+
* ```
|
|
460
|
+
*
|
|
461
|
+
* @example Controlled with ref
|
|
462
|
+
* ```tsx
|
|
463
|
+
* const drawerRef = useRef<DrawerHandle>(null)
|
|
464
|
+
*
|
|
465
|
+
* <Drawer ref={drawerRef} snapPoint={70} onClose={() => console.log('closed')}>
|
|
466
|
+
* <div style={{ padding: 24 }}>
|
|
467
|
+
* <h2>Payment</h2>
|
|
468
|
+
* </div>
|
|
469
|
+
* </Drawer>
|
|
470
|
+
*
|
|
471
|
+
* <button onClick={() => drawerRef.current?.open()}>Checkout</button>
|
|
472
|
+
* ```
|
|
473
|
+
*/
|
|
474
|
+
declare const Drawer: react.ForwardRefExoticComponent<DrawerProps & react.RefAttributes<DrawerHandle>>;
|
|
475
|
+
|
|
476
|
+
interface MarqueeHandle {
|
|
477
|
+
/** Start / resume the scrolling animation */
|
|
478
|
+
start: () => void;
|
|
479
|
+
/** Pause the scrolling animation */
|
|
480
|
+
pause: () => void;
|
|
481
|
+
}
|
|
482
|
+
interface MarqueeProps {
|
|
483
|
+
/** Content to scroll — will be duplicated for seamless looping */
|
|
484
|
+
children: ReactNode;
|
|
485
|
+
/** Scroll speed in pixels per second (default: 50) */
|
|
486
|
+
speed?: number;
|
|
487
|
+
/** Scroll direction (default: 'left') */
|
|
488
|
+
direction?: 'left' | 'right' | 'up' | 'down';
|
|
489
|
+
/** Pause scrolling when the user hovers (default: true) */
|
|
490
|
+
pauseOnHover?: boolean;
|
|
491
|
+
/** Gap between the original and duplicated content (default: 0) */
|
|
492
|
+
gap?: number | string;
|
|
493
|
+
/** Start automatically on mount (default: true) */
|
|
494
|
+
autoStart?: boolean;
|
|
495
|
+
/** Container style overrides */
|
|
496
|
+
style?: CSSProperties;
|
|
497
|
+
/** Container className */
|
|
498
|
+
className?: string;
|
|
499
|
+
}
|
|
500
|
+
declare const Marquee: react.ForwardRefExoticComponent<MarqueeProps & react.RefAttributes<MarqueeHandle>>;
|
|
501
|
+
|
|
502
|
+
interface CarouselHandle {
|
|
503
|
+
/** Go to the next slide */
|
|
504
|
+
next: () => void;
|
|
505
|
+
/** Go to the previous slide */
|
|
506
|
+
prev: () => void;
|
|
507
|
+
/** Jump to a specific slide index */
|
|
508
|
+
goTo: (index: number) => void;
|
|
509
|
+
/** Pause autoplay */
|
|
510
|
+
pause: () => void;
|
|
511
|
+
/** Resume autoplay */
|
|
512
|
+
resume: () => void;
|
|
513
|
+
}
|
|
514
|
+
interface CarouselProps {
|
|
515
|
+
/** Each child is rendered as a slide */
|
|
516
|
+
children: ReactNode[];
|
|
517
|
+
/** Scroll axis (default: 'horizontal') */
|
|
518
|
+
axis?: 'horizontal' | 'vertical';
|
|
519
|
+
/** Enable autoplay (default: false) */
|
|
520
|
+
autoPlay?: boolean;
|
|
521
|
+
/** Autoplay interval in milliseconds (default: 3000) */
|
|
522
|
+
interval?: number;
|
|
523
|
+
/** Loop back to start when reaching the end (default: true) */
|
|
524
|
+
loop?: boolean;
|
|
525
|
+
/** Enable drag/swipe to navigate (default: true) */
|
|
526
|
+
draggable?: boolean;
|
|
527
|
+
/** Slide alignment (default: 'start') */
|
|
528
|
+
align?: 'start' | 'center' | 'end';
|
|
529
|
+
/** Gap between slides */
|
|
530
|
+
gap?: number | string;
|
|
531
|
+
/** Show pagination dots (default: false) */
|
|
532
|
+
showDots?: boolean;
|
|
533
|
+
/** Dot color (default: '#d1d5db') */
|
|
534
|
+
dotColor?: string;
|
|
535
|
+
/** Active dot color (default: '#3b82f6') */
|
|
536
|
+
activeDotColor?: string;
|
|
537
|
+
/** Dot size in pixels (default: 8) */
|
|
538
|
+
dotSize?: number;
|
|
539
|
+
/** Gap between dots in pixels (default: 8) */
|
|
540
|
+
dotGap?: number;
|
|
541
|
+
/** Show prev/next arrow buttons (default: false) */
|
|
542
|
+
showArrows?: boolean;
|
|
543
|
+
/** Render custom previous arrow — receives onClick handler */
|
|
544
|
+
renderPrevArrow?: (onClick: () => void, enabled: boolean) => ReactNode;
|
|
545
|
+
/** Render custom next arrow — receives onClick handler */
|
|
546
|
+
renderNextArrow?: (onClick: () => void, enabled: boolean) => ReactNode;
|
|
547
|
+
/** Called when the active slide changes */
|
|
548
|
+
onSlideChange?: (index: number) => void;
|
|
549
|
+
/** Container style overrides */
|
|
550
|
+
style?: CSSProperties;
|
|
551
|
+
/** Container className */
|
|
552
|
+
className?: string;
|
|
553
|
+
/** Slide wrapper style overrides (applied to each slide container) */
|
|
554
|
+
slideStyle?: CSSProperties;
|
|
555
|
+
}
|
|
556
|
+
declare const Carousel: react.ForwardRefExoticComponent<CarouselProps & react.RefAttributes<CarouselHandle>>;
|
|
557
|
+
|
|
558
|
+
interface SingleSelectProps<T> {
|
|
559
|
+
/** The response key to store the selected value under (in answers.*) */
|
|
560
|
+
responseKey: string;
|
|
561
|
+
/** Array of option objects */
|
|
562
|
+
options: T[];
|
|
563
|
+
/** Extract a unique value from each option (used as the stored response) */
|
|
564
|
+
keyExtractor?: (item: T, index: number) => string;
|
|
565
|
+
/** Render each option. Receives the item and whether it's currently selected. */
|
|
566
|
+
renderItem: (info: {
|
|
567
|
+
item: T;
|
|
568
|
+
index: number;
|
|
569
|
+
active: boolean;
|
|
570
|
+
}) => ReactNode;
|
|
571
|
+
/** Automatically advance to the next page on selection (default: true) */
|
|
572
|
+
autoAdvance?: boolean;
|
|
573
|
+
/** Delay in ms before auto-advancing (default: 200) */
|
|
574
|
+
autoAdvanceDelay?: number;
|
|
575
|
+
/** Container className */
|
|
576
|
+
className?: string;
|
|
577
|
+
}
|
|
578
|
+
declare function SingleSelect<T>({ responseKey, options, keyExtractor, renderItem, autoAdvance, autoAdvanceDelay, className, }: SingleSelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
579
|
+
|
|
580
|
+
interface MultiSelectProps<T> {
|
|
581
|
+
/** The response key to store the selected values under (in answers.*) */
|
|
582
|
+
responseKey: string;
|
|
583
|
+
/** Array of option objects */
|
|
584
|
+
options: T[];
|
|
585
|
+
/** Extract a unique value from each option (used as the stored response) */
|
|
586
|
+
keyExtractor?: (item: T, index: number) => string;
|
|
587
|
+
/** Render each option. Receives the item and whether it's currently selected. */
|
|
588
|
+
renderItem: (info: {
|
|
589
|
+
item: T;
|
|
590
|
+
index: number;
|
|
591
|
+
active: boolean;
|
|
592
|
+
}) => ReactNode;
|
|
593
|
+
/** Minimum number of selections required (default: 0) */
|
|
594
|
+
min?: number;
|
|
595
|
+
/** Maximum number of selections allowed (default: unlimited) */
|
|
596
|
+
max?: number;
|
|
597
|
+
/** Container className */
|
|
598
|
+
className?: string;
|
|
599
|
+
}
|
|
600
|
+
declare function MultiSelect<T>({ responseKey, options, keyExtractor, renderItem, min, max, className, }: MultiSelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
601
|
+
|
|
602
|
+
export { Carousel, type CarouselHandle, type CarouselProps, CountUp, type CountUpHandle, type CountUpProps, Dialog, type DialogHandle, type DialogProps, Drawer, type DrawerHandle, type DrawerProps, type EasingType, Marquee, type MarqueeHandle, type MarqueeProps, MultiSelect, type MultiSelectProps, ProgressBar, type ProgressBarCheckpoint, type ProgressBarHandle, type ProgressBarProps, ProgressCircle, type ProgressCircleCheckpoint, type ProgressCircleHandle, type ProgressCircleProps, SingleSelect, type SingleSelectProps, type SpinnerSegment, SpinnerWheel, type SpinnerWheelHandle, type SpinnerWheelProps };
|