@atlaskit/datetime-picker 13.0.11 → 13.1.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/components/date-picker.js +13 -49
  3. package/dist/cjs/components/date-time-picker.js +12 -63
  4. package/dist/cjs/components/time-picker.js +12 -22
  5. package/dist/cjs/internal/date-time-picker-container.js +84 -0
  6. package/dist/cjs/internal/fixed-layer-menu.js +29 -0
  7. package/dist/cjs/internal/menu.js +57 -0
  8. package/dist/es2019/components/date-picker.js +8 -43
  9. package/dist/es2019/components/date-time-picker.js +13 -64
  10. package/dist/es2019/components/time-picker.js +7 -15
  11. package/dist/es2019/internal/date-time-picker-container.js +77 -0
  12. package/dist/es2019/internal/fixed-layer-menu.js +20 -0
  13. package/dist/es2019/internal/menu.js +48 -0
  14. package/dist/esm/components/date-picker.js +12 -48
  15. package/dist/esm/components/date-time-picker.js +13 -64
  16. package/dist/esm/components/time-picker.js +10 -20
  17. package/dist/esm/internal/date-time-picker-container.js +76 -0
  18. package/dist/esm/internal/fixed-layer-menu.js +23 -0
  19. package/dist/esm/internal/menu.js +49 -0
  20. package/dist/types/components/date-picker.d.ts +5 -2
  21. package/dist/types/components/date-time-picker.d.ts +2 -2
  22. package/dist/types/components/time-picker.d.ts +5 -2
  23. package/dist/types/internal/date-time-picker-container.d.ts +15 -0
  24. package/dist/types/internal/fixed-layer-menu.d.ts +7 -0
  25. package/dist/types/internal/menu.d.ts +7 -0
  26. package/dist/types/types.d.ts +8 -0
  27. package/dist/types-ts4.5/components/date-picker.d.ts +5 -2
  28. package/dist/types-ts4.5/components/date-time-picker.d.ts +2 -2
  29. package/dist/types-ts4.5/components/time-picker.d.ts +5 -2
  30. package/dist/types-ts4.5/internal/date-time-picker-container.d.ts +15 -0
  31. package/dist/types-ts4.5/internal/fixed-layer-menu.d.ts +7 -0
  32. package/dist/types-ts4.5/internal/menu.d.ts +7 -0
  33. package/dist/types-ts4.5/types.d.ts +8 -0
  34. package/extract-react-types/date-picker-props.tsx +1 -1
  35. package/extract-react-types/time-picker-props.tsx +1 -1
  36. package/package.json +7 -6
