heart-ui 0.0.4 → 0.0.6

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.
@@ -3,7 +3,8 @@ export type CssEntry = string | {
3
3
  } | (string | {
4
4
  [x: string]: boolean;
5
5
  })[];
6
- export declare const globalCss: {
6
+ export declare const globalCss: import("vue").Ref<{
7
+ [x: string]: any;
7
8
  icon: {
8
9
  root: string;
9
10
  };
@@ -12,14 +13,5 @@ export declare const globalCss: {
12
13
  prefix: CssEntry;
13
14
  suffix: CssEntry;
14
15
  };
15
- };
16
- export declare const setGlobalCss: (value: Record<string, Record<string, CssEntry>>) => {
17
- icon: {
18
- root: string;
19
- };
20
- button: {
21
- root: string;
22
- prefix: CssEntry;
23
- suffix: CssEntry;
24
- };
25
- } & Record<string, Record<string, CssEntry>>;
16
+ }>;
17
+ export declare const setGlobalCss: (value: Record<string, any>) => void;
@@ -1,14 +1,19 @@
1
- const s = {
1
+ import { ref as s } from "vue";
2
+ const o = {
2
3
  icon: {
3
4
  root: "inline-flex"
4
5
  },
5
6
  button: {
6
- root: "inline-flex items-center",
7
+ root: "inline-flex items-center p-4",
7
8
  prefix: "",
8
9
  suffix: ""
9
10
  }
10
- }, t = s, e = (o) => Object.assign(s, o);
11
+ }, t = s(
12
+ o
13
+ ), n = (e) => {
14
+ t.value = Object.assign(o, e);
15
+ };
11
16
  export {
12
17
  t as globalCss,
13
- e as setGlobalCss
18
+ n as setGlobalCss
14
19
  };
@@ -1 +1,2 @@
1
1
  export * from "./global";
2
+ export * from "./symbols";
@@ -0,0 +1 @@
1
+ export declare const heartGlobalKey: unique symbol;
@@ -0,0 +1,4 @@
1
+ const e = Symbol("heart");
2
+ export {
3
+ e as heartGlobalKey
4
+ };
@@ -1,9 +1,9 @@
1
1
  import { Component } from "vue";
2
2
  import { CssEntry } from "../common";
3
3
  export type ButtonCssProp = {
4
- root: CssEntry;
5
- prefix: CssEntry;
6
- suffix: CssEntry;
4
+ root?: CssEntry;
5
+ prefix?: CssEntry;
6
+ suffix?: CssEntry;
7
7
  };
8
8
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
9
9
  tag: string | Component;
@@ -1,6 +1,6 @@
1
1
  import { CssEntry } from "../common/index";
2
2
  export type IconCssProp = {
3
- root: CssEntry;
3
+ root?: CssEntry;
4
4
  };
5
5
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
6
6
  size: number;
