@zoreal/oauth2-js 0.1.12 → 0.1.13

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/index.cjs CHANGED
@@ -59,7 +59,7 @@ function unsafeClaims(idToken) {
59
59
 
60
60
  // src/wire.ts
61
61
  var WIRE_VERSION = 1;
62
- var SDK_VERSION = "0.1.12";
62
+ var SDK_VERSION = "0.1.13";
63
63
  var SDK_NAME = "@zoreal/oauth2-js";
64
64
  var DEFAULT_ISSUER = "https://id.zoreal.com";
65
65
  var POLL_INTERVAL_MS = 2e3;
@@ -931,8 +931,20 @@ var LIGHT = `
931
931
  --zrl-accent-ink: #04698a;
932
932
  --zrl-urgent: #b4761a;
933
933
  --zrl-qr-bg: #ffffff;
934
+ --zrl-qr-filter: none;
935
+ --zrl-qr-spent-filter: blur(3px);
936
+ --zrl-qr-blend: normal;
934
937
  --zrl-shadow: 0 1px 2px rgba(16, 18, 27, 0.06), 0 20px 50px -12px rgba(16, 18, 27, 0.3);
935
938
  --zrl-ring: rgba(16, 18, 27, 0.07);
939
+ /* The light on the QR well's edge. Brand blue on both grounds, a lighter
940
+ tint at the head; only its strength is themed, see the dark block. */
941
+ --zrl-beam: #00b4d9;
942
+ --zrl-beam-head: #7fe0f4;
943
+ --zrl-beam-line: 2px;
944
+ --zrl-glow-core: 4px;
945
+ --zrl-glow-reach: 24px;
946
+ --zrl-glow-blur: 8px;
947
+ --zrl-glow-opacity: 0.6;
936
948
  `;
937
949
  var DARK = `
938
950
  --zrl-scrim: rgba(0, 0, 0, 0.62);
@@ -947,12 +959,24 @@ var DARK = `
947
959
  --zrl-accent-soft: #0d3b47;
948
960
  --zrl-accent-ink: #7fdcf0;
949
961
  --zrl-urgent: #e0a952;
950
- /* The QR well stays white in dark mode on purpose: a scanner needs the
951
- quiet-zone contrast, and an inverted QR fails on a good number of phone
952
- cameras. It reads as a deliberate light panel, not a theming miss. */
953
- --zrl-qr-bg: #ffffff;
962
+ /* The code is drawn light on the dark surface: the panel is transparent
963
+ and the image is inverted and screened, so only the modules and the
964
+ mark show. */
965
+ --zrl-qr-bg: transparent;
966
+ --zrl-qr-filter: invert(1);
967
+ --zrl-qr-spent-filter: invert(1) blur(3px);
968
+ --zrl-qr-blend: screen;
954
969
  --zrl-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 20px 50px -12px rgba(0, 0, 0, 0.65);
955
970
  --zrl-ring: rgba(255, 255, 255, 0.1);
971
+ /* A glow that reads on a white card disappears on a dark one: the light
972
+ here is brighter and wider, and its halo reaches further out. */
973
+ --zrl-beam: #22c8ec;
974
+ --zrl-beam-head: #c2f3fc;
975
+ --zrl-beam-line: 3px;
976
+ --zrl-glow-core: 6px;
977
+ --zrl-glow-reach: 32px;
978
+ --zrl-glow-blur: 10px;
979
+ --zrl-glow-opacity: 0.85;
956
980
  `;
957
981
  var CSS = `
958
982
  .${PREFIX}-root { ${LIGHT} }
@@ -1024,16 +1048,10 @@ var CSS = `
1024
1048
  border: 1px solid var(--zrl-line);
1025
1049
  border-radius: var(--zrl-radius);
1026
1050
  background: var(--zrl-qr-bg);
1027
- /* The light on the edge takes its shape and colour from here. The colour
1028
- is fixed, not themed: the brand blue on both grounds, a lighter tint of
1029
- it at the head, no other hue. */
1051
+ /* The light on the edge takes its shape from here and its colour and
1052
+ strength from the theme tokens above. One lap in 4s on every tier. */
1030
1053
  --zrl-radius: 16px;
1031
- --zrl-beam: #00b4d9;
1032
- --zrl-beam-head: #7fe0f4;
1033
- --zrl-beam-size: 100px;
1034
1054
  --zrl-beam-time: 4s;
1035
- --zrl-glow-reach: 20px;
1036
- --zrl-glow-core: 3px;
1037
1055
  }
1038
1056
 
1039
1057
  /* The light on the well's edge: a short comet running along the border, with
@@ -1046,7 +1064,7 @@ var CSS = `
1046
1064
  before 120 and Safari before 15.4; the unprefixed one, declared after it,
1047
1065
  wins everywhere else.
1048
1066
 
1049
- qr-beam keeps a 1px ring on the border line: the comet itself.
1067
+ qr-beam keeps a thin ring on the border line: the comet itself.
1050
1068
  qr-beam-glow is the glow: a wide band outside the well that blurs whatever
1051
1069
  is inside it, and inside it qr-beam-glow-band keeps a 3px ring with a
1052
1070
  second copy of the comet. The blur has to sit on the parent because a
@@ -1061,9 +1079,9 @@ var CSS = `
1061
1079
  .${PREFIX}-qr-beam-glow,
1062
1080
  .${PREFIX}-qr-beam-glow-band {
1063
1081
  position: absolute;
1064
- inset: -1px;
1065
- border: 1px solid transparent;
1066
- border-radius: var(--zrl-radius);
1082
+ inset: calc(0px - var(--zrl-beam-line));
1083
+ border: var(--zrl-beam-line) solid transparent;
1084
+ border-radius: calc(var(--zrl-radius) - 1px + var(--zrl-beam-line));
1067
1085
  pointer-events: none;
1068
1086
  -webkit-mask: linear-gradient(transparent, transparent), linear-gradient(#fff, #fff);
1069
1087
  -webkit-mask-clip: padding-box, border-box;
@@ -1076,8 +1094,9 @@ var CSS = `
1076
1094
  inset: calc(0px - var(--zrl-glow-reach));
1077
1095
  border-width: var(--zrl-glow-reach);
1078
1096
  border-radius: calc(var(--zrl-radius) - 1px + var(--zrl-glow-reach));
1079
- filter: blur(6px);
1080
- opacity: 0.7;
1097
+ filter: blur(var(--zrl-glow-blur));
1098
+ opacity: var(--zrl-glow-opacity);
1099
+ will-change: filter;
1081
1100
  }
