@atom63/create 0.0.0-stage → 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +27 -0
- package/README.md +70 -2
- package/package.json +27 -3
- package/src/generate.mjs +281 -0
- package/src/index.mjs +64 -0
- package/starter/app/AGENTS.md +17 -0
- package/starter/app/README.md +40 -0
- package/starter/app/src/app.ts +4 -0
- package/starter/app/src/components/app-layout.tsx +49 -0
- package/starter/app/src/components/appearance-settings.tsx +87 -0
- package/starter/app/src/pages/not-found.tsx +30 -0
- package/starter/app/src/router.tsx +79 -0
- package/starter/app/src/styles.css +31 -0
- package/starter/app/vite.config.ts +10 -0
- package/starter/base/_gitignore +4 -0
- package/starter/base/components.json +21 -0
- package/starter/base/index.html +12 -0
- package/starter/base/src/lib/utils.ts +7 -0
- package/starter/base/src/main.tsx +21 -0
- package/starter/base/src/theme.tsx +89 -0
- package/starter/base/tsconfig.json +21 -0
- package/starter/content/AGENTS.md +16 -0
- package/starter/content/README.md +35 -0
- package/starter/content/src/components/site-footer.tsx +9 -0
- package/starter/content/src/components/site-header.tsx +32 -0
- package/starter/content/src/mdx.d.ts +7 -0
- package/starter/content/src/styles.css +32 -0
- package/starter/content/vite.config.ts +25 -0
- package/starter/docs/src/components/docs-sidebar.tsx +35 -0
- package/starter/docs/src/content/docs/installation.mdx +22 -0
- package/starter/docs/src/content/docs/introduction.mdx +22 -0
- package/starter/docs/src/content/docs/writing-pages.mdx +36 -0
- package/starter/docs/src/content/docs.ts +60 -0
- package/starter/docs/src/pages/doc-page.tsx +57 -0
- package/starter/docs/src/pages/home.tsx +39 -0
- package/starter/docs/src/pages/not-found.tsx +30 -0
- package/starter/docs/src/router.tsx +86 -0
- package/starter/docs/src/site.ts +7 -0
- package/starter/portfolio/AGENTS.md +28 -0
- package/starter/portfolio/README.md +152 -0
- package/starter/portfolio/public/plates/hero.svg +40 -0
- package/starter/portfolio/public/projects/front-desk-scheduling/calendar.svg +30 -0
- package/starter/portfolio/public/projects/front-desk-scheduling/cover.svg +28 -0
- package/starter/portfolio/public/projects/ledger-design-system/cover.svg +13 -0
- package/starter/portfolio/public/projects/night-trip-planner/cover.svg +19 -0
- package/starter/portfolio/public/projects/night-trip-planner/flow.svg +34 -0
- package/starter/portfolio/src/components/mdx-components.tsx +25 -0
- package/starter/portfolio/src/components/project-card.tsx +32 -0
- package/starter/portfolio/src/components/site-footer.tsx +33 -0
- package/starter/portfolio/src/components/site-header.tsx +124 -0
- package/starter/portfolio/src/components/site-layout.tsx +62 -0
- package/starter/portfolio/src/content/projects/front-desk-scheduling.mdx +47 -0
- package/starter/portfolio/src/content/projects/ledger-design-system.mdx +40 -0
- package/starter/portfolio/src/content/projects/night-trip-planner.mdx +51 -0
- package/starter/portfolio/src/content/projects.ts +43 -0
- package/starter/portfolio/src/content/resume.ts +80 -0
- package/starter/portfolio/src/content/timeline.ts +69 -0
- package/starter/portfolio/src/content/writing/a-design-system-for-one.mdx +21 -0
- package/starter/portfolio/src/content/writing/case-studies-that-show-the-work.mdx +24 -0
- package/starter/portfolio/src/content/writing/designing-for-interruptions.mdx +23 -0
- package/starter/portfolio/src/content/writing.ts +37 -0
- package/starter/portfolio/src/modules/assistant/answers.ts +60 -0
- package/starter/portfolio/src/modules/assistant/assistant.tsx +107 -0
- package/starter/portfolio/src/modules/assistant/transport.ts +36 -0
- package/starter/portfolio/src/modules/dock/dock.tsx +141 -0
- package/starter/portfolio/src/modules/slides/decks.ts +49 -0
- package/starter/portfolio/src/modules/slides/slides-pages.tsx +128 -0
- package/starter/portfolio/src/modules/widgets/widget-board.tsx +121 -0
- package/starter/portfolio/src/pages/home.tsx +139 -0
- package/starter/portfolio/src/pages/not-found.tsx +30 -0
- package/starter/portfolio/src/pages/project-page.tsx +102 -0
- package/starter/portfolio/src/pages/projects-index.tsx +39 -0
- package/starter/portfolio/src/pages/resume.tsx +97 -0
- package/starter/portfolio/src/pages/timeline.tsx +89 -0
- package/starter/portfolio/src/pages/writing-index.tsx +64 -0
- package/starter/portfolio/src/pages/writing-post.tsx +43 -0
- package/starter/portfolio/src/portfolio.config.ts +88 -0
- package/starter/portfolio/src/router.tsx +113 -0
- package/starter/portfolio/src/styles.css +38 -0
- package/starter/site/src/content/blog/hello-world.mdx +25 -0
- package/starter/site/src/content/blog/writing-with-mdx.mdx +29 -0
- package/starter/site/src/content/posts.ts +37 -0
- package/starter/site/src/pages/blog-index.tsx +60 -0
- package/starter/site/src/pages/blog-post.tsx +43 -0
- package/starter/site/src/pages/home.tsx +143 -0
- package/starter/site/src/pages/not-found.tsx +30 -0
- package/starter/site/src/router.tsx +82 -0
- package/starter/site/src/site.ts +7 -0
- package/versions.json +27 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Writing pages
|
|
3
|
+
description: Markdown, code, tables and design system blocks in a page.
|
|
4
|
+
group: Guides
|
|
5
|
+
order: 1
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Markdown
|
|
9
|
+
|
|
10
|
+
Headings, lists, links and **emphasis** work as usual. Level two and three headings appear in the
|
|
11
|
+
table of contents.
|
|
12
|
+
|
|
13
|
+
## Code
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { Button } from '@atom63/ui-react'
|
|
17
|
+
|
|
18
|
+
export function SaveButton() {
|
|
19
|
+
return <Button>Save</Button>
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Tables
|
|
24
|
+
|
|
25
|
+
| Frontmatter | Purpose |
|
|
26
|
+
| ------------- | -------------------------- |
|
|
27
|
+
| `title` | The page heading |
|
|
28
|
+
| `description` | The line under the heading |
|
|
29
|
+
| `group` | The sidebar group |
|
|
30
|
+
| `order` | The position in the group |
|
|
31
|
+
|
|
32
|
+
## Blocks
|
|
33
|
+
|
|
34
|
+
<Callout type="success">
|
|
35
|
+
Blocks from `@atom63/mdx/blocks`, such as this callout, work in every page.
|
|
36
|
+
</Callout>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ComponentType } from 'react'
|
|
2
|
+
|
|
3
|
+
export type Doc = {
|
|
4
|
+
Content: ComponentType
|
|
5
|
+
description: string
|
|
6
|
+
group: string
|
|
7
|
+
order: number
|
|
8
|
+
slug: string
|
|
9
|
+
title: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type DocModule = {
|
|
13
|
+
default: ComponentType
|
|
14
|
+
frontmatter: { description: string; group: string; order: number; title: string }
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Every `docs/*.mdx` file is a page; its file name is the slug. Pages are
|
|
19
|
+
* grouped by the `group` frontmatter, in the order the groups first appear
|
|
20
|
+
* when sorted, and ordered inside a group by `order`.
|
|
21
|
+
*/
|
|
22
|
+
const modules = import.meta.glob<DocModule>('./docs/*.mdx', { eager: true })
|
|
23
|
+
|
|
24
|
+
const groupOrder = ['Getting started', 'Guides']
|
|
25
|
+
|
|
26
|
+
export const docs: Doc[] = Object.entries(modules)
|
|
27
|
+
.map(([path, module]) => ({
|
|
28
|
+
Content: module.default,
|
|
29
|
+
...module.frontmatter,
|
|
30
|
+
slug: path.slice(path.lastIndexOf('/') + 1, -'.mdx'.length),
|
|
31
|
+
}))
|
|
32
|
+
.sort(
|
|
33
|
+
(left, right) =>
|
|
34
|
+
rank(left.group) - rank(right.group) ||
|
|
35
|
+
left.group.localeCompare(right.group) ||
|
|
36
|
+
left.order - right.order
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
function rank(group: string): number {
|
|
40
|
+
const position = groupOrder.indexOf(group)
|
|
41
|
+
return position === -1 ? groupOrder.length : position
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** The groups, each with its pages, in reading order. */
|
|
45
|
+
export const groups = docs.reduce<{ docs: Doc[]; name: string }[]>((result, doc) => {
|
|
46
|
+
const group = result.find(item => item.name === doc.group)
|
|
47
|
+
if (group) group.docs.push(doc)
|
|
48
|
+
else result.push({ docs: [doc], name: doc.group })
|
|
49
|
+
return result
|
|
50
|
+
}, [])
|
|
51
|
+
|
|
52
|
+
export function findDoc(slug: string): Doc | undefined {
|
|
53
|
+
return docs.find(doc => doc.slug === slug)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** The pages before and after one, for reading straight through. */
|
|
57
|
+
export function neighbours(slug: string): { next?: Doc; previous?: Doc } {
|
|
58
|
+
const index = docs.findIndex(doc => doc.slug === slug)
|
|
59
|
+
return { next: docs[index + 1], previous: index > 0 ? docs[index - 1] : undefined }
|
|
60
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { DocsMDXContentProvider } from '@atom63/mdx'
|
|
2
|
+
import { createMdxComponents } from '@atom63/mdx/article'
|
|
3
|
+
import { PageMeta, PageTableOfContents } from '@atom63/mdx/blocks'
|
|
4
|
+
import { Button } from '@atom63/ui-react'
|
|
5
|
+
import { Page, ReaderLayout } from '@atom63/ui-react/layout'
|
|
6
|
+
import { Link, useParams } from '@tanstack/react-router'
|
|
7
|
+
import { ArrowLeft, ArrowRight } from 'lucide-react'
|
|
8
|
+
|
|
9
|
+
import { findDoc, neighbours } from '../content/docs'
|
|
10
|
+
import { NotFoundPage } from './not-found'
|
|
11
|
+
|
|
12
|
+
// Core prose plus the @atom63/mdx blocks (Callout, Steps, Tabs, …) for every page.
|
|
13
|
+
const components = createMdxComponents()
|
|
14
|
+
|
|
15
|
+
export function DocPage() {
|
|
16
|
+
const { slug } = useParams({ from: '/site/docs/$slug' })
|
|
17
|
+
const doc = findDoc(slug)
|
|
18
|
+
if (!doc) {
|
|
19
|
+
return <NotFoundPage />
|
|
20
|
+
}
|
|
21
|
+
const { Content } = doc
|
|
22
|
+
const { next, previous } = neighbours(slug)
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
// Page renders <main>, where the table of contents looks for headings.
|
|
26
|
+
<Page noPadding>
|
|
27
|
+
<ReaderLayout aside={<PageTableOfContents label="On this page" />}>
|
|
28
|
+
<DocsMDXContentProvider components={components}>
|
|
29
|
+
<PageMeta description={doc.description} eyebrow={doc.group} title={doc.title} />
|
|
30
|
+
<Content />
|
|
31
|
+
</DocsMDXContentProvider>
|
|
32
|
+
<nav aria-label="Pages" className="flex flex-wrap justify-between gap-3 pt-8">
|
|
33
|
+
{previous ? (
|
|
34
|
+
<Button
|
|
35
|
+
render={<Link params={{ slug: previous.slug }} to="/docs/$slug" />}
|
|
36
|
+
variant="outline"
|
|
37
|
+
>
|
|
38
|
+
<ArrowLeft aria-hidden />
|
|
39
|
+
{previous.title}
|
|
40
|
+
</Button>
|
|
41
|
+
) : (
|
|
42
|
+
<span />
|
|
43
|
+
)}
|
|
44
|
+
{next ? (
|
|
45
|
+
<Button
|
|
46
|
+
render={<Link params={{ slug: next.slug }} to="/docs/$slug" />}
|
|
47
|
+
variant="outline"
|
|
48
|
+
>
|
|
49
|
+
{next.title}
|
|
50
|
+
<ArrowRight aria-hidden />
|
|
51
|
+
</Button>
|
|
52
|
+
) : null}
|
|
53
|
+
</nav>
|
|
54
|
+
</ReaderLayout>
|
|
55
|
+
</Page>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Card, CardContent, CardDescription, CardTitle } from '@atom63/ui-react'
|
|
2
|
+
import { Container, Page, Section, SectionHeader } from '@atom63/ui-react/layout'
|
|
3
|
+
import { Link } from '@tanstack/react-router'
|
|
4
|
+
|
|
5
|
+
import { groups } from '../content/docs'
|
|
6
|
+
import { site } from '../site'
|
|
7
|
+
|
|
8
|
+
export function HomePage() {
|
|
9
|
+
return (
|
|
10
|
+
<Page>
|
|
11
|
+
<Container>
|
|
12
|
+
<Section removeTopSpacing>
|
|
13
|
+
<SectionHeader description={site.description} level={1} title={site.tagline} />
|
|
14
|
+
</Section>
|
|
15
|
+
{groups.map(group => (
|
|
16
|
+
<Section key={group.name}>
|
|
17
|
+
<SectionHeader level={2} title={group.name} variant="secondary" />
|
|
18
|
+
<ul className="grid gap-4 md:grid-cols-2">
|
|
19
|
+
{group.docs.map(doc => (
|
|
20
|
+
<li key={doc.slug}>
|
|
21
|
+
<Card>
|
|
22
|
+
<CardContent>
|
|
23
|
+
<CardTitle>
|
|
24
|
+
<Link params={{ slug: doc.slug }} to="/docs/$slug">
|
|
25
|
+
{doc.title}
|
|
26
|
+
</Link>
|
|
27
|
+
</CardTitle>
|
|
28
|
+
<CardDescription>{doc.description}</CardDescription>
|
|
29
|
+
</CardContent>
|
|
30
|
+
</Card>
|
|
31
|
+
</li>
|
|
32
|
+
))}
|
|
33
|
+
</ul>
|
|
34
|
+
</Section>
|
|
35
|
+
))}
|
|
36
|
+
</Container>
|
|
37
|
+
</Page>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
Empty,
|
|
4
|
+
EmptyContent,
|
|
5
|
+
EmptyDescription,
|
|
6
|
+
EmptyHeader,
|
|
7
|
+
EmptyTitle,
|
|
8
|
+
} from '@atom63/ui-react'
|
|
9
|
+
import { Container, Page } from '@atom63/ui-react/layout'
|
|
10
|
+
import { Link } from '@tanstack/react-router'
|
|
11
|
+
|
|
12
|
+
export function NotFoundPage() {
|
|
13
|
+
return (
|
|
14
|
+
<Page>
|
|
15
|
+
<Container maxWidth="narrow">
|
|
16
|
+
<Empty>
|
|
17
|
+
<EmptyHeader>
|
|
18
|
+
<EmptyTitle>Page not found</EmptyTitle>
|
|
19
|
+
<EmptyDescription>
|
|
20
|
+
The page you are looking for does not exist or has moved.
|
|
21
|
+
</EmptyDescription>
|
|
22
|
+
</EmptyHeader>
|
|
23
|
+
<EmptyContent>
|
|
24
|
+
<Button render={<Link to="/" />}>Go home</Button>
|
|
25
|
+
</EmptyContent>
|
|
26
|
+
</Empty>
|
|
27
|
+
</Container>
|
|
28
|
+
</Page>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createRootRoute,
|
|
3
|
+
createRoute,
|
|
4
|
+
createRouter,
|
|
5
|
+
Outlet,
|
|
6
|
+
ScrollRestoration,
|
|
7
|
+
} from '@tanstack/react-router'
|
|
8
|
+
import type { ReactNode } from 'react'
|
|
9
|
+
|
|
10
|
+
import { DocsSidebar } from './components/docs-sidebar'
|
|
11
|
+
import { SiteFooter } from './components/site-footer'
|
|
12
|
+
import { type NavItem, SiteHeader } from './components/site-header'
|
|
13
|
+
import { docs } from './content/docs'
|
|
14
|
+
import { DocPage } from './pages/doc-page'
|
|
15
|
+
import { HomePage } from './pages/home'
|
|
16
|
+
import { NotFoundPage } from './pages/not-found'
|
|
17
|
+
import { site } from './site'
|
|
18
|
+
|
|
19
|
+
const nav: NavItem[] = [
|
|
20
|
+
{ label: 'Home', to: '/' },
|
|
21
|
+
...(docs[0] ? [{ label: 'Docs', to: `/docs/${docs[0].slug}` }] : []),
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
function SiteLayout({ children }: { children: ReactNode }) {
|
|
25
|
+
return (
|
|
26
|
+
<div className="flex min-h-screen flex-col">
|
|
27
|
+
<SiteHeader nav={nav} title={site.title} />
|
|
28
|
+
<div className="mx-auto flex w-full max-w-7xl flex-1 flex-col md:flex-row">
|
|
29
|
+
<aside
|
|
30
|
+
aria-label="Documentation"
|
|
31
|
+
className="border-border border-b md:sticky md:top-0 md:max-h-screen md:w-64 md:shrink-0 md:self-start md:overflow-y-auto md:border-e md:border-b-0"
|
|
32
|
+
>
|
|
33
|
+
<DocsSidebar />
|
|
34
|
+
</aside>
|
|
35
|
+
<div className="min-w-0 flex-1">{children}</div>
|
|
36
|
+
</div>
|
|
37
|
+
<SiteFooter title={site.title} />
|
|
38
|
+
</div>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const rootRoute = createRootRoute({
|
|
43
|
+
component: () => (
|
|
44
|
+
<>
|
|
45
|
+
<ScrollRestoration />
|
|
46
|
+
<Outlet />
|
|
47
|
+
</>
|
|
48
|
+
),
|
|
49
|
+
notFoundComponent: () => (
|
|
50
|
+
<SiteLayout>
|
|
51
|
+
<NotFoundPage />
|
|
52
|
+
</SiteLayout>
|
|
53
|
+
),
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
* The docs pages share the header, sidebar and footer through this pathless
|
|
58
|
+
* layout route. A full-window page, such as an AppView, is a child of
|
|
59
|
+
* rootRoute instead, so it draws no site chrome.
|
|
60
|
+
*/
|
|
61
|
+
const siteRoute = createRoute({
|
|
62
|
+
getParentRoute: () => rootRoute,
|
|
63
|
+
id: 'site',
|
|
64
|
+
component: () => (
|
|
65
|
+
<SiteLayout>
|
|
66
|
+
<Outlet />
|
|
67
|
+
</SiteLayout>
|
|
68
|
+
),
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
const homeRoute = createRoute({ getParentRoute: () => siteRoute, path: '/', component: HomePage })
|
|
72
|
+
const docRoute = createRoute({
|
|
73
|
+
getParentRoute: () => siteRoute,
|
|
74
|
+
path: '/docs/$slug',
|
|
75
|
+
component: DocPage,
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
export const router = createRouter({
|
|
79
|
+
routeTree: rootRoute.addChildren([siteRoute.addChildren([homeRoute, docRoute])]),
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
declare module '@tanstack/react-router' {
|
|
83
|
+
interface Register {
|
|
84
|
+
router: typeof router
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The few words the starter shows about your docs. Change them first. */
|
|
2
|
+
export const site = {
|
|
3
|
+
title: '{{title}}',
|
|
4
|
+
tagline: 'Documentation built on the Atom63 design system.',
|
|
5
|
+
description:
|
|
6
|
+
'Guides and reference written in MDX, with the same components and tokens as the product.',
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
This portfolio is built on the Atom63 design system. Components come from `@atom63/ui-react`,
|
|
2
|
+
tokens from `@atom63/styles`, long-form content from `@atom63/mdx`, the assistant from
|
|
3
|
+
`@atom63/agent` and the widgets from `@atom63/widgets`.
|
|
4
|
+
|
|
5
|
+
## Project
|
|
6
|
+
|
|
7
|
+
- `pnpm dev` runs the site; `pnpm typecheck` and `pnpm build` must pass before a change is done.
|
|
8
|
+
- `src/portfolio.config.ts` is the one config file: the person, the creative axes (brand, surface,
|
|
9
|
+
radius, font), the hero plate and the optional modules. Read it first.
|
|
10
|
+
- Routes live in `src/router.tsx`. Every page is a child of `siteRoute`, which renders
|
|
11
|
+
`src/components/site-layout.tsx`: the header, footer, assistant and dock, and the `data-a63-*`
|
|
12
|
+
attributes from the config. A module's routes are added only when it is on.
|
|
13
|
+
- Content is in `src/content`: case studies in `projects/*.mdx`, posts in `writing/*.mdx` (the file
|
|
14
|
+
name is the slug; `projects.ts` and `writing.ts` list the frontmatter fields), the resume in
|
|
15
|
+
`resume.ts` and the timeline in `timeline.ts`. The sample content is about a fictional person;
|
|
16
|
+
replace it rather than adding to it.
|
|
17
|
+
- MDX files can use the blocks in `src/components/mdx-components.tsx` without importing them. Add a
|
|
18
|
+
block there.
|
|
19
|
+
- Optional modules live in `src/modules/<name>` and are switched in the config. Keep a module's code
|
|
20
|
+
in its folder, and keep the site working with it off.
|
|
21
|
+
- The assistant's transport is `src/modules/assistant/transport.ts`. It answers offline from the
|
|
22
|
+
content; a real transport calls the site's own server, never a model API with a key in the browser.
|
|
23
|
+
- `src/templates` holds the chat panel block the assistant draws with. It is the site's own code now.
|
|
24
|
+
- Mode and theme are set once in `src/theme.tsx` through `Atom63Theme`. Style with tokens and the
|
|
25
|
+
Tailwind utilities mapped onto them (`bg-background`, `text-muted-foreground`, `border-border`).
|
|
26
|
+
- `npx shadcn add <component>` works (see `components.json`). Use it only for something the design
|
|
27
|
+
system does not offer; its components pick up the same tokens through the shadcn bridge.
|
|
28
|
+
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# {{title}}
|
|
2
|
+
|
|
3
|
+
A portfolio built on the [Atom63 design system](https://system.atom63.io): React, TanStack Router,
|
|
4
|
+
Tailwind CSS and MDX, with every color, space and radius coming from the system's tokens.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
pnpm install
|
|
8
|
+
pnpm dev
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
| Command | What it does |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `pnpm dev` | Start the dev server |
|
|
14
|
+
| `pnpm build` | Typecheck and build to `dist/` |
|
|
15
|
+
| `pnpm typecheck` | Typecheck only |
|
|
16
|
+
| `pnpm preview` | Serve the built site |
|
|
17
|
+
|
|
18
|
+
All the sample content is about a fictional person, Rowan Vale, and fictional companies. Replace it
|
|
19
|
+
with yours: start with `src/portfolio.config.ts`, then the folders under `src/content`.
|
|
20
|
+
|
|
21
|
+
## Pages
|
|
22
|
+
|
|
23
|
+
| Route | Page | Content from |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `/` | Home: the hero plate, your headline and intro, featured projects, writing and experience | `portfolio.config.ts`, projects with `featured: true` |
|
|
26
|
+
| `/projects` | Every project | `src/content/projects/*.mdx` |
|
|
27
|
+
| `/projects/<slug>` | A case study: role, timeline, team, tools, cover, then problem, role, process and outcome | One `.mdx` file |
|
|
28
|
+
| `/writing` | Every post | `src/content/writing/*.mdx` |
|
|
29
|
+
| `/writing/<slug>` | A post | One `.mdx` file |
|
|
30
|
+
| `/timeline` | Projects, writing, roles and milestones in one line, by year | `src/content/timeline.ts` |
|
|
31
|
+
| `/resume` | The resume, ready to print or save as a PDF | `src/content/resume.ts` |
|
|
32
|
+
|
|
33
|
+
A file's name is its slug. The frontmatter fields a project needs are listed in
|
|
34
|
+
`src/content/projects.ts`; a post needs `title`, `description` and `date`.
|
|
35
|
+
|
|
36
|
+
## Modules
|
|
37
|
+
|
|
38
|
+
Optional modules are switched in one place, `modules` in `src/portfolio.config.ts`. A module adds
|
|
39
|
+
its own route, link or section when it is on; nothing else needs to change.
|
|
40
|
+
|
|
41
|
+
| Module | Default | What it adds | Code |
|
|
42
|
+
| --- | --- | --- | --- |
|
|
43
|
+
| `assistant` | on | An "Ask" button and a chat sheet that answers questions about you | `src/modules/assistant` |
|
|
44
|
+
| `slides` | off | `/slides` and a deck viewer at `/slides/<slug>`, with a Slides link | `src/modules/slides` |
|
|
45
|
+
| `widgetBoard` | off | A "Right now" board of widgets on the home page: local time, current role, latest post | `src/modules/widgets` |
|
|
46
|
+
| `dock` | off | A bottom dock with the site's sections and two mini apps, a clock and a notepad | `src/modules/dock` |
|
|
47
|
+
|
|
48
|
+
### The assistant
|
|
49
|
+
|
|
50
|
+
The assistant runs on [`@atom63/agent`](https://system.atom63.io/docs/agent) and draws
|
|
51
|
+
with the chat panel block (`src/templates/blocks/chat-panel`), so it streams, stops and clears like
|
|
52
|
+
a real chat. Out of the box it answers offline from your own content (`answers.ts`), with no model
|
|
53
|
+
and no API key.
|
|
54
|
+
|
|
55
|
+
To answer with a model, replace `transport` in `src/modules/assistant/transport.ts` with one that
|
|
56
|
+
calls your own server. Never put an API key in the browser. A transport is any object with a
|
|
57
|
+
`stream()` that yields `response-start`, `text-delta` and `finish` events:
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
import type { AgentTransport } from '@atom63/agent'
|
|
61
|
+
|
|
62
|
+
export const transport: AgentTransport = {
|
|
63
|
+
async *stream(request, { signal }) {
|
|
64
|
+
const response = await fetch('/api/chat', {
|
|
65
|
+
body: JSON.stringify({ messages: request.messages }),
|
|
66
|
+
method: 'POST',
|
|
67
|
+
signal,
|
|
68
|
+
})
|
|
69
|
+
if (!response.body) throw new Error('No response body')
|
|
70
|
+
yield { runId: request.runId, type: 'response-start' }
|
|
71
|
+
const reader = response.body.pipeThrough(new TextDecoderStream()).getReader()
|
|
72
|
+
for (let chunk = await reader.read(); !chunk.done; chunk = await reader.read()) {
|
|
73
|
+
yield { delta: chunk.value, runId: request.runId, type: 'text-delta' }
|
|
74
|
+
}
|
|
75
|
+
yield { runId: request.runId, type: 'finish' }
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Mini apps and widgets
|
|
81
|
+
|
|
82
|
+
A mini app is a `<MiniApp>` in `src/modules/dock/dock.tsx`: a dock button that opens a small
|
|
83
|
+
window. A widget is a `<Tile>` in `src/modules/widgets/widget-board.tsx`, built on the
|
|
84
|
+
[`@atom63/widgets`](https://system.atom63.io/docs/widgets) card.
|
|
85
|
+
|
|
86
|
+
## The creative layer
|
|
87
|
+
|
|
88
|
+
The structure (pages, navigation, accessibility, themes) comes from the design system. The look is
|
|
89
|
+
yours, and changing it keeps the quality: everything below goes through tokens, so contrast, dark
|
|
90
|
+
mode and focus rings keep working.
|
|
91
|
+
|
|
92
|
+
### Brand, surface, radius and font
|
|
93
|
+
|
|
94
|
+
`appearance` in `src/portfolio.config.ts` sets four axes of the system around the whole site:
|
|
95
|
+
|
|
96
|
+
| Key | Values | What it changes |
|
|
97
|
+
| --- | --- | --- |
|
|
98
|
+
| `brand` | `auto`, `b1` to `b6` | The accent ramp: primary buttons, links, focus rings |
|
|
99
|
+
| `surface` | `n1` to `n6` | The neutral family: page, cards, borders |
|
|
100
|
+
| `radius` | `none`, `subtle`, `default`, `round` | Every corner, from buttons to the hero plate |
|
|
101
|
+
| `font` | `sans`, `serif`, `mono`, `pixel` | The type personality |
|
|
102
|
+
|
|
103
|
+
`src/components/site-layout.tsx` stamps them as `data-a63-*` attributes; the
|
|
104
|
+
[personalization page](https://system.atom63.io/themes/personalization) lists every
|
|
105
|
+
axis.
|
|
106
|
+
|
|
107
|
+
### Theme and mode
|
|
108
|
+
|
|
109
|
+
Theme (`modern`, `aqua`, `retro`, `terminal`) and mode (light, dark) are the visitor's choice, in
|
|
110
|
+
the appearance menu in the header. `src/theme.tsx` holds them, remembers them per browser and
|
|
111
|
+
applies them through `Atom63Theme`. Change the starting theme there (`'modern'`).
|
|
112
|
+
|
|
113
|
+
### The hero plate
|
|
114
|
+
|
|
115
|
+
The home page leads with a plate: one picture that sets the tone, with the text below it rather
|
|
116
|
+
than over it, so any image works. To swap it, put your image in `public/plates/` and point `hero`
|
|
117
|
+
in `src/portfolio.config.ts` at it (`plate: '/plates/my-plate.jpg'`). Give it `plateAlt` if it
|
|
118
|
+
shows something a visitor should know about; leave it empty if it is decoration. A wide image
|
|
119
|
+
(21:9) fills it on a desktop; the phone crops it to 4:3 from the centre.
|
|
120
|
+
|
|
121
|
+
Project covers work the same way: the `cover` in each project's frontmatter.
|
|
122
|
+
|
|
123
|
+
### MDX blocks
|
|
124
|
+
|
|
125
|
+
Projects and posts are MDX: Markdown that can hold components. Every file can use the
|
|
126
|
+
[`@atom63/mdx` blocks](https://system.atom63.io/docs/mdx-blocks) (`Callout`, `KeyIdea`,
|
|
127
|
+
`Steps`, `StatGrid` and `StatCard`, `FigureBlock`, `Timeline`, `Tabs`, `CodeBlock` and more), plus
|
|
128
|
+
the site's own `Quote`, without importing them.
|
|
129
|
+
|
|
130
|
+
To add a block of your own, write a component in `src/components/mdx-components.tsx` and add it to
|
|
131
|
+
the `createMdxComponents({ … })` call there. `Quote` is the example.
|
|
132
|
+
|
|
133
|
+
## Where things are
|
|
134
|
+
|
|
135
|
+
- `src/portfolio.config.ts`: who you are, the creative axes, the hero plate and the modules.
|
|
136
|
+
- `src/router.tsx`: the routes. Every page shares the header and footer through `siteRoute`.
|
|
137
|
+
- `src/pages`: the pages. `src/components`: the header, footer, layout, project card and MDX map.
|
|
138
|
+
- `src/content`: projects, writing, the timeline and the resume.
|
|
139
|
+
- `src/modules`: the optional modules.
|
|
140
|
+
- `src/templates`: the chat panel block the assistant is drawn with, now the site's own code.
|
|
141
|
+
- `src/theme.tsx`: theme and mode. `src/styles.css`: Tailwind, the token stack and the styles.
|
|
142
|
+
|
|
143
|
+
## Using the design system
|
|
144
|
+
|
|
145
|
+
Prefer components from `@atom63/ui-react`; the [component docs](https://system.atom63.io) list
|
|
146
|
+
them with their contracts. Tailwind utilities such as `bg-background` and `text-muted-foreground`
|
|
147
|
+
resolve to the same tokens, so custom layout follows every theme and mode.
|
|
148
|
+
|
|
149
|
+
For something the system does not offer, `npx shadcn add <component>` works in this project. The
|
|
150
|
+
shadcn bridge maps shadcn's variables onto the Atom63 tokens, so added components match.
|
|
151
|
+
|
|
152
|
+
`AGENTS.md` tells coding agents how to use the design system here.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2100 900" preserveAspectRatio="xMidYMid slice">
|
|
2
|
+
<!-- The sample hero plate. Replace this file, or point portfolio.config.ts at your own image. -->
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="sky" x1="0" y1="0" x2="1" y2="1">
|
|
5
|
+
<stop offset="0" stop-color="#1d2540"/>
|
|
6
|
+
<stop offset="0.55" stop-color="#34406b"/>
|
|
7
|
+
<stop offset="1" stop-color="#6b5a7e"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<radialGradient id="sun" cx="0.5" cy="0.5" r="0.5">
|
|
10
|
+
<stop offset="0" stop-color="#ffd9a8"/>
|
|
11
|
+
<stop offset="0.6" stop-color="#f2a477"/>
|
|
12
|
+
<stop offset="1" stop-color="#d9735f"/>
|
|
13
|
+
</radialGradient>
|
|
14
|
+
<linearGradient id="hill" x1="0" y1="0" x2="0" y2="1">
|
|
15
|
+
<stop offset="0" stop-color="#26304f"/>
|
|
16
|
+
<stop offset="1" stop-color="#141a2e"/>
|
|
17
|
+
</linearGradient>
|
|
18
|
+
<filter id="grain">
|
|
19
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" stitchTiles="stitch"/>
|
|
20
|
+
<feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.07 0"/>
|
|
21
|
+
</filter>
|
|
22
|
+
</defs>
|
|
23
|
+
<rect width="2100" height="900" fill="url(#sky)"/>
|
|
24
|
+
<g fill="none" stroke="#c9b8d8" stroke-opacity="0.18" stroke-width="2">
|
|
25
|
+
<circle cx="1420" cy="430" r="250"/>
|
|
26
|
+
<circle cx="1420" cy="430" r="330"/>
|
|
27
|
+
<circle cx="1420" cy="430" r="420"/>
|
|
28
|
+
<circle cx="1420" cy="430" r="520"/>
|
|
29
|
+
</g>
|
|
30
|
+
<circle cx="1420" cy="430" r="180" fill="url(#sun)"/>
|
|
31
|
+
<path d="M0 640 C 320 560 560 600 820 650 S 1360 720 1620 640 S 1960 560 2100 600 V 900 H 0 Z" fill="#2c3760" opacity="0.9"/>
|
|
32
|
+
<path d="M0 720 C 280 680 600 700 900 760 S 1500 820 1800 760 S 2040 720 2100 730 V 900 H 0 Z" fill="url(#hill)"/>
|
|
33
|
+
<g fill="#ffd9a8" opacity="0.85">
|
|
34
|
+
<circle cx="380" cy="742" r="5"/>
|
|
35
|
+
<circle cx="640" cy="752" r="4"/>
|
|
36
|
+
<circle cx="1010" cy="788" r="5"/>
|
|
37
|
+
<circle cx="1690" cy="774" r="4"/>
|
|
38
|
+
</g>
|
|
39
|
+
<rect width="2100" height="900" filter="url(#grain)"/>
|
|
40
|
+
</svg>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 900" preserveAspectRatio="xMidYMid meet">
|
|
2
|
+
<!-- Sample figure: a day calendar with a draft booking. Replace with your own image. -->
|
|
3
|
+
<rect width="1600" height="900" fill="#faf6f0"/>
|
|
4
|
+
<rect x="120" y="90" width="1360" height="720" rx="28" fill="#ffffff" stroke="#e6dccd" stroke-width="4"/>
|
|
5
|
+
<rect x="160" y="130" width="420" height="56" rx="28" fill="#f2ebe1"/>
|
|
6
|
+
<rect x="190" y="150" width="200" height="16" rx="8" fill="#b9a993"/>
|
|
7
|
+
<g stroke="#efe6d9" stroke-width="3">
|
|
8
|
+
<path d="M160 240 H 1440"/>
|
|
9
|
+
<path d="M160 340 H 1440"/>
|
|
10
|
+
<path d="M160 440 H 1440"/>
|
|
11
|
+
<path d="M160 540 H 1440"/>
|
|
12
|
+
<path d="M160 640 H 1440"/>
|
|
13
|
+
<path d="M160 740 H 1440"/>
|
|
14
|
+
</g>
|
|
15
|
+
<g fill="#c4b6a2" font-family="system-ui, sans-serif" font-size="24">
|
|
16
|
+
<text x="170" y="290">09:00</text>
|
|
17
|
+
<text x="170" y="390">10:00</text>
|
|
18
|
+
<text x="170" y="490">11:00</text>
|
|
19
|
+
<text x="170" y="590">12:00</text>
|
|
20
|
+
<text x="170" y="690">13:00</text>
|
|
21
|
+
</g>
|
|
22
|
+
<rect x="300" y="250" width="340" height="80" rx="16" fill="#e8eef7"/>
|
|
23
|
+
<rect x="680" y="250" width="340" height="180" rx="16" fill="#e8eef7"/>
|
|
24
|
+
<rect x="1060" y="350" width="340" height="80" rx="16" fill="#e8eef7"/>
|
|
25
|
+
<rect x="300" y="450" width="340" height="80" rx="16" fill="#e8eef7"/>
|
|
26
|
+
<rect x="680" y="550" width="340" height="80" rx="16" fill="#fbe9df" stroke="#c9634a" stroke-width="4" stroke-dasharray="14 10"/>
|
|
27
|
+
<rect x="704" y="574" width="160" height="16" rx="8" fill="#c9634a"/>
|
|
28
|
+
<rect x="704" y="600" width="220" height="12" rx="6" fill="#efb9a6"/>
|
|
29
|
+
<rect x="1060" y="650" width="340" height="80" rx="16" fill="#e8eef7"/>
|
|
30
|
+
</svg>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 900" preserveAspectRatio="xMidYMid slice">
|
|
2
|
+
<!-- Sample cover art. Replace with your own image. -->
|
|
3
|
+
<rect width="1600" height="900" fill="#f4e7d7"/>
|
|
4
|
+
<g fill="#ead6bf">
|
|
5
|
+
<rect x="160" y="140" width="220" height="140" rx="22"/>
|
|
6
|
+
<rect x="410" y="140" width="220" height="140" rx="22"/>
|
|
7
|
+
<rect x="660" y="140" width="220" height="140" rx="22"/>
|
|
8
|
+
<rect x="910" y="140" width="220" height="140" rx="22"/>
|
|
9
|
+
<rect x="1160" y="140" width="220" height="140" rx="22"/>
|
|
10
|
+
<rect x="160" y="310" width="220" height="140" rx="22"/>
|
|
11
|
+
<rect x="410" y="310" width="220" height="140" rx="22"/>
|
|
12
|
+
<rect x="910" y="310" width="220" height="140" rx="22"/>
|
|
13
|
+
<rect x="1160" y="310" width="220" height="140" rx="22"/>
|
|
14
|
+
<rect x="160" y="480" width="220" height="140" rx="22"/>
|
|
15
|
+
<rect x="410" y="480" width="220" height="140" rx="22"/>
|
|
16
|
+
<rect x="660" y="480" width="220" height="140" rx="22"/>
|
|
17
|
+
<rect x="910" y="480" width="220" height="140" rx="22"/>
|
|
18
|
+
<rect x="1160" y="480" width="220" height="140" rx="22"/>
|
|
19
|
+
<rect x="160" y="650" width="220" height="140" rx="22"/>
|
|
20
|
+
<rect x="410" y="650" width="220" height="140" rx="22"/>
|
|
21
|
+
<rect x="660" y="650" width="220" height="140" rx="22"/>
|
|
22
|
+
<rect x="1160" y="650" width="220" height="140" rx="22"/>
|
|
23
|
+
</g>
|
|
24
|
+
<rect x="660" y="310" width="220" height="140" rx="22" fill="#c9634a"/>
|
|
25
|
+
<rect x="690" y="340" width="120" height="18" rx="9" fill="#fbe9df"/>
|
|
26
|
+
<rect x="690" y="372" width="160" height="14" rx="7" fill="#efb9a6"/>
|
|
27
|
+
<rect x="910" y="650" width="220" height="140" rx="22" fill="none" stroke="#c9634a" stroke-width="6" stroke-dasharray="18 14"/>
|
|
28
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 900" preserveAspectRatio="xMidYMid slice">
|
|
2
|
+
<!-- Sample cover art. Replace with your own image. -->
|
|
3
|
+
<rect width="1600" height="900" fill="#e4eee4"/>
|
|
4
|
+
<g transform="translate(800 470)">
|
|
5
|
+
<path d="M0 140 L 420 -20 L 0 -180 L -420 -20 Z" fill="#1f5c45" transform="translate(0 160)"/>
|
|
6
|
+
<path d="M0 140 L 420 -20 L 0 -180 L -420 -20 Z" fill="#3f8a66" transform="translate(0 40)"/>
|
|
7
|
+
<path d="M0 140 L 420 -20 L 0 -180 L -420 -20 Z" fill="#8cc49e" transform="translate(0 -80)"/>
|
|
8
|
+
<g fill="#e4eee4" opacity="0.8" transform="translate(0 -80)">
|
|
9
|
+
<rect x="-150" y="-60" width="120" height="40" rx="20" transform="skewY(-21)"/>
|
|
10
|
+
<rect x="10" y="-60" width="160" height="40" rx="20" transform="skewY(-21)"/>
|
|
11
|
+
</g>
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 900" preserveAspectRatio="xMidYMid slice">
|
|
2
|
+
<!-- Sample cover art. Replace with your own image. -->
|
|
3
|
+
<rect width="1600" height="900" fill="#141b33"/>
|
|
4
|
+
<g fill="none" stroke="#3a4a7a" stroke-width="10" stroke-linecap="round" stroke-linejoin="round" opacity="0.7">
|
|
5
|
+
<path d="M-40 220 H 420 L 620 420 H 1640"/>
|
|
6
|
+
<path d="M180 -40 V 300 L 380 500 V 940"/>
|
|
7
|
+
<path d="M900 -40 V 260 L 1100 460 V 940"/>
|
|
8
|
+
<path d="M-40 700 H 560 L 760 560 H 1640"/>
|
|
9
|
+
<path d="M1320 -40 L 1120 160 H 700"/>
|
|
10
|
+
</g>
|
|
11
|
+
<path d="M120 760 L 380 500 L 620 420 H 1000 L 1100 460 L 1380 300" fill="none" stroke="#f2b36b" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"/>
|
|
12
|
+
<g fill="#141b33" stroke="#f2b36b" stroke-width="8">
|
|
13
|
+
<circle cx="120" cy="760" r="22"/>
|
|
14
|
+
<circle cx="620" cy="420" r="18"/>
|
|
15
|
+
<circle cx="1000" cy="420" r="18"/>
|
|
16
|
+
<circle cx="1380" cy="300" r="26"/>
|
|
17
|
+
</g>
|
|
18
|
+
<circle cx="1380" cy="300" r="70" fill="#f2b36b" opacity="0.15"/>
|
|
19
|
+
</svg>
|