jky-component-lib 0.0.6 → 0.0.8
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/README.md +4 -0
- package/dist/es/button/Button.vue.d.ts +27 -0
- package/dist/es/button/Button.vue.js +90 -0
- package/dist/es/button/Button.vue3.js +5 -0
- package/dist/es/button/index.d.ts +4 -0
- package/dist/es/button/index.js +8 -0
- package/dist/es/button/style.css +113 -0
- package/dist/es/components.d.ts +1 -0
- package/dist/es/components.js +8 -6
- package/dist/es/index.d.ts +4 -5
- package/dist/es/index.js +15 -11
- package/dist/es/package.json.js +2 -2
- package/dist/es/resolver.js +7 -7
- package/dist/es/say-hello/SayHello.vue.d.ts +5 -0
- package/dist/es/say-hello/SayHello.vue.js +34 -12
- package/dist/es/say-hello/SayHello.vue3.js +2 -2
- package/dist/es/say-hello/index.d.ts +2 -2
- package/dist/es/say-hello/index.js +5 -5
- package/dist/es/say-hello/style.css +13 -1
- package/dist/es/styles.css +1 -1
- package/dist/es/utils/index.d.ts +1 -0
- package/dist/es/utils/installer.d.ts +5 -3
- package/dist/es/utils/installer.js +15 -9
- package/dist/es/utils/string.d.ts +18 -0
- package/dist/es/utils/types.d.ts +10 -0
- package/dist/es/utils/with-install.js +11 -6
- package/dist/lib/button/Button.vue.d.ts +27 -0
- package/dist/lib/button/Button.vue.js +90 -0
- package/dist/lib/button/Button.vue3.js +5 -0
- package/dist/lib/button/index.d.ts +4 -0
- package/dist/lib/button/index.js +8 -0
- package/dist/lib/button/style.css +113 -0
- package/dist/lib/components.d.ts +1 -0
- package/dist/lib/components.js +11 -1
- package/dist/lib/index.d.ts +4 -5
- package/dist/lib/index.js +17 -1
- package/dist/lib/package.json.js +4 -1
- package/dist/lib/resolver.js +19 -1
- package/dist/lib/say-hello/SayHello.vue.d.ts +5 -0
- package/dist/lib/say-hello/SayHello.vue.js +42 -1
- package/dist/lib/say-hello/SayHello.vue3.js +5 -1
- package/dist/lib/say-hello/index.d.ts +2 -2
- package/dist/lib/say-hello/index.js +8 -1
- package/dist/lib/say-hello/style.css +13 -1
- package/dist/lib/styles.css +1 -1
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/installer.d.ts +5 -3
- package/dist/lib/utils/installer.js +20 -1
- package/dist/lib/utils/string.d.ts +18 -0
- package/dist/lib/utils/types.d.ts +10 -0
- package/dist/lib/utils/with-install.js +14 -1
- package/dist/umd/index.js +172 -2
- package/dist/umd/styles.css +1 -1
- package/dist/volar.d.ts +9 -1
- package/package.json +7 -4
- package/dist/es/node_modules/@kieranwv/utils/dist/index.js +0 -6
- package/dist/lib/node_modules/@kieranwv/utils/dist/index.js +0 -1
package/README.md
CHANGED
|
@@ -17,6 +17,10 @@ Vue 3 component library starter template, provides VitePress documentation, supp
|
|
|
17
17
|
- [VitePress](https://vitepress.dev/) documentation - Deploy on [Netlify](https://app.netlify.com/) with zero-config, supports other deployment methods as well.
|
|
18
18
|
- Manage versions using the [bumpp](https://github.com/antfu-collective/bumpp), and publish to npm with zero-configPublish to [npm](https://www.npmjs.com) with zero-config.
|
|
19
19
|
|
|
20
|
+
## Element Plus
|
|
21
|
+
|
|
22
|
+
This component library is built based on Element Plus, providing enhanced and customized components.
|
|
23
|
+
|
|
20
24
|
## Usage
|
|
21
25
|
|
|
22
26
|
[Create a repo](https://github.com/starter-collective/jky-component-lib/generate) from this template on GitHub.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
type?: 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
3
|
+
size?: 'large' | 'default' | 'small';
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
default?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {};
|
|
13
|
+
rootEl: HTMLButtonElement;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
17
|
+
click: () => any;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
|
+
onClick?: (() => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
|
|
21
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createCommentVNode, renderSlot } from "vue";
|
|
21
|
+
const _hoisted_1 = ["disabled"];
|
|
22
|
+
const _hoisted_2 = {
|
|
23
|
+
key: 0,
|
|
24
|
+
class: "jky-button__loading"
|
|
25
|
+
};
|
|
26
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
27
|
+
name: "JkyButton"
|
|
28
|
+
}), {
|
|
29
|
+
__name: "Button",
|
|
30
|
+
props: {
|
|
31
|
+
type: { default: "primary" },
|
|
32
|
+
size: { default: "default" },
|
|
33
|
+
disabled: { type: Boolean, default: false },
|
|
34
|
+
loading: { type: Boolean, default: false }
|
|
35
|
+
},
|
|
36
|
+
emits: ["click"],
|
|
37
|
+
setup(__props, { emit: __emit }) {
|
|
38
|
+
const emit = __emit;
|
|
39
|
+
function handleClick() {
|
|
40
|
+
if (!__props.disabled && !__props.loading) {
|
|
41
|
+
emit("click");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return (_ctx, _cache) => {
|
|
45
|
+
return openBlock(), createElementBlock("button", {
|
|
46
|
+
class: normalizeClass(["jky-button", [
|
|
47
|
+
`jky-button--${__props.type}`,
|
|
48
|
+
`jky-button--${__props.size}`,
|
|
49
|
+
{
|
|
50
|
+
"is-disabled": __props.disabled,
|
|
51
|
+
"is-loading": __props.loading
|
|
52
|
+
}
|
|
53
|
+
]]),
|
|
54
|
+
disabled: __props.disabled || __props.loading,
|
|
55
|
+
onClick: handleClick
|
|
56
|
+
}, [
|
|
57
|
+
__props.loading ? (openBlock(), createElementBlock("span", _hoisted_2, [..._cache[0] || (_cache[0] = [
|
|
58
|
+
createElementVNode("svg", {
|
|
59
|
+
class: "loading-spinner",
|
|
60
|
+
viewBox: "0 0 50 50"
|
|
61
|
+
}, [
|
|
62
|
+
createElementVNode("circle", {
|
|
63
|
+
cx: "25",
|
|
64
|
+
cy: "25",
|
|
65
|
+
r: "20",
|
|
66
|
+
fill: "none",
|
|
67
|
+
stroke: "currentColor",
|
|
68
|
+
"stroke-width": "4",
|
|
69
|
+
"stroke-dasharray": "80",
|
|
70
|
+
"stroke-dashoffset": "0"
|
|
71
|
+
}, [
|
|
72
|
+
createElementVNode("animateTransform", {
|
|
73
|
+
attributeName: "transform",
|
|
74
|
+
type: "rotate",
|
|
75
|
+
from: "0 25 25",
|
|
76
|
+
to: "360 25 25",
|
|
77
|
+
dur: "1s",
|
|
78
|
+
repeatCount: "indefinite"
|
|
79
|
+
})
|
|
80
|
+
])
|
|
81
|
+
], -1)
|
|
82
|
+
])])) : createCommentVNode("", true),
|
|
83
|
+
renderSlot(_ctx.$slots, "default")
|
|
84
|
+
], 10, _hoisted_1);
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}));
|
|
88
|
+
export {
|
|
89
|
+
_sfc_main as default
|
|
90
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* Button 组件样式 - 使用 TailwindCSS 4.x */
|
|
2
|
+
@reference '../styles.css';
|
|
3
|
+
.jky-button {
|
|
4
|
+
/* 使用 TailwindCSS 工具类 */
|
|
5
|
+
@apply inline-flex items-center justify-center font-medium rounded-md transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50;
|
|
6
|
+
|
|
7
|
+
/* 使用 CSS 变量 */
|
|
8
|
+
background-color: var(--color-primary);
|
|
9
|
+
color: var(--color-primary-foreground);
|
|
10
|
+
border: 1px solid transparent;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
|
|
13
|
+
/* 默认尺寸 */
|
|
14
|
+
--button-height: 40px;
|
|
15
|
+
--button-padding: 0 16px;
|
|
16
|
+
--button-font-size: 14px;
|
|
17
|
+
|
|
18
|
+
height: var(--button-height);
|
|
19
|
+
padding: var(--button-padding);
|
|
20
|
+
font-size: var(--button-font-size);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* 按钮类型 */
|
|
24
|
+
.jky-button--primary {
|
|
25
|
+
background-color: var(--color-primary);
|
|
26
|
+
color: var(--color-primary-foreground);
|
|
27
|
+
}
|
|
28
|
+
.jky-button--primary:hover {
|
|
29
|
+
background-color: color-mix(in srgb, var(--color-primary), black 10%);
|
|
30
|
+
}
|
|
31
|
+
.jky-button--success {
|
|
32
|
+
background-color: var(--color-success);
|
|
33
|
+
color: var(--color-success-foreground);
|
|
34
|
+
}
|
|
35
|
+
.jky-button--success:hover {
|
|
36
|
+
background-color: color-mix(in srgb, var(--color-success), black 10%);
|
|
37
|
+
}
|
|
38
|
+
.jky-button--warning {
|
|
39
|
+
background-color: var(--color-warning);
|
|
40
|
+
color: var(--color-warning-foreground);
|
|
41
|
+
}
|
|
42
|
+
.jky-button--warning:hover {
|
|
43
|
+
background-color: color-mix(in srgb, var(--color-warning), black 10%);
|
|
44
|
+
}
|
|
45
|
+
.jky-button--danger {
|
|
46
|
+
background-color: var(--color-destructive);
|
|
47
|
+
color: var(--color-destructive-foreground);
|
|
48
|
+
}
|
|
49
|
+
.jky-button--danger:hover {
|
|
50
|
+
background-color: color-mix(in srgb, var(--color-destructive), black 10%);
|
|
51
|
+
}
|
|
52
|
+
.jky-button--info {
|
|
53
|
+
background-color: var(--color-muted);
|
|
54
|
+
color: var(--color-muted-foreground);
|
|
55
|
+
}
|
|
56
|
+
.jky-button--info:hover {
|
|
57
|
+
background-color: color-mix(in srgb, var(--color-muted), black 10%);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* 按钮尺寸 */
|
|
61
|
+
.jky-button--large {
|
|
62
|
+
--button-height: 48px;
|
|
63
|
+
--button-padding: 0 24px;
|
|
64
|
+
--button-font-size: 16px;
|
|
65
|
+
}
|
|
66
|
+
.jky-button--default {
|
|
67
|
+
--button-height: 40px;
|
|
68
|
+
--button-padding: 0 16px;
|
|
69
|
+
--button-font-size: 14px;
|
|
70
|
+
}
|
|
71
|
+
.jky-button--small {
|
|
72
|
+
--button-height: 32px;
|
|
73
|
+
--button-padding: 0 12px;
|
|
74
|
+
--button-font-size: 12px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* 禁用状态 */
|
|
78
|
+
.jky-button.is-disabled {
|
|
79
|
+
opacity: 0.5;
|
|
80
|
+
cursor: not-allowed;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* 加载状态 */
|
|
84
|
+
.jky-button.is-loading {
|
|
85
|
+
position: relative;
|
|
86
|
+
pointer-events: none;
|
|
87
|
+
}
|
|
88
|
+
.jky-button__loading {
|
|
89
|
+
@apply absolute inset-0 flex items-center justify-center;
|
|
90
|
+
}
|
|
91
|
+
.loading-spinner {
|
|
92
|
+
@apply w-5 h-5 animate-spin;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* 边框按钮样式 */
|
|
96
|
+
.jky-button--primary.is-border {
|
|
97
|
+
background-color: transparent;
|
|
98
|
+
border-color: var(--color-primary);
|
|
99
|
+
color: var(--color-primary);
|
|
100
|
+
}
|
|
101
|
+
.jky-button--primary.is-border:hover {
|
|
102
|
+
background-color: color-mix(in srgb, var(--color-primary), transparent 90%);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* 文字按钮样式 */
|
|
106
|
+
.jky-button--text {
|
|
107
|
+
background-color: transparent;
|
|
108
|
+
color: var(--color-primary);
|
|
109
|
+
border-color: transparent;
|
|
110
|
+
}
|
|
111
|
+
.jky-button--text:hover {
|
|
112
|
+
background-color: color-mix(in srgb, var(--color-primary), transparent 90%);
|
|
113
|
+
}
|
package/dist/es/components.d.ts
CHANGED
package/dist/es/components.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { JkyButton } from "./button/index.js";
|
|
2
|
+
import { JkySayHello } from "./say-hello/index.js";
|
|
3
|
+
const components = [
|
|
4
|
+
JkySayHello,
|
|
5
|
+
JkyButton
|
|
4
6
|
];
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
JkyButton,
|
|
9
|
+
JkySayHello,
|
|
10
|
+
components
|
|
9
11
|
};
|
package/dist/es/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { ElementPlusOptions, InstallerOptions } from './utils/types';
|
|
1
2
|
export * from './components';
|
|
2
3
|
export * from './resolver';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
export declare const install: (app: import('vue').App) => void;
|
|
4
|
+
export type { ElementPlusOptions, InstallerOptions };
|
|
5
|
+
declare const installer: import('./utils/installer').JkyInstaller;
|
|
6
|
+
export declare const install: (app: import('vue').App, options?: InstallerOptions) => void;
|
|
8
7
|
export declare const version: string;
|
|
9
8
|
export default installer;
|
package/dist/es/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { components
|
|
2
|
-
import { createInstaller
|
|
3
|
-
import { StarterLibVue3Resolver
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { components } from "./components.js";
|
|
2
|
+
import { createInstaller } from "./utils/installer.js";
|
|
3
|
+
import { StarterLibVue3Resolver } from "./resolver.js";
|
|
4
|
+
import { JkyButton } from "./button/index.js";
|
|
5
|
+
import { JkySayHello } from "./say-hello/index.js";
|
|
6
|
+
const installer = createInstaller(components);
|
|
7
|
+
const install = installer.install;
|
|
8
|
+
const version = installer.version;
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
JkyButton,
|
|
11
|
+
JkySayHello,
|
|
12
|
+
StarterLibVue3Resolver,
|
|
13
|
+
components,
|
|
14
|
+
installer as default,
|
|
15
|
+
install,
|
|
16
|
+
version
|
|
13
17
|
};
|
package/dist/es/package.json.js
CHANGED
package/dist/es/resolver.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
function r() {
|
|
1
|
+
function StarterLibVue3Resolver() {
|
|
3
2
|
return {
|
|
4
3
|
type: "component",
|
|
5
|
-
resolve: (
|
|
6
|
-
if (
|
|
4
|
+
resolve: (name) => {
|
|
5
|
+
if (name.match(/^Jky[A-Z]/)) {
|
|
7
6
|
return {
|
|
8
|
-
name
|
|
7
|
+
name,
|
|
9
8
|
from: "jky-component-lib",
|
|
10
9
|
sideEffects: [
|
|
11
|
-
`jky-component-lib/dist/es/${
|
|
10
|
+
`jky-component-lib/dist/es/${name.replace("Jky", "").toLowerCase()}/style.css`
|
|
12
11
|
]
|
|
13
12
|
};
|
|
13
|
+
}
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
export {
|
|
18
|
-
|
|
18
|
+
StarterLibVue3Resolver
|
|
19
19
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
name: string;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
|
|
5
|
+
export default _default;
|
|
@@ -1,20 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { defineComponent, openBlock, createElementBlock } from "vue";
|
|
21
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
22
|
+
name: "JkySayHello"
|
|
23
|
+
}), {
|
|
4
24
|
__name: "SayHello",
|
|
5
25
|
props: {
|
|
6
26
|
name: {}
|
|
7
27
|
},
|
|
8
|
-
setup(
|
|
9
|
-
function
|
|
10
|
-
alert(`Hello, ${
|
|
28
|
+
setup(__props) {
|
|
29
|
+
function sayHello() {
|
|
30
|
+
alert(`Hello, ${__props.name}!`);
|
|
11
31
|
}
|
|
12
|
-
return (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
32
|
+
return (_ctx, _cache) => {
|
|
33
|
+
return openBlock(), createElementBlock("button", {
|
|
34
|
+
class: "jky-component-lib-say-hello",
|
|
35
|
+
onClick: _cache[0] || (_cache[0] = ($event) => sayHello())
|
|
36
|
+
}, " Say, hi! ");
|
|
37
|
+
};
|
|
16
38
|
}
|
|
17
|
-
});
|
|
39
|
+
}));
|
|
18
40
|
export {
|
|
19
|
-
|
|
41
|
+
_sfc_main as default
|
|
20
42
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { InstallWithSFC } from '../utils';
|
|
2
2
|
import { default as SayHello } from './SayHello.vue';
|
|
3
|
-
export declare const
|
|
4
|
-
export default
|
|
3
|
+
export declare const JkySayHello: InstallWithSFC<typeof SayHello>;
|
|
4
|
+
export default JkySayHello;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _sfc_main from "./SayHello.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { installWithSFC
|
|
4
|
-
const
|
|
3
|
+
import { installWithSFC } from "../utils/with-install.js";
|
|
4
|
+
const JkySayHello = installWithSFC(_sfc_main);
|
|
5
5
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
JkySayHello,
|
|
7
|
+
JkySayHello as default
|
|
8
8
|
};
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
.jky-component-lib-say-hello{
|
|
3
|
+
background: #42b883;
|
|
4
|
+
color: white;
|
|
5
|
+
padding: 8px 20px;
|
|
6
|
+
text-align: center;
|
|
7
|
+
text-decoration: none;
|
|
8
|
+
display: inline-block;
|
|
9
|
+
font-size: 16px;
|
|
10
|
+
margin: 4px 2px;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
border-radius: 6px;
|
|
13
|
+
}
|
package/dist/es/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.jky-component-lib-say-hello{background:#42b883;border-radius:6px;color:#fff;cursor:pointer;display:inline-block;font-size:16px;margin:4px 2px;padding:8px 20px;text-align:center;text-decoration:none}
|
|
1
|
+
@reference "../styles.css";.jky-button{@apply inline-flex items-center justify-center font-medium rounded-md transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50;background-color:var(--color-primary);border:1px solid transparent;color:var(--color-primary-foreground);cursor:pointer;--button-height:40px;--button-padding:0 16px;--button-font-size:14px;font-size:var(--button-font-size);height:var(--button-height);padding:var(--button-padding)}.jky-button--primary{background-color:var(--color-primary);color:var(--color-primary-foreground)}.jky-button--primary:hover{background-color:color-mix(in srgb,var(--color-primary),#000 10%)}.jky-button--success{background-color:var(--color-success);color:var(--color-success-foreground)}.jky-button--success:hover{background-color:color-mix(in srgb,var(--color-success),#000 10%)}.jky-button--warning{background-color:var(--color-warning);color:var(--color-warning-foreground)}.jky-button--warning:hover{background-color:color-mix(in srgb,var(--color-warning),#000 10%)}.jky-button--danger{background-color:var(--color-destructive);color:var(--color-destructive-foreground)}.jky-button--danger:hover{background-color:color-mix(in srgb,var(--color-destructive),#000 10%)}.jky-button--info{background-color:var(--color-muted);color:var(--color-muted-foreground)}.jky-button--info:hover{background-color:color-mix(in srgb,var(--color-muted),#000 10%)}.jky-button--large{--button-height:48px;--button-padding:0 24px;--button-font-size:16px}.jky-button--default{--button-height:40px;--button-padding:0 16px;--button-font-size:14px}.jky-button--small{--button-height:32px;--button-padding:0 12px;--button-font-size:12px}.jky-button.is-disabled{cursor:not-allowed;opacity:.5}.jky-button.is-loading{pointer-events:none;position:relative}.jky-button__loading{@apply absolute inset-0 flex items-center justify-center}.loading-spinner{@apply w-5 h-5 animate-spin}.jky-button--primary.is-border{background-color:transparent;border-color:var(--color-primary);color:var(--color-primary)}.jky-button--primary.is-border:hover{background-color:color-mix(in srgb,var(--color-primary),transparent 90%)}.jky-button--text{background-color:transparent;border-color:transparent;color:var(--color-primary)}.jky-button--text:hover{background-color:color-mix(in srgb,var(--color-primary),transparent 90%)}.jky-component-lib-say-hello{background:#42b883;border-radius:6px;color:#fff;cursor:pointer;display:inline-block;font-size:16px;margin:4px 2px;padding:8px 20px;text-align:center;text-decoration:none}@import "tailwindcss";@import "@fontsource-variable/geist";@custom-variant dark (&:is(.dark *));@theme inline{--font-heading:var(--font-sans);--font-sans:"Geist Variable",sans-serif;--color-sidebar-ring:var(--sidebar-ring);--color-sidebar-border:var(--sidebar-border);--color-sidebar-accent-foreground:var(--sidebar-accent-foreground);--color-sidebar-accent:var(--sidebar-accent);--color-sidebar-primary-foreground:var(--sidebar-primary-foreground);--color-sidebar-primary:var(--sidebar-primary);--color-sidebar-foreground:var(--sidebar-foreground);--color-sidebar:var(--sidebar);--color-chart-5:var(--chart-5);--color-chart-4:var(--chart-4);--color-chart-3:var(--chart-3);--color-chart-2:var(--chart-2);--color-chart-1:var(--chart-1);--color-ring:var(--ring);--color-input:var(--input);--color-border:var(--border);--color-destructive:var(--destructive);--color-accent-foreground:var(--accent-foreground);--color-accent:var(--accent);--color-muted-foreground:var(--muted-foreground);--color-muted:var(--muted);--color-secondary-foreground:var(--secondary-foreground);--color-secondary:var(--secondary);--color-primary-foreground:var(--primary-foreground);--color-primary:var(--primary);--color-popover-foreground:var(--popover-foreground);--color-popover:var(--popover);--color-card-foreground:var(--card-foreground);--color-card:var(--card);--color-foreground:var(--foreground);--color-background:var(--background);--radius-sm:calc(var(--radius)*0.6);--radius-md:calc(var(--radius)*0.8);--radius-lg:var(--radius);--radius-xl:calc(var(--radius)*1.4);--radius-2xl:calc(var(--radius)*1.8);--radius-3xl:calc(var(--radius)*2.2);--radius-4xl:calc(var(--radius)*2.6)}:root{--background:oklch(1 0 0);--foreground:oklch(0.145 0 0);--card:oklch(1 0 0);--card-foreground:oklch(0.145 0 0);--popover:oklch(1 0 0);--popover-foreground:oklch(0.145 0 0);--primary:oklch(0.205 0 0);--primary-foreground:oklch(0.985 0 0);--secondary:oklch(0.97 0 0);--secondary-foreground:oklch(0.205 0 0);--muted:oklch(0.97 0 0);--muted-foreground:oklch(0.556 0 0);--accent:oklch(0.97 0 0);--accent-foreground:oklch(0.205 0 0);--destructive:oklch(0.577 0.245 27.325);--border:oklch(0.922 0 0);--input:oklch(0.922 0 0);--ring:oklch(0.708 0 0);--chart-1:oklch(0.646 0.222 41.116);--chart-2:oklch(0.6 0.118 184.704);--chart-3:oklch(0.398 0.07 227.392);--chart-4:oklch(0.828 0.189 84.429);--chart-5:oklch(0.769 0.188 70.08);--radius:0.625rem;--sidebar:oklch(0.985 0 0);--sidebar-foreground:oklch(0.145 0 0);--sidebar-primary:oklch(0.205 0 0);--sidebar-primary-foreground:oklch(0.985 0 0);--sidebar-accent:oklch(0.97 0 0);--sidebar-accent-foreground:oklch(0.205 0 0);--sidebar-border:oklch(0.922 0 0);--sidebar-ring:oklch(0.708 0 0)}.dark{--background:oklch(0.145 0 0);--foreground:oklch(0.985 0 0);--card:oklch(0.205 0 0);--card-foreground:oklch(0.985 0 0);--popover:oklch(0.205 0 0);--popover-foreground:oklch(0.985 0 0);--primary:oklch(0.922 0 0);--primary-foreground:oklch(0.205 0 0);--secondary:oklch(0.269 0 0);--secondary-foreground:oklch(0.985 0 0);--muted:oklch(0.269 0 0);--muted-foreground:oklch(0.708 0 0);--accent:oklch(0.269 0 0);--accent-foreground:oklch(0.985 0 0);--destructive:oklch(0.704 0.191 22.216);--border:oklch(1 0 0/10%);--input:oklch(1 0 0/15%);--ring:oklch(0.556 0 0);--chart-1:oklch(0.488 0.243 264.376);--chart-2:oklch(0.696 0.17 162.48);--chart-3:oklch(0.769 0.188 70.08);--chart-4:oklch(0.627 0.265 303.9);--chart-5:oklch(0.645 0.246 16.439);--sidebar:oklch(0.205 0 0);--sidebar-foreground:oklch(0.985 0 0);--sidebar-primary:oklch(0.488 0.243 264.376);--sidebar-primary-foreground:oklch(0.985 0 0);--sidebar-accent:oklch(0.269 0 0);--sidebar-accent-foreground:oklch(0.985 0 0);--sidebar-border:oklch(1 0 0/10%);--sidebar-ring:oklch(0.556 0 0)}@layer base{*{@apply border-border outline-ring/50}body{@apply bg-background text-foreground}html{@apply font-sans}}
|
package/dist/es/utils/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { App, Plugin } from 'vue';
|
|
2
|
+
import { InstallerOptions } from './types';
|
|
2
3
|
export declare const INSTALLED_KEY: unique symbol;
|
|
3
4
|
declare module 'vue' {
|
|
4
5
|
interface App {
|
|
5
6
|
[INSTALLED_KEY]?: boolean;
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
|
-
export
|
|
9
|
-
install: (app: App) => void;
|
|
9
|
+
export interface JkyInstaller {
|
|
10
|
+
install: (app: App, options?: InstallerOptions) => void;
|
|
10
11
|
version: string;
|
|
11
|
-
}
|
|
12
|
+
}
|
|
13
|
+
export declare function createInstaller(components?: Plugin[]): JkyInstaller;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import ElementPlus from "element-plus";
|
|
2
|
+
import { version } from "../package.json.js";
|
|
3
|
+
const INSTALLED_KEY = Symbol("INSTALLED_KEY");
|
|
4
|
+
function createInstaller(components = []) {
|
|
5
|
+
const install = (app, options) => {
|
|
6
|
+
if (app[INSTALLED_KEY])
|
|
7
|
+
return;
|
|
8
|
+
app[INSTALLED_KEY] = true;
|
|
9
|
+
app.use(ElementPlus, options == null ? void 0 : options.elementPlusOptions);
|
|
10
|
+
components.forEach((c) => app.use(c));
|
|
11
|
+
};
|
|
4
12
|
return {
|
|
5
|
-
install
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
version: o
|
|
13
|
+
install,
|
|
14
|
+
version
|
|
9
15
|
};
|
|
10
16
|
}
|
|
11
17
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
INSTALLED_KEY,
|
|
19
|
+
createInstaller
|
|
14
20
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a string to lowercase
|
|
3
|
+
* @param str - The string to convert
|
|
4
|
+
* @returns The lowercase string
|
|
5
|
+
*/
|
|
6
|
+
export declare function toLowerCase(str: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Convert a string to kebab-case
|
|
9
|
+
* @param str - The string to convert
|
|
10
|
+
* @returns The kebab-case string
|
|
11
|
+
*/
|
|
12
|
+
export declare function toKebabCase(str: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Convert a string to PascalCase
|
|
15
|
+
* @param str - The string to convert
|
|
16
|
+
* @returns The PascalCase string
|
|
17
|
+
*/
|
|
18
|
+
export declare function toPascalCase(str: string): string;
|
package/dist/es/utils/types.d.ts
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
+
import { ConfigProviderProps } from 'element-plus';
|
|
1
2
|
import { Plugin } from 'vue';
|
|
2
3
|
export type InstallWithSFC<T> = T & Plugin;
|
|
4
|
+
export interface ElementPlusOptions extends Partial<ConfigProviderProps> {
|
|
5
|
+
}
|
|
6
|
+
export interface InstallerOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Element Plus configuration options
|
|
9
|
+
* These options will be passed to Element Plus when installing
|
|
10
|
+
*/
|
|
11
|
+
elementPlusOptions?: ElementPlusOptions;
|
|
12
|
+
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
for (const
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
function installWithSFC(main, extra) {
|
|
2
|
+
main.install = ((app, ..._options) => {
|
|
3
|
+
for (const comp of [main, ...Object.values({})]) {
|
|
4
|
+
if (comp && comp.name) {
|
|
5
|
+
app.component(comp.name, comp);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return app;
|
|
9
|
+
});
|
|
10
|
+
return main;
|
|
6
11
|
}
|
|
7
12
|
export {
|
|
8
|
-
|
|
13
|
+
installWithSFC
|
|
9
14
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
type?: 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
3
|
+
size?: 'large' | 'default' | 'small';
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
default?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {};
|
|
13
|
+
rootEl: HTMLButtonElement;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
17
|
+
click: () => any;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
|
+
onClick?: (() => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
|
|
21
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|