@ilamy/calendar 1.8.1 → 2.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.
@@ -0,0 +1,578 @@
1
+ import { ReactNode as ReactNode4 } from "react";
2
+ import { ComponentType, ReactNode as ReactNode2 } from "react";
3
+ import { Dayjs as Dayjs2, ManipulateType as ManipulateType2 } from "dayjs";
4
+ /**
5
+ * Core calendar event interface representing a single calendar event.
6
+ * This is the primary data structure for calendar events.
7
+ */
8
+ interface CalendarEvent {
9
+ /** Unique identifier for the event */
10
+ id: string | number;
11
+ /** Display title of the event */
12
+ title: string;
13
+ /** Start date and time of the event */
14
+ start: Dayjs2;
15
+ /** End date and time of the event */
16
+ end: Dayjs2;
17
+ /**
18
+ * Color for the event (supports CSS color values, hex, rgb, hsl, or CSS class names)
19
+ * @example "#3b82f6", "blue-500", "rgb(59, 130, 246)"
20
+ */
21
+ color?: string;
22
+ /**
23
+ * Background color for the event (supports CSS color values, hex, rgb, hsl, or CSS class names)
24
+ * @example "#dbeafe", "blue-100", "rgba(59, 130, 246, 0.1)"
25
+ */
26
+ backgroundColor?: string;
27
+ /** Optional description or notes for the event */
28
+ description?: string;
29
+ /** Optional location where the event takes place */
30
+ location?: string;
31
+ /**
32
+ * Whether this is an all-day event
33
+ * @default false
34
+ */
35
+ allDay?: boolean;
36
+ /**
37
+ * UID for iCalendar compatibility
38
+ * Unique identifier across calendar systems
39
+ */
40
+ uid?: string;
41
+ /** Single resource assignment */
42
+ resourceId?: string | number;
43
+ /** Multiple resource assignment (cross-resource events) */
44
+ resourceIds?: (string | number)[];
45
+ /**
46
+ * Custom data associated with the event
47
+ * Use this to store additional metadata specific to your application
48
+ * @example { meetingType: 'standup', attendees: ['john', 'jane'] }
49
+ */
50
+ data?: Record<string, unknown>;
51
+ }
52
+ /**
53
+ * Supported days of the week for calendar configuration.
54
+ * Used for setting the first day of the week and other week-related settings.
55
+ */
56
+ type WeekDays = "sunday" | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday";
57
+ /**
58
+ * Configuration for business hours.
59
+ * Defines the working hours to be highlighted on the calendar.
60
+ */
61
+ interface BusinessHours {
62
+ /**
63
+ * Days of the week to apply business hours to.
64
+ * @default ['monday', 'tuesday', 'wednesday', 'thursday', 'friday']
65
+ */
66
+ daysOfWeek?: WeekDays[];
67
+ /**
68
+ * Start time for business hours in 24-hour format (0-24).
69
+ * @default 9
70
+ */
71
+ startTime?: number;
72
+ /**
73
+ * End time for business hours in 24-hour format (0-24).
74
+ * @default 17
75
+ */
76
+ endTime?: number;
77
+ }
78
+ /**
79
+ * Resource interface representing a calendar resource (person, room, equipment, etc.)
80
+ */
81
+ interface Resource {
82
+ /** Unique identifier for the resource */
83
+ id: string | number;
84
+ /** Display title of the resource */
85
+ title: string;
86
+ /**
87
+ * Color for the resource (supports CSS color values, hex, rgb, hsl, or CSS class names)
88
+ * @example "#3b82f6", "blue-500", "rgb(59, 130, 246)"
89
+ */
90
+ color?: string;
91
+ /**
92
+ * Background color for the resource (supports CSS color values, hex, rgb, hsl, or CSS class names)
93
+ * @example "#dbeafe", "blue-100", "rgba(59, 130, 246, 0.1)"
94
+ */
95
+ backgroundColor?: string;
96
+ /**
97
+ * Configuration for resource-specific business hours.
98
+ * If provided, these will be used instead of the global business hours for this resource.
99
+ */
100
+ businessHours?: BusinessHours | BusinessHours[];
101
+ /**
102
+ * Custom data associated with the resource
103
+ * Use this to store additional metadata specific to your application
104
+ * @example { avatar: 'https://example.com/avatar.png', role: 'admin' }
105
+ */
106
+ data?: Record<string, unknown>;
107
+ }
108
+ interface PluginDateRange {
109
+ start: Dayjs2;
110
+ end: Dayjs2;
111
+ }
112
+ interface PluginMutationArgs {
113
+ event: CalendarEvent;
114
+ updates?: Partial<CalendarEvent>;
115
+ currentEvents: CalendarEvent[];
116
+ scope: unknown;
117
+ }
118
+ /** Structured result from `applyEdit` when a mutation updates multiple stored rows. */
119
+ interface PluginMutationResult {
120
+ events: CalendarEvent[];
121
+ /** Existing rows to persist via `onEventUpdate`. */
122
+ updated: CalendarEvent[];
123
+ /** New rows to persist via `onEventAdd`. */
124
+ added: CalendarEvent[];
125
+ /** Existing rows to persist via `onEventDelete`. */
126
+ deleted: CalendarEvent[];
127
+ }
128
+ /**
129
+ * Calendar configuration handed to a view's `columns()`/`renderHeader()`.
130
+ * Carries the resource axis (`resources`, `orientation`) so a resource-capable
131
+ * view can compose both arrangements. `range()` receives only the
132
+ * `firstDayOfWeek` slice (see its own signature).
133
+ */
134
+ interface ViewConfig {
135
+ firstDayOfWeek: number;
136
+ hiddenDays?: Set<number>;
137
+ businessHours?: BusinessHours | BusinessHours[];
138
+ hideNonBusinessHours?: boolean;
139
+ /** The resource axis. Set only when the calendar renders resources. */
140
+ resources?: Resource[];
141
+ /**
142
+ * The calendar-level resource arrangement (the user's choice): where the
143
+ * resource axis goes. Only meaningful when `resources` is set.
144
+ */
145
+ orientation?: "vertical" | "horizontal";
146
+ /**
147
+ * Week-view granularity when `resources` is set: 'hourly' (default) nests
148
+ * hour slots under each day; 'daily' shows one cell per day.
149
+ */
150
+ weekViewGranularity?: "hourly" | "daily";
151
+ }
152
+ /**
153
+ * One column of a 'vertical' view (time flows down the column).
154
+ * Formalizes the calendar's existing VerticalGrid column input.
155
+ */
156
+ interface VerticalColumnSpec {
157
+ /** Stable column id; drives testids and React keys. */
158
+ id: string;
159
+ /** The date this column represents; gutter/label columns leave it unset. */
160
+ day?: Dayjs2;
161
+ /** The cells of the column: hour slots (gridType 'hour') or dates ('day'). */
162
+ days: Dayjs2[];
163
+ gridType?: "day" | "hour";
164
+ className?: string;
165
+ /** Label-only column (e.g. the time gutter): renders no events. */
166
+ noEvents?: boolean;
167
+ renderCell?: (date: Dayjs2) => ReactNode2;
168
+ /**
169
+ * Resource-axis identity when the column belongs to one resource. The
170
+ * single carrier: consumers derive the id from `resource.id`.
171
+ */
172
+ resource?: Resource;
173
+ }
174
+ /** One cell of a 'horizontal' row. */
175
+ interface HorizontalCellSpec {
176
+ id: string;
177
+ day?: Dayjs2;
178
+ /** A grouped cell spanning several dates (nested-axis arrangements). */
179
+ days?: Dayjs2[];
180
+ gridType: "day" | "hour";
181
+ className?: string;
182
+ }
183
+ /**
184
+ * One row of a 'horizontal' view (date cells flow across the row).
185
+ * Formalizes the calendar's existing HorizontalGrid row input.
186
+ */
187
+ interface HorizontalRowSpec {
188
+ /** Stable row id; drives testids and React keys (matches VerticalColumnSpec.id). */
189
+ id: string;
190
+ columns?: HorizontalCellSpec[];
191
+ className?: string;
192
+ showDayNumber?: boolean;
193
+ /** Resource-axis identity when the row belongs to one resource. */
194
+ resource?: Resource;
195
+ }
196
+ /** Context passed to a view's `renderHeader`. */
197
+ interface ViewHeaderContext {
198
+ date: Dayjs2;
199
+ config: ViewConfig;
200
+ }
201
+ /**
202
+ * Describes a view type — contributed by a plugin or built into the calendar
203
+ * core (the four built-ins are themselves `PluginView` entries). A view either
204
+ * declares `columns` + `layout` and renders through the shared grid engines,
205
+ * or renders entirely through `component` (the escape hatch).
206
+ */
207
+ interface PluginView {
208
+ /** Unique view id, e.g. 'resource-week'. */
209
+ name: string;
210
+ /** View-switcher label (or a translation key; unknown keys render as-is). */
211
+ label?: string;
212
+ /**
213
+ * View-switcher icon (a component taking `className`, e.g. a lucide icon).
214
+ * Always shown in the switcher; the label appears beside it only when the
215
+ * view is selected, and as a hover tooltip otherwise.
216
+ */
217
+ icon: ComponentType<{
218
+ className?: string;
219
+ }>;
220
+ /**
221
+ * The escape hatch: renders the whole view when `columns`/`layout` are
222
+ * absent. Spec-driven views omit it. A view with neither renders nothing
223
+ * (dev builds log a warning).
224
+ */
225
+ component?: ComponentType;
226
+ /** How far prev/next steps when `navigationStep` is absent ('week', 'month', …). */
227
+ navigationUnit?: ManipulateType2;
228
+ /**
229
+ * How far prev/next jumps; defaults to one `navigationUnit`. Custom-duration
230
+ * views (a 40-day grid, a 4-day vertical view) set `{ amount: 40, unit: 'day' }`
231
+ * so navigation moves a full window.
232
+ *
233
+ * This also selects the header title/date-picker form (the core derives it
234
+ * generically, never by view name): a single `day`/`week`/`month`/`year` step
235
+ * borrows that grid's picker and title; any other step (amount > 1, or a custom
236
+ * unit) shows the day picker over the view's `range`. A third-party view gets
237
+ * the right picker for free just by declaring how it navigates.
238
+ */
239
+ navigationStep?: {
240
+ amount: number;
241
+ unit: ManipulateType2;
242
+ };
243
+ /**
244
+ * Visible range for navigation callbacks and the event pipeline. Views
245
+ * without `range` fall back to the month 6x7 grid range. Receives only the
246
+ * `firstDayOfWeek` slice of the config; the full axis config reaches
247
+ * `columns()`/`renderHeader()`.
248
+ */
249
+ range?: (date: Dayjs2, config: Pick<ViewConfig, "firstDayOfWeek">) => {
250
+ start: Dayjs2;
251
+ end: Dayjs2;
252
+ };
253
+ /**
254
+ * Column/row specs for the shared renderer. Return `VerticalColumnSpec[]`
255
+ * when `layout` is 'vertical', `HorizontalRowSpec[]` when 'horizontal'.
256
+ * Omit (together with `layout`) to render `component` instead.
257
+ */
258
+ columns?: (date: Dayjs2, config: ViewConfig) => VerticalColumnSpec[] | HorizontalRowSpec[];
259
+ /**
260
+ * The view's intrinsic shape (the author's choice): which engine renders it
261
+ * when the calendar has NO resources. 'vertical' = time flows down;
262
+ * 'horizontal' = date cells flow across in stacked rows. With resources on
263
+ * a resource-capable view, the calendar-level `orientation` wins instead:
264
+ * `engine = resources && supportsResources ? orientation : layout`.
265
+ */
266
+ layout?: "vertical" | "horizontal";
267
+ /** Header row content rendered above the grid by the shared renderer. */
268
+ renderHeader?: (ctx: ViewHeaderContext) => ReactNode2;
269
+ /**
270
+ * Whether `columns()` composes the resource axis when `config.resources`
271
+ * is set. Defaults to false; the view switcher hides resource-incapable
272
+ * views on a resource calendar.
273
+ */
274
+ supportsResources?: boolean;
275
+ }
276
+ /**
277
+ * A calendar plugin contributes optional behavior and UI through generic hooks
278
+ * named after pipeline moments and mount points, never after a feature. The
279
+ * core stays agnostic of any specific plugin (e.g. recurrence).
280
+ *
281
+ * Hooks follow the Rollup/Vite execution kinds:
282
+ * - `transformEvents` is sequential: each plugin receives the previous
283
+ * plugin's output, forming a transform chain.
284
+ * - `managesEvent` is first-match: the first plugin whose managesEvent returns
285
+ * true owns its scoped mutations.
286
+ * - `renderSlot` is additive: every plugin may contribute to a mount point.
287
+ *
288
+ * `slotName` is an opaque string identifier and `context` is opaque to the
289
+ * core. The built-in slot names and their context shapes live in the calendar
290
+ * core, which this contract does NOT depend on, so adding a slot never changes
291
+ * this interface. A plugin narrows `context` by `slotName` at its boundary.
292
+ *
293
+ * `scope` is opaque to the core: the owner produces it (via the mutation-scope
294
+ * slot) and consumes it in `applyEdit` / `applyDelete`. A plugin that provides
295
+ * `applyEdit` / `applyDelete` should also render the mutation-scope slot so the
296
+ * core can gather that scope before mutating.
297
+ */
298
+ interface IlamyPlugin {
299
+ name: string;
300
+ transformEvents?: (events: CalendarEvent[], range: PluginDateRange) => CalendarEvent[];
301
+ managesEvent?: (event: CalendarEvent) => boolean;
302
+ applyEdit?: (args: PluginMutationArgs) => CalendarEvent[] | PluginMutationResult;
303
+ applyDelete?: (args: PluginMutationArgs) => CalendarEvent[] | PluginMutationResult;
304
+ renderSlot?: (slotName: string, context: unknown) => ReactNode2;
305
+ /**
306
+ * Contributes arbitrary data to a named point. Additive: all plugins may
307
+ * contribute to the same point; the runtime aggregates all results via
308
+ * `collect`. Parallel to `renderSlot` but for data rather than UI nodes.
309
+ */
310
+ contribute?: (point: string, context: unknown) => unknown[];
311
+ /**
312
+ * Registers new view types that the calendar can switch to. Each entry in
313
+ * the array describes one view (id, component, navigation unit, …).
314
+ */
315
+ views?: PluginView[];
316
+ /**
317
+ * Wraps the calendar subtree so the plugin's own React context is available
318
+ * to its views, slots, and components. Rendered as the outermost wrapper
319
+ * among all plugin providers.
320
+ */
321
+ provider?: ComponentType<{
322
+ children: ReactNode2;
323
+ }>;
324
+ }
325
+ import dayjs from "dayjs";
326
+ type Dayjs3 = dayjs.Dayjs3;
327
+ import React3 from "react";
328
+ import { ReactNode as ReactNode3 } from "react";
329
+ interface EventFormProps {
330
+ open?: boolean;
331
+ selectedEvent?: CalendarEvent | null;
332
+ onAdd?: (event: CalendarEvent) => void;
333
+ onUpdate?: (event: CalendarEvent) => void;
334
+ onDelete?: (event: CalendarEvent) => void;
335
+ onClose: () => void;
336
+ }
337
+ declare const defaultTranslations: {
338
+ today: string;
339
+ create: string;
340
+ new: string;
341
+ update: string;
342
+ delete: string;
343
+ cancel: string;
344
+ export: string;
345
+ previous: string;
346
+ next: string;
347
+ event: string;
348
+ events: string;
349
+ newEvent: string;
350
+ title: string;
351
+ description: string;
352
+ location: string;
353
+ allDay: string;
354
+ startDate: string;
355
+ endDate: string;
356
+ startTime: string;
357
+ searchTime: string;
358
+ endTime: string;
359
+ color: string;
360
+ createEvent: string;
361
+ editEvent: string;
362
+ addNewEvent: string;
363
+ editEventDetails: string;
364
+ eventTitlePlaceholder: string;
365
+ eventDescriptionPlaceholder: string;
366
+ eventLocationPlaceholder: string;
367
+ repeat: string;
368
+ repeats: string;
369
+ customRecurrence: string;
370
+ frequency: string;
371
+ everyWeekday: string;
372
+ weeklyOn: string;
373
+ monthlyOnDay: string;
374
+ monthlyOnThe: string;
375
+ first: string;
376
+ second: string;
377
+ third: string;
378
+ fourth: string;
379
+ last: string;
380
+ daily: string;
381
+ weekly: string;
382
+ monthly: string;
383
+ yearly: string;
384
+ interval: string;
385
+ repeatOn: string;
386
+ never: string;
387
+ count: string;
388
+ every: string;
389
+ ends: string;
390
+ after: string;
391
+ occurrences: string;
392
+ on: string;
393
+ editRecurringEvent: string;
394
+ deleteRecurringEvent: string;
395
+ editRecurringEventQuestion: string;
396
+ deleteRecurringEventQuestion: string;
397
+ thisEvent: string;
398
+ thisEventDescription: string;
399
+ thisAndFollowingEvents: string;
400
+ thisAndFollowingEventsDescription: string;
401
+ allEvents: string;
402
+ allEventsDescription: string;
403
+ onlyChangeThis: string;
404
+ changeThisAndFuture: string;
405
+ changeEntireSeries: string;
406
+ onlyDeleteThis: string;
407
+ deleteThisAndFuture: string;
408
+ deleteEntireSeries: string;
409
+ month: string;
410
+ week: string;
411
+ day: string;
412
+ year: string;
413
+ agenda: string;
414
+ agendaNoEvents: string;
415
+ more: string;
416
+ resources: string;
417
+ resource: string;
418
+ selectResource: string;
419
+ time: string;
420
+ date: string;
421
+ noResourcesVisible: string;
422
+ addResourcesOrShowExisting: string;
423
+ };
424
+ /** All translation keys, derived from the canonical English dictionary in `default.ts`. */
425
+ type Translations = Record<keyof typeof defaultTranslations, string>;
426
+ type TranslationKey = keyof Translations;
427
+ type TranslatorFunction = (key: TranslationKey | string) => string;
428
+ /**
429
+ * Available calendar view types. The built-in views (day, week, month, year)
430
+ * are `PluginView` specs in `features/calendar/components/views`; plugins may
431
+ * contribute additional view names, so this is a broad `string`.
432
+ */
433
+ type CalendarView = string;
434
+ /**
435
+ * Time format options for displaying times in the calendar.
436
+ */
437
+ type TimeFormat = "12-hour" | "24-hour";
438
+ /**
439
+ * Granularity of the time grid in minutes for day, week, and resource hour views.
440
+ * Quarter-hour increments only. `60` shows one row per hour with no sub-hour lines.
441
+ * `30` shows two rows per hour. `15` shows four rows per hour with dashed sub-hour separators.
442
+ */
443
+ type SlotDuration = 15 | 30 | 60;
444
+ /**
445
+ * Custom class names for calendar styling.
446
+ * Allows users to override default styles for various calendar elements.
447
+ */
448
+ interface CalendarClassesOverride {
449
+ /**
450
+ * Class name for disabled cells (non-business hours).
451
+ * Replaces the DISABLED_CELL_CLASSNAME constant.
452
+ * @default "bg-secondary text-muted-foreground pointer-events-none"
453
+ * @example "bg-gray-100 text-gray-400 cursor-not-allowed"
454
+ */
455
+ disabledCell?: string;
456
+ }
457
+ /**
458
+ * Information passed to the onCellClick callback.
459
+ * Uses named properties for extensibility.
460
+ */
461
+ interface DateRange {
462
+ start: Dayjs3;
463
+ end: Dayjs3;
464
+ }
465
+ interface CellInfo {
466
+ /** Start date/time of the cell */
467
+ start: Dayjs3;
468
+ /** End date/time of the cell */
469
+ end: Dayjs3;
470
+ /** Full resource object in resource calendars; undefined in a regular calendar */
471
+ resource?: Resource;
472
+ /** Whether this is an all-day cell (optional) */
473
+ allDay?: boolean;
474
+ }
475
+ /**
476
+ * Props passed to the custom render function for the current time indicator.
477
+ * Allows users to customize how the current time indicator is displayed.
478
+ */
479
+ interface RenderCurrentTimeIndicatorProps {
480
+ /** The current time as a dayjs object */
481
+ currentTime: Dayjs3;
482
+ /** The start of the visible time range */
483
+ rangeStart: Dayjs3;
484
+ /** The end of the visible time range */
485
+ rangeEnd: Dayjs3;
486
+ /** Progress percentage (0-100) representing position in the range */
487
+ progress: number;
488
+ /**
489
+ * Layout axis the indicator is rendered along.
490
+ * - `'vertical'`: `progress` maps to a `top` offset (day/week vertical grids).
491
+ * - `'horizontal'`: `progress` maps to a `left` offset (horizontal resource hour grids).
492
+ *
493
+ * The library always populates this field, so consumers can treat it as
494
+ * always defined inside their render function.
495
+ *
496
+ * Note: distinct from the `orientation` prop on `IlamyResourceCalendar`.
497
+ * `orientation` chooses which view component renders the calendar; `axis` tells
498
+ * your render function which dimension `progress` maps to inside that view.
499
+ */
500
+ axis?: "vertical" | "horizontal";
501
+ /**
502
+ * The resource associated with this column (if in a resource-based view).
503
+ * Pass this to conditionally render custom indicators for specific resources.
504
+ */
505
+ resource?: Resource;
506
+ /** The current calendar view (e.g. 'day', 'week') */
507
+ view: CalendarView;
508
+ }
509
+ interface CalendarProviderProps {
510
+ children: ReactNode3;
511
+ events?: CalendarEvent[];
512
+ firstDayOfWeek?: number;
513
+ initialView?: CalendarView;
514
+ initialDate?: Dayjs3;
515
+ renderEvent?: (event: CalendarEvent) => ReactNode3;
516
+ onEventClick?: (event: CalendarEvent) => void;
517
+ onCellClick?: (info: CellInfo) => void;
518
+ isCellDisabled?: (info: CellInfo) => boolean;
519
+ getCellClassName?: (info: CellInfo) => string;
520
+ onViewChange?: (view: CalendarView) => void;
521
+ onEventAdd?: (event: CalendarEvent) => void;
522
+ onEventUpdate?: (event: CalendarEvent) => void;
523
+ onEventDelete?: (event: CalendarEvent) => void;
524
+ onDateChange?: (date: Dayjs3, range: DateRange) => void;
525
+ locale?: string;
526
+ timezone?: string;
527
+ disableCellClick?: boolean;
528
+ disableEventClick?: boolean;
529
+ disableDragAndDrop?: boolean;
530
+ /** Max stacked events per day in horizontal grids; the engine defaults it. */
531
+ dayMaxEvents?: number;
532
+ eventSpacing?: number;
533
+ eventHeight?: number;
534
+ stickyViewHeader?: boolean;
535
+ viewHeaderClassName?: string;
536
+ headerComponent?: ReactNode3;
537
+ headerClassName?: string;
538
+ businessHours?: BusinessHours | BusinessHours[];
539
+ renderEventForm?: (props: EventFormProps) => ReactNode3;
540
+ translations?: Translations;
541
+ translator?: TranslatorFunction;
542
+ timeFormat?: TimeFormat;
543
+ classesOverride?: CalendarClassesOverride;
544
+ renderCurrentTimeIndicator?: (props: RenderCurrentTimeIndicatorProps) => ReactNode3;
545
+ renderHour?: (date: Dayjs3) => ReactNode3;
546
+ hideNonBusinessHours?: boolean;
547
+ hideExportButton?: boolean;
548
+ hiddenDays?: Set<number>;
549
+ slotDuration?: SlotDuration;
550
+ scrollTime?: string;
551
+ plugins?: IlamyPlugin[];
552
+ /** The resource axis. Absent/empty → a regular calendar (no filtering, no resource columns). */
553
+ resources?: Resource[];
554
+ /** Custom render for resource header cells. */
555
+ renderResource?: (resource: Resource) => React3.ReactNode3;
556
+ /** Resource arrangement preference. Only applies when `resources` is set. @default 'horizontal' */
557
+ orientation?: "horizontal" | "vertical";
558
+ /** Week-view granularity for resource weeks. @default 'hourly' */
559
+ weekViewGranularity?: "hourly" | "daily";
560
+ }
561
+ type CalendarTestProviderProps = Partial<CalendarProviderProps> & {
562
+ children: ReactNode4;
563
+ };
564
+ /**
565
+ * Public test harness for plugin authors. Mounts children inside the calendar
566
+ * context with sensible defaults so context-consuming plugin components (slot
567
+ * sections, plugin views) can be unit-tested in isolation, without the full
568
+ * `<IlamyCalendar>`. Override any provider prop as needed.
569
+ *
570
+ * @example
571
+ * render(
572
+ * <CalendarTestProvider>
573
+ * <MyPluginFormSection event={event} onChange={onChange} />
574
+ * </CalendarTestProvider>
575
+ * )
576
+ */
577
+ declare const CalendarTestProvider: ({ children,...overrides }: CalendarTestProviderProps) => ReactNode4;
578
+ export { CalendarTestProvider };
@@ -0,0 +1 @@
1
+ import{H as b}from"../shared/chunk-6vnwf8sr.js";import"../shared/chunk-jfadfww5.js";import{jsx as q}from"react/jsx-runtime";var y=({children:g,...k})=>q(b,{dayMaxEvents:5,...k,children:g});export{y as CalendarTestProvider};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilamy/calendar",
3
- "version": "1.8.1",
3
+ "version": "2.0.0",
4
4
  "description": "A full-featured React calendar component library built with Shadcn-Ui, Tailwind CSS, and TypeScript.",
