Skip to content

Commit f4006b7

Browse files
committed
[breaking] Don't import styles by default
1 parent a5fc7c0 commit f4006b7

File tree

8 files changed

+10
-32
lines changed

8 files changed

+10
-32
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,12 @@ function MyApp() {
6666

6767
### Custom styling
6868

69-
If you don't want to use default React-Date-Picker and React-Calendar styles, you can import React-Date-Picker without them by using `import DatePicker from 'react-date-picker/dist/entry.nostyle';` instead.
69+
If you want to use default React-Date-Picker and React-Calendar styling to build upon it, you can import them by using:
7070

71-
Styles loaded by the default entry file are `react-date-picker/dist/DatePicker.css` and `react-calendar/dist/Calendar.css`. You can copy them to your project to build your own upon them.
71+
```js
72+
import 'react-date-picker/dist/DatePicker.css';
73+
import 'react-calendar/dist/Calendar.css';
74+
```
7275

7376
### Next.js and Vite
7477

copy-types.mjs

Lines changed: 0 additions & 9 deletions
This file was deleted.

entry.nostyle.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

jest.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"collectCoverageFrom": ["**/src/**.{js,jsx}", "!**/src/entry.js", "!**/src/entry.nostyle.js"],
2+
"collectCoverageFrom": ["**/src/**.{js,jsx}", "!**/src/index.js"],
33
"reporters": ["default", "github-actions"],
44
"setupFilesAfterEnv": ["@testing-library/jest-dom"],
55
"testEnvironment": "jsdom"

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
"name": "react-date-picker",
33
"version": "9.2.0",
44
"description": "A date picker for your React app.",
5-
"main": "dist/entry.js",
6-
"source": "src/entry.js",
5+
"main": "dist/index.js",
6+
"source": "src/index.js",
77
"types": "./index.d.ts",
88
"scripts": {
9-
"build": "yarn build-js && yarn copy-styles && yarn copy-types",
9+
"build": "yarn build-js && yarn copy-styles",
1010
"build-js": "babel src -d dist --ignore \"**/*.spec.js,**/*.spec.jsx\"",
1111
"clean": "rimraf dist",
1212
"copy-styles": "node ./copy-styles.mjs",
13-
"copy-types": "node ./copy-types.mjs",
1413
"jest": "jest",
1514
"lint": "eslint . --ext .js,.jsx",
1615
"postinstall": "husky install",

src/entry.js

Lines changed: 0 additions & 11 deletions
This file was deleted.
File renamed without changes.

test/Test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useRef, useState } from 'react';
2-
import DatePicker from 'react-date-picker/src/entry.nostyle';
2+
import DatePicker from 'react-date-picker/src';
33
import 'react-date-picker/src/DatePicker.css';
44
import 'react-calendar/dist/Calendar.css';
55

0 commit comments

Comments
 (0)