ehscan-react-components 0.1.18 → 0.1.20
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/TextArea.js +1 -1
- package/dist/style/input.css +61 -36
- package/dist/style/window.css +3 -1
- package/package.json +1 -1
package/dist/TextArea.js
CHANGED
|
@@ -40,5 +40,5 @@ export const TextArea = ({ id, tabIndex, label, value, editable = true, required
|
|
|
40
40
|
textareaRef.current.style.height = "auto";
|
|
41
41
|
}
|
|
42
42
|
}, [onChange]);
|
|
43
|
-
return (_jsxs("div", { className: "ext-textarea-wrapper", children: [label && (_jsxs("div", { className: "ext-textarea-label", children: [_jsxs("label", { className: "ext-textarea-label-title", htmlFor: textareaId, children: [label, " ", required && _jsx("span", { className: "required", children: "*" })] }), _jsxs("div", { className: "ext-textarea-label-btns", children: [editable && charCount > 0 && (_jsxs("div", { className: "form-container-count", children: [charCount, " / ", maxLength] })), editable && charCount > 0 && (_jsx("
|
|
43
|
+
return (_jsxs("div", { className: "ext-textarea-wrapper", children: [label && (_jsxs("div", { className: "ext-textarea-label", children: [_jsxs("label", { className: "ext-textarea-label-title", htmlFor: textareaId, children: [label, " ", required && _jsx("span", { className: "required", children: "*" })] }), _jsxs("div", { className: "ext-textarea-label-btns", children: [editable && charCount > 0 && (_jsxs("div", { className: "form-container-count", children: [charCount, " / ", maxLength] })), editable && charCount > 0 && (_jsx("div", { className: "ext-textarea-svg-close", onClick: clear, "aria-label": `Clear ${label !== null && label !== void 0 ? label : "text area"}`, children: _jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("line", { x1: "8", y1: "8", x2: "16", y2: "16", stroke: "#333", "stroke-width": "2", "stroke-linecap": "round" }), _jsx("line", { x1: "16", y1: "8", x2: "8", y2: "16", stroke: "#333", "stroke-width": "2", "stroke-linecap": "round" })] }) }))] })] })), _jsx("div", { className: "ext-textarea-box", children: _jsx("textarea", { id: textareaId, tabIndex: tabIndex, ref: textareaRef, value: value !== null && value !== void 0 ? value : "", placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : "...", maxLength: maxLength, onChange: handleInputChange, onFocus: handleFocus, onBlur: setHeight, className: `ext-textarea${required && value === "" ? " highlight" : ""}`, rows: 1, spellCheck: false, readOnly: !editable, "aria-required": required, "aria-label": label }) })] }));
|
|
44
44
|
};
|
package/dist/style/input.css
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.ext-textarea-box {
|
|
28
|
-
background-color:
|
|
28
|
+
background-color: var(--ext-textarea-box-bck-color, transparent);
|
|
29
29
|
border-radius: 10px;
|
|
30
30
|
display: flex;
|
|
31
31
|
position: relative;
|
|
@@ -54,16 +54,6 @@ textarea::placeholder {
|
|
|
54
54
|
padding: 0
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
input[type="text"],
|
|
58
|
-
input[type="email"],
|
|
59
|
-
textarea {
|
|
60
|
-
color: var(--input-clr);
|
|
61
|
-
text-align: var(--input-align);
|
|
62
|
-
background-color: var(--d-input-bck-clr);
|
|
63
|
-
outline: none;
|
|
64
|
-
border: none;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
57
|
textarea {
|
|
68
58
|
resize: none;
|
|
69
59
|
overflow: hidden;
|
|
@@ -83,16 +73,17 @@ input:-webkit-autofill:active {
|
|
|
83
73
|
|
|
84
74
|
/* 🌐 Wrapper */
|
|
85
75
|
.ext-textarea-wrapper {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
gap: 4px;
|
|
89
79
|
}
|
|
90
80
|
|
|
91
81
|
/* 🏷️ Label Area */
|
|
92
82
|
.ext-textarea-label {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
display: flex;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
align-items:center;
|
|
86
|
+
height: 22px;
|
|
96
87
|
}
|
|
97
88
|
|
|
98
89
|
/* 🏷️ Label Title */
|
|
@@ -104,42 +95,43 @@ input:-webkit-autofill:active {
|
|
|
104
95
|
|
|
105
96
|
/* ⚙️ Label Controls (counter + clear) */
|
|
106
97
|
.ext-textarea-label-btns {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
gap: 8px;
|
|
110
101
|
}
|
|
111
102
|
|
|
112
103
|
/* 🔢 Character Count */
|
|
113
104
|
.form-container-count {
|
|
114
|
-
|
|
115
|
-
|
|
105
|
+
font-size: 0.85rem;
|
|
106
|
+
color: #666;
|
|
116
107
|
}
|
|
117
108
|
|
|
118
109
|
/* ❌ Clear Button */
|
|
119
110
|
.form-container-clear {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
111
|
+
border: none;
|
|
112
|
+
background: none;
|
|
113
|
+
color: #007aff;
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
font-size: 0.85rem;
|
|
125
116
|
}
|
|
126
117
|
|
|
127
118
|
/* ✏️ Textarea Box */
|
|
128
119
|
.ext-textarea-box {
|
|
129
|
-
|
|
120
|
+
width: 100%;
|
|
130
121
|
}
|
|
131
122
|
|
|
132
123
|
.ext-textarea {
|
|
133
|
-
font-size: var(--input-txt-size);
|
|
124
|
+
font-size: var(--ext-textarea-input-txt-size, 14px);
|
|
125
|
+
background-color: var(--ext-textarea-input-bck-clr, darkblue);
|
|
126
|
+
color: var(--ext-textarea-input-clr, red);
|
|
127
|
+
font-weight: var(--ext-textarea-d-font-weight, 400);
|
|
128
|
+
border-radius: var(--ext-textarea-border-radius, 20px);
|
|
134
129
|
border: none;
|
|
135
130
|
outline: none;
|
|
136
131
|
width: 100%;
|
|
137
|
-
font-weight: var(--d-font-weight);
|
|
138
132
|
display: grid;
|
|
139
133
|
justify-content: left;
|
|
140
134
|
align-items: center;
|
|
141
|
-
background-color: transparent;
|
|
142
|
-
color: var(--input-clr);
|
|
143
135
|
box-sizing: border-box;
|
|
144
136
|
resize: none;
|
|
145
137
|
overflow: hidden;
|
|
@@ -147,9 +139,42 @@ input:-webkit-autofill:active {
|
|
|
147
139
|
line-height: 1.5;
|
|
148
140
|
}
|
|
149
141
|
|
|
150
|
-
|
|
142
|
+
.ext-textarea:focus{
|
|
143
|
+
background-color: var(--ext-textarea-focus-bck-clr);
|
|
144
|
+
border-radius: var(--ext-textarea-border-radius);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
input[type="text"],
|
|
148
|
+
input[type="email"],
|
|
149
|
+
textarea {
|
|
150
|
+
color: var(--ext-textarea-input-clr);
|
|
151
|
+
text-align: left;
|
|
152
|
+
background-color: var(--ext-textarea-input-bck-clr);
|
|
153
|
+
outline: none;
|
|
154
|
+
border: none;
|
|
155
|
+
}
|
|
156
|
+
|
|
151
157
|
.ext-textarea.highlight {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
158
|
+
border: 1px solid #ccc; /* normal border */
|
|
159
|
+
outline: none; /* remove default focus outline */
|
|
160
|
+
transition: box-shadow 0.2s ease, border-color 0.2s ease;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Highlight on focus */
|
|
164
|
+
.ext-textarea.highlight:focus {
|
|
165
|
+
border-color: #4A90E2; /* optional: change border color */
|
|
166
|
+
box-shadow: 0 0 8px rgba(74, 144, 226, 0.6); /* glow effect */
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.ext-textarea-svg-close{
|
|
170
|
+
background-color: #007aff;
|
|
171
|
+
border-radius: 50px;
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
justify-content: center;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.ext-textarea-svg-close:hover{
|
|
178
|
+
cursor: pointer;
|
|
179
|
+
background-color: aquamarine;
|
|
155
180
|
}
|
package/dist/style/window.css
CHANGED
|
@@ -25,9 +25,10 @@
|
|
|
25
25
|
/* Header */
|
|
26
26
|
.ext-window-header {
|
|
27
27
|
border-radius: var(--ext-window-border-radius, 12px) var(--ext-window-border-radius, 12px) 0 0;
|
|
28
|
-
background-color: var(--ext-window-header-bck-color,
|
|
28
|
+
background-color: var(--ext-window-header-bck-color, transparent);
|
|
29
29
|
height: var(--ext-window-header-height, 50px);
|
|
30
30
|
cursor: pointer;
|
|
31
|
+
display: flex;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
/* Body */
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
.ext-window-footer {
|
|
42
43
|
background-color: var(--ext-window-footer-bck, transparent);
|
|
43
44
|
height: var(--ext-window-footer-height, 50px);
|
|
45
|
+
border-radius: 0 0 var(--ext-window-border-radius, 12px) var(--ext-window-border-radius, 12px);
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
/* Scrollbars for WebKit */
|