Skip to content

UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.

chore(www): remove dead components, hooks, and their deps (#1024)

Jinho85f97fd27b05
diff --git a/apps/www/components/blur-image.tsx b/apps/www/components/blur-image.tsx
deleted file mode 100644
index 58e00efa..00000000
--- a/apps/www/components/blur-image.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-"use client"
-
-import { useEffect, useState } from "react"
-import Image, { type ImageProps } from "next/image"
-
-export default function BlurImage(props: ImageProps) {
- const [loading, setLoading] = useState(true)
- const [src, setSrc] = useState(props.src)
- useEffect(() => setSrc(props.src), [props.src]) // update the `src` value when the `prop.src` value changes
-
- return (
- <Image
- {...props}
- src={src}
- alt={props.alt}
- className={`${props.className} ${loading ? "blur-[2px]" : "blur-0"}`}
- onLoadingComplete={async () => {
- setLoading(false)
- }}
- onError={() => {
- setSrc(`https://avatar.vercel.sh/${props.alt}`) // if the image fails to load, use the default avatar
- }}
- />
- )
-}
diff --git a/apps/www/components/code-block-wrapper.tsx b/apps/www/components/code-block-wrapper.tsx
deleted file mode 100644
index e9398630..00000000
--- a/apps/www/components/code-block-wrapper.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-"use client"
-
-import * as React from "react"
-
-import { cn } from "@/lib/utils"
-import { Button } from "@/components/ui/button"
-import {
- Collapsible,
- CollapsibleContent,
- CollapsibleTrigger,
-} from "@/components/ui/collapsible"
-
-interface CodeBlockProps extends React.HTMLAttributes<HTMLDivElement> {
- expandButtonTitle?: string
-}
-
-export function CodeBlockWrapper({
- expandButtonTitle = "View Code",
- className,
- children,
- ...props
-}: CodeBlockProps) {
- const [isOpened, setIsOpened] = React.useState(false)
-
- return (
- <Collapsible open={isOpened} onOpenChange={setIsOpened}>
- <div className={cn("relative overflow-hidden", className)} {...props}>
- <CollapsibleContent
- forceMount
- className={cn("overflow-hidden", !isOpened && "max-h-72")}
- >
- <div
- className={cn(
- "[&_pre]:my-0 [&_pre]:max-h-[650px] [&_pre]:pb-[100px]",
- !isOpened ? "[&_pre]:overflow-hidden" : "[&_pre]:overflow-auto]"
- )}
- >
- {children}
- </div>
- </CollapsibleContent>
- <div
- className={cn(
- "from-background/10 to-background absolute flex items-center justify-center bg-linear-to-b to-90% p-2",
- isOpened ? "inset-x-0 bottom-0 h-12 from-gray-900/30" : "inset-0"
- )}
- >
- <CollapsibleTrigger asChild>
- <Button variant="secondary" className="mb-8 h-8 text-xs">
- {isOpened ? "Collapse" : expandButtonTitle}
- </Button>
- </CollapsibleTrigger>
- </div>
- </div>
- </Collapsible>
- )
-}
diff --git a/apps/www/components/deal-banner.tsx b/apps/www/components/deal-banner.tsx
deleted file mode 100644
index 262eed70..00000000
--- a/apps/www/components/deal-banner.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import Link from "next/link"
-import { ExternalLink } from "lucide-react"
-
-export function DealBanner() {
- return (
- <div className="bg-background relative top-0 py-3 md:py-0">
- <div className="container flex flex-col items-center justify-center gap-4 md:h-12 md:flex-row">
- <Link
- href="/pricing"
- className="flex flex-row items-center justify-center gap-2 text-center text-sm leading-loose font-bold text-black dark:text-white"
- >
- {/* ✨
- <span className="font-bold text-black dark:text-white">
- {" "}
- Join our new discord community <strong>here</strong>
- </span>{" "}
- ✨ */}
- 🔥🔥🔥 FIRE SALE - Get $100 off TODAY ONLY
- <ExternalLink className="size-4" />
- {/* with code{" "}
- <span className="rounded-md bg-orange-400 p-1 font-bold text-black dark:text-white">
- BLOCKPARTY
- </span>{" "}
- ✨ */}
- </Link>
- </div>
- <hr className="absolute bottom-0 m-0 h-px w-full bg-neutral-200/30" />
- </div>
- )
-}
diff --git a/apps/www/components/gradient-blur.tsx b/apps/www/components/gradient-blur.tsx
deleted file mode 100644
index 9524e8f1..00000000
--- a/apps/www/components/gradient-blur.tsx
+++ /dev/null
@@ -1,75 +0,0 @@
-import React from "react"
-
-import { cn } from "@/lib/utils"
-
-interface GradientBlurProps {
- numberOfLayers?: number
- className?: string
-}
-
-const GradientBlur: React.FC<GradientBlurProps> = ({
- numberOfLayers = 6,
- className = "",
-}) => {
- const generateLayers = () => {
- const layers = []
- for (let i = 0; i < numberOfLayers; i++) {
- const blurAmount = Math.pow(2, i)
- const startPercent = (i * 100) / numberOfLayers
- const midPercent = ((i + 1) * 100) / numberOfLayers
- const endPercent = ((i + 2) * 100) / numberOfLayers
- layers.push(
- <div
- key={i}
- className="absolute inset-0"
- style={{
- zIndex: i + 2,
- backdropFilter: `blur(${blurAmount}px)`,
- mask: `linear-gradient(
- to bottom,
- rgba(0, 0, 0, 0) ${startPercent}%,
- rgba(0, 0, 0, 1) ${midPercent}%,
- rgba(0, 0, 0, 1) ${endPercent}%,
- rgba(0, 0, 0, 0) ${endPercent + (endPercent - midPercent)}%
- )`,
- }}
- />
- )
- }
- return layers
- }
-
- return (
- <div className={cn(`pointer-events-none inset-x-0 z-5 h-full`, className)}>
- <div
- className="absolute inset-0"
- style={{
- zIndex: 1,
- backdropFilter: "blur(0.5px)",
- mask: `linear-gradient(
- to bottom,
- rgba(0, 0, 0, 0) 0%,
- rgba(0, 0, 0, 1) ${100 / (numberOfLayers * 4)}%,
- rgba(0, 0, 0, 1) ${100 / (numberOfLayers * 2)}%,
- rgba(0, 0, 0, 0) ${(100 * 3) / (numberOfLayers * 4)}%
- )`,
- }}
- />
- {generateLayers()}
- <div
- className="absolute inset-0"
- style={{
- zIndex: numberOfLayers + 2,
- backdropFilter: `blur(${Math.pow(2, numberOfLayers)}px)`,
- mask: `linear-gradient(
- to bottom,
- rgba(0, 0, 0, 0) ${100 - 100 / (numberOfLayers * 2)}%,
- rgba(0, 0, 0, 1) 100%
- )`,
- }}
- />
- </div>
- )
-}
-
-export default GradientBlur
diff --git a/apps/www/components/sections/component-demos.tsx b/apps/www/components/sections/component-demos.tsx
deleted file mode 100644
index e5b12273..00000000
--- a/apps/www/components/sections/component-demos.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import { notFound } from "next/navigation"
-import { mdxComponents } from "@/mdx-components"
-
-import { source } from "@/lib/source"
-
-const PAGE = "home"
-
-export function ComponentDemos() {
- const pages = source.getPages()
- const page = pages.find((page) => page.url === PAGE)
-
- if (!page) {
- notFound()
- }
-
- const MDX = page.data.body
-
- return (
- <section id="component-demos" className="container max-w-5xl py-14">
- <h2 className="text-foreground mb-2 text-center text-5xl leading-[1.2] font-bold tracking-tighter">
- Component Demos
- </h2>
- <h3 className="text-foreground/80 mx-auto mb-8 text-center text-lg font-medium tracking-tight text-balance">
- Here are some of the components that you can use to build your landing
- pages.
- </h3>
- <MDX components={mdxComponents} />
- </section>
- )
-}
diff --git a/apps/www/components/sections/cta.tsx b/apps/www/components/sections/cta.tsx
deleted file mode 100644
index a47b1d8a..00000000
--- a/apps/www/components/sections/cta.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { ChevronRight, HeartHandshake } from "lucide-react"
-
-import { cn } from "@/lib/utils"
-import { buttonVariants } from "@/components/ui/button"
-
-export function CTASection() {
- return (
- <section id="cta">
- <div className="py-14">
- <div className="relative flex w-full flex-col items-center justify-center overflow-hidden border-y p-14">
- <div className="z-10 mx-auto size-24 rounded-[2rem] border bg-white/10 p-3 shadow-2xl backdrop-blur-md lg:size-32 dark:bg-black/10">
- <HeartHandshake className="mx-auto size-16 text-black lg:size-24 dark:text-white" />
- </div>
- <div className="z-10 mt-4 flex flex-col items-center text-center text-black dark:text-white">
- <h1 className="text-3xl font-bold lg:text-4xl">
- Looking for templates instead?
- </h1>
- <p className="mt-2">Check out Magic UI Pro</p>
- <a
- href="https://pro.magicui.design/"
- className={cn(
- buttonVariants({
- size: "lg",
- variant: "outline",
- }),
- "group mt-4 rounded-[2rem] px-6"
- )}
- >
- Get Magic UI Pro
- <ChevronRight className="ml-1 size-4 transition-all duration-300 ease-out group-hover:translate-x-1" />
- </a>
- </div>
- <div className="absolute inset-x-0 bottom-0 h-full bg-linear-to-b from-transparent to-white to-70% dark:to-black" />
- </div>
- </div>
- </section>
- )
-}
diff --git a/apps/www/components/ui/avatar.tsx b/apps/www/components/ui/avatar.tsx
deleted file mode 100644
index e6a93ce0..00000000
--- a/apps/www/components/ui/avatar.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-"use client"
-
-import * as React from "react"
-import * as AvatarPrimitive from "@radix-ui/react-avatar"
-
-import { cn } from "@/lib/utils"
-
-const Avatar = React.forwardRef<
- React.ElementRef<typeof AvatarPrimitive.Root>,
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
->(({ className, ...props }, ref) => (
- <AvatarPrimitive.Root
- ref={ref}
- className={cn(
- "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
- className
- )}
- {...props}
- />
-))
-Avatar.displayName = AvatarPrimitive.Root.displayName
-
-const AvatarImage = React.forwardRef<
- React.ElementRef<typeof AvatarPrimitive.Image>,
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
->(({ className, ...props }, ref) => (
- <AvatarPrimitive.Image
- ref={ref}
- className={cn("aspect-square h-full w-full", className)}
- {...props}
- />
-))
-AvatarImage.displayName = AvatarPrimitive.Image.displayName
-
-const AvatarFallback = React.forwardRef<
- React.ElementRef<typeof AvatarPrimitive.Fallback>,
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
->(({ className, ...props }, ref) => (
- <AvatarPrimitive.Fallback
- ref={ref}
- className={cn(
- "bg-muted flex h-full w-full items-center justify-center rounded-full",
- className
- )}
- {...props}
- />
-))
-AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
-
-export { Avatar, AvatarImage, AvatarFallback }
diff --git a/apps/www/components/ui/form.tsx b/apps/www/components/ui/form.tsx
deleted file mode 100644
index 8a094aac..00000000
--- a/apps/www/components/ui/form.tsx
+++ /dev/null
@@ -1,178 +0,0 @@
-"use client"
-
-import * as React from "react"
-import * as LabelPrimitive from "@radix-ui/react-label"
-import { Slot } from "@radix-ui/react-slot"
-import {
- Controller,
- FormProvider,
- useFormContext,
- type ControllerProps,
- type FieldPath,
- type FieldValues,
-} from "react-hook-form"
-
-import { cn } from "@/lib/utils"
-import { Label } from "@/components/ui/label"
-
-const Form = FormProvider
-
-type FormFieldContextValue<
- TFieldValues extends FieldValues = FieldValues,
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
-> = {
- name: TName
-}
-
-const FormFieldContext = React.createContext<FormFieldContextValue>(
- {} as FormFieldContextValue
-)
-
-const FormField = <
- TFieldValues extends FieldValues = FieldValues,
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
->({
- ...props
-}: ControllerProps<TFieldValues, TName>) => {
- return (
- <FormFieldContext.Provider value={{ name: props.name }}>
- <Controller {...props} />
- </FormFieldContext.Provider>
- )
-}
-
-const useFormField = () => {
- const fieldContext = React.useContext(FormFieldContext)
- const itemContext = React.useContext(FormItemContext)
- const { getFieldState, formState } = useFormContext()
-
- const fieldState = getFieldState(fieldContext.name, formState)
-
- if (!fieldContext) {
- throw new Error("useFormField should be used within <FormField>")
- }
-
- const { id } = itemContext
-
- return {
- id,
- name: fieldContext.name,
- formItemId: `${id}-form-item`,
- formDescriptionId: `${id}-form-item-description`,
- formMessageId: `${id}-form-item-message`,
- ...fieldState,
- }
-}
-
-type FormItemContextValue = {
- id: string
-}
-
-const FormItemContext = React.createContext<FormItemContextValue>(
- {} as FormItemContextValue
-)
-
-const FormItem = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes<HTMLDivElement>
->(({ className, ...props }, ref) => {
- const id = React.useId()
-
- return (
- <FormItemContext.Provider value={{ id }}>
- <div ref={ref} className={cn("space-y-2", className)} {...props} />
- </FormItemContext.Provider>
- )
-})
-FormItem.displayName = "FormItem"
-
-const FormLabel = React.forwardRef<
- React.ElementRef<typeof LabelPrimitive.Root>,
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
->(({ className, ...props }, ref) => {
- const { error, formItemId } = useFormField()
-
- return (
- <Label
- ref={ref}
- className={cn(error && "text-destructive", className)}
- htmlFor={formItemId}
- {...props}
- />
- )
-})
-FormLabel.displayName = "FormLabel"
-
-const FormControl = React.forwardRef<
- React.ElementRef<typeof Slot>,
- React.ComponentPropsWithoutRef<typeof Slot>
->(({ ...props }, ref) => {
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
-
- return (
- <Slot
- ref={ref}
- id={formItemId}
- aria-describedby={
- !error
- ? `${formDescriptionId}`
- : `${formDescriptionId} ${formMessageId}`
- }
- aria-invalid={!!error}
- {...props}
- />
- )
-})
-FormControl.displayName = "FormControl"
-
-const FormDescription = React.forwardRef<
- HTMLParagraphElement,
- React.HTMLAttributes<HTMLParagraphElement>
->(({ className, ...props }, ref) => {
- const { formDescriptionId } = useFormField()
-
- return (
- <p
- ref={ref}
- id={formDescriptionId}
- className={cn("text-muted-foreground text-[0.8rem]", className)}
- {...props}
- />
- )
-})
-FormDescription.displayName = "FormDescription"
-
-const FormMessage = React.forwardRef<
- HTMLParagraphElement,
- React.HTMLAttributes<HTMLParagraphElement>
->(({ className, children, ...props }, ref) => {
- const { error, formMessageId } = useFormField()
- const body = error ? String(error?.message ?? "") : children
-
- if (!body) {
- return null
- }
-
- return (
- <p
- ref={ref}
- id={formMessageId}
- className={cn("text-destructive text-[0.8rem] font-medium", className)}
- {...props}
- >
- {body}
- </p>
- )
-})
-FormMessage.displayName = "FormMessage"
-
-export {
- Form,
- FormControl,
- FormDescription,
- FormField,
- FormItem,
- FormLabel,
- FormMessage,
- useFormField,
-}
diff --git a/apps/www/components/ui/select.tsx b/apps/www/components/ui/select.tsx
deleted file mode 100644
index 8faff85f..00000000
--- a/apps/www/components/ui/select.tsx
+++ /dev/null
@@ -1,159 +0,0 @@
-"use client"
-
-import * as React from "react"
-import * as SelectPrimitive from "@radix-ui/react-select"
-import { Check, ChevronDown, ChevronUp } from "lucide-react"
-
-import { cn } from "@/lib/utils"
-
-const Select = SelectPrimitive.Root
-
-const SelectGroup = SelectPrimitive.Group
-
-const SelectValue = SelectPrimitive.Value
-
-const SelectTrigger = React.forwardRef<
- React.ElementRef<typeof SelectPrimitive.Trigger>,
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
->(({ className, children, ...props }, ref) => (
- <SelectPrimitive.Trigger
- ref={ref}
- className={cn(
- "border-input ring-offset-background data-[placeholder]:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
- className
- )}
- {...props}
- >
- {children}
- <SelectPrimitive.Icon asChild>
- <ChevronDown className="h-4 w-4 opacity-50" />
- </SelectPrimitive.Icon>
- </SelectPrimitive.Trigger>
-))
-SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
-
-const SelectScrollUpButton = React.forwardRef<
- React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
->(({ className, ...props }, ref) => (
- <SelectPrimitive.ScrollUpButton
- ref={ref}
- className={cn(
- "flex cursor-default items-center justify-center py-1",
- className
- )}
- {...props}
- >
- <ChevronUp className="h-4 w-4" />
- </SelectPrimitive.ScrollUpButton>
-))
-SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
-
-const SelectScrollDownButton = React.forwardRef<
- React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
->(({ className, ...props }, ref) => (
- <SelectPrimitive.ScrollDownButton
- ref={ref}
- className={cn(
- "flex cursor-default items-center justify-center py-1",
- className
- )}
- {...props}
- >
- <ChevronDown className="h-4 w-4" />
- </SelectPrimitive.ScrollDownButton>
-))
-SelectScrollDownButton.displayName =
- SelectPrimitive.ScrollDownButton.displayName
-
-const SelectContent = React.forwardRef<
- React.ElementRef<typeof SelectPrimitive.Content>,
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
->(({ className, children, position = "popper", ...props }, ref) => (
- <SelectPrimitive.Portal>
- <SelectPrimitive.Content
- ref={ref}
- className={cn(
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] origin-[--radix-select-content-transform-origin] overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
- position === "popper" &&
- "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
- className
- )}
- position={position}
- {...props}
- >
- <SelectScrollUpButton />
- <SelectPrimitive.Viewport
- className={cn(
- "p-1",
- position === "popper" &&
- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
- )}
- >
- {children}
- </SelectPrimitive.Viewport>
- <SelectScrollDownButton />
- </SelectPrimitive.Content>
- </SelectPrimitive.Portal>
-))
-SelectContent.displayName = SelectPrimitive.Content.displayName
-
-const SelectLabel = React.forwardRef<
- React.ElementRef<typeof SelectPrimitive.Label>,
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
->(({ className, ...props }, ref) => (
- <SelectPrimitive.Label
- ref={ref}
- className={cn("px-2 py-1.5 text-sm font-semibold", className)}
- {...props}
- />
-))
-SelectLabel.displayName = SelectPrimitive.Label.displayName
-
-const SelectItem = React.forwardRef<
- React.ElementRef<typeof SelectPrimitive.Item>,
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
->(({ className, children, ...props }, ref) => (
- <SelectPrimitive.Item
- ref={ref}
- className={cn(
- "focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
- className
- )}
- {...props}
- >
- <span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
- <SelectPrimitive.ItemIndicator>
- <Check className="h-4 w-4" />
- </SelectPrimitive.ItemIndicator>
- </span>
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
- </SelectPrimitive.Item>
-))
-SelectItem.displayName = SelectPrimitive.Item.displayName
-
-const SelectSeparator = React.forwardRef<
- React.ElementRef<typeof SelectPrimitive.Separator>,
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
->(({ className, ...props }, ref) => (
- <SelectPrimitive.Separator
- ref={ref}
- className={cn("bg-muted -mx-1 my-1 h-px", className)}
- {...props}
- />
-))
-SelectSeparator.displayName = SelectPrimitive.Separator.displayName
-
-export {
- Select,
- SelectContent,
- SelectGroup,
- SelectItem,
- SelectLabel,
- SelectScrollDownButton,
- SelectScrollUpButton,
- SelectSeparator,
- SelectTrigger,
- SelectValue,
-}
diff --git a/apps/www/components/ui/switch.tsx b/apps/www/components/ui/switch.tsx
deleted file mode 100644
index 36e6d24b..00000000
--- a/apps/www/components/ui/switch.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-"use client"
-
-import * as React from "react"
-import * as SwitchPrimitives from "@radix-ui/react-switch"
-
-import { cn } from "@/lib/utils"
-
-const Switch = React.forwardRef<
- React.ElementRef<typeof SwitchPrimitives.Root>,
- React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
->(({ className, ...props }, ref) => (
- <SwitchPrimitives.Root
- className={cn(
- "peer focus-visible:ring-ring focus-visible:ring-offset-background data-[state=checked]:bg-primary data-[state=unchecked]:bg-input inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
- className
- )}
- {...props}
- ref={ref}
- >
- <SwitchPrimitives.Thumb
- className={cn(
- "bg-background pointer-events-none block h-4 w-4 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
- )}
- />
- </SwitchPrimitives.Root>
-))
-Switch.displayName = SwitchPrimitives.Root.displayName
-
-export { Switch }
diff --git a/apps/www/components/ui/table.tsx b/apps/www/components/ui/table.tsx
deleted file mode 100644
index f0835704..00000000
--- a/apps/www/components/ui/table.tsx
+++ /dev/null
@@ -1,120 +0,0 @@
-import * as React from "react"
-
-import { cn } from "@/lib/utils"
-
-const Table = React.forwardRef<
- HTMLTableElement,
- React.HTMLAttributes<HTMLTableElement>
->(({ className, ...props }, ref) => (
- <div className="relative w-full overflow-auto">
- <table
- ref={ref}
- className={cn("w-full caption-bottom text-sm", className)}
- {...props}
- />
- </div>
-))
-Table.displayName = "Table"
-
-const TableHeader = React.forwardRef<
- HTMLTableSectionElement,
- React.HTMLAttributes<HTMLTableSectionElement>
->(({ className, ...props }, ref) => (
- <thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
-))
-TableHeader.displayName = "TableHeader"
-
-const TableBody = React.forwardRef<
- HTMLTableSectionElement,
- React.HTMLAttributes<HTMLTableSectionElement>
->(({ className, ...props }, ref) => (
- <tbody
- ref={ref}
- className={cn("[&_tr:last-child]:border-0", className)}
- {...props}
- />
-))
-TableBody.displayName = "TableBody"
-
-const TableFooter = React.forwardRef<
- HTMLTableSectionElement,
- React.HTMLAttributes<HTMLTableSectionElement>
->(({ className, ...props }, ref) => (
- <tfoot
- ref={ref}
- className={cn(
- "bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
- className
- )}
- {...props}
- />
-))
-TableFooter.displayName = "TableFooter"
-
-const TableRow = React.forwardRef<
- HTMLTableRowElement,
- React.HTMLAttributes<HTMLTableRowElement>
->(({ className, ...props }, ref) => (
- <tr
- ref={ref}
- className={cn(
- "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
- className
- )}
- {...props}
- />
-))
-TableRow.displayName = "TableRow"
-
-const TableHead = React.forwardRef<
- HTMLTableCellElement,
- React.ThHTMLAttributes<HTMLTableCellElement>
->(({ className, ...props }, ref) => (
- <th
- ref={ref}
- className={cn(
- "text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
- className
- )}
- {...props}
- />
-))
-TableHead.displayName = "TableHead"
-
-const TableCell = React.forwardRef<
- HTMLTableCellElement,
- React.TdHTMLAttributes<HTMLTableCellElement>
->(({ className, ...props }, ref) => (
- <td
- ref={ref}
- className={cn(
- "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
- className
- )}
- {...props}
- />
-))
-TableCell.displayName = "TableCell"
-
-const TableCaption = React.forwardRef<
- HTMLTableCaptionElement,
- React.HTMLAttributes<HTMLTableCaptionElement>
->(({ className, ...props }, ref) => (
- <caption
- ref={ref}
- className={cn("text-muted-foreground mt-4 text-sm", className)}
- {...props}
- />
-))
-TableCaption.displayName = "TableCaption"
-
-export {
- Table,
- TableHeader,
- TableBody,
- TableFooter,
- TableHead,
- TableRow,
- TableCell,
- TableCaption,
-}
diff --git a/apps/www/components/version-select.tsx b/apps/www/components/version-select.tsx
deleted file mode 100644
index 144b558f..00000000
--- a/apps/www/components/version-select.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-"use client"
-
-import * as React from "react"
-import { CheckIcon, ChevronDownIcon } from "@radix-ui/react-icons"
-
-import { cn } from "@/lib/utils"
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu"
-
-const DOMAINS = {
- v3: "https://v3.magicui.design",
- v4: "https://magicui.design",
-} as const
-
-export function VersionSelect({ className }: { className?: string }) {
- const [version, setVersion] = React.useState<keyof typeof DOMAINS>("v4")
-
- const handleVersionChange = (value: keyof typeof DOMAINS) => {
- setVersion(value)
- window.location.href = DOMAINS[value]
- }
-
- return (
- <DropdownMenu>
- <DropdownMenuTrigger
- className={cn(
- "bg-background text-foreground hover:bg-accent hover:text-accent-foreground flex h-7 w-14 cursor-pointer items-center justify-between rounded-full border py-1 pr-0.5 pl-2 text-sm font-medium",
- className
- )}
- >
- {version}
- <div className="flex size-5 items-center justify-center rounded-full border">
- <ChevronDownIcon className="text-muted-foreground size-4" />
- </div>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="start" className="min-w-[120px]">
- <DropdownMenuItem
- onClick={() => handleVersionChange("v3")}
- className={cn(
- "flex justify-between",
- version === "v3" && "bg-accent text-accent-foreground"
- )}
- >
- Tailwind v3
- {version === "v3" && <CheckIcon className="ml-2 size-4" />}
- </DropdownMenuItem>
- <DropdownMenuItem
- onClick={() => handleVersionChange("v4")}
- className={cn(
- "flex justify-between",
- version === "v4" && "bg-accent text-accent-foreground"
- )}
- >
- Tailwind v4
- {version === "v4" && <CheckIcon className="ml-2 size-4" />}
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- )
-}
diff --git a/apps/www/hooks/use-is-mac.ts b/apps/www/hooks/use-is-mac.ts
deleted file mode 100644
index ee749b9b..00000000
--- a/apps/www/hooks/use-is-mac.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { useEffect, useState } from "react"
-
-export function useIsMac() {
- const [isMac, setIsMac] = useState(true)
-
- useEffect(() => {
- setIsMac(navigator.platform.toUpperCase().includes("MAC"))
- }, [])
-
- return isMac
-}
diff --git a/apps/www/hooks/use-mounted.ts b/apps/www/hooks/use-mounted.ts
deleted file mode 100644
index 3a20c62a..00000000
--- a/apps/www/hooks/use-mounted.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import * as React from "react"
-
-export function useMounted() {
- const [mounted, setMounted] = React.useState(false)
-
- React.useEffect(() => {
- setMounted(true)
- }, [])
-
- return mounted
-}
diff --git a/apps/www/hooks/use-mutation-observer.ts b/apps/www/hooks/use-mutation-observer.ts
deleted file mode 100644
index aed3cded..00000000
--- a/apps/www/hooks/use-mutation-observer.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import * as React from "react"
-
-export const useMutationObserver = (
- ref: React.RefObject<HTMLElement | null>,
- callback: MutationCallback,
- options: MutationObserverInit = {
- attributes: true,
- characterData: true,
- childList: true,
- subtree: true,
- }
-) => {
- React.useEffect(() => {
- if (ref.current) {
- const observer = new MutationObserver(callback)
- observer.observe(ref.current, options)
- return () => observer.disconnect()
- }
- }, [ref, callback, options])
-}
diff --git a/apps/www/package.json b/apps/www/package.json
index 275d5477..b953f46d 100644
--- a/apps/www/package.json
+++ b/apps/www/package.json
@@ -22,10 +22,8 @@
"check": "pnpm lint && pnpm typecheck && pnpm format:check && pnpm registry-deps:check"
},
"dependencies": {
- "@hookform/resolvers": "^5.2.2",
"@radix-ui/react-accordion": "^1.2.12",
"@radix-ui/react-alert-dialog": "^1.1.15",
- "@radix-ui/react-avatar": "^1.1.10",
"@radix-ui/react-collapsible": "^1.1.12",
"@radix-ui/react-context-menu": "^2.2.16",
"@radix-ui/react-dialog": "^1.1.15",
@@ -34,10 +32,8 @@
"@radix-ui/react-label": "^2.1.7",
"@radix-ui/react-popover": "^1.1.15",
"@radix-ui/react-scroll-area": "^1.2.10",
- "@radix-ui/react-select": "^2.2.6",
"@radix-ui/react-separator": "^1.1.7",
"@radix-ui/react-slot": "^1.2.3",
- "@radix-ui/react-switch": "^1.2.6",
"@radix-ui/react-tabs": "^1.1.13",
"@radix-ui/react-tooltip": "^1.2.8",
"@tabler/icons-react": "^3.34.1",
@@ -63,7 +59,6 @@
"react": "19.1.1",
"react-day-picker": "^9.11.0",
"react-dom": "19.1.1",
- "react-hook-form": "^7.62.0",
"react-tweet": "^3.2.2",
"rough-notation": "^0.5.1",
"schema-dts": "^1.1.5",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 6d646861..374ad904 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -29,18 +29,12 @@ importers:
apps/www:
dependencies:
- '@hookform/resolvers':
- specifier: ^5.2.2
'@radix-ui/react-accordion':
specifier: ^1.2.12
'@radix-ui/react-alert-dialog':
specifier: ^1.1.15
- '@radix-ui/react-avatar':
- specifier: ^1.1.10
'@radix-ui/react-collapsible':
specifier: ^1.1.12
@@ -65,18 +59,12 @@ importers:
'@radix-ui/react-scroll-area':
specifier: ^1.2.10
- '@radix-ui/react-select':
- specifier: ^2.2.6
'@radix-ui/react-separator':
specifier: ^1.1.7
'@radix-ui/react-slot':
specifier: ^1.2.3
version: 1.3.3(@types/[email protected])([email protected])
- '@radix-ui/react-switch':
- specifier: ^1.2.6
'@radix-ui/react-tabs':
specifier: ^1.1.13
@@ -152,9 +140,6 @@ importers:
react-dom:
specifier: 19.1.1
version: 19.1.1([email protected])
- react-hook-form:
- specifier: ^7.62.0
- version: 7.87.0([email protected])
react-tweet:
specifier: ^3.2.2
@@ -893,84 +878,6 @@ packages:
peerDependencies:
hono: ^4
- '@hookform/[email protected]':
- resolution: {integrity: sha512-7b7vsbraJxKgjVSA1Nur9tLwj539WGJUBLA7QNvXnFoT2pM5Z7G+6rlukk4B2/QrTZy6huRtH6wKeESPKuIr6w==}
- peerDependencies:
- '@sinclair/typebox': '>=0.25.24'
- '@standard-schema/spec': ^1.0.0
- '@typeschema/main': '>=0.13.7'
- '@vinejs/vine': ^2.0.0 || ^3.0.0 || ^4.0.0
- ajv: ^8.12.0
- ajv-errors: ^3.0.0
- ajv-formats: ^2.1.1
- arktype: ^2.0.0
- ata-validator: ^1.2.0
- class-transformer: '>=0.4.0'
- class-validator: '>=0.12.0'
- computed-types: ^1.0.0
- effect: ^3.10.3
- fluentvalidation-ts: ^3.0.0
- fp-ts: ^2.7.0
- io-ts: ^2.0.0
- joi: ^17.0.0 || ^18.0.0
- nope-validator: '>=0.12.0'
- react-hook-form: ^7.55.0
- superstruct: '>=0.12.0'
- typanion: ^3.3.2
- valibot: '>=0.31.0 || ^1.0.0-beta.4 || ^1.0.0-rc'
- vest: '>=6.0.0'
- yup: ^1.0.0
- zod: ^3.25.0 || ^4.0.0
- peerDependenciesMeta:
- '@sinclair/typebox':
- optional: true
- '@standard-schema/spec':
- optional: true
- '@typeschema/main':
- optional: true
- '@vinejs/vine':
- optional: true
- ajv:
- optional: true
- ajv-errors:
- optional: true
- ajv-formats:
- optional: true
- arktype:
- optional: true
- ata-validator:
- optional: true
- class-transformer:
- optional: true
- class-validator:
- optional: true
- computed-types:
- optional: true
- effect:
- optional: true
- fluentvalidation-ts:
- optional: true
- fp-ts:
- optional: true
- io-ts:
- optional: true
- joi:
- optional: true
- nope-validator:
- optional: true
- superstruct:
- optional: true
- typanion:
- optional: true
- valibot:
- optional: true
- vest:
- optional: true
- yup:
- optional: true
- zod:
- optional: true
-
'@humanfs/[email protected]':
resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==}
engines: {node: '>=18.18.0'}
@@ -1380,19 +1287,6 @@ packages:
'@types/react-dom':
optional: true
- '@radix-ui/[email protected]':
- resolution: {integrity: sha512-4ULOTJ/mqy2hT9GlWa/MFHxHSvH3nJzHnZM1waNsc5Bonv7i70aNenghXmD97S6OJ81ekXONGGt4nT1r0PfEdA==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
- react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
-
'@radix-ui/[email protected]':
resolution: {integrity: sha512-mcGesGplBnzN2sbvJETzpCNfSMyPnb29q1GRLU+Ib7bJrpIG2ywmRoh2V5VbA2uNvKikKUlVbAPks7JDjz4A8Q==}
peerDependencies:
@@ -1664,19 +1558,6 @@ packages:
'@types/react-dom':
optional: true
- '@radix-ui/[email protected]':
- resolution: {integrity: sha512-WFGImkmbzcfxeIwq/+4HvRN0pizBwbwQUED4I13ezQsDdfl38ZntN6TmR8XaSzPBqoCToe8rF75j6NPNDSzhbg==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
- react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
-
'@radix-ui/[email protected]':
resolution: {integrity: sha512-jOLO4lssEzWpoDu7G+Ze4VjwMRUBt291pnZD0gmalREZipnTX3wadQo7Fy48GCTfe14/YRN6rw/rOJqrE85Wxw==}
peerDependencies:
@@ -1699,19 +1580,6 @@ packages:
'@types/react':
optional: true
- '@radix-ui/[email protected]':
- resolution: {integrity: sha512-48tB/4dn2UVLBCYhTu9AuR63IHl73l/qLbLgxd86noTUor4/K4LFDAcYjK+isP5313qxaFpjPVogE7+Y0/V3Kw==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
- react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
-
'@radix-ui/[email protected]':
resolution: {integrity: sha512-UKxJlZid7FVtsk/WTxj4i4uSEgj2Au+KBbS7SQyTlzMhhn+86Cz3tISZdTa87bfEfcuvZezf2ZsxD4xuEKtkog==}
peerDependencies:
@@ -2050,9 +1918,6 @@ packages:
'@standard-schema/[email protected]':
resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==}
- '@standard-schema/[email protected]':
- resolution: {integrity: sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==}
-
resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==}
@@ -4970,12 +4835,6 @@ packages:
peerDependencies:
react: ^19.1.1
- resolution: {integrity: sha512-zhFzWvLxNHH+8839OnZcUxgMZw88ah2jZWDWvKWgF3Tpbnd0vKL+dlcuU3nZVWESZQjd81EW8K+wU+cYfYAc0w==}
- engines: {node: '>=18.0.0'}
- peerDependencies:
- react: ^16.8.0 || ^17 || ^18 || ^19
-
resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
@@ -6519,16 +6378,6 @@ snapshots:
dependencies:
hono: 4.13.7
- dependencies:
- '@standard-schema/utils': 0.3.0
- react-hook-form: 7.87.0([email protected])
- optionalDependencies:
- '@standard-schema/spec': 1.1.0
- ajv: 8.20.0
- ajv-formats: 2.1.1([email protected])
- zod: 4.5.4
-
'@humanfs/[email protected]':
dependencies:
'@humanfs/types': 0.15.0
@@ -6920,20 +6769,6 @@ snapshots:
'@types/react': 19.2.18
'@types/react-dom': 19.2.7(@types/[email protected])
- dependencies:
- '@radix-ui/primitive': 1.1.7
- '@radix-ui/react-context': 1.2.2(@types/[email protected])([email protected])
- '@radix-ui/react-use-callback-ref': 1.1.4(@types/[email protected])([email protected])
- '@radix-ui/react-use-is-hydrated': 0.1.3(@types/[email protected])([email protected])
- '@radix-ui/react-use-layout-effect': 1.1.4(@types/[email protected])([email protected])
- react: 19.1.1
- react-dom: 19.1.1([email protected])
- optionalDependencies:
- '@types/react': 19.2.18
- '@types/react-dom': 19.2.7(@types/[email protected])
-
dependencies:
'@radix-ui/primitive': 1.1.7
@@ -7234,36 +7069,6 @@ snapshots:
'@types/react': 19.2.18
'@types/react-dom': 19.2.7(@types/[email protected])
- dependencies:
- '@radix-ui/number': 1.1.3
- '@radix-ui/primitive': 1.1.7
- '@radix-ui/react-compose-refs': 1.1.5(@types/[email protected])([email protected])
- '@radix-ui/react-context': 1.2.2(@types/[email protected])([email protected])
- '@radix-ui/react-direction': 1.1.4(@types/[email protected])([email protected])
- '@radix-ui/react-dismissable-layer': 1.1.19(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
- '@radix-ui/react-focus-guards': 1.1.6(@types/[email protected])([email protected])
- '@radix-ui/react-focus-scope': 1.1.16(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
- '@radix-ui/react-id': 1.1.4(@types/[email protected])([email protected])
- '@radix-ui/react-slot': 1.3.3(@types/[email protected])([email protected])
- '@radix-ui/react-use-callback-ref': 1.1.4(@types/[email protected])([email protected])
- '@radix-ui/react-use-controllable-state': 1.2.6(@types/[email protected])([email protected])
- '@radix-ui/react-use-layout-effect': 1.1.4(@types/[email protected])([email protected])
- '@radix-ui/react-use-previous': 1.1.4(@types/[email protected])([email protected])
- '@radix-ui/react-visually-hidden': 1.2.11(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
- aria-hidden: 1.2.6
- react: 19.1.1
- react-dom: 19.1.1([email protected])
- react-remove-scroll: 2.7.2(@types/[email protected])([email protected])
- optionalDependencies:
- '@types/react': 19.2.18
- '@types/react-dom': 19.2.7(@types/[email protected])
-
dependencies:
@@ -7280,20 +7085,6 @@ snapshots:
optionalDependencies:
'@types/react': 19.2.18
- dependencies:
- '@radix-ui/primitive': 1.1.7
- '@radix-ui/react-compose-refs': 1.1.5(@types/[email protected])([email protected])
- '@radix-ui/react-context': 1.2.2(@types/[email protected])([email protected])
- '@radix-ui/react-use-controllable-state': 1.2.6(@types/[email protected])([email protected])
- '@radix-ui/react-use-size': 1.1.4(@types/[email protected])([email protected])
- react: 19.1.1
- react-dom: 19.1.1([email protected])
- optionalDependencies:
- '@types/react': 19.2.18
- '@types/react-dom': 19.2.7(@types/[email protected])
-
dependencies:
'@radix-ui/primitive': 1.1.7
@@ -7601,8 +7392,6 @@ snapshots:
'@standard-schema/[email protected]': {}
- '@standard-schema/[email protected]': {}
-
dependencies:
tslib: 2.8.1
@@ -10941,10 +10730,6 @@ snapshots:
react: 19.1.1
scheduler: 0.26.0
- dependencies:
- react: 19.1.1
-