@dayflow/core 2.0.3 → 2.0.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.
@@ -6,15 +6,15 @@
6
6
  * Calendar main container
7
7
  * Used for the root container of WeekView and DayView
8
8
  */
9
- export declare const calendarContainer = "relative flex flex-col bg-white dark:bg-gray-900 w-full overflow-hidden h-full select-none";
9
+ export declare const calendarContainer = "df-calendar relative flex flex-col bg-white dark:bg-gray-900 w-full overflow-hidden h-full select-none";
10
10
  /**
11
11
  * MonthView container
12
12
  */
13
- export declare const monthViewContainer = "h-full flex flex-col bg-white dark:bg-gray-900 select-none";
13
+ export declare const monthViewContainer = "df-month-view h-full flex flex-col bg-white dark:bg-gray-900 select-none";
14
14
  /**
15
15
  * Top navigation bar container
16
16
  */
17
- export declare const headerContainer = "p-2 flex justify-between";
17
+ export declare const headerContainer = "df-header p-2 flex justify-between";
18
18
  /**
19
19
  * Title text style
20
20
  */
@@ -26,7 +26,7 @@ export declare const headerSubtitle = "mt-3 text-gray-600 dark:text-gray-400";
26
26
  /**
27
27
  * Navigation button container
28
28
  */
29
- export declare const buttonGroup = "flex items-center";
29
+ export declare const buttonGroup = "df-navigation flex items-center";
30
30
  /**
31
31
  * Navigation button (forward/backward)
32
32
  */
@@ -50,7 +50,7 @@ export declare const weekGrid = "grid grid-cols-7";
50
50
  /**
51
51
  * Week title row (MonthView)
52
52
  */
53
- export declare const weekHeaderRow = "sticky top-0 z-10 bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700";
53
+ export declare const weekHeaderRow = "df-week-header-row sticky top-0 z-10 bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700";
54
54
  /**
55
55
  * Weekday labels
56
56
  */
@@ -58,15 +58,15 @@ export declare const dayLabel = "text-right text-gray-500 dark:text-gray-400 tex
58
58
  /**
59
59
  * WeekView week title
60
60
  */
61
- export declare const weekDayHeader = "flex border-b border-gray-200 dark:border-gray-700";
61
+ export declare const weekDayHeader = "df-week-header flex border-b border-gray-200 dark:border-gray-700";
62
62
  /**
63
63
  * WeekView week title cell
64
64
  */
65
- export declare const weekDayCell = "flex flex-1 justify-center items-center text-center text-gray-500 dark:text-gray-400 text-sm p-1 select-none";
65
+ export declare const weekDayCell = "df-week-day-cell flex flex-1 justify-center items-center text-center text-gray-500 dark:text-gray-400 text-sm p-1 select-none";
66
66
  /**
67
67
  * Date number style
68
68
  */
69
- export declare const dateNumber = "inline-flex items-center justify-center h-6 w-6 rounded-full text-sm mt-1 select-none";
69
+ export declare const dateNumber = "df-date-number inline-flex items-center justify-center h-6 w-6 rounded-full text-sm mt-1 select-none";
70
70
  /**
71
71
  * Virtual scroll container
72
72
  */
@@ -74,7 +74,27 @@ export declare const scrollContainer = "flex-1 overflow-auto will-change-scroll"
74
74
  /**
75
75
  * Month view 6-row grid container - fixed 6-row equal height layout
76
76
  */
77
- export declare const monthGrid6Rows = "grid grid-rows-6 h-full overflow-hidden";
77
+ export declare const monthGrid6Rows = "df-month-grid grid grid-rows-6 h-full overflow-hidden";
78
+ /**
79
+ * Month day cell
80
+ */
81
+ export declare const monthDayCell = "df-month-day-cell relative flex flex-col border-r border-gray-200 dark:border-gray-700 last:border-r-0";
82
+ /**
83
+ * Month date number container
84
+ */
85
+ export declare const monthDateNumberContainer = "df-month-date-number-container flex items-center justify-between px-2 h-[33px] relative z-20";
86
+ /**
87
+ * Month date number
88
+ */
89
+ export declare const monthDateNumber = "df-month-date-number inline-flex items-center justify-center h-6 min-w-6 rounded-full text-sm font-medium whitespace-nowrap px-1";
90
+ /**
91
+ * Month more events indicator
92
+ */
93
+ export declare const monthMoreEvents = "df-month-more-events text-xs text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 cursor-pointer hover:underline text-center md:text-left font-medium md:font-normal relative z-20 bg-white dark:bg-gray-900";
94
+ /**
95
+ * Month title (sticky)
96
+ */
97
+ export declare const monthTitle = "df-month-title absolute top-10 left-0 z-30 bg-white/50 dark:bg-gray-900/50 py-2 px-2 duration-300";
78
98
  /**
79
99
  * Calendar content area (week/day view)
80
100
  */
