virtual-ui-lib 1.0.17 → 1.0.18
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/index.js +45 -2
- package/dist/index.mjs +43 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33,7 +33,8 @@ __export(index_exports, {
|
|
|
33
33
|
Button: () => Button,
|
|
34
34
|
Card: () => Card,
|
|
35
35
|
Dropdown: () => Dropdown,
|
|
36
|
-
EmptyState: () => EmptyState
|
|
36
|
+
EmptyState: () => EmptyState,
|
|
37
|
+
FormInput: () => FormInput
|
|
37
38
|
});
|
|
38
39
|
module.exports = __toCommonJS(index_exports);
|
|
39
40
|
|
|
@@ -318,11 +319,53 @@ var EmptyState = ({
|
|
|
318
319
|
transition: "opacity 0.5s ease-in-out"
|
|
319
320
|
} }, renderModeContent());
|
|
320
321
|
};
|
|
322
|
+
|
|
323
|
+
// src/components/FormInput/FormInput.jsx
|
|
324
|
+
var import_react6 = __toESM(require("react"));
|
|
325
|
+
var FormInput = ({
|
|
326
|
+
label = "Input Label",
|
|
327
|
+
type = "text",
|
|
328
|
+
value = "",
|
|
329
|
+
placeholder = "Enter text...",
|
|
330
|
+
errorMessage = "This field is required.",
|
|
331
|
+
isError = false,
|
|
332
|
+
isSuccess = false,
|
|
333
|
+
isDisabled = false,
|
|
334
|
+
onChange
|
|
335
|
+
}) => {
|
|
336
|
+
const [isFocused, setIsFocused] = (0, import_react6.useState)(false);
|
|
337
|
+
const handleFocus = () => setIsFocused(true);
|
|
338
|
+
const handleBlur = () => setIsFocused(false);
|
|
339
|
+
return /* @__PURE__ */ import_react6.default.createElement("div", { style: { marginBottom: "20px", fontFamily: "system-ui, sans-serif" } }, /* @__PURE__ */ import_react6.default.createElement("label", { style: { display: "block", marginBottom: "8px", fontSize: "14px", color: isError ? "#ef4444" : "#64748b" } }, label), /* @__PURE__ */ import_react6.default.createElement(
|
|
340
|
+
"input",
|
|
341
|
+
{
|
|
342
|
+
type,
|
|
343
|
+
value,
|
|
344
|
+
placeholder,
|
|
345
|
+
onFocus: handleFocus,
|
|
346
|
+
onBlur: handleBlur,
|
|
347
|
+
onChange,
|
|
348
|
+
disabled: isDisabled,
|
|
349
|
+
style: {
|
|
350
|
+
width: "100%",
|
|
351
|
+
padding: "12px 16px",
|
|
352
|
+
border: `2px solid ${isError ? "#ef4444" : isSuccess ? "#22c55e" : isFocused ? "#2563eb" : "#d1d5db"}`,
|
|
353
|
+
borderRadius: "8px",
|
|
354
|
+
boxShadow: isFocused ? "0 4px 14px rgba(37,99,235,0.3)" : "none",
|
|
355
|
+
outline: "none",
|
|
356
|
+
transition: "border-color 0.3s, box-shadow 0.3s",
|
|
357
|
+
fontSize: "16px",
|
|
358
|
+
color: "#0f172a"
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
), isError && /* @__PURE__ */ import_react6.default.createElement("p", { style: { marginTop: "8px", color: "#ef4444", fontSize: "12px", opacity: 0, animation: "fadeIn 0.3s forwards" } }, errorMessage), isSuccess && /* @__PURE__ */ import_react6.default.createElement("p", { style: { marginTop: "8px", color: "#22c55e", fontSize: "12px" } }, "Input is valid!"), /* @__PURE__ */ import_react6.default.createElement("style", null, `@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }`));
|
|
362
|
+
};
|
|
321
363
|
// Annotate the CommonJS export names for ESM import in node:
|
|
322
364
|
0 && (module.exports = {
|
|
323
365
|
AlertBanner,
|
|
324
366
|
Button,
|
|
325
367
|
Card,
|
|
326
368
|
Dropdown,
|
|
327
|
-
EmptyState
|
|
369
|
+
EmptyState,
|
|
370
|
+
FormInput
|
|
328
371
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -279,10 +279,52 @@ var EmptyState = ({
|
|
|
279
279
|
transition: "opacity 0.5s ease-in-out"
|
|
280
280
|
} }, renderModeContent());
|
|
281
281
|
};
|
|
282
|
+
|
|
283
|
+
// src/components/FormInput/FormInput.jsx
|
|
284
|
+
import React6, { useState as useState4 } from "react";
|
|
285
|
+
var FormInput = ({
|
|
286
|
+
label = "Input Label",
|
|
287
|
+
type = "text",
|
|
288
|
+
value = "",
|
|
289
|
+
placeholder = "Enter text...",
|
|
290
|
+
errorMessage = "This field is required.",
|
|
291
|
+
isError = false,
|
|
292
|
+
isSuccess = false,
|
|
293
|
+
isDisabled = false,
|
|
294
|
+
onChange
|
|
295
|
+
}) => {
|
|
296
|
+
const [isFocused, setIsFocused] = useState4(false);
|
|
297
|
+
const handleFocus = () => setIsFocused(true);
|
|
298
|
+
const handleBlur = () => setIsFocused(false);
|
|
299
|
+
return /* @__PURE__ */ React6.createElement("div", { style: { marginBottom: "20px", fontFamily: "system-ui, sans-serif" } }, /* @__PURE__ */ React6.createElement("label", { style: { display: "block", marginBottom: "8px", fontSize: "14px", color: isError ? "#ef4444" : "#64748b" } }, label), /* @__PURE__ */ React6.createElement(
|
|
300
|
+
"input",
|
|
301
|
+
{
|
|
302
|
+
type,
|
|
303
|
+
value,
|
|
304
|
+
placeholder,
|
|
305
|
+
onFocus: handleFocus,
|
|
306
|
+
onBlur: handleBlur,
|
|
307
|
+
onChange,
|
|
308
|
+
disabled: isDisabled,
|
|
309
|
+
style: {
|
|
310
|
+
width: "100%",
|
|
311
|
+
padding: "12px 16px",
|
|
312
|
+
border: `2px solid ${isError ? "#ef4444" : isSuccess ? "#22c55e" : isFocused ? "#2563eb" : "#d1d5db"}`,
|
|
313
|
+
borderRadius: "8px",
|
|
314
|
+
boxShadow: isFocused ? "0 4px 14px rgba(37,99,235,0.3)" : "none",
|
|
315
|
+
outline: "none",
|
|
316
|
+
transition: "border-color 0.3s, box-shadow 0.3s",
|
|
317
|
+
fontSize: "16px",
|
|
318
|
+
color: "#0f172a"
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
), isError && /* @__PURE__ */ React6.createElement("p", { style: { marginTop: "8px", color: "#ef4444", fontSize: "12px", opacity: 0, animation: "fadeIn 0.3s forwards" } }, errorMessage), isSuccess && /* @__PURE__ */ React6.createElement("p", { style: { marginTop: "8px", color: "#22c55e", fontSize: "12px" } }, "Input is valid!"), /* @__PURE__ */ React6.createElement("style", null, `@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }`));
|
|
322
|
+
};
|
|
282
323
|
export {
|
|
283
324
|
AlertBanner,
|
|
284
325
|
Button,
|
|
285
326
|
Card,
|
|
286
327
|
Dropdown,
|
|
287
|
-
EmptyState
|
|
328
|
+
EmptyState,
|
|
329
|
+
FormInput
|
|
288
330
|
};
|