@underverse-ui/underverse 0.2.61 → 0.2.62

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.cjs CHANGED
@@ -5740,6 +5740,7 @@ var DatePicker = ({
5740
5740
  const locale = useLocale();
5741
5741
  const [isOpen, setIsOpen] = React23.useState(false);
5742
5742
  const [viewDate, setViewDate] = React23.useState(value || /* @__PURE__ */ new Date());
5743
+ const [viewMode, setViewMode] = React23.useState("calendar");
5743
5744
  const triggerRef = React23.useRef(null);
5744
5745
  const wheelContainerRef = React23.useRef(null);
5745
5746
  const wheelDeltaRef = React23.useRef(0);
@@ -5751,6 +5752,11 @@ var DatePicker = ({
5751
5752
  setViewDate(/* @__PURE__ */ new Date());
5752
5753
  }
5753
5754
  }, [value]);
5755
+ React23.useEffect(() => {
5756
+ if (!isOpen) {
5757
+ setViewMode("calendar");
5758
+ }
5759
+ }, [isOpen]);
5754
5760
  const handleDateSelect = (date) => {
5755
5761
  let selectedDate;
5756
5762
  if (value && (value.getHours() !== 0 || value.getMinutes() !== 0 || value.getSeconds() !== 0)) {
@@ -5859,13 +5865,64 @@ var DatePicker = ({
5859
5865
  }
5860
5866
  return days;
5861
5867
  };
5868
+ const renderMonthSelector = () => {
5869
+ const months = locale === "vi" ? ["Th1", "Th2", "Th3", "Th4", "Th5", "Th6", "Th7", "Th8", "Th9", "Th10", "Th11", "Th12"] : ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
5870
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "grid grid-cols-3 gap-2 p-2", children: months.map((month, idx) => {
5871
+ const isSelected = viewDate.getMonth() === idx;
5872
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5873
+ "button",
5874
+ {
5875
+ type: "button",
5876
+ onClick: () => {
5877
+ setViewDate(new Date(viewDate.getFullYear(), idx, 1));
5878
+ setViewMode("calendar");
5879
+ },
5880
+ className: cn(
5881
+ "py-2 px-3 rounded-lg text-sm font-medium transition-all duration-200",
5882
+ isSelected ? "bg-primary text-primary-foreground shadow-md" : "hover:bg-accent/80 text-foreground hover:scale-105"
5883
+ ),
5884
+ children: month
5885
+ },
5886
+ month
5887
+ );
5888
+ }) });
5889
+ };
5890
+ const renderYearSelector = () => {
5891
+ const currentYear = viewDate.getFullYear();
5892
+ const startYear = Math.floor(currentYear / 12) * 12;
5893
+ const years = Array.from({ length: 12 }, (_, i) => startYear + i);
5894
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "grid grid-cols-3 gap-2 p-2", children: years.map((year) => {
5895
+ const isSelected = viewDate.getFullYear() === year;
5896
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5897
+ "button",
5898
+ {
5899
+ type: "button",
5900
+ onClick: () => {
5901
+ setViewDate(new Date(year, viewDate.getMonth(), 1));
5902
+ setViewMode("month");
5903
+ },
5904
+ className: cn(
5905
+ "py-2 px-3 rounded-lg text-sm font-medium transition-all duration-200",
5906
+ isSelected ? "bg-primary text-primary-foreground shadow-md" : "hover:bg-accent/80 text-foreground hover:scale-105"
5907
+ ),
5908
+ children: year
5909
+ },
5910
+ year
5911
+ );
5912
+ }) });
5913
+ };
5914
+ const navigateYearRange = (direction) => {
5915
+ const currentYear = viewDate.getFullYear();
5916
+ const offset = direction === "next" ? 12 : -12;
5917
+ setViewDate(new Date(currentYear + offset, viewDate.getMonth(), 1));
5918
+ };
5862
5919
  const datePickerContent = /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { ref: wheelContainerRef, "data-datepicker": true, className: "w-full", children: [
5863
5920
  /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center justify-between mb-4 px-1", children: [
5864
5921
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5865
5922
  "button",
5866
5923
  {
5867
5924
  type: "button",
5868
- onClick: () => navigateMonth("prev"),
5925
+ onClick: () => viewMode === "year" ? navigateYearRange("prev") : navigateMonth("prev"),
5869
5926
  className: cn(
5870
5927
  "p-2 rounded-xl transition-all duration-200",
5871
5928
  "bg-muted/50 hover:bg-muted text-muted-foreground hover:text-foreground",
@@ -5875,15 +5932,37 @@ var DatePicker = ({
5875
5932
  children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.ChevronLeft, { className: "h-4 w-4" })
5876
5933
  }
5877
5934
  ),
5878
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-col items-center", children: [
5879
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-sm font-bold text-foreground", children: viewDate.toLocaleDateString(locale === "vi" ? "vi-VN" : "en-US", { month: "long" }) }),
5880
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-xs text-muted-foreground font-medium", children: viewDate.getFullYear() })
5935
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-1", children: [
5936
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5937
+ "button",
5938
+ {
5939
+ type: "button",
5940
+ onClick: () => setViewMode(viewMode === "month" ? "calendar" : "month"),
5941
+ className: cn(
5942
+ "text-sm font-bold transition-all duration-200 px-2 py-1 rounded-lg",
5943
+ viewMode === "month" ? "bg-primary/15 text-primary" : "text-foreground hover:bg-accent/50"
5944
+ ),
5945
+ children: viewDate.toLocaleDateString(locale === "vi" ? "vi-VN" : "en-US", { month: "long" })
5946
+ }
5947
+ ),
5948
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5949
+ "button",
5950
+ {
5951
+ type: "button",
5952
+ onClick: () => setViewMode(viewMode === "year" ? "calendar" : "year"),
5953
+ className: cn(
5954
+ "text-sm font-bold transition-all duration-200 px-2 py-1 rounded-lg",
5955
+ viewMode === "year" ? "bg-primary/15 text-primary" : "text-foreground hover:bg-accent/50"
5956
+ ),
5957
+ children: viewDate.getFullYear()
5958
+ }
5959
+ )
5881
5960
  ] }),
