Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 68e3b61

Browse files
committed
docs: add in vitepress docs
chore: remove nuxt docs chore: remove old docs fix(package.json): missing types from exports refactor(types): don't export default types -- not TypeScript v5 compatible fix(carousel): duplicate div with slots fix(carousel): v-for on transition
1 parent fefe8fa commit 68e3b61

File tree

284 files changed

+2362
-42946
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+2362
-42946
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
[*.{js,jsx,ts,tsx,vue}]
1+
[*.{js,jsx,ts,tsx,vue,json}]
22
indent_size = 2

apps/docs/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
components.d.ts
2+
3+
.vitepress/cache

apps/docs/.vitepress/config.ts

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { defineConfig } from 'vitepress'
2+
import Components from 'unplugin-vue-components/vite'
3+
import { BootstrapVueNextResolver } from 'unplugin-vue-components/resolvers'
4+
import Icons from 'unplugin-icons/vite'
5+
import IconsResolver from 'unplugin-icons/resolver'
6+
7+
// https://vitepress.dev/reference/site-config
8+
export default defineConfig({
9+
title: "BootstrapVueNext",
10+
description: "BootstrapVueNext Documentation",
11+
srcDir: 'src',
12+
head: [
13+
['link', { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
14+
],
15+
vite: {
16+
plugins: [
17+
Components({
18+
resolvers: [
19+
IconsResolver(),
20+
BootstrapVueNextResolver(),
21+
]
22+
}) as any,
23+
Icons()
24+
]
25+
},
26+
locales: {
27+
root: {
28+
label: 'English',
29+
lang: 'en'
30+
}
31+
},
32+
appearance: false
33+
})

apps/docs/.vitepress/theme/Layout.vue

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
<template>
2+
<BContainer fluid class="p-0">
3+
<BRow>
4+
<BCol>
5+
<BNavbar variant="primary">
6+
<BNavbarNav>
7+
<BNavbarBrand to="/">Home</BNavbarBrand>
8+
<BNav>
9+
<BNavItem to="/getting-started">Getting Started</BNavItem>
10+
<BNavItem to="/reference/components">Components</BNavItem>
11+
<BNavItem to="/reference/composables">Composables</BNavItem>
12+
<BNavItem to="/reference/directives">Directives</BNavItem>
13+
<BNavItem to="/reference/icons">Icons</BNavItem>
14+
<BNavItem to="/reference/types">Types</BNavItem>
15+
<BNavItem to="/migration-guide">Migrate</BNavItem>
16+
</BNav>
17+
</BNavbarNav>
18+
<BNav>
19+
<BButton
20+
:variant="variant"
21+
:href="appInfo.githubUrl"
22+
aria-label="Open Github"
23+
target="_blank"
24+
rel="noopener"
25+
>
26+
<GithubIcon aria-hidden />
27+
</BButton>
28+
<BButton
29+
:variant="variant"
30+
:href="appInfo.discordUrl"
31+
aria-label="Open Discord Server"
32+
target="_blank"
33+
rel="noopener"
34+
>
35+
<DiscordIcon aria-hidden />
36+
</BButton>
37+
<BDropdown :variant="variant" lazy>
38+
<!-- TODO there's no way to adjust these options, say if you wanted to remove the padding -->
39+
<template #button-content>
40+
<component :is="currentIcon" v-if="show" :aria-label="`Toggle theme (${proxy})`" />
41+
</template>
42+
<b-dropdown-item v-for="el in options" :key="el" :active="proxy === el" @click="set(el)">
43+
<component :is="map[el]" /> {{ el }}
44+
</b-dropdown-item>
45+
</BDropdown>
46+
</BNav>
47+
</BNavbar>
48+
</BCol>
49+
</BRow>
50+
<BRow v-if="page.isNotFound">
51+
<BCol>
52+
<BContainer class="text-center my-auto p-5">
53+
<BRow>
54+
<BCol>
55+
<h1>Oh No!</h1>
56+
</BCol>
57+
</BRow>
58+
<BRow>
59+
<BCol>
60+
<h2>File Not Found</h2>
61+
</BCol>
62+
</BRow>
63+
</BContainer>
64+
</BCol>
65+
</BRow>
66+
<BRow v-else>
67+
<BCol>
68+
<BContainer>
69+
<BRow>
70+
<BCol>
71+
<Content />
72+
</BCol>
73+
</BRow>
74+
</BContainer>
75+
</BCol>
76+
</BRow>
77+
</BContainer>
78+
</template>
79+
80+
<script setup lang="ts">
81+
import {ref, onMounted, toRef, computed, provide} from 'vue'
82+
import {useColorMode} from 'bootstrap-vue-next'
83+
import GithubIcon from '~icons/bi/github'
84+
import DiscordIcon from '~icons/bi/discord'
85+
import MoonStarsFill from '~icons/bi/moon-stars-fill'
86+
import SunFill from '~icons/bi/sun-fill'
87+
import CircleHalf from '~icons/bi/circle-half'
88+
import { useData } from 'vitepress'
89+
import {appInfoKey} from './keys'
90+
91+
// https://vitepress.dev/reference/runtime-api#usedata
92+
const { page } = useData()
93+
94+
const variant = null as any
95+
96+
const show = ref(false)
97+
98+
onMounted(() => { show.value = true })
99+
100+
const dark = useColorMode({
101+
persist: true,
102+
})
103+
104+
const proxy = toRef(dark, 'value')
105+
106+
const map = {
107+
dark: MoonStarsFill,
108+
light: SunFill,
109+
auto: CircleHalf,
110+
}
111+
112+
const options = Object.keys(map) as (keyof typeof map)[]
113+
114+
const currentIcon = computed(() => map[dark.value])
115+
116+
const set = (newValue: keyof typeof map) => (dark.value = newValue)
117+
118+
const appInfo = {
119+
githubUrl: 'https://github.com/bootstrap-vue/bootstrap-vue-next',
120+
discordUrl: 'https://discord.gg/j2Mtcny',
121+
}
122+
123+
provide(appInfoKey, appInfo)
124+
</script>

apps/docs/.vitepress/theme/index.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// https://vitepress.dev/guide/custom-theme
2+
import Layout from './Layout.vue'
3+
4+
import 'bootstrap/dist/css/bootstrap.css'
5+
import 'bootstrap-vue-next/dist/bootstrap-vue-next.css'
6+
7+
export default {
8+
Layout,
9+
enhanceApp() {
10+
// ...
11+
},
12+
}
13+

apps/docs/.vitepress/theme/keys.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const appInfoKey = Symbol('app-info')

apps/docs/docs/.vuepress/PluginComponentReference/client.ts

-14
This file was deleted.

apps/docs/docs/.vuepress/PluginComponentReference/client/components/anchored-heading.ts

-39
This file was deleted.

0 commit comments

Comments
 (0)