@milesroxas/create-design-hub 0.1.3 → 0.3.0

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.
@@ -0,0 +1,63 @@
1
+ ---
2
+ type: guide
3
+ feature: sample-brand
4
+ date: 2026-11-24
5
+ audience: Anyone learning the template
6
+ ---
7
+
8
+ # Sample social post: a walkthrough
9
+
10
+ The brand track's reference: one announcement post in three formats, at real size, with every fixture set, layout and tone on a dial. Nothing here is a real campaign. It exists so a reviewer can see what collateral from this hub looks like, and so Claude has a working example of the conventions to read.
11
+
12
+ ## Before you start
13
+
14
+ 1. **Open the prototype** at `/sample-social/`.
15
+ 2. **Find Controls.** The dark round button at the top of the page opens a panel that belongs to the board, not the post. Review holds the fixture set, the post, the layout and the tone; Board holds the zoom and the safe-area guides; View holds theme and motion. The panel's last row, **Open the walkthrough**, brings this page back in a new tab.
16
+ 3. **Nothing persists.** Reload and the board is back on the first real post.
17
+
18
+ ## 1. Read the board
19
+
20
+ **Do:** open the prototype. The same post sits in three artboards: square, portrait and story, each labelled with its format and size.
21
+
22
+ - Each artboard is drawn at its real size (1080 wide) and scaled to fit the screen. Type sizes in the code are the sizes that ship.
23
+ - The story's top and bottom 250px are shaded: the platform's own buttons cover them, so type and the mark stay out.
24
+
25
+ ## 2. Break it
26
+
27
+ Controls → Review → Fixtures → **longest**
28
+
29
+ The headline and subhead doubled. The headline wraps; the square, with the least room, is where it breaks first.
30
+
31
+ Controls → Review → Fixtures → **missing**, then Post → **1** and **2**
32
+
33
+ A post with no image or kicker, and one with no subhead or call to action. The photo shows a dashed outline where the image would be.
34
+
35
+ Controls → Review → Fixtures → **empty**
36
+
37
+ No post: each artboard says so.
38
+
39
+ ## 3. Change the template
40
+
41
+ Controls → Review → Layout → **type**, Tone → **light**
42
+
43
+ The copy alone, larger, on the page colour. Every combination is a state the export can write.
44
+
45
+ ## 4. Export it
46
+
47
+ Ask Claude to export the post, or run `pnpm export sample-social`. It writes one PNG per artboard into `exports/sample-social/`, at exactly 1080 wide, from the dial state you name.
48
+
49
+ ## Every state, and how to reach it
50
+
51
+ | State | How to reach it |
52
+ | --- | --- |
53
+ | Real post | Controls → Review → Fixtures → **real** |
54
+ | Longest copy | Controls → Review → Fixtures → **longest** |
55
+ | No post | Controls → Review → Fixtures → **empty** |
56
+ | Missing content | Controls → Review → Fixtures → **missing** |
57
+ | Another post | Controls → Review → Post → **2** or **3** |
58
+ | Type only | Controls → Review → Layout → **type** |
59
+ | Light tone | Controls → Review → Tone → **light** |
60
+
61
+ ## What we need from you
62
+
63
+ Nothing. Delete `prototypes/sample-social/` and `docs/sprints/sample-brand/` once the project has a brand feature of its own.
@@ -0,0 +1,69 @@
1
+ ---
2
+ type: guide
3
+ feature: sample-site
4
+ date: 2026-11-24
5
+ audience: Anyone learning the template
6
+ ---
7
+
8
+ # Sample page: a walkthrough
9
+
10
+ The website track's reference: a journal index inside the website shell, with every fixture set on a dial. Nothing here is a real site. It exists so a reviewer can see what a website prototype from this hub looks like, and so Claude has a working example of the conventions to read.
11
+
12
+ ## Before you start
13
+
14
+ 1. **Open the prototype** at `/sample-page/`.
15
+ 2. **Find Controls.** The dark round button at the top of the page opens a panel that belongs to the prototype, not the site. Review holds the fixture set and the column count; Motion holds the two numbers the entrance uses; View holds theme, reduced motion and speed. The panel's last row, **Open the walkthrough**, brings this page back in a new tab.
16
+ 3. **Nothing persists.** Reload and the grid is back on the real set.
17
+
18
+ ## 1. Read the journal
19
+
20
+ **Do:** open the prototype. Six posts arrive one after another, under the site's header and above its footer.
21
+
22
+ - The card is the link. Category and date sit above the title; the excerpt stops at three lines.
23
+ - The header and footer come from `kit/shell.ts`, written once for every page of the site.
24
+
25
+ **Try:** click a card. A dark toast says the post would open here. That is the prototype speaking, not the site.
26
+
27
+ ## 2. Break it
28
+
29
+ Controls → Review → Fixtures → **longest**
30
+
31
+ The first post carries the longest real title and excerpt doubled. The title wraps; the excerpt still stops at three lines, so the row stays level.
32
+
33
+ Controls → Review → Fixtures → **empty**
34
+
35
+ No posts: the grid gives way to one line and a Subscribe action.
36
+
37
+ Controls → Review → Fixtures → **max**
38
+
39
+ Forty posts, the design's maximum for one page. The entrance stagger is capped at the eighth card.
40
+
41
+ Controls → Review → Fixtures → **missing**
42
+
43
+ A post with no image, one with no excerpt or category, one with no title or date. Each says what is missing where the value would be.
44
+
45
+ ## 3. Change the grid
46
+
47
+ Controls → Review → Columns → **2**
48
+
49
+ Two cards per row on a wide screen. Phones always show one.
50
+
51
+ ## Every state, and how to reach it
52
+
53
+ | State | How to reach it |
54
+ | --- | --- |
55
+ | Real posts | Controls → Review → Fixtures → **real** |
56
+ | Longest titles | Controls → Review → Fixtures → **longest** |
57
+ | Empty | Controls → Review → Fixtures → **empty** |
58
+ | Maximum count | Controls → Review → Fixtures → **max** |
59
+ | Missing content | Controls → Review → Fixtures → **missing** |
60
+ | Two columns | Controls → Review → Columns → **2** |
61
+ | Dark | Controls → View → Theme → **dark** |
62
+
63
+ ## What the prototype does not do
64
+
65
+ Opening a post and subscribing are scope toasts. The header's other links are the shell's stubs.
66
+
67
+ ## What we need from you
68
+
69
+ Nothing. Delete `prototypes/sample-page/` and `docs/sprints/sample-site/` once the project has a website feature of its own.
@@ -34,6 +34,7 @@ export const SITE = {
34
34
  nav: [
35
35
  { href: '#/', label: 'Home' },
36
36
  { href: '#/work', label: 'Work' },
37
+ { href: '#/journal', label: 'Journal' },
37
38
  { href: '#/about', label: 'About' },
38
39
  { href: '#/contact', label: 'Contact' },
39
40
  ] satisfies SiteLink[],
@@ -9,8 +9,10 @@
9
9
  "dev": "design-hub dev",
10
10
  "build": "design-hub build",
11
11
  "preview": "design-hub preview",
12
+ "export": "design-hub export",
12
13
  "bootstrap": "design-hub bootstrap",
13
14
  "new": "design-hub new",
15
+ "tracks": "design-hub tracks",
14
16
  "guide": "design-hub guide",
15
17
  "check": "design-hub check",
16
18
  "fix": "design-hub check --fix",
@@ -2,6 +2,7 @@
2
2
  title: Sample list
3
3
  summary: A list page with every fixture set on a dial, as the reference for the conventions.
4
4
  context: app
5
+ track: product
5
6
  status: exploring
6
7
  kind: sprint
7
8
  feature: sample
@@ -0,0 +1,52 @@
1
+ ---
2
+ title: Sample page
3
+ summary: A journal index inside the website shell, with every fixture set on a dial, as the reference for a website's conventions.
4
+ context: app
5
+ track: website
6
+ status: exploring
7
+ kind: sprint
8
+ feature: sample-site
9
+ created: 2026-11-24
10
+ ---
11
+
12
+ # Sample page
13
+
14
+ The website track's reference prototype. It shows what a website prototype from this hub looks like: a page inside `SiteShell`, sections that read their content the way the CMS hands it over, hostile fixtures on a dial, and a walkthrough at `/guide/sample-site/`. Delete it when the project has a website feature of its own.
15
+
16
+ ## Problem
17
+
18
+ A CMS page is designed with six tidy posts and launched with a hundred messy ones. Editors skip images, write long titles and publish drafts without excerpts, and the grid breaks on the first week of real content.
19
+
20
+ ## Question
21
+
22
+ Does the journal grid hold up under every fixture set, in two and three columns, without a card changing height in a way that breaks the row?
23
+
24
+ ## Flows
25
+
26
+ | Flow | Starts from | Edge cases |
27
+ | --- | --- | --- |
28
+ | Read the journal | `#/journal` | longest title, no posts, 40 posts, no image, no excerpt |
29
+ | Open a post | a card | the card is the link; Open is a scope toast |
30
+ | Filter by category | a category chip | a scope toast; filtering is not this prototype's question |
31
+
32
+ ## States
33
+
34
+ Every state the prototype holds, one row each. The fidelity guard and `miles-port` read this table.
35
+
36
+ | State | How to reach it |
37
+ | --- | --- |
38
+ | Real posts | Controls → Review → Fixtures → **real** |
39
+ | Longest titles | Controls → Review → Fixtures → **longest** |
40
+ | Empty | Controls → Review → Fixtures → **empty** |
41
+ | Maximum count | Controls → Review → Fixtures → **max** |
42
+ | Missing content | Controls → Review → Fixtures → **missing** |
43
+ | Two columns | Controls → Review → Columns → **2** |
44
+ | Dark | Controls → View → Theme → **dark** |
45
+
46
+ ## Fixtures
47
+
48
+ `fixtures.json` holds `real` (six posts written from the comp; a CMS project pulls them from its posts collection with the fields `title`, `excerpt`, `category`, `published` and `image`) and `missing` (hand-written: no image, no excerpt or category, no title or date). `@kit/fixtures` derives `longest`, `empty` and `max`; the design's maximum is 40 posts on one page.
49
+
50
+ ## Decision
51
+
52
+ Empty until picked. What was chosen, its values, and what was rejected and why. Then delete the folder.
@@ -0,0 +1,78 @@
1
+ {
2
+ "real": [
3
+ {
4
+ "id": "1",
5
+ "title": "How we plan a site rebuild in two weeks",
6
+ "excerpt": "The questions we ask before the first frame, and the ones we leave for the build.",
7
+ "category": "Process",
8
+ "published": "2026-10-28",
9
+ "image": "#dbe6fe"
10
+ },
11
+ {
12
+ "id": "2",
13
+ "title": "Choosing a CMS your editors will like",
14
+ "excerpt": "Webflow, Payload, WordPress and EmDash, compared on the work editors do every day.",
15
+ "category": "Platforms",
16
+ "published": "2026-10-21",
17
+ "image": "#fedf89"
18
+ },
19
+ {
20
+ "id": "3",
21
+ "title": "A pricing page that answers the second question",
22
+ "excerpt": "Visitors read the price, then look for what happens after they pay.",
23
+ "category": "Case study",
24
+ "published": "2026-10-14",
25
+ "image": "#a9efc5"
26
+ },
27
+ {
28
+ "id": "4",
29
+ "title": "Motion that survives a slow phone",
30
+ "excerpt": "What we animate, what we fade, and what we never move.",
31
+ "category": "Craft",
32
+ "published": "2026-10-07",
33
+ "image": "#fecdc9"
34
+ },
35
+ {
36
+ "id": "5",
37
+ "title": "Writing alt text people actually hear",
38
+ "excerpt": "Short, specific, and written for the sentence around the image.",
39
+ "category": "Accessibility",
40
+ "published": "2026-09-30",
41
+ "image": "#e9d7fe"
42
+ },
43
+ {
44
+ "id": "6",
45
+ "title": "The footer is a sitemap, not a junk drawer",
46
+ "excerpt": "Three columns, one note, and nothing a visitor has to hunt for.",
47
+ "category": "Craft",
48
+ "published": "2026-09-23",
49
+ "image": "#d1fadf"
50
+ }
51
+ ],
52
+ "missing": [
53
+ {
54
+ "id": "m1",
55
+ "title": "A post with no image",
56
+ "excerpt": "Editors skip the image more often than the design expects.",
57
+ "category": "Process",
58
+ "published": "2026-10-28",
59
+ "image": null
60
+ },
61
+ {
62
+ "id": "m2",
63
+ "title": "A post with no excerpt",
64
+ "excerpt": "",
65
+ "category": "",
66
+ "published": "2026-10-21",
67
+ "image": "#fedf89"
68
+ },
69
+ {
70
+ "id": "m3",
71
+ "title": "",
72
+ "excerpt": "A draft that was published before it had a title.",
73
+ "category": "Platforms",
74
+ "published": "",
75
+ "image": "#a9efc5"
76
+ }
77
+ ]
78
+ }
@@ -0,0 +1,115 @@
1
+ import { DialVars, useDials } from '@kit/dials';
2
+ import { type FixtureSets, fixtureSets, SET_NAMES, type SetName } from '@kit/fixtures';
3
+ import { fmtDate, plural } from '@kit/format';
4
+ import { SiteShell } from '@kit/SiteShell';
5
+ import { Button, notInPrototype, toast } from '@kit/ui';
6
+ import type { CSSProperties } from 'react';
7
+ import data from './fixtures.json';
8
+ import './styles.css';
9
+
10
+ type Post = {
11
+ id: string;
12
+ title: string;
13
+ excerpt: string;
14
+ category: string;
15
+ published: string;
16
+ image: string | null;
17
+ };
18
+
19
+ const MAX_POSTS = 40;
20
+ const sets: FixtureSets<Post> = fixtureSets(data satisfies { real: Post[]; missing: Post[] }, {
21
+ max: MAX_POSTS,
22
+ text: ['title', 'excerpt'],
23
+ });
24
+
25
+ function PostCard({ post, index }: { post: Post; index: number }) {
26
+ return (
27
+ <li className="post" style={{ '--i': Math.min(index, 8) } as CSSProperties}>
28
+ <a
29
+ className="post-link"
30
+ href={`#/journal/${post.id}`}
31
+ onClick={(e) => {
32
+ e.preventDefault();
33
+ toast(`${post.title || 'The post'} would open here.`, { kind: 'scope' });
34
+ }}
35
+ >
36
+ {post.image ? (
37
+ <span className="post-image" style={{ background: post.image }} aria-hidden="true" />
38
+ ) : (
39
+ <span className="post-image is-missing" aria-hidden="true" />
40
+ )}
41
+ <span className="post-meta">
42
+ {post.category ? <span className="post-category">{post.category}</span> : null}
43
+ <time className="tabular" dateTime={post.published}>
44
+ {fmtDate(post.published) || 'Unscheduled'}
45
+ </time>
46
+ </span>
47
+ <span className="post-title">{post.title || <span className="post-untitled">Untitled</span>}</span>
48
+ {post.excerpt ? <span className="post-excerpt">{post.excerpt}</span> : null}
49
+ </a>
50
+ </li>
51
+ );
52
+ }
53
+
54
+ // The journal is its own component so its Review panel registers before the
55
+ // Motion dials and View: a child registers before its parent, and siblings in order.
56
+ function Journal() {
57
+ const review = useDials(
58
+ 'Review',
59
+ {
60
+ fixtures: { type: 'select', options: [...SET_NAMES], default: 'real' },
61
+ columns: { type: 'select', options: ['3', '2'], default: '3' },
62
+ },
63
+ {
64
+ hints: {
65
+ fixtures:
66
+ 'Which fixture set the grid shows. longest, empty and max are derived from real by @kit/fixtures.',
67
+ columns: 'Cards per row on a wide screen. Phones always show one.',
68
+ },
69
+ },
70
+ );
71
+ const posts = sets[review.fixtures as SetName];
72
+
73
+ return (
74
+ <div className="journal" data-columns={review.columns}>
75
+ <header className="journal-head">
76
+ <h1>Journal</h1>
77
+ <p className="journal-lede">Notes on the work: process, platforms and craft.</p>
78
+ </header>
79
+ {posts.length === 0 ? (
80
+ <div className="journal-empty">
81
+ <h2>No posts yet</h2>
82
+ <p>The first post appears here when it is published.</p>
83
+ <Button kind="secondary" label="Subscribe" onClick={() => notInPrototype('Subscribing')} />
84
+ </div>
85
+ ) : (
86
+ <>
87
+ <ul className="posts">
88
+ {posts.map((post, i) => (
89
+ <PostCard key={post.id} post={post} index={i} />
90
+ ))}
91
+ </ul>
92
+ <p className="journal-foot tabular">{plural(posts.length, 'post')}</p>
93
+ </>
94
+ )}
95
+ </div>
96
+ );
97
+ }
98
+
99
+ export default function Prototype() {
100
+ return (
101
+ <SiteShell active="#/journal">
102
+ <Journal />
103
+ <DialVars
104
+ name="Motion"
105
+ config={{ rise: [260, 0, 600, 10], stagger: [40, 0, 120, 5] }}
106
+ options={{
107
+ hints: {
108
+ rise: 'How long each card takes to arrive, in ms.',
109
+ stagger: 'The gap between one card and the next, in ms.',
110
+ },
111
+ }}
112
+ />
113
+ </SiteShell>
114
+ );
115
+ }
@@ -0,0 +1,27 @@
1
+ /* The journal: a grid of cards that keeps its rows level whatever the
2
+ content. Cards arrive 6px up, one after another, on the dials in index.tsx
3
+ (--rise, --stagger, unitless ms). */
4
+ .journal-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 40px; }
5
+ .journal-head h1 { font-size: 40px; line-height: 48px; letter-spacing: -0.02em; }
6
+ .journal-lede { font-size: 18px; line-height: 28px; color: var(--text-secondary); max-width: 56ch; }
7
+ .posts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
8
+ .journal[data-columns="2"] .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
9
+ .post { animation: post-rise calc(var(--rise, 260) * 1ms) var(--ease-out) calc(var(--i, 0) * var(--stagger, 40) * 1ms) backwards; }
10
+ .post-link { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 8px; margin: -8px; border-radius: var(--radius-md); color: inherit; text-decoration: none; transition: background-color var(--dur-hover) var(--ease-hover); }
11
+ @media (hover: hover) and (pointer: fine) { .post-link:hover { background: var(--bg-primary_hover); } }
12
+ .post-link:active { background: var(--bg-active); }
13
+ .post-image { aspect-ratio: 3 / 2; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px rgb(16 24 40 / 0.08); margin-bottom: 8px; }
14
+ .post-image.is-missing { background: var(--bg-secondary); box-shadow: none; outline: 1px dashed var(--border-primary); outline-offset: -1px; }
15
+ .post-meta { display: flex; gap: 12px; font-size: 12px; line-height: 18px; color: var(--text-tertiary); }
16
+ .post-category { font-weight: 600; color: var(--text-secondary); }
17
+ .post-title { font-size: 18px; line-height: 26px; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; text-wrap: pretty; }
18
+ .post-untitled { color: var(--text-quaternary); font-style: italic; font-weight: 500; }
19
+ .post-excerpt { color: var(--text-secondary); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
20
+ .journal-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 48px 0; }
21
+ .journal-empty p { color: var(--text-secondary); margin-bottom: 8px; }
22
+ .journal-foot { margin-top: 40px; color: var(--text-tertiary); font-size: 14px; }
23
+ @keyframes post-rise { from { opacity: 0; translate: 0 6px; } }
24
+ :root[data-motion="reduce"] .post { animation-name: post-fade; }
25
+ @keyframes post-fade { from { opacity: 0; } }
26
+ @media (max-width: 900px) { .posts, .journal[data-columns="2"] .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
27
+ @media (max-width: 600px) { .posts, .journal[data-columns="2"] .posts { grid-template-columns: minmax(0, 1fr); } }
@@ -0,0 +1,56 @@
1
+ ---
2
+ title: Sample social post
3
+ summary: One announcement post in three formats, with every fixture set, layout and tone on a dial, as the reference for brand collateral.
4
+ context: board
5
+ track: brand
6
+ status: exploring
7
+ kind: sprint
8
+ feature: sample-brand
9
+ created: 2026-11-24
10
+ ---
11
+
12
+ # Sample social post
13
+
14
+ The brand track's reference prototype. It shows what collateral from this hub looks like: one template drawn at real size in three formats, copy from fixtures, the brand's tokens, dials for layout and tone, and files written with `pnpm export sample-social`. Delete it when the project has a brand feature of its own.
15
+
16
+ ## Problem
17
+
18
+ A post template is approved with one tidy headline and then filled by whoever posts next week: a long headline, no image, no call to action. The square looks right and the story crops the logo under the platform's own buttons.
19
+
20
+ ## Question
21
+
22
+ Does one template hold every post the team will write, in square, portrait and story, without a format breaking?
23
+
24
+ ## Formats
25
+
26
+ | Artboard | Format | Where it runs |
27
+ | --- | --- | --- |
28
+ | square | `post-square`, 1080 × 1080 | Instagram and LinkedIn feeds |
29
+ | portrait | `post-portrait`, 1080 × 1350 | Instagram feed |
30
+ | story | `story`, 1080 × 1920 | Instagram and LinkedIn stories; type stays out of the top and bottom 250px |
31
+
32
+ ## States
33
+
34
+ Every state the board holds, one row each. `miles-port` and the export read this table.
35
+
36
+ | State | How to reach it |
37
+ | --- | --- |
38
+ | Real post | Controls → Review → Fixtures → **real** |
39
+ | Longest copy | Controls → Review → Fixtures → **longest** |
40
+ | No post | Controls → Review → Fixtures → **empty** |
41
+ | Missing content | Controls → Review → Fixtures → **missing** |
42
+ | Another post | Controls → Review → Post → **2** or **3** |
43
+ | Type only | Controls → Review → Layout → **type** |
44
+ | Light tone | Controls → Review → Tone → **light** |
45
+
46
+ ## Fixtures
47
+
48
+ `fixtures.json` holds `real` (three announcements written from the comp) and `missing` (no image or kicker; no subhead or call to action). `@kit/fixtures` derives `longest`, `empty` and `max`.
49
+
50
+ ## Export
51
+
52
+ `pnpm export sample-social` writes `exports/sample-social/sample-social-square.png`, `-portrait.png` and `-story.png` at 1080 wide. Another state: `pnpm export sample-social --dials '{"Review":{"layout":"type","tone":"light"}}'`.
53
+
54
+ ## Decision
55
+
56
+ Empty until picked. What was chosen, its values, and what was rejected and why. Then delete the folder.
@@ -0,0 +1,46 @@
1
+ {
2
+ "real": [
3
+ {
4
+ "id": "1",
5
+ "kicker": "New",
6
+ "headline": "Plan a site rebuild in two weeks",
7
+ "sub": "The questions we ask before the first frame.",
8
+ "cta": "Read the guide",
9
+ "image": "#dbe6fe"
10
+ },
11
+ {
12
+ "id": "2",
13
+ "kicker": "Case study",
14
+ "headline": "A pricing page that answers the second question",
15
+ "sub": "What visitors look for after they read the price.",
16
+ "cta": "See the work",
17
+ "image": "#fedf89"
18
+ },
19
+ {
20
+ "id": "3",
21
+ "kicker": "Event",
22
+ "headline": "Design review, live, every Thursday",
23
+ "sub": "Bring a screen. Leave with three decisions.",
24
+ "cta": "Save a seat",
25
+ "image": "#a9efc5"
26
+ }
27
+ ],
28
+ "missing": [
29
+ {
30
+ "id": "m1",
31
+ "kicker": "",
32
+ "headline": "A post with no image and no kicker",
33
+ "sub": "Editors skip the image more often than the design expects.",
34
+ "cta": "Read more",
35
+ "image": null
36
+ },
37
+ {
38
+ "id": "m2",
39
+ "kicker": "New",
40
+ "headline": "A post with no subhead or call to action",
41
+ "sub": "",
42
+ "cta": "",
43
+ "image": "#fecdc9"
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,95 @@
1
+ import { Artboard, Board, type FormatName } from '@kit/Artboard';
2
+ import { useDials } from '@kit/dials';
3
+ import { type FixtureSets, fixtureSets, SET_NAMES, type SetName } from '@kit/fixtures';
4
+ import { Icon } from '@kit/Icon';
5
+ import { BRAND } from '@kit/shell';
6
+ import data from './fixtures.json';
7
+ import './styles.css';
8
+
9
+ type Post = { id: string; kicker: string; headline: string; sub: string; cta: string; image: string | null };
10
+
11
+ const sets: FixtureSets<Post> = fixtureSets(data satisfies { real: Post[]; missing: Post[] }, {
12
+ max: 3,
13
+ text: ['headline', 'sub'],
14
+ });
15
+
16
+ const ARTBOARDS: { format: FormatName; name: string }[] = [
17
+ { format: 'post-square', name: 'square' },
18
+ { format: 'post-portrait', name: 'portrait' },
19
+ { format: 'story', name: 'story' },
20
+ ];
21
+
22
+ function PostArt({ post, layout, tone }: { post: Post | undefined; layout: string; tone: string }) {
23
+ if (!post)
24
+ return (
25
+ <div className="post-art post-none" data-tone={tone}>
26
+ <p>No post in this set.</p>
27
+ </div>
28
+ );
29
+ const photo = layout === 'photo';
30
+ return (
31
+ <div className="post-art" data-tone={tone} data-layout={layout}>
32
+ {photo ? (
33
+ <div
34
+ className={post.image ? 'post-photo' : 'post-photo is-missing'}
35
+ style={post.image ? { background: post.image } : undefined}
36
+ aria-hidden="true"
37
+ />
38
+ ) : null}
39
+ <div className="post-copy">
40
+ {post.kicker ? <p className="post-kicker">{post.kicker}</p> : null}
41
+ <h2 className="post-headline">{post.headline}</h2>
42
+ {post.sub ? <p className="post-sub">{post.sub}</p> : null}
43
+ {post.cta ? <p className="post-cta">{post.cta}</p> : null}
44
+ </div>
45
+ <p className="post-brand">
46
+ <Icon name={BRAND.glyph} size={40} />
47
+ {BRAND.name}
48
+ </p>
49
+ </div>
50
+ );
51
+ }
52
+
53
+ // The post is its own component so its Review panel registers before the Board's.
54
+ function Posts() {
55
+ const review = useDials(
56
+ 'Review',
57
+ {
58
+ fixtures: { type: 'select', options: [...SET_NAMES], default: 'real' },
59
+ post: { type: 'select', options: ['1', '2', '3'], default: '1' },
60
+ layout: { type: 'select', options: ['photo', 'type'], default: 'photo' },
61
+ tone: { type: 'select', options: ['brand', 'light'], default: 'brand' },
62
+ },
63
+ {
64
+ hints: {
65
+ fixtures:
66
+ 'Which fixture set the post reads. longest, empty and max are derived from real by @kit/fixtures.',
67
+ post: 'Which post in the set. A set with fewer posts shows its last.',
68
+ layout: 'photo: an image above the copy. type: copy alone, larger.',
69
+ tone: 'brand: the brand colour behind white type. light: the page colour behind brand type.',
70
+ },
71
+ },
72
+ );
73
+ const posts = sets[review.fixtures as SetName];
74
+ const post = posts[Math.min(Number(review.post), posts.length) - 1];
75
+ return (
76
+ <>
77
+ {ARTBOARDS.map((a) => (
78
+ <Artboard key={a.name} format={a.format} name={a.name}>
79
+ <PostArt post={post} layout={review.layout as string} tone={review.tone as string} />
80
+ </Artboard>
81
+ ))}
82
+ </>
83
+ );
84
+ }
85
+
86
+ export default function Prototype() {
87
+ return (
88
+ <Board
89
+ title="Sample social post"
90
+ lede="Does one template hold every post the team will write, in every format?"
91
+ >
92
+ <Posts />
93
+ </Board>
94
+ );
95
+ }
@@ -0,0 +1,20 @@
1
+ /* Real pixels: every artboard is 1080 wide. The copy block sits at the
2
+ bottom; the story's extra height goes to the photo, and its 250px top and
3
+ bottom bands stay clear of type and the mark. */
4
+ .post-art { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 56px; padding: 88px; background: var(--bg-brand-solid); color: var(--text-white); font-family: inherit; }
5
+ .post-art[data-tone="light"] { background: var(--bg-primary); color: var(--text-primary); }
6
+ .post-photo { flex: 1; min-height: 0; border-radius: 24px; box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.2); }
7
+ .post-photo.is-missing { background: transparent; outline: 3px dashed currentColor; outline-offset: -3px; opacity: 0.4; }
8
+ .post-copy { display: flex; flex-direction: column; gap: 24px; }
9
+ .post-art[data-layout="type"] .post-copy { flex: 1; justify-content: center; }
10
+ .post-kicker { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
11
+ .post-headline { font-size: 80px; line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; overflow-wrap: anywhere; }
12
+ .post-art[data-layout="type"] .post-headline { font-size: 104px; }
13
+ .post-sub { font-size: 34px; line-height: 46px; max-width: 28ch; opacity: 0.85; }
14
+ .post-cta { align-self: flex-start; padding: 18px 32px; border-radius: 999px; background: var(--text-white); color: var(--bg-brand-solid); font-size: 30px; line-height: 36px; font-weight: 600; }
15
+ .post-art[data-tone="light"] .post-cta { background: var(--bg-brand-solid); color: var(--text-white); }
16
+ .post-brand { display: flex; align-items: center; gap: 16px; font-size: 32px; line-height: 40px; font-weight: 600; }
17
+ .post-none { justify-content: center; align-items: center; font-size: 40px; opacity: 0.7; }
18
+ [data-format="post-square"] .post-art { gap: 40px; padding: 72px; }
19
+ [data-format="post-square"] .post-headline { font-size: 68px; }
20
+ [data-format="story"] .post-art { padding: 250px 88px; }