@prosopo/procaptcha-frictionless 0.3.36 → 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.
@@ -91,11 +91,13 @@ const Manager = (configInput, state, onStateUpdate, callbacks) => {
91
91
  return;
92
92
  }
93
93
  resetState();
94
+ updateState({
95
+ loading: true
96
+ });
94
97
  const config = getConfig();
95
98
  const ext = new ExtensionWeb2.ExtensionWeb2();
96
99
  const userAccount = config.userAccountAddress || (await ext.getAccount(config)).account.address;
97
100
  updateState({
98
- loading: true,
99
101
  account: { account: { address: userAccount } }
100
102
  });
101
103
  updateState({ dappAccount: config.account.address });
@@ -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$1.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: "0 15px"
45
+ margin: "15px"
42
46
  };
43
47
  }, [hover, theme$1, checked]);
44
- const id = react$1.useId();
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: "4px"
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-frictionless",
3
- "version": "0.3.36",
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",
@@ -35,9 +35,9 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@fingerprintjs/botd": "^1.9.0",
38
- "@prosopo/procaptcha-pow": "0.3.36",
39
- "@prosopo/procaptcha-react": "0.3.36",
40
- "@prosopo/web-components": "0.3.36",
38
+ "@prosopo/procaptcha-pow": "0.3.38",
39
+ "@prosopo/procaptcha-react": "0.3.38",
40
+ "@prosopo/web-components": "0.3.38",
41
41
  "react": "^18.2.0"
42
42
  },
43
43
  "devDependencies": {