diff --git a/src/DayPicker.tsx b/src/DayPicker.tsx index 890bfb448c..b8c569ff47 100644 --- a/src/DayPicker.tsx +++ b/src/DayPicker.tsx @@ -1,7 +1,7 @@ -import { DayPickerDefaultProps } from "types/DayPickerDefault"; -import { DayPickerMultipleProps } from "types/DayPickerMultiple"; -import { DayPickerRangeProps } from "types/DayPickerRange"; -import { DayPickerSingleProps } from "types/DayPickerSingle"; +import { DayPickerDefaultProps } from "./types/DayPickerDefault"; +import { DayPickerMultipleProps } from "./types/DayPickerMultiple"; +import { DayPickerRangeProps } from "./types/DayPickerRange"; +import { DayPickerSingleProps } from "./types/DayPickerSingle"; import { Root } from "./components/Root"; import { RootProvider } from "./contexts/RootProvider"; diff --git a/src/components/Button/Button.test.tsx b/src/components/Button/Button.test.tsx index 4be62c1348..b69784f7be 100644 --- a/src/components/Button/Button.test.tsx +++ b/src/components/Button/Button.test.tsx @@ -1,6 +1,6 @@ import { screen } from "@testing-library/react"; -import { customRender } from "test/render"; +import { customRender } from "../../../test/render"; import { Button } from "./Button"; diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index dc69e5d838..b874c3871f 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -1,6 +1,6 @@ import { forwardRef } from "react"; -import { useDayPicker } from "contexts/DayPicker"; +import { useDayPicker } from "../../contexts/DayPicker"; /** The props for the {@link Button} component. */ export type ButtonProps = JSX.IntrinsicElements["button"]; diff --git a/src/components/Caption/Caption.test.tsx b/src/components/Caption/Caption.test.tsx index 68253211fe..a063454813 100644 --- a/src/components/Caption/Caption.test.tsx +++ b/src/components/Caption/Caption.test.tsx @@ -1,7 +1,7 @@ import { screen } from "@testing-library/react"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render"; +import { customRender } from "../../../test/render"; import { getMonthCaption, getMonthDropdown, @@ -10,10 +10,10 @@ import { getYearDropdown, queryNextButton, queryPrevButton -} from "test/selectors"; -import { freezeBeforeAll } from "test/utils"; +} from "../../../test/selectors"; +import { freezeBeforeAll } from "../../../test/utils"; -import { CustomComponents } from "types/DayPickerBase"; +import { CustomComponents } from "../../types/DayPickerBase"; import { Caption, CaptionProps } from "./Caption"; diff --git a/src/components/Caption/Caption.tsx b/src/components/Caption/Caption.tsx index 904ab43111..7236063b73 100644 --- a/src/components/Caption/Caption.tsx +++ b/src/components/Caption/Caption.tsx @@ -1,7 +1,7 @@ -import { CaptionDropdowns } from "components/CaptionDropdowns"; -import { CaptionLabel } from "components/CaptionLabel"; -import { CaptionNavigation } from "components/CaptionNavigation"; -import { useDayPicker } from "contexts/DayPicker"; +import { CaptionDropdowns } from "../../components/CaptionDropdowns"; +import { CaptionLabel } from "../../components/CaptionLabel"; +import { CaptionNavigation } from "../../components/CaptionNavigation"; +import { useDayPicker } from "../../contexts/DayPicker"; /** Represent the props of the {@link Caption} component. */ export interface CaptionProps { diff --git a/src/components/CaptionDropdowns/CaptionDropdowns.test.tsx b/src/components/CaptionDropdowns/CaptionDropdowns.test.tsx index 1537fc858f..2844cb868d 100644 --- a/src/components/CaptionDropdowns/CaptionDropdowns.test.tsx +++ b/src/components/CaptionDropdowns/CaptionDropdowns.test.tsx @@ -1,19 +1,19 @@ import { screen } from "@testing-library/react"; import { setMonth, setYear } from "date-fns"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render"; +import { customRender } from "../../../test/render"; import { getMonthDropdown, getYearDropdown, queryMonthDropdown, queryYearDropdown -} from "test/selectors"; -import { user } from "test/user"; -import { freezeBeforeAll } from "test/utils"; +} from "../../../test/selectors"; +import { user } from "../../../test/user"; +import { freezeBeforeAll } from "../../../test/utils"; -import { CaptionProps } from "components/Caption"; -import { CustomComponents } from "types/DayPickerBase"; +import { CaptionProps } from "../../components/Caption"; +import { CustomComponents } from "../../types/DayPickerBase"; import { CaptionDropdowns } from "./CaptionDropdowns"; diff --git a/src/components/CaptionDropdowns/CaptionDropdowns.tsx b/src/components/CaptionDropdowns/CaptionDropdowns.tsx index 2ba575e52c..bcd72e92f4 100644 --- a/src/components/CaptionDropdowns/CaptionDropdowns.tsx +++ b/src/components/CaptionDropdowns/CaptionDropdowns.tsx @@ -1,12 +1,12 @@ import { addMonths } from "date-fns"; -import { CaptionProps } from "components/Caption/Caption"; -import { CaptionLabel } from "components/CaptionLabel"; -import { MonthsDropdown } from "components/MonthsDropdown"; -import { YearsDropdown } from "components/YearsDropdown"; -import { useDayPicker } from "contexts/DayPicker"; -import { useNavigation } from "contexts/Navigation"; -import { MonthChangeEventHandler } from "types/EventHandlers"; +import { CaptionProps } from "../../components/Caption/Caption"; +import { CaptionLabel } from "../../components/CaptionLabel"; +import { MonthsDropdown } from "../../components/MonthsDropdown"; +import { YearsDropdown } from "../../components/YearsDropdown"; +import { useDayPicker } from "../../contexts/DayPicker"; +import { useNavigation } from "../../contexts/Navigation"; +import { MonthChangeEventHandler } from "../../types/EventHandlers"; /** Render a caption with the dropdowns to navigate between months and years. */ export function CaptionDropdowns(props: CaptionProps): JSX.Element { diff --git a/src/components/CaptionLabel/CaptionLabel.test.tsx b/src/components/CaptionLabel/CaptionLabel.test.tsx index 0bf2877c75..5c8290f1b2 100644 --- a/src/components/CaptionLabel/CaptionLabel.test.tsx +++ b/src/components/CaptionLabel/CaptionLabel.test.tsx @@ -1,6 +1,6 @@ -import { customRender } from "test/render"; -import { getMonthCaption } from "test/selectors"; -import { freezeBeforeAll } from "test/utils"; +import { customRender } from "../../../test/render"; +import { getMonthCaption } from "../../../test/selectors"; +import { freezeBeforeAll } from "../../../test/utils"; import { CaptionLabel } from "./CaptionLabel"; diff --git a/src/components/CaptionLabel/CaptionLabel.tsx b/src/components/CaptionLabel/CaptionLabel.tsx index d71b923e4c..a0c30d5345 100644 --- a/src/components/CaptionLabel/CaptionLabel.tsx +++ b/src/components/CaptionLabel/CaptionLabel.tsx @@ -1,4 +1,4 @@ -import { useDayPicker } from "contexts/DayPicker"; +import { useDayPicker } from "../../contexts/DayPicker"; /** The props for the {@link CaptionLabel} component. */ export interface CaptionLabelProps { diff --git a/src/components/CaptionNavigation/CaptionNavigation.test.tsx b/src/components/CaptionNavigation/CaptionNavigation.test.tsx index 6a8d6c3bd4..d12e2b3125 100644 --- a/src/components/CaptionNavigation/CaptionNavigation.test.tsx +++ b/src/components/CaptionNavigation/CaptionNavigation.test.tsx @@ -1,15 +1,15 @@ import { addMonths } from "date-fns"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render"; +import { customRender } from "../../../test/render"; import { getNextButton, getPrevButton, queryNextButton, queryPrevButton -} from "test/selectors"; -import { user } from "test/user"; -import { freezeBeforeAll } from "test/utils"; +} from "../../../test/selectors"; +import { user } from "../../../test/user"; +import { freezeBeforeAll } from "../../../test/utils"; import { CaptionNavigation } from "./CaptionNavigation"; diff --git a/src/components/CaptionNavigation/CaptionNavigation.tsx b/src/components/CaptionNavigation/CaptionNavigation.tsx index 498193db27..8e0a07d7bb 100644 --- a/src/components/CaptionNavigation/CaptionNavigation.tsx +++ b/src/components/CaptionNavigation/CaptionNavigation.tsx @@ -2,10 +2,10 @@ import { MouseEventHandler } from "react"; import { isSameMonth } from "date-fns"; -import { CaptionProps } from "components/Caption/Caption"; -import { Navigation } from "components/Navigation"; -import { useDayPicker } from "contexts/DayPicker"; -import { useNavigation } from "contexts/Navigation"; +import { CaptionProps } from "../../components/Caption/Caption"; +import { Navigation } from "../../components/Navigation"; +import { useDayPicker } from "../../contexts/DayPicker"; +import { useNavigation } from "../../contexts/Navigation"; /** Render a caption with a button-based navigation. */ export function CaptionNavigation(props: CaptionProps): JSX.Element { diff --git a/src/components/Day/Day.test.tsx b/src/components/Day/Day.test.tsx index c3eddf4d7b..626af13c95 100644 --- a/src/components/Day/Day.test.tsx +++ b/src/components/Day/Day.test.tsx @@ -1,10 +1,10 @@ import { screen } from "@testing-library/react"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render"; -import { freezeBeforeAll } from "test/utils"; +import { customRender } from "../../../test/render"; +import { freezeBeforeAll } from "../../../test/utils"; -import { CustomComponents } from "types/DayPickerBase"; +import { CustomComponents } from "../../types/DayPickerBase"; import { Day, DayProps } from "./Day"; diff --git a/src/components/Day/Day.tsx b/src/components/Day/Day.tsx index ea5721c0c4..be21ea4fb9 100644 --- a/src/components/Day/Day.tsx +++ b/src/components/Day/Day.tsx @@ -1,6 +1,6 @@ import { useRef } from "react"; -import { useDayRender } from "hooks/useDayRender"; +import { useDayRender } from "../../hooks/useDayRender"; import { Button } from "../Button"; diff --git a/src/components/DayContent/DayContent.test.tsx b/src/components/DayContent/DayContent.test.tsx index 3987a059dd..4c446e1800 100644 --- a/src/components/DayContent/DayContent.test.tsx +++ b/src/components/DayContent/DayContent.test.tsx @@ -1,10 +1,10 @@ import { es } from "date-fns/locale"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render"; -import { freezeBeforeAll } from "test/utils"; +import { customRender } from "../../../test/render"; +import { freezeBeforeAll } from "../../../test/utils"; -import { DayContent, DayContentProps } from "components/DayContent"; +import { DayContent, DayContentProps } from "../../components/DayContent"; const today = new Date(2021, 8); diff --git a/src/components/DayContent/DayContent.tsx b/src/components/DayContent/DayContent.tsx index 2109a515f4..7ac508fcc6 100644 --- a/src/components/DayContent/DayContent.tsx +++ b/src/components/DayContent/DayContent.tsx @@ -1,5 +1,5 @@ -import { useDayPicker } from "contexts/DayPicker"; -import { ActiveModifiers } from "types/Modifiers"; +import { useDayPicker } from "../../contexts/DayPicker"; +import { ActiveModifiers } from "../../types/Modifiers"; /** Represent the props for the {@link DayContent} component. */ export interface DayContentProps { diff --git a/src/components/Dropdown/Dropdown.test.tsx b/src/components/Dropdown/Dropdown.test.tsx index 41e6434515..b7e70251e8 100644 --- a/src/components/Dropdown/Dropdown.test.tsx +++ b/src/components/Dropdown/Dropdown.test.tsx @@ -1,12 +1,12 @@ import { fireEvent, screen } from "@testing-library/react"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render"; -import { freezeBeforeAll } from "test/utils"; +import { customRender } from "../../../test/render"; +import { freezeBeforeAll } from "../../../test/utils"; -import { Dropdown, DropdownProps } from "components/Dropdown"; -import { defaultClassNames } from "contexts/DayPicker/defaultClassNames"; -import { CustomComponents } from "types/DayPickerBase"; +import { Dropdown, DropdownProps } from "../../components/Dropdown"; +import { defaultClassNames } from "../../contexts/DayPicker/defaultClassNames"; +import { CustomComponents } from "../../types/DayPickerBase"; const today = new Date(2021, 8); diff --git a/src/components/Dropdown/Dropdown.tsx b/src/components/Dropdown/Dropdown.tsx index 41db8f64b8..3c9a590587 100644 --- a/src/components/Dropdown/Dropdown.tsx +++ b/src/components/Dropdown/Dropdown.tsx @@ -5,8 +5,8 @@ import { SelectHTMLAttributes } from "react"; -import { IconDropdown } from "components/IconDropdown"; -import { useDayPicker } from "contexts/DayPicker"; +import { IconDropdown } from "../../components/IconDropdown"; +import { useDayPicker } from "../../contexts/DayPicker"; /** The props for the {@link Dropdown} component. */ export interface DropdownProps { diff --git a/src/components/Footer/Footer.test.tsx b/src/components/Footer/Footer.test.tsx index 111590d570..342a3d8ee8 100644 --- a/src/components/Footer/Footer.test.tsx +++ b/src/components/Footer/Footer.test.tsx @@ -1,5 +1,5 @@ -import { customRender } from "test/render"; -import { getTableFooter, queryTableFooter } from "test/selectors"; +import { customRender } from "../../../test/render"; +import { getTableFooter, queryTableFooter } from "../../../test/selectors"; import { Footer } from "./Footer"; diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index 0648c5dce6..c16a5e36f0 100644 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -1,4 +1,4 @@ -import { useDayPicker } from "contexts/DayPicker"; +import { useDayPicker } from "../../contexts/DayPicker"; export interface FooterProps { /** The month where the footer is displayed. */ diff --git a/src/components/Head/Head.test.tsx b/src/components/Head/Head.test.tsx index bdead37b03..235211eef8 100644 --- a/src/components/Head/Head.test.tsx +++ b/src/components/Head/Head.test.tsx @@ -1,7 +1,7 @@ import { RenderResult, screen } from "@testing-library/react"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render"; +import { customRender } from "../../../test/render"; import { Head } from "./Head"; diff --git a/src/components/Head/Head.tsx b/src/components/Head/Head.tsx index 823ebad18a..7333f7cc8f 100644 --- a/src/components/Head/Head.tsx +++ b/src/components/Head/Head.tsx @@ -1,5 +1,5 @@ -import { HeadRow } from "components/HeadRow"; -import { useDayPicker } from "contexts/DayPicker"; +import { HeadRow } from "../../components/HeadRow"; +import { useDayPicker } from "../../contexts/DayPicker"; /** Render the table head. */ export function Head(): JSX.Element { diff --git a/src/components/HeadRow/HeadRow.test.tsx b/src/components/HeadRow/HeadRow.test.tsx index 54d5299f99..013bb6c0b3 100644 --- a/src/components/HeadRow/HeadRow.test.tsx +++ b/src/components/HeadRow/HeadRow.test.tsx @@ -1,7 +1,7 @@ import { RenderResult } from "@testing-library/react"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render"; +import { customRender } from "../../../test/render"; import { HeadRow } from "./HeadRow"; diff --git a/src/components/HeadRow/HeadRow.tsx b/src/components/HeadRow/HeadRow.tsx index 6a6ec589d6..13e62ea5e4 100644 --- a/src/components/HeadRow/HeadRow.tsx +++ b/src/components/HeadRow/HeadRow.tsx @@ -1,4 +1,4 @@ -import { useDayPicker } from "contexts/DayPicker"; +import { useDayPicker } from "../../contexts/DayPicker"; import { getWeekdays } from "./utils"; diff --git a/src/components/HeadRow/utils/getWeekdays.test.ts b/src/components/HeadRow/utils/getWeekdays.test.ts index 673606bffd..2bbe50c8e0 100644 --- a/src/components/HeadRow/utils/getWeekdays.test.ts +++ b/src/components/HeadRow/utils/getWeekdays.test.ts @@ -1,6 +1,6 @@ import { es } from "date-fns/locale"; -import { freezeBeforeAll } from "test/utils"; +import { freezeBeforeAll } from "../../../../test/utils"; import { getWeekdays } from "./getWeekdays"; diff --git a/src/components/IconDropdown/IconDropdown.test.tsx b/src/components/IconDropdown/IconDropdown.test.tsx index ce17896566..da90207ef5 100644 --- a/src/components/IconDropdown/IconDropdown.test.tsx +++ b/src/components/IconDropdown/IconDropdown.test.tsx @@ -1,4 +1,4 @@ -import { customRender } from "test/render"; +import { customRender } from "../../../test/render"; import { IconDropdown } from "./IconDropdown"; diff --git a/src/components/IconDropdown/IconDropdown.tsx b/src/components/IconDropdown/IconDropdown.tsx index 53ed442fdc..df4b46471b 100644 --- a/src/components/IconDropdown/IconDropdown.tsx +++ b/src/components/IconDropdown/IconDropdown.tsx @@ -1,4 +1,4 @@ -import { StyledComponent } from "types/Styles"; +import { StyledComponent } from "../../types/Styles"; /** Render the icon in the styled drop-down. */ export function IconDropdown(props: StyledComponent): JSX.Element { diff --git a/src/components/IconLeft/IconLeft.test.tsx b/src/components/IconLeft/IconLeft.test.tsx index ec3a5bc2db..db8a3d32c5 100644 --- a/src/components/IconLeft/IconLeft.test.tsx +++ b/src/components/IconLeft/IconLeft.test.tsx @@ -1,4 +1,4 @@ -import { customRender } from "test/render"; +import { customRender } from "../../../test/render"; import { IconLeft } from "./IconLeft"; diff --git a/src/components/IconLeft/IconLeft.tsx b/src/components/IconLeft/IconLeft.tsx index 9a6999e635..33aed93b5e 100644 --- a/src/components/IconLeft/IconLeft.tsx +++ b/src/components/IconLeft/IconLeft.tsx @@ -1,4 +1,4 @@ -import { StyledComponent } from "types/Styles"; +import { StyledComponent } from "../../types/Styles"; /** Render the "previous month" button in the navigation. */ export function IconLeft(props: StyledComponent): JSX.Element { diff --git a/src/components/IconRight/IconRight.test.tsx b/src/components/IconRight/IconRight.test.tsx index 9a0506741d..2f5fd2c2ed 100644 --- a/src/components/IconRight/IconRight.test.tsx +++ b/src/components/IconRight/IconRight.test.tsx @@ -1,4 +1,4 @@ -import { customRender } from "test/render"; +import { customRender } from "../../../test/render"; import { IconRight } from "./IconRight"; diff --git a/src/components/IconRight/IconRight.tsx b/src/components/IconRight/IconRight.tsx index 4734f94703..dd3ac55c92 100644 --- a/src/components/IconRight/IconRight.tsx +++ b/src/components/IconRight/IconRight.tsx @@ -1,4 +1,4 @@ -import { StyledComponent } from "types/Styles"; +import { StyledComponent } from "../../types/Styles"; /** Render the "next month" button in the navigation. */ export function IconRight(props: StyledComponent): JSX.Element { diff --git a/src/components/Month/Month.test.tsx b/src/components/Month/Month.test.tsx index 5e800724f7..b04e39c734 100644 --- a/src/components/Month/Month.test.tsx +++ b/src/components/Month/Month.test.tsx @@ -1,10 +1,10 @@ import { screen } from "@testing-library/react"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render"; -import { getMonthCaption, getMonthGrid } from "test/selectors"; +import { customRender } from "../../../test/render"; +import { getMonthCaption, getMonthGrid } from "../../../test/selectors"; -import { CustomComponents } from "types/DayPickerBase"; +import { CustomComponents } from "../../types/DayPickerBase"; import { Month, MonthProps } from "./Month"; diff --git a/src/components/Month/Month.tsx b/src/components/Month/Month.tsx index dc60947be4..dc13c31dbf 100644 --- a/src/components/Month/Month.tsx +++ b/src/components/Month/Month.tsx @@ -1,8 +1,8 @@ -import { Caption } from "components/Caption"; -import { Table } from "components/Table"; -import { useDayPicker } from "contexts/DayPicker"; -import { useNavigation } from "contexts/Navigation"; -import { useId } from "hooks/useId"; +import { Caption } from "../../components/Caption"; +import { Table } from "../../components/Table"; +import { useDayPicker } from "../../contexts/DayPicker"; +import { useNavigation } from "../../contexts/Navigation"; +import { useId } from "../../hooks/useId"; /** The props for the {@link Month} component. */ export interface MonthProps { diff --git a/src/components/Months/Months.test.tsx b/src/components/Months/Months.test.tsx index 55d11a147d..8a2755ae04 100644 --- a/src/components/Months/Months.test.tsx +++ b/src/components/Months/Months.test.tsx @@ -1,4 +1,4 @@ -import { customRender } from "test/render"; +import { customRender } from "../../../test/render"; import { Months } from "./Months"; diff --git a/src/components/Months/Months.tsx b/src/components/Months/Months.tsx index 304342acce..2a6e8f010f 100644 --- a/src/components/Months/Months.tsx +++ b/src/components/Months/Months.tsx @@ -1,6 +1,6 @@ import { ReactNode } from "react"; -import { useDayPicker } from "contexts/DayPicker"; +import { useDayPicker } from "../../contexts/DayPicker"; /** The props for the {@link Months} component. */ export type MonthsProps = { children: ReactNode }; diff --git a/src/components/MonthsDropdown/MonthsDropdown.test.tsx b/src/components/MonthsDropdown/MonthsDropdown.test.tsx index f7ac2a3efb..3f07abf9f3 100644 --- a/src/components/MonthsDropdown/MonthsDropdown.test.tsx +++ b/src/components/MonthsDropdown/MonthsDropdown.test.tsx @@ -1,10 +1,10 @@ import { screen } from "@testing-library/react"; import { addMonths, differenceInMonths } from "date-fns"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render"; -import { user } from "test/user"; -import { freezeBeforeAll } from "test/utils"; +import { customRender } from "../../../test/render"; +import { user } from "../../../test/user"; +import { freezeBeforeAll } from "../../../test/utils"; import { MonthsDropdown, MonthsDropdownProps } from "./MonthsDropdown"; diff --git a/src/components/MonthsDropdown/MonthsDropdown.tsx b/src/components/MonthsDropdown/MonthsDropdown.tsx index 908751d9a8..5eeeb0517b 100644 --- a/src/components/MonthsDropdown/MonthsDropdown.tsx +++ b/src/components/MonthsDropdown/MonthsDropdown.tsx @@ -2,9 +2,9 @@ import { ChangeEventHandler } from "react"; import { isSameYear, setMonth, startOfMonth } from "date-fns"; -import { Dropdown } from "components/Dropdown"; -import { useDayPicker } from "contexts/DayPicker"; -import { MonthChangeEventHandler } from "types/EventHandlers"; +import { Dropdown } from "../../components/Dropdown"; +import { useDayPicker } from "../../contexts/DayPicker"; +import { MonthChangeEventHandler } from "../../types/EventHandlers"; /** The props for the {@link MonthsDropdown} component. */ export interface MonthsDropdownProps { diff --git a/src/components/Navigation/Navigation.test.tsx b/src/components/Navigation/Navigation.test.tsx index 57fa617b61..c5538d44db 100644 --- a/src/components/Navigation/Navigation.test.tsx +++ b/src/components/Navigation/Navigation.test.tsx @@ -1,8 +1,8 @@ -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render"; -import { getNextButton, getPrevButton } from "test/selectors"; -import { user } from "test/user"; +import { customRender } from "../../../test/render"; +import { getNextButton, getPrevButton } from "../../../test/selectors"; +import { user } from "../../../test/user"; import { Navigation, NavigationProps } from "./Navigation"; diff --git a/src/components/Navigation/Navigation.tsx b/src/components/Navigation/Navigation.tsx index f6cb1e4015..c434e0a37d 100644 --- a/src/components/Navigation/Navigation.tsx +++ b/src/components/Navigation/Navigation.tsx @@ -1,8 +1,8 @@ import { MouseEventHandler } from "react"; -import { IconLeft } from "components/IconLeft"; -import { IconRight } from "components/IconRight"; -import { useDayPicker } from "contexts/DayPicker"; +import { IconLeft } from "../../components/IconLeft"; +import { IconRight } from "../../components/IconRight"; +import { useDayPicker } from "../../contexts/DayPicker"; import { Button } from "../Button"; diff --git a/src/components/Root/Root.test.tsx b/src/components/Root/Root.test.tsx index 4aeb407b03..a501948d63 100644 --- a/src/components/Root/Root.test.tsx +++ b/src/components/Root/Root.test.tsx @@ -1,14 +1,14 @@ import { RenderResult, screen } from "@testing-library/react"; import { addDays } from "date-fns"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render"; -import { getDayButton, queryMonthGrids } from "test/selectors"; -import { freezeBeforeAll } from "test/utils"; +import { customRender } from "../../../test/render"; +import { getDayButton, queryMonthGrids } from "../../../test/selectors"; +import { freezeBeforeAll } from "../../../test/utils"; -import { MonthsProps } from "components/Months"; -import { defaultClassNames } from "contexts/DayPicker/defaultClassNames"; -import { ClassNames } from "types/Styles"; +import { MonthsProps } from "../../components/Months"; +import { defaultClassNames } from "../../contexts/DayPicker/defaultClassNames"; +import { ClassNames } from "../../types/Styles"; import { Root } from "./Root"; diff --git a/src/components/Root/Root.tsx b/src/components/Root/Root.tsx index 4b13145036..e14af836fc 100644 --- a/src/components/Root/Root.tsx +++ b/src/components/Root/Root.tsx @@ -1,12 +1,12 @@ import { useEffect, useState } from "react"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { Month } from "components/Month"; -import { Months } from "components/Months"; -import { useDayPicker } from "contexts/DayPicker"; -import { useFocusContext } from "contexts/Focus"; -import { useNavigation } from "contexts/Navigation"; +import { Month } from "../../components/Month"; +import { Months } from "../../components/Months"; +import { useDayPicker } from "../../contexts/DayPicker"; +import { useFocusContext } from "../../contexts/Focus"; +import { useNavigation } from "../../contexts/Navigation"; function isDataAttributes(attrs: DayPickerProps): attrs is { [key: string]: string | boolean | number | undefined; diff --git a/src/components/Row/Row.test.tsx b/src/components/Row/Row.test.tsx index 3f61dded4d..20bda14ac3 100644 --- a/src/components/Row/Row.test.tsx +++ b/src/components/Row/Row.test.tsx @@ -1,9 +1,9 @@ import { screen } from "@testing-library/react"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render/customRender"; +import { customRender } from "../../../test/render/customRender"; -import { CustomComponents } from "types/DayPickerBase"; +import { CustomComponents } from "../../types/DayPickerBase"; import { Row, RowProps } from "./Row"; diff --git a/src/components/Row/Row.tsx b/src/components/Row/Row.tsx index 771c5459d5..8a0e3eac28 100644 --- a/src/components/Row/Row.tsx +++ b/src/components/Row/Row.tsx @@ -1,8 +1,8 @@ import { getUnixTime } from "date-fns"; -import { Day } from "components/Day"; -import { WeekNumber } from "components/WeekNumber"; -import { useDayPicker } from "contexts/DayPicker"; +import { Day } from "../../components/Day"; +import { WeekNumber } from "../../components/WeekNumber"; +import { useDayPicker } from "../../contexts/DayPicker"; /** The props for the {@link Row} component. */ export interface RowProps { diff --git a/src/components/Table/Table.test.tsx b/src/components/Table/Table.test.tsx index 60f25c10e5..d384dcca59 100644 --- a/src/components/Table/Table.test.tsx +++ b/src/components/Table/Table.test.tsx @@ -1,9 +1,9 @@ -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render/customRender"; -import { freezeBeforeAll } from "test/utils"; +import { customRender } from "../../../test/render/customRender"; +import { freezeBeforeAll } from "../../../test/utils"; -import { FooterProps } from "components/Footer"; +import { FooterProps } from "../../components/Footer"; import { Table, TableProps } from "./Table"; diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx index 326eeb8178..134ed89d66 100644 --- a/src/components/Table/Table.tsx +++ b/src/components/Table/Table.tsx @@ -1,7 +1,7 @@ -import { Footer } from "components/Footer"; -import { Head } from "components/Head"; -import { Row } from "components/Row"; -import { useDayPicker } from "contexts/DayPicker"; +import { Footer } from "../../components/Footer"; +import { Head } from "../../components/Head"; +import { Row } from "../../components/Row"; +import { useDayPicker } from "../../contexts/DayPicker"; import { getMonthWeeks } from "./utils/getMonthWeeks"; diff --git a/src/components/WeekNumber/WeekNumber.test.tsx b/src/components/WeekNumber/WeekNumber.test.tsx index dd0d0c016f..06adff688e 100644 --- a/src/components/WeekNumber/WeekNumber.test.tsx +++ b/src/components/WeekNumber/WeekNumber.test.tsx @@ -1,8 +1,8 @@ import { screen } from "@testing-library/react"; import { userEvent } from "@testing-library/user-event"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render/customRender"; +import { customRender } from "../../../test/render/customRender"; import { WeekNumber, WeekNumberProps } from "./WeekNumber"; diff --git a/src/components/WeekNumber/WeekNumber.tsx b/src/components/WeekNumber/WeekNumber.tsx index cf64c5639d..2eb5b0c2d9 100644 --- a/src/components/WeekNumber/WeekNumber.tsx +++ b/src/components/WeekNumber/WeekNumber.tsx @@ -1,6 +1,6 @@ import { MouseEventHandler } from "react"; -import { useDayPicker } from "contexts/DayPicker"; +import { useDayPicker } from "../../contexts/DayPicker"; import { Button } from "../Button"; diff --git a/src/components/YearsDropdown/YearsDropdown.test.tsx b/src/components/YearsDropdown/YearsDropdown.test.tsx index 3f53dee2ec..53bcd2e183 100644 --- a/src/components/YearsDropdown/YearsDropdown.test.tsx +++ b/src/components/YearsDropdown/YearsDropdown.test.tsx @@ -1,10 +1,10 @@ import { screen } from "@testing-library/react"; import { addMonths, differenceInYears } from "date-fns"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { customRender } from "test/render"; -import { user } from "test/user"; -import { freezeBeforeAll } from "test/utils"; +import { customRender } from "../../../test/render"; +import { user } from "../../../test/user"; +import { freezeBeforeAll } from "../../../test/utils"; import { YearsDropdown, YearsDropdownProps } from "./YearsDropdown"; diff --git a/src/components/YearsDropdown/YearsDropdown.tsx b/src/components/YearsDropdown/YearsDropdown.tsx index 7c5aff29ce..fc5d5c5868 100644 --- a/src/components/YearsDropdown/YearsDropdown.tsx +++ b/src/components/YearsDropdown/YearsDropdown.tsx @@ -2,9 +2,9 @@ import { ChangeEventHandler } from "react"; import { setYear, startOfMonth, startOfYear } from "date-fns"; -import { Dropdown } from "components/Dropdown"; -import { useDayPicker } from "contexts/DayPicker"; -import { MonthChangeEventHandler } from "types/EventHandlers"; +import { Dropdown } from "../../components/Dropdown"; +import { useDayPicker } from "../../contexts/DayPicker"; +import { MonthChangeEventHandler } from "../../types/EventHandlers"; /** The props for the {@link YearsDropdown} component. */ export interface YearsDropdownProps { diff --git a/src/contexts/DayPicker/DayPickerContext.test.ts b/src/contexts/DayPicker/DayPickerContext.test.ts index 8594cb4a2c..0cd5d996b0 100644 --- a/src/contexts/DayPicker/DayPickerContext.test.ts +++ b/src/contexts/DayPicker/DayPickerContext.test.ts @@ -1,22 +1,22 @@ /* eslint-disable testing-library/render-result-naming-convention */ import { es } from "date-fns/locale"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { renderDayPickerHook } from "test/render"; -import { freezeBeforeAll } from "test/utils"; +import { renderDayPickerHook } from "../../../test/render"; +import { freezeBeforeAll } from "../../../test/utils"; -import { CaptionLayout } from "components/Caption"; -import { DayPickerContextValue, useDayPicker } from "contexts/DayPicker"; +import { CaptionLayout } from "../../components/Caption"; +import { DayPickerContextValue, useDayPicker } from "../../contexts/DayPicker"; import { DefaultContextProps, getDefaultContextValues -} from "contexts/DayPicker/defaultContextValues"; -import { DaySelectionMode } from "types/DayPickerBase"; -import { Formatters } from "types/Formatters"; -import { Labels } from "types/Labels"; -import { DayModifiers, ModifiersClassNames } from "types/Modifiers"; -import { ClassNames, Styles } from "types/Styles"; +} from "../../contexts/DayPicker/defaultContextValues"; +import { DaySelectionMode } from "../../types/DayPickerBase"; +import { Formatters } from "../../types/Formatters"; +import { Labels } from "../../types/Labels"; +import { DayModifiers, ModifiersClassNames } from "../../types/Modifiers"; +import { ClassNames, Styles } from "../../types/Styles"; const today = new Date(2022, 5, 13); const defaults = getDefaultContextValues(); diff --git a/src/contexts/DayPicker/DayPickerContext.tsx b/src/contexts/DayPicker/DayPickerContext.tsx index 19290a5104..f004467c95 100644 --- a/src/contexts/DayPicker/DayPickerContext.tsx +++ b/src/contexts/DayPicker/DayPickerContext.tsx @@ -1,21 +1,27 @@ import { createContext, ReactNode, useContext } from "react"; import { Locale } from "date-fns"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { CaptionLayout } from "components/Caption"; -import { DayPickerBase, DaySelectionMode } from "types/DayPickerBase"; +import { CaptionLayout } from "../../components/Caption"; +import { DayPickerBase, DaySelectionMode } from "../../types/DayPickerBase"; import { DayPickerMultipleProps, isDayPickerMultiple -} from "types/DayPickerMultiple"; -import { DayPickerRangeProps, isDayPickerRange } from "types/DayPickerRange"; -import { DayPickerSingleProps, isDayPickerSingle } from "types/DayPickerSingle"; -import { Formatters } from "types/Formatters"; -import { Labels } from "types/Labels"; -import { Matcher } from "types/Matchers"; -import { DayModifiers, ModifiersClassNames } from "types/Modifiers"; -import { ClassNames, Styles } from "types/Styles"; +} from "../../types/DayPickerMultiple"; +import { + DayPickerRangeProps, + isDayPickerRange +} from "../../types/DayPickerRange"; +import { + DayPickerSingleProps, + isDayPickerSingle +} from "../../types/DayPickerSingle"; +import { Formatters } from "../../types/Formatters"; +import { Labels } from "../../types/Labels"; +import { Matcher } from "../../types/Matchers"; +import { DayModifiers, ModifiersClassNames } from "../../types/Modifiers"; +import { ClassNames, Styles } from "../../types/Styles"; import { getDefaultContextValues } from "./defaultContextValues"; import { parseFromToProps } from "./utils"; diff --git a/src/contexts/DayPicker/defaultClassNames.ts b/src/contexts/DayPicker/defaultClassNames.ts index 86378c35e4..564891c935 100644 --- a/src/contexts/DayPicker/defaultClassNames.ts +++ b/src/contexts/DayPicker/defaultClassNames.ts @@ -1,4 +1,4 @@ -import { ClassNames } from "types/Styles"; +import { ClassNames } from "../../types/Styles"; /** The name of the default CSS classes. */ export const defaultClassNames: Required = { diff --git a/src/contexts/DayPicker/defaultContextValues.ts b/src/contexts/DayPicker/defaultContextValues.ts index 15471f3316..06abf0641b 100644 --- a/src/contexts/DayPicker/defaultContextValues.ts +++ b/src/contexts/DayPicker/defaultContextValues.ts @@ -1,7 +1,7 @@ import { enUS } from "date-fns/locale"; -import { CaptionLayout } from "components/Caption"; -import { DayPickerContextValue } from "contexts/DayPicker"; +import { CaptionLayout } from "../../components/Caption"; +import { DayPickerContextValue } from "../../contexts/DayPicker"; import { defaultClassNames } from "./defaultClassNames"; import * as formatters from "./formatters"; diff --git a/src/contexts/DayPicker/labels/labelDay.ts b/src/contexts/DayPicker/labels/labelDay.ts index 731faae486..5c9e693458 100644 --- a/src/contexts/DayPicker/labels/labelDay.ts +++ b/src/contexts/DayPicker/labels/labelDay.ts @@ -1,6 +1,6 @@ import { format } from "date-fns"; -import { DayLabel } from "types/Labels"; +import { DayLabel } from "../../../types/Labels"; /** The default ARIA label for the day button. */ export const labelDay: DayLabel = (day, activeModifiers, options): string => { diff --git a/src/contexts/DayPicker/labels/labelNext.ts b/src/contexts/DayPicker/labels/labelNext.ts index ab7f056146..bdd538e6ff 100644 --- a/src/contexts/DayPicker/labels/labelNext.ts +++ b/src/contexts/DayPicker/labels/labelNext.ts @@ -1,4 +1,4 @@ -import { NavButtonLabel } from "types/Labels"; +import { NavButtonLabel } from "../../../types/Labels"; /** The default ARIA label for next month button in navigation */ export const labelNext: NavButtonLabel = (): string => { diff --git a/src/contexts/DayPicker/labels/labelPrevious.ts b/src/contexts/DayPicker/labels/labelPrevious.ts index 8868578ec8..b9e2b5d62d 100644 --- a/src/contexts/DayPicker/labels/labelPrevious.ts +++ b/src/contexts/DayPicker/labels/labelPrevious.ts @@ -1,4 +1,4 @@ -import { NavButtonLabel } from "types/Labels"; +import { NavButtonLabel } from "../../../types/Labels"; /** The default ARIA label for previous month button in navigation */ export const labelPrevious: NavButtonLabel = (): string => { diff --git a/src/contexts/DayPicker/labels/labelWeekNumber.ts b/src/contexts/DayPicker/labels/labelWeekNumber.ts index 64bdc74622..6d3ae9c0b8 100644 --- a/src/contexts/DayPicker/labels/labelWeekNumber.ts +++ b/src/contexts/DayPicker/labels/labelWeekNumber.ts @@ -1,4 +1,4 @@ -import { WeekNumberLabel } from "types/Labels"; +import { WeekNumberLabel } from "../../../types/Labels"; /** The default ARIA label for the WeekNumber element. */ export const labelWeekNumber: WeekNumberLabel = (n): string => { diff --git a/src/contexts/DayPicker/labels/labelWeekday.ts b/src/contexts/DayPicker/labels/labelWeekday.ts index d46805ec5d..e4ae9036f5 100644 --- a/src/contexts/DayPicker/labels/labelWeekday.ts +++ b/src/contexts/DayPicker/labels/labelWeekday.ts @@ -1,6 +1,6 @@ import { format } from "date-fns"; -import { WeekdayLabel } from "types/Labels"; +import { WeekdayLabel } from "../../../types/Labels"; /** The default ARIA label for the Weekday element. */ export const labelWeekday: WeekdayLabel = (day, options): string => { diff --git a/src/contexts/DayPicker/utils/parseFromToProps.test.ts b/src/contexts/DayPicker/utils/parseFromToProps.test.ts index 5364a8557b..673b4beee9 100644 --- a/src/contexts/DayPicker/utils/parseFromToProps.test.ts +++ b/src/contexts/DayPicker/utils/parseFromToProps.test.ts @@ -1,4 +1,4 @@ -import { parseFromToProps } from "contexts/DayPicker/utils"; +import { parseFromToProps } from "../../../contexts/DayPicker/utils"; describe('when "fromMonth" is passed in', () => { const fromMonth = new Date(2021, 4, 3); diff --git a/src/contexts/DayPicker/utils/parseFromToProps.ts b/src/contexts/DayPicker/utils/parseFromToProps.ts index 47a1f69210..402b7c0ce6 100644 --- a/src/contexts/DayPicker/utils/parseFromToProps.ts +++ b/src/contexts/DayPicker/utils/parseFromToProps.ts @@ -1,6 +1,6 @@ import { endOfMonth, startOfDay, startOfMonth } from "date-fns"; -import { DayPickerBase } from "types/DayPickerBase"; +import { DayPickerBase } from "../../../types/DayPickerBase"; /** * Return the `fromDate` and `toDate` prop values values parsing the DayPicker diff --git a/src/contexts/Focus/FocusContext.test.ts b/src/contexts/Focus/FocusContext.test.ts index 3ed127e402..6ea3c255b5 100644 --- a/src/contexts/Focus/FocusContext.test.ts +++ b/src/contexts/Focus/FocusContext.test.ts @@ -8,10 +8,10 @@ import { startOfWeek } from "date-fns"; -import { renderDayPickerHook, RenderHookResult } from "test/render"; -import { freezeBeforeAll } from "test/utils"; +import { renderDayPickerHook, RenderHookResult } from "../../../test/render"; +import { freezeBeforeAll } from "../../../test/utils"; -import { FocusContextValue, useFocusContext } from "contexts/Focus"; +import { FocusContextValue, useFocusContext } from "../../contexts/Focus"; const today = new Date(2021, 11, 8); // make sure is in the middle of the week for the complete test freezeBeforeAll(today); diff --git a/src/contexts/Focus/FocusContext.tsx b/src/contexts/Focus/FocusContext.tsx index 9c5dd1160d..ef6a194c65 100644 --- a/src/contexts/Focus/FocusContext.tsx +++ b/src/contexts/Focus/FocusContext.tsx @@ -2,7 +2,7 @@ import { createContext, ReactNode, useContext, useState } from "react"; import { isSameDay } from "date-fns"; -import { useDayPicker } from "contexts/DayPicker"; +import { useDayPicker } from "../../contexts/DayPicker"; import { useModifiers } from "../Modifiers"; import { useNavigation } from "../Navigation"; diff --git a/src/contexts/Focus/utils/getInitialFocusTarget.test.ts b/src/contexts/Focus/utils/getInitialFocusTarget.test.ts index 796cd69ff2..9b840656fd 100644 --- a/src/contexts/Focus/utils/getInitialFocusTarget.test.ts +++ b/src/contexts/Focus/utils/getInitialFocusTarget.test.ts @@ -1,4 +1,4 @@ -import { Modifiers } from "types/Modifiers"; +import { Modifiers } from "../../../types/Modifiers"; import { getInitialFocusTarget } from "./getInitialFocusTarget"; diff --git a/src/contexts/Focus/utils/getInitialFocusTarget.ts b/src/contexts/Focus/utils/getInitialFocusTarget.ts index c8105f5296..483a3a257a 100644 --- a/src/contexts/Focus/utils/getInitialFocusTarget.ts +++ b/src/contexts/Focus/utils/getInitialFocusTarget.ts @@ -1,7 +1,7 @@ import { addDays, endOfMonth, startOfMonth } from "date-fns"; -import { getActiveModifiers } from "contexts/Modifiers"; -import { Modifiers } from "types/Modifiers"; +import { getActiveModifiers } from "../../../contexts/Modifiers"; +import { type Modifiers } from "../../../types/Modifiers"; /** * Returns the day that should be the target of the focus when DayPicker is diff --git a/src/contexts/Focus/utils/getNextFocus.test.ts b/src/contexts/Focus/utils/getNextFocus.test.ts index f14585e3df..f45a44f3da 100644 --- a/src/contexts/Focus/utils/getNextFocus.test.ts +++ b/src/contexts/Focus/utils/getNextFocus.test.ts @@ -5,7 +5,7 @@ import { InternalModifier, InternalModifiers, Modifiers -} from "types/Modifiers"; +} from "../../../types/Modifiers"; import { FocusDayPickerContext, diff --git a/src/contexts/Focus/utils/getNextFocus.ts b/src/contexts/Focus/utils/getNextFocus.ts index b6e984dea7..69b0c8bc17 100644 --- a/src/contexts/Focus/utils/getNextFocus.ts +++ b/src/contexts/Focus/utils/getNextFocus.ts @@ -11,9 +11,9 @@ import { startOfWeek } from "date-fns"; -import { DayPickerContextValue } from "contexts/DayPicker"; -import { getActiveModifiers } from "contexts/Modifiers"; -import { Modifiers } from "types/Modifiers"; +import { DayPickerContextValue } from "../../../contexts/DayPicker"; +import { getActiveModifiers } from "../../../contexts/Modifiers"; +import { Modifiers } from "../../../types/Modifiers"; export type MoveFocusBy = | "day" diff --git a/src/contexts/Modifiers/ModifiersContext.test.ts b/src/contexts/Modifiers/ModifiersContext.test.ts index 5597620da5..283966174c 100644 --- a/src/contexts/Modifiers/ModifiersContext.test.ts +++ b/src/contexts/Modifiers/ModifiersContext.test.ts @@ -1,9 +1,13 @@ -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { renderDayPickerHook } from "test/render"; +import { renderDayPickerHook } from "../../../test/render"; -import { useModifiers } from "contexts/Modifiers"; -import { DayModifiers, InternalModifier, Modifiers } from "types/Modifiers"; +import { useModifiers } from "../../contexts/Modifiers"; +import { + DayModifiers, + InternalModifier, + Modifiers +} from "../../types/Modifiers"; const internalModifiers = Object.values(InternalModifier); diff --git a/src/contexts/Modifiers/ModifiersContext.tsx b/src/contexts/Modifiers/ModifiersContext.tsx index 6e20a4a4bb..da850d3df1 100644 --- a/src/contexts/Modifiers/ModifiersContext.tsx +++ b/src/contexts/Modifiers/ModifiersContext.tsx @@ -1,9 +1,13 @@ import { createContext, useContext, ReactNode } from "react"; -import { useDayPicker } from "contexts/DayPicker"; -import { useSelectMultiple } from "contexts/SelectMultiple"; -import { useSelectRange } from "contexts/SelectRange"; -import { CustomModifiers, InternalModifiers, Modifiers } from "types/Modifiers"; +import { useDayPicker } from "../../contexts/DayPicker"; +import { useSelectMultiple } from "../../contexts/SelectMultiple"; +import { useSelectRange } from "../../contexts/SelectRange"; +import { + CustomModifiers, + InternalModifiers, + Modifiers +} from "../../types/Modifiers"; import { getCustomModifiers } from "./utils/getCustomModifiers"; import { getInternalModifiers } from "./utils/getInternalModifiers"; diff --git a/src/contexts/Modifiers/utils/getActiveModifiers.test.ts b/src/contexts/Modifiers/utils/getActiveModifiers.test.ts index b494aeb31b..9a873279e2 100644 --- a/src/contexts/Modifiers/utils/getActiveModifiers.test.ts +++ b/src/contexts/Modifiers/utils/getActiveModifiers.test.ts @@ -4,7 +4,7 @@ import { InternalModifier, InternalModifiers, Modifiers -} from "types/Modifiers"; +} from "../../../types/Modifiers"; import { getActiveModifiers } from "./getActiveModifiers"; diff --git a/src/contexts/Modifiers/utils/getActiveModifiers.ts b/src/contexts/Modifiers/utils/getActiveModifiers.ts index 5e3aaf7c8f..c1ca3c3d8e 100644 --- a/src/contexts/Modifiers/utils/getActiveModifiers.ts +++ b/src/contexts/Modifiers/utils/getActiveModifiers.ts @@ -1,6 +1,6 @@ import { isSameMonth } from "date-fns"; -import { ActiveModifiers, Modifiers } from "types/Modifiers"; +import { ActiveModifiers, Modifiers } from "../../../types/Modifiers"; import { isMatch } from "./isMatch"; diff --git a/src/contexts/Modifiers/utils/getCustomModifiers.test.ts b/src/contexts/Modifiers/utils/getCustomModifiers.test.ts index a578b33156..28c02ec2e9 100644 --- a/src/contexts/Modifiers/utils/getCustomModifiers.test.ts +++ b/src/contexts/Modifiers/utils/getCustomModifiers.test.ts @@ -1,5 +1,4 @@ -import { DayModifiers } from "index"; - +import { DayModifiers } from "../../../types/Modifiers"; import { getCustomModifiers } from "./getCustomModifiers"; describe("when some modifiers are not an array", () => { diff --git a/src/contexts/Modifiers/utils/getCustomModifiers.ts b/src/contexts/Modifiers/utils/getCustomModifiers.ts index 2e14d26c4b..a4c210e977 100644 --- a/src/contexts/Modifiers/utils/getCustomModifiers.ts +++ b/src/contexts/Modifiers/utils/getCustomModifiers.ts @@ -1,4 +1,4 @@ -import { CustomModifiers, DayModifiers } from "types/Modifiers"; +import { CustomModifiers, DayModifiers } from "../../../types/Modifiers"; import { matcherToArray } from "./matcherToArray"; diff --git a/src/contexts/Modifiers/utils/getInternalModifiers.test.ts b/src/contexts/Modifiers/utils/getInternalModifiers.test.ts index 49b625793e..7ed5cd32b3 100644 --- a/src/contexts/Modifiers/utils/getInternalModifiers.test.ts +++ b/src/contexts/Modifiers/utils/getInternalModifiers.test.ts @@ -1,9 +1,9 @@ import { addDays } from "date-fns"; -import { DayPickerContextValue } from "contexts/DayPicker"; -import { getDefaultContextValues } from "contexts/DayPicker/defaultContextValues"; -import { SelectRangeContextValue } from "contexts/SelectRange"; -import { InternalModifier, InternalModifiers } from "types/Modifiers"; +import { DayPickerContextValue } from "../../../contexts/DayPicker"; +import { getDefaultContextValues } from "../../../contexts/DayPicker/defaultContextValues"; +import { SelectRangeContextValue } from "../../../contexts/SelectRange"; +import { InternalModifier, InternalModifiers } from "../../../types/Modifiers"; import { getInternalModifiers } from "./getInternalModifiers"; diff --git a/src/contexts/Modifiers/utils/getInternalModifiers.ts b/src/contexts/Modifiers/utils/getInternalModifiers.ts index 6ac16f878f..9d94fb27d3 100644 --- a/src/contexts/Modifiers/utils/getInternalModifiers.ts +++ b/src/contexts/Modifiers/utils/getInternalModifiers.ts @@ -1,9 +1,9 @@ -import { DayPickerContextValue } from "contexts/DayPicker"; -import { SelectMultipleContextValue } from "contexts/SelectMultiple"; -import { SelectRangeContextValue } from "contexts/SelectRange"; -import { isDayPickerMultiple } from "types/DayPickerMultiple"; -import { isDayPickerRange } from "types/DayPickerRange"; -import { InternalModifier, InternalModifiers } from "types/Modifiers"; +import { DayPickerContextValue } from "../../../contexts/DayPicker"; +import { SelectMultipleContextValue } from "../../../contexts/SelectMultiple"; +import { SelectRangeContextValue } from "../../../contexts/SelectRange"; +import { isDayPickerMultiple } from "../../../types/DayPickerMultiple"; +import { isDayPickerRange } from "../../../types/DayPickerRange"; +import { InternalModifier, InternalModifiers } from "../../../types/Modifiers"; import { matcherToArray } from "./matcherToArray"; diff --git a/src/contexts/Modifiers/utils/isDateInRange.test.ts b/src/contexts/Modifiers/utils/isDateInRange.test.ts index 162161bc03..0b46ee9d8b 100644 --- a/src/contexts/Modifiers/utils/isDateInRange.test.ts +++ b/src/contexts/Modifiers/utils/isDateInRange.test.ts @@ -1,7 +1,7 @@ import { addDays } from "date-fns"; -import { DateRange } from "index"; import { isDateInRange } from "./isDateInRange"; +import { DateRange } from "../../../types/Matchers"; const date = new Date(); diff --git a/src/contexts/Modifiers/utils/isDateInRange.ts b/src/contexts/Modifiers/utils/isDateInRange.ts index f6f66a3071..44ad846dc9 100644 --- a/src/contexts/Modifiers/utils/isDateInRange.ts +++ b/src/contexts/Modifiers/utils/isDateInRange.ts @@ -1,6 +1,6 @@ import { differenceInCalendarDays, isSameDay } from "date-fns"; -import { DateRange } from "types/Matchers"; +import { DateRange } from "../../../types/Matchers"; /** Return `true` whether `date` is inside `range`. */ export function isDateInRange(date: Date, range: DateRange): boolean { diff --git a/src/contexts/Modifiers/utils/isMatch.test.ts b/src/contexts/Modifiers/utils/isMatch.test.ts index 48859b02a2..a7c965b544 100644 --- a/src/contexts/Modifiers/utils/isMatch.test.ts +++ b/src/contexts/Modifiers/utils/isMatch.test.ts @@ -6,7 +6,7 @@ import { DateInterval, DateRange, DayOfWeek -} from "types/Matchers"; +} from "../../../types/Matchers"; import { isMatch } from "./isMatch"; diff --git a/src/contexts/Modifiers/utils/isMatch.ts b/src/contexts/Modifiers/utils/isMatch.ts index 0adafd5c34..c6d4d11032 100644 --- a/src/contexts/Modifiers/utils/isMatch.ts +++ b/src/contexts/Modifiers/utils/isMatch.ts @@ -7,7 +7,7 @@ import { isDateRange, isDayOfWeekType, Matcher -} from "types/Matchers"; +} from "../../../types/Matchers"; import { isDateInRange } from "./isDateInRange"; diff --git a/src/contexts/Modifiers/utils/matcherToArray.test.ts b/src/contexts/Modifiers/utils/matcherToArray.test.ts index f8c391d6e0..f585d8c5cf 100644 --- a/src/contexts/Modifiers/utils/matcherToArray.test.ts +++ b/src/contexts/Modifiers/utils/matcherToArray.test.ts @@ -1,5 +1,5 @@ -import { matcherToArray } from "contexts/Modifiers/utils/matcherToArray"; -import { Matcher } from "types/Matchers"; +import { matcherToArray } from "../../../contexts/Modifiers/utils/matcherToArray"; +import { Matcher } from "../../../types/Matchers"; const matcher: Matcher = jest.fn(); diff --git a/src/contexts/Modifiers/utils/matcherToArray.ts b/src/contexts/Modifiers/utils/matcherToArray.ts index 2b60aaf4cb..77d69a126f 100644 --- a/src/contexts/Modifiers/utils/matcherToArray.ts +++ b/src/contexts/Modifiers/utils/matcherToArray.ts @@ -1,4 +1,4 @@ -import { Matcher } from "types/Matchers"; +import { Matcher } from "../../../types/Matchers"; /** Normalize to array a matcher input. */ export function matcherToArray( diff --git a/src/contexts/Navigation/NavigationContext.test.ts b/src/contexts/Navigation/NavigationContext.test.ts index 0daee35ce6..3b2e663170 100644 --- a/src/contexts/Navigation/NavigationContext.test.ts +++ b/src/contexts/Navigation/NavigationContext.test.ts @@ -1,9 +1,9 @@ import { act } from "@testing-library/react"; import { addMonths, startOfMonth, subMonths } from "date-fns"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { renderDayPickerHook, RenderHookResult } from "test/render"; -import { freezeBeforeAll } from "test/utils"; +import { renderDayPickerHook, RenderHookResult } from "../../../test/render"; +import { freezeBeforeAll } from "../../../test/utils"; import { NavigationContextValue, useNavigation } from "./NavigationContext"; diff --git a/src/contexts/Navigation/useNavigationState.test.ts b/src/contexts/Navigation/useNavigationState.test.ts index 2b7fef592a..0f5faf0412 100644 --- a/src/contexts/Navigation/useNavigationState.test.ts +++ b/src/contexts/Navigation/useNavigationState.test.ts @@ -1,9 +1,9 @@ import { act } from "@testing-library/react"; import { addMonths, startOfMonth } from "date-fns"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { renderDayPickerHook } from "test/render"; -import { freezeBeforeAll } from "test/utils"; +import { renderDayPickerHook } from "../../../test/render"; +import { freezeBeforeAll } from "../../../test/utils"; import { NavigationState, useNavigationState } from "./useNavigationState"; diff --git a/src/contexts/Navigation/useNavigationState.ts b/src/contexts/Navigation/useNavigationState.ts index 99952699e2..a95cb39896 100644 --- a/src/contexts/Navigation/useNavigationState.ts +++ b/src/contexts/Navigation/useNavigationState.ts @@ -1,7 +1,7 @@ import { startOfMonth } from "date-fns"; -import { useDayPicker } from "contexts/DayPicker"; -import { useControlledValue } from "hooks/useControlledValue"; +import { useDayPicker } from "../../contexts/DayPicker"; +import { useControlledValue } from "../../hooks/useControlledValue"; import { getInitialMonth } from "./utils/getInitialMonth"; diff --git a/src/contexts/Navigation/utils/getInitialMonth.ts b/src/contexts/Navigation/utils/getInitialMonth.ts index 43714c1b58..05389af7e7 100644 --- a/src/contexts/Navigation/utils/getInitialMonth.ts +++ b/src/contexts/Navigation/utils/getInitialMonth.ts @@ -1,6 +1,6 @@ import { addMonths, differenceInCalendarMonths, startOfMonth } from "date-fns"; -import { DayPickerContextValue } from "contexts/DayPicker"; +import { DayPickerContextValue } from "../../../contexts/DayPicker"; /** Return the initial month according to the given options. */ export function getInitialMonth(context: Partial): Date { diff --git a/src/contexts/RootProvider.tsx b/src/contexts/RootProvider.tsx index 40ab4f9ee1..6d4ab76d7b 100644 --- a/src/contexts/RootProvider.tsx +++ b/src/contexts/RootProvider.tsx @@ -1,6 +1,6 @@ import { ReactNode } from "react"; -import { ModifiersProvider } from "contexts/Modifiers/ModifiersContext"; +import { ModifiersProvider } from "../contexts/Modifiers/ModifiersContext"; import { DayPickerProvider } from "./DayPicker"; import { FocusProvider } from "./Focus"; @@ -8,10 +8,10 @@ import { NavigationProvider } from "./Navigation"; import { SelectMultipleProvider } from "./SelectMultiple"; import { SelectRangeProvider } from "./SelectRange"; import { SelectSingleProvider } from "./SelectSingle"; -import { DayPickerDefaultProps } from "types/DayPickerDefault"; -import { DayPickerSingleProps } from "types/DayPickerSingle"; -import { DayPickerMultipleProps } from "types/DayPickerMultiple"; -import { DayPickerRangeProps } from "types/DayPickerRange"; +import { DayPickerDefaultProps } from "../types/DayPickerDefault"; +import { DayPickerSingleProps } from "../types/DayPickerSingle"; +import { DayPickerMultipleProps } from "../types/DayPickerMultiple"; +import { DayPickerRangeProps } from "../types/DayPickerRange"; type RootContextProps = | Partial diff --git a/src/contexts/SelectMultiple/SelectMultipleContext.test.ts b/src/contexts/SelectMultiple/SelectMultipleContext.test.ts index ad0a4dd3e1..dccdcbc55b 100644 --- a/src/contexts/SelectMultiple/SelectMultipleContext.test.ts +++ b/src/contexts/SelectMultiple/SelectMultipleContext.test.ts @@ -1,14 +1,14 @@ import { MouseEvent } from "react"; import { addDays, addMonths } from "date-fns"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { renderDayPickerHook } from "test/render"; -import { freezeBeforeAll } from "test/utils"; +import { renderDayPickerHook } from "../../../test/render"; +import { freezeBeforeAll } from "../../../test/utils"; -import { isMatch } from "contexts/Modifiers/utils/isMatch"; -import { DayPickerMultipleProps } from "types/DayPickerMultiple"; -import { ActiveModifiers } from "types/Modifiers"; +import { isMatch } from "../../contexts/Modifiers/utils/isMatch"; +import { DayPickerMultipleProps } from "../../types/DayPickerMultiple"; +import { ActiveModifiers } from "../../types/Modifiers"; import { SelectMultipleContextValue, diff --git a/src/contexts/SelectMultiple/SelectMultipleContext.tsx b/src/contexts/SelectMultiple/SelectMultipleContext.tsx index 749db4d8ce..bcc002be35 100644 --- a/src/contexts/SelectMultiple/SelectMultipleContext.tsx +++ b/src/contexts/SelectMultiple/SelectMultipleContext.tsx @@ -2,13 +2,13 @@ import { createContext, ReactNode, useContext } from "react"; import { isSameDay } from "date-fns"; -import { DayPickerBase } from "types/DayPickerBase"; +import { DayPickerBase } from "../../types/DayPickerBase"; import { DayPickerMultipleProps, isDayPickerMultiple -} from "types/DayPickerMultiple"; -import { DayClickEventHandler } from "types/EventHandlers"; -import { InternalModifier, Modifiers } from "types/Modifiers"; +} from "../../types/DayPickerMultiple"; +import { DayClickEventHandler } from "../../types/EventHandlers"; +import { InternalModifier, Modifiers } from "../../types/Modifiers"; /** Represent the modifiers that are changed by the multiple selection. */ export type SelectMultipleModifiers = Pick< diff --git a/src/contexts/SelectRange/SelectRangeContext.test.ts b/src/contexts/SelectRange/SelectRangeContext.test.ts index 374858fe66..f221d0c26e 100644 --- a/src/contexts/SelectRange/SelectRangeContext.test.ts +++ b/src/contexts/SelectRange/SelectRangeContext.test.ts @@ -6,14 +6,14 @@ import { differenceInCalendarDays, subDays } from "date-fns"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { renderDayPickerHook } from "test/render"; -import { freezeBeforeAll } from "test/utils"; +import { renderDayPickerHook } from "../../../test/render"; +import { freezeBeforeAll } from "../../../test/utils"; -import { isMatch } from "contexts/Modifiers/utils/isMatch"; -import { DayPickerRangeProps } from "types/DayPickerRange"; -import { ActiveModifiers } from "types/Modifiers"; +import { isMatch } from "../../contexts/Modifiers/utils/isMatch"; +import { DayPickerRangeProps } from "../../types/DayPickerRange"; +import { ActiveModifiers } from "../../types/Modifiers"; import { SelectRangeContextValue, useSelectRange } from "./SelectRangeContext"; diff --git a/src/contexts/SelectRange/SelectRangeContext.tsx b/src/contexts/SelectRange/SelectRangeContext.tsx index 7722417062..4b840b6b14 100644 --- a/src/contexts/SelectRange/SelectRangeContext.tsx +++ b/src/contexts/SelectRange/SelectRangeContext.tsx @@ -7,11 +7,14 @@ import { subDays } from "date-fns"; -import { DayPickerBase } from "types/DayPickerBase"; -import { DayPickerRangeProps, isDayPickerRange } from "types/DayPickerRange"; -import { DayClickEventHandler } from "types/EventHandlers"; -import { DateRange } from "types/Matchers"; -import { InternalModifier, Modifiers } from "types/Modifiers"; +import { DayPickerBase } from "../../types/DayPickerBase"; +import { + DayPickerRangeProps, + isDayPickerRange +} from "../../types/DayPickerRange"; +import { DayClickEventHandler } from "../../types/EventHandlers"; +import { DateRange } from "../../types/Matchers"; +import { InternalModifier, Modifiers } from "../../types/Modifiers"; import { addToRange } from "./utils/addToRange"; diff --git a/src/contexts/SelectRange/utils/addToRange.test.ts b/src/contexts/SelectRange/utils/addToRange.test.ts index 42e27d3540..416b9c9e80 100644 --- a/src/contexts/SelectRange/utils/addToRange.test.ts +++ b/src/contexts/SelectRange/utils/addToRange.test.ts @@ -1,6 +1,6 @@ import { addDays, subDays } from "date-fns"; -import { DateRange } from "types/Matchers"; +import { DateRange } from "../../../types/Matchers"; import { addToRange } from "./addToRange"; diff --git a/src/contexts/SelectRange/utils/addToRange.ts b/src/contexts/SelectRange/utils/addToRange.ts index 04b4dcfafd..79fe483cb1 100644 --- a/src/contexts/SelectRange/utils/addToRange.ts +++ b/src/contexts/SelectRange/utils/addToRange.ts @@ -1,6 +1,6 @@ import { isAfter, isBefore, isSameDay } from "date-fns"; -import { DateRange } from "types/Matchers"; +import { DateRange } from "../../../types/Matchers"; /** * Add a day to an existing range. diff --git a/src/contexts/SelectSingle/SelectSingleContext.test.ts b/src/contexts/SelectSingle/SelectSingleContext.test.ts index cbaa032274..66cd193dc8 100644 --- a/src/contexts/SelectSingle/SelectSingleContext.test.ts +++ b/src/contexts/SelectSingle/SelectSingleContext.test.ts @@ -1,12 +1,12 @@ import { MouseEvent } from "react"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { renderDayPickerHook } from "test/render"; -import { freezeBeforeAll } from "test/utils"; +import { renderDayPickerHook } from "../../../test/render"; +import { freezeBeforeAll } from "../../../test/utils"; -import { DayPickerSingleProps } from "types/DayPickerSingle"; -import { ActiveModifiers } from "types/Modifiers"; +import { DayPickerSingleProps } from "../../types/DayPickerSingle"; +import { ActiveModifiers } from "../../types/Modifiers"; import { SelectSingleContextValue, diff --git a/src/contexts/SelectSingle/SelectSingleContext.tsx b/src/contexts/SelectSingle/SelectSingleContext.tsx index fda70699b7..f67f5b9c77 100644 --- a/src/contexts/SelectSingle/SelectSingleContext.tsx +++ b/src/contexts/SelectSingle/SelectSingleContext.tsx @@ -1,8 +1,11 @@ import { createContext, ReactNode, useContext } from "react"; -import { DayPickerBase } from "types/DayPickerBase"; -import { DayPickerSingleProps, isDayPickerSingle } from "types/DayPickerSingle"; -import { DayClickEventHandler } from "types/EventHandlers"; +import { DayPickerBase } from "../../types/DayPickerBase"; +import { + DayPickerSingleProps, + isDayPickerSingle +} from "../../types/DayPickerSingle"; +import { DayClickEventHandler } from "../../types/EventHandlers"; /** Represents the value of a {@link SelectSingleContext}. */ export interface SelectSingleContextValue { diff --git a/src/hooks/useActiveModifiers/useActiveModifiers.test.tsx b/src/hooks/useActiveModifiers/useActiveModifiers.test.tsx index 484b18be90..69daeadbb1 100644 --- a/src/hooks/useActiveModifiers/useActiveModifiers.test.tsx +++ b/src/hooks/useActiveModifiers/useActiveModifiers.test.tsx @@ -1,8 +1,8 @@ import { addMonths } from "date-fns"; -import { renderDayPickerHook } from "test/render"; +import { renderDayPickerHook } from "../../../test/render"; -import { ActiveModifiers } from "types/Modifiers"; +import { ActiveModifiers } from "../../types/Modifiers"; import { useActiveModifiers } from "./useActiveModifiers"; diff --git a/src/hooks/useActiveModifiers/useActiveModifiers.tsx b/src/hooks/useActiveModifiers/useActiveModifiers.tsx index 1800900429..f474e67734 100644 --- a/src/hooks/useActiveModifiers/useActiveModifiers.tsx +++ b/src/hooks/useActiveModifiers/useActiveModifiers.tsx @@ -1,5 +1,5 @@ -import { getActiveModifiers, useModifiers } from "contexts/Modifiers"; -import { ActiveModifiers } from "types/Modifiers"; +import { getActiveModifiers, useModifiers } from "../../contexts/Modifiers"; +import { ActiveModifiers } from "../../types/Modifiers"; /** * Return the active modifiers for the specified day. diff --git a/src/hooks/useControlledValue/useControlledValue.test.ts b/src/hooks/useControlledValue/useControlledValue.test.ts index 727e0dde51..74f975e35c 100644 --- a/src/hooks/useControlledValue/useControlledValue.test.ts +++ b/src/hooks/useControlledValue/useControlledValue.test.ts @@ -1,6 +1,6 @@ import { act } from "react-dom/test-utils"; -import { renderDayPickerHook } from "test/render"; +import { renderDayPickerHook } from "../../../test/render"; import { useControlledValue } from "./useControlledValue"; diff --git a/src/hooks/useDayEventHandlers/useDayEventHandlers.test.tsx b/src/hooks/useDayEventHandlers/useDayEventHandlers.test.tsx index 74cc68f0a0..461d87d6bf 100644 --- a/src/hooks/useDayEventHandlers/useDayEventHandlers.test.tsx +++ b/src/hooks/useDayEventHandlers/useDayEventHandlers.test.tsx @@ -1,15 +1,15 @@ -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { mockedContexts } from "test/mockedContexts"; -import { renderDayPickerHook } from "test/render"; +import { mockedContexts } from "../../../test/mockedContexts"; +import { renderDayPickerHook } from "../../../test/render"; -import { FocusContextValue } from "contexts/Focus"; +import { FocusContextValue } from "../../contexts/Focus"; import { DayEventName, EventName, useDayEventHandlers -} from "hooks/useDayEventHandlers"; -import { ActiveModifiers } from "types/Modifiers"; +} from "../../hooks/useDayEventHandlers"; +import { ActiveModifiers } from "../../types/Modifiers"; const today = new Date(2010, 5, 23); diff --git a/src/hooks/useDayEventHandlers/useDayEventHandlers.tsx b/src/hooks/useDayEventHandlers/useDayEventHandlers.tsx index 3f05e5bf80..edca312582 100644 --- a/src/hooks/useDayEventHandlers/useDayEventHandlers.tsx +++ b/src/hooks/useDayEventHandlers/useDayEventHandlers.tsx @@ -7,15 +7,15 @@ import { TouchEventHandler } from "react"; -import { useDayPicker } from "contexts/DayPicker"; -import { useFocusContext } from "contexts/Focus"; -import { useSelectMultiple } from "contexts/SelectMultiple"; -import { useSelectRange } from "contexts/SelectRange"; -import { useSelectSingle } from "contexts/SelectSingle"; -import { isDayPickerMultiple } from "types/DayPickerMultiple"; -import { isDayPickerRange } from "types/DayPickerRange"; -import { isDayPickerSingle } from "types/DayPickerSingle"; -import { ActiveModifiers } from "types/Modifiers"; +import { useDayPicker } from "../../contexts/DayPicker"; +import { useFocusContext } from "../../contexts/Focus"; +import { useSelectMultiple } from "../../contexts/SelectMultiple"; +import { useSelectRange } from "../../contexts/SelectRange"; +import { useSelectSingle } from "../../contexts/SelectSingle"; +import { isDayPickerMultiple } from "../../types/DayPickerMultiple"; +import { isDayPickerRange } from "../../types/DayPickerRange"; +import { isDayPickerSingle } from "../../types/DayPickerSingle"; +import { ActiveModifiers } from "../../types/Modifiers"; export type EventName = | "onClick" diff --git a/src/hooks/useDayRender/useDayRender.test.tsx b/src/hooks/useDayRender/useDayRender.test.tsx index 0125530421..08758ff78d 100644 --- a/src/hooks/useDayRender/useDayRender.test.tsx +++ b/src/hooks/useDayRender/useDayRender.test.tsx @@ -1,18 +1,18 @@ import { createRef } from "react"; import { addDays, addMonths } from "date-fns"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { mockedContexts } from "test/mockedContexts"; -import { renderDayPickerHook } from "test/render"; -import { freezeBeforeAll } from "test/utils"; +import { mockedContexts } from "../../../test/mockedContexts"; +import { renderDayPickerHook } from "../../../test/render"; +import { freezeBeforeAll } from "../../../test/utils"; -import { defaultClassNames } from "contexts/DayPicker/defaultClassNames"; -import { FocusContextValue } from "contexts/Focus"; -import { SelectMultipleContextValue } from "contexts/SelectMultiple"; -import { SelectRangeContextValue } from "contexts/SelectRange"; -import { SelectSingleContextValue } from "contexts/SelectSingle"; -import { EventName } from "hooks/useDayEventHandlers"; +import { defaultClassNames } from "../../contexts/DayPicker/defaultClassNames"; +import { FocusContextValue } from "../../contexts/Focus"; +import { SelectMultipleContextValue } from "../../contexts/SelectMultiple"; +import { SelectRangeContextValue } from "../../contexts/SelectRange"; +import { SelectSingleContextValue } from "../../contexts/SelectSingle"; +import { EventName } from "../../hooks/useDayEventHandlers"; import { useDayRender } from "./useDayRender"; diff --git a/src/hooks/useDayRender/useDayRender.tsx b/src/hooks/useDayRender/useDayRender.tsx index da1c388bdf..4c2914f7ce 100644 --- a/src/hooks/useDayRender/useDayRender.tsx +++ b/src/hooks/useDayRender/useDayRender.tsx @@ -2,18 +2,18 @@ import { RefObject, useEffect } from "react"; import { isSameDay } from "date-fns"; -import { ButtonProps } from "components/Button"; -import { DayContent } from "components/DayContent"; -import { useDayPicker } from "contexts/DayPicker"; -import { useFocusContext } from "contexts/Focus"; -import { useActiveModifiers } from "hooks/useActiveModifiers"; +import { ButtonProps } from "../../components/Button"; +import { DayContent } from "../../components/DayContent"; +import { useDayPicker } from "../../contexts/DayPicker"; +import { useFocusContext } from "../../contexts/Focus"; +import { useActiveModifiers } from "../../hooks/useActiveModifiers"; import { DayEventHandlers, useDayEventHandlers -} from "hooks/useDayEventHandlers"; -import { SelectedDays, useSelectedDays } from "hooks/useSelectedDays"; -import { ActiveModifiers } from "types/Modifiers"; -import { StyledComponent } from "types/Styles"; +} from "../../hooks/useDayEventHandlers"; +import { SelectedDays, useSelectedDays } from "../../hooks/useSelectedDays"; +import { ActiveModifiers } from "../../types/Modifiers"; +import { StyledComponent } from "../../types/Styles"; import { getDayClassNames } from "./utils/getDayClassNames"; import { getDayStyle } from "./utils/getDayStyle"; diff --git a/src/hooks/useDayRender/utils/getDayClassNames.test.ts b/src/hooks/useDayRender/utils/getDayClassNames.test.ts index 01e5da87c0..34e847a548 100644 --- a/src/hooks/useDayRender/utils/getDayClassNames.test.ts +++ b/src/hooks/useDayRender/utils/getDayClassNames.test.ts @@ -1,6 +1,6 @@ -import { DayPickerContextValue } from "contexts/DayPicker"; -import { defaultClassNames } from "contexts/DayPicker/defaultClassNames"; -import { ActiveModifiers, InternalModifier } from "types/Modifiers"; +import { DayPickerContextValue } from "../../../contexts/DayPicker"; +import { defaultClassNames } from "../../../contexts/DayPicker/defaultClassNames"; +import { ActiveModifiers, InternalModifier } from "../../../types/Modifiers"; import { getDayClassNames } from "./getDayClassNames"; diff --git a/src/hooks/useDayRender/utils/getDayClassNames.ts b/src/hooks/useDayRender/utils/getDayClassNames.ts index 04a7d87a39..1f6e40b721 100644 --- a/src/hooks/useDayRender/utils/getDayClassNames.ts +++ b/src/hooks/useDayRender/utils/getDayClassNames.ts @@ -1,5 +1,5 @@ -import { DayPickerContextValue } from "contexts/DayPicker"; -import { ActiveModifiers, InternalModifier } from "types/Modifiers"; +import { DayPickerContextValue } from "../../../contexts/DayPicker"; +import { ActiveModifiers, InternalModifier } from "../../../types/Modifiers"; function isInternalModifier(modifier: string): modifier is InternalModifier { return Object.values(InternalModifier).includes(modifier as InternalModifier); diff --git a/src/hooks/useDayRender/utils/getDayStyle.ts b/src/hooks/useDayRender/utils/getDayStyle.ts index 31aefac84a..292d26ae65 100644 --- a/src/hooks/useDayRender/utils/getDayStyle.ts +++ b/src/hooks/useDayRender/utils/getDayStyle.ts @@ -1,7 +1,7 @@ import { CSSProperties } from "react"; -import { DayPickerContextValue } from "contexts/DayPicker"; -import { ActiveModifiers } from "types/Modifiers"; +import { DayPickerContextValue } from "../../../contexts/DayPicker"; +import { ActiveModifiers } from "../../../types/Modifiers"; /** * Return the style for the Day element, according to the given active diff --git a/src/hooks/useInput/useInput.ts b/src/hooks/useInput/useInput.ts index 0d88f142e6..52fb7fcefc 100644 --- a/src/hooks/useInput/useInput.ts +++ b/src/hooks/useInput/useInput.ts @@ -8,13 +8,13 @@ import { import { differenceInCalendarDays, format as _format, parse } from "date-fns"; import { enUS } from "date-fns/locale"; -import { parseFromToProps } from "contexts/DayPicker/utils"; -import { DayPickerBase } from "types/DayPickerBase"; -import { DayPickerSingleProps } from "types/DayPickerSingle"; +import { parseFromToProps } from "../../contexts/DayPicker/utils"; +import { DayPickerBase } from "../../types/DayPickerBase"; +import { DayPickerSingleProps } from "../../types/DayPickerSingle"; import { DayClickEventHandler, MonthChangeEventHandler -} from "types/EventHandlers"; +} from "../../types/EventHandlers"; import { isValidDate } from "./utils/isValidDate"; diff --git a/src/hooks/useSelectedDays/useSelectedDays.test.ts b/src/hooks/useSelectedDays/useSelectedDays.test.ts index 519ea200b9..0fa5267325 100644 --- a/src/hooks/useSelectedDays/useSelectedDays.test.ts +++ b/src/hooks/useSelectedDays/useSelectedDays.test.ts @@ -1,8 +1,8 @@ -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../DayPicker"; -import { mockedContexts } from "test/mockedContexts"; -import { renderDayPickerHook } from "test/render"; -import { freezeBeforeAll } from "test/utils"; +import { mockedContexts } from "../../../test/mockedContexts"; +import { renderDayPickerHook } from "../../../test/render"; +import { freezeBeforeAll } from "../../../test/utils"; import { useSelectedDays } from "./useSelectedDays"; diff --git a/src/hooks/useSelectedDays/useSelectedDays.ts b/src/hooks/useSelectedDays/useSelectedDays.ts index 942121153a..5b08ff50c6 100644 --- a/src/hooks/useSelectedDays/useSelectedDays.ts +++ b/src/hooks/useSelectedDays/useSelectedDays.ts @@ -1,11 +1,11 @@ -import { useDayPicker } from "contexts/DayPicker"; -import { useSelectMultiple } from "contexts/SelectMultiple"; -import { useSelectRange } from "contexts/SelectRange"; -import { useSelectSingle } from "contexts/SelectSingle"; -import { isDayPickerMultiple } from "types/DayPickerMultiple"; -import { isDayPickerRange } from "types/DayPickerRange"; -import { isDayPickerSingle } from "types/DayPickerSingle"; -import { DateRange } from "types/Matchers"; +import { useDayPicker } from "../../contexts/DayPicker"; +import { useSelectMultiple } from "../../contexts/SelectMultiple"; +import { useSelectRange } from "../../contexts/SelectRange"; +import { useSelectSingle } from "../../contexts/SelectSingle"; +import { isDayPickerMultiple } from "../../types/DayPickerMultiple"; +import { isDayPickerRange } from "../../types/DayPickerRange"; +import { isDayPickerSingle } from "../../types/DayPickerSingle"; +import { DateRange } from "../../types/Matchers"; export type SelectedDays = Date | Date[] | DateRange | undefined; diff --git a/src/index.ts b/src/index.ts index 7a6431c0aa..2f82abfe2b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,47 +1,46 @@ export * from "./DayPicker"; -import "./style.css"; -export * from "components/Button"; -export * from "components/Caption"; -export * from "components/CaptionDropdowns"; -export * from "components/CaptionLabel"; -export * from "components/CaptionNavigation"; -export * from "components/Day"; -export * from "components/DayContent"; -export * from "components/Dropdown"; -export * from "components/Footer"; -export * from "components/Head"; -export * from "components/HeadRow"; -export * from "components/IconDropdown"; -export * from "components/IconRight"; -export * from "components/IconLeft"; -export * from "components/Months"; -export * from "components/Row"; -export * from "components/WeekNumber"; +export * from "./components/Button"; +export * from "./components/Caption"; +export * from "./components/CaptionDropdowns"; +export * from "./components/CaptionLabel"; +export * from "./components/CaptionNavigation"; +export * from "./components/Day"; +export * from "./components/DayContent"; +export * from "./components/Dropdown"; +export * from "./components/Footer"; +export * from "./components/Head"; +export * from "./components/HeadRow"; +export * from "./components/IconDropdown"; +export * from "./components/IconRight"; +export * from "./components/IconLeft"; +export * from "./components/Months"; +export * from "./components/Row"; +export * from "./components/WeekNumber"; -export * from "hooks/useInput"; -export * from "hooks/useDayRender"; -export * from "hooks/useActiveModifiers"; +export * from "./hooks/useInput"; +export * from "./hooks/useDayRender"; +export * from "./hooks/useActiveModifiers"; -export * from "contexts/DayPicker"; -export * from "contexts/Focus"; -export * from "contexts/Navigation"; -export * from "contexts/RootProvider"; -export * from "contexts/SelectMultiple"; -export * from "contexts/SelectRange"; -export * from "contexts/SelectSingle"; +export * from "./contexts/DayPicker"; +export * from "./contexts/Focus"; +export * from "./contexts/Navigation"; +export * from "./contexts/RootProvider"; +export * from "./contexts/SelectMultiple"; +export * from "./contexts/SelectRange"; +export * from "./contexts/SelectSingle"; -export * from "types/DayPickerBase"; -export * from "types/DayPickerDefault"; -export * from "types/DayPickerMultiple"; -export * from "types/DayPickerRange"; -export * from "types/DayPickerSingle"; -export * from "types/EventHandlers"; -export * from "types/Formatters"; -export * from "types/Labels"; -export * from "types/Matchers"; -export * from "types/Modifiers"; -export * from "types/Styles"; +export * from "./types/DayPickerBase"; +export * from "./types/DayPickerDefault"; +export * from "./types/DayPickerMultiple"; +export * from "./types/DayPickerRange"; +export * from "./types/DayPickerSingle"; +export * from "./types/EventHandlers"; +export * from "./types/Formatters"; +export * from "./types/Labels"; +export * from "./types/Matchers"; +export * from "./types/Modifiers"; +export * from "./types/Styles"; -export * from "contexts/Modifiers/utils/isMatch"; -export * from "contexts/SelectRange/utils/addToRange"; +export * from "./contexts/Modifiers/utils/isMatch"; +export * from "./contexts/SelectRange/utils/addToRange"; diff --git a/src/types/DayPickerBase.ts b/src/types/DayPickerBase.ts index b71ed553a6..303a330373 100644 --- a/src/types/DayPickerBase.ts +++ b/src/types/DayPickerBase.ts @@ -2,15 +2,15 @@ import { CSSProperties, ReactNode } from "react"; import { Locale } from "date-fns"; -import { CaptionLayout, CaptionProps } from "components/Caption"; -import { CaptionLabelProps } from "components/CaptionLabel"; -import { DayProps } from "components/Day"; -import { DayContentProps } from "components/DayContent"; -import { DropdownProps } from "components/Dropdown"; -import { FooterProps } from "components/Footer"; -import { MonthsProps } from "components/Months"; -import { RowProps } from "components/Row"; -import { WeekNumberProps } from "components/WeekNumber"; +import { CaptionLayout, CaptionProps } from "../components/Caption"; +import { CaptionLabelProps } from "../components/CaptionLabel"; +import { DayProps } from "../components/Day"; +import { DayContentProps } from "../components/DayContent"; +import { DropdownProps } from "../components/Dropdown"; +import { FooterProps } from "../components/Footer"; +import { MonthsProps } from "../components/Months"; +import { RowProps } from "../components/Row"; +import { WeekNumberProps } from "../components/WeekNumber"; import { DayClickEventHandler, diff --git a/src/types/DayPickerDefault.ts b/src/types/DayPickerDefault.ts index 5ba7e22131..9e18beadbf 100644 --- a/src/types/DayPickerDefault.ts +++ b/src/types/DayPickerDefault.ts @@ -1,4 +1,4 @@ -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../DayPicker"; import { DayPickerBase } from "./DayPickerBase"; diff --git a/src/types/DayPickerMultiple.ts b/src/types/DayPickerMultiple.ts index 8f33e16240..68cfb49341 100644 --- a/src/types/DayPickerMultiple.ts +++ b/src/types/DayPickerMultiple.ts @@ -1,6 +1,6 @@ -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../DayPicker"; -import { DayPickerContextValue } from "contexts/DayPicker"; +import { DayPickerContextValue } from "../contexts/DayPicker"; import { DayPickerBase } from "./DayPickerBase"; import { SelectMultipleEventHandler } from "./EventHandlers"; diff --git a/src/types/DayPickerRange.ts b/src/types/DayPickerRange.ts index a74bc7a640..454633c080 100644 --- a/src/types/DayPickerRange.ts +++ b/src/types/DayPickerRange.ts @@ -1,6 +1,6 @@ -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../DayPicker"; -import { DayPickerContextValue } from "contexts/DayPicker"; +import { DayPickerContextValue } from "../contexts/DayPicker"; import { DayPickerBase } from "./DayPickerBase"; import { SelectRangeEventHandler } from "./EventHandlers"; diff --git a/src/types/DayPickerSingle.ts b/src/types/DayPickerSingle.ts index 180b58e16d..f090ff4adf 100644 --- a/src/types/DayPickerSingle.ts +++ b/src/types/DayPickerSingle.ts @@ -1,6 +1,6 @@ -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../DayPicker"; -import { DayPickerContextValue } from "contexts/DayPicker"; +import { DayPickerContextValue } from "../contexts/DayPicker"; import { DayPickerBase } from "./DayPickerBase"; import { SelectSingleEventHandler } from "./EventHandlers"; diff --git a/src/types/Labels.ts b/src/types/Labels.ts index a81b3f26fc..109ff4f328 100644 --- a/src/types/Labels.ts +++ b/src/types/Labels.ts @@ -1,6 +1,6 @@ import { Locale } from "date-fns"; -import { ActiveModifiers } from "types/Modifiers"; +import { ActiveModifiers } from "./Modifiers"; /** Map of functions to translate ARIA labels for the relative elements. */ export type Labels = { diff --git a/test/mockedContexts.ts b/test/mockedContexts.ts index 89d656a656..c4393bf9b1 100644 --- a/test/mockedContexts.ts +++ b/test/mockedContexts.ts @@ -1,9 +1,9 @@ import { - FocusContextValue, + SelectSingleContextValue, SelectMultipleContextValue, SelectRangeContextValue, - SelectSingleContextValue -} from "index"; + FocusContextValue +} from "../src"; const singleContext: SelectSingleContextValue = { selected: new Date(), diff --git a/test/render/customRender.tsx b/test/render/customRender.tsx index c649eaa762..2d3fd68286 100644 --- a/test/render/customRender.tsx +++ b/test/render/customRender.tsx @@ -1,9 +1,7 @@ import { ReactElement } from "react"; import { render } from "@testing-library/react"; -import { DayPickerProps } from "DayPicker"; - -import { RootProvider } from "contexts/RootProvider"; +import { DayPickerProps, RootProvider } from "../../src"; /** Render a React Element wrapped with the Root Provider. */ export function customRender( diff --git a/test/render/renderDayPickerHook.tsx b/test/render/renderDayPickerHook.tsx index b2169d5c9d..623b2f7e38 100644 --- a/test/render/renderDayPickerHook.tsx +++ b/test/render/renderDayPickerHook.tsx @@ -1,20 +1,20 @@ import { render } from "@testing-library/react"; -import { DayPickerProps } from "DayPicker"; +import { DayPickerProps } from "../../src/DayPicker"; -import { FocusContext, FocusContextValue } from "contexts/Focus"; -import { RootProvider } from "contexts/RootProvider"; +import { FocusContext, FocusContextValue } from "../../src/contexts/Focus"; import { SelectMultipleContext, SelectMultipleContextValue -} from "contexts/SelectMultiple"; +} from "../../src/contexts/SelectMultiple"; import { SelectRangeContext, SelectRangeContextValue -} from "contexts/SelectRange"; +} from "../../src/contexts/SelectRange"; import { SelectSingleContext, SelectSingleContextValue -} from "contexts/SelectSingle"; +} from "../../src/contexts/SelectSingle"; +import { RootProvider } from "../../src"; /** Render a DayPicker hook inside the {@link RootProvider}. */ export type RenderHookResult = { diff --git a/test/utils/focusDaysGrid.ts b/test/utils/focusDaysGrid.ts index d5fddca165..843d5c15cc 100644 --- a/test/utils/focusDaysGrid.ts +++ b/test/utils/focusDaysGrid.ts @@ -1,7 +1,7 @@ import { fireEvent } from "@testing-library/dom"; import { act } from "@testing-library/react"; -import { user } from "test/user"; +import { user } from "../user"; import { getFocusedElement } from "../selectors"; diff --git a/website/test-integration/examples/controlled.test.tsx b/website/test-integration/examples/controlled.test.tsx index 4bcbdadab5..b54ea2f27d 100644 --- a/website/test-integration/examples/controlled.test.tsx +++ b/website/test-integration/examples/controlled.test.tsx @@ -6,7 +6,7 @@ import { freezeBeforeAll } from "@site/test/utils"; import { render, screen } from "@testing-library/react"; import { act } from "react-dom/test-utils"; -import { getMonthCaption } from "react-day-picker/test/selectors"; +import { getMonthCaption } from "../../../test/selectors"; import Example from "@examples/controlled"; diff --git a/website/test-integration/examples/custom-multiple.test.tsx b/website/test-integration/examples/custom-multiple.test.tsx index b475f3b71e..21f4abfb38 100644 --- a/website/test-integration/examples/custom-multiple.test.tsx +++ b/website/test-integration/examples/custom-multiple.test.tsx @@ -6,7 +6,7 @@ import { freezeBeforeAll } from "@site/test/utils"; import { render } from "@testing-library/react"; import { act } from "react-dom/test-utils"; -import { getDayButton, getTableFooter } from "react-day-picker/test/selectors"; +import { getDayButton, getTableFooter } from "../../../test/selectors"; import Example from "@examples/custom-multiple"; diff --git a/website/test-integration/examples/custom-single.test.tsx b/website/test-integration/examples/custom-single.test.tsx index 7f22165a0a..fa21ea25de 100644 --- a/website/test-integration/examples/custom-single.test.tsx +++ b/website/test-integration/examples/custom-single.test.tsx @@ -6,7 +6,7 @@ import { freezeBeforeAll } from "@site/test/utils"; import { render } from "@testing-library/react"; import { act } from "react-dom/test-utils"; -import { getDayButton, getTableFooter } from "react-day-picker/test/selectors"; +import { getDayButton, getTableFooter } from "../../../test/selectors"; import Example from "@examples/custom-single"; diff --git a/website/test-integration/examples/date-picker-dialog.test.tsx b/website/test-integration/examples/date-picker-dialog.test.tsx index be4f8cc8cc..5542779d60 100644 --- a/website/test-integration/examples/date-picker-dialog.test.tsx +++ b/website/test-integration/examples/date-picker-dialog.test.tsx @@ -7,7 +7,7 @@ import { render, screen } from "@testing-library/react"; import { format } from "date-fns"; import { act } from "react-dom/test-utils"; -import { getDayButton } from "react-day-picker/test/selectors"; +import { getDayButton } from "../../../test/selectors"; import Example from "@examples/date-picker-dialog"; diff --git a/website/test-integration/examples/default-month.test.tsx b/website/test-integration/examples/default-month.test.tsx index 8b4c5c25d6..2c67d58895 100644 --- a/website/test-integration/examples/default-month.test.tsx +++ b/website/test-integration/examples/default-month.test.tsx @@ -3,7 +3,7 @@ import React from "react"; import { freezeBeforeAll } from "@site/test/utils"; import { render } from "@testing-library/react"; -import { getMonthCaption } from "react-day-picker/test/selectors"; +import { getMonthCaption } from "../../../test/selectors"; import Example from "@examples/default-month"; diff --git a/website/test-integration/examples/disabled.test.tsx b/website/test-integration/examples/disabled.test.tsx index 37ee54b22a..78df81b6f0 100644 --- a/website/test-integration/examples/disabled.test.tsx +++ b/website/test-integration/examples/disabled.test.tsx @@ -11,7 +11,7 @@ import { getFocusedElement, getMonthCaption, queryPrevButton -} from "react-day-picker/test/selectors"; +} from "../../../test/selectors"; import Example from "@examples/disabled"; diff --git a/website/test-integration/examples/dropdown-buttons.test.tsx b/website/test-integration/examples/dropdown-buttons.test.tsx index bdc614b63a..20760b7ce5 100644 --- a/website/test-integration/examples/dropdown-buttons.test.tsx +++ b/website/test-integration/examples/dropdown-buttons.test.tsx @@ -11,7 +11,7 @@ import { getNextButton, getPrevButton, getYearDropdown -} from "react-day-picker/test/selectors"; +} from "../../../test/selectors"; import Example from "@examples/dropdown-buttons"; diff --git a/website/test-integration/examples/dropdown-multiple-months.test.tsx b/website/test-integration/examples/dropdown-multiple-months.test.tsx index 07ee7dc4d6..0870015459 100644 --- a/website/test-integration/examples/dropdown-multiple-months.test.tsx +++ b/website/test-integration/examples/dropdown-multiple-months.test.tsx @@ -5,7 +5,7 @@ import { user } from "@site/test/user"; import { freezeBeforeAll } from "@site/test/utils"; import { act, render, screen } from "@testing-library/react"; -import { getMonthGrid } from "react-day-picker/test/selectors"; +import { getMonthGrid } from "../../../test/selectors"; import Example from "@examples/dropdown-multiple-months"; diff --git a/website/test-integration/examples/dropdown.test.tsx b/website/test-integration/examples/dropdown.test.tsx index adb4cec998..7369bd08b0 100644 --- a/website/test-integration/examples/dropdown.test.tsx +++ b/website/test-integration/examples/dropdown.test.tsx @@ -9,7 +9,7 @@ import { getMonthDropdown, getMonthGrid, getYearDropdown -} from "react-day-picker/test/selectors"; +} from "../../../test/selectors"; import Example from "@examples/dropdown"; diff --git a/website/test-integration/examples/focus-recursive.test.tsx b/website/test-integration/examples/focus-recursive.test.tsx index dd3f20d8ed..e43236ac45 100644 --- a/website/test-integration/examples/focus-recursive.test.tsx +++ b/website/test-integration/examples/focus-recursive.test.tsx @@ -5,10 +5,7 @@ import { user } from "@site/test/user"; import { freezeBeforeAll } from "@site/test/utils"; import { act, render } from "@testing-library/react"; -import { - getDayButton, - getFocusedElement -} from "react-day-picker/test/selectors"; +import { getDayButton, getFocusedElement } from "../../../test/selectors"; import Example from "@examples/focus-recursive"; diff --git a/website/test-integration/examples/from-to-month.test.tsx b/website/test-integration/examples/from-to-month.test.tsx index 0eec5b6d52..4a63657b9b 100644 --- a/website/test-integration/examples/from-to-month.test.tsx +++ b/website/test-integration/examples/from-to-month.test.tsx @@ -5,7 +5,7 @@ import { user } from "@site/test/user"; import { act, render } from "@testing-library/react"; import { differenceInMonths } from "date-fns"; -import { getNextButton, getPrevButton } from "react-day-picker/test/selectors"; +import { getNextButton, getPrevButton } from "../../../test/selectors"; import Example from "@examples/from-to-month"; diff --git a/website/test-integration/examples/from-to-year.test.tsx b/website/test-integration/examples/from-to-year.test.tsx index 7f5a3108e2..87de855cf3 100644 --- a/website/test-integration/examples/from-to-year.test.tsx +++ b/website/test-integration/examples/from-to-year.test.tsx @@ -6,7 +6,7 @@ import { freezeBeforeAll } from "@site/test/utils"; import { act, render } from "@testing-library/react"; import { differenceInMonths } from "date-fns"; -import { getNextButton, getPrevButton } from "react-day-picker/test/selectors"; +import { getNextButton, getPrevButton } from "../../../test/selectors"; import Example from "@examples/from-to-year"; diff --git a/website/test-integration/examples/keyboard-focus.test.tsx b/website/test-integration/examples/keyboard-focus.test.tsx index 66fd08746d..1929dcf354 100644 --- a/website/test-integration/examples/keyboard-focus.test.tsx +++ b/website/test-integration/examples/keyboard-focus.test.tsx @@ -13,7 +13,7 @@ import { getFocusedElement, getNextButton, getPrevButton -} from "react-day-picker/test/selectors"; +} from "../../../test/selectors"; import Example from "@examples/keyboard"; diff --git a/website/test-integration/examples/keyboard.test.tsx b/website/test-integration/examples/keyboard.test.tsx index ef6b3df303..76250dad35 100644 --- a/website/test-integration/examples/keyboard.test.tsx +++ b/website/test-integration/examples/keyboard.test.tsx @@ -22,7 +22,7 @@ import { getMonthCaption, getNextButton, getPrevButton -} from "react-day-picker/test/selectors"; +} from "../../../test/selectors"; import Example from "@examples/keyboard"; diff --git a/website/test-integration/examples/modifiers-classnames.test.tsx b/website/test-integration/examples/modifiers-classnames.test.tsx index 07ec3e6605..ee4f94d65e 100644 --- a/website/test-integration/examples/modifiers-classnames.test.tsx +++ b/website/test-integration/examples/modifiers-classnames.test.tsx @@ -3,7 +3,7 @@ import React from "react"; import { freezeBeforeAll } from "@site/test/utils"; import { render } from "@testing-library/react"; -import { getDayButton } from "react-day-picker/test/selectors"; +import { getDayButton } from "../../../test/selectors"; import Example from "@examples/modifiers-classnames"; diff --git a/website/test-integration/examples/modifiers-custom.test.tsx b/website/test-integration/examples/modifiers-custom.test.tsx index e47a7d1f46..02fdcad651 100644 --- a/website/test-integration/examples/modifiers-custom.test.tsx +++ b/website/test-integration/examples/modifiers-custom.test.tsx @@ -3,7 +3,7 @@ import React from "react"; import { user } from "@site/test/user"; import { act, render } from "@testing-library/react"; -import { getDayButton, getTableFooter } from "react-day-picker/test/selectors"; +import { getDayButton, getTableFooter } from "../../../test/selectors"; import Example from "@examples/modifiers-custom"; diff --git a/website/test-integration/examples/modifiers-disabled.test.tsx b/website/test-integration/examples/modifiers-disabled.test.tsx index 1f21e88a2b..ce7ba6dc82 100644 --- a/website/test-integration/examples/modifiers-disabled.test.tsx +++ b/website/test-integration/examples/modifiers-disabled.test.tsx @@ -3,7 +3,7 @@ import React from "react"; import { freezeBeforeAll } from "@site/test/utils"; import { render } from "@testing-library/react"; -import { getDayButton } from "react-day-picker/test/selectors"; +import { getDayButton } from "../../../test/selectors"; import Example from "@examples/modifiers-disabled"; diff --git a/website/test-integration/examples/modifiers-hidden.test.tsx b/website/test-integration/examples/modifiers-hidden.test.tsx index 1d7a24d314..84b2affe0b 100644 --- a/website/test-integration/examples/modifiers-hidden.test.tsx +++ b/website/test-integration/examples/modifiers-hidden.test.tsx @@ -3,7 +3,7 @@ import React from "react"; import { freezeBeforeAll } from "@site/test/utils"; import { render } from "@testing-library/react"; -import { queryDayButton } from "react-day-picker/test/selectors"; +import { queryDayButton } from "../../../test/selectors"; import Example from "@examples/modifiers-hidden"; diff --git a/website/test-integration/examples/modifiers-style.test.tsx b/website/test-integration/examples/modifiers-style.test.tsx index c2ef7421f4..5b8cfce5d5 100644 --- a/website/test-integration/examples/modifiers-style.test.tsx +++ b/website/test-integration/examples/modifiers-style.test.tsx @@ -3,7 +3,7 @@ import React from "react"; import { freezeBeforeAll } from "@site/test/utils"; import { render } from "@testing-library/react"; -import { getDayButton } from "react-day-picker/test/selectors"; +import { getDayButton } from "../../../test/selectors"; import Example from "@examples/modifiers-style"; diff --git a/website/test-integration/examples/modifiers-today.test.tsx b/website/test-integration/examples/modifiers-today.test.tsx index c06ae50fff..1d2d3a00f9 100644 --- a/website/test-integration/examples/modifiers-today.test.tsx +++ b/website/test-integration/examples/modifiers-today.test.tsx @@ -5,7 +5,7 @@ import { freezeBeforeAll } from "@site/test/utils"; import { act, render } from "@testing-library/react"; import { addDays } from "date-fns"; -import { getDayButton, getTableFooter } from "react-day-picker/test/selectors"; +import { getDayButton, getTableFooter } from "../../../test/selectors"; import Example from "@examples/modifiers-today"; diff --git a/website/test-integration/examples/multiple-min-max.test.tsx b/website/test-integration/examples/multiple-min-max.test.tsx index 3e7523afa1..6fb0eb0a14 100644 --- a/website/test-integration/examples/multiple-min-max.test.tsx +++ b/website/test-integration/examples/multiple-min-max.test.tsx @@ -6,7 +6,7 @@ import { freezeBeforeAll } from "@site/test/utils"; import { act, render } from "@testing-library/react"; import { addDays } from "date-fns"; -import { getDayButton, getTableFooter } from "react-day-picker/test/selectors"; +import { getDayButton, getTableFooter } from "../../../test/selectors"; import Example from "@examples/multiple-min-max"; diff --git a/website/test-integration/examples/multiple-months-paged.test.tsx b/website/test-integration/examples/multiple-months-paged.test.tsx index 4dbf8c201e..0ea9a42c7c 100644 --- a/website/test-integration/examples/multiple-months-paged.test.tsx +++ b/website/test-integration/examples/multiple-months-paged.test.tsx @@ -5,7 +5,7 @@ import { user } from "@site/test/user"; import { freezeBeforeAll } from "@site/test/utils"; import { act, render, screen } from "@testing-library/react"; -import { getPrevButton } from "react-day-picker/test/selectors"; +import { getPrevButton } from "../../../test/selectors"; import Example from "@examples/multiple-months-paged"; diff --git a/website/test-integration/examples/multiple-months.test.tsx b/website/test-integration/examples/multiple-months.test.tsx index d93314a78e..e1967eb012 100644 --- a/website/test-integration/examples/multiple-months.test.tsx +++ b/website/test-integration/examples/multiple-months.test.tsx @@ -5,7 +5,7 @@ import { user } from "@site/test/user"; import { freezeBeforeAll } from "@site/test/utils"; import { act, render, screen } from "@testing-library/react"; -import { getMonthGrid, getPrevButton } from "react-day-picker/test/selectors"; +import { getMonthGrid, getPrevButton } from "../../../test/selectors"; import Example from "@examples/multiple-months"; diff --git a/website/test-integration/examples/multiple.test.tsx b/website/test-integration/examples/multiple.test.tsx index 81928cb4fe..f56ec97d1a 100644 --- a/website/test-integration/examples/multiple.test.tsx +++ b/website/test-integration/examples/multiple.test.tsx @@ -5,7 +5,7 @@ import { user } from "@site/test/user"; import { freezeBeforeAll } from "@site/test/utils"; import { act, render } from "@testing-library/react"; -import { getDayButton, getTableFooter } from "react-day-picker/test/selectors"; +import { getDayButton, getTableFooter } from "../../../test/selectors"; import Example from "@examples/multiple"; diff --git a/website/test-integration/examples/range-min-max.test.tsx b/website/test-integration/examples/range-min-max.test.tsx index c67f8d9699..828505591d 100644 --- a/website/test-integration/examples/range-min-max.test.tsx +++ b/website/test-integration/examples/range-min-max.test.tsx @@ -6,7 +6,7 @@ import { freezeBeforeAll } from "@site/test/utils"; import { act, render } from "@testing-library/react"; import { setDate } from "date-fns"; -import { getDayButton } from "react-day-picker/test/selectors"; +import { getDayButton } from "../../../test/selectors"; import Example from "@examples/range-min-max"; diff --git a/website/test-integration/examples/range-shift-key.test.tsx b/website/test-integration/examples/range-shift-key.test.tsx index d8849945d6..9590365afa 100644 --- a/website/test-integration/examples/range-shift-key.test.tsx +++ b/website/test-integration/examples/range-shift-key.test.tsx @@ -5,7 +5,7 @@ import { user } from "@site/test/user"; import { freezeBeforeAll } from "@site/test/utils"; import { act, render } from "@testing-library/react"; -import { getDayButton } from "react-day-picker/test/selectors"; +import { getDayButton } from "../../../test/selectors"; import Example from "@examples/range-shift-key"; diff --git a/website/test-integration/examples/range.test.tsx b/website/test-integration/examples/range.test.tsx index 816737cfb0..66064836ca 100644 --- a/website/test-integration/examples/range.test.tsx +++ b/website/test-integration/examples/range.test.tsx @@ -5,10 +5,7 @@ import { user } from "@site/test/user"; import { act, render } from "@testing-library/react"; import { addDays } from "date-fns"; -import { - getAllSelectedDays, - getDayButton -} from "react-day-picker/test/selectors"; +import { getAllSelectedDays, getDayButton } from "../../../test/selectors"; import Example from "@examples/range"; diff --git a/website/test-integration/examples/rtl.test.tsx b/website/test-integration/examples/rtl.test.tsx index b28a77a766..4968fd039b 100644 --- a/website/test-integration/examples/rtl.test.tsx +++ b/website/test-integration/examples/rtl.test.tsx @@ -9,7 +9,7 @@ import { getMonthCaption, getNextButton, getPrevButton -} from "react-day-picker/test/selectors"; +} from "../../../test/selectors"; import Example from "@examples/rtl"; diff --git a/website/test-integration/examples/single-required.test.tsx b/website/test-integration/examples/single-required.test.tsx index 252632cf78..79d58a3006 100644 --- a/website/test-integration/examples/single-required.test.tsx +++ b/website/test-integration/examples/single-required.test.tsx @@ -5,7 +5,7 @@ import { user } from "@site/test/user"; import { freezeBeforeAll } from "@site/test/utils"; import { act, render } from "@testing-library/react"; -import { getDayButton, getTableFooter } from "react-day-picker/test/selectors"; +import { getDayButton, getTableFooter } from "../../../test/selectors"; import Example from "@examples/single-required"; diff --git a/website/test-integration/examples/single.test.tsx b/website/test-integration/examples/single.test.tsx index ffa2a42e0d..42e1819850 100644 --- a/website/test-integration/examples/single.test.tsx +++ b/website/test-integration/examples/single.test.tsx @@ -5,7 +5,7 @@ import { user } from "@site/test/user"; import { freezeBeforeAll } from "@site/test/utils"; import { act, render } from "@testing-library/react"; -import { getDayButton, getTableFooter } from "react-day-picker/test/selectors"; +import { getDayButton, getTableFooter } from "../../../test/selectors"; import Example from "@examples/single"; diff --git a/website/test-integration/examples/spanish-week-starts-on.test.tsx b/website/test-integration/examples/spanish-week-starts-on.test.tsx index d892fb53ab..f966263c7a 100644 --- a/website/test-integration/examples/spanish-week-starts-on.test.tsx +++ b/website/test-integration/examples/spanish-week-starts-on.test.tsx @@ -3,7 +3,7 @@ import React from "react"; import { freezeBeforeAll } from "@site/test/utils"; import { render } from "@testing-library/react"; -import { getMonthGrid } from "react-day-picker/test/selectors"; +import { getMonthGrid } from "../../../test/selectors"; import Example from "@examples/spanish-week-starts-on"; diff --git a/website/test-integration/examples/spanish.test.tsx b/website/test-integration/examples/spanish.test.tsx index a01df6a3f1..d6b3edcba7 100644 --- a/website/test-integration/examples/spanish.test.tsx +++ b/website/test-integration/examples/spanish.test.tsx @@ -4,7 +4,7 @@ import { axe } from "@site/test/axe"; import { freezeBeforeAll } from "@site/test/utils"; import { render } from "@testing-library/react"; -import { getMonthCaption } from "react-day-picker/test/selectors"; +import { getMonthCaption } from "../../../test/selectors"; import Example from "@examples/spanish"; diff --git a/website/test-integration/examples/start.test.tsx b/website/test-integration/examples/start.test.tsx index 1d48ea138a..75a7d42d96 100644 --- a/website/test-integration/examples/start.test.tsx +++ b/website/test-integration/examples/start.test.tsx @@ -5,7 +5,7 @@ import { user } from "@site/test/user"; import { freezeBeforeAll } from "@site/test/utils"; import { act, render } from "@testing-library/react"; -import { getDayButton, getTableFooter } from "react-day-picker/test/selectors"; +import { getDayButton, getTableFooter } from "../../../test/selectors"; import Example from "@examples/start"; diff --git a/website/test-integration/examples/styling-inline.test.tsx b/website/test-integration/examples/styling-inline.test.tsx index 586ed166b1..ebf845a22d 100644 --- a/website/test-integration/examples/styling-inline.test.tsx +++ b/website/test-integration/examples/styling-inline.test.tsx @@ -3,7 +3,7 @@ import React from "react"; import { freezeBeforeAll } from "@site/test/utils"; import { render } from "@testing-library/react"; -import { getMonthCaption } from "react-day-picker/test/selectors"; +import { getMonthCaption } from "../../../test/selectors"; import Example from "@examples/styling-inline"; diff --git a/website/test-integration/examples/useinput.test.tsx b/website/test-integration/examples/useinput.test.tsx index d8614f242f..0571d54cb8 100644 --- a/website/test-integration/examples/useinput.test.tsx +++ b/website/test-integration/examples/useinput.test.tsx @@ -6,10 +6,7 @@ import { freezeBeforeAll } from "@site/test/utils"; import { act, render, screen } from "@testing-library/react"; import { addDays, format } from "date-fns"; -import { - getAllSelectedDays, - getDayButton -} from "react-day-picker/test/selectors"; +import { getAllSelectedDays, getDayButton } from "../../../test/selectors"; import Example from "@examples/useinput"; diff --git a/website/test-integration/examples/weeknumber.test.tsx b/website/test-integration/examples/weeknumber.test.tsx index 28425b8adc..a0d7e5a094 100644 --- a/website/test-integration/examples/weeknumber.test.tsx +++ b/website/test-integration/examples/weeknumber.test.tsx @@ -5,7 +5,7 @@ import { user } from "@site/test/user"; import { freezeBeforeAll } from "@site/test/utils"; import { act, render } from "@testing-library/react"; -import { getTableFooter, getWeekButton } from "react-day-picker/test/selectors"; +import { getTableFooter, getWeekButton } from "../../../test/selectors"; import Example from "@examples/weeknumber"; diff --git a/website/test/utils/focusDaysGrid.ts b/website/test/utils/focusDaysGrid.ts index 6b7de2cbb3..6f8b59980f 100644 --- a/website/test/utils/focusDaysGrid.ts +++ b/website/test/utils/focusDaysGrid.ts @@ -1,9 +1,8 @@ import { fireEvent } from "@testing-library/dom"; import { act } from "@testing-library/react"; -import { getFocusedElement } from "react-day-picker/test/selectors"; - import { user } from "../user"; +import { getFocusedElement } from "../../../test/selectors"; export async function focusDaysGrid() { // Make sure nothing is focused