@atlaskit/datetime-picker 17.0.18 → 17.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/datetime-picker
2
2
 
3
+ ## 17.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 17.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`cca11d70019df`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cca11d70019df) -
14
+ This fixes a bug with announcing the label for users of assistive technology behind a feature
15
+ flag. If successful, it will roll out in a future release.
16
+
3
17
  ## 17.0.18
4
18
 
5
19
  ### Patch Changes
@@ -40,7 +40,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
40
40
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
41
41
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /// <reference types="node" />
42
42
  var packageName = "@atlaskit/datetime-picker";
43
- var packageVersion = "0.0.0-development";
43
+ var packageVersion = "17.1.0";
44
44
  var datePickerDefaultProps = {
45
45
  defaultIsOpen: false,
46
46
  defaultValue: '',
@@ -446,8 +446,6 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
446
446
  var menuIsOpen = this.getIsOpen() && !isDisabled;
447
447
  var showClearIndicator = Boolean((value || selectInputValue) && !hideIcon);
448
448
  var clearIndicator = Icon;
449
-
450
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
451
449
  if ((0, _platformFeatureFlags.fg)('platform-visual-refresh-icons')) {
452
450
  clearIndicator = function clearIndicator(props) {
453
451
  return /*#__PURE__*/React.createElement(_compiled.Box, {
@@ -456,9 +454,6 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
456
454
  };
457
455
  }
458
456
  var dropDownIcon = appearance === 'subtle' || hideIcon || showClearIndicator ? null : clearIndicator;
459
- var SingleValue = (0, _singleValue.makeSingleValue)({
460
- lang: this.props.locale
461
- });
462
457
  var selectComponents = _objectSpread(_objectSpread(_objectSpread({
463
458
  DropdownIndicator: shouldShowCalendarButton ? _internal.EmptyComponent : dropDownIcon
464
459
  }, shouldShowCalendarButton ? {
@@ -468,8 +463,7 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
468
463
  }));
469
464
  }
470
465
  } : {}), {}, {
471
- Menu: _menu.Menu,
472
- SingleValue: SingleValue
466
+ Menu: _menu.Menu
473
467
  }, !showClearIndicator && {
474
468
  ClearIndicator: _internal.EmptyComponent
475
469
  }), selectProps.components);
@@ -536,11 +530,80 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
536
530
  type: "hidden",
537
531
  value: value,
538
532
  "data-testid": testId && "".concat(testId, "--input")
