@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,449 @@
|
|
|
1
|
+
# Architectural Decision Records
|
|
2
|
+
|
|
3
|
+
This document records the key architectural decisions made for the Simple Site Framework.
|
|
4
|
+
|
|
5
|
+
## Decision Summary
|
|
6
|
+
|
|
7
|
+
| Decision | Choice | Status | Date |
|
|
8
|
+
|----------|--------|--------|------|
|
|
9
|
+
| Animation Library | Framer Motion | ✅ Implemented | 2024-01-31 |
|
|
10
|
+
| Form Libraries | Peer Dependencies | ✅ Implemented | 2024-01-31 |
|
|
11
|
+
| Headless UI | Radix UI | ✅ Implemented | 2024-01-31 |
|
|
12
|
+
| Icon Library | Lucide React | ✅ Implemented | 2024-01-31 |
|
|
13
|
+
| Bundle Strategy | Hybrid (Lean + Rich) | ✅ Implemented | 2024-01-31 |
|
|
14
|
+
| Package Structure | Monolithic | ✅ Implemented | 2024-01-31 |
|
|
15
|
+
| Testing Strategy | Selective → Comprehensive | 🚧 In Progress | 2024-01-31 |
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## ADR-001: Animation Library
|
|
20
|
+
|
|
21
|
+
**Status**: ✅ Implemented
|
|
22
|
+
**Date**: 2024-01-31
|
|
23
|
+
**Deciders**: François Lane
|
|
24
|
+
|
|
25
|
+
### Context
|
|
26
|
+
|
|
27
|
+
The framework needs animation capabilities for micro-interactions, page transitions, and engagement elements. Two main options were considered: Framer Motion and GSAP.
|
|
28
|
+
|
|
29
|
+
### Decision
|
|
30
|
+
|
|
31
|
+
**Chose: Framer Motion**
|
|
32
|
+
|
|
33
|
+
### Rationale
|
|
34
|
+
|
|
35
|
+
**Framer Motion Advantages:**
|
|
36
|
+
- React-first API with hooks and declarative syntax
|
|
37
|
+
- Simpler learning curve for React developers
|
|
38
|
+
- ~35kb gzipped (smaller footprint)
|
|
39
|
+
- Excellent documentation and community
|
|
40
|
+
- Built-in gesture support
|
|
41
|
+
- Animation variants pattern matches component pattern
|
|
42
|
+
- TypeScript support out of the box
|
|
43
|
+
|
|
44
|
+
**GSAP Considered:**
|
|
45
|
+
- More powerful for complex timeline animations
|
|
46
|
+
- Better performance for heavy animations
|
|
47
|
+
- Industry standard in animation
|
|
48
|
+
- ~50kb gzipped (larger bundle)
|
|
49
|
+
- Steeper learning curve
|
|
50
|
+
- License considerations for commercial use
|
|
51
|
+
- Imperative API less natural for React
|
|
52
|
+
|
|
53
|
+
### Consequences
|
|
54
|
+
|
|
55
|
+
**Positive:**
|
|
56
|
+
- Faster development with React-first API
|
|
57
|
+
- Smaller bundle size
|
|
58
|
+
- Better TypeScript integration
|
|
59
|
+
- useReducedMotion hook for accessibility
|
|
60
|
+
|
|
61
|
+
**Negative:**
|
|
62
|
+
- Less control for complex timeline animations
|
|
63
|
+
- May need GSAP for specific advanced cases
|
|
64
|
+
|
|
65
|
+
**Mitigations:**
|
|
66
|
+
- Keep animation library isolated in hooks
|
|
67
|
+
- Can add GSAP as optional peer dependency if needed
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## ADR-002: Form Libraries Strategy
|
|
72
|
+
|
|
73
|
+
**Status**: ✅ Implemented
|
|
74
|
+
**Date**: 2024-01-31
|
|
75
|
+
**Deciders**: François Lane
|
|
76
|
+
|
|
77
|
+
### Context
|
|
78
|
+
|
|
79
|
+
Forms are critical for conversion but add significant bundle weight. Need to decide if form libraries should be required dependencies or peer dependencies.
|
|
80
|
+
|
|
81
|
+
### Decision
|
|
82
|
+
|
|
83
|
+
**Chose: Peer Dependencies (Optional)**
|
|
84
|
+
|
|
85
|
+
React Hook Form and Zod are peer dependencies, not required.
|
|
86
|
+
|
|
87
|
+
### Rationale
|
|
88
|
+
|
|
89
|
+
**Benefits of Peer Dependency Approach:**
|
|
90
|
+
- Smaller base bundle for non-form use cases
|
|
91
|
+
- Flexibility for developers who prefer other solutions
|
|
92
|
+
- Tree-shaking works better
|
|
93
|
+
- No forced dependency upgrades
|
|
94
|
+
|
|
95
|
+
**Strong Guidance Provided:**
|
|
96
|
+
- Documentation strongly recommends React Hook Form + Zod
|
|
97
|
+
- Form components designed for RHF integration
|
|
98
|
+
- Examples use RHF + Zod throughout
|
|
99
|
+
- TypeScript types encourage correct usage
|
|
100
|
+
|
|
101
|
+
### Consequences
|
|
102
|
+
|
|
103
|
+
**Positive:**
|
|
104
|
+
- Framework stays lean
|
|
105
|
+
- Developers can choose alternatives
|
|
106
|
+
- Better separation of concerns
|
|
107
|
+
|
|
108
|
+
**Negative:**
|
|
109
|
+
- Extra setup step for forms
|
|
110
|
+
- Some developers might skip validation
|
|
111
|
+
- More testing combinations
|
|
112
|
+
|
|
113
|
+
**Mitigations:**
|
|
114
|
+
- Clear documentation on setup
|
|
115
|
+
- CLI tool can scaffold with RHF + Zod
|
|
116
|
+
- FormField component works with or without RHF
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## ADR-003: Headless UI Library
|
|
121
|
+
|
|
122
|
+
**Status**: ✅ Implemented
|
|
123
|
+
**Date**: 2024-01-31
|
|
124
|
+
**Deciders**: François Lane
|
|
125
|
+
|
|
126
|
+
### Context
|
|
127
|
+
|
|
128
|
+
Need accessible, unstyled UI primitives for complex components (modals, dropdowns, tabs, etc.). Three options considered:
|
|
129
|
+
|
|
130
|
+
1. Radix UI (20+ components)
|
|
131
|
+
2. Headless UI (8 components)
|
|
132
|
+
3. Build from scratch
|
|
133
|
+
|
|
134
|
+
### Decision
|
|
135
|
+
|
|
136
|
+
**Chose: Radix UI**
|
|
137
|
+
|
|
138
|
+
### Rationale
|
|
139
|
+
|
|
140
|
+
**Radix UI Advantages:**
|
|
141
|
+
- Most comprehensive component library (20+ primitives)
|
|
142
|
+
- Best-in-class accessibility
|
|
143
|
+
- Excellent documentation
|
|
144
|
+
- Active development and maintenance
|
|
145
|
+
- Unstyled by default (perfect for framework)
|
|
146
|
+
- Tree-shakeable architecture
|
|
147
|
+
- Strong TypeScript support
|
|
148
|
+
- Used by Shadcn/UI and other major projects
|
|
149
|
+
|
|
150
|
+
**Headless UI Considered:**
|
|
151
|
+
- Made by Tailwind Labs
|
|
152
|
+
- Good Tailwind integration
|
|
153
|
+
- Only 8 components (would need to build more)
|
|
154
|
+
- Less comprehensive
|
|
155
|
+
|
|
156
|
+
**Build from Scratch Considered:**
|
|
157
|
+
- Full control over API
|
|
158
|
+
- Smallest possible bundle
|
|
159
|
+
- Massive time investment
|
|
160
|
+
- Accessibility is extremely complex
|
|
161
|
+
- Ongoing maintenance burden
|
|
162
|
+
|
|
163
|
+
### Consequences
|
|
164
|
+
|
|
165
|
+
**Positive:**
|
|
166
|
+
- Production-ready accessible components
|
|
167
|
+
- Wide component coverage
|
|
168
|
+
- Active community and support
|
|
169
|
+
- Proven in production
|
|
170
|
+
|
|
171
|
+
**Negative:**
|
|
172
|
+
- Adds ~100kb total (tree-shakeable)
|
|
173
|
+
- External dependency to maintain
|
|
174
|
+
- Learning curve for API
|
|
175
|
+
|
|
176
|
+
**Mitigations:**
|
|
177
|
+
- Wrap Radix components in framework API
|
|
178
|
+
- Only use components we need (tree-shaking)
|
|
179
|
+
- Document component usage clearly
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## ADR-004: Icon Library Integration
|
|
184
|
+
|
|
185
|
+
**Status**: ✅ Implemented
|
|
186
|
+
**Date**: 2024-01-31
|
|
187
|
+
**Deciders**: François Lane
|
|
188
|
+
|
|
189
|
+
### Context
|
|
190
|
+
|
|
191
|
+
Icons are essential for UI but can bloat bundle. Options:
|
|
192
|
+
|
|
193
|
+
1. Bundle icon library (Lucide, Hero Icons)
|
|
194
|
+
2. No bundled icons (let developers choose)
|
|
195
|
+
3. Custom minimal set
|
|
196
|
+
|
|
197
|
+
### Decision
|
|
198
|
+
|
|
199
|
+
**Chose: Lucide React as Peer Dependency**
|
|
200
|
+
|
|
201
|
+
### Rationale
|
|
202
|
+
|
|
203
|
+
**Lucide React Advantages:**
|
|
204
|
+
- Modern, well-maintained fork of Feather Icons
|
|
205
|
+
- 1000+ icons available
|
|
206
|
+
- Tree-shakeable (~1kb per icon)
|
|
207
|
+
- Consistent design language
|
|
208
|
+
- React components, not SVG imports
|
|
209
|
+
- TypeScript support
|
|
210
|
+
- Active development
|
|
211
|
+
|
|
212
|
+
**Implementation:**
|
|
213
|
+
- Peer dependency (not required)
|
|
214
|
+
- Icon component wrapper for type safety
|
|
215
|
+
- Common presets exported (Icons.Check, Icons.Menu, etc.)
|
|
216
|
+
- Developers can use directly or via wrapper
|
|
217
|
+
|
|
218
|
+
### Consequences
|
|
219
|
+
|
|
220
|
+
**Positive:**
|
|
221
|
+
- Excellent DX with type-safe icon names
|
|
222
|
+
- Small bundle impact (only used icons)
|
|
223
|
+
- Comprehensive icon set
|
|
224
|
+
- Consistent style across framework
|
|
225
|
+
|
|
226
|
+
**Negative:**
|
|
227
|
+
- Peer dependency to manage
|
|
228
|
+
- Developers could use different icon libraries
|
|
229
|
+
|
|
230
|
+
**Mitigations:**
|
|
231
|
+
- Strong documentation recommending Lucide
|
|
232
|
+
- Icon wrapper provides consistent API
|
|
233
|
+
- Examples use Lucide throughout
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## ADR-005: Bundle Size Strategy
|
|
238
|
+
|
|
239
|
+
**Status**: ✅ Implemented
|
|
240
|
+
**Date**: 2024-01-31
|
|
241
|
+
**Deciders**: François Lane
|
|
242
|
+
|
|
243
|
+
### Context
|
|
244
|
+
|
|
245
|
+
Trade-off between developer experience (batteries-included) and bundle size (minimal).
|
|
246
|
+
|
|
247
|
+
### Decision
|
|
248
|
+
|
|
249
|
+
**Chose: Hybrid Approach**
|
|
250
|
+
|
|
251
|
+
- Core framework: Lean (~50kb)
|
|
252
|
+
- Components package: Includes UI dependencies (~150kb total)
|
|
253
|
+
- Clear separation and tree-shaking
|
|
254
|
+
|
|
255
|
+
### Rationale
|
|
256
|
+
|
|
257
|
+
**Hybrid Benefits:**
|
|
258
|
+
- Base framework stays small
|
|
259
|
+
- Components include what they need
|
|
260
|
+
- Tree-shaking removes unused code
|
|
261
|
+
- Good balance of DX and performance
|
|
262
|
+
|
|
263
|
+
**Bundle Breakdown:**
|
|
264
|
+
- Core utils: ~10kb
|
|
265
|
+
- Components (all): ~150kb
|
|
266
|
+
- Peer dependencies: ~150kb (if all used)
|
|
267
|
+
- **Typical real app**: ~100-200kb framework code
|
|
268
|
+
|
|
269
|
+
**Performance Budget:**
|
|
270
|
+
- No single component >10kb
|
|
271
|
+
- Total framework <300kb uncompressed
|
|
272
|
+
- Encourage code-splitting
|
|
273
|
+
|
|
274
|
+
### Consequences
|
|
275
|
+
|
|
276
|
+
**Positive:**
|
|
277
|
+
- Reasonable bundle size
|
|
278
|
+
- Great developer experience
|
|
279
|
+
- Tree-shaking works well
|
|
280
|
+
|
|
281
|
+
**Negative:**
|
|
282
|
+
- Not the absolute smallest possible
|
|
283
|
+
- Some unused code if not optimized
|
|
284
|
+
|
|
285
|
+
**Mitigations:**
|
|
286
|
+
- Document tree-shaking setup
|
|
287
|
+
- Provide bundle size analyzer
|
|
288
|
+
- LazySection for code-splitting
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## ADR-006: Package Structure
|
|
293
|
+
|
|
294
|
+
**Status**: ✅ Implemented
|
|
295
|
+
**Date**: 2024-01-31
|
|
296
|
+
**Deciders**: François Lane
|
|
297
|
+
|
|
298
|
+
### Context
|
|
299
|
+
|
|
300
|
+
Single monolithic package vs. multiple split packages.
|
|
301
|
+
|
|
302
|
+
### Decision
|
|
303
|
+
|
|
304
|
+
**Chose: Monolithic (for v0.x)**
|
|
305
|
+
|
|
306
|
+
Single `@zoyth/simple-site-framework` package with multiple entry points:
|
|
307
|
+
- Main: `@zoyth/simple-site-framework`
|
|
308
|
+
- Components: `@zoyth/simple-site-framework/components`
|
|
309
|
+
- Config: `@zoyth/simple-site-framework/config`
|
|
310
|
+
|
|
311
|
+
### Rationale
|
|
312
|
+
|
|
313
|
+
**Monolithic Benefits:**
|
|
314
|
+
- Simpler installation
|
|
315
|
+
- Single version to manage
|
|
316
|
+
- Easier to maintain
|
|
317
|
+
- Better for small-medium scale
|
|
318
|
+
|
|
319
|
+
**When to Split:**
|
|
320
|
+
- If package grows beyond 500kb
|
|
321
|
+
- If components become very specialized
|
|
322
|
+
- If different update cadences needed
|
|
323
|
+
- Likely in v1.0+
|
|
324
|
+
|
|
325
|
+
### Consequences
|
|
326
|
+
|
|
327
|
+
**Positive:**
|
|
328
|
+
- Simple `npm install`
|
|
329
|
+
- Single version number
|
|
330
|
+
- Easier dependency management
|
|
331
|
+
|
|
332
|
+
**Negative:**
|
|
333
|
+
- Install components you might not use
|
|
334
|
+
- Harder to have different release cycles
|
|
335
|
+
|
|
336
|
+
**Mitigations:**
|
|
337
|
+
- Good tree-shaking
|
|
338
|
+
- Clear entry points
|
|
339
|
+
- Can split later if needed
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## ADR-007: Testing Strategy
|
|
344
|
+
|
|
345
|
+
**Status**: 🚧 In Progress
|
|
346
|
+
**Date**: 2024-01-31
|
|
347
|
+
**Deciders**: François Lane
|
|
348
|
+
|
|
349
|
+
### Context
|
|
350
|
+
|
|
351
|
+
Balance between test coverage and development velocity.
|
|
352
|
+
|
|
353
|
+
### Decision
|
|
354
|
+
|
|
355
|
+
**Chose: Selective → Comprehensive**
|
|
356
|
+
|
|
357
|
+
Start with critical path tests, expand over time.
|
|
358
|
+
|
|
359
|
+
### Strategy
|
|
360
|
+
|
|
361
|
+
**Phase 1: Critical Components**
|
|
362
|
+
- Form validation logic
|
|
363
|
+
- Accessibility features
|
|
364
|
+
- Core utilities
|
|
365
|
+
- Breaking change prevention
|
|
366
|
+
|
|
367
|
+
**Phase 2: UI Components**
|
|
368
|
+
- Component rendering
|
|
369
|
+
- Prop variations
|
|
370
|
+
- Keyboard navigation
|
|
371
|
+
- Screen reader announcements
|
|
372
|
+
|
|
373
|
+
**Phase 3: Integration**
|
|
374
|
+
- Full page flows
|
|
375
|
+
- Form submissions
|
|
376
|
+
- Multi-component interactions
|
|
377
|
+
|
|
378
|
+
**Phase 4: Visual & E2E**
|
|
379
|
+
- Visual regression testing
|
|
380
|
+
- Cross-browser E2E tests
|
|
381
|
+
- Performance benchmarks
|
|
382
|
+
|
|
383
|
+
### Tools
|
|
384
|
+
|
|
385
|
+
- **Unit**: Vitest
|
|
386
|
+
- **Component**: React Testing Library
|
|
387
|
+
- **E2E**: Playwright (future)
|
|
388
|
+
- **Visual**: Chromatic (future)
|
|
389
|
+
|
|
390
|
+
### Consequences
|
|
391
|
+
|
|
392
|
+
**Positive:**
|
|
393
|
+
- Fast initial development
|
|
394
|
+
- Tests grow with framework
|
|
395
|
+
- Focus on what matters
|
|
396
|
+
|
|
397
|
+
**Negative:**
|
|
398
|
+
- Some bugs may slip through initially
|
|
399
|
+
- Need discipline to add tests
|
|
400
|
+
|
|
401
|
+
**Mitigations:**
|
|
402
|
+
- Required tests for critical components
|
|
403
|
+
- CI/CD checks
|
|
404
|
+
- Manual QA process
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## Implementation Status
|
|
409
|
+
|
|
410
|
+
### ✅ Completed Decisions
|
|
411
|
+
|
|
412
|
+
All major architectural decisions have been implemented:
|
|
413
|
+
|
|
414
|
+
1. **Framer Motion** - Integrated in all animated components
|
|
415
|
+
2. **Radix UI** - Used for Modal, Tabs, Select, Accordion, Dialog, Tooltip
|
|
416
|
+
3. **Lucide React** - Icon component wrapper created
|
|
417
|
+
4. **React Hook Form + Zod** - Peer dependencies, strong guidance provided
|
|
418
|
+
5. **Hybrid Bundle** - Core + components structure working well
|
|
419
|
+
6. **Monolithic Package** - Single package with multiple entry points
|
|
420
|
+
|
|
421
|
+
### 🚧 In Progress
|
|
422
|
+
|
|
423
|
+
1. **Testing** - Expanding test coverage incrementally
|
|
424
|
+
|
|
425
|
+
### Future Considerations
|
|
426
|
+
|
|
427
|
+
1. **Package splitting** - Monitor bundle size, split if needed in v1.0
|
|
428
|
+
2. **Additional animation** - May add GSAP for specific use cases
|
|
429
|
+
3. **More UI primitives** - As Radix releases new components
|
|
430
|
+
4. **Testing infrastructure** - E2E and visual regression when stable
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
## Revision History
|
|
435
|
+
|
|
436
|
+
| Date | Change | Author |
|
|
437
|
+
|------|--------|--------|
|
|
438
|
+
| 2024-01-31 | Initial ADR document created | François Lane |
|
|
439
|
+
| 2024-01-31 | All major decisions documented | François Lane |
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
## References
|
|
444
|
+
|
|
445
|
+
- [Framer Motion](https://www.framer.com/motion/)
|
|
446
|
+
- [Radix UI](https://www.radix-ui.com/)
|
|
447
|
+
- [Lucide React](https://lucide.dev/)
|
|
448
|
+
- [React Hook Form](https://react-hook-form.com/)
|
|
449
|
+
- [Zod](https://zod.dev/)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# AnalyticsTracker
|
|
2
|
+
|
|
3
|
+
Automatic page view and scroll tracking component.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { AnalyticsTracker } from '@zoyth/simple-site-framework/client';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Type:** Client Component
|
|
12
|
+
|
|
13
|
+
## Basic Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
// In root layout
|
|
17
|
+
<html>
|
|
18
|
+
<body>
|
|
19
|
+
<AnalyticsTracker />
|
|
20
|
+
{children}
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
Automatically tracks:
|
|
28
|
+
- Page views on route changes
|
|
29
|
+
- Scroll depth milestones (25%, 50%, 75%, 100%)
|
|
30
|
+
|
|
31
|
+
## Props
|
|
32
|
+
|
|
33
|
+
No props required - works automatically.
|
|
34
|
+
|
|
35
|
+
## Events Tracked
|
|
36
|
+
|
|
37
|
+
### Page View
|
|
38
|
+
```typescript
|
|
39
|
+
{
|
|
40
|
+
event: 'page_view',
|
|
41
|
+
page_path: '/about',
|
|
42
|
+
page_title: 'About Us'
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Scroll Depth
|
|
47
|
+
```typescript
|
|
48
|
+
{
|
|
49
|
+
event: 'scroll_depth',
|
|
50
|
+
scroll_percentage: 50,
|
|
51
|
+
page_path: '/about'
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## See Also
|
|
56
|
+
|
|
57
|
+
- [TrackedLink](./TrackedLink.md)
|
|
58
|
+
- [Analytics Setup Guide](../guides/analytics-setup.md)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# AnimatedCounter
|
|
2
|
+
|
|
3
|
+
Animated number counter component.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { AnimatedCounter } from '@zoyth/simple-site-framework/client';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Type:** Client Component
|
|
12
|
+
|
|
13
|
+
## Basic Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
<AnimatedCounter
|
|
17
|
+
value={10000}
|
|
18
|
+
duration={2000}
|
|
19
|
+
/>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Props
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Required | Description |
|
|
25
|
+
|------|------|----------|-------------|
|
|
26
|
+
| `value` | `number` | Yes | Target value |
|
|
27
|
+
| `duration` | `number` | No | Animation duration (ms) |
|
|
28
|
+
| `suffix` | `string` | No | Suffix (e.g., '+', '%') |
|
|
29
|
+
| `prefix` | `string` | No | Prefix (e.g., '$') |
|
|
30
|
+
| `decimals` | `number` | No | Decimal places |
|
|
31
|
+
| `className` | `string` | No | Custom classes |
|
|
32
|
+
|
|
33
|
+
## Examples
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
// With suffix
|
|
37
|
+
<AnimatedCounter value={10000} suffix="+" />
|
|
38
|
+
|
|
39
|
+
// Currency
|
|
40
|
+
<AnimatedCounter value={9999} prefix="$" decimals={2} />
|
|
41
|
+
|
|
42
|
+
// Percentage
|
|
43
|
+
<AnimatedCounter value={99.9} suffix="%" decimals={1} />
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## See Also
|
|
47
|
+
|
|
48
|
+
- [StatsSection](./StatsSection.md)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# AnimatedSection
|
|
2
|
+
|
|
3
|
+
Section with scroll-triggered animations.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { AnimatedSection } from '@zoyth/simple-site-framework/client';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Type:** Client Component
|
|
12
|
+
|
|
13
|
+
## Basic Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
<AnimatedSection animation="fade-up">
|
|
17
|
+
<div>Content that animates on scroll</div>
|
|
18
|
+
</AnimatedSection>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Required | Description |
|
|
24
|
+
|------|------|----------|-------------|
|
|
25
|
+
| `children` | `ReactNode` | Yes | Content to animate |
|
|
26
|
+
| `animation` | `AnimationType` | Yes | Animation type |
|
|
27
|
+
| `delay` | `number` | No | Animation delay (ms) |
|
|
28
|
+
| `duration` | `number` | No | Animation duration (ms) |
|
|
29
|
+
| `className` | `string` | No | Custom classes |
|
|
30
|
+
|
|
31
|
+
## Animation Types
|
|
32
|
+
|
|
33
|
+
- `fade-up` - Fade in from bottom
|
|
34
|
+
- `fade-down` - Fade in from top
|
|
35
|
+
- `fade-left` - Fade in from left
|
|
36
|
+
- `fade-right` - Fade in from right
|
|
37
|
+
- `zoom-in` - Scale up
|
|
38
|
+
- `zoom-out` - Scale down
|
|
39
|
+
|
|
40
|
+
## Examples
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
// Fade up with delay
|
|
44
|
+
<AnimatedSection animation="fade-up" delay={200}>
|
|
45
|
+
<HeroSection {...props} />
|
|
46
|
+
</AnimatedSection>
|
|
47
|
+
|
|
48
|
+
// Zoom in
|
|
49
|
+
<AnimatedSection animation="zoom-in">
|
|
50
|
+
<Card>...</Card>
|
|
51
|
+
</AnimatedSection>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## See Also
|
|
55
|
+
|
|
56
|
+
- [LazySection](./LazySection.md)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# BlogCard
|
|
2
|
+
|
|
3
|
+
Blog post preview card component.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { BlogCard } from '@zoyth/simple-site-framework';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Type:** Server Component
|
|
12
|
+
|
|
13
|
+
## Basic Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
<BlogCard
|
|
17
|
+
title="How to Build Fast Websites"
|
|
18
|
+
excerpt="Learn the best practices for building performant websites..."
|
|
19
|
+
author="John Doe"
|
|
20
|
+
date="2024-01-15"
|
|
21
|
+
image="/blog/fast-websites.jpg"
|
|
22
|
+
href="/blog/fast-websites"
|
|
23
|
+
/>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Props
|
|
27
|
+
|
|
28
|
+
| Prop | Type | Required | Description |
|
|
29
|
+
|------|------|----------|-------------|
|
|
30
|
+
| `title` | `string \| LocalizedString` | Yes | Post title |
|
|
31
|
+
| `excerpt` | `string \| LocalizedString` | Yes | Post excerpt |
|
|
32
|
+
| `author` | `string` | No | Author name |
|
|
33
|
+
| `date` | `string` | No | Publication date |
|
|
34
|
+
| `image` | `string` | No | Featured image |
|
|
35
|
+
| `href` | `string` | Yes | Post URL |
|
|
36
|
+
| `tags` | `string[]` | No | Post tags |
|
|
37
|
+
| `className` | `string` | No | Custom classes |
|
|
38
|
+
| `locale` | `string` | No | Current locale |
|
|
39
|
+
|
|
40
|
+
## See Also
|
|
41
|
+
|
|
42
|
+
- [Card](./ui/Card.md)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Checkbox
|
|
2
|
+
|
|
3
|
+
Checkbox input component.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { Checkbox } from '@zoyth/simple-site-framework';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Type:** Server Component
|
|
12
|
+
|
|
13
|
+
## Basic Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
<Checkbox
|
|
17
|
+
name="agree"
|
|
18
|
+
label="I agree to the terms"
|
|
19
|
+
/>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Props
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Required | Description |
|
|
25
|
+
|------|------|----------|-------------|
|
|
26
|
+
| `name` | `string` | Yes | Checkbox name |
|
|
27
|
+
| `label` | `string \| LocalizedString` | Yes | Checkbox label |
|
|
28
|
+
| `checked` | `boolean` | No | Checked state |
|
|
29
|
+
| `defaultChecked` | `boolean` | No | Default checked |
|
|
30
|
+
| `disabled` | `boolean` | No | Disable checkbox |
|
|
31
|
+
| `required` | `boolean` | No | Required field |
|
|
32
|
+
| `onChange` | `function` | No | Change handler |
|
|
33
|
+
| `className` | `string` | No | Custom classes |
|
|
34
|
+
|
|
35
|
+
## Examples
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
// Simple checkbox
|
|
39
|
+
<Checkbox name="subscribe" label="Subscribe to newsletter" />
|
|
40
|
+
|
|
41
|
+
// Required checkbox
|
|
42
|
+
<Checkbox name="terms" label="I agree to the terms and conditions" required />
|
|
43
|
+
|
|
44
|
+
// Controlled checkbox
|
|
45
|
+
<Checkbox
|
|
46
|
+
name="option"
|
|
47
|
+
label="Enable feature"
|
|
48
|
+
checked={isEnabled}
|
|
49
|
+
onChange={(e) => setIsEnabled(e.target.checked)}
|
|
50
|
+
/>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## See Also
|
|
54
|
+
|
|
55
|
+
- [Radio](./Radio.md)
|
|
56
|
+
- [FormField](./forms/FormField.md)
|