@zoreal/oauth2-react 0.2.9 → 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 +160 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +160 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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.
|
|
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;
|
|
@@ -950,10 +950,112 @@ var CSS = `
|
|
|
950
950
|
margin: 20px auto 0;
|
|
951
951
|
padding: 12px;
|
|
952
952
|
border: 1px solid var(--zrl-line);
|
|
953
|
-
border-radius:
|
|
953
|
+
border-radius: var(--zrl-radius);
|
|
954
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;
|
|
965
|
+
}
|
|
966
|
+
|
|
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 {
|
|
991
|
+
position: absolute;
|
|
992
|
+
inset: -1px;
|
|
993
|
+
border: 1px solid transparent;
|
|
994
|
+
border-radius: var(--zrl-radius);
|
|
995
|
+
pointer-events: none;
|
|
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;
|
|
1002
|
+
}
|
|
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));
|
|
1014
|
+
}
|
|
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 {
|
|
1023
|
+
content: '';
|
|
1024
|
+
position: absolute;
|
|
1025
|
+
inset: -50%;
|
|
1026
|
+
background: var(--zrl-beam);
|
|
1027
|
+
opacity: 0;
|
|
1028
|
+
transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
955
1029
|
}
|
|
956
1030
|
|
|
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;
|
|
1037
|
+
inset: -50%;
|
|
1038
|
+
background: conic-gradient(
|
|
1039
|
+
from var(--zrl-angle, 0deg),
|
|
1040
|
+
transparent 0deg 245deg,
|
|
1041
|
+
var(--zrl-beam) 332deg 346deg,
|
|
1042
|
+
transparent 356deg 360deg
|
|
1043
|
+
);
|
|
1044
|
+
animation: ${PREFIX}-orbit 3s linear infinite;
|
|
1045
|
+
transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
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 {
|
|
1053
|
+
animation-play-state: paused;
|
|
1054
|
+
opacity: 0;
|
|
1055
|
+
}
|
|
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; }
|
|
1058
|
+
|
|
957
1059
|
.${PREFIX}-qr {
|
|
958
1060
|
display: block;
|
|
959
1061
|
width: 100%;
|
|
@@ -1096,6 +1198,54 @@ var CSS = `
|
|
|
1096
1198
|
70%, 100% { transform: scale(2.6); opacity: 0 }
|
|
1097
1199
|
}
|
|
1098
1200
|
|
|
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.
|
|
1207
|
+
There is no direct query for @property support. transition-behavior
|
|
1208
|
+
shipped after it in every engine (Chrome 117 vs 85, Firefox 129 vs 128,
|
|
1209
|
+
Safari 17.4 vs 16.4), so it stands in: a yes is never wrong, and a no only
|
|
1210
|
+
sends a capable browser down the transform tier, which looks the same.
|
|
1211
|
+
inherits: false so the angle stays on the element that animates it and
|
|
1212
|
+
never reaches the host page or the well. */
|
|
1213
|
+
@property --zrl-angle {
|
|
1214
|
+
syntax: '<angle>';
|
|
1215
|
+
inherits: false;
|
|
1216
|
+
initial-value: 0deg;
|
|
1217
|
+
}
|
|
1218
|
+
@keyframes ${PREFIX}-orbit { to { transform: rotate(360deg) } }
|
|
1219
|
+
@keyframes ${PREFIX}-orbit-angle { to { --zrl-angle: 360deg } }
|
|
1220
|
+
@keyframes ${PREFIX}-beam { to { offset-distance: 100% } }
|
|
1221
|
+
@supports (transition-behavior: allow-discrete) {
|
|
1222
|
+
.${PREFIX}-qr-beam::after {
|
|
1223
|
+
inset: -1px;
|
|
1224
|
+
animation-name: ${PREFIX}-orbit-angle;
|
|
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
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1099
1249
|
@media (prefers-reduced-motion: reduce) {
|
|
1100
1250
|
.${PREFIX}-scrim,
|
|
1101
1251
|
.${PREFIX}-card,
|
|
@@ -1105,6 +1255,11 @@ var CSS = `
|
|
|
1105
1255
|
.${PREFIX}-cancel,
|
|
1106
1256
|
.${PREFIX}-close,
|
|
1107
1257
|
.${PREFIX}-timer { transition: none }
|
|
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 }
|
|
1108
1263
|
}
|
|
1109
1264
|
`;
|
|
1110
1265
|
function ensureStyles() {
|
|
@@ -1215,7 +1370,9 @@ function PairingModal({
|
|
|
1215
1370
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ZorealLockup, { height: 44, className: cx("lockup") }),
|
|
1216
1371
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h2", { id: titleId, className: cx("title"), children: settled ? t.titleApprove : t.title }),
|
|
1217
1372
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: cx("body-text"), children: body }),
|
|
1218
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: cx("qr-well"), children: [
|
|
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 }),
|
|
1219
1376
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("img", { className: cx("qr"), "data-spent": settled, src: frameUrl, alt: t.qrAlt, width: 180, height: 180 }),
|
|
1220
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, {}) }) })
|
|
1221
1378
|
] }),
|