heart-ui 0.0.7 → 0.0.9
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.
- package/dist/nuxt/nuxt.config.d.ts +2 -0
- package/dist/nuxt-layer/components/HButton.vue +47 -0
- package/dist/nuxt-layer/components/HIcon.vue +29 -0
- package/dist/nuxt-layer/components/index.ts +4 -0
- package/dist/nuxt-layer/composables/index.ts +5 -0
- package/dist/nuxt-layer/nuxt.config.ts +3 -0
- package/dist/nuxt-layer/utils/index.ts +1 -0
- package/dist/nuxt.js +8 -8
- package/package.json +11 -6
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="tag"
|
|
4
|
+
:type="nativeType"
|
|
5
|
+
:class="css?.root ?? globalCss.button.root"
|
|
6
|
+
>
|
|
7
|
+
<slot name="prefix">
|
|
8
|
+
<HIcon v-if="prefixIcon" :class="css?.prefix ?? globalCss.button.prefix">
|
|
9
|
+
<component :is="prefixIcon" />
|
|
10
|
+
</HIcon>
|
|
11
|
+
</slot>
|
|
12
|
+
<slot />
|
|
13
|
+
<slot name="suffix">
|
|
14
|
+
<HIcon v-if="suffixIcon" :class="css?.suffix ?? globalCss.button.suffix">
|
|
15
|
+
<component :is="suffixIcon" />
|
|
16
|
+
</HIcon>
|
|
17
|
+
</slot>
|
|
18
|
+
</component>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import { Component } from "vue";
|
|
23
|
+
import { CssEntry, globalCss } from "../common";
|
|
24
|
+
import HIcon from "./HIcon.vue";
|
|
25
|
+
|
|
26
|
+
export type ButtonCssProp = {
|
|
27
|
+
root?: CssEntry;
|
|
28
|
+
prefix?: CssEntry;
|
|
29
|
+
suffix?: CssEntry;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
defineOptions({ name: "HButton", components: { HIcon } });
|
|
33
|
+
|
|
34
|
+
withDefaults(
|
|
35
|
+
defineProps<{
|
|
36
|
+
tag: string | Component;
|
|
37
|
+
nativeType: string;
|
|
38
|
+
prefixIcon?: Component;
|
|
39
|
+
suffixIcon?: Component;
|
|
40
|
+
css?: ButtonCssProp;
|
|
41
|
+
}>(),
|
|
42
|
+
{
|
|
43
|
+
tag: "button",
|
|
44
|
+
nativeType: "button",
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<i :style="computedStyle" :class="css?.root ?? globalCss.icon.root">
|
|
3
|
+
<slot />
|
|
4
|
+
</i>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { CSSProperties, computed } from "vue";
|
|
9
|
+
import { CssEntry, globalCss } from "../common/index";
|
|
10
|
+
|
|
11
|
+
export type IconCssProp = {
|
|
12
|
+
root?: CssEntry;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
defineOptions({ name: "HIcon" });
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(
|
|
18
|
+
defineProps<{
|
|
19
|
+
size: number;
|
|
20
|
+
css?: IconCssProp;
|
|
21
|
+
}>(),
|
|
22
|
+
{ size: 24 }
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const computedStyle = computed<CSSProperties>(() => ({
|
|
26
|
+
fontSize: props.size,
|
|
27
|
+
lineHeight: props.size,
|
|
28
|
+
}));
|
|
29
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const testUtil = "";
|
package/dist/nuxt.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineNuxtModule as o, createResolver as
|
|
2
|
-
const
|
|
1
|
+
import { defineNuxtModule as o, createResolver as t, addComponentsDir as r, addImports as n, addPlugin as a } from "@nuxt/kit";
|
|
2
|
+
const p = o({
|
|
3
3
|
meta: {
|
|
4
4
|
name: "heart-ui",
|
|
5
5
|
configKey: "heart"
|
|
6
6
|
},
|
|
7
|
-
setup: () => {
|
|
8
|
-
const e =
|
|
9
|
-
|
|
7
|
+
setup: (l, s) => {
|
|
8
|
+
const e = t(import.meta.url);
|
|
9
|
+
r({
|
|
10
10
|
path: e.resolve("./components/"),
|
|
11
11
|
prefix: "h",
|
|
12
12
|
pattern: "**/*.js",
|
|
13
13
|
ignore: ["**/*.vue.js", "**/*.d.ts"]
|
|
14
|
-
}),
|
|
14
|
+
}), n({
|
|
15
15
|
name: "useGlobalCss",
|
|
16
16
|
// name of the composable to be used
|
|
17
17
|
as: "useGlobalCss",
|
|
18
18
|
from: e.resolve("./composables/index")
|
|
19
|
-
}), a(e.resolve("./nuxt/plugin"));
|
|
19
|
+
}), s.options.build.transpile.push(e.resolve("./nuxt/plugin")), a(e.resolve("./nuxt/plugin"));
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
p as default
|
|
24
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "heart-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -36,6 +36,11 @@
|
|
|
36
36
|
"default": "./dist/composables/*.js",
|
|
37
37
|
"types": "./dist/composables/*.d.ts"
|
|
38
38
|
}
|
|
39
|
+
},
|
|
40
|
+
"./nuxt-layer": {
|
|
41
|
+
"import": {
|
|
42
|
+
"default": "./dist/nuxt-layer/nuxt.config.ts"
|
|
43
|
+
}
|
|
39
44
|
}
|
|
40
45
|
},
|
|
41
46
|
"style": "./dist/style.css",
|
|
@@ -43,14 +48,13 @@
|
|
|
43
48
|
"jsdelivr": "./dist/index.js",
|
|
44
49
|
"scripts": {
|
|
45
50
|
"dev": "pnpm run -C playground dev",
|
|
46
|
-
"build": "vite build && vue-tsc",
|
|
51
|
+
"build": "vite build && vue-tsc && node ./scripts/nuxt-layer.js",
|
|
47
52
|
"types": "vue-tsc",
|
|
48
|
-
"preview": "
|
|
49
|
-
"release": "changelogen --
|
|
53
|
+
"preview": "pnpm run -C playground preview",
|
|
54
|
+
"release": "changelogen --clean --bump --r && npm publish && git push --follow-tags",
|
|
50
55
|
"docs:dev": "vitepress dev docs",
|
|
51
56
|
"docs:build": "vitepress build docs",
|
|
52
|
-
"docs:preview": "vitepress preview docs"
|
|
53
|
-
"nuxt:prepack": "nuxt-module-build build"
|
|
57
|
+
"docs:preview": "vitepress preview docs"
|
|
54
58
|
},
|
|
55
59
|
"dependencies": {
|
|
56
60
|
"@vueuse/core": "^10.7.0",
|
|
@@ -68,6 +72,7 @@
|
|
|
68
72
|
"typescript": "^5.2.2",
|
|
69
73
|
"unocss": "^0.58.0",
|
|
70
74
|
"vite": "^5.0.8",
|
|
75
|
+
"vite-plugin-build": "^0.10.0",
|
|
71
76
|
"vitepress": "1.0.0-rc.32",
|
|
72
77
|
"vue-tsc": "^1.8.25"
|
|
73
78
|
},
|