@birdnet/advanced-react-dates 0.0.0-stage → 1.0.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 (267) hide show
  1. package/.babelrc +67 -0
  2. package/.eslintrc +66 -0
  3. package/.nvmrc +1 -0
  4. package/.nyc_output/4d8efcd220c2aec1f2b4ffd49d875001.json +1 -0
  5. package/.nyc_output/66d34779498a5d49bcf9d757dfc7fdb5.json +1 -0
  6. package/.nyc_output/8ca7e04140934515928bc7d4ae476b73.json +1 -0
  7. package/.nyc_output/afc270bb597bfc50e690436959c2ae54.json +1 -0
  8. package/.nycrc +19 -0
  9. package/.travis.yml +13 -0
  10. package/CHANGELOG.md +665 -0
  11. package/CLAUDE.md +56 -0
  12. package/INTHEWILD.md +9 -0
  13. package/LICENSE +21 -0
  14. package/README.md +421 -2
  15. package/constants.js +2 -0
  16. package/esm/components/CalendarDay.js +321 -0
  17. package/esm/components/CalendarIcon.js +11 -0
  18. package/esm/components/CalendarMonth.js +254 -0
  19. package/esm/components/CalendarMonthGrid.js +365 -0
  20. package/esm/components/CalendarWeek.js +11 -0
  21. package/esm/components/ChevronDown.js +11 -0
  22. package/esm/components/ChevronUp.js +11 -0
  23. package/esm/components/CloseButton.js +12 -0
  24. package/esm/components/CustomizableCalendarDay.js +341 -0
  25. package/esm/components/DateInput.js +344 -0
  26. package/esm/components/DateRangePicker.js +647 -0
  27. package/esm/components/DateRangePickerInput.js +341 -0
  28. package/esm/components/DateRangePickerInputController.js +348 -0
  29. package/esm/components/DayPicker.js +1167 -0
  30. package/esm/components/DayPickerKeyboardShortcuts.js +364 -0
  31. package/esm/components/DayPickerNavigation.js +314 -0
  32. package/esm/components/DayPickerRangeController.js +1202 -0
  33. package/esm/components/DayPickerSingleDateController.js +690 -0
  34. package/esm/components/KeyboardShortcutRow.js +69 -0
  35. package/esm/components/LeftArrow.js +11 -0
  36. package/esm/components/RightArrow.js +11 -0
  37. package/esm/components/SingleDatePicker.js +605 -0
  38. package/esm/components/SingleDatePickerInput.js +264 -0
  39. package/esm/components/SingleDatePickerInputController.js +260 -0
  40. package/esm/constants.js +28 -0
  41. package/esm/defaultPhrases.js +225 -0
  42. package/esm/index.js +20 -0
  43. package/esm/initialize.js +2 -0
  44. package/esm/shapes/AnchorDirectionShape.js +3 -0
  45. package/esm/shapes/CalendarInfoPositionShape.js +3 -0
  46. package/esm/shapes/DateRangePickerShape.js +101 -0
  47. package/esm/shapes/DayOfWeekShape.js +3 -0
  48. package/esm/shapes/DisabledShape.js +3 -0
  49. package/esm/shapes/FocusedInputShape.js +3 -0
  50. package/esm/shapes/IconPositionShape.js +3 -0
  51. package/esm/shapes/ModifiersShape.js +18 -0
  52. package/esm/shapes/NavPositionShape.js +3 -0
  53. package/esm/shapes/OpenDirectionShape.js +3 -0
  54. package/esm/shapes/OrientationShape.js +3 -0
  55. package/esm/shapes/ScrollableOrientationShape.js +3 -0
  56. package/esm/shapes/SingleDatePickerShape.js +90 -0
  57. package/esm/theme/DefaultTheme.js +176 -0
  58. package/esm/utils/calculateDimension.js +28 -0
  59. package/esm/utils/disableScroll.js +67 -0
  60. package/esm/utils/getActiveElement.js +3 -0
  61. package/esm/utils/getCalendarDaySettings.js +48 -0
  62. package/esm/utils/getCalendarMonthWeeks.js +37 -0
  63. package/esm/utils/getCalendarMonthWidth.js +4 -0
  64. package/esm/utils/getDetachedContainerStyles.js +36 -0
  65. package/esm/utils/getInputHeight.js +42 -0
  66. package/esm/utils/getNumberOfCalendarMonthWeeks.js +11 -0
  67. package/esm/utils/getPhrase.js +7 -0
  68. package/esm/utils/getPhrasePropTypes.js +9 -0
  69. package/esm/utils/getPooledMoment.js +8 -0
  70. package/esm/utils/getPreviousMonthMemoLast.js +9 -0
  71. package/esm/utils/getResponsiveContainerStyles.js +8 -0
  72. package/esm/utils/getSelectedDateOffset.js +8 -0
  73. package/esm/utils/getTransformStyles.js +8 -0
  74. package/esm/utils/getVisibleDays.js +42 -0
  75. package/esm/utils/isAfterDay.js +7 -0
  76. package/esm/utils/isBeforeDay.js +13 -0
  77. package/esm/utils/isDayVisible.js +38 -0
  78. package/esm/utils/isInclusivelyAfterDay.js +6 -0
  79. package/esm/utils/isInclusivelyBeforeDay.js +6 -0
  80. package/esm/utils/isNextDay.js +7 -0
  81. package/esm/utils/isNextMonth.js +6 -0
  82. package/esm/utils/isPrevMonth.js +6 -0
  83. package/esm/utils/isPreviousDay.js +7 -0
  84. package/esm/utils/isSameDay.js +7 -0
  85. package/esm/utils/isSameMonth.js +7 -0
  86. package/esm/utils/isTransitionEndSupported.js +3 -0
  87. package/esm/utils/modifiers.js +94 -0
  88. package/esm/utils/noflip.js +10 -0
  89. package/esm/utils/registerCSSInterfaceWithDefaultTheme.js +5 -0
  90. package/esm/utils/registerInterfaceWithDefaultTheme.js +6 -0
  91. package/esm/utils/toISODateString.js +12 -0
  92. package/esm/utils/toISOMonthString.js +12 -0
  93. package/esm/utils/toLocalizedDateString.js +8 -0
  94. package/esm/utils/toMomentObject.js +7 -0
  95. package/index.js +2 -0
  96. package/initialize.js +2 -0
  97. package/karma.conf.js +82 -0
  98. package/lib/components/CalendarDay.js +327 -0
  99. package/lib/components/CalendarIcon.js +18 -0
  100. package/lib/components/CalendarMonth.js +259 -0
  101. package/lib/components/CalendarMonthGrid.js +372 -0
  102. package/lib/components/CalendarWeek.js +18 -0
  103. package/lib/components/ChevronDown.js +18 -0
  104. package/lib/components/ChevronUp.js +18 -0
  105. package/lib/components/CloseButton.js +19 -0
  106. package/lib/components/CustomizableCalendarDay.js +347 -0
  107. package/lib/components/DateInput.js +351 -0
  108. package/lib/components/DateRangePicker.js +653 -0
  109. package/lib/components/DateRangePickerInput.js +348 -0
  110. package/lib/components/DateRangePickerInputController.js +354 -0
  111. package/lib/components/DayPicker.js +1175 -0
  112. package/lib/components/DayPickerKeyboardShortcuts.js +371 -0
  113. package/lib/components/DayPickerNavigation.js +321 -0
  114. package/lib/components/DayPickerRangeController.js +1208 -0
  115. package/lib/components/DayPickerSingleDateController.js +695 -0
  116. package/lib/components/KeyboardShortcutRow.js +76 -0
  117. package/lib/components/LeftArrow.js +18 -0
  118. package/lib/components/RightArrow.js +18 -0
  119. package/lib/components/SingleDatePicker.js +611 -0
  120. package/lib/components/SingleDatePickerInput.js +271 -0
  121. package/lib/components/SingleDatePickerInputController.js +266 -0
  122. package/lib/constants.js +34 -0
  123. package/lib/css/_datepicker.css +886 -0
  124. package/lib/defaultPhrases.js +231 -0
  125. package/lib/index.js +146 -0
  126. package/lib/initialize.js +5 -0
  127. package/lib/shapes/AnchorDirectionShape.js +10 -0
  128. package/lib/shapes/CalendarInfoPositionShape.js +10 -0
  129. package/lib/shapes/DateRangePickerShape.js +108 -0
  130. package/lib/shapes/DayOfWeekShape.js +10 -0
  131. package/lib/shapes/DisabledShape.js +10 -0
  132. package/lib/shapes/FocusedInputShape.js +10 -0
  133. package/lib/shapes/IconPositionShape.js +10 -0
  134. package/lib/shapes/ModifiersShape.js +25 -0
  135. package/lib/shapes/NavPositionShape.js +10 -0
  136. package/lib/shapes/OpenDirectionShape.js +10 -0
  137. package/lib/shapes/OrientationShape.js +10 -0
  138. package/lib/shapes/ScrollableOrientationShape.js +10 -0
  139. package/lib/shapes/SingleDatePickerShape.js +97 -0
  140. package/lib/theme/DefaultTheme.js +182 -0
  141. package/lib/utils/calculateDimension.js +34 -0
  142. package/lib/utils/disableScroll.js +75 -0
  143. package/lib/utils/getActiveElement.js +9 -0
  144. package/lib/utils/getCalendarDaySettings.js +55 -0
  145. package/lib/utils/getCalendarMonthWeeks.js +44 -0
  146. package/lib/utils/getCalendarMonthWidth.js +10 -0
  147. package/lib/utils/getDetachedContainerStyles.js +41 -0
  148. package/lib/utils/getInputHeight.js +48 -0
  149. package/lib/utils/getNumberOfCalendarMonthWeeks.js +18 -0
  150. package/lib/utils/getPhrase.js +13 -0
  151. package/lib/utils/getPhrasePropTypes.js +16 -0
  152. package/lib/utils/getPooledMoment.js +15 -0
  153. package/lib/utils/getPreviousMonthMemoLast.js +15 -0
  154. package/lib/utils/getResponsiveContainerStyles.js +15 -0
  155. package/lib/utils/getSelectedDateOffset.js +14 -0
  156. package/lib/utils/getTransformStyles.js +14 -0
  157. package/lib/utils/getVisibleDays.js +49 -0
  158. package/lib/utils/isAfterDay.js +14 -0
  159. package/lib/utils/isBeforeDay.js +20 -0
  160. package/lib/utils/isDayVisible.js +45 -0
  161. package/lib/utils/isInclusivelyAfterDay.js +13 -0
  162. package/lib/utils/isInclusivelyBeforeDay.js +13 -0
  163. package/lib/utils/isNextDay.js +14 -0
  164. package/lib/utils/isNextMonth.js +13 -0
  165. package/lib/utils/isPrevMonth.js +13 -0
  166. package/lib/utils/isPreviousDay.js +14 -0
  167. package/lib/utils/isSameDay.js +14 -0
  168. package/lib/utils/isSameMonth.js +14 -0
  169. package/lib/utils/isTransitionEndSupported.js +9 -0
  170. package/lib/utils/modifiers.js +102 -0
  171. package/lib/utils/noflip.js +16 -0
  172. package/lib/utils/registerCSSInterfaceWithDefaultTheme.js +12 -0
  173. package/lib/utils/registerInterfaceWithDefaultTheme.js +13 -0
  174. package/lib/utils/toISODateString.js +19 -0
  175. package/lib/utils/toISOMonthString.js +19 -0
  176. package/lib/utils/toLocalizedDateString.js +15 -0
  177. package/lib/utils/toMomentObject.js +14 -0
  178. package/package.json +141 -4
  179. package/scripts/.eslintrc +7 -0
  180. package/scripts/buildCSS.js +37 -0
  181. package/scripts/pure-component-fallback.js +70 -0
  182. package/scripts/renderAllComponents.jsx +25 -0
  183. package/src/components/CalendarDay.jsx +366 -0
  184. package/src/components/CalendarIcon.jsx +3 -0
  185. package/src/components/CalendarMonth.jsx +300 -0
  186. package/src/components/CalendarMonthGrid.jsx +427 -0
  187. package/src/components/CalendarWeek.jsx +17 -0
  188. package/src/components/ChevronDown.jsx +3 -0
  189. package/src/components/ChevronUp.jsx +3 -0
  190. package/src/components/CloseButton.jsx +3 -0
  191. package/src/components/CustomizableCalendarDay.jsx +382 -0
  192. package/src/components/DateInput.jsx +401 -0
  193. package/src/components/DateRangePicker.jsx +777 -0
  194. package/src/components/DateRangePickerInput.jsx +434 -0
  195. package/src/components/DateRangePickerInputController.jsx +379 -0
  196. package/src/components/DayPicker.jsx +1407 -0
  197. package/src/components/DayPickerKeyboardShortcuts.jsx +443 -0
  198. package/src/components/DayPickerNavigation.jsx +445 -0
  199. package/src/components/DayPickerRangeController.jsx +1409 -0
  200. package/src/components/DayPickerSingleDateController.jsx +769 -0
  201. package/src/components/KeyboardShortcutRow.jsx +93 -0
  202. package/src/components/LeftArrow.jsx +3 -0
  203. package/src/components/RightArrow.jsx +3 -0
  204. package/src/components/SingleDatePicker.jsx +731 -0
  205. package/src/components/SingleDatePickerInput.jsx +329 -0
  206. package/src/components/SingleDatePickerInputController.jsx +280 -0
  207. package/src/constants.js +37 -0
  208. package/src/defaultPhrases.js +215 -0
  209. package/src/index.js +20 -0
  210. package/src/initialize.js +3 -0
  211. package/src/shapes/AnchorDirectionShape.js +8 -0
  212. package/src/shapes/CalendarInfoPositionShape.js +15 -0
  213. package/src/shapes/DateRangePickerShape.js +111 -0
  214. package/src/shapes/DayOfWeekShape.js +5 -0
  215. package/src/shapes/DisabledShape.js +5 -0
  216. package/src/shapes/FocusedInputShape.js +8 -0
  217. package/src/shapes/IconPositionShape.js +8 -0
  218. package/src/shapes/ModifiersShape.js +20 -0
  219. package/src/shapes/NavPositionShape.js +8 -0
  220. package/src/shapes/OpenDirectionShape.js +8 -0
  221. package/src/shapes/OrientationShape.js +8 -0
  222. package/src/shapes/ScrollableOrientationShape.js +13 -0
  223. package/src/shapes/SingleDatePickerShape.js +100 -0
  224. package/src/svg/arrow-left.svg +1 -0
  225. package/src/svg/arrow-right.svg +1 -0
  226. package/src/svg/calendar.svg +1 -0
  227. package/src/svg/chevron-down.svg +1 -0
  228. package/src/svg/chevron-up.svg +1 -0
  229. package/src/svg/close.svg +1 -0
  230. package/src/theme/DefaultTheme.js +196 -0
  231. package/src/utils/calculateDimension.js +32 -0
  232. package/src/utils/disableScroll.js +65 -0
  233. package/src/utils/getActiveElement.js +3 -0
  234. package/src/utils/getCalendarDaySettings.js +61 -0
  235. package/src/utils/getCalendarMonthWeeks.js +49 -0
  236. package/src/utils/getCalendarMonthWidth.js +3 -0
  237. package/src/utils/getDetachedContainerStyles.js +39 -0
  238. package/src/utils/getInputHeight.js +67 -0
  239. package/src/utils/getNumberOfCalendarMonthWeeks.js +15 -0
  240. package/src/utils/getPhrase.jsx +9 -0
  241. package/src/utils/getPhrasePropTypes.js +9 -0
  242. package/src/utils/getPooledMoment.js +10 -0
  243. package/src/utils/getPreviousMonthMemoLast.js +11 -0
  244. package/src/utils/getResponsiveContainerStyles.js +18 -0
  245. package/src/utils/getSelectedDateOffset.js +6 -0
  246. package/src/utils/getTransformStyles.js +8 -0
  247. package/src/utils/getVisibleDays.js +54 -0
  248. package/src/utils/isAfterDay.js +9 -0
  249. package/src/utils/isBeforeDay.js +18 -0
  250. package/src/utils/isDayVisible.js +57 -0
  251. package/src/utils/isInclusivelyAfterDay.js +8 -0
  252. package/src/utils/isInclusivelyBeforeDay.js +8 -0
  253. package/src/utils/isNextDay.js +9 -0
  254. package/src/utils/isNextMonth.js +8 -0
  255. package/src/utils/isPrevMonth.js +8 -0
  256. package/src/utils/isPreviousDay.js +9 -0
  257. package/src/utils/isSameDay.js +10 -0
  258. package/src/utils/isSameMonth.js +9 -0
  259. package/src/utils/isTransitionEndSupported.js +3 -0
  260. package/src/utils/modifiers.js +116 -0
  261. package/src/utils/noflip.js +11 -0
  262. package/src/utils/registerCSSInterfaceWithDefaultTheme.js +7 -0
  263. package/src/utils/registerInterfaceWithDefaultTheme.js +7 -0
  264. package/src/utils/toISODateString.js +14 -0
  265. package/src/utils/toISOMonthString.js +14 -0
  266. package/src/utils/toLocalizedDateString.js +12 -0
  267. package/src/utils/toMomentObject.js +12 -0
