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.
- package/LICENSE +21 -0
- package/README.md +162 -0
- package/dist/clipboard.svelte.d.ts +6 -0
- package/dist/clipboard.svelte.js +27 -0
- package/dist/config.d.ts +79 -0
- package/dist/config.js +55 -0
- package/dist/content.d.ts +10 -0
- package/dist/content.js +4 -0
- package/dist/highlight.d.ts +17 -0
- package/dist/highlight.js +34 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +26 -0
- package/dist/markdown-layout.svelte +21 -0
- package/dist/markdown-layout.svelte.d.ts +18 -0
- package/dist/preprocess.d.ts +33 -0
- package/dist/preprocess.js +65 -0
- package/dist/shadcn.d.ts +12 -0
- package/dist/shadcn.js +5 -0
- package/dist/theme.css +201 -0
- package/dist/themes/amethyst.css +76 -0
- package/dist/themes/bubblegum.css +79 -0
- package/dist/themes/claude.css +79 -0
- package/dist/themes/evergreen.css +76 -0
- package/dist/themes/graphite.css +79 -0
- package/dist/themes/mono.css +79 -0
- package/dist/themes/nord.css +79 -0
- package/dist/themes/ocean.css +76 -0
- package/dist/themes/rose.css +78 -0
- package/dist/themes/tangerine.css +81 -0
- package/dist/toc/from-content.d.ts +11 -0
- package/dist/toc/from-content.js +18 -0
- package/dist/toc/index.d.ts +3 -0
- package/dist/toc/index.js +3 -0
- package/dist/toc/toc.svelte.d.ts +26 -0
- package/dist/toc/toc.svelte.js +74 -0
- package/dist/toc/types.d.ts +11 -0
- package/dist/toc/types.js +1 -0
- package/dist/types.d.ts +13 -0
- package/dist/types.js +1 -0
- package/dist/ui/accordion-item.svelte +24 -0
- package/dist/ui/accordion-item.svelte.d.ts +9 -0
- package/dist/ui/accordion.svelte +45 -0
- package/dist/ui/accordion.svelte.d.ts +15 -0
- package/dist/ui/background-pattern.svelte +17 -0
- package/dist/ui/background-pattern.svelte.d.ts +26 -0
- package/dist/ui/badge.svelte +54 -0
- package/dist/ui/badge.svelte.d.ts +12 -0
- package/dist/ui/callout.svelte +125 -0
- package/dist/ui/callout.svelte.d.ts +13 -0
- package/dist/ui/card-grid.svelte +10 -0
- package/dist/ui/card-grid.svelte.d.ts +7 -0
- package/dist/ui/card.svelte +52 -0
- package/dist/ui/card.svelte.d.ts +14 -0
- package/dist/ui/copy-button.svelte +30 -0
- package/dist/ui/copy-button.svelte.d.ts +9 -0
- package/dist/ui/file-tree-item.svelte +70 -0
- package/dist/ui/file-tree-item.svelte.d.ts +14 -0
- package/dist/ui/file-tree.svelte +34 -0
- package/dist/ui/file-tree.svelte.d.ts +7 -0
- package/dist/ui/icons/github.svelte +14 -0
- package/dist/ui/icons/github.svelte.d.ts +6 -0
- package/dist/ui/kbd.svelte +11 -0
- package/dist/ui/kbd.svelte.d.ts +7 -0
- package/dist/ui/layouts/breadcrumbs.svelte +37 -0
- package/dist/ui/layouts/breadcrumbs.svelte.d.ts +10 -0
- package/dist/ui/layouts/docs-footer.svelte +40 -0
- package/dist/ui/layouts/docs-footer.svelte.d.ts +7 -0
- package/dist/ui/layouts/docs-header.svelte +109 -0
- package/dist/ui/layouts/docs-header.svelte.d.ts +18 -0
- package/dist/ui/layouts/docs-mobile-header.svelte +106 -0
- package/dist/ui/layouts/docs-mobile-header.svelte.d.ts +18 -0
- package/dist/ui/layouts/docs-shell.svelte +133 -0
- package/dist/ui/layouts/docs-shell.svelte.d.ts +25 -0
- package/dist/ui/layouts/docs-sidebar.svelte +36 -0
- package/dist/ui/layouts/docs-sidebar.svelte.d.ts +8 -0
- package/dist/ui/layouts/prev-next-nav.svelte +32 -0
- package/dist/ui/layouts/prev-next-nav.svelte.d.ts +8 -0
- package/dist/ui/live-example.svelte +67 -0
- package/dist/ui/live-example.svelte.d.ts +10 -0
- package/dist/ui/markdown/code.svelte +11 -0
- package/dist/ui/markdown/code.svelte.d.ts +7 -0
- package/dist/ui/markdown/h2.svelte +13 -0
- package/dist/ui/markdown/h2.svelte.d.ts +4 -0
- package/dist/ui/markdown/h3.svelte +13 -0
- package/dist/ui/markdown/h3.svelte.d.ts +4 -0
- package/dist/ui/markdown/index.d.ts +5 -0
- package/dist/ui/markdown/index.js +5 -0
- package/dist/ui/markdown/pre.svelte +88 -0
- package/dist/ui/markdown/pre.svelte.d.ts +7 -0
- package/dist/ui/markdown/table.svelte +80 -0
- package/dist/ui/markdown/table.svelte.d.ts +7 -0
- package/dist/ui/markdown/types.d.ts +3 -0
- package/dist/ui/markdown/types.js +1 -0
- package/dist/ui/prop.svelte +130 -0
- package/dist/ui/prop.svelte.d.ts +16 -0
- package/dist/ui/props-table.svelte +127 -0
- package/dist/ui/props-table.svelte.d.ts +9 -0
- package/dist/ui/shadcn/accordion/accordion-content.svelte +27 -0
- package/dist/ui/shadcn/accordion/accordion-content.svelte.d.ts +4 -0
- package/dist/ui/shadcn/accordion/accordion-item.svelte +17 -0
- package/dist/ui/shadcn/accordion/accordion-item.svelte.d.ts +4 -0
- package/dist/ui/shadcn/accordion/accordion-trigger.svelte +38 -0
- package/dist/ui/shadcn/accordion/accordion-trigger.svelte.d.ts +8 -0
- package/dist/ui/shadcn/accordion/accordion.svelte +19 -0
- package/dist/ui/shadcn/accordion/accordion.svelte.d.ts +4 -0
- package/dist/ui/shadcn/accordion/index.d.ts +5 -0
- package/dist/ui/shadcn/accordion/index.js +7 -0
- package/dist/ui/shadcn/badge/badge.svelte +50 -0
- package/dist/ui/shadcn/badge/badge.svelte.d.ts +38 -0
- package/dist/ui/shadcn/badge/index.d.ts +2 -0
- package/dist/ui/shadcn/badge/index.js +2 -0
- package/dist/ui/shadcn/button/button.svelte +89 -0
- package/dist/ui/shadcn/button/button.svelte.d.ts +70 -0
- package/dist/ui/shadcn/button/index.d.ts +2 -0
- package/dist/ui/shadcn/button/index.js +4 -0
- package/dist/ui/shadcn/popover/index.d.ts +9 -0
- package/dist/ui/shadcn/popover/index.js +11 -0
- package/dist/ui/shadcn/popover/popover-close.svelte +7 -0
- package/dist/ui/shadcn/popover/popover-close.svelte.d.ts +4 -0
- package/dist/ui/shadcn/popover/popover-content.svelte +31 -0
- package/dist/ui/shadcn/popover/popover-content.svelte.d.ts +10 -0
- package/dist/ui/shadcn/popover/popover-description.svelte +20 -0
- package/dist/ui/shadcn/popover/popover-description.svelte.d.ts +5 -0
- package/dist/ui/shadcn/popover/popover-header.svelte +20 -0
- package/dist/ui/shadcn/popover/popover-header.svelte.d.ts +5 -0
- package/dist/ui/shadcn/popover/popover-portal.svelte +7 -0
- package/dist/ui/shadcn/popover/popover-portal.svelte.d.ts +3 -0
- package/dist/ui/shadcn/popover/popover-title.svelte +15 -0
- package/dist/ui/shadcn/popover/popover-title.svelte.d.ts +5 -0
- package/dist/ui/shadcn/popover/popover-trigger.svelte +17 -0
- package/dist/ui/shadcn/popover/popover-trigger.svelte.d.ts +4 -0
- package/dist/ui/shadcn/popover/popover.svelte +7 -0
- package/dist/ui/shadcn/popover/popover.svelte.d.ts +3 -0
- package/dist/ui/shadcn/scroll-area/index.d.ts +3 -0
- package/dist/ui/shadcn/scroll-area/index.js +5 -0
- package/dist/ui/shadcn/scroll-area/scroll-area-scrollbar.svelte +30 -0
- package/dist/ui/shadcn/scroll-area/scroll-area-scrollbar.svelte.d.ts +4 -0
- package/dist/ui/shadcn/scroll-area/scroll-area.svelte +43 -0
- package/dist/ui/shadcn/scroll-area/scroll-area.svelte.d.ts +11 -0
- package/dist/ui/shadcn/separator/index.d.ts +2 -0
- package/dist/ui/shadcn/separator/index.js +4 -0
- package/dist/ui/shadcn/separator/separator.svelte +23 -0
- package/dist/ui/shadcn/separator/separator.svelte.d.ts +4 -0
- package/dist/ui/shadcn/sheet/index.d.ts +11 -0
- package/dist/ui/shadcn/sheet/index.js +13 -0
- package/dist/ui/shadcn/sheet/sheet-close.svelte +7 -0
- package/dist/ui/shadcn/sheet/sheet-close.svelte.d.ts +4 -0
- package/dist/ui/shadcn/sheet/sheet-content.svelte +55 -0
- package/dist/ui/shadcn/sheet/sheet-content.svelte.d.ts +15 -0
- package/dist/ui/shadcn/sheet/sheet-description.svelte +17 -0
- package/dist/ui/shadcn/sheet/sheet-description.svelte.d.ts +4 -0
- package/dist/ui/shadcn/sheet/sheet-footer.svelte +20 -0
- package/dist/ui/shadcn/sheet/sheet-footer.svelte.d.ts +5 -0
- package/dist/ui/shadcn/sheet/sheet-header.svelte +20 -0
- package/dist/ui/shadcn/sheet/sheet-header.svelte.d.ts +5 -0
- package/dist/ui/shadcn/sheet/sheet-overlay.svelte +17 -0
- package/dist/ui/shadcn/sheet/sheet-overlay.svelte.d.ts +4 -0
- package/dist/ui/shadcn/sheet/sheet-portal.svelte +7 -0
- package/dist/ui/shadcn/sheet/sheet-portal.svelte.d.ts +3 -0
- package/dist/ui/shadcn/sheet/sheet-title.svelte +17 -0
- package/dist/ui/shadcn/sheet/sheet-title.svelte.d.ts +4 -0
- package/dist/ui/shadcn/sheet/sheet-trigger.svelte +7 -0
- package/dist/ui/shadcn/sheet/sheet-trigger.svelte.d.ts +4 -0
- package/dist/ui/shadcn/sheet/sheet.svelte +7 -0
- package/dist/ui/shadcn/sheet/sheet.svelte.d.ts +3 -0
- package/dist/ui/shadcn/tabs/index.d.ts +5 -0
- package/dist/ui/shadcn/tabs/index.js +7 -0
- package/dist/ui/shadcn/tabs/tabs-content.svelte +17 -0
- package/dist/ui/shadcn/tabs/tabs-content.svelte.d.ts +4 -0
- package/dist/ui/shadcn/tabs/tabs-list.svelte +40 -0
- package/dist/ui/shadcn/tabs/tabs-list.svelte.d.ts +25 -0
- package/dist/ui/shadcn/tabs/tabs-trigger.svelte +23 -0
- package/dist/ui/shadcn/tabs/tabs-trigger.svelte.d.ts +4 -0
- package/dist/ui/shadcn/tabs/tabs.svelte +19 -0
- package/dist/ui/shadcn/tabs/tabs.svelte.d.ts +4 -0
- package/dist/ui/step.svelte +82 -0
- package/dist/ui/step.svelte.d.ts +9 -0
- package/dist/ui/steps.svelte +71 -0
- package/dist/ui/steps.svelte.d.ts +7 -0
- package/dist/ui/tab-item.svelte +14 -0
- package/dist/ui/tab-item.svelte.d.ts +6 -0
- package/dist/ui/table-of-contents.svelte +114 -0
- package/dist/ui/table-of-contents.svelte.d.ts +9 -0
- package/dist/ui/tabs.svelte +29 -0
- package/dist/ui/tabs.svelte.d.ts +8 -0
- package/dist/ui/theme-provider.svelte +23 -0
- package/dist/ui/theme-provider.svelte.d.ts +10 -0
- package/dist/ui/theme-toggle.svelte +22 -0
- package/dist/ui/theme-toggle.svelte.d.ts +6 -0
- package/dist/vite.d.ts +32 -0
- package/dist/vite.js +216 -0
- package/package.json +115 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export type BadgeVariant =
|
|
3
|
+
| 'default'
|
|
4
|
+
| 'primary'
|
|
5
|
+
| 'secondary'
|
|
6
|
+
| 'success'
|
|
7
|
+
| 'warning'
|
|
8
|
+
| 'danger'
|
|
9
|
+
| 'outline';
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import type { Snippet } from 'svelte';
|
|
14
|
+
import {
|
|
15
|
+
Badge as ShadcnBadge,
|
|
16
|
+
type BadgeVariant as ShadcnVariant
|
|
17
|
+
} from './shadcn/badge/index.js';
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
variant = 'default',
|
|
21
|
+
href,
|
|
22
|
+
children
|
|
23
|
+
}: {
|
|
24
|
+
/** Visual intent. Default: `default`. */
|
|
25
|
+
variant?: BadgeVariant;
|
|
26
|
+
/** Turns the badge into a link. */
|
|
27
|
+
href?: string;
|
|
28
|
+
children: Snippet;
|
|
29
|
+
} = $props();
|
|
30
|
+
|
|
31
|
+
// Docs intents map onto the vendored shadcn badge. success/warning aren't
|
|
32
|
+
// shadcn variants, so they render on the `outline` base with token-driven
|
|
33
|
+
// colors layered on top (tailwind-merge lets the extra classes win).
|
|
34
|
+
const base: Record<BadgeVariant, ShadcnVariant> = {
|
|
35
|
+
default: 'secondary',
|
|
36
|
+
primary: 'default',
|
|
37
|
+
secondary: 'secondary',
|
|
38
|
+
success: 'outline',
|
|
39
|
+
warning: 'outline',
|
|
40
|
+
danger: 'destructive',
|
|
41
|
+
outline: 'outline'
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const extra: Partial<Record<BadgeVariant, string>> = {
|
|
45
|
+
success:
|
|
46
|
+
'border-transparent bg-emerald-500/10 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400',
|
|
47
|
+
warning:
|
|
48
|
+
'border-transparent bg-amber-500/10 text-amber-700 dark:bg-amber-500/15 dark:text-amber-400'
|
|
49
|
+
};
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<ShadcnBadge variant={base[variant]} {href} class={extra[variant]}>
|
|
53
|
+
{@render children()}
|
|
54
|
+
</ShadcnBadge>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type BadgeVariant = 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'outline';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
/** Visual intent. Default: `default`. */
|
|
5
|
+
variant?: BadgeVariant;
|
|
6
|
+
/** Turns the badge into a link. */
|
|
7
|
+
href?: string;
|
|
8
|
+
children: Snippet;
|
|
9
|
+
};
|
|
10
|
+
declare const Badge: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
11
|
+
type Badge = ReturnType<typeof Badge>;
|
|
12
|
+
export default Badge;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export type CalloutType = 'note' | 'tip' | 'warning' | 'danger';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import Info from '@lucide/svelte/icons/info';
|
|
7
|
+
import Lightbulb from '@lucide/svelte/icons/lightbulb';
|
|
8
|
+
import TriangleAlert from '@lucide/svelte/icons/triangle-alert';
|
|
9
|
+
import CircleAlert from '@lucide/svelte/icons/circle-alert';
|
|
10
|
+
import type { Component } from 'svelte';
|
|
11
|
+
import type { Snippet } from 'svelte';
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
type = 'note',
|
|
15
|
+
title,
|
|
16
|
+
children
|
|
17
|
+
}: {
|
|
18
|
+
/** Visual intent. Default: `note`. */
|
|
19
|
+
type?: CalloutType;
|
|
20
|
+
/** Optional heading; defaults to the capitalized type. */
|
|
21
|
+
title?: string;
|
|
22
|
+
children: Snippet;
|
|
23
|
+
} = $props();
|
|
24
|
+
|
|
25
|
+
const variants: Record<CalloutType, { icon: Component; label: string; klass: string }> = {
|
|
26
|
+
note: { icon: Info, label: 'Note', klass: 'callout-note' },
|
|
27
|
+
tip: { icon: Lightbulb, label: 'Tip', klass: 'callout-tip' },
|
|
28
|
+
warning: { icon: TriangleAlert, label: 'Warning', klass: 'callout-warning' },
|
|
29
|
+
danger: { icon: CircleAlert, label: 'Danger', klass: 'callout-danger' }
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const variant = $derived(variants[type]);
|
|
33
|
+
const Icon = $derived(variant.icon);
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<div role="note" class="not-prose callout {variant.klass}">
|
|
37
|
+
<Icon class="callout-icon" size={18} aria-hidden="true" />
|
|
38
|
+
<div class="callout-body">
|
|
39
|
+
<p class="callout-title">{title ?? variant.label}</p>
|
|
40
|
+
<div class="callout-content">{@render children()}</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<style>
|
|
45
|
+
.callout {
|
|
46
|
+
display: flex;
|
|
47
|
+
gap: 0.75rem;
|
|
48
|
+
margin: 1.5rem 0;
|
|
49
|
+
padding: 1rem 1.1rem;
|
|
50
|
+
border: 1px solid;
|
|
51
|
+
border-radius: var(--radius);
|
|
52
|
+
background: var(--callout-bg);
|
|
53
|
+
border-color: var(--callout-border);
|
|
54
|
+
}
|
|
55
|
+
:global(.callout .callout-icon) {
|
|
56
|
+
margin-top: 0.1rem;
|
|
57
|
+
flex-shrink: 0;
|
|
58
|
+
color: var(--callout-accent);
|
|
59
|
+
}
|
|
60
|
+
.callout-body {
|
|
61
|
+
min-width: 0;
|
|
62
|
+
}
|
|
63
|
+
.callout-title {
|
|
64
|
+
margin: 0;
|
|
65
|
+
font-weight: 600;
|
|
66
|
+
font-size: 0.875rem;
|
|
67
|
+
color: var(--callout-accent);
|
|
68
|
+
}
|
|
69
|
+
.callout-content {
|
|
70
|
+
margin-top: 0.25rem;
|
|
71
|
+
font-size: 0.9375rem;
|
|
72
|
+
line-height: 1.6;
|
|
73
|
+
color: var(--foreground);
|
|
74
|
+
}
|
|
75
|
+
.callout-content :global(:first-child) {
|
|
76
|
+
margin-top: 0;
|
|
77
|
+
}
|
|
78
|
+
.callout-content :global(:last-child) {
|
|
79
|
+
margin-bottom: 0;
|
|
80
|
+
}
|
|
81
|
+
.callout-content :global(a) {
|
|
82
|
+
color: var(--callout-accent);
|
|
83
|
+
text-decoration: underline;
|
|
84
|
+
text-underline-offset: 2px;
|
|
85
|
+
}
|
|
86
|
+
.callout-content :global(code) {
|
|
87
|
+
font-family: var(--font-mono);
|
|
88
|
+
font-size: 0.85em;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Tints are built from a single hue per type so light and dark both read
|
|
92
|
+
correctly; body copy stays on --foreground for contrast. */
|
|
93
|
+
.callout-note {
|
|
94
|
+
--callout-accent: oklch(0.58 0.13 250);
|
|
95
|
+
--callout-bg: oklch(0.58 0.13 250 / 0.08);
|
|
96
|
+
--callout-border: oklch(0.58 0.13 250 / 0.28);
|
|
97
|
+
}
|
|
98
|
+
.callout-tip {
|
|
99
|
+
--callout-accent: oklch(0.6 0.13 160);
|
|
100
|
+
--callout-bg: oklch(0.6 0.13 160 / 0.08);
|
|
101
|
+
--callout-border: oklch(0.6 0.13 160 / 0.28);
|
|
102
|
+
}
|
|
103
|
+
.callout-warning {
|
|
104
|
+
--callout-accent: oklch(0.62 0.14 75);
|
|
105
|
+
--callout-bg: oklch(0.62 0.14 75 / 0.1);
|
|
106
|
+
--callout-border: oklch(0.62 0.14 75 / 0.3);
|
|
107
|
+
}
|
|
108
|
+
.callout-danger {
|
|
109
|
+
--callout-accent: var(--destructive);
|
|
110
|
+
--callout-bg: oklch(0.64 0.21 25 / 0.08);
|
|
111
|
+
--callout-border: oklch(0.64 0.21 25 / 0.28);
|
|
112
|
+
}
|
|
113
|
+
:global(.dark) .callout-note {
|
|
114
|
+
--callout-accent: oklch(0.75 0.12 250);
|
|
115
|
+
}
|
|
116
|
+
:global(.dark) .callout-tip {
|
|
117
|
+
--callout-accent: oklch(0.78 0.13 160);
|
|
118
|
+
}
|
|
119
|
+
:global(.dark) .callout-warning {
|
|
120
|
+
--callout-accent: oklch(0.82 0.13 80);
|
|
121
|
+
}
|
|
122
|
+
:global(.dark) .callout-danger {
|
|
123
|
+
--callout-accent: oklch(0.72 0.17 25);
|
|
124
|
+
}
|
|
125
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type CalloutType = 'note' | 'tip' | 'warning' | 'danger';
|
|
2
|
+
import type { Component } from 'svelte';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
type $$ComponentProps = {
|
|
5
|
+
/** Visual intent. Default: `note`. */
|
|
6
|
+
type?: CalloutType;
|
|
7
|
+
/** Optional heading; defaults to the capitalized type. */
|
|
8
|
+
title?: string;
|
|
9
|
+
children: Snippet;
|
|
10
|
+
};
|
|
11
|
+
declare const Callout: Component<$$ComponentProps, {}, "">;
|
|
12
|
+
type Callout = ReturnType<typeof Callout>;
|
|
13
|
+
export default Callout;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
const { children }: { children: Snippet } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<!-- Breakpoint-free responsive grid of <Card>s. -->
|
|
8
|
+
<div class="not-prose my-6 grid gap-4 grid-cols-[repeat(auto-fit,minmax(15rem,1fr))]">
|
|
9
|
+
{@render children()}
|
|
10
|
+
</div>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ArrowRight from '@lucide/svelte/icons/arrow-right';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
title,
|
|
7
|
+
href,
|
|
8
|
+
external = false,
|
|
9
|
+
icon,
|
|
10
|
+
children
|
|
11
|
+
}: {
|
|
12
|
+
title: string;
|
|
13
|
+
/** Turns the card into a link. */
|
|
14
|
+
href?: string;
|
|
15
|
+
external?: boolean;
|
|
16
|
+
/** Optional leading icon. */
|
|
17
|
+
icon?: Snippet;
|
|
18
|
+
/** Card body / description. */
|
|
19
|
+
children?: Snippet;
|
|
20
|
+
} = $props();
|
|
21
|
+
|
|
22
|
+
const tag = $derived(href ? 'a' : 'div');
|
|
23
|
+
const rel = $derived(external ? 'noopener noreferrer' : undefined);
|
|
24
|
+
const target = $derived(external ? '_blank' : undefined);
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<svelte:element
|
|
28
|
+
this={tag}
|
|
29
|
+
{href}
|
|
30
|
+
{rel}
|
|
31
|
+
{target}
|
|
32
|
+
class="group not-prose flex flex-col gap-2 rounded-xl border border-border bg-card p-5 shadow-sm transition-colors {href
|
|
33
|
+
? 'hover:border-primary/40 focus-visible:border-primary/40 focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden'
|
|
34
|
+
: ''}"
|
|
35
|
+
>
|
|
36
|
+
{#if icon}
|
|
37
|
+
<div class="flex size-9 items-center justify-center rounded-lg bg-primary/10 text-primary">
|
|
38
|
+
{@render icon()}
|
|
39
|
+
</div>
|
|
40
|
+
{/if}
|
|
41
|
+
<div class="flex items-center gap-1.5">
|
|
42
|
+
<h3 class="font-semibold tracking-tight">{title}</h3>
|
|
43
|
+
{#if href}
|
|
44
|
+
<ArrowRight
|
|
45
|
+
class="size-4 text-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-primary"
|
|
46
|
+
/>
|
|
47
|
+
{/if}
|
|
48
|
+
</div>
|
|
49
|
+
{#if children}
|
|
50
|
+
<div class="text-sm leading-relaxed text-muted-foreground">{@render children()}</div>
|
|
51
|
+
{/if}
|
|
52
|
+
</svelte:element>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
/** Turns the card into a link. */
|
|
5
|
+
href?: string;
|
|
6
|
+
external?: boolean;
|
|
7
|
+
/** Optional leading icon. */
|
|
8
|
+
icon?: Snippet;
|
|
9
|
+
/** Card body / description. */
|
|
10
|
+
children?: Snippet;
|
|
11
|
+
};
|
|
12
|
+
declare const Card: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
13
|
+
type Card = ReturnType<typeof Card>;
|
|
14
|
+
export default Card;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Button } from './shadcn/button/index.js';
|
|
3
|
+
import Check from '@lucide/svelte/icons/check';
|
|
4
|
+
import Copy from '@lucide/svelte/icons/copy';
|
|
5
|
+
import { fade } from 'svelte/transition';
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
copied,
|
|
9
|
+
onclick,
|
|
10
|
+
class: className
|
|
11
|
+
}: {
|
|
12
|
+
/** Whether the copy just succeeded — swaps the icon to a check. */
|
|
13
|
+
copied: boolean;
|
|
14
|
+
onclick: () => void;
|
|
15
|
+
class?: string;
|
|
16
|
+
} = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<Button {onclick} variant="ghost" size="icon" class="size-8 {className ?? ''}">
|
|
20
|
+
{#if copied}
|
|
21
|
+
<div in:fade={{ duration: 80 }}>
|
|
22
|
+
<Check class="text-emerald-500" />
|
|
23
|
+
</div>
|
|
24
|
+
{:else}
|
|
25
|
+
<div in:fade={{ duration: 200 }}>
|
|
26
|
+
<Copy />
|
|
27
|
+
</div>
|
|
28
|
+
{/if}
|
|
29
|
+
<span class="sr-only">Copy</span>
|
|
30
|
+
</Button>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
/** Whether the copy just succeeded — swaps the icon to a check. */
|
|
3
|
+
copied: boolean;
|
|
4
|
+
onclick: () => void;
|
|
5
|
+
class?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const CopyButton: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
|
+
type CopyButton = ReturnType<typeof CopyButton>;
|
|
9
|
+
export default CopyButton;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Folder from '@lucide/svelte/icons/folder';
|
|
3
|
+
import FileIcon from '@lucide/svelte/icons/file';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
|
+
|
|
6
|
+
const {
|
|
7
|
+
name,
|
|
8
|
+
folder = false,
|
|
9
|
+
highlight = false,
|
|
10
|
+
children
|
|
11
|
+
}: {
|
|
12
|
+
/** File or directory name. */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Force folder styling for an empty directory (folders with children are detected automatically). */
|
|
15
|
+
folder?: boolean;
|
|
16
|
+
/** Emphasize this entry — e.g. the file a guide is about to create. */
|
|
17
|
+
highlight?: boolean;
|
|
18
|
+
/** Nested entries. Their presence marks this item as a folder. */
|
|
19
|
+
children?: Snippet;
|
|
20
|
+
} = $props();
|
|
21
|
+
|
|
22
|
+
const isFolder = $derived(folder || !!children);
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<li class="ft-item">
|
|
26
|
+
<span class="ft-label" class:ft-highlight={highlight}>
|
|
27
|
+
{#if isFolder}
|
|
28
|
+
<Folder class="ft-icon ft-icon-folder" size={15} aria-hidden="true" />
|
|
29
|
+
{:else}
|
|
30
|
+
<FileIcon class="ft-icon ft-icon-file" size={15} aria-hidden="true" />
|
|
31
|
+
{/if}
|
|
32
|
+
<span class="ft-name">{name}</span>
|
|
33
|
+
</span>
|
|
34
|
+
{#if children}
|
|
35
|
+
<ul>
|
|
36
|
+
{@render children()}
|
|
37
|
+
</ul>
|
|
38
|
+
{/if}
|
|
39
|
+
</li>
|
|
40
|
+
|
|
41
|
+
<style>
|
|
42
|
+
.ft-item {
|
|
43
|
+
margin: 0;
|
|
44
|
+
padding: 0;
|
|
45
|
+
}
|
|
46
|
+
.ft-label {
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: 0.45rem;
|
|
50
|
+
padding: 0.1rem 0.35rem;
|
|
51
|
+
border-radius: calc(var(--radius) - 2px);
|
|
52
|
+
}
|
|
53
|
+
.ft-highlight {
|
|
54
|
+
background: color-mix(in oklch, var(--primary) 12%, transparent);
|
|
55
|
+
color: var(--primary);
|
|
56
|
+
font-weight: 600;
|
|
57
|
+
}
|
|
58
|
+
:global(.filetree .ft-icon) {
|
|
59
|
+
flex-shrink: 0;
|
|
60
|
+
}
|
|
61
|
+
:global(.filetree .ft-icon-folder) {
|
|
62
|
+
color: var(--primary);
|
|
63
|
+
}
|
|
64
|
+
:global(.filetree .ft-icon-file) {
|
|
65
|
+
color: var(--muted-foreground);
|
|
66
|
+
}
|
|
67
|
+
.ft-name {
|
|
68
|
+
color: var(--foreground);
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
/** File or directory name. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** Force folder styling for an empty directory (folders with children are detected automatically). */
|
|
6
|
+
folder?: boolean;
|
|
7
|
+
/** Emphasize this entry — e.g. the file a guide is about to create. */
|
|
8
|
+
highlight?: boolean;
|
|
9
|
+
/** Nested entries. Their presence marks this item as a folder. */
|
|
10
|
+
children?: Snippet;
|
|
11
|
+
};
|
|
12
|
+
declare const FileTreeItem: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
13
|
+
type FileTreeItem = ReturnType<typeof FileTreeItem>;
|
|
14
|
+
export default FileTreeItem;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
const { children }: { children: Snippet } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<!--
|
|
8
|
+
A static project/directory tree for docs. Compose it from <FileTreeItem>s;
|
|
9
|
+
nesting is just nested items. Works in markdown and plain .svelte alike.
|
|
10
|
+
-->
|
|
11
|
+
<ul class="filetree not-prose">
|
|
12
|
+
{@render children()}
|
|
13
|
+
</ul>
|
|
14
|
+
|
|
15
|
+
<style>
|
|
16
|
+
.filetree {
|
|
17
|
+
margin: 1.5rem 0;
|
|
18
|
+
padding: 0.75rem 1rem;
|
|
19
|
+
list-style: none;
|
|
20
|
+
border: 1px solid var(--border);
|
|
21
|
+
border-radius: var(--radius);
|
|
22
|
+
background: var(--card);
|
|
23
|
+
font-family: var(--font-mono, ui-monospace, monospace);
|
|
24
|
+
font-size: 0.85rem;
|
|
25
|
+
line-height: 1.6;
|
|
26
|
+
}
|
|
27
|
+
.filetree :global(ul) {
|
|
28
|
+
list-style: none;
|
|
29
|
+
margin: 0;
|
|
30
|
+
padding-left: 1.05rem;
|
|
31
|
+
border-left: 1px solid var(--border);
|
|
32
|
+
margin-left: 0.5rem;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const { class: className = '' }: { class?: string } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
role="img"
|
|
7
|
+
fill="currentColor"
|
|
8
|
+
viewBox="0 0 24 24"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
class={className}
|
|
11
|
+
><title>GitHub</title><path
|
|
12
|
+
d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
const { children }: { children: Snippet } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<kbd
|
|
8
|
+
class="border-border bg-muted text-muted-foreground inline-flex min-w-[1.6em] items-center justify-center rounded-md border px-1.5 py-0.5 font-mono text-[0.75em] leading-none font-medium shadow-sm"
|
|
9
|
+
>
|
|
10
|
+
{@render children()}
|
|
11
|
+
</kbd>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ChevronRight from '@lucide/svelte/icons/chevron-right';
|
|
3
|
+
|
|
4
|
+
export type Crumb = { title: string; url?: string };
|
|
5
|
+
|
|
6
|
+
const { items = [] }: { items?: Crumb[] } = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
{#if items.length > 1}
|
|
10
|
+
<nav aria-label="Breadcrumb" class="mb-5">
|
|
11
|
+
<ol class="flex flex-wrap items-center gap-1.5 text-sm">
|
|
12
|
+
{#each items as crumb, i (crumb.title + i)}
|
|
13
|
+
{@const isLast = i === items.length - 1}
|
|
14
|
+
<li class="flex items-center gap-1.5">
|
|
15
|
+
{#if i > 0}
|
|
16
|
+
<ChevronRight class="text-muted-foreground/50 size-3.5 shrink-0" aria-hidden="true" />
|
|
17
|
+
{/if}
|
|
18
|
+
{#if crumb.url && !isLast}
|
|
19
|
+
<a
|
|
20
|
+
href={crumb.url}
|
|
21
|
+
class="text-muted-foreground hover:text-foreground rounded transition-colors"
|
|
22
|
+
>
|
|
23
|
+
{crumb.title}
|
|
24
|
+
</a>
|
|
25
|
+
{:else}
|
|
26
|
+
<span
|
|
27
|
+
class={isLast ? 'text-foreground font-medium' : 'text-muted-foreground'}
|
|
28
|
+
aria-current={isLast ? 'page' : undefined}
|
|
29
|
+
>
|
|
30
|
+
{crumb.title}
|
|
31
|
+
</span>
|
|
32
|
+
{/if}
|
|
33
|
+
</li>
|
|
34
|
+
{/each}
|
|
35
|
+
</ol>
|
|
36
|
+
</nav>
|
|
37
|
+
{/if}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type Crumb = {
|
|
2
|
+
title: string;
|
|
3
|
+
url?: string;
|
|
4
|
+
};
|
|
5
|
+
type $$ComponentProps = {
|
|
6
|
+
items?: Crumb[];
|
|
7
|
+
};
|
|
8
|
+
declare const Breadcrumbs: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type Breadcrumbs = ReturnType<typeof Breadcrumbs>;
|
|
10
|
+
export default Breadcrumbs;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { DocsmithConfig } from '../../config.js';
|
|
3
|
+
|
|
4
|
+
const { config }: { config: DocsmithConfig } = $props();
|
|
5
|
+
const footer = $derived(config.footer);
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#if footer}
|
|
9
|
+
<footer class="border-border/60 mt-16 border-t">
|
|
10
|
+
<div class="mx-auto max-w-7xl px-4 py-10 md:px-6 lg:px-8">
|
|
11
|
+
{#if footer.columns?.length}
|
|
12
|
+
<div class="mb-8 grid gap-8 grid-cols-[repeat(auto-fit,minmax(10rem,1fr))]">
|
|
13
|
+
{#each footer.columns as column (column.title)}
|
|
14
|
+
<div>
|
|
15
|
+
<p class="mb-3 text-sm font-semibold">{column.title}</p>
|
|
16
|
+
<ul class="space-y-2">
|
|
17
|
+
{#each column.links as link (link.href)}
|
|
18
|
+
<li>
|
|
19
|
+
<a
|
|
20
|
+
href={link.href}
|
|
21
|
+
target={link.external ? '_blank' : undefined}
|
|
22
|
+
rel={link.external ? 'noopener noreferrer' : undefined}
|
|
23
|
+
class="text-muted-foreground hover:text-foreground text-sm transition-colors"
|
|
24
|
+
>
|
|
25
|
+
{link.label}
|
|
26
|
+
</a>
|
|
27
|
+
</li>
|
|
28
|
+
{/each}
|
|
29
|
+
</ul>
|
|
30
|
+
</div>
|
|
31
|
+
{/each}
|
|
32
|
+
</div>
|
|
33
|
+
{/if}
|
|
34
|
+
|
|
35
|
+
{#if footer.copyright}
|
|
36
|
+
<p class="text-muted-foreground text-sm">{footer.copyright}</p>
|
|
37
|
+
{/if}
|
|
38
|
+
</div>
|
|
39
|
+
</footer>
|
|
40
|
+
{/if}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DocsmithConfig } from '../../config.js';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
config: DocsmithConfig;
|
|
4
|
+
};
|
|
5
|
+
declare const DocsFooter: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type DocsFooter = ReturnType<typeof DocsFooter>;
|
|
7
|
+
export default DocsFooter;
|