diff --git a/src/components/Card.tsx b/src/components/Card.tsx deleted file mode 100644 index add24fae2..000000000 --- a/src/components/Card.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import clsx from "clsx"; -import { ReactNode } from "react"; - -const Card = ({ - className, - children, -}: { - className?: string; - children: ReactNode; -}) => { - return ( -
- {children} -
- ); -}; - -export default Card; diff --git a/src/components/NextImage.tsx b/src/components/NextImage.tsx deleted file mode 100644 index 59b33fc63..000000000 --- a/src/components/NextImage.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import Image, { ImageProps } from "next/image"; -import * as React from "react"; - -import { cn } from "@/lib/utils"; - -type NextImageProps = { - useSkeleton?: boolean; - classNames?: { - image?: string; - blur?: string; - }; - alt: string; -} & ( - | { width: string | number; height: string | number } - | { layout: "fill"; width?: string | number; height?: string | number } -) & - ImageProps; - -/** - * - * @description Must set width using `w-` className - * @param useSkeleton add background with pulse animation, don't use it if image is transparent - */ -export default function NextImage({ - useSkeleton = false, - src, - width, - height, - alt, - className, - classNames, - ...rest -}: NextImageProps) { - const [status, setStatus] = React.useState( - useSkeleton ? "loading" : "complete", - ); - const widthIsSet = className?.includes("w-") ?? false; - - return ( -
- {alt} setStatus("complete")} - {...rest} - /> -
- ); -} diff --git a/src/components/Popover.tsx b/src/components/Popover.tsx deleted file mode 100644 index 5677af7c5..000000000 --- a/src/components/Popover.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import clsx from "clsx"; -import { ReactNode } from "react"; - -const Popover = ({ - trigger, - reveal, - triggerClassName, -}: { - trigger: ReactNode; - reveal: ReactNode; - triggerClassName?: string; -}) => { - return ( -
- {trigger} -
-
- {reveal} -
-
-
- ); -}; - -export default Popover; diff --git a/src/components/Skeleton.tsx b/src/components/Skeleton.tsx deleted file mode 100644 index e1ba5b893..000000000 --- a/src/components/Skeleton.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from "react"; - -import { cn } from "@/lib/utils"; - -type SkeletonProps = React.ComponentPropsWithoutRef<"div">; - -export default function Skeleton({ className, ...rest }: SkeletonProps) { - return ( -
- ); -} diff --git a/src/components/buttons/Button.tsx b/src/components/buttons/Button.tsx deleted file mode 100644 index 79c7abe89..000000000 --- a/src/components/buttons/Button.tsx +++ /dev/null @@ -1,160 +0,0 @@ -import { LucideIcon } from "lucide-react"; -import * as React from "react"; -import { IconType } from "react-icons"; -import { ImSpinner2 } from "react-icons/im"; - -import { cn } from "@/lib/utils"; - -const ButtonVariant = ["primary", "outline", "ghost", "light", "dark"] as const; -const ButtonSize = ["sm", "base"] as const; - -type ButtonProps = { - isLoading?: boolean; - isDarkBg?: boolean; - variant?: (typeof ButtonVariant)[number]; - size?: (typeof ButtonSize)[number]; - leftIcon?: IconType | LucideIcon; - rightIcon?: IconType | LucideIcon; - classNames?: { - leftIcon?: string; - rightIcon?: string; - }; -} & React.ComponentPropsWithRef<"button">; - -const Button = React.forwardRef( - ( - { - children, - className, - disabled: buttonDisabled, - isLoading, - variant = "primary", - size = "base", - isDarkBg = false, - leftIcon: LeftIcon, - rightIcon: RightIcon, - classNames, - ...rest - }, - ref, - ) => { - const disabled = isLoading || buttonDisabled; - - return ( - - ); - }, -); - -export default Button; diff --git a/src/components/buttons/IconButton.tsx b/src/components/buttons/IconButton.tsx deleted file mode 100644 index 3908fb7c7..000000000 --- a/src/components/buttons/IconButton.tsx +++ /dev/null @@ -1,116 +0,0 @@ -import { LucideIcon } from "lucide-react"; -import * as React from "react"; -import { IconType } from "react-icons"; -import { ImSpinner2 } from "react-icons/im"; - -import { cn } from "@/lib/utils"; - -const IconButtonVariant = [ - "primary", - "outline", - "ghost", - "light", - "dark", -] as const; - -type IconButtonProps = { - isLoading?: boolean; - isDarkBg?: boolean; - variant?: (typeof IconButtonVariant)[number]; - icon?: IconType | LucideIcon; - classNames?: { - icon?: string; - }; -} & React.ComponentPropsWithRef<"button">; - -const IconButton = React.forwardRef( - ( - { - className, - disabled: buttonDisabled, - isLoading, - variant = "primary", - isDarkBg = false, - icon: Icon, - classNames, - ...rest - }, - ref, - ) => { - const disabled = isLoading || buttonDisabled; - - return ( - - ); - }, -); - -export default IconButton; diff --git a/src/components/links/ArrowLink.tsx b/src/components/links/ArrowLink.tsx deleted file mode 100644 index ff18b40ee..000000000 --- a/src/components/links/ArrowLink.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import * as React from "react"; - -import { cn } from "@/lib/utils"; - -import UnderlineLink from "@/components/links/UnderlineLink"; -import { UnstyledLinkProps } from "@/components/links/UnstyledLink"; - -type ArrowLinkProps = { - as?: C; - direction?: "left" | "right"; -} & UnstyledLinkProps & - React.ComponentProps; - -export default function ArrowLink({ - children, - className, - direction = "right", - as, - ...rest -}: ArrowLinkProps) { - const Component = as || UnderlineLink; - - return ( - - {children} - - - - - - ); -} diff --git a/src/components/links/ButtonLink.tsx b/src/components/links/ButtonLink.tsx deleted file mode 100644 index 6bbd8bc0d..000000000 --- a/src/components/links/ButtonLink.tsx +++ /dev/null @@ -1,146 +0,0 @@ -import { LucideIcon } from "lucide-react"; -import * as React from "react"; -import { IconType } from "react-icons"; - -import { cn } from "@/lib/utils"; - -import UnstyledLink, { - UnstyledLinkProps, -} from "@/components/links/UnstyledLink"; - -const ButtonLinkVariant = [ - "primary", - "outline", - "ghost", - "light", - "dark", -] as const; -const ButtonLinkSize = ["sm", "base"] as const; - -type ButtonLinkProps = { - isDarkBg?: boolean; - variant?: (typeof ButtonLinkVariant)[number]; - size?: (typeof ButtonLinkSize)[number]; - leftIcon?: IconType | LucideIcon; - rightIcon?: IconType | LucideIcon; - classNames?: { - leftIcon?: string; - rightIcon?: string; - }; -} & UnstyledLinkProps; - -const ButtonLink = React.forwardRef( - ( - { - children, - className, - variant = "primary", - size = "base", - isDarkBg = false, - leftIcon: LeftIcon, - rightIcon: RightIcon, - classNames, - ...rest - }, - ref, - ) => { - return ( - - {LeftIcon && ( -
- -
- )} - {children} - {RightIcon && ( -
- -
- )} -
- ); - }, -); - -export default ButtonLink; diff --git a/src/components/links/IconLink.tsx b/src/components/links/IconLink.tsx deleted file mode 100644 index 7d35a7099..000000000 --- a/src/components/links/IconLink.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import { LucideIcon } from "lucide-react"; -import * as React from "react"; -import { IconType } from "react-icons"; - -import { cn } from "@/lib/utils"; - -import UnstyledLink, { - UnstyledLinkProps, -} from "@/components/links/UnstyledLink"; - -const IconLinkVariant = [ - "primary", - "outline", - "ghost", - "light", - "dark", -] as const; - -type IconLinkProps = { - isDarkBg?: boolean; - variant?: (typeof IconLinkVariant)[number]; - icon?: IconType | LucideIcon; - classNames?: { - icon?: string; - }; -} & Omit; - -const IconLink = React.forwardRef( - ( - { - className, - icon: Icon, - variant = "outline", - isDarkBg = false, - classNames, - ...rest - }, - ref, - ) => { - return ( - - {Icon && } - - ); - }, -); - -export default IconLink; diff --git a/src/components/links/PrimaryLink.tsx b/src/components/links/PrimaryLink.tsx deleted file mode 100644 index 31b2de9e8..000000000 --- a/src/components/links/PrimaryLink.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import * as React from "react"; - -import { cn } from "@/lib/utils"; - -import UnstyledLink, { - UnstyledLinkProps, -} from "@/components/links/UnstyledLink"; - -const PrimaryLinkVariant = ["primary", "basic"] as const; -type PrimaryLinkProps = { - variant?: (typeof PrimaryLinkVariant)[number]; -} & UnstyledLinkProps; - -const PrimaryLink = React.forwardRef( - ({ className, children, variant = "primary", ...rest }, ref) => { - return ( - - {children} - - ); - }, -); - -export default PrimaryLink; diff --git a/src/components/links/UnderlineLink.tsx b/src/components/links/UnderlineLink.tsx deleted file mode 100644 index 09458d660..000000000 --- a/src/components/links/UnderlineLink.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import * as React from "react"; - -import { cn } from "@/lib/utils"; - -import UnstyledLink, { - UnstyledLinkProps, -} from "@/components/links/UnstyledLink"; - -const UnderlineLink = React.forwardRef( - ({ children, className, ...rest }, ref) => { - return ( - - {children} - - ); - }, -); - -export default UnderlineLink; diff --git a/src/components/links/UnstyledLink.tsx b/src/components/links/UnstyledLink.tsx deleted file mode 100644 index d7671aab5..000000000 --- a/src/components/links/UnstyledLink.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import Link, { LinkProps } from "next/link"; -import * as React from "react"; - -import { cn } from "@/lib/utils"; - -export type UnstyledLinkProps = { - href: string; - children: React.ReactNode; - openNewTab?: boolean; - className?: string; - nextLinkProps?: Omit; -} & React.ComponentPropsWithRef<"a">; - -const UnstyledLink = React.forwardRef( - ({ children, href, openNewTab, className, nextLinkProps, ...rest }, ref) => { - const isNewTab = - openNewTab !== undefined - ? openNewTab - : href && !href.startsWith("/") && !href.startsWith("#"); - - if (!isNewTab) { - return ( - - {children} - - ); - } - - return ( - - {children} - - ); - }, -); - -export default UnstyledLink;