@novasamatech/host-papp-react-ui 0.7.9-4 → 0.7.9-6
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/flow/Pairing.module.css.js +40 -36
- package/dist/flow/PairingModal.js +79 -76
- package/dist/flow/PairingPopover.js +95 -90
- package/dist/index.css +1 -1
- package/dist/ui/QrCode.js +62 -52
- package/dist/ui/QrCode.module.css.js +16 -4
- package/package.json +6 -5
|
@@ -1,47 +1,51 @@
|
|
|
1
|
-
const
|
|
2
|
-
popoverContent:
|
|
3
|
-
container:
|
|
1
|
+
const r = "papp_Pairing-module_popoverContent_3xnU8", o = "papp_Pairing-module_container_gH7WU", e = "papp_Pairing-module_pairingContainer_R5atH", n = "papp_Pairing-module_pairingHeader_bpfNW", i = "papp_Pairing-module_scanCallToAction_lOQ-T", a = "papp_Pairing-module_pairingDescription_UJE0U", p = "papp_Pairing-module_qrSurfaceLight_dIa-z papp_Pairing-module_qrSurface_wDMjT", t = "papp_Pairing-module_qrSurfaceDark_2icM9 papp_Pairing-module_qrSurface_wDMjT", _ = "papp_Pairing-module_loaderLogo_iHsP9", c = "papp_Pairing-module_loaderContainer_cR46U", l = "papp_Pairing-module_loaderText_beteT", g = "papp_Pairing-module_loaderContainerPopover_n1-JJ", P = "papp_Pairing-module_errorContainer_KW5T-", d = "papp_Pairing-module_errorTitle_qokH0", s = "papp_Pairing-module_popoverContainer_fOWoF", u = "papp_Pairing-module_pairingPopoverHeader_PAQot", C = "papp_Pairing-module_scanCallToActionPopover_Irz-z", v = "papp_Pairing-module_pairingDescriptionPopover_z71yj", m = "papp_Pairing-module_errorContainerPopover_4mELg", T = "papp_Pairing-module_pairingPopoverContainer_RvVnH", f = "papp_Pairing-module_errorTitlePopover_-FPrd", D = "papp_Pairing-module_errorGenericText_ZPwQb", H = "papp_Pairing-module_retryButton_kWeRx", q = {
|
|
2
|
+
popoverContent: r,
|
|
3
|
+
container: o,
|
|
4
4
|
pairingContainer: e,
|
|
5
5
|
pairingHeader: n,
|
|
6
6
|
scanCallToAction: i,
|
|
7
|
-
pairingDescription:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
pairingDescription: a,
|
|
8
|
+
qrSurfaceLight: p,
|
|
9
|
+
qrSurfaceDark: t,
|
|
10
|
+
loaderLogo: _,
|
|
11
|
+
loaderContainer: c,
|
|
12
|
+
loaderText: l,
|
|
13
|
+
loaderContainerPopover: g,
|
|
14
|
+
errorContainer: P,
|
|
15
|
+
errorTitle: d,
|
|
16
|
+
popoverContainer: s,
|
|
17
|
+
pairingPopoverHeader: u,
|
|
18
|
+
scanCallToActionPopover: C,
|
|
19
|
+
pairingDescriptionPopover: v,
|
|
20
|
+
errorContainerPopover: m,
|
|
21
|
+
pairingPopoverContainer: T,
|
|
22
|
+
errorTitlePopover: f,
|
|
23
|
+
errorGenericText: D,
|
|
22
24
|
retryButton: H
|
|
23
25
|
};
|
|
24
26
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
o as container,
|
|
28
|
+
q as default,
|
|
29
|
+
P as errorContainer,
|
|
30
|
+
m as errorContainerPopover,
|
|
31
|
+
D as errorGenericText,
|
|
32
|
+
d as errorTitle,
|
|
33
|
+
f as errorTitlePopover,
|
|
34
|
+
c as loaderContainer,
|
|
35
|
+
g as loaderContainerPopover,
|
|
36
|
+
_ as loaderLogo,
|
|
37
|
+
l as loaderText,
|
|
36
38
|
e as pairingContainer,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
a as pairingDescription,
|
|
40
|
+
v as pairingDescriptionPopover,
|
|
39
41
|
n as pairingHeader,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
T as pairingPopoverContainer,
|
|
43
|
+
u as pairingPopoverHeader,
|
|
44
|
+
s as popoverContainer,
|
|
45
|
+
r as popoverContent,
|
|
46
|
+
t as qrSurfaceDark,
|
|
47
|
+
p as qrSurfaceLight,
|
|
44
48
|
H as retryButton,
|
|
45
49
|
i as scanCallToAction,
|
|
46
|
-
|
|
50
|
+
C as scanCallToActionPopover
|
|
47
51
|
};
|
|
@@ -1,97 +1,100 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { useAuthStatus as
|
|
1
|
+
import { jsx as l, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { c as C } from "react/compiler-runtime";
|
|
3
|
+
import { Button as E } from "@novasamatech/tr-ui";
|
|
4
|
+
import { memo as x, useEffect as M } from "react";
|
|
5
|
+
import { useAuthStatus as b } from "../hooks/authStatus.js";
|
|
6
6
|
import { useAuthentication as A } from "../providers/AuthProvider.js";
|
|
7
7
|
import { useTranslations as T } from "../providers/TranslationProvider.js";
|
|
8
|
-
import { LogoSmall as
|
|
9
|
-
import { Modal as
|
|
10
|
-
import { QrCode as
|
|
11
|
-
import
|
|
12
|
-
const F =
|
|
13
|
-
const e =
|
|
14
|
-
let
|
|
15
|
-
e[0] !==
|
|
8
|
+
import { LogoSmall as k } from "../ui/LogoSmall.js";
|
|
9
|
+
import { Modal as z } from "../ui/Modal.js";
|
|
10
|
+
import { QrCode as H } from "../ui/QrCode.js";
|
|
11
|
+
import p from "./Pairing.module.css.js";
|
|
12
|
+
const F = x((g) => {
|
|
13
|
+
const e = C(28);
|
|
14
|
+
let n;
|
|
15
|
+
e[0] !== g ? (n = g === void 0 ? {} : g, e[0] = g, e[1] = n) : n = e[1];
|
|
16
16
|
const {
|
|
17
17
|
theme: o,
|
|
18
|
-
size:
|
|
19
|
-
} =
|
|
18
|
+
size: s
|
|
19
|
+
} = n, i = s === void 0 ? 280 : s, a = A(), {
|
|
20
20
|
status: t
|
|
21
|
-
} =
|
|
22
|
-
let
|
|
23
|
-
e[2] !==
|
|
24
|
-
!
|
|
25
|
-
}, e[2] =
|
|
26
|
-
const
|
|
27
|
-
let
|
|
28
|
-
e[5] !==
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
let g;
|
|
32
|
-
e[9] !== s || e[10] !== t.payload || e[11] !== t.step || e[12] !== o ? (g = t.step === "pairing" && /* @__PURE__ */ p(L, { theme: o, size: s, payload: t.payload }), e[9] = s, e[10] = t.payload, e[11] = t.step, e[12] = o, e[13] = g) : g = e[13];
|
|
21
|
+
} = b(), r = a.authUIMode === "modal" && t.step !== "none" && t.step !== "finished";
|
|
22
|
+
let c;
|
|
23
|
+
e[2] !== a || e[3] !== t.step ? (c = (D) => {
|
|
24
|
+
!D && t.step !== "pending" && a.abortAuthentication();
|
|
25
|
+
}, e[2] = a, e[3] = t.step, e[4] = c) : c = e[4];
|
|
26
|
+
const h = c;
|
|
27
|
+
let d, m;
|
|
28
|
+
e[5] !== a || e[6] !== t.step ? (d = () => {
|
|
29
|
+
a.authUIMode === "modal" && t.step === "finished" && a.abortAuthentication();
|
|
30
|
+
}, m = [a, t.step], e[5] = a, e[6] = t.step, e[7] = d, e[8] = m) : (d = e[7], m = e[8]), M(d, m);
|
|
33
31
|
let f;
|
|
34
|
-
e[
|
|
35
|
-
let h;
|
|
36
|
-
e[17] !== t.message || e[18] !== t.step ? (h = t.step === "pairingError" && /* @__PURE__ */ p(R, { message: t.message }), e[17] = t.message, e[18] = t.step, e[19] = h) : h = e[19];
|
|
32
|
+
e[9] !== i || e[10] !== t.payload || e[11] !== t.step || e[12] !== o ? (f = t.step === "pairing" && /* @__PURE__ */ l(L, { theme: o, size: i, payload: t.payload }), e[9] = i, e[10] = t.payload, e[11] = t.step, e[12] = o, e[13] = f) : f = e[13];
|
|
37
33
|
let u;
|
|
38
|
-
e[
|
|
39
|
-
|
|
34
|
+
e[14] !== t.stage || e[15] !== t.step ? (u = t.step === "pending" && /* @__PURE__ */ l($, { stage: t.stage }), e[14] = t.stage, e[15] = t.step, e[16] = u) : u = e[16];
|
|
35
|
+
let y;
|
|
36
|
+
e[17] !== t.message || e[18] !== t.step ? (y = t.step === "pairingError" && /* @__PURE__ */ l(P, { message: t.message }), e[17] = t.message, e[18] = t.step, e[19] = y) : y = e[19];
|
|
37
|
+
let N;
|
|
38
|
+
e[20] !== f || e[21] !== u || e[22] !== y ? (N = /* @__PURE__ */ v("div", { className: p.container, children: [
|
|
40
39
|
f,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}),
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
u,
|
|
41
|
+
y
|
|
42
|
+
] }), e[20] = f, e[21] = u, e[22] = y, e[23] = N) : N = e[23];
|
|
43
|
+
let S;
|
|
44
|
+
return e[24] !== r || e[25] !== N || e[26] !== h ? (S = /* @__PURE__ */ l(z, { open: r, onOpenChange: h, width: "fit-content", children: N }), e[24] = r, e[25] = N, e[26] = h, e[27] = S) : S = e[27], S;
|
|
45
|
+
}), L = (g) => {
|
|
46
|
+
const e = C(18), {
|
|
47
|
+
payload: n,
|
|
48
48
|
size: o,
|
|
49
|
-
theme:
|
|
50
|
-
} =
|
|
51
|
-
let i;
|
|
52
|
-
e[0] !== s.pairingHeader ? (i = /* @__PURE__ */ p("span", { className: c.pairingHeader, children: s.pairingHeader }), e[0] = s.pairingHeader, e[1] = i) : i = e[1];
|
|
49
|
+
theme: s
|
|
50
|
+
} = g, i = T(), a = s === "dark";
|
|
53
51
|
let t;
|
|
54
|
-
e[
|
|
55
|
-
let
|
|
56
|
-
e[
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
e[0] !== i.pairingHeader ? (t = /* @__PURE__ */ l("span", { className: p.pairingHeader, children: i.pairingHeader }), e[0] = i.pairingHeader, e[1] = t) : t = e[1];
|
|
53
|
+
let r;
|
|
54
|
+
e[2] !== i.pairingScanCallToAction ? (r = /* @__PURE__ */ l("span", { className: p.scanCallToAction, children: i.pairingScanCallToAction }), e[2] = i.pairingScanCallToAction, e[3] = r) : r = e[3];
|
|
55
|
+
const c = a ? p.qrSurfaceDark : p.qrSurfaceLight;
|
|
56
|
+
let h;
|
|
57
|
+
e[4] !== n || e[5] !== o || e[6] !== s ? (h = /* @__PURE__ */ l(H, { value: n, size: o, theme: s }), e[4] = n, e[5] = o, e[6] = s, e[7] = h) : h = e[7];
|
|
59
58
|
let d;
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
e[8] !== c || e[9] !== h ? (d = /* @__PURE__ */ l("div", { className: c, children: h }), e[8] = c, e[9] = h, e[10] = d) : d = e[10];
|
|
60
|
+
let m;
|
|
61
|
+
e[11] !== i.pairingDescription ? (m = /* @__PURE__ */ l("span", { className: p.pairingDescription, children: i.pairingDescription }), e[11] = i.pairingDescription, e[12] = m) : m = e[12];
|
|
62
|
+
let f;
|
|
63
|
+
return e[13] !== t || e[14] !== r || e[15] !== d || e[16] !== m ? (f = /* @__PURE__ */ v("div", { className: p.pairingContainer, children: [
|
|
62
64
|
t,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
r,
|
|
66
|
+
d,
|
|
67
|
+
m
|
|
68
|
+
] }), e[13] = t, e[14] = r, e[15] = d, e[16] = m, e[17] = f) : f = e[17], f;
|
|
69
|
+
}, $ = (g) => {
|
|
70
|
+
const e = C(3), {
|
|
71
|
+
stage: n
|
|
72
|
+
} = g;
|
|
70
73
|
let o;
|
|
71
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */
|
|
72
|
-
let a;
|
|
73
|
-
return e[1] !== r ? (a = /* @__PURE__ */ v("div", { className: c.loaderContainer, children: [
|
|
74
|
-
o,
|
|
75
|
-
/* @__PURE__ */ p("span", { className: c.loaderText, children: r })
|
|
76
|
-
] }), e[1] = r, e[2] = a) : a = e[2], a;
|
|
77
|
-
}, R = (m) => {
|
|
78
|
-
const e = S(13), {
|
|
79
|
-
message: r
|
|
80
|
-
} = m, o = A(), a = T();
|
|
74
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ l("div", { className: p.loaderLogo, children: /* @__PURE__ */ l(k, { size: 100 }) }), e[0] = o) : o = e[0];
|
|
81
75
|
let s;
|
|
82
|
-
e[
|
|
76
|
+
return e[1] !== n ? (s = /* @__PURE__ */ v("div", { className: p.loaderContainer, children: [
|
|
77
|
+
o,
|
|
78
|
+
/* @__PURE__ */ l("span", { className: p.loaderText, children: n })
|
|
79
|
+
] }), e[1] = n, e[2] = s) : s = e[2], s;
|
|
80
|
+
}, P = (g) => {
|
|
81
|
+
const e = C(13), {
|
|
82
|
+
message: n
|
|
83
|
+
} = g, o = A(), s = T();
|
|
83
84
|
let i;
|
|
84
|
-
e[
|
|
85
|
+
e[0] !== s.pairingError ? (i = /* @__PURE__ */ l("span", { className: p.errorTitle, children: s.pairingError }), e[0] = s.pairingError, e[1] = i) : i = e[1];
|
|
86
|
+
let a;
|
|
87
|
+
e[2] !== n ? (a = /* @__PURE__ */ l("span", { className: p.errorGenericText, children: n }), e[2] = n, e[3] = a) : a = e[3];
|
|
85
88
|
let t;
|
|
86
89
|
e[4] !== o ? (t = () => o.authenticate(), e[4] = o, e[5] = t) : t = e[5];
|
|
87
|
-
let
|
|
88
|
-
e[6] !== t || e[7] !==
|
|
89
|
-
let
|
|
90
|
-
return e[9] !==
|
|
91
|
-
s,
|
|
90
|
+
let r;
|
|
91
|
+
e[6] !== t || e[7] !== s.pairingRetry ? (r = /* @__PURE__ */ l(E, { variant: "secondary", type: "button", onClick: t, children: s.pairingRetry }), e[6] = t, e[7] = s.pairingRetry, e[8] = r) : r = e[8];
|
|
92
|
+
let c;
|
|
93
|
+
return e[9] !== i || e[10] !== a || e[11] !== r ? (c = /* @__PURE__ */ v("div", { className: p.errorContainer, children: [
|
|
92
94
|
i,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
a,
|
|
96
|
+
r
|
|
97
|
+
] }), e[9] = i, e[10] = a, e[11] = r, e[12] = c) : c = e[12], c;
|
|
95
98
|
};
|
|
96
99
|
export {
|
|
97
100
|
F as PairingModal
|
|
@@ -1,116 +1,121 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsx as n, jsxs as k } from "react/jsx-runtime";
|
|
2
|
+
import { c as R } from "react/compiler-runtime";
|
|
3
3
|
import * as x from "@radix-ui/react-popover";
|
|
4
|
-
import { memo as
|
|
5
|
-
import { useAuthStatus as
|
|
6
|
-
import { useAuthentication as
|
|
7
|
-
import { useTranslations as
|
|
8
|
-
import { LogoSmall as
|
|
9
|
-
import { QrCode as
|
|
10
|
-
import
|
|
11
|
-
const oe =
|
|
12
|
-
const e =
|
|
4
|
+
import { memo as B, useEffect as I } from "react";
|
|
5
|
+
import { useAuthStatus as K } from "../hooks/authStatus.js";
|
|
6
|
+
import { useAuthentication as j } from "../providers/AuthProvider.js";
|
|
7
|
+
import { useTranslations as q } from "../providers/TranslationProvider.js";
|
|
8
|
+
import { LogoSmall as _ } from "../ui/LogoSmall.js";
|
|
9
|
+
import { QrCode as w } from "../ui/QrCode.js";
|
|
10
|
+
import c from "./Pairing.module.css.js";
|
|
11
|
+
const oe = B((h) => {
|
|
12
|
+
const e = R(44), {
|
|
13
13
|
theme: a,
|
|
14
14
|
size: l,
|
|
15
|
-
align:
|
|
16
|
-
side:
|
|
15
|
+
align: r,
|
|
16
|
+
side: p,
|
|
17
17
|
alignOffset: o,
|
|
18
|
-
sizeOffset:
|
|
18
|
+
sizeOffset: f,
|
|
19
19
|
children: s
|
|
20
|
-
} =
|
|
20
|
+
} = h, g = a === void 0 ? "dark" : a, d = l === void 0 ? 240 : l, m = f === void 0 ? 4 : f, i = j(), {
|
|
21
21
|
status: t
|
|
22
|
-
} =
|
|
22
|
+
} = K(), v = typeof process < "u" && process.env?.STORYBOOK === "true", H = i.authUIMode === "popover" && (v || t.step !== "none");
|
|
23
|
+
let A;
|
|
24
|
+
e[0] !== i || e[1] !== t.step ? (A = () => {
|
|
25
|
+
t.step === "none" && i.authenticate("popover");
|
|
26
|
+
}, e[0] = i, e[1] = t.step, e[2] = A) : A = e[2];
|
|
27
|
+
const $ = A;
|
|
28
|
+
let T;
|
|
29
|
+
e[3] !== i || e[4] !== t.step ? (T = (O) => {
|
|
30
|
+
!O && t.step !== "pending" && i.abortAuthentication();
|
|
31
|
+
}, e[3] = i, e[4] = t.step, e[5] = T) : T = e[5];
|
|
32
|
+
const W = T;
|
|
23
33
|
let E;
|
|
24
|
-
e[
|
|
25
|
-
|
|
26
|
-
}, e[
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
let h;
|
|
38
|
-
e[9] !== s || e[10] !== H ? (h = /* @__PURE__ */ n(x.Trigger, { asChild: !0, onClick: H, children: s }), e[9] = s, e[10] = H, e[11] = h) : h = e[11];
|
|
39
|
-
let u, P;
|
|
40
|
-
e[12] !== t.step ? (P = (T) => {
|
|
41
|
-
t.step === "pending" && T.preventDefault();
|
|
42
|
-
}, u = (T) => {
|
|
43
|
-
t.step === "pending" && T.preventDefault();
|
|
44
|
-
}, e[12] = t.step, e[13] = u, e[14] = P) : (u = e[13], P = e[14]);
|
|
45
|
-
let y;
|
|
46
|
-
e[15] !== f || e[16] !== t.payload || e[17] !== t.step || e[18] !== p ? (y = t.step === "pairing" && /* @__PURE__ */ n(M, { theme: p, size: f, payload: t.payload }), e[15] = f, e[16] = t.payload, e[17] = t.step, e[18] = p, e[19] = y) : y = e[19];
|
|
47
|
-
let C;
|
|
48
|
-
e[20] !== t.stage || e[21] !== t.step ? (C = t.step === "pending" && /* @__PURE__ */ n(Q, { stage: t.stage }), e[20] = t.stage, e[21] = t.step, e[22] = C) : C = e[22];
|
|
34
|
+
e[6] !== i ? (E = () => () => {
|
|
35
|
+
i.abortAuthentication();
|
|
36
|
+
}, e[6] = i, e[7] = E) : E = e[7];
|
|
37
|
+
let L;
|
|
38
|
+
e[8] !== i.abortAuthentication ? (L = [i.abortAuthentication], e[8] = i.abortAuthentication, e[9] = L) : L = e[9], I(E, L);
|
|
39
|
+
let u;
|
|
40
|
+
e[10] !== s || e[11] !== $ ? (u = /* @__PURE__ */ n(x.Trigger, { asChild: !0, onClick: $, children: s }), e[10] = s, e[11] = $, e[12] = u) : u = e[12];
|
|
41
|
+
let P, y;
|
|
42
|
+
e[13] !== t.step ? (y = (O) => {
|
|
43
|
+
t.step === "pending" && O.preventDefault();
|
|
44
|
+
}, P = (O) => {
|
|
45
|
+
t.step === "pending" && O.preventDefault();
|
|
46
|
+
}, e[13] = t.step, e[14] = P, e[15] = y) : (P = e[14], y = e[15]);
|
|
49
47
|
let N;
|
|
50
|
-
e[
|
|
48
|
+
e[16] !== d || e[17] !== t.payload || e[18] !== t.step || e[19] !== g ? (N = t.step === "pairing" && /* @__PURE__ */ n(G, { theme: g, size: d, payload: t.payload }), e[16] = d, e[17] = t.payload, e[18] = t.step, e[19] = g, e[20] = N) : N = e[20];
|
|
49
|
+
let C;
|
|
50
|
+
e[21] !== t.stage || e[22] !== t.step ? (C = t.step === "pending" && /* @__PURE__ */ n(M, { stage: t.stage }), e[21] = t.stage, e[22] = t.step, e[23] = C) : C = e[23];
|
|
51
51
|
let S;
|
|
52
|
-
e[
|
|
53
|
-
|
|
52
|
+
e[24] !== t.message || e[25] !== t.step ? (S = t.step === "pairingError" && /* @__PURE__ */ n(Q, { message: t.message }), e[24] = t.message, e[25] = t.step, e[26] = S) : S = e[26];
|
|
53
|
+
let b;
|
|
54
|
+
e[27] !== N || e[28] !== C || e[29] !== S ? (b = /* @__PURE__ */ k("div", { className: c.popoverContainer, children: [
|
|
55
|
+
N,
|
|
54
56
|
C,
|
|
55
|
-
|
|
56
|
-
] }), e[
|
|
57
|
-
let
|
|
58
|
-
e[
|
|
59
|
-
let
|
|
60
|
-
return e[
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
] }), e[
|
|
64
|
-
}),
|
|
65
|
-
const e =
|
|
57
|
+
S
|
|
58
|
+
] }), e[27] = N, e[28] = C, e[29] = S, e[30] = b) : b = e[30];
|
|
59
|
+
let D;
|
|
60
|
+
e[31] !== r || e[32] !== o || e[33] !== p || e[34] !== m || e[35] !== P || e[36] !== b || e[37] !== y ? (D = /* @__PURE__ */ n(x.Portal, { children: /* @__PURE__ */ n(x.Content, { side: p, align: r, sideOffset: m, alignOffset: o, className: c.popoverContent, onInteractOutside: y, onEscapeKeyDown: P, children: b }) }), e[31] = r, e[32] = o, e[33] = p, e[34] = m, e[35] = P, e[36] = b, e[37] = y, e[38] = D) : D = e[38];
|
|
61
|
+
let z;
|
|
62
|
+
return e[39] !== H || e[40] !== D || e[41] !== u || e[42] !== W ? (z = /* @__PURE__ */ k(x.Root, { open: H, onOpenChange: W, children: [
|
|
63
|
+
u,
|
|
64
|
+
D
|
|
65
|
+
] }), e[39] = H, e[40] = D, e[41] = u, e[42] = W, e[43] = z) : z = e[43], z;
|
|
66
|
+
}), G = (h) => {
|
|
67
|
+
const e = R(18), {
|
|
66
68
|
payload: a,
|
|
67
69
|
size: l,
|
|
68
|
-
theme:
|
|
69
|
-
} =
|
|
70
|
-
let r;
|
|
71
|
-
e[0] !== o.pairingPopoverWelcome ? (r = /* @__PURE__ */ n("span", { className: g.pairingPopoverHeader, children: o.pairingPopoverWelcome }), e[0] = o.pairingPopoverWelcome, e[1] = r) : r = e[1];
|
|
70
|
+
theme: r
|
|
71
|
+
} = h, p = r === void 0 ? "light" : r, o = q(), f = p === "dark";
|
|
72
72
|
let s;
|
|
73
|
-
e[
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
e[8] !== o.pairingPopoverScanDescription ? (f = /* @__PURE__ */ n("span", { className: g.pairingDescriptionPopover, children: o.pairingPopoverScanDescription }), e[8] = o.pairingPopoverScanDescription, e[9] = f) : f = e[9];
|
|
73
|
+
e[0] !== o.pairingPopoverWelcome ? (s = /* @__PURE__ */ n("span", { className: c.pairingPopoverHeader, children: o.pairingPopoverWelcome }), e[0] = o.pairingPopoverWelcome, e[1] = s) : s = e[1];
|
|
74
|
+
const g = f ? c.qrSurfaceDark : c.qrSurfaceLight;
|
|
75
|
+
let d;
|
|
76
|
+
e[2] !== a || e[3] !== l || e[4] !== p ? (d = /* @__PURE__ */ n(w, { value: a, size: l, theme: p }), e[2] = a, e[3] = l, e[4] = p, e[5] = d) : d = e[5];
|
|
78
77
|
let m;
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
e[6] !== g || e[7] !== d ? (m = /* @__PURE__ */ n("div", { className: g, children: d }), e[6] = g, e[7] = d, e[8] = m) : m = e[8];
|
|
79
|
+
let i;
|
|
80
|
+
e[9] !== o.pairingPopoverLoginHeading ? (i = /* @__PURE__ */ n("span", { className: c.scanCallToActionPopover, children: o.pairingPopoverLoginHeading }), e[9] = o.pairingPopoverLoginHeading, e[10] = i) : i = e[10];
|
|
81
|
+
let t;
|
|
82
|
+
e[11] !== o.pairingPopoverScanDescription ? (t = /* @__PURE__ */ n("span", { className: c.pairingDescriptionPopover, children: o.pairingPopoverScanDescription }), e[11] = o.pairingPopoverScanDescription, e[12] = t) : t = e[12];
|
|
83
|
+
let v;
|
|
84
|
+
return e[13] !== s || e[14] !== m || e[15] !== i || e[16] !== t ? (v = /* @__PURE__ */ k("div", { className: c.pairingPopoverContainer, children: [
|
|
81
85
|
s,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
|
|
86
|
+
m,
|
|
87
|
+
i,
|
|
88
|
+
t
|
|
89
|
+
] }), e[13] = s, e[14] = m, e[15] = i, e[16] = t, e[17] = v) : v = e[17], v;
|
|
90
|
+
}, M = (h) => {
|
|
91
|
+
const e = R(3), {
|
|
87
92
|
stage: a
|
|
88
|
-
} =
|
|
93
|
+
} = h;
|
|
89
94
|
let l;
|
|
90
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ n("div", { className:
|
|
91
|
-
let
|
|
92
|
-
return e[1] !== a ? (
|
|
95
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ n("div", { className: c.loaderLogo, children: /* @__PURE__ */ n(_, { size: 100 }) }), e[0] = l) : l = e[0];
|
|
96
|
+
let r;
|
|
97
|
+
return e[1] !== a ? (r = /* @__PURE__ */ k("div", { className: c.loaderContainerPopover, children: [
|
|
93
98
|
l,
|
|
94
|
-
/* @__PURE__ */ n("span", { className:
|
|
95
|
-
] }), e[1] = a, e[2] =
|
|
96
|
-
},
|
|
97
|
-
const e =
|
|
99
|
+
/* @__PURE__ */ n("span", { className: c.loaderText, children: a })
|
|
100
|
+
] }), e[1] = a, e[2] = r) : r = e[2], r;
|
|
101
|
+
}, Q = (h) => {
|
|
102
|
+
const e = R(13), {
|
|
98
103
|
message: a
|
|
99
|
-
} =
|
|
100
|
-
let
|
|
101
|
-
e[0] !==
|
|
104
|
+
} = h, l = j(), r = q();
|
|
105
|
+
let p;
|
|
106
|
+
e[0] !== r.pairingError ? (p = /* @__PURE__ */ n("span", { className: c.errorTitlePopover, children: r.pairingError }), e[0] = r.pairingError, e[1] = p) : p = e[1];
|
|
102
107
|
let o;
|
|
103
|
-
e[2] !== a ? (o = a && /* @__PURE__ */ n("span", { className:
|
|
104
|
-
let
|
|
105
|
-
e[4] !== l ? (
|
|
108
|
+
e[2] !== a ? (o = a && /* @__PURE__ */ n("span", { className: c.errorGenericText, children: a }), e[2] = a, e[3] = o) : o = e[3];
|
|
109
|
+
let f;
|
|
110
|
+
e[4] !== l ? (f = () => l.authenticate(), e[4] = l, e[5] = f) : f = e[5];
|
|
106
111
|
let s;
|
|
107
|
-
e[6] !==
|
|
108
|
-
let
|
|
109
|
-
return e[9] !==
|
|
110
|
-
|
|
112
|
+
e[6] !== f || e[7] !== r.pairingRetry ? (s = /* @__PURE__ */ n("button", { className: c.retryButton, type: "button", onClick: f, children: r.pairingRetry }), e[6] = f, e[7] = r.pairingRetry, e[8] = s) : s = e[8];
|
|
113
|
+
let g;
|
|
114
|
+
return e[9] !== p || e[10] !== o || e[11] !== s ? (g = /* @__PURE__ */ k("div", { className: c.errorContainerPopover, children: [
|
|
115
|
+
p,
|
|
111
116
|
o,
|
|
112
117
|
s
|
|
113
|
-
] }), e[9] =
|
|
118
|
+
] }), e[9] = p, e[10] = o, e[11] = s, e[12] = g) : g = e[12], g;
|
|
114
119
|
};
|
|
115
120
|
export {
|
|
116
121
|
oe as PairingPopover
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@keyframes papp_Modal-module_fadeInOpacity_lXaQm{0%{opacity:0}to{opacity:1}}.papp_Modal-module_backdrop_5PnfC{z-index:1000;position:fixed;inset:0;background:hsl(var(--general-background) / .3);opacity:1;animation-name:papp_Modal-module_fadeInOpacity_lXaQm;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:.3s}.papp_Modal-module_modal_L5tLT{z-index:1001;position:absolute;inset:0;margin:auto;width:300px;height:fit-content;border-radius:32px;opacity:1;animation-name:papp_Modal-module_fadeInOpacity_lXaQm;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:.5s;text-rendering:geometricPrecision;background:var(--color-surface-tertiary-inverse);color:var(--color-text-foreground-inverse)}@keyframes papp_QrCode-module_fadeInOpacity_ZCaTW{0%{opacity:0}to{opacity:1}}.papp_QrCode-module_container_L11My{border-radius:34px;animation-name:papp_QrCode-module_fadeInOpacity_ZCaTW;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:.3s;display:flex;justify-content:center;align-items:center;padding:
|
|
1
|
+
@keyframes papp_Modal-module_fadeInOpacity_lXaQm{0%{opacity:0}to{opacity:1}}.papp_Modal-module_backdrop_5PnfC{z-index:1000;position:fixed;inset:0;background:hsl(var(--general-background) / .3);opacity:1;animation-name:papp_Modal-module_fadeInOpacity_lXaQm;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:.3s}.papp_Modal-module_modal_L5tLT{z-index:1001;position:absolute;inset:0;margin:auto;width:300px;height:fit-content;border-radius:32px;opacity:1;animation-name:papp_Modal-module_fadeInOpacity_lXaQm;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:.5s;text-rendering:geometricPrecision;background:var(--color-surface-tertiary-inverse);color:var(--color-text-foreground-inverse)}@keyframes papp_QrCode-module_fadeInOpacity_ZCaTW{0%{opacity:0}to{opacity:1}}.papp_QrCode-module_container_L11My{border-radius:34px;animation-name:papp_QrCode-module_fadeInOpacity_ZCaTW;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:.3s;display:flex;justify-content:center;align-items:center;box-sizing:border-box;padding:0}.papp_QrCode-module_qrFrame_vx3iV{position:relative;display:inline-block;line-height:0}.papp_QrCode-module_qrCanvas_62D1u{display:block;image-rendering:pixelated}.papp_QrCode-module_qrCanvasLight_LOWJW{color:var(--color-neutral-black)}.papp_QrCode-module_qrCanvasDark_d-wBK{color:var(--color-neutral-white)}.papp_QrCode-module_logoBackdrop_GYOcr{position:absolute;left:50%;top:50%;box-sizing:border-box;display:flex;width:13%;height:13%;align-items:center;justify-content:center;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none}.papp_QrCode-module_logoBackdropLight_elBXb{background:var(--color-neutral-white)}.papp_QrCode-module_logoBackdropDark_v8Acu{background:var(--color-neutral-black)}.papp_QrCode-module_logo_jk35x{display:block;width:82%;height:82%;object-fit:contain}.papp_QrCode-module_gradientLayer_0Gbcy{position:absolute;inset:0;background:radial-gradient(circle at 50% 50%,rgba(255,255,255,.9) 0%,rgba(255,240,200,.7) 5%,rgba(255,200,150,.4) 10%,transparent 18%),radial-gradient(ellipse at 50% 30%,rgba(255,100,200,.6) 0%,rgba(200,120,255,.5) 15%,rgba(150,100,255,.3) 30%,transparent 50%),radial-gradient(ellipse at 50% 70%,rgba(100,200,255,.5) 0%,rgba(80,150,255,.4) 20%,rgba(60,100,200,.3) 40%,transparent 55%),radial-gradient(circle at 20% 20%,rgba(150,100,255,.5) 0%,rgba(120,80,200,.3) 25%,transparent 45%),radial-gradient(circle at 80% 20%,rgba(100,200,255,.5) 0%,rgba(80,150,200,.3) 25%,transparent 45%),radial-gradient(circle at 20% 80%,rgba(255,150,100,.5) 0%,rgba(200,100,150,.3) 25%,transparent 45%),linear-gradient(135deg,#3c5096e6,#5064b4cc 12%,#6478c8b3 25%,#7864b4b3 37%,#8c50a0b3 50%,#78468cbf 62%,#645078cc 75%,#505a82d9 87%,#3c466ee6)}.papp_QrCode-module_gradient-layer_7agFl:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 30% 40%,rgba(255,200,100,.3) 0%,rgba(255,150,150,.2) 15%,transparent 30%),radial-gradient(circle at 70% 60%,rgba(100,255,200,.3) 0%,rgba(100,200,255,.2) 15%,transparent 30%),radial-gradient(circle at 50% 80%,rgba(200,100,255,.3) 0%,rgba(150,100,200,.2) 20%,transparent 35%);filter:blur(25px)}.papp_QrCode-module_gradient-layer_7agFl:after{content:"";position:absolute;inset:0;background:radial-gradient(circle at 40% 30%,rgba(255,180,200,.2) 0%,rgba(200,150,255,.15) 20%,transparent 35%),radial-gradient(circle at 60% 70%,rgba(100,220,255,.2) 0%,rgba(150,180,255,.15) 20%,transparent 35%),radial-gradient(ellipse at 80% 50%,rgba(255,150,100,.2) 0%,rgba(255,100,150,.1) 25%,transparent 40%);filter:blur(35px);mix-blend-mode:screen}.papp_Pairing-module_popoverContent_3xnU8{padding:0;border-radius:32px;background:var(--color-surface-tertiary-inverse);color:var(--color-text-foreground-inverse)}.papp_Pairing-module_container_gH7WU{box-sizing:border-box;width:min(calc(100vw - 32px),420px);max-width:420px}.papp_Pairing-module_genericText_zDzqC{font-family:Inter,sans-serif;font-size:24px}.papp_Pairing-module_pairingContainer_R5atH{display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;width:100%;padding:36px 44px 44px;gap:20px}.papp_Pairing-module_pairingHeader_bpfNW{font-family:Inter,sans-serif;text-align:center;font-size:20px;font-style:normal;font-weight:400;line-height:1.83;letter-spacing:-.573px;color:var(--color-text-foreground-inverse)}.papp_Pairing-module_scanCallToAction_lOQ-T{font-family:Inter,sans-serif;color:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)));text-align:center;font-size:22px;font-style:normal;font-weight:400;line-height:1.5}.papp_Pairing-module_pairingDescription_UJE0U{font-family:Inter,sans-serif;box-sizing:border-box;width:100%;max-width:360px;color:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)));text-align:center;font-size:16px;font-style:normal;font-weight:400;line-height:1.2}.papp_Pairing-module_qrSurface_wDMjT{display:flex;align-items:center;justify-content:center;box-sizing:border-box;border-radius:24px;padding:16px}.papp_Pairing-module_qrSurfaceLight_dIa-z{background:var(--color-neutral-white)}.papp_Pairing-module_qrSurfaceDark_2icM9{background:var(--color-neutral-black)}@keyframes papp_Pairing-module_loader_S62aK{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.papp_Pairing-module_loaderLogo_iHsP9{width:fit-content;height:fit-content;animation:papp_Pairing-module_loader_S62aK 3s linear infinite}.papp_Pairing-module_loaderContainer_cR46U{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:40px;width:100%;padding:40px 44px 44px;box-sizing:border-box}.papp_Pairing-module_loaderText_beteT{color:var(--color-text-foreground-inverse);text-align:center;font-family:Inter,sans-serif;font-size:22px;line-height:1.5;letter-spacing:-.526px}.papp_Pairing-module_loaderContainerPopover_n1-JJ{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:40px;padding:20px}.papp_Pairing-module_finishedContainer_FtMTm{display:flex;flex-direction:column;align-items:center;height:100%;box-sizing:border-box;padding:40px 70px}.papp_Pairing-module_finishedLogo_jkEDX{display:flex;flex-direction:row;align-items:center;gap:12px}.papp_Pairing-module_finishedLogoSeparator_iRufd{width:1px;height:24px;background:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)))}.papp_Pairing-module_finishedLogoTitle_qKs3e{color:var(--color-text-foreground-inverse);text-align:center;font-family:Inter,sans-serif;font-size:16px;white-space:nowrap;font-style:normal;font-weight:600;line-height:140%;letter-spacing:-.329px}.papp_Pairing-module_finishedWelcome_Zvm-X{margin-top:54px;color:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)));font-family:Inter,sans-serif;font-size:18.39px;font-style:normal;font-weight:400;line-height:27.585px;letter-spacing:1.947px;text-transform:uppercase}.papp_Pairing-module_finishedUsername_RIpsa{color:var(--color-text-foreground-inverse);text-align:center;font-family:Inter,sans-serif;font-size:32.882px;font-style:normal;font-weight:400;line-height:60.185px;letter-spacing:-.593px}.papp_Pairing-module_finishedVoucher_rR0jH{flex-grow:1}.papp_Pairing-module_finishedButton_iuvIR{display:flex;flex-direction:column;width:262px}.papp_Pairing-module_errorContainer_KW5T-{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:12px;height:100%;box-sizing:border-box;width:100%;padding:40px 44px 44px}.papp_Pairing-module_errorTitle_qokH0{font-family:Inter,sans-serif;text-align:center;font-size:22px;font-style:normal;font-weight:400;line-height:1.83;letter-spacing:-.573px;color:var(--color-text-foreground-inverse)}.papp_Pairing-module_genericText_zDzqC{font-family:Inter,sans-serif;font-size:24px;color:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)))}.papp_Pairing-module_popoverContainer_fOWoF{width:280px}.papp_Pairing-module_pairingPopoverHeader_PAQot{font-family:Inter,sans-serif;text-align:center;font-size:16px;line-height:1.5;letter-spacing:-.573px;margin-bottom:15px;color:var(--color-text-foreground-inverse)}.papp_Pairing-module_scanCallToActionPopover_Irz-z{font-family:Inter,sans-serif;color:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)));text-align:center;font-size:20px;font-weight:600;line-height:1.2;margin:15px 0 10px}.papp_Pairing-module_pairingDescriptionPopover_z71yj{font-family:Inter,sans-serif;color:var(--color-text-foreground-inverse, hsl(var(--muted-foreground)));text-align:center;font-size:14px;line-height:1.2}.papp_Pairing-module_errorContainerPopover_4mELg{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:15px;padding:50px 20px;min-height:250px}.papp_Pairing-module_pairingPopoverContainer_RvVnH{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px 25px}.papp_Pairing-module_errorTitlePopover_-FPrd{font-family:Inter,sans-serif;text-align:center;font-size:18px;font-style:normal;line-height:1.5;letter-spacing:-.573px;margin-bottom:10px;color:var(--color-text-foreground-inverse)}.papp_Pairing-module_errorGenericText_ZPwQb{font-family:Inter,sans-serif;text-align:center;font-size:16px;font-style:normal;line-height:1.5;letter-spacing:-.573px;margin-bottom:20px;color:var(--color-text-foreground-inverse)}.papp_Pairing-module_retryButton_kWeRx{font-family:Inter,sans-serif;font-size:16px;font-weight:500;padding:10px 24px;border-radius:12px;border:1px solid var(--color-text-foreground-inverse);background:transparent;color:var(--color-text-foreground-inverse);cursor:pointer}
|
package/dist/ui/QrCode.js
CHANGED
|
@@ -1,56 +1,66 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
hideBackgroundDots: !0,
|
|
20
|
-
imageSize: 0.4,
|
|
21
|
-
margin: 6
|
|
22
|
-
},
|
|
23
|
-
dotsOptions: {
|
|
24
|
-
type: "rounded",
|
|
25
|
-
color: D
|
|
26
|
-
},
|
|
27
|
-
backgroundOptions: {
|
|
28
|
-
color: "transparent"
|
|
29
|
-
},
|
|
30
|
-
cornersSquareOptions: {
|
|
31
|
-
type: "dot",
|
|
32
|
-
color: D
|
|
33
|
-
},
|
|
34
|
-
cornersDotOptions: {
|
|
35
|
-
type: "dot",
|
|
36
|
-
color: D
|
|
37
|
-
},
|
|
38
|
-
qrOptions: {
|
|
39
|
-
errorCorrectionLevel: "M"
|
|
1
|
+
import { jsx as t, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { memo as a, useRef as E, useEffect as U } from "react";
|
|
3
|
+
import i from "./QrCode.module.css.js";
|
|
4
|
+
const k = "PHN2ZyB3aWR0aD0iNDMiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0MyA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIuNDIxMzggMTAuMTkyM0MtMC43MzQyNTUgMTMuODcxNyAtMC44MTc0NjcgMTguOTkzNCAyLjI0MjE1IDIxLjYyMTVDNS4zMDE3NyAyNC4yNTYgMTAuMzM5MyAyMy40MDM1IDEzLjUwMTMgMTkuNzE3N0MxNi42NTY5IDE2LjAzODMgMTYuNzQwMSAxMC45MTY3IDEzLjY4MDUgOC4yODg1NEMxMi40ODM2IDcuMjU2NTIgMTAuOTczIDYuNzYyOTQgOS4zOTgzNCA2Ljc2Mjk0QzYuOTUzMiA2Ljc2Mjk0IDQuMzQxNjQgNy45NTUyMSAyLjQyMTM4IDEwLjE5MjNaIiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNMS41MDYxNCAyOS4yMzA0Qy0wLjg2ODU4NCAzMi4wNTA4IDAuMTYxOTU2IDM2LjgzOTIgMy44MTA0NiAzOS45MjI0QzcuNDU4OTYgNDMuMDA1NyAxMi4zNDkyIDQzLjIyMzYgMTQuNzI0IDQwLjQwMzJDMTcuMDk4NyAzNy41ODI3IDE2LjA2ODEgMzIuNzk0NCAxMi40MTk2IDI5LjcxMTJ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= Math.max(1, Math.floor(O * o / Q)), A = N * Q;
|
|
10
|
+
z.width = A, z.height = A, z.style.width = `${O}px`, z.style.height = `${O}px`, M.clearRect(0, 0, A, A);
|
|
11
|
+
const T = I.size, e = (D, j) => D < g && j < g || D < g && j >= T - g || D >= T - g && j < g;
|
|
12
|
+
M.fillStyle = u;
|
|
13
|
+
for (let D = 0; D < T; D++)
|
|
14
|
+
for (let j = 0; j < T; j++) {
|
|
15
|
+
if (!I.data[D * T + j] || e(D, j))
|
|
16
|
+
continue;
|
|
17
|
+
const L = (j + x) * N, c = (D + x) * N;
|
|
18
|
+
M.fillRect(L, c, N, N);
|
|
40
19
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
N
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
20
|
+
const y = (D, j) => {
|
|
21
|
+
const L = (j + g / 2 + x) * N, c = (D + g / 2 + x) * N;
|
|
22
|
+
M.fillStyle = u, M.beginPath(), M.arc(L, c, 3.5 * N, 0, Math.PI * 2), M.fill(), M.globalCompositeOperation = "destination-out", M.beginPath(), M.arc(L, c, 2.5 * N, 0, Math.PI * 2), M.fill(), M.globalCompositeOperation = "source-over", M.fillStyle = u, M.beginPath(), M.arc(L, c, 1.5 * N, 0, Math.PI * 2), M.fill();
|
|
23
|
+
};
|
|
24
|
+
y(0, 0), y(0, T - g), y(T - g, 0);
|
|
25
|
+
}
|
|
26
|
+
const n = a(({
|
|
27
|
+
value: z,
|
|
28
|
+
size: I,
|
|
29
|
+
theme: O = "light"
|
|
30
|
+
}) => {
|
|
31
|
+
const u = E(null), M = O === "dark", Q = `data:image/svg+xml;base64,${M ? S : k}`;
|
|
32
|
+
return U(() => {
|
|
33
|
+
const N = u.current;
|
|
34
|
+
if (!N || !z)
|
|
35
|
+
return;
|
|
36
|
+
let A = !1;
|
|
37
|
+
const T = z, e = getComputedStyle(N).color;
|
|
38
|
+
return import("qrcode").then((y) => {
|
|
39
|
+
if (A)
|
|
40
|
+
return;
|
|
41
|
+
const D = y.default.create(T, {
|
|
42
|
+
errorCorrectionLevel: "H"
|
|
43
|
+
});
|
|
44
|
+
Y(N, D.modules, I, e);
|
|
45
|
+
}).catch((y) => {
|
|
46
|
+
A || console.error("[host-papp-react-ui] QR render failed:", y);
|
|
47
|
+
}), () => {
|
|
48
|
+
A = !0;
|
|
49
|
+
};
|
|
50
|
+
}, [z, I, M]), z ? /* @__PURE__ */ t("div", { className: i.container, style: {
|
|
51
|
+
height: I,
|
|
52
|
+
width: I
|
|
53
|
+
}, children: /* @__PURE__ */ C("div", { className: i.qrFrame, style: {
|
|
54
|
+
width: I,
|
|
55
|
+
height: I
|
|
56
|
+
}, children: [
|
|
57
|
+
/* @__PURE__ */ t("canvas", { ref: u, className: M ? i.qrCanvasDark : i.qrCanvasLight, "aria-hidden": !0 }),
|
|
58
|
+
/* @__PURE__ */ t("div", { className: M ? i.logoBackdropDark : i.logoBackdropLight, "aria-hidden": !0, children: /* @__PURE__ */ t("img", { className: i.logo, src: Q, alt: "", width: 1, height: 1 }) })
|
|
59
|
+
] }) }) : /* @__PURE__ */ t("div", { className: i.container, style: {
|
|
60
|
+
height: I,
|
|
61
|
+
width: I
|
|
62
|
+
}, "aria-hidden": !0 });
|
|
53
63
|
});
|
|
54
64
|
export {
|
|
55
|
-
|
|
65
|
+
n as QrCode
|
|
56
66
|
};
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
const
|
|
2
|
-
container:
|
|
1
|
+
const o = "papp_QrCode-module_container_L11My", a = "papp_QrCode-module_qrFrame_vx3iV", r = "papp_QrCode-module_qrCanvasLight_LOWJW papp_QrCode-module_qrCanvas_62D1u", p = "papp_QrCode-module_qrCanvasDark_d-wBK papp_QrCode-module_qrCanvas_62D1u", _ = "papp_QrCode-module_logoBackdropLight_elBXb papp_QrCode-module_logoBackdrop_GYOcr", d = "papp_QrCode-module_logoBackdropDark_v8Acu papp_QrCode-module_logoBackdrop_GYOcr", e = "papp_QrCode-module_logo_jk35x", l = {
|
|
2
|
+
container: o,
|
|
3
|
+
qrFrame: a,
|
|
4
|
+
qrCanvasLight: r,
|
|
5
|
+
qrCanvasDark: p,
|
|
6
|
+
logoBackdropLight: _,
|
|
7
|
+
logoBackdropDark: d,
|
|
8
|
+
logo: e
|
|
3
9
|
};
|
|
4
10
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
11
|
+
o as container,
|
|
12
|
+
l as default,
|
|
13
|
+
e as logo,
|
|
14
|
+
d as logoBackdropDark,
|
|
15
|
+
_ as logoBackdropLight,
|
|
16
|
+
p as qrCanvasDark,
|
|
17
|
+
r as qrCanvasLight,
|
|
18
|
+
a as qrFrame
|
|
7
19
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novasamatech/host-papp-react-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.9-
|
|
4
|
+
"version": "0.7.9-6",
|
|
5
5
|
"description": "Polkadot app UI Flow",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -30,15 +30,16 @@
|
|
|
30
30
|
"react-dom": ">=18"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@novasamatech/host-papp": "0.7.9-
|
|
34
|
-
"@novasamatech/statement-store": "0.7.9-
|
|
33
|
+
"@novasamatech/host-papp": "0.7.9-6",
|
|
34
|
+
"@novasamatech/statement-store": "0.7.9-6",
|
|
35
35
|
"@polkadot-api/utils": "^0.4.0",
|
|
36
36
|
"@radix-ui/react-dialog": "1.1.15",
|
|
37
37
|
"@radix-ui/react-popover": "1.1.15",
|
|
38
|
-
"
|
|
39
|
-
"@novasamatech/tr-ui": "0.2.
|
|
38
|
+
"qrcode": "^1.5.4",
|
|
39
|
+
"@novasamatech/tr-ui": "0.2.9"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
+
"@types/qrcode": "^1.5.6",
|
|
42
43
|
"@types/react": "19.2.14",
|
|
43
44
|
"@types/react-dom": "19.2.3",
|
|
44
45
|
"@polkadot-api/substrate-bindings": "^0.20.2",
|