vitepress 0.22.4 → 1.0.0-draft.1

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 (132) 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 +1 -1
  4. package/dist/client/theme-default/Layout.vue +25 -183
  5. package/dist/client/theme-default/NotFound.vue +9 -8
  6. package/dist/client/theme-default/components/VPAlgoliaSearchBox.vue +127 -0
  7. package/dist/client/theme-default/components/VPBackdrop.vue +39 -0
  8. package/dist/client/theme-default/components/VPContent.vue +44 -0
  9. package/dist/client/theme-default/components/VPContentDoc.vue +173 -0
  10. package/dist/client/theme-default/components/VPContentDocFooter.vue +140 -0
  11. package/dist/client/theme-default/components/VPContentDocOutline.vue +108 -0
  12. package/dist/client/theme-default/components/VPFlyout.vue +149 -0
  13. package/dist/client/theme-default/components/VPLink.vue +37 -0
  14. package/dist/client/theme-default/components/VPLocalNav.vue +106 -0
  15. package/dist/client/theme-default/components/VPMenu.vue +79 -0
  16. package/dist/client/theme-default/components/VPMenuGroup.vue +35 -0
  17. package/dist/client/theme-default/components/VPMenuLink.vue +30 -0
  18. package/dist/client/theme-default/components/VPNav.vue +33 -0
  19. package/dist/client/theme-default/components/VPNavBar.vue +109 -0
  20. package/dist/client/theme-default/components/VPNavBarAppearance.vue +22 -0
  21. package/dist/client/theme-default/components/VPNavBarExtra.vue +107 -0
  22. package/dist/client/theme-default/components/VPNavBarHamburger.vue +79 -0
  23. package/dist/client/theme-default/components/VPNavBarMenu.vue +29 -0
  24. package/dist/client/theme-default/components/VPNavBarMenuGroup.vue +18 -0
  25. package/dist/client/theme-default/components/VPNavBarMenuLink.vue +56 -0
  26. package/dist/client/theme-default/components/VPNavBarSearch.vue +269 -0
  27. package/dist/client/theme-default/components/VPNavBarSocialLinks.vue +27 -0
  28. package/dist/client/theme-default/components/VPNavBarTitle.vue +44 -0
  29. package/dist/client/theme-default/components/VPNavBarTranslations.vue +74 -0
  30. package/dist/client/theme-default/components/VPNavScreen.vue +100 -0
  31. package/dist/client/theme-default/components/VPNavScreenAppearance.vue +30 -0
  32. package/dist/client/theme-default/components/VPNavScreenMenu.vue +24 -0
  33. package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +118 -0
  34. package/dist/client/theme-default/components/VPNavScreenMenuGroupLink.vue +33 -0
  35. package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +35 -0
  36. package/dist/client/theme-default/components/VPNavScreenMenuLink.vue +34 -0
  37. package/dist/client/theme-default/components/VPNavScreenSocialLinks.vue +14 -0
  38. package/dist/client/theme-default/components/VPNavScreenTranslations.vue +73 -0
  39. package/dist/client/theme-default/components/VPSidebar.vue +118 -0
  40. package/dist/client/theme-default/components/VPSidebarGroup.vue +44 -0
  41. package/dist/client/theme-default/components/VPSidebarLink.vue +57 -0
  42. package/dist/client/theme-default/components/VPSkipLink.vue +72 -0
  43. package/dist/client/theme-default/components/VPSocialLink.vue +63 -0
  44. package/dist/client/theme-default/components/VPSocialLinks.vue +27 -0
  45. package/dist/client/theme-default/components/VPSwitch.vue +66 -0
  46. package/dist/client/theme-default/components/VPSwitchAppearance.vue +74 -0
  47. package/dist/client/theme-default/components/icons/VPIconAlignJustify.vue +8 -0
  48. package/dist/client/theme-default/components/icons/VPIconAlignLeft.vue +8 -0
  49. package/dist/client/theme-default/components/icons/VPIconAlignRight.vue +8 -0
  50. package/dist/client/theme-default/components/icons/{ArrowLeft.vue → VPIconArrowLeft.vue} +0 -0
  51. package/dist/client/theme-default/components/icons/{ArrowRight.vue → VPIconArrowRight.vue} +0 -0
  52. package/dist/client/theme-default/components/icons/VPIconChevronDown.vue +5 -0
  53. package/dist/client/theme-default/components/icons/VPIconChevronLeft.vue +5 -0
  54. package/dist/client/theme-default/components/icons/VPIconChevronRight.vue +5 -0
  55. package/dist/client/theme-default/components/icons/VPIconChevronUp.vue +5 -0
  56. package/dist/client/theme-default/components/icons/VPIconDiscord.vue +5 -0
  57. package/dist/client/theme-default/components/icons/VPIconEdit.vue +6 -0
  58. package/dist/client/theme-default/components/icons/VPIconExternalLink.vue +13 -0
  59. package/dist/client/theme-default/components/icons/VPIconFacebook.vue +5 -0
  60. package/dist/client/theme-default/components/icons/VPIconGitHub.vue +5 -0
  61. package/dist/client/theme-default/components/icons/VPIconInstagram.vue +5 -0
  62. package/dist/client/theme-default/components/icons/VPIconLanguages.vue +9 -0
  63. package/dist/client/theme-default/components/icons/VPIconLinkedIn.vue +5 -0
  64. package/dist/client/theme-default/components/icons/VPIconMoon.vue +5 -0
  65. package/dist/client/theme-default/components/icons/VPIconMoreHorizontal.vue +7 -0
  66. package/dist/client/theme-default/components/icons/VPIconPlus.vue +5 -0
  67. package/dist/client/theme-default/components/icons/VPIconSlack.vue +5 -0
  68. package/dist/client/theme-default/components/icons/VPIconSun.vue +13 -0
  69. package/dist/client/theme-default/components/icons/VPIconTwitter.vue +5 -0
  70. package/dist/client/theme-default/components/icons/VPIconYouTube.vue +5 -0
  71. package/dist/client/theme-default/composables/edit-link.js +22 -0
  72. package/dist/client/theme-default/composables/flyout.js +40 -0
  73. package/dist/client/theme-default/composables/nav.js +27 -1
  74. package/dist/client/theme-default/composables/outline.js +130 -0
  75. package/dist/client/theme-default/composables/prev-next.js +18 -0
  76. package/dist/client/theme-default/composables/sidebar.js +57 -0
  77. package/dist/client/theme-default/fonts/inter-cyrillic-ext.woff2 +0 -0
  78. package/dist/client/theme-default/fonts/inter-cyrillic.woff2 +0 -0
  79. package/dist/client/theme-default/fonts/inter-greek-ext.woff2 +0 -0
  80. package/dist/client/theme-default/fonts/inter-greek.woff2 +0 -0
  81. package/dist/client/theme-default/fonts/inter-latin-ext.woff2 +0 -0
  82. package/dist/client/theme-default/fonts/inter-latin.woff2 +0 -0
  83. package/dist/client/theme-default/fonts/inter-vietnamese.woff2 +0 -0
  84. package/dist/client/theme-default/index.js +4 -4
  85. package/dist/client/theme-default/styles/base.css +200 -0
  86. package/dist/client/theme-default/styles/fonts.css +67 -0
  87. package/dist/client/theme-default/styles/utils.css +9 -0
  88. package/dist/client/theme-default/styles/vars.css +206 -66
  89. package/dist/client/theme-default/styles/vp-doc.css +419 -0
  90. package/dist/client/theme-default/support/sidebar.js +29 -0
  91. package/dist/client/theme-default/support/utils.js +43 -0
  92. package/dist/node/cli.js +3 -8
  93. package/dist/node/index.d.ts +104 -79
  94. package/dist/node/index.js +1 -1
  95. package/dist/node/{serve-3035f99b.js → serve-428d4610.js} +11418 -1415
  96. package/package.json +24 -20
  97. package/types/default-theme.d.ts +104 -79
  98. package/dist/client/theme-default/components/AlgoliaSearchBox.vue +0 -188
  99. package/dist/client/theme-default/components/BuySellAds.vue +0 -152
  100. package/dist/client/theme-default/components/CarbonAds.vue +0 -99
  101. package/dist/client/theme-default/components/EditLink.vue +0 -38
  102. package/dist/client/theme-default/components/Home.vue +0 -31
  103. package/dist/client/theme-default/components/HomeFeatures.vue +0 -143
  104. package/dist/client/theme-default/components/HomeFooter.vue +0 -50
  105. package/dist/client/theme-default/components/HomeHero.vue +0 -161
  106. package/dist/client/theme-default/components/LastUpdated.vue +0 -60
  107. package/dist/client/theme-default/components/NavBar.vue +0 -60
  108. package/dist/client/theme-default/components/NavBarTitle.vue +0 -41
  109. package/dist/client/theme-default/components/NavDropdownLink.vue +0 -135
  110. package/dist/client/theme-default/components/NavDropdownLinkItem.vue +0 -76
  111. package/dist/client/theme-default/components/NavLink.vue +0 -61
  112. package/dist/client/theme-default/components/NavLinks.vue +0 -52
  113. package/dist/client/theme-default/components/NextAndPrevLinks.vue +0 -88
  114. package/dist/client/theme-default/components/Page.vue +0 -53
  115. package/dist/client/theme-default/components/PageFooter.vue +0 -44
  116. package/dist/client/theme-default/components/SideBar.vue +0 -60
  117. package/dist/client/theme-default/components/SideBarLink.js +0 -68
  118. package/dist/client/theme-default/components/SideBarLinks.vue +0 -12
  119. package/dist/client/theme-default/components/ToggleSideBarButton.vue +0 -46
  120. package/dist/client/theme-default/components/icons/OutboundLink.vue +0 -31
  121. package/dist/client/theme-default/composables/activeSidebarLink.js +0 -99
  122. package/dist/client/theme-default/composables/editLink.js +0 -49
  123. package/dist/client/theme-default/composables/navLink.js +0 -42
  124. package/dist/client/theme-default/composables/nextAndPrevLinks.js +0 -37
  125. package/dist/client/theme-default/composables/repo.js +0 -38
  126. package/dist/client/theme-default/composables/sideBar.js +0 -57
  127. package/dist/client/theme-default/styles/code.css +0 -299
  128. package/dist/client/theme-default/styles/custom-blocks.css +0 -76
  129. package/dist/client/theme-default/styles/layout.css +0 -236
  130. package/dist/client/theme-default/styles/sidebar-links.css +0 -107
  131. package/dist/client/theme-default/support/sideBar.js +0 -46
  132. package/dist/client/theme-default/utils.js +0 -63
