@novasamatech/host-papp-react-ui 0.7.9-2 → 0.7.9-4

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.
@@ -1,49 +1,47 @@
1
- const o = "papp_Pairing-module_popoverContent_3xnU8", r = "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_loaderLogo_iHsP9", t = "papp_Pairing-module_loaderContainer_cR46U", _ = "papp_Pairing-module_loaderHeader_-q0jo", l = "papp_Pairing-module_loaderText_beteT", c = "papp_Pairing-module_errorContainer_KW5T-", d = "papp_Pairing-module_errorTitle_qokH0", P = "papp_Pairing-module_popoverContainer_fOWoF", g = "papp_Pairing-module_pairingPopoverHeader_PAQot", s = "papp_Pairing-module_scanCallToActionPopover_Irz-z", C = "papp_Pairing-module_pairingDescriptionPopover_z71yj", v = "papp_Pairing-module_errorContainerPopover_4mELg", u = "papp_Pairing-module_pairingPopoverContainer_RvVnH", m = "papp_Pairing-module_errorTitlePopover_-FPrd", T = "papp_Pairing-module_errorGenericText_ZPwQb", H = "papp_Pairing-module_loaderContainerPopover_n1-JJ", x = "papp_Pairing-module_retryButton_kWeRx", A = {
1
+ const o = "papp_Pairing-module_popoverContent_3xnU8", r = "papp_Pairing-module_container_gH7WU", e = "papp_Pairing-module_pairingContainer_R5atH", n = "papp_Pairing-module_pairingHeader_bpfNW", i = "papp_Pairing-module_scanCallToAction_lOQ-T", p = "papp_Pairing-module_pairingDescription_UJE0U", a = "papp_Pairing-module_loaderLogo_iHsP9", t = "papp_Pairing-module_loaderContainer_cR46U", _ = "papp_Pairing-module_loaderText_beteT", l = "papp_Pairing-module_loaderContainerPopover_n1-JJ", c = "papp_Pairing-module_errorContainer_KW5T-", P = "papp_Pairing-module_errorTitle_qokH0", g = "papp_Pairing-module_popoverContainer_fOWoF", d = "papp_Pairing-module_pairingPopoverHeader_PAQot", s = "papp_Pairing-module_scanCallToActionPopover_Irz-z", C = "papp_Pairing-module_pairingDescriptionPopover_z71yj", v = "papp_Pairing-module_errorContainerPopover_4mELg", u = "papp_Pairing-module_pairingPopoverContainer_RvVnH", m = "papp_Pairing-module_errorTitlePopover_-FPrd", T = "papp_Pairing-module_errorGenericText_ZPwQb", H = "papp_Pairing-module_retryButton_kWeRx", x = {
2
2
  popoverContent: o,
3
3
  container: r,
4
4
  pairingContainer: e,
5
5
  pairingHeader: n,
6
6
  scanCallToAction: i,
7
- pairingDescription: a,
8
- loaderLogo: p,
7
+ pairingDescription: p,
8
+ loaderLogo: a,
9
9
  loaderContainer: t,
10
- loaderHeader: _,
11
- loaderText: l,
10
+ loaderText: _,
11
+ loaderContainerPopover: l,
12
12
  errorContainer: c,
13
- errorTitle: d,
14
- popoverContainer: P,
15
- pairingPopoverHeader: g,
13
+ errorTitle: P,
14
+ popoverContainer: g,
15
+ pairingPopoverHeader: d,
16
16
  scanCallToActionPopover: s,
17
17
  pairingDescriptionPopover: C,
18
18
  errorContainerPopover: v,
19
19
  pairingPopoverContainer: u,
20
20
  errorTitlePopover: m,
21
21
  errorGenericText: T,
22
- loaderContainerPopover: H,
23
- retryButton: x
22
+ retryButton: H
24
23
  };
25
24
  export {
26
25
  r as container,
27
- A as default,
26
+ x as default,
28
27
  c as errorContainer,
29
28
  v as errorContainerPopover,
30
29
  T as errorGenericText,
31
- d as errorTitle,
30
+ P as errorTitle,
32
31
  m as errorTitlePopover,
33
32
  t as loaderContainer,
34
- H as loaderContainerPopover,
35
- _ as loaderHeader,
36
- p as loaderLogo,
37
- l as loaderText,
33
+ l as loaderContainerPopover,
34
+ a as loaderLogo,
35
+ _ as loaderText,
38
36
  e as pairingContainer,
39
- a as pairingDescription,
37
+ p as pairingDescription,
40
38
  C as pairingDescriptionPopover,
41
39
  n as pairingHeader,
42
40
  u as pairingPopoverContainer,
43
- g as pairingPopoverHeader,
44
- P as popoverContainer,
41
+ d as pairingPopoverHeader,
42
+ g as popoverContainer,
45
43
  o as popoverContent,
46
- x as retryButton,
44
+ H as retryButton,
47
45
  i as scanCallToAction,
48
46
  s as scanCallToActionPopover
49
47
  };
@@ -1,104 +1,98 @@
1
- import { jsx as c, jsxs as L } from "react/jsx-runtime";
1
+ import { jsx as p, jsxs as v } from "react/jsx-runtime";
2
2
  import { c as S } from "react/compiler-runtime";
3
3
  import { Button as x } from "@novasamatech/tr-ui";
4
- import { memo as H, useEffect as b } from "react";
4
+ import { memo as M, useEffect as b } from "react";
5
5
  import { useAuthStatus as z } from "../hooks/authStatus.js";
6
- import { useAuthentication as T } from "../providers/AuthProvider.js";
7
- import { useTranslations as A } from "../providers/TranslationProvider.js";
6
+ import { useAuthentication as A } from "../providers/AuthProvider.js";
7
+ import { useTranslations as T } from "../providers/TranslationProvider.js";
8
8
  import { LogoSmall as D } from "../ui/LogoSmall.js";
9
- import { Modal as $ } from "../ui/Modal.js";
10
- import { QrCode as P } from "../ui/QrCode.js";
11
- import m from "./Pairing.module.css.js";
12
- const J = H((i) => {
13
- const e = S(31);
14
- let n;
15
- e[0] !== i ? (n = i === void 0 ? {} : i, e[0] = i, e[1] = n) : n = e[1];
9
+ import { Modal as H } from "../ui/Modal.js";
10
+ import { QrCode as $ } from "../ui/QrCode.js";
11
+ import c from "./Pairing.module.css.js";
12
+ const F = M((m) => {
13
+ const e = S(28);
14
+ let r;
15
+ e[0] !== m ? (r = m === void 0 ? {} : m, e[0] = m, e[1] = r) : r = e[1];
16
16
  const {
17
- theme: l,
18
- size: r
19
- } = n, s = r === void 0 ? 280 : r, a = T(), {
17
+ theme: o,
18
+ size: a
19
+ } = r, s = a === void 0 ? 280 : a, i = A(), {
20
20
  status: t
21
- } = z(), o = a.authUIMode === "modal" && t.step !== "none" && t.step !== "finished";
22
- let p;
23
- e[2] !== a || e[3] !== t.step ? (p = (E) => {
24
- !E && t.step !== "attestation" && a.abortAuthentication();
25
- }, e[2] = a, e[3] = t.step, e[4] = p) : p = e[4];
26
- const d = p;
27
- let N, C;
28
- e[5] !== a || e[6] !== t.step ? (N = () => {
29
- a.authUIMode === "modal" && t.step === "finished" && a.abortAuthentication();
30
- }, C = [a, t.step], e[5] = a, e[6] = t.step, e[7] = N, e[8] = C) : (N = e[7], C = e[8]), b(N, C);
21
+ } = z(), n = i.authUIMode === "modal" && t.step !== "none" && t.step !== "finished";
22
+ let l;
23
+ e[2] !== i || e[3] !== t.step ? (l = (E) => {
24
+ !E && t.step !== "pending" && i.abortAuthentication();
25
+ }, e[2] = i, e[3] = t.step, e[4] = l) : l = e[4];
26
+ const d = l;
27
+ let y, N;
28
+ e[5] !== i || e[6] !== t.step ? (y = () => {
29
+ i.authUIMode === "modal" && t.step === "finished" && i.abortAuthentication();
30
+ }, N = [i, t.step], e[5] = i, e[6] = t.step, e[7] = y, e[8] = N) : (y = e[7], N = e[8]), b(y, N);
31
31
  let g;
32
- e[9] !== s || e[10] !== t.payload || e[11] !== t.step || e[12] !== l ? (g = t.step === "pairing" && /* @__PURE__ */ c(R, { theme: l, size: s, payload: t.payload }), e[9] = s, e[10] = t.payload, e[11] = t.step, e[12] = l, e[13] = g) : g = e[13];
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];
33
33
  let f;
34
- e[14] !== t.message || e[15] !== t.step ? (f = t.step === "pairingError" && /* @__PURE__ */ c(M, { message: t.message }), e[14] = t.message, e[15] = t.step, e[16] = f) : f = e[16];
34
+ e[14] !== t.stage || e[15] !== t.step ? (f = t.step === "pending" && /* @__PURE__ */ p(P, { stage: t.stage }), e[14] = t.stage, e[15] = t.step, e[16] = f) : f = e[16];
35
35
  let h;
36
- e[17] !== t.step ? (h = t.step === "attestation" && /* @__PURE__ */ c(j, {}), e[17] = t.step, e[18] = h) : h = e[18];
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];
37
37
  let u;
38
- e[19] !== t.message || e[20] !== t.step ? (u = t.step === "attestationError" && /* @__PURE__ */ c(M, { message: t.message }), e[19] = t.message, e[20] = t.step, e[21] = u) : u = e[21];
39
- let y;
40
- e[22] !== g || e[23] !== f || e[24] !== h || e[25] !== u ? (y = /* @__PURE__ */ L("div", { className: m.container, children: [
38
+ e[20] !== g || e[21] !== f || e[22] !== h ? (u = /* @__PURE__ */ v("div", { className: c.container, children: [
41
39
  g,
42
40
  f,
43
- h,
44
- u
45
- ] }), e[22] = g, e[23] = f, e[24] = h, e[25] = u, e[26] = y) : y = e[26];
46
- let v;
47
- return e[27] !== o || e[28] !== y || e[29] !== d ? (v = /* @__PURE__ */ c($, { open: o, onOpenChange: d, width: "fit-content", children: y }), e[27] = o, e[28] = y, e[29] = d, e[30] = v) : v = e[30], v;
48
- }), R = (i) => {
41
+ h
42
+ ] }), e[20] = g, e[21] = f, e[22] = h, e[23] = u) : u = e[23];
43
+ let C;
44
+ return e[24] !== n || e[25] !== u || e[26] !== d ? (C = /* @__PURE__ */ p(H, { open: n, onOpenChange: d, width: "fit-content", children: u }), e[24] = n, e[25] = u, e[26] = d, e[27] = C) : C = e[27], C;
45
+ }), L = (m) => {
49
46
  const e = S(15), {
50
- payload: n,
51
- size: l,
52
- theme: r
53
- } = i, s = A();
54
- let a;
55
- e[0] !== s.pairingHeader ? (a = /* @__PURE__ */ c("span", { className: m.pairingHeader, children: s.pairingHeader }), e[0] = s.pairingHeader, e[1] = a) : a = e[1];
47
+ payload: r,
48
+ size: o,
49
+ theme: a
50
+ } = m, s = T();
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];
56
53
  let t;
