@nomideusz/svelte-calendar 0.6.0 → 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.
- package/dist/adapters/recurring.d.ts +7 -0
- package/dist/adapters/recurring.js +4 -3
- package/dist/calendar/Calendar.svelte +776 -767
- package/dist/calendar/Calendar.svelte.d.ts +2 -2
- package/dist/primitives/DayHeader.svelte +103 -103
- package/dist/primitives/EmptySlot.svelte +105 -105
- package/dist/primitives/EventBlock.svelte +312 -312
- package/dist/primitives/NowIndicator.svelte +178 -178
- package/dist/primitives/TimeGutter.svelte +104 -104
- package/dist/theme/presets.js +36 -36
- package/dist/views/agenda/AgendaDay.svelte +1073 -1055
- package/dist/views/agenda/AgendaWeek.svelte +934 -924
- package/dist/views/mobile/Mobile.svelte +17 -17
- package/dist/views/mobile/MobileDay.svelte +702 -665
- package/dist/views/mobile/MobileWeek.svelte +461 -456
- package/dist/views/planner/PlannerDay.svelte +1129 -1091
- package/dist/views/planner/PlannerWeek.svelte +949 -945
- package/dist/widget/CalendarWidget.svelte +142 -142
- package/package.json +1 -1
|
@@ -1,924 +1,934 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* AgendaWeek — rolling N-day agenda view.
|
|
4
|
-
*
|
|
5
|
-
* "The Week Ahead":
|
|
6
|
-
* Today + tomorrow expanded with time slots/countdowns.
|
|
7
|
-
* Future days compact (dot + time + title).
|
|
8
|
-
* Past days dimmed.
|
|
9
|
-
*
|
|
10
|
-
* Answers: "What's coming up and when do I need to be ready?"
|
|
11
|
-
*/
|
|
12
|
-
import { getContext, type Snippet } from 'svelte';
|
|
13
|
-
import { createClock } from '../../core/clock.svelte.js';
|
|
14
|
-
import type { TimelineEvent } from '../../core/types.js';
|
|
15
|
-
import { sod, DAY_MS, startOfWeek, dayNum, isAllDay, isMultiDay } from '../../core/time.js';
|
|
16
|
-
import { weekdayLong, monthLong, fmtTime as _fmtTime, fmtDuration, getLabels } from '../../core/locale.js';
|
|
17
|
-
import type { ViewState } from '../../engine/view-state.svelte.js';
|
|
18
|
-
|
|
19
|
-
const L = $derived(getLabels());
|
|
20
|
-
|
|
21
|
-
interface Props {
|
|
22
|
-
mondayStart?: boolean;
|
|
23
|
-
locale?: string;
|
|
24
|
-
height?: number;
|
|
25
|
-
events?: TimelineEvent[];
|
|
26
|
-
style?: string;
|
|
27
|
-
focusDate?: Date;
|
|
28
|
-
oneventclick?: (event: TimelineEvent) => void;
|
|
29
|
-
selectedEventId?: string | null;
|
|
30
|
-
[key: string]: unknown;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
let {
|
|
34
|
-
mondayStart = true,
|
|
35
|
-
locale,
|
|
36
|
-
height = 520,
|
|
37
|
-
events = [],
|
|
38
|
-
style = '',
|
|
39
|
-
focusDate,
|
|
40
|
-
oneventclick,
|
|
41
|
-
selectedEventId = null,
|
|
42
|
-
}: Props = $props();
|
|
43
|
-
|
|
44
|
-
const clock = createClock();
|
|
45
|
-
const viewState = getContext<ViewState>('calendar:viewState') as ViewState | undefined;
|
|
46
|
-
const showNavCtx = getContext<{ current: boolean }>('calendar:showNavigation') as { current: boolean } | undefined;
|
|
47
|
-
const equalDaysCtx = getContext<{ current: boolean }>('calendar:equalDays') as { current: boolean } | undefined;
|
|
48
|
-
const showDatesCtx = getContext<{ current: boolean }>('calendar:showDates') as { current: boolean } | undefined;
|
|
49
|
-
const hideDaysCtx = getContext<{ current: number[] | undefined }>('calendar:hideDays') as { current: number[] | undefined } | undefined;
|
|
50
|
-
const mobileCtx = getContext<{ current: boolean }>('calendar:mobile') as { current: boolean } | undefined;
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
if (
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
return `in ${
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
tier = '
|
|
219
|
-
} else if (ms ===
|
|
220
|
-
tier = '
|
|
221
|
-
} else if (ms
|
|
222
|
-
tier = '
|
|
223
|
-
} else {
|
|
224
|
-
tier = '
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
{
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
{
|
|
277
|
-
{
|
|
278
|
-
{
|
|
279
|
-
|
|
280
|
-
{
|
|
281
|
-
|
|
282
|
-
{
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
{
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
class
|
|
332
|
-
class:ag-wday--
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
{
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
<
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
<div class="ag-wday-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
{/
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
{
|
|
436
|
-
{#if ev.
|
|
437
|
-
{
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
{/
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
{L.
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
</
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
border:
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
}
|
|
518
|
-
.ag-nav-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
max-width
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
.ag-card
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
font-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
font-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
}
|
|
676
|
-
.ag-card-
|
|
677
|
-
font:
|
|
678
|
-
color: var(--
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
background: color
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
}
|
|
742
|
-
.ag-wday-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
}
|
|
757
|
-
.ag-wday-badge
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
);
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
.ag-wday-
|
|
776
|
-
|
|
777
|
-
font-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
}
|
|
812
|
-
.ag-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
.ag-compact
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
}
|
|
867
|
-
.ag-compact-
|
|
868
|
-
font-size:
|
|
869
|
-
font-
|
|
870
|
-
color: var(--dt-text-
|
|
871
|
-
flex
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
font:
|
|
880
|
-
color: var(--
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
}
|
|
897
|
-
.ag
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* AgendaWeek — rolling N-day agenda view.
|
|
4
|
+
*
|
|
5
|
+
* "The Week Ahead":
|
|
6
|
+
* Today + tomorrow expanded with time slots/countdowns.
|
|
7
|
+
* Future days compact (dot + time + title).
|
|
8
|
+
* Past days dimmed.
|
|
9
|
+
*
|
|
10
|
+
* Answers: "What's coming up and when do I need to be ready?"
|
|
11
|
+
*/
|
|
12
|
+
import { getContext, type Snippet } from 'svelte';
|
|
13
|
+
import { createClock } from '../../core/clock.svelte.js';
|
|
14
|
+
import type { TimelineEvent } from '../../core/types.js';
|
|
15
|
+
import { sod, DAY_MS, startOfWeek, dayNum, isAllDay, isMultiDay } from '../../core/time.js';
|
|
16
|
+
import { weekdayLong, monthLong, fmtTime as _fmtTime, fmtDuration, getLabels } from '../../core/locale.js';
|
|
17
|
+
import type { ViewState } from '../../engine/view-state.svelte.js';
|
|
18
|
+
|
|
19
|
+
const L = $derived(getLabels());
|
|
20
|
+
|
|
21
|
+
interface Props {
|
|
22
|
+
mondayStart?: boolean;
|
|
23
|
+
locale?: string;
|
|
24
|
+
height?: number;
|
|
25
|
+
events?: TimelineEvent[];
|
|
26
|
+
style?: string;
|
|
27
|
+
focusDate?: Date;
|
|
28
|
+
oneventclick?: (event: TimelineEvent) => void;
|
|
29
|
+
selectedEventId?: string | null;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let {
|
|
34
|
+
mondayStart = true,
|
|
35
|
+
locale,
|
|
36
|
+
height = 520,
|
|
37
|
+
events = [],
|
|
38
|
+
style = '',
|
|
39
|
+
focusDate,
|
|
40
|
+
oneventclick,
|
|
41
|
+
selectedEventId = null,
|
|
42
|
+
}: Props = $props();
|
|
43
|
+
|
|
44
|
+
const clock = createClock();
|
|
45
|
+
const viewState = getContext<ViewState>('calendar:viewState') as ViewState | undefined;
|
|
46
|
+
const showNavCtx = getContext<{ current: boolean }>('calendar:showNavigation') as { current: boolean } | undefined;
|
|
47
|
+
const equalDaysCtx = getContext<{ current: boolean }>('calendar:equalDays') as { current: boolean } | undefined;
|
|
48
|
+
const showDatesCtx = getContext<{ current: boolean }>('calendar:showDates') as { current: boolean } | undefined;
|
|
49
|
+
const hideDaysCtx = getContext<{ current: number[] | undefined }>('calendar:hideDays') as { current: number[] | undefined } | undefined;
|
|
50
|
+
const mobileCtx = getContext<{ current: boolean }>('calendar:mobile') as { current: boolean } | undefined;
|
|
51
|
+
const autoHeightCtx = getContext<{ current: boolean }>('calendar:autoHeight') as { current: boolean } | undefined;
|
|
52
|
+
const showNav = $derived(showNavCtx?.current ?? true);
|
|
53
|
+
const equalDays = $derived(equalDaysCtx?.current ?? false);
|
|
54
|
+
const showDates = $derived(showDatesCtx?.current ?? true);
|
|
55
|
+
const hideDays = $derived(hideDaysCtx?.current);
|
|
56
|
+
const isMobile = $derived(mobileCtx?.current ?? false);
|
|
57
|
+
const autoHeight = $derived(autoHeightCtx?.current ?? false);
|
|
58
|
+
|
|
59
|
+
// ── Swipe navigation (mobile) ──────────────────────
|
|
60
|
+
let swipeStartX = 0;
|
|
61
|
+
let swipeStartY = 0;
|
|
62
|
+
const SWIPE_THRESHOLD = 50;
|
|
63
|
+
|
|
64
|
+
function onPointerDown(e: PointerEvent) {
|
|
65
|
+
if (!isMobile) return;
|
|
66
|
+
swipeStartX = e.clientX;
|
|
67
|
+
swipeStartY = e.clientY;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function onPointerUp(e: PointerEvent) {
|
|
71
|
+
if (!isMobile) return;
|
|
72
|
+
const dx = e.clientX - swipeStartX;
|
|
73
|
+
const dy = e.clientY - swipeStartY;
|
|
74
|
+
if (Math.abs(dx) > SWIPE_THRESHOLD && Math.abs(dx) > Math.abs(dy) * 1.4) {
|
|
75
|
+
if (dx > 0) viewState?.prev();
|
|
76
|
+
else viewState?.next();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// ── New feature contexts ──
|
|
81
|
+
const dayHeaderSnippetCtx = getContext<{ current: Snippet<[{ date: Date; isToday: boolean; dayName: string }]> | undefined }>('calendar:dayHeaderSnippet') as { current: Snippet<[{ date: Date; isToday: boolean; dayName: string }]> | undefined } | undefined;
|
|
82
|
+
const callbacksCtx = getContext<{ oneventhover?: (event: TimelineEvent) => void }>('calendar:callbacks') as { oneventhover?: (event: TimelineEvent) => void } | undefined;
|
|
83
|
+
const disabledDatesCtx = getContext<{ current: Date[] | undefined }>('calendar:disabledDates') as { current: Date[] | undefined } | undefined;
|
|
84
|
+
|
|
85
|
+
const dayHeaderSnippet = $derived(dayHeaderSnippetCtx?.current);
|
|
86
|
+
const oneventhover = $derived(callbacksCtx?.oneventhover);
|
|
87
|
+
const disabledDates = $derived(disabledDatesCtx?.current);
|
|
88
|
+
const disabledSet = $derived(new Set(disabledDates?.map(d => sod(d.getTime())) ?? []));
|
|
89
|
+
|
|
90
|
+
// ── Format helpers ──────────────────────────────────
|
|
91
|
+
function fmtTime(d: Date): string {
|
|
92
|
+
return _fmtTime(d, locale);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function duration(ev: TimelineEvent): string {
|
|
96
|
+
return fmtDuration(ev.start, ev.end);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function timeUntilMs(ms: number): string {
|
|
100
|
+
const diff = ms - clock.tick;
|
|
101
|
+
if (diff <= 0) return L.now;
|
|
102
|
+
const tMins = Math.floor(diff / 60000);
|
|
103
|
+
if (tMins < 60) return `in ${tMins}m`;
|
|
104
|
+
const hrs = Math.floor(tMins / 60);
|
|
105
|
+
const rm = tMins % 60;
|
|
106
|
+
if (hrs < 24) return rm > 0 ? `in ${hrs}h ${rm}m` : `in ${hrs}h`;
|
|
107
|
+
const days = Math.floor(hrs / 24);
|
|
108
|
+
return `in ${days}d`;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function progress(ev: TimelineEvent): number {
|
|
112
|
+
const s = ev.start.getTime();
|
|
113
|
+
const e = ev.end.getTime();
|
|
114
|
+
return Math.min(1, Math.max(0, (clock.tick - s) / (e - s)));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// ── Overlap grouping ────────────────────────────────
|
|
118
|
+
interface TimeSlot {
|
|
119
|
+
startMs: number;
|
|
120
|
+
endMs: number;
|
|
121
|
+
events: TimelineEvent[];
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function groupIntoSlots(evts: TimelineEvent[]): TimeSlot[] {
|
|
125
|
+
const sorted = [...evts].sort((a, b) => a.start.getTime() - b.start.getTime());
|
|
126
|
+
const slots: TimeSlot[] = [];
|
|
127
|
+
for (const ev of sorted) {
|
|
128
|
+
const last = slots[slots.length - 1];
|
|
129
|
+
if (last && ev.start.getTime() < last.endMs) {
|
|
130
|
+
last.events.push(ev);
|
|
131
|
+
last.endMs = Math.max(last.endMs, ev.end.getTime());
|
|
132
|
+
} else {
|
|
133
|
+
slots.push({
|
|
134
|
+
startMs: ev.start.getTime(),
|
|
135
|
+
endMs: ev.end.getTime(),
|
|
136
|
+
events: [ev],
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return slots;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// ── Event handlers ──────────────────────────────────
|
|
144
|
+
function handleClick(ev: TimelineEvent): void {
|
|
145
|
+
oneventclick?.(ev);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function handleKeydown(e: KeyboardEvent, ev: TimelineEvent): void {
|
|
149
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
150
|
+
e.preventDefault();
|
|
151
|
+
oneventclick?.(ev);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// ── Week derivations ────────────────────────────────
|
|
156
|
+
type DayTier = 'today' | 'tomorrow' | 'upcoming' | 'past';
|
|
157
|
+
|
|
158
|
+
interface DayGroup {
|
|
159
|
+
ms: number;
|
|
160
|
+
dayName: string;
|
|
161
|
+
dateLabel: string;
|
|
162
|
+
tier: DayTier;
|
|
163
|
+
events: TimelineEvent[];
|
|
164
|
+
allDayEvents: TimelineEvent[];
|
|
165
|
+
timedEvents: TimelineEvent[];
|
|
166
|
+
pastEvents: TimelineEvent[];
|
|
167
|
+
currentEvents: TimelineEvent[];
|
|
168
|
+
upcomingEvents: TimelineEvent[];
|
|
169
|
+
totalHours: number;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const weekStartMs = $derived(
|
|
173
|
+
focusDate
|
|
174
|
+
? (viewState?.dayCount === 7
|
|
175
|
+
? startOfWeek(sod(focusDate.getTime()), mondayStart)
|
|
176
|
+
: sod(focusDate.getTime()))
|
|
177
|
+
: (viewState?.dayCount === 7
|
|
178
|
+
? startOfWeek(clock.today, mondayStart)
|
|
179
|
+
: clock.today),
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
const customDays = $derived(viewState?.dayCount ?? 7);
|
|
183
|
+
|
|
184
|
+
const isThisWeek = $derived(
|
|
185
|
+
customDays === 7
|
|
186
|
+
? weekStartMs === startOfWeek(clock.today, mondayStart)
|
|
187
|
+
: clock.today >= weekStartMs && clock.today < weekStartMs + customDays * DAY_MS,
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
const weekDays = $derived.by((): DayGroup[] => {
|
|
191
|
+
const now = clock.tick;
|
|
192
|
+
const todayMs = clock.today;
|
|
193
|
+
const tomorrowMs = todayMs + DAY_MS;
|
|
194
|
+
const out: DayGroup[] = [];
|
|
195
|
+
for (let i = 0; i < customDays; i++) {
|
|
196
|
+
const ms = weekStartMs + i * DAY_MS;
|
|
197
|
+
const dEnd = ms + DAY_MS;
|
|
198
|
+
const dayEvts = events
|
|
199
|
+
.filter((ev) => ev.start.getTime() < dEnd && ev.end.getTime() > ms)
|
|
200
|
+
.sort((a, b) => a.start.getTime() - b.start.getTime());
|
|
201
|
+
const allDayEvts = dayEvts.filter((ev) => isAllDay(ev) || isMultiDay(ev));
|
|
202
|
+
const timedEvts = dayEvts.filter((ev) => !isAllDay(ev) && !isMultiDay(ev));
|
|
203
|
+
const totalMinutes = timedEvts.reduce((sum, ev) => {
|
|
204
|
+
const s = Math.max(ev.start.getTime(), ms);
|
|
205
|
+
const e = Math.min(ev.end.getTime(), dEnd);
|
|
206
|
+
return sum + (e - s) / 60000;
|
|
207
|
+
}, 0);
|
|
208
|
+
const pastEvents: TimelineEvent[] = [];
|
|
209
|
+
const currentEvents: TimelineEvent[] = [];
|
|
210
|
+
const upcomingEvents: TimelineEvent[] = [];
|
|
211
|
+
for (const ev of timedEvts) {
|
|
212
|
+
if (ev.end.getTime() <= now) pastEvents.push(ev);
|
|
213
|
+
else if (ev.start.getTime() <= now && ev.end.getTime() > now) currentEvents.push(ev);
|
|
214
|
+
else upcomingEvents.push(ev);
|
|
215
|
+
}
|
|
216
|
+
let tier: DayTier;
|
|
217
|
+
if (equalDays) {
|
|
218
|
+
tier = 'upcoming';
|
|
219
|
+
} else if (ms === todayMs) {
|
|
220
|
+
tier = 'today';
|
|
221
|
+
} else if (ms === tomorrowMs) {
|
|
222
|
+
tier = 'tomorrow';
|
|
223
|
+
} else if (ms < todayMs) {
|
|
224
|
+
tier = 'past';
|
|
225
|
+
} else {
|
|
226
|
+
tier = 'upcoming';
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
out.push({
|
|
230
|
+
ms,
|
|
231
|
+
dayName: weekdayLong(ms, locale),
|
|
232
|
+
dateLabel: `${monthLong(ms, locale)} ${dayNum(ms)}`,
|
|
233
|
+
tier,
|
|
234
|
+
events: dayEvts,
|
|
235
|
+
allDayEvents: allDayEvts,
|
|
236
|
+
timedEvents: timedEvts,
|
|
237
|
+
pastEvents,
|
|
238
|
+
currentEvents,
|
|
239
|
+
upcomingEvents,
|
|
240
|
+
totalHours: Math.round((totalMinutes / 60) * 10) / 10,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Filter hidden days if hideDays is set
|
|
245
|
+
if (hideDays?.length) {
|
|
246
|
+
return out.filter((d) => {
|
|
247
|
+
const jsDay = new Date(d.ms).getDay();
|
|
248
|
+
const iso = jsDay === 0 ? 7 : jsDay;
|
|
249
|
+
return !hideDays.includes(iso);
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return out;
|
|
254
|
+
});
|
|
255
|
+
</script>
|
|
256
|
+
|
|
257
|
+
<!-- ═══ Shared event card snippet ═══ -->
|
|
258
|
+
{#snippet eventCard(ev: TimelineEvent, isNow: boolean, eta?: string)}
|
|
259
|
+
<div
|
|
260
|
+
class="ag-card"
|
|
261
|
+
class:ag-card--selected={selectedEventId === ev.id}
|
|
262
|
+
style:--ev-color={ev.color || 'var(--dt-accent)'}
|
|
263
|
+
role="button"
|
|
264
|
+
tabindex="0"
|
|
265
|
+
aria-label="{ev.title}, {fmtTime(ev.start)} to {fmtTime(ev.end)}, {duration(ev)}"
|
|
266
|
+
onclick={() => handleClick(ev)}
|
|
267
|
+
onpointerenter={() => oneventhover?.(ev)}
|
|
268
|
+
onkeydown={(e) => handleKeydown(e, ev)}
|
|
269
|
+
>
|
|
270
|
+
<div class="ag-card-body">
|
|
271
|
+
<span class="ag-card-title">{ev.title}</span>
|
|
272
|
+
{#if ev.subtitle}
|
|
273
|
+
<span class="ag-card-sub">{ev.subtitle}</span>
|
|
274
|
+
{/if}
|
|
275
|
+
<span class="ag-card-meta">
|
|
276
|
+
{#if isNow}
|
|
277
|
+
{L.until} {fmtTime(ev.end)}
|
|
278
|
+
{:else}
|
|
279
|
+
{fmtTime(ev.start)} – {fmtTime(ev.end)}
|
|
280
|
+
{/if}
|
|
281
|
+
<span class="ag-card-dur">{duration(ev)}</span>
|
|
282
|
+
{#if eta}
|
|
283
|
+
<span class="ag-card-eta">{eta}</span>
|
|
284
|
+
{/if}
|
|
285
|
+
</span>
|
|
286
|
+
{#if ev.tags?.length}
|
|
287
|
+
<div class="ag-card-tags">
|
|
288
|
+
{#each ev.tags as tag}
|
|
289
|
+
<span class="ag-card-tag">{tag}</span>
|
|
290
|
+
{/each}
|
|
291
|
+
</div>
|
|
292
|
+
{/if}
|
|
293
|
+
{#if isNow}
|
|
294
|
+
<div class="ag-card-progress">
|
|
295
|
+
<div class="ag-card-progress-fill" style:width="{progress(ev) * 100}%"></div>
|
|
296
|
+
</div>
|
|
297
|
+
{/if}
|
|
298
|
+
</div>
|
|
299
|
+
</div>
|
|
300
|
+
{/snippet}
|
|
301
|
+
|
|
302
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
303
|
+
<div
|
|
304
|
+
class="ag ag--week"
|
|
305
|
+
class:ag--mobile={isMobile}
|
|
306
|
+
class:ag--auto={autoHeight}
|
|
307
|
+
style={style || undefined}
|
|
308
|
+
onpointerdown={onPointerDown}
|
|
309
|
+
onpointerup={onPointerUp}
|
|
310
|
+
>
|
|
311
|
+
<div class="ag-body" role="list" aria-label={L.weekAhead}>
|
|
312
|
+
{#each weekDays as day (day.ms)}
|
|
313
|
+
{@const expanded = day.tier === 'today' || day.tier === 'tomorrow'}
|
|
314
|
+
{#if day.tier === 'past'}
|
|
315
|
+
<!-- Past day: single collapsed line -->
|
|
316
|
+
<div class="ag-wday ag-wday--past" class:ag-wday--disabled={disabledSet.has(day.ms)} role="listitem">
|
|
317
|
+
<div class="ag-wday-head">
|
|
318
|
+
<div class="ag-wday-head-left">
|
|
319
|
+
<span class="ag-wday-name">{day.dayName}</span>
|
|
320
|
+
{#if showDates}<span class="ag-wday-date">{day.dateLabel}</span>{/if}
|
|
321
|
+
</div>
|
|
322
|
+
{#if dayHeaderSnippet}
|
|
323
|
+
<div class="ag-wday-custom-header">
|
|
324
|
+
{@render dayHeaderSnippet({ date: new Date(day.ms), isToday: false, dayName: day.dayName })}
|
|
325
|
+
</div>
|
|
326
|
+
{/if}
|
|
327
|
+
</div>
|
|
328
|
+
</div>
|
|
329
|
+
{:else}
|
|
330
|
+
<div
|
|
331
|
+
class="ag-wday"
|
|
332
|
+
class:ag-wday--today={day.tier === 'today'}
|
|
333
|
+
class:ag-wday--tomorrow={day.tier === 'tomorrow'}
|
|
334
|
+
class:ag-wday--equal={equalDays}
|
|
335
|
+
class:ag-wday--disabled={disabledSet.has(day.ms)}
|
|
336
|
+
role="listitem"
|
|
337
|
+
>
|
|
338
|
+
<!-- Day header -->
|
|
339
|
+
<div class="ag-wday-head">
|
|
340
|
+
<div class="ag-wday-head-left">
|
|
341
|
+
{#if day.tier === 'today'}
|
|
342
|
+
<span class="ag-wday-badge">{L.today}</span>
|
|
343
|
+
{:else if day.tier === 'tomorrow'}
|
|
344
|
+
<span class="ag-wday-badge ag-wday-badge--muted">{L.tomorrow}</span>
|
|
345
|
+
{/if}
|
|
346
|
+
<span class="ag-wday-name">{day.dayName}</span>
|
|
347
|
+
{#if showDates}<span class="ag-wday-date">{day.dateLabel}</span>{/if}
|
|
348
|
+
</div>
|
|
349
|
+
{#if dayHeaderSnippet}
|
|
350
|
+
<div class="ag-wday-custom-header">
|
|
351
|
+
{@render dayHeaderSnippet({ date: new Date(day.ms), isToday: day.tier === 'today', dayName: day.dayName })}
|
|
352
|
+
</div>
|
|
353
|
+
{/if}
|
|
354
|
+
</div>
|
|
355
|
+
|
|
356
|
+
{#if day.allDayEvents.length > 0}
|
|
357
|
+
<div class="ag-allday">
|
|
358
|
+
{#each day.allDayEvents as ev (ev.id)}
|
|
359
|
+
<div
|
|
360
|
+
class="ag-allday-chip"
|
|
361
|
+
class:ag-allday-chip--selected={selectedEventId === ev.id}
|
|
362
|
+
style:--ev-color={ev.color || 'var(--dt-accent)'}
|
|
363
|
+
role="button"
|
|
364
|
+
tabindex="0"
|
|
365
|
+
aria-label="{ev.title}, {L.allDay}"
|
|
366
|
+
onclick={() => handleClick(ev)}
|
|
367
|
+
onpointerenter={() => oneventhover?.(ev)}
|
|
368
|
+
onkeydown={(e) => handleKeydown(e, ev)}
|
|
369
|
+
>
|
|
370
|
+
<span class="ag-allday-dot"></span>
|
|
371
|
+
<span class="ag-allday-title">{ev.title}</span>
|
|
372
|
+
</div>
|
|
373
|
+
{/each}
|
|
374
|
+
</div>
|
|
375
|
+
{/if}
|
|
376
|
+
|
|
377
|
+
{#if day.events.length === 0}
|
|
378
|
+
<div class="ag-wday-empty">{L.noEvents}</div>
|
|
379
|
+
{:else if equalDays}
|
|
380
|
+
<!-- Equal days: card layout for all days, no time-relative badges -->
|
|
381
|
+
<div class="ag-wday-expanded">
|
|
382
|
+
{#each groupIntoSlots(day.timedEvents) as slot (slot.startMs)}
|
|
383
|
+
<div class="ag-wslot">
|
|
384
|
+
|
|
385
|
+
<div class="ag-wslot-cards" class:ag-wslot-cards--multi={slot.events.length > 1}>
|
|
386
|
+
{#each slot.events as ev (ev.id)}
|
|
387
|
+
{@render eventCard(ev, false)}
|
|
388
|
+
{/each}
|
|
389
|
+
</div>
|
|
390
|
+
</div>
|
|
391
|
+
{/each}
|
|
392
|
+
</div>
|
|
393
|
+
{:else if expanded}
|
|
394
|
+
<!-- Expanded: today/tomorrow get full slot treatment -->
|
|
395
|
+
<div class="ag-wday-expanded">
|
|
396
|
+
{#if day.currentEvents.length > 0}
|
|
397
|
+
{#each day.currentEvents as ev (ev.id)}
|
|
398
|
+
<div class="ag-wslot">
|
|
399
|
+
<div class="ag-wslot-header">
|
|
400
|
+
<span class="ag-wslot-now">{L.now}</span>
|
|
401
|
+
</div>
|
|
402
|
+
{@render eventCard(ev, true)}
|
|
403
|
+
</div>
|
|
404
|
+
{/each}
|
|
405
|
+
{/if}
|
|
406
|
+
{#each groupIntoSlots(day.upcomingEvents) as slot (slot.startMs)}
|
|
407
|
+
<div class="ag-wslot">
|
|
408
|
+
|
|
409
|
+
<div class="ag-wslot-cards" class:ag-wslot-cards--multi={slot.events.length > 1}>
|
|
410
|
+
{#each slot.events as ev (ev.id)}
|
|
411
|
+
{@render eventCard(ev, false, day.tier === 'today' ? timeUntilMs(ev.start.getTime()) : undefined)}
|
|
412
|
+
{/each}
|
|
413
|
+
</div>
|
|
414
|
+
</div>
|
|
415
|
+
{/each}
|
|
416
|
+
{#if day.pastEvents.length > 0}
|
|
417
|
+
<div class="ag-wday-past-line">✓ {L.nCompleted(day.pastEvents.length)}</div>
|
|
418
|
+
{/if}
|
|
419
|
+
</div>
|
|
420
|
+
{:else}
|
|
421
|
+
<!-- Compact: future days get minimal rows -->
|
|
422
|
+
<div class="ag-wday-compact">
|
|
423
|
+
{#each day.timedEvents.slice(0, 4) as ev (ev.id)}
|
|
424
|
+
<div
|
|
425
|
+
class="ag-compact"
|
|
426
|
+
class:ag-compact--selected={selectedEventId === ev.id}
|
|
427
|
+
style:--ev-color={ev.color || 'var(--dt-accent)'}
|
|
428
|
+
role="button"
|
|
429
|
+
tabindex="0"
|
|
430
|
+
aria-label="{ev.title}, {fmtTime(ev.start)}, {duration(ev)}"
|
|
431
|
+
onclick={() => handleClick(ev)} onpointerenter={() => oneventhover?.(ev)} onkeydown={(e) => handleKeydown(e, ev)}
|
|
432
|
+
>
|
|
433
|
+
<span class="ag-compact-dot"></span>
|
|
434
|
+
<span class="ag-compact-time">{fmtTime(ev.start)}</span>
|
|
435
|
+
<span class="ag-compact-title">{ev.title}</span>
|
|
436
|
+
{#if ev.subtitle}
|
|
437
|
+
<span class="ag-compact-sub">{ev.subtitle}</span>
|
|
438
|
+
{/if}
|
|
439
|
+
{#if ev.tags?.length}
|
|
440
|
+
{#each ev.tags as tag}
|
|
441
|
+
<span class="ag-compact-tag">{tag}</span>
|
|
442
|
+
{/each}
|
|
443
|
+
{/if}
|
|
444
|
+
<span class="ag-compact-dur">{duration(ev)}</span>
|
|
445
|
+
</div>
|
|
446
|
+
{/each}
|
|
447
|
+
{#if day.timedEvents.length > 4}
|
|
448
|
+
<div class="ag-compact-more">{L.nMore(day.timedEvents.length - 4)}</div>
|
|
449
|
+
{/if}
|
|
450
|
+
</div>
|
|
451
|
+
{/if}
|
|
452
|
+
</div>
|
|
453
|
+
{/if}
|
|
454
|
+
{/each}
|
|
455
|
+
</div>
|
|
456
|
+
|
|
457
|
+
<!-- ── Floating nav pills (desktop only — mobile uses Calendar header) ── -->
|
|
458
|
+
{#if showNav && !isMobile}
|
|
459
|
+
<nav class="ag-nav" aria-label={L.weekNavigation}>
|
|
460
|
+
<button
|
|
461
|
+
class="ag-nav-pill ag-nav-today"
|
|
462
|
+
class:ag-nav-today--hidden={isThisWeek}
|
|
463
|
+
onclick={() => viewState?.goToday()}
|
|
464
|
+
aria-label={L.goToToday}
|
|
465
|
+
tabindex={isThisWeek ? -1 : 0}
|
|
466
|
+
>
|
|
467
|
+
{L.today}
|
|
468
|
+
</button>
|
|
469
|
+
<button
|
|
470
|
+
class="ag-nav-pill"
|
|
471
|
+
onclick={() => viewState?.prev()}
|
|
472
|
+
aria-label={L.previousWeek}
|
|
473
|
+
>
|
|
474
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="12" height="12" aria-hidden="true"><path d="M10 3 5 8l5 5"/></svg>
|
|
475
|
+
</button>
|
|
476
|
+
<button
|
|
477
|
+
class="ag-nav-pill"
|
|
478
|
+
onclick={() => viewState?.next()}
|
|
479
|
+
aria-label={L.nextWeek}
|
|
480
|
+
>
|
|
481
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="12" height="12" aria-hidden="true"><path d="M6 3l5 5-5 5"/></svg>
|
|
482
|
+
</button>
|
|
483
|
+
</nav>
|
|
484
|
+
{/if}
|
|
485
|
+
</div>
|
|
486
|
+
|
|
487
|
+
<style>
|
|
488
|
+
/* ═══ Floating nav pills ═══ */
|
|
489
|
+
.ag-nav {
|
|
490
|
+
position: absolute;
|
|
491
|
+
top: 10px;
|
|
492
|
+
right: 14px;
|
|
493
|
+
z-index: 20;
|
|
494
|
+
display: flex;
|
|
495
|
+
gap: 2px;
|
|
496
|
+
background: color-mix(in srgb, var(--dt-surface, #10141c) 85%, transparent);
|
|
497
|
+
backdrop-filter: blur(6px);
|
|
498
|
+
-webkit-backdrop-filter: blur(6px);
|
|
499
|
+
border-radius: 8px;
|
|
500
|
+
padding: 2px;
|
|
501
|
+
border: 1px solid var(--dt-border, rgba(148, 163, 184, 0.07));
|
|
502
|
+
}
|
|
503
|
+
.ag-nav-pill {
|
|
504
|
+
border: none;
|
|
505
|
+
background: transparent;
|
|
506
|
+
color: var(--dt-text-2, rgba(148, 163, 184, 0.55));
|
|
507
|
+
cursor: pointer;
|
|
508
|
+
font: 600 11px / 1 var(--dt-sans, 'Outfit', system-ui, sans-serif);
|
|
509
|
+
padding: 6px 12px;
|
|
510
|
+
border-radius: 6px;
|
|
511
|
+
letter-spacing: 0.04em;
|
|
512
|
+
text-transform: uppercase;
|
|
513
|
+
transition: background 100ms, color 100ms;
|
|
514
|
+
display: inline-flex;
|
|
515
|
+
align-items: center;
|
|
516
|
+
justify-content: center;
|
|
517
|
+
}
|
|
518
|
+
.ag-nav-pill:hover {
|
|
519
|
+
color: var(--dt-text, rgba(226, 232, 240, 0.85));
|
|
520
|
+
}
|
|
521
|
+
.ag-nav-today {
|
|
522
|
+
max-width: 60px;
|
|
523
|
+
overflow: hidden;
|
|
524
|
+
white-space: nowrap;
|
|
525
|
+
transition: max-width 250ms ease, padding 250ms ease, opacity 200ms ease;
|
|
526
|
+
}
|
|
527
|
+
.ag-nav-today--hidden {
|
|
528
|
+
max-width: 0;
|
|
529
|
+
padding-left: 0;
|
|
530
|
+
padding-right: 0;
|
|
531
|
+
opacity: 0;
|
|
532
|
+
pointer-events: none;
|
|
533
|
+
}
|
|
534
|
+
.ag-nav-pill:focus-visible {
|
|
535
|
+
outline: 2px solid color-mix(in srgb, var(--dt-accent, #ef4444) 55%, transparent);
|
|
536
|
+
outline-offset: 2px;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/* ═══ Container ═══ */
|
|
540
|
+
.ag {
|
|
541
|
+
position: relative;
|
|
542
|
+
overflow: hidden;
|
|
543
|
+
user-select: none;
|
|
544
|
+
display: flex;
|
|
545
|
+
flex-direction: column;
|
|
546
|
+
height: 100%;
|
|
547
|
+
color: var(--dt-text, rgba(255, 255, 255, 0.92));
|
|
548
|
+
font-family: var(--dt-sans, system-ui, sans-serif);
|
|
549
|
+
}
|
|
550
|
+
.ag--auto {
|
|
551
|
+
height: auto;
|
|
552
|
+
overflow: visible;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/* ═══ Body ═══ */
|
|
556
|
+
.ag-body {
|
|
557
|
+
flex: 1;
|
|
558
|
+
overflow-y: auto;
|
|
559
|
+
scrollbar-width: thin;
|
|
560
|
+
scrollbar-color: var(--dt-border) transparent;
|
|
561
|
+
}
|
|
562
|
+
.ag--auto .ag-body {
|
|
563
|
+
overflow-y: visible;
|
|
564
|
+
}
|
|
565
|
+
.ag-body::-webkit-scrollbar {
|
|
566
|
+
width: 4px;
|
|
567
|
+
}
|
|
568
|
+
.ag-body::-webkit-scrollbar-thumb {
|
|
569
|
+
background: var(--dt-border);
|
|
570
|
+
border-radius: 2px;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/* ═══ All-day chips ═══ */
|
|
574
|
+
.ag-allday {
|
|
575
|
+
display: flex;
|
|
576
|
+
flex-wrap: wrap;
|
|
577
|
+
gap: 4px;
|
|
578
|
+
padding: 4px 14px 6px;
|
|
579
|
+
}
|
|
580
|
+
.ag-allday-chip {
|
|
581
|
+
display: flex;
|
|
582
|
+
align-items: center;
|
|
583
|
+
gap: 4px;
|
|
584
|
+
padding: 2px 8px;
|
|
585
|
+
border-radius: 5px;
|
|
586
|
+
background: color-mix(in srgb, var(--ev-color) 12%, var(--dt-surface, #10141c));
|
|
587
|
+
border: 1px solid color-mix(in srgb, var(--ev-color) 18%, transparent);
|
|
588
|
+
cursor: pointer;
|
|
589
|
+
transition: background 0.15s, border-color 0.15s;
|
|
590
|
+
}
|
|
591
|
+
.ag-allday-chip:hover {
|
|
592
|
+
background: color-mix(in srgb, var(--ev-color) 22%, var(--dt-surface, #10141c));
|
|
593
|
+
border-color: color-mix(in srgb, var(--ev-color) 30%, transparent);
|
|
594
|
+
}
|
|
595
|
+
.ag-allday-chip:focus-visible {
|
|
596
|
+
outline: 2px solid var(--dt-accent, #ff6b4a);
|
|
597
|
+
outline-offset: 2px;
|
|
598
|
+
}
|
|
599
|
+
.ag-allday-chip--selected {
|
|
600
|
+
border-color: var(--ev-color);
|
|
601
|
+
background: color-mix(in srgb, var(--ev-color) 18%, var(--dt-surface, #10141c));
|
|
602
|
+
}
|
|
603
|
+
.ag-allday-dot {
|
|
604
|
+
width: 5px;
|
|
605
|
+
height: 5px;
|
|
606
|
+
border-radius: 50%;
|
|
607
|
+
background: var(--ev-color);
|
|
608
|
+
flex-shrink: 0;
|
|
609
|
+
}
|
|
610
|
+
.ag-allday-title {
|
|
611
|
+
font: 500 0.7rem/1.2 var(--dt-sans, system-ui, sans-serif);
|
|
612
|
+
color: var(--dt-text, rgba(226, 232, 240, 0.85));
|
|
613
|
+
white-space: nowrap;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/* ═══ Shared: event card ═══ */
|
|
617
|
+
.ag-card {
|
|
618
|
+
display: flex;
|
|
619
|
+
align-items: stretch;
|
|
620
|
+
border-radius: 6px;
|
|
621
|
+
background: color-mix(in srgb, var(--ev-color) 12%, var(--dt-surface, #191919));
|
|
622
|
+
border: 1px solid color-mix(in srgb, var(--ev-color) 8%, var(--dt-border, rgba(255, 255, 255, 0.06)));
|
|
623
|
+
overflow: hidden;
|
|
624
|
+
cursor: pointer;
|
|
625
|
+
transition: background 150ms, border-color 150ms;
|
|
626
|
+
}
|
|
627
|
+
.ag-card:hover {
|
|
628
|
+
background: color-mix(in srgb, var(--ev-color) 20%, var(--dt-surface, #191919));
|
|
629
|
+
border-color: color-mix(in srgb, var(--ev-color) 30%, transparent);
|
|
630
|
+
}
|
|
631
|
+
.ag-card:focus-visible {
|
|
632
|
+
outline: 2px solid var(--dt-accent, #ff6b4a);
|
|
633
|
+
outline-offset: 2px;
|
|
634
|
+
}
|
|
635
|
+
.ag-card--selected {
|
|
636
|
+
border-color: var(--ev-color);
|
|
637
|
+
background: color-mix(in srgb, var(--ev-color) 20%, var(--dt-surface, #191919));
|
|
638
|
+
}
|
|
639
|
+
.ag-card-body {
|
|
640
|
+
padding: 7px 10px;
|
|
641
|
+
display: flex;
|
|
642
|
+
flex-direction: column;
|
|
643
|
+
gap: 2px;
|
|
644
|
+
min-width: 0;
|
|
645
|
+
flex: 1;
|
|
646
|
+
}
|
|
647
|
+
.ag-card-title {
|
|
648
|
+
font-size: 13px;
|
|
649
|
+
font-weight: 600;
|
|
650
|
+
line-height: 1.2;
|
|
651
|
+
white-space: nowrap;
|
|
652
|
+
overflow: hidden;
|
|
653
|
+
text-overflow: ellipsis;
|
|
654
|
+
flex: 1;
|
|
655
|
+
}
|
|
656
|
+
.ag-card-meta {
|
|
657
|
+
display: flex;
|
|
658
|
+
align-items: center;
|
|
659
|
+
font-size: 11px;
|
|
660
|
+
color: var(--dt-text-2, rgba(255, 255, 255, 0.5));
|
|
661
|
+
font-family: var(--dt-mono, monospace);
|
|
662
|
+
line-height: 1;
|
|
663
|
+
}
|
|
664
|
+
.ag-card-dur {
|
|
665
|
+
margin-left: 6px;
|
|
666
|
+
color: var(--dt-text-3, rgba(255, 255, 255, 0.3));
|
|
667
|
+
}
|
|
668
|
+
.ag-card-eta {
|
|
669
|
+
margin-left: auto;
|
|
670
|
+
font-size: 10px;
|
|
671
|
+
font-weight: 600;
|
|
672
|
+
color: color-mix(in srgb, var(--ev-color) 80%, var(--dt-text));
|
|
673
|
+
opacity: 0.85;
|
|
674
|
+
letter-spacing: 0.02em;
|
|
675
|
+
}
|
|
676
|
+
.ag-card-sub {
|
|
677
|
+
font-size: 11px;
|
|
678
|
+
color: var(--dt-text-2, rgba(255, 255, 255, 0.45));
|
|
679
|
+
line-height: 1;
|
|
680
|
+
}
|
|
681
|
+
.ag-card-tags {
|
|
682
|
+
display: flex;
|
|
683
|
+
gap: 4px;
|
|
684
|
+
flex-wrap: wrap;
|
|
685
|
+
}
|
|
686
|
+
.ag-card-tag {
|
|
687
|
+
font: 500 9px / 1 var(--dt-sans, system-ui, sans-serif);
|
|
688
|
+
color: var(--ev-color, var(--dt-accent));
|
|
689
|
+
background: color-mix(in srgb, var(--ev-color, var(--dt-accent)) 15%, transparent);
|
|
690
|
+
padding: 2px 5px;
|
|
691
|
+
border-radius: 3px;
|
|
692
|
+
white-space: nowrap;
|
|
693
|
+
}
|
|
694
|
+
.ag-card-progress {
|
|
695
|
+
height: 3px;
|
|
696
|
+
background: var(--dt-border, rgba(255, 255, 255, 0.06));
|
|
697
|
+
border-radius: 2px;
|
|
698
|
+
overflow: hidden;
|
|
699
|
+
margin-top: 2px;
|
|
700
|
+
}
|
|
701
|
+
.ag-card-progress-fill {
|
|
702
|
+
height: 100%;
|
|
703
|
+
background: var(--ev-color, var(--dt-accent));
|
|
704
|
+
border-radius: 2px;
|
|
705
|
+
transition: width 1s linear;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/* ═══ Week day groups ═══ */
|
|
709
|
+
.ag-wday {
|
|
710
|
+
border-bottom: 1px solid var(--dt-border, rgba(255, 255, 255, 0.06));
|
|
711
|
+
}
|
|
712
|
+
.ag-wday--today {
|
|
713
|
+
background: color-mix(in srgb, var(--dt-accent, #ff6b4a) 2%, transparent);
|
|
714
|
+
}
|
|
715
|
+
.ag-wday--tomorrow .ag-card {
|
|
716
|
+
opacity: 0.82;
|
|
717
|
+
}
|
|
718
|
+
.ag-wday--past {
|
|
719
|
+
opacity: 0.4;
|
|
720
|
+
}
|
|
721
|
+
.ag-wday--past .ag-wday-head {
|
|
722
|
+
padding: 8px 20px;
|
|
723
|
+
}
|
|
724
|
+
.ag-wday--disabled {
|
|
725
|
+
opacity: 0.35;
|
|
726
|
+
pointer-events: none;
|
|
727
|
+
position: relative;
|
|
728
|
+
}
|
|
729
|
+
.ag-wday--disabled::after {
|
|
730
|
+
content: '';
|
|
731
|
+
position: absolute;
|
|
732
|
+
inset: 0;
|
|
733
|
+
background: repeating-linear-gradient(
|
|
734
|
+
135deg,
|
|
735
|
+
transparent,
|
|
736
|
+
transparent 4px,
|
|
737
|
+
rgba(128, 128, 128, 0.08) 4px,
|
|
738
|
+
rgba(128, 128, 128, 0.08) 8px
|
|
739
|
+
);
|
|
740
|
+
pointer-events: none;
|
|
741
|
+
}
|
|
742
|
+
.ag-wday-custom-header {
|
|
743
|
+
padding: 2px 0 4px;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
.ag-wday-head {
|
|
747
|
+
display: flex;
|
|
748
|
+
justify-content: space-between;
|
|
749
|
+
align-items: center;
|
|
750
|
+
padding: 10px 20px;
|
|
751
|
+
}
|
|
752
|
+
.ag-wday-head-left {
|
|
753
|
+
display: flex;
|
|
754
|
+
align-items: center;
|
|
755
|
+
gap: 8px;
|
|
756
|
+
}
|
|
757
|
+
.ag-wday-badge {
|
|
758
|
+
font-size: 10px;
|
|
759
|
+
font-weight: 600;
|
|
760
|
+
letter-spacing: 0.08em;
|
|
761
|
+
text-transform: uppercase;
|
|
762
|
+
color: var(--dt-accent, #ff6b4a);
|
|
763
|
+
background: color-mix(in srgb, var(--dt-accent, #ff6b4a) 12%, transparent);
|
|
764
|
+
padding: 2px 7px;
|
|
765
|
+
border-radius: 3px;
|
|
766
|
+
}
|
|
767
|
+
.ag-wday-badge--muted {
|
|
768
|
+
color: var(--dt-text-2, rgba(255, 255, 255, 0.5));
|
|
769
|
+
background: color-mix(
|
|
770
|
+
in srgb,
|
|
771
|
+
var(--dt-text-2, rgba(255, 255, 255, 0.5)) 10%,
|
|
772
|
+
transparent
|
|
773
|
+
);
|
|
774
|
+
}
|
|
775
|
+
.ag-wday-name {
|
|
776
|
+
font-size: 13px;
|
|
777
|
+
font-weight: 600;
|
|
778
|
+
}
|
|
779
|
+
.ag-wday-date {
|
|
780
|
+
font-size: 11px;
|
|
781
|
+
font-family: var(--dt-mono, monospace);
|
|
782
|
+
color: var(--dt-text-3, rgba(255, 255, 255, 0.3));
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.ag-wday-empty {
|
|
786
|
+
padding: 2px 20px 10px;
|
|
787
|
+
font-size: 11px;
|
|
788
|
+
color: var(--dt-text-3, rgba(255, 255, 255, 0.2));
|
|
789
|
+
font-style: italic;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/* Expanded day */
|
|
793
|
+
.ag-wday-expanded {
|
|
794
|
+
padding: 0 20px 10px;
|
|
795
|
+
}
|
|
796
|
+
.ag-wslot {
|
|
797
|
+
margin-bottom: 4px;
|
|
798
|
+
}
|
|
799
|
+
.ag-wslot-header {
|
|
800
|
+
display: flex;
|
|
801
|
+
align-items: baseline;
|
|
802
|
+
gap: 8px;
|
|
803
|
+
padding: 2px 0;
|
|
804
|
+
}
|
|
805
|
+
.ag-wslot-now {
|
|
806
|
+
font-size: 9px;
|
|
807
|
+
font-weight: 700;
|
|
808
|
+
letter-spacing: 0.08em;
|
|
809
|
+
text-transform: uppercase;
|
|
810
|
+
color: var(--dt-accent, #ff6b4a);
|
|
811
|
+
}
|
|
812
|
+
.ag-wslot-cards {
|
|
813
|
+
display: flex;
|
|
814
|
+
flex-direction: column;
|
|
815
|
+
gap: 4px;
|
|
816
|
+
}
|
|
817
|
+
.ag-wslot-cards--multi {
|
|
818
|
+
display: grid;
|
|
819
|
+
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
|
820
|
+
gap: 4px;
|
|
821
|
+
}
|
|
822
|
+
.ag-wday-past-line {
|
|
823
|
+
font-size: 10px;
|
|
824
|
+
color: var(--dt-text-3, rgba(255, 255, 255, 0.3));
|
|
825
|
+
padding: 6px 0 0;
|
|
826
|
+
opacity: 0.5;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
/* Compact day events */
|
|
830
|
+
.ag-wday-compact {
|
|
831
|
+
padding: 0 20px 10px;
|
|
832
|
+
}
|
|
833
|
+
.ag-compact {
|
|
834
|
+
display: flex;
|
|
835
|
+
align-items: center;
|
|
836
|
+
gap: 8px;
|
|
837
|
+
padding: 4px 0;
|
|
838
|
+
cursor: pointer;
|
|
839
|
+
}
|
|
840
|
+
.ag-compact--selected {
|
|
841
|
+
background: color-mix(in srgb, var(--ev-color) 10%, transparent);
|
|
842
|
+
border-radius: 4px;
|
|
843
|
+
padding-left: 6px;
|
|
844
|
+
padding-right: 6px;
|
|
845
|
+
}
|
|
846
|
+
.ag-compact:hover .ag-compact-title {
|
|
847
|
+
color: var(--dt-text);
|
|
848
|
+
}
|
|
849
|
+
.ag-compact:focus-visible {
|
|
850
|
+
outline: 2px solid var(--dt-accent, #ff6b4a);
|
|
851
|
+
outline-offset: 2px;
|
|
852
|
+
}
|
|
853
|
+
.ag-compact-dot {
|
|
854
|
+
width: 5px;
|
|
855
|
+
height: 5px;
|
|
856
|
+
border-radius: 50%;
|
|
857
|
+
background: var(--ev-color, var(--dt-accent));
|
|
858
|
+
flex-shrink: 0;
|
|
859
|
+
}
|
|
860
|
+
.ag-compact-time {
|
|
861
|
+
font-size: 11px;
|
|
862
|
+
font-family: var(--dt-mono, monospace);
|
|
863
|
+
color: var(--dt-text-2, rgba(255, 255, 255, 0.5));
|
|
864
|
+
min-width: 64px;
|
|
865
|
+
flex-shrink: 0;
|
|
866
|
+
}
|
|
867
|
+
.ag-compact-title {
|
|
868
|
+
font-size: 12px;
|
|
869
|
+
font-weight: 500;
|
|
870
|
+
color: var(--dt-text-2, rgba(255, 255, 255, 0.5));
|
|
871
|
+
flex: 1;
|
|
872
|
+
white-space: nowrap;
|
|
873
|
+
overflow: hidden;
|
|
874
|
+
text-overflow: ellipsis;
|
|
875
|
+
transition: color 150ms;
|
|
876
|
+
}
|
|
877
|
+
.ag-compact-dur {
|
|
878
|
+
font-size: 10px;
|
|
879
|
+
font-family: var(--dt-mono, monospace);
|
|
880
|
+
color: var(--dt-text-3, rgba(255, 255, 255, 0.3));
|
|
881
|
+
flex-shrink: 0;
|
|
882
|
+
}
|
|
883
|
+
.ag-compact-sub {
|
|
884
|
+
font-size: 10px;
|
|
885
|
+
color: var(--dt-text-3, rgba(255, 255, 255, 0.35));
|
|
886
|
+
flex-shrink: 0;
|
|
887
|
+
}
|
|
888
|
+
.ag-compact-tag {
|
|
889
|
+
font: 500 8px / 1 var(--dt-sans, system-ui, sans-serif);
|
|
890
|
+
color: var(--ev-color, var(--dt-accent));
|
|
891
|
+
background: color-mix(in srgb, var(--ev-color, var(--dt-accent)) 12%, transparent);
|
|
892
|
+
padding: 1px 4px;
|
|
893
|
+
border-radius: 3px;
|
|
894
|
+
white-space: nowrap;
|
|
895
|
+
flex-shrink: 0;
|
|
896
|
+
}
|
|
897
|
+
.ag-compact-more {
|
|
898
|
+
font-size: 11px;
|
|
899
|
+
color: var(--dt-text-3);
|
|
900
|
+
padding: 2px 0 0 13px;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
/* ═══ Mobile adaptations ═══ */
|
|
904
|
+
.ag--mobile .ag-wday-head {
|
|
905
|
+
padding: 12px 16px;
|
|
906
|
+
}
|
|
907
|
+
.ag--mobile .ag-wday-expanded {
|
|
908
|
+
padding: 0 16px 12px;
|
|
909
|
+
}
|
|
910
|
+
.ag--mobile .ag-wday-compact {
|
|
911
|
+
padding: 0 16px 12px;
|
|
912
|
+
}
|
|
913
|
+
.ag--mobile .ag-card-body {
|
|
914
|
+
padding: 12px 14px;
|
|
915
|
+
}
|
|
916
|
+
.ag--mobile .ag-card-title {
|
|
917
|
+
font-size: 14px;
|
|
918
|
+
}
|
|
919
|
+
.ag--mobile .ag-compact {
|
|
920
|
+
padding: 8px 0;
|
|
921
|
+
}
|
|
922
|
+
.ag--mobile .ag-compact-title {
|
|
923
|
+
font-size: 14px;
|
|
924
|
+
}
|
|
925
|
+
.ag--mobile .ag-compact-time {
|
|
926
|
+
font-size: 12px;
|
|
927
|
+
}
|
|
928
|
+
.ag--mobile .ag-nav-pill {
|
|
929
|
+
padding: 10px 16px;
|
|
930
|
+
}
|
|
931
|
+
.ag--mobile .ag-wslot-cards--multi {
|
|
932
|
+
grid-template-columns: 1fr;
|
|
933
|
+
}
|
|
934
|
+
</style>
|