@zoyth/simple-site-framework 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +572 -0
- package/bin/create-simple-site.js +390 -0
- package/bin/simple-site.js +664 -0
- package/dist/client.js +135 -0
- package/dist/client.js.map +1 -0
- package/dist/client.mjs +107 -0
- package/dist/client.mjs.map +1 -0
- package/dist/components/index.d.mts +3936 -0
- package/dist/components/index.d.ts +3936 -0
- package/dist/components/index.js +38265 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +38173 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/config/index.d.mts +298 -0
- package/dist/config/index.d.ts +298 -0
- package/dist/config/index.js +19 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/index.mjs +1 -0
- package/dist/config/index.mjs.map +1 -0
- package/dist/index.d.mts +2184 -0
- package/dist/index.d.ts +2184 -0
- package/dist/index.js +1713 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1605 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/i18n/index.js +665 -0
- package/dist/lib/i18n/index.js.map +1 -0
- package/dist/lib/i18n/index.mjs +621 -0
- package/dist/lib/i18n/index.mjs.map +1 -0
- package/docs/DOCUMENTATION-STRUCTURE.md +1156 -0
- package/docs/EXPORTS.md +125 -0
- package/docs/PERFORMANCE.md +757 -0
- package/docs/POLICY-PAGES.md +867 -0
- package/docs/ROADMAP.md +334 -0
- package/docs/SEO.md +455 -0
- package/docs/SITEMAP.md +708 -0
- package/docs/STRUCTURED-DATA.md +671 -0
- package/docs/accessibility/common-patterns.md +529 -0
- package/docs/accessibility/keyboard-navigation.md +263 -0
- package/docs/accessibility/overview.md +122 -0
- package/docs/accessibility/screen-readers.md +311 -0
- package/docs/accessibility/wcag-compliance.md +159 -0
- package/docs/api/README.md +164 -0
- package/docs/api/components/Accessibility.md +356 -0
- package/docs/api/components/Button.md +240 -0
- package/docs/api/components/HeroSection.md +306 -0
- package/docs/architecture/decisions.md +449 -0
- package/docs/components/AnalyticsTracker.md +58 -0
- package/docs/components/AnimatedCounter.md +48 -0
- package/docs/components/AnimatedSection.md +56 -0
- package/docs/components/BlogCard.md +42 -0
- package/docs/components/Checkbox.md +56 -0
- package/docs/components/CodeBlock.md +52 -0
- package/docs/components/ComparisonTable.md +40 -0
- package/docs/components/ComponentDemo.md +38 -0
- package/docs/components/CountdownTimer.md +51 -0
- package/docs/components/ExitIntentModal.md +56 -0
- package/docs/components/FAQAccordion.md +66 -0
- package/docs/components/FeaturesGrid.md +55 -0
- package/docs/components/FileUpload.md +54 -0
- package/docs/components/I18nMetaTags.md +55 -0
- package/docs/components/Icon.md +53 -0
- package/docs/components/LazySection.md +46 -0
- package/docs/components/LiveProof.md +53 -0
- package/docs/components/LoadingSpinner.md +46 -0
- package/docs/components/MultiStepForm.md +48 -0
- package/docs/components/PolicyLayout.md +55 -0
- package/docs/components/PricingTable.md +49 -0
- package/docs/components/Radio.md +59 -0
- package/docs/components/SEOMetaTags.md +58 -0
- package/docs/components/ScriptInjector.md +50 -0
- package/docs/components/Select.md +72 -0
- package/docs/components/Skeleton.md +47 -0
- package/docs/components/StatsSection.md +48 -0
- package/docs/components/StickyBar.md +62 -0
- package/docs/components/StructuredData.md +99 -0
- package/docs/components/StyleGuide.md +46 -0
- package/docs/components/TableOfContents.md +47 -0
- package/docs/components/TestimonialCarousel.md +42 -0
- package/docs/components/Timeline.md +51 -0
- package/docs/components/Toast.md +59 -0
- package/docs/components/TrackedLink.md +62 -0
- package/docs/components/TrustBadges.md +44 -0
- package/docs/components/conversion/MobileCTA.md +363 -0
- package/docs/components/forms/ContactForm.md +75 -0
- package/docs/components/forms/FormField.md +74 -0
- package/docs/components/layout/Footer.md +601 -0
- package/docs/components/layout/Header.md +549 -0
- package/docs/components/layout/LanguageSelector.md +54 -0
- package/docs/components/layout/LanguageSwitcher.md +24 -0
- package/docs/components/overview.md +447 -0
- package/docs/components/sections/AboutSection.md +48 -0
- package/docs/components/sections/CTASection.md +596 -0
- package/docs/components/sections/CaseStudySection.md +47 -0
- package/docs/components/sections/ContactSection.md +599 -0
- package/docs/components/sections/FeatureSection.md +44 -0
- package/docs/components/sections/HeroSection.md +404 -0
- package/docs/components/sections/LogosSection.md +47 -0
- package/docs/components/sections/PersonalTaxesSection.md +23 -0
- package/docs/components/sections/RecruitingSection.md +23 -0
- package/docs/components/sections/SecurePortalSection.md +23 -0
- package/docs/components/sections/ServicePageLayout.md +52 -0
- package/docs/components/sections/ServicesSection.md +49 -0
- package/docs/components/sections/TestimonialSection.md +44 -0
- package/docs/components/sections/WhyChooseUsSection.md +54 -0
- package/docs/components/ui/Breadcrumb.md +70 -0
- package/docs/components/ui/Button.md +514 -0
- package/docs/components/ui/Card.md +501 -0
- package/docs/components/ui/Input.md +54 -0
- package/docs/components/ui/MobileLinks.md +43 -0
- package/docs/components/ui/Modal.md +60 -0
- package/docs/components/ui/Tabs.md +62 -0
- package/docs/components/ui/Textarea.md +52 -0
- package/docs/core-concepts/configuration-driven.md +552 -0
- package/docs/core-concepts/overview.md +351 -0
- package/docs/features/accessibility/README.md +73 -0
- package/docs/features/accessibility/aria-support.md +177 -0
- package/docs/features/accessibility/color-contrast.md +155 -0
- package/docs/features/accessibility/focus-management.md +187 -0
- package/docs/features/accessibility/testing.md +196 -0
- package/docs/features/analytics/README.md +51 -0
- package/docs/features/analytics/ab-testing.md +171 -0
- package/docs/features/analytics/conversion-tracking.md +207 -0
- package/docs/features/analytics/custom-events.md +219 -0
- package/docs/features/analytics/privacy.md +198 -0
- package/docs/features/analytics/setup.md +114 -0
- package/docs/features/analytics/tracking-events.md +224 -0
- package/docs/features/i18n/README.md +51 -0
- package/docs/features/i18n/best-practices.md +273 -0
- package/docs/features/i18n/configuration.md +84 -0
- package/docs/features/i18n/formatting.md +133 -0
- package/docs/features/i18n/locale-detection.md +122 -0
- package/docs/features/i18n/routing.md +99 -0
- package/docs/features/i18n/rtl-support.md +191 -0
- package/docs/features/i18n/translations.md +129 -0
- package/docs/features/internationalization.md +595 -0
- package/docs/features/performance/README.md +77 -0
- package/docs/features/performance/bundle-size.md +134 -0
- package/docs/features/performance/caching.md +131 -0
- package/docs/features/performance/code-splitting.md +121 -0
- package/docs/features/performance/image-optimization.md +110 -0
- package/docs/features/performance/lazy-loading.md +92 -0
- package/docs/features/performance/monitoring.md +148 -0
- package/docs/features/seo/README.md +51 -0
- package/docs/features/seo/best-practices.md +184 -0
- package/docs/features/seo/canonical-urls.md +182 -0
- package/docs/features/seo/meta-tags.md +126 -0
- package/docs/features/seo/open-graph.md +166 -0
- package/docs/features/seo/robots-txt.md +146 -0
- package/docs/features/seo/sitemaps.md +162 -0
- package/docs/features/seo/structured-data.md +166 -0
- package/docs/getting-started/installation.md +292 -0
- package/docs/getting-started/introduction.md +195 -0
- package/docs/getting-started/quick-start.md +460 -0
- package/docs/guides/analytics-setup.md +616 -0
- package/docs/i18n/CONFIGURATION.md +353 -0
- package/docs/i18n/EXAMPLES.md +402 -0
- package/docs/i18n/MIGRATION.md +260 -0
- package/docs/i18n/SEO.md +392 -0
- package/docs/i18n/STATIC-GENERATION-FIX.md +71 -0
- package/docs/migration/changelog.md +136 -0
- package/docs/migration/overview.md +233 -0
- package/docs/recipes/adding-animations.md +475 -0
- package/docs/recipes/forms-with-validation.md +393 -0
- package/package.json +152 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 François Lane
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
# Simple Site Framework
|
|
2
|
+
|
|
3
|
+
A configuration-driven framework for building professional service websites with Next.js, React, and TypeScript.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Configuration-Driven**: Define your site's theme, content, and navigation in simple config files
|
|
8
|
+
- **Type-Safe**: Full TypeScript support with comprehensive type definitions
|
|
9
|
+
- **Flexible i18n**: Configurable internationalization supporting any number of languages
|
|
10
|
+
- **35+ Components**: Pre-built sections, layouts, and UI components with advanced features
|
|
11
|
+
- **Themeable**: Easy customization of colors, fonts, and design tokens
|
|
12
|
+
- **Next.js Optimized**: Built specifically for Next.js 14+ with App Router
|
|
13
|
+
- **CLI Tools**: Scaffold new projects and manage framework tasks with built-in commands
|
|
14
|
+
- **Accessibility First**: WCAG 2.1 AA compliant with comprehensive keyboard navigation
|
|
15
|
+
- **Performance Optimized**: Lazy loading, code splitting, and optimized animations
|
|
16
|
+
|
|
17
|
+
## Quick Start with CLI
|
|
18
|
+
|
|
19
|
+
The fastest way to get started is with the CLI scaffolding tool:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx @zoyth/simple-site-framework create my-site
|
|
23
|
+
cd my-site
|
|
24
|
+
npm install
|
|
25
|
+
npm run dev
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
This creates a complete Next.js project with:
|
|
29
|
+
- All framework dependencies configured
|
|
30
|
+
- Sample theme and content configs
|
|
31
|
+
- Example pages using all major components
|
|
32
|
+
- Tailwind CSS properly configured
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
For existing projects:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install @zoyth/simple-site-framework
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Peer Dependencies
|
|
43
|
+
|
|
44
|
+
This framework requires the following peer dependencies:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm install next@16 react@19 react-dom@19 tailwindcss@4
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Note:** Tailwind CSS v3.4+ and v4.x are both fully supported. The framework uses standard Tailwind utility classes that work across both versions.
|
|
51
|
+
|
|
52
|
+
## ⚠️ Components Rendering Without Styling?
|
|
53
|
+
|
|
54
|
+
If your site renders but looks plain/unstyled, see **[TROUBLESHOOTING.md](./TROUBLESHOOTING.md)** for a complete setup checklist. The framework requires custom theme tokens to be defined in your Tailwind config.
|
|
55
|
+
|
|
56
|
+
## Tailwind CSS Compatibility
|
|
57
|
+
|
|
58
|
+
The framework is built with **Tailwind CSS** and works seamlessly with both v3.4+ and v4.x.
|
|
59
|
+
|
|
60
|
+
### Required Tailwind Configuration
|
|
61
|
+
|
|
62
|
+
Your project's `tailwind.config.ts` must include the framework components in the `content` array:
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
import type { Config } from 'tailwindcss';
|
|
66
|
+
|
|
67
|
+
const config: Config = {
|
|
68
|
+
content: [
|
|
69
|
+
'./src/**/*.{js,ts,jsx,tsx,mdx}',
|
|
70
|
+
// Include framework components for Tailwind to scan
|
|
71
|
+
'./node_modules/@zoyth/simple-site-framework/dist/**/*.{js,mjs}',
|
|
72
|
+
],
|
|
73
|
+
theme: {
|
|
74
|
+
extend: {
|
|
75
|
+
colors: {
|
|
76
|
+
// Define colors that match your theme config
|
|
77
|
+
primary: '#F16531',
|
|
78
|
+
'primary-hover': '#D9551C',
|
|
79
|
+
},
|
|
80
|
+
fontFamily: {
|
|
81
|
+
heading: ['var(--font-heading)', 'serif'],
|
|
82
|
+
body: ['var(--font-body)', 'sans-serif'],
|
|
83
|
+
},
|
|
84
|
+
backgroundImage: {
|
|
85
|
+
'brand-gradient-light': 'linear-gradient(to bottom, #F8FAFC, #FFFFFF)',
|
|
86
|
+
'hero-gradient': 'linear-gradient(135deg, #2D3748, #1A202C)',
|
|
87
|
+
'footer-gradient-orange': 'linear-gradient(135deg, #F37840, #D85620)',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export default config;
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Why Both Versions Work
|
|
97
|
+
|
|
98
|
+
The framework only uses **standard Tailwind utility classes** that haven't changed between v3 and v4:
|
|
99
|
+
- Spacing: `px-4`, `py-6`, `mt-8`
|
|
100
|
+
- Layout: `flex`, `grid`, `items-center`
|
|
101
|
+
- Colors: `bg-primary`, `text-white`, `border-slate-200`
|
|
102
|
+
- Typography: `text-lg`, `font-bold`
|
|
103
|
+
- Effects: `hover:opacity-80`, `transition-colors`
|
|
104
|
+
|
|
105
|
+
These utilities are stable and work identically in both Tailwind v3.4+ and v4.x.
|
|
106
|
+
|
|
107
|
+
## Quick Start
|
|
108
|
+
|
|
109
|
+
### 1. Create Theme Configuration
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
// src/config/theme.ts
|
|
113
|
+
import { ThemeConfig } from 'simple-site-framework';
|
|
114
|
+
|
|
115
|
+
export const myTheme: ThemeConfig = {
|
|
116
|
+
brand: {
|
|
117
|
+
name: 'My Company',
|
|
118
|
+
colors: {
|
|
119
|
+
primary: '#F16531',
|
|
120
|
+
primaryHover: '#D9551C',
|
|
121
|
+
// ... more colors
|
|
122
|
+
},
|
|
123
|
+
fonts: {
|
|
124
|
+
heading: {
|
|
125
|
+
family: 'Playfair Display',
|
|
126
|
+
weights: [400, 700, 900],
|
|
127
|
+
fallback: 'serif',
|
|
128
|
+
},
|
|
129
|
+
body: {
|
|
130
|
+
family: 'IBM Plex Sans',
|
|
131
|
+
weights: [300, 400, 600],
|
|
132
|
+
fallback: 'sans-serif',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
// ... more theme config
|
|
137
|
+
};
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 2. Create Content Configuration
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
// src/config/content.ts
|
|
144
|
+
import { SiteContent } from 'simple-site-framework';
|
|
145
|
+
|
|
146
|
+
export const myContent: SiteContent = {
|
|
147
|
+
metadata: {
|
|
148
|
+
siteName: 'My Company',
|
|
149
|
+
siteUrl: 'https://example.com',
|
|
150
|
+
// ... more metadata
|
|
151
|
+
},
|
|
152
|
+
hero: {
|
|
153
|
+
headline: {
|
|
154
|
+
fr: 'Bienvenue',
|
|
155
|
+
en: 'Welcome',
|
|
156
|
+
},
|
|
157
|
+
// ... more hero content
|
|
158
|
+
},
|
|
159
|
+
// ... more content sections
|
|
160
|
+
};
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### 3. Create Navigation Configuration
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
// src/config/navigation.ts
|
|
167
|
+
import { NavigationConfig } from 'simple-site-framework';
|
|
168
|
+
|
|
169
|
+
export const myNavigation: NavigationConfig = {
|
|
170
|
+
header: {
|
|
171
|
+
logo: {
|
|
172
|
+
image: '/logo.png',
|
|
173
|
+
imageAlt: {
|
|
174
|
+
fr: 'Mon Entreprise',
|
|
175
|
+
en: 'My Company',
|
|
176
|
+
},
|
|
177
|
+
href: '/',
|
|
178
|
+
width: 1674, // Actual image width (for Next.js optimization)
|
|
179
|
+
height: 613, // Actual image height (for Next.js optimization)
|
|
180
|
+
displayHeight: 48, // Rendered height in header (defaults to 48px)
|
|
181
|
+
},
|
|
182
|
+
mainNav: [
|
|
183
|
+
// ... nav items
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
// ... more navigation config
|
|
187
|
+
};
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 4. Use Components in Your Pages
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
// src/app/[locale]/page.tsx
|
|
194
|
+
import { HeroSection, ServicesSection, ContactSection } from 'simple-site-framework';
|
|
195
|
+
import { myContent } from '@/config/content';
|
|
196
|
+
|
|
197
|
+
export default function HomePage({ params }: { params: { locale: string } }) {
|
|
198
|
+
return (
|
|
199
|
+
<>
|
|
200
|
+
<HeroSection
|
|
201
|
+
content={myContent.hero}
|
|
202
|
+
locale={params.locale}
|
|
203
|
+
animations={{ headline: 'fadeInUp', cta: 'fadeInUp' }}
|
|
204
|
+
stickyCtaAfterScroll={true}
|
|
205
|
+
/>
|
|
206
|
+
<ServicesSection content={myContent.services} locale={params.locale} />
|
|
207
|
+
<ContactSection
|
|
208
|
+
locale={params.locale}
|
|
209
|
+
content={myContent.contact}
|
|
210
|
+
formConfig={{
|
|
211
|
+
enabled: true,
|
|
212
|
+
fields: ['name', 'email', 'phone', 'subject', 'message'],
|
|
213
|
+
requiredFields: ['name', 'email', 'message']
|
|
214
|
+
}}
|
|
215
|
+
/>
|
|
216
|
+
</>
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Enhanced Component Examples
|
|
222
|
+
|
|
223
|
+
#### Button with Loading State
|
|
224
|
+
```typescript
|
|
225
|
+
import { Button } from 'simple-site-framework';
|
|
226
|
+
|
|
227
|
+
<Button
|
|
228
|
+
variant="filled"
|
|
229
|
+
size="lg"
|
|
230
|
+
loading={isSubmitting}
|
|
231
|
+
loadingText="Sending..."
|
|
232
|
+
success={isSuccess}
|
|
233
|
+
successText="Sent!"
|
|
234
|
+
icon={<Icons.Send />}
|
|
235
|
+
ripple
|
|
236
|
+
>
|
|
237
|
+
Submit
|
|
238
|
+
</Button>
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
#### Icon Usage
|
|
242
|
+
```typescript
|
|
243
|
+
import { Icon, Icons } from 'simple-site-framework';
|
|
244
|
+
|
|
245
|
+
// Type-safe icon by name
|
|
246
|
+
<Icon name="Mail" size={24} />
|
|
247
|
+
|
|
248
|
+
// Pre-configured preset
|
|
249
|
+
<Icons.Mail size={24} />
|
|
250
|
+
|
|
251
|
+
// With custom styling
|
|
252
|
+
<Icon name="Check" className="text-green-600" />
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### CodeBlock for Documentation
|
|
256
|
+
```typescript
|
|
257
|
+
import { CodeBlock } from 'simple-site-framework';
|
|
258
|
+
|
|
259
|
+
<CodeBlock
|
|
260
|
+
code={`const example = "Hello World";`}
|
|
261
|
+
language="typescript"
|
|
262
|
+
showLineNumbers
|
|
263
|
+
showCopy
|
|
264
|
+
/>
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### 5. Use Layout Components
|
|
268
|
+
|
|
269
|
+
```typescript
|
|
270
|
+
// src/app/[locale]/layout.tsx
|
|
271
|
+
import { Header, Footer } from 'simple-site-framework';
|
|
272
|
+
import { myNavigation } from '@/config/navigation';
|
|
273
|
+
|
|
274
|
+
export default function Layout({ children, params }: LayoutProps) {
|
|
275
|
+
return (
|
|
276
|
+
<html lang={params.locale}>
|
|
277
|
+
<body>
|
|
278
|
+
<Header config={myNavigation.header} locale={params.locale} />
|
|
279
|
+
<main>{children}</main>
|
|
280
|
+
<Footer config={myNavigation.footer} locale={params.locale} />
|
|
281
|
+
</body>
|
|
282
|
+
</html>
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## Available Components (35+)
|
|
288
|
+
|
|
289
|
+
### Layout Components
|
|
290
|
+
- **Header** - Responsive header with mobile menu, navigation, and language switcher
|
|
291
|
+
- **Footer** - Multi-column footer with links, social media, and copyright
|
|
292
|
+
- **LanguageSelector** - Auto-adapting language selector (text toggle for 2 languages, dropdown for 3+)
|
|
293
|
+
- **PageLayout** - Standard page wrapper with consistent spacing
|
|
294
|
+
- **ServicePageLayout** - Specialized layout for service detail pages
|
|
295
|
+
- **LazySection** - Wrapper for lazy-loading sections with intersection observer
|
|
296
|
+
|
|
297
|
+
### Section Components
|
|
298
|
+
- **HeroSection** - Advanced hero with animations, video backgrounds, parallax, sticky CTA, trust badges
|
|
299
|
+
- **AboutSection** - About section with rich content, timeline, team grid
|
|
300
|
+
- **ServicesSection** - Services grid with hover effects and filtering
|
|
301
|
+
- **FeaturesGrid** - Feature showcase with icons and descriptions
|
|
302
|
+
- **TestimonialsSection** - Customer testimonials with ratings and rotation
|
|
303
|
+
- **FAQSection** - Searchable, expandable FAQ accordion
|
|
304
|
+
- **TeamSection** - Team member grid with bios and social links
|
|
305
|
+
- **ContactSection** - Full contact form with validation, multiple locations, maps, office hours
|
|
306
|
+
- **CTASection** - Call-to-action sections with variants (banner, split, card)
|
|
307
|
+
- **WhyChooseUsSection** - Differentiators showcase
|
|
308
|
+
- **SecurePortalSection** - Secure portal CTA
|
|
309
|
+
- **PersonalTaxesSection** - Service-specific sections
|
|
310
|
+
- **RecruitingSection** - Recruitment CTA
|
|
311
|
+
- **PricingSection** - Pricing tables with feature comparison
|
|
312
|
+
- **StatsSection** - Statistics showcase with counter animations
|
|
313
|
+
- **LogosSection** - Client/partner logo grid
|
|
314
|
+
- **TimelineSection** - Company history or process timeline
|
|
315
|
+
- **ProcessSection** - Step-by-step process visualization
|
|
316
|
+
|
|
317
|
+
### UI Components
|
|
318
|
+
- **Button** - Enhanced button with loading/success states, icons, ripple effects, 6 variants, 5 sizes, tooltips
|
|
319
|
+
- **Card** - Flexible card container with variants and hover effects
|
|
320
|
+
- **Badge** - Status and category badges
|
|
321
|
+
- **Icon** - Type-safe Lucide icon wrapper with 1000+ icons
|
|
322
|
+
- **Input** - Form input with validation states
|
|
323
|
+
- **Textarea** - Multi-line text input
|
|
324
|
+
- **Select** - Dropdown select (Radix UI)
|
|
325
|
+
- **Checkbox** - Checkbox input
|
|
326
|
+
- **Radio** - Radio button input
|
|
327
|
+
- **FormField** - Form field wrapper with label and error display
|
|
328
|
+
- **Breadcrumb** - Breadcrumb navigation
|
|
329
|
+
- **Tabs** - Tab navigation (Radix UI)
|
|
330
|
+
- **Accordion** - Collapsible content (Radix UI)
|
|
331
|
+
- **Dialog** - Modal dialogs (Radix UI)
|
|
332
|
+
- **Tooltip** - Hover tooltips (Radix UI)
|
|
333
|
+
- **Toast** - Toast notifications
|
|
334
|
+
|
|
335
|
+
### Development & Documentation Tools
|
|
336
|
+
- **StyleGuide** - Comprehensive interactive style guide displaying all brand elements
|
|
337
|
+
- **CodeBlock** - Syntax-highlighted code blocks with copy button
|
|
338
|
+
- **ComponentDemo** - Live component preview with code examples
|
|
339
|
+
- **HeadScripts** - Inject scripts and meta tags into document head
|
|
340
|
+
- **BodyEndScripts** - Inject scripts before closing body tag
|
|
341
|
+
|
|
342
|
+
## Using the Style Guide
|
|
343
|
+
|
|
344
|
+
The framework includes a `StyleGuide` component that displays all your brand elements in one place - perfect for development reference, design reviews, and stakeholder presentations.
|
|
345
|
+
|
|
346
|
+
### Create a Style Guide Page
|
|
347
|
+
|
|
348
|
+
```typescript
|
|
349
|
+
// src/app/[locale]/style-guide/page.tsx
|
|
350
|
+
import { type Locale, StyleGuide } from 'simple-site-framework/components';
|
|
351
|
+
import { myTheme } from '@/config/theme';
|
|
352
|
+
import { myNavigation } from '@/config/navigation';
|
|
353
|
+
|
|
354
|
+
export default async function StyleGuidePage({
|
|
355
|
+
params,
|
|
356
|
+
}: {
|
|
357
|
+
params: Promise<{ locale: Locale }>;
|
|
358
|
+
}) {
|
|
359
|
+
const { locale } = await params;
|
|
360
|
+
|
|
361
|
+
return (
|
|
362
|
+
<StyleGuide
|
|
363
|
+
locale={locale}
|
|
364
|
+
theme={myTheme}
|
|
365
|
+
logo={myNavigation.header.logo}
|
|
366
|
+
favicon="/favicon.ico"
|
|
367
|
+
/>
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
Visit `/style-guide` to see:
|
|
373
|
+
- Logo and favicon with dimensions
|
|
374
|
+
- Complete color palette with hex codes
|
|
375
|
+
- Brand gradients
|
|
376
|
+
- Typography (all heading levels, body text, font families)
|
|
377
|
+
- Button variants and sizes
|
|
378
|
+
- Form components and states
|
|
379
|
+
- UI components (cards, breadcrumbs)
|
|
380
|
+
- Spacing scale reference
|
|
381
|
+
|
|
382
|
+
**Tip**: Add `robots: 'noindex, nofollow'` to metadata to hide from search engines.
|
|
383
|
+
|
|
384
|
+
## Internationalization (i18n)
|
|
385
|
+
|
|
386
|
+
The framework provides a flexible internationalization system that supports any number of languages. Projects configure their own locale preferences and the framework handles routing, detection, and SEO.
|
|
387
|
+
|
|
388
|
+
### Quick Start
|
|
389
|
+
|
|
390
|
+
1. **Create i18n configuration:**
|
|
391
|
+
|
|
392
|
+
```typescript
|
|
393
|
+
// src/config/i18n.ts
|
|
394
|
+
import type { I18nConfig } from 'simple-site-framework/lib/i18n';
|
|
395
|
+
|
|
396
|
+
export const i18nConfig: I18nConfig = {
|
|
397
|
+
locales: ['en', 'fr', 'es'],
|
|
398
|
+
defaultLocale: 'en',
|
|
399
|
+
localePrefix: 'as-needed',
|
|
400
|
+
localeDetection: true,
|
|
401
|
+
localeNames: {
|
|
402
|
+
en: 'English',
|
|
403
|
+
fr: 'Français',
|
|
404
|
+
es: 'Español',
|
|
405
|
+
},
|
|
406
|
+
};
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
2. **Create middleware:**
|
|
410
|
+
|
|
411
|
+
```typescript
|
|
412
|
+
// src/middleware.ts
|
|
413
|
+
import { createI18nMiddleware } from 'simple-site-framework/lib/i18n';
|
|
414
|
+
import { i18nConfig } from './src/config/i18n';
|
|
415
|
+
|
|
416
|
+
export default createI18nMiddleware(i18nConfig);
|
|
417
|
+
|
|
418
|
+
export const config = {
|
|
419
|
+
matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)'],
|
|
420
|
+
};
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
3. **Initialize in layout:**
|
|
424
|
+
|
|
425
|
+
```typescript
|
|
426
|
+
// src/app/[locale]/layout.tsx
|
|
427
|
+
import { setI18nConfig } from 'simple-site-framework/lib/i18n';
|
|
428
|
+
import { i18nConfig } from '../../config/i18n';
|
|
429
|
+
|
|
430
|
+
setI18nConfig(i18nConfig);
|
|
431
|
+
|
|
432
|
+
export default function Layout({ children, params }) {
|
|
433
|
+
// ... rest of layout
|
|
434
|
+
}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
### Key Features
|
|
438
|
+
|
|
439
|
+
- **3 Locale Prefix Modes**: 'always' (all URLs prefixed), 'as-needed' (only non-default prefixed), 'never' (no prefixes)
|
|
440
|
+
- **Automatic Detection**: Browser language detection with cookie persistence
|
|
441
|
+
- **Auto-Adapting Selector**: Text toggle for 2 languages, dropdown for 3+
|
|
442
|
+
- **SEO Optimized**: Automatic hreflang tags, canonical URLs, OpenGraph locale tags
|
|
443
|
+
- **RTL Support**: Built-in right-to-left language support
|
|
444
|
+
- **Slug Translation**: Custom URL translations per language
|
|
445
|
+
- **Formatters**: Locale-aware date, number, currency, and relative time formatting
|
|
446
|
+
|
|
447
|
+
### Documentation
|
|
448
|
+
|
|
449
|
+
- **[Configuration Reference](./docs/i18n/CONFIGURATION.md)** - Complete I18nConfig options
|
|
450
|
+
- **[Migration Guide](./docs/i18n/MIGRATION.md)** - Upgrade from hardcoded system
|
|
451
|
+
- **[Examples](./docs/i18n/EXAMPLES.md)** - Common i18n scenarios
|
|
452
|
+
- **[SEO Guide](./docs/i18n/SEO.md)** - Multilingual SEO best practices
|
|
453
|
+
|
|
454
|
+
## Utilities
|
|
455
|
+
|
|
456
|
+
### Content
|
|
457
|
+
- `getLocalizedString(localizedString, locale)` - Get localized text
|
|
458
|
+
- `getNavigationString(localizedString, locale)` - Get navigation string
|
|
459
|
+
- `replaceVariables(text, variables)` - Replace placeholders in strings
|
|
460
|
+
|
|
461
|
+
### i18n
|
|
462
|
+
- `formatDate(date, locale, options)` - Locale-aware date formatting
|
|
463
|
+
- `formatNumber(value, locale, options)` - Locale-aware number formatting
|
|
464
|
+
- `formatCurrency(amount, locale, currency)` - Locale-aware currency formatting
|
|
465
|
+
- `formatRelativeTime(value, unit, locale)` - Locale-aware relative time
|
|
466
|
+
- `getTextDirection(locale)` - Get 'ltr' or 'rtl' for locale
|
|
467
|
+
- `validateLocale(locale)` - Check if locale is supported
|
|
468
|
+
- `translateSlug(path, fromLocale, toLocale)` - Translate URL slugs
|
|
469
|
+
|
|
470
|
+
### Theme
|
|
471
|
+
- `generateThemeCSS(theme)` - Generate CSS variables from theme
|
|
472
|
+
- `cn(...classes)` - Merge Tailwind classes with clsx
|
|
473
|
+
|
|
474
|
+
## Configuration Schemas
|
|
475
|
+
|
|
476
|
+
The framework exports TypeScript types for all configurations:
|
|
477
|
+
|
|
478
|
+
- `ThemeConfig` - Theme configuration
|
|
479
|
+
- `SiteContent` - Content configuration
|
|
480
|
+
- `NavigationConfig` - Navigation configuration
|
|
481
|
+
- `LocalizedString` - Bilingual string type
|
|
482
|
+
- And many more...
|
|
483
|
+
|
|
484
|
+
## CLI Tools
|
|
485
|
+
|
|
486
|
+
The framework includes two CLI commands for project management:
|
|
487
|
+
|
|
488
|
+
### create-simple-site
|
|
489
|
+
Scaffold a new Next.js project with the framework pre-configured:
|
|
490
|
+
|
|
491
|
+
```bash
|
|
492
|
+
npx @zoyth/simple-site-framework create my-site
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
### simple-site
|
|
496
|
+
Framework management commands:
|
|
497
|
+
|
|
498
|
+
```bash
|
|
499
|
+
# Run migrations when upgrading versions
|
|
500
|
+
npx simple-site migrate
|
|
501
|
+
|
|
502
|
+
# Dry run to see what would change
|
|
503
|
+
npx simple-site migrate --dry-run
|
|
504
|
+
|
|
505
|
+
# Migrate to specific version
|
|
506
|
+
npx simple-site migrate --to=0.2.0
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
## Key Features
|
|
510
|
+
|
|
511
|
+
### Enhanced Button Component
|
|
512
|
+
- **6 variants**: outlined, filled, text, ghost, link, destructive
|
|
513
|
+
- **5 sizes**: xs, sm, md, lg, xl
|
|
514
|
+
- **States**: loading, success, disabled
|
|
515
|
+
- **Icons**: left, right, or icon-only buttons
|
|
516
|
+
- **Effects**: ripple animation, hover states
|
|
517
|
+
- **Tooltips**: automatic disabled state tooltips
|
|
518
|
+
|
|
519
|
+
### Advanced HeroSection
|
|
520
|
+
- **Animations**: fadeInUp, fadeIn, slideInLeft, with stagger
|
|
521
|
+
- **Backgrounds**: gradient, video, parallax effects
|
|
522
|
+
- **Interactive**: sticky CTA that appears on scroll
|
|
523
|
+
- **Trust signals**: badge display, social proof
|
|
524
|
+
- **Scroll indicator**: animated scroll hint
|
|
525
|
+
|
|
526
|
+
### Full-Featured ContactSection
|
|
527
|
+
- **Dynamic forms**: configurable fields with validation
|
|
528
|
+
- **Multiple locations**: office cards with maps, hours, directions
|
|
529
|
+
- **Spam protection**: honeypot and rate limiting
|
|
530
|
+
- **File uploads**: optional attachment support
|
|
531
|
+
- **Integrations**: ready for email/CRM services
|
|
532
|
+
|
|
533
|
+
### Type-Safe Icons
|
|
534
|
+
- **1000+ icons**: from Lucide React library
|
|
535
|
+
- **Type safety**: autocomplete for all icon names
|
|
536
|
+
- **Presets**: common icons pre-configured
|
|
537
|
+
- **Consistent**: automatic sizing and styling
|
|
538
|
+
|
|
539
|
+
## Documentation
|
|
540
|
+
|
|
541
|
+
### Getting Started
|
|
542
|
+
- **[QUICKSTART.md](./QUICKSTART.md)** - Complete step-by-step guide to building a new site
|
|
543
|
+
- **[TROUBLESHOOTING.md](./TROUBLESHOOTING.md)** - Solutions for common setup issues
|
|
544
|
+
|
|
545
|
+
### Internationalization
|
|
546
|
+
- **[docs/i18n/CONFIGURATION.md](./docs/i18n/CONFIGURATION.md)** - Complete i18n configuration reference
|
|
547
|
+
- **[docs/i18n/MIGRATION.md](./docs/i18n/MIGRATION.md)** - Migration guide from hardcoded system
|
|
548
|
+
- **[docs/i18n/EXAMPLES.md](./docs/i18n/EXAMPLES.md)** - Common i18n scenarios and patterns
|
|
549
|
+
- **[docs/i18n/SEO.md](./docs/i18n/SEO.md)** - Multilingual SEO best practices
|
|
550
|
+
|
|
551
|
+
### Accessibility
|
|
552
|
+
- **[docs/accessibility/overview.md](./docs/accessibility/overview.md)** - Accessibility commitment and quick start
|
|
553
|
+
- **[docs/accessibility/wcag-compliance.md](./docs/accessibility/wcag-compliance.md)** - WCAG 2.1 AA compliance checklist
|
|
554
|
+
- **[docs/accessibility/keyboard-navigation.md](./docs/accessibility/keyboard-navigation.md)** - Keyboard patterns and focus management
|
|
555
|
+
- **[docs/accessibility/screen-readers.md](./docs/accessibility/screen-readers.md)** - Screen reader testing and ARIA guidelines
|
|
556
|
+
- **[docs/accessibility/common-patterns.md](./docs/accessibility/common-patterns.md)** - Reusable accessibility patterns
|
|
557
|
+
|
|
558
|
+
### Migration & Upgrading
|
|
559
|
+
- **[docs/migration/overview.md](./docs/migration/overview.md)** - Version support, upgrade process, deprecation policy
|
|
560
|
+
- **[docs/migration/changelog.md](./docs/migration/changelog.md)** - Complete version history
|
|
561
|
+
|
|
562
|
+
### Architecture & Planning
|
|
563
|
+
- **[docs/architecture/decisions.md](./docs/architecture/decisions.md)** - Architecture Decision Records (ADRs)
|
|
564
|
+
- **[docs/ROADMAP.md](./docs/ROADMAP.md)** - Product roadmap and component inventory
|
|
565
|
+
|
|
566
|
+
## License
|
|
567
|
+
|
|
568
|
+
MIT
|
|
569
|
+
|
|
570
|
+
## Author
|
|
571
|
+
|
|
572
|
+
François Lane
|