@uptrademedia/site-kit 1.0.41 → 1.1.1

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.
@@ -2542,6 +2542,132 @@ var MONTHS = [
2542
2542
  "November",
2543
2543
  "December"
2544
2544
  ];
2545
+ function formatDateForTooltip(dateStr) {
2546
+ const d = new Date(dateStr);
2547
+ return d.toLocaleDateString("en-US", { weekday: "short", month: "short", day: "numeric", year: "numeric" });
2548
+ }
2549
+ function CalendarEventCell({
2550
+ item,
2551
+ eventDisplay,
2552
+ eventClassName,
2553
+ onEventClick,
2554
+ formatTime: formatTime2
2555
+ }) {
2556
+ const [hover, setHover] = React5.useState(false);
2557
+ const { event, schedule } = item;
2558
+ const imageUrl = event.featured_image_url;
2559
+ if (eventDisplay === "image") {
2560
+ return /* @__PURE__ */ jsxs(
2561
+ "div",
2562
+ {
2563
+ className: `site-kit-calendar-event-image-wrapper ${eventClassName}`,
2564
+ style: { position: "relative" },
2565
+ onMouseEnter: () => setHover(true),
2566
+ onMouseLeave: () => setHover(false),
2567
+ children: [
2568
+ /* @__PURE__ */ jsx(
2569
+ "button",
2570
+ {
2571
+ onClick: onEventClick,
2572
+ className: `site-kit-calendar-event site-kit-calendar-event-image ${eventClassName}`,
2573
+ style: {
2574
+ display: "block",
2575
+ width: "100%",
2576
+ height: "28px",
2577
+ padding: 0,
2578
+ border: "none",
2579
+ borderRadius: "4px",
2580
+ cursor: "pointer",
2581
+ overflow: "hidden",
2582
+ background: imageUrl ? "transparent" : "#dbeafe"
2583
+ },
2584
+ children: imageUrl ? /* @__PURE__ */ jsx(
2585
+ "img",
2586
+ {
2587
+ src: imageUrl,
2588
+ alt: event.name,
2589
+ style: {
2590
+ width: "100%",
2591
+ height: "100%",
2592
+ objectFit: "cover"
2593
+ }
2594
+ }
2595
+ ) : /* @__PURE__ */ jsx("span", { style: {
2596
+ fontSize: "0.65rem",
2597
+ color: "#1d4ed8",
2598
+ fontWeight: 500,
2599
+ padding: "2px 4px",
2600
+ display: "block",
2601
+ overflow: "hidden",
2602
+ textOverflow: "ellipsis",
2603
+ whiteSpace: "nowrap"
2604
+ }, children: event.name })
2605
+ }
2606
+ ),
2607
+ /* @__PURE__ */ jsxs(
2608
+ "div",
2609
+ {
2610
+ className: "site-kit-calendar-event-tooltip",
2611
+ style: {
2612
+ position: "absolute",
2613
+ bottom: "100%",
2614
+ left: "50%",
2615
+ transform: "translateX(-50%) translateY(-4px)",
2616
+ padding: "8px 12px",
2617
+ background: "#1f2937",
2618
+ color: "white",
2619
+ borderRadius: "8px",
2620
+ fontSize: "0.75rem",
2621
+ minWidth: "180px",
2622
+ maxWidth: "220px",
2623
+ boxShadow: "0 4px 12px rgba(0,0,0,0.2)",
2624
+ pointerEvents: "none",
2625
+ opacity: hover ? 1 : 0,
2626
+ visibility: hover ? "visible" : "hidden",
2627
+ transition: "opacity 0.15s, visibility 0.15s",
2628
+ zIndex: 50
2629
+ },
2630
+ children: [
2631
+ /* @__PURE__ */ jsx("div", { style: { fontWeight: 600, marginBottom: "4px" }, children: event.name }),
2632
+ /* @__PURE__ */ jsxs("div", { style: { opacity: 0.9, fontSize: "0.7rem" }, children: [
2633
+ formatDateForTooltip(schedule.starts_at),
2634
+ " \u2022 ",
2635
+ formatTime2(schedule.starts_at)
2636
+ ] }),
2637
+ event.location && /* @__PURE__ */ jsx("div", { style: { opacity: 0.8, fontSize: "0.65rem", marginTop: "2px" }, children: event.location })
2638
+ ]
2639
+ }
2640
+ )
2641
+ ]
2642
+ }
2643
+ );
2644
+ }
2645
+ return /* @__PURE__ */ jsx(
2646
+ "button",
2647
+ {
2648
+ onClick: onEventClick,
2649
+ className: `site-kit-calendar-event ${eventClassName}`,
2650
+ style: {
2651
+ display: "block",
2652
+ width: "100%",
2653
+ padding: "2px 4px",
2654
+ fontSize: "0.7rem",
2655
+ fontWeight: 500,
2656
+ textAlign: "left",
2657
+ border: "none",
2658
+ borderRadius: "3px",
2659
+ background: "#dbeafe",
2660
+ color: "#1d4ed8",
2661
+ cursor: "pointer",
2662
+ overflow: "hidden",
2663
+ whiteSpace: "nowrap",
2664
+ textOverflow: "ellipsis"
2665
+ },
2666
+ title: `${event.name} - ${formatTime2(schedule.starts_at)}`,
2667
+ children: event.name
2668
+ }
2669
+ );
2670
+ }
2545
2671
  function CalendarView({
2546
2672
  events: propEvents,
2547
2673
  initialDate,
@@ -2553,6 +2679,7 @@ function CalendarView({
2553
2679
  weekStartsOn = 0,
2554
2680
  minDate,
2555
2681
  maxDate,
2682
+ eventDisplay = "image",
2556
2683
  className = "",
2557
2684
  headerClassName = "",
2558
2685
  dayClassName = "",
@@ -2783,29 +2910,14 @@ function CalendarView({
2783
2910
  background: day.isToday ? "#2563eb" : "transparent"
2784
2911
  }, children: day.date.getDate() }) }),
2785
2912
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [
2786
- day.events.slice(0, 3).map((item, eventIndex) => /* @__PURE__ */ jsx(
2787
- "button",
2913
+ day.events.slice(0, 3).map((item) => /* @__PURE__ */ jsx(
2914
+ CalendarEventCell,
2788
2915
  {
2789
- onClick: (e) => handleEventClick(e, item.event, item.schedule),
2790
- className: `site-kit-calendar-event ${eventClassName}`,
2791
- style: {
2792
- display: "block",
2793
- width: "100%",
2794
- padding: "2px 4px",
2795
- fontSize: "0.7rem",
2796
- fontWeight: 500,
2797
- textAlign: "left",
2798
- border: "none",
2799
- borderRadius: "3px",
2800
- background: "#dbeafe",
2801
- color: "#1d4ed8",
2802
- cursor: "pointer",
2803
- overflow: "hidden",
2804
- whiteSpace: "nowrap",
2805
- textOverflow: "ellipsis"
2806
- },
2807
- title: `${item.event.name} - ${formatTime(item.schedule.starts_at)}`,
2808
- children: item.event.name
2916
+ item,
2917
+ eventDisplay,
2918
+ eventClassName,
2919
+ onEventClick: (e) => handleEventClick(e, item.event, item.schedule),
2920
+ formatTime
2809
2921
  },
2810
2922
  `${item.event.id}-${item.schedule.id}`
2811
2923
  )),
@@ -3764,10 +3876,11 @@ function EventsWidget({
3764
3876
  }
3765
3877
  ),
3766
3878
  effectiveView === "list" ? /* @__PURE__ */ jsxs("div", { className: `site-kit-events-list ${listClassName}`, children: [
3767
- /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "1rem" }, children: displayEvents.map((eventItem) => {
3879
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "1rem" }, children: displayEvents.map((eventItem, index) => {
3768
3880
  const nextSchedule = eventItem.next_schedule || eventItem.schedules?.[0];
3769
3881
  const isFree = !eventItem.price || eventItem.price === 0;
3770
3882
  const imageUrl = eventItem.featured_image_url;
3883
+ const uniqueKey = nextSchedule ? `${eventItem.id}-${nextSchedule.id}` : `${eventItem.id}-${index}`;
3771
3884
  return /* @__PURE__ */ jsxs(
3772
3885
  "div",
3773
3886
  {
@@ -3877,7 +3990,7 @@ function EventsWidget({
3877
3990
  ] })
3878
3991
  ]
3879
3992
  },
3880
- eventItem.id
3993
+ uniqueKey
3881
3994
  );
3882
3995
  }) }),
3883
3996
  showViewAll && events.length > limit && /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginTop: "1.5rem" }, children: /* @__PURE__ */ jsx(
@@ -3903,10 +4016,11 @@ function EventsWidget({
3903
4016
  display: "grid",
3904
4017
  gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))",
3905
4018
  gap: "1.25rem"
3906
- }, children: displayEvents.map((eventItem) => {
4019
+ }, children: displayEvents.map((eventItem, index) => {
3907
4020
  const nextSchedule = eventItem.next_schedule || eventItem.schedules?.[0];
3908
4021
  const isFree = !eventItem.price || eventItem.price === 0;
3909
4022
  const imageUrl = eventItem.featured_image_url;
4023
+ const uniqueKey = nextSchedule ? `${eventItem.id}-${nextSchedule.id}` : `${eventItem.id}-${index}`;
3910
4024
  return /* @__PURE__ */ jsxs(
3911
4025
  "div",
3912
4026
  {
@@ -3971,7 +4085,7 @@ function EventsWidget({
3971
4085
  ] })
3972
4086
  ]
3973
4087
  },
3974
- eventItem.id
4088
+ uniqueKey
3975
4089
  );
3976
4090
  }) }),
