@atlaskit/datetime-picker 12.3.9 → 12.3.11

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,18 @@
1
1
  # @atlaskit/datetime-picker
2
2
 
3
+ ## 12.3.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b50c6475079`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b50c6475079) - Make clear button in datetime picker a button element that is out of the tab order. This mimics the native input element's clear behavior in Safari/Edge.
8
+ - [`c0fb88b3af6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c0fb88b3af6) - [ux] style(calendar): update icon color token from text.subtlest to color.icon
9
+
10
+ ## 12.3.10
11
+
12
+ ### Patch Changes
13
+
14
+ - [`1fc7949b336`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1fc7949b336) - [ux] Fixes a bug where the background for the calendar element was incorrectly set to 'elevation.surface'
15
+
3
16
  ## 12.3.9
4
17
 
5
18
  ### Patch Changes
@@ -36,7 +36,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
36
36
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
37
37
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
38
38
  var packageName = "@atlaskit/datetime-picker";
39
- var packageVersion = "12.3.9";
39
+ var packageVersion = "12.3.11";
40
40
 
41
41
  /* eslint-disable react/no-unused-prop-types */
42
42
 
@@ -53,7 +53,7 @@ function getShortISOString(date) {
53
53
  }
54
54
  var menuStyles = (0, _react2.css)({
55
55
  zIndex: _constants.layers.dialog(),
56
- backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N20, ")"),
56
+ backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N0, ")"),
57
57
  borderRadius: "".concat((0, _constants.borderRadius)(), "px"),
58
58
  boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")"),
59
59
  overflow: 'hidden'
@@ -218,11 +218,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
218
218
  // today's date
219
219
  var yearIsOverLimit = calendarValue.match(/^\d{5,}/);
220
220
  if (yearIsOverLimit) {
221
- var today = new Date();
222
- var year = today.getFullYear();
223
- var month = (today.getMonth() + 1).toString().padStart(2, '0');
224
- var day = today.getDate().toString().padStart(2, '0');
225
- return "".concat(year, "-").concat(month, "-").concat(day);
221
+ return getShortISOString(new Date());
226
222
  }
227
223
  return calendarValue;
228
224
  });
@@ -31,7 +31,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
31
31
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
32
32
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
33
33
  var packageName = "@atlaskit/datetime-picker";
34
- var packageVersion = "12.3.9";
34
+ var packageVersion = "12.3.11";
35
35
 
36
36
  /* eslint-disable react/no-unused-prop-types */
37
37
 
@@ -108,6 +108,8 @@ var iconContainerStyles = (0, _react2.css)({
108
108
  paddingLeft: "".concat(ICON_PADDING * 2, "px"),
109
109
  alignItems: 'center',
110
110
  flexBasis: 'inherit',
111
+ backgroundColor: 'inherit',
112
+ border: 'none',
111
113
  color: "var(--ds-text-subtlest, ".concat(_colors.N70, ")"),
112
114
  transition: "color 150ms",
113
115
  '&:hover': {
@@ -333,10 +335,12 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
333
335
  testId: testId && "".concat(testId, "--timepicker")
334
336
  }, timePickerProps))), isClearable && !isDisabled ?
335
337
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
336
- (0, _react2.jsx)("div", {
338
+ (0, _react2.jsx)("button", {
337
339
  css: iconContainerStyles,
338
340
  onClick: this.onClear,
339
- "data-testid": testId && "".concat(testId, "--icon--container")
341
+ "data-testid": testId && "".concat(testId, "--icon--container"),
342
+ tabIndex: -1,
343
+ type: "button"
340
344
  }, (0, _react2.jsx)(_selectClear.default, {
341
345
  size: "small",
342
346
  primaryColor: "inherit",
@@ -35,7 +35,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
35
35
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
36
36
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
37
37
  var packageName = "@atlaskit/datetime-picker";
38
- var packageVersion = "12.3.9";
38
+ var packageVersion = "12.3.11";
39
39
  var menuStyles = {
40
40
  /* Need to remove default absolute positioning as that causes issues with position fixed */
41
41
  position: 'static',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "12.3.9",
3
+ "version": "12.3.11",
4
4
  "sideEffects": false
5
5
  }
@@ -12,13 +12,13 @@ import Calendar from '@atlaskit/calendar';
12
12
  import CalendarIcon from '@atlaskit/icon/glyph/calendar';
13
13
  import { createLocalizationProvider } from '@atlaskit/locale';
14
14
  import Select, { mergeStyles } from '@atlaskit/select';
15
- import { N20, N50A, N60A } from '@atlaskit/theme/colors';
15
+ import { N0, N50A, N60A } from '@atlaskit/theme/colors';
16
16
  import { borderRadius, gridSize, layers } from '@atlaskit/theme/constants';
17
17
  import { defaultDateFormat, EmptyComponent, padToTwo, placeholderDatetime } from '../internal';
18
18
  import FixedLayer from '../internal/fixed-layer';
19
19
  import { convertTokens } from './utils';
20
20
  const packageName = "@atlaskit/datetime-picker";
21
- const packageVersion = "12.3.9";
21
+ const packageVersion = "12.3.11";
22
22
 
23
23
  /* eslint-disable react/no-unused-prop-types */
24
24
 
@@ -35,7 +35,7 @@ function getShortISOString(date) {
35
35
  }
36
36
  const menuStyles = css({
37
37
  zIndex: layers.dialog(),
38
- backgroundColor: `var(--ds-surface-overlay, ${N20})`,
38
+ backgroundColor: `var(--ds-surface-overlay, ${N0})`,
39
39
  borderRadius: `${borderRadius()}px`,
40
40
  boxShadow: `var(--ds-shadow-overlay, ${`0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`})`,
41
41
  overflow: 'hidden'
@@ -197,11 +197,7 @@ class DatePicker extends Component {
197
197
  // today's date
198
198
  const yearIsOverLimit = calendarValue.match(/^\d{5,}/);
199
199
  if (yearIsOverLimit) {
200
- const today = new Date();
201
- const year = today.getFullYear();
202
- const month = (today.getMonth() + 1).toString().padStart(2, '0');
203
- const day = today.getDate().toString().padStart(2, '0');
204
- return `${year}-${month}-${day}`;
200
+ return getShortISOString(new Date());
205
201
  }
206
202
  return calendarValue;
207
203
  });
@@ -17,7 +17,7 @@ import DatePicker from './date-picker';
17
17
  import TimePicker from './time-picker';
18
18
  import { convertTokens } from './utils';
19
19
  const packageName = "@atlaskit/datetime-picker";
20
- const packageVersion = "12.3.9";
20
+ const packageVersion = "12.3.11";
21
21
 
22
22
  /* eslint-disable react/no-unused-prop-types */
23
23
 
@@ -94,6 +94,8 @@ const iconContainerStyles = css({
94
94
  paddingLeft: `${ICON_PADDING * 2}px`,
95
95
  alignItems: 'center',
96
96
  flexBasis: 'inherit',
97
+ backgroundColor: 'inherit',
98
+ border: 'none',
97
99
  color: `var(--ds-text-subtlest, ${N70})`,
98
100
  transition: `color 150ms`,
99
101
  '&:hover': {
@@ -322,10 +324,12 @@ class DateTimePicker extends React.Component {
322
324
  testId: testId && `${testId}--timepicker`
323
325
  }, timePickerProps))), isClearable && !isDisabled ?
324
326
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
325
- jsx("div", {
327
+ jsx("button", {
326
328
  css: iconContainerStyles,
327
329
  onClick: this.onClear,
328
- "data-testid": testId && `${testId}--icon--container`
330
+ "data-testid": testId && `${testId}--icon--container`,
331
+ tabIndex: -1,
332
+ type: "button"
329
333
  }, jsx(SelectClearIcon, {
330
334
  size: "small",
331
335
  primaryColor: "inherit",
@@ -9,13 +9,14 @@ import pick from 'lodash/pick';
9
9
  import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
10
10
  import { createLocalizationProvider } from '@atlaskit/locale';
11
11
  import Select, { components, CreatableSelect, mergeStyles } from '@atlaskit/select';
12
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
12
13
  import { gridSize } from '@atlaskit/theme/constants';
13
14
  import { defaultTimeFormat, defaultTimes, EmptyComponent, placeholderDatetime } from '../internal';
14
15
  import FixedLayer from '../internal/fixed-layer';
15
16
  import parseTime from '../internal/parse-time';
16
17
  import { convertTokens } from './utils';
17
18
  const packageName = "@atlaskit/datetime-picker";
18
- const packageVersion = "12.3.9";
19
+ const packageVersion = "12.3.11";
19
20
  const menuStyles = {
20
21
  /* Need to remove default absolute positioning as that causes issues with position fixed */
21
22
  position: 'static',
@@ -4,6 +4,7 @@ import ScrollLock from 'react-scrolllock';
4
4
  import noop from '@atlaskit/ds-lib/noop';
5
5
  import { sizes } from '@atlaskit/icon';
6
6
  import { Manager, Popper, Reference } from '@atlaskit/popper';
7
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
7
8
  import { gridSize, layers } from '@atlaskit/theme/constants';
8
9
  /**
9
10
  * This component renders layered content with fixed positioning.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "12.3.9",
3
+ "version": "12.3.11",
4
4
  "sideEffects": false
5
5
  }
@@ -23,13 +23,13 @@ import Calendar from '@atlaskit/calendar';
23
23
  import CalendarIcon from '@atlaskit/icon/glyph/calendar';
24
24
  import { createLocalizationProvider } from '@atlaskit/locale';
25
25
  import Select, { mergeStyles } from '@atlaskit/select';
26
- import { N20, N50A, N60A } from '@atlaskit/theme/colors';
26
+ import { N0, N50A, N60A } from '@atlaskit/theme/colors';
27
27
  import { borderRadius, gridSize, layers } from '@atlaskit/theme/constants';
28
28
  import { defaultDateFormat, EmptyComponent, padToTwo, placeholderDatetime } from '../internal';
29
29
  import FixedLayer from '../internal/fixed-layer';
30
30
  import { convertTokens } from './utils';
31
31
  var packageName = "@atlaskit/datetime-picker";
32
- var packageVersion = "12.3.9";
32
+ var packageVersion = "12.3.11";
33
33
 
34
34
  /* eslint-disable react/no-unused-prop-types */
35
35
 
@@ -46,7 +46,7 @@ function getShortISOString(date) {
46
46
  }
47
47
  var menuStyles = css({
48
48
  zIndex: layers.dialog(),
49
- backgroundColor: "var(--ds-surface-overlay, ".concat(N20, ")"),
49
+ backgroundColor: "var(--ds-surface-overlay, ".concat(N0, ")"),
50
50
  borderRadius: "".concat(borderRadius(), "px"),
51
51
  boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")"),
52
52
  overflow: 'hidden'
@@ -211,11 +211,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
211
211
  // today's date
212
212
  var yearIsOverLimit = calendarValue.match(/^\d{5,}/);
213
213
  if (yearIsOverLimit) {
214
- var today = new Date();
215
- var year = today.getFullYear();
216
- var month = (today.getMonth() + 1).toString().padStart(2, '0');
217
- var day = today.getDate().toString().padStart(2, '0');
218
- return "".concat(year, "-").concat(month, "-").concat(day);
214
+ return getShortISOString(new Date());
219
215
  }
220
216
  return calendarValue;
221
217
  });
@@ -27,7 +27,7 @@ import DatePicker from './date-picker';
27
27
  import TimePicker from './time-picker';
28
28
  import { convertTokens } from './utils';
29
29
  var packageName = "@atlaskit/datetime-picker";
30
- var packageVersion = "12.3.9";
30
+ var packageVersion = "12.3.11";
31
31
 
32
32
  /* eslint-disable react/no-unused-prop-types */
33
33
 
@@ -104,6 +104,8 @@ var iconContainerStyles = css({
104
104
  paddingLeft: "".concat(ICON_PADDING * 2, "px"),
105
105
  alignItems: 'center',
106
106
  flexBasis: 'inherit',
107
+ backgroundColor: 'inherit',
108
+ border: 'none',
107
109
  color: "var(--ds-text-subtlest, ".concat(N70, ")"),
108
110
  transition: "color 150ms",
109
111
  '&:hover': {
@@ -329,10 +331,12 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
329
331
  testId: testId && "".concat(testId, "--timepicker")
330
332
  }, timePickerProps))), isClearable && !isDisabled ?
331
333
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
332
- jsx("div", {
334
+ jsx("button", {
333
335
  css: iconContainerStyles,
334
336
  onClick: this.onClear,
335
- "data-testid": testId && "".concat(testId, "--icon--container")
337
+ "data-testid": testId && "".concat(testId, "--icon--container"),
338
+ tabIndex: -1,
339
+ type: "button"
336
340
  }, jsx(SelectClearIcon, {
337
341
  size: "small",
338
342
  primaryColor: "inherit",
@@ -22,13 +22,14 @@ import pick from 'lodash/pick';
22
22
  import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
23
23
  import { createLocalizationProvider } from '@atlaskit/locale';
24
24
  import Select, { components, CreatableSelect, mergeStyles } from '@atlaskit/select';
25
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
25
26
  import { gridSize } from '@atlaskit/theme/constants';
26
27
  import { defaultTimeFormat, defaultTimes, EmptyComponent, placeholderDatetime } from '../internal';
27
28
  import FixedLayer from '../internal/fixed-layer';
28
29
  import parseTime from '../internal/parse-time';
29
30
  import { convertTokens } from './utils';
30
31
  var packageName = "@atlaskit/datetime-picker";
31
- var packageVersion = "12.3.9";
32
+ var packageVersion = "12.3.11";
32
33
  var menuStyles = {
33
34
  /* Need to remove default absolute positioning as that causes issues with position fixed */
34
35
  position: 'static',
@@ -14,6 +14,7 @@ import ScrollLock from 'react-scrolllock';
14
14
  import noop from '@atlaskit/ds-lib/noop';
15
15
  import { sizes } from '@atlaskit/icon';
16
16
  import { Manager, Popper, Reference } from '@atlaskit/popper';
17
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
17
18
  import { gridSize, layers } from '@atlaskit/theme/constants';
18
19
  /**
19
20
  * This component renders layered content with fixed positioning.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "12.3.9",
3
+ "version": "12.3.11",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "12.3.9",
3
+ "version": "12.3.11",
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/"
@@ -15,7 +15,6 @@
15
15
  "sideEffects": false,
16
16
  "atlaskit:src": "src/index.tsx",
17
17
  "atlassian": {
18
- "disableProductCI": true,
19
18
  "team": "Design System Team",
20
19
  "deprecatedAutoEntryPoints": true,
21
20
  "releaseModel": "scheduled",
@@ -32,7 +31,7 @@
32
31
  "@atlaskit/locale": "^2.1.0",
33
32
  "@atlaskit/popper": "^5.4.0",
34
33
  "@atlaskit/select": "^16.1.0",
35
- "@atlaskit/theme": "^12.2.0",
34
+ "@atlaskit/theme": "^12.3.0",
36
35
  "@atlaskit/tokens": "^1.2.0",
37
36
  "@babel/runtime": "^7.0.0",
38
37
  "@emotion/react": "^11.7.1",
@@ -44,7 +43,7 @@
44
43
  "react": "^16.8.0"
45
44
  },
46
45
  "devDependencies": {
47
- "@atlaskit/button": "^16.5.0",
46
+ "@atlaskit/button": "^16.6.0",
48
47
  "@atlaskit/docs": "*",
49
48
  "@atlaskit/field-base": "^15.0.5",
50
49
  "@atlaskit/form": "^8.8.0",