-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: S2 DateField/DatePicker/Calendar #8428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
# Conflicts: # yarn.lock
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
@@ -14,6 +14,7 @@ export {useCalendar} from './useCalendar'; | |||
export {useRangeCalendar} from './useRangeCalendar'; | |||
export {useCalendarGrid} from './useCalendarGrid'; | |||
export {useCalendarCell} from './useCalendarCell'; | |||
export {getEraFormat} from './utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another way to do this? see RangeCalendar implementation for use
@@ -27,7 +27,8 @@ interface ContentProps extends UnsafeStyles, SlotProps { | |||
id?: string | |||
} | |||
|
|||
interface HeadingProps extends ContentProps { | |||
interface HeadingProps extends Omit<ContentProps, 'children'> { | |||
children?: ReactNode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to replace children in RangeCalendar
@@ -187,10 +188,11 @@ const fieldGroupStyles = style({ | |||
}); | |||
|
|||
export const FieldGroup = forwardRef(function FieldGroup(props: FieldGroupProps, ref: ForwardedRef<HTMLDivElement>) { | |||
let {shouldTurnOffFocusRing, ...otherProps} = props; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
date picker's button is focusable, and it's also inside the group, so needed a way to turn off the focus ring when the button has focus and has its own ring
* Whether the cell is today. | ||
* @selector [data-today] | ||
*/ | ||
isToday: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
figured this was a nice thing to expose, i could do it in Calendar directly though if we don't like it
@@ -448,7 +453,7 @@ export {CalendarHeaderCellForwardRef as CalendarHeaderCell}; | |||
|
|||
export interface CalendarGridBodyProps extends StyleProps { | |||
/** A function to render a `<CalendarCell>` for a given date. */ | |||
children: (date: CalendarDate) => ReactElement | |||
children: (date: CalendarDate, weekIndex: number, dayIndex: number) => ReactElement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needed to be able to determine what column a day was in for styling purposes so we can have a dashed border around ranges
better way to pass it along?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm couldn't you calculate this from the date itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could, but the information already exists, so it seemed to make more sense not to do that calculation
I'll see how bad it is to calculate though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check commit aa7701d#diff-08206439985c4bfe014f71e8aa5df9fbe4cbcf4c478f4923e9f551cb2b4b2af7R473 to see if you like this better, or if you think of a better way to account for all the edge cases
date: CalendarDate | ||
date: CalendarDate, | ||
/** The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. */ | ||
cellClassName?: string | ((values: CalendarCellRenderProps & {defaultClassName: string | undefined}) => string), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has been asked for before, i forget where. right now there is no way to get styles or classnames on the td element of the table with all the days in it, so this adds that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm this is weird. is there a way to avoid it?
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
@@ -73,7 +73,7 @@ export const DatePickerStateContext = createContext<DatePickerState | null>(null | |||
export const DateRangePickerStateContext = createContext<DateRangePickerState | null>(null); | |||
|
|||
// Contexts to clear inside the popover. | |||
const CLEAR_CONTEXTS = [GroupContext, ButtonContext, LabelContext, TextContext]; | |||
const CLEAR_CONTEXTS = [GroupContext, ButtonContext, LabelContext, TextContext, OverlayTriggerStateContext]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DateRangePicker too?
What was this needed for? Seems like it might be nice to be able to programmatically close from within the popover
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Next/Prev buttons were getting the hover state.
And this array is applied to both DatePicker and DateRangePicker
date: CalendarDate | ||
date: CalendarDate, | ||
/** The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. */ | ||
cellClassName?: string | ((values: CalendarCellRenderProps & {defaultClassName: string | undefined}) => string), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm this is weird. is there a way to avoid it?
@@ -448,7 +453,7 @@ export {CalendarHeaderCellForwardRef as CalendarHeaderCell}; | |||
|
|||
export interface CalendarGridBodyProps extends StyleProps { | |||
/** A function to render a `<CalendarCell>` for a given date. */ | |||
children: (date: CalendarDate) => ReactElement | |||
children: (date: CalendarDate, weekIndex: number, dayIndex: number) => ReactElement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm couldn't you calculate this from the date itself?
Let's try to reduce the duplication between components if we can. Many of the inner parts are identical. |
Yep, I left it as separate while i determined what was needed and due to #8428 (comment) . Will join them together now. |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
## API Changes
react-aria-components/react-aria-components:CalendarGrid-CalendarGrid {
+CalendarGrid extends AllHTMLAttributes {
children?: ReactElement | Array<ReactElement> | (CalendarDate) => ReactElement
className?: string
offset?: DateDuration
weekdayStyle?: 'narrow' | 'short' | 'long' = "narrow"
} /react-aria-components:useContextProps useContextProps <E extends Element, T, U extends SlotProps> {
props: (T & SlotProps)
- ref: ForwardedRef<E> | undefined
+ ref: ForwardedRef<E>
context: Context<ContextValue<U, E>>
returnVal: undefined
} /react-aria-components:CalendarCellRenderProps CalendarCellRenderProps {
date: CalendarDate
formattedDate: string
isDisabled: boolean
isFocusVisible: boolean
isFocused: boolean
isHovered: boolean
isInvalid: boolean
isOutsideMonth: boolean
isOutsideVisibleRange: boolean
isPressed: boolean
isSelected: boolean
isSelectionEnd: boolean
isSelectionStart: boolean
+ isToday: boolean
isUnavailable: boolean
} @react-aria/calendar/@react-aria/calendar:getEraFormat+getEraFormat {
+ date: CalendarDate | undefined
+ returnVal: undefined
+} @react-spectrum/s2/@react-spectrum/s2:Heading Heading {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
- children: ReactNode
+ children?: ReactNode
id?: string
isHidden?: boolean
level?: number
slot?: string | null
} /@react-spectrum/s2:Calendar+Calendar <T extends DateValue> {
+ UNSAFE_className?: UnsafeClassName
+ UNSAFE_style?: CSSProperties
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean = false
+ children?: ChildrenOrFunction<CalendarRenderProps>
+ createCalendar?: (CalendarIdentifier) => Calendar
+ defaultFocusedValue?: DateValue | null
+ defaultValue?: DateValue | null
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'
+ focusedValue?: DateValue | null
+ id?: string
+ isDateUnavailable?: (DateValue) => boolean
+ isDisabled?: boolean = false
+ isInvalid?: boolean
+ isReadOnly?: boolean = false
+ maxValue?: DateValue | null
+ minValue?: DateValue | null
+ onChange?: (MappedDateValue<DateValue>) => void
+ onFocusChange?: (CalendarDate) => void
+ pageBehavior?: PageBehavior = visible
+ slot?: string | null
+ styles?: StylesProp
+ value?: DateValue | null
+ visibleMonths?: number = 1
+} /@react-spectrum/s2:CalendarContext+CalendarContext {
+ UNTYPED
+} /@react-spectrum/s2:DateField+DateField <T extends DateValue> {
+ UNSAFE_className?: UnsafeClassName
+ UNSAFE_style?: CSSProperties
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean
+ contextualHelp?: ReactNode
+ defaultValue?: DateValue | null
+ description?: ReactNode
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ granularity?: Granularity
+ hideTimeZone?: boolean = false
+ hourCycle?: number | number
+ id?: string
+ isDateUnavailable?: (DateValue) => boolean
+ isDisabled?: boolean
+ isInvalid?: boolean
+ isReadOnly?: boolean
+ isRequired?: boolean
+ label?: ReactNode
+ labelAlign?: Alignment = 'start'
+ labelPosition?: LabelPosition = 'top'
+ maxValue?: DateValue | null
+ minValue?: DateValue | null
+ name?: string
+ necessityIndicator?: NecessityIndicator = 'icon'
+ onBlur?: (FocusEvent<Target>) => void
+ onChange?: (MappedDateValue<DateValue> | null) => void
+ onFocus?: (FocusEvent<Target>) => void
+ onFocusChange?: (boolean) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ placeholderValue?: DateValue | null
+ shouldForceLeadingZeros?: boolean
+ size?: 'S' | 'M' | 'L' | 'XL' = 'M'
+ slot?: string | null
+ styles?: StylesProp
+ validate?: (MappedDateValue<DateValue>) => ValidationError | boolean | null | undefined
+ validationBehavior?: 'native' | 'aria' = 'native'
+ value?: DateValue | null
+} /@react-spectrum/s2:DateFieldContext+DateFieldContext {
+ UNTYPED
+} /@react-spectrum/s2:DatePicker+DatePicker <T extends DateValue> {
+ UNSAFE_className?: UnsafeClassName
+ UNSAFE_style?: CSSProperties
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean
+ contextualHelp?: ReactNode
+ createCalendar?: (CalendarIdentifier) => Calendar
+ defaultOpen?: boolean
+ defaultValue?: DateValue | null
+ description?: ReactNode
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'
+ granularity?: Granularity
+ hideTimeZone?: boolean = false
+ hourCycle?: number | number
+ id?: string
+ isDateUnavailable?: (DateValue) => boolean
+ isDisabled?: boolean
+ isInvalid?: boolean
+ isOpen?: boolean
+ isReadOnly?: boolean
+ isRequired?: boolean
+ label?: ReactNode
+ labelAlign?: Alignment = 'start'
+ labelPosition?: LabelPosition = 'top'
+ maxValue?: DateValue | null
+ minValue?: DateValue | null
+ name?: string
+ necessityIndicator?: NecessityIndicator = 'icon'
+ onBlur?: (FocusEvent<Target>) => void
+ onChange?: (MappedDateValue<DateValue> | null) => void
+ onFocus?: (FocusEvent<Target>) => void
+ onFocusChange?: (boolean) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ onOpenChange?: (boolean) => void
+ pageBehavior?: PageBehavior = visible
+ placeholderValue?: DateValue | null
+ shouldCloseOnSelect?: boolean | () => boolean = true
+ shouldForceLeadingZeros?: boolean
+ size?: 'S' | 'M' | 'L' | 'XL' = 'M'
+ slot?: string | null
+ styles?: StylesProp
+ validate?: (MappedDateValue<DateValue>) => ValidationError | boolean | null | undefined
+ validationBehavior?: 'native' | 'aria' = 'native'
+ value?: DateValue | null
+ visibleMonths?: number = 1
+} /@react-spectrum/s2:DatePickerContext+DatePickerContext {
+ UNTYPED
+} /@react-spectrum/s2:DateRangePicker+DateRangePicker <T extends DateValue> {
+ UNSAFE_className?: UnsafeClassName
+ UNSAFE_style?: CSSProperties
+ allowsNonContiguousRanges?: boolean
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean
+ contextualHelp?: ReactNode
+ defaultOpen?: boolean
+ defaultValue?: RangeValue<DateValue> | null
+ description?: ReactNode
+ endName?: string
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'
+ granularity?: Granularity
+ hideTimeZone?: boolean = false
+ hourCycle?: number | number
+ id?: string
+ isDateUnavailable?: (DateValue) => boolean
+ isDisabled?: boolean
+ isInvalid?: boolean
+ isOpen?: boolean
+ isReadOnly?: boolean
+ isRequired?: boolean
+ label?: ReactNode
+ labelAlign?: Alignment = 'start'
+ labelPosition?: LabelPosition = 'top'
+ maxValue?: DateValue | null
+ minValue?: DateValue | null
+ necessityIndicator?: NecessityIndicator = 'icon'
+ onBlur?: (FocusEvent<Target>) => void
+ onChange?: (RangeValue<MappedDateValue<DateValue>> | null) => void
+ onFocus?: (FocusEvent<Target>) => void
+ onFocusChange?: (boolean) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ onOpenChange?: (boolean) => void
+ pageBehavior?: PageBehavior = visible
+ placeholderValue?: DateValue | null
+ shouldCloseOnSelect?: boolean | () => boolean = true
+ shouldForceLeadingZeros?: boolean
+ size?: 'S' | 'M' | 'L' | 'XL' = 'M'
+ slot?: string | null
+ startName?: string
+ styles?: StylesProp
+ validate?: (RangeValue<MappedDateValue<DateValue>>) => ValidationError | boolean | null | undefined
+ validationBehavior?: 'native' | 'aria' = 'native'
+ value?: RangeValue<DateValue> | null
+ visibleMonths?: number
+} /@react-spectrum/s2:DateRangePickerContext+DateRangePickerContext {
+ UNTYPED
+} /@react-spectrum/s2:RangeCalendar+RangeCalendar <T extends DateValue> {
+ UNSAFE_className?: UnsafeClassName
+ UNSAFE_style?: CSSProperties
+ allowsNonContiguousRanges?: boolean
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean = false
+ children?: ChildrenOrFunction<RangeCalendarRenderProps>
+ createCalendar?: (CalendarIdentifier) => Calendar
+ defaultFocusedValue?: DateValue | null
+ defaultValue?: RangeValue<DateValue> | null
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'
+ focusedValue?: DateValue | null
+ id?: string
+ isDateUnavailable?: (DateValue) => boolean
+ isDisabled?: boolean = false
+ isInvalid?: boolean
+ isReadOnly?: boolean = false
+ maxValue?: DateValue | null
+ minValue?: DateValue | null
+ onChange?: (RangeValue<MappedDateValue<DateValue>>) => void
+ onFocusChange?: (CalendarDate) => void
+ pageBehavior?: PageBehavior = visible
+ slot?: string | null
+ styles?: StylesProp
+ value?: RangeValue<DateValue> | null
+ visibleMonths?: number
+} /@react-spectrum/s2:RangeCalendarContext+RangeCalendarContext {
+ UNTYPED
+} /@react-spectrum/s2:TimeField+TimeField <T extends TimeValue> {
+ UNSAFE_className?: UnsafeClassName
+ UNSAFE_style?: CSSProperties
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean
+ contextualHelp?: ReactNode
+ defaultValue?: TimeValue | null
+ description?: ReactNode
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ granularity?: 'hour' | 'minute' | 'second' = 'minute'
+ hideTimeZone?: boolean
+ hourCycle?: number | number
+ id?: string
+ isDisabled?: boolean
+ isInvalid?: boolean
+ isReadOnly?: boolean
+ isRequired?: boolean
+ label?: ReactNode
+ labelAlign?: Alignment = 'start'
+ labelPosition?: LabelPosition = 'top'
+ maxValue?: TimeValue | null
+ minValue?: TimeValue | null
+ name?: string
+ necessityIndicator?: NecessityIndicator = 'icon'
+ onBlur?: (FocusEvent<Target>) => void
+ onChange?: (MappedTimeValue<TimeValue> | null) => void
+ onFocus?: (FocusEvent<Target>) => void
+ onFocusChange?: (boolean) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ placeholderValue?: TimeValue
+ shouldForceLeadingZeros?: boolean
+ size?: 'S' | 'M' | 'L' | 'XL' = 'M'
+ slot?: string | null
+ styles?: StylesProp
+ validate?: (MappedTimeValue<TimeValue>) => ValidationError | boolean | null | undefined
+ validationBehavior?: 'native' | 'aria' = 'native'
+ value?: TimeValue | null
+} /@react-spectrum/s2:TimeFieldContext+TimeFieldContext {
+ UNTYPED
+} /@react-spectrum/s2:CalendarProps+CalendarProps <T extends DateValue> {
+ UNSAFE_className?: UnsafeClassName
+ UNSAFE_style?: CSSProperties
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean = false
+ children?: ChildrenOrFunction<CalendarRenderProps>
+ createCalendar?: (CalendarIdentifier) => Calendar
+ defaultFocusedValue?: DateValue | null
+ defaultValue?: DateValue | null
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'
+ focusedValue?: DateValue | null
+ id?: string
+ isDateUnavailable?: (DateValue) => boolean
+ isDisabled?: boolean = false
+ isInvalid?: boolean
+ isReadOnly?: boolean = false
+ maxValue?: DateValue | null
+ minValue?: DateValue | null
+ onChange?: (MappedDateValue<DateValue>) => void
+ onFocusChange?: (CalendarDate) => void
+ pageBehavior?: PageBehavior = visible
+ slot?: string | null
+ styles?: StylesProp
+ value?: DateValue | null
+ visibleMonths?: number = 1
+} /@react-spectrum/s2:DateFieldProps+DateFieldProps <T extends DateValue> {
+ UNSAFE_className?: UnsafeClassName
+ UNSAFE_style?: CSSProperties
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean
+ contextualHelp?: ReactNode
+ defaultValue?: DateValue | null
+ description?: ReactNode
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ granularity?: Granularity
+ hideTimeZone?: boolean = false
+ hourCycle?: number | number
+ id?: string
+ isDateUnavailable?: (DateValue) => boolean
+ isDisabled?: boolean
+ isInvalid?: boolean
+ isReadOnly?: boolean
+ isRequired?: boolean
+ label?: ReactNode
+ labelAlign?: Alignment = 'start'
+ labelPosition?: LabelPosition = 'top'
+ maxValue?: DateValue | null
+ minValue?: DateValue | null
+ name?: string
+ necessityIndicator?: NecessityIndicator = 'icon'
+ onBlur?: (FocusEvent<Target>) => void
+ onChange?: (MappedDateValue<DateValue> | null) => void
+ onFocus?: (FocusEvent<Target>) => void
+ onFocusChange?: (boolean) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ placeholderValue?: DateValue | null
+ shouldForceLeadingZeros?: boolean
+ size?: 'S' | 'M' | 'L' | 'XL' = 'M'
+ slot?: string | null
+ styles?: StylesProp
+ validate?: (MappedDateValue<DateValue>) => ValidationError | boolean | null | undefined
+ validationBehavior?: 'native' | 'aria' = 'native'
+ value?: DateValue | null
+} /@react-spectrum/s2:DatePickerProps+DatePickerProps <T extends DateValue> {
+ UNSAFE_className?: UnsafeClassName
+ UNSAFE_style?: CSSProperties
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean
+ contextualHelp?: ReactNode
+ createCalendar?: (CalendarIdentifier) => Calendar
+ defaultOpen?: boolean
+ defaultValue?: DateValue | null
+ description?: ReactNode
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'
+ granularity?: Granularity
+ hideTimeZone?: boolean = false
+ hourCycle?: number | number
+ id?: string
+ isDateUnavailable?: (DateValue) => boolean
+ isDisabled?: boolean
+ isInvalid?: boolean
+ isOpen?: boolean
+ isReadOnly?: boolean
+ isRequired?: boolean
+ label?: ReactNode
+ labelAlign?: Alignment = 'start'
+ labelPosition?: LabelPosition = 'top'
+ maxValue?: DateValue | null
+ minValue?: DateValue | null
+ name?: string
+ necessityIndicator?: NecessityIndicator = 'icon'
+ onBlur?: (FocusEvent<Target>) => void
+ onChange?: (MappedDateValue<DateValue> | null) => void
+ onFocus?: (FocusEvent<Target>) => void
+ onFocusChange?: (boolean) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ onOpenChange?: (boolean) => void
+ pageBehavior?: PageBehavior = visible
+ placeholderValue?: DateValue | null
+ shouldCloseOnSelect?: boolean | () => boolean = true
+ shouldForceLeadingZeros?: boolean
+ size?: 'S' | 'M' | 'L' | 'XL' = 'M'
+ slot?: string | null
+ styles?: StylesProp
+ validate?: (MappedDateValue<DateValue>) => ValidationError | boolean | null | undefined
+ validationBehavior?: 'native' | 'aria' = 'native'
+ value?: DateValue | null
+ visibleMonths?: number = 1
+} /@react-spectrum/s2:DateRangePickerProps+DateRangePickerProps <T extends DateValue> {
+ UNSAFE_className?: UnsafeClassName
+ UNSAFE_style?: CSSProperties
+ allowsNonContiguousRanges?: boolean
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean
+ contextualHelp?: ReactNode
+ defaultOpen?: boolean
+ defaultValue?: RangeValue<DateValue> | null
+ description?: ReactNode
+ endName?: string
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'
+ granularity?: Granularity
+ hideTimeZone?: boolean = false
+ hourCycle?: number | number
+ id?: string
+ isDateUnavailable?: (DateValue) => boolean
+ isDisabled?: boolean
+ isInvalid?: boolean
+ isOpen?: boolean
+ isReadOnly?: boolean
+ isRequired?: boolean
+ label?: ReactNode
+ labelAlign?: Alignment = 'start'
+ labelPosition?: LabelPosition = 'top'
+ maxValue?: DateValue | null
+ minValue?: DateValue | null
+ necessityIndicator?: NecessityIndicator = 'icon'
+ onBlur?: (FocusEvent<Target>) => void
+ onChange?: (RangeValue<MappedDateValue<DateValue>> | null) => void
+ onFocus?: (FocusEvent<Target>) => void
+ onFocusChange?: (boolean) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ onOpenChange?: (boolean) => void
+ pageBehavior?: PageBehavior = visible
+ placeholderValue?: DateValue | null
+ shouldCloseOnSelect?: boolean | () => boolean = true
+ shouldForceLeadingZeros?: boolean
+ size?: 'S' | 'M' | 'L' | 'XL' = 'M'
+ slot?: string | null
+ startName?: string
+ styles?: StylesProp
+ validate?: (RangeValue<MappedDateValue<DateValue>>) => ValidationError | boolean | null | undefined
+ validationBehavior?: 'native' | 'aria' = 'native'
+ value?: RangeValue<DateValue> | null
+ visibleMonths?: number
+} /@react-spectrum/s2:RangeCalendarProps+RangeCalendarProps <T extends DateValue> {
+ UNSAFE_className?: UnsafeClassName
+ UNSAFE_style?: CSSProperties
+ allowsNonContiguousRanges?: boolean
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean = false
+ children?: ChildrenOrFunction<RangeCalendarRenderProps>
+ createCalendar?: (CalendarIdentifier) => Calendar
+ defaultFocusedValue?: DateValue | null
+ defaultValue?: RangeValue<DateValue> | null
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'
+ focusedValue?: DateValue | null
+ id?: string
+ isDateUnavailable?: (DateValue) => boolean
+ isDisabled?: boolean = false
+ isInvalid?: boolean
+ isReadOnly?: boolean = false
+ maxValue?: DateValue | null
+ minValue?: DateValue | null
+ onChange?: (RangeValue<MappedDateValue<DateValue>>) => void
+ onFocusChange?: (CalendarDate) => void
+ pageBehavior?: PageBehavior = visible
+ slot?: string | null
+ styles?: StylesProp
+ value?: RangeValue<DateValue> | null
+ visibleMonths?: number
+} /@react-spectrum/s2:TimeFieldProps+TimeFieldProps <T extends TimeValue> {
+ UNSAFE_className?: UnsafeClassName
+ UNSAFE_style?: CSSProperties
+ aria-describedby?: string
+ aria-details?: string
+ aria-label?: string
+ aria-labelledby?: string
+ autoFocus?: boolean
+ contextualHelp?: ReactNode
+ defaultValue?: TimeValue | null
+ description?: ReactNode
+ errorMessage?: ReactNode | (ValidationResult) => ReactNode
+ granularity?: 'hour' | 'minute' | 'second' = 'minute'
+ hideTimeZone?: boolean
+ hourCycle?: number | number
+ id?: string
+ isDisabled?: boolean
+ isInvalid?: boolean
+ isReadOnly?: boolean
+ isRequired?: boolean
+ label?: ReactNode
+ labelAlign?: Alignment = 'start'
+ labelPosition?: LabelPosition = 'top'
+ maxValue?: TimeValue | null
+ minValue?: TimeValue | null
+ name?: string
+ necessityIndicator?: NecessityIndicator = 'icon'
+ onBlur?: (FocusEvent<Target>) => void
+ onChange?: (MappedTimeValue<TimeValue> | null) => void
+ onFocus?: (FocusEvent<Target>) => void
+ onFocusChange?: (boolean) => void
+ onKeyDown?: (KeyboardEvent) => void
+ onKeyUp?: (KeyboardEvent) => void
+ placeholderValue?: TimeValue
+ shouldForceLeadingZeros?: boolean
+ size?: 'S' | 'M' | 'L' | 'XL' = 'M'
+ slot?: string | null
+ styles?: StylesProp
+ validate?: (MappedTimeValue<TimeValue>) => ValidationError | boolean | null | undefined
+ validationBehavior?: 'native' | 'aria' = 'native'
+ value?: TimeValue | null
+} |
Closes
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: