@contractspec/bundle.marketing 3.7.6 → 3.8.2

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 (164) hide show
  1. package/.turbo/turbo-build.log +87 -87
  2. package/AGENTS.md +29 -21
  3. package/CHANGELOG.md +59 -0
  4. package/README.md +36 -49
  5. package/dist/browser/components/marketing/ChangelogPage.js +8 -8
  6. package/dist/browser/components/marketing/CofounderPage.js +167 -523
  7. package/dist/browser/components/marketing/ContactClient.js +200 -207
  8. package/dist/browser/components/marketing/ContributePage.js +211 -463
  9. package/dist/browser/components/marketing/DesignPartnerPage.js +165 -218
  10. package/dist/browser/components/marketing/LandingPage.js +464 -568
  11. package/dist/browser/components/marketing/PricingClient.js +213 -839
  12. package/dist/browser/components/marketing/ProductClientPage.js +265 -463
  13. package/dist/browser/components/marketing/index.js +2007 -3338
  14. package/dist/browser/components/marketing/pricing-thinking-modal.js +12 -12
  15. package/dist/browser/components/marketing/sections/AudienceSection.js +2 -2
  16. package/dist/browser/components/marketing/sections/CorePositioningSection.js +2 -2
  17. package/dist/browser/components/marketing/sections/CtaSection.js +3 -3
  18. package/dist/browser/components/marketing/sections/FearsSection.js +3 -3
  19. package/dist/browser/components/marketing/sections/HeroMarketingSection.js +6 -6
  20. package/dist/browser/components/marketing/sections/IconGridSection.js +2 -2
  21. package/dist/browser/components/marketing/sections/OutputsSection.js +2 -2
  22. package/dist/browser/components/marketing/sections/ProblemSection.js +2 -2
  23. package/dist/browser/components/marketing/sections/SolutionSection.js +2 -2
  24. package/dist/browser/components/marketing/sections/StepsSection.js +4 -4
  25. package/dist/browser/components/marketing/studio-signup-section.js +25 -41
  26. package/dist/browser/components/templates/TemplatesClientPage.js +2374 -3571
  27. package/dist/browser/components/templates/TemplatesPage.js +1 -1
  28. package/dist/browser/components/templates/TemplatesPreviewModal.js +27 -3
  29. package/dist/browser/components/templates/index.js +2412 -3609
  30. package/dist/browser/index.js +2415 -3612
  31. package/dist/browser/libs/email/client.js +1 -1
  32. package/dist/browser/libs/email/contact.js +1 -1
  33. package/dist/browser/libs/email/newsletter.js +1 -1
  34. package/dist/browser/libs/email/waitlist-application.js +1 -1
  35. package/dist/browser/libs/email/waitlist.js +1 -1
  36. package/dist/browser/registry/engine.js +2003 -3334
  37. package/dist/browser/registry/index.js +2003 -3334
  38. package/dist/browser/registry/registry-docs.js +2 -2
  39. package/dist/browser/registry/registry-landing.js +2007 -3338
  40. package/dist/browser/registry/registry.js +2003 -3334
  41. package/dist/browser/registry/utils.js +2003 -3334
  42. package/dist/components/marketing/ChangelogPage.js +8 -8
  43. package/dist/components/marketing/CofounderPage.js +167 -523
  44. package/dist/components/marketing/ContactClient.js +200 -207
  45. package/dist/components/marketing/ContributePage.d.ts +0 -2
  46. package/dist/components/marketing/ContributePage.js +211 -463
  47. package/dist/components/marketing/DesignPartnerPage.js +165 -218
  48. package/dist/components/marketing/LandingPage.js +464 -568
  49. package/dist/components/marketing/PricingClient.js +213 -839
  50. package/dist/components/marketing/ProductClientPage.js +265 -463
  51. package/dist/components/marketing/index.d.ts +5 -5
  52. package/dist/components/marketing/index.js +2007 -3338
  53. package/dist/components/marketing/pricing-thinking-modal.js +12 -12
  54. package/dist/components/marketing/sections/AudienceSection.js +2 -2
  55. package/dist/components/marketing/sections/CorePositioningSection.js +2 -2
  56. package/dist/components/marketing/sections/CtaSection.js +3 -3
  57. package/dist/components/marketing/sections/FearsSection.js +3 -3
  58. package/dist/components/marketing/sections/HeroMarketingSection.js +6 -6
  59. package/dist/components/marketing/sections/IconGridSection.d.ts +3 -3
  60. package/dist/components/marketing/sections/IconGridSection.js +2 -2
  61. package/dist/components/marketing/sections/OutputsSection.js +2 -2
  62. package/dist/components/marketing/sections/ProblemSection.js +2 -2
  63. package/dist/components/marketing/sections/SolutionSection.js +2 -2
  64. package/dist/components/marketing/sections/StepsSection.js +4 -4
  65. package/dist/components/marketing/studio-signup-section.js +25 -41
  66. package/dist/components/templates/TemplatesClientPage.js +2374 -3571
  67. package/dist/components/templates/TemplatesPage.js +1 -1
  68. package/dist/components/templates/TemplatesPreviewModal.js +27 -3
  69. package/dist/components/templates/index.js +2412 -3609
  70. package/dist/index.js +2415 -3612
  71. package/dist/libs/email/client.js +1 -1
  72. package/dist/libs/email/contact.js +1 -1
  73. package/dist/libs/email/newsletter.js +1 -1
  74. package/dist/libs/email/waitlist-application.js +1 -1
  75. package/dist/libs/email/waitlist.js +1 -1
  76. package/dist/node/components/marketing/ChangelogPage.js +8 -8
  77. package/dist/node/components/marketing/CofounderPage.js +167 -523
  78. package/dist/node/components/marketing/ContactClient.js +200 -207
  79. package/dist/node/components/marketing/ContributePage.js +211 -463
  80. package/dist/node/components/marketing/DesignPartnerPage.js +165 -218
  81. package/dist/node/components/marketing/LandingPage.js +464 -568
  82. package/dist/node/components/marketing/PricingClient.js +213 -839
  83. package/dist/node/components/marketing/ProductClientPage.js +265 -463
  84. package/dist/node/components/marketing/index.js +2007 -3338
  85. package/dist/node/components/marketing/pricing-thinking-modal.js +12 -12
  86. package/dist/node/components/marketing/sections/AudienceSection.js +2 -2
  87. package/dist/node/components/marketing/sections/CorePositioningSection.js +2 -2
  88. package/dist/node/components/marketing/sections/CtaSection.js +3 -3
  89. package/dist/node/components/marketing/sections/FearsSection.js +3 -3
  90. package/dist/node/components/marketing/sections/HeroMarketingSection.js +6 -6
  91. package/dist/node/components/marketing/sections/IconGridSection.js +2 -2
  92. package/dist/node/components/marketing/sections/OutputsSection.js +2 -2
  93. package/dist/node/components/marketing/sections/ProblemSection.js +2 -2
  94. package/dist/node/components/marketing/sections/SolutionSection.js +2 -2
  95. package/dist/node/components/marketing/sections/StepsSection.js +4 -4
  96. package/dist/node/components/marketing/studio-signup-section.js +25 -41
  97. package/dist/node/components/templates/TemplatesClientPage.js +2374 -3571
  98. package/dist/node/components/templates/TemplatesPage.js +1 -1
  99. package/dist/node/components/templates/TemplatesPreviewModal.js +27 -3
  100. package/dist/node/components/templates/index.js +2412 -3609
  101. package/dist/node/index.js +2415 -3612
  102. package/dist/node/libs/email/client.js +1 -1
  103. package/dist/node/libs/email/contact.js +1 -1
  104. package/dist/node/libs/email/newsletter.js +1 -1
  105. package/dist/node/libs/email/waitlist-application.js +1 -1
  106. package/dist/node/libs/email/waitlist.js +1 -1
  107. package/dist/node/registry/engine.js +2003 -3334
  108. package/dist/node/registry/index.js +2003 -3334
  109. package/dist/node/registry/registry-docs.js +2 -2
  110. package/dist/node/registry/registry-landing.js +2007 -3338
  111. package/dist/node/registry/registry.js +2003 -3334
  112. package/dist/node/registry/utils.js +2003 -3334
  113. package/dist/registry/engine.js +2003 -3334
  114. package/dist/registry/index.js +2003 -3334
  115. package/dist/registry/registry-docs.js +2 -2
  116. package/dist/registry/registry-landing.js +2007 -3338
  117. package/dist/registry/registry.js +2003 -3334
  118. package/dist/registry/utils.js +2003 -3334
  119. package/package.json +31 -29
  120. package/src/bundles/MarketingBundle.ts +273 -273
  121. package/src/components/marketing/ChangelogPage.tsx +72 -100
  122. package/src/components/marketing/CofounderPage.tsx +120 -384
  123. package/src/components/marketing/ContactClient.tsx +164 -154
  124. package/src/components/marketing/ContributePage.tsx +139 -313
  125. package/src/components/marketing/DesignPartnerPage.tsx +133 -171
  126. package/src/components/marketing/LandingPage.tsx +353 -25
  127. package/src/components/marketing/PricingClient.tsx +192 -437
  128. package/src/components/marketing/ProductClientPage.tsx +255 -377
  129. package/src/components/marketing/index.ts +5 -5
  130. package/src/components/marketing/pricing-thinking-modal.tsx +197 -197
  131. package/src/components/marketing/sections/AudienceSection.tsx +55 -56
  132. package/src/components/marketing/sections/CorePositioningSection.tsx +37 -37
  133. package/src/components/marketing/sections/CtaSection.tsx +49 -50
  134. package/src/components/marketing/sections/DevelopersSection.tsx +26 -27
  135. package/src/components/marketing/sections/FearsSection.tsx +36 -37
  136. package/src/components/marketing/sections/HeroMarketingSection.tsx +59 -59
  137. package/src/components/marketing/sections/IconGridSection.tsx +71 -71
  138. package/src/components/marketing/sections/OutputsSection.tsx +51 -52
  139. package/src/components/marketing/sections/ProblemSection.tsx +39 -40
  140. package/src/components/marketing/sections/SolutionSection.tsx +39 -40
  141. package/src/components/marketing/sections/StepsSection.tsx +47 -48
  142. package/src/components/marketing/studio-signup-section.tsx +39 -41
  143. package/src/components/templates/TemplatesClientPage.tsx +763 -685
  144. package/src/components/templates/TemplatesPage.tsx +110 -110
  145. package/src/components/templates/TemplatesPreviewModal.tsx +251 -198
  146. package/src/index.ts +4 -4
  147. package/src/libs/email/client.test.ts +81 -81
  148. package/src/libs/email/client.ts +111 -111
  149. package/src/libs/email/contact.ts +35 -35
  150. package/src/libs/email/newsletter.ts +46 -46
  151. package/src/libs/email/types.ts +29 -29
  152. package/src/libs/email/utils.ts +5 -5
  153. package/src/libs/email/waitlist-application.ts +72 -72
  154. package/src/libs/email/waitlist.ts +46 -46
  155. package/src/libs/pricing-examples.ts +12 -12
  156. package/src/registry/engine.ts +16 -16
  157. package/src/registry/factory.ts +57 -57
  158. package/src/registry/registry-docs.ts +656 -666
  159. package/src/registry/registry-landing.ts +94 -95
  160. package/src/registry/registry.ts +36 -37
  161. package/src/registry/types.ts +2 -2
  162. package/src/registry/utils.ts +56 -56
  163. package/tsconfig.json +11 -11
  164. package/tsdown.config.js +5 -5
