virtual-ui-lib 1.0.27 → 1.0.28
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 +36 -2
- package/dist/index.mjs +34 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -42,7 +42,8 @@ __export(index_exports, {
|
|
|
42
42
|
Navbar: () => Navbar,
|
|
43
43
|
OTPInput: () => OTPInput,
|
|
44
44
|
RatingStars: () => RatingStars,
|
|
45
|
-
UserAvatar: () => UserAvatar
|
|
45
|
+
UserAvatar: () => UserAvatar,
|
|
46
|
+
WishlistButton: () => WishlistButton
|
|
46
47
|
});
|
|
47
48
|
module.exports = __toCommonJS(index_exports);
|
|
48
49
|
|
|
@@ -828,6 +829,38 @@ var Navbar = ({
|
|
|
828
829
|
margin: "15px 0"
|
|
829
830
|
} }, link.name)))));
|
|
830
831
|
};
|
|
832
|
+
|
|
833
|
+
// src/components/WishlistButton/WishlistButton.jsx
|
|
834
|
+
var import_react15 = __toESM(require("react"));
|
|
835
|
+
var WishlistButton = ({
|
|
836
|
+
isActive = false,
|
|
837
|
+
size = "40px",
|
|
838
|
+
inactiveColor = "#d1d5db",
|
|
839
|
+
activeColor = "#ff3e30",
|
|
840
|
+
onToggle
|
|
841
|
+
}) => {
|
|
842
|
+
const [active, setActive] = (0, import_react15.useState)(isActive);
|
|
843
|
+
const handleClick = () => {
|
|
844
|
+
setActive((prev) => !prev);
|
|
845
|
+
if (onToggle) onToggle(!active);
|
|
846
|
+
};
|
|
847
|
+
return /* @__PURE__ */ import_react15.default.createElement("div", { onClick: handleClick, style: { cursor: "pointer", width: size, height: size, display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ import_react15.default.createElement(
|
|
848
|
+
"svg",
|
|
849
|
+
{
|
|
850
|
+
width: "100%",
|
|
851
|
+
height: "100%",
|
|
852
|
+
viewBox: "0 0 24 24",
|
|
853
|
+
fill: "none",
|
|
854
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
855
|
+
style: {
|
|
856
|
+
transition: "transform 0.2s",
|
|
857
|
+
transform: active ? "scale(1.2)" : "scale(1)",
|
|
858
|
+
fill: active ? activeColor : inactiveColor
|
|
859
|
+
}
|
|
860
|
+
},
|
|
861
|
+
/* @__PURE__ */ import_react15.default.createElement("path", { d: "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" })
|
|
862
|
+
));
|
|
863
|
+
};
|
|
831
864
|
// Annotate the CommonJS export names for ESM import in node:
|
|
832
865
|
0 && (module.exports = {
|
|
833
866
|
AlertBanner,
|
|
@@ -843,5 +876,6 @@ var Navbar = ({
|
|
|
843
876
|
Navbar,
|
|
844
877
|
OTPInput,
|
|
845
878
|
RatingStars,
|
|
846
|
-
UserAvatar
|
|
879
|
+
UserAvatar,
|
|
880
|
+
WishlistButton
|
|
847
881
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -780,6 +780,38 @@ var Navbar = ({
|
|
|
780
780
|
margin: "15px 0"
|
|
781
781
|
} }, link.name)))));
|
|
782
782
|
};
|
|
783
|
+
|
|
784
|
+
// src/components/WishlistButton/WishlistButton.jsx
|
|
785
|
+
import React15, { useState as useState11 } from "react";
|
|
786
|
+
var WishlistButton = ({
|
|
787
|
+
isActive = false,
|
|
788
|
+
size = "40px",
|
|
789
|
+
inactiveColor = "#d1d5db",
|
|
790
|
+
activeColor = "#ff3e30",
|
|
791
|
+
onToggle
|
|
792
|
+
}) => {
|
|
793
|
+
const [active, setActive] = useState11(isActive);
|
|
794
|
+
const handleClick = () => {
|
|
795
|
+
setActive((prev) => !prev);
|
|
796
|
+
if (onToggle) onToggle(!active);
|
|
797
|
+
};
|
|
798
|
+
return /* @__PURE__ */ React15.createElement("div", { onClick: handleClick, style: { cursor: "pointer", width: size, height: size, display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ React15.createElement(
|
|
799
|
+
"svg",
|
|
800
|
+
{
|
|
801
|
+
width: "100%",
|
|
802
|
+
height: "100%",
|
|
803
|
+
viewBox: "0 0 24 24",
|
|
804
|
+
fill: "none",
|
|
805
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
806
|
+
style: {
|
|
807
|
+
transition: "transform 0.2s",
|
|
808
|
+
transform: active ? "scale(1.2)" : "scale(1)",
|
|
809
|
+
fill: active ? activeColor : inactiveColor
|
|
810
|
+
}
|
|
811
|
+
},
|
|
812
|
+
/* @__PURE__ */ React15.createElement("path", { d: "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" })
|
|
813
|
+
));
|
|
814
|
+
};
|
|
783
815
|
export {
|
|
784
816
|
AlertBanner,
|
|
785
817
|
Button,
|
|
@@ -794,5 +826,6 @@ export {
|
|
|
794
826
|
Navbar,
|
|
795
827
|
OTPInput,
|
|
796
828
|
RatingStars,
|
|
797
|
-
UserAvatar
|
|
829
|
+
UserAvatar,
|
|
830
|
+
WishlistButton
|
|
798
831
|
};
|