@react-types/datepicker 3.0.0-rc.1 → 3.1.1
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 +5 -5
- package/src/index.d.ts +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-types/datepicker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"url": "https://github.com/adobe/react-spectrum"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@internationalized/date": "3.0.
|
|
13
|
-
"@react-types/overlays": "^3.6.
|
|
14
|
-
"@react-types/shared": "^3.
|
|
12
|
+
"@internationalized/date": "^3.0.1",
|
|
13
|
+
"@react-types/overlays": "^3.6.3",
|
|
14
|
+
"@react-types/shared": "^3.14.1"
|
|
15
15
|
},
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "b03ef51e6317547dd0a840f151e59d039b1e1fd3"
|
|
23
23
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ type MappedDateValue<T> =
|
|
|
33
33
|
T extends CalendarDate ? CalendarDate :
|
|
34
34
|
never;
|
|
35
35
|
|
|
36
|
-
export type Granularity = 'day' | 'hour' | 'minute' | 'second'
|
|
36
|
+
export type Granularity = 'day' | 'hour' | 'minute' | 'second';
|
|
37
37
|
interface DatePickerBase<T extends DateValue> extends InputBase, Validation, FocusableProps, LabelableProps, HelpTextProps, OverlayTriggerProps {
|
|
38
38
|
/** The minimum allowed date that a user may select. */
|
|
39
39
|
minValue?: DateValue,
|
|
@@ -41,7 +41,7 @@ interface DatePickerBase<T extends DateValue> extends InputBase, Validation, Foc
|
|
|
41
41
|
maxValue?: DateValue,
|
|
42
42
|
/** Callback that is called for each date of the calendar. If it returns true, then the date is unavailable. */
|
|
43
43
|
isDateUnavailable?: (date: DateValue) => boolean,
|
|
44
|
-
/** 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. */
|
|
45
45
|
placeholderValue?: T,
|
|
46
46
|
/** Whether to display the time in 12 or 24 hour format. By default, this is determined by the user's locale. */
|
|
47
47
|
hourCycle?: 12 | 24,
|
|
@@ -111,10 +111,13 @@ export interface TimePickerProps<T extends TimeValue> extends InputBase, Validat
|
|
|
111
111
|
* Determines the smallest unit that is displayed in the time picker.
|
|
112
112
|
* @default 'minute'
|
|
113
113
|
*/
|
|
114
|
-
granularity?: 'hour' | 'minute' | 'second'
|
|
114
|
+
granularity?: 'hour' | 'minute' | 'second',
|
|
115
115
|
/** Whether to hide the time zone abbreviation. */
|
|
116
116
|
hideTimeZone?: boolean,
|
|
117
|
-
/**
|
|
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
|
+
*/
|
|
118
121
|
placeholderValue?: T,
|
|
119
122
|
/** The minimum allowed time that a user may select. */
|
|
120
123
|
minValue?: TimeValue,
|
|
@@ -124,10 +127,13 @@ export interface TimePickerProps<T extends TimeValue> extends InputBase, Validat
|
|
|
124
127
|
|
|
125
128
|
export interface AriaTimeFieldProps<T extends TimeValue> extends TimePickerProps<T>, AriaLabelingProps, DOMProps {}
|
|
126
129
|
|
|
127
|
-
export interface
|
|
130
|
+
export interface SpectrumTimeFieldProps<T extends TimeValue> extends AriaTimeFieldProps<T>, SpectrumLabelableProps, StyleProps {
|
|
128
131
|
/**
|
|
129
132
|
* Whether the time field should be displayed with a quiet style.
|
|
130
133
|
* @default false
|
|
131
134
|
*/
|
|
132
135
|
isQuiet?: boolean
|
|
133
136
|
}
|
|
137
|
+
|
|
138
|
+
// backward compatibility
|
|
139
|
+
export type SpectrumTimePickerProps<T extends TimeValue> = SpectrumTimeFieldProps<T>;
|