5882
5961
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5883
5962
  "button",
5884
5963
  {
5885
5964
  type: "button",
5886
- onClick: () => navigateMonth("next"),
5965
+ onClick: () => viewMode === "year" ? navigateYearRange("next") : navigateMonth("next"),
5887
5966
  className: cn(
5888
5967
  "p-2 rounded-xl transition-all duration-200",
5889
5968
  "bg-muted/50 hover:bg-muted text-muted-foreground hover:text-foreground",
@@ -5894,22 +5973,26 @@ var DatePicker = ({
5894
5973
  }
5895
5974
  )
5896
5975
  ] }),
5897
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn("grid grid-cols-7 gap-1 mb-2 px-0.5"), children: (weekdayLabels || (locale === "vi" ? ["CN", "T2", "T3", "T4", "T5", "T6", "T7"] : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"])).map(
5898
- (day, idx) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5899
- "div",
5900
- {
5901
- className: cn(
5902
- "text-center font-bold uppercase tracking-wide",
5903
- size === "sm" ? "text-[9px] py-1" : "text-[10px] py-1.5",
5904
- idx === 0 || idx === 6 ? "text-primary/70" : "text-muted-foreground/60"
5905
- ),
5906
- children: day
5907
- },
5908
- day
5909
- )
5910
- ) }),
5911
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "grid grid-cols-7 gap-1 p-1 rounded-xl bg-muted/20", children: renderCalendar() }),
5912
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-2 mt-4 pt-3 border-t border-border/50", children: [
5976
+ viewMode === "calendar" && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
5977
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn("grid grid-cols-7 gap-1 mb-2 px-0.5"), children: (weekdayLabels || (locale === "vi" ? ["CN", "T2", "T3", "T4", "T5", "T6", "T7"] : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"])).map(
5978
+ (day, idx) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5979
+ "div",
5980
+ {
5981
+ className: cn(
5982
+ "text-center font-bold uppercase tracking-wide",
5983
+ size === "sm" ? "text-[9px] py-1" : "text-[10px] py-1.5",
5984
+ idx === 0 || idx === 6 ? "text-primary/70" : "text-muted-foreground/60"
5985
+ ),
5986
+ children: day
5987
+ },
5988
+ day
5989
+ )
5990
+ ) }),
5991
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "grid grid-cols-7 gap-1 p-1 rounded-xl bg-muted/20", children: renderCalendar() })
5992
+ ] }),
5993
+ viewMode === "month" && renderMonthSelector(),
5994
+ viewMode === "year" && renderYearSelector(),
5995
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("flex items-center gap-2 mt-4 pt-3 border-t border-border/50", size === "sm" && "mt-3 pt-2 gap-1.5"), children: [
5913
5996
  /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
5914
5997
  "button",
5915
5998
  {
@@ -5919,14 +6002,15 @@ var DatePicker = ({
5919
6002
  handleDateSelect(today);
5920
6003
  },
5921
6004
  className: cn(
5922
- "flex-1 px-3 py-2 text-xs font-semibold rounded-xl",
6005
+ "flex-1 font-semibold rounded-xl",
5923
6006
  "bg-linear-to-r from-primary/10 to-primary/5 border border-primary/30",
5924
6007
  "text-primary hover:from-primary/20 hover:to-primary/10 hover:border-primary/50",
5925
- "transition-all duration-300 flex items-center justify-center gap-2",
5926
- "hover:scale-[1.02] active:scale-[0.98] hover:shadow-md hover:shadow-primary/10"
6008
+ "transition-all duration-300 flex items-center justify-center",
6009
+ "hover:scale-[1.02] active:scale-[0.98] hover:shadow-md hover:shadow-primary/10",
6010
+ size === "sm" ? "px-2 py-1 text-[10px] gap-1" : "px-3 py-2 text-xs gap-2"
5927
6011
  ),
5928
6012
  children: [
5929
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.Sparkles, { className: "w-3.5 h-3.5" }),
6013
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.Sparkles, { className: size === "sm" ? "w-2.5 h-2.5" : "w-3.5 h-3.5" }),
5930
6014
  todayLabel || t("today")
5931
6015
  ]
5932
6016
  }
