@nomideusz/svelte-calendar 0.8.0 → 0.10.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/README.md +29 -8
- package/dist/calendar/Calendar.svelte +187 -64
- package/dist/calendar/Calendar.svelte.d.ts +14 -0
- package/dist/core/clock.svelte.d.ts +1 -1
- package/dist/core/clock.svelte.js +8 -4
- package/dist/core/locale.d.ts +15 -1
- package/dist/core/locale.js +9 -2
- package/dist/core/timezone.d.ts +12 -0
- package/dist/core/timezone.js +31 -0
- package/dist/headless/create-calendar.svelte.js +12 -6
- package/dist/headless/types.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/theme/auto.js +27 -6
- package/dist/theme/presets.d.ts +4 -4
- package/dist/theme/presets.js +11 -7
- package/dist/views/agenda/AgendaDay.svelte +260 -111
- package/dist/views/agenda/AgendaWeek.svelte +191 -66
- package/dist/views/mobile/MobileDay.svelte +409 -214
- package/dist/views/mobile/MobileWeek.svelte +137 -75
- package/dist/views/mobile/swipe.d.ts +28 -0
- package/dist/views/mobile/swipe.js +64 -0
- package/dist/views/month/MonthGrid.svelte +167 -31
- package/dist/views/planner/PlannerDay.svelte +156 -81
- package/dist/views/planner/PlannerWeek.svelte +1156 -631
- package/dist/views/planner/PlannerWeek.svelte.d.ts +2 -0
- package/dist/views/shared/context.svelte.d.ts +4 -0
- package/dist/views/shared/context.svelte.js +14 -9
- package/dist/views/shared/format.d.ts +2 -1
- package/dist/views/shared/format.js +8 -5
- package/dist/widget/CalendarWidget.svelte +33 -5
- package/dist/widget/CalendarWidget.svelte.d.ts +16 -2
- package/dist/widget/widget.d.ts +9 -0
- package/dist/widget/widget.js +59 -13
- package/package.json +1 -1
- package/widget/widget.js +3830 -2755
- package/widget/svelte-calendar.css +0 -3054
package/dist/core/timezone.js
CHANGED
|
@@ -51,3 +51,34 @@ export function formatInTimeZone(date, timezone, options = {}, locale) {
|
|
|
51
51
|
timeZone: timezone,
|
|
52
52
|
}).format(d);
|
|
53
53
|
}
|
|
54
|
+
export function wrapAdapterWithTimezone(adapter, timezone) {
|
|
55
|
+
const zoneEvent = (ev) => ({
|
|
56
|
+
...ev,
|
|
57
|
+
start: toZonedTime(ev.start, timezone),
|
|
58
|
+
end: toZonedTime(ev.end, timezone),
|
|
59
|
+
});
|
|
60
|
+
const unzonePartial = (obj) => ({
|
|
61
|
+
...obj,
|
|
62
|
+
...(obj.start instanceof Date ? { start: fromZonedTime(obj.start, timezone) } : {}),
|
|
63
|
+
...(obj.end instanceof Date ? { end: fromZonedTime(obj.end, timezone) } : {}),
|
|
64
|
+
});
|
|
65
|
+
const wrapped = {
|
|
66
|
+
async fetchEvents(range) {
|
|
67
|
+
const events = await adapter.fetchEvents({
|
|
68
|
+
start: fromZonedTime(range.start, timezone),
|
|
69
|
+
end: fromZonedTime(range.end, timezone),
|
|
70
|
+
});
|
|
71
|
+
return events.map(zoneEvent);
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
if (adapter.createEvent) {
|
|
75
|
+
wrapped.createEvent = async (event) => zoneEvent(await adapter.createEvent(unzonePartial(event)));
|
|
76
|
+
}
|
|
77
|
+
if (adapter.updateEvent) {
|
|
78
|
+
wrapped.updateEvent = async (id, patch) => zoneEvent(await adapter.updateEvent(id, unzonePartial(patch)));
|
|
79
|
+
}
|
|
80
|
+
if (adapter.deleteEvent) {
|
|
81
|
+
wrapped.deleteEvent = (id) => adapter.deleteEvent(id);
|
|
82
|
+
}
|
|
83
|
+
return wrapped;
|
|
84
|
+
}
|
|
@@ -42,15 +42,18 @@
|
|
|
42
42
|
import { untrack } from 'svelte';
|
|
43
43
|
import { createEventStore } from '../engine/event-store.svelte.js';
|
|
44
44
|
import { createViewState } from '../engine/view-state.svelte.js';
|
|
45
|
+
import { toZonedTime, fromZonedTime, wrapAdapterWithTimezone } from '../core/timezone.js';
|
|
45
46
|
import { createSelection } from '../engine/selection.svelte.js';
|
|
46
47
|
import { createDragState } from '../engine/drag.svelte.js';
|
|
47
48
|
import { createClock } from '../core/clock.svelte.js';
|
|
48
49
|
import { sod, DAY_MS, HOUR_MS, startOfWeek as sowFn, isAllDay, isMultiDay, segmentForDay, } from '../core/time.js';
|
|
49
50
|
import { monthLong, weekdayLong, weekdayShort } from '../core/locale.js';
|
|
50
51
|
export function createCalendar(options) {
|
|
51
|
-
const { adapter, mondayStart: initialMondayStart = true, initialDate, locale, visibleHours, snapInterval = 15, equalDays = false, hideDays, blockedSlots, disabledDates, days: initialDayCount = 7, readOnly = false, minDuration, maxDuration, oneventclick, oneventcreate, oneventmove, } = options;
|
|
52
|
+
const { adapter, mondayStart: initialMondayStart = true, initialDate: rawInitialDate, locale, visibleHours, snapInterval = 15, equalDays = false, hideDays, blockedSlots, disabledDates, days: initialDayCount = 7, readOnly = false, minDuration, maxDuration, oneventclick, oneventcreate, oneventmove, } = options;
|
|
52
53
|
// ── Create engine ────────────────────────────────────
|
|
53
|
-
const
|
|
54
|
+
const timezone = options.timezone;
|
|
55
|
+
const initialDate = rawInitialDate && timezone ? toZonedTime(rawInitialDate, timezone) : rawInitialDate;
|
|
56
|
+
const store = createEventStore(timezone ? wrapAdapterWithTimezone(adapter, timezone) : adapter);
|
|
54
57
|
const viewState = createViewState({
|
|
55
58
|
view: options.view ?? 'week-planner',
|
|
56
59
|
mondayStart: initialMondayStart,
|
|
@@ -60,7 +63,8 @@ export function createCalendar(options) {
|
|
|
60
63
|
});
|
|
61
64
|
const selection = createSelection();
|
|
62
65
|
const drag = createDragState();
|
|
63
|
-
const clock = createClock();
|
|
66
|
+
const clock = createClock(timezone);
|
|
67
|
+
const unzoneDate = (d) => (timezone ? fromZonedTime(d, timezone) : d);
|
|
64
68
|
// ── Computed ──────────────────────────────────────────
|
|
65
69
|
const disabledSet = $derived(new Set(disabledDates?.map((d) => sod(d.getTime())) ?? []));
|
|
66
70
|
const startHour = visibleHours?.[0] ?? 0;
|
|
@@ -281,7 +285,7 @@ export function createCalendar(options) {
|
|
|
281
285
|
await store.move(payload.eventId, start, end);
|
|
282
286
|
const ev = store.byId(payload.eventId);
|
|
283
287
|
if (ev)
|
|
284
|
-
oneventmove?.(ev, start, end);
|
|
288
|
+
oneventmove?.(ev, unzoneDate(start), unzoneDate(end));
|
|
285
289
|
}
|
|
286
290
|
catch (e) {
|
|
287
291
|
const msg = e instanceof Error ? e.message : '';
|
|
@@ -290,7 +294,7 @@ export function createCalendar(options) {
|
|
|
290
294
|
if (msg.includes('read-only')) {
|
|
291
295
|
const ev = store.byId(payload.eventId);
|
|
292
296
|
if (ev)
|
|
293
|
-
oneventmove?.(ev, start, end);
|
|
297
|
+
oneventmove?.(ev, unzoneDate(start), unzoneDate(end));
|
|
294
298
|
}
|
|
295
299
|
else if (!msg.includes('not found')) {
|
|
296
300
|
console.warn('[calendar] drag commit failed:', e);
|
|
@@ -299,7 +303,9 @@ export function createCalendar(options) {
|
|
|
299
303
|
}
|
|
300
304
|
}
|
|
301
305
|
else if (mode === 'create') {
|
|
302
|
-
oneventcreate?.(
|
|
306
|
+
oneventcreate?.(timezone
|
|
307
|
+
? { start: fromZonedTime(start, timezone), end: fromZonedTime(end, timezone) }
|
|
308
|
+
: { start, end });
|
|
303
309
|
}
|
|
304
310
|
return result;
|
|
305
311
|
}
|
package/dist/headless/types.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export interface HeadlessCalendarOptions {
|
|
|
22
22
|
mondayStart?: boolean;
|
|
23
23
|
/** Initial date to focus on (default: today) */
|
|
24
24
|
initialDate?: Date;
|
|
25
|
+
/** Render in an IANA timezone; events, "now" and day boundaries shift. */
|
|
26
|
+
timezone?: string;
|
|
25
27
|
/** BCP 47 locale tag (e.g. 'en-US', 'pl-PL') */
|
|
26
28
|
locale?: string;
|
|
27
29
|
/** Visible hour range [startHour, endHour). Default: [0, 24] */
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { createClock, startOfWeek, fmtH, fmtTime, fmtDuration, weekdayShort, wee
|
|
|
11
11
|
export type { Clock, TimelineEvent, BlockedSlot, DaySegment, CalendarLabels, EventStatus, TextMeasure, TextMeasureOptions, ContentFit, } from './core/index.js';
|
|
12
12
|
export { auto, neutral, midnight, presets } from './theme/index.js';
|
|
13
13
|
export { probeHostTheme, observeHostTheme } from './theme/index.js';
|
|
14
|
+
export { wrapAdapterWithTimezone } from './core/timezone.js';
|
|
14
15
|
export type { PresetName, AutoThemeOptions } from './theme/index.js';
|
|
15
16
|
export { createCalendar, createAgenda } from './headless/index.js';
|
|
16
17
|
export type { HeadlessCalendarOptions, HeadlessCalendar, HeadlessDay, HeadlessWeek, TodayQueue, HeaderContext, NavigationContext, AgendaOptions, HeadlessAgenda, } from './headless/index.js';
|
package/dist/index.js
CHANGED
|
@@ -14,5 +14,6 @@ export { createClock, startOfWeek, fmtH, fmtTime, fmtDuration, weekdayShort, wee
|
|
|
14
14
|
// ─── Themes ─────────────────────────────────────────────
|
|
15
15
|
export { auto, neutral, midnight, presets } from './theme/index.js';
|
|
16
16
|
export { probeHostTheme, observeHostTheme } from './theme/index.js';
|
|
17
|
+
export { wrapAdapterWithTimezone } from './core/timezone.js';
|
|
17
18
|
// ─── Headless API ───────────────────────────────────────
|
|
18
19
|
export { createCalendar, createAgenda } from './headless/index.js';
|
package/dist/theme/auto.js
CHANGED
|
@@ -99,6 +99,23 @@ function mix(c1, c2, t) {
|
|
|
99
99
|
Math.round(c1[2] + (c2[2] - c1[2]) * t),
|
|
100
100
|
];
|
|
101
101
|
}
|
|
102
|
+
// ── Shadow-aware DOM walking ────────────────────────────
|
|
103
|
+
/**
|
|
104
|
+
* Parent element that hops shadow boundaries. When a node is a direct child
|
|
105
|
+
* of a ShadowRoot, `parentElement` is null — continue the walk from the
|
|
106
|
+
* shadow host so probes can still see the host page (the embeddable widget
|
|
107
|
+
* mounts the calendar inside a shadow root).
|
|
108
|
+
*/
|
|
109
|
+
function parentAcrossShadow(node) {
|
|
110
|
+
if (node.parentElement)
|
|
111
|
+
return node.parentElement;
|
|
112
|
+
const root = node.getRootNode();
|
|
113
|
+
return typeof ShadowRoot !== 'undefined' &&
|
|
114
|
+
root instanceof ShadowRoot &&
|
|
115
|
+
root.host instanceof HTMLElement
|
|
116
|
+
? root.host
|
|
117
|
+
: null;
|
|
118
|
+
}
|
|
102
119
|
// ── Text color detection ────────────────────────────────
|
|
103
120
|
/**
|
|
104
121
|
* Common CSS variable names for text / foreground color used by popular frameworks.
|
|
@@ -164,7 +181,7 @@ function probeTextColor(el, bg) {
|
|
|
164
181
|
break;
|
|
165
182
|
}
|
|
166
183
|
}
|
|
167
|
-
node = node
|
|
184
|
+
node = parentAcrossShadow(node);
|
|
168
185
|
}
|
|
169
186
|
// 3. Walk up the DOM reading *computed* color
|
|
170
187
|
node = el;
|
|
@@ -178,7 +195,7 @@ function probeTextColor(el, bg) {
|
|
|
178
195
|
}
|
|
179
196
|
}
|
|
180
197
|
catch { /* ignore */ }
|
|
181
|
-
node = node
|
|
198
|
+
node = parentAcrossShadow(node);
|
|
182
199
|
}
|
|
183
200
|
// Pick the first candidate with adequate contrast against the background.
|
|
184
201
|
// WCAG AA large-text minimum is 3:1.
|
|
@@ -367,7 +384,7 @@ function probeBackground(el) {
|
|
|
367
384
|
if (rgb)
|
|
368
385
|
return result(rgb);
|
|
369
386
|
}
|
|
370
|
-
node = node
|
|
387
|
+
node = parentAcrossShadow(node);
|
|
371
388
|
}
|
|
372
389
|
// 3. Fall back to computed backgroundColor (may be mid-transition, but
|
|
373
390
|
// still correct when no transition is active).
|
|
@@ -382,7 +399,7 @@ function probeBackground(el) {
|
|
|
382
399
|
catch {
|
|
383
400
|
// getComputedStyle may fail in test environments
|
|
384
401
|
}
|
|
385
|
-
node = node
|
|
402
|
+
node = parentAcrossShadow(node);
|
|
386
403
|
}
|
|
387
404
|
// 4. Ultimate fallback: check color-scheme preference
|
|
388
405
|
if (typeof window !== 'undefined' && typeof window.matchMedia === 'function' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
@@ -400,7 +417,9 @@ function probeBackground(el) {
|
|
|
400
417
|
export function probeHostTheme(el, options = {}) {
|
|
401
418
|
// Start probing from the parent — `el` itself is the calendar root, which
|
|
402
419
|
// has its own --dt-bg fallback in CSS. We need the *host page's* context.
|
|
403
|
-
|
|
420
|
+
// (Shadow-aware: inside a shadow root the parent hop lands on the shadow
|
|
421
|
+
// host, i.e. the <day-calendar> element in the light DOM.)
|
|
422
|
+
const host = parentAcrossShadow(el) ?? el;
|
|
404
423
|
const htmlRoot = (host.closest('body') ?? host) instanceof HTMLElement
|
|
405
424
|
? (host.closest('body') ?? host)
|
|
406
425
|
: document.body;
|
|
@@ -445,7 +464,7 @@ export function probeHostTheme(el, options = {}) {
|
|
|
445
464
|
// ── Accent derivatives ──
|
|
446
465
|
const accentDim = isDark ? 0.15 : 0.12;
|
|
447
466
|
const glow = isDark ? 0.30 : 0.25;
|
|
448
|
-
const todayBg = isDark ? 0.
|
|
467
|
+
const todayBg = isDark ? 0.07 : 0.07;
|
|
449
468
|
// Ensure accent is readable on the background — adjust lightness if needed
|
|
450
469
|
const accentL = isDark
|
|
451
470
|
? Math.max(aL, 0.45) // bright enough on dark
|
|
@@ -475,6 +494,8 @@ export function probeHostTheme(el, options = {}) {
|
|
|
475
494
|
`--dt-btn-text: ${btnText}`,
|
|
476
495
|
`--dt-scrollbar: ${rgba(...borderRgb, scrollAlpha)}`,
|
|
477
496
|
`--dt-success: ${rgba(...successRgb, 0.7)}`,
|
|
497
|
+
`--dt-weekend-bg: ${rgba(...borderRgb, isDark ? 0.03 : 0.02)}`,
|
|
498
|
+
`--dt-hover: ${rgba(...borderRgb, isDark ? 0.06 : 0.04)}`,
|
|
478
499
|
`--dt-sans: ${fonts.sans}`,
|
|
479
500
|
`--dt-mono: ${fonts.mono}`,
|
|
480
501
|
];
|
package/dist/theme/presets.d.ts
CHANGED
|
@@ -26,13 +26,13 @@ export declare const auto = "";
|
|
|
26
26
|
* Neutral — explicit light theme. White bg, blue accent, inherits host fonts.
|
|
27
27
|
* Use when embedding standalone without ancestor --dt-* vars.
|
|
28
28
|
*/
|
|
29
|
-
export declare const neutral = "\n\t--dt-stage-bg: #ffffff;\n\t--dt-bg: #ffffff;\n\t--dt-surface: #f9fafb;\n\t--dt-border: rgba(0, 0, 0, 0.08);\n\t--dt-border-day: rgba(0, 0, 0, 0.14);\n\t--dt-text: rgba(0, 0, 0, 0.87);\n\t--dt-text-2: rgba(0, 0, 0, 0.54);\n\t--dt-text-3: rgba(0, 0, 0, 0.38);\n\t--dt-accent: #2563eb;\n\t--dt-accent-dim:
|
|
29
|
+
export declare const neutral = "\n\t--dt-stage-bg: #ffffff;\n\t--dt-bg: #ffffff;\n\t--dt-surface: #f9fafb;\n\t--dt-border: rgba(0, 0, 0, 0.08);\n\t--dt-border-day: rgba(0, 0, 0, 0.14);\n\t--dt-text: rgba(0, 0, 0, 0.87);\n\t--dt-text-2: rgba(0, 0, 0, 0.54);\n\t--dt-text-3: rgba(0, 0, 0, 0.38);\n\t--dt-accent: var(--asini-accent, #2563eb);\n\t--dt-accent-dim: color-mix(in srgb, var(--dt-accent) 12%, transparent);\n\t--dt-glow: color-mix(in srgb, var(--dt-accent) 25%, transparent);\n\t--dt-today-bg: color-mix(in srgb, var(--dt-accent) 7%, transparent);\n\t--dt-btn-text: #fff;\n\t--dt-scrollbar: rgba(0, 0, 0, 0.1);\n\t--dt-success: rgba(22, 163, 74, 0.7);\n\t--dt-weekend-bg: rgba(0, 0, 0, 0.02);\n\t--dt-hover: rgba(0, 0, 0, 0.04);\n\t--dt-sans: inherit;\n\t--dt-mono: ui-monospace, 'SFMono-Regular', monospace;\n";
|
|
30
30
|
/** Midnight Industrial — dark charcoal + red accent, tech monitoring */
|
|
31
|
-
export declare const midnight = "\n\t--dt-stage-bg: #080a0f;\n\t--dt-bg: #0b0e14;\n\t--dt-surface: #10141c;\n\t--dt-border: rgba(148, 163, 184, 0.07);\n\t--dt-border-day: rgba(148, 163, 184, 0.14);\n\t--dt-text: rgba(226, 232, 240, 0.85);\n\t--dt-text-2: rgba(148, 163, 184, 0.55);\n\t--dt-text-3: rgba(100, 116, 139, 0.55);\n\t--dt-accent: #ef4444;\n\t--dt-accent-dim: rgba(239, 68, 68, 0.18);\n\t--dt-glow: rgba(239, 68, 68, 0.35);\n\t--dt-today-bg: rgba(239, 68, 68, 0.
|
|
31
|
+
export declare const midnight = "\n\t--dt-stage-bg: #080a0f;\n\t--dt-bg: #0b0e14;\n\t--dt-surface: #10141c;\n\t--dt-border: rgba(148, 163, 184, 0.07);\n\t--dt-border-day: rgba(148, 163, 184, 0.14);\n\t--dt-text: rgba(226, 232, 240, 0.85);\n\t--dt-text-2: rgba(148, 163, 184, 0.55);\n\t--dt-text-3: rgba(100, 116, 139, 0.55);\n\t--dt-accent: #ef4444;\n\t--dt-accent-dim: rgba(239, 68, 68, 0.18);\n\t--dt-glow: rgba(239, 68, 68, 0.35);\n\t--dt-today-bg: rgba(239, 68, 68, 0.07);\n\t--dt-btn-text: #fff;\n\t--dt-scrollbar: rgba(148, 163, 184, 0.12);\n\t--dt-success: rgba(74, 222, 128, 0.7);\n\t--dt-weekend-bg: rgba(148, 163, 184, 0.03);\n\t--dt-hover: rgba(148, 163, 184, 0.06);\n\t--dt-sans: inherit;\n\t--dt-mono: ui-monospace, 'SFMono-Regular', monospace;\n";
|
|
32
32
|
/** All available presets keyed by name */
|
|
33
33
|
export declare const presets: {
|
|
34
34
|
readonly auto: "";
|
|
35
|
-
readonly neutral: "\n\t--dt-stage-bg: #ffffff;\n\t--dt-bg: #ffffff;\n\t--dt-surface: #f9fafb;\n\t--dt-border: rgba(0, 0, 0, 0.08);\n\t--dt-border-day: rgba(0, 0, 0, 0.14);\n\t--dt-text: rgba(0, 0, 0, 0.87);\n\t--dt-text-2: rgba(0, 0, 0, 0.54);\n\t--dt-text-3: rgba(0, 0, 0, 0.38);\n\t--dt-accent: #2563eb;\n\t--dt-accent-dim:
|
|
36
|
-
readonly midnight: "\n\t--dt-stage-bg: #080a0f;\n\t--dt-bg: #0b0e14;\n\t--dt-surface: #10141c;\n\t--dt-border: rgba(148, 163, 184, 0.07);\n\t--dt-border-day: rgba(148, 163, 184, 0.14);\n\t--dt-text: rgba(226, 232, 240, 0.85);\n\t--dt-text-2: rgba(148, 163, 184, 0.55);\n\t--dt-text-3: rgba(100, 116, 139, 0.55);\n\t--dt-accent: #ef4444;\n\t--dt-accent-dim: rgba(239, 68, 68, 0.18);\n\t--dt-glow: rgba(239, 68, 68, 0.35);\n\t--dt-today-bg: rgba(239, 68, 68, 0.
|
|
35
|
+
readonly neutral: "\n\t--dt-stage-bg: #ffffff;\n\t--dt-bg: #ffffff;\n\t--dt-surface: #f9fafb;\n\t--dt-border: rgba(0, 0, 0, 0.08);\n\t--dt-border-day: rgba(0, 0, 0, 0.14);\n\t--dt-text: rgba(0, 0, 0, 0.87);\n\t--dt-text-2: rgba(0, 0, 0, 0.54);\n\t--dt-text-3: rgba(0, 0, 0, 0.38);\n\t--dt-accent: var(--asini-accent, #2563eb);\n\t--dt-accent-dim: color-mix(in srgb, var(--dt-accent) 12%, transparent);\n\t--dt-glow: color-mix(in srgb, var(--dt-accent) 25%, transparent);\n\t--dt-today-bg: color-mix(in srgb, var(--dt-accent) 7%, transparent);\n\t--dt-btn-text: #fff;\n\t--dt-scrollbar: rgba(0, 0, 0, 0.1);\n\t--dt-success: rgba(22, 163, 74, 0.7);\n\t--dt-weekend-bg: rgba(0, 0, 0, 0.02);\n\t--dt-hover: rgba(0, 0, 0, 0.04);\n\t--dt-sans: inherit;\n\t--dt-mono: ui-monospace, 'SFMono-Regular', monospace;\n";
|
|
36
|
+
readonly midnight: "\n\t--dt-stage-bg: #080a0f;\n\t--dt-bg: #0b0e14;\n\t--dt-surface: #10141c;\n\t--dt-border: rgba(148, 163, 184, 0.07);\n\t--dt-border-day: rgba(148, 163, 184, 0.14);\n\t--dt-text: rgba(226, 232, 240, 0.85);\n\t--dt-text-2: rgba(148, 163, 184, 0.55);\n\t--dt-text-3: rgba(100, 116, 139, 0.55);\n\t--dt-accent: #ef4444;\n\t--dt-accent-dim: rgba(239, 68, 68, 0.18);\n\t--dt-glow: rgba(239, 68, 68, 0.35);\n\t--dt-today-bg: rgba(239, 68, 68, 0.07);\n\t--dt-btn-text: #fff;\n\t--dt-scrollbar: rgba(148, 163, 184, 0.12);\n\t--dt-success: rgba(74, 222, 128, 0.7);\n\t--dt-weekend-bg: rgba(148, 163, 184, 0.03);\n\t--dt-hover: rgba(148, 163, 184, 0.06);\n\t--dt-sans: inherit;\n\t--dt-mono: ui-monospace, 'SFMono-Regular', monospace;\n";
|
|
37
37
|
};
|
|
38
38
|
export type PresetName = keyof typeof presets;
|
package/dist/theme/presets.js
CHANGED
|
@@ -35,14 +35,15 @@ export const neutral = `
|
|
|
35
35
|
--dt-text: rgba(0, 0, 0, 0.87);
|
|
36
36
|
--dt-text-2: rgba(0, 0, 0, 0.54);
|
|
37
37
|
--dt-text-3: rgba(0, 0, 0, 0.38);
|
|
38
|
-
--dt-accent: #2563eb;
|
|
39
|
-
--dt-accent-dim:
|
|
40
|
-
--dt-glow:
|
|
41
|
-
--dt-today-bg:
|
|
38
|
+
--dt-accent: var(--asini-accent, #2563eb);
|
|
39
|
+
--dt-accent-dim: color-mix(in srgb, var(--dt-accent) 12%, transparent);
|
|
40
|
+
--dt-glow: color-mix(in srgb, var(--dt-accent) 25%, transparent);
|
|
41
|
+
--dt-today-bg: color-mix(in srgb, var(--dt-accent) 7%, transparent);
|
|
42
42
|
--dt-btn-text: #fff;
|
|
43
43
|
--dt-scrollbar: rgba(0, 0, 0, 0.1);
|
|
44
44
|
--dt-success: rgba(22, 163, 74, 0.7);
|
|
45
|
-
--dt-
|
|
45
|
+
--dt-weekend-bg: rgba(0, 0, 0, 0.02);
|
|
46
|
+
--dt-hover: rgba(0, 0, 0, 0.04);
|
|
46
47
|
--dt-sans: inherit;
|
|
47
48
|
--dt-mono: ui-monospace, 'SFMono-Regular', monospace;
|
|
48
49
|
`;
|
|
@@ -59,11 +60,14 @@ export const midnight = `
|
|
|
59
60
|
--dt-accent: #ef4444;
|
|
60
61
|
--dt-accent-dim: rgba(239, 68, 68, 0.18);
|
|
61
62
|
--dt-glow: rgba(239, 68, 68, 0.35);
|
|
62
|
-
--dt-today-bg: rgba(239, 68, 68, 0.
|
|
63
|
+
--dt-today-bg: rgba(239, 68, 68, 0.07);
|
|
63
64
|
--dt-btn-text: #fff;
|
|
64
65
|
--dt-scrollbar: rgba(148, 163, 184, 0.12);
|
|
65
66
|
--dt-success: rgba(74, 222, 128, 0.7);
|
|
66
|
-
--dt-
|
|
67
|
+
--dt-weekend-bg: rgba(148, 163, 184, 0.03);
|
|
68
|
+
--dt-hover: rgba(148, 163, 184, 0.06);
|
|
69
|
+
--dt-sans: inherit;
|
|
70
|
+
--dt-mono: ui-monospace, 'SFMono-Regular', monospace;
|
|
67
71
|
`;
|
|
68
72
|
/** All available presets keyed by name */
|
|
69
73
|
export const presets = { auto, neutral, midnight };
|