@zoreal/oauth2-react 0.2.10 → 0.2.11

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
@@ -39,7 +39,7 @@ var import_react2 = require("react");
39
39
 
40
40
  // src/wire.ts
41
41
  var WIRE_VERSION = 1;
42
- var SDK_VERSION = "0.2.10";
42
+ var SDK_VERSION = "0.2.11";
43
43
  var DEFAULT_ISSUER = "https://id.zoreal.com";
44
44
  var POLL_INTERVAL_MS = 2e3;
45
45
  var POLL_INTERVAL_ENROLLING_MS = 5e3;
@@ -940,109 +940,121 @@ var CSS = `
940
940
  color: var(--zrl-ink-soft);
941
941
  }
942
942
 
943
- /* The light around the well: a thin ring in the accent, one bright arc
944
- travelling round it, and a soft glow of the same colour bleeding a few
945
- pixels outward. It says the pairing is live without a word.
946
-
947
- It sits BELOW the well, which is why the well is wrapped instead of given a
948
- pseudo-element. Anything drawn inside the well paints over the white quiet
949
- zone the camera needs, and a negative z-index from inside the well lands
950
- wherever the card's stacking context happens to be that frame (the card's
951
- entrance animation makes and unmakes one). The wrapper is the well's old
952
- box exactly, same size, same margin, so nothing moves; the well keeps its
953
- own stacking order on top, and the ring cannot touch the QR. */
954
- .${PREFIX}-qr-halo {
955
- position: relative;
956
- isolation: isolate;
957
- width: 204px;
958
- height: 204px;
959
- margin: 20px auto 0;
960
- }
961
-
962
943
  .${PREFIX}-qr-well {
963
944
  position: relative;
964
- z-index: 1;
965
945
  display: grid;
966
946
  place-items: center;
967
947
  box-sizing: border-box;
968
948
  width: 204px;
969
949
  height: 204px;
970
- margin: 0;
950
+ margin: 20px auto 0;
971
951
  padding: 12px;
972
952
  border: 1px solid var(--zrl-line);
973
- border-radius: 16px;
953
+ border-radius: var(--zrl-radius);
974
954
  background: var(--zrl-qr-bg);
955
+ /* The light on the edge takes its shape and colour from here. The colour
956
+ is fixed, not themed: the brand blue on both grounds, a lighter tint of
957
+ it at the head, no other hue. */
958
+ --zrl-radius: 16px;
959
+ --zrl-beam: #00b4d9;
960
+ --zrl-beam-head: #7fe0f4;
961
+ --zrl-beam-size: 100px;
962
+ --zrl-beam-time: 4s;
963
+ --zrl-glow-reach: 20px;
964
+ --zrl-glow-core: 3px;
975
965
  }
976
966
 
977
- /* The glow is the ring's own alpha, blurred and drawn beneath it, so it
978
- follows the arc round and fades with it. It has to be a parent of the
979
- masked band: a filter is applied before a mask, so a shadow cast from the
980
- band itself would be cut off at the band's edge. Two shadows because one
981
- 2px source blurred over 10px is too faint to read as light; the second
982
- blurs the first. */
983
- .${PREFIX}-qr-glow {
967
+ /* The light on the well's edge: a short comet running along the border, with
968
+ a soft glow outside it. Three overlays inside the well, each masked so the
969
+ comet can only ever paint where its mask allows, and the white interior lies
970
+ outside every mask: nothing here can reach the quiet zone a camera needs,
971
+ whatever the comet is doing. The mask is the padding box cut out of the
972
+ border box, a transparent layer clipped to the padding box intersected
973
+ with a solid one clipped to the border box. The prefixed form is for Chrome
974
+ before 120 and Safari before 15.4; the unprefixed one, declared after it,
975
+ wins everywhere else.
976
+
977
+ qr-beam keeps a 1px ring on the border line: the comet itself.
978
+ qr-beam-glow is the glow: a wide band outside the well that blurs whatever
979
+ is inside it, and inside it qr-beam-glow-band keeps a 3px ring with a
980
+ second copy of the comet. The blur has to sit on the parent because a
981
+ filter is applied before a mask: blurred on the band itself, the glow
982
+ would be cut back to the band's own edge. On the parent it runs after the
983
+ band has clipped the comet thin and before the parent's mask cuts away the
984
+ inward half, which is what makes it fade outward and never over the QR.
985
+ All three share one containing block, the well's padding box, so the two
986
+ comets ride the same path; the spent badge is a later sibling and paints
987
+ above them. */
988
+ .${PREFIX}-qr-beam,
989
+ .${PREFIX}-qr-beam-glow,
990
+ .${PREFIX}-qr-beam-glow-band {
984
991
  position: absolute;
985
- inset: -2px;
992
+ inset: -1px;
993
+ border: 1px solid transparent;
994
+ border-radius: var(--zrl-radius);
986
995
  pointer-events: none;
987
- filter: drop-shadow(0 0 3px var(--zrl-accent)) drop-shadow(0 0 10px var(--zrl-accent));
996
+ -webkit-mask: linear-gradient(transparent, transparent), linear-gradient(#fff, #fff);
997
+ -webkit-mask-clip: padding-box, border-box;
998
+ -webkit-mask-composite: source-in;
999
+ mask: linear-gradient(transparent, transparent), linear-gradient(#fff, #fff);
1000
+ mask-clip: padding-box, border-box;
1001
+ mask-composite: intersect;
988
1002
  }
989
-
990
- /* The band: a 2px ring just outside the well, cut with a mask that keeps the
991
- padding and drops the content box. The gradient is on a pseudo-element
992
- rather than on the band, because in the fallback it has to rotate as a
993
- whole while the band stays put. The prefixed mask is for Chrome before 120;
994
- the unprefixed one, declared after it, wins everywhere else. */
995
- .${PREFIX}-qr-arc {
996
- position: absolute;
997
- inset: 0;
998
- padding: 2px;
999
- border-radius: 18px;
1000
- overflow: hidden;
1001
- -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
1002
- -webkit-mask-composite: xor;
1003
- mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
1004
- mask-composite: exclude;
1003
+ .${PREFIX}-qr-beam-glow {
1004
+ inset: calc(0px - var(--zrl-glow-reach));
1005
+ border-width: var(--zrl-glow-reach);
1006
+ border-radius: calc(var(--zrl-radius) - 1px + var(--zrl-glow-reach));
1007
+ filter: blur(6px);
1008
+ opacity: 0.7;
1009
+ }
1010
+ .${PREFIX}-qr-beam-glow-band {
1011
+ inset: calc(0px - var(--zrl-glow-core));
1012
+ border-width: var(--zrl-glow-core);
1013
+ border-radius: calc(var(--zrl-radius) - 1px + var(--zrl-glow-core));
1005
1014
  }
1006
- .${PREFIX}-qr-arc::before,
1007
- .${PREFIX}-qr-arc::after {
1015
+
1016
+ /* At rest the edge holds a dim, even blue: a 1px line on the border and, from
1017
+ the glow band, a soft halo outside it. Hidden while the comet runs, so the
1018
+ border reads as the well's own line with a light passing over it; shown
1019
+ once the light has stopped. Every path below ends here, which is what
1020
+ makes them look the same at rest. */
1021
+ .${PREFIX}-qr-beam::before,
1022
+ .${PREFIX}-qr-beam-glow-band::before {
1008
1023
  content: '';
1009
1024
  position: absolute;
1025
+ inset: -50%;
1026
+ background: var(--zrl-beam);
1027
+ opacity: 0;
1010
1028
  transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1);
1011
1029
  }
1012
1030
 
1013
- /* The light. Mostly transparent, a tail that builds over a quarter turn, a
1014
- short full-strength head and a drop-off within a few degrees, so it reads
1015
- as travelling rather than blinking. One revolution every 3s, linear:
1016
- continuous motion has no ease. Oversized so its corners still cover the
1017
- band mid-rotation in the transform fallback; the property path shrinks it
1018
- back to the band. */
1019
- .${PREFIX}-qr-arc::before {
1031
+ /* The moving light. Declared bottom-up: the transform fallback here, and each
1032
+ @supports block further down replaces it where the browser allows. */
1033
+ .${PREFIX}-qr-beam::after,
1034
+ .${PREFIX}-qr-beam-glow-band::after {
1035
+ content: '';
1036
+ position: absolute;
1020
1037
  inset: -50%;
1021
1038
  background: conic-gradient(
1022
1039
  from var(--zrl-angle, 0deg),
1023
1040
  transparent 0deg 245deg,
1024
- var(--zrl-accent) 332deg 346deg,
1041
+ var(--zrl-beam) 332deg 346deg,
1025
1042
  transparent 356deg 360deg
1026
1043
  );
1027
1044
  animation: ${PREFIX}-orbit 3s linear infinite;
1045
+ transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1);
1028
1046
  }
1029
1047
 
1030
- /* The rest state: the same ring, evenly lit. Faint under the moving light so
1031
- the ring reads as a ring; stronger once the light has stopped. */
1032
- .${PREFIX}-qr-arc::after {
1033
- inset: 0;
1034
- background: var(--zrl-accent);
1035
- opacity: 0.16;
1036
- }
1037
-
1038
- /* Spent: the light stops where it is and fades, and the ring settles to a
1039
- dim, even glow. Paused rather than removed, so it does not jump back to
1040
- its start on the way out. */
1041
- .${PREFIX}-qr-halo[data-spent="true"] .${PREFIX}-qr-arc::before {
1048
+ /* Spent: the light stops where it is and fades, and the edge settles to the
1049
+ dim glow. Paused rather than removed, so it does not jump back to its start
1050
+ on the way out. */
1051
+ .${PREFIX}-qr-well[data-spent="true"] .${PREFIX}-qr-beam::after,
1052
+ .${PREFIX}-qr-well[data-spent="true"] .${PREFIX}-qr-beam-glow-band::after {
1042
1053
  animation-play-state: paused;
1043
1054
  opacity: 0;
1044
1055
  }
1045
- .${PREFIX}-qr-halo[data-spent="true"] .${PREFIX}-qr-arc::after { opacity: 0.34; }
1056
+ .${PREFIX}-qr-well[data-spent="true"] .${PREFIX}-qr-beam::before { opacity: 0.55; }
1057
+ .${PREFIX}-qr-well[data-spent="true"] .${PREFIX}-qr-beam-glow-band::before { opacity: 0.7; }
1046
1058
 
1047
1059
  .${PREFIX}-qr {
1048
1060
  display: block;
@@ -1186,17 +1198,16 @@ var CSS = `
1186
1198
  70%, 100% { transform: scale(2.6); opacity: 0 }