57
- e[2] !== s.pairingScanCallToAction ? (t = /* @__PURE__ */ c("span", { className: m.scanCallToAction, children: s.pairingScanCallToAction }), e[2] = s.pairingScanCallToAction, e[3] = t) : t = e[3];
58
- let o;
59
- e[4] !== n || e[5] !== l || e[6] !== r ? (o = /* @__PURE__ */ c(P, { value: n, size: l, theme: r }), e[4] = n, e[5] = l, e[6] = r, e[7] = o) : o = e[7];
60
- let p;
61
- e[8] !== s.pairingDescription ? (p = /* @__PURE__ */ c("span", { className: m.pairingDescription, children: s.pairingDescription }), e[8] = s.pairingDescription, e[9] = p) : p = e[9];
62
- let d;
63
- return e[10] !== a || e[11] !== t || e[12] !== o || e[13] !== p ? (d = /* @__PURE__ */ L("div", { className: m.pairingContainer, children: [
64
- a,
65
- t,
66
- o,
67
- p
68
- ] }), e[10] = a, e[11] = t, e[12] = o, e[13] = p, e[14] = d) : d = e[14], d;
69
- }, j = () => {
70
- const i = S(8), e = A();
54
+ e[2] !== s.pairingScanCallToAction ? (t = /* @__PURE__ */ p("span", { className: c.scanCallToAction, children: s.pairingScanCallToAction }), e[2] = s.pairingScanCallToAction, e[3] = t) : t = e[3];
71
55
  let n;
72
- i[0] !== e.pairingLoginMessage ? (n = /* @__PURE__ */ c("span", { className: m.loaderHeader, children: e.pairingLoginMessage }), i[0] = e.pairingLoginMessage, i[1] = n) : n = i[1];
56
+ e[4] !== r || e[5] !== o || e[6] !== a ? (n = /* @__PURE__ */ p($, { value: r, size: o, theme: a }), e[4] = r, e[5] = o, e[6] = a, e[7] = n) : n = e[7];
73
57
  let l;
74
- i[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ c("div", { className: m.loaderLogo, children: /* @__PURE__ */ c(D, { size: 100 }) }), i[2] = l) : l = i[2];
75
- let r;
76
- i[3] !== e.pairingLoader ? (r = /* @__PURE__ */ c("span", { className: m.loaderText, children: e.pairingLoader }), i[3] = e.pairingLoader, i[4] = r) : r = i[4];
77
- let s;
78
- return i[5] !== n || i[6] !== r ? (s = /* @__PURE__ */ L("div", { className: m.loaderContainer, children: [
58
+ e[8] !== s.pairingDescription ? (l = /* @__PURE__ */ p("span", { className: c.pairingDescription, children: s.pairingDescription }), e[8] = s.pairingDescription, e[9] = l) : l = e[9];
59
+ let d;
60
+ return e[10] !== i || e[11] !== t || e[12] !== n || e[13] !== l ? (d = /* @__PURE__ */ v("div", { className: c.pairingContainer, children: [
61
+ i,
62
+ t,
79
63
  n,
80
- l,
81
- r
82
- ] }), i[5] = n, i[6] = r, i[7] = s) : s = i[7], s;
83
- }, M = (i) => {
64
+ l
65
+ ] }), e[10] = i, e[11] = t, e[12] = n, e[13] = l, e[14] = d) : d = e[14], d;
66
+ }, P = (m) => {
67
+ const e = S(3), {
68
+ stage: r
69
+ } = m;
70
+ let o;
71
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ p("div", { className: c.loaderLogo, children: /* @__PURE__ */ p(D, { size: 100 }) }), e[0] = o) : o = e[0];
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) => {
84
78
  const e = S(13), {
85
- message: n
86
- } = i, l = T(), r = A();
79
+ message: r
80
+ } = m, o = A(), a = T();
87
81
  let s;