@@ -86,55 +106,55 @@ export declare const scrollbarHide = "scrollbar-hide";
86
106
  /**
87
107
  * Time column container
88
108
  */
89
- export declare const timeColumn = "flex-shrink-0 border-gray-200 dark:border-gray-700";
109
+ export declare const timeColumn = "df-time-column flex-shrink-0 border-gray-200 dark:border-gray-700";
90
110
  /**
91
111
  * Time slot
92
112
  */
93
- export declare const timeSlot = "relative h-[4.5rem] flex";
113
+ export declare const timeSlot = "df-time-slot relative h-[4.5rem] flex";
94
114
  /**
95
115
  * Time label
96
116
  */
97
- export declare const timeLabel = "absolute -top-2.5 right-2 text-[12px] text-gray-500 dark:text-gray-400 select-none";
117
+ export declare const timeLabel = "df-time-label absolute -top-2.5 right-2 text-[12px] text-gray-500 dark:text-gray-400 select-none";
98
118
  /**
99
119
  * Time grid row
100
120
  */
101
- export declare const timeGridRow = "h-[4.5rem] border-t first:border-none border-gray-200 dark:border-gray-700 flex";
121
+ export declare const timeGridRow = "df-time-grid-row h-[4.5rem] border-t first:border-none border-gray-200 dark:border-gray-700 flex";
102
122
  /**
103
123
  * Time grid cell
104
124
  */
105
- export declare const timeGridCell = "flex-1 relative border-r border-gray-200 dark:border-gray-700 select-none";
125
+ export declare const timeGridCell = "df-time-grid-cell flex-1 relative border-r border-gray-200 dark:border-gray-700 select-none";
106
126
  /**
107
127
  * Current time line container
108
128
  */
109
- export declare const currentTimeLine = "absolute left-0 top-0 flex pointer-events-none";
129
+ export declare const currentTimeLine = "df-current-time-line absolute left-0 top-0 flex pointer-events-none";
110
130
  /**
111
131
  * Current time label
112
132
  */
113
- export declare const currentTimeLabel = "ml-2 text-primary-foreground text-xs font-bold px-1.5 bg-primary rounded-sm";
133
+ export declare const currentTimeLabel = "df-current-time-label ml-2 text-primary-foreground text-xs font-bold px-1.5 bg-primary rounded-sm";
114
134
  /**
115
135
  * Current time line bar
116
136
  */
117
- export declare const currentTimeLineBar = "h-0.5 w-full bg-primary relative";
137
+ export declare const currentTimeLineBar = "df-current-time-bar h-0.5 w-full bg-primary relative";
118
138
  /**
119
139
  * All-day event row container
120
140
  */
121
- export declare const allDayRow = "flex items-center border-b border-gray-200 dark:border-gray-700 sticky";
141
+ export declare const allDayRow = "df-all-day-row flex items-center border-b border-gray-200 dark:border-gray-700 sticky";
122
142
  /**
123
143
  * All-day event label
124
144
  */
125
- export declare const allDayLabel = "flex-shrink-0 p-1 text-xs font-medium text-gray-500 dark:text-gray-400 flex justify-end select-none";
145
+ export declare const allDayLabel = "df-all-day-label flex-shrink-0 p-1 text-xs font-medium text-gray-500 dark:text-gray-400 flex justify-end select-none";
126
146
  /**
127
147
  * All-day event content area
128
148
  */
129
- export declare const allDayContent = "flex flex-1 relative";
149
+ export declare const allDayContent = "df-all-day-content flex flex-1 relative";
130
150
  /**
131
151
  * All-day event cell
132
152
  */
133
- export declare const allDayCell = "flex-1 border-r border-gray-200 dark:border-gray-700 relative";
153
+ export declare const allDayCell = "df-all-day-cell flex-1 border-r border-gray-200 dark:border-gray-700 relative";
134
154
  /**
135
155
  * Base event style
136
156
  */
137
- export declare const baseEvent = "calendar-event select-none pointer-events-auto px-0.5";
157
+ export declare const baseEvent = "df-event calendar-event select-none pointer-events-auto px-0.5";
138
158
  /**
139
159
  * Event shadow
140
160
  */
@@ -170,15 +190,15 @@ export declare const monthRegularContent = "text-xs mb-[2px] cursor-pointer flex
170
190
  /**
171
191
  * Event title (small)
172
192
  */