5
5
  "author": "Sujeet Kc",
6
6
  "license": "MIT",
@@ -27,17 +27,30 @@
27
27
  "drag-and-drop",
28
28
  "recurring-events"
29
29
  ],
30
- "private": false,
31
30
  "type": "module",
32
31
  "main": "./dist/index.js",
33
32
  "module": "./dist/index.js",
34
33
  "types": "./dist/index.d.ts",
35
34
  "exports": {
36
35
  ".": {
37
- "import": {
38
- "types": "./dist/index.d.ts",
39
- "default": "./dist/index.js"
40
- }
36
+ "types": "./dist/index.d.ts",
37
+ "import": "./dist/index.js"
38
+ },
39
+ "./testing": {
40
+ "types": "./dist/testing/index.d.ts",
41
+ "import": "./dist/testing/index.js"
42
+ },
43
+ "./plugins/recurrence": {
44
+ "types": "./dist/plugins/recurrence.d.ts",
45
+ "import": "./dist/plugins/recurrence.js"
46
+ },
47
+ "./plugins/agenda": {
48
+ "types": "./dist/plugins/agenda.d.ts",
49
+ "import": "./dist/plugins/agenda.js"
50
+ },
51
+ "./plugins/drag-to-create": {
52
+ "types": "./dist/plugins/drag-to-create.d.ts",
53
+ "import": "./dist/plugins/drag-to-create.js"
41
54
  }
42
55
  },
