@ilamy/calendar 0.2.1 → 0.3.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 +29 -9
- package/dist/index.d.ts +133 -1
- package/dist/index.js +594 -375
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -2,18 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
A powerful, full-featured React calendar component library built with TypeScript, Tailwind CSS, and modern React patterns. Features multiple calendar views, drag-and-drop support, recurring events, and comprehensive internationalization.
|
|
4
4
|
|
|
5
|
-
<img width="
|
|
5
|
+
<img width="1643" height="873" alt="Screenshot 2025-08-05 at 9 46 41 AM" src="https://github.com/user-attachments/assets/d289f034-0d26-4a1c-a997-dfa1ad26aa7a" />
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
- 🗓️ **Multiple Views**: Month, Week, Day, and Year views
|
|
10
|
-
- 🎯 **Drag & Drop**: Move events between dates and time slots
|
|
11
|
-
- 🔄 **Recurring Events**:
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
9
|
+
- 🗓️ **Multiple Views**: Month, Week, Day, and Year views with smooth transitions
|
|
10
|
+
- 🎯 **Drag & Drop**: Move events between dates and time slots with collision detection
|
|
11
|
+
- 🔄 **RFC 5545 Recurring Events**: Full RRULE support with Google Calendar-style operations
|
|
12
|
+
- **RRULE Patterns**: Daily, Weekly, Monthly, Yearly with complex frequencies
|
|
13
|
+
- **Smart Operations**: Edit "this event", "this and following", or "all events"
|
|
14
|
+
- **Exception Handling**: EXDATE exclusions and modified instance support
|
|
15
|
+
- **rrule.js Integration**: Battle-tested library for robust recurrence generation
|
|
16
|
+
- 📤 **iCalendar Export**: RFC 5545 compliant .ics file export with proper recurring event handling
|
|
17
|
+
- 🌍 **Internationalization**: 100+ locales with dayjs and configurable week start days
|
|
18
|
+
- 🎨 **Customizable Styling**:
|
|
19
|
+
- Flexible theming with Tailwind CSS and CSS variables
|
|
20
|
+
- Custom event rendering with render props
|
|
21
|
+
- Configurable colors, fonts, and spacing
|
|
22
|
+
- ⚡ **Performance Optimized**:
|
|
23
|
+
- On-demand recurring event generation
|
|
24
|
+
- Efficient date range calculations
|
|
25
|
+
- Minimal re-renders with optimized React patterns
|
|
26
|
+
- 📱 **Responsive Design**: Adaptive layouts for desktop, tablet, and mobile
|
|
27
|
+
- 🔧 **Developer Experience**:
|
|
28
|
+
- Full TypeScript support with comprehensive type definitions
|
|
29
|
+
- IntelliSense and autocompletion
|
|
30
|
+
- Extensive JSDoc documentation
|
|
31
|
+
- Test-driven development with 100% test coverage
|
|
32
|
+
- 🎛️ **Advanced Event Management**:
|
|
33
|
+
- All-day events with proper timezone handling
|
|
34
|
+
- Multi-day events with smart positioning
|
|
35
|
+
- Event validation and error handling
|
|
36
|
+
- Bulk operations and batch updates
|
|
17
37
|
|
|
18
38
|
## Documentation
|
|
19
39
|
|
package/dist/index.d.ts
CHANGED
|
@@ -237,6 +237,97 @@ interface CalendarEvent {
|
|
|
237
237
|
*/
|
|
238
238
|
type WeekDays = "sunday" | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday";
|
|
239
239
|
import React2 from "react";
|
|
240
|
+
interface Translations {
|
|
241
|
+
today: string;
|
|
242
|
+
create: string;
|
|
243
|
+
update: string;
|
|
244
|
+
delete: string;
|
|
245
|
+
cancel: string;
|
|
246
|
+
event: string;
|
|
247
|
+
events: string;
|
|
248
|
+
newEvent: string;
|
|
249
|
+
title: string;
|
|
250
|
+
description: string;
|
|
251
|
+
location: string;
|
|
252
|
+
allDay: string;
|
|
253
|
+
startDate: string;
|
|
254
|
+
endDate: string;
|
|
255
|
+
startTime: string;
|
|
256
|
+
endTime: string;
|
|
257
|
+
color: string;
|
|
258
|
+
createEvent: string;
|
|
259
|
+
editEvent: string;
|
|
260
|
+
addNewEvent: string;
|
|
261
|
+
editEventDetails: string;
|
|
262
|
+
eventTitlePlaceholder: string;
|
|
263
|
+
eventDescriptionPlaceholder: string;
|
|
264
|
+
eventLocationPlaceholder: string;
|
|
265
|
+
repeat: string;
|
|
266
|
+
repeats: string;
|
|
267
|
+
customRecurrence: string;
|
|
268
|
+
daily: string;
|
|
269
|
+
weekly: string;
|
|
270
|
+
monthly: string;
|
|
271
|
+
yearly: string;
|
|
272
|
+
interval: string;
|
|
273
|
+
repeatOn: string;
|
|
274
|
+
never: string;
|
|
275
|
+
count: string;
|
|
276
|
+
every: string;
|
|
277
|
+
ends: string;
|
|
278
|
+
after: string;
|
|
279
|
+
occurrences: string;
|
|
280
|
+
on: string;
|
|
281
|
+
editRecurringEvent: string;
|
|
282
|
+
deleteRecurringEvent: string;
|
|
283
|
+
editRecurringEventQuestion: string;
|
|
284
|
+
deleteRecurringEventQuestion: string;
|
|
285
|
+
thisEvent: string;
|
|
286
|
+
thisEventDescription: string;
|
|
287
|
+
thisAndFollowingEvents: string;
|
|
288
|
+
thisAndFollowingEventsDescription: string;
|
|
289
|
+
allEvents: string;
|
|
290
|
+
allEventsDescription: string;
|
|
291
|
+
onlyChangeThis: string;
|
|
292
|
+
changeThisAndFuture: string;
|
|
293
|
+
changeEntireSeries: string;
|
|
294
|
+
onlyDeleteThis: string;
|
|
295
|
+
deleteThisAndFuture: string;
|
|
296
|
+
deleteEntireSeries: string;
|
|
297
|
+
month: string;
|
|
298
|
+
week: string;
|
|
299
|
+
day: string;
|
|
300
|
+
year: string;
|
|
301
|
+
more: string;
|
|
302
|
+
sunday: string;
|
|
303
|
+
monday: string;
|
|
304
|
+
tuesday: string;
|
|
305
|
+
wednesday: string;
|
|
306
|
+
thursday: string;
|
|
307
|
+
friday: string;
|
|
308
|
+
saturday: string;
|
|
309
|
+
sun: string;
|
|
310
|
+
mon: string;
|
|
311
|
+
tue: string;
|
|
312
|
+
wed: string;
|
|
313
|
+
thu: string;
|
|
314
|
+
fri: string;
|
|
315
|
+
sat: string;
|
|
316
|
+
january: string;
|
|
317
|
+
february: string;
|
|
318
|
+
march: string;
|
|
319
|
+
april: string;
|
|
320
|
+
may: string;
|
|
321
|
+
june: string;
|
|
322
|
+
july: string;
|
|
323
|
+
august: string;
|
|
324
|
+
september: string;
|
|
325
|
+
october: string;
|
|
326
|
+
november: string;
|
|
327
|
+
december: string;
|
|
328
|
+
}
|
|
329
|
+
type TranslationKey = keyof Translations;
|
|
330
|
+
type TranslatorFunction = (key: TranslationKey | string) => string;
|
|
240
331
|
/**
|
|
241
332
|
* This interface extends the base CalendarEvent but allows more flexible date types
|
|
242
333
|
* for the start and end properties. The component will automatically convert these
|
|
@@ -260,6 +351,11 @@ interface IlamyCalendarProps {
|
|
|
260
351
|
*/
|
|
261
352
|
firstDayOfWeek?: WeekDays;
|
|
262
353
|
/**
|
|
354
|
+
* The initial view to display when the calendar loads.
|
|
355
|
+
* Defaults to 'month'.
|
|
356
|
+
*/
|
|
357
|
+
initialView?: "month" | "week" | "day" | "year";
|
|
358
|
+
/**
|
|
263
359
|
* Custom render function for calendar events.
|
|
264
360
|
* If provided, it will override the default event rendering.
|
|
265
361
|
*/
|
|
@@ -280,11 +376,41 @@ interface IlamyCalendarProps {
|
|
|
280
376
|
*/
|
|
281
377
|
onViewChange?: (view: "month" | "week" | "day" | "year") => void;
|
|
282
378
|
/**
|
|
379
|
+
* Callback when a new event is added to the calendar.
|
|
380
|
+
* Provides the newly created event object.
|
|
381
|
+
*/
|
|
382
|
+
onEventAdd?: (event: CalendarEvent) => void;
|
|
383
|
+
/**
|
|
384
|
+
* Callback when an existing event is updated.
|
|
385
|
+
* Provides the updated event object.
|
|
386
|
+
*/
|
|
387
|
+
onEventUpdate?: (event: CalendarEvent) => void;
|
|
388
|
+
/**
|
|
389
|
+
* Callback when an event is deleted from the calendar.
|
|
390
|
+
* Provides the deleted event object.
|
|
391
|
+
*/
|
|
392
|
+
onEventDelete?: (event: CalendarEvent) => void;
|
|
393
|
+
/**
|
|
394
|
+
* Callback when the current date changes (navigation).
|
|
395
|
+
* Provides the new current date.
|
|
396
|
+
*/
|
|
397
|
+
onDateChange?: (date: dayjs.Dayjs) => void;
|
|
398
|
+
/**
|
|
283
399
|
* Locale to use for formatting dates and times.
|
|
284
400
|
* If not provided, the default locale will be used.
|
|
285
401
|
*/
|
|
286
402
|
locale?: string;
|
|
287
403
|
/**
|
|
404
|
+
* Translations object for internationalization.
|
|
405
|
+
* Provide either this OR translator function, not both.
|
|
406
|
+
*/
|
|
407
|
+
translations?: Translations;
|
|
408
|
+
/**
|
|
409
|
+
* Translator function for internationalization.
|
|
410
|
+
* Provide either this OR translations object, not both.
|
|
411
|
+
*/
|
|
412
|
+
translator?: TranslatorFunction;
|
|
413
|
+
/**
|
|
288
414
|
* Timezone to use for displaying dates and times.
|
|
289
415
|
* If not provided, the local timezone will be used.
|
|
290
416
|
*/
|
|
@@ -320,6 +446,11 @@ interface IlamyCalendarProps {
|
|
|
320
446
|
* Useful for adding custom branding or additional controls.
|
|
321
447
|
*/
|
|
322
448
|
headerComponent?: React2.ReactNode;
|
|
449
|
+
/**
|
|
450
|
+
* Custom class name for the calendar header.
|
|
451
|
+
* Useful for applying custom styles to the header.
|
|
452
|
+
*/
|
|
453
|
+
headerClassName?: string;
|
|
323
454
|
}
|
|
324
455
|
declare const IlamyCalendar: React3.FC<IlamyCalendarProps>;
|
|
325
456
|
/**
|
|
@@ -357,4 +488,5 @@ interface GenerateRecurringEventsProps {
|
|
|
357
488
|
declare const generateRecurringEvents: ({ event, currentEvents, startDate, endDate }: GenerateRecurringEventsProps) => CalendarEvent[];
|
|
358
489
|
import { Frequency, Weekday } from "rrule";
|
|
359
490
|
import { RRule } from "rrule";
|
|
360
|
-
|
|
491
|
+
declare const defaultTranslations: Translations;
|
|
492
|
+
export { useIlamyCalendarContext, isRecurringEvent, generateRecurringEvents, defaultTranslations, Weekday, WeekDays, UseIlamyCalendarContextReturn, TranslatorFunction, Translations, TranslationKey, RRuleOptions, RRule, IlamyCalendarProps, IlamyCalendar, Frequency, CalendarEvent };
|