@nomideusz/svelte-calendar 0.5.2 → 0.6.3

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 (49) hide show
  1. package/README.md +408 -178
  2. package/dist/adapters/memory.d.ts +7 -9
  3. package/dist/adapters/memory.js +8 -23
  4. package/dist/adapters/recurring.d.ts +8 -6
  5. package/dist/adapters/recurring.js +28 -30
  6. package/dist/calendar/Calendar.svelte +776 -356
  7. package/dist/calendar/Calendar.svelte.d.ts +57 -6
  8. package/dist/core/index.d.ts +2 -2
  9. package/dist/core/index.js +1 -1
  10. package/dist/core/locale.js +2 -2
  11. package/dist/core/palette.d.ts +5 -0
  12. package/dist/core/palette.js +8 -0
  13. package/dist/core/types.d.ts +14 -0
  14. package/dist/engine/event-store.svelte.d.ts +0 -17
  15. package/dist/engine/event-store.svelte.js +30 -17
  16. package/dist/engine/index.d.ts +1 -1
  17. package/dist/engine/view-state.svelte.d.ts +10 -5
  18. package/dist/engine/view-state.svelte.js +32 -16
  19. package/dist/index.d.ts +7 -7
  20. package/dist/index.js +3 -4
  21. package/dist/primitives/DayHeader.svelte +103 -103
  22. package/dist/primitives/EmptySlot.svelte +105 -105
  23. package/dist/primitives/EventBlock.svelte +312 -312
  24. package/dist/primitives/NowIndicator.svelte +178 -178
  25. package/dist/primitives/TimeGutter.svelte +104 -104
  26. package/dist/theme/auto.d.ts +53 -0
  27. package/dist/theme/auto.js +534 -0
  28. package/dist/theme/index.d.ts +3 -1
  29. package/dist/theme/index.js +3 -1
  30. package/dist/theme/presets.d.ts +20 -6
  31. package/dist/theme/presets.js +55 -42
  32. package/dist/views/agenda/AgendaDay.svelte +1073 -976
  33. package/dist/views/agenda/AgendaWeek.svelte +934 -775
  34. package/dist/views/agenda/index.d.ts +0 -2
  35. package/dist/views/agenda/index.js +0 -2
  36. package/dist/views/index.d.ts +3 -2
  37. package/dist/views/index.js +3 -2
  38. package/dist/views/mobile/Mobile.svelte +17 -0
  39. package/dist/views/mobile/Mobile.svelte.d.ts +7 -0
  40. package/dist/views/mobile/MobileDay.svelte +702 -0
  41. package/dist/views/mobile/MobileDay.svelte.d.ts +20 -0
  42. package/dist/views/mobile/MobileWeek.svelte +461 -0
  43. package/dist/views/mobile/MobileWeek.svelte.d.ts +20 -0
  44. package/dist/views/mobile/index.d.ts +1 -0
  45. package/dist/views/mobile/index.js +1 -0
  46. package/dist/views/planner/PlannerDay.svelte +1129 -957
  47. package/dist/views/planner/PlannerWeek.svelte +949 -840
  48. package/dist/widget/CalendarWidget.svelte +142 -157
  49. package/package.json +2 -1
@@ -5,52 +5,65 @@
5
5
  * Pass to the `theme` prop of any timeline component.
6
6
  *
7
7
  * Presets:
8
- * midnight — Dark mode with red accent
9
- * neutral — Light mode, inherits host fonts
8
+ * auto — Transparent: inherit --dt-* from the host page (recommended default)
9
+ * neutral — Explicit light theme: white bg, blue accent, works standalone
10
+ * midnight — Explicit dark theme: charcoal bg, red accent
10
11
  */
11
12
  /**
12
- * Neutral — inherits fonts from host page, uses standard grays + safe blue accent.
13
- * Drop-in preset that blends into any website without fighting its design.
14
- * This is the recommended default.
13
+ * Auto — triggers the smart auto-theme engine.
14
+ *
15
+ * When passed to Calendar's `theme` prop, the component will probe the host
16
+ * page at mount time (background, fonts, accent color, light/dark mode)
17
+ * and generate matching --dt-* CSS tokens automatically.
18
+ *
19
+ * Reactively watches for host theme changes (e.g. dark-mode toggle).
20
+ *
21
+ * If you want passive inheritance only (no probing), pass `autoTheme={false}`
22
+ * alongside `theme={auto}`.
23
+ */
24
+ export const auto = ``;
25
+ /**
26
+ * Neutral — explicit light theme. White bg, blue accent, inherits host fonts.
27
+ * Use when embedding standalone without ancestor --dt-* vars.
15
28
  */