539
- }), /*#__PURE__*/React.createElement(_select.default, (0, _extends2.default)({
533
+ }), (0, _platformFeatureFlags.fg)('platform-dtp_a11y_fix-dsp-23950') ? /*#__PURE__*/React.createElement(_useId.IdProvider, null, function (_ref3) {
534
+ var valueId = _ref3.id;
535
+ return /*#__PURE__*/React.createElement(_select.default, (0, _extends2.default)({
536
+ appearance: _this2.props.appearance,
537
+ "aria-describedby": ariaDescribedBy ? "".concat(ariaDescribedBy, " ").concat(valueId) : valueId,
538
+ label: label || undefined
539
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
540
+ ,
541
+ autoFocus: autoFocus,
542
+ clearControlLabel: clearControlLabel,
543
+ closeMenuOnSelect: true,
544
+ enableAnimation: false,
545
+ inputId: id,
546
+ inputValue: actualSelectInputValue,
547
+ isDisabled: isDisabled,
548
+ isRequired: isRequired,
549
+ menuIsOpen: menuIsOpen,
550
+ onBlur: _this2.onSelectBlur,
551
+ onChange: _this2.onSelectChange,
552
+ onFocus: _this2.onSelectFocus,
553
+ onInputChange: _this2.handleSelectInputChange,
554
+ placeholder: (0, _datePickerMigration.getPlaceholder)({
555
+ placeholder: _this2.props.placeholder,
556
+ l10n: _this2.state.l10n
557
+ })
558
+ // @ts-ignore -- Argument of type 'StylesConfig<OptionType, false, GroupBase<OptionType>>' is not assignable to parameter of type 'StylesConfig<OptionType, boolean, GroupBase<OptionType>>'
559
+ ,
560
+ styles: mergedStyles,
561
+ value: initialValue
562
+ }, selectProps, {
563
+ // For some reason, this and the below `styles` type error _only_ show
564
+ // up when you alter some of the properties in the `selectComponents`
565
+ // object. These errors are still present, and I suspect have always
566
+ // been present, without changing the unrelated code. Ignoring as the
567
+ // component still works as expected despite this error. And also
568
+ // because the select refresh team may solve it later.
569
+ components: _objectSpread(_objectSpread({}, selectComponents), {}, {
570
+ SingleValue: (0, _singleValue.makeSingleValue)({
571
+ id: valueId,
572
+ lang: _this2.props.locale
573
+ })
574
+ })
575
+ // These are below the spread because I don't know what is in
576
+ // selectProps or not and what wil be overwritten
577
+ ,
578
+ isClearable: true,
579
+ isInvalid: isInvalid,
580
+ spacing: spacing,
581
+ testId: testId
582
+ // These aren't part of `Select`'s API, but we're using them here.
583
+ // @ts-ignore -- Property 'calendarContainerRef' does not exist on type 'IntrinsicAttributes & LibraryManagedAttributes<(<Option extends unknown = OptionType, IsMulti extends boolean = false>(props: AtlaskitSelectProps<Option, IsMulti> & { ...; }) => Element), AtlaskitSelectProps<...> & { ...; }>'.
584
+ ,
585
+ calendarContainerRef: calendarProps.calendarContainerRef,
586
+ calendarDisabled: calendarProps.calendarDisabled,
587
+ calendarDisabledDateFilter: calendarProps.calendarDisabledDateFilter,
588
+ calendarLocale: calendarProps.calendarLocale,
589
+ calendarMaxDate: calendarProps.calendarMaxDate,
590
+ calendarMinDate: calendarProps.calendarMinDate,
591
+ calendarRef: calendarProps.calendarRef,
592
+ calendarValue: calendarProps.calendarValue,
593
+ calendarView: calendarProps.calendarView,
594
+ calendarWeekStartDay: calendarProps.calendarWeekStartDay,
595
+ nextMonthLabel: nextMonthLabel,
596
+ onCalendarChange: calendarProps.onCalendarChange,
597
+ onCalendarSelect: calendarProps.onCalendarSelect,
598
+ previousMonthLabel: previousMonthLabel,
599
+ shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
600
+ menuInnerWrapper: calendarProps.menuInnerWrapper
601
+ }));
602
+ }) : /*#__PURE__*/React.createElement(_select.default, (0, _extends2.default)({
540
603
  appearance: this.props.appearance,
541
604
  "aria-describedby": ariaDescribedBy,
542
605
  label: label || undefined
543
- // eslint-disable-next-line jsx-a11y/no-autofocus
606
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
544
607
  ,
545
608
  autoFocus: autoFocus,
546
609
  clearControlLabel: clearControlLabel,
@@ -570,7 +633,11 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
570
633
  // been present, without changing the unrelated code. Ignoring as the
571
634
  // component still works as expected despite this error. And also
572
635
  // because the select refresh team may solve it later.
573
- components: selectComponents
636
+ components: _objectSpread(_objectSpread({}, selectComponents), {}, {
637
+ SingleValue: (0, _singleValue.makeSingleValue)({
638
+ lang: this.props.locale
639
+ })
640
+ })
574
641
  // These are below the spread because I don't know what is in
575
642
  // selectProps or not and what wil be overwritten
576
643
  ,
@@ -599,8 +666,8 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
599
666
  menuInnerWrapper: calendarProps.menuInnerWrapper
600
667
  })), shouldShowCalendarButton && !isDisabled ? /*#__PURE__*/React.createElement(_useId.IdProvider, {
601
668
  prefix: "open-calendar-label--"
602
- }, function (_ref3) {
603
- var openCalendarLabelId = _ref3.id;
669
+ }, function (_ref4) {
670
+ var openCalendarLabelId = _ref4.id;
604
671
  return /*#__PURE__*/React.createElement(_compiled.Box, {
605
672
  xcss: (0, _css.cx)(styles.iconContainerStyles, value && !hideIcon ? styles.iconSpacingWithClearButtonStyles : styles.iconSpacingWithoutClearButtonStyles)
606
673
  }, /*#__PURE__*/React.createElement(_new.IconButton, {
@@ -37,7 +37,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
37
37
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
38
38
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
39
39
  var packageName = "@atlaskit/datetime-picker";
40
- var packageVersion = "0.0.0-development";
40
+ var packageVersion = "17.1.0";
41
41
  var styles = {
42
42
  pickerContainerStyle: "_kqswh2mm",
43
43
  dropdownIndicatorStyles: "_1ul91k8s _1tke1k8s _1e0c1txw _4cvr1h6o _1bah1h6o",
@@ -449,8 +449,6 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, forwardedR
449
449
  var menuIsOpen = getIsOpen() && !isDisabled;
450
450
  var showClearIndicator = Boolean((getterValue || selectInputValue) && !hideIcon);
451
451
  var clearIndicator = Icon;
452
-
453
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
454
452
  if ((0, _platformFeatureFlags.fg)('platform-visual-refresh-icons')) {
455
453
  clearIndicator = function clearIndicator(props) {
456
454
  return /*#__PURE__*/React.createElement(_compiled.Box, {
@@ -459,7 +457,9 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, forwardedR
459
457
  };
460
458
  }
461
459
  var dropDownIcon = appearance === 'subtle' || hideIcon || showClearIndicator ? null : clearIndicator;
460
+ var valueId = (0, _useId.useId)();
462
461
  var SingleValue = (0, _singleValue.makeSingleValue)({
462
+ id: valueId,
463
463
  lang: propLocale
464
464
  });
465
465
  var selectComponents = _objectSpread(_objectSpread(_objectSpread({}, selectProps.components), {}, {
@@ -547,9 +547,9 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, forwardedR
547
547
  "data-testid": testId && "".concat(testId, "--input")
548
548
  }), /*#__PURE__*/React.createElement(_select.default, (0, _extends2.default)({
549
549
  appearance: appearance,
550
- "aria-describedby": ariaDescribedBy,
550
+ "aria-describedby": (0, _platformFeatureFlags.fg)('platform-dtp_a11y_fix-dsp-23950') ? ariaDescribedBy ? "".concat(ariaDescribedBy, " ").concat(valueId) : valueId : ariaDescribedBy,
551
551
  label: label || undefined
552
- // eslint-disable-next-line jsx-a11y/no-autofocus
552
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
553
553
  ,
554
554
  autoFocus: autoFocus,
555
555
  clearControlLabel: clearControlLabel,
@@ -568,8 +568,8 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, forwardedR
568
568
  placeholder: placeholder,
569
569
  l10n: l10n
570
570
  })
571
- // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
572
571
  // @ts-ignore -- Type 'OptionType' is not assignable to type '{ label: string; value: string; }'
572
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
573
573
  ,
574
574
  styles: mergedStyles,
575
575
  value: initialValue
@@ -35,7 +35,7 @@ var DatePicker = (0, _ffComponent.componentWithCondition)(function () {
35
35
  return (0, _platformFeatureFlags.fg)('dst-date-picker-use-functional-component');
36
36
  }, _datePickerFc.default, _datePickerClass.default);
37
37
  var packageName = "@atlaskit/datetime-picker";
38
- var packageVersion = "0.0.0-development";
38
+ var packageVersion = "17.1.0";
39
39
  var compiledStyles = {
40
40
  datePickerContainerStyles: "_i0dl1ssb _16jlkb7n _1o9zidpf",
41
41
  timePickerContainerStyles: "_i0dl1ssb _16jlkb7n",
@@ -34,13 +34,11 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
34
34
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
35
35
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /// <reference types="node" />
36
36
  // for typing `process`
37
- var DatePicker = (0, _ffComponent.componentWithCondition)(
38
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
39
- function () {
37
+ var DatePicker = (0, _ffComponent.componentWithCondition)(function () {
40
38
  return (0, _platformFeatureFlags.fg)('dst-date-picker-use-functional-component');
41
39
  }, _datePickerFc.default, _datePickerClass.default);
42
40
  var packageName = "@atlaskit/datetime-picker";
43
- var packageVersion = "0.0.0-development";
41
+ var packageVersion = "17.1.0";
44
42
  var analyticsAttributes = {
45
43
  componentName: 'dateTimePicker',
46
44
  packageName: packageName,
@@ -299,7 +297,7 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
299
297
  }, /*#__PURE__*/_react.default.createElement(DatePicker, {
300
298
  appearance: appearance,
301
299
  "aria-describedby": datePickerAriaDescribedBy
302
- // eslint-disable-next-line jsx-a11y/no-autofocus
300
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
303
301
  ,
304
302
  autoFocus: datePickerProps.autoFocus || autoFocus,
305
303
  dateFormat: datePickerProps.dateFormat,
@@ -342,7 +340,7 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
342
340
  }, /*#__PURE__*/_react.default.createElement(_timePicker.default, {
343
341
  appearance: timePickerProps.appearance || appearance,
344
342
  "aria-describedby": timePickerAriaDescribedBy
345
- // eslint-disable-next-line jsx-a11y/no-autofocus
343
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
346
344
  ,
347
345
  autoFocus: timePickerProps.autoFocus,
348
346
  defaultIsOpen: timePickerProps.defaultIsOpen,
@@ -26,7 +26,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
26
26
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
27
27
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
28
28
  var packageName = "@atlaskit/datetime-picker";
29
- var packageVersion = "0.0.0-development";
29
+ var packageVersion = "17.1.0";
30
30
  var menuStyles = {
31
31
  /* Need to remove default absolute positioning as that causes issues with position fixed */
32
32
  position: 'static',
@@ -6,16 +6,23 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.makeSingleValue = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
11
  var _react = _interopRequireDefault(require("react"));
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
13
  var _select = require("@atlaskit/select");
12
14
  var _excluded = ["children", "className", "clearValue", "cx", "data", "getStyles", "getValue", "hasValue", "isDisabled", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue"];
15
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
17
  /**
14
18
  * This creates a functional component that `react-select` will use to make the
15
19
  * SingleValue part of the different pickers.
16
20
  */
17
- var makeSingleValue = exports.makeSingleValue = function makeSingleValue(_ref) {
18
- var lang = _ref.lang;
21
+ var makeSingleValue = exports.makeSingleValue =
22
+ // TODO: Make ID required
23
+ function makeSingleValue(_ref) {
24
+ var id = _ref.id,
25
+ lang = _ref.lang;
19
26
  return function (_ref2) {
20
27
  var children = _ref2.children,
21
28
  className = _ref2.className,
@@ -42,9 +49,11 @@ var makeSingleValue = exports.makeSingleValue = function makeSingleValue(_ref) {
42
49
  getStyles: getStyles,
43
50
  getValue: getValue,
44
51
  hasValue: hasValue,
45
- innerProps: {
52
+ innerProps: _objectSpread(_objectSpread({}, (0, _platformFeatureFlags.fg)('platform-dtp_a11y_fix-dsp-23950') ? {
53
+ id: id
54
+ } : {}), {}, {
46
55
  lang: lang
47
- },
56
+ }),
48
57
  isDisabled: isDisabled,
49
58
  isMulti: isMulti,
50
59
  isRtl: isRtl,
@@ -23,7 +23,7 @@ import { Menu } from '../internal/menu';
23
23
  import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
24
24
  import { makeSingleValue } from '../internal/single-value';
25
25
  const packageName = "@atlaskit/datetime-picker";
26
- const packageVersion = "0.0.0-development";
26
+ const packageVersion = "17.1.0";
27
27
  const datePickerDefaultProps = {
28
28
  defaultIsOpen: false,
29
29
  defaultValue: '',
@@ -423,17 +423,12 @@ class DatePickerComponent extends Component {
423
423
  const menuIsOpen = this.getIsOpen() && !isDisabled;
424
424
  const showClearIndicator = Boolean((value || selectInputValue) && !hideIcon);
425
425
  let clearIndicator = Icon;
426
-
427
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
428
426
  if (fg('platform-visual-refresh-icons')) {
429
427
  clearIndicator = props => /*#__PURE__*/React.createElement(Box, {
430
428
  xcss: styles.dropdownIndicatorStyles
431
429
  }, /*#__PURE__*/React.createElement(Icon, props));
432
430
  }
433
431
  const dropDownIcon = appearance === 'subtle' || hideIcon || showClearIndicator ? null : clearIndicator;
434
- const SingleValue = makeSingleValue({
435
- lang: this.props.locale
436
- });
437
432
  const selectComponents = {
438
433
  DropdownIndicator: shouldShowCalendarButton ? EmptyComponent : dropDownIcon,
439
434
  // Only use this new container component if the calendar button is shown.
@@ -444,7 +439,7 @@ class DatePickerComponent extends Component {
444
439
  }))
445
440
  } : {}),
446
441
  Menu,
447
- SingleValue,
442
+ // SingleValue is defined in the render because of UI generator limitations
448
443
  ...(!showClearIndicator && {
449
444
  ClearIndicator: EmptyComponent
450
445
  }),
@@ -514,11 +509,80 @@ class DatePickerComponent extends Component {
514
509
  type: "hidden",
515
510
  value: value,
516
511
  "data-testid": testId && `${testId}--input`
517
- }), /*#__PURE__*/React.createElement(Select, _extends({
512
+ }), fg('platform-dtp_a11y_fix-dsp-23950') ? /*#__PURE__*/React.createElement(IdProvider, null, ({
513
+ id: valueId
514
+ }) => /*#__PURE__*/React.createElement(Select, _extends({
515
+ appearance: this.props.appearance,
516
+ "aria-describedby": ariaDescribedBy ? `${ariaDescribedBy} ${valueId}` : valueId,
517
+ label: label || undefined
518
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
519
+ ,
520
+ autoFocus: autoFocus,
521
+ clearControlLabel: clearControlLabel,
522
+ closeMenuOnSelect: true,
523
+ enableAnimation: false,
524
+ inputId: id,
525
+ inputValue: actualSelectInputValue,
526
+ isDisabled: isDisabled,
527
+ isRequired: isRequired,
528
+ menuIsOpen: menuIsOpen,
529
+ onBlur: this.onSelectBlur,
530
+ onChange: this.onSelectChange,
531
+ onFocus: this.onSelectFocus,
532
+ onInputChange: this.handleSelectInputChange,
533
+ placeholder: getPlaceholder({
534
+ placeholder: this.props.placeholder,
535
+ l10n: this.state.l10n
536
+ })
537
+ // @ts-ignore -- Argument of type 'StylesConfig<OptionType, false, GroupBase<OptionType>>' is not assignable to parameter of type 'StylesConfig<OptionType, boolean, GroupBase<OptionType>>'
538
+ ,
539
+ styles: mergedStyles,
540
+ value: initialValue
541
+ }, selectProps, {
542
+ // For some reason, this and the below `styles` type error _only_ show
543
+ // up when you alter some of the properties in the `selectComponents`
544
+ // object. These errors are still present, and I suspect have always
545
+ // been present, without changing the unrelated code. Ignoring as the
546
+ // component still works as expected despite this error. And also
547
+ // because the select refresh team may solve it later.
548
+ components: {
549
+ ...selectComponents,
550
+ SingleValue: makeSingleValue({
551
+ id: valueId,
552
+ lang: this.props.locale
553
+ })
554
+ }
555
+ // These are below the spread because I don't know what is in
556
+ // selectProps or not and what wil be overwritten
557
+ ,
558
+ isClearable: true,
559
+ isInvalid: isInvalid,
560
+ spacing: spacing,
561
+ testId: testId
562
+ // These aren't part of `Select`'s API, but we're using them here.
563
+ // @ts-ignore -- Property 'calendarContainerRef' does not exist on type 'IntrinsicAttributes & LibraryManagedAttributes<(<Option extends unknown = OptionType, IsMulti extends boolean = false>(props: AtlaskitSelectProps<Option, IsMulti> & { ...; }) => Element), AtlaskitSelectProps<...> & { ...; }>'.
564
+ ,
565
+ calendarContainerRef: calendarProps.calendarContainerRef,
566
+ calendarDisabled: calendarProps.calendarDisabled,
567
+ calendarDisabledDateFilter: calendarProps.calendarDisabledDateFilter,
568
+ calendarLocale: calendarProps.calendarLocale,
569
+ calendarMaxDate: calendarProps.calendarMaxDate,
570
+ calendarMinDate: calendarProps.calendarMinDate,
571
+ calendarRef: calendarProps.calendarRef,
572
+ calendarValue: calendarProps.calendarValue,
573
+ calendarView: calendarProps.calendarView,
574
+ calendarWeekStartDay: calendarProps.calendarWeekStartDay,
575
+ nextMonthLabel: nextMonthLabel,
576
+ onCalendarChange: calendarProps.onCalendarChange,
577
+ onCalendarSelect: calendarProps.onCalendarSelect,
578
+ previousMonthLabel: previousMonthLabel,
579
+ shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
580
+ menuInnerWrapper: calendarProps.menuInnerWrapper
581
+ }))) : /*#__PURE__*/React.createElement(Select, _extends({
518
582
  appearance: this.props.appearance,
519
583
  "aria-describedby": ariaDescribedBy,
520
584
  label: label || undefined
521
- // eslint-disable-next-line jsx-a11y/no-autofocus
585
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
522
586
  ,
523
587
  autoFocus: autoFocus,
524
588
  clearControlLabel: clearControlLabel,
@@ -548,7 +612,12 @@ class DatePickerComponent extends Component {
548
612
  // been present, without changing the unrelated code. Ignoring as the
549
613
  // component still works as expected despite this error. And also
550
614
  // because the select refresh team may solve it later.
551
- components: selectComponents
615
+ components: {
616
+ ...selectComponents,
617
+ SingleValue: makeSingleValue({
618
+ lang: this.props.locale
619
+ })
620
+ }
552
621
  // These are below the spread because I don't know what is in
553
622
  // selectProps or not and what wil be overwritten
554
623
  ,
@@ -23,7 +23,7 @@ import { Menu } from '../internal/menu';
23
23
  import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
24
24
  import { makeSingleValue } from '../internal/single-value';
25
25
  const packageName = "@atlaskit/datetime-picker";
26
- const packageVersion = "0.0.0-development";
26
+ const packageVersion = "17.1.0";
27
27
  const styles = {
28
28
  pickerContainerStyle: "_kqswh2mm",
29
29
  dropdownIndicatorStyles: "_1ul91k8s _1tke1k8s _1e0c1txw _4cvr1h6o _1bah1h6o",
@@ -376,15 +376,15 @@ const DatePicker = /*#__PURE__*/forwardRef((props, forwardedRef) => {
376
376
  const menuIsOpen = getIsOpen() && !isDisabled;
377
377
  const showClearIndicator = Boolean((getterValue || selectInputValue) && !hideIcon);
378
378
  let clearIndicator = Icon;
379
-
380
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
381
379
  if (fg('platform-visual-refresh-icons')) {
382
380
  clearIndicator = props => /*#__PURE__*/React.createElement(Box, {
383
381
  xcss: styles.dropdownIndicatorStyles
384
382
  }, /*#__PURE__*/React.createElement(Icon, props));
385
383
  }
386
384
  const dropDownIcon = appearance === 'subtle' || hideIcon || showClearIndicator ? null : clearIndicator;
385
+ const valueId = useId();
387
386
  const SingleValue = makeSingleValue({
387
+ id: valueId,
388
388
  lang: propLocale
389
389
  });
390
390
  const selectComponents = {
@@ -475,9 +475,9 @@ const DatePicker = /*#__PURE__*/forwardRef((props, forwardedRef) => {
475
475
  "data-testid": testId && `${testId}--input`
476
476
  }), /*#__PURE__*/React.createElement(Select, _extends({
477
477
  appearance: appearance,
478
- "aria-describedby": ariaDescribedBy,
478
+ "aria-describedby": fg('platform-dtp_a11y_fix-dsp-23950') ? ariaDescribedBy ? `${ariaDescribedBy} ${valueId}` : valueId : ariaDescribedBy,
479
479
  label: label || undefined
480
- // eslint-disable-next-line jsx-a11y/no-autofocus
480
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
481
481
  ,
482
482
  autoFocus: autoFocus,
483
483
  clearControlLabel: clearControlLabel,
@@ -496,8 +496,8 @@ const DatePicker = /*#__PURE__*/forwardRef((props, forwardedRef) => {
496
496
  placeholder: placeholder,
497
497
  l10n: l10n
498
498
  })
499
- // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
500
499
  // @ts-ignore -- Type 'OptionType' is not assignable to type '{ label: string; value: string; }'
500
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
501
501
  ,
502
502
  styles: mergedStyles,
503
503
  value: initialValue
@@ -19,7 +19,7 @@ import DatePickerNew from './date-picker-fc';
19
19
  import TimePicker from './time-picker';
20
20
  const DatePicker = componentWithCondition(() => fg('dst-date-picker-use-functional-component'), DatePickerNew, DatePickerOld);
21
21
  const packageName = "@atlaskit/datetime-picker";
22
- const packageVersion = "0.0.0-development";
22
+ const packageVersion = "17.1.0";
23
23
  const compiledStyles = {
24
24
  datePickerContainerStyles: "_i0dl1ssb _16jlkb7n _1o9zidpf",
25
25
  timePickerContainerStyles: "_i0dl1ssb _16jlkb7n",
@@ -20,11 +20,9 @@ import { convertTokens } from '../internal/parse-tokens';
20
20
  import DatePickerOld from './date-picker-class';
21
21
  import DatePickerNew from './date-picker-fc';
22
22
  import TimePicker from './time-picker';
23
- const DatePicker = componentWithCondition(
24
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
25
- () => fg('dst-date-picker-use-functional-component'), DatePickerNew, DatePickerOld);
23
+ const DatePicker = componentWithCondition(() => fg('dst-date-picker-use-functional-component'), DatePickerNew, DatePickerOld);
26
24
  const packageName = "@atlaskit/datetime-picker";
27
- const packageVersion = "0.0.0-development";
25
+ const packageVersion = "17.1.0";
28
26
  const analyticsAttributes = {
29
27
  componentName: 'dateTimePicker',
30
28
  packageName,
@@ -264,7 +262,7 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
264
262
  }, /*#__PURE__*/React.createElement(DatePicker, {
265
263
  appearance: appearance,
266
264
  "aria-describedby": datePickerAriaDescribedBy
267
- // eslint-disable-next-line jsx-a11y/no-autofocus
265
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
268
266
  ,
269
267
  autoFocus: datePickerProps.autoFocus || autoFocus,
270
268
  dateFormat: datePickerProps.dateFormat,
@@ -307,7 +305,7 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
307
305
  }, /*#__PURE__*/React.createElement(TimePicker, {
308
306
  appearance: timePickerProps.appearance || appearance,
309
307
  "aria-describedby": timePickerAriaDescribedBy
310
- // eslint-disable-next-line jsx-a11y/no-autofocus
308
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
311
309
  ,
312
310
  autoFocus: timePickerProps.autoFocus,
313
311
  defaultIsOpen: timePickerProps.defaultIsOpen,
@@ -11,7 +11,7 @@ import parseTime from '../internal/parse-time';
11
11
  import { convertTokens } from '../internal/parse-tokens';
12
12
  import { makeSingleValue } from '../internal/single-value';
13
13
  const packageName = "@atlaskit/datetime-picker";
14
- const packageVersion = "0.0.0-development";
14
+ const packageVersion = "17.1.0";
15
15
  const menuStyles = {
16
16
  /* Need to remove default absolute positioning as that causes issues with position fixed */
17
17
  position: 'static',
@@ -1,12 +1,16 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
3
4
  import { components } from '@atlaskit/select';
4
5
 
5
6
  /**
6
7
  * This creates a functional component that `react-select` will use to make the
7
8
  * SingleValue part of the different pickers.
8
9
  */
9
- export const makeSingleValue = ({
10
+ export const makeSingleValue =
11
+ // TODO: Make ID required
12
+ ({
13
+ id,
10
14
  lang
11
15
  }) => ({
12
16
  children,
@@ -36,6 +40,9 @@ export const makeSingleValue = ({
36
40
  getValue: getValue,
37
41
  hasValue: hasValue,
38
42
  innerProps: {
43
+ ...(fg('platform-dtp_a11y_fix-dsp-23950') ? {
44
+ id
45
+ } : {}),
39
46
  lang
40
47
  },
41
48
  isDisabled: isDisabled,
@@ -32,7 +32,7 @@ import { Menu } from '../internal/menu';
32
32
  import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
33
33
  import { makeSingleValue } from '../internal/single-value';
34
34
  var packageName = "@atlaskit/datetime-picker";
35
- var packageVersion = "0.0.0-development";
35
+ var packageVersion = "17.1.0";
36
36
  var datePickerDefaultProps = {
37
37
  defaultIsOpen: false,
38
38
  defaultValue: '',
@@ -438,8 +438,6 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
438
438
  var menuIsOpen = this.getIsOpen() && !isDisabled;
439
439
  var showClearIndicator = Boolean((value || selectInputValue) && !hideIcon);
440
440
  var clearIndicator = Icon;
441
-
442
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
443
441
  if (fg('platform-visual-refresh-icons')) {
444
442
  clearIndicator = function clearIndicator(props) {
445
443
  return /*#__PURE__*/React.createElement(Box, {
@@ -448,9 +446,6 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
448
446
  };
449
447
  }
450
448
  var dropDownIcon = appearance === 'subtle' || hideIcon || showClearIndicator ? null : clearIndicator;
451
- var SingleValue = makeSingleValue({
452
- lang: this.props.locale
453
- });
454
449
  var selectComponents = _objectSpread(_objectSpread(_objectSpread({
455
450
  DropdownIndicator: shouldShowCalendarButton ? EmptyComponent : dropDownIcon
456
451
  }, shouldShowCalendarButton ? {
@@ -460,8 +455,7 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
460
455
  }));
461
456
  }
462
457
  } : {}), {}, {
463
- Menu: Menu,
464
- SingleValue: SingleValue
458
+ Menu: Menu
465
459
  }, !showClearIndicator && {
466
460
  ClearIndicator: EmptyComponent
467
461
  }), selectProps.components);
@@ -528,11 +522,80 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
528
522
  type: "hidden",
529
523
  value: value,
530
524
  "data-testid": testId && "".concat(testId, "--input")
531
- }), /*#__PURE__*/React.createElement(Select, _extends({
525
+ }), fg('platform-dtp_a11y_fix-dsp-23950') ? /*#__PURE__*/React.createElement(IdProvider, null, function (_ref3) {
526
+ var valueId = _ref3.id;
527
+ return /*#__PURE__*/React.createElement(Select, _extends({
528
+ appearance: _this2.props.appearance,
529
+ "aria-describedby": ariaDescribedBy ? "".concat(ariaDescribedBy, " ").concat(valueId) : valueId,
530
+ label: label || undefined
531
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
532
+ ,
533
+ autoFocus: autoFocus,
534
+ clearControlLabel: clearControlLabel,
535
+ closeMenuOnSelect: true,
536
+ enableAnimation: false,
537
+ inputId: id,
538
+ inputValue: actualSelectInputValue,
539
+ isDisabled: isDisabled,
540
+ isRequired: isRequired,
541
+ menuIsOpen: menuIsOpen,
542
+ onBlur: _this2.onSelectBlur,
543
+ onChange: _this2.onSelectChange,
544
+ onFocus: _this2.onSelectFocus,
545
+ onInputChange: _this2.handleSelectInputChange,
546
+ placeholder: getPlaceholder({
547
+ placeholder: _this2.props.placeholder,
548
+ l10n: _this2.state.l10n
549
+ })
550
+ // @ts-ignore -- Argument of type 'StylesConfig<OptionType, false, GroupBase<OptionType>>' is not assignable to parameter of type 'StylesConfig<OptionType, boolean, GroupBase<OptionType>>'
551
+ ,
552
+ styles: mergedStyles,
553
+ value: initialValue
554
+ }, selectProps, {
555
+ // For some reason, this and the below `styles` type error _only_ show
556
+ // up when you alter some of the properties in the `selectComponents`
557
+ // object. These errors are still present, and I suspect have always
558
+ // been present, without changing the unrelated code. Ignoring as the
559
+ // component still works as expected despite this error. And also
560
+ // because the select refresh team may solve it later.
561
+ components: _objectSpread(_objectSpread({}, selectComponents), {}, {
562
+ SingleValue: makeSingleValue({
563
+ id: valueId,
564
+ lang: _this2.props.locale
565
+ })
566
+ })
567
+ // These are below the spread because I don't know what is in
568
+ // selectProps or not and what wil be overwritten
569
+ ,
570
+ isClearable: true,
571
+ isInvalid: isInvalid,
572
+ spacing: spacing,
573
+ testId: testId
574
+ // These aren't part of `Select`'s API, but we're using them here.
575
+ // @ts-ignore -- Property 'calendarContainerRef' does not exist on type 'IntrinsicAttributes & LibraryManagedAttributes<(<Option extends unknown = OptionType, IsMulti extends boolean = false>(props: AtlaskitSelectProps<Option, IsMulti> & { ...; }) => Element), AtlaskitSelectProps<...> & { ...; }>'.
576
+ ,
577
+ calendarContainerRef: calendarProps.calendarContainerRef,
578
+ calendarDisabled: calendarProps.calendarDisabled,
579
+ calendarDisabledDateFilter: calendarProps.calendarDisabledDateFilter,
580
+ calendarLocale: calendarProps.calendarLocale,
581
+ calendarMaxDate: calendarProps.calendarMaxDate,
582
+ calendarMinDate: calendarProps.calendarMinDate,
583
+ calendarRef: calendarProps.calendarRef,
584
+ calendarValue: calendarProps.calendarValue,
585
+ calendarView: calendarProps.calendarView,
586
+ calendarWeekStartDay: calendarProps.calendarWeekStartDay,
587
+ nextMonthLabel: nextMonthLabel,
588
+ onCalendarChange: calendarProps.onCalendarChange,
589
+ onCalendarSelect: calendarProps.onCalendarSelect,
590
+ previousMonthLabel: previousMonthLabel,
591
+ shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
592
+ menuInnerWrapper: calendarProps.menuInnerWrapper
593
+ }));
594
+ }) : /*#__PURE__*/React.createElement(Select, _extends({
532
595
  appearance: this.props.appearance,
533
596
  "aria-describedby": ariaDescribedBy,
534
597
  label: label || undefined
535
- // eslint-disable-next-line jsx-a11y/no-autofocus
598
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
536
599
  ,
537
600
  autoFocus: autoFocus,
538
601
  clearControlLabel: clearControlLabel,
@@ -562,7 +625,11 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
562
625
  // been present, without changing the unrelated code. Ignoring as the
563
626
  // component still works as expected despite this error. And also
564
627
  // because the select refresh team may solve it later.
565
- components: selectComponents
628
+ components: _objectSpread(_objectSpread({}, selectComponents), {}, {
629
+ SingleValue: makeSingleValue({
630
+ lang: this.props.locale
631
+ })
632
+ })
566
633
  // These are below the spread because I don't know what is in
567
634
  // selectProps or not and what wil be overwritten
568
635
  ,
@@ -591,8 +658,8 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
591
658
  menuInnerWrapper: calendarProps.menuInnerWrapper
592
659
  })), shouldShowCalendarButton && !isDisabled ? /*#__PURE__*/React.createElement(IdProvider, {
593
660
  prefix: "open-calendar-label--"
594
- }, function (_ref3) {
595
- var openCalendarLabelId = _ref3.id;
661
+ }, function (_ref4) {
662
+ var openCalendarLabelId = _ref4.id;
596
663
  return /*#__PURE__*/React.createElement(Box, {
597
664
  xcss: cx(styles.iconContainerStyles, value && !hideIcon ? styles.iconSpacingWithClearButtonStyles : styles.iconSpacingWithoutClearButtonStyles)
598
665
  }, /*#__PURE__*/React.createElement(IconButton, {
@@ -29,7 +29,7 @@ import { Menu } from '../internal/menu';
29
29
  import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
30
30
  import { makeSingleValue } from '../internal/single-value';
31
31
  var packageName = "@atlaskit/datetime-picker";
32
- var packageVersion = "0.0.0-development";
32
+ var packageVersion = "17.1.0";
33
33
  var styles = {
34
34
  pickerContainerStyle: "_kqswh2mm",
35
35
  dropdownIndicatorStyles: "_1ul91k8s _1tke1k8s _1e0c1txw _4cvr1h6o _1bah1h6o",
@@ -441,8 +441,6 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
441
441
  var menuIsOpen = getIsOpen() && !isDisabled;
442
442
  var showClearIndicator = Boolean((getterValue || selectInputValue) && !hideIcon);
443
443
  var clearIndicator = Icon;
444
-
445
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
446
444
  if (fg('platform-visual-refresh-icons')) {
447
445
  clearIndicator = function clearIndicator(props) {
448
446
  return /*#__PURE__*/React.createElement(Box, {
@@ -451,7 +449,9 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
451
449
  };
452
450
  }
453
451
  var dropDownIcon = appearance === 'subtle' || hideIcon || showClearIndicator ? null : clearIndicator;
452
+ var valueId = useId();
454
453
  var SingleValue = makeSingleValue({
454
+ id: valueId,
455
455
  lang: propLocale
456
456
  });
457
457
  var selectComponents = _objectSpread(_objectSpread(_objectSpread({}, selectProps.components), {}, {
@@ -539,9 +539,9 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
539
539
  "data-testid": testId && "".concat(testId, "--input")
540
540
  }), /*#__PURE__*/React.createElement(Select, _extends({
541
541
  appearance: appearance,
542
- "aria-describedby": ariaDescribedBy,
542
+ "aria-describedby": fg('platform-dtp_a11y_fix-dsp-23950') ? ariaDescribedBy ? "".concat(ariaDescribedBy, " ").concat(valueId) : valueId : ariaDescribedBy,
543
543
  label: label || undefined
544
- // eslint-disable-next-line jsx-a11y/no-autofocus
544
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
545
545
  ,
546
546
  autoFocus: autoFocus,
547
547
  clearControlLabel: clearControlLabel,
@@ -560,8 +560,8 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
560
560
  placeholder: placeholder,
561
561
  l10n: l10n
562
562
  })
563
- // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
564
563
  // @ts-ignore -- Type 'OptionType' is not assignable to type '{ label: string; value: string; }'
564
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
565
565
  ,
566
566
  styles: mergedStyles,
567
567
  value: initialValue
@@ -30,7 +30,7 @@ var DatePicker = componentWithCondition(function () {
30
30
  return fg('dst-date-picker-use-functional-component');
31
31
  }, DatePickerNew, DatePickerOld);
32
32
  var packageName = "@atlaskit/datetime-picker";
33
- var packageVersion = "0.0.0-development";
33
+ var packageVersion = "17.1.0";
34
34
  var compiledStyles = {
35
35
  datePickerContainerStyles: "_i0dl1ssb _16jlkb7n _1o9zidpf",
36
36
  timePickerContainerStyles: "_i0dl1ssb _16jlkb7n",
@@ -27,13 +27,11 @@ import { convertTokens } from '../internal/parse-tokens';
27
27
  import DatePickerOld from './date-picker-class';
28
28
  import DatePickerNew from './date-picker-fc';
29
29
  import TimePicker from './time-picker';
30
- var DatePicker = componentWithCondition(
31
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
32
- function () {
30
+ var DatePicker = componentWithCondition(function () {
33
31
  return fg('dst-date-picker-use-functional-component');
34
32
  }, DatePickerNew, DatePickerOld);
35
33
  var packageName = "@atlaskit/datetime-picker";
36
- var packageVersion = "0.0.0-development";
34
+ var packageVersion = "17.1.0";
37
35
  var analyticsAttributes = {
38
36
  componentName: 'dateTimePicker',
39
37
  packageName: packageName,
@@ -292,7 +290,7 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
292
290
  }, /*#__PURE__*/React.createElement(DatePicker, {
293
291
  appearance: appearance,
294
292
  "aria-describedby": datePickerAriaDescribedBy
295
- // eslint-disable-next-line jsx-a11y/no-autofocus
293
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
296
294
  ,
297
295
  autoFocus: datePickerProps.autoFocus || autoFocus,
298
296
  dateFormat: datePickerProps.dateFormat,
@@ -335,7 +333,7 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
335
333
  }, /*#__PURE__*/React.createElement(TimePicker, {
336
334
  appearance: timePickerProps.appearance || appearance,
337
335
  "aria-describedby": timePickerAriaDescribedBy
338
- // eslint-disable-next-line jsx-a11y/no-autofocus
336
+ // eslint-disable-next-line @atlassian/a11y/no-autofocus
339
337
  ,
340
338
  autoFocus: timePickerProps.autoFocus,
341
339
  defaultIsOpen: timePickerProps.defaultIsOpen,
@@ -17,7 +17,7 @@ import parseTime from '../internal/parse-time';
17
17
  import { convertTokens } from '../internal/parse-tokens';
18
18
  import { makeSingleValue } from '../internal/single-value';
19
19
  var packageName = "@atlaskit/datetime-picker";
20
- var packageVersion = "0.0.0-development";
20
+ var packageVersion = "17.1.0";
21
21
  var menuStyles = {
22
22
  /* Need to remove default absolute positioning as that causes issues with position fixed */
23
23
  position: 'static',
@@ -1,15 +1,22 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
4
  var _excluded = ["children", "className", "clearValue", "cx", "data", "getStyles", "getValue", "hasValue", "isDisabled", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue"];
5
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
7
  import React from 'react';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
5
9
  import { components } from '@atlaskit/select';
6
10
 
7
11
  /**
8
12
  * This creates a functional component that `react-select` will use to make the
9
13
  * SingleValue part of the different pickers.
10
14
  */
11
- export var makeSingleValue = function makeSingleValue(_ref) {
12
- var lang = _ref.lang;
15
+ export var makeSingleValue =
16
+ // TODO: Make ID required
17
+ function makeSingleValue(_ref) {
18
+ var id = _ref.id,
19
+ lang = _ref.lang;
13
20
  return function (_ref2) {
14
21
  var children = _ref2.children,
15
22
  className = _ref2.className,
@@ -36,9 +43,11 @@ export var makeSingleValue = function makeSingleValue(_ref) {
36
43
  getStyles: getStyles,
37
44
  getValue: getValue,
38
45
  hasValue: hasValue,
39
- innerProps: {
46
+ innerProps: _objectSpread(_objectSpread({}, fg('platform-dtp_a11y_fix-dsp-23950') ? {
47
+ id: id
48
+ } : {}), {}, {
40
49
  lang: lang
41
- },
50
+ }),
42
51
  isDisabled: isDisabled,
43
52
  isMulti: isMulti,
44
53
  isRtl: isRtl,
@@ -4,6 +4,7 @@ import { type OptionType, type SingleValueProps } from '@atlaskit/select';
4
4
  * This creates a functional component that `react-select` will use to make the
5
5
  * SingleValue part of the different pickers.
6
6
  */
7
- export declare const makeSingleValue: ({ lang }: {
7
+ export declare const makeSingleValue: ({ id, lang }: {
8
+ id?: string;
8
9
  lang: string;
9
10
  }) => ({ children, className, clearValue, cx, data, getStyles, getValue, hasValue, isDisabled, isMulti, isRtl, options, selectOption, selectProps, setValue, ...rest }: SingleValueProps<OptionType, false>) => React.JSX.Element;
@@ -4,6 +4,7 @@ import { type OptionType, type SingleValueProps } from '@atlaskit/select';
4
4
  * This creates a functional component that `react-select` will use to make the
5
5
  * SingleValue part of the different pickers.
6
6
  */
7
- export declare const makeSingleValue: ({ lang }: {
7
+ export declare const makeSingleValue: ({ id, lang }: {
8
+ id?: string;
8
9
  lang: string;
9
10
  }) => ({ children, className, clearValue, cx, data, getStyles, getValue, hasValue, isDisabled, isMulti, isRtl, options, selectOption, selectProps, setValue, ...rest }: SingleValueProps<OptionType, false>) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "17.0.18",
3
+ "version": "17.1.1",
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/"
@@ -33,18 +33,18 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/analytics-next": "^11.1.0",
36
- "@atlaskit/button": "^23.4.0",
36
+ "@atlaskit/button": "^23.5.0",
37
37
  "@atlaskit/calendar": "^17.1.0",
38
- "@atlaskit/css": "^0.14.0",
38
+ "@atlaskit/css": "^0.15.0",
39
39
  "@atlaskit/ds-lib": "^5.1.0",
40
- "@atlaskit/icon": "^28.3.0",
41
- "@atlaskit/layering": "^3.0.0",
40
+ "@atlaskit/icon": "^28.5.0",
41
+ "@atlaskit/layering": "^3.1.0",
42
42
  "@atlaskit/locale": "^3.0.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
44
  "@atlaskit/popper": "^7.1.0",
45
- "@atlaskit/primitives": "^14.15.0",
45
+ "@atlaskit/primitives": "^15.0.0",
46
46
  "@atlaskit/select": "^21.3.0",
47
- "@atlaskit/tokens": "^6.4.0",
47
+ "@atlaskit/tokens": "^6.5.0",
48
48
  "@atlaskit/visually-hidden": "^3.0.0",
49
49
  "@babel/runtime": "^7.0.0",
50
50
  "@compiled/react": "^0.18.3",
@@ -63,13 +63,14 @@
63
63
  "@atlaskit/form": "^14.2.0",
64
64
  "@atlaskit/heading": "^5.2.0",
65
65
  "@atlaskit/link": "^3.2.0",
66
- "@atlaskit/modal-dialog": "^14.4.0",
66
+ "@atlaskit/modal-dialog": "^14.5.0",
67
67
  "@atlaskit/popup": "^4.4.0",
68
68
  "@atlaskit/range": "^9.2.0",
69
69
  "@atlaskit/section-message": "^8.7.0",
70
70
  "@atlaskit/ssr": "workspace:^",
71
71
  "@atlaskit/textfield": "^8.0.0",
72
72
  "@atlaskit/toggle": "^15.1.0",
73
+ "@atlassian/feature-flags-test-utils": "^0.3.0",
73
74
  "@atlassian/ssr-tests": "^0.3.0",
74
75
  "@testing-library/react": "^13.4.0",
75
76
  "@testing-library/user-event": "^14.4.3",
@@ -112,6 +113,9 @@
112
113
  },
113
114
  "platform-visual-refresh-icons": {
114
115
  "type": "boolean"
116
+ },
117
+ "platform-dtp_a11y_fix-dsp-23950": {
118
+ "type": "boolean"
115
119
  }
116
120
  },
117
121
  "homepage": "https://atlassian.design/components/datetime-picker/"