From 0726231e4a9217f4f4cfcc2677610628bedcacf1 Mon Sep 17 00:00:00 2001 From: Devon Govett Date: Fri, 17 Mar 2023 10:20:45 -0700 Subject: [PATCH] Allow null in types for DatePicker components #3187 --- packages/@react-types/calendar/src/index.d.ts | 4 ++-- packages/@react-types/datepicker/src/index.d.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/@react-types/calendar/src/index.d.ts b/packages/@react-types/calendar/src/index.d.ts index 84382eefa94..d07946a1581 100644 --- a/packages/@react-types/calendar/src/index.d.ts +++ b/packages/@react-types/calendar/src/index.d.ts @@ -56,8 +56,8 @@ export interface CalendarPropsBase { } export type DateRange = RangeValue; -export interface CalendarProps extends CalendarPropsBase, ValueBase> {} -export interface RangeCalendarProps extends CalendarPropsBase, ValueBase, RangeValue>> { +export interface CalendarProps extends CalendarPropsBase, ValueBase> {} +export interface RangeCalendarProps extends CalendarPropsBase, ValueBase | null, RangeValue>> { /** * When combined with `isDateUnavailable`, determines whether non-contiguous ranges, * i.e. ranges containing unavailable dates, may be selected. diff --git a/packages/@react-types/datepicker/src/index.d.ts b/packages/@react-types/datepicker/src/index.d.ts index 5fbe9cffabe..6d7aa8404d8 100644 --- a/packages/@react-types/datepicker/src/index.d.ts +++ b/packages/@react-types/datepicker/src/index.d.ts @@ -55,17 +55,17 @@ interface DateFieldBase extends InputBase, Validation, Focu } interface AriaDateFieldBaseProps extends DateFieldBase, AriaLabelingProps, DOMProps {} -export interface DateFieldProps extends DateFieldBase, ValueBase> {} +export interface DateFieldProps extends DateFieldBase, ValueBase> {} export interface AriaDateFieldProps extends DateFieldProps, AriaDateFieldBaseProps {} interface DatePickerBase extends DateFieldBase, OverlayTriggerProps {} export interface AriaDatePickerBaseProps extends DatePickerBase, AriaLabelingProps, DOMProps {} -export interface DatePickerProps extends DatePickerBase, ValueBase> {} +export interface DatePickerProps extends DatePickerBase, ValueBase> {} export interface AriaDatePickerProps extends DatePickerProps, AriaDatePickerBaseProps {} export type DateRange = RangeValue; -export interface DateRangePickerProps extends DatePickerBase, ValueBase, RangeValue>> { +export interface DateRangePickerProps extends DatePickerBase, ValueBase | null, RangeValue>> { /** * When combined with `isDateUnavailable`, determines whether non-contiguous ranges, * i.e. ranges containing unavailable dates, may be selected. @@ -112,7 +112,7 @@ type MappedTimeValue = T extends Time ? Time : never; -export interface TimePickerProps extends InputBase, Validation, FocusableProps, LabelableProps, HelpTextProps, ValueBase> { +export interface TimePickerProps extends InputBase, Validation, FocusableProps, LabelableProps, HelpTextProps, ValueBase> { /** Whether to display the time in 12 or 24 hour format. By default, this is determined by the user's locale. */ hourCycle?: 12 | 24, /**