@forumone/create-throughline 0.2.1 → 0.3.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.
Files changed (139) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/generator.d.ts +2 -0
  3. package/dist/generator.d.ts.map +1 -1
  4. package/dist/generator.js +23 -4
  5. package/dist/generator.js.map +1 -1
  6. package/dist/post-install.js +1 -1
  7. package/dist/post-install.js.map +1 -1
  8. package/dist/templates/base/README.md +8 -9
  9. package/dist/templates/base/apps/web/package.json.template +11 -10
  10. package/dist/templates/base/apps/web/src/app/api/inngest/route.ts.template +33 -4
  11. package/dist/templates/base/apps/web/src/payload.config.ts.template +21 -6
  12. package/dist/templates/base/apps/web/tsconfig.json +2 -1
  13. package/dist/templates/base/gitignore +15 -0
  14. package/dist/templates/base/package.json.template +4 -1
  15. package/dist/templates/base/pnpm-workspace.yaml +1 -0
  16. package/dist/templates/base/turbo.json +11 -0
  17. package/dist/templates/with-reference-ds/design-system/.storybook/main.ts +21 -0
  18. package/dist/templates/with-reference-ds/design-system/.storybook/preview.ts +19 -0
  19. package/dist/templates/with-reference-ds/design-system/README.md +33 -0
  20. package/dist/templates/with-reference-ds/design-system/gitignore +5 -0
  21. package/dist/templates/with-reference-ds/design-system/package.json.template +62 -0
  22. package/dist/templates/with-reference-ds/design-system/scripts/build-manifest.ts +89 -0
  23. package/dist/templates/with-reference-ds/design-system/scripts/build-styles.ts +28 -0
  24. package/dist/templates/with-reference-ds/design-system/scripts/build-tokens-css.ts +43 -0
  25. package/dist/templates/with-reference-ds/design-system/scripts/validate.ts +58 -0
  26. package/dist/templates/with-reference-ds/design-system/src/components/CTASection/CTASection.contract.ts +128 -0
  27. package/dist/templates/with-reference-ds/design-system/src/components/CTASection/CTASection.module.css +83 -0
  28. package/dist/templates/with-reference-ds/design-system/src/components/CTASection/CTASection.stories.tsx +39 -0
  29. package/dist/templates/with-reference-ds/design-system/src/components/CTASection/CTASection.test.tsx +27 -0
  30. package/dist/templates/with-reference-ds/design-system/src/components/CTASection/CTASection.tsx +41 -0
  31. package/dist/templates/with-reference-ds/design-system/src/components/CTASection/index.ts +2 -0
  32. package/dist/templates/with-reference-ds/design-system/src/components/Card/Card.contract.ts +122 -0
  33. package/dist/templates/with-reference-ds/design-system/src/components/Card/Card.module.css +64 -0
  34. package/dist/templates/with-reference-ds/design-system/src/components/Card/Card.stories.tsx +45 -0
  35. package/dist/templates/with-reference-ds/design-system/src/components/Card/Card.test.tsx +37 -0
  36. package/dist/templates/with-reference-ds/design-system/src/components/Card/Card.tsx +39 -0
  37. package/dist/templates/with-reference-ds/design-system/src/components/Card/index.ts +2 -0
  38. package/dist/templates/with-reference-ds/design-system/src/components/CardGrid/CardGrid.contract.ts +78 -0
  39. package/dist/templates/with-reference-ds/design-system/src/components/CardGrid/CardGrid.module.css +34 -0
  40. package/dist/templates/with-reference-ds/design-system/src/components/CardGrid/CardGrid.stories.tsx +36 -0
  41. package/dist/templates/with-reference-ds/design-system/src/components/CardGrid/CardGrid.test.tsx +25 -0
  42. package/dist/templates/with-reference-ds/design-system/src/components/CardGrid/CardGrid.tsx +19 -0
  43. package/dist/templates/with-reference-ds/design-system/src/components/CardGrid/index.ts +2 -0
  44. package/dist/templates/with-reference-ds/design-system/src/components/Divider/Divider.contract.ts +87 -0
  45. package/dist/templates/with-reference-ds/design-system/src/components/Divider/Divider.module.css +18 -0
  46. package/dist/templates/with-reference-ds/design-system/src/components/Divider/Divider.stories.tsx +35 -0
  47. package/dist/templates/with-reference-ds/design-system/src/components/Divider/Divider.test.tsx +20 -0
  48. package/dist/templates/with-reference-ds/design-system/src/components/Divider/Divider.tsx +17 -0
  49. package/dist/templates/with-reference-ds/design-system/src/components/Divider/index.ts +2 -0
  50. package/dist/templates/with-reference-ds/design-system/src/components/FAQ/FAQ.contract.ts +104 -0
  51. package/dist/templates/with-reference-ds/design-system/src/components/FAQ/FAQ.module.css +66 -0
  52. package/dist/templates/with-reference-ds/design-system/src/components/FAQ/FAQ.stories.tsx +61 -0
  53. package/dist/templates/with-reference-ds/design-system/src/components/FAQ/FAQ.test.tsx +30 -0
  54. package/dist/templates/with-reference-ds/design-system/src/components/FAQ/FAQ.tsx +41 -0
  55. package/dist/templates/with-reference-ds/design-system/src/components/FAQ/index.ts +2 -0
  56. package/dist/templates/with-reference-ds/design-system/src/components/Hero/Hero.contract.ts +182 -0
  57. package/dist/templates/with-reference-ds/design-system/src/components/Hero/Hero.module.css +124 -0
  58. package/dist/templates/with-reference-ds/design-system/src/components/Hero/Hero.stories.tsx +58 -0
  59. package/dist/templates/with-reference-ds/design-system/src/components/Hero/Hero.test.tsx +49 -0
  60. package/dist/templates/with-reference-ds/design-system/src/components/Hero/Hero.tsx +67 -0
  61. package/dist/templates/with-reference-ds/design-system/src/components/Hero/index.ts +2 -0
  62. package/dist/templates/with-reference-ds/design-system/src/components/MediaBlock/MediaBlock.contract.ts +94 -0
  63. package/dist/templates/with-reference-ds/design-system/src/components/MediaBlock/MediaBlock.module.css +49 -0
  64. package/dist/templates/with-reference-ds/design-system/src/components/MediaBlock/MediaBlock.stories.tsx +37 -0
  65. package/dist/templates/with-reference-ds/design-system/src/components/MediaBlock/MediaBlock.test.tsx +35 -0
  66. package/dist/templates/with-reference-ds/design-system/src/components/MediaBlock/MediaBlock.tsx +49 -0
  67. package/dist/templates/with-reference-ds/design-system/src/components/MediaBlock/index.ts +7 -0
  68. package/dist/templates/with-reference-ds/design-system/src/components/Prose/Prose.contract.ts +107 -0
  69. package/dist/templates/with-reference-ds/design-system/src/components/Prose/Prose.module.css +72 -0
  70. package/dist/templates/with-reference-ds/design-system/src/components/Prose/Prose.stories.tsx +39 -0
  71. package/dist/templates/with-reference-ds/design-system/src/components/Prose/Prose.test.tsx +26 -0
  72. package/dist/templates/with-reference-ds/design-system/src/components/Prose/Prose.tsx +15 -0
  73. package/dist/templates/with-reference-ds/design-system/src/components/Prose/index.ts +2 -0
  74. package/dist/templates/with-reference-ds/design-system/src/components/Quote/Quote.contract.ts +101 -0
  75. package/dist/templates/with-reference-ds/design-system/src/components/Quote/Quote.module.css +59 -0
  76. package/dist/templates/with-reference-ds/design-system/src/components/Quote/Quote.stories.tsx +44 -0
  77. package/dist/templates/with-reference-ds/design-system/src/components/Quote/Quote.test.tsx +37 -0
  78. package/dist/templates/with-reference-ds/design-system/src/components/Quote/Quote.tsx +40 -0
  79. package/dist/templates/with-reference-ds/design-system/src/components/Quote/index.ts +2 -0
  80. package/dist/templates/with-reference-ds/design-system/src/components/SectionIntro/SectionIntro.contract.ts +108 -0
  81. package/dist/templates/with-reference-ds/design-system/src/components/SectionIntro/SectionIntro.module.css +36 -0
  82. package/dist/templates/with-reference-ds/design-system/src/components/SectionIntro/SectionIntro.stories.tsx +33 -0
  83. package/dist/templates/with-reference-ds/design-system/src/components/SectionIntro/SectionIntro.test.tsx +28 -0
  84. package/dist/templates/with-reference-ds/design-system/src/components/SectionIntro/SectionIntro.tsx +28 -0
  85. package/dist/templates/with-reference-ds/design-system/src/components/SectionIntro/index.ts +2 -0
  86. package/dist/templates/with-reference-ds/design-system/src/components/Spacer/Spacer.contract.ts +76 -0
  87. package/dist/templates/with-reference-ds/design-system/src/components/Spacer/Spacer.module.css +23 -0
  88. package/dist/templates/with-reference-ds/design-system/src/components/Spacer/Spacer.stories.tsx +25 -0
  89. package/dist/templates/with-reference-ds/design-system/src/components/Spacer/Spacer.test.tsx +17 -0
  90. package/dist/templates/with-reference-ds/design-system/src/components/Spacer/Spacer.tsx +19 -0
  91. package/dist/templates/with-reference-ds/design-system/src/components/Spacer/index.ts +2 -0
  92. package/dist/templates/with-reference-ds/design-system/src/components/Stats/Stats.contract.ts +103 -0
  93. package/dist/templates/with-reference-ds/design-system/src/components/Stats/Stats.module.css +88 -0
  94. package/dist/templates/with-reference-ds/design-system/src/components/Stats/Stats.stories.tsx +44 -0
  95. package/dist/templates/with-reference-ds/design-system/src/components/Stats/Stats.test.tsx +44 -0
  96. package/dist/templates/with-reference-ds/design-system/src/components/Stats/Stats.tsx +39 -0
  97. package/dist/templates/with-reference-ds/design-system/src/components/Stats/index.ts +2 -0
  98. package/dist/templates/with-reference-ds/design-system/src/css-modules.d.ts +5 -0
  99. package/dist/templates/with-reference-ds/design-system/src/foundations/Colors.stories.tsx +46 -0
  100. package/dist/templates/with-reference-ds/design-system/src/foundations/Elevation.stories.tsx +37 -0
  101. package/dist/templates/with-reference-ds/design-system/src/foundations/LayoutContainers.stories.tsx +86 -0
  102. package/dist/templates/with-reference-ds/design-system/src/foundations/Radii.stories.tsx +38 -0
  103. package/dist/templates/with-reference-ds/design-system/src/foundations/Spacing.stories.tsx +33 -0
  104. package/dist/templates/with-reference-ds/design-system/src/foundations/Typography.stories.tsx +55 -0
  105. package/dist/templates/with-reference-ds/design-system/src/foundations/_helpers.tsx +82 -0
  106. package/dist/templates/with-reference-ds/design-system/src/index.ts +14 -0
  107. package/dist/templates/with-reference-ds/design-system/src/styles/base.css +55 -0
  108. package/dist/templates/with-reference-ds/design-system/src/styles/reset.css +48 -0
  109. package/dist/templates/with-reference-ds/design-system/src/styles/tokens.css +116 -0
  110. package/dist/templates/with-reference-ds/design-system/src/tokens/colors.ts +54 -0
  111. package/dist/templates/with-reference-ds/design-system/src/tokens/index.ts +32 -0
  112. package/dist/templates/with-reference-ds/design-system/src/tokens/layout.ts +26 -0
  113. package/dist/templates/with-reference-ds/design-system/src/tokens/radii.ts +11 -0
  114. package/dist/templates/with-reference-ds/design-system/src/tokens/spacing.ts +26 -0
  115. package/dist/templates/with-reference-ds/design-system/src/tokens/typography.ts +32 -0
  116. package/dist/templates/with-reference-ds/design-system/tsconfig.json +24 -0
  117. package/dist/templates/with-reference-ds/design-system/vitest.config.ts +15 -0
  118. package/dist/templates/with-reference-ds/design-system/vitest.setup.ts +7 -0
  119. package/dist/templates/without-reference-ds/design-system/.storybook/main.ts +21 -0
  120. package/dist/templates/without-reference-ds/design-system/.storybook/preview.ts +16 -0
  121. package/dist/templates/without-reference-ds/design-system/README.md +20 -0
  122. package/dist/templates/without-reference-ds/design-system/gitignore +5 -0
  123. package/dist/templates/without-reference-ds/design-system/package.json.template +33 -0
  124. package/dist/templates/without-reference-ds/design-system/src/foundations/Welcome.stories.tsx +24 -0
  125. package/dist/templates/without-reference-ds/design-system/src/index.ts +9 -0
  126. package/dist/templates/without-reference-ds/design-system/tsconfig.json +11 -0
  127. package/dist/utils/versions.d.ts +20 -0
  128. package/dist/utils/versions.d.ts.map +1 -0
  129. package/dist/utils/versions.js +59 -0
  130. package/dist/utils/versions.js.map +1 -0
  131. package/dist/versions.json +14 -0
  132. package/package.json +7 -5
  133. package/dist/templates/with-reference-ds/packages/design-system/package.json.template +0 -18
  134. package/dist/templates/with-reference-ds/packages/design-system/src/index.ts +0 -6
  135. package/dist/templates/with-reference-ds/packages/design-system/src/manifest.ts +0 -6
  136. package/dist/templates/with-reference-ds/packages/design-system/tsconfig.json +0 -9
  137. package/dist/templates/without-reference-ds/packages/design-system/README.md +0 -19
  138. package/dist/templates/without-reference-ds/packages/design-system/package.json.template +0 -14
  139. package/dist/templates/without-reference-ds/packages/design-system/src/index.ts +0 -8
