@pelican-identity/react 2.0.2 → 2.0.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.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useState, useEffect, useRef, useCallback } from 'react';
2
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { PelicanAuthentication } from '@pelican-identity/auth-core';
4
4
 
5
5
  // src/components/PelicanAuth.tsx
@@ -7,31 +7,48 @@ var PelicanButton = ({
7
7
  authType,
8
8
  text
9
9
  }) => {
10
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 border border-grey-300 dark:border-primary/50 px-2 pr-3 py-1.5 rounded-[16px] w-full cursor-pointer", children: [
11
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
12
- "svg",
13
- {
14
- width: "28",
15
- height: "28",
16
- viewBox: "0 0 100 100",
17
- fill: "none",
18
- xmlns: "http://www.w3.org/2000/svg",
19
- role: "img",
20
- "aria-label": "Pelican logo",
21
- children: [
22
- /* @__PURE__ */ jsx("rect", { width: "100", height: "100", rx: "32", fill: "#121212" }),
23
- /* @__PURE__ */ jsx(
24
- "path",
25
- {
26
- d: "M56.5511 56.8089C56.5705 55.5878 57.5734 54.0696 58.7917 53.4254C60.0572 52.7596 61.0322 53.2324 61.0193 54.5099C60.9978 55.744 59.9754 57.2947 58.7572 57.9346C57.539 58.5744 56.5296 58.0777 56.5511 56.8089ZM70.0957 49.6364C70.2081 49.5555 70.2954 49.4442 70.3475 49.3154C70.369 48.6278 70.3626 47.9555 70.3626 47.2354C68.4083 48.5172 66.5142 49.7665 64.6202 51.0158V53.2389L65.1174 52.9114C66.7725 51.8183 68.4341 50.7338 70.0957 49.6364ZM69.7147 58.5592C68.4463 60.5076 66.7916 62.1705 64.8548 63.4436C63.1329 64.6039 61.4778 65.222 59.9389 65.1787C58.359 65.1375 57.2893 64.3957 56.6695 62.9686C57.2678 62.448 57.8059 61.9665 58.344 61.4937C58.5418 61.8163 58.7688 62.1198 59.022 62.4003C60.0572 63.3828 61.5488 63.3134 63.3546 62.4762C63.5698 62.3743 63.77 62.2593 63.9809 62.1401C64.8419 61.6607 65.2874 61.1033 65.5069 60.123C65.6834 59.3053 65.7932 58.5158 65.9374 57.7068C66.1135 56.6524 66.4412 55.6295 66.9102 54.6704C67.4634 53.5512 68.2382 52.7184 69.2412 52.3085C70.1323 51.9528 70.7048 52.2065 70.9911 52.8854C71.6432 54.4687 71.0965 56.425 69.7147 58.5592ZM69.3273 54.5923C69.2714 54.434 69.1013 54.2691 68.9528 54.3168C68.8043 54.3646 68.5632 54.6877 68.4341 54.9068C68.2881 55.1536 68.1759 55.4192 68.1005 55.6963C67.8293 56.8913 67.5775 58.082 67.3106 59.2641C67.356 59.263 67.4013 59.2586 67.4462 59.2511C68.1303 58.4928 68.6892 57.6287 69.1013 56.6918C69.4349 55.8741 69.5038 55.1757 69.3273 54.5923ZM80.7949 39.7072V60.2726C80.7942 62.6299 80.1786 64.9455 79.0098 66.9874C77.841 69.0293 76.1601 70.7257 74.1356 71.9066L56.4607 82.1785C54.4328 83.3608 52.1313 83.9834 49.7885 83.9834C47.4456 83.9834 45.1441 83.3608 43.1162 82.1785L25.4671 71.9001C23.4402 70.7208 21.7567 69.0251 20.5856 66.9831C19.4145 64.9411 18.7969 62.6246 18.7949 60.2661V39.7007C18.7969 37.3422 19.4145 35.0257 20.5856 32.9837C21.7567 30.9417 23.4402 29.246 25.4671 28.0667L43.1378 17.7883C45.1657 16.606 47.4671 15.9834 49.81 15.9834C52.1529 15.9834 54.4543 16.606 56.4822 17.7883L74.1356 28.0667C76.1601 29.2476 77.841 30.944 79.0098 32.9859C80.1786 35.0278 80.7942 37.3434 80.7949 39.7007V39.7072ZM77.8333 47.6887C77.8333 42.3077 73.5007 40.2624 68.1629 43.134L52.9287 51.2956C51.6739 51.9679 50.6602 53.5382 50.6602 54.8005V77.5956C50.6602 78.8644 51.6739 79.3307 52.9287 78.6649L58.5936 75.6284C59.1636 75.3055 59.6456 74.8458 59.997 74.2902C60.3517 73.7796 60.5547 73.1777 60.5824 72.5551C60.5824 71.9435 61.0731 71.1887 61.6779 70.8655L64.4975 69.3473C65.0291 69.0653 65.5414 68.7769 66.0299 68.4797L68.1629 67.3411C73.5007 64.4716 77.8333 57.7979 77.8333 52.4082V47.6887Z",
27
- fill: "#D9EB1B"
28
- }
29
- )
30
- ]
31
- }
32
- ) }),
33
- /* @__PURE__ */ jsx("p", { className: " tracking-tight text-sm", children: text || /* @__PURE__ */ jsx("span", { children: authType === "login" ? "Login with Pelican" : authType === "signup" ? "Signup with Pelican" : authType === "id-verification" ? "Verify identity with Pelican" : "Authenticate with Pelican" }) })
34
- ] });
10
+ return /* @__PURE__ */ jsxs(
11
+ "div",
12
+ {
13
+ style: {
14
+ display: "flex",
15
+ flexDirection: "row",
16
+ alignItems: "center",
17
+ justifyContent: "center",
18
+ gap: "0.5rem",
19
+ padding: "0.1rem 0.7rem",
20
+ borderRadius: "20px",
21
+ cursor: "pointer",
22
+ backgroundColor: "#232323ff",
23
+ border: "1px solid #d9eb1b"
24
+ },
25
+ children: [
26
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
27
+ "svg",
28
+ {
29
+ width: "28",
30
+ height: "28",
31
+ viewBox: "0 0 100 100",
32
+ fill: "none",
33
+ xmlns: "http://www.w3.org/2000/svg",
34
+ role: "img",
35
+ "aria-label": "Pelican logo",
36
+ children: [
37
+ /* @__PURE__ */ jsx("rect", { width: "100", height: "100", rx: "32", fill: "#121212" }),
38
+ /* @__PURE__ */ jsx(
39
+ "path",
40
+ {
41
+ d: "M56.5511 56.8089C56.5705 55.5878 57.5734 54.0696 58.7917 53.4254C60.0572 52.7596 61.0322 53.2324 61.0193 54.5099C60.9978 55.744 59.9754 57.2947 58.7572 57.9346C57.539 58.5744 56.5296 58.0777 56.5511 56.8089ZM70.0957 49.6364C70.2081 49.5555 70.2954 49.4442 70.3475 49.3154C70.369 48.6278 70.3626 47.9555 70.3626 47.2354C68.4083 48.5172 66.5142 49.7665 64.6202 51.0158V53.2389L65.1174 52.9114C66.7725 51.8183 68.4341 50.7338 70.0957 49.6364ZM69.7147 58.5592C68.4463 60.5076 66.7916 62.1705 64.8548 63.4436C63.1329 64.6039 61.4778 65.222 59.9389 65.1787C58.359 65.1375 57.2893 64.3957 56.6695 62.9686C57.2678 62.448 57.8059 61.9665 58.344 61.4937C58.5418 61.8163 58.7688 62.1198 59.022 62.4003C60.0572 63.3828 61.5488 63.3134 63.3546 62.4762C63.5698 62.3743 63.77 62.2593 63.9809 62.1401C64.8419 61.6607 65.2874 61.1033 65.5069 60.123C65.6834 59.3053 65.7932 58.5158 65.9374 57.7068C66.1135 56.6524 66.4412 55.6295 66.9102 54.6704C67.4634 53.5512 68.2382 52.7184 69.2412 52.3085C70.1323 51.9528 70.7048 52.2065 70.9911 52.8854C71.6432 54.4687 71.0965 56.425 69.7147 58.5592ZM69.3273 54.5923C69.2714 54.434 69.1013 54.2691 68.9528 54.3168C68.8043 54.3646 68.5632 54.6877 68.4341 54.9068C68.2881 55.1536 68.1759 55.4192 68.1005 55.6963C67.8293 56.8913 67.5775 58.082 67.3106 59.2641C67.356 59.263 67.4013 59.2586 67.4462 59.2511C68.1303 58.4928 68.6892 57.6287 69.1013 56.6918C69.4349 55.8741 69.5038 55.1757 69.3273 54.5923ZM80.7949 39.7072V60.2726C80.7942 62.6299 80.1786 64.9455 79.0098 66.9874C77.841 69.0293 76.1601 70.7257 74.1356 71.9066L56.4607 82.1785C54.4328 83.3608 52.1313 83.9834 49.7885 83.9834C47.4456 83.9834 45.1441 83.3608 43.1162 82.1785L25.4671 71.9001C23.4402 70.7208 21.7567 69.0251 20.5856 66.9831C19.4145 64.9411 18.7969 62.6246 18.7949 60.2661V39.7007C18.7969 37.3422 19.4145 35.0257 20.5856 32.9837C21.7567 30.9417 23.4402 29.246 25.4671 28.0667L43.1378 17.7883C45.1657 16.606 47.4671 15.9834 49.81 15.9834C52.1529 15.9834 54.4543 16.606 56.4822 17.7883L74.1356 28.0667C76.1601 29.2476 77.841 30.944 79.0098 32.9859C80.1786 35.0278 80.7942 37.3434 80.7949 39.7007V39.7072ZM77.8333 47.6887C77.8333 42.3077 73.5007 40.2624 68.1629 43.134L52.9287 51.2956C51.6739 51.9679 50.6602 53.5382 50.6602 54.8005V77.5956C50.6602 78.8644 51.6739 79.3307 52.9287 78.6649L58.5936 75.6284C59.1636 75.3055 59.6456 74.8458 59.997 74.2902C60.3517 73.7796 60.5547 73.1777 60.5824 72.5551C60.5824 71.9435 61.0731 71.1887 61.6779 70.8655L64.4975 69.3473C65.0291 69.0653 65.5414 68.7769 66.0299 68.4797L68.1629 67.3411C73.5007 64.4716 77.8333 57.7979 77.8333 52.4082V47.6887Z",
42
+ fill: "#D9EB1B"
43
+ }
44
+ )
45
+ ]
46
+ }
47
+ ) }),
48
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("p", { style: { fontSize: "14px", fontWeight: "600", color: "#fff" }, children: text || /* @__PURE__ */ jsx("span", { children: authType === "login" ? "Login with Pelican" : authType === "signup" ? "Signup with Pelican" : authType === "id-verification" ? "Verify identity with Pelican" : "Authenticate with Pelican" }) }) })
49
+ ]
50
+ }
51
+ );
35
52
  };
