create-nersh 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +187 -0
- package/dist/index.mjs +188 -44
- package/package.json +4 -3
- package/templates/default-site.json +668 -0
- package/templates/next/app/globals.css +26 -0
- package/templates/next/components.json +23 -0
- package/templates/next/package.json.tmpl +5 -3
- package/templates/next/postcss.config.mjs +8 -0
- package/templates/next/site.json +0 -121
- package/templates/next/src/components/site/SafeEmbed.tsx +0 -72
- package/templates/next/src/components/site/SiteButton.tsx +0 -65
- package/templates/next/src/components/site/SiteCard.tsx +0 -46
- package/templates/next/src/components/site/SiteCodeBlock.tsx +0 -56
- package/templates/next/src/components/site/SiteHeading.tsx +0 -50
- package/templates/next/src/components/site/SiteMobileSlider.tsx +0 -71
- package/templates/next/src/components/site/SiteSectionShell.tsx +0 -91
- package/templates/next/src/components/site/SiteStructuralContext.tsx +0 -52
- package/templates/next/src/lib/brandContext.ts +0 -65
- package/templates/next/src/lib/codeBlock.ts +0 -76
- package/templates/next/src/lib/componentLibrary/providers/shadcn/components.ts +0 -146
- package/templates/next/src/lib/componentLibrary/resolveComponent.ts +0 -35
- package/templates/next/src/lib/componentLibrary/schema.ts +0 -219
- package/templates/next/src/lib/embeds/index.ts +0 -232
- package/templates/next/src/lib/humanize.ts +0 -58
- package/templates/next/src/lib/sectionItems.ts +0 -48
- package/templates/next/src/lib/sectionSurface.ts +0 -70
- package/templates/next/src/lib/utils.ts +0 -6
- package/templates/next/src/registry.ts +0 -16
- package/templates/next/src/sections/about/Component.tsx +0 -51
- package/templates/next/src/sections/about/index.ts +0 -7
- package/templates/next/src/sections/about/meta.ts +0 -8
- package/templates/next/src/sections/about/schema.ts +0 -38
- package/templates/next/src/sections/about/writeCopy.ts +0 -10
- package/templates/next/src/sections/copyHelpers.ts +0 -59
- package/templates/next/src/sections/features/Component.tsx +0 -122
- package/templates/next/src/sections/features/index.ts +0 -7
- package/templates/next/src/sections/features/meta.ts +0 -14
- package/templates/next/src/sections/features/schema.ts +0 -23
- package/templates/next/src/sections/features/writeCopy.ts +0 -18
- package/templates/next/src/sections/footer/Component.tsx +0 -103
- package/templates/next/src/sections/footer/index.ts +0 -7
- package/templates/next/src/sections/footer/meta.ts +0 -8
- package/templates/next/src/sections/footer/schema.ts +0 -39
- package/templates/next/src/sections/footer/writeCopy.ts +0 -31
- package/templates/next/src/sections/marketing-hero/Component.tsx +0 -187
- package/templates/next/src/sections/marketing-hero/index.ts +0 -7
- package/templates/next/src/sections/marketing-hero/meta.ts +0 -13
- package/templates/next/src/sections/marketing-hero/schema.ts +0 -106
- package/templates/next/src/sections/marketing-hero/writeCopy.ts +0 -18
- package/templates/next/src/sections/navbar/Component.tsx +0 -53
- package/templates/next/src/sections/navbar/index.ts +0 -7
- package/templates/next/src/sections/navbar/meta.ts +0 -8
- package/templates/next/src/sections/navbar/schema.ts +0 -50
- package/templates/next/src/sections/navbar/writeCopy.ts +0 -16
- package/templates/next/src/sections/pricing/Component.tsx +0 -125
- package/templates/next/src/sections/pricing/index.ts +0 -7
- package/templates/next/src/sections/pricing/meta.ts +0 -12
- package/templates/next/src/sections/pricing/schema.ts +0 -25
- package/templates/next/src/sections/pricing/writeCopy.ts +0 -22
- package/templates/next/src/sections/siteLayoutClasses.ts +0 -9
- package/templates/next/src/sections/types.ts +0 -119
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import type { SectionCopySchemaField } from "../types";
|
|
2
|
-
|
|
3
|
-
export const schema: SectionCopySchemaField[] = [
|
|
4
|
-
{
|
|
5
|
-
key: "eyebrow",
|
|
6
|
-
label: "Eyebrow (above headline)",
|
|
7
|
-
type: "text",
|
|
8
|
-
required: false,
|
|
9
|
-
maxLength: 64,
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
key: "headline",
|
|
13
|
-
label: "Headline",
|
|
14
|
-
type: "text",
|
|
15
|
-
placeholder: '"Website"',
|
|
16
|
-
required: true,
|
|
17
|
-
maxLength: 120,
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
key: "sub",
|
|
21
|
-
label: "Sub copy",
|
|
22
|
-
type: "textarea",
|
|
23
|
-
placeholder: "One sentence that says what you do.",
|
|
24
|
-
required: false,
|
|
25
|
-
maxLength: 220,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
key: "heroImage",
|
|
29
|
-
label: "Hero image",
|
|
30
|
-
type: "image",
|
|
31
|
-
required: false,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
key: "heroVideo",
|
|
35
|
-
label: "Hero video",
|
|
36
|
-
type: "videoEmbed",
|
|
37
|
-
required: false,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
key: "ctaLabel",
|
|
41
|
-
label: "CTA label",
|
|
42
|
-
type: "text",
|
|
43
|
-
placeholder: "Begin",
|
|
44
|
-
required: false,
|
|
45
|
-
maxLength: 30,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
key: "ctaHref",
|
|
49
|
-
label: "CTA link",
|
|
50
|
-
type: "text",
|
|
51
|
-
placeholder: "#",
|
|
52
|
-
required: false,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
key: "cta2Label",
|
|
56
|
-
label: "Secondary CTA label",
|
|
57
|
-
type: "text",
|
|
58
|
-
placeholder: "Learn more",
|
|
59
|
-
required: false,
|
|
60
|
-
maxLength: 30,
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
key: "cta2Href",
|
|
64
|
-
label: "Secondary CTA link",
|
|
65
|
-
type: "text",
|
|
66
|
-
placeholder: "#",
|
|
67
|
-
required: false,
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
key: "cardHeading",
|
|
71
|
-
label: "CTA card heading (card layout)",
|
|
72
|
-
type: "text",
|
|
73
|
-
placeholder: "Ready when you are",
|
|
74
|
-
required: false,
|
|
75
|
-
maxLength: 60,
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
key: "cardSub",
|
|
79
|
-
label: "CTA card sub (card layout)",
|
|
80
|
-
type: "text",
|
|
81
|
-
placeholder: "Free estimate, no pressure.",
|
|
82
|
-
required: false,
|
|
83
|
-
maxLength: 120,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
key: "trustBadge1",
|
|
87
|
-
label: "Trust badge 1 (optional)",
|
|
88
|
-
type: "text",
|
|
89
|
-
required: false,
|
|
90
|
-
maxLength: 48,
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
key: "trustBadge2",
|
|
94
|
-
label: "Trust badge 2 (optional)",
|
|
95
|
-
type: "text",
|
|
96
|
-
required: false,
|
|
97
|
-
maxLength: 48,
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
key: "trustBadge3",
|
|
101
|
-
label: "Trust badge 3 (optional)",
|
|
102
|
-
type: "text",
|
|
103
|
-
required: false,
|
|
104
|
-
maxLength: 48,
|
|
105
|
-
},
|
|
106
|
-
];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { SectionWriteCopy } from "../types";
|
|
2
|
-
import { humanize } from "@/lib/humanize";
|
|
3
|
-
import { firstSentence, virgilQuote } from "../copyHelpers";
|
|
4
|
-
|
|
5
|
-
export const writeCopy: SectionWriteCopy = (ctx) => {
|
|
6
|
-
const purpose = ctx.purpose ?? "";
|
|
7
|
-
const sentences = purpose.split(/(?<=[.!?])\s+/).filter(Boolean);
|
|
8
|
-
return {
|
|
9
|
-
headline: purpose
|
|
10
|
-
? virgilQuote(humanize(firstSentence(purpose)))
|
|
11
|
-
: virgilQuote("Website"),
|
|
12
|
-
// Second sentence of purpose if one exists; vibes drive palette/font,
|
|
13
|
-
// not copy.
|
|
14
|
-
sub: sentences.length > 1 ? sentences.slice(1).join(" ") : "",
|
|
15
|
-
ctaLabel: "Begin",
|
|
16
|
-
ctaHref: "#",
|
|
17
|
-
};
|
|
18
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { SectionProps } from "../types";
|
|
2
|
-
|
|
3
|
-
interface NavLink {
|
|
4
|
-
label: string;
|
|
5
|
-
href: string;
|
|
6
|
-
sectionId?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function parseNavLinks(json: string | undefined): NavLink[] {
|
|
10
|
-
if (!json) return [];
|
|
11
|
-
try {
|
|
12
|
-
const parsed = JSON.parse(json);
|
|
13
|
-
if (!Array.isArray(parsed)) return [];
|
|
14
|
-
return parsed.filter((l): l is NavLink => typeof l.label === 'string' && typeof l.href === 'string');
|
|
15
|
-
} catch {
|
|
16
|
-
return [];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function Component({ copy }: SectionProps) {
|
|
21
|
-
const wordmark = copy.wordmark ?? "";
|
|
22
|
-
const logoImage = copy.logoImage ?? "";
|
|
23
|
-
|
|
24
|
-
const links: NavLink[] = copy.navLinksJson
|
|
25
|
-
? parseNavLinks(copy.navLinksJson)
|
|
26
|
-
: [
|
|
27
|
-
{ label: copy.link1Label, href: copy.link1Href },
|
|
28
|
-
{ label: copy.link2Label, href: copy.link2Href },
|
|
29
|
-
{ label: copy.link3Label, href: copy.link3Href },
|
|
30
|
-
].filter((l): l is NavLink => !!(l.label && l.href));
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<nav className="site-navbar">
|
|
34
|
-
<a href="#" className="site-navbar-wordmark site-wordmark flex items-center gap-2">
|
|
35
|
-
{logoImage ? (
|
|
36
|
-
// eslint-disable-next-line @next/next/no-img-element
|
|
37
|
-
<img src={logoImage} alt={wordmark} className="site-navbar-logo w-auto object-contain" />
|
|
38
|
-
) : (
|
|
39
|
-
wordmark
|
|
40
|
-
)}
|
|
41
|
-
</a>
|
|
42
|
-
{links.length > 0 && (
|
|
43
|
-
<div className="site-navbar-links">
|
|
44
|
-
{links.map((l, i) => (
|
|
45
|
-
<a key={i} href={l.href}>
|
|
46
|
-
{l.label}
|
|
47
|
-
</a>
|
|
48
|
-
))}
|
|
49
|
-
</div>
|
|
50
|
-
)}
|
|
51
|
-
</nav>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Section } from "../types";
|
|
2
|
-
import { Component } from "./Component";
|
|
3
|
-
import { schema } from "./schema";
|
|
4
|
-
import { meta } from "./meta";
|
|
5
|
-
import { writeCopy } from "./writeCopy";
|
|
6
|
-
|
|
7
|
-
export const navbar: Section = { meta, schema, Component, writeCopy };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { SectionCopySchemaField } from "../types";
|
|
2
|
-
|
|
3
|
-
export const schema: SectionCopySchemaField[] = [
|
|
4
|
-
{
|
|
5
|
-
key: "wordmark",
|
|
6
|
-
label: "Wordmark",
|
|
7
|
-
type: "text",
|
|
8
|
-
placeholder: "your name",
|
|
9
|
-
required: true,
|
|
10
|
-
maxLength: 40,
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
key: "logoImage",
|
|
14
|
-
label: "Logo image",
|
|
15
|
-
type: "image",
|
|
16
|
-
required: false,
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
key: "link1Label",
|
|
20
|
-
label: "Link 1 label",
|
|
21
|
-
type: "text",
|
|
22
|
-
required: false,
|
|
23
|
-
maxLength: 24,
|
|
24
|
-
},
|
|
25
|
-
{ key: "link1Href", label: "Link 1 href", type: "text", required: false },
|
|
26
|
-
{
|
|
27
|
-
key: "link2Label",
|
|
28
|
-
label: "Link 2 label",
|
|
29
|
-
type: "text",
|
|
30
|
-
required: false,
|
|
31
|
-
maxLength: 24,
|
|
32
|
-
},
|
|
33
|
-
{ key: "link2Href", label: "Link 2 href", type: "text", required: false },
|
|
34
|
-
{
|
|
35
|
-
key: "link3Label",
|
|
36
|
-
label: "Link 3 label",
|
|
37
|
-
type: "text",
|
|
38
|
-
required: false,
|
|
39
|
-
maxLength: 24,
|
|
40
|
-
},
|
|
41
|
-
{ key: "link3Href", label: "Link 3 href", type: "text", required: false },
|
|
42
|
-
{
|
|
43
|
-
key: "navLinksJson",
|
|
44
|
-
label: "Nav links (JSON array — overrides link 1–3)",
|
|
45
|
-
type: "textarea",
|
|
46
|
-
placeholder: '[{"label":"About","href":"#about"}]',
|
|
47
|
-
required: false,
|
|
48
|
-
maxLength: 800,
|
|
49
|
-
},
|
|
50
|
-
];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { SectionWriteCopy } from "../types";
|
|
2
|
-
import { firstWord } from "../copyHelpers";
|
|
3
|
-
|
|
4
|
-
export const writeCopy: SectionWriteCopy = (ctx) => {
|
|
5
|
-
const fromPurpose = firstWord(ctx.purpose ?? "");
|
|
6
|
-
const fromHandle = ctx.handles?.[0]?.handle ?? "";
|
|
7
|
-
return {
|
|
8
|
-
wordmark: fromPurpose || fromHandle || "Acme",
|
|
9
|
-
link1Label: "About",
|
|
10
|
-
link1Href: "#about",
|
|
11
|
-
link2Label: "Services",
|
|
12
|
-
link2Href: "#services",
|
|
13
|
-
link3Label: "Contact",
|
|
14
|
-
link3Href: "#contact",
|
|
15
|
-
};
|
|
16
|
-
};
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import type { SectionProps } from "../types";
|
|
2
|
-
import { SiteButton } from "@/components/site/SiteButton";
|
|
3
|
-
import { SiteCard } from "@/components/site/SiteCard";
|
|
4
|
-
import { SiteSectionShell } from "@/components/site/SiteSectionShell";
|
|
5
|
-
import { sectionSurfaceStyle } from "@/lib/sectionSurface";
|
|
6
|
-
import { SITE_GRID_3 } from "../siteLayoutClasses";
|
|
7
|
-
import { cn } from "@/lib/utils";
|
|
8
|
-
|
|
9
|
-
interface Tier {
|
|
10
|
-
label: string;
|
|
11
|
-
price: string;
|
|
12
|
-
desc: string;
|
|
13
|
-
features: string[];
|
|
14
|
-
ctaLabel: string;
|
|
15
|
-
ctaHref: string;
|
|
16
|
-
badge?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function tierFrom(copy: Record<string, string>, n: 1 | 2 | 3): Tier {
|
|
20
|
-
return {
|
|
21
|
-
label: copy[`tier${n}Label`] ?? "",
|
|
22
|
-
price: copy[`tier${n}Price`] ?? "",
|
|
23
|
-
desc: copy[`tier${n}Desc`] ?? "",
|
|
24
|
-
features: (copy[`tier${n}Features`] ?? "")
|
|
25
|
-
.split("\n")
|
|
26
|
-
.map((f) => f.trim())
|
|
27
|
-
.filter(Boolean),
|
|
28
|
-
ctaLabel: copy[`tier${n}CtaLabel`] ?? "",
|
|
29
|
-
ctaHref: copy[`tier${n}CtaHref`] ?? "#",
|
|
30
|
-
badge: copy[`tier${n}Badge`] ?? "",
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function Component({ copy, layout }: SectionProps) {
|
|
35
|
-
const heading = copy.heading || "Pricing";
|
|
36
|
-
const highlightIndex = layout === "highlighted-middle" ? 1 : -1;
|
|
37
|
-
const checkIcon = copy.checkIcon?.trim() ?? "";
|
|
38
|
-
const tiers: Tier[] = [tierFrom(copy, 1), tierFrom(copy, 2), tierFrom(copy, 3)];
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<SiteSectionShell
|
|
42
|
-
eyebrow={heading}
|
|
43
|
-
className={cn(
|
|
44
|
-
"bg-[var(--section-bg,var(--background))] text-[var(--section-fg,var(--foreground))]",
|
|
45
|
-
)}
|
|
46
|
-
style={sectionSurfaceStyle(copy)}
|
|
47
|
-
>
|
|
48
|
-
<div className={`${SITE_GRID_3} gap-4 @lg/site:gap-6`}>
|
|
49
|
-
{tiers.map((t, i) => {
|
|
50
|
-
const highlighted = i === highlightIndex;
|
|
51
|
-
const badge =
|
|
52
|
-
highlighted && layout === "highlighted-middle"
|
|
53
|
-
? t.badge || "Most Popular"
|
|
54
|
-
: "";
|
|
55
|
-
return (
|
|
56
|
-
<SiteCard
|
|
57
|
-
key={i}
|
|
58
|
-
className={cn(
|
|
59
|
-
"relative gap-4",
|
|
60
|
-
highlighted &&
|
|
61
|
-
"border-2 border-[var(--accent)] shadow-[var(--shadow-md)]",
|
|
62
|
-
)}
|
|
63
|
-
>
|
|
64
|
-
{badge && (
|
|
65
|
-
<span className="absolute -top-3 left-1/2 -translate-x-1/2 whitespace-nowrap rounded-full bg-[var(--accent)] px-3 py-1 site-type-xs font-semibold text-[var(--accent-fg,var(--accent-foreground))]">
|
|
66
|
-
{badge}
|
|
67
|
-
</span>
|
|
68
|
-
)}
|
|
69
|
-
{t.label && (
|
|
70
|
-
<p className="site-type-xs uppercase tracking-[0.2em] text-[var(--muted-fg)]">
|
|
71
|
-
{t.label}
|
|
72
|
-
</p>
|
|
73
|
-
)}
|
|
74
|
-
<p className="site-type-stat font-bold text-[var(--foreground)]">
|
|
75
|
-
{t.price || "—"}
|
|
76
|
-
</p>
|
|
77
|
-
{t.desc && (
|
|
78
|
-
<p className="site-type-sm leading-relaxed text-[var(--muted-fg)]">
|
|
79
|
-
{t.desc}
|
|
80
|
-
</p>
|
|
81
|
-
)}
|
|
82
|
-
{t.features.length > 0 && (
|
|
83
|
-
<ul className="site-feature-checklist site-type-sm mt-1 flex flex-col gap-2.5 text-left text-[var(--muted-fg)]">
|
|
84
|
-
{t.features.map((f) => (
|
|
85
|
-
<li key={f} className="flex items-start gap-2.5">
|
|
86
|
-
{checkIcon ? (
|
|
87
|
-
/* eslint-disable-next-line @next/next/no-img-element */
|
|
88
|
-
<img
|
|
89
|
-
src={checkIcon}
|
|
90
|
-
alt=""
|
|
91
|
-
aria-hidden
|
|
92
|
-
className="mt-0.5 size-5 shrink-0"
|
|
93
|
-
/>
|
|
94
|
-
) : (
|
|
95
|
-
<span
|
|
96
|
-
className="mt-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-full border-2 border-[var(--foreground)] bg-[var(--muted)] text-[var(--accent)] text-[10px] font-bold leading-none"
|
|
97
|
-
aria-hidden
|
|
98
|
-
>
|
|
99
|
-
✓
|
|
100
|
-
</span>
|
|
101
|
-
)}
|
|
102
|
-
<span>{f}</span>
|
|
103
|
-
</li>
|
|
104
|
-
))}
|
|
105
|
-
</ul>
|
|
106
|
-
)}
|
|
107
|
-
{t.ctaLabel && (
|
|
108
|
-
<SiteButton
|
|
109
|
-
variant={highlighted ? "primary" : "secondary"}
|
|
110
|
-
href={t.ctaHref}
|
|
111
|
-
className="mt-auto"
|
|
112
|
-
{...(/^https?:\/\//.test(t.ctaHref)
|
|
113
|
-
? { target: "_blank", rel: "noopener noreferrer" }
|
|
114
|
-
: {})}
|
|
115
|
-
>
|
|
116
|
-
{t.ctaLabel}
|
|
117
|
-
</SiteButton>
|
|
118
|
-
)}
|
|
119
|
-
</SiteCard>
|
|
120
|
-
);
|
|
121
|
-
})}
|
|
122
|
-
</div>
|
|
123
|
-
</SiteSectionShell>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Section } from "../types";
|
|
2
|
-
import { Component } from "./Component";
|
|
3
|
-
import { schema } from "./schema";
|
|
4
|
-
import { meta } from "./meta";
|
|
5
|
-
import { writeCopy } from "./writeCopy";
|
|
6
|
-
|
|
7
|
-
export const pricing: Section = { meta, schema, Component, writeCopy };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { SectionMeta } from "../types";
|
|
2
|
-
|
|
3
|
-
export const meta: SectionMeta = {
|
|
4
|
-
id: "pricing",
|
|
5
|
-
displayName: "Pricing",
|
|
6
|
-
family: "content",
|
|
7
|
-
tags: ["pricing", "tiers", "saas", "product", "business", "subscription"],
|
|
8
|
-
layouts: [
|
|
9
|
-
{ id: "three-tier", label: "Three tier" },
|
|
10
|
-
{ id: "highlighted-middle", label: "Highlighted middle tier" },
|
|
11
|
-
],
|
|
12
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { SectionCopySchemaField } from "../types";
|
|
2
|
-
|
|
3
|
-
export const schema: SectionCopySchemaField[] = [
|
|
4
|
-
{ key: "heading", label: "Heading", type: "text", placeholder: '"Pricing"', maxLength: 60 },
|
|
5
|
-
{ key: "checkIcon", label: "Feature bullet icon (image URL, optional)", type: "text", maxLength: 200 },
|
|
6
|
-
// Tier 1
|
|
7
|
-
{ key: "tier1Label", label: "Tier 1 label", type: "text", maxLength: 40 },
|
|
8
|
-
{ key: "tier1Price", label: "Tier 1 price", type: "text", maxLength: 20 },
|
|
9
|
-
{ key: "tier1Desc", label: "Tier 1 description", type: "textarea", maxLength: 120 },
|
|
10
|
-
{ key: "tier1Features", label: "Tier 1 features (one per line)", type: "textarea", maxLength: 300 },
|
|
11
|
-
{ key: "tier1CtaLabel", label: "Tier 1 CTA label", type: "text", maxLength: 30 },
|
|
12
|
-
// Tier 2
|
|
13
|
-
{ key: "tier2Label", label: "Tier 2 label", type: "text", maxLength: 40 },
|
|
14
|
-
{ key: "tier2Price", label: "Tier 2 price", type: "text", maxLength: 20 },
|
|
15
|
-
{ key: "tier2Desc", label: "Tier 2 description", type: "textarea", maxLength: 120 },
|
|
16
|
-
{ key: "tier2Features", label: "Tier 2 features (one per line)", type: "textarea", maxLength: 300 },
|
|
17
|
-
{ key: "tier2CtaLabel", label: "Tier 2 CTA label", type: "text", maxLength: 30 },
|
|
18
|
-
{ key: "tier2Badge", label: "Tier 2 badge (optional)", type: "text", placeholder: "Most Popular", maxLength: 30 },
|
|
19
|
-
// Tier 3
|
|
20
|
-
{ key: "tier3Label", label: "Tier 3 label", type: "text", maxLength: 40 },
|
|
21
|
-
{ key: "tier3Price", label: "Tier 3 price", type: "text", maxLength: 20 },
|
|
22
|
-
{ key: "tier3Desc", label: "Tier 3 description", type: "textarea", maxLength: 120 },
|
|
23
|
-
{ key: "tier3Features", label: "Tier 3 features (one per line)", type: "textarea", maxLength: 300 },
|
|
24
|
-
{ key: "tier3CtaLabel", label: "Tier 3 CTA label", type: "text", maxLength: 30 },
|
|
25
|
-
];
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { SectionWriteCopy } from "../types";
|
|
2
|
-
import { virgilQuote } from "../copyHelpers";
|
|
3
|
-
|
|
4
|
-
export const writeCopy: SectionWriteCopy = () => {
|
|
5
|
-
// Pricing is empty by default — the user edits post-generation.
|
|
6
|
-
// We return deterministic tier labels + blank prices/descriptions/CTAs.
|
|
7
|
-
return {
|
|
8
|
-
heading: virgilQuote("Pricing"),
|
|
9
|
-
tier1Label: "Starter",
|
|
10
|
-
tier1Price: "",
|
|
11
|
-
tier1Desc: "",
|
|
12
|
-
tier1CtaLabel: "",
|
|
13
|
-
tier2Label: "Pro",
|
|
14
|
-
tier2Price: "",
|
|
15
|
-
tier2Desc: "",
|
|
16
|
-
tier2CtaLabel: "",
|
|
17
|
-
tier3Label: "Enterprise",
|
|
18
|
-
tier3Price: "",
|
|
19
|
-
tier3Desc: "",
|
|
20
|
-
tier3CtaLabel: "",
|
|
21
|
-
};
|
|
22
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Responsive layout classes keyed to the SiteSurface container (@container/site).
|
|
3
|
-
* Avoid @sm/site (384px) for multi-column — mobile previews (~390px) would never stack.
|
|
4
|
-
*/
|
|
5
|
-
export const SITE_GRID_2 = "grid grid-cols-1 @md/site:grid-cols-2";
|
|
6
|
-
export const SITE_GRID_3 = "grid grid-cols-1 @lg/site:grid-cols-3";
|
|
7
|
-
export const SITE_GRID_4 = "grid grid-cols-1 @md/site:grid-cols-2 @xl/site:grid-cols-4";
|
|
8
|
-
export const SITE_STACK_ROW = "flex flex-col @md/site:flex-row";
|
|
9
|
-
export const SITE_STACK = "flex flex-col gap-8";
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import type { ComponentType, ReactElement, ReactNode } from "react";
|
|
2
|
-
import type { BrandContext } from "@/lib/brandContext";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* One copy slot in a section. Section schemas declare their slots using
|
|
6
|
-
* just the slot key (e.g. "headline") — the full Site.copy key becomes
|
|
7
|
-
* `{instanceId}.{slotKey}` once the section is instantiated in a composition.
|
|
8
|
-
*/
|
|
9
|
-
export interface SectionCopySchemaField {
|
|
10
|
-
key: string;
|
|
11
|
-
label: string;
|
|
12
|
-
type: "text" | "textarea" | "list" | "items" | "image" | "link" | "videoEmbed" | "iframeEmbed" | "codeBlock" | "file";
|
|
13
|
-
placeholder?: string;
|
|
14
|
-
helpText?: string;
|
|
15
|
-
required?: boolean;
|
|
16
|
-
maxLength?: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Sections carry tags reserved for the future Feedback-Loop tier (Zero-Point ignores them).
|
|
21
|
-
*/
|
|
22
|
-
export type SectionFamily =
|
|
23
|
-
| "hero"
|
|
24
|
-
| "content"
|
|
25
|
-
| "footer"
|
|
26
|
-
| "navbar"
|
|
27
|
-
| "links"
|
|
28
|
-
| "posts"
|
|
29
|
-
| "contact"
|
|
30
|
-
| "feed"
|
|
31
|
-
| "structure"
|
|
32
|
-
| "component";
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Library bucket — the top-level grouping the component/widget library and the
|
|
36
|
-
* builder add panel read. Defaults are derived from id/family by
|
|
37
|
-
* `resolveComponentBucket`; set `bucket` on meta only to override the default.
|
|
38
|
-
*/
|
|
39
|
-
export type ComponentBucket =
|
|
40
|
-
| "contact-card"
|
|
41
|
-
| "navigation"
|
|
42
|
-
| "widget"
|
|
43
|
-
| "section"
|
|
44
|
-
| "structure"
|
|
45
|
-
| "atom";
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Bento sizing hint. aspect = "w:h" preview ratio; spans in grid columns (1..4).
|
|
49
|
-
* renderWidth — effective viewport px the section previews at (default 1200).
|
|
50
|
-
* Narrower values zoom in; useful for nav bars and contact cards that read better
|
|
51
|
-
* at tablet/mobile viewport than at full desktop scale.
|
|
52
|
-
*/
|
|
53
|
-
export interface WidgetFootprint {
|
|
54
|
-
aspect: string;
|
|
55
|
-
spanIdeal: number;
|
|
56
|
-
spanMin: number;
|
|
57
|
-
spanMax: number;
|
|
58
|
-
renderWidth?: number;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/** Pattern variant id per section — persisted on `SectionInstance.layout` (e.g. `inset-card`). */
|
|
62
|
-
export interface SectionLayout {
|
|
63
|
-
id: string;
|
|
64
|
-
label: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface SectionMeta {
|
|
68
|
-
id: string;
|
|
69
|
-
displayName: string;
|
|
70
|
-
family: SectionFamily;
|
|
71
|
-
tags: string[];
|
|
72
|
-
layouts?: SectionLayout[];
|
|
73
|
-
bucket?: ComponentBucket;
|
|
74
|
-
footprint?: WidgetFootprint;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Props every section component receives. `copy` already has the instance
|
|
79
|
-
* prefix stripped — slots are keyed by their schema key.
|
|
80
|
-
* Sections style using nertia's design-system CSS vars (var(--foreground),
|
|
81
|
-
* var(--background), var(--accent), etc.) — the hosted site wrapper injects
|
|
82
|
-
* the user's brand color as --accent; dark/light mode cascades from globals.
|
|
83
|
-
*/
|
|
84
|
-
export interface SectionProps {
|
|
85
|
-
copy: Record<string, string>;
|
|
86
|
-
/** Set on hosted pages for live feed sections (Phase 2). */
|
|
87
|
-
siteSlug?: string;
|
|
88
|
-
/** Section instance id — used for contact form submissions. */
|
|
89
|
-
instanceId?: string;
|
|
90
|
-
layout?: string;
|
|
91
|
-
/** Marketing hero only — fills the main column below the navbar. */
|
|
92
|
-
fullHeight?: boolean;
|
|
93
|
-
/** Nested blocks rendered inside layout shells. */
|
|
94
|
-
slotContent?: ReactNode;
|
|
95
|
-
/** Builder-only — open insert drawer on a tab (layout shells). */
|
|
96
|
-
builderInsert?: {
|
|
97
|
-
openTab: (tab: 'structure' | 'components') => void;
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Pure function producing this section's copy from a BrandContext.
|
|
103
|
-
* Keys are slot names (same as SectionCopySchemaField.key). No LLM.
|
|
104
|
-
* Each section owns its voice — `lib/writeCopy.ts` orchestrates across a
|
|
105
|
-
* composition by calling this per-instance and prefixing keys.
|
|
106
|
-
*/
|
|
107
|
-
export type SectionWriteCopy = (ctx: BrandContext) => Record<string, string>;
|
|
108
|
-
|
|
109
|
-
export type SectionComponentFn =
|
|
110
|
-
| ComponentType<SectionProps>
|
|
111
|
-
| ((props: SectionProps) => Promise<ReactElement>);
|
|
112
|
-
|
|
113
|
-
/** Everything a section exports. Registered by `src/sections/index.ts`. */
|
|
114
|
-
export interface Section {
|
|
115
|
-
meta: SectionMeta;
|
|
116
|
-
schema: SectionCopySchemaField[];
|
|
117
|
-
Component: SectionComponentFn;
|
|
118
|
-
writeCopy: SectionWriteCopy;
|
|
119
|
-
}
|