react-attendance-calendar 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/AttendanceCalendar.d.ts +30 -0
- package/dist/AttendanceCalendar.d.ts.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -20,6 +20,20 @@ A highly customizable and developer-friendly React attendance calendar component
|
|
|
20
20
|
npm install react-attendance-calendar
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
### CSS Import
|
|
24
|
+
|
|
25
|
+
The component includes its own CSS styles. Import the CSS file:
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import "react-attendance-calendar/dist/index.css";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or if your bundler supports the `style` field:
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import "react-attendance-calendar";
|
|
35
|
+
```
|
|
36
|
+
|
|
23
37
|
## Usage
|
|
24
38
|
|
|
25
39
|
### Basic Usage
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ClassValue } from "clsx";
|
|
2
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
|
+
export type MonthView = {
|
|
4
|
+
year: number;
|
|
5
|
+
monthIndex: number;
|
|
6
|
+
};
|
|
7
|
+
export type AttendanceData = {
|
|
8
|
+
year: number;
|
|
9
|
+
monthIndex: number;
|
|
10
|
+
presentDays: Set<number>;
|
|
11
|
+
absentDays: Set<number>;
|
|
12
|
+
};
|
|
13
|
+
export type CalendarProps = {
|
|
14
|
+
view: MonthView;
|
|
15
|
+
onChangeView: (next: MonthView) => void;
|
|
16
|
+
attendanceData?: AttendanceData;
|
|
17
|
+
onDateClick?: (day: number, month: number, year: number) => void;
|
|
18
|
+
showNavigation?: boolean;
|
|
19
|
+
showWeekdayHeaders?: boolean;
|
|
20
|
+
className?: string;
|
|
21
|
+
cellClassName?: string;
|
|
22
|
+
presentCellClassName?: string;
|
|
23
|
+
absentCellClassName?: string;
|
|
24
|
+
navigationButtonClassName?: string;
|
|
25
|
+
weekdayHeaderClassName?: string;
|
|
26
|
+
monthTitleClassName?: string;
|
|
27
|
+
containerClassName?: string;
|
|
28
|
+
};
|
|
29
|
+
export default function AttendanceCalendar({ view, onChangeView, attendanceData, onDateClick, showNavigation, showWeekdayHeaders, className, cellClassName, presentCellClassName, absentCellClassName, navigationButtonClassName, weekdayHeaderClassName, monthTitleClassName, containerClassName, }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=AttendanceCalendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttendanceCalendar.d.ts","sourceRoot":"","sources":["../src/AttendanceCalendar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAI7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAuCF,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,IAAI,EACJ,YAAY,EACZ,cAAc,EACd,WAAW,EACX,cAAqB,EACrB,kBAAyB,EACzB,SAAc,EAEd,aAAkB,EAClB,oBAAyB,EACzB,mBAAwB,EACxB,yBAA8B,EAC9B,sBAA2B,EAC3B,mBAAwB,EACxB,kBAAuB,GACxB,EAAE,aAAa,2CAkNf"}
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.w-full{width:100%}.flex{display:flex}.grid{display:grid}.hidden{display:none}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.place-items-center{place-items:center}.size-8{width:2rem;height:2rem}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-14{width:3.5rem;height:3.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.mb-12{margin-bottom:3rem}.ml-2{margin-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.text-white{color:#fff}.text-slate-500{color:#64748b}.text-slate-600{color:#475569}.text-slate-700{color:#334155}.text-slate-900{color:#0f172a}.bg-emerald-500{background-color:#10b981}.bg-amber-500{background-color:#f59e0b}.bg-slate-50{background-color:#f8fafc}.bg-slate-100{background-color:#f1f5f9}.bg-slate-200{background-color:#e2e8f0}.bg-transparent{background-color:transparent}.border{border-width:1px}.border-2{border-width:2px}.border-slate-200{border-color:#e2e8f0}.rounded-xl{border-radius:.75rem}.rounded-2xl{border-radius:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.font-semibold{font-weight:600}.font-bold{font-weight:700}.uppercase{text-transform:uppercase}.tracking-wide{letter-spacing:.025em}.text-center{text-align:center}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.hover\:bg-slate-50:hover{background-color:#f8fafc}.hover\:bg-blue-600:hover{background-color:#2563eb}.hover\:scale-105:hover{transform:scale(1.05)}.hover\:scale-110:hover{transform:scale(1.1)}.cursor-pointer{cursor:pointer}@media (min-width: 640px){.sm\:size-12{width:3rem;height:3rem}.sm\:size-14{width:3.5rem;height:3.5rem}}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-14{grid-template-columns:repeat(14,minmax(0,1fr))}.calendar-grid-7{grid-template-columns:repeat(7,minmax(0,1fr))}.calendar-grid-14{grid-template-columns:repeat(14,minmax(0,1fr))}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAC;AACzE,YAAY,EACV,SAAS,EACT,cAAc,EACd,aAAa,GACd,MAAM,sBAAsB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-attendance-calendar",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "A responsive React attendance calendar component with TypeScript support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
+
"style": "./dist/index.css",
|
|
9
10
|
"exports": {
|
|
10
11
|
".": {
|
|
11
12
|
"import": "./dist/index.js",
|
|
12
|
-
"types": "./dist/index.d.ts"
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"style": "./dist/index.css"
|
|
13
15
|
}
|
|
14
16
|
},
|
|
15
17
|
"files": [
|
|
@@ -24,7 +26,7 @@
|
|
|
24
26
|
"component",
|
|
25
27
|
"ui"
|
|
26
28
|
],
|
|
27
|
-
"author": "
|
|
29
|
+
"author": "Alamin",
|
|
28
30
|
"license": "MIT",
|
|
29
31
|
"repository": {
|
|
30
32
|
"type": "git",
|
|
@@ -37,7 +39,7 @@
|
|
|
37
39
|
},
|
|
38
40
|
"scripts": {
|
|
39
41
|
"dev": "vite",
|
|
40
|
-
"build": "tsc --project tsconfig.lib.json
|
|
42
|
+
"build": "vite build --mode library && tsc --project tsconfig.lib.json",
|
|
41
43
|
"build:types": "tsc --emitDeclarationOnly",
|
|
42
44
|
"lint": "eslint .",
|
|
43
45
|
"preview": "vite preview",
|