diff --git a/apps/www/components/theme-provider.tsx b/apps/www/components/theme-provider.tsx index 891cc2649..691554dd0 100644 --- a/apps/www/components/theme-provider.tsx +++ b/apps/www/components/theme-provider.tsx @@ -4,6 +4,6 @@ import * as React from "react" import { ThemeProvider as NextThemesProvider } from "next-themes" import { ThemeProviderProps } from "next-themes/dist/types" -export function ThemeProvider({ children }: ThemeProviderProps) { - return {children} +export function ThemeProvider({ children, ...props }: ThemeProviderProps) { + return {children} } diff --git a/apps/www/components/ui/toast.tsx b/apps/www/components/ui/toast.tsx index fce208997..b7387e4f5 100644 --- a/apps/www/components/ui/toast.tsx +++ b/apps/www/components/ui/toast.tsx @@ -14,7 +14,7 @@ const ToastViewport = React.forwardRef< Open + My Account + Profile Billing Team diff --git a/examples/playground/.editorconfig b/examples/playground/.editorconfig new file mode 100644 index 000000000..ae10a5cce --- /dev/null +++ b/examples/playground/.editorconfig @@ -0,0 +1,10 @@ +# editorconfig.org +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/examples/playground/.eslintignore b/examples/playground/.eslintignore new file mode 100644 index 000000000..dc0f9d8bf --- /dev/null +++ b/examples/playground/.eslintignore @@ -0,0 +1,5 @@ +dist/* +.cache +public +node_modules +*.esm.js diff --git a/examples/playground/.eslintrc.json b/examples/playground/.eslintrc.json new file mode 100644 index 000000000..45cf7c682 --- /dev/null +++ b/examples/playground/.eslintrc.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json.schemastore.org/eslintrc", + "root": true, + "extends": [ + "next/core-web-vitals", + "prettier", + "plugin:tailwindcss/recommended" + ], + "plugins": ["tailwindcss"], + "rules": { + "@next/next/no-html-link-for-pages": "off", + "react/jsx-key": "off", + "tailwindcss/no-custom-classname": "off" + }, + "settings": { + "tailwindcss": { + "callees": ["cn"] + } + } +} diff --git a/examples/playground/.gitignore b/examples/playground/.gitignore new file mode 100644 index 000000000..ea0d26b98 --- /dev/null +++ b/examples/playground/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +node_modules +.pnp +.pnp.js + +# testing +coverage + +# next.js +.next/ +out/ +build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# turbo +.turbo + +.contentlayer +.env \ No newline at end of file diff --git a/examples/playground/.prettierignore b/examples/playground/.prettierignore new file mode 100644 index 000000000..2f730936c --- /dev/null +++ b/examples/playground/.prettierignore @@ -0,0 +1,12 @@ +cache +.cache +package.json +package-lock.json +public +CHANGELOG.md +.yarn +dist +node_modules +.next +build +.contentlayer \ No newline at end of file diff --git a/examples/playground/.vscode/settings.json b/examples/playground/.vscode/settings.json new file mode 100644 index 000000000..94a4cbdf8 --- /dev/null +++ b/examples/playground/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "typescript.tsdk": "../../node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/lib", + "typescript.enablePromptUseWorkspaceTsdk": true +} diff --git a/examples/playground/README.md b/examples/playground/README.md new file mode 100644 index 000000000..121a1ba45 --- /dev/null +++ b/examples/playground/README.md @@ -0,0 +1,7 @@ +# Playground Example + +The OpenAI Playground built using Radix UI and Tailwind CSS. + +## License + +Licensed under the [MIT license](https://github.com/shadcn/ui/blob/main/LICENSE.md). diff --git a/examples/playground/app/(auth)/login/page.tsx b/examples/playground/app/(auth)/login/page.tsx new file mode 100644 index 000000000..bee818317 --- /dev/null +++ b/examples/playground/app/(auth)/login/page.tsx @@ -0,0 +1,43 @@ +import Link from "next/link" +import { ChevronLeft } from "lucide-react" + +import { cn } from "@/lib/utils" +import { Icons } from "@/components/icons" +import { buttonVariants } from "@/components/ui/button" +import { UserAuthForm } from "@/components/user-auth-form" + +export default function LoginPage() { + return ( +
+ + + Back + +
+
+ +
+

+ Welcome back +

+

+ Click continue to login to the demo dashboard +

+
+
+ +

+ + Don't have an account? Sign Up + +

+
+
+ ) +} diff --git a/examples/playground/app/(auth)/signup/page.tsx b/examples/playground/app/(auth)/signup/page.tsx new file mode 100644 index 000000000..8cdc58057 --- /dev/null +++ b/examples/playground/app/(auth)/signup/page.tsx @@ -0,0 +1,48 @@ +import Link from "next/link" + +import { cn } from "@/lib/utils" +import { Icons } from "@/components/icons" +import { buttonVariants } from "@/components/ui/button" +import { UserAuthForm } from "@/components/user-auth-form" + +export default function LoginPage() { + return ( +
+ + Login + +
+
+
+ +
+

+ Create an account +

+

+ Click continue to login to the demo dashboard +

+
+
+ +

+ By clicking continue, you agree to our{" "} + + Terms of Service + {" "} + and{" "} + + Privacy Policy + + . +

+
+
+ ) +} diff --git a/examples/playground/app/(playground)/layout.tsx b/examples/playground/app/(playground)/layout.tsx new file mode 100644 index 000000000..92d22e881 --- /dev/null +++ b/examples/playground/app/(playground)/layout.tsx @@ -0,0 +1,47 @@ +import Link from "next/link" +import { HelpCircle, Zap } from "lucide-react" + +import { workspaces } from "@/data/teams" +import { user } from "@/data/user" +import { cn } from "@/lib/utils" +import { Icons } from "@/components/icons" +import { MainNav } from "@/components/main-nav" +import { Button, buttonVariants } from "@/components/ui/button" +import { UserNav } from "@/components/user-nav" + +interface DashboardLayoutProps { + children: React.ReactNode +} + +export default function DashboardLayout({ children }: DashboardLayoutProps) { + return ( +
+
+
+
+ + + + +
+ +
+
+
{children}
+
+ ) +} diff --git a/examples/playground/app/(playground)/page.tsx b/examples/playground/app/(playground)/page.tsx new file mode 100644 index 000000000..1265fbaf8 --- /dev/null +++ b/examples/playground/app/(playground)/page.tsx @@ -0,0 +1,135 @@ +import { History } from "lucide-react" + +import { models, types } from "@/data/models" +import { presets } from "@/data/presets" +import { CodeViewer } from "@/components/code-viewer" +import { Icons } from "@/components/icons" +import { MaxLengthSelector } from "@/components/maxlength-selector" +import { ModelSelector } from "@/components/model-selector" +import { PresetActions } from "@/components/preset-actions" +import { PresetSave } from "@/components/preset-save" +import { PresetSelector } from "@/components/preset-selector" +import { PresetShare } from "@/components/preset-share" +import { TemperatureSelector } from "@/components/temperature-selector" +import { TopPSelector } from "@/components/top-p-selector" +import { Button } from "@/components/ui/button" +import { + HoverCard, + HoverCardContent, + HoverCardTrigger, +} from "@/components/ui/hover-card" +import { Label } from "@/components/ui/label" +import { Separator } from "@/components/ui/separator" +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" +import { Textarea } from "@/components/ui/textarea" + +export default function PlaygroundPage() { + return ( +
+
+

+ Playground +

+
+ + +
+ + +
+ +
+
+ + +
+
+ +
+