@@ -5941,14 +6025,15 @@ var DatePicker = ({
5941
6025
  setViewDate(/* @__PURE__ */ new Date());
5942
6026
  },
5943
6027
  className: cn(
5944
- "flex-1 px-3 py-2 text-xs font-semibold rounded-xl",
6028
+ "flex-1 font-semibold rounded-xl",
5945
6029
  "bg-linear-to-r from-destructive/10 to-destructive/5 border border-destructive/30",
5946
6030
  "text-destructive hover:from-destructive/20 hover:to-destructive/10 hover:border-destructive/50",
5947
- "transition-all duration-300 flex items-center justify-center gap-2",
5948
- "hover:scale-[1.02] active:scale-[0.98] hover:shadow-md hover:shadow-destructive/10"
6031
+ "transition-all duration-300 flex items-center justify-center",
6032
+ "hover:scale-[1.02] active:scale-[0.98] hover:shadow-md hover:shadow-destructive/10",
6033
+ size === "sm" ? "px-2 py-1 text-[10px] gap-1" : "px-3 py-2 text-xs gap-2"
5949
6034
  ),
5950
6035
  children: [
5951
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.X, { className: "w-3.5 h-3.5" }),
6036
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.X, { className: size === "sm" ? "w-2.5 h-2.5" : "w-3.5 h-3.5" }),
5952
6037
  clearLabel || t("clear")
5953
6038
  ]
5954
6039
  }
@@ -6081,20 +6166,25 @@ var DatePicker = ({
6081
6166
  )
6082
6167
  ] });
6083
6168
  };
6084
- var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select date range...", className, disablePastDates = false }) => {
6169
+ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select date range...", className, disablePastDates = false, size = "md" }) => {
6085
6170
  const locale = useLocale();
6171
+ const t = useTranslations("DatePicker");
6086
6172
  const [isOpen, setIsOpen] = React23.useState(false);
6087
6173
  const wheelContainerRef = React23.useRef(null);
6088
6174
  const wheelDeltaRef = React23.useRef(0);
6175
+ const normalizeToLocal = (date) => {
6176
+ if (!date) return null;
6177
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate());
6178
+ };
6089
6179
  const [viewDate, setViewDate] = React23.useState(startDate || /* @__PURE__ */ new Date());
