@@ -3,6 +3,7 @@ import type { VariantProps } from 'tailwind-variants'
3
3
import type { CalendarRootProps , CalendarRootEmits , RangeCalendarRootEmits , DateRange , CalendarCellTriggerProps } from ' reka-ui'
4
4
import type { DateValue } from ' @internationalized/date'
5
5
import type { AppConfig } from ' @nuxt/schema'
6
+ import type { ButtonProps } from ' ../types'
6
7
import _appConfig from ' #build/app.config'
7
8
import theme from ' #build/ui/calendar'
8
9
import { tv } from ' ../utils/tv'
@@ -32,24 +33,44 @@ export interface CalendarProps<R extends boolean, M extends boolean> extends Omi
32
33
* @IconifyIcon
33
34
*/
34
35
nextYearIcon? : string
36
+ /**
37
+ * Configure the next year button.
38
+ * `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
39
+ */
40
+ nextYear? : ButtonProps
35
41
/**
36
42
* The icon to use for the next month control.
37
43
* @defaultValue appConfig.ui.icons.chevronRight
38
44
* @IconifyIcon
39
45
*/
40
46
nextMonthIcon? : string
47
+ /**
48
+ * Configure the next month button.
49
+ * `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
50
+ */
51
+ nextMonth? : ButtonProps
41
52
/**
42
53
* The icon to use for the previous year control.
43
54
* @defaultValue appConfig.ui.icons.chevronDoubleLeft
44
55
* @IconifyIcon
45
56
*/
46
57
prevYearIcon? : string
58
+ /**
59
+ * Configure the prev year button.
60
+ * `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
61
+ */
62
+ prevYear? : ButtonProps
47
63
/**
48
64
* The icon to use for the previous month control.
49
65
* @defaultValue appConfig.ui.icons.chevronLeft
50
66
* @IconifyIcon
51
67
*/
52
68
prevMonthIcon? : string
69
+ /**
70
+ * Configure the prev month button.
71
+ * `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
72
+ */
73
+ prevMonth? : ButtonProps
53
74
/**
54
75
* @defaultValue 'primary'
55
76
*/
@@ -138,21 +159,21 @@ const Calendar = computed(() => props.range ? RangeCalendar : SingleCalendar)
138
159
>
139
160
<Calendar .Header :class =" ui.header({ class: props.ui?.header })" >
140
161
<Calendar .Prev v-if =" props.yearControls" :prev-page =" (date: DateValue) => paginateYear(date, -1)" :aria-label =" t('calendar.prevYear')" as-child >
141
- <UButton :icon =" prevYearIcon" :size =" props.size" color =" neutral" variant =" ghost" />
162
+ <UButton :icon =" prevYearIcon" :size =" props.size" color =" neutral" variant =" ghost" v-bind = " props.prevYear " />
142
163
</Calendar .Prev >
143
164
<Calendar .Prev v-if =" props.monthControls" :aria-label =" t('calendar.prevMonth')" as-child >
144
- <UButton :icon =" prevMonthIcon" :size =" props.size" color =" neutral" variant =" ghost" />
165
+ <UButton :icon =" prevMonthIcon" :size =" props.size" color =" neutral" variant =" ghost" v-bind = " props.prevMonth " />
145
166
</Calendar .Prev >
146
167
<Calendar .Heading v-slot =" { headingValue }" :class =" ui.heading({ class: props.ui?.heading })" >
147
168
<slot name =" heading" :value =" headingValue" >
148
169
{{ headingValue }}
149
170
</slot >
150
171
</Calendar .Heading >
151
172
<Calendar .Next v-if =" props.monthControls" :aria-label =" t('calendar.nextMonth')" as-child >
152
- <UButton :icon =" nextMonthIcon" :size =" props.size" color =" neutral" variant =" ghost" />
173
+ <UButton :icon =" nextMonthIcon" :size =" props.size" color =" neutral" variant =" ghost" v-bind = " props.nextMonth " />
153
174
</Calendar .Next >
154
175
<Calendar .Next v-if =" props.yearControls" :next-page =" (date: DateValue) => paginateYear(date, 1)" :aria-label =" t('calendar.nextYear')" as-child >
155
- <UButton :icon =" nextYearIcon" :size =" props.size" color =" neutral" variant =" ghost" />
176
+ <UButton :icon =" nextYearIcon" :size =" props.size" color =" neutral" variant =" ghost" v-bind = " props.nextYear " />
156
177
</Calendar .Next >
157
178
</Calendar .Header >
158
179
<div :class =" ui.body({ class: props.ui?.body })" >
0 commit comments