3977
4091
  showViewAll && events.length > limit && /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginTop: "1.5rem" }, children: /* @__PURE__ */ jsx(
@@ -4031,5 +4145,5 @@ function getApiKey() {
4031
4145
  }
4032
4146
 
4033
4147
  export { CalendarView, CheckoutForm, EventCalendar, EventEmbed, EventModal, EventTile, EventsWidget, OfferingCard, OfferingList, ProductDetail, ProductEmbed, ProductGrid, ProductPage, RegistrationForm, UpcomingEvents, createCheckoutSession, fetchActiveProcessor, fetchCategories, fetchLatestOffering, fetchNextEvent, fetchOffering, fetchOfferings, fetchProcessorConfig, fetchProductBySlug, fetchProducts, fetchProductsPublic, fetchServices, fetchUpcomingEvents, formatDate, formatDateRange, formatDateTime, formatPrice, formatTime, getOfferingUrl, getRelativeTimeUntil, getSpotsRemaining, isEventSoldOut, registerForEvent, useEventModal };
4034
- //# sourceMappingURL=chunk-SONJCT7Z.mjs.map
4035
- //# sourceMappingURL=chunk-SONJCT7Z.mjs.map
4148
+ //# sourceMappingURL=chunk-TI5CH4WT.mjs.map
4149
+ //# sourceMappingURL=chunk-TI5CH4WT.mjs.map