@usecalendar/core 0.0.0-stage → 0.2.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 ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2026, Sebastian Urdanegui Bisalaya
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,40 @@
1
- # Temporary Holding Version
1
+ # @usecalendar/core
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The framework-agnostic core of [usecalendar](https://github.com/SebastianUrdaneguiBisalaya/usecalendar#readme), a Google Calendar-style calendar UI. It holds types, constants and pure functions only: no framework, no DOM and no runtime dependencies.
4
+
5
+ Most apps don't install it directly: [`@usecalendar/react`](https://github.com/SebastianUrdaneguiBisalaya/usecalendar/tree/main/packages/react) depends on it and re-exports what components need. Use it to build an adapter for another framework, or to reuse the calendar math in your own code.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @usecalendar/core
11
+ ```
12
+
13
+ Dates use the global `Temporal` API. Where it isn't native, import `"temporal-polyfill/global"` once. The package never bundles a polyfill.
14
+
15
+ ## What's inside
16
+
17
+ | Area | Exports |
18
+ |---|---|
19
+ | Events and ranges | `CalendarEvent<TData>`, `EventStatus`, `DateRange`, `TimeRange`, `overlapsRange` |
20
+ | Views and navigation | `CalendarView`, `CALENDAR_VIEWS`, `visibleDays`, `visibleRange`, `visibleDayRange`, `shiftDate`, `startOfWeek`, `isWeekend`, `daysToUtcRange` |
21
+ | Month layout | `monthWeeks`, `weekNumber`, `layoutWeek`, `fitWeek`, `itemDays`, `belongsInAllDayLane` |
22
+ | Day layout and editing | `layoutDay`, `MINUTES_PER_DAY`, `moveRange`, `resizeRange`, `sweepRange`, `rangeAt`, `wallTime`, `SNAP_MINUTES` |
23
+ | Date strip (mini calendar) | `stripStart`, `stripDays`, `shiftStrip`, `addStripDays`, `isDayInRange`, `clampDay`, `nextStripFocus`, `STRIP_ALIGNS`, `STRIP_STEPS` |
24
+ | Keyboard focus | `nextFocus` (time grid), `nextMonthFocus`, `focusKey`, `SLOT_MINUTES` |
25
+ | Shortcuts | `CALENDAR_KEYMAP`, `resolveKeymap`, `hotkeyActionFor`, `matchesHotkey`, `parseHotkey`, `describeHotkey`, `ariaKeyShortcut`, action lists |
26
+ | Options | `WeekStart`, `TimeFormat`, `isWeekStart`, `isTimeFormat` |
27
+
28
+ ```ts
29
+ import { stripDays, stripStart, visibleRange } from "@usecalendar/core";
30
+
31
+ const day = Temporal.PlainDate.from("2026-11-19");
32
+ visibleRange(day, "week", "monday", "America/Lima"); // { start: "2026-11-16T05:00:00.000Z", end: "2026-11-23T05:00:00.000Z" }
33
+ stripDays(stripStart(day, 5, { align: "center" }), 5); // 2026-11-17 … 2026-11-21
34
+ ```
35
+
36
+ Every export has TSDoc with examples, so your editor shows the details on hover.
37
+
38
+ ## License
39
+
40
+ ISC