Skip to content

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

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open

Conversation

snowystinger
Copy link
Member

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@rspbot
Copy link

rspbot commented Jun 20, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Jun 23, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Jun 23, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Jun 23, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Jun 23, 2025

Build successful! 🎉

@snowystinger snowystinger marked this pull request as ready for review June 24, 2025 02:39
@rspbot
Copy link

rspbot commented Jun 24, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Jun 24, 2025

@rspbot
Copy link

rspbot commented Jun 24, 2025

@@ -14,6 +14,7 @@ export {useCalendar} from './useCalendar';
export {useRangeCalendar} from './useRangeCalendar';
export {useCalendarGrid} from './useCalendarGrid';
export {useCalendarCell} from './useCalendarCell';
export {getEraFormat} from './utils';
Copy link
Member Author

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,
Copy link
Member Author

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;
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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?

Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member Author

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),
Copy link
Member Author

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

Copy link
Member

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?

@rspbot
Copy link

rspbot commented Jun 27, 2025

@rspbot
Copy link

rspbot commented Jun 27, 2025

@rspbot
Copy link

rspbot commented Jun 27, 2025

@rspbot
Copy link

rspbot commented Jun 27, 2025

@@ -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];
Copy link
Member

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

Copy link
Member Author

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),
Copy link
Member

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
Copy link
Member

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?

@devongovett
Copy link
Member

Let's try to reduce the duplication between components if we can. Many of the inner parts are identical.

@snowystinger
Copy link
Member Author

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.

@rspbot
Copy link

rspbot commented Jun 30, 2025

@rspbot
Copy link

rspbot commented Jun 30, 2025

@rspbot
Copy link

rspbot commented Jun 30, 2025

@rspbot
Copy link

rspbot commented Jul 1, 2025

@rspbot
Copy link

rspbot commented Jul 1, 2025

@rspbot
Copy link

rspbot commented Jul 1, 2025

@rspbot
Copy link

rspbot commented Jul 1, 2025

@rspbot
Copy link

rspbot commented Jul 1, 2025

## 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
+}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants