@luhtech/site-template 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/LICENSE +201 -0
- package/README.md +135 -0
- package/bin/luhtech-page-claims.mjs +162 -0
- package/bin/luhtech-page-lexicon.mjs +126 -0
- package/bin/luhtech-tokens.mjs +110 -0
- package/package.json +50 -0
- package/src/components/Block.astro +37 -0
- package/src/components/CrossLink.astro +18 -0
- package/src/components/CtaLink.astro +17 -0
- package/src/components/Figure.astro +23 -0
- package/src/components/Icon.astro +56 -0
- package/src/components/LeadCaptureForm.astro +108 -0
- package/src/components/Section.astro +48 -0
- package/src/components/sections/Approach.astro +13 -0
- package/src/components/sections/Audiences.astro +24 -0
- package/src/components/sections/Cta.astro +36 -0
- package/src/components/sections/Hero.astro +18 -0
- package/src/components/sections/Legal.astro +11 -0
- package/src/components/sections/Open.astro +21 -0
- package/src/components/sections/Problem.astro +14 -0
- package/src/components/sections/Proof.astro +28 -0
- package/src/components/sections/Sources.astro +17 -0
- package/src/components/sections/Status.astro +15 -0
- package/src/content/_vendored-schema-fallback/capability-claim.schema.json +91 -0
- package/src/content/bindBrand.ts +62 -0
- package/src/content/index.ts +7 -0
- package/src/content/loadBrand.ts +60 -0
- package/src/content/loadPage.ts +61 -0
- package/src/content/loadSite.ts +55 -0
- package/src/content/schemaFetch.ts +70 -0
- package/src/layouts/SiteLayout.astro +107 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Generates tokens.generated.css from a brand-identity.schema.json instance.
|
|
4
|
+
* Moved into @luhtech/site-template from the per-repo generate-tokens.mjs
|
|
5
|
+
* scripts (Ectropy-Business, LuhTech-Business, Replique, ...) it replaces --
|
|
6
|
+
* same real logic, generalized to take instance/output paths as CLI args
|
|
7
|
+
* instead of assuming one repo's directory layout.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* luhtech-tokens <path-to-brand-identity.json> <output-css-path>
|
|
11
|
+
* luhtech-tokens content/brand/ectropy.json src/styles/tokens.generated.css
|
|
12
|
+
*/
|
|
13
|
+
import { readFileSync, writeFileSync, mkdirSync } from 'node:fs';
|
|
14
|
+
import { dirname, resolve } from 'node:path';
|
|
15
|
+
import Ajv from 'ajv';
|
|
16
|
+
import addFormats from 'ajv-formats';
|
|
17
|
+
|
|
18
|
+
const SCHEMA_BASE = 'https://schemas.luh.tech';
|
|
19
|
+
const SCHEMA_REFS = [
|
|
20
|
+
'portfolio/brand-identity.schema.json',
|
|
21
|
+
'_enums/luhtech-enums.schema.v2.json',
|
|
22
|
+
'_enums/venture.enum.json',
|
|
23
|
+
'_definitions/definitions.schema.json',
|
|
24
|
+
'_definitions/graph.schema.json',
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
const [, , instanceArg, outputArg] = process.argv;
|
|
28
|
+
if (!instanceArg || !outputArg) {
|
|
29
|
+
console.error('Usage: luhtech-tokens <path-to-brand-identity.json> <output-css-path>');
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
const instancePath = resolve(process.cwd(), instanceArg);
|
|
33
|
+
const outputPath = resolve(process.cwd(), outputArg);
|
|
34
|
+
|
|
35
|
+
async function fetchSchema(rel) {
|
|
36
|
+
const url = `${SCHEMA_BASE}/${rel}`;
|
|
37
|
+
const res = await fetch(url);
|
|
38
|
+
if (!res.ok) {
|
|
39
|
+
throw new Error(`Failed to fetch canonical schema ${url}: HTTP ${res.status}.`);
|
|
40
|
+
}
|
|
41
|
+
return res.json();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function readInstance(path) {
|
|
45
|
+
let raw;
|
|
46
|
+
try {
|
|
47
|
+
raw = readFileSync(path, 'utf-8');
|
|
48
|
+
} catch {
|
|
49
|
+
throw new Error(`No brand-identity instance at ${path}.`);
|
|
50
|
+
}
|
|
51
|
+
return JSON.parse(raw);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function cssColor(colorValue) {
|
|
55
|
+
return colorValue.oklch;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function fontStack(fontRef, fallback) {
|
|
59
|
+
return `"${fontRef.family}", ${fallback}`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function generateCss(brand) {
|
|
63
|
+
const { color, identity, brandId, typography } = brand;
|
|
64
|
+
return `/* GENERATED by luhtech-tokens (@luhtech/site-template) from ${instanceArg} -- DO NOT HAND-EDIT.
|
|
65
|
+
* Source brand: ${brandId} (${identity.name})
|
|
66
|
+
* Regenerated on every predev/prebuild. Edit the brand-identity JSON instance instead.
|
|
67
|
+
*/
|
|
68
|
+
@theme {
|
|
69
|
+
--color-ink: ${cssColor(color.foundation.ink)};
|
|
70
|
+
--color-canvas: ${cssColor(color.foundation.canvas)};
|
|
71
|
+
--color-accent-primary: ${cssColor(color.accent.primary)};
|
|
72
|
+
${color.accent.secondary ? ` --color-accent-secondary: ${cssColor(color.accent.secondary)};\n` : ''}
|
|
73
|
+
--font-display: ${fontStack(typography.display, 'sans-serif')};
|
|
74
|
+
--font-body: ${fontStack(typography.body, 'sans-serif')};
|
|
75
|
+
--font-mono: ${fontStack(typography.mono, 'monospace')};
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async function main() {
|
|
81
|
+
const ajv = new Ajv({ strict: false, allErrors: true });
|
|
82
|
+
addFormats(ajv);
|
|
83
|
+
|
|
84
|
+
const [brandIdentitySchema, ...refs] = await Promise.all(SCHEMA_REFS.map(fetchSchema));
|
|
85
|
+
for (const ref of refs) {
|
|
86
|
+
ajv.addSchema(ref);
|
|
87
|
+
}
|
|
88
|
+
const validate = ajv.compile(brandIdentitySchema);
|
|
89
|
+
|
|
90
|
+
const brand = readInstance(instancePath);
|
|
91
|
+
|
|
92
|
+
if (!validate(brand)) {
|
|
93
|
+
const detail = (validate.errors ?? [])
|
|
94
|
+
.map((e) => `${e.instancePath || '(root)'}: ${e.message}`)
|
|
95
|
+
.join('; ');
|
|
96
|
+
throw new Error(
|
|
97
|
+
`${instancePath} failed validation against portfolio/brand-identity.schema.json: ${detail}`
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const css = generateCss(brand);
|
|
102
|
+
mkdirSync(dirname(outputPath), { recursive: true });
|
|
103
|
+
writeFileSync(outputPath, css, 'utf-8');
|
|
104
|
+
console.log(`Generated ${outputPath} from ${instancePath} (brandId: ${brand.brandId})`);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
main().catch((err) => {
|
|
108
|
+
console.error(`luhtech-tokens failed: ${err.message}`);
|
|
109
|
+
process.exit(1);
|
|
110
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@luhtech/site-template",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Shared Astro component library + content-instance contract for LuhTech venture marketing sites -- one template renders every site from content/page.schema.json + content/site.schema.json instances.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"author": "LuhTech Holdings",
|
|
8
|
+
"repository": "github:luh-tech/site-template",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"registry": "https://registry.npmjs.org",
|
|
11
|
+
"access": "public",
|
|
12
|
+
"provenance": true
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"src",
|
|
16
|
+
"bin",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"exports": {
|
|
21
|
+
"./content": "./src/content/index.ts",
|
|
22
|
+
"./layouts/SiteLayout.astro": "./src/layouts/SiteLayout.astro",
|
|
23
|
+
"./components/*": "./src/components/*",
|
|
24
|
+
"./components/sections/*": "./src/components/sections/*"
|
|
25
|
+
},
|
|
26
|
+
"bin": {
|
|
27
|
+
"luhtech-tokens": "./bin/luhtech-tokens.mjs",
|
|
28
|
+
"luhtech-page-lexicon": "./bin/luhtech-page-lexicon.mjs",
|
|
29
|
+
"luhtech-page-claims": "./bin/luhtech-page-claims.mjs"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"test": "node --test test/*.test.mjs"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"astro": "^7.2",
|
|
36
|
+
"tailwindcss": "^4"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"ajv": "^8.17.1",
|
|
40
|
+
"ajv-formats": "^3.0.1"
|
|
41
|
+
},
|
|
42
|
+
"luhtech": {
|
|
43
|
+
"schemaPins": {
|
|
44
|
+
"content/page.schema.json": "1.0.0",
|
|
45
|
+
"content/site.schema.json": "1.0.0",
|
|
46
|
+
"content/capability-claim.schema.json": "0.2.0",
|
|
47
|
+
"portfolio/brand-identity.schema.json": "1.2.0"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Renders one page.schema.json block by blockType. "text" is markdown-safe
|
|
3
|
+
// per the schema's own description -- kept as plain text here (no markdown
|
|
4
|
+
// parser dependency); a consumer site that needs real markdown rendering
|
|
5
|
+
// wraps this or replaces it, the contract only requires blockType/text/label.
|
|
6
|
+
export interface Props {
|
|
7
|
+
block: { blockType: string; text: string; label?: string };
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
const { block, class: className = '' } = Astro.props;
|
|
11
|
+
const items = block.blockType === 'list' ? block.text.split('\n').filter(Boolean) : [];
|
|
12
|
+
---
|
|
13
|
+
{block.blockType === 'paragraph' && (
|
|
14
|
+
<div class={className}>
|
|
15
|
+
{block.label && <p class="font-display font-semibold text-accent-secondary mb-1">{block.label}</p>}
|
|
16
|
+
<p class="leading-relaxed">{block.text}</p>
|
|
17
|
+
</div>
|
|
18
|
+
)}
|
|
19
|
+
{block.blockType === 'lede' && <p class={`text-lg leading-relaxed ${className}`}>{block.text}</p>}
|
|
20
|
+
{block.blockType === 'pullquote' && (
|
|
21
|
+
<blockquote class={`border-l-4 border-accent-primary pl-4 italic text-lg ${className}`}>{block.text}</blockquote>
|
|
22
|
+
)}
|
|
23
|
+
{block.blockType === 'definition' && (
|
|
24
|
+
<div class={className}>
|
|
25
|
+
{block.label && <dt class="font-semibold">{block.label}</dt>}
|
|
26
|
+
<dd class="leading-relaxed">{block.text}</dd>
|
|
27
|
+
</div>
|
|
28
|
+
)}
|
|
29
|
+
{block.blockType === 'caption' && <p class={`text-sm text-ink/60 ${className}`}>{block.text}</p>}
|
|
30
|
+
{block.blockType === 'list' && (
|
|
31
|
+
<div class={className}>
|
|
32
|
+
{block.label && <p class="font-display font-semibold mb-1">{block.label}</p>}
|
|
33
|
+
<ul class="list-disc list-inside space-y-1">
|
|
34
|
+
{items.map((item) => <li>{item}</li>)}
|
|
35
|
+
</ul>
|
|
36
|
+
</div>
|
|
37
|
+
)}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Renders one page.schema.json crossLink -- the only schema-legal way a
|
|
3
|
+
// section may name a sibling brand (RULE-CONTENT-PAGE-LEXICON-PROHIBITED-1
|
|
4
|
+
// exempts crossLinks from the bare-sibling-name check for exactly this
|
|
5
|
+
// reason: the relationshipLine is authored text stating the real
|
|
6
|
+
// relationship, not an incidental mention).
|
|
7
|
+
export interface Props {
|
|
8
|
+
crossLink: { brandRef: string; relationshipLine: string; href: string };
|
|
9
|
+
}
|
|
10
|
+
const { crossLink } = Astro.props;
|
|
11
|
+
---
|
|
12
|
+
<a
|
|
13
|
+
href={crossLink.href}
|
|
14
|
+
class="block rounded-md border border-ink/15 p-4 hover:border-accent-primary transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-primary"
|
|
15
|
+
>
|
|
16
|
+
<span class="font-display font-semibold">{crossLink.brandRef}</span>
|
|
17
|
+
<p class="text-sm text-ink/70 mt-1">{crossLink.relationshipLine}</p>
|
|
18
|
+
</a>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Renders one page.schema.json cta {label, href, intent}. mailto: is
|
|
3
|
+
// rejected by the schema's own href pattern before this ever renders.
|
|
4
|
+
export interface Props {
|
|
5
|
+
cta: { label: string; href: string; intent: string };
|
|
6
|
+
variant?: 'primary' | 'secondary';
|
|
7
|
+
}
|
|
8
|
+
const { cta, variant = 'primary' } = Astro.props;
|
|
9
|
+
const classes =
|
|
10
|
+
variant === 'primary'
|
|
11
|
+
? 'px-5 py-2.5 rounded-md bg-accent-primary text-canvas font-medium transition-all duration-200 hover:opacity-90 hover:shadow-lg hover:-translate-y-0.5 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-secondary focus-visible:rounded'
|
|
12
|
+
: 'px-5 py-2.5 rounded-md border border-ink/20 text-ink font-medium transition-all duration-200 hover:border-ink/40 hover:-translate-y-0.5 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-secondary focus-visible:rounded';
|
|
13
|
+
const isExternal = cta.intent === 'external' || cta.href.startsWith('https://');
|
|
14
|
+
---
|
|
15
|
+
<a href={cta.href} class={classes} target={isExternal ? '_blank' : undefined} rel={isExternal ? 'noopener noreferrer' : undefined}>
|
|
16
|
+
{cta.label}
|
|
17
|
+
</a>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Renders one page.schema.json figure with its provenance.sourceRef --
|
|
3
|
+
// provenance.public must be true (schema const), so every figure that
|
|
4
|
+
// reaches this component is already cleared to appear on a public page.
|
|
5
|
+
export interface Props {
|
|
6
|
+
figure: {
|
|
7
|
+
figureId: string;
|
|
8
|
+
value: string;
|
|
9
|
+
unit?: string;
|
|
10
|
+
provenance: { sourceRef: string; observedAt?: string };
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
const { figure } = Astro.props;
|
|
14
|
+
---
|
|
15
|
+
<div class="flex flex-col gap-1" id={figure.figureId}>
|
|
16
|
+
<span class="font-display text-3xl font-bold">
|
|
17
|
+
{figure.value}{figure.unit && <span class="text-lg font-normal ml-1">{figure.unit}</span>}
|
|
18
|
+
</span>
|
|
19
|
+
<span class="text-xs text-ink/60">
|
|
20
|
+
{figure.provenance.sourceRef}
|
|
21
|
+
{figure.provenance.observedAt && ` (${figure.provenance.observedAt})`}
|
|
22
|
+
</span>
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
// ARC-GTM-SURFACE D2.2: shared line-icon grammar (24x24, stroke-based, rounded
|
|
3
|
+
// caps/joins). Registered brand-side as iconSetRef.iconSetId =
|
|
4
|
+
// "gtm-surface-line-icons-v1" -- a shared-set identifier (brand-identity
|
|
5
|
+
// schema's own alternative to a per-brand asset-bank upload), since this set
|
|
6
|
+
// is common across the portfolio rather than brand-specific. Copied verbatim
|
|
7
|
+
// from luh-tech/LuhTech-Business's own Icon.astro -- keep this file in sync
|
|
8
|
+
// if the shared set grows.
|
|
9
|
+
const ICONS: Record<string, string> = {
|
|
10
|
+
'voxel-grid': `<rect x="3" y="3" width="8" height="8" rx="1.5"/><rect x="13" y="3" width="8" height="8" rx="1.5"/><rect x="3" y="13" width="8" height="8" rx="1.5"/><rect x="13" y="13" width="8" height="8" rx="1.5"/>`,
|
|
11
|
+
'location-pin': `<path d="M12 21s7-6.5 7-12a7 7 0 1 0-14 0c0 5.5 7 12 7 12z"/><circle cx="12" cy="9" r="2.25"/>`,
|
|
12
|
+
'decision-chain': `<circle cx="7" cy="7" r="4"/><path d="M5.5 7l1.25 1.25L9.5 5.5"/><circle cx="17" cy="17" r="4"/><path d="M15.5 17l1.25 1.25 2.75-2.75"/><path d="M10.5 9.5l3 3"/>`,
|
|
13
|
+
'cost-tag': `<path d="M3 12l8.5-8.5a2 2 0 0 1 1.5-.5H19a2 2 0 0 1 2 2v6a2 2 0 0 1-.5 1.5L12 21a2 2 0 0 1-3 0l-6-6a2 2 0 0 1 0-3z"/><circle cx="16" cy="8" r="1.25" fill="currentColor" stroke="none"/>`,
|
|
14
|
+
'field-inspection': `<rect x="5" y="4" width="14" height="17" rx="2"/><rect x="9" y="2.5" width="6" height="3" rx="1"/><path d="M9 12.5l2 2 4-4.5"/><line x1="8" y1="17" x2="16" y2="17"/>`,
|
|
15
|
+
'schema-doc': `<path d="M6 3h9l4 4v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"/><path d="M15 3v4h4"/><path d="M9.5 13l-1.5 1.5 1.5 1.5"/><path d="M14.5 13l1.5 1.5-1.5 1.5"/>`,
|
|
16
|
+
'integration-plug': `<rect x="3" y="9" width="7" height="6" rx="1.5"/><rect x="14" y="9" width="7" height="6" rx="1.5"/><line x1="10" y1="12" x2="14" y2="12"/><line x1="6" y1="7" x2="6" y2="9"/><line x1="6" y1="15" x2="6" y2="17"/>`,
|
|
17
|
+
'sync-loop': `<path d="M4 12a8 8 0 0 1 14-5.3L21 9"/><path d="M21 4v5h-5"/><path d="M20 12a8 8 0 0 1-14 5.3L3 15"/><path d="M3 20v-5h5"/>`,
|
|
18
|
+
'hard-hat': `<path d="M4 16a8 8 0 0 1 16 0"/><rect x="2.5" y="16" width="19" height="3" rx="1.5"/><line x1="12" y1="6" x2="12" y2="8"/>`,
|
|
19
|
+
'building': `<rect x="5" y="3" width="14" height="18" rx="1"/><circle cx="9" cy="7" r="0.9" fill="currentColor" stroke="none"/><circle cx="15" cy="7" r="0.9" fill="currentColor" stroke="none"/><circle cx="9" cy="11" r="0.9" fill="currentColor" stroke="none"/><circle cx="15" cy="11" r="0.9" fill="currentColor" stroke="none"/><circle cx="9" cy="15" r="0.9" fill="currentColor" stroke="none"/><circle cx="15" cy="15" r="0.9" fill="currentColor" stroke="none"/>`,
|
|
20
|
+
'field-team': `<circle cx="10" cy="8" r="3.25"/><path d="M4 20.5c0-3.6 2.7-6.2 6-6.2s6 2.6 6 6.2"/><path d="M18.5 4.5a2.5 2.5 0 0 0-2.5 2.5c0 2.1 2.5 4.3 2.5 4.3s2.5-2.2 2.5-4.3a2.5 2.5 0 0 0-2.5-2.5z"/>`,
|
|
21
|
+
'zone-map': `<rect x="3" y="3" width="18" height="18" rx="1.5"/><line x1="3" y1="9" x2="21" y2="9"/><line x1="3" y1="15" x2="21" y2="15"/><line x1="9" y1="3" x2="9" y2="21"/><line x1="15" y1="3" x2="15" y2="21"/><rect x="9.5" y="9.5" width="5" height="5" rx="0.75" fill="currentColor" stroke="none" opacity="0.35"/>`,
|
|
22
|
+
'audit-trail': `<line x1="5" y1="4" x2="5" y2="20"/><circle cx="5" cy="4" r="1.5" fill="currentColor" stroke="none"/><circle cx="5" cy="12" r="1.5" fill="currentColor" stroke="none"/><circle cx="5" cy="20" r="1.5" fill="currentColor" stroke="none"/><line x1="10" y1="4" x2="20" y2="4"/><line x1="10" y1="12" x2="20" y2="12"/><line x1="10" y1="20" x2="20" y2="20"/>`,
|
|
23
|
+
'change-order': `<path d="M6 3h8l4 4v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"/><path d="M14 3v4h4"/><path d="M8 14h8"/><path d="M13 11l3 3-3 3"/>`,
|
|
24
|
+
'studio-compass': `<circle cx="12" cy="12" r="9"/><path d="M12 12l4-7"/><path d="M12 12l-2 8"/><circle cx="12" cy="12" r="1.25" fill="currentColor" stroke="none"/>`,
|
|
25
|
+
'portfolio-grid': `<circle cx="7" cy="7" r="4"/><circle cx="17" cy="7" r="4"/><circle cx="7" cy="17" r="4"/><circle cx="17" cy="17" r="4"/>`,
|
|
26
|
+
'code-bracket': `<path d="M8 5L3 12l5 7"/><path d="M16 5l5 7-5 7"/>`,
|
|
27
|
+
'team-people': `<circle cx="9" cy="8" r="3.25"/><path d="M3.5 20c0-3.6 2.5-6 5.5-6s5.5 2.4 5.5 6"/><circle cx="17" cy="9" r="2.5"/><path d="M14.5 20c0-2.8 1.7-5 4-5"/>`,
|
|
28
|
+
'crane': `<line x1="5" y1="21" x2="5" y2="6"/><line x1="5" y1="6" x2="19" y2="6"/><line x1="16" y1="6" x2="16" y2="3"/><line x1="16" y1="10" x2="19" y2="6"/><line x1="16" y1="10" x2="13" y2="6"/><line x1="16" y1="10" x2="16" y2="15"/><line x1="2" y1="21" x2="9" y2="21"/>`,
|
|
29
|
+
'handshake': `<path d="M2 11l5-3 3 1.5"/><path d="M22 11l-5-3-3 1.5"/><path d="M10 9.5l2 1.2 2-1.2"/><path d="M7 14.5l2.5 2.5a1.7 1.7 0 0 0 2.4 0"/><path d="M17 14.5l-2.5 2.5a1.7 1.7 0 0 1-2.4 0"/>`,
|
|
30
|
+
'rocket': `<path d="M12 2c3 2 4.5 5.5 4.5 9.5 0 2-.5 4-1.5 5.5h-6c-1-1.5-1.5-3.5-1.5-5.5C7.5 7.5 9 4 12 2z"/><circle cx="12" cy="10" r="1.5"/><path d="M9 16l-2.5 4.5"/><path d="M15 16l2.5 4.5"/><path d="M10.5 17.5h3l-1.5 3.5z"/>`,
|
|
31
|
+
'data-flow': `<circle cx="5" cy="6" r="2"/><circle cx="19" cy="6" r="2"/><circle cx="12" cy="14" r="2"/><circle cx="5" cy="20" r="2"/><circle cx="19" cy="20" r="2"/><line x1="6.5" y1="7.5" x2="10.5" y2="12.5"/><line x1="17.5" y1="7.5" x2="13.5" y2="12.5"/><line x1="10.5" y1="15.5" x2="6.5" y2="18.5"/><line x1="13.5" y1="15.5" x2="17.5" y2="18.5"/>`,
|
|
32
|
+
'mail-envelope': `<rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3.5 6.5L12 13l8.5-6.5"/>`,
|
|
33
|
+
'message-bubble': `<path d="M4 5h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H9l-5 4v-4H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z"/><line x1="7" y1="9" x2="17" y2="9"/><line x1="7" y1="12.5" x2="14" y2="12.5"/>`,
|
|
34
|
+
'external-link': `<path d="M7 17L17 7"/><path d="M8 7h9v9"/>`,
|
|
35
|
+
'lock': `<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V7a4 4 0 1 1 8 0v4"/><circle cx="12" cy="16" r="1.25" fill="currentColor" stroke="none"/>`,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export interface Props {
|
|
39
|
+
name: keyof typeof ICONS;
|
|
40
|
+
class?: string;
|
|
41
|
+
}
|
|
42
|
+
const { name, class: className = 'w-6 h-6' } = Astro.props;
|
|
43
|
+
const inner = ICONS[name] ?? '';
|
|
44
|
+
---
|
|
45
|
+
<svg
|
|
46
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
47
|
+
viewBox="0 0 24 24"
|
|
48
|
+
fill="none"
|
|
49
|
+
stroke="currentColor"
|
|
50
|
+
stroke-width="1.75"
|
|
51
|
+
stroke-linecap="round"
|
|
52
|
+
stroke-linejoin="round"
|
|
53
|
+
class={className}
|
|
54
|
+
aria-hidden="true"
|
|
55
|
+
set:html={inner}
|
|
56
|
+
/>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Parameterises Replique's own contact form/script (the L1 fixture pattern)
|
|
3
|
+
// off site.leadCapture: destination is a schema const (every site posts to
|
|
4
|
+
// the same n8n webhook), source/ventureField/honeypotField/minSubmitMs vary
|
|
5
|
+
// per site. Also sends `utm` from the query string, matching every real
|
|
6
|
+
// venture contact form on the portfolio.
|
|
7
|
+
export interface Props {
|
|
8
|
+
leadCapture: {
|
|
9
|
+
destination: string;
|
|
10
|
+
source: string;
|
|
11
|
+
ventureField: string;
|
|
12
|
+
honeypotField: string;
|
|
13
|
+
minSubmitMs?: number;
|
|
14
|
+
};
|
|
15
|
+
/** Pass "" (or omit and let the default apply) -- pass "" explicitly when
|
|
16
|
+
* a wrapping section (e.g. Section.astro's Cta) already rendered its own
|
|
17
|
+
* heading, so the two don't duplicate. */
|
|
18
|
+
heading?: string;
|
|
19
|
+
/** Overrides the "Company (optional)" field label -- some ventures (e.g.
|
|
20
|
+
* Replique, a research-bench product) have a more accurate term. */
|
|
21
|
+
companyLabel?: string;
|
|
22
|
+
}
|
|
23
|
+
const { leadCapture, heading = 'Get in touch', companyLabel = 'Company (optional)' } = Astro.props;
|
|
24
|
+
const minSubmitMs = leadCapture.minSubmitMs ?? 2000;
|
|
25
|
+
---
|
|
26
|
+
<form id="lead-capture-form" class="max-w-md space-y-4" data-destination={leadCapture.destination} data-source={leadCapture.source} data-venture={leadCapture.ventureField} data-honeypot={leadCapture.honeypotField} data-min-submit-ms={minSubmitMs}>
|
|
27
|
+
{heading && <h2 class="font-display text-2xl font-bold mb-2">{heading}</h2>}
|
|
28
|
+
<div>
|
|
29
|
+
<label for="lc-name" class="block text-sm font-medium mb-1">Name</label>
|
|
30
|
+
<input type="text" id="lc-name" name="name" required class="w-full px-3 py-2 rounded-md border border-ink/20 bg-canvas text-ink" />
|
|
31
|
+
</div>
|
|
32
|
+
<div>
|
|
33
|
+
<label for="lc-email" class="block text-sm font-medium mb-1">Email</label>
|
|
34
|
+
<input type="email" id="lc-email" name="email" required class="w-full px-3 py-2 rounded-md border border-ink/20 bg-canvas text-ink" />
|
|
35
|
+
</div>
|
|
36
|
+
<div>
|
|
37
|
+
<label for="lc-company" class="block text-sm font-medium mb-1">{companyLabel}</label>
|
|
38
|
+
<input type="text" id="lc-company" name="company" class="w-full px-3 py-2 rounded-md border border-ink/20 bg-canvas text-ink" />
|
|
39
|
+
</div>
|
|
40
|
+
<div>
|
|
41
|
+
<label for="lc-message" class="block text-sm font-medium mb-1">Message</label>
|
|
42
|
+
<textarea id="lc-message" name="message" required rows="4" class="w-full px-3 py-2 rounded-md border border-ink/20 bg-canvas text-ink"></textarea>
|
|
43
|
+
</div>
|
|
44
|
+
<!-- Honeypot -- hidden from real users via CSS, bots fill every field they see -->
|
|
45
|
+
<div class="hidden" aria-hidden="true">
|
|
46
|
+
<label for={`lc-${leadCapture.honeypotField}`}>Website</label>
|
|
47
|
+
<input type="text" id={`lc-${leadCapture.honeypotField}`} name={leadCapture.honeypotField} tabindex="-1" autocomplete="off" />
|
|
48
|
+
</div>
|
|
49
|
+
<button type="submit" class="px-5 py-2.5 rounded-md bg-accent-primary text-canvas font-medium transition-all duration-200 hover:opacity-90 hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-secondary focus-visible:rounded">
|
|
50
|
+
Send
|
|
51
|
+
</button>
|
|
52
|
+
<p id="lead-capture-status" class="text-sm" role="status"></p>
|
|
53
|
+
</form>
|
|
54
|
+
|
|
55
|
+
<script>
|
|
56
|
+
const form = document.getElementById('lead-capture-form') as HTMLFormElement;
|
|
57
|
+
const status = document.getElementById('lead-capture-status') as HTMLParagraphElement;
|
|
58
|
+
const loadedAt = Date.now();
|
|
59
|
+
|
|
60
|
+
const destination = form.dataset.destination!;
|
|
61
|
+
const source = form.dataset.source!;
|
|
62
|
+
const venture = form.dataset.venture!;
|
|
63
|
+
const honeypotField = form.dataset.honeypot!;
|
|
64
|
+
const minSubmitMs = Number(form.dataset.minSubmitMs ?? '2000');
|
|
65
|
+
|
|
66
|
+
form.addEventListener('submit', async (e) => {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
|
|
69
|
+
const data = new FormData(form);
|
|
70
|
+
|
|
71
|
+
// Honeypot: a real visitor never fills this (hidden via CSS, no autocomplete).
|
|
72
|
+
if ((data.get(honeypotField) as string)?.length > 0) return;
|
|
73
|
+
|
|
74
|
+
// Time-to-submit: a form filled and submitted faster than minSubmitMs is
|
|
75
|
+
// almost certainly scripted, not a human reading the page first.
|
|
76
|
+
if (Date.now() - loadedAt < minSubmitMs) return;
|
|
77
|
+
|
|
78
|
+
const submitBtn = form.querySelector('button[type="submit"]') as HTMLButtonElement;
|
|
79
|
+
submitBtn.disabled = true;
|
|
80
|
+
status.textContent = 'Sending...';
|
|
81
|
+
|
|
82
|
+
try {
|
|
83
|
+
const res = await fetch(destination, {
|
|
84
|
+
method: 'POST',
|
|
85
|
+
headers: { 'Content-Type': 'application/json' },
|
|
86
|
+
body: JSON.stringify({
|
|
87
|
+
name: data.get('name'),
|
|
88
|
+
email: data.get('email'),
|
|
89
|
+
company: data.get('company') || undefined,
|
|
90
|
+
message: data.get('message'),
|
|
91
|
+
source,
|
|
92
|
+
venture,
|
|
93
|
+
utm: Object.fromEntries(new URLSearchParams(window.location.search)),
|
|
94
|
+
}),
|
|
95
|
+
});
|
|
96
|
+
if (res.ok) {
|
|
97
|
+
status.textContent = "Thanks -- we'll be in touch.";
|
|
98
|
+
form.reset();
|
|
99
|
+
} else {
|
|
100
|
+
status.textContent = 'Something went wrong. Try again in a moment.';
|
|
101
|
+
submitBtn.disabled = false;
|
|
102
|
+
}
|
|
103
|
+
} catch {
|
|
104
|
+
status.textContent = 'Something went wrong. Try again in a moment.';
|
|
105
|
+
submitBtn.disabled = false;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
</script>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Single entry point for rendering a page.sections[] entry: dispatches on
|
|
3
|
+
// sectionKind to the matching sections/*.astro component. A consumer page
|
|
4
|
+
// just does {page.sections.map((s) => <Section section={s} site={site} />)}.
|
|
5
|
+
// site is optional and only actually used by the "cta" kind (to embed the
|
|
6
|
+
// real lead-capture form) -- passed through uniformly so a future
|
|
7
|
+
// sectionKind needing site-level data doesn't require a new prop plumbed
|
|
8
|
+
// through every call site again.
|
|
9
|
+
import Hero from './sections/Hero.astro';
|
|
10
|
+
import Problem from './sections/Problem.astro';
|
|
11
|
+
import Approach from './sections/Approach.astro';
|
|
12
|
+
import Proof from './sections/Proof.astro';
|
|
13
|
+
import Audiences from './sections/Audiences.astro';
|
|
14
|
+
import Open from './sections/Open.astro';
|
|
15
|
+
import Status from './sections/Status.astro';
|
|
16
|
+
import Sources from './sections/Sources.astro';
|
|
17
|
+
import Cta from './sections/Cta.astro';
|
|
18
|
+
import Legal from './sections/Legal.astro';
|
|
19
|
+
|
|
20
|
+
const SECTION_COMPONENTS: Record<string, any> = {
|
|
21
|
+
hero: Hero,
|
|
22
|
+
problem: Problem,
|
|
23
|
+
approach: Approach,
|
|
24
|
+
proof: Proof,
|
|
25
|
+
audiences: Audiences,
|
|
26
|
+
open: Open,
|
|
27
|
+
status: Status,
|
|
28
|
+
sources: Sources,
|
|
29
|
+
cta: Cta,
|
|
30
|
+
legal: Legal,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export interface Props {
|
|
34
|
+
section: any;
|
|
35
|
+
site?: any;
|
|
36
|
+
companyLabel?: string;
|
|
37
|
+
}
|
|
38
|
+
const { section, site, companyLabel } = Astro.props;
|
|
39
|
+
const Component = SECTION_COMPONENTS[section.sectionKind];
|
|
40
|
+
if (!Component) {
|
|
41
|
+
throw new Error(`Section.astro: unknown sectionKind "${section.sectionKind}" (id: ${section.sectionId})`);
|
|
42
|
+
}
|
|
43
|
+
---
|
|
44
|
+
{section.sectionKind === 'cta' ? (
|
|
45
|
+
<Cta section={section} leadCapture={site?.leadCapture} companyLabel={companyLabel} />
|
|
46
|
+
) : (
|
|
47
|
+
<Component section={section} />
|
|
48
|
+
)}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
// sectionKind: approach -- how it works.
|
|
3
|
+
import Block from '../Block.astro';
|
|
4
|
+
|
|
5
|
+
export interface Props { section: any }
|
|
6
|
+
const { section } = Astro.props;
|
|
7
|
+
---
|
|
8
|
+
<section id={section.sectionId} class="py-8" data-reveal>
|
|
9
|
+
{section.eyebrow && <p class="text-sm font-mono uppercase tracking-wide text-accent-primary mb-3">{section.eyebrow}</p>}
|
|
10
|
+
{section.heading && <h2 class="font-display text-2xl font-bold mb-3">{section.heading}</h2>}
|
|
11
|
+
{section.subheading && <p class="text-ink/80 max-w-2xl mb-4">{section.subheading}</p>}
|
|
12
|
+
{section.blocks?.map((b: any) => <Block block={b} class="mb-3" />)}
|
|
13
|
+
</section>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
// sectionKind: audiences -- one block per buyer role.
|
|
3
|
+
import Block from '../Block.astro';
|
|
4
|
+
import CtaLink from '../CtaLink.astro';
|
|
5
|
+
|
|
6
|
+
export interface Props { section: any }
|
|
7
|
+
const { section } = Astro.props;
|
|
8
|
+
---
|
|
9
|
+
<section id={section.sectionId} class="py-8" data-reveal>
|
|
10
|
+
{section.eyebrow && <p class="text-sm font-mono uppercase tracking-wide text-accent-primary mb-3">{section.eyebrow}</p>}
|
|
11
|
+
{section.heading && <h2 class="font-display text-2xl font-bold mb-4">{section.heading}</h2>}
|
|
12
|
+
<div class="grid gap-4 sm:grid-cols-2">
|
|
13
|
+
{section.blocks?.map((b: any) => (
|
|
14
|
+
<div class="rounded-md border border-ink/15 p-4">
|
|
15
|
+
<Block block={b} />
|
|
16
|
+
</div>
|
|
17
|
+
))}
|
|
18
|
+
</div>
|
|
19
|
+
{section.ctas?.length > 0 && (
|
|
20
|
+
<div class="mt-6 flex gap-4 flex-wrap">
|
|
21
|
+
{section.ctas.map((c: any, i: number) => <CtaLink cta={c} variant={i === 0 ? 'primary' : 'secondary'} />)}
|
|
22
|
+
</div>
|
|
23
|
+
)}
|
|
24
|
+
</section>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
// sectionKind: cta -- lead-capture (per the schema's own description of
|
|
3
|
+
// this sectionKind). Embeds LeadCaptureForm directly when leadCapture is
|
|
4
|
+
// provided, so a page's real form appears exactly once, with the section's
|
|
5
|
+
// own authored heading/blocks as its intro copy -- not as a separate
|
|
6
|
+
// "teaser" section pointing at a form rendered again elsewhere (found live
|
|
7
|
+
// during GTM-L2 C3's Replique migration: rendering Section.astro's Cta and
|
|
8
|
+
// a standalone <LeadCaptureForm> both produced a duplicated "Get in touch"
|
|
9
|
+
// heading and a dead-end button).
|
|
10
|
+
import Block from '../Block.astro';
|
|
11
|
+
import CtaLink from '../CtaLink.astro';
|
|
12
|
+
import LeadCaptureForm from '../LeadCaptureForm.astro';
|
|
13
|
+
|
|
14
|
+
export interface Props {
|
|
15
|
+
section: any;
|
|
16
|
+
leadCapture?: { destination: string; source: string; ventureField: string; honeypotField: string; minSubmitMs?: number };
|
|
17
|
+
companyLabel?: string;
|
|
18
|
+
}
|
|
19
|
+
const { section, leadCapture, companyLabel } = Astro.props;
|
|
20
|
+
---
|
|
21
|
+
<section id={section.sectionId} class="py-12 text-center border-t border-ink/10" data-reveal>
|
|
22
|
+
{section.heading && <h2 class="font-display text-2xl font-bold mb-3">{section.heading}</h2>}
|
|
23
|
+
{section.subheading && <p class="text-ink/80 max-w-xl mx-auto mb-6">{section.subheading}</p>}
|
|
24
|
+
{section.blocks?.map((b: any) => <Block block={b} class="mb-4 max-w-xl mx-auto text-left" />)}
|
|
25
|
+
{leadCapture ? (
|
|
26
|
+
<div class="text-left max-w-md mx-auto">
|
|
27
|
+
<LeadCaptureForm leadCapture={leadCapture} heading="" companyLabel={companyLabel} />
|
|
28
|
+
</div>
|
|
29
|
+
) : (
|
|
30
|
+
section.ctas?.length > 0 && (
|
|
31
|
+
<div class="flex gap-4 justify-center flex-wrap">
|
|
32
|
+
{section.ctas.map((c: any, i: number) => <CtaLink cta={c} variant={i === 0 ? 'primary' : 'secondary'} />)}
|
|
33
|
+
</div>
|
|
34
|
+
)
|
|
35
|
+
)}
|
|
36
|
+
</section>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Block from '../Block.astro';
|
|
3
|
+
import CtaLink from '../CtaLink.astro';
|
|
4
|
+
|
|
5
|
+
export interface Props { section: any }
|
|
6
|
+
const { section } = Astro.props;
|
|
7
|
+
---
|
|
8
|
+
<section id={section.sectionId} class="py-8" data-reveal>
|
|
9
|
+
{section.eyebrow && <p class="text-sm font-mono uppercase tracking-wide text-accent-primary mb-3">{section.eyebrow}</p>}
|
|
10
|
+
{section.heading && <h1 class="font-display text-4xl sm:text-5xl font-semibold leading-tight mb-4">{section.heading}</h1>}
|
|
11
|
+
{section.subheading && <p class="text-lg text-ink/80 max-w-2xl mb-6">{section.subheading}</p>}
|
|
12
|
+
{section.blocks?.map((b: any) => <Block block={b} class="mb-3" />)}
|
|
13
|
+
{section.ctas?.length > 0 && (
|
|
14
|
+
<div class="mt-6 flex gap-4 flex-wrap">
|
|
15
|
+
{section.ctas.map((c: any, i: number) => <CtaLink cta={c} variant={i === 0 ? 'primary' : 'secondary'} />)}
|
|
16
|
+
</div>
|
|
17
|
+
)}
|
|
18
|
+
</section>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
// sectionKind: legal -- footer legal line (in-page legal copy, distinct
|
|
3
|
+
// from site.footer.legalLine which SiteLayout renders separately).
|
|
4
|
+
import Block from '../Block.astro';
|
|
5
|
+
|
|
6
|
+
export interface Props { section: any }
|
|
7
|
+
const { section } = Astro.props;
|
|
8
|
+
---
|
|
9
|
+
<section id={section.sectionId} class="py-6 text-xs text-ink/50" data-reveal>
|
|
10
|
+
{section.blocks?.map((b: any) => <Block block={b} />)}
|
|
11
|
+
</section>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
// sectionKind: open -- open-standards/open-core statement. crossLinks are
|
|
3
|
+
// the schema-legal way this section names a sibling brand its openness
|
|
4
|
+
// connects to.
|
|
5
|
+
import Block from '../Block.astro';
|
|
6
|
+
import CrossLink from '../CrossLink.astro';
|
|
7
|
+
|
|
8
|
+
export interface Props { section: any }
|
|
9
|
+
const { section } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
<section id={section.sectionId} class="py-8" data-reveal>
|
|
12
|
+
{section.eyebrow && <p class="text-sm font-mono uppercase tracking-wide text-accent-primary mb-3">{section.eyebrow}</p>}
|
|
13
|
+
{section.heading && <h2 class="font-display text-2xl font-bold mb-3">{section.heading}</h2>}
|
|
14
|
+
{section.subheading && <p class="text-ink/80 max-w-2xl mb-4">{section.subheading}</p>}
|
|
15
|
+
{section.blocks?.map((b: any) => <Block block={b} class="mb-3" />)}
|
|
16
|
+
{section.crossLinks?.length > 0 && (
|
|
17
|
+
<div class="grid gap-3 sm:grid-cols-2 mt-4">
|
|
18
|
+
{section.crossLinks.map((cl: any) => <CrossLink crossLink={cl} />)}
|
|
19
|
+
</div>
|
|
20
|
+
)}
|
|
21
|
+
</section>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
// sectionKind: problem -- the system-level framing, never worker-blame
|
|
3
|
+
// (per the schema's own description of this sectionKind).
|
|
4
|
+
import Block from '../Block.astro';
|
|
5
|
+
|
|
6
|
+
export interface Props { section: any }
|
|
7
|
+
const { section } = Astro.props;
|
|
8
|
+
---
|
|
9
|
+
<section id={section.sectionId} class="py-8" data-reveal>
|
|
10
|
+
{section.eyebrow && <p class="text-sm font-mono uppercase tracking-wide text-accent-primary mb-3">{section.eyebrow}</p>}
|
|
11
|
+
{section.heading && <h2 class="font-display text-2xl font-bold mb-3">{section.heading}</h2>}
|
|
12
|
+
{section.subheading && <p class="text-ink/80 max-w-2xl mb-4">{section.subheading}</p>}
|
|
13
|
+
{section.blocks?.map((b: any) => <Block block={b} class="mb-3" />)}
|
|
14
|
+
</section>
|