dev #1

Merged
Astrian merged 17 commits from dev into main 2025-02-20 04:29:20 +00:00
6 changed files with 33 additions and 18 deletions
Showing only changes of commit 69dcbd282f - Show all commits

View File

@ -22,13 +22,13 @@
"eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.18", "eslint-plugin-react-refresh": "^0.4.18",
"globals": "^15.14.0", "globals": "^15.14.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sass-embedded": "^1.85.0", "sass-embedded": "^1.85.0",
"typescript": "~5.7.2", "typescript": "~5.7.2",
"typescript-eslint": "^8.22.0", "typescript-eslint": "^8.22.0",
"vite": "^6.1.0", "vite": "^6.1.0",
"vite-plugin-dts": "^4.5.0", "vite-plugin-dts": "^4.5.0"
"react": "^19.0.0",
"react-dom": "^19.0.0"
}, },
"exports": { "exports": {
"import": "./dist/datenel.es.js", "import": "./dist/datenel.es.js",
@ -38,5 +38,7 @@
"main": "dist/index.cjs.js", "main": "dist/index.cjs.js",
"module": "dist/datenel.es.js", "module": "dist/datenel.es.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"files": ["dist"] "files": [
"dist"
]
} }

View File

@ -1,7 +1,7 @@
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
import { getCalendarDates, getL10Weekday, generateUniqueId, applyColor } from '../utils' import { getCalendarDates, getL10Weekday, generateUniqueId, applyColor } from '../utils'
interface Props { export interface SingleDatePickerProps {
/** /**
* Control the selected * Control the selected
* date programmatically, including situations like provide a default value or control the selected * date programmatically, including situations like provide a default value or control the selected
@ -78,9 +78,9 @@ interface Props {
* *
* @component * @component
* *
* @param {Props} props * @param {SingleDatePickerProps} props
*/ */
export default ({ value, onSelect, localization, onClose, mainColor = '#000000', accentColor = '#000000', reversedColor = '#ffffff', hoverColor = '#00000017', borderColor = '#e0e0e0' }: Props) => { const SingleDatePicker: React.FC = ({ value, onSelect, localization, onClose, mainColor = '#000000', accentColor = '#000000', reversedColor = '#ffffff', hoverColor = '#00000017', borderColor = '#e0e0e0' }: SingleDatePickerProps) => {
const [currentMonth, setCurrentMonth] = useState(new Date().getMonth()) const [currentMonth, setCurrentMonth] = useState(new Date().getMonth())
const [currentYear, setCurrentYear] = useState(new Date().getFullYear()) const [currentYear, setCurrentYear] = useState(new Date().getFullYear())
const [selectedDate, setSelectedDate] = useState(new Date()) const [selectedDate, setSelectedDate] = useState(new Date())
@ -225,3 +225,5 @@ export default ({ value, onSelect, localization, onClose, mainColor = '#000000',
</div> </div>
) )
} }
export default SingleDatePicker

View File

@ -10,9 +10,10 @@
/* Bundler mode */ /* Bundler mode */
"moduleResolution": "bundler", "moduleResolution": "bundler",
"allowImportingTsExtensions": true, "allowImportingTsExtensions": true,
"emitDeclarationOnly": true,
"declaration": true,
"isolatedModules": true, "isolatedModules": true,
"moduleDetection": "force", "moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx", "jsx": "react-jsx",
/* Linting */ /* Linting */
@ -20,7 +21,10 @@
"noUnusedLocals": true, "noUnusedLocals": true,
"noUnusedParameters": true, "noUnusedParameters": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true "noUncheckedSideEffectImports": true,
"composite": true,
"outDir": "./dist" //
}, },
"include": ["src"] "include": ["src", "tsconfig.app.json", "tsconfig.node.json"]
} }

View File

@ -9,6 +9,9 @@
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@/*": ["src/*"] "@/*": ["src/*"]
} },
} "declaration": true,
"outDir": "./dist"
},
"include": ["src/**/*", "tsconfig.app.json", "tsconfig.node.json"]
} }

View File

@ -9,16 +9,19 @@
/* Bundler mode */ /* Bundler mode */
"moduleResolution": "bundler", "moduleResolution": "bundler",
"allowImportingTsExtensions": true, "allowImportingTsExtensions": true,
"emitDeclarationOnly": true,
"declaration": true,
"isolatedModules": true, "isolatedModules": true,
"moduleDetection": "force", "moduleDetection": "force",
"noEmit": true,
/* Linting */ /* Linting */
"strict": true, "strict": true,
"noUnusedLocals": true, "noUnusedLocals": true,
"noUnusedParameters": true, "noUnusedParameters": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true "noUncheckedSideEffectImports": true,
"composite": true
}, },
"include": ["vite.config.ts"] "include": ["vite.config.ts"]
} }

View File

@ -20,7 +20,8 @@ export default defineConfig(({mode}) => ({
}, },
}, },
plugins: [react(), dts({ plugins: [react(), dts({
insertTypesEntry: true insertTypesEntry: true,
logLevel: "info"
})], })],
resolve: { resolve: {
alias: { alias: {