@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,43 @@
|
|
|
1
|
+
import { ArticleMDXContentProvider } from '@atom63/mdx/article'
|
|
2
|
+
import { PageMeta } from '@atom63/mdx/blocks'
|
|
3
|
+
import { Button } from '@atom63/ui-react'
|
|
4
|
+
import { Container, Page } from '@atom63/ui-react/layout'
|
|
5
|
+
import { Link, useParams } from '@tanstack/react-router'
|
|
6
|
+
import { ArrowLeft } from 'lucide-react'
|
|
7
|
+
|
|
8
|
+
import { mdxComponents } from '../components/mdx-components'
|
|
9
|
+
import { findPost, formatDate } from '../content/writing'
|
|
10
|
+
import { NotFoundPage } from './not-found'
|
|
11
|
+
|
|
12
|
+
export function WritingPostPage() {
|
|
13
|
+
const { slug } = useParams({ from: '/site/writing/$slug' })
|
|
14
|
+
const post = findPost(slug)
|
|
15
|
+
if (!post) {
|
|
16
|
+
return <NotFoundPage />
|
|
17
|
+
}
|
|
18
|
+
const { Content } = post
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Page>
|
|
22
|
+
<Container maxWidth="narrower">
|
|
23
|
+
<article>
|
|
24
|
+
<ArticleMDXContentProvider components={mdxComponents} variant="article">
|
|
25
|
+
{/* `article`: the header, prose, code and blocks share one column and one left edge. */}
|
|
26
|
+
<PageMeta
|
|
27
|
+
description={post.description}
|
|
28
|
+
eyebrow={<time dateTime={post.date}>{formatDate(post.date)}</time>}
|
|
29
|
+
title={post.title}
|
|
30
|
+
/>
|
|
31
|
+
<Content />
|
|
32
|
+
</ArticleMDXContentProvider>
|
|
33
|
+
</article>
|
|
34
|
+
<div className="mt-12">
|
|
35
|
+
<Button render={<Link to="/writing" />} size="sm" tone="muted" variant="ghost">
|
|
36
|
+
<ArrowLeft aria-hidden />
|
|
37
|
+
All writing
|
|
38
|
+
</Button>
|
|
39
|
+
</div>
|
|
40
|
+
</Container>
|
|
41
|
+
</Page>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Brand, FontFamily, RadiusScale, Surface } from '@atom63/ui-foundation'
|
|
2
|
+
|
|
3
|
+
type PortfolioConfig = {
|
|
4
|
+
appearance: { brand: Brand; font: FontFamily; radius: RadiusScale; surface: Surface }
|
|
5
|
+
hero: { plate: string; plateAlt: string }
|
|
6
|
+
modules: Record<'assistant' | 'dock' | 'slides' | 'widgetBoard', boolean>
|
|
7
|
+
person: {
|
|
8
|
+
email: string
|
|
9
|
+
headline: string
|
|
10
|
+
intro: string
|
|
11
|
+
links: readonly { href: string; label: string }[]
|
|
12
|
+
location: string
|
|
13
|
+
name: string
|
|
14
|
+
role: string
|
|
15
|
+
timeZone: string
|
|
16
|
+
}
|
|
17
|
+
title: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The one file to edit first: who the portfolio is for, how it looks, and
|
|
22
|
+
* which modules it runs. Everything here is sample content about a fictional
|
|
23
|
+
* person; replace it with yours.
|
|
24
|
+
*/
|
|
25
|
+
export const portfolio = {
|
|
26
|
+
/** The site title, shown in the browser tab and the footer. */
|
|
27
|
+
title: '{{title}}',
|
|
28
|
+
|
|
29
|
+
person: {
|
|
30
|
+
name: 'Rowan Vale',
|
|
31
|
+
role: 'Product designer and design engineer',
|
|
32
|
+
location: 'Lisbon, working remotely',
|
|
33
|
+
/** For the clocks in the widget board and the dock. */
|
|
34
|
+
timeZone: 'Europe/Lisbon',
|
|
35
|
+
/** One sentence for the home page heading. */
|
|
36
|
+
headline: 'Rowan Vale designs calm tools for complicated work.',
|
|
37
|
+
intro:
|
|
38
|
+
'I lead product design for teams whose users are busy: dispatchers, nurses, accountants. I sketch in Figma, ship in React, and measure whether it helped.',
|
|
39
|
+
email: 'hello@rowanvale.example',
|
|
40
|
+
links: [
|
|
41
|
+
{ label: 'GitHub', href: 'https://github.com/' },
|
|
42
|
+
{ label: 'LinkedIn', href: 'https://www.linkedin.com/' },
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The creative layer. Each value is a design system axis, applied as a
|
|
48
|
+
* `data-a63-*` attribute around the whole site, so every component follows.
|
|
49
|
+
* Theme and mode are the visitor's choice (the appearance menu); these are
|
|
50
|
+
* yours.
|
|
51
|
+
*/
|
|
52
|
+
appearance: {
|
|
53
|
+
/** Accent ramp: 'auto' or 'b1' to 'b6'. */
|
|
54
|
+
brand: 'b3',
|
|
55
|
+
/** Neutral family: 'n1' to 'n6'. */
|
|
56
|
+
surface: 'n6',
|
|
57
|
+
/** Corner scale: 'none', 'subtle', 'default' or 'round'. */
|
|
58
|
+
radius: 'default',
|
|
59
|
+
/** Type personality: 'sans', 'serif', 'mono' or 'pixel'. */
|
|
60
|
+
font: 'sans',
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
/** The art at the top of the home page. Swap the file in public/plates. */
|
|
64
|
+
hero: {
|
|
65
|
+
plate: '/plates/hero.svg',
|
|
66
|
+
plateAlt: '',
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Optional modules. Turn one on here and it adds its route, its link or
|
|
71
|
+
* its section; nothing else needs to change. See README.md.
|
|
72
|
+
*/
|
|
73
|
+
modules: {
|
|
74
|
+
/** A site assistant built on @atom63/agent. Answers offline from your content. */
|
|
75
|
+
assistant: true,
|
|
76
|
+
/** Talks and decks at /slides. */
|
|
77
|
+
slides: false,
|
|
78
|
+
/** A board of small widgets on the home page. */
|
|
79
|
+
widgetBoard: false,
|
|
80
|
+
/** A bottom dock with navigation and mini apps (a clock and a notepad). */
|
|
81
|
+
dock: false,
|
|
82
|
+
},
|
|
83
|
+
} as const satisfies PortfolioConfig
|
|
84
|
+
|
|
85
|
+
export type PortfolioModule = keyof typeof portfolio.modules
|
|
86
|
+
|
|
87
|
+
/** True when a module is switched on. */
|
|
88
|
+
export const isOn = (module: PortfolioModule): boolean => portfolio.modules[module]
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createRootRoute,
|
|
3
|
+
createRoute,
|
|
4
|
+
createRouter,
|
|
5
|
+
lazyRouteComponent,
|
|
6
|
+
Outlet,
|
|
7
|
+
ScrollRestoration,
|
|
8
|
+
} from '@tanstack/react-router'
|
|
9
|
+
|
|
10
|
+
import { SiteLayout } from './components/site-layout'
|
|
11
|
+
import { HomePage } from './pages/home'
|
|
12
|
+
import { NotFoundPage } from './pages/not-found'
|
|
13
|
+
import { ProjectPage } from './pages/project-page'
|
|
14
|
+
import { ProjectsIndexPage } from './pages/projects-index'
|
|
15
|
+
import { ResumePage } from './pages/resume'
|
|
16
|
+
import { TimelinePage } from './pages/timeline'
|
|
17
|
+
import { WritingIndexPage } from './pages/writing-index'
|
|
18
|
+
import { WritingPostPage } from './pages/writing-post'
|
|
19
|
+
import { isOn } from './portfolio.config'
|
|
20
|
+
|
|
21
|
+
const rootRoute = createRootRoute({
|
|
22
|
+
component: () => (
|
|
23
|
+
<>
|
|
24
|
+
<ScrollRestoration />
|
|
25
|
+
<Outlet />
|
|
26
|
+
</>
|
|
27
|
+
),
|
|
28
|
+
notFoundComponent: () => (
|
|
29
|
+
<SiteLayout>
|
|
30
|
+
<NotFoundPage />
|
|
31
|
+
</SiteLayout>
|
|
32
|
+
),
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
/* Every page shares the header, footer, assistant and dock through this pathless layout route. */
|
|
36
|
+
const siteRoute = createRoute({
|
|
37
|
+
getParentRoute: () => rootRoute,
|
|
38
|
+
id: 'site',
|
|
39
|
+
component: () => (
|
|
40
|
+
<SiteLayout>
|
|
41
|
+
<Outlet />
|
|
42
|
+
</SiteLayout>
|
|
43
|
+
),
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const homeRoute = createRoute({
|
|
47
|
+
getParentRoute: () => siteRoute,
|
|
48
|
+
path: '/',
|
|
49
|
+
component: HomePage,
|
|
50
|
+
})
|
|
51
|
+
const projectsRoute = createRoute({
|
|
52
|
+
getParentRoute: () => siteRoute,
|
|
53
|
+
path: '/projects',
|
|
54
|
+
component: ProjectsIndexPage,
|
|
55
|
+
})
|
|
56
|
+
const projectRoute = createRoute({
|
|
57
|
+
getParentRoute: () => siteRoute,
|
|
58
|
+
path: '/projects/$slug',
|
|
59
|
+
component: ProjectPage,
|
|
60
|
+
})
|
|
61
|
+
const writingRoute = createRoute({
|
|
62
|
+
getParentRoute: () => siteRoute,
|
|
63
|
+
path: '/writing',
|
|
64
|
+
component: WritingIndexPage,
|
|
65
|
+
})
|
|
66
|
+
const postRoute = createRoute({
|
|
67
|
+
getParentRoute: () => siteRoute,
|
|
68
|
+
path: '/writing/$slug',
|
|
69
|
+
component: WritingPostPage,
|
|
70
|
+
})
|
|
71
|
+
const timelineRoute = createRoute({
|
|
72
|
+
getParentRoute: () => siteRoute,
|
|
73
|
+
path: '/timeline',
|
|
74
|
+
component: TimelinePage,
|
|
75
|
+
})
|
|
76
|
+
const resumeRoute = createRoute({
|
|
77
|
+
getParentRoute: () => siteRoute,
|
|
78
|
+
path: '/resume',
|
|
79
|
+
component: ResumePage,
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
/* The slides module: its routes exist only when it is on in portfolio.config.ts. */
|
|
83
|
+
const slidesRoute = createRoute({
|
|
84
|
+
getParentRoute: () => siteRoute,
|
|
85
|
+
path: '/slides',
|
|
86
|
+
component: lazyRouteComponent(() => import('./modules/slides/slides-pages'), 'SlidesIndexPage'),
|
|
87
|
+
})
|
|
88
|
+
const deckRoute = createRoute({
|
|
89
|
+
getParentRoute: () => siteRoute,
|
|
90
|
+
path: '/slides/$slug',
|
|
91
|
+
component: lazyRouteComponent(() => import('./modules/slides/slides-pages'), 'SlideDeckPage'),
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
export const router = createRouter({
|
|
95
|
+
routeTree: rootRoute.addChildren([
|
|
96
|
+
siteRoute.addChildren([
|
|
97
|
+
homeRoute,
|
|
98
|
+
projectsRoute,
|
|
99
|
+
projectRoute,
|
|
100
|
+
writingRoute,
|
|
101
|
+
postRoute,
|
|
102
|
+
timelineRoute,
|
|
103
|
+
resumeRoute,
|
|
104
|
+
...(isOn('slides') ? [slidesRoute, deckRoute] : []),
|
|
105
|
+
]),
|
|
106
|
+
]),
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
declare module '@tanstack/react-router' {
|
|
110
|
+
interface Register {
|
|
111
|
+
router: typeof router
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
/* The Atom63 token stack. --a63-* tokens are the source of truth; the Tailwind
|
|
4
|
+
theme maps utilities onto them (bg-background, text-muted-foreground, …), and
|
|
5
|
+
the shadcn bridge gives components added with `npx shadcn add` the same
|
|
6
|
+
colors, radius and modes. */
|
|
7
|
+
@import '@atom63/styles';
|
|
8
|
+
@import '@atom63/styles/tailwind';
|
|
9
|
+
@import '@atom63/styles/compat/shadcn';
|
|
10
|
+
|
|
11
|
+
/* Component recipes, the MDX prose styles and the widget surfaces. */
|
|
12
|
+
@import '@atom63/ui-react/reset.css';
|
|
13
|
+
@import '@atom63/ui-react/recipes.css';
|
|
14
|
+
@import '@atom63/mdx/styles/a63.css';
|
|
15
|
+
@import '@atom63/widgets/styles.css';
|
|
16
|
+
|
|
17
|
+
/* Generate the utilities the Atom63 components use. */
|
|
18
|
+
@source '../node_modules/@atom63/ui-react/dist';
|
|
19
|
+
|
|
20
|
+
/* Atom63Theme puts the mode on a class, so `dark:` and `light:` utilities
|
|
21
|
+
(including those in shadcn components) follow it, not the OS setting. */
|
|
22
|
+
@custom-variant light (&:not(.dark *));
|
|
23
|
+
@custom-variant dark (&:is(.dark *));
|
|
24
|
+
|
|
25
|
+
@layer base {
|
|
26
|
+
html,
|
|
27
|
+
body,
|
|
28
|
+
#root {
|
|
29
|
+
min-height: 100%;
|
|
30
|
+
background-color: var(--a63-surface-page);
|
|
31
|
+
color: var(--a63-text-primary);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* The site frame stamps data-a63-font (portfolio.config.ts); this applies it. */
|
|
36
|
+
.portfolio-root {
|
|
37
|
+
font-family: var(--a63-font-app);
|
|
38
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Hello, world
|
|
3
|
+
description: What this starter gives you and where to go next.
|
|
4
|
+
date: '{{date}}'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This post is an MDX file in `src/content/blog`. Its file name is the slug, and its frontmatter
|
|
8
|
+
sets the title, description and date. Add a file, and it appears on the blog.
|
|
9
|
+
|
|
10
|
+
## What is set up
|
|
11
|
+
|
|
12
|
+
- **Components** from `@atom63/ui-react`, styled by recipes that read `--a63-*` tokens.
|
|
13
|
+
- **Tailwind** with a theme that maps utilities such as `bg-background` onto the same tokens.
|
|
14
|
+
- **MDX** rendered with the `@atom63/mdx` typography, so posts match the rest of the site.
|
|
15
|
+
- **Themes and modes** switched from the header; everything follows them.
|
|
16
|
+
|
|
17
|
+
<Callout type="info">
|
|
18
|
+
Use components from `@atom63/mdx/blocks` in any post. This callout is one of them.
|
|
19
|
+
</Callout>
|
|
20
|
+
|
|
21
|
+
## Next steps
|
|
22
|
+
|
|
23
|
+
1. Change the site title and tagline in `src/site.ts`.
|
|
24
|
+
2. Edit the landing page in `src/pages/home.tsx`.
|
|
25
|
+
3. Write your first real post and delete this one.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Writing with MDX
|
|
3
|
+
description: Markdown, code blocks and design system components in one file.
|
|
4
|
+
date: '{{date}}'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
MDX is Markdown that can hold components. Headings, lists, links and **emphasis** work as usual:
|
|
8
|
+
|
|
9
|
+
> A quote picks up the blockquote style from `@atom63/mdx`.
|
|
10
|
+
|
|
11
|
+
Code blocks are highlighted:
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Button } from '@atom63/ui-react'
|
|
15
|
+
|
|
16
|
+
export function SaveButton() {
|
|
17
|
+
return <Button>Save</Button>
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
<Callout type="success">
|
|
22
|
+
Tables, task lists and footnotes work too, through `remark-gfm`.
|
|
23
|
+
</Callout>
|
|
24
|
+
|
|
25
|
+
| Layer | Where it lives |
|
|
26
|
+
| --------- | ----------------------- |
|
|
27
|
+
| Tokens | `@atom63/styles` |
|
|
28
|
+
| Contracts | `@atom63/ui-foundation` |
|
|
29
|
+
| React | `@atom63/ui-react` |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ComponentType } from 'react'
|
|
2
|
+
|
|
3
|
+
export type Post = {
|
|
4
|
+
Content: ComponentType
|
|
5
|
+
date: string
|
|
6
|
+
description: string
|
|
7
|
+
slug: string
|
|
8
|
+
title: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type PostModule = {
|
|
12
|
+
default: ComponentType
|
|
13
|
+
frontmatter: { date: string; description: string; title: string }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Every `blog/*.mdx` file is a post; its file name is the slug. */
|
|
17
|
+
const modules = import.meta.glob<PostModule>('./blog/*.mdx', { eager: true })
|
|
18
|
+
|
|
19
|
+
export const posts: Post[] = Object.entries(modules)
|
|
20
|
+
.map(([path, module]) => ({
|
|
21
|
+
Content: module.default,
|
|
22
|
+
...module.frontmatter,
|
|
23
|
+
slug: path.slice(path.lastIndexOf('/') + 1, -'.mdx'.length),
|
|
24
|
+
}))
|
|
25
|
+
.sort((left, right) => right.date.localeCompare(left.date))
|
|
26
|
+
|
|
27
|
+
export function findPost(slug: string): Post | undefined {
|
|
28
|
+
return posts.find(post => post.slug === slug)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function formatDate(date: string): string {
|
|
32
|
+
return new Date(`${date}T00:00:00`).toLocaleDateString('en', {
|
|
33
|
+
day: 'numeric',
|
|
34
|
+
month: 'long',
|
|
35
|
+
year: 'numeric',
|
|
36
|
+
})
|
|
37
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Card,
|
|
3
|
+
CardContent,
|
|
4
|
+
CardDescription,
|
|
5
|
+
CardHeader,
|
|
6
|
+
CardLabel,
|
|
7
|
+
CardTitle,
|
|
8
|
+
Empty,
|
|
9
|
+
EmptyDescription,
|
|
10
|
+
EmptyHeader,
|
|
11
|
+
EmptyTitle,
|
|
12
|
+
} from '@atom63/ui-react'
|
|
13
|
+
import { Container, Page, Section, SectionHeader } from '@atom63/ui-react/layout'
|
|
14
|
+
import { Link } from '@tanstack/react-router'
|
|
15
|
+
|
|
16
|
+
import { formatDate, posts } from '../content/posts'
|
|
17
|
+
|
|
18
|
+
export function BlogIndexPage() {
|
|
19
|
+
return (
|
|
20
|
+
<Page>
|
|
21
|
+
<Container maxWidth="narrow">
|
|
22
|
+
<Section removeTopSpacing>
|
|
23
|
+
<SectionHeader description="Notes, guides and updates." level={1} title="Blog" />
|
|
24
|
+
{posts.length === 0 ? (
|
|
25
|
+
<Empty>
|
|
26
|
+
<EmptyHeader>
|
|
27
|
+
<EmptyTitle>No posts yet</EmptyTitle>
|
|
28
|
+
<EmptyDescription>
|
|
29
|
+
Add an .mdx file to src/content/blog to publish one.
|
|
30
|
+
</EmptyDescription>
|
|
31
|
+
</EmptyHeader>
|
|
32
|
+
</Empty>
|
|
33
|
+
) : (
|
|
34
|
+
<ul className="grid gap-4">
|
|
35
|
+
{posts.map(post => (
|
|
36
|
+
<li key={post.slug}>
|
|
37
|
+
<Card>
|
|
38
|
+
<CardHeader>
|
|
39
|
+
<CardLabel className="text-muted-foreground">
|
|
40
|
+
{formatDate(post.date)}
|
|
41
|
+
</CardLabel>
|
|
42
|
+
</CardHeader>
|
|
43
|
+
<CardContent>
|
|
44
|
+
<CardTitle>
|
|
45
|
+
<Link params={{ slug: post.slug }} to="/blog/$slug">
|
|
46
|
+
{post.title}
|
|
47
|
+
</Link>
|
|
48
|
+
</CardTitle>
|
|
49
|
+
<CardDescription>{post.description}</CardDescription>
|
|
50
|
+
</CardContent>
|
|
51
|
+
</Card>
|
|
52
|
+
</li>
|
|
53
|
+
))}
|
|
54
|
+
</ul>
|
|
55
|
+
)}
|
|
56
|
+
</Section>
|
|
57
|
+
</Container>
|
|
58
|
+
</Page>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ArticleMDXContentProvider, createMdxComponents } from '@atom63/mdx/article'
|
|
2
|
+
import { PageMeta } from '@atom63/mdx/blocks'
|
|
3
|
+
import { Button } from '@atom63/ui-react'
|
|
4
|
+
import { Container, Page } from '@atom63/ui-react/layout'
|
|
5
|
+
import { Link, useParams } from '@tanstack/react-router'
|
|
6
|
+
|
|
7
|
+
import { findPost, formatDate } from '../content/posts'
|
|
8
|
+
import { NotFoundPage } from './not-found'
|
|
9
|
+
|
|
10
|
+
// Core prose plus the @atom63/mdx blocks (Callout, Steps, Tabs, …) for every post.
|
|
11
|
+
const components = createMdxComponents()
|
|
12
|
+
|
|
13
|
+
export function BlogPostPage() {
|
|
14
|
+
const { slug } = useParams({ from: '/site/blog/$slug' })
|
|
15
|
+
const post = findPost(slug)
|
|
16
|
+
if (!post) {
|
|
17
|
+
return <NotFoundPage />
|
|
18
|
+
}
|
|
19
|
+
const { Content } = post
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Page>
|
|
23
|
+
<Container maxWidth="narrow">
|
|
24
|
+
<article>
|
|
25
|
+
<ArticleMDXContentProvider components={components}>
|
|
26
|
+
{/* PageMeta follows the provider's reading column, like the post body. */}
|
|
27
|
+
<PageMeta
|
|
28
|
+
description={post.description}
|
|
29
|
+
eyebrow={<time dateTime={post.date}>{formatDate(post.date)}</time>}
|
|
30
|
+
title={post.title}
|
|
31
|
+
/>
|
|
32
|
+
<Content />
|
|
33
|
+
</ArticleMDXContentProvider>
|
|
34
|
+
</article>
|
|
35
|
+
<div className="mx-auto mt-12 w-full max-w-xl">
|
|
36
|
+
<Button render={<Link to="/blog" />} variant="outline">
|
|
37
|
+
All posts
|
|
38
|
+
</Button>
|
|
39
|
+
</div>
|
|
40
|
+
</Container>
|
|
41
|
+
</Page>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Badge,
|
|
3
|
+
Button,
|
|
4
|
+
Card,
|
|
5
|
+
CardContent,
|
|
6
|
+
CardDescription,
|
|
7
|
+
CardFooter,
|
|
8
|
+
CardHeader,
|
|
9
|
+
CardLabel,
|
|
10
|
+
CardTitle,
|
|
11
|
+
Field,
|
|
12
|
+
FieldDescription,
|
|
13
|
+
FieldLabel,
|
|
14
|
+
Input,
|
|
15
|
+
} from '@atom63/ui-react'
|
|
16
|
+
import { Container, Page, Section, SectionHeader } from '@atom63/ui-react/layout'
|
|
17
|
+
import { Link } from '@tanstack/react-router'
|
|
18
|
+
import { type FormEvent, useState } from 'react'
|
|
19
|
+
|
|
20
|
+
import { formatDate, posts } from '../content/posts'
|
|
21
|
+
import { site } from '../site'
|
|
22
|
+
|
|
23
|
+
const features = [
|
|
24
|
+
{
|
|
25
|
+
title: 'One token architecture',
|
|
26
|
+
body: 'Colors, space, radius and motion come from --a63-* tokens, so every theme and mode follows.',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
title: 'Components with contracts',
|
|
30
|
+
body: 'Sizes, variants and states are defined once and shared by React, SwiftUI and Figma.',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: 'Content in MDX',
|
|
34
|
+
body: 'Write posts in Markdown with design system blocks, rendered with the same typography.',
|
|
35
|
+
},
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
export function HomePage() {
|
|
39
|
+
const [email, setEmail] = useState('')
|
|
40
|
+
const [subscribed, setSubscribed] = useState(false)
|
|
41
|
+
|
|
42
|
+
function subscribe(event: FormEvent) {
|
|
43
|
+
event.preventDefault()
|
|
44
|
+
// Connect this to your newsletter or form service.
|
|
45
|
+
setSubscribed(true)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Page>
|
|
50
|
+
<Container>
|
|
51
|
+
<Section removeTopSpacing spacing="generous">
|
|
52
|
+
<Badge variant="outline">New site</Badge>
|
|
53
|
+
<SectionHeader
|
|
54
|
+
description={site.description}
|
|
55
|
+
level={1}
|
|
56
|
+
title={site.tagline}
|
|
57
|
+
variant="display"
|
|
58
|
+
/>
|
|
59
|
+
<div className="flex flex-wrap gap-3">
|
|
60
|
+
<Button render={<Link to="/blog" />}>Read the blog</Button>
|
|
61
|
+
<Button
|
|
62
|
+
render={<a href="https://system.atom63.io" rel="noreferrer" target="_blank" />}
|
|
63
|
+
variant="outline"
|
|
64
|
+
>
|
|
65
|
+
Design system docs
|
|
66
|
+
</Button>
|
|
67
|
+
</div>
|
|
68
|
+
</Section>
|
|
69
|
+
|
|
70
|
+
<Section>
|
|
71
|
+
<SectionHeader title="What is included" />
|
|
72
|
+
<div className="grid gap-4 md:grid-cols-3">
|
|
73
|
+
{features.map(feature => (
|
|
74
|
+
<Card key={feature.title}>
|
|
75
|
+
<CardContent>
|
|
76
|
+
<CardTitle>{feature.title}</CardTitle>
|
|
77
|
+
<CardDescription>{feature.body}</CardDescription>
|
|
78
|
+
</CardContent>
|
|
79
|
+
</Card>
|
|
80
|
+
))}
|
|
81
|
+
</div>
|
|
82
|
+
</Section>
|
|
83
|
+
|
|
84
|
+
<Section>
|
|
85
|
+
<SectionHeader title="Latest posts" />
|
|
86
|
+
<ul className="grid gap-4 md:grid-cols-2">
|
|
87
|
+
{posts.slice(0, 2).map(post => (
|
|
88
|
+
<li key={post.slug}>
|
|
89
|
+
<Card>
|
|
90
|
+
<CardHeader>
|
|
91
|
+
<CardLabel className="text-muted-foreground">{formatDate(post.date)}</CardLabel>
|
|
92
|
+
</CardHeader>
|
|
93
|
+
<CardContent>
|
|
94
|
+
<CardTitle>
|
|
95
|
+
<Link params={{ slug: post.slug }} to="/blog/$slug">
|
|
96
|
+
{post.title}
|
|
97
|
+
</Link>
|
|
98
|
+
</CardTitle>
|
|
99
|
+
<CardDescription>{post.description}</CardDescription>
|
|
100
|
+
</CardContent>
|
|
101
|
+
</Card>
|
|
102
|
+
</li>
|
|
103
|
+
))}
|
|
104
|
+
</ul>
|
|
105
|
+
</Section>
|
|
106
|
+
|
|
107
|
+
<Section>
|
|
108
|
+
<Card className="max-w-xl">
|
|
109
|
+
<form onSubmit={subscribe}>
|
|
110
|
+
<CardContent>
|
|
111
|
+
<CardTitle>Stay in the loop</CardTitle>
|
|
112
|
+
<CardDescription>
|
|
113
|
+
Get new posts by email. No spam, unsubscribe any time.
|
|
114
|
+
</CardDescription>
|
|
115
|
+
<Field className="mt-4">
|
|
116
|
+
<FieldLabel htmlFor="email">Email address</FieldLabel>
|
|
117
|
+
<Input
|
|
118
|
+
autoComplete="email"
|
|
119
|
+
id="email"
|
|
120
|
+
onChange={event => setEmail(event.target.value)}
|
|
121
|
+
required
|
|
122
|
+
type="email"
|
|
123
|
+
value={email}
|
|
124
|
+
/>
|
|
125
|
+
<FieldDescription>
|
|
126
|
+
{subscribed
|
|
127
|
+
? `Thanks, ${email} is on the list.`
|
|
128
|
+
: 'We send at most one email a month.'}
|
|
129
|
+
</FieldDescription>
|
|
130
|
+
</Field>
|
|
131
|
+
</CardContent>
|
|
132
|
+
<CardFooter>
|
|
133
|
+
<Button disabled={subscribed} type="submit">
|
|
134
|
+
{subscribed ? 'Subscribed' : 'Subscribe'}
|
|
135
|
+
</Button>
|
|
136
|
+
</CardFooter>
|
|
137
|
+
</form>
|
|
138
|
+
</Card>
|
|
139
|
+
</Section>
|
|
140
|
+
</Container>
|
|
141
|
+
</Page>
|
|
142
|
+
)
|
|
143
|
+
}
|
|
@@ -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
|
+
}
|