big-calendar 0.2.0 → 0.2.1
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/README.md +40 -155
- package/package.json +10 -7
package/README.md
CHANGED
|
@@ -1,185 +1,70 @@
|
|
|
1
|
-
#
|
|
1
|
+
# big-calendar
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React + Tailwind implementation of [Big Calendar](https://github.com/lramos33/big-calendar), with extended host-app control over views, events, and behavior via props and API.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Thank you & credit
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- 🎨 **Highly Customizable**: Full control over styling, API integration, and behavior
|
|
11
|
-
- 🔄 **Drag & Drop**: Reschedule events by dragging
|
|
12
|
-
- 🎯 **API Integration**: Connect to your backend or third-party calendars
|
|
13
|
-
- 🎨 **Styling Control**: CSS variables, className props, and theme customization
|
|
14
|
-
- 👤 **Single-User Mode**: Simplified UI for single-user applications
|
|
15
|
-
- 📱 **Responsive**: Works on all screen sizes
|
|
16
|
-
- 🌙 **Dark Mode**: Built-in dark mode support
|
|
9
|
+
**A big thank you to the original author** [**lramos33**](https://github.com/lramos33) for the [Big Calendar](https://github.com/lramos33/big-calendar) project this package is based on. This fork adds React + Tailwind, host-controlled behavior, and API integration while building on that work.
|
|
17
10
|
|
|
18
|
-
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Install
|
|
19
14
|
|
|
20
15
|
```bash
|
|
21
16
|
npm install big-calendar
|
|
22
17
|
```
|
|
23
18
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
```jsx
|
|
27
|
-
import { CalendarProvider, ClientContainer } from 'big-calendar';
|
|
28
|
-
import 'big-calendar/styles'; // Import styles
|
|
29
|
-
|
|
30
|
-
function App() {
|
|
31
|
-
return (
|
|
32
|
-
<CalendarProvider useMocks={true}>
|
|
33
|
-
<ClientContainer view="month" />
|
|
34
|
-
</CalendarProvider>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Basic Usage
|
|
19
|
+
**Requirements:** React 18+, Tailwind CSS in your app.
|
|
40
20
|
|
|
41
|
-
|
|
21
|
+
Add the package to Tailwind content in `tailwind.config.js`:
|
|
42
22
|
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<CalendarProvider useMocks={true}>
|
|
50
|
-
<ClientContainer view="month" />
|
|
51
|
-
</CalendarProvider>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
23
|
+
```js
|
|
24
|
+
content: [
|
|
25
|
+
"./src/**/*.{js,jsx,ts,tsx}",
|
|
26
|
+
"./node_modules/big-calendar/dist/**/*.{js,jsx}",
|
|
27
|
+
],
|
|
54
28
|
```
|
|
55
29
|
|
|
56
|
-
|
|
30
|
+
## Usage
|
|
57
31
|
|
|
58
32
|
```jsx
|
|
59
|
-
import { CalendarProvider, ClientContainer } from 'big-calendar';
|
|
33
|
+
import { CalendarProvider, CalendarRoot, ClientContainer } from 'big-calendar';
|
|
60
34
|
import 'big-calendar/styles';
|
|
61
35
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
getUsers: async () => {
|
|
68
|
-
const response = await fetch('/api/users');
|
|
69
|
-
return response.json();
|
|
70
|
-
},
|
|
71
|
-
createEvent: async (eventData) => {
|
|
72
|
-
const response = await fetch('/api/events', {
|
|
73
|
-
method: 'POST',
|
|
74
|
-
headers: { 'Content-Type': 'application/json' },
|
|
75
|
-
body: JSON.stringify(eventData),
|
|
76
|
-
});
|
|
77
|
-
return response.json();
|
|
78
|
-
},
|
|
79
|
-
updateEvent: async (eventData) => {
|
|
80
|
-
const response = await fetch(`/api/events/${eventData.id}`, {
|
|
81
|
-
method: 'PUT',
|
|
82
|
-
headers: { 'Content-Type': 'application/json' },
|
|
83
|
-
body: JSON.stringify(eventData),
|
|
84
|
-
});
|
|
85
|
-
return response.json();
|
|
86
|
-
},
|
|
87
|
-
deleteEvent: async (eventId) => {
|
|
88
|
-
await fetch(`/api/events/${eventId}`, { method: 'DELETE' });
|
|
89
|
-
},
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
function MyCalendar() {
|
|
93
|
-
return (
|
|
94
|
-
<CalendarProvider api={calendarAPI}>
|
|
95
|
-
<ClientContainer view="month" />
|
|
96
|
-
</CalendarProvider>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## Customization
|
|
102
|
-
|
|
103
|
-
### Side Panel for Event Details
|
|
104
|
-
|
|
105
|
-
```jsx
|
|
106
|
-
<CalendarProvider
|
|
107
|
-
eventClickHandler={{
|
|
108
|
-
mode: "sidePanel",
|
|
109
|
-
sidePanelPosition: "right",
|
|
110
|
-
sidePanelWidth: 400,
|
|
111
|
-
}}
|
|
112
|
-
>
|
|
113
|
-
<ClientContainer view="month" />
|
|
36
|
+
// With mock data
|
|
37
|
+
<CalendarProvider useMocks={true}>
|
|
38
|
+
<CalendarRoot>
|
|
39
|
+
<ClientContainer view="month" />
|
|
40
|
+
</CalendarRoot>
|
|
114
41
|
</CalendarProvider>
|
|
115
|
-
```
|
|
116
42
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
43
|
+
// With your API
|
|
44
|
+
const api = {
|
|
45
|
+
getEvents: async () => (await fetch('/api/events')).json(),
|
|
46
|
+
getUsers: async () => (await fetch('/api/users')).json(),
|
|
47
|
+
createEvent: async (data) => /* ... */,
|
|
48
|
+
updateEvent: async (data) => /* ... */,
|
|
49
|
+
deleteEvent: async (id) => /* ... */,
|
|
50
|
+
};
|
|
51
|
+
<CalendarProvider api={api}>
|
|
52
|
+
<CalendarRoot>
|
|
53
|
+
<ClientContainer view="month" />
|
|
54
|
+
</CalendarRoot>
|
|
129
55
|
</CalendarProvider>
|
|
130
56
|
```
|
|
131
57
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
```css
|
|
135
|
-
/* Override CSS variables */
|
|
136
|
-
:root {
|
|
137
|
-
--calendar-container-border-radius: 1rem;
|
|
138
|
-
--calendar-event-border-radius: 0.5rem;
|
|
139
|
-
--calendar-event-blue-bg: 217 91% 95%;
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
```jsx
|
|
144
|
-
<ClientContainer
|
|
145
|
-
view="month"
|
|
146
|
-
className="bigcal-my-custom-calendar"
|
|
147
|
-
headerclassName="bigcal-custom-header"
|
|
148
|
-
/>
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## Documentation
|
|
58
|
+
**Views:** `view="month" | "week" | "day" | "agenda" | "year"`
|
|
152
59
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
## Requirements
|
|
156
|
-
|
|
157
|
-
- React 18+
|
|
158
|
-
- Tailwind CSS (for styling)
|
|
159
|
-
|
|
160
|
-
## Tailwind CSS Setup
|
|
60
|
+
## Customization
|
|
161
61
|
|
|
162
|
-
|
|
62
|
+
- **Single-user:** `singleUser={true}` and `currentUser={{ id, name, picturePath }}`
|
|
63
|
+
- **Event click:** `eventClickHandler={{ mode: "sidePanel", sidePanelPosition: "right", sidePanelWidth: 400 }}`
|
|
64
|
+
- **Styling:** CSS variables (e.g. `--calendar-container-border-radius`) or `className` / `headerClassName` on `ClientContainer`
|
|
163
65
|
|
|
164
|
-
|
|
165
|
-
module.exports = {
|
|
166
|
-
content: [
|
|
167
|
-
"./src/**/*.{js,jsx,ts,tsx}",
|
|
168
|
-
"./node_modules/big-calendar/dist/**/*.{js,jsx}", // Include big-calendar
|
|
169
|
-
],
|
|
170
|
-
theme: {
|
|
171
|
-
extend: {
|
|
172
|
-
// Your theme extensions
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
plugins: [],
|
|
176
|
-
}
|
|
177
|
-
```
|
|
66
|
+
Full options: [CUSTOMIZATION.md](./CUSTOMIZATION.md).
|
|
178
67
|
|
|
179
68
|
## License
|
|
180
69
|
|
|
181
70
|
MIT
|
|
182
|
-
|
|
183
|
-
## Contributing
|
|
184
|
-
|
|
185
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
package/package.json
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "big-calendar",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "React + Tailwind implementation of Big Calendar. Fork extending the original with host-app control: control views, events, and behavior via props and API from your app.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
7
|
+
"tailwind",
|
|
7
8
|
"calendar",
|
|
8
9
|
"calendar-component",
|
|
9
10
|
"react-calendar",
|
|
10
11
|
"event-calendar",
|
|
11
12
|
"scheduler",
|
|
12
13
|
"date-picker",
|
|
13
|
-
"calendar-view"
|
|
14
|
+
"calendar-view",
|
|
15
|
+
"big-calendar",
|
|
16
|
+
"fork"
|
|
14
17
|
],
|
|
15
|
-
"author": "",
|
|
18
|
+
"author": "Noam Suissa (https://github.com/noamsuissa)",
|
|
16
19
|
"license": "MIT",
|
|
17
20
|
"repository": {
|
|
18
21
|
"type": "git",
|
|
19
|
-
"url": "https://github.com/
|
|
22
|
+
"url": "https://github.com/noamsuissa/big-calendar.git"
|
|
20
23
|
},
|
|
21
|
-
"homepage": "https://github.com/
|
|
24
|
+
"homepage": "https://github.com/noamsuissa/big-calendar#readme",
|
|
22
25
|
"bugs": {
|
|
23
|
-
"url": "https://github.com/
|
|
26
|
+
"url": "https://github.com/noamsuissa/big-calendar/issues"
|
|
24
27
|
},
|
|
25
28
|
"main": "./dist/big-calendar.cjs",
|
|
26
29
|
"module": "./dist/big-calendar.mjs",
|