@@ -0,0 +1,82 @@
1
+ import type { CSSProperties, ReactNode } from 'react'
2
+
3
+ /** Shared layout chrome for every Foundations page. */
4
+ export function FoundationPage({
5
+ title,
6
+ intro,
7
+ children,
8
+ }: {
9
+ title: string
10
+ intro?: string
11
+ children: ReactNode
12
+ }) {
13
+ return (
14
+ <div
15
+ style={{
16
+ fontFamily: 'var(--font-family-sans)',
17
+ color: 'var(--color-text-primary)',
18
+ background: 'var(--color-bg-primary)',
19
+ padding: '2rem',
20
+ maxWidth: '64rem',
21
+ }}
22
+ >
23
+ <h1 style={{ fontSize: 'var(--font-size-4xl)', margin: '0 0 0.5rem', lineHeight: 1.15 }}>
24
+ {title}
25
+ </h1>
26
+ {intro ? (
27
+ <p
28
+ style={{
29
+ color: 'var(--color-text-secondary)',
30
+ margin: '0 0 2rem',
31
+ maxWidth: '42rem',
32
+ lineHeight: 'var(--line-height-relaxed)',
33
+ }}
34
+ >
35
+ {intro}
36
+ </p>
37
+ ) : null}
38
+ {children}
39
+ </div>
40
+ )
41
+ }
42
+
43
+ const cell: CSSProperties = {
44
+ textAlign: 'left',
45
+ padding: '0.5rem 0.75rem',
46
+ borderBottom: '1px solid var(--color-border-default)',
47
+ verticalAlign: 'middle',
48
+ }
49
+
50
+ /** A simple token reference table: name, resolved value, and a preview cell. */
51
+ export function TokenTable({
52
+ rows,
53
+ }: {
54
+ rows: Array<{ name: string; value: string; preview?: ReactNode }>
55
+ }) {
56
+ return (
57
+ <table
58
+ style={{
59
+ borderCollapse: 'collapse',
60
+ width: '100%',
61
+ fontSize: 'var(--font-size-sm)',
62
+ }}
63
+ >
64
+ <thead>
65
+ <tr>
66
+ <th style={{ ...cell, color: 'var(--color-text-muted)', fontWeight: 600 }}>Token</th>
67
+ <th style={{ ...cell, color: 'var(--color-text-muted)', fontWeight: 600 }}>Value</th>
68
+ <th style={{ ...cell, color: 'var(--color-text-muted)', fontWeight: 600 }}>Preview</th>
69
+ </tr>
70
+ </thead>
71
+ <tbody>
72
+ {rows.map((row) => (
73
+ <tr key={row.name}>
74
+ <td style={{ ...cell, fontFamily: 'var(--font-family-mono)' }}>{row.name}</td>
75
+ <td style={{ ...cell, color: 'var(--color-text-secondary)' }}>{row.value}</td>
76
+ <td style={cell}>{row.preview}</td>
77
+ </tr>
78
+ ))}
79
+ </tbody>
80
+ </table>
81
+ )
82
+ }
@@ -0,0 +1,14 @@
1
+ export { Hero, type HeroProps, type HeroVariant, type HeroBackground } from './components/Hero/index.js'
2
+ export { SectionIntro, type SectionIntroProps, type SectionIntroAlignment } from './components/SectionIntro/index.js'
3
+ export { Prose, type ProseProps, type ProseSize } from './components/Prose/index.js'
4
+ export { MediaBlock, type MediaBlockProps, type MediaBlockAspect, type MediaBlockMedia } from './components/MediaBlock/index.js'
5
+ export { Card, type CardProps } from './components/Card/index.js'
6
+ export { CardGrid, type CardGridProps, type CardGridColumns } from './components/CardGrid/index.js'
7
+ export { CTASection, type CTASectionProps, type CTASectionBackground } from './components/CTASection/index.js'
8
+ export { Stats, type StatsProps, type StatItem } from './components/Stats/index.js'
9
+ export { FAQ, type FAQProps, type FAQItem } from './components/FAQ/index.js'
10
+ export { Quote, type QuoteProps, type QuoteSize } from './components/Quote/index.js'
11
+ export { Divider, type DividerProps, type DividerSpacing } from './components/Divider/index.js'
12
+ export { Spacer, type SpacerProps, type SpacerSize } from './components/Spacer/index.js'
13
+
14
+ export * as tokens from './tokens/index.js'
@@ -0,0 +1,55 @@
1
+ /* Base element styles applied on top of reset.css + tokens.css. */
2
+
3
+ html {
4
+ font-family: var(--font-family-sans);
5
+ font-size: 16px;
6
+ line-height: var(--line-height-normal);
7
+ color: var(--color-text-primary);
8
+ background: var(--color-bg-primary);
9
+ }
10
+
11
+ body {
12
+ font-size: var(--font-size-base);
13
+ }
14
+
15
+ h1 {
16
+ font-size: var(--font-size-5xl);
17
+ font-weight: var(--font-weight-bold);
18
+ line-height: var(--line-height-tight);
19
+ letter-spacing: var(--letter-spacing-tight);
20
+ }
21
+
22
+ h2 {
23
+ font-size: var(--font-size-3xl);
24
+ font-weight: var(--font-weight-semibold);
25
+ line-height: var(--line-height-snug);
26
+ }
27
+
28
+ h3 {
29
+ font-size: var(--font-size-2xl);
30
+ font-weight: var(--font-weight-semibold);
31
+ line-height: var(--line-height-snug);
32
+ }
33
+
34
+ h4 {
35
+ font-size: var(--font-size-xl);
36
+ font-weight: var(--font-weight-semibold);
37
+ }
38
+
39
+ a {
40
+ color: var(--color-brand-primary);
41
+ text-decoration: underline;
42
+ text-underline-offset: 0.15em;
43
+ }
44
+
45
+ a:hover {
46
+ color: var(--color-brand-primary-hover);
47
+ }
48
+
49
+ code {
50
+ font-family: var(--font-family-mono);
51
+ font-size: 0.9em;
52
+ background: var(--color-bg-tertiary);
53
+ padding: 0.125em 0.25em;
54
+ border-radius: var(--radius-sm);
55
+ }
@@ -0,0 +1,48 @@
1
+ /* Minimal reset — based on modern-normalize with a few opinionated extras. */
2
+
3
+ *,
4
+ *::before,
5
+ *::after {
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ html {
10
+ -webkit-text-size-adjust: 100%;
11
+ -moz-tab-size: 4;
12
+ tab-size: 4;
13
+ }
14
+
15
+ body {
16
+ margin: 0;
17
+ }
18
+
19
+ p,
20
+ h1,
21
+ h2,
22
+ h3,
23
+ h4,
24
+ h5,
25
+ h6 {
26
+ margin: 0;
27
+ }
28
+
29
+ button,
30
+ input,
31
+ select,
32
+ textarea {
33
+ font: inherit;
34
+ color: inherit;
35
+ }
36
+
37
+ img,
38
+ svg,
39
+ video {
40
+ display: block;
41
+ max-width: 100%;
42
+ height: auto;
43
+ }
44
+
45
+ :focus-visible {
46
+ outline: 2px solid var(--color-brand-primary);
47
+ outline-offset: 2px;
48
+ }
@@ -0,0 +1,116 @@
1
+ /* Auto-generated by scripts/build-tokens-css.ts. Do not edit by hand. */
2
+
3
+ :root {
4
+ /* Colors */
5
+ --color-neutral-0: #FFFFFF;
6
+ --color-neutral-50: #FAFAFA;
7
+ --color-neutral-100: #F4F4F5;
8
+ --color-neutral-200: #E4E4E7;
9
+ --color-neutral-300: #D4D4D8;
10
+ --color-neutral-400: #A1A1AA;
11
+ --color-neutral-500: #71717A;
12
+ --color-neutral-600: #52525B;
13
+ --color-neutral-700: #3F3F46;
14
+ --color-neutral-800: #27272A;
15
+ --color-neutral-900: #18181B;
16
+ --color-neutral-1000: #000000;
17
+ --color-brand-primary: #2563EB;
18
+ --color-brand-primary-hover: #1D4ED8;
19
+ --color-brand-secondary: #0891B2;
20
+ --color-text-primary: #18181B;
21
+ --color-text-secondary: #52525B;
22
+ --color-text-muted: #71717A;
23
+ --color-text-inverse: #FFFFFF;
24
+ --color-bg-primary: #FFFFFF;
25
+ --color-bg-secondary: #FAFAFA;
26
+ --color-bg-tertiary: #F4F4F5;
27
+ --color-bg-inverse: #18181B;
28
+ --color-border-default: #E4E4E7;
29
+ --color-border-strong: #D4D4D8;
30
+ --color-state-success: #16A34A;
31
+ --color-state-warning: #CA8A04;
32
+ --color-state-error: #DC2626;
33
+ --color-state-info: #2563EB;
34
+
35
+ /* Typography */
36
+ --font-family-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
37
+ --font-family-mono: ui-monospace, "SF Mono", Monaco, Consolas, monospace;
38
+ --font-size-xs: 0.75rem;
39
+ --font-size-sm: 0.875rem;
40
+ --font-size-base: 1rem;
41
+ --font-size-lg: 1.125rem;
42
+ --font-size-xl: 1.25rem;
43
+ --font-size-2xl: 1.5rem;
44
+ --font-size-3xl: 1.875rem;
45
+ --font-size-4xl: 2.25rem;
46
+ --font-size-5xl: 3rem;
47
+ --font-size-6xl: 3.75rem;
48
+ --font-weight-normal: 400;
49
+ --font-weight-medium: 500;
50
+ --font-weight-semibold: 600;
51
+ --font-weight-bold: 700;
52
+ --line-height-tight: 1.15;
53
+ --line-height-snug: 1.3;
54
+ --line-height-normal: 1.5;
55
+ --line-height-relaxed: 1.65;
56
+ --line-height-loose: 1.8;
57
+ --letter-spacing-tight: -0.025em;
58
+ --letter-spacing-normal: 0;
59
+ --letter-spacing-wide: 0.025em;
60
+
61
+ /* Spacing */
62
+ --spacing-0: 0;
63
+ --spacing-px: 1px;
64
+ --spacing-0-5: 0.125rem;
65
+ --spacing-1: 0.25rem;
66
+ --spacing-2: 0.5rem;
67
+ --spacing-3: 0.75rem;
68
+ --spacing-4: 1rem;
69
+ --spacing-5: 1.25rem;
70
+ --spacing-6: 1.5rem;
71
+ --spacing-8: 2rem;
72
+ --spacing-10: 2.5rem;
73
+ --spacing-12: 3rem;
74
+ --spacing-16: 4rem;
75
+ --spacing-20: 5rem;
76
+ --spacing-24: 6rem;
77
+ --spacing-32: 8rem;
78
+ --spacing-40: 10rem;
79
+ --spacing-48: 12rem;
80
+ --spacing-section: 5rem;
81
+ --spacing-container: 1.5rem;
82
+
83
+ /* Radii */
84
+ --radius-none: 0;
85
+ --radius-sm: 0.25rem;
86
+ --radius-md: 0.375rem;
87
+ --radius-lg: 0.5rem;
88
+ --radius-xl: 0.75rem;
89
+ --radius-2xl: 1rem;
90
+ --radius-full: 9999px;
91
+
92
+ /* Layout & Containers */
93
+ --layout-container-sm: 40rem;
94
+ --layout-container-md: 64rem;
95
+ --layout-container-lg: 80rem;
96
+ --layout-gutter: 1.5rem;
97
+ --layout-margin: 1rem;
98
+ --layout-breakpoint-sm: 40rem;
99
+ --layout-breakpoint-md: 48rem;
100
+ --layout-breakpoint-lg: 64rem;
101
+ --layout-breakpoint-xl: 80rem;
102
+ }
103
+
104
+ @media (prefers-color-scheme: dark) {
105
+ :root {
106
+ --color-text-primary: #FAFAFA;
107
+ --color-text-secondary: #A1A1AA;
108
+ --color-text-muted: #71717A;
109
+ --color-bg-primary: #18181B;
110
+ --color-bg-secondary: #27272A;
111
+ --color-bg-tertiary: #3F3F46;
112
+ --color-bg-inverse: #FAFAFA;
113
+ --color-border-default: #3F3F46;
114
+ --color-border-strong: #52525B;
115
+ }
116
+ }
@@ -0,0 +1,54 @@
1
+ export const colors = {
2
+ 'color.neutral.0': '#FFFFFF',
3
+ 'color.neutral.50': '#FAFAFA',
4
+ 'color.neutral.100': '#F4F4F5',
5
+ 'color.neutral.200': '#E4E4E7',
6
+ 'color.neutral.300': '#D4D4D8',
7
+ 'color.neutral.400': '#A1A1AA',
8
+ 'color.neutral.500': '#71717A',
9
+ 'color.neutral.600': '#52525B',
10
+ 'color.neutral.700': '#3F3F46',
11
+ 'color.neutral.800': '#27272A',
12
+ 'color.neutral.900': '#18181B',
13
+ 'color.neutral.1000': '#000000',
14
+
15
+ 'color.brand.primary': '#2563EB',
16
+ 'color.brand.primaryHover': '#1D4ED8',
17
+ 'color.brand.secondary': '#0891B2',
18
+
19
+ 'color.text.primary': '#18181B',
20
+ 'color.text.secondary': '#52525B',
21
+ 'color.text.muted': '#71717A',
22
+ 'color.text.inverse': '#FFFFFF',
23
+
24
+ 'color.bg.primary': '#FFFFFF',
25
+ 'color.bg.secondary': '#FAFAFA',
26
+ 'color.bg.tertiary': '#F4F4F5',
27
+ 'color.bg.inverse': '#18181B',
28
+
29
+ 'color.border.default': '#E4E4E7',
30
+ 'color.border.strong': '#D4D4D8',
31
+
32
+ 'color.state.success': '#16A34A',
33
+ 'color.state.warning': '#CA8A04',
34
+ 'color.state.error': '#DC2626',
35
+ 'color.state.info': '#2563EB',
36
+ } as const
37
+
38
+ /**
39
+ * Tokens that swap under `prefers-color-scheme: dark`. Keys match the base
40
+ * palette; values replace the light defaults when the media query applies.
41
+ */
42
+ export const darkOverrides = {
43
+ 'color.text.primary': '#FAFAFA',
44
+ 'color.text.secondary': '#A1A1AA',
45
+ 'color.text.muted': '#71717A',
46
+ 'color.bg.primary': '#18181B',
47
+ 'color.bg.secondary': '#27272A',
48
+ 'color.bg.tertiary': '#3F3F46',
49
+ 'color.bg.inverse': '#FAFAFA',
50
+ 'color.border.default': '#3F3F46',
51
+ 'color.border.strong': '#52525B',
52
+ } as const
53
+
54
+ export type ColorToken = keyof typeof colors
@@ -0,0 +1,32 @@
1
+ import { colors, darkOverrides } from './colors.js'
2
+ import { typography } from './typography.js'
3
+ import { spacing } from './spacing.js'
4
+ import { radii } from './radii.js'
5
+ import { layout } from './layout.js'
6
+
7
+ export { colors, darkOverrides, typography, spacing, radii, layout }
8
+ export type { ColorToken } from './colors.js'
9
+ export type { TypographyToken } from './typography.js'
10
+ export type { SpacingToken } from './spacing.js'
11
+ export type { RadiusToken } from './radii.js'
12
+ export type { LayoutToken } from './layout.js'
13
+
14
+ export const allTokens = {
15
+ ...colors,
16
+ ...typography,
17
+ ...spacing,
18
+ ...radii,
19
+ ...layout,
20
+ } as const
21
+
22
+ export type TokenName = keyof typeof allTokens
23
+
24
+ /** Returns every token in the shape the design-contract manifest expects. */
25
+ export function getTokenList() {
26
+ const categorize = (name: string) => name.split('.')[0] ?? 'other'
27
+ return Object.entries(allTokens).map(([name, value]) => ({
28
+ name,
29
+ value,
30
+ category: categorize(name),
31
+ }))
32
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Layout & container tokens: the max-widths a page constrains to, the
3
+ * horizontal gutter/margins, and the responsive breakpoints. These are the
4
+ * values the "Layout & Containers" foundation documents. Brand projects
5
+ * override them (e.g. Forum One uses constrain 800/1440/2200, gutter 40,
6
+ * breakpoints 320–1400); the reference DS ships neutral defaults.
7
+ */
8
+ export const layout = {
9
+ /** Container max-widths the page content constrains to. */
10
+ 'layout.container.sm': '40rem', // 640px — narrow prose
11
+ 'layout.container.md': '64rem', // 1024px — default content width
12
+ 'layout.container.lg': '80rem', // 1280px — wide / full-bleed sections
13
+
14
+ /** Horizontal gutter between grid columns. */
15
+ 'layout.gutter': '1.5rem', // 24px
16
+ /** Page side margins (inside the viewport, outside the container). */
17
+ 'layout.margin': '1rem', // 16px
18
+
19
+ /** Responsive breakpoints (min-width). */
20
+ 'layout.breakpoint.sm': '40rem', // 640px
21
+ 'layout.breakpoint.md': '48rem', // 768px
22
+ 'layout.breakpoint.lg': '64rem', // 1024px
23
+ 'layout.breakpoint.xl': '80rem', // 1280px
24
+ } as const
25
+
26
+ export type LayoutToken = keyof typeof layout
@@ -0,0 +1,11 @@
1
+ export const radii = {
2
+ 'radius.none': '0',
3
+ 'radius.sm': '0.25rem',
4
+ 'radius.md': '0.375rem',
5
+ 'radius.lg': '0.5rem',
6
+ 'radius.xl': '0.75rem',
7
+ 'radius.2xl': '1rem',
8
+ 'radius.full': '9999px',
9
+ } as const
10
+
11
+ export type RadiusToken = keyof typeof radii
@@ -0,0 +1,26 @@
1
+ export const spacing = {
2
+ 'spacing.0': '0',
3
+ 'spacing.px': '1px',
4
+ 'spacing.0.5': '0.125rem',
5
+ 'spacing.1': '0.25rem',
6
+ 'spacing.2': '0.5rem',
7
+ 'spacing.3': '0.75rem',
8
+ 'spacing.4': '1rem',
9
+ 'spacing.5': '1.25rem',
10
+ 'spacing.6': '1.5rem',
11
+ 'spacing.8': '2rem',
12
+ 'spacing.10': '2.5rem',
13
+ 'spacing.12': '3rem',
14
+ 'spacing.16': '4rem',
15
+ 'spacing.20': '5rem',
16
+ 'spacing.24': '6rem',
17
+ 'spacing.32': '8rem',
18
+ 'spacing.40': '10rem',
19
+ 'spacing.48': '12rem',
20
+ /** Semantic: default vertical padding inside a page section. */
21
+ 'spacing.section': '5rem',
22
+ /** Semantic: horizontal gutter inside the page container. */
23
+ 'spacing.container': '1.5rem',
24
+ } as const
25
+
26
+ export type SpacingToken = keyof typeof spacing
@@ -0,0 +1,32 @@
1
+ export const typography = {
2
+ 'font.family.sans': 'Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif',
3
+ 'font.family.mono': 'ui-monospace, "SF Mono", Monaco, Consolas, monospace',
4
+
5
+ 'font.size.xs': '0.75rem',
6
+ 'font.size.sm': '0.875rem',
7
+ 'font.size.base': '1rem',
8
+ 'font.size.lg': '1.125rem',
9
+ 'font.size.xl': '1.25rem',
10
+ 'font.size.2xl': '1.5rem',
11
+ 'font.size.3xl': '1.875rem',
12
+ 'font.size.4xl': '2.25rem',
13
+ 'font.size.5xl': '3rem',
14
+ 'font.size.6xl': '3.75rem',
15
+
16
+ 'font.weight.normal': '400',
17
+ 'font.weight.medium': '500',
18
+ 'font.weight.semibold': '600',
19
+ 'font.weight.bold': '700',
20
+
21
+ 'line.height.tight': '1.15',
22
+ 'line.height.snug': '1.3',
23
+ 'line.height.normal': '1.5',
24
+ 'line.height.relaxed': '1.65',
25
+ 'line.height.loose': '1.8',
26
+
27
+ 'letter.spacing.tight': '-0.025em',
28
+ 'letter.spacing.normal': '0',
29
+ 'letter.spacing.wide': '0.025em',
30
+ } as const
31
+
32
+ export type TypographyToken = keyof typeof typography
@@ -0,0 +1,24 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "composite": true,
5
+ "declaration": true,
6
+ "declarationMap": true,
7
+ "sourceMap": true,
8
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
9
+ "jsx": "react-jsx",
10
+ "rootDir": "./src",
11
+ "outDir": "./dist",
12
+ "resolveJsonModule": true
13
+ },
14
+ "include": ["src/**/*"],
15
+ "exclude": [
16
+ "dist",
17
+ "storybook-static",
18
+ "node_modules",
19
+ "**/*.test.ts",
20
+ "**/*.test.tsx",
21
+ "**/*.stories.ts",
22
+ "**/*.stories.tsx"
23
+ ]
24
+ }
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from 'vitest/config'
2
+ import react from '@vitejs/plugin-react'
3
+
4
+ export default defineConfig({
5
+ plugins: [react()],
6
+ test: {
7
+ environment: 'jsdom',
8
+ setupFiles: ['./vitest.setup.ts'],
9
+ include: ['src/**/*.test.{ts,tsx}'],
10
+ passWithNoTests: true,
11
+ css: {
12
+ modules: { classNameStrategy: 'non-scoped' },
13
+ },
14
+ },
15
+ })
@@ -0,0 +1,7 @@
1
+ import '@testing-library/jest-dom/vitest'
2
+ import { cleanup } from '@testing-library/react'
3
+ import { afterEach } from 'vitest'
4
+
5
+ afterEach(() => {
6
+ cleanup()
7
+ })
@@ -0,0 +1,21 @@
1
+ import type { StorybookConfig } from '@storybook/react-vite'
2
+
3
+ const config: StorybookConfig = {
4
+ stories: [
5
+ '../src/foundations/**/*.stories.@(ts|tsx)',
6
+ '../src/components/**/*.stories.@(ts|tsx)',
7
+ ],
8
+ addons: ['@storybook/addon-a11y'],
9
+ framework: {
10
+ name: '@storybook/react-vite',
11
+ options: {},
12
+ },
13
+ typescript: {
14
+ reactDocgen: 'react-docgen-typescript',
15
+ },
16
+ docs: {
17
+ autodocs: true,
18
+ },
19
+ }
20
+
21
+ export default config
@@ -0,0 +1,16 @@
1
+ import type { Preview } from '@storybook/react-vite'
2
+
3
+ const preview: Preview = {
4
+ parameters: {
5
+ controls: {
6
+ matchers: { color: /(background|color)$/i, date: /Date$/i },
7
+ },
8
+ a11y: {
9
+ config: {},
10
+ options: {},
11
+ manual: false,
12
+ },
13
+ },
14
+ }
15
+
16
+ export default preview
@@ -0,0 +1,20 @@
1
+ # Design system
2
+
3
+ An empty Storybook authoring environment for your own design system. Bring your components here.
4
+
5
+ ```
6
+ src/
7
+ components/ One folder per component: .tsx, .module.css, .stories.tsx, .contract.ts
8
+ foundations/ Storybook "Foundations" pages documenting your tokens
9
+ .storybook/ Storybook (react-vite) config
10
+ ```
11
+
12
+ ## Commands
13
+
14
+ ```bash
15
+ pnpm --filter "./design-system" storybook # author at http://localhost:6006
16
+ pnpm --filter "./design-system" build-storybook # static Storybook
17
+ pnpm --filter "./design-system" typecheck
18
+ ```
19
+
20
+ Point the Components MCP server at your manifest in `apps/web/src/payload.config.ts` (`componentsPlugin({ manifest })`) once you generate one. For a worked starting point, re-scaffold with the reference design system.
@@ -0,0 +1,5 @@
1
+ dist
2
+ storybook-static
3
+ node_modules
4
+ *.tsbuildinfo
5
+ .turbo
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "{{designSystemName}}",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "main": "./src/index.ts",
7
+ "types": "./src/index.ts",
8
+ "exports": {
9
+ ".": "./src/index.ts"
10
+ },
11
+ "scripts": {
12
+ "storybook": "storybook dev -p 6006",
13
+ "build-storybook": "storybook build",
14
+ "typecheck": "tsc --noEmit",
15
+ "clean": "rm -rf dist .turbo storybook-static *.tsbuildinfo"
16
+ },
17
+ "peerDependencies": {
18
+ "react": "^18.0.0 || ^19.0.0",
19
+ "react-dom": "^18.0.0 || ^19.0.0"
20
+ },
21
+ "devDependencies": {
22
+ "@storybook/addon-a11y": "^10.3.5",
23
+ "@storybook/react-vite": "^10.3.5",
24
+ "@types/react": "^19.2.0",
25
+ "@types/react-dom": "^19.2.0",
26
+ "@vitejs/plugin-react": "^6.0.1",
27
+ "react": "^19.2.0",
28
+ "react-dom": "^19.2.0",
29
+ "storybook": "^10.3.5",
30
+ "typescript": "^5.6.0",
31
+ "vite": "^8.0.9"
32
+ }
33
+ }