@nomideusz/svelte-calendar 1.0.1 → 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.
@@ -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">◂</span>
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">▸</span>
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: 4px;
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: 10px;
1063
+ border-radius: 0;
1064
1064
  margin: var(--wg-row-margin, 12px) 8px;
1065
- border: 1.5px solid var(--dt-border, rgba(0, 0, 0, 0.08));
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
- /* Border width stays constant (no layout shift); emphasis via box-shadow */
1072
- border-color: var(--dt-accent, #2563eb);
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: color-mix(in srgb, var(--dt-accent, #2563eb) 12%, transparent) !important;
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: color-mix(in srgb, var(--dt-accent, #2563eb) 6%, transparent); }
1138
+ .wg-cell--today:hover { background: var(--dt-hover, rgba(0, 0, 0, 0.04)); }
1140
1139
 
1141
- /* Dim non-current weeks with a subtle wash + softer header text instead of
1142
- a subtree opacity, so event content keeps full contrast everywhere. */
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-week--current .wg-cell--past {
1150
- background: color-mix(in srgb, var(--dt-text, rgba(0, 0, 0, 0.87)) 2.5%, transparent);
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: 3px;
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,7 +1204,7 @@ function onCellKeydown(e, ms) {
1208
1204
  gap: 4px;
1209
1205
  padding: 3px 7px;
1210
1206
  margin: 1px 0 2px;
1211
- border-radius: 999px;
1207
+ border-radius: 0;
1212
1208
  }
1213
1209
 
1214
1210
  .wg-day-wd {
@@ -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-btn-text, #fff);
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: 3px;
1261
- background: color-mix(in srgb, var(--ev-color) 22%, var(--dt-surface, var(--dt-bg, #ffffff)));
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: background 0.12s;
1263
+ transition: filter 0.12s;
1265
1264
  min-height: 18px;
1266
1265
  }
1267
1266
 
@@ -1270,58 +1269,42 @@ 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
- background: color-mix(in srgb, var(--ev-color) 32%, var(--dt-surface, var(--dt-bg, #ffffff)));
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--mid {
1287
- border-radius: 0;
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--selected {
1297
- box-shadow: 0 0 0 1.5px var(--ev-color);
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
1289
  font: 500 11px / 1.1 var(--dt-sans, system-ui, sans-serif);
1302
- color: var(--dt-text, rgba(0, 0, 0, 0.87));
1290
+ color: inherit;
1303
1291
  white-space: nowrap;
1304
1292
  overflow: hidden;
1305
1293
  text-overflow: ellipsis;
1306
1294
  flex: 1;
1307
1295
  }
1308
1296
 
1309
- /* The event colour as ink can be a pale fill (a host's "no colour" tint);
1310
- pulled toward the text colour it stays the event's hue and stays legible
1311
- on the chip in either theme. */
1312
1297
  .wg-ad-cont {
1313
- font-size: 11px;
1314
- color: color-mix(in srgb, var(--ev-color) 45%, var(--dt-text, #000));
1298
+ display: flex;
1299
+ color: inherit;
1315
1300
  flex-shrink: 0;
1316
- line-height: 1;
1317
1301
  }
1318
1302
 
1319
1303
  .wg-ad-arrow {
1320
- font-size: 11px;
1321
- color: color-mix(in srgb, var(--ev-color) 45%, var(--dt-text, #000));
1304
+ display: flex;
1305
+ color: inherit;
1322
1306
  flex-shrink: 0;
1323
1307
  margin-left: auto;
1324
- line-height: 1;
1325
1308
  }
1326
1309
 
1327
1310
  /* ─── Events ─────────────────────────────────────── */
@@ -1349,18 +1332,21 @@ function onCellKeydown(e, ms) {
1349
1332
  .wg-now::after {
1350
1333
  content: '';
1351
1334
  flex: 1;
1352
- border-top: 1px dashed var(--dt-accent, #2563eb);
1335
+ border-top: 2px solid var(--dt-accent, #2563eb);
1353
1336
  }
1354
1337
  .wg-now-time {
1355
1338
  font: 500 10px / 1 var(--dt-sans, system-ui, sans-serif);
1356
- color: var(--dt-accent, #2563eb);
1339
+ padding: 2px 4px;
1340
+ border-radius: 0;
1341
+ background: var(--dt-accent, #2563eb);
1342
+ color: var(--dt-btn-text, #fff);
1357
1343
  }
1358
- /* Where a dragged-in class would land: the now-line's shape, solid */
1344
+ /* Where a dragged-in class would land: the now-line's shape, dashed */
1359
1345
  .wg-drop {
1360
1346
  z-index: 3;
1361
1347
  }
1362
1348
  .wg-drop::after {
1363
- border-top-style: solid;
1349
+ border-top-style: dashed;
1364
1350
  }
1365
1351
  .wg-drop .wg-now-time {
1366
1352
  font-weight: 600;
@@ -1375,16 +1361,25 @@ function onCellKeydown(e, ms) {
1375
1361
  height: var(--wg-chip-h, 22px);
1376
1362
  box-sizing: border-box;
1377
1363
  flex-shrink: 0;
1378
- padding: 0 6px;
1379
- border-radius: 4px;
1380
- background: color-mix(in srgb, var(--ev-color) 15%, var(--dt-surface, var(--dt-bg, #ffffff)));
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;
1381
1368
  cursor: pointer;
1382
1369
  overflow: hidden;
1383
- 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);
1384
1379
  }
1385
1380
 
1386
1381
  .wg-ev:hover {
1387
- background: color-mix(in srgb, var(--ev-color) 25%, var(--dt-surface, var(--dt-bg, #ffffff)));
1382
+ background: var(--dt-hover, rgba(0, 0, 0, 0.04));
1388
1383
  }
1389
1384
 
1390
1385
  .wg-ev--drag-preview {
@@ -1394,52 +1389,50 @@ function onCellKeydown(e, ms) {
1394
1389
  z-index: 8;
1395
1390
  opacity: 0.95;
1396
1391
  pointer-events: none;
1397
- background: color-mix(in srgb, var(--ev-color) 28%, var(--dt-surface, var(--dt-bg, #ffffff)));
1398
- box-shadow: 0 6px 18px color-mix(in srgb, var(--ev-color) 24%, rgba(0, 0, 0, 0.22));
1399
- 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);
1400
1394
  cursor: grabbing;
1401
1395
  }
1402
1396
 
1403
1397
  .wg-ev--selected {
1404
- box-shadow: 0 0 0 1.5px var(--ev-color);
1398
+ box-shadow: inset 0 0 0 1px var(--ev-color);
1405
1399
  }
1406
1400
 
1407
1401
  .wg-ev--current {
1408
- background: color-mix(in srgb, var(--ev-color) 22%, var(--dt-surface, var(--dt-bg, #ffffff)));
1402
+ background: var(--dt-accent-dim, rgba(37, 99, 235, 0.12));
1409
1403
  }
1410
1404
 
1411
- .wg-ev--cancelled {
1412
- opacity: 0.5;
1413
- }
1405
+ /* Printed states: struck through, grey, or a dashed bar — never a tint */
1414
1406
  .wg-ev--cancelled .wg-ev-title {
1415
1407
  text-decoration: line-through;
1408
+ color: var(--dt-text-2, rgba(0, 0, 0, 0.54));
1416
1409
  }
1417
- .wg-ev--tentative {
1418
- opacity: 0.65;
1419
- border: 1px dashed color-mix(in srgb, var(--ev-color) 40%, transparent);
1410
+ .wg-ev--cancelled::before,
1411
+ .wg-ev--full::before {
1412
+ opacity: 0.45;
1420
1413
  }
1421
- .wg-ev--full {
1422
- opacity: 0.55;
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));
1423
1417
  }
1424
- .wg-ev--limited {
1425
- opacity: 0.65;
1426
- border: 1px dashed color-mix(in srgb, var(--ev-color) 40%, transparent);
1418
+ .wg-ev--tentative::before,
1419
+ .wg-ev--limited::before {
1420
+ background: repeating-linear-gradient(180deg, var(--ev-color) 0 4px, transparent 4px 7px);
1427
1421
  }
1428
1422
  .wg-ev--readonly {
1429
1423
  cursor: default;
1430
1424
  }
1431
1425
 
1432
- /* On the tinted chip the tertiary ink fell under 4.5:1; the time is the
1433
- chip's first answer, so it reads in the secondary ink. */
1434
1426
  .wg-ev-time {
1435
- font: 400 11px / 1 var(--dt-sans, system-ui, sans-serif);
1436
- color: var(--dt-text-2, rgba(0, 0, 0, 0.6));
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));
1437
1430
  flex-shrink: 0;
1438
1431
  white-space: nowrap;
1439
1432
  }
1440
1433
 
1441
1434
  .wg-ev-title {
1442
- font: 500 12px / 1.1 var(--dt-sans, system-ui, sans-serif);
1435
+ font: 500 15px / 1.25 var(--dt-sans, system-ui, sans-serif);
1443
1436
  color: var(--dt-text, rgba(0, 0, 0, 0.87));
1444
1437
  white-space: nowrap;
1445
1438
  overflow: hidden;
@@ -1449,8 +1442,8 @@ function onCellKeydown(e, ms) {
1449
1442
  }
1450
1443
 
1451
1444
  .wg-ev-loc {
1452
- font: 400 11px / 1 var(--dt-sans, system-ui, sans-serif);
1453
- color: var(--dt-text-3, rgba(0, 0, 0, 0.38));
1445
+ font: 400 12.5px / 1 var(--dt-sans, system-ui, sans-serif);
1446
+ color: var(--dt-text, rgba(0, 0, 0, 0.87));
1454
1447
  white-space: nowrap;
1455
1448
  flex-shrink: 0; /* shown only when measured to fit — never squeezed */
1456
1449
  }
@@ -1460,7 +1453,7 @@ function onCellKeydown(e, ms) {
1460
1453
  appearance: none;
1461
1454
  background: none;
1462
1455
  border: none;
1463
- border-radius: 3px;
1456
+ border-radius: 0;
1464
1457
  text-align: left;
1465
1458
  align-self: flex-start;
1466
1459
  font: 500 10px / 1 var(--dt-sans, system-ui, sans-serif);
@@ -1487,13 +1480,14 @@ function onCellKeydown(e, ms) {
1487
1480
  }
1488
1481
 
1489
1482
  .wg-ev:focus-visible {
1490
- outline: 2px solid var(--ev-color, var(--dt-accent, #2563eb));
1491
- outline-offset: 1px;
1483
+ outline: none;
1484
+ box-shadow: 0 0 0 2px var(--dt-accent, #2563eb);
1492
1485
  }
1493
1486
 
1494
1487
  .wg-ev--dragging {
1495
1488
  cursor: grabbing;
1496
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
1489
+ background: var(--dt-hover, rgba(0, 0, 0, 0.04));
1490
+ box-shadow: inset 0 0 0 1px var(--ev-color);
1497
1491
  }
1498
1492
  </style>
1499
1493