Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 12a93fa

Browse files
Merge pull request #19 from chakra-ui/docs/setup
Docs/setup
2 parents ee62a4b + b086016 commit 12a93fa

File tree

18 files changed

+701
-134
lines changed

18 files changed

+701
-134
lines changed

@types/index.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

@types/jsx.d.ts

Lines changed: 0 additions & 61 deletions
This file was deleted.

docs/.vitepress/__theme/index.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
import Default from '../../layouts/default.vue'
3+
import { domElements, chakra } from '@chakra-ui/vue-system'
4+
import ChakraUIVue from '@chakra-ui/vue-next'
5+
// import kebabCase from 'lodash.kebabcase'
6+
function kebabCase(key) {
7+
const result = key.replace(/([A-Z])/g, " $1").trim();
8+
return result.split(" ").join("-").toLowerCase();
9+
}
10+
11+
export default {
12+
Layout: Default,
13+
NotFound: () => 'custom 404', // <- this is a Vue 3 functional component
14+
enhanceApp({ app }) {
15+
// app is the Vue 3 app instance from `createApp()`. router is VitePress'
16+
// custom router. `siteData`` is a `ref`` of current site-level metadata.
17+
app.use(ChakraUIVue, {
18+
icons: {
19+
library: {
20+
feActivity
21+
}
22+
}
23+
})
24+
25+
domElements.forEach((tag) => {
26+
app.component(`chakra.${tag}`, chakra(tag))
27+
})
28+
29+
Object.keys(ChakraUIVue).forEach((component) => {
30+
if (kebabCase(component).startsWith('c-')) {
31+
app.component(component, ChakraUIVue[component])
32+
}
33+
})
34+
}
35+
}

docs/.vitepress/config.js

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
module.exports = {
2+
lang: 'en-US',
3+
title: '@chakra-ui/vue@next',
4+
description: 'Build accessible Vue apps with speed',
5+
6+
themeConfig: {
7+
repo: 'chakra-ui/chakra-ui-vue-next',
8+
docsDir: 'docs',
9+
10+
editLinks: true,
11+
editLinkText: 'Edit this page on GitHub',
12+
lastUpdated: 'Last Updated',
13+
14+
nav: [
15+
{ text: 'Guide', link: '/', activeMatch: '^/$|^/guide/' },
16+
{
17+
text: 'Config Reference',
18+
link: '/config/basics',
19+
activeMatch: '^/config/'
20+
},
21+
{
22+
text: 'Release Notes',
23+
link: 'https://github.com/chakra-ui/chakra-ui-vue-next/releases'
24+
}
25+
],
26+
27+
sidebar: {
28+
'/setup/': getSetupSidebar(),
29+
'/components/': getSetupSidebar(),
30+
'/': getSetupSidebar()
31+
}
32+
}
33+
}
34+
35+
function getSetupSidebar() {
36+
return [
37+
{
38+
text: 'Introduction',
39+
children: [
40+
{ text: 'Chakra UI Vue', link: '/' },
41+
{ text: 'Getting Started', link: '/guide/getting-started' }
42+
]
43+
},
44+
{
45+
text: 'Components',
46+
children: [
47+
{ text: 'Alert', link: '/components/alert' },
48+
{ text: 'Button', link: '/components/button' },
49+
{ text: 'Icon', link: '/components/icon' },
50+
{ text: 'Spinner', link: '/components/spinner' },
51+
{ text: 'CSS reset', link: '/components/css-reset' },
52+
{ text: 'Visually hidden', link: '/components/visually-hidden' },
53+
]
54+
}
55+
]
56+
}
57+
58+
function getComponentsSidebar() {
59+
return [
60+
{
61+
text: 'Components',
62+
children: [
63+
{ text: 'Alert', link: '/components/alert' },
64+
{ text: 'Button', link: '/components/button' },
65+
{ text: 'Icon', link: '/components/icon' },
66+
{ text: 'Spinner', link: '/components/spinner' },
67+
{ text: 'CSS reset', link: '/components/css-reset' },
68+
{ text: 'Visually hidden', link: '/components/visually-hidden' },
69+
]
70+
},
71+
// {
72+
// text: 'Theme',
73+
// children: [
74+
// { text: 'Homepage', link: '/config/homepage' },
75+
// { text: 'Algolia Search', link: '/config/algolia-search' },
76+
// { text: 'Carbon Ads', link: '/config/carbon-ads' }
77+
// ]
78+
// }
79+
]
80+
}

docs/components/alert.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Alert
2+
3+
> TODO

docs/components/button.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Button
2+
3+
> TODO

docs/components/css-reset.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# CSS Reset
2+
3+
> TODO

docs/components/icon.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Icon
2+
3+
> TODO

docs/components/spinner.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Spinner
2+
3+
> TODO

docs/components/visually-hidden.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Visually hidden
2+
3+
> TODO

0 commit comments

Comments
 (0)