@prosopo/procaptcha-react 0.3.37 → 0.3.38
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.
|
@@ -25,6 +25,10 @@ const baseStyle = {
|
|
|
25
25
|
borderStyle: "solid",
|
|
26
26
|
borderWidth: "1px"
|
|
27
27
|
};
|
|
28
|
+
const ID_LETTERS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
29
|
+
const generateRandomId = () => {
|
|
30
|
+
return Array.from({ length: 8 }, () => ID_LETTERS[Math.floor(Math.random() * ID_LETTERS.length)]).join("");
|
|
31
|
+
};
|
|
28
32
|
const Checkbox = ({ themeColor, onChange, checked, labelText }) => {
|
|
29
33
|
const theme$1 = React.useMemo(() => themeColor === "light" ? theme.lightTheme : theme.darkTheme, [themeColor]);
|
|
30
34
|
const checkboxStyleBase = {
|
|
@@ -38,17 +42,17 @@ const Checkbox = ({ themeColor, onChange, checked, labelText }) => {
|
|
|
38
42
|
borderColor: hover ? theme$1.palette.background.contrastText : theme$1.palette.grey[400],
|
|
39
43
|
appearance: checked ? "auto" : "none",
|
|
40
44
|
flex: 1,
|
|
41
|
-
margin: "
|
|
45
|
+
margin: "15px"
|
|
42
46
|
};
|
|
43
47
|
}, [hover, theme$1, checked]);
|
|
44
|
-
const id =
|
|
45
|
-
return jsxRuntime.jsxs("span", { style: { display: "inline-flex" }, children: [jsxRuntime.jsx("input", { name: id, onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), css: checkboxBefore, type: "checkbox", "aria-live": "assertive", "aria-haspopup": "true", onChange, checked, style: checkboxStyle }), jsxRuntime.jsx("label", { css: {
|
|
48
|
+
const id = generateRandomId();
|
|
49
|
+
return jsxRuntime.jsxs("span", { style: { display: "inline-flex" }, children: [jsxRuntime.jsx("input", { name: id, id, onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), css: checkboxBefore, type: "checkbox", "aria-live": "assertive", "aria-haspopup": "true", onChange, checked, style: checkboxStyle }), jsxRuntime.jsx("label", { css: {
|
|
46
50
|
color: theme$1.palette.background.contrastText,
|
|
47
51
|
position: "relative",
|
|
48
52
|
display: "flex",
|
|
49
53
|
cursor: "pointer",
|
|
50
54
|
userSelect: "none",
|
|
51
|
-
top: "
|
|
55
|
+
top: "18px"
|
|
52
56
|
}, htmlFor: id, children: labelText })] });
|
|
53
57
|
};
|
|
54
58
|
exports.Checkbox = Checkbox;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/procaptcha-react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.38",
|
|
4
4
|
"author": "PROSOPO LIMITED <info@prosopo.io>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"@emotion/styled": "^11.11.0",
|
|
39
39
|
"@polkadot/extension-dapp": "0.46.6",
|
|
40
40
|
"@polkadot/extension-inject": "0.46.6",
|
|
41
|
-
"@prosopo/api": "0.3.
|
|
42
|
-
"@prosopo/common": "0.3.
|
|
43
|
-
"@prosopo/procaptcha": "0.3.
|
|
44
|
-
"@prosopo/types": "0.3.
|
|
45
|
-
"@prosopo/util": "0.3.
|
|
46
|
-
"@prosopo/web-components": "0.3.
|
|
41
|
+
"@prosopo/api": "0.3.38",
|
|
42
|
+
"@prosopo/common": "0.3.38",
|
|
43
|
+
"@prosopo/procaptcha": "0.3.38",
|
|
44
|
+
"@prosopo/types": "0.3.38",
|
|
45
|
+
"@prosopo/util": "0.3.38",
|
|
46
|
+
"@prosopo/web-components": "0.3.38",
|
|
47
47
|
"react": "^18.2.0",
|
|
48
48
|
"react-dom": "^18.2.0"
|
|
49
49
|
},
|