heart-ui 0.0.8 → 0.0.10

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.
@@ -0,0 +1,2 @@
1
+ declare const _default: import("c12").InputConfig<import("@nuxt/schema").NuxtConfig, import("c12").ConfigLayerMeta>;
2
+ export default _default;
@@ -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,4 @@
1
+ import HButton from "./HButton.vue";
2
+ import HIcon from "./HIcon.vue";
3
+
4
+ export const components = [HButton, HIcon];
@@ -0,0 +1,5 @@
1
+ import { globalCss, setGlobalCss } from "../common";
2
+
3
+ export const useGlobalCss = () => {
4
+ return { globalCss, setGlobalCss };
5
+ };
@@ -0,0 +1,3 @@
1
+ import { defineNuxtConfig } from "nuxt/config";
2
+
3
+ export default defineNuxtConfig({});
@@ -0,0 +1 @@
1
+ export const testUtil = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heart-ui",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
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": "vite preview",
49
- "release": "changelogen --release && npm publish && git push --follow-tags",
53
+ "preview": "pnpm run -C playground preview",
54
+ "release": "changelogen --clean --release && 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
  },