gurunkit 0.1.0
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/LICENSE +21 -0
- package/README.md +28 -0
- package/dist/gurun-kit.js +245 -0
- package/dist/gurun-kit.umd.cjs +1 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Narakode
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Gurun Kit
|
|
2
|
+
|
|
3
|
+
Vue UI Component Library Built with Tailwind CSS.
|
|
4
|
+
|
|
5
|
+
[Read Documentation](https://narakode.id/gurunkit).
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Vue.js 3+
|
|
10
|
+
- Tailwind CSS 4+
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install gurunkit
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Basic Usage
|
|
19
|
+
|
|
20
|
+
```vue
|
|
21
|
+
<script setup>
|
|
22
|
+
import { Button } from 'gurunkit';
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<Button>My Button</Button>
|
|
27
|
+
</template>
|
|
28
|
+
```
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { h as e, useId as t } from "vue";
|
|
2
|
+
//#region src/components/button/button.ts
|
|
3
|
+
var n = {
|
|
4
|
+
base: "font-medium cursor-pointer inline-flex items-center justify-center",
|
|
5
|
+
colors: {
|
|
6
|
+
primary: "bg-blue-600 text-white hover:bg-blue-700",
|
|
7
|
+
success: "bg-green-600 text-white hover:bg-green-700",
|
|
8
|
+
error: "bg-red-600 text-white hover:bg-red-700",
|
|
9
|
+
warning: "bg-yellow-600 text-white hover:bg-yellow-700",
|
|
10
|
+
light: "bg-white text-gray-700 hover:bg-gray-100"
|
|
11
|
+
},
|
|
12
|
+
sizes: {
|
|
13
|
+
sm: "h-8 px-3 rounded text-sm",
|
|
14
|
+
md: "h-10 px-4 rounded-md",
|
|
15
|
+
lg: "h-12 px-6 rounded-md text-lg"
|
|
16
|
+
}
|
|
17
|
+
}, r = (t, r) => {
|
|
18
|
+
let { class: i, ...a } = r.attrs;
|
|
19
|
+
return e(t.tag ?? "button", {
|
|
20
|
+
class: [
|
|
21
|
+
i,
|
|
22
|
+
n.base,
|
|
23
|
+
n.colors[t.color ?? "primary"],
|
|
24
|
+
n.sizes[t.size ?? "md"]
|
|
25
|
+
],
|
|
26
|
+
...a
|
|
27
|
+
}, { default: r.slots.default });
|
|
28
|
+
};
|
|
29
|
+
r.props = {
|
|
30
|
+
color: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "primary"
|
|
33
|
+
},
|
|
34
|
+
size: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "md"
|
|
37
|
+
},
|
|
38
|
+
tag: {
|
|
39
|
+
type: null,
|
|
40
|
+
default: "button"
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/components/input/input.ts
|
|
45
|
+
var i = {
|
|
46
|
+
base: "border file:bg-gray-100 file:h-full file:text-gray-900 file:border-r focus:outline-0 dark:file:bg-gray-700 dark:file:text-white",
|
|
47
|
+
file: "pl-0",
|
|
48
|
+
colors: {
|
|
49
|
+
primary: "bg-white text-blue-700 placeholder-blue-500 border-blue-300 file:border-blue-300 focus:border-blue-600 focus:file:border-blue-600 dark:bg-transparent dark:border-blue-600 dark:file:border-blue-600 dark:focus:border-blue-400 dark:focus:file:border-blue-400 dark:placeholder-blue-600 dark:text-blue-300",
|
|
50
|
+
success: "bg-white text-green-700 placeholder-green-500 border-green-300 file:border-green-300 focus:border-green-600 focus:file:border-green-600 dark:bg-transparent dark:border-green-600 dark:file:border-green-600 dark:focus:border-green-400 dark:focus:file:border-green-400 dark:placeholder-green-600 dark:text-green-300",
|
|
51
|
+
error: "bg-white text-red-700 placeholder-red-500 border-red-300 file:border-red-300 focus:border-red-600 focus:file:border-red-600 dark:bg-transparent dark:border-red-600 dark:file:border-red-600 dark:focus:border-red-400 dark:focus:file:border-red-400 dark:placeholder-red-600 dark:text-red-300",
|
|
52
|
+
warning: "bg-white text-yellow-700 placeholder-yellow-500 border-yellow-300 file:border-yellow-300 focus:border-yellow-600 focus:file:border-yellow-600 dark:bg-transparent dark:border-yellow-600 dark:file:border-yellow-600 dark:focus:border-yellow-400 dark:focus:file:border-yellow-400 dark:placeholder-yellow-600 dark:text-yellow-300",
|
|
53
|
+
light: "bg-white text-gray-700 placeholder-gray-400 border-gray-300 file:border-gray-300 focus:border-blue-600 focus:file:border-blue-600 dark:bg-transparent dark:border-gray-600 dark:file:border-gray-600 dark:focus:border-blue-400 dark:focus:file:border-blue-400 dark:placeholder-gray-500 dark:text-gray-300"
|
|
54
|
+
},
|
|
55
|
+
sizes: {
|
|
56
|
+
sm: "h-8 px-2.5 rounded text-sm file:text-sm file:px-2.5 file:mr-2.5",
|
|
57
|
+
md: "h-10 px-3 rounded-md file:px-3 file:mr-3",
|
|
58
|
+
lg: "h-12 px-4 rounded-md text-lg file:text-lg file:px-4 file:mr-4"
|
|
59
|
+
}
|
|
60
|
+
}, a = (t, n) => {
|
|
61
|
+
let { class: r, type: a, ...o } = n.attrs;
|
|
62
|
+
return e("input", {
|
|
63
|
+
type: a,
|
|
64
|
+
class: [
|
|
65
|
+
r,
|
|
66
|
+
i.base,
|
|
67
|
+
a === "file" ? i.file : "",
|
|
68
|
+
i.colors[t.color ?? "light"],
|
|
69
|
+
i.sizes[t.size ?? "md"]
|
|
70
|
+
],
|
|
71
|
+
...o,
|
|
72
|
+
value: t.modelValue,
|
|
73
|
+
onInput: (e) => n.emit("update:modelValue", e.target.value)
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
a.props = {
|
|
77
|
+
color: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: "light"
|
|
80
|
+
},
|
|
81
|
+
size: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: "md"
|
|
84
|
+
},
|
|
85
|
+
modelValue: String
|
|
86
|
+
};
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/components/checkbox/checkbox.ts
|
|
89
|
+
var o = {
|
|
90
|
+
wrapper: "inline-flex items-center gap-2.5",
|
|
91
|
+
label: "font-normal text-gray-900 dark:text-gray-300",
|
|
92
|
+
base: "appearance-none relative border focus-visible:outline-2 focus:ring-0 focus-visible:outline-offset-2 after:hidden checked:after:block after:content-[''] after:border-white after:-rotate-45 after:absolute",
|
|
93
|
+
colors: {
|
|
94
|
+
light: "border-gray-300 checked:bg-blue-600 checked:border-blue-600 dark:border-gray-600 focus-visible:outline-blue-600",
|
|
95
|
+
primary: "border-blue-300 checked:bg-blue-600 checked:border-blue-600 dark:border-blue-600 focus-visible:outline-blue-600",
|
|
96
|
+
error: "border-red-300 checked:bg-red-600 checked:border-red-600 dark:border-red-600 focus-visible:outline-red-600",
|
|
97
|
+
warning: "border-yellow-300 checked:bg-yellow-600 checked:border-yellow-600 dark:border-yellow-600 focus-visible:outline-yellow-600",
|
|
98
|
+
success: "border-green-300 checked:bg-green-600 checked:border-green-600 dark:border-green-600 focus-visible:outline-green-600"
|
|
99
|
+
},
|
|
100
|
+
sizes: {
|
|
101
|
+
sm: "size-3 rounded-sm after:w-1.5 after:border-l-1 after:border-b-1 after:h-1 after:top-0.5 after:left-0.5",
|
|
102
|
+
md: "size-4 rounded after:w-2.5 after:border-l-2 after:border-b-2 after:h-1.5 after:top-0.75 after:left-0.5",
|
|
103
|
+
lg: "size-6 rounded-md after:w-4 after:border-l-3 after:border-b-3 after:h-2.5 after:top-0.75 after:left-0.75"
|
|
104
|
+
}
|
|
105
|
+
}, s = (n, r) => {
|
|
106
|
+
let i = n.id || t();
|
|
107
|
+
return e("div", { class: o.wrapper }, [e("input", {
|
|
108
|
+
...r.attrs,
|
|
109
|
+
id: i,
|
|
110
|
+
type: "checkbox",
|
|
111
|
+
checked: Array.isArray(n.modelValue) ? n.modelValue.findIndex((e) => e === n.inputValue) !== -1 : n.modelValue,
|
|
112
|
+
class: [
|
|
113
|
+
o.base,
|
|
114
|
+
o.colors[n.color ?? "light"],
|
|
115
|
+
o.sizes[n.size ?? "md"]
|
|
116
|
+
],
|
|
117
|
+
onChange: (e) => {
|
|
118
|
+
let t = e.target.checked;
|
|
119
|
+
r.emit("update:modelValue", Array.isArray(n.modelValue) ? t ? [...n.modelValue, n.inputValue] : n.modelValue.filter((e) => e !== n.inputValue) : t);
|
|
120
|
+
}
|
|
121
|
+
}), n.label ? e("label", {
|
|
122
|
+
class: o.label,
|
|
123
|
+
for: i
|
|
124
|
+
}, n.label) : null]);
|
|
125
|
+
};
|
|
126
|
+
s.props = {
|
|
127
|
+
label: String,
|
|
128
|
+
color: {
|
|
129
|
+
type: String,
|
|
130
|
+
default: "light"
|
|
131
|
+
},
|
|
132
|
+
size: {
|
|
133
|
+
type: String,
|
|
134
|
+
default: "md"
|
|
135
|
+
},
|
|
136
|
+
inputValue: String,
|
|
137
|
+
modelValue: [Boolean, Array],
|
|
138
|
+
id: String
|
|
139
|
+
}, s.emits = ["update:modelValue"];
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/components/radio/radio.ts
|
|
142
|
+
var c = {
|
|
143
|
+
wrapper: "inline-flex items-center gap-2",
|
|
144
|
+
label: "font-normal text-gray-900 dark:text-gray-300",
|
|
145
|
+
base: "appearance-none rounded-full relative border focus-visible:outline-2 focus:ring-0 focus-visible:outline-offset-2 after:hidden checked:after:block after:content-[''] after:bg-white after:absolute after:rounded-full after:top-1/2 after:left-1/2 after:-translate-x-1/2 after:-translate-y-1/2",
|
|
146
|
+
colors: {
|
|
147
|
+
light: "border-gray-300 checked:bg-blue-600 checked:border-blue-600 dark:border-gray-600 focus-visible:outline-blue-600",
|
|
148
|
+
primary: "border-blue-300 checked:bg-blue-600 checked:border-blue-600 dark:border-blue-600 focus-visible:outline-blue-600",
|
|
149
|
+
error: "border-red-300 checked:bg-red-600 checked:border-red-600 dark:border-red-600 focus-visible:outline-red-600",
|
|
150
|
+
warning: "border-yellow-300 checked:bg-yellow-600 checked:border-yellow-600 dark:border-yellow-600 focus-visible:outline-yellow-600",
|
|
151
|
+
success: "border-green-300 checked:bg-green-600 checked:border-green-600 dark:border-green-600 focus-visible:outline-green-600"
|
|
152
|
+
},
|
|
153
|
+
sizes: {
|
|
154
|
+
sm: "size-3 after:size-1.25",
|
|
155
|
+
md: "size-4 after:size-1.75",
|
|
156
|
+
lg: "size-6 after:size-3"
|
|
157
|
+
}
|
|
158
|
+
}, l = (n, r) => {
|
|
159
|
+
let i = n.id || t();
|
|
160
|
+
return e("div", { class: c.wrapper }, [e("input", {
|
|
161
|
+
...r.attrs,
|
|
162
|
+
id: i,
|
|
163
|
+
type: "radio",
|
|
164
|
+
checked: n.modelValue === n.inputValue,
|
|
165
|
+
class: [
|
|
166
|
+
c.base,
|
|
167
|
+
c.colors[n.color ?? "light"],
|
|
168
|
+
c.sizes[n.size ?? "md"]
|
|
169
|
+
],
|
|
170
|
+
onChange: () => {
|
|
171
|
+
r.emit("update:modelValue", n.inputValue);
|
|
172
|
+
}
|
|
173
|
+
}), n.label ? e("label", {
|
|
174
|
+
class: c.label,
|
|
175
|
+
for: i
|
|
176
|
+
}, n.label) : null]);
|
|
177
|
+
};
|
|
178
|
+
l.props = {
|
|
179
|
+
label: String,
|
|
180
|
+
color: {
|
|
181
|
+
type: String,
|
|
182
|
+
default: "light"
|
|
183
|
+
},
|
|
184
|
+
size: {
|
|
185
|
+
type: String,
|
|
186
|
+
default: "md"
|
|
187
|
+
},
|
|
188
|
+
inputValue: String,
|
|
189
|
+
modelValue: String,
|
|
190
|
+
id: String
|
|
191
|
+
}, l.emits = ["update:modelValue"];
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/components/select/select.ts
|
|
194
|
+
var u = {
|
|
195
|
+
base: "appearance-none border focus:outline-0",
|
|
196
|
+
wrapper: "w-fit relative after:block after:content-[''] after:border-l-2 after:border-b-2 after:border-gray-500 after:-rotate-45 has-focus:after:rotate-135 after:absolute",
|
|
197
|
+
colors: {
|
|
198
|
+
primary: "bg-white text-blue-700 placeholder-blue-500 border-blue-300 focus:border-blue-600 dark:bg-transparent dark:border-blue-600 dark:focus:border-blue-400 dark:placeholder-blue-600 dark:text-blue-300",
|
|
199
|
+
success: "bg-white text-green-700 placeholder-green-500 border-green-300 focus:border-green-600 dark:bg-transparent dark:border-green-600 dark:focus:border-green-400 dark:placeholder-green-600 dark:text-green-300",
|
|
200
|
+
error: "bg-white text-red-700 placeholder-red-500 border-red-300 focus:border-red-600 dark:bg-transparent dark:border-red-600 dark:focus:border-red-400 dark:placeholder-red-600 dark:text-red-300",
|
|
201
|
+
warning: "bg-white text-yellow-700 placeholder-yellow-500 border-yellow-300 focus:border-yellow-600 dark:bg-transparent dark:border-yellow-600 dark:focus:border-yellow-400 dark:placeholder-yellow-600 dark:text-yellow-300",
|
|
202
|
+
light: "bg-white text-gray-700 placeholder-gray-400 border-gray-300 focus:border-blue-600 dark:bg-transparent dark:border-gray-600 dark:focus:border-blue-400 dark:placeholder-gray-500 dark:text-gray-300"
|
|
203
|
+
},
|
|
204
|
+
wrapperSizes: {
|
|
205
|
+
sm: "after:size-1.75 after:top-2.5 after:right-2.5 has-focus:after:top-3.5",
|
|
206
|
+
md: "after:size-2 after:top-3.25 after:right-3 has-focus:after:top-4.25",
|
|
207
|
+
lg: "after:size-2 after:top-4.25 after:right-4 has-focus:after:top-5.25"
|
|
208
|
+
},
|
|
209
|
+
sizes: {
|
|
210
|
+
sm: "h-8 px-2.5 pr-8 rounded text-sm",
|
|
211
|
+
md: "h-10 pl-3 pr-10 rounded-md",
|
|
212
|
+
lg: "h-12 px-4 pr-12 rounded-md text-lg"
|
|
213
|
+
}
|
|
214
|
+
}, d = (t, n) => {
|
|
215
|
+
let { class: r, type: i, ...a } = n.attrs;
|
|
216
|
+
return e("div", { class: [u.wrapper, u.wrapperSizes[t.size ?? "md"]] }, e("select", {
|
|
217
|
+
type: i,
|
|
218
|
+
class: [
|
|
219
|
+
r,
|
|
220
|
+
u.base,
|
|
221
|
+
u.colors[t.color ?? "light"],
|
|
222
|
+
u.sizes[t.size ?? "md"]
|
|
223
|
+
],
|
|
224
|
+
...a,
|
|
225
|
+
value: t.modelValue,
|
|
226
|
+
onChange: (e) => n.emit("update:modelValue", e.target.value)
|
|
227
|
+
}, t.options?.map((t) => e("option", { value: typeof t == "object" ? t.id : t }, typeof t == "object" ? t.name : t))));
|
|
228
|
+
};
|
|
229
|
+
d.props = {
|
|
230
|
+
color: {
|
|
231
|
+
type: String,
|
|
232
|
+
default: "light"
|
|
233
|
+
},
|
|
234
|
+
size: {
|
|
235
|
+
type: String,
|
|
236
|
+
default: "md"
|
|
237
|
+
},
|
|
238
|
+
modelValue: null,
|
|
239
|
+
options: {
|
|
240
|
+
type: Array,
|
|
241
|
+
default: () => []
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
//#endregion
|
|
245
|
+
export { r as Button, s as Checkbox, a as Input, l as Radio, d as Select };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.GurunKit={},e.Vue))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n={base:`font-medium cursor-pointer inline-flex items-center justify-center`,colors:{primary:`bg-blue-600 text-white hover:bg-blue-700`,success:`bg-green-600 text-white hover:bg-green-700`,error:`bg-red-600 text-white hover:bg-red-700`,warning:`bg-yellow-600 text-white hover:bg-yellow-700`,light:`bg-white text-gray-700 hover:bg-gray-100`},sizes:{sm:`h-8 px-3 rounded text-sm`,md:`h-10 px-4 rounded-md`,lg:`h-12 px-6 rounded-md text-lg`}},r=(e,r)=>{let{class:i,...a}=r.attrs;return(0,t.h)(e.tag??`button`,{class:[i,n.base,n.colors[e.color??`primary`],n.sizes[e.size??`md`]],...a},{default:r.slots.default})};r.props={color:{type:String,default:`primary`},size:{type:String,default:`md`},tag:{type:null,default:`button`}};var i={base:`border file:bg-gray-100 file:h-full file:text-gray-900 file:border-r focus:outline-0 dark:file:bg-gray-700 dark:file:text-white`,file:`pl-0`,colors:{primary:`bg-white text-blue-700 placeholder-blue-500 border-blue-300 file:border-blue-300 focus:border-blue-600 focus:file:border-blue-600 dark:bg-transparent dark:border-blue-600 dark:file:border-blue-600 dark:focus:border-blue-400 dark:focus:file:border-blue-400 dark:placeholder-blue-600 dark:text-blue-300`,success:`bg-white text-green-700 placeholder-green-500 border-green-300 file:border-green-300 focus:border-green-600 focus:file:border-green-600 dark:bg-transparent dark:border-green-600 dark:file:border-green-600 dark:focus:border-green-400 dark:focus:file:border-green-400 dark:placeholder-green-600 dark:text-green-300`,error:`bg-white text-red-700 placeholder-red-500 border-red-300 file:border-red-300 focus:border-red-600 focus:file:border-red-600 dark:bg-transparent dark:border-red-600 dark:file:border-red-600 dark:focus:border-red-400 dark:focus:file:border-red-400 dark:placeholder-red-600 dark:text-red-300`,warning:`bg-white text-yellow-700 placeholder-yellow-500 border-yellow-300 file:border-yellow-300 focus:border-yellow-600 focus:file:border-yellow-600 dark:bg-transparent dark:border-yellow-600 dark:file:border-yellow-600 dark:focus:border-yellow-400 dark:focus:file:border-yellow-400 dark:placeholder-yellow-600 dark:text-yellow-300`,light:`bg-white text-gray-700 placeholder-gray-400 border-gray-300 file:border-gray-300 focus:border-blue-600 focus:file:border-blue-600 dark:bg-transparent dark:border-gray-600 dark:file:border-gray-600 dark:focus:border-blue-400 dark:focus:file:border-blue-400 dark:placeholder-gray-500 dark:text-gray-300`},sizes:{sm:`h-8 px-2.5 rounded text-sm file:text-sm file:px-2.5 file:mr-2.5`,md:`h-10 px-3 rounded-md file:px-3 file:mr-3`,lg:`h-12 px-4 rounded-md text-lg file:text-lg file:px-4 file:mr-4`}},a=(e,n)=>{let{class:r,type:a,...o}=n.attrs;return(0,t.h)(`input`,{type:a,class:[r,i.base,a===`file`?i.file:``,i.colors[e.color??`light`],i.sizes[e.size??`md`]],...o,value:e.modelValue,onInput:e=>n.emit(`update:modelValue`,e.target.value)})};a.props={color:{type:String,default:`light`},size:{type:String,default:`md`},modelValue:String};var o={wrapper:`inline-flex items-center gap-2.5`,label:`font-normal text-gray-900 dark:text-gray-300`,base:`appearance-none relative border focus-visible:outline-2 focus:ring-0 focus-visible:outline-offset-2 after:hidden checked:after:block after:content-[''] after:border-white after:-rotate-45 after:absolute`,colors:{light:`border-gray-300 checked:bg-blue-600 checked:border-blue-600 dark:border-gray-600 focus-visible:outline-blue-600`,primary:`border-blue-300 checked:bg-blue-600 checked:border-blue-600 dark:border-blue-600 focus-visible:outline-blue-600`,error:`border-red-300 checked:bg-red-600 checked:border-red-600 dark:border-red-600 focus-visible:outline-red-600`,warning:`border-yellow-300 checked:bg-yellow-600 checked:border-yellow-600 dark:border-yellow-600 focus-visible:outline-yellow-600`,success:`border-green-300 checked:bg-green-600 checked:border-green-600 dark:border-green-600 focus-visible:outline-green-600`},sizes:{sm:`size-3 rounded-sm after:w-1.5 after:border-l-1 after:border-b-1 after:h-1 after:top-0.5 after:left-0.5`,md:`size-4 rounded after:w-2.5 after:border-l-2 after:border-b-2 after:h-1.5 after:top-0.75 after:left-0.5`,lg:`size-6 rounded-md after:w-4 after:border-l-3 after:border-b-3 after:h-2.5 after:top-0.75 after:left-0.75`}},s=(e,n)=>{let r=e.id||(0,t.useId)();return(0,t.h)(`div`,{class:o.wrapper},[(0,t.h)(`input`,{...n.attrs,id:r,type:`checkbox`,checked:Array.isArray(e.modelValue)?e.modelValue.findIndex(t=>t===e.inputValue)!==-1:e.modelValue,class:[o.base,o.colors[e.color??`light`],o.sizes[e.size??`md`]],onChange:t=>{let r=t.target.checked;n.emit(`update:modelValue`,Array.isArray(e.modelValue)?r?[...e.modelValue,e.inputValue]:e.modelValue.filter(t=>t!==e.inputValue):r)}}),e.label?(0,t.h)(`label`,{class:o.label,for:r},e.label):null])};s.props={label:String,color:{type:String,default:`light`},size:{type:String,default:`md`},inputValue:String,modelValue:[Boolean,Array],id:String},s.emits=[`update:modelValue`];var c={wrapper:`inline-flex items-center gap-2`,label:`font-normal text-gray-900 dark:text-gray-300`,base:`appearance-none rounded-full relative border focus-visible:outline-2 focus:ring-0 focus-visible:outline-offset-2 after:hidden checked:after:block after:content-[''] after:bg-white after:absolute after:rounded-full after:top-1/2 after:left-1/2 after:-translate-x-1/2 after:-translate-y-1/2`,colors:{light:`border-gray-300 checked:bg-blue-600 checked:border-blue-600 dark:border-gray-600 focus-visible:outline-blue-600`,primary:`border-blue-300 checked:bg-blue-600 checked:border-blue-600 dark:border-blue-600 focus-visible:outline-blue-600`,error:`border-red-300 checked:bg-red-600 checked:border-red-600 dark:border-red-600 focus-visible:outline-red-600`,warning:`border-yellow-300 checked:bg-yellow-600 checked:border-yellow-600 dark:border-yellow-600 focus-visible:outline-yellow-600`,success:`border-green-300 checked:bg-green-600 checked:border-green-600 dark:border-green-600 focus-visible:outline-green-600`},sizes:{sm:`size-3 after:size-1.25`,md:`size-4 after:size-1.75`,lg:`size-6 after:size-3`}},l=(e,n)=>{let r=e.id||(0,t.useId)();return(0,t.h)(`div`,{class:c.wrapper},[(0,t.h)(`input`,{...n.attrs,id:r,type:`radio`,checked:e.modelValue===e.inputValue,class:[c.base,c.colors[e.color??`light`],c.sizes[e.size??`md`]],onChange:()=>{n.emit(`update:modelValue`,e.inputValue)}}),e.label?(0,t.h)(`label`,{class:c.label,for:r},e.label):null])};l.props={label:String,color:{type:String,default:`light`},size:{type:String,default:`md`},inputValue:String,modelValue:String,id:String},l.emits=[`update:modelValue`];var u={base:`appearance-none border focus:outline-0`,wrapper:`w-fit relative after:block after:content-[''] after:border-l-2 after:border-b-2 after:border-gray-500 after:-rotate-45 has-focus:after:rotate-135 after:absolute`,colors:{primary:`bg-white text-blue-700 placeholder-blue-500 border-blue-300 focus:border-blue-600 dark:bg-transparent dark:border-blue-600 dark:focus:border-blue-400 dark:placeholder-blue-600 dark:text-blue-300`,success:`bg-white text-green-700 placeholder-green-500 border-green-300 focus:border-green-600 dark:bg-transparent dark:border-green-600 dark:focus:border-green-400 dark:placeholder-green-600 dark:text-green-300`,error:`bg-white text-red-700 placeholder-red-500 border-red-300 focus:border-red-600 dark:bg-transparent dark:border-red-600 dark:focus:border-red-400 dark:placeholder-red-600 dark:text-red-300`,warning:`bg-white text-yellow-700 placeholder-yellow-500 border-yellow-300 focus:border-yellow-600 dark:bg-transparent dark:border-yellow-600 dark:focus:border-yellow-400 dark:placeholder-yellow-600 dark:text-yellow-300`,light:`bg-white text-gray-700 placeholder-gray-400 border-gray-300 focus:border-blue-600 dark:bg-transparent dark:border-gray-600 dark:focus:border-blue-400 dark:placeholder-gray-500 dark:text-gray-300`},wrapperSizes:{sm:`after:size-1.75 after:top-2.5 after:right-2.5 has-focus:after:top-3.5`,md:`after:size-2 after:top-3.25 after:right-3 has-focus:after:top-4.25`,lg:`after:size-2 after:top-4.25 after:right-4 has-focus:after:top-5.25`},sizes:{sm:`h-8 px-2.5 pr-8 rounded text-sm`,md:`h-10 pl-3 pr-10 rounded-md`,lg:`h-12 px-4 pr-12 rounded-md text-lg`}},d=(e,n)=>{let{class:r,type:i,...a}=n.attrs;return(0,t.h)(`div`,{class:[u.wrapper,u.wrapperSizes[e.size??`md`]]},(0,t.h)(`select`,{type:i,class:[r,u.base,u.colors[e.color??`light`],u.sizes[e.size??`md`]],...a,value:e.modelValue,onChange:e=>n.emit(`update:modelValue`,e.target.value)},e.options?.map(e=>(0,t.h)(`option`,{value:typeof e==`object`?e.id:e},typeof e==`object`?e.name:e))))};d.props={color:{type:String,default:`light`},size:{type:String,default:`md`},modelValue:null,options:{type:Array,default:()=>[]}},e.Button=r,e.Checkbox=s,e.Input=a,e.Radio=l,e.Select=d});
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gurunkit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"author": "Narakode <ibrahimalanshor6@gmail.com> (https://narakode.id)",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"vue",
|
|
7
|
+
"tailwindcss"
|
|
8
|
+
],
|
|
9
|
+
"homepage": "https://github.com/narakode/gurunkit",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"main": "./dist/gurun-kit.umd.cjs",
|
|
16
|
+
"module": "./dist/gurun-kit.js",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./dist/gurun-kit.js",
|
|
20
|
+
"require": "./dist/gurun-kit.umd.cjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "vite",
|
|
25
|
+
"test": "vitest",
|
|
26
|
+
"build": "vue-tsc -b && vite build",
|
|
27
|
+
"preview": "vite preview",
|
|
28
|
+
"prepare": "husky",
|
|
29
|
+
"docs:dev": "vitepress dev docs",
|
|
30
|
+
"docs:build": "vitepress build docs",
|
|
31
|
+
"docs:preview": "vitepress preview docs"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@tailwindcss/vite": "^4.3.0",
|
|
35
|
+
"@types/node": "^24.12.3",
|
|
36
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
37
|
+
"@vue/test-utils": "^2.4.10",
|
|
38
|
+
"@vue/tsconfig": "^0.9.1",
|
|
39
|
+
"eslint": "^10.3.0",
|
|
40
|
+
"eslint-plugin-vue": "^10.9.1",
|
|
41
|
+
"globals": "^17.6.0",
|
|
42
|
+
"husky": "^9.1.7",
|
|
43
|
+
"jsdom": "^29.1.1",
|
|
44
|
+
"lint-staged": "^17.0.4",
|
|
45
|
+
"postcss": "^8.5.14",
|
|
46
|
+
"prettier": "3.8.3",
|
|
47
|
+
"typescript": "~6.0.2",
|
|
48
|
+
"typescript-eslint": "^8.59.3",
|
|
49
|
+
"vite": "^8.0.12",
|
|
50
|
+
"vitepress": "^2.0.0-alpha.17",
|
|
51
|
+
"vitest": "^4.1.6",
|
|
52
|
+
"vue-tsc": "^3.2.8"
|
|
53
|
+
},
|
|
54
|
+
"lint-staged": {
|
|
55
|
+
"*.{vue,js,ts,css,md}": "prettier --write",
|
|
56
|
+
"*.{vue,js,ts}": "eslint --cache --fix"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"tailwind": "^4.0.0",
|
|
60
|
+
"vue": "^3.5.34"
|
|
61
|
+
}
|
|
62
|
+
}
|