@wealthx/shadcn 1.5.8 → 1.5.10

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.
@@ -695,11 +695,12 @@ function generateMonthGrid(year, month) {
695
695
  }
696
696
  function MonthView({
697
697
  appointments,
698
+ viewDate,
698
699
  today,
699
700
  onSelectAppointment
700
701
  }) {
701
- const todayDate = /* @__PURE__ */ new Date(today + "T00:00:00");
702
- const grid = generateMonthGrid(todayDate.getFullYear(), todayDate.getMonth());
702
+ const vd = /* @__PURE__ */ new Date(viewDate + "T00:00:00");
703
+ const grid = generateMonthGrid(vd.getFullYear(), vd.getMonth());
703
704
  const toIso = (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
704
705
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col", children: [
705
706
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "grid grid-cols-7 border-b border-border", children: MONTH_DAY_HEADERS.map((d) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
@@ -768,15 +769,18 @@ function AppointmentCalendarView({
768
769
  periodLabel,
769
770
  weekDays,
770
771
  hours = DEFAULT_HOURS,
772
+ viewDate,
771
773
  dayViewDate,
772
774
  defaultView = "week",
773
775
  onPrev,
774
776
  onNext,
775
777
  onToday,
778
+ onViewChange,
776
779
  onSelectAppointment,
777
780
  toolbarActions
778
781
  }) {
779
- const dayDate = dayViewDate != null ? dayViewDate : today;
782
+ var _a;
783
+ const effectiveViewDate = (_a = viewDate != null ? viewDate : dayViewDate) != null ? _a : today;
780
784
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col border border-border bg-card", children: [
781
785
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center justify-between gap-4 px-4 py-3", children: [
782
786
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-2", children: [
@@ -806,41 +810,57 @@ function AppointmentCalendarView({
806
810
  toolbarActions && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex items-center gap-2", children: toolbarActions })
807
811
  ] }),
808
812
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Separator, {}),
809
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Tabs, { defaultValue: defaultView, className: "flex flex-col", children: [
810
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "px-4 pt-3", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(TabsList, { children: [
811
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsTrigger, { value: "day", children: "Day" }),
812
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsTrigger, { value: "week", children: "Week" }),
813
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsTrigger, { value: "month", children: "Month" })
814
- ] }) }),
815
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsContent, { value: "day", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
816
- DayView,
817
- {
818
- appointments,
819
- date: dayDate,
820
- today,
821
- hours,
822
- onSelectAppointment
823
- }
824
- ) }),
825
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsContent, { value: "week", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
826
- WeekView,
827
- {
828
- appointments,
829
- weekDays,
830
- today,
831
- hours,
832
- onSelectAppointment
833
- }
834
- ) }),
835
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsContent, { value: "month", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
836
- MonthView,
837
- {
838
- appointments,
839
- today,
840
- onSelectAppointment
841
- }
842
- ) })
843
- ] })
813
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
814
+ Tabs,
815
+ {
816
+ defaultValue: defaultView,
817
+ onValueChange: (v) => onViewChange == null ? void 0 : onViewChange(v),
818
+ className: "flex flex-col",
819
+ children: [
820
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "px-4 pt-3", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(TabsList, { children: [
821
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsTrigger, { value: "day", children: "Day" }),
822
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsTrigger, { value: "week", children: "Week" }),
823
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsTrigger, { value: "month", children: "Month" })
824
+ ] }) }),
825
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsContent, { value: "day", className: "mt-0 max-h-[75vh] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
826
+ DayView,
827
+ {
828
+ appointments,
829
+ date: effectiveViewDate,
830
+ today,
831
+ hours,
832
+ onSelectAppointment
833
+ }
834
+ ) }),
835
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsContent, { value: "week", className: "mt-0 max-h-[75vh] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
836
+ WeekView,
837
+ {
838
+ appointments,
839
+ weekDays,
840
+ today,
841
+ hours,
842
+ onSelectAppointment
843
+ }
844
+ ) }),
845
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
846
+ TabsContent,
847
+ {
848
+ value: "month",
849
+ className: "mt-0 max-h-[75vh] overflow-y-auto",
850
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
851
+ MonthView,
852
+ {
853
+ appointments,
854
+ viewDate: effectiveViewDate,
855
+ today,
856
+ onSelectAppointment
857
+ }
858
+ )
859
+ }
860
+ )
861
+ ]
862
+ }
863
+ )
844
864
  ] });
845
865
  }
846
866
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AppointmentCalendarView
3
- } from "../../chunk-XVZGXPIX.mjs";
3
+ } from "../../chunk-Z2BW5T7P.mjs";
4
4
  import "../../chunk-WE4YKBDE.mjs";
5
5
  import "../../chunk-2GIYVERS.mjs";
6
6
  import "../../chunk-H6NQTIF4.mjs";
package/dist/index.js CHANGED
@@ -9589,11 +9589,12 @@ function generateMonthGrid(year, month) {
9589
9589
  }
