@synqauth/react 0.3.0 → 0.4.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/styles.css CHANGED
@@ -13,7 +13,23 @@
13
13
 
14
14
  :where(.synq) {
15
15
  --synq-font-family: inherit;
16
- --synq-font-size: 0.9375rem;
16
+ /*
17
+ * Kelvin's type scale (AERO-2765), as Synq's own apps have it: nothing
18
+ * under 13px, 13px (xs) only for incidental metadata, 14px (sm) for what a
19
+ * person reads to decide (labels, a row's second line, badges, notes), 16px
20
+ * (base) for body, rows, inputs and buttons. In px, so an app's own root
21
+ * size (62.5% is common) can't shrink them under the floor; from 1024px
22
+ * wide every step goes up one (below). Set any of them to retheme, and
23
+ * --synq-font-size for the components' body text.
24
+ */
25
+ --synq-text-xs: 13px;
26
+ --synq-text-sm: 14px;
27
+ --synq-text-base: 16px;
28
+ --synq-text-lg: 18px;
29
+ --synq-text-xl: 20px;
30
+ --synq-text-2xl: 24px;
31
+ --synq-text-3xl: 28px;
32
+ --synq-font-size: var(--synq-text-base);
17
33
  --synq-color-text: #f5f5f7;
18
34
  --synq-color-muted: #b8a5c9;
19
35
  /* Inputs, addresses and the cards inside a section. */
@@ -45,7 +61,7 @@
45
61
  --synq-color-disabled: #231a2e;
46
62
  --synq-color-disabled-border: #786b8b;
47
63
  --synq-color-disabled-text: #a497b3;
48
- /* <AccountPanel>'s titles and greetings: the app's display face, if it has one. */
64
+ /* Titles, greetings and drawn initials: the app's display face, if it has one. */
49
65
  --synq-font-display: inherit;
50
66
  /* <AvatarMoment>: the ring's three colors, and the embers'. */
51
67
  --synq-moment-1: var(--synq-color-primary);
@@ -67,6 +83,19 @@
67
83
  color: var(--synq-color-text);
68
84
  }
69
85
 
86
+ /* A laptop's text is never smaller than a phone's: one step up from 1024px wide. */
87
+ @media (min-width: 64rem) {
88
+ :where(.synq) {
89
+ --synq-text-xs: 14px;
90
+ --synq-text-sm: 15px;
91
+ --synq-text-base: 17px;
92
+ --synq-text-lg: 19px;
93
+ --synq-text-xl: 22px;
94
+ --synq-text-2xl: 26px;
95
+ --synq-text-3xl: 30px;
96
+ }
97
+ }
98
+
70
99
  @media (prefers-color-scheme: light) {
71
100
  :where(.synq) {
72
101
  --synq-color-text: #140a1f;
@@ -76,7 +105,8 @@
76
105
  --synq-color-border: rgb(60 18 83 / 0.14);
77
106
  --synq-color-primary-ink: #0f766e;
78
107
  --synq-color-accent: #c2410c;
79
- --synq-color-danger: #d92d20;
108
+ /* 4.5:1 as words on the danger section's own tint too, not only on white (AERO-2765). */
109
+ --synq-color-danger: #b42318;
80
110
  --synq-color-danger-text: #ffffff;
81
111
  --synq-shadow: 0 12px 32px rgb(20 10 31 / 0.14);
82
112
  --synq-backdrop: rgb(20 10 31 / 0.4);
@@ -242,7 +272,7 @@
242
272
  border-radius: 999px;
243
273
  background: color-mix(in srgb, var(--synq-color-primary) 10%, transparent);
244
274
  color: var(--synq-color-primary-ink);
245
- font-size: 0.8125rem;
275
+ font-size: var(--synq-text-xs);
246
276
  font-weight: 700;
247
277
  object-fit: cover;
248
278
  }
@@ -259,6 +289,12 @@
259
289
  height: 100%;
260
290
  }
261
291
 
292
+ /* Drawn initials take the display face; the SVG's own attributes are the fallback without this sheet. */
293
+ :where(.synq-avatar) :where(text) {
294
+ font-family: var(--synq-font-display);
295
+ font-weight: 700;
296
+ }
297
+
262
298
  :where(.synq-picture) {
263
299
  display: flex;
264
300
  flex-wrap: wrap;
@@ -270,7 +306,7 @@
270
306
  width: 5rem;
271
307
  height: 5rem;
272
308
  justify-self: start;
273
- font-size: 1.75rem;
309
+ font-size: var(--synq-text-3xl);
274
310
  }
