@react-types/datepicker 3.4.0 → 3.6.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 +6 -6
  2. package/src/index.d.ts +20 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/datepicker",
3
- "version": "3.4.0",
3
+ "version": "3.6.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -9,10 +9,10 @@
9
9
  "url": "https://github.com/adobe/react-spectrum"
10
10
  },
11
11
  "dependencies": {
12
- "@internationalized/date": "^3.3.0",
13
- "@react-types/calendar": "^3.3.0",
14
- "@react-types/overlays": "^3.8.0",
15
- "@react-types/shared": "^3.18.1"
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"
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": "504e40e0a50c1b20ed0fb3ba9561a263b6d5565e"
23
+ "gitHead": "54fbaa67cc56867506811819fef765546d403253"
24
24
  }
package/src/index.d.ts CHANGED
@@ -16,8 +16,10 @@ import {
16
16
  FocusableProps,
17
17
  HelpTextProps,
18
18
  InputBase,
19
+ InputDOMProps,
19
20
  LabelableProps,
20
21
  RangeValue,
22
+ SpectrumFieldValidation,
21
23
  SpectrumLabelableProps,
22
24
  StyleProps,
23
25
  Validation,
@@ -62,7 +64,7 @@ interface DateFieldBase<T extends DateValue> extends InputBase, Validation, Focu
62
64
 
63
65
  interface AriaDateFieldBaseProps<T extends DateValue> extends DateFieldBase<T>, AriaLabelingProps, DOMProps {}
64
66
  export interface DateFieldProps<T extends DateValue> extends DateFieldBase<T>, ValueBase<T | null, MappedDateValue<T>> {}
65
- export interface AriaDateFieldProps<T extends DateValue> extends DateFieldProps<T>, AriaDateFieldBaseProps<T> {}
67
+ export interface AriaDateFieldProps<T extends DateValue> extends DateFieldProps<T>, AriaDateFieldBaseProps<T>, InputDOMProps {}
66
68
 
67
69
  interface DatePickerBase<T extends DateValue> extends DateFieldBase<T>, OverlayTriggerProps {
68
70
  /**
@@ -74,7 +76,7 @@ interface DatePickerBase<T extends DateValue> extends DateFieldBase<T>, OverlayT
74
76
  export interface AriaDatePickerBaseProps<T extends DateValue> extends DatePickerBase<T>, AriaLabelingProps, DOMProps {}
75
77
 
76
78
  export interface DatePickerProps<T extends DateValue> extends DatePickerBase<T>, ValueBase<T | null, MappedDateValue<T>> {}
77
- export interface AriaDatePickerProps<T extends DateValue> extends DatePickerProps<T>, AriaDatePickerBaseProps<T> {}
79
+ export interface AriaDatePickerProps<T extends DateValue> extends DatePickerProps<T>, AriaDatePickerBaseProps<T>, InputDOMProps {}
78
80
 
79
81
  export type DateRange = RangeValue<DateValue>;
80
82
  export interface DateRangePickerProps<T extends DateValue> extends DatePickerBase<T>, ValueBase<RangeValue<T> | null, RangeValue<MappedDateValue<T>>> {
@@ -85,9 +87,18 @@ export interface DateRangePickerProps<T extends DateValue> extends DatePickerBas
85
87
  allowsNonContiguousRanges?: boolean
86
88
  }
87
89
 
88
- export interface AriaDateRangePickerProps<T extends DateValue> extends AriaDatePickerBaseProps<T>, DateRangePickerProps<T> {}
90
+ export interface AriaDateRangePickerProps<T extends DateValue> extends AriaDatePickerBaseProps<T>, DateRangePickerProps<T> {
91
+ /**
92
+ * 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
+ */
94
+ startName?: string,
95
+ /**
96
+ * The name of the end date input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
97
+ */
98
+ endName?: string
99
+ }
89
100
 
90
- interface SpectrumDateFieldBase extends SpectrumLabelableProps, HelpTextProps, StyleProps {
101
+ interface SpectrumDateFieldBase extends SpectrumLabelableProps, HelpTextProps, SpectrumFieldValidation, StyleProps {
91
102
  /**
92
103
  * Whether the date picker should be displayed with a quiet style.
93
104
  * @default false
@@ -113,9 +124,9 @@ interface SpectrumDatePickerBase extends SpectrumDateFieldBase, SpectrumLabelabl
113
124
  shouldFlip?: boolean
114
125
  }
115
126
 
116
- export interface SpectrumDatePickerProps<T extends DateValue> extends AriaDatePickerProps<T>, SpectrumDatePickerBase {}
117
- export interface SpectrumDateRangePickerProps<T extends DateValue> extends AriaDateRangePickerProps<T>, SpectrumDatePickerBase {}
118
- export interface SpectrumDateFieldProps<T extends DateValue> extends AriaDateFieldProps<T>, SpectrumDateFieldBase {}
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 {}
119
130
 
120
131
  export type TimeValue = Time | CalendarDateTime | ZonedDateTime;
121
132
  type MappedTimeValue<T> =
@@ -150,9 +161,9 @@ export interface TimePickerProps<T extends TimeValue> extends InputBase, Validat
150
161
  maxValue?: TimeValue
151
162
  }
152
163
 
153
- export interface AriaTimeFieldProps<T extends TimeValue> extends TimePickerProps<T>, AriaLabelingProps, DOMProps {}
164
+ export interface AriaTimeFieldProps<T extends TimeValue> extends TimePickerProps<T>, AriaLabelingProps, DOMProps, InputDOMProps {}
154
165
 
155
- export interface SpectrumTimeFieldProps<T extends TimeValue> extends AriaTimeFieldProps<T>, SpectrumLabelableProps, StyleProps {
166
+ export interface SpectrumTimeFieldProps<T extends TimeValue> extends Omit<AriaTimeFieldProps<T>, 'isInvalid' | 'validationState'>, SpectrumFieldValidation, SpectrumLabelableProps, StyleProps, InputDOMProps {
156
167
  /**
157
168
  * Whether the time field should be displayed with a quiet style.
158
169
  * @default false