Skip to content

Commit 4fedd7e

Browse files
committed
fix(docs): resolve InfinitySlider error
1 parent 0df9c1a commit 4fedd7e

4 files changed

Lines changed: 17 additions & 105 deletions

File tree

docs/src/@types/props.ts

Lines changed: 11 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,22 @@
1-
import type { StaticImageData } from "next/image"
2-
import type { ButtonHTMLAttributes, PropsWithChildren, JSX, CSSProperties, MouseEventHandler } from "react"
3-
import type { VariantProps } from "class-variance-authority"
4-
import type { ArgsFunction, PerType, PresetType } from "./types"
5-
import type { Transition, Variants } from "motion"
6-
import type { MotionProps } from "motion/react"
1+
import type { PropsWithChildren } from "react"
2+
import type { PresetType } from "./types"
3+
import type { Variants } from "motion"
74

8-
export type ButtonProps<T extends ArgsFunction> = ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<T>
9-
10-
export interface ImageSetProps {
11-
width?: number
12-
height?: number
13-
src?: StaticImageData
14-
alt?: string
15-
}
16-
17-
export interface TitleProps extends ImageSetProps {
18-
className?: string
19-
title: string
20-
}
21-
22-
export interface SeparatorProps {
5+
export interface AnimatedGroupProps extends PropsWithChildren {
236
className?: string
24-
redirectTo?: string
25-
children: string
26-
rotate?: boolean
27-
}
28-
29-
export interface AnimationComponentProps {
30-
segment: string
31-
variants: Variants
32-
per: PerType
33-
segmentWrapperClassName?: string
34-
}
35-
36-
export interface TextEffectProps {
37-
children: string
38-
per?: PerType
39-
as?: keyof JSX.IntrinsicElements
407
variants?: {
418
container?: Variants
429
item?: Variants
4310
}
44-
className?: string
4511
preset?: PresetType
46-
delay?: number
47-
speedReveal?: number
48-
speedSegment?: number
49-
trigger?: boolean
50-
onAnimationComplete?: () => void
51-
onAnimationStart?: () => void
52-
segmentWrapperClassName?: string
53-
containerTransition?: Transition
54-
segmentTransition?: Transition
55-
style?: CSSProperties
5612
}
5713

58-
export type TextScrambleEffectProps = {
59-
children: string
14+
export interface InfiniteSliderProps {
15+
children: React.ReactNode
16+
gap?: number
6017
duration?: number
61-
speed?: number
62-
characterSet?: string
63-
as?: React.ElementType
64-
className?: string
65-
trigger?: boolean
66-
onScrambleComplete?: () => void
67-
} & MotionProps
68-
69-
export interface TextScrambleProps {
70-
children: string
71-
as?: React.ElementType
72-
characterSet?: string
73-
}
74-
75-
export interface SegmentAnimationProps {
76-
title: string
77-
description: string
78-
}
79-
80-
export interface CallToActionProps {
81-
title: string
82-
description: string
83-
button: string
84-
href: string
85-
separator: string
86-
}
87-
88-
export interface SectionLayoutProps extends PropsWithChildren {
89-
className?: string
90-
}
91-
92-
export interface HeaderMenuProps {
93-
onLinkClick: MouseEventHandler
94-
}
95-
96-
export interface AnimatedGroupProps extends PropsWithChildren {
18+
durationOnHover?: number
19+
direction?: "horizontal" | "vertical"
20+
reverse?: boolean
9721
className?: string
98-
variants?: {
99-
container?: Variants
100-
item?: Variants
101-
}
102-
preset?: PresetType
103-
}
22+
}

docs/src/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const inter = Inter({
1212

1313
export const metadata = meta
1414

15-
export default function RootLayout({ children }: Required<PropsWithChildren<{}>>) {
15+
export default function RootLayout({ children }: LayoutProps<"/">) {
1616
return (
1717
<html className="scroll-smooth" lang="en" suppressHydrationWarning>
1818
<body className={`${inter.className} max-w-dvw min-h-screen antialiased flex flex-col relative overflow-x-hidden`}>

docs/src/components/powered-by.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const PoweredBy = () => {
1010
<p className="text-end text-sm">Powered by</p>
1111
</div>
1212
<div className="relative py-6 md:w-[calc(100%-7rem)]">
13-
<InfiniteSlider speedOnHover={20} speed={40} gap={112}>
13+
<InfiniteSlider durationOnHover={20} duration={40} gap={112}>
1414
<div className="flex">
1515
<Image
1616
className="mx-auto h-4 w-fit dark:invert"

docs/src/components/ui/infinite-slider.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
"use client"
2-
import { cn } from "@/lib/utils"
3-
import { useMotionValue, animate, motion } from "framer-motion"
42
import { useState, useEffect } from "react"
53
import useMeasure from "react-use-measure"
4+
import { InfiniteSliderProps } from "@/@types/props"
5+
import { cn } from "@/lib/utils"
6+
import { useMotionValue, animate, motion } from "framer-motion"
7+
68

7-
type InfiniteSliderProps = {
8-
children: React.ReactNode
9-
gap?: number
10-
duration?: number
11-
durationOnHover?: number
12-
direction?: "horizontal" | "vertical"
13-
reverse?: boolean
14-
className?: string
15-
}
169

1710
export function InfiniteSlider({
1811
children,

0 commit comments

Comments
 (0)