1187
1199
  }
1188
1200
 
1189
- /* Two ways to turn the light, one look.
1190
- Where the browser can register a typed custom property, the gradient's own
1191
- angle animates and the element never moves. Where it cannot (Firefox before
1192
- 128), an untyped custom property cannot interpolate and the light would
1193
- snap once a cycle, so the oversized pseudo-element rotates instead and the
1194
- band's mask keeps the ring in place. At rest the two are the same pixels:
1195
- same gradient, same centre, angle zero.
1201
+ /* Three ways to move the light, one look at rest.
1202
+ Where offset-path takes a rect() (Chrome 116, Firefox 122, Safari 18) the
1203
+ comet rides the edge. Before that, a conic gradient turns inside the same
1204
+ masks instead: on a registered custom property where @property exists, and
1205
+ by rotating an oversized square where it does not, since an untyped custom
1206
+ property cannot interpolate and the light would snap once a cycle.
1196
1207
  There is no direct query for @property support. transition-behavior
1197
1208
  shipped after it in every engine (Chrome 117 vs 85, Firefox 129 vs 128,
1198
1209
  Safari 17.4 vs 16.4), so it stands in: a yes is never wrong, and a no only
1199
- sends a capable browser down the fallback, which looks the same.
1210
+ sends a capable browser down the transform tier, which looks the same.
1200
1211
  inherits: false so the angle stays on the element that animates it and
1201
1212
  never reaches the host page or the well. */
