@greghowe79/the-lib 1.5.9 → 1.6.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.
- package/lib/components/hero/styles.css.qwik.cjs +1 -1
- package/lib/components/hero/styles.css.qwik.mjs +1 -1
- package/lib/components/input/input.qwik.cjs +46 -1
- package/lib/components/input/input.qwik.mjs +46 -1
- package/lib/components/input/styles.css.qwik.cjs +1 -1
- package/lib/components/input/styles.css.qwik.mjs +1 -1
- package/lib-types/components/input/input.d.ts +4 -0
- package/lib-types/stories/input.stories.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const styles = "
|
|
2
|
+
const styles = ".hero {\r\n font-family: 'Roboto Condensed', sans-serif;\r\n background-color: #f5f5f7;\r\n text-align: center;\r\n padding: 3.5rem 1.25rem;\r\n}\r\n\r\n.hero h1 {\r\n font-size: calc(1rem * 3);\r\n margin-bottom: 1.25rem;\r\n color: #333;\r\n}\r\n\r\n.hero p {\r\n font-size: calc(1rem * 1);\r\n font-weight: 400;\r\n margin-bottom: 1.25rem;\r\n color: #333;\r\n}\r\n\r\n@media (min-width: 481px) {\r\n .hero {\r\n padding: 6.25rem 1.25rem;\r\n }\r\n\r\n .hero h1 {\r\n font-size: calc(1rem * 4);\r\n }\r\n\r\n .hero p {\r\n font-size: calc(1rem * 1.125);\r\n margin-bottom: 1.875rem;\r\n }\r\n}\r\n";
|
|
3
3
|
module.exports = styles;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const styles = "
|
|
1
|
+
const styles = ".hero {\r\n font-family: 'Roboto Condensed', sans-serif;\r\n background-color: #f5f5f7;\r\n text-align: center;\r\n padding: 3.5rem 1.25rem;\r\n}\r\n\r\n.hero h1 {\r\n font-size: calc(1rem * 3);\r\n margin-bottom: 1.25rem;\r\n color: #333;\r\n}\r\n\r\n.hero p {\r\n font-size: calc(1rem * 1);\r\n font-weight: 400;\r\n margin-bottom: 1.25rem;\r\n color: #333;\r\n}\r\n\r\n@media (min-width: 481px) {\r\n .hero {\r\n padding: 6.25rem 1.25rem;\r\n }\r\n\r\n .hero h1 {\r\n font-size: calc(1rem * 4);\r\n }\r\n\r\n .hero p {\r\n font-size: calc(1rem * 1.125);\r\n margin-bottom: 1.875rem;\r\n }\r\n}\r\n";
|
|
2
2
|
export {
|
|
3
3
|
styles as default
|
|
4
4
|
};
|
|
@@ -26,10 +26,14 @@ const uploadImage = qwik.$(async (_event, input, currentFile, selectedFile, imag
|
|
|
26
26
|
if (selectedFile) selectedFile.value = file.name;
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
|
-
const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate$, onInput$, bgLight, currentFile, selectedFile, icon, prefix, required = false, color, nameAttribute, label, selectedValue, imgUrl, autocomplete }) => {
|
|
29
|
+
const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate$, onInput$, bgLight, currentFile, selectedFile, icon, prefix, required = false, color, nameAttribute, label, selectedValue, imgUrl, autocomplete, iconPasswordShow, iconPasswordHide, labelShowPassword = "Show password", labelHidePassword = "Hide password" }) => {
|
|
30
30
|
qwik.useStylesScoped$(styles);
|
|
31
31
|
const internalError = qwik.useSignal(null);
|
|
32
|
+
const isPasswordVisible = qwik.useSignal(false);
|
|
32
33
|
const showError = error ?? internalError;
|
|
34
|
+
const togglePasswordVisibility = qwik.$(() => {
|
|
35
|
+
isPasswordVisible.value = !isPasswordVisible.value;
|
|
36
|
+
});
|
|
33
37
|
const inputHandler = qwik.$(async (_, elem) => {
|
|
34
38
|
if (type === "number") {
|
|
35
39
|
if (value) value.value = elem.value;
|
|
@@ -68,6 +72,7 @@ const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate
|
|
|
68
72
|
if (!error) internalError.value = result;
|
|
69
73
|
}
|
|
70
74
|
});
|
|
75
|
+
const effectiveType = type === "password" && isPasswordVisible.value ? "text" : type;
|
|
71
76
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
72
77
|
class: "input-container",
|
|
73
78
|
children: [
|
|
@@ -126,6 +131,7 @@ const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate
|
|
|
126
131
|
}),
|
|
127
132
|
/* @__PURE__ */ jsxRuntime.jsx("input", {
|
|
128
133
|
id,
|
|
134
|
+
name: id,
|
|
129
135
|
type,
|
|
130
136
|
inputMode: "tel",
|
|
131
137
|
pattern: "[0-9]*",
|
|
@@ -160,6 +166,44 @@ const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate
|
|
|
160
166
|
children: label
|
|
161
167
|
})
|
|
162
168
|
]
|
|
169
|
+
}) : type === "password" ? /* @__PURE__ */ jsxRuntime.jsxs("label", {
|
|
170
|
+
class: `input-label ${bgLight ? "bg_light" : ""}`,
|
|
171
|
+
for: id,
|
|
172
|
+
children: [
|
|
173
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
174
|
+
class: "sr-only",
|
|
175
|
+
children: label
|
|
176
|
+
}),
|
|
177
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
178
|
+
class: "input-wrapper",
|
|
179
|
+
children: [
|
|
180
|
+
(icon || iconPasswordShow || iconPasswordHide) && /* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
181
|
+
class: "input-icon",
|
|
182
|
+
"aria-hidden": "true",
|
|
183
|
+
children: typeof icon === "function" ? icon({}, null, 0) : icon
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ jsxRuntime.jsx("input", {
|
|
186
|
+
id,
|
|
187
|
+
name: id,
|
|
188
|
+
type: effectiveType,
|
|
189
|
+
class: `input ${showError.value ? "error" : ""}`,
|
|
190
|
+
placeholder,
|
|
191
|
+
"bind:value": value,
|
|
192
|
+
onInput$: inputHandler,
|
|
193
|
+
onBlur$: inputHandler,
|
|
194
|
+
required,
|
|
195
|
+
autocomplete
|
|
196
|
+
}),
|
|
197
|
+
(iconPasswordShow || iconPasswordHide) && /* @__PURE__ */ jsxRuntime.jsx("button", {
|
|
198
|
+
type: "button",
|
|
199
|
+
class: "password-toggle-btn",
|
|
200
|
+
onClick$: togglePasswordVisibility,
|
|
201
|
+
"aria-label": isPasswordVisible.value ? labelHidePassword : labelShowPassword,
|
|
202
|
+
children: isPasswordVisible.value ? typeof iconPasswordShow === "function" ? iconPasswordShow({}, null, 0) : iconPasswordShow : typeof iconPasswordHide === "function" ? iconPasswordHide({}, null, 0) : iconPasswordHide
|
|
203
|
+
})
|
|
204
|
+
]
|
|
205
|
+
})
|
|
206
|
+
]
|
|
163
207
|
}) : /* @__PURE__ */ jsxRuntime.jsxs("label", {
|
|
164
208
|
class: `input-label ${bgLight ? "bg_light" : ""}`,
|
|
165
209
|
for: id,
|
|
@@ -178,6 +222,7 @@ const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate
|
|
|
178
222
|
}),
|
|
179
223
|
/* @__PURE__ */ jsxRuntime.jsx("input", {
|
|
180
224
|
id,
|
|
225
|
+
name: id,
|
|
181
226
|
type,
|
|
182
227
|
class: `input ${showError.value ? "error" : ""}`,
|
|
183
228
|
placeholder,
|
|
@@ -24,10 +24,14 @@ const uploadImage = $(async (_event, input, currentFile, selectedFile, imageUrl)
|
|
|
24
24
|
if (selectedFile) selectedFile.value = file.name;
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
const Input = component$(({ id, type, placeholder, value, error, onValidate$, onInput$, bgLight, currentFile, selectedFile, icon, prefix, required = false, color, nameAttribute, label, selectedValue, imgUrl, autocomplete }) => {
|
|
27
|
+
const Input = component$(({ id, type, placeholder, value, error, onValidate$, onInput$, bgLight, currentFile, selectedFile, icon, prefix, required = false, color, nameAttribute, label, selectedValue, imgUrl, autocomplete, iconPasswordShow, iconPasswordHide, labelShowPassword = "Show password", labelHidePassword = "Hide password" }) => {
|
|
28
28
|
useStylesScoped$(styles);
|
|
29
29
|
const internalError = useSignal(null);
|
|
30
|
+
const isPasswordVisible = useSignal(false);
|
|
30
31
|
const showError = error ?? internalError;
|
|
32
|
+
const togglePasswordVisibility = $(() => {
|
|
33
|
+
isPasswordVisible.value = !isPasswordVisible.value;
|
|
34
|
+
});
|
|
31
35
|
const inputHandler = $(async (_, elem) => {
|
|
32
36
|
if (type === "number") {
|
|
33
37
|
if (value) value.value = elem.value;
|
|
@@ -66,6 +70,7 @@ const Input = component$(({ id, type, placeholder, value, error, onValidate$, on
|
|
|
66
70
|
if (!error) internalError.value = result;
|
|
67
71
|
}
|
|
68
72
|
});
|
|
73
|
+
const effectiveType = type === "password" && isPasswordVisible.value ? "text" : type;
|
|
69
74
|
return /* @__PURE__ */ jsxs("div", {
|
|
70
75
|
class: "input-container",
|
|
71
76
|
children: [
|
|
@@ -124,6 +129,7 @@ const Input = component$(({ id, type, placeholder, value, error, onValidate$, on
|
|
|
124
129
|
}),
|
|
125
130
|
/* @__PURE__ */ jsx("input", {
|
|
126
131
|
id,
|
|
132
|
+
name: id,
|
|
127
133
|
type,
|
|
128
134
|
inputMode: "tel",
|
|
129
135
|
pattern: "[0-9]*",
|
|
@@ -158,6 +164,44 @@ const Input = component$(({ id, type, placeholder, value, error, onValidate$, on
|
|
|
158
164
|
children: label
|
|
159
165
|
})
|
|
160
166
|
]
|
|
167
|
+
}) : type === "password" ? /* @__PURE__ */ jsxs("label", {
|
|
168
|
+
class: `input-label ${bgLight ? "bg_light" : ""}`,
|
|
169
|
+
for: id,
|
|
170
|
+
children: [
|
|
171
|
+
label && /* @__PURE__ */ jsx("span", {
|
|
172
|
+
class: "sr-only",
|
|
173
|
+
children: label
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ jsxs("div", {
|
|
176
|
+
class: "input-wrapper",
|
|
177
|
+
children: [
|
|
178
|
+
(icon || iconPasswordShow || iconPasswordHide) && /* @__PURE__ */ jsx("span", {
|
|
179
|
+
class: "input-icon",
|
|
180
|
+
"aria-hidden": "true",
|
|
181
|
+
children: typeof icon === "function" ? icon({}, null, 0) : icon
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ jsx("input", {
|
|
184
|
+
id,
|
|
185
|
+
name: id,
|
|
186
|
+
type: effectiveType,
|
|
187
|
+
class: `input ${showError.value ? "error" : ""}`,
|
|
188
|
+
placeholder,
|
|
189
|
+
"bind:value": value,
|
|
190
|
+
onInput$: inputHandler,
|
|
191
|
+
onBlur$: inputHandler,
|
|
192
|
+
required,
|
|
193
|
+
autocomplete
|
|
194
|
+
}),
|
|
195
|
+
(iconPasswordShow || iconPasswordHide) && /* @__PURE__ */ jsx("button", {
|
|
196
|
+
type: "button",
|
|
197
|
+
class: "password-toggle-btn",
|
|
198
|
+
onClick$: togglePasswordVisibility,
|
|
199
|
+
"aria-label": isPasswordVisible.value ? labelHidePassword : labelShowPassword,
|
|
200
|
+
children: isPasswordVisible.value ? typeof iconPasswordShow === "function" ? iconPasswordShow({}, null, 0) : iconPasswordShow : typeof iconPasswordHide === "function" ? iconPasswordHide({}, null, 0) : iconPasswordHide
|
|
201
|
+
})
|
|
202
|
+
]
|
|
203
|
+
})
|
|
204
|
+
]
|
|
161
205
|
}) : /* @__PURE__ */ jsxs("label", {
|
|
162
206
|
class: `input-label ${bgLight ? "bg_light" : ""}`,
|
|
163
207
|
for: id,
|
|
@@ -176,6 +220,7 @@ const Input = component$(({ id, type, placeholder, value, error, onValidate$, on
|
|
|
176
220
|
}),
|
|
177
221
|
/* @__PURE__ */ jsx("input", {
|
|
178
222
|
id,
|
|
223
|
+
name: id,
|
|
179
224
|
type,
|
|
180
225
|
class: `input ${showError.value ? "error" : ""}`,
|
|
181
226
|
placeholder,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const styles = ".input-container {\r\n font-family: 'Roboto Condensed', sans-serif;\r\n}\r\n\r\n.input-label:not([type='checkbox']) {\r\n font-size: 0.8125rem;\r\n line-height: 1.85;\r\n letter-spacing: 0.0625rem;\r\n color: #333;\r\n position: relative;\r\n height: 3.29412rem;\r\n display: flex;\r\n min-width: 0;\r\n background: rgba(0, 0, 0, 0.04);\r\n transition:\r\n color 0.15s ease,\r\n box-shadow 0.15s ease,\r\n background 0.15s ease;\r\n}\r\n\r\n.input-label.bg_light:not([type='checkbox']) {\r\n background: white;\r\n box-shadow: inset 0 0 0 1px #86868b;\r\n}\r\n\r\n.input-label.bg_light:not([type='checkbox']):focus-within {\r\n box-shadow: inset 0 0 0 1.5px #007aff;\r\n}\r\n\r\n.input {\r\n background: transparent;\r\n padding: 0 0.9375rem;\r\n flex: 1;\r\n font-size: 1rem;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n font-weight: 100;\r\n letter-spacing: inherit;\r\n color: inherit;\r\n height: 100%;\r\n border: none;\r\n -webkit-appearance: none;\r\n -moz-appearance: none;\r\n appearance: none;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n width: calc(100% - 0.9375rem * 2);\r\n}\r\n\r\n.input::placeholder {\r\n color: #6e6e73;\r\n}\r\n\r\n.input:focus {\r\n outline: none;\r\n opacity: 1;\r\n}\r\n\r\n.input-label {\r\n border-radius: 0.75rem;\r\n transition: box-shadow 0.15s ease;\r\n}\r\n\r\n.input-label:focus-within {\r\n box-shadow: inset 0 0 0 1.5px #007aff;\r\n}\r\n\r\n.error-message {\r\n color: #e74c3c;\r\n font-size: 0.875rem;\r\n margin-top: 0.25rem;\r\n font-size: 1rem;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n}\r\n\r\n.flex_wrapper {\r\n display: flex;\r\n justify-content: flex-start;\r\n align-items: center;\r\n}\r\n\r\n.label_wrapper {\r\n display: inline-flex;\r\n align-items: center;\r\n border-radius: 0.75rem 0 0 0.75rem;\r\n height: 3.29412rem;\r\n background-color: #0095ae;\r\n}\r\n\r\n.preview_container {\r\n height: 3.29412rem;\r\n display: flex;\r\n align-items: center;\r\n background: rgba(0, 0, 0, 0.04);\r\n border-radius: 0 0.75rem 0.75rem 0;\r\n color: #333;\r\n letter-spacing: 0.0625rem;\r\n font-size: 0.875rem;\r\n width: calc(100% - 3.4375rem);\r\n}\r\n\r\n.prev_wrap {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: calc(100% - 6.25rem);\r\n}\r\n\r\n.preview {\r\n margin: 0;\r\n border: none;\r\n}\r\n\r\n.input[type='file'] {\r\n position: absolute;\r\n width: 0.0625rem;\r\n height: 0.0625rem;\r\n padding: 0;\r\n margin: -0.0625rem;\r\n overflow: hidden;\r\n clip: rect(0, 0, 0, 0);\r\n border: 0;\r\n}\r\n\r\n.input-label {\r\n cursor: pointer;\r\n}\r\n\r\n.input-label-upload {\r\n cursor: pointer;\r\n width: 6.25rem;\r\n color: #fff;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n height: 3.4375rem;\r\n}\r\n\r\n.input-label:hover {\r\n background-color: rgba(0, 0, 0, 0.1);\r\n}\r\n\r\n.input-wrapper {\r\n position: relative;\r\n display: flex;\r\n align-items: center;\r\n width: 100%;\r\n padding: 0 0.9375rem;\r\n}\r\n\r\n.input-icon {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n pointer-events: none;\r\n}\r\n\r\n.input.with-icon {\r\n padding-left: 2.5rem;\r\n}\r\n.no_icon {\r\n width: 100%;\r\n}\r\n\r\n.sr-only {\r\n position: absolute;\r\n width: 1px;\r\n height: 1px;\r\n padding: 0;\r\n margin: -1px;\r\n overflow: hidden;\r\n clip: rect(0, 0, 0, 0);\r\n white-space: nowrap;\r\n border: 0;\r\n}\r\n\r\ninput[type='number']::-webkit-outer-spin-button,\r\ninput[type='number']::-webkit-inner-spin-button {\r\n -webkit-appearance: none;\r\n margin: 0;\r\n}\r\n\r\ninput[type='number'] {\r\n -moz-appearance: textfield;\r\n appearance: textfield;\r\n}\r\n";
|
|
2
|
+
const styles = ".input-container {\r\n font-family: 'Roboto Condensed', sans-serif;\r\n}\r\n\r\n.input-label:not([type='checkbox']) {\r\n font-size: 0.8125rem;\r\n line-height: 1.85;\r\n letter-spacing: 0.0625rem;\r\n color: #333;\r\n position: relative;\r\n height: 3.29412rem;\r\n display: flex;\r\n min-width: 0;\r\n background: rgba(0, 0, 0, 0.04);\r\n transition:\r\n color 0.15s ease,\r\n box-shadow 0.15s ease,\r\n background 0.15s ease;\r\n}\r\n\r\n.input-label.bg_light:not([type='checkbox']) {\r\n background: white;\r\n box-shadow: inset 0 0 0 1px #86868b;\r\n}\r\n\r\n.input-label.bg_light:not([type='checkbox']):focus-within {\r\n box-shadow: inset 0 0 0 1.5px #007aff;\r\n}\r\n\r\n.input {\r\n background: transparent;\r\n padding: 0 0.9375rem;\r\n flex: 1;\r\n font-size: 1rem;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n font-weight: 100;\r\n letter-spacing: inherit;\r\n color: inherit;\r\n height: 100%;\r\n border: none;\r\n -webkit-appearance: none;\r\n -moz-appearance: none;\r\n appearance: none;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n width: calc(100% - 0.9375rem * 2);\r\n}\r\n\r\n.input::placeholder {\r\n color: #6e6e73;\r\n}\r\n\r\n.input:focus {\r\n outline: none;\r\n opacity: 1;\r\n}\r\n\r\n.input-label {\r\n border-radius: 0.75rem;\r\n transition: box-shadow 0.15s ease;\r\n}\r\n\r\n.input-label:focus-within {\r\n box-shadow: inset 0 0 0 1.5px #007aff;\r\n}\r\n\r\n.error-message {\r\n color: #e74c3c;\r\n font-size: 0.875rem;\r\n margin-top: 0.25rem;\r\n font-size: 1rem;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n}\r\n\r\n.flex_wrapper {\r\n display: flex;\r\n justify-content: flex-start;\r\n align-items: center;\r\n}\r\n\r\n.label_wrapper {\r\n display: inline-flex;\r\n align-items: center;\r\n border-radius: 0.75rem 0 0 0.75rem;\r\n height: 3.29412rem;\r\n background-color: #0095ae;\r\n}\r\n\r\n.preview_container {\r\n height: 3.29412rem;\r\n display: flex;\r\n align-items: center;\r\n background: rgba(0, 0, 0, 0.04);\r\n border-radius: 0 0.75rem 0.75rem 0;\r\n color: #333;\r\n letter-spacing: 0.0625rem;\r\n font-size: 0.875rem;\r\n width: calc(100% - 3.4375rem);\r\n}\r\n\r\n.prev_wrap {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: calc(100% - 6.25rem);\r\n}\r\n\r\n.preview {\r\n margin: 0;\r\n border: none;\r\n}\r\n\r\n.input[type='file'] {\r\n position: absolute;\r\n width: 0.0625rem;\r\n height: 0.0625rem;\r\n padding: 0;\r\n margin: -0.0625rem;\r\n overflow: hidden;\r\n clip: rect(0, 0, 0, 0);\r\n border: 0;\r\n}\r\n\r\n.input-label {\r\n cursor: pointer;\r\n}\r\n\r\n.input-label-upload {\r\n cursor: pointer;\r\n width: 6.25rem;\r\n color: #fff;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n height: 3.4375rem;\r\n}\r\n\r\n.input-label:hover {\r\n background-color: rgba(0, 0, 0, 0.1);\r\n}\r\n\r\n.input-wrapper {\r\n position: relative;\r\n display: flex;\r\n align-items: center;\r\n width: 100%;\r\n padding: 0 0.9375rem;\r\n}\r\n\r\n.input-icon {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n pointer-events: none;\r\n}\r\n\r\n.input.with-icon {\r\n padding-left: 2.5rem;\r\n}\r\n.no_icon {\r\n width: 100%;\r\n}\r\n\r\n.sr-only {\r\n position: absolute;\r\n width: 1px;\r\n height: 1px;\r\n padding: 0;\r\n margin: -1px;\r\n overflow: hidden;\r\n clip: rect(0, 0, 0, 0);\r\n white-space: nowrap;\r\n border: 0;\r\n}\r\n\r\ninput[type='number']::-webkit-outer-spin-button,\r\ninput[type='number']::-webkit-inner-spin-button {\r\n -webkit-appearance: none;\r\n margin: 0;\r\n}\r\n\r\ninput[type='number'] {\r\n -moz-appearance: textfield;\r\n appearance: textfield;\r\n}\r\n\r\n.password-toggle-btn {\r\n position: absolute;\r\n right: 12px;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n background: none;\r\n border: none;\r\n cursor: pointer;\r\n padding: 4px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n color: inherit;\r\n opacity: 0.6;\r\n transition: opacity 0.2s;\r\n}\r\n\r\n.password-toggle-btn:focus {\r\n outline: none;\r\n}\r\n\r\n.input-wrapper {\r\n position: relative;\r\n}\r\n";
|
|
3
3
|
module.exports = styles;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const styles = ".input-container {\r\n font-family: 'Roboto Condensed', sans-serif;\r\n}\r\n\r\n.input-label:not([type='checkbox']) {\r\n font-size: 0.8125rem;\r\n line-height: 1.85;\r\n letter-spacing: 0.0625rem;\r\n color: #333;\r\n position: relative;\r\n height: 3.29412rem;\r\n display: flex;\r\n min-width: 0;\r\n background: rgba(0, 0, 0, 0.04);\r\n transition:\r\n color 0.15s ease,\r\n box-shadow 0.15s ease,\r\n background 0.15s ease;\r\n}\r\n\r\n.input-label.bg_light:not([type='checkbox']) {\r\n background: white;\r\n box-shadow: inset 0 0 0 1px #86868b;\r\n}\r\n\r\n.input-label.bg_light:not([type='checkbox']):focus-within {\r\n box-shadow: inset 0 0 0 1.5px #007aff;\r\n}\r\n\r\n.input {\r\n background: transparent;\r\n padding: 0 0.9375rem;\r\n flex: 1;\r\n font-size: 1rem;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n font-weight: 100;\r\n letter-spacing: inherit;\r\n color: inherit;\r\n height: 100%;\r\n border: none;\r\n -webkit-appearance: none;\r\n -moz-appearance: none;\r\n appearance: none;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n width: calc(100% - 0.9375rem * 2);\r\n}\r\n\r\n.input::placeholder {\r\n color: #6e6e73;\r\n}\r\n\r\n.input:focus {\r\n outline: none;\r\n opacity: 1;\r\n}\r\n\r\n.input-label {\r\n border-radius: 0.75rem;\r\n transition: box-shadow 0.15s ease;\r\n}\r\n\r\n.input-label:focus-within {\r\n box-shadow: inset 0 0 0 1.5px #007aff;\r\n}\r\n\r\n.error-message {\r\n color: #e74c3c;\r\n font-size: 0.875rem;\r\n margin-top: 0.25rem;\r\n font-size: 1rem;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n}\r\n\r\n.flex_wrapper {\r\n display: flex;\r\n justify-content: flex-start;\r\n align-items: center;\r\n}\r\n\r\n.label_wrapper {\r\n display: inline-flex;\r\n align-items: center;\r\n border-radius: 0.75rem 0 0 0.75rem;\r\n height: 3.29412rem;\r\n background-color: #0095ae;\r\n}\r\n\r\n.preview_container {\r\n height: 3.29412rem;\r\n display: flex;\r\n align-items: center;\r\n background: rgba(0, 0, 0, 0.04);\r\n border-radius: 0 0.75rem 0.75rem 0;\r\n color: #333;\r\n letter-spacing: 0.0625rem;\r\n font-size: 0.875rem;\r\n width: calc(100% - 3.4375rem);\r\n}\r\n\r\n.prev_wrap {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: calc(100% - 6.25rem);\r\n}\r\n\r\n.preview {\r\n margin: 0;\r\n border: none;\r\n}\r\n\r\n.input[type='file'] {\r\n position: absolute;\r\n width: 0.0625rem;\r\n height: 0.0625rem;\r\n padding: 0;\r\n margin: -0.0625rem;\r\n overflow: hidden;\r\n clip: rect(0, 0, 0, 0);\r\n border: 0;\r\n}\r\n\r\n.input-label {\r\n cursor: pointer;\r\n}\r\n\r\n.input-label-upload {\r\n cursor: pointer;\r\n width: 6.25rem;\r\n color: #fff;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n height: 3.4375rem;\r\n}\r\n\r\n.input-label:hover {\r\n background-color: rgba(0, 0, 0, 0.1);\r\n}\r\n\r\n.input-wrapper {\r\n position: relative;\r\n display: flex;\r\n align-items: center;\r\n width: 100%;\r\n padding: 0 0.9375rem;\r\n}\r\n\r\n.input-icon {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n pointer-events: none;\r\n}\r\n\r\n.input.with-icon {\r\n padding-left: 2.5rem;\r\n}\r\n.no_icon {\r\n width: 100%;\r\n}\r\n\r\n.sr-only {\r\n position: absolute;\r\n width: 1px;\r\n height: 1px;\r\n padding: 0;\r\n margin: -1px;\r\n overflow: hidden;\r\n clip: rect(0, 0, 0, 0);\r\n white-space: nowrap;\r\n border: 0;\r\n}\r\n\r\ninput[type='number']::-webkit-outer-spin-button,\r\ninput[type='number']::-webkit-inner-spin-button {\r\n -webkit-appearance: none;\r\n margin: 0;\r\n}\r\n\r\ninput[type='number'] {\r\n -moz-appearance: textfield;\r\n appearance: textfield;\r\n}\r\n";
|
|
1
|
+
const styles = ".input-container {\r\n font-family: 'Roboto Condensed', sans-serif;\r\n}\r\n\r\n.input-label:not([type='checkbox']) {\r\n font-size: 0.8125rem;\r\n line-height: 1.85;\r\n letter-spacing: 0.0625rem;\r\n color: #333;\r\n position: relative;\r\n height: 3.29412rem;\r\n display: flex;\r\n min-width: 0;\r\n background: rgba(0, 0, 0, 0.04);\r\n transition:\r\n color 0.15s ease,\r\n box-shadow 0.15s ease,\r\n background 0.15s ease;\r\n}\r\n\r\n.input-label.bg_light:not([type='checkbox']) {\r\n background: white;\r\n box-shadow: inset 0 0 0 1px #86868b;\r\n}\r\n\r\n.input-label.bg_light:not([type='checkbox']):focus-within {\r\n box-shadow: inset 0 0 0 1.5px #007aff;\r\n}\r\n\r\n.input {\r\n background: transparent;\r\n padding: 0 0.9375rem;\r\n flex: 1;\r\n font-size: 1rem;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n font-weight: 100;\r\n letter-spacing: inherit;\r\n color: inherit;\r\n height: 100%;\r\n border: none;\r\n -webkit-appearance: none;\r\n -moz-appearance: none;\r\n appearance: none;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n width: calc(100% - 0.9375rem * 2);\r\n}\r\n\r\n.input::placeholder {\r\n color: #6e6e73;\r\n}\r\n\r\n.input:focus {\r\n outline: none;\r\n opacity: 1;\r\n}\r\n\r\n.input-label {\r\n border-radius: 0.75rem;\r\n transition: box-shadow 0.15s ease;\r\n}\r\n\r\n.input-label:focus-within {\r\n box-shadow: inset 0 0 0 1.5px #007aff;\r\n}\r\n\r\n.error-message {\r\n color: #e74c3c;\r\n font-size: 0.875rem;\r\n margin-top: 0.25rem;\r\n font-size: 1rem;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n}\r\n\r\n.flex_wrapper {\r\n display: flex;\r\n justify-content: flex-start;\r\n align-items: center;\r\n}\r\n\r\n.label_wrapper {\r\n display: inline-flex;\r\n align-items: center;\r\n border-radius: 0.75rem 0 0 0.75rem;\r\n height: 3.29412rem;\r\n background-color: #0095ae;\r\n}\r\n\r\n.preview_container {\r\n height: 3.29412rem;\r\n display: flex;\r\n align-items: center;\r\n background: rgba(0, 0, 0, 0.04);\r\n border-radius: 0 0.75rem 0.75rem 0;\r\n color: #333;\r\n letter-spacing: 0.0625rem;\r\n font-size: 0.875rem;\r\n width: calc(100% - 3.4375rem);\r\n}\r\n\r\n.prev_wrap {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: calc(100% - 6.25rem);\r\n}\r\n\r\n.preview {\r\n margin: 0;\r\n border: none;\r\n}\r\n\r\n.input[type='file'] {\r\n position: absolute;\r\n width: 0.0625rem;\r\n height: 0.0625rem;\r\n padding: 0;\r\n margin: -0.0625rem;\r\n overflow: hidden;\r\n clip: rect(0, 0, 0, 0);\r\n border: 0;\r\n}\r\n\r\n.input-label {\r\n cursor: pointer;\r\n}\r\n\r\n.input-label-upload {\r\n cursor: pointer;\r\n width: 6.25rem;\r\n color: #fff;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n height: 3.4375rem;\r\n}\r\n\r\n.input-label:hover {\r\n background-color: rgba(0, 0, 0, 0.1);\r\n}\r\n\r\n.input-wrapper {\r\n position: relative;\r\n display: flex;\r\n align-items: center;\r\n width: 100%;\r\n padding: 0 0.9375rem;\r\n}\r\n\r\n.input-icon {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n pointer-events: none;\r\n}\r\n\r\n.input.with-icon {\r\n padding-left: 2.5rem;\r\n}\r\n.no_icon {\r\n width: 100%;\r\n}\r\n\r\n.sr-only {\r\n position: absolute;\r\n width: 1px;\r\n height: 1px;\r\n padding: 0;\r\n margin: -1px;\r\n overflow: hidden;\r\n clip: rect(0, 0, 0, 0);\r\n white-space: nowrap;\r\n border: 0;\r\n}\r\n\r\ninput[type='number']::-webkit-outer-spin-button,\r\ninput[type='number']::-webkit-inner-spin-button {\r\n -webkit-appearance: none;\r\n margin: 0;\r\n}\r\n\r\ninput[type='number'] {\r\n -moz-appearance: textfield;\r\n appearance: textfield;\r\n}\r\n\r\n.password-toggle-btn {\r\n position: absolute;\r\n right: 12px;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n background: none;\r\n border: none;\r\n cursor: pointer;\r\n padding: 4px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n color: inherit;\r\n opacity: 0.6;\r\n transition: opacity 0.2s;\r\n}\r\n\r\n.password-toggle-btn:focus {\r\n outline: none;\r\n}\r\n\r\n.input-wrapper {\r\n position: relative;\r\n}\r\n";
|
|
2
2
|
export {
|
|
3
3
|
styles as default
|
|
4
4
|
};
|
|
@@ -23,6 +23,10 @@ export interface InputProps {
|
|
|
23
23
|
label?: string;
|
|
24
24
|
selectedValue?: Signal<string>;
|
|
25
25
|
autocomplete?: AutoFill;
|
|
26
|
+
iconPasswordShow?: JSXOutput | Component<unknown>;
|
|
27
|
+
iconPasswordHide?: JSXOutput | Component<unknown>;
|
|
28
|
+
labelShowPassword?: string;
|
|
29
|
+
labelHidePassword?: string;
|
|
26
30
|
}
|
|
27
31
|
export declare const displayLocalImage: QRL<(file: File, imageUrl?: Signal<string>) => void>;
|
|
28
32
|
export declare const uploadImage: QRL<(_event: Event, input: HTMLInputElement, currentFile?: Signal<any>, selectedFile?: Signal<string>, imageUrl?: Signal<string>) => Promise<void>>;
|
|
@@ -9,3 +9,7 @@ export declare const InputWithIcon: Story;
|
|
|
9
9
|
export declare const PhoneInput: Story;
|
|
10
10
|
export declare const FileUpload: Story;
|
|
11
11
|
export declare const InputNumber: Story;
|
|
12
|
+
export declare const PasswordWithToggle: Story;
|
|
13
|
+
export declare const EmailAutocomplete: Story;
|
|
14
|
+
export declare const PasswordAutocomplete: Story;
|
|
15
|
+
export declare const LoginFormComplete: Story;
|