275
311
 
276
312
  :where(.synq-menu) {
@@ -285,7 +321,7 @@
285
321
  margin-top: 0.375rem;
286
322
  padding: 0.25rem;
287
323
  border: 1px solid var(--synq-color-border);
288
- border-radius: var(--synq-radius-control);
324
+ border-radius: var(--synq-radius);
289
325
  background: var(--synq-color-surface);
290
326
  box-shadow: var(--synq-shadow);
291
327
  }
@@ -294,7 +330,7 @@
294
330
  display: block;
295
331
  padding: 0.5rem 0.75rem;
296
332
  border: 0;
297
- border-radius: calc(var(--synq-radius-control) - 0.25rem);
333
+ border-radius: var(--synq-radius-control);
298
334
  background: none;
299
335
  color: inherit;
300
336
  font: inherit;
@@ -312,11 +348,18 @@
312
348
 
313
349
  :where(.synq-account-manager) {
314
350
  display: grid;
351
+ /*
352
+ * Its sections take the width there is, never their content's, so at
353
+ * 320px a long address or a row's badge wraps rather than widening the
354
+ * page (AERO-2765).
355
+ */
356
+ grid-template-columns: minmax(0, 1fr);
315
357
  gap: calc(var(--synq-spacing) * 2);
316
358
  }
317
359
 
318
360
  :where(.synq-section, .synq-wallet-manager) {
319
361
  display: grid;
362
+ grid-template-columns: minmax(0, 1fr);
320
363
  gap: calc(var(--synq-spacing) * 1.5);
321
364
  padding: calc(var(--synq-spacing) * 2);
322
365
  border: 1px solid var(--synq-color-border);
@@ -348,13 +391,15 @@
348
391
 
349
392
  :where(.synq-heading) {
350
393
  margin: 0;
351
- font-size: 1.25rem;
394
+ font-family: var(--synq-font-display);
395
+ font-size: var(--synq-text-xl);
352
396
  font-weight: 700;
353
397
  }
354
398
 
355
399
  :where(.synq-subheading) {
356
400
  margin: 0;
357
- font-size: 1rem;
401
+ font-family: var(--synq-font-display);
402
+ font-size: var(--synq-text-base);
358
403
  font-weight: 700;
359
404
  }
360
405
 
@@ -402,7 +447,7 @@
402
447
  }
403
448
 
404
449
  :where(.synq-card-title) {
405
- font-size: 1.0625rem;
450
+ font-size: var(--synq-text-lg);
406
451
  font-weight: 700;
407
452
  }
408
453
 
@@ -429,7 +474,7 @@
429
474
  border-radius: var(--synq-radius-control);
430
475
  background: var(--synq-color-surface);
431
476
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
432
- font-size: 0.875rem;
477
+ font-size: var(--synq-text-sm);
433
478
  text-overflow: ellipsis;
434
479
  white-space: nowrap;
435
480
  }
@@ -486,7 +531,7 @@
486
531
 
487
532
  :where(.synq-label) {
488
533
  color: var(--synq-color-muted);
489
- font-size: 0.8125rem;
534
+ font-size: var(--synq-text-sm);
490
535
  font-weight: 500;
491
536
  }
492
537
 
@@ -562,7 +607,8 @@
562
607
  border-radius: 999px;
563
608
  background: color-mix(in srgb, var(--synq-color-primary) 8%, transparent);
564
609
  color: var(--synq-color-primary-ink);
565
- font-size: 0.75rem;
610
+ /* 13px at the least, however small the page sets its type (AERO-2757); 14px as a badge is read to decide (AERO-2765). */
611
+ font-size: var(--synq-text-sm);
566
612
  font-weight: 500;
567
613
  }
568
614
 
@@ -652,7 +698,7 @@
652
698
 
653
699
  :where(.synq-dialog-title) {
654
700
  margin: 0;
655
- font-size: 1.25rem;
701
+ font-size: var(--synq-text-xl);
656
702
  font-weight: 700;
657
703
  }
658
704
 
@@ -684,7 +730,7 @@
684
730
  background: color-mix(in srgb, var(--synq-color-text) 8%, transparent);
685
731
  color: var(--synq-color-text);
686
732
  font: inherit;