9590
9590
  function MonthView({
9591
9591
  appointments,
9592
+ viewDate,
9592
9593
  today,
9593
9594
  onSelectAppointment
9594
9595
  }) {
9595
- const todayDate = /* @__PURE__ */ new Date(today + "T00:00:00");
9596
- const grid = generateMonthGrid(todayDate.getFullYear(), todayDate.getMonth());
9596
+ const vd = /* @__PURE__ */ new Date(viewDate + "T00:00:00");
9597
+ const grid = generateMonthGrid(vd.getFullYear(), vd.getMonth());
9597
9598
  const toIso = (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
9598
9599
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-col", children: [
9599
9600
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "grid grid-cols-7 border-b border-border", children: MONTH_DAY_HEADERS.map((d) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
@@ -9662,15 +9663,18 @@ function AppointmentCalendarView({
9662
9663
  periodLabel,
9663
9664
  weekDays,
9664
9665
  hours = DEFAULT_HOURS,
9666
+ viewDate,
9665
9667
  dayViewDate,
9666
9668
  defaultView = "week",
9667
9669
  onPrev,
9668
9670
  onNext,
9669
9671
  onToday,
9672
+ onViewChange,
9670
9673
  onSelectAppointment,
9671
9674
  toolbarActions
9672
9675
  }) {
9673
- const dayDate = dayViewDate != null ? dayViewDate : today;
9676
+ var _a;
9677
+ const effectiveViewDate = (_a = viewDate != null ? viewDate : dayViewDate) != null ? _a : today;
9674
9678
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-col border border-border bg-card", children: [
9675
9679
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center justify-between gap-4 px-4 py-3", children: [
9676
9680
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-2", children: [
@@ -9700,41 +9704,57 @@ function AppointmentCalendarView({
9700
9704
  toolbarActions && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex items-center gap-2", children: toolbarActions })
9701
9705
  ] }),
9702
9706
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Separator, {}),
9703
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Tabs, { defaultValue: defaultView, className: "flex flex-col", children: [
9704
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "px-4 pt-3", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(TabsList, { children: [
9705
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TabsTrigger, { value: "day", children: "Day" }),
9706
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TabsTrigger, { value: "week", children: "Week" }),
9707
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TabsTrigger, { value: "month", children: "Month" })
9708
- ] }) }),
9709
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TabsContent, { value: "day", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
9710
- DayView,
9711
- {
9712
- appointments,
9713
- date: dayDate,
9714
- today,
9715
- hours,
9716
- onSelectAppointment
9717
- }
9718
- ) }),
9719
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TabsContent, { value: "week", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
9720
- WeekView,
9721
- {
9722
- appointments,
9723
- weekDays,
9724
- today,
9725
- hours,
9726
- onSelectAppointment
9727
- }
9728
- ) }),
9729
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TabsContent, { value: "month", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
9730
- MonthView,
9731
- {
9732
- appointments,
9733
- today,
9734
- onSelectAppointment
9735
- }
9736
- ) })
9737
- ] })
9707
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
9708
+ Tabs,
9709
+ {
9710
+ defaultValue: defaultView,
9711
+ onValueChange: (v) => onViewChange == null ? void 0 : onViewChange(v),
9712
+ className: "flex flex-col",
9713
+ children: [
9714
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "px-4 pt-3", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(TabsList, { children: [
9715
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TabsTrigger, { value: "day", children: "Day" }),
9716
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TabsTrigger, { value: "week", children: "Week" }),
9717
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TabsTrigger, { value: "month", children: "Month" })
9718
+ ] }) }),
9719
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TabsContent, { value: "day", className: "mt-0 max-h-[75vh] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
9720
+ DayView,
9721
+ {
9722
+ appointments,
9723
+ date: effectiveViewDate,
9724
+ today,
9725
+ hours,
9726
+ onSelectAppointment
9727
+ }
9728
+ ) }),
9729
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TabsContent, { value: "week", className: "mt-0 max-h-[75vh] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
9730
+ WeekView,
9731
+ {
9732
+ appointments,
9733
+ weekDays,
9734
+ today,
9735
+ hours,
9736
+ onSelectAppointment
9737
+ }
9738
+ ) }),
9739
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
9740
+ TabsContent,
9741
+ {
9742
+ value: "month",
9743
+ className: "mt-0 max-h-[75vh] overflow-y-auto",
9744
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
9745
+ MonthView,
9746
+ {
9747
+ appointments,
9748
+ viewDate: effectiveViewDate,
9749
+ today,
9750
+ onSelectAppointment
9751
+ }
9752
+ )
9753
+ }
9754
+ )
9755
+ ]
9756
+ }
9757
+ )
9738
9758
  ] });
9739
9759
  }
9740
9760
 
package/dist/index.mjs CHANGED
@@ -379,7 +379,7 @@ import {
379
379
  } from "./chunk-ISUA7DSB.mjs";
380
380
  import {
381
381
  AppointmentCalendarView
382
- } from "./chunk-XVZGXPIX.mjs";
382
+ } from "./chunk-Z2BW5T7P.mjs";
383
383
  import {
384
384
  AppointmentDetailSheet
385
385
  } from "./chunk-XUCDPAVI.mjs";