@react-aria/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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/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
  "main": "dist/main.js",
@@ -22,21 +22,21 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@internationalized/date": "^3.4.0",
25
+ "@internationalized/date": "^3.5.0",
26
26
  "@internationalized/number": "^3.2.1",
27
27
  "@internationalized/string": "^3.1.1",
28
- "@react-aria/focus": "^3.14.0",
29
- "@react-aria/i18n": "^3.8.1",
30
- "@react-aria/interactions": "^3.17.0",
31
- "@react-aria/label": "^3.6.1",
32
- "@react-aria/spinbutton": "^3.5.1",
33
- "@react-aria/utils": "^3.19.0",
34
- "@react-stately/datepicker": "^3.6.0",
35
- "@react-types/button": "^3.7.4",
36
- "@react-types/calendar": "^3.3.1",
37
- "@react-types/datepicker": "^3.5.0",
38
- "@react-types/dialog": "^3.5.4",
39
- "@react-types/shared": "^3.19.0",
28
+ "@react-aria/focus": "^3.14.1",
29
+ "@react-aria/i18n": "^3.8.2",
30
+ "@react-aria/interactions": "^3.18.0",
31
+ "@react-aria/label": "^3.7.0",
32
+ "@react-aria/spinbutton": "^3.5.2",
33
+ "@react-aria/utils": "^3.20.0",
34
+ "@react-stately/datepicker": "^3.7.0",
35
+ "@react-types/button": "^3.8.0",
36
+ "@react-types/calendar": "^3.4.0",
37
+ "@react-types/datepicker": "^3.6.0",
38
+ "@react-types/dialog": "^3.5.5",
39
+ "@react-types/shared": "^3.20.0",
40
40
  "@swc/helpers": "^0.5.0"
41
41
  },
42
42
  "peerDependencies": {
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "d4dfe4bb842a914f10045ee63fc6b92f034c5b30"
49
+ "gitHead": "54fbaa67cc56867506811819fef765546d403253"
50
50
  }
@@ -129,7 +129,7 @@ export function useDatePicker<T extends DateValue>(props: AriaDatePickerProps<T>
129
129
  isDisabled: props.isDisabled,
130
130
  isReadOnly: props.isReadOnly,
131
131
  isRequired: props.isRequired,
132
- validationState: state.validationState,
132
+ isInvalid: state.isInvalid,
133
133
  autoFocus: props.autoFocus,
134
134
  name: props.name
135
135
  },
@@ -159,7 +159,7 @@ export function useDatePicker<T extends DateValue>(props: AriaDatePickerProps<T>
159
159
  isReadOnly: props.isReadOnly,
160
160
  isDateUnavailable: props.isDateUnavailable,
161
161
  defaultFocusedValue: state.dateValue ? undefined : props.placeholderValue,
162
- validationState: state.validationState,
162
+ isInvalid: state.isInvalid,
163
163
  errorMessage: props.errorMessage
164
164
  }
165
165
  };
@@ -12,6 +12,10 @@ export function useDatePickerGroup(state: DatePickerState | DateRangePickerState
12
12
 
13
13
  // Open the popover on alt + arrow down
14
14
  let onKeyDown = (e: KeyboardEvent) => {
15
+ if (!e.currentTarget.contains(e.target)) {
16
+ return;
17
+ }
18
+
15
19
  if (e.altKey && (e.key === 'ArrowDown' || e.key === 'ArrowUp') && 'setOpen' in state) {
16
20
  e.preventDefault();
17
21
  e.stopPropagation();
@@ -102,7 +102,7 @@ export function useDateRangePicker<T extends DateValue>(props: AriaDateRangePick
102
102
  isDisabled: props.isDisabled,
103
103
  isReadOnly: props.isReadOnly,
104
104
  isRequired: props.isRequired,
105
- validationState: state.validationState
105
+ isInvalid: state.isInvalid
106
106
  };
107
107
 
108
108
  let domProps = filterDOMProps(props);
@@ -187,7 +187,7 @@ export function useDateRangePicker<T extends DateValue>(props: AriaDateRangePick
187
187
  isDateUnavailable: props.isDateUnavailable,
188
188
  allowsNonContiguousRanges: props.allowsNonContiguousRanges,
189
189
  defaultFocusedValue: state.dateRange ? undefined : props.placeholderValue,
190
- validationState: state.validationState,
190
+ isInvalid: state.isInvalid,
191
191
  errorMessage: props.errorMessage
192
192
  }
193
193
  };
@@ -335,7 +335,7 @@ export function useDateSegment(segment: DateSegment, state: DateFieldState, ref:
335
335
  // Only apply aria-describedby to the first segment, unless the field is invalid. This avoids it being
336
336
  // read every time the user navigates to a new segment.
337
337
  let firstSegment = useMemo(() => state.segments.find(s => s.isEditable), [state.segments]);
338
- if (segment !== firstSegment && state.validationState !== 'invalid') {
338
+ if (segment !== firstSegment && !state.isInvalid) {
339
339
  ariaDescribedBy = undefined;
340
340
  }
341
341
 
@@ -364,7 +364,7 @@ export function useDateSegment(segment: DateSegment, state: DateFieldState, ref:
364
364
  segmentProps: mergeProps(spinButtonProps, labelProps, {
365
365
  id,
366
366
  ...touchPropOverrides,
367
- 'aria-invalid': state.validationState === 'invalid' ? 'true' : undefined,
367
+ 'aria-invalid': state.isInvalid ? 'true' : undefined,
368
368
  'aria-describedby': ariaDescribedBy,
369
369
  'aria-readonly': state.isReadOnly || !segment.isEditable ? 'true' : undefined,
370
370
  'data-placeholder': segment.isPlaceholder || undefined,