@zoreal/oauth2-react 0.2.11 → 0.2.12
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 +51 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +51 -72
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { createContext, useContext, useMemo, useState as useState2 } from "react
|
|
|
5
5
|
|
|
6
6
|
// src/wire.ts
|
|
7
7
|
var WIRE_VERSION = 1;
|
|
8
|
-
var SDK_VERSION = "0.2.
|
|
8
|
+
var SDK_VERSION = "0.2.12";
|
|
9
9
|
var DEFAULT_ISSUER = "https://id.zoreal.com";
|
|
10
10
|
var POLL_INTERVAL_MS = 2e3;
|
|
11
11
|
var POLL_INTERVAL_ENROLLING_MS = 5e3;
|
|
@@ -825,8 +825,20 @@ var LIGHT = `
|
|
|
825
825
|
--zrl-accent-ink: #04698a;
|
|
826
826
|
--zrl-urgent: #b4761a;
|
|
827
827
|
--zrl-qr-bg: #ffffff;
|
|
828
|
+
--zrl-qr-filter: none;
|
|
829
|
+
--zrl-qr-spent-filter: blur(3px);
|
|
830
|
+
--zrl-qr-blend: normal;
|
|
828
831
|
--zrl-shadow: 0 1px 2px rgba(16, 18, 27, 0.06), 0 20px 50px -12px rgba(16, 18, 27, 0.3);
|
|
829
832
|
--zrl-ring: rgba(16, 18, 27, 0.07);
|
|
833
|
+
/* The light on the QR well's edge. Brand blue on both grounds, a lighter
|
|
834
|
+
tint at the head; only its strength is themed, see the dark block. */
|
|
835
|
+
--zrl-beam: #00b4d9;
|
|
836
|
+
--zrl-beam-head: #7fe0f4;
|
|
837
|
+
--zrl-beam-line: 2px;
|
|
838
|
+
--zrl-glow-core: 4px;
|
|
839
|
+
--zrl-glow-reach: 24px;
|
|
840
|
+
--zrl-glow-blur: 8px;
|
|
841
|
+
--zrl-glow-opacity: 0.6;
|
|
830
842
|
`;
|
|
831
843
|
var DARK = `
|
|
832
844
|
--zrl-scrim: rgba(0, 0, 0, 0.62);
|
|
@@ -841,12 +853,24 @@ var DARK = `
|
|
|
841
853
|
--zrl-accent-soft: #0d3b47;
|
|
842
854
|
--zrl-accent-ink: #7fdcf0;
|
|
843
855
|
--zrl-urgent: #e0a952;
|
|
844
|
-
/* The
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
--zrl-qr-bg:
|
|
856
|
+
/* The code is drawn light on the dark surface: the panel is transparent
|
|
857
|
+
and the image is inverted and screened, so only the modules and the
|
|
858
|
+
mark show. */
|
|
859
|
+
--zrl-qr-bg: transparent;
|
|
860
|
+
--zrl-qr-filter: invert(1);
|
|
861
|
+
--zrl-qr-spent-filter: invert(1) blur(3px);
|
|
862
|
+
--zrl-qr-blend: screen;
|
|
848
863
|
--zrl-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 20px 50px -12px rgba(0, 0, 0, 0.65);
|
|
849
864
|
--zrl-ring: rgba(255, 255, 255, 0.1);
|
|
865
|
+
/* A glow that reads on a white card disappears on a dark one: the light
|
|
866
|
+
here is brighter and wider, and its halo reaches further out. */
|
|
867
|
+
--zrl-beam: #22c8ec;
|
|
868
|
+
--zrl-beam-head: #c2f3fc;
|
|
869
|
+
--zrl-beam-line: 3px;
|
|
870
|
+
--zrl-glow-core: 6px;
|
|
871
|
+
--zrl-glow-reach: 32px;
|
|
872
|
+
--zrl-glow-blur: 10px;
|
|
873
|
+
--zrl-glow-opacity: 0.85;
|
|
850
874
|
`;
|
|
851
875
|
var CSS = `
|
|
852
876
|
.${PREFIX}-root { ${LIGHT} }
|
|
@@ -918,16 +942,10 @@ var CSS = `
|
|
|
918
942
|
border: 1px solid var(--zrl-line);
|
|
919
943
|
border-radius: var(--zrl-radius);
|
|
920
944
|
background: var(--zrl-qr-bg);
|
|
921
|
-
/* The light on the edge takes its shape
|
|
922
|
-
|
|
923
|
-
it at the head, no other hue. */
|
|
945
|
+
/* The light on the edge takes its shape from here and its colour and
|
|
946
|
+
strength from the theme tokens above. One lap in 4s on every tier. */
|
|
924
947
|
--zrl-radius: 16px;
|
|
925
|
-
--zrl-beam: #00b4d9;
|
|
926
|
-
--zrl-beam-head: #7fe0f4;
|
|
927
|
-
--zrl-beam-size: 100px;
|
|
928
948
|
--zrl-beam-time: 4s;
|
|
929
|
-
--zrl-glow-reach: 20px;
|
|
930
|
-
--zrl-glow-core: 3px;
|
|
931
949
|
}
|
|
932
950
|
|
|
933
951
|
/* The light on the well's edge: a short comet running along the border, with
|
|
@@ -940,7 +958,7 @@ var CSS = `
|
|
|
940
958
|
before 120 and Safari before 15.4; the unprefixed one, declared after it,
|
|
941
959
|
wins everywhere else.
|
|
942
960
|
|
|
943
|
-
qr-beam keeps a
|
|
961
|
+
qr-beam keeps a thin ring on the border line: the comet itself.
|
|
944
962
|
qr-beam-glow is the glow: a wide band outside the well that blurs whatever
|
|
945
963
|
is inside it, and inside it qr-beam-glow-band keeps a 3px ring with a
|
|
946
964
|
second copy of the comet. The blur has to sit on the parent because a
|
|
@@ -955,9 +973,9 @@ var CSS = `
|
|
|
955
973
|
.${PREFIX}-qr-beam-glow,
|
|
956
974
|
.${PREFIX}-qr-beam-glow-band {
|
|
957
975
|
position: absolute;
|
|
958
|
-
inset: -
|
|
959
|
-
border:
|
|
960
|
-
border-radius: var(--zrl-radius);
|
|
976
|
+
inset: calc(0px - var(--zrl-beam-line));
|
|
977
|
+
border: var(--zrl-beam-line) solid transparent;
|
|
978
|
+
border-radius: calc(var(--zrl-radius) - 1px + var(--zrl-beam-line));
|
|
961
979
|
pointer-events: none;
|
|
962
980
|
-webkit-mask: linear-gradient(transparent, transparent), linear-gradient(#fff, #fff);
|
|
963
981
|
-webkit-mask-clip: padding-box, border-box;
|
|
@@ -970,8 +988,9 @@ var CSS = `
|
|
|
970
988
|
inset: calc(0px - var(--zrl-glow-reach));
|
|
971
989
|
border-width: var(--zrl-glow-reach);
|
|
972
990
|
border-radius: calc(var(--zrl-radius) - 1px + var(--zrl-glow-reach));
|
|
973
|
-
filter: blur(
|
|
974
|
-
opacity:
|
|
991
|
+
filter: blur(var(--zrl-glow-blur));
|
|
992
|
+
opacity: var(--zrl-glow-opacity);
|
|
993
|
+
will-change: filter;
|
|
975
994
|
}
|
|
976
995
|
.${PREFIX}-qr-beam-glow-band {
|
|
977
996
|
inset: calc(0px - var(--zrl-glow-core));
|
|
@@ -994,20 +1013,24 @@ var CSS = `
|
|
|
994
1013
|
transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
995
1014
|
}
|
|
996
1015
|
|
|
997
|
-
/* The moving light
|
|
998
|
-
|
|
1016
|
+
/* The moving light: an oversized square carrying a conic sweep, rotated
|
|
1017
|
+
whole. A transform animation runs on the compositor, so the light keeps
|
|
1018
|
+
moving while the page is busy; animating the gradient angle instead
|
|
1019
|
+
repaints every frame on the main thread and stutters. */
|
|
999
1020
|
.${PREFIX}-qr-beam::after,
|
|
1000
1021
|
.${PREFIX}-qr-beam-glow-band::after {
|
|
1001
1022
|
content: '';
|
|
1002
1023
|
position: absolute;
|
|
1003
1024
|
inset: -50%;
|
|
1004
1025
|
background: conic-gradient(
|
|
1005
|
-
from
|
|
1006
|
-
transparent 0deg
|
|
1007
|
-
var(--zrl-beam)
|
|
1026
|
+
from 0deg,
|
|
1027
|
+
transparent 0deg 220deg,
|
|
1028
|
+
var(--zrl-beam) 330deg,
|
|
1029
|
+
var(--zrl-beam-head) 348deg,
|
|
1008
1030
|
transparent 356deg 360deg
|
|
1009
1031
|
);
|
|
1010
|
-
animation: ${PREFIX}-orbit
|
|
1032
|
+
animation: ${PREFIX}-orbit var(--zrl-beam-time) linear infinite;
|
|
1033
|
+
will-change: transform;
|
|
1011
1034
|
transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
1012
1035
|
}
|
|
1013
1036
|
|
|
@@ -1027,6 +1050,8 @@ var CSS = `
|
|
|
1027
1050
|
width: 100%;
|
|
1028
1051
|
height: 100%;
|
|
1029
1052
|
border-radius: 8px;
|
|
1053
|
+
filter: var(--zrl-qr-filter);
|
|
1054
|
+
mix-blend-mode: var(--zrl-qr-blend);
|
|
1030
1055
|
transition: filter 300ms cubic-bezier(0.23, 1, 0.32, 1),
|
|
1031
1056
|
opacity 300ms cubic-bezier(0.23, 1, 0.32, 1),
|
|
1032
1057
|
transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
@@ -1035,7 +1060,7 @@ var CSS = `
|
|
|
1035
1060
|
/* Once the code is claimed the QR is spent. Blurring it out rather than
|
|
1036
1061
|
swapping it keeps one object on screen through the state change, so the eye
|
|
1037
1062
|
reads a transformation instead of two things trading places. */
|
|
1038
|
-
.${PREFIX}-qr[data-spent="true"] { opacity: 0.2; filter:
|
|
1063
|
+
.${PREFIX}-qr[data-spent="true"] { opacity: 0.2; filter: var(--zrl-qr-spent-filter); transform: scale(0.96); }
|
|
1039
1064
|
|
|
1040
1065
|
.${PREFIX}-qr-overlay {
|
|
1041
1066
|
position: absolute;
|
|
@@ -1164,53 +1189,7 @@ var CSS = `
|
|
|
1164
1189
|
70%, 100% { transform: scale(2.6); opacity: 0 }
|
|
1165
1190
|
}
|
|
1166
1191
|
|
|
1167
|
-
/* Three ways to move the light, one look at rest.
|
|
1168
|
-
Where offset-path takes a rect() (Chrome 116, Firefox 122, Safari 18) the
|
|
1169
|
-
comet rides the edge. Before that, a conic gradient turns inside the same
|
|
1170
|
-
masks instead: on a registered custom property where @property exists, and
|
|
1171
|
-
by rotating an oversized square where it does not, since an untyped custom
|
|
1172
|
-
property cannot interpolate and the light would snap once a cycle.
|
|
1173
|
-
There is no direct query for @property support. transition-behavior
|
|
1174
|
-
shipped after it in every engine (Chrome 117 vs 85, Firefox 129 vs 128,
|
|
1175
|
-
Safari 17.4 vs 16.4), so it stands in: a yes is never wrong, and a no only
|
|
1176
|
-
sends a capable browser down the transform tier, which looks the same.
|
|
1177
|
-
inherits: false so the angle stays on the element that animates it and
|
|
1178
|
-
never reaches the host page or the well. */
|
|
1179
|
-
@property --zrl-angle {
|
|
1180
|
-
syntax: '<angle>';
|
|
1181
|
-
inherits: false;
|
|
1182
|
-
initial-value: 0deg;
|
|
1183
|
-
}
|
|
1184
1192
|
@keyframes ${PREFIX}-orbit { to { transform: rotate(360deg) } }
|
|
1185
|
-
@keyframes ${PREFIX}-orbit-angle { to { --zrl-angle: 360deg } }
|
|
1186
|
-
@keyframes ${PREFIX}-beam { to { offset-distance: 100% } }
|
|
1187
|
-
@supports (transition-behavior: allow-discrete) {
|
|
1188
|
-
.${PREFIX}-qr-beam::after {
|
|
1189
|
-
inset: -1px;
|
|
1190
|
-
animation-name: ${PREFIX}-orbit-angle;
|
|
1191
|
-
}
|
|
1192
|
-
.${PREFIX}-qr-beam-glow-band::after {
|
|
1193
|
-
inset: calc(0px - var(--zrl-glow-core));
|
|
1194
|
-
animation-name: ${PREFIX}-orbit-angle;
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
/* The comet: a square that rides the well's edge on a rounded-rect path, its
|
|
1198
|
-
anchor a little ahead of centre, turned to face the way it travels, and
|
|
1199
|
-
masked down to what its overlay allows. The gradient runs against the
|
|
1200
|
-
direction of travel: a light head, the blue body, nothing behind. One lap
|
|
1201
|
-
in 4s, linear: continuous motion has no ease. */
|
|
1202
|
-
@supports (offset-path: rect(0 auto auto 0)) {
|
|
1203
|
-
.${PREFIX}-qr-beam::after,
|
|
1204
|
-
.${PREFIX}-qr-beam-glow-band::after {
|
|
1205
|
-
inset: auto;
|
|
1206
|
-
width: var(--zrl-beam-size);
|
|
1207
|
-
height: var(--zrl-beam-size);
|
|
1208
|
-
background: linear-gradient(to left, var(--zrl-beam-head), var(--zrl-beam), transparent);
|
|
1209
|
-
offset-path: rect(0 auto auto 0 round calc(var(--zrl-radius) - 1px));
|
|
1210
|
-
offset-anchor: 60% 50%;
|
|
1211
|
-
animation: ${PREFIX}-beam var(--zrl-beam-time) linear infinite;
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
1193
|
|
|
1215
1194
|
@media (prefers-reduced-motion: reduce) {
|
|
1216
1195
|
.${PREFIX}-scrim,
|