flowlink-auth 2.8.1 → 2.8.2
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/SignUp.js +259 -262
- package/package.json +1 -1
- package/src/SignUp.jsx +326 -326
package/src/SignUp.jsx
CHANGED
|
@@ -258,12 +258,11 @@
|
|
|
258
258
|
// const errorBox = { marginTop: 10, color: '#ffb4b4', fontSize: 13 }
|
|
259
259
|
// const successBox = { marginTop: 10, color: '#bef264', fontSize: 13 }
|
|
260
260
|
|
|
261
|
-
// src/signup.jsx
|
|
262
261
|
// src/signup.jsx
|
|
263
262
|
'use client'
|
|
264
263
|
import React, { useState, useRef, useEffect } from 'react'
|
|
265
264
|
import Link from 'next/link'
|
|
266
|
-
import { useAuth } from './provider.js' // keep if your
|
|
265
|
+
import { useAuth } from './provider.js' // keep if your app provides it; safe to remove if not used
|
|
267
266
|
|
|
268
267
|
export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
269
268
|
const {
|
|
@@ -283,17 +282,14 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
283
282
|
const [loading, setLoading] = useState(false)
|
|
284
283
|
const [loadingOauth, setLoadingOauth] = useState({ google: false, github: false })
|
|
285
284
|
const redirectTimer = useRef(null)
|
|
286
|
-
|
|
287
|
-
// Local toast system (black background)
|
|
288
285
|
const toastId = useRef(0)
|
|
289
|
-
const [toasts, setToasts] = useState([])
|
|
286
|
+
const [toasts, setToasts] = useState([]) // local toast system (black background)
|
|
290
287
|
|
|
288
|
+
// Insert a viewport meta tag while this component is mounted to avoid pinch-zoom on mobile
|
|
291
289
|
useEffect(() => {
|
|
292
|
-
// Soft-disable pinch-zoom on mobile while this component is mounted.
|
|
293
|
-
// This inserts a viewport meta tag and removes it on unmount.
|
|
294
290
|
const meta = document.createElement('meta')
|
|
295
291
|
meta.name = 'viewport'
|
|
296
|
-
meta.content = 'width=device-width, initial-scale=1, maximum-scale=1
|
|
292
|
+
meta.content = 'width=device-width, initial-scale=1, maximum-scale=1'
|
|
297
293
|
document.head.appendChild(meta)
|
|
298
294
|
|
|
299
295
|
return () => {
|
|
@@ -303,7 +299,7 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
303
299
|
if (existing && existing.content === meta.content) {
|
|
304
300
|
document.head.removeChild(existing)
|
|
305
301
|
}
|
|
306
|
-
// clear any toast timers
|
|
302
|
+
// clear any toast timers stored on the toasts (best-effort)
|
|
307
303
|
toasts.forEach(t => {
|
|
308
304
|
if (t._timer) clearTimeout(t._timer)
|
|
309
305
|
})
|
|
@@ -311,17 +307,21 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
311
307
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
312
308
|
}, [])
|
|
313
309
|
|
|
314
|
-
//
|
|
310
|
+
// simple toast helper (auto-dismiss). type: 'success' | 'error' | 'info'
|
|
315
311
|
function showToast(type, message, ms = 5000) {
|
|
316
312
|
const id = ++toastId.current
|
|
317
313
|
const t = { id, type, message, _timer: null }
|
|
318
|
-
setToasts(prev =>
|
|
314
|
+
setToasts(prev => {
|
|
315
|
+
const next = [t, ...prev].slice(0, 6)
|
|
316
|
+
return next
|
|
317
|
+
})
|
|
319
318
|
const timer = setTimeout(() => {
|
|
320
319
|
setToasts(prev => prev.filter(x => x.id !== id))
|
|
321
320
|
}, ms)
|
|
322
321
|
t._timer = timer
|
|
323
322
|
}
|
|
324
323
|
|
|
324
|
+
// remove toast immediately
|
|
325
325
|
function removeToast(id) {
|
|
326
326
|
setToasts(prev => {
|
|
327
327
|
prev.forEach(t => {
|
|
@@ -339,7 +339,6 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
339
339
|
return null
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
-
// Prevent double submit
|
|
343
342
|
async function submit(e) {
|
|
344
343
|
e.preventDefault()
|
|
345
344
|
if (loading) return
|
|
@@ -376,8 +375,8 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
376
375
|
})
|
|
377
376
|
|
|
378
377
|
const data = await res.json().catch(async () => {
|
|
379
|
-
const
|
|
380
|
-
return { _raw:
|
|
378
|
+
const text = await res.text().catch(() => '')
|
|
379
|
+
return { _raw: text }
|
|
381
380
|
})
|
|
382
381
|
|
|
383
382
|
if (!res.ok) {
|
|
@@ -399,7 +398,6 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
399
398
|
} catch (err) {
|
|
400
399
|
const text = err?.message ?? 'Network error'
|
|
401
400
|
showToast('error', text)
|
|
402
|
-
// keep console error for integrators
|
|
403
401
|
console.error('Signup error:', err)
|
|
404
402
|
} finally {
|
|
405
403
|
setLoading(false)
|
|
@@ -420,7 +418,9 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
420
418
|
const sdkBase = baseUrl || (typeof window !== 'undefined' ? window.location.origin.replace(/\/+$/, '') : '')
|
|
421
419
|
const startUrl = `${sdkBase}/sdk/auth/start?rid=${rid}&source=${encodeURIComponent(provider)}&callbackUrl=${callbackUrl}`
|
|
422
420
|
|
|
423
|
-
if (!publishableKey)
|
|
421
|
+
if (!publishableKey) {
|
|
422
|
+
throw new Error('Missing publishable key (client side).')
|
|
423
|
+
}
|
|
424
424
|
|
|
425
425
|
const res = await fetch(startUrl, {
|
|
426
426
|
method: 'GET',
|
|
@@ -431,7 +431,7 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
431
431
|
if (!res.ok) throw new Error(data?.error || `OAuth start failed (${res.status})`)
|
|
432
432
|
if (!data?.oauthUrl) throw new Error('SDK start did not return oauthUrl')
|
|
433
433
|
|
|
434
|
-
//
|
|
434
|
+
// navigate away to provider
|
|
435
435
|
if (typeof window !== 'undefined') window.location.href = data.oauthUrl
|
|
436
436
|
} catch (err) {
|
|
437
437
|
showToast('error', err?.message || 'OAuth start failed')
|
|
@@ -451,51 +451,51 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
return (
|
|
454
|
-
<div style={
|
|
455
|
-
{/*
|
|
456
|
-
<div style={
|
|
454
|
+
<div style={overlay}>
|
|
455
|
+
{/* toast container (custom black toasts) */}
|
|
456
|
+
<div style={toastContainer} aria-live="polite" aria-atomic="true">
|
|
457
457
|
{toasts.map(t => (
|
|
458
458
|
<div
|
|
459
459
|
key={t.id}
|
|
460
460
|
role="status"
|
|
461
|
+
aria-live="polite"
|
|
461
462
|
style={{
|
|
462
|
-
...
|
|
463
|
-
...(t.type === 'error' ?
|
|
463
|
+
...toastBase,
|
|
464
|
+
...(t.type === 'error' ? toastError : t.type === 'success' ? toastSuccess : toastInfo)
|
|
464
465
|
}}
|
|
465
466
|
onMouseEnter={() => {
|
|
466
467
|
if (t._timer) clearTimeout(t._timer)
|
|
467
468
|
}}
|
|
468
469
|
onMouseLeave={() => {
|
|
469
|
-
// restart auto-dismiss shorter when mouse leaves
|
|
470
470
|
const timer = setTimeout(() => removeToast(t.id), 3000)
|
|
471
471
|
setToasts(prev => prev.map(x => x.id === t.id ? { ...x, _timer: timer } : x))
|
|
472
472
|
}}
|
|
473
473
|
>
|
|
474
474
|
<div style={{ flex: 1 }}>{t.message}</div>
|
|
475
|
-
<button aria-label="Dismiss" onClick={() => removeToast(t.id)} style={
|
|
475
|
+
<button aria-label="Dismiss" onClick={() => removeToast(t.id)} style={toastCloseBtn}>✕</button>
|
|
476
476
|
</div>
|
|
477
477
|
))}
|
|
478
478
|
</div>
|
|
479
479
|
|
|
480
|
-
<div style={
|
|
481
|
-
<div style={
|
|
482
|
-
<header style={
|
|
483
|
-
<div style={
|
|
484
|
-
<div style={
|
|
485
|
-
<div style={
|
|
480
|
+
<div style={modal}>
|
|
481
|
+
<div style={modalInner}>
|
|
482
|
+
<header style={header}>
|
|
483
|
+
<div style={brandRow}>
|
|
484
|
+
<div style={logo}>
|
|
485
|
+
<div style={logoCircle} aria-hidden />
|
|
486
486
|
</div>
|
|
487
487
|
<div>
|
|
488
|
-
<h1
|
|
489
|
-
<div style={
|
|
488
|
+
<h1 style={title}>Sign up to {agency?.name || 'App'}</h1>
|
|
489
|
+
<div style={subtitle}>Welcome! Create your account.</div>
|
|
490
490
|
</div>
|
|
491
491
|
</div>
|
|
492
492
|
</header>
|
|
493
493
|
|
|
494
|
-
<section style={
|
|
494
|
+
<section style={oauthSection}>
|
|
495
495
|
<button
|
|
496
496
|
onClick={handleGoogle}
|
|
497
497
|
type="button"
|
|
498
|
-
style={{ ...
|
|
498
|
+
style={{ ...oauthButton, ...oauthGoogle }}
|
|
499
499
|
disabled={loading || loadingOauth.google}
|
|
500
500
|
aria-disabled={loading || loadingOauth.google}
|
|
501
501
|
>
|
|
@@ -511,7 +511,7 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
511
511
|
<button
|
|
512
512
|
onClick={handleGithub}
|
|
513
513
|
type="button"
|
|
514
|
-
style={{ ...
|
|
514
|
+
style={{ ...oauthButton, ...oauthGithub }}
|
|
515
515
|
disabled={loading || loadingOauth.github}
|
|
516
516
|
aria-disabled={loading || loadingOauth.github}
|
|
517
517
|
>
|
|
@@ -522,28 +522,28 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
522
522
|
</button>
|
|
523
523
|
</section>
|
|
524
524
|
|
|
525
|
-
<div style={
|
|
526
|
-
<div style={
|
|
527
|
-
<div style={
|
|
528
|
-
<div style={
|
|
525
|
+
<div style={dividerRow}>
|
|
526
|
+
<div style={line} />
|
|
527
|
+
<div style={orText}>or</div>
|
|
528
|
+
<div style={line} />
|
|
529
529
|
</div>
|
|
530
530
|
|
|
531
|
-
<form onSubmit={submit} style={
|
|
532
|
-
<label style={
|
|
533
|
-
<span style={
|
|
531
|
+
<form onSubmit={submit} style={form}>
|
|
532
|
+
<label style={label} htmlFor="name">
|
|
533
|
+
<span style={labelText}>Name</span>
|
|
534
534
|
<input
|
|
535
535
|
id="name"
|
|
536
536
|
type="text"
|
|
537
537
|
value={name}
|
|
538
538
|
onChange={e => setName(e.target.value)}
|
|
539
539
|
placeholder="Your name"
|
|
540
|
-
style={
|
|
540
|
+
style={input}
|
|
541
541
|
autoComplete="name"
|
|
542
542
|
/>
|
|
543
543
|
</label>
|
|
544
544
|
|
|
545
|
-
<label style={
|
|
546
|
-
<span style={
|
|
545
|
+
<label style={label} htmlFor="email">
|
|
546
|
+
<span style={labelText}>Email address</span>
|
|
547
547
|
<input
|
|
548
548
|
id="email"
|
|
549
549
|
type="email"
|
|
@@ -551,13 +551,13 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
551
551
|
onChange={e => setEmail(e.target.value)}
|
|
552
552
|
required
|
|
553
553
|
placeholder="you@example.com"
|
|
554
|
-
style={
|
|
554
|
+
style={input}
|
|
555
555
|
autoComplete="email"
|
|
556
556
|
/>
|
|
557
557
|
</label>
|
|
558
558
|
|
|
559
|
-
<label style={
|
|
560
|
-
<span style={
|
|
559
|
+
<label style={label} htmlFor="password">
|
|
560
|
+
<span style={labelText}>Password</span>
|
|
561
561
|
<input
|
|
562
562
|
id="password"
|
|
563
563
|
type="password"
|
|
@@ -565,14 +565,14 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
565
565
|
onChange={e => setPassword(e.target.value)}
|
|
566
566
|
required
|
|
567
567
|
placeholder="••••••••"
|
|
568
|
-
style={
|
|
568
|
+
style={input}
|
|
569
569
|
autoComplete="new-password"
|
|
570
570
|
/>
|
|
571
571
|
</label>
|
|
572
572
|
|
|
573
573
|
<button
|
|
574
574
|
type="submit"
|
|
575
|
-
style={
|
|
575
|
+
style={submitButton}
|
|
576
576
|
disabled={loading}
|
|
577
577
|
aria-disabled={loading}
|
|
578
578
|
>
|
|
@@ -581,14 +581,14 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
581
581
|
</form>
|
|
582
582
|
</div>
|
|
583
583
|
|
|
584
|
-
<div style={
|
|
585
|
-
<div style={
|
|
586
|
-
<span style={
|
|
587
|
-
<Link href="/sign-in" style={
|
|
584
|
+
<div style={modalFooter}>
|
|
585
|
+
<div style={belowRow}>
|
|
586
|
+
<span style={muted}>Already have an account? </span>
|
|
587
|
+
<Link href="/sign-in" style={link}>Sign in</Link>
|
|
588
588
|
</div>
|
|
589
|
-
<div style={
|
|
590
|
-
<div style={
|
|
591
|
-
<div style={
|
|
589
|
+
<div style={dividerThin} />
|
|
590
|
+
<div style={secured}>
|
|
591
|
+
<div style={securedText}>Secured by auth</div>
|
|
592
592
|
</div>
|
|
593
593
|
</div>
|
|
594
594
|
</div>
|
|
@@ -596,273 +596,273 @@ export default function SignUp({ agency = { name: 'MyApp', logo: '' } }) {
|
|
|
596
596
|
)
|
|
597
597
|
}
|
|
598
598
|
|
|
599
|
-
/*
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
599
|
+
/* styles (JS objects) - neutral palette, translucent overlay so underlying content shows */
|
|
600
|
+
const overlay = {
|
|
601
|
+
position: 'fixed',
|
|
602
|
+
inset: 0,
|
|
603
|
+
display: 'block', // page scroll model
|
|
604
|
+
padding: 20,
|
|
605
|
+
background: 'linear-gradient(180deg, rgba(2,6,23,0.22), rgba(2,6,23,0.32))',
|
|
606
|
+
backdropFilter: 'blur(6px)',
|
|
607
|
+
overflowY: 'auto',
|
|
608
|
+
WebkitOverflowScrolling: 'touch',
|
|
609
|
+
minHeight: '100vh',
|
|
610
|
+
zIndex: 9999
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
const modal = {
|
|
614
|
+
width: '100%',
|
|
615
|
+
maxWidth: 460, // reduced width per request
|
|
616
|
+
margin: '40px auto',
|
|
617
|
+
borderRadius: 14,
|
|
618
|
+
background: 'linear-gradient(180deg, rgba(15,19,24,0.6), rgba(10,12,16,0.6))',
|
|
619
|
+
border: '1px solid rgba(99,102,106,0.12)',
|
|
620
|
+
boxShadow: '0 20px 50px rgba(2,6,23,0.55), inset 0 1px 0 rgba(255,255,255,0.02)',
|
|
621
|
+
overflow: 'hidden',
|
|
622
|
+
display: 'flex',
|
|
623
|
+
flexDirection: 'column',
|
|
624
|
+
maxHeight: 'calc(100vh - 80px)'
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
const modalInner = {
|
|
628
|
+
padding: 18,
|
|
629
|
+
display: 'flex',
|
|
630
|
+
flexDirection: 'column',
|
|
631
|
+
gap: 12,
|
|
632
|
+
overflowY: 'auto'
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/* header / brand */
|
|
636
|
+
const header = {
|
|
637
|
+
paddingBottom: 6,
|
|
638
|
+
borderBottom: '1px solid rgba(148,163,184,0.04)'
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
const brandRow = {
|
|
642
|
+
display: 'flex',
|
|
643
|
+
alignItems: 'center',
|
|
644
|
+
gap: 12
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
const logo = {
|
|
648
|
+
width: 44,
|
|
649
|
+
height: 44,
|
|
650
|
+
display: 'flex',
|
|
651
|
+
alignItems: 'center',
|
|
652
|
+
justifyContent: 'center'
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
const logoCircle = {
|
|
656
|
+
width: 36,
|
|
657
|
+
height: 36,
|
|
658
|
+
borderRadius: 999,
|
|
659
|
+
background: 'linear-gradient(135deg,#2f3438,#11151a)',
|
|
660
|
+
boxShadow: '0 4px 12px rgba(2,6,23,0.6)'
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
const title = {
|
|
664
|
+
margin: 0,
|
|
665
|
+
fontSize: 18,
|
|
666
|
+
fontWeight: 600,
|
|
667
|
+
color: '#e6e6e6'
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
const subtitle = {
|
|
671
|
+
fontSize: 13,
|
|
672
|
+
color: 'rgba(230,230,230,0.72)',
|
|
673
|
+
marginTop: 4
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/* oauth row */
|
|
677
|
+
const oauthSection = {
|
|
678
|
+
marginTop: 8,
|
|
679
|
+
display: 'flex',
|
|
680
|
+
gap: 8
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
const oauthButton = {
|
|
684
|
+
flex: 1,
|
|
685
|
+
display: 'inline-flex',
|
|
686
|
+
alignItems: 'center',
|
|
687
|
+
justifyContent: 'center',
|
|
688
|
+
padding: '10px 12px',
|
|
689
|
+
borderRadius: 10,
|
|
690
|
+
border: '1px solid rgba(148,163,184,0.08)',
|
|
691
|
+
fontSize: 14,
|
|
692
|
+
cursor: 'pointer',
|
|
693
|
+
userSelect: 'none',
|
|
694
|
+
gap: 8,
|
|
695
|
+
minHeight: 40
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
const oauthGoogle = {
|
|
699
|
+
background: 'linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01))',
|
|
700
|
+
color: '#fff'
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
const oauthGithub = {
|
|
704
|
+
background: 'linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00))',
|
|
705
|
+
color: '#fff'
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/* divider row */
|
|
709
|
+
const dividerRow = {
|
|
710
|
+
display: 'flex',
|
|
711
|
+
alignItems: 'center',
|
|
712
|
+
gap: 10,
|
|
713
|
+
marginTop: 12
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
const line = {
|
|
717
|
+
flex: 1,
|
|
718
|
+
height: 1,
|
|
719
|
+
background: 'rgba(148,163,184,0.06)'
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
const orText = {
|
|
723
|
+
fontSize: 13,
|
|
724
|
+
color: 'rgba(230,230,230,0.65)',
|
|
725
|
+
padding: '0 8px'
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
/* form */
|
|
729
|
+
const form = {
|
|
730
|
+
display: 'flex',
|
|
731
|
+
flexDirection: 'column',
|
|
732
|
+
gap: 10,
|
|
733
|
+
marginTop: 6
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
const label = {
|
|
737
|
+
display: 'flex',
|
|
738
|
+
flexDirection: 'column',
|
|
739
|
+
gap: 6
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
const labelText = {
|
|
743
|
+
fontSize: 13,
|
|
744
|
+
color: 'rgba(230,230,230,0.68)'
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
const input = {
|
|
748
|
+
width: '100%',
|
|
749
|
+
padding: '10px 12px',
|
|
750
|
+
borderRadius: 10,
|
|
751
|
+
background: 'rgba(255,255,255,0.02)',
|
|
752
|
+
color: '#e6e6e6',
|
|
753
|
+
border: '1px solid rgba(148,163,184,0.10)',
|
|
754
|
+
fontSize: 14,
|
|
755
|
+
outline: 'none',
|
|
756
|
+
boxSizing: 'border-box',
|
|
757
|
+
transition: 'box-shadow 120ms, border-color 120ms'
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
const submitButton = {
|
|
761
|
+
marginTop: 6,
|
|
762
|
+
width: '100%',
|
|
763
|
+
padding: '10px 12px',
|
|
764
|
+
borderRadius: 10,
|
|
765
|
+
background: 'linear-gradient(180deg,#475569,#94a3b8)',
|
|
766
|
+
border: 'none',
|
|
767
|
+
color: '#fff',
|
|
768
|
+
fontWeight: 600,
|
|
769
|
+
cursor: 'pointer',
|
|
770
|
+
fontSize: 15,
|
|
771
|
+
display: 'inline-flex',
|
|
772
|
+
alignItems: 'center',
|
|
773
|
+
justifyContent: 'center',
|
|
774
|
+
minHeight: 44
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
/* modal footer */
|
|
778
|
+
const modalFooter = {
|
|
779
|
+
padding: '12px 18px 18px 18px',
|
|
780
|
+
borderTop: '1px solid rgba(148,163,184,0.03)',
|
|
781
|
+
display: 'flex',
|
|
782
|
+
flexDirection: 'column',
|
|
783
|
+
gap: 8
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
const belowRow = {
|
|
787
|
+
textAlign: 'center',
|
|
788
|
+
display: 'flex',
|
|
789
|
+
justifyContent: 'center',
|
|
790
|
+
gap: 8,
|
|
791
|
+
alignItems: 'center'
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
const muted = {
|
|
795
|
+
color: 'rgba(230,230,230,0.66)',
|
|
796
|
+
fontSize: 13
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
const link = {
|
|
800
|
+
color: '#9fb0d9',
|
|
801
|
+
textDecoration: 'none',
|
|
802
|
+
fontWeight: 600
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
const dividerThin = {
|
|
806
|
+
height: 1,
|
|
807
|
+
background: 'rgba(148,163,184,0.04)',
|
|
808
|
+
marginTop: 6,
|
|
809
|
+
marginBottom: 6
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
const secured = {
|
|
813
|
+
textAlign: 'center'
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
const securedText = {
|
|
817
|
+
color: 'rgba(230,230,230,0.9)',
|
|
818
|
+
fontSize: 13,
|
|
819
|
+
fontWeight: 600
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/* toasts - black background as requested */
|
|
823
|
+
const toastContainer = {
|
|
824
|
+
position: 'fixed',
|
|
825
|
+
top: 18,
|
|
826
|
+
right: 18,
|
|
827
|
+
width: 360,
|
|
828
|
+
maxWidth: 'calc(100% - 36px)',
|
|
829
|
+
display: 'flex',
|
|
830
|
+
flexDirection: 'column',
|
|
831
|
+
gap: 10,
|
|
832
|
+
zIndex: 60000
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
const toastBase = {
|
|
836
|
+
display: 'flex',
|
|
837
|
+
gap: 10,
|
|
838
|
+
alignItems: 'center',
|
|
839
|
+
padding: '10px 12px',
|
|
840
|
+
borderRadius: 10,
|
|
841
|
+
boxShadow: '0 8px 20px rgba(2,6,23,0.6)',
|
|
842
|
+
color: '#fff',
|
|
843
|
+
fontSize: 13,
|
|
844
|
+
minWidth: 120
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
const toastError = {
|
|
848
|
+
background: '#000000',
|
|
849
|
+
border: '1px solid rgba(255,255,255,0.06)'
|
|
850
|
+
}
|
|
851
|
+
const toastSuccess = {
|
|
852
|
+
background: '#000000',
|
|
853
|
+
border: '1px solid rgba(255,255,255,0.06)'
|
|
854
|
+
}
|
|
855
|
+
const toastInfo = {
|
|
856
|
+
background: '#000000',
|
|
857
|
+
border: '1px solid rgba(255,255,255,0.06)'
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
const toastCloseBtn = {
|
|
861
|
+
marginLeft: 8,
|
|
862
|
+
background: 'transparent',
|
|
863
|
+
border: 'none',
|
|
864
|
+
color: 'rgba(255,255,255,0.7)',
|
|
865
|
+
cursor: 'pointer',
|
|
866
|
+
fontSize: 14,
|
|
867
|
+
lineHeight: 1
|
|
868
868
|
}
|