feat: new CLI, Styles and more (#637)

This commit is contained in:
shadcn
2023-06-22 22:44:52 +04:00
committed by GitHub
parent 3d717f992b
commit eeb17545a1
658 changed files with 23389 additions and 4729 deletions

View File

@@ -0,0 +1,15 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"tailwind": {
"config": "tailwind.config.js",
"css": "app/globals.css",
"baseColor": "slate",
"cssVariables": true
},
"rsc": false,
"aliases": {
"utils": "@/lib/utils",
"components": "@/components"
}
}

View File

@@ -8,7 +8,7 @@ import { ThemeToggle } from "@/components/theme-toggle"
export function SiteHeader() {
return (
<header className="sticky top-0 z-40 w-full border-b bg-background">
<header className="bg-background sticky top-0 z-40 w-full border-b">
<div className="container flex h-16 items-center space-x-4 sm:justify-between sm:space-x-0">
<MainNav items={siteConfig.mainNav} />
<div className="flex flex-1 items-center justify-end space-x-4">
@@ -20,7 +20,7 @@ export function SiteHeader() {
>
<div
className={buttonVariants({
size: "sm",
size: "icon",
variant: "ghost",
})}
>
@@ -35,7 +35,7 @@ export function SiteHeader() {
>
<div
className={buttonVariants({
size: "sm",
size: "icon",
variant: "ghost",
})}
>

View File

@@ -2,7 +2,7 @@
import * as React from "react"
import { ThemeProvider as NextThemesProvider } from "next-themes"
import { ThemeProviderProps } from "next-themes/dist/types"
import { type ThemeProviderProps } from "next-themes/dist/types"
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>

View File

@@ -1,10 +1,10 @@
"use client"
import * as React from "react"
import { Moon, Sun } from "lucide-react"
import { useTheme } from "next-themes"
import { Button } from "@/components/ui/button"
import { Icons } from "@/components/icons"
export function ThemeToggle() {
const { setTheme, theme } = useTheme()
@@ -12,11 +12,11 @@ export function ThemeToggle() {
return (
<Button
variant="ghost"
size="sm"
size="icon"
onClick={() => setTheme(theme === "light" ? "dark" : "light")}
>
<Icons.sun className="rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<Icons.moon className="absolute rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<Sun className="h-[1.5rem] w-[1.3rem] dark:hidden" />
<Moon className="hidden h-5 w-5 dark:block" />
<span className="sr-only">Toggle theme</span>
</Button>
)

View File

@@ -23,6 +23,7 @@ const buttonVariants = cva(
default: "h-10 py-2 px-4",
sm: "h-9 px-3 rounded-md",
lg: "h-11 px-8 rounded-md",
icon: "h-10 w-10",
},
},
defaultVariants: {