687
- font-size: 15px;
733
+ font-size: var(--synq-text-base);
688
734
  font-weight: 600;
689
735
  white-space: nowrap;
690
736
  cursor: pointer;
@@ -755,7 +801,7 @@
755
801
  box-shadow: var(--synq-shadow);
756
802
  color: var(--synq-color-text);
757
803
  font-family: var(--synq-font-family);
758
- font-size: 1rem;
804
+ font-size: var(--synq-text-base);
759
805
  line-height: 1.45;
760
806
  text-align: left;
761
807
  pointer-events: auto;
@@ -859,20 +905,20 @@
859
905
  :where(.synq-account-panel-title) {
860
906
  margin: 0;
861
907
  font-family: var(--synq-font-display);
862
- font-size: 24px;
908
+ font-size: var(--synq-text-2xl);
863
909
  font-weight: 700;
864
910
  line-height: 1.1;
865
911
  text-wrap: balance;
866
912
  }
867
913
 
868
914
  :where(.synq-account-panel-title-small) {
869
- font-size: 20px;
915
+ font-size: var(--synq-text-xl);
870
916
  }
871
917
 
872
918
  :where(.synq-account-panel-subtitle) {
873
919
  margin: 4px 0 0;
874
920
  color: var(--synq-color-muted);
875
- font-size: 16px;
921
+ font-size: var(--synq-text-base);
876
922
  }
877
923
 
878
924
  :where(.synq-account-panel-icon-button) {
@@ -920,7 +966,7 @@
920
966
  background: color-mix(in srgb, var(--synq-color-text) 6%, transparent);
921
967
  color: var(--synq-color-text);
922
968
  font: inherit;
923
- font-size: 16px;
969
+ font-size: var(--synq-text-base);
924
970
  font-weight: 600;
925
971
  text-align: left;
926
972
  cursor: pointer;
@@ -989,7 +1035,7 @@
989
1035
  border-radius: 999px;
990
1036
  background: var(--synq-color-background);
991
1037
  color: var(--synq-color-primary-ink);
992
- font-size: 13px;
1038
+ font-size: var(--synq-text-xs);
993
1039
  font-weight: 600;
994
1040
  line-height: 16px;
995
1041
  white-space: nowrap;
@@ -1030,7 +1076,7 @@
1030
1076
  background: none;
1031
1077
  color: var(--synq-color-muted);
1032
1078
  font: inherit;
1033
- font-size: 15px;
1079
+ font-size: var(--synq-text-base);
1034
1080
  font-weight: 600;
1035
1081
  text-decoration: underline;
1036
1082
  text-underline-offset: 3px;
@@ -1069,13 +1115,13 @@
1069
1115
  :where(.synq-account-panel-note) {
1070
1116
  margin: 0;
1071
1117
  color: var(--synq-color-muted);
1072
- font-size: 15px;
1118
+ font-size: var(--synq-text-base);
1073
1119
  }
1074
1120
 
1075
1121
  :where(.synq-account-panel-by) {
1076
1122
  margin: 0;
1077
1123
  color: var(--synq-color-muted);
1078
- font-size: 13px;
1124
+ font-size: var(--synq-text-xs);
1079
1125
  text-align: center;
1080
1126
  }
1081
1127
 
@@ -1085,7 +1131,7 @@
1085
1131
  align-items: start;
1086
1132
  gap: 8px;
1087
1133
  color: var(--synq-color-text);
1088
- font-size: 15px;
1134
+ font-size: var(--synq-text-base);
1089
1135
  }
1090
1136
 
1091
1137
  :where(.synq-account-panel-problem) > :where(svg) {
@@ -1149,7 +1195,7 @@
1149
1195
  }
1150
1196
 
1151
1197
  :where(.synq-account-panel-row-title) {
1152
- font-size: 16px;
1198
+ font-size: var(--synq-text-base);
1153
1199
  font-weight: 600;
1154
1200
  }
1155
1201
 
@@ -1159,7 +1205,7 @@
1159
1205
  align-items: center;
1160
1206
  gap: 6px;
1161
1207
  color: var(--synq-color-muted);
1162
- font-size: 15px;
1208
+ font-size: var(--synq-text-sm);
1163
1209
  font-weight: 400;
1164
1210
  overflow-wrap: anywhere;
1165
1211
  }
@@ -1172,7 +1218,7 @@
1172
1218
  }
1173
1219
 