88
- e[0] !== r.pairingError ? (s = /* @__PURE__ */ c("span", { className: m.errorTitle, children: r.pairingError }), e[0] = r.pairingError, e[1] = s) : s = e[1];
89
- let a;
90
- e[2] !== n ? (a = /* @__PURE__ */ c("span", { className: m.errorGenericText, children: n }), e[2] = n, e[3] = a) : a = e[3];
82
+ e[0] !== a.pairingError ? (s = /* @__PURE__ */ p("span", { className: c.errorTitle, children: a.pairingError }), e[0] = a.pairingError, e[1] = s) : s = e[1];
83
+ let i;
84
+ e[2] !== r ? (i = /* @__PURE__ */ p("span", { className: c.errorGenericText, children: r }), e[2] = r, e[3] = i) : i = e[3];
91
85
  let t;
92
- e[4] !== l ? (t = () => l.authenticate(), e[4] = l, e[5] = t) : t = e[5];
93
- let o;
94
- e[6] !== t || e[7] !== r.pairingRetry ? (o = /* @__PURE__ */ c(x, { variant: "secondary", type: "button", onClick: t, children: r.pairingRetry }), e[6] = t, e[7] = r.pairingRetry, e[8] = o) : o = e[8];
95
- let p;
96
- return e[9] !== s || e[10] !== a || e[11] !== o ? (p = /* @__PURE__ */ L("div", { className: m.errorContainer, children: [
86
+ e[4] !== o ? (t = () => o.authenticate(), e[4] = o, e[5] = t) : t = e[5];
87
+ let n;
88
+ e[6] !== t || e[7] !== a.pairingRetry ? (n = /* @__PURE__ */ p(x, { variant: "secondary", type: "button", onClick: t, children: a.pairingRetry }), e[6] = t, e[7] = a.pairingRetry, e[8] = n) : n = e[8];
89
+ let l;
90
+ return e[9] !== s || e[10] !== i || e[11] !== n ? (l = /* @__PURE__ */ v("div", { className: c.errorContainer, children: [
97
91
  s,
98
- a,
99
- o
100
- ] }), e[9] = s, e[10] = a, e[11] = o, e[12] = p) : p = e[12], p;
92
+ i,
93
+ n
94
+ ] }), e[9] = s, e[10] = i, e[11] = n, e[12] = l) : l = e[12], l;
101
95
  };
