@super-calendar/dom 2.2.0 → 2.3.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.
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", {
@@ -1667,7 +1673,7 @@ function PickerShell({ open, setOpen, rootRef, triggerRef, theme, slot, label, h
1667
1673
  base: triggerDefault,
1668
1674
  themed: {
1669
1675
  border: `1px solid ${theme.gridLine}`,
1670
- background: theme.eventBackground,
1676
+ background: theme.surface,
1671
1677
  color: hasValue ? theme.text : theme.textMuted,
1672
1678
  opacity: disabled ? .5 : 1
1673
1679
  }
@@ -1683,7 +1689,7 @@ function PickerShell({ open, setOpen, rootRef, triggerRef, theme, slot, label, h
1683
1689
  ...slot("popover", {
1684
1690
  base: popoverDefault,
1685
1691
  themed: {
1686
- background: theme.eventBackground,
1692
+ background: theme.surface,
1687
1693
  border: `1px solid ${theme.gridLine}`
1688
1694
  }
1689
1695
  }),
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", {
@@ -1666,7 +1672,7 @@ function PickerShell({ open, setOpen, rootRef, triggerRef, theme, slot, label, h
1666
1672
  base: triggerDefault,
1667
1673
  themed: {
1668
1674
  border: `1px solid ${theme.gridLine}`,
1669
- background: theme.eventBackground,
1675
+ background: theme.surface,
1670
1676
  color: hasValue ? theme.text : theme.textMuted,
1671
1677
  opacity: disabled ? .5 : 1
1672
1678
  }
@@ -1682,7 +1688,7 @@ function PickerShell({ open, setOpen, rootRef, triggerRef, theme, slot, label, h
1682
1688
  ...slot("popover", {
1683
1689
  base: popoverDefault,
1684
1690
  themed: {
1685
- background: theme.eventBackground,
1691
+ background: theme.surface,
1686
1692
  border: `1px solid ${theme.gridLine}`
1687
1693
  }
1688
1694
  }),
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.1",
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.1"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@legendapp/list": ">=3",
@@ -150,7 +150,7 @@ function PickerShell({
150
150
  base: triggerDefault,
151
151
  themed: {
152
152
  border: `1px solid ${theme.gridLine}`,
153
- background: theme.eventBackground,
153
+ background: theme.surface,
154
154
  color: hasValue ? theme.text : theme.textMuted,
155
155
  opacity: disabled ? 0.5 : 1,
156
156
  },
@@ -166,7 +166,7 @@ function PickerShell({
166
166
  aria-label={ariaLabel}
167
167
  {...slot("popover", {
168
168
  base: popoverDefault,
169
- themed: { background: theme.eventBackground, border: `1px solid ${theme.gridLine}` },
169
+ themed: { background: theme.surface, border: `1px solid ${theme.gridLine}` },
170
170
  })}
171
171
  >
172
172
  {children}
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. */}