@innosolutions/inno-calendar 1.0.57 → 1.0.59

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 (30) hide show
  1. package/AGENT.md +1721 -1610
  2. package/README.md +235 -235
  3. package/dist/agenda-widget-BxZU4eGL.cjs +2 -0
  4. package/dist/agenda-widget-BxZU4eGL.cjs.map +1 -0
  5. package/dist/{agenda-widget-1kak6FM9.js → agenda-widget-wrZfO67A.js} +1308 -1223
  6. package/dist/agenda-widget-wrZfO67A.js.map +1 -0
  7. package/dist/components/event/event-card.d.ts.map +1 -1
  8. package/dist/components/index.cjs +1 -1
  9. package/dist/components/index.mjs +2 -2
  10. package/dist/components/primitives/scroll-navigator.d.ts +1 -1
  11. package/dist/components/primitives/scroll-navigator.d.ts.map +1 -1
  12. package/dist/index.cjs +1 -1
  13. package/dist/index.mjs +200 -200
  14. package/dist/presets/index.cjs +1 -1
  15. package/dist/presets/index.mjs +1 -1
  16. package/dist/{tailwind-calendar-DjtOowce.js → tailwind-calendar-CVuxWXLY.js} +2 -2
  17. package/dist/{tailwind-calendar-DjtOowce.js.map → tailwind-calendar-CVuxWXLY.js.map} +1 -1
  18. package/dist/{tailwind-calendar-DpEkgg5k.cjs → tailwind-calendar-DoG6s3PJ.cjs} +2 -2
  19. package/dist/{tailwind-calendar-DpEkgg5k.cjs.map → tailwind-calendar-DoG6s3PJ.cjs.map} +1 -1
  20. package/dist/week-view-Bzpbti1B.cjs +11 -0
  21. package/dist/week-view-Bzpbti1B.cjs.map +1 -0
  22. package/dist/{week-view-CKx6bJdJ.js → week-view-C1FxF_nk.js} +880 -867
  23. package/dist/week-view-C1FxF_nk.js.map +1 -0
  24. package/package.json +138 -138
  25. package/dist/agenda-widget-1kak6FM9.js.map +0 -1
  26. package/dist/agenda-widget-C8CFFI1c.cjs +0 -2
  27. package/dist/agenda-widget-C8CFFI1c.cjs.map +0 -1
  28. package/dist/week-view-CKx6bJdJ.js.map +0 -1
  29. package/dist/week-view-DXlwhFjn.cjs +0 -11
  30. package/dist/week-view-DXlwhFjn.cjs.map +0 -1