6090
- const [tempStart, setTempStart] = React23.useState(startDate || null);
6091
- const [tempEnd, setTempEnd] = React23.useState(endDate || null);
6180
+ const [tempStart, setTempStart] = React23.useState(normalizeToLocal(startDate));
6181
+ const [tempEnd, setTempEnd] = React23.useState(normalizeToLocal(endDate));
6092
6182
  const [hoveredDate, setHoveredDate] = React23.useState(null);
6093
6183
  React23.useEffect(() => {
6094
- setTempStart(startDate || null);
6184
+ setTempStart(normalizeToLocal(startDate));
6095
6185
  }, [startDate]);
6096
6186
  React23.useEffect(() => {
6097
- setTempEnd(endDate || null);
6187
+ setTempEnd(normalizeToLocal(endDate));
6098
6188
  }, [endDate]);
6099
6189
  const isSameDay2 = (a, b) => {
6100
6190
  if (!a || !b) return false;
@@ -6195,7 +6285,8 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
6195
6285
  onMouseEnter: () => !isPastDate && tempStart && !tempEnd && setHoveredDate(date),
6196
6286
  onMouseLeave: () => tempStart && !tempEnd && setHoveredDate(null),
6197
6287
  className: cn(
6198
- "w-8 h-8 text-sm transition-all duration-200 focus:outline-none relative font-medium",
6288
+ "transition-all duration-200 focus:outline-none relative font-medium",
6289
+ size === "sm" ? "w-6 h-6 text-xs" : "w-8 h-8 text-sm",
6199
6290
  // Disabled/past date state
6200
6291
  isPastDate && "opacity-30 cursor-not-allowed text-muted-foreground",
6201
6292
  // Default state
@@ -6221,24 +6312,25 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
6221
6312
  return nodes;
6222
6313
  };
6223
6314
  const panel = /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { ref: wheelContainerRef, className: "w-full", children: [
6224
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center justify-between mb-4 px-1", children: [
6315
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("flex items-center justify-between px-1", size === "sm" ? "mb-2" : "mb-4"), children: [
6225
6316
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6226
6317
  "button",
6227
6318
  {
6228
6319
  type: "button",
6229
6320
  onClick: () => navigateMonth("prev"),
6230
6321
  className: cn(
6231
- "p-2 rounded-xl transition-all duration-200",
6322
+ "rounded-xl transition-all duration-200",
6323
+ size === "sm" ? "p-1.5" : "p-2",
6232
6324
  "bg-muted/50 hover:bg-muted text-muted-foreground hover:text-foreground",
6233
6325
  "hover:scale-110 active:scale-95 hover:shadow-md",
6234
6326
  "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50"
6235
6327
  ),
6236
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.ChevronLeft, { className: "h-4 w-4" })
6328
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.ChevronLeft, { className: cn(size === "sm" ? "h-3 w-3" : "h-4 w-4") })
6237
6329
  }
6238
6330
  ),
6239
6331
  /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-col items-center", children: [
6240
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-sm font-bold text-foreground", children: viewDate.toLocaleDateString(locale === "vi" ? "vi-VN" : "en-US", { month: "long" }) }),
6241
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-xs text-muted-foreground font-medium", children: viewDate.getFullYear() })
6332
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: cn("font-bold text-foreground", size === "sm" ? "text-xs" : "text-sm"), children: viewDate.toLocaleDateString(locale === "vi" ? "vi-VN" : "en-US", { month: "long" }) }),
6333
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: cn("text-muted-foreground font-medium", size === "sm" ? "text-[10px]" : "text-xs"), children: viewDate.getFullYear() })
6242
6334
  ] }),
6243
6335
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6244
6336
  "button",
@@ -6246,20 +6338,22 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
6246
6338
  type: "button",
6247
6339
  onClick: () => navigateMonth("next"),
6248
6340
  className: cn(
6249
- "p-2 rounded-xl transition-all duration-200",
6341
+ "rounded-xl transition-all duration-200",
6342
+ size === "sm" ? "p-1.5" : "p-2",
6250
6343
  "bg-muted/50 hover:bg-muted text-muted-foreground hover:text-foreground",
6251
6344
  "hover:scale-110 active:scale-95 hover:shadow-md",
6252
6345
  "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50"
6253
6346
  ),
6254
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.ChevronRight, { className: "h-4 w-4" })
6347
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.ChevronRight, { className: cn(size === "sm" ? "h-3 w-3" : "h-4 w-4") })
6255
6348
  }
