diff --git a/.changeset/large-phones-poke.md b/.changeset/large-phones-poke.md new file mode 100644 index 00000000000..60e86eca93f --- /dev/null +++ b/.changeset/large-phones-poke.md @@ -0,0 +1,5 @@ +--- +"shadcn-ui": minor +--- + +Add support for frameworks diff --git a/.changeset/tidy-rings-ring.md b/.changeset/tidy-rings-ring.md new file mode 100644 index 00000000000..42c2fa870fb --- /dev/null +++ b/.changeset/tidy-rings-ring.md @@ -0,0 +1,5 @@ +--- +"shadcn": major +--- + +npx shadcn init diff --git a/.eslintrc.json b/.eslintrc.json index 9a48847ba7b..94fcc14cc57 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,6 +8,7 @@ "plugin:tailwindcss/recommended" ], "plugins": ["tailwindcss"], + "ignorePatterns": ["**/fixtures/**"], "rules": { "@next/next/no-html-link-for-pages": "off", "tailwindcss/no-custom-classname": "off", diff --git a/.github/version-script-beta.js b/.github/version-script-beta.js index 4dd5ea221d4..4c95b49f71b 100644 --- a/.github/version-script-beta.js +++ b/.github/version-script-beta.js @@ -4,7 +4,7 @@ import { exec } from "child_process" import fs from "fs" -const pkgJsonPath = "packages/cli/package.json" +const pkgJsonPath = "packages/shadcn/package.json" try { const pkg = JSON.parse(fs.readFileSync(pkgJsonPath)) exec("git rev-parse --short HEAD", (err, stdout) => { diff --git a/.github/version-script-next.js b/.github/version-script-next.js index c18a7af1805..5acd91c2d20 100644 --- a/.github/version-script-next.js +++ b/.github/version-script-next.js @@ -4,7 +4,7 @@ import { exec } from "child_process" import fs from "fs" -const pkgJsonPath = "packages/cli/package.json" +const pkgJsonPath = "packages/shadcn/package.json" try { const pkg = JSON.parse(fs.readFileSync(pkgJsonPath)) exec("git rev-parse --short HEAD", (err, stdout) => { diff --git a/.github/workflows/prerelease-comment.yml b/.github/workflows/prerelease-comment.yml index ad21a549f9b..7d4089ae1ac 100644 --- a/.github/workflows/prerelease-comment.yml +++ b/.github/workflows/prerelease-comment.yml @@ -28,8 +28,8 @@ jobs: for (const artifact of allArtifacts.data.artifacts) { // Extract the PR number and package version from the artifact name - const match = /^npm-package-shadcn-ui@(.*?)-pr-(\d+)/.exec(artifact.name); - + const match = /^npm-package-shadcn@(.*?)-pr-(\d+)/.exec(artifact.name); + if (match) { require("fs").appendFileSync( process.env.GITHUB_ENV, @@ -49,7 +49,7 @@ jobs: A new prerelease is available for testing: ```sh - npx shadcn-ui@${{ env.BETA_PACKAGE_VERSION }} + npx shadcn@${{ env.BETA_PACKAGE_VERSION }} ``` - name: "Remove the autorelease label once published" diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 8c7be9fe99e..f354abc95a2 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -40,7 +40,7 @@ jobs: run: node .github/version-script-beta.js - name: Authenticate to NPM - run: echo "//registry.npmjs.org/:_authToken=$NPM_ACCESS_TOKEN" >> packages/cli/.npmrc + run: echo "//registry.npmjs.org/:_authToken=$NPM_ACCESS_TOKEN" >> packages/shadcn/.npmrc env: NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} @@ -51,10 +51,10 @@ jobs: id: package-version uses: martinbeentjes/npm-get-version-action@main with: - path: packages/cli + path: packages/shadcn - name: Upload packaged artifact uses: actions/upload-artifact@v2 with: - name: npm-package-shadcn-ui@${{ steps.package-version.outputs.current-version }}-pr-${{ github.event.number }} # encode the PR number into the artifact name - path: packages/cli/dist/index.js + name: npm-package-shadcn@${{ steps.package-version.outputs.current-version }}-pr-${{ github.event.number }} # encode the PR number into the artifact name + path: packages/shadcn/dist/index.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 050a17e605b..b3c17a17fbb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,7 @@ jobs: # run: pnpm check - name: Build the package - run: pnpm build:cli + run: pnpm shadcn:build - name: Create Version PR or Publish to NPM id: changesets diff --git a/.prettierignore b/.prettierignore index b2269835327..41cd3d3b5d3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,4 +3,5 @@ node_modules .next build .contentlayer -apps/www/pages/api/registry.json \ No newline at end of file +apps/www/pages/api/registry.json +**/fixtures diff --git a/.vscode/settings.json b/.vscode/settings.json index 2de03938860..48a495a6a0d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,5 +6,10 @@ "tailwindCSS.experimental.classRegex": [ ["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"], ["cn\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"] + ], + "vitest.debugExclude": [ + "/**", + "**/node_modules/**", + "**/fixtures/**" ] } diff --git a/apps/www/__registry__/default/block/login-01.tsx b/apps/www/__registry__/default/block/login-01.tsx new file mode 100644 index 00000000000..09809062ff2 --- /dev/null +++ b/apps/www/__registry__/default/block/login-01.tsx @@ -0,0 +1,13 @@ +import { LoginForm } from "@/registry/default/block/login-01/components/login-form" + +export const iframeHeight = "870px" + +export const containerClassName = "w-full h-full" + +export default function Page() { + return ( +
+ +
+ ) +} diff --git a/apps/www/__registry__/default/block/sidebar-01.tsx b/apps/www/__registry__/default/block/sidebar-01.tsx new file mode 100644 index 00000000000..335bb25e163 --- /dev/null +++ b/apps/www/__registry__/default/block/sidebar-01.tsx @@ -0,0 +1,25 @@ +import { AppSidebar } from "@/registry/default/block/sidebar-01/components/app-sidebar" +import { + SidebarLayout, + SidebarTrigger, +} from "@/registry/default/block/sidebar-01/ui/sidebar" + +export const iframeHeight = "870px" + +export const containerClassName = "w-full h-full" + +export default async function Page() { + const { cookies } = await import("next/headers") + return ( + + +
+
+ +
+
+
+ ) +} diff --git a/apps/www/__registry__/default/example/accordion-demo.tsx b/apps/www/__registry__/default/example/accordion-demo.tsx deleted file mode 100644 index cc5ee7d2250..00000000000 --- a/apps/www/__registry__/default/example/accordion-demo.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { - Accordion, - AccordionContent, - AccordionItem, - AccordionTrigger, -} from "@/registry/default/ui/accordion" - -export default function AccordionDemo() { - return ( - - - Is it accessible? - - Yes. It adheres to the WAI-ARIA design pattern. - - - - Is it styled? - - Yes. It comes with default styles that matches the other - components' aesthetic. - - - - Is it animated? - - Yes. It's animated by default, but you can disable it if you - prefer. - - - - ) -} diff --git a/apps/www/__registry__/default/example/alert-demo.tsx b/apps/www/__registry__/default/example/alert-demo.tsx deleted file mode 100644 index a26c71fcfd1..00000000000 --- a/apps/www/__registry__/default/example/alert-demo.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { Terminal } from "lucide-react" - -import { - Alert, - AlertDescription, - AlertTitle, -} from "@/registry/default/ui/alert" - -export default function AlertDemo() { - return ( - - - Heads up! - - You can add components to your app using the cli. - - - ) -} diff --git a/apps/www/__registry__/default/example/alert-destructive.tsx b/apps/www/__registry__/default/example/alert-destructive.tsx deleted file mode 100644 index a72c26b8f88..00000000000 --- a/apps/www/__registry__/default/example/alert-destructive.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { AlertCircle } from "lucide-react" - -import { - Alert, - AlertDescription, - AlertTitle, -} from "@/registry/default/ui/alert" - -export default function AlertDestructive() { - return ( - - - Error - - Your session has expired. Please log in again. - - - ) -} diff --git a/apps/www/__registry__/default/example/alert-dialog-demo.tsx b/apps/www/__registry__/default/example/alert-dialog-demo.tsx deleted file mode 100644 index 2e087b3f85f..00000000000 --- a/apps/www/__registry__/default/example/alert-dialog-demo.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, -} from "@/registry/default/ui/alert-dialog" -import { Button } from "@/registry/default/ui/button" - -export default function AlertDialogDemo() { - return ( - - - - - - - Are you absolutely sure? - - This action cannot be undone. This will permanently delete your - account and remove your data from our servers. - - - - Cancel - Continue - - - - ) -} diff --git a/apps/www/__registry__/default/example/aspect-ratio-demo.tsx b/apps/www/__registry__/default/example/aspect-ratio-demo.tsx deleted file mode 100644 index 174a4860992..00000000000 --- a/apps/www/__registry__/default/example/aspect-ratio-demo.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import Image from "next/image" - -import { AspectRatio } from "@/registry/default/ui/aspect-ratio" - -export default function AspectRatioDemo() { - return ( - - Photo by Drew Beamer - - ) -} diff --git a/apps/www/__registry__/default/example/avatar-demo.tsx b/apps/www/__registry__/default/example/avatar-demo.tsx deleted file mode 100644 index 596d8691fbe..00000000000 --- a/apps/www/__registry__/default/example/avatar-demo.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { - Avatar, - AvatarFallback, - AvatarImage, -} from "@/registry/default/ui/avatar" - -export default function AvatarDemo() { - return ( - - - CN - - ) -} diff --git a/apps/www/__registry__/default/example/badge-demo.tsx b/apps/www/__registry__/default/example/badge-demo.tsx deleted file mode 100644 index 0636e41a185..00000000000 --- a/apps/www/__registry__/default/example/badge-demo.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { Badge } from "@/registry/default/ui/badge" - -export default function BadgeDemo() { - return Badge -} diff --git a/apps/www/__registry__/default/example/badge-destructive.tsx b/apps/www/__registry__/default/example/badge-destructive.tsx deleted file mode 100644 index d0a2f4c72de..00000000000 --- a/apps/www/__registry__/default/example/badge-destructive.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { Badge } from "@/registry/default/ui/badge" - -export default function BadgeDestructive() { - return Destructive -} diff --git a/apps/www/__registry__/default/example/badge-outline.tsx b/apps/www/__registry__/default/example/badge-outline.tsx deleted file mode 100644 index 2744bc3e3a1..00000000000 --- a/apps/www/__registry__/default/example/badge-outline.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { Badge } from "@/registry/default/ui/badge" - -export default function BadgeOutline() { - return Outline -} diff --git a/apps/www/__registry__/default/example/badge-secondary.tsx b/apps/www/__registry__/default/example/badge-secondary.tsx deleted file mode 100644 index a6f4f0903fd..00000000000 --- a/apps/www/__registry__/default/example/badge-secondary.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { Badge } from "@/registry/default/ui/badge" - -export default function BadgeSecondary() { - return Secondary -} diff --git a/apps/www/__registry__/default/example/breadcrumb-demo.tsx b/apps/www/__registry__/default/example/breadcrumb-demo.tsx deleted file mode 100644 index df146fd858b..00000000000 --- a/apps/www/__registry__/default/example/breadcrumb-demo.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { - Breadcrumb, - BreadcrumbEllipsis, - BreadcrumbItem, - BreadcrumbLink, - BreadcrumbList, - BreadcrumbPage, - BreadcrumbSeparator, -} from "@/registry/default/ui/breadcrumb" -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, -} from "@/registry/default/ui/dropdown-menu" - -export default function BreadcrumbDemo() { - return ( - - - - Home - - - - - - - Toggle menu - - - Documentation - Themes - GitHub - - - - - - Components - - - - Breadcrumb - - - - ) -} diff --git a/apps/www/__registry__/default/example/breadcrumb-dropdown.tsx b/apps/www/__registry__/default/example/breadcrumb-dropdown.tsx deleted file mode 100644 index 3970695c178..00000000000 --- a/apps/www/__registry__/default/example/breadcrumb-dropdown.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { ChevronDown, Slash } from "lucide-react" - -import { - Breadcrumb, - BreadcrumbItem, - BreadcrumbLink, - BreadcrumbList, - BreadcrumbPage, - BreadcrumbSeparator, -} from "@/registry/default/ui/breadcrumb" -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, -} from "@/registry/default/ui/dropdown-menu" - -export default function BreadcrumbWithDropdown() { - return ( - - - - Home - - - - - - - - Components - - - - Documentation - Themes - GitHub - - - - - - - - Breadcrumb - - - - ) -} diff --git a/apps/www/__registry__/default/example/breadcrumb-ellipsis.tsx b/apps/www/__registry__/default/example/breadcrumb-ellipsis.tsx deleted file mode 100644 index 2ef9a46e072..00000000000 --- a/apps/www/__registry__/default/example/breadcrumb-ellipsis.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import Link from "next/link" - -import { - Breadcrumb, - BreadcrumbEllipsis, - BreadcrumbItem, - BreadcrumbLink, - BreadcrumbList, - BreadcrumbPage, - BreadcrumbSeparator, -} from "@/registry/default/ui/breadcrumb" - -export default function BreadcrumbCollapsed() { - return ( - - - - - Home - - - - - - - - - - Components - - - - - Breadcrumb - - - - ) -} diff --git a/apps/www/__registry__/default/example/breadcrumb-link.tsx b/apps/www/__registry__/default/example/breadcrumb-link.tsx deleted file mode 100644 index 8b7bb3f020c..00000000000 --- a/apps/www/__registry__/default/example/breadcrumb-link.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import Link from "next/link" - -import { - Breadcrumb, - BreadcrumbItem, - BreadcrumbLink, - BreadcrumbList, - BreadcrumbPage, - BreadcrumbSeparator, -} from "@/registry/default/ui/breadcrumb" - -export default function BreadcrumbWithCustomSeparator() { - return ( - - - - - Home - - - - - - Components - - - - - Breadcrumb - - - - ) -} diff --git a/apps/www/__registry__/default/example/breadcrumb-responsive.tsx b/apps/www/__registry__/default/example/breadcrumb-responsive.tsx deleted file mode 100644 index ae0acaf8670..00000000000 --- a/apps/www/__registry__/default/example/breadcrumb-responsive.tsx +++ /dev/null @@ -1,133 +0,0 @@ -"use client" - -import * as React from "react" -import Link from "next/link" - -import { useMediaQuery } from "@/hooks/use-media-query" -import { - Breadcrumb, - BreadcrumbEllipsis, - BreadcrumbItem, - BreadcrumbLink, - BreadcrumbList, - BreadcrumbPage, - BreadcrumbSeparator, -} from "@/registry/default/ui/breadcrumb" -import { Button } from "@/registry/default/ui/button" -import { - Drawer, - DrawerClose, - DrawerContent, - DrawerDescription, - DrawerFooter, - DrawerHeader, - DrawerTitle, - DrawerTrigger, -} from "@/registry/default/ui/drawer" -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, -} from "@/registry/default/ui/dropdown-menu" - -const items = [ - { href: "#", label: "Home" }, - { href: "#", label: "Documentation" }, - { href: "#", label: "Building Your Application" }, - { href: "#", label: "Data Fetching" }, - { label: "Caching and Revalidating" }, -] - -const ITEMS_TO_DISPLAY = 3 - -export default function BreadcrumbResponsive() { - const [open, setOpen] = React.useState(false) - const isDesktop = useMediaQuery("(min-width: 768px)") - - return ( - - - - {items[0].label} - - - {items.length > ITEMS_TO_DISPLAY ? ( - <> - - {isDesktop ? ( - - - - - - {items.slice(1, -2).map((item, index) => ( - - - {item.label} - - - ))} - - - ) : ( - - - - - - - Navigate to - - Select a page to navigate to. - - -
- {items.slice(1, -2).map((item, index) => ( - - {item.label} - - ))} -
- - - - - -
-
- )} -
- - - ) : null} - {items.slice(-ITEMS_TO_DISPLAY + 1).map((item, index) => ( - - {item.href ? ( - <> - - {item.label} - - - - ) : ( - - {item.label} - - )} - - ))} -
-
- ) -} diff --git a/apps/www/__registry__/default/example/breadcrumb-separator.tsx b/apps/www/__registry__/default/example/breadcrumb-separator.tsx deleted file mode 100644 index 83e309112d1..00000000000 --- a/apps/www/__registry__/default/example/breadcrumb-separator.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Slash } from "lucide-react" - -import { - Breadcrumb, - BreadcrumbItem, - BreadcrumbLink, - BreadcrumbList, - BreadcrumbPage, - BreadcrumbSeparator, -} from "@/registry/default/ui/breadcrumb" - -export default function BreadcrumbWithCustomSeparator() { - return ( - - - - Home - - - - - - Components - - - - - - Breadcrumb - - - - ) -} diff --git a/apps/www/__registry__/default/example/button-as-child.tsx b/apps/www/__registry__/default/example/button-as-child.tsx deleted file mode 100644 index edb19e11568..00000000000 --- a/apps/www/__registry__/default/example/button-as-child.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import Link from "next/link" - -import { Button } from "@/registry/default/ui/button" - -export default function ButtonAsChild() { - return ( - - ) -} diff --git a/apps/www/__registry__/default/example/button-demo.tsx b/apps/www/__registry__/default/example/button-demo.tsx deleted file mode 100644 index 0dc1d9095ea..00000000000 --- a/apps/www/__registry__/default/example/button-demo.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { Button } from "@/registry/default/ui/button" - -export default function ButtonDemo() { - return -} diff --git a/apps/www/__registry__/default/example/button-destructive.tsx b/apps/www/__registry__/default/example/button-destructive.tsx deleted file mode 100644 index 07d3e1b1281..00000000000 --- a/apps/www/__registry__/default/example/button-destructive.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { Button } from "@/registry/default/ui/button" - -export default function ButtonDestructive() { - return -} diff --git a/apps/www/__registry__/default/example/button-ghost.tsx b/apps/www/__registry__/default/example/button-ghost.tsx deleted file mode 100644 index fe458c79b23..00000000000 --- a/apps/www/__registry__/default/example/button-ghost.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { Button } from "@/registry/default/ui/button" - -export default function ButtonGhost() { - return -} diff --git a/apps/www/__registry__/default/example/button-icon.tsx b/apps/www/__registry__/default/example/button-icon.tsx deleted file mode 100644 index 1e790f85d4f..00000000000 --- a/apps/www/__registry__/default/example/button-icon.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { ChevronRight } from "lucide-react" - -import { Button } from "@/registry/default/ui/button" - -export default function ButtonIcon() { - return ( - - ) -} diff --git a/apps/www/__registry__/default/example/button-link.tsx b/apps/www/__registry__/default/example/button-link.tsx deleted file mode 100644 index 1fad5bc0f0f..00000000000 --- a/apps/www/__registry__/default/example/button-link.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { Button } from "@/registry/default/ui/button" - -export default function ButtonLink() { - return -} diff --git a/apps/www/__registry__/default/example/button-loading.tsx b/apps/www/__registry__/default/example/button-loading.tsx deleted file mode 100644 index bdce9478b02..00000000000 --- a/apps/www/__registry__/default/example/button-loading.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { Loader2 } from "lucide-react" - -import { Button } from "@/registry/default/ui/button" - -export default function ButtonLoading() { - return ( - - ) -} diff --git a/apps/www/__registry__/default/example/button-outline.tsx b/apps/www/__registry__/default/example/button-outline.tsx deleted file mode 100644 index bfb7c8453bf..00000000000 --- a/apps/www/__registry__/default/example/button-outline.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { Button } from "@/registry/default/ui/button" - -export default function ButtonOutline() { - return -} diff --git a/apps/www/__registry__/default/example/button-secondary.tsx b/apps/www/__registry__/default/example/button-secondary.tsx deleted file mode 100644 index 4f3c7f91275..00000000000 --- a/apps/www/__registry__/default/example/button-secondary.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { Button } from "@/registry/default/ui/button" - -export default function ButtonSecondary() { - return -} diff --git a/apps/www/__registry__/default/example/button-with-icon.tsx b/apps/www/__registry__/default/example/button-with-icon.tsx deleted file mode 100644 index fd4e39671d1..00000000000 --- a/apps/www/__registry__/default/example/button-with-icon.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Mail } from "lucide-react" - -import { Button } from "@/registry/default/ui/button" - -export default function ButtonWithIcon() { - return ( - - ) -} diff --git a/apps/www/__registry__/default/example/calendar-demo.tsx b/apps/www/__registry__/default/example/calendar-demo.tsx deleted file mode 100644 index dec175ac7e8..00000000000 --- a/apps/www/__registry__/default/example/calendar-demo.tsx +++ /dev/null @@ -1,18 +0,0 @@ -"use client" - -import * as React from "react" - -import { Calendar } from "@/registry/default/ui/calendar" - -export default function CalendarDemo() { - const [date, setDate] = React.useState(new Date()) - - return ( - - ) -} diff --git a/apps/www/__registry__/default/example/calendar-form.tsx b/apps/www/__registry__/default/example/calendar-form.tsx deleted file mode 100644 index 3fec57d8313..00000000000 --- a/apps/www/__registry__/default/example/calendar-form.tsx +++ /dev/null @@ -1,101 +0,0 @@ -"use client" - -import { zodResolver } from "@hookform/resolvers/zod" -import { format } from "date-fns" -import { CalendarIcon } from "lucide-react" -import { useForm } from "react-hook-form" -import { z } from "zod" - -import { cn } from "@/lib/utils" -import { Button } from "@/registry/default/ui/button" -import { Calendar } from "@/registry/default/ui/calendar" -import { - Form, - FormControl, - FormDescription, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/registry/default/ui/form" -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/registry/default/ui/popover" -import { toast } from "@/registry/default/ui/use-toast" - -const FormSchema = z.object({ - dob: z.date({ - required_error: "A date of birth is required.", - }), -}) - -export default function CalendarForm() { - const form = useForm>({ - resolver: zodResolver(FormSchema), - }) - - function onSubmit(data: z.infer) { - toast({ - title: "You submitted the following values:", - description: ( -
-          {JSON.stringify(data, null, 2)}
-        
- ), - }) - } - - return ( -
- - ( - - Date of birth - - - - - - - - - date > new Date() || date < new Date("1900-01-01") - } - initialFocus - /> - - - - Your date of birth is used to calculate your age. - - - - )} - /> - - - - ) -} diff --git a/apps/www/__registry__/default/example/card-demo.tsx b/apps/www/__registry__/default/example/card-demo.tsx deleted file mode 100644 index 136f42ab848..00000000000 --- a/apps/www/__registry__/default/example/card-demo.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import { BellRing, Check } from "lucide-react" - -import { cn } from "@/lib/utils" -import { Button } from "@/registry/default/ui/button" -import { - Card, - CardContent, - CardDescription, - CardFooter, - CardHeader, - CardTitle, -} from "@/registry/default/ui/card" -import { Switch } from "@/registry/default/ui/switch" - -const notifications = [ - { - title: "Your call has been confirmed.", - description: "1 hour ago", - }, - { - title: "You have a new message!", - description: "1 hour ago", - }, - { - title: "Your subscription is expiring soon!", - description: "2 hours ago", - }, -] - -type CardProps = React.ComponentProps - -export default function CardDemo({ className, ...props }: CardProps) { - return ( - - - Notifications - You have 3 unread messages. - - -
- -
-

- Push Notifications -

-

- Send notifications to device. -

-
- -
-
- {notifications.map((notification, index) => ( -
- -
-

- {notification.title} -

-

- {notification.description} -

-
-
- ))} -
-
- - - -
- ) -} diff --git a/apps/www/__registry__/default/example/card-with-form.tsx b/apps/www/__registry__/default/example/card-with-form.tsx deleted file mode 100644 index 31c960e4f68..00000000000 --- a/apps/www/__registry__/default/example/card-with-form.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import * as React from "react" - -import { Button } from "@/registry/default/ui/button" -import { - Card, - CardContent, - CardDescription, - CardFooter, - CardHeader, - CardTitle, -} from "@/registry/default/ui/card" -import { Input } from "@/registry/default/ui/input" -import { Label } from "@/registry/default/ui/label" -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/registry/default/ui/select" - -export default function CardWithForm() { - return ( - - - Create project - Deploy your new project in one-click. - - -
-
-
- - -
-
- - -
-
-
-
- - - - -
- ) -} diff --git a/apps/www/__registry__/default/example/carousel-api.tsx b/apps/www/__registry__/default/example/carousel-api.tsx deleted file mode 100644 index 9b8ac3837ce..00000000000 --- a/apps/www/__registry__/default/example/carousel-api.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import * as React from "react" - -import { Card, CardContent } from "@/registry/default/ui/card" -import { - Carousel, - CarouselContent, - CarouselItem, - CarouselNext, - CarouselPrevious, - type CarouselApi, -} from "@/registry/default/ui/carousel" - -export default function CarouselDApiDemo() { - const [api, setApi] = React.useState() - const [current, setCurrent] = React.useState(0) - const [count, setCount] = React.useState(0) - - React.useEffect(() => { - if (!api) { - return - } - - setCount(api.scrollSnapList().length) - setCurrent(api.selectedScrollSnap() + 1) - - api.on("select", () => { - console.log("current") - setCurrent(api.selectedScrollSnap() + 1) - }) - }, [api]) - - return ( -
- - - {Array.from({ length: 5 }).map((_, index) => ( - - - - {index + 1} - - - - ))} - - - - -
- Slide {current} of {count} -
-
- ) -} diff --git a/apps/www/__registry__/default/example/carousel-demo.tsx b/apps/www/__registry__/default/example/carousel-demo.tsx deleted file mode 100644 index 9efd3d27be8..00000000000 --- a/apps/www/__registry__/default/example/carousel-demo.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import * as React from "react" - -import { Card, CardContent } from "@/registry/default/ui/card" -import { - Carousel, - CarouselContent, - CarouselItem, - CarouselNext, - CarouselPrevious, -} from "@/registry/default/ui/carousel" - -export default function CarouselDemo() { - return ( - - - {Array.from({ length: 5 }).map((_, index) => ( - -
- - - {index + 1} - - -
-
- ))} -
- - -
- ) -} diff --git a/apps/www/__registry__/default/example/carousel-orientation.tsx b/apps/www/__registry__/default/example/carousel-orientation.tsx deleted file mode 100644 index 863e8688249..00000000000 --- a/apps/www/__registry__/default/example/carousel-orientation.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import * as React from "react" - -import { Card, CardContent } from "@/registry/default/ui/card" -import { - Carousel, - CarouselContent, - CarouselItem, - CarouselNext, - CarouselPrevious, -} from "@/registry/default/ui/carousel" - -export default function CarouselOrientation() { - return ( - - - {Array.from({ length: 5 }).map((_, index) => ( - -
- - - {index + 1} - - -
-
- ))} -
- - -
- ) -} diff --git a/apps/www/__registry__/default/example/carousel-plugin.tsx b/apps/www/__registry__/default/example/carousel-plugin.tsx deleted file mode 100644 index 93db22c15f5..00000000000 --- a/apps/www/__registry__/default/example/carousel-plugin.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import * as React from "react" -import Autoplay from "embla-carousel-autoplay" - -import { Card, CardContent } from "@/registry/default/ui/card" -import { - Carousel, - CarouselContent, - CarouselItem, - CarouselNext, - CarouselPrevious, -} from "@/registry/default/ui/carousel" - -export default function CarouselPlugin() { - const plugin = React.useRef( - Autoplay({ delay: 2000, stopOnInteraction: true }) - ) - - return ( - - - {Array.from({ length: 5 }).map((_, index) => ( - -
- - - {index + 1} - - -
-
- ))} -
- - -
- ) -} diff --git a/apps/www/__registry__/default/example/carousel-size.tsx b/apps/www/__registry__/default/example/carousel-size.tsx deleted file mode 100644 index 41e00c8a462..00000000000 --- a/apps/www/__registry__/default/example/carousel-size.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import * as React from "react" - -import { Card, CardContent } from "@/registry/default/ui/card" -import { - Carousel, - CarouselContent, - CarouselItem, - CarouselNext, - CarouselPrevious, -} from "@/registry/default/ui/carousel" - -export default function CarouselSize() { - return ( - - - {Array.from({ length: 5 }).map((_, index) => ( - -
- - - {index + 1} - - -
-
- ))} -
- - -
- ) -} diff --git a/apps/www/__registry__/default/example/carousel-spacing.tsx b/apps/www/__registry__/default/example/carousel-spacing.tsx deleted file mode 100644 index c1357e0f21c..00000000000 --- a/apps/www/__registry__/default/example/carousel-spacing.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import * as React from "react" - -import { Card, CardContent } from "@/registry/default/ui/card" -import { - Carousel, - CarouselContent, - CarouselItem, - CarouselNext, - CarouselPrevious, -} from "@/registry/default/ui/carousel" - -export default function CarouselSpacing() { - return ( - - - {Array.from({ length: 5 }).map((_, index) => ( - -
- - - {index + 1} - - -
-
- ))} -
- - -
- ) -} diff --git a/apps/www/__registry__/default/example/checkbox-demo.tsx b/apps/www/__registry__/default/example/checkbox-demo.tsx deleted file mode 100644 index 11c520e3744..00000000000 --- a/apps/www/__registry__/default/example/checkbox-demo.tsx +++ /dev/null @@ -1,17 +0,0 @@ -"use client" - -import { Checkbox } from "@/registry/default/ui/checkbox" - -export default function CheckboxDemo() { - return ( -
- - -
- ) -} diff --git a/apps/www/__registry__/default/example/checkbox-disabled.tsx b/apps/www/__registry__/default/example/checkbox-disabled.tsx deleted file mode 100644 index 00780c9da74..00000000000 --- a/apps/www/__registry__/default/example/checkbox-disabled.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { Checkbox } from "@/registry/default/ui/checkbox" - -export default function CheckboxDisabled() { - return ( -
- - -
- ) -} diff --git a/apps/www/__registry__/default/example/checkbox-form-multiple.tsx b/apps/www/__registry__/default/example/checkbox-form-multiple.tsx deleted file mode 100644 index b89ba5d12e5..00000000000 --- a/apps/www/__registry__/default/example/checkbox-form-multiple.tsx +++ /dev/null @@ -1,127 +0,0 @@ -"use client" - -import { zodResolver } from "@hookform/resolvers/zod" -import { useForm } from "react-hook-form" -import { z } from "zod" - -import { Button } from "@/registry/default/ui/button" -import { Checkbox } from "@/registry/default/ui/checkbox" -import { - Form, - FormControl, - FormDescription, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/registry/default/ui/form" -import { toast } from "@/registry/default/ui/use-toast" - -const items = [ - { - id: "recents", - label: "Recents", - }, - { - id: "home", - label: "Home", - }, - { - id: "applications", - label: "Applications", - }, - { - id: "desktop", - label: "Desktop", - }, - { - id: "downloads", - label: "Downloads", - }, - { - id: "documents", - label: "Documents", - }, -] as const - -const FormSchema = z.object({ - items: z.array(z.string()).refine((value) => value.some((item) => item), { - message: "You have to select at least one item.", - }), -}) - -export default function CheckboxReactHookFormMultiple() { - const form = useForm>({ - resolver: zodResolver(FormSchema), - defaultValues: { - items: ["recents", "home"], - }, - }) - - function onSubmit(data: z.infer) { - toast({ - title: "You submitted the following values:", - description: ( -
-          {JSON.stringify(data, null, 2)}
-        
- ), - }) - } - - return ( -
- - ( - -
- Sidebar - - Select the items you want to display in the sidebar. - -
- {items.map((item) => ( - { - return ( - - - { - return checked - ? field.onChange([...field.value, item.id]) - : field.onChange( - field.value?.filter( - (value) => value !== item.id - ) - ) - }} - /> - - - {item.label} - - - ) - }} - /> - ))} - -
- )} - /> - - - - ) -} diff --git a/apps/www/__registry__/default/example/checkbox-form-single.tsx b/apps/www/__registry__/default/example/checkbox-form-single.tsx deleted file mode 100644 index 95f0b7f8f48..00000000000 --- a/apps/www/__registry__/default/example/checkbox-form-single.tsx +++ /dev/null @@ -1,73 +0,0 @@ -"use client" - -import Link from "next/link" -import { zodResolver } from "@hookform/resolvers/zod" -import { useForm } from "react-hook-form" -import { z } from "zod" - -import { Button } from "@/registry/default/ui/button" -import { Checkbox } from "@/registry/default/ui/checkbox" -import { - Form, - FormControl, - FormDescription, - FormField, - FormItem, - FormLabel, -} from "@/registry/default/ui/form" -import { toast } from "@/registry/default/ui/use-toast" - -const FormSchema = z.object({ - mobile: z.boolean().default(false).optional(), -}) - -export default function CheckboxReactHookFormSingle() { - const form = useForm>({ - resolver: zodResolver(FormSchema), - defaultValues: { - mobile: true, - }, - }) - - function onSubmit(data: z.infer) { - toast({ - title: "You submitted the following values:", - description: ( -
-          {JSON.stringify(data, null, 2)}
-        
- ), - }) - } - - return ( -
- - ( - - - - -
- - Use different settings for my mobile devices - - - You can manage your mobile notifications in the{" "} - mobile settings page. - -
-
- )} - /> - - - - ) -} diff --git a/apps/www/__registry__/default/example/checkbox-with-text.tsx b/apps/www/__registry__/default/example/checkbox-with-text.tsx deleted file mode 100644 index 4b9479e4aa2..00000000000 --- a/apps/www/__registry__/default/example/checkbox-with-text.tsx +++ /dev/null @@ -1,22 +0,0 @@ -"use client" - -import { Checkbox } from "@/registry/default/ui/checkbox" - -export default function CheckboxWithText() { - return ( -
- -
- -

- You agree to our Terms of Service and Privacy Policy. -

-
-
- ) -} diff --git a/apps/www/__registry__/default/example/collapsible-demo.tsx b/apps/www/__registry__/default/example/collapsible-demo.tsx deleted file mode 100644 index 345d54adc67..00000000000 --- a/apps/www/__registry__/default/example/collapsible-demo.tsx +++ /dev/null @@ -1,46 +0,0 @@ -"use client" - -import * as React from "react" -import { ChevronsUpDown, Plus, X } from "lucide-react" - -import { Button } from "@/registry/default/ui/button" -import { - Collapsible, - CollapsibleContent, - CollapsibleTrigger, -} from "@/registry/default/ui/collapsible" - -export default function CollapsibleDemo() { - const [isOpen, setIsOpen] = React.useState(false) - - return ( - -
-

- @peduarte starred 3 repositories -

- - - -
-
- @radix-ui/primitives -
- -
- @radix-ui/colors -
-
- @stitches/react -
-
-
- ) -} diff --git a/apps/www/__registry__/default/example/combobox-demo.tsx b/apps/www/__registry__/default/example/combobox-demo.tsx deleted file mode 100644 index b16ad8fd7b5..00000000000 --- a/apps/www/__registry__/default/example/combobox-demo.tsx +++ /dev/null @@ -1,91 +0,0 @@ -"use client" - -import * as React from "react" -import { Check, ChevronsUpDown } from "lucide-react" - -import { cn } from "@/lib/utils" -import { Button } from "@/registry/default/ui/button" -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, -} from "@/registry/default/ui/command" -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/registry/default/ui/popover" - -const frameworks = [ - { - value: "next.js", - label: "Next.js", - }, - { - value: "sveltekit", - label: "SvelteKit", - }, - { - value: "nuxt.js", - label: "Nuxt.js", - }, - { - value: "remix", - label: "Remix", - }, - { - value: "astro", - label: "Astro", - }, -] - -export default function ComboboxDemo() { - const [open, setOpen] = React.useState(false) - const [value, setValue] = React.useState("") - - return ( - - - - - - - - No framework found. - - {frameworks.map((framework) => ( - { - setValue(currentValue === value ? "" : currentValue) - setOpen(false) - }} - > - - {framework.label} - - ))} - - - - - ) -} diff --git a/apps/www/__registry__/default/example/combobox-dropdown-menu.tsx b/apps/www/__registry__/default/example/combobox-dropdown-menu.tsx deleted file mode 100644 index de1a35afba8..00000000000 --- a/apps/www/__registry__/default/example/combobox-dropdown-menu.tsx +++ /dev/null @@ -1,111 +0,0 @@ -"use client" - -import * as React from "react" -import { Calendar, MoreHorizontal, Tags, Trash, User } from "lucide-react" - -import { Button } from "@/registry/default/ui/button" -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, - CommandList, -} from "@/registry/default/ui/command" -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuGroup, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuShortcut, - DropdownMenuSub, - DropdownMenuSubContent, - DropdownMenuSubTrigger, - DropdownMenuTrigger, -} from "@/registry/default/ui/dropdown-menu" - -const labels = [ - "feature", - "bug", - "enhancement", - "documentation", - "design", - "question", - "maintenance", -] - -export default function ComboboxDropdownMenu() { - const [label, setLabel] = React.useState("feature") - const [open, setOpen] = React.useState(false) - - return ( -
-

