@atlaskit/datetime-picker 13.10.0 → 13.11.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/datetime-picker
2
2
 
3
+ ## 13.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#129307](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/129307)
8
+ [`8f67a01e4e56f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8f67a01e4e56f) -
9
+ Fix internal type issues with regard to forwarding types from underlying `select` package.
10
+
11
+ ## 13.10.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 13.10.0
4
18
 
5
19
  ### Minor Changes
@@ -38,7 +38,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
38
38
  * @jsx jsx
39
39
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
40
40
  var packageName = "@atlaskit/datetime-picker";
41
- var packageVersion = "13.10.0";
41
+ var packageVersion = "13.11.0";
42
42
  var datePickerDefaultProps = {
43
43
  appearance: 'default',
44
44
  autoFocus: false,
@@ -295,6 +295,7 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
295
295
  _this.setState(changedState);
296
296
  _this.props.onChange('');
297
297
  });
298
+ // `unknown` is used because `value` is unused so it does not matter.
298
299
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onSelectChange", function (_value, action) {
299
300
  // Used for native clear event in React Select
300
301
  // Triggered when clicking ClearIndicator or backspace with no value
@@ -450,6 +451,22 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
450
451
  previousMonthLabel: previousMonthLabel,
451
452
  shouldSetFocusOnCurrentDay: this.state.shouldSetFocusOnCurrentDay
452
453
  };
454
+ var mergedStyles = (0, _select.mergeStyles)(selectStyles, {
455
+ control: function control(base) {
456
+ return _objectSpread(_objectSpread({}, base), disabledStyle);
457
+ },
458
+ indicatorsContainer: function indicatorsContainer(base) {
459
+ return _objectSpread(_objectSpread({}, base), {}, {
460
+ paddingLeft: "var(--ds-space-025, 2px)",
461
+ // ICON_PADDING = 2
462
+ paddingRight: "var(--ds-space-075, 6px)" // 8 - ICON_PADDING = 6
463
+ });
464
+ }
465
+ });
466
+ var initialValue = value ? {
467
+ label: this.formatDate(value),
468
+ value: value
469
+ } : null;
453
470
  return (
454
471
  // These event handlers must be on this element because the events come
455
472
  // from different child elements.
@@ -485,23 +502,9 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
485
502
  onChange: this.onSelectChange
486
503
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
487
504
  ,
488
- styles: (0, _select.mergeStyles)(selectStyles, {
489
- control: function control(base) {
490
- return _objectSpread(_objectSpread({}, base), disabledStyle);
491
- },
492
- indicatorsContainer: function indicatorsContainer(base) {
493
- return _objectSpread(_objectSpread({}, base), {}, {
494
- paddingLeft: "var(--ds-space-025, 2px)",
495
- // ICON_PADDING = 2
496
- paddingRight: "var(--ds-space-075, 6px)" // 8 - ICON_PADDING = 6
497
- });
498
- }
499
- }),
505
+ styles: mergedStyles,
500
506
  placeholder: this.getPlaceholder(),
501
- value: value && {
502
- label: this.formatDate(value),
503
- value: value
504
- }
507
+ value: initialValue
505
508
  }, selectProps, calendarProps, {
506
509
  isClearable: true,
507
510
  spacing: spacing,
@@ -34,7 +34,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
34
34
  * @jsx jsx
35
35
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
36
36
  var packageName = "@atlaskit/datetime-picker";
37
- var packageVersion = "13.10.0";
37
+ var packageVersion = "13.11.0";
38
38
  // Make DatePicker 50% the width of DateTimePicker
39
39
  // If rendering an icon container, shrink the TimePicker
40
40
  var datePickerContainerStyles = (0, _react2.css)({
@@ -36,7 +36,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
36
36
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // eslint-disable-next-line no-restricted-imports
37
37
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
38
38
  var packageName = "@atlaskit/datetime-picker";
39
- var packageVersion = "13.10.0";
39
+ var packageVersion = "13.11.0";
40
40
  var menuStyles = {
41
41
  /* Need to remove default absolute positioning as that causes issues with position fixed */
42
42
  position: 'static',
@@ -257,10 +257,10 @@ var TimePickerComponent = exports.TimePickerWithoutAnalytics = /*#__PURE__*/func
257
257
  value: time
258
258
  };
259
259
  });
260
- var labelAndValue = value && {
260
+ var initialValue = value ? {
261
261
  label: formatTime(value),
262
262
  value: value
263
- };
263
+ } : null;
264
264
  var SingleValue = (0, _singleValue.makeSingleValue)({
265
265
  lang: this.props.locale
266
266
  });
@@ -320,7 +320,7 @@ var TimePickerComponent = exports.TimePickerWithoutAnalytics = /*#__PURE__*/func
320
320
  onMenuClose: this.onMenuClose,
321
321
  placeholder: placeholder || l10n.formatTime(_internal.placeholderDatetime),
322
322
  styles: mergedStyles,
323
- value: labelAndValue,
323
+ value: initialValue,
324
324
  spacing: spacing
325
325
  // @ts-ignore caused by prop not part of @atlaskit/select
326
326
  ,
@@ -20,7 +20,7 @@ import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date'
20
20
  import { convertTokens } from '../internal/parse-tokens';
21
21
  import { makeSingleValue } from '../internal/single-value';
22
22
  const packageName = "@atlaskit/datetime-picker";
23
- const packageVersion = "13.10.0";
23
+ const packageVersion = "13.11.0";
24
24
  const datePickerDefaultProps = {
25
25
  appearance: 'default',
26
26
  autoFocus: false,
@@ -276,6 +276,7 @@ class DatePickerComponent extends Component {
276
276
  this.setState(changedState);
277
277
  this.props.onChange('');
278
278
  });
279
+ // `unknown` is used because `value` is unused so it does not matter.
279
280
  _defineProperty(this, "onSelectChange", (_value, action) => {
280
281
  // Used for native clear event in React Select
281
282
  // Triggered when clicking ClearIndicator or backspace with no value
@@ -451,6 +452,22 @@ class DatePickerComponent extends Component {
451
452
  previousMonthLabel,
452
453
  shouldSetFocusOnCurrentDay: this.state.shouldSetFocusOnCurrentDay
453
454
  };
455
+ const mergedStyles = mergeStyles(selectStyles, {
456
+ control: base => ({
457
+ ...base,
458
+ ...disabledStyle
459
+ }),
460
+ indicatorsContainer: base => ({
461
+ ...base,
462
+ paddingLeft: "var(--ds-space-025, 2px)",
463
+ // ICON_PADDING = 2
464
+ paddingRight: "var(--ds-space-075, 6px)" // 8 - ICON_PADDING = 6
465
+ })
466
+ });
467
+ const initialValue = value ? {
468
+ label: this.formatDate(value),
469
+ value
470
+ } : null;
454
471
  return (
455
472
  // These event handlers must be on this element because the events come
456
473
  // from different child elements.
@@ -486,23 +503,9 @@ class DatePickerComponent extends Component {
486
503
  onChange: this.onSelectChange
487
504
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
488
505
  ,
489
- styles: mergeStyles(selectStyles, {
490
- control: base => ({
491
- ...base,
492
- ...disabledStyle
493
- }),
494
- indicatorsContainer: base => ({
495
- ...base,
496
- paddingLeft: "var(--ds-space-025, 2px)",
497
- // ICON_PADDING = 2
498
- paddingRight: "var(--ds-space-075, 6px)" // 8 - ICON_PADDING = 6
499
- })
500
- }),
506
+ styles: mergedStyles,
501
507
  placeholder: this.getPlaceholder(),
502
- value: value && {
503
- label: this.formatDate(value),
504
- value
505
- }
508
+ value: initialValue
506
509
  }, selectProps, calendarProps, {
507
510
  isClearable: true,
508
511
  spacing: spacing,
@@ -20,7 +20,7 @@ import { convertTokens } from '../internal/parse-tokens';
20
20
  import DatePicker from './date-picker';
21
21
  import TimePicker from './time-picker';
22
22
  const packageName = "@atlaskit/datetime-picker";
23
- const packageVersion = "13.10.0";
23
+ const packageVersion = "13.11.0";
24
24
  // Make DatePicker 50% the width of DateTimePicker
25
25
  // If rendering an icon container, shrink the TimePicker
26
26
  const datePickerContainerStyles = css({
@@ -16,7 +16,7 @@ import parseTime from '../internal/parse-time';
16
16
  import { convertTokens } from '../internal/parse-tokens';
17
17
  import { makeSingleValue } from '../internal/single-value';
18
18
  const packageName = "@atlaskit/datetime-picker";
19
- const packageVersion = "13.10.0";
19
+ const packageVersion = "13.11.0";
20
20
  const menuStyles = {
21
21
  /* Need to remove default absolute positioning as that causes issues with position fixed */
22
22
  position: 'static',
@@ -233,10 +233,10 @@ class TimePickerComponent extends React.Component {
233
233
  value: time
234
234
  };
235
235
  });
236
- const labelAndValue = value && {
236
+ const initialValue = value ? {
237
237
  label: formatTime(value),
238
238
  value
239
- };
239
+ } : null;
240
240
  const SingleValue = makeSingleValue({
241
241
  lang: this.props.locale
242
242
  });
@@ -296,7 +296,7 @@ class TimePickerComponent extends React.Component {
296
296
  onMenuClose: this.onMenuClose,
297
297
  placeholder: placeholder || l10n.formatTime(placeholderDatetime),
298
298
  styles: mergedStyles,
299
- value: labelAndValue,
299
+ value: initialValue,
300
300
  spacing: spacing
301
301
  // @ts-ignore caused by prop not part of @atlaskit/select
302
302
  ,
@@ -31,7 +31,7 @@ import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date'
31
31
  import { convertTokens } from '../internal/parse-tokens';
32
32
  import { makeSingleValue } from '../internal/single-value';
33
33
  var packageName = "@atlaskit/datetime-picker";
34
- var packageVersion = "13.10.0";
34
+ var packageVersion = "13.11.0";
35
35
  var datePickerDefaultProps = {
36
36
  appearance: 'default',
37
37
  autoFocus: false,
@@ -288,6 +288,7 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
288
288
  _this.setState(changedState);
289
289
  _this.props.onChange('');
290
290
  });
291
+ // `unknown` is used because `value` is unused so it does not matter.
291
292
  _defineProperty(_assertThisInitialized(_this), "onSelectChange", function (_value, action) {
292
293
  // Used for native clear event in React Select
293
294
  // Triggered when clicking ClearIndicator or backspace with no value
@@ -443,6 +444,22 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
443
444
  previousMonthLabel: previousMonthLabel,
444
445
  shouldSetFocusOnCurrentDay: this.state.shouldSetFocusOnCurrentDay
445
446
  };
447
+ var mergedStyles = mergeStyles(selectStyles, {
448
+ control: function control(base) {
449
+ return _objectSpread(_objectSpread({}, base), disabledStyle);
450
+ },
451
+ indicatorsContainer: function indicatorsContainer(base) {
452
+ return _objectSpread(_objectSpread({}, base), {}, {
453
+ paddingLeft: "var(--ds-space-025, 2px)",
454
+ // ICON_PADDING = 2
455
+ paddingRight: "var(--ds-space-075, 6px)" // 8 - ICON_PADDING = 6
456
+ });
457
+ }
458
+ });
459
+ var initialValue = value ? {
460
+ label: this.formatDate(value),
461
+ value: value
462
+ } : null;
446
463
  return (
447
464
  // These event handlers must be on this element because the events come
448
465
  // from different child elements.
@@ -478,23 +495,9 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
478
495
  onChange: this.onSelectChange
479
496
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
480
497
  ,
481
- styles: mergeStyles(selectStyles, {
482
- control: function control(base) {
483
- return _objectSpread(_objectSpread({}, base), disabledStyle);
484
- },
485
- indicatorsContainer: function indicatorsContainer(base) {
486
- return _objectSpread(_objectSpread({}, base), {}, {
487
- paddingLeft: "var(--ds-space-025, 2px)",
488
- // ICON_PADDING = 2
489
- paddingRight: "var(--ds-space-075, 6px)" // 8 - ICON_PADDING = 6
490
- });
491
- }
492
- }),
498
+ styles: mergedStyles,
493
499
  placeholder: this.getPlaceholder(),
494
- value: value && {
495
- label: this.formatDate(value),
496
- value: value
497
- }
500
+ value: initialValue
498
501
  }, selectProps, calendarProps, {
499
502
  isClearable: true,
500
503
  spacing: spacing,
@@ -30,7 +30,7 @@ import { convertTokens } from '../internal/parse-tokens';
30
30
  import DatePicker from './date-picker';
31
31
  import TimePicker from './time-picker';
32
32
  var packageName = "@atlaskit/datetime-picker";
33
- var packageVersion = "13.10.0";
33
+ var packageVersion = "13.11.0";
34
34
  // Make DatePicker 50% the width of DateTimePicker
35
35
  // If rendering an icon container, shrink the TimePicker
36
36
  var datePickerContainerStyles = css({
@@ -28,7 +28,7 @@ import parseTime from '../internal/parse-time';
28
28
  import { convertTokens } from '../internal/parse-tokens';
29
29
  import { makeSingleValue } from '../internal/single-value';
30
30
  var packageName = "@atlaskit/datetime-picker";
31
- var packageVersion = "13.10.0";
31
+ var packageVersion = "13.11.0";
32
32
  var menuStyles = {
33
33
  /* Need to remove default absolute positioning as that causes issues with position fixed */
34
34
  position: 'static',
@@ -249,10 +249,10 @@ var TimePickerComponent = /*#__PURE__*/function (_React$Component) {
249
249
  value: time
250
250
  };
251
251
  });
252
- var labelAndValue = value && {
252
+ var initialValue = value ? {
253
253
  label: formatTime(value),
254
254
  value: value
255
- };
255
+ } : null;
256
256
  var SingleValue = makeSingleValue({
257
257
  lang: this.props.locale
258
258
  });
@@ -312,7 +312,7 @@ var TimePickerComponent = /*#__PURE__*/function (_React$Component) {
312
312
  onMenuClose: this.onMenuClose,
313
313
  placeholder: placeholder || l10n.formatTime(placeholderDatetime),
314
314
  styles: mergedStyles,
315
- value: labelAndValue,
315
+ value: initialValue,
316
316
  spacing: spacing
317
317
  // @ts-ignore caused by prop not part of @atlaskit/select
318
318
  ,
@@ -6,7 +6,7 @@ import { Component } from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import { type CalendarRef } from '@atlaskit/calendar';
8
8
  import { type LocalizationProvider } from '@atlaskit/locale';
9
- import { type ActionMeta, type DropdownIndicatorProps, type InputActionMeta, type OptionType, type ValueType } from '@atlaskit/select';
9
+ import { type ActionMeta, type DropdownIndicatorProps, type GroupType, type InputActionMeta, type OptionType } from '@atlaskit/select';
10
10
  import { type Appearance, type DatePickerBaseProps, type Spacing } from '../types';
11
11
  type DatePickerProps = typeof datePickerDefaultProps & DatePickerBaseProps;
12
12
  interface State {
@@ -33,7 +33,7 @@ declare const datePickerDefaultProps: {
33
33
  disabled: string[];
34
34
  disabledDateFilter: (_: string) => boolean;
35
35
  hideIcon: boolean;
36
- icon: import("react").ComponentType<DropdownIndicatorProps<OptionType, boolean, import("@atlaskit/select").GroupType<OptionType>>>;
36
+ icon: import("react").ComponentType<DropdownIndicatorProps<OptionType, boolean, GroupType<OptionType>>>;
37
37
  id: string;
38
38
  innerProps: {};
39
39
  isDisabled: boolean;
@@ -56,7 +56,7 @@ declare class DatePickerComponent extends Component<DatePickerProps, State> {
56
56
  disabled: string[];
57
57
  disabledDateFilter: (_: string) => boolean;
58
58
  hideIcon: boolean;
59
- icon: import("react").ComponentType<DropdownIndicatorProps<OptionType, boolean, import("@atlaskit/select").GroupType<OptionType>>>;
59
+ icon: import("react").ComponentType<DropdownIndicatorProps<OptionType, boolean, GroupType<OptionType>>>;
60
60
  id: string;
61
61
  innerProps: {};
62
62
  isDisabled: boolean;
@@ -78,7 +78,7 @@ declare class DatePickerComponent extends Component<DatePickerProps, State> {
78
78
  locale: string;
79
79
  } | null;
80
80
  getSafeState: () => {
81
- inputValue?: string | undefined;
81
+ inputValue: any;
82
82
  value: string;
83
83
  isOpen: boolean;
84
84
  isFocused: boolean;
@@ -104,7 +104,7 @@ declare class DatePickerComponent extends Component<DatePickerProps, State> {
104
104
  onTextInput: (event: React.ChangeEvent<HTMLInputElement>) => void;
105
105
  onInputKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
106
106
  onClear: () => void;
107
- onSelectChange: (_value: ValueType<OptionType>, action: ActionMeta) => void;
107
+ onSelectChange: (_value: unknown, action: ActionMeta) => void;
108
108
  refCalendar: (ref: CalendarRef | null) => void;
109
109
  handleSelectInputChange: (selectInputValue: string, actionMeta: InputActionMeta) => void;
110
110
  getContainerRef: (ref: HTMLElement | null) => void;
@@ -136,7 +136,7 @@ export { DatePickerComponent as DatePickerWithoutAnalytics };
136
136
  * - [Code](https://atlassian.design/components/datetime-picker/date-picker/code)
137
137
  * - [Usage](https://atlassian.design/components/datetime-picker/date-picker/usage)
138
138
  */
139
- declare const DatePicker: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "placeholder" | "aria-describedby" | "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<{
139
+ declare const DatePicker: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "placeholder" | "aria-describedby" | "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" | "name" | "spacing" | "isInvalid" | "defaultIsOpen" | "hideIcon">> & Partial<Pick<{
140
140
  appearance: Appearance;
141
141
  autoFocus: boolean;
142
142
  defaultIsOpen: boolean;
@@ -144,7 +144,7 @@ declare const DatePicker: import("react").ForwardRefExoticComponent<Pick<Pick<Om
144
144
  disabled: string[];
145
145
  disabledDateFilter: (_: string) => boolean;
146
146
  hideIcon: boolean;
147
- icon: import("react").ComponentType<DropdownIndicatorProps<OptionType, boolean, import("@atlaskit/select").GroupType<OptionType>>>;
147
+ icon: import("react").ComponentType<DropdownIndicatorProps<OptionType, boolean, GroupType<OptionType>>>;
148
148
  id: string;
149
149
  innerProps: {};
150
150
  isDisabled: boolean;
@@ -157,5 +157,5 @@ declare const DatePicker: import("react").ForwardRefExoticComponent<Pick<Pick<Om
157
157
  selectProps: {};
158
158
  spacing: Spacing;
159
159
  locale: string;
160
- }, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "label" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "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>>;
160
+ }, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "label" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "disabledDateFilter" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "locale" | "analyticsContext" | "weekStartDay" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "defaultIsOpen" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "hideIcon" | "dateFormat"> & import("react").RefAttributes<any>>;
161
161
  export default DatePicker;
@@ -89,7 +89,7 @@ export { TimePickerComponent as TimePickerWithoutAnalytics };
89
89
  * - [Code](https://atlassian.design/components/datetime-picker/time-picker/code)
90
90
  * - [Usage](https://atlassian.design/components/datetime-picker/time-picker/usage)
91
91
  */
92
- 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" | "defaultIsOpen" | "name" | "parseInputValue" | "spacing" | "isInvalid" | "hideIcon" | "timeIsEditable">> & Partial<Pick<{
92
+ 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<{
93
93
  appearance: Appearance;
94
94
  autoFocus: boolean;
95
95
  defaultIsOpen: boolean;
@@ -110,5 +110,5 @@ declare const TimePicker: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePic
110
110
  times: string[];
111
111
  timeIsEditable: boolean;
112
112
  locale: string;
113
- }, 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" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
113
+ }, 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>>;
114
114
  export default TimePicker;
@@ -3,7 +3,15 @@ import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
3
  import { type DropdownIndicatorProps, type OptionType, type SelectProps } from '@atlaskit/select';
4
4
  export type Appearance = 'default' | 'subtle' | 'none';
5
5
  export type Spacing = 'compact' | 'default';
6
- export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
6
+ type Combine<First, Second> = Omit<First, keyof Second> & Second;
7
+ interface PickerSelectProps {
8
+ /**
9
+ * Props to apply to the select. These include all of [the props from our
10
+ * `Select` component](/components/select).
11
+ */
12
+ selectProps?: Combine<SelectProps<OptionType>, {}>;
13
+ }
14
+ export interface DatePickerBaseProps extends WithAnalyticsEventsProps, PickerSelectProps {
7
15
  /**
8
16
  * Set the appearance of the picker.
9
17
  * `subtle` will remove the borders, background, and icon.
@@ -102,11 +110,6 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
102
110
  * The aria-label attribute associated with the previous-month arrow.
103
111
  */
104
112
  previousMonthLabel?: string;
105
- /**
106
- * Props to apply to the select. This can be used to set options such as placeholder text.
107
- * See [the `Select` documentation for further information](/components/select).
108
- */
109
- selectProps?: SelectProps<any>;
110
113
  /**
111
114
  * The spacing for the select control.
112
115
  *
@@ -155,7 +158,7 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
155
158
  */
156
159
  weekStartDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
157
160
  }
158
- export interface TimePickerBaseProps extends WithAnalyticsEventsProps {
161
+ export interface TimePickerBaseProps extends WithAnalyticsEventsProps, PickerSelectProps {
159
162
  /**
160
163
  * Set the appearance of the picker.
161
164
  * `subtle` will remove the borders, background, and icon.
@@ -225,10 +228,6 @@ export interface TimePickerBaseProps extends WithAnalyticsEventsProps {
225
228
  * By default parses the string based off the locale.
226
229
  */
227
230
  parseInputValue?: (time: string, timeFormat: string) => string | Date;
228
- /**
229
- * Props to apply to the select.
230
- */
231
- selectProps?: SelectProps<any>;
232
231
  /**
233
232
  * The spacing for the select control.
234
233
  *
@@ -388,3 +387,4 @@ export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
388
387
  */
389
388
  testId?: string;
390
389
  }
390
+ export {};
@@ -6,7 +6,7 @@ import { Component } from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import { type CalendarRef } from '@atlaskit/calendar';
8
8
  import { type LocalizationProvider } from '@atlaskit/locale';
9
- import { type ActionMeta, type DropdownIndicatorProps, type InputActionMeta, type OptionType, type ValueType } from '@atlaskit/select';
9
+ import { type ActionMeta, type DropdownIndicatorProps, type GroupType, type InputActionMeta, type OptionType } from '@atlaskit/select';
10
10
  import { type Appearance, type DatePickerBaseProps, type Spacing } from '../types';
11
11
  type DatePickerProps = typeof datePickerDefaultProps & DatePickerBaseProps;
12
12
  interface State {
@@ -33,7 +33,7 @@ declare const datePickerDefaultProps: {
33
33
  disabled: string[];
34
34
  disabledDateFilter: (_: string) => boolean;
35
35
  hideIcon: boolean;
36
- icon: import("react").ComponentType<DropdownIndicatorProps<OptionType, boolean, import("@atlaskit/select").GroupType<OptionType>>>;
36
+ icon: import("react").ComponentType<DropdownIndicatorProps<OptionType, boolean, GroupType<OptionType>>>;
37
37
  id: string;
38
38
  innerProps: {};
39
39
  isDisabled: boolean;
@@ -56,7 +56,7 @@ declare class DatePickerComponent extends Component<DatePickerProps, State> {
56
56
  disabled: string[];
57
57
  disabledDateFilter: (_: string) => boolean;
58
58
  hideIcon: boolean;
59
- icon: import("react").ComponentType<DropdownIndicatorProps<OptionType, boolean, import("@atlaskit/select").GroupType<OptionType>>>;
59
+ icon: import("react").ComponentType<DropdownIndicatorProps<OptionType, boolean, GroupType<OptionType>>>;
60
60
  id: string;
61
61
  innerProps: {};
62
62
  isDisabled: boolean;
@@ -78,7 +78,7 @@ declare class DatePickerComponent extends Component<DatePickerProps, State> {
78
78
  locale: string;
79
79
  } | null;
80
80
  getSafeState: () => {
81
- inputValue?: string | undefined;
81
+ inputValue: any;
82
82
  value: string;
83
83
  isOpen: boolean;
84
84
  isFocused: boolean;
@@ -104,7 +104,7 @@ declare class DatePickerComponent extends Component<DatePickerProps, State> {
104
104
  onTextInput: (event: React.ChangeEvent<HTMLInputElement>) => void;
105
105
  onInputKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
106
106
  onClear: () => void;
107
- onSelectChange: (_value: ValueType<OptionType>, action: ActionMeta) => void;
107
+ onSelectChange: (_value: unknown, action: ActionMeta) => void;
108
108
  refCalendar: (ref: CalendarRef | null) => void;
109
109
  handleSelectInputChange: (selectInputValue: string, actionMeta: InputActionMeta) => void;
110
110
  getContainerRef: (ref: HTMLElement | null) => void;
@@ -136,7 +136,7 @@ export { DatePickerComponent as DatePickerWithoutAnalytics };
136
136
  * - [Code](https://atlassian.design/components/datetime-picker/date-picker/code)
137
137
  * - [Usage](https://atlassian.design/components/datetime-picker/date-picker/usage)
138
138
  */
139
- declare const DatePicker: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "placeholder" | "aria-describedby" | "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<{
139
+ declare const DatePicker: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "placeholder" | "aria-describedby" | "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" | "name" | "spacing" | "isInvalid" | "defaultIsOpen" | "hideIcon">> & Partial<Pick<{
140
140
  appearance: Appearance;
141
141
  autoFocus: boolean;
142
142
  defaultIsOpen: boolean;
@@ -144,7 +144,7 @@ declare const DatePicker: import("react").ForwardRefExoticComponent<Pick<Pick<Om
144
144
  disabled: string[];
145
145
  disabledDateFilter: (_: string) => boolean;
146
146
  hideIcon: boolean;
147
- icon: import("react").ComponentType<DropdownIndicatorProps<OptionType, boolean, import("@atlaskit/select").GroupType<OptionType>>>;
147
+ icon: import("react").ComponentType<DropdownIndicatorProps<OptionType, boolean, GroupType<OptionType>>>;
148
148
  id: string;
149
149
  innerProps: {};
150
150
  isDisabled: boolean;
@@ -157,5 +157,5 @@ declare const DatePicker: import("react").ForwardRefExoticComponent<Pick<Pick<Om
157
157
  selectProps: {};
158
158
  spacing: Spacing;
159
159
  locale: string;
160
- }, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "label" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "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>>;
160
+ }, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "label" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "disabledDateFilter" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "locale" | "analyticsContext" | "weekStartDay" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "defaultIsOpen" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "hideIcon" | "dateFormat"> & import("react").RefAttributes<any>>;
161
161
  export default DatePicker;
@@ -89,7 +89,7 @@ export { TimePickerComponent as TimePickerWithoutAnalytics };
89
89
  * - [Code](https://atlassian.design/components/datetime-picker/time-picker/code)
90
90
  * - [Usage](https://atlassian.design/components/datetime-picker/time-picker/usage)
91
91
  */
92
- 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" | "defaultIsOpen" | "name" | "parseInputValue" | "spacing" | "isInvalid" | "hideIcon" | "timeIsEditable">> & Partial<Pick<{
92
+ 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<{
93
93
  appearance: Appearance;
94
94
  autoFocus: boolean;
95
95
  defaultIsOpen: boolean;
@@ -110,5 +110,5 @@ declare const TimePicker: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePic
110
110
  times: string[];
111
111
  timeIsEditable: boolean;
112
112
  locale: string;
113
- }, 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" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
113
+ }, 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>>;
114
114
  export default TimePicker;
@@ -3,7 +3,15 @@ import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
3
  import { type DropdownIndicatorProps, type OptionType, type SelectProps } from '@atlaskit/select';
4
4
  export type Appearance = 'default' | 'subtle' | 'none';
5
5
  export type Spacing = 'compact' | 'default';
6
- export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
6
+ type Combine<First, Second> = Omit<First, keyof Second> & Second;
7
+ interface PickerSelectProps {
8
+ /**
9
+ * Props to apply to the select. These include all of [the props from our
10
+ * `Select` component](/components/select).
11
+ */
12
+ selectProps?: Combine<SelectProps<OptionType>, {}>;
13
+ }
14
+ export interface DatePickerBaseProps extends WithAnalyticsEventsProps, PickerSelectProps {
7
15
  /**
8
16
  * Set the appearance of the picker.
9
17
  * `subtle` will remove the borders, background, and icon.
@@ -102,11 +110,6 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
102
110
  * The aria-label attribute associated with the previous-month arrow.
103
111
  */
104
112
  previousMonthLabel?: string;
105
- /**
106
- * Props to apply to the select. This can be used to set options such as placeholder text.
107
- * See [the `Select` documentation for further information](/components/select).
108
- */
109
- selectProps?: SelectProps<any>;
110
113
  /**
111
114
  * The spacing for the select control.
112
115
  *
@@ -155,7 +158,7 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
155
158
  */
156
159
  weekStartDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
157
160
  }
158
- export interface TimePickerBaseProps extends WithAnalyticsEventsProps {
161
+ export interface TimePickerBaseProps extends WithAnalyticsEventsProps, PickerSelectProps {
159
162
  /**
160
163
  * Set the appearance of the picker.
161
164
  * `subtle` will remove the borders, background, and icon.
@@ -225,10 +228,6 @@ export interface TimePickerBaseProps extends WithAnalyticsEventsProps {
225
228
  * By default parses the string based off the locale.
226
229
  */
227
230
  parseInputValue?: (time: string, timeFormat: string) => string | Date;
228
- /**
229
- * Props to apply to the select.
230
- */
231
- selectProps?: SelectProps<any>;
232
231
  /**
233
232
  * The spacing for the select control.
234
233
  *
@@ -388,3 +387,4 @@ export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
388
387
  */
389
388
  testId?: string;
390
389
  }
390
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "13.10.0",
3
+ "version": "13.11.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/"
@@ -47,7 +47,7 @@
47
47
  "@atlaskit/locale": "^2.8.0",
48
48
  "@atlaskit/popper": "^6.2.0",
49
49
  "@atlaskit/select": "^17.13.0",
50
- "@atlaskit/theme": "^12.12.0",
50
+ "@atlaskit/theme": "^13.0.0",
51
51
  "@atlaskit/tokens": "^1.58.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@emotion/react": "^11.7.1",