kalendly 0.1.7 → 0.2.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.
Files changed (38) hide show
  1. package/README.md +317 -681
  2. package/dist/core/index.js +3 -3
  3. package/dist/index.d.mts +48 -602
  4. package/dist/index.d.ts +48 -602
  5. package/dist/index.js +753 -2359
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +727 -2348
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/{vanilla/index.umd.js → index.umd.js} +218 -218
  10. package/dist/index.umd.js.map +1 -0
  11. package/package.json +41 -91
  12. package/dist/react/index.d.mts +0 -251
  13. package/dist/react/index.d.ts +0 -251
  14. package/dist/react/index.js +0 -969
  15. package/dist/react/index.js.map +0 -1
  16. package/dist/react/index.mjs +0 -924
  17. package/dist/react/index.mjs.map +0 -1
  18. package/dist/react-native/index.d.mts +0 -642
  19. package/dist/react-native/index.d.ts +0 -642
  20. package/dist/react-native/index.js +0 -1649
  21. package/dist/react-native/index.js.map +0 -1
  22. package/dist/react-native/index.mjs +0 -1615
  23. package/dist/react-native/index.mjs.map +0 -1
  24. package/dist/vanilla/index.d.mts +0 -271
  25. package/dist/vanilla/index.d.ts +0 -271
  26. package/dist/vanilla/index.js +0 -1064
  27. package/dist/vanilla/index.js.map +0 -1
  28. package/dist/vanilla/index.mjs +0 -1013
  29. package/dist/vanilla/index.mjs.map +0 -1
  30. package/dist/vanilla/index.umd.js.map +0 -1
  31. package/dist/vue/components/Calendar.vue.d.ts +0 -43
  32. package/dist/vue/components/Calendar.vue.d.ts.map +0 -1
  33. package/dist/vue/index.d.ts +0 -134
  34. package/dist/vue/index.d.ts.map +0 -1
  35. package/dist/vue/index.js +0 -1
  36. package/dist/vue/index.mjs +0 -717
  37. package/dist/vue/types.d.ts +0 -21
  38. package/dist/vue/types.d.ts.map +0 -1