1202
1213
  @property --zrl-angle {
@@ -1206,11 +1217,33 @@ var CSS = `
1206
1217
  }
1207
1218
  @keyframes ${PREFIX}-orbit { to { transform: rotate(360deg) } }
1208
1219
  @keyframes ${PREFIX}-orbit-angle { to { --zrl-angle: 360deg } }
1220
+ @keyframes ${PREFIX}-beam { to { offset-distance: 100% } }
1209
1221
  @supports (transition-behavior: allow-discrete) {
1210
- .${PREFIX}-qr-arc::before {
1211
- inset: 0;
1222
+ .${PREFIX}-qr-beam::after {
1223
+ inset: -1px;
1212
1224
  animation-name: ${PREFIX}-orbit-angle;
1213
1225
  }
1226
+ .${PREFIX}-qr-beam-glow-band::after {
1227
+ inset: calc(0px - var(--zrl-glow-core));
1228
+ animation-name: ${PREFIX}-orbit-angle;
1229
+ }
1230
+ }
1231
+ /* The comet: a square that rides the well's edge on a rounded-rect path, its
1232
+ anchor a little ahead of centre, turned to face the way it travels, and
1233
+ masked down to what its overlay allows. The gradient runs against the
1234
+ direction of travel: a light head, the blue body, nothing behind. One lap
1235
+ in 4s, linear: continuous motion has no ease. */
1236
+ @supports (offset-path: rect(0 auto auto 0)) {
1237
+ .${PREFIX}-qr-beam::after,
1238
+ .${PREFIX}-qr-beam-glow-band::after {
1239
+ inset: auto;
1240
+ width: var(--zrl-beam-size);
1241
+ height: var(--zrl-beam-size);
1242
+ background: linear-gradient(to left, var(--zrl-beam-head), var(--zrl-beam), transparent);
1243
+ offset-path: rect(0 auto auto 0 round calc(var(--zrl-radius) - 1px));
1244
+ offset-anchor: 60% 50%;
1245
+ animation: ${PREFIX}-beam var(--zrl-beam-time) linear infinite;
1246
+ }
1214
1247
  }
1215
1248
 
1216
1249
  @media (prefers-reduced-motion: reduce) {
@@ -1222,10 +1255,11 @@ var CSS = `
1222
1255
  .${PREFIX}-cancel,
1223
1256
  .${PREFIX}-close,
1224
1257
  .${PREFIX}-timer { transition: none }
1225
- /* No travelling light. The ring keeps a still, soft glow instead, a step
1226
- brighter than the spent state so pending and spent still read apart. */
1227
- .${PREFIX}-qr-arc::before { animation: none; opacity: 0 }
1228
- .${PREFIX}-qr-arc::after { opacity: 0.5 }
1258
+ /* No travelling light; the edge keeps its dim static glow instead. */
1259
+ .${PREFIX}-qr-beam::after,
1260
+ .${PREFIX}-qr-beam-glow-band::after { animation: none; opacity: 0 }
1261
+ .${PREFIX}-qr-beam::before { opacity: 0.55 }
1262
+ .${PREFIX}-qr-beam-glow-band::before { opacity: 0.7 }
1229
1263
  }
