@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
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
# Button Component
|
|
2
|
+
|
|
3
|
+
Enhanced button component with loading states, success feedback, icons, ripple effects, and comprehensive variants.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { Button } from '@zoyth/simple-site-framework'
|
|
9
|
+
import type { ButtonProps } from '@zoyth/simple-site-framework'
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Props
|
|
13
|
+
|
|
14
|
+
| Prop | Type | Default | Description |
|
|
15
|
+
|------|------|---------|-------------|
|
|
16
|
+
| `variant` | `'outlined' \| 'filled' \| 'text' \| 'ghost' \| 'link' \| 'destructive'` | `'outlined'` | Visual style variant |
|
|
17
|
+
| `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Button size |
|
|
18
|
+
| `loading` | `boolean` | `false` | Shows loading spinner, disables button |
|
|
19
|
+
| `loadingText` | `string` | - | Optional text to show while loading |
|
|
20
|
+
| `success` | `boolean` | `false` | Shows success checkmark |
|
|
21
|
+
| `successText` | `string` | - | Optional text to show on success |
|
|
22
|
+
| `successDuration` | `number` | `2000` | How long to show success state (ms) |
|
|
23
|
+
| `icon` | `ReactNode` | - | Icon to display with button text |
|
|
24
|
+
| `iconPosition` | `'left' \| 'right'` | `'left'` | Position of icon relative to text |
|
|
25
|
+
| `iconOnly` | `boolean` | `false` | Display only icon, no text |
|
|
26
|
+
| `disabledTooltip` | `string` | - | Tooltip shown when button is disabled |
|
|
27
|
+
| `ripple` | `boolean` | `true` | Enable ripple effect on click |
|
|
28
|
+
| `className` | `string` | - | Additional CSS classes |
|
|
29
|
+
| `children` | `ReactNode` | - | Button content |
|
|
30
|
+
|
|
31
|
+
All standard HTML button props are also supported (onClick, disabled, type, etc.).
|
|
32
|
+
|
|
33
|
+
## Variants
|
|
34
|
+
|
|
35
|
+
### outlined (default)
|
|
36
|
+
Border with transparent background, fills on hover.
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
<Button variant="outlined">Click me</Button>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### filled
|
|
43
|
+
Solid background color.
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
<Button variant="filled">Submit</Button>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### text
|
|
50
|
+
No border or background, text only.
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<Button variant="text">Cancel</Button>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### ghost
|
|
57
|
+
Subtle hover state, minimal styling.
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
<Button variant="ghost">Options</Button>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### link
|
|
64
|
+
Styled like a hyperlink.
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
<Button variant="link">Learn more</Button>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### destructive
|
|
71
|
+
Red color scheme for dangerous actions.
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
<Button variant="destructive">Delete</Button>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Sizes
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
<Button size="xs">Extra Small</Button>
|
|
81
|
+
<Button size="sm">Small</Button>
|
|
82
|
+
<Button size="md">Medium (default)</Button>
|
|
83
|
+
<Button size="lg">Large</Button>
|
|
84
|
+
<Button size="xl">Extra Large</Button>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Loading State
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
const [isLoading, setIsLoading] = useState(false)
|
|
91
|
+
|
|
92
|
+
<Button
|
|
93
|
+
loading={isLoading}
|
|
94
|
+
loadingText="Submitting..."
|
|
95
|
+
onClick={async () => {
|
|
96
|
+
setIsLoading(true)
|
|
97
|
+
await submitForm()
|
|
98
|
+
setIsLoading(false)
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
Submit
|
|
102
|
+
</Button>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Success State
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
const [isSuccess, setIsSuccess] = useState(false)
|
|
109
|
+
|
|
110
|
+
<Button
|
|
111
|
+
success={isSuccess}
|
|
112
|
+
successText="Saved!"
|
|
113
|
+
successDuration={3000}
|
|
114
|
+
onClick={async () => {
|
|
115
|
+
await saveData()
|
|
116
|
+
setIsSuccess(true)
|
|
117
|
+
setTimeout(() => setIsSuccess(false), 3000)
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
Save
|
|
121
|
+
</Button>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## With Icons
|
|
125
|
+
|
|
126
|
+
```tsx
|
|
127
|
+
import { Icons } from '@zoyth/simple-site-framework'
|
|
128
|
+
|
|
129
|
+
// Icon on left (default)
|
|
130
|
+
<Button icon={<Icons.Mail />}>
|
|
131
|
+
Send Email
|
|
132
|
+
</Button>
|
|
133
|
+
|
|
134
|
+
// Icon on right
|
|
135
|
+
<Button icon={<Icons.ArrowRight />} iconPosition="right">
|
|
136
|
+
Continue
|
|
137
|
+
</Button>
|
|
138
|
+
|
|
139
|
+
// Icon only
|
|
140
|
+
<Button
|
|
141
|
+
icon={<Icons.Search />}
|
|
142
|
+
iconOnly
|
|
143
|
+
aria-label="Search"
|
|
144
|
+
/>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Disabled with Tooltip
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
<Button
|
|
151
|
+
disabled
|
|
152
|
+
disabledTooltip="Complete the form first"
|
|
153
|
+
>
|
|
154
|
+
Submit
|
|
155
|
+
</Button>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Ripple Effect
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
// Ripple enabled (default)
|
|
162
|
+
<Button ripple>Click for ripple</Button>
|
|
163
|
+
|
|
164
|
+
// Ripple disabled
|
|
165
|
+
<Button ripple={false}>No ripple</Button>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Complete Example
|
|
169
|
+
|
|
170
|
+
```tsx
|
|
171
|
+
import { useState } from 'react'
|
|
172
|
+
import { Button, Icons } from '@zoyth/simple-site-framework'
|
|
173
|
+
|
|
174
|
+
function ContactForm() {
|
|
175
|
+
const [isLoading, setIsLoading] = useState(false)
|
|
176
|
+
const [isSuccess, setIsSuccess] = useState(false)
|
|
177
|
+
|
|
178
|
+
const handleSubmit = async () => {
|
|
179
|
+
setIsLoading(true)
|
|
180
|
+
|
|
181
|
+
try {
|
|
182
|
+
await submitToAPI()
|
|
183
|
+
setIsSuccess(true)
|
|
184
|
+
setTimeout(() => setIsSuccess(false), 2000)
|
|
185
|
+
} finally {
|
|
186
|
+
setIsLoading(false)
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return (
|
|
191
|
+
<Button
|
|
192
|
+
variant="filled"
|
|
193
|
+
size="lg"
|
|
194
|
+
loading={isLoading}
|
|
195
|
+
loadingText="Sending..."
|
|
196
|
+
success={isSuccess}
|
|
197
|
+
successText="Sent!"
|
|
198
|
+
icon={<Icons.Send />}
|
|
199
|
+
onClick={handleSubmit}
|
|
200
|
+
ripple
|
|
201
|
+
>
|
|
202
|
+
Send Message
|
|
203
|
+
</Button>
|
|
204
|
+
)
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Accessibility
|
|
209
|
+
|
|
210
|
+
- Automatically disabled during loading/success states
|
|
211
|
+
- `aria-label` required for `iconOnly` buttons
|
|
212
|
+
- Disabled state tooltip helps explain why button is disabled
|
|
213
|
+
- Keyboard accessible (Enter/Space to activate)
|
|
214
|
+
- Focus visible with outline
|
|
215
|
+
|
|
216
|
+
## Best Practices
|
|
217
|
+
|
|
218
|
+
1. **Use appropriate variants**
|
|
219
|
+
- `filled` for primary actions
|
|
220
|
+
- `outlined` for secondary actions
|
|
221
|
+
- `destructive` for delete/remove actions
|
|
222
|
+
- `text` or `ghost` for tertiary actions
|
|
223
|
+
|
|
224
|
+
2. **Loading states**
|
|
225
|
+
- Always show loading state for async operations
|
|
226
|
+
- Provide meaningful `loadingText` for clarity
|
|
227
|
+
|
|
228
|
+
3. **Success feedback**
|
|
229
|
+
- Use success state for positive confirmation
|
|
230
|
+
- Keep `successDuration` brief (2-3 seconds)
|
|
231
|
+
|
|
232
|
+
4. **Icon usage**
|
|
233
|
+
- Use icons to reinforce button meaning
|
|
234
|
+
- Always provide `aria-label` for icon-only buttons
|
|
235
|
+
- Keep icons consistent with action (e.g., Mail for email, Trash for delete)
|
|
236
|
+
|
|
237
|
+
5. **Size selection**
|
|
238
|
+
- Use `lg` or `xl` for hero CTAs
|
|
239
|
+
- Use `md` for most form buttons
|
|
240
|
+
- Use `sm` or `xs` for compact UIs or inline actions
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# HeroSection Component
|
|
2
|
+
|
|
3
|
+
Advanced hero section with animations, video backgrounds, parallax effects, sticky CTA, and trust badges.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { HeroSection } from '@zoyth/simple-site-framework'
|
|
9
|
+
import type { HeroSectionProps, HeroAnimations } from '@zoyth/simple-site-framework'
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Props
|
|
13
|
+
|
|
14
|
+
| Prop | Type | Default | Description |
|
|
15
|
+
|------|------|---------|-------------|
|
|
16
|
+
| `locale` | `'fr' \| 'en'` | **required** | Current language |
|
|
17
|
+
| `content` | `HeroContent` | **required** | Hero content configuration |
|
|
18
|
+
| `animations` | `HeroAnimations` | - | Animation configuration |
|
|
19
|
+
| `stickyCtaAfterScroll` | `boolean` | `false` | Show sticky CTA button after scrolling |
|
|
20
|
+
| `trustBadges` | `Badge[]` | - | Trust badges to display |
|
|
21
|
+
| `backgroundEffect` | `'none' \| 'particles' \| 'gradient-shift' \| 'mesh'` | `'none'` | Background visual effect |
|
|
22
|
+
| `className` | `string` | - | Additional CSS classes |
|
|
23
|
+
|
|
24
|
+
## HeroContent Type
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
interface HeroContent {
|
|
28
|
+
headline: LocalizedString
|
|
29
|
+
subheadline?: LocalizedString
|
|
30
|
+
cta?: {
|
|
31
|
+
primary?: {
|
|
32
|
+
text: LocalizedString
|
|
33
|
+
href: string
|
|
34
|
+
variant?: ButtonProps['variant']
|
|
35
|
+
}
|
|
36
|
+
secondary?: {
|
|
37
|
+
text: LocalizedString
|
|
38
|
+
href: string
|
|
39
|
+
variant?: ButtonProps['variant']
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
backgroundImage?: string
|
|
43
|
+
backgroundVideo?: string
|
|
44
|
+
overlayGradient?: {
|
|
45
|
+
from: string // CSS color value
|
|
46
|
+
to: string // CSS color value
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## HeroAnimations Type
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
interface HeroAnimations {
|
|
55
|
+
headline?: 'fadeInUp' | 'fadeIn' | 'slideInLeft' | 'none'
|
|
56
|
+
cta?: 'fadeInUp' | 'fadeIn' | 'none'
|
|
57
|
+
stagger?: number // Delay between elements in ms
|
|
58
|
+
scrollIndicator?: boolean // Show animated scroll hint
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Basic Usage
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import { HeroSection } from '@zoyth/simple-site-framework'
|
|
66
|
+
|
|
67
|
+
const heroContent = {
|
|
68
|
+
headline: {
|
|
69
|
+
fr: 'Bienvenue sur notre site',
|
|
70
|
+
en: 'Welcome to our site'
|
|
71
|
+
},
|
|
72
|
+
subheadline: {
|
|
73
|
+
fr: 'Solutions professionnelles pour votre entreprise',
|
|
74
|
+
en: 'Professional solutions for your business'
|
|
75
|
+
},
|
|
76
|
+
cta: {
|
|
77
|
+
primary: {
|
|
78
|
+
text: { fr: 'Commencer', en: 'Get Started' },
|
|
79
|
+
href: '/contact'
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
<HeroSection
|
|
85
|
+
locale="en"
|
|
86
|
+
content={heroContent}
|
|
87
|
+
/>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## With Animations
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
<HeroSection
|
|
94
|
+
locale="en"
|
|
95
|
+
content={heroContent}
|
|
96
|
+
animations={{
|
|
97
|
+
headline: 'fadeInUp',
|
|
98
|
+
cta: 'fadeInUp',
|
|
99
|
+
stagger: 200,
|
|
100
|
+
scrollIndicator: true
|
|
101
|
+
}}
|
|
102
|
+
/>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## With Sticky CTA
|
|
106
|
+
|
|
107
|
+
The sticky CTA appears as a floating button after user scrolls past the hero section.
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
<HeroSection
|
|
111
|
+
locale="en"
|
|
112
|
+
content={heroContent}
|
|
113
|
+
stickyCtaAfterScroll={true}
|
|
114
|
+
/>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## With Trust Badges
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
import { Badge } from '@zoyth/simple-site-framework'
|
|
121
|
+
|
|
122
|
+
const trustBadges: Badge[] = [
|
|
123
|
+
{
|
|
124
|
+
name: 'Google Partner',
|
|
125
|
+
image: '/badges/google-partner.png',
|
|
126
|
+
variant: 'color'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'ISO 9001',
|
|
130
|
+
image: '/badges/iso-9001.png',
|
|
131
|
+
variant: 'grayscale'
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
|
|
135
|
+
<HeroSection
|
|
136
|
+
locale="en"
|
|
137
|
+
content={heroContent}
|
|
138
|
+
trustBadges={trustBadges}
|
|
139
|
+
/>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## With Video Background
|
|
143
|
+
|
|
144
|
+
```tsx
|
|
145
|
+
const heroContent = {
|
|
146
|
+
headline: { fr: 'Innovation', en: 'Innovation' },
|
|
147
|
+
backgroundVideo: '/videos/hero-background.mp4',
|
|
148
|
+
overlayGradient: {
|
|
149
|
+
from: 'rgba(0, 0, 0, 0.6)',
|
|
150
|
+
to: 'rgba(0, 0, 0, 0.3)'
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
<HeroSection
|
|
155
|
+
locale="en"
|
|
156
|
+
content={heroContent}
|
|
157
|
+
/>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## With Background Effects
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
// Gradient animation
|
|
164
|
+
<HeroSection
|
|
165
|
+
locale="en"
|
|
166
|
+
content={heroContent}
|
|
167
|
+
backgroundEffect="gradient-shift"
|
|
168
|
+
/>
|
|
169
|
+
|
|
170
|
+
// Particle effect
|
|
171
|
+
<HeroSection
|
|
172
|
+
locale="en"
|
|
173
|
+
content={heroContent}
|
|
174
|
+
backgroundEffect="particles"
|
|
175
|
+
/>
|
|
176
|
+
|
|
177
|
+
// Mesh gradient
|
|
178
|
+
<HeroSection
|
|
179
|
+
locale="en"
|
|
180
|
+
content={heroContent}
|
|
181
|
+
backgroundEffect="mesh"
|
|
182
|
+
/>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Complete Example
|
|
186
|
+
|
|
187
|
+
```tsx
|
|
188
|
+
import { HeroSection } from '@zoyth/simple-site-framework'
|
|
189
|
+
|
|
190
|
+
const heroContent = {
|
|
191
|
+
headline: {
|
|
192
|
+
fr: 'Transformez votre entreprise',
|
|
193
|
+
en: 'Transform your business'
|
|
194
|
+
},
|
|
195
|
+
subheadline: {
|
|
196
|
+
fr: 'Solutions innovantes pour la croissance',
|
|
197
|
+
en: 'Innovative solutions for growth'
|
|
198
|
+
},
|
|
199
|
+
cta: {
|
|
200
|
+
primary: {
|
|
201
|
+
text: { fr: 'Démarrer gratuitement', en: 'Start free trial' },
|
|
202
|
+
href: '/signup',
|
|
203
|
+
variant: 'filled'
|
|
204
|
+
},
|
|
205
|
+
secondary: {
|
|
206
|
+
text: { fr: 'En savoir plus', en: 'Learn more' },
|
|
207
|
+
href: '/about',
|
|
208
|
+
variant: 'outlined'
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
backgroundImage: '/images/hero-bg.jpg',
|
|
212
|
+
overlayGradient: {
|
|
213
|
+
from: 'rgba(0, 0, 0, 0.7)',
|
|
214
|
+
to: 'rgba(0, 0, 0, 0.4)'
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const trustBadges = [
|
|
219
|
+
{ name: 'SOC 2', image: '/badges/soc2.png', variant: 'color' },
|
|
220
|
+
{ name: 'GDPR', image: '/badges/gdpr.png', variant: 'color' }
|
|
221
|
+
]
|
|
222
|
+
|
|
223
|
+
<HeroSection
|
|
224
|
+
locale="en"
|
|
225
|
+
content={heroContent}
|
|
226
|
+
animations={{
|
|
227
|
+
headline: 'fadeInUp',
|
|
228
|
+
cta: 'fadeInUp',
|
|
229
|
+
stagger: 150,
|
|
230
|
+
scrollIndicator: true
|
|
231
|
+
}}
|
|
232
|
+
stickyCtaAfterScroll={true}
|
|
233
|
+
trustBadges={trustBadges}
|
|
234
|
+
backgroundEffect="gradient-shift"
|
|
235
|
+
/>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## Animation Types
|
|
239
|
+
|
|
240
|
+
### fadeInUp
|
|
241
|
+
Elements fade in while moving upward. Best for vertical emphasis.
|
|
242
|
+
|
|
243
|
+
### fadeIn
|
|
244
|
+
Simple fade-in effect. Subtle and professional.
|
|
245
|
+
|
|
246
|
+
### slideInLeft
|
|
247
|
+
Elements slide in from the left. Good for directional flow.
|
|
248
|
+
|
|
249
|
+
### none
|
|
250
|
+
No animation. Instant display.
|
|
251
|
+
|
|
252
|
+
## Background Effects
|
|
253
|
+
|
|
254
|
+
### none (default)
|
|
255
|
+
Static background image or color.
|
|
256
|
+
|
|
257
|
+
### particles
|
|
258
|
+
Animated particle effect overlay. Adds movement and depth.
|
|
259
|
+
|
|
260
|
+
### gradient-shift
|
|
261
|
+
Animated gradient that shifts colors. Modern and dynamic.
|
|
262
|
+
|
|
263
|
+
### mesh
|
|
264
|
+
Mesh gradient background. Trendy and eye-catching.
|
|
265
|
+
|
|
266
|
+
## Accessibility
|
|
267
|
+
|
|
268
|
+
- Semantic HTML structure (h1 for headline)
|
|
269
|
+
- Proper heading hierarchy
|
|
270
|
+
- Video backgrounds respect `prefers-reduced-motion`
|
|
271
|
+
- Animations can be disabled via user preferences
|
|
272
|
+
- Focus visible on CTA buttons
|
|
273
|
+
- Scroll indicator has proper ARIA labels
|
|
274
|
+
|
|
275
|
+
## Best Practices
|
|
276
|
+
|
|
277
|
+
1. **Headlines**
|
|
278
|
+
- Keep concise (5-10 words)
|
|
279
|
+
- Focus on value proposition
|
|
280
|
+
- Use action-oriented language
|
|
281
|
+
|
|
282
|
+
2. **CTAs**
|
|
283
|
+
- Primary CTA should be most important action
|
|
284
|
+
- Use contrasting colors for visibility
|
|
285
|
+
- Action-oriented text ("Start", "Get", "Try")
|
|
286
|
+
|
|
287
|
+
3. **Animations**
|
|
288
|
+
- Use `fadeInUp` for professional sites
|
|
289
|
+
- Keep `stagger` between 100-200ms
|
|
290
|
+
- Enable `scrollIndicator` only on tall heroes
|
|
291
|
+
|
|
292
|
+
4. **Sticky CTA**
|
|
293
|
+
- Enable for long-scroll pages
|
|
294
|
+
- Ensure it doesn't obscure important content
|
|
295
|
+
- Use for primary conversion action
|
|
296
|
+
|
|
297
|
+
5. **Trust Badges**
|
|
298
|
+
- Limit to 3-5 most relevant badges
|
|
299
|
+
- Use high-quality images
|
|
300
|
+
- Ensure badges are recognizable
|
|
301
|
+
|
|
302
|
+
6. **Performance**
|
|
303
|
+
- Optimize background images (WebP format)
|
|
304
|
+
- Use video backgrounds sparingly
|
|
305
|
+
- Lazy-load video on mobile
|
|
306
|
+
- Consider removing effects on low-end devices
|