@alliance-droid/svelte-docs-system 0.0.2 → 0.1.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.
Files changed (185) hide show
  1. package/README.md +155 -23
  2. package/dist/components/APITable.svelte.d.ts +21 -0
  3. package/dist/components/Breadcrumbs.svelte.d.ts +14 -0
  4. package/dist/components/Callout.svelte.d.ts +15 -0
  5. package/dist/components/CodeBlock.svelte.d.ts +12 -0
  6. package/{src/lib → dist}/components/DocLayout.svelte +18 -6
  7. package/dist/components/DocLayout.svelte.d.ts +18 -0
  8. package/dist/components/DocsPage.svelte +39 -0
  9. package/dist/components/DocsPage.svelte.d.ts +8 -0
  10. package/dist/components/Documentation.svelte +639 -0
  11. package/dist/components/Footer.svelte.d.ts +10 -0
  12. package/dist/components/Image.svelte.d.ts +15 -0
  13. package/{src/lib → dist}/components/Navbar.svelte +4 -4
  14. package/dist/components/Navbar.svelte.d.ts +10 -0
  15. package/{src/lib → dist}/components/Search.svelte +2 -2
  16. package/dist/components/Search.svelte.d.ts +6 -0
  17. package/{template-starter/src/lib → dist}/components/Sidebar.svelte +2 -2
  18. package/dist/components/Sidebar.svelte.d.ts +9 -0
  19. package/dist/components/Tabs.svelte.d.ts +16 -0
  20. package/dist/config.d.ts +93 -0
  21. package/dist/config.js +89 -0
  22. package/dist/configLoader.d.ts +48 -0
  23. package/dist/configLoader.js +187 -0
  24. package/dist/configParser.d.ts +27 -0
  25. package/dist/configParser.js +208 -0
  26. package/{template-starter/src/lib/index.ts → dist/index.d.ts} +6 -7
  27. package/dist/index.js +18 -0
  28. package/dist/navigationBuilder.d.ts +64 -0
  29. package/dist/navigationBuilder.js +225 -0
  30. package/dist/plugin.d.ts +30 -0
  31. package/dist/plugin.js +172 -0
  32. package/dist/routing.d.ts +48 -0
  33. package/dist/routing.js +92 -0
  34. package/dist/stores/i18n.d.ts +20 -0
  35. package/dist/stores/i18n.js +119 -0
  36. package/dist/stores/nav.d.ts +20 -0
  37. package/dist/stores/nav.js +15 -0
  38. package/dist/stores/search.d.ts +49 -0
  39. package/dist/stores/search.js +127 -0
  40. package/dist/stores/theme.d.ts +7 -0
  41. package/dist/stores/theme.js +152 -0
  42. package/dist/stores/version.d.ts +18 -0
  43. package/dist/stores/version.js +93 -0
  44. package/dist/themeCustomization.d.ts +46 -0
  45. package/dist/themeCustomization.js +188 -0
  46. package/dist/utils/highlight.d.ts +13 -0
  47. package/dist/utils/highlight.js +83 -0
  48. package/dist/utils/index.d.ts +1 -0
  49. package/dist/utils/index.js +1 -0
  50. package/dist/utils/markdown.d.ts +40 -0
  51. package/dist/utils/markdown.js +165 -0
  52. package/package.json +44 -23
  53. package/COMPONENTS.md +0 -365
  54. package/COVERAGE_REPORT.md +0 -663
  55. package/SEARCH_VERIFICATION.md +0 -229
  56. package/TEST_SUMMARY.md +0 -344
  57. package/bin/init.js +0 -821
  58. package/docs/COMPONENT_LIBRARY_INTEGRATION_REPORT.md +0 -153
  59. package/docs/DARK_MODE_AUDIT_REPORT.md +0 -403
  60. package/docs/E2E_TESTS.md +0 -354
  61. package/docs/TESTING.md +0 -754
  62. package/docs/THEME_INHERITANCE.md +0 -192
  63. package/docs/de/index.md +0 -41
  64. package/docs/en/COMPONENTS.md +0 -443
  65. package/docs/en/api/examples.md +0 -100
  66. package/docs/en/api/overview.md +0 -69
  67. package/docs/en/components/index.md +0 -622
  68. package/docs/en/config/navigation.md +0 -505
  69. package/docs/en/config/theme-and-colors.md +0 -395
  70. package/docs/en/getting-started/integration.md +0 -406
  71. package/docs/en/guides/common-setups.md +0 -651
  72. package/docs/en/index.md +0 -243
  73. package/docs/en/markdown.md +0 -102
  74. package/docs/en/routing.md +0 -64
  75. package/docs/en/setup.md +0 -52
  76. package/docs/en/troubleshooting.md +0 -704
  77. package/docs/es/index.md +0 -41
  78. package/docs/fr/index.md +0 -41
  79. package/docs/ja/index.md +0 -41
  80. package/pagefind.toml +0 -8
  81. package/postcss.config.js +0 -5
  82. package/src/app.css +0 -119
  83. package/src/app.d.ts +0 -13
  84. package/src/app.html +0 -11
  85. package/src/lib/components/APITable.test.ts +0 -153
  86. package/src/lib/components/Breadcrumbs.test.ts +0 -148
  87. package/src/lib/components/Callout.test.ts +0 -100
  88. package/src/lib/components/CodeBlock.test.ts +0 -133
  89. package/src/lib/components/Image.test.ts +0 -163
  90. package/src/lib/components/Sidebar.svelte +0 -110
  91. package/src/lib/components/Tabs.test.ts +0 -102
  92. package/src/lib/config.test.ts +0 -140
  93. package/src/lib/config.ts +0 -179
  94. package/src/lib/configIntegration.test.ts +0 -272
  95. package/src/lib/configLoader.ts +0 -231
  96. package/src/lib/configParser.test.ts +0 -217
  97. package/src/lib/configParser.ts +0 -234
  98. package/src/lib/index.ts +0 -37
  99. package/src/lib/integration.test.ts +0 -426
  100. package/src/lib/navigationBuilder.test.ts +0 -338
  101. package/src/lib/navigationBuilder.ts +0 -268
  102. package/src/lib/performance.test.ts +0 -369
  103. package/src/lib/routing.test.ts +0 -202
  104. package/src/lib/routing.ts +0 -127
  105. package/src/lib/search-functionality.test.ts +0 -493
  106. package/src/lib/stores/i18n.test.ts +0 -180
  107. package/src/lib/stores/i18n.ts +0 -143
  108. package/src/lib/stores/nav.ts +0 -36
  109. package/src/lib/stores/search.test.ts +0 -140
  110. package/src/lib/stores/search.ts +0 -162
  111. package/src/lib/stores/theme.test.ts +0 -117
  112. package/src/lib/stores/theme.ts +0 -167
  113. package/src/lib/stores/version.test.ts +0 -139
  114. package/src/lib/stores/version.ts +0 -111
  115. package/src/lib/themeCustomization.test.ts +0 -223
  116. package/src/lib/themeCustomization.ts +0 -212
  117. package/src/lib/utils/highlight.test.ts +0 -136
  118. package/src/lib/utils/highlight.ts +0 -100
  119. package/src/lib/utils/index.ts +0 -7
  120. package/src/lib/utils/markdown.test.ts +0 -357
  121. package/src/lib/utils/markdown.ts +0 -77
  122. package/src/routes/+layout.server.ts +0 -1
  123. package/src/routes/+layout.svelte +0 -29
  124. package/src/routes/+page.svelte +0 -165
  125. package/src/routes/quote-demo/+page.svelte +0 -141
  126. package/static/robots.txt +0 -3
  127. package/svelte.config.js +0 -15
  128. package/tailwind.config.ts +0 -55
  129. package/template-starter/.github/workflows/build.yml +0 -40
  130. package/template-starter/.github/workflows/deploy-github-pages.yml +0 -47
  131. package/template-starter/.github/workflows/deploy-netlify.yml +0 -41
  132. package/template-starter/.github/workflows/deploy-vercel.yml +0 -64
  133. package/template-starter/NPM-PACKAGE-SETUP.md +0 -233
  134. package/template-starter/README.md +0 -320
  135. package/template-starter/docs/_config.json +0 -39
  136. package/template-starter/docs/api/components.md +0 -257
  137. package/template-starter/docs/api/overview.md +0 -169
  138. package/template-starter/docs/guides/configuration.md +0 -145
  139. package/template-starter/docs/guides/github-pages-deployment.md +0 -254
  140. package/template-starter/docs/guides/netlify-deployment.md +0 -159
  141. package/template-starter/docs/guides/vercel-deployment.md +0 -131
  142. package/template-starter/docs/index.md +0 -49
  143. package/template-starter/docs/setup.md +0 -149
  144. package/template-starter/package.json +0 -31
  145. package/template-starter/pagefind.toml +0 -3
  146. package/template-starter/postcss.config.js +0 -5
  147. package/template-starter/src/app.css +0 -34
  148. package/template-starter/src/app.d.ts +0 -13
  149. package/template-starter/src/app.html +0 -11
  150. package/template-starter/src/lib/components/APITable.svelte +0 -120
  151. package/template-starter/src/lib/components/APITable.test.ts +0 -96
  152. package/template-starter/src/lib/components/Breadcrumbs.svelte +0 -85
  153. package/template-starter/src/lib/components/Breadcrumbs.test.ts +0 -82
  154. package/template-starter/src/lib/components/Callout.svelte +0 -60
  155. package/template-starter/src/lib/components/Callout.test.ts +0 -91
  156. package/template-starter/src/lib/components/CodeBlock.svelte +0 -68
  157. package/template-starter/src/lib/components/CodeBlock.test.ts +0 -62
  158. package/template-starter/src/lib/components/DocLayout.svelte +0 -84
  159. package/template-starter/src/lib/components/Footer.svelte +0 -78
  160. package/template-starter/src/lib/components/Image.svelte +0 -100
  161. package/template-starter/src/lib/components/Image.test.ts +0 -81
  162. package/template-starter/src/lib/components/Navbar.svelte +0 -141
  163. package/template-starter/src/lib/components/Search.svelte +0 -248
  164. package/template-starter/src/lib/components/Tabs.svelte +0 -48
  165. package/template-starter/src/lib/components/Tabs.test.ts +0 -89
  166. package/template-starter/src/routes/+layout.svelte +0 -28
  167. package/template-starter/src/routes/+page.svelte +0 -92
  168. package/template-starter/svelte.config.js +0 -17
  169. package/template-starter/tailwind.config.ts +0 -17
  170. package/template-starter/tsconfig.json +0 -13
  171. package/template-starter/vite.config.ts +0 -6
  172. package/tests/e2e/example.spec.ts +0 -345
  173. package/tsconfig.json +0 -20
  174. package/vite.config.ts +0 -6
  175. package/vitest.config.ts +0 -33
  176. package/vitest.setup.ts +0 -21
  177. /package/{src/lib → dist}/assets/favicon.svg +0 -0
  178. /package/{src/lib → dist}/components/APITable.svelte +0 -0
  179. /package/{src/lib → dist}/components/Breadcrumbs.svelte +0 -0
  180. /package/{src/lib → dist}/components/Callout.svelte +0 -0
  181. /package/{src/lib → dist}/components/CodeBlock.svelte +0 -0
  182. /package/{src/lib → dist}/components/Footer.svelte +0 -0
  183. /package/{src/lib → dist}/components/Image.svelte +0 -0
  184. /package/{src/lib → dist}/components/Tabs.svelte +0 -0
  185. /package/{src/lib → dist}/svelte-component-library.d.ts +0 -0
