@getpara/react-common 2.0.0-alpha.6 → 2.0.0-alpha.61
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/classes/ParaInternal.d.ts +21 -6
- package/dist/classes/ParaInternal.js +17 -1
- package/dist/components/HeroSpinner.d.ts +4 -3
- package/dist/components/HeroSpinner.js +28 -14
- package/dist/components/KnownDevices.js +5 -6
- package/dist/components/MoonPayEmbed.d.ts +4 -2
- package/dist/components/MoonPayEmbed.js +56 -83
- package/dist/components/NetworkSpeedBanner.js +5 -5
- package/dist/components/QRCode.js +7 -7
- package/dist/components/RampEmbed.d.ts +2 -2
- package/dist/components/RampEmbed.js +16 -28
- package/dist/components/UserIdentifier.d.ts +8 -0
- package/dist/components/UserIdentifier.js +30 -22
- package/dist/components/WarningBanner.d.ts +7 -0
- package/dist/components/WarningBanner.js +60 -0
- package/dist/components/common.d.ts +3 -3
- package/dist/components/common.js +7 -7
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/constants/externalWalletDefaults.d.ts +47 -0
- package/dist/constants/externalWalletDefaults.js +49 -0
- package/dist/constants/oAuthLogos.d.ts +12 -0
- package/dist/constants/oAuthLogos.js +160 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useUserAgent.d.ts +2 -0
- package/dist/hooks/useUserAgent.js +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/types/commonTypes.d.ts +15 -0
- package/dist/types/commonTypes.js +1 -0
- package/dist/types/externalWalletCommon.d.ts +69 -37
- package/dist/types/externalWalletCommon.js +0 -31
- package/dist/types/index.d.ts +8 -5
- package/dist/types/index.js +1 -0
- package/dist/utils/formatBiometricHints.d.ts +1 -1
- package/dist/utils/formatBiometricHints.js +2 -2
- package/dist/utils/getExternalWalletDisplayName.d.ts +3 -1
- package/dist/utils/getExternalWalletDisplayName.js +6 -14
- package/dist/utils/getExternalWalletIcon.d.ts +5 -0
- package/dist/utils/getExternalWalletIcon.js +17 -0
- package/dist/utils/index.d.ts +17 -16
- package/dist/utils/index.js +25 -30
- package/dist/utils/safeStyled.d.ts +2 -0
- package/dist/utils/safeStyled.js +25 -0
- package/package.json +22 -24
- package/dist/components/StripeEmbed.d.ts +0 -4
- package/dist/components/StripeEmbed.js +0 -138
- package/dist/utils/offRampSend.d.ts +0 -7
- package/dist/utils/offRampSend.js +0 -75
|
@@ -1,39 +1,46 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../chunk-GOCCUU3Z.js";
|
|
3
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
import { CpslAvatar, CpslIcon, CpslText } from "@getpara/react-components";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { authType, identifier, externalWallet } = authInfo;
|
|
7
|
+
import { displayPhoneNumber, truncateAddress } from "@getpara/web-sdk";
|
|
8
|
+
import { getExternalWalletDisplayName, getExternalWalletIcon, safeStyled } from "../utils/index.js";
|
|
9
|
+
function getAuthDisplay(authInfo, { withAddress = false } = {}) {
|
|
10
|
+
var _a;
|
|
11
|
+
const { authType, displayName, identifier, pfpUrl, externalWallet } = authInfo;
|
|
10
12
|
switch (authType) {
|
|
11
13
|
case "email":
|
|
12
|
-
return {
|
|
14
|
+
return { name: identifier.toLowerCase(), icon: "mail" };
|
|
13
15
|
case "phone":
|
|
14
|
-
return {
|
|
16
|
+
return { name: displayPhoneNumber(identifier), icon: "phone" };
|
|
15
17
|
case "farcaster":
|
|
16
|
-
return {
|
|
18
|
+
return __spreadValues({ name: displayName != null ? displayName : `@${identifier}` }, pfpUrl ? { src: pfpUrl } : { icon: "farcasterBrand" });
|
|
17
19
|
case "telegram":
|
|
18
|
-
return {
|
|
20
|
+
return __spreadValues({
|
|
21
|
+
name: displayName != null ? displayName : `Telegram User @${identifier}`
|
|
22
|
+
}, pfpUrl ? { src: pfpUrl } : { icon: "telegramBrand" });
|
|
19
23
|
case "externalWallet":
|
|
20
|
-
return {
|
|
24
|
+
return {
|
|
25
|
+
name: externalWallet ? getExternalWalletDisplayName(externalWallet, { withAddress }) : truncateAddress(identifier, "EVM"),
|
|
26
|
+
icon: (_a = getExternalWalletIcon(externalWallet == null ? void 0 : externalWallet.providerId)) != null ? _a : "wallet02"
|
|
27
|
+
};
|
|
21
28
|
default:
|
|
22
|
-
return {
|
|
29
|
+
return { name: null, icon: null };
|
|
23
30
|
}
|
|
24
31
|
}
|
|
25
32
|
const UserIdentifier = ({ authInfo }) => {
|
|
26
33
|
if (!authInfo) {
|
|
27
34
|
return null;
|
|
28
35
|
}
|
|
29
|
-
const { authType
|
|
30
|
-
const {
|
|
36
|
+
const { authType } = authInfo;
|
|
37
|
+
const { name, icon, src } = getAuthDisplay(authInfo, { withAddress: true });
|
|
31
38
|
return /* @__PURE__ */ jsxs(Container, { children: [
|
|
32
|
-
/* @__PURE__ */ jsx(IconContainer, { children:
|
|
33
|
-
/* @__PURE__ */ jsx(IdentifierText, { variant: "bodyS", weight: "medium", children:
|
|
39
|
+
/* @__PURE__ */ jsx(IconContainer, { children: src ? /* @__PURE__ */ jsx(Avatar, { src, size: "20px", variant: "round" }) : /* @__PURE__ */ jsx(Icon, { icon, size: authType === "telegram" ? "20px" : "13px" }) }),
|
|
40
|
+
/* @__PURE__ */ jsx(IdentifierText, { variant: "bodyS", weight: "medium", children: name })
|
|
34
41
|
] });
|
|
35
42
|
};
|
|
36
|
-
const Container =
|
|
43
|
+
const Container = safeStyled.div`
|
|
37
44
|
padding: 8px 12px 8px 8px;
|
|
38
45
|
border-radius: 1000px;
|
|
39
46
|
background-color: var(--cpsl-color-background-4);
|
|
@@ -42,10 +49,10 @@ const Container = styled.div`
|
|
|
42
49
|
justify-content: flex-start;
|
|
43
50
|
gap: 4px;
|
|
44
51
|
`;
|
|
45
|
-
const IdentifierText =
|
|
52
|
+
const IdentifierText = safeStyled(CpslText)`
|
|
46
53
|
--color-override: var(--cpsl-color-background-96);
|
|
47
54
|
`;
|
|
48
|
-
const IconContainer =
|
|
55
|
+
const IconContainer = safeStyled.div`
|
|
49
56
|
display: flex;
|
|
50
57
|
background: var(--cpsl-color-background-0);
|
|
51
58
|
align-items: center;
|
|
@@ -54,13 +61,14 @@ const IconContainer = styled.div`
|
|
|
54
61
|
width: 20px;
|
|
55
62
|
height: 20px;
|
|
56
63
|
`;
|
|
57
|
-
const Icon =
|
|
64
|
+
const Icon = safeStyled(CpslIcon)`
|
|
58
65
|
--icon-color: var(--cpsl-color-text-primary);
|
|
59
66
|
`;
|
|
60
|
-
const Avatar =
|
|
67
|
+
const Avatar = safeStyled(CpslAvatar)`
|
|
61
68
|
--container-border-width: 0;
|
|
62
69
|
--container-padding: 0;
|
|
63
70
|
`;
|
|
64
71
|
export {
|
|
65
|
-
UserIdentifier
|
|
72
|
+
UserIdentifier,
|
|
73
|
+
getAuthDisplay
|
|
66
74
|
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-GOCCUU3Z.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { CpslIcon } from "@getpara/react-components";
|
|
6
|
+
import { safeStyled } from "../utils/index.js";
|
|
7
|
+
const BannerContainer = safeStyled.div`
|
|
8
|
+
background: #fffcec;
|
|
9
|
+
border: 2px solid var(--cpsl-color-utility-yellow);
|
|
10
|
+
border-radius: 4px;
|
|
11
|
+
padding: 8px 8px;
|
|
12
|
+
`;
|
|
13
|
+
const Content = safeStyled.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: flex-start;
|
|
16
|
+
gap: 8px;
|
|
17
|
+
position: relative;
|
|
18
|
+
`;
|
|
19
|
+
const Text = safeStyled.div`
|
|
20
|
+
flex: 1;
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
line-height: 1.4;
|
|
23
|
+
color: var(--cpsl-color-black);
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
`;
|
|
26
|
+
const CloseButton = safeStyled.button`
|
|
27
|
+
background-color: transparent;
|
|
28
|
+
border: none;
|
|
29
|
+
padding: 0;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
flex-shrink: 0;
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
width: 20px;
|
|
36
|
+
height: 20px;
|
|
37
|
+
margin-top: 1px;
|
|
38
|
+
`;
|
|
39
|
+
const CloseIcon = safeStyled(CpslIcon)`
|
|
40
|
+
--icon-color: var(--cpsl-color-utility-yellow);
|
|
41
|
+
--height: 20px;
|
|
42
|
+
--width: 20px;
|
|
43
|
+
`;
|
|
44
|
+
const WarningBanner = ({ children, onClose }) => {
|
|
45
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
46
|
+
const handleClose = () => {
|
|
47
|
+
setIsVisible(false);
|
|
48
|
+
onClose == null ? void 0 : onClose();
|
|
49
|
+
};
|
|
50
|
+
if (!isVisible) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
return /* @__PURE__ */ jsx(BannerContainer, { children: /* @__PURE__ */ jsxs(Content, { children: [
|
|
54
|
+
/* @__PURE__ */ jsx(CloseButton, { onClick: handleClose, "aria-label": "Close warning", children: /* @__PURE__ */ jsx(CloseIcon, { icon: "x" }) }),
|
|
55
|
+
/* @__PURE__ */ jsx(Text, { children })
|
|
56
|
+
] }) });
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
WarningBanner
|
|
60
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CpslInput, CpslText } from '@getpara/react-components';
|
|
2
|
-
export declare const SpinnerContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
-
export declare const CenteredColumnContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
export declare const SpinnerContainer: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const CenteredColumnContainer: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
4
|
export declare const FilledDisabledInput: typeof CpslInput;
|
|
5
5
|
export declare const FullWidthFilledDisabledInput: typeof CpslInput;
|
|
6
6
|
export declare const CenteredText: typeof CpslText;
|
|
7
|
-
export declare const HeaderButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<any, "ref"> & import("react").RefAttributes<any>, "ref"> & {
|
|
7
|
+
export declare const HeaderButton: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<any, "ref"> & import("react").RefAttributes<any>, "ref"> & {
|
|
8
8
|
ref?: import("react").Ref<any>;
|
|
9
9
|
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<any>>, keyof import("react").Component<any, {}, any>>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../chunk-GOCCUU3Z.js";
|
|
3
3
|
import { CpslButton, CpslInput, CpslText } from "@getpara/react-components";
|
|
4
|
-
import
|
|
5
|
-
const SpinnerContainer =
|
|
4
|
+
import { safeStyled } from "../utils/index.js";
|
|
5
|
+
const SpinnerContainer = safeStyled.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
justify-content: center;
|
|
9
9
|
`;
|
|
10
|
-
const CenteredColumnContainer =
|
|
10
|
+
const CenteredColumnContainer = safeStyled.div`
|
|
11
11
|
width: 100%;
|
|
12
12
|
height: 100%;
|
|
13
13
|
align-self: center;
|
|
@@ -16,21 +16,21 @@ const CenteredColumnContainer = styled.div`
|
|
|
16
16
|
align-items: center;
|
|
17
17
|
gap: 8px;
|
|
18
18
|
`;
|
|
19
|
-
const FilledDisabledInput =
|
|
19
|
+
const FilledDisabledInput = safeStyled(CpslInput)`
|
|
20
20
|
--container-border-color: var(--cpsl-color-input-border-placeholder);
|
|
21
21
|
--container-background-color: var(--cpsl-color-background-0);
|
|
22
22
|
--input-background-color: transparent;
|
|
23
23
|
--input-font-weight: 500;
|
|
24
24
|
--input-color: var(--cpsl-color-text-secondary) !important;
|
|
25
25
|
`;
|
|
26
|
-
const FullWidthFilledDisabledInput =
|
|
26
|
+
const FullWidthFilledDisabledInput = safeStyled(FilledDisabledInput)`
|
|
27
27
|
width: 100%;
|
|
28
28
|
`;
|
|
29
|
-
const CenteredText =
|
|
29
|
+
const CenteredText = safeStyled(CpslText)`
|
|
30
30
|
width: 100%;
|
|
31
31
|
text-align: center;
|
|
32
32
|
`;
|
|
33
|
-
const HeaderButton =
|
|
33
|
+
const HeaderButton = safeStyled(CpslButton)`
|
|
34
34
|
flex: 0;
|
|
35
35
|
--button-padding-top: 2px;
|
|
36
36
|
--button-padding-bottom: 2px;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export * from './MoonPayEmbed.js';
|
|
2
2
|
export * from './RampEmbed.js';
|
|
3
|
-
export * from './StripeEmbed.js';
|
|
4
3
|
export * from './common.js';
|
|
5
4
|
export * from './HeroSpinner.js';
|
|
6
5
|
export * from './KnownDevices.js';
|
|
7
6
|
export * from './QRCode.js';
|
|
8
7
|
export * from './UserIdentifier.js';
|
|
9
8
|
export * from './NetworkSpeedBanner.js';
|
|
9
|
+
export * from './WarningBanner.js';
|
package/dist/components/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
export * from "./MoonPayEmbed.js";
|
|
3
3
|
export * from "./RampEmbed.js";
|
|
4
|
-
export * from "./StripeEmbed.js";
|
|
5
4
|
export * from "./common.js";
|
|
6
5
|
export * from "./HeroSpinner.js";
|
|
7
6
|
export * from "./KnownDevices.js";
|
|
8
7
|
export * from "./QRCode.js";
|
|
9
8
|
export * from "./UserIdentifier.js";
|
|
10
9
|
export * from "./NetworkSpeedBanner.js";
|
|
10
|
+
export * from "./WarningBanner.js";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ExternalWalletInfo } from '@getpara/web-sdk';
|
|
2
|
+
export declare const defaultCosmosExternalWallet: {
|
|
3
|
+
wallets: any[];
|
|
4
|
+
chains: any[];
|
|
5
|
+
chainId: any;
|
|
6
|
+
disconnect: () => Promise<void>;
|
|
7
|
+
switchChain: () => Promise<void>;
|
|
8
|
+
connectParaEmbedded: () => Promise<{}>;
|
|
9
|
+
signMessage: () => Promise<{}>;
|
|
10
|
+
signVerificationMessage: () => Promise<{}>;
|
|
11
|
+
requestInfo: () => Promise<any>;
|
|
12
|
+
disconnectBase: () => Promise<void>;
|
|
13
|
+
useAccount: () => any;
|
|
14
|
+
};
|
|
15
|
+
export declare const defaultEvmExternalWallet: {
|
|
16
|
+
wallets: any[];
|
|
17
|
+
chains: any[];
|
|
18
|
+
chainId: any;
|
|
19
|
+
username: any;
|
|
20
|
+
avatar: any;
|
|
21
|
+
balance: any;
|
|
22
|
+
disconnect: () => Promise<void>;
|
|
23
|
+
switchChain: () => Promise<void>;
|
|
24
|
+
connectParaEmbedded: () => Promise<{}>;
|
|
25
|
+
signMessage: () => Promise<{}>;
|
|
26
|
+
signVerificationMessage: () => Promise<{}>;
|
|
27
|
+
getWalletBalance: () => Promise<any>;
|
|
28
|
+
requestInfo: () => Promise<ExternalWalletInfo>;
|
|
29
|
+
disconnectBase: () => Promise<void>;
|
|
30
|
+
useAccount: () => any;
|
|
31
|
+
farcasterStatus: {
|
|
32
|
+
isPresent: false;
|
|
33
|
+
};
|
|
34
|
+
verificationStage: any;
|
|
35
|
+
};
|
|
36
|
+
export declare const defaultSolanaExternalWallet: {
|
|
37
|
+
wallets: any[];
|
|
38
|
+
disconnect: () => Promise<void>;
|
|
39
|
+
signMessage: () => Promise<{}>;
|
|
40
|
+
signVerificationMessage: () => Promise<{}>;
|
|
41
|
+
requestInfo: () => Promise<ExternalWalletInfo>;
|
|
42
|
+
disconnectBase: () => Promise<void>;
|
|
43
|
+
useWallet: () => any;
|
|
44
|
+
farcasterStatus: {
|
|
45
|
+
isPresent: false;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-GOCCUU3Z.js";
|
|
3
|
+
const defaultCosmosExternalWallet = {
|
|
4
|
+
wallets: [],
|
|
5
|
+
chains: [],
|
|
6
|
+
chainId: void 0,
|
|
7
|
+
disconnect: () => Promise.resolve(),
|
|
8
|
+
switchChain: () => Promise.resolve(),
|
|
9
|
+
connectParaEmbedded: () => Promise.resolve({}),
|
|
10
|
+
signMessage: () => Promise.resolve({}),
|
|
11
|
+
signVerificationMessage: () => Promise.resolve({}),
|
|
12
|
+
requestInfo: () => Promise.resolve({}),
|
|
13
|
+
disconnectBase: () => Promise.resolve(),
|
|
14
|
+
useAccount: () => void 0
|
|
15
|
+
};
|
|
16
|
+
const defaultEvmExternalWallet = {
|
|
17
|
+
wallets: [],
|
|
18
|
+
chains: [],
|
|
19
|
+
chainId: void 0,
|
|
20
|
+
username: void 0,
|
|
21
|
+
avatar: void 0,
|
|
22
|
+
balance: void 0,
|
|
23
|
+
disconnect: () => Promise.resolve(),
|
|
24
|
+
switchChain: () => Promise.resolve(),
|
|
25
|
+
connectParaEmbedded: () => Promise.resolve({}),
|
|
26
|
+
signMessage: () => Promise.resolve({}),
|
|
27
|
+
signVerificationMessage: () => Promise.resolve({}),
|
|
28
|
+
getWalletBalance: () => Promise.resolve(void 0),
|
|
29
|
+
requestInfo: () => Promise.resolve({}),
|
|
30
|
+
disconnectBase: () => Promise.resolve(),
|
|
31
|
+
useAccount: () => void 0,
|
|
32
|
+
farcasterStatus: { isPresent: false },
|
|
33
|
+
verificationStage: void 0
|
|
34
|
+
};
|
|
35
|
+
const defaultSolanaExternalWallet = {
|
|
36
|
+
wallets: [],
|
|
37
|
+
disconnect: () => Promise.resolve(),
|
|
38
|
+
signMessage: () => Promise.resolve({}),
|
|
39
|
+
signVerificationMessage: () => Promise.resolve({}),
|
|
40
|
+
requestInfo: () => Promise.resolve({}),
|
|
41
|
+
disconnectBase: () => Promise.resolve(),
|
|
42
|
+
useWallet: () => void 0,
|
|
43
|
+
farcasterStatus: { isPresent: false }
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
defaultCosmosExternalWallet,
|
|
47
|
+
defaultEvmExternalWallet,
|
|
48
|
+
defaultSolanaExternalWallet
|
|
49
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IconType } from '@getpara/react-components';
|
|
2
|
+
import { TLinkedAccountType } from '@getpara/web-sdk';
|
|
3
|
+
import { DisplayMetadata } from '../types/commonTypes.js';
|
|
4
|
+
export declare const ACCOUNT_TYPES: {
|
|
5
|
+
[key in TLinkedAccountType | string]: DisplayMetadata & {
|
|
6
|
+
isExternalWallet?: boolean;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare function getAccountTypeName(type: TLinkedAccountType | string | undefined, { inline }?: {
|
|
10
|
+
inline?: boolean;
|
|
11
|
+
}): string | undefined;
|
|
12
|
+
export declare function getAccountTypeLogo(type: TLinkedAccountType | undefined): IconType | undefined;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-GOCCUU3Z.js";
|
|
3
|
+
const ACCOUNT_TYPES = {
|
|
4
|
+
"EMAIL": {
|
|
5
|
+
icon: "mail",
|
|
6
|
+
name: "Email",
|
|
7
|
+
inlineText: "email address",
|
|
8
|
+
isPlain: true
|
|
9
|
+
},
|
|
10
|
+
"PHONE": {
|
|
11
|
+
icon: "phone",
|
|
12
|
+
name: "Phone",
|
|
13
|
+
inlineText: "phone number",
|
|
14
|
+
isPlain: true
|
|
15
|
+
},
|
|
16
|
+
"EXTERNAL_WALLET": {
|
|
17
|
+
icon: "wallet",
|
|
18
|
+
name: "External Wallet",
|
|
19
|
+
inlineText: "external wallet",
|
|
20
|
+
isPlain: true
|
|
21
|
+
},
|
|
22
|
+
"GOOGLE": {
|
|
23
|
+
icon: "google",
|
|
24
|
+
iconBranded: "googleBrand",
|
|
25
|
+
name: "Google"
|
|
26
|
+
},
|
|
27
|
+
"TWITTER": {
|
|
28
|
+
icon: "twitter",
|
|
29
|
+
// Not using branded here to ensure the icon looks correct in dark mode
|
|
30
|
+
iconBranded: "twitter",
|
|
31
|
+
name: "X / Twitter",
|
|
32
|
+
inlineText: "X account",
|
|
33
|
+
isDark: true
|
|
34
|
+
},
|
|
35
|
+
"APPLE": {
|
|
36
|
+
icon: "apple",
|
|
37
|
+
// Not using branded here to ensure the icon looks correct in dark mode
|
|
38
|
+
iconBranded: "apple",
|
|
39
|
+
name: "Apple",
|
|
40
|
+
isDark: true
|
|
41
|
+
},
|
|
42
|
+
"DISCORD": {
|
|
43
|
+
icon: "discord",
|
|
44
|
+
iconBranded: "discordBrand",
|
|
45
|
+
name: "Discord"
|
|
46
|
+
},
|
|
47
|
+
"FACEBOOK": {
|
|
48
|
+
icon: "facebook",
|
|
49
|
+
iconBranded: "facebookBrand",
|
|
50
|
+
name: "Facebook"
|
|
51
|
+
},
|
|
52
|
+
"FARCASTER": {
|
|
53
|
+
icon: "farcaster",
|
|
54
|
+
iconBranded: "farcasterBrand",
|
|
55
|
+
name: "Farcaster"
|
|
56
|
+
},
|
|
57
|
+
"TELEGRAM": {
|
|
58
|
+
icon: "telegram",
|
|
59
|
+
iconBranded: "telegramBrand",
|
|
60
|
+
name: "Telegram"
|
|
61
|
+
},
|
|
62
|
+
"MetaMask": {
|
|
63
|
+
icon: "metamask",
|
|
64
|
+
name: "MetaMask",
|
|
65
|
+
isExternalWallet: true
|
|
66
|
+
},
|
|
67
|
+
"Rainbow": {
|
|
68
|
+
icon: "rainbow",
|
|
69
|
+
name: "Rainbow",
|
|
70
|
+
isExternalWallet: true
|
|
71
|
+
},
|
|
72
|
+
"Coinbase Wallet": {
|
|
73
|
+
icon: "coinbase",
|
|
74
|
+
name: "Coinbase Wallet",
|
|
75
|
+
isExternalWallet: true
|
|
76
|
+
},
|
|
77
|
+
"WalletConnect": {
|
|
78
|
+
icon: "walletConnect",
|
|
79
|
+
name: "WalletConnect",
|
|
80
|
+
isExternalWallet: true
|
|
81
|
+
},
|
|
82
|
+
"Zerion": {
|
|
83
|
+
icon: "zerion",
|
|
84
|
+
name: "Zerion",
|
|
85
|
+
isExternalWallet: true
|
|
86
|
+
},
|
|
87
|
+
"Safe": {
|
|
88
|
+
icon: "safe",
|
|
89
|
+
name: "Safe",
|
|
90
|
+
isExternalWallet: true
|
|
91
|
+
},
|
|
92
|
+
"Rabby": {
|
|
93
|
+
icon: "rabby",
|
|
94
|
+
name: "Rabby",
|
|
95
|
+
isExternalWallet: true
|
|
96
|
+
},
|
|
97
|
+
"OKX Wallet": {
|
|
98
|
+
icon: "okx",
|
|
99
|
+
name: "OKX Wallet",
|
|
100
|
+
isExternalWallet: true
|
|
101
|
+
},
|
|
102
|
+
"Phantom": {
|
|
103
|
+
icon: "phantom",
|
|
104
|
+
name: "Phantom",
|
|
105
|
+
isExternalWallet: true
|
|
106
|
+
},
|
|
107
|
+
"Glow": {
|
|
108
|
+
icon: "glow",
|
|
109
|
+
name: "Glow",
|
|
110
|
+
isExternalWallet: true
|
|
111
|
+
},
|
|
112
|
+
"Backpack": {
|
|
113
|
+
icon: "backpack",
|
|
114
|
+
name: "Backpack",
|
|
115
|
+
isExternalWallet: true
|
|
116
|
+
},
|
|
117
|
+
"Keplr": {
|
|
118
|
+
icon: "keplr",
|
|
119
|
+
name: "Keplr",
|
|
120
|
+
isExternalWallet: true
|
|
121
|
+
},
|
|
122
|
+
"Leap": {
|
|
123
|
+
icon: "leap",
|
|
124
|
+
name: "Leap",
|
|
125
|
+
isExternalWallet: true
|
|
126
|
+
},
|
|
127
|
+
"HaHa": {
|
|
128
|
+
icon: "haha",
|
|
129
|
+
name: "HaHa",
|
|
130
|
+
isExternalWallet: true
|
|
131
|
+
},
|
|
132
|
+
"Cosmostation": {
|
|
133
|
+
icon: "cosmostation",
|
|
134
|
+
name: "Cosmostation",
|
|
135
|
+
isExternalWallet: true
|
|
136
|
+
},
|
|
137
|
+
"Solflare": {
|
|
138
|
+
icon: "solflare",
|
|
139
|
+
name: "Solflare",
|
|
140
|
+
isExternalWallet: true
|
|
141
|
+
},
|
|
142
|
+
"Valora": {
|
|
143
|
+
icon: "valora",
|
|
144
|
+
name: "Valora",
|
|
145
|
+
isExternalWallet: true
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
function getAccountTypeName(type, { inline = false } = {}) {
|
|
149
|
+
var _a;
|
|
150
|
+
const data = type ? ACCOUNT_TYPES[type] : void 0;
|
|
151
|
+
return data ? inline ? (_a = data.inlineText) != null ? _a : `${data.name} ${data.isExternalWallet ? "wallet" : "account"}` : data.name : void 0;
|
|
152
|
+
}
|
|
153
|
+
function getAccountTypeLogo(type) {
|
|
154
|
+
return type ? ACCOUNT_TYPES[type].iconBranded || ACCOUNT_TYPES[type].icon : void 0;
|
|
155
|
+
}
|
|
156
|
+
export {
|
|
157
|
+
ACCOUNT_TYPES,
|
|
158
|
+
getAccountTypeLogo,
|
|
159
|
+
getAccountTypeName
|
|
160
|
+
};
|
package/dist/hooks/index.d.ts
CHANGED
package/dist/hooks/index.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-GOCCUU3Z.js";
|
|
3
|
+
import { UAParser } from "ua-parser-js";
|
|
4
|
+
function useUserAgent() {
|
|
5
|
+
const userAgent = typeof window !== "undefined" ? window.navigator.userAgent : void 0;
|
|
6
|
+
return UAParser(userAgent);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
useUserAgent
|
|
10
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IconType } from '@getpara/react-components';
|
|
2
|
+
export type Tab<T> = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: T;
|
|
5
|
+
icon: IconType;
|
|
6
|
+
};
|
|
7
|
+
export type DisplayMetadata = {
|
|
8
|
+
name: string;
|
|
9
|
+
inlineText?: string;
|
|
10
|
+
icon: IconType;
|
|
11
|
+
iconBranded?: IconType;
|
|
12
|
+
isDark?: boolean;
|
|
13
|
+
isCircular?: boolean;
|
|
14
|
+
isPlain?: boolean;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|