@@ -1,714 +1,792 @@
1
1
  'use client';
2
2
 
3
- import { useState } from 'react';
4
- import { Search } from 'lucide-react';
5
- import { cn } from '@contractspec/lib.ui-kit-core/utils';
6
- import Link from 'next/link';
3
+ import {
4
+ analyticsEventNames,
5
+ captureAnalyticsEvent,
6
+ } from '@contractspec/bundle.library/libs/posthog/client';
7
7
  import type {
8
- RegistryTemplate,
9
- TemplateId,
8
+ RegistryTemplate,
9
+ TemplateId,
10
10
  } from '@contractspec/lib.example-shared-ui';
11
11
  import { useRegistryTemplates } from '@contractspec/lib.example-shared-ui';
12
- import { getTemplate } from '@contractspec/module.examples';
13
- import {
14
- Tooltip,
15
- TooltipContent,
16
- TooltipProvider,
17
- TooltipTrigger,
18
- } from '@contractspec/lib.ui-kit-web/ui/tooltip';
19
- import {
20
- analyticsEventNames,
21
- captureAnalyticsEvent,
22
- } from '@contractspec/bundle.library/libs/posthog/client';
12
+ import { cn } from '@contractspec/lib.ui-kit-core/utils';
23
13
  import {
24
- Dialog,
25
- DialogContent,
26
- DialogDescription,
27
- DialogHeader,
28
- DialogTitle,
14
+ Dialog,
15
+ DialogContent,
16
+ DialogDescription,
17
+ DialogHeader,
18
+ DialogTitle,
29
19
  } from '@contractspec/lib.ui-kit-web/ui/dialog';
20
+ import {
21
+ Tooltip,
22
+ TooltipContent,
23
+ TooltipProvider,
24
+ TooltipTrigger,
25
+ } from '@contractspec/lib.ui-kit-web/ui/tooltip';
26
+ import { getTemplate } from '@contractspec/module.examples';
27
+ import { Search } from 'lucide-react';
28
+ import Link from 'next/link';
29
+ import { useState } from 'react';
30
30
  import { StudioSignupSection } from '../marketing';
31
31
  import { TemplatePreviewModal } from './TemplatesPreviewModal';
32
32
 
