virtual-ui-lib 1.0.42 → 1.0.44
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 +122 -0
- package/dist/index.mjs +120 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -32,8 +32,10 @@ __export(index_exports, {
|
|
|
32
32
|
CodeBlock: () => CodeBlock,
|
|
33
33
|
CustomInputField: () => CustomInputField,
|
|
34
34
|
OtpInput: () => OtpInput,
|
|
35
|
+
SearchBar: () => SearchBar,
|
|
35
36
|
SmartButton: () => SmartButton,
|
|
36
37
|
StatCard: () => StatCard,
|
|
38
|
+
TextArea: () => TextArea,
|
|
37
39
|
ToastNotification: () => ToastNotification
|
|
38
40
|
});
|
|
39
41
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -347,12 +349,132 @@ var CustomInputField = ({
|
|
|
347
349
|
}
|
|
348
350
|
), errorMessage && /* @__PURE__ */ import_react6.default.createElement("p", { style: { color: "red", margin: "4px 0 0 0" } }, errorMessage), helperText && /* @__PURE__ */ import_react6.default.createElement("p", { style: { color: textColor, margin: "4px 0 0 0" } }, helperText));
|
|
349
351
|
};
|
|
352
|
+
|
|
353
|
+
// src/components/TextArea/TextArea.jsx
|
|
354
|
+
var import_react7 = __toESM(require("react"));
|
|
355
|
+
var TextArea = ({
|
|
356
|
+
label = "Label",
|
|
357
|
+
placeholder = "Type here...",
|
|
358
|
+
value = "",
|
|
359
|
+
bg = "#1e293b",
|
|
360
|
+
textColor = "#f1f5f9",
|
|
361
|
+
accent = "#2563eb",
|
|
362
|
+
radius = "8px",
|
|
363
|
+
padding = "12px",
|
|
364
|
+
maxLength = 250,
|
|
365
|
+
onChange = () => {
|
|
366
|
+
}
|
|
367
|
+
}) => {
|
|
368
|
+
const [currentValue, setCurrentValue] = (0, import_react7.useState)(value);
|
|
369
|
+
const handleChange = (e) => {
|
|
370
|
+
setCurrentValue(e.target.value);
|
|
371
|
+
onChange(e.target.value);
|
|
372
|
+
};
|
|
373
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", { style: { margin: "16px 0" } }, /* @__PURE__ */ import_react7.default.createElement("label", { style: { color: textColor, marginBottom: "8px", display: "block" } }, label), /* @__PURE__ */ import_react7.default.createElement(
|
|
374
|
+
"textarea",
|
|
375
|
+
{
|
|
376
|
+
value: currentValue,
|
|
377
|
+
placeholder,
|
|
378
|
+
maxLength,
|
|
379
|
+
onChange: handleChange,
|
|
380
|
+
style: {
|
|
381
|
+
background: bg,
|
|
382
|
+
color: textColor,
|
|
383
|
+
padding,
|
|
384
|
+
borderRadius: radius,
|
|
385
|
+
border: `1px solid ${accent}`,
|
|
386
|
+
width: "100%",
|
|
387
|
+
minHeight: "100px",
|
|
388
|
+
resize: "none",
|
|
389
|
+
transition: "border-color 0.3s"
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
), /* @__PURE__ */ import_react7.default.createElement("div", { style: { color: textColor, marginTop: "8px" } }, currentValue.length, "/", maxLength));
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
// src/components/SearchBar/SearchBar.jsx
|
|
396
|
+
var import_react8 = __toESM(require("react"));
|
|
397
|
+
var SearchBar = ({
|
|
398
|
+
placeholder = "Search...",
|
|
399
|
+
bg = "#1e293b",
|
|
400
|
+
textColor = "#f1f5f9",
|
|
401
|
+
accent = "#7c3aed",
|
|
402
|
+
loading = false,
|
|
403
|
+
suggestions = [],
|
|
404
|
+
onChange = () => {
|
|
405
|
+
},
|
|
406
|
+
onClear = () => {
|
|
407
|
+
}
|
|
408
|
+
}) => {
|
|
409
|
+
const [query, setQuery] = (0, import_react8.useState)("");
|
|
410
|
+
const handleInputChange = (e) => {
|
|
411
|
+
setQuery(e.target.value);
|
|
412
|
+
onChange(e.target.value);
|
|
413
|
+
};
|
|
414
|
+
const handleClear = () => {
|
|
415
|
+
setQuery("");
|
|
416
|
+
onClear();
|
|
417
|
+
};
|
|
418
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { style: { position: "relative", width: "100%" } }, /* @__PURE__ */ import_react8.default.createElement(
|
|
419
|
+
"input",
|
|
420
|
+
{
|
|
421
|
+
value: query,
|
|
422
|
+
placeholder,
|
|
423
|
+
onChange: handleInputChange,
|
|
424
|
+
style: {
|
|
425
|
+
background: bg,
|
|
426
|
+
color: textColor,
|
|
427
|
+
padding: "10px",
|
|
428
|
+
borderRadius: "8px",
|
|
429
|
+
border: "1px solid #cbd5e1",
|
|
430
|
+
width: "100%",
|
|
431
|
+
transition: "border-color 0.3s",
|
|
432
|
+
outline: "none"
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
), query && /* @__PURE__ */ import_react8.default.createElement("button", { onClick: handleClear, style: {
|
|
436
|
+
position: "absolute",
|
|
437
|
+
right: "10px",
|
|
438
|
+
top: "50%",
|
|
439
|
+
transform: "translateY(-50%)",
|
|
440
|
+
background: "transparent",
|
|
441
|
+
color: accent,
|
|
442
|
+
border: "none",
|
|
443
|
+
cursor: "pointer"
|
|
444
|
+
} }, "Clear"), loading && /* @__PURE__ */ import_react8.default.createElement("div", { style: {
|
|
445
|
+
position: "absolute",
|
|
446
|
+
left: "10px",
|
|
447
|
+
top: "50%",
|
|
448
|
+
transform: "translateY(-50%)"
|
|
449
|
+
} }, "Loading..."), suggestions.length > 0 && !loading && /* @__PURE__ */ import_react8.default.createElement("ul", { style: {
|
|
450
|
+
listStyleType: "none",
|
|
451
|
+
margin: 0,
|
|
452
|
+
padding: "10px",
|
|
453
|
+
background: bg,
|
|
454
|
+
borderRadius: "8px",
|
|
455
|
+
position: "absolute",
|
|
456
|
+
zIndex: 1e3,
|
|
457
|
+
width: "100%",
|
|
458
|
+
maxHeight: "200px",
|
|
459
|
+
overflowY: "auto"
|
|
460
|
+
} }, suggestions.map((suggestion, index) => /* @__PURE__ */ import_react8.default.createElement("li", { key: index, style: {
|
|
461
|
+
padding: "8px",
|
|
462
|
+
color: textColor,
|
|
463
|
+
cursor: "pointer",
|
|
464
|
+
transition: "background 0.2s"
|
|
465
|
+
}, onClick: () => {
|
|
466
|
+
setQuery(suggestion);
|
|
467
|
+
onChange(suggestion);
|
|
468
|
+
} }, suggestion))));
|
|
469
|
+
};
|
|
350
470
|
// Annotate the CommonJS export names for ESM import in node:
|
|
351
471
|
0 && (module.exports = {
|
|
352
472
|
CodeBlock,
|
|
353
473
|
CustomInputField,
|
|
354
474
|
OtpInput,
|
|
475
|
+
SearchBar,
|
|
355
476
|
SmartButton,
|
|
356
477
|
StatCard,
|
|
478
|
+
TextArea,
|
|
357
479
|
ToastNotification
|
|
358
480
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -307,11 +307,131 @@ var CustomInputField = ({
|
|
|
307
307
|
}
|
|
308
308
|
), errorMessage && /* @__PURE__ */ React6.createElement("p", { style: { color: "red", margin: "4px 0 0 0" } }, errorMessage), helperText && /* @__PURE__ */ React6.createElement("p", { style: { color: textColor, margin: "4px 0 0 0" } }, helperText));
|
|
309
309
|
};
|
|
310
|
+
|
|
311
|
+
// src/components/TextArea/TextArea.jsx
|
|
312
|
+
import React7, { useState as useState6 } from "react";
|
|
313
|
+
var TextArea = ({
|
|
314
|
+
label = "Label",
|
|
315
|
+
placeholder = "Type here...",
|
|
316
|
+
value = "",
|
|
317
|
+
bg = "#1e293b",
|
|
318
|
+
textColor = "#f1f5f9",
|
|
319
|
+
accent = "#2563eb",
|
|
320
|
+
radius = "8px",
|
|
321
|
+
padding = "12px",
|
|
322
|
+
maxLength = 250,
|
|
323
|
+
onChange = () => {
|
|
324
|
+
}
|
|
325
|
+
}) => {
|
|
326
|
+
const [currentValue, setCurrentValue] = useState6(value);
|
|
327
|
+
const handleChange = (e) => {
|
|
328
|
+
setCurrentValue(e.target.value);
|
|
329
|
+
onChange(e.target.value);
|
|
330
|
+
};
|
|
331
|
+
return /* @__PURE__ */ React7.createElement("div", { style: { margin: "16px 0" } }, /* @__PURE__ */ React7.createElement("label", { style: { color: textColor, marginBottom: "8px", display: "block" } }, label), /* @__PURE__ */ React7.createElement(
|
|
332
|
+
"textarea",
|
|
333
|
+
{
|
|
334
|
+
value: currentValue,
|
|
335
|
+
placeholder,
|
|
336
|
+
maxLength,
|
|
337
|
+
onChange: handleChange,
|
|
338
|
+
style: {
|
|
339
|
+
background: bg,
|
|
340
|
+
color: textColor,
|
|
341
|
+
padding,
|
|
342
|
+
borderRadius: radius,
|
|
343
|
+
border: `1px solid ${accent}`,
|
|
344
|
+
width: "100%",
|
|
345
|
+
minHeight: "100px",
|
|
346
|
+
resize: "none",
|
|
347
|
+
transition: "border-color 0.3s"
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
), /* @__PURE__ */ React7.createElement("div", { style: { color: textColor, marginTop: "8px" } }, currentValue.length, "/", maxLength));
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
// src/components/SearchBar/SearchBar.jsx
|
|
354
|
+
import React8, { useState as useState7 } from "react";
|
|
355
|
+
var SearchBar = ({
|
|
356
|
+
placeholder = "Search...",
|
|
357
|
+
bg = "#1e293b",
|
|
358
|
+
textColor = "#f1f5f9",
|
|
359
|
+
accent = "#7c3aed",
|
|
360
|
+
loading = false,
|
|
361
|
+
suggestions = [],
|
|
362
|
+
onChange = () => {
|
|
363
|
+
},
|
|
364
|
+
onClear = () => {
|
|
365
|
+
}
|
|
366
|
+
}) => {
|
|
367
|
+
const [query, setQuery] = useState7("");
|
|
368
|
+
const handleInputChange = (e) => {
|
|
369
|
+
setQuery(e.target.value);
|
|
370
|
+
onChange(e.target.value);
|
|
371
|
+
};
|
|
372
|
+
const handleClear = () => {
|
|
373
|
+
setQuery("");
|
|
374
|
+
onClear();
|
|
375
|
+
};
|
|
376
|
+
return /* @__PURE__ */ React8.createElement("div", { style: { position: "relative", width: "100%" } }, /* @__PURE__ */ React8.createElement(
|
|
377
|
+
"input",
|
|
378
|
+
{
|
|
379
|
+
value: query,
|
|
380
|
+
placeholder,
|
|
381
|
+
onChange: handleInputChange,
|
|
382
|
+
style: {
|
|
383
|
+
background: bg,
|
|
384
|
+
color: textColor,
|
|
385
|
+
padding: "10px",
|
|
386
|
+
borderRadius: "8px",
|
|
387
|
+
border: "1px solid #cbd5e1",
|
|
388
|
+
width: "100%",
|
|
389
|
+
transition: "border-color 0.3s",
|
|
390
|
+
outline: "none"
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
), query && /* @__PURE__ */ React8.createElement("button", { onClick: handleClear, style: {
|
|
394
|
+
position: "absolute",
|
|
395
|
+
right: "10px",
|
|
396
|
+
top: "50%",
|
|
397
|
+
transform: "translateY(-50%)",
|
|
398
|
+
background: "transparent",
|
|
399
|
+
color: accent,
|
|
400
|
+
border: "none",
|
|
401
|
+
cursor: "pointer"
|
|
402
|
+
} }, "Clear"), loading && /* @__PURE__ */ React8.createElement("div", { style: {
|
|
403
|
+
position: "absolute",
|
|
404
|
+
left: "10px",
|
|
405
|
+
top: "50%",
|
|
406
|
+
transform: "translateY(-50%)"
|
|
407
|
+
} }, "Loading..."), suggestions.length > 0 && !loading && /* @__PURE__ */ React8.createElement("ul", { style: {
|
|
408
|
+
listStyleType: "none",
|
|
409
|
+
margin: 0,
|
|
410
|
+
padding: "10px",
|
|
411
|
+
background: bg,
|
|
412
|
+
borderRadius: "8px",
|
|
413
|
+
position: "absolute",
|
|
414
|
+
zIndex: 1e3,
|
|
415
|
+
width: "100%",
|
|
416
|
+
maxHeight: "200px",
|
|
417
|
+
overflowY: "auto"
|
|
418
|
+
} }, suggestions.map((suggestion, index) => /* @__PURE__ */ React8.createElement("li", { key: index, style: {
|
|
419
|
+
padding: "8px",
|
|
420
|
+
color: textColor,
|
|
421
|
+
cursor: "pointer",
|
|
422
|
+
transition: "background 0.2s"
|
|
423
|
+
}, onClick: () => {
|
|
424
|
+
setQuery(suggestion);
|
|
425
|
+
onChange(suggestion);
|
|
426
|
+
} }, suggestion))));
|
|
427
|
+
};
|
|
310
428
|
export {
|
|
311
429
|
CodeBlock,
|
|
312
430
|
CustomInputField,
|
|
313
431
|
OtpInput,
|
|
432
|
+
SearchBar,
|
|
314
433
|
SmartButton,
|
|
315
434
|
StatCard,
|
|
435
|
+
TextArea,
|
|
316
436
|
ToastNotification
|
|
317
437
|
};
|