@reservi/calendar 1.4.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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Reservi
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,58 @@
1
+ # @reservi/calendar
2
+
3
+ Build **autocontenido** de Reservi Calendar para React.
4
+
5
+ ## Por qué existe
6
+
7
+ `@reservi/react` declara sus dependencias internas con el protocolo `workspace:*`
8
+ (solo lo entiende pnpm) y `@reservi/preact` pide `preact` y `@preact/signals`
9
+ como peer dependencies. Eso funciona dentro de este monorepo, pero rompe cuando
10
+ una app externa —por ejemplo una app Next.js con npm— quiere consumir la
11
+ librería desde la carpeta hermana.
12
+
13
+ Este paquete resuelve eso: empaqueta **núcleo + capa de UI + Preact + los
14
+ adaptadores de fechas/HTTP** en un único artefacto y deja fuera solo `react` y
15
+ `react-dom` (los aporta la app). Además publica el CSS ya aplanado, sin
16
+ `@import` y sin necesitar Tailwind.
17
+
18
+ | Paquete | Para |
19
+ | ------------------- | ------------------------------------------------ |
20
+ | `@reservi/react` | apps dentro de este workspace pnpm |
21
+ | `@reservi/calendar` | apps externas (npm/yarn), o consumo por ruta |
22
+
23
+ La superficie pública es **idéntica**: `export * from "@reservi/react"`.
24
+
25
+ ## Uso
26
+
27
+ ```bash
28
+ npm i "file:../reservi-calendar/packages/bundle"
29
+ ```
30
+
31
+ ```tsx
32
+ import { ReserviCalendar, dayGridPlugin, timeGridPlugin } from "@reservi/calendar";
33
+ import "@reservi/calendar/styles.css"; // design tokens (:root) + componentes
34
+ import "@reservi/calendar/themes.css"; // opcional: themes pre-hechos
35
+
36
+ <ReserviCalendar
37
+ plugins={[dayGridPlugin, timeGridPlugin]}
38
+ initialView="timeGridWeek"
39
+ events={events}
40
+ eventClick={(arg) => console.log(arg.event.id)}
41
+ eventContent={(arg) => <MiEvento {...arg} />}
42
+ />;
43
+ ```
44
+
45
+ ## Build
46
+
47
+ ```bash
48
+ pnpm turbo run build --filter=@reservi/calendar...
49
+ ```
50
+
51
+ Genera:
52
+
53
+ - `dist/index.js` / `dist/index.cjs` — bundle con todo inlineado
54
+ - `dist/index.d.ts` — tipos (roll-up de los tres paquetes)
55
+ - `dist/styles.css` — `packages/theme` aplanado (variante `plain`, tokens en `:root`)
56
+ - `dist/themes.css` — los 15 themes pre-hechos
57
+
58
+ `dist/` es artefacto de build: se regenera y no se edita a mano.