Skip to content

Commit f5bb41f

Browse files
Merge branch 'main' into add-dropdown-keyboard-accessibility
2 parents bb77088 + 6d64eff commit f5bb41f

25 files changed

+2788
-1886
lines changed

.github/workflows/security.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Security Review
2+
3+
permissions:
4+
pull-requests: write # Needed for leaving PR comments
5+
contents: read
6+
7+
on:
8+
pull_request:
9+
10+
jobs:
11+
security:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
17+
fetch-depth: 2
18+
19+
- uses: anthropics/claude-code-security-review@main
20+
with:
21+
comment-pr: true
22+
claude-api-key: ${{ secrets.CLAUDE_API_KEY }}

docs-site/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
"highlight.js": "^11.11.1",
99
"lodash": "^4.17.21",
1010
"prism-react-renderer": "^2.4.1",
11-
"react": "^19.1.0",
11+
"react": "^19.1.1",
1212
"react-datepicker": "portal:../",
13-
"react-dom": "^19.1.0",
13+
"react-dom": "^19.1.1",
1414
"react-live": "^4.1.8",
1515
"slugify": "^1.6.6"
1616
},
@@ -21,17 +21,17 @@
2121
"preview": "vite preview"
2222
},
2323
"devDependencies": {
24-
"@eslint/js": "^9.29.0",
25-
"@types/react": "^19.1.8",
26-
"@types/react-dom": "^19.1.6",
27-
"@vitejs/plugin-react": "^4.6.0",
28-
"eslint": "^9.29.0",
24+
"@eslint/js": "^9.33.0",
25+
"@types/react": "^19.1.10",
26+
"@types/react-dom": "^19.1.7",
27+
"@vitejs/plugin-react": "^5.0.0",
28+
"eslint": "^9.33.0",
2929
"eslint-plugin-react": "^7.37.5",
3030
"eslint-plugin-react-hooks": "^6.0.0",
3131
"eslint-plugin-react-refresh": "^0.4.20",
32-
"globals": "^16.2.0",
33-
"sass": "^1.89.2",
34-
"vite": "^6.3.5"
32+
"globals": "^16.3.0",
33+
"sass": "^1.90.0",
34+
"vite": "^7.1.2"
3535
},
3636
"packageManager": "[email protected]"
3737
}

docs-site/src/components/Examples/examples.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@
133133
color: #f00;
134134
}
135135

136+
.react-datepicker__week.highlighted {
137+
background-color: #ddffdd;
138+
border-radius: 5px;
139+
}
140+
136141
.example-custom-input {
137142
cursor: pointer;
138143
padding: 5px 15px;

docs-site/src/components/Examples/index.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import CustomDateFormat from "../../examples/customDateFormat?raw";
1818
import CustomClassName from "../../examples/customClassName?raw";
1919
import CustomCalendarClassName from "../../examples/customCalendarClassName?raw";
2020
import CustomDayClassName from "../../examples/customDayClassName?raw";
21+
import CustomWeekClassName from "../../examples/customWeekClassName?raw";
2122
import CustomTimeClassName from "../../examples/customTimeClassName?raw";
2223
import Today from "../../examples/today?raw";
2324
import PlaceholderText from "../../examples/placeholderText?raw";
@@ -100,6 +101,7 @@ import CustomTimeInput from "../../examples/customTimeInput?raw";
100101
import CloseOnScroll from "../../examples/closeOnScroll?raw";
101102
import CloseOnScrollCallback from "../../examples/closeOnScrollCallback?raw";
102103
import SelectsRange from "../../examples/selectsRange?raw";
104+
import SelectsRangeWithCustomSeparator from "../../examples/customRangeSeparator?raw";
103105
import selectsRangeWithDisabledDates from "../../examples/selectsRangeWithDisabledDates?raw";
104106
import CalendarStartDay from "../../examples/calendarStartDay?raw";
105107
import ExternalForm from "../../examples/externalForm?raw";
@@ -222,6 +224,10 @@ export default class exampleComponents extends React.Component {
222224
title: "Custom day class name",
223225
component: CustomDayClassName,
224226
},
227+
{
228+
title: "Custom week class name",
229+
component: CustomWeekClassName,
230+
},
225231
{
226232
title: "Custom date format",
227233
component: CustomDateFormat,
@@ -242,6 +248,10 @@ export default class exampleComponents extends React.Component {
242248
title: "Date range for one datepicker",
243249
component: SelectsRange,
244250
},
251+
{
252+
title: "Date range for one datepicker with custom range separator",
253+
component: SelectsRangeWithCustomSeparator,
254+
},
245255
{
246256
title: "Date range for one datepicker with disabled dates highlighted",
247257
component: selectsRangeWithDisabledDates,
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
() => {
2+
const [startDate, setStartDate] = useState(new Date());
3+
const [endDate, setEndDate] = useState(addDays(new Date(), 3));
4+
5+
const onChange = (dates) => {
6+
const [start, end] = dates;
7+
setStartDate(start);
8+
setEndDate(end);
9+
};
10+
11+
return (
12+
<DatePicker
13+
selected={startDate}
14+
onChange={onChange}
15+
startDate={startDate}
16+
endDate={endDate}
17+
selectsRange
18+
rangeSeparator=" to "
19+
/>
20+
);
21+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
() => {
2+
const [selectedDate, setSelectedDate] = useState(new Date());
3+
return (
4+
<DatePicker
5+
selected={selectedDate}
6+
onChange={(date) => setSelectedDate(date)}
7+
weekClassName={(date) =>
8+
getDate(date) % 2 === 0 ? "highlighted" : undefined
9+
}
10+
/>
11+
);
12+
};

docs-site/vite.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import { defineConfig } from "vite";
22
import react from "@vitejs/plugin-react";
3+
import path from "path";
4+
import { fileURLToPath } from "url";
5+
6+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
37

48
export default defineConfig({
59
plugins: [react()],
10+
resolve: {
11+
alias: {
12+
// Ensure single React instance to avoid "Invalid hook call" errors
13+
react: path.resolve(__dirname, "node_modules/react"),
14+
"react-dom": path.resolve(__dirname, "node_modules/react-dom"),
15+
},
16+
},
617
});

0 commit comments

Comments
 (0)