baseui 10.3.0 → 10.7.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.
Files changed (213) hide show
  1. package/app-nav-bar/user-menu.js +1 -0
  2. package/app-nav-bar/user-menu.js.flow +1 -0
  3. package/button/styled-components.js +1 -1
  4. package/button/styled-components.js.flow +4 -1
  5. package/card/styled-components.js +0 -1
  6. package/card/styled-components.js.flow +0 -1
  7. package/combobox/combobox.js +5 -1
  8. package/combobox/combobox.js.flow +4 -0
  9. package/combobox/index.d.ts +6 -3
  10. package/data-table/column-datetime.js +2 -0
  11. package/data-table/column-datetime.js.flow +2 -0
  12. package/data-table/data-table.js +13 -3
  13. package/data-table/data-table.js.flow +20 -4
  14. package/data-table/types.js.flow +2 -1
  15. package/datepicker/calendar-header.js +255 -109
  16. package/datepicker/calendar-header.js.flow +282 -145
  17. package/datepicker/calendar.js +6 -1
  18. package/datepicker/calendar.js.flow +5 -1
  19. package/datepicker/constants.js +9 -2
  20. package/datepicker/constants.js.flow +7 -0
  21. package/datepicker/datepicker.js +135 -73
  22. package/datepicker/datepicker.js.flow +161 -62
  23. package/datepicker/day.js +2 -0
  24. package/datepicker/day.js.flow +2 -0
  25. package/datepicker/index.d.ts +8 -0
  26. package/datepicker/month.js +4 -0
  27. package/datepicker/month.js.flow +3 -0
  28. package/datepicker/styled-components.js +116 -56
  29. package/datepicker/styled-components.js.flow +101 -36
  30. package/datepicker/types.js.flow +18 -1
  31. package/datepicker/utils/calendar-header-helpers.js +51 -0
  32. package/datepicker/utils/calendar-header-helpers.js.flow +53 -0
  33. package/datepicker/utils/date-helpers.js +1 -1
  34. package/datepicker/utils/date-helpers.js.flow +1 -1
  35. package/datepicker/week.js +1 -0
  36. package/datepicker/week.js.flow +1 -0
  37. package/dnd-list/index.js.flow +2 -1
  38. package/dnd-list/list.js +1 -2
  39. package/dnd-list/list.js.flow +1 -1
  40. package/dnd-list/styled-components.js +1 -1
  41. package/dnd-list/styled-components.js.flow +1 -0
  42. package/drawer/close-icon.js +3 -2
  43. package/drawer/close-icon.js.flow +2 -2
  44. package/drawer/drawer.js +5 -2
  45. package/drawer/drawer.js.flow +2 -2
  46. package/es/app-nav-bar/user-menu.js +1 -0
  47. package/es/button/styled-components.js +1 -1
  48. package/es/card/styled-components.js +0 -1
  49. package/es/combobox/combobox.js +5 -1
  50. package/es/data-table/column-datetime.js +2 -0
  51. package/es/data-table/data-table.js +13 -3
  52. package/es/datepicker/calendar-header.js +204 -93
  53. package/es/datepicker/calendar.js +7 -2
  54. package/es/datepicker/constants.js +6 -1
  55. package/es/datepicker/datepicker.js +70 -42
  56. package/es/datepicker/day.js +2 -0
  57. package/es/datepicker/month.js +3 -0
  58. package/es/datepicker/styled-components.js +98 -37
  59. package/es/datepicker/types.js +1 -1
  60. package/es/datepicker/utils/calendar-header-helpers.js +34 -0
  61. package/es/datepicker/utils/date-helpers.js +1 -1
  62. package/es/datepicker/week.js +1 -0
  63. package/es/dnd-list/index.js +2 -1
  64. package/es/dnd-list/list.js +1 -2
  65. package/es/dnd-list/styled-components.js +1 -0
  66. package/es/drawer/close-icon.js +3 -2
  67. package/es/drawer/drawer.js +5 -2
  68. package/es/helper/helper.js +1 -0
  69. package/es/layer/layer.js +8 -0
  70. package/es/list/list-heading.js +17 -6
  71. package/es/map-marker/constants.js +69 -0
  72. package/es/map-marker/fixed-marker.js +98 -0
  73. package/es/map-marker/floating-marker.js +65 -0
  74. package/es/map-marker/index.js +9 -0
  75. package/es/map-marker/pin-head.js +108 -0
  76. package/es/map-marker/styled-components.js +156 -0
  77. package/es/map-marker/types.js +8 -0
  78. package/es/menu/maybe-child-menu.js +1 -0
  79. package/es/popover/popover.js +6 -5
  80. package/es/popover/stateful-container.js +8 -2
  81. package/es/rating/emoticon-rating.js +3 -1
  82. package/es/rating/star-rating.js +3 -1
  83. package/es/select/select-component.js +20 -5
  84. package/es/select/styled-components.js +34 -4
  85. package/es/snackbar/snackbar-context.js +16 -4
  86. package/es/spinner/styled-components.js +1 -1
  87. package/es/table-semantic/styled-components.js +6 -4
  88. package/es/table-semantic/table-builder.js +3 -0
  89. package/es/themes/dark-theme/color-component-tokens.js +1 -1
  90. package/es/themes/light-theme/color-component-tokens.js +9 -9
  91. package/es/themes/shared/lighting.js +5 -1
  92. package/es/timepicker/timepicker.js +16 -11
  93. package/es/tooltip/styled-components.js +8 -0
  94. package/es/tooltip/tooltip.js +1 -0
  95. package/esm/app-nav-bar/user-menu.js +1 -0
  96. package/esm/button/styled-components.js +1 -1
  97. package/esm/card/styled-components.js +0 -1
  98. package/esm/combobox/combobox.js +5 -1
  99. package/esm/data-table/column-datetime.js +2 -0
  100. package/esm/data-table/data-table.js +13 -3
  101. package/esm/datepicker/calendar-header.js +255 -110
  102. package/esm/datepicker/calendar.js +7 -2
  103. package/esm/datepicker/constants.js +6 -1
  104. package/esm/datepicker/datepicker.js +136 -74
  105. package/esm/datepicker/day.js +2 -0
  106. package/esm/datepicker/month.js +3 -0
  107. package/esm/datepicker/styled-components.js +112 -55
  108. package/esm/datepicker/types.js +1 -1
  109. package/esm/datepicker/utils/calendar-header-helpers.js +45 -0
  110. package/esm/datepicker/utils/date-helpers.js +1 -1
  111. package/esm/datepicker/week.js +1 -0
  112. package/esm/dnd-list/index.js +2 -1
  113. package/esm/dnd-list/list.js +1 -2
  114. package/esm/dnd-list/styled-components.js +1 -1
  115. package/esm/drawer/close-icon.js +3 -2
  116. package/esm/drawer/drawer.js +5 -2
  117. package/esm/helper/helper.js +1 -0
  118. package/esm/layer/layer.js +8 -0
  119. package/esm/list/list-heading.js +17 -6
  120. package/esm/map-marker/constants.js +62 -0
  121. package/esm/map-marker/fixed-marker.js +137 -0
  122. package/esm/map-marker/floating-marker.js +94 -0
  123. package/esm/map-marker/index.js +9 -0
  124. package/esm/map-marker/pin-head.js +144 -0
  125. package/esm/map-marker/styled-components.js +168 -0
  126. package/esm/map-marker/types.js +8 -0
  127. package/esm/menu/maybe-child-menu.js +1 -0
  128. package/esm/popover/popover.js +6 -5
  129. package/esm/popover/stateful-container.js +8 -2
  130. package/esm/rating/emoticon-rating.js +2 -2
  131. package/esm/rating/star-rating.js +2 -2
  132. package/esm/select/select-component.js +19 -5
  133. package/esm/select/styled-components.js +28 -4
  134. package/esm/snackbar/snackbar-context.js +16 -4
  135. package/esm/spinner/styled-components.js +1 -1
  136. package/esm/table-semantic/styled-components.js +6 -4
  137. package/esm/table-semantic/table-builder.js +3 -0
  138. package/esm/themes/dark-theme/color-component-tokens.js +1 -1
  139. package/esm/themes/light-theme/color-component-tokens.js +9 -9
  140. package/esm/themes/shared/lighting.js +5 -1
  141. package/esm/timepicker/timepicker.js +17 -11
  142. package/esm/tooltip/styled-components.js +8 -0
  143. package/esm/tooltip/tooltip.js +1 -0
  144. package/helper/helper.js +1 -0
  145. package/helper/helper.js.flow +1 -0
  146. package/layer/layer.js +8 -0
  147. package/layer/layer.js.flow +9 -0
  148. package/link/index.d.ts +1 -0
  149. package/list/index.d.ts +36 -0
  150. package/list/list-heading.js +24 -7
  151. package/list/list-heading.js.flow +17 -8
  152. package/map-marker/constants.js +82 -0
  153. package/map-marker/constants.js.flow +74 -0
  154. package/map-marker/fixed-marker.js +152 -0
  155. package/map-marker/fixed-marker.js.flow +137 -0
  156. package/map-marker/floating-marker.js +109 -0
  157. package/map-marker/floating-marker.js.flow +102 -0
  158. package/map-marker/index.d.ts +105 -0
  159. package/map-marker/index.js +55 -0
  160. package/map-marker/index.js.flow +23 -0
  161. package/map-marker/package.json +4 -0
  162. package/map-marker/pin-head.js +159 -0
  163. package/map-marker/pin-head.js.flow +155 -0
  164. package/map-marker/styled-components.js +184 -0
  165. package/map-marker/styled-components.js.flow +177 -0
  166. package/map-marker/types.js +11 -0
  167. package/map-marker/types.js.flow +114 -0
  168. package/menu/index.d.ts +7 -0
  169. package/menu/maybe-child-menu.js +1 -0
  170. package/menu/maybe-child-menu.js.flow +1 -0
  171. package/menu/types.js.flow +12 -0
  172. package/modal/index.d.ts +1 -1
  173. package/modal/types.js.flow +4 -1
  174. package/package.json +5 -3
  175. package/popover/index.d.ts +2 -1
  176. package/popover/popover.js +6 -5
  177. package/popover/popover.js.flow +11 -4
  178. package/popover/stateful-container.js +8 -2
  179. package/popover/stateful-container.js.flow +5 -0
  180. package/popover/types.js.flow +6 -1
  181. package/rating/emoticon-rating.js +2 -2
  182. package/rating/emoticon-rating.js.flow +4 -1
  183. package/rating/star-rating.js +2 -2
  184. package/rating/star-rating.js.flow +4 -1
  185. package/select/select-component.js +19 -5
  186. package/select/select-component.js.flow +19 -5
  187. package/select/styled-components.js +28 -4
  188. package/select/styled-components.js.flow +30 -2
  189. package/select/types.js.flow +9 -0
  190. package/snackbar/index.d.ts +21 -16
  191. package/snackbar/snackbar-context.js +15 -4
  192. package/snackbar/snackbar-context.js.flow +15 -3
  193. package/spinner/styled-components.js +1 -1
  194. package/spinner/styled-components.js.flow +1 -1
  195. package/table-semantic/styled-components.js +6 -4
  196. package/table-semantic/styled-components.js.flow +6 -4
  197. package/table-semantic/table-builder.js +3 -0
  198. package/table-semantic/table-builder.js.flow +3 -0
  199. package/themes/dark-theme/color-component-tokens.js +1 -1
  200. package/themes/dark-theme/color-component-tokens.js.flow +1 -1
  201. package/themes/light-theme/color-component-tokens.js +9 -9
  202. package/themes/light-theme/color-component-tokens.js.flow +9 -9
  203. package/themes/shared/lighting.js +5 -1
  204. package/themes/shared/lighting.js.flow +4 -0
  205. package/themes/types.js.flow +4 -0
  206. package/timepicker/index.d.ts +1 -0
  207. package/timepicker/timepicker.js +17 -11
  208. package/timepicker/timepicker.js.flow +31 -12
  209. package/timepicker/types.js.flow +10 -0
  210. package/tooltip/styled-components.js +8 -0
  211. package/tooltip/styled-components.js.flow +8 -0
  212. package/tooltip/tooltip.js +1 -0
  213. package/tooltip/tooltip.js.flow +6 -1
