virtual-ui-lib 1.0.30 → 1.0.32
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 +98 -0
- package/dist/index.mjs +96 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __export(index_exports, {
|
|
|
34
34
|
Button: () => Button,
|
|
35
35
|
Card: () => Card,
|
|
36
36
|
CopyButton: () => CopyButton,
|
|
37
|
+
DateRangePicker: () => DateRangePicker,
|
|
37
38
|
Dropdown: () => Dropdown,
|
|
38
39
|
EmptyState: () => EmptyState,
|
|
39
40
|
Footer: () => Footer,
|
|
@@ -41,6 +42,7 @@ __export(index_exports, {
|
|
|
41
42
|
GridLayout: () => GridLayout,
|
|
42
43
|
ImageUploadPreview: () => ImageUploadPreview,
|
|
43
44
|
Loader: () => Loader,
|
|
45
|
+
MultiStepProgress: () => MultiStepProgress,
|
|
44
46
|
Navbar: () => Navbar,
|
|
45
47
|
OTPInput: () => OTPInput,
|
|
46
48
|
RatingStars: () => RatingStars,
|
|
@@ -903,6 +905,100 @@ var AnimatedProgressBar = ({
|
|
|
903
905
|
fontWeight: "600"
|
|
904
906
|
} }, percentage, "%"));
|
|
905
907
|
};
|
|
908
|
+
|
|
909
|
+
// src/components/MultiStepProgress/MultiStepProgress.jsx
|
|
910
|
+
var import_react18 = __toESM(require("react"));
|
|
911
|
+
var MultiStepProgress = ({
|
|
912
|
+
steps = ["Step 1", "Step 2", "Step 3"],
|
|
913
|
+
activeStep = 0,
|
|
914
|
+
onStepChange
|
|
915
|
+
}) => {
|
|
916
|
+
const [currentStep, setCurrentStep] = (0, import_react18.useState)(activeStep);
|
|
917
|
+
const handleNext = () => {
|
|
918
|
+
if (currentStep < steps.length - 1) {
|
|
919
|
+
setCurrentStep((prev) => prev + 1);
|
|
920
|
+
if (onStepChange) onStepChange(currentStep + 1);
|
|
921
|
+
}
|
|
922
|
+
};
|
|
923
|
+
const handlePrevious = () => {
|
|
924
|
+
if (currentStep > 0) {
|
|
925
|
+
setCurrentStep((prev) => prev - 1);
|
|
926
|
+
if (onStepChange) onStepChange(currentStep - 1);
|
|
927
|
+
}
|
|
928
|
+
};
|
|
929
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { style: { fontFamily: "system-ui, sans-serif", width: "100%", maxWidth: "700px", margin: "0 auto" } }, /* @__PURE__ */ import_react18.default.createElement("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "16px" } }, steps.map((step, index) => /* @__PURE__ */ import_react18.default.createElement("div", { key: index, style: { flex: 1, textAlign: "center" } }, /* @__PURE__ */ import_react18.default.createElement("div", { style: {
|
|
930
|
+
width: "40px",
|
|
931
|
+
height: "40px",
|
|
932
|
+
margin: "0 auto",
|
|
933
|
+
borderRadius: "50%",
|
|
934
|
+
background: index < currentStep ? "#059669" : index === currentStep ? "#2563eb" : "#cbd5e1",
|
|
935
|
+
color: index <= currentStep ? "white" : "#0f172a",
|
|
936
|
+
display: "flex",
|
|
937
|
+
alignItems: "center",
|
|
938
|
+
justifyContent: "center",
|
|
939
|
+
fontWeight: "bold"
|
|
940
|
+
} }, index + 1), /* @__PURE__ */ import_react18.default.createElement("p", { style: { color: index <= currentStep ? "#f1f5f9" : "#64748b", marginTop: "8px", fontSize: "14px" } }, step)))), /* @__PURE__ */ import_react18.default.createElement("div", { style: { display: "flex", position: "relative", height: "4px", background: "#cbd5e1", borderRadius: "2px" } }, /* @__PURE__ */ import_react18.default.createElement(
|
|
941
|
+
"div",
|
|
942
|
+
{
|
|
943
|
+
style: {
|
|
944
|
+
height: "100%",
|
|
945
|
+
width: currentStep / (steps.length - 1) * 100 + "%",
|
|
946
|
+
background: "#2563eb",
|
|
947
|
+
borderRadius: "2px"
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
)), /* @__PURE__ */ import_react18.default.createElement("div", { style: { display: "flex", justifyContent: "space-between", marginTop: "24px" } }, /* @__PURE__ */ import_react18.default.createElement("button", { onClick: handlePrevious, disabled: currentStep === 0, style: {
|
|
951
|
+
padding: "10px 20px",
|
|
952
|
+
borderRadius: "8px",
|
|
953
|
+
background: currentStep === 0 ? "#cbd5e1" : "#7c3aed",
|
|
954
|
+
color: "white",
|
|
955
|
+
border: "none",
|
|
956
|
+
cursor: currentStep === 0 ? "not-allowed" : "pointer"
|
|
957
|
+
} }, "Previous"), /* @__PURE__ */ import_react18.default.createElement("button", { onClick: handleNext, disabled: currentStep === steps.length - 1, style: {
|
|
958
|
+
padding: "10px 20px",
|
|
959
|
+
borderRadius: "8px",
|
|
960
|
+
background: currentStep === steps.length - 1 ? "#cbd5e1" : "#7c3aed",
|
|
961
|
+
color: "white",
|
|
962
|
+
border: "none",
|
|
963
|
+
cursor: currentStep === steps.length - 1 ? "not-allowed" : "pointer"
|
|
964
|
+
} }, "Next")));
|
|
965
|
+
};
|
|
966
|
+
|
|
967
|
+
// src/components/DateRangePicker/DateRangePicker.jsx
|
|
968
|
+
var import_react19 = __toESM(require("react"));
|
|
969
|
+
var DateRangePicker = ({
|
|
970
|
+
startDate = /* @__PURE__ */ new Date(),
|
|
971
|
+
endDate = new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + 7)),
|
|
972
|
+
onChange,
|
|
973
|
+
bg = "#0f172a",
|
|
974
|
+
highlightColor = "#2563eb",
|
|
975
|
+
borderColor = "#7c3aed",
|
|
976
|
+
borderRadius = "12px",
|
|
977
|
+
textColor = "#f1f5f9"
|
|
978
|
+
}) => {
|
|
979
|
+
const [selectedStart, setSelectedStart] = (0, import_react19.useState)(startDate);
|
|
980
|
+
const [selectedEnd, setSelectedEnd] = (0, import_react19.useState)(endDate);
|
|
981
|
+
const daysArray = Array.from({ length: 30 }, (_, i) => new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + i)));
|
|
982
|
+
const handleSelect = (date) => {
|
|
983
|
+
if (!selectedStart || selectedEnd && date < selectedStart) {
|
|
984
|
+
setSelectedStart(date);
|
|
985
|
+
setSelectedEnd(null);
|
|
986
|
+
} else {
|
|
987
|
+
setSelectedEnd(date);
|
|
988
|
+
}
|
|
989
|
+
onChange && onChange(selectedStart, selectedEnd);
|
|
990
|
+
};
|
|
991
|
+
return /* @__PURE__ */ import_react19.default.createElement("div", { style: { display: "flex", flexDirection: "column", background: bg, padding: "16px", borderRadius, border: `1px solid ${borderColor}`, boxShadow: "0 4px 20px rgba(0, 0, 0, 0.2)", fontFamily: "system-ui, sans-serif" } }, /* @__PURE__ */ import_react19.default.createElement("h3", { style: { color: textColor, margin: "0 0 12px", fontSize: "16px", fontWeight: "600" } }, "Select Date Range"), /* @__PURE__ */ import_react19.default.createElement("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 1fr)", gap: "8px" } }, daysArray.map((date, index) => /* @__PURE__ */ import_react19.default.createElement("button", { key: index, onClick: () => handleSelect(date), style: {
|
|
992
|
+
background: date >= selectedStart && date <= selectedEnd ? highlightColor : "#334155",
|
|
993
|
+
color: textColor,
|
|
994
|
+
padding: "10px 0",
|
|
995
|
+
borderRadius,
|
|
996
|
+
border: "none",
|
|
997
|
+
cursor: "pointer",
|
|
998
|
+
transition: "background 0.3s",
|
|
999
|
+
fontSize: "14px"
|
|
1000
|
+
} }, date.getDate()))));
|
|
1001
|
+
};
|
|
906
1002
|
// Annotate the CommonJS export names for ESM import in node:
|
|
907
1003
|
0 && (module.exports = {
|
|
908
1004
|
AlertBanner,
|
|
@@ -910,6 +1006,7 @@ var AnimatedProgressBar = ({
|
|
|
910
1006
|
Button,
|
|
911
1007
|
Card,
|
|
912
1008
|
CopyButton,
|
|
1009
|
+
DateRangePicker,
|
|
913
1010
|
Dropdown,
|
|
914
1011
|
EmptyState,
|
|
915
1012
|
Footer,
|
|
@@ -917,6 +1014,7 @@ var AnimatedProgressBar = ({
|
|
|
917
1014
|
GridLayout,
|
|
918
1015
|
ImageUploadPreview,
|
|
919
1016
|
Loader,
|
|
1017
|
+
MultiStepProgress,
|
|
920
1018
|
Navbar,
|
|
921
1019
|
OTPInput,
|
|
922
1020
|
RatingStars,
|
package/dist/index.mjs
CHANGED
|
@@ -852,12 +852,107 @@ var AnimatedProgressBar = ({
|
|
|
852
852
|
fontWeight: "600"
|
|
853
853
|
} }, percentage, "%"));
|
|
854
854
|
};
|
|
855
|
+
|
|
856
|
+
// src/components/MultiStepProgress/MultiStepProgress.jsx
|
|
857
|
+
import React18, { useState as useState12 } from "react";
|
|
858
|
+
var MultiStepProgress = ({
|
|
859
|
+
steps = ["Step 1", "Step 2", "Step 3"],
|
|
860
|
+
activeStep = 0,
|
|
861
|
+
onStepChange
|
|
862
|
+
}) => {
|
|
863
|
+
const [currentStep, setCurrentStep] = useState12(activeStep);
|
|
864
|
+
const handleNext = () => {
|
|
865
|
+
if (currentStep < steps.length - 1) {
|
|
866
|
+
setCurrentStep((prev) => prev + 1);
|
|
867
|
+
if (onStepChange) onStepChange(currentStep + 1);
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
const handlePrevious = () => {
|
|
871
|
+
if (currentStep > 0) {
|
|
872
|
+
setCurrentStep((prev) => prev - 1);
|
|
873
|
+
if (onStepChange) onStepChange(currentStep - 1);
|
|
874
|
+
}
|
|
875
|
+
};
|
|
876
|
+
return /* @__PURE__ */ React18.createElement("div", { style: { fontFamily: "system-ui, sans-serif", width: "100%", maxWidth: "700px", margin: "0 auto" } }, /* @__PURE__ */ React18.createElement("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "16px" } }, steps.map((step, index) => /* @__PURE__ */ React18.createElement("div", { key: index, style: { flex: 1, textAlign: "center" } }, /* @__PURE__ */ React18.createElement("div", { style: {
|
|
877
|
+
width: "40px",
|
|
878
|
+
height: "40px",
|
|
879
|
+
margin: "0 auto",
|
|
880
|
+
borderRadius: "50%",
|
|
881
|
+
background: index < currentStep ? "#059669" : index === currentStep ? "#2563eb" : "#cbd5e1",
|
|
882
|
+
color: index <= currentStep ? "white" : "#0f172a",
|
|
883
|
+
display: "flex",
|
|
884
|
+
alignItems: "center",
|
|
885
|
+
justifyContent: "center",
|
|
886
|
+
fontWeight: "bold"
|
|
887
|
+
} }, index + 1), /* @__PURE__ */ React18.createElement("p", { style: { color: index <= currentStep ? "#f1f5f9" : "#64748b", marginTop: "8px", fontSize: "14px" } }, step)))), /* @__PURE__ */ React18.createElement("div", { style: { display: "flex", position: "relative", height: "4px", background: "#cbd5e1", borderRadius: "2px" } }, /* @__PURE__ */ React18.createElement(
|
|
888
|
+
"div",
|
|
889
|
+
{
|
|
890
|
+
style: {
|
|
891
|
+
height: "100%",
|
|
892
|
+
width: currentStep / (steps.length - 1) * 100 + "%",
|
|
893
|
+
background: "#2563eb",
|
|
894
|
+
borderRadius: "2px"
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
)), /* @__PURE__ */ React18.createElement("div", { style: { display: "flex", justifyContent: "space-between", marginTop: "24px" } }, /* @__PURE__ */ React18.createElement("button", { onClick: handlePrevious, disabled: currentStep === 0, style: {
|
|
898
|
+
padding: "10px 20px",
|
|
899
|
+
borderRadius: "8px",
|
|
900
|
+
background: currentStep === 0 ? "#cbd5e1" : "#7c3aed",
|
|
901
|
+
color: "white",
|
|
902
|
+
border: "none",
|
|
903
|
+
cursor: currentStep === 0 ? "not-allowed" : "pointer"
|
|
904
|
+
} }, "Previous"), /* @__PURE__ */ React18.createElement("button", { onClick: handleNext, disabled: currentStep === steps.length - 1, style: {
|
|
905
|
+
padding: "10px 20px",
|
|
906
|
+
borderRadius: "8px",
|
|
907
|
+
background: currentStep === steps.length - 1 ? "#cbd5e1" : "#7c3aed",
|
|
908
|
+
color: "white",
|
|
909
|
+
border: "none",
|
|
910
|
+
cursor: currentStep === steps.length - 1 ? "not-allowed" : "pointer"
|
|
911
|
+
} }, "Next")));
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
// src/components/DateRangePicker/DateRangePicker.jsx
|
|
915
|
+
import React19, { useState as useState13 } from "react";
|
|
916
|
+
var DateRangePicker = ({
|
|
917
|
+
startDate = /* @__PURE__ */ new Date(),
|
|
918
|
+
endDate = new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + 7)),
|
|
919
|
+
onChange,
|
|
920
|
+
bg = "#0f172a",
|
|
921
|
+
highlightColor = "#2563eb",
|
|
922
|
+
borderColor = "#7c3aed",
|
|
923
|
+
borderRadius = "12px",
|
|
924
|
+
textColor = "#f1f5f9"
|
|
925
|
+
}) => {
|
|
926
|
+
const [selectedStart, setSelectedStart] = useState13(startDate);
|
|
927
|
+
const [selectedEnd, setSelectedEnd] = useState13(endDate);
|
|
928
|
+
const daysArray = Array.from({ length: 30 }, (_, i) => new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + i)));
|
|
929
|
+
const handleSelect = (date) => {
|
|
930
|
+
if (!selectedStart || selectedEnd && date < selectedStart) {
|
|
931
|
+
setSelectedStart(date);
|
|
932
|
+
setSelectedEnd(null);
|
|
933
|
+
} else {
|
|
934
|
+
setSelectedEnd(date);
|
|
935
|
+
}
|
|
936
|
+
onChange && onChange(selectedStart, selectedEnd);
|
|
937
|
+
};
|
|
938
|
+
return /* @__PURE__ */ React19.createElement("div", { style: { display: "flex", flexDirection: "column", background: bg, padding: "16px", borderRadius, border: `1px solid ${borderColor}`, boxShadow: "0 4px 20px rgba(0, 0, 0, 0.2)", fontFamily: "system-ui, sans-serif" } }, /* @__PURE__ */ React19.createElement("h3", { style: { color: textColor, margin: "0 0 12px", fontSize: "16px", fontWeight: "600" } }, "Select Date Range"), /* @__PURE__ */ React19.createElement("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 1fr)", gap: "8px" } }, daysArray.map((date, index) => /* @__PURE__ */ React19.createElement("button", { key: index, onClick: () => handleSelect(date), style: {
|
|
939
|
+
background: date >= selectedStart && date <= selectedEnd ? highlightColor : "#334155",
|
|
940
|
+
color: textColor,
|
|
941
|
+
padding: "10px 0",
|
|
942
|
+
borderRadius,
|
|
943
|
+
border: "none",
|
|
944
|
+
cursor: "pointer",
|
|
945
|
+
transition: "background 0.3s",
|
|
946
|
+
fontSize: "14px"
|
|
947
|
+
} }, date.getDate()))));
|
|
948
|
+
};
|
|
855
949
|
export {
|
|
856
950
|
AlertBanner,
|
|
857
951
|
AnimatedProgressBar,
|
|
858
952
|
Button,
|
|
859
953
|
Card,
|
|
860
954
|
CopyButton,
|
|
955
|
+
DateRangePicker,
|
|
861
956
|
Dropdown,
|
|
862
957
|
EmptyState,
|
|
863
958
|
Footer,
|
|
@@ -865,6 +960,7 @@ export {
|
|
|
865
960
|
GridLayout,
|
|
866
961
|
ImageUploadPreview,
|
|
867
962
|
Loader,
|
|
963
|
+
MultiStepProgress,
|
|
868
964
|
Navbar,
|
|
869
965
|
OTPInput,
|
|
870
966
|
RatingStars,
|