react-attendance-calendar 2.3.3 → 2.3.4

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 CHANGED
@@ -1,15 +1,19 @@
1
1
  # React Attendance Calendar
2
2
 
3
- A modern, customizable attendance calendar component for React with TypeScript support.
3
+ A modern, responsive, and highly customizable attendance calendar component for React with full TypeScript support. Perfect for tracking employee attendance, student presence, or any date-based status system.
4
4
 
5
5
  ## ✨ Features
6
6
 
7
- - 📅 Responsive design (7-14 columns based on width)
8
- - 🎨 Fully customizable with Tailwind CSS classes
9
- - 🖱️ Interactive date clicks with callbacks
10
- - 📱 Mobile-friendly
11
- - 🔧 TypeScript support
12
- - 🎭 Beautiful default styling included
7
+ - 📅 **Responsive design** - Automatically switches between 7-14 columns based on container width
8
+ - 🎨 **Fully customizable** - Complete control with Tailwind CSS classes
9
+ - 🖱️ **Interactive** - Date click callbacks with hover effects
10
+ - 📱 **Mobile-friendly** - Responsive grid layout with touch-friendly interactions
11
+ - 🔧 **TypeScript support** - Full type safety and IntelliSense
12
+ - 🎭 **Beautiful defaults** - Modern design with emerald/amber color scheme
13
+ - 📊 **Multi-month support** - Provide attendance data for multiple months at once
14
+ - 🔄 **Flexible data format** - Support both single month and array of months
15
+ - ⚡ **Auto-initialization** - Defaults to current month if no view provided
16
+ - 🎯 **Smart navigation** - Seamless month/year transitions
13
17
 
14
18
  ## 📦 Installation
15
19
 
@@ -46,7 +50,20 @@ function App() {
46
50
  }
47
51
  ```
48
52
 
49
- ### With Attendance Data
53
+ ### Minimal Example (Auto-initialize to current month)
54
+
55
+ ```tsx
56
+ import { AttendanceCalendar } from "react-attendance-calendar";
57
+ import "react-attendance-calendar/styles.css";
58
+
59
+ function App() {
60
+ const [view, setView] = useState();
61
+
62
+ return <AttendanceCalendar onChangeView={setView} />;
63
+ }
64
+ ```
65
+
66
+ ### With Single Month Attendance Data
50
67
 
51
68
  ```tsx
52
69
  import { AttendanceCalendar } from "react-attendance-calendar";
@@ -67,6 +84,43 @@ const attendanceData = {
67
84
  />;
68
85
  ```
69
86
 
87
+ ### With Multiple Months Attendance Data
88
+
89
+ ```tsx
90
+ import { AttendanceCalendar } from "react-attendance-calendar";
91
+ import "react-attendance-calendar/styles.css";
92
+
93
+ // Provide data for multiple months at once
94
+ const attendanceData = [
95
+ // January 2024
96
+ {
97
+ year: 2024,
98
+ monthIndex: 0,
99
+ presentDays: new Set([
100
+ 1, 2, 3, 5, 8, 9, 10, 12, 15, 16, 17, 19, 22, 23, 24, 26, 29, 30, 31,
101
+ ]),
102
+ absentDays: new Set([4, 11, 18, 25]),
103
+ },
104
+ // February 2025
105
+ {
106
+ year: 2025,
107
+ monthIndex: 1,
108
+ presentDays: new Set([
109
+ 1, 2, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 26, 27, 28,
110
+ 29,
111
+ ]),
112
+ absentDays: new Set([3, 10, 17, 24]),
113
+ },
114
+ ];
115
+
116
+ <AttendanceCalendar
117
+ view={view}
118
+ onChangeView={setView}
119
+ attendanceData={attendanceData}
120
+ onDateClick={(day, month, year) => console.log(day, month, year)}
121
+ />;
122
+ ```
123
+
70
124
  ### Custom Styling
71
125
 
72
126
  ```tsx
@@ -96,15 +150,28 @@ function App() {
96
150
  monthIndex: 0, // January
97
151
  });
98
152
 
