@super-calendar/dom 2.2.0 → 2.3.0

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 CHANGED
@@ -1218,13 +1218,19 @@ function TimeGrid({ date, events = [], mode = "day", numberOfDays = 1, weekStart
1218
1218
  onPointerMove: cellEnabled ? moveCreate : void 0,
1219
1219
  onPointerUp: cellEnabled ? endCreate : void 0,
1220
1220
  onPointerCancel: cellEnabled ? cancelCreate : void 0,
1221
- ...dataState({ "data-today": (0, _super_calendar_core.getIsToday)(day) }),
1221
+ ...dataState({
1222
+ "data-today": (0, _super_calendar_core.getIsToday)(day),
1223
+ "data-weekend": (0, _super_calendar_core.isWeekend)(day)
1224
+ }),
1222
1225
  ...slot("dayColumn", {
1223
1226
  base: {
1224
1227
  flex: 1,
1225
1228
  position: "relative"
1226
1229
  },
1227
- themed: { borderLeft: `1px solid ${theme.gridLine}` }
1230
+ themed: {
1231
+ borderLeft: `1px solid ${theme.gridLine}`,
1232
+ ...(0, _super_calendar_core.isWeekend)(day) ? { background: theme.weekendBackground } : null
1233
+ }
1228
1234
  }),
1229
1235
  children: [
1230
1236
  bands.map((b) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LegendList } from "@legendapp/list/react";
2
2
  import { addDays, addMinutes, addMonths, endOfMonth, format, isSameDay, isSameMonth, startOfDay, startOfMonth } from "date-fns";
3
3
  import { useEffect, useId, useMemo, useRef, useState } from "react";
4
- import { bandRounding, buildMonthGrid, buildMonthGrid as buildMonthGrid$1, cellRangeFromDrag, closedHourBands, compareDayEvents, darkColors, dayBadgeKind, daySelectionState, eventAccessibilityLabel, eventChipLayout, eventTimeLabel, expandRecurringEvents, formatHour, getIsToday, getViewDays, getViewDays as getViewDays$1, groupEventsByDay, isAllDayEvent, isAllDayEvent as isAllDayEvent$1, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWithinDateRange, layoutDayEvents, layoutDayEvents as layoutDayEvents$1, lightColors, monthVisibleCount, nextDateRange, nextDateRange as nextDateRange$1, parseICalendar, rangeBandKind, titleNumberOfLines, toICalendar, useDateRange, useMonthGrid, weekdayFormatToken, weekdayFormatToken as weekdayFormatToken$1 } from "@super-calendar/core";
4
+ import { bandRounding, buildMonthGrid, buildMonthGrid as buildMonthGrid$1, cellRangeFromDrag, closedHourBands, compareDayEvents, darkColors, dayBadgeKind, daySelectionState, eventAccessibilityLabel, eventChipLayout, eventTimeLabel, expandRecurringEvents, formatHour, getIsToday, getViewDays, getViewDays as getViewDays$1, groupEventsByDay, isAllDayEvent, isAllDayEvent as isAllDayEvent$1, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutDayEvents as layoutDayEvents$1, lightColors, monthVisibleCount, nextDateRange, nextDateRange as nextDateRange$1, parseICalendar, rangeBandKind, titleNumberOfLines, toICalendar, useDateRange, useMonthGrid, weekdayFormatToken, weekdayFormatToken as weekdayFormatToken$1 } from "@super-calendar/core";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/slots.ts
7
7
  /** Join truthy class names (a dependency-free clsx-lite). */
@@ -1217,13 +1217,19 @@ function TimeGrid({ date, events = [], mode = "day", numberOfDays = 1, weekStart
1217
1217
  onPointerMove: cellEnabled ? moveCreate : void 0,
1218
1218
  onPointerUp: cellEnabled ? endCreate : void 0,
1219
1219
  onPointerCancel: cellEnabled ? cancelCreate : void 0,
1220
- ...dataState({ "data-today": getIsToday(day) }),
1220
+ ...dataState({
1221
+ "data-today": getIsToday(day),
1222
+ "data-weekend": isWeekend(day)
1223
+ }),
1221
1224
  ...slot("dayColumn", {
1222
1225
  base: {
1223
1226
  flex: 1,
1224
1227
  position: "relative"
1225
1228
  },
1226
- themed: { borderLeft: `1px solid ${theme.gridLine}` }
1229
+ themed: {
1230
+ borderLeft: `1px solid ${theme.gridLine}`,
1231
+ ...isWeekend(day) ? { background: theme.weekendBackground } : null
1232
+ }
1227
1233
  }),
1228
1234
  children: [
1229
1235
  bands.map((b) => /* @__PURE__ */ jsx("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@super-calendar/dom",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Virtualized month / week / day calendar and date picker for react-dom. No React Native, no react-native-web.",
5
5
  "keywords": [
6
6
  "calendar",
@@ -48,7 +48,7 @@
48
48
  "access": "public"
49
49
  },
50
50
  "dependencies": {
51
- "@super-calendar/core": "2.2.0"
51
+ "@super-calendar/core": "2.3.0"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@legendapp/list": ">=3",
package/src/TimeGrid.tsx CHANGED
@@ -25,6 +25,7 @@ import {
25
25
  getViewDays,
26
26
  isAllDayEvent,
27
27
  isSameCalendarDay,
28
+ isWeekend,
28
29
  layoutDayEvents,
29
30
  type TimeGridMode,
30
31
  titleNumberOfLines,
@@ -770,10 +771,15 @@ export function TimeGrid<T = unknown>({
770
771
  onPointerMove={cellEnabled ? moveCreate : undefined}
771
772
  onPointerUp={cellEnabled ? endCreate : undefined}
772
773
  onPointerCancel={cellEnabled ? cancelCreate : undefined}
773
- {...dataState({ "data-today": getIsToday(day) })}
774
+ {...dataState({ "data-today": getIsToday(day), "data-weekend": isWeekend(day) })}
774
775
  {...slot("dayColumn", {
775
776
  base: { flex: 1, position: "relative" },
776
- themed: { borderLeft: `1px solid ${theme.gridLine}` },
777
+ // Weekend columns are tinted (matching the native renderer); the
778
+ // tint sits behind the grid lines, business-hours shade and events.
779
+ themed: {
780
+ borderLeft: `1px solid ${theme.gridLine}`,
781
+ ...(isWeekend(day) ? { background: theme.weekendBackground } : null),
782
+ },
777
783
  })}
778
784
  >
779
785
  {/* Business-hours shade, behind the grid lines and events. */}