@@ -0,0 +1,118 @@
1
+ <script lang="ts" setup>
2
+ import { ref, watchPostEffect, nextTick } from 'vue'
3
+ import { useSidebar } from '../composables/sidebar'
4
+ import VPSidebarGroup from './VPSidebarGroup.vue'
5
+
6
+ const { sidebar, hasSidebar } = useSidebar()
7
+
8
+ const props = defineProps<{
9
+ open: boolean
10
+ }>()
11
+
12
+ // a11y: focus Nav element when menu has opened
13
+ let navEl = ref<(Element & { focus(): void }) | null>(null)
14
+
15
+ watchPostEffect(async () => {
16
+ if (props.open) {
17
+ await nextTick()
18
+ navEl.value?.focus()
19
+ }
20
+ })
21
+ </script>
22
+
23
+ <template>
24
+ <aside
25
+ v-if="hasSidebar"
26
+ class="VPSidebar"
27
+ :class="{ open }"
28
+ ref="navEl"
29
+ @click.stop
30
+ >
31
+ <nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1">
32
+ <span class="visually-hidden" id="sidebar-aria-label">
33
+ Sidebar Navigation
34
+ </span>
35
+
36
+ <div v-for="group in sidebar" :key="group.text" class="group">
37
+ <VPSidebarGroup :text="group.text" :items="group.items" />
38
+ </div>
39
+ </nav>
40
+ </aside>
41
+ </template>
42
+
43
+ <style scoped>
44
+ .VPSidebar {
45
+ position: fixed;
46
+ top: 0;
47
+ bottom: 0;
48
+ left: 0;
49
+ z-index: var(--vp-z-index-sidebar);
50
+ padding: 32px 32px 96px;
51
+ width: calc(100vw - 64px);
52
+ max-width: 320px;
53
+ background-color: var(--vp-c-bg);
54
+ opacity: 0;
55
+ box-shadow: var(--vp-c-shadow-3);
56
+ overflow-x: hidden;
57
+ overflow-y: auto;
58
+ transform: translateX(-100%);
59
+ transition: background-color 0.5s, opacity 0.5s, transform 0.25s ease;
60
+ }
61
+
62
+ .VPSidebar.open {
63
+ opacity: 1;
64
+ visibility: visible;
65
+ transform: translateX(0);
66
+ transition: background-color 0.5s,
67
+ opacity 0.25s,
68
+ transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
69
+ }
70
+
71
+ .dark .VPSidebar {
72
+ box-shadow: var(--vp-shadow-1);
73
+ }
74
+
75
+ @media (min-width: 960px) {
76
+ .VPSidebar {
77
+ z-index: 1;
78
+ padding-top: var(--vp-nav-height-desktop);
79
+ padding-bottom: 128px;
80
+ width: var(--vp-sidebar-width);
81
+ max-width: 100%;
82
+ width: var(--vp-sidebar-width);
83
+ background-color: var(--vp-c-bg-sidebar);
84
+ opacity: 1;
85
+ visibility: visible;
86
+ box-shadow: none;
87
+ transform: translateX(0);
88
+ transition: border-color 0.5s, background-color 0.5s;
89
+ }
90
+ }
91
+
92
+ @media (min-width: 1440px) {
93
+ .VPSidebar {
94
+ padding-left: calc((100% - var(--vp-layout-max-width)) / 2);
95
+ width: calc((100% - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width) - 32px);
96
+ }
97
+ }
98
+
99
+ .nav {
100
+ outline: 0;
101
+ }
102
+
103
+ .group + .group {
104
+ margin-top: 32px;
105
+ border-top: 1px solid var(--vp-c-divider-light);
106
+ padding-top: 8px;
107
+ }
108
+
109
+ @media (min-width: 960px) {
110
+ .group {
111
+ padding-top: 8px;
112
+ }
113
+
114
+ .group + .group {
115
+ margin-top: 24px;
116
+ }
117
+ }
118
+ </style>
@@ -0,0 +1,44 @@
1
+ <script lang="ts" setup>
2
+ import { useData } from 'vitepress'
3
+ import { DefaultTheme } from '../config'
4
+ import VPSidebarLink from './VPSidebarLink.vue'
5
+
6
+ const props = defineProps<{
7
+ text: string
8
+ items: DefaultTheme.SidebarItem[]
9
+ }>()
10
+
11
+ const { page } = useData()
12
+ </script>
13
+
14
+ <template>
15
+ <section class="VPSidebarGroup">
16
+ <div class="title">
17
+ <h2 class="title-text">{{ text }}</h2>
18
+ </div>
19
+
20
+ <template v-for="item in items" :key="item.link">
21
+ <VPSidebarLink :item="item" />
22
+ </template>
23
+ </section>
24
+ </template>
25
+
26
+ <style scoped>
27
+ .title {
28
+ padding: 6px 0;
29
+ }
30
+
31
+ @media (min-width: 960px) {
32
+ .title {
33
+ padding: 4px 0;
34
+ }
35
+ }
36
+
37
+ .title-text {
38
+ line-height: 20px;
39
+ font-size: 13px;
40
+ font-weight: 600;
41
+ color: var(--vp-c-text-1);
42
+ transition: color 0.5s;
43
+ }
44
+ </style>
@@ -0,0 +1,57 @@
1
+ <script lang="ts" setup>
2
+ import { inject } from 'vue'
3
+ import { useData } from 'vitepress'
4
+ import { DefaultTheme } from '../config'
5
+ import { isActive, normalizeLink } from '../support/utils'
6
+
7
+ defineProps<{
8
+ item: DefaultTheme.SidebarItem
9
+ }>()
10
+
11
+ const { page } = useData()
12
+
13
+ const closeSideBar = inject('close-sidebar') as () => void
14
+ </script>
15
+
16
+ <template>
17
+ <a
18
+ class="link"
19
+ :class="{ active: isActive(page.relativePath, item.link) }"
20
+ :href="normalizeLink(item.link)"
21
+ @click="closeSideBar"
22
+ >
23
+ <p class="link-text">{{ item.text }}</p>
24
+ </a>
25
+ </template>
26
+
27
+ <style scoped>
28
+ .link {
29
+ display: block;
30
+ padding: 6px 0;
31
+ }
32
+
33
+ .link:hover .link-text {
34
+ color: var(--vp-c-brand);
35
+ transition: color 0.25s;
36
+ }
37
+
38
+ .link.active .link-text {
39
+ font-weight: 600;
40
+ color: var(--vp-c-brand);
41
+ transition: color 0.25s;
42
+ }
43
+
44
+ @media (min-width: 960px) {
45
+ .link {
46
+ padding: 4px 0;
47
+ }
48
+ }
49
+
50
+ .link-text {
51
+ line-height: 20px;
52
+ font-size: 13px;
53
+ font-weight: 500;
54
+ color: var(--vp-c-text-2);
55
+ transition: color 0.5s;
56
+ }
57
+ </style>
@@ -0,0 +1,72 @@
1
+ <script lang="ts" setup>
2
+ import { ref, watch } from 'vue'
3
+ import { useRoute } from 'vitepress'
4
+
5
+ const route = useRoute()
6
+ const backToTop = ref()
7
+
8
+ watch(() => route.path, () => backToTop.value.focus())
9
+
10
+ function focusOnTargetAnchor({ target }: Event) {
11
+ const el = document.querySelector(
12
+ (target as HTMLAnchorElement).hash!
13
+ ) as HTMLAnchorElement
14
+
15
+ if (el) {
16
+ const removeTabIndex = () => {
17
+ el.removeAttribute('tabindex')
18
+ el.removeEventListener('blur', removeTabIndex)
19
+ }
20
+
21
+ el.setAttribute('tabindex', '-1')
22
+ el.addEventListener('blur', removeTabIndex)
23
+ el.focus()
24
+ window.scrollTo(0, 0)
25
+ }
26
+ }
27
+ </script>
28
+
29
+ <template>
30
+ <span ref="backToTop" tabindex="-1" />
31
+ <a
32
+ href="#VPContent"
33
+ class="VPSkipLink visually-hidden"
34
+ @click="focusOnTargetAnchor"
35
+ >
36
+ Skip to content
37
+ </a>
38
+ </template>
39
+
40
+ <style scoped>
41
+ .VPSkipLink {
42
+ top: 8px;
43
+ left: 8px;
44
+ padding: 8px 16px;
45
+ z-index: 999;
46
+ border-radius: 8px;
47
+ font-size: 12px;
48
+ font-weight: bold;
49
+ text-decoration: none;
50
+ color: var(--vp-c-brand);
51
+ box-shadow: var(--vp-shadow-3);
52
+ background-color: var(--vp-c-bg);
53
+ }
54
+
55
+ .VPSkipLink:focus {
56
+ height: auto;
57
+ width: auto;
58
+ clip: auto;
59
+ clip-path: none;
60
+ }
61
+
62
+ .dark .VPSkipLink {
63
+ color: var(--vp-c-green);
64
+ }
65
+
66
+ @media (min-width: 1280px) {
67
+ .VPSkipLink {
68
+ top: 14px;
69
+ left: 16px;
70
+ }
71
+ }
72
+ </style>
@@ -0,0 +1,63 @@
1
+ <script lang="ts" setup>
2
+ import { DefaultTheme } from 'vitepress'
3
+ import VPIconDiscord from './icons/VPIconDiscord.vue'
4
+ import VPIconFacebook from './icons/VPIconFacebook.vue'
5
+ import VPIconGitHub from './icons/VPIconGitHub.vue'
6
+ import VPIconLinkedIn from './icons/VPIconLinkedIn.vue'
7
+ import VPIconInstagram from './icons/VPIconInstagram.vue'
8
+ import VPIconSlack from './icons/VPIconSlack.vue'
9
+ import VPIconTwitter from './icons/VPIconTwitter.vue'
10
+ import VPIconYouTube from './icons/VPIconYouTube.vue'
11
+
12
+ const props = defineProps<{
13
+ icon: DefaultTheme.SocialLinkIcon
14
+ link: string
15
+ }>()
16
+
17
+ const icons = {
18
+ discord: VPIconDiscord,
19
+ facebook: VPIconFacebook,
20
+ github: VPIconGitHub,
21
+ instagram: VPIconInstagram,
22
+ linkedin: VPIconLinkedIn,
23
+ slack: VPIconSlack,
24
+ twitter: VPIconTwitter,
25
+ youtube: VPIconYouTube
26
+ }
27
+ </script>
28
+
29
+ <template>
30
+ <a
31
+ class="VPSocialLink"
32
+ :href="link"
33
+ :title="icon"
34
+ target="_blank"
35
+ rel="noopener noreferrer"
36
+ >
37
+ <component :is="icons[icon]" class="icon" />
38
+ <span class="visually-hidden">{{ icon }}</span>
39
+ </a>
40
+ </template>
41
+
42
+ <style scoped>
43
+ .VPSocialLink {
44
+ display: flex;
45
+ justify-content: center;
46
+ align-items: center;
47
+ width: 36px;
48
+ height: 36px;
49
+ color: var(--vp-c-text-2);
50
+ transition: color .5s;
51
+ }
52
+
53
+ .VPSocialLink:hover {
54
+ color: var(--vp-c-text-1);
55
+ transition: color .25s;
56
+ }
57
+
58
+ .icon {
59
+ width: 20px;
60
+ height: 20px;
61
+ fill: currentColor;
62
+ }
63
+ </style>
@@ -0,0 +1,27 @@
1
+ <script lang="ts" setup>
2
+ import { DefaultTheme } from 'vitepress'
3
+ import VPSocialLink from './VPSocialLink.vue'
4
+
5
+ defineProps<{
6
+ links: DefaultTheme.SocialLink[]
7
+ }>()
8
+ </script>
9
+
10
+ <template>
11
+ <div class="VPSocialLinks">
12
+ <VPSocialLink
13
+ v-for="{ link, icon } in links"
14
+ :key="link"
15
+ :icon="icon"
16
+ :link="link"
17
+ />
18
+ </div>
19
+ </template>
20
+
21
+ <style scoped>
22
+ .VPSocialLinks {
23
+ display: flex;
24
+ flex-wrap: wrap;
25
+ justify-content: center;
26
+ }
27
+ </style>
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <button class="VPSwitch" type="button" role="switch">
3
+ <span class="check">
4
+ <span class="icon" v-if="$slots.default">
5
+ <slot />
6
+ </span>
7
+ </span>
8
+ </button>
9
+ </template>
10
+
11
+ <style scoped>
12
+ .VPSwitch {
13
+ position: relative;
14
+ border-radius: 11px;
15
+ display: block;
16
+ width: 40px;
17
+ height: 22px;
18
+ flex-shrink: 0;
19
+ border: 1px solid var(--vp-c-divider);
20
+ background-color: var(--vp-c-bg-mute);
21
+ transition: border-color 0.25s, background-color 0.25s;
22
+ }
23
+
24
+ .VPSwitch:hover {
25
+ border-color: var(--vp-c-gray);
26
+ }
27
+
28
+ .check {
29
+ position: absolute;
30
+ top: 1px;
31
+ left: 1px;
32
+ width: 18px;
33
+ height: 18px;
34
+ border-radius: 50%;
35
+ background-color: var(--vp-c-white);
36
+ box-shadow: var(--vp-shadow-1);
37
+ transition: background-color 0.25s, transform 0.25s;
38
+ }
39
+
40
+ .dark .check {
41
+ background-color: var(--vp-c-black);
42
+ }
43
+
44
+ .icon {
45
+ position: relative;
46
+ display: block;
47
+ width: 18px;
48
+ height: 18px;
49
+ border-radius: 50%;
50
+ overflow: hidden;
51
+ }
52
+
53
+ .icon :deep(svg) {
54
+ position: absolute;
55
+ top: 3px;
56
+ left: 3px;
57
+ width: 12px;
58
+ height: 12px;
59
+ fill: var(--vp-c-text-2);
60
+ }
61
+
62
+ .dark .icon :deep(svg) {
63
+ fill: var(--vp-c-text-1);
64
+ transition: opacity 0.25s;
65
+ }
66
+ </style>
@@ -0,0 +1,74 @@
1
+ <script lang="ts" setup>
2
+ import VPSwitch from './VPSwitch.vue'
3
+ import VPIconSun from './icons/VPIconSun.vue'
4
+ import VPIconMoon from './icons/VPIconMoon.vue'
5
+
6
+ const toggle = typeof localStorage !== 'undefined' ? useAppearance() : () => {}
7
+
8
+ function useAppearance() {
9
+ const storageKey = 'vitepress-theme-appearance'
10
+ const query = window.matchMedia('(prefers-color-scheme: dark)')
11
+ const classList = document.documentElement.classList
12
+
13
+ let userPreference = localStorage.getItem(storageKey) || 'auto'
14
+
15
+ let isDark = userPreference === 'auto'
16
+ ? query.matches
17
+ : userPreference === 'dark'
18
+
19
+ query.onchange = (e) => {
20
+ if (userPreference === 'auto') {
21
+ setClass((isDark = e.matches))
22
+ }
23
+ }
24
+
25
+ function toggle() {
26
+ setClass((isDark = !isDark))
27
+
28
+ userPreference = isDark
29
+ ? query.matches ? 'auto' : 'dark'
30
+ : query.matches ? 'light' : 'auto'
31
+
32
+ localStorage.setItem(storageKey, userPreference)
33
+ }
34
+
35
+ function setClass(dark: boolean): void {
36
+ classList[dark ? 'add' : 'remove']('dark')
37
+ }
38
+
39
+ return toggle
40
+ }
41
+ </script>
42
+
43
+ <template>
44
+ <VPSwitch
45
+ class="VPSwitchAppearance"
46
+ aria-label="toggle dark mode"
47
+ @click="toggle"
48
+ >
49
+ <VPIconSun class="sun" />
50
+ <VPIconMoon class="moon" />
51
+ </VPSwitch>
52
+ </template>
53
+
54
+ <style scoped>
55
+ .sun {
56
+ opacity: 1;
57
+ }
58
+
59
+ .moon {
60
+ opacity: 0;
61
+ }
62
+
63
+ .dark .sun {
64
+ opacity: 0;
65
+ }
66
+
67
+ .dark .moon {
68
+ opacity: 1;
69
+ }
70
+
71
+ .dark .VPSwitchAppearance :deep(.check) {
72
+ transform: translateX(18px);
73
+ }
74
+ </style>
@@ -0,0 +1,8 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M21,11H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,11,21,11z" />
4
+ <path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z" />
5
+ <path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z" />
6
+ <path d="M21,19H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,19,21,19z" />
7
+ </svg>
8
+ </template>
@@ -0,0 +1,8 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M17,11H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,11,17,11z" />
4
+ <path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z" />
5
+ <path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z" />
6
+ <path d="M17,19H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,19,17,19z" />
7
+ </svg>
8
+ </template>
@@ -0,0 +1,8 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M21,11H7c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S21.6,11,21,11z" />
4
+ <path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z" />
5
+ <path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z" />
6
+ <path d="M21,19H7c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S21.6,19,21,19z" />
7
+ </svg>
8
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M12,16c-0.3,0-0.5-0.1-0.7-0.3l-6-6c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l5.3,5.3l5.3-5.3c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-6,6C12.5,15.9,12.3,16,12,16z" />
4
+ </svg>
5
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M15,19c-0.3,0-0.5-0.1-0.7-0.3l-6-6c-0.4-0.4-0.4-1,0-1.4l6-6c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4L10.4,12l5.3,5.3c0.4,0.4,0.4,1,0,1.4C15.5,18.9,15.3,19,15,19z" />
4
+ </svg>
5
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M9,19c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l5.3-5.3L8.3,6.7c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l6,6c0.4,0.4,0.4,1,0,1.4l-6,6C9.5,18.9,9.3,19,9,19z" />
4
+ </svg>
5
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M18,16c-0.3,0-0.5-0.1-0.7-0.3L12,10.4l-5.3,5.3c-0.4,0.4-1,0.4-1.4,0s-0.4-1,0-1.4l6-6c0.4-0.4,1-0.4,1.4,0l6,6c0.4,0.4,0.4,1,0,1.4C18.5,15.9,18.3,16,18,16z" />
4
+ </svg>
5
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M20.222 0c1.406 0 2.54 1.137 2.607 2.475V24l-2.677-2.273-1.47-1.338-1.604-1.398.67 2.205H3.71c-1.402 0-2.54-1.065-2.54-2.476V2.48C1.17 1.142 2.31.003 3.715.003h16.5L20.222 0zm-6.118 5.683h-.03l-.202.2c2.073.6 3.076 1.537 3.076 1.537-1.336-.668-2.54-1.002-3.744-1.137-.87-.135-1.74-.064-2.475 0h-.2c-.47 0-1.47.2-2.81.735-.467.203-.735.336-.735.336s1.002-1.002 3.21-1.537l-.135-.135s-1.672-.064-3.477 1.27c0 0-1.805 3.144-1.805 7.02 0 0 1 1.74 3.743 1.806 0 0 .4-.533.805-1.002-1.54-.468-2.14-1.404-2.14-1.404s.134.066.335.2h.06c.03 0 .044.015.06.03v.006c.016.016.03.03.06.03.33.136.66.27.93.4.466.202 1.065.403 1.8.536.93.135 1.996.2 3.21 0 .6-.135 1.2-.267 1.8-.535.39-.2.87-.4 1.397-.737 0 0-.6.936-2.205 1.404.33.466.795 1 .795 1 2.744-.06 3.81-1.8 3.87-1.726 0-3.87-1.815-7.02-1.815-7.02-1.635-1.214-3.165-1.26-3.435-1.26l.056-.02zm.168 4.413c.703 0 1.27.6 1.27 1.335 0 .74-.57 1.34-1.27 1.34-.7 0-1.27-.6-1.27-1.334.002-.74.573-1.338 1.27-1.338zm-4.543 0c.7 0 1.266.6 1.266 1.335 0 .74-.57 1.34-1.27 1.34-.7 0-1.27-.6-1.27-1.334 0-.74.57-1.338 1.27-1.338z" />
4
+ </svg>
5
+ </template>
@@ -0,0 +1,6 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
+ <path d="M18,23H4c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h7c0.6,0,1,0.4,1,1s-0.4,1-1,1H4C3.4,5,3,5.4,3,6v14c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1v-7c0-0.6,0.4-1,1-1s1,0.4,1,1v7C21,21.7,19.7,23,18,23z" />
4
+ <path d="M8,17c-0.3,0-0.5-0.1-0.7-0.3C7,16.5,6.9,16.1,7,15.8l1-4c0-0.2,0.1-0.3,0.3-0.5l9.5-9.5c1.2-1.2,3.2-1.2,4.4,0c1.2,1.2,1.2,3.2,0,4.4l-9.5,9.5c-0.1,0.1-0.3,0.2-0.5,0.3l-4,1C8.2,17,8.1,17,8,17zM9.9,12.5l-0.5,2.1l2.1-0.5l9.3-9.3c0.4-0.4,0.4-1.1,0-1.6c-0.4-0.4-1.2-0.4-1.6,0l0,0L9.9,12.5z M18.5,2.5L18.5,2.5L18.5,2.5z" />
5
+ </svg>
6
+ </template>
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ aria-hidden="true"
5
+ focusable="false"
6
+ height="24px"
7
+ viewBox="0 0 24 24"
8
+ width="24px"
9
+ >
10
+ <path d="M0 0h24v24H0V0z" fill="none" />
11
+ <path d="M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z" />
12
+ </svg>
13
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z" />
4
+ </svg>
5
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path 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" />
4
+ </svg>
5
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z" />
4
+ </svg>
5
+ </template>
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M0 0h24v24H0z" fill="none"></path>
4
+ <path
5
+ d=" M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z "
6
+ class="css-c4d79v"
7
+ ></path>
8
+ </svg>
9
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z" />
4
+ </svg>
5
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z" />
4
+ </svg>
5
+ </template>
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <circle cx="12" cy="12" r="2" />
4
+ <circle cx="19" cy="12" r="2" />
5
+ <circle cx="5" cy="12" r="2" />
6
+ </svg>
7
+ </template>