Skip to content

Commit

Permalink
Last update
Browse files Browse the repository at this point in the history
Signed-off-by: gpbl <[email protected]>
  • Loading branch information
gpbl committed Mar 2, 2024
1 parent 4414b47 commit 2d5b17f
Show file tree
Hide file tree
Showing 375 changed files with 12,374 additions and 415 deletions.
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "https://json.schemastore.org/prettierrc",
"tabWidth": 2,
"useTabs": false,
"singleQuote": false,
"plugins": [
"prettier-plugin-jsdoc"
]
Expand Down
4 changes: 4 additions & 0 deletions 9.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@
{
"path": "docs",
},
{
"path": "next",
},
],
"settings": {
"files.exclude": {
"website": true,
"docs": true,
"next": true,
"typedoc": true,
},
"cSpell.enabled": true,
Expand Down
23 changes: 23 additions & 0 deletions next/jest.config.ts
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;
101 changes: 101 additions & 0 deletions next/package.json
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"
}
}
1 change: 1 addition & 0 deletions next/src/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style.css.d.ts
File renamed without changes.
43 changes: 43 additions & 0 deletions next/src/DayPicker.tsx
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.
11 changes: 11 additions & 0 deletions next/src/index.ts
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.
Loading

0 comments on commit 2d5b17f

Please sign in to comment.