@react-types/datepicker 3.0.0-nightly.3180 → 3.0.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 +6 -5
- package/src/index.d.ts +14 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-types/datepicker",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -9,14 +9,15 @@
|
|
|
9
9
|
"url": "https://github.com/adobe/react-spectrum"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@internationalized/date": "3.0.0
|
|
13
|
-
"@react-types/
|
|
12
|
+
"@internationalized/date": "^3.0.0",
|
|
13
|
+
"@react-types/overlays": "^3.6.1",
|
|
14
|
+
"@react-types/shared": "^3.13.1"
|
|
14
15
|
},
|
|
15
16
|
"publishConfig": {
|
|
16
17
|
"access": "public"
|
|
17
18
|
},
|
|
18
19
|
"peerDependencies": {
|
|
19
|
-
"react": "^16.8.0 || ^17.0.0-rc.1"
|
|
20
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
|
|
20
21
|
},
|
|
21
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "715c3f563ccf8c2e0102d3e18403d9db21a05a71"
|
|
22
23
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
ValueBase
|
|
25
25
|
} from '@react-types/shared';
|
|
26
26
|
import {CalendarDate, CalendarDateTime, Time, ZonedDateTime} from '@internationalized/date';
|
|
27
|
+
import {OverlayTriggerProps} from '@react-types/overlays';
|
|
27
28
|
|
|
28
29
|
export type DateValue = CalendarDate | CalendarDateTime | ZonedDateTime;
|
|
29
30
|
type MappedDateValue<T> =
|
|
@@ -33,14 +34,14 @@ type MappedDateValue<T> =
|
|
|
33
34
|
never;
|
|
34
35
|
|
|
35
36
|
export type Granularity = 'day' | 'hour' | 'minute' | 'second' | 'millisecond';
|
|
36
|
-
interface DatePickerBase<T extends DateValue> extends InputBase, Validation, FocusableProps, LabelableProps, HelpTextProps {
|
|
37
|
+
interface DatePickerBase<T extends DateValue> extends InputBase, Validation, FocusableProps, LabelableProps, HelpTextProps, OverlayTriggerProps {
|
|
37
38
|
/** The minimum allowed date that a user may select. */
|
|
38
39
|
minValue?: DateValue,
|
|
39
40
|
/** The maximum allowed date that a user may select. */
|
|
40
41
|
maxValue?: DateValue,
|
|
41
42
|
/** Callback that is called for each date of the calendar. If it returns true, then the date is unavailable. */
|
|
42
43
|
isDateUnavailable?: (date: DateValue) => boolean,
|
|
43
|
-
/** A placeholder date
|
|
44
|
+
/** A placeholder date that influences the format of the placeholder shown when no value is selected. Defaults to today's date at midnight. */
|
|
44
45
|
placeholderValue?: T,
|
|
45
46
|
/** Whether to display the time in 12 or 24 hour format. By default, this is determined by the user's locale. */
|
|
46
47
|
hourCycle?: 12 | 24,
|
|
@@ -84,7 +85,12 @@ interface SpectrumDatePickerBase<T extends DateValue> extends AriaDatePickerBase
|
|
|
84
85
|
* The maximum number of months to display at once in the calendar popover, if screen space permits.
|
|
85
86
|
* @default 1
|
|
86
87
|
*/
|
|
87
|
-
maxVisibleMonths?: number
|
|
88
|
+
maxVisibleMonths?: number,
|
|
89
|
+
/**
|
|
90
|
+
* Whether the calendar popover should automatically flip direction when space is limited.
|
|
91
|
+
* @default true
|
|
92
|
+
*/
|
|
93
|
+
shouldFlip?: boolean
|
|
88
94
|
}
|
|
89
95
|
|
|
90
96
|
export interface SpectrumDatePickerProps<T extends DateValue> extends DatePickerProps<T>, SpectrumDatePickerBase<T> {}
|
|
@@ -98,7 +104,7 @@ type MappedTimeValue<T> =
|
|
|
98
104
|
T extends Time ? Time :
|
|
99
105
|
never;
|
|
100
106
|
|
|
101
|
-
export interface TimePickerProps<T extends TimeValue> extends InputBase, Validation, FocusableProps, LabelableProps, ValueBase<T, MappedTimeValue<T>> {
|
|
107
|
+
export interface TimePickerProps<T extends TimeValue> extends InputBase, Validation, FocusableProps, LabelableProps, HelpTextProps, ValueBase<T, MappedTimeValue<T>> {
|
|
102
108
|
/** Whether to display the time in 12 or 24 hour format. By default, this is determined by the user's locale. */
|
|
103
109
|
hourCycle?: 12 | 24,
|
|
104
110
|
/**
|
|
@@ -108,7 +114,10 @@ export interface TimePickerProps<T extends TimeValue> extends InputBase, Validat
|
|
|
108
114
|
granularity?: 'hour' | 'minute' | 'second' | 'millisecond',
|
|
109
115
|
/** Whether to hide the time zone abbreviation. */
|
|
110
116
|
hideTimeZone?: boolean,
|
|
111
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* A placeholder time that influences the format of the placeholder shown when no value is selected.
|
|
119
|
+
* Defaults to 12:00 AM or 00:00 depending on the hour cycle.
|
|
120
|
+
*/
|
|
112
121
|
placeholderValue?: T,
|
|
113
122
|
/** The minimum allowed time that a user may select. */
|
|
114
123
|
minValue?: TimeValue,
|