99
- // Sample attendance data
100
- const attendanceData: AttendanceData = {
101
- year: 2024,
102
- monthIndex: 0,
103
- presentDays: new Set([
104
- 1, 2, 3, 5, 8, 9, 10, 12, 15, 16, 17, 19, 22, 23, 24, 26, 29, 30, 31,
105
- ]),
106
- absentDays: new Set([4, 11, 18, 25]),
107
- };
153
+ // Sample attendance data for multiple months
154
+ const attendanceData: AttendanceData = [
155
+ // January 2024
156
+ {
157
+ year: 2024,
158
+ monthIndex: 0,
159
+ presentDays: new Set([
160
+ 1, 2, 3, 5, 8, 9, 10, 12, 15, 16, 17, 19, 22, 23, 24, 26, 29, 30, 31,
161
+ ]),
162
+ absentDays: new Set([4, 11, 18, 25]),
163
+ },
164
+ // February 2025
165
+ {
166
+ year: 2025,
167
+ monthIndex: 1,
168
+ presentDays: new Set([
169
+ 1, 2, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 26, 27, 28,
170
+ 29,
171
+ ]),
172
+ absentDays: new Set([3, 10, 17, 24]),
173
+ },
174
+ ];
108
175
 
109
176
  const handleDateClick = (day: number, month: number, year: number) => {
110
177
  console.log(`Clicked on ${day}/${month + 1}/${year}`);
@@ -137,22 +204,22 @@ export default App;
137
204
 
138
205
  ## 📚 Props
139
206
 
140
- | Prop | Type | Required | Description |
141
- | --------------------------- | ---------------------------- | -------- | -------------------------------------- |
142
- | `view` | `MonthView` | | Current month and year |
143
- | `onChangeView` | `(view: MonthView) => void` | ✅ | Month navigation callback |
144
- | `attendanceData` | `AttendanceData` | ❌ | Present/absent days data |
145
- | `onDateClick` | `(day, month, year) => void` | ❌ | Date click callback |
146
- | `showNavigation` | `boolean` | ❌ | Show nav arrows (default: `true`) |
147
- | `showWeekdayHeaders` | `boolean` | ❌ | Show weekday headers (default: `true`) |
148
- | `className` | `string` | ❌ | Additional classes for root element |
149
- | `cellClassName` | `string` | ❌ | Custom classes for all cells |
150
- | `presentCellClassName` | `string` | ❌ | Custom classes for present days |
151
- | `absentCellClassName` | `string` | ❌ | Custom classes for absent days |
152
- | `navigationButtonClassName` | `string` | ❌ | Custom classes for nav buttons |
153
- | `monthTitleClassName` | `string` | ❌ | Custom classes for month title |
154
- | `weekdayHeaderClassName` | `string` | ❌ | Custom classes for weekday headers |
155
- | `containerClassName` | `string` | ❌ | Custom classes for main container |
207
+ | Prop | Type | Required | Description |
208
+ | --------------------------- | ---------------------------- | -------- | -------------------------------------------------- |
209
+ | `view` | `MonthView` | | Current month and year (defaults to current month) |
210
+ | `onChangeView` | `(view: MonthView) => void` | ✅ | Month navigation callback |
211
+ | `attendanceData` | `AttendanceData` | ❌ | Present/absent days data (single month or array) |
212
+ | `onDateClick` | `(day, month, year) => void` | ❌ | Date click callback |
213
+ | `showNavigation` | `boolean` | ❌ | Show nav arrows (default: `true`) |
214
+ | `showWeekdayHeaders` | `boolean` | ❌ | Show weekday headers (default: `true`) |
215
+ | `className` | `string` | ❌ | Additional classes for root element |
216
+ | `cellClassName` | `string` | ❌ | Custom classes for all cells |
217
+ | `presentCellClassName` | `string` | ❌ | Custom classes for present days |
218
+ | `absentCellClassName` | `string` | ❌ | Custom classes for absent days |
219
+ | `navigationButtonClassName` | `string` | ❌ | Custom classes for nav buttons |
220
+ | `monthTitleClassName` | `string` | ❌ | Custom classes for month title |
221
+ | `weekdayHeaderClassName` | `string` | ❌ | Custom classes for weekday headers |
222
+ | `containerClassName` | `string` | ❌ | Custom classes for main container |
156
223
 
157
224
  ### TypeScript
158
225
 
@@ -162,22 +229,86 @@ type MonthView = {
162
229
  monthIndex: number; // 0-11 (0 = January)
163
230
  };
164
231
 
165
- type AttendanceData = {
232
+ type MonthAttendanceData = {
166
233
  year: number;
167
234
  monthIndex: number;
168
235
  presentDays: Set<number>; // Day numbers 1-31
169
236
  absentDays: Set<number>; // Day numbers 1-31
170
237
  };
238
+
239
+ // Support both single month and multiple months
240
+ type AttendanceData = MonthAttendanceData | MonthAttendanceData[];
171
241
  ```
172
242
 
173
243
  ## 🎨 Styling
174
244
 
175
- The component uses Tailwind CSS classes. Default theme includes:
245
+ The component uses Tailwind CSS classes with a modern design system:
246
+
247
+ ### Default Theme
248
+
249
+ - **Present days**: Emerald green (`emerald-500`) with white text
250
+ - **Absent days**: Amber orange (`amber-500`) with white text
251
+ - **Regular days**: Slate gray (`slate-700`) with light border
252
+ - **Navigation**: Rounded buttons with hover effects
253
+ - **Typography**: Clean, readable fonts with proper hierarchy
254
+
255
+ ### Responsive Behavior
256
+
257
+ - **Desktop**: 7 columns with larger cells (`size-12 sm:size-14`)
258
+ - **Wide screens**: 14 columns with smaller cells (`size-8 sm:size-12`)
259
+ - **Mobile**: Optimized touch targets and spacing
260
+
261
+ ### Customization
262
+
263
+ Override any styling using the `className` props. All Tailwind classes are supported:
264
+
265
+ - Colors, spacing, borders, shadows
266
+ - Hover effects, transitions, animations
267
+ - Responsive breakpoints and utilities
268
+
269
+ ## 🔄 Multi-Month Data Format
270
+
271
+ The `attendanceData` prop supports two formats:
272
+
273
+ ### Single Month (Legacy Format)
274
+
275
+ ```typescript
276
+ const attendanceData: AttendanceData = {
277
+ year: 2024,
278
+ monthIndex: 0,
279
+ presentDays: new Set([1, 2, 3, 5, 8]),
280
+ absentDays: new Set([4, 6, 7]),
281
+ };
282
+ ```
283
+
284
+ ### Multiple Months (New Format)
285
+
286
+ ```typescript
287
+ const attendanceData: AttendanceData = [
288
+ {
289
+ year: 2024,
290
+ monthIndex: 0, // January
291
+ presentDays: new Set([1, 2, 3, 5, 8]),
292
+ absentDays: new Set([4, 6, 7]),
293
+ },
294
+ {
295
+ year: 2024,
296
+ monthIndex: 1, // February
297
+ presentDays: new Set([1, 2, 5, 6, 7]),
298
+ absentDays: new Set([3, 4, 8]),
299
+ },
300
+ // ... add more months as needed
301
+ ];
302
+ ```
176
303
 
177
- - Present days: Green (`emerald-500`)
178
- - Absent days: Orange (`amber-500`)
304
+ **Benefits of Multi-Month Format:**
179
305
 
180
- Customize with any Tailwind classes via the `className` props.
306
+ - **Batch loading** - Load attendance data for multiple months at once
307
+ - ✅ **Better performance** - No need to fetch data when navigating between months
308
+ - ✅ **Seamless navigation** - Smooth transitions between months with data
309
+ - ✅ **Backward compatible** - Works with existing single month format
310
+ - ✅ **Memory efficient** - Store data in memory for instant access
311
+ - ✅ **Offline ready** - Pre-load data for offline calendar browsing
181
312
 
182
313
  ## 📝 License
183
314
 
@@ -12,7 +12,7 @@ export type MonthAttendanceData = {
12
12
  };
13
13
  export type AttendanceData = MonthAttendanceData | MonthAttendanceData[];
14
14
  export type CalendarProps = {
15
- view: MonthView;
15
+ view?: MonthView;
16
16
  onChangeView: (next: MonthView) => void;
17
17
  attendanceData?: AttendanceData;
18
18
  onDateClick?: (day: number, month: number, year: number) => void;
@@ -1 +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,mBAAmB,GAAG;IAChC,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,cAAc,GAAG,mBAAmB,GAAG,mBAAmB,EAAE,CAAC;AAEzE,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,2CAgOf"}
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,mBAAmB,GAAG;IAChC,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,cAAc,GAAG,mBAAmB,GAAG,mBAAmB,EAAE,CAAC;AAEzE,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,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,IAA4E,EAC5E,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,2CAgOf"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import Le, { useRef as $e, useState as Fe, useEffect as We, useMemo as fe } from "react";
1
+ import Le, { useRef as Fe, useState as $e, useEffect as We, useMemo as fe } from "react";
2
2
  var ce = { exports: {} }, se = {};
3
3
  /**
4
4
  * @license React
@@ -47,7 +47,7 @@ function Ye() {
47
47
  function e(r) {
48
48
  if (r == null) return null;
49
49
  if (typeof r == "function")
50
- return r.$$typeof === P ? null : r.displayName || r.name || null;
50
+ return r.$$typeof === M ? null : r.displayName || r.name || null;
51
51
  if (typeof r == "string") return r;
52
52
  switch (r) {
53
53
  case j:
@@ -69,11 +69,11 @@ function Ye() {
69
69
  ), r.$$typeof) {
70
70
  case v:
71
71
  return "Portal";
72
- case $:
72
+ case F:
73
73
  return r.displayName || "Context";
74
74
  case Y:
75
75
  return (r._context.displayName || "Context") + ".Consumer";
76
- case F:
76
+ case $:
77
77
  var f = r.render;
78
78
  return r = r.displayName, r || (r = f.displayName || f.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
79
79
  case u:
@@ -237,16 +237,16 @@ React keys must be passed directly to JSX without using spread:
237
237
  function L(r) {
238
238
  return typeof r == "object" && r !== null && r.$$typeof === E;
239
239
  }
240
- var M = Le, E = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), O = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), Y = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), F = Symbol.for("react.forward_ref"), W = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), y = Symbol.for("react.activity"), P = Symbol.for("react.client.reference"), N = M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = Object.prototype.hasOwnProperty, I = Array.isArray, S = console.createTask ? console.createTask : function() {
240
+ var z = Le, E = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), O = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), Y = Symbol.for("react.consumer"), F = Symbol.for("react.context"), $ = Symbol.for("react.forward_ref"), W = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), y = Symbol.for("react.activity"), M = Symbol.for("react.client.reference"), N = z.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = Object.prototype.hasOwnProperty, I = Array.isArray, S = console.createTask ? console.createTask : function() {
241
241
  return null;
242
242
  };
243
- M = {
243
+ z = {
244
244
  react_stack_bottom_frame: function(r) {
245
245
  return r();
246
246
  }
247
247
  };
248
- var R, D = {}, d = M.react_stack_bottom_frame.bind(
249
- M,
248
+ var R, D = {}, d = z.react_stack_bottom_frame.bind(
249
+ z,
250
250
  c
251
251
  )(), oe = S(t(c)), ne = {};
252
252
  ae.Fragment = j, ae.jsx = function(r, f, b) {
@@ -410,12 +410,12 @@ const ye = "-", Be = (e) => {
410
410
  }
411
411
  v === "[" ? l++ : v === "]" ? l-- : v === "(" ? h++ : v === ")" && h--;
412
412
  }
413
- const w = c.length === 0 ? i : i.substring(m), T = Ke(w), L = T !== w, M = k && k > m ? k - m : void 0;
413
+ const w = c.length === 0 ? i : i.substring(m), T = Ke(w), L = T !== w, z = k && k > m ? k - m : void 0;
414
414
  return {
415
415
  modifiers: c,
416
416
  hasImportantModifier: L,
417
417
  baseClassName: T,
418
- maybePostfixModifierPosition: M
418
+ maybePostfixModifierPosition: z
419
419
  };
420
420
  };
421
421
  if (n) {
@@ -464,7 +464,7 @@ const ye = "-", Be = (e) => {
464
464
  const w = h[k], {
465
465
  isExternal: T,
466
466
  modifiers: L,
467
- hasImportantModifier: M,
467
+ hasImportantModifier: z,
468
468
  baseClassName: E,
469
469
  maybePostfixModifierPosition: v
470
470
  } = o(w);
@@ -484,13 +484,13 @@ const ye = "-", Be = (e) => {
484
484
  }
485
485
  j = !1;
486
486
  }
487
- const q = c(L).join(":"), Y = M ? q + he : q, $ = Y + O;
488
- if (l.includes($))
487
+ const q = c(L).join(":"), Y = z ? q + he : q, F = Y + O;
488
+ if (l.includes(F))
489
489
  continue;
490
- l.push($);
491
- const F = i(O, j);
492
- for (let W = 0; W < F.length; ++W) {
493
- const G = F[W];
490
+ l.push(F);
491
+ const $ = i(O, j);
492
+ for (let W = 0; W < $.length; ++W) {
493
+ const G = $[W];
494
494
  l.push(Y + G);
495
495
  }
496
496
  m = w + (m.length > 0 ? " " + m : m);
@@ -531,19 +531,19 @@ function sr(e, ...n) {
531
531
  const A = (e) => {
532
532
  const n = (o) => o[e] || [];
533
533
  return n.isThemeGetter = !0, n;
534
- }, Pe = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, ze = /^\((?:(\w[\w-]*):)?(.+)\)$/i, ar = /^\d+\/\d+$/, ir = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, lr = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, cr = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, dr = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, ur = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, ee = (e) => ar.test(e), p = (e) => !!e && !Number.isNaN(Number(e)), H = (e) => !!e && Number.isInteger(Number(e)), pe = (e) => e.endsWith("%") && p(e.slice(0, -1)), B = (e) => ir.test(e), mr = () => !0, fr = (e) => (
534
+ }, Me = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, Pe = /^\((?:(\w[\w-]*):)?(.+)\)$/i, ar = /^\d+\/\d+$/, ir = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, lr = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, cr = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, dr = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, ur = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, ee = (e) => ar.test(e), p = (e) => !!e && !Number.isNaN(Number(e)), H = (e) => !!e && Number.isInteger(Number(e)), pe = (e) => e.endsWith("%") && p(e.slice(0, -1)), B = (e) => ir.test(e), mr = () => !0, fr = (e) => (
535
535
  // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
536
536
  // For example, `hsl(0 0% 0%)` would be classified as a length without this check.
537
537
  // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
538
538
  lr.test(e) && !cr.test(e)
539
- ), Me = () => !1, pr = (e) => dr.test(e), br = (e) => ur.test(e), gr = (e) => !s(e) && !a(e), hr = (e) => re(e, Ie, Me), s = (e) => Pe.test(e), Z = (e) => re(e, Oe, fr), be = (e) => re(e, vr, p), Ae = (e) => re(e, je, Me), xr = (e) => re(e, Ne, br), de = (e) => re(e, Ge, pr), a = (e) => ze.test(e), ie = (e) => te(e, Oe), yr = (e) => te(e, Rr), Ce = (e) => te(e, je), kr = (e) => te(e, Ie), wr = (e) => te(e, Ne), ue = (e) => te(e, Ge, !0), re = (e, n, o) => {
540
- const t = Pe.exec(e);
539
+ ), ze = () => !1, pr = (e) => dr.test(e), br = (e) => ur.test(e), gr = (e) => !s(e) && !a(e), hr = (e) => re(e, Ie, ze), s = (e) => Me.test(e), Z = (e) => re(e, Oe, fr), be = (e) => re(e, vr, p), Ae = (e) => re(e, je, ze), xr = (e) => re(e, Ne, br), de = (e) => re(e, Ge, pr), a = (e) => Pe.test(e), ie = (e) => te(e, Oe), yr = (e) => te(e, Rr), Ce = (e) => te(e, je), kr = (e) => te(e, Ie), wr = (e) => te(e, Ne), ue = (e) => te(e, Ge, !0), re = (e, n, o) => {
540
+ const t = Me.exec(e);
541
541
  return t ? t[1] ? n(t[1]) : o(t[2]) : !1;
542
542
  }, te = (e, n, o = !1) => {
543
- const t = ze.exec(e);
543
+ const t = Pe.exec(e);
544
544
  return t ? t[1] ? n(t[1]) : o : !1;
545
545
  }, je = (e) => e === "position" || e === "percentage", Ne = (e) => e === "image" || e === "url", Ie = (e) => e === "length" || e === "size" || e === "bg-size", Oe = (e) => e === "length", vr = (e) => e === "number", Rr = (e) => e === "family-name", Ge = (e) => e === "shadow", Er = () => {
546
- const e = A("color"), n = A("font"), o = A("text"), t = A("font-weight"), i = A("tracking"), c = A("leading"), l = A("breakpoint"), h = A("container"), m = A("spacing"), k = A("radius"), w = A("shadow"), T = A("inset-shadow"), L = A("text-shadow"), M = A("drop-shadow"), E = A("blur"), v = A("perspective"), j = A("aspect"), O = A("ease"), q = A("animate"), Y = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], $ = () => [
546
+ const e = A("color"), n = A("font"), o = A("text"), t = A("font-weight"), i = A("tracking"), c = A("leading"), l = A("breakpoint"), h = A("container"), m = A("spacing"), k = A("radius"), w = A("shadow"), T = A("inset-shadow"), L = A("text-shadow"), z = A("drop-shadow"), E = A("blur"), v = A("perspective"), j = A("aspect"), O = A("ease"), q = A("animate"), Y = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], F = () => [
547
547
  "center",
548
548
  "top",
549
549
  "bottom",
@@ -561,9 +561,9 @@ const A = (e) => {
561
561
  "bottom-left",
562
562
  // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
563
563
  "left-bottom"
564
- ], F = () => [...$(), a, s], W = () => ["auto", "hidden", "clip", "visible", "scroll"], G = () => ["auto", "contain", "none"], u = () => [a, s, m], _ = () => [ee, "full", "auto", ...u()], y = () => [H, "none", "subgrid", a, s], P = () => ["auto", {
564
+ ], $ = () => [...F(), a, s], W = () => ["auto", "hidden", "clip", "visible", "scroll"], G = () => ["auto", "contain", "none"], u = () => [a, s, m], _ = () => [ee, "full", "auto", ...u()], y = () => [H, "none", "subgrid", a, s], M = () => ["auto", {
565
565
  span: ["full", H, a, s]
566
- }, H, a, s], N = () => [H, "auto", a, s], J = () => ["auto", "min", "max", "fr", a, s], I = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], S = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], R = () => ["auto", ...u()], D = () => [ee, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...u()], d = () => [e, a, s], oe = () => [...$(), Ce, Ae, {
566
+ }, H, a, s], N = () => [H, "auto", a, s], J = () => ["auto", "min", "max", "fr", a, s], I = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], S = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], R = () => ["auto", ...u()], D = () => [ee, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...u()], d = () => [e, a, s], oe = () => [...F(), Ce, Ae, {
567
567
  position: [a, s]
568
568
  }], ne = () => ["no-repeat", {
569
569
  repeat: ["", "x", "y", "space", "round"]
@@ -708,7 +708,7 @@ const A = (e) => {
708
708
  * @see https://tailwindcss.com/docs/object-position
709
709
  */
710
710
  "object-position": [{
711
- object: F()
711
+ object: $()
712
712
  }],
713
713
  /**
714
714
  * Overflow
@@ -896,7 +896,7 @@ const A = (e) => {
896
896
  * @see https://tailwindcss.com/docs/grid-column
897
897
  */
898
898
  "col-start-end": [{
899
- col: P()
899
+ col: M()
900
900
  }],
901
901
  /**
902
902
  * Grid Column Start
@@ -924,7 +924,7 @@ const A = (e) => {
924
924
  * @see https://tailwindcss.com/docs/grid-row
925
925
  */
926
926
  "row-start-end": [{
927
- row: P()
927
+ row: M()
928
928
  }],
929
929
  /**
930
930
  * Grid Row Start
@@ -2177,7 +2177,7 @@ const A = (e) => {
2177
2177
  }]
2178
2178
  }],
2179
2179
  "mask-image-radial-pos": [{
2180
- "mask-radial-at": $()
2180
+ "mask-radial-at": F()
2181
2181
  }],
2182
2182
  "mask-image-conic-pos": [{
2183
2183
  "mask-conic": [p]
@@ -2289,7 +2289,7 @@ const A = (e) => {
2289
2289
  // Deprecated since Tailwind CSS v4.0.0
2290
2290
  "",
2291
2291
  "none",
2292
- M,
2292
+ z,
2293
2293
  ue,
2294
2294
  de
2295
2295
  ]
@@ -2524,7 +2524,7 @@ const A = (e) => {
2524
2524
  * @see https://tailwindcss.com/docs/perspective-origin
2525
2525
  */
2526
2526
  "perspective-origin": [{
2527
- "perspective-origin": F()
2527
+ "perspective-origin": $()
2528
2528
  }],
2529
2529
  /**
2530
2530
  * Rotate
@@ -2620,7 +2620,7 @@ const A = (e) => {
2620
2620
  * @see https://tailwindcss.com/docs/transform-origin
2621
2621
  */
2622
2622
  "transform-origin": [{
2623
- origin: F()
2623
+ origin: $()
2624
2624
  }],
2625
2625
  /**
2626
2626
  * Transform Style
@@ -3013,7 +3013,7 @@ const A = (e) => {
3013
3013
  orderSensitiveModifiers: ["*", "**", "after", "backdrop", "before", "details-content", "file", "first-letter", "first-line", "marker", "placeholder", "selection"]
3014
3014
  };
3015
3015
  }, Ar = /* @__PURE__ */ sr(Er);
3016
- function z(...e) {
3016
+ function P(...e) {
3017
3017
  return Ar(Ue(e));
3018
3018
  }
3019
3019
  const Cr = [
@@ -3040,7 +3040,7 @@ function _r({ year: e, monthIndex: n }, o) {
3040
3040
  return h;
3041
3041
  }
3042
3042
  function Tr({
3043
- view: e,
3043
+ view: e = { year: (/* @__PURE__ */ new Date()).getFullYear(), monthIndex: (/* @__PURE__ */ new Date()).getMonth() },
3044
3044
  onChangeView: n,
3045
3045
  attendanceData: o,
3046
3046
  onDateClick: t,
@@ -3054,26 +3054,26 @@ function Tr({
3054
3054
  navigationButtonClassName: w = "",
3055
3055
  weekdayHeaderClassName: T = "",
3056
3056
  monthTitleClassName: L = "",
3057
- containerClassName: M = ""
3057
+ containerClassName: z = ""
3058
3058
  }) {
3059
- const E = $e(null), [v, j] = Fe(7);
3059
+ const E = Fe(null), [v, j] = $e(7);
3060
3060
  We(() => {
3061
3061
  if (!E.current) return;
3062
- const y = E.current, P = new ResizeObserver((N) => {
3062
+ const y = E.current, M = new ResizeObserver((N) => {
3063
3063
  const R = (N[0]?.contentRect.width ?? y.clientWidth) >= 8 * 64 + 156;
3064
3064
  j(R ? 14 : 7);
3065
3065
  });
3066
- return P.observe(y), () => P.disconnect();
3066
+ return M.observe(y), () => M.disconnect();
3067
3067
  }, []);
3068
- const O = fe(() => _r(e, v), [e, v]), q = fe(() => Array.from({ length: v }).map((y, P) => Cr[P % 7]), [v]), Y = fe(
3068
+ const O = fe(() => _r(e, v), [e, v]), q = fe(() => Array.from({ length: v }).map((y, M) => Cr[M % 7]), [v]), Y = fe(
3069
3069
  () => new Date(e.year, e.monthIndex).toLocaleString("en-US", {
3070
3070
  month: "long"
3071
3071
  }),
3072
3072
  [e]
3073
- ), $ = () => {
3073
+ ), F = () => {
3074
3074
  const y = e.monthIndex - 1;
3075
3075
  y < 0 ? n({ year: e.year - 1, monthIndex: 11 }) : n({ ...e, monthIndex: y });
3076
- }, F = () => {
3076
+ }, $ = () => {
3077
3077
  const y = e.monthIndex + 1;
3078
3078
  y > 11 ? n({ year: e.year + 1, monthIndex: 0 }) : n({ ...e, monthIndex: y });
3079
3079
  }, G = (() => {
@@ -3084,14 +3084,14 @@ function Tr({
3084
3084
  })(), u = G !== void 0, _ = (y) => {
3085
3085
  t && u && t(y, e.monthIndex, e.year);
3086
3086
  };
3087
- return /* @__PURE__ */ C.jsxs("div", { className: z("w-full", l, M), children: [
3087
+ return /* @__PURE__ */ C.jsxs("div", { className: P("w-full", l, z), children: [
3088
3088
  i && /* @__PURE__ */ C.jsxs("div", { className: "flex items-center justify-between mb-8", children: [
3089
3089
  /* @__PURE__ */ C.jsxs("div", { className: "flex items-center gap-3", children: [
3090
3090
  /* @__PURE__ */ C.jsx(
3091
3091
  "button",
3092
3092
  {
3093
- onClick: $,
3094
- className: z(
3093
+ onClick: F,
3094
+ className: P(
3095
3095
  "size-10 rounded-xl border-2 border-slate-200 text-slate-700 grid place-items-center",
3096
3096
  "transition-colors duration-200 hover:bg-slate-50",
3097
3097
  w
@@ -3114,8 +3114,8 @@ function Tr({
3114
3114
  /* @__PURE__ */ C.jsx(
3115
3115
  "button",
3116
3116
  {
3117
- onClick: F,
3118
- className: z(
3117
+ onClick: $,
3118
+ className: P(
3119
3119
  "size-10 rounded-xl border-2 border-slate-200 text-slate-700 grid place-items-center",
3120
3120
  "transition-colors duration-200 hover:bg-slate-50",
3121
3121
  w
@@ -3139,7 +3139,7 @@ function Tr({
3139
3139
  /* @__PURE__ */ C.jsxs(
3140
3140
  "h2",
3141
3141
  {
3142
- className: z(
3142
+ className: P(
3143
3143
  "text-2xl font-bold text-slate-900",
3144
3144
  L
3145
3145
  ),
@@ -3156,19 +3156,19 @@ function Tr({
3156
3156
  c && /* @__PURE__ */ C.jsx(
3157
3157
  "div",
3158
3158
  {
3159
- className: z("grid gap-4 text-center mb-6"),
3159
+ className: P("grid gap-4 text-center mb-6"),
3160
3160
  style: { gridTemplateColumns: `repeat(${v}, minmax(0, 1fr))` },
3161
- children: q.map((y, P) => /* @__PURE__ */ C.jsx(
3161
+ children: q.map((y, M) => /* @__PURE__ */ C.jsx(
3162
3162
  "div",
3163
3163
  {
3164
- className: z(
3164
+ className: P(
3165
3165
  "text-sm font-semibold uppercase tracking-wide py-2",
3166
3166
  "text-slate-500 bg-transparent rounded-xl",
3167
3167
  T
3168
3168
  ),
3169
3169
  children: y
3170
3170
  },
3171
- P
3171
+ M
3172
3172
  ))
3173
3173
  }
3174
3174
  ),
@@ -3176,31 +3176,31 @@ function Tr({
3176
3176
  "div",
3177
3177
  {
3178
3178
  ref: E,
3179
- className: z("grid gap-4"),
3179
+ className: P("grid gap-4"),
3180
3180
  style: { gridTemplateColumns: `repeat(${v}, minmax(0, 1fr))` },
3181
- children: O.map((y, P) => {
3182
- const N = u && y.inCurrentMonth && G?.presentDays.has(y.day), J = u && y.inCurrentMonth && G?.absentDays.has(y.day), I = z(
3181
+ children: O.map((y, M) => {
3182
+ const N = u && y.inCurrentMonth && G?.presentDays.has(y.day), J = u && y.inCurrentMonth && G?.absentDays.has(y.day), I = P(
3183
3183
  "rounded-2xl grid place-items-center font-semibold cursor-pointer",
3184
3184
  "transition-all duration-200",
3185
3185
  v >= 14 ? "size-8 sm:size-12 text-sm" : "size-12 sm:size-14 text-base",
3186
3186
  h
3187
3187
  ), S = t && y.inCurrentMonth && u;
3188
3188
  let R = I;
3189
- return y.inCurrentMonth ? N ? R = z(
3189
+ return y.inCurrentMonth ? N ? R = P(
3190
3190
  I,
3191
3191
  "bg-emerald-500 text-white border-2 border-emerald-500",
3192
3192
  m
3193
- ) : J ? R = z(
3193
+ ) : J ? R = P(
3194
3194
  I,
3195
3195
  "bg-amber-500 text-white border-2 border-amber-500",
3196
3196
  k
3197
- ) : R = z(
3197
+ ) : R = P(
3198
3198
  I,
3199
3199
  "text-slate-700 border-2 border-slate-200"
3200
- ) : R = z(
3200
+ ) : R = P(
3201
3201
  I,
3202
3202
  "text-slate-400 border-2 border-slate-200"
3203
- ), /* @__PURE__ */ C.jsx("div", { className: z("flex items-center justify-center"), children: /* @__PURE__ */ C.jsx(
3203
+ ), /* @__PURE__ */ C.jsx("div", { className: P("flex items-center justify-center"), children: /* @__PURE__ */ C.jsx(
3204
3204
  "div",
3205
3205
  {
3206
3206
  className: R,
@@ -3208,7 +3208,7 @@ function Tr({
3208
3208
  title: S ? `Click to interact with ${y.day}` : void 0,
3209
3209
  children: y.day
3210
3210
  }
3211
- ) }, P);
3211
+ ) }, M);
3212
3212
  })
3213
3213
  }
3214
3214
  )
@@ -3216,6 +3216,6 @@ function Tr({
3216
3216
  }
3217
3217
  export {
3218
3218
  Tr as AttendanceCalendar,
3219
- z as cn
3219
+ P as cn
3220
3220
  };
3221
3221
  //# sourceMappingURL=index.js.map