@getpara/react-common 0.1.0
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 +25 -0
- package/dist/classes/ParaInternal.js +20 -0
- package/dist/classes/index.d.ts +1 -0
- package/dist/classes/index.js +1 -0
- package/dist/components/HeroSpinner.d.ts +9 -0
- package/dist/components/HeroSpinner.js +37 -0
- package/dist/components/KnownDevices.d.ts +8 -0
- package/dist/components/KnownDevices.js +39 -0
- package/dist/components/MoonPayEmbed.d.ts +3 -0
- package/dist/components/MoonPayEmbed.js +142 -0
- package/dist/components/QRCode.d.ts +10 -0
- package/dist/components/QRCode.js +65 -0
- package/dist/components/RampEmbed.d.ts +4 -0
- package/dist/components/RampEmbed.js +95 -0
- package/dist/components/StripeEmbed.d.ts +4 -0
- package/dist/components/StripeEmbed.js +128 -0
- package/dist/components/UserIdentifier.d.ts +2 -0
- package/dist/components/UserIdentifier.js +65 -0
- package/dist/components/common.d.ts +9 -0
- package/dist/components/common.js +44 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +8 -0
- package/dist/constants/aaguiMetadata.d.ts +140 -0
- package/dist/constants/aaguiMetadata.js +140 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useCopyToClipboard.d.ts +3 -0
- package/dist/hooks/useCopyToClipboard.js +37 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/index.js +1 -0
- package/dist/utils/formatBiometricHints.d.ts +15 -0
- package/dist/utils/formatBiometricHints.js +49 -0
- package/dist/utils/formatPhoneNumber.d.ts +1 -0
- package/dist/utils/formatPhoneNumber.js +9 -0
- package/dist/utils/getBrowserName.d.ts +1 -0
- package/dist/utils/getBrowserName.js +2 -0
- package/dist/utils/getDeviceLogo.d.ts +2 -0
- package/dist/utils/getDeviceLogo.js +31 -0
- package/dist/utils/getDeviceModelName.d.ts +1 -0
- package/dist/utils/getDeviceModelName.js +13 -0
- package/dist/utils/index.d.ts +35 -0
- package/dist/utils/index.js +92 -0
- package/dist/utils/offRampSend.d.ts +7 -0
- package/dist/utils/offRampSend.js +67 -0
- package/package.json +44 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CpslAvatar, CpslIcon, CpslText } from '@getpara/react-components';
|
|
3
|
+
import parsePhoneNumberFromString from 'libphonenumber-js';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
function defaultDisplayName(authType, identifier) {
|
|
6
|
+
switch (authType) {
|
|
7
|
+
case 'email':
|
|
8
|
+
return identifier.toLowerCase();
|
|
9
|
+
case 'phone':
|
|
10
|
+
const parsed = parsePhoneNumberFromString(identifier);
|
|
11
|
+
return `+${parsed.countryCallingCode} ${parsed.formatNational()}`;
|
|
12
|
+
case 'farcasterUsername':
|
|
13
|
+
return `@${identifier}`;
|
|
14
|
+
case 'telegramUserId':
|
|
15
|
+
return `Telegram User @${identifier}`;
|
|
16
|
+
default:
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export const UserIdentifier = ({ identifier, authType, displayName, pfpUrl }) => {
|
|
21
|
+
let icon;
|
|
22
|
+
switch (authType) {
|
|
23
|
+
case 'email':
|
|
24
|
+
icon = 'mail';
|
|
25
|
+
break;
|
|
26
|
+
case 'phone':
|
|
27
|
+
icon = 'phone';
|
|
28
|
+
break;
|
|
29
|
+
case 'farcaster':
|
|
30
|
+
icon = 'farcasterBrand';
|
|
31
|
+
break;
|
|
32
|
+
case 'telegram':
|
|
33
|
+
icon = 'telegramBrand';
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
return (_jsxs(Container, { children: [_jsx(IconContainer, { children: pfpUrl ? (_jsx(Avatar, { src: pfpUrl, size: "20px" })) : (_jsx(Icon, { icon: icon, size: authType === 'telegram' ? '20px' : '13px' })) }), _jsx(IdentifierText, { variant: "bodyS", weight: "medium", children: displayName || defaultDisplayName(authType, identifier) })] }));
|
|
37
|
+
};
|
|
38
|
+
const Container = styled.div `
|
|
39
|
+
padding: 8px 12px 8px 8px;
|
|
40
|
+
border-radius: 1000px;
|
|
41
|
+
background-color: var(--cpsl-color-background-4);
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: flex-start;
|
|
45
|
+
gap: 4px;
|
|
46
|
+
`;
|
|
47
|
+
const IdentifierText = styled(CpslText) `
|
|
48
|
+
--color-override: var(--cpsl-color-background-96);
|
|
49
|
+
`;
|
|
50
|
+
const IconContainer = styled.div `
|
|
51
|
+
display: flex;
|
|
52
|
+
background: var(--cpsl-color-background-0);
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
border-radius: 1000px;
|
|
56
|
+
width: 20px;
|
|
57
|
+
height: 20px;
|
|
58
|
+
`;
|
|
59
|
+
const Icon = styled(CpslIcon) `
|
|
60
|
+
--icon-color: var(--cpsl-color-text-primary);
|
|
61
|
+
`;
|
|
62
|
+
const Avatar = styled(CpslAvatar) `
|
|
63
|
+
--container-border-width: 0;
|
|
64
|
+
--container-padding: 0;
|
|
65
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
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;
|
|
4
|
+
export declare const FilledDisabledInput: typeof CpslInput;
|
|
5
|
+
export declare const FullWidthFilledDisabledInput: typeof CpslInput;
|
|
6
|
+
export declare const CenteredText: typeof CpslText;
|
|
7
|
+
export declare const HeaderButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("@getpara/core-components").JSX.CpslButton & Omit<import("react").HTMLAttributes<HTMLCpslButtonElement>, "style"> & import("@getpara/react-components/dist/types/components/stencil-generated/react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLCpslButtonElement>, "ref"> & {
|
|
8
|
+
ref?: import("react").Ref<HTMLCpslButtonElement>;
|
|
9
|
+
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<import("@getpara/core-components").JSX.CpslButton & Omit<import("react").HTMLAttributes<HTMLCpslButtonElement>, "style"> & import("@getpara/react-components/dist/types/components/stencil-generated/react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLCpslButtonElement>>, keyof import("react").Component<any, {}, any>>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CpslButton, CpslInput, CpslText } from '@getpara/react-components';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
export const SpinnerContainer = styled.div `
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
`;
|
|
8
|
+
export const CenteredColumnContainer = styled.div `
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
align-self: center;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: 8px;
|
|
16
|
+
`;
|
|
17
|
+
export const FilledDisabledInput = styled(CpslInput) `
|
|
18
|
+
--container-border-color: var(--cpsl-color-input-border-placeholder);
|
|
19
|
+
--container-background-color: var(--cpsl-color-background-0);
|
|
20
|
+
--input-background-color: transparent;
|
|
21
|
+
--input-font-weight: 500;
|
|
22
|
+
--input-color: var(--cpsl-color-text-secondary) !important;
|
|
23
|
+
`;
|
|
24
|
+
export const FullWidthFilledDisabledInput = styled(FilledDisabledInput) `
|
|
25
|
+
width: 100%;
|
|
26
|
+
`;
|
|
27
|
+
export const CenteredText = styled(CpslText) `
|
|
28
|
+
width: 100%;
|
|
29
|
+
text-align: center;
|
|
30
|
+
`;
|
|
31
|
+
export const HeaderButton = styled(CpslButton) `
|
|
32
|
+
flex: 0;
|
|
33
|
+
--button-padding-top: 2px;
|
|
34
|
+
--button-padding-bottom: 2px;
|
|
35
|
+
--button-padding-start: 2px;
|
|
36
|
+
--button-padding-end: 2px;
|
|
37
|
+
--button-border-radius: 1000px;
|
|
38
|
+
--button-background-color: var(--cpsl-color-background-4);
|
|
39
|
+
|
|
40
|
+
cpsl-icon {
|
|
41
|
+
--height: 20px;
|
|
42
|
+
--width: 20px;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './MoonPayEmbed.js';
|
|
2
|
+
export * from './RampEmbed.js';
|
|
3
|
+
export * from './StripeEmbed.js';
|
|
4
|
+
export * from './common.js';
|
|
5
|
+
export * from './HeroSpinner.js';
|
|
6
|
+
export * from './KnownDevices.js';
|
|
7
|
+
export * from './QRCode.js';
|
|
8
|
+
export * from './UserIdentifier.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './MoonPayEmbed.js';
|
|
2
|
+
export * from './RampEmbed.js';
|
|
3
|
+
export * from './StripeEmbed.js';
|
|
4
|
+
export * from './common.js';
|
|
5
|
+
export * from './HeroSpinner.js';
|
|
6
|
+
export * from './KnownDevices.js';
|
|
7
|
+
export * from './QRCode.js';
|
|
8
|
+
export * from './UserIdentifier.js';
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
export declare const aaguidMetadata: {
|
|
2
|
+
'ea9b8d66-4d01-1d21-3ce4-b6b48cb575d4': {
|
|
3
|
+
name: string;
|
|
4
|
+
icon_dark: string;
|
|
5
|
+
icon_light: string;
|
|
6
|
+
};
|
|
7
|
+
'adce0002-35bc-c60a-648b-0b25f1f05503': {
|
|
8
|
+
name: string;
|
|
9
|
+
icon_dark: string;
|
|
10
|
+
icon_light: string;
|
|
11
|
+
};
|
|
12
|
+
'08987058-cadc-4b81-b6e1-30de50dcbe96': {
|
|
13
|
+
name: string;
|
|
14
|
+
icon_dark: string;
|
|
15
|
+
icon_light: string;
|
|
16
|
+
};
|
|
17
|
+
'9ddd1817-af5a-4672-a2b9-3e3dd95000a9': {
|
|
18
|
+
name: string;
|
|
19
|
+
icon_dark: string;
|
|
20
|
+
icon_light: string;
|
|
21
|
+
};
|
|
22
|
+
'6028b017-b1d4-4c02-b4b3-afcdafc96bb2': {
|
|
23
|
+
name: string;
|
|
24
|
+
icon_dark: string;
|
|
25
|
+
icon_light: string;
|
|
26
|
+
};
|
|
27
|
+
'dd4ec289-e01d-41c9-bb89-70fa845d4bf2': {
|
|
28
|
+
name: string;
|
|
29
|
+
icon_dark: string;
|
|
30
|
+
icon_light: string;
|
|
31
|
+
};
|
|
32
|
+
'531126d6-e717-415c-9320-3d9aa6981239': {
|
|
33
|
+
name: string;
|
|
34
|
+
icon_dark: string;
|
|
35
|
+
icon_light: string;
|
|
36
|
+
};
|
|
37
|
+
'bada5566-a7aa-401f-bd96-45619a55120d': {
|
|
38
|
+
name: string;
|
|
39
|
+
icon_dark: string;
|
|
40
|
+
icon_light: string;
|
|
41
|
+
};
|
|
42
|
+
'b84e4048-15dc-4dd0-8640-f4f60813c8af': {
|
|
43
|
+
name: string;
|
|
44
|
+
icon_dark: string;
|
|
45
|
+
icon_light: string;
|
|
46
|
+
};
|
|
47
|
+
'0ea242b4-43c4-4a1b-8b17-dd6d0b6baec6': {
|
|
48
|
+
name: string;
|
|
49
|
+
icon_dark: string;
|
|
50
|
+
icon_light: string;
|
|
51
|
+
};
|
|
52
|
+
'891494da-2c90-4d31-a9cd-4eab0aed1309': {
|
|
53
|
+
name: string;
|
|
54
|
+
icon_dark: string;
|
|
55
|
+
icon_light: string;
|
|
56
|
+
};
|
|
57
|
+
'f3809540-7f14-49c1-a8b3-8f813b225541': {
|
|
58
|
+
name: string;
|
|
59
|
+
icon_dark: string;
|
|
60
|
+
icon_light: string;
|
|
61
|
+
};
|
|
62
|
+
'b5397666-4885-aa6b-cebf-e52262a439a2': {
|
|
63
|
+
name: string;
|
|
64
|
+
};
|
|
65
|
+
'771b48fd-d3d4-4f74-9232-fc157ab0507a': {
|
|
66
|
+
name: string;
|
|
67
|
+
icon_dark: string;
|
|
68
|
+
icon_light: string;
|
|
69
|
+
};
|
|
70
|
+
'39a5647e-1853-446c-a1f6-a79bae9f5bc7': {
|
|
71
|
+
name: string;
|
|
72
|
+
icon_dark: string;
|
|
73
|
+
icon_light: string;
|
|
74
|
+
};
|
|
75
|
+
'd548826e-79b4-db40-a3d8-11116f7e8349': {
|
|
76
|
+
name: string;
|
|
77
|
+
icon_dark: string;
|
|
78
|
+
icon_light: string;
|
|
79
|
+
};
|
|
80
|
+
'fbfc3007-154e-4ecc-8c0b-6e020557d7bd': {
|
|
81
|
+
name: string;
|
|
82
|
+
icon_dark: string;
|
|
83
|
+
icon_light: string;
|
|
84
|
+
};
|
|
85
|
+
'53414d53-554e-4700-0000-000000000000': {
|
|
86
|
+
name: string;
|
|
87
|
+
icon_dark: string;
|
|
88
|
+
icon_light: string;
|
|
89
|
+
};
|
|
90
|
+
'66a0ccb3-bd6a-191f-ee06-e375c50b9846': {
|
|
91
|
+
name: string;
|
|
92
|
+
icon_dark: string;
|
|
93
|
+
icon_light: string;
|
|
94
|
+
};
|
|
95
|
+
'8836336a-f590-0921-301d-46427531eee6': {
|
|
96
|
+
name: string;
|
|
97
|
+
icon_dark: string;
|
|
98
|
+
icon_light: string;
|
|
99
|
+
};
|
|
100
|
+
'cd69adb5-3c7a-deb9-3177-6800ea6cb72a': {
|
|
101
|
+
name: string;
|
|
102
|
+
icon_dark: string;
|
|
103
|
+
icon_light: string;
|
|
104
|
+
};
|
|
105
|
+
'17290f1e-c212-34d0-1423-365d729f09d9': {
|
|
106
|
+
name: string;
|
|
107
|
+
icon_dark: string;
|
|
108
|
+
icon_light: string;
|
|
109
|
+
};
|
|
110
|
+
'50726f74-6f6e-5061-7373-50726f746f6e': {
|
|
111
|
+
name: string;
|
|
112
|
+
icon_dark: string;
|
|
113
|
+
icon_light: string;
|
|
114
|
+
};
|
|
115
|
+
'fdb141b2-5d84-443e-8a35-4698c205a502': {
|
|
116
|
+
name: string;
|
|
117
|
+
icon_dark: string;
|
|
118
|
+
icon_light: string;
|
|
119
|
+
};
|
|
120
|
+
'cc45f64e-52a2-451b-831a-4edd8022a202': {
|
|
121
|
+
name: string;
|
|
122
|
+
icon_dark: string;
|
|
123
|
+
icon_light: string;
|
|
124
|
+
};
|
|
125
|
+
'bfc748bb-3429-4faa-b9f9-7cfa9f3b76d0': {
|
|
126
|
+
name: string;
|
|
127
|
+
icon_dark: string;
|
|
128
|
+
icon_light: string;
|
|
129
|
+
};
|
|
130
|
+
'b35a26b2-8f6e-4697-ab1d-d44db4da28c6': {
|
|
131
|
+
name: string;
|
|
132
|
+
icon_dark: string;
|
|
133
|
+
icon_light: string;
|
|
134
|
+
};
|
|
135
|
+
'b78a0a55-6ef8-d246-a042-ba0f6d55050c': {
|
|
136
|
+
name: string;
|
|
137
|
+
icon_dark: string;
|
|
138
|
+
icon_light: string;
|
|
139
|
+
};
|
|
140
|
+
};
|