@opensite/ui 0.0.1 → 0.0.2
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 +117 -2
- package/dist/alternating-blocks.cjs +138 -0
- package/dist/alternating-blocks.cjs.map +1 -0
- package/dist/alternating-blocks.d.cts +65 -0
- package/dist/alternating-blocks.d.ts +65 -0
- package/dist/alternating-blocks.js +132 -0
- package/dist/alternating-blocks.js.map +1 -0
- package/dist/animated-dialog.cjs +6 -6
- package/dist/animated-dialog.cjs.map +1 -1
- package/dist/animated-dialog.js +6 -6
- package/dist/animated-dialog.js.map +1 -1
- package/dist/button.cjs.map +1 -1
- package/dist/button.js.map +1 -1
- package/dist/components.cjs +50 -7
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +2 -1
- package/dist/components.d.ts +2 -1
- package/dist/components.js +50 -8
- package/dist/components.js.map +1 -1
- package/dist/index.cjs +50 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +50 -8
- package/dist/index.js.map +1 -1
- package/dist/page-hero-banner.cjs +1 -1
- package/dist/page-hero-banner.cjs.map +1 -1
- package/dist/page-hero-banner.js +1 -1
- package/dist/page-hero-banner.js.map +1 -1
- package/dist/registry.cjs +227 -0
- package/dist/registry.cjs.map +1 -0
- package/dist/registry.d.cts +55 -0
- package/dist/registry.d.ts +55 -0
- package/dist/registry.js +215 -0
- package/dist/registry.js.map +1 -0
- package/dist/section.cjs +2 -0
- package/dist/section.cjs.map +1 -1
- package/dist/section.js +2 -0
- package/dist/section.js.map +1 -1
- package/dist/types.d.cts +37 -2
- package/dist/types.d.ts +37 -2
- package/package.json +12 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../lib/utils.ts","../components/ui/container.tsx","../components/ui/section.tsx","../components/blocks/about/alternating-blocks.tsx","../src/registry/blocks.ts"],"names":["twMerge","clsx","React","jsx","jsxs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CAAK,WAAA,EAAY,CAAE,QAAA,CAAS,cAAc,CAAA,IAChD,KAAA,CAAM,WAAA,CAAY,WAAA,EAAY,CAAE,SAAS,cAAc,CAAA,IACvD,KAAA,CAAM,YAAA,CAAa,IAAA,CAAK,CAAC,GAAA,KAAQ,GAAA,CAAI,WAAA,EAAY,CAAE,QAAA,CAAS,cAAc,CAAC;AAAA,GAC/E;AACF","file":"registry.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport type { ContainerProps } from \"../../src/types\";\n\nconst maxWidthStyles = {\n sm: \"max-w-screen-sm\",\n md: \"max-w-screen-md\",\n lg: \"max-w-screen-lg\",\n xl: \"max-w-screen-xl\",\n \"2xl\": \"max-w-screen-2xl\",\n \"4xl\": \"max-w-[1536px]\",\n full: \"max-w-full\",\n};\n\n/**\n * Container component for consistent content width and centering\n *\n * @example\n * ```tsx\n * <Container maxWidth=\"xl\">\n * <h1>Page Content</h1>\n * </Container>\n * ```\n */\nexport const Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ children, maxWidth = \"xl\", className, as = \"div\", ...props }, ref) => {\n const Component = as as any;\n return (\n <Component\n ref={ref}\n className={cn(\n \"mx-auto w-full px-4 sm:px-6 lg:px-8\",\n maxWidthStyles[maxWidth],\n className\n )}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nContainer.displayName = \"Container\";\n","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Container } from \"./container\";\nimport type { SectionProps } from \"../../src/types\";\n\n/**\n * Background style variants\n * Uses standard Tailwind/shadcn CSS variables for theming\n */\nconst backgroundStyles = {\n white: \"bg-background text-foreground\",\n gray: \"bg-muted/30 text-foreground\",\n dark: \"bg-foreground text-background\",\n gradient: \"bg-gradient-to-br from-primary via-primary/90 to-foreground text-primary-foreground\",\n primary: \"bg-primary text-primary-foreground\",\n secondary: \"bg-secondary text-secondary-foreground\",\n muted: \"bg-muted text-muted-foreground\",\n};\n\n/**\n * Vertical spacing variants\n */\nconst spacingStyles = {\n sm: \"py-12 md:py-16\",\n md: \"py-16 md:py-24\",\n lg: \"py-20 md:py-32\",\n xl: \"py-24 md:py-40\",\n};\n\n/**\n * Section component for consistent page sections with optional title, subtitle, and background\n *\n * @example\n * ```tsx\n * <Section\n * title=\"Our Services\"\n * subtitle=\"What we offer\"\n * background=\"gray\"\n * spacing=\"lg\"\n * >\n * <div>Section content goes here</div>\n * </Section>\n * ```\n */\nexport const Section = React.forwardRef<HTMLElement, SectionProps>(\n (\n {\n id,\n title,\n subtitle,\n children,\n className,\n style,\n background = \"white\",\n spacing = \"lg\",\n ...props\n },\n ref\n ) => {\n return (\n <section\n ref={ref}\n id={id}\n className={cn(\n backgroundStyles[background],\n spacingStyles[spacing],\n className\n )}\n style={style}\n {...props}\n >\n <Container>\n {(title || subtitle) && (\n <div className=\"text-center mb-12 md:mb-16\">\n {subtitle && (\n <p className=\"text-sm font-semibold uppercase tracking-wider mb-2 text-primary\">\n {subtitle}\n </p>\n )}\n {title && (\n <h2 className=\"text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight\">\n {title}\n </h2>\n )}\n </div>\n )}\n {children}\n </Container>\n </section>\n );\n }\n);\n\nSection.displayName = \"Section\";\n","import * as React from \"react\";\nimport { cn } from \"../../../lib/utils\";\nimport { Section } from \"../../ui/section\";\nimport type { SectionBackground, SectionSpacing } from \"../../../src/types\";\n\nexport interface AlternatingBlockSection {\n content: React.ReactNode;\n media: React.ReactNode;\n mediaLeft?: boolean;\n}\n\nexport interface AlternatingBlocksProps {\n /**\n * Array of sections to display with alternating layout\n */\n sections: AlternatingBlockSection[];\n /**\n * Section title (optional)\n */\n title?: string;\n /**\n * Section subtitle/eyebrow (optional)\n */\n subtitle?: string;\n /**\n * Background style variant\n * @default \"white\"\n */\n background?: SectionBackground;\n /**\n * Vertical spacing variant\n * @default \"lg\"\n */\n spacing?: SectionSpacing;\n /**\n * Additional CSS classes for the Section wrapper\n */\n className?: string;\n /**\n * Additional CSS classes for the content container\n */\n contentClassName?: string;\n}\n\n/**\n * AlternatingBlocks component displays content sections with alternating media placement.\n * Uses the Section component for consistent spacing, backgrounds, and optional titles.\n *\n * @example\n * ```tsx\n * <AlternatingBlocks\n * title=\"Our Story\"\n * subtitle=\"About Us\"\n * background=\"gray\"\n * spacing=\"xl\"\n * sections={[\n * {\n * content: <div><h3>Title</h3><p>Description</p></div>,\n * media: <img src=\"...\" alt=\"...\" />,\n * mediaLeft: false\n * }\n * ]}\n * />\n * ```\n */\nexport function AlternatingBlocks({\n sections,\n title,\n subtitle,\n background = \"white\",\n spacing = \"lg\",\n className,\n contentClassName,\n}: AlternatingBlocksProps) {\n return (\n <Section\n title={title}\n subtitle={subtitle}\n background={background}\n spacing={spacing}\n className={className}\n >\n <div className={cn(\"mx-auto w-full max-w-[900px]\", contentClassName)}>\n <div className=\"space-y-12\">\n {sections?.map((section, index) => (\n <div\n key={index}\n className=\"grid items-center gap-8 md:grid-cols-2 md:gap-12\"\n >\n <div className={section.mediaLeft ? \"md:order-2\" : \"\"}>\n {section.content}\n </div>\n\n <div\n className={cn(\n \"aspect-[4/3] overflow-hidden rounded-lg border\",\n section.mediaLeft ? \"md:order-1\" : \"\"\n )}\n >\n <div className=\"flex h-full w-full items-center justify-center\">\n {section.media}\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n </Section>\n );\n}\n","/**\n * Semantic Block Registry\n *\n * This registry maps semantic concepts to available UI blocks for AI-driven\n * site generation. Each block entry contains:\n * - id: Unique identifier for the block\n * - name: Human-readable name\n * - description: What the block does and when to use it\n * - semanticTags: Array of semantic concepts this block represents\n * - category: Block category (about, features, cta, testimonials, etc.)\n * - component: Reference to the actual component\n * - props: TypeScript type for the component's props\n * - exampleUsage: Code example showing how to use the block\n */\n\nimport { AlternatingBlocks } from \"../../components/blocks/about/alternating-blocks\";\nimport type { AlternatingBlocksProps } from \"../../components/blocks/about/alternating-blocks\";\n\nexport interface BlockRegistryEntry<T = any> {\n id: string;\n name: string;\n description: string;\n semanticTags: string[];\n category: BlockCategory;\n component: React.ComponentType<T>;\n props: string;\n exampleUsage: string;\n}\n\nexport type BlockCategory =\n | \"about\"\n | \"features\"\n | \"cta\"\n | \"testimonials\"\n | \"services\"\n | \"hero\"\n | \"footer\"\n | \"header\"\n | \"pricing\"\n | \"team\"\n | \"stats\"\n | \"faq\"\n | \"contact\"\n | \"gallery\"\n | \"timeline\"\n | \"process\"\n | \"benefits\"\n | \"comparison\";\n\n/**\n * Block Registry - Central registry of all available UI blocks\n */\nexport const BLOCK_REGISTRY: Record<string, BlockRegistryEntry> = {\n \"alternating-blocks\": {\n id: \"alternating-blocks\",\n name: \"Alternating Content Blocks\",\n description:\n \"Display content sections with alternating left/right media placement. Ideal for storytelling, feature showcases, or company history sections.\",\n semanticTags: [\n \"about\",\n \"story\",\n \"history\",\n \"timeline\",\n \"features\",\n \"benefits\",\n \"alternating\",\n \"two-column\",\n \"content-media\",\n ],\n category: \"about\",\n component: AlternatingBlocks,\n props: \"AlternatingBlocksProps\",\n exampleUsage: `\n<AlternatingBlocks\n sections={[\n {\n content: (\n <div>\n <div className=\"flex items-center gap-2 mb-3\">\n <Lightbulb className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-medium text-muted-foreground\">\n The Origin\n </span>\n </div>\n <h3 className=\"mb-3 text-2xl font-semibold tracking-tight\">\n It started with frustration\n </h3>\n <p className=\"text-muted-foreground leading-relaxed\">\n We spent years watching teams drown in tools that promised to help\n but only added complexity. In 2018, we decided to build something better.\n </p>\n </div>\n ),\n media: <img src=\"...\" alt=\"...\" />,\n mediaLeft: false\n },\n {\n content: <div>...</div>,\n media: <img src=\"...\" alt=\"...\" />,\n mediaLeft: true\n }\n ]}\n/>\n `.trim(),\n },\n // Add more blocks here following this pattern\n};\n\n/**\n * Get blocks by semantic tag\n */\nexport function getBlocksBySemanticTag(tag: string): BlockRegistryEntry[] {\n return Object.values(BLOCK_REGISTRY).filter((block) =>\n block.semanticTags.includes(tag)\n );\n}\n\n/**\n * Get blocks by category\n */\nexport function getBlocksByCategory(\n category: BlockCategory\n): BlockRegistryEntry[] {\n return Object.values(BLOCK_REGISTRY).filter(\n (block) => block.category === category\n );\n}\n\n/**\n * Get block by ID\n */\nexport function getBlockById(id: string): BlockRegistryEntry | undefined {\n return BLOCK_REGISTRY[id];\n}\n\n/**\n * Get all available blocks\n */\nexport function getAllBlocks(): BlockRegistryEntry[] {\n return Object.values(BLOCK_REGISTRY);\n}\n\n/**\n * Get all categories\n */\nexport function getAllCategories(): BlockCategory[] {\n return Array.from(\n new Set(Object.values(BLOCK_REGISTRY).map((block) => block.category))\n );\n}\n\n/**\n * Search blocks by query (searches name, description, and semantic tags)\n */\nexport function searchBlocks(query: string): BlockRegistryEntry[] {\n const lowercaseQuery = query.toLowerCase();\n return Object.values(BLOCK_REGISTRY).filter(\n (block) =>\n block.name.toLowerCase().includes(lowercaseQuery) ||\n block.description.toLowerCase().includes(lowercaseQuery) ||\n block.semanticTags.some((tag) => tag.toLowerCase().includes(lowercaseQuery))\n );\n}\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic Block Registry
|
|
3
|
+
*
|
|
4
|
+
* This registry maps semantic concepts to available UI blocks for AI-driven
|
|
5
|
+
* site generation. Each block entry contains:
|
|
6
|
+
* - id: Unique identifier for the block
|
|
7
|
+
* - name: Human-readable name
|
|
8
|
+
* - description: What the block does and when to use it
|
|
9
|
+
* - semanticTags: Array of semantic concepts this block represents
|
|
10
|
+
* - category: Block category (about, features, cta, testimonials, etc.)
|
|
11
|
+
* - component: Reference to the actual component
|
|
12
|
+
* - props: TypeScript type for the component's props
|
|
13
|
+
* - exampleUsage: Code example showing how to use the block
|
|
14
|
+
*/
|
|
15
|
+
interface BlockRegistryEntry<T = any> {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
semanticTags: string[];
|
|
20
|
+
category: BlockCategory;
|
|
21
|
+
component: React.ComponentType<T>;
|
|
22
|
+
props: string;
|
|
23
|
+
exampleUsage: string;
|
|
24
|
+
}
|
|
25
|
+
type BlockCategory = "about" | "features" | "cta" | "testimonials" | "services" | "hero" | "footer" | "header" | "pricing" | "team" | "stats" | "faq" | "contact" | "gallery" | "timeline" | "process" | "benefits" | "comparison";
|
|
26
|
+
/**
|
|
27
|
+
* Block Registry - Central registry of all available UI blocks
|
|
28
|
+
*/
|
|
29
|
+
declare const BLOCK_REGISTRY: Record<string, BlockRegistryEntry>;
|
|
30
|
+
/**
|
|
31
|
+
* Get blocks by semantic tag
|
|
32
|
+
*/
|
|
33
|
+
declare function getBlocksBySemanticTag(tag: string): BlockRegistryEntry[];
|
|
34
|
+
/**
|
|
35
|
+
* Get blocks by category
|
|
36
|
+
*/
|
|
37
|
+
declare function getBlocksByCategory(category: BlockCategory): BlockRegistryEntry[];
|
|
38
|
+
/**
|
|
39
|
+
* Get block by ID
|
|
40
|
+
*/
|
|
41
|
+
declare function getBlockById(id: string): BlockRegistryEntry | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Get all available blocks
|
|
44
|
+
*/
|
|
45
|
+
declare function getAllBlocks(): BlockRegistryEntry[];
|
|
46
|
+
/**
|
|
47
|
+
* Get all categories
|
|
48
|
+
*/
|
|
49
|
+
declare function getAllCategories(): BlockCategory[];
|
|
50
|
+
/**
|
|
51
|
+
* Search blocks by query (searches name, description, and semantic tags)
|
|
52
|
+
*/
|
|
53
|
+
declare function searchBlocks(query: string): BlockRegistryEntry[];
|
|
54
|
+
|
|
55
|
+
export { BLOCK_REGISTRY, type BlockCategory, type BlockRegistryEntry, getAllBlocks, getAllCategories, getBlockById, getBlocksByCategory, getBlocksBySemanticTag, searchBlocks };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic Block Registry
|
|
3
|
+
*
|
|
4
|
+
* This registry maps semantic concepts to available UI blocks for AI-driven
|
|
5
|
+
* site generation. Each block entry contains:
|
|
6
|
+
* - id: Unique identifier for the block
|
|
7
|
+
* - name: Human-readable name
|
|
8
|
+
* - description: What the block does and when to use it
|
|
9
|
+
* - semanticTags: Array of semantic concepts this block represents
|
|
10
|
+
* - category: Block category (about, features, cta, testimonials, etc.)
|
|
11
|
+
* - component: Reference to the actual component
|
|
12
|
+
* - props: TypeScript type for the component's props
|
|
13
|
+
* - exampleUsage: Code example showing how to use the block
|
|
14
|
+
*/
|
|
15
|
+
interface BlockRegistryEntry<T = any> {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
semanticTags: string[];
|
|
20
|
+
category: BlockCategory;
|
|
21
|
+
component: React.ComponentType<T>;
|
|
22
|
+
props: string;
|
|
23
|
+
exampleUsage: string;
|
|
24
|
+
}
|
|
25
|
+
type BlockCategory = "about" | "features" | "cta" | "testimonials" | "services" | "hero" | "footer" | "header" | "pricing" | "team" | "stats" | "faq" | "contact" | "gallery" | "timeline" | "process" | "benefits" | "comparison";
|
|
26
|
+
/**
|
|
27
|
+
* Block Registry - Central registry of all available UI blocks
|
|
28
|
+
*/
|
|
29
|
+
declare const BLOCK_REGISTRY: Record<string, BlockRegistryEntry>;
|
|
30
|
+
/**
|
|
31
|
+
* Get blocks by semantic tag
|
|
32
|
+
*/
|
|
33
|
+
declare function getBlocksBySemanticTag(tag: string): BlockRegistryEntry[];
|
|
34
|
+
/**
|
|
35
|
+
* Get blocks by category
|
|
36
|
+
*/
|
|
37
|
+
declare function getBlocksByCategory(category: BlockCategory): BlockRegistryEntry[];
|
|
38
|
+
/**
|
|
39
|
+
* Get block by ID
|
|
40
|
+
*/
|
|
41
|
+
declare function getBlockById(id: string): BlockRegistryEntry | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Get all available blocks
|
|
44
|
+
*/
|
|
45
|
+
declare function getAllBlocks(): BlockRegistryEntry[];
|
|
46
|
+
/**
|
|
47
|
+
* Get all categories
|
|
48
|
+
*/
|
|
49
|
+
declare function getAllCategories(): BlockCategory[];
|
|
50
|
+
/**
|
|
51
|
+
* Search blocks by query (searches name, description, and semantic tags)
|
|
52
|
+
*/
|
|
53
|
+
declare function searchBlocks(query: string): BlockRegistryEntry[];
|
|
54
|
+
|
|
55
|
+
export { BLOCK_REGISTRY, type BlockCategory, type BlockRegistryEntry, getAllBlocks, getAllCategories, getBlockById, getBlocksByCategory, getBlocksBySemanticTag, searchBlocks };
|
package/dist/registry.js
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
// lib/utils.ts
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
var maxWidthStyles = {
|
|
11
|
+
sm: "max-w-screen-sm",
|
|
12
|
+
md: "max-w-screen-md",
|
|
13
|
+
lg: "max-w-screen-lg",
|
|
14
|
+
xl: "max-w-screen-xl",
|
|
15
|
+
"2xl": "max-w-screen-2xl",
|
|
16
|
+
"4xl": "max-w-[1536px]",
|
|
17
|
+
full: "max-w-full"
|
|
18
|
+
};
|
|
19
|
+
var Container = React.forwardRef(
|
|
20
|
+
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
21
|
+
const Component = as;
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
Component,
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
className: cn(
|
|
27
|
+
"mx-auto w-full px-4 sm:px-6 lg:px-8",
|
|
28
|
+
maxWidthStyles[maxWidth],
|
|
29
|
+
className
|
|
30
|
+
),
|
|
31
|
+
...props,
|
|
32
|
+
children
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
Container.displayName = "Container";
|
|
38
|
+
var backgroundStyles = {
|
|
39
|
+
white: "bg-background text-foreground",
|
|
40
|
+
gray: "bg-muted/30 text-foreground",
|
|
41
|
+
dark: "bg-foreground text-background",
|
|
42
|
+
gradient: "bg-gradient-to-br from-primary via-primary/90 to-foreground text-primary-foreground",
|
|
43
|
+
primary: "bg-primary text-primary-foreground",
|
|
44
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
45
|
+
muted: "bg-muted text-muted-foreground"
|
|
46
|
+
};
|
|
47
|
+
var spacingStyles = {
|
|
48
|
+
sm: "py-12 md:py-16",
|
|
49
|
+
md: "py-16 md:py-24",
|
|
50
|
+
lg: "py-20 md:py-32",
|
|
51
|
+
xl: "py-24 md:py-40"
|
|
52
|
+
};
|
|
53
|
+
var Section = React.forwardRef(
|
|
54
|
+
({
|
|
55
|
+
id,
|
|
56
|
+
title,
|
|
57
|
+
subtitle,
|
|
58
|
+
children,
|
|
59
|
+
className,
|
|
60
|
+
style,
|
|
61
|
+
background = "white",
|
|
62
|
+
spacing = "lg",
|
|
63
|
+
...props
|
|
64
|
+
}, ref) => {
|
|
65
|
+
return /* @__PURE__ */ jsx(
|
|
66
|
+
"section",
|
|
67
|
+
{
|
|
68
|
+
ref,
|
|
69
|
+
id,
|
|
70
|
+
className: cn(
|
|
71
|
+
backgroundStyles[background],
|
|
72
|
+
spacingStyles[spacing],
|
|
73
|
+
className
|
|
74
|
+
),
|
|
75
|
+
style,
|
|
76
|
+
...props,
|
|
77
|
+
children: /* @__PURE__ */ jsxs(Container, { children: [
|
|
78
|
+
(title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "text-center mb-12 md:mb-16", children: [
|
|
79
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold uppercase tracking-wider mb-2 text-primary", children: subtitle }),
|
|
80
|
+
title && /* @__PURE__ */ jsx("h2", { className: "text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight", children: title })
|
|
81
|
+
] }),
|
|
82
|
+
children
|
|
83
|
+
] })
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
Section.displayName = "Section";
|
|
89
|
+
function AlternatingBlocks({
|
|
90
|
+
sections,
|
|
91
|
+
title,
|
|
92
|
+
subtitle,
|
|
93
|
+
background = "white",
|
|
94
|
+
spacing = "lg",
|
|
95
|
+
className,
|
|
96
|
+
contentClassName
|
|
97
|
+
}) {
|
|
98
|
+
return /* @__PURE__ */ jsx(
|
|
99
|
+
Section,
|
|
100
|
+
{
|
|
101
|
+
title,
|
|
102
|
+
subtitle,
|
|
103
|
+
background,
|
|
104
|
+
spacing,
|
|
105
|
+
className,
|
|
106
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("mx-auto w-full max-w-[900px]", contentClassName), children: /* @__PURE__ */ jsx("div", { className: "space-y-12", children: sections?.map((section, index) => /* @__PURE__ */ jsxs(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
className: "grid items-center gap-8 md:grid-cols-2 md:gap-12",
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ jsx("div", { className: section.mediaLeft ? "md:order-2" : "", children: section.content }),
|
|
112
|
+
/* @__PURE__ */ jsx(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
className: cn(
|
|
116
|
+
"aspect-[4/3] overflow-hidden rounded-lg border",
|
|
117
|
+
section.mediaLeft ? "md:order-1" : ""
|
|
118
|
+
),
|
|
119
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center", children: section.media })
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
index
|
|
125
|
+
)) }) })
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// src/registry/blocks.ts
|
|
131
|
+
var BLOCK_REGISTRY = {
|
|
132
|
+
"alternating-blocks": {
|
|
133
|
+
id: "alternating-blocks",
|
|
134
|
+
name: "Alternating Content Blocks",
|
|
135
|
+
description: "Display content sections with alternating left/right media placement. Ideal for storytelling, feature showcases, or company history sections.",
|
|
136
|
+
semanticTags: [
|
|
137
|
+
"about",
|
|
138
|
+
"story",
|
|
139
|
+
"history",
|
|
140
|
+
"timeline",
|
|
141
|
+
"features",
|
|
142
|
+
"benefits",
|
|
143
|
+
"alternating",
|
|
144
|
+
"two-column",
|
|
145
|
+
"content-media"
|
|
146
|
+
],
|
|
147
|
+
category: "about",
|
|
148
|
+
component: AlternatingBlocks,
|
|
149
|
+
props: "AlternatingBlocksProps",
|
|
150
|
+
exampleUsage: `
|
|
151
|
+
<AlternatingBlocks
|
|
152
|
+
sections={[
|
|
153
|
+
{
|
|
154
|
+
content: (
|
|
155
|
+
<div>
|
|
156
|
+
<div className="flex items-center gap-2 mb-3">
|
|
157
|
+
<Lightbulb className="h-4 w-4 text-primary" />
|
|
158
|
+
<span className="text-sm font-medium text-muted-foreground">
|
|
159
|
+
The Origin
|
|
160
|
+
</span>
|
|
161
|
+
</div>
|
|
162
|
+
<h3 className="mb-3 text-2xl font-semibold tracking-tight">
|
|
163
|
+
It started with frustration
|
|
164
|
+
</h3>
|
|
165
|
+
<p className="text-muted-foreground leading-relaxed">
|
|
166
|
+
We spent years watching teams drown in tools that promised to help
|
|
167
|
+
but only added complexity. In 2018, we decided to build something better.
|
|
168
|
+
</p>
|
|
169
|
+
</div>
|
|
170
|
+
),
|
|
171
|
+
media: <img src="..." alt="..." />,
|
|
172
|
+
mediaLeft: false
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
content: <div>...</div>,
|
|
176
|
+
media: <img src="..." alt="..." />,
|
|
177
|
+
mediaLeft: true
|
|
178
|
+
}
|
|
179
|
+
]}
|
|
180
|
+
/>
|
|
181
|
+
`.trim()
|
|
182
|
+
}
|
|
183
|
+
// Add more blocks here following this pattern
|
|
184
|
+
};
|
|
185
|
+
function getBlocksBySemanticTag(tag) {
|
|
186
|
+
return Object.values(BLOCK_REGISTRY).filter(
|
|
187
|
+
(block) => block.semanticTags.includes(tag)
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
function getBlocksByCategory(category) {
|
|
191
|
+
return Object.values(BLOCK_REGISTRY).filter(
|
|
192
|
+
(block) => block.category === category
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
function getBlockById(id) {
|
|
196
|
+
return BLOCK_REGISTRY[id];
|
|
197
|
+
}
|
|
198
|
+
function getAllBlocks() {
|
|
199
|
+
return Object.values(BLOCK_REGISTRY);
|
|
200
|
+
}
|
|
201
|
+
function getAllCategories() {
|
|
202
|
+
return Array.from(
|
|
203
|
+
new Set(Object.values(BLOCK_REGISTRY).map((block) => block.category))
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
function searchBlocks(query) {
|
|
207
|
+
const lowercaseQuery = query.toLowerCase();
|
|
208
|
+
return Object.values(BLOCK_REGISTRY).filter(
|
|
209
|
+
(block) => block.name.toLowerCase().includes(lowercaseQuery) || block.description.toLowerCase().includes(lowercaseQuery) || block.semanticTags.some((tag) => tag.toLowerCase().includes(lowercaseQuery))
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export { BLOCK_REGISTRY, getAllBlocks, getAllCategories, getBlockById, getBlocksByCategory, getBlocksBySemanticTag, searchBlocks };
|
|
214
|
+
//# sourceMappingURL=registry.js.map
|
|
215
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../lib/utils.ts","../components/ui/container.tsx","../components/ui/section.tsx","../components/blocks/about/alternating-blocks.tsx","../src/registry/blocks.ts"],"names":["React","jsx","jsxs"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,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,IACvD,KAAA,CAAM,YAAA,CAAa,IAAA,CAAK,CAAC,GAAA,KAAQ,GAAA,CAAI,WAAA,EAAY,CAAE,QAAA,CAAS,cAAc,CAAC;AAAA,GAC/E;AACF","file":"registry.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport type { ContainerProps } from \"../../src/types\";\n\nconst maxWidthStyles = {\n sm: \"max-w-screen-sm\",\n md: \"max-w-screen-md\",\n lg: \"max-w-screen-lg\",\n xl: \"max-w-screen-xl\",\n \"2xl\": \"max-w-screen-2xl\",\n \"4xl\": \"max-w-[1536px]\",\n full: \"max-w-full\",\n};\n\n/**\n * Container component for consistent content width and centering\n *\n * @example\n * ```tsx\n * <Container maxWidth=\"xl\">\n * <h1>Page Content</h1>\n * </Container>\n * ```\n */\nexport const Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ children, maxWidth = \"xl\", className, as = \"div\", ...props }, ref) => {\n const Component = as as any;\n return (\n <Component\n ref={ref}\n className={cn(\n \"mx-auto w-full px-4 sm:px-6 lg:px-8\",\n maxWidthStyles[maxWidth],\n className\n )}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nContainer.displayName = \"Container\";\n","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Container } from \"./container\";\nimport type { SectionProps } from \"../../src/types\";\n\n/**\n * Background style variants\n * Uses standard Tailwind/shadcn CSS variables for theming\n */\nconst backgroundStyles = {\n white: \"bg-background text-foreground\",\n gray: \"bg-muted/30 text-foreground\",\n dark: \"bg-foreground text-background\",\n gradient: \"bg-gradient-to-br from-primary via-primary/90 to-foreground text-primary-foreground\",\n primary: \"bg-primary text-primary-foreground\",\n secondary: \"bg-secondary text-secondary-foreground\",\n muted: \"bg-muted text-muted-foreground\",\n};\n\n/**\n * Vertical spacing variants\n */\nconst spacingStyles = {\n sm: \"py-12 md:py-16\",\n md: \"py-16 md:py-24\",\n lg: \"py-20 md:py-32\",\n xl: \"py-24 md:py-40\",\n};\n\n/**\n * Section component for consistent page sections with optional title, subtitle, and background\n *\n * @example\n * ```tsx\n * <Section\n * title=\"Our Services\"\n * subtitle=\"What we offer\"\n * background=\"gray\"\n * spacing=\"lg\"\n * >\n * <div>Section content goes here</div>\n * </Section>\n * ```\n */\nexport const Section = React.forwardRef<HTMLElement, SectionProps>(\n (\n {\n id,\n title,\n subtitle,\n children,\n className,\n style,\n background = \"white\",\n spacing = \"lg\",\n ...props\n },\n ref\n ) => {\n return (\n <section\n ref={ref}\n id={id}\n className={cn(\n backgroundStyles[background],\n spacingStyles[spacing],\n className\n )}\n style={style}\n {...props}\n >\n <Container>\n {(title || subtitle) && (\n <div className=\"text-center mb-12 md:mb-16\">\n {subtitle && (\n <p className=\"text-sm font-semibold uppercase tracking-wider mb-2 text-primary\">\n {subtitle}\n </p>\n )}\n {title && (\n <h2 className=\"text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight\">\n {title}\n </h2>\n )}\n </div>\n )}\n {children}\n </Container>\n </section>\n );\n }\n);\n\nSection.displayName = \"Section\";\n","import * as React from \"react\";\nimport { cn } from \"../../../lib/utils\";\nimport { Section } from \"../../ui/section\";\nimport type { SectionBackground, SectionSpacing } from \"../../../src/types\";\n\nexport interface AlternatingBlockSection {\n content: React.ReactNode;\n media: React.ReactNode;\n mediaLeft?: boolean;\n}\n\nexport interface AlternatingBlocksProps {\n /**\n * Array of sections to display with alternating layout\n */\n sections: AlternatingBlockSection[];\n /**\n * Section title (optional)\n */\n title?: string;\n /**\n * Section subtitle/eyebrow (optional)\n */\n subtitle?: string;\n /**\n * Background style variant\n * @default \"white\"\n */\n background?: SectionBackground;\n /**\n * Vertical spacing variant\n * @default \"lg\"\n */\n spacing?: SectionSpacing;\n /**\n * Additional CSS classes for the Section wrapper\n */\n className?: string;\n /**\n * Additional CSS classes for the content container\n */\n contentClassName?: string;\n}\n\n/**\n * AlternatingBlocks component displays content sections with alternating media placement.\n * Uses the Section component for consistent spacing, backgrounds, and optional titles.\n *\n * @example\n * ```tsx\n * <AlternatingBlocks\n * title=\"Our Story\"\n * subtitle=\"About Us\"\n * background=\"gray\"\n * spacing=\"xl\"\n * sections={[\n * {\n * content: <div><h3>Title</h3><p>Description</p></div>,\n * media: <img src=\"...\" alt=\"...\" />,\n * mediaLeft: false\n * }\n * ]}\n * />\n * ```\n */\nexport function AlternatingBlocks({\n sections,\n title,\n subtitle,\n background = \"white\",\n spacing = \"lg\",\n className,\n contentClassName,\n}: AlternatingBlocksProps) {\n return (\n <Section\n title={title}\n subtitle={subtitle}\n background={background}\n spacing={spacing}\n className={className}\n >\n <div className={cn(\"mx-auto w-full max-w-[900px]\", contentClassName)}>\n <div className=\"space-y-12\">\n {sections?.map((section, index) => (\n <div\n key={index}\n className=\"grid items-center gap-8 md:grid-cols-2 md:gap-12\"\n >\n <div className={section.mediaLeft ? \"md:order-2\" : \"\"}>\n {section.content}\n </div>\n\n <div\n className={cn(\n \"aspect-[4/3] overflow-hidden rounded-lg border\",\n section.mediaLeft ? \"md:order-1\" : \"\"\n )}\n >\n <div className=\"flex h-full w-full items-center justify-center\">\n {section.media}\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n </Section>\n );\n}\n","/**\n * Semantic Block Registry\n *\n * This registry maps semantic concepts to available UI blocks for AI-driven\n * site generation. Each block entry contains:\n * - id: Unique identifier for the block\n * - name: Human-readable name\n * - description: What the block does and when to use it\n * - semanticTags: Array of semantic concepts this block represents\n * - category: Block category (about, features, cta, testimonials, etc.)\n * - component: Reference to the actual component\n * - props: TypeScript type for the component's props\n * - exampleUsage: Code example showing how to use the block\n */\n\nimport { AlternatingBlocks } from \"../../components/blocks/about/alternating-blocks\";\nimport type { AlternatingBlocksProps } from \"../../components/blocks/about/alternating-blocks\";\n\nexport interface BlockRegistryEntry<T = any> {\n id: string;\n name: string;\n description: string;\n semanticTags: string[];\n category: BlockCategory;\n component: React.ComponentType<T>;\n props: string;\n exampleUsage: string;\n}\n\nexport type BlockCategory =\n | \"about\"\n | \"features\"\n | \"cta\"\n | \"testimonials\"\n | \"services\"\n | \"hero\"\n | \"footer\"\n | \"header\"\n | \"pricing\"\n | \"team\"\n | \"stats\"\n | \"faq\"\n | \"contact\"\n | \"gallery\"\n | \"timeline\"\n | \"process\"\n | \"benefits\"\n | \"comparison\";\n\n/**\n * Block Registry - Central registry of all available UI blocks\n */\nexport const BLOCK_REGISTRY: Record<string, BlockRegistryEntry> = {\n \"alternating-blocks\": {\n id: \"alternating-blocks\",\n name: \"Alternating Content Blocks\",\n description:\n \"Display content sections with alternating left/right media placement. Ideal for storytelling, feature showcases, or company history sections.\",\n semanticTags: [\n \"about\",\n \"story\",\n \"history\",\n \"timeline\",\n \"features\",\n \"benefits\",\n \"alternating\",\n \"two-column\",\n \"content-media\",\n ],\n category: \"about\",\n component: AlternatingBlocks,\n props: \"AlternatingBlocksProps\",\n exampleUsage: `\n<AlternatingBlocks\n sections={[\n {\n content: (\n <div>\n <div className=\"flex items-center gap-2 mb-3\">\n <Lightbulb className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-medium text-muted-foreground\">\n The Origin\n </span>\n </div>\n <h3 className=\"mb-3 text-2xl font-semibold tracking-tight\">\n It started with frustration\n </h3>\n <p className=\"text-muted-foreground leading-relaxed\">\n We spent years watching teams drown in tools that promised to help\n but only added complexity. In 2018, we decided to build something better.\n </p>\n </div>\n ),\n media: <img src=\"...\" alt=\"...\" />,\n mediaLeft: false\n },\n {\n content: <div>...</div>,\n media: <img src=\"...\" alt=\"...\" />,\n mediaLeft: true\n }\n ]}\n/>\n `.trim(),\n },\n // Add more blocks here following this pattern\n};\n\n/**\n * Get blocks by semantic tag\n */\nexport function getBlocksBySemanticTag(tag: string): BlockRegistryEntry[] {\n return Object.values(BLOCK_REGISTRY).filter((block) =>\n block.semanticTags.includes(tag)\n );\n}\n\n/**\n * Get blocks by category\n */\nexport function getBlocksByCategory(\n category: BlockCategory\n): BlockRegistryEntry[] {\n return Object.values(BLOCK_REGISTRY).filter(\n (block) => block.category === category\n );\n}\n\n/**\n * Get block by ID\n */\nexport function getBlockById(id: string): BlockRegistryEntry | undefined {\n return BLOCK_REGISTRY[id];\n}\n\n/**\n * Get all available blocks\n */\nexport function getAllBlocks(): BlockRegistryEntry[] {\n return Object.values(BLOCK_REGISTRY);\n}\n\n/**\n * Get all categories\n */\nexport function getAllCategories(): BlockCategory[] {\n return Array.from(\n new Set(Object.values(BLOCK_REGISTRY).map((block) => block.category))\n );\n}\n\n/**\n * Search blocks by query (searches name, description, and semantic tags)\n */\nexport function searchBlocks(query: string): BlockRegistryEntry[] {\n const lowercaseQuery = query.toLowerCase();\n return Object.values(BLOCK_REGISTRY).filter(\n (block) =>\n block.name.toLowerCase().includes(lowercaseQuery) ||\n block.description.toLowerCase().includes(lowercaseQuery) ||\n block.semanticTags.some((tag) => tag.toLowerCase().includes(lowercaseQuery))\n );\n}\n"]}
|
package/dist/section.cjs
CHANGED
|
@@ -63,6 +63,7 @@ var Section = React__default.default.forwardRef(
|
|
|
63
63
|
subtitle,
|
|
64
64
|
children,
|
|
65
65
|
className,
|
|
66
|
+
style,
|
|
66
67
|
background = "white",
|
|
67
68
|
spacing = "lg",
|
|
68
69
|
...props
|
|
@@ -77,6 +78,7 @@ var Section = React__default.default.forwardRef(
|
|
|
77
78
|
spacingStyles[spacing],
|
|
78
79
|
className
|
|
79
80
|
),
|
|
81
|
+
style,
|
|
80
82
|
...props,
|
|
81
83
|
children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
|
|
82
84
|
(title || subtitle) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center mb-12 md:mb-16", children: [
|
package/dist/section.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/utils.ts","../components/ui/container.tsx","../components/ui/section.tsx"],"names":["twMer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,EAAI,gBAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AAiBO,IAAM,UAAUD,sBAAAA,CAAM,UAAA;AAAA,EAC3B,CACE;AAAA,IACE,EAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA,GAAa,OAAA;AAAA,IACb,OAAA,GAAU,IAAA;AAAA,IACV,GAAG;AAAA,KAEL,GAAA,KACG;AACH,IAAA,uBACEC,cAAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,EAAA;AAAA,QACA,SAAA,EAAW,EAAA;AAAA,UACT,iBAAiB,UAAU,CAAA;AAAA,UAC3B,cAAc,OAAO,CAAA;AAAA,UACrB;AAAA,SACF;AAAA,QACC,GAAG,KAAA;AAAA,QAEJ,0CAAC,SAAA,EAAA,EACG,QAAA,EAAA;AAAA,UAAA,CAAA,KAAA,IAAS,QAAA,qBACTC,eAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,4BAAA,EACZ,QAAA,EAAA;AAAA,YAAA,QAAA,oBACCD,cAAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,oEACV,QAAA,EAAA,QAAA,EACH,CAAA;AAAA,YAED,yBACCA,cAAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,6DACX,QAAA,EAAA,KAAA,EACH;AAAA,WAAA,EAEJ,CAAA;AAAA,UAED;AAAA,SAAA,EACH;AAAA;AAAA,KACF;AAAA,EAEJ;AACF;AAEA,OAAA,CAAQ,WAAA,GAAc,SAAA","file":"section.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport type { ContainerProps } from \"../../src/types\";\n\nconst maxWidthStyles = {\n sm: \"max-w-screen-sm\",\n md: \"max-w-screen-md\",\n lg: \"max-w-screen-lg\",\n xl: \"max-w-screen-xl\",\n \"2xl\": \"max-w-screen-2xl\",\n \"4xl\": \"max-w-[1536px]\",\n full: \"max-w-full\",\n};\n\n/**\n * Container component for consistent content width and centering\n *\n * @example\n * ```tsx\n * <Container maxWidth=\"xl\">\n * <h1>Page Content</h1>\n * </Container>\n * ```\n */\nexport const Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ children, maxWidth = \"xl\", className, as = \"div\", ...props }, ref) => {\n const Component = as as any;\n return (\n <Component\n ref={ref}\n className={cn(\n \"mx-auto w-full px-4 sm:px-6 lg:px-8\",\n maxWidthStyles[maxWidth],\n className\n )}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nContainer.displayName = \"Container\";\n","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Container } from \"./container\";\nimport type { SectionProps } from \"../../src/types\";\n\n/**\n * Background style variants\n * Uses standard Tailwind/shadcn CSS variables for theming\n */\nconst backgroundStyles = {\n white: \"bg-background text-foreground\",\n gray: \"bg-muted/30 text-foreground\",\n dark: \"bg-foreground text-background\",\n gradient: \"bg-gradient-to-br from-primary via-primary/90 to-foreground text-primary-foreground\",\n primary: \"bg-primary text-primary-foreground\",\n secondary: \"bg-secondary text-secondary-foreground\",\n muted: \"bg-muted text-muted-foreground\",\n};\n\n/**\n * Vertical spacing variants\n */\nconst spacingStyles = {\n sm: \"py-12 md:py-16\",\n md: \"py-16 md:py-24\",\n lg: \"py-20 md:py-32\",\n xl: \"py-24 md:py-40\",\n};\n\n/**\n * Section component for consistent page sections with optional title, subtitle, and background\n *\n * @example\n * ```tsx\n * <Section\n * title=\"Our Services\"\n * subtitle=\"What we offer\"\n * background=\"gray\"\n * spacing=\"lg\"\n * >\n * <div>Section content goes here</div>\n * </Section>\n * ```\n */\nexport const Section = React.forwardRef<HTMLElement, SectionProps>(\n (\n {\n id,\n title,\n subtitle,\n children,\n className,\n background = \"white\",\n spacing = \"lg\",\n ...props\n },\n ref\n ) => {\n return (\n <section\n ref={ref}\n id={id}\n className={cn(\n backgroundStyles[background],\n spacingStyles[spacing],\n className\n )}\n {...props}\n >\n <Container>\n {(title || subtitle) && (\n <div className=\"text-center mb-12 md:mb-16\">\n {subtitle && (\n <p className=\"text-sm font-semibold uppercase tracking-wider mb-2 text-primary\">\n {subtitle}\n </p>\n )}\n {title && (\n <h2 className=\"text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight\">\n {title}\n </h2>\n )}\n </div>\n )}\n {children}\n </Container>\n </section>\n );\n }\n);\n\nSection.displayName = \"Section\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../lib/utils.ts","../components/ui/container.tsx","../components/ui/section.tsx"],"names":["twMerge","clsx","React","jsx","jsxs"],"mappings":";;;;;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACDA,IAAM,cAAA,GAAiB;AAAA,EACrB,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,KAAA,EAAO,kBAAA;AAAA,EACP,KAAA,EAAO,gBAAA;AAAA,EACP,IAAA,EAAM;AACR,CAAA;AAYO,IAAM,YAAYC,sBAAA,CAAM,UAAA;AAAA,EAC7B,CAAC,EAAE,QAAA,EAAU,QAAA,GAAW,IAAA,EAAM,SAAA,EAAW,EAAA,GAAK,KAAA,EAAO,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AACvE,IAAA,MAAM,SAAA,GAAY,EAAA;AAClB,IAAA,uBACEC,cAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAW,EAAA;AAAA,UACT,qCAAA;AAAA,UACA,eAAe,QAAQ,CAAA;AAAA,UACvB;AAAA,SACF;AAAA,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oEACV,QAAA,EAAA,QAAA,EACH,CAAA;AAAA,YAED,yBACCA,cAAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,6DACX,QAAA,EAAA,KAAA,EACH;AAAA,WAAA,EAEJ,CAAA;AAAA,UAED;AAAA,SAAA,EACH;AAAA;AAAA,KACF;AAAA,EAEJ;AACF;AAEA,OAAA,CAAQ,WAAA,GAAc,SAAA","file":"section.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport type { ContainerProps } from \"../../src/types\";\n\nconst maxWidthStyles = {\n sm: \"max-w-screen-sm\",\n md: \"max-w-screen-md\",\n lg: \"max-w-screen-lg\",\n xl: \"max-w-screen-xl\",\n \"2xl\": \"max-w-screen-2xl\",\n \"4xl\": \"max-w-[1536px]\",\n full: \"max-w-full\",\n};\n\n/**\n * Container component for consistent content width and centering\n *\n * @example\n * ```tsx\n * <Container maxWidth=\"xl\">\n * <h1>Page Content</h1>\n * </Container>\n * ```\n */\nexport const Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ children, maxWidth = \"xl\", className, as = \"div\", ...props }, ref) => {\n const Component = as as any;\n return (\n <Component\n ref={ref}\n className={cn(\n \"mx-auto w-full px-4 sm:px-6 lg:px-8\",\n maxWidthStyles[maxWidth],\n className\n )}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nContainer.displayName = \"Container\";\n","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Container } from \"./container\";\nimport type { SectionProps } from \"../../src/types\";\n\n/**\n * Background style variants\n * Uses standard Tailwind/shadcn CSS variables for theming\n */\nconst backgroundStyles = {\n white: \"bg-background text-foreground\",\n gray: \"bg-muted/30 text-foreground\",\n dark: \"bg-foreground text-background\",\n gradient: \"bg-gradient-to-br from-primary via-primary/90 to-foreground text-primary-foreground\",\n primary: \"bg-primary text-primary-foreground\",\n secondary: \"bg-secondary text-secondary-foreground\",\n muted: \"bg-muted text-muted-foreground\",\n};\n\n/**\n * Vertical spacing variants\n */\nconst spacingStyles = {\n sm: \"py-12 md:py-16\",\n md: \"py-16 md:py-24\",\n lg: \"py-20 md:py-32\",\n xl: \"py-24 md:py-40\",\n};\n\n/**\n * Section component for consistent page sections with optional title, subtitle, and background\n *\n * @example\n * ```tsx\n * <Section\n * title=\"Our Services\"\n * subtitle=\"What we offer\"\n * background=\"gray\"\n * spacing=\"lg\"\n * >\n * <div>Section content goes here</div>\n * </Section>\n * ```\n */\nexport const Section = React.forwardRef<HTMLElement, SectionProps>(\n (\n {\n id,\n title,\n subtitle,\n children,\n className,\n style,\n background = \"white\",\n spacing = \"lg\",\n ...props\n },\n ref\n ) => {\n return (\n <section\n ref={ref}\n id={id}\n className={cn(\n backgroundStyles[background],\n spacingStyles[spacing],\n className\n )}\n style={style}\n {...props}\n >\n <Container>\n {(title || subtitle) && (\n <div className=\"text-center mb-12 md:mb-16\">\n {subtitle && (\n <p className=\"text-sm font-semibold uppercase tracking-wider mb-2 text-primary\">\n {subtitle}\n </p>\n )}\n {title && (\n <h2 className=\"text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight\">\n {title}\n </h2>\n )}\n </div>\n )}\n {children}\n </Container>\n </section>\n );\n }\n);\n\nSection.displayName = \"Section\";\n"]}
|
package/dist/section.js
CHANGED
|
@@ -57,6 +57,7 @@ var Section = React.forwardRef(
|
|
|
57
57
|
subtitle,
|
|
58
58
|
children,
|
|
59
59
|
className,
|
|
60
|
+
style,
|
|
60
61
|
background = "white",
|
|
61
62
|
spacing = "lg",
|
|
62
63
|
...props
|
|
@@ -71,6 +72,7 @@ var Section = React.forwardRef(
|
|
|
71
72
|
spacingStyles[spacing],
|
|
72
73
|
className
|
|
73
74
|
),
|
|
75
|
+
style,
|
|
74
76
|
...props,
|
|
75
77
|
children: /* @__PURE__ */ jsxs(Container, { children: [
|
|
76
78
|
(title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "text-center mb-12 md:mb-16", children: [
|
package/dist/section.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/utils.ts","../components/ui/container.tsx","../components/ui/section.tsx"],"names":["React","jsx"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACDA,IAAM,cAAA,GAAiB;AAAA,EACrB,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,KAAA,EAAO,kBAAA;AAAA,EACP,KAAA,EAAO,gBAAA;AAAA,EACP,IAAA,EAAM;AACR,CAAA;AAYO,IAAM,YAAY,KAAA,CAAM,UAAA;AAAA,EAC7B,CAAC,EAAE,QAAA,EAAU,QAAA,GAAW,IAAA,EAAM,SAAA,EAAW,EAAA,GAAK,KAAA,EAAO,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AACvE,IAAA,MAAM,SAAA,GAAY,EAAA;AAClB,IAAA,uBACE,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAW,EAAA;AAAA,UACT,qCAAA;AAAA,UACA,eAAe,QAAQ,CAAA;AAAA,UACvB;AAAA,SACF;AAAA,QACC,GAAG,KAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AACF,CAAA;AAEA,SAAA,CAAU,WAAA,GAAc,WAAA;AClCxB,IAAM,gBAAA,GAAmB;AAAA,EACvB,KAAA,EAAO,+BAAA;AAAA,EACP,IAAA,EAAM,6BAAA;AAAA,EACN,IAAA,EAAM,+BAAA;AAAA,EACN,QAAA,EAAU,qFAAA;AAAA,EACV,OAAA,EAAS,oCAAA;AAAA,EACT,SAAA,EAAW,wCAAA;AAAA,EACX,KAAA,EAAO;AACT,CAAA;AAKA,IAAM,aAAA,GAAgB;AAAA,EACpB,EAAA,EAAI,gBAAA;AAAA,EACJ,EAAA,EAAI,gBAAA;AAAA,EACJ,EAAA,EAAI,gBAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AAiBO,IAAM,UAAUA,KAAAA,CAAM,UAAA;AAAA,EAC3B,CACE;AAAA,IACE,EAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA,GAAa,OAAA;AAAA,IACb,OAAA,GAAU,IAAA;AAAA,IACV,GAAG;AAAA,KAEL,GAAA,KACG;AACH,IAAA,uBACEC,GAAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,EAAA;AAAA,QACA,SAAA,EAAW,EAAA;AAAA,UACT,iBAAiB,UAAU,CAAA;AAAA,UAC3B,cAAc,OAAO,CAAA;AAAA,UACrB;AAAA,SACF;AAAA,QACC,GAAG,KAAA;AAAA,QAEJ,+BAAC,SAAA,EAAA,EACG,QAAA,EAAA;AAAA,UAAA,CAAA,KAAA,IAAS,QAAA,qBACT,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,4BAAA,EACZ,QAAA,EAAA;AAAA,YAAA,QAAA,oBACCA,GAAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,oEACV,QAAA,EAAA,QAAA,EACH,CAAA;AAAA,YAED,yBACCA,GAAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,6DACX,QAAA,EAAA,KAAA,EACH;AAAA,WAAA,EAEJ,CAAA;AAAA,UAED;AAAA,SAAA,EACH;AAAA;AAAA,KACF;AAAA,EAEJ;AACF;AAEA,OAAA,CAAQ,WAAA,GAAc,SAAA","file":"section.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport type { ContainerProps } from \"../../src/types\";\n\nconst maxWidthStyles = {\n sm: \"max-w-screen-sm\",\n md: \"max-w-screen-md\",\n lg: \"max-w-screen-lg\",\n xl: \"max-w-screen-xl\",\n \"2xl\": \"max-w-screen-2xl\",\n \"4xl\": \"max-w-[1536px]\",\n full: \"max-w-full\",\n};\n\n/**\n * Container component for consistent content width and centering\n *\n * @example\n * ```tsx\n * <Container maxWidth=\"xl\">\n * <h1>Page Content</h1>\n * </Container>\n * ```\n */\nexport const Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ children, maxWidth = \"xl\", className, as = \"div\", ...props }, ref) => {\n const Component = as as any;\n return (\n <Component\n ref={ref}\n className={cn(\n \"mx-auto w-full px-4 sm:px-6 lg:px-8\",\n maxWidthStyles[maxWidth],\n className\n )}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nContainer.displayName = \"Container\";\n","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Container } from \"./container\";\nimport type { SectionProps } from \"../../src/types\";\n\n/**\n * Background style variants\n * Uses standard Tailwind/shadcn CSS variables for theming\n */\nconst backgroundStyles = {\n white: \"bg-background text-foreground\",\n gray: \"bg-muted/30 text-foreground\",\n dark: \"bg-foreground text-background\",\n gradient: \"bg-gradient-to-br from-primary via-primary/90 to-foreground text-primary-foreground\",\n primary: \"bg-primary text-primary-foreground\",\n secondary: \"bg-secondary text-secondary-foreground\",\n muted: \"bg-muted text-muted-foreground\",\n};\n\n/**\n * Vertical spacing variants\n */\nconst spacingStyles = {\n sm: \"py-12 md:py-16\",\n md: \"py-16 md:py-24\",\n lg: \"py-20 md:py-32\",\n xl: \"py-24 md:py-40\",\n};\n\n/**\n * Section component for consistent page sections with optional title, subtitle, and background\n *\n * @example\n * ```tsx\n * <Section\n * title=\"Our Services\"\n * subtitle=\"What we offer\"\n * background=\"gray\"\n * spacing=\"lg\"\n * >\n * <div>Section content goes here</div>\n * </Section>\n * ```\n */\nexport const Section = React.forwardRef<HTMLElement, SectionProps>(\n (\n {\n id,\n title,\n subtitle,\n children,\n className,\n background = \"white\",\n spacing = \"lg\",\n ...props\n },\n ref\n ) => {\n return (\n <section\n ref={ref}\n id={id}\n className={cn(\n backgroundStyles[background],\n spacingStyles[spacing],\n className\n )}\n {...props}\n >\n <Container>\n {(title || subtitle) && (\n <div className=\"text-center mb-12 md:mb-16\">\n {subtitle && (\n <p className=\"text-sm font-semibold uppercase tracking-wider mb-2 text-primary\">\n {subtitle}\n </p>\n )}\n {title && (\n <h2 className=\"text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight\">\n {title}\n </h2>\n )}\n </div>\n )}\n {children}\n </Container>\n </section>\n );\n }\n);\n\nSection.displayName = \"Section\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../lib/utils.ts","../components/ui/container.tsx","../components/ui/section.tsx"],"names":["React","jsx"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACDA,IAAM,cAAA,GAAiB;AAAA,EACrB,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,KAAA,EAAO,kBAAA;AAAA,EACP,KAAA,EAAO,gBAAA;AAAA,EACP,IAAA,EAAM;AACR,CAAA;AAYO,IAAM,YAAY,KAAA,CAAM,UAAA;AAAA,EAC7B,CAAC,EAAE,QAAA,EAAU,QAAA,GAAW,IAAA,EAAM,SAAA,EAAW,EAAA,GAAK,KAAA,EAAO,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AACvE,IAAA,MAAM,SAAA,GAAY,EAAA;AAClB,IAAA,uBACE,GAAA;AAAA,MAAC,SAAA;AAAA,M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,KAAA,EAAA,EAAI,SAAA,EAAU,4BAAA,EACZ,QAAA,EAAA;AAAA,YAAA,QAAA,oBACCA,GAAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,oEACV,QAAA,EAAA,QAAA,EACH,CAAA;AAAA,YAED,yBACCA,GAAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,6DACX,QAAA,EAAA,KAAA,EACH;AAAA,WAAA,EAEJ,CAAA;AAAA,UAED;AAAA,SAAA,EACH;AAAA;AAAA,KACF;AAAA,EAEJ;AACF;AAEA,OAAA,CAAQ,WAAA,GAAc,SAAA","file":"section.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport type { ContainerProps } from \"../../src/types\";\n\nconst maxWidthStyles = {\n sm: \"max-w-screen-sm\",\n md: \"max-w-screen-md\",\n lg: \"max-w-screen-lg\",\n xl: \"max-w-screen-xl\",\n \"2xl\": \"max-w-screen-2xl\",\n \"4xl\": \"max-w-[1536px]\",\n full: \"max-w-full\",\n};\n\n/**\n * Container component for consistent content width and centering\n *\n * @example\n * ```tsx\n * <Container maxWidth=\"xl\">\n * <h1>Page Content</h1>\n * </Container>\n * ```\n */\nexport const Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ children, maxWidth = \"xl\", className, as = \"div\", ...props }, ref) => {\n const Component = as as any;\n return (\n <Component\n ref={ref}\n className={cn(\n \"mx-auto w-full px-4 sm:px-6 lg:px-8\",\n maxWidthStyles[maxWidth],\n className\n )}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nContainer.displayName = \"Container\";\n","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Container } from \"./container\";\nimport type { SectionProps } from \"../../src/types\";\n\n/**\n * Background style variants\n * Uses standard Tailwind/shadcn CSS variables for theming\n */\nconst backgroundStyles = {\n white: \"bg-background text-foreground\",\n gray: \"bg-muted/30 text-foreground\",\n dark: \"bg-foreground text-background\",\n gradient: \"bg-gradient-to-br from-primary via-primary/90 to-foreground text-primary-foreground\",\n primary: \"bg-primary text-primary-foreground\",\n secondary: \"bg-secondary text-secondary-foreground\",\n muted: \"bg-muted text-muted-foreground\",\n};\n\n/**\n * Vertical spacing variants\n */\nconst spacingStyles = {\n sm: \"py-12 md:py-16\",\n md: \"py-16 md:py-24\",\n lg: \"py-20 md:py-32\",\n xl: \"py-24 md:py-40\",\n};\n\n/**\n * Section component for consistent page sections with optional title, subtitle, and background\n *\n * @example\n * ```tsx\n * <Section\n * title=\"Our Services\"\n * subtitle=\"What we offer\"\n * background=\"gray\"\n * spacing=\"lg\"\n * >\n * <div>Section content goes here</div>\n * </Section>\n * ```\n */\nexport const Section = React.forwardRef<HTMLElement, SectionProps>(\n (\n {\n id,\n title,\n subtitle,\n children,\n className,\n style,\n background = \"white\",\n spacing = \"lg\",\n ...props\n },\n ref\n ) => {\n return (\n <section\n ref={ref}\n id={id}\n className={cn(\n backgroundStyles[background],\n spacingStyles[spacing],\n className\n )}\n style={style}\n {...props}\n >\n <Container>\n {(title || subtitle) && (\n <div className=\"text-center mb-12 md:mb-16\">\n {subtitle && (\n <p className=\"text-sm font-semibold uppercase tracking-wider mb-2 text-primary\">\n {subtitle}\n </p>\n )}\n {title && (\n <h2 className=\"text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight\">\n {title}\n </h2>\n )}\n </div>\n )}\n {children}\n </Container>\n </section>\n );\n }\n);\n\nSection.displayName = \"Section\";\n"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -70,9 +70,13 @@ interface SectionProps extends HTMLAttributes<HTMLElement> {
|
|
|
70
70
|
*/
|
|
71
71
|
spacing?: SectionSpacing;
|
|
72
72
|
/**
|
|
73
|
-
* Additional CSS classes
|
|
73
|
+
* Additional CSS classes (can override spacing and background styles)
|
|
74
74
|
*/
|
|
75
75
|
className?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Inline styles (React.CSSProperties)
|
|
78
|
+
*/
|
|
79
|
+
style?: React.CSSProperties;
|
|
76
80
|
}
|
|
77
81
|
/**
|
|
78
82
|
* Props for AnimatedDialog component
|
|
@@ -176,5 +180,36 @@ interface PageHeroBannerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
176
180
|
*/
|
|
177
181
|
contentMaxWidth?: ContainerMaxWidth;
|
|
178
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Block Types - Content-Specific UI Blocks
|
|
185
|
+
*/
|
|
186
|
+
/**
|
|
187
|
+
* Props for AlternatingBlocks component
|
|
188
|
+
*/
|
|
189
|
+
interface AlternatingBlockSection {
|
|
190
|
+
/**
|
|
191
|
+
* Content node to display (text, headings, etc.)
|
|
192
|
+
*/
|
|
193
|
+
content: ReactNode;
|
|
194
|
+
/**
|
|
195
|
+
* Media node to display (image, video, icon, etc.)
|
|
196
|
+
*/
|
|
197
|
+
media: ReactNode;
|
|
198
|
+
/**
|
|
199
|
+
* Whether to place media on the left side
|
|
200
|
+
* @default false (media on right)
|
|
201
|
+
*/
|
|
202
|
+
mediaLeft?: boolean;
|
|
203
|
+
}
|
|
204
|
+
interface AlternatingBlocksProps {
|
|
205
|
+
/**
|
|
206
|
+
* Array of sections to display with alternating layout
|
|
207
|
+
*/
|
|
208
|
+
sections: AlternatingBlockSection[];
|
|
209
|
+
/**
|
|
210
|
+
* Additional CSS classes
|
|
211
|
+
*/
|
|
212
|
+
className?: string;
|
|
213
|
+
}
|
|
179
214
|
|
|
180
|
-
export type { AnimatedDialogProps, AnimatedDialogSize, ContainerMaxWidth, ContainerProps, PageHeroBannerProps, SectionBackground, SectionProps, SectionSpacing };
|
|
215
|
+
export type { AlternatingBlockSection, AlternatingBlocksProps, AnimatedDialogProps, AnimatedDialogSize, ContainerMaxWidth, ContainerProps, PageHeroBannerProps, SectionBackground, SectionProps, SectionSpacing };
|
package/dist/types.d.ts
CHANGED
|
@@ -70,9 +70,13 @@ interface SectionProps extends HTMLAttributes<HTMLElement> {
|
|
|
70
70
|
*/
|
|
71
71
|
spacing?: SectionSpacing;
|
|
72
72
|
/**
|
|
73
|
-
* Additional CSS classes
|
|
73
|
+
* Additional CSS classes (can override spacing and background styles)
|
|
74
74
|
*/
|
|
75
75
|
className?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Inline styles (React.CSSProperties)
|
|
78
|
+
*/
|
|
79
|
+
style?: React.CSSProperties;
|
|
76
80
|
}
|
|
77
81
|
/**
|
|
78
82
|
* Props for AnimatedDialog component
|
|
@@ -176,5 +180,36 @@ interface PageHeroBannerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
176
180
|
*/
|
|
177
181
|
contentMaxWidth?: ContainerMaxWidth;
|
|
178
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Block Types - Content-Specific UI Blocks
|
|
185
|
+
*/
|
|
186
|
+
/**
|
|
187
|
+
* Props for AlternatingBlocks component
|
|
188
|
+
*/
|
|
189
|
+
interface AlternatingBlockSection {
|
|
190
|
+
/**
|
|
191
|
+
* Content node to display (text, headings, etc.)
|
|
192
|
+
*/
|
|
193
|
+
content: ReactNode;
|
|
194
|
+
/**
|
|
195
|
+
* Media node to display (image, video, icon, etc.)
|
|
196
|
+
*/
|
|
197
|
+
media: ReactNode;
|
|
198
|
+
/**
|
|
199
|
+
* Whether to place media on the left side
|
|
200
|
+
* @default false (media on right)
|
|
201
|
+
*/
|
|
202
|
+
mediaLeft?: boolean;
|
|
203
|
+
}
|
|
204
|
+
interface AlternatingBlocksProps {
|
|
205
|
+
/**
|
|
206
|
+
* Array of sections to display with alternating layout
|
|
207
|
+
*/
|
|
208
|
+
sections: AlternatingBlockSection[];
|
|
209
|
+
/**
|
|
210
|
+
* Additional CSS classes
|
|
211
|
+
*/
|
|
212
|
+
className?: string;
|
|
213
|
+
}
|
|
179
214
|
|
|
180
|
-
export type { AnimatedDialogProps, AnimatedDialogSize, ContainerMaxWidth, ContainerProps, PageHeroBannerProps, SectionBackground, SectionProps, SectionSpacing };
|
|
215
|
+
export type { AlternatingBlockSection, AlternatingBlocksProps, AnimatedDialogProps, AnimatedDialogSize, ContainerMaxWidth, ContainerProps, PageHeroBannerProps, SectionBackground, SectionProps, SectionSpacing };
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensite/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Foundational UI component library for OpenSite Semantic Site Builder with tree-shakable exports and abstract styling",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
7
7
|
"performance",
|
|
8
8
|
"pagespeed",
|
|
9
9
|
"tree-shakeable",
|
|
10
|
-
"ui",
|
|
10
|
+
"semantic-ui",
|
|
11
11
|
"shadcn",
|
|
12
12
|
"tailwind"
|
|
13
13
|
],
|
|
@@ -76,6 +76,16 @@
|
|
|
76
76
|
"import": "./dist/popover.js",
|
|
77
77
|
"require": "./dist/popover.cjs"
|
|
78
78
|
},
|
|
79
|
+
"./blocks/about/alternating-blocks": {
|
|
80
|
+
"types": "./dist/alternating-blocks.d.ts",
|
|
81
|
+
"import": "./dist/alternating-blocks.js",
|
|
82
|
+
"require": "./dist/alternating-blocks.cjs"
|
|
83
|
+
},
|
|
84
|
+
"./registry": {
|
|
85
|
+
"types": "./dist/registry.d.ts",
|
|
86
|
+
"import": "./dist/registry.js",
|
|
87
|
+
"require": "./dist/registry.cjs"
|
|
88
|
+
},
|
|
79
89
|
"./utils": {
|
|
80
90
|
"types": "./dist/utils.d.ts",
|
|
81
91
|
"import": "./dist/utils.js",
|