36
53
  var PelicanButton_default = PelicanButton;
37
54
  var usePelicanAuth = (config) => {
@@ -71,23 +88,74 @@ var usePelicanAuth = (config) => {
71
88
  };
72
89
  };
73
90
  var StoreIcons = () => {
74
- return /* @__PURE__ */ jsx("div", { className: "flex justify-center ", children: /* @__PURE__ */ jsxs("div", { className: "bg-[#000000] rounded-3xl flex gap-4 p-2 px-6 items-center text-white font-semibold border border-primary", children: [
75
- /* @__PURE__ */ jsxs("div", { className: "flex space-x-3 items-center", children: [
76
- /* @__PURE__ */ jsx(Apple, {}),
77
- /* @__PURE__ */ jsx(PlayStore, {})
78
- ] }),
79
- /* @__PURE__ */ jsxs("div", { children: [
80
- /* @__PURE__ */ jsx("p", { className: "text-[12px]", children: "Available on the" }),
81
- /* @__PURE__ */ jsx("p", { className: "text-xl", children: "App Stores" })
82
- ] })
83
- ] }) });
91
+ return /* @__PURE__ */ jsx(
92
+ "div",
93
+ {
94
+ style: {
95
+ display: "flex",
96
+ justifyContent: "center",
97
+ alignItems: "center"
98
+ },
99
+ children: /* @__PURE__ */ jsxs(
100
+ "div",
101
+ {
102
+ style: {
103
+ display: "flex",
104
+ justifyContent: "center",
105
+ alignItems: "center",
106
+ backgroundColor: "#000000",
107
+ borderRadius: "1.2rem",
108
+ gap: "0.5rem",
109
+ padding: "0.7rem 1rem",
110
+ height: "1.4rem"
111
+ },
112
+ children: [
113
+ /* @__PURE__ */ jsx(
114
+ "div",
115
+ {
116
+ style: {
117
+ gap: "0.1rem"
118
+ },
119
+ children: /* @__PURE__ */ jsx(
120
+ "p",
121
+ {
122
+ style: {
123
+ fontSize: "14px",
124
+ fontWeight: "500",
125
+ color: "#fff",
126
+ fontFamily: "system-ui, Avenir, Helvetica, Arial, sans-serif"
127
+ },
128
+ children: "Available on"
129
+ }
130
+ )
131
+ }
132
+ ),
133
+ /* @__PURE__ */ jsxs(
134
+ "div",
135
+ {
136
+ style: {
137
+ display: "flex",
138
+ alignItems: "center",
139
+ gap: "0.6rem"
140
+ },
141
+ children: [
142
+ /* @__PURE__ */ jsx(Apple, {}),
143
+ /* @__PURE__ */ jsx(PlayStore, {})
144
+ ]
145
+ }
146
+ )
147
+ ]
148
+ }
149
+ )
150
+ }
151
+ );
84
152
  };
