@prosopo/procaptcha-react 0.1.0 → 0.1.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/README.md +36 -0
- package/dist/components/CaptchaComponent.d.ts +6 -0
- package/dist/components/CaptchaComponent.d.ts.map +1 -0
- package/{src/components/CaptchaComponent.tsx → dist/components/CaptchaComponent.js} +9 -63
- package/dist/components/CaptchaComponent.js.map +1 -0
- package/dist/components/CaptchaManager.d.ts +5 -0
- package/dist/components/CaptchaManager.d.ts.map +1 -0
- package/{src/components/CaptchaManager.ts → dist/components/CaptchaManager.js} +9 -17
- package/dist/components/CaptchaManager.js.map +1 -0
- package/dist/components/CaptchaWidget.d.ts +8 -0
- package/dist/components/CaptchaWidget.d.ts.map +1 -0
- package/{src/components/CaptchaWidget.tsx → dist/components/CaptchaWidget.js} +6 -21
- package/dist/components/CaptchaWidget.js.map +1 -0
- package/dist/components/ExtensionAccountSelect.d.ts +8 -0
- package/dist/components/ExtensionAccountSelect.d.ts.map +1 -0
- package/dist/components/ExtensionAccountSelect.js +8 -0
- package/dist/components/ExtensionAccountSelect.js.map +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -0
- package/{src/components/index.ts → dist/components/index.js} +1 -0
- package/dist/components/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/{src/index.ts → dist/index.js} +1 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.d.ts +2 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +91 -0
- package/dist/styles.js.map +1 -0
- package/package.json +3 -3
- package/tsconfig.tsbuildinfo +1 -0
- package/src/components/ExtensionAccountSelect.tsx +0 -38
- package/src/styles.ts +0 -89
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// Copyright (C) 2021-2022 Prosopo (UK) Ltd.
|
|
2
|
-
// This file is part of procaptcha-react <https://github.com/prosopo-io/procaptcha-react>.
|
|
3
|
-
//
|
|
4
|
-
// procaptcha-react is free software: you can redistribute it and/or modify
|
|
5
|
-
// it under the terms of the GNU General Public License as published by
|
|
6
|
-
// the Free Software Foundation, either version 3 of the License, or
|
|
7
|
-
// (at your option) any later version.
|
|
8
|
-
//
|
|
9
|
-
// procaptcha-react is distributed in the hope that it will be useful,
|
|
10
|
-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
// GNU General Public License for more details.
|
|
13
|
-
//
|
|
14
|
-
// You should have received a copy of the GNU General Public License
|
|
15
|
-
// along with procaptcha-react. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
-
import { SyntheticEvent } from "react";
|
|
17
|
-
import { Autocomplete, TextField } from "@mui/material";
|
|
18
|
-
import { TExtensionAccount } from "@prosopo/procaptcha";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export const ExtensionAccountSelect = ({value, options, onChange}:
|
|
22
|
-
{value?: TExtensionAccount, options: TExtensionAccount[], onChange: (value: TExtensionAccount | null) => void}) => {
|
|
23
|
-
return (
|
|
24
|
-
<Autocomplete
|
|
25
|
-
disablePortal
|
|
26
|
-
id="select-accounts" // TODO
|
|
27
|
-
options={options}
|
|
28
|
-
value={value}
|
|
29
|
-
isOptionEqualToValue={(option, value) => option.address === value.address}
|
|
30
|
-
onChange={(event: SyntheticEvent<Element, Event>, value: TExtensionAccount | null) => onChange(value)}
|
|
31
|
-
sx={{ width: 550 }} // TODO prop
|
|
32
|
-
getOptionLabel={(option: any) => `${option.meta.name}\n${option.address}`}
|
|
33
|
-
renderInput={(props) => <TextField {...props} label="Select account" />} // TODO label
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export default ExtensionAccountSelect;
|
package/src/styles.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// Copyright (C) 2021-2022 Prosopo (UK) Ltd.
|
|
2
|
-
// This file is part of procaptcha-react <https://github.com/prosopo-io/procaptcha-react>.
|
|
3
|
-
//
|
|
4
|
-
// procaptcha-react is free software: you can redistribute it and/or modify
|
|
5
|
-
// it under the terms of the GNU General Public License as published by
|
|
6
|
-
// the Free Software Foundation, either version 3 of the License, or
|
|
7
|
-
// (at your option) any later version.
|
|
8
|
-
//
|
|
9
|
-
// procaptcha-react is distributed in the hope that it will be useful,
|
|
10
|
-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
// GNU General Public License for more details.
|
|
13
|
-
//
|
|
14
|
-
// You should have received a copy of the GNU General Public License
|
|
15
|
-
// along with procaptcha-react. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
-
import { makeStyles } from "@mui/styles";
|
|
17
|
-
|
|
18
|
-
const dot = {
|
|
19
|
-
width: 7,
|
|
20
|
-
height: 7,
|
|
21
|
-
borderRadius: 3.5,
|
|
22
|
-
marginRight: 5,
|
|
23
|
-
border: "1px solid #CFCFCF",
|
|
24
|
-
backgroundColor: "#FFFFFF",
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const useStyles = makeStyles({
|
|
28
|
-
root: {
|
|
29
|
-
display: "flex",
|
|
30
|
-
alignItems: "center",
|
|
31
|
-
justifyContent: "center",
|
|
32
|
-
width: "100%",
|
|
33
|
-
height: "100%"
|
|
34
|
-
},
|
|
35
|
-
captchasContainer: {
|
|
36
|
-
display: "flex",
|
|
37
|
-
flexDirection: "column",
|
|
38
|
-
background: "#FFFFFF",
|
|
39
|
-
border: "1px solid #CFCFCF",
|
|
40
|
-
boxShadow: "0px 2px 4px rgba(0, 0, 0, 0.2)"
|
|
41
|
-
},
|
|
42
|
-
captchasHeader: {
|
|
43
|
-
display: "flex",
|
|
44
|
-
alignItems: "center",
|
|
45
|
-
backgroundColor: "#bdbdbd",
|
|
46
|
-
height: 80,
|
|
47
|
-
paddingLeft: 20
|
|
48
|
-
},
|
|
49
|
-
captchasBody: {
|
|
50
|
-
display: "flex",
|
|
51
|
-
width: 460,
|
|
52
|
-
flexWrap: "wrap",
|
|
53
|
-
height: "max-content",
|
|
54
|
-
paddingTop: 10,
|
|
55
|
-
paddingLeft: 10,
|
|
56
|
-
borderBottom: "1px solid #CFCFCF"
|
|
57
|
-
},
|
|
58
|
-
captchasFooter: {
|
|
59
|
-
display: "flex",
|
|
60
|
-
alignItems: "center",
|
|
61
|
-
justifyContent: "space-between",
|
|
62
|
-
height: 80,
|
|
63
|
-
paddingLeft: 20,
|
|
64
|
-
paddingRight: 20
|
|
65
|
-
},
|
|
66
|
-
captchaItem: {
|
|
67
|
-
width: "140px !important",
|
|
68
|
-
borderRadius: 2,
|
|
69
|
-
height: "140px !important",
|
|
70
|
-
marginRight: 10,
|
|
71
|
-
marginBottom: 10
|
|
72
|
-
},
|
|
73
|
-
captchasHeaderLabel: {
|
|
74
|
-
color: "#ffffff"
|
|
75
|
-
},
|
|
76
|
-
dotsContainer: {
|
|
77
|
-
display: "flex",
|
|
78
|
-
alignItems: "center",
|
|
79
|
-
justifyContent: "center",
|
|
80
|
-
width: "100%",
|
|
81
|
-
paddingBottom: 15,
|
|
82
|
-
paddingTop: 10
|
|
83
|
-
},
|
|
84
|
-
dot,
|
|
85
|
-
dotActive: {
|
|
86
|
-
...dot,
|
|
87
|
-
backgroundColor: "#CFCFCF"
|
|
88
|
-
},
|
|
89
|
-
});
|