@@ -0,0 +1,76 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ /** @jsx jsx */
3
+ import { css, jsx } from '@emotion/react';
4
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
+ import { B100, N0, N100, N20, N30, R400 } from '@atlaskit/theme/colors';
6
+ var isInvalidBorderStyles = css({
7
+ borderColor: "var(--ds-border-danger, ".concat(R400, ")")
8
+ });
9
+ var isFocusedBorderStyles = css({
10
+ borderColor: "var(--ds-border-focused, ".concat(B100, ")")
11
+ });
12
+ var isFocusedStyles = css({
13
+ backgroundColor: "var(--ds-background-input-pressed, ".concat(N0, ")")
14
+ });
15
+ var subtleBgStyles = css({
16
+ backgroundColor: 'transparent',
17
+ borderColor: 'transparent'
18
+ });
19
+ var subtleFocusedBgStyles = css({
20
+ backgroundColor: "var(--ds-background-input-pressed, transparent)",
21
+ borderColor: 'transparent'
22
+ });
23
+ var noBgStyles = css({
24
+ backgroundColor: 'transparent',
25
+ borderColor: 'transparent',
26
+ '&:hover': {
27
+ backgroundColor: 'transparent',
28
+ borderColor: 'transparent'
29
+ }
30
+ });
31
+ var hoverStyles = css({
32
+ '&:hover': {
33
+ backgroundColor: "var(--ds-background-input-hovered, ".concat(N30, ")"),
34
+ borderColor: "var(--ds-border-input, ".concat(getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? N100 : N30, ")")
35
+ }
36
+ });
37
+ var isInvalidHoverStyles = css({
38
+ '&:hover': {
39
+ backgroundColor: "var(--ds-background-input-hovered, ".concat(N0, ")"),
40
+ borderColor: "var(--ds-border-danger, ".concat(R400, ")")
41
+ }
42
+ });
43
+ var isDisabledStyles = css({
44
+ '&:hover': {
45
+ cursor: 'default'
46
+ }
47
+ });
48
+ var baseContainerStyles = css({
49
+ display: 'flex',
50
+ backgroundColor: "var(--ds-background-input, ".concat(N20, ")"),
51
+ border: getBooleanFF('platform.design-system-team.update-input-border-wdith_5abwv') ? "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border-input, ".concat(N100, ")")) : "2px solid ".concat("var(--ds-border-input, ".concat(N20, ")")),
52
+ borderRadius: "var(--ds-border-radius, 3px)",
53
+ transition: 'background-color 200ms ease-in-out, border-color 200ms ease-in-out',
54
+ '&:hover': {
55
+ cursor: 'pointer'
56
+ }
57
+ });
58
+
59
+ /**
60
+ * This is the container for the datetime picker component.
61
+ */
62
+ export var DateTimePickerContainer = function DateTimePickerContainer(_ref) {
63
+ var isDisabled = _ref.isDisabled,
64
+ isFocused = _ref.isFocused,
65
+ appearance = _ref.appearance,
66
+ isInvalid = _ref.isInvalid,
67
+ innerProps = _ref.innerProps,
68
+ testId = _ref.testId,
69
+ children = _ref.children;
70
+ var notFocusedOrIsDisabled = !(isFocused || isDisabled);
71
+ return jsx("div", _extends({
72
+ css: [baseContainerStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (isInvalid ? isInvalidHoverStyles : hoverStyles), appearance === 'none' && noBgStyles]
73
+ }, innerProps, {
74
+ "data-testid": testId
75
+ }), children);
76
+ };
@@ -0,0 +1,23 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["selectProps"];
4
+ /** @jsx jsx */
5
+ import { jsx } from '@emotion/react';
6
+ import { components } from '@atlaskit/select';
7
+ import FixedLayer from '../internal/fixed-layer';
8
+
9
+ /**
10
+ * This is the fixed layer menu used in the time picker.
11
+ */
12
+ export var FixedLayerMenu = function FixedLayerMenu(_ref) {
13
+ var selectProps = _ref.selectProps,
14
+ rest = _objectWithoutProperties(_ref, _excluded);
15
+ return jsx(FixedLayer, {
16
+ inputValue: selectProps.inputValue,
17
+ containerRef: selectProps.fixedLayerRef,
18
+ content: jsx(components.Menu, _extends({}, rest, {
19
+ menuShouldScrollIntoView: false
20
+ })),
21
+ testId: selectProps.testId
22
+ });
23
+ };
@@ -0,0 +1,49 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ /** @jsx jsx */
3
+ import { css, jsx } from '@emotion/react';
4
+ import Calendar from '@atlaskit/calendar';
5
+ import { UNSAFE_LAYERING } from '@atlaskit/layering';
6
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
7
+ import { N0, N50A, N60A } from '@atlaskit/theme/colors';
8
+ import { layers } from '@atlaskit/theme/constants';
9
+ import FixedLayer from '../internal/fixed-layer';
10
+ import { getValidDate } from './parse-date';
11
+ var menuStyles = css({
12
+ zIndex: layers.dialog(),
13
+ backgroundColor: "var(--ds-surface-overlay, ".concat(N0, ")"),
14
+ borderRadius: "var(--ds-border-radius, 3px)",
15
+ boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")"),
16
+ overflow: 'hidden'
17
+ });
18
+
19
+ /**
20
+ * This is the menu used in the select of the date picker.
21
+ */
22
+ export var Menu = function Menu(_ref) {
23
+ var selectProps = _ref.selectProps,
24
+ innerProps = _ref.innerProps;
25
+ return jsx(UNSAFE_LAYERING, {
26
+ isDisabled: getBooleanFF('platform.design-system-team.layering_qmiw3') ? false : true
27
+ }, jsx(FixedLayer, {
28
+ inputValue: selectProps.inputValue,
29
+ containerRef: selectProps.calendarContainerRef,
30
+ content: jsx("div", _extends({
31
+ css: menuStyles
32
+ }, innerProps), jsx(Calendar, _extends({}, getValidDate(selectProps.calendarValue), getValidDate(selectProps.calendarView), {
33
+ disabled: selectProps.calendarDisabled,
34
+ disabledDateFilter: selectProps.calendarDisabledDateFilter,
35
+ minDate: selectProps.calendarMinDate,
36
+ maxDate: selectProps.calendarMaxDate,
37
+ nextMonthLabel: selectProps.nextMonthLabel,
38
+ onChange: selectProps.onCalendarChange,
39
+ onSelect: selectProps.onCalendarSelect,
40
+ previousMonthLabel: selectProps.previousMonthLabel,
41
+ calendarRef: selectProps.calendarRef,
42
+ selected: [selectProps.calendarValue],
43
+ locale: selectProps.calendarLocale,
44
+ testId: selectProps.testId && "".concat(selectProps.testId, "--calendar"),
45
+ weekStartDay: selectProps.calendarWeekStartDay
46
+ }))),
47
+ testId: selectProps.testId
48
+ }));
49
+ };
@@ -34,6 +34,7 @@ declare const datePickerDefaultProps: {
34
34
  innerProps: {};
35
35
  isDisabled: boolean;
36
36
  isInvalid: boolean;
37
+ label: string;
37
38
  name: string;
38
39
  onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
39
40
  onChange: (_value: string) => void;
@@ -56,6 +57,7 @@ declare class DatePicker extends Component<DatePickerProps, State> {
56
57
  innerProps: {};
57
58
  isDisabled: boolean;
58
59
  isInvalid: boolean;
60
+ label: string;
59
61
  name: string;
60
62
  onBlur: (_event: import("react").FocusEvent<HTMLInputElement>) => void;
61
63
  onChange: (_value: string) => void;
@@ -119,7 +121,7 @@ declare class DatePicker extends Component<DatePickerProps, State> {
119
121
  render(): jsx.JSX.Element;
120
122
  }
121
123
  export { DatePicker as DatePickerWithoutAnalytics };
122
- declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "value" | "placeholder" | "maxDate" | "minDate" | "isOpen" | "nextMonthLabel" | "parseInputValue" | "formatDisplayLabel" | "previousMonthLabel" | "dateFormat" | "weekStartDay"> & Partial<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "icon" | "disabled" | "innerProps" | "isDisabled" | "selectProps" | "appearance" | "id" | "defaultValue" | "onFocus" | "onBlur" | "onChange" | "autoFocus" | "defaultIsOpen" | "disabledDateFilter" | "name" | "spacing" | "isInvalid" | "hideIcon" | "locale">> & Partial<Pick<{
124
+ declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "placeholder" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "weekStartDay" | "value" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "dateFormat"> & Partial<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "label" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "disabledDateFilter" | "locale" | "autoFocus" | "defaultIsOpen" | "name" | "spacing" | "isInvalid" | "hideIcon">> & Partial<Pick<{
123
125
  appearance: Appearance;
124
126
  autoFocus: boolean;
125
127
  defaultIsOpen: boolean;
@@ -132,6 +134,7 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit
132
134
  innerProps: {};
133
135
  isDisabled: boolean;
134
136
  isInvalid: boolean;
137
+ label: string;
135
138
  name: string;
136
139
  onBlur: (_event: import("react").FocusEvent<HTMLInputElement>) => void;
137
140
  onChange: (_value: string) => void;
@@ -139,5 +142,5 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit
139
142
  selectProps: {};
140
143
  spacing: Spacing;
141
144
  locale: string;
142
- }, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "icon" | "disabled" | "innerProps" | "isDisabled" | "selectProps" | "appearance" | "value" | "id" | "key" | "defaultValue" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "autoFocus" | "defaultIsOpen" | "disabledDateFilter" | "maxDate" | "minDate" | "isOpen" | "name" | "nextMonthLabel" | "parseInputValue" | "formatDisplayLabel" | "previousMonthLabel" | "spacing" | "isInvalid" | "hideIcon" | "dateFormat" | "locale" | "weekStartDay" | "analyticsContext"> & import("react").RefAttributes<any>>;
145
+ }, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "label" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "disabledDateFilter" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "locale" | "analyticsContext" | "weekStartDay" | "value" | "autoFocus" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "dateFormat"> & import("react").RefAttributes<any>>;
143
146
  export default _default;
@@ -81,7 +81,7 @@ declare class DateTimePicker extends React.Component<DateTimePickerProps, State>
81
81
  render(): jsx.JSX.Element;
82
82
  }
83
83
  export { DateTimePicker as DateTimePickerWithoutAnalytics };
84
- declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "value" | "dateFormat" | "timeFormat" | "parseValue"> & Partial<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "times" | "innerProps" | "isDisabled" | "appearance" | "id" | "defaultValue" | "onFocus" | "onBlur" | "onChange" | "autoFocus" | "name" | "spacing" | "isInvalid" | "locale" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "datePickerSelectProps" | "timePickerSelectProps">> & Partial<Pick<{
84
+ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "value" | "dateFormat" | "timeFormat" | "parseValue"> & Partial<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "times" | "appearance" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "locale" | "autoFocus" | "name" | "spacing" | "isInvalid" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "datePickerSelectProps" | "timePickerSelectProps">> & Partial<Pick<{
85
85
  appearance: string;
86
86
  autoFocus: boolean;
87
87
  isDisabled: boolean;
@@ -101,5 +101,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimeP
101
101
  times: string[];
102
102
  spacing: string;
103
103
  locale: string;
104
- }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "innerProps" | "isDisabled" | "appearance" | "value" | "id" | "key" | "defaultValue" | "onFocus" | "onBlur" | "onChange" | "autoFocus" | "name" | "spacing" | "isInvalid" | "dateFormat" | "locale" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "parseValue" | "datePickerSelectProps" | "timePickerSelectProps" | "analyticsContext"> & React.RefAttributes<any>>;
104
+ }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "appearance" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "dateFormat" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "parseValue" | "datePickerSelectProps" | "timePickerSelectProps"> & React.RefAttributes<any>>;
105
105
  export default _default;
@@ -23,6 +23,7 @@ declare const timePickerDefaultProps: {
23
23
  innerProps: {};
24
24
  isDisabled: boolean;
25
25
  isInvalid: boolean;
26
+ label: string;
26
27
  name: string;
27
28
  onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
28
29
  onChange: (_value: string) => void;
@@ -46,6 +47,7 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
46
47
  innerProps: {};
47
48
  isDisabled: boolean;
48
49
  isInvalid: boolean;
50
+ label: string;
49
51
  name: string;
50
52
  onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
51
53
  onChange: (_value: string) => void;
@@ -78,7 +80,7 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
78
80
  render(): JSX.Element;
79
81
  }
80
82
  export { TimePicker as TimePickerWithoutAnalytics };
81
- declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "value" | "placeholder" | "isOpen" | "formatDisplayLabel" | "timeFormat"> & Partial<Pick<Omit<TimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "times" | "innerProps" | "isDisabled" | "selectProps" | "appearance" | "id" | "defaultValue" | "onFocus" | "onBlur" | "onChange" | "autoFocus" | "defaultIsOpen" | "name" | "parseInputValue" | "spacing" | "isInvalid" | "hideIcon" | "locale" | "timeIsEditable">> & Partial<Pick<{
83
+ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "placeholder" | "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" | "defaultIsOpen" | "name" | "parseInputValue" | "spacing" | "isInvalid" | "hideIcon" | "timeIsEditable">> & Partial<Pick<{
82
84
  appearance: Appearance;
83
85
  autoFocus: boolean;
84
86
  defaultIsOpen: boolean;
@@ -88,6 +90,7 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePicke
88
90
  innerProps: {};
89
91
  isDisabled: boolean;
90
92
  isInvalid: boolean;
93
+ label: string;
91
94
  name: string;
92
95
  onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
93
96
  onChange: (_value: string) => void;
@@ -98,5 +101,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePicke
98
101
  times: string[];
99
102
  timeIsEditable: boolean;
100
103
  locale: string;
101
- }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "innerProps" | "isDisabled" | "selectProps" | "appearance" | "value" | "id" | "key" | "defaultValue" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "autoFocus" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "locale" | "timeIsEditable" | "timeFormat" | "analyticsContext"> & React.RefAttributes<any>>;
104
+ }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "value" | "autoFocus" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
102
105
  export default _default;
@@ -0,0 +1,15 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { Appearance } from '../types';
4
+ /**
5
+ * This is the container for the datetime picker component.
6
+ */
7
+ export declare const DateTimePickerContainer: ({ isDisabled, isFocused, appearance, isInvalid, innerProps, testId, children, }: {
8
+ isDisabled: boolean;
9
+ isFocused: boolean;
10
+ appearance: Appearance;
11
+ isInvalid: boolean;
12
+ innerProps: React.AllHTMLAttributes<HTMLElement>;
13
+ testId?: string | undefined;
14
+ children: React.ReactNode;
15
+ }) => jsx.JSX.Element;
@@ -0,0 +1,7 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { MenuProps, OptionType } from '@atlaskit/select';
4
+ /**
5
+ * This is the fixed layer menu used in the time picker.
6
+ */
7
+ export declare const FixedLayerMenu: ({ selectProps, ...rest }: MenuProps<OptionType>) => jsx.JSX.Element;
@@ -0,0 +1,7 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { MenuProps } from '@atlaskit/select';
4
+ /**
5
+ * This is the menu used in the select of the date picker.
6
+ */
7
+ export declare const Menu: ({ selectProps, innerProps }: MenuProps<any>) => jsx.JSX.Element;
@@ -34,6 +34,10 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
34
34
  * The function is called with a date string in the format `YYYY-MM-DD` and should return `true` if the date should be disabled.
35
35
  */
36
36
  disabledDateFilter?: (date: string) => boolean;
37
+ /**
38
+ * Accessible name for the Date Picker Select, rendered as `aria-label`. This will override any other method of providing a label.
39
+ */
40
+ label?: string;
37
41
  /**
38
42
  * The latest enabled date. Dates after this are disabled on the calendar. This does not affect what users can type into the picker.
39
43
  */
@@ -190,6 +194,10 @@ export interface TimePickerBaseProps extends WithAnalyticsEventsProps {
190
194
  * Set if the dropdown is open. Will be `false` if not provided.
191
195
  */
192
196
  isOpen?: boolean;
197
+ /**
198
+ * Accessible name for the Time Picker Select, rendered as `aria-label`. This will override any other method of providing a label.
199
+ */
200
+ label?: string;
193
201
  /**
194
202
  * The name of the field.
195
203
  */
@@ -34,6 +34,7 @@ declare const datePickerDefaultProps: {
34
34
  innerProps: {};
35
35
  isDisabled: boolean;
36
36
  isInvalid: boolean;
37
+ label: string;
37
38
  name: string;
38
39
  onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
39
40
  onChange: (_value: string) => void;
@@ -56,6 +57,7 @@ declare class DatePicker extends Component<DatePickerProps, State> {
56
57
  innerProps: {};
57
58
  isDisabled: boolean;
58
59
  isInvalid: boolean;
60
+ label: string;
59
61
  name: string;
60
62
  onBlur: (_event: import("react").FocusEvent<HTMLInputElement>) => void;
61
63
  onChange: (_value: string) => void;
@@ -119,7 +121,7 @@ declare class DatePicker extends Component<DatePickerProps, State> {
119
121
  render(): jsx.JSX.Element;
120
122
  }
121
123
  export { DatePicker as DatePickerWithoutAnalytics };
122
- declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "value" | "placeholder" | "maxDate" | "minDate" | "isOpen" | "nextMonthLabel" | "parseInputValue" | "formatDisplayLabel" | "previousMonthLabel" | "dateFormat" | "weekStartDay"> & Partial<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "icon" | "disabled" | "innerProps" | "isDisabled" | "selectProps" | "appearance" | "id" | "defaultValue" | "onFocus" | "onBlur" | "onChange" | "autoFocus" | "defaultIsOpen" | "disabledDateFilter" | "name" | "spacing" | "isInvalid" | "hideIcon" | "locale">> & Partial<Pick<{
124
+ declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "placeholder" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "weekStartDay" | "value" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "dateFormat"> & Partial<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "label" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "disabledDateFilter" | "locale" | "autoFocus" | "defaultIsOpen" | "name" | "spacing" | "isInvalid" | "hideIcon">> & Partial<Pick<{
123
125
  appearance: Appearance;
124
126
  autoFocus: boolean;
125
127
  defaultIsOpen: boolean;
@@ -132,6 +134,7 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit
132
134
  innerProps: {};
133
135
  isDisabled: boolean;
134
136
  isInvalid: boolean;
137
+ label: string;
135
138
  name: string;
136
139
  onBlur: (_event: import("react").FocusEvent<HTMLInputElement>) => void;
137
140
  onChange: (_value: string) => void;
@@ -139,5 +142,5 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit
139
142
  selectProps: {};
140
143
  spacing: Spacing;
141
144
  locale: string;
142
- }, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "icon" | "disabled" | "innerProps" | "isDisabled" | "selectProps" | "appearance" | "value" | "id" | "key" | "defaultValue" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "autoFocus" | "defaultIsOpen" | "disabledDateFilter" | "maxDate" | "minDate" | "isOpen" | "name" | "nextMonthLabel" | "parseInputValue" | "formatDisplayLabel" | "previousMonthLabel" | "spacing" | "isInvalid" | "hideIcon" | "dateFormat" | "locale" | "weekStartDay" | "analyticsContext"> & import("react").RefAttributes<any>>;
145
+ }, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "label" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "disabledDateFilter" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "locale" | "analyticsContext" | "weekStartDay" | "value" | "autoFocus" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "dateFormat"> & import("react").RefAttributes<any>>;
143
146
  export default _default;
@@ -81,7 +81,7 @@ declare class DateTimePicker extends React.Component<DateTimePickerProps, State>
81
81
  render(): jsx.JSX.Element;
82
82
  }
83
83
  export { DateTimePicker as DateTimePickerWithoutAnalytics };
84
- declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "value" | "dateFormat" | "timeFormat" | "parseValue"> & Partial<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "times" | "innerProps" | "isDisabled" | "appearance" | "id" | "defaultValue" | "onFocus" | "onBlur" | "onChange" | "autoFocus" | "name" | "spacing" | "isInvalid" | "locale" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "datePickerSelectProps" | "timePickerSelectProps">> & Partial<Pick<{
84
+ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "value" | "dateFormat" | "timeFormat" | "parseValue"> & Partial<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "times" | "appearance" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "locale" | "autoFocus" | "name" | "spacing" | "isInvalid" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "datePickerSelectProps" | "timePickerSelectProps">> & Partial<Pick<{
85
85
  appearance: string;
86
86
  autoFocus: boolean;
87
87
  isDisabled: boolean;
@@ -101,5 +101,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimeP
101
101
  times: string[];
102
102
  spacing: string;
103
103
  locale: string;
104
- }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "innerProps" | "isDisabled" | "appearance" | "value" | "id" | "key" | "defaultValue" | "onFocus" | "onBlur" | "onChange" | "autoFocus" | "name" | "spacing" | "isInvalid" | "dateFormat" | "locale" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "parseValue" | "datePickerSelectProps" | "timePickerSelectProps" | "analyticsContext"> & React.RefAttributes<any>>;
104
+ }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "appearance" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "dateFormat" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "parseValue" | "datePickerSelectProps" | "timePickerSelectProps"> & React.RefAttributes<any>>;
105
105
  export default _default;
@@ -23,6 +23,7 @@ declare const timePickerDefaultProps: {
23
23
  innerProps: {};
24
24
  isDisabled: boolean;
25
25
  isInvalid: boolean;
26
+ label: string;
26
27
  name: string;
27
28
  onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
28
29
  onChange: (_value: string) => void;
@@ -46,6 +47,7 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
46
47
  innerProps: {};
47
48
  isDisabled: boolean;
48
49
  isInvalid: boolean;
50
+ label: string;
49
51
  name: string;
50
52
  onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
51
53
  onChange: (_value: string) => void;
@@ -78,7 +80,7 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
78
80
  render(): JSX.Element;
79
81
  }
80
82
  export { TimePicker as TimePickerWithoutAnalytics };
81
- declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "value" | "placeholder" | "isOpen" | "formatDisplayLabel" | "timeFormat"> & Partial<Pick<Omit<TimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "times" | "innerProps" | "isDisabled" | "selectProps" | "appearance" | "id" | "defaultValue" | "onFocus" | "onBlur" | "onChange" | "autoFocus" | "defaultIsOpen" | "name" | "parseInputValue" | "spacing" | "isInvalid" | "hideIcon" | "locale" | "timeIsEditable">> & Partial<Pick<{
83
+ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "placeholder" | "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" | "defaultIsOpen" | "name" | "parseInputValue" | "spacing" | "isInvalid" | "hideIcon" | "timeIsEditable">> & Partial<Pick<{
82
84
  appearance: Appearance;
83
85
  autoFocus: boolean;
84
86
  defaultIsOpen: boolean;
@@ -88,6 +90,7 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePicke
88
90
  innerProps: {};
89
91
  isDisabled: boolean;
90
92
  isInvalid: boolean;
93
+ label: string;
91
94
  name: string;
92
95
  onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
93
96
  onChange: (_value: string) => void;
@@ -98,5 +101,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePicke
98
101
  times: string[];
99
102
  timeIsEditable: boolean;
100
103
  locale: string;
101
- }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "innerProps" | "isDisabled" | "selectProps" | "appearance" | "value" | "id" | "key" | "defaultValue" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "autoFocus" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "locale" | "timeIsEditable" | "timeFormat" | "analyticsContext"> & React.RefAttributes<any>>;
104
+ }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "value" | "autoFocus" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
102
105
  export default _default;
@@ -0,0 +1,15 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { Appearance } from '../types';
4
+ /**
5
+ * This is the container for the datetime picker component.
6
+ */
7
+ export declare const DateTimePickerContainer: ({ isDisabled, isFocused, appearance, isInvalid, innerProps, testId, children, }: {
8
+ isDisabled: boolean;
9
+ isFocused: boolean;
10
+ appearance: Appearance;
11
+ isInvalid: boolean;
12
+ innerProps: React.AllHTMLAttributes<HTMLElement>;
13
+ testId?: string | undefined;
14
+ children: React.ReactNode;
15
+ }) => jsx.JSX.Element;
@@ -0,0 +1,7 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { MenuProps, OptionType } from '@atlaskit/select';
4
+ /**
5
+ * This is the fixed layer menu used in the time picker.
6
+ */
7
+ export declare const FixedLayerMenu: ({ selectProps, ...rest }: MenuProps<OptionType>) => jsx.JSX.Element;
@@ -0,0 +1,7 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { MenuProps } from '@atlaskit/select';
4
+ /**
5
+ * This is the menu used in the select of the date picker.
6
+ */
7
+ export declare const Menu: ({ selectProps, innerProps }: MenuProps<any>) => jsx.JSX.Element;
@@ -34,6 +34,10 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
34
34
  * The function is called with a date string in the format `YYYY-MM-DD` and should return `true` if the date should be disabled.
35
35
  */
36
36
  disabledDateFilter?: (date: string) => boolean;
37
+ /**
38
+ * Accessible name for the Date Picker Select, rendered as `aria-label`. This will override any other method of providing a label.
39
+ */
40
+ label?: string;
37
41
  /**
38
42
  * The latest enabled date. Dates after this are disabled on the calendar. This does not affect what users can type into the picker.
39
43
  */
@@ -190,6 +194,10 @@ export interface TimePickerBaseProps extends WithAnalyticsEventsProps {
190
194
  * Set if the dropdown is open. Will be `false` if not provided.
191
195
  */
192
196
  isOpen?: boolean;
197
+ /**
198
+ * Accessible name for the Time Picker Select, rendered as `aria-label`. This will override any other method of providing a label.
199
+ */
200
+ label?: string;
193
201
  /**
194
202
  * The name of the field.
195
203
  */
@@ -1,4 +1,4 @@
1
- import { DatePickerBaseProps } from '../src/components/date-picker';
1
+ import { DatePickerBaseProps } from '../src/types';
2
2
 
3
3
  export default function DatePickerProps(props: DatePickerBaseProps) {
4
4
  return null;
@@ -1,4 +1,4 @@
1
- import { TimePickerBaseProps } from '../src/components/time-picker';
1
+ import { TimePickerBaseProps } from '../src/types';
2
2
 
3
3
  export default function TimePickerProps(props: TimePickerBaseProps) {
4
4
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "13.0.11",
3
+ "version": "13.1.0",
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/"
@@ -41,14 +41,14 @@
41
41
  "@atlaskit/analytics-next": "^9.2.0",
42
42
  "@atlaskit/calendar": "^14.0.3",
43
43
  "@atlaskit/ds-lib": "^2.2.0",
44
- "@atlaskit/icon": "^22.0.0",
44
+ "@atlaskit/icon": "^22.1.0",
45
45
  "@atlaskit/layering": "^0.2.0",
46
46
  "@atlaskit/locale": "^2.6.0",
47
47
  "@atlaskit/platform-feature-flags": "^0.2.0",
48
48
  "@atlaskit/popper": "^5.5.0",
49
- "@atlaskit/select": "^17.1.0",
49
+ "@atlaskit/select": "^17.2.0",
50
50
  "@atlaskit/theme": "^12.6.0",
51
- "@atlaskit/tokens": "^1.38.0",
51
+ "@atlaskit/tokens": "^1.39.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@emotion/react": "^11.7.1",
54
54
  "date-fns": "^2.17.0",
@@ -61,11 +61,12 @@
61
61
  "devDependencies": {
62
62
  "@af/accessibility-testing": "*",
63
63
  "@af/integration-testing": "*",
64
- "@atlaskit/button": "^17.4.0",
64
+ "@af/visual-regression": "*",
65
+ "@atlaskit/button": "^17.7.0",
65
66
  "@atlaskit/docs": "*",
66
67
  "@atlaskit/form": "^9.0.3",
67
68
  "@atlaskit/modal-dialog": "^12.10.0",
68
- "@atlaskit/popup": "^1.12.0",
69
+ "@atlaskit/popup": "^1.13.0",
69
70
  "@atlaskit/range": "^7.1.0",
70
71
  "@atlaskit/section-message": "^6.4.0",
71
72
  "@atlaskit/ssr": "*",