The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
adding GlassPanel, amended layouts a bit
Jonathan Summers-Muir95e3dff29094
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsxindex 89514474c4b..bc5b0d1b3fc 100644--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx@@ -30,7 +30,7 @@ const SideNav = () => {case `/docs${tempBasePath}/database`:setLevel('database')break- case `/docs${tempBasePath}/auth`:+ case url.includes(`/docs${tempBasePath}/auth`) && url:setLevel('auth')breakcase `/docs${tempBasePath}/storage`:diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideList.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideList.tsxindex 1fa4196a254..d1e2b0e4cd5 100644--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideList.tsx+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideList.tsx@@ -31,15 +31,15 @@ const NavigationMenuGuideList = ({ currentLevel, setLevel, tempBasePath, id }) =}}className={['flex items-center gap-1 text-xs group mb-3',- 'text-base transition-all duration-200 text-scale-1200 hover:text-brand-900 hover:cursor-pointer ',+ 'text-base transition-all duration-200 text-brand-900 hover:text-brand-1200 hover:cursor-pointer ',].join(' ')}><div className="relative w-2">- <div>- <IconChevronLeft size={10} />+ <div className="transition-all ease-out ml-0 group-hover:-ml-1">+ <IconChevronLeft size={10} strokeWidth={3} /></div></div>- <span>back</span>+ <span>Main Menu</span></li><div className="flex items-center gap-3 my-3">diff --git a/apps/docs/layouts/DefaultLayout.tsx b/apps/docs/layouts/DefaultLayout.tsxindex 0446a90da93..a6bfe7a1732 100644--- a/apps/docs/layouts/DefaultLayout.tsx+++ b/apps/docs/layouts/DefaultLayout.tsx@@ -1,6 +1,6 @@import { MDXProvider } from '@mdx-js/react'import Head from 'next/head'-import { FC, useEffect } from 'react'+import { FC, useEffect, useState } from 'react'import components from '~/components'import Footer from '~/components/Footer'import SideBar from '~/components/Navigation/SideBar'@@ -17,6 +17,8 @@ interface Props {const Layout: FC<Props> = (props: Props) => {// const contentString = renderToString(props.children)+ const [active, setActive] = useState(false)+useEffect(() => {const key = localStorage.getItem('supabaseDarkMode')if (!key) {@@ -27,6 +29,12 @@ const Layout: FC<Props> = (props: Props) => {}}, [])+ useEffect(() => {+ setTimeout(function () {+ setActive(true)+ }, 150)+ }, [])+// const contentString = renderToString(props.children)// const content = serialize(contentString || '')@@ -52,7 +60,13 @@ const Layout: FC<Props> = (props: Props) => {<meta property="og:title" content={props.meta?.title} /></Head>- <div className="">+ <div+ className={[+ 'relative transition-all ease-out',+ 'duration-150 ',+ active ? 'opacity-100 left-0' : 'opacity-0 left-5',+ ].join(' ')}+ >{/* <p className="text-brand-900 tracking-wider">Tutorials</p> */}<article className="prose dark:prose-dar max-w-none"><h1>{props.meta.title}</h1>diff --git a/apps/docs/layouts/SiteLayout.tsx b/apps/docs/layouts/SiteLayout.tsxindex e2cc107ab08..7dbf79d0aa6 100644--- a/apps/docs/layouts/SiteLayout.tsx+++ b/apps/docs/layouts/SiteLayout.tsx@@ -20,9 +20,20 @@ const Layout = ({ children }) => {<div className="col-span-3"><NavigationMenu /></div>- <div className="col-span-9">{children}</div>+ <div className="col-span-9">+ {children}+ <hr className="border-scale-400 mt-32"></hr>+ <div className="flex flex-row gap-3 mt-6">+ <span className="text-xs text-scale-900">Supabase 2022</span>+ <span className="text-xs text-scale-900">—</span>+ <a className="text-xs text-scale-800">Contributing</a>+ <a className="text-xs text-scale-800">Author Styleguide</a>+ <a className="text-xs text-scale-800">Changelog</a>+ <a className="text-xs text-scale-800">Opensource</a>+ <a className="text-xs text-scale-800">Supasquad</a>+ </div>+ </div></div>- <Footer /></main></>)diff --git a/apps/docs/layouts/tutorials/TutorialLayout.tsx b/apps/docs/layouts/tutorials/TutorialLayout.tsxindex 0a33ce773bb..b49391425b2 100644--- a/apps/docs/layouts/tutorials/TutorialLayout.tsx+++ b/apps/docs/layouts/tutorials/TutorialLayout.tsx@@ -1,6 +1,6 @@import { MDXProvider } from '@mdx-js/react'import Head from 'next/head'-import { FC, useEffect } from 'react'+import { FC, useEffect, useState } from 'react'import components from '~/components'import Footer from '~/components/Footer'import SideBar from '~/components/Navigation/SideBar'@@ -16,6 +16,7 @@ interface Props {const Layout: FC<Props> = (props: Props) => {// const contentString = renderToString(props.children)+ const [active, setActive] = useState(false)useEffect(() => {const key = localStorage.getItem('supabaseDarkMode')@@ -27,6 +28,12 @@ const Layout: FC<Props> = (props: Props) => {}}, [])+ useEffect(() => {+ setTimeout(function () {+ setActive(true)+ }, 150)+ }, [])+// const contentString = renderToString(props.children)// const content = serialize(contentString || '')@@ -52,40 +59,33 @@ const Layout: FC<Props> = (props: Props) => {<meta property="og:title" content={props.meta?.title} /></Head>- <main>- {/* <NavBar currentPage={currentPage} /> */}- <div className="flex w-full flex-row">- <SideBar menuItems={props.menuItems} />- <div className="main-content-pane docs-width grid md:grid-cols-12 gap-4 justify-between p-4 pb-8 w-full">- <div- className={`${- props.meta?.hide_table_of_contents || !hasTableOfContents- ? 'col-span-12 xl:col-start-2 xl:col-span-10 2xl:col-start-3 2xl:col-span-8'- : 'col-span-12 md:col-span-9'- } py-2 md:py-4 px-2 md:px-8`}- >- <p className="text-brand-900 tracking-wider">Tutorials</p>- <article className="prose dark:prose-dark dark:bg-scale-200 max-w-4xl mt-8">- <h1>{props.meta.title}</h1>- <div className="max-w-xs w-32 h-[1px] bg-gradient-to-r from-brand-800 to-brand-900 my-16"></div>+ <div+ className={[+ 'relative transition-all ease-out',+ 'duration-150',+ active ? 'opacity-100 left-0' : 'opacity-0 left-10',+ ].join(' ')}+ >+ <div>+ <p className="text-brand-900 tracking-wider">Tutorials</p>+ <article className={['prose dark:prose-dark ', 'max-w-none'].join(' ')}>+ <h1>{props.meta.title}</h1>+ <div className="max-w-xs w-32 h-[1px] bg-gradient-to-r from-brand-800 to-brand-900 my-16"></div>- <MDXProvider components={components} children={props.children} />- </article>- </div>- {hasTableOfContents && !props.meta?.hide_table_of_contents && (- <div- className={[- 'border-scale-400 dark:bg-scale-200 table-of-contents-height border-l',- 'thin-scrollbar overflow-y-auto sticky hidden md:block md:col-span-3 px-2',- ].join(' ')}- >- <TableOfContents toc={props.toc} video={props.meta.video} />- </div>- )}- </div>+ <MDXProvider components={components} children={props.children} />+ </article></div>- <Footer />- </main>+ {hasTableOfContents && !props.meta?.hide_table_of_contents && (+ <div+ className={[+ 'border-scale-400 dark:bg-scale-200 table-of-contents-height border-l',+ 'thin-scrollbar overflow-y-auto sticky hidden md:block md:col-span-3 px-2',+ ].join(' ')}+ >+ <TableOfContents toc={props.toc} video={props.meta.video} />+ </div>+ )}+ </div></>)}diff --git a/apps/docs/next.config.mjs b/apps/docs/next.config.mjsindex 5c1035f4aa0..0eb42162e06 100644--- a/apps/docs/next.config.mjs+++ b/apps/docs/next.config.mjs@@ -35,7 +35,7 @@ const withMDX = nextMdx({],rehypePlugins: [rehypeSlug],// This is required for `MDXProvider` component- providerImportSource: '@mdx-js/react',+ // providerImportSource: '@mdx-js/react',},})diff --git a/apps/docs/pages/new/auth.mdx b/apps/docs/pages/new/auth.mdxindex 4d846a79353..704f9a6f5ea 100644--- a/apps/docs/pages/new/auth.mdx+++ b/apps/docs/pages/new/auth.mdx@@ -1,10 +1,84 @@import Layout from '~/layouts/DefaultLayout'+import Link from 'next/link'+import { GlassPanel } from 'ui'export const meta = {title: 'Auth',}-## wowzers auth !!+## Learn how to use Supabase Auth to handle authentication and authorization of your users blah blah i am test text++### Popular Guides++<div className="grid grid-cols-12 gap-6 not-prose">+ {topArticles.map((item) => {+ return (+ <Link+ href={`/new/${item.href}`}+ key={item.title}+ passHref+ >+ <a className={item.span ?? 'col-span-4'}>+ <GlassPanel+ title="Social Login"+ header="/docs/img/cards/sample-card-header-4.svg"+ span="col-span-6"+ background={false}+ >+ {item.description}+ </GlassPanel>+ </a>+ </Link>+ )})}++</div>++export const topArticles = [+ {+ title: 'Database',+ header: '/docs/img/cards/sample-card-header-4.svg',+ href: '/auth/auth-login',+ description: 'Social Login allows the user to sign into a third party website instead of.',+ span: 'col-span-6',+ },+ {+ title: 'Auth',+ header: '/docs/img/cards/sample-card-header-4.svg',+ icon: 'auth',+ href: '/auth/auth-login',+ description: `+Social Login allows the user to sign into a third party website instead of creating a new account specifically for that website.+ `,+ span: 'col-span-6',+ },+ {+ title: 'Storage',+ header: '/docs/img/cards/sample-card-header-4.svg',+ icon: 'storage',+ href: '/auth/auth-login',+ description: `+Social Login allows the user to sign into a third party website instead of creating a new account specifically for that website.+ `,+ },+ {+ title: 'Realtime',+ header: '/docs/img/cards/sample-card-header-4.svg',+ icon: 'realtime',+ href: '/auth/auth-login',+ description: `+Social Login allows the user to sign into a third party website instead of creating a new account specifically for that website.+ `,+ },+ {+ title: 'Edge Functions',+ header: '/docs/img/cards/sample-card-header-4.svg',+ icon: 'functions',+ href: '/auth/auth-login',+ description: `+Social Login allows the user to sign into a third party website instead of creating a new account specifically for that website.+ `,+ },+]export const Page = ({ children }) => <Layout meta={meta} children={children} />diff --git a/apps/docs/pages/new/auth/auth-login.mdx b/apps/docs/pages/new/auth/auth-login.mdxnew file mode 100644index 00000000000..f545f41ecfc--- /dev/null+++ b/apps/docs/pages/new/auth/auth-login.mdx@@ -0,0 +1,25 @@+import Layout from '~/layouts/tutorials/TutorialLayout'+import Link from 'next/link'+import { GlassPanel } from 'ui'++export const meta = {+ title: 'Auth login',+}++## Learn how to use Supabase Auth to handle authentication and authorization of your users blah blah i am test text++Auth0 Universal Login defines your login flow, which is the key feature of an Authorization Server.+Each time a user needs to prove their identity, your applications redirect to Universal Login and Auth0 will do what is needed to guarantee the user's identity.++By choosing Universal Login, you don't have to do any integration work to handle the various flavors of authentication. You can start off using a simple username and password.+You can also add other features such as social login and multi-factor authentication (MFA). All of this is dynamic and adjustable in real-time without requiring application-level changes because all functionality is driven by the web pages served by the centralized Authentication Server.+Your application will benefit from any improvements Auth0 makes in the login flow without the need for you to change your code.++Create a consistent, branded login experience by customizing the login page appearance and behavior from the Auth0 Dashboard including the logo and colors.+For more advanced use cases, you can change the code of each page.++To learn more about the differences between Universal Login and embedded login, read Centralized Universal Login vs. Embedded Login.++export const Page = ({ children }) => <Layout meta={meta} children={children} />++export default Pagediff --git a/apps/docs/pages/new/danny.mdx b/apps/docs/pages/new/danny.mdxnew file mode 100644index 00000000000..1f32ae40676--- /dev/null+++ b/apps/docs/pages/new/danny.mdx@@ -0,0 +1,68 @@+import Layout from '~/layouts/DefaultLayout'++export const meta = {+ title: 'Supabase Docs',+ description: 'All the information to integrate supabase',+}++## hello world++this is a paragraph++this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph++this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph+this is a paragraph++```mdx pages/your-page.mdx+import Layout from '~/layouts/DefaultLayout'++export const meta = {+ title: 'Supabase Docs',+ description: 'All the information to integrate supabase',+}++// your content goes here++export default ({ children }) => <Layout meta={meta} children={children} />+```++## Using tabs++```mdx pages/your-page.mdx+import Layout from '~/layouts/DefaultLayout'++export const meta = {+ title: 'Supabase Docs',+ description: 'All the information to integrate supabase',+}++// your content goes here++export default ({ children }) => <Layout meta={meta} children={children} /++>+```++export default ({ children }) => <Layout meta={meta} children={children} />diff --git a/apps/docs/pages/new/index.mdx b/apps/docs/pages/new/index.mdxindex ea0cc6a5f90..0d27d3ff960 100644--- a/apps/docs/pages/new/index.mdx+++ b/apps/docs/pages/new/index.mdx@@ -1,12 +1,17 @@import Layout from '~/layouts/DefaultLayout'import Link from 'next/link'+import { GlassPanel } from 'ui'export const meta = {title: 'Supabase Docs',+ description: 'All the information to integrate supabase',}Learn how to use Supabase Auth to handle authentication and authorization of your users blah blah i am test text+adsdasd+Hello danny+<div className="border rounded p-12">In this 25-minute guide, we’ll be building a collaborative user managment app using NextJS and Supabase.@@ -29,37 +34,10 @@ hello worldkey={product.title}passHref>- <a className={`- relative- group- overflow-hidden- bg-white dark:bg-scale-300 border rounded-md drop-shadow-sm- transition- border-scale-500- hover:border-scale-700- gap-6- p-8 flex flex-col ${- product.span ?? 'col-span-4'- }`}>- <img- src={`/docs/img/gradient-bg.png`}- className="transition-all absolute left-0 -top-64 w-[258px]- duration-700 ease-out- group-hover:w-[320px]- "- />- <div className="flex items-center gap-3">- <div className="bg-green-600 w-8 h-8 flex items-center justify-center rounded">- <img className="bg-green-600 w-5" src={`/docs/img/icons/menu/${product.icon}.svg`} />- </div>- <h5 className="text-base text-scale-1200">{product.title}</h5>- </div>-- <p className="text-sm text-scale-1100">- Social Login allows the user to sign into a third party website instead of creating a new- account specifically for that website.- </p>- <span className="text-brand-900 justify-end text-sm">Learn more</span>+ <a className={product.span ?? 'col-span-4'}>+ <GlassPanel {...product} background={true}>+ {product.description}+ </GlassPanel></a></Link>)@@ -78,37 +56,10 @@ hello worldkey={product.title}passHref>- <a className={`- relative- group- overflow-hidden- border rounded-md- transition- border-scale-400- hover:border-scale-500- gap-6- p-8 flex flex-col ${- product.span ?? 'col-span-4'- }`}>- <img- src={`/docs/img/gradient-bg.png`}- className="transition-all absolute left-0 -top-64 w-[258px]- duration-700 ease-out- group-hover:w-[320px]- "- />- <div className="flex items-center gap-3">- <div className="bg-green-600 w-8 h-8 flex items-center justify-center rounded">- <img className="bg-green-600 w-5" src={`/docs/img/icons/menu/${product.icon}.svg`} />- </div>- <h5 className="text-base text-scale-1200">{product.title}</h5>- </div>-- <p className="text-sm text-scale-1100">- Social Login allows the user to sign into a third party website instead of creating a new- account specifically for that website.- </p>- <span className="text-brand-900 justify-end text-sm">Learn more</span>+ <a className={product.span ?? 'col-span-4'}>+ <GlassPanel {...product} background={false}>+ {product.description}+ </GlassPanel></a></Link>)@@ -127,44 +78,10 @@ hello worldkey={product.title}passHref>- <a className={`- relative- group- overflow-hidden- border rounded-md- transition- border-scale-400- hover:border-scale-500- ${- product.span ?? 'col-span-4'- }`}>- <img- src={`/docs/img/cards/${product.header}.svg`}- className="transition-all left-0 -top-64 w-full- duration-700 ease-out- "- />- <img- src={`/docs/img/gradient-bg.png`}- className="transition-all absolute left-0 -top-64 w-[258px]- duration-700 ease-out- group-hover:w-[320px]- "- />- <div className="px-8 pb-8 flex flex-col gap-6">- <div className="flex items-center gap-3">- <div className="bg-green-600 w-8 h-8 flex items-center justify-center rounded">- <img className="bg-green-600 w-5" src={`/docs/img/icons/menu/${product.icon}.svg`} />- </div>- <h5 className="text-base text-scale-1200">{product.title}</h5>- </div>-- <p className="text-sm text-scale-1100">- Social Login allows the user to sign into a third party website instead of creating a new- account specifically for that website.- </p>- <span className="text-brand-900 justify-end text-sm">Learn more</span>- </div>+ <a className={product.span ?? 'col-span-4'}>+ <GlassPanel {...product} background={false}>+ {product.description}+ </GlassPanel></a></Link>)@@ -178,9 +95,7 @@ export const products = [title: 'Database',icon: 'database',href: 'database',- description: `-Social Login allows the user to sign into a third party website instead of creating a new account specifically for that website.- `,+ description: 'Social Login allows the user to sign into a third party website instead of.',span: 'col-span-6',},{@@ -247,7 +162,7 @@ Social Login allows the user to sign into a third party website instead of createxport const platform = [{- header: 'sample-card-header-3',+ header: '/docs/img/cards/sample-card-header-3.svg',title: 'Dashboard guides',icon: 'reference',href: 'database',@@ -257,7 +172,7 @@ Social Login allows the user to sign into a third party website instead of creatspan: 'col-span-6',},{- header: 'sample-card-header-2',+ header: '/docs/img/cards/sample-card-header-2.svg',title: 'Integrations',icon: 'integrations',href: 'auth',@@ -267,7 +182,7 @@ Social Login allows the user to sign into a third party website instead of creatspan: 'col-span-6',},{- header: 'sample-card-header-4',+ header: '/docs/img/cards/sample-card-header-4.svg',title: 'Glossary',icon: 'reference',href: 'storage',diff --git a/packages/ui/index.tsx b/packages/ui/index.tsxindex 1bf276ae8d8..469ffcb6dc0 100644--- a/packages/ui/index.tsx+++ b/packages/ui/index.tsx@@ -5,6 +5,7 @@ import * as React from 'react'export * from './src/components/Button'export * from './src/components/Icon'export * from './src/components/Icon/IconContext'+export * from './src/components/GlassPanel'// export * from './src/components/Image'// DISPLAYSdiff --git a/packages/ui/src/components/GlassPanel/GlassPanel.tsx b/packages/ui/src/components/GlassPanel/GlassPanel.tsxnew file mode 100644index 00000000000..86aedc9fd86--- /dev/null+++ b/packages/ui/src/components/GlassPanel/GlassPanel.tsx@@ -0,0 +1,65 @@+import React from 'react'+import { Item } from '../Accordion/Accordion'++interface Props {+ title: string+ span?: string+ icon?: string+ children?: React.ReactNode+ header?: string+ background?: boolean+}++const GlassPanel = ({ title, span, icon, children, header, background = true }: Props) => {+ return (+ <div+ className={[+ 'relative',+ 'group',+ 'cursor-pointer',+ 'overflow-hidden',+ 'border rounded-lg',+ 'text-left',+ background+ ? 'border-scale-500 hover:border-scale-700 bg-white dark:bg-scale-300'+ : 'border-scale-400 hover:border-scale-500 bg-transparent',+ 'transition',+ ].join(' ')}+ >+ {header && (+ <img+ src={`${header}`}+ className="transition-all left-0 -top-64 w-full+ duration-700 ease-out+ "+ />+ )}+ <img+ src={`/docs/img/gradient-bg.png`}+ className="transition-all absolute left-0 -top-64 w-[258px]+ duration-700 ease-out+ group-hover:w-[320px]+ "+ />+ <div+ className={['px-8 pb-8', 'flex flex-col', icon ? 'gap-6' : 'gap-2', !header && 'pt-8'].join(+ ' '+ )}+ >+ <div className="flex items-center gap-3">+ {icon && (+ <div className="bg-green-600 w-8 h-8 flex items-center justify-center rounded">+ <img className="bg-green-600 w-5" src={`/docs/img/icons/menu/${icon}.svg`} />+ </div>+ )}+ <h5 className="text-base text-scale-1200">{title}</h5>+ </div>++ {children && <span className="text-sm text-scale-1100">{children}</span>}+ <span className="text-brand-900 justify-end text-sm">Learn more</span>+ </div>+ </div>+ )+}++export default GlassPaneldiff --git a/packages/ui/src/components/GlassPanel/index.tsx b/packages/ui/src/components/GlassPanel/index.tsxnew file mode 100644index 00000000000..3728536c76b--- /dev/null+++ b/packages/ui/src/components/GlassPanel/index.tsx@@ -0,0 +1 @@+export { default as GlassPanel } from './GlassPanel'