@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.d.cts CHANGED
@@ -289,7 +289,7 @@ declare function mountPairingModal(state: PairingState, options: PairingModalOpt
289
289
  * auth-code mode leaves it to the RP backend.
290
290
  */
291
291
  declare const WIRE_VERSION = 1;
292
- declare const SDK_VERSION = "0.1.12";
292
+ declare const SDK_VERSION = "0.1.13";
293
293
  declare const SDK_NAME = "@zoreal/oauth2-js";
294
294
  declare const DEFAULT_ISSUER = "https://id.zoreal.com";
295
295
  /** Pending TTL is short. Poll gently; over-polling cancels the request. */
package/dist/index.d.ts CHANGED
@@ -289,7 +289,7 @@ declare function mountPairingModal(state: PairingState, options: PairingModalOpt
289
289
  * auth-code mode leaves it to the RP backend.
290
290
  */
291
291
  declare const WIRE_VERSION = 1;
292
- declare const SDK_VERSION = "0.1.12";
292
+ declare const SDK_VERSION = "0.1.13";
293
293
  declare const SDK_NAME = "@zoreal/oauth2-js";
294
294
  declare const DEFAULT_ISSUER = "https://id.zoreal.com";
295
295
  /** Pending TTL is short. Poll gently; over-polling cancels the request. */
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ function unsafeClaims(idToken) {
14
14
 
15
15
  // src/wire.ts
16
16
  var WIRE_VERSION = 1;
17
- var SDK_VERSION = "0.1.12";
17
+ var SDK_VERSION = "0.1.13";
18
18
  var SDK_NAME = "@zoreal/oauth2-js";
19
19
  var DEFAULT_ISSUER = "https://id.zoreal.com";
20
20
  var POLL_INTERVAL_MS = 2e3;
@@ -886,8 +886,20 @@ var LIGHT = `
886
886
  --zrl-accent-ink: #04698a;
887
887
  --zrl-urgent: #b4761a;
888
888
  --zrl-qr-bg: #ffffff;
889
+ --zrl-qr-filter: none;
890
+ --zrl-qr-spent-filter: blur(3px);
891
+ --zrl-qr-blend: normal;
889
892
  --zrl-shadow: 0 1px 2px rgba(16, 18, 27, 0.06), 0 20px 50px -12px rgba(16, 18, 27, 0.3);
890
893
  --zrl-ring: rgba(16, 18, 27, 0.07);
894
+ /* The light on the QR well's edge. Brand blue on both grounds, a lighter
895
+ tint at the head; only its strength is themed, see the dark block. */
896
+ --zrl-beam: #00b4d9;
897
+ --zrl-beam-head: #7fe0f4;
898
+ --zrl-beam-line: 2px;
899
+ --zrl-glow-core: 4px;
900
+ --zrl-glow-reach: 24px;
901
+ --zrl-glow-blur: 8px;
902
+ --zrl-glow-opacity: 0.6;
891
903
  `;
892
904
  var DARK = `
893
905
  --zrl-scrim: rgba(0, 0, 0, 0.62);
@@ -902,12 +914,24 @@ var DARK = `
902
914
  --zrl-accent-soft: #0d3b47;
903
915
  --zrl-accent-ink: #7fdcf0;
904
916
  --zrl-urgent: #e0a952;
905
- /* The QR well stays white in dark mode on purpose: a scanner needs the
906
- quiet-zone contrast, and an inverted QR fails on a good number of phone
907
- cameras. It reads as a deliberate light panel, not a theming miss. */
908
- --zrl-qr-bg: #ffffff;
917
+ /* The code is drawn light on the dark surface: the panel is transparent
918
+ and the image is inverted and screened, so only the modules and the
919
+ mark show. */
920
+ --zrl-qr-bg: transparent;
921
+ --zrl-qr-filter: invert(1);
922
+ --zrl-qr-spent-filter: invert(1) blur(3px);
923
+ --zrl-qr-blend: screen;
909
924
  --zrl-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 20px 50px -12px rgba(0, 0, 0, 0.65);
910
925
  --zrl-ring: rgba(255, 255, 255, 0.1);
926
+ /* A glow that reads on a white card disappears on a dark one: the light
927
+ here is brighter and wider, and its halo reaches further out. */
928
+ --zrl-beam: #22c8ec;
929
+ --zrl-beam-head: #c2f3fc;
930
+ --zrl-beam-line: 3px;
931
+ --zrl-glow-core: 6px;
932
+ --zrl-glow-reach: 32px;
933
+ --zrl-glow-blur: 10px;
934
+ --zrl-glow-opacity: 0.85;
911
935
  `;
912
936
  var CSS = `
913
937
  .${PREFIX}-root { ${LIGHT} }
@@ -979,16 +1003,10 @@ var CSS = `
979
1003
  border: 1px solid var(--zrl-line);
980
1004
  border-radius: var(--zrl-radius);
981
1005
  background: var(--zrl-qr-bg);
982
- /* The light on the edge takes its shape and colour from here. The colour
983
- is fixed, not themed: the brand blue on both grounds, a lighter tint of
984
- it at the head, no other hue. */
1006
+ /* The light on the edge takes its shape from here and its colour and
1007
+ strength from the theme tokens above. One lap in 4s on every tier. */
985
1008
  --zrl-radius: 16px;
986
- --zrl-beam: #00b4d9;
987
- --zrl-beam-head: #7fe0f4;
988
- --zrl-beam-size: 100px;
989
1009
  --zrl-beam-time: 4s;
990
- --zrl-glow-reach: 20px;
991
- --zrl-glow-core: 3px;
992
1010
  }
993
1011
 
994
1012
  /* The light on the well's edge: a short comet running along the border, with
@@ -1001,7 +1019,7 @@ var CSS = `
1001
1019
  before 120 and Safari before 15.4; the unprefixed one, declared after it,
1002
1020
  wins everywhere else.
1003
1021
 
1004
- qr-beam keeps a 1px ring on the border line: the comet itself.
1022
+ qr-beam keeps a thin ring on the border line: the comet itself.
1005
1023
  qr-beam-glow is the glow: a wide band outside the well that blurs whatever
1006
1024
  is inside it, and inside it qr-beam-glow-band keeps a 3px ring with a
1007
1025
  second copy of the comet. The blur has to sit on the parent because a
@@ -1016,9 +1034,9 @@ var CSS = `
1016
1034
  .${PREFIX}-qr-beam-glow,
1017
1035
  .${PREFIX}-qr-beam-glow-band {
1018
1036
  position: absolute;
1019
- inset: -1px;
1020
- border: 1px solid transparent;
1021
- border-radius: var(--zrl-radius);
1037
+ inset: calc(0px - var(--zrl-beam-line));
1038
+ border: var(--zrl-beam-line) solid transparent;
1039
+ border-radius: calc(var(--zrl-radius) - 1px + var(--zrl-beam-line));
1022
1040
  pointer-events: none;
1023
1041
  -webkit-mask: linear-gradient(transparent, transparent), linear-gradient(#fff, #fff);
1024
1042
  -webkit-mask-clip: padding-box, border-box;
@@ -1031,8 +1049,9 @@ var CSS = `
1031
1049
  inset: calc(0px - var(--zrl-glow-reach));
1032
1050
  border-width: var(--zrl-glow-reach);
1033
1051
  border-radius: calc(var(--zrl-radius) - 1px + var(--zrl-glow-reach));
1034
- filter: blur(6px);
1035
- opacity: 0.7;
1052
+ filter: blur(var(--zrl-glow-blur));
1053
+ opacity: var(--zrl-glow-opacity);
1054
+ will-change: filter;
1036
1055
  }
1037
1056
  .${PREFIX}-qr-beam-glow-band {
1038
1057
  inset: calc(0px - var(--zrl-glow-core));
@@ -1055,20 +1074,24 @@ var CSS = `
1055
1074
  transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1);
1056
1075
  }
1057
1076
 
1058
- /* The moving light. Declared bottom-up: the transform fallback here, and each
1059
- @supports block further down replaces it where the browser allows. */
1077
+ /* The moving light: an oversized square carrying a conic sweep, rotated
1078
+ whole. A transform animation runs on the compositor, so the light keeps
1079
+ moving while the page is busy; animating the gradient angle instead
1080
+ repaints every frame on the main thread and stutters. */
1060
1081
  .${PREFIX}-qr-beam::after,
1061
1082
  .${PREFIX}-qr-beam-glow-band::after {
1062
1083
  content: '';
1063
1084
  position: absolute;
1064
1085
  inset: -50%;
1065
1086
  background: conic-gradient(
1066
- from var(--zrl-angle, 0deg),
1067
- transparent 0deg 245deg,
1068
- var(--zrl-beam) 332deg 346deg,
1087
+ from 0deg,
1088
+ transparent 0deg 220deg,
1089
+ var(--zrl-beam) 330deg,
1090
+ var(--zrl-beam-head) 348deg,
1069
1091
  transparent 356deg 360deg
1070
1092
  );
1071
- animation: ${PREFIX}-orbit 3s linear infinite;
1093
+ animation: ${PREFIX}-orbit var(--zrl-beam-time) linear infinite;
1094
+ will-change: transform;
1072
1095
  transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1);
1073
1096
  }
1074
1097
 
@@ -1088,6 +1111,8 @@ var CSS = `
1088
1111
  width: 100%;
1089
1112
  height: 100%;
1090
1113
  border-radius: 8px;
1114
+ filter: var(--zrl-qr-filter);
1115
+ mix-blend-mode: var(--zrl-qr-blend);
1091
1116
  transition: filter 300ms cubic-bezier(0.23, 1, 0.32, 1),
1092
1117
  opacity 300ms cubic-bezier(0.23, 1, 0.32, 1),
1093
1118
  transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
@@ -1096,7 +1121,7 @@ var CSS = `
1096
1121
  /* Once the code is claimed the QR is spent. Blurring it out rather than
1097
1122
  swapping it keeps one object on screen through the state change, so the eye
1098
1123
  reads a transformation instead of two things trading places. */
1099
- .${PREFIX}-qr[data-spent="true"] { opacity: 0.2; filter: blur(3px); transform: scale(0.96); }
1124
+ .${PREFIX}-qr[data-spent="true"] { opacity: 0.2; filter: var(--zrl-qr-spent-filter); transform: scale(0.96); }
1100
1125
 
1101
1126
  .${PREFIX}-qr-overlay {
1102
1127
  position: absolute;
@@ -1225,53 +1250,7 @@ var CSS = `
1225
1250
  70%, 100% { transform: scale(2.6); opacity: 0 }
1226
1251
  }
1227
1252
 
1228
- /* Three ways to move the light, one look at rest.
1229
- Where offset-path takes a rect() (Chrome 116, Firefox 122, Safari 18) the
1230
- comet rides the edge. Before that, a conic gradient turns inside the same
1231
- masks instead: on a registered custom property where @property exists, and
1232
- by rotating an oversized square where it does not, since an untyped custom
1233
- property cannot interpolate and the light would snap once a cycle.
1234
- There is no direct query for @property support. transition-behavior
1235
- shipped after it in every engine (Chrome 117 vs 85, Firefox 129 vs 128,
1236
- Safari 17.4 vs 16.4), so it stands in: a yes is never wrong, and a no only
1237
- sends a capable browser down the transform tier, which looks the same.
1238
- inherits: false so the angle stays on the element that animates it and
1239
- never reaches the host page or the well. */
1240
- @property --zrl-angle {
1241
- syntax: '<angle>';
1242
- inherits: false;
1243
- initial-value: 0deg;
1244
- }
1245
1253
  @keyframes ${PREFIX}-orbit { to { transform: rotate(360deg) } }
1246
- @keyframes ${PREFIX}-orbit-angle { to { --zrl-angle: 360deg } }
1247
- @keyframes ${PREFIX}-beam { to { offset-distance: 100% } }
1248
- @supports (transition-behavior: allow-discrete) {
1249
- .${PREFIX}-qr-beam::after {
1250
- inset: -1px;
1251
- animation-name: ${PREFIX}-orbit-angle;
1252
- }
1253
- .${PREFIX}-qr-beam-glow-band::after {
1254
- inset: calc(0px - var(--zrl-glow-core));
1255
- animation-name: ${PREFIX}-orbit-angle;
1256
- }
1257
- }
1258
- /* The comet: a square that rides the well's edge on a rounded-rect path, its
1259
- anchor a little ahead of centre, turned to face the way it travels, and
1260
- masked down to what its overlay allows. The gradient runs against the
1261
- direction of travel: a light head, the blue body, nothing behind. One lap
1262
- in 4s, linear: continuous motion has no ease. */
1263
- @supports (offset-path: rect(0 auto auto 0)) {
1264
- .${PREFIX}-qr-beam::after,
1265
- .${PREFIX}-qr-beam-glow-band::after {
1266
- inset: auto;
1267
- width: var(--zrl-beam-size);
1268
- height: var(--zrl-beam-size);
1269
- background: linear-gradient(to left, var(--zrl-beam-head), var(--zrl-beam), transparent);
1270
- offset-path: rect(0 auto auto 0 round calc(var(--zrl-radius) - 1px));
1271
- offset-anchor: 60% 50%;
1272
- animation: ${PREFIX}-beam var(--zrl-beam-time) linear infinite;
1273
- }
1274
- }
1275
1254
 
1276
1255
  @media (prefers-reduced-motion: reduce) {
1277
1256
  .${PREFIX}-scrim,