- - {label} - - Create a new project -

- - - - - - Actions - - - - Assign to... - - - - Set due date... - - - - - - Apply label - - - - - - No label found. - - {labels.map((label) => ( - { - setLabel(value) - setOpen(false) - }} - > - {label} - - ))} - - - - - - - - - Delete - ⌘⌫ - - - - -
- ) -} diff --git a/apps/www/__registry__/default/example/combobox-form.tsx b/apps/www/__registry__/default/example/combobox-form.tsx deleted file mode 100644 index 24f9b00c742..00000000000 --- a/apps/www/__registry__/default/example/combobox-form.tsx +++ /dev/null @@ -1,135 +0,0 @@ -"use client" - -import { zodResolver } from "@hookform/resolvers/zod" -import { Check, ChevronsUpDown } from "lucide-react" -import { useForm } from "react-hook-form" -import { z } from "zod" - -import { cn } from "@/lib/utils" -import { Button } from "@/registry/default/ui/button" -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, -} from "@/registry/default/ui/command" -import { - Form, - FormControl, - FormDescription, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/registry/default/ui/form" -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/registry/default/ui/popover" -import { toast } from "@/registry/default/ui/use-toast" - -const languages = [ - { label: "English", value: "en" }, - { label: "French", value: "fr" }, - { label: "German", value: "de" }, - { label: "Spanish", value: "es" }, - { label: "Portuguese", value: "pt" }, - { label: "Russian", value: "ru" }, - { label: "Japanese", value: "ja" }, - { label: "Korean", value: "ko" }, - { label: "Chinese", value: "zh" }, -] as const - -const FormSchema = z.object({ - language: z.string({ - required_error: "Please select a language.", - }), -}) - -export default function ComboboxForm() { - const form = useForm>({ - resolver: zodResolver(FormSchema), - }) - - function onSubmit(data: z.infer) { - toast({ - title: "You submitted the following values:", - description: ( -
-          {JSON.stringify(data, null, 2)}
-        
- ), - }) - } - - return ( -
- - ( - - Language - - - - - - - - - - No language found. - - {languages.map((language) => ( - { - form.setValue("language", language.value) - }} - > - - {language.label} - - ))} - - - - - - This is the language that will be used in the dashboard. - - - - )} - /> - - - - ) -} diff --git a/apps/www/__registry__/default/example/combobox-popover.tsx b/apps/www/__registry__/default/example/combobox-popover.tsx deleted file mode 100644 index aacb34dc51e..00000000000 --- a/apps/www/__registry__/default/example/combobox-popover.tsx +++ /dev/null @@ -1,125 +0,0 @@ -"use client" - -import * as React from "react" -import { - ArrowUpCircle, - CheckCircle2, - Circle, - HelpCircle, - LucideIcon, - XCircle, -} from "lucide-react" - -import { cn } from "@/lib/utils" -import { Button } from "@/registry/default/ui/button" -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, - CommandList, -} from "@/registry/default/ui/command" -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/registry/default/ui/popover" - -type Status = { - value: string - label: string - icon: LucideIcon -} - -const statuses: Status[] = [ - { - value: "backlog", - label: "Backlog", - icon: HelpCircle, - }, - { - value: "todo", - label: "Todo", - icon: Circle, - }, - { - value: "in progress", - label: "In Progress", - icon: ArrowUpCircle, - }, - { - value: "done", - label: "Done", - icon: CheckCircle2, - }, - { - value: "canceled", - label: "Canceled", - icon: XCircle, - }, -] - -export default function ComboboxPopover() { - const [open, setOpen] = React.useState(false) - const [selectedStatus, setSelectedStatus] = React.useState( - null - ) - - return ( -
-