102
96
  export {
103
- J as PairingModal
97
+ F as PairingModal
104
98
  };
@@ -1,123 +1,117 @@
1
- import { jsx as a, jsxs as T } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as D } from "react/jsx-runtime";
2
2
  import { c as A } from "react/compiler-runtime";
3
3
  import * as x from "@radix-ui/react-popover";
4
- import { memo as _, useEffect as w } from "react";
5
- import { useAuthStatus as G } from "../hooks/authStatus.js";
6
- import { useAuthentication as I } from "../providers/AuthProvider.js";
4
+ import { memo as I, useEffect as K } from "react";
5
+ import { useAuthStatus as _ } from "../hooks/authStatus.js";
6
+ import { useAuthentication as W } from "../providers/AuthProvider.js";
7
7
  import { useTranslations as j } from "../providers/TranslationProvider.js";
8
- import { LogoSmall as M } from "../ui/LogoSmall.js";
9
- import { QrCode as Q } from "../ui/QrCode.js";
8
+ import { LogoSmall as w } from "../ui/LogoSmall.js";
9
+ import { QrCode as G } from "../ui/QrCode.js";
10
10
  import g from "./Pairing.module.css.js";
11
- const ie = _((o) => {
12
- const e = A(46), {
13
- theme: n,
14
- size: c,
11
+ const oe = I((v) => {
12
+ const e = A(43), {
13
+ theme: a,
14
+ size: l,
15
15
  align: i,
16
- side: r,
17
- alignOffset: s,
18
- sizeOffset: p,
19
- children: l
20
- } = o, m = n === void 0 ? "dark" : n, d = c === void 0 ? 240 : c, v = p === void 0 ? 4 : p, f = I(), {
16
+ side: c,
17
+ alignOffset: o,
18
+ sizeOffset: r,
19
+ children: s
20
+ } = v, p = a === void 0 ? "dark" : a, f = l === void 0 ? 240 : l, m = r === void 0 ? 4 : r, d = W(), {
21
21
  status: t
22
- } = G(), K = typeof process < "u" && process.env?.STORYBOOK === "true", H = f.authUIMode === "popover" && (K || t.step !== "none");
23
- let D;
24
- e[0] !== f || e[1] !== t.step ? (D = () => {
25
- t.step === "none" && f.authenticate("popover");
26
- }, e[0] = f, e[1] = t.step, e[2] = D) : D = e[2];
27
- const R = D;
22
+ } = _(), B = typeof process < "u" && process.env?.STORYBOOK === "true", R = d.authUIMode === "popover" && (B || t.step !== "none");
23
+ let E;
24
+ e[0] !== d || e[1] !== t.step ? (E = () => {
25
+ t.step === "none" && d.authenticate("popover");
26
+ }, e[0] = d, e[1] = t.step, e[2] = E) : E = e[2];
27
+ const H = E;
28
28
  let b;
29
- e[3] !== f || e[4] !== t.step ? (b = (E) => {
30
- !E && t.step !== "attestation" && f.abortAuthentication();
31
- }, e[3] = f, e[4] = t.step, e[5] = b) : b = e[5];
29
+ e[3] !== d || e[4] !== t.step ? (b = (T) => {
30
+ !T && t.step !== "pending" && d.abortAuthentication();
31
+ }, e[3] = d, e[4] = t.step, e[5] = b) : b = e[5];
32
32
  const $ = b;
33
- let z, W;
34
- e[6] !== f ? (z = () => () => {
35
- f.abortAuthentication();
36
- }, W = [f], e[6] = f, e[7] = z, e[8] = W) : (z = e[7], W = e[8]), w(z, W);
33
+ let z, L;
34
+ e[6] !== d ? (z = () => () => {
35
+ d.abortAuthentication();
36
+ }, L = [d], e[6] = d, e[7] = z, e[8] = L) : (z = e[7], L = e[8]), K(z, L);
37
37
  let h;
38
- e[9] !== l || e[10] !== R ? (h = /* @__PURE__ */ a(x.Trigger, { asChild: !0, onClick: R, children: l }), e[9] = l, e[10] = R, e[11] = h) : h = e[11];
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
39
  let u, P;
40
- e[12] !== t.step ? (P = (E) => {
41
- t.step === "attestation" && E.preventDefault();
42
- }, u = (E) => {
43
- t.step === "attestation" && E.preventDefault();
40
+ e[12] !== t.step ? (P = (T) => {
41
+ t.step === "pending" && T.preventDefault();
42
+ }, u = (T) => {
43
+ t.step === "pending" && T.preventDefault();
44
44
  }, e[12] = t.step, e[13] = u, e[14] = P) : (u = e[13], P = e[14]);
45
45
  let y;
46
- e[15] !== d || e[16] !== t.payload || e[17] !== t.step || e[18] !== m ? (y = t.step === "pairing" && /* @__PURE__ */ a(U, { theme: m, size: d, payload: t.payload }), e[15] = d, e[16] = t.payload, e[17] = t.step, e[18] = m, e[19] = y) : y = e[19];
47
- let N;
48
- e[20] !== t.message || e[21] !== t.step ? (N = t.step === "pairingError" && /* @__PURE__ */ a(B, { message: t.message }), e[20] = t.message, e[21] = t.step, e[22] = N) : N = e[22];
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];
49
47
  let C;
50
- e[23] !== t.step ? (C = t.step === "attestation" && /* @__PURE__ */ a(Y, {}), e[23] = t.step, e[24] = C) : C = e[24];
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];
49
+ let N;
50
+ e[23] !== t.message || e[24] !== t.step ? (N = t.step === "pairingError" && /* @__PURE__ */ n(U, { message: t.message }), e[23] = t.message, e[24] = t.step, e[25] = N) : N = e[25];
51
51
  let S;
52
- e[25] !== t.message || e[26] !== t.step ? (S = t.step === "attestationError" && /* @__PURE__ */ a(B, { message: t.message }), e[25] = t.message, e[26] = t.step, e[27] = S) : S = e[27];
53
- let L;
54
- e[28] !== y || e[29] !== N || e[30] !== C || e[31] !== S ? (L = /* @__PURE__ */ T("div", { className: g.popoverContainer, children: [
52
+ e[26] !== y || e[27] !== C || e[28] !== N ? (S = /* @__PURE__ */ D("div", { className: g.popoverContainer, children: [
55
53
  y,
56
- N,
57
54
  C,
58
- S
59
- ] }), e[28] = y, e[29] = N, e[30] = C, e[31] = S, e[32] = L) : L = e[32];
55
+ N
56
+ ] }), e[26] = y, e[27] = C, e[28] = N, e[29] = S) : S = e[29];
60
57
  let O;
61
- e[33] !== i || e[34] !== s || e[35] !== r || e[36] !== v || e[37] !== u || e[38] !== L || e[39] !== P ? (O = /* @__PURE__ */ a(x.Portal, { children: /* @__PURE__ */ a(x.Content, { side: r, align: i, sideOffset: v, alignOffset: s, className: g.popoverContent, onInteractOutside: P, onEscapeKeyDown: u, children: L }) }), e[33] = i, e[34] = s, e[35] = r, e[36] = v, e[37] = u, e[38] = L, e[39] = P, e[40] = O) : O = e[40];
58
+ e[30] !== i || e[31] !== o || e[32] !== c || e[33] !== m || e[34] !== u || e[35] !== S || e[36] !== P ? (O = /* @__PURE__ */ n(x.Portal, { children: /* @__PURE__ */ n(x.Content, { side: c, align: i, sideOffset: m, alignOffset: o, className: g.popoverContent, onInteractOutside: P, onEscapeKeyDown: u, children: S }) }), e[30] = i, e[31] = o, e[32] = c, e[33] = m, e[34] = u, e[35] = S, e[36] = P, e[37] = O) : O = e[37];
62
59
  let k;
63
- return e[41] !== H || e[42] !== O || e[43] !== h || e[44] !== $ ? (k = /* @__PURE__ */ T(x.Root, { open: H, onOpenChange: $, children: [
60
+ return e[38] !== R || e[39] !== O || e[40] !== h || e[41] !== $ ? (k = /* @__PURE__ */ D(x.Root, { open: R, onOpenChange: $, children: [
64
61
  h,
65
62
  O
66
- ] }), e[41] = H, e[42] = O, e[43] = h, e[44] = $, e[45] = k) : k = e[45], k;
67
- }), U = (o) => {
63
+ ] }), e[38] = R, e[39] = O, e[40] = h, e[41] = $, e[42] = k) : k = e[42], k;
64
+ }), M = (v) => {
68
65
  const e = A(15), {
69
- payload: n,
70
- size: c,
66
+ payload: a,
67
+ size: l,
71
68
  theme: i
72
- } = o, r = i === void 0 ? "light" : i, s = j();
69
+ } = v, c = i === void 0 ? "light" : i, o = j();
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];
72
+ let s;
73
+ e[2] !== a || e[3] !== l || e[4] !== c ? (s = /* @__PURE__ */ n(G, { value: a, size: l, theme: c }), e[2] = a, e[3] = l, e[4] = c, e[5] = s) : s = e[5];
73
74
  let p;