173
- export declare const eventTitleSmall = "font-medium text-xs truncate pr-1";
193
+ export declare const eventTitleSmall = "df-event-title font-medium text-xs truncate pr-1";
174
194
  /**
175
195
  * Event time text
176
196
  */
177
- export declare const eventTime = "text-xs opacity-80 truncate";
197
+ export declare const eventTime = "df-event-time text-xs opacity-80 truncate";
178
198
  /**
179
199
  * Event color bar
180
200
  */
181
- export declare const eventColorBar = "absolute left-1 top-1 bottom-1 w-[3px] rounded-full";
201
+ export declare const eventColorBar = "df-event-color-bar absolute left-1 top-1 bottom-1 w-[3px] rounded-full";
182
202
  /**
183
203
  * Event icon
184
204
  */
@@ -202,19 +222,19 @@ export declare const resizeHandleRight = "resize-handle absolute right-0 top-0 b
202
222
  /**
203
223
  * Mini calendar container
204
224
  */
205
- export declare const miniCalendarContainer = "px-2 border-b border-gray-200 dark:border-gray-700";
225
+ export declare const miniCalendarContainer = "df-mini-calendar px-2 border-b border-gray-200 dark:border-gray-700";
206
226
  /**
207
227
  * Mini calendar grid
208
228
  */
209
- export declare const miniCalendarGrid = "grid grid-cols-7 gap-1 text-xs justify-items-center";
229
+ export declare const miniCalendarGrid = "df-mini-calendar-grid grid grid-cols-7 gap-1 text-xs justify-items-center";
210
230
  /**
211
231
  * Mini calendar weekday title
212
232
  */
213
- export declare const miniCalendarDayHeader = "text-center text-gray-500 dark:text-gray-400 font-medium py-1 h-6 w-6";
233
+ export declare const miniCalendarDayHeader = "df-mini-calendar-header text-center text-gray-500 dark:text-gray-400 font-medium py-1 h-6 w-6";
214
234
  /**
215
235
  * Mini calendar date cell base style
216
236
  */
217
- export declare const miniCalendarDay = "text-center py-1 rounded text-xs h-6 w-6";
237
+ export declare const miniCalendarDay = "df-mini-calendar-day text-center py-1 rounded text-xs h-6 w-6";
218
238
  /**
219
239
  * Mini calendar current month date
220
240
  */
@@ -231,6 +251,67 @@ export declare const miniCalendarToday = "bg-primary rounded-full text-primary-f
231
251
  * Mini calendar selected date
232
252
  */
233
253
  export declare const miniCalendarSelected = "bg-secondary text-secondary-foreground rounded-full font-medium";
