@booga/vblocks 0.1.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/CHANGELOG.md +18 -0
- package/LICENSE +21 -0
- package/README.md +83 -0
- package/dist/blog/index.cjs +148 -0
- package/dist/blog/index.cjs.map +1 -0
- package/dist/blog/index.d.cts +140 -0
- package/dist/blog/index.d.ts +140 -0
- package/dist/blog/index.js +141 -0
- package/dist/blog/index.js.map +1 -0
- package/dist/business/index.cjs +121 -0
- package/dist/business/index.cjs.map +1 -0
- package/dist/business/index.d.cts +102 -0
- package/dist/business/index.d.ts +102 -0
- package/dist/business/index.js +114 -0
- package/dist/business/index.js.map +1 -0
- package/dist/cta/index.cjs +99 -0
- package/dist/cta/index.cjs.map +1 -0
- package/dist/cta/index.d.cts +110 -0
- package/dist/cta/index.d.ts +110 -0
- package/dist/cta/index.js +92 -0
- package/dist/cta/index.js.map +1 -0
- package/dist/faq/index.cjs +93 -0
- package/dist/faq/index.cjs.map +1 -0
- package/dist/faq/index.d.cts +71 -0
- package/dist/faq/index.d.ts +71 -0
- package/dist/faq/index.js +86 -0
- package/dist/faq/index.js.map +1 -0
- package/dist/features/index.cjs +104 -0
- package/dist/features/index.cjs.map +1 -0
- package/dist/features/index.d.cts +81 -0
- package/dist/features/index.d.ts +81 -0
- package/dist/features/index.js +97 -0
- package/dist/features/index.js.map +1 -0
- package/dist/footer/index.cjs +117 -0
- package/dist/footer/index.cjs.map +1 -0
- package/dist/footer/index.d.cts +107 -0
- package/dist/footer/index.d.ts +107 -0
- package/dist/footer/index.js +110 -0
- package/dist/footer/index.js.map +1 -0
- package/dist/gallery/index.cjs +106 -0
- package/dist/gallery/index.cjs.map +1 -0
- package/dist/gallery/index.d.cts +78 -0
- package/dist/gallery/index.d.ts +78 -0
- package/dist/gallery/index.js +99 -0
- package/dist/gallery/index.js.map +1 -0
- package/dist/hero/index.cjs +108 -0
- package/dist/hero/index.cjs.map +1 -0
- package/dist/hero/index.d.cts +134 -0
- package/dist/hero/index.d.ts +134 -0
- package/dist/hero/index.js +101 -0
- package/dist/hero/index.js.map +1 -0
- package/dist/index.cjs +1079 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +22 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +1005 -0
- package/dist/index.js.map +1 -0
- package/dist/portfolio/index.cjs +122 -0
- package/dist/portfolio/index.cjs.map +1 -0
- package/dist/portfolio/index.d.cts +120 -0
- package/dist/portfolio/index.d.ts +120 -0
- package/dist/portfolio/index.js +115 -0
- package/dist/portfolio/index.js.map +1 -0
- package/dist/post/index.cjs +116 -0
- package/dist/post/index.cjs.map +1 -0
- package/dist/post/index.d.cts +74 -0
- package/dist/post/index.d.ts +74 -0
- package/dist/post/index.js +109 -0
- package/dist/post/index.js.map +1 -0
- package/dist/team/index.cjs +120 -0
- package/dist/team/index.cjs.map +1 -0
- package/dist/team/index.d.cts +128 -0
- package/dist/team/index.d.ts +128 -0
- package/dist/team/index.js +113 -0
- package/dist/team/index.js.map +1 -0
- package/dist/testimonial/index.cjs +130 -0
- package/dist/testimonial/index.cjs.map +1 -0
- package/dist/testimonial/index.d.cts +113 -0
- package/dist/testimonial/index.d.ts +113 -0
- package/dist/testimonial/index.js +123 -0
- package/dist/testimonial/index.js.map +1 -0
- package/dist/types-n6w6cZmP.d.cts +16 -0
- package/dist/types-n6w6cZmP.d.ts +16 -0
- package/package.json +126 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/primitives.ts","../../src/theme.ts","../../src/gallery/GallerySplit/schema.ts","../../src/gallery/GallerySplit/index.tsx","../../src/gallery/GallerySplit/default.ts","../../src/gallery/GalleryGrid/schema.ts","../../src/gallery/GalleryGrid/index.tsx","../../src/gallery/GalleryGrid/default.ts"],"names":["dsl","Box","Stack","Grid","Inline","z","jsx","jsxs","cn","GalleryItemSchema"],"mappings":";;;;;;;;AAQO,IAAM,IAAA,GAAUA,SAAIC,OA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from \"react\";\nimport { dsl } from \"@booga/vdsl\";\nimport { Box, Stack, Grid, Inline } from \"@booga/vui\";\n\n// PolymorphicComponent is not structurally assignable to ElementType; dsl() uses\n// createElement() at runtime which accepts any callable, so the bridge is safe.\nexport const DBox = dsl(Box as unknown as ElementType);\nexport const DStack = dsl(Stack as unknown as ElementType);\nexport const DGrid = dsl(Grid as unknown as ElementType);\nexport const DInline = dsl(Inline as unknown as ElementType);\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { type CSSProperties } from \"react\";\nimport { type ThemeOverride } from \"./types\";\n\nexport function themeStyle(theme: ThemeOverride | undefined): CSSProperties | undefined {\n if (!theme) return undefined;\n return Object.fromEntries(\n Object.entries(theme).map(([k, v]) => [`--v-${k}`, v])\n ) as CSSProperties;\n}\n\nexport function clampedGridCols(n: number): 1 | 2 | 3 | 4 | 5 | 6 {\n return Math.max(1, Math.min(6, Math.round(n))) as 1 | 2 | 3 | 4 | 5 | 6;\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { z } from \"zod\";\n\nconst GalleryItemSchema = z.object({\n src: z.string(),\n alt: z.string(),\n caption: z.string().optional(),\n}).strict();\n\nexport const GallerySplitContentSchema = z.object({\n heading: z.string(),\n description: z.string().optional(),\n items: z.array(GalleryItemSchema).min(1),\n}).strict();\n\nexport type GallerySplitContent = z.infer<typeof GallerySplitContentSchema>;\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { cn } from \"@booga/vui\";\nimport { DBox, DGrid, DStack } from \"../../primitives\";\nimport { type BlockProps } from \"../../types\";\nimport { themeStyle } from \"../../theme\";\nimport { GallerySplitContentSchema, type GallerySplitContent } from \"./schema\";\n\nexport function GallerySplit({ content, theme }: BlockProps<GallerySplitContent>) {\n GallerySplitContentSchema.parse(content);\n const { heading, description, items } = content;\n return (\n <DBox as=\"section\" aria-label={heading} style={themeStyle(theme)}>\n <DGrid columns={2} px={6} py={16} gap={12} align=\"start\" className={cn(\"max-w-6xl mx-auto\")}>\n <DStack gap={4} className={cn(\"sticky top-16\")}>\n <DBox as=\"h2\" className={cn(\"text-3xl font-bold tracking-tight\")}>{heading}</DBox>\n {description && (\n <DBox as=\"p\" color=\"muted\">{description}</DBox>\n )}\n </DStack>\n <DBox as=\"ul\" m={0} p={0} gap={4} display=\"grid\" className={cn(\"list-none grid-cols-2\")}>\n {items.map((item, i) => (\n <DBox as=\"li\" key={i}>\n <DBox as=\"figure\" m={0}>\n <DBox\n as=\"img\"\n src={item.src}\n alt={item.alt}\n className={cn(\"w-full rounded-lg object-cover aspect-square\")}\n />\n {item.caption && (\n <DBox as=\"figcaption\" color=\"muted\" mt={1} className={cn(\"text-xs\")}>\n {item.caption}\n </DBox>\n )}\n </DBox>\n </DBox>\n ))}\n </DBox>\n </DGrid>\n </DBox>\n );\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { type GallerySplitContent } from \"./schema\";\n\nexport const GallerySplitDefaultContent: GallerySplitContent = {\n heading: \"Our work\",\n description: \"A selection of recent projects.\",\n items: [\n { src: \"https://placehold.co/400x300\", alt: \"Project one\" },\n { src: \"https://placehold.co/400x300\", alt: \"Project two\" },\n { src: \"https://placehold.co/400x300\", alt: \"Project three\", caption: \"Featured project\" },\n ],\n};\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { z } from \"zod\";\n\nconst GalleryItemSchema = z.object({\n src: z.string(),\n alt: z.string(),\n caption: z.string().optional(),\n}).strict();\n\nexport const GalleryGridContentSchema = z.object({\n items: z.array(GalleryItemSchema).min(1),\n}).strict();\n\nexport type GalleryGridContent = z.infer<typeof GalleryGridContentSchema>;\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { cn } from \"@booga/vui\";\nimport { DBox, DGrid } from \"../../primitives\";\nimport { type BlockProps } from \"../../types\";\nimport { themeStyle } from \"../../theme\";\nimport { GalleryGridContentSchema, type GalleryGridContent } from \"./schema\";\n\nexport function GalleryGrid({ content, theme }: BlockProps<GalleryGridContent>) {\n GalleryGridContentSchema.parse(content);\n const { items } = content;\n return (\n <DBox as=\"section\" aria-label=\"Gallery\" style={themeStyle(theme)}>\n <DGrid columns={3} px={6} py={12} gap={4} className={cn(\"max-w-6xl mx-auto\")}>\n {items.map((item, i) => (\n <DBox as=\"figure\" key={i} m={0}>\n <DBox\n as=\"img\"\n src={item.src}\n alt={item.alt}\n className={cn(\"w-full rounded-lg object-cover aspect-square\")}\n />\n {item.caption && (\n <DBox as=\"figcaption\" color=\"muted\" mt={1} className={cn(\"text-xs\")}>\n {item.caption}\n </DBox>\n )}\n </DBox>\n ))}\n </DGrid>\n </DBox>\n );\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { type GalleryGridContent } from \"./schema\";\n\nexport const GalleryGridDefaultContent: GalleryGridContent = {\n items: [\n { src: \"https://placehold.co/400x400\", alt: \"Gallery image one\" },\n { src: \"https://placehold.co/400x400\", alt: \"Gallery image two\" },\n { src: \"https://placehold.co/400x400\", alt: \"Gallery image three\" },\n { src: \"https://placehold.co/400x400\", alt: \"Gallery image four\", caption: \"Featured\" },\n ],\n};\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { a as BlockProps } from '../types-n6w6cZmP.cjs';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
declare const GallerySplitContentSchema: z.ZodObject<{
|
|
7
|
+
heading: z.ZodString;
|
|
8
|
+
description: z.ZodOptional<z.ZodString>;
|
|
9
|
+
items: z.ZodArray<z.ZodObject<{
|
|
10
|
+
src: z.ZodString;
|
|
11
|
+
alt: z.ZodString;
|
|
12
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, "strict", z.ZodTypeAny, {
|
|
14
|
+
src: string;
|
|
15
|
+
alt: string;
|
|
16
|
+
caption?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
src: string;
|
|
19
|
+
alt: string;
|
|
20
|
+
caption?: string | undefined;
|
|
21
|
+
}>, "many">;
|
|
22
|
+
}, "strict", z.ZodTypeAny, {
|
|
23
|
+
heading: string;
|
|
24
|
+
items: {
|
|
25
|
+
src: string;
|
|
26
|
+
alt: string;
|
|
27
|
+
caption?: string | undefined;
|
|
28
|
+
}[];
|
|
29
|
+
description?: string | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
heading: string;
|
|
32
|
+
items: {
|
|
33
|
+
src: string;
|
|
34
|
+
alt: string;
|
|
35
|
+
caption?: string | undefined;
|
|
36
|
+
}[];
|
|
37
|
+
description?: string | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
type GallerySplitContent = z.infer<typeof GallerySplitContentSchema>;
|
|
40
|
+
|
|
41
|
+
declare function GallerySplit({ content, theme }: BlockProps<GallerySplitContent>): react_jsx_runtime.JSX.Element;
|
|
42
|
+
|
|
43
|
+
declare const GallerySplitDefaultContent: GallerySplitContent;
|
|
44
|
+
|
|
45
|
+
declare const GalleryGridContentSchema: z.ZodObject<{
|
|
46
|
+
items: z.ZodArray<z.ZodObject<{
|
|
47
|
+
src: z.ZodString;
|
|
48
|
+
alt: z.ZodString;
|
|
49
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, "strict", z.ZodTypeAny, {
|
|
51
|
+
src: string;
|
|
52
|
+
alt: string;
|
|
53
|
+
caption?: string | undefined;
|
|
54
|
+
}, {
|
|
55
|
+
src: string;
|
|
56
|
+
alt: string;
|
|
57
|
+
caption?: string | undefined;
|
|
58
|
+
}>, "many">;
|
|
59
|
+
}, "strict", z.ZodTypeAny, {
|
|
60
|
+
items: {
|
|
61
|
+
src: string;
|
|
62
|
+
alt: string;
|
|
63
|
+
caption?: string | undefined;
|
|
64
|
+
}[];
|
|
65
|
+
}, {
|
|
66
|
+
items: {
|
|
67
|
+
src: string;
|
|
68
|
+
alt: string;
|
|
69
|
+
caption?: string | undefined;
|
|
70
|
+
}[];
|
|
71
|
+
}>;
|
|
72
|
+
type GalleryGridContent = z.infer<typeof GalleryGridContentSchema>;
|
|
73
|
+
|
|
74
|
+
declare function GalleryGrid({ content, theme }: BlockProps<GalleryGridContent>): react_jsx_runtime.JSX.Element;
|
|
75
|
+
|
|
76
|
+
declare const GalleryGridDefaultContent: GalleryGridContent;
|
|
77
|
+
|
|
78
|
+
export { GalleryGrid, type GalleryGridContent, GalleryGridContentSchema, GalleryGridDefaultContent, GallerySplit, type GallerySplitContent, GallerySplitContentSchema, GallerySplitDefaultContent };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { a as BlockProps } from '../types-n6w6cZmP.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
declare const GallerySplitContentSchema: z.ZodObject<{
|
|
7
|
+
heading: z.ZodString;
|
|
8
|
+
description: z.ZodOptional<z.ZodString>;
|
|
9
|
+
items: z.ZodArray<z.ZodObject<{
|
|
10
|
+
src: z.ZodString;
|
|
11
|
+
alt: z.ZodString;
|
|
12
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, "strict", z.ZodTypeAny, {
|
|
14
|
+
src: string;
|
|
15
|
+
alt: string;
|
|
16
|
+
caption?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
src: string;
|
|
19
|
+
alt: string;
|
|
20
|
+
caption?: string | undefined;
|
|
21
|
+
}>, "many">;
|
|
22
|
+
}, "strict", z.ZodTypeAny, {
|
|
23
|
+
heading: string;
|
|
24
|
+
items: {
|
|
25
|
+
src: string;
|
|
26
|
+
alt: string;
|
|
27
|
+
caption?: string | undefined;
|
|
28
|
+
}[];
|
|
29
|
+
description?: string | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
heading: string;
|
|
32
|
+
items: {
|
|
33
|
+
src: string;
|
|
34
|
+
alt: string;
|
|
35
|
+
caption?: string | undefined;
|
|
36
|
+
}[];
|
|
37
|
+
description?: string | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
type GallerySplitContent = z.infer<typeof GallerySplitContentSchema>;
|
|
40
|
+
|
|
41
|
+
declare function GallerySplit({ content, theme }: BlockProps<GallerySplitContent>): react_jsx_runtime.JSX.Element;
|
|
42
|
+
|
|
43
|
+
declare const GallerySplitDefaultContent: GallerySplitContent;
|
|
44
|
+
|
|
45
|
+
declare const GalleryGridContentSchema: z.ZodObject<{
|
|
46
|
+
items: z.ZodArray<z.ZodObject<{
|
|
47
|
+
src: z.ZodString;
|
|
48
|
+
alt: z.ZodString;
|
|
49
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, "strict", z.ZodTypeAny, {
|
|
51
|
+
src: string;
|
|
52
|
+
alt: string;
|
|
53
|
+
caption?: string | undefined;
|
|
54
|
+
}, {
|
|
55
|
+
src: string;
|
|
56
|
+
alt: string;
|
|
57
|
+
caption?: string | undefined;
|
|
58
|
+
}>, "many">;
|
|
59
|
+
}, "strict", z.ZodTypeAny, {
|
|
60
|
+
items: {
|
|
61
|
+
src: string;
|
|
62
|
+
alt: string;
|
|
63
|
+
caption?: string | undefined;
|
|
64
|
+
}[];
|
|
65
|
+
}, {
|
|
66
|
+
items: {
|
|
67
|
+
src: string;
|
|
68
|
+
alt: string;
|
|
69
|
+
caption?: string | undefined;
|
|
70
|
+
}[];
|
|
71
|
+
}>;
|
|
72
|
+
type GalleryGridContent = z.infer<typeof GalleryGridContentSchema>;
|
|
73
|
+
|
|
74
|
+
declare function GalleryGrid({ content, theme }: BlockProps<GalleryGridContent>): react_jsx_runtime.JSX.Element;
|
|
75
|
+
|
|
76
|
+
declare const GalleryGridDefaultContent: GalleryGridContent;
|
|
77
|
+
|
|
78
|
+
export { GalleryGrid, type GalleryGridContent, GalleryGridContentSchema, GalleryGridDefaultContent, GallerySplit, type GallerySplitContent, GallerySplitContentSchema, GallerySplitDefaultContent };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Box, Stack, Grid, Inline, cn } from '@booga/vui';
|
|
2
|
+
import { dsl } from '@booga/vdsl';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
// src/gallery/GallerySplit/index.tsx
|
|
7
|
+
var DBox = dsl(Box);
|
|
8
|
+
var DStack = dsl(Stack);
|
|
9
|
+
var DGrid = dsl(Grid);
|
|
10
|
+
dsl(Inline);
|
|
11
|
+
|
|
12
|
+
// src/theme.ts
|
|
13
|
+
function themeStyle(theme) {
|
|
14
|
+
if (!theme) return void 0;
|
|
15
|
+
return Object.fromEntries(
|
|
16
|
+
Object.entries(theme).map(([k, v]) => [`--v-${k}`, v])
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
var GalleryItemSchema = z.object({
|
|
20
|
+
src: z.string(),
|
|
21
|
+
alt: z.string(),
|
|
22
|
+
caption: z.string().optional()
|
|
23
|
+
}).strict();
|
|
24
|
+
var GallerySplitContentSchema = z.object({
|
|
25
|
+
heading: z.string(),
|
|
26
|
+
description: z.string().optional(),
|
|
27
|
+
items: z.array(GalleryItemSchema).min(1)
|
|
28
|
+
}).strict();
|
|
29
|
+
function GallerySplit({ content, theme }) {
|
|
30
|
+
GallerySplitContentSchema.parse(content);
|
|
31
|
+
const { heading, description, items } = content;
|
|
32
|
+
return /* @__PURE__ */ jsx(DBox, { as: "section", "aria-label": heading, style: themeStyle(theme), children: /* @__PURE__ */ jsxs(DGrid, { columns: 2, px: 6, py: 16, gap: 12, align: "start", className: cn("max-w-6xl mx-auto"), children: [
|
|
33
|
+
/* @__PURE__ */ jsxs(DStack, { gap: 4, className: cn("sticky top-16"), children: [
|
|
34
|
+
/* @__PURE__ */ jsx(DBox, { as: "h2", className: cn("text-3xl font-bold tracking-tight"), children: heading }),
|
|
35
|
+
description && /* @__PURE__ */ jsx(DBox, { as: "p", color: "muted", children: description })
|
|
36
|
+
] }),
|
|
37
|
+
/* @__PURE__ */ jsx(DBox, { as: "ul", m: 0, p: 0, gap: 4, display: "grid", className: cn("list-none grid-cols-2"), children: items.map((item, i) => /* @__PURE__ */ jsx(DBox, { as: "li", children: /* @__PURE__ */ jsxs(DBox, { as: "figure", m: 0, children: [
|
|
38
|
+
/* @__PURE__ */ jsx(
|
|
39
|
+
DBox,
|
|
40
|
+
{
|
|
41
|
+
as: "img",
|
|
42
|
+
src: item.src,
|
|
43
|
+
alt: item.alt,
|
|
44
|
+
className: cn("w-full rounded-lg object-cover aspect-square")
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
item.caption && /* @__PURE__ */ jsx(DBox, { as: "figcaption", color: "muted", mt: 1, className: cn("text-xs"), children: item.caption })
|
|
48
|
+
] }) }, i)) })
|
|
49
|
+
] }) });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/gallery/GallerySplit/default.ts
|
|
53
|
+
var GallerySplitDefaultContent = {
|
|
54
|
+
heading: "Our work",
|
|
55
|
+
description: "A selection of recent projects.",
|
|
56
|
+
items: [
|
|
57
|
+
{ src: "https://placehold.co/400x300", alt: "Project one" },
|
|
58
|
+
{ src: "https://placehold.co/400x300", alt: "Project two" },
|
|
59
|
+
{ src: "https://placehold.co/400x300", alt: "Project three", caption: "Featured project" }
|
|
60
|
+
]
|
|
61
|
+
};
|
|
62
|
+
var GalleryItemSchema2 = z.object({
|
|
63
|
+
src: z.string(),
|
|
64
|
+
alt: z.string(),
|
|
65
|
+
caption: z.string().optional()
|
|
66
|
+
}).strict();
|
|
67
|
+
var GalleryGridContentSchema = z.object({
|
|
68
|
+
items: z.array(GalleryItemSchema2).min(1)
|
|
69
|
+
}).strict();
|
|
70
|
+
function GalleryGrid({ content, theme }) {
|
|
71
|
+
GalleryGridContentSchema.parse(content);
|
|
72
|
+
const { items } = content;
|
|
73
|
+
return /* @__PURE__ */ jsx(DBox, { as: "section", "aria-label": "Gallery", style: themeStyle(theme), children: /* @__PURE__ */ jsx(DGrid, { columns: 3, px: 6, py: 12, gap: 4, className: cn("max-w-6xl mx-auto"), children: items.map((item, i) => /* @__PURE__ */ jsxs(DBox, { as: "figure", m: 0, children: [
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
DBox,
|
|
76
|
+
{
|
|
77
|
+
as: "img",
|
|
78
|
+
src: item.src,
|
|
79
|
+
alt: item.alt,
|
|
80
|
+
className: cn("w-full rounded-lg object-cover aspect-square")
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
item.caption && /* @__PURE__ */ jsx(DBox, { as: "figcaption", color: "muted", mt: 1, className: cn("text-xs"), children: item.caption })
|
|
84
|
+
] }, i)) }) });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// src/gallery/GalleryGrid/default.ts
|
|
88
|
+
var GalleryGridDefaultContent = {
|
|
89
|
+
items: [
|
|
90
|
+
{ src: "https://placehold.co/400x400", alt: "Gallery image one" },
|
|
91
|
+
{ src: "https://placehold.co/400x400", alt: "Gallery image two" },
|
|
92
|
+
{ src: "https://placehold.co/400x400", alt: "Gallery image three" },
|
|
93
|
+
{ src: "https://placehold.co/400x400", alt: "Gallery image four", caption: "Featured" }
|
|
94
|
+
]
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export { GalleryGrid, GalleryGridContentSchema, GalleryGridDefaultContent, GallerySplit, GallerySplitContentSchema, GallerySplitDefaultContent };
|
|
98
|
+
//# sourceMappingURL=index.js.map
|
|
99
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/primitives.ts","../../src/theme.ts","../../src/gallery/GallerySplit/schema.ts","../../src/gallery/GallerySplit/index.tsx","../../src/gallery/GallerySplit/default.ts","../../src/gallery/GalleryGrid/schema.ts","../../src/gallery/GalleryGrid/index.tsx","../../src/gallery/GalleryGrid/default.ts"],"names":["GalleryItem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Copyright (c) 2026 bvasilenko\nimport { type ElementType } from \"react\";\nimport { dsl } from \"@booga/vdsl\";\nimport { Box, Stack, Grid, Inline } from \"@booga/vui\";\n\n// PolymorphicComponent is not structurally assignable to ElementType; dsl() uses\n// createElement() at runtime which accepts any callable, so the bridge is safe.\nexport const DBox = dsl(Box as unknown as ElementType);\nexport const DStack = dsl(Stack as unknown as ElementType);\nexport const DGrid = dsl(Grid as unknown as ElementType);\nexport const DInline = dsl(Inline as unknown as ElementType);\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { type CSSProperties } from \"react\";\nimport { type ThemeOverride } from \"./types\";\n\nexport function themeStyle(theme: ThemeOverride | undefined): CSSProperties | undefined {\n if (!theme) return undefined;\n return Object.fromEntries(\n Object.entries(theme).map(([k, v]) => [`--v-${k}`, v])\n ) as CSSProperties;\n}\n\nexport function clampedGridCols(n: number): 1 | 2 | 3 | 4 | 5 | 6 {\n return Math.max(1, Math.min(6, Math.round(n))) as 1 | 2 | 3 | 4 | 5 | 6;\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { z } from \"zod\";\n\nconst GalleryItemSchema = z.object({\n src: z.string(),\n alt: z.string(),\n caption: z.string().optional(),\n}).strict();\n\nexport const GallerySplitContentSchema = z.object({\n heading: z.string(),\n description: z.string().optional(),\n items: z.array(GalleryItemSchema).min(1),\n}).strict();\n\nexport type GallerySplitContent = z.infer<typeof GallerySplitContentSchema>;\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { cn } from \"@booga/vui\";\nimport { DBox, DGrid, DStack } from \"../../primitives\";\nimport { type BlockProps } from \"../../types\";\nimport { themeStyle } from \"../../theme\";\nimport { GallerySplitContentSchema, type GallerySplitContent } from \"./schema\";\n\nexport function GallerySplit({ content, theme }: BlockProps<GallerySplitContent>) {\n GallerySplitContentSchema.parse(content);\n const { heading, description, items } = content;\n return (\n <DBox as=\"section\" aria-label={heading} style={themeStyle(theme)}>\n <DGrid columns={2} px={6} py={16} gap={12} align=\"start\" className={cn(\"max-w-6xl mx-auto\")}>\n <DStack gap={4} className={cn(\"sticky top-16\")}>\n <DBox as=\"h2\" className={cn(\"text-3xl font-bold tracking-tight\")}>{heading}</DBox>\n {description && (\n <DBox as=\"p\" color=\"muted\">{description}</DBox>\n )}\n </DStack>\n <DBox as=\"ul\" m={0} p={0} gap={4} display=\"grid\" className={cn(\"list-none grid-cols-2\")}>\n {items.map((item, i) => (\n <DBox as=\"li\" key={i}>\n <DBox as=\"figure\" m={0}>\n <DBox\n as=\"img\"\n src={item.src}\n alt={item.alt}\n className={cn(\"w-full rounded-lg object-cover aspect-square\")}\n />\n {item.caption && (\n <DBox as=\"figcaption\" color=\"muted\" mt={1} className={cn(\"text-xs\")}>\n {item.caption}\n </DBox>\n )}\n </DBox>\n </DBox>\n ))}\n </DBox>\n </DGrid>\n </DBox>\n );\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { type GallerySplitContent } from \"./schema\";\n\nexport const GallerySplitDefaultContent: GallerySplitContent = {\n heading: \"Our work\",\n description: \"A selection of recent projects.\",\n items: [\n { src: \"https://placehold.co/400x300\", alt: \"Project one\" },\n { src: \"https://placehold.co/400x300\", alt: \"Project two\" },\n { src: \"https://placehold.co/400x300\", alt: \"Project three\", caption: \"Featured project\" },\n ],\n};\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { z } from \"zod\";\n\nconst GalleryItemSchema = z.object({\n src: z.string(),\n alt: z.string(),\n caption: z.string().optional(),\n}).strict();\n\nexport const GalleryGridContentSchema = z.object({\n items: z.array(GalleryItemSchema).min(1),\n}).strict();\n\nexport type GalleryGridContent = z.infer<typeof GalleryGridContentSchema>;\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { cn } from \"@booga/vui\";\nimport { DBox, DGrid } from \"../../primitives\";\nimport { type BlockProps } from \"../../types\";\nimport { themeStyle } from \"../../theme\";\nimport { GalleryGridContentSchema, type GalleryGridContent } from \"./schema\";\n\nexport function GalleryGrid({ content, theme }: BlockProps<GalleryGridContent>) {\n GalleryGridContentSchema.parse(content);\n const { items } = content;\n return (\n <DBox as=\"section\" aria-label=\"Gallery\" style={themeStyle(theme)}>\n <DGrid columns={3} px={6} py={12} gap={4} className={cn(\"max-w-6xl mx-auto\")}>\n {items.map((item, i) => (\n <DBox as=\"figure\" key={i} m={0}>\n <DBox\n as=\"img\"\n src={item.src}\n alt={item.alt}\n className={cn(\"w-full rounded-lg object-cover aspect-square\")}\n />\n {item.caption && (\n <DBox as=\"figcaption\" color=\"muted\" mt={1} className={cn(\"text-xs\")}>\n {item.caption}\n </DBox>\n )}\n </DBox>\n ))}\n </DGrid>\n </DBox>\n );\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { type GalleryGridContent } from \"./schema\";\n\nexport const GalleryGridDefaultContent: GalleryGridContent = {\n items: [\n { src: \"https://placehold.co/400x400\", alt: \"Gallery image one\" },\n { src: \"https://placehold.co/400x400\", alt: \"Gallery image two\" },\n { src: \"https://placehold.co/400x400\", alt: \"Gallery image three\" },\n { src: \"https://placehold.co/400x400\", alt: \"Gallery image four\", caption: \"Featured\" },\n ],\n};\n"]}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vui = require('@booga/vui');
|
|
4
|
+
var vdsl = require('@booga/vdsl');
|
|
5
|
+
var zod = require('zod');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
// src/hero/HeroSplit/index.tsx
|
|
9
|
+
var DBox = vdsl.dsl(vui.Box);
|
|
10
|
+
var DStack = vdsl.dsl(vui.Stack);
|
|
11
|
+
var DGrid = vdsl.dsl(vui.Grid);
|
|
12
|
+
var DInline = vdsl.dsl(vui.Inline);
|
|
13
|
+
|
|
14
|
+
// src/theme.ts
|
|
15
|
+
function themeStyle(theme) {
|
|
16
|
+
if (!theme) return void 0;
|
|
17
|
+
return Object.fromEntries(
|
|
18
|
+
Object.entries(theme).map(([k, v]) => [`--v-${k}`, v])
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
var CtaSchema = zod.z.object({
|
|
22
|
+
label: zod.z.string(),
|
|
23
|
+
href: zod.z.string()
|
|
24
|
+
}).strict();
|
|
25
|
+
var ImageSchema = zod.z.object({
|
|
26
|
+
src: zod.z.string(),
|
|
27
|
+
alt: zod.z.string()
|
|
28
|
+
}).strict();
|
|
29
|
+
|
|
30
|
+
// src/hero/HeroSplit/schema.ts
|
|
31
|
+
var HeroSplitContentSchema = zod.z.object({
|
|
32
|
+
eyebrow: zod.z.string().optional(),
|
|
33
|
+
heading: zod.z.string(),
|
|
34
|
+
description: zod.z.string(),
|
|
35
|
+
primaryCta: CtaSchema,
|
|
36
|
+
secondaryCta: CtaSchema.optional(),
|
|
37
|
+
image: ImageSchema
|
|
38
|
+
}).strict();
|
|
39
|
+
function HeroSplit({ content, theme }) {
|
|
40
|
+
HeroSplitContentSchema.parse(content);
|
|
41
|
+
const { eyebrow, heading, description, primaryCta, secondaryCta, image } = content;
|
|
42
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DBox, { as: "section", "aria-label": heading, style: themeStyle(theme), children: /* @__PURE__ */ jsxRuntime.jsxs(DGrid, { columns: 2, px: 6, py: 16, gap: 12, align: "center", className: vui.cn("max-w-6xl mx-auto"), children: [
|
|
43
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DStack, { gap: 6, children: [
|
|
44
|
+
eyebrow && /* @__PURE__ */ jsxRuntime.jsx(DBox, { as: "p", color: "accent", className: vui.cn("text-sm font-semibold uppercase tracking-widest"), children: eyebrow }),
|
|
45
|
+
/* @__PURE__ */ jsxRuntime.jsx(DBox, { as: "h1", className: vui.cn("text-5xl font-bold tracking-tight leading-tight"), children: heading }),
|
|
46
|
+
/* @__PURE__ */ jsxRuntime.jsx(DBox, { as: "p", color: "muted", className: vui.cn("text-lg"), children: description }),
|
|
47
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DInline, { wrap: true, gap: 3, children: [
|
|
48
|
+
/* @__PURE__ */ jsxRuntime.jsx(vui.Button, { as: "a", href: primaryCta.href, children: primaryCta.label }),
|
|
49
|
+
secondaryCta && /* @__PURE__ */ jsxRuntime.jsx(vui.Button, { as: "a", href: secondaryCta.href, variant: "outline", children: secondaryCta.label })
|
|
50
|
+
] })
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
53
|
+
DBox,
|
|
54
|
+
{
|
|
55
|
+
as: "img",
|
|
56
|
+
src: image.src,
|
|
57
|
+
alt: image.alt,
|
|
58
|
+
className: vui.cn("w-full rounded-lg object-cover aspect-video")
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
] }) });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// src/hero/HeroSplit/default.ts
|
|
65
|
+
var HeroSplitDefaultContent = {
|
|
66
|
+
heading: "Build something remarkable",
|
|
67
|
+
description: "A composable foundation for ambitious teams. Typed, accessible, and ready to ship.",
|
|
68
|
+
primaryCta: { label: "Get started", href: "#" },
|
|
69
|
+
secondaryCta: { label: "Learn more", href: "#" },
|
|
70
|
+
image: { src: "https://placehold.co/600x400", alt: "Product preview" }
|
|
71
|
+
};
|
|
72
|
+
var HeroCenteredContentSchema = zod.z.object({
|
|
73
|
+
eyebrow: zod.z.string().optional(),
|
|
74
|
+
heading: zod.z.string(),
|
|
75
|
+
description: zod.z.string(),
|
|
76
|
+
primaryCta: CtaSchema,
|
|
77
|
+
secondaryCta: CtaSchema.optional()
|
|
78
|
+
}).strict();
|
|
79
|
+
function HeroCentered({ content, theme }) {
|
|
80
|
+
HeroCenteredContentSchema.parse(content);
|
|
81
|
+
const { eyebrow, heading, description, primaryCta, secondaryCta } = content;
|
|
82
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DBox, { as: "section", "aria-label": heading, style: themeStyle(theme), children: /* @__PURE__ */ jsxRuntime.jsxs(DStack, { px: 6, py: 24, gap: 8, align: "center", className: vui.cn("max-w-3xl mx-auto text-center"), children: [
|
|
83
|
+
eyebrow && /* @__PURE__ */ jsxRuntime.jsx(DBox, { as: "p", color: "accent", className: vui.cn("text-sm font-semibold uppercase tracking-widest"), children: eyebrow }),
|
|
84
|
+
/* @__PURE__ */ jsxRuntime.jsx(DBox, { as: "h1", className: vui.cn("text-5xl font-bold tracking-tight leading-tight"), children: heading }),
|
|
85
|
+
/* @__PURE__ */ jsxRuntime.jsx(DBox, { as: "p", color: "muted", className: vui.cn("text-xl"), children: description }),
|
|
86
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DInline, { wrap: true, gap: 3, justify: "center", children: [
|
|
87
|
+
/* @__PURE__ */ jsxRuntime.jsx(vui.Button, { as: "a", href: primaryCta.href, children: primaryCta.label }),
|
|
88
|
+
secondaryCta && /* @__PURE__ */ jsxRuntime.jsx(vui.Button, { as: "a", href: secondaryCta.href, variant: "outline", children: secondaryCta.label })
|
|
89
|
+
] })
|
|
90
|
+
] }) });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// src/hero/HeroCentered/default.ts
|
|
94
|
+
var HeroCenteredDefaultContent = {
|
|
95
|
+
heading: "The foundation for what comes next",
|
|
96
|
+
description: "Composable blocks, typed content, and zero boilerplate. Focus on the product.",
|
|
97
|
+
primaryCta: { label: "Start building", href: "#" },
|
|
98
|
+
secondaryCta: { label: "View docs", href: "#" }
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
exports.HeroCentered = HeroCentered;
|
|
102
|
+
exports.HeroCenteredContentSchema = HeroCenteredContentSchema;
|
|
103
|
+
exports.HeroCenteredDefaultContent = HeroCenteredDefaultContent;
|
|
104
|
+
exports.HeroSplit = HeroSplit;
|
|
105
|
+
exports.HeroSplitContentSchema = HeroSplitContentSchema;
|
|
106
|
+
exports.HeroSplitDefaultContent = HeroSplitDefaultContent;
|
|
107
|
+
//# sourceMappingURL=index.cjs.map
|
|
108
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/primitives.ts","../../src/theme.ts","../../src/shared/schemas.ts","../../src/hero/HeroSplit/schema.ts","../../src/hero/HeroSplit/index.tsx","../../src/hero/HeroSplit/default.ts","../../src/hero/HeroCentered/schema.ts","../../src/hero/HeroCentered/index.tsx","../../src/hero/HeroCentered/default.ts"],"names":["dsl","Box","Stack","Grid","Inline","z","jsx","jsxs","cn","Button"],"mappings":";;;;;;;;AAQO,IAAM,IAAA,GAAUA,SAAIC,OAAgC,CAAA;AACpD,IAAM,MAAA,GAAUD,SAAIE,SAAgC,CAAA;AACpD,IAAM,KAAA,GAAUF,SAAIG,QAAgC,CAAA;AACpD,IAAM,OAAA,GAAUH,SAAII,UAAgC,CAAA;;;ACNpD,SAAS,WAAW,KAAA,EAA6D;AACtF,EAAA,IAAI,CAAC,OAAO,OAAO,MAAA;AACnB,EAAA,OAAO,MAAA,CAAO,WAAA;AAAA,IACZ,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,CAAE,IAAI,CAAC,CAAC,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA,IAAA,EAAO,CAAC,CAAA,CAAA,EAAI,CAAC,CAAC;AAAA,GACvD;AACF;ACNO,IAAM,SAAA,GAAYC,MAAE,MAAA,CAAO;AAAA,EAChC,KAAA,EAAOA,MAAE,MAAA,EAAO;AAAA,EAChB,IAAA,EAAMA,MAAE,MAAA;AACV,CAAC,EAAE,MAAA,EAAO;AAEH,IAAM,WAAA,GAAcA,MAAE,MAAA,CAAO;AAAA,EAClC,GAAA,EAAKA,MAAE,MAAA,EAAO;AAAA,EACd,GAAA,EAAKA,MAAE,MAAA;AACT,CAAC,EAAE,MAAA,EAAO;;;ACPH,IAAM,sBAAA,GAAyBA,MAAE,MAAA,CAAO;AAAA,EAC7C,OAAA,EAASA,KAAAA,CAAE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A,EAC5B,QAAA,EAAA;AAAA,sBAAAD,cAAAA,CAACG,YAAA,EAAO,EAAA,EAAG,KAAI,IAAA,EAAM,UAAA,CAAW,IAAA,EAAO,QAAA,EAAA,UAAA,CAAW,KAAA,EAAM,CAAA;AAAA,MACvD,YAAA,oBACCH,cAAAA,CAACG,UAAAA,EAAA,EAAO,EAAA,EAAG,GAAA,EAAI,IAAA,EAAM,YAAA,CAAa,IAAA,EAAM,OAAA,EAAQ,SAAA,EAC7C,uBAAa,KAAA,EAChB;AAAA,KAAA,EAEJ;AAAA,GAAA,EACF,CAAA,EACF,CAAA;AAEJ;;;AChCO,IAAM,0BAAA,GAAkD;AAAA,EAC7D,OAAA,EAAS,oCAAA;AAAA,EACT,WAAA,EAAa,+EAAA;AAAA,EACb,UAAA,EAAY,EAAE,KAAA,EAAO,gBAAA,EAAkB,MAAM,GAAA,EAAI;AAAA,EACjD,YAAA,EAAc,EAAE,KAAA,EAAO,WAAA,EAAa,MAAM,GAAA;AAC5C","file":"index.cjs","sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { type ElementType } from \"react\";\nimport { dsl } from \"@booga/vdsl\";\nimport { Box, Stack, Grid, Inline } from \"@booga/vui\";\n\n// PolymorphicComponent is not structurally assignable to ElementType; dsl() uses\n// createElement() at runtime which accepts any callable, so the bridge is safe.\nexport const DBox = dsl(Box as unknown as ElementType);\nexport const DStack = dsl(Stack as unknown as ElementType);\nexport const DGrid = dsl(Grid as unknown as ElementType);\nexport const DInline = dsl(Inline as unknown as ElementType);\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { type CSSProperties } from \"react\";\nimport { type ThemeOverride } from \"./types\";\n\nexport function themeStyle(theme: ThemeOverride | undefined): CSSProperties | undefined {\n if (!theme) return undefined;\n return Object.fromEntries(\n Object.entries(theme).map(([k, v]) => [`--v-${k}`, v])\n ) as CSSProperties;\n}\n\nexport function clampedGridCols(n: number): 1 | 2 | 3 | 4 | 5 | 6 {\n return Math.max(1, Math.min(6, Math.round(n))) as 1 | 2 | 3 | 4 | 5 | 6;\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { z } from \"zod\";\n\nexport const CtaSchema = z.object({\n label: z.string(),\n href: z.string(),\n}).strict();\n\nexport const ImageSchema = z.object({\n src: z.string(),\n alt: z.string(),\n}).strict();\n\nexport const AvatarSchema = ImageSchema;\n\nexport type Cta = z.infer<typeof CtaSchema>;\nexport type Image = z.infer<typeof ImageSchema>;\nexport type AvatarSrc = Image;\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { z } from \"zod\";\nimport { CtaSchema, ImageSchema } from \"../../shared/schemas\";\n\nexport const HeroSplitContentSchema = z.object({\n eyebrow: z.string().optional(),\n heading: z.string(),\n description: z.string(),\n primaryCta: CtaSchema,\n secondaryCta: CtaSchema.optional(),\n image: ImageSchema,\n}).strict();\n\nexport type HeroSplitContent = z.infer<typeof HeroSplitContentSchema>;\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { Button, cn } from \"@booga/vui\";\nimport { DBox, DGrid, DInline, DStack } from \"../../primitives\";\nimport { type BlockProps } from \"../../types\";\nimport { themeStyle } from \"../../theme\";\nimport { HeroSplitContentSchema, type HeroSplitContent } from \"./schema\";\n\nexport function HeroSplit({ content, theme }: BlockProps<HeroSplitContent>) {\n HeroSplitContentSchema.parse(content);\n const { eyebrow, heading, description, primaryCta, secondaryCta, image } = content;\n return (\n <DBox as=\"section\" aria-label={heading} style={themeStyle(theme)}>\n <DGrid columns={2} px={6} py={16} gap={12} align=\"center\" className={cn(\"max-w-6xl mx-auto\")}>\n <DStack gap={6}>\n {eyebrow && (\n <DBox as=\"p\" color=\"accent\" className={cn(\"text-sm font-semibold uppercase tracking-widest\")}>\n {eyebrow}\n </DBox>\n )}\n <DBox as=\"h1\" className={cn(\"text-5xl font-bold tracking-tight leading-tight\")}>\n {heading}\n </DBox>\n <DBox as=\"p\" color=\"muted\" className={cn(\"text-lg\")}>\n {description}\n </DBox>\n <DInline wrap gap={3}>\n <Button as=\"a\" href={primaryCta.href}>{primaryCta.label}</Button>\n {secondaryCta && (\n <Button as=\"a\" href={secondaryCta.href} variant=\"outline\">\n {secondaryCta.label}\n </Button>\n )}\n </DInline>\n </DStack>\n <DBox\n as=\"img\"\n src={image.src}\n alt={image.alt}\n className={cn(\"w-full rounded-lg object-cover aspect-video\")}\n />\n </DGrid>\n </DBox>\n );\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { type HeroSplitContent } from \"./schema\";\n\nexport const HeroSplitDefaultContent: HeroSplitContent = {\n heading: \"Build something remarkable\",\n description: \"A composable foundation for ambitious teams. Typed, accessible, and ready to ship.\",\n primaryCta: { label: \"Get started\", href: \"#\" },\n secondaryCta: { label: \"Learn more\", href: \"#\" },\n image: { src: \"https://placehold.co/600x400\", alt: \"Product preview\" },\n};\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { z } from \"zod\";\nimport { CtaSchema } from \"../../shared/schemas\";\n\nexport const HeroCenteredContentSchema = z.object({\n eyebrow: z.string().optional(),\n heading: z.string(),\n description: z.string(),\n primaryCta: CtaSchema,\n secondaryCta: CtaSchema.optional(),\n}).strict();\n\nexport type HeroCenteredContent = z.infer<typeof HeroCenteredContentSchema>;\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { Button, cn } from \"@booga/vui\";\nimport { DBox, DInline, DStack } from \"../../primitives\";\nimport { type BlockProps } from \"../../types\";\nimport { themeStyle } from \"../../theme\";\nimport { HeroCenteredContentSchema, type HeroCenteredContent } from \"./schema\";\n\nexport function HeroCentered({ content, theme }: BlockProps<HeroCenteredContent>) {\n HeroCenteredContentSchema.parse(content);\n const { eyebrow, heading, description, primaryCta, secondaryCta } = content;\n return (\n <DBox as=\"section\" aria-label={heading} style={themeStyle(theme)}>\n <DStack px={6} py={24} gap={8} align=\"center\" className={cn(\"max-w-3xl mx-auto text-center\")}>\n {eyebrow && (\n <DBox as=\"p\" color=\"accent\" className={cn(\"text-sm font-semibold uppercase tracking-widest\")}>\n {eyebrow}\n </DBox>\n )}\n <DBox as=\"h1\" className={cn(\"text-5xl font-bold tracking-tight leading-tight\")}>\n {heading}\n </DBox>\n <DBox as=\"p\" color=\"muted\" className={cn(\"text-xl\")}>\n {description}\n </DBox>\n <DInline wrap gap={3} justify=\"center\">\n <Button as=\"a\" href={primaryCta.href}>{primaryCta.label}</Button>\n {secondaryCta && (\n <Button as=\"a\" href={secondaryCta.href} variant=\"outline\">\n {secondaryCta.label}\n </Button>\n )}\n </DInline>\n </DStack>\n </DBox>\n );\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 bvasilenko\nimport { type HeroCenteredContent } from \"./schema\";\n\nexport const HeroCenteredDefaultContent: HeroCenteredContent = {\n heading: \"The foundation for what comes next\",\n description: \"Composable blocks, typed content, and zero boilerplate. Focus on the product.\",\n primaryCta: { label: \"Start building\", href: \"#\" },\n secondaryCta: { label: \"View docs\", href: \"#\" },\n};\n"]}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { a as BlockProps } from '../types-n6w6cZmP.cjs';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
declare const HeroSplitContentSchema: z.ZodObject<{
|
|
7
|
+
eyebrow: z.ZodOptional<z.ZodString>;
|
|
8
|
+
heading: z.ZodString;
|
|
9
|
+
description: z.ZodString;
|
|
10
|
+
primaryCta: z.ZodObject<{
|
|
11
|
+
label: z.ZodString;
|
|
12
|
+
href: z.ZodString;
|
|
13
|
+
}, "strict", z.ZodTypeAny, {
|
|
14
|
+
label: string;
|
|
15
|
+
href: string;
|
|
16
|
+
}, {
|
|
17
|
+
label: string;
|
|
18
|
+
href: string;
|
|
19
|
+
}>;
|
|
20
|
+
secondaryCta: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
label: z.ZodString;
|
|
22
|
+
href: z.ZodString;
|
|
23
|
+
}, "strict", z.ZodTypeAny, {
|
|
24
|
+
label: string;
|
|
25
|
+
href: string;
|
|
26
|
+
}, {
|
|
27
|
+
label: string;
|
|
28
|
+
href: string;
|
|
29
|
+
}>>;
|
|
30
|
+
image: z.ZodObject<{
|
|
31
|
+
src: z.ZodString;
|
|
32
|
+
alt: z.ZodString;
|
|
33
|
+
}, "strict", z.ZodTypeAny, {
|
|
34
|
+
src: string;
|
|
35
|
+
alt: string;
|
|
36
|
+
}, {
|
|
37
|
+
src: string;
|
|
38
|
+
alt: string;
|
|
39
|
+
}>;
|
|
40
|
+
}, "strict", z.ZodTypeAny, {
|
|
41
|
+
image: {
|
|
42
|
+
src: string;
|
|
43
|
+
alt: string;
|
|
44
|
+
};
|
|
45
|
+
heading: string;
|
|
46
|
+
description: string;
|
|
47
|
+
primaryCta: {
|
|
48
|
+
label: string;
|
|
49
|
+
href: string;
|
|
50
|
+
};
|
|
51
|
+
eyebrow?: string | undefined;
|
|
52
|
+
secondaryCta?: {
|
|
53
|
+
label: string;
|
|
54
|
+
href: string;
|
|
55
|
+
} | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
image: {
|
|
58
|
+
src: string;
|
|
59
|
+
alt: string;
|
|
60
|
+
};
|
|
61
|
+
heading: string;
|
|
62
|
+
description: string;
|
|
63
|
+
primaryCta: {
|
|
64
|
+
label: string;
|
|
65
|
+
href: string;
|
|
66
|
+
};
|
|
67
|
+
eyebrow?: string | undefined;
|
|
68
|
+
secondaryCta?: {
|
|
69
|
+
label: string;
|
|
70
|
+
href: string;
|
|
71
|
+
} | undefined;
|
|
72
|
+
}>;
|
|
73
|
+
type HeroSplitContent = z.infer<typeof HeroSplitContentSchema>;
|
|
74
|
+
|
|
75
|
+
declare function HeroSplit({ content, theme }: BlockProps<HeroSplitContent>): react_jsx_runtime.JSX.Element;
|
|
76
|
+
|
|
77
|
+
declare const HeroSplitDefaultContent: HeroSplitContent;
|
|
78
|
+
|
|
79
|
+
declare const HeroCenteredContentSchema: z.ZodObject<{
|
|
80
|
+
eyebrow: z.ZodOptional<z.ZodString>;
|
|
81
|
+
heading: z.ZodString;
|
|
82
|
+
description: z.ZodString;
|
|
83
|
+
primaryCta: z.ZodObject<{
|
|
84
|
+
label: z.ZodString;
|
|
85
|
+
href: z.ZodString;
|
|
86
|
+
}, "strict", z.ZodTypeAny, {
|
|
87
|
+
label: string;
|
|
88
|
+
href: string;
|
|
89
|
+
}, {
|
|
90
|
+
label: string;
|
|
91
|
+
href: string;
|
|
92
|
+
}>;
|
|
93
|
+
secondaryCta: z.ZodOptional<z.ZodObject<{
|
|
94
|
+
label: z.ZodString;
|
|
95
|
+
href: z.ZodString;
|
|
96
|
+
}, "strict", z.ZodTypeAny, {
|
|
97
|
+
label: string;
|
|
98
|
+
href: string;
|
|
99
|
+
}, {
|
|
100
|
+
label: string;
|
|
101
|
+
href: string;
|
|
102
|
+
}>>;
|
|
103
|
+
}, "strict", z.ZodTypeAny, {
|
|
104
|
+
heading: string;
|
|
105
|
+
description: string;
|
|
106
|
+
primaryCta: {
|
|
107
|
+
label: string;
|
|
108
|
+
href: string;
|
|
109
|
+
};
|
|
110
|
+
eyebrow?: string | undefined;
|
|
111
|
+
secondaryCta?: {
|
|
112
|
+
label: string;
|
|
113
|
+
href: string;
|
|
114
|
+
} | undefined;
|
|
115
|
+
}, {
|
|
116
|
+
heading: string;
|
|
117
|
+
description: string;
|
|
118
|
+
primaryCta: {
|
|
119
|
+
label: string;
|
|
120
|
+
href: string;
|
|
121
|
+
};
|
|
122
|
+
eyebrow?: string | undefined;
|
|
123
|
+
secondaryCta?: {
|
|
124
|
+
label: string;
|
|
125
|
+
href: string;
|
|
126
|
+
} | undefined;
|
|
127
|
+
}>;
|
|
128
|
+
type HeroCenteredContent = z.infer<typeof HeroCenteredContentSchema>;
|
|
129
|
+
|
|
130
|
+
declare function HeroCentered({ content, theme }: BlockProps<HeroCenteredContent>): react_jsx_runtime.JSX.Element;
|
|
131
|
+
|
|
132
|
+
declare const HeroCenteredDefaultContent: HeroCenteredContent;
|
|
133
|
+
|
|
134
|
+
export { HeroCentered, type HeroCenteredContent, HeroCenteredContentSchema, HeroCenteredDefaultContent, HeroSplit, type HeroSplitContent, HeroSplitContentSchema, HeroSplitDefaultContent };
|