package/README.md CHANGED
@@ -1,235 +1,235 @@
1
- # @inno/calendar
2
-
3
- A headless-first, fully customizable React calendar for enterprise applications.
4
-
5
- [![npm version](https://img.shields.io/npm/v/@innosolutions/inno-calendar.svg)](https://www.npmjs.com/package/@innosolutions/inno-calendar)
6
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue.svg)](https://www.typescriptlang.org/)
7
- [![React](https://img.shields.io/badge/React-18+-61DAFB.svg)](https://reactjs.org/)
8
-
9
- > **🤖 AI Agents:** For comprehensive implementation details, copy the contents of [AGENT.md](./AGENT.md) into your context.
10
-
11
- ## Installation
12
-
13
- ```bash
14
- npm install @innosolutions/inno-calendar
15
- ```
16
-
17
- ```bash
18
- # Optional: Radix UI for enhanced popovers/tooltips
19
- npm install @radix-ui/react-popover @radix-ui/react-tooltip @radix-ui/react-dropdown-menu
20
- ```
21
-
22
- ## Quick Start
23
-
24
- ```tsx
25
- import { InnoCalendar, type CalendarEvent } from "@innosolutions/inno-calendar";
26
- import "@innosolutions/inno-calendar/styles";
27
-
28
- const events: CalendarEvent[] = [
29
- {
30
- id: "1",
31
- title: "Team Meeting",
32
- startDate: new Date("2026-02-04T09:00:00"),
33
- endDate: new Date("2026-02-04T10:00:00"),
34
- color: "blue",
35
- },
36
- ];
37
-
38
- function MyCalendar() {
39
- return (
40
- <InnoCalendar
41
- events={events}
42
- initialView="week"
43
- onEventClick={(event) => console.log(event)}
44
- onSlotSelect={(selection) =>
45
- console.log(selection.startDate, selection.endDate)
46
- }
47
- />
48
- );
49
- }
50
- ```
51
-
52
- ## Features
53
-
54
- - **8 View Modes** — Day, Week, Month, Year, Agenda, Timeline (1/3/7 day)
55
- - **Headless Architecture** — Use hooks directly or pre-built components
56
- - **Drag & Drop** — Drag to select time ranges, drag events to reschedule
57
- - **TypeScript** — Fully typed with generic event data support
58
- - **Customizable** — Custom popovers, settings panels, filters
59
- - **No External Dependencies** — Native Date API, minimal footprint
60
-
61
- ## Views
62
-
63
- | View | Description |
64
- | --------------- | -------------------------- |
65
- | `day` | Single day hourly grid |
66
- | `week` | 7-day grid with time slots |
67
- | `month` | Monthly calendar |
68
- | `year` | 12-month overview |
69
- | `agenda` | Scrollable event list |
70
- | `timeline-day` | Resource timeline (1 day) |
71
- | `timeline-3day` | Resource timeline (3 days) |
72
- | `timeline-week` | Resource timeline (7 days) |
73
-
74
- ## Event Structure
75
-
76
- ```tsx
77
- interface CalendarEvent<TData = Record<string, unknown>> {
78
- // Required
79
- id: string;
80
- title: string;
81
- startDate: Date;
82
- endDate: Date;
83
-
84
- // Optional display fields
85
- color?:
86
- | "blue"
87
- | "green"
88
- | "red"
89
- | "yellow"
90
- | "purple"
91
- | "orange"
92
- | "pink"
93
- | "teal"
94
- | "gray"
95
- | "indigo";
96
- hexColor?: string; // Hex override (takes precedence over color)
97
- description?: string;
98
- isCanceled?: boolean;
99
- isAllDay?: boolean;
100
- isMultiDay?: boolean;
101
- isRecurring?: boolean;
102
- resourceId?: string; // For resource/timeline views
103
-
104
- // Built-in filtering (optional — skip if you filter server-side)
105
- scheduleTypeId?: number;
106
- scheduleTypeName?: string;
107
- participants?: ICalendarUser[];
108
-
109
- // @deprecated — still functional, but migrate to `data` bag.
110
- // Will be removed in the next major version.
111
- meetingTookPlace?: boolean; // → data.meetingTookPlace
112
- isAccepted?: boolean; // → data.isAccepted
113
- companyId?: number; // → data.companyId
114
- cancelReason?: string | null; // → data.cancelReason
115
- user?: ICalendarUser; // → data.user
116
- // ... and others (see types.ts for full list)
117
-
118
- data?: TData; // Your custom domain-specific fields (RECOMMENDED)
119
- }
120
- ```
121
-
122
- ## Props
123
-
124
- ```tsx
125
- <InnoCalendar
126
- // Data
127
- events={events}
128
- users={users}
129
- scheduleTypes={scheduleTypes}
130
- // Initial State
131
- initialView="week"
132
- initialDate={new Date()}
133
- // Callbacks
134
- onEventClick={(event) => {}}
135
- onSlotSelect={(selection) => {}}
136
- onSlotClick={(date, hour) => {}}
137
- onAddEvent={() => {}}
138
- onEventDrop={(result) => {}}
139
- onDateChange={(date, view) => {}}
140
- onViewChange={(view) => {}}
141
- // Customization
142
- renderPopover={({ event, onClose }) => <CustomPopover />}
143
- settingsContent={<SettingsPanel />}
144
- filterContent={<FiltersRow />}
145
- showHeader={true}
146
- />
147
- ```
148
-
149
- ## Provider Pattern
150
-
151
- For shared state across components:
152
-
153
- ```tsx
154
- import {
155
- InnoCalendarProvider,
156
- useInnoCalendar,
157
- CalendarHeader,
158
- WeekView,
159
- } from "@innosolutions/inno-calendar";
160
-
161
- function App() {
162
- return (
163
- <InnoCalendarProvider initialEvents={events} initialView="week">
164
- <CalendarContent />
165
- </InnoCalendarProvider>
166
- );
167
- }
168
-
169
- function CalendarContent() {
170
- const { view, filteredEvents, selectedDate } = useInnoCalendar();
171
- return (
172
- <>
173
- <CalendarHeader />
174
- <WeekView events={filteredEvents} date={selectedDate} />
175
- </>
176
- );
177
- }
178
- ```
179
-
180
- ## Working Hours
181
-
182
- ```tsx
183
- const workingHours = {
184
- 0: { enabled: false, from: 8, to: 17 }, // Sunday
185
- 1: { enabled: true, from: 9, to: 18 }, // Monday
186
- 2: { enabled: true, from: 9, to: 18 }, // Tuesday
187
- 3: { enabled: true, from: 9, to: 18 }, // Wednesday
188
- 4: { enabled: true, from: 9, to: 18 }, // Thursday
189
- 5: { enabled: true, from: 9, to: 17 }, // Friday
190
- 6: { enabled: false, from: 8, to: 12 }, // Saturday
191
- };
192
-
193
- <InnoCalendar
194
- events={events}
195
- preferencesConfig={{
196
- defaults: { workingHours },
197
- }}
198
- />;
199
- ```
200
-
201
- ## Styles
202
-
203
- Import the bundled styles for proper rendering:
204
-
205
- ```tsx
206
- import "@innosolutions/inno-calendar/styles";
207
- ```
208
-
209
- Or include CSS custom properties for theming:
210
-
211
- ```css
212
- :root {
213
- --inno-border-color: #e5e7eb;
214
- --inno-primary: #3b82f6;
215
- --inno-hour-height: 96px;
216
- }
217
- ```
218
-
219
- ## TypeScript
220
-
221
- ```tsx
222
- import type {
223
- CalendarEvent,
224
- TCalendarView,
225
- TEventColor,
226
- ICalendarUser,
227
- IScheduleType,
228
- ISelectionResult,
229
- TWorkingHours,
230
- } from "@innosolutions/inno-calendar";
231
- ```
232
-
233
- ## License
234
-
235
- MIT © [InnoSolutions](https://github.com/innosolutions)
1
+ # @inno/calendar
2
+
3
+ A headless-first, fully customizable React calendar for enterprise applications.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@innosolutions/inno-calendar.svg)](https://www.npmjs.com/package/@innosolutions/inno-calendar)
6
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue.svg)](https://www.typescriptlang.org/)
7
+ [![React](https://img.shields.io/badge/React-18+-61DAFB.svg)](https://reactjs.org/)
8
+
9
+ > **🤖 AI Agents:** For comprehensive implementation details, copy the contents of [AGENT.md](./AGENT.md) into your context.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ npm install @innosolutions/inno-calendar
15
+ ```
16
+
17
+ ```bash
18
+ # Optional: Radix UI for enhanced popovers/tooltips
19
+ npm install @radix-ui/react-popover @radix-ui/react-tooltip @radix-ui/react-dropdown-menu
20
+ ```
21
+
22
+ ## Quick Start
23
+
24
+ ```tsx
25
+ import { InnoCalendar, type CalendarEvent } from "@innosolutions/inno-calendar";
26
+ import "@innosolutions/inno-calendar/styles";
27
+
28
+ const events: CalendarEvent[] = [
29
+ {
30
+ id: "1",
31
+ title: "Team Meeting",
32
+ startDate: new Date("2026-02-04T09:00:00"),
33
+ endDate: new Date("2026-02-04T10:00:00"),
34
+ color: "blue",
35
+ },
36
+ ];
37
+
38
+ function MyCalendar() {
39
+ return (
40
+ <InnoCalendar
41
+ events={events}
42
+ initialView="week"
43
+ onEventClick={(event) => console.log(event)}
44
+ onSlotSelect={(selection) =>
45
+ console.log(selection.startDate, selection.endDate)
46
+ }
47
+ />
48
+ );
49
+ }
50
+ ```
51
+
52
+ ## Features
53
+
54
+ - **8 View Modes** — Day, Week, Month, Year, Agenda, Timeline (1/3/7 day)
55
+ - **Headless Architecture** — Use hooks directly or pre-built components
56
+ - **Drag & Drop** — Drag to select time ranges, drag events to reschedule
57
+ - **TypeScript** — Fully typed with generic event data support
58
+ - **Customizable** — Custom popovers, settings panels, filters
59
+ - **No External Dependencies** — Native Date API, minimal footprint
60
+
61
+ ## Views
62
+
63
+ | View | Description |
64
+ | --------------- | -------------------------- |
65
+ | `day` | Single day hourly grid |
66
+ | `week` | 7-day grid with time slots |
67
+ | `month` | Monthly calendar |
68
+ | `year` | 12-month overview |
69
+ | `agenda` | Scrollable event list |
70
+ | `timeline-day` | Resource timeline (1 day) |
71
+ | `timeline-3day` | Resource timeline (3 days) |
72
+ | `timeline-week` | Resource timeline (7 days) |
73
+
74
+ ## Event Structure
75
+
76
+ ```tsx
77
+ interface CalendarEvent<TData = Record<string, unknown>> {
78
+ // Required
79
+ id: string;
80
+ title: string;
81
+ startDate: Date;
82
+ endDate: Date;
83
+
84
+ // Optional display fields
85
+ color?:
86
+ | "blue"
87
+ | "green"
88
+ | "red"
89
+ | "yellow"
90
+ | "purple"
91
+ | "orange"
92
+ | "pink"
93
+ | "teal"
94
+ | "gray"
95
+ | "indigo";
96
+ hexColor?: string; // Hex override (takes precedence over color)
97
+ description?: string;
98
+ isCanceled?: boolean;
99
+ isAllDay?: boolean;
100
+ isMultiDay?: boolean;
101
+ isRecurring?: boolean;
102
+ resourceId?: string; // For resource/timeline views
103
+
104
+ // Built-in filtering (optional — skip if you filter server-side)
105
+ scheduleTypeId?: number;
106
+ scheduleTypeName?: string;
107
+ participants?: ICalendarUser[];
108
+
109
+ // @deprecated — still functional, but migrate to `data` bag.
110
+ // Will be removed in the next major version.
111
+ meetingTookPlace?: boolean; // → data.meetingTookPlace
112
+ isAccepted?: boolean; // → data.isAccepted
113
+ companyId?: number; // → data.companyId
114
+ cancelReason?: string | null; // → data.cancelReason
115
+ user?: ICalendarUser; // → data.user
116
+ // ... and others (see types.ts for full list)
117
+
118
+ data?: TData; // Your custom domain-specific fields (RECOMMENDED)
119
+ }
120
+ ```
121
+
122
+ ## Props
123
+
124
+ ```tsx
125
+ <InnoCalendar
126
+ // Data
127
+ events={events}
128
+ users={users}
129
+ scheduleTypes={scheduleTypes}
130
+ // Initial State
131
+ initialView="week"
132
+ initialDate={new Date()}
133
+ // Callbacks
134
+ onEventClick={(event) => {}}
135
+ onSlotSelect={(selection) => {}}
136
+ onSlotClick={(date, hour) => {}}
137
+ onAddEvent={() => {}}
138
+ onEventDrop={(result) => {}}
139
+ onDateChange={(date, view) => {}}
140
+ onViewChange={(view) => {}}
141
+ // Customization
142
+ renderPopover={({ event, onClose }) => <CustomPopover />}
143
+ settingsContent={<SettingsPanel />}
144
+ filterContent={<FiltersRow />}
145
+ showHeader={true}
146
+ />
147
+ ```
148
+
149
+ ## Provider Pattern
150
+
151
+ For shared state across components:
152
+
153
+ ```tsx
154
+ import {
155
+ InnoCalendarProvider,
156
+ useInnoCalendar,
157
+ CalendarHeader,
158
+ WeekView,
159
+ } from "@innosolutions/inno-calendar";
160
+
161
+ function App() {
162
+ return (
163
+ <InnoCalendarProvider initialEvents={events} initialView="week">
164
+ <CalendarContent />
165
+ </InnoCalendarProvider>
166
+ );
167
+ }
168
+
169
+ function CalendarContent() {
170
+ const { view, filteredEvents, selectedDate } = useInnoCalendar();
171
+ return (
172
+ <>
173
+ <CalendarHeader />
174
+ <WeekView events={filteredEvents} date={selectedDate} />
175
+ </>
176
+ );
177
+ }
178
+ ```
179
+
180
+ ## Working Hours
181
+
182
+ ```tsx
183
+ const workingHours = {
184
+ 0: { enabled: false, from: 8, to: 17 }, // Sunday
185
+ 1: { enabled: true, from: 9, to: 18 }, // Monday
186
+ 2: { enabled: true, from: 9, to: 18 }, // Tuesday
187
+ 3: { enabled: true, from: 9, to: 18 }, // Wednesday
188
+ 4: { enabled: true, from: 9, to: 18 }, // Thursday
189
+ 5: { enabled: true, from: 9, to: 17 }, // Friday
190
+ 6: { enabled: false, from: 8, to: 12 }, // Saturday
191
+ };
192
+
193
+ <InnoCalendar
194
+ events={events}
195
+ preferencesConfig={{
196
+ defaults: { workingHours },
197
+ }}
198
+ />;
199
+ ```
200
+
201
+ ## Styles
202
+
203
+ Import the bundled styles for proper rendering:
204
+
205
+ ```tsx
206
+ import "@innosolutions/inno-calendar/styles";
207
+ ```
208
+
209
+ Or include CSS custom properties for theming:
210
+
211
+ ```css
212
+ :root {
213
+ --inno-border-color: #e5e7eb;
214
+ --inno-primary: #3b82f6;
215
+ --inno-hour-height: 96px;
216
+ }
217
+ ```
218
+
219
+ ## TypeScript
220
+
221
+ ```tsx
222
+ import type {
223
+ CalendarEvent,
224
+ TCalendarView,
225
+ TEventColor,
226
+ ICalendarUser,
227
+ IScheduleType,
228
+ ISelectionResult,
229
+ TWorkingHours,
230
+ } from "@innosolutions/inno-calendar";
231
+ ```
232
+
233
+ ## License
234
+
235
+ MIT © [InnoSolutions](https://github.com/innosolutions)