Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

45 feature add syntax highlighting to docssandbox #46

Merged
merged 4 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"oxlint",
"Positionals",
"rehype",
"tseslint"
"Shiki",
"shikijs",
"tseslint",
"Twoslash"
],
"prettier.configPath": ".prettierrc",
"prettier.prettierPath": "./node_modules/prettier",
Expand Down
43 changes: 43 additions & 0 deletions docs/app/components/Admonition.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { css } from '@/styled-system/css'
import { hstack } from '@/styled-system/patterns'
import { Information } from '@cerberus-design/icons'
import type { PropsWithChildren } from 'react'

// TODO: Replace with React version when available

interface AdmonitionProps {
heading: string
description: string
}

export function Admonition(props: PropsWithChildren<AdmonitionProps>) {
return (
<div
className={css({
borderColor: 'info.border.initial',
bgColor: 'info.surface.initial',
color: 'info.text.initial',
mb: '6',
p: '4',
rounded: 'xl',
})}
>
<div
className={hstack({
pb: '2',
})}
>
<Information aria-hidden size="1.25rem" />
<p
className={css({
pb: 'initial !important',
textStyle: 'h5 !important',
})}
>
{props.heading}
</p>
</div>
<p>{props.description}</p>
</div>
)
}
21 changes: 21 additions & 0 deletions docs/app/icons/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { PropsWithChildren } from 'react'
import { cx } from '@/styled-system/css'
import { container } from '@/styled-system/patterns'
import { markdown } from '../styles/markdown'

interface IconsProps {}

export default function IconsLayout(props: PropsWithChildren<IconsProps>) {
return (
<div
className={cx(
container({
pt: '12',
}),
markdown,
)}
>
{props.children}
</div>
)
}
17 changes: 17 additions & 0 deletions docs/app/icons/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {
Admonition,
AdmonitionHeading,
AdmonitionText,
} from '@/app/components/Admonition'

# Overview

The Cerberus Icons library is a optional library to add visual elements to your React app.

## Installation

Install the Cerberus Icons library, with the package manager of your choice:

```bash
pnpm install '@cerberus-design/icons'
```
13 changes: 10 additions & 3 deletions docs/app/icons/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
export default function LearnPage() {
import { css } from '@/styled-system/css'
import Overview from './overview.mdx'

export default function IconsPage() {
return (
<main>
<h1>Learn</h1>
<main
className={css({
py: '6',
})}
>
<Overview />
</main>
)
}
12 changes: 10 additions & 2 deletions docs/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import type { Metadata } from 'next'
import { Poppins } from 'next/font/google'
import type { PropsWithChildren } from 'react'
import { ThemeProvider } from '@cerberus-design/react'
import { css, cx } from '@/styled-system/css'
import { Nav } from './components/Nav'

import './night-owl.css'
import './two-slash.css'
import './globals.css'

const poppins = Poppins({
Expand All @@ -24,7 +25,14 @@ interface RootProps {}
export default function RootLayout(props: PropsWithChildren<RootProps>) {
return (
<html lang="en" data-theme="cerberus" data-color-mode="light">
<body className={poppins.className}>
<body
className={cx(
poppins.className,
css({
minW: '18.75rem',
}),
)}
>
<ThemeProvider>
<Nav />
{props.children}
Expand Down
157 changes: 0 additions & 157 deletions docs/app/night-owl.css

This file was deleted.

21 changes: 21 additions & 0 deletions docs/app/preset/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { PropsWithChildren } from 'react'
import { cx } from '@/styled-system/css'
import { container } from '@/styled-system/patterns'
import { markdown } from '../styles/markdown'

interface PresetProps {}

export default function PresetLayout(props: PropsWithChildren<PresetProps>) {
return (
<div
className={cx(
container({
pt: '12',
}),
markdown,
)}
>
{props.children}
</div>
)
}
17 changes: 17 additions & 0 deletions docs/app/preset/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {
Admonition,
AdmonitionHeading,
AdmonitionText,
} from '@/app/components/Admonition'

# Overview

The Cerberus Panda CSS Preset adds a set of core features to the Cerberus Design System.

## Installation

Install the Cerberus Panda Preset library, with the package manager of your choice:

```bash
pnpm install '@cerberus-design/panda-preset'
```
13 changes: 10 additions & 3 deletions docs/app/preset/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
export default function BlogPage() {
import { css } from '@/styled-system/css'
import Overview from './overview.mdx'

export default function PresetPage() {
return (
<main>
<h1>Blog</h1>
<main
className={css({
py: '6',
})}
>
<Overview />
</main>
)
}
18 changes: 10 additions & 8 deletions docs/app/react/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import type { Metadata } from 'next'
import type { PropsWithChildren } from 'react'
import { cx } from '@/styled-system/css'
import { container } from '@/styled-system/patterns'
import { markdown } from '../styles/markdown'

export const metadata: Metadata = {
title: 'Cerberus Design System | React',
description:
'The Cerberus Design System React library provides a set of components and utilities to help you build your application.',
}

interface ReactProps {}

export default function ReactLayout(props: PropsWithChildren<ReactProps>) {
return (
<div className={markdown}>
<div
className={cx(
container({
pt: '12',
}),
markdown,
)}
>
<header>Nav sidebar</header>
{props.children}
</div>
Expand Down
Loading