From 9e977917ebe47526375a7459d623d7d91b2f1f0c Mon Sep 17 00:00:00 2001 From: zernonia Date: Tue, 5 Sep 2023 14:29:34 +0800 Subject: [PATCH] feat: add exmaples layout --- apps/www/.vitepress/theme/Layout.vue | 21 ----- .../theme/components/ExamplesNav.vue | 81 +++++++++++++++++++ .../theme/components/LandingPage.vue | 75 +++++++++++++++++ .../theme/components/PageHeader.vue | 16 ++++ .../components/PageHeaderDescription.vue | 10 +++ .../theme/components/PageHeaderHeading.vue | 14 ++++ apps/www/.vitepress/theme/index.ts | 2 + .../theme/layout/ExamplesLayout.vue | 63 +++++++++++++++ .../.vitepress/theme/layout/MainLayout.vue | 3 + apps/www/package.json | 3 +- apps/www/src/content/example/dashboard.md | 1 - apps/www/src/content/examples/dashboard.md | 5 ++ apps/www/src/content/index.md | 4 +- .../default/ui/scroll-area/ScrollArea.vue | 22 ++--- .../default/ui/scroll-area/ScrollBar.vue | 23 ++++++ .../registry/default/ui/scroll-area/index.ts | 1 + pnpm-lock.yaml | 12 +++ 17 files changed, 315 insertions(+), 41 deletions(-) delete mode 100644 apps/www/.vitepress/theme/Layout.vue create mode 100644 apps/www/.vitepress/theme/components/ExamplesNav.vue create mode 100644 apps/www/.vitepress/theme/components/LandingPage.vue create mode 100644 apps/www/.vitepress/theme/components/PageHeader.vue create mode 100644 apps/www/.vitepress/theme/components/PageHeaderDescription.vue create mode 100644 apps/www/.vitepress/theme/components/PageHeaderHeading.vue create mode 100644 apps/www/.vitepress/theme/layout/ExamplesLayout.vue delete mode 100644 apps/www/src/content/example/dashboard.md create mode 100644 apps/www/src/content/examples/dashboard.md create mode 100644 apps/www/src/lib/registry/default/ui/scroll-area/ScrollBar.vue diff --git a/apps/www/.vitepress/theme/Layout.vue b/apps/www/.vitepress/theme/Layout.vue deleted file mode 100644 index f535b083..00000000 --- a/apps/www/.vitepress/theme/Layout.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - diff --git a/apps/www/.vitepress/theme/components/ExamplesNav.vue b/apps/www/.vitepress/theme/components/ExamplesNav.vue new file mode 100644 index 00000000..eb2c9d57 --- /dev/null +++ b/apps/www/.vitepress/theme/components/ExamplesNav.vue @@ -0,0 +1,81 @@ + + + diff --git a/apps/www/.vitepress/theme/components/LandingPage.vue b/apps/www/.vitepress/theme/components/LandingPage.vue new file mode 100644 index 00000000..4b3e80f9 --- /dev/null +++ b/apps/www/.vitepress/theme/components/LandingPage.vue @@ -0,0 +1,75 @@ + + + diff --git a/apps/www/.vitepress/theme/components/PageHeader.vue b/apps/www/.vitepress/theme/components/PageHeader.vue new file mode 100644 index 00000000..824c3068 --- /dev/null +++ b/apps/www/.vitepress/theme/components/PageHeader.vue @@ -0,0 +1,16 @@ + + + diff --git a/apps/www/.vitepress/theme/components/PageHeaderDescription.vue b/apps/www/.vitepress/theme/components/PageHeaderDescription.vue new file mode 100644 index 00000000..9869756c --- /dev/null +++ b/apps/www/.vitepress/theme/components/PageHeaderDescription.vue @@ -0,0 +1,10 @@ + + + diff --git a/apps/www/.vitepress/theme/components/PageHeaderHeading.vue b/apps/www/.vitepress/theme/components/PageHeaderHeading.vue new file mode 100644 index 00000000..32ad81a9 --- /dev/null +++ b/apps/www/.vitepress/theme/components/PageHeaderHeading.vue @@ -0,0 +1,14 @@ + + + diff --git a/apps/www/.vitepress/theme/index.ts b/apps/www/.vitepress/theme/index.ts index 52335bb9..197b7d09 100644 --- a/apps/www/.vitepress/theme/index.ts +++ b/apps/www/.vitepress/theme/index.ts @@ -2,6 +2,7 @@ // https://vitepress.dev/guide/custom-theme import Layout from './layout/MainLayout.vue' import DocsLayout from './layout/DocsLayout.vue' +import ExamplesLayout from './layout/ExamplesLayout.vue' import * as components from './components' import './style.css' import './styles/vp-doc.css' @@ -12,6 +13,7 @@ export default { enhanceApp({ app }) { // ... app.component('docs', DocsLayout) + app.component('examples', ExamplesLayout) for (const component of Object.keys(components)) app.component(component, components[component]) diff --git a/apps/www/.vitepress/theme/layout/ExamplesLayout.vue b/apps/www/.vitepress/theme/layout/ExamplesLayout.vue new file mode 100644 index 00000000..75d857e7 --- /dev/null +++ b/apps/www/.vitepress/theme/layout/ExamplesLayout.vue @@ -0,0 +1,63 @@ + + + diff --git a/apps/www/.vitepress/theme/layout/MainLayout.vue b/apps/www/.vitepress/theme/layout/MainLayout.vue index fdf33237..ee9ca831 100644 --- a/apps/www/.vitepress/theme/layout/MainLayout.vue +++ b/apps/www/.vitepress/theme/layout/MainLayout.vue @@ -109,6 +109,9 @@ const links = [ + + + diff --git a/apps/www/package.json b/apps/www/package.json index 12de379b..99d95ce3 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -23,7 +23,8 @@ "tailwindcss-animate": "^1.0.6", "v-calendar": "^3.0.3", "vitepress": "^1.0.0-rc.10", - "vue": "^3.3.4" + "vue": "^3.3.4", + "vue-wrap-balancer": "^1.1.3" }, "devDependencies": { "@iconify-json/radix-icons": "^1.1.11", diff --git a/apps/www/src/content/example/dashboard.md b/apps/www/src/content/example/dashboard.md deleted file mode 100644 index 32f95c0d..00000000 --- a/apps/www/src/content/example/dashboard.md +++ /dev/null @@ -1 +0,0 @@ -hi \ No newline at end of file diff --git a/apps/www/src/content/examples/dashboard.md b/apps/www/src/content/examples/dashboard.md new file mode 100644 index 00000000..6ddd81d6 --- /dev/null +++ b/apps/www/src/content/examples/dashboard.md @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/apps/www/src/content/index.md b/apps/www/src/content/index.md index 0c7721dc..4da94590 100644 --- a/apps/www/src/content/index.md +++ b/apps/www/src/content/index.md @@ -3,7 +3,7 @@ home: true --- - \ No newline at end of file + \ No newline at end of file diff --git a/apps/www/src/lib/registry/default/ui/scroll-area/ScrollArea.vue b/apps/www/src/lib/registry/default/ui/scroll-area/ScrollArea.vue index f0c7fc61..c56cf87d 100644 --- a/apps/www/src/lib/registry/default/ui/scroll-area/ScrollArea.vue +++ b/apps/www/src/lib/registry/default/ui/scroll-area/ScrollArea.vue @@ -1,17 +1,16 @@ + + diff --git a/apps/www/src/lib/registry/default/ui/scroll-area/index.ts b/apps/www/src/lib/registry/default/ui/scroll-area/index.ts index 82a7ce7d..2bd4fae5 100644 --- a/apps/www/src/lib/registry/default/ui/scroll-area/index.ts +++ b/apps/www/src/lib/registry/default/ui/scroll-area/index.ts @@ -1 +1,2 @@ export { default as ScrollArea } from './ScrollArea.vue' +export { default as ScrollBar } from './ScrollBar.vue' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 000f0ea5..8eb6f3e4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -80,6 +80,9 @@ importers: vue: specifier: ^3.3.4 version: 3.3.4 + vue-wrap-balancer: + specifier: ^1.1.3 + version: 1.1.3(vue@3.3.4) devDependencies: '@iconify-json/radix-icons': specifier: ^1.1.11 @@ -7877,6 +7880,15 @@ packages: typescript: 5.0.2 dev: true + /vue-wrap-balancer@1.1.3(vue@3.3.4): + resolution: {integrity: sha512-9kTRwYIveWxV1FdaCJfRjIIRZOtwgnxypGS5mlAiXnih5+Cfaby9YDh3APMW1jWp0oCvL+gep0XCbcjBb7/ZXQ==} + peerDependencies: + vue: ^3.3.0 + dependencies: + nanoid: 3.3.6 + vue: 3.3.4 + dev: false + /vue@3.3.4: resolution: {integrity: sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==} dependencies: