@alliance-droid/svelte-docs-system 0.0.1

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.
Files changed (134) hide show
  1. package/COMPONENTS.md +365 -0
  2. package/COVERAGE_REPORT.md +663 -0
  3. package/README.md +42 -0
  4. package/SEARCH_VERIFICATION.md +229 -0
  5. package/TEST_SUMMARY.md +344 -0
  6. package/bin/init.js +821 -0
  7. package/docs/E2E_TESTS.md +354 -0
  8. package/docs/TESTING.md +754 -0
  9. package/docs/de/index.md +41 -0
  10. package/docs/en/COMPONENTS.md +443 -0
  11. package/docs/en/api/examples.md +100 -0
  12. package/docs/en/api/overview.md +69 -0
  13. package/docs/en/components/index.md +622 -0
  14. package/docs/en/config/navigation.md +505 -0
  15. package/docs/en/config/theme-and-colors.md +395 -0
  16. package/docs/en/getting-started/integration.md +406 -0
  17. package/docs/en/guides/common-setups.md +651 -0
  18. package/docs/en/index.md +243 -0
  19. package/docs/en/markdown.md +102 -0
  20. package/docs/en/routing.md +64 -0
  21. package/docs/en/setup.md +52 -0
  22. package/docs/en/troubleshooting.md +704 -0
  23. package/docs/es/index.md +41 -0
  24. package/docs/fr/index.md +41 -0
  25. package/docs/ja/index.md +41 -0
  26. package/package.json +40 -0
  27. package/pagefind.toml +8 -0
  28. package/postcss.config.js +5 -0
  29. package/src/app.css +119 -0
  30. package/src/app.d.ts +13 -0
  31. package/src/app.html +11 -0
  32. package/src/lib/assets/favicon.svg +1 -0
  33. package/src/lib/components/APITable.svelte +120 -0
  34. package/src/lib/components/APITable.test.ts +153 -0
  35. package/src/lib/components/Breadcrumbs.svelte +85 -0
  36. package/src/lib/components/Breadcrumbs.test.ts +148 -0
  37. package/src/lib/components/Callout.svelte +60 -0
  38. package/src/lib/components/Callout.test.ts +100 -0
  39. package/src/lib/components/CodeBlock.svelte +68 -0
  40. package/src/lib/components/CodeBlock.test.ts +133 -0
  41. package/src/lib/components/DocLayout.svelte +84 -0
  42. package/src/lib/components/Footer.svelte +78 -0
  43. package/src/lib/components/Image.svelte +100 -0
  44. package/src/lib/components/Image.test.ts +163 -0
  45. package/src/lib/components/Navbar.svelte +141 -0
  46. package/src/lib/components/Search.svelte +248 -0
  47. package/src/lib/components/Sidebar.svelte +110 -0
  48. package/src/lib/components/Tabs.svelte +48 -0
  49. package/src/lib/components/Tabs.test.ts +102 -0
  50. package/src/lib/config.test.ts +140 -0
  51. package/src/lib/config.ts +179 -0
  52. package/src/lib/configIntegration.test.ts +272 -0
  53. package/src/lib/configLoader.ts +231 -0
  54. package/src/lib/configParser.test.ts +217 -0
  55. package/src/lib/configParser.ts +234 -0
  56. package/src/lib/index.ts +34 -0
  57. package/src/lib/integration.test.ts +426 -0
  58. package/src/lib/navigationBuilder.test.ts +338 -0
  59. package/src/lib/navigationBuilder.ts +268 -0
  60. package/src/lib/performance.test.ts +369 -0
  61. package/src/lib/routing.test.ts +202 -0
  62. package/src/lib/routing.ts +127 -0
  63. package/src/lib/search-functionality.test.ts +493 -0
  64. package/src/lib/stores/i18n.test.ts +180 -0
  65. package/src/lib/stores/i18n.ts +143 -0
  66. package/src/lib/stores/nav.ts +36 -0
  67. package/src/lib/stores/search.test.ts +140 -0
  68. package/src/lib/stores/search.ts +162 -0
  69. package/src/lib/stores/theme.ts +59 -0
  70. package/src/lib/stores/version.test.ts +139 -0
  71. package/src/lib/stores/version.ts +111 -0
  72. package/src/lib/themeCustomization.test.ts +223 -0
  73. package/src/lib/themeCustomization.ts +212 -0
  74. package/src/lib/utils/highlight.test.ts +136 -0
  75. package/src/lib/utils/highlight.ts +100 -0
  76. package/src/lib/utils/index.ts +7 -0
  77. package/src/lib/utils/markdown.test.ts +357 -0
  78. package/src/lib/utils/markdown.ts +77 -0
  79. package/src/routes/+layout.server.ts +1 -0
  80. package/src/routes/+layout.svelte +28 -0
  81. package/src/routes/+page.svelte +165 -0
  82. package/static/robots.txt +3 -0
  83. package/svelte.config.js +18 -0
  84. package/tailwind.config.ts +55 -0
  85. package/template-starter/.github/workflows/build.yml +40 -0
  86. package/template-starter/.github/workflows/deploy-github-pages.yml +47 -0
  87. package/template-starter/.github/workflows/deploy-netlify.yml +41 -0
  88. package/template-starter/.github/workflows/deploy-vercel.yml +64 -0
  89. package/template-starter/NPM-PACKAGE-SETUP.md +233 -0
  90. package/template-starter/README.md +320 -0
  91. package/template-starter/docs/_config.json +39 -0
  92. package/template-starter/docs/api/components.md +257 -0
  93. package/template-starter/docs/api/overview.md +169 -0
  94. package/template-starter/docs/guides/configuration.md +145 -0
  95. package/template-starter/docs/guides/github-pages-deployment.md +254 -0
  96. package/template-starter/docs/guides/netlify-deployment.md +159 -0
  97. package/template-starter/docs/guides/vercel-deployment.md +131 -0
  98. package/template-starter/docs/index.md +49 -0
  99. package/template-starter/docs/setup.md +149 -0
  100. package/template-starter/package.json +31 -0
  101. package/template-starter/pagefind.toml +3 -0
  102. package/template-starter/postcss.config.js +5 -0
  103. package/template-starter/src/app.css +34 -0
  104. package/template-starter/src/app.d.ts +13 -0
  105. package/template-starter/src/app.html +11 -0
  106. package/template-starter/src/lib/components/APITable.svelte +120 -0
  107. package/template-starter/src/lib/components/APITable.test.ts +19 -0
  108. package/template-starter/src/lib/components/Breadcrumbs.svelte +85 -0
  109. package/template-starter/src/lib/components/Breadcrumbs.test.ts +19 -0
  110. package/template-starter/src/lib/components/Callout.svelte +60 -0
  111. package/template-starter/src/lib/components/Callout.test.ts +16 -0
  112. package/template-starter/src/lib/components/CodeBlock.svelte +68 -0
  113. package/template-starter/src/lib/components/CodeBlock.test.ts +12 -0
  114. package/template-starter/src/lib/components/DocLayout.svelte +84 -0
  115. package/template-starter/src/lib/components/Footer.svelte +78 -0
  116. package/template-starter/src/lib/components/Image.svelte +100 -0
  117. package/template-starter/src/lib/components/Image.test.ts +15 -0
  118. package/template-starter/src/lib/components/Navbar.svelte +141 -0
  119. package/template-starter/src/lib/components/Search.svelte +248 -0
  120. package/template-starter/src/lib/components/Sidebar.svelte +110 -0
  121. package/template-starter/src/lib/components/Tabs.svelte +48 -0
  122. package/template-starter/src/lib/components/Tabs.test.ts +17 -0
  123. package/template-starter/src/lib/index.ts +15 -0
  124. package/template-starter/src/routes/+layout.svelte +28 -0
  125. package/template-starter/src/routes/+page.svelte +92 -0
  126. package/template-starter/svelte.config.js +17 -0
  127. package/template-starter/tailwind.config.ts +17 -0
  128. package/template-starter/tsconfig.json +13 -0
  129. package/template-starter/vite.config.ts +6 -0
  130. package/tests/e2e/example.spec.ts +345 -0
  131. package/tsconfig.json +20 -0
  132. package/vite.config.ts +6 -0
  133. package/vitest.config.ts +34 -0
  134. package/vitest.setup.ts +21 -0