package/docs/es/index.md DELETED
@@ -1,41 +0,0 @@
1
- ---
2
- title: Inicio de Documentación
3
- description: Bienvenido al Sistema de Documentación de SvelteKit
4
- author: Andrew
5
- date: 2026-02-05
6
- ---
7
-
8
- # Bienvenido al sistema de documentación
9
-
10
- Esta es la página de inicio de su sitio de documentación. Demuestra el sistema de enrutamiento de markdown en acción.
11
-
12
- ## Características
13
-
14
- - **Enrutamiento automático** desde archivos markdown
15
- - **Soporte de rutas anidadas** (organizar documentos en carpetas)
16
- - **Metadatos de frontmatter** (título, autor, fecha)
17
- - **Estilo profesional** listo para usar
18
- - **Fácil de personalizar** y extender
19
-
20
- ## Comenzar
21
-
22
- Consulte la [Guía de configuración](/docs/es/setup) para comenzar.
23
-
24
- ## Estructura del proyecto
25
-
26
- ```
27
- docs/
28
- ├── index.md (Este archivo)
29
- ├── setup.md (Guía de inicio)
30
- ├── routing.md (Cómo funciona el enrutamiento)
31
- ├── api/
32
- │ ├── overview.md (Descripción general de la API)
33
- │ └── examples.md (Ejemplos de API)
34
- └── guides/
35
- └── advanced.md (Temas avanzados)
36
- ```
37
-
38
- Cada archivo markdown se convierte automáticamente en una ruta:
39
- - `docs/setup.md` → `/docs/es/setup`
40
- - `docs/api/overview.md` → `/docs/es/api/overview`
41
- - `docs/guides/advanced.md` → `/docs/es/guides/advanced`
package/docs/fr/index.md DELETED
@@ -1,41 +0,0 @@
1
- ---
2
- title: Accueil de la Documentation
3
- description: Bienvenue dans le système de documentation SvelteKit
4
- author: Andrew
5
- date: 2026-02-05
6
- ---
7
-
8
- # Bienvenue dans le système de documentation
9
-
10
- Ceci est la page d'accueil de votre site de documentation. Elle démontre le système de routage markdown en action.
11
-
12
- ## Fonctionnalités
13
-
14
- - **Routage automatique** à partir des fichiers markdown
15
- - **Support des chemins imbriqués** (organisez les documents dans des dossiers)
16
- - **Métadonnées frontmatter** (titre, auteur, date)
17
- - **Stylisation professionnelle** prête à l'emploi
18
- - **Facile à personnaliser** et à étendre
19
-
20
- ## Commencer
21
-
22
- Consultez le [Guide d'installation](/docs/fr/setup) pour commencer.
23
-
24
- ## Structure du projet
25
-
26
- ```
27
- docs/
28
- ├── index.md (Ce fichier)
29
- ├── setup.md (Guide de démarrage)
30
- ├── routing.md (Fonctionnement du routage)
31
- ├── api/
32
- │ ├── overview.md (Aperçu de l'API)
33
- │ └── examples.md (Exemples d'API)
34
- └── guides/
35
- └── advanced.md (Sujets avancés)
36
- ```
37
-
38
- Chaque fichier markdown devient automatiquement une route :
39
- - `docs/setup.md` → `/docs/fr/setup`
40
- - `docs/api/overview.md` → `/docs/fr/api/overview`
41
- - `docs/guides/advanced.md` → `/docs/fr/guides/advanced`
package/docs/ja/index.md DELETED
@@ -1,41 +0,0 @@
1
- ---
2
- title: ドキュメントホーム
3
- description: SvelteKit ドキュメントシステムへようこそ
4
- author: Andrew
5
- date: 2026-02-05
6
- ---
7
-
8
- # ドキュメントシステムへようこそ
9
-
10
- これはドキュメントサイトのホームページです。マークダウンルーティングシステムの動作を示しています。
11
-
12
- ## 機能
13
-
14
- - **マークダウンファイルからの自動ルーティング**
15
- - **ネストされたパスのサポート** (フォルダ内にドキュメントを整理)
16
- - **フロントマターメタデータ** (タイトル、著者、日付)
17
- - **プロフェッショナルなスタイリング** (すぐに使用可能)
18
- - **簡単にカスタマイズ** して拡張可能
19
-
20
- ## 始める
21
-
22
- [セットアップガイド](/docs/ja/setup) をご覧ください。
23
-
24
- ## プロジェクト構造
25
-
26
- ```
27
- docs/
28
- ├── index.md (このファイル)
29
- ├── setup.md (スタートガイド)
30
- ├── routing.md (ルーティングの仕組み)
31
- ├── api/
32
- │ ├── overview.md (API概要)
33
- │ └── examples.md (API例)
34
- └── guides/
35
- └── advanced.md (高度なトピック)
36
- ```
37
-
38
- 各マークダウンファイルは自動的にルートになります:
39
- - `docs/setup.md` → `/docs/ja/setup`
40
- - `docs/api/overview.md` → `/docs/ja/api/overview`
41
- - `docs/guides/advanced.md` → `/docs/ja/guides/advanced`
package/pagefind.toml DELETED
@@ -1,8 +0,0 @@
1
- # Pagefind Search Configuration
2
- site = "build"
3
- bundle_size = 20000
4
- keep_index_url = true
5
- merging_strategy = "merge_smaller_into_larger"
6
- indexing = { comment_strings = false }
7
- root_selector = "main"
8
- exclude_selectors = ["nav", "aside"]
package/postcss.config.js DELETED
@@ -1,5 +0,0 @@
1
- export default {
2
- plugins: {
3
- autoprefixer: {},
4
- },
5
- };
package/src/app.css DELETED
@@ -1,119 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- /* Claude Code Aesthetic Styling */
6
-
7
- @layer base {
8
- :root {
9
- color-scheme: light;
10
- --background: #ffffff;
11
- --foreground: #1a1a1a;
12
- --secondary: #565656;
13
- --border: #ececec;
14
- --accent: #0066cc;
15
- }
16
-
17
- :root.dark {
18
- color-scheme: dark;
19
- --background: #1a1a1a;
20
- --foreground: #ffffff;
21
- --secondary: #b0b0b0;
22
- --border: #3a3a3a;
23
- --accent: #4d94ff;
24
- }
25
-
26
- html {
27
- @apply antialiased scroll-smooth;
28
- }
29
-
30
- body {
31
- @apply bg-white dark:bg-claude-dark-bg text-claude-text dark:text-claude-dark-text transition-colors;
32
- }
33
- }
34
-
35
- @layer components {
36
- .doc-container {
37
- @apply max-w-7xl mx-auto;
38
- }
39
-
40
- .doc-content {
41
- @apply prose dark:prose-invert max-w-none;
42
- }
43
-
44
- .btn-primary {
45
- @apply px-4 py-2 rounded-lg bg-claude-accent dark:bg-claude-dark-accent text-white font-medium hover:bg-claude-accent-hover dark:hover:bg-claude-dark-accent-hover transition-colors;
46
- }
47
-
48
- .btn-secondary {
49
- @apply px-4 py-2 rounded-lg bg-claude-bg-secondary dark:bg-claude-dark-bg-secondary text-claude-text dark:text-claude-dark-text border border-claude-border dark:border-claude-dark-border hover:bg-claude-border dark:hover:bg-claude-dark-border transition-colors;
50
- }
51
-
52
- .card {
53
- @apply rounded-lg border border-claude-border dark:border-claude-dark-border bg-white dark:bg-claude-dark-bg-secondary p-6 transition-colors;
54
- }
55
-
56
- /* Doc content styling */
57
- .doc-content h1 {
58
- @apply text-4xl font-bold mb-6 mt-0 text-claude-text dark:text-claude-dark-text;
59
- }
60
-
61
- .doc-content h2 {
62
- @apply text-2xl font-bold mb-4 mt-8 text-claude-text dark:text-claude-dark-text;
63
- }
64
-
65
- .doc-content h3 {
66
- @apply text-xl font-bold mb-3 mt-6 text-claude-text dark:text-claude-dark-text;
67
- }
68
-
69
- .doc-content p {
70
- @apply mb-4 text-claude-text dark:text-claude-dark-text leading-relaxed;
71
- }
72
-
73
- .doc-content a {
74
- @apply text-claude-accent dark:text-claude-dark-accent hover:underline;
75
- }
76
-
77
- .doc-content code {
78
- @apply bg-claude-bg-secondary dark:bg-claude-dark-bg-secondary px-2 py-1 rounded text-sm font-mono;
79
- }
80
-
81
- .doc-content pre {
82
- @apply bg-claude-bg-secondary dark:bg-claude-dark-bg-secondary p-4 rounded-lg overflow-x-auto mb-4;
83
- }
84
-
85
- .doc-content pre code {
86
- @apply bg-transparent p-0;
87
- }
88
-
89
- .doc-content ul,
90
- .doc-content ol {
91
- @apply mb-4 ml-6 space-y-2;
92
- }
93
-
94
- .doc-content li {
95
- @apply text-claude-text dark:text-claude-dark-text;
96
- }
97
-
98
- .doc-content blockquote {
99
- @apply border-l-4 border-claude-accent dark:border-claude-dark-accent pl-4 py-2 text-claude-text-secondary dark:text-claude-dark-text-secondary italic;
100
- }
101
-
102
- .doc-content table {
103
- @apply w-full border-collapse mb-4;
104
- }
105
-
106
- .doc-content th,
107
- .doc-content td {
108
- @apply border border-claude-border dark:border-claude-dark-border px-4 py-2 text-left;
109
- }
110
-
111
- .doc-content th {
112
- @apply bg-claude-bg-secondary dark:bg-claude-dark-bg-secondary font-bold;
113
- }
114
- }
115
-
116
- /* Smooth dark mode transitions */
117
- * {
118
- @apply transition-colors duration-200;
119
- }
package/src/app.d.ts DELETED
@@ -1,13 +0,0 @@
1
- // See https://svelte.dev/docs/kit/types#app.d.ts
2
- // for information about these interfaces
3
- declare global {
4
- namespace App {
5
- // interface Error {}
6
- // interface Locals {}
7
- // interface PageData {}
8
- // interface PageState {}
9
- // interface Platform {}
10
- }
11
- }
12
-
13
- export {};
package/src/app.html DELETED
@@ -1,11 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- %sveltekit.head%
7
- </head>
8
- <body data-sveltekit-preload-data="hover">
9
- <div style="display: contents">%sveltekit.body%</div>
10
- </body>
11
- </html>
@@ -1,153 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
-
3
- /**
4
- * Unit tests for APITable component
5
- * Tests API reference table structure and data handling
6
- */
7
-
8
- describe('APITable Component', () => {
9
- describe('Column Definition', () => {
10
- it('should accept array of columns', () => {
11
- const columns = [
12
- { header: 'Name', field: 'name' },
13
- { header: 'Type', field: 'type' },
14
- { header: 'Description', field: 'description' }
15
- ];
16
- expect(Array.isArray(columns)).toBe(true);
17
- expect(columns.length).toBe(3);
18
- });
19
-
20
- it('should require header for each column', () => {
21
- const column = { header: 'Parameter', field: 'param' };
22
- expect(column.header).toBeDefined();
23
- expect(typeof column.header).toBe('string');
24
- });
25
-
26
- it('should require field property', () => {
27
- const column = { header: 'Value', field: 'value' };
28
- expect(column.field).toBeDefined();
29
- expect(typeof column.field).toBe('string');
30
- });
31
- });
32
-
33
- describe('Data Rows', () => {
34
- it('should accept array of data rows', () => {
35
- const data = [
36
- { name: 'foo', type: 'string', description: 'A string' },
37
- { name: 'bar', type: 'number', description: 'A number' }
38
- ];
39
- expect(Array.isArray(data)).toBe(true);
40
- expect(data.length).toBe(2);
41
- });
42
-
43
- it('should handle empty data array', () => {
44
- const data: any[] = [];
45
- expect(data.length).toBe(0);
46
- });
47
-
48
- it('should display data in correct columns', () => {
49
- const data = [{ name: 'parameter1', type: 'string' }];
50
- const columns = [
51
- { header: 'Name', field: 'name' },
52
- { header: 'Type', field: 'type' }
53
- ];
54
- expect(data[0].name).toBe('parameter1');
55
- expect(columns[0].field).toBe('name');
56
- });
57
- });
58
-
59
- describe('Cell Content', () => {
60
- it('should support text content', () => {
61
- const cell = 'Simple text content';
62
- expect(typeof cell).toBe('string');
63
- });
64
-
65
- it('should support HTML content', () => {
66
- const cell = '<code>inline code</code>';
67
- expect(cell).toContain('<code>');
68
- expect(cell).toContain('</code>');
69
- });
70
-
71
- it('should support code content', () => {
72
- const cell = 'User[]';
73
- expect(cell).toBeTruthy();
74
- });
75
-
76
- it('should support optional properties', () => {
77
- const row = {
78
- name: 'optional',
79
- type: 'string | undefined',
80
- optional: true
81
- };
82
- expect(row.optional).toBe(true);
83
- });
84
- });
85
-
86
- describe('Table Features', () => {
87
- it('should support sortable columns', () => {
88
- const column = {
89
- header: 'Name',
90
- field: 'name',
91
- sortable: true
92
- };
93
- expect(column.sortable).toBe(true);
94
- });
95
-
96
- it('should support striped rows', () => {
97
- const hasStriped = true;
98
- expect(hasStriped).toBe(true);
99
- });
100
-
101
- it('should support column alignment', () => {
102
- const alignments = ['left', 'center', 'right'];
103
- alignments.forEach((align) => {
104
- expect(['left', 'center', 'right']).toContain(align);
105
- });
106
- });
107
-
108
- it('should support column width customization', () => {
109
- const column = {
110
- header: 'Name',
111
- field: 'name',
112
- width: '30%'
113
- };
114
- expect(column.width).toBe('30%');
115
- });
116
- });
117
-
118
- describe('Styling', () => {
119
- it('should support responsive layout', () => {
120
- const isResponsive = true;
121
- expect(isResponsive).toBe(true);
122
- });
123
-
124
- it('should support dark mode', () => {
125
- const colorSchemes = ['light', 'dark'];
126
- colorSchemes.forEach((scheme) => {
127
- expect(['light', 'dark']).toContain(scheme);
128
- });
129
- });
130
-
131
- it('should have proper borders', () => {
132
- const tableStyle = 'border border-gray-200';
133
- expect(tableStyle).toContain('border');
134
- });
135
- });
136
-
137
- describe('Accessibility', () => {
138
- it('should have table ARIA role', () => {
139
- const role = 'table';
140
- expect(role).toBe('table');
141
- });
142
-
143
- it('should have header row with th elements', () => {
144
- const headerRole = 'columnheader';
145
- expect(headerRole).toBe('columnheader');
146
- });
147
-
148
- it('should support keyboard navigation', () => {
149
- const isKeyboardAccessible = true;
150
- expect(isKeyboardAccessible).toBe(true);
151
- });
152
- });
153
- });
@@ -1,148 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
-
3
- /**
4
- * Unit tests for Breadcrumbs component
5
- * Tests breadcrumb navigation structure and routing
6
- */
7
-
8
- describe('Breadcrumbs Component', () => {
9
- describe('Breadcrumb Items', () => {
10
- it('should accept array of breadcrumb items', () => {
11
- const items = [
12
- { label: 'Home', href: '/' },
13
- { label: 'Docs', href: '/docs' },
14
- { label: 'API', href: '/docs/api' }
15
- ];
16
- expect(Array.isArray(items)).toBe(true);
17
- expect(items.length).toBe(3);
18
- });
19
-
20
- it('should require label for each item', () => {
21
- const item = { label: 'Documentation', href: '/docs' };
22
- expect(item.label).toBeDefined();
23
- expect(typeof item.label).toBe('string');
24
- });
25
-
26
- it('should require href for navigation links', () => {
27
- const item = { label: 'API', href: '/api' };
28
- expect(item.href).toBeDefined();
29
- expect(typeof item.href).toBe('string');
30
- });
31
-
32
- it('should handle home item', () => {
33
- const homeItem = { label: 'Home', href: '/' };
34
- expect(homeItem.href).toBe('/');
35
- });
36
- });
37
-
38
- describe('Breadcrumb Structure', () => {
39
- it('should maintain breadcrumb order', () => {
40
- const breadcrumbs = [
41
- { label: 'Home', href: '/' },
42
- { label: 'Products', href: '/products' },
43
- { label: 'Books', href: '/products/books' },
44
- { label: 'JavaScript Guide' }
45
- ];
46
- expect(breadcrumbs[0].label).toBe('Home');
47
- expect(breadcrumbs[breadcrumbs.length - 1].label).toBe('JavaScript Guide');
48
- });
49
-
50
- it('should support single breadcrumb', () => {
51
- const items = [{ label: 'Home', href: '/' }];
52
- expect(items.length).toBe(1);
53
- });
54
-
55
- it('should support current page as last item without link', () => {
56
- const items = [
57
- { label: 'Home', href: '/' },
58
- { label: 'Current Page' }
59
- ];
60
- const lastItem = items[items.length - 1];
61
- expect('href' in lastItem).toBe(false);
62
- });
63
- });
64
-
65
- describe('Navigation', () => {
66
- it('should have proper href attributes', () => {
67
- const item = { label: 'Docs', href: '/docs' };
68
- expect(item.href).toMatch(/^\//);
69
- });
70
-
71
- it('should support absolute URLs', () => {
72
- const item = { label: 'External', href: 'https://example.com' };
73
- expect(item.href).toContain('http');
74
- });
75
-
76
- it('should support relative paths', () => {
77
- const item = { label: 'Sibling', href: '../other' };
78
- expect(item.href).toContain('..');
79
- });
80
- });
81
-
82
- describe('Separators', () => {
83
- it('should have separators between items', () => {
84
- const separator = '/';
85
- expect(typeof separator).toBe('string');
86
- });
87
-
88
- it('should not show separator after last item', () => {
89
- const items = [
90
- { label: 'Home', href: '/' },
91
- { label: 'Current' }
92
- ];
93
- const showSeparator = (index: number) => index < items.length - 1;
94
- expect(showSeparator(0)).toBe(true);
95
- expect(showSeparator(1)).toBe(false);
96
- });
97
- });
98
-
99
- describe('Accessibility', () => {
100
- it('should have nav ARIA landmark', () => {
101
- const role = 'navigation';
102
- expect(role).toBe('navigation');
103
- });
104
-
105
- it('should have proper ARIA attributes', () => {
106
- const ariaLabel = 'Breadcrumb navigation';
107
- expect(ariaLabel).toBeTruthy();
108
- });
109
-
110
- it('should mark current page as current', () => {
111
- const ariaCurrent = 'page';
112
- expect(ariaCurrent).toBe('page');
113
- });
114
-
115
- it('should have proper link semantics', () => {
116
- const link = { label: 'Docs', href: '/docs' };
117
- expect(link.href).toBeTruthy();
118
- expect(link.label).toBeTruthy();
119
- });
120
- });
121
-
122
- describe('Styling', () => {
123
- it('should support custom classes', () => {
124
- const customClass = 'text-sm text-gray-600';
125
- expect(customClass).toContain('text-');
126
- });
127
-
128
- it('should support active/current state styling', () => {
129
- const activeClass = 'text-gray-900 font-semibold';
130
- expect(activeClass).toBeTruthy();
131
- });
132
-
133
- it('should be responsive', () => {
134
- const isResponsive = true;
135
- expect(isResponsive).toBe(true);
136
- });
137
- });
138
-
139
- describe('Schema/Structured Data', () => {
140
- it('should support breadcrumbList schema', () => {
141
- const schema = {
142
- '@context': 'https://schema.org',
143
- '@type': 'BreadcrumbList'
144
- };
145
- expect(schema['@type']).toBe('BreadcrumbList');
146
- });
147
- });
148
- });
@@ -1,100 +0,0 @@
1
- import { describe, it, expect, beforeEach } from 'vitest';
2
-
3
- /**
4
- * Unit tests for Callout component
5
- * Tests component structure and prop handling
6
- */
7
-
8
- describe('Callout Component', () => {
9
- describe('Props', () => {
10
- it('should have default variant as info', () => {
11
- const defaultVariant = 'info';
12
- expect(['info', 'warning', 'success', 'error']).toContain(defaultVariant);
13
- });
14
-
15
- it('should accept valid variants', () => {
16
- const validVariants = ['info', 'warning', 'success', 'error'];
17
- validVariants.forEach((variant) => {
18
- expect(validVariants).toContain(variant);
19
- });
20
- });
21
-
22
- it('should accept optional title', () => {
23
- const props = {
24
- title: 'Important Note',
25
- variant: 'info' as const
26
- };
27
- expect(props.title).toBeDefined();
28
- expect(typeof props.title).toBe('string');
29
- });
30
-
31
- it('should accept children slot', () => {
32
- const hasChildren = true;
33
- expect(hasChildren).toBe(true);
34
- });
35
- });
36
-
37
- describe('Variant Configuration', () => {
38
- const variantConfig = {
39
- info: {
40
- bgColor: 'bg-blue-50 dark:bg-blue-900/20',
41
- borderColor: 'border-blue-200 dark:border-blue-700',
42
- textColor: 'text-blue-900 dark:text-blue-100',
43
- iconClass: 'fa-circle-info text-blue-500'
44
- },
45
- warning: {
46
- bgColor: 'bg-amber-50 dark:bg-amber-900/20',
47
- borderColor: 'border-amber-200 dark:border-amber-700',
48
- textColor: 'text-amber-900 dark:text-amber-100',
49
- iconClass: 'fa-triangle-exclamation text-amber-500'
50
- },
51
- success: {
52
- bgColor: 'bg-green-50 dark:bg-green-900/20',
53
- borderColor: 'border-green-200 dark:border-green-700',
54
- textColor: 'text-green-900 dark:text-green-100',
55
- iconClass: 'fa-circle-check text-green-500'
56
- },
57
- error: {
58
- bgColor: 'bg-red-50 dark:bg-red-900/20',
59
- borderColor: 'border-red-200 dark:border-red-700',
60
- textColor: 'text-red-900 dark:text-red-100',
61
- iconClass: 'fa-circle-xmark text-red-500'
62
- }
63
- };
64
-
65
- it('should have all required properties for each variant', () => {
66
- Object.entries(variantConfig).forEach(([variant, config]) => {
67
- expect(config).toHaveProperty('bgColor');
68
- expect(config).toHaveProperty('borderColor');
69
- expect(config).toHaveProperty('textColor');
70
- expect(config).toHaveProperty('iconClass');
71
- expect(config.bgColor).toBeTruthy();
72
- expect(config.borderColor).toBeTruthy();
73
- expect(config.textColor).toBeTruthy();
74
- expect(config.iconClass).toBeTruthy();
75
- });
76
- });
77
-
78
- it('should use correct icon classes for each variant', () => {
79
- expect(variantConfig.info.iconClass).toContain('circle-info');
80
- expect(variantConfig.warning.iconClass).toContain('triangle-exclamation');
81
- expect(variantConfig.success.iconClass).toContain('circle-check');
82
- expect(variantConfig.error.iconClass).toContain('circle-xmark');
83
- });
84
-
85
- it('should include dark mode classes', () => {
86
- Object.values(variantConfig).forEach((config) => {
87
- expect(config.bgColor).toMatch(/dark:/);
88
- expect(config.borderColor).toMatch(/dark:/);
89
- expect(config.textColor).toMatch(/dark:/);
90
- });
91
- });
92
- });
93
-
94
- describe('Accessibility', () => {
95
- it('should support icon from FontAwesome', () => {
96
- const iconClass = 'fa-solid fa-circle-info text-blue-500';
97
- expect(iconClass).toMatch(/fa-(solid|regular|light|brands)/);
98
- });
99
- });
100
- });