virtual-ui-lib 1.0.43 → 1.0.45
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 +86 -0
- package/dist/index.mjs +84 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,7 +31,9 @@ var index_exports = {};
|
|
|
31
31
|
__export(index_exports, {
|
|
32
32
|
CodeBlock: () => CodeBlock,
|
|
33
33
|
CustomInputField: () => CustomInputField,
|
|
34
|
+
LoadingSpinner: () => LoadingSpinner,
|
|
34
35
|
OtpInput: () => OtpInput,
|
|
36
|
+
SearchBar: () => SearchBar,
|
|
35
37
|
SmartButton: () => SmartButton,
|
|
36
38
|
StatCard: () => StatCard,
|
|
37
39
|
TextArea: () => TextArea,
|
|
@@ -390,11 +392,95 @@ var TextArea = ({
|
|
|
390
392
|
}
|
|
391
393
|
), /* @__PURE__ */ import_react7.default.createElement("div", { style: { color: textColor, marginTop: "8px" } }, currentValue.length, "/", maxLength));
|
|
392
394
|
};
|
|
395
|
+
|
|
396
|
+
// src/components/SearchBar/SearchBar.jsx
|
|
397
|
+
var import_react8 = __toESM(require("react"));
|
|
398
|
+
var SearchBar = ({
|
|
399
|
+
placeholder = "Search...",
|
|
400
|
+
bg = "#1e293b",
|
|
401
|
+
textColor = "#f1f5f9",
|
|
402
|
+
accent = "#7c3aed",
|
|
403
|
+
loading = false,
|
|
404
|
+
suggestions = [],
|
|
405
|
+
onChange = () => {
|
|
406
|
+
},
|
|
407
|
+
onClear = () => {
|
|
408
|
+
}
|
|
409
|
+
}) => {
|
|
410
|
+
const [query, setQuery] = (0, import_react8.useState)("");
|
|
411
|
+
const handleInputChange = (e) => {
|
|
412
|
+
setQuery(e.target.value);
|
|
413
|
+
onChange(e.target.value);
|
|
414
|
+
};
|
|
415
|
+
const handleClear = () => {
|
|
416
|
+
setQuery("");
|
|
417
|
+
onClear();
|
|
418
|
+
};
|
|
419
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { style: { position: "relative", width: "100%" } }, /* @__PURE__ */ import_react8.default.createElement(
|
|
420
|
+
"input",
|
|
421
|
+
{
|
|
422
|
+
value: query,
|
|
423
|
+
placeholder,
|
|
424
|
+
onChange: handleInputChange,
|
|
425
|
+
style: {
|
|
426
|
+
background: bg,
|
|
427
|
+
color: textColor,
|
|
428
|
+
padding: "10px",
|
|
429
|
+
borderRadius: "8px",
|
|
430
|
+
border: "1px solid #cbd5e1",
|
|
431
|
+
width: "100%",
|
|
432
|
+
transition: "border-color 0.3s",
|
|
433
|
+
outline: "none"
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
), query && /* @__PURE__ */ import_react8.default.createElement("button", { onClick: handleClear, style: {
|
|
437
|
+
position: "absolute",
|
|
438
|
+
right: "10px",
|
|
439
|
+
top: "50%",
|
|
440
|
+
transform: "translateY(-50%)",
|
|
441
|
+
background: "transparent",
|
|
442
|
+
color: accent,
|
|
443
|
+
border: "none",
|
|
444
|
+
cursor: "pointer"
|
|
445
|
+
} }, "Clear"), loading && /* @__PURE__ */ import_react8.default.createElement("div", { style: {
|
|
446
|
+
position: "absolute",
|
|
447
|
+
left: "10px",
|
|
448
|
+
top: "50%",
|
|
449
|
+
transform: "translateY(-50%)"
|
|
450
|
+
} }, "Loading..."), suggestions.length > 0 && !loading && /* @__PURE__ */ import_react8.default.createElement("ul", { style: {
|
|
451
|
+
listStyleType: "none",
|
|
452
|
+
margin: 0,
|
|
453
|
+
padding: "10px",
|
|
454
|
+
background: bg,
|
|
455
|
+
borderRadius: "8px",
|
|
456
|
+
position: "absolute",
|
|
457
|
+
zIndex: 1e3,
|
|
458
|
+
width: "100%",
|
|
459
|
+
maxHeight: "200px",
|
|
460
|
+
overflowY: "auto"
|
|
461
|
+
} }, suggestions.map((suggestion, index) => /* @__PURE__ */ import_react8.default.createElement("li", { key: index, style: {
|
|
462
|
+
padding: "8px",
|
|
463
|
+
color: textColor,
|
|
464
|
+
cursor: "pointer",
|
|
465
|
+
transition: "background 0.2s"
|
|
466
|
+
}, onClick: () => {
|
|
467
|
+
setQuery(suggestion);
|
|
468
|
+
onChange(suggestion);
|
|
469
|
+
} }, suggestion))));
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
// src/components/LoadingSpinner/LoadingSpinner.jsx
|
|
473
|
+
var import_react9 = __toESM(require("react"));
|
|
474
|
+
var LoadingSpinner = ({ size = "40px", color = "#7c3aed", speed = "1s" }) => {
|
|
475
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", { style: { border: `4px solid ${color}`, borderTop: `4px solid transparent`, borderRadius: "50%", width: size, height: size, animation: `spin ${speed} linear infinite` } });
|
|
476
|
+
};
|
|
393
477
|
// Annotate the CommonJS export names for ESM import in node:
|
|
394
478
|
0 && (module.exports = {
|
|
395
479
|
CodeBlock,
|
|
396
480
|
CustomInputField,
|
|
481
|
+
LoadingSpinner,
|
|
397
482
|
OtpInput,
|
|
483
|
+
SearchBar,
|
|
398
484
|
SmartButton,
|
|
399
485
|
StatCard,
|
|
400
486
|
TextArea,
|
package/dist/index.mjs
CHANGED
|
@@ -349,10 +349,94 @@ var TextArea = ({
|
|
|
349
349
|
}
|
|
350
350
|
), /* @__PURE__ */ React7.createElement("div", { style: { color: textColor, marginTop: "8px" } }, currentValue.length, "/", maxLength));
|
|
351
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
|
+
};
|
|
428
|
+
|
|
429
|
+
// src/components/LoadingSpinner/LoadingSpinner.jsx
|
|
430
|
+
import React9 from "react";
|
|
431
|
+
var LoadingSpinner = ({ size = "40px", color = "#7c3aed", speed = "1s" }) => {
|
|
432
|
+
return /* @__PURE__ */ React9.createElement("div", { style: { border: `4px solid ${color}`, borderTop: `4px solid transparent`, borderRadius: "50%", width: size, height: size, animation: `spin ${speed} linear infinite` } });
|
|
433
|
+
};
|
|
352
434
|
export {
|
|
353
435
|
CodeBlock,
|
|
354
436
|
CustomInputField,
|
|
437
|
+
LoadingSpinner,
|
|
355
438
|
OtpInput,
|
|
439
|
+
SearchBar,
|
|
356
440
|
SmartButton,
|
|
357
441
|
StatCard,
|
|
358
442
|
TextArea,
|