diff --git a/constants.js b/constants.js index d613b7eff0fea756ee86461b09bb8172a116b248..a3358962ec05d3e6ebd7ab60e0cf36e90ad54ee2 100644 --- a/constants.js +++ b/constants.js @@ -1,25 +1,2 @@ -module.exports = { - DISPLAY_FORMAT: 'L', - ISO_FORMAT: 'YYYY-MM-DD', - ISO_MONTH_FORMAT: 'YYYY-MM', - - START_DATE: 'startDate', - END_DATE: 'endDate', - - HORIZONTAL_ORIENTATION: 'horizontal', - VERTICAL_ORIENTATION: 'vertical', - VERTICAL_SCROLLABLE: 'verticalScrollable', - - ICON_BEFORE_POSITION: 'before', - ICON_AFTER_POSITION: 'after', - - ANCHOR_LEFT: 'left', - ANCHOR_RIGHT: 'right', - - OPEN_DOWN: 'down', - OPEN_UP: 'up', - - DAY_SIZE: 39, - BLOCKED_MODIFIER: 'blocked', - WEEKDAYS: [0, 1, 2, 3, 4, 5, 6], -}; +// eslint-disable-next-line import/no-unresolved +module.exports = require('./lib/constants'); diff --git a/index.js b/index.js index 4e4d8764288bc6505c12d0c9f0ede98b5a5fadc6..3f16f627d1d4a82875e31960ab7d0e1c17210373 100644 --- a/index.js +++ b/index.js @@ -1,51 +1,2 @@ -var DateRangePicker = require('./lib/components/DateRangePicker').default; -var DateRangePickerInput = require('./lib/components/DateRangePickerInput').default; -var DateRangePickerInputController = require('./lib/components/DateRangePickerInputController').default; -var SingleDatePicker = require('./lib/components/SingleDatePicker').default; -var SingleDatePickerInput = require('./lib/components/SingleDatePickerInput').default; -var DayPicker = require('./lib/components/DayPicker').default; -var DayPickerRangeController = require('./lib/components/DayPickerRangeController').default; -var DayPickerSingleDateController = require('./lib/components/DayPickerSingleDateController').default; -var CalendarMonthGrid = require('./lib/components/CalendarMonthGrid').default; -var CalendarMonth = require('./lib/components/CalendarMonth').default; -var CalendarDay = require('./lib/components/CalendarDay').default; - -var DateRangePickerShape = require('./lib/shapes/DateRangePickerShape').default; -var SingleDatePickerShape = require('./lib/shapes/SingleDatePickerShape').default; - -var isInclusivelyAfterDay = require('./lib/utils/isInclusivelyAfterDay').default; -var isInclusivelyBeforeDay = require('./lib/utils/isInclusivelyBeforeDay').default; -var isNextDay = require('./lib/utils/isNextDay').default; -var isSameDay = require('./lib/utils/isSameDay').default; - -var toISODateString = require('./lib/utils/toISODateString').default; -var toLocalizedDateString = require('./lib/utils/toLocalizedDateString').default; -var toMomentObject = require('./lib/utils/toMomentObject').default; - - -module.exports = { - DateRangePicker: DateRangePicker, - SingleDatePicker: SingleDatePicker, - - DateRangePickerInputController: DateRangePickerInputController, - DateRangePickerInput: DateRangePickerInput, - SingleDatePickerInput: SingleDatePickerInput, - DayPicker: DayPicker, - DayPickerRangeController: DayPickerRangeController, - DayPickerSingleDateController: DayPickerSingleDateController, - CalendarMonthGrid: CalendarMonthGrid, - CalendarMonth: CalendarMonth, - CalendarDay: CalendarDay, - - DateRangePickerShape: DateRangePickerShape, - SingleDatePickerShape: SingleDatePickerShape, - - isInclusivelyAfterDay: isInclusivelyAfterDay, - isInclusivelyBeforeDay: isInclusivelyBeforeDay, - isNextDay: isNextDay, - isSameDay: isSameDay, - - toISODateString: toISODateString, - toLocalizedDateString: toLocalizedDateString, - toMomentObject: toMomentObject, -}; +// eslint-disable-next-line import/no-unresolved +module.exports = require('./lib'); diff --git a/initialize.js b/initialize.js index 96d30fc67c86ed2a1ac8ba647d95290ff12bc8bf..fbd491b733f2015df0f9ccfd3ede7b35edd180a3 100644 --- a/initialize.js +++ b/initialize.js @@ -1,4 +1,2 @@ // eslint-disable-next-line import/no-unresolved -const registerCSSInterfaceWithDefaultTheme = require('./lib/utils/registerCSSInterfaceWithDefaultTheme.js').default; - -registerCSSInterfaceWithDefaultTheme(); +require('./lib/initialize'); diff --git a/src/components/CalendarDay.jsx b/src/components/CalendarDay.jsx index 0105a54e3644d79a9ec1053877751ccd8a801807..bd101351055178dcaac94b41f5284d7758550639 100644 --- a/src/components/CalendarDay.jsx +++ b/src/components/CalendarDay.jsx @@ -10,7 +10,7 @@ import { CalendarDayPhrases } from '../defaultPhrases'; import getPhrasePropTypes from '../utils/getPhrasePropTypes'; import getPhrase from '../utils/getPhrase'; -import { BLOCKED_MODIFIER, DAY_SIZE } from '../../constants'; +import { BLOCKED_MODIFIER, DAY_SIZE } from '../constants'; const propTypes = forbidExtraProps({ ...withStylesPropTypes, diff --git a/src/components/CalendarMonth.jsx b/src/components/CalendarMonth.jsx index d38e23c37c7b9635793ae5f561d009727bde4963..c2a1093f8da8e12ba806b44341b923e34195f60a 100644 --- a/src/components/CalendarMonth.jsx +++ b/src/components/CalendarMonth.jsx @@ -26,7 +26,7 @@ import { VERTICAL_ORIENTATION, VERTICAL_SCROLLABLE, DAY_SIZE, -} from '../../constants'; +} from '../constants'; const propTypes = forbidExtraProps({ ...withStylesPropTypes, diff --git a/src/components/CalendarMonthGrid.jsx b/src/components/CalendarMonthGrid.jsx index 3db9b4acc3738c4e68615d4f642c8ebdb01ce464..95c0a896078589585ea9c4a597aa6691cf194147 100644 --- a/src/components/CalendarMonthGrid.jsx +++ b/src/components/CalendarMonthGrid.jsx @@ -26,7 +26,7 @@ import { VERTICAL_ORIENTATION, VERTICAL_SCROLLABLE, DAY_SIZE, -} from '../../constants'; +} from '../constants'; const propTypes = forbidExtraProps({ ...withStylesPropTypes, diff --git a/src/components/DateInput.jsx b/src/components/DateInput.jsx index 30a9be2652fa8f45426bad0dcd9f5e522c77d784..85b86983db2a52dca3cb855a45a5c2cd69e3f7e3 100644 --- a/src/components/DateInput.jsx +++ b/src/components/DateInput.jsx @@ -6,7 +6,7 @@ import throttle from 'lodash/throttle'; import isTouchDevice from 'is-touch-device'; import openDirectionShape from '../shapes/OpenDirectionShape'; -import { OPEN_DOWN, OPEN_UP } from '../../constants'; +import { OPEN_DOWN, OPEN_UP } from '../constants'; const propTypes = forbidExtraProps({ ...withStylesPropTypes, diff --git a/src/components/DateRangePicker.jsx b/src/components/DateRangePicker.jsx index 3d0a7c12fccc7c8125157b4b11420a0bca721af5..ed2451740702edbe80148ac7efc9d1811fec77ee 100644 --- a/src/components/DateRangePicker.jsx +++ b/src/components/DateRangePicker.jsx @@ -32,7 +32,7 @@ import { OPEN_UP, DAY_SIZE, ICON_BEFORE_POSITION, -} from '../../constants'; +} from '../constants'; const propTypes = forbidExtraProps({ ...withStylesPropTypes, diff --git a/src/components/DateRangePickerInput.jsx b/src/components/DateRangePickerInput.jsx index 060f57d56fdb4de6dd188355a651df8431730053..90573028bde4f171917422e57415c124303698f5 100644 --- a/src/components/DateRangePickerInput.jsx +++ b/src/components/DateRangePickerInput.jsx @@ -21,7 +21,7 @@ import { ICON_BEFORE_POSITION, ICON_AFTER_POSITION, OPEN_DOWN, -} from '../../constants'; +} from '../constants'; const propTypes = forbidExtraProps({ ...withStylesPropTypes, diff --git a/src/components/DateRangePickerInputController.jsx b/src/components/DateRangePickerInputController.jsx index d22558037c4ecec3f7a002fcd09c8c1b30836ec1..9892d9da5a6039c9942f96d4a074b04fdfe8b951 100644 --- a/src/components/DateRangePickerInputController.jsx +++ b/src/components/DateRangePickerInputController.jsx @@ -19,7 +19,7 @@ import toLocalizedDateString from '../utils/toLocalizedDateString'; import isInclusivelyAfterDay from '../utils/isInclusivelyAfterDay'; import isBeforeDay from '../utils/isBeforeDay'; -import { START_DATE, END_DATE, ICON_BEFORE_POSITION, OPEN_DOWN } from '../../constants'; +import { START_DATE, END_DATE, ICON_BEFORE_POSITION, OPEN_DOWN } from '../constants'; const propTypes = forbidExtraProps({ startDate: momentPropTypes.momentObj, diff --git a/src/components/DayPicker.jsx b/src/components/DayPicker.jsx index 14fbcefe4a70c5e118a8cd54f62fa6010e36dba0..54dc1b11f81f809563e7ee000d526414fd7257b0 100644 --- a/src/components/DayPicker.jsx +++ b/src/components/DayPicker.jsx @@ -32,7 +32,7 @@ import { VERTICAL_ORIENTATION, VERTICAL_SCROLLABLE, DAY_SIZE, -} from '../../constants'; +} from '../constants'; const MONTH_PADDING = 23; const DAY_PICKER_PADDING = 9; diff --git a/src/components/DayPickerNavigation.jsx b/src/components/DayPickerNavigation.jsx index 2795e2254fd1567577e8c0600e4b5bb1cfc3b483..5bcd3a27a4a9f6896d574c8e4987258888cee120 100644 --- a/src/components/DayPickerNavigation.jsx +++ b/src/components/DayPickerNavigation.jsx @@ -15,7 +15,7 @@ import ScrollableOrientationShape from '../shapes/ScrollableOrientationShape'; import { HORIZONTAL_ORIENTATION, VERTICAL_SCROLLABLE, -} from '../../constants'; +} from '../constants'; const propTypes = forbidExtraProps({ ...withStylesPropTypes, diff --git a/src/components/DayPickerRangeController.jsx b/src/components/DayPickerRangeController.jsx index b3c3c9dc2f0c583b418af9a3f13d99f15c6ee38d..01f96bebfef147831ee9682f82a17138e52b64b8 100644 --- a/src/components/DayPickerRangeController.jsx +++ b/src/components/DayPickerRangeController.jsx @@ -31,7 +31,7 @@ import { HORIZONTAL_ORIENTATION, VERTICAL_SCROLLABLE, DAY_SIZE, -} from '../../constants'; +} from '../constants'; import DayPicker from './DayPicker'; diff --git a/src/components/DayPickerSingleDateController.jsx b/src/components/DayPickerSingleDateController.jsx index 3808951c165671dee08646ab2a6b823746470216..0e28733c0fb9a696fb41764d74e1b459f52edf64 100644 --- a/src/components/DayPickerSingleDateController.jsx +++ b/src/components/DayPickerSingleDateController.jsx @@ -25,7 +25,7 @@ import { HORIZONTAL_ORIENTATION, VERTICAL_SCROLLABLE, DAY_SIZE, -} from '../../constants'; +} from '../constants'; import DayPicker from './DayPicker'; import OutsideClickHandler from './OutsideClickHandler'; diff --git a/src/components/SingleDatePicker.jsx b/src/components/SingleDatePicker.jsx index ca455f76254c101931562f60cd068ed33b273df7..4f03949d6928d153b3470c8a77b336f9d9dbe6d8 100644 --- a/src/components/SingleDatePicker.jsx +++ b/src/components/SingleDatePicker.jsx @@ -30,7 +30,7 @@ import { OPEN_UP, DAY_SIZE, ICON_BEFORE_POSITION, -} from '../../constants'; +} from '../constants'; const propTypes = forbidExtraProps({ ...withStylesPropTypes, diff --git a/src/components/SingleDatePickerInput.jsx b/src/components/SingleDatePickerInput.jsx index 44acd2efce8a321c904ffdd83c2f6741ade8994e..6b0b4d18d51637a34126a33b556adb7ef17271a5 100644 --- a/src/components/SingleDatePickerInput.jsx +++ b/src/components/SingleDatePickerInput.jsx @@ -13,7 +13,7 @@ import CloseButton from './CloseButton'; import CalendarIcon from './CalendarIcon'; import openDirectionShape from '../shapes/OpenDirectionShape'; -import { ICON_BEFORE_POSITION, ICON_AFTER_POSITION, OPEN_DOWN } from '../../constants'; +import { ICON_BEFORE_POSITION, ICON_AFTER_POSITION, OPEN_DOWN } from '../constants'; const propTypes = forbidExtraProps({ ...withStylesPropTypes, diff --git a/src/constants.js b/src/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..c41193d17386e8e7f23fc48ad28419419ed84276 --- /dev/null +++ b/src/constants.js @@ -0,0 +1,23 @@ +export const DISPLAY_FORMAT = 'L'; +export const ISO_FORMAT = 'YYYY-MM-DD'; +export const ISO_MONTH_FORMAT = 'YYYY-MM'; + +export const START_DATE = 'startDate'; +export const END_DATE = 'endDate'; + +export const HORIZONTAL_ORIENTATION = 'horizontal'; +export const VERTICAL_ORIENTATION = 'vertical'; +export const VERTICAL_SCROLLABLE = 'verticalScrollable'; + +export const ICON_BEFORE_POSITION = 'before'; +export const ICON_AFTER_POSITION = 'after'; + +export const ANCHOR_LEFT = 'left'; +export const ANCHOR_RIGHT = 'right'; + +export const OPEN_DOWN = 'down'; +export const OPEN_UP = 'up'; + +export const DAY_SIZE = 39; +export const BLOCKED_MODIFIER = 'blocked'; +export const WEEKDAYS = [0, 1, 2, 3, 4, 5, 6]; diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e94529f3f9f22bf71f4278340f2b6e1b04877d79 --- /dev/null +++ b/src/index.js @@ -0,0 +1,20 @@ +export { default as CalendarDay } from './components/CalendarDay'; +export { default as CalendarMonth } from './components/CalendarMonth'; +export { default as CalendarMonthGrid } from './components/CalendarMonthGrid'; +export { default as DateRangePicker } from './components/DateRangePicker'; +export { default as DateRangePickerInput } from './components/DateRangePickerInput'; +export { default as DateRangePickerInputController } from './components/DateRangePickerInputController'; +export { default as DateRangePickerShape } from './shapes/DateRangePickerShape'; +export { default as DayPicker } from './components/DayPicker'; +export { default as DayPickerRangeController } from './components/DayPickerRangeController'; +export { default as DayPickerSingleDateController } from './components/DayPickerSingleDateController'; +export { default as SingleDatePicker } from './components/SingleDatePicker'; +export { default as SingleDatePickerInput } from './components/SingleDatePickerInput'; +export { default as SingleDatePickerShape } from './shapes/SingleDatePickerShape'; +export { default as isInclusivelyAfterDay } from './utils/isInclusivelyAfterDay'; +export { default as isInclusivelyBeforeDay } from './utils/isInclusivelyBeforeDay'; +export { default as isNextDay } from './utils/isNextDay'; +export { default as isSameDay } from './utils/isSameDay'; +export { default as toISODateString } from './utils/toISODateString'; +export { default as toLocalizedDateString } from './utils/toLocalizedDateString'; +export { default as toMomentObject } from './utils/toMomentObject'; diff --git a/src/initialize.js b/src/initialize.js new file mode 100644 index 0000000000000000000000000000000000000000..9b3570710f2cb65aa5af10a6007c12507d095e89 --- /dev/null +++ b/src/initialize.js @@ -0,0 +1,3 @@ +import registerCSSInterfaceWithDefaultTheme from './utils/registerCSSInterfaceWithDefaultTheme'; + +registerCSSInterfaceWithDefaultTheme(); diff --git a/src/shapes/AnchorDirectionShape.js b/src/shapes/AnchorDirectionShape.js index 91834507635e29a0b592460aefeb1f1135d7d9eb..5bfdbe659e804f42f2195d08956ec735a51e761c 100644 --- a/src/shapes/AnchorDirectionShape.js +++ b/src/shapes/AnchorDirectionShape.js @@ -3,6 +3,6 @@ import PropTypes from 'prop-types'; import { ANCHOR_LEFT, ANCHOR_RIGHT, -} from '../../constants'; +} from '../constants'; export default PropTypes.oneOf([ANCHOR_LEFT, ANCHOR_RIGHT]); diff --git a/src/shapes/DayOfWeekShape.js b/src/shapes/DayOfWeekShape.js index 7a7b087223390634ee8ca026e12350c3e9822441..39516d92d28e67e63184782a1f1e35ed1395e639 100644 --- a/src/shapes/DayOfWeekShape.js +++ b/src/shapes/DayOfWeekShape.js @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import { WEEKDAYS } from '../../constants'; +import { WEEKDAYS } from '../constants'; export default PropTypes.oneOf(WEEKDAYS); diff --git a/src/shapes/FocusedInputShape.js b/src/shapes/FocusedInputShape.js index 76e54115ef4257351b99f1654d12f3786ad5cd4a..db3a37cf55768e037716a6bcc0cfad924db3690f 100644 --- a/src/shapes/FocusedInputShape.js +++ b/src/shapes/FocusedInputShape.js @@ -3,6 +3,6 @@ import PropTypes from 'prop-types'; import { START_DATE, END_DATE, -} from '../../constants'; +} from '../constants'; export default PropTypes.oneOf([START_DATE, END_DATE]); diff --git a/src/shapes/IconPositionShape.js b/src/shapes/IconPositionShape.js index 0fc7aeed2bcc0c7f6acce44fbb9cdd04f5f94655..a9c536235c0f757c42ed04a72b217a3fa53baa4a 100644 --- a/src/shapes/IconPositionShape.js +++ b/src/shapes/IconPositionShape.js @@ -3,6 +3,6 @@ import PropTypes from 'prop-types'; import { ICON_BEFORE_POSITION, ICON_AFTER_POSITION, -} from '../../constants'; +} from '../constants'; export default PropTypes.oneOf([ICON_BEFORE_POSITION, ICON_AFTER_POSITION]); diff --git a/src/shapes/OpenDirectionShape.js b/src/shapes/OpenDirectionShape.js index da90c87df18ddea77bdbfefc8ce7c77ac8d303e1..204c2351037d99ba3092847c5eb2809533709276 100644 --- a/src/shapes/OpenDirectionShape.js +++ b/src/shapes/OpenDirectionShape.js @@ -3,6 +3,6 @@ import PropTypes from 'prop-types'; import { OPEN_DOWN, OPEN_UP, -} from '../../constants'; +} from '../constants'; export default PropTypes.oneOf([OPEN_DOWN, OPEN_UP]); diff --git a/src/shapes/OrientationShape.js b/src/shapes/OrientationShape.js index 512302ef389729d919d0ee6c490c1824f2629e13..b112529d1149ba1431cf1ca8d8773d0a60b65a4d 100644 --- a/src/shapes/OrientationShape.js +++ b/src/shapes/OrientationShape.js @@ -3,6 +3,6 @@ import PropTypes from 'prop-types'; import { HORIZONTAL_ORIENTATION, VERTICAL_ORIENTATION, -} from '../../constants'; +} from '../constants'; export default PropTypes.oneOf([HORIZONTAL_ORIENTATION, VERTICAL_ORIENTATION]); diff --git a/src/shapes/ScrollableOrientationShape.js b/src/shapes/ScrollableOrientationShape.js index 844a3580dda17d83b70cb284dfcd162e1b22813e..b42626128decba0ae04db568e4e597fd78d93d87 100644 --- a/src/shapes/ScrollableOrientationShape.js +++ b/src/shapes/ScrollableOrientationShape.js @@ -4,7 +4,7 @@ import { HORIZONTAL_ORIENTATION, VERTICAL_ORIENTATION, VERTICAL_SCROLLABLE, -} from '../../constants'; +} from '../constants'; export default PropTypes.oneOf([ HORIZONTAL_ORIENTATION, diff --git a/src/utils/getCalendarMonthWeeks.js b/src/utils/getCalendarMonthWeeks.js index fef9abe77cfe3bef7f37e798095363c144f3efbd..47b5bb25c966b17d5b873a33b5048efa61b3db41 100644 --- a/src/utils/getCalendarMonthWeeks.js +++ b/src/utils/getCalendarMonthWeeks.js @@ -1,6 +1,6 @@ import moment from 'moment'; -import { WEEKDAYS } from '../../constants'; +import { WEEKDAYS } from '../constants'; export default function getCalendarMonthWeeks( month, diff --git a/src/utils/getResponsiveContainerStyles.js b/src/utils/getResponsiveContainerStyles.js index 6ebb17cb6cb24ee1bf95964e9c4933311028231a..94e642b3d73e332620fd6f79429dc9136b6c4856 100644 --- a/src/utils/getResponsiveContainerStyles.js +++ b/src/utils/getResponsiveContainerStyles.js @@ -1,4 +1,4 @@ -import { ANCHOR_LEFT } from '../../constants'; +import { ANCHOR_LEFT } from '../constants'; export default function getResponsiveContainerStyles( anchorDirection, diff --git a/src/utils/toISODateString.js b/src/utils/toISODateString.js index b3da6484a78baface49dafb63ea93518585f2301..de3cd5ac6b7b3f728a38ae9e3cef6c65c3a235c7 100644 --- a/src/utils/toISODateString.js +++ b/src/utils/toISODateString.js @@ -2,7 +2,7 @@ import moment from 'moment'; import toMomentObject from './toMomentObject'; -import { ISO_FORMAT } from '../../constants'; +import { ISO_FORMAT } from '../constants'; export default function toISODateString(date, currentFormat) { const dateObj = moment.isMoment(date) ? date : toMomentObject(date, currentFormat); diff --git a/src/utils/toISOMonthString.js b/src/utils/toISOMonthString.js index 9845074c746d8b0384a3cb7eb27100773a258af3..d024d51c5bd479bfe0f23293d3b9f6273093aab5 100644 --- a/src/utils/toISOMonthString.js +++ b/src/utils/toISOMonthString.js @@ -2,7 +2,7 @@ import moment from 'moment'; import toMomentObject from './toMomentObject'; -import { ISO_MONTH_FORMAT } from '../../constants'; +import { ISO_MONTH_FORMAT } from '../constants'; export default function toISOMonthString(date, currentFormat) { const dateObj = moment.isMoment(date) ? date : toMomentObject(date, currentFormat); diff --git a/src/utils/toLocalizedDateString.js b/src/utils/toLocalizedDateString.js index d83ec64483c4c65723a70716e1b3caa3c6cd54f3..e6e9e3e23c83a9bb4cc489780e9dd7acea967517 100644 --- a/src/utils/toLocalizedDateString.js +++ b/src/utils/toLocalizedDateString.js @@ -2,7 +2,7 @@ import moment from 'moment'; import toMomentObject from './toMomentObject'; -import { DISPLAY_FORMAT } from '../../constants'; +import { DISPLAY_FORMAT } from '../constants'; export default function toLocalizedDateString(date, currentFormat) { const dateObj = moment.isMoment(date) ? date : toMomentObject(date, currentFormat); diff --git a/src/utils/toMomentObject.js b/src/utils/toMomentObject.js index 51ab2a13079f4f426c9bddf01e944911f91f4d7f..261922e58e4ba0fb89c42c9cf3b8751edb2217c8 100644 --- a/src/utils/toMomentObject.js +++ b/src/utils/toMomentObject.js @@ -1,6 +1,6 @@ import moment from 'moment'; -import { DISPLAY_FORMAT, ISO_FORMAT } from '../../constants'; +import { DISPLAY_FORMAT, ISO_FORMAT } from '../constants'; export default function toMomentObject(dateString, customFormat) { const dateFormats = customFormat ? diff --git a/test/components/CalendarDay_spec.jsx b/test/components/CalendarDay_spec.jsx index 30749777010cfa7fc2f580032f3039ef66174c73..77da4b3f35d280601af707abe17f9996fbd36b93 100644 --- a/test/components/CalendarDay_spec.jsx +++ b/test/components/CalendarDay_spec.jsx @@ -4,7 +4,7 @@ import sinon from 'sinon-sandbox'; import { shallow } from 'enzyme'; import moment from 'moment'; -import { BLOCKED_MODIFIER } from '../../constants'; +import { BLOCKED_MODIFIER } from '../../src/constants'; import CalendarDay, { PureCalendarDay } from '../../src/components/CalendarDay'; describe('CalendarDay', () => { diff --git a/test/components/DateRangePickerInputController_spec.jsx b/test/components/DateRangePickerInputController_spec.jsx index a68f78cdf0777ea6ab1c7705251c81a736d1e8dc..79fae574bbad8256a151612ca2c993b5e68630fc 100644 --- a/test/components/DateRangePickerInputController_spec.jsx +++ b/test/components/DateRangePickerInputController_spec.jsx @@ -14,7 +14,7 @@ import isSameDay from '../../src/utils/isSameDay'; import { START_DATE, END_DATE, -} from '../../constants'; +} from '../../src/constants'; // Set to noon to mimic how days in the picker are configured internally const today = moment().startOf('day').hours(12); diff --git a/test/components/DateRangePicker_spec.jsx b/test/components/DateRangePicker_spec.jsx index 3c0a9a24121f4dddbf7d5cda5d86ae01008a74bc..5cb2c64ecd49ec714a4ece05f21eb6bce29fef79 100644 --- a/test/components/DateRangePicker_spec.jsx +++ b/test/components/DateRangePicker_spec.jsx @@ -13,7 +13,7 @@ import DayPickerRangeController from '../../src/components/DayPickerRangeControl import { HORIZONTAL_ORIENTATION, START_DATE, -} from '../../constants'; +} from '../../src/constants'; const requiredProps = { onDatesChange: () => {}, diff --git a/test/components/DayPickerNavigation_spec.jsx b/test/components/DayPickerNavigation_spec.jsx index 506a2c5571f8429f7c62a89338205a19fedad14c..e11b49ee22f5a9f45b787aa35d3c9d4cb50e0587 100644 --- a/test/components/DayPickerNavigation_spec.jsx +++ b/test/components/DayPickerNavigation_spec.jsx @@ -6,7 +6,7 @@ import { shallow } from 'enzyme'; import DayPickerNavigation from '../../src/components/DayPickerNavigation'; import { VERTICAL_SCROLLABLE, -} from '../../constants'; +} from '../../src/constants'; describe('DayPickerNavigation', () => { describe('#render', () => { diff --git a/test/components/DayPickerRangeController_spec.jsx b/test/components/DayPickerRangeController_spec.jsx index f37abe96ce0d96fb5a1d54d4ebb242be6b11d35c..0cf38ff72529eed8887d6aeba1e4c3d55186e858 100644 --- a/test/components/DayPickerRangeController_spec.jsx +++ b/test/components/DayPickerRangeController_spec.jsx @@ -15,7 +15,7 @@ import isSameDay from '../../src/utils/isSameDay'; import * as isDayVisible from '../../src/utils/isDayVisible'; import getVisibleDays from '../../src/utils/getVisibleDays'; -import { START_DATE, END_DATE } from '../../constants'; +import { START_DATE, END_DATE } from '../../src/constants'; // Set to noon to mimic how days in the picker are configured internally const today = moment().startOf('day').hours(12); diff --git a/test/components/DayPicker_spec.jsx b/test/components/DayPicker_spec.jsx index 4c5c1d7f95f3e24d8062e7bbbdb4dc87bd17165e..2aa3dc1a373ecdef3b5484fa8c180295abb1b33c 100644 --- a/test/components/DayPicker_spec.jsx +++ b/test/components/DayPicker_spec.jsx @@ -14,7 +14,7 @@ import { HORIZONTAL_ORIENTATION, VERTICAL_ORIENTATION, VERTICAL_SCROLLABLE, -} from '../../constants'; +} from '../../src/constants'; const today = moment(); const event = { preventDefault() {}, stopPropagation() {} }; diff --git a/test/utils/getResponsiveContainerStyles_spec.js b/test/utils/getResponsiveContainerStyles_spec.js index ad5f449ef9bf67e78dc47f6bb9cc913853f5b874..07a2908d45d59cb9b5c41d3158ce7611793f2090 100644 --- a/test/utils/getResponsiveContainerStyles_spec.js +++ b/test/utils/getResponsiveContainerStyles_spec.js @@ -3,7 +3,7 @@ import wrap from 'mocha-wrap'; import getResponsiveContainerStyles from '../../src/utils/getResponsiveContainerStyles'; -import { ANCHOR_LEFT, ANCHOR_RIGHT } from '../../constants'; +import { ANCHOR_LEFT, ANCHOR_RIGHT } from '../../src/constants'; const describeUnlessWindow = typeof window === 'undefined' ? describe : describe.skip; diff --git a/test/utils/toISODateString_spec.js b/test/utils/toISODateString_spec.js index fdcb92879046837a0c886acad508b102b63012a2..d089c8c0e10e65c2262526b45bb8f350858c5029 100644 --- a/test/utils/toISODateString_spec.js +++ b/test/utils/toISODateString_spec.js @@ -2,7 +2,7 @@ import moment from 'moment'; import { expect } from 'chai'; import toISODateString from '../../src/utils/toISODateString'; -import { ISO_FORMAT } from '../../constants'; +import { ISO_FORMAT } from '../../src/constants'; describe('toISODateString', () => { it('returns null for falsy argument', () => { diff --git a/test/utils/toISOMonthString_spec.js b/test/utils/toISOMonthString_spec.js index a83c5ecbf0320c3c339a854bf02fcb9b520510c6..943eaf2c7fc1236002e1460a30a8a65736323be8 100644 --- a/test/utils/toISOMonthString_spec.js +++ b/test/utils/toISOMonthString_spec.js @@ -1,7 +1,7 @@ import moment from 'moment'; import { expect } from 'chai'; -import { ISO_FORMAT, ISO_MONTH_FORMAT } from '../../constants'; +import { ISO_FORMAT, ISO_MONTH_FORMAT } from '../../src/constants'; import toISOMonthString from '../../src/utils/toISOMonthString'; describe('#toISOMonthString', () => { diff --git a/test/utils/toLocalizedDateString_spec.js b/test/utils/toLocalizedDateString_spec.js index 134e104d59b192dbd8a11fdbc94a5e6d732874ea..4bfbcde454d6347e7cca878f4418bb24edef3230 100644 --- a/test/utils/toLocalizedDateString_spec.js +++ b/test/utils/toLocalizedDateString_spec.js @@ -2,7 +2,7 @@ import moment from 'moment'; import { expect } from 'chai'; import toLocalizedDateString from '../../src/utils/toLocalizedDateString'; -import { ISO_FORMAT } from '../../constants'; +import { ISO_FORMAT } from '../../src/constants'; describe('toLocalizedDateString', () => { it('returns null for falsy argument', () => {