@gobrand/react-calendar 0.0.20 → 0.0.22

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 +22 -12
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
- # @gobrand/react-calendar
1
+ # React Calendar
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@gobrand/react-calendar.svg)](https://www.npmjs.com/package/@gobrand/react-calendar)
4
+ [![CI](https://github.com/go-brand/calendar/actions/workflows/ci.yml/badge.svg)](https://github.com/go-brand/calendar/actions/workflows/ci.yml)
4
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
6
 
6
7
  **React hooks for building calendars with the Temporal API.** Type-safe views, timezone-aware, optimized state management.
@@ -14,17 +15,26 @@
14
15
  - **TanStack Store** - Optimized reactive state management
15
16
 
16
17
  ```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 => ...)
18
+ import { useCreateCalendar, useView, CalendarProvider } from '@gobrand/react-calendar';
19
+
20
+ const accessor = { getDate: (e: Event) => e.date };
21
+
22
+ function App() {
23
+ const calendar = useCreateCalendar<Event>({
24
+ views: { month: { accessor } },
25
+ });
26
+
27
+ return (
28
+ <CalendarProvider calendar={calendar}>
29
+ <Calendar />
30
+ </CalendarProvider>
31
+ );
32
+ }
33
+
34
+ function Calendar() {
35
+ const view = useView({ data: events });
36
+ // view.data.weeks.flat().map(day => ...)
37
+ }
28
38
  ```
29
39
 
30
40
  ## 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.22",
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.22"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": "^18.0.0 || ^19.0.0"