1174
1220
  :where(.synq-account-panel-showing) {
1175
- font-size: 13px;
1221
+ font-size: var(--synq-text-xs);
1176
1222
  font-weight: 600;
1177
1223
  white-space: nowrap;
1178
1224
  }
@@ -1207,7 +1253,7 @@
1207
1253
  :where(.synq-account-panel-greeting) {
1208
1254
  margin: 6px 0 0;
1209
1255
  font-family: var(--synq-font-display);
1210
- font-size: 26px;
1256
+ font-size: var(--synq-text-3xl);
1211
1257
  font-weight: 700;
1212
1258
  line-height: 1.1;
1213
1259
  text-wrap: balance;
@@ -1220,7 +1266,7 @@
1220
1266
  :where(.synq-account-panel-address, .synq-account-panel-mono) {
1221
1267
  color: var(--synq-color-muted);
1222
1268
  font-family: var(--synq-font-mono);
1223
- font-size: 14px;
1269
+ font-size: var(--synq-text-sm);
1224
1270
  font-weight: 400;
1225
1271
  }
1226
1272
 
@@ -1276,7 +1322,7 @@
1276
1322
  gap: 8px;
1277
1323
  margin: 0;
1278
1324
  color: var(--synq-color-muted);
1279
- font-size: 13px;
1325
+ font-size: var(--synq-text-sm);
1280
1326
  font-weight: 600;
1281
1327
  letter-spacing: 0.08em;
1282
1328
  line-height: 1.3;
@@ -1308,7 +1354,7 @@
1308
1354
 
1309
1355
  :where(.synq-account-panel-username-at) {
1310
1356
  color: var(--synq-color-muted);
1311
- font-size: 16px;
1357
+ font-size: var(--synq-text-base);
1312
1358
  font-weight: 600;
1313
1359
  }
1314
1360
 
@@ -1321,7 +1367,7 @@
1321
1367
  background: none;
1322
1368
  color: var(--synq-color-text);
1323
1369
  font: inherit;
1324
- font-size: 16px;
1370
+ font-size: var(--synq-text-base);
1325
1371
  outline: none;
1326
1372
  }
1327
1373
 
@@ -1334,7 +1380,7 @@
1334
1380
  background: var(--synq-color-primary);
1335
1381
  color: var(--synq-color-primary-text);
1336
1382
  font: inherit;
1337
- font-size: 15px;
1383
+ font-size: var(--synq-text-base);
1338
1384
  font-weight: 700;
1339
1385
  cursor: pointer;
1340
1386
  }
@@ -1344,7 +1390,7 @@
1344
1390
  gap: 8px;
1345
1391
  min-height: 24px;
1346
1392
  color: var(--synq-color-muted);
1347
- font-size: 15px;
1393
+ font-size: var(--synq-text-sm);
1348
1394
  }
1349
1395
 
1350
1396
  :where(.synq-account-panel-chips) {
@@ -1361,7 +1407,7 @@
1361
1407
  background: none;
1362
1408
  color: var(--synq-color-text);
1363
1409
  font: inherit;
1364
- font-size: 15px;
1410
+ font-size: var(--synq-text-sm);
1365
1411
  font-weight: 600;
1366
1412
  cursor: pointer;
1367
1413
  }
@@ -1372,7 +1418,7 @@
1372
1418
  }
1373
1419
 
1374
1420
  :where(.synq-account-panel-label) {
1375
- font-size: 15px;
1421
+ font-size: var(--synq-text-sm);
1376
1422
  font-weight: 600;
1377
1423
  }
1378
1424
 
@@ -1386,7 +1432,7 @@
1386
1432
  background: color-mix(in srgb, var(--synq-color-text) 3%, transparent);
1387
1433
  color: var(--synq-color-text);
1388
1434
  font: inherit;
1389
- font-size: 16px;
1435
+ font-size: var(--synq-text-base);
1390
1436
  }
1391
1437
 
1392
1438
  :where(.synq-account-panel-actions) {
@@ -1409,7 +1455,7 @@
1409
1455
  padding: 0 16px;
1410
1456
  border-radius: 999px;
1411
1457
  font: inherit;
1412
- font-size: 15px;
1458
+ font-size: var(--synq-text-base);
1413
1459
  font-weight: 600;
1414
1460
  text-decoration: none;
1415
1461
  white-space: nowrap;
@@ -1422,7 +1468,7 @@
1422
1468
  border: 0;
1423
1469
  background: var(--synq-color-primary);
1424
1470
  color: var(--synq-color-primary-text);
1425
- font-size: 16px;
1471
+ font-size: var(--synq-text-base);
1426
1472
  font-weight: 700;
1427
1473
  }