254
+ /**
255
+ * Calendar navigation button (prev/next arrows)
256
+ * Used in TodayBox component for navigation
257
+ */
258
+ export declare const calendarNavButton = "df-nav-button calendar-nav-button group relative inline-flex items-center justify-center w-7 h-7 rounded-md border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 hover:border-gray-300 dark:hover:border-gray-500 active:bg-gray-100 dark:active:bg-gray-600 transition-all duration-150 shadow-sm hover:shadow focus:outline-none";
259
+ /**
260
+ * Calendar today button
261
+ * Used in TodayBox component for "Today" button
262
+ */
263
+ export declare const calendarTodayButton = "df-today-button calendar-today-button inline-flex items-center justify-center px-4 h-7 text-sm font-medium rounded-md border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-700 hover:border-gray-300 dark:hover:border-gray-500 active:bg-gray-100 dark:active:bg-gray-600 transition-all duration-150 shadow-sm hover:shadow focus:outline-none";
264
+ /**
265
+ * Navigation button icon size
266
+ */
267
+ export declare const navButtonIcon = "h-4 w-4 transition-transform group-hover:scale-110";
268
+ /**
269
+ * Fixed event detail panel
270
+ * Used in DefaultEventDetailPanel, EventDetailPanelWithContent
271
+ */
272
+ export declare const eventDetailPanel = "df-event-detail-panel fixed bg-white dark:bg-gray-800 shadow-lg border border-gray-200 dark:border-gray-700 rounded-lg";
273
+ /**
274
+ * Event detail dialog overlay
275
+ * Used in DefaultEventDetailDialog
276
+ */
277
+ export declare const dialogOverlay = "df-dialog-overlay fixed inset-0 bg-black/50 flex items-center justify-center z-50";
278
+ /**
279
+ * Event detail dialog container
280
+ */
281
+ export declare const dialogContainer = "df-dialog-container relative bg-white dark:bg-gray-800 shadow-2xl border border-gray-200 dark:border-gray-700 rounded-lg p-6 max-w-md w-full mx-4";
282
+ /**
283
+ * Dropdown panel (ViewSwitcher, ColorPicker)
284
+ */
285
+ export declare const dropdownPanel = "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg dark:shadow-gray-900/50 overflow-hidden";
286
+ /**
287
+ * Color picker dropdown
288
+ */
289
+ export declare const colorPickerDropdown = "bg-white dark:bg-gray-800 rounded-md shadow-lg border border-gray-200 dark:border-gray-700 overflow-hidden transition-all duration-200 origin-top-right animate-in fade-in zoom-in-95";
290
+ /**
291
+ * Time grid bottom boundary (midnight line)
292
+ * Used in TimeGrid.tsx and DayContent.tsx
293
+ */
294
+ export declare const timeGridBoundary = "h-3 border-t border-gray-200 dark:border-gray-700 relative";
295
+ /**
296
+ * Midnight time label
297
+ */
298
+ export declare const midnightLabel = "absolute -top-2.5 text-[12px] text-gray-500 dark:text-gray-400";
299
+ /**
300
+ * Sidebar container
301
+ */
302
+ export declare const sidebarContainer = "df-sidebar flex h-full flex-col border-r border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-900";
303
+ /**
304
+ * Mobile fullscreen overlay
305
+ */
306
+ export declare const mobileFullscreen = "fixed inset-0 z-9999 bg-white dark:bg-gray-900 flex flex-col";
307
+ /**
308
+ * Search input
309
+ */
310
+ export declare const searchInput = "pl-9 pr-8 py-1 h-7 text-sm border border-slate-200 dark:border-gray-600 rounded-lg text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary transition resize-none";
311
+ /**
312
+ * Icon button (square, no text)
313
+ */
314
+ export declare const iconButton = "flex h-7 w-7 items-center justify-center rounded hover:bg-gray-100 dark:hover:bg-slate-800 transition-colors";
234
315
  /**
235
316
  * Border styles
236
317
  */