43
56
  "files": [
@@ -46,30 +59,19 @@
46
59
  "LICENSE"
47
60
  ],
48
61
  "scripts": {
49
- "dev": "bunx vite",
50
- "start": "NODE_ENV=production bun src/index.tsx",
51
- "build": "NODE_ENV=production bunx bunup",
52
- "lint": "bunx biome lint . --diagnostic-level=error",
53
- "lint:fix": "bunx biome lint --write .",
54
- "format": "bunx biome format --write .",
55
- "format:check": "bunx biome format .",
56
- "check": "bunx biome check . --diagnostic-level=error",
57
- "check:fix": "bunx biome check --write .",
62
+ "build": "CI=true NODE_ENV=production bunx bunup",
58
63
  "test": "bun test",
59
64
  "test:coverage": "bun test --coverage",
60
- "test:coverage:report": "bun test --coverage --reporter=html",
61
65
  "type-check": "bunx tsc --noEmit",
66
+ "lint": "bunx biome lint . --diagnostic-level=error",
67
+ "check": "bunx biome check . --diagnostic-level=error",
68
+ "check:fix": "bunx biome check --write .",
62
69
  "ci": "bun run check && bun run type-check && bun run test && bun run build",
63
- "pre-commit": "bun run check:fix",
64
- "prepare": "bunx husky",
65
70
  "prepack": "bun scripts/prepack.ts",
66
- "postpack": "bun scripts/postpack.ts",
67
- "release": "bun run ci && npm publish --access public",
68
- "version:patch": "npm version patch",
69
- "version:minor": "npm version minor",
70
- "version:major": "npm version major"
71
+ "postpack": "bun scripts/postpack.ts"
71
72
  },
