cr-ui-lib 1.1.102 → 1.1.105

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.d.mts CHANGED
@@ -65,8 +65,9 @@ interface SimpleCardProps {
65
65
  handleRefresh?: () => void;
66
66
  isCustomTitle?: boolean;
67
67
  customTitle?: React$1.ReactNode;
68
+ isAvailable?: boolean;
68
69
  }
69
- declare const SimpleCard: ({ title, value, image, unit, tooltip_text, subText, footerText, hasfooterDesign, footerDesign, hasDaysOption, hasTillDateDayOption, onDayChange, className, handleRefresh, isLoading, isError, isCustomTitle, customTitle, }: SimpleCardProps) => JSX.Element;
70
+ declare const SimpleCard: ({ title, value, image, unit, tooltip_text, subText, footerText, hasfooterDesign, footerDesign, hasDaysOption, hasTillDateDayOption, onDayChange, className, handleRefresh, isLoading, isError, isCustomTitle, customTitle, isAvailable, }: SimpleCardProps) => JSX.Element;
70
71
 
71
72
  interface Props {
72
73
  title: string;
package/dist/index.d.ts CHANGED
@@ -65,8 +65,9 @@ interface SimpleCardProps {
65
65
  handleRefresh?: () => void;
66
66
  isCustomTitle?: boolean;
67
67
  customTitle?: React$1.ReactNode;
68
+ isAvailable?: boolean;
68
69
  }
69
- declare const SimpleCard: ({ title, value, image, unit, tooltip_text, subText, footerText, hasfooterDesign, footerDesign, hasDaysOption, hasTillDateDayOption, onDayChange, className, handleRefresh, isLoading, isError, isCustomTitle, customTitle, }: SimpleCardProps) => JSX.Element;
70
+ declare const SimpleCard: ({ title, value, image, unit, tooltip_text, subText, footerText, hasfooterDesign, footerDesign, hasDaysOption, hasTillDateDayOption, onDayChange, className, handleRefresh, isLoading, isError, isCustomTitle, customTitle, isAvailable, }: SimpleCardProps) => JSX.Element;
70
71
 
71
72
  interface Props {
72
73
  title: string;
package/dist/index.js CHANGED
@@ -747,7 +747,8 @@ var SimpleCard = ({
747
747
  isLoading,
748
748
  isError,
749
749
  isCustomTitle = false,
750
- customTitle
750
+ customTitle,
751
+ isAvailable = true
751
752
  }) => {
752
753
  const [selectedDay, setSelectedDay] = React__default.default.useState("90");
753
754
  const handleDayClick = (label) => {
@@ -837,18 +838,18 @@ var SimpleCard = ({
837
838
  ]
838
839
  }
839
840
  ) }),
840
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex-grow items-center`, children: [
841
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex-grow items-center`, children: isAvailable ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
841
842
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[24px] font-semibold text-gray-900 antialiased tracking-normal", children: [
842
843
  subText == "$" ? "$" : "",
843
844
  value.trim(),
844
845
  subText == "$" ? "" : subText
845
846
  ] }),
846
847
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500 ml-2", children: unit })
847
- ] })
848
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[24px] font-semibold text-gray-900 antialiased tracking-normal opacity-50", children: "0" }) })
848
849
  ] }),
849
850
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-4", children: image })
850
851
  ] }),
851
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
852
+ isAvailable && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
852
853
  hasfooterDesign && footerDesign,
853
854
  !hasDaysOption && /* @__PURE__ */ jsxRuntime.jsx(
854
855
  "span",
@@ -862,6 +863,10 @@ var SimpleCard = ({
862
863
  }
863
864
  )
864
865
  ] }),
866
+ !isAvailable && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-1 h-[22px] w-[107px] rounded-[40px] border border-[#D9E0FA] bg-[#F5F7FE]", children: [
867
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[5px] h-[5px] rounded-full bg-[#4062E5]" }),
868
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-[#4062E5] font-semibold antialiased text-center leading-[1px]", children: "Coming Soon" })
869
+ ] }),
865
870
  hasDaysOption && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-[4px] text-[12px] font-normal text-center items-center antialiased tracking-normal", children: options.map((label, index, array) => /* @__PURE__ */ jsxRuntime.jsxs(React__default.default.Fragment, { children: [
866
871
  renderDayOption(label),