33
33
  const templates = [
34
- {
35
- id: 'minimal-example',
36
- templateId: 'todos-app' as TemplateId,
37
- title: 'Minimal Example',
38
- description:
39
- 'A minimal template to get you running in minutes. Perfect for exploring the engine.',
40
- tags: ['Getting Started'],
41
- capabilities: 'Basic Forms, Auth',
42
- isStarter: true,
43
- previewUrl: '/sandbox?template=minimal-example',
44
- docsUrl: '/docs/getting-started/hello-world',
45
- },
46
- // ============================================
47
- // Phase 1 Examples (using cross-cutting modules)
48
- // ============================================
49
- {
50
- id: 'saas-boilerplate',
51
- templateId: 'saas-boilerplate' as TemplateId,
52
- title: 'SaaS Boilerplate',
53
- description:
54
- 'Complete SaaS foundation with multi-tenant orgs, projects, settings, and billing usage.',
55
- tags: ['Getting Started', 'SaaS', 'Business'],
56
- capabilities: 'Multi-tenancy, RBAC, Projects, Billing',
57
- isNew: true,
58
- previewUrl: '/sandbox?template=saas-boilerplate',
59
- docsUrl: '/docs/templates/saas-boilerplate',
60
- },
61
- {
62
- id: 'crm-pipeline',
63
- templateId: 'crm-pipeline' as TemplateId,
64
- title: 'CRM Pipeline',
65
- description:
66
- 'Sales CRM with contacts, companies, deals, pipeline stages, and task management.',
67
- tags: ['CRM', 'Business'],
68
- capabilities: 'Contacts, Deals, Pipelines, Tasks',
69
- isNew: true,
70
- previewUrl: '/sandbox?template=crm-pipeline',
71
- docsUrl: '/docs/templates/crm-pipeline',
72
- },
73
- {
74
- id: 'agent-console',
75
- templateId: 'agent-console' as TemplateId,
76
- title: 'AI Agent Console',
77
- description:
78
- 'AI agent orchestration platform with tools, agents, runs, and execution logs.',
79
- tags: ['AI', 'Ops'],
80
- capabilities: 'Tools, Agents, Runs, Metrics',
81
- isNew: true,
82
- previewUrl: '/sandbox?template=agent-console',
83
- docsUrl: '/docs/templates/agent-console',
84
- },
85
- // ============================================
86
- // Phase 2-4 Examples
87
- // ============================================
88
- {
89
- id: 'workflow-system',
90
- templateId: 'workflow-system' as TemplateId,
91
- title: 'Workflow / Approval System',
92
- description:
93
- 'Multi-step workflows with role-based approvals and state transitions.',
94
- tags: ['Business', 'Ops'],
95
- capabilities: 'Workflows, Approvals, State Machine',
96
- isNew: true,
97
- previewUrl: '/sandbox?template=workflow-system',
98
- docsUrl: '/docs/templates/workflow-system',
99
- },
100
- {
101
- id: 'marketplace',
102
- templateId: 'marketplace' as TemplateId,
103
- title: 'Marketplace',
104
- description:
105
- 'Two-sided marketplace with stores, products, orders, and payouts.',
106
- tags: ['Business', 'Payments'],
107
- capabilities: 'Stores, Products, Orders, Payouts',
108
- isNew: true,
109
- previewUrl: '/sandbox?template=marketplace',
110
- docsUrl: '/docs/templates/marketplace',
111
- },
112
- {
113
- id: 'integration-hub',
114
- templateId: 'integration-hub' as TemplateId,
115
- title: 'Integration Hub',
116
- description:
117
- 'Third-party integrations with connections, sync configs, and field mapping.',
118
- tags: ['Ops', 'AI'],
119
- capabilities: 'Integrations, Connections, Sync',
120
- isNew: true,
121
- previewUrl: '/sandbox?template=integration-hub',
122
- docsUrl: '/docs/templates/integration-hub',
123
- },
124
- // ============================================
125
- // Learning Journeys
126
- // ============================================
127
- {
128
- id: 'learning-journey-studio-onboarding',
129
- templateId: 'learning-journey-studio-onboarding' as TemplateId,
130
- title: 'Learning Journey — Studio Getting Started',
131
- description:
132
- 'First 30 minutes in Studio: choose template, edit spec, regenerate, playground, evolution.',
133
- tags: ['Learning', 'Onboarding'],
134
- capabilities: 'Spec-first onboarding, XP/streak, progress widget',
135
- isNew: true,
136
- previewUrl: '/sandbox?template=learning-journey-studio-onboarding',
137
- docsUrl: '/docs/templates/learning-journey-studio-onboarding',
138
- },
139
- {
140
- id: 'learning-journey-platform-tour',
141
- templateId: 'learning-journey-platform-tour' as TemplateId,
142
- title: 'Learning Journey — Platform Primitives Tour',
143
- description:
144
- 'Touch identity, audit, notifications, jobs, flags, files, metering once with guided steps.',
145
- tags: ['Learning', 'Platform'],
146
- capabilities: 'Cross-module tour with event-driven completion',
147
- isNew: true,
148
- previewUrl: '/sandbox?template=learning-journey-platform-tour',
149
- docsUrl: '/docs/templates/learning-journey-platform-tour',
150
- },
151
- {
152
- id: 'learning-journey-crm-onboarding',
153
- templateId: 'learning-journey-crm-onboarding' as TemplateId,
154
- title: 'Learning Journey — CRM First Win',
155
- description:
156
- 'Get to first closed-won deal: pipeline, contact/company, deal, stages, follow-up.',
157
- tags: ['Learning', 'CRM'],
158
- capabilities: 'CRM onboarding with XP/streak/badge',
159
- isNew: true,
160
- previewUrl: '/sandbox?template=learning-journey-crm-onboarding',
161
- docsUrl: '/docs/templates/learning-journey-crm-onboarding',
162
- },
163
- {
164
- id: 'analytics-dashboard',
165
- templateId: 'analytics-dashboard' as TemplateId,
166
- title: 'Analytics Dashboard',
167
- description:
168
- 'Custom dashboards with widgets, saved queries, and real-time visualization.',
169
- tags: ['Business', 'Ops'],
170
- capabilities: 'Dashboards, Widgets, Queries',
171
- isNew: true,
172
- previewUrl: '/sandbox?template=analytics-dashboard',
173
- docsUrl: '/docs/templates/analytics-dashboard',
174
- },
175
- // ============================================
176
- // Classic Templates
177
- // ============================================
178
- {
179
- id: 'plumber-ops',
180
- templateId: 'messaging-app' as TemplateId,
181
- title: 'Plumber Ops',
182
- description:
183
- 'Complete workflow: Quotes → Deposit → Job → Invoice → Payment. Policy-enforced approvals.',
184
- tags: ['Trades', 'Payments'],
185
- capabilities: 'Quotes, Jobs, Invoicing, Payments',
186
- previewUrl: '/sandbox?template=plumber-ops',
187
- docsUrl: '/docs/specs/workflows',
188
- },
189
- {
190
- id: 'coliving-management',
191
- templateId: 'recipe-app-i18n' as TemplateId,
192
- title: 'Coliving Management',
193
- description:
194
- 'Coliving management: Onboarding, chores, shared wallet. Multi-party approvals built-in.',
195
- tags: ['Coliving', 'Finance'],
196
- capabilities: 'Tasks, Approvals, Payments',
197
- previewUrl: '/sandbox?template=coliving-management',
198
- docsUrl: '/docs/specs/workflows',
199
- },
200
- {
201
- id: 'chores-allowance',
202
- templateId: 'todos-app' as TemplateId,
203
- title: 'Chores & Allowance',
204
- description:
205
- 'Family task management with approval workflows. Teach financial accountability safely.',
206
- tags: ['Family', 'Ops'],
207
- capabilities: 'Tasks, Approvals, Notifications',
208
- previewUrl: '/sandbox?template=chores-allowance',
209
- docsUrl: '/docs/specs/workflows',
210
- },
211
- {
212
- id: 'service-dispatch',
213
- templateId: 'messaging-app' as TemplateId,
214
- title: 'Service Dispatch',
215
- description:
216
- 'Field service scheduling, routing, and invoicing. Real-time coordination with policy gates.',
217
- tags: ['Ops', 'Trades'],
218
- capabilities: 'Scheduling, Maps, Invoicing',
219
- previewUrl: '/sandbox?template=service-dispatch',
220
- docsUrl: '/docs/specs/workflows',
221
- },
222
- {
223
- id: 'content-review',
224
- templateId: 'todos-app' as TemplateId,
225
- title: 'Content Review',
226
- description:
227
- 'Multi-stage approval workflow for content. Audit trail for every decision.',
228
- tags: ['Ops'],
229
- capabilities: 'Workflows, Approvals, Comments',
230
- previewUrl: '/sandbox?template=content-review',
231
- docsUrl: '/docs/specs/workflows',
232
- },
34
+ {
35
+ id: 'minimal-example',
36
+ templateId: 'todos-app' as TemplateId,
37
+ title: 'Minimal Example',
38
+ description:
39
+ 'A minimal template to get you running in minutes. Perfect for exploring the engine.',
40
+ tags: ['Getting Started'],
41
+ capabilities: 'Basic Forms, Auth',
42
+ isStarter: true,
43
+ previewUrl: '/sandbox?template=minimal-example',
44
+ docsUrl: '/docs/getting-started/hello-world',
45
+ },
46
+ // ============================================
47
+ // Phase 1 Examples (using cross-cutting modules)
48
+ // ============================================
49
+ {
50
+ id: 'saas-boilerplate',
51
+ templateId: 'saas-boilerplate' as TemplateId,
52
+ title: 'SaaS Boilerplate',
53
+ description:
54
+ 'Complete SaaS foundation with multi-tenant orgs, projects, settings, and billing usage.',
55
+ tags: ['Getting Started', 'SaaS', 'Business'],
56
+ capabilities: 'Multi-tenancy, RBAC, Projects, Billing',
57
+ isNew: true,
58
+ previewUrl: '/sandbox?template=saas-boilerplate',
59
+ docsUrl: '/docs/templates/saas-boilerplate',
60
+ },
61
+ {
62
+ id: 'crm-pipeline',
63
+ templateId: 'crm-pipeline' as TemplateId,
64
+ title: 'CRM Pipeline',
65
+ description:
66
+ 'Sales CRM with contacts, companies, deals, pipeline stages, and task management.',
67
+ tags: ['CRM', 'Business'],
68
+ capabilities: 'Contacts, Deals, Pipelines, Tasks',
69
+ isNew: true,
70
+ previewUrl: '/sandbox?template=crm-pipeline',
71
+ docsUrl: '/docs/templates/crm-pipeline',
72
+ },
73
+ {
74
+ id: 'data-grid-showcase',
75
+ templateId: 'data-grid-showcase' as TemplateId,
76
+ title: 'Data Grid Showcase',
77
+ description:
78
+ 'Focused example for ContractSpec headless tables across client, server, and DataView-driven lanes.',
79
+ tags: ['Ops', 'Business'],
80
+ capabilities: 'Tables, Sorting, Pagination, Column Controls',
81
+ isNew: true,
82
+ previewUrl: '/sandbox?template=data-grid-showcase',
83
+ docsUrl: '/docs/examples/data-grid-showcase',
84
+ },
85
+ {
86
+ id: 'visualization-showcase',
87
+ templateId: 'visualization-showcase' as TemplateId,
88
+ title: 'Visualization Showcase',
89
+ description:
90
+ 'Canonical ContractSpec example for chart primitives, shared visualization contracts, and opinionated dashboard blocks.',
91
+ tags: ['Ops', 'Visualization'],
92
+ capabilities: 'Metrics, Charts, Timelines, Comparisons',
93
+ isNew: true,
94
+ previewUrl: '/sandbox?template=visualization-showcase',
95
+ docsUrl: '/docs/examples/visualization-showcase',
96
+ },
97
+ {
98
+ id: 'agent-console',
99
+ templateId: 'agent-console' as TemplateId,
100
+ title: 'AI Agent Console',
101
+ description:
102
+ 'AI agent orchestration platform with tools, agents, runs, and execution logs.',
103
+ tags: ['AI', 'Ops'],
104
+ capabilities: 'Tools, Agents, Runs, Metrics',
105
+ isNew: true,
106
+ previewUrl: '/sandbox?template=agent-console',
107
+ docsUrl: '/docs/examples/agent-console',
108
+ },
109
+ {
110
+ id: 'ai-chat-assistant',
111
+ templateId: 'ai-chat-assistant' as TemplateId,
112
+ title: 'AI Chat Assistant',
113
+ description:
114
+ 'Focused assistant template with reasoning, sources, suggestions, and MCP-aware tooling.',
115
+ tags: ['AI', 'Ops'],
116
+ capabilities: 'Chat UX, Sources, Suggestions, MCP',
117
+ isNew: true,
118
+ previewUrl: '/sandbox?template=ai-chat-assistant',
119
+ docsUrl: '/docs/examples/ai-chat-assistant',
120
+ },
121
+ // ============================================
122
+ // Phase 2-4 Examples
123
+ // ============================================
124
+ {
125
+ id: 'workflow-system',
126
+ templateId: 'workflow-system' as TemplateId,
127
+ title: 'Workflow / Approval System',
128
+ description:
129
+ 'Multi-step workflows with role-based approvals and state transitions.',
130
+ tags: ['Business', 'Ops'],
131
+ capabilities: 'Workflows, Approvals, State Machine',
132
+ isNew: true,
133
+ previewUrl: '/sandbox?template=workflow-system',
134
+ docsUrl: '/docs/examples/workflow-system',
135
+ },
136
+ {
137
+ id: 'marketplace',
138
+ templateId: 'marketplace' as TemplateId,
139
+ title: 'Marketplace',
140
+ description:
141
+ 'Two-sided marketplace with stores, products, orders, and payouts.',
142
+ tags: ['Business', 'Payments'],
143
+ capabilities: 'Stores, Products, Orders, Payouts',
144
+ isNew: true,
145
+ previewUrl: '/sandbox?template=marketplace',
146
+ docsUrl: '/docs/templates/marketplace',
147
+ },
148
+ {
149
+ id: 'integration-hub',
150
+ templateId: 'integration-hub' as TemplateId,
151
+ title: 'Integration Hub',
152
+ description:
153
+ 'Third-party integrations with connections, sync configs, and field mapping.',
154
+ tags: ['Ops', 'AI'],
155
+ capabilities: 'Integrations, Connections, Sync',
156
+ isNew: true,
157
+ previewUrl: '/sandbox?template=integration-hub',
158
+ docsUrl: '/docs/templates/integration-hub',
159
+ },
160
+ // ============================================
161
+ // Learning Journeys
162
+ // ============================================
163
+ {
164
+ id: 'learning-journey-studio-onboarding',
165
+ templateId: 'learning-journey-studio-onboarding' as TemplateId,
166
+ title: 'Learning Journey — Studio Getting Started',
167
+ description:
168
+ 'First 30 minutes in Studio: choose template, edit spec, regenerate, playground, evolution.',
169
+ tags: ['Learning', 'Onboarding'],
170
+ capabilities: 'Spec-first onboarding, XP/streak, progress widget',
171
+ isNew: true,
172
+ previewUrl: '/sandbox?template=learning-journey-studio-onboarding',
173
+ docsUrl: '/docs/templates/learning-journey-studio-onboarding',
174
+ },
175
+ {
176
+ id: 'learning-journey-platform-tour',
177
+ templateId: 'learning-journey-platform-tour' as TemplateId,
178
+ title: 'Learning Journey — Platform Primitives Tour',
179
+ description:
180
+ 'Touch identity, audit, notifications, jobs, flags, files, metering once with guided steps.',
181
+ tags: ['Learning', 'Platform'],
182
+ capabilities: 'Cross-module tour with event-driven completion',
183
+ isNew: true,
184
+ previewUrl: '/sandbox?template=learning-journey-platform-tour',
185
+ docsUrl: '/docs/templates/learning-journey-platform-tour',
186
+ },
187
+ {
188
+ id: 'learning-journey-crm-onboarding',
189
+ templateId: 'learning-journey-crm-onboarding' as TemplateId,
190
+ title: 'Learning Journey — CRM First Win',
191
+ description:
192
+ 'Get to first closed-won deal: pipeline, contact/company, deal, stages, follow-up.',
193
+ tags: ['Learning', 'CRM'],
194
+ capabilities: 'CRM onboarding with XP/streak/badge',
195
+ isNew: true,
196
+ previewUrl: '/sandbox?template=learning-journey-crm-onboarding',
197
+ docsUrl: '/docs/templates/learning-journey-crm-onboarding',
198
+ },
199
+ {
200
+ id: 'analytics-dashboard',
201
+ templateId: 'analytics-dashboard' as TemplateId,
202
+ title: 'Analytics Dashboard',
203
+ description:
204
+ 'Custom dashboards with widgets, saved queries, and real-time visualization.',
205
+ tags: ['Business', 'Ops'],
206
+ capabilities: 'Dashboards, Widgets, Queries',
207
+ isNew: true,
208
+ previewUrl: '/sandbox?template=analytics-dashboard',
209
+ docsUrl: '/docs/templates/analytics-dashboard',
210
+ },
211
+ // ============================================
212
+ // Classic Templates
213
+ // ============================================
214
+ {
215
+ id: 'plumber-ops',
216
+ templateId: 'messaging-app' as TemplateId,
217
+ title: 'Plumber Ops',
218
+ description:
219
+ 'Complete workflow: Quotes → Deposit → Job → Invoice → Payment. Policy-enforced approvals.',
220
+ tags: ['Trades', 'Payments'],
221
+ capabilities: 'Quotes, Jobs, Invoicing, Payments',
222
+ previewUrl: '/sandbox?template=plumber-ops',
223
+ docsUrl: '/docs/specs/workflows',
224
+ },
225
+ {
226
+ id: 'coliving-management',
227
+ templateId: 'recipe-app-i18n' as TemplateId,
228
+ title: 'Coliving Management',
229
+ description:
230
+ 'Coliving management: Onboarding, chores, shared wallet. Multi-party approvals built-in.',
231
+ tags: ['Coliving', 'Finance'],
232
+ capabilities: 'Tasks, Approvals, Payments',
233
+ previewUrl: '/sandbox?template=coliving-management',
234
+ docsUrl: '/docs/specs/workflows',
235
+ },
236
+ {
237
+ id: 'chores-allowance',
238
+ templateId: 'todos-app' as TemplateId,
239
+ title: 'Chores & Allowance',
240
+ description:
241
+ 'Family task management with approval workflows. Teach financial accountability safely.',
242
+ tags: ['Family', 'Ops'],
243
+ capabilities: 'Tasks, Approvals, Notifications',
244
+ previewUrl: '/sandbox?template=chores-allowance',
245
+ docsUrl: '/docs/specs/workflows',
246
+ },
247
+ {
248
+ id: 'service-dispatch',
249
+ templateId: 'messaging-app' as TemplateId,
250
+ title: 'Service Dispatch',
251
+ description:
252
+ 'Field service scheduling, routing, and invoicing. Real-time coordination with policy gates.',
253
+ tags: ['Ops', 'Trades'],
254
+ capabilities: 'Scheduling, Maps, Invoicing',
255
+ previewUrl: '/sandbox?template=service-dispatch',
256
+ docsUrl: '/docs/specs/workflows',
257
+ },
258
+ {
259
+ id: 'content-review',
260
+ templateId: 'todos-app' as TemplateId,
261
+ title: 'Content Review',
262
+ description:
263
+ 'Multi-stage approval workflow for content. Audit trail for every decision.',
264
+ tags: ['Ops'],
265
+ capabilities: 'Workflows, Approvals, Comments',
266
+ previewUrl: '/sandbox?template=content-review',
267
+ docsUrl: '/docs/specs/workflows',
268
+ },
233
269
  ];
