@redzone/taunt-logins-ui-react 0.0.11 → 0.0.13
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/cjs/cc-D-353NYd.cjs +63 -0
- package/dist/cjs/index.cjs +647 -0
- package/dist/cjs/index.d.cts +112 -0
- package/dist/es/cc-D6TRVNtd.js +61 -0
- package/dist/es/index.d.ts +112 -0
- package/dist/es/index.js +636 -0
- package/dist/styling.css +239 -0
- package/package.json +40 -34
- package/README.md +0 -73
- package/dist/LoadingView.d.ts +0 -1
- package/dist/LoginUIComplete.d.ts +0 -6
- package/dist/LoginView.d.ts +0 -41
- package/dist/ModalView.d.ts +0 -7
- package/dist/assets/fonts/DrukTextWide-Bold-Trial.otf +0 -0
- package/dist/coinbase.d.ts +0 -5
- package/dist/index.d.ts +0 -11
- package/dist/magic.d.ts +0 -4
- package/dist/meta.d.ts +0 -5
- package/dist/metamask.d.ts +0 -5
- package/dist/taunt-logins-ui-react.d.ts +0 -2
- package/dist/taunt-logins-ui-react.js +0 -3639
- package/dist/taunt-logins-ui-react.js.map +0 -1
- package/dist/taunt-logins-ui-react.umd.cjs +0 -13
- package/dist/taunt-logins-ui-react.umd.cjs.map +0 -1
- package/dist/tauntContext.d.ts +0 -18
- package/dist/tauntProvider.d.ts +0 -5
- package/dist/telegram.d.ts +0 -5
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
|
|
4
|
+
interface CoinbaseButtonProps {
|
|
5
|
+
openCoinbase?: () => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const CoinbaseButton: ({ openCoinbase, disabled }: CoinbaseButtonProps) => react_jsx_runtime.JSX.Element;
|
|
9
|
+
|
|
10
|
+
declare function LoadingView(): react_jsx_runtime.JSX.Element;
|
|
11
|
+
|
|
12
|
+
type MagicEmailProps = {
|
|
13
|
+
onEmail?: (email: string) => void;
|
|
14
|
+
};
|
|
15
|
+
declare const MagicEmailInput: ({ onEmail }: MagicEmailProps) => react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
interface MetaButtonProps {
|
|
18
|
+
openMeta?: () => void;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
declare const MetaButton: ({ openMeta, disabled }: MetaButtonProps) => react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
interface MetaMaskButtonProps {
|
|
24
|
+
openMetamask?: () => void;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
}
|
|
27
|
+
declare const MetaMaskButton: ({ openMetamask, disabled }: MetaMaskButtonProps) => react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
interface TelegramButtonProps {
|
|
30
|
+
openTelegram?: () => void;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare const TelegramButton: ({ openTelegram, disabled }: TelegramButtonProps) => react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
type LoginProvider = "email" | "metamask" | "telegram" | "meta" | "coinbase";
|
|
36
|
+
interface LoginComponentProps {
|
|
37
|
+
/** Array of login providers to display. If not provided, shows all providers */
|
|
38
|
+
providers?: LoginProvider[];
|
|
39
|
+
/** Whether to show the email/magic link login */
|
|
40
|
+
showEmail?: boolean;
|
|
41
|
+
/** If true, show all providers but disable unsupported ones. If false, hide unsupported providers */
|
|
42
|
+
showDisabled?: boolean;
|
|
43
|
+
/** Custom text for the divider between email and social logins */
|
|
44
|
+
dividerText?: string;
|
|
45
|
+
/** Gap between provider buttons in pixels */
|
|
46
|
+
providerGap?: number;
|
|
47
|
+
/** Whether to show terms and privacy links (default: false) */
|
|
48
|
+
showTerms?: boolean;
|
|
49
|
+
/** Terms of Service text content (if provided, will show in built-in modal) */
|
|
50
|
+
termsContent?: string;
|
|
51
|
+
/** Privacy Policy text content (if provided, will show in built-in modal) */
|
|
52
|
+
privacyContent?: string;
|
|
53
|
+
/** Custom terms of service click handler (use if you want custom modal handling) */
|
|
54
|
+
onTermsClick?: () => void;
|
|
55
|
+
/** Custom privacy policy click handler (use if you want custom modal handling) */
|
|
56
|
+
onPrivacyClick?: () => void;
|
|
57
|
+
/** Custom modal component to use for displaying terms/privacy (optional) */
|
|
58
|
+
ModalComponent?: React.ComponentType<{
|
|
59
|
+
title: string;
|
|
60
|
+
content: string;
|
|
61
|
+
onClose: () => void;
|
|
62
|
+
}>;
|
|
63
|
+
/** Callback when email is entered (for custom handling) */
|
|
64
|
+
magicEmailProps?: MagicEmailProps;
|
|
65
|
+
coinbaseProps?: CoinbaseButtonProps;
|
|
66
|
+
metamaskProps?: MetaMaskButtonProps;
|
|
67
|
+
metaProps?: MetaButtonProps;
|
|
68
|
+
telegramProps?: TelegramButtonProps;
|
|
69
|
+
}
|
|
70
|
+
declare const LoginView: ({ providers, showEmail, showDisabled, dividerText, providerGap, showTerms, termsContent, privacyContent, onTermsClick, onPrivacyClick, ModalComponent, magicEmailProps, coinbaseProps, metamaskProps, metaProps, telegramProps }: LoginComponentProps) => react_jsx_runtime.JSX.Element;
|
|
71
|
+
|
|
72
|
+
type LoginUICompleteProps = LoginComponentProps & {
|
|
73
|
+
className?: string;
|
|
74
|
+
extLoading?: boolean;
|
|
75
|
+
};
|
|
76
|
+
declare const LoginUIComplete: ({ className, extLoading, ...loginProps }: LoginUICompleteProps) => react_jsx_runtime.JSX.Element;
|
|
77
|
+
|
|
78
|
+
interface ModalProps {
|
|
79
|
+
title: string;
|
|
80
|
+
content: string;
|
|
81
|
+
onClose: () => void;
|
|
82
|
+
}
|
|
83
|
+
declare function ModalView({ title, content, onClose }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
84
|
+
|
|
85
|
+
type ContextProps = {
|
|
86
|
+
tauntServiceEndpoint: string;
|
|
87
|
+
loggedIn: boolean;
|
|
88
|
+
deets?: {
|
|
89
|
+
accessToken: string;
|
|
90
|
+
refreshToken: string;
|
|
91
|
+
};
|
|
92
|
+
isLoading: boolean;
|
|
93
|
+
metamaskLogin: () => void;
|
|
94
|
+
otpMagicLogin: (email: string) => void;
|
|
95
|
+
telegramLogin: () => void;
|
|
96
|
+
metaLogin: () => void;
|
|
97
|
+
coinbaseLogin: () => void;
|
|
98
|
+
getClaimrToken: () => Promise<string | undefined>;
|
|
99
|
+
refreshToken: (token: string) => Promise<void>;
|
|
100
|
+
logout: () => void;
|
|
101
|
+
};
|
|
102
|
+
declare const TauntContext: react.Context<ContextProps>;
|
|
103
|
+
declare function useTaunt(): ContextProps;
|
|
104
|
+
|
|
105
|
+
declare const TauntProvider: ({ children, tauntServiceEndpoint, magicKey }: {
|
|
106
|
+
children: React.ReactNode;
|
|
107
|
+
tauntServiceEndpoint?: string;
|
|
108
|
+
magicKey?: string;
|
|
109
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
110
|
+
|
|
111
|
+
export { CoinbaseButton, LoadingView, LoginUIComplete, LoginView, MagicEmailInput, MetaButton, MetaMaskButton, ModalView, TauntContext, TauntProvider, TelegramButton, useTaunt };
|
|
112
|
+
export type { CoinbaseButtonProps, LoginComponentProps, LoginProvider, MagicEmailProps, MetaButtonProps, MetaMaskButtonProps, TelegramButtonProps };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
function __insertCSS(code) {
|
|
2
|
+
if (!code || typeof document == 'undefined') return
|
|
3
|
+
let head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
let style = document.createElement('style')
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
head.appendChild(style)
|
|
7
|
+
;style.styleSheet ? (style.styleSheet.cssText = code) : style.appendChild(document.createTextNode(code))
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function _extends() {
|
|
11
|
+
_extends = Object.assign || function assign(target) {
|
|
12
|
+
for(var i = 1; i < arguments.length; i++){
|
|
13
|
+
var source = arguments[i];
|
|
14
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
15
|
+
}
|
|
16
|
+
return target;
|
|
17
|
+
};
|
|
18
|
+
return _extends.apply(this, arguments);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function _object_without_properties_loose(source, excluded) {
|
|
22
|
+
if (source == null) return {};
|
|
23
|
+
var target = {};
|
|
24
|
+
var sourceKeys = Object.keys(source);
|
|
25
|
+
var key, i;
|
|
26
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
27
|
+
key = sourceKeys[i];
|
|
28
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
29
|
+
target[key] = source[key];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
35
|
+
try {
|
|
36
|
+
var info = gen[key](arg);
|
|
37
|
+
var value = info.value;
|
|
38
|
+
} catch (error) {
|
|
39
|
+
reject(error);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (info.done) resolve(value);
|
|
43
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
44
|
+
}
|
|
45
|
+
function _async_to_generator(fn) {
|
|
46
|
+
return function() {
|
|
47
|
+
var self = this, args = arguments;
|
|
48
|
+
return new Promise(function(resolve, reject) {
|
|
49
|
+
var gen = fn.apply(self, args);
|
|
50
|
+
function _next(value) {
|
|
51
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
52
|
+
}
|
|
53
|
+
function _throw(err) {
|
|
54
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
55
|
+
}
|
|
56
|
+
_next(undefined);
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { _async_to_generator as _, _extends as a, _object_without_properties_loose as b };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
|
|
4
|
+
interface CoinbaseButtonProps {
|
|
5
|
+
openCoinbase?: () => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const CoinbaseButton: ({ openCoinbase, disabled }: CoinbaseButtonProps) => react_jsx_runtime.JSX.Element;
|
|
9
|
+
|
|
10
|
+
declare function LoadingView(): react_jsx_runtime.JSX.Element;
|
|
11
|
+
|
|
12
|
+
type MagicEmailProps = {
|
|
13
|
+
onEmail?: (email: string) => void;
|
|
14
|
+
};
|
|
15
|
+
declare const MagicEmailInput: ({ onEmail }: MagicEmailProps) => react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
interface MetaButtonProps {
|
|
18
|
+
openMeta?: () => void;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
declare const MetaButton: ({ openMeta, disabled }: MetaButtonProps) => react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
interface MetaMaskButtonProps {
|
|
24
|
+
openMetamask?: () => void;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
}
|
|
27
|
+
declare const MetaMaskButton: ({ openMetamask, disabled }: MetaMaskButtonProps) => react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
interface TelegramButtonProps {
|
|
30
|
+
openTelegram?: () => void;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare const TelegramButton: ({ openTelegram, disabled }: TelegramButtonProps) => react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
type LoginProvider = "email" | "metamask" | "telegram" | "meta" | "coinbase";
|
|
36
|
+
interface LoginComponentProps {
|
|
37
|
+
/** Array of login providers to display. If not provided, shows all providers */
|
|
38
|
+
providers?: LoginProvider[];
|
|
39
|
+
/** Whether to show the email/magic link login */
|
|
40
|
+
showEmail?: boolean;
|
|
41
|
+
/** If true, show all providers but disable unsupported ones. If false, hide unsupported providers */
|
|
42
|
+
showDisabled?: boolean;
|
|
43
|
+
/** Custom text for the divider between email and social logins */
|
|
44
|
+
dividerText?: string;
|
|
45
|
+
/** Gap between provider buttons in pixels */
|
|
46
|
+
providerGap?: number;
|
|
47
|
+
/** Whether to show terms and privacy links (default: false) */
|
|
48
|
+
showTerms?: boolean;
|
|
49
|
+
/** Terms of Service text content (if provided, will show in built-in modal) */
|
|
50
|
+
termsContent?: string;
|
|
51
|
+
/** Privacy Policy text content (if provided, will show in built-in modal) */
|
|
52
|
+
privacyContent?: string;
|
|
53
|
+
/** Custom terms of service click handler (use if you want custom modal handling) */
|
|
54
|
+
onTermsClick?: () => void;
|
|
55
|
+
/** Custom privacy policy click handler (use if you want custom modal handling) */
|
|
56
|
+
onPrivacyClick?: () => void;
|
|
57
|
+
/** Custom modal component to use for displaying terms/privacy (optional) */
|
|
58
|
+
ModalComponent?: React.ComponentType<{
|
|
59
|
+
title: string;
|
|
60
|
+
content: string;
|
|
61
|
+
onClose: () => void;
|
|
62
|
+
}>;
|
|
63
|
+
/** Callback when email is entered (for custom handling) */
|
|
64
|
+
magicEmailProps?: MagicEmailProps;
|
|
65
|
+
coinbaseProps?: CoinbaseButtonProps;
|
|
66
|
+
metamaskProps?: MetaMaskButtonProps;
|
|
67
|
+
metaProps?: MetaButtonProps;
|
|
68
|
+
telegramProps?: TelegramButtonProps;
|
|
69
|
+
}
|
|
70
|
+
declare const LoginView: ({ providers, showEmail, showDisabled, dividerText, providerGap, showTerms, termsContent, privacyContent, onTermsClick, onPrivacyClick, ModalComponent, magicEmailProps, coinbaseProps, metamaskProps, metaProps, telegramProps }: LoginComponentProps) => react_jsx_runtime.JSX.Element;
|
|
71
|
+
|
|
72
|
+
type LoginUICompleteProps = LoginComponentProps & {
|
|
73
|
+
className?: string;
|
|
74
|
+
extLoading?: boolean;
|
|
75
|
+
};
|
|
76
|
+
declare const LoginUIComplete: ({ className, extLoading, ...loginProps }: LoginUICompleteProps) => react_jsx_runtime.JSX.Element;
|
|
77
|
+
|
|
78
|
+
interface ModalProps {
|
|
79
|
+
title: string;
|
|
80
|
+
content: string;
|
|
81
|
+
onClose: () => void;
|
|
82
|
+
}
|
|
83
|
+
declare function ModalView({ title, content, onClose }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
84
|
+
|
|
85
|
+
type ContextProps = {
|
|
86
|
+
tauntServiceEndpoint: string;
|
|
87
|
+
loggedIn: boolean;
|
|
88
|
+
deets?: {
|
|
89
|
+
accessToken: string;
|
|
90
|
+
refreshToken: string;
|
|
91
|
+
};
|
|
92
|
+
isLoading: boolean;
|
|
93
|
+
metamaskLogin: () => void;
|
|
94
|
+
otpMagicLogin: (email: string) => void;
|
|
95
|
+
telegramLogin: () => void;
|
|
96
|
+
metaLogin: () => void;
|
|
97
|
+
coinbaseLogin: () => void;
|
|
98
|
+
getClaimrToken: () => Promise<string | undefined>;
|
|
99
|
+
refreshToken: (token: string) => Promise<void>;
|
|
100
|
+
logout: () => void;
|
|
101
|
+
};
|
|
102
|
+
declare const TauntContext: react.Context<ContextProps>;
|
|
103
|
+
declare function useTaunt(): ContextProps;
|
|
104
|
+
|
|
105
|
+
declare const TauntProvider: ({ children, tauntServiceEndpoint, magicKey }: {
|
|
106
|
+
children: React.ReactNode;
|
|
107
|
+
tauntServiceEndpoint?: string;
|
|
108
|
+
magicKey?: string;
|
|
109
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
110
|
+
|
|
111
|
+
export { CoinbaseButton, LoadingView, LoginUIComplete, LoginView, MagicEmailInput, MetaButton, MetaMaskButton, ModalView, TauntContext, TauntProvider, TelegramButton, useTaunt };
|
|
112
|
+
export type { CoinbaseButtonProps, LoginComponentProps, LoginProvider, MagicEmailProps, MetaButtonProps, MetaMaskButtonProps, TelegramButtonProps };
|