1230
1264
  `;
1231
1265
  function ensureStyles() {
@@ -1336,12 +1370,11 @@ function PairingModal({
1336
1370
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ZorealLockup, { height: 44, className: cx("lockup") }),
1337
1371
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h2", { id: titleId, className: cx("title"), children: settled ? t.titleApprove : t.title }),
1338
1372
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: cx("body-text"), children: body }),
1339
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: cx("qr-halo"), "data-spent": settled, children: [
1340
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: cx("qr-glow"), "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: cx("qr-arc") }) }),
1341
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: cx("qr-well"), children: [
1342
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("img", { className: cx("qr"), "data-spent": settled, src: frameUrl, alt: t.qrAlt, width: 180, height: 180 }),
1343
- settled && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: cx("qr-overlay"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: cx("qr-badge"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(IconPhone, {}) }) })
1344
- ] })
1373
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: cx("qr-well"), "data-spent": settled, children: [
1374
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: cx("qr-beam-glow"), "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: cx("qr-beam-glow-band") }) }),
1375
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: cx("qr-beam"), "aria-hidden": true }),
1376
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("img", { className: cx("qr"), "data-spent": settled, src: frameUrl, alt: t.qrAlt, width: 180, height: 180 }),
1377
+ settled && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: cx("qr-overlay"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: cx("qr-badge"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(IconPhone, {}) }) })
1345
1378
  ] }),
1346
1379
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: cx("status"), children: [
1347
1380
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: cx("dot"), children: [