@react-aria/datepicker 3.4.0 → 3.5.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/dist/import.mjs +15 -13
- package/dist/main.js +15 -13
- package/dist/main.js.map +1 -1
- package/dist/module.js +15 -13
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +18 -18
- package/src/useDateField.ts +1 -1
- package/src/useDatePicker.ts +3 -2
- package/src/useDateRangePicker.ts +3 -2
- package/src/useDateSegment.ts +1 -1
- package/src/useDisplayNames.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/datepicker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,22 +22,22 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@internationalized/date": "^3.
|
|
26
|
-
"@internationalized/number": "^3.2.
|
|
27
|
-
"@internationalized/string": "^3.1.
|
|
28
|
-
"@react-aria/focus": "^3.
|
|
29
|
-
"@react-aria/i18n": "^3.
|
|
30
|
-
"@react-aria/interactions": "^3.
|
|
31
|
-
"@react-aria/label": "^3.
|
|
32
|
-
"@react-aria/spinbutton": "^3.
|
|
33
|
-
"@react-aria/utils": "^3.
|
|
34
|
-
"@react-stately/datepicker": "^3.
|
|
35
|
-
"@react-types/button": "^3.7.
|
|
36
|
-
"@react-types/calendar": "^3.
|
|
37
|
-
"@react-types/datepicker": "^3.
|
|
38
|
-
"@react-types/dialog": "^3.5.
|
|
39
|
-
"@react-types/shared": "^3.18.
|
|
40
|
-
"@swc/helpers": "^0.
|
|
25
|
+
"@internationalized/date": "^3.3.0",
|
|
26
|
+
"@internationalized/number": "^3.2.1",
|
|
27
|
+
"@internationalized/string": "^3.1.1",
|
|
28
|
+
"@react-aria/focus": "^3.13.0",
|
|
29
|
+
"@react-aria/i18n": "^3.8.0",
|
|
30
|
+
"@react-aria/interactions": "^3.16.0",
|
|
31
|
+
"@react-aria/label": "^3.6.0",
|
|
32
|
+
"@react-aria/spinbutton": "^3.5.0",
|
|
33
|
+
"@react-aria/utils": "^3.18.0",
|
|
34
|
+
"@react-stately/datepicker": "^3.5.0",
|
|
35
|
+
"@react-types/button": "^3.7.3",
|
|
36
|
+
"@react-types/calendar": "^3.3.0",
|
|
37
|
+
"@react-types/datepicker": "^3.4.0",
|
|
38
|
+
"@react-types/dialog": "^3.5.3",
|
|
39
|
+
"@react-types/shared": "^3.18.1",
|
|
40
|
+
"@swc/helpers": "^0.5.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "504e40e0a50c1b20ed0fb3ba9561a263b6d5565e"
|
|
50
50
|
}
|
package/src/useDateField.ts
CHANGED
|
@@ -94,7 +94,7 @@ export function useDateField<T extends DateValue>(props: AriaDateFieldOptions<T>
|
|
|
94
94
|
// Pass labels and other information to segments.
|
|
95
95
|
hookData.set(state, {
|
|
96
96
|
ariaLabel: props['aria-label'],
|
|
97
|
-
ariaLabelledBy: [props['aria-labelledby']
|
|
97
|
+
ariaLabelledBy: [labelProps.id, props['aria-labelledby']].filter(Boolean).join(' ') || undefined,
|
|
98
98
|
ariaDescribedBy: describedBy,
|
|
99
99
|
focusManager
|
|
100
100
|
});
|
package/src/useDatePicker.ts
CHANGED
|
@@ -124,6 +124,7 @@ export function useDatePicker<T extends DateValue>(props: AriaDatePickerProps<T>
|
|
|
124
124
|
placeholderValue: props.placeholderValue,
|
|
125
125
|
hideTimeZone: props.hideTimeZone,
|
|
126
126
|
hourCycle: props.hourCycle,
|
|
127
|
+
shouldForceLeadingZeros: props.shouldForceLeadingZeros,
|
|
127
128
|
granularity: props.granularity,
|
|
128
129
|
isDisabled: props.isDisabled,
|
|
129
130
|
isReadOnly: props.isReadOnly,
|
|
@@ -138,14 +139,14 @@ export function useDatePicker<T extends DateValue>(props: AriaDatePickerProps<T>
|
|
|
138
139
|
id: buttonId,
|
|
139
140
|
'aria-haspopup': 'dialog',
|
|
140
141
|
'aria-label': stringFormatter.format('calendar'),
|
|
141
|
-
'aria-labelledby': `${
|
|
142
|
+
'aria-labelledby': `${buttonId} ${labelledBy}`,
|
|
142
143
|
'aria-describedby': ariaDescribedBy,
|
|
143
144
|
'aria-expanded': state.isOpen || undefined,
|
|
144
145
|
onPress: () => state.setOpen(true)
|
|
145
146
|
},
|
|
146
147
|
dialogProps: {
|
|
147
148
|
id: dialogId,
|
|
148
|
-
'aria-labelledby': `${
|
|
149
|
+
'aria-labelledby': `${buttonId} ${labelledBy}`
|
|
149
150
|
},
|
|
150
151
|
calendarProps: {
|
|
151
152
|
autoFocus: true,
|
|
@@ -98,6 +98,7 @@ export function useDateRangePicker<T extends DateValue>(props: AriaDateRangePick
|
|
|
98
98
|
hideTimeZone: props.hideTimeZone,
|
|
99
99
|
hourCycle: props.hourCycle,
|
|
100
100
|
granularity: props.granularity,
|
|
101
|
+
shouldForceLeadingZeros: props.shouldForceLeadingZeros,
|
|
101
102
|
isDisabled: props.isDisabled,
|
|
102
103
|
isReadOnly: props.isReadOnly,
|
|
103
104
|
isRequired: props.isRequired,
|
|
@@ -149,14 +150,14 @@ export function useDateRangePicker<T extends DateValue>(props: AriaDateRangePick
|
|
|
149
150
|
id: buttonId,
|
|
150
151
|
'aria-haspopup': 'dialog',
|
|
151
152
|
'aria-label': stringFormatter.format('calendar'),
|
|
152
|
-
'aria-labelledby': `${
|
|
153
|
+
'aria-labelledby': `${buttonId} ${labelledBy}`,
|
|
153
154
|
'aria-describedby': ariaDescribedBy,
|
|
154
155
|
'aria-expanded': state.isOpen || undefined,
|
|
155
156
|
onPress: () => state.setOpen(true)
|
|
156
157
|
},
|
|
157
158
|
dialogProps: {
|
|
158
159
|
id: dialogId,
|
|
159
|
-
'aria-labelledby': `${
|
|
160
|
+
'aria-labelledby': `${buttonId} ${labelledBy}`
|
|
160
161
|
},
|
|
161
162
|
startFieldProps: {
|
|
162
163
|
...startFieldProps,
|
package/src/useDateSegment.ts
CHANGED
|
@@ -346,7 +346,7 @@ export function useDateSegment(segment: DateSegment, state: DateFieldState, ref:
|
|
|
346
346
|
// This is needed because VoiceOver on iOS does not announce groups.
|
|
347
347
|
let name = segment.type === 'literal' ? '' : displayNames.of(segment.type);
|
|
348
348
|
let labelProps = useLabels({
|
|
349
|
-
'aria-label':
|
|
349
|
+
'aria-label': `${name}${ariaLabel ? `, ${ariaLabel}` : ''}${ariaLabelledBy ? ', ' : ''}`,
|
|
350
350
|
'aria-labelledby': ariaLabelledBy
|
|
351
351
|
});
|
|
352
352
|
|
package/src/useDisplayNames.ts
CHANGED
|
@@ -16,7 +16,7 @@ import {LocalizedStringDictionary} from '@internationalized/string';
|
|
|
16
16
|
import {useLocale} from '@react-aria/i18n';
|
|
17
17
|
import {useMemo} from 'react';
|
|
18
18
|
|
|
19
|
-
type Field =
|
|
19
|
+
type Field = Intl.DateTimeFormatPartTypes;
|
|
20
20
|
interface DisplayNames {
|
|
21
21
|
of(field: Field): string
|
|
22
22
|
}
|