234
270
  type LocalTemplate = (typeof templates)[number];
235
271
 
236
272
  const allTags = [
237
- 'Getting Started',
238
- 'SaaS',
239
- 'Business',
240
- 'CRM',
241
- 'AI',
242
- 'Trades',
243
- 'Coliving',
244
- 'Family',
245
- 'Ops',
246
- 'Payments',
247
- 'Learning',
248
- 'Platform',
273
+ 'Getting Started',
274
+ 'SaaS',
275
+ 'Business',
276
+ 'CRM',
277
+ 'AI',
278
+ 'Trades',
279
+ 'Coliving',
280
+ 'Family',
281
+ 'Ops',
282
+ 'Payments',
283
+ 'Learning',
284
+ 'Platform',
249
285
  ];
250
286
 
251
287
  export const TemplatesPage = () => {
252
- const [selectedTag, setSelectedTag] = useState<string | null>(null);
253
- const [search, setSearch] = useState('');
254
- const [preview, setPreview] = useState<TemplateId | null>(null);
255
- const [studioSignupModalOpen, setStudioSignupModalOpen] = useState(false);
256
- const [source, setSource] = useState<'local' | 'registry'>('local');
257
- const [selectedTemplateForCommand, setSelectedTemplateForCommand] = useState<
258
- RegistryTemplate | LocalTemplate | null
259
- >(null);
288
+ const [selectedTag, setSelectedTag] = useState<string | null>(null);
289
+ const [search, setSearch] = useState('');
290
+ const [preview, setPreview] = useState<TemplateId | null>(null);
291
+ const [studioSignupModalOpen, setStudioSignupModalOpen] = useState(false);
292
+ const [source, setSource] = useState<'local' | 'registry'>('local');
293
+ const [selectedTemplateForCommand, setSelectedTemplateForCommand] = useState<
294
+ RegistryTemplate | LocalTemplate | null
295
+ >(null);
260
296
 
261
- const { data: registryTemplates = [], isLoading: registryLoading } =
262
- useRegistryTemplates();
297
+ const { data: registryTemplates = [], isLoading: registryLoading } =
298
+ useRegistryTemplates();
263
299
 
264
- const filtered = templates.filter((t) => {
265
- const matchTag = !selectedTag || t.tags.includes(selectedTag);
266
- const matchSearch =
267
- !search ||
268
- t.title.toLowerCase().includes(search.toLowerCase()) ||
269
- t.description.toLowerCase().includes(search.toLowerCase());
270
- return matchTag && matchSearch;
271
- });
300
+ const filtered = templates.filter((t) => {
301
+ const matchTag = !selectedTag || t.tags.includes(selectedTag);
302
+ const matchSearch =
303
+ !search ||
304
+ t.title.toLowerCase().includes(search.toLowerCase()) ||
305
+ t.description.toLowerCase().includes(search.toLowerCase());
306
+ return matchTag && matchSearch;
307
+ });
272
308
 
273
- const commandId = selectedTemplateForCommand
274
- ? 'templateId' in selectedTemplateForCommand
275
- ? selectedTemplateForCommand.templateId
276
- : selectedTemplateForCommand.id
277
- : '';
309
+ const commandId = selectedTemplateForCommand
310
+ ? 'templateId' in selectedTemplateForCommand
311
+ ? selectedTemplateForCommand.templateId
312
+ : selectedTemplateForCommand.id
313
+ : '';
278
314
 
279
- return (
280
- <TooltipProvider>
281
- <main className="">
282
- {/* Hero */}
283
- <section className="section-padding hero-gradient border-border relative border-b">
284
- <div className="mx-auto max-w-4xl space-y-6 text-center">
285
- <h1 className="text-5xl leading-tight font-bold md:text-6xl">
286
- Recipe templates
287
- </h1>
288
- <p className="text-muted-foreground text-lg">
289
- Ready-to-use, customizable recipes. Policies built in. One-click
290
- deploy.
291
- </p>
292
- </div>
293
- </section>
315
+ return (
316
+ <TooltipProvider>
317
+ <main>
318
+ <section className="section-padding hero-gradient border-border/70 border-b">
319
+ <div className="editorial-shell space-y-8">
320
+ <div className="max-w-4xl space-y-5">
321
+ <p className="editorial-kicker">Proof through real scenarios</p>
322
+ <h1 className="editorial-title">
323
+ Templates that show the open system in practice.
324
+ </h1>
325
+ <p className="editorial-subtitle">
326
+ These scenarios are the fastest way to understand ContractSpec:
327
+ explicit contracts, aligned surfaces, and an adoption path from
328
+ OSS exploration into Studio deployment.
329
+ </p>
330
+ </div>
331
+ <div className="editorial-proof-strip">
332
+ <div className="editorial-stat">
333
+ <span className="editorial-stat-value">{templates.length}</span>
334
+ <span className="editorial-label">curated scenarios</span>
335
+ </div>
336
+ <div className="editorial-stat">
337
+ <span className="editorial-stat-value">2</span>
338
+ <span className="editorial-label">entry paths</span>
339
+ </div>
340
+ <div className="editorial-stat">
341
+ <span className="editorial-stat-value">OSS</span>
342
+ <span className="editorial-label">first, Studio second</span>
343
+ </div>
344
+ </div>
345
+ </div>
346
+ </section>
294
347
 
295
- {/* Search & Filter */}
296
- <section className="section-padding border-border border-b">
297
- <div className="mx-auto max-w-6xl space-y-6">
298
- <div className="flex items-center justify-between gap-3">
299
- <div className="text-muted-foreground text-sm">Source:</div>
300
- <div className="flex gap-2">
301
- <button
302
- onClick={() => setSource('local')}
303
- className={cn(
304
- 'rounded-full px-4 py-2 text-sm font-medium transition-colors',
305
- {
306
- 'bg-violet-500 text-white': source === 'local',
307
- 'bg-card border-border hover:bg-card/80 border':
308
- source !== 'local',
309
- }
310
- )}
311
- aria-pressed={source === 'local'}
312
- >
313
- Local
314
- </button>
315
- <button
316
- onClick={() => setSource('registry')}
317
- className={cn(
318
- 'rounded-full px-4 py-2 text-sm font-medium transition-colors',
319
- {
320
- 'bg-violet-500 text-white': source === 'registry',
321
- 'bg-card border-border hover:bg-card/80 border':
322
- source !== 'registry',
323
- }
324
- )}
325
- aria-pressed={source === 'registry'}
326
- >
327
- Community
328
- </button>
329
- </div>
330
- </div>
331
- <div className="relative">
332
- <Search
333
- className="text-muted-foreground absolute top-3 left-3"
334
- size={20}
335
- />
336
- <input
337
- type="text"
338
- placeholder="Search templates..."
339
- value={search}
340
- onChange={(e) => setSearch(e.target.value)}
341
- className="bg-card border-border w-full rounded-lg border py-3 pr-4 pl-10 focus:ring-2 focus:ring-violet-500 focus:outline-none"
342
- aria-label="Search templates"
343
- />
344
- </div>
345
- <div className="flex flex-wrap gap-2">
346
- <button
347
- onClick={() => setSelectedTag(null)}
348
- className={`rounded-full px-4 py-2 text-sm font-medium transition-colors ${
349
- selectedTag === null
350
- ? 'bg-violet-500 text-white'
351
- : 'bg-card border-border hover:bg-card/80 border'
352
- }`}
353
- aria-pressed={selectedTag === null}
354
- >
355
- All
356
- </button>
357
- {allTags.map((tag) => (
358
- <button
359
- key={tag}
360
- onClick={() => setSelectedTag(tag)}
361
- className={cn(
362
- `rounded-full px-4 py-2 text-sm font-medium transition-colors`,
363
- {
364
- 'bg-violet-500 text-white': selectedTag === tag,
365
- 'bg-card border-border hover:bg-card/80 border':
366
- selectedTag !== tag,
367
- }
368
- )}
369
- aria-pressed={selectedTag === tag}
370
- >
371
- {tag}
372
- </button>
373
- ))}
374
- </div>
375
- </div>
376
- </section>
348
+ <section className="editorial-section">
349
+ <div className="editorial-shell space-y-6">
350
+ <div className="flex flex-col gap-6 lg:flex-row lg:items-end lg:justify-between">
351
+ <div className="max-w-3xl space-y-3">
352
+ <p className="editorial-kicker">Browse by source</p>
353
+ <h2 className="font-serif text-4xl tracking-[-0.04em]">
354
+ Use local scenarios for core proof, then scan the community.
355
+ </h2>
356
+ <p className="text-muted-foreground text-sm leading-7">
357
+ Local templates show the official adoption path. Community
358
+ templates show where the ecosystem is pushing the system next.
359
+ </p>
360
+ </div>
361
+ <div className="flex gap-2">
362
+ <button
363
+ onClick={() => setSource('local')}
364
+ className={cn(
365
+ 'rounded-full px-4 py-2 font-medium text-sm transition-colors',
366
+ {
367
+ 'bg-primary text-primary-foreground': source === 'local',
368
+ 'border border-border bg-card hover:bg-card/80':
369
+ source !== 'local',
370
+ }
371
+ )}
372
+ aria-pressed={source === 'local'}
373
+ >
374
+ Local
375
+ </button>
376
+ <button
377
+ onClick={() => setSource('registry')}
378
+ className={cn(
379
+ 'rounded-full px-4 py-2 font-medium text-sm transition-colors',
380
+ {
381
+ 'bg-primary text-primary-foreground':
382
+ source === 'registry',
383
+ 'border border-border bg-card hover:bg-card/80':
384
+ source !== 'registry',
385
+ }
386
+ )}
387
+ aria-pressed={source === 'registry'}
388
+ >
389
+ Community
390
+ </button>
391
+ </div>
392
+ </div>
393
+ <div className="editorial-panel space-y-5">
394
+ <div className="relative">
395
+ <Search
396
+ className="absolute top-3.5 left-4 text-muted-foreground"
397
+ size={18}
398
+ />
399
+ <input
400
+ type="text"
401
+ placeholder="Search scenarios, industries, or capabilities"
402
+ value={search}
403
+ onChange={(e) => setSearch(e.target.value)}
404
+ className="w-full rounded-full border border-border bg-background px-12 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring"
405
+ aria-label="Search templates"
406
+ />
407
+ </div>
408
+ <div className="flex flex-wrap gap-2">
409
+ <button
410
+ onClick={() => setSelectedTag(null)}
411
+ className={cn(
412
+ 'rounded-full px-4 py-2 font-medium text-sm transition-colors',
413
+ {
414
+ 'bg-primary text-primary-foreground':
415
+ selectedTag === null,
416
+ 'border border-border bg-card hover:bg-card/80':
417
+ selectedTag !== null,
418
+ }
419
+ )}
420
+ aria-pressed={selectedTag === null}
421
+ >
422
+ All
423
+ </button>
424
+ {allTags.map((tag) => (
425
+ <button
426
+ key={tag}
427
+ onClick={() => setSelectedTag(tag)}
428
+ className={cn(
429
+ 'rounded-full px-4 py-2 font-medium text-sm transition-colors',
430
+ {
431
+ 'bg-primary text-primary-foreground':
432
+ selectedTag === tag,
433
+ 'border border-border bg-card hover:bg-card/80':
434
+ selectedTag !== tag,
435
+ }
436
+ )}
437
+ aria-pressed={selectedTag === tag}
438
+ >
439
+ {tag}
440
+ </button>
441
+ ))}
442
+ </div>
443
+ </div>
444
+ </div>
445
+ </section>
377
446
 
378
- {/* Templates Grid */}
379
- <section className="section-padding">
380
- <div className="mx-auto max-w-6xl">
381
- {source === 'registry' ? (
382
- registryLoading ? (
383
- <div className="py-12 text-center">
384
- <p className="text-muted-foreground">
385
- Loading community templates…
386
- </p>
387
- </div>
388
- ) : registryTemplates.length === 0 ? (
389
- <div className="py-12 text-center">
390
- <p className="text-muted-foreground">
391
- No community templates found (configure
392
- `NEXT_PUBLIC_CONTRACTSPEC_REGISTRY_URL`).
393
- </p>
394
- </div>
395
- ) : (
396
- <div className="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
397
- {registryTemplates.map((t) => (
398
- <div
399
- key={t.id}
400
- className="card-subtle relative flex flex-col space-y-4 p-6 transition-colors hover:border-violet-500/50"
401
- >
402
- <div>
403
- <h3 className="text-lg font-bold">{t.name}</h3>
404
- <p className="text-muted-foreground mt-1 text-sm">
405
- {t.description}
406
- </p>
407
- </div>
408
- <div className="flex-1 space-y-2">
409
- <div className="flex flex-wrap gap-1">
410
- {t.tags.map((tag) => (
411
- <span
412
- key={tag}
413
- className="rounded border border-violet-500/20 bg-violet-500/10 px-2 py-1 text-xs text-violet-300"
414
- >
415
- {tag}
416
- </span>
417
- ))}
418
- </div>
419
- </div>
420
- <div className="flex gap-2 pt-4">
421
- <Tooltip>
422
- <TooltipTrigger asChild>
423
- <button
424
- className="btn-ghost flex-1 text-center text-xs"
425
- onClick={() => {
426
- const local = getTemplate(t.id as TemplateId);
427
- if (!local) {
428
- setSelectedTemplateForCommand(t);
429
- return;
430
- }
431
- setPreview(t.id as TemplateId);
432
- }}
433
- >
434
- Preview
435
- </button>
436
- </TooltipTrigger>
437
- <TooltipContent>
438
- <p>Preview this template (if available locally)</p>
439
- </TooltipContent>
440
- </Tooltip>
441
- <Tooltip>
442
- <TooltipTrigger asChild>
443
- <button
444
- className="btn-primary flex-1 text-center text-xs"
445
- onClick={() => {
446
- captureAnalyticsEvent(
447
- analyticsEventNames.EXAMPLE_REPO_OPEN,
448
- {
449
- surface: 'templates',
450
- templateId: t.id,
451
- source: 'registry',
452
- }
453
- );
454
- setSelectedTemplateForCommand(t);
455
- }}
456
- >
457
- Use Template
458
- </button>
459
- </TooltipTrigger>
460
- <TooltipContent>
461
- <p>Get CLI command</p>
462
- </TooltipContent>
463
- </Tooltip>
464
- </div>
465
- </div>
466
- ))}
467
- </div>
468
- )
469
- ) : filtered.length === 0 ? (
470
- <div className="py-12 text-center">
471
- <p className="text-muted-foreground">
472
- No templates match your filters. Try a different search.
473
- </p>
474
- </div>
475
- ) : (
476
- <div className="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
477
- {filtered.map((template, i) => (
478
- <div
479
- key={i}
480
- className="card-subtle relative flex flex-col space-y-4 p-6 transition-colors hover:border-violet-500/50"
481
- >
482
- {'isNew' in template && template.isNew && (
483
- <span className="absolute top-3 right-3 rounded-full bg-green-500 px-2 py-0.5 text-xs font-semibold text-white">
484
- New
485
- </span>
486
- )}
487
- <div>
488
- <h3 className="text-lg font-bold">{template.title}</h3>
489
- <p className="text-muted-foreground mt-1 text-sm">
490
- {template.description}
491
- </p>
492
- </div>
493
- <div className="flex-1 space-y-2">
494
- <p className="text-muted-foreground text-xs">
495
- <span className="text-foreground font-medium">
496
- Capabilities:
497
- </span>{' '}
498
- {template.capabilities}
499
- </p>
500
- <div className="flex flex-wrap gap-1">
501
- {template.tags.map((tag) => (
502
- <span
503
- key={tag}
504
- className="rounded border border-violet-500/20 bg-violet-500/10 px-2 py-1 text-xs text-violet-300"
505
- >
506
- {tag}
507
- </span>
508
- ))}
509
- </div>
510
- </div>
511
- <div className="flex gap-2 pt-4">
512
- <Tooltip>
513
- <TooltipTrigger asChild>
514
- <button
515
- className="btn-ghost flex-1 text-center text-xs"
516
- onClick={() => setPreview(template.templateId)}
517
- >
518
- Preview
519
- </button>
520
- </TooltipTrigger>
521
- <TooltipContent>
522
- <p>Preview this template in a modal</p>
523
- </TooltipContent>
524
- </Tooltip>
525
- <Tooltip>
526
- <TooltipTrigger asChild>
527
- <button
528
- className="btn-primary flex-1 text-center text-xs"
529
- onClick={() => {
530
- captureAnalyticsEvent(
531
- analyticsEventNames.EXAMPLE_REPO_OPEN,
532
- {
533
- surface: 'templates',
534
- templateId: template.templateId,
535
- source: 'local',
536
- }
537
- );
538
- setSelectedTemplateForCommand(template);
539
- }}
540
- >
541
- Use Template
542
- </button>
543
- </TooltipTrigger>
544
- <TooltipContent>
545
- <p>Get CLI command</p>
546
- </TooltipContent>
547
- </Tooltip>
548
- </div>
549
- </div>
550
- ))}
551
- </div>
552
- )}
553
- </div>
554
- </section>
447
+ <section className="section-padding">
448
+ <div className="editorial-shell">
449
+ {source === 'registry' ? (
450
+ registryLoading ? (
451
+ <div className="py-12 text-center">
452
+ <p className="text-muted-foreground">
453
+ Loading community templates…
454
+ </p>
455
+ </div>
456
+ ) : registryTemplates.length === 0 ? (
457
+ <div className="py-12 text-center">
458
+ <p className="text-muted-foreground">
459
+ No community templates found (configure
460
+ `NEXT_PUBLIC_CONTRACTSPEC_REGISTRY_URL`).
461
+ </p>
462
+ </div>
463
+ ) : (
464
+ <div className="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
465
+ {registryTemplates.map((t) => (
466
+ <div
467
+ key={t.id}
468
+ className="editorial-panel relative flex flex-col space-y-4 transition-colors hover:border-[color:rgb(162_79_42_/_0.55)]"
469
+ >
470
+ <div>
471
+ <h3 className="font-serif text-2xl tracking-[-0.03em]">
472
+ {t.name}
473
+ </h3>
474
+ <p className="mt-1 text-muted-foreground text-sm">
475
+ {t.description}
476
+ </p>
477
+ </div>
478
+ <div className="flex-1 space-y-2">
479
+ <div className="flex flex-wrap gap-1">
480
+ {t.tags.map((tag) => (
481
+ <span
482
+ key={tag}
483
+ className="rounded-full border border-border bg-muted px-3 py-1 text-[11px] text-muted-foreground"
484
+ >
485
+ {tag}
486
+ </span>
487
+ ))}
488
+ </div>
489
+ </div>
490
+ <div className="flex gap-2 pt-4">
491
+ <Tooltip>
492
+ <TooltipTrigger asChild>
493
+ <button
494
+ className="btn-ghost flex-1 text-center text-xs"
495
+ onClick={() => {
496
+ const local = getTemplate(t.id as TemplateId);
497
+ if (!local) {
498
+ setSelectedTemplateForCommand(t);
499
+ return;
500
+ }
501
+ setPreview(t.id as TemplateId);
502
+ }}
503
+ >
504
+ Preview
505
+ </button>
506
+ </TooltipTrigger>
507
+ <TooltipContent>
508
+ <p>Preview this template (if available locally)</p>
509
+ </TooltipContent>
510
+ </Tooltip>
511
+ <Tooltip>
512
+ <TooltipTrigger asChild>
513
+ <button
514
+ className="btn-primary flex-1 text-center text-xs"
515
+ onClick={() => {
516
+ captureAnalyticsEvent(
517
+ analyticsEventNames.EXAMPLE_REPO_OPEN,
518
+ {
519
+ surface: 'templates',
520
+ templateId: t.id,
521
+ source: 'registry',
522
+ }
523
+ );
524
+ setSelectedTemplateForCommand(t);
525
+ }}
526
+ >
527
+ Use Template
528
+ </button>
529
+ </TooltipTrigger>
530
+ <TooltipContent>
531
+ <p>Get CLI command</p>
532
+ </TooltipContent>
533
+ </Tooltip>
534
+ </div>
535
+ </div>
536
+ ))}
537
+ </div>
538
+ )
539
+ ) : filtered.length === 0 ? (
540
+ <div className="py-12 text-center">
541
+ <p className="text-muted-foreground">
542
+ No templates match your filters. Try a different search.
543
+ </p>
544
+ </div>
545
+ ) : (
546
+ <div className="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
547
+ {filtered.map((template, i) => (
548
+ <div
549
+ key={i}
550
+ className="editorial-panel relative flex flex-col space-y-4 transition-colors hover:border-[color:rgb(162_79_42_/_0.55)]"
551
+ >
552
+ {'isNew' in template && template.isNew && (
553
+ <span className="absolute top-4 right-4 rounded-full bg-[color:var(--success)] px-2.5 py-1 font-medium text-[11px] text-white uppercase">
554
+ New
555
+ </span>
556
+ )}
557
+ <div>
558
+ <h3 className="font-serif text-2xl tracking-[-0.03em]">
559
+ {template.title}
560
+ </h3>
561
+ <p className="mt-1 text-muted-foreground text-sm">
562
+ {template.description}
563
+ </p>
564
+ </div>
565
+ <div className="flex-1 space-y-2">
566
+ <p className="text-muted-foreground text-xs">
567
+ <span className="font-medium text-foreground">
568
+ Capabilities:
569
+ </span>{' '}
570
+ {template.capabilities}
571
+ </p>
572
+ <div className="flex flex-wrap gap-1">
573
+ {template.tags.map((tag) => (
574
+ <span
575
+ key={tag}
576
+ className="rounded-full border border-border bg-muted px-3 py-1 text-[11px] text-muted-foreground"
577
+ >
578
+ {tag}
579
+ </span>
580
+ ))}
581
+ </div>
582
+ </div>
583
+ <div className="flex gap-2 pt-4">
584
+ <Tooltip>
585
+ <TooltipTrigger asChild>
586
+ <button
587
+ className="btn-ghost flex-1 text-center text-xs"
588
+ onClick={() => setPreview(template.templateId)}
589
+ >
590
+ Preview
591
+ </button>
592
+ </TooltipTrigger>
593
+ <TooltipContent>
594
+ <p>Preview this template in a modal</p>
595
+ </TooltipContent>
596
+ </Tooltip>
597
+ <Tooltip>
598
+ <TooltipTrigger asChild>
599
+ <button
600
+ className="btn-primary flex-1 text-center text-xs"
601
+ onClick={() => {
602
+ captureAnalyticsEvent(
603
+ analyticsEventNames.EXAMPLE_REPO_OPEN,
604
+ {
605
+ surface: 'templates',
606
+ templateId: template.templateId,
607
+ source: 'local',
608
+ }
609
+ );
610
+ setSelectedTemplateForCommand(template);
611
+ }}
612
+ >
613
+ Use Template
614
+ </button>
615
+ </TooltipTrigger>
616
+ <TooltipContent>
617
+ <p>Get CLI command</p>
618
+ </TooltipContent>
619
+ </Tooltip>
620
+ </div>
621
+ </div>
622
+ ))}
623
+ </div>
624
+ )}
625
+ </div>
626
+ </section>
555
627
 
556
- {/* Extend with Integrations & Knowledge */}
557
- <section className="section-padding border-border bg-striped border-t">
558
- <div className="mx-auto max-w-6xl space-y-8">
559
- <div className="space-y-4 text-center">
560
- <h2 className="text-3xl font-bold md:text-4xl">
561
- Extend templates with integrations & knowledge
562
- </h2>
563
- <p className="text-muted-foreground mx-auto max-w-2xl">
564
- Every template can be enhanced with built-in integrations and
565
- knowledge spaces. Add payments, email, AI, and structured
566
- knowledge without writing integration code.
567
- </p>
568
- </div>
569
- <div className="grid gap-6 md:grid-cols-3">
570
- <div className="card-subtle space-y-4 p-6">
571
- <div className="text-3xl">💳</div>
572
- <h3 className="font-bold">Add Payments</h3>
573
- <p className="text-muted-foreground text-sm">
574
- Connect Stripe to any template for payment processing,
575
- subscriptions, and invoicing. Type-safe and policy-enforced.
576
- </p>
577
- <Link
578
- href="/docs/integrations/stripe"
579
- className="inline-flex items-center gap-1 text-sm text-violet-400 hover:text-violet-300"
580
- >
581
- Learn more
582
- </Link>
583
- </div>
584
- <div className="card-subtle space-y-4 p-6">
585
- <div className="text-3xl">📧</div>
586
- <h3 className="font-bold">Add Notifications</h3>
587
- <p className="text-muted-foreground text-sm">
588
- Send transactional emails via Postmark or Resend. Process
589
- inbound emails with Gmail API. SMS via Twilio.
590
- </p>
591
- <Link
592
- href="/docs/integrations"
593
- className="inline-flex items-center gap-1 text-sm text-violet-400 hover:text-violet-300"
594
- >
595
- View integrations →
596
- </Link>
597
- </div>
598
- <div className="card-subtle space-y-4 p-6">
599
- <div className="text-3xl">🧠</div>
600
- <h3 className="font-bold">Add AI & Knowledge</h3>
601
- <p className="text-muted-foreground text-sm">
602
- Power templates with OpenAI, vector search via Qdrant, and
603
- structured knowledge spaces for context-aware workflows.
604
- </p>
605
- <Link
606
- href="/docs/knowledge"
607
- className="inline-flex items-center gap-1 text-sm text-violet-400 hover:text-violet-300"
608
- >
609
- Learn about knowledge
610
- </Link>
611
- </div>
612
- </div>
613
- <div className="pt-4 text-center">
614
- <p className="text-muted-foreground mb-4 text-sm">
615
- All integrations are configured per-tenant with automatic health
616
- checks and credential rotation.
617
- </p>
618
- <Link href="/docs/architecture" className="btn-primary">
619
- View Architecture
620
- </Link>
621
- </div>
622
- </div>
623
- </section>
624
- </main>
628
+ <section className="editorial-section bg-striped">
629
+ <div className="editorial-shell space-y-8">
630
+ <div className="max-w-3xl space-y-4">
631
+ <p className="editorial-kicker">From template to real system</p>
632
+ <h2 className="font-serif text-4xl tracking-[-0.04em] md:text-5xl">
633
+ Templates become useful when the system can absorb more context.
634
+ </h2>
635
+ <p className="editorial-copy">
636
+ Use templates to prove the base flow, then layer integrations,
637
+ knowledge, and runtime behavior on top without losing the same
638
+ contract source.
639
+ </p>
640
+ </div>
641
+ <div className="grid gap-6 md:grid-cols-3">
642
+ <div className="editorial-panel space-y-4">
643
+ <div className="text-3xl">💳</div>
644
+ <h3 className="font-serif text-2xl tracking-[-0.03em]">
645
+ Add payments
646
+ </h3>
647
+ <p className="text-muted-foreground text-sm">
648
+ Connect Stripe to any template for payment processing,
649
+ subscriptions, and invoicing. Type-safe and policy-enforced.
650
+ </p>
651
+ <Link
652
+ href="/docs/integrations/stripe"
653
+ className="font-medium text-[color:var(--blue)] text-sm hover:opacity-80"
654
+ >
655
+ Learn more →
656
+ </Link>
657
+ </div>
658
+ <div className="editorial-panel space-y-4">
659
+ <div className="text-3xl">📧</div>
660
+ <h3 className="font-serif text-2xl tracking-[-0.03em]">
661
+ Add notifications
662
+ </h3>
663
+ <p className="text-muted-foreground text-sm">
664
+ Send transactional emails via Postmark or Resend. Process
665
+ inbound emails with Gmail API. SMS via Twilio.
666
+ </p>
667
+ <Link
668
+ href="/docs/integrations"
669
+ className="font-medium text-[color:var(--blue)] text-sm hover:opacity-80"
670
+ >
671
+ View integrations →
672
+ </Link>
673
+ </div>
674
+ <div className="editorial-panel space-y-4">
675
+ <div className="text-3xl">🧠</div>
676
+ <h3 className="font-serif text-2xl tracking-[-0.03em]">
677
+ Add AI and knowledge
678
+ </h3>
679
+ <p className="text-muted-foreground text-sm">
680
+ Power templates with OpenAI, vector search via Qdrant, and
681
+ structured knowledge spaces for context-aware workflows.
682
+ </p>
683
+ <Link
684
+ href="/docs/knowledge"
685
+ className="font-medium text-[color:var(--blue)] text-sm hover:opacity-80"
686
+ >
687
+ Learn about knowledge
688
+ </Link>
689
+ </div>
690
+ </div>
691
+ <div className="pt-4 text-center">
692
+ <p className="mb-4 text-muted-foreground text-sm">
693
+ All integrations are configured per-tenant with automatic health
694
+ checks and credential rotation.
695
+ </p>
696
+ <Link href="/docs/architecture" className="btn-primary">
697
+ View Architecture
698
+ </Link>
699
+ </div>
700
+ </div>
701
+ </section>
702
+ </main>
625
703
 
626
- {/*{preview ? (*/}
627
- <TemplatePreviewModal
628
- templateId={preview}
629
- onClose={() => {
630
- setPreview(null);
631
- }}
632
- />
633
- {/*) : null}*/}
704
+ {/*{preview ? (*/}
705
+ <TemplatePreviewModal
706
+ templateId={preview}
707
+ onClose={() => {
708
+ setPreview(null);
709
+ }}
710
+ />
711
+ {/*) : null}*/}
634
712
 
635
- <Dialog
636
- open={studioSignupModalOpen}
637
- onOpenChange={setStudioSignupModalOpen}
638
- >
639
- <DialogContent className="max-h-[90vh] max-w-2xl overflow-y-auto">
640
- <DialogHeader>
641
- <DialogTitle>Deploy in Studio</DialogTitle>
642
- <DialogDescription>
643
- Deploy templates in ContractSpec Studio and run the full
644
- evidence-to-spec loop with your team.
645
- </DialogDescription>
646
- </DialogHeader>
647
- <StudioSignupSection variant="compact" />
648
- </DialogContent>
649
- </Dialog>
713
+ <Dialog
714
+ open={studioSignupModalOpen}
715
+ onOpenChange={setStudioSignupModalOpen}
716
+ >
717
+ <DialogContent className="max-h-[90vh] max-w-2xl overflow-y-auto">
718
+ <DialogHeader>
719
+ <DialogTitle>Deploy in Studio</DialogTitle>
720
+ <DialogDescription>
721
+ Deploy templates in ContractSpec Studio and run the full
722
+ evidence-to-spec loop with your team.
723
+ </DialogDescription>
724
+ </DialogHeader>
725
+ <StudioSignupSection variant="compact" />
726
+ </DialogContent>
727
+ </Dialog>
650
728
 
651
- <Dialog
652
- open={!!selectedTemplateForCommand}
653
- onOpenChange={() => setSelectedTemplateForCommand(null)}
654
- >
655
- <DialogContent className="max-w-md">
656
- <DialogHeader>
657
- <DialogTitle>Use this template</DialogTitle>
658
- <DialogDescription>
659
- Initialize a new project with this template using the CLI.
660
- </DialogDescription>
661
- </DialogHeader>
662
- <div className="space-y-4 pt-4">
663
- <div className="rounded-md border border-zinc-800 bg-zinc-950 p-4 font-mono text-sm text-zinc-50">
664
- npx contractspec init --template {commandId}
665
- </div>
666
- <div className="flex gap-2">
667
- <button
668
- className="btn-secondary w-full"
669
- onClick={() => {
670
- navigator.clipboard.writeText(
671
- `npx contractspec init --template ${commandId}`
672
- );
673
- captureAnalyticsEvent(
674
- analyticsEventNames.COPY_COMMAND_CLICK,
675
- {
676
- surface: 'templates',
677
- templateId: commandId,
678
- filename: 'templates-cli',
679
- }
680
- );
681
- }}
682
- >
683
- Copy Command
684
- </button>
685
- </div>
686
- <div className="relative">
687
- <div className="absolute inset-0 flex items-center">
688
- <span className="border-border w-full border-t" />
689
- </div>
690
- <div className="relative flex justify-center text-xs uppercase">
691
- <span className="bg-background text-muted-foreground px-2">
692
- Or
693
- </span>
694
- </div>
695
- </div>
696
- <button
697
- className="btn-ghost w-full text-sm"
698
- onClick={() => {
699
- captureAnalyticsEvent(analyticsEventNames.CTA_STUDIO_CLICK, {
700
- surface: 'templates',
701
- templateId: commandId,
702
- });
703
- setSelectedTemplateForCommand(null);
704
- setStudioSignupModalOpen(true);
705
- }}
706
- >
707
- Deploy to Studio
708
- </button>
709
- </div>
710
- </DialogContent>
711
- </Dialog>
712
- </TooltipProvider>
713
- );
729
+ <Dialog
730
+ open={!!selectedTemplateForCommand}
731
+ onOpenChange={() => setSelectedTemplateForCommand(null)}
732
+ >
733
+ <DialogContent className="max-w-md">
734
+ <DialogHeader>
735
+ <DialogTitle>Use this template</DialogTitle>
736
+ <DialogDescription>
737
+ Initialize a new project with this template using the CLI.
738
+ </DialogDescription>
739
+ </DialogHeader>
740
+ <div className="space-y-4 pt-4">
741
+ <div className="rounded-md border border-zinc-800 bg-zinc-950 p-4 font-mono text-sm text-zinc-50">
742
+ npx contractspec init --template {commandId}
743
+ </div>
744
+ <div className="flex gap-2">
745
+ <button
746
+ className="btn-secondary w-full"
747
+ onClick={() => {
748
+ navigator.clipboard.writeText(
749
+ `npx contractspec init --template ${commandId}`
750
+ );
751
+ captureAnalyticsEvent(
752
+ analyticsEventNames.COPY_COMMAND_CLICK,
753
+ {
754
+ surface: 'templates',
755
+ templateId: commandId,
756
+ filename: 'templates-cli',
757
+ }
758
+ );
759
+ }}
760
+ >
761
+ Copy Command
762
+ </button>
763
+ </div>
764
+ <div className="relative">
765
+ <div className="absolute inset-0 flex items-center">
766
+ <span className="w-full border-border border-t" />
767
+ </div>
768
+ <div className="relative flex justify-center text-xs uppercase">
769
+ <span className="bg-background px-2 text-muted-foreground">
770
+ Or
771
+ </span>
772
+ </div>
773
+ </div>
774
+ <button
775
+ className="btn-ghost w-full text-sm"
776
+ onClick={() => {
777
+ captureAnalyticsEvent(analyticsEventNames.CTA_STUDIO_CLICK, {
778
+ surface: 'templates',
779
+ templateId: commandId,
780
+ });
781
+ setSelectedTemplateForCommand(null);
782
+ setStudioSignupModalOpen(true);
783
+ }}
784
+ >
785
+ Deploy to Studio
786
+ </button>
787
+ </div>
788
+ </DialogContent>
789
+ </Dialog>
790
+ </TooltipProvider>
791
+ );
714
792
  };