74
- e[0] !== s.pairingPopoverWelcome ? (p = /* @__PURE__ */ a("span", { className: g.pairingPopoverHeader, children: s.pairingPopoverWelcome }), e[0] = s.pairingPopoverWelcome, e[1] = p) : p = e[1];
75
- let l;
76
- e[2] !== n || e[3] !== c || e[4] !== r ? (l = /* @__PURE__ */ a(Q, { value: n, size: c, theme: r }), e[2] = n, e[3] = c, e[4] = r, e[5] = l) : l = e[5];
75
+ e[6] !== o.pairingPopoverLoginHeading ? (p = /* @__PURE__ */ n("span", { className: g.scanCallToActionPopover, children: o.pairingPopoverLoginHeading }), e[6] = o.pairingPopoverLoginHeading, e[7] = p) : p = e[7];
76
+ let f;
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];
77
78
  let m;
78
- e[6] !== s.pairingPopoverLoginHeading ? (m = /* @__PURE__ */ a("span", { className: g.scanCallToActionPopover, children: s.pairingPopoverLoginHeading }), e[6] = s.pairingPopoverLoginHeading, e[7] = m) : m = e[7];
79
- let d;
80
- e[8] !== s.pairingPopoverScanDescription ? (d = /* @__PURE__ */ a("span", { className: g.pairingDescriptionPopover, children: s.pairingPopoverScanDescription }), e[8] = s.pairingPopoverScanDescription, e[9] = d) : d = e[9];
81
- let v;
82
- return e[10] !== p || e[11] !== l || e[12] !== m || e[13] !== d ? (v = /* @__PURE__ */ T("div", { className: g.pairingPopoverContainer, children: [
79
+ return e[10] !== r || e[11] !== s || e[12] !== p || e[13] !== f ? (m = /* @__PURE__ */ D("div", { className: g.pairingPopoverContainer, children: [
80
+ r,
81
+ s,
83
82
  p,
84
- l,
85
- m,
86
- d
87
- ] }), e[10] = p, e[11] = l, e[12] = m, e[13] = d, e[14] = v) : v = e[14], v;
88
- }, Y = () => {
89
- const o = A(8), e = j();
90
- let n;
91
- o[0] !== e.pairingPopoverWelcome ? (n = /* @__PURE__ */ a("span", { className: g.pairingPopoverHeader, children: e.pairingPopoverWelcome }), o[0] = e.pairingPopoverWelcome, o[1] = n) : n = o[1];
92
- let c;
93
- o[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ a("div", { className: g.loaderLogo, children: /* @__PURE__ */ a(M, { size: 100 }) }), o[2] = c) : c = o[2];
83
+ f
84
+ ] }), e[10] = r, e[11] = s, e[12] = p, e[13] = f, e[14] = m) : m = e[14], m;
85
+ }, Q = (v) => {
86
+ const e = A(3), {
87
+ stage: a
88
+ } = v;
89
+ let l;
90
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ n("div", { className: g.loaderLogo, children: /* @__PURE__ */ n(w, { size: 100 }) }), e[0] = l) : l = e[0];
94
91
  let i;
