svelte-docsmith 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 (192) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +162 -0
  3. package/dist/clipboard.svelte.d.ts +6 -0
  4. package/dist/clipboard.svelte.js +27 -0
  5. package/dist/config.d.ts +79 -0
  6. package/dist/config.js +55 -0
  7. package/dist/content.d.ts +10 -0
  8. package/dist/content.js +4 -0
  9. package/dist/highlight.d.ts +17 -0
  10. package/dist/highlight.js +34 -0
  11. package/dist/index.d.ts +20 -0
  12. package/dist/index.js +26 -0
  13. package/dist/markdown-layout.svelte +21 -0
  14. package/dist/markdown-layout.svelte.d.ts +18 -0
  15. package/dist/preprocess.d.ts +33 -0
  16. package/dist/preprocess.js +65 -0
  17. package/dist/shadcn.d.ts +12 -0
  18. package/dist/shadcn.js +5 -0
  19. package/dist/theme.css +201 -0
  20. package/dist/themes/amethyst.css +76 -0
  21. package/dist/themes/bubblegum.css +79 -0
  22. package/dist/themes/claude.css +79 -0
  23. package/dist/themes/evergreen.css +76 -0
  24. package/dist/themes/graphite.css +79 -0
  25. package/dist/themes/mono.css +79 -0
  26. package/dist/themes/nord.css +79 -0
  27. package/dist/themes/ocean.css +76 -0
  28. package/dist/themes/rose.css +78 -0
  29. package/dist/themes/tangerine.css +81 -0
  30. package/dist/toc/from-content.d.ts +11 -0
  31. package/dist/toc/from-content.js +18 -0
  32. package/dist/toc/index.d.ts +3 -0
  33. package/dist/toc/index.js +3 -0
  34. package/dist/toc/toc.svelte.d.ts +26 -0
  35. package/dist/toc/toc.svelte.js +74 -0
  36. package/dist/toc/types.d.ts +11 -0
  37. package/dist/toc/types.js +1 -0
  38. package/dist/types.d.ts +13 -0
  39. package/dist/types.js +1 -0
  40. package/dist/ui/accordion-item.svelte +24 -0
  41. package/dist/ui/accordion-item.svelte.d.ts +9 -0
  42. package/dist/ui/accordion.svelte +45 -0
  43. package/dist/ui/accordion.svelte.d.ts +15 -0
  44. package/dist/ui/background-pattern.svelte +17 -0
  45. package/dist/ui/background-pattern.svelte.d.ts +26 -0
  46. package/dist/ui/badge.svelte +54 -0
  47. package/dist/ui/badge.svelte.d.ts +12 -0
  48. package/dist/ui/callout.svelte +125 -0
  49. package/dist/ui/callout.svelte.d.ts +13 -0
  50. package/dist/ui/card-grid.svelte +10 -0
  51. package/dist/ui/card-grid.svelte.d.ts +7 -0
  52. package/dist/ui/card.svelte +52 -0
  53. package/dist/ui/card.svelte.d.ts +14 -0
  54. package/dist/ui/copy-button.svelte +30 -0
  55. package/dist/ui/copy-button.svelte.d.ts +9 -0
  56. package/dist/ui/file-tree-item.svelte +70 -0
  57. package/dist/ui/file-tree-item.svelte.d.ts +14 -0
  58. package/dist/ui/file-tree.svelte +34 -0
  59. package/dist/ui/file-tree.svelte.d.ts +7 -0
  60. package/dist/ui/icons/github.svelte +14 -0
  61. package/dist/ui/icons/github.svelte.d.ts +6 -0
  62. package/dist/ui/kbd.svelte +11 -0
  63. package/dist/ui/kbd.svelte.d.ts +7 -0
  64. package/dist/ui/layouts/breadcrumbs.svelte +37 -0
  65. package/dist/ui/layouts/breadcrumbs.svelte.d.ts +10 -0
  66. package/dist/ui/layouts/docs-footer.svelte +40 -0
  67. package/dist/ui/layouts/docs-footer.svelte.d.ts +7 -0
  68. package/dist/ui/layouts/docs-header.svelte +109 -0
  69. package/dist/ui/layouts/docs-header.svelte.d.ts +18 -0
  70. package/dist/ui/layouts/docs-mobile-header.svelte +106 -0
  71. package/dist/ui/layouts/docs-mobile-header.svelte.d.ts +18 -0
  72. package/dist/ui/layouts/docs-shell.svelte +133 -0
  73. package/dist/ui/layouts/docs-shell.svelte.d.ts +25 -0
  74. package/dist/ui/layouts/docs-sidebar.svelte +36 -0
  75. package/dist/ui/layouts/docs-sidebar.svelte.d.ts +8 -0
  76. package/dist/ui/layouts/prev-next-nav.svelte +32 -0
  77. package/dist/ui/layouts/prev-next-nav.svelte.d.ts +8 -0
  78. package/dist/ui/live-example.svelte +67 -0
  79. package/dist/ui/live-example.svelte.d.ts +10 -0
  80. package/dist/ui/markdown/code.svelte +11 -0
  81. package/dist/ui/markdown/code.svelte.d.ts +7 -0
  82. package/dist/ui/markdown/h2.svelte +13 -0
  83. package/dist/ui/markdown/h2.svelte.d.ts +4 -0
  84. package/dist/ui/markdown/h3.svelte +13 -0
  85. package/dist/ui/markdown/h3.svelte.d.ts +4 -0
  86. package/dist/ui/markdown/index.d.ts +5 -0
  87. package/dist/ui/markdown/index.js +5 -0
  88. package/dist/ui/markdown/pre.svelte +88 -0
  89. package/dist/ui/markdown/pre.svelte.d.ts +7 -0
  90. package/dist/ui/markdown/table.svelte +80 -0
  91. package/dist/ui/markdown/table.svelte.d.ts +7 -0
  92. package/dist/ui/markdown/types.d.ts +3 -0
  93. package/dist/ui/markdown/types.js +1 -0
  94. package/dist/ui/prop.svelte +130 -0
  95. package/dist/ui/prop.svelte.d.ts +16 -0
  96. package/dist/ui/props-table.svelte +127 -0
  97. package/dist/ui/props-table.svelte.d.ts +9 -0
  98. package/dist/ui/shadcn/accordion/accordion-content.svelte +27 -0
  99. package/dist/ui/shadcn/accordion/accordion-content.svelte.d.ts +4 -0
  100. package/dist/ui/shadcn/accordion/accordion-item.svelte +17 -0
  101. package/dist/ui/shadcn/accordion/accordion-item.svelte.d.ts +4 -0
  102. package/dist/ui/shadcn/accordion/accordion-trigger.svelte +38 -0
  103. package/dist/ui/shadcn/accordion/accordion-trigger.svelte.d.ts +8 -0
  104. package/dist/ui/shadcn/accordion/accordion.svelte +19 -0
  105. package/dist/ui/shadcn/accordion/accordion.svelte.d.ts +4 -0
  106. package/dist/ui/shadcn/accordion/index.d.ts +5 -0
  107. package/dist/ui/shadcn/accordion/index.js +7 -0
  108. package/dist/ui/shadcn/badge/badge.svelte +50 -0
  109. package/dist/ui/shadcn/badge/badge.svelte.d.ts +38 -0
  110. package/dist/ui/shadcn/badge/index.d.ts +2 -0
  111. package/dist/ui/shadcn/badge/index.js +2 -0
  112. package/dist/ui/shadcn/button/button.svelte +89 -0
  113. package/dist/ui/shadcn/button/button.svelte.d.ts +70 -0
  114. package/dist/ui/shadcn/button/index.d.ts +2 -0
  115. package/dist/ui/shadcn/button/index.js +4 -0
  116. package/dist/ui/shadcn/popover/index.d.ts +9 -0
  117. package/dist/ui/shadcn/popover/index.js +11 -0
  118. package/dist/ui/shadcn/popover/popover-close.svelte +7 -0
  119. package/dist/ui/shadcn/popover/popover-close.svelte.d.ts +4 -0
  120. package/dist/ui/shadcn/popover/popover-content.svelte +31 -0
  121. package/dist/ui/shadcn/popover/popover-content.svelte.d.ts +10 -0
  122. package/dist/ui/shadcn/popover/popover-description.svelte +20 -0
  123. package/dist/ui/shadcn/popover/popover-description.svelte.d.ts +5 -0
  124. package/dist/ui/shadcn/popover/popover-header.svelte +20 -0
  125. package/dist/ui/shadcn/popover/popover-header.svelte.d.ts +5 -0
  126. package/dist/ui/shadcn/popover/popover-portal.svelte +7 -0
  127. package/dist/ui/shadcn/popover/popover-portal.svelte.d.ts +3 -0
  128. package/dist/ui/shadcn/popover/popover-title.svelte +15 -0
  129. package/dist/ui/shadcn/popover/popover-title.svelte.d.ts +5 -0
  130. package/dist/ui/shadcn/popover/popover-trigger.svelte +17 -0
  131. package/dist/ui/shadcn/popover/popover-trigger.svelte.d.ts +4 -0
  132. package/dist/ui/shadcn/popover/popover.svelte +7 -0
  133. package/dist/ui/shadcn/popover/popover.svelte.d.ts +3 -0
  134. package/dist/ui/shadcn/scroll-area/index.d.ts +3 -0
  135. package/dist/ui/shadcn/scroll-area/index.js +5 -0
  136. package/dist/ui/shadcn/scroll-area/scroll-area-scrollbar.svelte +30 -0
  137. package/dist/ui/shadcn/scroll-area/scroll-area-scrollbar.svelte.d.ts +4 -0
  138. package/dist/ui/shadcn/scroll-area/scroll-area.svelte +43 -0
  139. package/dist/ui/shadcn/scroll-area/scroll-area.svelte.d.ts +11 -0
  140. package/dist/ui/shadcn/separator/index.d.ts +2 -0
  141. package/dist/ui/shadcn/separator/index.js +4 -0
  142. package/dist/ui/shadcn/separator/separator.svelte +23 -0
  143. package/dist/ui/shadcn/separator/separator.svelte.d.ts +4 -0
  144. package/dist/ui/shadcn/sheet/index.d.ts +11 -0
  145. package/dist/ui/shadcn/sheet/index.js +13 -0
  146. package/dist/ui/shadcn/sheet/sheet-close.svelte +7 -0
  147. package/dist/ui/shadcn/sheet/sheet-close.svelte.d.ts +4 -0
  148. package/dist/ui/shadcn/sheet/sheet-content.svelte +55 -0
  149. package/dist/ui/shadcn/sheet/sheet-content.svelte.d.ts +15 -0
  150. package/dist/ui/shadcn/sheet/sheet-description.svelte +17 -0
  151. package/dist/ui/shadcn/sheet/sheet-description.svelte.d.ts +4 -0
  152. package/dist/ui/shadcn/sheet/sheet-footer.svelte +20 -0
  153. package/dist/ui/shadcn/sheet/sheet-footer.svelte.d.ts +5 -0
  154. package/dist/ui/shadcn/sheet/sheet-header.svelte +20 -0
  155. package/dist/ui/shadcn/sheet/sheet-header.svelte.d.ts +5 -0
  156. package/dist/ui/shadcn/sheet/sheet-overlay.svelte +17 -0
  157. package/dist/ui/shadcn/sheet/sheet-overlay.svelte.d.ts +4 -0
  158. package/dist/ui/shadcn/sheet/sheet-portal.svelte +7 -0
  159. package/dist/ui/shadcn/sheet/sheet-portal.svelte.d.ts +3 -0
  160. package/dist/ui/shadcn/sheet/sheet-title.svelte +17 -0
  161. package/dist/ui/shadcn/sheet/sheet-title.svelte.d.ts +4 -0
  162. package/dist/ui/shadcn/sheet/sheet-trigger.svelte +7 -0
  163. package/dist/ui/shadcn/sheet/sheet-trigger.svelte.d.ts +4 -0
  164. package/dist/ui/shadcn/sheet/sheet.svelte +7 -0
  165. package/dist/ui/shadcn/sheet/sheet.svelte.d.ts +3 -0
  166. package/dist/ui/shadcn/tabs/index.d.ts +5 -0
  167. package/dist/ui/shadcn/tabs/index.js +7 -0
  168. package/dist/ui/shadcn/tabs/tabs-content.svelte +17 -0
  169. package/dist/ui/shadcn/tabs/tabs-content.svelte.d.ts +4 -0
  170. package/dist/ui/shadcn/tabs/tabs-list.svelte +40 -0
  171. package/dist/ui/shadcn/tabs/tabs-list.svelte.d.ts +25 -0
  172. package/dist/ui/shadcn/tabs/tabs-trigger.svelte +23 -0
  173. package/dist/ui/shadcn/tabs/tabs-trigger.svelte.d.ts +4 -0
  174. package/dist/ui/shadcn/tabs/tabs.svelte +19 -0
  175. package/dist/ui/shadcn/tabs/tabs.svelte.d.ts +4 -0
  176. package/dist/ui/step.svelte +82 -0
  177. package/dist/ui/step.svelte.d.ts +9 -0
  178. package/dist/ui/steps.svelte +71 -0
  179. package/dist/ui/steps.svelte.d.ts +7 -0
  180. package/dist/ui/tab-item.svelte +14 -0
  181. package/dist/ui/tab-item.svelte.d.ts +6 -0
  182. package/dist/ui/table-of-contents.svelte +114 -0
  183. package/dist/ui/table-of-contents.svelte.d.ts +9 -0
  184. package/dist/ui/tabs.svelte +29 -0
  185. package/dist/ui/tabs.svelte.d.ts +8 -0
  186. package/dist/ui/theme-provider.svelte +23 -0
  187. package/dist/ui/theme-provider.svelte.d.ts +10 -0
  188. package/dist/ui/theme-toggle.svelte +22 -0
  189. package/dist/ui/theme-toggle.svelte.d.ts +6 -0
  190. package/dist/vite.d.ts +32 -0
  191. package/dist/vite.js +216 -0
  192. package/package.json +115 -0
