@nomideusz/svelte-calendar 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calendar/Calendar.svelte +37 -43
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/locale.d.ts +5 -0
- package/dist/core/locale.js +9 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/primitives/EmptySlot.svelte +2 -1
- package/dist/primitives/EventBlock.svelte +4 -2
- package/dist/primitives/NowIndicator.svelte +2 -1
- package/dist/primitives/TimeGutter.svelte +4 -2
- package/dist/text-fit.js +6 -1
- package/dist/theme/auto.js +10 -7
- package/dist/theme/presets.d.ts +13 -7
- package/dist/theme/presets.js +27 -18
- package/dist/views/agenda/AgendaDay.svelte +147 -115
- package/dist/views/agenda/AgendaWeek.svelte +106 -90
- package/dist/views/mobile/MobileDay.svelte +83 -63
- package/dist/views/mobile/MobileWeek.svelte +42 -34
- package/dist/views/month/MonthGrid.svelte +21 -17
- package/dist/views/planner/PlannerScroll.svelte +86 -87
- package/dist/views/planner/PlannerWeek.svelte +160 -91
- package/package.json +6 -6
- package/widget/widget.js +387 -380
|
@@ -784,11 +784,11 @@ function onCellKeydown(e, ms) {
|
|
|
784
784
|
{#if seg.isStart}
|
|
785
785
|
<span class="wg-ad-title">{seg.ev.title}</span>
|
|
786
786
|
{:else}
|
|
787
|
-
<span class="wg-ad-cont" aria-hidden="true"
|
|
787
|
+
<span class="wg-ad-cont" aria-hidden="true"><svg viewBox="0 0 8 8" width="8" height="8"><path d="M5.5 1.5 2.5 4l3 2.5" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" /></svg></span>
|
|
788
788
|
<span class="wg-ad-title">{seg.ev.title}</span>
|
|
789
789
|
{/if}
|
|
790
790
|
{#if !seg.isEnd && seg.totalDays > 1}
|
|
791
|
-
<span class="wg-ad-arrow" aria-hidden="true"
|
|
791
|
+
<span class="wg-ad-arrow" aria-hidden="true"><svg viewBox="0 0 8 8" width="8" height="8"><path d="M2.5 1.5 5.5 4l-3 2.5" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" /></svg></span>
|
|
792
792
|
{/if}
|
|
793
793
|
{/snippet}
|
|
794
794
|
|
|
@@ -1045,7 +1045,7 @@ function onCellKeydown(e, ms) {
|
|
|
1045
1045
|
.wg-body::-webkit-scrollbar { width: 4px; }
|
|
1046
1046
|
.wg-body::-webkit-scrollbar-thumb {
|
|
1047
1047
|
background: var(--dt-scrollbar, rgba(0, 0, 0, 0.1));
|
|
1048
|
-
border-radius:
|
|
1048
|
+
border-radius: 0;
|
|
1049
1049
|
}
|
|
1050
1050
|
.wg-body::-webkit-scrollbar-track { background: transparent; }
|
|
1051
1051
|
|
|
@@ -1060,17 +1060,16 @@ function onCellKeydown(e, ms) {
|
|
|
1060
1060
|
/* ─── Week row ───────────────────────────────────── */
|
|
1061
1061
|
.wg-week {
|
|
1062
1062
|
display: flex;
|
|
1063
|
-
border-radius:
|
|
1063
|
+
border-radius: 0;
|
|
1064
1064
|
margin: var(--wg-row-margin, 12px) 8px;
|
|
1065
|
-
border:
|
|
1065
|
+
border: 1px solid var(--dt-border, rgba(0, 0, 0, 0.08));
|
|
1066
1066
|
overflow: hidden;
|
|
1067
1067
|
}
|
|
1068
1068
|
|
|
1069
1069
|
.wg-week--current {
|
|
1070
1070
|
background: var(--dt-today-bg, rgba(37, 99, 235, 0.04));
|
|
1071
|
-
/*
|
|
1072
|
-
border-color: var(--dt-
|
|
1073
|
-
box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--dt-accent, #2563eb) 55%, transparent);
|
|
1071
|
+
/* The current row's frame is a day rule, not the accent */
|
|
1072
|
+
border-color: var(--dt-border-day, rgba(0, 0, 0, 0.3));
|
|
1074
1073
|
}
|
|
1075
1074
|
|
|
1076
1075
|
/* ─── Week body ──────────────────────────────────── */
|
|
@@ -1133,21 +1132,18 @@ function onCellKeydown(e, ms) {
|
|
|
1133
1132
|
|
|
1134
1133
|
.wg-cell--today { background: var(--dt-today-bg, rgba(37, 99, 235, 0.04)); }
|
|
1135
1134
|
.wg-cell--drop {
|
|
1136
|
-
background:
|
|
1135
|
+
background: var(--dt-accent-dim, rgba(37, 99, 235, 0.12)) !important;
|
|
1137
1136
|
box-shadow: inset 0 0 0 2px var(--dt-accent, #2563eb);
|
|
1138
1137
|
}
|
|
1139
|
-
.wg-cell--today:hover { background:
|
|
1138
|
+
.wg-cell--today:hover { background: var(--dt-hover, rgba(0, 0, 0, 0.04)); }
|
|
1140
1139
|
|
|
1141
|
-
/*
|
|
1142
|
-
|
|
1143
|
-
.wg-week:not(.wg-week--current) .wg-cell {
|
|
1144
|
-
background: color-mix(in srgb, var(--dt-text, rgba(0, 0, 0, 0.87)) 2.5%, transparent);
|
|
1145
|
-
}
|
|
1140
|
+
/* Non-current weeks sit on the same paper; only the header ink softens,
|
|
1141
|
+
and past events print a shade lighter. */
|
|
1146
1142
|
.wg-week:not(.wg-week--current) .wg-day-num {
|
|
1147
1143
|
color: var(--dt-text-2, rgba(0, 0, 0, 0.54));
|
|
1148
1144
|
}
|
|
1149
|
-
.wg-
|
|
1150
|
-
|
|
1145
|
+
.wg-cell--past .wg-ev:not(.wg-ev--cancelled) {
|
|
1146
|
+
opacity: 0.78;
|
|
1151
1147
|
}
|
|
1152
1148
|
|
|
1153
1149
|
/* equalDays: when no cells are marked past, all are full brightness */
|
|
@@ -1177,7 +1173,7 @@ function onCellKeydown(e, ms) {
|
|
|
1177
1173
|
align-items: flex-start;
|
|
1178
1174
|
gap: 3px;
|
|
1179
1175
|
padding: 2px 4px;
|
|
1180
|
-
border-radius:
|
|
1176
|
+
border-radius: 0;
|
|
1181
1177
|
background: repeating-linear-gradient(
|
|
1182
1178
|
-45deg,
|
|
1183
1179
|
color-mix(in srgb, var(--dt-text, rgba(0, 0, 0, 0.87)) 4%, transparent),
|
|
@@ -1208,11 +1204,11 @@ function onCellKeydown(e, ms) {
|
|
|
1208
1204
|
gap: 4px;
|
|
1209
1205
|
padding: 3px 7px;
|
|
1210
1206
|
margin: 1px 0 2px;
|
|
1211
|
-
border-radius:
|
|
1207
|
+
border-radius: 0;
|
|
1212
1208
|
}
|
|
1213
1209
|
|
|
1214
1210
|
.wg-day-wd {
|
|
1215
|
-
font: 400
|
|
1211
|
+
font: 400 11px / 1 var(--dt-sans, system-ui, sans-serif);
|
|
1216
1212
|
letter-spacing: 0.04em;
|
|
1217
1213
|
text-transform: uppercase;
|
|
1218
1214
|
color: var(--dt-text-3, rgba(0, 0, 0, 0.38));
|
|
@@ -1232,12 +1228,13 @@ function onCellKeydown(e, ms) {
|
|
|
1232
1228
|
}
|
|
1233
1229
|
|
|
1234
1230
|
/* Today's pill — after the week rules above, which it must beat */
|
|
1235
|
-
.wg-cell-hd--today {
|
|
1236
|
-
background: var(--dt-accent, #2563eb);
|
|
1237
|
-
}
|
|
1238
1231
|
.wg-cell-hd--today .wg-day-wd,
|
|
1239
1232
|
.wg-cell-hd--today .wg-day-num {
|
|
1240
|
-
color: var(--dt-
|
|
1233
|
+
color: var(--dt-accent, #2563eb);
|
|
1234
|
+
}
|
|
1235
|
+
.wg-cell-hd--today .wg-day-num {
|
|
1236
|
+
box-shadow: inset 0 -2px 0 var(--dt-accent, #2563eb);
|
|
1237
|
+
padding-bottom: 2px;
|
|
1241
1238
|
}
|
|
1242
1239
|
|
|
1243
1240
|
/* ─── All-day / multi-day events ─────────────────── */
|
|
@@ -1257,11 +1254,13 @@ function onCellKeydown(e, ms) {
|
|
|
1257
1254
|
height: var(--wg-chip-h, 22px);
|
|
1258
1255
|
box-sizing: border-box;
|
|
1259
1256
|
flex-shrink: 0;
|
|
1260
|
-
border-radius:
|
|
1261
|
-
|
|
1257
|
+
border-radius: 0;
|
|
1258
|
+
border: none;
|
|
1259
|
+
background: var(--ev-color);
|
|
1260
|
+
color: var(--dt-btn-text, #fff);
|
|
1262
1261
|
cursor: pointer;
|
|
1263
1262
|
overflow: hidden;
|
|
1264
|
-
transition:
|
|
1263
|
+
transition: filter 0.12s;
|
|
1265
1264
|
min-height: 18px;
|
|
1266
1265
|
}
|
|
1267
1266
|
|
|
@@ -1270,36 +1269,25 @@ function onCellKeydown(e, ms) {
|
|
|
1270
1269
|
z-index: 8;
|
|
1271
1270
|
opacity: 0.95;
|
|
1272
1271
|
pointer-events: none;
|
|
1273
|
-
box-shadow: 0 6px 18px color-mix(in srgb, var(--ev-color) 26%, rgba(0, 0, 0, 0.22));
|
|
1274
|
-
outline: 1px solid color-mix(in srgb, var(--ev-color) 42%, transparent);
|
|
1275
1272
|
cursor: grabbing;
|
|
1276
1273
|
}
|
|
1277
1274
|
|
|
1278
1275
|
.wg-ad:hover {
|
|
1279
|
-
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
.wg-ad--start {
|
|
1283
|
-
border-left: 2.5px solid var(--ev-color);
|
|
1276
|
+
filter: brightness(1.08);
|
|
1284
1277
|
}
|
|
1285
1278
|
|
|
1286
|
-
.wg-ad--
|
|
1287
|
-
|
|
1288
|
-
border-left: 1px dashed color-mix(in srgb, var(--ev-color) 40%, transparent);
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
.wg-ad--end:not(.wg-ad--start) {
|
|
1292
|
-
border-radius: 0 3px 3px 0;
|
|
1293
|
-
border-left: 1px dashed color-mix(in srgb, var(--ev-color) 40%, transparent);
|
|
1279
|
+
.wg-ad--selected {
|
|
1280
|
+
box-shadow: inset 0 0 0 2px var(--dt-btn-text, #fff);
|
|
1294
1281
|
}
|
|
1295
1282
|
|
|
1296
|
-
.wg-ad
|
|
1297
|
-
|
|
1283
|
+
.wg-ad:focus-visible {
|
|
1284
|
+
outline: none;
|
|
1285
|
+
box-shadow: inset 0 0 0 2px var(--dt-btn-text, #fff), 0 0 0 2px var(--dt-accent, #2563eb);
|
|
1298
1286
|
}
|
|
1299
1287
|
|
|
1300
1288
|
.wg-ad-title {
|
|
1301
|
-
font: 500
|
|
1302
|
-
color:
|
|
1289
|
+
font: 500 11px / 1.1 var(--dt-sans, system-ui, sans-serif);
|
|
1290
|
+
color: inherit;
|
|
1303
1291
|
white-space: nowrap;
|
|
1304
1292
|
overflow: hidden;
|
|
1305
1293
|
text-overflow: ellipsis;
|
|
@@ -1307,18 +1295,16 @@ function onCellKeydown(e, ms) {
|
|
|
1307
1295
|
}
|
|
1308
1296
|
|
|
1309
1297
|
.wg-ad-cont {
|
|
1310
|
-
|
|
1311
|
-
color:
|
|
1298
|
+
display: flex;
|
|
1299
|
+
color: inherit;
|
|
1312
1300
|
flex-shrink: 0;
|
|
1313
|
-
line-height: 1;
|
|
1314
1301
|
}
|
|
1315
1302
|
|
|
1316
1303
|
.wg-ad-arrow {
|
|
1317
|
-
|
|
1318
|
-
color:
|
|
1304
|
+
display: flex;
|
|
1305
|
+
color: inherit;
|
|
1319
1306
|
flex-shrink: 0;
|
|
1320
1307
|
margin-left: auto;
|
|
1321
|
-
line-height: 1;
|
|
1322
1308
|
}
|
|
1323
1309
|
|
|
1324
1310
|
/* ─── Events ─────────────────────────────────────── */
|
|
@@ -1346,18 +1332,21 @@ function onCellKeydown(e, ms) {
|
|
|
1346
1332
|
.wg-now::after {
|
|
1347
1333
|
content: '';
|
|
1348
1334
|
flex: 1;
|
|
1349
|
-
border-top:
|
|
1335
|
+
border-top: 2px solid var(--dt-accent, #2563eb);
|
|
1350
1336
|
}
|
|
1351
1337
|
.wg-now-time {
|
|
1352
|
-
font: 500
|
|
1353
|
-
|
|
1338
|
+
font: 500 10px / 1 var(--dt-sans, system-ui, sans-serif);
|
|
1339
|
+
padding: 2px 4px;
|
|
1340
|
+
border-radius: 0;
|
|
1341
|
+
background: var(--dt-accent, #2563eb);
|
|
1342
|
+
color: var(--dt-btn-text, #fff);
|
|
1354
1343
|
}
|
|
1355
|
-
/* Where a dragged-in class would land: the now-line's shape,
|
|
1344
|
+
/* Where a dragged-in class would land: the now-line's shape, dashed */
|
|
1356
1345
|
.wg-drop {
|
|
1357
1346
|
z-index: 3;
|
|
1358
1347
|
}
|
|
1359
1348
|
.wg-drop::after {
|
|
1360
|
-
border-top-style:
|
|
1349
|
+
border-top-style: dashed;
|
|
1361
1350
|
}
|
|
1362
1351
|
.wg-drop .wg-now-time {
|
|
1363
1352
|
font-weight: 600;
|
|
@@ -1372,16 +1361,25 @@ function onCellKeydown(e, ms) {
|
|
|
1372
1361
|
height: var(--wg-chip-h, 22px);
|
|
1373
1362
|
box-sizing: border-box;
|
|
1374
1363
|
flex-shrink: 0;
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1364
|
+
/* 3px bar + 6px, and 3px on the right: 12px in all (CHIP_PAD_X) */
|
|
1365
|
+
padding: 0 3px 0 9px;
|
|
1366
|
+
border-radius: 0;
|
|
1367
|
+
background: transparent;
|
|
1378
1368
|
cursor: pointer;
|
|
1379
1369
|
overflow: hidden;
|
|
1380
|
-
transition: background 0.12s;
|
|
1370
|
+
transition: background 0.12s, box-shadow 0.12s;
|
|
1371
|
+
}
|
|
1372
|
+
/* The start bar on the leading edge */
|
|
1373
|
+
.wg-ev::before {
|
|
1374
|
+
content: '';
|
|
1375
|
+
position: absolute;
|
|
1376
|
+
inset: 0 auto 0 0;
|
|
1377
|
+
width: 3px;
|
|
1378
|
+
background: var(--ev-color);
|
|
1381
1379
|
}
|
|
1382
1380
|
|
|
1383
1381
|
.wg-ev:hover {
|
|
1384
|
-
background:
|
|
1382
|
+
background: var(--dt-hover, rgba(0, 0, 0, 0.04));
|
|
1385
1383
|
}
|
|
1386
1384
|
|
|
1387
1385
|
.wg-ev--drag-preview {
|
|
@@ -1391,50 +1389,50 @@ function onCellKeydown(e, ms) {
|
|
|
1391
1389
|
z-index: 8;
|
|
1392
1390
|
opacity: 0.95;
|
|
1393
1391
|
pointer-events: none;
|
|
1394
|
-
background:
|
|
1395
|
-
box-shadow: 0
|
|
1396
|
-
outline: 1px solid color-mix(in srgb, var(--ev-color) 42%, transparent);
|
|
1392
|
+
background: var(--dt-hover, rgba(0, 0, 0, 0.04));
|
|
1393
|
+
box-shadow: inset 0 0 0 1px var(--ev-color);
|
|
1397
1394
|
cursor: grabbing;
|
|
1398
1395
|
}
|
|
1399
1396
|
|
|
1400
1397
|
.wg-ev--selected {
|
|
1401
|
-
box-shadow: 0 0 0
|
|
1398
|
+
box-shadow: inset 0 0 0 1px var(--ev-color);
|
|
1402
1399
|
}
|
|
1403
1400
|
|
|
1404
1401
|
.wg-ev--current {
|
|
1405
|
-
background:
|
|
1402
|
+
background: var(--dt-accent-dim, rgba(37, 99, 235, 0.12));
|
|
1406
1403
|
}
|
|
1407
1404
|
|
|
1408
|
-
|
|
1409
|
-
opacity: 0.5;
|
|
1410
|
-
}
|
|
1405
|
+
/* Printed states: struck through, grey, or a dashed bar — never a tint */
|
|
1411
1406
|
.wg-ev--cancelled .wg-ev-title {
|
|
1412
1407
|
text-decoration: line-through;
|
|
1408
|
+
color: var(--dt-text-2, rgba(0, 0, 0, 0.54));
|
|
1413
1409
|
}
|
|
1414
|
-
.wg-ev--
|
|
1415
|
-
|
|
1416
|
-
|
|
1410
|
+
.wg-ev--cancelled::before,
|
|
1411
|
+
.wg-ev--full::before {
|
|
1412
|
+
opacity: 0.45;
|
|
1417
1413
|
}
|
|
1418
|
-
.wg-ev--
|
|
1419
|
-
|
|
1414
|
+
.wg-ev--tentative .wg-ev-title,
|
|
1415
|
+
.wg-ev--full .wg-ev-title {
|
|
1416
|
+
color: var(--dt-text-2, rgba(0, 0, 0, 0.54));
|
|
1420
1417
|
}
|
|
1421
|
-
.wg-ev--
|
|
1422
|
-
|
|
1423
|
-
|
|
1418
|
+
.wg-ev--tentative::before,
|
|
1419
|
+
.wg-ev--limited::before {
|
|
1420
|
+
background: repeating-linear-gradient(180deg, var(--ev-color) 0 4px, transparent 4px 7px);
|
|
1424
1421
|
}
|
|
1425
1422
|
.wg-ev--readonly {
|
|
1426
1423
|
cursor: default;
|
|
1427
1424
|
}
|
|
1428
1425
|
|
|
1429
1426
|
.wg-ev-time {
|
|
1430
|
-
font: 400
|
|
1431
|
-
|
|
1427
|
+
font: 400 14px / 1 var(--dt-sans, system-ui, sans-serif);
|
|
1428
|
+
font-variant-numeric: tabular-nums;
|
|
1429
|
+
color: var(--dt-text, rgba(0, 0, 0, 0.87));
|
|
1432
1430
|
flex-shrink: 0;
|
|
1433
1431
|
white-space: nowrap;
|
|
1434
1432
|
}
|
|
1435
1433
|
|
|
1436
1434
|
.wg-ev-title {
|
|
1437
|
-
font: 500
|
|
1435
|
+
font: 500 15px / 1.25 var(--dt-sans, system-ui, sans-serif);
|
|
1438
1436
|
color: var(--dt-text, rgba(0, 0, 0, 0.87));
|
|
1439
1437
|
white-space: nowrap;
|
|
1440
1438
|
overflow: hidden;
|
|
@@ -1444,8 +1442,8 @@ function onCellKeydown(e, ms) {
|
|
|
1444
1442
|
}
|
|
1445
1443
|
|
|
1446
1444
|
.wg-ev-loc {
|
|
1447
|
-
font: 400
|
|
1448
|
-
color: var(--dt-text
|
|
1445
|
+
font: 400 12.5px / 1 var(--dt-sans, system-ui, sans-serif);
|
|
1446
|
+
color: var(--dt-text, rgba(0, 0, 0, 0.87));
|
|
1449
1447
|
white-space: nowrap;
|
|
1450
1448
|
flex-shrink: 0; /* shown only when measured to fit — never squeezed */
|
|
1451
1449
|
}
|
|
@@ -1455,7 +1453,7 @@ function onCellKeydown(e, ms) {
|
|
|
1455
1453
|
appearance: none;
|
|
1456
1454
|
background: none;
|
|
1457
1455
|
border: none;
|
|
1458
|
-
border-radius:
|
|
1456
|
+
border-radius: 0;
|
|
1459
1457
|
text-align: left;
|
|
1460
1458
|
align-self: flex-start;
|
|
1461
1459
|
font: 500 10px / 1 var(--dt-sans, system-ui, sans-serif);
|
|
@@ -1482,13 +1480,14 @@ function onCellKeydown(e, ms) {
|
|
|
1482
1480
|
}
|
|
1483
1481
|
|
|
1484
1482
|
.wg-ev:focus-visible {
|
|
1485
|
-
outline:
|
|
1486
|
-
|
|
1483
|
+
outline: none;
|
|
1484
|
+
box-shadow: 0 0 0 2px var(--dt-accent, #2563eb);
|
|
1487
1485
|
}
|
|
1488
1486
|
|
|
1489
1487
|
.wg-ev--dragging {
|
|
1490
1488
|
cursor: grabbing;
|
|
1491
|
-
|
|
1489
|
+
background: var(--dt-hover, rgba(0, 0, 0, 0.04));
|
|
1490
|
+
box-shadow: inset 0 0 0 1px var(--ev-color);
|
|
1492
1491
|
}
|
|
1493
1492
|
</style>
|
|
1494
1493
|
|