|
1 | 1 | import type * as marquee from '@zag-js/marquee' |
2 | | -import type { Optional } from '../../types' |
3 | 2 |
|
4 | | -export interface RootProps extends Optional<Omit<marquee.Props, 'dir' | 'getRootNode'>, 'id'> {} |
| 3 | +export interface RootProps { |
| 4 | + /** |
| 5 | + * Whether to automatically duplicate content to fill the container. |
| 6 | + * @default false |
| 7 | + */ |
| 8 | + autoFill?: boolean |
| 9 | + /** |
| 10 | + * Whether the marquee is paused by default. |
| 11 | + * @default false |
| 12 | + */ |
| 13 | + defaultPaused?: boolean |
| 14 | + /** |
| 15 | + * The delay before the animation starts (in seconds). |
| 16 | + * @default 0 |
| 17 | + */ |
| 18 | + delay?: number |
| 19 | + /** |
| 20 | + * The unique identifier of the machine. |
| 21 | + */ |
| 22 | + id?: string |
| 23 | + /** |
| 24 | + * The ids of the elements in the marquee. Useful for composition. |
| 25 | + */ |
| 26 | + ids?: Partial<{ root: string; viewport: string; content: (index: number) => string }> |
| 27 | + /** |
| 28 | + * The number of times to loop the animation (0 = infinite). |
| 29 | + * @default 0 |
| 30 | + */ |
| 31 | + loopCount?: number |
| 32 | + /** |
| 33 | + * Whether to pause the marquee on user interaction (hover, focus). |
| 34 | + * @default false |
| 35 | + */ |
| 36 | + pauseOnInteraction?: boolean |
| 37 | + /** |
| 38 | + * Whether the marquee is paused. |
| 39 | + */ |
| 40 | + paused?: boolean |
| 41 | + /** |
| 42 | + * Whether to reverse the animation direction. |
| 43 | + * @default false |
| 44 | + */ |
| 45 | + reverse?: boolean |
| 46 | + /** |
| 47 | + * The side/direction the marquee scrolls towards. |
| 48 | + * @default "start" |
| 49 | + */ |
| 50 | + side?: marquee.Side |
| 51 | + /** |
| 52 | + * The spacing between marquee items. |
| 53 | + * @default "1rem" |
| 54 | + */ |
| 55 | + spacing?: string |
| 56 | + /** |
| 57 | + * The speed of the marquee animation in pixels per second. |
| 58 | + * @default 50 |
| 59 | + */ |
| 60 | + speed?: number |
| 61 | + /** |
| 62 | + * The localized messages to use. |
| 63 | + */ |
| 64 | + translations?: marquee.IntlTranslations |
| 65 | +} |
5 | 66 |
|
6 | | -export interface RootEmits { |
7 | | - pauseChange: [details: marquee.PauseStatusDetails] |
8 | | - loopComplete: [] |
| 67 | +export type RootEmits = { |
| 68 | + /** |
| 69 | + * Function called when the marquee completes all loops and stops. |
| 70 | + * Only fires for finite loops (loopCount > 0). |
| 71 | + */ |
9 | 72 | complete: [] |
| 73 | + /** |
| 74 | + * Function called when the marquee completes one loop iteration. |
| 75 | + */ |
| 76 | + loopComplete: [] |
| 77 | + /** |
| 78 | + * Function called when the pause status changes. |
| 79 | + */ |
| 80 | + pauseChange: [details: marquee.PauseStatusDetails] |
10 | 81 | } |
0 commit comments