@lit-material/calendar 0.0.0-init → 1.0.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.
@@ -0,0 +1,64 @@
1
+ import { type CalendarDate } from "./calendar-utils.js";
2
+ /** A `DateTimeFormat` for `lang`, built once per language and option set; an invalid `lang` falls back to the default locale. */
3
+ export declare function formatter(lang: string, name: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
4
+ /** `start – end` the way the language writes a range ("Jun 14 – 20, 2026"); the same instant prints once. */
5
+ export declare function formatRange(format: Intl.DateTimeFormat, start: Date, end: Date): string;
6
+ export declare const OPTIONS: {
7
+ monthTitle: {
8
+ month: "long";
9
+ year: "numeric";
10
+ };
11
+ rangeTitle: {
12
+ month: "short";
13
+ day: "numeric";
14
+ year: "numeric";
15
+ };
16
+ dayTitle: {
17
+ weekday: "long";
18
+ month: "long";
19
+ day: "numeric";
20
+ year: "numeric";
21
+ };
22
+ fullDate: {
23
+ weekday: "long";
24
+ month: "long";
25
+ day: "numeric";
26
+ year: "numeric";
27
+ };
28
+ eventDate: {
29
+ weekday: "long";
30
+ month: "long";
31
+ day: "numeric";
32
+ };
33
+ eventDateTime: {
34
+ weekday: "long";
35
+ month: "long";
36
+ day: "numeric";
37
+ hour: "numeric";
38
+ minute: "2-digit";
39
+ };
40
+ time: {
41
+ hour: "numeric";
42
+ minute: "2-digit";
43
+ };
44
+ hour: {
45
+ hour: "numeric";
46
+ };
47
+ weekdayShort: {
48
+ weekday: "short";
49
+ };
50
+ weekdayLong: {
51
+ weekday: "long";
52
+ };
53
+ agendaDate: {
54
+ weekday: "short";
55
+ month: "short";
56
+ day: "numeric";
57
+ };
58
+ };
59
+ export type FormatName = keyof typeof OPTIONS;
60
+ export declare function format(lang: string, name: FormatName, date: Date | CalendarDate): string;
61
+ export declare function range(lang: string, name: FormatName, start: Date | CalendarDate, end: Date | CalendarDate): string;
62
+ /** A day number in `lang`'s digits. */
63
+ export declare function dayNumber(lang: string, value: number): string;
64
+ //# sourceMappingURL=calendar-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-format.d.ts","sourceRoot":"","sources":["../src/calendar-format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAU,MAAM,qBAAqB,CAAC;AAIhE,iIAAiI;AACjI,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,cAAc,CAY9G;AAID,6GAA6G;AAC7G,wBAAgB,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,MAAM,CAWvF;AAED,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYkC,CAAC;AAEvD,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,OAAO,CAAC;AAE9C,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,GAAG,YAAY,GAAG,MAAM,CAExF;AAED,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,GAAG,YAAY,EAAE,GAAG,EAAE,IAAI,GAAG,YAAY,GAAG,MAAM,CAElH;AAID,uCAAuC;AACvC,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAW7D"}
@@ -0,0 +1,67 @@
1
+ import { toDate } from "./calendar-utils.js";
2
+ const formatters = new Map();
3
+ /** A `DateTimeFormat` for `lang`, built once per language and option set; an invalid `lang` falls back to the default locale. */
4
+ export function formatter(lang, name, options) {
5
+ const key = `${lang}|${name}`;
6
+ let format = formatters.get(key);
7
+ if (!format) {
8
+ try {
9
+ format = new Intl.DateTimeFormat(lang, options);
10
+ }
11
+ catch {
12
+ format = new Intl.DateTimeFormat(undefined, options);
13
+ }
14
+ formatters.set(key, format);
15
+ }
16
+ return format;
17
+ }
18
+ /** `start – end` the way the language writes a range ("Jun 14 – 20, 2026"); the same instant prints once. */
19
+ export function formatRange(format, start, end) {
20
+ if (start.getTime() === end.getTime())
21
+ return format.format(start);
22
+ const range = format.formatRange;
23
+ if (typeof range === "function") {
24
+ try {
25
+ return range.call(format, start, end);
26
+ }
27
+ catch {
28
+ // fall through
29
+ }
30
+ }
31
+ return `${format.format(start)} – ${format.format(end)}`;
32
+ }
33
+ export const OPTIONS = {
34
+ monthTitle: { month: "long", year: "numeric" },
35
+ rangeTitle: { month: "short", day: "numeric", year: "numeric" },
36
+ dayTitle: { weekday: "long", month: "long", day: "numeric", year: "numeric" },
37
+ fullDate: { weekday: "long", month: "long", day: "numeric", year: "numeric" },
38
+ eventDate: { weekday: "long", month: "long", day: "numeric" },
39
+ eventDateTime: { weekday: "long", month: "long", day: "numeric", hour: "numeric", minute: "2-digit" },
40
+ time: { hour: "numeric", minute: "2-digit" },
41
+ hour: { hour: "numeric" },
42
+ weekdayShort: { weekday: "short" },
43
+ weekdayLong: { weekday: "long" },
44
+ agendaDate: { weekday: "short", month: "short", day: "numeric" },
45
+ };
46
+ export function format(lang, name, date) {
47
+ return formatter(lang, name, OPTIONS[name]).format(date instanceof Date ? date : toDate(date));
48
+ }
49
+ export function range(lang, name, start, end) {
50
+ return formatRange(formatter(lang, name, OPTIONS[name]), start instanceof Date ? start : toDate(start), end instanceof Date ? end : toDate(end));
51
+ }
52
+ const numberFormats = new Map();
53
+ /** A day number in `lang`'s digits. */
54
+ export function dayNumber(lang, value) {
55
+ let f = numberFormats.get(lang);
56
+ if (!f) {
57
+ try {
58
+ f = new Intl.NumberFormat(lang, { useGrouping: false });
59
+ }
60
+ catch {
61
+ f = new Intl.NumberFormat(undefined, { useGrouping: false });
62
+ }
63
+ numberFormats.set(lang, f);
64
+ }
65
+ return f.format(value);
66
+ }
67
+ //# sourceMappingURL=calendar-format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-format.js","sourceRoot":"","sources":["../src/calendar-format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAEhE,MAAM,UAAU,GAAG,IAAI,GAAG,EAA+B,CAAC;AAE1D,iIAAiI;AACjI,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,IAAY,EAAE,OAAmC;IACvF,MAAM,GAAG,GAAG,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;IAC9B,IAAI,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACvD,CAAC;QACD,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAID,6GAA6G;AAC7G,MAAM,UAAU,WAAW,CAAC,MAA2B,EAAE,KAAW,EAAE,GAAS;IAC7E,IAAI,KAAK,CAAC,OAAO,EAAE,KAAK,GAAG,CAAC,OAAO,EAAE;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnE,MAAM,KAAK,GAAI,MAAsB,CAAC,WAAW,CAAC;IAClD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,IAAI,CAAC;YACH,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACxC,CAA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2 @@
1
+ export declare const styles: import("lit").CSSResult;
2
+ //# sourceMappingURL=calendar-styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-styles.d.ts","sourceRoot":"","sources":["../src/calendar-styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA4clB,CAAC"}
@@ -0,0 +1,463 @@
1
+ import { css } from "lit";
2
+ export const styles = css `
3
+ :host {
4
+ --cal-slot-height: var(--lit-material-calendar-slot-height, 24px);
5
+ --cal-height: var(--lit-material-calendar-height, 640px);
6
+ --cal-gutter: 64px;
7
+ --cal-chip: 20px;
8
+ --cal-lane: 22px;
9
+ --cal-day-label: 28px;
10
+ --cal-outline: var(--md-sys-color-outline-variant, light-dark(#cac4d0, #49454f));
11
+ --cal-muted: var(--md-sys-color-on-surface-variant, light-dark(#49454f, #cac4d0));
12
+ --cal-surface: var(--md-sys-color-surface, light-dark(#fef7ff, #141218));
13
+ --cal-primary: var(--md-sys-color-primary, light-dark(#6750a4, #d0bcff));
14
+ --cal-on-primary: var(--md-sys-color-on-primary, light-dark(#ffffff, #381e72));
15
+ display: block;
16
+ color: var(--md-sys-color-on-surface, light-dark(#1d1b20, #e6e0e9));
17
+ font-family: var(--md-sys-typescale-body-medium-font, Roboto, system-ui, sans-serif);
18
+ font-size: var(--md-sys-typescale-body-medium-size, 0.875rem);
19
+ }
20
+ :host([hidden]) {
21
+ display: none;
22
+ }
23
+ .visually-hidden {
24
+ position: absolute;
25
+ width: 1px;
26
+ height: 1px;
27
+ overflow: hidden;
28
+ clip-path: inset(50%);
29
+ white-space: nowrap;
30
+ }
31
+ button {
32
+ font: inherit;
33
+ color: inherit;
34
+ }
35
+ :focus-visible {
36
+ outline: 2px solid var(--cal-primary);
37
+ outline-offset: -2px;
38
+ }
39
+
40
+ /* Toolbar */
41
+ .toolbar {
42
+ display: flex;
43
+ flex-wrap: wrap;
44
+ align-items: center;
45
+ gap: 8px 16px;
46
+ padding-block-end: 12px;
47
+ }
48
+ .nav {
49
+ display: flex;
50
+ align-items: center;
51
+ gap: 4px;
52
+ }
53
+ .title {
54
+ flex: 1 1 auto;
55
+ margin: 0;
56
+ font-family: var(--md-sys-typescale-title-large-font, inherit);
57
+ font-size: var(--md-sys-typescale-title-large-size, 1.375rem);
58
+ font-weight: var(--md-sys-typescale-title-large-weight, 400);
59
+ line-height: 1.3;
60
+ }
61
+ .today-button {
62
+ block-size: 40px;
63
+ padding-inline: 16px;
64
+ border: 1px solid var(--md-sys-color-outline, light-dark(#79747e, #938f99));
65
+ border-radius: var(--md-sys-shape-corner-full, 20px);
66
+ background: none;
67
+ color: var(--cal-primary);
68
+ font-weight: 500;
69
+ cursor: pointer;
70
+ }
71
+ .icon-button {
72
+ display: inline-grid;
73
+ place-items: center;
74
+ inline-size: 40px;
75
+ block-size: 40px;
76
+ padding: 0;
77
+ border: none;
78
+ border-radius: 50%;
79
+ background: none;
80
+ color: var(--cal-muted);
81
+ cursor: pointer;
82
+ }
83
+ .today-button:hover,
84
+ .icon-button:hover {
85
+ background: color-mix(in srgb, currentColor 8%, transparent);
86
+ }
87
+ .nav-icon {
88
+ inline-size: 24px;
89
+ block-size: 24px;
90
+ fill: currentColor;
91
+ }
92
+ :host(:dir(rtl)) .nav-icon {
93
+ transform: scaleX(-1);
94
+ }
95
+
96
+ /* Event chips */
97
+ .event {
98
+ --c: var(--event-color, var(--cal-primary));
99
+ display: flex;
100
+ align-items: baseline;
101
+ gap: 4px;
102
+ box-sizing: border-box;
103
+ margin: 0;
104
+ padding: 0 6px;
105
+ border: none;
106
+ border-inline-start: 3px solid var(--c);
107
+ border-radius: 4px;
108
+ background: color-mix(in srgb, var(--c) 18%, var(--cal-surface));
109
+ color: var(--md-sys-color-on-surface, light-dark(#1d1b20, #e6e0e9));
110
+ font-size: var(--md-sys-typescale-label-medium-size, 0.75rem);
111
+ line-height: var(--cal-chip);
112
+ text-align: start;
113
+ white-space: nowrap;
114
+ overflow: hidden;
115
+ cursor: pointer;
116
+ }
117
+ .event.editable {
118
+ touch-action: none;
119
+ }
120
+ .event:hover,
121
+ .event:focus-visible {
122
+ z-index: 2;
123
+ background: color-mix(in srgb, var(--c) 30%, var(--cal-surface));
124
+ }
125
+ .event.dragging {
126
+ opacity: 0.8;
127
+ box-shadow: var(--md-sys-elevation-level2, 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 6px 2px rgba(0, 0, 0, 0.15));
128
+ z-index: 2;
129
+ }
130
+ .event.continues-before {
131
+ border-start-start-radius: 0;
132
+ border-end-start-radius: 0;
133
+ }
134
+ .event.continues-after {
135
+ border-start-end-radius: 0;
136
+ border-end-end-radius: 0;
137
+ }
138
+ .event-title {
139
+ overflow: hidden;
140
+ text-overflow: ellipsis;
141
+ font-weight: 500;
142
+ }
143
+ .time {
144
+ color: var(--cal-muted);
145
+ font-variant-numeric: tabular-nums;
146
+ }
147
+ /* Times read in their own direction ("9:00 AM" stays put in a right-to-left page). */
148
+ .time,
149
+ .agenda-time,
150
+ .time-label span {
151
+ unicode-bidi: plaintext;
152
+ }
153
+
154
+ /* Month */
155
+ .month {
156
+ border: 1px solid var(--cal-outline);
157
+ border-radius: var(--md-sys-shape-corner-medium, 12px);
158
+ }
159
+ .row {
160
+ display: grid;
161
+ }
162
+ .month .row {
163
+ grid-template-columns: repeat(7, minmax(0, 1fr));
164
+ }
165
+ .weekday {
166
+ padding: 8px 4px;
167
+ color: var(--cal-muted);
168
+ font-size: var(--md-sys-typescale-label-medium-size, 0.75rem);
169
+ font-weight: 500;
170
+ text-align: center;
171
+ }
172
+ .day {
173
+ position: relative;
174
+ box-sizing: border-box;
175
+ min-block-size: calc(var(--cal-day-label) + (var(--max-lanes) + 1) * var(--cal-lane) + 4px);
176
+ border-block-start: 1px solid var(--cal-outline);
177
+ border-inline-start: 1px solid var(--cal-outline);
178
+ cursor: pointer;
179
+ }
180
+ .day:first-child {
181
+ border-inline-start-color: transparent;
182
+ }
183
+ .day.outside {
184
+ background: color-mix(in srgb, var(--cal-outline) 18%, transparent);
185
+ }
186
+ .day.outside .day-number {
187
+ color: var(--cal-muted);
188
+ }
189
+ .day-number {
190
+ display: inline-grid;
191
+ place-items: center;
192
+ min-inline-size: 24px;
193
+ block-size: 24px;
194
+ margin: 2px;
195
+ border-radius: 12px;
196
+ font-size: var(--md-sys-typescale-label-medium-size, 0.75rem);
197
+ font-weight: 500;
198
+ }
199
+ .today .day-number,
200
+ .day-header.today .date-number {
201
+ background: var(--cal-primary);
202
+ color: var(--cal-on-primary);
203
+ }
204
+ .month .event {
205
+ position: absolute;
206
+ z-index: 1;
207
+ inset-block-start: calc(var(--cal-day-label) + var(--lane) * var(--cal-lane));
208
+ inset-inline-start: 2px;
209
+ inline-size: calc(var(--span) * (100% + 1px) - 5px);
210
+ block-size: var(--cal-chip);
211
+ }
212
+ .month .event.timed {
213
+ border-inline-start-width: 0;
214
+ background: none;
215
+ }
216
+ .month .event.timed::before {
217
+ content: "";
218
+ flex: none;
219
+ align-self: center;
220
+ inline-size: 8px;
221
+ block-size: 8px;
222
+ border-radius: 50%;
223
+ background: var(--c);
224
+ }
225
+ .month .event.timed:hover,
226
+ .month .event.timed:focus-visible {
227
+ background: color-mix(in srgb, var(--c) 14%, var(--cal-surface));
228
+ }
229
+ .more {
230
+ position: absolute;
231
+ inset-block-start: calc(var(--cal-day-label) + var(--max-lanes) * var(--cal-lane));
232
+ inset-inline-start: 2px;
233
+ padding: 0 6px;
234
+ border: none;
235
+ border-radius: 4px;
236
+ background: none;
237
+ color: var(--cal-muted);
238
+ font-size: var(--md-sys-typescale-label-medium-size, 0.75rem);
239
+ font-weight: 500;
240
+ line-height: var(--cal-chip);
241
+ cursor: pointer;
242
+ }
243
+ .more:hover {
244
+ background: color-mix(in srgb, currentColor 8%, transparent);
245
+ }
246
+
247
+ /* Week and day */
248
+ .time-grid {
249
+ position: relative;
250
+ max-block-size: var(--cal-height);
251
+ overflow: auto;
252
+ border: 1px solid var(--cal-outline);
253
+ border-radius: var(--md-sys-shape-corner-medium, 12px);
254
+ overscroll-behavior: contain;
255
+ }
256
+ .time-grid .row {
257
+ grid-template-columns: var(--cal-gutter) repeat(var(--days), minmax(0, 1fr));
258
+ }
259
+ .head {
260
+ position: sticky;
261
+ inset-block-start: 0;
262
+ z-index: 3;
263
+ background: var(--cal-surface);
264
+ border-block-end: 1px solid var(--cal-outline);
265
+ }
266
+ .day-header {
267
+ display: flex;
268
+ flex-direction: column;
269
+ align-items: center;
270
+ gap: 2px;
271
+ padding-block: 6px;
272
+ border-inline-start: 1px solid var(--cal-outline);
273
+ }
274
+ .day-header .weekday {
275
+ padding: 0;
276
+ }
277
+ .date-number {
278
+ display: inline-grid;
279
+ place-items: center;
280
+ min-inline-size: 32px;
281
+ block-size: 32px;
282
+ border-radius: 16px;
283
+ font-size: var(--md-sys-typescale-title-medium-size, 1rem);
284
+ font-weight: 500;
285
+ }
286
+ .time-label {
287
+ position: relative;
288
+ padding-inline: 4px 8px;
289
+ color: var(--cal-muted);
290
+ font-size: var(--md-sys-typescale-label-small-size, 0.6875rem);
291
+ text-align: end;
292
+ line-height: 1;
293
+ }
294
+ .slot-row .time-label span[aria-hidden] {
295
+ position: relative;
296
+ inset-block-start: -0.5em;
297
+ }
298
+ .slot-row:first-child .time-label span[aria-hidden] {
299
+ inset-block-start: 0;
300
+ }
301
+ .all-day-label {
302
+ align-self: center;
303
+ }
304
+ .cell {
305
+ position: relative;
306
+ box-sizing: border-box;
307
+ border-inline-start: 1px solid var(--cal-outline);
308
+ cursor: pointer;
309
+ }
310
+ .all-day-cell {
311
+ min-block-size: calc(var(--lanes) * var(--cal-lane) + 6px);
312
+ }
313
+ .all-day-cell .event {
314
+ position: absolute;
315
+ z-index: 1;
316
+ inset-block-start: calc(2px + var(--lane) * var(--cal-lane));
317
+ inset-inline-start: 2px;
318
+ inline-size: calc(var(--span) * (100% + 1px) - 5px);
319
+ block-size: var(--cal-chip);
320
+ }
321
+ .slot {
322
+ block-size: var(--cal-slot-height);
323
+ border-block-start: 1px dotted color-mix(in srgb, var(--cal-outline) 70%, transparent);
324
+ }
325
+ .hour .slot {
326
+ border-block-start: 1px solid var(--cal-outline);
327
+ }
328
+ .slot-row:first-child .slot {
329
+ border-block-start-color: transparent;
330
+ }
331
+ .slot.selected {
332
+ background: color-mix(in srgb, var(--cal-primary) 16%, transparent);
333
+ }
334
+ .timed-block {
335
+ position: absolute;
336
+ z-index: 1;
337
+ flex-direction: column;
338
+ align-items: stretch;
339
+ gap: 0;
340
+ inset-block-start: calc(var(--offset) * var(--cal-slot-height));
341
+ block-size: max(12px, calc(var(--length) * var(--cal-slot-height) - 2px));
342
+ inset-inline-start: calc(2px + var(--col) * (100% - 8px) / var(--cols));
343
+ inline-size: calc((100% - 8px) / var(--cols) - 2px);
344
+ padding-block: 2px;
345
+ white-space: normal;
346
+ line-height: 1.25;
347
+ }
348
+ .timed-block .event-title,
349
+ .timed-block .time {
350
+ white-space: nowrap;
351
+ overflow: hidden;
352
+ text-overflow: ellipsis;
353
+ }
354
+ .timed-block.short {
355
+ flex-direction: row;
356
+ padding-block: 0;
357
+ gap: 4px;
358
+ }
359
+ .resize {
360
+ position: absolute;
361
+ inset-inline: 0;
362
+ inset-block-end: 0;
363
+ block-size: 6px;
364
+ cursor: ns-resize;
365
+ }
366
+ .now {
367
+ position: absolute;
368
+ z-index: 2;
369
+ inset-inline: 0;
370
+ inset-block-start: calc(var(--offset) * var(--cal-slot-height));
371
+ border-block-start: 2px solid var(--md-sys-color-error, light-dark(#b3261e, #f2b8b5));
372
+ pointer-events: none;
373
+ }
374
+
375
+ /* Agenda */
376
+ .agenda {
377
+ display: grid;
378
+ gap: 8px;
379
+ }
380
+ .agenda-day {
381
+ display: grid;
382
+ grid-template-columns: 9rem minmax(0, 1fr);
383
+ gap: 8px;
384
+ padding-block: 8px;
385
+ border-block-start: 1px solid var(--cal-outline);
386
+ }
387
+ .agenda-date {
388
+ margin: 0;
389
+ font-size: var(--md-sys-typescale-title-small-size, 0.875rem);
390
+ font-weight: 500;
391
+ line-height: 2rem;
392
+ }
393
+ .agenda-day.today .agenda-date {
394
+ color: var(--cal-primary);
395
+ }
396
+ .agenda ul {
397
+ display: grid;
398
+ gap: 2px;
399
+ margin: 0;
400
+ padding: 0;
401
+ list-style: none;
402
+ }
403
+ .agenda-event {
404
+ inline-size: 100%;
405
+ align-items: center;
406
+ gap: 12px;
407
+ padding: 6px 8px;
408
+ border-inline-start: none;
409
+ background: none;
410
+ font-size: inherit;
411
+ line-height: 1.4;
412
+ }
413
+ .agenda-event:hover,
414
+ .agenda-event:focus-visible {
415
+ background: color-mix(in srgb, var(--c) 12%, var(--cal-surface));
416
+ }
417
+ .agenda-time {
418
+ flex: none;
419
+ min-inline-size: 9rem;
420
+ color: var(--cal-muted);
421
+ font-variant-numeric: tabular-nums;
422
+ }
423
+ .dot {
424
+ flex: none;
425
+ inline-size: 10px;
426
+ block-size: 10px;
427
+ border-radius: 50%;
428
+ background: var(--c);
429
+ }
430
+ .empty {
431
+ margin: 0;
432
+ padding: 24px;
433
+ color: var(--cal-muted);
434
+ text-align: center;
435
+ }
436
+
437
+ @media (max-width: 600px) {
438
+ .agenda-day {
439
+ grid-template-columns: 1fr;
440
+ }
441
+ .agenda-time {
442
+ min-inline-size: 6rem;
443
+ }
444
+ :host {
445
+ --cal-gutter: 48px;
446
+ }
447
+ }
448
+
449
+ @media (forced-colors: active) {
450
+ .event {
451
+ border: 1px solid CanvasText;
452
+ border-inline-start-width: 3px;
453
+ }
454
+ .slot.selected {
455
+ background: Highlight;
456
+ }
457
+ .today .day-number,
458
+ .day-header.today .date-number {
459
+ border: 1px solid CanvasText;
460
+ }
461
+ }
462
+ `;
463
+ //# sourceMappingURL=calendar-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-styles.js","sourceRoot":"","sources":["../src/calendar-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4cxB,CAAC"}