hoveredSpanStyles: DayStyleShape,
selectedSpanStyles: DayStyleShape,
lastInRangeStyles: DayStyleShape,
selectedStyles: DayStyleShape,
selectedStartStyles: DayStyleShape,
selectedEndStyles: DayStyleShape,
afterHoveredStartStyles: DayStyleShape,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases))
var defaultStyles = exports.defaultStyles = {
border: '1px solid ' + String(color.core.borderLight),
background: color.background,
background: color.core.borderLight,
border: '1px double ' + String(color.core.borderLight),
var outsideStyles = exports.outsideStyles = {
background: color.outside.backgroundColor,
color: color.outside.color
var highlightedCalendarStyles = exports.highlightedCalendarStyles = {
background: color.highlighted.backgroundColor,
color: color.highlighted.color,
background: color.highlighted.backgroundColor_hover,
color: color.highlighted.color_active
var blockedMinNightsStyles = exports.blockedMinNightsStyles = {
background: color.minimumNights.backgroundColor,
border: '1px solid ' + String(color.minimumNights.borderColor),
color: color.minimumNights.color,
background: color.minimumNights.backgroundColor_hover,
color: color.minimumNights.color_active
var blockedCalendarStyles = exports.blockedCalendarStyles = {
background: color.blocked_calendar.backgroundColor,
border: '1px solid ' + String(color.blocked_calendar.borderColor),
color: color.blocked_calendar.color,
background: color.blocked_calendar.backgroundColor_hover,
border: '1px solid ' + String(color.blocked_calendar.borderColor),
color: color.blocked_calendar.color_active
var blockedOutOfRangeStyles = exports.blockedOutOfRangeStyles = {
background: color.blocked_out_of_range.backgroundColor,
border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
color: color.blocked_out_of_range.color,
background: color.blocked_out_of_range.backgroundColor_hover,
border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
color: color.blocked_out_of_range.color_active
var hoveredSpanStyles = exports.hoveredSpanStyles = {
background: color.hoveredSpan.backgroundColor,
border: '1px solid ' + String(color.hoveredSpan.borderColor),
color: color.hoveredSpan.color,
background: color.hoveredSpan.backgroundColor_hover,
border: '1px solid ' + String(color.hoveredSpan.borderColor),
color: color.hoveredSpan.color_active
var selectedSpanStyles = exports.selectedSpanStyles = {
background: color.selectedSpan.backgroundColor,
border: '1px solid ' + String(color.selectedSpan.borderColor),
color: color.selectedSpan.color,
background: color.selectedSpan.backgroundColor_hover,
border: '1px solid ' + String(color.selectedSpan.borderColor),
color: color.selectedSpan.color_active
var lastInRangeStyles = exports.lastInRangeStyles = {
borderRight: color.core.primary
var selectedStyles = exports.selectedStyles = {
background: color.selected.backgroundColor,
border: '1px solid ' + String(color.selected.borderColor),
color: color.selected.color,
background: color.selected.backgroundColor_hover,
border: '1px solid ' + String(color.selected.borderColor),
color: color.selected.color_active
day: (0, _moment2['default'])(),
daySize: _constants.DAY_SIZE,
onDayClick: function () {
onDayMouseEnter: function () {
function onDayMouseEnter() {}
onDayMouseLeave: function () {
function onDayMouseLeave() {}
ariaLabelFormat: 'dddd, LL',
defaultStyles: defaultStyles,
outsideStyles: outsideStyles,
highlightedCalendarStyles: highlightedCalendarStyles,
blockedMinNightsStyles: blockedMinNightsStyles,
blockedCalendarStyles: blockedCalendarStyles,
blockedOutOfRangeStyles: blockedOutOfRangeStyles,
hoveredSpanStyles: hoveredSpanStyles,
selectedSpanStyles: selectedSpanStyles,
lastInRangeStyles: lastInRangeStyles,
selectedStyles: selectedStyles,
afterHoveredStartStyles: {},
firstDayOfWeekStyles: {},
phrases: _defaultPhrases.CalendarDayPhrases
var CustomizableCalendarDay = function (_React$Component) {
_inherits(CustomizableCalendarDay, _React$Component);
function CustomizableCalendarDay() {
_classCallCheck(this, CustomizableCalendarDay);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
var _this = _possibleConstructorReturn(this, (_ref = CustomizableCalendarDay.__proto__ || Object.getPrototypeOf(CustomizableCalendarDay)).call.apply(_ref, [this].concat(args)));
_this.setButtonRef = _this.setButtonRef.bind(_this);
_createClass(CustomizableCalendarDay, [{
key: 'shouldComponentUpdate',
function shouldComponentUpdate(nextProps, nextState) {
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
return shouldComponentUpdate;
key: 'componentDidUpdate',
function componentDidUpdate(prevProps) {
isFocused = _props.isFocused,
tabIndex = _props.tabIndex;
if (isFocused || tabIndex !== prevProps.tabIndex) {
return componentDidUpdate;
function onDayClick(day, e) {
var onDayClick = this.props.onDayClick;
function onDayMouseEnter(day, e) {
var onDayMouseEnter = this.props.onDayMouseEnter;
this.setState({ isHovered: true });
function onDayMouseLeave(day, e) {
var onDayMouseLeave = this.props.onDayMouseLeave;
this.setState({ isHovered: false });
function onKeyDown(day, e) {
var onDayClick = this.props.onDayClick;
if (key === 'Enter' || key === ' ') {
function setButtonRef(ref) {
var _props2 = this.props,
ariaLabelFormat = _props2.ariaLabelFormat,
daySize = _props2.daySize,
isOutsideDay = _props2.isOutsideDay,
modifiers = _props2.modifiers,
tabIndex = _props2.tabIndex,
renderDayContents = _props2.renderDayContents,
phrases = _props2.phrases,
defaultStylesWithHover = _props2.defaultStyles,
outsideStylesWithHover = _props2.outsideStyles,
todayStylesWithHover = _props2.todayStyles,
firstDayOfWeekStylesWithHover = _props2.firstDayOfWeekStyles,
lastDayOfWeekStylesWithHover = _props2.lastDayOfWeekStyles,
highlightedCalendarStylesWithHover = _props2.highlightedCalendarStyles,
blockedMinNightsStylesWithHover = _props2.blockedMinNightsStyles,
blockedCalendarStylesWithHover = _props2.blockedCalendarStyles,
blockedOutOfRangeStylesWithHover = _props2.blockedOutOfRangeStyles,
hoveredSpanStylesWithHover = _props2.hoveredSpanStyles,
selectedSpanStylesWithHover = _props2.selectedSpanStyles,
lastInRangeStylesWithHover = _props2.lastInRangeStyles,
selectedStylesWithHover = _props2.selectedStyles,
selectedStartStylesWithHover = _props2.selectedStartStyles,
selectedEndStylesWithHover = _props2.selectedEndStyles,
afterHoveredStartStylesWithHover = _props2.afterHoveredStartStyles;
var isHovered = this.state.isHovered;
if (!day) return _react2['default'].createElement('td', null);
var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases),
daySizeStyles = _getCalendarDaySettin.daySizeStyles,
useDefaultCursor = _getCalendarDaySettin.useDefaultCursor,
selected = _getCalendarDaySettin.selected,
hoveredSpan = _getCalendarDaySettin.hoveredSpan,
isOutsideRange = _getCalendarDaySettin.isOutsideRange,
ariaLabel = _getCalendarDaySettin.ariaLabel;
return _react2['default'].createElement(
_extends({}, (0, _reactWithStyles.css)(styles.CalendarDay, useDefaultCursor && styles.CalendarDay__defaultCursor, daySizeStyles, getStyles(defaultStylesWithHover, isHovered), isOutsideDay && getStyles(outsideStylesWithHover, isHovered), modifiers.has('today') && getStyles(todayStylesWithHover, isHovered), modifiers.has('first-day-of-week') && getStyles(firstDayOfWeekStylesWithHover, isHovered), modifiers.has('last-day-of-week') && getStyles(lastDayOfWeekStylesWithHover, isHovered), modifiers.has('highlighted-calendar') && getStyles(highlightedCalendarStylesWithHover, isHovered), modifiers.has('blocked-minimum-nights') && getStyles(blockedMinNightsStylesWithHover, isHovered), modifiers.has('blocked-calendar') && getStyles(blockedCalendarStylesWithHover, isHovered), hoveredSpan && getStyles(hoveredSpanStylesWithHover, isHovered), modifiers.has('after-hovered-start') && getStyles(afterHoveredStartStylesWithHover, isHovered), modifiers.has('selected-span') && getStyles(selectedSpanStylesWithHover, isHovered), modifiers.has('last-in-range') && getStyles(lastInRangeStylesWithHover, isHovered), selected && getStyles(selectedStylesWithHover, isHovered), modifiers.has('selected-start') && getStyles(selectedStartStylesWithHover, isHovered), modifiers.has('selected-end') && getStyles(selectedEndStylesWithHover, isHovered), isOutsideRange && getStyles(blockedOutOfRangeStylesWithHover, isHovered)), {
role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role
, ref: this.setButtonRef,
onMouseEnter: function () {
function onMouseEnter(e) {
_this2.onDayMouseEnter(day, e);
onMouseLeave: function () {
function onMouseLeave(e) {
_this2.onDayMouseLeave(day, e);
_this2.onDayClick(day, e);
_this2.onKeyDown(day, e);
renderDayContents ? renderDayContents(day, modifiers) : day.format('D')
return CustomizableCalendarDay;
}(_react2['default'].Component);
CustomizableCalendarDay.propTypes = propTypes;
CustomizableCalendarDay.defaultProps = defaultProps;
exports.PureCustomizableCalendarDay = CustomizableCalendarDay;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
var font = _ref2.reactDates.font;
CalendarDay__defaultCursor: {
})(CustomizableCalendarDay);
/***/ (function(module, exports, __webpack_require__) {
// eslint-disable-next-line import/no-unresolved
__webpack_require__("H24B");
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
var ToolbarContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])();
/* harmony default export */ __webpack_exports__["a"] = (ToolbarContext);
/***/ (function(module, exports) {
(function() { module.exports = window["wp"]["element"]; }());
/***/ (function(module, exports, __webpack_require__) {
var define = __webpack_require__("82c2");
var getPolyfill = __webpack_require__("5yQQ");
module.exports = function shimContains() {
var polyfill = getPolyfill();
if (typeof document !== 'undefined') {
{ contains: function () { return document.contains !== polyfill; } }
if (typeof Element !== 'undefined') {
{ contains: function () { return Element.prototype.contains !== polyfill; } }
/***/ (function(module, exports) {
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
function isObject(value) {
return value != null && (type == 'object' || type == 'function');
module.exports = isObject;
/***/ (function(module, exports, __webpack_require__) {