create-tauri-ui 0.3.1 → 0.3.2
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/package.json +55 -55
- package/templates/.shared/src-tauri/Cargo.lock +15 -12
- package/templates/next/package.json +3 -3
- package/templates/next/pnpm-lock.yaml +19 -19
- package/templates/next/src/components/menu.tsx +3 -2
- package/templates/next/src-tauri/Cargo.lock +3835 -3832
- package/templates/sveltekit/package.json +4 -4
- package/templates/sveltekit/pnpm-lock.yaml +95 -72
- package/templates/sveltekit/src/lib/components/docs/dashboard/DashboardPage.svelte +1 -17
- package/templates/sveltekit/src/lib/components/docs/index.ts +1 -18
- package/templates/sveltekit/src/routes/+layout.svelte +13 -65
- package/templates/sveltekit/src/routes/authentication/+page.svelte +2 -18
- package/templates/sveltekit/src/routes/cards/+page.svelte +1 -19
- package/templates/sveltekit/src-tauri/Cargo.lock +21 -18
- package/templates/sveltekit/src-tauri/tauri.conf.json +3 -3
- package/templates/sveltekit/tailwind.config.js +4 -1
- package/templates/sveltekit/vite.config.js +5 -3
- package/templates/vite/package.json +3 -3
- package/templates/vite/pnpm-lock.yaml +417 -419
- package/templates/vite/src-tauri/Cargo.lock +21 -18
- package/templates/sveltekit/src/content/cli.md +0 -63
- package/templates/sveltekit/src/content/components/accordion.md +0 -59
- package/templates/sveltekit/src/content/components/alert-dialog.md +0 -75
- package/templates/sveltekit/src/content/components/alert.md +0 -67
- package/templates/sveltekit/src/content/components/aspect-ratio.md +0 -51
- package/templates/sveltekit/src/content/components/avatar.md +0 -52
- package/templates/sveltekit/src/content/components/badge.md +0 -104
- package/templates/sveltekit/src/content/components/button.md +0 -165
- package/templates/sveltekit/src/content/components/card.md +0 -82
- package/templates/sveltekit/src/content/components/checkbox.md +0 -71
- package/templates/sveltekit/src/content/components/collapsible.md +0 -55
- package/templates/sveltekit/src/content/components/dialog.md +0 -72
- package/templates/sveltekit/src/content/components/hover-card.md +0 -52
- package/templates/sveltekit/src/content/components/input.md +0 -114
- package/templates/sveltekit/src/content/components/label.md +0 -49
- package/templates/sveltekit/src/content/components/progress.md +0 -49
- package/templates/sveltekit/src/content/components/radio-group.md +0 -59
- package/templates/sveltekit/src/content/components/separator.md +0 -49
- package/templates/sveltekit/src/content/components/sheet.md +0 -95
- package/templates/sveltekit/src/content/components/skeleton.md +0 -42
- package/templates/sveltekit/src/content/components/slider.md +0 -49
- package/templates/sveltekit/src/content/components/switch.md +0 -49
- package/templates/sveltekit/src/content/components/table.md +0 -78
- package/templates/sveltekit/src/content/components/tabs.md +0 -56
- package/templates/sveltekit/src/content/components/textarea.md +0 -102
- package/templates/sveltekit/src/content/components/toggle.md +0 -121
- package/templates/sveltekit/src/content/components/tooltip.md +0 -56
- package/templates/sveltekit/src/content/figma.md +0 -22
- package/templates/sveltekit/src/content/forms/superforms.md +0 -4
- package/templates/sveltekit/src/content/index.md +0 -84
- package/templates/sveltekit/src/content/installation.md +0 -327
- package/templates/sveltekit/src/content/theming.md +0 -189
- package/templates/sveltekit/src/content/typography.md +0 -150
- package/templates/sveltekit/src/lib/components/docs/Callout.svelte +0 -17
- package/templates/sveltekit/src/lib/components/docs/CodeBlockWrapper.svelte +0 -30
- package/templates/sveltekit/src/lib/components/docs/ComponentExample.svelte +0 -55
- package/templates/sveltekit/src/lib/components/docs/ComponentSource.svelte +0 -14
- package/templates/sveltekit/src/lib/components/docs/CopyButton.svelte +0 -39
- package/templates/sveltekit/src/lib/components/docs/DocsPager.svelte +0 -51
- package/templates/sveltekit/src/lib/components/docs/HexToChannels.svelte +0 -38
- package/templates/sveltekit/src/lib/components/docs/ManualInstall.svelte +0 -17
- package/templates/sveltekit/src/lib/components/docs/Metadata.svelte +0 -34
- package/templates/sveltekit/src/lib/components/docs/SiteFooter.svelte +0 -42
- package/templates/sveltekit/src/lib/components/docs/SiteHeader.svelte +0 -51
- package/templates/sveltekit/src/lib/components/docs/Steps.svelte +0 -3
- package/templates/sveltekit/src/lib/components/docs/TableOfContents.svelte +0 -55
- package/templates/sveltekit/src/lib/components/docs/Tree.svelte +0 -31
- package/templates/sveltekit/src/lib/components/docs/examples/accordion/AccordionDemo.svelte +0 -27
- package/templates/sveltekit/src/lib/components/docs/examples/accordion/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/alert/AlertDemo.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/examples/alert/AlertDemoDestructive.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/examples/alert/index.ts +0 -2
- package/templates/sveltekit/src/lib/components/docs/examples/alert-dialog/AlertDialogDemo.svelte +0 -33
- package/templates/sveltekit/src/lib/components/docs/examples/alert-dialog/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/aspect-ratio/AspectRatioDemo.svelte +0 -11
- package/templates/sveltekit/src/lib/components/docs/examples/aspect-ratio/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/avatar/AvatarDemo.svelte +0 -8
- package/templates/sveltekit/src/lib/components/docs/examples/avatar/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/badge/BadgeDemo.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/badge/BadgeDemoDestructive.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/badge/BadgeDemoOutline.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/badge/BadgeDemoSecondary.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/badge/index.ts +0 -4
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemo.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoDestructive.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoGhost.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoIcon.svelte +0 -9
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoLink.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoLoading.svelte +0 -9
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoOutline.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoSecondary.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/button/index.ts +0 -8
- package/templates/sveltekit/src/lib/components/docs/examples/card/CardDemo.svelte +0 -65
- package/templates/sveltekit/src/lib/components/docs/examples/card/CardDemoForm.svelte +0 -0
- package/templates/sveltekit/src/lib/components/docs/examples/card/index.ts +0 -2
- package/templates/sveltekit/src/lib/components/docs/examples/checkbox/CheckboxDemo.svelte +0 -13
- package/templates/sveltekit/src/lib/components/docs/examples/checkbox/CheckboxDemoDisabled.svelte +0 -13
- package/templates/sveltekit/src/lib/components/docs/examples/checkbox/CheckboxDemoText.svelte +0 -18
- package/templates/sveltekit/src/lib/components/docs/examples/checkbox/index.ts +0 -3
- package/templates/sveltekit/src/lib/components/docs/examples/collapsible/CollapsibleDemo.svelte +0 -24
- package/templates/sveltekit/src/lib/components/docs/examples/collapsible/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/dialog/DialogDemo.svelte +0 -41
- package/templates/sveltekit/src/lib/components/docs/examples/dialog/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/hover-card/HoverCardDemo.svelte +0 -28
- package/templates/sveltekit/src/lib/components/docs/examples/hover-card/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/index.ts +0 -27
- package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemo.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoButton.svelte +0 -9
- package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoDisabled.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoFile.svelte +0 -9
- package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoLabel.svelte +0 -9
- package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoText.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/examples/input/index.ts +0 -6
- package/templates/sveltekit/src/lib/components/docs/examples/label/LabelDemo.svelte +0 -11
- package/templates/sveltekit/src/lib/components/docs/examples/label/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/progress/ProgressDemo.svelte +0 -12
- package/templates/sveltekit/src/lib/components/docs/examples/progress/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/radio-group/RadioGroupDemo.svelte +0 -19
- package/templates/sveltekit/src/lib/components/docs/examples/radio-group/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/separator/SeparatorDemo.svelte +0 -18
- package/templates/sveltekit/src/lib/components/docs/examples/separator/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/sheet/SheetDemo.svelte +0 -44
- package/templates/sveltekit/src/lib/components/docs/examples/sheet/SheetPositionDemo.svelte +0 -62
- package/templates/sveltekit/src/lib/components/docs/examples/sheet/SheetSizeDemo.svelte +0 -62
- package/templates/sveltekit/src/lib/components/docs/examples/sheet/index.ts +0 -3
- package/templates/sveltekit/src/lib/components/docs/examples/skeleton/SkeletonDemo.svelte +0 -11
- package/templates/sveltekit/src/lib/components/docs/examples/skeleton/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/slider/SliderDemo.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/slider/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/switch/SwitchDemo.svelte +0 -9
- package/templates/sveltekit/src/lib/components/docs/examples/switch/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/table/TableDemo.svelte +0 -78
- package/templates/sveltekit/src/lib/components/docs/examples/table/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/tabs/TabsDemo.svelte +0 -67
- package/templates/sveltekit/src/lib/components/docs/examples/tabs/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemo.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemoButton.svelte +0 -9
- package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemoDisabled.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemoLabel.svelte +0 -9
- package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemoText.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/examples/textarea/index.ts +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemo.svelte +0 -8
- package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoDisabled.svelte +0 -8
- package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoLg.svelte +0 -8
- package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoOutline.svelte +0 -8
- package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoSm.svelte +0 -8
- package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoText.svelte +0 -9
- package/templates/sveltekit/src/lib/components/docs/examples/toggle/index.ts +0 -6
- package/templates/sveltekit/src/lib/components/docs/examples/tooltip/TooltipDemo.svelte +0 -19
- package/templates/sveltekit/src/lib/components/docs/examples/tooltip/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/typography/BlockquoteDemo.svelte +0 -4
- package/templates/sveltekit/src/lib/components/docs/examples/typography/H1Demo.svelte +0 -3
- package/templates/sveltekit/src/lib/components/docs/examples/typography/H2Demo.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/typography/H3Demo.svelte +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/typography/H4Demo.svelte +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/typography/InlineCodeDemo.svelte +0 -3
- package/templates/sveltekit/src/lib/components/docs/examples/typography/LargeDemo.svelte +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/typography/LeadDemo.svelte +0 -3
- package/templates/sveltekit/src/lib/components/docs/examples/typography/ListDemo.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/examples/typography/MutedDemo.svelte +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/typography/PDemo.svelte +0 -4
- package/templates/sveltekit/src/lib/components/docs/examples/typography/SmallDemo.svelte +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples/typography/TableDemo.svelte +0 -56
- package/templates/sveltekit/src/lib/components/docs/examples/typography/TypographyDemo.svelte +0 -117
- package/templates/sveltekit/src/lib/components/docs/examples/typography/index.ts +0 -14
- package/templates/sveltekit/src/lib/components/docs/mdsvex/a.svelte +0 -12
- package/templates/sveltekit/src/lib/components/docs/mdsvex/blockquote.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/mdsvex/h1.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/mdsvex/h2.svelte +0 -16
- package/templates/sveltekit/src/lib/components/docs/mdsvex/h3.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/mdsvex/h4.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/mdsvex/h5.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/mdsvex/h6.svelte +0 -13
- package/templates/sveltekit/src/lib/components/docs/mdsvex/hr.svelte +0 -8
- package/templates/sveltekit/src/lib/components/docs/mdsvex/img.svelte +0 -11
- package/templates/sveltekit/src/lib/components/docs/mdsvex/index.ts +0 -19
- package/templates/sveltekit/src/lib/components/docs/mdsvex/li.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/mdsvex/mdsvex.svelte +0 -37
- package/templates/sveltekit/src/lib/components/docs/mdsvex/ol.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/mdsvex/p.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/mdsvex/pre.svelte +0 -24
- package/templates/sveltekit/src/lib/components/docs/mdsvex/table.svelte +0 -12
- package/templates/sveltekit/src/lib/components/docs/mdsvex/td.svelte +0 -16
- package/templates/sveltekit/src/lib/components/docs/mdsvex/th.svelte +0 -16
- package/templates/sveltekit/src/lib/components/docs/mdsvex/tr.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/mdsvex/ul.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/nav/DocsSidebarNav.svelte +0 -24
- package/templates/sveltekit/src/lib/components/docs/nav/DocsSidebarNavItems.svelte +0 -43
- package/templates/sveltekit/src/lib/components/docs/nav/MainNav.svelte +0 -31
- package/templates/sveltekit/src/lib/components/docs/nav/MobileLink.svelte +0 -19
- package/templates/sveltekit/src/lib/components/docs/nav/MobileNav.svelte +0 -56
- package/templates/sveltekit/src/lib/components/docs/nav/index.ts +0 -4
- package/templates/sveltekit/src/lib/components/docs/page-header/PageHeader.svelte +0 -13
- package/templates/sveltekit/src/lib/components/docs/page-header/PageHeaderDescription.svelte +0 -13
- package/templates/sveltekit/src/lib/components/docs/page-header/PageHeaderHeading.svelte +0 -16
- package/templates/sveltekit/src/lib/components/docs/page-header/index.ts +0 -3
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Typography
|
|
3
|
-
description: Styles for headings, paragraphs, lists...etc
|
|
4
|
-
component: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import { BlockquoteDemo, H1Demo, H2Demo, H3Demo, H4Demo, InlineCodeDemo, LargeDemo, LeadDemo, ListDemo, MutedDemo, PDemo, SmallDemo, TableDemo2, TypographyDemo, ComponentExample } from "$components/docs"
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<ComponentExample
|
|
12
|
-
src="src/lib/components/docs/examples/typography/TypographyDemo.svelte">
|
|
13
|
-
|
|
14
|
-
<div slot="example" class="[&>div.min-h-[350px]]:p-6">
|
|
15
|
-
<TypographyDemo />
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
</ComponentExample>
|
|
19
|
-
|
|
20
|
-
## h1
|
|
21
|
-
|
|
22
|
-
<ComponentExample src="src/lib/components/docs/examples/typography/H1Demo.svelte" >
|
|
23
|
-
|
|
24
|
-
<div slot="example">
|
|
25
|
-
<H1Demo />
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
</ComponentExample>
|
|
29
|
-
|
|
30
|
-
## h2
|
|
31
|
-
|
|
32
|
-
<ComponentExample src="src/lib/components/docs/examples/typography/H2Demo.svelte">
|
|
33
|
-
|
|
34
|
-
<div slot="example">
|
|
35
|
-
<H2Demo />
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
</ComponentExample>
|
|
39
|
-
|
|
40
|
-
## h3
|
|
41
|
-
|
|
42
|
-
<ComponentExample src="src/lib/components/docs/examples/typography/H3Demo.svelte" >
|
|
43
|
-
|
|
44
|
-
<div slot="example">
|
|
45
|
-
<H3Demo />
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
</ComponentExample>
|
|
49
|
-
|
|
50
|
-
## h4
|
|
51
|
-
|
|
52
|
-
<ComponentExample src="src/lib/components/docs/examples/typography/H4Demo.svelte" >
|
|
53
|
-
|
|
54
|
-
<div slot="example">
|
|
55
|
-
<H4Demo />
|
|
56
|
-
</div>
|
|
57
|
-
|
|
58
|
-
</ComponentExample>
|
|
59
|
-
|
|
60
|
-
## p
|
|
61
|
-
|
|
62
|
-
<ComponentExample src="src/lib/components/docs/examples/typography/PDemo.svelte">
|
|
63
|
-
|
|
64
|
-
<div slot="example">
|
|
65
|
-
<PDemo />
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
</ComponentExample>
|
|
69
|
-
|
|
70
|
-
## blockquote
|
|
71
|
-
|
|
72
|
-
<ComponentExample src="src/lib/components/docs/examples/typography/BlockquoteDemo.svelte">
|
|
73
|
-
|
|
74
|
-
<div slot="example">
|
|
75
|
-
<BlockquoteDemo />
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
</ComponentExample>
|
|
79
|
-
|
|
80
|
-
## table
|
|
81
|
-
|
|
82
|
-
<ComponentExample src="src/lib/components/docs/examples/typography/TableDemo.svelte">
|
|
83
|
-
|
|
84
|
-
<div slot="example">
|
|
85
|
-
<TableDemo2 />
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
</ComponentExample>
|
|
89
|
-
|
|
90
|
-
## list
|
|
91
|
-
|
|
92
|
-
<ComponentExample src="src/lib/components/docs/examples/typography/ListDemo.svelte">
|
|
93
|
-
|
|
94
|
-
<div slot="example">
|
|
95
|
-
<ListDemo />
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
</ComponentExample>
|
|
99
|
-
|
|
100
|
-
## Inline code
|
|
101
|
-
|
|
102
|
-
<ComponentExample
|
|
103
|
-
src="src/lib/components/docs/examples/typography/InlineCodeDemo.svelte">
|
|
104
|
-
|
|
105
|
-
<div slot="example">
|
|
106
|
-
<InlineCodeDemo />
|
|
107
|
-
</div>
|
|
108
|
-
|
|
109
|
-
</ComponentExample>
|
|
110
|
-
|
|
111
|
-
## Lead
|
|
112
|
-
|
|
113
|
-
<ComponentExample src="src/lib/components/docs/examples/typography/LeadDemo.svelte">
|
|
114
|
-
|
|
115
|
-
<div slot="example">
|
|
116
|
-
<LeadDemo />
|
|
117
|
-
</div>
|
|
118
|
-
|
|
119
|
-
</ComponentExample>
|
|
120
|
-
|
|
121
|
-
## Large
|
|
122
|
-
|
|
123
|
-
<ComponentExample src="src/lib/components/docs/examples/typography/LargeDemo.svelte">
|
|
124
|
-
|
|
125
|
-
<div slot="example">
|
|
126
|
-
<LargeDemo />
|
|
127
|
-
</div>
|
|
128
|
-
|
|
129
|
-
</ComponentExample>
|
|
130
|
-
|
|
131
|
-
## Small
|
|
132
|
-
|
|
133
|
-
<ComponentExample
|
|
134
|
-
src="src/lib/components/docs/examples/typography/SmallDemo.svelte">
|
|
135
|
-
|
|
136
|
-
<div slot="example">
|
|
137
|
-
<SmallDemo />
|
|
138
|
-
</div>
|
|
139
|
-
|
|
140
|
-
</ComponentExample>
|
|
141
|
-
|
|
142
|
-
## Muted
|
|
143
|
-
|
|
144
|
-
<ComponentExample src="src/lib/components/docs/examples/typography/MutedDemo.svelte">
|
|
145
|
-
|
|
146
|
-
<div slot="example">
|
|
147
|
-
<MutedDemo />
|
|
148
|
-
</div>
|
|
149
|
-
|
|
150
|
-
</ComponentExample>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Alert, AlertDescription, AlertTitle } from '$components/ui/alert';
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<Alert {...$$restProps} class="mt-2">
|
|
6
|
-
{#if $$slots.icon}
|
|
7
|
-
<span class="mr-4 text-2xl">
|
|
8
|
-
<slot name="icon" />
|
|
9
|
-
</span>
|
|
10
|
-
{/if}
|
|
11
|
-
<AlertTitle>
|
|
12
|
-
<slot name="title" />
|
|
13
|
-
</AlertTitle>
|
|
14
|
-
<AlertDescription>
|
|
15
|
-
<slot />
|
|
16
|
-
</AlertDescription>
|
|
17
|
-
</Alert>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { buttonVariants } from '$components/ui/button';
|
|
3
|
-
import { Collapsible, CollapsibleTrigger } from '$components/ui/collapsible';
|
|
4
|
-
import { cn } from '$lib/utils';
|
|
5
|
-
|
|
6
|
-
let className: string | undefined | null = undefined;
|
|
7
|
-
export { className as class };
|
|
8
|
-
export let expandButtonTitle = 'View Code';
|
|
9
|
-
let open = false;
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<Collapsible bind:open>
|
|
13
|
-
<div class={cn('relative mb-4 overflow-hidden rounded-md', className)} {...$$restProps}>
|
|
14
|
-
<div class={cn('h-full overflow-hidden', !open && 'max-h-32')}>
|
|
15
|
-
<slot />
|
|
16
|
-
</div>
|
|
17
|
-
<div
|
|
18
|
-
class={cn(
|
|
19
|
-
'absolute flex items-center justify-center bg-gradient-to-b from-background/30 to-muted/90 p-2',
|
|
20
|
-
open ? 'inset-x-0 bottom-0 h-12' : 'inset-0'
|
|
21
|
-
)}
|
|
22
|
-
>
|
|
23
|
-
<span class={!open ? 'pt-4' : ''}>
|
|
24
|
-
<CollapsibleTrigger class={cn(buttonVariants({ variant: 'secondary' }), 'h-8 text-xs')}>
|
|
25
|
-
{open ? 'Collapse' : expandButtonTitle}
|
|
26
|
-
</CollapsibleTrigger>
|
|
27
|
-
</span>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</Collapsible>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { CopyButton } from '$components/docs';
|
|
3
|
-
import { Tabs, TabsContent, TabsList, TabsTrigger } from '$components/ui/tabs';
|
|
4
|
-
import { cn } from '$lib/utils';
|
|
5
|
-
|
|
6
|
-
let codeString: string;
|
|
7
|
-
|
|
8
|
-
function copyCodeToClipboard(node: HTMLElement) {
|
|
9
|
-
codeString = node.innerText ?? '';
|
|
10
|
-
}
|
|
11
|
-
let className: string | undefined | null = undefined;
|
|
12
|
-
export { className as class };
|
|
13
|
-
export let align: 'start' | 'center' | 'end' = 'center';
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<div class={cn('group relative my-4 flex flex-col space-y-2', className)} {...$$restProps}>
|
|
17
|
-
<Tabs value="preview" class="relative mr-auto w-full">
|
|
18
|
-
<div class="flex items-center justify-between pb-3">
|
|
19
|
-
<TabsList class="w-full justify-start rounded-none border-b bg-transparent p-0">
|
|
20
|
-
<TabsTrigger
|
|
21
|
-
value="preview"
|
|
22
|
-
class="relative rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 font-semibold text-muted-foreground shadow-none transition-none data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none"
|
|
23
|
-
>
|
|
24
|
-
Preview
|
|
25
|
-
</TabsTrigger>
|
|
26
|
-
<TabsTrigger
|
|
27
|
-
value="code"
|
|
28
|
-
class="relative rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 font-semibold text-muted-foreground shadow-none transition-none data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none"
|
|
29
|
-
>
|
|
30
|
-
Code
|
|
31
|
-
</TabsTrigger>
|
|
32
|
-
</TabsList>
|
|
33
|
-
</div>
|
|
34
|
-
<TabsContent value="preview" class="rounded-md border">
|
|
35
|
-
<div
|
|
36
|
-
class={cn('flex min-h-[350px] justify-center p-10', {
|
|
37
|
-
'items-center': align === 'center',
|
|
38
|
-
'items-start': align === 'start',
|
|
39
|
-
'items-end': align === 'end'
|
|
40
|
-
})}
|
|
41
|
-
>
|
|
42
|
-
<slot name="example" />
|
|
43
|
-
</div>
|
|
44
|
-
</TabsContent>
|
|
45
|
-
<TabsContent value="code">
|
|
46
|
-
<CopyButton value={codeString} class="absolute right-4 top-20" />
|
|
47
|
-
<div
|
|
48
|
-
class="w-full rounded-md [&_button]:hidden [&_pre]:my-0 [&_pre]:max-h-[350px] [&_pre]:overflow-auto"
|
|
49
|
-
use:copyCodeToClipboard
|
|
50
|
-
>
|
|
51
|
-
<slot />
|
|
52
|
-
</div>
|
|
53
|
-
</TabsContent>
|
|
54
|
-
</Tabs>
|
|
55
|
-
</div>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { CodeBlockWrapper } from '$components/docs';
|
|
3
|
-
import { cn } from '$lib/utils';
|
|
4
|
-
|
|
5
|
-
let className: string | undefined | null = undefined;
|
|
6
|
-
export { className as class };
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<CodeBlockWrapper
|
|
10
|
-
expandButtonTitle="Expand"
|
|
11
|
-
class={cn('my-6 overflow-hidden rounded-md', className)}
|
|
12
|
-
>
|
|
13
|
-
<slot />
|
|
14
|
-
</CodeBlockWrapper>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { clickToCopyAction } from 'svelte-legos';
|
|
3
|
-
import { cn } from '$lib/utils';
|
|
4
|
-
import { Icons } from './icons';
|
|
5
|
-
|
|
6
|
-
let copied = false;
|
|
7
|
-
let className: string | undefined | null = undefined;
|
|
8
|
-
export let value = '';
|
|
9
|
-
export { className as class };
|
|
10
|
-
|
|
11
|
-
function handleCopyDone() {
|
|
12
|
-
copied = true;
|
|
13
|
-
setTimeout(() => {
|
|
14
|
-
copied = false;
|
|
15
|
-
}, 1000);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function handleCopyError() {
|
|
19
|
-
console.log('Error copying');
|
|
20
|
-
}
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<button
|
|
24
|
-
class={cn(
|
|
25
|
-
'relative z-20 inline-flex h-6 w-6 items-center justify-center rounded-md border bg-background text-sm font-medium transition-all hover:bg-muted focus:outline-none',
|
|
26
|
-
className
|
|
27
|
-
)}
|
|
28
|
-
use:clickToCopyAction={value}
|
|
29
|
-
on:copy-done={handleCopyDone}
|
|
30
|
-
on:copy-error={handleCopyError}
|
|
31
|
-
{...$$restProps}
|
|
32
|
-
>
|
|
33
|
-
<span class="sr-only">Copy</span>
|
|
34
|
-
{#if copied}
|
|
35
|
-
<Icons.check class="h-3 w-3" />
|
|
36
|
-
{:else}
|
|
37
|
-
<Icons.copy class="h-3 w-3" />
|
|
38
|
-
{/if}
|
|
39
|
-
</button>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { NavItem, NavItemWithChildren } from '$lib/types/nav';
|
|
3
|
-
import { page } from '$app/stores';
|
|
4
|
-
import { Button } from '$components/ui/button';
|
|
5
|
-
import { docsConfig } from '$lib/config/docs';
|
|
6
|
-
import { Icons } from './icons';
|
|
7
|
-
|
|
8
|
-
let pager: ReturnType<typeof getPagerForDoc>;
|
|
9
|
-
|
|
10
|
-
function getPagerForDoc(slug: string) {
|
|
11
|
-
const flattenedLinks = [null, ...flatten(docsConfig.sidebarNav), null];
|
|
12
|
-
let activeIndex: number;
|
|
13
|
-
if (!slug) {
|
|
14
|
-
activeIndex = 1;
|
|
15
|
-
} else {
|
|
16
|
-
activeIndex = flattenedLinks.findIndex((link) => `/docs/${slug}` === link?.href);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const prev = activeIndex !== 0 ? flattenedLinks[activeIndex - 1] : null;
|
|
20
|
-
const next = activeIndex !== flattenedLinks.length - 1 ? flattenedLinks[activeIndex + 1] : null;
|
|
21
|
-
return {
|
|
22
|
-
prev,
|
|
23
|
-
next
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function flatten(links: NavItemWithChildren[]): NavItem[] {
|
|
28
|
-
return links
|
|
29
|
-
.reduce<NavItem[]>((flat, link) => {
|
|
30
|
-
return flat.concat(link.items?.length ? flatten(link.items) : link);
|
|
31
|
-
}, [])
|
|
32
|
-
.filter((link) => !link?.disabled);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
$: pager = getPagerForDoc($page.params.slug);
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<div class="flex flex-row items-center justify-between">
|
|
39
|
-
{#if pager?.prev?.href}
|
|
40
|
-
<Button href={pager.prev.href} variant="outline">
|
|
41
|
-
<Icons.chevronLeft class="mr-2 h-4 w-4" />
|
|
42
|
-
{pager.prev.title}
|
|
43
|
-
</Button>
|
|
44
|
-
{/if}
|
|
45
|
-
{#if pager?.next?.href}
|
|
46
|
-
<Button href={pager.next.href} variant="outline">
|
|
47
|
-
{pager.next.title}
|
|
48
|
-
<Icons.chevronRight class="ml-2 h-4 w-4" />
|
|
49
|
-
</Button>
|
|
50
|
-
{/if}
|
|
51
|
-
</div>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Input } from '$components/ui/input';
|
|
3
|
-
import { Label } from '$components/ui/label';
|
|
4
|
-
import { hexToHsl, hexToRgb } from '$lib/utils';
|
|
5
|
-
import { CopyButton } from '.';
|
|
6
|
-
|
|
7
|
-
let hex = '#030711';
|
|
8
|
-
let hsl: [number, number, number] = [0, 0, 0];
|
|
9
|
-
let rgb: [number, number, number] = [0, 0, 0];
|
|
10
|
-
$: if (hex && ((hex.length === 6 && hex[0] !== '#') || (hex.length === 7 && hex[0] === '#'))) {
|
|
11
|
-
hsl = hexToHsl(hex);
|
|
12
|
-
rgb = hexToRgb(hex);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
$: hslString = `${hsl[0]} ${hsl[1]}% ${hsl[2]}%`;
|
|
16
|
-
$: rgbString = `${rgb[0]} ${rgb[1]} ${rgb[2]}`;
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<div
|
|
20
|
-
class="mt-2 flex h-[300px] items-center justify-center rounded-md border ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
21
|
-
>
|
|
22
|
-
<div class="mx-auto w-full max-w-sm space-y-6 py-4">
|
|
23
|
-
<div class="grid gap-2">
|
|
24
|
-
<Label for="hex">HEX</Label>
|
|
25
|
-
<Input name="hex" bind:value={hex} maxlength="7" />
|
|
26
|
-
</div>
|
|
27
|
-
<div class="relative grid gap-2">
|
|
28
|
-
<CopyButton class="absolute right-2 top-[30px]" value={hslString} />
|
|
29
|
-
<Label for="hsl">HSL</Label>
|
|
30
|
-
<Input name="hsl" value={hslString} readonly />
|
|
31
|
-
</div>
|
|
32
|
-
<div class="relative grid gap-2">
|
|
33
|
-
<CopyButton class="absolute right-2 top-[30px]" value={rgbString} />
|
|
34
|
-
<Label for="rgb">RGB</Label>
|
|
35
|
-
<Input name="rgb" value={rgbString} readonly />
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
Accordion,
|
|
4
|
-
AccordionContent,
|
|
5
|
-
AccordionItem,
|
|
6
|
-
AccordionTrigger
|
|
7
|
-
} from '$components/ui/accordion';
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<Accordion type="single" collapsible>
|
|
11
|
-
<AccordionItem value="manual-installation">
|
|
12
|
-
<AccordionTrigger>Manual Installation</AccordionTrigger>
|
|
13
|
-
<AccordionContent>
|
|
14
|
-
<slot />
|
|
15
|
-
</AccordionContent>
|
|
16
|
-
</AccordionItem>
|
|
17
|
-
</Accordion>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { page } from '$app/stores';
|
|
3
|
-
import { siteConfig } from '$lib/config/site';
|
|
4
|
-
|
|
5
|
-
export let title: string = siteConfig.name;
|
|
6
|
-
|
|
7
|
-
$: title = $page.data?.title ? `${$page.data.title} - ${siteConfig.name}` : siteConfig.name;
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<svelte:head>
|
|
11
|
-
<title>{title}</title>
|
|
12
|
-
<meta name="description" content={siteConfig.description} />
|
|
13
|
-
<meta name="keywords" content={siteConfig.keywords} />
|
|
14
|
-
<meta name="author" content="huntabyte" />
|
|
15
|
-
<meta name="twitter:card" content="summary_large_image" />
|
|
16
|
-
<meta name="twitter:site" content={siteConfig.url} />
|
|
17
|
-
<meta name="twitter:title" content={title} />
|
|
18
|
-
<meta name="twitter:description" content={siteConfig.description} />
|
|
19
|
-
<meta name="twitter:image" content="https://shadcn-svelte.com/og.jpg" />
|
|
20
|
-
<meta name="twitter:image:alt" content={siteConfig.name} />
|
|
21
|
-
<meta name="twitter:creator" content="huntabyte" />
|
|
22
|
-
<meta property="og:title" content={title} />
|
|
23
|
-
<meta property="og:type" content="article" />
|
|
24
|
-
<meta property="og:url" content={siteConfig.url + $page.url.pathname} />
|
|
25
|
-
<meta property="og:image" content="https://shadcn-svelte.com/og.jpg" />
|
|
26
|
-
<meta property="og:image:alt" content={siteConfig.name} />
|
|
27
|
-
<meta property="og:image:width" content="1200" />
|
|
28
|
-
<meta property="og:image:height" content="630" />
|
|
29
|
-
<meta property="og:description" content={siteConfig.description} />
|
|
30
|
-
<meta property="og:site_name" content={siteConfig.name} />
|
|
31
|
-
<meta property="og:locale" content="EN_US" />
|
|
32
|
-
<link rel="shortcut icon" href="/favicon-16x16.png" />
|
|
33
|
-
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
34
|
-
</svelte:head>
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { siteConfig } from '$lib/config/site';
|
|
3
|
-
import { Icons } from './icons';
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<footer class="border-t py-6 md:py-0">
|
|
7
|
-
<div class="container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row">
|
|
8
|
-
<div class="flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0">
|
|
9
|
-
<Icons.logo class="hidden h-6 w-6 md:inline-block" />
|
|
10
|
-
<p class="text-center text-sm leading-loose text-muted-foreground md:text-left">
|
|
11
|
-
Built & designed by{' '}
|
|
12
|
-
<a
|
|
13
|
-
href={siteConfig.links.shadTwitter}
|
|
14
|
-
target="_blank"
|
|
15
|
-
rel="noreferrer"
|
|
16
|
-
class="font-medium underline underline-offset-4"
|
|
17
|
-
>
|
|
18
|
-
shadcn
|
|
19
|
-
</a>
|
|
20
|
-
. Ported to Svelte by{' '}
|
|
21
|
-
<a
|
|
22
|
-
href={siteConfig.links.twitter}
|
|
23
|
-
target="_blank"
|
|
24
|
-
rel="noreferrer"
|
|
25
|
-
class="font-medium underline underline-offset-4"
|
|
26
|
-
>
|
|
27
|
-
huntabyte
|
|
28
|
-
</a>
|
|
29
|
-
. The source code is available on{' '}
|
|
30
|
-
<a
|
|
31
|
-
href={siteConfig.links.github}
|
|
32
|
-
target="_blank"
|
|
33
|
-
rel="noreferrer"
|
|
34
|
-
class="font-medium underline underline-offset-4"
|
|
35
|
-
>
|
|
36
|
-
GitHub
|
|
37
|
-
</a>
|
|
38
|
-
.
|
|
39
|
-
</p>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</footer>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Icons, LightSwitch, MainNav, MobileNav } from '$components/docs';
|
|
3
|
-
import { buttonVariants } from '$components/ui/button';
|
|
4
|
-
import { siteConfig } from '$lib/config/site';
|
|
5
|
-
import { cn } from '$lib/utils';
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<header
|
|
9
|
-
class="supports-backdrop-blur:bg-background/60 sticky top-0 z-40 w-full border-b bg-background/95 shadow-sm backdrop-blur"
|
|
10
|
-
>
|
|
11
|
-
<div class="container flex h-14 items-center">
|
|
12
|
-
<MainNav />
|
|
13
|
-
<MobileNav />
|
|
14
|
-
<div class="flex flex-1 items-center justify-between space-x-2 sm:space-x-4 md:justify-end">
|
|
15
|
-
<div class="w-full flex-1 md:w-auto md:flex-none">
|
|
16
|
-
<!-- Command Menu Here -->
|
|
17
|
-
</div>
|
|
18
|
-
<nav class="flex items-center space-x-1">
|
|
19
|
-
<a href={siteConfig.links.github} target="_blank" rel="noreferrer">
|
|
20
|
-
<div
|
|
21
|
-
class={cn(
|
|
22
|
-
buttonVariants({
|
|
23
|
-
size: 'sm',
|
|
24
|
-
variant: 'ghost'
|
|
25
|
-
}),
|
|
26
|
-
'w-9 px-0'
|
|
27
|
-
)}
|
|
28
|
-
>
|
|
29
|
-
<Icons.gitHub class="h-5 w-5" />
|
|
30
|
-
<span class="sr-only">GitHub</span>
|
|
31
|
-
</div>
|
|
32
|
-
</a>
|
|
33
|
-
<a href={siteConfig.links.shadTwitter} target="_blank" rel="noreferrer">
|
|
34
|
-
<div
|
|
35
|
-
class={cn(
|
|
36
|
-
buttonVariants({
|
|
37
|
-
size: 'sm',
|
|
38
|
-
variant: 'ghost'
|
|
39
|
-
}),
|
|
40
|
-
'w-9 px-0'
|
|
41
|
-
)}
|
|
42
|
-
>
|
|
43
|
-
<Icons.twitter class="h-5 w-5 fill-current" />
|
|
44
|
-
<span class="sr-only">Twitter</span>
|
|
45
|
-
</div>
|
|
46
|
-
</a>
|
|
47
|
-
<LightSwitch />
|
|
48
|
-
</nav>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</header>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { TableOfContents, TableOfContentsItem } from '$lib/types/docs';
|
|
3
|
-
import { onMount } from 'svelte';
|
|
4
|
-
import { Tree } from '$components/docs';
|
|
5
|
-
|
|
6
|
-
let filteredHeadingsList: TableOfContents;
|
|
7
|
-
|
|
8
|
-
function getHeadingsWithHierarchy(divId: string) {
|
|
9
|
-
const div = document.getElementById(divId);
|
|
10
|
-
|
|
11
|
-
if (!div) {
|
|
12
|
-
return { items: [] };
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const headings: HTMLHeadingElement[] = Array.from(div.querySelectorAll('h2, h3'));
|
|
16
|
-
const hierarchy: TableOfContents = { items: [] };
|
|
17
|
-
let currentLevel: TableOfContentsItem | undefined = undefined;
|
|
18
|
-
|
|
19
|
-
headings.forEach((heading: HTMLHeadingElement) => {
|
|
20
|
-
const level = parseInt(heading.tagName.charAt(1));
|
|
21
|
-
if (!heading.id) {
|
|
22
|
-
let newId = heading.innerText
|
|
23
|
-
.replaceAll(/[^a-zA-Z0-9 ]/g, '')
|
|
24
|
-
.replaceAll(' ', '-')
|
|
25
|
-
.toLowerCase();
|
|
26
|
-
heading.id = `${newId}`;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const item: TableOfContentsItem = {
|
|
30
|
-
title: heading.textContent || '',
|
|
31
|
-
url: `#${heading.id}`,
|
|
32
|
-
items: []
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
if (level === 2) {
|
|
36
|
-
hierarchy.items.push(item);
|
|
37
|
-
currentLevel = item;
|
|
38
|
-
} else if (level === 3 && currentLevel?.items) {
|
|
39
|
-
currentLevel.items.push(item);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
filteredHeadingsList = hierarchy;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Lifecycle
|
|
47
|
-
onMount(() => {
|
|
48
|
-
getHeadingsWithHierarchy('mdsvex');
|
|
49
|
-
});
|
|
50
|
-
</script>
|
|
51
|
-
|
|
52
|
-
<div class="space-y-2">
|
|
53
|
-
<p class="font-medium">On This Page</p>
|
|
54
|
-
<Tree tree={filteredHeadingsList} />
|
|
55
|
-
</div>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { TableOfContents } from '$lib/types/docs';
|
|
3
|
-
import { page } from '$app/stores';
|
|
4
|
-
import { cn } from '$lib/utils';
|
|
5
|
-
|
|
6
|
-
export let tree: TableOfContents = {
|
|
7
|
-
items: []
|
|
8
|
-
};
|
|
9
|
-
export let level = 1;
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<ul class={cn('m-0 list-none', { 'pl-4': level !== 1 })}>
|
|
13
|
-
{#if tree.items && tree.items.length}
|
|
14
|
-
{#each tree.items as item, i (i)}
|
|
15
|
-
<li class={cn('mt-0 pt-2')}>
|
|
16
|
-
<a
|
|
17
|
-
href={item.url}
|
|
18
|
-
class={cn(
|
|
19
|
-
'inline-block no-underline transition-colors hover:text-foreground',
|
|
20
|
-
item.url === $page.url.hash ? 'font-medium text-foreground' : 'text-muted-foreground'
|
|
21
|
-
)}
|
|
22
|
-
>
|
|
23
|
-
{item.title}
|
|
24
|
-
</a>
|
|
25
|
-
{#if item.items && item.items.length}
|
|
26
|
-
<svelte:self tree={item} level={level + 1} />
|
|
27
|
-
{/if}
|
|
28
|
-
</li>
|
|
29
|
-
{/each}
|
|
30
|
-
{/if}
|
|
31
|
-
</ul>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
Accordion,
|
|
4
|
-
AccordionContent,
|
|
5
|
-
AccordionItem,
|
|
6
|
-
AccordionTrigger
|
|
7
|
-
} from '$components/ui/accordion';
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<Accordion type="single" collapsible class="w-full">
|
|
11
|
-
<AccordionItem value="item-1">
|
|
12
|
-
<AccordionTrigger>Is it accessible?</AccordionTrigger>
|
|
13
|
-
<AccordionContent>Yes. It adheres to the WAI-ARIA design pattern.</AccordionContent>
|
|
14
|
-
</AccordionItem>
|
|
15
|
-
<AccordionItem value="item-2">
|
|
16
|
-
<AccordionTrigger>Is it styled?</AccordionTrigger>
|
|
17
|
-
<AccordionContent>
|
|
18
|
-
Yes. It comes with default styles that matches the other components' aesthetic.
|
|
19
|
-
</AccordionContent>
|
|
20
|
-
</AccordionItem>
|
|
21
|
-
<AccordionItem value="item-3">
|
|
22
|
-
<AccordionTrigger>Is it animated?</AccordionTrigger>
|
|
23
|
-
<AccordionContent>
|
|
24
|
-
Yes. It's animated by default, but you can disable it if you prefer.
|
|
25
|
-
</AccordionContent>
|
|
26
|
-
</AccordionItem>
|
|
27
|
-
</Accordion>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as AccordionDemo } from './AccordionDemo.svelte';
|