@@ -0,0 +1,321 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _enzymeShallowEqual = _interopRequireDefault(require("enzyme-shallow-equal"));
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
+ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
+ var _react = _interopRequireDefault(require("react"));
14
+ var _propTypes = _interopRequireDefault(require("prop-types"));
15
+ var _airbnbPropTypes = require("airbnb-prop-types");
16
+ var _reactWithStyles = require("react-with-styles");
17
+ var _defaultPhrases = require("../defaultPhrases");
18
+ var _getPhrasePropTypes = _interopRequireDefault(require("../utils/getPhrasePropTypes"));
19
+ var _noflip = _interopRequireDefault(require("../utils/noflip"));
20
+ var _LeftArrow = _interopRequireDefault(require("./LeftArrow"));
21
+ var _RightArrow = _interopRequireDefault(require("./RightArrow"));
22
+ var _ChevronUp = _interopRequireDefault(require("./ChevronUp"));
23
+ var _ChevronDown = _interopRequireDefault(require("./ChevronDown"));
24
+ var _NavPositionShape = _interopRequireDefault(require("../shapes/NavPositionShape"));
25
+ var _ScrollableOrientationShape = _interopRequireDefault(require("../shapes/ScrollableOrientationShape"));
26
+ var _constants = require("../constants");
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
+ 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
+ var propTypes = process.env.NODE_ENV !== "production" ? (0, _airbnbPropTypes.forbidExtraProps)(_objectSpread(_objectSpread({}, _reactWithStyles.withStylesPropTypes), {}, {
30
+ disablePrev: _propTypes["default"].bool,
31
+ disableNext: _propTypes["default"].bool,
32
+ inlineStyles: _propTypes["default"].object,
33
+ isRTL: _propTypes["default"].bool,
34
+ navPosition: _NavPositionShape["default"],
35
+ navPrev: _propTypes["default"].node,
36
+ navNext: _propTypes["default"].node,
37
+ orientation: _ScrollableOrientationShape["default"],
38
+ onPrevMonthClick: _propTypes["default"].func,
39
+ onNextMonthClick: _propTypes["default"].func,
40
+ // internationalization
41
+ phrases: _propTypes["default"].shape((0, _getPhrasePropTypes["default"])(_defaultPhrases.DayPickerNavigationPhrases)),
42
+ renderNavPrevButton: _propTypes["default"].func,
43
+ renderNavNextButton: _propTypes["default"].func,
44
+ showNavPrevButton: _propTypes["default"].bool,
45
+ showNavNextButton: _propTypes["default"].bool
46
+ })) : {};
47
+ var defaultProps = {
48
+ disablePrev: false,
49
+ disableNext: false,
50
+ inlineStyles: null,
51
+ isRTL: false,
52
+ navPosition: _constants.NAV_POSITION_TOP,
53
+ navPrev: null,
54
+ navNext: null,
55
+ orientation: _constants.HORIZONTAL_ORIENTATION,
56
+ onPrevMonthClick: function onPrevMonthClick() {},
57
+ onNextMonthClick: function onNextMonthClick() {},
58
+ // internationalization
59
+ phrases: _defaultPhrases.DayPickerNavigationPhrases,
60
+ renderNavPrevButton: null,
61
+ renderNavNextButton: null,
62
+ showNavPrevButton: true,
63
+ showNavNextButton: true
64
+ };
65
+ var DayPickerNavigation = /*#__PURE__*/function (_ref2, _ref) {
66
+ function DayPickerNavigation() {
67
+ return _ref2.apply(this, arguments) || this;
68
+ }
69
+ (0, _inheritsLoose2["default"])(DayPickerNavigation, _ref2);
70
+ var _proto = DayPickerNavigation.prototype;
71
+ _proto[_ref] = function (nextProps, nextState) {
72
+ return !(0, _enzymeShallowEqual["default"])(this.props, nextProps) || !(0, _enzymeShallowEqual["default"])(this.state, nextState);
73
+ };
74
+ _proto.render = function render() {
75
+ var _this$props = this.props,
76
+ inlineStyles = _this$props.inlineStyles,
77
+ isRTL = _this$props.isRTL,
78
+ disablePrev = _this$props.disablePrev,
79
+ disableNext = _this$props.disableNext,
80
+ navPosition = _this$props.navPosition,
81
+ navPrev = _this$props.navPrev,
82
+ navNext = _this$props.navNext,
83
+ onPrevMonthClick = _this$props.onPrevMonthClick,
84
+ onNextMonthClick = _this$props.onNextMonthClick,
85
+ orientation = _this$props.orientation,
86
+ phrases = _this$props.phrases,
87
+ renderNavPrevButton = _this$props.renderNavPrevButton,
88
+ renderNavNextButton = _this$props.renderNavNextButton,
89
+ showNavPrevButton = _this$props.showNavPrevButton,
90
+ showNavNextButton = _this$props.showNavNextButton,
91
+ css = _this$props.css,
92
+ styles = _this$props.styles;
93
+ if (!showNavNextButton && !showNavPrevButton) {
94
+ return null;
95
+ }
96
+ var isHorizontal = orientation === _constants.HORIZONTAL_ORIENTATION;
97
+ var isVertical = orientation !== _constants.HORIZONTAL_ORIENTATION;
98
+ var isVerticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
99
+ var isBottomNavPosition = navPosition === _constants.NAV_POSITION_BOTTOM;
100
+ var hasInlineStyles = !!inlineStyles;
101
+ var navPrevIcon = navPrev;
102
+ var navNextIcon = navNext;
103
+ var isDefaultNavPrev = false;
104
+ var isDefaultNavNext = false;
105
+ var navPrevTabIndex = {};
106
+ var navNextTabIndex = {};
107
+ if (!navPrevIcon && !renderNavPrevButton && showNavPrevButton) {
108
+ navPrevTabIndex = {
109
+ tabIndex: '0'
110
+ };
111
+ isDefaultNavPrev = true;
112
+ var Icon = isVertical ? _ChevronUp["default"] : _LeftArrow["default"];
113
+ if (isRTL && !isVertical) {
114
+ Icon = _RightArrow["default"];
115
+ }
116
+ navPrevIcon = /*#__PURE__*/_react["default"].createElement(Icon, css(isHorizontal && styles.DayPickerNavigation_svg__horizontal, isVertical && styles.DayPickerNavigation_svg__vertical, disablePrev && styles.DayPickerNavigation_svg__disabled));
117
+ }
118
+ if (!navNextIcon && !renderNavNextButton && showNavNextButton) {
119
+ navNextTabIndex = {
120
+ tabIndex: '0'
121
+ };
122
+ isDefaultNavNext = true;
123
+ var _Icon = isVertical ? _ChevronDown["default"] : _RightArrow["default"];
124
+ if (isRTL && !isVertical) {
125
+ _Icon = _LeftArrow["default"];
126
+ }
127
+ navNextIcon = /*#__PURE__*/_react["default"].createElement(_Icon, css(isHorizontal && styles.DayPickerNavigation_svg__horizontal, isVertical && styles.DayPickerNavigation_svg__vertical, disableNext && styles.DayPickerNavigation_svg__disabled));
128
+ }
129
+ var isDefaultNav = isDefaultNavNext || isDefaultNavPrev;
130
+ return /*#__PURE__*/_react["default"].createElement("div", css.apply(void 0, [styles.DayPickerNavigation, isHorizontal && styles.DayPickerNavigation__horizontal].concat((0, _toConsumableArray2["default"])(isVertical ? [styles.DayPickerNavigation__vertical, isDefaultNav && styles.DayPickerNavigation__verticalDefault] : []), (0, _toConsumableArray2["default"])(isVerticalScrollable ? [styles.DayPickerNavigation__verticalScrollable, isDefaultNav && styles.DayPickerNavigation__verticalScrollableDefault, showNavPrevButton && styles.DayPickerNavigation__verticalScrollable_prevNav] : []), (0, _toConsumableArray2["default"])(isBottomNavPosition ? [styles.DayPickerNavigation__bottom, isDefaultNav && styles.DayPickerNavigation__bottomDefault] : []), [hasInlineStyles && inlineStyles])), showNavPrevButton && (renderNavPrevButton ? renderNavPrevButton({
131
+ ariaLabel: phrases.jumpToPrevMonth,
132
+ disabled: disablePrev,
133
+ onClick: disablePrev ? undefined : onPrevMonthClick,
134
+ onKeyUp: disablePrev ? undefined : function (e) {
135
+ var key = e.key;
136
+ if (key === 'Enter' || key === ' ') {
137
+ onPrevMonthClick(e);
138
+ }
139
+ },
140
+ onMouseUp: disablePrev ? undefined : function (e) {
141
+ e.currentTarget.blur();
142
+ }
143
+ }) : /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
144
+ // eslint-disable-line jsx-a11y/interactive-supports-focus
145
+ role: "button"
146
+ }, navPrevTabIndex, css.apply(void 0, [styles.DayPickerNavigation_button, isDefaultNavPrev && styles.DayPickerNavigation_button__default, disablePrev && styles.DayPickerNavigation_button__disabled].concat((0, _toConsumableArray2["default"])(isHorizontal ? [styles.DayPickerNavigation_button__horizontal].concat((0, _toConsumableArray2["default"])(isDefaultNavPrev ? [styles.DayPickerNavigation_button__horizontalDefault, isBottomNavPosition && styles.DayPickerNavigation_bottomButton__horizontalDefault, !isRTL && styles.DayPickerNavigation_leftButton__horizontalDefault, isRTL && styles.DayPickerNavigation_rightButton__horizontalDefault] : [])) : []), (0, _toConsumableArray2["default"])(isVertical ? [styles.DayPickerNavigation_button__vertical].concat((0, _toConsumableArray2["default"])(isDefaultNavPrev ? [styles.DayPickerNavigation_button__verticalDefault, styles.DayPickerNavigation_prevButton__verticalDefault, isVerticalScrollable && styles.DayPickerNavigation_prevButton__verticalScrollableDefault] : [])) : []))), {
147
+ "aria-disabled": disablePrev ? true : undefined,
148
+ "aria-label": phrases.jumpToPrevMonth,
149
+ onClick: disablePrev ? undefined : onPrevMonthClick,
150
+ onKeyUp: disablePrev ? undefined : function (e) {
151
+ var key = e.key;
152
+ if (key === 'Enter' || key === ' ') {
153
+ onPrevMonthClick(e);
154
+ }
155
+ },
156
+ onMouseUp: disablePrev ? undefined : function (e) {
157
+ e.currentTarget.blur();
158
+ }
159
+ }), navPrevIcon)), showNavNextButton && (renderNavNextButton ? renderNavNextButton({
160
+ ariaLabel: phrases.jumpToNextMonth,
161
+ disabled: disableNext,
162
+ onClick: disableNext ? undefined : onNextMonthClick,
163
+ onKeyUp: disableNext ? undefined : function (e) {
164
+ var key = e.key;
165
+ if (key === 'Enter' || key === ' ') {
166
+ onNextMonthClick(e);
167
+ }
168
+ },
169
+ onMouseUp: disableNext ? undefined : function (e) {
170
+ e.currentTarget.blur();
171
+ }
172
+ }) : /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
173
+ // eslint-disable-line jsx-a11y/interactive-supports-focus
174
+ role: "button"
175
+ }, navNextTabIndex, css.apply(void 0, [styles.DayPickerNavigation_button, isDefaultNavNext && styles.DayPickerNavigation_button__default, disableNext && styles.DayPickerNavigation_button__disabled].concat((0, _toConsumableArray2["default"])(isHorizontal ? [styles.DayPickerNavigation_button__horizontal].concat((0, _toConsumableArray2["default"])(isDefaultNavNext ? [styles.DayPickerNavigation_button__horizontalDefault, isBottomNavPosition && styles.DayPickerNavigation_bottomButton__horizontalDefault, isRTL && styles.DayPickerNavigation_leftButton__horizontalDefault, !isRTL && styles.DayPickerNavigation_rightButton__horizontalDefault] : [])) : []), (0, _toConsumableArray2["default"])(isVertical ? [styles.DayPickerNavigation_button__vertical].concat((0, _toConsumableArray2["default"])(isDefaultNavNext ? [styles.DayPickerNavigation_button__verticalDefault, styles.DayPickerNavigation_nextButton__verticalDefault, isVerticalScrollable && styles.DayPickerNavigation_nextButton__verticalScrollableDefault] : [])) : []))), {
176
+ "aria-disabled": disableNext ? true : undefined,
177
+ "aria-label": phrases.jumpToNextMonth,
178
+ onClick: disableNext ? undefined : onNextMonthClick,
179
+ onKeyUp: disableNext ? undefined : function (e) {
180
+ var key = e.key;
181
+ if (key === 'Enter' || key === ' ') {
182
+ onNextMonthClick(e);
183
+ }
184
+ },
185
+ onMouseUp: disableNext ? undefined : function (e) {
186
+ e.currentTarget.blur();
187
+ }
188
+ }), navNextIcon)));
189
+ };
190
+ return DayPickerNavigation;
191
+ }(_react["default"].PureComponent || _react["default"].Component, !_react["default"].PureComponent && "shouldComponentUpdate");
192
+ DayPickerNavigation.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
193
+ DayPickerNavigation.defaultProps = defaultProps;
194
+ var _default = exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref3) {
195
+ var _ref3$reactDates = _ref3.reactDates,
196
+ color = _ref3$reactDates.color,
197
+ zIndex = _ref3$reactDates.zIndex;
198
+ return {
199
+ DayPickerNavigation: {
200
+ position: 'relative',
201
+ zIndex: zIndex + 2
202
+ },
203
+ DayPickerNavigation__horizontal: {
204
+ height: 0
205
+ },
206
+ DayPickerNavigation__vertical: {},
207
+ DayPickerNavigation__verticalScrollable: {},
208
+ DayPickerNavigation__verticalScrollable_prevNav: {
209
+ zIndex: zIndex + 1 // zIndex + 2 causes the button to show on top of the day of week headers
210
+ },
211
+ DayPickerNavigation__verticalDefault: {
212
+ position: 'absolute',
213
+ width: '100%',
214
+ height: 52,
215
+ bottom: 0,
216
+ left: (0, _noflip["default"])(0)
217
+ },
218
+ DayPickerNavigation__verticalScrollableDefault: {
219
+ position: 'relative'
220
+ },
221
+ DayPickerNavigation__bottom: {
222
+ height: 'auto'
223
+ },
224
+ DayPickerNavigation__bottomDefault: {
225
+ display: 'flex',
226
+ justifyContent: 'space-between'
227
+ },
228
+ DayPickerNavigation_button: {
229
+ cursor: 'pointer',
230
+ userSelect: 'none',
231
+ border: 0,
232
+ padding: 0,
233
+ margin: 0
234
+ },
235
+ DayPickerNavigation_button__default: {
236
+ border: "1px solid ".concat(color.core.borderLight),
237
+ backgroundColor: color.background,
238
+ color: color.placeholderText,
239
+ ':focus': {
240
+ border: "1px solid ".concat(color.core.borderMedium)
241
+ },
242
+ ':hover': {
243
+ border: "1px solid ".concat(color.core.borderMedium)
244
+ },
245
+ ':active': {
246
+ background: color.backgroundDark
247
+ }
248
+ },
249
+ DayPickerNavigation_button__disabled: {
250
+ cursor: 'default',
251
+ border: "1px solid ".concat(color.disabled),
252
+ ':focus': {
253
+ border: "1px solid ".concat(color.disabled)
254
+ },
255
+ ':hover': {
256
+ border: "1px solid ".concat(color.disabled)
257
+ },
258
+ ':active': {
259
+ background: 'none'
260
+ }
261
+ },
262
+ DayPickerNavigation_button__horizontal: {},
263
+ DayPickerNavigation_button__horizontalDefault: {
264
+ position: 'absolute',
265
+ top: 18,
266
+ lineHeight: 0.78,
267
+ borderRadius: 3,
268
+ padding: '6px 9px'
269
+ },
270
+ DayPickerNavigation_bottomButton__horizontalDefault: {
271
+ position: 'static',
272
+ marginLeft: 22,
273
+ marginRight: 22,
274
+ marginBottom: 30,
275
+ marginTop: -10
276
+ },
277
+ DayPickerNavigation_leftButton__horizontalDefault: {
278
+ left: (0, _noflip["default"])(22)
279
+ },
280
+ DayPickerNavigation_rightButton__horizontalDefault: {
281
+ right: (0, _noflip["default"])(22)
282
+ },
283
+ DayPickerNavigation_button__vertical: {},
284
+ DayPickerNavigation_button__verticalDefault: {
285
+ padding: 5,
286
+ background: color.background,
287
+ boxShadow: (0, _noflip["default"])('0 0 5px 2px rgba(0, 0, 0, 0.1)'),
288
+ position: 'relative',
289
+ display: 'inline-block',
290
+ textAlign: 'center',
291
+ height: '100%',
292
+ width: '50%'
293
+ },
294
+ DayPickerNavigation_prevButton__verticalDefault: {},
295
+ DayPickerNavigation_nextButton__verticalDefault: {
296
+ borderLeft: (0, _noflip["default"])(0)
297
+ },
298
+ DayPickerNavigation_nextButton__verticalScrollableDefault: {
299
+ width: '100%'
300
+ },
301
+ DayPickerNavigation_prevButton__verticalScrollableDefault: {
302
+ width: '100%'
303
+ },
304
+ DayPickerNavigation_svg__horizontal: {
305
+ height: 19,
306
+ width: 19,
307
+ fill: color.core.grayLight,
308
+ display: 'block'
309
+ },
310
+ DayPickerNavigation_svg__vertical: {
311
+ height: 42,
312
+ width: 42,
313
+ fill: color.text
314
+ },
315
+ DayPickerNavigation_svg__disabled: {
316
+ fill: color.disabled
317
+ }
318
+ };
319
+ }, {
320
+ pureComponent: typeof _react["default"].PureComponent !== 'undefined'
321
+ })(DayPickerNavigation);