Skip to content

Commit

Permalink
♻️ refactor(ui): Dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
web-ppanel committed Nov 14, 2024
1 parent 5af60aa commit 727d779
Show file tree
Hide file tree
Showing 187 changed files with 26,491 additions and 14,080 deletions.
12 changes: 6 additions & 6 deletions apps/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
"@iconify/react": "^5.0.2",
"@repo/ui": "workspace:*",
"@shadcn/ui": "workspace:*",
"@tanstack/react-query": "^5.59.20",
"@tanstack/react-query-next-experimental": "^5.59.20",
"@tanstack/react-query": "^5.60.2",
"@tanstack/react-query-next-experimental": "^5.60.2",
"ahooks": "^3.8.1",
"axios": "^1.7.7",
"crypto-js": "^4.2.0",
"mathjs": "^13.2.1",
"mathjs": "^13.2.2",
"nanoid": "^5.0.8",
"next": "^15.0.3",
"next-intl": "^3.25.0",
"next-intl": "^3.25.1",
"next-runtime-env": "^3.2.2",
"next-themes": "^0.4.3",
"nextjs-toploader": "^3.7.15",
Expand All @@ -36,8 +36,8 @@
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/node": "^22.9.0",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"typescript": "^5.6.3"
}
}
42 changes: 0 additions & 42 deletions apps/user/app/(main)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import {
UsersIcon,
} from '@repo/ui/lotties';
import { Button, buttonVariants } from '@shadcn/ui/button';
import Marquee from '@shadcn/ui/marquee';
import { AnimationProps, motion, MotionProps } from 'framer-motion';
import { useTranslations } from 'next-intl';
import Image from 'next/legacy/image';
import Link from 'next/link';
import { useMemo } from 'react';

