@f-ewald/components 1.27.2 → 1.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/custom-elements.json +109 -9
  2. package/dist/calendar-day.d.ts +21 -0
  3. package/dist/calendar-day.d.ts.map +1 -1
  4. package/dist/calendar-day.js +131 -9
  5. package/dist/calendar-day.js.map +1 -1
  6. package/dist/calendar-entry.d.ts +1 -0
  7. package/dist/calendar-entry.d.ts.map +1 -1
  8. package/dist/calendar-entry.js +2 -1
  9. package/dist/calendar-entry.js.map +1 -1
  10. package/dist/calendar-month.d.ts +3 -3
  11. package/dist/calendar-month.d.ts.map +1 -1
  12. package/dist/calendar-month.js +40 -7
  13. package/dist/calendar-month.js.map +1 -1
  14. package/dist/calendar-week.d.ts.map +1 -1
  15. package/dist/calendar-week.js +30 -3
  16. package/dist/calendar-week.js.map +1 -1
  17. package/dist/icons.d.ts +1 -1
  18. package/dist/icons.d.ts.map +1 -1
  19. package/dist/icons.js +1 -1
  20. package/dist/icons.js.map +1 -1
  21. package/dist/percent-bar-chart.d.ts.map +1 -1
  22. package/dist/percent-bar-chart.js +9 -2
  23. package/dist/percent-bar-chart.js.map +1 -1
  24. package/dist/radio-cards.d.ts +5 -1
  25. package/dist/radio-cards.d.ts.map +1 -1
  26. package/dist/radio-cards.js +19 -2
  27. package/dist/radio-cards.js.map +1 -1
  28. package/dist/scroll-to-bottom.d.ts +6 -0
  29. package/dist/scroll-to-bottom.d.ts.map +1 -1
  30. package/dist/scroll-to-bottom.js +31 -7
  31. package/dist/scroll-to-bottom.js.map +1 -1
  32. package/dist/scroll-to-top.d.ts +6 -0
  33. package/dist/scroll-to-top.d.ts.map +1 -1
  34. package/dist/scroll-to-top.js +31 -7
  35. package/dist/scroll-to-top.js.map +1 -1
  36. package/dist/tokens.css +4 -0
  37. package/dist/tokens.d.ts.map +1 -1
  38. package/dist/tokens.js +11 -0
  39. package/dist/tokens.js.map +1 -1
  40. package/dist/ui-button.d.ts +24 -0
  41. package/dist/ui-button.d.ts.map +1 -1
  42. package/dist/ui-button.js +122 -1
  43. package/dist/ui-button.js.map +1 -1
  44. package/dist/utils/calendar.d.ts +1 -0
  45. package/dist/utils/calendar.d.ts.map +1 -1
  46. package/dist/utils/calendar.js +2 -0
  47. package/dist/utils/calendar.js.map +1 -1
  48. package/dist/weight-bar-chart.js +2 -2
  49. package/dist/weight-bar-chart.js.map +1 -1
  50. package/docs/calendar-day.md +7 -1
  51. package/docs/calendar-entry.md +2 -0
  52. package/docs/calendar-month.md +3 -0
  53. package/docs/calendar-week.md +5 -1
  54. package/docs/design-language.md +19 -0
  55. package/docs/icons.md +1 -1
  56. package/docs/radio-cards.md +6 -1
  57. package/docs/scroll-to-bottom.md +15 -0
  58. package/docs/scroll-to-top.md +15 -0
  59. package/docs/ui-button.md +28 -0
  60. package/docs/weight-bar-chart.md +1 -0
  61. package/llms.txt +59 -13
  62. package/package.json +1 -1
