(props: AriaCalendarProps<DateValue>)
| 19 | import './Calendar.css'; |
| 20 | |
| 21 | export function Calendar(props: AriaCalendarProps<DateValue>) { |
| 22 | let {locale} = useLocale(); |
| 23 | let state = useCalendarState({...props, locale, createCalendar}); |
| 24 | /*- begin highlight -*/ |
| 25 | let {calendarProps, prevButtonProps, nextButtonProps, title} = useCalendar(props, state); |
| 26 | /*- end highlight -*/ |
| 27 | |
| 28 | return ( |
| 29 | <div {...calendarProps} className="react-aria-Calendar"> |
| 30 | <header> |
| 31 | <Button {...prevButtonProps} variant="quiet"> |
| 32 | <ChevronLeft size={18} /> |
| 33 | </Button> |
| 34 | <h2 className="react-aria-CalendarHeading">{title}</h2> |
| 35 | <Button {...nextButtonProps} variant="quiet"> |
| 36 | <ChevronRight size={18} /> |
| 37 | </Button> |
| 38 | </header> |
| 39 | <div className="months"> |
| 40 | <div className="month"> |
| 41 | <CalendarGrid state={state} /> |
| 42 | </div> |
| 43 | </div> |
| 44 | </div> |
| 45 | ); |
| 46 | } |
| 47 | |
| 48 | function CalendarGrid({state, ...props}: AriaCalendarGridProps & {state: CalendarState}) { |
| 49 | let {gridProps, headerProps, weekDays, weeksInMonth} = useCalendarGrid(props, state); |
nothing calls this directly
no test coverage detected