create-nersh 0.1.6 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +187 -0
- package/dist/index.mjs +169 -40
- package/package.json +4 -3
- package/templates/default-site.json +858 -0
- package/templates/next/app/globals.css +19 -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,2 +1,21 @@
|
|
|
1
1
|
@import "tailwindcss";
|
|
2
|
+
@import "tw-animate-css";
|
|
2
3
|
@source "../node_modules/@nersh/render/dist";
|
|
4
|
+
|
|
5
|
+
/* 12-column grid spans are composed at runtime from `SectionInstance.span`, so no source
|
|
6
|
+
file spells them out for the scanner. Brace-expanded safelist, Tailwind v4.1 @source inline.
|
|
7
|
+
Same line src/app/globals.css carries in the nertia app. */
|
|
8
|
+
@source inline("{@cq-sm/site:,@cq-md/site:,@cq-lg/site:,}col-span-{1..12}");
|
|
9
|
+
|
|
10
|
+
@custom-variant dark (&:is(.dark *));
|
|
11
|
+
|
|
12
|
+
@theme inline {
|
|
13
|
+
/* Container-query breakpoints on their own names, read by the @cq-sm/site and @cq-md/site
|
|
14
|
+
variants the spans above emit. The bare --container-* scale stays Tailwind's, so max-w-lg
|
|
15
|
+
is 32rem. Values match src/app/globals.css. */
|
|
16
|
+
--container-cq-sm: 40rem;
|
|
17
|
+
--container-cq-md: 48rem;
|
|
18
|
+
--container-cq-lg: 64rem;
|
|
19
|
+
--container-cq-xl: 80rem;
|
|
20
|
+
--container-cq-2xl: 96rem;
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "base-nova",
|
|
4
|
+
"rsc": true,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "app/globals.css",
|
|
9
|
+
"baseColor": "zinc",
|
|
10
|
+
"cssVariables": true
|
|
11
|
+
},
|
|
12
|
+
"aliases": {
|
|
13
|
+
"components": "@/components",
|
|
14
|
+
"utils": "@/lib/utils",
|
|
15
|
+
"ui": "@/components/ui",
|
|
16
|
+
"lib": "@/lib",
|
|
17
|
+
"hooks": "@/hooks"
|
|
18
|
+
},
|
|
19
|
+
"iconLibrary": "lucide",
|
|
20
|
+
"registries": {
|
|
21
|
+
"@nertia": "https://ner.sh/r/{name}.json"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@base-ui/react": "^1.5.0",
|
|
12
12
|
"@calcom/embed-react": "^1.5.3",
|
|
13
|
-
"@nersh/render": "
|
|
13
|
+
"@nersh/render": "{{RENDER_PACKAGE}}",
|
|
14
14
|
"class-variance-authority": "^0.7.1",
|
|
15
15
|
"clsx": "^2.1.1",
|
|
16
16
|
"cobe": "^0.6.5",
|
|
@@ -20,15 +20,17 @@
|
|
|
20
20
|
"next": "^15.0.0",
|
|
21
21
|
"react": "^19.0.0",
|
|
22
22
|
"react-dom": "^19.0.0",
|
|
23
|
-
"
|
|
24
|
-
"tailwind-merge": "^3.0.0",
|
|
23
|
+
"tailwind-merge": "^3.6.0",
|
|
25
24
|
"tailwindcss": "^4.0.0",
|
|
25
|
+
"tw-animate-css": "^1.4.0",
|
|
26
26
|
"zod": "^4.3.6"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
+
"@tailwindcss/postcss": "^4.0.0",
|
|
29
30
|
"@types/node": "^22.0.0",
|
|
30
31
|
"@types/react": "^19.0.0",
|
|
31
32
|
"@types/react-dom": "^19.0.0",
|
|
33
|
+
"shadcn": "^4.8.0",
|
|
32
34
|
"typescript": "^5.7.0"
|
|
33
35
|
}
|
|
34
36
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* Tailwind v4 runs as a PostCSS plugin. Without this file Next passes globals.css through
|
|
2
|
+
untouched: the @import and @source directives survive into the built stylesheet and not one
|
|
3
|
+
utility class compiles, so every section renders unstyled. */
|
|
4
|
+
const config = {
|
|
5
|
+
plugins: ["@tailwindcss/postcss"],
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default config;
|
package/templates/next/site.json
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"slug": "mysite",
|
|
3
|
-
"mode": "easy",
|
|
4
|
-
"status": "published",
|
|
5
|
-
"composition": {
|
|
6
|
-
"id": "marketing",
|
|
7
|
-
"sections": [
|
|
8
|
-
{
|
|
9
|
-
"id": "navbar",
|
|
10
|
-
"instanceId": "nav-1"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"id": "marketing-hero",
|
|
14
|
-
"instanceId": "hero-1"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"id": "features",
|
|
18
|
-
"instanceId": "features-1"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"id": "pricing",
|
|
22
|
-
"instanceId": "pricing-1"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"id": "about",
|
|
26
|
-
"instanceId": "about-1"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"id": "footer",
|
|
30
|
-
"instanceId": "footer-1"
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
"skinId": "zinc",
|
|
35
|
-
"copy": {
|
|
36
|
-
"nav-1.wordmark": "\"WORDMARK\"",
|
|
37
|
-
"nav-1.logoImage": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221200%22%20height%3D%22675%22%20viewBox%3D%220%200%201200%20675%22%3E%3Crect%20x%3D%221%22%20y%3D%221%22%20width%3D%221198%22%20height%3D%22673%22%20fill%3D%22%238888881a%22%20stroke%3D%22%23888888%22%20stroke-width%3D%222%22%20stroke-dasharray%3D%2210%208%22%2F%3E%3Ctext%20x%3D%2250%25%22%20y%3D%2250%25%22%20fill%3D%22%23888888%22%20font-family%3D%22ui-monospace%2C%20monospace%22%20font-size%3D%2232%22%20text-anchor%3D%22middle%22%20dominant-baseline%3D%22middle%22%3E%22LOGO%20IMAGE%20%2F%2016%3A9%22%3C%2Ftext%3E%3C%2Fsvg%3E",
|
|
38
|
-
"nav-1.link1Label": "\"LINK 1 LABEL\"",
|
|
39
|
-
"nav-1.link1Href": "\"LINK 1 HREF\"",
|
|
40
|
-
"nav-1.link2Label": "\"LINK 2 LABEL\"",
|
|
41
|
-
"nav-1.link2Href": "\"LINK 2 HREF\"",
|
|
42
|
-
"nav-1.link3Label": "\"LINK 3 LABEL\"",
|
|
43
|
-
"nav-1.link3Href": "\"LINK 3 HREF\"",
|
|
44
|
-
"nav-1.navLinksJson": "\"NAV LINKS (JSON ARRAY — OVERRIDES LINK 1–3)\"",
|
|
45
|
-
"hero-1.eyebrow": "\"EYEBROW (ABOVE HEADLINE)\"",
|
|
46
|
-
"hero-1.headline": "\"HEADLINE\"",
|
|
47
|
-
"hero-1.sub": "\"SUB COPY\"",
|
|
48
|
-
"hero-1.heroImage": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221200%22%20height%3D%22675%22%20viewBox%3D%220%200%201200%20675%22%3E%3Crect%20x%3D%221%22%20y%3D%221%22%20width%3D%221198%22%20height%3D%22673%22%20fill%3D%22%238888881a%22%20stroke%3D%22%23888888%22%20stroke-width%3D%222%22%20stroke-dasharray%3D%2210%208%22%2F%3E%3Ctext%20x%3D%2250%25%22%20y%3D%2250%25%22%20fill%3D%22%23888888%22%20font-family%3D%22ui-monospace%2C%20monospace%22%20font-size%3D%2232%22%20text-anchor%3D%22middle%22%20dominant-baseline%3D%22middle%22%3E%22HERO%20IMAGE%20%2F%2016%3A9%22%3C%2Ftext%3E%3C%2Fsvg%3E",
|
|
49
|
-
"hero-1.heroVideo": "",
|
|
50
|
-
"hero-1.ctaLabel": "\"CTA LABEL\"",
|
|
51
|
-
"hero-1.ctaHref": "\"CTA LINK\"",
|
|
52
|
-
"hero-1.cta2Label": "\"SECONDARY CTA LABEL\"",
|
|
53
|
-
"hero-1.cta2Href": "\"SECONDARY CTA LINK\"",
|
|
54
|
-
"hero-1.cardHeading": "\"CTA CARD HEADING (CARD LAYOUT)\"",
|
|
55
|
-
"hero-1.cardSub": "\"CTA CARD SUB (CARD LAYOUT)\"",
|
|
56
|
-
"hero-1.trustBadge1": "\"TRUST BADGE 1 (OPTIONAL)\"",
|
|
57
|
-
"hero-1.trustBadge2": "\"TRUST BADGE 2 (OPTIONAL)\"",
|
|
58
|
-
"hero-1.trustBadge3": "\"TRUST BADGE 3 (OPTIONAL)\"",
|
|
59
|
-
"features-1.headline": "\"HEADLINE\"",
|
|
60
|
-
"features-1.anchor": "\"SECTION ANCHOR (FOR NAV LINKS, E.G. SERVICES)\"",
|
|
61
|
-
"features-1.sub": "\"SUBHEADING\"",
|
|
62
|
-
"features-1.ctaLabel": "\"SECTION CTA LABEL\"",
|
|
63
|
-
"features-1.ctaHref": "\"SECTION CTA LINK\"",
|
|
64
|
-
"features-1.items": "[{\"label\":\"\\\"FEATURE ITEMS\\\"\",\"icon\":\"\",\"desc\":\"what it does\"},{\"label\":\"\\\"FEATURE ITEMS\\\"\",\"icon\":\"\",\"desc\":\"what it does\"},{\"label\":\"\\\"FEATURE ITEMS\\\"\",\"icon\":\"\",\"desc\":\"what it does\"}]",
|
|
65
|
-
"features-1.feature1Icon": "\"FEATURE 1 — ICON (EMOJI)\"",
|
|
66
|
-
"features-1.feature1Label": "\"FEATURE 1 — LABEL\"",
|
|
67
|
-
"features-1.feature1Desc": "\"FEATURE 1 — DESCRIPTION\"",
|
|
68
|
-
"features-1.feature2Icon": "\"FEATURE 2 — ICON (EMOJI)\"",
|
|
69
|
-
"features-1.feature2Label": "\"FEATURE 2 — LABEL\"",
|
|
70
|
-
"features-1.feature2Desc": "\"FEATURE 2 — DESCRIPTION\"",
|
|
71
|
-
"features-1.feature3Icon": "\"FEATURE 3 — ICON (EMOJI)\"",
|
|
72
|
-
"features-1.feature3Label": "\"FEATURE 3 — LABEL\"",
|
|
73
|
-
"features-1.feature3Desc": "\"FEATURE 3 — DESCRIPTION\"",
|
|
74
|
-
"pricing-1.heading": "\"HEADING\"",
|
|
75
|
-
"pricing-1.checkIcon": "\"FEATURE BULLET ICON (IMAGE URL, OPTIONAL)\"",
|
|
76
|
-
"pricing-1.tier1Label": "\"TIER 1 LABEL\"",
|
|
77
|
-
"pricing-1.tier1Price": "\"TIER 1 PRICE\"",
|
|
78
|
-
"pricing-1.tier1Desc": "\"TIER 1 DESCRIPTION\"",
|
|
79
|
-
"pricing-1.tier1Features": "\"TIER 1 FEATURES (ONE PER LINE)\"",
|
|
80
|
-
"pricing-1.tier1CtaLabel": "\"TIER 1 CTA LABEL\"",
|
|
81
|
-
"pricing-1.tier2Label": "\"TIER 2 LABEL\"",
|
|
82
|
-
"pricing-1.tier2Price": "\"TIER 2 PRICE\"",
|
|
83
|
-
"pricing-1.tier2Desc": "\"TIER 2 DESCRIPTION\"",
|
|
84
|
-
"pricing-1.tier2Features": "\"TIER 2 FEATURES (ONE PER LINE)\"",
|
|
85
|
-
"pricing-1.tier2CtaLabel": "\"TIER 2 CTA LABEL\"",
|
|
86
|
-
"pricing-1.tier2Badge": "\"TIER 2 BADGE (OPTIONAL)\"",
|
|
87
|
-
"pricing-1.tier3Label": "\"TIER 3 LABEL\"",
|
|
88
|
-
"pricing-1.tier3Price": "\"TIER 3 PRICE\"",
|
|
89
|
-
"pricing-1.tier3Desc": "\"TIER 3 DESCRIPTION\"",
|
|
90
|
-
"pricing-1.tier3Features": "\"TIER 3 FEATURES (ONE PER LINE)\"",
|
|
91
|
-
"pricing-1.tier3CtaLabel": "\"TIER 3 CTA LABEL\"",
|
|
92
|
-
"about-1.heading": "\"HEADING\"",
|
|
93
|
-
"about-1.image": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221200%22%20height%3D%22675%22%20viewBox%3D%220%200%201200%20675%22%3E%3Crect%20x%3D%221%22%20y%3D%221%22%20width%3D%221198%22%20height%3D%22673%22%20fill%3D%22%238888881a%22%20stroke%3D%22%23888888%22%20stroke-width%3D%222%22%20stroke-dasharray%3D%2210%208%22%2F%3E%3Ctext%20x%3D%2250%25%22%20y%3D%2250%25%22%20fill%3D%22%23888888%22%20font-family%3D%22ui-monospace%2C%20monospace%22%20font-size%3D%2232%22%20text-anchor%3D%22middle%22%20dominant-baseline%3D%22middle%22%3E%22IMAGE%20%2F%2016%3A9%22%3C%2Ftext%3E%3C%2Fsvg%3E",
|
|
94
|
-
"about-1.body": "\"BODY\"",
|
|
95
|
-
"about-1.video": "",
|
|
96
|
-
"about-1.codeSample": "",
|
|
97
|
-
"footer-1.wordmark": "\"WORDMARK\"",
|
|
98
|
-
"footer-1.tagline": "\"TAGLINE\"",
|
|
99
|
-
"footer-1.phone": "\"PHONE\"",
|
|
100
|
-
"footer-1.email": "\"EMAIL\"",
|
|
101
|
-
"footer-1.hours": "\"HOURS\"",
|
|
102
|
-
"footer-1.link1Label": "\"QUICK LINK 1 LABEL\"",
|
|
103
|
-
"footer-1.link1Href": "\"QUICK LINK 1 HREF\"",
|
|
104
|
-
"footer-1.link2Label": "\"QUICK LINK 2 LABEL\"",
|
|
105
|
-
"footer-1.link2Href": "\"QUICK LINK 2 HREF\"",
|
|
106
|
-
"footer-1.link3Label": "\"QUICK LINK 3 LABEL\"",
|
|
107
|
-
"footer-1.link3Href": "\"QUICK LINK 3 HREF\"",
|
|
108
|
-
"footer-1.link4Label": "\"QUICK LINK 4 LABEL\"",
|
|
109
|
-
"footer-1.link4Href": "\"QUICK LINK 4 HREF\"",
|
|
110
|
-
"footer-1.link5Label": "\"QUICK LINK 5 LABEL\"",
|
|
111
|
-
"footer-1.link5Href": "\"QUICK LINK 5 HREF\"",
|
|
112
|
-
"footer-1.social1Label": "\"SOCIAL 1 LABEL\"",
|
|
113
|
-
"footer-1.social1Href": "\"SOCIAL 1 URL\"",
|
|
114
|
-
"footer-1.social2Label": "\"SOCIAL 2 LABEL\"",
|
|
115
|
-
"footer-1.social2Href": "\"SOCIAL 2 URL\"",
|
|
116
|
-
"footer-1.social3Label": "\"SOCIAL 3 LABEL\"",
|
|
117
|
-
"footer-1.social3Href": "\"SOCIAL 3 URL\""
|
|
118
|
-
},
|
|
119
|
-
"listingEnabled": false,
|
|
120
|
-
"footerAttribution": "default"
|
|
121
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import { parseEmbedUrl, type ParsedEmbed } from '@/lib/embeds';
|
|
5
|
-
import { cn } from '@/lib/utils';
|
|
6
|
-
|
|
7
|
-
type Props = {
|
|
8
|
-
embed: ParsedEmbed;
|
|
9
|
-
title?: string;
|
|
10
|
-
className?: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
function youtubeEmbedSrc(embedSrc: string): string {
|
|
14
|
-
if (typeof window === 'undefined') return embedSrc;
|
|
15
|
-
try {
|
|
16
|
-
const u = new URL(embedSrc);
|
|
17
|
-
const host = u.hostname.replace(/^www\./, '');
|
|
18
|
-
if (host !== 'youtube.com' && host !== 'youtube-nocookie.com') return embedSrc;
|
|
19
|
-
if (!u.pathname.startsWith('/embed/')) return embedSrc;
|
|
20
|
-
u.searchParams.set('origin', window.location.origin);
|
|
21
|
-
return u.toString();
|
|
22
|
-
} catch {
|
|
23
|
-
return embedSrc;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function SafeEmbed({ embed, title, className }: Props) {
|
|
28
|
-
const isAutoHeight = embed.aspectRatio === 'auto';
|
|
29
|
-
// SSR + first client paint use embedSrc without window.origin; patch after mount.
|
|
30
|
-
const [iframeSrc, setIframeSrc] = useState(embed.embedSrc);
|
|
31
|
-
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
setIframeSrc(
|
|
34
|
-
embed.provider === 'youtube' ? youtubeEmbedSrc(embed.embedSrc) : embed.embedSrc,
|
|
35
|
-
);
|
|
36
|
-
}, [embed.embedSrc, embed.provider]);
|
|
37
|
-
return (
|
|
38
|
-
<div
|
|
39
|
-
className={cn(
|
|
40
|
-
'relative w-full overflow-hidden rounded-[var(--radius)] border border-[var(--card-border)] bg-[var(--card)]',
|
|
41
|
-
className,
|
|
42
|
-
)}
|
|
43
|
-
style={isAutoHeight ? { minHeight: '352px' } : { aspectRatio: embed.aspectRatio }}
|
|
44
|
-
>
|
|
45
|
-
<iframe
|
|
46
|
-
src={iframeSrc}
|
|
47
|
-
title={title ?? `${embed.provider} embed`}
|
|
48
|
-
sandbox="allow-scripts allow-same-origin allow-presentation allow-popups"
|
|
49
|
-
referrerPolicy="strict-origin-when-cross-origin"
|
|
50
|
-
loading="lazy"
|
|
51
|
-
className="absolute inset-0 h-full w-full border-0"
|
|
52
|
-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
|
53
|
-
/>
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function SafeEmbedFromUrl({
|
|
59
|
-
url,
|
|
60
|
-
kind,
|
|
61
|
-
title,
|
|
62
|
-
className,
|
|
63
|
-
}: {
|
|
64
|
-
url: string;
|
|
65
|
-
kind: 'videoEmbed' | 'iframeEmbed';
|
|
66
|
-
title?: string;
|
|
67
|
-
className?: string;
|
|
68
|
-
}) {
|
|
69
|
-
const result = parseEmbedUrl(url, kind);
|
|
70
|
-
if (!result.ok) return null;
|
|
71
|
-
return <SafeEmbed embed={result.embed} title={title} className={className} />;
|
|
72
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
forwardRef,
|
|
5
|
-
type AnchorHTMLAttributes,
|
|
6
|
-
type ButtonHTMLAttributes,
|
|
7
|
-
type ReactNode,
|
|
8
|
-
} from "react";
|
|
9
|
-
import { cn } from "@/lib/utils";
|
|
10
|
-
import { useSiteStructural } from "@/components/site/SiteStructuralContext";
|
|
11
|
-
|
|
12
|
-
export type SiteButtonVariant = "primary" | "secondary";
|
|
13
|
-
|
|
14
|
-
type SiteButtonBaseProps = {
|
|
15
|
-
variant?: SiteButtonVariant;
|
|
16
|
-
className?: string;
|
|
17
|
-
children?: ReactNode;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type SiteButtonProps = SiteButtonBaseProps &
|
|
21
|
-
(
|
|
22
|
-
| (SiteButtonBaseProps & { href: string } & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof SiteButtonBaseProps | "href">)
|
|
23
|
-
| (SiteButtonBaseProps & { href?: undefined } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof SiteButtonBaseProps>)
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
function variantClass(variant: SiteButtonVariant): string {
|
|
27
|
-
return variant === "primary" ? "site-btn-primary" : "site-btn-secondary";
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const SiteButton = forwardRef<HTMLAnchorElement | HTMLButtonElement, SiteButtonProps>(
|
|
31
|
-
function SiteButton({ variant = "primary", href, className, children, ...rest }, ref) {
|
|
32
|
-
const { buttonRecipe } = useSiteStructural();
|
|
33
|
-
const density = buttonRecipe?.variants[variant].density;
|
|
34
|
-
const modifierClass = buttonRecipe?.variants[variant].modifierClass;
|
|
35
|
-
const classes = cn(variantClass(variant), modifierClass, className);
|
|
36
|
-
|
|
37
|
-
if (href != null) {
|
|
38
|
-
const anchorProps = rest as Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof SiteButtonBaseProps>;
|
|
39
|
-
return (
|
|
40
|
-
<a
|
|
41
|
-
ref={ref as React.Ref<HTMLAnchorElement>}
|
|
42
|
-
href={href}
|
|
43
|
-
className={classes}
|
|
44
|
-
data-density={density}
|
|
45
|
-
{...anchorProps}
|
|
46
|
-
>
|
|
47
|
-
{children}
|
|
48
|
-
</a>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const buttonProps = rest as Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof SiteButtonBaseProps>;
|
|
53
|
-
return (
|
|
54
|
-
<button
|
|
55
|
-
ref={ref as React.Ref<HTMLButtonElement>}
|
|
56
|
-
type={buttonProps.type ?? "button"}
|
|
57
|
-
className={classes}
|
|
58
|
-
data-density={density}
|
|
59
|
-
{...buttonProps}
|
|
60
|
-
>
|
|
61
|
-
{children}
|
|
62
|
-
</button>
|
|
63
|
-
);
|
|
64
|
-
},
|
|
65
|
-
);
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { AnchorHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { cn } from '@/lib/utils';
|
|
3
|
-
|
|
4
|
-
type SiteCardBaseProps = {
|
|
5
|
-
title?: ReactNode;
|
|
6
|
-
children?: ReactNode;
|
|
7
|
-
className?: string;
|
|
8
|
-
/** Opt non-link cards into the skin hover lift (anchor cards get it automatically). */
|
|
9
|
-
interactive?: boolean;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
type SiteCardProps =
|
|
13
|
-
| (SiteCardBaseProps & { href: string } & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof SiteCardBaseProps | 'href'>)
|
|
14
|
-
| (SiteCardBaseProps & { href?: undefined } & Omit<HTMLAttributes<HTMLDivElement>, keyof SiteCardBaseProps>);
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Hosted-site card surface — radius / border / shadow / bg all skin-driven via `.site-card`.
|
|
18
|
-
* Default padding is `p-6`; override with `className` (twMerge wins, e.g. `p-0` for edge-to-edge media).
|
|
19
|
-
*/
|
|
20
|
-
export function SiteCard({ title, children, className, href, interactive, ...rest }: SiteCardProps) {
|
|
21
|
-
const classes = cn('site-card flex flex-col', 'p-6', className);
|
|
22
|
-
const content = (
|
|
23
|
-
<>
|
|
24
|
-
{title ? <p className="site-type-sm mb-1 font-semibold">{title}</p> : null}
|
|
25
|
-
{children}
|
|
26
|
-
</>
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
if (href != null) {
|
|
30
|
-
return (
|
|
31
|
-
<a href={href} className={classes} {...(rest as AnchorHTMLAttributes<HTMLAnchorElement>)}>
|
|
32
|
-
{content}
|
|
33
|
-
</a>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<div
|
|
39
|
-
className={classes}
|
|
40
|
-
data-interactive={interactive ? 'true' : undefined}
|
|
41
|
-
{...(rest as HTMLAttributes<HTMLDivElement>)}
|
|
42
|
-
>
|
|
43
|
-
{content}
|
|
44
|
-
</div>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
codeBlockHasContent,
|
|
5
|
-
parseCodeBlock,
|
|
6
|
-
type CodeBlockLanguage,
|
|
7
|
-
} from '@/lib/codeBlock';
|
|
8
|
-
import { cn } from '@/lib/utils';
|
|
9
|
-
|
|
10
|
-
type Props = {
|
|
11
|
-
raw: string;
|
|
12
|
-
className?: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const LANGUAGE_LABELS: Record<CodeBlockLanguage, string> = {
|
|
16
|
-
plain: 'Plain',
|
|
17
|
-
typescript: 'TypeScript',
|
|
18
|
-
javascript: 'JavaScript',
|
|
19
|
-
tsx: 'TSX',
|
|
20
|
-
jsx: 'JSX',
|
|
21
|
-
python: 'Python',
|
|
22
|
-
bash: 'Bash',
|
|
23
|
-
html: 'HTML',
|
|
24
|
-
css: 'CSS',
|
|
25
|
-
json: 'JSON',
|
|
26
|
-
sql: 'SQL',
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export function SiteCodeBlock({ raw, className }: Props) {
|
|
30
|
-
if (!codeBlockHasContent(raw)) return null;
|
|
31
|
-
const parsed = parseCodeBlock(raw);
|
|
32
|
-
if (!parsed.ok) return null;
|
|
33
|
-
const { language, code } = parsed.value;
|
|
34
|
-
return (
|
|
35
|
-
<div className={cn('relative', className)}>
|
|
36
|
-
<span
|
|
37
|
-
className="absolute right-2 top-2 z-10 rounded px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wide"
|
|
38
|
-
style={{ color: 'var(--muted-foreground)', background: 'var(--background)' }}
|
|
39
|
-
>
|
|
40
|
-
{LANGUAGE_LABELS[language]}
|
|
41
|
-
</span>
|
|
42
|
-
<pre
|
|
43
|
-
className="overflow-x-auto font-mono text-sm leading-relaxed"
|
|
44
|
-
style={{
|
|
45
|
-
background: 'var(--code-block-bg, var(--muted))',
|
|
46
|
-
border: '1px solid var(--code-block-border, var(--border))',
|
|
47
|
-
color: 'var(--code-block-text, var(--foreground))',
|
|
48
|
-
borderRadius: 'var(--code-block-radius, var(--radius))',
|
|
49
|
-
padding: 'var(--code-block-padding, 1rem)',
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
<code className="whitespace-pre-wrap break-words">{code}</code>
|
|
53
|
-
</pre>
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import { cn } from '@/lib/utils';
|
|
3
|
-
|
|
4
|
-
export type SiteHeadingLevel = 'hero' | 'display' | 'title' | 'heading';
|
|
5
|
-
export type SiteHeadingAlign = 'inherit' | 'center' | 'start';
|
|
6
|
-
|
|
7
|
-
const LEVEL_CLASS: Record<SiteHeadingLevel, string> = {
|
|
8
|
-
hero: 'site-type-hero',
|
|
9
|
-
display: 'site-type-display',
|
|
10
|
-
title: 'site-type-title',
|
|
11
|
-
heading: 'site-type-heading',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const ALIGN_CLASS: Record<Exclude<SiteHeadingAlign, 'inherit'>, string> = {
|
|
15
|
-
center: 'text-center',
|
|
16
|
-
start: 'text-left',
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
type Props = {
|
|
20
|
-
level?: SiteHeadingLevel;
|
|
21
|
-
/** 'inherit' lets the skin drive alignment via --heading-align (display only). */
|
|
22
|
-
align?: SiteHeadingAlign;
|
|
23
|
-
as?: 'h1' | 'h2' | 'h3' | 'h4';
|
|
24
|
-
children: ReactNode;
|
|
25
|
-
className?: string;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/** Hosted-site heading — fluid type + skin alignment via .site-comparison-heading or explicit align. */
|
|
29
|
-
export function SiteHeading({
|
|
30
|
-
level = 'display',
|
|
31
|
-
align = 'inherit',
|
|
32
|
-
as: Tag = 'h2',
|
|
33
|
-
children,
|
|
34
|
-
className,
|
|
35
|
-
}: Props) {
|
|
36
|
-
const alignClass =
|
|
37
|
-
align === 'inherit'
|
|
38
|
-
? level === 'display'
|
|
39
|
-
? 'site-comparison-heading'
|
|
40
|
-
: undefined
|
|
41
|
-
: ALIGN_CLASS[align];
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<Tag
|
|
45
|
-
className={cn(LEVEL_CLASS[level], 'font-bold leading-tight', alignClass, className)}
|
|
46
|
-
>
|
|
47
|
-
{children}
|
|
48
|
-
</Tag>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import { cn } from '@/lib/utils';
|
|
3
|
-
|
|
4
|
-
export type SiteMobileSliderSize = 'default' | 'compact' | 'wide';
|
|
5
|
-
|
|
6
|
-
const SLIDE_WIDTH: Record<SiteMobileSliderSize, string> = {
|
|
7
|
-
default: 'w-[min(88cqw,22rem)]',
|
|
8
|
-
compact: 'w-[min(72cqw,11.5rem)]',
|
|
9
|
-
wide: 'w-[min(92cqw,26rem)]',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
type SliderProps = {
|
|
13
|
-
children: ReactNode;
|
|
14
|
-
/** Grid classes from the @md/site breakpoint upward. */
|
|
15
|
-
desktopClass: string;
|
|
16
|
-
className?: string;
|
|
17
|
-
gapClass?: string;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/** Horizontal scroll-snap rail on narrow viewports; grid (or flex) from @md/site up. */
|
|
21
|
-
export function SiteMobileSlider({
|
|
22
|
-
children,
|
|
23
|
-
desktopClass,
|
|
24
|
-
className,
|
|
25
|
-
gapClass = 'gap-4 @md/site:gap-6',
|
|
26
|
-
}: SliderProps) {
|
|
27
|
-
return (
|
|
28
|
-
<div
|
|
29
|
-
className={cn(
|
|
30
|
-
'site-mobile-slider -mx-[var(--site-px)] px-[var(--site-px)] @md/site:mx-0 @md/site:px-0',
|
|
31
|
-
className,
|
|
32
|
-
)}
|
|
33
|
-
>
|
|
34
|
-
<div
|
|
35
|
-
className={cn(
|
|
36
|
-
'flex overflow-x-auto overscroll-x-contain scroll-smooth snap-x snap-mandatory pb-2',
|
|
37
|
-
gapClass,
|
|
38
|
-
'[scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden',
|
|
39
|
-
'@md/site:grid @md/site:overflow-visible @md/site:snap-none @md/site:pb-0',
|
|
40
|
-
desktopClass,
|
|
41
|
-
)}
|
|
42
|
-
>
|
|
43
|
-
{children}
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
type SlideProps = {
|
|
50
|
-
children: ReactNode;
|
|
51
|
-
size?: SiteMobileSliderSize;
|
|
52
|
-
className?: string;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export function SiteMobileSliderSlide({
|
|
56
|
-
children,
|
|
57
|
-
size = 'default',
|
|
58
|
-
className,
|
|
59
|
-
}: SlideProps) {
|
|
60
|
-
return (
|
|
61
|
-
<div
|
|
62
|
-
className={cn(
|
|
63
|
-
'shrink-0 snap-start snap-always @md/site:w-auto @md/site:min-w-0 @md/site:shrink',
|
|
64
|
-
SLIDE_WIDTH[size],
|
|
65
|
-
className,
|
|
66
|
-
)}
|
|
67
|
-
>
|
|
68
|
-
{children}
|
|
69
|
-
</div>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import { cn } from '@/lib/utils';
|
|
3
|
-
import { SiteHeading, type SiteHeadingAlign, type SiteHeadingLevel } from './SiteHeading';
|
|
4
|
-
|
|
5
|
-
type Props = {
|
|
6
|
-
/** Anchor id for in-page nav. */
|
|
7
|
-
id?: string;
|
|
8
|
-
/** Optional section header. */
|
|
9
|
-
heading?: ReactNode;
|
|
10
|
-
sub?: ReactNode;
|
|
11
|
-
eyebrow?: ReactNode;
|
|
12
|
-
headingLevel?: SiteHeadingLevel;
|
|
13
|
-
align?: Exclude<SiteHeadingAlign, 'inherit'>;
|
|
14
|
-
/** Decor / layout hooks on the outer `<section>`. */
|
|
15
|
-
dataSection?: string;
|
|
16
|
-
dataLayout?: string;
|
|
17
|
-
dataFullHeight?: boolean;
|
|
18
|
-
/** Extra classes on the `<section>` (vertical rhythm, bg overrides). */
|
|
19
|
-
className?: string;
|
|
20
|
-
/** Per-instance surface overrides (`--section-bg` / `--section-fg`). */
|
|
21
|
-
style?: CSSProperties;
|
|
22
|
-
/** Extra classes on the inner width-constrained container. */
|
|
23
|
-
innerClassName?: string;
|
|
24
|
-
/** Extra classes on the header block. */
|
|
25
|
-
headerClassName?: string;
|
|
26
|
-
children: ReactNode;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Hosted-site section wrapper. Owns the `.site-section-shell` token box (skin max-width /
|
|
31
|
-
* gutter / alignment) + a width-constrained inner container + an optional skin-styled header.
|
|
32
|
-
* Sections compose their body as `children` instead of re-rolling the shell + heading markup.
|
|
33
|
-
*/
|
|
34
|
-
export function SiteSectionShell({
|
|
35
|
-
id,
|
|
36
|
-
heading,
|
|
37
|
-
sub,
|
|
38
|
-
eyebrow,
|
|
39
|
-
headingLevel = 'display',
|
|
40
|
-
align = 'center',
|
|
41
|
-
dataSection,
|
|
42
|
-
dataLayout,
|
|
43
|
-
dataFullHeight,
|
|
44
|
-
className,
|
|
45
|
-
style,
|
|
46
|
-
innerClassName,
|
|
47
|
-
headerClassName,
|
|
48
|
-
children,
|
|
49
|
-
}: Props) {
|
|
50
|
-
const centered = align === 'center';
|
|
51
|
-
const hasHeader = eyebrow != null || heading != null || sub != null;
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<section
|
|
55
|
-
id={id || undefined}
|
|
56
|
-
data-section={dataSection}
|
|
57
|
-
data-layout={dataLayout}
|
|
58
|
-
{...(dataFullHeight ? { 'data-full-height': 'true' as const } : {})}
|
|
59
|
-
style={style}
|
|
60
|
-
className={cn('site-section-shell py-[var(--section-py,6rem)]', className)}
|
|
61
|
-
>
|
|
62
|
-
<div className={cn('mx-auto w-full max-w-5xl', innerClassName)}>
|
|
63
|
-
{hasHeader ? (
|
|
64
|
-
<header className={cn('mb-12', centered && 'text-center', headerClassName)}>
|
|
65
|
-
{eyebrow ? (
|
|
66
|
-
<p className={cn('site-type-label mb-3 text-[var(--accent)]', centered && 'mx-auto')}>
|
|
67
|
-
{eyebrow}
|
|
68
|
-
</p>
|
|
69
|
-
) : null}
|
|
70
|
-
{heading ? (
|
|
71
|
-
<SiteHeading level={headingLevel} align={align} className="mb-4">
|
|
72
|
-
{heading}
|
|
73
|
-
</SiteHeading>
|
|
74
|
-
) : null}
|
|
75
|
-
{sub ? (
|
|
76
|
-
<p
|
|
77
|
-
className={cn(
|
|
78
|
-
'site-type-body text-[var(--muted-fg)]',
|
|
79
|
-
centered ? 'mx-auto max-w-xl' : 'max-w-2xl',
|
|
80
|
-
)}
|
|
81
|
-
>
|
|
82
|
-
{sub}
|
|
83
|
-
</p>
|
|
84
|
-
) : null}
|
|
85
|
-
</header>
|
|
86
|
-
) : null}
|
|
87
|
-
{children}
|
|
88
|
-
</div>
|
|
89
|
-
</section>
|
|
90
|
-
);
|
|
91
|
-
}
|