1082
1101
  .${PREFIX}-qr-beam-glow-band {
1083
1102
  inset: calc(0px - var(--zrl-glow-core));
@@ -1100,20 +1119,24 @@ var CSS = `
1100
1119
  transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1);
1101
1120
  }
1102
1121
 
1103
- /* The moving light. Declared bottom-up: the transform fallback here, and each
1104
- @supports block further down replaces it where the browser allows. */
1122
+ /* The moving light: an oversized square carrying a conic sweep, rotated
1123
+ whole. A transform animation runs on the compositor, so the light keeps
1124
+ moving while the page is busy; animating the gradient angle instead
1125
+ repaints every frame on the main thread and stutters. */
1105
1126
  .${PREFIX}-qr-beam::after,
1106
1127
  .${PREFIX}-qr-beam-glow-band::after {
1107
1128
  content: '';
1108
1129
  position: absolute;
1109
1130
  inset: -50%;
1110
1131
  background: conic-gradient(
1111
- from var(--zrl-angle, 0deg),
1112
- transparent 0deg 245deg,
1113
- var(--zrl-beam) 332deg 346deg,
1132
+ from 0deg,
1133
+ transparent 0deg 220deg,
1134
+ var(--zrl-beam) 330deg,
1135
+ var(--zrl-beam-head) 348deg,
1114
1136
  transparent 356deg 360deg
1115
1137
  );
1116
- animation: ${PREFIX}-orbit 3s linear infinite;
1138
+ animation: ${PREFIX}-orbit var(--zrl-beam-time) linear infinite;
1139
+ will-change: transform;
1117
1140
  transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1);
1118
1141
  }
1119
1142
 
@@ -1133,6 +1156,8 @@ var CSS = `
1133
1156
  width: 100%;
1134
1157
  height: 100%;
1135
1158
  border-radius: 8px;
1159
+ filter: var(--zrl-qr-filter);
1160
+ mix-blend-mode: var(--zrl-qr-blend);
1136
1161
  transition: filter 300ms cubic-bezier(0.23, 1, 0.32, 1),
1137
1162
  opacity 300ms cubic-bezier(0.23, 1, 0.32, 1),
1138
1163
  transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
@@ -1141,7 +1166,7 @@ var CSS = `
1141
1166
  /* Once the code is claimed the QR is spent. Blurring it out rather than
1142
1167
  swapping it keeps one object on screen through the state change, so the eye
1143
1168
  reads a transformation instead of two things trading places. */
1144
- .${PREFIX}-qr[data-spent="true"] { opacity: 0.2; filter: blur(3px); transform: scale(0.96); }
1169
+ .${PREFIX}-qr[data-spent="true"] { opacity: 0.2; filter: var(--zrl-qr-spent-filter); transform: scale(0.96); }
1145
1170
 
1146
1171
  .${PREFIX}-qr-overlay {
1147
1172
  position: absolute;
@@ -1270,53 +1295,7 @@ var CSS = `
1270
1295
  70%, 100% { transform: scale(2.6); opacity: 0 }
1271
1296
  }