Status

- - - - - - - - - No results found. - - {statuses.map((status) => ( - { - setSelectedStatus( - statuses.find((priority) => priority.value === value) || - null - ) - setOpen(false) - }} - > - - {status.label} - - ))} - - - - - -
- ) -} diff --git a/apps/www/__registry__/default/example/combobox-responsive.tsx b/apps/www/__registry__/default/example/combobox-responsive.tsx deleted file mode 100644 index 176e4abf909..00000000000 --- a/apps/www/__registry__/default/example/combobox-responsive.tsx +++ /dev/null @@ -1,123 +0,0 @@ -"use client" - -import * as React from "react" - -import { useMediaQuery } from "@/hooks/use-media-query" -import { Button } from "@/registry/default/ui/button" -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, - CommandList, -} from "@/registry/default/ui/command" -import { - Drawer, - DrawerContent, - DrawerTrigger, -} from "@/registry/default/ui/drawer" -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/registry/default/ui/popover" - -type Status = { - value: string - label: string -} - -const statuses: Status[] = [ - { - value: "backlog", - label: "Backlog", - }, - { - value: "todo", - label: "Todo", - }, - { - value: "in progress", - label: "In Progress", - }, - { - value: "done", - label: "Done", - }, - { - value: "canceled", - label: "Canceled", - }, -] - -export default function ComboBoxResponsive() { - const [open, setOpen] = React.useState(false) - const isDesktop = useMediaQuery("(min-width: 768px)") - const [selectedStatus, setSelectedStatus] = React.useState( - null - ) - - if (isDesktop) { - return ( - - - - - - - - - ) - } - - return ( - - - - - -
- -
-
-
- ) -} - -function StatusList({ - setOpen, - setSelectedStatus, -}: { - setOpen: (open: boolean) => void - setSelectedStatus: (status: Status | null) => void -}) { - return ( - - - - No results found. - - {statuses.map((status) => ( - { - setSelectedStatus( - statuses.find((priority) => priority.value === value) || null - ) - setOpen(false) - }} - > - {status.label} - - ))} - - - - ) -} diff --git a/apps/www/__registry__/default/example/command-demo.tsx b/apps/www/__registry__/default/example/command-demo.tsx deleted file mode 100644 index b1d7fde68dd..00000000000 --- a/apps/www/__registry__/default/example/command-demo.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import { - Calculator, - Calendar, - CreditCard, - Settings, - Smile, - User, -} from "lucide-react" - -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, - CommandList, - CommandSeparator, - CommandShortcut, -} from "@/registry/default/ui/command" - -export default function CommandDemo() { - return ( - - - - No results found. - - - - Calendar - - - - Search Emoji - - - - Calculator - - - - - - - Profile - ⌘P - - - - Billing - ⌘B - - - - Settings - ⌘S - - - - - ) -} diff --git a/apps/www/__registry__/default/example/command-dialog.tsx b/apps/www/__registry__/default/example/command-dialog.tsx deleted file mode 100644 index 64c35c7166e..00000000000 --- a/apps/www/__registry__/default/example/command-dialog.tsx +++ /dev/null @@ -1,87 +0,0 @@ -"use client" - -import * as React from "react" -import { - Calculator, - Calendar, - CreditCard, - Settings, - Smile, - User, -} from "lucide-react" - -import { - CommandDialog, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, - CommandList, - CommandSeparator, - CommandShortcut, -} from "@/registry/default/ui/command" - -export default function CommandDialogDemo() { - const [open, setOpen] = React.useState(false) - - React.useEffect(() => { - const down = (e: KeyboardEvent) => { - if (e.key === "j" && (e.metaKey || e.ctrlKey)) { - e.preventDefault() - setOpen((open) => !open) - } - } - - document.addEventListener("keydown", down) - return () => document.removeEventListener("keydown", down) - }, []) - - return ( - <> -

- Press{" "} - - J - -

- - - - No results found. - - - - Calendar - - - - Search Emoji - - - - Calculator - - - - - - - Profile - ⌘P - - - - Billing - ⌘B - - - - Settings - ⌘S - - - - - - ) -} diff --git a/apps/www/__registry__/default/example/context-menu-demo.tsx b/apps/www/__registry__/default/example/context-menu-demo.tsx deleted file mode 100644 index b2a13653e80..00000000000 --- a/apps/www/__registry__/default/example/context-menu-demo.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { - ContextMenu, - ContextMenuCheckboxItem, - ContextMenuContent, - ContextMenuItem, - ContextMenuLabel, - ContextMenuRadioGroup, - ContextMenuRadioItem, - ContextMenuSeparator, - ContextMenuShortcut, - ContextMenuSub, - ContextMenuSubContent, - ContextMenuSubTrigger, - ContextMenuTrigger, -} from "@/registry/default/ui/context-menu" - -export default function ContextMenuDemo() { - return ( - - - Right click here - - - - Back - ⌘[ - - - Forward - ⌘] - - - Reload - ⌘R - - - More Tools - - - Save Page As... - ⇧⌘S - - Create Shortcut... - Name Window... - - Developer Tools - - - - - Show Bookmarks Bar - ⌘⇧B - - Show Full URLs - - - People - - - Pedro Duarte - - Colm Tuite - - - - ) -} diff --git a/apps/www/__registry__/default/example/data-table-demo.tsx b/apps/www/__registry__/default/example/data-table-demo.tsx deleted file mode 100644 index f5fd232617a..00000000000 --- a/apps/www/__registry__/default/example/data-table-demo.tsx +++ /dev/null @@ -1,312 +0,0 @@ -"use client" - -import * as React from "react" -import { - ColumnDef, - ColumnFiltersState, - SortingState, - VisibilityState, - flexRender, - getCoreRowModel, - getFilteredRowModel, - getPaginationRowModel, - getSortedRowModel, - useReactTable, -} from "@tanstack/react-table" -import { ArrowUpDown, ChevronDown, MoreHorizontal } from "lucide-react" - -import { Button } from "@/registry/default/ui/button" -import { Checkbox } from "@/registry/default/ui/checkbox" -import { - DropdownMenu, - DropdownMenuCheckboxItem, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuTrigger, -} from "@/registry/default/ui/dropdown-menu" -import { Input } from "@/registry/default/ui/input" -import { - Table, - TableBody, - TableCell, - TableHead, - TableHeader, - TableRow, -} from "@/registry/default/ui/table" - -const data: Payment[] = [ - { - id: "m5gr84i9", - amount: 316, - status: "success", - email: "ken99@yahoo.com", - }, - { - id: "3u1reuv4", - amount: 242, - status: "success", - email: "Abe45@gmail.com", - }, - { - id: "derv1ws0", - amount: 837, - status: "processing", - email: "Monserrat44@gmail.com", - }, - { - id: "5kma53ae", - amount: 874, - status: "success", - email: "Silas22@gmail.com", - }, - { - id: "bhqecj4p", - amount: 721, - status: "failed", - email: "carmella@hotmail.com", - }, -] - -export type Payment = { - id: string - amount: number - status: "pending" | "processing" | "success" | "failed" - email: string -} - -export const columns: ColumnDef[] = [ - { - id: "select", - header: ({ table }) => ( - table.toggleAllPageRowsSelected(!!value)} - aria-label="Select all" - /> - ), - cell: ({ row }) => ( - row.toggleSelected(!!value)} - aria-label="Select row" - /> - ), - enableSorting: false, - enableHiding: false, - }, - { - accessorKey: "status", - header: "Status", - cell: ({ row }) => ( -
{row.getValue("status")}
- ), - }, - { - accessorKey: "email", - header: ({ column }) => { - return ( - - ) - }, - cell: ({ row }) =>
{row.getValue("email")}
, - }, - { - accessorKey: "amount", - header: () =>
Amount
, - cell: ({ row }) => { - const amount = parseFloat(row.getValue("amount")) - - // Format the amount as a dollar amount - const formatted = new Intl.NumberFormat("en-US", { - style: "currency", - currency: "USD", - }).format(amount) - - return
{formatted}
- }, - }, - { - id: "actions", - enableHiding: false, - cell: ({ row }) => { - const payment = row.original - - return ( - - - - - - Actions - navigator.clipboard.writeText(payment.id)} - > - Copy payment ID - - - View customer - View payment details - - - ) - }, - }, -] - -export default function DataTableDemo() { - const [sorting, setSorting] = React.useState([]) - const [columnFilters, setColumnFilters] = React.useState( - [] - ) - const [columnVisibility, setColumnVisibility] = - React.useState({}) - const [rowSelection, setRowSelection] = React.useState({}) - - const table = useReactTable({ - data, - columns, - onSortingChange: setSorting, - onColumnFiltersChange: setColumnFilters, - getCoreRowModel: getCoreRowModel(), - getPaginationRowModel: getPaginationRowModel(), - getSortedRowModel: getSortedRowModel(), - getFilteredRowModel: getFilteredRowModel(), - onColumnVisibilityChange: setColumnVisibility, - onRowSelectionChange: setRowSelection, - state: { - sorting, - columnFilters, - columnVisibility, - rowSelection, - }, - }) - - return ( -
-
- - table.getColumn("email")?.setFilterValue(event.target.value) - } - className="max-w-sm" - /> - - - - - - {table - .getAllColumns() - .filter((column) => column.getCanHide()) - .map((column) => { - return ( - - column.toggleVisibility(!!value) - } - > - {column.id} - - ) - })} - - -
-
- - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => { - return ( - - {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext() - )} - - ) - })} - - ))} - - - {table.getRowModel().rows?.length ? ( - table.getRowModel().rows.map((row) => ( - - {row.getVisibleCells().map((cell) => ( - - {flexRender( - cell.column.columnDef.cell, - cell.getContext() - )} - - ))} - - )) - ) : ( - - - No results. - - - )} - -
-
-
-
- {table.getFilteredSelectedRowModel().rows.length} of{" "} - {table.getFilteredRowModel().rows.length} row(s) selected. -
-
- - -
-
-
- ) -} diff --git a/apps/www/__registry__/default/example/date-picker-demo.tsx b/apps/www/__registry__/default/example/date-picker-demo.tsx deleted file mode 100644 index d34cbe67763..00000000000 --- a/apps/www/__registry__/default/example/date-picker-demo.tsx +++ /dev/null @@ -1,43 +0,0 @@ -"use client" - -import * as React from "react" -import { format } from "date-fns" -import { Calendar as CalendarIcon } from "lucide-react" - -import { cn } from "@/lib/utils" -import { Button } from "@/registry/default/ui/button" -import { Calendar } from "@/registry/default/ui/calendar" -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/registry/default/ui/popover" - -export default function DatePickerDemo() { - const [date, setDate] = React.useState() - - return ( - - - - - - - - - ) -} diff --git a/apps/www/__registry__/default/example/date-picker-form.tsx b/apps/www/__registry__/default/example/date-picker-form.tsx deleted file mode 100644 index c54442546ee..00000000000 --- a/apps/www/__registry__/default/example/date-picker-form.tsx +++ /dev/null @@ -1,101 +0,0 @@ -"use client" - -import { zodResolver } from "@hookform/resolvers/zod" -import { format } from "date-fns" -import { CalendarIcon } from "lucide-react" -import { useForm } from "react-hook-form" -import { z } from "zod" - -import { cn } from "@/lib/utils" -import { Button } from "@/registry/default/ui/button" -import { Calendar } from "@/registry/default/ui/calendar" -import { - Form, - FormControl, - FormDescription, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/registry/default/ui/form" -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/registry/default/ui/popover" -import { toast } from "@/registry/default/ui/use-toast" - -const FormSchema = z.object({ - dob: z.date({ - required_error: "A date of birth is required.", - }), -}) - -export default function DatePickerForm() { - const form = useForm>({ - resolver: zodResolver(FormSchema), - }) - - function onSubmit(data: z.infer) { - toast({ - title: "You submitted the following values:", - description: ( -
-          {JSON.stringify(data, null, 2)}
-        
- ), - }) - } - - return ( -
- - ( - - Date of birth - - - - - - - - - date > new Date() || date < new Date("1900-01-01") - } - initialFocus - /> - - - - Your date of birth is used to calculate your age. - - - - )} - /> - - - - ) -} diff --git a/apps/www/__registry__/default/example/date-picker-with-presets.tsx b/apps/www/__registry__/default/example/date-picker-with-presets.tsx deleted file mode 100644 index 1e5cd1605a2..00000000000 --- a/apps/www/__registry__/default/example/date-picker-with-presets.tsx +++ /dev/null @@ -1,62 +0,0 @@ -"use client" - -import * as React from "react" -import { addDays, format } from "date-fns" -import { Calendar as CalendarIcon } from "lucide-react" - -import { cn } from "@/lib/utils" -import { Button } from "@/registry/default/ui/button" -import { Calendar } from "@/registry/default/ui/calendar" -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/registry/default/ui/popover" -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/registry/default/ui/select" - -export default function DatePickerWithPresets() { - const [date, setDate] = React.useState() - - return ( - - - - - - -
- -
-
-
- ) -} diff --git a/apps/www/__registry__/default/example/date-picker-with-range.tsx b/apps/www/__registry__/default/example/date-picker-with-range.tsx deleted file mode 100644 index 4d88bcf0834..00000000000 --- a/apps/www/__registry__/default/example/date-picker-with-range.tsx +++ /dev/null @@ -1,65 +0,0 @@ -"use client" - -import * as React from "react" -import { addDays, format } from "date-fns" -import { Calendar as CalendarIcon } from "lucide-react" -import { DateRange } from "react-day-picker" - -import { cn } from "@/lib/utils" -import { Button } from "@/registry/default/ui/button" -import { Calendar } from "@/registry/default/ui/calendar" -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/registry/default/ui/popover" - -export default function DatePickerWithRange({ - className, -}: React.HTMLAttributes) { - const [date, setDate] = React.useState({ - from: new Date(2022, 0, 20), - to: addDays(new Date(2022, 0, 20), 20), - }) - - return ( -
- - - - - - - - -
- ) -} diff --git a/apps/www/__registry__/default/example/dialog-close-button.tsx b/apps/www/__registry__/default/example/dialog-close-button.tsx deleted file mode 100644 index 826d0661328..00000000000 --- a/apps/www/__registry__/default/example/dialog-close-button.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { Copy } from "lucide-react" - -import { Button } from "@/registry/default/ui/button" -import { - Dialog, - DialogClose, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "@/registry/default/ui/dialog" -import { Input } from "@/registry/default/ui/input" -import { Label } from "@/registry/default/ui/label" - -export default function DialogCloseButton() { - return ( - - - - - - - Share link - - Anyone who has this link will be able to view this. - - -
-
- - -
- -
- - - - - -
-
- ) -} diff --git a/apps/www/__registry__/default/example/dialog-demo.tsx b/apps/www/__registry__/default/example/dialog-demo.tsx deleted file mode 100644 index 31bde7637f3..00000000000 --- a/apps/www/__registry__/default/example/dialog-demo.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import { Button } from "@/registry/default/ui/button" -import { - Dialog, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "@/registry/default/ui/dialog" -import { Input } from "@/registry/default/ui/input" -import { Label } from "@/registry/default/ui/label" - -export default function DialogDemo() { - return ( - - - - - - - Edit profile - - Make changes to your profile here. Click save when you're done. - - -
-
- - -
-
- - -
-
- - - -
-
- ) -} diff --git a/apps/www/__registry__/default/example/drawer-demo.tsx b/apps/www/__registry__/default/example/drawer-demo.tsx deleted file mode 100644 index 2c2038474f2..00000000000 --- a/apps/www/__registry__/default/example/drawer-demo.tsx +++ /dev/null @@ -1,134 +0,0 @@ -import * as React from "react" -import { Minus, Plus } from "lucide-react" -import { Bar, BarChart, ResponsiveContainer } from "recharts" - -import { Button } from "@/registry/default/ui/button" -import { - Drawer, - DrawerClose, - DrawerContent, - DrawerDescription, - DrawerFooter, - DrawerHeader, - DrawerTitle, - DrawerTrigger, -} from "@/registry/default/ui/drawer" - -const data = [ - { - goal: 400, - }, - { - goal: 300, - }, - { - goal: 200, - }, - { - goal: 300, - }, - { - goal: 200, - }, - { - goal: 278, - }, - { - goal: 189, - }, - { - goal: 239, - }, - { - goal: 300, - }, - { - goal: 200, - }, - { - goal: 278, - }, - { - goal: 189, - }, - { - goal: 349, - }, -] - -export default function DrawerDemo() { - const [goal, setGoal] = React.useState(350) - - function onClick(adjustment: number) { - setGoal(Math.max(200, Math.min(400, goal + adjustment))) - } - - return ( - - - - - -
- - Move Goal - Set your daily activity goal. - -
-
- -
-
- {goal} -
-
- Calories/day -
-
- -
-
- - - - - -
-
- - - - - - -
-
-
- ) -} diff --git a/apps/www/__registry__/default/example/drawer-dialog.tsx b/apps/www/__registry__/default/example/drawer-dialog.tsx deleted file mode 100644 index 75a6e3186e9..00000000000 --- a/apps/www/__registry__/default/example/drawer-dialog.tsx +++ /dev/null @@ -1,87 +0,0 @@ -import * as React from "react" - -import { cn } from "@/lib/utils" -import { useMediaQuery } from "@/hooks/use-media-query" -import { Button } from "@/registry/default/ui/button" -import { - Dialog, - DialogContent, - DialogDescription, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "@/registry/default/ui/dialog" -import { - Drawer, - DrawerClose, - DrawerContent, - DrawerDescription, - DrawerFooter, - DrawerHeader, - DrawerTitle, - DrawerTrigger, -} from "@/registry/default/ui/drawer" -import { Input } from "@/registry/default/ui/input" -import { Label } from "@/registry/default/ui/label" - -export default function DrawerDialogDemo() { - const [open, setOpen] = React.useState(false) - const isDesktop = useMediaQuery("(min-width: 768px)") - - if (isDesktop) { - return ( - - - - - - - Edit profile - - Make changes to your profile here. Click save when you're done. - - - - - - ) - } - - return ( - - - - - - - Edit profile - - Make changes to your profile here. Click save when you're done. - - - - - - - - - - - ) -} - -function ProfileForm({ className }: React.ComponentProps<"form">) { - return ( -
-
- - -
-
- - -
- -
- ) -} diff --git a/apps/www/__registry__/default/example/dropdown-menu-checkboxes.tsx b/apps/www/__registry__/default/example/dropdown-menu-checkboxes.tsx deleted file mode 100644 index efc43534354..00000000000 --- a/apps/www/__registry__/default/example/dropdown-menu-checkboxes.tsx +++ /dev/null @@ -1,53 +0,0 @@ -"use client" - -import * as React from "react" -import { DropdownMenuCheckboxItemProps } from "@radix-ui/react-dropdown-menu" - -import { Button } from "@/registry/default/ui/button" -import { - DropdownMenu, - DropdownMenuCheckboxItem, - DropdownMenuContent, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuTrigger, -} from "@/registry/default/ui/dropdown-menu" - -type Checked = DropdownMenuCheckboxItemProps["checked"] - -export default function DropdownMenuCheckboxes() { - const [showStatusBar, setShowStatusBar] = React.useState(true) - const [showActivityBar, setShowActivityBar] = React.useState(false) - const [showPanel, setShowPanel] = React.useState(false) - - return ( - - - - - - Appearance - - - Status Bar - - - Activity Bar - - - Panel - - - - ) -} diff --git a/apps/www/__registry__/default/example/dropdown-menu-demo.tsx b/apps/www/__registry__/default/example/dropdown-menu-demo.tsx deleted file mode 100644 index 79b0895942a..00000000000 --- a/apps/www/__registry__/default/example/dropdown-menu-demo.tsx +++ /dev/null @@ -1,122 +0,0 @@ -import { - Cloud, - CreditCard, - Github, - Keyboard, - LifeBuoy, - LogOut, - Mail, - MessageSquare, - Plus, - PlusCircle, - Settings, - User, - UserPlus, - Users, -} from "lucide-react" - -import { Button } from "@/registry/default/ui/button" -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuGroup, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuPortal, - DropdownMenuSeparator, - DropdownMenuShortcut, - DropdownMenuSub, - DropdownMenuSubContent, - DropdownMenuSubTrigger, - DropdownMenuTrigger, -} from "@/registry/default/ui/dropdown-menu" - -export default function DropdownMenuDemo() { - return ( - - - - - - My Account - - - - - Profile - ⇧⌘P - - - - Billing - ⌘B - - - - Settings - ⌘S - - - - Keyboard shortcuts - ⌘K - - - - - - - Team - - - - - Invite users - - - - - - Email - - - - Message - - - - - More... - - - - - - - New Team - ⌘+T - - - - - - GitHub - - - - Support - - - - API - - - - - Log out - ⇧⌘Q - - - - ) -} diff --git a/apps/www/__registry__/default/example/dropdown-menu-radio-group.tsx b/apps/www/__registry__/default/example/dropdown-menu-radio-group.tsx deleted file mode 100644 index 2c06e7b131d..00000000000 --- a/apps/www/__registry__/default/example/dropdown-menu-radio-group.tsx +++ /dev/null @@ -1,35 +0,0 @@ -"use client" - -import * as React from "react" - -import { Button } from "@/registry/default/ui/button" -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuLabel, - DropdownMenuRadioGroup, - DropdownMenuRadioItem, - DropdownMenuSeparator, - DropdownMenuTrigger, -} from "@/registry/default/ui/dropdown-menu" - -export default function DropdownMenuRadioGroupDemo() { - const [position, setPosition] = React.useState("bottom") - - return ( - - - - - - Panel Position - - - Top - Bottom - Right - - - - ) -} diff --git a/apps/www/__registry__/default/example/hover-card-demo.tsx b/apps/www/__registry__/default/example/hover-card-demo.tsx deleted file mode 100644 index 03acab7bf23..00000000000 --- a/apps/www/__registry__/default/example/hover-card-demo.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { CalendarDays } from "lucide-react" - -import { - Avatar, - AvatarFallback, - AvatarImage, -} from "@/registry/default/ui/avatar" -import { Button } from "@/registry/default/ui/button" -import { - HoverCard, - HoverCardContent, - HoverCardTrigger, -} from "@/registry/default/ui/hover-card" - -export default function HoverCardDemo() { - return ( - - - - - -
- - - VC - -
-

@nextjs

-

- The React Framework – created and maintained by @vercel. -

-
- {" "} - - Joined December 2021 - -
-
-
-
-
- ) -} diff --git a/apps/www/__registry__/default/example/input-demo.tsx b/apps/www/__registry__/default/example/input-demo.tsx deleted file mode 100644 index 126407be9c2..00000000000 --- a/apps/www/__registry__/default/example/input-demo.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { Input } from "@/registry/default/ui/input" - -export default function InputDemo() { - return -} diff --git a/apps/www/__registry__/default/example/input-disabled.tsx b/apps/www/__registry__/default/example/input-disabled.tsx deleted file mode 100644 index 602f02c6100..00000000000 --- a/apps/www/__registry__/default/example/input-disabled.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { Input } from "@/registry/default/ui/input" - -export default function InputDisabled() { - return -} diff --git a/apps/www/__registry__/default/example/input-file.tsx b/apps/www/__registry__/default/example/input-file.tsx deleted file mode 100644 index b07b4013749..00000000000 --- a/apps/www/__registry__/default/example/input-file.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Input } from "@/registry/default/ui/input" -import { Label } from "@/registry/default/ui/label" - -export default function InputFile() { - return ( -
- - -
- ) -} diff --git a/apps/www/__registry__/default/example/input-form.tsx b/apps/www/__registry__/default/example/input-form.tsx deleted file mode 100644 index da69bbfb996..00000000000 --- a/apps/www/__registry__/default/example/input-form.tsx +++ /dev/null @@ -1,68 +0,0 @@ -"use client" - -import { zodResolver } from "@hookform/resolvers/zod" -import { useForm } from "react-hook-form" -import { z } from "zod" - -import { Button } from "@/registry/default/ui/button" -import { - Form, - FormControl, - FormDescription, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/registry/default/ui/form" -import { Input } from "@/registry/default/ui/input" -import { toast } from "@/registry/default/ui/use-toast" - -const FormSchema = z.object({ - username: z.string().min(2, { - message: "Username must be at least 2 characters.", - }), -}) - -export default function InputForm() { - const form = useForm>({ - resolver: zodResolver(FormSchema), - defaultValues: { - username: "", - }, - }) - - function onSubmit(data: z.infer) { - toast({ - title: "You submitted the following values:", - description: ( -
-          {JSON.stringify(data, null, 2)}
-        
- ), - }) - } - - return ( -
- - ( - - Username - - - - - This is your public display name. - - - - )} - /> - - - - ) -} diff --git a/apps/www/__registry__/default/example/input-otp-controlled.tsx b/apps/www/__registry__/default/example/input-otp-controlled.tsx deleted file mode 100644 index c5f95cfbfca..00000000000 --- a/apps/www/__registry__/default/example/input-otp-controlled.tsx +++ /dev/null @@ -1,39 +0,0 @@ -"use client" - -import * as React from "react" - -import { - InputOTP, - InputOTPGroup, - InputOTPSlot, -} from "@/registry/default/ui/input-otp" - -export default function InputOTPControlled() { - const [value, setValue] = React.useState("") - - return ( -
- setValue(value)} - > - - - - - - - - - -
- {value === "" ? ( - <>Enter your one-time password. - ) : ( - <>You entered: {value} - )} -
-
- ) -} diff --git a/apps/www/__registry__/default/example/input-otp-demo.tsx b/apps/www/__registry__/default/example/input-otp-demo.tsx deleted file mode 100644 index ec19b7db0fa..00000000000 --- a/apps/www/__registry__/default/example/input-otp-demo.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { - InputOTP, - InputOTPGroup, - InputOTPSeparator, - InputOTPSlot, -} from "@/registry/default/ui/input-otp" - -export default function InputOTPDemo() { - return ( - - - - - - - - - - - - - - ) -} diff --git a/apps/www/__registry__/default/example/input-otp-form.tsx b/apps/www/__registry__/default/example/input-otp-form.tsx deleted file mode 100644 index cc6922f52df..00000000000 --- a/apps/www/__registry__/default/example/input-otp-form.tsx +++ /dev/null @@ -1,82 +0,0 @@ -"use client" - -import { zodResolver } from "@hookform/resolvers/zod" -import { useForm } from "react-hook-form" -import { z } from "zod" - -import { Button } from "@/registry/default/ui/button" -import { - Form, - FormControl, - FormDescription, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/registry/default/ui/form" -import { - InputOTP, - InputOTPGroup, - InputOTPSlot, -} from "@/registry/default/ui/input-otp" -import { toast } from "@/registry/default/ui/use-toast" - -const FormSchema = z.object({ - pin: z.string().min(6, { - message: "Your one-time password must be 6 characters.", - }), -}) - -export default function InputOTPForm() { - const form = useForm>({ - resolver: zodResolver(FormSchema), - defaultValues: { - pin: "", - }, - }) - - function onSubmit(data: z.infer) { - toast({ - title: "You submitted the following values:", - description: ( -
-          {JSON.stringify(data, null, 2)}
-        
- ), - }) - } - - return ( -
- - ( - - One-Time Password - - - - - - - - - - - - - - Please enter the one-time password sent to your phone. - - - - )} - /> - - - - - ) -} diff --git a/apps/www/__registry__/default/example/input-otp-pattern.tsx b/apps/www/__registry__/default/example/input-otp-pattern.tsx deleted file mode 100644 index 87d711b0ecd..00000000000 --- a/apps/www/__registry__/default/example/input-otp-pattern.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp" - -import { - InputOTP, - InputOTPGroup, - InputOTPSlot, -} from "@/registry/default/ui/input-otp" - -export default function InputOTPPattern() { - return ( - - - - - - - - - - - ) -} diff --git a/apps/www/__registry__/default/example/input-otp-separator.tsx b/apps/www/__registry__/default/example/input-otp-separator.tsx deleted file mode 100644 index e6e5a2a6fa2..00000000000 --- a/apps/www/__registry__/default/example/input-otp-separator.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import React from "react" - -import { - InputOTP, - InputOTPGroup, - InputOTPSeparator, - InputOTPSlot, -} from "@/registry/default/ui/input-otp" - -export default function InputOTPWithSeparator() { - return ( - - - - - - - - - - - - - - - - - ) -} diff --git a/apps/www/__registry__/default/example/input-with-button.tsx b/apps/www/__registry__/default/example/input-with-button.tsx deleted file mode 100644 index 2bfe0429343..00000000000 --- a/apps/www/__registry__/default/example/input-with-button.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Button } from "@/registry/default/ui/button" -import { Input } from "@/registry/default/ui/input" - -export default function InputWithButton() { - return ( -
- - -
- ) -} diff --git a/apps/www/__registry__/default/example/input-with-label.tsx b/apps/www/__registry__/default/example/input-with-label.tsx deleted file mode 100644 index d4b92d23aa7..00000000000 --- a/apps/www/__registry__/default/example/input-with-label.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Input } from "@/registry/default/ui/input" -import { Label } from "@/registry/default/ui/label" - -export default function InputWithLabel() { - return ( -
- - -
- ) -} diff --git a/apps/www/__registry__/default/example/input-with-text.tsx b/apps/www/__registry__/default/example/input-with-text.tsx deleted file mode 100644 index 43f9a1e8cdc..00000000000 --- a/apps/www/__registry__/default/example/input-with-text.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { Input } from "@/registry/default/ui/input" -import { Label } from "@/registry/default/ui/label" - -export default function InputWithText() { - return ( -
- - -

Enter your email address.

-
- ) -} diff --git a/apps/www/__registry__/default/example/label-demo.tsx b/apps/www/__registry__/default/example/label-demo.tsx deleted file mode 100644 index 5fdfd063eb9..00000000000 --- a/apps/www/__registry__/default/example/label-demo.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { Checkbox } from "@/registry/default/ui/checkbox" -import { Label } from "@/registry/default/ui/label" - -export default function LabelDemo() { - return ( -
-
- - -
-
- ) -} diff --git a/apps/www/__registry__/default/example/menubar-demo.tsx b/apps/www/__registry__/default/example/menubar-demo.tsx deleted file mode 100644 index adf5c73903a..00000000000 --- a/apps/www/__registry__/default/example/menubar-demo.tsx +++ /dev/null @@ -1,107 +0,0 @@ -import { - Menubar, - MenubarCheckboxItem, - MenubarContent, - MenubarItem, - MenubarMenu, - MenubarRadioGroup, - MenubarRadioItem, - MenubarSeparator, - MenubarShortcut, - MenubarSub, - MenubarSubContent, - MenubarSubTrigger, - MenubarTrigger, -} from "@/registry/default/ui/menubar" - -export default function MenubarDemo() { - return ( - - - File - - - New Tab ⌘T - - - New Window ⌘N - - New Incognito Window - - - Share - - Email link - Messages - Notes - - - - - Print... ⌘P - - - - - Edit - - - Undo ⌘Z - - - Redo ⇧⌘Z - - - - Find - - Search the web - - Find... - Find Next - Find Previous - - - - Cut - Copy - Paste - - - - View - - Always Show Bookmarks Bar - - Always Show Full URLs - - - - Reload ⌘R - - - Force Reload ⇧⌘R - - - Toggle Fullscreen - - Hide Sidebar - - - - Profiles - - - Andy - Benoit - Luis - - - Edit... - - Add Profile... - - - - ) -} diff --git a/apps/www/__registry__/default/example/mode-toggle.tsx b/apps/www/__registry__/default/example/mode-toggle.tsx deleted file mode 100644 index c6f338d16e5..00000000000 --- a/apps/www/__registry__/default/example/mode-toggle.tsx +++ /dev/null @@ -1,40 +0,0 @@ -"use client" - -import * as React from "react" -import { Moon, Sun } from "lucide-react" -import { useTheme } from "next-themes" - -import { Button } from "@/registry/default/ui/button" -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, -} from "@/registry/default/ui/dropdown-menu" - -export default function ModeToggle() { - const { setTheme } = useTheme() - - return ( - - - - - - setTheme("light")}> - Light - - setTheme("dark")}> - Dark - - setTheme("system")}> - System - - - - ) -} diff --git a/apps/www/__registry__/default/example/navigation-menu-demo.tsx b/apps/www/__registry__/default/example/navigation-menu-demo.tsx deleted file mode 100644 index 4fea056f361..00000000000 --- a/apps/www/__registry__/default/example/navigation-menu-demo.tsx +++ /dev/null @@ -1,146 +0,0 @@ -"use client" - -import * as React from "react" -import Link from "next/link" - -import { cn } from "@/lib/utils" -import { Icons } from "@/components/icons" -import { - NavigationMenu, - NavigationMenuContent, - NavigationMenuItem, - NavigationMenuLink, - NavigationMenuList, - NavigationMenuTrigger, - navigationMenuTriggerStyle, -} from "@/registry/default/ui/navigation-menu" - -const components: { title: string; href: string; description: string }[] = [ - { - title: "Alert Dialog", - href: "/docs/primitives/alert-dialog", - description: - "A modal dialog that interrupts the user with important content and expects a response.", - }, - { - title: "Hover Card", - href: "/docs/primitives/hover-card", - description: - "For sighted users to preview content available behind a link.", - }, - { - title: "Progress", - href: "/docs/primitives/progress", - description: - "Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.", - }, - { - title: "Scroll-area", - href: "/docs/primitives/scroll-area", - description: "Visually or semantically separates content.", - }, - { - title: "Tabs", - href: "/docs/primitives/tabs", - description: - "A set of layered sections of content—known as tab panels—that are displayed one at a time.", - }, - { - title: "Tooltip", - href: "/docs/primitives/tooltip", - description: - "A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.", - }, -] - -export default function NavigationMenuDemo() { - return ( - - - - Getting started - - - - - - Components - -
    - {components.map((component) => ( - - {component.description} - - ))} -
-
-
- - - - Documentation - - - -
-
- ) -} - -const ListItem = React.forwardRef< - React.ElementRef<"a">, - React.ComponentPropsWithoutRef<"a"> ->(({ className, title, children, ...props }, ref) => { - return ( -
  • - - -
    {title}
    -

    - {children} -

    -
    -
    -
  • - ) -}) -ListItem.displayName = "ListItem" diff --git a/apps/www/__registry__/default/example/pagination-demo.tsx b/apps/www/__registry__/default/example/pagination-demo.tsx deleted file mode 100644 index 739c8181da0..00000000000 --- a/apps/www/__registry__/default/example/pagination-demo.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { - Pagination, - PaginationContent, - PaginationEllipsis, - PaginationItem, - PaginationLink, - PaginationNext, - PaginationPrevious, -} from "@/registry/default/ui/pagination" - -export default function PaginationDemo() { - return ( - - - - - - - 1 - - - - 2 - - - - 3 - - - - - - - - - - ) -} diff --git a/apps/www/__registry__/default/example/popover-demo.tsx b/apps/www/__registry__/default/example/popover-demo.tsx deleted file mode 100644 index a4fc06d7f73..00000000000 --- a/apps/www/__registry__/default/example/popover-demo.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import { Button } from "@/registry/default/ui/button" -import { Input } from "@/registry/default/ui/input" -import { Label } from "@/registry/default/ui/label" -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/registry/default/ui/popover" - -export default function PopoverDemo() { - return ( - - - - - -
    -
    -

    Dimensions

    -

    - Set the dimensions for the layer. -

    -
    -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    -
    -
    -
    - ) -} diff --git a/apps/www/__registry__/default/example/progress-demo.tsx b/apps/www/__registry__/default/example/progress-demo.tsx deleted file mode 100644 index 997e2d5fb87..00000000000 --- a/apps/www/__registry__/default/example/progress-demo.tsx +++ /dev/null @@ -1,16 +0,0 @@ -"use client" - -import * as React from "react" - -import { Progress } from "@/registry/default/ui/progress" - -export default function ProgressDemo() { - const [progress, setProgress] = React.useState(13) - - React.useEffect(() => { - const timer = setTimeout(() => setProgress(66), 500) - return () => clearTimeout(timer) - }, []) - - return -} diff --git a/apps/www/__registry__/default/example/radio-group-demo.tsx b/apps/www/__registry__/default/example/radio-group-demo.tsx deleted file mode 100644 index 8b0d24650ec..00000000000 --- a/apps/www/__registry__/default/example/radio-group-demo.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { Label } from "@/registry/default/ui/label" -import { RadioGroup, RadioGroupItem } from "@/registry/default/ui/radio-group" - -export default function RadioGroupDemo() { - return ( - -
    - - -
    -
    - - -
    -
    - - -
    -
    - ) -} diff --git a/apps/www/__registry__/default/example/radio-group-form.tsx b/apps/www/__registry__/default/example/radio-group-form.tsx deleted file mode 100644 index 5d35613e643..00000000000 --- a/apps/www/__registry__/default/example/radio-group-form.tsx +++ /dev/null @@ -1,88 +0,0 @@ -"use client" - -import { zodResolver } from "@hookform/resolvers/zod" -import { useForm } from "react-hook-form" -import { z } from "zod" - -import { Button } from "@/registry/default/ui/button" -import { - Form, - FormControl, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/registry/default/ui/form" -import { RadioGroup, RadioGroupItem } from "@/registry/default/ui/radio-group" -import { toast } from "@/registry/default/ui/use-toast" - -const FormSchema = z.object({ - type: z.enum(["all", "mentions", "none"], { - required_error: "You need to select a notification type.", - }), -}) - -export default function RadioGroupForm() { - const form = useForm>({ - resolver: zodResolver(FormSchema), - }) - - function onSubmit(data: z.infer) { - toast({ - title: "You submitted the following values:", - description: ( -
    -          {JSON.stringify(data, null, 2)}
    -        
    - ), - }) - } - - return ( -
    - - ( - - Notify me about... - - - - - - - - All new messages - - - - - - - - Direct messages and mentions - - - - - - - Nothing - - - - - - )} - /> - - - - ) -} diff --git a/apps/www/__registry__/default/example/resizable-demo-with-handle.tsx b/apps/www/__registry__/default/example/resizable-demo-with-handle.tsx deleted file mode 100644 index af9c5973d3f..00000000000 --- a/apps/www/__registry__/default/example/resizable-demo-with-handle.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { - ResizableHandle, - ResizablePanel, - ResizablePanelGroup, -} from "@/registry/default/ui/resizable" - -export default function ResizableDemo() { - return ( - - -
    - One -
    -
    - - - - -
    - Two -
    -
    - - -
    - Three -
    -
    -
    -
    -
    - ) -} diff --git a/apps/www/__registry__/default/example/resizable-demo.tsx b/apps/www/__registry__/default/example/resizable-demo.tsx deleted file mode 100644 index 8429c3d4d86..00000000000 --- a/apps/www/__registry__/default/example/resizable-demo.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { - ResizableHandle, - ResizablePanel, - ResizablePanelGroup, -} from "@/registry/default/ui/resizable" - -export default function ResizableDemo() { - return ( - - -
    - One -
    -
    - - - - -
    - Two -
    -
    - - -
    - Three -
    -
    -
    -
    -
    - ) -} diff --git a/apps/www/__registry__/default/example/resizable-handle.tsx b/apps/www/__registry__/default/example/resizable-handle.tsx deleted file mode 100644 index eeba94f6c53..00000000000 --- a/apps/www/__registry__/default/example/resizable-handle.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { - ResizableHandle, - ResizablePanel, - ResizablePanelGroup, -} from "@/registry/default/ui/resizable" - -export default function ResizableDemo() { - return ( - - -
    - Sidebar -
    -
    - - -
    - Content -
    -
    -
    - ) -} diff --git a/apps/www/__registry__/default/example/resizable-vertical.tsx b/apps/www/__registry__/default/example/resizable-vertical.tsx deleted file mode 100644 index 2e9e4c44300..00000000000 --- a/apps/www/__registry__/default/example/resizable-vertical.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { - ResizableHandle, - ResizablePanel, - ResizablePanelGroup, -} from "@/registry/default/ui/resizable" - -export default function ResizableDemo() { - return ( - - -
    - Header -
    -
    - - -
    - Content -
    -
    -
    - ) -} diff --git a/apps/www/__registry__/default/example/scroll-area-demo.tsx b/apps/www/__registry__/default/example/scroll-area-demo.tsx deleted file mode 100644 index fff8dc58632..00000000000 --- a/apps/www/__registry__/default/example/scroll-area-demo.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import * as React from "react" - -import { ScrollArea } from "@/registry/default/ui/scroll-area" -import { Separator } from "@/registry/default/ui/separator" - -const tags = Array.from({ length: 50 }).map( - (_, i, a) => `v1.2.0-beta.${a.length - i}` -) - -export default function ScrollAreaDemo() { - return ( - -
    -

    Tags

    - {tags.map((tag) => ( - <> -
    - {tag} -
    - - - ))} -
    -
    - ) -} diff --git a/apps/www/__registry__/default/example/scroll-area-horizontal-demo.tsx b/apps/www/__registry__/default/example/scroll-area-horizontal-demo.tsx deleted file mode 100644 index fad6de53485..00000000000 --- a/apps/www/__registry__/default/example/scroll-area-horizontal-demo.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import * as React from "react" -import Image from "next/image" - -import { ScrollArea, ScrollBar } from "@/registry/default/ui/scroll-area" - -export interface Artwork { - artist: string - art: string -} - -export const works: Artwork[] = [ - { - artist: "Ornella Binni", - art: "https://images.unsplash.com/photo-1465869185982-5a1a7522cbcb?auto=format&fit=crop&w=300&q=80", - }, - { - artist: "Tom Byrom", - art: "https://images.unsplash.com/photo-1548516173-3cabfa4607e9?auto=format&fit=crop&w=300&q=80", - }, - { - artist: "Vladimir Malyavko", - art: "https://images.unsplash.com/photo-1494337480532-3725c85fd2ab?auto=format&fit=crop&w=300&q=80", - }, -] - -export default function ScrollAreaHorizontalDemo() { - return ( - -
    - {works.map((artwork) => ( -
    -
    - {`Photo -
    -
    - Photo by{" "} - - {artwork.artist} - -
    -
    - ))} -
    - -
    - ) -} diff --git a/apps/www/__registry__/default/example/select-demo.tsx b/apps/www/__registry__/default/example/select-demo.tsx deleted file mode 100644 index 6430740fb18..00000000000 --- a/apps/www/__registry__/default/example/select-demo.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import * as React from "react" - -import { - Select, - SelectContent, - SelectGroup, - SelectItem, - SelectLabel, - SelectTrigger, - SelectValue, -} from "@/registry/default/ui/select" - -export default function SelectDemo() { - return ( - - ) -} diff --git a/apps/www/__registry__/default/example/select-form.tsx b/apps/www/__registry__/default/example/select-form.tsx deleted file mode 100644 index ee66c876a73..00000000000 --- a/apps/www/__registry__/default/example/select-form.tsx +++ /dev/null @@ -1,84 +0,0 @@ -"use client" - -import Link from "next/link" -import { zodResolver } from "@hookform/resolvers/zod" -import { useForm } from "react-hook-form" -import { z } from "zod" - -import { Button } from "@/registry/default/ui/button" -import { - Form, - FormControl, - FormDescription, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/registry/default/ui/form" -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/registry/default/ui/select" -import { toast } from "@/registry/default/ui/use-toast" - -const FormSchema = z.object({ - email: z - .string({ - required_error: "Please select an email to display.", - }) - .email(), -}) - -export default function SelectForm() { - const form = useForm>({ - resolver: zodResolver(FormSchema), - }) - - function onSubmit(data: z.infer) { - toast({ - title: "You submitted the following values:", - description: ( -
    -          {JSON.stringify(data, null, 2)}
    -        
    - ), - }) - } - - return ( -
    - - ( - - Email - - - You can manage email addresses in your{" "} - email settings. - - - - )} - /> - - - - ) -} diff --git a/apps/www/__registry__/default/example/select-scrollable.tsx b/apps/www/__registry__/default/example/select-scrollable.tsx deleted file mode 100644 index 44ed74c15f5..00000000000 --- a/apps/www/__registry__/default/example/select-scrollable.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import * as React from "react" - -import { - Select, - SelectContent, - SelectGroup, - SelectItem, - SelectLabel, - SelectTrigger, - SelectValue, -} from "@/registry/default/ui/select" - -export default function SelectScrollable() { - return ( - - ) -} diff --git a/apps/www/__registry__/default/example/separator-demo.tsx b/apps/www/__registry__/default/example/separator-demo.tsx deleted file mode 100644 index 8d7f86f7016..00000000000 --- a/apps/www/__registry__/default/example/separator-demo.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { Separator } from "@/registry/default/ui/separator" - -export default function SeparatorDemo() { - return ( -
    -
    -

    Radix Primitives

    -

    - An open-source UI component library. -

    -
    - -
    -
    Blog
    - -
    Docs
    - -
    Source
    -
    -
    - ) -} diff --git a/apps/www/__registry__/default/example/sheet-demo.tsx b/apps/www/__registry__/default/example/sheet-demo.tsx deleted file mode 100644 index 75943eed771..00000000000 --- a/apps/www/__registry__/default/example/sheet-demo.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { Button } from "@/registry/default/ui/button" -import { Input } from "@/registry/default/ui/input" -import { Label } from "@/registry/default/ui/label" -import { - Sheet, - SheetClose, - SheetContent, - SheetDescription, - SheetFooter, - SheetHeader, - SheetTitle, - SheetTrigger, -} from "@/registry/default/ui/sheet" - -export default function SheetDemo() { - return ( - - - - - - - Edit profile - - Make changes to your profile here. Click save when you're done. - - -
    -
    - - -
    -
    - - -
    -
    - - - - - -
    -
    - ) -} diff --git a/apps/www/__registry__/default/example/sheet-side.tsx b/apps/www/__registry__/default/example/sheet-side.tsx deleted file mode 100644 index b672e1a993f..00000000000 --- a/apps/www/__registry__/default/example/sheet-side.tsx +++ /dev/null @@ -1,60 +0,0 @@ -"use client" - -import { Button } from "@/registry/new-york/ui/button" -import { Input } from "@/registry/new-york/ui/input" -import { Label } from "@/registry/new-york/ui/label" -import { - Sheet, - SheetClose, - SheetContent, - SheetDescription, - SheetFooter, - SheetHeader, - SheetTitle, - SheetTrigger, -} from "@/registry/new-york/ui/sheet" - -const SHEET_SIDES = ["top", "right", "bottom", "left"] as const - -type SheetSide = (typeof SHEET_SIDES)[number] - -export default function SheetSide() { - return ( -
    - {SHEET_SIDES.map((side) => ( - - - - - - - Edit profile - - Make changes to your profile here. Click save when you're done. - - -
    -
    - - -
    -
    - - -
    -
    - - - - - -
    -
    - ))} -
    - ) -} diff --git a/apps/www/__registry__/default/example/skeleton-card.tsx b/apps/www/__registry__/default/example/skeleton-card.tsx deleted file mode 100644 index 6b43b850419..00000000000 --- a/apps/www/__registry__/default/example/skeleton-card.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { Skeleton } from "@/registry/default/ui/skeleton" - -export default function SkeletonCard() { - return ( -
    - -
    - - -
    -
    - ) -} diff --git a/apps/www/__registry__/default/example/skeleton-demo.tsx b/apps/www/__registry__/default/example/skeleton-demo.tsx deleted file mode 100644 index af83a48325f..00000000000 --- a/apps/www/__registry__/default/example/skeleton-demo.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { Skeleton } from "@/registry/default/ui/skeleton" - -export default function SkeletonDemo() { - return ( -
    - -
    - - -
    -
    - ) -} diff --git a/apps/www/__registry__/default/example/slider-demo.tsx b/apps/www/__registry__/default/example/slider-demo.tsx deleted file mode 100644 index af66d9e9e4c..00000000000 --- a/apps/www/__registry__/default/example/slider-demo.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { cn } from "@/lib/utils" -import { Slider } from "@/registry/default/ui/slider" - -type SliderProps = React.ComponentProps - -export default function SliderDemo({ className, ...props }: SliderProps) { - return ( - - ) -} diff --git a/apps/www/__registry__/default/example/sonner-demo.tsx b/apps/www/__registry__/default/example/sonner-demo.tsx deleted file mode 100644 index 1f61bdf185f..00000000000 --- a/apps/www/__registry__/default/example/sonner-demo.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { toast } from "sonner" - -import { Button } from "@/registry/default/ui/button" - -export default function SonnerDemo() { - return ( - - ) -} diff --git a/apps/www/__registry__/default/example/switch-demo.tsx b/apps/www/__registry__/default/example/switch-demo.tsx deleted file mode 100644 index 38034159b42..00000000000 --- a/apps/www/__registry__/default/example/switch-demo.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Label } from "@/registry/default/ui/label" -import { Switch } from "@/registry/default/ui/switch" - -export default function SwitchDemo() { - return ( -
    - - -
    - ) -} diff --git a/apps/www/__registry__/default/example/switch-form.tsx b/apps/www/__registry__/default/example/switch-form.tsx deleted file mode 100644 index 2e61fada8e5..00000000000 --- a/apps/www/__registry__/default/example/switch-form.tsx +++ /dev/null @@ -1,99 +0,0 @@ -"use client" - -import { zodResolver } from "@hookform/resolvers/zod" -import { useForm } from "react-hook-form" -import { z } from "zod" - -import { Button } from "@/registry/default/ui/button" -import { - Form, - FormControl, - FormDescription, - FormField, - FormItem, - FormLabel, -} from "@/registry/default/ui/form" -import { Switch } from "@/registry/default/ui/switch" -import { toast } from "@/registry/default/ui/use-toast" - -const FormSchema = z.object({ - marketing_emails: z.boolean().default(false).optional(), - security_emails: z.boolean(), -}) - -export default function SwitchForm() { - const form = useForm>({ - resolver: zodResolver(FormSchema), - defaultValues: { - security_emails: true, - }, - }) - - function onSubmit(data: z.infer) { - toast({ - title: "You submitted the following values:", - description: ( -
    -          {JSON.stringify(data, null, 2)}
    -        
    - ), - }) - } - - return ( -
    - -
    -

    Email Notifications

    -
    - ( - -
    - - Marketing emails - - - Receive emails about new products, features, and more. - -
    - - - -
    - )} - /> - ( - -
    - Security emails - - Receive emails about your account security. - -
    - - - -
    - )} - /> -
    -
    - -
    - - ) -} diff --git a/apps/www/__registry__/default/example/table-demo.tsx b/apps/www/__registry__/default/example/table-demo.tsx deleted file mode 100644 index 3b830de01d8..00000000000 --- a/apps/www/__registry__/default/example/table-demo.tsx +++ /dev/null @@ -1,87 +0,0 @@ -import { - Table, - TableBody, - TableCaption, - TableCell, - TableFooter, - TableHead, - TableHeader, - TableRow, -} from "@/registry/default/ui/table" - -const invoices = [ - { - invoice: "INV001", - paymentStatus: "Paid", - totalAmount: "$250.00", - paymentMethod: "Credit Card", - }, - { - invoice: "INV002", - paymentStatus: "Pending", - totalAmount: "$150.00", - paymentMethod: "PayPal", - }, - { - invoice: "INV003", - paymentStatus: "Unpaid", - totalAmount: "$350.00", - paymentMethod: "Bank Transfer", - }, - { - invoice: "INV004", - paymentStatus: "Paid", - totalAmount: "$450.00", - paymentMethod: "Credit Card", - }, - { - invoice: "INV005", - paymentStatus: "Paid", - totalAmount: "$550.00", - paymentMethod: "PayPal", - }, - { - invoice: "INV006", - paymentStatus: "Pending", - totalAmount: "$200.00", - paymentMethod: "Bank Transfer", - }, - { - invoice: "INV007", - paymentStatus: "Unpaid", - totalAmount: "$300.00", - paymentMethod: "Credit Card", - }, -] - -export default function TableDemo() { - return ( - - A list of your recent invoices. - - - Invoice - Status - Method - Amount - - - - {invoices.map((invoice) => ( - - {invoice.invoice} - {invoice.paymentStatus} - {invoice.paymentMethod} - {invoice.totalAmount} - - ))} - - - - Total - $2,500.00 - - -
    - ) -} diff --git a/apps/www/__registry__/default/example/tabs-demo.tsx b/apps/www/__registry__/default/example/tabs-demo.tsx deleted file mode 100644 index 15198fd7b7d..00000000000 --- a/apps/www/__registry__/default/example/tabs-demo.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import { Button } from "@/registry/default/ui/button" -import { - Card, - CardContent, - CardDescription, - CardFooter, - CardHeader, - CardTitle, -} from "@/registry/default/ui/card" -import { Input } from "@/registry/default/ui/input" -import { Label } from "@/registry/default/ui/label" -import { - Tabs, - TabsContent, - TabsList, - TabsTrigger, -} from "@/registry/default/ui/tabs" - -export default function TabsDemo() { - return ( - - - Account - Password - - - - - Account - - Make changes to your account here. Click save when you're done. - - - -
    - - -
    -
    - - -
    -
    - - - -
    -
    - - - - Password - - Change your password here. After saving, you'll be logged out. - - - -
    - - -
    -
    - - -
    -
    - - - -
    -
    -
    - ) -} diff --git a/apps/www/__registry__/default/example/textarea-demo.tsx b/apps/www/__registry__/default/example/textarea-demo.tsx deleted file mode 100644 index 946a7a4b936..00000000000 --- a/apps/www/__registry__/default/example/textarea-demo.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { Textarea } from "@/registry/default/ui/textarea" - -export default function TextareaDemo() { - return