@smurfox/proxy-ui 0.1.1 → 0.1.3
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/module.json +1 -1
- package/dist/runtime/components/Button.d.vue.ts +5 -1
- package/dist/runtime/components/Button.vue +2 -1
- package/dist/runtime/components/Button.vue.d.ts +5 -1
- package/dist/runtime/components/Tabs.d.vue.ts +17 -0
- package/dist/runtime/components/Tabs.vue +62 -0
- package/dist/runtime/components/Tabs.vue.d.ts +17 -0
- package/dist/runtime/types/index.d.ts +18 -0
- package/package.json +79 -79
package/dist/module.json
CHANGED
|
@@ -19,7 +19,11 @@ declare var __VLS_30: {};
|
|
|
19
19
|
type __VLS_Slots = {} & {
|
|
20
20
|
default?: (props: typeof __VLS_30) => any;
|
|
21
21
|
};
|
|
22
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
|
+
click: (event: MouseEvent) => any;
|
|
24
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
26
|
+
}>, {
|
|
23
27
|
size: ButtonSize;
|
|
24
28
|
rounded: ButtonRounded;
|
|
25
29
|
variant: ButtonVariant;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
]"
|
|
14
14
|
:while-press="disabled || loading ? {} : { scale: 0.95 }"
|
|
15
15
|
class="flex items-center justify-center select-none transition-[color,background-color,opacity,filter] duration-200"
|
|
16
|
-
@click="
|
|
16
|
+
@click="emit('click', $event)"
|
|
17
17
|
>
|
|
18
18
|
<template v-if="isIconOnly">
|
|
19
19
|
<Icon v-if="loading" name="svg-spinners:ring-resize" />
|
|
@@ -63,6 +63,7 @@ const roundedClasses = {
|
|
|
63
63
|
"2xl": "rounded-2xl",
|
|
64
64
|
full: "rounded-full"
|
|
65
65
|
};
|
|
66
|
+
const emit = defineEmits(["click"]);
|
|
66
67
|
const props = defineProps({
|
|
67
68
|
label: { type: String, required: false },
|
|
68
69
|
size: { type: String, required: false, default: "md" },
|
|
@@ -19,7 +19,11 @@ declare var __VLS_30: {};
|
|
|
19
19
|
type __VLS_Slots = {} & {
|
|
20
20
|
default?: (props: typeof __VLS_30) => any;
|
|
21
21
|
};
|
|
22
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
|
+
click: (event: MouseEvent) => any;
|
|
24
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
26
|
+
}>, {
|
|
23
27
|
size: ButtonSize;
|
|
24
28
|
rounded: ButtonRounded;
|
|
25
29
|
variant: ButtonVariant;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TabsRounded, TabsProps } from "../types/index.js";
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<TabsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
"update:modelValue": (value: string) => any;
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<TabsProps> & Readonly<{
|
|
5
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
rounded: TabsRounded;
|
|
8
|
+
iconSize: number;
|
|
9
|
+
modelValue: string;
|
|
10
|
+
bgColor: string;
|
|
11
|
+
btnColor: string;
|
|
12
|
+
activeTextColor: string;
|
|
13
|
+
inactiveTextColor: string;
|
|
14
|
+
disabledTabs: string[];
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="inline-flex gap-1 p-1"
|
|
4
|
+
:class="[bgColor, roundedClasses[rounded]]"
|
|
5
|
+
>
|
|
6
|
+
<button
|
|
7
|
+
v-for="tab in tabs"
|
|
8
|
+
:key="tab.value"
|
|
9
|
+
class="relative flex items-center gap-2"
|
|
10
|
+
:disabled="tab.disabled || disabledTabs.includes(tab.value)"
|
|
11
|
+
:class="[
|
|
12
|
+
'px-4 py-1.5 text-sm font-medium transition-colors duration-200',
|
|
13
|
+
roundedClasses[rounded],
|
|
14
|
+
tab.disabled || disabledTabs.includes(tab.value) ? 'text-black/30 dark:text-white/40' : modelValue === tab.value ? activeTextColor + ' cursor-pointer' : inactiveTextColor + ' cursor-pointer'
|
|
15
|
+
]"
|
|
16
|
+
@click="
|
|
17
|
+
!(tab.disabled || disabledTabs.includes(tab.value)) && emit('update:modelValue', tab.value)
|
|
18
|
+
"
|
|
19
|
+
>
|
|
20
|
+
<motion.div
|
|
21
|
+
v-if="modelValue === tab.value"
|
|
22
|
+
layout-id="tab-indicator"
|
|
23
|
+
class="absolute inset-0 shadow-sm"
|
|
24
|
+
:class="[btnColor, roundedClasses[rounded]]"
|
|
25
|
+
:transition="{ type: 'spring', stiffness: 400, damping: 35 }"
|
|
26
|
+
/>
|
|
27
|
+
<Icon
|
|
28
|
+
v-if="tab.icon"
|
|
29
|
+
:name="tab.icon"
|
|
30
|
+
:size="iconSize"
|
|
31
|
+
class="relative z-10"
|
|
32
|
+
/>
|
|
33
|
+
<span class="relative z-10">{{ tab.label }}</span>
|
|
34
|
+
</button>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup>
|
|
39
|
+
import { motion } from "motion-v";
|
|
40
|
+
const roundedClasses = {
|
|
41
|
+
none: "rounded-none",
|
|
42
|
+
xs: "rounded-xs",
|
|
43
|
+
sm: "rounded-sm",
|
|
44
|
+
md: "rounded-md",
|
|
45
|
+
lg: "rounded-lg",
|
|
46
|
+
xl: "rounded-xl",
|
|
47
|
+
"2xl": "rounded-2xl",
|
|
48
|
+
full: "rounded-full"
|
|
49
|
+
};
|
|
50
|
+
const props = defineProps({
|
|
51
|
+
modelValue: { type: String, required: true, default: "" },
|
|
52
|
+
tabs: { type: Array, required: true },
|
|
53
|
+
iconSize: { type: Number, required: false, default: 15 },
|
|
54
|
+
rounded: { type: String, required: false, default: "lg" },
|
|
55
|
+
bgColor: { type: String, required: false, default: "bg-black/5 dark:bg-white/10" },
|
|
56
|
+
btnColor: { type: String, required: false, default: "bg-white dark:bg-white/10" },
|
|
57
|
+
activeTextColor: { type: String, required: false, default: "text-black dark:text-white" },
|
|
58
|
+
inactiveTextColor: { type: String, required: false, default: "text-black/70 dark:text-white/70 hover:text-black dark:hover:text-white" },
|
|
59
|
+
disabledTabs: { type: Array, required: false, default: () => [] }
|
|
60
|
+
});
|
|
61
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
62
|
+
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TabsRounded, TabsProps } from "../types/index.js";
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<TabsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
"update:modelValue": (value: string) => any;
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<TabsProps> & Readonly<{
|
|
5
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
rounded: TabsRounded;
|
|
8
|
+
iconSize: number;
|
|
9
|
+
modelValue: string;
|
|
10
|
+
bgColor: string;
|
|
11
|
+
btnColor: string;
|
|
12
|
+
activeTextColor: string;
|
|
13
|
+
inactiveTextColor: string;
|
|
14
|
+
disabledTabs: string[];
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -38,3 +38,21 @@ export interface CardProps {
|
|
|
38
38
|
}
|
|
39
39
|
export type AvatarSize = "sm" | "md" | "lg" | "full";
|
|
40
40
|
export type AvatarRounded = "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
|
|
41
|
+
export type TabsRounded = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
|
|
42
|
+
export interface TabItem {
|
|
43
|
+
label: string;
|
|
44
|
+
value: string;
|
|
45
|
+
icon?: string;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface TabsProps {
|
|
49
|
+
modelValue: string;
|
|
50
|
+
tabs: TabItem[];
|
|
51
|
+
iconSize?: number;
|
|
52
|
+
rounded?: TabsRounded;
|
|
53
|
+
bgColor?: string;
|
|
54
|
+
btnColor?: string;
|
|
55
|
+
activeTextColor?: string;
|
|
56
|
+
inactiveTextColor?: string;
|
|
57
|
+
disabledTabs?: string[];
|
|
58
|
+
}
|
package/package.json
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@smurfox/proxy-ui",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "A UI component library built for Nuxt 4",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "https://github.com/Smurfox/proxy-ui"
|
|
8
|
-
},
|
|
9
|
-
"homepage": "https://github.com/Smurfox/proxy-ui",
|
|
10
|
-
"bugs": {
|
|
11
|
-
"url": "https://github.com/Smurfox/proxy-ui/issues"
|
|
12
|
-
},
|
|
13
|
-
"author": "Smurfox",
|
|
14
|
-
"license": "MIT",
|
|
15
|
-
"type": "module",
|
|
16
|
-
"exports": {
|
|
17
|
-
".": {
|
|
18
|
-
"types": "./dist/types.d.mts",
|
|
19
|
-
"import": "./dist/module.mjs"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"main": "./dist/module.mjs",
|
|
23
|
-
"typesVersions": {
|
|
24
|
-
"*": {
|
|
25
|
-
".": [
|
|
26
|
-
"./dist/types.d.mts"
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"files": [
|
|
31
|
-
"dist"
|
|
32
|
-
],
|
|
33
|
-
"keywords": [
|
|
34
|
-
"nuxt",
|
|
35
|
-
"nuxt4",
|
|
36
|
-
"ui",
|
|
37
|
-
"components",
|
|
38
|
-
"tailwindcss",
|
|
39
|
-
"motion-v"
|
|
40
|
-
],
|
|
41
|
-
"workspaces": [
|
|
42
|
-
"playground"
|
|
43
|
-
],
|
|
44
|
-
"scripts": {
|
|
45
|
-
"prepack": "nuxt-module-build build",
|
|
46
|
-
"dev": "npm run dev:prepare && nuxt dev playground",
|
|
47
|
-
"dev:build": "nuxt build playground",
|
|
48
|
-
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
|
|
49
|
-
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
|
|
50
|
-
"lint": "eslint .",
|
|
51
|
-
"test": "vitest run",
|
|
52
|
-
"test:watch": "vitest watch",
|
|
53
|
-
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
54
|
-
},
|
|
55
|
-
"dependencies": {
|
|
56
|
-
"@nuxt/fonts": "^0.14.0",
|
|
57
|
-
"@nuxt/icon": "^2.2.1",
|
|
58
|
-
"@nuxt/kit": "^4.4.2",
|
|
59
|
-
"motion-v": "^1.0.0"
|
|
60
|
-
},
|
|
61
|
-
"peerDependencies": {
|
|
62
|
-
"nuxt": "^4.0.0",
|
|
63
|
-
"tailwindcss": "^4.0.0"
|
|
64
|
-
},
|
|
65
|
-
"devDependencies": {
|
|
66
|
-
"@nuxt/devtools": "^3.2.4",
|
|
67
|
-
"@nuxt/eslint-config": "^1.15.2",
|
|
68
|
-
"@nuxt/module-builder": "^1.0.2",
|
|
69
|
-
"@nuxt/schema": "^4.4.2",
|
|
70
|
-
"@nuxt/test-utils": "^4.0.0",
|
|
71
|
-
"@types/node": "latest",
|
|
72
|
-
"changelogen": "^0.6.2",
|
|
73
|
-
"eslint": "^10.1.0",
|
|
74
|
-
"nuxt": "^4.4.2",
|
|
75
|
-
"typescript": "~6.0.2",
|
|
76
|
-
"vitest": "^4.1.1",
|
|
77
|
-
"vue-tsc": "^3.2.6"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@smurfox/proxy-ui",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "A UI component library built for Nuxt 4",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Smurfox/proxy-ui"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/Smurfox/proxy-ui",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/Smurfox/proxy-ui/issues"
|
|
12
|
+
},
|
|
13
|
+
"author": "Smurfox",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/types.d.mts",
|
|
19
|
+
"import": "./dist/module.mjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"main": "./dist/module.mjs",
|
|
23
|
+
"typesVersions": {
|
|
24
|
+
"*": {
|
|
25
|
+
".": [
|
|
26
|
+
"./dist/types.d.mts"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"keywords": [
|
|
34
|
+
"nuxt",
|
|
35
|
+
"nuxt4",
|
|
36
|
+
"ui",
|
|
37
|
+
"components",
|
|
38
|
+
"tailwindcss",
|
|
39
|
+
"motion-v"
|
|
40
|
+
],
|
|
41
|
+
"workspaces": [
|
|
42
|
+
"playground"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"prepack": "nuxt-module-build build",
|
|
46
|
+
"dev": "npm run dev:prepare && nuxt dev playground",
|
|
47
|
+
"dev:build": "nuxt build playground",
|
|
48
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
|
|
49
|
+
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
|
|
50
|
+
"lint": "eslint .",
|
|
51
|
+
"test": "vitest run",
|
|
52
|
+
"test:watch": "vitest watch",
|
|
53
|
+
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@nuxt/fonts": "^0.14.0",
|
|
57
|
+
"@nuxt/icon": "^2.2.1",
|
|
58
|
+
"@nuxt/kit": "^4.4.2",
|
|
59
|
+
"motion-v": "^1.0.0"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"nuxt": "^4.0.0",
|
|
63
|
+
"tailwindcss": "^4.0.0"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@nuxt/devtools": "^3.2.4",
|
|
67
|
+
"@nuxt/eslint-config": "^1.15.2",
|
|
68
|
+
"@nuxt/module-builder": "^1.0.2",
|
|
69
|
+
"@nuxt/schema": "^4.4.2",
|
|
70
|
+
"@nuxt/test-utils": "^4.0.0",
|
|
71
|
+
"@types/node": "latest",
|
|
72
|
+
"changelogen": "^0.6.2",
|
|
73
|
+
"eslint": "^10.1.0",
|
|
74
|
+
"nuxt": "^4.4.2",
|
|
75
|
+
"typescript": "~6.0.2",
|
|
76
|
+
"vitest": "^4.1.1",
|
|
77
|
+
"vue-tsc": "^3.2.6"
|
|
78
|
+
}
|
|
79
|
+
}
|