72
73
  "peerDependencies": {
74
+ "dayjs": "^1.11.20",
73
75
  "react": "^19.2.0",
74
76
  "react-dom": "^19.2.0",
75
77
  "tailwindcss": "^4.2.2",
@@ -80,38 +82,21 @@
80
82
  "@dnd-kit/modifiers": "^9.0.0",
81
83
  "@radix-ui/react-checkbox": "^1.3.3",
82
84
  "@radix-ui/react-dialog": "^1.1.15",
85
+ "@radix-ui/react-dropdown-menu": "^2.1.18",
83
86
  "@radix-ui/react-label": "^2.1.8",
84
87
  "@radix-ui/react-popover": "^1.1.15",
85
88
  "@radix-ui/react-scroll-area": "^1.2.10",
86
89
  "@radix-ui/react-select": "^2.2.6",
87
90
  "@radix-ui/react-slot": "^1.2.4",
91
+ "@radix-ui/react-toggle-group": "^1.1.13",
92
+ "@radix-ui/react-tooltip": "^1.2.8",
88
93
  "class-variance-authority": "^0.7.1",
89
94
  "clsx": "^2.1.1",
90
- "dayjs": "^1.11.20",
91
95
  "lucide-react": "^0.475.0",
92
96
  "motion": "^12.36.0",
93
97
  "rrule": "^2.8.1",
94
98
  "tailwind-merge": "^3.5.0"
95
99
  },
96
- "devDependencies": {
97
- "@biomejs/biome": "^2.4.9",
98
- "@happy-dom/global-registrator": "^18.0.1",
99
- "@tailwindcss/vite": "^4.3.0",
100
- "@testing-library/dom": "^10.4.1",
101
- "@testing-library/jest-dom": "^6.9.1",
102
- "@testing-library/react": "^16.3.2",
103
- "@types/bun": "latest",
104
- "@types/react": "^19.2.14",
105
- "@types/react-dom": "^19.2.3",
106
- "@types/rrule": "^2.2.9",
107
- "@vitejs/plugin-react": "^6.0.2",
108
- "bun-plugin-tailwind": "^0.1.2",
109
- "bunup": "^0.16.31",
110
- "husky": "^9.1.7",
111
- "lint-staged": "^16.4.0",
112
- "typescript": "^6.0.2",
113
- "vite": "^8.0.14"
114
- },
115
100
  "publishConfig": {
116
101
  "access": "public"
117
102
  },