@atlaskit/datetime-picker 15.7.1 → 15.9.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,21 @@
1
1
  # @atlaskit/datetime-picker
2
2
 
3
+ ## 15.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#161715](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/161715)
8
+ [`fc083f8b29d92`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fc083f8b29d92) -
9
+ update datetime picker to use button component and primitives
10
+
11
+ ## 15.8.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#161680](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/161680)
16
+ [`e47891c352097`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e47891c352097) -
17
+ Update date picker to include latest primitives and css
18
+
3
19
  ## 15.7.1
4
20
 
5
21
  ### Patch Changes
@@ -43,7 +43,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
43
43
  * @jsx jsx
44
44
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
45
45
  var packageName = "@atlaskit/datetime-picker";
46
- var packageVersion = "15.7.1";
46
+ var packageVersion = "15.9.0";
47
47
  var dropdownIndicatorStyles = (0, _primitives.xcss)({
48
48
  minWidth: "var(--ds-space-300, 24px)",
49
49
  minHeight: "var(--ds-space-300, 24px)",
@@ -21,7 +21,6 @@ var _locale = require("@atlaskit/locale");
21
21
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
22
  var _primitives = require("@atlaskit/primitives");
23
23
  var _select = _interopRequireWildcard(require("@atlaskit/select"));
24
- var _colors = require("@atlaskit/theme/colors");
25
24
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
26
25
  var _internal = require("../internal");
27
26
  var _datePickerMigration = require("../internal/date-picker-migration");
@@ -40,7 +39,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
40
39
  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; }
41
40
  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; }
42
41
  var packageName = "@atlaskit/datetime-picker";
