export const components = [ { title: 'button.tsx', content: "import * as React from 'react';\nimport classnames from 'classnames';\nimport { unreachable } from '../utils';\nimport * as SlotPrimitive from '@radix-ui/react-slot';\n\ntype ButtonElement = React.ElementRef<'button'>;\ntype RootProps = React.ComponentPropsWithoutRef<'button'>;\n\ntype Appearance = 'white' | 'gradient';\ntype Size = '1' | '2' | '3' | '4';\n\ninterface ButtonProps extends RootProps {\n asChild?: boolean;\n appearance?: Appearance;\n size?: Size;\n}\n\nexport const Button = React.forwardRef>(\n (\n {\n asChild,\n appearance = 'white',\n className,\n children,\n size = '2',\n ...props\n },\n forwardedRef,\n ) => {\n const classNames = classnames(\n getSize(size),\n getAppearance(appearance),\n 'inline-flex items-center justify-center border font-medium',\n className,\n );\n\n return asChild ? (\n \n {children}\n \n ) : (\n \n );\n },\n);\n\nButton.displayName = 'Button';\n\nconst getAppearance = (appearance: Appearance | undefined) => {\n switch (appearance) {\n case undefined:\n case 'white':\n return [\n 'bg-white text-black',\n 'hover:bg-white/90',\n 'focus:ring-2 focus:ring-white/20 focus:outline-none focus:bg-white/90',\n ];\n case 'gradient':\n return [\n 'bg-gradient backdrop-blur-[20px] border-[#34343A]',\n 'hover:bg-gradientHover',\n 'focus:ring-2 focus:ring-white/20 focus:outline-none focus:bg-gradientHover',\n ];\n default:\n unreachable(appearance);\n }\n};\n\nconst getSize = (size: Size | undefined) => {\n switch (size) {\n case '1':\n return '';\n case undefined:\n case '2':\n return 'text-[14px] h-8 px-3 rounded-md gap-2';\n case '3':\n return 'text-[14px] h-10 px-4 rounded-md gap-2';\n case '4':\n return 'text-base h-11 px-4 rounded-md gap-2';\n default:\n unreachable(size);\n }\n};\n", }, { title: 'code.tsx', content: "import classnames from 'classnames';\nimport Highlight, { defaultProps, Language } from 'prism-react-renderer';\nimport * as React from 'react';\n\ninterface CodeProps {\n children: any;\n className?: string;\n language?: Language;\n}\n\nconst theme = {\n plain: {\n color: '#EDEDEF',\n fontSize: 13,\n fontFamily: 'MonoLisa, Menlo, monospace',\n },\n styles: [\n {\n types: ['comment'],\n style: {\n color: '#706F78',\n },\n },\n {\n types: ['atrule', 'keyword', 'attr-name', 'selector'],\n style: {\n color: '#7E7D86',\n },\n },\n {\n types: ['punctuation', 'operator'],\n style: {\n color: '#706F78',\n },\n },\n {\n types: ['class-name', 'function', 'tag', 'key-white'],\n style: {\n color: '#EDEDEF',\n },\n },\n ],\n};\n\nexport const Code: React.FC> = ({\n children,\n className,\n language = 'html',\n ...props\n}) => {\n const [isCopied, setIsCopied] = React.useState(false);\n const value = children.trim();\n\n return (\n \n {({ tokens, getLineProps, getTokenProps }) => (\n \n \n {tokens.map((line, i) => {\n return (\n \n {line.map((token, key) => {\n const isException =\n token.content === 'from' && line[key + 1]?.content === ':';\n const newTypes = isException\n ? [...token.types, 'key-white']\n : token.types;\n token.types = newTypes;\n\n return (\n \n \n \n );\n })}\n \n );\n })}\n \n \n )}\n \n );\n};\n", }, { title: 'heading.tsx', content: "import * as SlotPrimitive from '@radix-ui/react-slot';\nimport classnames from 'classnames';\nimport * as React from 'react';\nimport { As, unreachable } from '../utils';\n\nexport type HeadingSize =\n | '1'\n | '2'\n | '3'\n | '4'\n | '5'\n | '6'\n | '7'\n | '8'\n | '9'\n | '10';\nexport type HeadingColor = 'white' | 'gray';\nexport type HeadingWeight = 'medium' | 'bold';\n\ninterface HeadingOwnProps {\n size?: HeadingSize;\n color?: HeadingColor;\n weight?: HeadingWeight;\n}\n\ntype HeadingProps = As<'h1', 'h2', 'h3', 'h4', 'h5', 'h6'> & HeadingOwnProps;\n\nexport const Heading = React.forwardRef<\n HTMLHeadingElement,\n Readonly\n>(\n (\n {\n as: Tag = 'h1',\n size = '3',\n className,\n color = 'white',\n children,\n weight = 'bold',\n ...props\n },\n forwardedRef,\n ) => (\n \n {children}\n \n ),\n);\n\nconst getSizesClassNames = (size: HeadingSize | undefined) => {\n switch (size) {\n case '1':\n return 'text-xs';\n case '2':\n return 'text-sm';\n case undefined:\n case '3':\n return 'text-base';\n case '4':\n return 'text-lg';\n case '5':\n return 'text-xl tracking-[-0.16px]';\n case '6':\n return 'text-2xl tracking-[-0.288px]';\n case '7':\n return 'text-[28px] leading-[34px] tracking-[-0.416px]';\n case '8':\n return 'text-[35px] leading-[42px] tracking-[-0.64px]';\n case '9':\n return 'text-6xl leading-[73px] tracking-[-0.896px]';\n case '10':\n return [\n 'text-[38px] leading-[46px]',\n 'md:text-[70px] md:leading-[85px] tracking-[-1.024px;]',\n ];\n default:\n return unreachable(size);\n }\n};\n\nconst getColorClassNames = (color: HeadingColor | undefined) => {\n switch (color) {\n case 'gray':\n return 'text-slate-11';\n case 'white':\n case undefined:\n return 'text-slate-12';\n default:\n return unreachable(color);\n }\n};\n\nconst getWeightClassNames = (weight: HeadingWeight | undefined) => {\n switch (weight) {\n case 'medium':\n return 'font-medium';\n case 'bold':\n case undefined:\n return 'font-bold';\n default:\n return unreachable(weight);\n }\n};\n\nHeading.displayName = 'Heading';\n", }, { title: 'index.ts', content: "export * from './button';\nexport * from './code';\nexport * from './heading';\nexport * from './logo';\nexport * from './sidebar';\nexport * from './text';\nexport * from './topbar';\n", }, { title: 'layout.tsx', content: "import * as React from 'react';\nimport { Topbar } from './topbar';\nimport { Sidebar } from './sidebar';\n\ntype LayoutElement = React.ElementRef<'div'>;\ntype RootProps = React.ComponentPropsWithoutRef<'div'>;\n\ninterface LayoutProps extends RootProps {\n navItems: string[];\n viewMode?: string;\n setViewMode?: (viewMode: string) => void;\n}\n\nexport const Layout = React.forwardRef>(\n (\n { className, title, navItems, children, viewMode, setViewMode, ...props },\n forwardedRef,\n ) => {\n return (\n <>\n
\n \n
\n {title && (\n \n )}\n
\n
{children}
\n
\n
\n
\n \n );\n },\n);\n\nLayout.displayName = 'Layout';\n", }, { title: 'logo.tsx', content: 'import * as React from \'react\';\n\ntype LogoElement = React.ElementRef<\'svg\'>;\ntype RootProps = React.ComponentPropsWithoutRef<\'svg\'>;\n\nexport const Logo = React.forwardRef>(\n ({ ...props }, forwardedRef) => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ),\n);\n\nLogo.displayName = \'Logo\';\n', }, { title: 'sidebar.tsx', content: 'import { Logo } from \'./logo\';\nimport * as React from \'react\';\nimport classnames from \'classnames\';\nimport Link from \'next/link\';\nimport { Heading } from \'./heading\';\nimport { useRouter } from \'next/router\';\nimport * as Collapsible from \'@radix-ui/react-collapsible\';\n\ntype SidebarElement = React.ElementRef<\'aside\'>;\ntype RootProps = React.ComponentPropsWithoutRef<\'aside\'>;\n\ninterface SidebarProps extends RootProps {\n navItems: string[];\n}\n\nexport const Sidebar = React.forwardRef>(\n ({ className, navItems, ...props }, forwardedRef) => {\n const { query } = useRouter();\n\n return (\n \n
\n \n
\n\n \n \n );\n },\n);\n\nSidebar.displayName = \'Sidebar\';\n', }, { title: 'text.tsx', content: "import * as SlotPrimitive from '@radix-ui/react-slot';\nimport classnames from 'classnames';\nimport * as React from 'react';\nimport { As, unreachable } from '../utils';\n\nexport type TextSize = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';\nexport type TextColor = 'gray' | 'white';\nexport type TextTransform = 'uppercase' | 'lowercase' | 'capitalize';\nexport type TextWeight = 'normal' | 'medium';\n\ninterface TextOwnProps {\n size?: TextSize;\n color?: TextColor;\n transform?: TextTransform;\n weight?: TextWeight;\n}\n\ntype TextProps = As<'span', 'div', 'p'> & TextOwnProps;\n\nexport const Text = React.forwardRef>(\n (\n {\n as: Tag = 'span',\n size = '2',\n color = 'gray',\n transform,\n weight = 'normal',\n className,\n children,\n ...props\n },\n forwardedRef,\n ) => (\n \n {children}\n \n ),\n);\n\nconst getSizesClassNames = (size: TextSize | undefined) => {\n switch (size) {\n case '1':\n return 'text-xs';\n case undefined:\n case '2':\n return 'text-sm';\n case '3':\n return 'text-base';\n case '4':\n return 'text-lg';\n case '5':\n return ['text-17px', 'md:text-xl tracking-[-0.16px]'];\n case '6':\n return 'text-2xl tracking-[-0.288px]';\n case '7':\n return 'text-[28px] leading-[34px] tracking-[-0.416px]';\n case '8':\n return 'text-[35px] leading-[42px] tracking-[-0.64px]';\n case '9':\n return 'text-6xl leading-[73px] tracking-[-0.896px]';\n default:\n return unreachable(size);\n }\n};\n\nconst getColorClassNames = (color: TextColor | undefined) => {\n switch (color) {\n case 'white':\n return 'text-slate-12';\n case undefined:\n case 'gray':\n return 'text-slate-11';\n default:\n return unreachable(color);\n }\n};\n\nconst getWeightClassNames = (weight: TextWeight | undefined) => {\n switch (weight) {\n case undefined:\n case 'normal':\n return 'font-normal';\n case 'medium':\n return 'font-medium';\n default:\n return unreachable(weight);\n }\n};\n\nText.displayName = 'Text';\n", }, { title: 'topbar.tsx', content: 'import * as React from \'react\';\nimport classnames from \'classnames\';\nimport { Heading } from \'./heading\';\nimport { Text } from \'./text\';\nimport * as ToggleGroup from \'@radix-ui/react-toggle-group\';\n\ntype TopbarElement = React.ElementRef<\'header\'>;\ntype RootProps = React.ComponentPropsWithoutRef<\'header\'>;\n\ninterface TopbarProps extends RootProps {\n title: string;\n viewMode?: string;\n setViewMode?: (viewMode: string) => void;\n}\n\nexport const Topbar = React.forwardRef>(\n ({ className, title, viewMode, setViewMode, ...props }, forwardedRef) => {\n return (\n \n
\n \n All emails\n \n \n \n \n\n \n {title}\n \n
\n\n {setViewMode && (\n {\n if (!value) {\n return setViewMode(\'desktop\');\n }\n setViewMode(value);\n }}\n >\n \n Desktop\n \n \n Source\n \n \n )}\n \n );\n },\n);\n\nTopbar.displayName = \'Topbar\';\n', }, ];