@create-lft-app/nextjs 3.2.0 → 3.3.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 +549 -549
- package/package.json +48 -48
- package/template/.claude/skills/anti-patterns.md +150 -0
- package/template/.claude/skills/drizzle-schema.md +178 -0
- package/template/.claude/skills/formatting.md +56 -0
- package/template/.claude/skills/module-architecture.md +143 -0
- package/template/.claude/skills/supabase-server-actions.md +199 -0
- package/template/.claude/skills/ui-patterns.md +161 -0
- package/template/CLAUDE.md +114 -1239
- package/template/drizzle.config.ts +12 -12
- package/template/eslint.config.mjs +16 -16
- package/template/gitignore +36 -36
- package/template/next.config.ts +7 -7
- package/template/package.json +86 -86
- package/template/postcss.config.mjs +7 -7
- package/template/proxy.ts +12 -12
- package/template/public/logolft.svg +11 -11
- package/template/src/app/(auth)/dashboard/dashboard-content.tsx +124 -124
- package/template/src/app/(auth)/dashboard/page.tsx +9 -9
- package/template/src/app/(auth)/layout.tsx +7 -7
- package/template/src/app/(auth)/users/page.tsx +9 -9
- package/template/src/app/(auth)/users/users-content.tsx +26 -26
- package/template/src/app/(public)/layout.tsx +7 -7
- package/template/src/app/(public)/login/page.tsx +17 -17
- package/template/src/app/api/webhooks/route.ts +20 -20
- package/template/src/app/globals.css +249 -249
- package/template/src/app/layout.tsx +37 -37
- package/template/src/app/page.tsx +5 -5
- package/template/src/app/providers.tsx +27 -27
- package/template/src/components/layout/main-content.tsx +28 -28
- package/template/src/components/layout/sidebar-context.tsx +33 -33
- package/template/src/components/layout/sidebar.tsx +141 -141
- package/template/src/components/tables/data-table-column-header.tsx +68 -68
- package/template/src/components/tables/data-table-date-filter.tsx +203 -203
- package/template/src/components/tables/data-table-faceted-filter.tsx +185 -185
- package/template/src/components/tables/data-table-filters-dropdown.tsx +130 -130
- package/template/src/components/tables/data-table-number-filter.tsx +295 -295
- package/template/src/components/tables/data-table-pagination.tsx +99 -99
- package/template/src/components/tables/data-table-toolbar.tsx +140 -140
- package/template/src/components/tables/data-table-view-options.tsx +63 -63
- package/template/src/components/tables/data-table.tsx +148 -148
- package/template/src/components/tables/index.ts +9 -9
- package/template/src/components/ui/accordion.tsx +58 -58
- package/template/src/components/ui/alert-dialog.tsx +165 -165
- package/template/src/components/ui/alert.tsx +66 -66
- package/template/src/components/ui/animations/index.ts +44 -44
- package/template/src/components/ui/avatar.tsx +55 -55
- package/template/src/components/ui/badge.tsx +50 -50
- package/template/src/components/ui/button.tsx +118 -118
- package/template/src/components/ui/calendar.tsx +220 -220
- package/template/src/components/ui/card.tsx +113 -113
- package/template/src/components/ui/checkbox.tsx +38 -38
- package/template/src/components/ui/collapsible.tsx +33 -33
- package/template/src/components/ui/command.tsx +196 -196
- package/template/src/components/ui/dialog.tsx +156 -156
- package/template/src/components/ui/dropdown-menu.tsx +280 -280
- package/template/src/components/ui/form.tsx +171 -171
- package/template/src/components/ui/icons.tsx +167 -167
- package/template/src/components/ui/input.tsx +28 -28
- package/template/src/components/ui/label.tsx +25 -25
- package/template/src/components/ui/motion.tsx +197 -197
- package/template/src/components/ui/page-transition.tsx +166 -166
- package/template/src/components/ui/popover.tsx +59 -59
- package/template/src/components/ui/progress.tsx +32 -32
- package/template/src/components/ui/radio-group.tsx +45 -45
- package/template/src/components/ui/scroll-area.tsx +63 -63
- package/template/src/components/ui/select.tsx +208 -208
- package/template/src/components/ui/separator.tsx +28 -28
- package/template/src/components/ui/sheet.tsx +170 -170
- package/template/src/components/ui/sidebar.tsx +726 -726
- package/template/src/components/ui/skeleton.tsx +15 -15
- package/template/src/components/ui/slider.tsx +58 -58
- package/template/src/components/ui/sonner.tsx +47 -47
- package/template/src/components/ui/spinner.tsx +27 -27
- package/template/src/components/ui/submit-button.tsx +47 -47
- package/template/src/components/ui/switch.tsx +31 -31
- package/template/src/components/ui/table.tsx +120 -120
- package/template/src/components/ui/tabs.tsx +75 -75
- package/template/src/components/ui/textarea.tsx +26 -26
- package/template/src/components/ui/tooltip.tsx +70 -70
- package/template/src/config/navigation.ts +59 -59
- package/template/src/config/roles.ts +27 -27
- package/template/src/config/site.ts +12 -12
- package/template/src/db/index.ts +12 -12
- package/template/src/db/schema/index.ts +1 -1
- package/template/src/db/schema/users.ts +16 -16
- package/template/src/db/seed.ts +39 -39
- package/template/src/hooks/index.ts +3 -3
- package/template/src/hooks/use-mobile.ts +21 -21
- package/template/src/hooks/useDataTable.ts +82 -82
- package/template/src/hooks/useDebounce.ts +49 -49
- package/template/src/hooks/useMediaQuery.ts +36 -36
- package/template/src/lib/date/config.ts +36 -36
- package/template/src/lib/date/formatters.ts +127 -127
- package/template/src/lib/date/index.ts +26 -26
- package/template/src/lib/excel/exporter.ts +89 -89
- package/template/src/lib/excel/index.ts +14 -14
- package/template/src/lib/excel/parser.ts +96 -96
- package/template/src/lib/query-client.ts +35 -35
- package/template/src/lib/supabase/admin.ts +23 -23
- package/template/src/lib/supabase/client.ts +11 -11
- package/template/src/lib/supabase/proxy.ts +67 -67
- package/template/src/lib/supabase/server.ts +38 -38
- package/template/src/lib/supabase/types.ts +53 -53
- package/template/src/lib/utils.ts +6 -6
- package/template/src/lib/validations/common.ts +75 -75
- package/template/src/lib/validations/index.ts +20 -20
- package/template/src/modules/auth/actions/auth-actions.ts +59 -59
- package/template/src/modules/auth/components/login-form.tsx +68 -68
- package/template/src/modules/auth/hooks/useAuth.ts +38 -38
- package/template/src/modules/auth/hooks/useAuthMutations.ts +43 -43
- package/template/src/modules/auth/hooks/useAuthQueries.ts +43 -43
- package/template/src/modules/auth/index.ts +12 -12
- package/template/src/modules/auth/schemas/auth.schema.ts +32 -32
- package/template/src/modules/auth/stores/useAuthStore.ts +37 -37
- package/template/src/modules/users/actions/users-actions.ts +166 -166
- package/template/src/modules/users/columns.tsx +106 -106
- package/template/src/modules/users/components/users-list.tsx +48 -48
- package/template/src/modules/users/hooks/useUsers.ts +39 -39
- package/template/src/modules/users/hooks/useUsersMutations.ts +55 -55
- package/template/src/modules/users/hooks/useUsersQueries.ts +35 -35
- package/template/src/modules/users/index.ts +30 -30
- package/template/src/modules/users/schemas/users.schema.ts +51 -51
- package/template/src/modules/users/stores/useUsersStore.ts +60 -60
- package/template/src/modules/users/types/auth-user.types.ts +42 -42
- package/template/src/modules/users/utils/user-mapper.ts +32 -32
- package/template/src/stores/index.ts +1 -1
- package/template/src/stores/useUiStore.ts +55 -55
- package/template/src/types/api.ts +28 -28
- package/template/src/types/index.ts +2 -2
- package/template/src/types/table.ts +34 -34
- package/template/supabase/config.toml +94 -94
- package/template/tsconfig.json +42 -42
|
@@ -1,197 +1,197 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { motion, type HTMLMotionProps, type Variants } from 'framer-motion'
|
|
4
|
-
import { forwardRef } from 'react'
|
|
5
|
-
|
|
6
|
-
// Variantes de animación reutilizables
|
|
7
|
-
export const fadeIn: Variants = {
|
|
8
|
-
hidden: { opacity: 0 },
|
|
9
|
-
visible: { opacity: 1 },
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const fadeInUp: Variants = {
|
|
13
|
-
hidden: { opacity: 0, y: 20 },
|
|
14
|
-
visible: { opacity: 1, y: 0 },
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const fadeInDown: Variants = {
|
|
18
|
-
hidden: { opacity: 0, y: -20 },
|
|
19
|
-
visible: { opacity: 1, y: 0 },
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const fadeInLeft: Variants = {
|
|
23
|
-
hidden: { opacity: 0, x: -20 },
|
|
24
|
-
visible: { opacity: 1, x: 0 },
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const fadeInRight: Variants = {
|
|
28
|
-
hidden: { opacity: 0, x: 20 },
|
|
29
|
-
visible: { opacity: 1, x: 0 },
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const scaleIn: Variants = {
|
|
33
|
-
hidden: { opacity: 0, scale: 0.95 },
|
|
34
|
-
visible: { opacity: 1, scale: 1 },
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const slideInFromBottom: Variants = {
|
|
38
|
-
hidden: { y: '100%' },
|
|
39
|
-
visible: { y: 0 },
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const slideInFromTop: Variants = {
|
|
43
|
-
hidden: { y: '-100%' },
|
|
44
|
-
visible: { y: 0 },
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export const staggerContainer: Variants = {
|
|
48
|
-
hidden: { opacity: 0 },
|
|
49
|
-
visible: {
|
|
50
|
-
opacity: 1,
|
|
51
|
-
transition: {
|
|
52
|
-
staggerChildren: 0.1,
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export const staggerItem: Variants = {
|
|
58
|
-
hidden: { opacity: 0, y: 20 },
|
|
59
|
-
visible: { opacity: 1, y: 0 },
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Transiciones predefinidas
|
|
63
|
-
export const springTransition = {
|
|
64
|
-
type: 'spring',
|
|
65
|
-
stiffness: 300,
|
|
66
|
-
damping: 30,
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export const easeTransition = {
|
|
70
|
-
duration: 0.3,
|
|
71
|
-
ease: [0.25, 0.1, 0.25, 1],
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export const smoothTransition = {
|
|
75
|
-
duration: 0.4,
|
|
76
|
-
ease: 'easeInOut',
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Componentes de animación base
|
|
80
|
-
export const MotionDiv = motion.div
|
|
81
|
-
export const MotionSpan = motion.span
|
|
82
|
-
export const MotionButton = motion.button
|
|
83
|
-
export const MotionUl = motion.ul
|
|
84
|
-
export const MotionLi = motion.li
|
|
85
|
-
export const MotionNav = motion.nav
|
|
86
|
-
export const MotionSection = motion.section
|
|
87
|
-
export const MotionArticle = motion.article
|
|
88
|
-
export const MotionHeader = motion.header
|
|
89
|
-
export const MotionFooter = motion.footer
|
|
90
|
-
export const MotionMain = motion.main
|
|
91
|
-
export const MotionAside = motion.aside
|
|
92
|
-
|
|
93
|
-
// Componente FadeIn genérico
|
|
94
|
-
interface FadeInProps extends HTMLMotionProps<'div'> {
|
|
95
|
-
direction?: 'up' | 'down' | 'left' | 'right' | 'none'
|
|
96
|
-
delay?: number
|
|
97
|
-
duration?: number
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export const FadeIn = forwardRef<HTMLDivElement, FadeInProps>(
|
|
101
|
-
({ children, direction = 'up', delay = 0, duration = 0.4, ...props }, ref) => {
|
|
102
|
-
const variants: Record<string, Variants> = {
|
|
103
|
-
up: fadeInUp,
|
|
104
|
-
down: fadeInDown,
|
|
105
|
-
left: fadeInLeft,
|
|
106
|
-
right: fadeInRight,
|
|
107
|
-
none: fadeIn,
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<motion.div
|
|
112
|
-
ref={ref}
|
|
113
|
-
initial="hidden"
|
|
114
|
-
animate="visible"
|
|
115
|
-
variants={variants[direction]}
|
|
116
|
-
transition={{ duration, delay, ease: 'easeOut' }}
|
|
117
|
-
{...props}
|
|
118
|
-
>
|
|
119
|
-
{children}
|
|
120
|
-
</motion.div>
|
|
121
|
-
)
|
|
122
|
-
}
|
|
123
|
-
)
|
|
124
|
-
FadeIn.displayName = 'FadeIn'
|
|
125
|
-
|
|
126
|
-
// Componente ScaleIn
|
|
127
|
-
interface ScaleInProps extends HTMLMotionProps<'div'> {
|
|
128
|
-
delay?: number
|
|
129
|
-
duration?: number
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export const ScaleIn = forwardRef<HTMLDivElement, ScaleInProps>(
|
|
133
|
-
({ children, delay = 0, duration = 0.3, ...props }, ref) => {
|
|
134
|
-
return (
|
|
135
|
-
<motion.div
|
|
136
|
-
ref={ref}
|
|
137
|
-
initial="hidden"
|
|
138
|
-
animate="visible"
|
|
139
|
-
variants={scaleIn}
|
|
140
|
-
transition={{ duration, delay, ...springTransition }}
|
|
141
|
-
{...props}
|
|
142
|
-
>
|
|
143
|
-
{children}
|
|
144
|
-
</motion.div>
|
|
145
|
-
)
|
|
146
|
-
}
|
|
147
|
-
)
|
|
148
|
-
ScaleIn.displayName = 'ScaleIn'
|
|
149
|
-
|
|
150
|
-
// Componente para listas con stagger
|
|
151
|
-
interface StaggerListProps extends HTMLMotionProps<'ul'> {
|
|
152
|
-
staggerDelay?: number
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export const StaggerList = forwardRef<HTMLUListElement, StaggerListProps>(
|
|
156
|
-
({ children, staggerDelay = 0.1, ...props }, ref) => {
|
|
157
|
-
return (
|
|
158
|
-
<motion.ul
|
|
159
|
-
ref={ref}
|
|
160
|
-
initial="hidden"
|
|
161
|
-
animate="visible"
|
|
162
|
-
variants={{
|
|
163
|
-
hidden: { opacity: 0 },
|
|
164
|
-
visible: {
|
|
165
|
-
opacity: 1,
|
|
166
|
-
transition: {
|
|
167
|
-
staggerChildren: staggerDelay,
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
}}
|
|
171
|
-
{...props}
|
|
172
|
-
>
|
|
173
|
-
{children}
|
|
174
|
-
</motion.ul>
|
|
175
|
-
)
|
|
176
|
-
}
|
|
177
|
-
)
|
|
178
|
-
StaggerList.displayName = 'StaggerList'
|
|
179
|
-
|
|
180
|
-
export const StaggerItem = forwardRef<HTMLLIElement, HTMLMotionProps<'li'>>(
|
|
181
|
-
({ children, ...props }, ref) => {
|
|
182
|
-
return (
|
|
183
|
-
<motion.li
|
|
184
|
-
ref={ref}
|
|
185
|
-
variants={staggerItem}
|
|
186
|
-
transition={easeTransition}
|
|
187
|
-
{...props}
|
|
188
|
-
>
|
|
189
|
-
{children}
|
|
190
|
-
</motion.li>
|
|
191
|
-
)
|
|
192
|
-
}
|
|
193
|
-
)
|
|
194
|
-
StaggerItem.displayName = 'StaggerItem'
|
|
195
|
-
|
|
196
|
-
// Componente de presencia animada para entradas/salidas
|
|
197
|
-
export { AnimatePresence } from 'framer-motion'
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { motion, type HTMLMotionProps, type Variants } from 'framer-motion'
|
|
4
|
+
import { forwardRef } from 'react'
|
|
5
|
+
|
|
6
|
+
// Variantes de animación reutilizables
|
|
7
|
+
export const fadeIn: Variants = {
|
|
8
|
+
hidden: { opacity: 0 },
|
|
9
|
+
visible: { opacity: 1 },
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const fadeInUp: Variants = {
|
|
13
|
+
hidden: { opacity: 0, y: 20 },
|
|
14
|
+
visible: { opacity: 1, y: 0 },
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const fadeInDown: Variants = {
|
|
18
|
+
hidden: { opacity: 0, y: -20 },
|
|
19
|
+
visible: { opacity: 1, y: 0 },
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const fadeInLeft: Variants = {
|
|
23
|
+
hidden: { opacity: 0, x: -20 },
|
|
24
|
+
visible: { opacity: 1, x: 0 },
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const fadeInRight: Variants = {
|
|
28
|
+
hidden: { opacity: 0, x: 20 },
|
|
29
|
+
visible: { opacity: 1, x: 0 },
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const scaleIn: Variants = {
|
|
33
|
+
hidden: { opacity: 0, scale: 0.95 },
|
|
34
|
+
visible: { opacity: 1, scale: 1 },
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const slideInFromBottom: Variants = {
|
|
38
|
+
hidden: { y: '100%' },
|
|
39
|
+
visible: { y: 0 },
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const slideInFromTop: Variants = {
|
|
43
|
+
hidden: { y: '-100%' },
|
|
44
|
+
visible: { y: 0 },
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const staggerContainer: Variants = {
|
|
48
|
+
hidden: { opacity: 0 },
|
|
49
|
+
visible: {
|
|
50
|
+
opacity: 1,
|
|
51
|
+
transition: {
|
|
52
|
+
staggerChildren: 0.1,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const staggerItem: Variants = {
|
|
58
|
+
hidden: { opacity: 0, y: 20 },
|
|
59
|
+
visible: { opacity: 1, y: 0 },
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Transiciones predefinidas
|
|
63
|
+
export const springTransition = {
|
|
64
|
+
type: 'spring',
|
|
65
|
+
stiffness: 300,
|
|
66
|
+
damping: 30,
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const easeTransition = {
|
|
70
|
+
duration: 0.3,
|
|
71
|
+
ease: [0.25, 0.1, 0.25, 1],
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const smoothTransition = {
|
|
75
|
+
duration: 0.4,
|
|
76
|
+
ease: 'easeInOut',
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Componentes de animación base
|
|
80
|
+
export const MotionDiv = motion.div
|
|
81
|
+
export const MotionSpan = motion.span
|
|
82
|
+
export const MotionButton = motion.button
|
|
83
|
+
export const MotionUl = motion.ul
|
|
84
|
+
export const MotionLi = motion.li
|
|
85
|
+
export const MotionNav = motion.nav
|
|
86
|
+
export const MotionSection = motion.section
|
|
87
|
+
export const MotionArticle = motion.article
|
|
88
|
+
export const MotionHeader = motion.header
|
|
89
|
+
export const MotionFooter = motion.footer
|
|
90
|
+
export const MotionMain = motion.main
|
|
91
|
+
export const MotionAside = motion.aside
|
|
92
|
+
|
|
93
|
+
// Componente FadeIn genérico
|
|
94
|
+
interface FadeInProps extends HTMLMotionProps<'div'> {
|
|
95
|
+
direction?: 'up' | 'down' | 'left' | 'right' | 'none'
|
|
96
|
+
delay?: number
|
|
97
|
+
duration?: number
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export const FadeIn = forwardRef<HTMLDivElement, FadeInProps>(
|
|
101
|
+
({ children, direction = 'up', delay = 0, duration = 0.4, ...props }, ref) => {
|
|
102
|
+
const variants: Record<string, Variants> = {
|
|
103
|
+
up: fadeInUp,
|
|
104
|
+
down: fadeInDown,
|
|
105
|
+
left: fadeInLeft,
|
|
106
|
+
right: fadeInRight,
|
|
107
|
+
none: fadeIn,
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<motion.div
|
|
112
|
+
ref={ref}
|
|
113
|
+
initial="hidden"
|
|
114
|
+
animate="visible"
|
|
115
|
+
variants={variants[direction]}
|
|
116
|
+
transition={{ duration, delay, ease: 'easeOut' }}
|
|
117
|
+
{...props}
|
|
118
|
+
>
|
|
119
|
+
{children}
|
|
120
|
+
</motion.div>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
FadeIn.displayName = 'FadeIn'
|
|
125
|
+
|
|
126
|
+
// Componente ScaleIn
|
|
127
|
+
interface ScaleInProps extends HTMLMotionProps<'div'> {
|
|
128
|
+
delay?: number
|
|
129
|
+
duration?: number
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export const ScaleIn = forwardRef<HTMLDivElement, ScaleInProps>(
|
|
133
|
+
({ children, delay = 0, duration = 0.3, ...props }, ref) => {
|
|
134
|
+
return (
|
|
135
|
+
<motion.div
|
|
136
|
+
ref={ref}
|
|
137
|
+
initial="hidden"
|
|
138
|
+
animate="visible"
|
|
139
|
+
variants={scaleIn}
|
|
140
|
+
transition={{ duration, delay, ...springTransition }}
|
|
141
|
+
{...props}
|
|
142
|
+
>
|
|
143
|
+
{children}
|
|
144
|
+
</motion.div>
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
ScaleIn.displayName = 'ScaleIn'
|
|
149
|
+
|
|
150
|
+
// Componente para listas con stagger
|
|
151
|
+
interface StaggerListProps extends HTMLMotionProps<'ul'> {
|
|
152
|
+
staggerDelay?: number
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export const StaggerList = forwardRef<HTMLUListElement, StaggerListProps>(
|
|
156
|
+
({ children, staggerDelay = 0.1, ...props }, ref) => {
|
|
157
|
+
return (
|
|
158
|
+
<motion.ul
|
|
159
|
+
ref={ref}
|
|
160
|
+
initial="hidden"
|
|
161
|
+
animate="visible"
|
|
162
|
+
variants={{
|
|
163
|
+
hidden: { opacity: 0 },
|
|
164
|
+
visible: {
|
|
165
|
+
opacity: 1,
|
|
166
|
+
transition: {
|
|
167
|
+
staggerChildren: staggerDelay,
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
}}
|
|
171
|
+
{...props}
|
|
172
|
+
>
|
|
173
|
+
{children}
|
|
174
|
+
</motion.ul>
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
StaggerList.displayName = 'StaggerList'
|
|
179
|
+
|
|
180
|
+
export const StaggerItem = forwardRef<HTMLLIElement, HTMLMotionProps<'li'>>(
|
|
181
|
+
({ children, ...props }, ref) => {
|
|
182
|
+
return (
|
|
183
|
+
<motion.li
|
|
184
|
+
ref={ref}
|
|
185
|
+
variants={staggerItem}
|
|
186
|
+
transition={easeTransition}
|
|
187
|
+
{...props}
|
|
188
|
+
>
|
|
189
|
+
{children}
|
|
190
|
+
</motion.li>
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
)
|
|
194
|
+
StaggerItem.displayName = 'StaggerItem'
|
|
195
|
+
|
|
196
|
+
// Componente de presencia animada para entradas/salidas
|
|
197
|
+
export { AnimatePresence } from 'framer-motion'
|