@@ -14,18 +14,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
14
14
 
15
15
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
16
16
 
17
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
18
-
19
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
20
-
21
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
22
-
23
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
24
-
25
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
26
-
27
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
28
-
29
17
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
30
18
 
31
19
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -48,6 +36,18 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
48
36
 
49
37
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
50
38
 
39
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
40
+
41
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
42
+
43
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
44
+
45
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
46
+
47
+ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
48
+
49
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
50
+
51
51
  /*
52
52
  Copyright (c) Uber Technologies, Inc.
53
53
 
@@ -61,10 +61,34 @@ import Calendar from './calendar.js';
61
61
  import { getOverrides } from '../helpers/overrides.js';
62
62
  import getInterpolatedString from '../helpers/i18n-interpolation.js';
63
63
  import { LocaleContext } from '../locale/index.js';
64
- import { StyledInputWrapper } from './styled-components.js';
64
+ import { StyledInputWrapper, StyledInputLabel, StyledStartDate, StyledEndDate } from './styled-components.js';
65
65
  import DateHelpers from './utils/date-helpers.js';
66
66
  import dateFnsAdapter from './utils/date-fns-adapter.js';
67
67
  export var DEFAULT_DATE_FORMAT = 'yyyy/MM/dd';
68
+ var INPUT_DELIMITER = ' – ';
69
+
70
+ var combineSeparatedInputs = function combineSeparatedInputs(newInputValue) {
71
+ var prevCombinedInputValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
72
+ var separatedInput = arguments.length > 2 ? arguments[2] : undefined;
73
+ var inputValue = newInputValue;
74
+
75
+ var _prevCombinedInputVal = prevCombinedInputValue.split(INPUT_DELIMITER),
76
+ _prevCombinedInputVal2 = _slicedToArray(_prevCombinedInputVal, 2),
77
+ _prevCombinedInputVal3 = _prevCombinedInputVal2[0],
78
+ prevStartDate = _prevCombinedInputVal3 === void 0 ? '' : _prevCombinedInputVal3,
79
+ _prevCombinedInputVal4 = _prevCombinedInputVal2[1],
80
+ prevEndDate = _prevCombinedInputVal4 === void 0 ? '' : _prevCombinedInputVal4;
81
+
82
+ if (separatedInput === 'startDate' && prevEndDate) {
83
+ inputValue = "".concat(inputValue, " \u2013 ").concat(prevEndDate);
84
+ }
85
+
86
+ if (separatedInput === 'endDate') {
87
+ inputValue = "".concat(prevStartDate, " \u2013 ").concat(inputValue);
88
+ }
89
+
90
+ return inputValue;
91
+ };
68
92
 
69
93
  var Datepicker = /*#__PURE__*/function (_React$Component) {
70
94
  _inherits(Datepicker, _React$Component);
@@ -197,7 +221,7 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
197
221
  isOpen: true,
198
222
  isPseudoFocused: true,
199
223
  calendarFocused: false
200
- });
224
+ }, _this.props.onOpen);
201
225
  });