867
872
  index < array.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[#757575]", children: "|" })
@@ -2019,7 +2024,11 @@ var DateRangePicker = ({
2019
2024
  getInitialStartDate()
2020
2025
  );
2021
2026
  const [endDate, setEndDate] = React.useState(getInitialEndDate());
2022
- const [leftMonth, setLeftMonth] = React.useState(/* @__PURE__ */ new Date());
2027
+ const [leftMonth, setLeftMonth] = React.useState(() => {
2028
+ const prevMonth = /* @__PURE__ */ new Date();
2029
+ prevMonth.setMonth(prevMonth.getMonth() - 1);
2030
+ return prevMonth;
2031
+ });
2023
2032
  const [rightMonth, setRightMonth] = React.useState(/* @__PURE__ */ new Date());
2024
2033
  const [hoveredDate, setHoveredDate] = React.useState(null);
2025
2034
  const [selectingStart, setSelectingStart] = React.useState(true);
@@ -2677,7 +2686,7 @@ var DateRangePicker = ({
2677
2686
  setLeftCalendarView("day");
2678
2687
  setRightCalendarView("day");
2679
2688
  setLeftMonth(
2680
- originalStart ? new Date(originalStart.getFullYear(), originalStart.getMonth(), 1) : /* @__PURE__ */ new Date()
2689
+ originalStart ? new Date(originalStart.getFullYear(), originalStart.getMonth(), 1) : new Date((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1))
2681
2690
  );
2682
2691
  setRightMonth(
2683
2692
  originalEnd ? new Date(originalEnd.getFullYear(), originalEnd.getMonth(), 1) : /* @__PURE__ */ new Date()
@@ -2755,7 +2764,7 @@ var DateRangePicker = ({
2755
2764
  isOpen && /* @__PURE__ */ jsxRuntime.jsx(
2756
2765
  "div",
2757
2766
  {
2758
- className: `absolute top-full right-0 ${datePopupOnly ? "" : "mt-2"} bg-white border rounded-lg shadow-lg z-50 ${dateRangeClass}`,
2767
+ className: `absolute top-full right-0 ${datePopupOnly ? "" : "mt-1"} bg-white border rounded-lg shadow-lg z-50 ${dateRangeClass}`,
2759
2768
  style: {
2760
2769
  width: "700px",
2761
2770
  height: "419px",
@@ -2791,7 +2800,9 @@ var DateRangePicker = ({
2791
2800
  setStartDate(null);
2792
2801
  setEndDate(null);
2793
2802
  setRightMonth(/* @__PURE__ */ new Date());
2794
- setLeftMonth(/* @__PURE__ */ new Date());
2803
+ const prev = /* @__PURE__ */ new Date();
2804
+ prev.setMonth(prev.getMonth() - 1);
2805
+ setLeftMonth(prev);
2795
2806
  setLeftCalendarView("day");
2796
2807
  setRightCalendarView("day");
2797
2808
  },
@@ -2921,7 +2932,7 @@ var DateRangePicker = ({
2921
2932
  "button",
2922
2933
  {
2923
2934
  onClick: () => handleCancel(),
2924
- className: "w-full px-[14px] py-[6px] text-[16px] font-semibold border rounded-[4px] border-1 border-[#E0E1E6]",
2935
+ className: "w-full px-[14px] py-[6px] text-[16px] font-semibold antialiased border rounded-[4px] border-1 border-[#E0E1E6]",
2925
2936
  children: "Cancel"
2926
2937
  }
2927
2938
  ),
@@ -2975,7 +2986,7 @@ var DateRangePicker = ({
2975
2986
  setIsShowDateRange();
2976
2987
  setIsOpen(false);
2977
2988
  },
2978
- className: `w-full px-[14px] py-[6px] text-[16px] text-[#FFFFFF] font-semibold border rounded-[4px] bg-[#4683B4] ${!isCustomInputValid() && "opacity-50"} flex justify-center items-center gap-2`,
2989
+ className: `w-full px-[14px] py-[6px] text-[16px] text-[#FFFFFF] font-semibold antialiased border rounded-[4px] bg-[#4683B4] ${!isCustomInputValid() && "opacity-50"} flex justify-center items-center gap-2`,
2979
2990
  children: datePopupOnly ? isExporting ? /* @__PURE__ */ jsxRuntime.jsxs(
2980
2991
  "svg",
2981
2992
  {