tfs-input 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +60 -0
- package/dist/style.css +1 -0
- package/dist/tfsInput.js +31 -0
- package/dist/tfsInput.umd.cjs +1 -0
- package/package.json +54 -0
- package/src/main.js +3 -0
- package/src/tfsInput.vue +73 -0
package/README.md
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
# tfsInput
|
2
|
+
|
3
|
+
A customizable Vue 3 input component with animated floating labels for clean, modern forms.
|
4
|
+
|
5
|
+
## Features
|
6
|
+
|
7
|
+
- Modern UI
|
8
|
+
- Customizable placeholder, label, and value.
|
9
|
+
- Emits updates for seamless v-model binding.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Install via npm:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
npm install tfs-input
|
17
|
+
```
|
18
|
+
|
19
|
+
## Basic Usage
|
20
|
+
|
21
|
+
Import and use the component in your Vue project.
|
22
|
+
|
23
|
+
```vue
|
24
|
+
<template>
|
25
|
+
<tInput label="Name" placehold="Enter your name" v-model:val="name" />
|
26
|
+
</template>
|
27
|
+
|
28
|
+
<script setup>
|
29
|
+
import { ref } from "vue";
|
30
|
+
import tInput from "tfs-input";
|
31
|
+
|
32
|
+
const name = ref("");
|
33
|
+
</script>
|
34
|
+
```
|
35
|
+
|
36
|
+
## Properties
|
37
|
+
|
38
|
+
### Props
|
39
|
+
|
40
|
+
| **Prop** |**Type**| **Description** |
|
41
|
+
| ----------- | ------ | ----------------------------------- |
|
42
|
+
| `label` | String | Text displayed as a floating label. |
|
43
|
+
| `val` | String | Bound value for input. |
|
44
|
+
| `placehold` | String | Placeholder text for input. |
|
45
|
+
|
46
|
+
### Emits
|
47
|
+
|
48
|
+
| **Event** | **Description** |
|
49
|
+
| ------------ | ---------------------------------------------------- |
|
50
|
+
| `update:val` | Emits input value updates for v-model compatibility. |
|
51
|
+
|
52
|
+
## Credits
|
53
|
+
|
54
|
+
- Created by [Farhan Madni](https://github.com/MFM-347)
|
55
|
+
|
56
|
+
## License
|
57
|
+
|
58
|
+
The code in this repository is licensed under the **MIT License**.
|
59
|
+
|
60
|
+
[![License MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
|
package/dist/style.css
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.contain[data-v-2143fbc4]{position:relative}.inp[data-v-2143fbc4]{background-color:transparent;color:#27272a;border:1px solid #52525b;width:100%;margin:5px 15px;border-radius:8.75px;background:none;padding:12px 16px;font-size:18px}.inp[data-v-2143fbc4]:focus{border:1px solid #2563eb;outline:none}.inp[data-v-2143fbc4]::placeholder,.inp[data-v-2143fbc4]::-webkit-input-placeholder,.inp[data-v-2143fbc4]::-ms-input-placeholder,.inp[data-v-2143fbc4]::-moz-input-placeholder{color:#71717a}.inp[data-v-2143fbc4],.label[data-v-2143fbc4]{transition:color,background-color,border-color .2s ease-out}.label[data-v-2143fbc4]{background-color:transparent;color:#71717a;border:1px solid #52525b;font-size:15px;font-weight:600;padding:0 6px;border-radius:7.25px;position:absolute;top:-12px;left:40px;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.contain:focus-within .label[data-v-2143fbc4]{color:#2563eb;border:1px solid #2563eb}
|
package/dist/tfsInput.js
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
import { openBlock as s, createElementBlock as c, createElementVNode as n, toDisplayString as r } from "vue";
|
2
|
+
const p = (t, l) => {
|
3
|
+
const e = t.__vccOpts || t;
|
4
|
+
for (const [a, o] of l)
|
5
|
+
e[a] = o;
|
6
|
+
return e;
|
7
|
+
}, i = { class: "contain" }, u = ["placeholder", "value"], d = { class: "label" }, v = {
|
8
|
+
__name: "tfsInput",
|
9
|
+
props: {
|
10
|
+
label: String,
|
11
|
+
val: String,
|
12
|
+
placehold: String
|
13
|
+
},
|
14
|
+
emits: ["update:val"],
|
15
|
+
setup(t) {
|
16
|
+
return (l, e) => (s(), c("div", i, [
|
17
|
+
n("input", {
|
18
|
+
class: "inp",
|
19
|
+
name: "text",
|
20
|
+
type: "text",
|
21
|
+
placeholder: t.placehold,
|
22
|
+
value: t.val,
|
23
|
+
onInput: e[0] || (e[0] = (a) => l.$emit("update:val", a.target.value))
|
24
|
+
}, null, 40, u),
|
25
|
+
n("label", d, r(t.label), 1)
|
26
|
+
]));
|
27
|
+
}
|
28
|
+
}, m = /* @__PURE__ */ p(v, [["__scopeId", "data-v-2143fbc4"]]);
|
29
|
+
export {
|
30
|
+
m as tInput
|
31
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["tfs-Input"]={},t.Vue))})(this,function(t,e){"use strict";const a=(n,o)=>{const l=n.__vccOpts||n;for(const[s,u]of o)l[s]=u;return l},i={class:"contain"},c=["placeholder","value"],d={class:"label"},p=a({__name:"tfsInput",props:{label:String,val:String,placehold:String},emits:["update:val"],setup(n){return(o,l)=>(e.openBlock(),e.createElementBlock("div",i,[e.createElementVNode("input",{class:"inp",name:"text",type:"text",placeholder:n.placehold,value:n.val,onInput:l[0]||(l[0]=s=>o.$emit("update:val",s.target.value))},null,40,c),e.createElementVNode("label",d,e.toDisplayString(n.label),1)]))}},[["__scopeId","data-v-2143fbc4"]]);t.tInput=p,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
{
|
2
|
+
"name": "tfs-input",
|
3
|
+
"version": "0.9.0",
|
4
|
+
"private": false,
|
5
|
+
"type": "module",
|
6
|
+
"description": "Customizable Vue input component floating labels for modern UIs.",
|
7
|
+
"homepage": "https://github.com/MFM-347/tfsInput#readme",
|
8
|
+
"files": [
|
9
|
+
"dist/*",
|
10
|
+
"src/*"
|
11
|
+
],
|
12
|
+
"main": "./dist/tfsInput.umd.cjs",
|
13
|
+
"module": "./dist/tfsInput.js",
|
14
|
+
"exports": {
|
15
|
+
".": {
|
16
|
+
"import": "./dist/tfsInput.js",
|
17
|
+
"require": "./dist/tfsInput.umd.cjs"
|
18
|
+
},
|
19
|
+
"./style.css": "./dist/style.css"
|
20
|
+
},
|
21
|
+
"scripts": {
|
22
|
+
"dev": "vite",
|
23
|
+
"build": "vite build",
|
24
|
+
"preview": "vite preview"
|
25
|
+
},
|
26
|
+
"dependencies": {
|
27
|
+
"vue": "^3.5.12"
|
28
|
+
},
|
29
|
+
"peerDependencies": {
|
30
|
+
"vue": "^3.x"
|
31
|
+
},
|
32
|
+
"devDependencies": {
|
33
|
+
"@vitejs/plugin-vue": "^5.1.4",
|
34
|
+
"vite": "^5.4.10"
|
35
|
+
},
|
36
|
+
"keywords": [
|
37
|
+
"vue",
|
38
|
+
"vue3",
|
39
|
+
"input",
|
40
|
+
"ui-component"
|
41
|
+
],
|
42
|
+
"repository": {
|
43
|
+
"type": "git",
|
44
|
+
"url": "git+https://github.com/MFM-347/tfsInput.git"
|
45
|
+
},
|
46
|
+
"bugs": {
|
47
|
+
"url": "https://github.com/MFM-347/tfsInput/issues"
|
48
|
+
},
|
49
|
+
"author": {
|
50
|
+
"name": "Farhan Madni",
|
51
|
+
"email": "madnifm347@outlook.com"
|
52
|
+
},
|
53
|
+
"license": "MIT"
|
54
|
+
}
|
package/src/main.js
ADDED
package/src/tfsInput.vue
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="contain">
|
3
|
+
<input
|
4
|
+
class="inp"
|
5
|
+
name="text"
|
6
|
+
type="text"
|
7
|
+
:placeholder="placehold"
|
8
|
+
:value="val"
|
9
|
+
@input="$emit('update:val', $event.target.value)"
|
10
|
+
/>
|
11
|
+
<label class="label"> {{ label }} </label>
|
12
|
+
</div>
|
13
|
+
</template>
|
14
|
+
|
15
|
+
<script setup>
|
16
|
+
defineProps({
|
17
|
+
label: String,
|
18
|
+
val: String,
|
19
|
+
placehold: String,
|
20
|
+
});
|
21
|
+
|
22
|
+
defineEmits(["update:val"]);
|
23
|
+
</script>
|
24
|
+
<style scoped>
|
25
|
+
.contain {
|
26
|
+
position: relative;
|
27
|
+
}
|
28
|
+
.inp {
|
29
|
+
background-color: transparent;
|
30
|
+
color: #27272a;
|
31
|
+
border: 1px solid #52525b;
|
32
|
+
width: 100%;
|
33
|
+
margin: 5px 15px;
|
34
|
+
border-radius: 8.75px;
|
35
|
+
background: none;
|
36
|
+
padding: 12px 16px;
|
37
|
+
font-size: 18px;
|
38
|
+
}
|
39
|
+
.inp:focus {
|
40
|
+
border: 1px solid #2563eb;
|
41
|
+
outline: none;
|
42
|
+
}
|
43
|
+
.inp::placeholder,
|
44
|
+
.inp::-webkit-input-placeholder,
|
45
|
+
.inp::-ms-input-placeholder,
|
46
|
+
.inp::-moz-input-placeholder {
|
47
|
+
color: #71717a;
|
48
|
+
}
|
49
|
+
.inp,
|
50
|
+
.label {
|
51
|
+
transition:
|
52
|
+
color,
|
53
|
+
background-color,
|
54
|
+
border-color 0.2s ease-out;
|
55
|
+
}
|
56
|
+
.label {
|
57
|
+
background-color: transparent;
|
58
|
+
color: #71717a;
|
59
|
+
border: 1px solid #52525b;
|
60
|
+
font-size: 15px;
|
61
|
+
font-weight: 600;
|
62
|
+
padding: 0 6px;
|
63
|
+
border-radius: 7.25px;
|
64
|
+
position: absolute;
|
65
|
+
top: -12px;
|
66
|
+
left: 40px;
|
67
|
+
backdrop-filter: blur(8px);
|
68
|
+
}
|
69
|
+
.contain:focus-within .label {
|
70
|
+
color: #2563eb;
|
71
|
+
border: 1px solid #2563eb;
|
72
|
+
}
|
73
|
+
</style>
|