This commit is contained in:
2026-05-03 18:38:18 +02:00
parent 1446db75d9
commit c61b1b19bb
3 changed files with 13 additions and 11 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@avocadi/ui", "name": "@avocadi/ui",
"type": "module", "type": "module",
"version": "0.2.13", "version": "0.2.14",
"description": "ui elements for avocadi", "description": "ui elements for avocadi",
"private": false, "private": false,
"files": [ "files": [
+6 -7
View File
@@ -5,6 +5,10 @@ import { type HTMLMotionProps, motion } from "motion/react";
import { forwardRef, type HTMLAttributes, type ReactNode } from "react"; import { forwardRef, type HTMLAttributes, type ReactNode } from "react";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { CardDepthProvider, useCardDepth } from "./card-context"; import { CardDepthProvider, useCardDepth } from "./card-context";
import {
defaultTransitionCard,
defaultVariantsCard,
} from "./styles/animations";
const cardVariants = cva( const cardVariants = cva(
`flex flex-col gap-2 ring-2 rounded-card `flex flex-col gap-2 ring-2 rounded-card
@@ -69,13 +73,8 @@ export const AnimatedCard: React.FC<
> = (props) => { > = (props) => {
return ( return (
<MCard <MCard
variants={{ enter: { scale: 1 }, from: { scale: 0 } }} variants={defaultVariantsCard}
transition={{ transition={defaultTransitionCard}
type: "spring",
stiffness: 200,
damping: 15,
mass: 2,
}}
{...props} {...props}
/> />
); );
+6 -3
View File
@@ -1,4 +1,4 @@
import type { Transition, Variants } from "motion"; import { stagger, type Transition, type Variants } from "motion";
export const defaultTransitionCard: Transition = { export const defaultTransitionCard: Transition = {
type: "spring", type: "spring",
@@ -7,13 +7,16 @@ export const defaultTransitionCard: Transition = {
mass: 1, mass: 1,
}; };
export const defaultAnimationStagger = { export const defaultAnimationStagger: {
variants: Variants;
transition: Transition;
} = {
variants: { variants: {
enter: {}, enter: {},
from: {}, from: {},
}, },
transition: { transition: {
staggerChildren: 0.1, delayChildren: stagger(0.1),
}, },
}; };