chore(ui): creating a playground for the new components (#4301)

Co-authored-by: Dan Rukas <dan.rukas@gmail.com>
This commit is contained in:
AlirezaandDan Rukas authored and GitHub committed 2024-07-26 11:04:58 -04:00
1 parent b9eb54c71f
commit 6231629b38
20 files changed
+1215 -334

No files matched your search

+1
View File
@@ -0,0 +1 @@
This is our playground for designing and developing the next generation of the platform's UI. You probably don't need to be here.
+134
View File
@@ -0,0 +1,134 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import '../tailwind.css';
function Colors() {
return (
<main>
<h2>Primary color</h2>
<div className="row">
<div className="example2">
<div className="bg-primary h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-primary/80 h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-primary/60 h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-primary/40 h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-primary/20 h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-infosecondary h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-highlight h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-highlight h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="h-16 w-16 rounded bg-white"></div>
</div>
<div className="example2">
<div className="h-16 w-16 rounded bg-white"></div>
</div>
<div className="example2">
<div className="h-16 w-16 rounded bg-white"></div>
</div>
</div>
<h2>New colors</h2>
<div className="row">
<div className="example2">
<div className="bg-highlight h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-bkg-low h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-bkg-med h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-bkg-full h-16 w-16 rounded"></div>
</div>
</div>
<h2>Core colors</h2>
<div className="row">
<div className="example2">
<div className="bg-background h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-foreground h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-card h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-card-foreground h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-popover h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-popover-foreground h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-primary h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-primary-foreground h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-secondary h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-secondary-foreground h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-muted h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-muted-foreground h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-accent h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-accent-foreground h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="destructive h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="destructive-foreground h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-border h-16 w-16 rounded"></div>
</div>
</div>
<h2>Borders</h2>
<div className="row">
<div className="example2">
<div className="bg-border h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-input h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-ring h-16 w-16 rounded"></div>
</div>
</div>
</main>
);
}
const container = document.getElementById('root');
const root = createRoot(container);
root.render(React.createElement(Colors));
+34
View File
@@ -0,0 +1,34 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import '../tailwind.css';
const App: React.FC = () => (
<div className="container mx-auto p-4">
<h1 className="mb-4 text-2xl font-bold">Home Page</h1>
<nav className="space-x-4">
<a
href="playground.html"
className="text-blue-500 hover:text-blue-700"
>
Playground
</a>
<a
href="viewer.html"
className="text-blue-500 hover:text-blue-700"
>
Viewer
</a>
<a
href="colors.html"
className="text-blue-500 hover:text-blue-700"
>
Colors
</a>
</nav>
</div>
);
const container = document.getElementById('root');
const root = createRoot(container);
root.render(React.createElement(App));
+185
View File
@@ -0,0 +1,185 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import '../tailwind.css';
import { Button } from '../components/Button';
// import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from '../components/Tooltip';
// import type { Metadata } from 'next';
// import Script from 'next/script';
// import BackgroundColorSelector from '@/components/backgroundcolor';
// import { useState, useEffect } from 'react';
// import { Inter } from 'next/font/google';
// import { ThemeProvider } from '@/components/themeprovider';
// import { Button2 } from '@/components/ui/button2';
// import { Switch } from '@/components/ui/switch';
// import { Slider } from '@/components/ui/slider';
// import { ScrollArea } from '@/components/ui/scroll-area';
// import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
// import { Separator } from '@/components/ui/separator';
// import { Toggle } from '@/components/ui/toggle';
// import { Checkbox } from '@/components/ui/checkbox';
// import {
// Select,
// SelectContent,
// SelectItem,
// SelectTrigger,
// SelectValue,
// } from '@/components/ui/select';
// import { Input } from '@/components/ui/input';
// import { Label } from '@/components/ui/label';
// import icons from '../../components/icons';
// import SegRow from '@/components/segrow';
export default function Playground() {
return (
<main>
{/* <BackgroundColorSelector /> */}
<h2>Button default</h2>
<div className="row">
<div className="example">
<Button
className=""
variant="default"
>
Primary Button
</Button>
</div>
<div className="example">
<Button variant="secondary">Secondary Button</Button>
</div>
<div className="example">
<Button variant="ghost">Ghost Button</Button>
</div>
<div className="example">
<Button
variant="ghost"
size="icon"
>
?
</Button>
</div>
<div className="example">
<Button variant="link">Link</Button>
</div>
</div>
<h2>Button small</h2>
<div className="row">
<div className="example">
<Button
className=""
variant="default"
size="sm"
>
Primary Button
</Button>
</div>
<div className="example">
<Button
variant="secondary"
size="sm"
>
Secondary Button
</Button>
</div>
<div className="example">
<Button
variant="ghost"
size="sm"
>
Ghost Button
</Button>
</div>
<div className="example">
<Button
variant="ghost"
size="icon"
>
?
</Button>
</div>
<div className="example">
<Button
variant="link"
size="sm"
>
Link
</Button>
</div>
</div>
<h2>Button large</h2>
<div className="row">
<div className="example">
<Button
className=""
variant="default"
size="lg"
>
Primary Button
</Button>
</div>
<div className="example">
<Button
variant="secondary"
size="lg"
>
Secondary Button
</Button>
</div>
<div className="example">
<Button
variant="ghost"
size="lg"
>
Ghost Button
</Button>
</div>
<div className="example">
<Button
variant="ghost"
size="icon"
>
?
</Button>
</div>
<div className="example">
<Button
variant="link"
size="lg"
>
Link
</Button>
</div>
</div>
<h2>Color swatches</h2>
<div className="row">
<div className="example2">
<div className="bg-actions h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-infosecondary h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="bg-highlight h-16 w-16 rounded"></div>
</div>
<div className="example2">
<div className="h-16 w-16 rounded bg-white"></div>
</div>
<div className="example2">
<div className="h-16 w-16 rounded bg-white"></div>
</div>
<div className="example2">
<div className="h-16 w-16 rounded bg-white"></div>
</div>
</div>
</main>
);
}
const container = document.getElementById('root');
const root = createRoot(container);
root.render(React.createElement(Playground));
+17
View File
@@ -0,0 +1,17 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import '../tailwind.css';
// component imports
function Viewer() {
return (
<div className="h-full w-full">
<div className="text-3xl"> Viewer </div>
</div>
);
}
const container = document.getElementById('root');
const root = createRoot(container);
root.render(React.createElement(Viewer));