Skip to content

Commit

Permalink
chore(www): migrate all radix icons to lucide
Browse files Browse the repository at this point in the history
  • Loading branch information
shadcn committed Nov 4, 2024
1 parent fae5035 commit bd02e24
Show file tree
Hide file tree
Showing 30 changed files with 119 additions and 169 deletions.
8 changes: 4 additions & 4 deletions apps/www/app/(app)/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { allDocs } from "contentlayer/generated"
import "@/styles/mdx.css"
import type { Metadata } from "next"
import Link from "next/link"
import { ChevronRightIcon, ExternalLinkIcon } from "@radix-ui/react-icons"
import { ChevronRight, ExternalLink } from "lucide-react"
import Balancer from "react-wrap-balancer"

import { siteConfig } from "@/config/site"
Expand Down Expand Up @@ -92,7 +92,7 @@ export default async function DocPage({ params }: DocPageProps) {
<div className="mx-auto w-full min-w-0 max-w-3xl">
<div className="mb-4 flex items-center space-x-1 text-sm leading-none text-muted-foreground">
<div className="truncate">Docs</div>
<ChevronRightIcon className="h-3.5 w-3.5" />
<ChevronRight className="h-3.5 w-3.5" />
<div className="text-foreground">{doc.title}</div>
</div>
<div className="space-y-2">
Expand All @@ -115,7 +115,7 @@ export default async function DocPage({ params }: DocPageProps) {
className={cn(badgeVariants({ variant: "secondary" }), "gap-1")}
>
Docs
<ExternalLinkIcon className="h-3 w-3" />
<ExternalLink className="h-3 w-3" />
</Link>
)}
{doc.links?.api && (
Expand All @@ -126,7 +126,7 @@ export default async function DocPage({ params }: DocPageProps) {
className={cn(badgeVariants({ variant: "secondary" }), "gap-1")}
>
API Reference
<ExternalLinkIcon className="h-3 w-3" />
<ExternalLink className="h-3 w-3" />
</Link>
)}
</div>
Expand Down
17 changes: 6 additions & 11 deletions apps/www/app/(app)/examples/cards/components/github-card.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
ChevronDownIcon,
CircleIcon,
PlusIcon,
StarIcon,
} from "@radix-ui/react-icons"
import { ChevronDown, Circle, Plus, Star } from "lucide-react"

