calendarkit-prov2 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.
- package/LICENSE +21 -0
- package/README.md +272 -0
- package/dist/calendarkit.css +64 -0
- package/dist/index.d.mts +320 -0
- package/dist/index.d.ts +320 -0
- package/dist/index.js +4687 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4661 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +95 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sayzera
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# CalendarKit Pro v2
|
|
2
|
+
|
|
3
|
+
Professional React calendar component with drag-and-drop, recurring events, timezone support, resource scheduling, custom views, sidebar menus, and 15+ languages.
|
|
4
|
+
|
|
5
|
+
**Author:** [Sayzera](https://github.com/Sayzera)
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/calendarkit-prov2)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
[](https://github.com/Sayzera/calendarkit-prov2)
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install calendarkit-prov2
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Peer dependencies
|
|
18
|
+
|
|
19
|
+
- `react` ^18 or ^19
|
|
20
|
+
- `react-dom` ^18 or ^19
|
|
21
|
+
- **Tailwind CSS v3+** (required for styling)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Quick start
|
|
26
|
+
|
|
27
|
+
### 1. Tailwind — scan the package
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
// tailwind.config.js
|
|
31
|
+
module.exports = {
|
|
32
|
+
content: [
|
|
33
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
34
|
+
'./node_modules/calendarkit-prov2/dist/**/*.{js,mjs}',
|
|
35
|
+
],
|
|
36
|
+
darkMode: 'class',
|
|
37
|
+
theme: {
|
|
38
|
+
extend: {
|
|
39
|
+
colors: {
|
|
40
|
+
background: 'hsl(var(--background))',
|
|
41
|
+
foreground: 'hsl(var(--foreground))',
|
|
42
|
+
primary: {
|
|
43
|
+
DEFAULT: 'hsl(var(--primary))',
|
|
44
|
+
foreground: 'hsl(var(--primary-foreground))',
|
|
45
|
+
},
|
|
46
|
+
secondary: {
|
|
47
|
+
DEFAULT: 'hsl(var(--secondary))',
|
|
48
|
+
foreground: 'hsl(var(--secondary-foreground))',
|
|
49
|
+
},
|
|
50
|
+
muted: {
|
|
51
|
+
DEFAULT: 'hsl(var(--muted))',
|
|
52
|
+
foreground: 'hsl(var(--muted-foreground))',
|
|
53
|
+
},
|
|
54
|
+
accent: {
|
|
55
|
+
DEFAULT: 'hsl(var(--accent))',
|
|
56
|
+
foreground: 'hsl(var(--accent-foreground))',
|
|
57
|
+
},
|
|
58
|
+
border: 'hsl(var(--border))',
|
|
59
|
+
ring: 'hsl(var(--ring))',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 2. Import theme CSS
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
// app/layout.tsx or main.tsx
|
|
70
|
+
import 'calendarkit-prov2/calendarkit.css';
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 3. Use the component
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
'use client';
|
|
77
|
+
|
|
78
|
+
import { ProScheduler } from 'calendarkit-prov2';
|
|
79
|
+
import type { CalendarEvent, ViewType } from 'calendarkit-prov2';
|
|
80
|
+
import { useState } from 'react';
|
|
81
|
+
import { fr } from 'date-fns/locale';
|
|
82
|
+
|
|
83
|
+
export default function AdvancedCalendar() {
|
|
84
|
+
const [events, setEvents] = useState<CalendarEvent[]>([]);
|
|
85
|
+
const [view, setView] = useState<ViewType>('week');
|
|
86
|
+
const [date, setDate] = useState(new Date());
|
|
87
|
+
const [isDark, setIsDark] = useState(false);
|
|
88
|
+
const [language, setLanguage] = useState<'en' | 'fr' | 'tr'>('en');
|
|
89
|
+
const [timezone, setTimezone] = useState('America/New_York');
|
|
90
|
+
|
|
91
|
+
const calendars = [
|
|
92
|
+
{ id: 'work', label: 'Work', color: '#3b82f6', active: true },
|
|
93
|
+
{ id: 'personal', label: 'Personal', color: '#10b981', active: true },
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<div className={isDark ? 'dark' : ''}>
|
|
98
|
+
<div className="h-[700px] border rounded-lg overflow-hidden">
|
|
99
|
+
<ProScheduler
|
|
100
|
+
events={events}
|
|
101
|
+
view={view}
|
|
102
|
+
onViewChange={setView}
|
|
103
|
+
date={date}
|
|
104
|
+
onDateChange={setDate}
|
|
105
|
+
calendars={calendars}
|
|
106
|
+
timezone={timezone}
|
|
107
|
+
onTimezoneChange={setTimezone}
|
|
108
|
+
language={language}
|
|
109
|
+
onLanguageChange={setLanguage}
|
|
110
|
+
locale={language === 'fr' ? fr : undefined}
|
|
111
|
+
isDarkMode={isDark}
|
|
112
|
+
onThemeToggle={() => setIsDark(!isDark)}
|
|
113
|
+
onEventCreate={(event) => {
|
|
114
|
+
setEvents((prev) => [
|
|
115
|
+
...prev,
|
|
116
|
+
{ ...event, id: crypto.randomUUID() } as CalendarEvent,
|
|
117
|
+
]);
|
|
118
|
+
}}
|
|
119
|
+
onEventUpdate={(updated) => {
|
|
120
|
+
setEvents((prev) => prev.map((e) => (e.id === updated.id ? updated : e)));
|
|
121
|
+
}}
|
|
122
|
+
onEventDelete={(id) => {
|
|
123
|
+
setEvents((prev) => prev.filter((e) => e.id !== id));
|
|
124
|
+
}}
|
|
125
|
+
onEventDrop={(event, newStart, newEnd) => {
|
|
126
|
+
setEvents((prev) =>
|
|
127
|
+
prev.map((e) =>
|
|
128
|
+
e.id === event.id ? { ...e, start: newStart, end: newEnd } : e
|
|
129
|
+
)
|
|
130
|
+
);
|
|
131
|
+
}}
|
|
132
|
+
/>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
> **Migration from v1 (`@calendarkit/react`):** Replace the import path with `calendarkit-prov2`. The component name `ProScheduler` and most props stay the same. `Scheduler` is also exported as an alias.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Exports
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
import {
|
|
147
|
+
ProScheduler,
|
|
148
|
+
Scheduler,
|
|
149
|
+
cn,
|
|
150
|
+
getTranslations,
|
|
151
|
+
LANGUAGE_META,
|
|
152
|
+
LOCALES,
|
|
153
|
+
} from 'calendarkit-prov2';
|
|
154
|
+
|
|
155
|
+
import type {
|
|
156
|
+
CalendarEvent,
|
|
157
|
+
ProSchedulerProps,
|
|
158
|
+
ViewType,
|
|
159
|
+
Resource,
|
|
160
|
+
EventType,
|
|
161
|
+
CustomView,
|
|
162
|
+
SidebarMenuItem,
|
|
163
|
+
CalendarTheme,
|
|
164
|
+
LanguageCode,
|
|
165
|
+
} from 'calendarkit-prov2';
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Props
|
|
171
|
+
|
|
172
|
+
| Prop | Type | Description |
|
|
173
|
+
|------|------|-------------|
|
|
174
|
+
| `events` | `CalendarEvent[]` | Events to display |
|
|
175
|
+
| `view` | `ViewType` | `'month' \| 'week' \| 'day' \| 'agenda' \| 'resource'` |
|
|
176
|
+
| `date` | `Date` | Focused date |
|
|
177
|
+
| `onViewChange` | `(view) => void` | View change handler |
|
|
178
|
+
| `onDateChange` | `(date) => void` | Date change handler |
|
|
179
|
+
| `onEventCreate` | `(event) => void` | New event |
|
|
180
|
+
| `onEventUpdate` | `(event) => void` | Update event |
|
|
181
|
+
| `onEventDelete` | `(id) => void` | Delete event |
|
|
182
|
+
| `onEventDrop` | `(event, start, end) => void` | Drag and drop handler |
|
|
183
|
+
| `onEventResize` | `(event, start, end) => void` | Resize handler |
|
|
184
|
+
| `calendars` | `Calendar[]` | Multi-calendar filter |
|
|
185
|
+
| `resources` | `Resource[]` | Resource view columns |
|
|
186
|
+
| `eventTypes` | `EventType[]` | Event type presets |
|
|
187
|
+
| `timezone` | `string` | IANA timezone |
|
|
188
|
+
| `onTimezoneChange` | `(tz) => void` | Timezone change |
|
|
189
|
+
| `language` | `LanguageCode` | UI language (15+ locales, default `tr`) |
|
|
190
|
+
| `onLanguageChange` | `(lang) => void` | Language change |
|
|
191
|
+
| `locale` | `Locale` | date-fns locale |
|
|
192
|
+
| `isDarkMode` | `boolean` | Dark mode state |
|
|
193
|
+
| `onThemeToggle` | `() => void` | Theme toggle |
|
|
194
|
+
| `theme` | `CalendarTheme` | Custom colors / radius |
|
|
195
|
+
| `customViews` | `CustomView[]` | Extra header views |
|
|
196
|
+
| `sidebarMenus` | `SidebarMenuItem[]` | Custom sidebar pages |
|
|
197
|
+
| `readOnly` | `boolean` | Disable editing |
|
|
198
|
+
| `isLoading` | `boolean` | Skeleton state |
|
|
199
|
+
| `renderEventForm` | `(props) => ReactNode` | Custom event modal |
|
|
200
|
+
| `renderHeader` | `(props) => ReactNode` | Custom header |
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Publish to npm (Access Token)
|
|
205
|
+
|
|
206
|
+
Repository: [github.com/Sayzera/calendarkit-prov2](https://github.com/Sayzera/calendarkit-prov2)
|
|
207
|
+
|
|
208
|
+
npm publish requires an **Access Token** (for CI/CD or local automation). You do not need 2FA OTP on every publish when using a token with publish permission.
|
|
209
|
+
|
|
210
|
+
### Step 1 — Create npm Access Token
|
|
211
|
+
|
|
212
|
+
1. Go to [npmjs.com](https://www.npmjs.com) → **Account** → **Access Tokens**
|
|
213
|
+
2. **Generate New Token** → **Granular Access Token**
|
|
214
|
+
3. Configure:
|
|
215
|
+
- **Token name:** `calendarkit-prov2-publish`
|
|
216
|
+
- **Expiration:** your choice (90 days / 1 year)
|
|
217
|
+
- **Packages:** select `calendarkit-prov2` (or all packages you own)
|
|
218
|
+
- **Permissions:** **Read and write**
|
|
219
|
+
4. Enable **Bypass 2FA for publish** if the option is shown (required for automated publish)
|
|
220
|
+
5. Copy the token (`npm_...`) — it is shown only once
|
|
221
|
+
|
|
222
|
+
### Step 2 — Publish from your machine (PowerShell)
|
|
223
|
+
|
|
224
|
+
```powershell
|
|
225
|
+
# Set token for this session only (do not commit the token)
|
|
226
|
+
$env:NPM_TOKEN = "npm_YOUR_TOKEN_HERE"
|
|
227
|
+
|
|
228
|
+
npm run build:lib
|
|
229
|
+
npm publish --access public
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
The project `.npmrc` reads `NPM_TOKEN` from the environment automatically.
|
|
233
|
+
|
|
234
|
+
### Step 3 — Publish via GitHub Actions (recommended)
|
|
235
|
+
|
|
236
|
+
1. GitHub repo → **Settings** → **Secrets and variables** → **Actions**
|
|
237
|
+
2. **New repository secret**
|
|
238
|
+
- Name: `NPM_TOKEN`
|
|
239
|
+
- Value: your `npm_...` token
|
|
240
|
+
3. Bump version and push a tag:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
npm version patch
|
|
244
|
+
git push origin main --tags
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Or run manually: **Actions** → **Publish to npm** → **Run workflow**
|
|
248
|
+
|
|
249
|
+
The workflow file: `.github/workflows/publish-npm.yml`
|
|
250
|
+
|
|
251
|
+
### What gets published
|
|
252
|
+
|
|
253
|
+
`build:lib` produces:
|
|
254
|
+
|
|
255
|
+
- `dist/index.js` (CommonJS)
|
|
256
|
+
- `dist/index.mjs` (ESM)
|
|
257
|
+
- `dist/index.d.ts` / `dist/index.d.mts` (TypeScript types)
|
|
258
|
+
- `dist/calendarkit.css` (theme tokens)
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Links
|
|
263
|
+
|
|
264
|
+
- [GitHub Repository](https://github.com/Sayzera/calendarkit-prov2)
|
|
265
|
+
- [npm Package](https://www.npmjs.com/package/calendarkit-prov2)
|
|
266
|
+
- [Issues](https://github.com/Sayzera/calendarkit-prov2/issues)
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## License
|
|
271
|
+
|
|
272
|
+
MIT — see [LICENSE](LICENSE). Copyright (c) 2026 [Sayzera](https://github.com/Sayzera).
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CalendarKit Pro v2 — theme tokens
|
|
3
|
+
* Import once in your app entry (e.g. layout.tsx / main.tsx):
|
|
4
|
+
* import 'calendarkit-prov2/calendarkit.css';
|
|
5
|
+
*/
|
|
6
|
+
:root {
|
|
7
|
+
--background: 0 0% 100%;
|
|
8
|
+
--foreground: 222.2 84% 4.9%;
|
|
9
|
+
--primary: 221.2 83.2% 53.3%;
|
|
10
|
+
--primary-foreground: 210 40% 98%;
|
|
11
|
+
--secondary: 210 40% 96.1%;
|
|
12
|
+
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
13
|
+
--muted: 210 40% 96.1%;
|
|
14
|
+
--muted-foreground: 215.4 16.3% 46.9%;
|
|
15
|
+
--accent: 210 40% 96.1%;
|
|
16
|
+
--accent-foreground: 222.2 47.4% 11.2%;
|
|
17
|
+
--border: 214.3 31.8% 91.4%;
|
|
18
|
+
--ring: 221.2 83.2% 53.3%;
|
|
19
|
+
--card: 0 0% 100%;
|
|
20
|
+
--card-foreground: 222.2 84% 4.9%;
|
|
21
|
+
--popover: 0 0% 100%;
|
|
22
|
+
--popover-foreground: 222.2 84% 4.9%;
|
|
23
|
+
--destructive: 0 84.2% 60.2%;
|
|
24
|
+
--destructive-foreground: 210 40% 98%;
|
|
25
|
+
--success: 142 76% 36%;
|
|
26
|
+
--success-foreground: 0 0% 100%;
|
|
27
|
+
--warning: 38 92% 50%;
|
|
28
|
+
--warning-foreground: 0 0% 100%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.dark {
|
|
32
|
+
--background: 224 71% 4%;
|
|
33
|
+
--foreground: 213 31% 91%;
|
|
34
|
+
--primary: 217.2 91.2% 59.8%;
|
|
35
|
+
--primary-foreground: 222.2 47.4% 11.2%;
|
|
36
|
+
--secondary: 222 47% 11%;
|
|
37
|
+
--secondary-foreground: 210 40% 98%;
|
|
38
|
+
--muted: 223 47% 11%;
|
|
39
|
+
--muted-foreground: 218 11% 65%;
|
|
40
|
+
--accent: 216 34% 17%;
|
|
41
|
+
--accent-foreground: 210 40% 98%;
|
|
42
|
+
--border: 216 34% 17%;
|
|
43
|
+
--ring: 224.3 76.3% 48%;
|
|
44
|
+
--card: 224 71% 6%;
|
|
45
|
+
--card-foreground: 213 31% 91%;
|
|
46
|
+
--popover: 224 71% 6%;
|
|
47
|
+
--popover-foreground: 213 31% 91%;
|
|
48
|
+
--destructive: 0 63% 31%;
|
|
49
|
+
--destructive-foreground: 210 40% 98%;
|
|
50
|
+
--success: 142 69% 31%;
|
|
51
|
+
--success-foreground: 0 0% 100%;
|
|
52
|
+
--warning: 32 95% 44%;
|
|
53
|
+
--warning-foreground: 0 0% 100%;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Time indicator pulse used in Day/Week views */
|
|
57
|
+
@keyframes time-pulse {
|
|
58
|
+
0%, 100% { opacity: 1; transform: scale(1); }
|
|
59
|
+
50% { opacity: 0.7; transform: scale(1.1); }
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.time-indicator-dot {
|
|
63
|
+
animation: time-pulse 2s ease-in-out infinite;
|
|
64
|
+
}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Locale } from 'date-fns';
|
|
3
|
+
import { ClassValue } from 'clsx';
|
|
4
|
+
|
|
5
|
+
type LanguageCode = 'tr' | 'en' | 'fr' | 'de' | 'es' | 'it' | 'pt' | 'ar' | 'zh' | 'ja' | 'ko' | 'ru' | 'nl' | 'pl' | 'sv';
|
|
6
|
+
declare const LANGUAGE_META: Record<LanguageCode, {
|
|
7
|
+
native: string;
|
|
8
|
+
english: string;
|
|
9
|
+
flag: string;
|
|
10
|
+
rtl?: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
declare const LOCALES: Record<LanguageCode, CalendarTranslations>;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the full translation object for a given language code,
|
|
15
|
+
* merged with any custom override translations.
|
|
16
|
+
*/
|
|
17
|
+
declare function getTranslations(language?: LanguageCode, overrides?: Partial<CalendarTranslations>): CalendarTranslations;
|
|
18
|
+
|
|
19
|
+
type ViewType = 'month' | 'week' | 'day' | 'agenda' | 'resource';
|
|
20
|
+
/**
|
|
21
|
+
* A fully custom view that extends the built-in views (month/week/day/agenda).
|
|
22
|
+
* - Appears as a button in the header's view switcher (after built-in views)
|
|
23
|
+
* - Also listed vertically in the sidebar's İşlemler section
|
|
24
|
+
* - When active, its component replaces the main calendar area
|
|
25
|
+
*/
|
|
26
|
+
interface CustomView {
|
|
27
|
+
/** Unique identifier — must not collide with built-in ViewType values. */
|
|
28
|
+
id: string;
|
|
29
|
+
/** Short label shown in the header button and sidebar list. */
|
|
30
|
+
label: string;
|
|
31
|
+
/** Optional icon for the header button and sidebar row. */
|
|
32
|
+
icon?: React.ReactNode;
|
|
33
|
+
/** The React node rendered in the main content area when this view is selected. */
|
|
34
|
+
component: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A single custom navigation item shown in the Scheduler sidebar.
|
|
38
|
+
* Clicking it replaces the main calendar area with the provided component.
|
|
39
|
+
*/
|
|
40
|
+
interface SidebarMenuItem {
|
|
41
|
+
/** Unique key used to track which menu is active. */
|
|
42
|
+
id: string;
|
|
43
|
+
/** Display label shown in the sidebar. */
|
|
44
|
+
label: string;
|
|
45
|
+
/** Optional icon rendered before the label. Any React node (e.g. a Lucide icon). */
|
|
46
|
+
icon?: React.ReactNode;
|
|
47
|
+
/** The component rendered in the main area when this menu item is selected. */
|
|
48
|
+
component: React.ReactNode;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface EventAttachment {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
url?: string;
|
|
55
|
+
type: 'file' | 'link' | 'image';
|
|
56
|
+
size?: string;
|
|
57
|
+
}
|
|
58
|
+
interface EventReminder {
|
|
59
|
+
id: string;
|
|
60
|
+
type: 'notification' | 'email';
|
|
61
|
+
time: number;
|
|
62
|
+
label?: string;
|
|
63
|
+
}
|
|
64
|
+
interface CalendarEvent {
|
|
65
|
+
id: string;
|
|
66
|
+
title: string;
|
|
67
|
+
start: Date;
|
|
68
|
+
end: Date;
|
|
69
|
+
description?: string;
|
|
70
|
+
color?: string;
|
|
71
|
+
allDay?: boolean;
|
|
72
|
+
calendarId?: string;
|
|
73
|
+
resourceId?: string;
|
|
74
|
+
type?: string;
|
|
75
|
+
icon?: string;
|
|
76
|
+
attachments?: EventAttachment[];
|
|
77
|
+
guests?: string[];
|
|
78
|
+
reminders?: EventReminder[];
|
|
79
|
+
recurrence?: {
|
|
80
|
+
freq: 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY';
|
|
81
|
+
interval?: number;
|
|
82
|
+
count?: number;
|
|
83
|
+
until?: Date;
|
|
84
|
+
byweekday?: number[];
|
|
85
|
+
};
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
}
|
|
88
|
+
interface EventType {
|
|
89
|
+
id: string;
|
|
90
|
+
label: string;
|
|
91
|
+
color?: string;
|
|
92
|
+
icon?: React.ReactNode;
|
|
93
|
+
}
|
|
94
|
+
interface Resource {
|
|
95
|
+
id: string;
|
|
96
|
+
label: string;
|
|
97
|
+
color?: string;
|
|
98
|
+
avatar?: string;
|
|
99
|
+
}
|
|
100
|
+
interface ThemeColors {
|
|
101
|
+
primary?: string;
|
|
102
|
+
secondary?: string;
|
|
103
|
+
background?: string;
|
|
104
|
+
foreground?: string;
|
|
105
|
+
border?: string;
|
|
106
|
+
muted?: string;
|
|
107
|
+
accent?: string;
|
|
108
|
+
}
|
|
109
|
+
interface CalendarTheme {
|
|
110
|
+
colors?: ThemeColors;
|
|
111
|
+
fontFamily?: string;
|
|
112
|
+
borderRadius?: string;
|
|
113
|
+
}
|
|
114
|
+
/** Full set of translation strings used across all components. */
|
|
115
|
+
interface CalendarTranslations {
|
|
116
|
+
today: string;
|
|
117
|
+
month: string;
|
|
118
|
+
week: string;
|
|
119
|
+
day: string;
|
|
120
|
+
agenda: string;
|
|
121
|
+
resource: string;
|
|
122
|
+
create: string;
|
|
123
|
+
createEvent: string;
|
|
124
|
+
editEvent: string;
|
|
125
|
+
newEvent: string;
|
|
126
|
+
saveChanges: string;
|
|
127
|
+
delete: string;
|
|
128
|
+
save: string;
|
|
129
|
+
cancel: string;
|
|
130
|
+
edit: string;
|
|
131
|
+
duplicate: string;
|
|
132
|
+
close: string;
|
|
133
|
+
moreOptions: string;
|
|
134
|
+
addAttachment: string;
|
|
135
|
+
addReminder: string;
|
|
136
|
+
title: string;
|
|
137
|
+
addTitle: string;
|
|
138
|
+
start: string;
|
|
139
|
+
end: string;
|
|
140
|
+
allDay: string;
|
|
141
|
+
description: string;
|
|
142
|
+
descriptionAndAttachments: string;
|
|
143
|
+
addDescription: string;
|
|
144
|
+
location: string;
|
|
145
|
+
addLocation: string;
|
|
146
|
+
locationHelpText: string;
|
|
147
|
+
notes: string;
|
|
148
|
+
repeat: string;
|
|
149
|
+
noRepeat: string;
|
|
150
|
+
doesNotRepeat: string;
|
|
151
|
+
daily: string;
|
|
152
|
+
weekly: string;
|
|
153
|
+
monthly: string;
|
|
154
|
+
yearly: string;
|
|
155
|
+
repeatFor: string;
|
|
156
|
+
times: string;
|
|
157
|
+
until: string;
|
|
158
|
+
endRepeat: string;
|
|
159
|
+
never: string;
|
|
160
|
+
afterOccurrences: string;
|
|
161
|
+
onDate: string;
|
|
162
|
+
selectCalendar: string;
|
|
163
|
+
selectType: string;
|
|
164
|
+
calendar: string;
|
|
165
|
+
calendars: string;
|
|
166
|
+
event: string;
|
|
167
|
+
task: string;
|
|
168
|
+
appointmentSchedule: string;
|
|
169
|
+
new: string;
|
|
170
|
+
guests: string;
|
|
171
|
+
addGuests: string;
|
|
172
|
+
guest: string;
|
|
173
|
+
guestCount: string;
|
|
174
|
+
guestsCount: string;
|
|
175
|
+
guestAdded: string;
|
|
176
|
+
guestsAdded: string;
|
|
177
|
+
whosJoining: string;
|
|
178
|
+
suggestedTimes: string;
|
|
179
|
+
viewSuggestions: string;
|
|
180
|
+
whereWillItBe: string;
|
|
181
|
+
dateAndTime: string;
|
|
182
|
+
reminders: string;
|
|
183
|
+
dragAndDrop: string;
|
|
184
|
+
attachments: string;
|
|
185
|
+
reminderAtTime: string;
|
|
186
|
+
reminder5min: string;
|
|
187
|
+
reminder10min: string;
|
|
188
|
+
reminder15min: string;
|
|
189
|
+
reminder30min: string;
|
|
190
|
+
reminder1hour: string;
|
|
191
|
+
reminder2hours: string;
|
|
192
|
+
reminder1day: string;
|
|
193
|
+
reminder2days: string;
|
|
194
|
+
reminder1week: string;
|
|
195
|
+
tomorrow: string;
|
|
196
|
+
eventCount: string;
|
|
197
|
+
eventsCount: string;
|
|
198
|
+
timezone: string;
|
|
199
|
+
localTime: string;
|
|
200
|
+
search: string;
|
|
201
|
+
allTypes: string;
|
|
202
|
+
noTitle: string;
|
|
203
|
+
copy: string;
|
|
204
|
+
clickToOpenInMaps: string;
|
|
205
|
+
}
|
|
206
|
+
interface CalendarProps {
|
|
207
|
+
events?: CalendarEvent[];
|
|
208
|
+
/** Partial override translations merged on top of the selected language. */
|
|
209
|
+
translations?: Partial<CalendarTranslations>;
|
|
210
|
+
view?: ViewType;
|
|
211
|
+
onViewChange?: (view: ViewType) => void;
|
|
212
|
+
date?: Date;
|
|
213
|
+
onDateChange?: (date: Date) => void;
|
|
214
|
+
onEventClick?: (event: CalendarEvent) => void;
|
|
215
|
+
onEventDrop?: (event: CalendarEvent, start: Date, end: Date) => void;
|
|
216
|
+
onEventResize?: (event: CalendarEvent, start: Date, end: Date) => void;
|
|
217
|
+
onEventCreate?: (event: Partial<CalendarEvent>) => void;
|
|
218
|
+
onEventUpdate?: (event: CalendarEvent) => void;
|
|
219
|
+
onEventDelete?: (eventId: string) => void;
|
|
220
|
+
theme?: CalendarTheme;
|
|
221
|
+
locale?: Locale;
|
|
222
|
+
timezone?: string;
|
|
223
|
+
onTimezoneChange?: (timezone: string) => void;
|
|
224
|
+
className?: string;
|
|
225
|
+
readOnly?: boolean;
|
|
226
|
+
calendars?: {
|
|
227
|
+
id: string;
|
|
228
|
+
label: string;
|
|
229
|
+
color?: string;
|
|
230
|
+
active?: boolean;
|
|
231
|
+
}[];
|
|
232
|
+
resources?: Resource[];
|
|
233
|
+
eventTypes?: EventType[];
|
|
234
|
+
onCalendarToggle?: (calendarId: string, active: boolean) => void;
|
|
235
|
+
isLoading?: boolean;
|
|
236
|
+
isDarkMode?: boolean;
|
|
237
|
+
onThemeToggle?: () => void;
|
|
238
|
+
hideViewSwitcher?: boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Hour (0–23) the Day and Week views initially scroll to on mount.
|
|
241
|
+
* Defaults to 8 (08:00 AM).
|
|
242
|
+
*/
|
|
243
|
+
initialScrollHour?: number;
|
|
244
|
+
/**
|
|
245
|
+
* When true, the time axis is reversed: 23:00 appears at the top,
|
|
246
|
+
* 00:00 at the bottom. Defaults to false.
|
|
247
|
+
*/
|
|
248
|
+
reverseTime?: boolean;
|
|
249
|
+
/** BCP 47 language code. Defaults to 'tr' (Turkish). */
|
|
250
|
+
language?: LanguageCode;
|
|
251
|
+
onLanguageChange?: (lang: LanguageCode) => void;
|
|
252
|
+
/**
|
|
253
|
+
* Replace the default event form/modal with a fully custom component.
|
|
254
|
+
* Receives open state, the event being edited, and save/delete handlers.
|
|
255
|
+
*/
|
|
256
|
+
renderEventForm?: (props: {
|
|
257
|
+
isOpen: boolean;
|
|
258
|
+
onClose: () => void;
|
|
259
|
+
event?: CalendarEvent | null;
|
|
260
|
+
initialDate?: Date;
|
|
261
|
+
onSave: (event: Partial<CalendarEvent>) => void;
|
|
262
|
+
onDelete?: (eventId: string) => void;
|
|
263
|
+
}) => React.ReactNode;
|
|
264
|
+
/**
|
|
265
|
+
* Replace the default CalendarHeader bar with a fully custom component.
|
|
266
|
+
* All navigation state and handlers are forwarded so you have full control.
|
|
267
|
+
*/
|
|
268
|
+
renderHeader?: (props: {
|
|
269
|
+
currentDate: Date;
|
|
270
|
+
view: ViewType;
|
|
271
|
+
onPrev: () => void;
|
|
272
|
+
onNext: () => void;
|
|
273
|
+
onToday: () => void;
|
|
274
|
+
onViewChange: (view: ViewType) => void;
|
|
275
|
+
translations: CalendarTranslations;
|
|
276
|
+
language: LanguageCode;
|
|
277
|
+
onLanguageChange?: (lang: LanguageCode) => void;
|
|
278
|
+
isDarkMode?: boolean;
|
|
279
|
+
onThemeToggle?: () => void;
|
|
280
|
+
}) => React.ReactNode;
|
|
281
|
+
/**
|
|
282
|
+
* Replace the default MiniCalendar in the sidebar with a custom component.
|
|
283
|
+
* Receives the currently selected date and date/view change handlers.
|
|
284
|
+
*/
|
|
285
|
+
renderMiniCalendar?: (props: {
|
|
286
|
+
currentDate: Date;
|
|
287
|
+
onDateChange: (date: Date) => void;
|
|
288
|
+
onViewChange?: (view: ViewType) => void;
|
|
289
|
+
}) => React.ReactNode;
|
|
290
|
+
/**
|
|
291
|
+
* Replace the default empty-state shown in the Agenda view with a custom component.
|
|
292
|
+
* Receives the current view type and the create-event handler.
|
|
293
|
+
*/
|
|
294
|
+
renderEmptyState?: (props: {
|
|
295
|
+
view: ViewType;
|
|
296
|
+
onCreateEvent?: () => void;
|
|
297
|
+
}) => React.ReactNode;
|
|
298
|
+
/**
|
|
299
|
+
* Custom navigation items rendered in the sidebar.
|
|
300
|
+
* Clicking an item replaces the main calendar area with its `component`.
|
|
301
|
+
* The calendar itself is always accessible via the view switcher in the header.
|
|
302
|
+
*/
|
|
303
|
+
sidebarMenus?: SidebarMenuItem[];
|
|
304
|
+
/**
|
|
305
|
+
* Additional views that extend the built-in ones (month / week / day / agenda).
|
|
306
|
+
* Each custom view:
|
|
307
|
+
* • Gets a button in the header's view switcher (after the built-in ones)
|
|
308
|
+
* • Is also listed vertically inside the sidebar's İşlemler section
|
|
309
|
+
* • Renders its `component` in the main content area when selected
|
|
310
|
+
*/
|
|
311
|
+
customViews?: CustomView[];
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
315
|
+
|
|
316
|
+
declare const Scheduler: React.FC<CalendarProps>;
|
|
317
|
+
/** Primary export — backward-compatible alias for v1 `@calendarkit/react` consumers. */
|
|
318
|
+
declare const ProScheduler: React.FC<CalendarProps>;
|
|
319
|
+
|
|
320
|
+
export { type CalendarEvent, type CalendarProps, type CalendarTheme, type CalendarTranslations, type CustomView, type EventAttachment, type EventReminder, type EventType, LANGUAGE_META, LOCALES, type LanguageCode, ProScheduler, type CalendarProps as ProSchedulerProps, type Resource, Scheduler, type SidebarMenuItem, type ThemeColors, type ViewType, cn, getTranslations };
|