@@ -28,7 +28,12 @@ export interface AriaCalendarCellProps {
28
28
* Whether the cell is disabled. By default, this is determined by the
29
29
* Calendar's `minValue`, `maxValue`, and `isDisabled` props.
30
30
*/
31
- isDisabled ?: boolean
31
+ isDisabled ?: boolean ,
32
+
33
+ /**
34
+ * Whether the cell is outside of the current month.
35
+ */
36
+ isOutsideMonth ?: boolean
32
37
}
33
38
34
39
export interface CalendarCellAria {
@@ -40,6 +45,8 @@ export interface CalendarCellAria {
40
45
isPressed : boolean ,
41
46
/** Whether the cell is selected. */
42
47
isSelected : boolean ,
48
+ /** Whether the cell is read only. */
49
+ isReadOnly : boolean ,
43
50
/** Whether the cell is focused. */
44
51
isFocused : boolean ,
45
52
/**
@@ -85,7 +92,7 @@ export function useCalendarCell(props: AriaCalendarCellProps, state: CalendarSta
85
92
timeZone : state . timeZone
86
93
} ) ;
87
94
let isSelected = state . isSelected ( date ) ;
88
- let isFocused = state . isCellFocused ( date ) ;
95
+ let isFocused = state . isCellFocused ( date ) && ! props . isOutsideMonth ;
89
96
isDisabled = isDisabled || state . isCellDisabled ( date ) ;
90
97
let isUnavailable = state . isCellUnavailable ( date ) ;
91
98
let isSelectable = ! isDisabled && ! isUnavailable ;
@@ -305,7 +312,8 @@ export function useCalendarCell(props: AriaCalendarCellProps, state: CalendarSta
305
312
role : 'gridcell' ,
306
313
'aria-disabled' : ! isSelectable || undefined ,
307
314
'aria-selected' : isSelected || undefined ,
308
- 'aria-invalid' : isInvalid || undefined
315
+ 'aria-invalid' : isInvalid || undefined ,
316
+ 'aria-readonly' : state . isReadOnly || undefined
309
317
} ,
310
318
buttonProps : mergeProps ( pressProps , {
311
319
onFocus ( ) {
@@ -343,6 +351,7 @@ export function useCalendarCell(props: AriaCalendarCellProps, state: CalendarSta
343
351
} ) ,
344
352
isPressed,
345
353
isFocused,
354
+ isReadOnly : state . isReadOnly ,
346
355
isSelected,
347
356
isDisabled,
348
357
isUnavailable,
0 commit comments