95
- o[3] !== e.pairingLoader ? (i = /* @__PURE__ */ a("span", { className: g.loaderText, children: e.pairingLoader }), o[3] = e.pairingLoader, o[4] = i) : i = o[4];
96
- let r;
97
- return o[5] !== n || o[6] !== i ? (r = /* @__PURE__ */ T("div", { className: g.loaderContainerPopover, children: [
98
- n,
99
- c,
100
- i
101
- ] }), o[5] = n, o[6] = i, o[7] = r) : r = o[7], r;
102
- }, B = (o) => {
92
+ return e[1] !== a ? (i = /* @__PURE__ */ D("div", { className: g.loaderContainerPopover, children: [
93
+ l,
94
+ /* @__PURE__ */ n("span", { className: g.loaderText, children: a })
95
+ ] }), e[1] = a, e[2] = i) : i = e[2], i;
96
+ }, U = (v) => {
103
97
  const e = A(13), {
104
- message: n
105
- } = o, c = I(), i = j();
98
+ message: a
99
+ } = v, l = W(), i = j();
100
+ let c;
101
+ e[0] !== i.pairingError ? (c = /* @__PURE__ */ n("span", { className: g.errorTitlePopover, children: i.pairingError }), e[0] = i.pairingError, e[1] = c) : c = e[1];
102
+ let o;
103
+ e[2] !== a ? (o = a && /* @__PURE__ */ n("span", { className: g.errorGenericText, children: a }), e[2] = a, e[3] = o) : o = e[3];
106
104
  let r;
107
- e[0] !== i.pairingError ? (r = /* @__PURE__ */ a("span", { className: g.errorTitlePopover, children: i.pairingError }), e[0] = i.pairingError, e[1] = r) : r = e[1];
105
+ e[4] !== l ? (r = () => l.authenticate(), e[4] = l, e[5] = r) : r = e[5];
108
106
  let s;
109
- e[2] !== n ? (s = n && /* @__PURE__ */ a("span", { className: g.errorGenericText, children: n }), e[2] = n, e[3] = s) : s = e[3];
107
+ e[6] !== r || e[7] !== i.pairingRetry ? (s = /* @__PURE__ */ n("button", { className: g.retryButton, type: "button", onClick: r, children: i.pairingRetry }), e[6] = r, e[7] = i.pairingRetry, e[8] = s) : s = e[8];
110
108
  let p;
111
- e[4] !== c ? (p = () => c.authenticate(), e[4] = c, e[5] = p) : p = e[5];
112
- let l;
113
- e[6] !== p || e[7] !== i.pairingRetry ? (l = /* @__PURE__ */ a("button", { className: g.retryButton, type: "button", onClick: p, children: i.pairingRetry }), e[6] = p, e[7] = i.pairingRetry, e[8] = l) : l = e[8];
114
- let m;
115
- return e[9] !== r || e[10] !== s || e[11] !== l ? (m = /* @__PURE__ */ T("div", { className: g.errorContainerPopover, children: [
116
- r,
117
- s,
118
- l
119
- ] }), e[9] = r, e[10] = s, e[11] = l, e[12] = m) : m = e[12], m;
109
+ return e[9] !== c || e[10] !== o || e[11] !== s ? (p = /* @__PURE__ */ D("div", { className: g.errorContainerPopover, children: [
110
+ c,
111
+ o,
112
+ s
113
+ ] }), e[9] = c, e[10] = o, e[11] = s, e[12] = p) : p = e[12], p;
120
114
  };
121
115
  export {
122
- ie as PairingPopover
116
+ oe as PairingPopover
123
117
  };
