Skip to content
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
11 changes: 0 additions & 11 deletions apps/design-system/__registry__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,6 @@ export const Index: Record<string, any> = {
subcategory: "undefined",
chunks: []
},
"ConfirmDialog": {
name: "ConfirmDialog",
type: "components:fragment",
registryDependencies: undefined,
component: React.lazy(() => import("@/../../packages/ui-patterns/src/Dialogs/ConfirmDialog")),
source: "",
files: ["registry/default//Dialogs/ConfirmDialog.tsx"],
category: "undefined",
subcategory: "undefined",
chunks: []
},
"PageContainer": {
name: "PageContainer",
type: "components:fragment",
Expand Down
14 changes: 7 additions & 7 deletions apps/design-system/app/(app)/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SourcePanel } from '@/components/source-panel'
import { DashboardTableOfContents } from '@/components/toc'
import { siteConfig } from '@/config/site'
import { getTableOfContents } from '@/lib/toc'
import { absoluteUrl, cn } from '@/lib/utils'
import { absoluteUrl } from '@/lib/utils'
import '@/styles/code-block-variables.css'
import '@/styles/mdx.css'
import { allDocs } from 'contentlayer/generated'
Expand Down Expand Up @@ -83,15 +83,15 @@ export default async function DocPage(props: DocPageProps) {
const toc = await getTableOfContents(doc.body.raw)

return (
<main className="relative lg:gap-10 xl:grid xl:grid-cols-[1fr_200px] pr-6 lg:py-8">
<div className="mx-auto w-full min-w-0 max-w-4xl">
<div className="relative xl:grid xl:grid-cols-[1fr_160px] gap-4 px-6 py-6 lg:py-8">
<div className="mx-auto w-full min-w-0 max-w-4xl flex-1">
<div className="mb-4 flex items-center space-x-1 text-sm text-foreground-muted">
<div className="overflow-hidden text-ellipsis whitespace-nowrap">Docs</div>
<ChevronRight className="h-4 w-4 text-foreground-muted" />
<div className="text-foreground-lighter">{doc.title}</div>
</div>
<div className="space-y-2 mb-5">
<h1 className={cn('scroll-m-20 text-4xl tracking-tight')}>{doc.title}</h1>
<h1 className="scroll-m-20 text-4xl tracking-tight">{doc.title}</h1>
{doc.description && (
<p className="text-lg text-foreground-light">
<Balancer>{doc.description}</Balancer>
Expand All @@ -107,15 +107,15 @@ export default async function DocPage(props: DocPageProps) {
</div>
{doc.toc && (
<div className="hidden text-sm xl:block">
<div className="sticky top-16 -mt-10 pt-4">
<div className="sticky top-8 -mt-10 pt-8">
<ScrollArea className="pb-10">
<div className="sticky top-16 -mt-10 h-[calc(100vh-3.5rem)] py-12">
<div className="h-[calc(100vh-3.5rem)] py-14">
<DashboardTableOfContents toc={toc} />
</div>
</ScrollArea>
</div>
</div>
)}
</main>
</div>
)
}
36 changes: 15 additions & 21 deletions apps/design-system/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
import SideNavigation from '@/components/side-navigation'
import { SideNavigation } from '@/components/side-navigation'
import { SiteFooter } from '@/components/site-footer'
// import ThemeSettings from '@/components/theme-settings'
import TopNavigation from '@/components/top-navigation'
import { TopNavigation } from '@/components/top-navigation'
import { MobileSidebarSheet } from '@/components/mobile-sidebar-sheet'
import { ScrollArea } from 'ui'

interface AppLayoutProps {
children: React.ReactNode
}

export default function AppLayout({ children }: AppLayoutProps) {
export default async function AppLayout({ children }: AppLayoutProps) {
return (
<>
<TopNavigation />
{/* main container */}
<div className="">
{/* main content */}
<main className="flex-1 max-w-site mx-auto w-full border-l border-r">
{/* {children} */}
<div className="border-b">
<div className="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-10 z-30 hidden h-[calc(100vh-3rem)] w-full shrink-0 md:sticky md:block border-r">
<ScrollArea className="h-full py-6 lg:py-8">
<SideNavigation />
</ScrollArea>
</aside>
{children}
</div>
</div>
</main>
</div>
<MobileSidebarSheet />
<main className="flex-1 max-w-site mx-auto w-full border-l border-r border-b">
<div className="flex-1 items-start md:grid md:grid-cols-[220px_minmax(0,1fr)] lg:grid-cols-[240px_minmax(0,1fr)]">
<aside className="fixed top-10 z-30 hidden h-[calc(100vh-3rem)] w-full shrink-0 md:sticky md:block border-r">
<ScrollArea className="h-full">
<SideNavigation />
</ScrollArea>
</aside>
{children}
</div>
</main>
<SiteFooter />
</>
)
Expand Down
124 changes: 52 additions & 72 deletions apps/design-system/app/(app)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,85 +1,59 @@
import { HomepageSvgHandler } from '@/components/homepage-svg-handler'
import Link from 'next/link'
import { Paintbrush } from 'lucide-react'
import { Realtime, Database, Auth } from 'icons/src/icons'

export default function Home() {
return (
<main className="relative lg:gap-10 pr-6 lg:py-20">
<div className="mx-auto w-full min-w-0 max-w-6xl flex flex-col gap-20">
<div className="flex flex-col gap-8 justify-start">
{/* <div>
<DesignSystemMarks />
</div> */}
<div>
<h1 className="text-4xl text-foreground mb-3">Supabase Design System</h1>
<h2 className="text-xl text-foreground-light font-light">
Design resources for building consistent user experiences
</h2>
</div>
<div className="relative gap-4 px-6 py-6 lg:py-8">
<div className="mx-auto w-full min-w-0 max-w-4xl flex-1">
<div className="flex flex-col gap-2 justify-start my-8 w-full">
<h1 className="text-2xl lg:text-4xl text-foreground">Supabase Design System</h1>
<h2 className="md:text-xl text-base text-foreground-light font-light">
Design resources for building consistent user experiences
</h2>
</div>

{/* Homepage items */}

<div className="grid grid-cols-2 gap-10">
<Link href="/docs/components/atom-components">
<div className="px-10 py-8 min-h-[18rem] flex flex-col justify-between bg-surface-75/50 hover:bg-overlay/50 hover:border-foreground-muted cursor-pointer transition-all border rounded-md">
<HomepageSvgHandler name="atoms-illustration" />
<div className="grid md:grid-cols-2 grid-cols-1 gap-4 w-full">
<Link href="/docs/components/atom-components" className="h-full flex">
<div className="p-6 gap-4 flex flex-col justify-between h-full w-full bg-surface-75 hover:bg-overlay/50 hover:border-foreground-muted cursor-pointer transition-all border rounded-md">
<div className="flex items-center justify-start min-h-[24px]">
<HomepageSvgHandler name="atoms" className="w-6 h-6" />
</div>
<div>
<h3 className="font-medium text-foreground">Atom components</h3>
<p className="text-sm text-foreground-light">Building blocks of User interfaces</p>
</div>
</div>
</Link>
<Link href="/docs/components/fragment-components">
<div className="px-10 py-8 min-h-[18rem] flex flex-col justify-between bg-surface-75/50 hover:bg-overlay/50 hover:border-foreground-muted cursor-pointer transition-all border rounded-md">
<HomepageSvgHandler name="fragments-illustration" />
<Link href="/docs/fragments/fragment-components" className="h-full flex">
<div className="p-6 gap-4 flex flex-col justify-between h-full w-full bg-surface-75 hover:bg-overlay/50 hover:border-foreground-muted cursor-pointer transition-all border rounded-md">
<div className="flex items-center justify-start min-h-[24px]">
<HomepageSvgHandler name="fragments" className="w-6 h-6" />
</div>
<div>
<h3 className="font-medium text-foreground">Fragment components</h3>
<p className="text-sm text-foreground-light">Components assembled from Atoms</p>
</div>
</div>
</Link>
<Link href="/docs/color-usage">
<div className="px-10 py-8 min-h-[18rem] flex flex-col justify-between bg-surface-75/50 hover:bg-overlay/50 hover:border-foreground-muted cursor-pointer transition-all border rounded-md">
<div className="flex flex-col gap-1">
<div className="flex flex-row gap-0.5">
<div className="w-3 h-16 rounded border bg-foreground"></div>
<div className="w-3 h-16 rounded border bg-foreground-light"></div>
<div className="w-3 h-16 rounded border bg-foreground-lighter"></div>
<div className="w-3 h-16 rounded border bg-foreground-muted"></div>
<div className="w-3 h-16 rounded border"></div>

<div className="w-3 h-16 rounded border bg"></div>
<div className="w-3 h-16 rounded border bg-200"></div>
<div className="w-3 h-16 rounded border bg-surface-75"></div>
<div className="w-3 h-16 rounded border bg-surface-100"></div>
<div className="w-3 h-16 rounded border bg-surface-200"></div>
<div className="w-3 h-16 rounded border bg-surface-300"></div>
<div className="w-3 h-16 rounded border"></div>

<div className="w-3 h-16 rounded border bg-brand-200"></div>
<div className="w-3 h-16 rounded border bg-brand-300"></div>
<div className="w-3 h-16 rounded border bg-brand-400"></div>
<div className="w-3 h-16 rounded border bg-brand-500"></div>
<div className="w-3 h-16 rounded border bg-brand"></div>
<div className="w-3 h-16 rounded border bg-brand-600"></div>
<div className="w-3 h-16 rounded border"></div>

<div className="w-3 h-16 rounded border bg-warning-200"></div>
<div className="w-3 h-16 rounded border bg-warning-300"></div>
<div className="w-3 h-16 rounded border bg-warning-400"></div>
<div className="w-3 h-16 rounded border bg-warning-500"></div>
<div className="w-3 h-16 rounded border bg-warning"></div>
<div className="w-3 h-16 rounded border bg-warning-600"></div>
<div className="w-3 h-16 rounded border"></div>

<div className="w-3 h-16 rounded border bg-destructive-200"></div>
<div className="w-3 h-16 rounded border bg-destructive-300"></div>
<div className="w-3 h-16 rounded border bg-destructive-400"></div>
<div className="w-3 h-16 rounded border bg-destructive-500"></div>
<div className="w-3 h-16 rounded border bg-destructive"></div>
<div className="w-3 h-16 rounded border bg-destructive-600"></div>
<div className="w-3 h-16 rounded border"></div>
</div>
<Link href="/docs/components/ui-patterns" className="h-full flex">
<div className="p-6 gap-4 flex flex-col justify-between h-full w-full bg-surface-75 hover:bg-overlay/50 hover:border-foreground-muted cursor-pointer transition-all border rounded-md">
<div className="flex items-center justify-start min-h-[24px]">
<HomepageSvgHandler name="ui-patterns" className="w-6 h-6" />
</div>
<div>
<h3 className="font-medium text-foreground">UI Patterns components</h3>
<p className="text-sm text-foreground-light">
Components assembled from Atoms &amp; Fragments
</p>
</div>
</div>
</Link>
<Link href="/docs/color-usage" className="h-full flex">
<div className="p-6 gap-4 flex flex-col justify-between h-full w-full bg-surface-75 hover:bg-overlay/50 hover:border-foreground-muted cursor-pointer transition-all border rounded-md">
<div className="flex flex-col gap-2 min-h-[24px]">
<HomepageSvgHandler name="colours" className="w-6 h-6" />
</div>
<div>
<h3 className="font-medium text-foreground">Colors</h3>
Expand All @@ -88,27 +62,33 @@ export default function Home() {
</div>
</Link>

<Link href="/docs/theming">
<div className="px-10 py-8 min-h-[18rem] flex flex-col justify-between bg-surface-75/50 hover:bg-overlay/50 hover:border-foreground-muted cursor-pointer transition-all border rounded-md">
<HomepageSvgHandler name="fragments-illustration" />
<Link href="/docs/theming" className="h-full flex">
<div className="p-6 gap-4 flex flex-col justify-between h-full w-full bg-surface-75 hover:bg-overlay/50 hover:border-foreground-muted cursor-pointer transition-all border rounded-md">
<div className="flex items-center justify-start min-h-[24px] text-brand">
<Paintbrush className="w-6 h-6" strokeWidth={1.5} stroke="currentColor" />
</div>
<div>
<h3 className="font-medium text-foreground">Theming</h3>
<p className="text-sm text-foreground-light">Components assembled from Atoms</p>
<p className="text-sm text-foreground-light">Simple extensible theming system</p>
</div>
</div>
</Link>

<Link href="/docs/icons">
<div className="px-10 py-8 min-h-[18rem] flex flex-col justify-between bg-surface-75/50 hover:bg-overlay/50 hover:border-foreground-muted cursor-pointer transition-all border rounded-md">
<HomepageSvgHandler name="fragments-illustration" />
<Link href="/docs/icons" className="h-full flex">
<div className="p-6 gap-4 flex flex-col justify-between h-full w-full bg-surface-75 hover:bg-overlay/50 hover:border-foreground-muted cursor-pointer transition-all border rounded-md">
<div className="flex items-center justify-start min-h-[24px] gap-3 text-brand">
<Realtime className="w-5 h-5" strokeWidth={1.5} stroke="currentColor" />
<Database className="w-5 h-5 opacity-60" strokeWidth={1.5} stroke="currentColor" />
<Auth className="w-5 h-5 opacity-30" strokeWidth={1.5} stroke="currentColor" />
</div>
<div>
<h3 className="font-medium text-foreground">Icons</h3>
<p className="text-sm text-foreground-light">Components assembled from Atoms</p>
<p className="text-sm text-foreground-light">Custom icons for Supabase</p>
</div>
</div>
</Link>
</div>
</div>
</main>
</div>
)
}
5 changes: 4 additions & 1 deletion apps/design-system/app/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ import { ThemeProvider as NextThemesProvider } from 'next-themes'
import { ThemeProviderProps } from 'next-themes/dist/types'

import { TooltipProvider } from 'ui'
import { MobileSidebarProvider } from '@/context/mobile-sidebar-context'

export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
return (
<JotaiProvider>
<NextThemesProvider {...props}>
<TooltipProvider delayDuration={0}>{children}</TooltipProvider>
<TooltipProvider delayDuration={0}>
<MobileSidebarProvider>{children}</MobileSidebarProvider>
</TooltipProvider>
</NextThemesProvider>
</JotaiProvider>
)
Expand Down
30 changes: 11 additions & 19 deletions apps/design-system/components/command-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { CircleIcon, LaptopIcon, MoonIcon, SunIcon } from 'lucide-react'
import { CircleIcon, LaptopIcon, MoonIcon, SunIcon, Search } from 'lucide-react'
import { useTheme } from 'next-themes'
import { useRouter } from 'next/navigation'
import * as React from 'react'
Expand All @@ -17,6 +17,7 @@ import {
CommandList_Shadcn_,
CommandSeparator_Shadcn_,
DialogProps,
DialogTitle,
} from 'ui'

export function CommandMenu({ ...props }: DialogProps) {
Expand Down Expand Up @@ -55,8 +56,7 @@ export function CommandMenu({ ...props }: DialogProps) {
<Button
type="outline"
className={cn(
`relative h-8 w-full justify-start rounded-[0.5rem] bg-background text-sm font-normal text-foreground-muted shadow-none sm:pr-12 md:w-40 lg:w-64
hover:border-foreground-muted hover:bg-surface-100 hover:text-foreground-lighter
`lg:flex hidden relative h-8 w-full justify-start rounded-[0.5rem] bg-background text-sm font-normal text-foreground-muted shadow-none sm:pr-12 md:w-40 lg:w-64 hover:border-foreground-muted hover:bg-surface-100 hover:text-foreground-lighter
`
)}
onClick={() => setOpen(true)}
Expand All @@ -68,26 +68,18 @@ export function CommandMenu({ ...props }: DialogProps) {
<span className="text-sm">⌘</span>K
</kbd>
</Button>
<Button
type="text"
size="tiny"
className="px-1 group lg:hidden"
onClick={() => setOpen(true)}
icon={<Search size={16} />}
/>
<CommandDialog open={open} onOpenChange={setOpen}>
<DialogTitle className="sr-only">Search Design System...</DialogTitle>
<CommandInput_Shadcn_ placeholder="Type a command or search..." />
<CommandList_Shadcn_>
<CommandEmpty_Shadcn_>No results found.</CommandEmpty_Shadcn_>
{/* <CommandGroup_Shadcn_ heading="Links">
{docsConfig.mainNav
.filter((navitem) => !navitem.external)
.map((navItem) => (
<CommandItem_Shadcn_
key={navItem.href}
value={navItem.title}
onSelect={() => {
runCommand(() => router.push(navItem.href as string))
}}
>
<FileIcon className="mr-2 h-4 w-4" strokeWidth={1} />
{navItem.title}
</CommandItem_Shadcn_>
))}
</CommandGroup_Shadcn_> */}
{docsConfig.sidebarNav.map((group) => (
<CommandGroup_Shadcn_ key={group.title} heading={group.title}>
{group.items.map((navItem) => (
Expand Down
20 changes: 20 additions & 0 deletions apps/design-system/components/mobile-sidebar-sheet.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use client'

import { SideNavigation } from '@/components/side-navigation'
import { useMobileSidebar } from '@/hooks/use-mobile-sidebar'
import { Sheet, SheetContent, SheetTitle, ScrollArea } from 'ui'

export function MobileSidebarSheet() {
const { open, setOpen } = useMobileSidebar()

return (
<Sheet open={open} onOpenChange={setOpen}>
<SheetContent side="left" className="p-0 w-[240px] sm:w-[280px]" showClose={false}>
<SheetTitle className="sr-only">Navigation</SheetTitle>
<ScrollArea className="h-full py-6 lg:py-8">
<SideNavigation />
</ScrollArea>
</SheetContent>
</Sheet>
)
}
5 changes: 3 additions & 2 deletions apps/design-system/components/pager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { NavItem, NavItemWithChildren } from '@/types/nav'

import { docsConfig } from '@/config/docs'
import { cn } from '@/lib/utils'
import { buttonVariants } from 'ui'
import { ChevronLeft, ChevronRight } from 'lucide-react'

interface DocsPagerProps {
Expand All @@ -18,8 +17,10 @@ export function DocsPager({ doc }: DocsPagerProps) {
return null
}

const hasBoth = pager?.prev?.href && pager?.next?.href

return (
<div className="flex flex-row items-center justify-between">
<div className={cn('flex flex-row items-center', hasBoth ? 'justify-between' : 'justify-end')}>
{pager?.prev?.href && (
<Link
href={pager.prev.href}
Expand Down
Loading
Loading