package/COMPONENTS.md ADDED
@@ -0,0 +1,365 @@
1
+ # SvelteKit Theme Components - Documentation
2
+
3
+ ## Overview
4
+
5
+ Task #90 has been completed successfully. The SvelteKit documentation system now includes a full set of professional theme components built with Svelte 5, Tailwind CSS, and the Claude Code aesthetic.
6
+
7
+ **Status:** ✅ Complete (8/8 checklist items)
8
+ **Repository:** ~/clawd-shared/code/svelte-docs-system
9
+ **Tech Stack:** SvelteKit 5, Svelte 5 Runes, Tailwind CSS 4, TypeScript
10
+
11
+ ---
12
+
13
+ ## Components Built
14
+
15
+ ### 1. DocLayout.svelte
16
+ **Purpose:** Main wrapper component that orchestrates all theme components
17
+
18
+ **Features:**
19
+ - Coordinates Navbar, Sidebar, Footer, and main content area
20
+ - Manages responsive layout (stacking on mobile, side-by-side on desktop)
21
+ - Tracks current route for active nav highlighting
22
+ - Supports customizable title, logo, navigation sections, and copyright
23
+ - Full dark mode integration
24
+
25
+ **Props:**
26
+ ```typescript
27
+ {
28
+ title?: string; // Page title (e.g., "Documentation")
29
+ logo?: string | null; // Logo image URL
30
+ sections?: NavSection[]; // Navigation sections
31
+ copyright?: string; // Footer copyright text
32
+ footerLinks?: { label: string; href: string }[];
33
+ children: any; // Page content
34
+ }
35
+ ```
36
+
37
+ ---
38
+
39
+ ### 2. Navbar.svelte
40
+ **Purpose:** Fixed header with navigation and controls
41
+
42
+ **Features:**
43
+ - Sticky positioning at top of viewport
44
+ - Logo/brand name click handler for navigation
45
+ - Mobile hamburger menu button (toggles sidebar)
46
+ - Language selector dropdown
47
+ - Version selector dropdown
48
+ - Dark mode toggle with sun/moon icons
49
+ - Responsive: hamburger menu on mobile, full controls on desktop
50
+ - Smooth transitions and hover effects
51
+
52
+ **Props:**
53
+ ```typescript
54
+ {
55
+ title?: string; // Brand/title text
56
+ logo?: string | null; // Logo image URL
57
+ onLogoClick?: () => void; // Logo click handler
58
+ }
59
+ ```
60
+
61
+ ---
62
+
63
+ ### 3. Sidebar.svelte
64
+ **Purpose:** Responsive navigation sidebar with nested items
65
+
66
+ **Features:**
67
+ - Expandable/collapsible on mobile (overlay with backdrop)
68
+ - Auto-hides on desktop or when navigating
69
+ - Active page indication with blue accent color
70
+ - Support for nested navigation items
71
+ - Section grouping with titles
72
+ - Custom icons per item (optional)
73
+ - Smooth slide-in animation for mobile
74
+ - Scrollable overflow on tall navigation
75
+
76
+ **Props:**
77
+ ```typescript
78
+ {
79
+ sections?: NavSection[]; // Navigation sections
80
+ currentPath?: string; // Current route for active state
81
+ onNavigate?: (path: string) => void; // Navigation callback
82
+ }
83
+ ```
84
+
85
+ **Structure:**
86
+ ```typescript
87
+ interface NavSection {
88
+ title: string;
89
+ items: NavItem[];
90
+ }
91
+
92
+ interface NavItem {
93
+ label: string;
94
+ href?: string;
95
+ children?: NavItem[]; // Nested items
96
+ icon?: string;
97
+ }
98
+ ```
99
+
100
+ ---
101
+
102
+ ### 4. Footer.svelte
103
+ **Purpose:** Multi-column footer with links and information
104
+
105
+ **Features:**
106
+ - Three-column layout (About, Resources, Connect)
107
+ - About section with project description
108
+ - Configurable resource links
109
+ - Social media buttons (GitHub, Twitter)
110
+ - Copyright notice
111
+ - Responsive grid (stacks on mobile)
112
+ - Dark mode styling
113
+
114
+ **Props:**
115
+ ```typescript
116
+ {
117
+ copyright?: string; // Copyright text
118
+ links?: { label: string; href: string }[]; // Footer links
119
+ }
120
+ ```
121
+
122
+ ---
123
+
124
+ ## Stores (State Management)
125
+
126
+ ### Theme Store (src/lib/stores/theme.ts)
127
+ **Purpose:** Manage light/dark mode theme globally
128
+
129
+ **Features:**
130
+ - Svelte writable store for reactive theme changes
131
+ - Automatic localStorage persistence
132
+ - System preference detection (respects `prefers-color-scheme`)
133
+ - Methods: `set(theme)`, `toggle()`
134
+ - Applies `dark` class to document root for Tailwind dark mode
135
+
136
+ **Usage:**
137
+ ```typescript
138
+ import { theme } from '$lib/stores/theme';
139
+
140
+ // Subscribe to changes
141
+ let isDark = $derived($theme === 'dark');
142
+
143
+ // Toggle theme
144
+ theme.toggle();
145
+
146
+ // Set specific theme
147
+ theme.set('dark');
148
+ ```
149
+
150
+ ---
151
+
152
+ ### Navigation Store (src/lib/stores/nav.ts)
153
+ **Purpose:** Manage navigation structure and sidebar state
154
+
155
+ **Features:**
156
+ - Navigation configuration store
157
+ - Sidebar open/closed state
158
+ - Type-safe navigation structures
159
+ - Methods: `setNav()`, `updateNav()`
160
+
161
+ **Usage:**
162
+ ```typescript
163
+ import { nav, sidebarOpen } from '$lib/stores/nav';
164
+
165
+ // Subscribe to sidebar state
166
+ let open = $derived($sidebarOpen);
167
+
168
+ // Toggle sidebar
169
+ sidebarOpen.set(!$sidebarOpen);
170
+
171
+ // Update navigation
172
+ nav.setNav({
173
+ title: 'My Docs',
174
+ sections: [...]
175
+ });
176
+ ```
177
+
178
+ ---
179
+
180
+ ## Styling
181
+
182
+ ### Tailwind Configuration (tailwind.config.ts)
183
+
184
+ **Claude Code Color Palette:**
185
+
186
+ **Light Mode:**
187
+ - `claude-bg`: #FFFFFF
188
+ - `claude-bg-secondary`: #F7F6F3
189
+ - `claude-text`: #1A1A1A
190
+ - `claude-text-secondary`: #565656
191
+ - `claude-border`: #ECECEC
192
+ - `claude-accent`: #0066CC
193
+ - `claude-accent-hover`: #0052A3
194
+
195
+ **Dark Mode:**
196
+ - `claude-dark-bg`: #1A1A1A
197
+ - `claude-dark-bg-secondary`: #2D2D2D
198
+ - `claude-dark-text`: #FFFFFF
199
+ - `claude-dark-text-secondary`: #B0B0B0
200
+ - `claude-dark-border`: #3A3A3A
201
+ - `claude-dark-accent`: #4D94FF
202
+ - `claude-dark-accent-hover`: #6BA3FF
203
+
204
+ ### Global CSS (src/app.css)
205
+
206
+ Provides:
207
+ - Tailwind directives (@tailwind)
208
+ - Base layer with CSS custom properties
209
+ - Component layer with utility classes
210
+ - Doc content typography styling
211
+ - All heading, paragraph, link, code, table, blockquote styles
212
+
213
+ ---
214
+
215
+ ## Demo Pages
216
+
217
+ A complete working example is available at `/demo` route:
218
+
219
+ - **`/demo`** - Home page with feature showcase
220
+ - **`/demo/installation`** - Installation instructions
221
+ - **`/demo/quick-start`** - Quick start guide
222
+ - **`/demo/components/theme`** - Component reference
223
+
224
+ The demo uses the DocLayout wrapper and demonstrates all features.
225
+
226
+ ---
227
+
228
+ ## File Structure
229
+
230
+ ```
231
+ src/
232
+ ├── app.css # Global Tailwind CSS
233
+ ├── routes/
234
+ │ ├── +layout.svelte # Main layout with theme initialization
235
+ │ ├── +page.svelte # Home page
236
+ │ └── demo/
237
+ │ ├── +layout.svelte # Demo layout with DocLayout
238
+ │ ├── +page.svelte # Demo home
239
+ │ ├── installation/
240
+ │ │ └── +page.svelte
241
+ │ └── quick-start/
242
+ │ └── +page.svelte
243
+ ├── lib/
244
+ │ ├── components/
245
+ │ │ ├── DocLayout.svelte # Main theme wrapper
246
+ │ │ ├── Navbar.svelte # Header component
247
+ │ │ ├── Sidebar.svelte # Navigation sidebar
248
+ │ │ ├── Footer.svelte # Footer component
249
+ │ │ ├── Callout.svelte # Doc component
250
+ │ │ ├── CodeBlock.svelte # Doc component
251
+ │ │ ├── Tabs.svelte # Doc component
252
+ │ │ ├── Image.svelte # Doc component
253
+ │ │ ├── APITable.svelte # Doc component
254
+ │ │ └── Breadcrumbs.svelte # Doc component
255
+ │ ├── stores/
256
+ │ │ ├── theme.ts # Dark mode store
257
+ │ │ └── nav.ts # Navigation store
258
+ │ └── index.ts # Component exports
259
+ ├── tailwind.config.ts # Tailwind configuration
260
+ ├── postcss.config.js # PostCSS configuration
261
+ └── tsconfig.json # TypeScript configuration
262
+ ```
263
+
264
+ ---
265
+
266
+ ## Usage Example
267
+
268
+ ### Basic Setup
269
+
270
+ ```svelte
271
+ <script lang="ts">
272
+ import DocLayout from '$lib/components/DocLayout.svelte';
273
+ import type { NavSection } from '$lib/stores/nav';
274
+
275
+ const sections: NavSection[] = [
276
+ {
277
+ title: 'Getting Started',
278
+ items: [
279
+ { label: 'Introduction', href: '/docs' },
280
+ { label: 'Installation', href: '/docs/install' },
281
+ ],
282
+ },
283
+ ];
284
+
285
+ let { children } = $props();
286
+ </script>
287
+
288
+ <DocLayout
289
+ title="My Documentation"
290
+ logo={null}
291
+ {sections}
292
+ copyright="© 2026 My Project"
293
+ >
294
+ {@render children()}
295
+ </DocLayout>
296
+ ```
297
+
298
+ ---
299
+
300
+ ## Testing & Verification
301
+
302
+ ### Build Status
303
+ ✅ `npm run check` - Zero errors, zero warnings
304
+ ✅ `npm run build` - Successful production build
305
+ ✅ `npm run dev` - Dev server running and responding
306
+
307
+ ### Features Tested
308
+ ✅ Components render correctly
309
+ ✅ Dark mode toggle works (localStorage persistence)
310
+ ✅ Responsive layout (mobile sidebar overlay, desktop side-by-side)
311
+ ✅ Navigation active state highlighting
312
+ ✅ Tailwind styling applied correctly
313
+ ✅ TypeScript compilation without errors
314
+
315
+ ---
316
+
317
+ ## Color Palette Reference
318
+
319
+ The Claude Code aesthetic uses a professional, clean color scheme:
320
+
321
+ **Accent Colors:**
322
+ - Primary Blue: #0066CC (light), #4D94FF (dark)
323
+ - Hover Blue: #0052A3 (light), #6BA3FF (dark)
324
+
325
+ **Neutral Colors:**
326
+ - White: #FFFFFF (light), #1A1A1A (dark)
327
+ - Gray: #565656 (light), #B0B0B0 (dark)
328
+ - Border: #ECECEC (light), #3A3A3A (dark)
329
+ - Background: #F7F6F3 (light), #2D2D2D (dark)
330
+
331
+ ---
332
+
333
+ ## Next Steps
334
+
335
+ 1. **Extend Components:**
336
+ - Add more doc components (Callout variants, API blocks, etc.)
337
+ - Create component showcase pages
338
+
339
+ 2. **Search Implementation:**
340
+ - Integrate Pagefind for full-text search
341
+ - Add search UI component
342
+
343
+ 3. **Multi-version Support:**
344
+ - Implement version switching in navbar
345
+ - Version-specific routing
346
+
347
+ 4. **Internationalization:**
348
+ - Implement multi-language support
349
+ - Language-specific docs folder structure
350
+
351
+ 5. **Testing:**
352
+ - Add unit tests for components
353
+ - Add E2E tests for navigation flows
354
+
355
+ ---
356
+
357
+ ## Summary
358
+
359
+ This implementation provides a production-ready foundation for the SvelteKit documentation system. All theme components follow the Claude Code aesthetic, feature complete dark mode support, responsive design, and are fully type-safe with TypeScript.
360
+
361
+ The system is modular, allowing individual components to be imported and used independently while maintaining consistency across the documentation site.
362
+
363
+ **Build Date:** February 4, 2026
364
+ **Status:** ✅ Complete
365
+ **Checklist:** 8/8 items completed