@f-ewald/components 1.27.1 → 1.27.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.
@@ -2671,6 +2671,10 @@
2671
2671
  {
2672
2672
  "description": "Declarative `calendar-entry` elements to render for this day.",
2673
2673
  "name": ""
2674
+ },
2675
+ {
2676
+ "description": "Optional controls rendered beside the day name (e.g. day-navigation buttons).",
2677
+ "name": "actions"
2674
2678
  }
2675
2679
  ],
2676
2680
  "members": [
@@ -2684,6 +2688,64 @@
2684
2688
  "attribute": "date",
2685
2689
  "reflects": true
2686
2690
  },
2691
+ {
2692
+ "kind": "field",
2693
+ "name": "timeMarker",
2694
+ "type": {
2695
+ "text": "boolean"
2696
+ },
2697
+ "default": "false",
2698
+ "description": "Shows a fine live line marking the current time, Google-Calendar-style. Only rendered when `date` is today.",
2699
+ "attribute": "time-marker",
2700
+ "reflects": true
2701
+ },
2702
+ {
2703
+ "kind": "field",
2704
+ "name": "minWidth",
2705
+ "type": {
2706
+ "text": "string"
2707
+ },
2708
+ "default": "\"\"",
2709
+ "description": "Minimum width for the day column, as a CSS length (e.g. `\"18rem\"`).\nUnset leaves the host's width fully controlled by its container —\nuseful as the sizing floor when placing several `calendar-day`\nelements in a scrollable row.",
2710
+ "attribute": "min-width",
2711
+ "reflects": true
2712
+ },
2713
+ {
2714
+ "kind": "field",
2715
+ "name": "_now",
2716
+ "privacy": "private"
2717
+ },
2718
+ {
2719
+ "kind": "field",
2720
+ "name": "_nowTimer",
2721
+ "type": {
2722
+ "text": "ReturnType<typeof setInterval> | null"
2723
+ },
2724
+ "privacy": "private",
2725
+ "default": "null"
2726
+ },
2727
+ {
2728
+ "kind": "method",
2729
+ "name": "_syncNowTimer",
2730
+ "privacy": "private",
2731
+ "return": {
2732
+ "type": {
2733
+ "text": "void"
2734
+ }
2735
+ },
2736
+ "description": "Ensures a 60s current-time ticker is running only while `timeMarker` is enabled."
2737
+ },
2738
+ {
2739
+ "kind": "method",
2740
+ "name": "_syncMinWidth",
2741
+ "privacy": "private",
2742
+ "return": {
2743
+ "type": {
2744
+ "text": "void"
2745
+ }
2746
+ },
2747
+ "description": "Reflects `minWidth` onto the `--calendar-day-min-width` custom property the host's own styles read."
2748
+ },
2687
2749
  {
2688
2750
  "kind": "method",
2689
2751
  "name": "_renderAllDayLane",
@@ -2925,6 +2987,24 @@
2925
2987
  },
2926
2988
  "description": "The day shown, `\"YYYY-MM-DD\"`.",
2927
2989
  "fieldName": "date"
2990
+ },
2991
+ {
2992
+ "name": "time-marker",
2993
+ "type": {
2994
+ "text": "boolean"
2995
+ },
2996
+ "default": "false",
2997
+ "description": "Shows a fine live line marking the current time, Google-Calendar-style. Only rendered when `date` is today.",
2998
+ "fieldName": "timeMarker"
2999
+ },
3000
+ {
3001
+ "name": "min-width",
3002
+ "type": {
3003
+ "text": "string"
3004
+ },
3005
+ "default": "\"\"",
3006
+ "description": "Minimum width for the day column, as a CSS length (e.g. `\"18rem\"`).\nUnset leaves the host's width fully controlled by its container —\nuseful as the sizing floor when placing several `calendar-day`\nelements in a scrollable row.",
3007
+ "fieldName": "minWidth"
2928
3008
  }
2929
3009
  ],
2930
3010
  "superclass": {
@@ -2974,6 +3054,10 @@
2974
3054
  {
2975
3055
  "description": "Plain-text ending note pinned to the bottom of the shared body.",
2976
3056
  "name": "footer"
3057
+ },
3058
+ {
3059
+ "description": "Plain-text location, shown on its own line with a leading marker icon.",
3060
+ "name": "location"
2977
3061
  }
2978
3062
  ],
2979
3063
  "members": [
@@ -3117,6 +3201,10 @@
3117
3201
  {
3118
3202
  "description": "Declarative `calendar-entry` elements to render for this month.",
3119
3203
  "name": ""
3204
+ },
3205
+ {
3206
+ "description": "Optional controls rendered beside the month name (e.g. month-navigation buttons).",
3207
+ "name": "actions"
3120
3208
  }
3121
3209
  ],
3122
3210
  "members": [
@@ -3339,7 +3427,7 @@
3339
3427
  }
3340
3428
  }
3341
3429
  ],
3342
- "description": "Joins the event title, details, and visible footer for tooltips and accessible link names."
3430
+ "description": "Joins the event title, location, details, and visible footer for tooltips and accessible link names."
3343
3431
  },
3344
3432
  {
3345
3433
  "kind": "method",
@@ -3369,7 +3457,7 @@
3369
3457
  "default": "false"
3370
3458
  }
3371
3459
  ],
3372
- "description": "Renders the shared details body, with the footer reserved at its bottom edge."
3460
+ "description": "Renders the shared details body, with the location pinned at the top and the footer reserved at the bottom."
3373
3461
  },
3374
3462
  {
3375
3463
  "kind": "method",
@@ -3399,7 +3487,7 @@
3399
3487
  "default": "false"
3400
3488
  }
3401
3489
  ],
3402
- "description": "Renders a row-spanning body cell with whole-line detail and footer budgets."
3490
+ "description": "Renders a row-spanning body cell with whole-line location, detail, and footer budgets."
3403
3491
  },
3404
3492
  {
3405
3493
  "kind": "method",
@@ -3670,6 +3758,10 @@
3670
3758
  {
3671
3759
  "description": "Declarative `calendar-entry` elements to render for this week.",
3672
3760
  "name": ""
3761
+ },
3762
+ {
3763
+ "description": "Optional controls rendered beside the day headers (e.g. week-navigation buttons).",
3764
+ "name": "actions"
3673
3765
  }
3674
3766
  ],
3675
3767
  "members": [
@@ -14,11 +14,33 @@ import { CalendarTimelineBase } from "./calendar-timeline-base.js";
14
14
  *
15
15
  * @element calendar-day
16
16
  * @slot - Declarative `calendar-entry` elements to render for this day.
17
+ * @slot actions - Optional controls rendered beside the day name (e.g. day-navigation buttons).
17
18
  */
18
19
  export declare class CalendarDay extends CalendarTimelineBase {
19
20
  /** The day shown, `"YYYY-MM-DD"`. */
20
21
  date: string;
22
+ /** Shows a fine live line marking the current time, Google-Calendar-style. Only rendered when `date` is today. */
23
+ timeMarker: boolean;
24
+ /**
25
+ * Minimum width for the day column, as a CSS length (e.g. `"18rem"`).
26
+ * Unset leaves the host's width fully controlled by its container —
27
+ * useful as the sizing floor when placing several `calendar-day`
28
+ * elements in a scrollable row.
29
+ */
30
+ minWidth: string;
31
+ private _now;
32
+ private _nowTimer;
21
33
  static styles: import("lit").CSSResult[];
34
+ /** Starts the current-time ticker if `time-marker` is already set on connect. */
35
+ connectedCallback(): void;
36
+ /** Stops the current-time ticker when this element disconnects. */
37
+ disconnectedCallback(): void;
38
+ /** Starts/stops the current-time ticker and re-syncs the min-width host style to match the latest properties. */
39
+ protected updated(): void;
40
+ /** Ensures a 60s current-time ticker is running only while `timeMarker` is enabled. */
41
+ private _syncNowTimer;
42
+ /** Reflects `minWidth` onto the `--calendar-day-min-width` custom property the host's own styles read. */
43
+ private _syncMinWidth;
22
44
  /** Renders one lane's stacked all-day bars, given the entries assigned to it. */
23
45
  private _renderAllDayLane;
24
46
  /** Renders a positioned/sized block for one timed entry, clamped to this day's bounds. */
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-day.d.ts","sourceRoot":"","sources":["../src/calendar-day.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAoBnE;;;;;;;;;;;;;;;GAeG;AACH,qBACa,WAAY,SAAQ,oBAAoB;IACnD,qCAAqC;IACR,IAAI,EAAE,MAAM,CAAyB;IAElE,OAAgB,MAAM,4BA0JpB;IAEF,iFAAiF;IACjF,OAAO,CAAC,iBAAiB;IAoBzB,0FAA0F;IAC1F,OAAO,CAAC,iBAAiB;IAqBzB,UAAmB,MAAM,yCA6CxB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
1
+ {"version":3,"file":"calendar-day.d.ts","sourceRoot":"","sources":["../src/calendar-day.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAwBnE;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,WAAY,SAAQ,oBAAoB;IACnD,qCAAqC;IACR,IAAI,EAAE,MAAM,CAAyB;IAElE,kHAAkH;IAC5C,UAAU,UAAS;IAEzF;;;;;OAKG;IACkD,QAAQ,SAAM;IAE1D,OAAO,CAAC,IAAI,CAAc;IAEnC,OAAO,CAAC,SAAS,CAA+C;IAEhE,OAAgB,MAAM,4BAkNpB;IAEF,iFAAiF;IACxE,iBAAiB,IAAI,IAAI,CAGjC;IAED,mEAAmE;IAC1D,oBAAoB,IAAI,IAAI,CAIpC;IAED,iHAAiH;IACjH,UAAmB,OAAO,IAAI,IAAI,CAIjC;IAED,uFAAuF;IACvF,OAAO,CAAC,aAAa;IAYrB,0GAA0G;IAC1G,OAAO,CAAC,aAAa;IAQrB,iFAAiF;IACjF,OAAO,CAAC,iBAAiB;IA0BzB,0FAA0F;IAC1F,OAAO,CAAC,iBAAiB;IA0BzB,UAAmB,MAAM,yCAsDxB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
@@ -5,11 +5,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { css, html, nothing } from "lit";
8
- import { customElement, property } from "lit/decorators.js";
8
+ import { customElement, property, state } from "lit/decorators.js";
9
9
  import { repeat } from "lit/directives/repeat.js";
10
10
  import { CalendarTimelineBase } from "./calendar-timeline-base.js";
11
+ import { iconMapPin } from "./icons.js";
11
12
  import { tokens } from "./tokens.js";
12
- import { assignLanes, minutesSinceMidnight, monthName, parseIsoDate, toIsoDate, } from "./utils/calendar.js";
13
+ import { assignLanes, isWeekend, minutesSinceMidnight, monthName, parseIsoDate, toIsoDate, } from "./utils/calendar.js";
14
+ const NOW_MARKER_INTERVAL_MS = 60_000;
13
15
  const HOUR_HEIGHT_REM = 3;
14
16
  const HOURS = Array.from({ length: 24 }, (_, i) => i);
15
17
  const hourLabelFormatter = new Intl.DateTimeFormat(undefined, { hour: "numeric" });
@@ -32,18 +34,31 @@ function hourLabel(h) {
32
34
  *
33
35
  * @element calendar-day
34
36
  * @slot - Declarative `calendar-entry` elements to render for this day.
37
+ * @slot actions - Optional controls rendered beside the day name (e.g. day-navigation buttons).
35
38
  */
36
39
  let CalendarDay = class CalendarDay extends CalendarTimelineBase {
37
40
  constructor() {
38
41
  super(...arguments);
39
42
  /** The day shown, `"YYYY-MM-DD"`. */
40
43
  this.date = toIsoDate(new Date());
44
+ /** Shows a fine live line marking the current time, Google-Calendar-style. Only rendered when `date` is today. */
45
+ this.timeMarker = false;
46
+ /**
47
+ * Minimum width for the day column, as a CSS length (e.g. `"18rem"`).
48
+ * Unset leaves the host's width fully controlled by its container —
49
+ * useful as the sizing floor when placing several `calendar-day`
50
+ * elements in a scrollable row.
51
+ */
52
+ this.minWidth = "";
53
+ this._now = Date.now();
54
+ this._nowTimer = null;
41
55
  }
42
56
  static { this.styles = [
43
57
  tokens,
44
58
  css `
45
59
  :host {
46
60
  display: block;
61
+ min-width: var(--calendar-day-min-width, 0);
47
62
  font-family: var(
48
63
  --ui-font,
49
64
  ui-sans-serif,
@@ -56,16 +71,33 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
56
71
  );
57
72
  font-size: var(--ui-font-size-sm, 0.75rem);
58
73
  }
74
+ .day-header {
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: space-between;
78
+ gap: 0.5rem;
79
+ margin-bottom: 0.5rem;
80
+ }
59
81
  .day-name {
60
- margin: 0 0 0.5rem;
82
+ margin: 0;
83
+ min-width: 0;
61
84
  color: var(--ui-text, #0f172a);
62
85
  font-size: var(--ui-font-size-lg, 1rem);
63
86
  font-weight: var(--ui-font-weight-semibold, 600);
64
87
  line-height: var(--ui-line-height-tight, 1.25);
65
88
  }
89
+ .day-name.weekend {
90
+ color: var(--ui-text-muted, #64748b);
91
+ }
66
92
  .day-name.today {
67
93
  color: var(--ui-primary, #4f46e5);
68
94
  }
95
+ .actions {
96
+ display: flex;
97
+ flex: 0 0 auto;
98
+ align-items: center;
99
+ gap: 0.5rem;
100
+ }
69
101
  .all-day-band {
70
102
  display: flex;
71
103
  margin-bottom: 0.5rem;
@@ -108,9 +140,32 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
108
140
  flex: 1 1 auto;
109
141
  height: ${HOUR_HEIGHT_REM * 24}rem;
110
142
  }
143
+ .day-column.weekend {
144
+ background: var(--ui-surface-muted, #f8fafc);
145
+ }
111
146
  .day-column.today {
112
147
  background: color-mix(in srgb, var(--ui-primary, #4f46e5) 6%, transparent);
113
148
  }
149
+ .now-line {
150
+ position: absolute;
151
+ left: 0;
152
+ right: 0;
153
+ height: 2px;
154
+ background: var(--ui-danger, #dc2626);
155
+ pointer-events: none;
156
+ z-index: 2;
157
+ }
158
+ .now-line::before {
159
+ content: "";
160
+ position: absolute;
161
+ top: 50%;
162
+ left: -3px;
163
+ width: 8px;
164
+ height: 8px;
165
+ border-radius: 50%;
166
+ background: var(--ui-danger, #dc2626);
167
+ transform: translateY(-50%);
168
+ }
114
169
  .hour-line {
115
170
  box-sizing: border-box;
116
171
  height: ${HOUR_HEIGHT_REM}rem;
@@ -140,6 +195,21 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
140
195
  text-overflow: ellipsis;
141
196
  pointer-events: none;
142
197
  }
198
+ .entry-location {
199
+ display: flex;
200
+ align-items: center;
201
+ gap: 0.25rem;
202
+ overflow: hidden;
203
+ color: inherit;
204
+ font-size: var(--ui-font-size-xs, 0.6875rem);
205
+ font-weight: var(--ui-font-weight-regular, 400);
206
+ white-space: nowrap;
207
+ text-overflow: ellipsis;
208
+ pointer-events: none;
209
+ }
210
+ .entry-location svg {
211
+ flex: 0 0 auto;
212
+ }
143
213
  .entry-link {
144
214
  position: absolute;
145
215
  z-index: 1;
@@ -189,26 +259,74 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
189
259
  transition: none;
190
260
  }
191
261
  }
192
- slot {
262
+ slot:not([name]) {
193
263
  display: none;
194
264
  }
195
265
  `,
196
266
  ]; }
267
+ /** Starts the current-time ticker if `time-marker` is already set on connect. */
268
+ connectedCallback() {
269
+ super.connectedCallback();
270
+ this._syncNowTimer();
271
+ }
272
+ /** Stops the current-time ticker when this element disconnects. */
273
+ disconnectedCallback() {
274
+ super.disconnectedCallback();
275
+ if (this._nowTimer != null)
276
+ clearInterval(this._nowTimer);
277
+ this._nowTimer = null;
278
+ }
279
+ /** Starts/stops the current-time ticker and re-syncs the min-width host style to match the latest properties. */
280
+ updated() {
281
+ super.updated();
282
+ this._syncNowTimer();
283
+ this._syncMinWidth();
284
+ }
285
+ /** Ensures a 60s current-time ticker is running only while `timeMarker` is enabled. */
286
+ _syncNowTimer() {
287
+ if (this.timeMarker && this._nowTimer == null) {
288
+ this._now = Date.now();
289
+ this._nowTimer = setInterval(() => {
290
+ this._now = Date.now();
291
+ }, NOW_MARKER_INTERVAL_MS);
292
+ }
293
+ else if (!this.timeMarker && this._nowTimer != null) {
294
+ clearInterval(this._nowTimer);
295
+ this._nowTimer = null;
296
+ }
297
+ }
298
+ /** Reflects `minWidth` onto the `--calendar-day-min-width` custom property the host's own styles read. */
299
+ _syncMinWidth() {
300
+ if (this.minWidth) {
301
+ this.style.setProperty("--calendar-day-min-width", this.minWidth);
302
+ }
303
+ else {
304
+ this.style.removeProperty("--calendar-day-min-width");
305
+ }
306
+ }
197
307
  /** Renders one lane's stacked all-day bars, given the entries assigned to it. */
198
308
  _renderAllDayLane(laned, lane) {
199
309
  const entries = laned.filter((entry) => entry.lane === lane);
200
310
  return html `
201
311
  <div class="all-day-lane">
202
- ${entries.map((entry) => html `
312
+ ${entries.map((entry) => {
313
+ const bodyText = [entry.label, entry.location].filter(Boolean).join(" · ");
314
+ return html `
203
315
  <div
204
316
  class="entry-bar ${entry.color}"
205
317
  data-entry-key=${this.entryKey(entry)}
206
- title=${entry.href ? nothing : entry.label}
318
+ title=${entry.href ? nothing : bodyText}
207
319
  >
208
- ${this.renderEntryLink(entry, entry.label)}
320
+ ${this.renderEntryLink(entry, bodyText)}
209
321
  <span class="entry-title" aria-hidden=${entry.href ? "true" : nothing}>${entry.label}</span>
322
+ ${entry.location
323
+ ? html `<span class="entry-location" aria-hidden=${entry.href ? "true" : nothing}
324
+ >${iconMapPin(14)}${entry.location}</span
325
+ >`
326
+ : nothing}
210
327
  </div>
211
- `)}
328
+ `;
329
+ })}
212
330
  </div>
213
331
  `;
214
332
  }
@@ -220,7 +338,7 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
220
338
  const bottomRem = (minutesSinceMidnight(visibleEnd) / 60) * HOUR_HEIGHT_REM;
221
339
  const heightRem = Math.max(bottomRem - topRem, HOUR_HEIGHT_REM / 4);
222
340
  const widthPercent = 100 / laneCount;
223
- const bodyText = [entry.label, ...(entry.details ?? [])].filter(Boolean).join("\n");
341
+ const bodyText = [entry.label, ...(entry.details ?? []), entry.location].filter(Boolean).join("\n");
224
342
  return html `
225
343
  <div
226
344
  class="entry-bar entry-block ${entry.color}"
@@ -230,6 +348,11 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
230
348
  >
231
349
  ${this.renderEntryLink(entry, bodyText)}
232
350
  <span class="entry-title" aria-hidden=${entry.href ? "true" : nothing}>${entry.label}</span>
351
+ ${entry.location
352
+ ? html `<span class="entry-location" aria-hidden=${entry.href ? "true" : nothing}
353
+ >${iconMapPin(14)}${entry.location}</span
354
+ >`
355
+ : nothing}
233
356
  </div>
234
357
  `;
235
358
  }
@@ -240,16 +363,21 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
240
363
  const dayEnd = new Date(day);
241
364
  dayEnd.setHours(23, 59, 59, 999);
242
365
  const isToday = toIsoDate(day) === toIsoDate(new Date());
366
+ const isWeekendDay = isWeekend(day);
243
367
  const resolved = this.resolveTimedEntriesFor(dayStart, dayEnd);
244
368
  const allDay = resolved.filter((entry) => entry.allDay);
245
369
  const timed = resolved.filter((entry) => !entry.allDay);
246
370
  const { entries: lanedAllDay, laneCount: allDayLaneCount } = assignLanes(allDay);
247
371
  const { entries: lanedTimed, laneCount: timedLaneCount } = assignLanes(timed);
372
+ const nowTopRem = this.timeMarker && isToday ? (minutesSinceMidnight(new Date(this._now)) / 60) * HOUR_HEIGHT_REM : null;
248
373
  return html `
249
374
  <div class="day">
250
- <h4 class="day-name ${isToday ? "today" : ""}">
251
- ${monthName(day.getMonth() + 1)} ${day.getDate()}, ${day.getFullYear()}
252
- </h4>
375
+ <div class="day-header">
376
+ <h4 class="day-name ${isWeekendDay ? "weekend" : ""} ${isToday ? "today" : ""}">
377
+ ${monthName(day.getMonth() + 1)} ${day.getDate()}, ${day.getFullYear()}
378
+ </h4>
379
+ <div class="actions"><slot name="actions"></slot></div>
380
+ </div>
253
381
  <div class="all-day-band ${allDay.length === 0 ? "empty" : ""}">
254
382
  <div class="hour-gutter-spacer"></div>
255
383
  <div class="all-day-lanes">
@@ -260,9 +388,12 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
260
388
  <div class="hour-gutter">
261
389
  ${HOURS.map((h) => html `<div class="hour-label-cell">${hourLabel(h)}</div>`)}
262
390
  </div>
263
- <div class="day-column ${isToday ? "today" : ""}">
391
+ <div class="day-column ${isWeekendDay ? "weekend" : ""} ${isToday ? "today" : ""}">
264
392
  ${HOURS.map(() => html `<div class="hour-line"></div>`)}
265
393
  ${repeat(lanedTimed, (entry) => this.entryKey(entry), (entry) => this._renderTimedEntry(entry, Math.max(timedLaneCount, 1), dayStart, dayEnd))}
394
+ ${nowTopRem !== null
395
+ ? html `<div class="now-line" style="top: ${nowTopRem}rem" aria-hidden="true"></div>`
396
+ : nothing}
266
397
  </div>
267
398
  </div>
268
399
  <slot @slotchange=${this.handleSlotChange}></slot>
@@ -273,6 +404,15 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
273
404
  __decorate([
274
405
  property({ reflect: true })
275
406
  ], CalendarDay.prototype, "date", void 0);
407
+ __decorate([
408
+ property({ type: Boolean, reflect: true, attribute: "time-marker" })
409
+ ], CalendarDay.prototype, "timeMarker", void 0);
410
+ __decorate([
411
+ property({ reflect: true, attribute: "min-width" })
412
+ ], CalendarDay.prototype, "minWidth", void 0);
413
+ __decorate([
414
+ state()
415
+ ], CalendarDay.prototype, "_now", void 0);
276
416
  CalendarDay = __decorate([
277
417
  customElement("calendar-day")
278
418
  ], CalendarDay);
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-day.js","sourceRoot":"","sources":["../src/calendar-day.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,SAAS,EACT,YAAY,EACZ,SAAS,GAEV,MAAM,qBAAqB,CAAC;AAE7B,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AACtD,MAAM,kBAAkB,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;AAEnF,yEAAyE;AACzE,SAAS,SAAS,CAAC,CAAS;IAC1B,OAAO,kBAAkB,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,oBAAoB;IAA9C;;QACL,qCAAqC;QACR,SAAI,GAAW,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAuPpE,CAAC;aArPi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CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EACd,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,IAAI,CAAC,CACpD;;;;;cAKC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAA,gCAAgC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;;mCAErD,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;cAC3C,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAA,+BAA+B,CAAC;cACpD,MAAM,CACN,UAAU,EACV,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAC/B,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,CACxF;;;4BAGe,IAAI,CAAC,gBAAgB;;KAE5C,CAAC;IACJ,CAAC;CACF,CAAA;AAvP8B;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAsC;AAFvD,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAyPvB","sourcesContent":["import { css, html, nothing } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { CalendarTimelineBase } from \"./calendar-timeline-base.js\";\nimport { tokens } from \"./tokens.js\";\nimport {\n assignLanes,\n minutesSinceMidnight,\n monthName,\n parseIsoDate,\n toIsoDate,\n type LanedEntry,\n} from \"./utils/calendar.js\";\n\nconst HOUR_HEIGHT_REM = 3;\nconst HOURS = Array.from({ length: 24 }, (_, i) => i);\nconst hourLabelFormatter = new Intl.DateTimeFormat(undefined, { hour: \"numeric\" });\n\n/** Formats hour `h` (0-23) as a locale-aware hour label, e.g. \"9 AM\". */\nfunction hourLabel(h: number): string {\n return hourLabelFormatter.format(new Date(2000, 0, 1, h));\n}\n\n/**\n * A single day rendered as an hourly time grid — a Google-Calendar-style\n * view distinct from `calendar-month`'s whole-day table. Declarative\n * `calendar-entry` children with a time-of-day in `start`/`end` (e.g.\n * `start=\"2026-03-05T09:00\"`) render as positioned/sized blocks; entries\n * with only a date (no time) render in an all-day band above the grid.\n * Overlapping timed entries stack into side-by-side columns; overlapping\n * all-day/multi-day entries stack into lanes, same as `calendar-month`.\n * Read-only.\n *\n * Shares its slotted-entry observation, resolution, and hover/focus\n * interaction sync with `calendar-week` via `CalendarTimelineBase`.\n *\n * @element calendar-day\n * @slot - Declarative `calendar-entry` elements to render for this day.\n */\n@customElement(\"calendar-day\")\nexport class CalendarDay extends CalendarTimelineBase {\n /** The day shown, `\"YYYY-MM-DD\"`. */\n @property({ reflect: true }) date: string = toIsoDate(new Date());\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size-sm, 0.75rem);\n }\n .day-name {\n margin: 0 0 0.5rem;\n color: var(--ui-text, #0f172a);\n font-size: var(--ui-font-size-lg, 1rem);\n font-weight: var(--ui-font-weight-semibold, 600);\n line-height: var(--ui-line-height-tight, 1.25);\n }\n .day-name.today {\n color: var(--ui-primary, #4f46e5);\n }\n .all-day-band {\n display: flex;\n margin-bottom: 0.5rem;\n }\n .all-day-band.empty {\n display: none;\n }\n .hour-gutter-spacer {\n flex: 0 0 3rem;\n }\n .all-day-lanes {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n gap: 0.25rem;\n }\n .all-day-lane {\n display: flex;\n gap: 0.25rem;\n }\n .grid {\n display: flex;\n border-top: 1px solid var(--ui-border, #e2e8f0);\n }\n .hour-gutter {\n flex: 0 0 3rem;\n }\n .hour-label-cell {\n box-sizing: border-box;\n height: ${HOUR_HEIGHT_REM}rem;\n padding-right: 0.5rem;\n border-bottom: 1px solid var(--ui-border, #e2e8f0);\n color: var(--ui-text-muted, #64748b);\n font-variant-numeric: tabular-nums;\n text-align: right;\n white-space: nowrap;\n }\n .day-column {\n position: relative;\n flex: 1 1 auto;\n height: ${HOUR_HEIGHT_REM * 24}rem;\n }\n .day-column.today {\n background: color-mix(in srgb, var(--ui-primary, #4f46e5) 6%, transparent);\n }\n .hour-line {\n box-sizing: border-box;\n height: ${HOUR_HEIGHT_REM}rem;\n border-bottom: 1px solid var(--ui-border, #e2e8f0);\n }\n .entry-bar {\n position: relative;\n box-sizing: border-box;\n flex: 1 1 auto;\n overflow: hidden;\n border-radius: var(--ui-radius-sm, 0.25rem);\n padding: 0.25rem 0.5rem;\n transition: box-shadow 120ms ease;\n }\n .entry-bar.entry-block {\n position: absolute;\n }\n .entry-bar.entry-hovered,\n .entry-bar.entry-focused {\n box-shadow: inset 0 0 0 100vmax var(--ui-hover-overlay, rgb(255 255 255 / 0.32));\n }\n .entry-title {\n display: block;\n overflow: hidden;\n font-weight: var(--ui-font-weight-medium, 500);\n white-space: nowrap;\n text-overflow: ellipsis;\n pointer-events: none;\n }\n .entry-link {\n position: absolute;\n z-index: 1;\n inset: 0;\n border-radius: inherit;\n color: inherit;\n cursor: pointer;\n text-decoration: none;\n }\n .entry-link:focus-visible {\n outline: 2px solid var(--ui-primary, #4f46e5);\n outline-offset: -2px;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35)) inset;\n }\n .entry-bar.neutral {\n background: color-mix(in srgb, var(--ui-text-muted, #64748b) 15%, var(--ui-surface, #ffffff));\n color: var(--ui-text-muted, #64748b);\n }\n .entry-bar.info {\n background: color-mix(in srgb, var(--ui-info, #0ea5e9) 15%, var(--ui-surface, #ffffff));\n color: var(--ui-info, #0ea5e9);\n }\n .entry-bar.primary {\n background: color-mix(in srgb, var(--ui-primary, #4f46e5) 15%, var(--ui-surface, #ffffff));\n color: var(--ui-primary, #4f46e5);\n }\n .entry-bar.success {\n background: color-mix(in srgb, var(--ui-success, #16a34a) 15%, var(--ui-surface, #ffffff));\n color: var(--ui-success, #16a34a);\n }\n .entry-bar.warning {\n background: color-mix(in srgb, var(--ui-warning, #d97706) 15%, var(--ui-surface, #ffffff));\n color: var(--ui-warning, #d97706);\n }\n .entry-bar.danger {\n background: color-mix(in srgb, var(--ui-danger, #dc2626) 15%, var(--ui-surface, #ffffff));\n color: var(--ui-danger, #dc2626);\n }\n @media (forced-colors: active) {\n .entry-link:focus-visible {\n outline-color: Highlight;\n box-shadow: none;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .entry-bar {\n transition: none;\n }\n }\n slot {\n display: none;\n }\n `,\n ];\n\n /** Renders one lane's stacked all-day bars, given the entries assigned to it. */\n private _renderAllDayLane(laned: LanedEntry[], lane: number) {\n const entries = laned.filter((entry) => entry.lane === lane);\n return html`\n <div class=\"all-day-lane\">\n ${entries.map(\n (entry) => html`\n <div\n class=\"entry-bar ${entry.color}\"\n data-entry-key=${this.entryKey(entry)}\n title=${entry.href ? nothing : entry.label}\n >\n ${this.renderEntryLink(entry, entry.label)}\n <span class=\"entry-title\" aria-hidden=${entry.href ? \"true\" : nothing}>${entry.label}</span>\n </div>\n `,\n )}\n </div>\n `;\n }\n\n /** Renders a positioned/sized block for one timed entry, clamped to this day's bounds. */\n private _renderTimedEntry(entry: LanedEntry, laneCount: number, dayStart: Date, dayEnd: Date) {\n const visibleStart = entry.startDate < dayStart ? dayStart : entry.startDate;\n const visibleEnd = entry.endDate > dayEnd ? dayEnd : entry.endDate;\n const topRem = (minutesSinceMidnight(visibleStart) / 60) * HOUR_HEIGHT_REM;\n const bottomRem = (minutesSinceMidnight(visibleEnd) / 60) * HOUR_HEIGHT_REM;\n const heightRem = Math.max(bottomRem - topRem, HOUR_HEIGHT_REM / 4);\n const widthPercent = 100 / laneCount;\n const bodyText = [entry.label, ...(entry.details ?? [])].filter(Boolean).join(\"\\n\");\n return html`\n <div\n class=\"entry-bar entry-block ${entry.color}\"\n data-entry-key=${this.entryKey(entry)}\n title=${entry.href ? nothing : bodyText}\n style=\"top: ${topRem}rem; height: ${heightRem}rem; left: ${entry.lane * widthPercent}%; width: ${widthPercent}%;\"\n >\n ${this.renderEntryLink(entry, bodyText)}\n <span class=\"entry-title\" aria-hidden=${entry.href ? \"true\" : nothing}>${entry.label}</span>\n </div>\n `;\n }\n\n protected override render() {\n const day = parseIsoDate(this.date) ?? new Date();\n const dayStart = new Date(day);\n dayStart.setHours(0, 0, 0, 0);\n const dayEnd = new Date(day);\n dayEnd.setHours(23, 59, 59, 999);\n const isToday = toIsoDate(day) === toIsoDate(new Date());\n\n const resolved = this.resolveTimedEntriesFor(dayStart, dayEnd);\n const allDay = resolved.filter((entry) => entry.allDay);\n const timed = resolved.filter((entry) => !entry.allDay);\n const { entries: lanedAllDay, laneCount: allDayLaneCount } = assignLanes(allDay);\n const { entries: lanedTimed, laneCount: timedLaneCount } = assignLanes(timed);\n\n return html`\n <div class=\"day\">\n <h4 class=\"day-name ${isToday ? \"today\" : \"\"}\">\n ${monthName(day.getMonth() + 1)} ${day.getDate()}, ${day.getFullYear()}\n </h4>\n <div class=\"all-day-band ${allDay.length === 0 ? \"empty\" : \"\"}\">\n <div class=\"hour-gutter-spacer\"></div>\n <div class=\"all-day-lanes\">\n ${repeat(\n Array.from({ length: Math.max(allDayLaneCount, 1) }, (_, i) => i),\n (lane) => lane,\n (lane) => this._renderAllDayLane(lanedAllDay, lane),\n )}\n </div>\n </div>\n <div class=\"grid\">\n <div class=\"hour-gutter\">\n ${HOURS.map((h) => html`<div class=\"hour-label-cell\">${hourLabel(h)}</div>`)}\n </div>\n <div class=\"day-column ${isToday ? \"today\" : \"\"}\">\n ${HOURS.map(() => html`<div class=\"hour-line\"></div>`)}\n ${repeat(\n lanedTimed,\n (entry) => this.entryKey(entry),\n (entry) => this._renderTimedEntry(entry, Math.max(timedLaneCount, 1), dayStart, dayEnd),\n )}\n </div>\n </div>\n <slot @slotchange=${this.handleSlotChange}></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"calendar-day\": CalendarDay;\n }\n}\n"]}
1
+ {"version":3,"file":"calendar-day.js","sourceRoot":"","sources":["../src/calendar-day.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,WAAW,EACX,SAAS,EACT,oBAAoB,EACpB,SAAS,EACT,YAAY,EACZ,SAAS,GAEV,MAAM,qBAAqB,CAAC;AAE7B,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAEtC,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AACtD,MAAM,kBAAkB,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;AAEnF,yEAAyE;AACzE,SAAS,SAAS,CAAC,CAAS;IAC1B,OAAO,kBAAkB,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;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AC;+CAAoB;AAQpC;IAApD,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;6CAAe;AAElD;IAAhB,KAAK,EAAE;yCAA2B;AAfxB,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA8XvB","sourcesContent":["import { css, html, nothing } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { CalendarTimelineBase } from \"./calendar-timeline-base.js\";\nimport { iconMapPin } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\nimport {\n assignLanes,\n isWeekend,\n minutesSinceMidnight,\n monthName,\n parseIsoDate,\n toIsoDate,\n type LanedEntry,\n} from \"./utils/calendar.js\";\n\nconst NOW_MARKER_INTERVAL_MS = 60_000;\n\nconst HOUR_HEIGHT_REM = 3;\nconst HOURS = Array.from({ length: 24 }, (_, i) => i);\nconst hourLabelFormatter = new Intl.DateTimeFormat(undefined, { hour: \"numeric\" });\n\n/** Formats hour `h` (0-23) as a locale-aware hour label, e.g. \"9 AM\". */\nfunction hourLabel(h: number): string {\n return hourLabelFormatter.format(new Date(2000, 0, 1, h));\n}\n\n/**\n * A single day rendered as an hourly time grid — a Google-Calendar-style\n * view distinct from `calendar-month`'s whole-day table. Declarative\n * `calendar-entry` children with a time-of-day in `start`/`end` (e.g.\n * `start=\"2026-03-05T09:00\"`) render as positioned/sized blocks; entries\n * with only a date (no time) render in an all-day band above the grid.\n * Overlapping timed entries stack into side-by-side columns; overlapping\n * all-day/multi-day entries stack into lanes, same as `calendar-month`.\n * Read-only.\n *\n * Shares its slotted-entry observation, resolution, and hover/focus\n * interaction sync with `calendar-week` via `CalendarTimelineBase`.\n *\n * @element calendar-day\n * @slot - Declarative `calendar-entry` elements to render for this day.\n * @slot actions - Optional controls rendered beside the day name (e.g. day-navigation buttons).\n */\n@customElement(\"calendar-day\")\nexport class CalendarDay extends CalendarTimelineBase {\n /** The day shown, `\"YYYY-MM-DD\"`. */\n @property({ reflect: true }) date: string = toIsoDate(new Date());\n\n /** Shows a fine live line marking the current time, Google-Calendar-style. Only rendered when `date` is today. */\n @property({ type: Boolean, reflect: true, attribute: \"time-marker\" }) timeMarker = false;\n\n /**\n * Minimum width for the day column, as a CSS length (e.g. `\"18rem\"`).\n * Unset leaves the host's width fully controlled by its container —\n * useful as the sizing floor when placing several `calendar-day`\n * elements in a scrollable row.\n */\n @property({ reflect: true, attribute: \"min-width\" }) minWidth = \"\";\n\n @state() private _now = Date.now();\n\n private _nowTimer: ReturnType<typeof setInterval> | null = null;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n min-width: var(--calendar-day-min-width, 0);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size-sm, 0.75rem);\n }\n .day-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n margin-bottom: 0.5rem;\n }\n .day-name {\n margin: 0;\n min-width: 0;\n color: var(--ui-text, #0f172a);\n font-size: var(--ui-font-size-lg, 1rem);\n font-weight: var(--ui-font-weight-semibold, 600);\n line-height: var(--ui-line-height-tight, 1.25);\n }\n .day-name.weekend {\n color: var(--ui-text-muted, #64748b);\n }\n .day-name.today {\n color: var(--ui-primary, #4f46e5);\n }\n .actions {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n gap: 0.5rem;\n }\n .all-day-band {\n display: flex;\n margin-bottom: 0.5rem;\n }\n .all-day-band.empty {\n display: none;\n }\n .hour-gutter-spacer {\n flex: 0 0 3rem;\n }\n .all-day-lanes {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n gap: 0.25rem;\n }\n .all-day-lane {\n display: flex;\n gap: 0.25rem;\n }\n .grid {\n display: flex;\n border-top: 1px solid var(--ui-border, #e2e8f0);\n }\n .hour-gutter {\n flex: 0 0 3rem;\n }\n .hour-label-cell {\n box-sizing: border-box;\n height: ${HOUR_HEIGHT_REM}rem;\n padding-right: 0.5rem;\n border-bottom: 1px solid var(--ui-border, #e2e8f0);\n color: var(--ui-text-muted, #64748b);\n font-variant-numeric: tabular-nums;\n text-align: right;\n white-space: nowrap;\n }\n .day-column {\n position: relative;\n flex: 1 1 auto;\n height: ${HOUR_HEIGHT_REM * 24}rem;\n }\n .day-column.weekend {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .day-column.today {\n background: color-mix(in srgb, var(--ui-primary, #4f46e5) 6%, transparent);\n }\n .now-line {\n position: absolute;\n left: 0;\n right: 0;\n height: 2px;\n background: var(--ui-danger, #dc2626);\n pointer-events: none;\n z-index: 2;\n }\n .now-line::before {\n content: \"\";\n position: absolute;\n top: 50%;\n left: -3px;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--ui-danger, #dc2626);\n transform: translateY(-50%);\n }\n .hour-line {\n box-sizing: border-box;\n height: ${HOUR_HEIGHT_REM}rem;\n border-bottom: 1px solid var(--ui-border, #e2e8f0);\n }\n .entry-bar {\n position: relative;\n box-sizing: border-box;\n flex: 1 1 auto;\n overflow: hidden;\n border-radius: var(--ui-radius-sm, 0.25rem);\n padding: 0.25rem 0.5rem;\n transition: box-shadow 120ms ease;\n }\n .entry-bar.entry-block {\n position: absolute;\n }\n .entry-bar.entry-hovered,\n .entry-bar.entry-focused {\n box-shadow: inset 0 0 0 100vmax var(--ui-hover-overlay, rgb(255 255 255 / 0.32));\n }\n .entry-title {\n display: block;\n overflow: hidden;\n font-weight: var(--ui-font-weight-medium, 500);\n white-space: nowrap;\n text-overflow: ellipsis;\n pointer-events: none;\n }\n .entry-location {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n overflow: hidden;\n color: inherit;\n font-size: var(--ui-font-size-xs, 0.6875rem);\n font-weight: var(--ui-font-weight-regular, 400);\n white-space: nowrap;\n text-overflow: ellipsis;\n pointer-events: none;\n }\n .entry-location svg {\n flex: 0 0 auto;\n }\n .entry-link {\n position: absolute;\n z-index: 1;\n inset: 0;\n border-radius: inherit;\n color: inherit;\n cursor: pointer;\n text-decoration: none;\n }\n .entry-link:focus-visible {\n outline: 2px solid var(--ui-primary, #4f46e5);\n outline-offset: -2px;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35)) inset;\n }\n .entry-bar.neutral {\n background: color-mix(in srgb, var(--ui-text-muted, #64748b) 15%, var(--ui-surface, #ffffff));\n color: var(--ui-text-muted, #64748b);\n }\n .entry-bar.info {\n background: color-mix(in srgb, var(--ui-info, #0ea5e9) 15%, var(--ui-surface, #ffffff));\n color: var(--ui-info, #0ea5e9);\n }\n .entry-bar.primary {\n background: color-mix(in srgb, var(--ui-primary, #4f46e5) 15%, var(--ui-surface, #ffffff));\n color: var(--ui-primary, #4f46e5);\n }\n .entry-bar.success {\n background: color-mix(in srgb, var(--ui-success, #16a34a) 15%, var(--ui-surface, #ffffff));\n color: var(--ui-success, #16a34a);\n }\n .entry-bar.warning {\n background: color-mix(in srgb, var(--ui-warning, #d97706) 15%, var(--ui-surface, #ffffff));\n color: var(--ui-warning, #d97706);\n }\n .entry-bar.danger {\n background: color-mix(in srgb, var(--ui-danger, #dc2626) 15%, var(--ui-surface, #ffffff));\n color: var(--ui-danger, #dc2626);\n }\n @media (forced-colors: active) {\n .entry-link:focus-visible {\n outline-color: Highlight;\n box-shadow: none;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .entry-bar {\n transition: none;\n }\n }\n slot:not([name]) {\n display: none;\n }\n `,\n ];\n\n /** Starts the current-time ticker if `time-marker` is already set on connect. */\n override connectedCallback(): void {\n super.connectedCallback();\n this._syncNowTimer();\n }\n\n /** Stops the current-time ticker when this element disconnects. */\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this._nowTimer != null) clearInterval(this._nowTimer);\n this._nowTimer = null;\n }\n\n /** Starts/stops the current-time ticker and re-syncs the min-width host style to match the latest properties. */\n protected override updated(): void {\n super.updated();\n this._syncNowTimer();\n this._syncMinWidth();\n }\n\n /** Ensures a 60s current-time ticker is running only while `timeMarker` is enabled. */\n private _syncNowTimer(): void {\n if (this.timeMarker && this._nowTimer == null) {\n this._now = Date.now();\n this._nowTimer = setInterval(() => {\n this._now = Date.now();\n }, NOW_MARKER_INTERVAL_MS);\n } else if (!this.timeMarker && this._nowTimer != null) {\n clearInterval(this._nowTimer);\n this._nowTimer = null;\n }\n }\n\n /** Reflects `minWidth` onto the `--calendar-day-min-width` custom property the host's own styles read. */\n private _syncMinWidth(): void {\n if (this.minWidth) {\n this.style.setProperty(\"--calendar-day-min-width\", this.minWidth);\n } else {\n this.style.removeProperty(\"--calendar-day-min-width\");\n }\n }\n\n /** Renders one lane's stacked all-day bars, given the entries assigned to it. */\n private _renderAllDayLane(laned: LanedEntry[], lane: number) {\n const entries = laned.filter((entry) => entry.lane === lane);\n return html`\n <div class=\"all-day-lane\">\n ${entries.map((entry) => {\n const bodyText = [entry.label, entry.location].filter(Boolean).join(\" · \");\n return html`\n <div\n class=\"entry-bar ${entry.color}\"\n data-entry-key=${this.entryKey(entry)}\n title=${entry.href ? nothing : bodyText}\n >\n ${this.renderEntryLink(entry, bodyText)}\n <span class=\"entry-title\" aria-hidden=${entry.href ? \"true\" : nothing}>${entry.label}</span>\n ${entry.location\n ? html`<span class=\"entry-location\" aria-hidden=${entry.href ? \"true\" : nothing}\n >${iconMapPin(14)}${entry.location}</span\n >`\n : nothing}\n </div>\n `;\n })}\n </div>\n `;\n }\n\n /** Renders a positioned/sized block for one timed entry, clamped to this day's bounds. */\n private _renderTimedEntry(entry: LanedEntry, laneCount: number, dayStart: Date, dayEnd: Date) {\n const visibleStart = entry.startDate < dayStart ? dayStart : entry.startDate;\n const visibleEnd = entry.endDate > dayEnd ? dayEnd : entry.endDate;\n const topRem = (minutesSinceMidnight(visibleStart) / 60) * HOUR_HEIGHT_REM;\n const bottomRem = (minutesSinceMidnight(visibleEnd) / 60) * HOUR_HEIGHT_REM;\n const heightRem = Math.max(bottomRem - topRem, HOUR_HEIGHT_REM / 4);\n const widthPercent = 100 / laneCount;\n const bodyText = [entry.label, ...(entry.details ?? []), entry.location].filter(Boolean).join(\"\\n\");\n return html`\n <div\n class=\"entry-bar entry-block ${entry.color}\"\n data-entry-key=${this.entryKey(entry)}\n title=${entry.href ? nothing : bodyText}\n style=\"top: ${topRem}rem; height: ${heightRem}rem; left: ${entry.lane * widthPercent}%; width: ${widthPercent}%;\"\n >\n ${this.renderEntryLink(entry, bodyText)}\n <span class=\"entry-title\" aria-hidden=${entry.href ? \"true\" : nothing}>${entry.label}</span>\n ${entry.location\n ? html`<span class=\"entry-location\" aria-hidden=${entry.href ? \"true\" : nothing}\n >${iconMapPin(14)}${entry.location}</span\n >`\n : nothing}\n </div>\n `;\n }\n\n protected override render() {\n const day = parseIsoDate(this.date) ?? new Date();\n const dayStart = new Date(day);\n dayStart.setHours(0, 0, 0, 0);\n const dayEnd = new Date(day);\n dayEnd.setHours(23, 59, 59, 999);\n const isToday = toIsoDate(day) === toIsoDate(new Date());\n const isWeekendDay = isWeekend(day);\n\n const resolved = this.resolveTimedEntriesFor(dayStart, dayEnd);\n const allDay = resolved.filter((entry) => entry.allDay);\n const timed = resolved.filter((entry) => !entry.allDay);\n const { entries: lanedAllDay, laneCount: allDayLaneCount } = assignLanes(allDay);\n const { entries: lanedTimed, laneCount: timedLaneCount } = assignLanes(timed);\n const nowTopRem =\n this.timeMarker && isToday ? (minutesSinceMidnight(new Date(this._now)) / 60) * HOUR_HEIGHT_REM : null;\n\n return html`\n <div class=\"day\">\n <div class=\"day-header\">\n <h4 class=\"day-name ${isWeekendDay ? \"weekend\" : \"\"} ${isToday ? \"today\" : \"\"}\">\n ${monthName(day.getMonth() + 1)} ${day.getDate()}, ${day.getFullYear()}\n </h4>\n <div class=\"actions\"><slot name=\"actions\"></slot></div>\n </div>\n <div class=\"all-day-band ${allDay.length === 0 ? \"empty\" : \"\"}\">\n <div class=\"hour-gutter-spacer\"></div>\n <div class=\"all-day-lanes\">\n ${repeat(\n Array.from({ length: Math.max(allDayLaneCount, 1) }, (_, i) => i),\n (lane) => lane,\n (lane) => this._renderAllDayLane(lanedAllDay, lane),\n )}\n </div>\n </div>\n <div class=\"grid\">\n <div class=\"hour-gutter\">\n ${HOURS.map((h) => html`<div class=\"hour-label-cell\">${hourLabel(h)}</div>`)}\n </div>\n <div class=\"day-column ${isWeekendDay ? \"weekend\" : \"\"} ${isToday ? \"today\" : \"\"}\">\n ${HOURS.map(() => html`<div class=\"hour-line\"></div>`)}\n ${repeat(\n lanedTimed,\n (entry) => this.entryKey(entry),\n (entry) => this._renderTimedEntry(entry, Math.max(timedLaneCount, 1), dayStart, dayEnd),\n )}\n ${nowTopRem !== null\n ? html`<div class=\"now-line\" style=\"top: ${nowTopRem}rem\" aria-hidden=\"true\"></div>`\n : nothing}\n </div>\n </div>\n <slot @slotchange=${this.handleSlotChange}></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"calendar-day\": CalendarDay;\n }\n}\n"]}
@@ -9,6 +9,7 @@ import type { StatusPillColor } from "./status-pill.js";
9
9
  * @slot title - Plain-text title shown instead of the `label` fallback.
10
10
  * @slot detail - Repeatable plain-text details rendered inside the shared body spanning all remaining days.
11
11
  * @slot footer - Plain-text ending note pinned to the bottom of the shared body.
12
+ * @slot location - Plain-text location, shown on its own line with a leading marker icon.
12
13
  */
13
14
  export declare class CalendarEntry extends LitElement {
14
15
  /** Inclusive start date, `"YYYY-MM-DD"`. */
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-entry.d.ts","sourceRoot":"","sources":["../src/calendar-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD;;;;;;;;;GASG;AACH,qBACa,aAAc,SAAQ,UAAU;IAC3C,4CAA4C;IACf,KAAK,SAAM;IAExC,+FAA+F;IAClE,GAAG,SAAM;IAEtC,4DAA4D;IAC/B,KAAK,SAAM;IAExC,sDAAsD;IACzB,KAAK,EAAE,eAAe,CAAa;IAEhE,+EAA+E;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IAE3C,OAAgB,MAAM,4BAOpB;IAEF,6FAA6F;IAC7F,UAAmB,MAAM,yCAExB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAC;KACjC;CACF"}
1
+ {"version":3,"file":"calendar-entry.d.ts","sourceRoot":"","sources":["../src/calendar-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD;;;;;;;;;;GAUG;AACH,qBACa,aAAc,SAAQ,UAAU;IAC3C,4CAA4C;IACf,KAAK,SAAM;IAExC,+FAA+F;IAClE,GAAG,SAAM;IAEtC,4DAA4D;IAC/B,KAAK,SAAM;IAExC,sDAAsD;IACzB,KAAK,EAAE,eAAe,CAAa;IAEhE,+EAA+E;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IAE3C,OAAgB,MAAM,4BAOpB;IAEF,6FAA6F;IAC7F,UAAmB,MAAM,yCAExB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAC;KACjC;CACF"}
@@ -16,6 +16,7 @@ import { tokens } from "./tokens.js";
16
16
  * @slot title - Plain-text title shown instead of the `label` fallback.
17
17
  * @slot detail - Repeatable plain-text details rendered inside the shared body spanning all remaining days.
18
18
  * @slot footer - Plain-text ending note pinned to the bottom of the shared body.
19
+ * @slot location - Plain-text location, shown on its own line with a leading marker icon.
19
20
  */
20
21
  let CalendarEntry = class CalendarEntry extends LitElement {
21
22
  constructor() {
@@ -39,7 +40,7 @@ let CalendarEntry = class CalendarEntry extends LitElement {
39
40
  ]; }
40
41
  /** Keeps the metadata host hidden while exposing named text slots to the parent calendar. */
41
42
  render() {
42
- return html `<slot name="title"></slot><slot name="detail"></slot><slot name="footer"></slot>`;
43
+ return html `<slot name="title"></slot><slot name="detail"></slot><slot name="footer"></slot><slot name="location"></slot>`;
43
44
  }
44
45
  };
45
46
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-entry.js","sourceRoot":"","sources":["../src/calendar-entry.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;;;;GASG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QACL,4CAA4C;QACf,UAAK,GAAG,EAAE,CAAC;QAExC,+FAA+F;QAClE,QAAG,GAAG,EAAE,CAAC;QAEtC,4DAA4D;QAC/B,UAAK,GAAG,EAAE,CAAC;QAExC,sDAAsD;QACzB,UAAK,GAAoB,SAAS,CAAC;IAkBlE,CAAC;aAbiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;KAIF;KACF,AAPqB,CAOpB;IAEF,6FAA6F;IAC1E,MAAM;QACvB,OAAO,IAAI,CAAA,kFAAkF,CAAC;IAChG,CAAC;CACF,CAAA;AA3B8B;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAY;AAGX;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAAU;AAGT;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAY;AAGX;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAoC;AAGnC;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAe;AAdhC,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CA6BzB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport type { StatusPillColor } from \"./status-pill.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * Declarative metadata for one calendar event, consumed by a parent\n * `calendar-month` or `calendar-year`. Read-only/non-interactive; renders\n * nothing itself.\n *\n * @element calendar-entry\n * @slot title - Plain-text title shown instead of the `label` fallback.\n * @slot detail - Repeatable plain-text details rendered inside the shared body spanning all remaining days.\n * @slot footer - Plain-text ending note pinned to the bottom of the shared body.\n */\n@customElement(\"calendar-entry\")\nexport class CalendarEntry extends LitElement {\n /** Inclusive start date, `\"YYYY-MM-DD\"`. */\n @property({ reflect: true }) start = \"\";\n\n /** Inclusive end date, `\"YYYY-MM-DD\"`. Falls back to `start` when unset (single-day entry). */\n @property({ reflect: true }) end = \"\";\n\n /** Fallback title used when no `title` slot is provided. */\n @property({ reflect: true }) label = \"\";\n\n /** Color variant, reusing `status-pill`'s palette. */\n @property({ reflect: true }) color: StatusPillColor = \"neutral\";\n\n /** Optional link target; the parent renders the entry as an `<a>` when set. */\n @property({ reflect: true }) href?: string;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: none;\n }\n `,\n ];\n\n /** Keeps the metadata host hidden while exposing named text slots to the parent calendar. */\n protected override render() {\n return html`<slot name=\"title\"></slot><slot name=\"detail\"></slot><slot name=\"footer\"></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"calendar-entry\": CalendarEntry;\n }\n}\n"]}
1
+ {"version":3,"file":"calendar-entry.js","sourceRoot":"","sources":["../src/calendar-entry.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;;;;;GAUG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QACL,4CAA4C;QACf,UAAK,GAAG,EAAE,CAAC;QAExC,+FAA+F;QAClE,QAAG,GAAG,EAAE,CAAC;QAEtC,4DAA4D;QAC/B,UAAK,GAAG,EAAE,CAAC;QAExC,sDAAsD;QACzB,UAAK,GAAoB,SAAS,CAAC;IAkBlE,CAAC;aAbiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;KAIF;KACF,AAPqB,CAOpB;IAEF,6FAA6F;IAC1E,MAAM;QACvB,OAAO,IAAI,CAAA,+GAA+G,CAAC;IAC7H,CAAC;CACF,CAAA;AA3B8B;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAY;AAGX;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAAU;AAGT;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAY;AAGX;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAoC;AAGnC;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAe;AAdhC,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CA6BzB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport type { StatusPillColor } from \"./status-pill.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * Declarative metadata for one calendar event, consumed by a parent\n * `calendar-month` or `calendar-year`. Read-only/non-interactive; renders\n * nothing itself.\n *\n * @element calendar-entry\n * @slot title - Plain-text title shown instead of the `label` fallback.\n * @slot detail - Repeatable plain-text details rendered inside the shared body spanning all remaining days.\n * @slot footer - Plain-text ending note pinned to the bottom of the shared body.\n * @slot location - Plain-text location, shown on its own line with a leading marker icon.\n */\n@customElement(\"calendar-entry\")\nexport class CalendarEntry extends LitElement {\n /** Inclusive start date, `\"YYYY-MM-DD\"`. */\n @property({ reflect: true }) start = \"\";\n\n /** Inclusive end date, `\"YYYY-MM-DD\"`. Falls back to `start` when unset (single-day entry). */\n @property({ reflect: true }) end = \"\";\n\n /** Fallback title used when no `title` slot is provided. */\n @property({ reflect: true }) label = \"\";\n\n /** Color variant, reusing `status-pill`'s palette. */\n @property({ reflect: true }) color: StatusPillColor = \"neutral\";\n\n /** Optional link target; the parent renders the entry as an `<a>` when set. */\n @property({ reflect: true }) href?: string;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: none;\n }\n `,\n ];\n\n /** Keeps the metadata host hidden while exposing named text slots to the parent calendar. */\n protected override render() {\n return html`<slot name=\"title\"></slot><slot name=\"detail\"></slot><slot name=\"footer\"></slot><slot name=\"location\"></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"calendar-entry\": CalendarEntry;\n }\n}\n"]}