@nexxtmove/ui 0.0.8 → 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/index.d.ts +13 -1
- package/dist/index.js +43 -26
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentOptionsMixin } from 'vue';
|
|
2
2
|
import { ComponentProvideOptions } from 'vue';
|
|
3
3
|
import { DefineComponent } from 'vue';
|
|
4
|
+
import { IconName } from '@awesome.me/kit-37b149f3ef/icons';
|
|
4
5
|
import { PublicProps } from 'vue';
|
|
5
6
|
|
|
6
7
|
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
@@ -10,7 +11,7 @@ buttonType: "button" | "submit" | "reset";
|
|
|
10
11
|
|
|
11
12
|
declare type __VLS_Props = {
|
|
12
13
|
variant?: 'primary' | 'secondary';
|
|
13
|
-
icon?:
|
|
14
|
+
icon?: InstanceType<typeof NexxtIcon>['name'];
|
|
14
15
|
iconRight?: boolean;
|
|
15
16
|
disabled?: boolean;
|
|
16
17
|
loading?: boolean;
|
|
@@ -34,6 +35,17 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
|
34
35
|
};
|
|
35
36
|
};
|
|
36
37
|
|
|
38
|
+
declare type IconType = 'regular' | 'solid' | 'light' | 'duotone' | 'brands';
|
|
39
|
+
|
|
37
40
|
export declare const NexxtButton: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
38
41
|
|
|
42
|
+
export declare const NexxtIcon: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
43
|
+
type: IconType;
|
|
44
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLElement>;
|
|
45
|
+
|
|
46
|
+
declare interface Props {
|
|
47
|
+
name: IconName;
|
|
48
|
+
type?: IconType;
|
|
49
|
+
}
|
|
50
|
+
|
|
39
51
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as c, createElementBlock as o, openBlock as t, normalizeClass as a, createBlock as d, createCommentVNode as l, renderSlot as u, createVNode as s, Transition as m, withCtx as y } from "vue";
|
|
2
|
+
const r = /* @__PURE__ */ c({
|
|
3
|
+
__name: "Icon",
|
|
4
|
+
props: {
|
|
5
|
+
name: {},
|
|
6
|
+
type: { default: "light" }
|
|
7
|
+
},
|
|
8
|
+
setup(e) {
|
|
9
|
+
return (i, n) => (t(), o("i", {
|
|
10
|
+
class: a([`fa-${e.type}`, `fa-${e.name}`, "items-center", "justify-center"])
|
|
11
|
+
}, null, 2));
|
|
12
|
+
}
|
|
13
|
+
}), f = ["type", "disabled", "data-variant"], h = /* @__PURE__ */ c({
|
|
3
14
|
__name: "Button",
|
|
4
15
|
props: {
|
|
5
16
|
variant: { default: "primary" },
|
|
@@ -9,28 +20,29 @@ const m = ["type", "disabled", "data-variant"], v = /* @__PURE__ */ r({
|
|
|
9
20
|
loading: { type: Boolean },
|
|
10
21
|
buttonType: { default: "button" }
|
|
11
22
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
23
|
+
setup(e) {
|
|
24
|
+
const i = {
|
|
14
25
|
primary: "bg-cornflower-blue-500",
|
|
15
26
|
secondary: "bg-white"
|
|
16
27
|
};
|
|
17
|
-
return (
|
|
18
|
-
type:
|
|
19
|
-
disabled:
|
|
20
|
-
class:
|
|
28
|
+
return (n, b) => (t(), o("button", {
|
|
29
|
+
type: e.buttonType,
|
|
30
|
+
disabled: e.disabled,
|
|
31
|
+
class: a([
|
|
21
32
|
"button relative flex h-10 cursor-pointer items-center justify-center overflow-hidden rounded-lg transition-colors focus-visible:outline-3 disabled:cursor-not-allowed",
|
|
22
|
-
`button-${
|
|
23
|
-
|
|
24
|
-
|
|
33
|
+
`button-${e.variant}`,
|
|
34
|
+
n.$slots.default ?? "w-10",
|
|
35
|
+
e.loading ? "pointer-events-none" : ""
|
|
25
36
|
]),
|
|
26
|
-
"data-variant":
|
|
37
|
+
"data-variant": e.variant
|
|
27
38
|
}, [
|
|
28
|
-
|
|
39
|
+
e.icon ? (t(), d(r, {
|
|
29
40
|
key: 0,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
name: e.icon,
|
|
42
|
+
class: a({ "order-last": e.iconRight })
|
|
43
|
+
}, null, 8, ["name", "class"])) : l("", !0),
|
|
44
|
+
u(n.$slots, "default"),
|
|
45
|
+
s(m, {
|
|
34
46
|
"enter-active-class": "transition-opacity duration-200",
|
|
35
47
|
"enter-from-class": "opacity-0",
|
|
36
48
|
"enter-to-class": "opacity-100",
|
|
@@ -38,22 +50,27 @@ const m = ["type", "disabled", "data-variant"], v = /* @__PURE__ */ r({
|
|
|
38
50
|
"leave-from-class": "opacity-100",
|
|
39
51
|
"leave-to-class": "opacity-0"
|
|
40
52
|
}, {
|
|
41
|
-
default:
|
|
42
|
-
|
|
53
|
+
default: y(() => [
|
|
54
|
+
e.loading ? (t(), o("div", {
|
|
43
55
|
key: 0,
|
|
44
|
-
class:
|
|
56
|
+
class: a([
|
|
45
57
|
"absolute inset-0 flex items-center justify-center rounded-lg",
|
|
46
|
-
|
|
58
|
+
i[e.variant]
|
|
47
59
|
])
|
|
48
|
-
}, [
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
}, [
|
|
61
|
+
s(r, {
|
|
62
|
+
name: "spinner-third",
|
|
63
|
+
type: "light",
|
|
64
|
+
class: "fa-spin absolute text-sm"
|
|
65
|
+
})
|
|
66
|
+
], 2)) : l("", !0)
|
|
51
67
|
]),
|
|
52
68
|
_: 1
|
|
53
69
|
})
|
|
54
|
-
], 10,
|
|
70
|
+
], 10, f));
|
|
55
71
|
}
|
|
56
72
|
});
|
|
57
73
|
export {
|
|
58
|
-
|
|
74
|
+
h as NexxtButton,
|
|
75
|
+
r as NexxtIcon
|
|
59
76
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexxtmove/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.9",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"vue": "^3.0.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
+
"@awesome.me/kit-37b149f3ef": "^1.0.4",
|
|
23
24
|
"@eslint/js": "^9.39.2",
|
|
24
25
|
"@storybook/addon-a11y": "^10.1.11",
|
|
25
26
|
"@storybook/addon-docs": "^10.1.11",
|