react-attendance-calendar 1.0.0
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 +182 -0
- package/dist/index.js +489 -0
- package/dist/index.js.map +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +66 -0
package/README.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Attendance Calendar
|
|
2
|
+
|
|
3
|
+
A highly customizable and developer-friendly React attendance calendar component with TypeScript support. This component provides a clean, modern interface for displaying attendance data with interactive features and full theme customization.
|
|
4
|
+
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
- 📅 **Responsive Design**: Automatically adjusts between 7 and 14 columns based on container width
|
|
8
|
+
- 🎨 **Full Theme Customization**: Customize all colors, borders, and styling
|
|
9
|
+
- 🖱️ **Interactive Dates**: Click on dates to trigger custom actions
|
|
10
|
+
- 📱 **Mobile Friendly**: Responsive design that works on all screen sizes
|
|
11
|
+
- 🔧 **TypeScript Support**: Full TypeScript definitions included
|
|
12
|
+
- ⚡ **Lightweight**: Minimal dependencies, only requires React
|
|
13
|
+
- 🎯 **Accessible**: Includes proper ARIA labels and semantic HTML
|
|
14
|
+
- 🎛️ **Developer Friendly**: Extensive props for customization
|
|
15
|
+
- 🎭 **Pure Tailwind CSS**: No external CSS dependencies
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install react-attendance-calendar
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
### Basic Usage
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import React, { useState } from "react";
|
|
29
|
+
import { AttendanceCalendar, MonthView } from "react-attendance-calendar";
|
|
30
|
+
|
|
31
|
+
function App() {
|
|
32
|
+
const [view, setView] = useState<MonthView>({
|
|
33
|
+
year: 2024,
|
|
34
|
+
monthIndex: 0, // January
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div className="max-w-4xl mx-auto p-4">
|
|
39
|
+
<AttendanceCalendar view={view} onChangeView={setView} />
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### With Attendance Data & Custom Theme
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
import React, { useState } from "react";
|
|
49
|
+
import {
|
|
50
|
+
AttendanceCalendar,
|
|
51
|
+
MonthView,
|
|
52
|
+
AttendanceData,
|
|
53
|
+
CalendarTheme,
|
|
54
|
+
} from "react-attendance-calendar";
|
|
55
|
+
|
|
56
|
+
function App() {
|
|
57
|
+
const [view, setView] = useState<MonthView>({
|
|
58
|
+
year: 2024,
|
|
59
|
+
monthIndex: 0, // January
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// Sample attendance data
|
|
63
|
+
const attendanceData: AttendanceData = {
|
|
64
|
+
year: 2024,
|
|
65
|
+
monthIndex: 0,
|
|
66
|
+
presentDays: new Set([
|
|
67
|
+
1, 2, 3, 5, 8, 9, 10, 12, 15, 16, 17, 19, 22, 23, 24, 26, 29, 30, 31,
|
|
68
|
+
]),
|
|
69
|
+
absentDays: new Set([4, 11, 18, 25]),
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// Custom theme
|
|
73
|
+
const customTheme: CalendarTheme = {
|
|
74
|
+
primaryColor: "#10b981", // Green for present
|
|
75
|
+
absentColor: "#f59e0b", // Orange for absent
|
|
76
|
+
textColor: "#1f2937",
|
|
77
|
+
borderColor: "#d1d5db",
|
|
78
|
+
mutedTextColor: "#9ca3af",
|
|
79
|
+
hoverColor: "#f3f4f6",
|
|
80
|
+
backgroundColor: "#ffffff",
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const handleDateClick = (day: number, month: number, year: number) => {
|
|
84
|
+
console.log(`Clicked on ${day}/${month + 1}/${year}`);
|
|
85
|
+
// Your custom logic here
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<div className="max-w-4xl mx-auto p-4">
|
|
90
|
+
<AttendanceCalendar
|
|
91
|
+
view={view}
|
|
92
|
+
onChangeView={setView}
|
|
93
|
+
attendanceData={attendanceData}
|
|
94
|
+
theme={customTheme}
|
|
95
|
+
onDateClick={handleDateClick}
|
|
96
|
+
showNavigation={true}
|
|
97
|
+
showWeekdayHeaders={true}
|
|
98
|
+
className="border border-gray-200 rounded-lg p-4"
|
|
99
|
+
/>
|
|
100
|
+
</div>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Props
|
|
106
|
+
|
|
107
|
+
### AttendanceCalendar
|
|
108
|
+
|
|
109
|
+
| Prop | Type | Required | Description |
|
|
110
|
+
| -------------------- | ---------------------------------------------------- | -------- | ----------------------------------------------- |
|
|
111
|
+
| `view` | `MonthView` | ✅ | Current month view with year and month index |
|
|
112
|
+
| `onChangeView` | `(view: MonthView) => void` | ✅ | Callback when user navigates to different month |
|
|
113
|
+
| `attendanceData` | `AttendanceData` | ❌ | Optional attendance data to display |
|
|
114
|
+
| `theme` | `CalendarTheme` | ❌ | Custom theme colors and styling |
|
|
115
|
+
| `onDateClick` | `(day: number, month: number, year: number) => void` | ❌ | Callback when a date is clicked |
|
|
116
|
+
| `showNavigation` | `boolean` | ❌ | Show/hide month navigation (default: true) |
|
|
117
|
+
| `showWeekdayHeaders` | `boolean` | ❌ | Show/hide weekday headers (default: true) |
|
|
118
|
+
| `className` | `string` | ❌ | Additional CSS classes |
|
|
119
|
+
|
|
120
|
+
### Types
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
type MonthView = {
|
|
124
|
+
year: number;
|
|
125
|
+
monthIndex: number; // 0-11 (0 = January, 11 = December)
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
type AttendanceData = {
|
|
129
|
+
year: number;
|
|
130
|
+
monthIndex: number; // 0-11
|
|
131
|
+
presentDays: Set<number>; // Set of day numbers (1-31)
|
|
132
|
+
absentDays: Set<number>; // Set of day numbers (1-31)
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
type CalendarTheme = {
|
|
136
|
+
primaryColor?: string; // Color for present days (default: "#3b82f6")
|
|
137
|
+
absentColor?: string; // Color for absent days (default: "#ef4444")
|
|
138
|
+
textColor?: string; // Main text color (default: "#1f2937")
|
|
139
|
+
borderColor?: string; // Border color (default: "#e5e7eb")
|
|
140
|
+
mutedTextColor?: string; // Muted text color (default: "#6b7280")
|
|
141
|
+
hoverColor?: string; // Hover background color (default: "#f3f4f6")
|
|
142
|
+
backgroundColor?: string; // Background color (default: "#ffffff")
|
|
143
|
+
};
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Styling
|
|
147
|
+
|
|
148
|
+
The component uses Tailwind CSS classes. Make sure you have Tailwind CSS installed and configured in your project. The component uses these standard Tailwind classes:
|
|
149
|
+
|
|
150
|
+
- Layout: `w-full`, `flex`, `grid`, `gap-3`, `gap-4`, `items-center`, `justify-center`
|
|
151
|
+
- Sizing: `size-8`, `size-10`, `size-12`, `size-14`
|
|
152
|
+
- Colors: `bg-emerald-500`, `bg-amber-500`, `text-slate-900`, `text-slate-600`
|
|
153
|
+
- Borders: `border`, `border-slate-200`, `rounded-xl`, `rounded-2xl`
|
|
154
|
+
- Spacing: `mb-4`, `mb-6`, `mb-8`, `p-6`, `p-8`
|
|
155
|
+
- Typography: `text-xl`, `text-2xl`, `font-semibold`, `font-bold`
|
|
156
|
+
|
|
157
|
+
### Custom Styling
|
|
158
|
+
|
|
159
|
+
You can customize the appearance using the `theme` prop or by adding custom CSS classes:
|
|
160
|
+
|
|
161
|
+
```tsx
|
|
162
|
+
// Example with custom styling
|
|
163
|
+
<AttendanceCalendar
|
|
164
|
+
view={view}
|
|
165
|
+
onChangeView={setView}
|
|
166
|
+
attendanceData={attendanceData}
|
|
167
|
+
theme={{
|
|
168
|
+
primaryColor: "#3b82f6",
|
|
169
|
+
absentColor: "#ef4444",
|
|
170
|
+
textColor: "#1f2937",
|
|
171
|
+
}}
|
|
172
|
+
className="my-custom-calendar"
|
|
173
|
+
/>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## License
|
|
177
|
+
|
|
178
|
+
MIT
|
|
179
|
+
|
|
180
|
+
## Contributing
|
|
181
|
+
|
|
182
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
import re, { useRef as te, useState as oe, useEffect as ne, useMemo as L } from "react";
|
|
2
|
+
var M = { exports: {} }, g = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var H;
|
|
13
|
+
function se() {
|
|
14
|
+
if (H) return g;
|
|
15
|
+
H = 1;
|
|
16
|
+
var t = Symbol.for("react.transitional.element"), d = Symbol.for("react.fragment");
|
|
17
|
+
function m(E, c, f) {
|
|
18
|
+
var p = null;
|
|
19
|
+
if (f !== void 0 && (p = "" + f), c.key !== void 0 && (p = "" + c.key), "key" in c) {
|
|
20
|
+
f = {};
|
|
21
|
+
for (var b in c)
|
|
22
|
+
b !== "key" && (f[b] = c[b]);
|
|
23
|
+
} else f = c;
|
|
24
|
+
return c = f.ref, {
|
|
25
|
+
$$typeof: t,
|
|
26
|
+
type: E,
|
|
27
|
+
key: p,
|
|
28
|
+
ref: c !== void 0 ? c : null,
|
|
29
|
+
props: f
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return g.Fragment = d, g.jsx = m, g.jsxs = m, g;
|
|
33
|
+
}
|
|
34
|
+
var k = {};
|
|
35
|
+
/**
|
|
36
|
+
* @license React
|
|
37
|
+
* react-jsx-runtime.development.js
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the MIT license found in the
|
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/
|
|
44
|
+
var Z;
|
|
45
|
+
function ae() {
|
|
46
|
+
return Z || (Z = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
|
+
function t(e) {
|
|
48
|
+
if (e == null) return null;
|
|
49
|
+
if (typeof e == "function")
|
|
50
|
+
return e.$$typeof === D ? null : e.displayName || e.name || null;
|
|
51
|
+
if (typeof e == "string") return e;
|
|
52
|
+
switch (e) {
|
|
53
|
+
case y:
|
|
54
|
+
return "Fragment";
|
|
55
|
+
case s:
|
|
56
|
+
return "Profiler";
|
|
57
|
+
case U:
|
|
58
|
+
return "StrictMode";
|
|
59
|
+
case T:
|
|
60
|
+
return "Suspense";
|
|
61
|
+
case O:
|
|
62
|
+
return "SuspenseList";
|
|
63
|
+
case x:
|
|
64
|
+
return "Activity";
|
|
65
|
+
}
|
|
66
|
+
if (typeof e == "object")
|
|
67
|
+
switch (typeof e.tag == "number" && console.error(
|
|
68
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
+
), e.$$typeof) {
|
|
70
|
+
case $:
|
|
71
|
+
return "Portal";
|
|
72
|
+
case o:
|
|
73
|
+
return e.displayName || "Context";
|
|
74
|
+
case I:
|
|
75
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
+
case h:
|
|
77
|
+
var r = e.render;
|
|
78
|
+
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
+
case P:
|
|
80
|
+
return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
|
|
81
|
+
case C:
|
|
82
|
+
r = e._payload, e = e._init;
|
|
83
|
+
try {
|
|
84
|
+
return t(e(r));
|
|
85
|
+
} catch {
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
function d(e) {
|
|
91
|
+
return "" + e;
|
|
92
|
+
}
|
|
93
|
+
function m(e) {
|
|
94
|
+
try {
|
|
95
|
+
d(e);
|
|
96
|
+
var r = !1;
|
|
97
|
+
} catch {
|
|
98
|
+
r = !0;
|
|
99
|
+
}
|
|
100
|
+
if (r) {
|
|
101
|
+
r = console;
|
|
102
|
+
var n = r.error, a = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
|
+
return n.call(
|
|
104
|
+
r,
|
|
105
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
+
a
|
|
107
|
+
), d(e);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function E(e) {
|
|
111
|
+
if (e === y) return "<>";
|
|
112
|
+
if (typeof e == "object" && e !== null && e.$$typeof === C)
|
|
113
|
+
return "<...>";
|
|
114
|
+
try {
|
|
115
|
+
var r = t(e);
|
|
116
|
+
return r ? "<" + r + ">" : "<...>";
|
|
117
|
+
} catch {
|
|
118
|
+
return "<...>";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function c() {
|
|
122
|
+
var e = Y.A;
|
|
123
|
+
return e === null ? null : e.getOwner();
|
|
124
|
+
}
|
|
125
|
+
function f() {
|
|
126
|
+
return Error("react-stack-top-frame");
|
|
127
|
+
}
|
|
128
|
+
function p(e) {
|
|
129
|
+
if (q.call(e, "key")) {
|
|
130
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
|
+
if (r && r.isReactWarning) return !1;
|
|
132
|
+
}
|
|
133
|
+
return e.key !== void 0;
|
|
134
|
+
}
|
|
135
|
+
function b(e, r) {
|
|
136
|
+
function n() {
|
|
137
|
+
G || (G = !0, console.error(
|
|
138
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
|
+
r
|
|
140
|
+
));
|
|
141
|
+
}
|
|
142
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
143
|
+
get: n,
|
|
144
|
+
configurable: !0
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function _() {
|
|
148
|
+
var e = t(this.type);
|
|
149
|
+
return J[e] || (J[e] = !0, console.error(
|
|
150
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
|
+
}
|
|
153
|
+
function i(e, r, n, a, w, F) {
|
|
154
|
+
var l = n.ref;
|
|
155
|
+
return e = {
|
|
156
|
+
$$typeof: N,
|
|
157
|
+
type: e,
|
|
158
|
+
key: r,
|
|
159
|
+
props: n,
|
|
160
|
+
_owner: a
|
|
161
|
+
}, (l !== void 0 ? l : null) !== null ? Object.defineProperty(e, "ref", {
|
|
162
|
+
enumerable: !1,
|
|
163
|
+
get: _
|
|
164
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
165
|
+
configurable: !1,
|
|
166
|
+
enumerable: !1,
|
|
167
|
+
writable: !0,
|
|
168
|
+
value: 0
|
|
169
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
170
|
+
configurable: !1,
|
|
171
|
+
enumerable: !1,
|
|
172
|
+
writable: !0,
|
|
173
|
+
value: null
|
|
174
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
175
|
+
configurable: !1,
|
|
176
|
+
enumerable: !1,
|
|
177
|
+
writable: !0,
|
|
178
|
+
value: w
|
|
179
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
180
|
+
configurable: !1,
|
|
181
|
+
enumerable: !1,
|
|
182
|
+
writable: !0,
|
|
183
|
+
value: F
|
|
184
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
185
|
+
}
|
|
186
|
+
function j(e, r, n, a, w, F) {
|
|
187
|
+
var l = r.children;
|
|
188
|
+
if (l !== void 0)
|
|
189
|
+
if (a)
|
|
190
|
+
if (K(l)) {
|
|
191
|
+
for (a = 0; a < l.length; a++)
|
|
192
|
+
A(l[a]);
|
|
193
|
+
Object.freeze && Object.freeze(l);
|
|
194
|
+
} else
|
|
195
|
+
console.error(
|
|
196
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
|
+
);
|
|
198
|
+
else A(l);
|
|
199
|
+
if (q.call(r, "key")) {
|
|
200
|
+
l = t(e);
|
|
201
|
+
var R = Object.keys(r).filter(function(ee) {
|
|
202
|
+
return ee !== "key";
|
|
203
|
+
});
|
|
204
|
+
a = 0 < R.length ? "{key: someKey, " + R.join(": ..., ") + ": ...}" : "{key: someKey}", X[l + a] || (R = 0 < R.length ? "{" + R.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
206
|
+
let props = %s;
|
|
207
|
+
<%s {...props} />
|
|
208
|
+
React keys must be passed directly to JSX without using spread:
|
|
209
|
+
let props = %s;
|
|
210
|
+
<%s key={someKey} {...props} />`,
|
|
211
|
+
a,
|
|
212
|
+
l,
|
|
213
|
+
R,
|
|
214
|
+
l
|
|
215
|
+
), X[l + a] = !0);
|
|
216
|
+
}
|
|
217
|
+
if (l = null, n !== void 0 && (m(n), l = "" + n), p(r) && (m(r.key), l = "" + r.key), "key" in r) {
|
|
218
|
+
n = {};
|
|
219
|
+
for (var z in r)
|
|
220
|
+
z !== "key" && (n[z] = r[z]);
|
|
221
|
+
} else n = r;
|
|
222
|
+
return l && b(
|
|
223
|
+
n,
|
|
224
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
225
|
+
), i(
|
|
226
|
+
e,
|
|
227
|
+
l,
|
|
228
|
+
n,
|
|
229
|
+
c(),
|
|
230
|
+
w,
|
|
231
|
+
F
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
function A(e) {
|
|
235
|
+
S(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === C && (e._payload.status === "fulfilled" ? S(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
236
|
+
}
|
|
237
|
+
function S(e) {
|
|
238
|
+
return typeof e == "object" && e !== null && e.$$typeof === N;
|
|
239
|
+
}
|
|
240
|
+
var v = re, N = Symbol.for("react.transitional.element"), $ = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), I = Symbol.for("react.consumer"), o = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), O = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), x = Symbol.for("react.activity"), D = Symbol.for("react.client.reference"), Y = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, q = Object.prototype.hasOwnProperty, K = Array.isArray, W = console.createTask ? console.createTask : function() {
|
|
241
|
+
return null;
|
|
242
|
+
};
|
|
243
|
+
v = {
|
|
244
|
+
react_stack_bottom_frame: function(e) {
|
|
245
|
+
return e();
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
var G, J = {}, B = v.react_stack_bottom_frame.bind(
|
|
249
|
+
v,
|
|
250
|
+
f
|
|
251
|
+
)(), V = W(E(f)), X = {};
|
|
252
|
+
k.Fragment = y, k.jsx = function(e, r, n) {
|
|
253
|
+
var a = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return j(
|
|
255
|
+
e,
|
|
256
|
+
r,
|
|
257
|
+
n,
|
|
258
|
+
!1,
|
|
259
|
+
a ? Error("react-stack-top-frame") : B,
|
|
260
|
+
a ? W(E(e)) : V
|
|
261
|
+
);
|
|
262
|
+
}, k.jsxs = function(e, r, n) {
|
|
263
|
+
var a = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return j(
|
|
265
|
+
e,
|
|
266
|
+
r,
|
|
267
|
+
n,
|
|
268
|
+
!0,
|
|
269
|
+
a ? Error("react-stack-top-frame") : B,
|
|
270
|
+
a ? W(E(e)) : V
|
|
271
|
+
);
|
|
272
|
+
};
|
|
273
|
+
})()), k;
|
|
274
|
+
}
|
|
275
|
+
var Q;
|
|
276
|
+
function le() {
|
|
277
|
+
return Q || (Q = 1, process.env.NODE_ENV === "production" ? M.exports = se() : M.exports = ae()), M.exports;
|
|
278
|
+
}
|
|
279
|
+
var u = le();
|
|
280
|
+
const ce = [
|
|
281
|
+
"Sun",
|
|
282
|
+
"Mon",
|
|
283
|
+
"Tue",
|
|
284
|
+
"Wed",
|
|
285
|
+
"Thu",
|
|
286
|
+
"Fri",
|
|
287
|
+
"Sat"
|
|
288
|
+
];
|
|
289
|
+
function ie({ year: t, monthIndex: d }, m) {
|
|
290
|
+
const c = new Date(t, d, 1).getDay(), f = new Date(t, d + 1, 0).getDate(), p = new Date(t, d, 0).getDate(), b = [];
|
|
291
|
+
for (let i = 0; i < c; i++)
|
|
292
|
+
b.push({
|
|
293
|
+
day: p - c + 1 + i,
|
|
294
|
+
inCurrentMonth: !1
|
|
295
|
+
});
|
|
296
|
+
for (let i = 1; i <= f; i++)
|
|
297
|
+
b.push({ day: i, inCurrentMonth: !0 });
|
|
298
|
+
let _ = 1;
|
|
299
|
+
for (; b.length % m !== 0; )
|
|
300
|
+
b.push({ day: _, inCurrentMonth: !1 }), _++;
|
|
301
|
+
return b;
|
|
302
|
+
}
|
|
303
|
+
function fe({
|
|
304
|
+
view: t,
|
|
305
|
+
onChangeView: d,
|
|
306
|
+
attendanceData: m,
|
|
307
|
+
theme: E = {},
|
|
308
|
+
onDateClick: c,
|
|
309
|
+
showNavigation: f = !0,
|
|
310
|
+
showWeekdayHeaders: p = !0,
|
|
311
|
+
className: b = ""
|
|
312
|
+
}) {
|
|
313
|
+
const _ = te(null), [i, j] = oe(7);
|
|
314
|
+
ne(() => {
|
|
315
|
+
if (!_.current) return;
|
|
316
|
+
const o = _.current, h = new ResizeObserver((T) => {
|
|
317
|
+
const x = (T[0]?.contentRect.width ?? o.clientWidth) >= 8 * 64 + 156;
|
|
318
|
+
j(x ? 14 : 7);
|
|
319
|
+
});
|
|
320
|
+
return h.observe(o), () => h.disconnect();
|
|
321
|
+
}, []);
|
|
322
|
+
const A = L(() => ie(t, i), [t, i]), S = L(() => Array.from({ length: i }).map((o, h) => ce[h % 7]), [i]), v = L(
|
|
323
|
+
() => new Date(t.year, t.monthIndex).toLocaleString("en-US", {
|
|
324
|
+
month: "long"
|
|
325
|
+
}),
|
|
326
|
+
[t]
|
|
327
|
+
), N = () => {
|
|
328
|
+
const o = t.monthIndex - 1;
|
|
329
|
+
o < 0 ? d({ year: t.year - 1, monthIndex: 11 }) : d({ ...t, monthIndex: o });
|
|
330
|
+
}, $ = () => {
|
|
331
|
+
const o = t.monthIndex + 1;
|
|
332
|
+
o > 11 ? d({ year: t.year + 1, monthIndex: 0 }) : d({ ...t, monthIndex: o });
|
|
333
|
+
}, y = m !== void 0 && t.year === m.year && t.monthIndex === m.monthIndex, s = { ...{
|
|
334
|
+
primaryColor: "#10b981",
|
|
335
|
+
// Modern emerald
|
|
336
|
+
absentColor: "#f59e0b",
|
|
337
|
+
// Modern amber
|
|
338
|
+
textColor: "#0f172a",
|
|
339
|
+
// Slate 900
|
|
340
|
+
borderColor: "#e2e8f0",
|
|
341
|
+
// Slate 200
|
|
342
|
+
mutedTextColor: "#64748b",
|
|
343
|
+
// Slate 500
|
|
344
|
+
hoverColor: "#f1f5f9",
|
|
345
|
+
// Slate 100
|
|
346
|
+
backgroundColor: "#ffffff"
|
|
347
|
+
}, ...E }, I = (o) => {
|
|
348
|
+
c && y && c(o, t.monthIndex, t.year);
|
|
349
|
+
};
|
|
350
|
+
return /* @__PURE__ */ u.jsxs(
|
|
351
|
+
"div",
|
|
352
|
+
{
|
|
353
|
+
className: `w-full ${b}`,
|
|
354
|
+
style: { backgroundColor: s.backgroundColor },
|
|
355
|
+
children: [
|
|
356
|
+
f && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between mb-8", children: [
|
|
357
|
+
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
358
|
+
/* @__PURE__ */ u.jsx(
|
|
359
|
+
"button",
|
|
360
|
+
{
|
|
361
|
+
onClick: N,
|
|
362
|
+
className: "size-10 rounded-xl border-2 grid place-items-center",
|
|
363
|
+
style: {
|
|
364
|
+
borderColor: s.borderColor,
|
|
365
|
+
color: s.textColor,
|
|
366
|
+
backgroundColor: s.hoverColor
|
|
367
|
+
},
|
|
368
|
+
"aria-label": "Previous month",
|
|
369
|
+
children: /* @__PURE__ */ u.jsx(
|
|
370
|
+
"svg",
|
|
371
|
+
{
|
|
372
|
+
width: "16",
|
|
373
|
+
height: "16",
|
|
374
|
+
viewBox: "0 0 24 24",
|
|
375
|
+
fill: "none",
|
|
376
|
+
stroke: "currentColor",
|
|
377
|
+
strokeWidth: "2",
|
|
378
|
+
children: /* @__PURE__ */ u.jsx("polyline", { points: "15,18 9,12 15,6" })
|
|
379
|
+
}
|
|
380
|
+
)
|
|
381
|
+
}
|
|
382
|
+
),
|
|
383
|
+
/* @__PURE__ */ u.jsx(
|
|
384
|
+
"button",
|
|
385
|
+
{
|
|
386
|
+
onClick: $,
|
|
387
|
+
className: "size-10 rounded-xl border-2 grid place-items-center",
|
|
388
|
+
style: {
|
|
389
|
+
borderColor: s.borderColor,
|
|
390
|
+
color: s.textColor,
|
|
391
|
+
backgroundColor: s.hoverColor
|
|
392
|
+
},
|
|
393
|
+
"aria-label": "Next month",
|
|
394
|
+
children: /* @__PURE__ */ u.jsx(
|
|
395
|
+
"svg",
|
|
396
|
+
{
|
|
397
|
+
width: "16",
|
|
398
|
+
height: "16",
|
|
399
|
+
viewBox: "0 0 24 24",
|
|
400
|
+
fill: "none",
|
|
401
|
+
stroke: "currentColor",
|
|
402
|
+
strokeWidth: "2",
|
|
403
|
+
children: /* @__PURE__ */ u.jsx("polyline", { points: "9,18 15,12 9,6" })
|
|
404
|
+
}
|
|
405
|
+
)
|
|
406
|
+
}
|
|
407
|
+
)
|
|
408
|
+
] }),
|
|
409
|
+
/* @__PURE__ */ u.jsxs(
|
|
410
|
+
"h2",
|
|
411
|
+
{
|
|
412
|
+
className: "text-2xl font-bold",
|
|
413
|
+
style: { color: s.textColor },
|
|
414
|
+
children: [
|
|
415
|
+
v,
|
|
416
|
+
" ",
|
|
417
|
+
t.year
|
|
418
|
+
]
|
|
419
|
+
}
|
|
420
|
+
),
|
|
421
|
+
/* @__PURE__ */ u.jsx("div", { className: "w-20" }),
|
|
422
|
+
" "
|
|
423
|
+
] }),
|
|
424
|
+
p && /* @__PURE__ */ u.jsx(
|
|
425
|
+
"div",
|
|
426
|
+
{
|
|
427
|
+
className: "grid gap-4 text-center mb-6",
|
|
428
|
+
style: { gridTemplateColumns: `repeat(${i}, minmax(0, 1fr))` },
|
|
429
|
+
children: S.map((o, h) => /* @__PURE__ */ u.jsx(
|
|
430
|
+
"div",
|
|
431
|
+
{
|
|
432
|
+
className: "text-sm font-semibold uppercase tracking-wide py-2",
|
|
433
|
+
style: {
|
|
434
|
+
color: s.mutedTextColor,
|
|
435
|
+
backgroundColor: s.hoverColor,
|
|
436
|
+
borderRadius: "12px"
|
|
437
|
+
},
|
|
438
|
+
children: o
|
|
439
|
+
},
|
|
440
|
+
h
|
|
441
|
+
))
|
|
442
|
+
}
|
|
443
|
+
),
|
|
444
|
+
/* @__PURE__ */ u.jsx(
|
|
445
|
+
"div",
|
|
446
|
+
{
|
|
447
|
+
ref: _,
|
|
448
|
+
className: "grid gap-4",
|
|
449
|
+
style: { gridTemplateColumns: `repeat(${i}, minmax(0, 1fr))` },
|
|
450
|
+
children: A.map((o, h) => {
|
|
451
|
+
const T = y && o.inCurrentMonth && m?.presentDays.has(o.day), O = y && o.inCurrentMonth && m?.absentDays.has(o.day), P = i >= 14 ? "size-8 sm:size-12 rounded-2xl grid place-items-center text-sm font-semibold cursor-pointer" : "size-12 sm:size-14 rounded-2xl grid place-items-center text-base font-semibold cursor-pointer", C = c && o.inCurrentMonth && y;
|
|
452
|
+
let x = {}, D = P;
|
|
453
|
+
return o.inCurrentMonth ? T ? x = {
|
|
454
|
+
backgroundColor: s.primaryColor,
|
|
455
|
+
color: "#ffffff",
|
|
456
|
+
border: `2px solid ${s.primaryColor}`
|
|
457
|
+
} : O ? x = {
|
|
458
|
+
backgroundColor: s.absentColor,
|
|
459
|
+
color: "#ffffff",
|
|
460
|
+
border: `2px solid ${s.absentColor}`
|
|
461
|
+
} : x = {
|
|
462
|
+
color: s.textColor,
|
|
463
|
+
backgroundColor: "transparent",
|
|
464
|
+
border: `2px solid ${s.borderColor}`
|
|
465
|
+
} : x = {
|
|
466
|
+
color: s.mutedTextColor,
|
|
467
|
+
backgroundColor: s.hoverColor,
|
|
468
|
+
border: `2px solid ${s.borderColor}`
|
|
469
|
+
}, /* @__PURE__ */ u.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ u.jsx(
|
|
470
|
+
"div",
|
|
471
|
+
{
|
|
472
|
+
className: D,
|
|
473
|
+
style: x,
|
|
474
|
+
onClick: () => C && I(o.day),
|
|
475
|
+
title: C ? `Click to interact with ${o.day}` : void 0,
|
|
476
|
+
children: o.day
|
|
477
|
+
}
|
|
478
|
+
) }, h);
|
|
479
|
+
})
|
|
480
|
+
}
|
|
481
|
+
)
|
|
482
|
+
]
|
|
483
|
+
}
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
export {
|
|
487
|
+
fe as AttendanceCalendar
|
|
488
|
+
};
|
|
489
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/AttendanceCalendar.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { useEffect, useMemo, useRef, useState } from \"react\";\r\n\r\nexport type MonthView = {\r\n year: number;\r\n monthIndex: number; // 0-11\r\n};\r\n\r\nexport type AttendanceData = {\r\n year: number;\r\n monthIndex: number; // 0-11\r\n presentDays: Set<number>;\r\n absentDays: Set<number>;\r\n};\r\n\r\nexport type CalendarTheme = {\r\n primaryColor?: string;\r\n absentColor?: string;\r\n textColor?: string;\r\n borderColor?: string;\r\n mutedTextColor?: string;\r\n hoverColor?: string;\r\n backgroundColor?: string;\r\n};\r\n\r\nexport type CalendarProps = {\r\n view: MonthView;\r\n onChangeView: (next: MonthView) => void;\r\n attendanceData?: AttendanceData;\r\n theme?: CalendarTheme;\r\n onDateClick?: (day: number, month: number, year: number) => void;\r\n showNavigation?: boolean;\r\n showWeekdayHeaders?: boolean;\r\n className?: string;\r\n};\r\n\r\nconst WEEKDAY_LABELS = [\r\n \"Sun\",\r\n \"Mon\",\r\n \"Tue\",\r\n \"Wed\",\r\n \"Thu\",\r\n \"Fri\",\r\n \"Sat\",\r\n] as const;\r\n\r\nfunction getMonthMatrix({ year, monthIndex }: MonthView, columns: number) {\r\n const firstOfMonth = new Date(year, monthIndex, 1);\r\n const startDay = firstOfMonth.getDay();\r\n const daysInMonth = new Date(year, monthIndex + 1, 0).getDate();\r\n\r\n const prevMonthDays = new Date(year, monthIndex, 0).getDate();\r\n\r\n const cells: { day: number; inCurrentMonth: boolean }[] = [];\r\n\r\n for (let i = 0; i < startDay; i++) {\r\n cells.push({\r\n day: prevMonthDays - startDay + 1 + i,\r\n inCurrentMonth: false,\r\n });\r\n }\r\n for (let d = 1; d <= daysInMonth; d++) {\r\n cells.push({ day: d, inCurrentMonth: true });\r\n }\r\n let nextMonthDay = 1;\r\n while (cells.length % columns !== 0) {\r\n cells.push({ day: nextMonthDay, inCurrentMonth: false });\r\n nextMonthDay++;\r\n }\r\n\r\n return cells;\r\n}\r\n\r\nexport default function AttendanceCalendar({\r\n view,\r\n onChangeView,\r\n attendanceData,\r\n theme = {},\r\n onDateClick,\r\n showNavigation = true,\r\n showWeekdayHeaders = true,\r\n className = \"\",\r\n}: CalendarProps) {\r\n const containerRef = useRef<HTMLDivElement | null>(null);\r\n const [columns, setColumns] = useState<number>(7);\r\n\r\n useEffect(() => {\r\n if (!containerRef.current) return;\r\n const el = containerRef.current;\r\n const ro = new ResizeObserver((entries) => {\r\n const width = entries[0]?.contentRect.width ?? el.clientWidth;\r\n const minCellWidth = 64;\r\n const minGaps = (14 - 1) * 12; // gap-3\r\n const canFit14 = width >= 8 * minCellWidth + minGaps;\r\n setColumns(canFit14 ? 14 : 7);\r\n });\r\n ro.observe(el);\r\n return () => ro.disconnect();\r\n }, []);\r\n\r\n const cells = useMemo(() => getMonthMatrix(view, columns), [view, columns]);\r\n\r\n // Generate weekday headers that match the calendar grid structure\r\n const weekdayHeaders = useMemo(() => {\r\n return Array.from({ length: columns }).map((_, i) => {\r\n // Always use standard week order for headers\r\n return WEEKDAY_LABELS[i % 7];\r\n });\r\n }, [columns]);\r\n\r\n const monthName = useMemo(\r\n () =>\r\n new Date(view.year, view.monthIndex).toLocaleString(\"en-US\", {\r\n month: \"long\",\r\n }),\r\n [view]\r\n );\r\n\r\n const goPrev = () => {\r\n const m = view.monthIndex - 1;\r\n if (m < 0) onChangeView({ year: view.year - 1, monthIndex: 11 });\r\n else onChangeView({ ...view, monthIndex: m });\r\n };\r\n\r\n const goNext = () => {\r\n const m = view.monthIndex + 1;\r\n if (m > 11) onChangeView({ year: view.year + 1, monthIndex: 0 });\r\n else onChangeView({ ...view, monthIndex: m });\r\n };\r\n\r\n const isAttendanceMonth =\r\n attendanceData !== undefined &&\r\n view.year === attendanceData.year &&\r\n view.monthIndex === attendanceData.monthIndex;\r\n\r\n // Default theme colors - Modern design\r\n const defaultTheme: Required<CalendarTheme> = {\r\n primaryColor: \"#10b981\", // Modern emerald\r\n absentColor: \"#f59e0b\", // Modern amber\r\n textColor: \"#0f172a\", // Slate 900\r\n borderColor: \"#e2e8f0\", // Slate 200\r\n mutedTextColor: \"#64748b\", // Slate 500\r\n hoverColor: \"#f1f5f9\", // Slate 100\r\n backgroundColor: \"#ffffff\",\r\n };\r\n\r\n const finalTheme = { ...defaultTheme, ...theme };\r\n\r\n const handleDateClick = (day: number) => {\r\n if (onDateClick && isAttendanceMonth) {\r\n onDateClick(day, view.monthIndex, view.year);\r\n }\r\n };\r\n\r\n return (\r\n <div\r\n className={`w-full ${className}`}\r\n style={{ backgroundColor: finalTheme.backgroundColor }}\r\n >\r\n {/* Month header */}\r\n {showNavigation && (\r\n <div className=\"flex items-center justify-between mb-8\">\r\n <div className=\"flex items-center gap-3\">\r\n <button\r\n onClick={goPrev}\r\n className=\"size-10 rounded-xl border-2 grid place-items-center\"\r\n style={{\r\n borderColor: finalTheme.borderColor,\r\n color: finalTheme.textColor,\r\n backgroundColor: finalTheme.hoverColor,\r\n }}\r\n aria-label=\"Previous month\"\r\n >\r\n <svg\r\n width=\"16\"\r\n height=\"16\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n >\r\n <polyline points=\"15,18 9,12 15,6\"></polyline>\r\n </svg>\r\n </button>\r\n <button\r\n onClick={goNext}\r\n className=\"size-10 rounded-xl border-2 grid place-items-center\"\r\n style={{\r\n borderColor: finalTheme.borderColor,\r\n color: finalTheme.textColor,\r\n backgroundColor: finalTheme.hoverColor,\r\n }}\r\n aria-label=\"Next month\"\r\n >\r\n <svg\r\n width=\"16\"\r\n height=\"16\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n >\r\n <polyline points=\"9,18 15,12 9,6\"></polyline>\r\n </svg>\r\n </button>\r\n </div>\r\n <h2\r\n className=\"text-2xl font-bold\"\r\n style={{ color: finalTheme.textColor }}\r\n >\r\n {monthName} {view.year}\r\n </h2>\r\n <div className=\"w-20\"></div> {/* Spacer for centering */}\r\n </div>\r\n )}\r\n\r\n {/* Weekday headers */}\r\n {showWeekdayHeaders && (\r\n <div\r\n className=\"grid gap-4 text-center mb-6\"\r\n style={{ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }}\r\n >\r\n {weekdayHeaders.map((weekday, i) => (\r\n <div\r\n key={i}\r\n className=\"text-sm font-semibold uppercase tracking-wide py-2\"\r\n style={{\r\n color: finalTheme.mutedTextColor,\r\n backgroundColor: finalTheme.hoverColor,\r\n borderRadius: \"12px\",\r\n }}\r\n >\r\n {weekday}\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n\r\n {/* Calendar grid */}\r\n <div\r\n ref={containerRef}\r\n className=\"grid gap-4\"\r\n style={{ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }}\r\n >\r\n {cells.map((cell, idx) => {\r\n const isPresent =\r\n isAttendanceMonth &&\r\n cell.inCurrentMonth &&\r\n attendanceData?.presentDays.has(cell.day);\r\n const isAbsent =\r\n isAttendanceMonth &&\r\n cell.inCurrentMonth &&\r\n attendanceData?.absentDays.has(cell.day);\r\n\r\n const baseCircle =\r\n columns >= 14\r\n ? \"size-8 sm:size-12 rounded-2xl grid place-items-center text-sm font-semibold cursor-pointer\"\r\n : \"size-12 sm:size-14 rounded-2xl grid place-items-center text-base font-semibold cursor-pointer\";\r\n\r\n const isClickable =\r\n onDateClick && cell.inCurrentMonth && isAttendanceMonth;\r\n\r\n let cellStyle: React.CSSProperties = {};\r\n let cellClassName = baseCircle;\r\n\r\n if (!cell.inCurrentMonth) {\r\n cellStyle = {\r\n color: finalTheme.mutedTextColor,\r\n backgroundColor: finalTheme.hoverColor,\r\n border: `2px solid ${finalTheme.borderColor}`,\r\n };\r\n } else if (isPresent) {\r\n cellStyle = {\r\n backgroundColor: finalTheme.primaryColor,\r\n color: \"#ffffff\",\r\n border: `2px solid ${finalTheme.primaryColor}`,\r\n };\r\n } else if (isAbsent) {\r\n cellStyle = {\r\n backgroundColor: finalTheme.absentColor,\r\n color: \"#ffffff\",\r\n border: `2px solid ${finalTheme.absentColor}`,\r\n };\r\n } else {\r\n cellStyle = {\r\n color: finalTheme.textColor,\r\n backgroundColor: \"transparent\",\r\n border: `2px solid ${finalTheme.borderColor}`,\r\n };\r\n }\r\n\r\n return (\r\n <div key={idx} className=\"flex items-center justify-center\">\r\n <div\r\n className={cellClassName}\r\n style={cellStyle}\r\n onClick={() => isClickable && handleDateClick(cell.day)}\r\n title={\r\n isClickable ? `Click to interact with ${cell.day}` : undefined\r\n }\r\n >\r\n {cell.day}\r\n </div>\r\n </div>\r\n );\r\n })}\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["REACT_ELEMENT_TYPE","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","reactJsxRuntime_production","getComponentNameFromType","REACT_CLIENT_REFERENCE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","REACT_FORWARD_REF_TYPE","innerType","REACT_MEMO_TYPE","REACT_LAZY_TYPE","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","getTaskName","name","getOwner","dispatcher","ReactSharedInternals","UnknownOwner","hasValidKey","hasOwnProperty","getter","defineKeyPropWarningGetter","props","displayName","warnAboutAccessingKey","specialPropKeyWarningShown","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","jsxDEVImpl","isStaticChildren","children","isArrayImpl","validateChildKeys","keys","k","didWarnAboutKeySpread","node","isValidElement","object","React","require$$0","createTask","callStackForError","unknownOwnerDebugStack","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","jsxRuntimeModule","require$$1","WEEKDAY_LABELS","getMonthMatrix","year","monthIndex","columns","startDay","daysInMonth","prevMonthDays","cells","d","nextMonthDay","AttendanceCalendar","view","onChangeView","attendanceData","theme","onDateClick","showNavigation","showWeekdayHeaders","className","containerRef","useRef","setColumns","useState","useEffect","el","ro","entries","canFit14","useMemo","weekdayHeaders","_","i","monthName","goPrev","m","goNext","isAttendanceMonth","finalTheme","handleDateClick","day","jsxs","jsx","weekday","cell","idx","isPresent","isAbsent","baseCircle","isClickable","cellStyle","cellClassName"],"mappings":";;;;;;;;;;;;;;;AAWA,MAAIA,IAAqB,OAAO,IAAI,4BAA4B,GAC9DC,IAAsB,OAAO,IAAI,gBAAgB;AACnD,WAASC,EAAQC,GAAMC,GAAQC,GAAU;AACvC,QAAIC,IAAM;AAGV,QAFWD,MAAX,WAAwBC,IAAM,KAAKD,IACxBD,EAAO,QAAlB,WAA0B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;AAAA,IAAA;AAAA,EAAA;AAGN;","x_google_ignoreList":[0,1,2]}
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-attendance-calendar",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A responsive React attendance calendar component with TypeScript support",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"keywords": [
|
|
20
|
+
"react",
|
|
21
|
+
"calendar",
|
|
22
|
+
"attendance",
|
|
23
|
+
"typescript",
|
|
24
|
+
"component",
|
|
25
|
+
"ui"
|
|
26
|
+
],
|
|
27
|
+
"author": "Your Name",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/alamincodes/attendance-calendar"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/alamincodes/attendance-calendar#readme",
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": ">=16.8.0",
|
|
36
|
+
"react-dom": ">=16.8.0"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"dev": "vite",
|
|
40
|
+
"build": "tsc --project tsconfig.lib.json && vite build --mode library",
|
|
41
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
42
|
+
"lint": "eslint .",
|
|
43
|
+
"preview": "vite preview",
|
|
44
|
+
"prepublishOnly": "npm run build"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@tailwindcss/vite": "^4.1.14",
|
|
48
|
+
"react": ">=16.8.0",
|
|
49
|
+
"react-dom": ">=16.8.0",
|
|
50
|
+
"tailwindcss": "^4.1.14"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@eslint/js": "^9.36.0",
|
|
54
|
+
"@types/node": "^24.7.2",
|
|
55
|
+
"@types/react": "^19.1.16",
|
|
56
|
+
"@types/react-dom": "^19.1.9",
|
|
57
|
+
"@vitejs/plugin-react": "^5.0.4",
|
|
58
|
+
"eslint": "^9.36.0",
|
|
59
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
60
|
+
"eslint-plugin-react-refresh": "^0.4.22",
|
|
61
|
+
"globals": "^16.4.0",
|
|
62
|
+
"typescript": "~5.9.3",
|
|
63
|
+
"typescript-eslint": "^8.45.0",
|
|
64
|
+
"vite": "^7.1.7"
|
|
65
|
+
}
|
|
66
|
+
}
|