@super-calendar/native 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.
@@ -1,8 +1,8 @@
1
1
  import { Locale } from "date-fns";
2
2
  import { ComponentType, ReactElement } from "react";
3
+ import { StyleProp, TextStyle, ViewStyle } from "react-native";
3
4
  import { SharedValue } from "react-native-reanimated";
4
5
  import { BusinessHours, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarMode, CalendarMode as CalendarMode$1, DateRange, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, EventKeyExtractor, ICalendarEvent, RecurrenceFrequency, RecurrenceRule, TimeGridMode, WeekStartsOn, WeekdayFormat, WeekdayFormat as WeekdayFormat$1 } from "@super-calendar/core";
5
- import { StyleProp, TextStyle, ViewStyle } from "react-native";
6
6
 
7
7
  //#region src/theme.d.ts
8
8
  /**
@@ -15,7 +15,8 @@ interface CalendarTheme {
15
15
  colors: CalendarColors;
16
16
  /** Text styles for the calendar's labels and the built-in event box. */
17
17
  text: {
18
- /** Large day number in the week/day header. */dayNumber: TextStyle; /** Short weekday label ("Mon") in headers. */
18
+ /** The day number in a time-grid (week/day) column header. */dayNumber: TextStyle; /** The weekday label ("Mon") in a time-grid column header. */
19
+ columnHeaderWeekday: TextStyle; /** Short weekday label ("Mon") in the month grid's header row. */
19
20
  weekday: TextStyle; /** The "MMMM yyyy" month title above the month grid. */
20
21
  monthTitle: TextStyle; /** Date number inside a month cell. */
21
22
  dateCell: TextStyle; /** Hour labels down the left of the time grid. */
@@ -36,7 +37,8 @@ interface CalendarTheme {
36
37
  dayCell: ViewStyle; /** The date badge (the circle) inside a month day cell. */
37
38
  dayBadge: ViewStyle; /** An event chip inside a month day cell. */
38
39
  monthEvent: ViewStyle; /** Each day's column header in the time grid. */
39
- columnHeader: ViewStyle; /** A timed event's positioned box in the time grid (and resource timeline). */
40
+ columnHeader: ViewStyle; /** The day-number badge (the circle) inside a time-grid column header. */
41
+ columnHeaderBadge: ViewStyle; /** A timed event's positioned box in the time grid (and resource timeline). */
40
42
  timeGridEvent: ViewStyle; /** The current-time indicator line. */
41
43
  nowIndicator: ViewStyle; /** Each resource row in the resource timeline. */
42
44
  resourceRow: ViewStyle; /** The left-hand resource-label cell in the resource timeline. */
@@ -1,8 +1,8 @@
1
1
  import { Locale } from "date-fns";
2
2
  import { ComponentType, ReactElement } from "react";
3
- import { StyleProp, TextStyle, ViewStyle } from "react-native";
4
3
  import { SharedValue } from "react-native-reanimated";
5
4
  import { BusinessHours, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarMode, CalendarMode as CalendarMode$1, DateRange, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, EventKeyExtractor, ICalendarEvent, RecurrenceFrequency, RecurrenceRule, TimeGridMode, WeekStartsOn, WeekdayFormat, WeekdayFormat as WeekdayFormat$1 } from "@super-calendar/core";
5
+ import { StyleProp, TextStyle, ViewStyle } from "react-native";
6
6
 
7
7
  //#region src/theme.d.ts
8
8
  /**
@@ -15,7 +15,8 @@ interface CalendarTheme {
15
15
  colors: CalendarColors;
16
16
  /** Text styles for the calendar's labels and the built-in event box. */
17
17
  text: {
18
- /** Large day number in the week/day header. */dayNumber: TextStyle; /** Short weekday label ("Mon") in headers. */
18
+ /** The day number in a time-grid (week/day) column header. */dayNumber: TextStyle; /** The weekday label ("Mon") in a time-grid column header. */
19
+ columnHeaderWeekday: TextStyle; /** Short weekday label ("Mon") in the month grid's header row. */
19
20
  weekday: TextStyle; /** The "MMMM yyyy" month title above the month grid. */
20
21
  monthTitle: TextStyle; /** Date number inside a month cell. */
21
22
  dateCell: TextStyle; /** Hour labels down the left of the time grid. */
@@ -36,7 +37,8 @@ interface CalendarTheme {
36
37
  dayCell: ViewStyle; /** The date badge (the circle) inside a month day cell. */
37
38
  dayBadge: ViewStyle; /** An event chip inside a month day cell. */
38
39
  monthEvent: ViewStyle; /** Each day's column header in the time grid. */
39
- columnHeader: ViewStyle; /** A timed event's positioned box in the time grid (and resource timeline). */
40
+ columnHeader: ViewStyle; /** The day-number badge (the circle) inside a time-grid column header. */
41
+ columnHeaderBadge: ViewStyle; /** A timed event's positioned box in the time grid (and resource timeline). */
40
42
  timeGridEvent: ViewStyle; /** The current-time indicator line. */
41
43
  nowIndicator: ViewStyle; /** Each resource row in the resource timeline. */
42
44
  resourceRow: ViewStyle; /** The left-hand resource-label cell in the resource timeline. */
@@ -11,8 +11,12 @@ const defaultTheme = {
11
11
  colors: lightColors,
12
12
  text: {
13
13
  dayNumber: {
14
- fontSize: 22,
15
- fontWeight: "700"
14
+ fontSize: 15,
15
+ fontWeight: "600"
16
+ },
17
+ columnHeaderWeekday: {
18
+ fontSize: 11,
19
+ fontWeight: "600"
16
20
  },
17
21
  weekday: {
18
22
  fontSize: 13,
@@ -45,6 +49,7 @@ const defaultTheme = {
45
49
  dayBadge: {},
46
50
  monthEvent: {},
47
51
  columnHeader: {},
52
+ columnHeaderBadge: {},
48
53
  timeGridEvent: {},
49
54
  nowIndicator: {},
50
55
  resourceRow: {},
@@ -11,8 +11,12 @@ const defaultTheme = {
11
11
  colors: _super_calendar_core.lightColors,
12
12
  text: {
13
13
  dayNumber: {
14
- fontSize: 22,
15
- fontWeight: "700"
14
+ fontSize: 15,
15
+ fontWeight: "600"
16
+ },
17
+ columnHeaderWeekday: {
18
+ fontSize: 11,
19
+ fontWeight: "600"
16
20
  },
17
21
  weekday: {
18
22
  fontSize: 13,
@@ -45,6 +49,7 @@ const defaultTheme = {
45
49
  dayBadge: {},
46
50
  monthEvent: {},
47
51
  columnHeader: {},
52
+ columnHeaderBadge: {},
48
53
  timeGridEvent: {},
49
54
  nowIndicator: {},
50
55
  resourceRow: {},
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as CalendarThemeProvider, D as mergeTheme, E as defaultTheme, O as useCalendarTheme, S as CalendarTheme, T as darkTheme, _ as RenderEvent, a as MonthPagerProps, b as WeekStartsOn, c as BusinessHours, d as EventAccessibilityLabelContext, f as EventAccessibilityLabeler, g as RecurrenceRule, h as RecurrenceFrequency, i as MonthPager, l as CalendarEvent, m as ICalendarEvent, n as MonthList, o as MonthView, p as EventKeyExtractor, r as MonthListProps, s as MonthViewProps, t as DefaultMonthEvent, u as CalendarMode, v as RenderEventArgs, w as PartialCalendarTheme, x as WeekdayFormat, y as TimeGridMode } from "./DefaultMonthEvent-BlfDkmF5.mjs";
1
+ import { C as CalendarThemeProvider, D as mergeTheme, E as defaultTheme, O as useCalendarTheme, S as CalendarTheme, T as darkTheme, _ as RenderEvent, a as MonthPagerProps, b as WeekStartsOn, c as BusinessHours, d as EventAccessibilityLabelContext, f as EventAccessibilityLabeler, g as RecurrenceRule, h as RecurrenceFrequency, i as MonthPager, l as CalendarEvent, m as ICalendarEvent, n as MonthList, o as MonthView, p as EventKeyExtractor, r as MonthListProps, s as MonthViewProps, t as DefaultMonthEvent, u as CalendarMode, v as RenderEventArgs, w as PartialCalendarTheme, x as WeekdayFormat, y as TimeGridMode } from "./DefaultMonthEvent-BbCMc60z.mjs";
2
2
  import { Locale } from "date-fns";
3
3
  import { ComponentType, ReactElement } from "react";
4
4
  import { SharedValue, useSharedValue } from "react-native-reanimated";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as CalendarThemeProvider, D as mergeTheme, E as defaultTheme, O as useCalendarTheme, S as CalendarTheme, T as darkTheme, _ as RenderEvent, a as MonthPagerProps, b as WeekStartsOn, c as BusinessHours, d as EventAccessibilityLabelContext, f as EventAccessibilityLabeler, g as RecurrenceRule, h as RecurrenceFrequency, i as MonthPager, l as CalendarEvent, m as ICalendarEvent, n as MonthList, o as MonthView, p as EventKeyExtractor, r as MonthListProps, s as MonthViewProps, t as DefaultMonthEvent, u as CalendarMode, v as RenderEventArgs, w as PartialCalendarTheme, x as WeekdayFormat, y as TimeGridMode } from "./DefaultMonthEvent-Cagj4aBo.js";
1
+ import { C as CalendarThemeProvider, D as mergeTheme, E as defaultTheme, O as useCalendarTheme, S as CalendarTheme, T as darkTheme, _ as RenderEvent, a as MonthPagerProps, b as WeekStartsOn, c as BusinessHours, d as EventAccessibilityLabelContext, f as EventAccessibilityLabeler, g as RecurrenceRule, h as RecurrenceFrequency, i as MonthPager, l as CalendarEvent, m as ICalendarEvent, n as MonthList, o as MonthView, p as EventKeyExtractor, r as MonthListProps, s as MonthViewProps, t as DefaultMonthEvent, u as CalendarMode, v as RenderEventArgs, w as PartialCalendarTheme, x as WeekdayFormat, y as TimeGridMode } from "./DefaultMonthEvent-BW6qy50X.js";
2
2
  import { Locale } from "date-fns";
3
3
  import { ComponentType, ReactElement } from "react";
4
4
  import { StyleProp, ViewStyle } from "react-native";
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  //#endregion
24
- const require_MonthList = require("./MonthList-DWAjW5R7.js");
24
+ const require_MonthList = require("./MonthList-CFXm7BK_.js");
25
25
  let date_fns = require("date-fns");
26
26
  let react = require("react");
27
27
  let react_native_reanimated = require("react-native-reanimated");
@@ -1357,14 +1357,20 @@ const DayHeader = ({ day, width, weekdayFormat = "short", locale, activeDate, on
1357
1357
  onPress: onPressDateHeader ? () => onPressDateHeader(day) : void 0,
1358
1358
  disabled: !onPressDateHeader,
1359
1359
  accessibilityRole: onPressDateHeader ? "button" : void 0,
1360
+ accessibilityLabel: onPressDateHeader ? (0, date_fns.format)(day, "EEEE d MMMM", { locale }) : void 0,
1360
1361
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Text, {
1361
- style: [styles$1.dayHeaderWeekday, { color: theme.colors.textMuted }],
1362
+ style: [{ color: theme.colors.textMuted }, theme.text.columnHeaderWeekday],
1362
1363
  allowFontScaling: false,
1363
1364
  children: (0, date_fns.format)(day, (0, _super_calendar_core.weekdayFormatToken)(weekdayFormat), { locale })
1364
1365
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
1365
- style: [styles$1.dayHeaderBadge, isHighlighted && { backgroundColor: theme.colors.todayBackground }],
1366
+ testID: "column-header-badge",
1367
+ style: [
1368
+ styles$1.dayHeaderBadge,
1369
+ theme.containers.columnHeaderBadge,
1370
+ isHighlighted && { backgroundColor: theme.colors.todayBackground }
1371
+ ],
1366
1372
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Text, {
1367
- style: [styles$1.dayHeaderNumber, { color: isHighlighted ? theme.colors.todayText : theme.colors.text }],
1373
+ style: [theme.text.dayNumber, { color: isHighlighted ? theme.colors.todayText : theme.colors.text }],
1368
1374
  allowFontScaling: false,
1369
1375
  ...isToday && { accessibilityLabel: `Today, ${day.getDate()}` },
1370
1376
  children: day.getDate()
@@ -1390,10 +1396,6 @@ const styles$1 = react_native.StyleSheet.create({
1390
1396
  gap: 2,
1391
1397
  paddingVertical: 6
1392
1398
  },
1393
- dayHeaderWeekday: {
1394
- fontSize: 11,
1395
- fontWeight: "600"
1396
- },
1397
1399
  dayHeaderBadge: {
1398
1400
  width: 28,
1399
1401
  height: 28,
@@ -1401,10 +1403,6 @@ const styles$1 = react_native.StyleSheet.create({
1401
1403
  justifyContent: "center",
1402
1404
  alignItems: "center"
1403
1405
  },
1404
- dayHeaderNumber: {
1405
- fontSize: 15,
1406
- fontWeight: "600"
1407
- },
1408
1406
  content: {
1409
1407
  width: "100%",
1410
1408
  position: "relative"
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as withEventAccessibilityLabel, c as darkTheme, d as useCalendarTheme, i as MonthView, l as defaultTheme, n as DefaultMonthEvent, o as useWebPagerKeys, r as MonthPager, s as CalendarThemeProvider, t as MonthList, u as mergeTheme } from "./MonthList-DZx8rPle.mjs";
1
+ import { a as withEventAccessibilityLabel, c as darkTheme, d as useCalendarTheme, i as MonthView, l as defaultTheme, n as DefaultMonthEvent, o as useWebPagerKeys, r as MonthPager, s as CalendarThemeProvider, t as MonthList, u as mergeTheme } from "./MonthList-BidXJMfm.mjs";
2
2
  import { addDays, differenceInCalendarDays, endOfDay, endOfMonth, endOfWeek, format, getHours, getISOWeek, getMinutes, isSameDay, startOfDay, startOfMonth, startOfWeek } from "date-fns";
3
3
  import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
4
4
  import Animated, { runOnJS, scrollTo, useAnimatedReaction, useAnimatedRef, useAnimatedScrollHandler, useAnimatedStyle, useDerivedValue, useSharedValue } from "react-native-reanimated";
@@ -1333,14 +1333,20 @@ const DayHeader = ({ day, width, weekdayFormat = "short", locale, activeDate, on
1333
1333
  onPress: onPressDateHeader ? () => onPressDateHeader(day) : void 0,
1334
1334
  disabled: !onPressDateHeader,
1335
1335
  accessibilityRole: onPressDateHeader ? "button" : void 0,
1336
+ accessibilityLabel: onPressDateHeader ? format(day, "EEEE d MMMM", { locale }) : void 0,
1336
1337
  children: [/* @__PURE__ */ jsx(Text, {
1337
- style: [styles$1.dayHeaderWeekday, { color: theme.colors.textMuted }],
1338
+ style: [{ color: theme.colors.textMuted }, theme.text.columnHeaderWeekday],
1338
1339
  allowFontScaling: false,
1339
1340
  children: format(day, weekdayFormatToken$1(weekdayFormat), { locale })
1340
1341
  }), /* @__PURE__ */ jsx(View, {
1341
- style: [styles$1.dayHeaderBadge, isHighlighted && { backgroundColor: theme.colors.todayBackground }],
1342
+ testID: "column-header-badge",
1343
+ style: [
1344
+ styles$1.dayHeaderBadge,
1345
+ theme.containers.columnHeaderBadge,
1346
+ isHighlighted && { backgroundColor: theme.colors.todayBackground }
1347
+ ],
1342
1348
  children: /* @__PURE__ */ jsx(Text, {
1343
- style: [styles$1.dayHeaderNumber, { color: isHighlighted ? theme.colors.todayText : theme.colors.text }],
1349
+ style: [theme.text.dayNumber, { color: isHighlighted ? theme.colors.todayText : theme.colors.text }],
1344
1350
  allowFontScaling: false,
1345
1351
  ...isToday && { accessibilityLabel: `Today, ${day.getDate()}` },
1346
1352
  children: day.getDate()
@@ -1366,10 +1372,6 @@ const styles$1 = StyleSheet.create({
1366
1372
  gap: 2,
1367
1373
  paddingVertical: 6
1368
1374
  },
1369
- dayHeaderWeekday: {
1370
- fontSize: 11,
1371
- fontWeight: "600"
1372
- },
1373
1375
  dayHeaderBadge: {
1374
1376
  width: 28,
1375
1377
  height: 28,
@@ -1377,10 +1379,6 @@ const styles$1 = StyleSheet.create({
1377
1379
  justifyContent: "center",
1378
1380
  alignItems: "center"
1379
1381
  },
1380
- dayHeaderNumber: {
1381
- fontSize: 15,
1382
- fontWeight: "600"
1383
- },
1384
1382
  content: {
1385
1383
  width: "100%",
1386
1384
  position: "relative"
package/dist/picker.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { C as CalendarThemeProvider, D as mergeTheme, E as defaultTheme, O as useCalendarTheme, S as CalendarTheme, T as darkTheme, _ as RenderEvent, a as MonthPagerProps, b as WeekStartsOn, i as MonthPager, l as CalendarEvent, m as ICalendarEvent, n as MonthList, o as MonthView, p as EventKeyExtractor, r as MonthListProps, s as MonthViewProps, t as DefaultMonthEvent, u as CalendarMode, v as RenderEventArgs, w as PartialCalendarTheme } from "./DefaultMonthEvent-BlfDkmF5.mjs";
1
+ import { C as CalendarThemeProvider, D as mergeTheme, E as defaultTheme, O as useCalendarTheme, S as CalendarTheme, T as darkTheme, _ as RenderEvent, a as MonthPagerProps, b as WeekStartsOn, i as MonthPager, l as CalendarEvent, m as ICalendarEvent, n as MonthList, o as MonthView, p as EventKeyExtractor, r as MonthListProps, s as MonthViewProps, t as DefaultMonthEvent, u as CalendarMode, v as RenderEventArgs, w as PartialCalendarTheme } from "./DefaultMonthEvent-BbCMc60z.mjs";
2
2
  import { DateRange, DateSelectionConstraints, DaySelectionState, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, UseDateRangeOptions, UseMonthGridOptions, buildMonthGrid, buildMonthWeeks, daySelectionState, getIsToday, getWeekDays, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, minutesIntoDay, nextDateRange, useDateRange, useMonthGrid } from "@super-calendar/core";
3
3
  export { type CalendarEvent, type CalendarMode, type CalendarTheme, CalendarThemeProvider, type DateRange, type DateSelectionConstraints, type DaySelectionState, DefaultMonthEvent, type EventKeyExtractor, type ICalendarEvent, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, MonthPager, type MonthPagerProps, MonthView, type MonthViewProps, type PartialCalendarTheme, type RenderEvent, type RenderEventArgs, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, buildMonthGrid, buildMonthWeeks, darkTheme, daySelectionState, defaultTheme, getIsToday, getWeekDays, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, mergeTheme, minutesIntoDay, nextDateRange, useCalendarTheme, useDateRange, useMonthGrid };
package/dist/picker.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { C as CalendarThemeProvider, D as mergeTheme, E as defaultTheme, O as useCalendarTheme, S as CalendarTheme, T as darkTheme, _ as RenderEvent, a as MonthPagerProps, b as WeekStartsOn, i as MonthPager, l as CalendarEvent, m as ICalendarEvent, n as MonthList, o as MonthView, p as EventKeyExtractor, r as MonthListProps, s as MonthViewProps, t as DefaultMonthEvent, u as CalendarMode, v as RenderEventArgs, w as PartialCalendarTheme } from "./DefaultMonthEvent-Cagj4aBo.js";
1
+ import { C as CalendarThemeProvider, D as mergeTheme, E as defaultTheme, O as useCalendarTheme, S as CalendarTheme, T as darkTheme, _ as RenderEvent, a as MonthPagerProps, b as WeekStartsOn, i as MonthPager, l as CalendarEvent, m as ICalendarEvent, n as MonthList, o as MonthView, p as EventKeyExtractor, r as MonthListProps, s as MonthViewProps, t as DefaultMonthEvent, u as CalendarMode, v as RenderEventArgs, w as PartialCalendarTheme } from "./DefaultMonthEvent-BW6qy50X.js";
2
2
  import { DateRange, DateSelectionConstraints, DaySelectionState, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, UseDateRangeOptions, UseMonthGridOptions, buildMonthGrid, buildMonthWeeks, daySelectionState, getIsToday, getWeekDays, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, minutesIntoDay, nextDateRange, useDateRange, useMonthGrid } from "@super-calendar/core";
3
3
  export { type CalendarEvent, type CalendarMode, type CalendarTheme, CalendarThemeProvider, type DateRange, type DateSelectionConstraints, type DaySelectionState, DefaultMonthEvent, type EventKeyExtractor, type ICalendarEvent, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, MonthPager, type MonthPagerProps, MonthView, type MonthViewProps, type PartialCalendarTheme, type RenderEvent, type RenderEventArgs, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, buildMonthGrid, buildMonthWeeks, darkTheme, daySelectionState, defaultTheme, getIsToday, getWeekDays, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, mergeTheme, minutesIntoDay, nextDateRange, useCalendarTheme, useDateRange, useMonthGrid };
package/dist/picker.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_MonthList = require("./MonthList-DWAjW5R7.js");
2
+ const require_MonthList = require("./MonthList-CFXm7BK_.js");
3
3
  let _super_calendar_core = require("@super-calendar/core");
4
4
  exports.CalendarThemeProvider = require_MonthList.CalendarThemeProvider;
5
5
  exports.DefaultMonthEvent = require_MonthList.DefaultMonthEvent;
package/dist/picker.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { c as darkTheme, d as useCalendarTheme, i as MonthView, l as defaultTheme, n as DefaultMonthEvent, r as MonthPager, s as CalendarThemeProvider, t as MonthList, u as mergeTheme } from "./MonthList-DZx8rPle.mjs";
1
+ import { c as darkTheme, d as useCalendarTheme, i as MonthView, l as defaultTheme, n as DefaultMonthEvent, r as MonthPager, s as CalendarThemeProvider, t as MonthList, u as mergeTheme } from "./MonthList-BidXJMfm.mjs";
2
2
  import { buildMonthGrid, buildMonthWeeks, daySelectionState, getIsToday, getWeekDays, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, minutesIntoDay, nextDateRange, useDateRange, useMonthGrid } from "@super-calendar/core";
3
3
  export { CalendarThemeProvider, DefaultMonthEvent, MonthList, MonthPager, MonthView, buildMonthGrid, buildMonthWeeks, darkTheme, daySelectionState, defaultTheme, getIsToday, getWeekDays, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, mergeTheme, minutesIntoDay, nextDateRange, useCalendarTheme, useDateRange, useMonthGrid };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@super-calendar/native",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "Gesture-driven, virtualized month / week / day calendar and date picker for React Native (and web via react-native-web).",
5
5
  "keywords": [
6
6
  "agenda",
@@ -64,7 +64,7 @@
64
64
  "access": "public"
65
65
  },
66
66
  "dependencies": {
67
- "@super-calendar/core": "2.2.0"
67
+ "@super-calendar/core": "2.3.1"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@legendapp/list": ">=3",
@@ -1852,24 +1852,32 @@ const DayHeader = ({
1852
1852
  onPress={onPressDateHeader ? () => onPressDateHeader(day) : undefined}
1853
1853
  disabled={!onPressDateHeader}
1854
1854
  accessibilityRole={onPressDateHeader ? "button" : undefined}
1855
+ // A pressable header announces the full date it opens; a static one lets
1856
+ // the child labels speak for themselves.
1857
+ accessibilityLabel={onPressDateHeader ? format(day, "EEEE d MMMM", { locale }) : undefined}
1855
1858
  >
1856
1859
  {/* Mirrors the dom renderer's header: the muted weekday label sits above the
1857
- day number, and the number's circle fills for today / the active date. */}
1860
+ day number, and the number's circle fills for today / the active date.
1861
+ Theme text merges after the muted colour so a themed colour wins. */}
1858
1862
  <Text
1859
- style={[styles.dayHeaderWeekday, { color: theme.colors.textMuted }]}
1863
+ style={[{ color: theme.colors.textMuted }, theme.text.columnHeaderWeekday]}
1860
1864
  allowFontScaling={false}
1861
1865
  >
1862
1866
  {format(day, weekdayFormatToken(weekdayFormat), { locale })}
1863
1867
  </Text>
1864
1868
  <View
1869
+ testID="column-header-badge"
1865
1870
  style={[
1866
1871
  styles.dayHeaderBadge,
1872
+ theme.containers.columnHeaderBadge,
1867
1873
  isHighlighted && { backgroundColor: theme.colors.todayBackground },
1868
1874
  ]}
1869
1875
  >
1870
1876
  <Text
1871
1877
  style={[
1872
- styles.dayHeaderNumber,
1878
+ theme.text.dayNumber,
1879
+ // The state colour stays last so a themed dayNumber can't break the
1880
+ // today/active contrast.
1873
1881
  { color: isHighlighted ? theme.colors.todayText : theme.colors.text },
1874
1882
  ]}
1875
1883
  allowFontScaling={false}
@@ -1909,10 +1917,6 @@ const styles = StyleSheet.create({
1909
1917
  gap: 2,
1910
1918
  paddingVertical: 6,
1911
1919
  },
1912
- dayHeaderWeekday: {
1913
- fontSize: 11,
1914
- fontWeight: "600",
1915
- },
1916
1920
  dayHeaderBadge: {
1917
1921
  // A fixed circle so the today/active fill never shifts the header's height.
1918
1922
  width: 28,
@@ -1921,10 +1925,6 @@ const styles = StyleSheet.create({
1921
1925
  justifyContent: "center",
1922
1926
  alignItems: "center",
1923
1927
  },
1924
- dayHeaderNumber: {
1925
- fontSize: 15,
1926
- fontWeight: "600",
1927
- },
1928
1928
  content: {
1929
1929
  width: "100%",
1930
1930
  position: "relative",
package/src/theme.ts CHANGED
@@ -12,9 +12,11 @@ export interface CalendarTheme {
12
12
  colors: CalendarColors;
13
13
  /** Text styles for the calendar's labels and the built-in event box. */
14
14
  text: {
15
- /** Large day number in the week/day header. */
15
+ /** The day number in a time-grid (week/day) column header. */
16
16
  dayNumber: TextStyle;
17
- /** Short weekday label ("Mon") in headers. */
17
+ /** The weekday label ("Mon") in a time-grid column header. */
18
+ columnHeaderWeekday: TextStyle;
19
+ /** Short weekday label ("Mon") in the month grid's header row. */
18
20
  weekday: TextStyle;
19
21
  /** The "MMMM yyyy" month title above the month grid. */
20
22
  monthTitle: TextStyle;
@@ -48,6 +50,8 @@ export interface CalendarTheme {
48
50
  monthEvent: ViewStyle;
49
51
  /** Each day's column header in the time grid. */
50
52
  columnHeader: ViewStyle;
53
+ /** The day-number badge (the circle) inside a time-grid column header. */
54
+ columnHeaderBadge: ViewStyle;
51
55
  /** A timed event's positioned box in the time grid (and resource timeline). */
52
56
  timeGridEvent: ViewStyle;
53
57
  /** The current-time indicator line. */
@@ -78,7 +82,11 @@ export interface CalendarTheme {
78
82
  export const defaultTheme: CalendarTheme = {
79
83
  colors: lightColors,
80
84
  text: {
81
- dayNumber: { fontSize: 22, fontWeight: "700" },
85
+ // Match the header's shipped look: these two previously lived as hardcoded
86
+ // styles in the time-grid header, so honouring the theme changes nothing
87
+ // until a consumer overrides them.
88
+ dayNumber: { fontSize: 15, fontWeight: "600" },
89
+ columnHeaderWeekday: { fontSize: 11, fontWeight: "600" },
82
90
  weekday: { fontSize: 13, fontWeight: "700" },
83
91
  monthTitle: { fontSize: 17, fontWeight: "700" },
84
92
  dateCell: { fontSize: 13, fontWeight: "700" },
@@ -96,6 +104,7 @@ export const defaultTheme: CalendarTheme = {
96
104
  dayBadge: {},
97
105
  monthEvent: {},
98
106
  columnHeader: {},
107
+ columnHeaderBadge: {},
99
108
  timeGridEvent: {},
100
109
  nowIndicator: {},
101
110
  resourceRow: {},