@@ -1,251 +0,0 @@
1
- import React, { CSSProperties, ReactNode } from 'react';
2
-
3
- interface CalendarEvent {
4
- id: string | number;
5
- name: string;
6
- date: string | Date;
7
- startTime?: string;
8
- endTime?: string;
9
- allDay?: boolean;
10
- description?: string;
11
- color?: string;
12
- category?: 'work' | 'personal' | 'meeting' | 'deadline' | 'appointment' | 'other';
13
- location?: string;
14
- url?: string;
15
- status?: 'scheduled' | 'completed' | 'cancelled' | 'tentative';
16
- priority?: 'low' | 'medium' | 'high';
17
- attendees?: string[];
18
- organizer?: string;
19
- reminders?: number[];
20
- recurring?: {
21
- frequency: 'daily' | 'weekly' | 'monthly' | 'yearly';
22
- interval?: number;
23
- endDate?: string | Date;
24
- daysOfWeek?: number[];
25
- };
26
- notes?: string;
27
- tags?: string[];
28
- createdAt?: string | Date;
29
- updatedAt?: string | Date;
30
- [key: string]: unknown;
31
- }
32
- interface CalendarDate {
33
- date: Date;
34
- isCurrentMonth: boolean;
35
- isToday: boolean;
36
- hasEvents: boolean;
37
- events: CalendarEvent[];
38
- }
39
- interface CalendarState {
40
- currentYear: number;
41
- currentMonth: number;
42
- currentDate: number;
43
- selectedDate: Date | null;
44
- selectedDayIndex: number | null;
45
- tasks: CalendarEvent[];
46
- }
47
- interface CategoryColorMap {
48
- [category: string]: string;
49
- }
50
- interface CalendarConfig {
51
- events: CalendarEvent[];
52
- initialDate?: Date;
53
- minYear?: number;
54
- maxYear?: number;
55
- weekStartsOn?: 0 | 1;
56
- categoryColors?: CategoryColorMap;
57
- }
58
- interface CalendarActions {
59
- next: () => void;
60
- previous: () => void;
61
- jump: (year: number, month: number) => void;
62
- goToToday: () => void;
63
- isCurrentMonth: () => boolean;
64
- selectDate: (date: Date) => void;
65
- updateTasks: () => void;
66
- }
67
- interface PopupPosition {
68
- class: 'popup-left' | 'popup-right' | 'popup-center-top' | 'popup-center-bottom';
69
- style?: Record<string, string | number>;
70
- }
71
- interface CalendarViewModel extends CalendarState {
72
- months: string[];
73
- days: string[];
74
- years: number[];
75
- monthAndYearText: string;
76
- scheduleDay: string;
77
- calendarDates: CalendarDate[][];
78
- popupPositionClass: string;
79
- }
80
- type CalendarEventHandler = (event: CalendarEvent) => void;
81
- interface CalendarProps {
82
- events: CalendarEvent[];
83
- initialDate?: Date;
84
- minYear?: number;
85
- maxYear?: number;
86
- weekStartsOn?: 0 | 1;
87
- useShortMonthNames?: boolean;
88
- onDateSelect?: (date: Date) => void;
89
- onEventClick?: CalendarEventHandler;
90
- onMonthChange?: (year: number, month: number) => void;
91
- }
92
- interface CalendarTheme {
93
- primary?: string;
94
- secondary?: string;
95
- tertiary?: string;
96
- textColor?: string;
97
- textLight?: string;
98
- background?: string;
99
- cellHover?: string;
100
- borderColor?: string;
101
- todayOutline?: string;
102
- selectedBg?: string;
103
- eventIndicator?: string;
104
- }
105
-
106
- declare const MONTHS: string[];
107
- declare const MONTHS_FULL: string[];
108
- declare const DAYS: string[];
109
- declare function normalizeDate(date: Date): Date;
110
- declare function isSameDay(date1: Date, date2: Date): boolean;
111
- declare function isToday(date: Date): boolean;
112
- declare function generateYears(minYear?: number, maxYear?: number): number[];
113
- declare function getEventsForDate(events: CalendarEvent[], date: Date): CalendarEvent[];
114
- declare function hasEvents(events: CalendarEvent[], date: Date): boolean;
115
- declare function generateCalendarDates(year: number, month: number, events?: CalendarEvent[], weekStartsOn?: 0 | 1): CalendarDate[][];
116
- declare function getPopupPositionClass(selectedDayIndex: number | null): string;
117
- declare function getCellClasses(calendarDate: CalendarDate): string[];
118
- declare function formatDateForDisplay(date: Date): string;
119
- declare function getMonthYearText(year: number, month: number): string;
120
- declare function formatTimeRange(event: CalendarEvent): string;
121
- declare function formatAttendees(attendees?: string[]): string;
122
- declare function sortEventsByTime(events: CalendarEvent[]): CalendarEvent[];
123
- declare const DEFAULT_CATEGORY_COLORS: CategoryColorMap;
124
- declare function getDefaultEventColor(category?: string, customColors?: CategoryColorMap): string;
125
- declare function mergeCategoryColors(customColors?: CategoryColorMap): CategoryColorMap;
126
- declare function isValidHexColor(color: string): boolean;
127
- declare function getCategoryColor(category: string, customColors?: CategoryColorMap): string;
128
-
129
- declare class CalendarEngine {
130
- private state;
131
- private config;
132
- private listeners;
133
- private categoryColors;
134
- constructor(config: CalendarConfig);
135
- /**
136
- * Subscribe to state changes
137
- */
138
- subscribe(listener: () => void): () => void;
139
- /**
140
- * Notify all listeners of state changes
141
- */
142
- private notify;
143
- /**
144
- * Get current state
145
- */
146
- getState(): CalendarState;
147
- /**
148
- * Get view model with computed properties
149
- */
150
- getViewModel(): CalendarViewModel;
151
- /**
152
- * Get actions object
153
- */
154
- getActions(): CalendarActions;
155
- /**
156
- * Navigate to next month
157
- */
158
- private next;
159
- /**
160
- * Navigate to previous month
161
- */
162
- private previous;
163
- /**
164
- * Jump to specific month and year
165
- */
166
- private jump;
167
- /**
168
- * Navigate to current month (today)
169
- */
170
- private goToToday;
171
- /**
172
- * Check if currently viewing today's month
173
- */
174
- private isCurrentMonth;
175
- /**
176
- * Select a specific date
177
- */
178
- private selectDate;
179
- /**
180
- * Update tasks for the currently selected date
181
- */
182
- private updateTasks;
183
- /**
184
- * Update events configuration
185
- */
186
- updateEvents(events: CalendarEvent[]): void;
187
- /**
188
- * Handle date cell click
189
- */
190
- handleDateClick(date: Date, dayIndex?: number): void;
191
- /**
192
- * Check if date has events
193
- */
194
- hasEventsForDate(date: Date): boolean;
195
- /**
196
- * Get events for a specific date
197
- */
198
- getEventsForDate(date: Date): CalendarEvent[];
199
- /**
200
- * Clear selected date
201
- */
202
- clearSelection(): void;
203
- /**
204
- * Get category color (with custom colors support)
205
- */
206
- getCategoryColor(category?: string): string;
207
- /**
208
- * Update category colors dynamically
209
- */
210
- updateCategoryColors(colors: CategoryColorMap): void;
211
- /**
212
- * Get all category colors
213
- */
214
- getCategoryColors(): CategoryColorMap;
215
- /**
216
- * Register a new category with color
217
- */
218
- registerCategory(name: string, color: string): void;
219
- /**
220
- * Destroy the engine and cleanup listeners
221
- */
222
- destroy(): void;
223
- }
224
-
225
- interface ReactCalendarProps extends CalendarProps {
226
- className?: string;
227
- style?: CSSProperties;
228
- children?: ReactNode;
229
- renderEvent?: (event: CalendarEvent) => ReactNode;
230
- renderNoEvents?: () => ReactNode;
231
- title?: string;
232
- theme?: CalendarTheme;
233
- }
234
- type CalendarComponentProps = ReactCalendarProps;
235
- interface DatePopupProps {
236
- isVisible: boolean;
237
- selectedDate: Date | null;
238
- events: CalendarEvent[];
239
- scheduleDay: string;
240
- popupPositionClass: string;
241
- onClose?: () => void;
242
- onEventClick?: (event: CalendarEvent) => void;
243
- renderEvent?: (event: CalendarEvent) => ReactNode;
244
- renderNoEvents?: () => ReactNode;
245
- }
246
-
247
- declare const Calendar: React.FC<CalendarComponentProps>;
248
-
249
- declare const DatePopup: React.FC<DatePopupProps>;
250
-
251
- export { Calendar, type CalendarActions, type CalendarComponentProps, type CalendarConfig, type CalendarDate, CalendarEngine, type CalendarEvent, type CalendarEventHandler, type CalendarProps, type CalendarState, type CalendarTheme, type CalendarViewModel, type CategoryColorMap, DAYS, DEFAULT_CATEGORY_COLORS, DatePopup, type DatePopupProps, MONTHS, MONTHS_FULL, type PopupPosition, type ReactCalendarProps, formatAttendees, formatDateForDisplay, formatTimeRange, generateCalendarDates, generateYears, getCategoryColor, getCellClasses, getDefaultEventColor, getEventsForDate, getMonthYearText, getPopupPositionClass, hasEvents, isSameDay, isToday, isValidHexColor, mergeCategoryColors, normalizeDate, sortEventsByTime };