1272
1297
 
1273
- /* Three ways to move the light, one look at rest.
1274
- Where offset-path takes a rect() (Chrome 116, Firefox 122, Safari 18) the
1275
- comet rides the edge. Before that, a conic gradient turns inside the same
1276
- masks instead: on a registered custom property where @property exists, and
1277
- by rotating an oversized square where it does not, since an untyped custom
1278
- property cannot interpolate and the light would snap once a cycle.
1279
- There is no direct query for @property support. transition-behavior
1280
- shipped after it in every engine (Chrome 117 vs 85, Firefox 129 vs 128,
1281
- Safari 17.4 vs 16.4), so it stands in: a yes is never wrong, and a no only
1282
- sends a capable browser down the transform tier, which looks the same.
1283
- inherits: false so the angle stays on the element that animates it and
1284
- never reaches the host page or the well. */
1285
- @property --zrl-angle {
1286
- syntax: '<angle>';
1287
- inherits: false;
1288
- initial-value: 0deg;
1289
- }
1290
1298
  @keyframes ${PREFIX}-orbit { to { transform: rotate(360deg) } }
1291
- @keyframes ${PREFIX}-orbit-angle { to { --zrl-angle: 360deg } }
1292
- @keyframes ${PREFIX}-beam { to { offset-distance: 100% } }
1293
- @supports (transition-behavior: allow-discrete) {
1294
- .${PREFIX}-qr-beam::after {
1295
- inset: -1px;
1296
- animation-name: ${PREFIX}-orbit-angle;
1297
- }
1298
- .${PREFIX}-qr-beam-glow-band::after {
1299
- inset: calc(0px - var(--zrl-glow-core));
1300
- animation-name: ${PREFIX}-orbit-angle;
1301
- }
1302
- }
1303
- /* The comet: a square that rides the well's edge on a rounded-rect path, its
1304
- anchor a little ahead of centre, turned to face the way it travels, and
1305
- masked down to what its overlay allows. The gradient runs against the
1306
- direction of travel: a light head, the blue body, nothing behind. One lap
1307
- in 4s, linear: continuous motion has no ease. */
1308
- @supports (offset-path: rect(0 auto auto 0)) {
1309
- .${PREFIX}-qr-beam::after,
1310
- .${PREFIX}-qr-beam-glow-band::after {
1311
- inset: auto;
1312
- width: var(--zrl-beam-size);
1313
- height: var(--zrl-beam-size);
1314
- background: linear-gradient(to left, var(--zrl-beam-head), var(--zrl-beam), transparent);
1315
- offset-path: rect(0 auto auto 0 round calc(var(--zrl-radius) - 1px));
1316
- offset-anchor: 60% 50%;
1317
- animation: ${PREFIX}-beam var(--zrl-beam-time) linear infinite;
1318
- }
1319
- }
1320
1299
 
1321
1300
  @media (prefers-reduced-motion: reduce) {
1322
1301
  .${PREFIX}-scrim,