@react-types/datepicker 3.6.0 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/index.d.ts +12 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/datepicker",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -10,9 +10,9 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@internationalized/date": "^3.5.0",
13
- "@react-types/calendar": "^3.4.0",
14
- "@react-types/overlays": "^3.8.2",
15
- "@react-types/shared": "^3.20.0"
13
+ "@react-types/calendar": "^3.4.2",
14
+ "@react-types/overlays": "^3.8.4",
15
+ "@react-types/shared": "^3.22.0"
16
16
  },
17
17
  "publishConfig": {
18
18
  "access": "public"
@@ -20,5 +20,5 @@
20
20
  "peerDependencies": {
21
21
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
22
22
  },
23
- "gitHead": "54fbaa67cc56867506811819fef765546d403253"
23
+ "gitHead": "9ce2f674eab2cc8912800d3162dcf00a1ce94274"
24
24
  }
package/src/index.d.ts CHANGED
@@ -37,7 +37,7 @@ type MappedDateValue<T> =
37
37
  never;
38
38
 
39
39
  export type Granularity = 'day' | 'hour' | 'minute' | 'second';
40
- interface DateFieldBase<T extends DateValue> extends InputBase, Validation, FocusableProps, LabelableProps, HelpTextProps, OverlayTriggerProps {
40
+ interface DateFieldBase<T extends DateValue> extends InputBase, Validation<MappedDateValue<T>>, FocusableProps, LabelableProps, HelpTextProps, OverlayTriggerProps {
41
41
  /** The minimum allowed date that a user may select. */
42
42
  minValue?: DateValue,
43
43
  /** The maximum allowed date that a user may select. */
@@ -79,15 +79,12 @@ export interface DatePickerProps<T extends DateValue> extends DatePickerBase<T>,
79
79
  export interface AriaDatePickerProps<T extends DateValue> extends DatePickerProps<T>, AriaDatePickerBaseProps<T>, InputDOMProps {}
80
80
 
81
81
  export type DateRange = RangeValue<DateValue>;
82
- export interface DateRangePickerProps<T extends DateValue> extends DatePickerBase<T>, ValueBase<RangeValue<T> | null, RangeValue<MappedDateValue<T>>> {
82
+ export interface DateRangePickerProps<T extends DateValue> extends Omit<DatePickerBase<T>, 'validate'>, Validation<RangeValue<MappedDateValue<T>>>, ValueBase<RangeValue<T> | null, RangeValue<MappedDateValue<T>>> {
83
83
  /**
84
84
  * When combined with `isDateUnavailable`, determines whether non-contiguous ranges,
85
85
  * i.e. ranges containing unavailable dates, may be selected.
86
86
  */
87
- allowsNonContiguousRanges?: boolean
88
- }
89
-
90
- export interface AriaDateRangePickerProps<T extends DateValue> extends AriaDatePickerBaseProps<T>, DateRangePickerProps<T> {
87
+ allowsNonContiguousRanges?: boolean,
91
88
  /**
92
89
  * The name of the start date input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
93
90
  */
@@ -98,7 +95,9 @@ export interface AriaDateRangePickerProps<T extends DateValue> extends AriaDateP
98
95
  endName?: string
99
96
  }
100
97
 
101
- interface SpectrumDateFieldBase extends SpectrumLabelableProps, HelpTextProps, SpectrumFieldValidation, StyleProps {
98
+ export interface AriaDateRangePickerProps<T extends DateValue> extends Omit<AriaDatePickerBaseProps<T>, 'validate'>, DateRangePickerProps<T> {}
99
+
100
+ interface SpectrumDateFieldBase<T extends DateValue> extends SpectrumLabelableProps, HelpTextProps, SpectrumFieldValidation<MappedDateValue<T>>, StyleProps {
102
101
  /**
103
102
  * Whether the date picker should be displayed with a quiet style.
104
103
  * @default false
@@ -111,7 +110,7 @@ interface SpectrumDateFieldBase extends SpectrumLabelableProps, HelpTextProps, S
111
110
  showFormatHelpText?: boolean
112
111
  }
113
112
 
114
- interface SpectrumDatePickerBase extends SpectrumDateFieldBase, SpectrumLabelableProps, StyleProps {
113
+ interface SpectrumDatePickerBase<T extends DateValue> extends SpectrumDateFieldBase<T>, SpectrumLabelableProps, StyleProps {
115
114
  /**
116
115
  * The maximum number of months to display at once in the calendar popover, if screen space permits.
117
116
  * @default 1
@@ -124,9 +123,9 @@ interface SpectrumDatePickerBase extends SpectrumDateFieldBase, SpectrumLabelabl
124
123
  shouldFlip?: boolean
125
124
  }
126
125
 
127
- export interface SpectrumDatePickerProps<T extends DateValue> extends Omit<AriaDatePickerProps<T>, 'isInvalid' | 'validationState'>, SpectrumDatePickerBase {}
128
- export interface SpectrumDateRangePickerProps<T extends DateValue> extends Omit<AriaDateRangePickerProps<T>, 'isInvalid' | 'validationState'>, SpectrumDatePickerBase {}
129
- export interface SpectrumDateFieldProps<T extends DateValue> extends Omit<AriaDateFieldProps<T>, 'isInvalid' | 'validationState'>, SpectrumDateFieldBase {}
126
+ export interface SpectrumDatePickerProps<T extends DateValue> extends Omit<AriaDatePickerProps<T>, 'isInvalid' | 'validationState'>, SpectrumDatePickerBase<T> {}
127
+ export interface SpectrumDateRangePickerProps<T extends DateValue> extends Omit<AriaDateRangePickerProps<T>, 'isInvalid' | 'validationState'>, Omit<SpectrumDatePickerBase<T>, 'validate'> {}
128
+ export interface SpectrumDateFieldProps<T extends DateValue> extends Omit<AriaDateFieldProps<T>, 'isInvalid' | 'validationState'>, SpectrumDateFieldBase<T> {}
130
129
 
131
130
  export type TimeValue = Time | CalendarDateTime | ZonedDateTime;
132
131
  type MappedTimeValue<T> =
@@ -135,7 +134,7 @@ type MappedTimeValue<T> =
135
134
  T extends Time ? Time :
136
135
  never;
137
136
 
138
- export interface TimePickerProps<T extends TimeValue> extends InputBase, Validation, FocusableProps, LabelableProps, HelpTextProps, ValueBase<T | null, MappedTimeValue<T>> {
137
+ export interface TimePickerProps<T extends TimeValue> extends InputBase, Validation<MappedTimeValue<T>>, FocusableProps, LabelableProps, HelpTextProps, ValueBase<T | null, MappedTimeValue<T>> {
139
138
  /** Whether to display the time in 12 or 24 hour format. By default, this is determined by the user's locale. */
140
139
  hourCycle?: 12 | 24,
141
140
  /**
@@ -163,7 +162,7 @@ export interface TimePickerProps<T extends TimeValue> extends InputBase, Validat
163
162
 
164
163
  export interface AriaTimeFieldProps<T extends TimeValue> extends TimePickerProps<T>, AriaLabelingProps, DOMProps, InputDOMProps {}
165
164
 
166
- export interface SpectrumTimeFieldProps<T extends TimeValue> extends Omit<AriaTimeFieldProps<T>, 'isInvalid' | 'validationState'>, SpectrumFieldValidation, SpectrumLabelableProps, StyleProps, InputDOMProps {
165
+ export interface SpectrumTimeFieldProps<T extends TimeValue> extends Omit<AriaTimeFieldProps<T>, 'isInvalid' | 'validationState'>, SpectrumFieldValidation<MappedTimeValue<T>>, SpectrumLabelableProps, StyleProps, InputDOMProps {
167
166
  /**
168
167
  * Whether the time field should be displayed with a quiet style.
169
168
  * @default false