@@ -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,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ACF,CAAA;AAxQ8B;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAsC;AAFvD,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA0QvB","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 * @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 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-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.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.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:not([name]) {\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 <div class=\"day-header\">\n <h4 class=\"day-name ${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 ${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,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CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;cAC5E,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;cACC,SAAS,KAAK,IAAI;YAClB,CAAC,CAAC,IAAI,CAAA,qCAAqC,SAAS,gCAAgC;YACpF,CAAC,CAAC,OAAO;;;4BAGK,IAAI,CAAC,gBAAgB;;KAE5C,CAAC;IACJ,CAAC;CACF,CAAA;AA5X8B;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAsC;AAGI;IAArE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;+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"]}
@@ -50,11 +50,11 @@ export declare class CalendarMonth extends LitElement {
50
50
  private _syncEntryInteractions;
51
51
  /** Renders a transparent full-cell link without wrapping the visible text. */
52
52
  private _renderEntryLink;
53
- /** Joins the event title, details, and visible footer for tooltips and accessible link names. */
53
+ /** Joins the event title, location, details, and visible footer for tooltips and accessible link names. */
54
54
  private _entryBodyText;
55
- /** Renders the shared details body, with the footer reserved at its bottom edge. */
55
+ /** Renders the shared details body, with the location pinned at the top and the footer reserved at the bottom. */
56
56
  private _renderEntryBody;
57
- /** Renders a row-spanning body cell with whole-line detail and footer budgets. */
57
+ /** Renders a row-spanning body cell with whole-line location, detail, and footer budgets. */
58
58
  private _renderEntryBodyCell;
59
59
  /** Renders a lane's title/body cell, skips rows covered by a body rowspan, or emits an empty spacer. */
60
60
  private _renderLaneCell;
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-month.d.ts","sourceRoot":"","sources":["../src/calendar-month.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAoBrD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBACa,aAAc,SAAQ,UAAU;IAC3C,kCAAkC;IACS,IAAI,EAAE,MAAM,CAA4B;IAEnF,0CAA0C;IACC,KAAK,SAAK;IAGrD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAmB;IAElD,2FAA2F;IAClF,OAAO,CAAC,eAAe,CAAK;IAErC,OAAO,CAAC,gBAAgB,CAAC,CAAmB;I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,CAWjC;IAED,+DAA+D;IACtD,oBAAoB,IAAI,IAAI,CAGpC;IAED,wFAAwF;IACxF,UAAmB,OAAO,IAAI,IAAI,CAEjC;IAED,kFAAkF;IAClF,OAAO,CAAC,iBAAiB;IAIzB,sEAAsE;IACtE,OAAO,CAAC,SAAS;IAIjB,8EAA8E;IAC9E,OAAO,CAAC,aAAa;IASrB,oEAAoE;IACpE,OAAO,CAAC,SAAS;IAIjB,kFAAkF;IAClF,OAAO,CAAC,oBAAoB;IAQ5B,uFAAuF;IACvF,OAAO,CAAC,sBAAsB;IAa9B,8EAA8E;IAC9E,OAAO,CAAC,gBAAgB;IAgBxB,2GAA2G;IAC3G,OAAO,CAAC,cAAc;IAMtB,kHAAkH;IAClH,OAAO,CAAC,gBAAgB;IAoCxB,6FAA6F;IAC7F,OAAO,CAAC,oBAAoB;IAuB5B,wGAAwG;IACxG,OAAO,CAAC,eAAe;IAoDvB,UAAmB,MAAM,yCA4CxB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAC;KACjC;CACF"}
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { LitElement, css, html, nothing } from "lit";
8
8
  import { customElement, property, queryAssignedElements, state } from "lit/decorators.js";
9
9
  import { repeat } from "lit/directives/repeat.js";
10
+ import { iconMapPin } from "./icons.js";
10
11
  import { tokens } from "./tokens.js";
11
12
  import { CALENDAR_ENTRY_ATTRIBUTES, WEEKDAY_ABBR, assignLanes, daysInMonth, isWeekend, monthName, overlapsRange, readCalendarEntryElement, resolveEntry, toIsoDate, } from "./utils/calendar.js";
12
13
  /**
@@ -183,6 +184,28 @@ let CalendarMonth = class CalendarMonth extends LitElement {
183
184
  white-space: nowrap;
184
185
  text-overflow: ellipsis;
185
186
  }
187
+ .entry-location {
188
+ display: flex;
189
+ align-items: center;
190
+ gap: 0.25rem;
191
+ box-sizing: border-box;
192
+ overflow: hidden;
193
+ color: inherit;
194
+ font-size: var(--ui-font-size-xs, 0.6875rem);
195
+ font-weight: var(--ui-font-weight-regular, 400);
196
+ white-space: nowrap;
197
+ text-overflow: ellipsis;
198
+ pointer-events: none;
199
+ }
200
+ .entry-location svg {
201
+ flex: 0 0 auto;
202
+ }
203
+ .entry-title-cell .entry-location {
204
+ padding: 0 0.5rem 0.25rem;
205
+ }
206
+ .entry-body .entry-location {
207
+ margin-bottom: 0.25rem;
208
+ }
186
209
  .entry-details {
187
210
  display: -webkit-box;
188
211
  min-height: 0;
@@ -344,13 +367,13 @@ let CalendarMonth = class CalendarMonth extends LitElement {
344
367
  ></a>`
345
368
  : nothing;
346
369
  }
347
- /** Joins the event title, details, and visible footer for tooltips and accessible link names. */
370
+ /** Joins the event title, location, details, and visible footer for tooltips and accessible link names. */
348
371
  _entryBodyText(entry, showFooter) {
349
- return [entry.label, ...(entry.details ?? []), showFooter ? entry.footer : undefined]
372
+ return [entry.label, entry.location, ...(entry.details ?? []), showFooter ? entry.footer : undefined]
350
373
  .filter((line) => Boolean(line))
351
374
  .join("\n");
352
375
  }
353
- /** Renders the shared details body, with the footer reserved at its bottom edge. */
376
+ /** Renders the shared details body, with the location pinned at the top and the footer reserved at the bottom. */
354
377
  _renderEntryBody(entry, showFooter, detailLineClamp, showTitleFallback = false) {
355
378
  const sourceDetails = entry.details ?? [];
356
379
  const footer = showFooter ? entry.footer : undefined;
@@ -361,6 +384,9 @@ let CalendarMonth = class CalendarMonth extends LitElement {
361
384
  return html `
362
385
  ${this._renderEntryLink(entry, bodyText)}
363
386
  <div class="entry-body" aria-hidden=${entry.href ? "true" : nothing}>
387
+ ${entry.location
388
+ ? html `<div class="entry-location">${iconMapPin(14)}${entry.location}</div>`
389
+ : nothing}
364
390
  ${detailLineClamp > 0 && details.length > 0
365
391
  ? html `
366
392
  <div
@@ -375,11 +401,12 @@ let CalendarMonth = class CalendarMonth extends LitElement {
375
401
  </div>
376
402
  `;
377
403
  }
378
- /** Renders a row-spanning body cell with whole-line detail and footer budgets. */
404
+ /** Renders a row-spanning body cell with whole-line location, detail, and footer budgets. */
379
405
  _renderEntryBodyCell(entry, bodyRows, reachesEventEnd, showTitleFallback = false) {
380
406
  const segmentClass = reachesEventEnd ? "segment-end" : "segment-middle";
381
407
  const footerLineBudget = reachesEventEnd && entry.footer ? 1 : 0;
382
- const detailLineClamp = Math.max(0, bodyRows - footerLineBudget);
408
+ const locationLineBudget = entry.location ? 1 : 0;
409
+ const detailLineClamp = Math.max(0, bodyRows - footerLineBudget - locationLineBudget);
383
410
  const bodyText = this._entryBodyText(entry, reachesEventEnd);
384
411
  return html `
385
412
  <td
@@ -416,16 +443,22 @@ let CalendarMonth = class CalendarMonth extends LitElement {
416
443
  const reachesEventEnd = lastVisibleDay.getTime() === entry.endDate.getTime();
417
444
  return this._renderEntryBodyCell(entry, bodyRows, reachesEventEnd);
418
445
  }
446
+ const bodyText = [entry.label, entry.location].filter(Boolean).join(" · ");
419
447
  return html `
420
448
  <td
421
449
  class="lane-cell entry-bar entry-title-cell ${entry.color} ${this._segmentClass(entry, date)}"
422
450
  data-entry-key=${this._entryKey(entry)}
423
- title=${entry.href ? nothing : entry.label}
451
+ title=${entry.href ? nothing : bodyText}
424
452
  >
425
- ${this._renderEntryLink(entry, entry.label)}
453
+ ${this._renderEntryLink(entry, bodyText)}
426
454
  <span class="entry-line entry-title" aria-hidden=${entry.href ? "true" : nothing}>
427
455
  ${entry.label}
428
456
  </span>
457
+ ${entry.location
458
+ ? html `<span class="entry-line entry-location" aria-hidden=${entry.href ? "true" : nothing}
459
+ >${iconMapPin(14)}${entry.location}</span
460
+ >`
461
+ : nothing}
429
462
  </td>
430
463
  `;
431
464
  }
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-month.js","sourceRoot":"","sources":["../src/calendar-month.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAA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AG,SAAS,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7D,OAAO,IAAI,CAAA;uCACY,UAAU,IAAI,QAAQ;6CAChB,CAAC;8CACA,YAAY,CAAC,GAAG,CAAC;sBACzC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;;iBAEvF,CAAC;QACJ,CAAC,CACF;;;4BAGe,IAAI,CAAC,iBAAiB;;KAE7C,CAAC;IACJ,CAAC;CACF,CAAA;AAje4C;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAyC;AAGxC;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAW;AAGpC;IADhB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;qDACJ;AAGjC;IAAhB,KAAK,EAAE;sDAA6B;AAX1B,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CAmezB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property, queryAssignedElements, state } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { CalendarEntry } from \"./calendar-entry.js\";\nimport { tokens } from \"./tokens.js\";\nimport {\n CALENDAR_ENTRY_ATTRIBUTES,\n WEEKDAY_ABBR,\n assignLanes,\n daysInMonth,\n isWeekend,\n monthName,\n overlapsRange,\n readCalendarEntryElement,\n resolveEntry,\n toIsoDate,\n type LanedEntry,\n type ResolvedCalendarEntry,\n} from \"./utils/calendar.js\";\n\n/**\n * One month rendered as a top-to-bottom list of days — weekends and today\n * highlighted, with declarative `calendar-entry` children shown as colored\n * bars spanning the days they cover. An entry's title uses its first visible\n * day; every remaining visible day becomes one shared body for wrapped\n * details and an optional ending footer. Overlapping entries stack into\n * side-by-side lanes rather than being layered/hidden. Read-only.\n *\n * Lanes are computed independently per instance, from only the entries\n * overlapping this month — an entry spanning a month boundary may therefore\n * land in a different lane index in the adjacent month's `calendar-month`.\n * This is an accepted v1 limitation: cross-month lane continuity would\n * require a shared parent (`calendar-year`) to assign lanes globally.\n *\n * Entry attributes and slotted title/detail text are observed, so a\n * standalone month re-renders when consumers update declarative metadata.\n *\n * @element calendar-month\n * @slot - Declarative `calendar-entry` elements to render for this month.\n * @slot actions - Optional controls rendered beside the month name (e.g. month-navigation buttons).\n */\n@customElement(\"calendar-month\")\nexport class CalendarMonth extends LitElement {\n /** Calendar year, e.g. `2026`. */\n @property({ type: Number, reflect: true }) year: number = new Date().getFullYear();\n\n /** Calendar month, 1-12 (January = 1). */\n @property({ type: Number, reflect: true }) month = 1;\n\n @queryAssignedElements({ selector: \"calendar-entry\" })\n private readonly _entryElements!: CalendarEntry[];\n\n /** Bumped when entry elements, attributes, or slotted text change to force a re-render. */\n @state() private _entriesVersion = 0;\n\n private _entriesObserver?: MutationObserver;\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 .month-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n margin-bottom: 0.5rem;\n }\n .month-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 .actions {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n gap: 0.5rem;\n }\n table {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n }\n .day-row td {\n padding: 0.25rem 0.5rem;\n border-bottom: 1px solid var(--ui-border, #e2e8f0);\n }\n .day-row.weekend {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .day-row.today {\n background: color-mix(in srgb, var(--ui-primary, #4f46e5) 10%, transparent);\n }\n .day-number {\n width: 1.5rem;\n color: var(--ui-text-muted, #64748b);\n font-variant-numeric: tabular-nums;\n text-align: right;\n white-space: nowrap;\n }\n .day-row.today .day-number {\n color: var(--ui-primary, #4f46e5);\n font-weight: var(--ui-font-weight-bold, 700);\n }\n .day-weekday {\n width: 2.25rem;\n color: var(--ui-text-muted, #64748b);\n white-space: nowrap;\n }\n .day-row.today .day-weekday {\n color: var(--ui-primary, #4f46e5);\n font-weight: var(--ui-font-weight-semibold, 600);\n }\n .day-row.weekend .day-weekday {\n font-weight: var(--ui-font-weight-semibold, 600);\n }\n .lane-cell {\n padding: 0.25rem 0.5rem;\n }\n .entry-bar {\n border-radius: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: box-shadow 120ms ease;\n white-space: nowrap;\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-bar.segment-single {\n border-radius: var(--ui-radius-sm, 0.25rem);\n }\n .entry-bar.segment-start {\n border-radius: var(--ui-radius-sm, 0.25rem) var(--ui-radius-sm, 0.25rem) 0 0;\n }\n .entry-bar.segment-end {\n border-radius: 0 0 var(--ui-radius-sm, 0.25rem) var(--ui-radius-sm, 0.25rem);\n }\n .entry-bar.segment-start,\n .entry-bar.segment-middle {\n border-bottom: 0;\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 .entry-line {\n display: block;\n overflow: hidden;\n }\n .day-row td.entry-title-cell {\n position: relative;\n padding: 0;\n }\n .entry-title {\n box-sizing: border-box;\n font-weight: var(--ui-font-weight-medium, 500);\n padding: 0.25rem 0.5rem;\n pointer-events: none;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n .entry-details {\n display: -webkit-box;\n min-height: 0;\n max-height: var(--entry-detail-max-height, 1.15em);\n flex: 0 0 auto;\n overflow: hidden;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: var(--entry-detail-lines, 1);\n font-size: var(--ui-font-size-xs, 0.6875rem);\n font-weight: var(--ui-font-weight-regular, 400);\n line-height: 1.15;\n overflow-wrap: anywhere;\n text-overflow: ellipsis;\n white-space: normal;\n }\n .entry-detail {\n min-height: 1.15em;\n }\n .day-row td.entry-body-cell {\n position: relative;\n padding: 0;\n vertical-align: top;\n }\n .entry-body {\n position: absolute;\n inset: 0;\n box-sizing: border-box;\n display: flex;\n min-height: 0;\n flex-direction: column;\n overflow: hidden;\n padding: 0.25rem 0.5rem;\n color: inherit;\n pointer-events: none;\n }\n .entry-footer {\n flex: 0 0 auto;\n min-height: 1.15em;\n margin-top: auto;\n border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent);\n padding-top: 0.25rem;\n font-size: var(--ui-font-size-xs, 0.6875rem);\n font-weight: var(--ui-font-weight-medium, 500);\n line-height: 1.15;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\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 @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 /** Observes declarative entry attributes and slotted text for live updates. */\n override connectedCallback(): void {\n super.connectedCallback();\n this._entriesVersion++;\n this._entriesObserver ??= new MutationObserver(() => this._entriesVersion++);\n this._entriesObserver.observe(this, {\n attributes: true,\n attributeFilter: CALENDAR_ENTRY_ATTRIBUTES,\n characterData: true,\n childList: true,\n subtree: true,\n });\n }\n\n /** Releases the entry observer when this month disconnects. */\n override disconnectedCallback(): void {\n this._entriesObserver?.disconnect();\n super.disconnectedCallback();\n }\n\n /** Restores hover/focus classes from the live DOM after Lit updates or reuses cells. */\n protected override updated(): void {\n this._syncEntryInteractions();\n }\n\n /** Re-renders when declarative `calendar-entry` children are added or removed. */\n private _handleSlotChange(): void {\n this._entriesVersion++;\n }\n\n /** Finds the laned entry (if any) covering `date` in a given lane. */\n private _entryFor(laned: LanedEntry[], lane: number, date: Date): LanedEntry | undefined {\n return laned.find((entry) => entry.lane === lane && entry.startDate <= date && date <= entry.endDate);\n }\n\n /** Classifies one day of an entry so only the outer endpoints are rounded. */\n private _segmentClass(entry: LanedEntry, date: Date): string {\n const startsHere = date.getTime() === entry.startDate.getTime();\n const endsHere = date.getTime() === entry.endDate.getTime();\n if (startsHere && endsHere) return \"segment-single\";\n if (startsHere) return \"segment-start\";\n if (endsHere) return \"segment-end\";\n return \"segment-middle\";\n }\n\n /** Current render key shared by an entry's title and body cells. */\n private _entryKey(entry: LanedEntry): string {\n return `${entry.lane}|${entry.start}|${entry.end}|${entry.label}|${entry.href ?? \"\"}`;\n }\n\n /** Toggles one interaction class on every rendered cell belonging to an entry. */\n private _setEntryInteraction(entryKey: string, className: string, active: boolean): void {\n for (const cell of this.renderRoot.querySelectorAll<HTMLElement>(\".entry-bar\")) {\n if (cell.dataset.entryKey === entryKey) {\n cell.classList.toggle(className, active);\n }\n }\n }\n\n /** Reconciles classes against the links actually hovered or focused after a render. */\n private _syncEntryInteractions(): void {\n for (const cell of this.renderRoot.querySelectorAll<HTMLElement>(\".entry-bar\")) {\n cell.classList.remove(\"entry-hovered\", \"entry-focused\");\n }\n for (const link of this.renderRoot.querySelectorAll<HTMLElement>(\".entry-link:hover\")) {\n this._setEntryInteraction(link.dataset.entryKey ?? \"\", \"entry-hovered\", true);\n }\n const activeElement = this.shadowRoot?.activeElement;\n if (activeElement instanceof HTMLElement && activeElement.matches(\".entry-link\")) {\n this._setEntryInteraction(activeElement.dataset.entryKey ?? \"\", \"entry-focused\", true);\n }\n }\n\n /** Renders a transparent full-cell link without wrapping the visible text. */\n private _renderEntryLink(entry: LanedEntry, accessibleText: string) {\n const entryKey = this._entryKey(entry);\n return entry.href\n ? html`<a\n class=\"entry-link\"\n href=${entry.href}\n aria-label=${accessibleText}\n data-entry-key=${entryKey}\n @pointerenter=${() => this._setEntryInteraction(entryKey, \"entry-hovered\", true)}\n @pointerleave=${() => this._setEntryInteraction(entryKey, \"entry-hovered\", false)}\n @focus=${() => this._setEntryInteraction(entryKey, \"entry-focused\", true)}\n @blur=${() => this._setEntryInteraction(entryKey, \"entry-focused\", false)}\n ></a>`\n : nothing;\n }\n\n /** Joins the event title, details, and visible footer for tooltips and accessible link names. */\n private _entryBodyText(entry: LanedEntry, showFooter: boolean): string {\n return [entry.label, ...(entry.details ?? []), showFooter ? entry.footer : undefined]\n .filter((line): line is string => Boolean(line))\n .join(\"\\n\");\n }\n\n /** Renders the shared details body, with the footer reserved at its bottom edge. */\n private _renderEntryBody(\n entry: LanedEntry,\n showFooter: boolean,\n detailLineClamp: number,\n showTitleFallback = false,\n ) {\n const sourceDetails = entry.details ?? [];\n const footer = showFooter ? entry.footer : undefined;\n const details =\n showTitleFallback && sourceDetails.length === 0 && !footer\n ? [entry.label]\n : sourceDetails;\n const bodyText = this._entryBodyText(entry, showFooter);\n return html`\n ${this._renderEntryLink(entry, bodyText)}\n <div class=\"entry-body\" aria-hidden=${entry.href ? \"true\" : nothing}>\n ${detailLineClamp > 0 && details.length > 0\n ? html`\n <div\n class=\"entry-details\"\n style=${`--entry-detail-lines: ${detailLineClamp}; --entry-detail-max-height: ${\n detailLineClamp * 1.15\n }em`}\n >\n ${details.map((detail) => html`<div class=\"entry-detail\">${detail}</div>`)}\n </div>\n `\n : nothing}\n ${footer ? html`<div class=\"entry-footer\" title=${footer}>${footer}</div>` : nothing}\n </div>\n `;\n }\n\n /** Renders a row-spanning body cell with whole-line detail and footer budgets. */\n private _renderEntryBodyCell(\n entry: LanedEntry,\n bodyRows: number,\n reachesEventEnd: boolean,\n showTitleFallback = false,\n ) {\n const segmentClass = reachesEventEnd ? \"segment-end\" : \"segment-middle\";\n const footerLineBudget = reachesEventEnd && entry.footer ? 1 : 0;\n const detailLineClamp = Math.max(0, bodyRows - footerLineBudget);\n const bodyText = this._entryBodyText(entry, reachesEventEnd);\n return html`\n <td\n class=\"lane-cell entry-bar entry-body-cell ${entry.color} ${segmentClass}\"\n data-entry-key=${this._entryKey(entry)}\n rowspan=${bodyRows}\n title=${entry.href ? nothing : bodyText}\n >\n ${this._renderEntryBody(entry, reachesEventEnd, detailLineClamp, showTitleFallback)}\n </td>\n `;\n }\n\n /** Renders a lane's title/body cell, skips rows covered by a body rowspan, or emits an empty spacer. */\n private _renderLaneCell(\n laned: LanedEntry[],\n lane: number,\n date: Date,\n monthStart: Date,\n monthEnd: Date,\n ) {\n const entry = this._entryFor(laned, lane, date);\n if (!entry) {\n return html`<td class=\"lane-cell empty\"></td>`;\n }\n\n const firstVisibleDay = entry.startDate > monthStart ? entry.startDate : monthStart;\n const lastVisibleDay = entry.endDate < monthEnd ? entry.endDate : monthEnd;\n const dayOffset = date.getDate() - firstVisibleDay.getDate();\n const visibleDayCount = lastVisibleDay.getDate() - firstVisibleDay.getDate() + 1;\n const isMultiDayEntry = entry.startDate.getTime() !== entry.endDate.getTime();\n const isEndingOnlyClip =\n visibleDayCount === 1 &&\n isMultiDayEntry &&\n date.getTime() === entry.endDate.getTime();\n if (isEndingOnlyClip) {\n return this._renderEntryBodyCell(entry, 1, true, true);\n }\n if (dayOffset > 1) return nothing;\n\n if (dayOffset === 1) {\n const bodyRows = visibleDayCount - 1;\n const reachesEventEnd = lastVisibleDay.getTime() === entry.endDate.getTime();\n return this._renderEntryBodyCell(entry, bodyRows, reachesEventEnd);\n }\n\n return html`\n <td\n class=\"lane-cell entry-bar entry-title-cell ${entry.color} ${this._segmentClass(entry, date)}\"\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-line entry-title\" aria-hidden=${entry.href ? \"true\" : nothing}>\n ${entry.label}\n </span>\n </td>\n `;\n }\n\n protected override render() {\n const totalDays = daysInMonth(this.year, this.month);\n const monthStart = new Date(this.year, this.month - 1, 1);\n const monthEnd = new Date(this.year, this.month - 1, totalDays);\n\n const resolved = this._entryElements\n .map(readCalendarEntryElement)\n .map(resolveEntry)\n .filter((entry): entry is ResolvedCalendarEntry => entry !== null)\n .filter((entry) => overlapsRange(entry, monthStart, monthEnd));\n const { entries: laned, laneCount } = assignLanes(resolved);\n const todayIso = toIsoDate(new Date());\n const lanes = Array.from({ length: Math.max(laneCount, 1) }, (_, i) => i);\n\n return html`\n <div class=\"month\">\n <div class=\"month-header\">\n <h4 class=\"month-name\">${monthName(this.month)} ${this.year}</h4>\n <div class=\"actions\"><slot name=\"actions\"></slot></div>\n </div>\n <table>\n <tbody>\n ${repeat(\n Array.from({ length: totalDays }, (_, i) => i + 1),\n (d) => d,\n (d) => {\n const date = new Date(this.year, this.month - 1, d);\n const dow = date.getDay();\n const weekendCls = isWeekend(date) ? \"weekend\" : \"\";\n const todayCls = toIsoDate(date) === todayIso ? \"today\" : \"\";\n return html`\n <tr class=\"day-row ${weekendCls} ${todayCls}\">\n <td class=\"day-number\">${d}</td>\n <td class=\"day-weekday\">${WEEKDAY_ABBR[dow]}</td>\n ${lanes.map((lane) => this._renderLaneCell(laned, lane, date, monthStart, monthEnd))}\n </tr>\n `;\n },\n )}\n </tbody>\n </table>\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"calendar-month\": CalendarMonth;\n }\n}\n"]}
1
+ {"version":3,"file":"calendar-month.js","sourceRoot":"","sources":["../src/calendar-month.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,yBAAyB,EACzB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS,EACT,aAAa,EACb,wBAAwB,EACxB,YAAY,EACZ,SAAS,GAGV,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;;GAoBG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QACL,kCAAkC;QACS,SAAI,GAA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,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAC1B,MAAM,UAAU,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YACpD,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7D,OAAO,IAAI,CAAA;uCACY,UAAU,IAAI,QAAQ;6CAChB,CAAC;8CACA,YAAY,CAAC,GAAG,CAAC;sBACzC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;;iBAEvF,CAAC;QACJ,CAAC,CACF;;;4BAGe,IAAI,CAAC,iBAAiB;;KAE7C,CAAC;IACJ,CAAC;CACF,CAAA;AAjgB4C;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAyC;AAGxC;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAW;AAGpC;IADhB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;qDACJ;AAGjC;IAAhB,KAAK,EAAE;sDAA6B;AAX1B,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CAmgBzB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property, queryAssignedElements, state } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { CalendarEntry } from \"./calendar-entry.js\";\nimport { iconMapPin } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\nimport {\n CALENDAR_ENTRY_ATTRIBUTES,\n WEEKDAY_ABBR,\n assignLanes,\n daysInMonth,\n isWeekend,\n monthName,\n overlapsRange,\n readCalendarEntryElement,\n resolveEntry,\n toIsoDate,\n type LanedEntry,\n type ResolvedCalendarEntry,\n} from \"./utils/calendar.js\";\n\n/**\n * One month rendered as a top-to-bottom list of days — weekends and today\n * highlighted, with declarative `calendar-entry` children shown as colored\n * bars spanning the days they cover. An entry's title uses its first visible\n * day; every remaining visible day becomes one shared body for wrapped\n * details and an optional ending footer. Overlapping entries stack into\n * side-by-side lanes rather than being layered/hidden. Read-only.\n *\n * Lanes are computed independently per instance, from only the entries\n * overlapping this month — an entry spanning a month boundary may therefore\n * land in a different lane index in the adjacent month's `calendar-month`.\n * This is an accepted v1 limitation: cross-month lane continuity would\n * require a shared parent (`calendar-year`) to assign lanes globally.\n *\n * Entry attributes and slotted title/detail text are observed, so a\n * standalone month re-renders when consumers update declarative metadata.\n *\n * @element calendar-month\n * @slot - Declarative `calendar-entry` elements to render for this month.\n * @slot actions - Optional controls rendered beside the month name (e.g. month-navigation buttons).\n */\n@customElement(\"calendar-month\")\nexport class CalendarMonth extends LitElement {\n /** Calendar year, e.g. `2026`. */\n @property({ type: Number, reflect: true }) year: number = new Date().getFullYear();\n\n /** Calendar month, 1-12 (January = 1). */\n @property({ type: Number, reflect: true }) month = 1;\n\n @queryAssignedElements({ selector: \"calendar-entry\" })\n private readonly _entryElements!: CalendarEntry[];\n\n /** Bumped when entry elements, attributes, or slotted text change to force a re-render. */\n @state() private _entriesVersion = 0;\n\n private _entriesObserver?: MutationObserver;\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 .month-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n margin-bottom: 0.5rem;\n }\n .month-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 .actions {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n gap: 0.5rem;\n }\n table {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n }\n .day-row td {\n padding: 0.25rem 0.5rem;\n border-bottom: 1px solid var(--ui-border, #e2e8f0);\n }\n .day-row.weekend {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .day-row.today {\n background: color-mix(in srgb, var(--ui-primary, #4f46e5) 10%, transparent);\n }\n .day-number {\n width: 1.5rem;\n color: var(--ui-text-muted, #64748b);\n font-variant-numeric: tabular-nums;\n text-align: right;\n white-space: nowrap;\n }\n .day-row.today .day-number {\n color: var(--ui-primary, #4f46e5);\n font-weight: var(--ui-font-weight-bold, 700);\n }\n .day-weekday {\n width: 2.25rem;\n color: var(--ui-text-muted, #64748b);\n white-space: nowrap;\n }\n .day-row.today .day-weekday {\n color: var(--ui-primary, #4f46e5);\n font-weight: var(--ui-font-weight-semibold, 600);\n }\n .day-row.weekend .day-weekday {\n font-weight: var(--ui-font-weight-semibold, 600);\n }\n .lane-cell {\n padding: 0.25rem 0.5rem;\n }\n .entry-bar {\n border-radius: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: box-shadow 120ms ease;\n white-space: nowrap;\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-bar.segment-single {\n border-radius: var(--ui-radius-sm, 0.25rem);\n }\n .entry-bar.segment-start {\n border-radius: var(--ui-radius-sm, 0.25rem) var(--ui-radius-sm, 0.25rem) 0 0;\n }\n .entry-bar.segment-end {\n border-radius: 0 0 var(--ui-radius-sm, 0.25rem) var(--ui-radius-sm, 0.25rem);\n }\n .entry-bar.segment-start,\n .entry-bar.segment-middle {\n border-bottom: 0;\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 .entry-line {\n display: block;\n overflow: hidden;\n }\n .day-row td.entry-title-cell {\n position: relative;\n padding: 0;\n }\n .entry-title {\n box-sizing: border-box;\n font-weight: var(--ui-font-weight-medium, 500);\n padding: 0.25rem 0.5rem;\n pointer-events: none;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n .entry-location {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n box-sizing: border-box;\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-title-cell .entry-location {\n padding: 0 0.5rem 0.25rem;\n }\n .entry-body .entry-location {\n margin-bottom: 0.25rem;\n }\n .entry-details {\n display: -webkit-box;\n min-height: 0;\n max-height: var(--entry-detail-max-height, 1.15em);\n flex: 0 0 auto;\n overflow: hidden;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: var(--entry-detail-lines, 1);\n font-size: var(--ui-font-size-xs, 0.6875rem);\n font-weight: var(--ui-font-weight-regular, 400);\n line-height: 1.15;\n overflow-wrap: anywhere;\n text-overflow: ellipsis;\n white-space: normal;\n }\n .entry-detail {\n min-height: 1.15em;\n }\n .day-row td.entry-body-cell {\n position: relative;\n padding: 0;\n vertical-align: top;\n }\n .entry-body {\n position: absolute;\n inset: 0;\n box-sizing: border-box;\n display: flex;\n min-height: 0;\n flex-direction: column;\n overflow: hidden;\n padding: 0.25rem 0.5rem;\n color: inherit;\n pointer-events: none;\n }\n .entry-footer {\n flex: 0 0 auto;\n min-height: 1.15em;\n margin-top: auto;\n border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent);\n padding-top: 0.25rem;\n font-size: var(--ui-font-size-xs, 0.6875rem);\n font-weight: var(--ui-font-weight-medium, 500);\n line-height: 1.15;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\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 @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 /** Observes declarative entry attributes and slotted text for live updates. */\n override connectedCallback(): void {\n super.connectedCallback();\n this._entriesVersion++;\n this._entriesObserver ??= new MutationObserver(() => this._entriesVersion++);\n this._entriesObserver.observe(this, {\n attributes: true,\n attributeFilter: CALENDAR_ENTRY_ATTRIBUTES,\n characterData: true,\n childList: true,\n subtree: true,\n });\n }\n\n /** Releases the entry observer when this month disconnects. */\n override disconnectedCallback(): void {\n this._entriesObserver?.disconnect();\n super.disconnectedCallback();\n }\n\n /** Restores hover/focus classes from the live DOM after Lit updates or reuses cells. */\n protected override updated(): void {\n this._syncEntryInteractions();\n }\n\n /** Re-renders when declarative `calendar-entry` children are added or removed. */\n private _handleSlotChange(): void {\n this._entriesVersion++;\n }\n\n /** Finds the laned entry (if any) covering `date` in a given lane. */\n private _entryFor(laned: LanedEntry[], lane: number, date: Date): LanedEntry | undefined {\n return laned.find((entry) => entry.lane === lane && entry.startDate <= date && date <= entry.endDate);\n }\n\n /** Classifies one day of an entry so only the outer endpoints are rounded. */\n private _segmentClass(entry: LanedEntry, date: Date): string {\n const startsHere = date.getTime() === entry.startDate.getTime();\n const endsHere = date.getTime() === entry.endDate.getTime();\n if (startsHere && endsHere) return \"segment-single\";\n if (startsHere) return \"segment-start\";\n if (endsHere) return \"segment-end\";\n return \"segment-middle\";\n }\n\n /** Current render key shared by an entry's title and body cells. */\n private _entryKey(entry: LanedEntry): string {\n return `${entry.lane}|${entry.start}|${entry.end}|${entry.label}|${entry.href ?? \"\"}`;\n }\n\n /** Toggles one interaction class on every rendered cell belonging to an entry. */\n private _setEntryInteraction(entryKey: string, className: string, active: boolean): void {\n for (const cell of this.renderRoot.querySelectorAll<HTMLElement>(\".entry-bar\")) {\n if (cell.dataset.entryKey === entryKey) {\n cell.classList.toggle(className, active);\n }\n }\n }\n\n /** Reconciles classes against the links actually hovered or focused after a render. */\n private _syncEntryInteractions(): void {\n for (const cell of this.renderRoot.querySelectorAll<HTMLElement>(\".entry-bar\")) {\n cell.classList.remove(\"entry-hovered\", \"entry-focused\");\n }\n for (const link of this.renderRoot.querySelectorAll<HTMLElement>(\".entry-link:hover\")) {\n this._setEntryInteraction(link.dataset.entryKey ?? \"\", \"entry-hovered\", true);\n }\n const activeElement = this.shadowRoot?.activeElement;\n if (activeElement instanceof HTMLElement && activeElement.matches(\".entry-link\")) {\n this._setEntryInteraction(activeElement.dataset.entryKey ?? \"\", \"entry-focused\", true);\n }\n }\n\n /** Renders a transparent full-cell link without wrapping the visible text. */\n private _renderEntryLink(entry: LanedEntry, accessibleText: string) {\n const entryKey = this._entryKey(entry);\n return entry.href\n ? html`<a\n class=\"entry-link\"\n href=${entry.href}\n aria-label=${accessibleText}\n data-entry-key=${entryKey}\n @pointerenter=${() => this._setEntryInteraction(entryKey, \"entry-hovered\", true)}\n @pointerleave=${() => this._setEntryInteraction(entryKey, \"entry-hovered\", false)}\n @focus=${() => this._setEntryInteraction(entryKey, \"entry-focused\", true)}\n @blur=${() => this._setEntryInteraction(entryKey, \"entry-focused\", false)}\n ></a>`\n : nothing;\n }\n\n /** Joins the event title, location, details, and visible footer for tooltips and accessible link names. */\n private _entryBodyText(entry: LanedEntry, showFooter: boolean): string {\n return [entry.label, entry.location, ...(entry.details ?? []), showFooter ? entry.footer : undefined]\n .filter((line): line is string => Boolean(line))\n .join(\"\\n\");\n }\n\n /** Renders the shared details body, with the location pinned at the top and the footer reserved at the bottom. */\n private _renderEntryBody(\n entry: LanedEntry,\n showFooter: boolean,\n detailLineClamp: number,\n showTitleFallback = false,\n ) {\n const sourceDetails = entry.details ?? [];\n const footer = showFooter ? entry.footer : undefined;\n const details =\n showTitleFallback && sourceDetails.length === 0 && !footer\n ? [entry.label]\n : sourceDetails;\n const bodyText = this._entryBodyText(entry, showFooter);\n return html`\n ${this._renderEntryLink(entry, bodyText)}\n <div class=\"entry-body\" aria-hidden=${entry.href ? \"true\" : nothing}>\n ${entry.location\n ? html`<div class=\"entry-location\">${iconMapPin(14)}${entry.location}</div>`\n : nothing}\n ${detailLineClamp > 0 && details.length > 0\n ? html`\n <div\n class=\"entry-details\"\n style=${`--entry-detail-lines: ${detailLineClamp}; --entry-detail-max-height: ${\n detailLineClamp * 1.15\n }em`}\n >\n ${details.map((detail) => html`<div class=\"entry-detail\">${detail}</div>`)}\n </div>\n `\n : nothing}\n ${footer ? html`<div class=\"entry-footer\" title=${footer}>${footer}</div>` : nothing}\n </div>\n `;\n }\n\n /** Renders a row-spanning body cell with whole-line location, detail, and footer budgets. */\n private _renderEntryBodyCell(\n entry: LanedEntry,\n bodyRows: number,\n reachesEventEnd: boolean,\n showTitleFallback = false,\n ) {\n const segmentClass = reachesEventEnd ? \"segment-end\" : \"segment-middle\";\n const footerLineBudget = reachesEventEnd && entry.footer ? 1 : 0;\n const locationLineBudget = entry.location ? 1 : 0;\n const detailLineClamp = Math.max(0, bodyRows - footerLineBudget - locationLineBudget);\n const bodyText = this._entryBodyText(entry, reachesEventEnd);\n return html`\n <td\n class=\"lane-cell entry-bar entry-body-cell ${entry.color} ${segmentClass}\"\n data-entry-key=${this._entryKey(entry)}\n rowspan=${bodyRows}\n title=${entry.href ? nothing : bodyText}\n >\n ${this._renderEntryBody(entry, reachesEventEnd, detailLineClamp, showTitleFallback)}\n </td>\n `;\n }\n\n /** Renders a lane's title/body cell, skips rows covered by a body rowspan, or emits an empty spacer. */\n private _renderLaneCell(\n laned: LanedEntry[],\n lane: number,\n date: Date,\n monthStart: Date,\n monthEnd: Date,\n ) {\n const entry = this._entryFor(laned, lane, date);\n if (!entry) {\n return html`<td class=\"lane-cell empty\"></td>`;\n }\n\n const firstVisibleDay = entry.startDate > monthStart ? entry.startDate : monthStart;\n const lastVisibleDay = entry.endDate < monthEnd ? entry.endDate : monthEnd;\n const dayOffset = date.getDate() - firstVisibleDay.getDate();\n const visibleDayCount = lastVisibleDay.getDate() - firstVisibleDay.getDate() + 1;\n const isMultiDayEntry = entry.startDate.getTime() !== entry.endDate.getTime();\n const isEndingOnlyClip =\n visibleDayCount === 1 &&\n isMultiDayEntry &&\n date.getTime() === entry.endDate.getTime();\n if (isEndingOnlyClip) {\n return this._renderEntryBodyCell(entry, 1, true, true);\n }\n if (dayOffset > 1) return nothing;\n\n if (dayOffset === 1) {\n const bodyRows = visibleDayCount - 1;\n const reachesEventEnd = lastVisibleDay.getTime() === entry.endDate.getTime();\n return this._renderEntryBodyCell(entry, bodyRows, reachesEventEnd);\n }\n\n const bodyText = [entry.label, entry.location].filter(Boolean).join(\" · \");\n return html`\n <td\n class=\"lane-cell entry-bar entry-title-cell ${entry.color} ${this._segmentClass(entry, date)}\"\n data-entry-key=${this._entryKey(entry)}\n title=${entry.href ? nothing : bodyText}\n >\n ${this._renderEntryLink(entry, bodyText)}\n <span class=\"entry-line entry-title\" aria-hidden=${entry.href ? \"true\" : nothing}>\n ${entry.label}\n </span>\n ${entry.location\n ? html`<span class=\"entry-line entry-location\" aria-hidden=${entry.href ? \"true\" : nothing}\n >${iconMapPin(14)}${entry.location}</span\n >`\n : nothing}\n </td>\n `;\n }\n\n protected override render() {\n const totalDays = daysInMonth(this.year, this.month);\n const monthStart = new Date(this.year, this.month - 1, 1);\n const monthEnd = new Date(this.year, this.month - 1, totalDays);\n\n const resolved = this._entryElements\n .map(readCalendarEntryElement)\n .map(resolveEntry)\n .filter((entry): entry is ResolvedCalendarEntry => entry !== null)\n .filter((entry) => overlapsRange(entry, monthStart, monthEnd));\n const { entries: laned, laneCount } = assignLanes(resolved);\n const todayIso = toIsoDate(new Date());\n const lanes = Array.from({ length: Math.max(laneCount, 1) }, (_, i) => i);\n\n return html`\n <div class=\"month\">\n <div class=\"month-header\">\n <h4 class=\"month-name\">${monthName(this.month)} ${this.year}</h4>\n <div class=\"actions\"><slot name=\"actions\"></slot></div>\n </div>\n <table>\n <tbody>\n ${repeat(\n Array.from({ length: totalDays }, (_, i) => i + 1),\n (d) => d,\n (d) => {\n const date = new Date(this.year, this.month - 1, d);\n const dow = date.getDay();\n const weekendCls = isWeekend(date) ? \"weekend\" : \"\";\n const todayCls = toIsoDate(date) === todayIso ? \"today\" : \"\";\n return html`\n <tr class=\"day-row ${weekendCls} ${todayCls}\">\n <td class=\"day-number\">${d}</td>\n <td class=\"day-weekday\">${WEEKDAY_ABBR[dow]}</td>\n ${lanes.map((lane) => this._renderLaneCell(laned, lane, date, monthStart, monthEnd))}\n </tr>\n `;\n },\n )}\n </tbody>\n </table>\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"calendar-month\": CalendarMonth;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-week.d.ts","sourceRoot":"","sources":["../src/calendar-week.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AA6BnE;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBACa,YAAa,SAAQ,oBAAoB;IACpD,mGAAmG;IACtE,IAAI,EAAE,MAAM,CAAyB;IAElE,OAAgB,MAAM,4BAgLpB;IAEF,sFAAsF;IACtF,OAAO,CAAC,kBAAkB;IAkB1B,uFAAuF;IACvF,OAAO,CAAC,iBAAiB;IAqBzB,gGAAgG;IAChG,OAAO,CAAC,gBAAgB;IAoBxB,UAAmB,MAAM,yCAkDxB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
1
+ {"version":3,"file":"calendar-week.d.ts","sourceRoot":"","sources":["../src/calendar-week.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AA8BnE;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBACa,YAAa,SAAQ,oBAAoB;IACpD,mGAAmG;IACtE,IAAI,EAAE,MAAM,CAAyB;IAElE,OAAgB,MAAM,4BA+LpB;IAEF,sFAAsF;IACtF,OAAO,CAAC,kBAAkB;IAwB1B,uFAAuF;IACvF,OAAO,CAAC,iBAAiB;IA0BzB,gGAAgG;IAChG,OAAO,CAAC,gBAAgB;IAoBxB,UAAmB,MAAM,yCAkDxB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
@@ -8,6 +8,7 @@ import { css, html, nothing } from "lit";
8
8
  import { customElement, property } 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
13
  import { WEEKDAY_ABBR, addDays, assignLanes, minutesSinceMidnight, overlapsRange, parseIsoDate, startOfWeek, toIsoDate, } from "./utils/calendar.js";
13
14
  const HOUR_HEIGHT_REM = 3;
@@ -169,6 +170,21 @@ let CalendarWeek = class CalendarWeek extends CalendarTimelineBase {
169
170
  text-overflow: ellipsis;
170
171
  pointer-events: none;
171
172
  }
173
+ .entry-location {
174
+ display: flex;
175
+ align-items: center;
176
+ gap: 0.25rem;
177
+ overflow: hidden;
178
+ color: inherit;
179
+ font-size: var(--ui-font-size-xs, 0.6875rem);
180
+ font-weight: var(--ui-font-weight-regular, 400);
181
+ white-space: nowrap;
182
+ text-overflow: ellipsis;
183
+ pointer-events: none;
184
+ }
185
+ .entry-location svg {
186
+ flex: 0 0 auto;
187
+ }
172
188
  .entry-link {
173
189
  position: absolute;
174
190
  z-index: 1;
@@ -229,15 +245,21 @@ let CalendarWeek = class CalendarWeek extends CalendarTimelineBase {
229
245
  const visibleEnd = entry.endDate > weekEnd ? weekEnd : entry.endDate;
230
246
  const startCol = dayIndex(visibleStart, weekStart) + 1;
231
247
  const endCol = dayIndex(visibleEnd, weekStart) + 2;
248
+ const bodyText = [entry.label, entry.location].filter(Boolean).join(" · ");
232
249
  return html `
233
250
  <div
234
251
  class="entry-bar ${entry.color}"
235
252
  data-entry-key=${this.entryKey(entry)}
236
- title=${entry.href ? nothing : entry.label}
253
+ title=${entry.href ? nothing : bodyText}
237
254
  style="grid-column: ${startCol} / ${endCol}; grid-row: ${entry.lane + 1};"
238
255
  >
239
- ${this.renderEntryLink(entry, entry.label)}
256
+ ${this.renderEntryLink(entry, bodyText)}
240
257
  <span class="entry-title" aria-hidden=${entry.href ? "true" : nothing}>${entry.label}</span>
258
+ ${entry.location
259
+ ? html `<span class="entry-location" aria-hidden=${entry.href ? "true" : nothing}
260
+ >${iconMapPin(14)}${entry.location}</span
261
+ >`
262
+ : nothing}
241
263
  </div>
242
264
  `;
243
265
  }
@@ -249,7 +271,7 @@ let CalendarWeek = class CalendarWeek extends CalendarTimelineBase {
249
271
  const bottomRem = (minutesSinceMidnight(visibleEnd) / 60) * HOUR_HEIGHT_REM;
250
272
  const heightRem = Math.max(bottomRem - topRem, HOUR_HEIGHT_REM / 4);
251
273
  const widthPercent = 100 / laneCount;
252
- const bodyText = [entry.label, ...(entry.details ?? [])].filter(Boolean).join("\n");
274
+ const bodyText = [entry.label, ...(entry.details ?? []), entry.location].filter(Boolean).join("\n");
253
275
  return html `
254
276
  <div
255
277
  class="entry-bar entry-block ${entry.color}"
@@ -259,6 +281,11 @@ let CalendarWeek = class CalendarWeek extends CalendarTimelineBase {
259
281
  >
260
282
  ${this.renderEntryLink(entry, bodyText)}
261
283
  <span class="entry-title" aria-hidden=${entry.href ? "true" : nothing}>${entry.label}</span>
284
+ ${entry.location
285
+ ? html `<span class="entry-location" aria-hidden=${entry.href ? "true" : nothing}
286
+ >${iconMapPin(14)}${entry.location}</span
287
+ >`
288
+ : nothing}
262
289
  </div>
263
290
  `;
264
291
  }
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-week.js","sourceRoot":"","sources":["../src/calendar-week.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,YAAY,EACZ,OAAO,EACP,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,WAAW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EAAE,EAAE,CAAC,IAAI,CAAA,gCAAgC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;;;cAG1E,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;;;4BAGhD,IAAI,CAAC,gBAAgB;;KAE5C,CAAC;IACJ,CAAC;CACF,CAAA;AArS8B;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAAsC;AAFvD,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAuSxB","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 WEEKDAY_ABBR,\n addDays,\n assignLanes,\n minutesSinceMidnight,\n overlapsRange,\n parseIsoDate,\n startOfWeek,\n toIsoDate,\n type LanedEntry,\n type ResolvedTimedEntry,\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/** 0-based day-of-week offset between `date` (local midnight) and `weekStart`. */\nfunction dayIndex(date: Date, weekStart: Date): number {\n return Math.round((date.getTime() - weekStart.getTime()) / 86_400_000);\n}\n\n/**\n * Sunday-through-Saturday week rendered as one shared hourly time grid — the\n * seven-day sibling of `calendar-day`. Unlike `calendar-year` composing 12\n * `calendar-month` children, this is its own independent 7-column layout\n * (not 7 nested `<calendar-day>` elements): a single hour gutter is drawn\n * once, and multi-day/all-day entries span the days they cover as one\n * continuous bar in a shared all-day band, since lanes for that band are\n * assigned once across the whole visible week (unlike `calendar-month`'s\n * documented per-instance lane limitation). Timed entries stack into\n * side-by-side columns independently per day, same as `calendar-day`.\n * Read-only.\n *\n * Shares its slotted-entry observation, resolution, and hover/focus\n * interaction sync with `calendar-day` via `CalendarTimelineBase`.\n *\n * @element calendar-week\n * @slot - Declarative `calendar-entry` elements to render for this week.\n * @slot actions - Optional controls rendered beside the day headers (e.g. week-navigation buttons).\n */\n@customElement(\"calendar-week\")\nexport class CalendarWeek extends CalendarTimelineBase {\n /** Any date within the displayed week (`\"YYYY-MM-DD\"`) — the week runs Sunday through Saturday. */\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 .week-header-row {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin-bottom: 0.5rem;\n }\n .week-header {\n display: flex;\n flex: 1 1 auto;\n min-width: 0;\n }\n .actions {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n gap: 0.5rem;\n }\n .hour-gutter-spacer {\n flex: 0 0 3rem;\n }\n .day-header {\n flex: 1 1 0;\n color: var(--ui-text-muted, #64748b);\n font-weight: var(--ui-font-weight-semibold, 600);\n text-align: center;\n }\n .day-header .day-number {\n color: var(--ui-text, #0f172a);\n font-size: var(--ui-font-size-lg, 1rem);\n }\n .day-header.today,\n .day-header.today .day-number {\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 .all-day-lanes {\n display: grid;\n flex: 1 1 auto;\n grid-auto-rows: min-content;\n grid-template-columns: repeat(7, 1fr);\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 .week-days {\n display: flex;\n flex: 1 1 auto;\n }\n .day-column {\n position: relative;\n flex: 1 1 0;\n height: ${HOUR_HEIGHT_REM * 24}rem;\n border-left: 1px solid var(--ui-border, #e2e8f0);\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 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:not([name]) {\n display: none;\n }\n `,\n ];\n\n /** Renders one all-day/multi-day bar, spanning the visible-week columns it covers. */\n private _renderAllDayEntry(entry: LanedEntry, weekStart: Date, weekEnd: Date) {\n const visibleStart = entry.startDate < weekStart ? weekStart : entry.startDate;\n const visibleEnd = entry.endDate > weekEnd ? weekEnd : entry.endDate;\n const startCol = dayIndex(visibleStart, weekStart) + 1;\n const endCol = dayIndex(visibleEnd, weekStart) + 2;\n return html`\n <div\n class=\"entry-bar ${entry.color}\"\n data-entry-key=${this.entryKey(entry)}\n title=${entry.href ? nothing : entry.label}\n style=\"grid-column: ${startCol} / ${endCol}; grid-row: ${entry.lane + 1};\"\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\n /** Renders a positioned/sized block for one timed entry, clamped to `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 /** Renders one day's hour column: grid lines plus its own independently laned timed entries. */\n private _renderDayColumn(day: Date, timedWeek: ResolvedTimedEntry[], todayIso: string) {\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 dayTimed = timedWeek.filter((entry) => overlapsRange(entry, dayStart, dayEnd));\n const { entries: laned, laneCount } = assignLanes(dayTimed);\n const isToday = toIsoDate(day) === todayIso;\n return html`\n <div class=\"day-column ${isToday ? \"today\" : \"\"}\">\n ${HOURS.map(() => html`<div class=\"hour-line\"></div>`)}\n ${repeat(\n laned,\n (entry) => this.entryKey(entry),\n (entry) => this._renderTimedEntry(entry, Math.max(laneCount, 1), dayStart, dayEnd),\n )}\n </div>\n `;\n }\n\n protected override render() {\n const anyDayInWeek = parseIsoDate(this.date) ?? new Date();\n const weekStart = startOfWeek(anyDayInWeek);\n const days = Array.from({ length: 7 }, (_, i) => addDays(weekStart, i));\n const weekEnd = new Date(days[6]);\n weekEnd.setHours(23, 59, 59, 999);\n const todayIso = toIsoDate(new Date());\n\n const resolved = this.resolveTimedEntriesFor(weekStart, weekEnd);\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\n return html`\n <div class=\"week\">\n <div class=\"week-header-row\">\n <div class=\"week-header\">\n <div class=\"hour-gutter-spacer\"></div>\n ${days.map(\n (day) => html`\n <div class=\"day-header ${toIsoDate(day) === todayIso ? \"today\" : \"\"}\">\n <div>${WEEKDAY_ABBR[day.getDay()]}</div>\n <div class=\"day-number\">${day.getDate()}</div>\n </div>\n `,\n )}\n </div>\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\" style=\"grid-template-rows: repeat(${Math.max(allDayLaneCount, 1)}, min-content);\">\n ${repeat(\n lanedAllDay,\n (entry) => this.entryKey(entry),\n (entry) => this._renderAllDayEntry(entry, weekStart, weekEnd),\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=\"week-days\">\n ${days.map((day) => this._renderDayColumn(day, timed, todayIso))}\n </div>\n </div>\n <slot @slotchange=${this.handleSlotChange}></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"calendar-week\": CalendarWeek;\n }\n}\n"]}
1
+ {"version":3,"file":"calendar-week.js","sourceRoot":"","sources":["../src/calendar-week.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,M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AY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAiUxB","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 { iconMapPin } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\nimport {\n WEEKDAY_ABBR,\n addDays,\n assignLanes,\n minutesSinceMidnight,\n overlapsRange,\n parseIsoDate,\n startOfWeek,\n toIsoDate,\n type LanedEntry,\n type ResolvedTimedEntry,\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/** 0-based day-of-week offset between `date` (local midnight) and `weekStart`. */\nfunction dayIndex(date: Date, weekStart: Date): number {\n return Math.round((date.getTime() - weekStart.getTime()) / 86_400_000);\n}\n\n/**\n * Sunday-through-Saturday week rendered as one shared hourly time grid — the\n * seven-day sibling of `calendar-day`. Unlike `calendar-year` composing 12\n * `calendar-month` children, this is its own independent 7-column layout\n * (not 7 nested `<calendar-day>` elements): a single hour gutter is drawn\n * once, and multi-day/all-day entries span the days they cover as one\n * continuous bar in a shared all-day band, since lanes for that band are\n * assigned once across the whole visible week (unlike `calendar-month`'s\n * documented per-instance lane limitation). Timed entries stack into\n * side-by-side columns independently per day, same as `calendar-day`.\n * Read-only.\n *\n * Shares its slotted-entry observation, resolution, and hover/focus\n * interaction sync with `calendar-day` via `CalendarTimelineBase`.\n *\n * @element calendar-week\n * @slot - Declarative `calendar-entry` elements to render for this week.\n * @slot actions - Optional controls rendered beside the day headers (e.g. week-navigation buttons).\n */\n@customElement(\"calendar-week\")\nexport class CalendarWeek extends CalendarTimelineBase {\n /** Any date within the displayed week (`\"YYYY-MM-DD\"`) — the week runs Sunday through Saturday. */\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 .week-header-row {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin-bottom: 0.5rem;\n }\n .week-header {\n display: flex;\n flex: 1 1 auto;\n min-width: 0;\n }\n .actions {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n gap: 0.5rem;\n }\n .hour-gutter-spacer {\n flex: 0 0 3rem;\n }\n .day-header {\n flex: 1 1 0;\n color: var(--ui-text-muted, #64748b);\n font-weight: var(--ui-font-weight-semibold, 600);\n text-align: center;\n }\n .day-header .day-number {\n color: var(--ui-text, #0f172a);\n font-size: var(--ui-font-size-lg, 1rem);\n }\n .day-header.today,\n .day-header.today .day-number {\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 .all-day-lanes {\n display: grid;\n flex: 1 1 auto;\n grid-auto-rows: min-content;\n grid-template-columns: repeat(7, 1fr);\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 .week-days {\n display: flex;\n flex: 1 1 auto;\n }\n .day-column {\n position: relative;\n flex: 1 1 0;\n height: ${HOUR_HEIGHT_REM * 24}rem;\n border-left: 1px solid var(--ui-border, #e2e8f0);\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 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 /** Renders one all-day/multi-day bar, spanning the visible-week columns it covers. */\n private _renderAllDayEntry(entry: LanedEntry, weekStart: Date, weekEnd: Date) {\n const visibleStart = entry.startDate < weekStart ? weekStart : entry.startDate;\n const visibleEnd = entry.endDate > weekEnd ? weekEnd : entry.endDate;\n const startCol = dayIndex(visibleStart, weekStart) + 1;\n const endCol = dayIndex(visibleEnd, weekStart) + 2;\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 style=\"grid-column: ${startCol} / ${endCol}; grid-row: ${entry.lane + 1};\"\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 /** Renders a positioned/sized block for one timed entry, clamped to `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 /** Renders one day's hour column: grid lines plus its own independently laned timed entries. */\n private _renderDayColumn(day: Date, timedWeek: ResolvedTimedEntry[], todayIso: string) {\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 dayTimed = timedWeek.filter((entry) => overlapsRange(entry, dayStart, dayEnd));\n const { entries: laned, laneCount } = assignLanes(dayTimed);\n const isToday = toIsoDate(day) === todayIso;\n return html`\n <div class=\"day-column ${isToday ? \"today\" : \"\"}\">\n ${HOURS.map(() => html`<div class=\"hour-line\"></div>`)}\n ${repeat(\n laned,\n (entry) => this.entryKey(entry),\n (entry) => this._renderTimedEntry(entry, Math.max(laneCount, 1), dayStart, dayEnd),\n )}\n </div>\n `;\n }\n\n protected override render() {\n const anyDayInWeek = parseIsoDate(this.date) ?? new Date();\n const weekStart = startOfWeek(anyDayInWeek);\n const days = Array.from({ length: 7 }, (_, i) => addDays(weekStart, i));\n const weekEnd = new Date(days[6]);\n weekEnd.setHours(23, 59, 59, 999);\n const todayIso = toIsoDate(new Date());\n\n const resolved = this.resolveTimedEntriesFor(weekStart, weekEnd);\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\n return html`\n <div class=\"week\">\n <div class=\"week-header-row\">\n <div class=\"week-header\">\n <div class=\"hour-gutter-spacer\"></div>\n ${days.map(\n (day) => html`\n <div class=\"day-header ${toIsoDate(day) === todayIso ? \"today\" : \"\"}\">\n <div>${WEEKDAY_ABBR[day.getDay()]}</div>\n <div class=\"day-number\">${day.getDate()}</div>\n </div>\n `,\n )}\n </div>\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\" style=\"grid-template-rows: repeat(${Math.max(allDayLaneCount, 1)}, min-content);\">\n ${repeat(\n lanedAllDay,\n (entry) => this.entryKey(entry),\n (entry) => this._renderAllDayEntry(entry, weekStart, weekEnd),\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=\"week-days\">\n ${days.map((day) => this._renderDayColumn(day, timed, todayIso))}\n </div>\n </div>\n <slot @slotchange=${this.handleSlotChange}></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"calendar-week\": CalendarWeek;\n }\n}\n"]}