-
-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: gpbl <[email protected]>
- Loading branch information
Showing
375 changed files
with
12,374 additions
and
415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Config } from "@jest/types"; | ||
|
||
const config: Config.InitialOptions = { | ||
preset: "ts-jest", | ||
moduleNameMapper: { | ||
"\\.css$": "identity-obj-proxy", | ||
"^react-day-picker$": | ||
process.env.TEST_ENV === "build" | ||
? "<rootDir>/dist/cjs/index.js" | ||
: "<rootDir>/src/index.ts", | ||
"^@/test/(.*)$": "<rootDir>/test/$1", | ||
"^react-day-picker/style.module.css$": "react-day-picker/style.css", | ||
}, | ||
roots: ["./src", "./website/examples"], | ||
testEnvironment: "jsdom", | ||
coverageReporters: ["lcov", "text", "clover"], | ||
setupFilesAfterEnv: ["./test/setup.ts"], | ||
fakeTimers: { | ||
enableGlobally: true, | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{ | ||
"name": "react-day-picker-next", | ||
"version": "9.0.0-alpha.1", | ||
"description": "Customizable Date Picker component for React", | ||
"author": "Giampaolo Bellavite <[email protected]>", | ||
"homepage": "https://react-day-picker.dev", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/gpbl/react-day-picker" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/gpbl/react-day-picker/issues" | ||
}, | ||
"funding": { | ||
"type": "individual", | ||
"url": "https://github.com/sponsors/gpbl" | ||
}, | ||
"main": "./dist/cjs/index.js", | ||
"types": "./dist/cjs/index.d.ts", | ||
"module": "./dist/esm/index.js", | ||
"style": "./src/styles.css", | ||
"exports": { | ||
".": { | ||
"require": { | ||
"types": "./dist/cjs/index.d.ts", | ||
"default": "./dist/cjs/index.js" | ||
}, | ||
"import": { | ||
"types": "./dist/esm/index.d.ts", | ||
"default": "./dist/esm/index.js" | ||
} | ||
}, | ||
"./style.css": { | ||
"default": "./src/style.css" | ||
}, | ||
"./style.module.css": { | ||
"default": "./src/style.css", | ||
"types": "./src/style.d.ts" | ||
}, | ||
"./package.json": { | ||
"import": "./package.json", | ||
"require": "./package.json", | ||
"default": "./package.json" | ||
} | ||
}, | ||
"scripts": { | ||
"prepublish": "pnpm build", | ||
"build-website": "pnpm run build && pnpm --filter website run build && rm -rf website/build/cache", | ||
"build:cjs": "tsc --project tsconfig-cjs.json", | ||
"build-typedoc-theme": "rm -rf ./typedoc-theme/dist && tsc -p ./typedoc-theme/tsconfig.json && cp -R ./typedoc-theme/src/resources ./typedoc-theme/dist", | ||
"build:esm": "tsc --project tsconfig-esm.json", | ||
"build": "pnpm build:cjs && pnpm build:esm", | ||
"lint": "eslint src --ext .js,.jsx,.ts,.tsx", | ||
"test": "jest", | ||
"test-watch": "jest --watch", | ||
"test-build": "TEST_ENV=build pnpm run test ./examples" | ||
}, | ||
"files": [ | ||
"docs", | ||
"dist/**", | ||
"src/**" | ||
], | ||
"peerDependencies": { | ||
"date-fns": "^3.1.0", | ||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0" | ||
}, | ||
"devDependencies": { | ||
"@jest/types": "^29.6.3", | ||
"@testing-library/dom": "^9.3.4", | ||
"@testing-library/jest-dom": "^6.4.2", | ||
"@testing-library/react": "^14.2.1", | ||
"@testing-library/user-event": "^14.5.2", | ||
"@types/jest": "^29.5.12", | ||
"@types/node": "^20.11.20", | ||
"@types/react": "^18.2.59", | ||
"@types/react-dom": "^18.2.19", | ||
"@typescript-eslint/eslint-plugin": "^7.1.0", | ||
"@typescript-eslint/parser": "^7.1.0", | ||
"date-fns": "^3.3.1", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-import-resolver-typescript": "^3.6.1", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-jest": "^27.9.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-testing-library": "^6.2.0", | ||
"identity-obj-proxy": "^3.0.0", | ||
"jest": "^29.7.0", | ||
"jest-environment-jsdom": "^29.7.0", | ||
"prettier": "^3.2.5", | ||
"prettier-plugin-jsdoc": "^1.3.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"ts-jest": "^29.1.2", | ||
"ts-node": "^10.9.2", | ||
"tslib": "^2.6.2", | ||
"typescript": "^5.3.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
style.css.d.ts |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Calendar } from "./components/Calendar"; | ||
import { ContextProviders } from "./contexts/ContextProviders"; | ||
import type { | ||
Mode, | ||
PropsBase, | ||
PropsMulti, | ||
PropsRange, | ||
PropsSingle, | ||
} from "./types/props"; | ||
|
||
/** Map of the props supported by selection modes. */ | ||
export interface ModePropsMap { | ||
single: PropsSingle; | ||
multi: PropsMulti; | ||
range: PropsRange; | ||
none: object; | ||
} | ||
|
||
export interface ModeProp<T> { | ||
mode?: T | undefined; | ||
} | ||
|
||
/** | ||
* Defines the props accepted by the DayPicker component. | ||
* | ||
* @see https://react-day-picker.dev/api/daypickerprops | ||
*/ | ||
export type DayPickerProps<T extends Mode> = PropsBase & | ||
ModeProp<T> & | ||
ModePropsMap[T]; | ||
|
||
/** | ||
* Render the date picker component. | ||
* | ||
* @see https://react-day-picker.js.org | ||
*/ | ||
export function DayPicker<T extends Mode = "none">(props: DayPickerProps<T>) { | ||
return ( | ||
<ContextProviders {...props}> | ||
<Calendar /> | ||
</ContextProviders> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export * from "./DayPicker"; | ||
export * from "./contexts/CalendarContext"; | ||
export * from "./contexts/SelectionContext"; | ||
export * from "./contexts/DayPickerContext"; | ||
|
||
export * from "./classes"; | ||
export * from "./components/custom-components"; | ||
export * from "./formatters"; | ||
export * from "./labels"; | ||
|
||
export * from "./types"; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.