({
errorMessage,
...props
}: RangeCalendarProps<T>)
| 19 | } |
| 20 | |
| 21 | export function RangeCalendar<T extends DateValue>({ |
| 22 | errorMessage, |
| 23 | ...props |
| 24 | }: RangeCalendarProps<T>) { |
| 25 | let months = props.visibleDuration?.months || 1; |
| 26 | return ( |
| 27 | <AriaRangeCalendar {...props}> |
| 28 | <div className="months"> |
| 29 | {Array.from({length: months}, (_, i) => ( |
| 30 | <div key={i} className="month"> |
| 31 | <header> |
| 32 | {i === 0 && ( |
| 33 | <Button slot="previous" variant="quiet"> |
| 34 | <ChevronLeft /> |
| 35 | </Button> |
| 36 | )} |
| 37 | <CalendarHeading offset={{months: i}} /> |
| 38 | {i === months - 1 && ( |
| 39 | <Button slot="next" variant="quiet"> |
| 40 | <ChevronRight /> |
| 41 | </Button> |
| 42 | )} |
| 43 | </header> |
| 44 | <CalendarGrid offset={{months: i}}>{date => <CalendarCell date={date} />}</CalendarGrid> |
| 45 | </div> |
| 46 | ))} |
| 47 | </div> |
| 48 | {errorMessage && <Text slot="errorMessage">{errorMessage}</Text>} |
| 49 | </AriaRangeCalendar> |
| 50 | ); |
| 51 | } |
| 52 | |
| 53 | export {CalendarGrid}; |
| 54 | export function CalendarCell(props: CalendarCellProps) { |
nothing calls this directly
no outgoing calls
no test coverage detected