@atlaskit/datetime-picker 17.1.5 → 17.1.6

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,12 @@
1
1
  # @atlaskit/datetime-picker
2
2
 
3
+ ## 17.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a8247416bb21a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a8247416bb21a) -
8
+ Improve accessible description of date picker.
9
+
3
10
  ## 17.1.5
4
11
 
5
12
  ### Patch Changes
@@ -530,7 +530,7 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
530
530
  type: "hidden",
531
531
  value: value,
532
532
  "data-testid": testId && "".concat(testId, "--input")
533
- }), (0, _platformFeatureFlags.fg)('platform-dtp_a11y_fix-dsp-23950') ? /*#__PURE__*/React.createElement(_useId.IdProvider, null, function (_ref3) {
533
+ }), /*#__PURE__*/React.createElement(_useId.IdProvider, null, function (_ref3) {
534
534
  var valueId = _ref3.id;
535
535
  return /*#__PURE__*/React.createElement(_select.default, (0, _extends2.default)({
536
536
  appearance: _this2.props.appearance,
@@ -597,70 +597,7 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
597
597
  shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
598
598
  menuInnerWrapper: calendarProps.menuInnerWrapper
599
599
  }));
600
- }) : /*#__PURE__*/React.createElement(_select.default, (0, _extends2.default)({
601
- appearance: this.props.appearance,
602
- "aria-describedby": ariaDescribedBy,
603
- label: label || undefined,
604
- autoFocus: autoFocus,
605
- clearControlLabel: clearControlLabel,
606
- closeMenuOnSelect: true,
607
- enableAnimation: false,
608
- inputId: id,
609
- inputValue: actualSelectInputValue,
610
- isDisabled: isDisabled,
611
- isRequired: isRequired,
612
- menuIsOpen: menuIsOpen,
613
- onBlur: this.onSelectBlur,
614
- onChange: this.onSelectChange,
615
- onFocus: this.onSelectFocus,
616
- onInputChange: this.handleSelectInputChange,
617
- placeholder: (0, _datePickerMigration.getPlaceholder)({
618
- placeholder: this.props.placeholder,
619
- l10n: this.state.l10n
620
- })
621
- // @ts-ignore -- Argument of type 'StylesConfig<OptionType, false, GroupBase<OptionType>>' is not assignable to parameter of type 'StylesConfig<OptionType, boolean, GroupBase<OptionType>>'
622
- ,
623
- styles: mergedStyles,
624
- value: initialValue
625
- }, selectProps, {
626
- // For some reason, this and the below `styles` type error _only_ show
627
- // up when you alter some of the properties in the `selectComponents`
628
- // object. These errors are still present, and I suspect have always
629
- // been present, without changing the unrelated code. Ignoring as the
630
- // component still works as expected despite this error. And also
631
- // because the select refresh team may solve it later.
632
- components: _objectSpread(_objectSpread({}, selectComponents), {}, {
633
- SingleValue: (0, _singleValue.makeSingleValue)({
634
- lang: this.props.locale
635
- })
636
- })
637
- // These are below the spread because I don't know what is in
638
- // selectProps or not and what wil be overwritten
639
- ,
640
- isClearable: true,
641
- isInvalid: isInvalid,
642
- spacing: spacing,
643
- testId: testId
644
- // These aren't part of `Select`'s API, but we're using them here.
645
- // @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<...> & { ...; }>'.
646
- ,
647
- calendarContainerRef: calendarProps.calendarContainerRef,
648
- calendarDisabled: calendarProps.calendarDisabled,
649
- calendarDisabledDateFilter: calendarProps.calendarDisabledDateFilter,
650
- calendarLocale: calendarProps.calendarLocale,
651
- calendarMaxDate: calendarProps.calendarMaxDate,
652
- calendarMinDate: calendarProps.calendarMinDate,
653
- calendarRef: calendarProps.calendarRef,
654
- calendarValue: calendarProps.calendarValue,
655
- calendarView: calendarProps.calendarView,
656
- calendarWeekStartDay: calendarProps.calendarWeekStartDay,
657
- nextMonthLabel: nextMonthLabel,
658
- onCalendarChange: calendarProps.onCalendarChange,
659
- onCalendarSelect: calendarProps.onCalendarSelect,
660
- previousMonthLabel: previousMonthLabel,
661
- shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
662
- menuInnerWrapper: calendarProps.menuInnerWrapper
663
- })), shouldShowCalendarButton && !isDisabled ? /*#__PURE__*/React.createElement(_useId.IdProvider, {
600
+ }), shouldShowCalendarButton && !isDisabled ? /*#__PURE__*/React.createElement(_useId.IdProvider, {
664
601
  prefix: "open-calendar-label--"
665
602
  }, function (_ref4) {
666
603
  var openCalendarLabelId = _ref4.id;
@@ -547,7 +547,7 @@ 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": (0, _platformFeatureFlags.fg)('platform-dtp_a11y_fix-dsp-23950') ? ariaDescribedBy ? "".concat(ariaDescribedBy, " ").concat(valueId) : valueId : ariaDescribedBy,
550
+ "aria-describedby": ariaDescribedBy ? "".concat(ariaDescribedBy, " ").concat(valueId) : valueId,
551
551
  label: label || undefined,
552
552
  autoFocus: autoFocus,
553
553
  clearControlLabel: clearControlLabel,
@@ -6,14 +6,10 @@ 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"));
10
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
10
  var _react = _interopRequireDefault(require("react"));
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
11
  var _select = require("@atlaskit/select");
14
12
  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; }
17
13
  /**
18
14
  * This creates a functional component that `react-select` will use to make the
19
15
  * SingleValue part of the different pickers.
@@ -49,11 +45,10 @@ function makeSingleValue(_ref) {
49
45
  getStyles: getStyles,
50
46
  getValue: getValue,
51
47
  hasValue: hasValue,
52
- innerProps: _objectSpread(_objectSpread({}, (0, _platformFeatureFlags.fg)('platform-dtp_a11y_fix-dsp-23950') ? {
53
- id: id
54
- } : {}), {}, {
48
+ innerProps: {
49
+ id: id,
55
50
  lang: lang
56
- }),
51
+ },
57
52
  isDisabled: isDisabled,
58
53
  isMulti: isMulti,
59
54
  isRtl: isRtl,
@@ -509,7 +509,7 @@ class DatePickerComponent extends Component {
509
509
  type: "hidden",
510
510
  value: value,
511
511
  "data-testid": testId && `${testId}--input`
512
- }), fg('platform-dtp_a11y_fix-dsp-23950') ? /*#__PURE__*/React.createElement(IdProvider, null, ({
512
+ }), /*#__PURE__*/React.createElement(IdProvider, null, ({
513
513
  id: valueId
514
514
  }) => /*#__PURE__*/React.createElement(Select, _extends({
515
515
  appearance: this.props.appearance,
@@ -576,71 +576,7 @@ class DatePickerComponent extends Component {
576
576
  previousMonthLabel: previousMonthLabel,
577
577
  shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
578
578
  menuInnerWrapper: calendarProps.menuInnerWrapper
579
- }))) : /*#__PURE__*/React.createElement(Select, _extends({
580
- appearance: this.props.appearance,
581
- "aria-describedby": ariaDescribedBy,
582
- label: label || undefined,
583
- autoFocus: autoFocus,
584
- clearControlLabel: clearControlLabel,
585
- closeMenuOnSelect: true,
586
- enableAnimation: false,
587
- inputId: id,
588
- inputValue: actualSelectInputValue,
589
- isDisabled: isDisabled,
590
- isRequired: isRequired,
591
- menuIsOpen: menuIsOpen,
592
- onBlur: this.onSelectBlur,
593
- onChange: this.onSelectChange,
594
- onFocus: this.onSelectFocus,
595
- onInputChange: this.handleSelectInputChange,
596
- placeholder: getPlaceholder({
597
- placeholder: this.props.placeholder,
598
- l10n: this.state.l10n
599
- })
600
- // @ts-ignore -- Argument of type 'StylesConfig<OptionType, false, GroupBase<OptionType>>' is not assignable to parameter of type 'StylesConfig<OptionType, boolean, GroupBase<OptionType>>'
601
- ,
602
- styles: mergedStyles,
603
- value: initialValue
604
- }, selectProps, {
605
- // For some reason, this and the below `styles` type error _only_ show
606
- // up when you alter some of the properties in the `selectComponents`
607
- // object. These errors are still present, and I suspect have always
608
- // been present, without changing the unrelated code. Ignoring as the
609
- // component still works as expected despite this error. And also
610
- // because the select refresh team may solve it later.
611
- components: {
612
- ...selectComponents,
613
- SingleValue: makeSingleValue({
614
- lang: this.props.locale
615
- })
616
- }
617
- // These are below the spread because I don't know what is in
618
- // selectProps or not and what wil be overwritten
619
- ,
620
- isClearable: true,
621
- isInvalid: isInvalid,
622
- spacing: spacing,
623
- testId: testId
624
- // These aren't part of `Select`'s API, but we're using them here.
625
- // @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<...> & { ...; }>'.
626
- ,
627
- calendarContainerRef: calendarProps.calendarContainerRef,
628
- calendarDisabled: calendarProps.calendarDisabled,
629
- calendarDisabledDateFilter: calendarProps.calendarDisabledDateFilter,
630
- calendarLocale: calendarProps.calendarLocale,
631
- calendarMaxDate: calendarProps.calendarMaxDate,
632
- calendarMinDate: calendarProps.calendarMinDate,
633
- calendarRef: calendarProps.calendarRef,
634
- calendarValue: calendarProps.calendarValue,
635
- calendarView: calendarProps.calendarView,
636
- calendarWeekStartDay: calendarProps.calendarWeekStartDay,
637
- nextMonthLabel: nextMonthLabel,
638
- onCalendarChange: calendarProps.onCalendarChange,
639
- onCalendarSelect: calendarProps.onCalendarSelect,
640
- previousMonthLabel: previousMonthLabel,
641
- shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
642
- menuInnerWrapper: calendarProps.menuInnerWrapper
643
- })), shouldShowCalendarButton && !isDisabled ? /*#__PURE__*/React.createElement(IdProvider, {
579
+ }))), shouldShowCalendarButton && !isDisabled ? /*#__PURE__*/React.createElement(IdProvider, {
644
580
  prefix: "open-calendar-label--"
645
581
  }, ({
646
582
  id: openCalendarLabelId
@@ -474,7 +474,7 @@ const DatePicker = /*#__PURE__*/forwardRef((props, forwardedRef) => {
474
474
  "data-testid": testId && `${testId}--input`
475
475
  }), /*#__PURE__*/React.createElement(Select, _extends({
476
476
  appearance: appearance,
477
- "aria-describedby": fg('platform-dtp_a11y_fix-dsp-23950') ? ariaDescribedBy ? `${ariaDescribedBy} ${valueId}` : valueId : ariaDescribedBy,
477
+ "aria-describedby": ariaDescribedBy ? `${ariaDescribedBy} ${valueId}` : valueId,
478
478
  label: label || undefined,
479
479
  autoFocus: autoFocus,
480
480
  clearControlLabel: clearControlLabel,
@@ -1,6 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  import { components } from '@atlaskit/select';
5
4
 
6
5
  /**
@@ -40,9 +39,7 @@ export const makeSingleValue =
40
39
  getValue: getValue,
41
40
  hasValue: hasValue,
42
41
  innerProps: {
43
- ...(fg('platform-dtp_a11y_fix-dsp-23950') ? {
44
- id
45
- } : {}),
42
+ id,
46
43
  lang
47
44
  },
48
45
  isDisabled: isDisabled,
@@ -522,7 +522,7 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
522
522
  type: "hidden",
523
523
  value: value,
524
524
  "data-testid": testId && "".concat(testId, "--input")
525
- }), fg('platform-dtp_a11y_fix-dsp-23950') ? /*#__PURE__*/React.createElement(IdProvider, null, function (_ref3) {
525
+ }), /*#__PURE__*/React.createElement(IdProvider, null, function (_ref3) {
526
526
  var valueId = _ref3.id;
527
527
  return /*#__PURE__*/React.createElement(Select, _extends({
528
528
  appearance: _this2.props.appearance,
@@ -589,70 +589,7 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
589
589
  shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
590
590
  menuInnerWrapper: calendarProps.menuInnerWrapper
591
591
  }));
592
- }) : /*#__PURE__*/React.createElement(Select, _extends({
593
- appearance: this.props.appearance,
594
- "aria-describedby": ariaDescribedBy,
595
- label: label || undefined,
596
- autoFocus: autoFocus,
597
- clearControlLabel: clearControlLabel,
598
- closeMenuOnSelect: true,
599
- enableAnimation: false,
600
- inputId: id,
601
- inputValue: actualSelectInputValue,
602
- isDisabled: isDisabled,
603
- isRequired: isRequired,
604
- menuIsOpen: menuIsOpen,
605
- onBlur: this.onSelectBlur,
606
- onChange: this.onSelectChange,
607
- onFocus: this.onSelectFocus,
608
- onInputChange: this.handleSelectInputChange,
609
- placeholder: getPlaceholder({
610
- placeholder: this.props.placeholder,
611
- l10n: this.state.l10n
612
- })
613
- // @ts-ignore -- Argument of type 'StylesConfig<OptionType, false, GroupBase<OptionType>>' is not assignable to parameter of type 'StylesConfig<OptionType, boolean, GroupBase<OptionType>>'
614
- ,
615
- styles: mergedStyles,
616
- value: initialValue
617
- }, selectProps, {
618
- // For some reason, this and the below `styles` type error _only_ show
619
- // up when you alter some of the properties in the `selectComponents`
620
- // object. These errors are still present, and I suspect have always
621
- // been present, without changing the unrelated code. Ignoring as the
622
- // component still works as expected despite this error. And also
623
- // because the select refresh team may solve it later.
624
- components: _objectSpread(_objectSpread({}, selectComponents), {}, {
625
- SingleValue: makeSingleValue({
626
- lang: this.props.locale
627
- })
628
- })
629
- // These are below the spread because I don't know what is in
630
- // selectProps or not and what wil be overwritten
631
- ,
632
- isClearable: true,
633
- isInvalid: isInvalid,
634
- spacing: spacing,
635
- testId: testId
636
- // These aren't part of `Select`'s API, but we're using them here.
637
- // @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<...> & { ...; }>'.
638
- ,
639
- calendarContainerRef: calendarProps.calendarContainerRef,
640
- calendarDisabled: calendarProps.calendarDisabled,
641
- calendarDisabledDateFilter: calendarProps.calendarDisabledDateFilter,
642
- calendarLocale: calendarProps.calendarLocale,
643
- calendarMaxDate: calendarProps.calendarMaxDate,
644
- calendarMinDate: calendarProps.calendarMinDate,
645
- calendarRef: calendarProps.calendarRef,
646
- calendarValue: calendarProps.calendarValue,
647
- calendarView: calendarProps.calendarView,
648
- calendarWeekStartDay: calendarProps.calendarWeekStartDay,
649
- nextMonthLabel: nextMonthLabel,
650
- onCalendarChange: calendarProps.onCalendarChange,
651
- onCalendarSelect: calendarProps.onCalendarSelect,
652
- previousMonthLabel: previousMonthLabel,
653
- shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
654
- menuInnerWrapper: calendarProps.menuInnerWrapper
655
- })), shouldShowCalendarButton && !isDisabled ? /*#__PURE__*/React.createElement(IdProvider, {
592
+ }), shouldShowCalendarButton && !isDisabled ? /*#__PURE__*/React.createElement(IdProvider, {
656
593
  prefix: "open-calendar-label--"
657
594
  }, function (_ref4) {
658
595
  var openCalendarLabelId = _ref4.id;
@@ -539,7 +539,7 @@ 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": fg('platform-dtp_a11y_fix-dsp-23950') ? ariaDescribedBy ? "".concat(ariaDescribedBy, " ").concat(valueId) : valueId : ariaDescribedBy,
542
+ "aria-describedby": ariaDescribedBy ? "".concat(ariaDescribedBy, " ").concat(valueId) : valueId,
543
543
  label: label || undefined,
544
544
  autoFocus: autoFocus,
545
545
  clearControlLabel: clearControlLabel,
@@ -1,11 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
3
  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; }
7
4
  import React from 'react';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
5
  import { components } from '@atlaskit/select';
10
6
 
11
7
  /**
@@ -43,11 +39,10 @@ function makeSingleValue(_ref) {
43
39
  getStyles: getStyles,
44
40
  getValue: getValue,
45
41
  hasValue: hasValue,
46
- innerProps: _objectSpread(_objectSpread({}, fg('platform-dtp_a11y_fix-dsp-23950') ? {
47
- id: id
48
- } : {}), {}, {
42
+ innerProps: {
43
+ id: id,
49
44
  lang: lang
50
- }),
45
+ },
51
46
  isDisabled: isDisabled,
52
47
  isMulti: isMulti,
53
48
  isRtl: isRtl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "17.1.5",
3
+ "version": "17.1.6",
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/"
@@ -36,7 +36,7 @@
36
36
  "@atlaskit/button": "^23.5.0",
37
37
  "@atlaskit/calendar": "^17.1.0",
38
38
  "@atlaskit/css": "^0.15.0",
39
- "@atlaskit/ds-lib": "^5.1.0",
39
+ "@atlaskit/ds-lib": "^5.2.0",
40
40
  "@atlaskit/icon": "^28.5.0",
41
41
  "@atlaskit/layering": "^3.2.0",
42
42
  "@atlaskit/locale": "^3.0.0",
@@ -113,9 +113,6 @@
113
113
  },
114
114
  "platform-visual-refresh-icons": {
115
115
  "type": "boolean"
116
- },
117
- "platform-dtp_a11y_fix-dsp-23950": {
118
- "type": "boolean"
119
116
  }
120
117
  },
121
118
  "homepage": "https://atlassian.design/components/datetime-picker/"