virtual-ui-lib 1.0.24 → 1.0.26
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 +109 -2
- package/dist/index.mjs +106 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -40,7 +40,9 @@ __export(index_exports, {
|
|
|
40
40
|
ImageUploadPreview: () => ImageUploadPreview,
|
|
41
41
|
Loader: () => Loader,
|
|
42
42
|
Navbar: () => Navbar,
|
|
43
|
-
OTPInput: () => OTPInput
|
|
43
|
+
OTPInput: () => OTPInput,
|
|
44
|
+
RatingStars: () => RatingStars,
|
|
45
|
+
UserAvatar: () => UserAvatar
|
|
44
46
|
});
|
|
45
47
|
module.exports = __toCommonJS(index_exports);
|
|
46
48
|
|
|
@@ -721,6 +723,109 @@ var OTPInput = ({
|
|
|
721
723
|
}
|
|
722
724
|
)));
|
|
723
725
|
};
|
|
726
|
+
|
|
727
|
+
// src/components/RatingStars/RatingStars.jsx
|
|
728
|
+
var import_react13 = __toESM(require("react"));
|
|
729
|
+
var RatingStars = ({
|
|
730
|
+
totalStars = 5,
|
|
731
|
+
selectedColor = "#ffc107",
|
|
732
|
+
defaultColor = "#e4e5e9",
|
|
733
|
+
size = "24px",
|
|
734
|
+
onSelect
|
|
735
|
+
}) => {
|
|
736
|
+
const [hovered, setHovered] = (0, import_react13.useState)(0);
|
|
737
|
+
const [selected, setSelected] = (0, import_react13.useState)(0);
|
|
738
|
+
const handleMouseEnter = (index) => {
|
|
739
|
+
setHovered(index + 1);
|
|
740
|
+
};
|
|
741
|
+
const handleMouseLeave = () => {
|
|
742
|
+
setHovered(0);
|
|
743
|
+
};
|
|
744
|
+
const handleClick = (index) => {
|
|
745
|
+
setSelected(index + 1);
|
|
746
|
+
if (onSelect) onSelect(index + 1);
|
|
747
|
+
};
|
|
748
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", { style: { display: "flex", gap: "4px" } }, [...Array(totalStars)].map((_, index) => /* @__PURE__ */ import_react13.default.createElement(
|
|
749
|
+
"svg",
|
|
750
|
+
{
|
|
751
|
+
key: index,
|
|
752
|
+
width: size,
|
|
753
|
+
height: size,
|
|
754
|
+
viewBox: "0 0 24 24",
|
|
755
|
+
fill: "none",
|
|
756
|
+
stroke: index < (hovered || selected) ? selectedColor : defaultColor,
|
|
757
|
+
strokeWidth: "1.5",
|
|
758
|
+
strokeLinecap: "round",
|
|
759
|
+
strokeLinejoin: "round",
|
|
760
|
+
onMouseEnter: () => handleMouseEnter(index),
|
|
761
|
+
onMouseLeave: handleMouseLeave,
|
|
762
|
+
onClick: () => handleClick(index),
|
|
763
|
+
style: { transition: "color 0.2s ease" }
|
|
764
|
+
},
|
|
765
|
+
/* @__PURE__ */ import_react13.default.createElement("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21 12 17.77 5.82 21 7 14.14 2 9.27 8.91 8.26 12 2" })
|
|
766
|
+
)));
|
|
767
|
+
};
|
|
768
|
+
|
|
769
|
+
// src/components/UserAvatar/UserAvatar.jsx
|
|
770
|
+
var import_react14 = __toESM(require("react"));
|
|
771
|
+
var UserAvatar = ({
|
|
772
|
+
size = "50px",
|
|
773
|
+
src = "",
|
|
774
|
+
initials = "AB",
|
|
775
|
+
online = false,
|
|
776
|
+
busy = false,
|
|
777
|
+
showStatus = true,
|
|
778
|
+
bgColor = "#1e293b",
|
|
779
|
+
textColor = "#f1f5f9",
|
|
780
|
+
statusColor = "#22c55e",
|
|
781
|
+
borderColor = "#7c3aed"
|
|
782
|
+
}) => {
|
|
783
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
784
|
+
"div",
|
|
785
|
+
{
|
|
786
|
+
style: {
|
|
787
|
+
position: "relative",
|
|
788
|
+
width: size,
|
|
789
|
+
height: size,
|
|
790
|
+
borderRadius: "50%",
|
|
791
|
+
backgroundColor: bgColor,
|
|
792
|
+
display: "flex",
|
|
793
|
+
alignItems: "center",
|
|
794
|
+
justifyContent: "center",
|
|
795
|
+
transition: "transform 0.2s",
|
|
796
|
+
cursor: "pointer",
|
|
797
|
+
overflow: "hidden",
|
|
798
|
+
boxShadow: "0 4px 14px rgba(0, 0, 0, 0.2)"
|
|
799
|
+
},
|
|
800
|
+
onMouseEnter: (e) => {
|
|
801
|
+
e.currentTarget.style.transform = "scale(1.1)";
|
|
802
|
+
},
|
|
803
|
+
onMouseLeave: (e) => {
|
|
804
|
+
e.currentTarget.style.transform = "scale(1)";
|
|
805
|
+
}
|
|
806
|
+
},
|
|
807
|
+
src ? /* @__PURE__ */ import_react14.default.createElement("img", { src, alt: initials, style: {
|
|
808
|
+
width: "100%",
|
|
809
|
+
height: "100%",
|
|
810
|
+
borderRadius: "50%",
|
|
811
|
+
objectFit: "cover"
|
|
812
|
+
} }) : /* @__PURE__ */ import_react14.default.createElement("span", { style: {
|
|
813
|
+
color: textColor,
|
|
814
|
+
fontSize: "20px",
|
|
815
|
+
fontWeight: "700"
|
|
816
|
+
} }, initials),
|
|
817
|
+
showStatus && /* @__PURE__ */ import_react14.default.createElement("span", { style: {
|
|
818
|
+
position: "absolute",
|
|
819
|
+
bottom: "0",
|
|
820
|
+
right: "0",
|
|
821
|
+
width: "12px",
|
|
822
|
+
height: "12px",
|
|
823
|
+
borderRadius: "50%",
|
|
824
|
+
backgroundColor: busy ? "#fbbf24" : online ? statusColor : "#9ca3af",
|
|
825
|
+
border: "2px solid " + borderColor
|
|
826
|
+
} })
|
|
827
|
+
);
|
|
828
|
+
};
|
|
724
829
|
// Annotate the CommonJS export names for ESM import in node:
|
|
725
830
|
0 && (module.exports = {
|
|
726
831
|
AlertBanner,
|
|
@@ -734,5 +839,7 @@ var OTPInput = ({
|
|
|
734
839
|
ImageUploadPreview,
|
|
735
840
|
Loader,
|
|
736
841
|
Navbar,
|
|
737
|
-
OTPInput
|
|
842
|
+
OTPInput,
|
|
843
|
+
RatingStars,
|
|
844
|
+
UserAvatar
|
|
738
845
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -675,6 +675,109 @@ var OTPInput = ({
|
|
|
675
675
|
}
|
|
676
676
|
)));
|
|
677
677
|
};
|
|
678
|
+
|
|
679
|
+
// src/components/RatingStars/RatingStars.jsx
|
|
680
|
+
import React13, { useState as useState10 } from "react";
|
|
681
|
+
var RatingStars = ({
|
|
682
|
+
totalStars = 5,
|
|
683
|
+
selectedColor = "#ffc107",
|
|
684
|
+
defaultColor = "#e4e5e9",
|
|
685
|
+
size = "24px",
|
|
686
|
+
onSelect
|
|
687
|
+
}) => {
|
|
688
|
+
const [hovered, setHovered] = useState10(0);
|
|
689
|
+
const [selected, setSelected] = useState10(0);
|
|
690
|
+
const handleMouseEnter = (index) => {
|
|
691
|
+
setHovered(index + 1);
|
|
692
|
+
};
|
|
693
|
+
const handleMouseLeave = () => {
|
|
694
|
+
setHovered(0);
|
|
695
|
+
};
|
|
696
|
+
const handleClick = (index) => {
|
|
697
|
+
setSelected(index + 1);
|
|
698
|
+
if (onSelect) onSelect(index + 1);
|
|
699
|
+
};
|
|
700
|
+
return /* @__PURE__ */ React13.createElement("div", { style: { display: "flex", gap: "4px" } }, [...Array(totalStars)].map((_, index) => /* @__PURE__ */ React13.createElement(
|
|
701
|
+
"svg",
|
|
702
|
+
{
|
|
703
|
+
key: index,
|
|
704
|
+
width: size,
|
|
705
|
+
height: size,
|
|
706
|
+
viewBox: "0 0 24 24",
|
|
707
|
+
fill: "none",
|
|
708
|
+
stroke: index < (hovered || selected) ? selectedColor : defaultColor,
|
|
709
|
+
strokeWidth: "1.5",
|
|
710
|
+
strokeLinecap: "round",
|
|
711
|
+
strokeLinejoin: "round",
|
|
712
|
+
onMouseEnter: () => handleMouseEnter(index),
|
|
713
|
+
onMouseLeave: handleMouseLeave,
|
|
714
|
+
onClick: () => handleClick(index),
|
|
715
|
+
style: { transition: "color 0.2s ease" }
|
|
716
|
+
},
|
|
717
|
+
/* @__PURE__ */ React13.createElement("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21 12 17.77 5.82 21 7 14.14 2 9.27 8.91 8.26 12 2" })
|
|
718
|
+
)));
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
// src/components/UserAvatar/UserAvatar.jsx
|
|
722
|
+
import React14 from "react";
|
|
723
|
+
var UserAvatar = ({
|
|
724
|
+
size = "50px",
|
|
725
|
+
src = "",
|
|
726
|
+
initials = "AB",
|
|
727
|
+
online = false,
|
|
728
|
+
busy = false,
|
|
729
|
+
showStatus = true,
|
|
730
|
+
bgColor = "#1e293b",
|
|
731
|
+
textColor = "#f1f5f9",
|
|
732
|
+
statusColor = "#22c55e",
|
|
733
|
+
borderColor = "#7c3aed"
|
|
734
|
+
}) => {
|
|
735
|
+
return /* @__PURE__ */ React14.createElement(
|
|
736
|
+
"div",
|
|
737
|
+
{
|
|
738
|
+
style: {
|
|
739
|
+
position: "relative",
|
|
740
|
+
width: size,
|
|
741
|
+
height: size,
|
|
742
|
+
borderRadius: "50%",
|
|
743
|
+
backgroundColor: bgColor,
|
|
744
|
+
display: "flex",
|
|
745
|
+
alignItems: "center",
|
|
746
|
+
justifyContent: "center",
|
|
747
|
+
transition: "transform 0.2s",
|
|
748
|
+
cursor: "pointer",
|
|
749
|
+
overflow: "hidden",
|
|
750
|
+
boxShadow: "0 4px 14px rgba(0, 0, 0, 0.2)"
|
|
751
|
+
},
|
|
752
|
+
onMouseEnter: (e) => {
|
|
753
|
+
e.currentTarget.style.transform = "scale(1.1)";
|
|
754
|
+
},
|
|
755
|
+
onMouseLeave: (e) => {
|
|
756
|
+
e.currentTarget.style.transform = "scale(1)";
|
|
757
|
+
}
|
|
758
|
+
},
|
|
759
|
+
src ? /* @__PURE__ */ React14.createElement("img", { src, alt: initials, style: {
|
|
760
|
+
width: "100%",
|
|
761
|
+
height: "100%",
|
|
762
|
+
borderRadius: "50%",
|
|
763
|
+
objectFit: "cover"
|
|
764
|
+
} }) : /* @__PURE__ */ React14.createElement("span", { style: {
|
|
765
|
+
color: textColor,
|
|
766
|
+
fontSize: "20px",
|
|
767
|
+
fontWeight: "700"
|
|
768
|
+
} }, initials),
|
|
769
|
+
showStatus && /* @__PURE__ */ React14.createElement("span", { style: {
|
|
770
|
+
position: "absolute",
|
|
771
|
+
bottom: "0",
|
|
772
|
+
right: "0",
|
|
773
|
+
width: "12px",
|
|
774
|
+
height: "12px",
|
|
775
|
+
borderRadius: "50%",
|
|
776
|
+
backgroundColor: busy ? "#fbbf24" : online ? statusColor : "#9ca3af",
|
|
777
|
+
border: "2px solid " + borderColor
|
|
778
|
+
} })
|
|
779
|
+
);
|
|
780
|
+
};
|
|
678
781
|
export {
|
|
679
782
|
AlertBanner,
|
|
680
783
|
Button,
|
|
@@ -687,5 +790,7 @@ export {
|
|
|
687
790
|
ImageUploadPreview,
|
|
688
791
|
Loader,
|
|
689
792
|
Navbar,
|
|
690
|
-
OTPInput
|
|
793
|
+
OTPInput,
|
|
794
|
+
RatingStars,
|
|
795
|
+
UserAvatar
|
|
691
796
|
};
|