Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: www updates #5688

Merged
merged 2 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/www/app/(app)/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default async function DocPage({ params }: DocPageProps) {

return (
<main className="relative py-6 lg:gap-10 lg:py-8 xl:grid xl:grid-cols-[1fr_300px]">
<div className="mx-auto w-full min-w-0">
<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" />
Expand Down Expand Up @@ -137,7 +137,7 @@ export default async function DocPage({ params }: DocPageProps) {
<DocsPager doc={doc} />
</div>
<div className="hidden text-sm xl:block">
<div className="sticky top-16 -mt-10 h-[calc(100vh-3.5rem)] pt-4">
<div className="sticky top-20 -mt-6 h-[calc(100vh-3.5rem)] pt-4">
<ScrollArea className="h-full pb-10">
{doc.toc && <DashboardTableOfContents toc={toc} />}
<OpenInV0Cta className="mt-6 max-w-[80%]" />
Expand Down
2 changes: 1 addition & 1 deletion apps/www/app/(app)/docs/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface DocsLayoutProps {

export default function DocsLayout({ children }: DocsLayoutProps) {
return (
<div className="border-b">
<div className="border-b border-border/40 dark:border-border">
<div className="container flex-1 items-start md:grid md:grid-cols-[220px_minmax(0,1fr)] md:gap-6 lg:grid-cols-[240px_minmax(0,1fr)] lg:gap-10">
<aside className="fixed top-14 z-30 -ml-2 hidden h-[calc(100vh-3.5rem)] w-full shrink-0 md:sticky md:block">
<ScrollArea className="h-full py-6 pr-6 lg:py-8">
Expand Down
4 changes: 2 additions & 2 deletions apps/www/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ interface AppLayoutProps {

export default function AppLayout({ children }: AppLayoutProps) {
return (
<>
<div className="mx-auto w-full border-border/40 dark:border-border min-[1800px]:max-w-[1536px] min-[1800px]:border-x">
<SiteHeader />
<main className="flex-1">{children}</main>
<SiteFooter />
</>
</div>
)
}
2 changes: 1 addition & 1 deletion apps/www/app/(app)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function IndexPage() {
<PageHeaderHeading>Build your component library</PageHeaderHeading>
<PageHeaderDescription>
Beautifully designed components that you can copy and paste into your
apps.
apps. Made with Tailwind CSS. Open source.
</PageHeaderDescription>
<PageActions>
<Button asChild size="sm">
Expand Down
7 changes: 1 addition & 6 deletions apps/www/components/examples-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ScrollArea, ScrollBar } from "@/registry/new-york/ui/scroll-area"
const examples = [
{
name: "Examples",
href: "/",
href: "/examples/cards",
code: "https://github.com/shadcn/ui/tree/main/apps/www/app/(app)/examples/mail",
},
{
Expand All @@ -23,11 +23,6 @@ const examples = [
href: "/examples/dashboard",
code: "https://github.com/shadcn/ui/tree/main/apps/www/app/(app)/examples/dashboard",
},
{
name: "Cards",
href: "/examples/cards",
code: "https://github.com/shadcn/ui/tree/main/apps/www/app/(app)/examples/cards",
},
{
name: "Tasks",
href: "/examples/tasks",
Expand Down
37 changes: 11 additions & 26 deletions apps/www/components/mobile-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as React from "react"
import Link, { LinkProps } from "next/link"
import { useRouter } from "next/navigation"
import { ViewVerticalIcon } from "@radix-ui/react-icons"
import { MenuIcon } from "lucide-react"

import { docsConfig } from "@/config/docs"
import { siteConfig } from "@/config/site"
Expand All @@ -21,36 +21,21 @@ export function MobileNav() {
<SheetTrigger asChild>
<Button
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"
className="-ml-2 mr-2 h-8 w-8 px-0 text-base hover:bg-transparent focus-visible:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 md:hidden"
>
<svg
strokeWidth="1.5"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="h-5 w-5"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
className="size-6"
>
<path
d="M3 5H11"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
></path>
<path
d="M3 12H16"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
></path>
<path
d="M3 19H21"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
></path>
stroke-linecap="round"
stroke-linejoin="round"
d="M3.75 9h16.5m-16.5 6.75h16.5"
/>
</svg>
<span className="sr-only">Toggle Menu</span>
</Button>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/components/mode-toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client"

import * as React from "react"
import { MoonIcon, SunIcon } from "@radix-ui/react-icons"
import { MoonIcon, SunIcon } from "lucide-react"
import { useTheme } from "next-themes"

import { Button } from "@/registry/new-york/ui/button"
Expand Down
29 changes: 13 additions & 16 deletions apps/www/components/pager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { Doc } from "contentlayer/generated"
import { NavItem, NavItemWithChildren } from "types/nav"

import { docsConfig } from "@/config/docs"
import { cn } from "@/lib/utils"
import { buttonVariants } from "@/registry/new-york/ui/button"
import { Button } from "@/registry/new-york/ui/button"

interface DocsPagerProps {
doc: Doc
Expand All @@ -21,22 +20,20 @@ export function DocsPager({ doc }: DocsPagerProps) {
return (
<div className="flex flex-row items-center justify-between">
{pager?.prev?.href && (
<Link
href={pager.prev.href}
className={buttonVariants({ variant: "outline" })}
>
<ChevronLeftIcon className="mr-2 h-4 w-4" />
{pager.prev.title}
</Link>
<Button variant="ghost" asChild>
<Link href={pager.prev.href}>
<ChevronLeftIcon />
{pager.prev.title}
</Link>
</Button>
)}
{pager?.next?.href && (
<Link
href={pager.next.href}
className={cn(buttonVariants({ variant: "outline" }), "ml-auto")}
>
{pager.next.title}
<ChevronRightIcon className="ml-2 h-4 w-4" />
</Link>
<Button variant="ghost" className="ml-auto" asChild>
<Link href={pager.next.href}>
{pager.next.title}
<ChevronRightIcon />
</Link>
</Button>
)}
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion apps/www/components/site-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { buttonVariants } from "@/registry/new-york/ui/button"

export function SiteHeader() {
return (
<header className="sticky top-0 z-50 w-full border-border/40 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
<header className="sticky top-0 z-50 w-full border-b border-border/40 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 dark:border-border">
<div className="container flex h-14 max-w-screen-2xl items-center">
<MainNav />
<MobileNav />
Expand Down
Binary file modified apps/www/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/www/public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/www/public/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion apps/www/public/r/styles/new-york/accordion.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"files": [
{
"path": "ui/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 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=\"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{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 text-left [&[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=\"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n))\nAccordionContent.displayName = AccordionPrimitive.Content.displayName\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent }\n",
"type": "registry:ui",
"target": ""
}
Expand Down
6 changes: 3 additions & 3 deletions apps/www/registry/new-york/example/cards/activity-goal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client"

import * as React from "react"
import { MinusIcon, PlusIcon } from "@radix-ui/react-icons"
import { MinusIcon, PlusIcon } from "lucide-react"
import { useTheme } from "next-themes"
import { Bar, BarChart, ResponsiveContainer } from "recharts"

Expand Down Expand Up @@ -87,7 +87,7 @@ export function CardsActivityGoal() {
onClick={() => onClick(-10)}
disabled={goal <= 200}
>
<MinusIcon className="h-4 w-4" />
<MinusIcon />
<span className="sr-only">Decrease</span>
</Button>
<div className="flex-1 text-center">
Expand All @@ -103,7 +103,7 @@ export function CardsActivityGoal() {
onClick={() => onClick(10)}
disabled={goal >= 400}
>
<PlusIcon className="h-4 w-4" />
<PlusIcon />
<span className="sr-only">Increase</span>
</Button>
</div>
Expand Down
6 changes: 3 additions & 3 deletions apps/www/registry/new-york/example/cards/chat.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client"

import * as React from "react"
import { CheckIcon, PaperPlaneIcon, PlusIcon } from "@radix-ui/react-icons"
import { CheckIcon, PlusIcon, SendIcon } from "lucide-react"

import { cn } from "@/lib/utils"
import {
Expand Down Expand Up @@ -118,7 +118,7 @@ export function CardsChat() {
className="ml-auto rounded-full"
onClick={() => setOpen(true)}
>
<PlusIcon className="h-4 w-4" />
<PlusIcon />
<span className="sr-only">New message</span>
</Button>
</TooltipTrigger>
Expand Down Expand Up @@ -168,7 +168,7 @@ export function CardsChat() {
onChange={(event) => setInput(event.target.value)}
/>
<Button type="submit" size="icon" disabled={inputLength === 0}>
<PaperPlaneIcon className="h-4 w-4" />
<SendIcon className="h-4 w-4" />
<span className="sr-only">Send</span>
</Button>
</form>
Expand Down
20 changes: 5 additions & 15 deletions apps/www/registry/new-york/example/cards/data-table.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
"use client"

import * as React from "react"
import {
CaretSortIcon,
ChevronDownIcon,
DotsHorizontalIcon,
} from "@radix-ui/react-icons"
import {
ColumnDef,
ColumnFiltersState,
Expand All @@ -18,6 +13,7 @@ import {
getSortedRowModel,
useReactTable,
} from "@tanstack/react-table"
import { ChevronsUpDownIcon, MoreHorizontalIcon } from "lucide-react"

import { Button } from "@/registry/new-york/ui/button"
import {
Expand Down Expand Up @@ -66,12 +62,6 @@ const data: Payment[] = [
status: "processing",
email: "[email protected]",
},
{
id: "5kma53ae",
amount: 874,
status: "success",
email: "[email protected]",
},
{
id: "bhqecj4p",
amount: 721,
Expand Down Expand Up @@ -126,7 +116,7 @@ export const columns: ColumnDef<Payment>[] = [
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
>
Email
<CaretSortIcon className="ml-2 h-4 w-4" />
<ChevronsUpDownIcon className="size-3" />
</Button>
)
},
Expand Down Expand Up @@ -158,7 +148,7 @@ export const columns: ColumnDef<Payment>[] = [
<DropdownMenuTrigger asChild>
<Button variant="ghost" className="h-8 w-8 p-0">
<span className="sr-only">Open menu</span>
<DotsHorizontalIcon className="h-4 w-4" />
<MoreHorizontalIcon />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
Expand Down Expand Up @@ -209,7 +199,7 @@ export function CardsDataTable() {
return (
<Card>
<CardHeader>
<CardTitle>Payments</CardTitle>
<CardTitle className="text-xl">Payments</CardTitle>
<CardDescription>Manage your payments.</CardDescription>
</CardHeader>
<CardContent>
Expand All @@ -225,7 +215,7 @@ export function CardsDataTable() {
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline" className="ml-auto">
Columns <ChevronDownIcon className="ml-2 h-4 w-4" />
Columns <ChevronsUpDownIcon />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
Expand Down
6 changes: 4 additions & 2 deletions apps/www/registry/new-york/example/cards/report-issue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ export function CardsReportIssue() {
</div>
</CardContent>
<CardFooter className="justify-between space-x-2">
<Button variant="ghost">Cancel</Button>
<Button>Submit</Button>
<Button variant="ghost" size="sm">
Cancel
</Button>
<Button size="sm">Submit</Button>
</CardFooter>
</Card>
)
Expand Down
2 changes: 1 addition & 1 deletion apps/www/registry/new-york/example/cards/stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function CardsStats() {
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-normal">Total Revenue</CardTitle>
</CardHeader>
<CardContent>
<CardContent className="pb-0">
<div className="text-2xl font-bold">$15,231.89</div>
<p className="text-xs text-muted-foreground">
+20.1% from last month
Expand Down
2 changes: 1 addition & 1 deletion apps/www/registry/new-york/example/cards/team-members.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import { ChevronDownIcon } from "@radix-ui/react-icons"
import { ChevronDownIcon } from "lucide-react"

import {
Avatar,
Expand Down
2 changes: 1 addition & 1 deletion apps/www/registry/new-york/ui/accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const AccordionTrigger = React.forwardRef<
<AccordionPrimitive.Trigger
ref={ref}
className={cn(
"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",
className
)}
{...props}
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px",
"2xl": "1536px",
},
},
extend: {
Expand Down
Loading