@@ -0,0 +1,79 @@
1
+ /*
2
+ * svelte-docsmith theme — Nord. A cool, desaturated arctic palette; its dark
3
+ * mode is the signature mid-slate "polar night", not near-black.
4
+ *
5
+ * @import 'svelte-docsmith/theme.css';
6
+ * @import 'svelte-docsmith/themes/nord.css';
7
+ */
8
+
9
+ :root {
10
+ --radius: 0.5rem;
11
+ --background: oklch(0.96 0.006 250);
12
+ --foreground: oklch(0.32 0.02 255);
13
+ --card: oklch(0.98 0.004 250);
14
+ --card-foreground: oklch(0.32 0.02 255);
15
+ --popover: oklch(0.98 0.004 250);
16
+ --popover-foreground: oklch(0.32 0.02 255);
17
+ --primary: oklch(0.55 0.07 245);
18
+ --primary-foreground: oklch(0.98 0.005 250);
19
+ --secondary: oklch(0.92 0.008 250);
20
+ --secondary-foreground: oklch(0.4 0.02 250);
21
+ --muted: oklch(0.93 0.006 250);
22
+ --muted-foreground: oklch(0.5 0.015 250);
23
+ --accent: oklch(0.88 0.03 220);
24
+ --accent-foreground: oklch(0.4 0.05 235);
25
+ --border: oklch(0.88 0.008 250);
26
+ --input: oklch(0.88 0.008 250);
27
+ --ring: oklch(0.55 0.07 245);
28
+ --destructive: oklch(0.6 0.13 25);
29
+ --destructive-foreground: oklch(0.98 0.005 250);
30
+ --chart-1: oklch(0.6 0.07 245);
31
+ --chart-2: oklch(0.68 0.08 200);
32
+ --chart-3: oklch(0.7 0.09 150);
33
+ --chart-4: oklch(0.74 0.1 90);
34
+ --chart-5: oklch(0.65 0.12 30);
35
+ --sidebar: oklch(0.93 0.008 250);
36
+ --sidebar-foreground: oklch(0.32 0.02 255);
37
+ --sidebar-primary: oklch(0.55 0.07 245);
38
+ --sidebar-primary-foreground: oklch(0.98 0.005 250);
39
+ --sidebar-accent: oklch(0.88 0.03 220);
40
+ --sidebar-accent-foreground: oklch(0.4 0.05 235);
41
+ --sidebar-border: oklch(0.88 0.008 250);
42
+ --sidebar-ring: oklch(0.55 0.07 245);
43
+ }
44
+
45
+ .dark {
46
+ --radius: 0.5rem;
47
+ --background: oklch(0.29 0.02 255);
48
+ --foreground: oklch(0.9 0.01 240);
49
+ --card: oklch(0.33 0.02 255);
50
+ --card-foreground: oklch(0.9 0.01 240);
51
+ --popover: oklch(0.32 0.02 255);
52
+ --popover-foreground: oklch(0.9 0.01 240);
53
+ --primary: oklch(0.72 0.08 235);
54
+ --primary-foreground: oklch(0.2 0.02 255);
55
+ --secondary: oklch(0.37 0.02 255);
56
+ --secondary-foreground: oklch(0.9 0.01 240);
57
+ --muted: oklch(0.37 0.02 255);
58
+ --muted-foreground: oklch(0.74 0.015 240);
59
+ --accent: oklch(0.42 0.04 220);
60
+ --accent-foreground: oklch(0.85 0.05 220);
61
+ --border: oklch(0.4 0.02 255);
62
+ --input: oklch(0.4 0.02 255);
63
+ --ring: oklch(0.72 0.08 235);
64
+ --destructive: oklch(0.64 0.15 25);
65
+ --destructive-foreground: oklch(0.2 0.02 255);
66
+ --chart-1: oklch(0.72 0.08 235);
67
+ --chart-2: oklch(0.75 0.08 200);
68
+ --chart-3: oklch(0.76 0.09 150);
69
+ --chart-4: oklch(0.8 0.1 90);
70
+ --chart-5: oklch(0.72 0.12 30);
71
+ --sidebar: oklch(0.31 0.02 255);
72
+ --sidebar-foreground: oklch(0.9 0.01 240);
73
+ --sidebar-primary: oklch(0.72 0.08 235);
74
+ --sidebar-primary-foreground: oklch(0.2 0.02 255);
75
+ --sidebar-accent: oklch(0.42 0.04 220);
76
+ --sidebar-accent-foreground: oklch(0.85 0.05 220);
77
+ --sidebar-border: oklch(0.4 0.02 255);
78
+ --sidebar-ring: oklch(0.72 0.08 235);
79
+ }
@@ -0,0 +1,76 @@
1
+ /*
2
+ * svelte-docsmith theme — Ocean. A cool teal-blue palette.
3
+ *
4
+ * @import 'svelte-docsmith/theme.css';
5
+ * @import 'svelte-docsmith/themes/ocean.css';
6
+ */
7
+
8
+ :root {
9
+ --primary: oklch(0.55 0.11 220);
10
+ --primary-foreground: oklch(0.99 0 0);
11
+ --background: oklch(0.99 0.005 215);
12
+ --foreground: oklch(0.26 0.02 225);
13
+ --card: oklch(1 0 0);
14
+ --card-foreground: oklch(0.26 0.02 225);
15
+ --popover: oklch(1 0 0);
16
+ --popover-foreground: oklch(0.26 0.02 225);
17
+ --secondary: oklch(0.965 0.008 215);
18
+ --secondary-foreground: oklch(0.35 0.02 225);
19
+ --muted: oklch(0.97 0.006 215);
20
+ --muted-foreground: oklch(0.5 0.02 225);
21
+ --accent: oklch(0.93 0.03 210);
22
+ --accent-foreground: oklch(0.38 0.09 222);
23
+ --border: oklch(0.9 0.01 215);
24
+ --input: oklch(0.9 0.01 215);
25
+ --ring: oklch(0.55 0.11 220);
26
+ --destructive: oklch(0.637 0.208 25);
27
+ --destructive-foreground: oklch(1 0 0);
28
+ --chart-1: oklch(0.62 0.12 220);
29
+ --chart-2: oklch(0.7 0.1 195);
30
+ --chart-3: oklch(0.54 0.12 250);
31
+ --chart-4: oklch(0.68 0.09 175);
32
+ --chart-5: oklch(0.48 0.11 235);
33
+ --sidebar: oklch(0.975 0.007 215);
34
+ --sidebar-foreground: oklch(0.26 0.02 225);
35
+ --sidebar-primary: oklch(0.55 0.11 220);
36
+ --sidebar-primary-foreground: oklch(0.99 0 0);
37
+ --sidebar-accent: oklch(0.93 0.03 210);
38
+ --sidebar-accent-foreground: oklch(0.38 0.09 222);
39
+ --sidebar-border: oklch(0.9 0.01 215);
40
+ --sidebar-ring: oklch(0.55 0.11 220);
41
+ }
42
+
43
+ .dark {
44
+ --primary: oklch(0.72 0.12 210);
45
+ --primary-foreground: oklch(0.16 0.02 225);
46
+ --background: oklch(0.19 0.02 228);
47
+ --foreground: oklch(0.94 0.01 215);
48
+ --card: oklch(0.23 0.022 228);
49
+ --card-foreground: oklch(0.94 0.01 215);
50
+ --popover: oklch(0.22 0.022 228);
51
+ --popover-foreground: oklch(0.94 0.01 215);
52
+ --secondary: oklch(0.27 0.02 228);
53
+ --secondary-foreground: oklch(0.94 0.01 215);
54
+ --muted: oklch(0.27 0.02 228);
55
+ --muted-foreground: oklch(0.72 0.012 215);
56
+ --accent: oklch(0.32 0.055 216);
57
+ --accent-foreground: oklch(0.85 0.08 214);
58
+ --border: oklch(0.33 0.02 228);
59
+ --input: oklch(0.33 0.02 228);
60
+ --ring: oklch(0.72 0.12 210);
61
+ --destructive: oklch(0.637 0.208 25);
62
+ --destructive-foreground: oklch(1 0 0);
63
+ --chart-1: oklch(0.7 0.12 220);
64
+ --chart-2: oklch(0.77 0.1 195);
65
+ --chart-3: oklch(0.62 0.12 250);
66
+ --chart-4: oklch(0.75 0.09 175);
67
+ --chart-5: oklch(0.56 0.11 235);
68
+ --sidebar: oklch(0.21 0.02 228);
69
+ --sidebar-foreground: oklch(0.94 0.01 215);
70
+ --sidebar-primary: oklch(0.72 0.12 210);
71
+ --sidebar-primary-foreground: oklch(0.16 0.02 225);
72
+ --sidebar-accent: oklch(0.32 0.055 216);
73
+ --sidebar-accent-foreground: oklch(0.85 0.08 214);
74
+ --sidebar-border: oklch(0.33 0.02 228);
75
+ --sidebar-ring: oklch(0.72 0.12 210);
76
+ }
@@ -0,0 +1,78 @@
1
+ /*
2
+ * svelte-docsmith theme — Rosé. A warm rose palette with softer, rounder corners.
3
+ *
4
+ * @import 'svelte-docsmith/theme.css';
5
+ * @import 'svelte-docsmith/themes/rose.css';
6
+ */
7
+
8
+ :root {
9
+ --radius: 1rem;
10
+ --primary: oklch(0.58 0.17 13);
11
+ --primary-foreground: oklch(0.99 0 0);
12
+ --background: oklch(0.99 0.006 12);
13
+ --foreground: oklch(0.28 0.02 12);
14
+ --card: oklch(1 0 0);
15
+ --card-foreground: oklch(0.28 0.02 12);
16
+ --popover: oklch(1 0 0);
17
+ --popover-foreground: oklch(0.28 0.02 12);
18
+ --secondary: oklch(0.967 0.008 12);
19
+ --secondary-foreground: oklch(0.4 0.03 12);
20
+ --muted: oklch(0.972 0.007 12);
21
+ --muted-foreground: oklch(0.52 0.02 12);
22
+ --accent: oklch(0.94 0.03 12);
23
+ --accent-foreground: oklch(0.42 0.13 13);
24
+ --border: oklch(0.91 0.012 12);
25
+ --input: oklch(0.91 0.012 12);
26
+ --ring: oklch(0.58 0.17 13);
27
+ --destructive: oklch(0.637 0.208 25);
28
+ --destructive-foreground: oklch(1 0 0);
29
+ --chart-1: oklch(0.62 0.16 13);
30
+ --chart-2: oklch(0.7 0.12 38);
31
+ --chart-3: oklch(0.54 0.14 350);
32
+ --chart-4: oklch(0.68 0.1 60);
33
+ --chart-5: oklch(0.48 0.15 3);
34
+ --sidebar: oklch(0.975 0.008 12);
35
+ --sidebar-foreground: oklch(0.28 0.02 12);
36
+ --sidebar-primary: oklch(0.58 0.17 13);
37
+ --sidebar-primary-foreground: oklch(0.99 0 0);
38
+ --sidebar-accent: oklch(0.94 0.03 12);
39
+ --sidebar-accent-foreground: oklch(0.42 0.13 13);
40
+ --sidebar-border: oklch(0.91 0.012 12);
41
+ --sidebar-ring: oklch(0.58 0.17 13);
42
+ }
43
+
44
+ .dark {
45
+ --radius: 1rem;
46
+ --primary: oklch(0.72 0.15 13);
47
+ --primary-foreground: oklch(0.18 0.02 12);
48
+ --background: oklch(0.2 0.02 14);
49
+ --foreground: oklch(0.95 0.01 12);
50
+ --card: oklch(0.24 0.022 14);
51
+ --card-foreground: oklch(0.95 0.01 12);
52
+ --popover: oklch(0.23 0.022 14);
53
+ --popover-foreground: oklch(0.95 0.01 12);
54
+ --secondary: oklch(0.27 0.02 14);
55
+ --secondary-foreground: oklch(0.95 0.01 12);
56
+ --muted: oklch(0.27 0.02 14);
57
+ --muted-foreground: oklch(0.72 0.012 12);
58
+ --accent: oklch(0.32 0.05 13);
59
+ --accent-foreground: oklch(0.86 0.07 12);
60
+ --border: oklch(0.33 0.02 14);
61
+ --input: oklch(0.33 0.02 14);
62
+ --ring: oklch(0.72 0.15 13);
63
+ --destructive: oklch(0.637 0.208 25);
64
+ --destructive-foreground: oklch(1 0 0);
65
+ --chart-1: oklch(0.7 0.16 13);
66
+ --chart-2: oklch(0.77 0.12 38);
67
+ --chart-3: oklch(0.62 0.14 350);
68
+ --chart-4: oklch(0.75 0.1 60);
69
+ --chart-5: oklch(0.56 0.15 3);
70
+ --sidebar: oklch(0.21 0.02 14);
71
+ --sidebar-foreground: oklch(0.95 0.01 12);
72
+ --sidebar-primary: oklch(0.72 0.15 13);
73
+ --sidebar-primary-foreground: oklch(0.18 0.02 12);
74
+ --sidebar-accent: oklch(0.32 0.05 13);
75
+ --sidebar-accent-foreground: oklch(0.86 0.07 12);
76
+ --sidebar-border: oklch(0.33 0.02 14);
77
+ --sidebar-ring: oklch(0.72 0.15 13);
78
+ }
@@ -0,0 +1,81 @@
1
+ /*
2
+ * svelte-docsmith theme — Tangerine (the default).
3
+ *
4
+ * These are the same tokens baked into theme.css, extracted as a named preset
5
+ * so you can re-apply the default explicitly or use it as a starting point:
6
+ *
7
+ * @import 'svelte-docsmith/theme.css';
8
+ * @import 'svelte-docsmith/themes/tangerine.css';
9
+ *
10
+ * Warm terracotta primary on calm, faintly-cool neutrals.
11
+ */
12
+
13
+ :root {
14
+ --primary: oklch(0.6397 0.172 36.4421);
15
+ --primary-foreground: oklch(1 0 0);
16
+ --background: oklch(0.9383 0.0042 236.4993);
17
+ --foreground: oklch(0.3211 0 0);
18
+ --card: oklch(1 0 0);
19
+ --card-foreground: oklch(0.3211 0 0);
20
+ --popover: oklch(1 0 0);
21
+ --popover-foreground: oklch(0.3211 0 0);
22
+ --secondary: oklch(0.967 0.0029 264.5419);
23
+ --secondary-foreground: oklch(0.4461 0.0263 256.8018);
24
+ --muted: oklch(0.9846 0.0017 247.8389);
25
+ --muted-foreground: oklch(0.551 0.0234 264.3637);
26
+ --accent: oklch(0.9119 0.0222 243.8174);
27
+ --accent-foreground: oklch(0.3791 0.1378 265.5222);
28
+ --border: oklch(0.9022 0.0052 247.8822);
29
+ --input: oklch(0.97 0.0029 264.542);
30
+ --ring: oklch(0.6397 0.172 36.4421);
31
+ --destructive: oklch(0.6368 0.2078 25.3313);
32
+ --destructive-foreground: oklch(1 0 0);
33
+ --chart-1: oklch(0.7156 0.0605 248.6845);
34
+ --chart-2: oklch(0.7875 0.0917 35.9616);
35
+ --chart-3: oklch(0.5778 0.0759 254.1573);
36
+ --chart-4: oklch(0.5016 0.0849 259.4902);
37
+ --chart-5: oklch(0.4241 0.0952 264.0306);
38
+ --sidebar: oklch(0.903 0.0046 258.3257);
39
+ --sidebar-foreground: oklch(0.3211 0 0);
40
+ --sidebar-primary: oklch(0.6397 0.172 36.4421);
41
+ --sidebar-primary-foreground: oklch(1 0 0);
42
+ --sidebar-accent: oklch(0.9119 0.0222 243.8174);
43
+ --sidebar-accent-foreground: oklch(0.3791 0.1378 265.5222);
44
+ --sidebar-border: oklch(0.9276 0.0058 264.5313);
45
+ --sidebar-ring: oklch(0.6397 0.172 36.4421);
46
+ }
47
+
48
+ .dark {
49
+ --primary: oklch(0.6397 0.172 36.4421);
50
+ --primary-foreground: oklch(1 0 0);
51
+ --background: oklch(0.2598 0.0306 262.6666);
52
+ --foreground: oklch(0.9219 0 0);
53
+ --card: oklch(0.3106 0.0301 268.6365);
54
+ --card-foreground: oklch(0.9219 0 0);
55
+ --popover: oklch(0.29 0.0249 268.3986);
56
+ --popover-foreground: oklch(0.9219 0 0);
57
+ --secondary: oklch(0.3095 0.0266 266.7132);
58
+ --secondary-foreground: oklch(0.9219 0 0);
59
+ --muted: oklch(0.3095 0.0266 266.7132);
60
+ --muted-foreground: oklch(0.7155 0 0);
61
+ --accent: oklch(0.338 0.0589 267.5867);
62
+ --accent-foreground: oklch(0.8823 0.0571 254.1284);
63
+ --border: oklch(0.3843 0.0301 269.7337);
64
+ --input: oklch(0.3843 0.0301 269.7337);
65
+ --ring: oklch(0.6397 0.172 36.4421);
66
+ --destructive: oklch(0.6368 0.2078 25.3313);
67
+ --destructive-foreground: oklch(1 0 0);
68
+ --chart-1: oklch(0.7156 0.0605 248.6845);
69
+ --chart-2: oklch(0.7693 0.0876 34.1875);
70
+ --chart-3: oklch(0.5778 0.0759 254.1573);
71
+ --chart-4: oklch(0.5016 0.0849 259.4902);
72
+ --chart-5: oklch(0.4241 0.0952 264.0306);
73
+ --sidebar: oklch(0.31 0.0283 267.7408);
74
+ --sidebar-foreground: oklch(0.9219 0 0);
75
+ --sidebar-primary: oklch(0.6397 0.172 36.4421);
76
+ --sidebar-primary-foreground: oklch(1 0 0);
77
+ --sidebar-accent: oklch(0.338 0.0589 267.5867);
78
+ --sidebar-accent-foreground: oklch(0.8823 0.0571 254.1284);
79
+ --sidebar-border: oklch(0.3843 0.0301 269.7337);
80
+ --sidebar-ring: oklch(0.6397 0.172 36.4421);
81
+ }
@@ -0,0 +1,11 @@
1
+ import type { TocItem } from './types.js';
2
+ /**
3
+ * Scan a rendered content element for `h2`/`h3` headings and return a flat
4
+ * {@link TocItem} list (with a `depth` so the renderer can indent `h3`s). Only
5
+ * headings with an `id` are included, since ids (from rehype-slug) are what the
6
+ * in-page links point at.
7
+ *
8
+ * Pure and DOM-only, so it is trivially testable and safe to re-run after every
9
+ * navigation.
10
+ */
11
+ export declare function tocFromContent(container: HTMLElement, selector?: string): TocItem[];
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Scan a rendered content element for `h2`/`h3` headings and return a flat
3
+ * {@link TocItem} list (with a `depth` so the renderer can indent `h3`s). Only
4
+ * headings with an `id` are included, since ids (from rehype-slug) are what the
5
+ * in-page links point at.
6
+ *
7
+ * Pure and DOM-only, so it is trivially testable and safe to re-run after every
8
+ * navigation.
9
+ */
10
+ export function tocFromContent(container, selector = 'h2, h3') {
11
+ return Array.from(container.querySelectorAll(selector))
12
+ .filter((h) => h.id)
13
+ .map((h) => ({
14
+ id: h.id,
15
+ title: h.textContent?.trim() ?? '',
16
+ depth: h.tagName === 'H3' ? 3 : 2
17
+ }));
18
+ }
@@ -0,0 +1,3 @@
1
+ export * from './types.js';
2
+ export * from './from-content.js';
3
+ export * from './toc.svelte.js';
@@ -0,0 +1,3 @@
1
+ export * from './types.js';
2
+ export * from './from-content.js';
3
+ export * from './toc.svelte.js';
@@ -0,0 +1,26 @@
1
+ import type { TocItem } from './types.js';
2
+ /**
3
+ * A live table of contents: the headings scanned from the current page, plus
4
+ * the id of the section currently in view.
5
+ */
6
+ export type Toc = {
7
+ /** Headings of the current page, in document order. */
8
+ readonly items: TocItem[];
9
+ /** Id of the heading whose section is currently in view, or `null`. */
10
+ readonly activeId: string | null;
11
+ /** Re-scan the content element. Call after each navigation. */
12
+ refresh: () => Promise<void>;
13
+ };
14
+ /**
15
+ * Create a table of contents bound to a content element.
16
+ *
17
+ * Two jobs, both re-run whenever the page changes:
18
+ * - `refresh()` re-scans the rendered headings (call it from `afterNavigate` so
19
+ * client-side navigation updates the list, not just a full reload).
20
+ * - a single `IntersectionObserver` tracks which heading is in view for
21
+ * scroll-spy highlighting, re-observing the new headings after each refresh.
22
+ *
23
+ * Deliberately small: no section wrappers, no multi-threshold ratio math, no
24
+ * parent-highlight bookkeeping. One observer, one active id.
25
+ */
26
+ export declare function createToc(contentFn: () => HTMLElement | null): Toc;
@@ -0,0 +1,74 @@
1
+ import { BROWSER } from 'esm-env';
2
+ import { tick } from 'svelte';
3
+ import { tocFromContent } from './from-content.js';
4
+ /**
5
+ * Create a table of contents bound to a content element.
6
+ *
7
+ * Two jobs, both re-run whenever the page changes:
8
+ * - `refresh()` re-scans the rendered headings (call it from `afterNavigate` so
9
+ * client-side navigation updates the list, not just a full reload).
10
+ * - a single `IntersectionObserver` tracks which heading is in view for
11
+ * scroll-spy highlighting, re-observing the new headings after each refresh.
12
+ *
13
+ * Deliberately small: no section wrappers, no multi-threshold ratio math, no
14
+ * parent-highlight bookkeeping. One observer, one active id.
15
+ */
16
+ export function createToc(contentFn) {
17
+ let items = $state([]);
18
+ let activeId = $state(null);
19
+ async function refresh() {
20
+ // Wait for the navigated-to content to be in the DOM before scanning.
21
+ await tick();
22
+ const el = contentFn();
23
+ items = el ? tocFromContent(el) : [];
24
+ }
25
+ $effect(() => {
26
+ if (!BROWSER)
27
+ return;
28
+ const el = contentFn();
29
+ const headingItems = items; // re-run this effect when the heading set changes
30
+ if (!el || headingItems.length === 0) {
31
+ activeId = null;
32
+ return;
33
+ }
34
+ const headings = headingItems
35
+ .map((item) => el.querySelector(`#${CSS.escape(item.id)}`))
36
+ .filter((node) => node !== null);
37
+ const visible = new Set();
38
+ function recompute() {
39
+ // The first heading (in document order) inside the active band wins.
40
+ const firstVisible = headingItems.find((item) => visible.has(item.id));
41
+ if (firstVisible) {
42
+ activeId = firstVisible.id;
43
+ }
44
+ else if (activeId === null) {
45
+ // Nothing in the band yet (top of page): default to the first heading.
46
+ activeId = headingItems[0].id;
47
+ }
48
+ // Else keep the last active id — we're mid-section, between bands.
49
+ }
50
+ const observer = new IntersectionObserver((entries) => {
51
+ for (const entry of entries) {
52
+ if (entry.isIntersecting)
53
+ visible.add(entry.target.id);
54
+ else
55
+ visible.delete(entry.target.id);
56
+ }
57
+ recompute();
58
+ },
59
+ // Active band: just below the sticky header down to ~a third of the
60
+ // viewport, so the highlighted entry matches what you're reading.
61
+ { rootMargin: '-72px 0px -66% 0px', threshold: 0 });
62
+ headings.forEach((heading) => observer.observe(heading));
63
+ return () => observer.disconnect();
64
+ });
65
+ return {
66
+ get items() {
67
+ return items;
68
+ },
69
+ get activeId() {
70
+ return activeId;
71
+ },
72
+ refresh
73
+ };
74
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A table-of-contents entry: one heading scanned from the rendered page.
3
+ */
4
+ export type TocItem = {
5
+ /** The heading's `id` (from rehype-slug); the in-page link is `#${id}`. */
6
+ id: string;
7
+ /** Heading text. */
8
+ title: string;
9
+ /** Heading level: `2` for an `h2`, `3` for an `h3`. */
10
+ depth: 2 | 3;
11
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { Snippet } from 'svelte';
2
+ /**
3
+ * Adds a required `children` snippet to a props type.
4
+ */
5
+ export type WithChildren<T> = T & {
6
+ children: Snippet;
7
+ };
8
+ /**
9
+ * Adds an optional `children` snippet to a props type.
10
+ */
11
+ export type WithChildrenOptional<T> = T & {
12
+ children?: Snippet;
13
+ };
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ <script lang="ts">
2
+ import * as AccordionPrimitive from './shadcn/accordion/index.js';
3
+ import { nextAccordionValue } from './accordion.svelte';
4
+ import type { Snippet } from 'svelte';
5
+
6
+ const {
7
+ title,
8
+ children
9
+ }: {
10
+ /** The always-visible summary that toggles the panel. */
11
+ title: string;
12
+ children: Snippet;
13
+ } = $props();
14
+
15
+ // Claimed once at init, in document order, so it stays stable across renders.
16
+ const value = nextAccordionValue();
17
+ </script>
18
+
19
+ <AccordionPrimitive.Item {value}>
20
+ <AccordionPrimitive.Trigger>{title}</AccordionPrimitive.Trigger>
21
+ <AccordionPrimitive.Content>
22
+ {@render children()}
23
+ </AccordionPrimitive.Content>
24
+ </AccordionPrimitive.Item>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ /** The always-visible summary that toggles the panel. */
4
+ title: string;
5
+ children: Snippet;
6
+ };
7
+ declare const AccordionItem: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type AccordionItem = ReturnType<typeof AccordionItem>;
9
+ export default AccordionItem;
@@ -0,0 +1,45 @@
1
+ <script lang="ts" module>
2
+ import { getContext, setContext } from 'svelte';
3
+
4
+ const KEY = Symbol('docsmith-accordion');
5
+
6
+ type AccordionCtx = { count: number };
7
+
8
+ /**
9
+ * Called by each <AccordionItem> at init to claim a stable, sequential value
10
+ * so authors never have to pass one. Falls back to a random id when used
11
+ * outside an <Accordion> (still valid for bits-ui, just not grouped).
12
+ */
13
+ export function nextAccordionValue(): string {
14
+ const ctx = getContext<AccordionCtx | undefined>(KEY);
15
+ if (!ctx) return `item-${Math.random().toString(36).slice(2)}`;
16
+ ctx.count += 1;
17
+ return `item-${ctx.count}`;
18
+ }
19
+ </script>
20
+
21
+ <script lang="ts">
22
+ import * as AccordionPrimitive from './shadcn/accordion/index.js';
23
+ import type { Snippet } from 'svelte';
24
+
25
+ const {
26
+ multiple = false,
27
+ children
28
+ }: {
29
+ /** Allow several items open at once. Default: one at a time. */
30
+ multiple?: boolean;
31
+ children: Snippet;
32
+ } = $props();
33
+
34
+ setContext<AccordionCtx>(KEY, { count: 0 });
35
+ </script>
36
+
37
+ {#if multiple}
38
+ <AccordionPrimitive.Root type="multiple" class="my-6">
39
+ {@render children()}
40
+ </AccordionPrimitive.Root>
41
+ {:else}
42
+ <AccordionPrimitive.Root type="single" class="my-6">
43
+ {@render children()}
44
+ </AccordionPrimitive.Root>
45
+ {/if}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Called by each <AccordionItem> at init to claim a stable, sequential value
3
+ * so authors never have to pass one. Falls back to a random id when used
4
+ * outside an <Accordion> (still valid for bits-ui, just not grouped).
5
+ */
6
+ export declare function nextAccordionValue(): string;
7
+ import type { Snippet } from 'svelte';
8
+ type $$ComponentProps = {
9
+ /** Allow several items open at once. Default: one at a time. */
10
+ multiple?: boolean;
11
+ children: Snippet;
12
+ };
13
+ declare const Accordion: import("svelte").Component<$$ComponentProps, {}, "">;
14
+ type Accordion = ReturnType<typeof Accordion>;
15
+ export default Accordion;
@@ -0,0 +1,17 @@
1
+ <!-- Decorative page background: a faint grid fading out from the top, with two
2
+ soft primary/accent glows. Render it inside a `relative isolate` container. -->
3
+ <div
4
+ class="pointer-events-none absolute inset-0 -z-10 h-full w-full overflow-hidden"
5
+ aria-hidden="true"
6
+ >
7
+ <div
8
+ class="fixed inset-0 bg-[linear-gradient(to_right,#80808012_1px,transparent_1px),linear-gradient(to_bottom,#80808012_1px,transparent_1px)] bg-size-[24px_24px] mask-[radial-gradient(ellipse_80%_80%_at_50%_0%,#000_70%,transparent_100%)]"
9
+ ></div>
10
+
11
+ <div
12
+ class="bg-primary/20 pointer-events-none fixed top-0 left-1/2 h-[500px] w-[800px] -translate-x-1/2 rounded-full opacity-40 mix-blend-screen blur-[120px] dark:opacity-20 dark:mix-blend-normal"
13
+ ></div>
14
+ <div
15
+ class="bg-accent/25 pointer-events-none fixed top-28 left-1/2 h-[400px] w-[600px] -translate-x-1/2 rounded-full opacity-30 mix-blend-screen blur-[100px] dark:opacity-20 dark:mix-blend-normal"
16
+ ></div>
17
+ </div>
@@ -0,0 +1,26 @@
1
+ export default BackgroundPattern;
2
+ type BackgroundPattern = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const BackgroundPattern: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
14
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
15
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
16
+ $$bindings?: Bindings;
17
+ } & Exports;
18
+ (internal: unknown, props: {
19
+ $$events?: Events;
20
+ $$slots?: Slots;
21
+ }): Exports & {
22
+ $set?: any;
23
+ $on?: any;
24
+ };
25
+ z_$$bindings?: Bindings;
26
+ }