Compare commits

...

16 Commits

Author SHA1 Message Date
github-actions[bot]
25a41cfe2a chore(release): version packages (#835)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-07-04 23:26:32 +04:00
shadcn
edc653c01e feat(shadcn-ui): add support for jsx (#834) 2023-07-04 23:22:20 +04:00
shadcn
f78a4aaa28 chore(www): site updates (#829)
* chore(www): update to latest Next.js

* feat(www): replace lucide icons
2023-07-04 17:04:22 +04:00
shadcn
b4dda36cc9 docs(www): add radix-ui deps install (#827) 2023-07-04 12:01:50 +04:00
Lennart
cbe0f1959c docs(www): improve Gatsby guide (#826) 2023-07-04 10:55:01 +04:00
Daniele Luisetto
dbd3b8f066 docs(www): add astro installation guide (#824) 2023-07-04 10:02:34 +04:00
Moinul Moin
7abb4019c3 docs(www): add installation guide for Gatsby (#822)
* docs: add installation guide for Gatsby

* docs: add  PR review changes
2023-07-03 22:23:52 +04:00
shadcn
b14081631f docs(www): fix link 2023-06-30 23:32:17 +04:00
github-actions[bot]
0857bfe889 chore(release): version packages (#737)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-30 22:56:01 +04:00
shadcn
ea6699adbf feat: restructure installation docs 2023-06-30 22:37:43 +04:00
Samuel Adebayo
1f004243d4 docs(www): add react with vite installation guide (#714)
* docs: add react with vite installation guide

* refactor(docs): move Ract with vite page into installation.mdx as tab

* fix(docs): remove classnames and wrapper divs

* fix(docs): update tsconfig file path to default @

* docs(www): fix code style

---------

Co-authored-by: Samuel Adebayo <samuel.adebayo@engagetech.com>
Co-authored-by: shadcn <m@shadcn.com>
2023-06-30 21:21:10 +04:00
Christoffer Hallas
eee7ce6879 docs(www): add remix and tabbed installation docs (#753)
* docs: add react with vite installation guide

* refactor(docs): move Ract with vite page into installation.mdx as tab

* fix(docs): remove classnames and wrapper divs

* fix(docs): update tsconfig file path to default @

* feat: added remix installation docs

* feat: added tabbed installation docs

* fix: remove log statement

* fix: cleaned up, restored usage notice, removed vite for now

* fix: moved installation.mdx into folder

---------

Co-authored-by: Samuel Adebayo <samuel.adebayo@engagetech.com>
Co-authored-by: shadcn <m@shadcn.com>
2023-06-29 17:27:03 +04:00
Mark Lyck
c3377530f4 feat(shadcn-cli): add support for bun install (#707)
* add support for bun install

* fix(cli): add changeset for bun install

---------

Co-authored-by: shadcn <m@shadcn.com>
2023-06-27 11:48:51 +04:00
Fady Makram
a8bb2ef737 fix(accordion): prevent accordion chevron from shrinking on smaller viewports (#717)
* Prevent accordion chevron from shrinking on smaller viewports

* fix: apply feedback
2023-06-27 11:39:54 +04:00
sean-brydon
ab836d1ab3 fix(www): update data-table-toolbar to correctly handle isFiltered (#702)
* Update data-table-toolbar.tsx

* style(www): run format:write

---------

Co-authored-by: shadcn <m@shadcn.com>
2023-06-26 16:16:03 +04:00
Daichi Ninomiya
77d6f5676e chore(www): pnpx to pnpm dlx (#350)
* fix(npm-commands): pnpx to pnpm dlx

* style(www): fix

---------

Co-authored-by: shadcn <m@shadcn.com>
2023-06-26 15:50:53 +04:00
119 changed files with 2495 additions and 819 deletions

View File

@@ -4,7 +4,7 @@ import { allDocs } from "contentlayer/generated"
import "@/styles/mdx.css"
import type { Metadata } from "next"
import Link from "next/link"
import { ChevronRight } from "lucide-react"
import { ChevronRightIcon } from "@radix-ui/react-icons"
import Balancer from "react-wrap-balancer"
import { siteConfig } from "@/config/site"
@@ -16,7 +16,6 @@ import { DocsPager } from "@/components/pager"
import { DashboardTableOfContents } from "@/components/toc"
import { badgeVariants } from "@/registry/new-york/ui/badge"
import { ScrollArea } from "@/registry/new-york/ui/scroll-area"
import { Separator } from "@/registry/new-york/ui/separator"
interface DocPageProps {
params: {
@@ -95,7 +94,7 @@ export default async function DocPage({ params }: DocPageProps) {
<div className="overflow-hidden text-ellipsis whitespace-nowrap">
Docs
</div>
<ChevronRight className="h-4 w-4" />
<ChevronRightIcon className="h-4 w-4" />
<div className="font-medium text-foreground">{doc.title}</div>
</div>
<div className="space-y-2">

View File

@@ -1,7 +1,6 @@
import { Metadata } from "next"
import Image from "next/image"
import Link from "next/link"
import { Command } from "lucide-react"
import { cn } from "@/lib/utils"
import { buttonVariants } from "@/registry/new-york/ui/button"
@@ -44,7 +43,19 @@ export default function AuthenticationPage() {
<div className="relative hidden h-full flex-col bg-muted p-10 text-white dark:border-r lg:flex">
<div className="absolute inset-0 bg-zinc-900" />
<div className="relative z-20 flex items-center text-lg font-medium">
<Command className="mr-2 h-6 w-6" /> Acme Inc
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="mr-2 h-6 w-6"
>
<path d="M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3" />
</svg>
Acme Inc
</div>
<div className="relative z-20 mt-auto">
<blockquote className="space-y-2">

View File

@@ -1,4 +1,9 @@
import { ChevronDown, Circle, Plus, Star } from "lucide-react"
import {
ChevronDownIcon,
CircleIcon,
PlusIcon,
StarIcon,
} from "@radix-ui/react-icons"
import { Button } from "@/registry/new-york/ui/button"
import {
@@ -31,15 +36,15 @@ export function DemoGithub() {
</CardDescription>
</div>
<div className="flex items-center space-x-1 rounded-md bg-secondary text-secondary-foreground">
<Button variant="secondary" className="px-3">
<Star className="mr-2 h-4 w-4" />
<Button variant="secondary" className="px-3 shadow-none">
<StarIcon className="mr-2 h-4 w-4" />
Star
</Button>
<Separator orientation="vertical" className="h-[20px]" />
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="secondary" className="px-2">
<ChevronDown className="h-4 w-4 text-secondary-foreground" />
<Button variant="secondary" className="px-2 shadow-none">
<ChevronDownIcon className="h-4 w-4 text-secondary-foreground" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent
@@ -57,7 +62,7 @@ export function DemoGithub() {
<DropdownMenuCheckboxItem>Inspiration</DropdownMenuCheckboxItem>
<DropdownMenuSeparator />
<DropdownMenuItem>
<Plus className="mr-2 h-4 w-4" /> Create List
<PlusIcon className="mr-2 h-4 w-4" /> Create List
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
@@ -66,11 +71,11 @@ export function DemoGithub() {
<CardContent>
<div className="flex space-x-4 text-sm text-muted-foreground">
<div className="flex items-center">
<Circle className="mr-1 h-3 w-3 fill-sky-400 text-sky-400" />
<CircleIcon className="mr-1 h-3 w-3 fill-sky-400 text-sky-400" />
TypeScript
</div>
<div className="flex items-center">
<Star className="mr-1 h-3 w-3" />
<StarIcon className="mr-1 h-3 w-3" />
20k
</div>
<div>Updated April 2023</div>

View File

@@ -1,4 +1,4 @@
import { AtSign, Bell, BellOff } from "lucide-react"
import { BellIcon, EyeNoneIcon, PersonIcon } from "@radix-ui/react-icons"
import {
Card,
@@ -19,7 +19,7 @@ export function DemoNotifications() {
</CardHeader>
<CardContent className="grid gap-1">
<div className="-mx-2 flex items-start space-x-4 rounded-md p-2 transition-all hover:bg-accent hover:text-accent-foreground">
<Bell className="mt-px h-5 w-5" />
<BellIcon className="mt-px h-5 w-5" />
<div className="space-y-1">
<p className="text-sm font-medium leading-none">Everything</p>
<p className="text-sm text-muted-foreground">
@@ -28,7 +28,7 @@ export function DemoNotifications() {
</div>
</div>
<div className="-mx-2 flex items-start space-x-4 rounded-md bg-accent p-2 text-accent-foreground transition-all">
<AtSign className="mt-px h-5 w-5" />
<PersonIcon className="mt-px h-5 w-5" />
<div className="space-y-1">
<p className="text-sm font-medium leading-none">Available</p>
<p className="text-sm text-muted-foreground">
@@ -37,7 +37,7 @@ export function DemoNotifications() {
</div>
</div>
<div className="-mx-2 flex items-start space-x-4 rounded-md p-2 transition-all hover:bg-accent hover:text-accent-foreground">
<BellOff className="mt-px h-5 w-5" />
<EyeNoneIcon className="mt-px h-5 w-5" />
<div className="space-y-1">
<p className="text-sm font-medium leading-none">Ignoring</p>
<p className="text-sm text-muted-foreground">

View File

@@ -1,5 +1,3 @@
import { CreditCard } from "lucide-react"
import { Icons } from "@/components/icons"
import { Button } from "@/registry/new-york/ui/button"
import {
@@ -37,7 +35,19 @@ export function DemoPaymentMethod() {
className="flex flex-col items-center justify-between rounded-md border-2 border-muted bg-popover p-4 hover:bg-accent hover:text-accent-foreground [&:has([data-state=checked])]:border-primary"
>
<RadioGroupItem value="card" id="card" className="sr-only" />
<CreditCard className="mb-3 h-6 w-6" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="mb-3 h-6 w-6"
>
<rect width="20" height="14" x="2" y="5" rx="2" />
<path d="M2 10h20" />
</svg>
Card
</Label>
<Label

View File

@@ -49,7 +49,10 @@ export function DemoReportAnIssue() {
<div className="grid gap-2">
<Label htmlFor="security-level">Security Level</Label>
<Select defaultValue="2">
<SelectTrigger id="security-level">
<SelectTrigger
id="security-level"
className="line-clamp-1 w-[160px] truncate"
>
<SelectValue placeholder="Select level" />
</SelectTrigger>
<SelectContent>

View File

@@ -1,4 +1,4 @@
import { ChevronDown } from "lucide-react"
import { ChevronDownIcon } from "@radix-ui/react-icons"
import {
Avatar,
@@ -52,7 +52,7 @@ export function DemoTeamMembers() {
<PopoverTrigger asChild>
<Button variant="outline" className="ml-auto">
Owner{" "}
<ChevronDown className="ml-2 h-4 w-4 text-muted-foreground" />
<ChevronDownIcon className="ml-2 h-4 w-4 text-muted-foreground" />
</Button>
</PopoverTrigger>
<PopoverContent className="p-0" align="end">
@@ -106,7 +106,7 @@ export function DemoTeamMembers() {
<PopoverTrigger asChild>
<Button variant="outline" className="ml-auto">
Member{" "}
<ChevronDown className="ml-2 h-4 w-4 text-muted-foreground" />
<ChevronDownIcon className="ml-2 h-4 w-4 text-muted-foreground" />
</Button>
</PopoverTrigger>
<PopoverContent className="p-0" align="end">

View File

@@ -1,4 +1,5 @@
import { Metadata } from "next"
import Image from "next/image"
import { cn } from "@/lib/utils"
@@ -11,8 +12,6 @@ import { DemoPaymentMethod } from "./components/payment-method"
import { DemoReportAnIssue } from "./components/report-an-issue"
import { DemoShareDocument } from "./components/share-document"
import { DemoTeamMembers } from "./components/team-members"
import "./styles.css"
import Image from "next/image"
export const metadata: Metadata = {
title: "Cards",

View File

@@ -1,63 +0,0 @@
[data-section="cards"] {
--background: 0 0% 100%;
--foreground: 222.2 47.4% 11.2%;
--muted: 214 95% 93%;
--muted-foreground: 215.4 16.3% 46.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 47.4% 11.2%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--card: 0 0% 100%;
--card-foreground: 222.2 47.4% 11.2%;
--primary: 224 82% 56%;
--primary-foreground: 0 0% 100%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
--accent: 216 100% 97%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 100% 50%;
--destructive-foreground: 210 40% 98%;
--ring: 215 20.2% 65.1%;
--radius: 1.2rem;
}
.dark [data-section="cards"] {
--background: 224 71% 4%;
--foreground: 213 31% 91%;
--muted: 223 47% 11%;
--muted-foreground: 215.4 16.3% 56.9%;
--popover: 224 71% 4%;
--popover-foreground: 215 20.2% 65.1%;
--border: 216 34% 17%;
--input: 216 34% 17%;
--card: 224 71% 4%;
--card-foreground: 213 31% 91%;
--primary: 224 82% 56%;
--primary-foreground: 0 0% 100%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
--accent: 226 57% 21%;
--accent-foreground: 0 0% 100%;
--destructive: 0 63% 31%;
--destructive-foreground: 210 40% 98%;
--ring: 215 20.2% 65.1%;
}

View File

@@ -1,8 +1,8 @@
"use client"
import * as React from "react"
import { CalendarIcon } from "@radix-ui/react-icons"
import { addDays, format } from "date-fns"
import { Calendar as CalendarIcon } from "lucide-react"
import { DateRange } from "react-day-picker"
import { cn } from "@/lib/utils"

View File

@@ -1,7 +1,11 @@
"use client"
import * as React from "react"
import { Check, ChevronsUpDown, PlusCircle } from "lucide-react"
import {
CaretSortIcon,
CheckIcon,
PlusCircledIcon,
} from "@radix-ui/react-icons"
import { cn } from "@/lib/utils"
import {
@@ -96,12 +100,11 @@ export default function TeamSwitcher({ className }: TeamSwitcherProps) {
<AvatarImage
src={`https://avatar.vercel.sh/${selectedTeam.value}.png`}
alt={selectedTeam.label}
className="grayscale"
/>
<AvatarFallback>SC</AvatarFallback>
</Avatar>
{selectedTeam.label}
<ChevronsUpDown className="ml-auto h-4 w-4 shrink-0 opacity-50" />
<CaretSortIcon className="ml-auto h-4 w-4 shrink-0 opacity-50" />
</Button>
</PopoverTrigger>
<PopoverContent className="w-[200px] p-0">
@@ -129,7 +132,7 @@ export default function TeamSwitcher({ className }: TeamSwitcherProps) {
<AvatarFallback>SC</AvatarFallback>
</Avatar>
{team.label}
<Check
<CheckIcon
className={cn(
"ml-auto h-4 w-4",
selectedTeam.value === team.value
@@ -152,7 +155,7 @@ export default function TeamSwitcher({ className }: TeamSwitcherProps) {
setShowNewTeamDialog(true)
}}
>
<PlusCircle className="mr-2 h-5 w-5" />
<PlusCircledIcon className="mr-2 h-5 w-5" />
Create Team
</CommandItem>
</DialogTrigger>

View File

@@ -1,5 +1,3 @@
import { CreditCard, LogOut, PlusCircle, Settings, User } from "lucide-react"
import {
Avatar,
AvatarFallback,
@@ -40,29 +38,22 @@ export function UserNav() {
<DropdownMenuSeparator />
<DropdownMenuGroup>
<DropdownMenuItem>
<User className="mr-2 h-4 w-4" />
<span>Profile</span>
Profile
<DropdownMenuShortcut>P</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuItem>
<CreditCard className="mr-2 h-4 w-4" />
<span>Billing</span>
Billing
<DropdownMenuShortcut>B</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuItem>
<Settings className="mr-2 h-4 w-4" />
<span>Settings</span>
Settings
<DropdownMenuShortcut>S</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuItem>
<PlusCircle className="mr-2 h-4 w-4" />
<span>New Team</span>
</DropdownMenuItem>
<DropdownMenuItem>New Team</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />
<DropdownMenuItem>
<LogOut className="mr-2 h-4 w-4" />
<span>Log out</span>
Log out
<DropdownMenuShortcut>Q</DropdownMenuShortcut>
</DropdownMenuItem>
</DropdownMenuContent>

View File

@@ -1,6 +1,5 @@
import { Metadata } from "next"
import Image from "next/image"
import { Activity, CreditCard, DollarSign, Download, Users } from "lucide-react"
import { Button } from "@/registry/new-york/ui/button"
import {
@@ -64,10 +63,7 @@ export default function DashboardPage() {
<h2 className="text-3xl font-bold tracking-tight">Dashboard</h2>
<div className="flex items-center space-x-2">
<CalendarDateRangePicker />
<Button>
<Download className="mr-2 h-4 w-4" />
Download
</Button>
<Button>Download</Button>
</div>
</div>
<Tabs defaultValue="overview" className="space-y-4">
@@ -90,7 +86,18 @@ export default function DashboardPage() {
<CardTitle className="text-sm font-medium">
Total Revenue
</CardTitle>
<DollarSign className="h-4 w-4 text-muted-foreground" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="h-4 w-4 text-muted-foreground"
>
<path d="M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
</svg>
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">$45,231.89</div>
@@ -104,7 +111,20 @@ export default function DashboardPage() {
<CardTitle className="text-sm font-medium">
Subscriptions
</CardTitle>
<Users className="h-4 w-4 text-muted-foreground" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="h-4 w-4 text-muted-foreground"
>
<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />
<circle cx="9" cy="7" r="4" />
<path d="M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75" />
</svg>
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">+2350</div>
@@ -116,7 +136,19 @@ export default function DashboardPage() {
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">Sales</CardTitle>
<CreditCard className="h-4 w-4 text-muted-foreground" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="h-4 w-4 text-muted-foreground"
>
<rect width="20" height="14" x="2" y="5" rx="2" />
<path d="M2 10h20" />
</svg>
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">+12,234</div>
@@ -130,7 +162,18 @@ export default function DashboardPage() {
<CardTitle className="text-sm font-medium">
Active Now
</CardTitle>
<Activity className="h-4 w-4 text-muted-foreground" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="h-4 w-4 text-muted-foreground"
>
<path d="M22 12h-4l-3 9L9 3l-3 9H2" />
</svg>
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">+573</div>

View File

@@ -1,8 +1,8 @@
"use client"
import { zodResolver } from "@hookform/resolvers/zod"
import { CalendarIcon, CaretSortIcon, CheckIcon } from "@radix-ui/react-icons"
import { format } from "date-fns"
import { CalendarIcon, Check, ChevronsUpDown } from "lucide-react"
import { useForm } from "react-hook-form"
import * as z from "zod"
@@ -173,7 +173,7 @@ export function AccountForm() {
(language) => language.value === field.value
)?.label
: "Select language"}
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
<CaretSortIcon className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button>
</FormControl>
</PopoverTrigger>
@@ -190,7 +190,7 @@ export function AccountForm() {
form.setValue("language", value)
}}
>
<Check
<CheckIcon
className={cn(
"mr-2 h-4 w-4",
language.value === field.value

View File

@@ -1,7 +1,7 @@
"use client"
import { zodResolver } from "@hookform/resolvers/zod"
import { ChevronDown } from "lucide-react"
import { ChevronDownIcon } from "@radix-ui/react-icons"
import { useForm } from "react-hook-form"
import * as z from "zod"
@@ -76,7 +76,7 @@ export function AppearanceForm() {
<option value="system">System</option>
</select>
</FormControl>
<ChevronDown className="absolute right-3 top-3 h-4 w-4 opacity-50" />
<ChevronDownIcon className="absolute right-3 top-2.5 h-4 w-4 opacity-50" />
</div>
<FormDescription>
Set the font you want to use in the dashboard.

View File

@@ -1,5 +1,4 @@
import { Separator } from "@/registry/new-york/ui/separator"
import { AccountForm } from "@/app/examples/forms/account/account-form"
import { NotificationsForm } from "@/app/examples/forms/notifications/notifications-form"
export default function SettingsNotificationsPage() {

View File

@@ -1,6 +1,6 @@
import { Metadata } from "next"
import Link from "next/link"
import { ChevronRight } from "lucide-react"
import { ArrowRightIcon } from "@radix-ui/react-icons"
import { cn } from "@/lib/utils"
import { ExamplesNav } from "@/components/examples-nav"
@@ -35,7 +35,7 @@ export default function ExamplesLayout({ children }: ExamplesLayoutProps) {
<span className="hidden sm:inline">
Introducing Style, a new CLI and more.
</span>
<ChevronRight className="ml-1 h-4 w-4" />
<ArrowRightIcon className="ml-1 h-4 w-4" />
</Link>
<PageHeaderHeading className="hidden md:block">
Check out some examples.

View File

@@ -1,8 +1,7 @@
import Image from "next/image"
import { ListMusic, PlusCircle } from "lucide-react"
import { PlusCircledIcon } from "@radix-ui/react-icons"
import { cn } from "@/lib/utils"
import { AspectRatio } from "@/registry/new-york/ui/aspect-ratio"
import {
ContextMenu,
ContextMenuContent,
@@ -55,13 +54,25 @@ export function AlbumArtwork({
<ContextMenuSubTrigger>Add to Playlist</ContextMenuSubTrigger>
<ContextMenuSubContent className="w-48">
<ContextMenuItem>
<PlusCircle className="mr-2 h-4 w-4" />
<PlusCircledIcon className="mr-2 h-4 w-4" />
New Playlist
</ContextMenuItem>
<ContextMenuSeparator />
{playlists.map((playlist) => (
<ContextMenuItem key={playlist}>
<ListMusic className="mr-2 h-4 w-4" /> {playlist}
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="mr-2 h-4 w-4"
viewBox="0 0 24 24"
>
<path d="M21 15V6M18.5 18a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM12 12H3M16 6H3M12 18H3" />
</svg>
{playlist}
</ContextMenuItem>
))}
</ContextMenuSubContent>

View File

@@ -1,5 +1,3 @@
import { Globe, Mic } from "lucide-react"
import {
Menubar,
MenubarCheckboxItem,
@@ -130,13 +128,37 @@ export function Menu() {
<MenubarItem>
Smart Dictation...{" "}
<MenubarShortcut>
<Mic className="h-4 w-4" />
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="h-4 w-4"
viewBox="0 0 24 24"
>
<path d="m12 8-9.04 9.06a2.82 2.82 0 1 0 3.98 3.98L16 12" />
<circle cx="17" cy="7" r="5" />
</svg>
</MenubarShortcut>
</MenubarItem>
<MenubarItem>
Emoji & Symbols{" "}
<MenubarShortcut>
<Globe className="h-4 w-4" />
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="h-4 w-4"
viewBox="0 0 24 24"
>
<circle cx="12" cy="12" r="10" />
<path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" />
</svg>
</MenubarShortcut>
</MenubarItem>
</MenubarContent>

View File

@@ -1,5 +1,3 @@
import { Plus, Podcast } from "lucide-react"
import { Button } from "@/registry/new-york/ui/button"
import {
Dialog,
@@ -17,7 +15,21 @@ export function PodcastEmptyPlaceholder() {
return (
<div className="flex h-[450px] shrink-0 items-center justify-center rounded-md border border-dashed">
<div className="mx-auto flex max-w-[420px] flex-col items-center justify-center text-center">
<Podcast className="h-10 w-10 text-muted-foreground" />
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="h-10 w-10 text-muted-foreground"
viewBox="0 0 24 24"
>
<circle cx="12" cy="11" r="1" />
<path d="M11 17a1 1 0 0 1 2 0c0 .5-.34 3-.5 4.5a.5.5 0 0 1-1 0c-.16-1.5-.5-4-.5-4.5ZM8 14a5 5 0 1 1 8 0" />
<path d="M17 18.5a9 9 0 1 0-10 0" />
</svg>
<h3 className="mt-4 text-lg font-semibold">No episodes added</h3>
<p className="mb-4 mt-2 text-sm text-muted-foreground">
You have not added any podcasts. Add one below.
@@ -25,7 +37,6 @@ export function PodcastEmptyPlaceholder() {
<Dialog>
<DialogTrigger>
<Button size="sm" className="relative">
<Plus className="mr-2 h-4 w-4" />
Add Podcast
</Button>
</DialogTrigger>

View File

@@ -1,15 +1,3 @@
import {
LayoutGrid,
Library,
ListMusic,
Mic2,
Music,
Music2,
PlayCircle,
Radio,
User,
} from "lucide-react"
import { cn } from "@/lib/utils"
import { Button } from "@/registry/new-york/ui/button"
import { ScrollArea } from "@/registry/new-york/ui/scroll-area"
@@ -30,15 +18,56 @@ export function Sidebar({ className, playlists }: SidebarProps) {
</h2>
<div className="space-y-1">
<Button variant="secondary" className="w-full justify-start">
<PlayCircle className="mr-2 h-4 w-4" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="mr-2 h-4 w-4"
>
<circle cx="12" cy="12" r="10" />
<polygon points="10 8 16 12 10 16 10 8" />
</svg>
Listen Now
</Button>
<Button variant="ghost" className="w-full justify-start">
<LayoutGrid className="mr-2 h-4 w-4" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="mr-2 h-4 w-4"
>
<rect width="7" height="7" x="3" y="3" rx="1" />
<rect width="7" height="7" x="14" y="3" rx="1" />
<rect width="7" height="7" x="14" y="14" rx="1" />
<rect width="7" height="7" x="3" y="14" rx="1" />
</svg>
Browse
</Button>
<Button variant="ghost" className="w-full justify-start">
<Radio className="mr-2 h-4 w-4" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="mr-2 h-4 w-4"
>
<path d="M4.9 19.1C1 15.2 1 8.8 4.9 4.9" />
<path d="M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5" />
<circle cx="12" cy="12" r="2" />
<path d="M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5" />
<path d="M19.1 4.9C23 8.8 23 15.1 19.1 19" />
</svg>
Radio
</Button>
</div>
@@ -49,23 +78,88 @@ export function Sidebar({ className, playlists }: SidebarProps) {
</h2>
<div className="space-y-1">
<Button variant="ghost" className="w-full justify-start">
<ListMusic className="mr-2 h-4 w-4" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="mr-2 h-4 w-4"
>
<path d="M21 15V6" />
<path d="M18.5 18a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z" />
<path d="M12 12H3" />
<path d="M16 6H3" />
<path d="M12 18H3" />
</svg>
Playlists
</Button>
<Button variant="ghost" className="w-full justify-start">
<Music2 className="mr-2 h-4 w-4" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="mr-2 h-4 w-4"
>
<circle cx="8" cy="18" r="4" />
<path d="M12 18V2l7 4" />
</svg>
Songs
</Button>
<Button variant="ghost" className="w-full justify-start">
<User className="mr-2 h-4 w-4" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="mr-2 h-4 w-4"
>
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" />
<circle cx="12" cy="7" r="4" />
</svg>
Made for You
</Button>
<Button variant="ghost" className="w-full justify-start">
<Mic2 className="mr-2 h-4 w-4" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="mr-2 h-4 w-4"
>
<path d="m12 8-9.04 9.06a2.82 2.82 0 1 0 3.98 3.98L16 12" />
<circle cx="17" cy="7" r="5" />
</svg>
Artists
</Button>
<Button variant="ghost" className="w-full justify-start">
<Library className="mr-2 h-4 w-4" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="mr-2 h-4 w-4"
>
<path d="m16 6 4 14" />
<path d="M12 6v14" />
<path d="M8 8v12" />
<path d="M4 4v16" />
</svg>
Albums
</Button>
</div>
@@ -82,7 +176,22 @@ export function Sidebar({ className, playlists }: SidebarProps) {
variant="ghost"
className="w-full justify-start font-normal"
>
<ListMusic className="mr-2 h-4 w-4" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="mr-2 h-4 w-4"
>
<path d="M21 15V6" />
<path d="M18.5 18a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z" />
<path d="M12 12H3" />
<path d="M16 6H3" />
<path d="M12 18H3" />
</svg>
{playlist}
</Button>
))}

View File

@@ -1,5 +1,8 @@
import { Metadata } from "next"
import Image from "next/image"
import { PlusCircledIcon } from "@radix-ui/react-icons"
import { Button } from "@/registry/new-york/ui/button"
import { ScrollArea, ScrollBar } from "@/registry/new-york/ui/scroll-area"
import { Separator } from "@/registry/new-york/ui/separator"
import {
@@ -15,11 +18,6 @@ import { PodcastEmptyPlaceholder } from "./components/podcast-empty-placeholder"
import { Sidebar } from "./components/sidebar"
import { listenNowAlbums, madeForYouAlbums } from "./data/albums"
import { playlists } from "./data/playlists"
import "./styles.css"
import Image from "next/image"
import { PlusCircle } from "lucide-react"
import { Button } from "@/registry/new-york/ui/button"
export const metadata: Metadata = {
title: "Music App",
@@ -66,7 +64,7 @@ export default function MusicPage() {
</TabsList>
<div className="ml-auto mr-4">
<Button>
<PlusCircle className="mr-2 h-4 w-4" />
<PlusCircledIcon className="mr-2 h-4 w-4" />
Add music
</Button>
</div>

View File

@@ -1,65 +0,0 @@
[data-section="music"] {
--background: 0 0% 100%;
--foreground: 222.2 47.4% 11.2%;
--muted: 243 5% 96%;
--muted-foreground: 215.4 16.3% 46.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 47.4% 11.2%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--card: 0 0% 100%;
--card-foreground: 222.2 47.4% 11.2%;
--primary: 349 89% 60%;
--primary-foreground: 0 0% 100%;
--secondary: 243 11% 4%;
--secondary-foreground: 0 0% 98%;
--accent: 243 11% 4%;
--accent-foreground: 0 0% 100%;
--destructive: 0 100% 50%;
--destructive-foreground: 210 40% 98%;
--ring: 349 89% 60%;
--radius: 0.5rem;
}
.dark [data-section="music"] {
--background: 224 71% 4%;
--foreground: 213 31% 91%;
--muted: 223 47% 11%;
--muted-foreground: 215.4 16.3% 56.9%;
--accent: 216 34% 17%;
--accent-foreground: 210 40% 98%;
--popover: 224 71% 4%;
--popover-foreground: 215 20.2% 65.1%;
--border: 216 34% 17%;
--input: 216 34% 17%;
--card: 224 71% 4%;
--card-foreground: 213 31% 91%;
--primary: 349 89% 60%;
--primary-foreground: 0 0% 100%;
--secondary: 222.2 47.4% 11.2%;
--secondary-foreground: 210 40% 98%;
--destructive: 0 63% 31%;
--destructive-foreground: 210 40% 98%;
--ring: 216 34% 17%;
--radius: 0.5rem;
}

View File

@@ -1,153 +0,0 @@
import {
AlertTriangle,
ArrowRight,
Check,
ChevronLeft,
ChevronRight,
ClipboardCheck,
Copy,
CreditCard,
Fingerprint,
HelpCircle,
Laptop,
Loader2,
LucideProps,
Moon,
MoreVertical,
Plus,
Settings,
SunMedium,
Trash,
Twitter,
User,
X,
type Icon as LucideIcon,
} from "lucide-react"
export type Icon = LucideIcon
export const Icons = {
logo: Fingerprint,
close: X,
spinner: Loader2,
chevronLeft: ChevronLeft,
chevronRight: ChevronRight,
trash: Trash,
settings: Settings,
billing: CreditCard,
ellipsis: MoreVertical,
add: Plus,
warning: AlertTriangle,
user: User,
arrowRight: ArrowRight,
help: HelpCircle,
twitter: Twitter,
check: Check,
copy: Copy,
copyDone: ClipboardCheck,
sun: SunMedium,
moon: Moon,
laptop: Laptop,
gitHub: (props: LucideProps) => (
<svg viewBox="0 0 438.549 438.549" {...props}>
<path
fill="currentColor"
d="M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z"
></path>
</svg>
),
completeMode: ({ ...props }: LucideProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="none"
{...props}
>
<rect x="4" y="3" width="12" height="2" rx="1" fill="currentColor"></rect>
<rect x="4" y="7" width="12" height="2" rx="1" fill="currentColor"></rect>
<rect x="4" y="11" width="3" height="2" rx="1" fill="currentColor"></rect>
<rect x="4" y="15" width="3" height="2" rx="1" fill="currentColor"></rect>
<rect
x="8.5"
y="11"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="8.5"
y="15"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="13"
y="11"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
</svg>
),
insertMode: ({ ...props }: LucideProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="none"
{...props}
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M14.491 7.769a.888.888 0 0 1 .287.648.888.888 0 0 1-.287.648l-3.916 3.667a1.013 1.013 0 0 1-.692.268c-.26 0-.509-.097-.692-.268L5.275 9.065A.886.886 0 0 1 5 8.42a.889.889 0 0 1 .287-.64c.181-.17.427-.267.683-.269.257-.002.504.09.69.258L8.903 9.87V3.917c0-.243.103-.477.287-.649.183-.171.432-.268.692-.268.26 0 .509.097.692.268a.888.888 0 0 1 .287.649V9.87l2.245-2.102c.183-.172.432-.269.692-.269.26 0 .508.097.692.269Z"
fill="currentColor"
></path>
<rect x="4" y="15" width="3" height="2" rx="1" fill="currentColor"></rect>
<rect
x="8.5"
y="15"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="13"
y="15"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
</svg>
),
editMode: ({ ...props }: LucideProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="none"
{...props}
>
<rect x="4" y="3" width="12" height="2" rx="1" fill="currentColor"></rect>
<rect x="4" y="7" width="12" height="2" rx="1" fill="currentColor"></rect>
<rect x="4" y="11" width="3" height="2" rx="1" fill="currentColor"></rect>
<rect x="4" y="15" width="4" height="2" rx="1" fill="currentColor"></rect>
<rect
x="8.5"
y="11"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
<path
d="M17.154 11.346a1.182 1.182 0 0 0-1.671 0L11 15.829V17.5h1.671l4.483-4.483a1.182 1.182 0 0 0 0-1.671Z"
fill="currentColor"
></path>
</svg>
),
}

View File

@@ -1,8 +1,8 @@
"use client"
import * as React from "react"
import { CaretSortIcon, CheckIcon } from "@radix-ui/react-icons"
import { PopoverProps } from "@radix-ui/react-popover"
import { Check, ChevronsUpDown } from "lucide-react"
import { cn } from "@/lib/utils"
import { useMutationObserver } from "@/hooks/use-mutation-observer"
@@ -64,7 +64,7 @@ export function ModelSelector({ models, types, ...props }: ModelSelectorProps) {
className="w-full justify-between"
>
{selectedModel ? selectedModel.name : "Select a model..."}
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
<CaretSortIcon className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button>
</PopoverTrigger>
<PopoverContent align="end" className="w-[250px] p-0">
@@ -152,7 +152,7 @@ function ModelItem({ model, isSelected, onSelect, onPeek }: ModelItemProps) {
className="aria-selected:bg-primary aria-selected:text-primary-foreground"
>
{model.name}
<Check
<CheckIcon
className={cn(
"ml-auto h-4 w-4",
isSelected ? "opacity-100" : "opacity-0"

View File

@@ -2,7 +2,7 @@
import * as React from "react"
import { Dialog } from "@radix-ui/react-dialog"
import { Flag, MoreHorizontal, Trash } from "lucide-react"
import { DotsHorizontalIcon } from "@radix-ui/react-icons"
import {
AlertDialog,
@@ -42,12 +42,11 @@ export function PresetActions() {
<DropdownMenuTrigger asChild>
<Button variant="secondary">
<span className="sr-only">Actions</span>
<MoreHorizontal className="h-4 w-4" />
<DotsHorizontalIcon className="h-4 w-4" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onSelect={() => setIsOpen(true)}>
<Flag className="mr-2 h-4 w-4" />
Content filter preferences
</DropdownMenuItem>
<DropdownMenuSeparator />
@@ -55,7 +54,6 @@ export function PresetActions() {
onSelect={() => setShowDeleteDialog(true)}
className="text-red-600"
>
<Trash className="mr-2 h-4 w-4" />
Delete preset
</DropdownMenuItem>
</DropdownMenuContent>

View File

@@ -2,8 +2,8 @@
import * as React from "react"
import { useRouter } from "next/navigation"
import { CaretSortIcon, CheckIcon } from "@radix-ui/react-icons"
import { PopoverProps } from "@radix-ui/react-popover"
import { Check, ChevronsUpDown } from "lucide-react"
import { cn } from "@/lib/utils"
import { Button } from "@/registry/new-york/ui/button"
@@ -42,7 +42,7 @@ export function PresetSelector({ presets, ...props }: PresetSelectorProps) {
className="flex-1 justify-between md:max-w-[200px] lg:max-w-[300px]"
>
{selectedPreset ? selectedPreset.name : "Load a preset..."}
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
<CaretSortIcon className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button>
</PopoverTrigger>
<PopoverContent className="w-[300px] p-0">
@@ -59,7 +59,7 @@ export function PresetSelector({ presets, ...props }: PresetSelectorProps) {
}}
>
{preset.name}
<Check
<CheckIcon
className={cn(
"ml-auto h-4 w-4",
selectedPreset?.id === preset.id

View File

@@ -1,4 +1,4 @@
import { Copy } from "lucide-react"
import { CopyIcon } from "@radix-ui/react-icons"
import { Button } from "@/registry/new-york/ui/button"
import { Input } from "@/registry/new-york/ui/input"
@@ -37,7 +37,7 @@ export function PresetShare() {
</div>
<Button type="submit" size="sm" className="px-3">
<span className="sr-only">Copy</span>
<Copy className="h-4 w-4" />
<CopyIcon className="h-4 w-4" />
</Button>
</div>
</PopoverContent>

View File

@@ -1,5 +1,6 @@
import { Metadata } from "next"
import { History } from "lucide-react"
import Image from "next/image"
import { CounterClockwiseClockIcon } from "@radix-ui/react-icons"
import { Button } from "@/registry/new-york/ui/button"
import {
@@ -18,7 +19,6 @@ import {
import { Textarea } from "@/registry/new-york/ui/textarea"
import { CodeViewer } from "./components/code-viewer"
import { Icons } from "./components/icons"
import { MaxLengthSelector } from "./components/maxlength-selector"
import { ModelSelector } from "./components/model-selector"
import { PresetActions } from "./components/preset-actions"
@@ -29,8 +29,6 @@ import { TemperatureSelector } from "./components/temperature-selector"
import { TopPSelector } from "./components/top-p-selector"
import { models, types } from "./data/models"
import { presets } from "./data/presets"
import "./styles.css"
import Image from "next/image"
export const metadata: Metadata = {
title: "Playground",
@@ -91,15 +89,163 @@ export default function PlaygroundPage() {
<TabsList className="grid grid-cols-3">
<TabsTrigger value="complete">
<span className="sr-only">Complete</span>
<Icons.completeMode className="h-5 w-5" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="none"
className="h-5 w-5"
>
<rect
x="4"
y="3"
width="12"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="4"
y="7"
width="12"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="4"
y="11"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="4"
y="15"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="8.5"
y="11"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="8.5"
y="15"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="13"
y="11"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
</svg>
</TabsTrigger>
<TabsTrigger value="insert">
<span className="sr-only">Insert</span>
<Icons.insertMode className="h-5 w-5" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="none"
className="h-5 w-5"
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M14.491 7.769a.888.888 0 0 1 .287.648.888.888 0 0 1-.287.648l-3.916 3.667a1.013 1.013 0 0 1-.692.268c-.26 0-.509-.097-.692-.268L5.275 9.065A.886.886 0 0 1 5 8.42a.889.889 0 0 1 .287-.64c.181-.17.427-.267.683-.269.257-.002.504.09.69.258L8.903 9.87V3.917c0-.243.103-.477.287-.649.183-.171.432-.268.692-.268.26 0 .509.097.692.268a.888.888 0 0 1 .287.649V9.87l2.245-2.102c.183-.172.432-.269.692-.269.26 0 .508.097.692.269Z"
fill="currentColor"
></path>
<rect
x="4"
y="15"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="8.5"
y="15"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="13"
y="15"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
</svg>
</TabsTrigger>
<TabsTrigger value="edit">
<span className="sr-only">Edit</span>
<Icons.editMode className="h-5 w-5" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="none"
className="h-5 w-5"
>
<rect
x="4"
y="3"
width="12"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="4"
y="7"
width="12"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="4"
y="11"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="4"
y="15"
width="4"
height="2"
rx="1"
fill="currentColor"
></rect>
<rect
x="8.5"
y="11"
width="3"
height="2"
rx="1"
fill="currentColor"
></rect>
<path
d="M17.154 11.346a1.182 1.182 0 0 0-1.671 0L11 15.829V17.5h1.671l4.483-4.483a1.182 1.182 0 0 0 0-1.671Z"
fill="currentColor"
></path>
</svg>
</TabsTrigger>
</TabsList>
</div>
@@ -119,7 +265,7 @@ export default function PlaygroundPage() {
<Button>Submit</Button>
<Button variant="secondary">
<span className="sr-only">Show history</span>
<History className="h-4 w-4" />
<CounterClockwiseClockIcon className="h-4 w-4" />
</Button>
</div>
</div>
@@ -137,7 +283,7 @@ export default function PlaygroundPage() {
<Button>Submit</Button>
<Button variant="secondary">
<span className="sr-only">Show history</span>
<History className="h-4 w-4" />
<CounterClockwiseClockIcon className="h-4 w-4" />
</Button>
</div>
</div>
@@ -168,7 +314,7 @@ export default function PlaygroundPage() {
<Button>Submit</Button>
<Button variant="secondary">
<span className="sr-only">Show history</span>
<History className="h-4 w-4" />
<CounterClockwiseClockIcon className="h-4 w-4" />
</Button>
</div>
</div>

View File

@@ -1,65 +0,0 @@
[data-section="playground"] {
--background: 0 0% 100%;
--foreground: 222.2 47.4% 11.2%;
--muted: 154 79% 96%;
--muted-foreground: 215.4 16.3% 46.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 47.4% 11.2%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--card: 0 0% 100%;
--card-foreground: 222.2 47.4% 11.2%;
--primary: 143 72% 29%;
--primary-foreground: 141 75% 97%;
--secondary: 145 80% 10%;
--secondary-foreground: 141 75% 97%;
--accent: 154 79% 96%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 100% 50%;
--destructive-foreground: 210 40% 98%;
--ring: 158 64% 52%;
--radius: 0rem;
}
.dark [data-section="playground"] {
--background: 224 71% 4%;
--foreground: 213 31% 91%;
--muted: 223 47% 11%;
--muted-foreground: 215.4 16.3% 56.9%;
--popover: 224 71% 4%;
--popover-foreground: 215 20.2% 65.1%;
--border: 216 34% 17%;
--input: 216 34% 17%;
--card: 224 71% 4%;
--card-foreground: 213 31% 91%;
--primary: 143 72% 29%;
--primary-foreground: 141 75% 97%;
--secondary: 145 80% 10%;
--secondary-foreground: 141 75% 97%;
--accent: 154 79% 96%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 100% 50%;
--destructive-foreground: 210 40% 98%;
--ring: 158 64% 52%;
--radius: 0rem;
}

View File

@@ -1,5 +1,10 @@
import {
ArrowDownIcon,
ArrowUpIcon,
CaretSortIcon,
EyeNoneIcon,
} from "@radix-ui/react-icons"
import { Column } from "@tanstack/react-table"
import { ChevronsUpDown, EyeOff, SortAsc, SortDesc } from "lucide-react"
import { cn } from "@/lib/utils"
import { Button } from "@/registry/new-york/ui/button"
@@ -37,26 +42,26 @@ export function DataTableColumnHeader<TData, TValue>({
>
<span>{title}</span>
{column.getIsSorted() === "desc" ? (
<SortDesc className="ml-2 h-4 w-4" />
<ArrowDownIcon className="ml-2 h-4 w-4" />
) : column.getIsSorted() === "asc" ? (
<SortAsc className="ml-2 h-4 w-4" />
<ArrowUpIcon className="ml-2 h-4 w-4" />
) : (
<ChevronsUpDown className="ml-2 h-4 w-4" />
<CaretSortIcon className="ml-2 h-4 w-4" />
)}
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="start">
<DropdownMenuItem onClick={() => column.toggleSorting(false)}>
<SortAsc className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
<ArrowUpIcon className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
Asc
</DropdownMenuItem>
<DropdownMenuItem onClick={() => column.toggleSorting(true)}>
<SortDesc className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
<ArrowDownIcon className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
Desc
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem onClick={() => column.toggleVisibility(false)}>
<EyeOff className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
<EyeNoneIcon className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
Hide
</DropdownMenuItem>
</DropdownMenuContent>

View File

@@ -1,6 +1,6 @@
import * as React from "react"
import { CheckIcon, PlusCircledIcon } from "@radix-ui/react-icons"
import { Column } from "@tanstack/react-table"
import { Check, LucideIcon, PlusCircle } from "lucide-react"
import { cn } from "@/lib/utils"
import { Badge } from "@/registry/new-york/ui/badge"
@@ -27,7 +27,7 @@ interface DataTableFacetedFilter<TData, TValue> {
options: {
label: string
value: string
icon?: LucideIcon
icon?: React.ComponentType<{ className?: string }>
}[]
}
@@ -43,7 +43,7 @@ export function DataTableFacetedFilter<TData, TValue>({
<Popover>
<PopoverTrigger asChild>
<Button variant="outline" size="sm" className="h-8 border-dashed">
<PlusCircle className="mr-2 h-4 w-4" />
<PlusCircledIcon className="mr-2 h-4 w-4" />
{title}
{selectedValues?.size > 0 && (
<>
@@ -111,7 +111,7 @@ export function DataTableFacetedFilter<TData, TValue>({
: "opacity-50 [&_svg]:invisible"
)}
>
<Check className={cn("h-4 w-4")} />
<CheckIcon className={cn("h-4 w-4")} />
</div>
{option.icon && (
<option.icon className="mr-2 h-4 w-4 text-muted-foreground" />

View File

@@ -1,10 +1,10 @@
import { Table } from "@tanstack/react-table"
import {
ChevronLeft,
ChevronRight,
ChevronsLeft,
ChevronsRight,
} from "lucide-react"
ChevronLeftIcon,
ChevronRightIcon,
DoubleArrowLeftIcon,
DoubleArrowRightIcon,
} from "@radix-ui/react-icons"
import { Table } from "@tanstack/react-table"
import { Button } from "@/registry/new-york/ui/button"
import {
@@ -61,7 +61,7 @@ export function DataTablePagination<TData>({
disabled={!table.getCanPreviousPage()}
>
<span className="sr-only">Go to first page</span>
<ChevronsLeft className="h-4 w-4" />
<DoubleArrowLeftIcon className="h-4 w-4" />
</Button>
<Button
variant="outline"
@@ -70,7 +70,7 @@ export function DataTablePagination<TData>({
disabled={!table.getCanPreviousPage()}
>
<span className="sr-only">Go to previous page</span>
<ChevronLeft className="h-4 w-4" />
<ChevronLeftIcon className="h-4 w-4" />
</Button>
<Button
variant="outline"
@@ -79,7 +79,7 @@ export function DataTablePagination<TData>({
disabled={!table.getCanNextPage()}
>
<span className="sr-only">Go to next page</span>
<ChevronRight className="h-4 w-4" />
<ChevronRightIcon className="h-4 w-4" />
</Button>
<Button
variant="outline"
@@ -88,7 +88,7 @@ export function DataTablePagination<TData>({
disabled={!table.getCanNextPage()}
>
<span className="sr-only">Go to last page</span>
<ChevronsRight className="h-4 w-4" />
<DoubleArrowRightIcon className="h-4 w-4" />
</Button>
</div>
</div>

View File

@@ -1,7 +1,7 @@
"use client"
import { DotsHorizontalIcon } from "@radix-ui/react-icons"
import { Row } from "@tanstack/react-table"
import { Copy, MoreHorizontal, Pen, Star, Tags, Trash } from "lucide-react"
import { Button } from "@/registry/new-york/ui/button"
import {
@@ -37,29 +37,17 @@ export function DataTableRowActions<TData>({
variant="ghost"
className="flex h-8 w-8 p-0 data-[state=open]:bg-muted"
>
<MoreHorizontal className="h-4 w-4" />
<DotsHorizontalIcon className="h-4 w-4" />
<span className="sr-only">Open menu</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-[160px]">
<DropdownMenuItem>
<Pen className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
Edit
</DropdownMenuItem>
<DropdownMenuItem>
<Copy className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
Make a copy
</DropdownMenuItem>
<DropdownMenuItem>
<Star className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
Favorite
</DropdownMenuItem>
<DropdownMenuItem>Edit</DropdownMenuItem>
<DropdownMenuItem>Make a copy</DropdownMenuItem>
<DropdownMenuItem>Favorite</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<Tags className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
Labels
</DropdownMenuSubTrigger>
<DropdownMenuSubTrigger>Labels</DropdownMenuSubTrigger>
<DropdownMenuSubContent>
<DropdownMenuRadioGroup value={task.label}>
{labels.map((label) => (
@@ -72,7 +60,6 @@ export function DataTableRowActions<TData>({
</DropdownMenuSub>
<DropdownMenuSeparator />
<DropdownMenuItem>
<Trash className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
Delete
<DropdownMenuShortcut></DropdownMenuShortcut>
</DropdownMenuItem>

View File

@@ -1,7 +1,7 @@
"use client"
import { Cross2Icon } from "@radix-ui/react-icons"
import { Table } from "@tanstack/react-table"
import { X } from "lucide-react"
import { Button } from "@/registry/new-york/ui/button"
import { Input } from "@/registry/new-york/ui/input"
@@ -17,9 +17,7 @@ interface DataTableToolbarProps<TData> {
export function DataTableToolbar<TData>({
table,
}: DataTableToolbarProps<TData>) {
const isFiltered =
table.getPreFilteredRowModel().rows.length >
table.getFilteredRowModel().rows.length
const isFiltered = table.getState().columnFilters.length > 0
return (
<div className="flex items-center justify-between">
@@ -53,7 +51,7 @@ export function DataTableToolbar<TData>({
className="h-8 px-2 lg:px-3"
>
Reset
<X className="ml-2 h-4 w-4" />
<Cross2Icon className="ml-2 h-4 w-4" />
</Button>
)}
</div>

View File

@@ -1,8 +1,8 @@
"use client"
import { DropdownMenuTrigger } from "@radix-ui/react-dropdown-menu"
import { MixerHorizontalIcon } from "@radix-ui/react-icons"
import { Table } from "@tanstack/react-table"
import { SlidersHorizontal } from "lucide-react"
import { Button } from "@/registry/new-york/ui/button"
import {
@@ -28,7 +28,7 @@ export function DataTableViewOptions<TData>({
size="sm"
className="ml-auto hidden h-8 lg:flex"
>
<SlidersHorizontal className="mr-2 h-4 w-4" />
<MixerHorizontalIcon className="mr-2 h-4 w-4" />
View
</Button>
</DropdownMenuTrigger>

View File

@@ -1,5 +1,3 @@
import { CreditCard, LogOut, PlusCircle, Settings, User } from "lucide-react"
import {
Avatar,
AvatarFallback,
@@ -40,29 +38,22 @@ export function UserNav() {
<DropdownMenuSeparator />
<DropdownMenuGroup>
<DropdownMenuItem>
<User className="mr-2 h-4 w-4" />
<span>Profile</span>
Profile
<DropdownMenuShortcut>P</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuItem>
<CreditCard className="mr-2 h-4 w-4" />
<span>Billing</span>
Billing
<DropdownMenuShortcut>B</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuItem>
<Settings className="mr-2 h-4 w-4" />
<span>Settings</span>
Settings
<DropdownMenuShortcut>S</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuItem>
<PlusCircle className="mr-2 h-4 w-4" />
<span>New Team</span>
</DropdownMenuItem>
<DropdownMenuItem>New Team</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />
<DropdownMenuItem>
<LogOut className="mr-2 h-4 w-4" />
<span>Log out</span>
Log out
<DropdownMenuShortcut>Q</DropdownMenuShortcut>
</DropdownMenuItem>
</DropdownMenuContent>

View File

@@ -1,13 +1,13 @@
import {
ArrowDownToLine,
ArrowRightToLine,
ArrowUpCircle,
ArrowUpToLine,
CheckCircle2,
Circle,
HelpCircle,
XCircle,
} from "lucide-react"
ArrowDownIcon,
ArrowRightIcon,
ArrowUpIcon,
CheckCircledIcon,
CircleIcon,
CrossCircledIcon,
QuestionMarkCircledIcon,
StopwatchIcon,
} from "@radix-ui/react-icons"
export const labels = [
{
@@ -28,27 +28,27 @@ export const statuses = [
{
value: "backlog",
label: "Backlog",
icon: HelpCircle,
icon: QuestionMarkCircledIcon,
},
{
value: "todo",
label: "Todo",
icon: Circle,
icon: CircleIcon,
},
{
value: "in progress",
label: "In Progress",
icon: ArrowUpCircle,
icon: StopwatchIcon,
},
{
value: "done",
label: "Done",
icon: CheckCircle2,
icon: CheckCircledIcon,
},
{
value: "canceled",
label: "Canceled",
icon: XCircle,
icon: CrossCircledIcon,
},
]
@@ -56,16 +56,16 @@ export const priorities = [
{
label: "Low",
value: "low",
icon: ArrowDownToLine,
icon: ArrowDownIcon,
},
{
label: "Medium",
value: "medium",
icon: ArrowRightToLine,
icon: ArrowRightIcon,
},
{
label: "High",
value: "high",
icon: ArrowUpToLine,
icon: ArrowUpIcon,
},
]

View File

@@ -1,6 +1,6 @@
import Image from "next/image"
import Link from "next/link"
import { ChevronRight } from "lucide-react"
import { ArrowRightIcon } from "@radix-ui/react-icons"
import { siteConfig } from "@/config/site"
import { cn } from "@/lib/utils"
@@ -28,7 +28,7 @@ export default function IndexPage() {
<span className="hidden sm:inline">
Introducing Style, a new CLI and more.
</span>
<ChevronRight className="ml-1 h-4 w-4" />
<ArrowRightIcon className="ml-1 h-4 w-4" />
</Link>
<PageHeaderHeading>Build your component library.</PageHeaderHeading>
<PageHeaderDescription>

View File

@@ -1,4 +1,3 @@
import { cn } from "@/lib/utils"
import {
Alert,
AlertDescription,

View File

@@ -3,7 +3,13 @@
import * as React from "react"
import { useRouter } from "next/navigation"
import { DialogProps } from "@radix-ui/react-alert-dialog"
import { Circle, File, Laptop, Moon, SunMedium } from "lucide-react"
import {
CircleIcon,
FileIcon,
LaptopIcon,
MoonIcon,
SunIcon,
} from "@radix-ui/react-icons"
import { useTheme } from "next-themes"
import { docsConfig } from "@/config/docs"
@@ -72,7 +78,7 @@ export function CommandMenu({ ...props }: DialogProps) {
runCommand(() => router.push(navItem.href as string))
}}
>
<File className="mr-2 h-4 w-4" />
<FileIcon className="mr-2 h-4 w-4" />
{navItem.title}
</CommandItem>
))}
@@ -88,7 +94,7 @@ export function CommandMenu({ ...props }: DialogProps) {
}}
>
<div className="mr-2 flex h-4 w-4 items-center justify-center">
<Circle className="h-3 w-3" />
<CircleIcon className="h-3 w-3" />
</div>
{navItem.title}
</CommandItem>
@@ -98,15 +104,15 @@ export function CommandMenu({ ...props }: DialogProps) {
<CommandSeparator />
<CommandGroup heading="Theme">
<CommandItem onSelect={() => runCommand(() => setTheme("light"))}>
<SunMedium className="mr-2 h-4 w-4" />
<SunIcon className="mr-2 h-4 w-4" />
Light
</CommandItem>
<CommandItem onSelect={() => runCommand(() => setTheme("dark"))}>
<Moon className="mr-2 h-4 w-4" />
<MoonIcon className="mr-2 h-4 w-4" />
Dark
</CommandItem>
<CommandItem onSelect={() => runCommand(() => setTheme("system"))}>
<Laptop className="mr-2 h-4 w-4" />
<LaptopIcon className="mr-2 h-4 w-4" />
System
</CommandItem>
</CommandGroup>

View File

@@ -2,11 +2,11 @@
import * as React from "react"
import { Index } from "@/__registry__"
import { Loader2 } from "lucide-react"
import { cn } from "@/lib/utils"
import { useConfig } from "@/hooks/use-config"
import { CopyButton, CopyWithClassNames } from "@/components/copy-button"
import { Icons } from "@/components/icons"
import { StyleSwitcher } from "@/components/style-switcher"
import { ThemeWrapper } from "@/components/theme-wrapper"
import {
@@ -116,7 +116,7 @@ export function ComponentPreview({
<React.Suspense
fallback={
<div className="flex items-center text-sm text-muted-foreground">
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
<Icons.spinner className="mr-2 h-4 w-4 animate-spin" />
Loading...
</div>
}

View File

@@ -2,11 +2,11 @@
import * as React from "react"
import { DropdownMenuTriggerProps } from "@radix-ui/react-dropdown-menu"
import { CheckIcon, CopyIcon } from "@radix-ui/react-icons"
import { NpmCommands } from "types/unist"
import { Event, trackEvent } from "@/lib/events"
import { cn } from "@/lib/utils"
import { Icons } from "@/components/icons"
import { Button } from "@/registry/new-york/ui/button"
import {
DropdownMenu,
@@ -69,9 +69,9 @@ export function CopyButton({
>
<span className="sr-only">Copy</span>
{hasCopied ? (
<Icons.check className="h-3 w-3" />
<CheckIcon className="h-3 w-3" />
) : (
<Icons.copy className="h-3 w-3" />
<CopyIcon className="h-3 w-3" />
)}
</Button>
)
@@ -114,21 +114,19 @@ export function CopyWithClassNames({
)}
>
{hasCopied ? (
<Icons.check className="h-3 w-3" />
<CheckIcon className="h-3 w-3" />
) : (
<Icons.copy className="h-3 w-3" />
<CopyIcon className="h-3 w-3" />
)}
<span className="sr-only">Copy</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => copyToClipboard(value)}>
<Icons.react className="mr-2 h-4 w-4" />
<span>Component</span>
Component
</DropdownMenuItem>
<DropdownMenuItem onClick={() => copyToClipboard(classNames)}>
<Icons.tailwind className="mr-2 h-4 w-4" />
<span>Classname</span>
Classname
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
@@ -178,9 +176,9 @@ export function CopyNpmCommandButton({
)}
>
{hasCopied ? (
<Icons.check className="h-3 w-3" />
<CheckIcon className="h-3 w-3" />
) : (
<Icons.copy className="h-3 w-3" />
<CopyIcon className="h-3 w-3" />
)}
<span className="sr-only">Copy</span>
</Button>

View File

@@ -2,7 +2,7 @@
import Link from "next/link"
import { usePathname } from "next/navigation"
import { ArrowRight } from "lucide-react"
import { ArrowRightIcon } from "@radix-ui/react-icons"
import { cn } from "@/lib/utils"
import { ScrollArea, ScrollBar } from "@/registry/new-york/ui/scroll-area"
@@ -97,7 +97,7 @@ export function ExampleCodeLink({ pathname }: ExampleCodeLinkProps) {
className="absolute right-0 top-0 hidden items-center rounded-[0.5rem] text-sm font-medium md:flex"
>
View code
<ArrowRight className="ml-1 h-4 w-4" />
<ArrowRightIcon className="ml-1 h-4 w-4" />
</Link>
)
}

View File

@@ -0,0 +1,22 @@
"use client"
import * as React from "react"
import { allDocs } from "contentlayer/generated"
import { Mdx } from "./mdx-components"
interface FrameworkDocsProps extends React.HTMLAttributes<HTMLDivElement> {
data: string
}
export function FrameworkDocs({ ...props }: FrameworkDocsProps) {
const frameworkDoc = allDocs.find(
(doc) => doc.slug === `/docs/installation/${props.data}`
)
if (!frameworkDoc) {
return null
}
return <Mdx code={frameworkDoc.body.code} />
}

View File

@@ -1,36 +1,7 @@
import {
AlertTriangle,
ArrowRight,
Check,
ChevronLeft,
ChevronRight,
ClipboardCheck,
Copy,
CreditCard,
File,
FileText,
HelpCircle,
Image,
Laptop,
Loader2,
LucideProps,
Moon,
MoreVertical,
Pizza,
Plus,
Settings,
SunMedium,
Trash,
Twitter,
User,
X,
type Icon as LucideIcon,
} from "lucide-react"
export type Icon = LucideIcon
type IconProps = React.HTMLAttributes<SVGElement>
export const Icons = {
logo: (props: LucideProps) => (
logo: (props: IconProps) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" {...props}>
<rect width="256" height="256" fill="none" />
<line
@@ -57,31 +28,12 @@ export const Icons = {
/>
</svg>
),
close: X,
spinner: Loader2,
chevronLeft: ChevronLeft,
chevronRight: ChevronRight,
trash: Trash,
post: FileText,
page: File,
media: Image,
settings: Settings,
billing: CreditCard,
ellipsis: MoreVertical,
add: Plus,
warning: AlertTriangle,
user: User,
arrowRight: ArrowRight,
help: HelpCircle,
pizza: Pizza,
twitter: Twitter,
check: Check,
copy: Copy,
copyDone: ClipboardCheck,
sun: SunMedium,
moon: Moon,
laptop: Laptop,
gitHub: (props: LucideProps) => (
twitter: (props: IconProps) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path d="M21.543 7.104c.015.211.015.423.015.636 0 6.507-4.954 14.01-14.01 14.01v-.003A13.94 13.94 0 0 1 0 19.539a9.88 9.88 0 0 0 7.287-2.041 4.93 4.93 0 0 1-4.6-3.42 4.916 4.916 0 0 0 2.223-.084A4.926 4.926 0 0 1 .96 9.167v-.062a4.887 4.887 0 0 0 2.235.616A4.928 4.928 0 0 1 1.67 3.148a13.98 13.98 0 0 0 10.15 5.144 4.929 4.929 0 0 1 8.39-4.49 9.868 9.868 0 0 0 3.128-1.196 4.941 4.941 0 0 1-2.165 2.724A9.828 9.828 0 0 0 24 4.555a10.019 10.019 0 0 1-2.457 2.549z" />
</svg>
),
gitHub: (props: IconProps) => (
<svg viewBox="0 0 438.549 438.549" {...props}>
<path
fill="currentColor"
@@ -89,7 +41,7 @@ export const Icons = {
></path>
</svg>
),
radix: (props: LucideProps) => (
radix: (props: IconProps) => (
<svg viewBox="0 0 25 25" fill="none" {...props}>
<path
d="M12 25C7.58173 25 4 21.4183 4 17C4 12.5817 7.58173 9 12 9V25Z"
@@ -102,12 +54,12 @@ export const Icons = {
></path>
</svg>
),
aria: (props: LucideProps) => (
aria: (props: IconProps) => (
<svg role="img" viewBox="0 0 24 24" fill="currentColor" {...props}>
<path d="M13.966 22.624l-1.69-4.281H8.122l3.892-9.144 5.662 13.425zM8.884 1.376H0v21.248zm15.116 0h-8.884L24 22.624Z" />
</svg>
),
npm: (props: LucideProps) => (
npm: (props: IconProps) => (
<svg viewBox="0 0 24 24" {...props}>
<path
d="M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z"
@@ -115,7 +67,7 @@ export const Icons = {
/>
</svg>
),
yarn: (props: LucideProps) => (
yarn: (props: IconProps) => (
<svg viewBox="0 0 24 24" {...props}>
<path
d="M12 0C5.375 0 0 5.375 0 12s5.375 12 12 12 12-5.375 12-12S18.625 0 12 0zm.768 4.105c.183 0 .363.053.525.157.125.083.287.185.755 1.154.31-.088.468-.042.551-.019.204.056.366.19.463.375.477.917.542 2.553.334 3.605-.241 1.232-.755 2.029-1.131 2.576.324.329.778.899 1.117 1.825.278.774.31 1.478.273 2.015a5.51 5.51 0 0 0 .602-.329c.593-.366 1.487-.917 2.553-.931.714-.009 1.269.445 1.353 1.103a1.23 1.23 0 0 1-.945 1.362c-.649.158-.95.278-1.821.843-1.232.797-2.539 1.242-3.012 1.39a1.686 1.686 0 0 1-.704.343c-.737.181-3.266.315-3.466.315h-.046c-.783 0-1.214-.241-1.45-.491-.658.329-1.51.19-2.122-.134a1.078 1.078 0 0 1-.58-1.153 1.243 1.243 0 0 1-.153-.195c-.162-.25-.528-.936-.454-1.946.056-.723.556-1.367.88-1.71a5.522 5.522 0 0 1 .408-2.256c.306-.727.885-1.348 1.32-1.737-.32-.537-.644-1.367-.329-2.21.227-.602.412-.936.82-1.08h-.005c.199-.074.389-.153.486-.259a3.418 3.418 0 0 1 2.298-1.103c.037-.093.079-.185.125-.283.31-.658.639-1.029 1.024-1.168a.94.94 0 0 1 .328-.06zm.006.7c-.507.016-1.001 1.519-1.001 1.519s-1.27-.204-2.266.871c-.199.218-.468.334-.746.44-.079.028-.176.023-.417.672-.371.991.625 2.094.625 2.094s-1.186.839-1.626 1.881c-.486 1.144-.338 2.261-.338 2.261s-.843.732-.899 1.487c-.051.663.139 1.2.343 1.515.227.343.51.176.51.176s-.561.653-.037.931c.477.25 1.283.394 1.71-.037.31-.31.371-1.001.486-1.283.028-.065.12.111.209.199.097.093.264.195.264.195s-.755.324-.445 1.066c.102.246.468.403 1.066.398.222-.005 2.664-.139 3.313-.296.375-.088.505-.283.505-.283s1.566-.431 2.998-1.357c.917-.598 1.293-.76 2.034-.936.612-.148.57-1.098-.241-1.084-.839.009-1.575.44-2.196.825-1.163.718-1.742.672-1.742.672l-.018-.032c-.079-.13.371-1.293-.134-2.678-.547-1.515-1.413-1.881-1.344-1.997.297-.5 1.038-1.297 1.334-2.78.176-.899.13-2.377-.269-3.151-.074-.144-.732.241-.732.241s-.616-1.371-.788-1.483a.271.271 0 0 0-.157-.046z"
@@ -123,7 +75,7 @@ export const Icons = {
/>
</svg>
),
pnpm: (props: LucideProps) => (
pnpm: (props: IconProps) => (
<svg viewBox="0 0 24 24" {...props}>
<path
d="M0 0v7.5h7.5V0zm8.25 0v7.5h7.498V0zm8.25 0v7.5H24V0zM8.25 8.25v7.5h7.498v-7.5zm8.25 0v7.5H24v-7.5zM0 16.5V24h7.5v-7.5zm8.25 0V24h7.498v-7.5zm8.25 0V24H24v-7.5z"
@@ -131,7 +83,7 @@ export const Icons = {
/>
</svg>
),
react: (props: LucideProps) => (
react: (props: IconProps) => (
<svg viewBox="0 0 24 24" {...props}>
<path
d="M14.23 12.004a2.236 2.236 0 0 1-2.235 2.236 2.236 2.236 0 0 1-2.236-2.236 2.236 2.236 0 0 1 2.235-2.236 2.236 2.236 0 0 1 2.236 2.236zm2.648-10.69c-1.346 0-3.107.96-4.888 2.622-1.78-1.653-3.542-2.602-4.887-2.602-.41 0-.783.093-1.106.278-1.375.793-1.683 3.264-.973 6.365C1.98 8.917 0 10.42 0 12.004c0 1.59 1.99 3.097 5.043 4.03-.704 3.113-.39 5.588.988 6.38.32.187.69.275 1.102.275 1.345 0 3.107-.96 4.888-2.624 1.78 1.654 3.542 2.603 4.887 2.603.41 0 .783-.09 1.106-.275 1.374-.792 1.683-3.263.973-6.365C22.02 15.096 24 13.59 24 12.004c0-1.59-1.99-3.097-5.043-4.032.704-3.11.39-5.587-.988-6.38-.318-.184-.688-.277-1.092-.278zm-.005 1.09v.006c.225 0 .406.044.558.127.666.382.955 1.835.73 3.704-.054.46-.142.945-.25 1.44-.96-.236-2.006-.417-3.107-.534-.66-.905-1.345-1.727-2.035-2.447 1.592-1.48 3.087-2.292 4.105-2.295zm-9.77.02c1.012 0 2.514.808 4.11 2.28-.686.72-1.37 1.537-2.02 2.442-1.107.117-2.154.298-3.113.538-.112-.49-.195-.964-.254-1.42-.23-1.868.054-3.32.714-3.707.19-.09.4-.127.563-.132zm4.882 3.05c.455.468.91.992 1.36 1.564-.44-.02-.89-.034-1.345-.034-.46 0-.915.01-1.36.034.44-.572.895-1.096 1.345-1.565zM12 8.1c.74 0 1.477.034 2.202.093.406.582.802 1.203 1.183 1.86.372.64.71 1.29 1.018 1.946-.308.655-.646 1.31-1.013 1.95-.38.66-.773 1.288-1.18 1.87-.728.063-1.466.098-2.21.098-.74 0-1.477-.035-2.202-.093-.406-.582-.802-1.204-1.183-1.86-.372-.64-.71-1.29-1.018-1.946.303-.657.646-1.313 1.013-1.954.38-.66.773-1.286 1.18-1.868.728-.064 1.466-.098 2.21-.098zm-3.635.254c-.24.377-.48.763-.704 1.16-.225.39-.435.782-.635 1.174-.265-.656-.49-1.31-.676-1.947.64-.15 1.315-.283 2.015-.386zm7.26 0c.695.103 1.365.23 2.006.387-.18.632-.405 1.282-.66 1.933-.2-.39-.41-.783-.64-1.174-.225-.392-.465-.774-.705-1.146zm3.063.675c.484.15.944.317 1.375.498 1.732.74 2.852 1.708 2.852 2.476-.005.768-1.125 1.74-2.857 2.475-.42.18-.88.342-1.355.493-.28-.958-.646-1.956-1.1-2.98.45-1.017.81-2.01 1.085-2.964zm-13.395.004c.278.96.645 1.957 1.1 2.98-.45 1.017-.812 2.01-1.086 2.964-.484-.15-.944-.318-1.37-.5-1.732-.737-2.852-1.706-2.852-2.474 0-.768 1.12-1.742 2.852-2.476.42-.18.88-.342 1.356-.494zm11.678 4.28c.265.657.49 1.312.676 1.948-.64.157-1.316.29-2.016.39.24-.375.48-.762.705-1.158.225-.39.435-.788.636-1.18zm-9.945.02c.2.392.41.783.64 1.175.23.39.465.772.705 1.143-.695-.102-1.365-.23-2.006-.386.18-.63.406-1.282.66-1.933zM17.92 16.32c.112.493.2.968.254 1.423.23 1.868-.054 3.32-.714 3.708-.147.09-.338.128-.563.128-1.012 0-2.514-.807-4.11-2.28.686-.72 1.37-1.536 2.02-2.44 1.107-.118 2.154-.3 3.113-.54zm-11.83.01c.96.234 2.006.415 3.107.532.66.905 1.345 1.727 2.035 2.446-1.595 1.483-3.092 2.295-4.11 2.295-.22-.005-.406-.05-.553-.132-.666-.38-.955-1.834-.73-3.703.054-.46.142-.944.25-1.438zm4.56.64c.44.02.89.034 1.345.034.46 0 .915-.01 1.36-.034-.44.572-.895 1.095-1.345 1.565-.455-.47-.91-.993-1.36-1.565z"
@@ -139,7 +91,7 @@ export const Icons = {
/>
</svg>
),
tailwind: (props: LucideProps) => (
tailwind: (props: IconProps) => (
<svg viewBox="0 0 24 24" {...props}>
<path
d="M12.001,4.8c-3.2,0-5.2,1.6-6,4.8c1.2-1.6,2.6-2.2,4.2-1.8c0.913,0.228,1.565,0.89,2.288,1.624 C13.666,10.618,15.027,12,18.001,12c3.2,0,5.2-1.6,6-4.8c-1.2,1.6-2.6,2.2-4.2,1.8c-0.913-0.228-1.565-0.89-2.288-1.624 C16.337,6.182,14.976,4.8,12.001,4.8z M6.001,12c-3.2,0-5.2,1.6-6,4.8c1.2-1.6,2.6-2.2,4.2-1.8c0.913,0.228,1.565,0.89,2.288,1.624 c1.177,1.194,2.538,2.576,5.512,2.576c3.2,0,5.2-1.6,6-4.8c-1.2,1.6-2.6,2.2-4.2,1.8c-0.913-0.228-1.565-0.89-2.288-1.624 C10.337,13.382,8.976,12,6.001,12z"
@@ -147,7 +99,7 @@ export const Icons = {
/>
</svg>
),
google: (props: LucideProps) => (
google: (props: IconProps) => (
<svg role="img" viewBox="0 0 24 24" {...props}>
<path
fill="currentColor"
@@ -155,7 +107,7 @@ export const Icons = {
/>
</svg>
),
apple: (props: LucideProps) => (
apple: (props: IconProps) => (
<svg role="img" viewBox="0 0 24 24" {...props}>
<path
d="M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"
@@ -163,7 +115,7 @@ export const Icons = {
/>
</svg>
),
paypal: (props: LucideProps) => (
paypal: (props: IconProps) => (
<svg role="img" viewBox="0 0 24 24" {...props}>
<path
d="M7.076 21.337H2.47a.641.641 0 0 1-.633-.74L4.944.901C5.026.382 5.474 0 5.998 0h7.46c2.57 0 4.578.543 5.69 1.81 1.01 1.15 1.304 2.42 1.012 4.287-.023.143-.047.288-.077.437-.983 5.05-4.349 6.797-8.647 6.797h-2.19c-.524 0-.968.382-1.05.9l-1.12 7.106zm14.146-14.42a3.35 3.35 0 0 0-.607-.541c-.013.076-.026.175-.041.254-.93 4.778-4.005 7.201-9.138 7.201h-2.19a.563.563 0 0 0-.556.479l-1.187 7.527h-.506l-.24 1.516a.56.56 0 0 0 .554.647h3.882c.46 0 .85-.334.922-.788.06-.26.76-4.852.816-5.09a.932.932 0 0 1 .923-.788h.58c3.76 0 6.705-1.528 7.565-5.946.36-1.847.174-3.388-.777-4.471z"
@@ -171,4 +123,20 @@ export const Icons = {
/>
</svg>
),
spinner: (props: IconProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
{...props}
>
<path d="M21 12a9 9 0 1 1-6.219-8.56" />
</svg>
),
}

View File

@@ -2,6 +2,7 @@
import * as React from "react"
import Image from "next/image"
import Link, { LinkProps } from "next/link"
import { useMDXComponent } from "next-contentlayer/hooks"
import { NpmCommands } from "types/unist"
@@ -14,6 +15,7 @@ import { ComponentExample } from "@/components/component-example"
import { ComponentPreview } from "@/components/component-preview"
import { ComponentSource } from "@/components/component-source"
import { CopyButton, CopyNpmCommandButton } from "@/components/copy-button"
import { FrameworkDocs } from "@/components/framework-docs"
import { StyleWrapper } from "@/components/style-wrapper"
import {
Accordion,
@@ -241,7 +243,7 @@ const components = {
),
Steps: ({ ...props }) => (
<div
className="[&>h3]:step mb-12 ml-4 border-l pl-8 [counter-reset:step]"
className="[&>h3]:step steps mb-12 ml-4 border-l pl-8 [counter-reset:step]"
{...props}
/>
),
@@ -278,7 +280,22 @@ const components = {
}: React.ComponentProps<typeof TabsContent>) => (
<TabsContent
className={cn(
"relative [&_h3.font-heading]:text-base [&_h3.font-heading]:font-normal",
"relative [&_h3.font-heading]:text-base [&_h3.font-heading]:font-semibold",
className
)}
{...props}
/>
),
FrameworkDocs: ({
className,
...props
}: React.ComponentProps<typeof FrameworkDocs>) => (
<FrameworkDocs className={cn(className)} {...props} />
),
LinkedCard: ({ className, ...props }: React.ComponentProps<typeof Link>) => (
<Link
className={cn(
"flex w-full flex-col items-center rounded-xl border bg-card p-6 text-card-foreground shadow transition-colors hover:bg-muted/50 sm:p-10",
className
)}
{...props}

View File

@@ -3,7 +3,7 @@
import * as React from "react"
import Link, { LinkProps } from "next/link"
import { useRouter } from "next/navigation"
import { SidebarOpen } from "lucide-react"
import { ViewVerticalIcon } from "@radix-ui/react-icons"
import { docsConfig } from "@/config/docs"
import { siteConfig } from "@/config/site"
@@ -23,7 +23,7 @@ export function MobileNav() {
variant="ghost"
className="mr-2 px-0 text-base hover:bg-transparent focus-visible:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 md:hidden"
>
<SidebarOpen className="h-6 w-6" />
<ViewVerticalIcon className="h-5 w-5" />
<span className="sr-only">Toggle Menu</span>
</Button>
</SheetTrigger>

View File

@@ -1,9 +1,9 @@
"use client"
import * as React from "react"
import { MoonIcon, SunIcon } from "@radix-ui/react-icons"
import { useTheme } from "next-themes"
import { Icons } from "@/components/icons"
import { Button } from "@/registry/new-york/ui/button"
import {
DropdownMenu,
@@ -19,23 +19,20 @@ export function ModeToggle() {
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" className="w-9 px-0">
<Icons.sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<Icons.moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<SunIcon className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<MoonIcon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<span className="sr-only">Toggle theme</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => setTheme("light")}>
<Icons.sun className="mr-2 h-4 w-4" />
<span>Light</span>
Light
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme("dark")}>
<Icons.moon className="mr-2 h-4 w-4" />
<span>Dark</span>
Dark
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme("system")}>
<Icons.laptop className="mr-2 h-4 w-4" />
<span>System</span>
System
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>

View File

@@ -1,10 +1,10 @@
import Link from "next/link"
import { ChevronLeftIcon, ChevronRightIcon } from "@radix-ui/react-icons"
import { Doc } from "contentlayer/generated"
import { NavItem, NavItemWithChildren } from "types/nav"
import { docsConfig } from "@/config/docs"
import { cn } from "@/lib/utils"
import { Icons } from "@/components/icons"
import { buttonVariants } from "@/registry/new-york/ui/button"
interface DocsPagerProps {
@@ -25,7 +25,7 @@ export function DocsPager({ doc }: DocsPagerProps) {
href={pager.prev.href}
className={buttonVariants({ variant: "outline" })}
>
<Icons.chevronLeft className="mr-2 h-4 w-4" />
<ChevronLeftIcon className="mr-2 h-4 w-4" />
{pager.prev.title}
</Link>
)}
@@ -35,7 +35,7 @@ export function DocsPager({ doc }: DocsPagerProps) {
className={cn(buttonVariants({ variant: "outline" }), "ml-auto")}
>
{pager.next.title}
<Icons.chevronRight className="ml-2 h-4 w-4" />
<ChevronRightIcon className="ml-2 h-4 w-4" />
</Link>
)}
</div>

View File

@@ -68,19 +68,54 @@ export const docsConfig: DocsConfig = {
href: "/docs/components/typography",
items: [],
},
{
title: "Figma",
href: "/docs/figma",
items: [],
},
{
title: "Changelog",
href: "/docs/changelog",
items: [],
},
{
title: "About",
href: "/docs/about",
items: [],
},
],
},
{
title: "Community",
title: "Installation",
items: [
{
title: "Figma",
href: "/docs/figma",
title: "Next.js",
href: "/docs/installation/next",
items: [],
},
{
title: "Vite",
href: "/docs/installation/vite",
items: [],
},
{
title: "Remix",
href: "/docs/installation/remix",
items: [],
},
{
title: "Gatsby",
href: "/docs/installation/gatsby",
items: [],
},
{
title: "Astro",
href: "/docs/installation/astro",
items: [],
},
{
title: "Manual",
href: "/docs/installation/manual",
items: [],
},
],

View File

@@ -0,0 +1,20 @@
---
title: About
description: Powered by amazing open source projects.
---
## About
[ui.shadcn.com](https://ui.shadcn.com) is a project by [shadcn](https://shadcn.com).
## Credits
- [Radix UI](https://radix-ui.com) - For the primitives.
- [Vercel](https://vercel.com) - Where I host all my projects.
- [Shu Ding](https://shud.in) - The typography style is adapted from his work on Nextra.
- [Cal](https://cal.com) - Where I copied the styles for the first component: the `Button`.
- [cmdk](https://cmdk.paco.me) - For the `<Command />` component.
## License
MIT © [shadcn](https://shadcn.com)

View File

@@ -4,6 +4,48 @@ description: Latest updates and announcements.
toc: false
---
## July 2023 - JavaScript
This project and the components are written in TypeScript. We recommend using TypeScript for your project as well.
However we provide a JavaScript version of the components as well. The JavaScript version is available via the [cli](/docs/cli).
```txt
Would you like to use TypeScript (recommended)? no
```
To opt-out of TypeScript, you can use the `tsx` flag in your `components.json` file.
```json {10} title="components.json"
{
"style": "default",
"tailwind": {
"config": "tailwind.config.js",
"css": "src/app/globals.css",
"baseColor": "zinc",
"cssVariables": true
},
"rsc": false,
"tsx": false,
"aliases": {
"utils": "~/lib/utils",
"components": "~/components"
}
}
```
To configure import aliases, you can use the following `jsconfig.json`:
```json {4} title="jsconfig.json"
{
"compilerOptions": {
"paths": {
"@/*": ["./*"]
}
}
}
```
## June 2023 - New CLI, Styles and more
I have a lot of updates to share with you today:

View File

@@ -67,6 +67,12 @@ module.exports = {
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-accordion
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="accordion" />

View File

@@ -30,6 +30,12 @@ npx shadcn-ui@latest add alert-dialog
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-alert-dialog
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="alert-dialog" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add aspect-ratio
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-aspect-ratio
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="aspect-ratio" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add avatar
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-avatar
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="avatar" />

View File

@@ -27,6 +27,12 @@ npx shadcn-ui@latest add button
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-slot
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="button" />

View File

@@ -30,6 +30,16 @@ npx shadcn-ui@latest add calendar
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install react-day-picker date-fns
```
<Step>Add the `Button` component to your project.</Step>
The `Calendar` component uses the `Button` component. Make sure you have it installed in your project.
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="calendar" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add checkbox
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-checkbox
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="checkbox" />

View File

@@ -30,6 +30,12 @@ npx shadcn-ui@latest add collapsible
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-collapsible
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="collapsible" />

View File

@@ -34,6 +34,12 @@ npx shadcn-ui@latest add command
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install cmdk
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="command" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add context-menu
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-context-menu
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="context-menu" />

View File

@@ -30,6 +30,12 @@ npx shadcn-ui@latest add dialog
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-dialog
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="dialog" />

View File

@@ -30,6 +30,12 @@ npx shadcn-ui@latest add dropdown-menu
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-dropdown-menu
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="dropdown-menu" />

View File

@@ -27,6 +27,12 @@ npx shadcn-ui@latest add hover-card
<TabsContent value="manual">
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-hover-card
```
<Steps>
<Step>Copy and paste the following code into your project.</Step>

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add label
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-label
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="label" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add menubar
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-menubar
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="menubar" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add navigation-menu
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-navigation-menu
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="navigation-menu" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add popover
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-popover
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="popover" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add progress
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-progress
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="progress" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add radio-group
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-radio-group
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="radio-group" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add scroll-area
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-scroll-area
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="scroll-area" />

View File

@@ -30,6 +30,12 @@ npx shadcn-ui@latest add select
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-select
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="select" />

View File

@@ -28,6 +28,11 @@ npx shadcn-ui@latest add separator
<TabsContent value="manual">
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-separator
```
<Step>Copy and paste the following code into your project.</Step>

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add sheet
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-dialog
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="sheet" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add slider
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-slider
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="slider" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add switch
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-switch
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="switch" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add tabs
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-tabs
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="tabs" />

View File

@@ -53,6 +53,12 @@ export default function RootLayout({ children }) {
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-toast
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="toast" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add toggle
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-toggle
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="toggle" />

View File

@@ -29,6 +29,12 @@ npx shadcn-ui@latest add tooltip
<Steps>
<Step>Install the following dependencies:</Step>
```bash
npm install @radix-ui/react-tooltip
```
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="tooltip" />

View File

@@ -65,11 +65,3 @@ But hey, let me know if you do. I'd love to see what you build.
</AccordionItem>
</Accordion>
## Credits
- [Radix UI](https://radix-ui.com) - For the primitives.
- [Vercel](https://vercel.com) - Where I host all my projects.
- [Shu Ding](https://shud.in) - The typography style is adapted from his work on Nextra.
- [Cal](https://cal.com) - Where I copied the styles for the first component: the `Button`.
- [cmdk](https://cmdk.paco.me) - For the `<Command />` component.

View File

@@ -0,0 +1,137 @@
---
title: Astro
description: Install and configure Astro.
---
<Steps>
### Create project
Start by creating a new Astro project:
```bash
npm create astro@latest
```
### Configure your Astro project
You will be asked a few questions to configure your project:
```txt showLineNumbers
- Where should we create your new project?
./your-app-name
- How would you like to start your new project?
Choose a starter template (or Empty)
- Install dependencies?
Yes
- Do you plan to write TypeScript?
Yes
- How strict should TypeScript be?
Strict
- Initialize a new git repository? (optional)
Yes/No
```
### Add React to your project
Install React using the Astro CLI:
```bash
npx astro add react
```
<Callout className="mt-4">
Answer `Yes` to all the question prompted by the CLI when installing React.
</Callout>
### Add Tailwind CSS to your project
Install Tailwind CSS using the Astro CLI:
```bash
npx astro add tailwind
```
<Callout className="mt-4">
Answer `Yes` to all the question prompted by the CLI when installing Tailwind CSS.
</Callout>
### Edit tsconfig.json file
Add the code below to the tsconfig.json file to resolve paths:
```json {2-7} showLineNumbers
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}
}
```
### Run the CLI
Run the `shadcn-ui` init command to setup your project:
```bash
npx shadcn-ui@latest init
```
### Configure components.json
You will be asked a few questions to configure `components.json`:
```txt showLineNumbers
Would you like to use TypeScript (recommended)? no / yes
Which style would you like to use? Default
Which color would you like to use as base color? Slate
Where is your global CSS file? ./src/styles/globals.css
Do you want to use CSS variables for colors? no / yes
Where is your tailwind.config.js located? tailwind.config.cjs
Configure the import alias for components: @/components
Configure the import alias for utils: @/lib/utils
Are you using React Server Components? no
```
### Import the globals.css file
Import the `globals.css` file in the `src/index.astro` file:
```ts {2} showLineNumbers
---
import '@/styles/globals.css'
---
```
### That's it
You can now start adding components to your project.
```bash
npx shadcn-ui@latest add button
```
The command above will add the `Button` component to your project. You can then import it like this:
```astro {2,10} showLineNumbers
---
import { Button } from "@/components/ui/button"
---
<html lang="en">
<head>
<title>Astro</title>
</head>
<body>
<Button>Hello World</Button>
</body>
</html>
```
</Steps>

View File

@@ -0,0 +1,120 @@
---
title: Gatsby
description: Install and configure Gatsby.
---
<Steps>
### Create project
Start by creating a new Gatsby project using `create-gatsby`:
```bash
npm init gatsby
```
### Configure your Gatsby project to use TypeScript and Tailwind CSS
You will be asked a few questions to configure your project:
```txt showLineNumbers
✔ What would you like to call your site?
· your-app-name
✔ What would you like to name the folder where your site will be created?
· your-app-name
✔ Will you be using JavaScript or TypeScript?
· TypeScript
✔ Will you be using a CMS?
· Choose whatever you want
✔ Would you like to install a styling system?
· Tailwind CSS
✔ Would you like to install additional features with other plugins?
· Choose whatever you want
✔ Shall we do this? (Y/n) · Yes
```
### Edit tsconfig.json file
Add the code below to the `tsconfig.json` file to resolve paths:
```ts {4-9} showLineNumbers
{
"compilerOptions": {
// ...
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
]
}
// ...
}
}
```
### Create gatsby-node.ts file
Create a `gatsby-node.ts` file at the root of your project if it doesnt already exist, and add the code below to the `gatsby-node` file so your app can resolve paths:
```ts
import * as path from "path"
export const onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
resolve: {
alias: {
"@/components": path.resolve(__dirname, "src/components"),
"@/lib/utils": path.resolve(__dirname, "src/lib/utils"),
},
},
})
}
```
### Run the CLI
Run the `shadcn-ui` init command to setup your project:
```bash
npx shadcn-ui@latest init
```
### Configure components.json
You will be asked a few questions to configure `components.json`:
```txt showLineNumbers
Would you like to use TypeScript (recommended)? no / yes
Which style would you like to use? Default
Which color would you like to use as base color? Slate
Where is your global CSS file? ./src/styles/globals.css
Do you want to use CSS variables for colors? no / yes
Where is your tailwind.config.js located? tailwind.config.js
Configure the import alias for components: @/components
Configure the import alias for utils: @/lib/utils
Are you using React Server Components? no
```
### That's it
You can now start adding components to your project.
```bash
npx shadcn-ui@latest add button
```
The command above will add the `Button` component to your project. You can then import it like this:
```tsx {1,6} showLineNumbers
import { Button } from "@/components/ui"
export default function Home() {
return (
<div>
<Button>Click me</Button>
</div>
)
}
```
</Steps>

View File

@@ -0,0 +1,128 @@
---
title: Installation
description: How to install dependencies and structure your app.
---
## Frameworks
<div className="grid sm:grid-cols-2 gap-4 mt-8 sm:gap-6">
<LinkedCard href="/docs/installation/next">
<svg
role="img"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
className="w-10 h-10"
fill="currentColor"
>
<title>Next.js</title>
<path d="M11.5725 0c-.1763 0-.3098.0013-.3584.0067-.0516.0053-.2159.021-.3636.0328-3.4088.3073-6.6017 2.1463-8.624 4.9728C1.1004 6.584.3802 8.3666.1082 10.255c-.0962.659-.108.8537-.108 1.7474s.012 1.0884.108 1.7476c.652 4.506 3.8591 8.2919 8.2087 9.6945.7789.2511 1.6.4223 2.5337.5255.3636.04 1.9354.04 2.299 0 1.6117-.1783 2.9772-.577 4.3237-1.2643.2065-.1056.2464-.1337.2183-.1573-.0188-.0139-.8987-1.1938-1.9543-2.62l-1.919-2.592-2.4047-3.5583c-1.3231-1.9564-2.4117-3.556-2.4211-3.556-.0094-.0026-.0187 1.5787-.0235 3.509-.0067 3.3802-.0093 3.5162-.0516 3.596-.061.115-.108.1618-.2064.2134-.075.0374-.1408.0445-.495.0445h-.406l-.1078-.068a.4383.4383 0 01-.1572-.1712l-.0493-.1056.0053-4.703.0067-4.7054.0726-.0915c.0376-.0493.1174-.1125.1736-.143.0962-.047.1338-.0517.5396-.0517.4787 0 .5584.0187.6827.1547.0353.0377 1.3373 1.9987 2.895 4.3608a10760.433 10760.433 0 004.7344 7.1706l1.9002 2.8782.096-.0633c.8518-.5536 1.7525-1.3418 2.4657-2.1627 1.5179-1.7429 2.4963-3.868 2.8247-6.134.0961-.6591.1078-.854.1078-1.7475 0-.8937-.012-1.0884-.1078-1.7476-.6522-4.506-3.8592-8.2919-8.2087-9.6945-.7672-.2487-1.5836-.42-2.4985-.5232-.169-.0176-1.0835-.0366-1.6123-.037zm4.0685 7.217c.3473 0 .4082.0053.4857.047.1127.0562.204.1642.237.2767.0186.061.0234 1.3653.0186 4.3044l-.0067 4.2175-.7436-1.14-.7461-1.14v-3.066c0-1.982.0093-3.0963.0234-3.1502.0375-.1313.1196-.2346.2323-.2955.0961-.0494.1313-.054.4997-.054z" />
</svg>
<p className="font-medium mt-2">Next.js</p>
</LinkedCard>
<LinkedCard href="/docs/installation/vite">
<svg
role="img"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
className="w-10 h-10"
fill="currentColor"
>
<title>Vite</title>
<path d="m8.286 10.578.512-8.657a.306.306 0 0 1 .247-.282L17.377.006a.306.306 0 0 1 .353.385l-1.558 5.403a.306.306 0 0 0 .352.385l2.388-.46a.306.306 0 0 1 .332.438l-6.79 13.55-.123.19a.294.294 0 0 1-.252.14c-.177 0-.35-.152-.305-.369l1.095-5.301a.306.306 0 0 0-.388-.355l-1.433.435a.306.306 0 0 1-.389-.354l.69-3.375a.306.306 0 0 0-.37-.36l-2.32.536a.306.306 0 0 1-.374-.316zm14.976-7.926L17.284 3.74l-.544 1.887 2.077-.4a.8.8 0 0 1 .84.369.8.8 0 0 1 .034.783L12.9 19.93l-.013.025-.015.023-.122.19a.801.801 0 0 1-.672.37.826.826 0 0 1-.634-.302.8.8 0 0 1-.16-.67l1.029-4.981-1.12.34a.81.81 0 0 1-.86-.262.802.802 0 0 1-.165-.67l.63-3.08-2.027.468a.808.808 0 0 1-.768-.233.81.81 0 0 1-.217-.6l.389-6.57-7.44-1.33a.612.612 0 0 0-.64.906L11.58 23.691a.612.612 0 0 0 1.066-.004l11.26-20.135a.612.612 0 0 0-.644-.9z" />
</svg>
<p className="font-medium mt-2">Vite</p>
</LinkedCard>
<LinkedCard href="/docs/installation/remix">
<svg
role="img"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
className="w-10 h-10"
fill="currentColor"
>
<title>Remix</title>
<path d="M21.511 18.508c.216 2.773.216 4.073.216 5.492H15.31c0-.309.006-.592.011-.878.018-.892.036-1.821-.109-3.698-.19-2.747-1.374-3.358-3.55-3.358H1.574v-5h10.396c2.748 0 4.122-.835 4.122-3.049 0-1.946-1.374-3.125-4.122-3.125H1.573V0h11.541c6.221 0 9.313 2.938 9.313 7.632 0 3.511-2.176 5.8-5.114 6.182 2.48.497 3.93 1.909 4.198 4.694ZM1.573 24v-3.727h6.784c1.133 0 1.379.84 1.379 1.342V24Z" />
</svg>
<p className="font-medium mt-2">Remix</p>
</LinkedCard>
<LinkedCard href="/docs/installation/gatsby">
<svg
role="img"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
className="w-10 h-10"
fill="currentColor"
>
<title>Gatsby</title>
<path d="M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.6 0 12 0zm0 2.571c3.171 0 5.915 1.543 7.629 3.858l-1.286 1.115C16.886 5.572 14.571 4.286 12 4.286c-3.343 0-6.171 2.143-7.286 5.143l9.857 9.857c2.486-.857 4.373-3 4.973-5.572h-4.115V12h6c0 4.457-3.172 8.228-7.372 9.17L2.83 9.944C3.772 5.743 7.543 2.57 12 2.57zm-9.429 9.6l9.344 9.258c-2.4-.086-4.801-.943-6.601-2.743-1.8-1.8-2.743-4.201-2.743-6.515z" />
</svg>
<p className="font-medium mt-2">Gatsby</p>
</LinkedCard>
<LinkedCard href="/docs/installation/astro">
<svg
role="img"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
className="w-10 h-10"
fill="currentColor"
>
<title>Astro</title>
<path
d="M16.074 16.86C15.354 17.476 13.917 17.895 12.262 17.895C10.23 17.895 8.527 17.263 8.075 16.412C7.914 16.9 7.877 17.458 7.877 17.814C7.877 17.814 7.771 19.564 8.988 20.782C8.988 20.15 9.501 19.637 10.133 19.637C11.216 19.637 11.215 20.582 11.214 21.349V21.418C11.214 22.582 11.925 23.579 12.937 24C12.7812 23.6794 12.7005 23.3275 12.701 22.971C12.701 21.861 13.353 21.448 14.111 20.968C14.713 20.585 15.383 20.161 15.844 19.308C16.0926 18.8493 16.2225 18.3357 16.222 17.814C16.2221 17.4903 16.1722 17.1685 16.074 16.86ZM15.551 0.6C15.747 0.844 15.847 1.172 16.047 1.829L20.415 16.176C18.7743 15.3246 17.0134 14.7284 15.193 14.408L12.35 4.8C12.3273 4.72337 12.2803 4.65616 12.2162 4.60844C12.152 4.56072 12.0742 4.53505 11.9943 4.53528C11.9143 4.5355 11.8366 4.56161 11.7727 4.60969C11.7089 4.65777 11.6623 4.72524 11.64 4.802L8.83 14.405C7.00149 14.724 5.23264 15.3213 3.585 16.176L7.974 1.827C8.174 1.171 8.274 0.843 8.471 0.6C8.64406 0.385433 8.86922 0.218799 9.125 0.116C9.415 0 9.757 0 10.443 0H13.578C14.264 0 14.608 0 14.898 0.117C15.1529 0.219851 15.3783 0.386105 15.551 0.6Z"
fill="currentColor"
/>
</svg>
<p className="font-medium mt-2">Astro</p>
</LinkedCard>
<LinkedCard href="/docs/installation/manual">
<svg
role="img"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
className="w-10 h-10"
fill="currentColor"
>
<title>React</title>
<path d="M14.23 12.004a2.236 2.236 0 0 1-2.235 2.236 2.236 2.236 0 0 1-2.236-2.236 2.236 2.236 0 0 1 2.235-2.236 2.236 2.236 0 0 1 2.236 2.236zm2.648-10.69c-1.346 0-3.107.96-4.888 2.622-1.78-1.653-3.542-2.602-4.887-2.602-.41 0-.783.093-1.106.278-1.375.793-1.683 3.264-.973 6.365C1.98 8.917 0 10.42 0 12.004c0 1.59 1.99 3.097 5.043 4.03-.704 3.113-.39 5.588.988 6.38.32.187.69.275 1.102.275 1.345 0 3.107-.96 4.888-2.624 1.78 1.654 3.542 2.603 4.887 2.603.41 0 .783-.09 1.106-.275 1.374-.792 1.683-3.263.973-6.365C22.02 15.096 24 13.59 24 12.004c0-1.59-1.99-3.097-5.043-4.032.704-3.11.39-5.587-.988-6.38-.318-.184-.688-.277-1.092-.278zm-.005 1.09v.006c.225 0 .406.044.558.127.666.382.955 1.835.73 3.704-.054.46-.142.945-.25 1.44-.96-.236-2.006-.417-3.107-.534-.66-.905-1.345-1.727-2.035-2.447 1.592-1.48 3.087-2.292 4.105-2.295zm-9.77.02c1.012 0 2.514.808 4.11 2.28-.686.72-1.37 1.537-2.02 2.442-1.107.117-2.154.298-3.113.538-.112-.49-.195-.964-.254-1.42-.23-1.868.054-3.32.714-3.707.19-.09.4-.127.563-.132zm4.882 3.05c.455.468.91.992 1.36 1.564-.44-.02-.89-.034-1.345-.034-.46 0-.915.01-1.36.034.44-.572.895-1.096 1.345-1.565zM12 8.1c.74 0 1.477.034 2.202.093.406.582.802 1.203 1.183 1.86.372.64.71 1.29 1.018 1.946-.308.655-.646 1.31-1.013 1.95-.38.66-.773 1.288-1.18 1.87-.728.063-1.466.098-2.21.098-.74 0-1.477-.035-2.202-.093-.406-.582-.802-1.204-1.183-1.86-.372-.64-.71-1.29-1.018-1.946.303-.657.646-1.313 1.013-1.954.38-.66.773-1.286 1.18-1.868.728-.064 1.466-.098 2.21-.098zm-3.635.254c-.24.377-.48.763-.704 1.16-.225.39-.435.782-.635 1.174-.265-.656-.49-1.31-.676-1.947.64-.15 1.315-.283 2.015-.386zm7.26 0c.695.103 1.365.23 2.006.387-.18.632-.405 1.282-.66 1.933-.2-.39-.41-.783-.64-1.174-.225-.392-.465-.774-.705-1.146zm3.063.675c.484.15.944.317 1.375.498 1.732.74 2.852 1.708 2.852 2.476-.005.768-1.125 1.74-2.857 2.475-.42.18-.88.342-1.355.493-.28-.958-.646-1.956-1.1-2.98.45-1.017.81-2.01 1.085-2.964zm-13.395.004c.278.96.645 1.957 1.1 2.98-.45 1.017-.812 2.01-1.086 2.964-.484-.15-.944-.318-1.37-.5-1.732-.737-2.852-1.706-2.852-2.474 0-.768 1.12-1.742 2.852-2.476.42-.18.88-.342 1.356-.494zm11.678 4.28c.265.657.49 1.312.676 1.948-.64.157-1.316.29-2.016.39.24-.375.48-.762.705-1.158.225-.39.435-.788.636-1.18zm-9.945.02c.2.392.41.783.64 1.175.23.39.465.772.705 1.143-.695-.102-1.365-.23-2.006-.386.18-.63.406-1.282.66-1.933zM17.92 16.32c.112.493.2.968.254 1.423.23 1.868-.054 3.32-.714 3.708-.147.09-.338.128-.563.128-1.012 0-2.514-.807-4.11-2.28.686-.72 1.37-1.536 2.02-2.44 1.107-.118 2.154-.3 3.113-.54zm-11.83.01c.96.234 2.006.415 3.107.532.66.905 1.345 1.727 2.035 2.446-1.595 1.483-3.092 2.295-4.11 2.295-.22-.005-.406-.05-.553-.132-.666-.38-.955-1.834-.73-3.703.054-.46.142-.944.25-1.438zm4.56.64c.44.02.89.034 1.345.034.46 0 .915-.01 1.36-.034-.44.572-.895 1.095-1.345 1.565-.455-.47-.91-.993-1.36-1.565z" />
</svg>
<p className="font-medium mt-2">Manual</p>
</LinkedCard>
</div>
## TypeScript
This project and the components are written in TypeScript. We recommend using TypeScript for your project as well.
However we provide a JavaScript version of the components as well. The JavaScript version is available via the [cli](/docs/cli).
To opt-out of TypeScript, you can use the `tsx` flag in your `components.json` file.
```json {10} title="components.json"
{
"style": "default",
"tailwind": {
"config": "tailwind.config.js",
"css": "src/app/globals.css",
"baseColor": "zinc",
"cssVariables": true
},
"rsc": false,
"tsx": false,
"aliases": {
"utils": "~/lib/utils",
"components": "~/components"
}
}
```
To configure import aliases, you can use the following `jsconfig.json`:
```json {4} title="jsconfig.json"
{
"compilerOptions": {
"paths": {
"@/*": ["./*"]
}
}
}
```

View File

@@ -0,0 +1,243 @@
---
title: Manual Installation
description: Add dependencies to your project manually.
---
<Steps>
### Add Tailwind CSS
Components are styled using Tailwind CSS. You need to install Tailwind CSS in your project.
[Follow the Tailwind CSS installation instructions to get started.](https://tailwindcss.com/docs/installation)
### Add dependencies
Add the following dependencies to your project:
```bash
npm install tailwindcss-animate class-variance-authority clsx tailwind-merge
```
### Add icon library
If you're using the `default` style, install `lucide-react`:
```bash
npm install lucide-react
```
If you're using the `new-york` style, install `@radix-ui/react-icons`:
```bash
npm install @radix-ui/react-icons
```
### Configure path aliases
I use the `@` alias. This is how I configure it in tsconfig.json:
```json {3-6} title="tsconfig.json"
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
}
}
```
The `@` alias is a preference. You can use other aliases if you want.
**If you use a different alias such as ~, you'll need to update import statements when adding components.**
### Configure tailwind.config.js
Here's what my `tailwind.config.js` file looks like:
```js title="tailwind.config.js"
const { fontFamily } = require("tailwindcss/defaultTheme")
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ["class"],
content: ["app/**/*.{ts,tsx}", "components/**/*.{ts,tsx}"],
theme: {
container: {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px",
},
},
extend: {
colors: {
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
destructive: {
DEFAULT: "hsl(var(--destructive))",
foreground: "hsl(var(--destructive-foreground))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
accent: {
DEFAULT: "hsl(var(--accent))",
foreground: "hsl(var(--accent-foreground))",
},
popover: {
DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))",
},
card: {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
},
borderRadius: {
lg: `var(--radius)`,
md: `calc(var(--radius) - 2px)`,
sm: "calc(var(--radius) - 4px)",
},
fontFamily: {
sans: ["var(--font-sans)", ...fontFamily.sans],
},
keyframes: {
"accordion-down": {
from: { height: 0 },
to: { height: "var(--radix-accordion-content-height)" },
},
"accordion-up": {
from: { height: "var(--radix-accordion-content-height)" },
to: { height: 0 },
},
},
animation: {
"accordion-down": "accordion-down 0.2s ease-out",
"accordion-up": "accordion-up 0.2s ease-out",
},
},
},
plugins: [require("tailwindcss-animate")],
}
```
### Configure styles
Add the following to your styles/globals.css file. You can learn more about using CSS variables for theming in the [theming section](/docs/theming).
```css title="styles.css"
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 47.4% 11.2%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 47.4% 11.2%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--card: 0 0% 100%;
--card-foreground: 222.2 47.4% 11.2%;
--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 100% 50%;
--destructive-foreground: 210 40% 98%;
--ring: 215 20.2% 65.1%;
--radius: 0.5rem;
}
.dark {
--background: 224 71% 4%;
--foreground: 213 31% 91%;
--muted: 223 47% 11%;
--muted-foreground: 215.4 16.3% 56.9%;
--accent: 216 34% 17%;
--accent-foreground: 210 40% 98%;
--popover: 224 71% 4%;
--popover-foreground: 215 20.2% 65.1%;
--border: 216 34% 17%;
--input: 216 34% 17%;
--card: 224 71% 4%;
--card-foreground: 213 31% 91%;
--primary: 210 40% 98%;
--primary-foreground: 222.2 47.4% 1.2%;
--secondary: 222.2 47.4% 11.2%;
--secondary-foreground: 210 40% 98%;
--destructive: 0 63% 31%;
--destructive-foreground: 210 40% 98%;
--ring: 216 34% 17%;
--radius: 0.5rem;
}
}
@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
font-feature-settings: "rlig" 1, "calt" 1;
}
}
```
### Add a cn helper
I use a `cn` helper to make it easier to conditionally add Tailwind CSS classes. Here's how I define it in `lib/utils.ts`:
```ts title="lib/utils.ts"
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
```
### That's it
You can now start adding components to your project.
</Steps>

View File

@@ -1,10 +1,8 @@
---
title: Installation
description: How to install dependencies and structure your app.
title: Next.js
description: Install and configure Next.js.
---
## Next.js
<Steps>
### Create project
@@ -28,6 +26,7 @@ npx shadcn-ui@latest init
You will be asked a few questions to configure `components.json`:
```txt showLineNumbers
Would you like to use TypeScript (recommended)? no / yes
Which style would you like to use? Default
Which color would you like to use as base color? Slate
Where is your global CSS file? app/globals.css
@@ -40,7 +39,7 @@ Are you using React Server Components? no / yes
### App structure
Here's how I structure my app. I use Next.js, but this is not required.
Here's how I structure my Next.js apps. You can use this as a reference:
```txt {6-10,14-15}
.
@@ -72,14 +71,26 @@ Here's how I structure my app. I use Next.js, but this is not required.
- The `lib` folder contains all the utility functions. I have a `utils.ts` where I define the `cn` helper.
- The `styles` folder contains the global CSS.
</Steps>
### That's it
That's it. You can now start adding components to your project.
You can now start adding components to your project.
```bash
npx shadcn-ui@latest add
npx shadcn-ui@latest add button
```
## Other frameworks
The command above will add the `Button` component to your project. You can then import it like this:
I'm looking for help writing guides for other frameworks. Help me write guides for Remix, Astro and Vite by [opening an PR](https://github.com/shadcn/ui).
```tsx {1,6} showLineNumbers
import { Button } from "@/components/ui"
export default function Home() {
return (
<div>
<Button>Click me</Button>
</div>
)
}
```
</Steps>

View File

@@ -0,0 +1,117 @@
---
title: Remix
description: Install and configure Remix.
---
<Steps>
### Create project
Start by creating a new Remix project using `create-remix`:
```bash
npx create-remix@latest my-app
```
### Run the CLI
Run the `shadcn-ui` init command to setup your project:
```bash
npx shadcn-ui@latest init
```
### Configure components.json
You will be asked a few questions to configure `components.json`:
```txt showLineNumbers
Would you like to use TypeScript (recommended)? no / yes
Which style would you like to use? Default
Which color would you like to use as base color? Slate
Where is your global CSS file? app/tailwind.css
Do you want to use CSS variables for colors? no / yes
Where is your tailwind.config.js located? tailwind.config.js
Configure the import alias for components: ~/components
Configure the import alias for utils: ~/lib/utils
Are you using React Server Components? no
```
### App structure
<Callout>
**Note**: This app structure is only a suggestion. You can place the files wherever you want.
</Callout>
- Place the UI components in the `app/components/ui` folder.
- Your own components can be placed in the `app/components` folder.
- The `app/lib` folder contains all the utility functions. We have a `utils.ts` where we define the `cn` helper.
- The `app/tailwind.css` file contains the global CSS.
### Install Tailwind CSS
```bash
npm add -D tailwindcss@latest autoprefixer@latest
```
Then we create a `postcss.config.js` file:
```js
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
```
And finally we add the following to our `remix.config.js` file:
```js {4-5}
/** @type {import('@remix-run/dev').AppConfig} */
module.exports = {
...
tailwind: true,
postcss: true,
...
};
```
### Add `tailwind.css` to your app
In your `app/root.tsx` file, import the `tailwind.css` file:
```js {1, 4}
import styles from "./tailwind.css"
export const links: LinksFunction = () => [
{ rel: "stylesheet", href: styles },
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
]
```
### That's it
You can now start adding components to your project.
```bash
npx shadcn-ui@latest add button
```
The command above will add the `Button` component to your project. You can then import it like this:
```tsx {1,6} showLineNumbers
import { Button } from "@/components/ui"
export default function Home() {
return (
<div>
<Button>Click me</Button>
</div>
)
}
```
</Steps>

View File

@@ -0,0 +1,107 @@
---
title: Vite
description: Install and configure Vite.
---
<Steps>
### Create project
Start by creating a new React project using `vite`:
```bash
npm create vite@latest
```
### Add Tailwind and its configuration
Install `tailwindcss` and its peer dependencies, then generate your `tailwind.config.js` and `postcss.config.js` files:
```bash
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
```
### Edit tsconfig.json
Add the code below to the compilerOptions of your tsconfig.json so your app can resolve paths without error
```typescript
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
```
### Update vite.config.ts
Add the code below to the vite.config.ts so your app can resolve paths without error
```bash
# (so you can import "path" without error)
npm i -D @types/node
```
```typescript
import path from "path"
import react from "@vitejs/plugin-react"
import { defineConfig } from "vite"
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
})
```
### Run the CLI
Run the `shadcn-ui` init command to setup your project:
```bash
npx shadcn-ui@latest init
```
### Configure components.json
You will be asked a few questions to configure `components.json`:
```txt showLineNumbers
Would you like to use TypeScript (recommended)? no / yes
Which style would you like to use? Default
Which color would you like to use as base color? Slate
Where is your global CSS file? src/index.css
Do you want to use CSS variables for colors? no / yes
Where is your tailwind.config.js located? tailwind.config.js
Configure the import alias for components: @/components
Configure the import alias for utils: @/lib/utils
Are you using React Server Components? no / yes (no)
```
### That's it
You can now start adding components to your project.
```bash
npx shadcn-ui@latest add button
```
The command above will add the `Button` component to your project. You can then import it like this:
```tsx {1,6} showLineNumbers
import { Button } from "@/components/ui"
export default function Home() {
return (
<div>
<Button>Click me</Button>
</div>
)
}
```
</Steps>

View File

@@ -44,7 +44,10 @@ export function rehypeNpmCommand() {
const npmCommand = node.properties?.["__rawString__"]
node.properties["__npmCommand__"] = npmCommand
node.properties["__yarnCommand__"] = npmCommand
node.properties["__pnpmCommand__"] = npmCommand.replace("npx", "pnpx")
node.properties["__pnpmCommand__"] = npmCommand.replace(
"npx",
"pnpm dlx"
)
}
})
}

View File

@@ -53,13 +53,14 @@
"class-variance-authority": "^0.4.0",
"clsx": "^1.2.1",
"cmdk": "^0.2.0",
"contentlayer": "0.3.3",
"contentlayer": "0.3.4",
"date-fns": "^2.30.0",
"jotai": "^2.1.0",
"lodash.template": "^4.5.0",
"lucide-react": "0.214.0",
"next": "13.4.6",
"next-contentlayer": "0.3.3",
"markdown-wasm": "^1.2.0",
"next": "13.4.8",
"next-contentlayer": "0.3.4",
"next-themes": "^0.2.1",
"react": "^18.2.0",
"react-day-picker": "^8.7.1",

View File

@@ -6,7 +6,7 @@
"files": [
{
"name": "accordion.tsx",
"content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\"\nimport { ChevronDown } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Accordion = AccordionPrimitive.Root\n\nconst AccordionItem = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item\n ref={ref}\n className={cn(\"border-b\", className)}\n {...props}\n />\n))\nAccordionItem.displayName = \"AccordionItem\"\n\nconst AccordionTrigger = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown className=\"h-4 w-4 transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n))\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName\n\nconst AccordionContent = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className={cn(\n \"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\",\n className\n )}\n {...props}\n >\n <div className=\"pb-4 pt-0\">{children}</div>\n </AccordionPrimitive.Content>\n))\nAccordionContent.displayName = AccordionPrimitive.Content.displayName\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent }\n"
"content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\"\nimport { ChevronDown } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Accordion = AccordionPrimitive.Root\n\nconst AccordionItem = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item\n ref={ref}\n className={cn(\"border-b\", className)}\n {...props}\n />\n))\nAccordionItem.displayName = \"AccordionItem\"\n\nconst AccordionTrigger = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown className=\"h-4 w-4 shrink-0 transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n))\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName\n\nconst AccordionContent = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className={cn(\n \"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\",\n className\n )}\n {...props}\n >\n <div className=\"pb-4 pt-0\">{children}</div>\n </AccordionPrimitive.Content>\n))\nAccordionContent.displayName = AccordionPrimitive.Content.displayName\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent }\n"
}
],
"type": "components:ui"

View File

@@ -6,7 +6,7 @@
"files": [
{
"name": "accordion.tsx",
"content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\"\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Accordion = AccordionPrimitive.Root\n\nconst AccordionItem = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item\n ref={ref}\n className={cn(\"border-b\", className)}\n {...props}\n />\n))\nAccordionItem.displayName = \"AccordionItem\"\n\nconst AccordionTrigger = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"h-4 w-4 text-muted-foreground transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n))\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName\n\nconst AccordionContent = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className={cn(\n \"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\",\n className\n )}\n {...props}\n >\n <div className=\"pb-4 pt-0\">{children}</div>\n </AccordionPrimitive.Content>\n))\nAccordionContent.displayName = AccordionPrimitive.Content.displayName\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent }\n"
"content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\"\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Accordion = AccordionPrimitive.Root\n\nconst AccordionItem = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item\n ref={ref}\n className={cn(\"border-b\", className)}\n {...props}\n />\n))\nAccordionItem.displayName = \"AccordionItem\"\n\nconst AccordionTrigger = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n))\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName\n\nconst AccordionContent = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className={cn(\n \"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\",\n className\n )}\n {...props}\n >\n <div className=\"pb-4 pt-0\">{children}</div>\n </AccordionPrimitive.Content>\n))\nAccordionContent.displayName = AccordionPrimitive.Content.displayName\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent }\n"
}
],
"type": "components:ui"

View File

@@ -27,6 +27,9 @@
"rsc": {
"type": "boolean"
},
"tsx": {
"type": "boolean"
},
"aliases": {
"type": "object",
"properties": {

View File

@@ -34,7 +34,7 @@ const AccordionTrigger = React.forwardRef<
{...props}
>
{children}
<ChevronDown className="h-4 w-4 transition-transform duration-200" />
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
</AccordionPrimitive.Trigger>
</AccordionPrimitive.Header>
))

View File

@@ -34,7 +34,7 @@ const AccordionTrigger = React.forwardRef<
{...props}
>
{children}
<ChevronDownIcon className="h-4 w-4 text-muted-foreground transition-transform duration-200" />
<ChevronDownIcon className="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" />
</AccordionPrimitive.Trigger>
</AccordionPrimitive.Header>
))

View File

@@ -65,3 +65,7 @@
[data-rehype-pretty-code-title] + pre {
@apply mt-2;
}
.mdx > .steps:first-child > h3:first-child {
@apply mt-0;
}

View File

@@ -1,5 +1,17 @@
# @shadcn/ui
## 0.3.0
### Minor Changes
- [#834](https://github.com/shadcn/ui/pull/834) [`edc653c`](https://github.com/shadcn/ui/commit/edc653c01e6d4d5a51f3e414f2aeeb77af758257) Thanks [@shadcn](https://github.com/shadcn)! - add support for jsx
## 0.2.3
### Patch Changes
- [#707](https://github.com/shadcn/ui/pull/707) [`c337753`](https://github.com/shadcn/ui/commit/c3377530f43baa95c9e41cce7c07b1a4db1e3ee6) Thanks [@MarkLyck](https://github.com/MarkLyck)! - fix(cli): use bun add when bun detected
## 0.2.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "shadcn-ui",
"version": "0.2.2",
"version": "0.3.0",
"description": "Add components to your apps.",
"publishConfig": {
"access": "public"
@@ -45,6 +45,9 @@
},
"dependencies": {
"@antfu/ni": "^0.21.4",
"@babel/core": "^7.22.1",
"@babel/parser": "^7.22.6",
"@babel/plugin-transform-typescript": "^7.22.5",
"chalk": "5.2.0",
"commander": "^10.0.0",
"cosmiconfig": "^8.1.3",
@@ -52,16 +55,20 @@
"execa": "^7.0.0",
"fs-extra": "^11.1.0",
"https-proxy-agent": "^6.2.0",
"lodash.template": "^4.5.0",
"node-fetch": "^3.3.0",
"ora": "^6.1.2",
"prompts": "^2.4.2",
"recast": "^0.23.2",
"ts-morph": "^18.0.0",
"tsconfig-paths": "^4.2.0",
"zod": "^3.20.2"
},
"devDependencies": {
"@types/babel__core": "^7.20.1",
"@types/diff": "^5.0.3",
"@types/fs-extra": "^11.0.1",
"@types/lodash.template": "^4.5.1",
"@types/prompts": "^2.4.2",
"rimraf": "^4.1.3",
"tsup": "^6.6.3",

Some files were not shown because too many files have changed in this diff Show More