@@ -0,0 +1,37 @@
1
+ /**
2
+ * ICS Date Utilities
3
+ *
4
+ * Convert between ICS date formats (RFC 5545) and Temporal API types.
5
+ *
6
+ * ICS Date Formats:
7
+ * 1. DATE (all-day): YYYYMMDD (e.g., 20250115)
8
+ * 2. DATE-TIME (local): YYYYMMDDTHHMMSS (e.g., 20250115T143000)
9
+ * 3. DATE-TIME (UTC): YYYYMMDDTHHMMSSZ (e.g., 20250115T143000Z)
10
+ * 4. DATE-TIME (with TZID): DTSTART;TZID=America/New_York:20250115T143000
11
+ */
12
+ import { Temporal } from 'temporal-polyfill';
13
+ import { ICSDateParams } from './types';
14
+ /**
15
+ * Parse ICS date string to Temporal type
16
+ *
17
+ * @param dateStr - ICS date string
18
+ * @param params - Date parameters (VALUE, TZID)
19
+ * @param defaultTimeZone - Default timezone when none specified
20
+ * @returns Temporal.PlainDate, PlainDateTime, or ZonedDateTime
21
+ */
22
+ export declare function parseICSDate(dateStr: string, params?: ICSDateParams, defaultTimeZone?: string): Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime;
23
+ /**
24
+ * Format Temporal type to ICS date string
25
+ *
26
+ * @param temporal - Temporal date/time object
27
+ * @param allDay - Force all-day format
28
+ * @returns Object with value and optional params
29
+ */
30
+ export declare function formatICSDate(temporal: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, allDay?: boolean): {
31
+ value: string;
32
+ params?: Record<string, string>;
33
+ };
34
+ /**
35
+ * Format a Date to ICS timestamp (UTC format for DTSTAMP)
36
+ */
37
+ export declare function formatDateToICSTimestamp(date: Date): string;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * ICS Generator
3
+ *
4
+ * Generates iCalendar (.ics) files from DayFlow Event objects.
5
+ * Supports standard RFC 5545 components.
6
+ */
7
+ import { Event } from '../../types/event';
8
+ import { ICSExportOptions } from './types';
9
+ /**
10
+ * Generate ICS content string from events
11
+ *
12
+ * @param events - List of DayFlow events to export
13
+ * @param options - Export options
14
+ * @returns ICS file content string
15
+ */
16
+ export declare function generateICS(events: Event[], options?: ICSExportOptions): string;
17
+ /**
18
+ * Trigger download of ICS file (Browser only)
19
+ *
20
+ * @param events - Events to export
21
+ * @param options - Export options
22
+ */
23
+ export declare function downloadICS(events: Event[], options?: ICSExportOptions): void;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * ICS Parser
3
+ *
4
+ * Parses iCalendar (.ics) format into DayFlow Event objects.
5
+ * Supports standard RFC 5545 VEVENT components.
6
+ */
7
+ import { ICSImportOptions, ICSImportResult } from './types';
8
+ /**
9
+ * Main function to parse ICS content string
10
+ *
11
+ * @param icsContent - Raw string content of the .ics file
12
+ * @param options - Import options
13
+ * @returns Result object containing success flag, events, and errors
14
+ */
15
+ export declare function parseICS(icsContent: string, options?: ICSImportOptions): ICSImportResult;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * ICS Utilities Module
3
+ */
4
+ import { ICSImportResult, ICSImportOptions } from './types';
5
+ export * from './types';
6
+ export * from './icsDateUtils';
7
+ export * from './icsParser';
8
+ export * from './icsGenerator';
9
+ /**
10
+ * Import events from an ICS file object
11
+ *
12
+ * @param file - The File object (from input[type="file"])
13
+ * @param options - Import options
14
+ * @returns Promise resolving to import result
15
+ */
16
+ export declare function importICSFile(file: File, options?: ICSImportOptions): Promise<ICSImportResult>;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * ICS (iCalendar) Types
3
+ *
4
+ * Type definitions for ICS file import/export functionality.
5
+ * Based on RFC 5545 iCalendar specification.
6
+ */
7
+ import { Event } from '../../types/event';
8
+ /**
9
+ * ICS VEVENT raw data structure (intermediate format after parsing)
10
+ */
11
+ export interface ICSVEvent {
12
+ /** Unique identifier */
13
+ uid: string;
14
+ /** Event summary/title */
15
+ summary: string;
16
+ /** Event description */
17
+ description?: string;
18
+ /** Start date/time in ICS format */
19
+ dtstart: string;
20
+ /** End date/time in ICS format */
21
+ dtend: string;
22
+ /** DTSTART parameters */
23
+ dtstartParams?: ICSDateParams;
24
+ /** DTEND parameters */
25
+ dtendParams?: ICSDateParams;
26
+ /** Event location */
27
+ location?: string;
28
+ /** Event categories */
29
+ categories?: string[];
30
+ }
31
+ /**
32
+ * ICS date/time parameters
33
+ */
34
+ export interface ICSDateParams {
35
+ /** Value type: DATE for all-day, DATE-TIME for timed events */
36
+ value?: 'DATE' | 'DATE-TIME';
37
+ /** Timezone identifier (e.g., "America/New_York") */
38
+ tzid?: string;
39
+ }
40
+ /**
41
+ * ICS import options
42
+ */
43
+ export interface ICSImportOptions {
44
+ /** Default calendar ID for imported events */
45
+ calendarId?: string;
46
+ /** Generate new IDs for imported events (default: true) */
47
+ generateNewIds?: boolean;
48
+ /** ID prefix for generated IDs (default: "ics-") */
49
+ idPrefix?: string;
50
+ /** Default timezone when ICS has no timezone info */
51
+ defaultTimeZone?: string;
52
+ }
53
+ /**
54
+ * ICS export options
55
+ */
56
+ export interface ICSExportOptions {
57
+ /** Calendar name in exported file */
58
+ calendarName?: string;
59
+ /** Product identifier */
60
+ productId?: string;
61
+ /** Include timezone information */
62
+ includeTimezone?: boolean;
63
+ /** Export filename (without extension) */
64
+ filename?: string;
65
+ }
66
+ /**
67
+ * ICS import result
68
+ */
69
+ export interface ICSImportResult {
70
+ /** Whether import completed without errors */
71
+ success: boolean;
72
+ /** Successfully imported events */
73
+ events: Event[];
74
+ /** Parse errors encountered */
75
+ errors: ICSParseError[];
76
+ /** Total VEVENTs found in file */
77
+ totalParsed: number;
78
+ /** Successfully imported event count */
79
+ totalImported: number;
80
+ }
81
+ /**
82
+ * ICS parse error
83
+ */
84
+ export interface ICSParseError {
85
+ /** Line number where error occurred */
86
+ line?: number;
87
+ /** Error message */
88
+ message: string;
89
+ /** UID of the event that failed (if available) */
90
+ eventUid?: string;
91
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dayflow/core",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "A flexible and feature-rich calendar component library for React applications with drag-and-drop support, multiple views (Day, Week, Month, Year), and plugin architecture",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",