@vvedantb/ui 0.7.2 → 0.9.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.
@@ -0,0 +1,214 @@
1
+ import type { ReactNode } from "react";
2
+ import type { motion as motionNamespace } from "motion/react";
3
+ import { motionDuration, motionEase } from "../motion/presets";
4
+ import { Button } from "../ui/button";
5
+ import { cn } from "../utils/cn";
6
+ import { landingItemVariants, type LandingLink } from "./landing";
7
+ import { landingClasses, landingShellClass } from "./marketing-classes";
8
+
9
+ /** The `motion` export of `motion/react`. Only these elements are used. */
10
+ export type LandingMotion = Pick<typeof motionNamespace, "div" | "p" | "h1" | "ul" | "header">;
11
+
12
+ export type LandingKitOptions = {
13
+ /** Pass `motion` from `motion/react`. The package does not import Motion itself. */
14
+ motion: LandingMotion;
15
+ };
16
+
17
+ export type LandingRevealProps = {
18
+ children: ReactNode;
19
+ className?: string;
20
+ /** Seconds before the first child starts. Default `0`. */
21
+ delay?: number;
22
+ };
23
+
24
+ export type LandingRevealItemProps = { children: ReactNode; className?: string };
25
+
26
+ export type LandingHeroProps = {
27
+ /** Pill above the title, after a pulsing dot. */
28
+ eyebrow: ReactNode;
29
+ title: ReactNode;
30
+ description: ReactNode;
31
+ /** Inside the button row, for example Get started and Sign in. The row renders even when empty. */
32
+ actions?: ReactNode;
33
+ /** Mono pills under the buttons. */
34
+ capabilities: readonly string[];
35
+ };
36
+
37
+ export type LandingNavProps = {
38
+ /** Wordmark inside the `#top` home link. */
39
+ brand: ReactNode;
40
+ /** `aria-label` of the home link. */
41
+ homeLabel: string;
42
+ /** Section links, shown from `md`. */
43
+ links: readonly LandingLink[];
44
+ /** Icon button from `sm`. `label` is its `aria-label`. */
45
+ github: { href: string; label: string; icon: ReactNode };
46
+ /** After the GitHub button, for example Sign in and Get started. */
47
+ actions?: ReactNode;
48
+ /** Last in the bar, usually `LandingNavMenu`. */
49
+ menu?: ReactNode;
50
+ };
51
+
52
+ export type LandingCtaProps = {
53
+ title: ReactNode;
54
+ description: ReactNode;
55
+ /** Under the text, for example a large Get started button. */
56
+ action?: ReactNode;
57
+ };
58
+
59
+ export type LandingKit = {
60
+ LandingReveal: (props: LandingRevealProps) => ReactNode;
61
+ LandingRevealItem: (props: LandingRevealItemProps) => ReactNode;
62
+ LandingHero: (props: LandingHeroProps) => ReactNode;
63
+ LandingNav: (props: LandingNavProps) => ReactNode;
64
+ LandingCta: (props: LandingCtaProps) => ReactNode;
65
+ };
66
+
67
+ const heroContainer = {
68
+ hidden: {},
69
+ show: {
70
+ transition: { staggerChildren: 0.1, delayChildren: 0.08 },
71
+ },
72
+ };
73
+
74
+ /**
75
+ * Builds the animated landing parts on the app's Motion. Call it once at
76
+ * module scope: `export const { LandingHero, ... } = createLandingKit({ motion })`.
77
+ */
78
+ export function createLandingKit({ motion }: LandingKitOptions): LandingKit {
79
+ /** Staggers its `LandingRevealItem` children in once, when 20% is in view. */
80
+ function LandingReveal({ children, className, delay = 0 }: LandingRevealProps) {
81
+ return (
82
+ <motion.div
83
+ className={className}
84
+ initial="hidden"
85
+ whileInView="show"
86
+ viewport={{ once: true, amount: 0.2 }}
87
+ variants={{
88
+ hidden: {},
89
+ show: {
90
+ transition: { staggerChildren: 0.1, delayChildren: delay },
91
+ },
92
+ }}
93
+ >
94
+ {children}
95
+ </motion.div>
96
+ );
97
+ }
98
+
99
+ function LandingRevealItem({ children, className }: LandingRevealItemProps) {
100
+ return (
101
+ <motion.div className={cn(className)} variants={landingItemVariants}>
102
+ {children}
103
+ </motion.div>
104
+ );
105
+ }
106
+
107
+ /** Centred hero: eyebrow pill, title, description, actions and capability pills, revealed on mount. */
108
+ function LandingHero({ eyebrow, title, description, actions, capabilities }: LandingHeroProps) {
109
+ return (
110
+ <section className={`${landingShellClass} pb-16 pt-12 sm:pb-20 sm:pt-20 lg:pb-24 lg:pt-24`}>
111
+ <motion.div
112
+ className="mx-auto max-w-3xl text-center"
113
+ initial="hidden"
114
+ animate="show"
115
+ variants={heroContainer}
116
+ >
117
+ <motion.p className={landingClasses.heroEyebrow} variants={landingItemVariants}>
118
+ <span className="landing-pulse-dot size-1.5 rounded-full bg-foreground" aria-hidden />
119
+ {eyebrow}
120
+ </motion.p>
121
+
122
+ <motion.h1
123
+ className="text-balance font-semibold text-[2.35rem] leading-[1] tracking-[-0.035em] text-foreground min-[400px]:text-[2.85rem] sm:text-6xl lg:text-[4.85rem]"
124
+ variants={landingItemVariants}
125
+ transition={{ duration: motionDuration.slow, ease: motionEase }}
126
+ >
127
+ {title}
128
+ </motion.h1>
129
+
130
+ <motion.p className={landingClasses.heroDescription} variants={landingItemVariants}>
131
+ {description}
132
+ </motion.p>
133
+
134
+ <motion.div
135
+ className="mt-7 flex flex-col items-stretch justify-center gap-2.5 sm:mt-9 sm:flex-row sm:items-center sm:gap-3"
136
+ variants={landingItemVariants}
137
+ >
138
+ {actions}
139
+ </motion.div>
140
+
141
+ <motion.ul
142
+ className="mt-8 flex flex-wrap items-center justify-center gap-2 sm:mt-10"
143
+ variants={landingItemVariants}
144
+ >
145
+ {capabilities.map((label) => (
146
+ <li key={label} className={landingClasses.heroCapability}>
147
+ {label}
148
+ </li>
149
+ ))}
150
+ </motion.ul>
151
+ </motion.div>
152
+ </section>
153
+ );
154
+ }
155
+
156
+ /** Sticky blurred header that rises in on mount. */
157
+ function LandingNav({ brand, homeLabel, links, github, actions, menu }: LandingNavProps) {
158
+ return (
159
+ <motion.header
160
+ className="sticky top-0 z-30 border-b border-separator bg-background/80 backdrop-blur-md"
161
+ initial={{ opacity: 0, y: 14 }}
162
+ animate={{ opacity: 1, y: 0 }}
163
+ transition={{ duration: motionDuration.base, ease: motionEase }}
164
+ >
165
+ <div className={cn(landingShellClass, "flex h-14 items-center justify-between gap-3 sm:h-16")}>
166
+ <a
167
+ href="#top"
168
+ className="group min-w-0 shrink-0 rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
169
+ aria-label={homeLabel}
170
+ >
171
+ {brand}
172
+ </a>
173
+
174
+ <nav className="hidden items-center gap-1 md:flex" aria-label="Page">
175
+ {links.map((link) => (
176
+ <a key={link.href} href={link.href} className={landingClasses.navLink}>
177
+ {link.label}
178
+ </a>
179
+ ))}
180
+ </nav>
181
+
182
+ <div className="flex items-center gap-1.5">
183
+ <Button asChild variant="ghost" size="icon-sm" className="hidden sm:inline-flex">
184
+ <a href={github.href} target="_blank" rel="noreferrer" aria-label={github.label}>
185
+ {github.icon}
186
+ </a>
187
+ </Button>
188
+ {actions}
189
+ {menu}
190
+ </div>
191
+ </div>
192
+ </motion.header>
193
+ );
194
+ }
195
+
196
+ /** Closing call to action on the atmosphere background. */
197
+ function LandingCta({ title, description, action }: LandingCtaProps) {
198
+ return (
199
+ <div className="landing-atmosphere landing-grain relative overflow-hidden border-t border-separator">
200
+ <section className={`${landingShellClass} relative z-10 py-20 sm:py-28`}>
201
+ <LandingReveal className="flex flex-col items-center text-center">
202
+ <h2 className="max-w-2xl text-balance font-semibold text-3xl leading-[1.1] tracking-[-0.03em] text-foreground sm:text-5xl">
203
+ {title}
204
+ </h2>
205
+ <p className={landingClasses.ctaDescription}>{description}</p>
206
+ <div className="mt-9">{action}</div>
207
+ </LandingReveal>
208
+ </section>
209
+ </div>
210
+ );
211
+ }
212
+
213
+ return { LandingReveal, LandingRevealItem, LandingHero, LandingNav, LandingCta };
214
+ }
@@ -0,0 +1,271 @@
1
+ /* Instrument Serif ships only regular (+ italic). Disable faux-bold. */
2
+ .landing-wordmark-text {
3
+ font-family: var(--font-instrumentSerif);
4
+ font-weight: 400;
5
+ font-synthesis: none;
6
+ }
7
+
8
+ @keyframes landing-graph-dash {
9
+ to {
10
+ stroke-dashoffset: -20;
11
+ }
12
+ }
13
+
14
+ .landing-graph-dash {
15
+ animation: landing-graph-dash 12s linear infinite;
16
+ }
17
+
18
+ @keyframes landing-preview-pulse {
19
+ 0%,
20
+ 100% {
21
+ opacity: 0.35;
22
+ }
23
+ 50% {
24
+ opacity: 1;
25
+ }
26
+ }
27
+
28
+ .landing-preview-pulse {
29
+ animation: landing-preview-pulse 2.8s ease-in-out infinite;
30
+ }
31
+
32
+ @keyframes landing-pulse-dot {
33
+ 0%,
34
+ 100% {
35
+ opacity: 0.45;
36
+ box-shadow: 0 0 0 0 color-mix(in oklch, var(--foreground) 35%, transparent);
37
+ }
38
+ 50% {
39
+ opacity: 1;
40
+ box-shadow: 0 0 0 6px color-mix(in oklch, var(--foreground) 0%, transparent);
41
+ }
42
+ }
43
+
44
+ .landing-pulse-dot {
45
+ animation: landing-pulse-dot 2.4s ease-in-out infinite;
46
+ }
47
+
48
+ .landing-grain::after {
49
+ content: "";
50
+ pointer-events: none;
51
+ position: absolute;
52
+ inset: 0;
53
+ opacity: 0.22;
54
+ mix-blend-mode: overlay;
55
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
56
+ background-size: 128px 128px;
57
+ }
58
+
59
+ .landing-atmosphere {
60
+ background-color: var(--background);
61
+ background-image:
62
+ radial-gradient(
63
+ ellipse 90% 55% at 50% -12%,
64
+ color-mix(in oklch, var(--foreground) 8%, transparent),
65
+ transparent 58%
66
+ ),
67
+ radial-gradient(
68
+ ellipse 45% 35% at 100% 100%,
69
+ color-mix(in oklch, var(--foreground) 4%, transparent),
70
+ transparent 55%
71
+ ),
72
+ linear-gradient(
73
+ color-mix(in oklch, var(--foreground) 5.5%, transparent) 1px,
74
+ transparent 1px
75
+ ),
76
+ linear-gradient(
77
+ 90deg,
78
+ color-mix(in oklch, var(--foreground) 5.5%, transparent) 1px,
79
+ transparent 1px
80
+ );
81
+ background-size:
82
+ 100% 100%,
83
+ 100% 100%,
84
+ 56px 56px,
85
+ 56px 56px;
86
+ }
87
+
88
+ /* Centered hero: keep a readable well, graph atmosphere around the edges */
89
+ .landing-hero-read-scrim {
90
+ background: radial-gradient(
91
+ ellipse 72% 58% at 50% 42%,
92
+ var(--background) 0%,
93
+ color-mix(in oklch, var(--background) 82%, transparent) 46%,
94
+ transparent 74%
95
+ );
96
+ }
97
+
98
+ .landing-ambient-graph-mask {
99
+ mask-image: radial-gradient(
100
+ ellipse 88% 78% at 50% 48%,
101
+ transparent 8%,
102
+ black 62%
103
+ );
104
+ -webkit-mask-image: radial-gradient(
105
+ ellipse 88% 78% at 50% 48%,
106
+ transparent 8%,
107
+ black 62%
108
+ );
109
+ }
110
+
111
+ @keyframes landing-ambient-drift {
112
+ 0%,
113
+ 100% {
114
+ transform: translate3d(0, 0, 0);
115
+ }
116
+ 50% {
117
+ transform: translate3d(0, -10px, 0);
118
+ }
119
+ }
120
+
121
+ .landing-ambient-drift {
122
+ animation: landing-ambient-drift 14s ease-in-out infinite;
123
+ }
124
+
125
+ @keyframes landing-ambient-node-a {
126
+ 0%,
127
+ 100% {
128
+ opacity: 0.35;
129
+ }
130
+ 50% {
131
+ opacity: 1;
132
+ }
133
+ }
134
+
135
+ @keyframes landing-ambient-node-b {
136
+ 0%,
137
+ 100% {
138
+ opacity: 0.5;
139
+ }
140
+ 50% {
141
+ opacity: 1;
142
+ }
143
+ }
144
+
145
+ @keyframes landing-ambient-node-c {
146
+ 0%,
147
+ 100% {
148
+ opacity: 0.4;
149
+ }
150
+ 50% {
151
+ opacity: 0.95;
152
+ }
153
+ }
154
+
155
+ @keyframes landing-ambient-node-d {
156
+ 0%,
157
+ 100% {
158
+ opacity: 0.3;
159
+ }
160
+ 50% {
161
+ opacity: 0.9;
162
+ }
163
+ }
164
+
165
+ @keyframes landing-ambient-node-e {
166
+ 0%,
167
+ 100% {
168
+ opacity: 0.45;
169
+ }
170
+ 50% {
171
+ opacity: 1;
172
+ }
173
+ }
174
+
175
+ @keyframes landing-ambient-node-f {
176
+ 0%,
177
+ 100% {
178
+ opacity: 0.35;
179
+ }
180
+ 50% {
181
+ opacity: 0.85;
182
+ }
183
+ }
184
+
185
+ @keyframes landing-ambient-node-g {
186
+ 0%,
187
+ 100% {
188
+ opacity: 0.4;
189
+ }
190
+ 50% {
191
+ opacity: 1;
192
+ }
193
+ }
194
+
195
+ @keyframes landing-ambient-node-h {
196
+ 0%,
197
+ 100% {
198
+ opacity: 0.25;
199
+ }
200
+ 50% {
201
+ opacity: 0.75;
202
+ }
203
+ }
204
+
205
+ .landing-ambient-node-a {
206
+ animation: landing-ambient-node-a 5s ease-in-out infinite;
207
+ }
208
+
209
+ .landing-ambient-node-b {
210
+ animation: landing-ambient-node-b 4s ease-in-out infinite;
211
+ }
212
+
213
+ .landing-ambient-node-c {
214
+ animation: landing-ambient-node-c 6s ease-in-out infinite;
215
+ }
216
+
217
+ .landing-ambient-node-d {
218
+ animation: landing-ambient-node-d 5.5s ease-in-out infinite;
219
+ }
220
+
221
+ .landing-ambient-node-e {
222
+ animation: landing-ambient-node-e 4.5s ease-in-out infinite;
223
+ }
224
+
225
+ .landing-ambient-node-f {
226
+ animation: landing-ambient-node-f 5.2s ease-in-out infinite;
227
+ }
228
+
229
+ .landing-ambient-node-g {
230
+ animation: landing-ambient-node-g 4.8s ease-in-out infinite;
231
+ }
232
+
233
+ .landing-ambient-node-h {
234
+ animation: landing-ambient-node-h 5.8s ease-in-out infinite;
235
+ }
236
+
237
+ html:has(#top) {
238
+ scroll-behavior: smooth;
239
+ }
240
+
241
+ @media (max-width: 1023px) {
242
+ .landing-hero-read-scrim {
243
+ background: radial-gradient(
244
+ ellipse 90% 70% at 50% 28%,
245
+ var(--background) 0%,
246
+ color-mix(in oklch, var(--background) 88%, transparent) 52%,
247
+ transparent 78%
248
+ );
249
+ }
250
+ }
251
+
252
+ @media (prefers-reduced-motion: reduce) {
253
+ html:has(#top) {
254
+ scroll-behavior: auto;
255
+ }
256
+
257
+ .landing-graph-dash,
258
+ .landing-preview-pulse,
259
+ .landing-pulse-dot,
260
+ .landing-ambient-drift,
261
+ .landing-ambient-node-a,
262
+ .landing-ambient-node-b,
263
+ .landing-ambient-node-c,
264
+ .landing-ambient-node-d,
265
+ .landing-ambient-node-e,
266
+ .landing-ambient-node-f,
267
+ .landing-ambient-node-g,
268
+ .landing-ambient-node-h {
269
+ animation: none !important;
270
+ }
271
+ }
@@ -0,0 +1,217 @@
1
+ import type { ComponentType, ReactNode } from "react";
2
+ import { IconMenu2 } from "@tabler/icons-react";
3
+ import type { Variants } from "motion/react";
4
+ import { motionDuration, motionEase } from "../motion/presets";
5
+ import { Button } from "../ui/button";
6
+ import {
7
+ DropdownMenu,
8
+ DropdownMenuContent,
9
+ DropdownMenuItem,
10
+ DropdownMenuSeparator,
11
+ DropdownMenuTrigger,
12
+ } from "../ui/dropdown-menu";
13
+ import { cn } from "../utils/cn";
14
+ import { landingClasses, landingFooterLinkClass, landingShellClass } from "./marketing-classes";
15
+
16
+ export type LandingLink = { href: string; label: string };
17
+
18
+ /** Variants for one revealed child: fade, rise 14px and unblur. */
19
+ export const landingItemVariants: Variants = {
20
+ hidden: { opacity: 0, y: 14, filter: "blur(4px)" },
21
+ show: {
22
+ opacity: 1,
23
+ y: 0,
24
+ filter: "blur(0px)",
25
+ transition: { duration: motionDuration.slow, ease: motionEase },
26
+ },
27
+ };
28
+
29
+ export type LandingSectionProps = {
30
+ id?: string;
31
+ children: ReactNode;
32
+ className?: string;
33
+ };
34
+
35
+ /** Landing column with section spacing and a `scroll-mt-24` anchor offset. */
36
+ export function LandingSection({ id, children, className }: LandingSectionProps) {
37
+ return (
38
+ <section
39
+ id={id}
40
+ className={cn(landingShellClass, "scroll-mt-24 py-20 sm:py-28 lg:py-32", className)}
41
+ >
42
+ {children}
43
+ </section>
44
+ );
45
+ }
46
+
47
+ export type LandingSectionHeadingProps = {
48
+ eyebrow: string;
49
+ heading: string;
50
+ intro?: string;
51
+ className?: string;
52
+ };
53
+
54
+ /** Mono eyebrow, large heading and optional intro. */
55
+ export function LandingSectionHeading({ eyebrow, heading, intro, className }: LandingSectionHeadingProps) {
56
+ return (
57
+ <div className={cn("max-w-2xl", className)}>
58
+ <p className={landingClasses.eyebrow}>{eyebrow}</p>
59
+ <h2 className="text-balance font-semibold text-3xl leading-[1.08] tracking-[-0.03em] text-foreground sm:text-5xl">
60
+ {heading}
61
+ </h2>
62
+ {intro ? <p className={landingClasses.sectionIntro}>{intro}</p> : null}
63
+ </div>
64
+ );
65
+ }
66
+
67
+ export type LandingLatticeProps = { children: ReactNode; className?: string };
68
+
69
+ /** Shared border through 1px gaps so adjacent cells don't double a hairline. */
70
+ export function LandingLattice({ children, className }: LandingLatticeProps) {
71
+ return (
72
+ <div className="overflow-hidden rounded-2xl border border-separator">
73
+ <div className={cn("grid gap-px bg-separator", className)}>{children}</div>
74
+ </div>
75
+ );
76
+ }
77
+
78
+ export type LandingFeature = {
79
+ /** Rendered with `size={18} stroke={1.5}`, for example a Tabler icon. */
80
+ icon: ComponentType<{ size?: number; stroke?: number }>;
81
+ title: string;
82
+ description: string;
83
+ };
84
+
85
+ /** Feature tile: inverted icon square, title and description, with a hover lift and edge bar. */
86
+ export function LandingFeatureCard({ icon: Icon, title, description }: LandingFeature) {
87
+ return (
88
+ <div className="group relative flex gap-3 overflow-hidden rounded-2xl border border-separator bg-surface px-3.5 py-3.5 transition-[transform,background-color] duration-200 ease-out hover:-translate-y-0.5 hover:bg-surface-secondary sm:gap-4 sm:px-5 sm:py-4">
89
+ <div
90
+ className="absolute inset-y-3 left-0 w-1 rounded-full bg-foreground/0 transition-[background-color] duration-200 group-hover:bg-foreground/20"
91
+ aria-hidden
92
+ />
93
+ <div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-foreground text-background transition-transform duration-200 ease-out group-hover:scale-[1.04]">
94
+ <Icon size={18} stroke={1.5} />
95
+ </div>
96
+ <div className="min-w-0 pt-0.5">
97
+ <p className="text-sm font-medium text-foreground">{title}</p>
98
+ <p className={landingClasses.featureDescription}>{description}</p>
99
+ </div>
100
+ </div>
101
+ );
102
+ }
103
+
104
+ export type LandingNavMenuProps = {
105
+ links: readonly LandingLink[];
106
+ /** Last item, after a separator: opens in a new tab and reads "GitHub". */
107
+ github: { href: string; icon: ReactNode };
108
+ };
109
+
110
+ /**
111
+ * Overflow menu below `md`. Section links do not fit a phone-width bar;
112
+ * the auth buttons stay in the bar itself.
113
+ */
114
+ export function LandingNavMenu({ links, github }: LandingNavMenuProps) {
115
+ return (
116
+ <DropdownMenu>
117
+ <DropdownMenuTrigger asChild>
118
+ <Button variant="ghost" size="icon-sm" aria-label="Open menu" className="md:hidden">
119
+ <IconMenu2 size={18} />
120
+ </Button>
121
+ </DropdownMenuTrigger>
122
+ <DropdownMenuContent
123
+ align="end"
124
+ className="max-h-[70dvh] w-56 max-w-[calc(100vw-2rem)] overflow-y-auto"
125
+ >
126
+ {links.map((link) => (
127
+ <DropdownMenuItem key={link.href} asChild className="max-sm:py-2.5">
128
+ <a href={link.href}>{link.label}</a>
129
+ </DropdownMenuItem>
130
+ ))}
131
+ <DropdownMenuSeparator />
132
+ <DropdownMenuItem asChild className="max-sm:py-2.5">
133
+ <a href={github.href} target="_blank" rel="noreferrer">
134
+ {github.icon}
135
+ GitHub
136
+ </a>
137
+ </DropdownMenuItem>
138
+ </DropdownMenuContent>
139
+ </DropdownMenu>
140
+ );
141
+ }
142
+
143
+ export type LandingFooterProps = {
144
+ /** Wordmark above the tagline. */
145
+ brand: ReactNode;
146
+ tagline: ReactNode;
147
+ links: readonly LandingLink[];
148
+ /** After the links, before GitHub. Style with `landingFooterLinkClass` or `landingFooterButtonClass`. */
149
+ actions?: ReactNode;
150
+ /** `label` is the link's `aria-label`. */
151
+ github: { href: string; label: string; icon: ReactNode };
152
+ };
153
+
154
+ /** Footer row: brand and tagline, then section links, app actions and a GitHub icon link. */
155
+ export function LandingFooter({ brand, tagline, links, actions, github }: LandingFooterProps) {
156
+ return (
157
+ <footer className="border-t border-separator">
158
+ <div
159
+ className={`${landingShellClass} flex flex-col gap-6 pb-[max(2.5rem,env(safe-area-inset-bottom))] pt-10 sm:flex-row sm:items-center sm:justify-between`}
160
+ >
161
+ <div>
162
+ {brand}
163
+ <p className={landingClasses.footerTagline}>{tagline}</p>
164
+ </div>
165
+ <nav className="flex flex-wrap items-center gap-x-5 gap-y-2" aria-label="Footer">
166
+ {links.map((link) => (
167
+ <a key={link.href} href={link.href} className={landingFooterLinkClass}>
168
+ {link.label}
169
+ </a>
170
+ ))}
171
+ {actions}
172
+ <a
173
+ href={github.href}
174
+ target="_blank"
175
+ rel="noreferrer"
176
+ aria-label={github.label}
177
+ className={landingClasses.footerGithub}
178
+ >
179
+ {github.icon}
180
+ </a>
181
+ </nav>
182
+ </div>
183
+ </footer>
184
+ );
185
+ }
186
+
187
+ export type LandingPageLayoutProps = {
188
+ /** Sticky header, usually `LandingNav`. */
189
+ nav: ReactNode;
190
+ /** Inside the hero's atmosphere block, before `hero` (for example an ambient graphic). */
191
+ heroBackdrop?: ReactNode;
192
+ hero: ReactNode;
193
+ /** Sections after the hero, inside `<main>`. */
194
+ children?: ReactNode;
195
+ footer: ReactNode;
196
+ };
197
+
198
+ /**
199
+ * Page frame: `#top` root, nav, a `<main>` whose first block is the hero on the
200
+ * grid-and-grain atmosphere, then the sections and the footer. Import
201
+ * `@vvedantb/ui/landing.css` for the atmosphere, grain and pulse classes.
202
+ */
203
+ export function LandingPageLayout({ nav, heroBackdrop, hero, children, footer }: LandingPageLayoutProps) {
204
+ return (
205
+ <div id="top" className="relative min-h-[100dvh] bg-background text-foreground">
206
+ {nav}
207
+ <main>
208
+ <div className="landing-atmosphere landing-grain relative overflow-hidden border-b border-separator">
209
+ {heroBackdrop}
210
+ {hero}
211
+ </div>
212
+ {children}
213
+ </main>
214
+ {footer}
215
+ </div>
216
+ );
217
+ }