202
226
 
203
227
  _defineProperty(_assertThisInitialized(_this), "close", function () {
@@ -228,9 +252,10 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
228
252
  var _this$props2 = _this.props,
229
253
  formatString = _this$props2.formatString,
230
254
  mask = _this$props2.mask,
231
- range = _this$props2.range;
255
+ range = _this$props2.range,
256
+ separateRangeInputs = _this$props2.separateRangeInputs;
232
257
 
233
- if (mask === null) {
258
+ if (mask === null || mask === undefined && formatString !== DEFAULT_DATE_FORMAT) {
234
259
  return null;
235
260
  }
236
261
 
@@ -238,28 +263,20 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
238
263
  return _this.normalizeDashes(mask);
239
264
  }
240
265
 
241
- var normalizedFormatString = _this.normalizeDashes(formatString);
242
-
243
- if (formatString) {
244
- if (range) {
245
- return "".concat(normalizedFormatString, " \u2013 ").concat(normalizedFormatString).replace(/[a-z]/gi, '9');
246
- } else {
247
- return normalizedFormatString.replace(/[a-z]/gi, '9');
248
- }
249
- }
250
-
251
- if (range) {
266
+ if (range && !separateRangeInputs) {
252
267
  return '9999/99/99 – 9999/99/99';
253
268
  }
254
269
 
255
270
  return '9999/99/99';
256
271
  });
257
272
 
258
- _defineProperty(_assertThisInitialized(_this), "handleInputChange", function (event) {
259
- var inputValue = event.currentTarget.value;
273
+ _defineProperty(_assertThisInitialized(_this), "handleInputChange", function (event, separatedInput) {
274
+ var inputValue = _this.props.range && _this.props.separateRangeInputs ? combineSeparatedInputs(event.currentTarget.value, _this.state.inputValue, separatedInput) : event.currentTarget.value;
260
275
 
261
276
  var mask = _this.getMask();
262
277
 
278
+ var formatString = _this.normalizeDashes(_this.props.formatString);
279
+
263
280
  if (typeof mask === 'string' && inputValue === mask.replace(/9/g, ' ') || inputValue.length === 0) {
264
281
  if (_this.props.onChange) {
265
282
  if (_this.props.range) {
@@ -278,8 +295,6 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
278
295
  inputValue: inputValue
279
296
  });
280
297
 
281
- var formatString = _this.normalizeDashes(_this.props.formatString);
282
-
283
298
  var parseDateString = function parseDateString(dateString) {
284
299
  if (formatString === DEFAULT_DATE_FORMAT) {
285
300
  return _this.dateHelpers.parse(dateString, 'slashDate', _this.props.locale);
@@ -289,7 +304,7 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
289
304
  };
290
305
 
291
306
  if (_this.props.range && typeof _this.props.displayValueAtRangeIndex !== 'number') {
292
- var _this$normalizeDashes = _this.normalizeDashes(inputValue).split(' – '),
307
+ var _this$normalizeDashes = _this.normalizeDashes(inputValue).split(INPUT_DELIMITER),
293
308
  _this$normalizeDashes2 = _slicedToArray(_this$normalizeDashes, 2),
294
309
  left = _this$normalizeDashes2[0],
295
310
  right = _this$normalizeDashes2[1];
@@ -455,7 +470,7 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
455
470
  } else if (Array.isArray(date)) {
456
471
  return date.map(function (day) {
457
472
  return format(day);
458
- }).join(' – ');
473
+ }).join(INPUT_DELIMITER);
459
474
  } else {
460
475
  return format(date);
461
476
  }
@@ -470,8 +485,8 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
470
485
  }
471
486
  }
472
487
  }, {
473
- key: "render",
474
- value: function render() {
488
+ key: "renderInputComponent",
489
+ value: function renderInputComponent(locale, separatedInput) {
475
490
  var _this3 = this;
476
491
 
477
492
  var _this$props$overrides = this.props.overrides,
@@ -482,6 +497,55 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
482
497
  InputComponent = _getOverrides2[0],
483
498
  inputProps = _getOverrides2[1];
484
499
 
500
+ var placeholder = this.props.placeholder || this.props.placeholder === '' ? this.props.placeholder : this.props.range && !this.props.separateRangeInputs ? 'YYYY/MM/DD – YYYY/MM/DD' : 'YYYY/MM/DD';
501
+
502
+ var _split = (this.state.inputValue || '').split(INPUT_DELIMITER),
503
+ _split2 = _slicedToArray(_split, 2),
504
+ _split2$ = _split2[0],
505
+ startDate = _split2$ === void 0 ? '' : _split2$,
506
+ _split2$2 = _split2[1],
507
+ endDate = _split2$2 === void 0 ? '' : _split2$2;
508
+
509
+ var value = separatedInput === 'startDate' ? startDate : separatedInput === 'endDate' ? endDate : this.state.inputValue;
510
+
511
+ var onChange = function onChange(event) {
512
+ return _this3.handleInputChange(event, separatedInput);
513
+ };
514
+
515
+ return /*#__PURE__*/React.createElement(InputComponent, _extends({
516
+ "aria-disabled": this.props.disabled,
517
+ "aria-label": this.props['aria-label'] || (this.props.range ? locale.datepicker.ariaLabelRange : locale.datepicker.ariaLabel),
518
+ error: this.props.error,
519
+ positive: this.props.positive,
520
+ "aria-describedby": this.props['aria-describedby'],
521
+ "aria-labelledby": this.props['aria-labelledby'],
522
+ "aria-required": this.props.required || null,
523
+ disabled: this.props.disabled,
524
+ size: this.props.size,
525
+ value: value,
526
+ onFocus: this.open,
527
+ onBlur: this.handleInputBlur,
528
+ onKeyDown: this.handleKeyDown,
529
+ onChange: onChange,
530
+ placeholder: placeholder,
531
+ mask: this.getMask(),
532
+ required: this.props.required,
533
+ clearable: this.props.clearable
534
+ }, inputProps));
535
+ }
536
+ }, {
537
+ key: "render",
538
+ value: function render() {
539
+ var _this4 = this;
540
+
541
+ var _this$props4 = this.props,
542
+ _this$props4$override = _this$props4.overrides,
543
+ overrides = _this$props4$override === void 0 ? {} : _this$props4$override,
544
+ _this$props4$startDat = _this$props4.startDateLabel,
545
+ startDateLabel = _this$props4$startDat === void 0 ? 'Start Date' : _this$props4$startDat,
546
+ _this$props4$endDateL = _this$props4.endDateLabel,
547
+ endDateLabel = _this$props4$endDateL === void 0 ? 'End Date' : _this$props4$endDateL;
548
+
485
549
  var _getOverrides3 = getOverrides(overrides.Popover, Popover),
486
550
  _getOverrides4 = _slicedToArray(_getOverrides3, 2),
487
551
  PopoverComponent = _getOverrides4[0],
@@ -492,44 +556,42 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
492
556
  InputWrapper = _getOverrides6[0],
493
557
  inputWrapperProps = _getOverrides6[1];
494
558
 
495
- var placeholder = this.props.placeholder || this.props.placeholder === '' ? this.props.placeholder : this.props.range ? 'YYYY/MM/DD – YYYY/MM/DD' : 'YYYY/MM/DD';
559
+ var _getOverrides7 = getOverrides(overrides.StartDate, StyledStartDate),
560
+ _getOverrides8 = _slicedToArray(_getOverrides7, 2),
561
+ StartDate = _getOverrides8[0],
562
+ startDateProps = _getOverrides8[1];
563
+
564
+ var _getOverrides9 = getOverrides(overrides.EndDate, StyledEndDate),
565
+ _getOverrides10 = _slicedToArray(_getOverrides9, 2),
566
+ EndDate = _getOverrides10[0],
567
+ endDateProps = _getOverrides10[1];
568
+
569
+ var _getOverrides11 = getOverrides(overrides.InputLabel, StyledInputLabel),
570
+ _getOverrides12 = _slicedToArray(_getOverrides11, 2),
571
+ InputLabel = _getOverrides12[0],
572
+ inputLabelProps = _getOverrides12[1];
573
+
496
574
  return /*#__PURE__*/React.createElement(LocaleContext.Consumer, null, function (locale) {
497
575
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PopoverComponent, _extends({
498
576
  focusLock: false,
499
- mountNode: _this3.props.mountNode,
577
+ autoFocus: false,
578
+ mountNode: _this4.props.mountNode,
500
579
  placement: PLACEMENT.bottom,
501
- isOpen: _this3.state.isOpen,
502
- onClickOutside: _this3.close,
503
- onEsc: _this3.handleEsc,
580
+ isOpen: _this4.state.isOpen,
581
+ onClickOutside: _this4.close,
582
+ onEsc: _this4.handleEsc,
504
583
  content: /*#__PURE__*/React.createElement(Calendar, _extends({
505
- adapter: _this3.props.adapter,
506
- autoFocusCalendar: _this3.state.calendarFocused,
584
+ adapter: _this4.props.adapter,
585
+ autoFocusCalendar: _this4.state.calendarFocused,
507
586
  trapTabbing: true,
508
- value: _this3.props.value
509
- }, _this3.props, {
510
- onChange: _this3.onChange
587
+ value: _this4.props.value
588
+ }, _this4.props, {
589
+ onChange: _this4.onChange
511
590
  }))
512
- }, popoverProps), /*#__PURE__*/React.createElement(InputWrapper, inputWrapperProps, /*#__PURE__*/React.createElement(InputComponent, _extends({
513
- "aria-disabled": _this3.props.disabled,
514
- "aria-label": _this3.props['aria-label'] || (_this3.props.range ? locale.datepicker.ariaLabelRange : locale.datepicker.ariaLabel),
515
- error: _this3.props.error,
516
- positive: _this3.props.positive,
517
- "aria-describedby": _this3.props['aria-describedby'],
518
- "aria-labelledby": _this3.props['aria-labelledby'],
519
- "aria-required": _this3.props.required || null,
520
- disabled: _this3.props.disabled,
521
- size: _this3.props.size,
522
- value: _this3.state.inputValue,
523
- onFocus: _this3.open,
524
- onBlur: _this3.handleInputBlur,
525
- onKeyDown: _this3.handleKeyDown,
526
- onChange: _this3.handleInputChange,
527
- placeholder: placeholder,
528
- mask: _this3.getMask(),
529
- required: _this3.props.required,
530
- clearable: _this3.props.clearable
531
- }, inputProps)))), /*#__PURE__*/React.createElement("p", {
532
- id: _this3.props['aria-describedby'],
591
+ }, popoverProps), /*#__PURE__*/React.createElement(InputWrapper, _extends({}, inputWrapperProps, {
592
+ $separateRangeInputs: _this4.props.range && _this4.props.separateRangeInputs
593
+ }), _this4.props.range && _this4.props.separateRangeInputs ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StartDate, startDateProps, /*#__PURE__*/React.createElement(InputLabel, inputLabelProps, startDateLabel), _this4.renderInputComponent(locale, 'startDate')), /*#__PURE__*/React.createElement(EndDate, endDateProps, /*#__PURE__*/React.createElement(InputLabel, inputLabelProps, endDateLabel), _this4.renderInputComponent(locale, 'endDate'))) : /*#__PURE__*/React.createElement(React.Fragment, null, _this4.renderInputComponent(locale)))), /*#__PURE__*/React.createElement("p", {
594
+ id: _this4.props['aria-describedby'],
533
595
  style: {
534
596
  position: 'fixed',
535
597
  width: '0px',
@@ -559,17 +621,17 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
559
621
  clipPath: 'inset(100%)'
560
622
  }
561
623
  }, // No date selected
562
- !_this3.props.value || Array.isArray(_this3.props.value) && !_this3.props.value.length ? '' : // Date selected in a non-range picker
563
- !Array.isArray(_this3.props.value) ? getInterpolatedString(locale.datepicker.selectedDate, {
564
- date: _this3.state.inputValue || ''
624
+ !_this4.props.value || Array.isArray(_this4.props.value) && !_this4.props.value.length ? '' : // Date selected in a non-range picker
625
+ !Array.isArray(_this4.props.value) ? getInterpolatedString(locale.datepicker.selectedDate, {
626
+ date: _this4.state.inputValue || ''
565
627
  }) : // Start and end dates are selected in a range picker
566
- _this3.props.value.length > 1 ? getInterpolatedString(locale.datepicker.selectedDateRange, {
567
- startDate: _this3.formatDisplayValue(_this3.props.value[0]),
568
- endDate: _this3.formatDisplayValue( // $FlowFixMe
569
- _this3.props.value[1])
628
+ _this4.props.value.length > 1 ? getInterpolatedString(locale.datepicker.selectedDateRange, {
629
+ startDate: _this4.formatDisplayValue(_this4.props.value[0]),
630
+ endDate: _this4.formatDisplayValue( // $FlowFixMe
631
+ _this4.props.value[1])
570
632
  }) : // A single date selected in a range picker
571
633
  "".concat(getInterpolatedString(locale.datepicker.selectedDate, {
572
- date: _this3.formatDisplayValue(_this3.props.value[0])
634
+ date: _this4.formatDisplayValue(_this4.props.value[0])
573
635
  }), " ").concat(locale.datepicker.selectSecondDatePrompt)));
574
636
  });
575
637
  }
@@ -332,6 +332,7 @@ var Day = /*#__PURE__*/function (_React$Component) {
332
332
  var $outsideMonthWithinRange = !!(Array.isArray(value) && range && $outsideMonth && !this.props.peekNextMonth && this.isOutsideOfMonthButWithinRange());
333
333
  return {
334
334
  $date: date,
335
+ $density: this.props.density,
335
336
  $disabled: this.props.disabled,
336
337
  $endDate: Array.isArray(value) && this.props.range && $selected && this.dateHelpers.isSameDay(date, value[1]) || false,
337
338
  $hasDateLabel: !!this.props.dateLabel,
@@ -344,6 +345,7 @@ var Day = /*#__PURE__*/function (_React$Component) {
344
345
  $isFocusVisible: this.state.isFocusVisible,
345
346
  $startOfMonth: this.dateHelpers.isStartOfMonth(date),
346
347
  $endOfMonth: this.dateHelpers.isEndOfMonth(date),
348
+ $month: this.getMonthProp(),
347
349
  $outsideMonth: $outsideMonth,
348
350
  $outsideMonthWithinRange: $outsideMonthWithinRange,
349
351
  $peekNextMonth: this.props.peekNextMonth,
@@ -46,8 +46,10 @@ import { StyledMonth } from './styled-components.js';
46
46
  import dateFnsAdapter from './utils/date-fns-adapter.js';
47
47
  import DateHelpers from './utils/date-helpers.js';
48
48
  import { getOverrides } from '../helpers/overrides.js';
49
+ import { DENSITY } from './constants.js';
49
50
  var defaultProps = {
50
51
  dateLabel: null,
52
+ density: DENSITY.high,
51
53
  excludeDates: null,
52
54
  filterDate: null,
53
55
  highlightDates: null,
@@ -107,6 +109,7 @@ var CalendarMonth = /*#__PURE__*/function (_React$Component) {
107
109
  adapter: _this.props.adapter,
108
110
  date: currentWeekStart,
109
111
  dateLabel: _this.props.dateLabel,
112
+ density: _this.props.density,
110
113
  excludeDates: _this.props.excludeDates,
111
114
  filterDate: _this.props.filterDate,
112
115
  highlightedDate: _this.props.highlightedDate,