@@ -1,24 +1,5 @@
1
1
  export declare const useAuthStatus: () => {
2
- status: {
3
- step: "none";
4
- } | {
5
- step: "initial";
6
- } | {
7
- step: "attestation";
8
- } | {
9
- step: "pairing";
10
- payload: string;
11
- } | {
12
- step: "pairingError";
13
- message: string;
14
- } | {
15
- step: "finished";
16
- session: import('@novasamatech/host-papp').StoredUserSession;
17
- } | {
18
- step: "attestationError";
19
- message: string;
20
- };
21
- guestUsername: string | null;
2
+ status: import('@novasamatech/host-papp').PairingStatus;
22
3
  signedInUser: {
23
4
  id: string;
24
5
  localAccount: {
@@ -1,52 +1,25 @@
1
- import { c as f } from "react/compiler-runtime";
1
+ import { c as o } from "react/compiler-runtime";
2
2
  import "react";
3
- import { useAuthentication as c } from "../providers/AuthProvider.js";
4
- const k = () => {
5
- const e = f(4), p = c(), {
6
- pairingStatus: t,
7
- attestationStatus: i
8
- } = p, a = i.step === "attestation" ? i.username : null;
9
- let r;
3
+ import { useAuthentication as r } from "../providers/AuthProvider.js";
4
+ const p = () => {
5
+ const t = o(3), {
6
+ pairingStatus: s
7
+ } = r();
8
+ let i;
10
9
  t: {
11
- if (t.step === "finished") {
12
- r = t.session;
10
+ if (s.step === "finished") {
11
+ i = s.session;
13
12
  break t;
14
13
  }
15
- r = null;
14
+ i = null;
16
15
  }
17
- const o = r;
18
- let s;
19
- t: {
20
- if (t.step === "none") {
21
- s = t;
22
- break t;
23
- }
24
- if (t.step === "initial") {
25
- s = t;
26
- break t;
27
- }
28
- if (t.step === "pairing") {
29
- s = t;
30
- break t;
31
- }
32
- if (i.step === "attestation") {
33
- s = i;
34
- break t;
35
- }
36
- if (i.step === "attestationError") {
37
- s = i;
38
- break t;
39
- }
40
- s = t;
41
- }
42
- const u = s;
43
- let n;
44
- return e[0] !== a || e[1] !== o || e[2] !== u ? (n = {
45
- status: u,
46
- guestUsername: a,
47
- signedInUser: o
48
- }, e[0] = a, e[1] = o, e[2] = u, e[3] = n) : n = e[3], n;
16
+ const n = i;
17
+ let e;
18
+ return t[0] !== s || t[1] !== n ? (e = {
19
+ status: s,
20
+ signedInUser: n
21
+ }, t[0] = s, t[1] = n, t[2] = e) : e = t[2], e;
49
22
  };
50
23
  export {
51
- k as useAuthStatus
24
+ p as useAuthStatus
52
25
  };
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:16px}.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{width:350px}.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;padding:20px 50px 30px}.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;margin-bottom:9px;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;margin-bottom:15px}.papp_Pairing-module_pairingDescription_UJE0U{font-family:Inter,sans-serif;width:300px;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;margin-top:20px}@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;padding:30px;box-sizing:border-box}.papp_Pairing-module_loaderHeader_-q0jo{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_loaderText_beteT{color:var(--color-text-foreground-inverse);text-align:center;font-family:Inter,sans-serif;font-size:29.203px;font-style:normal;font-weight:400;line-height:53.452px;letter-spacing:-.526px}.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;padding:40px 30px}.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;margin-bottom:9px;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_loaderContainerPopover_n1-JJ{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:40px;padding:20px}.papp_Pairing-module_loaderText_beteT{color:var(--color-text-foreground-inverse);text-align:center;font-family:Inter,sans-serif;font-size:20px;line-height:1.5;letter-spacing:-.526px}.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}
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:16px}.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{width:350px}.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;padding:20px 50px 30px}.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;margin-bottom:9px;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;margin-bottom:15px}.papp_Pairing-module_pairingDescription_UJE0U{font-family:Inter,sans-serif;width:300px;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;margin-top:20px}@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;padding:30px;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;padding:40px 30px}.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;margin-bottom:9px;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}
@@ -1,10 +1,9 @@
1
- import { AttestationStatus, PairingStatus, UserSession } from '@novasamatech/host-papp';
1
+ import { PairingStatus, UserSession } from '@novasamatech/host-papp';
2
2
  import { PropsWithChildren } from 'react';
3
3
  export type AuthUIMode = 'popover' | 'modal' | null;
4
4
  export declare function withRetry<T>(fn: () => Promise<T>, maxRetries?: number): Promise<T>;