6256
6349
  )
6257
6350
  ] }),
6258
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "grid grid-cols-7 gap-1 mb-2 px-0.5", children: (locale === "vi" ? ["CN", "T2", "T3", "T4", "T5", "T6", "T7"] : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]).map((d, idx) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6351
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn("grid grid-cols-7 gap-1 px-0.5", size === "sm" ? "mb-1" : "mb-2"), children: (locale === "vi" ? ["CN", "T2", "T3", "T4", "T5", "T6", "T7"] : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]).map((d, idx) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6259
6352
  "div",
6260
6353
  {
6261
6354
  className: cn(
6262
- "text-[10px] text-center py-1.5 font-bold uppercase tracking-wide",
6355
+ "text-center font-bold uppercase tracking-wide",
6356
+ size === "sm" ? "text-[8px] py-1" : "text-[10px] py-1.5",
6263
6357
  idx === 0 || idx === 6 ? "text-primary/70" : "text-muted-foreground/60"
6264
6358
  ),
6265
6359
  children: d
@@ -6276,13 +6370,13 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
6276
6370
  open: isOpen,
6277
6371
  onOpenChange: setIsOpen,
6278
6372
  placement: "bottom-start",
6279
- contentWidth: 280,
6373
+ contentWidth: size === "sm" ? 240 : 280,
6280
6374
  contentClassName: cn(
6281
6375
  "p-0",
6282
6376
  "backdrop-blur-xl bg-popover/95 border-border/40 shadow-2xl",
6283
6377
  "rounded-2xl",
6284
6378
  "max-w-[calc(100vw-1rem)] max-h-[calc(100vh-6rem)] overflow-auto overscroll-contain",
6285
- "p-5",
6379
+ size === "sm" ? "p-3" : "p-5",
6286
6380
  "animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-300"
6287
6381
  ),
6288
6382
  trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
@@ -6290,7 +6384,8 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
6290
6384
  {
6291
6385
  type: "button",
6292
6386
  className: cn(
6293
- "group flex w-full items-center justify-between rounded-full border bg-background/80 backdrop-blur-sm px-3 py-2.5 text-sm",
6387
+ "group flex w-full items-center justify-between rounded-full border bg-background/80 backdrop-blur-sm",
6388
+ size === "sm" ? "px-2 py-1.5 text-xs" : "px-3 py-2.5 text-sm",
6294
6389
  "border-border/60 hover:border-primary/40",
6295
6390
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background",
6296
6391
  "hover:bg-accent/10 hover:shadow-lg hover:shadow-primary/5 hover:-translate-y-0.5",
@@ -6299,15 +6394,16 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
6299
6394
  className
6300
6395
  ),
6301
6396
  children: [
6302
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-2.5", children: [
6397
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("flex items-center", size === "sm" ? "gap-1.5" : "gap-2.5"), children: [
6303
6398
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6304
6399
  "div",
6305
6400
  {
6306
6401
  className: cn(
6307
- "flex items-center justify-center rounded-lg p-1.5 transition-all duration-300",
6402
+ "flex items-center justify-center rounded-lg transition-all duration-300",
6403
+ size === "sm" ? "p-1" : "p-1.5",
6308
6404
  isOpen ? "bg-primary/15 text-primary" : "bg-muted/50 text-muted-foreground group-hover:bg-primary/10 group-hover:text-primary"
6309
6405
  ),
6310
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.Calendar, { className: cn("h-4 w-4 transition-transform duration-300", isOpen && "scale-110") })
6406
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.Calendar, { className: cn("transition-transform duration-300", size === "sm" ? "h-3 w-3" : "h-4 w-4", isOpen && "scale-110") })
6311
6407
  }
6312
6408
  ),
6313
6409
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
@@ -6322,7 +6418,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
6322
6418
  }
6323
6419
  )
6324
6420
  ] }),
6325
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: cn("transition-all duration-300 text-muted-foreground group-hover:text-foreground", isOpen && "rotate-180 text-primary"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) })
6421
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: cn("transition-all duration-300 text-muted-foreground group-hover:text-foreground", isOpen && "rotate-180 text-primary"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { className: cn(size === "sm" ? "h-3 w-3" : "h-4 w-4"), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) })
6326
6422
  ]
6327
6423
  }
6328
6424
  ),