virtual-ui-lib 1.0.31 → 1.0.33
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 +59 -0
- package/dist/index.mjs +57 -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
|
+
LoadingSkeleton: () => LoadingSkeleton,
|
|
44
46
|
MultiStepProgress: () => MultiStepProgress,
|
|
45
47
|
Navbar: () => Navbar,
|
|
46
48
|
OTPInput: () => OTPInput,
|
|
@@ -962,6 +964,61 @@ var MultiStepProgress = ({
|
|
|
962
964
|
cursor: currentStep === steps.length - 1 ? "not-allowed" : "pointer"
|
|
963
965
|
} }, "Next")));
|
|
964
966
|
};
|
|
967
|
+
|
|
968
|
+
// src/components/DateRangePicker/DateRangePicker.jsx
|
|
969
|
+
var import_react19 = __toESM(require("react"));
|
|
970
|
+
var DateRangePicker = ({
|
|
971
|
+
startDate = /* @__PURE__ */ new Date(),
|
|
972
|
+
endDate = new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + 7)),
|
|
973
|
+
onChange,
|
|
974
|
+
bg = "#0f172a",
|
|
975
|
+
highlightColor = "#2563eb",
|
|
976
|
+
borderColor = "#7c3aed",
|
|
977
|
+
borderRadius = "12px",
|
|
978
|
+
textColor = "#f1f5f9"
|
|
979
|
+
}) => {
|
|
980
|
+
const [selectedStart, setSelectedStart] = (0, import_react19.useState)(startDate);
|
|
981
|
+
const [selectedEnd, setSelectedEnd] = (0, import_react19.useState)(endDate);
|
|
982
|
+
const daysArray = Array.from({ length: 30 }, (_, i) => new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + i)));
|
|
983
|
+
const handleSelect = (date) => {
|
|
984
|
+
if (!selectedStart || selectedEnd && date < selectedStart) {
|
|
985
|
+
setSelectedStart(date);
|
|
986
|
+
setSelectedEnd(null);
|
|
987
|
+
} else {
|
|
988
|
+
setSelectedEnd(date);
|
|
989
|
+
}
|
|
990
|
+
onChange && onChange(selectedStart, selectedEnd);
|
|
991
|
+
};
|
|
992
|
+
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: {
|
|
993
|
+
background: date >= selectedStart && date <= selectedEnd ? highlightColor : "#334155",
|
|
994
|
+
color: textColor,
|
|
995
|
+
padding: "10px 0",
|
|
996
|
+
borderRadius,
|
|
997
|
+
border: "none",
|
|
998
|
+
cursor: "pointer",
|
|
999
|
+
transition: "background 0.3s",
|
|
1000
|
+
fontSize: "14px"
|
|
1001
|
+
} }, date.getDate()))));
|
|
1002
|
+
};
|
|
1003
|
+
|
|
1004
|
+
// src/components/LoadingSkeleton/LoadingSkeleton.jsx
|
|
1005
|
+
var import_react20 = __toESM(require("react"));
|
|
1006
|
+
var LoadingSkeleton = ({
|
|
1007
|
+
type = "card",
|
|
1008
|
+
width = "300px",
|
|
1009
|
+
height = "200px",
|
|
1010
|
+
bg = "#334155",
|
|
1011
|
+
shimmerColor = "#7c3aed",
|
|
1012
|
+
radius = "12px",
|
|
1013
|
+
speed = "1.5s"
|
|
1014
|
+
}) => {
|
|
1015
|
+
const shimmer = {
|
|
1016
|
+
background: `linear-gradient(90deg, ${shimmerColor} 25%, rgba(255, 255, 255, 0.2) 50%, ${shimmerColor} 75%)`,
|
|
1017
|
+
backgroundSize: "200% 100%",
|
|
1018
|
+
animation: `shimmer ${speed} infinite`
|
|
1019
|
+
};
|
|
1020
|
+
return /* @__PURE__ */ import_react20.default.createElement("div", { style: { width, height, borderRadius: radius, position: "relative", overflow: "hidden", background: bg } }, /* @__PURE__ */ import_react20.default.createElement("div", { style: { width: "100%", height: "100%", ...shimmer } }), /* @__PURE__ */ import_react20.default.createElement("style", null, `@keyframes shimmer { 0% { background-position: 200% 0%; } 100% { background-position: 0% 0%; } }`));
|
|
1021
|
+
};
|
|
965
1022
|
// Annotate the CommonJS export names for ESM import in node:
|
|
966
1023
|
0 && (module.exports = {
|
|
967
1024
|
AlertBanner,
|
|
@@ -969,6 +1026,7 @@ var MultiStepProgress = ({
|
|
|
969
1026
|
Button,
|
|
970
1027
|
Card,
|
|
971
1028
|
CopyButton,
|
|
1029
|
+
DateRangePicker,
|
|
972
1030
|
Dropdown,
|
|
973
1031
|
EmptyState,
|
|
974
1032
|
Footer,
|
|
@@ -976,6 +1034,7 @@ var MultiStepProgress = ({
|
|
|
976
1034
|
GridLayout,
|
|
977
1035
|
ImageUploadPreview,
|
|
978
1036
|
Loader,
|
|
1037
|
+
LoadingSkeleton,
|
|
979
1038
|
MultiStepProgress,
|
|
980
1039
|
Navbar,
|
|
981
1040
|
OTPInput,
|
package/dist/index.mjs
CHANGED
|
@@ -910,12 +910,68 @@ var MultiStepProgress = ({
|
|
|
910
910
|
cursor: currentStep === steps.length - 1 ? "not-allowed" : "pointer"
|
|
911
911
|
} }, "Next")));
|
|
912
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
|
+
};
|
|
949
|
+
|
|
950
|
+
// src/components/LoadingSkeleton/LoadingSkeleton.jsx
|
|
951
|
+
import React20 from "react";
|
|
952
|
+
var LoadingSkeleton = ({
|
|
953
|
+
type = "card",
|
|
954
|
+
width = "300px",
|
|
955
|
+
height = "200px",
|
|
956
|
+
bg = "#334155",
|
|
957
|
+
shimmerColor = "#7c3aed",
|
|
958
|
+
radius = "12px",
|
|
959
|
+
speed = "1.5s"
|
|
960
|
+
}) => {
|
|
961
|
+
const shimmer = {
|
|
962
|
+
background: `linear-gradient(90deg, ${shimmerColor} 25%, rgba(255, 255, 255, 0.2) 50%, ${shimmerColor} 75%)`,
|
|
963
|
+
backgroundSize: "200% 100%",
|
|
964
|
+
animation: `shimmer ${speed} infinite`
|
|
965
|
+
};
|
|
966
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { width, height, borderRadius: radius, position: "relative", overflow: "hidden", background: bg } }, /* @__PURE__ */ React20.createElement("div", { style: { width: "100%", height: "100%", ...shimmer } }), /* @__PURE__ */ React20.createElement("style", null, `@keyframes shimmer { 0% { background-position: 200% 0%; } 100% { background-position: 0% 0%; } }`));
|
|
967
|
+
};
|
|
913
968
|
export {
|
|
914
969
|
AlertBanner,
|
|
915
970
|
AnimatedProgressBar,
|
|
916
971
|
Button,
|
|
917
972
|
Card,
|
|
918
973
|
CopyButton,
|
|
974
|
+
DateRangePicker,
|
|
919
975
|
Dropdown,
|
|
920
976
|
EmptyState,
|
|
921
977
|
Footer,
|
|
@@ -923,6 +979,7 @@ export {
|
|
|
923
979
|
GridLayout,
|
|
924
980
|
ImageUploadPreview,
|
|
925
981
|
Loader,
|
|
982
|
+
LoadingSkeleton,
|
|
926
983
|
MultiStepProgress,
|
|
927
984
|
Navbar,
|
|
928
985
|
OTPInput,
|