@@ -6,13 +6,20 @@ import {
6
6
CalendarItemEmpty ,
7
7
} from "@/components/CalendarItemDay" ;
8
8
import { CalendarItemWeekName } from "@/components/CalendarItemWeekName" ;
9
- import { CalendarRowMonth } from "@/components/CalendarRowMonth" ;
9
+ import {
10
+ CalendarRowMonth ,
11
+ CalendarRowMonthProps ,
12
+ } from "@/components/CalendarRowMonth" ;
10
13
import { CalendarRowWeek } from "@/components/CalendarRowWeek" ;
11
14
import { VStack } from "@/components/VStack" ;
12
15
import { uppercaseFirstLetter } from "@/helpers/strings" ;
13
16
import { tokens } from "@/helpers/tokens" ;
14
17
import { BuildCalendarParams , useCalendar } from "@/hooks/useCalendar" ;
15
18
19
+ export type CalendarTheme = {
20
+ rowMonthTheme : CalendarRowMonthProps [ "theme" ] ;
21
+ } ;
22
+
16
23
export interface CalendarProps extends BuildCalendarParams {
17
24
onDayPress : ( dateId : string , date : Date ) => void ;
18
25
disabledDates ?: string [ ] ;
@@ -23,6 +30,8 @@ export interface CalendarProps extends BuildCalendarParams {
23
30
* @default 8
24
31
*/
25
32
calendarRowSpacing ?: number ;
33
+ /** Theme to customize the calendar component. */
34
+ theme ?: CalendarTheme ;
26
35
}
27
36
28
37
export const Calendar = memo (
@@ -31,6 +40,7 @@ export const Calendar = memo(
31
40
disabledDates,
32
41
activeDateRanges,
33
42
calendarRowSpacing = 8 ,
43
+ theme,
34
44
...buildCalendarParams
35
45
} : CalendarProps ) => {
36
46
const { calendarRowMonth, weeksList, weekDaysList } =
@@ -41,7 +51,7 @@ export const Calendar = memo(
41
51
alignItems = "center"
42
52
spacing = { calendarRowSpacing as keyof typeof tokens . spacing }
43
53
>
44
- < CalendarRowMonth >
54
+ < CalendarRowMonth height = { 20 } theme = { theme ?. rowMonthTheme } >
45
55
{ uppercaseFirstLetter ( calendarRowMonth ) }
46
56
</ CalendarRowMonth >
47
57
< CalendarRowWeek spacing = { 8 } >
0 commit comments