diff --git a/src/DayPicker.test.tsx b/src/DayPicker.test.tsx index 4b55b1e35f..a525df467c 100644 --- a/src/DayPicker.test.tsx +++ b/src/DayPicker.test.tsx @@ -1,8 +1,8 @@ -import React from "react"; +import React from "react" -import { render, screen } from "@testing-library/react"; +import { render, screen } from "@testing-library/react" -import { DayPicker } from "./DayPicker"; +import { DayPicker } from "./DayPicker.js" test("should render a date picker component", () => { render(); diff --git a/src/DayPicker.tsx b/src/DayPicker.tsx index a22c31013c..ec02df0cfc 100644 --- a/src/DayPicker.tsx +++ b/src/DayPicker.tsx @@ -1,8 +1,8 @@ -import React from "react"; +import React from "react" -import { Calendar } from "./components/Calendar"; -import { ContextProviders } from "./contexts/providers"; -import type { DayPickerProps } from "./types"; +import { Calendar } from "./components/Calendar.js" +import { ContextProviders } from "./contexts/providers.js" +import type { DayPickerProps } from "./types/index.js" /** * Render the date picker calendar. diff --git a/src/UI.ts b/src/UI.ts index f8705cf4c7..e3c696f990 100644 --- a/src/UI.ts +++ b/src/UI.ts @@ -1,4 +1,4 @@ -import type { CustomComponents, ClassNames, Styles } from "./types"; +import type { CustomComponents, ClassNames, Styles } from "./types/index.js" /** * The UI elements composing DayPicker. These elements are mapped to diff --git a/src/classes/CalendarDay.test.ts b/src/classes/CalendarDay.test.ts index 8a250af2cd..4c9066f676 100644 --- a/src/classes/CalendarDay.test.ts +++ b/src/classes/CalendarDay.test.ts @@ -1,4 +1,4 @@ -import { CalendarDay } from "./CalendarDay"; +import { CalendarDay } from "./CalendarDay.js" it("should set `displayMonth` to undefined when date and `displayMonth` are in the same month", () => { const date = new Date(2020, 0, 1); diff --git a/src/classes/CalendarDay.ts b/src/classes/CalendarDay.ts index ed928ce090..4a1c0643d8 100644 --- a/src/classes/CalendarDay.ts +++ b/src/classes/CalendarDay.ts @@ -1,5 +1,5 @@ -import { dateLib as defaultDateLib } from "../lib"; -import type { DateLib } from "../types"; +import { dateLib as defaultDateLib } from "../lib/index.js" +import type { DateLib } from "../types/index.js" /** * Represent the day displayed in the calendar. diff --git a/src/classes/CalendarMonth.test.ts b/src/classes/CalendarMonth.test.ts index deb245bc29..962bbb1b8e 100644 --- a/src/classes/CalendarMonth.test.ts +++ b/src/classes/CalendarMonth.test.ts @@ -1,6 +1,6 @@ -import { CalendarDay } from "./CalendarDay"; -import { CalendarMonth } from "./CalendarMonth"; -import { CalendarWeek } from "./CalendarWeek"; +import { CalendarDay } from "./CalendarDay.js" +import { CalendarMonth } from "./CalendarMonth.js" +import { CalendarWeek } from "./CalendarWeek.js" let month: CalendarMonth; let date: Date; diff --git a/src/classes/CalendarMonth.ts b/src/classes/CalendarMonth.ts index 1693873f62..338a9b58a3 100644 --- a/src/classes/CalendarMonth.ts +++ b/src/classes/CalendarMonth.ts @@ -1,4 +1,4 @@ -import { CalendarWeek } from "./CalendarWeek"; +import { CalendarWeek } from "./CalendarWeek.js" /** Represent a month in a calendar year. Contains the weeks within the month. */ export class CalendarMonth { diff --git a/src/classes/CalendarWeek.test.ts b/src/classes/CalendarWeek.test.ts index 9d2c2be9ff..711fa210d6 100644 --- a/src/classes/CalendarWeek.test.ts +++ b/src/classes/CalendarWeek.test.ts @@ -1,5 +1,5 @@ -import { CalendarDay } from "./CalendarDay"; -import { CalendarWeek } from "./CalendarWeek"; +import { CalendarDay } from "./CalendarDay.js" +import { CalendarWeek } from "./CalendarWeek.js" let week: CalendarWeek; const days = [ diff --git a/src/classes/CalendarWeek.ts b/src/classes/CalendarWeek.ts index b56fa5f0f3..964351eb2c 100644 --- a/src/classes/CalendarWeek.ts +++ b/src/classes/CalendarWeek.ts @@ -1,4 +1,4 @@ -import { CalendarDay } from "./CalendarDay"; +import { CalendarDay } from "./CalendarDay.js" /** Represent a week in a calendar month. */ export class CalendarWeek { diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 05ca2e41d1..5924e34786 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -1,4 +1,4 @@ -import React, { type ButtonHTMLAttributes } from "react"; +import React, { type ButtonHTMLAttributes } from "react" /** * Render the button elements in the calendar. diff --git a/src/components/Calendar.test.tsx b/src/components/Calendar.test.tsx index 847564f121..6a645b3da6 100644 --- a/src/components/Calendar.test.tsx +++ b/src/components/Calendar.test.tsx @@ -1,9 +1,9 @@ -import React from "react"; +import React from "react" -import { grid, nav } from "@/test/elements"; -import { render } from "@/test/render"; +import { grid, nav } from "@/test/elements.js" +import { render } from "@/test/render.js" -import { Calendar } from "./Calendar"; +import { Calendar } from "./Calendar.js" it("should render the navigation and month grids", () => { render(); diff --git a/src/components/Calendar.tsx b/src/components/Calendar.tsx index 14767b924b..b539b2f3cd 100644 --- a/src/components/Calendar.tsx +++ b/src/components/Calendar.tsx @@ -1,12 +1,12 @@ -import React from "react"; +import React from "react" -import { UI, CalendarFlag } from "../UI"; -import { useCalendar, useProps } from "../contexts"; +import { UI, CalendarFlag } from "../UI.js" +import { useCalendar, useProps } from "../contexts/index.js" -import { Footer as DefaultFooter } from "./Footer"; -import { Month as DefaultMonth } from "./Month"; -import { Months as DefaultMonths } from "./Months"; -import { Nav as DefaultNav } from "./Nav"; +import { Footer as DefaultFooter } from "./Footer.js" +import { Month as DefaultMonth } from "./Month.js" +import { Months as DefaultMonths } from "./Months.js" +import { Nav as DefaultNav } from "./Nav.js" /** * Render the DayPicker Calendar with navigation and the month grids. diff --git a/src/components/Chevron.tsx b/src/components/Chevron.tsx index 984936ad3d..cc00d09866 100644 --- a/src/components/Chevron.tsx +++ b/src/components/Chevron.tsx @@ -1,7 +1,7 @@ -import React from "react"; +import React from "react" -import { ChevronFlag, UI } from "../UI"; -import { useProps } from "../contexts"; +import { ChevronFlag, UI } from "../UI.js" +import { useProps } from "../contexts/index.js" /** * Render the chevron icon used in the navigation buttons and dropdowns. diff --git a/src/components/Day.tsx b/src/components/Day.tsx index efc3589eae..4b90f4defa 100644 --- a/src/components/Day.tsx +++ b/src/components/Day.tsx @@ -1,8 +1,8 @@ -import React from "react"; -import type { ReactNode } from "react"; +import React from "react" +import type { ReactNode } from "react" -import type { CalendarDay } from "../classes"; -import type { Modifiers } from "../types"; +import type { CalendarDay } from "../classes/index.js" +import type { Modifiers } from "../types/index.js" /** * Render the gridcell of a day in the calendar and handle the interaction and diff --git a/src/components/DayDate.tsx b/src/components/DayDate.tsx index b6c7abbb32..3e762f6486 100644 --- a/src/components/DayDate.tsx +++ b/src/components/DayDate.tsx @@ -1,7 +1,7 @@ -import React from "react"; +import React from "react" -import type { CalendarDay } from "../classes"; -import type { Modifiers } from "../types"; +import type { CalendarDay } from "../classes/index.js" +import type { Modifiers } from "../types/index.js" /** * Render the date as string inside the day grid cell. diff --git a/src/components/DayWrapper.tsx b/src/components/DayWrapper.tsx index 46136edd8d..79ed48398f 100644 --- a/src/components/DayWrapper.tsx +++ b/src/components/DayWrapper.tsx @@ -1,15 +1,15 @@ -import React from "react"; +import React from "react" -import { UI, DayFlag } from "../UI"; -import { CalendarDay } from "../classes/CalendarDay"; -import { useCalendar, useFocus, useModifiers, useProps } from "../contexts"; -import { debounce } from "../helpers/debounce"; -import { getClassNamesForModifiers } from "../helpers/getClassNamesForModifiers"; -import { getStyleForModifiers } from "../helpers/getStyleForModifiers"; -import { useMulti, useRange, useSingle } from "../selection"; +import { UI, DayFlag } from "../UI.js" +import { CalendarDay } from "../classes/CalendarDay.js" +import { useCalendar, useFocus, useModifiers, useProps } from "../contexts/index.js" +import { debounce } from "../helpers/debounce.js" +import { getClassNamesForModifiers } from "../helpers/getClassNamesForModifiers.js" +import { getStyleForModifiers } from "../helpers/getStyleForModifiers.js" +import { useMulti, useRange, useSingle } from "../selection/index.js" -import { type DayProps, Day as DefaultDay } from "./Day"; -import { type DayDateProps, DayDate as DefaultDayDate } from "./DayDate"; +import { type DayProps, Day as DefaultDay } from "./Day.js" +import { type DayDateProps, DayDate as DefaultDayDate } from "./DayDate.js" /** * Provides a `Day` the day state and the html attributes. Developers may use a diff --git a/src/components/Dropdown.tsx b/src/components/Dropdown.tsx index fb395cbebc..2a79c6d1f4 100644 --- a/src/components/Dropdown.tsx +++ b/src/components/Dropdown.tsx @@ -1,11 +1,11 @@ -import React, { type SelectHTMLAttributes } from "react"; +import React, { type SelectHTMLAttributes } from "react" -import { UI } from "../UI"; -import { useProps } from "../contexts"; +import { UI } from "../UI.js" +import { useProps } from "../contexts/index.js" -import { Chevron as DefaultChevron } from "./Chevron"; -import { Option as DefaultOption } from "./Option"; -import { Select as DefaultSelect } from "./Select"; +import { Chevron as DefaultChevron } from "./Chevron.js" +import { Option as DefaultOption } from "./Option.js" +import { Select as DefaultSelect } from "./Select.js" /** An option to use in the dropdown. Maps to the `