@gobrand/react-calendar 0.0.20 → 0.0.21

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 (2) hide show
  1. package/README.md +20 -11
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -14,17 +14,26 @@
14
14
  - **TanStack Store** - Optimized reactive state management
15
15
 
16
16
  ```tsx
17
- import { useCalendar, createCalendarViews, createCalendarAccessor } from '@gobrand/react-calendar';
18
-
19
- const calendar = useCalendar({
20
- data: events,
21
- views: createCalendarViews<Event>()({
22
- month: { accessor: createCalendarAccessor({ getDate: (e) => e.date }) },
23
- }),
24
- });
25
-
26
- const month = calendar.getMonth();
27
- // month.weeks.flat().map(day => ...)
17
+ import { useCreateCalendar, useView, CalendarProvider } from '@gobrand/react-calendar';
18
+
19
+ const accessor = { getDate: (e: Event) => e.date };
20
+
21
+ function App() {
22
+ const calendar = useCreateCalendar<Event>({
23
+ views: { month: { accessor } },
24
+ });
25
+
26
+ return (
27
+ <CalendarProvider calendar={calendar}>
28
+ <Calendar />
29
+ </CalendarProvider>
30
+ );
31
+ }
32
+
33
+ function Calendar() {
34
+ const view = useView({ data: events });
35
+ // view.data.weeks.flat().map(day => ...)
36
+ }
28
37
  ```
29
38
 
30
39
  ## Install
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobrand/react-calendar",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "description": "React hooks and components for building calendars using the Temporal API",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -34,7 +34,7 @@
34
34
  "homepage": "https://eng.gobrand.app/calendar",
35
35
  "dependencies": {
36
36
  "@js-temporal/polyfill": "^0.5.1",
37
- "@gobrand/calendar-core": "^0.0.20"
37
+ "@gobrand/calendar-core": "^0.0.21"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": "^18.0.0 || ^19.0.0"