form-validator-widget 1.1.0 → 1.1.1
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.
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
|
|
2
|
+
@keyframes shake {
|
|
3
|
+
0%, 100% { transform: translateX(0); }
|
|
4
|
+
10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
|
|
5
|
+
20%, 40%, 60%, 80% { transform: translateX(5px); }
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@keyframes slideIn {
|
|
9
|
+
from {
|
|
10
|
+
opacity: 0;
|
|
11
|
+
transform: translateY(-10px);
|
|
12
|
+
}
|
|
13
|
+
to {
|
|
14
|
+
opacity: 1;
|
|
15
|
+
transform: translateY(0);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes gentlePulse {
|
|
20
|
+
0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); }
|
|
21
|
+
70% { box-shadow: 0 0 0 5px rgba(59, 130, 246, 0); }
|
|
22
|
+
100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.form-validator-field {
|
|
26
|
+
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.form-validator-field:focus {
|
|
30
|
+
outline: none;
|
|
31
|
+
border-color: #3b82f6;
|
|
32
|
+
animation: gentlePulse 1.5s infinite;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.form-validator-field.error {
|
|
36
|
+
border-color: #ef4444;
|
|
37
|
+
animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.form-validator-error-message {
|
|
41
|
+
color: #ef4444;
|
|
42
|
+
font-size: 0.875rem;
|
|
43
|
+
margin-top: 0.25rem;
|
|
44
|
+
animation: slideIn 0.2s ease-out;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.form-validator-theme-dark .form-validator-field {
|
|
48
|
+
background-color: #1f2937;
|
|
49
|
+
border-color: #4b5563;
|
|
50
|
+
color: white;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.form-validator-success {
|
|
54
|
+
border-color: #10b981 !important;
|
|
55
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
|
|
56
|
+
background-repeat: no-repeat;
|
|
57
|
+
background-position: right 0.5rem center;
|
|
58
|
+
padding-right: 2rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.form-validator-field-container {
|
|
62
|
+
margin-bottom: 1rem;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.form-validator-label {
|
|
66
|
+
display: block;
|
|
67
|
+
margin-bottom: 0.25rem;
|
|
68
|
+
font-size: 0.875rem;
|
|
69
|
+
font-weight: 500;
|
|
70
|
+
color: #374151;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.form-validator-theme-dark .form-validator-label {
|
|
74
|
+
color: #e5e7eb;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.form-validator-input {
|
|
78
|
+
composes: form-validator-field;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.checkbox-group {
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
gap: 0.75rem;
|
|
85
|
+
margin-bottom: 1rem;
|
|
86
|
+
padding: 0.5rem;
|
|
87
|
+
border: 1px solid #e5e7eb;
|
|
88
|
+
border-radius: 0.375rem;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.checkbox-label {
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
gap: 0.75rem;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
font-size: 0.95rem;
|
|
97
|
+
color: #374151;
|
|
98
|
+
transition: color 0.2s ease;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.checkbox-label:hover {
|
|
102
|
+
color: #1f2937;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.checkbox-input {
|
|
106
|
+
width: 1.2rem;
|
|
107
|
+
height: 1.2rem;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
border: 2px solid #d1d5db;
|
|
110
|
+
border-radius: 0.25rem;
|
|
111
|
+
transition: all 0.2s ease;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.checkbox-input:checked {
|
|
115
|
+
background-color: #3b82f6;
|
|
116
|
+
border-color: #3b82f6;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.checkbox-input.error {
|
|
120
|
+
border-color: #ef4444;
|
|
121
|
+
animation: pulse 1s infinite;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.checkbox-input:focus {
|
|
125
|
+
outline: none;
|
|
126
|
+
ring: 2px solid #3b82f6;
|
|
127
|
+
ring-offset: 2px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.form-validator-theme-dark .checkbox-label {
|
|
131
|
+
color: #e5e7eb;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.form-validator-theme-dark .checkbox-group {
|
|
135
|
+
border-color: #4b5563;
|
|
136
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "form-validator-widget",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "A reusable form validation widget with animations and advanced JavaScript concepts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,6 +32,9 @@
|
|
|
32
32
|
"react": ">=16.8.0",
|
|
33
33
|
"react-dom": ">=16.8.0"
|
|
34
34
|
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"tslib": "^2.6.0"
|
|
37
|
+
},
|
|
35
38
|
"devDependencies": {
|
|
36
39
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
37
40
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
@@ -43,8 +46,8 @@
|
|
|
43
46
|
"react-dom": "^18.0.0",
|
|
44
47
|
"rimraf": "^5.0.0",
|
|
45
48
|
"rollup": "^3.0.0",
|
|
49
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
46
50
|
"rollup-plugin-postcss": "^4.0.2",
|
|
47
|
-
"tslib": "^2.6.0",
|
|
48
51
|
"typescript": "^5.0.0"
|
|
49
52
|
}
|
|
50
53
|
}
|