43
- var packageVersion = "15.7.1";
42
+ var packageVersion = "15.9.0";
44
43
  var analyticsAttributes = {
45
44
  componentName: 'datePicker',
46
45
  packageName: packageName,
@@ -56,31 +55,33 @@ var dropdownIndicatorStyles = (0, _primitives.xcss)({
56
55
  alignItems: 'center',
57
56
  justifyContent: 'center'
58
57
  });
58
+
59
+ // eslint-disable-next-line @atlaskit/platform/no-module-level-eval, @atlaskit/platform/ensure-feature-flag-prefix
59
60
  var CalendarIcon = (0, _platformFeatureFlags.fg)('platform-visual-refresh-icon-ads-migration') ? _calendar.default :
60
61
  // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons
61
62
  _calendar2.default;
62
- var iconContainerStyles = (0, _react2.css)({
63
+ var iconContainerStyles = (0, _primitives.xcss)({
63
64
  display: 'flex',
64
65
  height: '100%',
65
66
  position: 'absolute',
66
67
  alignItems: 'center',
67
68
  flexBasis: 'inherit',
68
- color: "var(--ds-text-subtlest, ".concat(_colors.N70, ")"),
69
- insetBlockStart: 0,
70
- insetInlineEnd: 0,
69
+ color: 'color.text.subtlest',
70
+ insetBlockStart: 'space.0',
71
+ insetInlineEnd: 'space.0',
71
72
  transition: "color 150ms",
72
- '&:hover': {
73
- color: "var(--ds-text-subtle, ".concat(_colors.N500, ")")
73
+ ':hover': {
74
+ color: 'color.text.subtle'
74
75
  }
75
76
  });
76
- var iconSpacingWithClearButtonStyles = (0, _react2.css)({
77
- marginInlineEnd: "var(--ds-space-400, 2rem)"
77
+ var iconSpacingWithClearButtonStyles = (0, _primitives.xcss)({
78
+ marginInlineEnd: 'space.400'
78
79
  });
79
- var iconSpacingWithoutClearButtonStylesNew = (0, _react2.css)({
80
- marginInlineEnd: "var(--ds-space-050, 0.25rem)"
80
+ var iconSpacingWithoutClearButtonStylesNew = (0, _primitives.xcss)({
81
+ marginInlineEnd: 'space.050'
81
82
  });
82
- var iconSpacingWithoutClearButtonStyles = (0, _react2.css)({
83
- marginInlineEnd: "var(--ds-space-025, 0.125rem)"
83
+ var iconSpacingWithoutClearButtonStyles = (0, _primitives.xcss)({
84
+ marginInlineEnd: 'space.025'
84
85
  });
85
86
  var calendarButtonFixedSizeStyles = (0, _primitives.xcss)({
86
87
  width: "".concat(32 / 14, "em"),
@@ -478,7 +479,7 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, forwardedR
478
479
  var showClearIndicator = Boolean((getterValue || selectInputValue) && !hideIcon);
479
480
  var clearIndicator = Icon;
480
481
 
481
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
482
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
482
483
  if ((0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && (0, _platformFeatureFlags.fg)('platform-visual-refresh-icon-ads-migration')) {
483
484
  clearIndicator = function clearIndicator(props) {
484
485
  return (0, _react2.jsx)(_primitives.Box, {
@@ -553,17 +554,19 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, forwardedR
553
554
  var openCalendarLabelId = "open-calendar-label--".concat((0, _useId.useId)());
554
555
  return (
555
556
  // These event handlers must be on this element because the events come
556
- // from different child elements.
557
+ // from different child elements. Cannot use Box primtive until we remove ...innerProps
557
558
  (0, _react2.jsx)("div", (0, _extends2.default)({}, innerProps, {
558
559
  css: pickerContainerStyles,
559
- role: "presentation",
560
+ "data-testid": testId && "".concat(testId, "--container"),
560
561
  onBlur: onContainerBlur,
561
562
  onFocus: onContainerFocus,
562
563
  onClick: onInputClick,
563
564
  onInput: onTextInput,
564
565
  onKeyDown: onInputKeyDown,
565
- ref: getContainerRef,
566
- "data-testid": testId && "".concat(testId, "--container")
566
+ ref: getContainerRef
567
+ // loophole role="presentation" as it solves the onclick, onfocus, etc. typecheck errors
568
+ ,
569
+ role: "presentation"
567
570
  }), (0, _react2.jsx)("input", {
568
571
  name: name,
569
572
  type: "hidden",
@@ -597,7 +600,9 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, forwardedR
597
600
  placeholder: (0, _datePickerMigration.getPlaceholder)({
598
601
  placeholder: placeholder,
599
602
  l10n: l10n
600
- }),
603
+ })
604
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
605
+ ,
601
606
  styles: mergedStyles,
602
607
  value: initialValue
603
608
  }, selectProps, {
@@ -625,8 +630,10 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, forwardedR
625
630
  onCalendarSelect: calendarProps.onCalendarSelect,
626
631
  previousMonthLabel: previousMonthLabel,
627
632
  shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay
628
- })), shouldShowCalendarButton && !isDisabled ? (0, _react2.jsx)("div", {
629
- css: [iconContainerStyles, value && !hideIcon ? iconSpacingWithClearButtonStyles : (0, _platformFeatureFlags.fg)('platform-visual-refresh-icon-ads-migration') ? iconSpacingWithoutClearButtonStylesNew : iconSpacingWithoutClearButtonStyles]
633
+ })), shouldShowCalendarButton && !isDisabled ? (0, _react2.jsx)(_primitives.Box, {
634
+ xcss: [iconContainerStyles, value && !hideIcon ? iconSpacingWithClearButtonStyles :
635
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
636
+ (0, _platformFeatureFlags.fg)('platform-visual-refresh-icon-ads-migration') ? iconSpacingWithoutClearButtonStylesNew : iconSpacingWithoutClearButtonStyles]
630
637
  }, inputLabelId && (0, _react2.jsx)(_visuallyHidden.default, {
631
638
  id: openCalendarLabelId
632
639
  }, ", ", openCalendarLabel), (0, _react2.jsx)(_primitives.Pressable, (0, _extends2.default)({}, inputLabelId ? {
@@ -38,7 +38,7 @@ var DatePicker = (0, _ffComponent.componentWithCondition)(function () {
38
38
  return (0, _platformFeatureFlags.fg)('dst-date-picker-use-functional-component');
39
39
  }, _datePickerFc.default, _datePickerClass.default);
40
40
  var packageName = "@atlaskit/datetime-picker";
41
- var packageVersion = "15.7.1";
41
+ var packageVersion = "15.9.0";
42
42
  // Make DatePicker 50% the width of DateTimePicker
43
43
  // If rendering an icon container, shrink the TimePicker
44
44
  var datePickerContainerStyles = (0, _react2.css)({
@@ -6,17 +6,18 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.timePickerDefaultAriaLabel = exports.default = exports.datePickerDefaultAriaLabel = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
13
  var _react = _interopRequireWildcard(require("react"));
13
- var _react2 = require("@emotion/react");
14
14
  var _dateFns = require("date-fns");
15
15
  var _analyticsNext = require("@atlaskit/analytics-next");
16
+ var _new = require("@atlaskit/button/new");
16
17
  var _crossCircleSelectClear = _interopRequireDefault(require("@atlaskit/icon/utility/migration/cross-circle--select-clear"));
17
18
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
+ var _primitives = require("@atlaskit/primitives");
18
20
  var _select = require("@atlaskit/select");
19
- var _colors = require("@atlaskit/theme/colors");
20
21
  var _internal = require("../internal");
21
22
  var _dateTimePickerContainer = require("../internal/date-time-picker-container");
22
23
  var _ffComponent = require("../internal/ff-component");
@@ -29,15 +30,14 @@ var _excluded = ["selectProps"],
29
30
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
30
31
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
31
32
  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; }
32
- 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; } /**
33
- * @jsxRuntime classic
34
- * @jsx jsx
35
- */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
36
- var DatePicker = (0, _ffComponent.componentWithCondition)(function () {
33
+ 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; }
34
+ var DatePicker = (0, _ffComponent.componentWithCondition)(
35
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
36
+ function () {
37
37
  return (0, _platformFeatureFlags.fg)('dst-date-picker-use-functional-component');
38
38
  }, _datePickerFc.default, _datePickerClass.default);
39
39
  var packageName = "@atlaskit/datetime-picker";
40
- var packageVersion = "15.7.1";
40
+ var packageVersion = "15.9.0";
41
41
  var analyticsAttributes = {
42
42
  componentName: 'dateTimePicker',
43
43
  packageName: packageName,
@@ -46,31 +46,19 @@ var analyticsAttributes = {
46
46
 
47
47
  // Make DatePicker 50% the width of DateTimePicker
48
48
  // If rendering an icon container, shrink the TimePicker
49
- var datePickerContainerStyles = (0, _react2.css)({
49
+ var datePickerContainerStyles = (0, _primitives.xcss)({
50
50
  flexBasis: '50%',
51
51
  flexGrow: 1,
52
52
  flexShrink: 0
53
53
  });
54
- var timePickerContainerStyles = (0, _react2.css)({
54
+ var timePickerContainerStyles = (0, _primitives.xcss)({
55
55
  flexBasis: '50%',
56
56
  flexGrow: 1
57
57
  });
58
- var iconContainerStyles = (0, _react2.css)({
58
+ var iconContainerStyles = (0, _primitives.xcss)({
59
59
  display: 'flex',
60
- margin: "var(--ds-border-width, 1px)",
61
60
  alignItems: 'center',
62
- flexBasis: 'inherit',
63
- backgroundColor: 'inherit',
64
- border: 'none',
65
- color: "var(--ds-text-subtlest, ".concat(_colors.N70, ")"),
66
- paddingBlockEnd: "var(--ds-space-075, 6px)",
67
- paddingBlockStart: "var(--ds-space-075, 6px)",
68
- paddingInlineEnd: "var(--ds-space-100, 8px)",
69
- paddingInlineStart: "var(--ds-space-050, 4px)",
70
- transition: "color 150ms",
71
- '&:hover': {
72
- color: "var(--ds-text-subtle, ".concat(_colors.N500, ")")
73
- }
61
+ flexBasis: 'inherit'
74
62
  });
75
63
 
76
64
  // react-select overrides (via @atlaskit/select).
@@ -303,21 +291,21 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
303
291
  // Render DateTimePicker's IconContainer when a value has been filled
304
292
  // Don't use Date or TimePicker's because they can't be customised
305
293
  var isClearable = Boolean(dateValue || timeValue);
306
- return (0, _react2.jsx)(_dateTimePickerContainer.DateTimePickerContainer, {
294
+ return /*#__PURE__*/_react.default.createElement(_dateTimePickerContainer.DateTimePickerContainer, {
307
295
  appearance: appearance,
308
296
  isDisabled: isDisabled,
309
297
  isFocused: isFocused,
310
298
  isInvalid: isInvalid,
311
299
  testId: testId,
312
300
  innerProps: innerProps
313
- }, (0, _react2.jsx)("input", {
301
+ }, /*#__PURE__*/_react.default.createElement("input", {
314
302
  name: name,
315
303
  type: "hidden",
316
304
  value: value,
317
305
  "data-testid": testId && "".concat(testId, "--input")
318
- }), (0, _react2.jsx)("div", {
319
- css: datePickerContainerStyles
320
- }, (0, _react2.jsx)(DatePicker, {
306
+ }), /*#__PURE__*/_react.default.createElement(_primitives.Box, {
307
+ xcss: datePickerContainerStyles
308
+ }, /*#__PURE__*/_react.default.createElement(DatePicker, {
321
309
  appearance: appearance,
322
310
  "aria-describedby": datePickerAriaDescribedBy,
323
311
  autoFocus: datePickerProps.autoFocus || autoFocus,
@@ -352,9 +340,9 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
352
340
  testId: testId && "".concat(testId, "--datepicker") || datePickerProps.testId,
353
341
  value: dateValue,
354
342
  weekStartDay: datePickerProps.weekStartDay
355
- })), (0, _react2.jsx)("div", {
356
- css: timePickerContainerStyles
357
- }, (0, _react2.jsx)(_timePicker.default, {
343
+ })), /*#__PURE__*/_react.default.createElement(_primitives.Box, {
344
+ xcss: timePickerContainerStyles
345
+ }, /*#__PURE__*/_react.default.createElement(_timePicker.default, {
358
346
  appearance: timePickerProps.appearance || appearance,
359
347
  "aria-describedby": timePickerAriaDescribedBy,
360
348
  autoFocus: timePickerProps.autoFocus,
@@ -383,16 +371,20 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
383
371
  timeIsEditable: timePickerProps.timeIsEditable,
384
372
  times: timePickerProps.times,
385
373
  value: timeValue
386
- })), isClearable && !isDisabled ? (0, _react2.jsx)("button", {
387
- css: iconContainerStyles,
374
+ })), isClearable && !isDisabled ? /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
375
+ xcss: iconContainerStyles
376
+ }, /*#__PURE__*/_react.default.createElement(_new.IconButton, {
377
+ appearance: "subtle",
378
+ label: clearControlLabel,
379
+ icon: function icon(iconProps) {
380
+ return /*#__PURE__*/_react.default.createElement(_crossCircleSelectClear.default, (0, _extends2.default)({}, iconProps, {
381
+ color: "var(--ds-text-subtlest, #626F86)",
382
+ LEGACY_size: "small"
383
+ }));
384
+ },
388
385
  onClick: onClear,
389
- "data-testid": testId && "".concat(testId, "--icon--container"),
390
- tabIndex: -1,
391
- type: "button"
392
- }, (0, _react2.jsx)(_crossCircleSelectClear.default, {
393
- LEGACY_size: "small",
394
- color: "currentColor",
395
- label: clearControlLabel
396
- }), ' ') : null);
386
+ testId: testId && "".concat(testId, "--icon--container"),
387
+ tabIndex: -1
388
+ })) : null);
397
389
  });
398
390
  var _default = exports.default = DateTimePicker;
@@ -27,7 +27,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
27
27
  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; }
28
28
  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; }
29
29
  var packageName = "@atlaskit/datetime-picker";
30
- var packageVersion = "15.7.1";
30
+ var packageVersion = "15.9.0";
31
31
  var menuStyles = {
32
32
  /* Need to remove default absolute positioning as that causes issues with position fixed */
33
33
  position: 'static',
@@ -83,6 +83,8 @@ var DateTimePickerContainer = exports.DateTimePickerContainer = /*#__PURE__*/(0,
83
83
  innerProps = _ref.innerProps,
84
84
  testId = _ref.testId;
85
85
  var notFocusedOrIsDisabled = !(isFocused || isDisabled);
86
+
87
+ // we cannot use Box or Flex primitives because these do not allow ...innerProps to be passed
86
88
  return (0, _react2.jsx)("div", (0, _extends2.default)({
87
89
  css: [baseContainerStyles, newBorderStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (isInvalid ? isInvalidHoverStyles : hoverStyles), appearance === 'none' && noBgStyles]
88
90
  }, innerProps, {
@@ -26,7 +26,7 @@ import { Menu } from '../internal/menu';
26
26
  import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
27
27
  import { makeSingleValue } from '../internal/single-value';
28
28
  const packageName = "@atlaskit/datetime-picker";
29
- const packageVersion = "15.7.1";
29
+ const packageVersion = "15.9.0";
30
30
  const dropdownIndicatorStyles = xcss({
31
31
  minWidth: "var(--ds-space-300, 24px)",
32
32
  minHeight: "var(--ds-space-300, 24px)",
@@ -16,7 +16,6 @@ import { createLocalizationProvider } from '@atlaskit/locale';
16
16
  import { fg } from '@atlaskit/platform-feature-flags';
17
17
  import { Box, Pressable, xcss } from '@atlaskit/primitives';
18
18
  import Select, { mergeStyles } from '@atlaskit/select';
19
- import { N500, N70 } from '@atlaskit/theme/colors';
20
19
  import VisuallyHidden from '@atlaskit/visually-hidden';
21
20
  import { EmptyComponent } from '../internal';
22
21
  import { formatDate, getParsedISO, getPlaceholder, isDateDisabled, parseDate } from '../internal/date-picker-migration';
@@ -25,7 +24,7 @@ import { Menu } from '../internal/menu';
25
24
  import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
26
25
  import { makeSingleValue } from '../internal/single-value';
27
26
  const packageName = "@atlaskit/datetime-picker";
28
- const packageVersion = "15.7.1";
27
+ const packageVersion = "15.9.0";
29
28
  const analyticsAttributes = {
30
29
  componentName: 'datePicker',
31
30
  packageName,
@@ -41,31 +40,33 @@ const dropdownIndicatorStyles = xcss({
41
40
  alignItems: 'center',
42
41
  justifyContent: 'center'
43
42
  });
43
+
44
+ // eslint-disable-next-line @atlaskit/platform/no-module-level-eval, @atlaskit/platform/ensure-feature-flag-prefix
44
45
  const CalendarIcon = fg('platform-visual-refresh-icon-ads-migration') ? CalendarIconNew :
45
46
  // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons
46
47
  CalendarIconOld;
47
- const iconContainerStyles = css({
48
+ const iconContainerStyles = xcss({
48
49
  display: 'flex',
49
50
  height: '100%',
50
51
  position: 'absolute',
51
52
  alignItems: 'center',
52
53
  flexBasis: 'inherit',
53
- color: `var(--ds-text-subtlest, ${N70})`,
54
- insetBlockStart: 0,
55
- insetInlineEnd: 0,
54
+ color: 'color.text.subtlest',
55
+ insetBlockStart: 'space.0',
56
+ insetInlineEnd: 'space.0',
56
57
  transition: `color 150ms`,
57
- '&:hover': {
58
- color: `var(--ds-text-subtle, ${N500})`
58
+ ':hover': {
59
+ color: 'color.text.subtle'
59
60
  }
60
61
  });
61
- const iconSpacingWithClearButtonStyles = css({
62
- marginInlineEnd: "var(--ds-space-400, 2rem)"
62
+ const iconSpacingWithClearButtonStyles = xcss({
63
+ marginInlineEnd: 'space.400'
63
64
  });
64
- const iconSpacingWithoutClearButtonStylesNew = css({
65
- marginInlineEnd: "var(--ds-space-050, 0.25rem)"
65
+ const iconSpacingWithoutClearButtonStylesNew = xcss({
66
+ marginInlineEnd: 'space.050'
66
67
  });
67
- const iconSpacingWithoutClearButtonStyles = css({
68
- marginInlineEnd: "var(--ds-space-025, 0.125rem)"
68
+ const iconSpacingWithoutClearButtonStyles = xcss({
69
+ marginInlineEnd: 'space.025'
69
70
  });
70
71
  const calendarButtonFixedSizeStyles = xcss({
71
72
  width: `${32 / 14}em`,
@@ -404,7 +405,7 @@ const DatePicker = /*#__PURE__*/forwardRef((props, forwardedRef) => {
404
405
  const showClearIndicator = Boolean((getterValue || selectInputValue) && !hideIcon);
405
406
  let clearIndicator = Icon;
406
407
 
407
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
408
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
408
409
  if (fg('platform-visual-refresh-icons') && fg('platform-visual-refresh-icon-ads-migration')) {
409
410
  clearIndicator = props => jsx(Box, {
410
411
  xcss: dropdownIndicatorStyles
@@ -479,17 +480,19 @@ const DatePicker = /*#__PURE__*/forwardRef((props, forwardedRef) => {
479
480
  const openCalendarLabelId = `open-calendar-label--${useId()}`;
480
481
  return (
481
482
  // These event handlers must be on this element because the events come
482
- // from different child elements.
483
+ // from different child elements. Cannot use Box primtive until we remove ...innerProps
483
484
  jsx("div", _extends({}, innerProps, {
484
485
  css: pickerContainerStyles,
485
- role: "presentation",
486
+ "data-testid": testId && `${testId}--container`,
486
487
  onBlur: onContainerBlur,
487
488
  onFocus: onContainerFocus,
488
489
  onClick: onInputClick,
489
490
  onInput: onTextInput,
490
491
  onKeyDown: onInputKeyDown,
491
- ref: getContainerRef,
492
- "data-testid": testId && `${testId}--container`
492
+ ref: getContainerRef
493
+ // loophole role="presentation" as it solves the onclick, onfocus, etc. typecheck errors
494
+ ,
495
+ role: "presentation"
493
496
  }), jsx("input", {
494
497
  name: name,
495
498
  type: "hidden",
@@ -523,7 +526,9 @@ const DatePicker = /*#__PURE__*/forwardRef((props, forwardedRef) => {
523
526
  placeholder: getPlaceholder({
524
527
  placeholder: placeholder,
525
528
  l10n: l10n
526
- }),
529
+ })
530
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
531
+ ,
527
532
  styles: mergedStyles,
528
533
  value: initialValue
529
534
  }, selectProps, {
@@ -551,8 +556,10 @@ const DatePicker = /*#__PURE__*/forwardRef((props, forwardedRef) => {
551
556
  onCalendarSelect: calendarProps.onCalendarSelect,
552
557
  previousMonthLabel: previousMonthLabel,
553
558
  shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay
554
- })), shouldShowCalendarButton && !isDisabled ? jsx("div", {
555
- css: [iconContainerStyles, value && !hideIcon ? iconSpacingWithClearButtonStyles : fg('platform-visual-refresh-icon-ads-migration') ? iconSpacingWithoutClearButtonStylesNew : iconSpacingWithoutClearButtonStyles]
559
+ })), shouldShowCalendarButton && !isDisabled ? jsx(Box, {
560
+ xcss: [iconContainerStyles, value && !hideIcon ? iconSpacingWithClearButtonStyles :
561
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
562
+ fg('platform-visual-refresh-icon-ads-migration') ? iconSpacingWithoutClearButtonStylesNew : iconSpacingWithoutClearButtonStyles]
556
563
  }, inputLabelId && jsx(VisuallyHidden, {
557
564
  id: openCalendarLabelId
558
565
  }, ", ", openCalendarLabel), jsx(Pressable, _extends({}, inputLabelId ? {
@@ -22,7 +22,7 @@ import DatePickerNew from './date-picker-fc';
22
22
  import TimePicker from './time-picker';
23
23
  const DatePicker = componentWithCondition(() => fg('dst-date-picker-use-functional-component'), DatePickerNew, DatePickerOld);
24
24
  const packageName = "@atlaskit/datetime-picker";
25
- const packageVersion = "15.7.1";
25
+ const packageVersion = "15.9.0";
26
26
  // Make DatePicker 50% the width of DateTimePicker
27
27
  // If rendering an icon container, shrink the TimePicker
28
28
  const datePickerContainerStyles = css({
@@ -1,17 +1,12 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
1
+ import _extends from "@babel/runtime/helpers/extends";
5
2
  import React, { forwardRef, useCallback, useEffect, useState } from 'react';
6
-
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { css, jsx } from '@emotion/react';
9
3
  import { format, isValid, parseISO } from 'date-fns';
10
4
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
5
+ import { IconButton } from '@atlaskit/button/new';
11
6
  import SelectClearIcon from '@atlaskit/icon/utility/migration/cross-circle--select-clear';
12
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
+ import { Box, Inline, xcss } from '@atlaskit/primitives';
13
9
  import { mergeStyles } from '@atlaskit/select';
14
- import { N500, N70 } from '@atlaskit/theme/colors';
15
10
  import { formatDateTimeZoneIntoIso } from '../internal';
16
11
  import { DateTimePickerContainer } from '../internal/date-time-picker-container';
17
12
  import { componentWithCondition } from '../internal/ff-component';
@@ -19,9 +14,11 @@ import { convertTokens } from '../internal/parse-tokens';
19
14
  import DatePickerOld from './date-picker-class';
20
15
  import DatePickerNew from './date-picker-fc';
21
16
  import TimePicker from './time-picker';
22
- const DatePicker = componentWithCondition(() => fg('dst-date-picker-use-functional-component'), DatePickerNew, DatePickerOld);
17
+ const DatePicker = componentWithCondition(
18
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
19
+ () => fg('dst-date-picker-use-functional-component'), DatePickerNew, DatePickerOld);
23
20
  const packageName = "@atlaskit/datetime-picker";
24
- const packageVersion = "15.7.1";
21
+ const packageVersion = "15.9.0";
25
22
  const analyticsAttributes = {
26
23
  componentName: 'dateTimePicker',
27
24
  packageName,
@@ -30,31 +27,19 @@ const analyticsAttributes = {
30
27
 
31
28
  // Make DatePicker 50% the width of DateTimePicker
32
29
  // If rendering an icon container, shrink the TimePicker
33
- const datePickerContainerStyles = css({
30
+ const datePickerContainerStyles = xcss({
34
31
  flexBasis: '50%',
35
32
  flexGrow: 1,
36
33
  flexShrink: 0
37
34
  });
38
- const timePickerContainerStyles = css({
35
+ const timePickerContainerStyles = xcss({
39
36
  flexBasis: '50%',
40
37
  flexGrow: 1
41
38
  });
42
- const iconContainerStyles = css({
39
+ const iconContainerStyles = xcss({
43
40
  display: 'flex',
44
- margin: "var(--ds-border-width, 1px)",
45
41
  alignItems: 'center',
46
- flexBasis: 'inherit',
47
- backgroundColor: 'inherit',
48
- border: 'none',
49
- color: `var(--ds-text-subtlest, ${N70})`,
50
- paddingBlockEnd: "var(--ds-space-075, 6px)",
51
- paddingBlockStart: "var(--ds-space-075, 6px)",
52
- paddingInlineEnd: "var(--ds-space-100, 8px)",
53
- paddingInlineStart: "var(--ds-space-050, 4px)",
54
- transition: `color 150ms`,
55
- '&:hover': {
56
- color: `var(--ds-text-subtle, ${N500})`
57
- }
42
+ flexBasis: 'inherit'
58
43
  });
59
44
 
60
45
  // react-select overrides (via @atlaskit/select).
@@ -268,21 +253,21 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
268
253
  // Render DateTimePicker's IconContainer when a value has been filled
269
254
  // Don't use Date or TimePicker's because they can't be customised
270
255
  const isClearable = Boolean(dateValue || timeValue);
271
- return jsx(DateTimePickerContainer, {
256
+ return /*#__PURE__*/React.createElement(DateTimePickerContainer, {
272
257
  appearance: appearance,
273
258
  isDisabled: isDisabled,
274
259
  isFocused: isFocused,
275
260
  isInvalid: isInvalid,
276
261
  testId: testId,
277
262
  innerProps: innerProps
278
- }, jsx("input", {
263
+ }, /*#__PURE__*/React.createElement("input", {
279
264
  name: name,
280
265
  type: "hidden",
281
266
  value: value,
282
267
  "data-testid": testId && `${testId}--input`
283
- }), jsx("div", {
284
- css: datePickerContainerStyles
285
- }, jsx(DatePicker, {
268
+ }), /*#__PURE__*/React.createElement(Box, {
269
+ xcss: datePickerContainerStyles
270
+ }, /*#__PURE__*/React.createElement(DatePicker, {
286
271
  appearance: appearance,
287
272
  "aria-describedby": datePickerAriaDescribedBy,
288
273
  autoFocus: datePickerProps.autoFocus || autoFocus,
@@ -317,9 +302,9 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
317
302
  testId: testId && `${testId}--datepicker` || datePickerProps.testId,
318
303
  value: dateValue,
319
304
  weekStartDay: datePickerProps.weekStartDay
320
- })), jsx("div", {
321
- css: timePickerContainerStyles
322
- }, jsx(TimePicker, {
305
+ })), /*#__PURE__*/React.createElement(Box, {
306
+ xcss: timePickerContainerStyles
307
+ }, /*#__PURE__*/React.createElement(TimePicker, {
323
308
  appearance: timePickerProps.appearance || appearance,
324
309
  "aria-describedby": timePickerAriaDescribedBy,
325
310
  autoFocus: timePickerProps.autoFocus,
@@ -348,16 +333,18 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
348
333
  timeIsEditable: timePickerProps.timeIsEditable,
349
334
  times: timePickerProps.times,
350
335
  value: timeValue
351
- })), isClearable && !isDisabled ? jsx("button", {
352
- css: iconContainerStyles,
336
+ })), isClearable && !isDisabled ? /*#__PURE__*/React.createElement(Inline, {
337
+ xcss: iconContainerStyles
338
+ }, /*#__PURE__*/React.createElement(IconButton, {
339
+ appearance: "subtle",
340
+ label: clearControlLabel,
341
+ icon: iconProps => /*#__PURE__*/React.createElement(SelectClearIcon, _extends({}, iconProps, {
342
+ color: "var(--ds-text-subtlest, #626F86)",
343
+ LEGACY_size: "small"
344
+ })),
353
345
  onClick: onClear,
354
- "data-testid": testId && `${testId}--icon--container`,
355
- tabIndex: -1,
356
- type: "button"
357
- }, jsx(SelectClearIcon, {
358
- LEGACY_size: "small",
359
- color: "currentColor",
360
- label: clearControlLabel
361
- }), ' ') : null);
346
+ testId: testId && `${testId}--icon--container`,
347
+ tabIndex: -1
348
+ })) : null);
362
349
  });
363
350
  export default DateTimePicker;
@@ -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 = "15.7.1";
14
+ const packageVersion = "15.9.0";
15
15
  const menuStyles = {
16
16
  /* Need to remove default absolute positioning as that causes issues with position fixed */
17
17
  position: 'static',
@@ -76,6 +76,8 @@ export const DateTimePickerContainer = /*#__PURE__*/forwardRef(({
76
76
  testId
77
77
  }, ref) => {
78
78
  const notFocusedOrIsDisabled = !(isFocused || isDisabled);
79
+
80
+ // we cannot use Box or Flex primitives because these do not allow ...innerProps to be passed
79
81
  return jsx("div", _extends({
80
82
  css: [baseContainerStyles, newBorderStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (isInvalid ? isInvalidHoverStyles : hoverStyles), appearance === 'none' && noBgStyles]
81
83
  }, innerProps, {
@@ -36,7 +36,7 @@ import { Menu } from '../internal/menu';
36
36
  import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
37
37
  import { makeSingleValue } from '../internal/single-value';
38
38
  var packageName = "@atlaskit/datetime-picker";
39
- var packageVersion = "15.7.1";
39
+ var packageVersion = "15.9.0";
40
40
  var dropdownIndicatorStyles = xcss({
41
41
  minWidth: "var(--ds-space-300, 24px)",
42
42
  minHeight: "var(--ds-space-300, 24px)",
@@ -22,7 +22,6 @@ import { createLocalizationProvider } from '@atlaskit/locale';
22
22
  import { fg } from '@atlaskit/platform-feature-flags';
23
23
  import { Box, Pressable, xcss } from '@atlaskit/primitives';
24
24
  import Select, { mergeStyles } from '@atlaskit/select';
25
- import { N500, N70 } from '@atlaskit/theme/colors';
26
25
  import VisuallyHidden from '@atlaskit/visually-hidden';
27
26
  import { EmptyComponent } from '../internal';
28
27
  import { formatDate, getParsedISO, getPlaceholder, isDateDisabled, parseDate } from '../internal/date-picker-migration';
@@ -31,7 +30,7 @@ import { Menu } from '../internal/menu';
31
30
  import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
32
31
  import { makeSingleValue } from '../internal/single-value';
33
32
  var packageName = "@atlaskit/datetime-picker";
34
- var packageVersion = "15.7.1";
33
+ var packageVersion = "15.9.0";
35
34
  var analyticsAttributes = {
36
35
  componentName: 'datePicker',
37
36
  packageName: packageName,
@@ -47,31 +46,33 @@ var dropdownIndicatorStyles = xcss({
47
46
  alignItems: 'center',
48
47
  justifyContent: 'center'
49
48
  });
49
+
50
+ // eslint-disable-next-line @atlaskit/platform/no-module-level-eval, @atlaskit/platform/ensure-feature-flag-prefix
50
51
  var CalendarIcon = fg('platform-visual-refresh-icon-ads-migration') ? CalendarIconNew :
51
52
  // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons
52
53
  CalendarIconOld;
53
- var iconContainerStyles = css({
54
+ var iconContainerStyles = xcss({
54
55
  display: 'flex',
55
56
  height: '100%',
56
57
  position: 'absolute',
57
58
  alignItems: 'center',
58
59
  flexBasis: 'inherit',
59
- color: "var(--ds-text-subtlest, ".concat(N70, ")"),
60
- insetBlockStart: 0,
61
- insetInlineEnd: 0,
60
+ color: 'color.text.subtlest',
61
+ insetBlockStart: 'space.0',
62
+ insetInlineEnd: 'space.0',
62
63
  transition: "color 150ms",
63
- '&:hover': {
64
- color: "var(--ds-text-subtle, ".concat(N500, ")")
64
+ ':hover': {
65
+ color: 'color.text.subtle'
65
66
  }
66
67
  });
67
- var iconSpacingWithClearButtonStyles = css({
68
- marginInlineEnd: "var(--ds-space-400, 2rem)"
68
+ var iconSpacingWithClearButtonStyles = xcss({
69
+ marginInlineEnd: 'space.400'
69
70
  });
70
- var iconSpacingWithoutClearButtonStylesNew = css({
71
- marginInlineEnd: "var(--ds-space-050, 0.25rem)"
71
+ var iconSpacingWithoutClearButtonStylesNew = xcss({
72
+ marginInlineEnd: 'space.050'
72
73
  });
73
- var iconSpacingWithoutClearButtonStyles = css({
74
- marginInlineEnd: "var(--ds-space-025, 0.125rem)"
74
+ var iconSpacingWithoutClearButtonStyles = xcss({
75
+ marginInlineEnd: 'space.025'
75
76
  });
76
77
  var calendarButtonFixedSizeStyles = xcss({
77
78
  width: "".concat(32 / 14, "em"),
@@ -469,7 +470,7 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
469
470
  var showClearIndicator = Boolean((getterValue || selectInputValue) && !hideIcon);
470
471
  var clearIndicator = Icon;
471
472
 
472
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
473
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
473
474
  if (fg('platform-visual-refresh-icons') && fg('platform-visual-refresh-icon-ads-migration')) {
474
475
  clearIndicator = function clearIndicator(props) {
475
476
  return jsx(Box, {
@@ -544,17 +545,19 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
544
545
  var openCalendarLabelId = "open-calendar-label--".concat(useId());
545
546
  return (
546
547
  // These event handlers must be on this element because the events come
547
- // from different child elements.
548
+ // from different child elements. Cannot use Box primtive until we remove ...innerProps
548
549
  jsx("div", _extends({}, innerProps, {
549
550
  css: pickerContainerStyles,
550
- role: "presentation",
551
+ "data-testid": testId && "".concat(testId, "--container"),
551
552
  onBlur: onContainerBlur,
552
553
  onFocus: onContainerFocus,
553
554
  onClick: onInputClick,
554
555
  onInput: onTextInput,
555
556
  onKeyDown: onInputKeyDown,
556
- ref: getContainerRef,
557
- "data-testid": testId && "".concat(testId, "--container")
557
+ ref: getContainerRef
558
+ // loophole role="presentation" as it solves the onclick, onfocus, etc. typecheck errors
559
+ ,
560
+ role: "presentation"
558
561
  }), jsx("input", {
559
562
  name: name,
560
563
  type: "hidden",
@@ -588,7 +591,9 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
588
591
  placeholder: getPlaceholder({
589
592
  placeholder: placeholder,
590
593
  l10n: l10n
591
- }),
594
+ })
595
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
596
+ ,
592
597
  styles: mergedStyles,
593
598
  value: initialValue
594
599
  }, selectProps, {
@@ -616,8 +621,10 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
616
621
  onCalendarSelect: calendarProps.onCalendarSelect,
617
622
  previousMonthLabel: previousMonthLabel,
618
623
  shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay
619
- })), shouldShowCalendarButton && !isDisabled ? jsx("div", {
620
- css: [iconContainerStyles, value && !hideIcon ? iconSpacingWithClearButtonStyles : fg('platform-visual-refresh-icon-ads-migration') ? iconSpacingWithoutClearButtonStylesNew : iconSpacingWithoutClearButtonStyles]
624
+ })), shouldShowCalendarButton && !isDisabled ? jsx(Box, {
625
+ xcss: [iconContainerStyles, value && !hideIcon ? iconSpacingWithClearButtonStyles :
626
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
627
+ fg('platform-visual-refresh-icon-ads-migration') ? iconSpacingWithoutClearButtonStylesNew : iconSpacingWithoutClearButtonStyles]
621
628
  }, inputLabelId && jsx(VisuallyHidden, {
622
629
  id: openCalendarLabelId
623
630
  }, ", ", openCalendarLabel), jsx(Pressable, _extends({}, inputLabelId ? {
@@ -34,7 +34,7 @@ var DatePicker = componentWithCondition(function () {
34
34
  return fg('dst-date-picker-use-functional-component');
35
35
  }, DatePickerNew, DatePickerOld);
36
36
  var packageName = "@atlaskit/datetime-picker";
37
- var packageVersion = "15.7.1";
37
+ var packageVersion = "15.9.0";
38
38
  // Make DatePicker 50% the width of DateTimePicker
39
39
  // If rendering an icon container, shrink the TimePicker
40
40
  var datePickerContainerStyles = css({
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
4
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
@@ -5,20 +6,14 @@ var _excluded = ["selectProps"],
5
6
  _excluded2 = ["selectProps"];
6
7
  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; }
7
8
  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; }
8
- /**
9
- * @jsxRuntime classic
10
- * @jsx jsx
11
- */
12
9
  import React, { forwardRef, useCallback, useEffect, useState } from 'react';
13
-
14
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
15
- import { css, jsx } from '@emotion/react';
16
10
  import { format, isValid, parseISO } from 'date-fns';
17
11
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
12
+ import { IconButton } from '@atlaskit/button/new';
18
13
  import SelectClearIcon from '@atlaskit/icon/utility/migration/cross-circle--select-clear';
19
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
+ import { Box, Inline, xcss } from '@atlaskit/primitives';
20
16
  import { mergeStyles } from '@atlaskit/select';
21
- import { N500, N70 } from '@atlaskit/theme/colors';
22
17
  import { formatDateTimeZoneIntoIso } from '../internal';
23
18
  import { DateTimePickerContainer } from '../internal/date-time-picker-container';
24
19
  import { componentWithCondition } from '../internal/ff-component';
@@ -26,11 +21,13 @@ import { convertTokens } from '../internal/parse-tokens';
26
21
  import DatePickerOld from './date-picker-class';
27
22
  import DatePickerNew from './date-picker-fc';
28
23
  import TimePicker from './time-picker';
29
- var DatePicker = componentWithCondition(function () {
24
+ var DatePicker = componentWithCondition(
25
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
26
+ function () {
30
27
  return fg('dst-date-picker-use-functional-component');
31
28
  }, DatePickerNew, DatePickerOld);
32
29
  var packageName = "@atlaskit/datetime-picker";
33
- var packageVersion = "15.7.1";
30
+ var packageVersion = "15.9.0";
34
31
  var analyticsAttributes = {
35
32
  componentName: 'dateTimePicker',
36
33
  packageName: packageName,
@@ -39,31 +36,19 @@ var analyticsAttributes = {
39
36
 
40
37
  // Make DatePicker 50% the width of DateTimePicker
41
38
  // If rendering an icon container, shrink the TimePicker
42
- var datePickerContainerStyles = css({
39
+ var datePickerContainerStyles = xcss({
43
40
  flexBasis: '50%',
44
41
  flexGrow: 1,
45
42
  flexShrink: 0
46
43
  });
47
- var timePickerContainerStyles = css({
44
+ var timePickerContainerStyles = xcss({
48
45
  flexBasis: '50%',
49
46
  flexGrow: 1
50
47
  });
51
- var iconContainerStyles = css({
48
+ var iconContainerStyles = xcss({
52
49
  display: 'flex',
53
- margin: "var(--ds-border-width, 1px)",
54
50
  alignItems: 'center',
55
- flexBasis: 'inherit',
56
- backgroundColor: 'inherit',
57
- border: 'none',
58
- color: "var(--ds-text-subtlest, ".concat(N70, ")"),
59
- paddingBlockEnd: "var(--ds-space-075, 6px)",
60
- paddingBlockStart: "var(--ds-space-075, 6px)",
61
- paddingInlineEnd: "var(--ds-space-100, 8px)",
62
- paddingInlineStart: "var(--ds-space-050, 4px)",
63
- transition: "color 150ms",
64
- '&:hover': {
65
- color: "var(--ds-text-subtle, ".concat(N500, ")")
66
- }
51
+ flexBasis: 'inherit'
67
52
  });
68
53
 
69
54
  // react-select overrides (via @atlaskit/select).
@@ -296,21 +281,21 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
296
281
  // Render DateTimePicker's IconContainer when a value has been filled
297
282
  // Don't use Date or TimePicker's because they can't be customised
298
283
  var isClearable = Boolean(dateValue || timeValue);
299
- return jsx(DateTimePickerContainer, {
284
+ return /*#__PURE__*/React.createElement(DateTimePickerContainer, {
300
285
  appearance: appearance,
301
286
  isDisabled: isDisabled,
302
287
  isFocused: isFocused,
303
288
  isInvalid: isInvalid,
304
289
  testId: testId,
305
290
  innerProps: innerProps
306
- }, jsx("input", {
291
+ }, /*#__PURE__*/React.createElement("input", {
307
292
  name: name,
308
293
  type: "hidden",
309
294
  value: value,
310
295
  "data-testid": testId && "".concat(testId, "--input")
311
- }), jsx("div", {
312
- css: datePickerContainerStyles
313
- }, jsx(DatePicker, {
296
+ }), /*#__PURE__*/React.createElement(Box, {
297
+ xcss: datePickerContainerStyles
298
+ }, /*#__PURE__*/React.createElement(DatePicker, {
314
299
  appearance: appearance,
315
300
  "aria-describedby": datePickerAriaDescribedBy,
316
301
  autoFocus: datePickerProps.autoFocus || autoFocus,
@@ -345,9 +330,9 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
345
330
  testId: testId && "".concat(testId, "--datepicker") || datePickerProps.testId,
346
331
  value: dateValue,
347
332
  weekStartDay: datePickerProps.weekStartDay
348
- })), jsx("div", {
349
- css: timePickerContainerStyles
350
- }, jsx(TimePicker, {
333
+ })), /*#__PURE__*/React.createElement(Box, {
334
+ xcss: timePickerContainerStyles
335
+ }, /*#__PURE__*/React.createElement(TimePicker, {
351
336
  appearance: timePickerProps.appearance || appearance,
352
337
  "aria-describedby": timePickerAriaDescribedBy,
353
338
  autoFocus: timePickerProps.autoFocus,
@@ -376,16 +361,20 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
376
361
  timeIsEditable: timePickerProps.timeIsEditable,
377
362
  times: timePickerProps.times,
378
363
  value: timeValue
379
- })), isClearable && !isDisabled ? jsx("button", {
380
- css: iconContainerStyles,
364
+ })), isClearable && !isDisabled ? /*#__PURE__*/React.createElement(Inline, {
365
+ xcss: iconContainerStyles
366
+ }, /*#__PURE__*/React.createElement(IconButton, {
367
+ appearance: "subtle",
368
+ label: clearControlLabel,
369
+ icon: function icon(iconProps) {
370
+ return /*#__PURE__*/React.createElement(SelectClearIcon, _extends({}, iconProps, {
371
+ color: "var(--ds-text-subtlest, #626F86)",
372
+ LEGACY_size: "small"
373
+ }));
374
+ },
381
375
  onClick: onClear,
382
- "data-testid": testId && "".concat(testId, "--icon--container"),
383
- tabIndex: -1,
384
- type: "button"
385
- }, jsx(SelectClearIcon, {
386
- LEGACY_size: "small",
387
- color: "currentColor",
388
- label: clearControlLabel
389
- }), ' ') : null);
376
+ testId: testId && "".concat(testId, "--icon--container"),
377
+ tabIndex: -1
378
+ })) : null);
390
379
  });
391
380
  export default DateTimePicker;
@@ -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 = "15.7.1";
20
+ var packageVersion = "15.9.0";
21
21
  var menuStyles = {
22
22
  /* Need to remove default absolute positioning as that causes issues with position fixed */
23
23
  position: 'static',
@@ -75,6 +75,8 @@ export var DateTimePickerContainer = /*#__PURE__*/forwardRef(function (_ref, ref
75
75
  innerProps = _ref.innerProps,
76
76
  testId = _ref.testId;
77
77
  var notFocusedOrIsDisabled = !(isFocused || isDisabled);
78
+
79
+ // we cannot use Box or Flex primitives because these do not allow ...innerProps to be passed
78
80
  return jsx("div", _extends({
79
81
  css: [baseContainerStyles, newBorderStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (isInvalid ? isInvalidHoverStyles : hoverStyles), appearance === 'none' && noBgStyles]
80
82
  }, innerProps, {
@@ -1,7 +1,3 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
1
  import React from 'react';
6
2
  import { type DateTimePickerBaseProps } from '../types';
7
3
  export declare const datePickerDefaultAriaLabel = "Date";
@@ -67,6 +67,7 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps, PickerSel
67
67
  /**
68
68
  * Set the `aria-label` for the clear button.
69
69
  * Add the word "Clear" at the beginning of the clearControlLabel.
70
+ * For instance, for a field to set an appointment, use "Clear appointment date and time".
70
71
  */
71
72
  clearControlLabel?: string;
72
73
  /**
@@ -277,6 +278,7 @@ export interface TimePickerBaseProps extends WithAnalyticsEventsProps, PickerSel
277
278
  /**
278
279
  * Set the `aria-label` for the clear button.
279
280
  * Add the word "Clear" at the beginning of the clearControlLabel.
281
+ * For instance, for a field to set an appointment, use "Clear appointment date and time".
280
282
  */
281
283
  clearControlLabel?: string;
282
284
  /**
@@ -409,6 +411,7 @@ export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
409
411
  /**
410
412
  * Set the `aria-label` for the clear button.
411
413
  * Add the word "Clear" at the beginning of the clearControlLabel.
414
+ * For instance, for a field to set an appointment, use "Clear appointment date and time".
412
415
  */
413
416
  clearControlLabel?: string;
414
417
  /**
@@ -1,7 +1,3 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
1
  import React from 'react';
6
2
  import { type DateTimePickerBaseProps } from '../types';
7
3
  export declare const datePickerDefaultAriaLabel = "Date";
@@ -67,6 +67,7 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps, PickerSel
67
67
  /**
68
68
  * Set the `aria-label` for the clear button.
69
69
  * Add the word "Clear" at the beginning of the clearControlLabel.
70
+ * For instance, for a field to set an appointment, use "Clear appointment date and time".
70
71
  */
71
72
  clearControlLabel?: string;
72
73
  /**
@@ -277,6 +278,7 @@ export interface TimePickerBaseProps extends WithAnalyticsEventsProps, PickerSel
277
278
  /**
278
279
  * Set the `aria-label` for the clear button.
279
280
  * Add the word "Clear" at the beginning of the clearControlLabel.
281
+ * For instance, for a field to set an appointment, use "Clear appointment date and time".
280
282
  */
281
283
  clearControlLabel?: string;
282
284
  /**
@@ -409,6 +411,7 @@ export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
409
411
  /**
410
412
  * Set the `aria-label` for the clear button.
411
413
  * Add the word "Clear" at the beginning of the clearControlLabel.
414
+ * For instance, for a field to set an appointment, use "Clear appointment date and time".
412
415
  */
413
416
  clearControlLabel?: string;
414
417
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "15.7.1",
3
+ "version": "15.9.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/"
@@ -36,6 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@atlaskit/analytics-next": "^10.1.0",
39
+ "@atlaskit/button": "^20.3.1",
39
40
  "@atlaskit/calendar": "^15.1.0",
40
41
  "@atlaskit/ds-lib": "^3.1.0",
41
42
  "@atlaskit/icon": "^22.24.0",
@@ -43,10 +44,10 @@
43
44
  "@atlaskit/locale": "^2.8.0",
44
45
  "@atlaskit/platform-feature-flags": "^0.3.0",
45
46
  "@atlaskit/popper": "^6.3.0",
46
- "@atlaskit/primitives": "^13.0.0",
47
- "@atlaskit/select": "^18.4.0",
47
+ "@atlaskit/primitives": "^13.1.0",
48
+ "@atlaskit/select": "^18.5.0",
48
49
  "@atlaskit/theme": "^14.0.0",
49
- "@atlaskit/tokens": "^2.0.0",
50
+ "@atlaskit/tokens": "^2.2.0",
50
51
  "@atlaskit/visually-hidden": "^1.5.0",
51
52
  "@babel/runtime": "^7.0.0",
52
53
  "@emotion/react": "^11.7.1",
@@ -59,7 +60,6 @@
59
60
  "@af/accessibility-testing": "*",
60
61
  "@af/integration-testing": "*",
61
62
  "@af/visual-regression": "*",
62
- "@atlaskit/button": "^20.3.0",
63
63
  "@atlaskit/codemod-utils": "4.2.4",
64
64
  "@atlaskit/docs": "*",
65
65
  "@atlaskit/form": "^10.5.0",