@@ -1,5 +1,3 @@
1
- import HButton from "./HButton.vue";
2
- import HIcon from "./HIcon.vue";
3
1
  export declare const components: (({
4
2
  new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
5
3
  size: {
@@ -166,4 +164,3 @@ export declare const components: (({
166
164
  suffix?(_: {}): any;
167
165
  };
168
166
  })))[];
169
- export { HButton, HIcon };
@@ -1,8 +1,6 @@
1
1
  import o from "./HButton.vue.js";
2
2
  import m from "./HIcon.vue.js";
3
- const s = [o, m];
3
+ const t = [o, m];
4
4
  export {
5
- o as HButton,
6
- m as HIcon,
7
- s as components
5
+ t as components
8
6
  };
@@ -0,0 +1,14 @@
1
+ export declare const useGlobalCss: () => {
2
+ globalCss: import("vue").Ref<{
3
+ [x: string]: any;
4
+ icon: {
5
+ root: string;
6
+ };
7
+ button: {
8
+ root: string;
9
+ prefix: import("../common").CssEntry;
10
+ suffix: import("../common").CssEntry;
11
+ };
12
+ }>;
13
+ setGlobalCss: (value: Record<string, any>) => void;
14
+ };
@@ -0,0 +1,5 @@
1
+ import { globalCss as s, setGlobalCss as o } from "../common/global.js";
2
+ const r = () => ({ globalCss: s, setGlobalCss: o });
3
+ export {
4
+ r as useGlobalCss
5
+ };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { App } from "vue";
1
+ import { type App } from "vue";
2
2
  import { CssEntry } from "./common";
3
3
  export * from "./components";
4
+ export * from "./composables";
4
5
  export * from "./common";
5
6
  export * from "./utils";
6
7
  export declare const HeartUI: {
package/dist/index.js CHANGED
@@ -1,22 +1,21 @@
1
- import { components as s } from "./components/index.js";
2
- import { setGlobalCss as e } from "./common/global.js";
3
- import { globalCss as n } from "./common/global.js";
4
- import { testUtil as x } from "./utils/index.js";
5
- import { default as u } from "./components/HButton.vue.js";
6
- import { default as b } from "./components/HIcon.vue.js";
7
- const f = {
8
- install: (t, r = { css: {} }) => {
9
- e(r.css), s.forEach((o) => {
10
- t.component(o.name, o);
1
+ import { components as t } from "./components/index.js";
2
+ import { setGlobalCss as e, globalCss as l } from "./common/global.js";
3
+ import { heartGlobalKey as m } from "./common/symbols.js";
4
+ import { useGlobalCss as b } from "./composables/index.js";
5
+ import { testUtil as C } from "./utils/index.js";
6
+ const i = {
7
+ install: (o, r = { css: {} }) => {
8
+ e(r.css), o.provide(m, { css: l }), t.forEach((s) => {
9
+ o.component(s.name, s);
11
10
  });
12
11
  }
13
12
  };
14
13
  export {
15
- u as HButton,
16
- b as HIcon,
17
- f as HeartUI,
18
- s as components,
19
- n as globalCss,
14
+ i as HeartUI,
15
+ t as components,
16
+ l as globalCss,
17
+ m as heartGlobalKey,
20
18
  e as setGlobalCss,
21
- x as testUtil
19
+ C as testUtil,
20
+ b as useGlobalCss
22
21
  };
@@ -0,0 +1,30 @@
1
+ declare const _default: import("nuxt/app").Plugin<{
2
+ heart: {
3
+ css: {
4
+ [x: string]: any;
5
+ icon: {
6
+ root: string;
7
+ };
8
+ button: {
9
+ root: string;
10
+ prefix: import("../common").CssEntry;
11
+ suffix: import("../common").CssEntry;
12
+ };
13
+ };
14
+ };
15
+ }> & import("nuxt/app").ObjectPlugin<{
16
+ heart: {
17
+ css: {
18
+ [x: string]: any;
19
+ icon: {
20
+ root: string;
21
+ };
22
+ button: {
23
+ root: string;
24
+ prefix: import("../common").CssEntry;
25
+ suffix: import("../common").CssEntry;
26
+ };
27
+ };
28
+ };
29
+ }>;
30
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import { defineNuxtPlugin as p, useAppConfig as t } from "#app";
2
+ import { setGlobalCss as a, globalCss as o } from "../common/global.js";
3
+ import { heartGlobalKey as l } from "../common/symbols.js";
4
+ const f = p((s) => {
5
+ var e;
6
+ const r = t();
7
+ return a(((e = r.heart) == null ? void 0 : e.css) ?? {}), s.vueApp.provide(l, { css: o.value }), {
8
+ provide: {
9
+ heart: { css: o.value }
10
+ }
11
+ };
12
+ });
13
+ export {
14
+ f as default
15
+ };
package/dist/nuxt.d.ts CHANGED
@@ -1,10 +1,25 @@
1
+ import { globalCss } from ".";
1
2
  declare const _default: import("@nuxt/schema").NuxtModule<import("@nuxt/schema").ModuleOptions>;
2
3
  export default _default;
3
4
  declare module "@nuxt/schema" {
5
+ interface AppConfigInput {
6
+ heart?: {
7
+ css: typeof globalCss;
8
+ } | undefined;
9
+ }
10
+ interface AppConfig {
11
+ heart?: {
12
+ css: typeof globalCss;
13
+ } | undefined;
14
+ }
4
15
  interface NuxtConfig {
5
- heart?: Record<string, unknown>;
16
+ heart?: {
17
+ css: typeof globalCss;
18
+ } | undefined;
6
19
  }
7
20
  interface NuxtOptions {
8
- heart?: Record<string, unknown>;
21
+ heart?: {
22
+ css: typeof globalCss;
23
+ } | undefined;
9
24
  }
10
25
  }
package/dist/nuxt.js CHANGED
@@ -1,18 +1,24 @@
1
- import { defineNuxtModule as e, addComponentsDir as t, createResolver as o } from "@nuxt/kit";
2
- const a = e({
1
+ import { defineNuxtModule as o, createResolver as s, addComponentsDir as t, addImports as r, addPlugin as a } from "@nuxt/kit";
2
+ const l = o({
3
3
  meta: {
4
4
  name: "heart-ui",
5
5
  configKey: "heart"
6
6
  },
7
- setup() {
7
+ setup: () => {
8
+ const e = s(import.meta.url);
8
9
  t({
9
- path: o(import.meta.url).resolve("./components/"),
10
+ path: e.resolve("./components/"),
10
11
  prefix: "h",
11
12
  pattern: "**/*.js",
12
- ignore: ["**/*.vue.js", "**/*.cjs", "**/*.d.ts"]
13
- });
13
+ ignore: ["**/*.vue.js", "**/*.d.ts"]
14
+ }), r({
15
+ name: "useGlobalCss",
16
+ // name of the composable to be used
17
+ as: "useGlobalCss",
18
+ from: e.resolve("./composables/index")
19
+ }), a(e.resolve("./nuxt/plugin"));
14
20
  }
15
21
  });
16
22
  export {
17
- a as default
23
+ l as default
18
24
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .inline-flex{display:inline-flex}.items-center{align-items:center}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }
1
+ .inline-flex{display:inline-flex}.items-center{align-items:center}.p-4{padding:1rem}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }
package/package.json CHANGED
@@ -1,43 +1,56 @@
1
1
  {
2
2
  "name": "heart-ui",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
- "main": "./dist/index.cjs",
9
8
  "module": "./dist/index.js",
10
9
  "exports": {
11
10
  ".": {
12
11
  "import": {
13
12
  "default": "./dist/index.js",
14
13
  "types": "./dist/index.d.ts"
15
- },
16
- "require": {
17
- "default": "./dist/index.cjs",
18
- "types": "./dist/index.d.ts"
19
14
  }
20
15
  },
21
16
  "./nuxt": {
22
17
  "import": {
23
18
  "default": "./dist/nuxt.js",
24
19
  "types": "./dist/nuxt.d.ts"
25
- },
26
- "require": {
27
- "default": "./dist/nuxt.cjs",
28
- "types": "./dist/nuxt.d.ts"
20
+ }
21
+ },
22
+ "./common/*": {
23
+ "import": {
24
+ "default": "./dist/common/*.js",
25
+ "types": "./dist/common/*.d.ts"
26
+ }
27
+ },
28
+ "./components/*": {
29
+ "import": {
30
+ "default": "./dist/components/*.js",
31
+ "types": "./dist/components/*.vue.d.ts"
32
+ }
33
+ },
34
+ "./composables/*": {
35
+ "import": {
36
+ "default": "./dist/composables/*.js",
37
+ "types": "./dist/composables/*.d.ts"
29
38
  }
30
39
  }
31
40
  },
32
41
  "style": "./dist/style.css",
33
- "unpkg": "./dist/index.cjs",
34
- "jsdelivr": "./dist/index.cjs",
42
+ "unpkg": "./dist/index.js",
43
+ "jsdelivr": "./dist/index.js",
35
44
  "scripts": {
36
45
  "dev": "pnpm run -C playground dev",
37
46
  "build": "vite build && vue-tsc",
38
47
  "types": "vue-tsc",
39
48
  "preview": "vite preview",
40
- "release": "changelogen --release && npm publish && git push --follow-tags"
49
+ "release": "changelogen --release && npm publish && git push --follow-tags",
50
+ "docs:dev": "vitepress dev docs",
51
+ "docs:build": "vitepress build docs",
52
+ "docs:preview": "vitepress preview docs",
53
+ "nuxt:prepack": "nuxt-module-build build"
41
54
  },
42
55
  "dependencies": {
43
56
  "@vueuse/core": "^10.7.0",
@@ -51,9 +64,14 @@
51
64
  "@vitejs/plugin-vue": "^4.5.2",
52
65
  "changelogen": "^0.5.5",
53
66
  "glob": "^10.3.10",
67
+ "nuxt": "^3.8.2",
54
68
  "typescript": "^5.2.2",
55
69
  "unocss": "^0.58.0",
56
70
  "vite": "^5.0.8",
71
+ "vitepress": "1.0.0-rc.32",
57
72
  "vue-tsc": "^1.8.25"
73
+ },
74
+ "engines": {
75
+ "node": ">=16"
58
76
  }
59
77
  }
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s={icon:{root:"inline-flex"},button:{root:"inline-flex items-center",prefix:"",suffix:""}},t=s,l=e=>Object.assign(s,e);exports.globalCss=t;exports.setGlobalCss=l;
@@ -1 +0,0 @@
1
- "use strict";const t=require("./HButton.vue.cjs");module.exports=t;
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),t=require("../common/global.cjs"),n=require("./HIcon.vue.cjs"),l=e.defineComponent({name:"HButton",components:{HIcon:n},__name:"HButton",props:{tag:{default:"button"},nativeType:{default:"button"},prefixIcon:{},suffixIcon:{},css:{}},setup(a){return(o,c)=>{var r;return e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.tag),{type:o.nativeType,class:e.normalizeClass(((r=o.css)==null?void 0:r.root)??e.unref(t.globalCss).button.root)},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"prefix",{},()=>{var s;return[o.prefixIcon?(e.openBlock(),e.createBlock(n,{key:0,class:e.normalizeClass(((s=o.css)==null?void 0:s.prefix)??e.unref(t.globalCss).button.prefix)},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.prefixIcon)))]),_:1},8,["class"])):e.createCommentVNode("",!0)]}),e.renderSlot(o.$slots,"default"),e.renderSlot(o.$slots,"suffix",{},()=>{var s;return[o.suffixIcon?(e.openBlock(),e.createBlock(n,{key:0,class:e.normalizeClass(((s=o.css)==null?void 0:s.suffix)??e.unref(t.globalCss).button.suffix)},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.suffixIcon)))]),_:1},8,["class"])):e.createCommentVNode("",!0)]})]),_:3},8,["type","class"])}}});module.exports=l;
@@ -1 +0,0 @@
1
- "use strict";const e=require("./HIcon.vue.cjs");module.exports=e;
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),r=require("../common/global.cjs"),c=e.defineComponent({name:"HIcon",__name:"HIcon",props:{size:{default:24},css:{}},setup(n){const o=n,l=e.computed(()=>({fontSize:o.size,lineHeight:o.size}));return(s,i)=>{var t;return e.openBlock(),e.createElementBlock("i",{style:e.normalizeStyle(l.value),class:e.normalizeClass(((t=s.css)==null?void 0:t.root)??e.unref(r.globalCss).icon.root)},[e.renderSlot(s.$slots,"default")],6)}}});module.exports=c;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./HButton.vue.cjs"),t=require("./HIcon.vue.cjs"),n=[e,t];exports.HButton=e;exports.HIcon=t;exports.components=n;
package/dist/index.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./components/index.cjs"),e=require("./common/global.cjs"),l=require("./utils/index.cjs"),r=require("./components/HButton.vue.cjs"),c=require("./components/HIcon.vue.cjs"),u={install:(o,n={css:{}})=>{e.setGlobalCss(n.css),s.components.forEach(t=>{o.component(t.name,t)})}};exports.components=s.components;exports.globalCss=e.globalCss;exports.setGlobalCss=e.setGlobalCss;exports.testUtil=l.testUtil;exports.HButton=r;exports.HIcon=c;exports.HeartUI=u;
package/dist/nuxt.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";const e=require("@nuxt/kit");var t=typeof document<"u"?document.currentScript:null;const n=e.defineNuxtModule({meta:{name:"heart-ui",configKey:"heart"},setup(){e.addComponentsDir({path:e.createResolver(typeof document>"u"?require("url").pathToFileURL(__filename).href:t&&t.src||new URL("nuxt.cjs",document.baseURI).href).resolve("./components/"),prefix:"h",pattern:"**/*.js",ignore:["**/*.vue.js","**/*.cjs","**/*.d.ts"]})}});module.exports=n;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t="";exports.testUtil=t;