Skip to content

Commit

Permalink
feat(theme): wip editor
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjavi committed May 29, 2024
1 parent 44ef3ad commit 8f81f48
Show file tree
Hide file tree
Showing 20 changed files with 347 additions and 107 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

https://pandacss-theme-generator.vercel.app

## Inspired in
## Inspired by

- [Panda CSS Playground](https://github.com/chakra-ui/panda/blob/main/playground)
- [Park UI](https://park-ui.com)
Expand Down
17 changes: 17 additions & 0 deletions app/(components)/components/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Sidebar from '@/components/layout/sidebar'
import HeroTitle from '@/components/ui/hero-title'
import { panda } from '@/styled-system/jsx'

export default async function () {
return (
<>
<Sidebar.ContentSection>
<HeroTitle size="xl">Button</HeroTitle>
<panda.p color="gray.fg1" fontSize="xl">
Trigger an action or event, such as submitting a form or displaying a dialog.
</panda.p>
</Sidebar.ContentSection>
<Sidebar.ContentSection>(WIP)</Sidebar.ContentSection>
</>
)
}
31 changes: 31 additions & 0 deletions app/(components)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import FullLayout from '@/components/layout/full-layout'
import Sidebar from '@/components/layout/sidebar'
import HeroTitle from '@/components/ui/hero-title'
import type { PropsWithChildren } from 'react'

export default async function ({ children }: PropsWithChildren) {
return (
<FullLayout withHeaderLogo>
<Sidebar.Layout>
<Sidebar>
<HeroTitle as="div" size="md">
Components
</HeroTitle>
<section>
<ul>
<li>Avatar</li>
<li>Badge</li>
<li>Button</li>
<li>Combobox</li>
<li>Checkbox</li>
<li>Input</li>
<li>RadioGroup</li>
<li>Select</li>
</ul>
</section>
</Sidebar>
<Sidebar.Content>{children}</Sidebar.Content>
</Sidebar.Layout>
</FullLayout>
)
}
82 changes: 82 additions & 0 deletions app/(tokens)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import FullLayout from '@/components/layout/full-layout'
import Sidebar from '@/components/layout/sidebar'
import HeroTitle from '@/components/ui/hero-title'
import type { PropsWithChildren } from 'react'

export default async function ({ children }: PropsWithChildren) {
return (
<FullLayout withHeaderLogo>
<Sidebar.Layout>
<Sidebar>
<HeroTitle as="div" size="md">
Theme
</HeroTitle>
<section>
<HeroTitle as="div" size="xs">
Units
</HeroTitle>
<ul>
<li>Root Value</li>
<li>Sizes</li>
<li>Spacings</li>
<li>Z-Indices</li>
</ul>
</section>
<section>
<HeroTitle as="div" size="xs">
Colors
</HeroTitle>
<ul>
<li>Palette</li>
<li>Gradients</li>
</ul>
</section>
<section>
<HeroTitle as="div" size="xs">
Borders
</HeroTitle>
<ul>
<li>Radius</li>
<li>Borders</li>
<li>Border Widths</li>
</ul>
</section>
<section>
<HeroTitle as="div" size="xs">
Effects
</HeroTitle>
<ul>
<li>Blurs</li>
<li>Shadows</li>
<li>Opacity</li>
</ul>
</section>
<section>
<HeroTitle as="div" size="xs">
Typography
</HeroTitle>
<ul>
<li>Root Size</li>
<li>Font Sizes</li>
<li>Font Weights</li>
<li>Line Heights</li>
<li>Letter Spacings</li>
</ul>
</section>
<section>
<HeroTitle as="div" size="xs">
Animation
</HeroTitle>
<ul>
<li>Easings</li>
<li>Durations</li>
<li>Keyframes</li>
<li>Animations</li>
</ul>
</section>
</Sidebar>
<Sidebar.Content>{children}</Sidebar.Content>
</Sidebar.Layout>
</FullLayout>
)
}
17 changes: 17 additions & 0 deletions app/(tokens)/theme/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Sidebar from '@/components/layout/sidebar'
import HeroTitle from '@/components/ui/hero-title'
import { panda } from '@/styled-system/jsx'

export default async function () {
return (
<>
<Sidebar.ContentSection>
<HeroTitle size="xl">Colors</HeroTitle>
<panda.p color="gray.fg1" fontSize="xl">
Learn how to work with our color system. Right click to copy raw values.
</panda.p>
</Sidebar.ContentSection>
<Sidebar.ContentSection>(WIP)</Sidebar.ContentSection>
</>
)
}
10 changes: 0 additions & 10 deletions app/components/page.tsx

This file was deleted.

26 changes: 15 additions & 11 deletions app/error.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use client' // Error components must be Client Components

import ContainerCentered from '@/components/layout/container-centered'
import FullLayout from '@/components/layout/full-layout'
import { BlackButton } from '@/components/ui/button'
import { useEffect } from 'react'

Expand All @@ -16,16 +18,18 @@ export default function ({
}, [error])

return (
<>
<h1>Something went wrong</h1>
<p>
An error occurred while loading this page. Please try again later. If the problem persists, contact support with
the following error code:{' '}
<pre className="badge-lg">
<code>{error.digest}</code>
</pre>
</p>
<BlackButton onClick={reset}>Try again</BlackButton>
</>
<FullLayout withHeaderLogo withBgPattern withFooter>
<ContainerCentered>
<h1>Something went wrong</h1>
<p>
An error occurred while loading this page. Please try again later. If the problem persists, contact support
with the following error code:{' '}
<pre className="badge-lg">
<code>{error.digest}</code>
</pre>
</p>
<BlackButton onClick={reset}>Try again</BlackButton>
</ContainerCentered>
</FullLayout>
)
}
5 changes: 3 additions & 2 deletions app/examples/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import FullLayout from '@/components/layout/full-layout'
import HeroTitle from '@/components/ui/hero-title'

export default async function () {
return (
<div>
<FullLayout withFooter withHeaderLogo>
<HeroTitle>Examples</HeroTitle>
(WIP)
</div>
</FullLayout>
)
}
9 changes: 1 addition & 8 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import FullLayout from '@/components/layout/full-layout'
import './globals.css'

import { sansFontClass } from '@/app/fonts'
import { Providers } from '@/components/providers'
import seoConfig from '@/lib/seo.config'
import { panda } from '@/styled-system/jsx'
import { Analytics } from '@vercel/analytics/react'
import type { Viewport } from 'next'
import type { PropsWithChildren } from 'react'
Expand All @@ -21,12 +19,7 @@ export default async function RootLayout({ children }: PropsWithChildren) {
return (
<html lang="en" className={sansFontClass} suppressHydrationWarning>
<body>
<panda.div />
<Providers>
<FullLayout withHeaderLogo withBgPattern>
{children}
</FullLayout>
</Providers>
<Providers>{children}</Providers>
<Analytics />
</body>
</html>
Expand Down
5 changes: 3 additions & 2 deletions app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import ContainerCentered from '@/components/layout/container-centered'
import FullLayout from '@/components/layout/full-layout'
import HeroTitle from '@/components/ui/hero-title'

export default async function () {
return (
<>
<FullLayout withHeaderLogo withBgPattern withFooter>
<ContainerCentered>
<HeroTitle size="xl">Page Not Found</HeroTitle>
<p>The page you are looking for does not exist. Please check the URL in the address bar and try again.</p>
</ContainerCentered>
</>
</FullLayout>
)
}
49 changes: 26 additions & 23 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import FullLayout from '@/components/layout/full-layout'
import { PrimaryButton } from '@/components/ui/button'
import HeroTitle from '@/components/ui/hero-title'
import { cn } from '@/lib/utils'
Expand Down Expand Up @@ -36,35 +37,37 @@ function HeadlineText() {

export default async function () {
return (
<div
className={css({
display: 'flex',
flex: 1,
alignItems: 'center',
color: 'fg.contrast',
})}
>
<FullLayout withBgPattern withFooter withHeaderLogo>
<div
className={css({
display: 'flex',
flex: 1,
flexDirection: 'column',
alignItems: 'start',
justifyContent: 'start',
textAlign: 'left',
gap: '4',
padding: '8',
maxWidth: '600px',
alignItems: 'center',
color: 'fg.contrast',
})}
>
<HeroTitle>Panda Theme Generator</HeroTitle>
<HeadlineText />
<PrimaryButton asChild>
<Link href="/components">
Get started <ArrowRight />
</Link>
</PrimaryButton>
<div
className={css({
display: 'flex',
flex: 1,
flexDirection: 'column',
alignItems: 'start',
justifyContent: 'start',
textAlign: 'left',
gap: '4',
padding: '8',
maxWidth: '600px',
})}
>
<HeroTitle>Panda Theme Generator</HeroTitle>
<HeadlineText />
<PrimaryButton asChild>
<Link href="/theme">
Get started <ArrowRight />
</Link>
</PrimaryButton>
</div>
</div>
</div>
</FullLayout>
)
}
4 changes: 3 additions & 1 deletion components/layout/full-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type FullLayoutProps = {
withBgAnimation?: boolean
withHeaderLogo?: boolean
withHeaderSearch?: boolean
withFooter?: boolean
}

export default async function FullLayout({
Expand All @@ -21,6 +22,7 @@ export default async function FullLayout({
withBgAnimation,
withHeaderLogo,
withHeaderSearch,
withFooter,
}: FullLayoutProps) {
return (
<LayoutRoot
Expand All @@ -31,7 +33,7 @@ export default async function FullLayout({
>
<LayoutHeader withLogo={withHeaderLogo} withSearch={withHeaderSearch} />
<LayoutMain>{children}</LayoutMain>
<LayoutFooter />
{withFooter && <LayoutFooter />}
</LayoutRoot>
)
}
Loading

0 comments on commit 8f81f48

Please sign in to comment.