5
5
  type Auth = {
6
6
  pairingStatus: PairingStatus;
7
- attestationStatus: AttestationStatus;
8
7
  pending: boolean;
9
8
  authUIMode: AuthUIMode;
10
9
  authenticate(ui?: AuthUIMode): Promise<void>;
@@ -1,21 +1,18 @@
1
- import { jsx as x } from "react/jsx-runtime";
2
- import { toastError as C } from "@novasamatech/tr-ui";
3
- import { createContext as k, useContext as y, useState as p, useCallback as i, useSyncExternalStore as d, useDebugValue as l } from "react";
4
- import { usePapp as u } from "../flow/PappProvider.js";
5
- function h(t, s = 2) {
6
- return t().catch((a) => {
7
- if (s > 0)
8
- return h(t, s - 1);
9
- throw a;
1
+ import { jsx as v } from "react/jsx-runtime";
2
+ import { toastError as A } from "@novasamatech/tr-ui";
3
+ import { createContext as w, useContext as x, useState as u, useCallback as i, useSyncExternalStore as C, useDebugValue as y } from "react";
4
+ import { usePapp as p } from "../flow/PappProvider.js";
5
+ function h(t, e = 2) {
6
+ return t().catch((r) => {
7
+ if (e > 0)
8
+ return h(t, e - 1);
9
+ throw r;
10
10
  });
11
11
  }
12
- const S = k({
12
+ const l = w({
13
13
  pairingStatus: {
14
14
  step: "none"
15
15
  },
16
- attestationStatus: {
17
- step: "none"
18
- },
19
16
  pending: !1,
20
17
  authUIMode: null,
21
18
  authenticate: () => Promise.resolve(),
@@ -23,38 +20,34 @@ const S = k({
23
20
  },
24
21
  async disconnect() {
25
22
  }
26
- }), $ = () => y(S), I = () => {
27
- const t = u(), s = d(t.sso.pairingStatus.subscribe, t.sso.pairingStatus.read);
28
- return l(`Polkadot app pairing status: ${s.step}`), s;
29
- }, M = () => {
30
- const t = u(), s = d(t.sso.attestationStatus.subscribe, t.sso.attestationStatus.read);
31
- return l(`Polkadot app attestation status: ${s.step}`), s;
32
- }, j = ({
23
+ }), E = () => x(l), I = () => {
24
+ const t = p(), e = C(t.sso.pairingStatus.subscribe, t.sso.pairingStatus.read);
25
+ return y(`Polkadot app pairing status: ${e.step}`), e;
26
+ }, T = ({
33
27
  children: t
34
28
  }) => {
35
- const [s, a] = p(!1), [m, c] = p(null), e = u(), g = I(), P = M(), f = i((n) => (n && c(n), a(!0), new Promise((o, r) => {
36
- e.sso.authenticate().andTee(() => a(!1)).orTee(() => a(!1)).match(() => o(), r);
37
- })), [e]), b = i(() => {
38
- c(null), e.sso.abortAuthentication();
39
- }, [e]), v = (n) => new Promise((o, r) => {
40
- e.sessions.disconnect(n).match(o, r);
41
- }), A = i((n) => h(() => v(n)).catch((o) => {
42
- throw C({
29
+ const [e, r] = u(!1), [d, c] = u(null), n = p(), m = I(), g = i((s) => (s && c(s), r(!0), new Promise((o, a) => {
30
+ n.sso.authenticate().andTee(() => r(!1)).orTee(() => r(!1)).match(() => o(), a);
31
+ })), [n]), f = i(() => {
32
+ c(null), n.sso.abortAuthentication();
33
+ }, [n]), P = (s) => new Promise((o, a) => {
34
+ n.sessions.disconnect(s).match(o, a);
35
+ }), S = i((s) => h(() => P(s)).catch((o) => {
36
+ throw A({
43
37
  title: o.message
44
38
  }), o;
45
- }), [e]), w = {
46
- pending: s,
47
- pairingStatus: g,
48
- attestationStatus: P,
49
- authUIMode: m,
50
- authenticate: f,
51
- abortAuthentication: b,
52
- disconnect: A
39
+ }), [n]), b = {
40
+ pending: e,
41
+ pairingStatus: m,
42
+ authUIMode: d,
43
+ authenticate: g,
44
+ abortAuthentication: f,
45
+ disconnect: S
53
46
  };
54
- return /* @__PURE__ */ x(S.Provider, { value: w, children: t });
47
+ return /* @__PURE__ */ v(l.Provider, { value: b, children: t });
55
48
  };
56
49
  export {
57
- j as AuthProvider,
58
- $ as useAuthentication,
50
+ T as AuthProvider,
51
+ E as useAuthentication,
59
52
  h as withRetry
60
53
  };
@@ -3,12 +3,9 @@ export type Translations = {
3
3
  pairingHeader: string;
4
4
  pairingScanCallToAction: string;
5
5
  pairingDescription: string;
6
- pairingLoader: string;
7
- pairingAttestationError: string;
8
6
  pairingRetry: string;
9
7
  pairingError: string;
10
8
  pairingWelcomeMessage: string;
11
- pairingLoginMessage: string;
12
9
  pairingPopoverWelcome: string;
13
10
  pairingPopoverLoginHeading: string;
14
11
  pairingPopoverScanDescription: string;
@@ -1,50 +1,47 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
2
  import { c as h } from "react/compiler-runtime";
3
3
  import { createContext as m, useContext as f } from "react";
4
- const p = "en", c = {
5
- [p]: {
4
+ const g = "en", c = {
5
+ [g]: {
6
6
  pairingHeader: "Log in to save",
7
7
  pairingScanCallToAction: "Scan it with a phone",
8
8
  pairingDescription: "Scanning the QR code opens the Polkadot mobile app, where users are guided step-by-step through the onboarding or setup process.",
9
- pairingLoader: "Just a second...",
10
- pairingAttestationError: "Error while passing attestation",
11
9
  pairingRetry: "Retry",
12
10
  pairingError: "Error while pairing",
13
11
  pairingWelcomeMessage: "Welcome back,",
14
- pairingLoginMessage: "Loggin in",
15
12
  pairingPopoverWelcome: "Welcome to Polkadot!",
16
13
  pairingPopoverLoginHeading: "Login to explore all Polkadot features",
17
14
  pairingPopoverScanDescription: "Scan with your phone camera to log in using the Polkadot mobile app"
18
15
  }
19
16
  }, u = m({
20
- language: p,
17
+ language: g,
21
18
  keys: c
22
- }), v = (n) => {
19
+ }), v = (t) => {
23
20
  const e = h(8), {
24
- language: l,
25
- keys: i,
26
- children: a
27
- } = n, s = l === void 0 ? p : l;
21
+ language: p,
22
+ keys: a,
23
+ children: i
24
+ } = t, s = p === void 0 ? g : p;
28
25
  let o;
29
- e[0] !== i ? (o = {
26
+ e[0] !== a ? (o = {
30
27
  ...c,
31
- ...i
32
- }, e[0] = i, e[1] = o) : o = e[1];
33
- let t;
34
- e[2] !== s || e[3] !== o ? (t = {
28
+ ...a
29
+ }, e[0] = a, e[1] = o) : o = e[1];
30
+ let n;
31
+ e[2] !== s || e[3] !== o ? (n = {
35
32
  language: s,
36
33
  keys: o
37
- }, e[2] = s, e[3] = o, e[4] = t) : t = e[4];
38
- const g = t;
34
+ }, e[2] = s, e[3] = o, e[4] = n) : n = e[4];
35
+ const l = n;
39
36
  let r;
40
- return e[5] !== a || e[6] !== g ? (r = /* @__PURE__ */ d(u.Provider, { value: g, children: a }), e[5] = a, e[6] = g, e[7] = r) : r = e[7], r;
41
- }, w = () => {
42
- const n = f(u), e = n.keys[n.language];
37
+ return e[5] !== i || e[6] !== l ? (r = /* @__PURE__ */ d(u.Provider, { value: l, children: i }), e[5] = i, e[6] = l, e[7] = r) : r = e[7], r;
38
+ }, x = () => {
39
+ const t = f(u), e = t.keys[t.language];
43
40
  if (!e)
44
- throw new Error(`Papp integration: translation keys for "${n.language}" not found`);
41
+ throw new Error(`Papp integration: translation keys for "${t.language}" not found`);
45
42
  return e;
46
43
  };
47
44
  export {
48
45
  v as TranslationProvider,
49
- w as useTranslations
46
+ x as useTranslations
50
47
  };
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-2",
4
+ "version": "0.7.9-4",
5
5
  "description": "Polkadot app UI Flow",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -30,8 +30,8 @@
30
30
  "react-dom": ">=18"
31
31
  },
32
32
  "dependencies": {
33
- "@novasamatech/host-papp": "0.7.9-2",
34
- "@novasamatech/statement-store": "0.7.9-2",
33
+ "@novasamatech/host-papp": "0.7.9-4",
34
+ "@novasamatech/statement-store": "0.7.9-4",
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",