diff --git a/docs-site/package.json b/docs-site/package.json index 9577466a7..9cc7d916e 100644 --- a/docs-site/package.json +++ b/docs-site/package.json @@ -6,7 +6,7 @@ "highlight.js": "^11.10.0", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-live": "^4.1.7" + "react-live": "^4.1.8" }, "scripts": { "start": "react-app-rewired start", @@ -29,7 +29,7 @@ "raw-loader": "^4.0.2", "react-app-rewired": "^2.2.1", "react-scripts": "5.0.1", - "sass": "^1.80.7" + "sass": "^1.81.0" }, "resolutions": { "strip-ansi": "6.0.1" diff --git a/docs-site/yarn.lock b/docs-site/yarn.lock index 38ea8fe30..5c8b05c12 100644 --- a/docs-site/yarn.lock +++ b/docs-site/yarn.lock @@ -5038,13 +5038,13 @@ __metadata: linkType: hard "cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": - version: 7.0.3 - resolution: "cross-spawn@npm:7.0.3" + version: 7.0.5 + resolution: "cross-spawn@npm:7.0.5" dependencies: path-key: "npm:^3.1.0" shebang-command: "npm:^2.0.0" which: "npm:^2.0.1" - checksum: 10c0/5738c312387081c98d69c98e105b6327b069197f864a60593245d64c8089c8a0a744e16349281210d56835bb9274130d825a78b2ad6853ca13cfbeffc0c31750 + checksum: 10c0/aa82ce7ac0814a27e6f2b738c5a7cf1fa21a3558a1e42df449fc96541ba3ba731e4d3ecffa4435348808a86212f287c6f20a1ee551ef1ff95d01cfec5f434944 languageName: node linkType: hard @@ -10787,15 +10787,15 @@ __metadata: languageName: node linkType: hard -"prism-react-renderer@npm:^2.0.6": - version: 2.3.1 - resolution: "prism-react-renderer@npm:2.3.1" +"prism-react-renderer@npm:^2.4.0": + version: 2.4.0 + resolution: "prism-react-renderer@npm:2.4.0" dependencies: "@types/prismjs": "npm:^1.26.0" clsx: "npm:^2.0.0" peerDependencies: react: ">=16.0.0" - checksum: 10c0/566932127ca18049a651aa038a8f8c7c1ca15950d21b659c2ce71fd95bd03bef2b5d40c489e7aa3453eaf15d984deef542a609d7842e423e6a13427dd90bd371 + checksum: 10c0/3d6969b057da0efe39e3e637bf93601cd5757de5919180e8df16daf1d1b8eedc39b70c7f6f28724fba0a01bc857c6b78312ab027f4e913159d1165c5aba235bb languageName: node linkType: hard @@ -10992,9 +10992,9 @@ __metadata: react: "npm:^18.3.1" react-app-rewired: "npm:^2.2.1" react-dom: "npm:^18.3.1" - react-live: "npm:^4.1.7" + react-live: "npm:^4.1.8" react-scripts: "npm:5.0.1" - sass: "npm:^1.80.7" + sass: "npm:^1.81.0" languageName: unknown linkType: soft @@ -11070,17 +11070,17 @@ __metadata: languageName: node linkType: hard -"react-live@npm:^4.1.7": - version: 4.1.7 - resolution: "react-live@npm:4.1.7" +"react-live@npm:^4.1.8": + version: 4.1.8 + resolution: "react-live@npm:4.1.8" dependencies: - prism-react-renderer: "npm:^2.0.6" - sucrase: "npm:^3.31.0" + prism-react-renderer: "npm:^2.4.0" + sucrase: "npm:^3.35.0" use-editable: "npm:^2.3.3" peerDependencies: react: ">=18.0.0" react-dom: ">=18.0.0" - checksum: 10c0/728a51cb0b92774076e4592f9b3cbc2af4afac1da549dbb55723728324bdc1968d3f7b268b5dd92929dcc9d3aa1fd1265f7e912b5ee6fd4fe9b5b77898b50237 + checksum: 10c0/fa96ca176bc9074e4892d6a079b94488ba74e95907ea187678afb17e4a23cc7760c3774ef17f4429d2ba562f1fda852a822e18a161ef386676371c56a7585970 languageName: node linkType: hard @@ -11591,9 +11591,9 @@ __metadata: languageName: node linkType: hard -"sass@npm:^1.80.7": - version: 1.80.7 - resolution: "sass@npm:1.80.7" +"sass@npm:^1.81.0": + version: 1.81.0 + resolution: "sass@npm:1.81.0" dependencies: "@parcel/watcher": "npm:^2.4.1" chokidar: "npm:^4.0.0" @@ -11604,7 +11604,7 @@ __metadata: optional: true bin: sass: sass.js - checksum: 10c0/e0e0df8dc9dd7694826f915196a96cda45fe0fc849be9fc08b43c12aa1250eb512130979ed239e1106476973ace1f52abbcc1d5900a075d3813c282a626dcbf7 + checksum: 10c0/9c59b3c9b4231c18fcb4583cc232dbc4de501ddc11101b7a025e44833e3f3ce6031546dc1cd109ee9f04ebcfb1fe30ff870810af33b8feb9aa9e36dfba9ec1ef languageName: node linkType: hard @@ -12283,7 +12283,7 @@ __metadata: languageName: node linkType: hard -"sucrase@npm:^3.31.0, sucrase@npm:^3.32.0": +"sucrase@npm:^3.32.0, sucrase@npm:^3.35.0": version: 3.35.0 resolution: "sucrase@npm:3.35.0" dependencies: diff --git a/examples/hello-world/yarn.lock b/examples/hello-world/yarn.lock index 904c9784b..ee71c6100 100644 --- a/examples/hello-world/yarn.lock +++ b/examples/hello-world/yarn.lock @@ -4947,13 +4947,13 @@ __metadata: linkType: hard "cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": - version: 7.0.3 - resolution: "cross-spawn@npm:7.0.3" + version: 7.0.5 + resolution: "cross-spawn@npm:7.0.5" dependencies: path-key: "npm:^3.1.0" shebang-command: "npm:^2.0.0" which: "npm:^2.0.1" - checksum: 10c0/5738c312387081c98d69c98e105b6327b069197f864a60593245d64c8089c8a0a744e16349281210d56835bb9274130d825a78b2ad6853ca13cfbeffc0c31750 + checksum: 10c0/aa82ce7ac0814a27e6f2b738c5a7cf1fa21a3558a1e42df449fc96541ba3ba731e4d3ecffa4435348808a86212f287c6f20a1ee551ef1ff95d01cfec5f434944 languageName: node linkType: hard diff --git a/src/calendar_container.tsx b/src/calendar_container.tsx index 69fa205b3..2d6ece029 100644 --- a/src/calendar_container.tsx +++ b/src/calendar_container.tsx @@ -1,9 +1,9 @@ import React from "react"; -export interface CalendarContainerProps extends React.PropsWithChildren { +export interface CalendarContainerProps + extends React.PropsWithChildren { showTimeSelectOnly?: boolean; showTime?: boolean; - className?: string; } const CalendarContainer: React.FC = function ({ diff --git a/src/popper_component.tsx b/src/popper_component.tsx index 5ea2e0738..94e1f6c8a 100644 --- a/src/popper_component.tsx +++ b/src/popper_component.tsx @@ -7,6 +7,7 @@ import TabLoop from "./tab_loop"; import withFloating from "./with_floating"; import type { FloatingProps } from "./with_floating"; +import type { ReactNode } from "react"; interface PortalProps extends Omit, "children"> {} @@ -20,7 +21,7 @@ interface PopperComponentProps className?: string; wrapperClassName?: string; popperComponent: React.ReactNode; - popperContainer?: React.FC; + popperContainer?: React.FC<{ children?: ReactNode | undefined }>; targetComponent: React.ReactNode; popperOnKeyDown: React.KeyboardEventHandler; showArrow?: boolean; diff --git a/src/stylesheets/datepicker.scss b/src/stylesheets/datepicker.scss index c68daaa9c..471fab9c0 100644 --- a/src/stylesheets/datepicker.scss +++ b/src/stylesheets/datepicker.scss @@ -347,10 +347,7 @@ h2.react-datepicker__current-month { &.react-datepicker__week-number--clickable { cursor: pointer; - &:not( - .react-datepicker__week-number--selected, - .react-datepicker__week-number--keyboard-selected - ):hover { + &:not(.react-datepicker__week-number--selected):hover { border-radius: $datepicker__border-radius; background-color: $datepicker__background-color; } @@ -368,22 +365,6 @@ h2.react-datepicker__current-month { ); } } - - &--keyboard-selected { - border-radius: $datepicker__border-radius; - background-color: color.adjust( - $datepicker__selected-color, - $lightness: 10% - ); - color: #fff; - - &:hover { - background-color: color.adjust( - $datepicker__selected-color, - $lightness: -5% - ); - } - } } .react-datepicker__day-names { diff --git a/src/tab_loop.tsx b/src/tab_loop.tsx index 4a6e0b15e..3695b1117 100644 --- a/src/tab_loop.tsx +++ b/src/tab_loop.tsx @@ -1,7 +1,10 @@ import React, { Component, createRef } from "react"; -interface TabLoopProps extends React.PropsWithChildren { +import type { ReactNode } from "react"; + +interface TabLoopProps { enableTabLoop?: boolean; + children?: ReactNode | undefined; } const focusableElementsSelector = diff --git a/src/test/week_number_test.test.tsx b/src/test/week_number_test.test.tsx index baa704cfa..8345ecbcf 100644 --- a/src/test/week_number_test.test.tsx +++ b/src/test/week_number_test.test.tsx @@ -186,11 +186,6 @@ describe("WeekNumber", () => { ) as HTMLDivElement; expect(weekNumber).not.toBeNull(); - expect( - weekNumber?.classList.contains( - "react-datepicker__week-number--keyboard-selected", - ), - ).toBe(false); expect(weekNumber?.tabIndex).toBe(0); }); @@ -212,11 +207,6 @@ describe("WeekNumber", () => { ".react-datepicker__week-number", ) as HTMLDivElement; expect(weekNumber).not.toBeNull(); - expect( - weekNumber?.classList.contains( - "react-datepicker__week-number--keyboard-selected", - ), - ).toBe(true); expect(weekNumber.tabIndex).toBe(0); }); @@ -267,11 +257,6 @@ describe("WeekNumber", () => { const weekNumber = container.querySelector( ".react-datepicker__week-number", ) as HTMLDivElement; - expect( - weekNumber?.classList.contains( - "react-datepicker__week-number--keyboard-selected", - ), - ).toBe(false); expect(weekNumber.tabIndex).toBe(-1); }); }); @@ -403,11 +388,6 @@ describe("WeekNumber", () => { "react-datepicker__week-number--selected", ), ).toBe(false); - expect( - weekNumber?.classList.contains( - "react-datepicker__week-number--keyboard-selected", - ), - ).toBe(true); }); it("should have the class 'react-datepicker__week-number--selected' if selected is not current week and preselected is not current week", () => { @@ -430,11 +410,6 @@ describe("WeekNumber", () => { "react-datepicker__week-number--selected", ), ).toBe(false); - expect( - weekNumber?.classList.contains( - "react-datepicker__week-number--keyboard-selected", - ), - ).toBe(false); }); }); }); diff --git a/src/week_number.tsx b/src/week_number.tsx index 0340466ab..e244916e1 100644 --- a/src/week_number.tsx +++ b/src/week_number.tsx @@ -120,8 +120,6 @@ export default class WeekNumber extends Component { "react-datepicker__week-number--clickable": !!onClick, "react-datepicker__week-number--selected": !!onClick && isSameDay(this.props.date, this.props.selected), - "react-datepicker__week-number--keyboard-selected": - this.isKeyboardSelected(), }; return (