1428
1474
 
@@ -1463,7 +1509,7 @@
1463
1509
 
1464
1510
  :where(.synq-account-panel-nudge) > :where(p) {
1465
1511
  margin: 0;
1466
- font-size: 15px;
1512
+ font-size: var(--synq-text-base);
1467
1513
  }
1468
1514
 
1469
1515
  :where(.synq-account-panel-rows) {
@@ -1512,7 +1558,7 @@
1512
1558
  }
1513
1559
 
1514
1560
  :where(.synq-account-panel-wallet-name) {
1515
- font-size: 16px;
1561
+ font-size: var(--synq-text-base);
1516
1562
  font-weight: 600;
1517
1563
  overflow-wrap: anywhere;
1518
1564
  }
@@ -1531,7 +1577,7 @@
1531
1577
  border-radius: 999px;
1532
1578
  background: color-mix(in srgb, var(--synq-color-text) 6%, transparent);
1533
1579
  color: var(--synq-color-muted);
1534
- font-size: 13px;
1580
+ font-size: var(--synq-text-sm);
1535
1581
  font-weight: 600;
1536
1582
  line-height: 1.3;
1537
1583
  white-space: nowrap;
@@ -1546,7 +1592,7 @@
1546
1592
 
1547
1593
  :where(.synq-account-panel-wallet-extra) {
1548
1594
  color: var(--synq-color-muted);
1549
- font-size: 14px;
1595
+ font-size: var(--synq-text-sm);
1550
1596
  }
1551
1597
 
1552
1598
  :where(.synq-account-panel-wallet-actions) {
@@ -1571,7 +1617,7 @@
1571
1617
  background: none;
1572
1618
  color: var(--synq-color-text);
1573
1619
  font: inherit;
1574
- font-size: 16px;
1620
+ font-size: var(--synq-text-base);
1575
1621
  text-align: left;
1576
1622
  cursor: pointer;
1577
1623
  }
@@ -1605,7 +1651,7 @@
1605
1651
 
1606
1652
  :where(.synq-account-panel-confirm) > :where(p) {
1607
1653
  margin: 0;
1608
- font-size: 15px;
1654
+ font-size: var(--synq-text-base);
1609
1655
  }
1610
1656
 
1611
1657
  :where(.synq-account-panel-add) {
@@ -1620,7 +1666,7 @@
1620
1666
  background: none;
1621
1667
  color: var(--synq-color-text);
1622
1668
  font: inherit;
1623
- font-size: 16px;
1669
+ font-size: var(--synq-text-base);
1624
1670
  font-weight: 600;
1625
1671
  cursor: pointer;
1626
1672
  }
@@ -1692,7 +1738,7 @@
1692
1738
 
1693
1739
  :where(.synq-account-panel-profile-name) {
1694
1740
  margin: 0;
1695
- font-size: 18px;
1741
+ font-size: var(--synq-text-lg);
1696
1742
  font-weight: 600;
1697
1743
  line-height: 1.25;
1698
1744
  overflow-wrap: anywhere;
@@ -1716,7 +1762,7 @@
1716
1762
  /* The forms an in-place sign-in borrows from <SignInForm>, at the panel's sizes. */
1717
1763
  :where(.synq-account-panel-dialog) :where(.synq-input) {
1718
1764
  min-height: 48px;
1719
- font-size: 16px;
1765
+ font-size: var(--synq-text-base);
1720
1766
  }
1721
1767
 
1722
1768
  :where(.synq-account-panel-dialog) :where(.synq-button) {
@@ -1724,7 +1770,7 @@
1724
1770
  }
1725
1771
 
1726
1772
  :where(.synq-account-panel-dialog) :where(.synq-label) {
1727
- font-size: 15px;
1773
+ font-size: var(--synq-text-sm);
1728
1774
  }
1729
1775
 
1730
1776
  :where(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synqauth/react",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "React hooks and components for Synq.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -30,7 +30,7 @@
30
30
  "access": "public"
31
31
  },
32
32
  "dependencies": {
33
- "@synqauth/js": "0.3.0"
33
+ "@synqauth/js": "0.4.0"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "react": ">=19.0.0",