@atlaskit/datetime-picker 14.0.2 → 14.0.3

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.
@@ -1,86 +1,5 @@
1
1
  import React from 'react';
2
- import { type ActionMeta, type OptionType, type ValueType } from '@atlaskit/select';
3
- import { type Appearance, type Spacing, type TimePickerBaseProps } from '../types';
4
- type TimePickerProps = typeof timePickerDefaultProps & TimePickerBaseProps;
5
- interface State {
6
- isOpen: boolean;
7
- /**
8
- * When being cleared from the icon the TimePicker is blurred.
9
- * This variable defines whether the default onMenuOpen or onMenuClose
10
- * events should behave as normal
11
- */
12
- clearingFromIcon: boolean;
13
- value: string;
14
- isFocused: boolean;
15
- }
16
- declare const timePickerDefaultProps: {
17
- appearance: Appearance;
18
- autoFocus: boolean;
19
- defaultIsOpen: boolean;
20
- defaultValue: string;
21
- hideIcon: boolean;
22
- id: string;
23
- innerProps: {};
24
- isDisabled: boolean;
25
- isInvalid: boolean;
26
- label: string;
27
- name: string;
28
- onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
29
- onChange: (_value: string) => void;
30
- onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
31
- parseInputValue: (time: string, _timeFormat: string) => string | Date;
32
- selectProps: {};
33
- spacing: Spacing;
34
- times: string[];
35
- timeIsEditable: boolean;
36
- locale: string;
37
- };
38
- declare class TimePickerComponent extends React.Component<TimePickerProps, State> {
39
- containerRef: HTMLElement | null;
40
- static defaultProps: {
41
- appearance: Appearance;
42
- autoFocus: boolean;
43
- defaultIsOpen: boolean;
44
- defaultValue: string;
45
- hideIcon: boolean;
46
- id: string;
47
- innerProps: {};
48
- isDisabled: boolean;
49
- isInvalid: boolean;
50
- label: string;
51
- name: string;
52
- onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
53
- onChange: (_value: string) => void;
54
- onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
55
- parseInputValue: (time: string, _timeFormat: string) => string | Date;
56
- selectProps: {};
57
- spacing: Spacing;
58
- times: string[];
59
- timeIsEditable: boolean;
60
- locale: string;
61
- };
62
- state: {
63
- isOpen: boolean;
64
- clearingFromIcon: boolean;
65
- value: string;
66
- isFocused: boolean;
67
- };
68
- getValue: () => string;
69
- getIsOpen: () => boolean;
70
- onChange: (newValue: ValueType<OptionType> | string, action?: ActionMeta<OptionType>) => void;
71
- /**
72
- * Only allow custom times if timeIsEditable prop is true
73
- */
74
- onCreateOption: (inputValue: string) => void;
75
- onMenuOpen: () => void;
76
- onMenuClose: () => void;
77
- setContainerRef: (ref: HTMLElement | null) => void;
78
- onBlur: (event: React.FocusEvent<HTMLElement>) => void;
79
- onFocus: (event: React.FocusEvent<HTMLElement>) => void;
80
- onSelectKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
81
- render(): JSX.Element;
82
- }
83
- export { TimePickerComponent as TimePickerWithoutAnalytics };
2
+ import { type TimePickerBaseProps } from '../types';
84
3
  /**
85
4
  * __Time picker__
86
5
  *
@@ -90,26 +9,5 @@ export { TimePickerComponent as TimePickerWithoutAnalytics };
90
9
  * - [Code](https://atlassian.design/components/datetime-picker/time-picker/code)
91
10
  * - [Usage](https://atlassian.design/components/datetime-picker/time-picker/usage)
92
11
  */
93
- declare const TimePicker: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "placeholder" | "aria-describedby" | "value" | "isOpen" | "formatDisplayLabel" | "timeFormat"> & Partial<Pick<Omit<TimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "times" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "locale" | "autoFocus" | "name" | "spacing" | "isInvalid" | "defaultIsOpen" | "parseInputValue" | "hideIcon" | "timeIsEditable">> & Partial<Pick<{
94
- appearance: Appearance;
95
- autoFocus: boolean;
96
- defaultIsOpen: boolean;
97
- defaultValue: string;
98
- hideIcon: boolean;
99
- id: string;
100
- innerProps: {};
101
- isDisabled: boolean;
102
- isInvalid: boolean;
103
- label: string;
104
- name: string;
105
- onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
106
- onChange: (_value: string) => void;
107
- onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
108
- parseInputValue: (time: string, _timeFormat: string) => string | Date;
109
- selectProps: {};
110
- spacing: Spacing;
111
- times: string[];
112
- timeIsEditable: boolean;
113
- locale: string;
114
- }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "defaultIsOpen" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
12
+ declare const TimePicker: React.ForwardRefExoticComponent<Pick<TimePickerBaseProps, "times" | "testId" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "defaultIsOpen" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<unknown>>;
115
13
  export default TimePicker;
@@ -206,6 +206,10 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps, PickerSel
206
206
  weekStartDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
207
207
  }
