vitepress 0.22.3 → 1.0.0-draft.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.
Files changed (208) hide show
  1. package/client.d.ts +2 -3
  2. package/dist/client/app/components/ClientOnly.js +1 -1
  3. package/dist/client/app/index.js +5 -7
  4. package/dist/client/index.d.ts +5 -0
  5. package/dist/client/shared.js +1 -0
  6. package/dist/client/theme-default/Layout.vue +39 -180
  7. package/dist/client/theme-default/NotFound.vue +9 -8
  8. package/dist/client/theme-default/components/VPAlgoliaSearchBox.vue +127 -0
  9. package/dist/client/theme-default/components/VPBackdrop.vue +39 -0
  10. package/dist/client/theme-default/components/VPBox.vue +59 -0
  11. package/dist/client/theme-default/components/VPButton.vue +123 -0
  12. package/dist/client/theme-default/components/VPContent.vue +74 -0
  13. package/dist/client/theme-default/components/VPDoc.vue +173 -0
  14. package/dist/client/theme-default/components/VPDocFooter.vue +141 -0
  15. package/dist/client/theme-default/components/VPDocOutline.vue +108 -0
  16. package/dist/client/theme-default/components/VPFlyout.vue +149 -0
  17. package/dist/client/theme-default/components/VPFooter.vue +53 -0
  18. package/dist/client/theme-default/components/VPHero.vue +144 -0
  19. package/dist/client/theme-default/components/VPHome.vue +33 -0
  20. package/dist/client/theme-default/components/VPHomeFeatures.vue +96 -0
  21. package/dist/client/theme-default/components/VPHomeHero.vue +17 -0
  22. package/dist/client/theme-default/components/VPHomeSponsors.vue +97 -0
  23. package/dist/client/theme-default/components/VPLink.vue +37 -0
  24. package/dist/client/theme-default/components/VPLocalNav.vue +106 -0
  25. package/dist/client/theme-default/components/VPMenu.vue +79 -0
  26. package/dist/client/theme-default/components/VPMenuGroup.vue +35 -0
  27. package/dist/client/theme-default/components/VPMenuLink.vue +30 -0
  28. package/dist/client/theme-default/components/VPNav.vue +33 -0
  29. package/dist/client/theme-default/components/VPNavBar.vue +110 -0
  30. package/dist/client/theme-default/components/VPNavBarAppearance.vue +25 -0
  31. package/dist/client/theme-default/components/VPNavBarExtra.vue +107 -0
  32. package/dist/client/theme-default/components/VPNavBarHamburger.vue +79 -0
  33. package/dist/client/theme-default/components/VPNavBarMenu.vue +29 -0
  34. package/dist/client/theme-default/components/VPNavBarMenuGroup.vue +18 -0
  35. package/dist/client/theme-default/components/VPNavBarMenuLink.vue +56 -0
  36. package/dist/client/theme-default/components/VPNavBarSearch.vue +269 -0
  37. package/dist/client/theme-default/components/VPNavBarSocialLinks.vue +27 -0
  38. package/dist/client/theme-default/components/VPNavBarTitle.vue +57 -0
  39. package/dist/client/theme-default/components/VPNavBarTranslations.vue +74 -0
  40. package/dist/client/theme-default/components/VPNavScreen.vue +100 -0
  41. package/dist/client/theme-default/components/VPNavScreenAppearance.vue +33 -0
  42. package/dist/client/theme-default/components/VPNavScreenMenu.vue +24 -0
  43. package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +118 -0
  44. package/dist/client/theme-default/components/VPNavScreenMenuGroupLink.vue +33 -0
  45. package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +35 -0
  46. package/dist/client/theme-default/components/VPNavScreenMenuLink.vue +34 -0
  47. package/dist/client/theme-default/components/VPNavScreenSocialLinks.vue +14 -0
  48. package/dist/client/theme-default/components/VPNavScreenTranslations.vue +73 -0
  49. package/dist/client/theme-default/components/VPPage.vue +5 -0
  50. package/dist/client/theme-default/components/VPSidebar.vue +118 -0
  51. package/dist/client/theme-default/components/VPSidebarGroup.vue +44 -0
  52. package/dist/client/theme-default/components/VPSidebarLink.vue +57 -0
  53. package/dist/client/theme-default/components/VPSkipLink.vue +72 -0
  54. package/dist/client/theme-default/components/VPSocialLink.vue +63 -0
  55. package/dist/client/theme-default/components/VPSocialLinks.vue +27 -0
  56. package/dist/client/theme-default/components/VPSponsors.vue +77 -0
  57. package/dist/client/theme-default/components/VPSponsorsGrid.vue +32 -0
  58. package/dist/client/theme-default/components/VPSwitch.vue +66 -0
  59. package/dist/client/theme-default/components/VPSwitchAppearance.vue +74 -0
  60. package/dist/client/theme-default/components/icons/VPIconAlignJustify.vue +8 -0
  61. package/dist/client/theme-default/components/icons/VPIconAlignLeft.vue +8 -0
  62. package/dist/client/theme-default/components/icons/VPIconAlignRight.vue +8 -0
  63. package/dist/client/theme-default/components/icons/{ArrowLeft.vue → VPIconArrowLeft.vue} +0 -0
  64. package/dist/client/theme-default/components/icons/{ArrowRight.vue → VPIconArrowRight.vue} +0 -0
  65. package/dist/client/theme-default/components/icons/VPIconChevronDown.vue +5 -0
  66. package/dist/client/theme-default/components/icons/VPIconChevronLeft.vue +5 -0
  67. package/dist/client/theme-default/components/icons/VPIconChevronRight.vue +5 -0
  68. package/dist/client/theme-default/components/icons/VPIconChevronUp.vue +5 -0
  69. package/dist/client/theme-default/components/icons/VPIconDiscord.vue +5 -0
  70. package/dist/client/theme-default/components/icons/VPIconEdit.vue +6 -0
  71. package/dist/client/theme-default/components/icons/VPIconExternalLink.vue +13 -0
  72. package/dist/client/theme-default/components/icons/VPIconFacebook.vue +5 -0
  73. package/dist/client/theme-default/components/icons/VPIconGitHub.vue +5 -0
  74. package/dist/client/theme-default/components/icons/VPIconHeart.vue +5 -0
  75. package/dist/client/theme-default/components/icons/VPIconInstagram.vue +5 -0
  76. package/dist/client/theme-default/components/icons/VPIconLanguages.vue +9 -0
  77. package/dist/client/theme-default/components/icons/VPIconLinkedIn.vue +5 -0
  78. package/dist/client/theme-default/components/icons/VPIconMoon.vue +5 -0
  79. package/dist/client/theme-default/components/icons/VPIconMoreHorizontal.vue +7 -0
  80. package/dist/client/theme-default/components/icons/VPIconPlus.vue +5 -0
  81. package/dist/client/theme-default/components/icons/VPIconSlack.vue +5 -0
  82. package/dist/client/theme-default/components/icons/VPIconSun.vue +13 -0
  83. package/dist/client/theme-default/components/icons/VPIconTwitter.vue +5 -0
  84. package/dist/client/theme-default/components/icons/VPIconYouTube.vue +5 -0
  85. package/dist/client/theme-default/composables/edit-link.js +22 -0
  86. package/dist/client/theme-default/composables/flyout.js +40 -0
  87. package/dist/client/theme-default/composables/nav.js +27 -1
  88. package/dist/client/theme-default/composables/outline.js +112 -0
  89. package/dist/client/theme-default/composables/prev-next.js +18 -0
  90. package/dist/client/theme-default/composables/sidebar.js +57 -0
  91. package/dist/client/theme-default/composables/sponsor-grid.js +92 -0
  92. package/dist/client/theme-default/composables/sponsor.js +87 -0
  93. package/dist/client/theme-default/fonts/inter-cyrillic-ext.woff2 +0 -0
  94. package/dist/client/theme-default/fonts/inter-cyrillic.woff2 +0 -0
  95. package/dist/client/theme-default/fonts/inter-greek-ext.woff2 +0 -0
  96. package/dist/client/theme-default/fonts/inter-greek.woff2 +0 -0
  97. package/dist/client/theme-default/fonts/inter-latin-ext.woff2 +0 -0
  98. package/dist/client/theme-default/fonts/inter-latin.woff2 +0 -0
  99. package/dist/client/theme-default/fonts/inter-vietnamese.woff2 +0 -0
  100. package/dist/client/theme-default/index.js +8 -4
  101. package/dist/client/theme-default/styles/base.css +203 -0
  102. package/dist/client/theme-default/styles/fonts.css +67 -0
  103. package/dist/client/theme-default/styles/utils.css +9 -0
  104. package/dist/client/theme-default/styles/vars.css +291 -66
  105. package/dist/client/theme-default/styles/vp-doc.css +425 -0
  106. package/dist/client/theme-default/styles/vp-sponsor.css +86 -0
  107. package/dist/client/theme-default/support/sidebar.js +29 -0
  108. package/dist/client/theme-default/support/utils.js +62 -0
  109. package/dist/node/alias.js +60 -0
  110. package/dist/node/alias.js.map +1 -0
  111. package/dist/node/build/build.js +57 -0
  112. package/dist/node/build/build.js.map +1 -0
  113. package/dist/node/build/buildMPAClient.js +44 -0
  114. package/dist/node/build/buildMPAClient.js.map +1 -0
  115. package/dist/node/build/bundle.js +163 -0
  116. package/dist/node/build/bundle.js.map +1 -0
  117. package/dist/node/build/render.js +185 -0
  118. package/dist/node/build/render.js.map +1 -0
  119. package/dist/node/cli.js +37 -294
  120. package/dist/node/cli.js.map +1 -0
  121. package/dist/node/config.js +176 -0
  122. package/dist/node/config.js.map +1 -0
  123. package/dist/node/index.d.ts +122 -79
  124. package/dist/node/index.js +22 -37
  125. package/dist/node/index.js.map +1 -0
  126. package/dist/node/markdown/markdown.js +75 -0
  127. package/dist/node/markdown/markdown.js.map +1 -0
  128. package/dist/node/markdown/plugins/component.js +86 -0
  129. package/dist/node/markdown/plugins/component.js.map +1 -0
  130. package/dist/node/markdown/plugins/containers.js +41 -0
  131. package/dist/node/markdown/plugins/containers.js.map +1 -0
  132. package/dist/node/markdown/plugins/headings.js +25 -0
  133. package/dist/node/markdown/plugins/headings.js.map +1 -0
  134. package/dist/node/markdown/plugins/highlight.js +53 -0
  135. package/dist/node/markdown/plugins/highlight.js.map +1 -0
  136. package/dist/node/markdown/plugins/highlightLines.js +48 -0
  137. package/dist/node/markdown/plugins/highlightLines.js.map +1 -0
  138. package/dist/node/markdown/plugins/hoist.js +22 -0
  139. package/dist/node/markdown/plugins/hoist.js.map +1 -0
  140. package/dist/node/markdown/plugins/image.js +17 -0
  141. package/dist/node/markdown/plugins/image.js.map +1 -0
  142. package/dist/node/markdown/plugins/lineNumbers.js +23 -0
  143. package/dist/node/markdown/plugins/lineNumbers.js.map +1 -0
  144. package/dist/node/markdown/plugins/link.js +85 -0
  145. package/dist/node/markdown/plugins/link.js.map +1 -0
  146. package/dist/node/markdown/plugins/preWrapper.js +22 -0
  147. package/dist/node/markdown/plugins/preWrapper.js.map +1 -0
  148. package/dist/node/markdown/plugins/slugify.js +26 -0
  149. package/dist/node/markdown/plugins/slugify.js.map +1 -0
  150. package/dist/node/markdown/plugins/snippet.js +146 -0
  151. package/dist/node/markdown/plugins/snippet.js.map +1 -0
  152. package/dist/node/markdownToVue.js +166 -0
  153. package/dist/node/markdownToVue.js.map +1 -0
  154. package/dist/node/plugin.js +227 -0
  155. package/dist/node/plugin.js.map +1 -0
  156. package/dist/node/serve/serve.js +59 -0
  157. package/dist/node/serve/serve.js.map +1 -0
  158. package/dist/node/{serve-777539c0.js → serve-b5dc02b2.js} +27 -2
  159. package/dist/node/server.js +18 -0
  160. package/dist/node/server.js.map +1 -0
  161. package/dist/node/shared.js +72 -0
  162. package/dist/node/shared.js.map +1 -0
  163. package/dist/node/staticDataPlugin.js +99 -0
  164. package/dist/node/staticDataPlugin.js.map +1 -0
  165. package/dist/node/utils/getGitTimestamp.js +17 -0
  166. package/dist/node/utils/getGitTimestamp.js.map +1 -0
  167. package/dist/node/utils/parseHeader.js +57 -0
  168. package/dist/node/utils/parseHeader.js.map +1 -0
  169. package/dist/node/utils/slash.js +8 -0
  170. package/dist/node/utils/slash.js.map +1 -0
  171. package/package.json +31 -25
  172. package/types/default-theme.d.ts +115 -78
  173. package/types/shared.d.ts +11 -6
  174. package/dist/client/theme-default/components/AlgoliaSearchBox.vue +0 -188
  175. package/dist/client/theme-default/components/BuySellAds.vue +0 -152
  176. package/dist/client/theme-default/components/CarbonAds.vue +0 -99
  177. package/dist/client/theme-default/components/EditLink.vue +0 -38
  178. package/dist/client/theme-default/components/Home.vue +0 -31
  179. package/dist/client/theme-default/components/HomeFeatures.vue +0 -143
  180. package/dist/client/theme-default/components/HomeFooter.vue +0 -50
  181. package/dist/client/theme-default/components/HomeHero.vue +0 -161
  182. package/dist/client/theme-default/components/LastUpdated.vue +0 -60
  183. package/dist/client/theme-default/components/NavBar.vue +0 -60
  184. package/dist/client/theme-default/components/NavBarTitle.vue +0 -41
  185. package/dist/client/theme-default/components/NavDropdownLink.vue +0 -135
  186. package/dist/client/theme-default/components/NavDropdownLinkItem.vue +0 -76
  187. package/dist/client/theme-default/components/NavLink.vue +0 -61
  188. package/dist/client/theme-default/components/NavLinks.vue +0 -52
  189. package/dist/client/theme-default/components/NextAndPrevLinks.vue +0 -88
  190. package/dist/client/theme-default/components/Page.vue +0 -53
  191. package/dist/client/theme-default/components/PageFooter.vue +0 -44
  192. package/dist/client/theme-default/components/SideBar.vue +0 -60
  193. package/dist/client/theme-default/components/SideBarLink.js +0 -68
  194. package/dist/client/theme-default/components/SideBarLinks.vue +0 -12
  195. package/dist/client/theme-default/components/ToggleSideBarButton.vue +0 -46
  196. package/dist/client/theme-default/components/icons/OutboundLink.vue +0 -31
  197. package/dist/client/theme-default/composables/activeSidebarLink.js +0 -99
  198. package/dist/client/theme-default/composables/editLink.js +0 -49
  199. package/dist/client/theme-default/composables/navLink.js +0 -42
  200. package/dist/client/theme-default/composables/nextAndPrevLinks.js +0 -37
  201. package/dist/client/theme-default/composables/repo.js +0 -38
  202. package/dist/client/theme-default/composables/sideBar.js +0 -57
  203. package/dist/client/theme-default/styles/code.css +0 -299
  204. package/dist/client/theme-default/styles/custom-blocks.css +0 -76
  205. package/dist/client/theme-default/styles/layout.css +0 -236
  206. package/dist/client/theme-default/styles/sidebar-links.css +0 -107
  207. package/dist/client/theme-default/support/sideBar.js +0 -46
  208. package/dist/client/theme-default/utils.js +0 -63
