Skip to content

Commit 70339f2

Browse files
committed
feat(alert): Add a new component under development
1 parent 29e1e97 commit 70339f2

File tree

14 files changed

+210
-23
lines changed

14 files changed

+210
-23
lines changed

docs/.vitepress/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export default defineConfig({
4848
collapsed: true,
4949
items: [
5050
{ text: '按钮', link: '/components/button' },
51+
{ text: 'alert', link: '/components/alert' },
5152
],
5253
},
5354
],

docs/.vitepress/theme/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import DefaultTheme from 'vitepress/theme'
22
import type { Theme } from 'vitepress'
3-
import { Button } from 'nextui-vue'
3+
import { Alert, Button } from 'nextui-vue'
44
import './styles.css'
55

66
export default {
77
extends: DefaultTheme,
88
enhanceApp({ app }) {
99
app.component('NButton', Button)
10+
app.component('NAlert', Alert)
1011
},
1112
} satisfies Theme

docs/components/alert.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# 按钮组件
2+
## 按需安装
3+
```bash
4+
npm add @vue-nextui/alert
5+
```
6+
7+
如果你使用[全局安装](/guide/installation#全局安装)的方式,可忽略此安装步骤
8+
9+
## 基础用法
10+
<NAlert>alert</NAlert>

packages/components/alert/.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
!.vscode/settings.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?
26+
docs/.vitepress/dist
27+
docs/.vitepress/cache

packages/components/alert/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 hotdogc1017
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/components/alert/README.md

Whitespace-only changes.

packages/components/alert/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as Alert } from './src/Alert.vue'
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "@vue-nextui/alert",
3+
"type": "module",
4+
"version": "0.0.0-beta.1",
5+
"author": {
6+
"name": "hotdog",
7+
"email": "hotdogc1017@gmail.com",
8+
"url": "https://github.com/hotdogc1017"
9+
},
10+
"publishConfig": {
11+
"access": "public",
12+
"registry": "https://registry.npmjs.org/"
13+
},
14+
"license": "MIT",
15+
"repository": {
16+
"url": "git+https://github.com/hotdogc1017/nextui-vue.git"
17+
},
18+
"bugs": {
19+
"url": "https://github.com/hotdogc1017/nextui-vue/issues"
20+
},
21+
"keywords": [
22+
"nextui",
23+
"vue",
24+
"ui framework",
25+
"tailwindcss",
26+
"alert component"
27+
],
28+
"exports": {
29+
".": "./dist/index.js"
30+
},
31+
"files": [
32+
"dist"
33+
],
34+
"scripts": {
35+
"dev": "vite -w build",
36+
"build": "vite build"
37+
},
38+
"dependencies": {
39+
"@vue-nextui/shared": "workspace: *"
40+
},
41+
"devDependencies": {
42+
"@heroui/theme": "^2.4.6",
43+
"@types/node": "^22.10.5",
44+
"@vitejs/plugin-vue": "^5.0.5",
45+
"@vue/tsconfig": "^0.5.1",
46+
"vite": "^5.3.4",
47+
"vite-plugin-dts": "^4.5.0",
48+
"vue": "^3.5.0"
49+
}
50+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script lang="ts" setup>
2+
import { ref } from 'vue'
3+
import { alert } from '@heroui/theme'
4+
5+
const classname = alert({})
6+
7+
console.log(classname)
8+
</script>
9+
10+
<template>
11+
<span :class="classname">
12+
<slot />
13+
</span>
14+
</template>
15+
16+
<style scoped>
17+
18+
</style>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "@vue/tsconfig/tsconfig.dom.json",
3+
"compilerOptions": {
4+
"baseUrl": ".",
5+
},
6+
"files": ["./index.ts"],
7+
"include": ["./src/**/*", "./src/**/*.vue"]
8+
}

0 commit comments

Comments
 (0)