208
208
  export interface TimePickerBaseProps extends WithAnalyticsEventsProps, PickerSelectProps {
209
+ /**
210
+ * Additional information to be included in the `context` of analytics events
211
+ */
212
+ analyticsContext?: Record<string, any>;
209
213
  /**
210
214
  * Set the appearance of the picker.
211
215
  * `subtle` will remove the borders, background, and icon.
@@ -1,86 +1,5 @@
1
1
  import React from 'react';
2
- import { type ActionMeta, type OptionType, type ValueType } from '@atlaskit/select';
3
- import { type Appearance, type Spacing, type TimePickerBaseProps } from '../types';
4
- type TimePickerProps = typeof timePickerDefaultProps & TimePickerBaseProps;
5
- interface State {
6
- isOpen: boolean;
7
- /**
8
- * When being cleared from the icon the TimePicker is blurred.
9
- * This variable defines whether the default onMenuOpen or onMenuClose
10
- * events should behave as normal
11
- */
12
- clearingFromIcon: boolean;
13
- value: string;
14
- isFocused: boolean;
15
- }
16
- declare const timePickerDefaultProps: {
17
- appearance: Appearance;
18
- autoFocus: boolean;
19
- defaultIsOpen: boolean;
20
- defaultValue: string;
21
- hideIcon: boolean;
22
- id: string;
23
- innerProps: {};
24
- isDisabled: boolean;
25
- isInvalid: boolean;
26
- label: string;
27
- name: string;
28
- onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
29
- onChange: (_value: string) => void;
30
- onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
31
- parseInputValue: (time: string, _timeFormat: string) => string | Date;
32
- selectProps: {};
33
- spacing: Spacing;
34
- times: string[];
35
- timeIsEditable: boolean;
36
- locale: string;
37
- };
38
- declare class TimePickerComponent extends React.Component<TimePickerProps, State> {
39
- containerRef: HTMLElement | null;
40
- static defaultProps: {
41
- appearance: Appearance;
42
- autoFocus: boolean;
43
- defaultIsOpen: boolean;
44
- defaultValue: string;
45
- hideIcon: boolean;
46
- id: string;
47
- innerProps: {};
48
- isDisabled: boolean;
49
- isInvalid: boolean;
50
- label: string;
51
- name: string;
52
- onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
53
- onChange: (_value: string) => void;
54
- onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
55
- parseInputValue: (time: string, _timeFormat: string) => string | Date;
56
- selectProps: {};
57
- spacing: Spacing;
58
- times: string[];
59
- timeIsEditable: boolean;
60
- locale: string;
61
- };
62
- state: {
63
- isOpen: boolean;
64
- clearingFromIcon: boolean;
65
- value: string;
66
- isFocused: boolean;
67
- };
68
- getValue: () => string;
69
- getIsOpen: () => boolean;
70
- onChange: (newValue: ValueType<OptionType> | string, action?: ActionMeta<OptionType>) => void;
71
- /**
72
- * Only allow custom times if timeIsEditable prop is true
73
- */
74
- onCreateOption: (inputValue: string) => void;
75
- onMenuOpen: () => void;
76
- onMenuClose: () => void;
77
- setContainerRef: (ref: HTMLElement | null) => void;
78
- onBlur: (event: React.FocusEvent<HTMLElement>) => void;
79
- onFocus: (event: React.FocusEvent<HTMLElement>) => void;
80
- onSelectKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
81
- render(): JSX.Element;
82
- }
83
- export { TimePickerComponent as TimePickerWithoutAnalytics };
2
+ import { type TimePickerBaseProps } from '../types';
84
3
  /**
85
4
  * __Time picker__
86
5
  *
@@ -90,26 +9,5 @@ export { TimePickerComponent as TimePickerWithoutAnalytics };
90
9
  * - [Code](https://atlassian.design/components/datetime-picker/time-picker/code)
91
10
  * - [Usage](https://atlassian.design/components/datetime-picker/time-picker/usage)
92
11
  */
93
- declare const TimePicker: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "placeholder" | "aria-describedby" | "value" | "isOpen" | "formatDisplayLabel" | "timeFormat"> & Partial<Pick<Omit<TimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "times" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "locale" | "autoFocus" | "name" | "spacing" | "isInvalid" | "defaultIsOpen" | "parseInputValue" | "hideIcon" | "timeIsEditable">> & Partial<Pick<{
94
- appearance: Appearance;
95
- autoFocus: boolean;
96
- defaultIsOpen: boolean;
97
- defaultValue: string;
98
- hideIcon: boolean;
99
- id: string;
100
- innerProps: {};
101
- isDisabled: boolean;
102
- isInvalid: boolean;
103
- label: string;
104
- name: string;
105
- onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
106
- onChange: (_value: string) => void;
107
- onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
108
- parseInputValue: (time: string, _timeFormat: string) => string | Date;
109
- selectProps: {};
110
- spacing: Spacing;
111
- times: string[];
112
- timeIsEditable: boolean;
113
- locale: string;
114
- }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "defaultIsOpen" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
12
+ declare const TimePicker: React.ForwardRefExoticComponent<Pick<TimePickerBaseProps, "times" | "testId" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "defaultIsOpen" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<unknown>>;
115
13
  export default TimePicker;
@@ -206,6 +206,10 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps, PickerSel
206
206
  weekStartDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
207
207
  }
208
208
  export interface TimePickerBaseProps extends WithAnalyticsEventsProps, PickerSelectProps {
209
+ /**
210
+ * Additional information to be included in the `context` of analytics events
211
+ */
212
+ analyticsContext?: Record<string, any>;
209
213
  /**
210
214
  * Set the appearance of the picker.
211
215
  * `subtle` will remove the borders, background, and icon.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "14.0.2",
3
+ "version": "14.0.3",
4
4
  "description": "A date time picker allows the user to select an associated date and time.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"