Expand Down Expand Up @@ -243,46 +241,6 @@ export default function Page() {
<GlobalMapIcon className='-mt-[25%] w-full' />
</motion.div>
</ScrollAnimationWrapper>
<ScrollAnimationWrapper>
<motion.div
className='relative mx-auto flex items-center justify-center overflow-hidden py-6'
variants={scrollAnimation}
>
<Marquee pauseOnHover className='[--duration:20s]'>
{[
'facebook',
'google',
'hbo',
'instagram',
'netflix',
'primevideo',
'reddit',
'snapchat',
'spotify',
'twitch',
'twitter',
'whatsapp',
'youtube',
].map((logo) => (
<div
className='mx-10 flex shrink-0 items-center justify-center dark:invert'
key={logo}
>
<Image
src={`/index/${logo}.png`}
alt={logo}
width={120}
height={48}
className='h-12 w-auto object-contain'
/>
</div>
))}
</Marquee>

<div className='from-background absolute inset-y-0 left-0 w-12 bg-gradient-to-r to-transparent'></div>
<div className='from-background absolute inset-y-0 right-0 w-12 bg-gradient-to-l to-transparent'></div>
</motion.div>
</ScrollAnimationWrapper>
</main>
);
}
16 changes: 8 additions & 8 deletions apps/user/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
"@shadcn/ui": "workspace:*",
"@stripe/react-stripe-js": "^2.9.0",
"@stripe/stripe-js": "^4.10.0",
"@tanstack/react-query": "^5.59.20",
"@tanstack/react-query-next-experimental": "^5.59.20",
"@tanstack/react-query": "^5.60.2",
"@tanstack/react-query-next-experimental": "^5.60.2",
"ahooks": "^3.8.1",
"axios": "^1.7.7",
"crypto-js": "^4.2.0",
"framer-motion": "^11.11.11",
"lucide-react": "^0.446.0",
"mathjs": "^13.2.1",
"framer-motion": "^11.11.16",
"lucide-react": "^0.456.0",
"mathjs": "^13.2.2",
"next": "^15.0.3",
"next-intl": "^3.25.0",
"next-intl": "^3.25.1",
"next-runtime-env": "^3.2.2",
"next-themes": "^0.4.3",
"nextjs-toploader": "^3.7.15",
Expand All @@ -40,8 +40,8 @@
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/node": "^22.9.0",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"typescript": "^5.6.3"
}
}
Binary file removed apps/user/public/index/facebook.png
Binary file not shown.
Binary file removed apps/user/public/index/google.png
Binary file not shown.
Binary file removed apps/user/public/index/hbo.png
Binary file not shown.
Binary file removed apps/user/public/index/instagram.png
Binary file not shown.
Binary file removed apps/user/public/index/netflix.png
Binary file not shown.
Binary file removed apps/user/public/index/primevideo.png
Binary file not shown.
Binary file removed apps/user/public/index/reddit.png
Binary file not shown.
Binary file removed apps/user/public/index/snapchat.png
Binary file not shown.
Binary file removed apps/user/public/index/spotify.png
Binary file not shown.
Binary file removed apps/user/public/index/twitch.png
Binary file not shown.
Binary file removed apps/user/public/index/twitter.png
Binary file not shown.
Binary file removed apps/user/public/index/whatsapp.png
Binary file not shown.
Binary file removed apps/user/public/index/youtube.png
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"devDependencies": {
"@next/eslint-plugin-next": "^15.0.3",
"@types/eslint": "^8",
"@typescript-eslint/eslint-plugin": "^8.13.0",
"@typescript-eslint/parser": "^8.13.0",
"@typescript-eslint/eslint-plugin": "^8.14.0",
"@typescript-eslint/parser": "^8.14.0",
"@vercel/style-guide": "^6.0.0",
"eslint": "^8",
"eslint-config-next": "^15.0.3",
Expand Down
4 changes: 4 additions & 0 deletions packages/shadcn/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ module.exports = {
tsconfigRootDir: __dirname,
},
rules: {
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-redeclare': 'off',
'no-unused-vars': 'off',
'no-undef': 'off',
},
};
41 changes: 25 additions & 16 deletions packages/shadcn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-progress": "^1.1.0",
"@radix-ui/react-radio-group": "^1.2.1",
"@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-scroll-area": "^1.2.1",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slider": "^1.2.1",
Expand All @@ -43,42 +43,51 @@
"@radix-ui/react-toast": "^1.2.2",
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.3",
"@types/canvas-confetti": "^1.6.4",
"canvas-confetti": "^1.9.3",
"@radix-ui/react-tooltip": "^1.1.4",
"@react-three/drei": "^9.116.0",
"@react-three/fiber": "^8.17.10",
"@tabler/icons-react": "^3.22.0",
"@tsparticles/engine": "^3.5.0",
"@tsparticles/react": "^3.0.0",
"@tsparticles/slim": "^3.5.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"cmdk": "1.0.0",
"cmdk": "1.0.4",
"cobe": "^0.6.3",
"date-fns": "^4.1.0",
"embla-carousel-react": "^8.3.1",
"framer-motion": "^11.11.11",
"framer-motion": "^11.11.16",
"input-otp": "^1.4.1",
"lucide-react": "^0.446.0",
"lucide-react": "^0.456.0",
"mini-svg-data-uri": "^1.4.4",
"next-themes": "^0.4.3",
"react": "^18.3.1",
"qss": "^3.0.0",
"react-day-picker": "8.10.1",
"react-dropzone": "^14.3.5",
"react-hook-form": "^7.53.2",
"react-icon-cloud": "^4.1.4",
"react-icons": "^5.3.0",
"react-resizable-panels": "^2.1.6",
"react-spring": "^9.7.4",
"react-tweet": "^3.2.1",
"recharts": "^2.13.3",
"shiki": "^1.22.2",
"simplex-noise": "^4.0.3",
"sonner": "^1.7.0",
"tailwind-merge": "^2.5.2",
"tailwind-merge": "^2.5.4",
"tailwindcss-animate": "^1.0.7",
"three": "^0.170.0",
"three-globe": "^2.34.4",
"vaul": "^1.1.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/node": "^22.9.0",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/three": "^0.170.0",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.47",
"next": "^15.0.3",
"postcss": "^8.4.49",
"react": "^18.3.1",
"tailwindcss": "^3.4.14",
"typescript": "^5.6.3"
}
Expand Down
141 changes: 141 additions & 0 deletions packages/shadcn/src/components/ui/3d-card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
// @ts-nocheck
'use client';

import React, { createContext, useContext, useEffect, useRef, useState } from 'react';
import { cn } from '../../lib/utils';

const MouseEnterContext = createContext<
[boolean, React.Dispatch<React.SetStateAction<boolean>>] | undefined
>(undefined);

export const CardContainer = ({
children,
className,
containerClassName,
}: {
children?: React.ReactNode;
className?: string;
containerClassName?: string;
}) => {
const containerRef = useRef<HTMLDivElement>(null);
const [isMouseEntered, setIsMouseEntered] = useState(false);

const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
if (!containerRef.current) return;
const { left, top, width, height } = containerRef.current.getBoundingClientRect();
const x = (e.clientX - left - width / 2) / 25;
const y = (e.clientY - top - height / 2) / 25;
containerRef.current.style.transform = `rotateY(${x}deg) rotateX(${y}deg)`;
};

const handleMouseEnter = (e: React.MouseEvent<HTMLDivElement>) => {
setIsMouseEntered(true);
if (!containerRef.current) return;
};

const handleMouseLeave = (e: React.MouseEvent<HTMLDivElement>) => {
if (!containerRef.current) return;
setIsMouseEntered(false);
containerRef.current.style.transform = `rotateY(0deg) rotateX(0deg)`;
};
return (
<MouseEnterContext.Provider value={[isMouseEntered, setIsMouseEntered]}>
<div
className={cn('flex items-center justify-center py-20', containerClassName)}
style={{
perspective: '1000px',
}}
>
<div
ref={containerRef}
onMouseEnter={handleMouseEnter}
onMouseMove={handleMouseMove}
onMouseLeave={handleMouseLeave}
className={cn(
'relative flex items-center justify-center transition-all duration-200 ease-linear',
className,
)}
style={{
transformStyle: 'preserve-3d',
}}
>
{children}
</div>
</div>
</MouseEnterContext.Provider>
);
};

export const CardBody = ({
children,
className,
}: {
children: React.ReactNode;
className?: string;
}) => {
return (
<div
className={cn(
'h-96 w-96 [transform-style:preserve-3d] [&>*]:[transform-style:preserve-3d]',
className,
)}
>
{children}
</div>
);
};

export const CardItem = ({
as: Tag = 'div',
children,
className,
translateX = 0,
translateY = 0,
translateZ = 0,
rotateX = 0,
rotateY = 0,
rotateZ = 0,
...rest
}: {
as?: React.ElementType;
children: React.ReactNode;
className?: string;
translateX?: number | string;
translateY?: number | string;
translateZ?: number | string;
rotateX?: number | string;
rotateY?: number | string;
rotateZ?: number | string;
[key: string]: any;
}) => {
const ref = useRef<HTMLDivElement>(null);
const [isMouseEntered] = useMouseEnter();

useEffect(() => {
handleAnimations();
}, [isMouseEntered]);

const handleAnimations = () => {
if (!ref.current) return;
if (isMouseEntered) {
ref.current.style.transform = `translateX(${translateX}px) translateY(${translateY}px) translateZ(${translateZ}px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) rotateZ(${rotateZ}deg)`;
} else {
ref.current.style.transform = `translateX(0px) translateY(0px) translateZ(0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg)`;
}
};

return (
<Tag ref={ref} className={cn('w-fit transition duration-200 ease-linear', className)} {...rest}>
{children}
</Tag>
);
};

// Create a hook to use the context
export const useMouseEnter = () => {
const context = useContext(MouseEnterContext);
if (context === undefined) {
throw new Error('useMouseEnter must be used within a MouseEnterProvider');
}
return context;
};
Loading

0 comments on commit 727d779

Please sign in to comment.