import { Button } from "@/registry/new-york/ui/button"
import {
Expand Down Expand Up @@ -37,14 +32,14 @@ export function DemoGithub() {
</div>
<div className="flex items-center space-x-1 rounded-md bg-secondary text-secondary-foreground">
<Button variant="secondary" className="px-3 shadow-none">
<StarIcon className="mr-2 h-4 w-4" />
<Star />
Star
</Button>
<Separator orientation="vertical" className="h-[20px]" />
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="secondary" className="px-2 shadow-none">
<ChevronDownIcon className="h-4 w-4 text-secondary-foreground" />
<ChevronDown className="text-secondary-foreground" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent
Expand All @@ -62,7 +57,7 @@ export function DemoGithub() {
<DropdownMenuCheckboxItem>Inspiration</DropdownMenuCheckboxItem>
<DropdownMenuSeparator />
<DropdownMenuItem>
<PlusIcon className="mr-2 h-4 w-4" /> Create List
<Plus /> Create List
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
Expand All @@ -71,11 +66,11 @@ export function DemoGithub() {
<CardContent>
<div className="flex space-x-4 text-sm text-muted-foreground">
<div className="flex items-center">
<CircleIcon className="mr-1 h-3 w-3 fill-sky-400 text-sky-400" />
<Circle className="mr-1 h-3 w-3 fill-sky-400 text-sky-400" />
TypeScript
</div>
<div className="flex items-center">
<StarIcon className="mr-1 h-3 w-3" />
<Star className="mr-1 h-3 w-3" />
20k
</div>
<div>Updated April 2023</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BellIcon, EyeNoneIcon, PersonIcon } from "@radix-ui/react-icons"
import { Bell, EyeOff, User } from "lucide-react"

import {
Card,
Expand All @@ -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">
<BellIcon className="mt-px h-5 w-5" />
<Bell 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">
Expand All @@ -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">
<PersonIcon className="mt-px h-5 w-5" />
<User 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">
Expand All @@ -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">
<EyeNoneIcon className="mt-px h-5 w-5" />
<EyeOff 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">
Expand Down
8 changes: 3 additions & 5 deletions apps/www/app/(app)/examples/cards/components/team-members.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChevronDownIcon } from "@radix-ui/react-icons"
import { ChevronDown } from "lucide-react"

import {
Avatar,
Expand Down Expand Up @@ -51,8 +51,7 @@ export function DemoTeamMembers() {
<Popover>
<PopoverTrigger asChild>
<Button variant="outline" className="ml-auto">
Owner{" "}
<ChevronDownIcon className="ml-2 h-4 w-4 text-muted-foreground" />
Owner <ChevronDown className="text-muted-foreground" />
</Button>
</PopoverTrigger>
<PopoverContent className="p-0" align="end">
Expand Down Expand Up @@ -105,8 +104,7 @@ export function DemoTeamMembers() {
<Popover>
<PopoverTrigger asChild>
<Button variant="outline" className="ml-auto">
Member{" "}
<ChevronDownIcon className="ml-2 h-4 w-4 text-muted-foreground" />
Member <ChevronDown className="text-muted-foreground" />
</Button>
</PopoverTrigger>
<PopoverContent className="p-0" align="end">
Expand Down
Original file line number Diff line number Diff line change
@@ -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 { CalendarIcon } from "lucide-react"
import { DateRange } from "react-day-picker"

import { cn } from "@/lib/utils"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
"use client"

import * as React from "react"
import {
CaretSortIcon,
CheckIcon,
PlusCircledIcon,
} from "@radix-ui/react-icons"
import { Check, ChevronsUpDown, PlusCircle } from "lucide-react"

import { cn } from "@/lib/utils"
import {
Expand Down Expand Up @@ -105,7 +101,7 @@ export default function TeamSwitcher({ className }: TeamSwitcherProps) {
<AvatarFallback>SC</AvatarFallback>
</Avatar>
{selectedTeam.label}
<CaretSortIcon className="ml-auto h-4 w-4 shrink-0 opacity-50" />
<ChevronsUpDown className="ml-auto opacity-50" />
</Button>
</PopoverTrigger>
<PopoverContent className="w-[200px] p-0">
Expand Down Expand Up @@ -133,9 +129,9 @@ export default function TeamSwitcher({ className }: TeamSwitcherProps) {
<AvatarFallback>SC</AvatarFallback>
</Avatar>
{team.label}
<CheckIcon
<Check
className={cn(
"ml-auto h-4 w-4",
"ml-auto",
selectedTeam.value === team.value
? "opacity-100"
: "opacity-0"
Expand All @@ -156,7 +152,7 @@ export default function TeamSwitcher({ className }: TeamSwitcherProps) {
setShowNewTeamDialog(true)
}}
>
<PlusCircledIcon className="mr-2 h-5 w-5" />
<PlusCircle className="h-5 w-5" />
Create Team
</CommandItem>
</DialogTrigger>
Expand Down
8 changes: 4 additions & 4 deletions apps/www/app/(app)/examples/forms/account/account-form.tsx
Original file line number Diff line number Diff line change
@@ -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 { z } from "zod"

Expand Down Expand Up @@ -174,7 +174,7 @@ export function AccountForm() {
(language) => language.value === field.value
)?.label
: "Select language"}
<CaretSortIcon className="ml-2 h-4 w-4 shrink-0 opacity-50" />
<ChevronsUpDown className="opacity-50" />
</Button>
</FormControl>
</PopoverTrigger>
Expand All @@ -192,9 +192,9 @@ export function AccountForm() {
form.setValue("language", language.value)
}}
>
<CheckIcon
<Check
className={cn(
"mr-2 h-4 w-4",
"mr-2",
language.value === field.value
? "opacity-100"
: "opacity-0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client"

import { zodResolver } from "@hookform/resolvers/zod"
import { ChevronDownIcon } from "@radix-ui/react-icons"
import { ChevronDown } from "lucide-react"
import { useForm } from "react-hook-form"
import { z } from "zod"

Expand Down Expand Up @@ -76,7 +76,7 @@ export function AppearanceForm() {
<option value="system">System</option>
</select>
</FormControl>
<ChevronDownIcon className="absolute right-3 top-2.5 h-4 w-4 opacity-50" />
<ChevronDown 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Image from "next/image"
import { PlusCircledIcon } from "@radix-ui/react-icons"
import { PlusCircle } from "lucide-react"

import { cn } from "@/lib/utils"
import {
Expand Down Expand Up @@ -54,7 +54,7 @@ export function AlbumArtwork({
<ContextMenuSubTrigger>Add to Playlist</ContextMenuSubTrigger>
<ContextMenuSubContent className="w-48">
<ContextMenuItem>
<PlusCircledIcon className="mr-2 h-4 w-4" />
<PlusCircle className="mr-2 h-4 w-4" />
New Playlist
</ContextMenuItem>
<ContextMenuSeparator />
Expand Down
4 changes: 2 additions & 2 deletions apps/www/app/(app)/examples/music/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Metadata } from "next"
import Image from "next/image"
import { PlusCircledIcon } from "@radix-ui/react-icons"
import { PlusCircle } from "lucide-react"

import { Button } from "@/registry/new-york/ui/button"
import { ScrollArea, ScrollBar } from "@/registry/new-york/ui/scroll-area"
Expand Down Expand Up @@ -64,7 +64,7 @@ export default function MusicPage() {
</TabsList>
<div className="ml-auto mr-4">
<Button>
<PlusCircledIcon className="mr-2 h-4 w-4" />
<PlusCircle />
Add music
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -64,7 +64,7 @@ export function ModelSelector({ models, types, ...props }: ModelSelectorProps) {
className="w-full justify-between"
>
{selectedModel ? selectedModel.name : "Select a model..."}
<CaretSortIcon className="ml-2 h-4 w-4 shrink-0 opacity-50" />
<ChevronsUpDown className="opacity-50" />
</Button>
</PopoverTrigger>
<PopoverContent align="end" className="w-[250px] p-0">
Expand Down Expand Up @@ -154,11 +154,8 @@ function ModelItem({ model, isSelected, onSelect, onPeek }: ModelItemProps) {
className="data-[selected=true]:bg-primary data-[selected=true]:text-primary-foreground"
>
{model.name}
<CheckIcon
className={cn(
"ml-auto h-4 w-4",
isSelected ? "opacity-100" : "opacity-0"
)}
<Check
className={cn("ml-auto", isSelected ? "opacity-100" : "opacity-0")}
/>
</CommandItem>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import * as React from "react"
import { Dialog } from "@radix-ui/react-dialog"
import { DotsHorizontalIcon } from "@radix-ui/react-icons"
import { MoreHorizontal } from "lucide-react"

import { toast } from "@/registry/new-york/hooks/use-toast"
import {
Expand Down Expand Up @@ -40,9 +40,9 @@ export function PresetActions() {
<>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="secondary">
<Button variant="secondary" size="icon">
<span className="sr-only">Actions</span>
<DotsHorizontalIcon className="h-4 w-4" />
<MoreHorizontal />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -43,7 +43,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..."}
<CaretSortIcon className="ml-2 h-4 w-4 shrink-0 opacity-50" />
<ChevronsUpDown className="opacity-50" />
</Button>
</PopoverTrigger>
<PopoverContent className="w-[300px] p-0">
Expand All @@ -61,9 +61,9 @@ export function PresetSelector({ presets, ...props }: PresetSelectorProps) {
}}
>
{preset.name}
<CheckIcon
<Check
className={cn(
"ml-auto h-4 w-4",
"ml-auto",
selectedPreset?.id === preset.id
? "opacity-100"
: "opacity-0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CopyIcon } from "@radix-ui/react-icons"
import { Copy } from "lucide-react"

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

0 comments on commit bd02e24

Please sign in to comment.