@@ -0,0 +1,144 @@
1
+ <script setup lang="ts">
2
+ import VPButton from './VPButton.vue'
3
+
4
+ interface HeroAction {
5
+ theme?: 'brand' | 'alt'
6
+ text: string
7
+ link: string
8
+ }
9
+
10
+ defineProps<{
11
+ name?: string
12
+ text: string
13
+ tagline?: string
14
+ actions?: HeroAction[]
15
+ }>()
16
+ </script>
17
+
18
+ <template>
19
+ <div class="VPHero">
20
+ <div class="container">
21
+ <p v-if="name" class="name"><span class="clip">{{ name }}</span></p>
22
+ <h1 v-if="text" class="text">{{ text }}</h1>
23
+ <p v-if="tagline" class="tagline">{{ tagline }}</p>
24
+
25
+ <div v-if="actions" class="actions">
26
+ <div v-for="action in actions" :key="action.link" class="action">
27
+ <VPButton
28
+ tag="a"
29
+ size="big"
30
+ :theme="action.theme"
31
+ :text="action.text"
32
+ :href="action.link"
33
+ />
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </template>
39
+
40
+ <style scoped>
41
+ .VPHero {
42
+ margin-top: calc(var(--vp-nav-height) * -1);
43
+ padding: calc(var(--vp-nav-height) + 48px) 24px 48px;
44
+ }
45
+
46
+ @media (min-width: 640px) {
47
+ .VPHero {
48
+ padding: calc(var(--vp-nav-height) + 80px) 48px 64px;
49
+ }
50
+ }
51
+
52
+ .container {
53
+ margin: 0 auto;
54
+ max-width: 960px;
55
+ }
56
+
57
+ .name,
58
+ .text {
59
+ line-height: 40px;
60
+ font-size: 32px;
61
+ font-weight: 700;
62
+ }
63
+
64
+ .name {
65
+ padding-bottom: 4px;
66
+ color: var(--vp-home-hero-name-color);
67
+ }
68
+
69
+ .clip {
70
+ background: var(--vp-home-hero-name-background);
71
+ -webkit-text-fill-color: var(--vp-home-hero-name-color);
72
+ -webkit-background-clip: text;
73
+ }
74
+
75
+ @media (min-width: 640px) {
76
+ .name,
77
+ .text {
78
+ max-width: 640px;
79
+ line-height: 56px;
80
+ font-size: 48px;
81
+ }
82
+
83
+ .name {
84
+ padding-bottom: 6px;
85
+ }
86
+ }
87
+
88
+ @media (min-width: 960px) {
89
+ .name,
90
+ .text {
91
+ max-width: 720px;
92
+ line-height: 64px;
93
+ font-size: 56px;
94
+ }
95
+
96
+ .name {
97
+ padding-bottom: 6px;
98
+ }
99
+ }
100
+
101
+ .tagline {
102
+ padding-top: 16px;
103
+ line-height: 28px;
104
+ font-size: 18px;
105
+ font-weight: 500;
106
+ color: var(--vp-c-text-2);
107
+ }
108
+
109
+ @media (min-width: 640px) {
110
+ .tagline {
111
+ padding-top: 24px;
112
+ max-width: 540px;
113
+ line-height: 32px;
114
+ font-size: 20px;
115
+ }
116
+ }
117
+
118
+ @media (min-width: 960px) {
119
+ .tagline {
120
+ padding-top: 24px;
121
+ max-width: 640px;
122
+ line-height: 36px;
123
+ font-size: 24px;
124
+ }
125
+ }
126
+
127
+ .actions {
128
+ display: flex;
129
+ flex-wrap: wrap;
130
+ margin: -8px;
131
+ padding-top: 24px;
132
+ }
133
+
134
+ @media (min-width: 640px) {
135
+ .actions {
136
+ padding-top: 32px;
137
+ }
138
+ }
139
+
140
+ .action {
141
+ flex-shrink: 0;
142
+ padding: 8px;
143
+ }
144
+ </style>
@@ -0,0 +1,33 @@
1
+ <script setup lang="ts">
2
+ import VPHomeHero from './VPHomeHero.vue'
3
+ import VPHomeFeatures from './VPHomeFeatures.vue'
4
+ </script>
5
+
6
+ <template>
7
+ <div class="VPHome">
8
+ <slot name="home-hero-before" />
9
+ <VPHomeHero />
10
+ <slot name="home-hero-after" />
11
+
12
+ <slot name="home-features-before" />
13
+ <VPHomeFeatures />
14
+ <slot name="home-features-after" />
15
+ </div>
16
+ </template>
17
+
18
+ <style scoped>
19
+ .VPHome {
20
+ padding-bottom: 96px;
21
+ }
22
+
23
+ .VPHome :deep(.VPHomeSponsors) {
24
+ margin-top: 112px;
25
+ margin-bottom: -128px;
26
+ }
27
+
28
+ @media (min-width: 768px) {
29
+ .VPHome {
30
+ padding-bottom: 128px;
31
+ }
32
+ }
33
+ </style>
@@ -0,0 +1,96 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue'
3
+ import { useData } from 'vitepress'
4
+ import VPBox from './VPBox.vue'
5
+
6
+ const { frontmatter: fm } = useData()
7
+
8
+ const grid = computed(() => {
9
+ const length = fm.value.features?.length
10
+
11
+ if (!length) {
12
+ return
13
+ }
14
+
15
+ if (length === 2) {
16
+ return 'grid-2'
17
+ } else if (length === 3) {
18
+ return 'grid-3'
19
+ } else if (length % 3 === 0) {
20
+ return 'grid-6'
21
+ } else if (length % 2 === 0) {
22
+ return 'grid-4'
23
+ }
24
+ })
25
+ </script>
26
+
27
+ <template>
28
+ <div v-if="fm.features" class="VPHomeFeatures">
29
+ <div class="container">
30
+ <div class="items">
31
+ <div v-for="feature in fm.features" :key="feature.title" class="item" :class="[grid]">
32
+ <VPBox
33
+ :icon="feature.icon"
34
+ :title="feature.title"
35
+ :details="feature.details"
36
+ />
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </template>
42
+
43
+ <style scoped>
44
+ .VPHomeFeatures {
45
+ padding: 0 24px;
46
+ }
47
+
48
+ @media (min-width: 640px) {
49
+ .VPHomeFeatures {
50
+ padding: 0 48px;
51
+ }
52
+ }
53
+
54
+ .container {
55
+ margin: 0 auto;
56
+ max-width: 960px;
57
+ }
58
+
59
+ .items {
60
+ display: flex;
61
+ flex-wrap: wrap;
62
+ margin: -8px;
63
+ }
64
+
65
+ .item {
66
+ padding: 8px;
67
+ width: 100%;
68
+ }
69
+
70
+ @media (min-width: 640px) {
71
+ .item.grid-2,
72
+ .item.grid-4,
73
+ .item.grid-6 {
74
+ width: calc(100% / 2);
75
+ }
76
+ }
77
+
78
+ @media (min-width: 768px) {
79
+ .item.grid-2,
80
+ .item.grid-4 {
81
+ width: calc(100% / 2);
82
+ }
83
+
84
+ .item.grid-3,
85
+ .item.grid-6 {
86
+ width: calc(100% / 3);
87
+ }
88
+ }
89
+
90
+ @media (min-width: 960px) {
91
+ .item.grid-4 {
92
+ width: calc(100% / 4);
93
+ }
94
+ }
95
+
96
+ </style>
@@ -0,0 +1,17 @@
1
+ <script setup lang="ts">
2
+ import { useData } from 'vitepress'
3
+ import VPHero from './VPHero.vue'
4
+
5
+ const { frontmatter: fm } = useData()
6
+ </script>
7
+
8
+ <template>
9
+ <div v-if="fm.hero" class="VPHomeHero">
10
+ <VPHero
11
+ :name="fm.hero.name"
12
+ :text="fm.hero.text"
13
+ :tagline="fm.hero.tagline"
14
+ :actions="fm.hero.actions"
15
+ />
16
+ </div>
17
+ </template>
@@ -0,0 +1,97 @@
1
+ <script setup lang="ts">
2
+ import VPIconHeart from './icons/VPIconHeart.vue'
3
+ import VPButton from './VPButton.vue'
4
+ import VPSponsors from './VPSponsors.vue'
5
+
6
+ interface Sponsors {
7
+ tier: string
8
+ size?: 'medium' | 'big'
9
+ items: Sponsor[]
10
+ }
11
+
12
+ interface Sponsor {
13
+ name: string
14
+ img: string
15
+ url: string
16
+ }
17
+
18
+ defineProps<{
19
+ message?: string
20
+ actionText?: string
21
+ actionLink?: string
22
+ data: Sponsors[]
23
+ }>()
24
+ </script>
25
+
26
+ <template>
27
+ <section class="VPHomeSponsors">
28
+ <div class="container">
29
+ <div class="header">
30
+ <div class="love"><VPIconHeart class="icon" /></div>
31
+ <h2 v-if="message" class="message">{{ message }}</h2>
32
+ </div>
33
+
34
+ <div class="sponsors">
35
+ <VPSponsors :data="data" />
36
+ </div>
37
+
38
+ <div v-if="actionLink" class="action">
39
+ <VPButton
40
+ theme="sponsor"
41
+ :text="actionText ?? 'Become a sponsor'"
42
+ :href="actionLink"
43
+ />
44
+ </div>
45
+ </div>
46
+ </section>
47
+ </template>
48
+
49
+ <style scoped>
50
+ .VPHomeSponsors {
51
+ border-top: 1px solid var(--vp-c-divider-light);
52
+ padding: 88px 24px 96px;
53
+ background-color: var(--vp-c-bg-content);
54
+ }
55
+
56
+ .container {
57
+ margin: 0 auto;
58
+ max-width: 960px;
59
+ }
60
+
61
+ .love {
62
+ margin: 0 auto;
63
+ width: 28px;
64
+ height: 28px;
65
+ color: var(--vp-c-text-3);
66
+ }
67
+
68
+ .icon {
69
+ width: 28px;
70
+ height: 28px;
71
+ fill: currentColor;
72
+ }
73
+
74
+ .message {
75
+ margin: 0 auto;
76
+ padding-top: 10px;
77
+ max-width: 320px;
78
+ text-align: center;
79
+ line-height: 24px;
80
+ font-size: 16px;
81
+ font-weight: 500;
82
+ color: var(--vp-c-text-2);
83
+ }
84
+
85
+ .sponsors {
86
+ padding-top: 32px;
87
+ }
88
+
89
+ .sponsor + .sponsor {
90
+ padding-top: 0px;
91
+ }
92
+
93
+ .action {
94
+ padding-top: 40px;
95
+ text-align: center;
96
+ }
97
+ </style>
@@ -0,0 +1,37 @@
1
+ <script lang="ts" setup>
2
+ import { computed } from 'vue'
3
+ import VPIconExternalLink from './icons/VPIconExternalLink.vue'
4
+
5
+ const props = defineProps<{
6
+ href?: string
7
+ noIcon?: boolean
8
+ }>()
9
+
10
+ const isExternal = computed(() => props.href && /^[a-z]+:/i.test(props.href))
11
+ </script>
12
+
13
+ <template>
14
+ <component
15
+ :is="href ? 'a' : 'span'"
16
+ class="VPLink"
17
+ :class="{ link: href }"
18
+ :href="href"
19
+ :target="isExternal ? '_blank' : undefined"
20
+ :rel="isExternal ? 'noopener noreferrer' : undefined"
21
+ >
22
+ <slot />
23
+ <VPIconExternalLink v-if="isExternal && !noIcon" class="icon" />
24
+ </component>
25
+ </template>
26
+
27
+ <style scoped>
28
+ .icon {
29
+ display: inline-block;
30
+ margin-top: -1px;
31
+ margin-left: 4px;
32
+ width: 11px;
33
+ height: 11px;
34
+ fill: var(--vp-c-text-3);
35
+ transition: fill 0.25s;
36
+ }
37
+ </style>
@@ -0,0 +1,106 @@
1
+ <script lang="ts" setup>
2
+ import { useSidebar } from '../composables/sidebar'
3
+ import VPIconAlignLeft from './icons/VPIconAlignLeft.vue'
4
+
5
+ defineProps<{
6
+ open: boolean
7
+ }>()
8
+
9
+ defineEmits<{
10
+ (e: 'open-menu'): void
11
+ }>()
12
+
13
+ const { hasSidebar } = useSidebar()
14
+
15
+ function scrollToTop() {
16
+ window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
17
+ }
18
+ </script>
19
+
20
+ <template>
21
+ <div v-if="hasSidebar" class="VPLocalNav">
22
+ <button
23
+ class="menu"
24
+ :aria-expanded="open"
25
+ aria-controls="VPSidebarNav"
26
+ @click="$emit('open-menu')"
27
+ >
28
+ <VPIconAlignLeft class="menu-icon" />
29
+ <span class="menu-text">Menu</span>
30
+ </button>
31
+
32
+ <a class="top-link" href="#" @click="scrollToTop">
33
+ Return to top
34
+ </a>
35
+ </div>
36
+ </template>
37
+
38
+ <style scoped>
39
+ .VPLocalNav {
40
+ position: sticky;
41
+ top: 0;
42
+ left: 0;
43
+ z-index: var(--vp-z-index-local-nav);
44
+ display: flex;
45
+ justify-content: space-between;
46
+ border-bottom: 1px solid var(--vp-c-divider-light);
47
+ width: 100%;
48
+ background-color: var(--vp-c-bg-content);
49
+ transition: border-color 0.5s, background-color 0.5s;
50
+ }
51
+
52
+ @media (min-width: 960px) {
53
+ .VPLocalNav {
54
+ display: none;
55
+ }
56
+ }
57
+
58
+ .menu {
59
+ display: flex;
60
+ align-items: center;
61
+ padding: 0 24px;
62
+ line-height: 47px;
63
+ font-size: 12px;
64
+ font-weight: 500;
65
+ color: var(--vp-c-text-2);
66
+ transition: color 0.5s;
67
+ }
68
+
69
+ .menu:hover {
70
+ color: var(--vp-c-text-1);
71
+ transition: color 0.25s;
72
+ }
73
+
74
+ @media (min-width: 768px) {
75
+ .menu {
76
+ padding: 0 32px;
77
+ }
78
+ }
79
+
80
+ .menu-icon {
81
+ margin-right: 8px;
82
+ width: 16px;
83
+ height: 16px;
84
+ fill: currentColor;
85
+ }
86
+
87
+ .top-link {
88
+ padding: 0 24px;
89
+ line-height: 47px;
90
+ font-size: 12px;
91
+ font-weight: 500;
92
+ color: var(--vp-c-text-2);
93
+ transition: color 0.5s;
94
+ }
95
+
96
+ .top-link:hover {
97
+ color: var(--vp-c-text-1);
98
+ transition: color 0.25s;
99
+ }
100
+
101
+ @media (min-width: 768px) {
102
+ .top-link {
103
+ padding: 0 32px;
104
+ }
105
+ }
106
+ </style>
@@ -0,0 +1,79 @@
1
+ <script lang="ts" setup>
2
+ import VPMenuLink from './VPMenuLink.vue'
3
+ import VPMenuGroup from './VPMenuGroup.vue'
4
+
5
+ defineProps<{
6
+ items?: any[]
7
+ }>()
8
+ </script>
9
+
10
+ <template>
11
+ <div class="VPMenu">
12
+ <div v-if="items" class="items">
13
+ <template v-for="item in items" :key="item.text">
14
+ <VPMenuLink v-if="'link' in item" :item="item" />
15
+ <VPMenuGroup v-else :text="item.text" :items="item.items" />
16
+ </template>
17
+ </div>
18
+
19
+ <slot />
20
+ </div>
21
+ </template>
22
+
23
+ <style scoped>
24
+ .VPMenu {
25
+ border-radius: 8px;
26
+ padding: 12px 0;
27
+ min-width: 192px;
28
+ border: 1px solid transparent;
29
+ background: var(--vp-c-bg);
30
+ box-shadow: var(--vp-shadow-3);
31
+ transition: background-color 0.5s;
32
+ }
33
+
34
+ .dark .VPMenu {
35
+ background: var(--vp-c-bg);
36
+ box-shadow: var(--vp-shadow-1);
37
+ border: 1px solid var(--vp-c-divider-light);
38
+ }
39
+
40
+ .VPMenu :deep(.items) {
41
+ transition: border-color .5s;
42
+ }
43
+
44
+ .VPMenu :deep(.group) {
45
+ padding: 0 0 12px;
46
+ }
47
+
48
+ .VPMenu :deep(.group + .group) {
49
+ border-top: 1px solid var(--vp-c-divider-light);
50
+ padding: 11px 0 12px;
51
+ }
52
+
53
+ .VPMenu :deep(.group:last-child) {
54
+ padding-bottom: 0;
55
+ }
56
+
57
+ .VPMenu :deep(.group + .item) {
58
+ border-top: 1px solid var(--vp-c-divider-light);
59
+ padding: 11px 16px 0;
60
+ }
61
+
62
+ .VPMenu :deep(.item) {
63
+ padding: 0 16px;
64
+ white-space: nowrap;
65
+ }
66
+
67
+ .VPMenu :deep(.label) {
68
+ flex-grow: 1;
69
+ line-height: 28px;
70
+ font-size: 12px;
71
+ font-weight: 500;
72
+ color: var(--vp-c-text-2);
73
+ transition: color .5s;
74
+ }
75
+
76
+ .VPMenu :deep(.action) {
77
+ padding-left: 24px;
78
+ }
79
+ </style>
@@ -0,0 +1,35 @@
1
+ <script lang="ts" setup>
2
+ import VPMenuLink from './VPMenuLink.vue'
3
+
4
+ defineProps<{
5
+ text?: string
6
+ items: any[]
7
+ }>()
8
+ </script>
9
+
10
+ <template>
11
+ <div class="VPMenuGroup">
12
+ <p v-if="text" class="title">{{ text }}</p>
13
+
14
+ <template v-for="item in items">
15
+ <VPMenuLink v-if="'link' in item" :item="item" />
16
+ </template>
17
+ </div>
18
+ </template>
19
+
20
+ <style scoped>
21
+ .VPMenuGroup + .VPMenuGroup {
22
+ margin-top: 8px;
23
+ border-top: 1px solid var(--vp-c-divider-light);
24
+ padding-top: 8px;
25
+ }
26
+
27
+ .title {
28
+ padding: 0 16px;
29
+ line-height: 28px;
30
+ font-size: 13px;
31
+ font-weight: 600;
32
+ color: var(--vp-c-text-2);
33
+ transition: color 0.25s;
34
+ }
35
+ </style>
@@ -0,0 +1,30 @@
1
+ <script lang="ts" setup>
2
+ import VPLink from './VPLink.vue'
3
+
4
+ defineProps<{
5
+ item: any
6
+ }>()
7
+ </script>
8
+
9
+ <template>
10
+ <VPLink class="VPMenuLink" :href="item.link">
11
+ {{ item.text }}
12
+ </VPLink>
13
+ </template>
14
+
15
+ <style scoped>
16
+ .VPMenuLink {
17
+ display: block;
18
+ padding: 0 16px;
19
+ line-height: 28px;
20
+ font-size: 13px;
21
+ font-weight: 500;
22
+ color: var(--vp-c-text-1);
23
+ white-space: nowrap;
24
+ transition: color 0.25s;
25
+ }
26
+
27
+ .VPMenuLink:hover {
28
+ color: var(--vp-c-brand);
29
+ }
30
+ </style>
@@ -0,0 +1,33 @@
1
+ <script setup lang="ts">
2
+ import { provide } from 'vue'
3
+ import { useNav } from '../composables/nav'
4
+ import VPNavBar from './VPNavBar.vue'
5
+ import VPNavScreen from './VPNavScreen.vue'
6
+
7
+ const { isScreenOpen, closeScreen, toggleScreen } = useNav()
8
+
9
+ provide('close-screen', closeScreen)
10
+ </script>
11
+
12
+ <template>
13
+ <header class="VPNav">
14
+ <VPNavBar :is-screen-open="isScreenOpen" @toggle-screen="toggleScreen" />
15
+ <VPNavScreen :open="isScreenOpen" />
16
+ </header>
17
+ </template>
18
+
19
+ <style scoped>
20
+ .VPNav {
21
+ position: relative;
22
+ top: 0;
23
+ left: 0;
24
+ z-index: var(--vp-z-index-nav);
25
+ width: 100%;
26
+ }
27
+
28
+ @media (min-width: 960px) {
29
+ .VPNav {
30
+ position: fixed;
31
+ }
32
+ }
33
+ </style>