Skip to content

Commit

Permalink
feat(date-input, date-range): upgrade react-day-picker to v9
Browse files Browse the repository at this point in the history
Upgrades react-day-picker to remove the dependency on React 18
  • Loading branch information
damienrobson-sage committed Dec 3, 2024
1 parent f87c34c commit beb4f4f
Show file tree
Hide file tree
Showing 22 changed files with 814 additions and 479 deletions.
1 change: 1 addition & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Config } from "jest";

import coverageThresholds from "./coverage-thresholds.json";

const isCI = process.env.CI === "true";
Expand Down
50 changes: 41 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"lodash": "^4.17.21",
"polished": "^4.2.2",
"prop-types": "^15.8.1",
"react-day-picker": "~7.4.10",
"react-day-picker": "^9.3.2",
"react-dnd": "^15.1.2",
"react-dnd-html5-backend": "^15.1.3",
"react-is": "^17.0.2",
Expand Down
3 changes: 2 additions & 1 deletion playwright/components/date-input/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { Page } from "@playwright/test";

import { DAY_PICKER_WRAPPER, DAY_PICKER_HEADING } from "./locators";

// component preview locators

export const dayPickerWrapper = (page: Page) =>
page.locator(DAY_PICKER_WRAPPER);
export const dayPickerHeading = (page: Page) =>
page.locator(DAY_PICKER_HEADING).locator("div");
page.locator(DAY_PICKER_HEADING);
4 changes: 2 additions & 2 deletions playwright/components/date-input/locators.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// component preview locators
export const DAY_PICKER_WRAPPER = 'div[class="DayPicker-wrapper"]';
export const DAY_PICKER_HEADING = ".DayPicker-Caption";
export const DAY_PICKER_WRAPPER = 'div[class="rdp-root"]';
export const DAY_PICKER_HEADING = 'span[class="rdp-caption_label"]';
2 changes: 1 addition & 1 deletion src/__internal__/utils/logger/logger.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Logger from ".";

test("should not output a warning to the console when logging is disabled", () => {
test("should not output a warning to the console when logging is disabled and a deprecation message is fired", () => {
Logger.setEnabledState(false);
const consoleWarnSpy = jest
.spyOn(console, "warn")
Expand Down
2 changes: 2 additions & 0 deletions src/components/date/__internal__/date-fns-fp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
export { default as format } from "date-fns/fp/format";
export { default as formatISO } from "date-fns/fp/formatISO";
export { default as isMatch } from "date-fns/fp/isMatch";
export { default as isValid } from "date-fns/fp/isValid";
export { default as parse } from "date-fns/fp/parse";
export { default as parseWithOptions } from "date-fns/fp/parseWithOptions";
export { default as parseISO } from "date-fns/fp/parseISO";
Loading

0 comments on commit beb4f4f

Please sign in to comment.