16
- export const neutral = `
17
- --dt-stage-bg: #ffffff;
18
- --dt-bg: #ffffff;
19
- --dt-surface: #f9fafb;
20
- --dt-border: rgba(0, 0, 0, 0.08);
21
- --dt-border-day: rgba(0, 0, 0, 0.14);
22
- --dt-text: rgba(0, 0, 0, 0.87);
23
- --dt-text-2: rgba(0, 0, 0, 0.54);
24
- --dt-text-3: rgba(0, 0, 0, 0.38);
25
- --dt-accent: #2563eb;
26
- --dt-accent-dim: rgba(37, 99, 235, 0.12);
27
- --dt-glow: rgba(37, 99, 235, 0.25);
28
- --dt-today-bg: rgba(37, 99, 235, 0.04);
29
- --dt-btn-text: #fff;
30
- --dt-scrollbar: rgba(0, 0, 0, 0.1);
31
- --dt-success: rgba(22, 163, 74, 0.7);
32
- --dt-serif: inherit;
33
- --dt-sans: inherit;
34
- --dt-mono: ui-monospace, 'SFMono-Regular', monospace;
29
+ export const neutral = `
30
+ --dt-stage-bg: #ffffff;
31
+ --dt-bg: #ffffff;
32
+ --dt-surface: #f9fafb;
33
+ --dt-border: rgba(0, 0, 0, 0.08);
34
+ --dt-border-day: rgba(0, 0, 0, 0.14);
35
+ --dt-text: rgba(0, 0, 0, 0.87);
36
+ --dt-text-2: rgba(0, 0, 0, 0.54);
37
+ --dt-text-3: rgba(0, 0, 0, 0.38);
38
+ --dt-accent: #2563eb;
39
+ --dt-accent-dim: rgba(37, 99, 235, 0.12);
40
+ --dt-glow: rgba(37, 99, 235, 0.25);
41
+ --dt-today-bg: rgba(37, 99, 235, 0.04);
42
+ --dt-btn-text: #fff;
43
+ --dt-scrollbar: rgba(0, 0, 0, 0.1);
44
+ --dt-success: rgba(22, 163, 74, 0.7);
45
+ --dt-serif: inherit;
46
+ --dt-sans: inherit;
47
+ --dt-mono: ui-monospace, 'SFMono-Regular', monospace;
35
48
  `;
36
49
  /** Midnight Industrial — dark charcoal + red accent, tech monitoring */
37
- export const midnight = `
38
- --dt-stage-bg: #080a0f;
39
- --dt-bg: #0b0e14;
40
- --dt-surface: #10141c;
41
- --dt-border: rgba(148, 163, 184, 0.07);
42
- --dt-border-day: rgba(148, 163, 184, 0.14);
43
- --dt-text: rgba(226, 232, 240, 0.85);
44
- --dt-text-2: rgba(148, 163, 184, 0.55);
45
- --dt-text-3: rgba(100, 116, 139, 0.55);
46
- --dt-accent: #ef4444;
47
- --dt-accent-dim: rgba(239, 68, 68, 0.18);
48
- --dt-glow: rgba(239, 68, 68, 0.35);
49
- --dt-today-bg: rgba(239, 68, 68, 0.02);
50
- --dt-btn-text: #fff;
51
- --dt-scrollbar: rgba(148, 163, 184, 0.12);
52
- --dt-success: rgba(74, 222, 128, 0.7);
53
- --dt-serif: Georgia, 'Times New Roman', serif;
50
+ export const midnight = `
51
+ --dt-stage-bg: #080a0f;
52
+ --dt-bg: #0b0e14;
53
+ --dt-surface: #10141c;
54
+ --dt-border: rgba(148, 163, 184, 0.07);
55
+ --dt-border-day: rgba(148, 163, 184, 0.14);
56
+ --dt-text: rgba(226, 232, 240, 0.85);
57
+ --dt-text-2: rgba(148, 163, 184, 0.55);
58
+ --dt-text-3: rgba(100, 116, 139, 0.55);
59
+ --dt-accent: #ef4444;
60
+ --dt-accent-dim: rgba(239, 68, 68, 0.18);
61
+ --dt-glow: rgba(239, 68, 68, 0.35);
62
+ --dt-today-bg: rgba(239, 68, 68, 0.02);
63
+ --dt-btn-text: #fff;
64
+ --dt-scrollbar: rgba(148, 163, 184, 0.12);
65
+ --dt-success: rgba(74, 222, 128, 0.7);
66
+ --dt-serif: Georgia, 'Times New Roman', serif;
54
67
  `;
55
68
  /** All available presets keyed by name */
56
- export const presets = { midnight, neutral };
69
+ export const presets = { auto, neutral, midnight };