85
153
  var Apple = () => {
86
154
  return /* @__PURE__ */ jsxs(
87
155
  "svg",
88
156
  {
89
- width: "32",
90
- height: "32",
157
+ width: "20",
158
+ height: "20",
91
159
  viewBox: "0 0 32 32",
92
160
  fill: "none",
93
161
  xmlns: "http://www.w3.org/2000/svg",
@@ -112,8 +180,8 @@ var PlayStore = () => {
112
180
  return /* @__PURE__ */ jsx(
113
181
  "svg",
114
182
  {
115
- width: "26",
116
- height: "26",
183
+ width: "18",
184
+ height: "18",
117
185
  viewBox: "0 0 26 26",
118
186
  fill: "none",
119
187
  xmlns: "http://www.w3.org/2000/svg",
@@ -132,424 +200,170 @@ var PlayStore = () => {
132
200
  var StoreIcons_default = StoreIcons;
133
201
  var PelicanAuth = (config) => {
134
202
  const [isOpen, setIsOpen] = useState(config.continuousMode || false);
135
- const [successMessage, setSuccessMessage] = useState("");
203
+ const [successMessage, setSuccessMessage] = useState(null);
136
204
  const { start, qr, state, deeplink, isProcessing, stop } = usePelicanAuth({
137
205
  projectId: config.projectId,
138
206
  publicKey: config.publicKey,
139
207
  authType: config.authType,
208
+ onClose: config.onClose,
209
+ continuousMode: config.continuousMode,
210
+ forceQRCode: config.forceQRCode,
140
211
  onSuccess: (identity) => {
141
212
  config.onSuccess(identity);
142
213
  if (config.continuousMode) {
143
214
  setSuccessMessage("Authentication complete!");
215
+ setTimeout(() => {
216
+ setSuccessMessage(null);
217
+ }, 2e3);
218
+ } else {
219
+ setIsOpen(false);
144
220
  }
145
221
  },
146
222
  onError: (error) => {
147
223
  config.onError?.(error);
148
- },
149
- onClose: config.onClose
224
+ }
150
225
  });
151
226
  useEffect(() => {
152
227
  if (config.continuousMode) {
153
228
  start();
154
229
  }
155
230
  }, [config.continuousMode]);
156
- return /* @__PURE__ */ jsxs(Fragment, { children: [
157
- /* @__PURE__ */ jsx("style", { children: `
158
- @keyframes fadeUp {
159
- from {
160
- opacity: 0;
161
- transform: translateY(20px);
162
- }
163
- to {
164
- opacity: 1;
165
- transform: translateY(0);
166
- }
167
- }
168
-
169
- @keyframes spin {
170
- to {
171
- transform: rotate(360deg);
172
- }
173
- }
174
-
175
- @keyframes successPulse {
176
- 0%, 100% {
177
- transform: scale(1);
178
- opacity: 1;
179
- }
180
- 50% {
181
- transform: scale(1.05);
182
- opacity: 0.9;
183
- }
184
- }
185
-
186
- .auth-container {
187
- width: 100%;
188
- max-width: 400px;
189
- padding: 1rem;
190
- position: relative;
191
- animation: fadeUp 0.5s ease-out;
192
- }
193
-
194
- .close-button {
195
- position: absolute;
196
- right: 0;
197
- top: -2.5rem;
198
- background: none;
199
- border: none;
200
- cursor: pointer;
201
- transition: opacity 0.2s;
202
- }
203
-
204
- .close-button:hover {
205
- opacity: 0.6;
206
- }
207
-
208
- @media (prefers-color-scheme: dark) {
209
- .close-button {
210
- color: #fff;
211
- }
212
-
213
- .close-icon {
214
- fill: #000000;
215
- }
216
- }
217
-
218
- .close-icon {
219
- width: 1.5rem;
220
- height: 1.5rem;
221
- fill: #000000;
222
- }
223
-
224
- .retry-container {
225
- text-align: center;
226
- padding: 3rem 0;
227
- }
228
-
229
- .retry-container > div:first-child {
230
- margin-bottom: 1rem;
231
- }
232
-
233
- .retry-text {
234
- font-size: 1.125rem;
235
- }
236
-
237
- .content-wrapper {
238
- display: flex;
239
- flex-direction: column;
240
- gap: 2rem;
241
- }
242
-
243
- .unpaired-container {
244
- text-align: center;
245
- display: flex;
246
- flex-direction: column;
247
- gap: 1.5rem;
248
- }
249
-
250
- .main-heading {
251
- font-size: 1rem;
252
- font-weight: 800;
253
- }
254
-
255
- @media (min-width: 768px) {
256
- .main-heading {
257
- font-size: 1.25rem;
258
- }
259
- }
260
-
261
- @media (min-width: 1024px) {
262
- .main-heading {
263
- font-size: 1.25rem;
264
- }
265
- }
266
-
267
- .mobile-auth-container {
268
- display: flex;
269
- flex-direction: column;
270
- gap: 1rem;
271
- }
272
-
273
- .logo-container {
274
- display: flex;
275
- justify-content: center;
276
- padding: 2rem 0;
277
- }
278
-
279
- .open-app-link {
280
- display: inline-block;
281
- padding: 1rem 2rem;
282
- background-color: #000000;
283
- border: 1px solid #d9eb1b;
284
- border-radius: 9999px;
285
- color: #d9eb1b;
286
- font-weight: 700;
287
- font-size: 1.125rem;
288
- text-decoration: none;
289
- transition: background-color 0.2s;
290
- }
291
-
292
- .open-app-link:hover {
293
- background-color: rgba(217, 235, 27, 0.9);
294
- color: #000;
295
- }
296
-
297
- .helper-text {
298
- font-size: 0.75rem;
299
- color: #6b7280;
300
- }
301
-
302
- .qr-container {
303
- display: flex;
304
- justify-content: center;
305
- }
306
-
307
- .qr-wrapper {
308
- display: flex;
309
- justify-content: center;
310
- align-items: center;
311
- overflow: hidden;
312
- border-radius: 2rem;
313
- border: 1px solid #d9eb1b;
314
- background-color: #FFFFF5;
315
- padding: 0.5rem;
316
- height: 250px;
317
- width: 250px;
318
- }
319
-
320
- .error-text {
321
- font-weight: 500;
322
- color: red;
323
- }
324
-
325
- .qr-image {
326
- height: 100%;
327
- width: 100%;
328
- }
329
-
330
- .loader-container {
331
- display: flex;
332
- justify-content: center;
333
- }
334
-
335
- .instruction-text {
336
- font-size: 0.875rem;
337
- color: #9ca3af;
338
- }
339
-
340
- .paired-container {
341
- text-align: center;
342
- padding: 1rem 0;
343
- display: flex;
344
- flex-direction: column;
345
- gap: 1rem;
346
- max-width: 250px;
347
- }
348
-
349
- .paired-heading {
350
- font-size: 1.875rem;
351
- font-weight: 800;
352
- }
353
-
354
- @media (min-width: 768px) {
355
- .paired-heading {
356
- font-size: 2.25rem;
357
- }
358
- .main-heading {
359
- font-size: 1.25rem;
360
- }
361
- }
362
-
363
- .success-message {
364
- background-color: #121212;
365
- color: #d9eb1b;
366
- padding: 1rem 2rem;
367
- border-radius: 2rem;
368
- font-weight: 700;
369
- font-size: 1.25rem;
370
- animation: successPulse 0.2s ease-in-out;
371
- margin: 1rem 0;
372
- }
373
-
374
- .auto-renew-badge {
375
- display: inline-block;
376
- background-color: rgba(217, 235, 27, 0.2);
377
- border: 1px solid #d9eb1b;
378
- color: #d9eb1b;
379
- padding: 0.25rem 0.75rem;
380
- border-radius: 9999px;
381
- font-size: 0.75rem;
382
- font-weight: 600;
383
- margin-top: 0.5rem;
384
- }
385
-
386
- .loader {
387
- width: 48px;
388
- height: 48px;
389
- position: relative;
390
- }
391
- .loader::before , .loader::after{
392
- content: '';
393
- position: absolute;
394
- left: 50%;
395
- top: 50%;
396
- transform: translate(-50% , -50%);
397
- width: 48em;
398
- height: 48em;
399
- background-image:
400
- radial-gradient(circle 10px, #d9eb1b 100%, transparent 0),
401
- radial-gradient(circle 10px, #d9eb1b 100%, transparent 0),
402
- radial-gradient(circle 10px, #d9eb1b 100%, transparent 0),
403
- radial-gradient(circle 10px, #d9eb1b 100%, transparent 0),
404
- radial-gradient(circle 10px, #d9eb1b 100%, transparent 0),
405
- radial-gradient(circle 10px, #d9eb1b 100%, transparent 0),
406
- radial-gradient(circle 10px, #d9eb1b 100%, transparent 0),
407
- radial-gradient(circle 10px, #d9eb1b 100%, transparent 0);
408
- background-position: 0em -18em, 0em 18em, 18em 0em, -18em 0em,
409
- 13em -13em, -13em -13em, 13em 13em, -13em 13em;
410
- background-repeat: no-repeat;
411
- font-size: 0.5px;
412
- border-radius: 50%;
413
- animation: blast 1s ease-in infinite;
414
- }
415
- .loader::after {
416
- font-size: 1px;
417
- background: #d9eb1b;
418
- animation: bounce 1s ease-in infinite;
419
- }
420
-
421
- @keyframes bounce {
422
- 0% , 100%{ font-size: 0.75px }
423
- 50% { font-size: 1.5px }
424
- }
425
- @keyframes blast {
426
- 0% , 40% {
427
- font-size: 0.5px;
428
- }
429
- 70% {
430
- opacity: 1;
431
- font-size: 4px;
432
- }
433
- 100% {
434
- font-size: 6px;
435
- opacity: 0;
436
- }
437
- }
438
- ` }),
439
- /* @__PURE__ */ jsx("div", { style: { maxWidth: "300px" }, children: !config.continuousMode && /* @__PURE__ */ jsxs(
231
+ return /* @__PURE__ */ jsxs("section", { children: [
232
+ /* @__PURE__ */ jsx(
440
233
  "div",
441
234
  {
442
235
  style: {
443
- maxWidth: "300px",
444
- gap: "40px",
445
- display: "flex",
236
+ maxWidth: "290px",
446
237
  justifyContent: "space-between",
447
- alignItems: "center"
238
+ alignItems: "center",
239
+ width: "100%"
448
240
  },
449
- children: [
450
- /* @__PURE__ */ jsx(
451
- "button",
452
- {
453
- type: "button",
454
- onClick: () => {
455
- start();
456
- setIsOpen(true);
457
- },
458
- disabled: isOpen || config.continuousMode,
459
- children: config.buttonComponent ? config.buttonComponent : /* @__PURE__ */ jsx(
460
- PelicanButton_default,
241
+ children: !config.continuousMode && /* @__PURE__ */ jsxs(
242
+ "div",
243
+ {
244
+ style: {
245
+ width: "100%",
246
+ gap: "40px",
247
+ display: "flex",
248
+ justifyContent: "space-between",
249
+ alignItems: "center"
250
+ },
251
+ children: [
252
+ /* @__PURE__ */ jsx(
253
+ "button",
461
254
  {
462
- authType: config.authType,
463
- text: config.buttonText
255
+ type: "button",
256
+ style: {
257
+ border: "none",
258
+ background: "transparent",
259
+ cursor: "pointer"
260
+ },
261
+ onClick: () => {
262
+ start();
263
+ setIsOpen(true);
264
+ },
265
+ disabled: isOpen || config.continuousMode,
266
+ children: config.buttonComponent ? config.buttonComponent : /* @__PURE__ */ jsx(
267
+ PelicanButton_default,
268
+ {
269
+ authType: config.authType,
270
+ text: config.buttonText
271
+ }
272
+ )
464
273
  }
465
- )
466
- }
467
- ),
468
- isOpen && !config.continuousMode && /* @__PURE__ */ jsx(
469
- "button",
470
- {
471
- onClick: () => {
472
- stop();
473
- config.onClose?.();
474
- setIsOpen(false);
475
- },
476
- className: "close-button",
477
- "aria-label": "Close",
478
- type: "button",
479
- children: /* @__PURE__ */ jsx(
480
- "svg",
274
+ ),
275
+ isOpen && !config.continuousMode && /* @__PURE__ */ jsx(
276
+ "button",
481
277
  {
482
- className: "close-icon",
483
- fill: "#6a7282",
484
- stroke: "#6a7282",
485
- viewBox: "0 0 24 24",
486
- role: "img",
487
- "aria-label": "close icon",
278
+ onClick: () => {
279
+ stop();
280
+ config.onClose?.();
281
+ setIsOpen(false);
282
+ },
283
+ className: "close-button",
284
+ "aria-label": "Close",
285
+ type: "button",
488
286
  children: /* @__PURE__ */ jsx(
489
- "path",
287
+ "svg",
490
288
  {
491
- strokeLinecap: "round",
492
- strokeLinejoin: "round",
493
- strokeWidth: 4,
494
- d: "M6 18L18 6M6 6l12 12"
289
+ className: "close-icon",
290
+ fill: "#fff",
291
+ stroke: "#fff",
292
+ viewBox: "0 0 24 24",
293
+ role: "img",
294
+ "aria-label": "close icon",
295
+ children: /* @__PURE__ */ jsx(
296
+ "path",
297
+ {
298
+ strokeLinecap: "round",
299
+ strokeLinejoin: "round",
300
+ strokeWidth: 4,
301
+ d: "M6 18L18 6M6 6l12 12"
302
+ }
303
+ )
495
304
  }
496
305
  )
497
306
  }
498
307
  )
499
- }
500
- )
501
- ]
308
+ ]
309
+ }
310
+ )
502
311
  }
503
- ) }),
504
- /* @__PURE__ */ jsxs("div", { className: "auth-container", children: [
505
- successMessage && /* @__PURE__ */ jsxs("div", { className: "success-message", children: [
312
+ ),
313
+ isOpen && /* @__PURE__ */ jsxs("div", { className: "auth-container", children: [
314
+ successMessage && /* @__PURE__ */ jsxs("div", { className: "success-message", style: { textAlign: "center" }, children: [
506
315
  successMessage,
507
- config.continuousMode && /* @__PURE__ */ jsx("div", { style: { fontSize: "0.875rem", marginTop: "0.5rem" }, children: "Preparing next session..." })
316
+ config.continuousMode && /* @__PURE__ */ jsx(
317
+ "p",
318
+ {
319
+ style: {
320
+ fontSize: "0.8rem",
321
+ marginTop: "0.5rem",
322
+ color: "#f3f3f3",
323
+ textAlign: "center"
324
+ },
325
+ children: "Preparing next session..."
326
+ }
327
+ )
508
328
  ] }),
509
329
  isProcessing ? /* @__PURE__ */ jsxs("div", { className: "content-wrapper", children: [
510
- /* @__PURE__ */ jsx("h2", { className: "main-heading", children: config.continuousMode ? "Preparing new session..." : "Starting authentication..." }),
511
- /* @__PURE__ */ jsx("div", { className: "qr-wrapper", children: /* @__PURE__ */ jsx("span", { className: "loader" }) })
512
- ] }) : /* @__PURE__ */ jsxs("div", { className: "content-wrapper", children: [
513
- state === "awaiting-pair" && !successMessage && /* @__PURE__ */ jsxs("div", { className: "unpaired-container", children: [
514
- /* @__PURE__ */ jsx("h2", { className: "main-heading", children: config.forceQRCode || state === "awaiting-pair" ? "Open the Pelican Vault app" : `Authenticate with Pelican Vault` }),
515
- !config.forceQRCode && deeplink ? /* @__PURE__ */ jsxs("div", { className: "mobile-auth-container", children: [
516
- /* @__PURE__ */ jsx("div", { className: "logo-container", children: /* @__PURE__ */ jsx(
517
- "svg",
518
- {
519
- width: 82,
520
- height: 96,
521
- viewBox: "0 0 588 640",
522
- fill: "none",
523
- role: "img",
524
- "aria-label": "Pelican Logo",
525
- children: /* @__PURE__ */ jsx(
526
- "path",
527
- {
528
- d: "M357.79 383.899C357.99 372.409 367.47 358.149 379.03 352.079C391.03 345.819 400.26 350.269 400.13 362.279C399.94 373.899 390.26 388.479 378.7 394.479C367.14 400.479 357.6 395.839 357.79 383.899ZM486.16 316.459C487.06 315.809 488.55 314.069 488.55 313.459C488.74 307.009 488.67 300.689 488.67 293.909C470.15 305.979 452.21 317.719 434.27 329.469V350.379C436.01 349.219 437.5 348.249 438.98 347.279C454.66 336.999 470.41 326.779 486.16 316.459ZM482.54 400.359C470.529 418.676 454.87 434.318 436.54 446.309C420.21 457.209 404.54 463.019 389.94 462.699C374.94 462.309 364.84 455.339 358.94 441.919C364.62 437.009 369.72 432.489 374.82 428.039C377.02 431.039 378.76 434.169 381.21 436.429C391.02 445.659 405.15 445.009 422.21 437.139C424.21 436.139 426.14 435.079 428.14 433.979C436.34 429.459 440.53 424.229 442.6 414.979C444.28 407.299 445.31 399.869 446.66 392.259C448.387 382.382 451.533 372.806 456 363.829C461.23 353.309 468.59 345.369 478.08 341.629C486.53 338.269 491.95 340.629 494.66 347.049C500.81 361.889 495.64 380.279 482.54 400.359ZM478.87 362.999C478.35 361.509 476.73 359.999 475.32 360.419C473.91 360.839 471.64 363.899 470.41 365.969C469.016 368.283 467.953 370.781 467.25 373.389C464.67 384.619 462.25 395.779 459.76 406.949C460.192 406.935 460.623 406.892 461.05 406.819C467.51 399.399 473.05 391.519 476.73 382.749C479.9 375.119 480.54 368.539 478.87 362.999ZM587.54 222.999V416.419C587.537 438.587 581.704 460.364 570.627 479.566C559.55 498.767 543.618 514.719 524.43 525.819L357 622.489C337.794 633.588 316.003 639.432 293.82 639.432C271.637 639.432 249.846 633.588 230.64 622.489L63.12 525.819C43.9293 514.721 27.995 498.77 16.9161 479.568C5.83724 460.366 0.00339985 438.588 0 416.419L0 222.999C0.006907 200.834 5.84241 179.06 16.9211 159.861C27.9999 140.663 43.9322 124.716 63.12 113.619L230.59 16.9391C249.796 5.83984 271.587 -0.00390625 293.77 -0.00390625C315.953 -0.00390625 337.744 5.83984 356.95 16.9391L524.43 113.619C543.615 124.718 559.545 140.666 570.622 159.864C581.699 179.062 587.533 200.835 587.54 222.999ZM559.47 298.119C559.47 247.519 518.47 228.289 467.83 255.199L323.46 331.999C311.58 338.319 301.97 353.099 301.97 364.999V579.379C301.97 591.319 311.58 595.769 323.46 589.449L377.15 560.919C382.557 557.892 387.127 553.569 390.45 548.339C393.87 543.109 396 537.339 396 532.079C396 526.329 400.65 519.229 406.39 516.199L433.11 501.939C438.137 499.272 442.977 496.559 447.63 493.799L467.83 483.089C518.43 456.089 559.47 393.259 559.47 342.659V298.119Z",
529
- fill: "#D9EB1B"
530
- }
531
- )
532
- }
533
- ) }),
534
- /* @__PURE__ */ jsx("a", { href: deeplink, className: "open-app-link", children: "Open Pelican App" }),
535
- /* @__PURE__ */ jsx("p", { className: "helper-text", children: "Tap the button above to open the app and authenticate" })
536
- ] }) : config.forceQRCode && qr && state === "awaiting-pair" || !config.forceQRCode && qr && state === "awaiting-pair" ? /* @__PURE__ */ jsx("div", { className: "qr-container", children: /* @__PURE__ */ jsxs("div", { className: "qr-wrapper", children: [
537
- qr && /* @__PURE__ */ jsx("img", { src: qr, alt: "QR Code", className: "qr-image" }),
538
- !qr && /* @__PURE__ */ jsx("span", { className: "loader" })
539
- ] }) }) : /* @__PURE__ */ jsx("div", { className: "loader-container", children: /* @__PURE__ */ jsx("span", { className: "loader" }) }),
540
- !config.continuousMode && /* @__PURE__ */ jsxs("p", { className: "instruction-text", children: [
541
- "Scan barcode to",
542
- " ",
543
- config.authType === "login" ? "login" : config.authType === "signup" ? "sign up" : config.authType === "id-verification" ? "verify identity" : "authenticate"
544
- ] })
545
- ] }),
546
- state === "paired" && !successMessage && /* @__PURE__ */ jsxs("div", { className: "paired-container", children: [
547
- /* @__PURE__ */ jsx("h2", { className: "main-heading", children: "Authorize on your mobile device" }),
548
- /* @__PURE__ */ jsx("div", { className: "loader-container", children: /* @__PURE__ */ jsx("span", { className: "loader" }) }),
549
- /* @__PURE__ */ jsx("p", { className: "instruction-text", children: "Enter your passcode on your mobile device to continue" }),
550
- !config.continuousMode && /* @__PURE__ */ jsx(StoreIcons_default, {})
551
- ] })
552
- ] })
330
+ /* @__PURE__ */ jsx("h2", { className: "main-heading", children: "one sec..." }),
331
+ /* @__PURE__ */ jsx(
332
+ "span",
333
+ {
334
+ className: "loader",
335
+ style: { margin: "1rem auto", width: "252px" }
336
+ }
337
+ )
338
+ ] }) : /* @__PURE__ */ jsx("div", { className: "content-wrapper", children: state === "awaiting-pair" && !successMessage && /* @__PURE__ */ jsxs("div", { className: "unpaired-container", children: [
339
+ /* @__PURE__ */ jsx("h2", { className: "main-heading", children: "Open Pelican Vault" }),
340
+ !config.forceQRCode && deeplink ? /* @__PURE__ */ jsxs("div", { className: "mobile-auth-container", children: [
341
+ /* @__PURE__ */ jsx("div", { className: "logo-container", children: /* @__PURE__ */ jsx(
342
+ "svg",
343
+ {
344
+ width: 82,
345
+ height: 96,
346
+ viewBox: "0 0 588 640",
347
+ fill: "none",
348
+ role: "img",
349
+ "aria-label": "Pelican Logo",
350
+ children: /* @__PURE__ */ jsx(
351
+ "path",
352
+ {
353
+ d: "M357.79 383.899C357.99 372.409 367.47 358.149 379.03 352.079C391.03 345.819 400.26 350.269 400.13 362.279C399.94 373.899 390.26 388.479 378.7 394.479C367.14 400.479 357.6 395.839 357.79 383.899ZM486.16 316.459C487.06 315.809 488.55 314.069 488.55 313.459C488.74 307.009 488.67 300.689 488.67 293.909C470.15 305.979 452.21 317.719 434.27 329.469V350.379C436.01 349.219 437.5 348.249 438.98 347.279C454.66 336.999 470.41 326.779 486.16 316.459ZM482.54 400.359C470.529 418.676 454.87 434.318 436.54 446.309C420.21 457.209 404.54 463.019 389.94 462.699C374.94 462.309 364.84 455.339 358.94 441.919C364.62 437.009 369.72 432.489 374.82 428.039C377.02 431.039 378.76 434.169 381.21 436.429C391.02 445.659 405.15 445.009 422.21 437.139C424.21 436.139 426.14 435.079 428.14 433.979C436.34 429.459 440.53 424.229 442.6 414.979C444.28 407.299 445.31 399.869 446.66 392.259C448.387 382.382 451.533 372.806 456 363.829C461.23 353.309 468.59 345.369 478.08 341.629C486.53 338.269 491.95 340.629 494.66 347.049C500.81 361.889 495.64 380.279 482.54 400.359ZM478.87 362.999C478.35 361.509 476.73 359.999 475.32 360.419C473.91 360.839 471.64 363.899 470.41 365.969C469.016 368.283 467.953 370.781 467.25 373.389C464.67 384.619 462.25 395.779 459.76 406.949C460.192 406.935 460.623 406.892 461.05 406.819C467.51 399.399 473.05 391.519 476.73 382.749C479.9 375.119 480.54 368.539 478.87 362.999ZM587.54 222.999V416.419C587.537 438.587 581.704 460.364 570.627 479.566C559.55 498.767 543.618 514.719 524.43 525.819L357 622.489C337.794 633.588 316.003 639.432 293.82 639.432C271.637 639.432 249.846 633.588 230.64 622.489L63.12 525.819C43.9293 514.721 27.995 498.77 16.9161 479.568C5.83724 460.366 0.00339985 438.588 0 416.419L0 222.999C0.006907 200.834 5.84241 179.06 16.9211 159.861C27.9999 140.663 43.9322 124.716 63.12 113.619L230.59 16.9391C249.796 5.83984 271.587 -0.00390625 293.77 -0.00390625C315.953 -0.00390625 337.744 5.83984 356.95 16.9391L524.43 113.619C543.615 124.718 559.545 140.666 570.622 159.864C581.699 179.062 587.533 200.835 587.54 222.999ZM559.47 298.119C559.47 247.519 518.47 228.289 467.83 255.199L323.46 331.999C311.58 338.319 301.97 353.099 301.97 364.999V579.379C301.97 591.319 311.58 595.769 323.46 589.449L377.15 560.919C382.557 557.892 387.127 553.569 390.45 548.339C393.87 543.109 396 537.339 396 532.079C396 526.329 400.65 519.229 406.39 516.199L433.11 501.939C438.137 499.272 442.977 496.559 447.63 493.799L467.83 483.089C518.43 456.089 559.47 393.259 559.47 342.659V298.119Z",
354
+ fill: "#D9EB1B"
355
+ }
356
+ )
357
+ }
358
+ ) }),
359
+ /* @__PURE__ */ jsx("a", { href: deeplink, className: "open-app-link", children: "Open Pelican App" }),
360
+ /* @__PURE__ */ jsx("p", { className: "helper-text", children: "Tap the button above to open the app and authenticate" })
361
+ ] }) : config.forceQRCode && qr && state === "awaiting-pair" || !config.forceQRCode && qr && state === "awaiting-pair" ? /* @__PURE__ */ jsx("div", { className: "qr-container", children: /* @__PURE__ */ jsxs("div", { className: "qr-wrapper", children: [
362
+ qr && /* @__PURE__ */ jsx("img", { src: qr, alt: "QR Code", className: "qr-image" }),
363
+ !qr && /* @__PURE__ */ jsx("span", { className: "loader" })
364
+ ] }) }) : /* @__PURE__ */ jsx("div", { className: "loader-container", children: /* @__PURE__ */ jsx("span", { className: "loader" }) })
365
+ ] }) }),
366
+ /* @__PURE__ */ jsx(StoreIcons_default, {})
553
367
  ] })
554
368
  ] });
555
369
  };