@prosopo/procaptcha-react 0.2.40 → 0.3.1

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.
Files changed (67) hide show
  1. package/dist/cjs/components/Button.cjs +2 -1
  2. package/dist/cjs/components/CaptchaComponent.cjs +2 -1
  3. package/dist/cjs/components/CaptchaWidget.cjs +2 -1
  4. package/dist/cjs/components/ExtensionAccountSelect.cjs +1 -2
  5. package/dist/cjs/components/Modal.cjs +27 -3
  6. package/dist/cjs/components/Procaptcha.cjs +2 -1
  7. package/dist/cjs/components/ProcaptchaWidget.cjs +5 -4
  8. package/dist/cjs/index.cjs +2 -2
  9. package/dist/cjs/{components → web-components/dist}/CaptchaPlaceholder.cjs +30 -83
  10. package/dist/cjs/{components → web-components/dist}/Checkbox.cjs +4 -15
  11. package/dist/cjs/{components → web-components/dist}/LoadingSpinner.cjs +1 -1
  12. package/dist/cjs/web-components/dist/index.cjs +11 -0
  13. package/dist/components/Button.d.ts +10 -0
  14. package/dist/components/Button.d.ts.map +1 -0
  15. package/dist/components/Button.js +55 -65
  16. package/dist/components/Button.js.map +1 -0
  17. package/dist/components/CaptchaComponent.d.ts +14 -0
  18. package/dist/components/CaptchaComponent.d.ts.map +1 -0
  19. package/dist/components/CaptchaComponent.js +59 -156
  20. package/dist/components/CaptchaComponent.js.map +1 -0
  21. package/dist/components/CaptchaWidget.d.ts +9 -0
  22. package/dist/components/CaptchaWidget.d.ts.map +1 -0
  23. package/dist/components/CaptchaWidget.js +66 -144
  24. package/dist/components/CaptchaWidget.js.map +1 -0
  25. package/dist/components/ExtensionAccountSelect.d.ts +6 -0
  26. package/dist/components/ExtensionAccountSelect.d.ts.map +1 -0
  27. package/dist/components/ExtensionAccountSelect.js +29 -47
  28. package/dist/components/ExtensionAccountSelect.js.map +1 -0
  29. package/dist/components/Modal.d.ts +8 -0
  30. package/dist/components/Modal.d.ts.map +1 -0
  31. package/dist/components/Modal.js +36 -16
  32. package/dist/components/Modal.js.map +1 -0
  33. package/dist/components/Procaptcha.d.ts +6 -0
  34. package/dist/components/Procaptcha.d.ts.map +1 -0
  35. package/dist/components/Procaptcha.js +7 -8
  36. package/dist/components/Procaptcha.js.map +1 -0
  37. package/dist/components/ProcaptchaWidget.d.ts +8 -0
  38. package/dist/components/ProcaptchaWidget.d.ts.map +1 -0
  39. package/dist/components/ProcaptchaWidget.js +128 -221
  40. package/dist/components/ProcaptchaWidget.js.map +1 -0
  41. package/dist/components/collector.d.ts +8 -0
  42. package/dist/components/collector.d.ts.map +1 -0
  43. package/dist/components/collector.js +23 -24
  44. package/dist/components/collector.js.map +1 -0
  45. package/dist/components/index.d.ts +7 -0
  46. package/dist/components/index.d.ts.map +1 -0
  47. package/dist/components/index.js +7 -11
  48. package/dist/components/index.js.map +1 -0
  49. package/dist/index.d.ts +3 -42
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +3 -12
  52. package/dist/index.js.map +1 -0
  53. package/dist/util/index.d.ts +9 -0
  54. package/dist/util/index.d.ts.map +1 -0
  55. package/dist/util/index.js +7 -12
  56. package/dist/util/index.js.map +1 -0
  57. package/package.json +8 -7
  58. package/typedoc.config.js +6 -0
  59. package/dist/cjs/style/Modal.css +0 -41
  60. package/dist/components/CaptchaPlaceholder.js +0 -132
  61. package/dist/components/Checkbox.js +0 -57
  62. package/dist/components/LoadingSpinner.js +0 -30
  63. package/dist/components/theme.js +0 -44
  64. package/dist/style/Modal.css +0 -41
  65. package/public/style/Modal.css +0 -41
  66. package/vite.config.ts +0 -22
  67. /package/dist/cjs/{components → web-components/dist}/theme.cjs +0 -0
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("@emotion/react/jsx-runtime");
3
- const theme = require("./theme.cjs");
3
+ require("../web-components/dist/index.cjs");
4
4
  const React = require("react");
5
5
  const index = require("../util/index.cjs");
6
+ const theme = require("../web-components/dist/theme.cjs");
6
7
  const buttonStyleBase = {
7
8
  display: "inline-flex",
8
9
  alignItems: "center",
@@ -3,10 +3,11 @@ const jsxRuntime = require("@emotion/react/jsx-runtime");
3
3
  const CaptchaWidget = require("./CaptchaWidget.cjs");
4
4
  const React = require("react");
5
5
  const util = require("@prosopo/util");
6
- const theme = require("./theme.cjs");
6
+ require("../web-components/dist/index.cjs");
7
7
  const common = require("@prosopo/common");
8
8
  const Button = require("./Button.cjs");
9
9
  const index = require("../util/index.cjs");
10
+ const theme = require("../web-components/dist/theme.cjs");
10
11
  const CaptchaComponent = ({
11
12
  challenge,
12
13
  index: index$1,
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("@emotion/react/jsx-runtime");
4
4
  const common = require("@prosopo/common");
5
- const theme = require("./theme.cjs");
5
+ require("../web-components/dist/index.cjs");
6
6
  const React = require("react");
7
+ const theme = require("../web-components/dist/theme.cjs");
7
8
  const getHash = (item) => {
8
9
  if (!item.hash) {
9
10
  throw new common.ProsopoDatasetError("CAPTCHA.MISSING_ITEM_HASH", { context: { item } });
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("@emotion/react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const common = require("@prosopo/common");
@@ -45,4 +45,3 @@ const ExtensionAccountSelect = ({
45
45
  );
46
46
  };
47
47
  exports.ExtensionAccountSelect = ExtensionAccountSelect;
48
- exports.default = ExtensionAccountSelect;
@@ -1,17 +1,41 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("@emotion/react/jsx-runtime");
3
- require("../style/Modal.css");
4
3
  const React = require("react");
5
4
  const ModalComponent = React.memo((props, nextProps) => {
6
5
  const { show, children } = props;
7
6
  console.log("rendering modal with show: ", show);
8
7
  const display = show ? "block" : "none";
9
8
  const ModalOuterDivCss = {
9
+ position: "fixed",
10
+ zIndex: 2147483646,
11
+ inset: 0,
10
12
  display
11
13
  };
14
+ const ModalBackgroundCSS = {
15
+ position: "fixed",
16
+ display: "flex",
17
+ alignItems: "center",
18
+ justifyContent: "center",
19
+ right: 0,
20
+ bottom: 0,
21
+ top: 0,
22
+ left: 0,
23
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
24
+ zIndex: -1
25
+ };
26
+ const ModalInnerDivCSS = {
27
+ position: "absolute",
28
+ top: "50%",
29
+ left: "50%",
30
+ transform: "translate(-50%, -50%)",
31
+ width: "400px",
32
+ backgroundColor: "rgb(255, 255, 255)",
33
+ border: "none",
34
+ boxShadow: "rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px,"
35
+ };
12
36
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modalOuter", style: ModalOuterDivCss, children: [
13
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modalBackground" }),
14
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modalInner", children })
37
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modalBackground", style: ModalBackgroundCSS }),
38
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modalInner", style: ModalInnerDivCSS, children })
15
39
  ] });
16
40
  });
17
41
  module.exports = ModalComponent;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("@emotion/react/jsx-runtime");
3
- const CaptchaPlaceholder = require("./CaptchaPlaceholder.cjs");
3
+ require("../web-components/dist/index.cjs");
4
4
  const React = require("react");
5
+ const CaptchaPlaceholder = require("../web-components/dist/CaptchaPlaceholder.cjs");
5
6
  const _interopNamespaceDefaultOnly = (e) => Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: "Module" }));
6
7
  const ProcaptchaWidget = React.lazy(async () => Promise.resolve().then(() => /* @__PURE__ */ _interopNamespaceDefaultOnly(require("./ProcaptchaWidget.cjs"))));
7
8
  const Procaptcha = (props) => /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(CaptchaPlaceholder.ProcaptchaPlaceholder, { darkMode: props.config.theme }), children: /* @__PURE__ */ jsxRuntime.jsx(ProcaptchaWidget, { config: props.config, callbacks: props.callbacks }) });
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("@emotion/react/jsx-runtime");
3
+ require("../web-components/dist/index.cjs");
3
4
  const procaptcha = require("@prosopo/procaptcha");
4
- const LoadingSpinner = require("./LoadingSpinner.cjs");
5
5
  const react = require("@emotion/react");
6
- const theme = require("./theme.cjs");
7
6
  const React = require("react");
8
7
  const CaptchaComponent = require("./CaptchaComponent.cjs");
9
- const Checkbox = require("./Checkbox.cjs");
10
8
  const collector = require("./collector.cjs");
11
9
  const Modal = require("./Modal.cjs");
10
+ const theme = require("../web-components/dist/theme.cjs");
11
+ const Checkbox = require("../web-components/dist/Checkbox.cjs");
12
+ const LoadingSpinner = require("../web-components/dist/LoadingSpinner.cjs");
12
13
  const logoStyle = react.css`
13
14
  align-items: center;
14
15
  justify-content: flex-end;
@@ -192,7 +193,7 @@ const ProcaptchaWidget = (props) => {
192
193
  display: !state.loading ? "flex" : "none"
193
194
  },
194
195
  children: /* @__PURE__ */ jsxRuntime.jsx(
195
- Checkbox,
196
+ Checkbox.Checkbox,
196
197
  {
197
198
  themeColor,
198
199
  onChange: manager.start,
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("./components/index.cjs");
4
4
  require("./util/index.cjs");
5
- const ExtensionAccountSelect = require("./components/ExtensionAccountSelect.cjs");
6
5
  const ProcaptchaWidget = require("./components/ProcaptchaWidget.cjs");
7
6
  const Procaptcha = require("./components/Procaptcha.cjs");
8
7
  const CaptchaWidget = require("./components/CaptchaWidget.cjs");
9
- exports.ExtensionAccountSelect = ExtensionAccountSelect.ExtensionAccountSelect;
8
+ const ExtensionAccountSelect = require("./components/ExtensionAccountSelect.cjs");
10
9
  exports.ProcaptchaWidget = ProcaptchaWidget;
11
10
  exports.Procaptcha = Procaptcha;
12
11
  exports.CaptchaWidget = CaptchaWidget.CaptchaWidget;
12
+ exports.ExtensionAccountSelect = ExtensionAccountSelect.ExtensionAccountSelect;
@@ -41,89 +41,36 @@ const ProcaptchaPlaceholder = (props) => {
41
41
  const styleWidth = { maxWidth: "400px", minWidth: "200px", margin: "8px" };
42
42
  const themeColor = darkMode ? "light" : "dark";
43
43
  const theme$1 = React.useMemo(() => darkMode === "light" ? theme.lightTheme : theme.darkTheme, [darkMode]);
44
- return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { maxWidth: "100%", maxHeight: "100%", overflowX: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: styleWidth, "data-cy": "button-human", children: [
45
- " ",
46
- /* @__PURE__ */ jsxRuntime.jsxs(
47
- "div",
48
- {
49
- style: {
50
- padding: "8px",
51
- border: "1px solid",
52
- backgroundColor: theme$1.palette.background.default,
53
- borderColor: theme$1.palette.grey[300],
54
- borderRadius: "8px",
55
- display: "flex",
56
- justifyContent: "space-between",
57
- alignItems: "center",
58
- flexWrap: "wrap"
59
- },
60
- children: [
61
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsxRuntime.jsx(
62
- "div",
63
- {
64
- style: {
65
- display: "flex",
66
- justifyContent: "flex-start",
67
- alignItems: "center",
68
- flexWrap: "wrap"
69
- },
70
- children: /* @__PURE__ */ jsxRuntime.jsx(
71
- "div",
72
- {
73
- style: {
74
- height: "50px",
75
- width: "50px",
76
- display: "flex",
77
- alignItems: "center",
78
- justifyContent: "center",
79
- flexDirection: "column",
80
- verticalAlign: "middle"
81
- },
82
- children: /* @__PURE__ */ jsxRuntime.jsx(
83
- "div",
84
- {
85
- style: {
86
- display: "flex"
87
- },
88
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(LoadingSpinner.LoadingSpinner, { themeColor }) })
89
- }
90
- )
91
- }
92
- )
93
- }
94
- ) }),
95
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
96
- "a",
97
- {
98
- href: "https://www.prosopo.io/#features?ref=accounts.prosopo.io&utm_campaign=widget&utm_medium=checkbox",
99
- target: "_blank",
100
- "aria-label": "Visit prosopo.io to learn more about the service and its accessibility options.",
101
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
102
- /* @__PURE__ */ jsxRuntime.jsx(
103
- "div",
104
- {
105
- css: logoStyle,
106
- dangerouslySetInnerHTML: {
107
- __html: darkMode === "light" ? logoWithoutTextBlack : logoWithoutTextWhite
108
- }
109
- }
110
- ),
111
- /* @__PURE__ */ jsxRuntime.jsx(
112
- "div",
113
- {
114
- css: logoStyle,
115
- dangerouslySetInnerHTML: {
116
- __html: darkMode === "light" ? logoWithTextBlack : logoWithTextWhite
117
- }
118
- }
119
- )
120
- ] }) })
121
- }
122
- ) })
123
- ]
124
- }
125
- )
126
- ] }) }) });
44
+ return jsxRuntime.jsx("div", { children: jsxRuntime.jsx("div", { style: { maxWidth: "100%", maxHeight: "100%", overflowX: "auto" }, children: jsxRuntime.jsxs("div", { style: styleWidth, "data-cy": "button-human", children: [" ", jsxRuntime.jsxs("div", { style: {
45
+ padding: "8px",
46
+ border: "1px solid",
47
+ backgroundColor: theme$1.palette.background.default,
48
+ borderColor: theme$1.palette.grey[300],
49
+ borderRadius: "8px",
50
+ display: "flex",
51
+ justifyContent: "space-between",
52
+ alignItems: "center",
53
+ flexWrap: "wrap"
54
+ }, children: [jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column" }, children: jsxRuntime.jsx("div", { style: {
55
+ display: "flex",
56
+ justifyContent: "flex-start",
57
+ alignItems: "center",
58
+ flexWrap: "wrap"
59
+ }, children: jsxRuntime.jsx("div", { style: {
60
+ height: "50px",
61
+ width: "50px",
62
+ display: "flex",
63
+ alignItems: "center",
64
+ justifyContent: "center",
65
+ flexDirection: "column",
66
+ verticalAlign: "middle"
67
+ }, children: jsxRuntime.jsx("div", { style: {
68
+ display: "flex"
69
+ }, children: jsxRuntime.jsx("div", { style: { flex: 1 }, children: jsxRuntime.jsx(LoadingSpinner.LoadingSpinner, { themeColor }) }) }) }) }) }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx("a", { href: "https://www.prosopo.io/#features?ref=accounts.prosopo.io&utm_campaign=widget&utm_medium=checkbox", target: "_blank", "aria-label": "Visit prosopo.io to learn more about the service and its accessibility options.", children: jsxRuntime.jsx("div", { children: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("div", { css: logoStyle, dangerouslySetInnerHTML: {
70
+ __html: darkMode === "light" ? logoWithoutTextBlack : logoWithoutTextWhite
71
+ } }), jsxRuntime.jsx("div", { css: logoStyle, dangerouslySetInnerHTML: {
72
+ __html: darkMode === "light" ? logoWithTextBlack : logoWithTextWhite
73
+ } })] }) }) }) })] })] }) }) });
127
74
  };
128
75
  const logoWithTextBlack = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2062.63 468.67" height="35px" width="140px"><defs><style>.cls-1{fill:#1d1d1b;}</style></defs><title>Prosopo Logo Black</title><path class="cls-1" d="M335.55,1825.19A147.75,147.75,0,0,1,483.3,1972.94h50.5c0-109.49-88.76-198.25-198.25-198.25v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M269.36,1891.39A147.74,147.74,0,0,1,417.1,2039.13h50.5c0-109.49-88.75-198.24-198.24-198.24v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M414,2157.17a147.75,147.75,0,0,1-147.74-147.74h-50.5c0,109.49,88.75,198.24,198.24,198.24v-50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M480.17,2091a147.74,147.74,0,0,1-147.74-147.75H281.92c0,109.49,88.76,198.25,198.25,198.25V2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M862.8,2017.5q-27.39,22.86-78.25,22.86h-65v112.19H654.82v-312h134q46.32,0,73.86,24.13t27.55,74.72Q890.2,1994.64,862.8,2017.5ZM813,1905.1q-12.37-10.36-34.7-10.38H719.59v91.87h58.75q22.32,0,34.7-11.22t12.39-35.56Q825.43,1915.48,813,1905.1Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1045.69,1916.42c.78.08,2.51.19,5.19.32v61.81c-3.81-.42-7.2-.71-10.16-.85s-5.36-.21-7.2-.21q-36.4,0-48.89,23.71-7,13.33-7,41.06v110.29H916.89V1921.82h57.58V1962q14-23.07,24.34-31.54,16.94-14.18,44-14.18C1044,1916.32,1044.92,1916.35,1045.69,1916.42Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1265.64,2124.32q-29.21,36.06-88.69,36.06t-88.69-36.06Q1059,2088.26,1059,2037.5q0-49.9,29.22-86.5t88.69-36.59q59.47,0,88.69,36.59t29.21,86.5Q1294.85,2088.26,1265.64,2124.32ZM1217.38,2091q14.17-18.81,14.18-53.48t-14.18-53.37q-14.19-18.7-40.64-18.71T1136,1984.13q-14.29,18.72-14.29,53.37T1136,2091q14.28,18.81,40.75,18.81T1217.38,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1371.81,2078.88q1.92,16.1,8.29,22.87,11.28,12.06,41.7,12.06,17.85,0,28.39-5.29t10.53-15.88a17.12,17.12,0,0,0-8.48-15.45q-8.49-5.28-63.12-18.2-39.33-9.73-55.41-24.35-16.08-14.39-16.09-41.49,0-32,25.14-54.93t70.75-23q43.26,0,70.53,17.25t31.29,59.59H1455q-1.27-11.64-6.58-18.42-10-12.27-34-12.28-19.74,0-28.13,6.14t-8.38,14.4c0,6.91,3,11.93,8.92,15q8.89,4.89,63,16.73,36,8.46,54.05,25.61,17.77,17.35,17.78,43.39,0,34.3-25.56,56t-79,21.7q-54.51,0-80.49-23t-26-58.53Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1745.54,2124.32q-29.22,36.06-88.7,36.06t-88.69-36.06q-29.2-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.7,36.59t29.21,86.5Q1774.75,2088.26,1745.54,2124.32ZM1697.27,2091q14.19-18.81,14.19-53.48t-14.19-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.28,53.37t14.28,53.48q14.3,18.81,40.75,18.81T1697.27,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1992.75,1946.59q28.24,29.84,28.23,87.63,0,61-27.58,92.93t-71.06,32q-27.69,0-46-13.76-10-7.62-19.6-22.23v120.24H1797V1921.82h57.79v34.08q9.79-15,20.88-23.71,20.23-15.43,48.15-15.45Q1964.53,1916.74,1992.75,1946.59Zm-46.3,43.39q-12.3-20.52-39.88-20.53-33.15,0-45.54,31.11-6.43,16.51-6.42,41.92,0,40.21,21.58,56.51,12.82,9.53,30.37,9.53,25.45,0,38.83-19.48t13.36-51.86Q1958.75,2010.51,1946.45,1990Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M2249.14,2124.32q-29.2,36.06-88.69,36.06t-88.69-36.06q-29.22-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.69,36.59t29.22,86.5Q2278.36,2088.26,2249.14,2124.32ZM2200.88,2091q14.19-18.81,14.18-53.48t-14.18-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.29,53.37t14.29,53.48q14.3,18.81,40.75,18.81T2200.88,2091Z" transform="translate(-215.73 -1774.69)"/></svg>';
129
76
  const logoWithTextWhite = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2062.63 468.67" height="35px" width="140px"><defs><style>.cls-1{fill:#fff;}</style></defs><title>Prosopo Logo Black</title><path class="cls-1" d="M335.55,1825.19A147.75,147.75,0,0,1,483.3,1972.94h50.5c0-109.49-88.76-198.25-198.25-198.25v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M269.36,1891.39A147.74,147.74,0,0,1,417.1,2039.13h50.5c0-109.49-88.75-198.24-198.24-198.24v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M414,2157.17a147.75,147.75,0,0,1-147.74-147.74h-50.5c0,109.49,88.75,198.24,198.24,198.24v-50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M480.17,2091a147.74,147.74,0,0,1-147.74-147.75H281.92c0,109.49,88.76,198.25,198.25,198.25V2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M862.8,2017.5q-27.39,22.86-78.25,22.86h-65v112.19H654.82v-312h134q46.32,0,73.86,24.13t27.55,74.72Q890.2,1994.64,862.8,2017.5ZM813,1905.1q-12.37-10.36-34.7-10.38H719.59v91.87h58.75q22.32,0,34.7-11.22t12.39-35.56Q825.43,1915.48,813,1905.1Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1045.69,1916.42c.78.08,2.51.19,5.19.32v61.81c-3.81-.42-7.2-.71-10.16-.85s-5.36-.21-7.2-.21q-36.4,0-48.89,23.71-7,13.33-7,41.06v110.29H916.89V1921.82h57.58V1962q14-23.07,24.34-31.54,16.94-14.18,44-14.18C1044,1916.32,1044.92,1916.35,1045.69,1916.42Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1265.64,2124.32q-29.21,36.06-88.69,36.06t-88.69-36.06Q1059,2088.26,1059,2037.5q0-49.9,29.22-86.5t88.69-36.59q59.47,0,88.69,36.59t29.21,86.5Q1294.85,2088.26,1265.64,2124.32ZM1217.38,2091q14.17-18.81,14.18-53.48t-14.18-53.37q-14.19-18.7-40.64-18.71T1136,1984.13q-14.29,18.72-14.29,53.37T1136,2091q14.28,18.81,40.75,18.81T1217.38,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1371.81,2078.88q1.92,16.1,8.29,22.87,11.28,12.06,41.7,12.06,17.85,0,28.39-5.29t10.53-15.88a17.12,17.12,0,0,0-8.48-15.45q-8.49-5.28-63.12-18.2-39.33-9.73-55.41-24.35-16.08-14.39-16.09-41.49,0-32,25.14-54.93t70.75-23q43.26,0,70.53,17.25t31.29,59.59H1455q-1.27-11.64-6.58-18.42-10-12.27-34-12.28-19.74,0-28.13,6.14t-8.38,14.4c0,6.91,3,11.93,8.92,15q8.89,4.89,63,16.73,36,8.46,54.05,25.61,17.77,17.35,17.78,43.39,0,34.3-25.56,56t-79,21.7q-54.51,0-80.49-23t-26-58.53Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1745.54,2124.32q-29.22,36.06-88.7,36.06t-88.69-36.06q-29.2-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.7,36.59t29.21,86.5Q1774.75,2088.26,1745.54,2124.32ZM1697.27,2091q14.19-18.81,14.19-53.48t-14.19-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.28,53.37t14.28,53.48q14.3,18.81,40.75,18.81T1697.27,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1992.75,1946.59q28.24,29.84,28.23,87.63,0,61-27.58,92.93t-71.06,32q-27.69,0-46-13.76-10-7.62-19.6-22.23v120.24H1797V1921.82h57.79v34.08q9.79-15,20.88-23.71,20.23-15.43,48.15-15.45Q1964.53,1916.74,1992.75,1946.59Zm-46.3,43.39q-12.3-20.52-39.88-20.53-33.15,0-45.54,31.11-6.43,16.51-6.42,41.92,0,40.21,21.58,56.51,12.82,9.53,30.37,9.53,25.45,0,38.83-19.48t13.36-51.86Q1958.75,2010.51,1946.45,1990Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M2249.14,2124.32q-29.2,36.06-88.69,36.06t-88.69-36.06q-29.22-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.69,36.59t29.22,86.5Q2278.36,2088.26,2249.14,2124.32ZM2200.88,2091q14.19-18.81,14.18-53.48t-14.18-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.29,53.37t14.29,53.48q14.3,18.81,40.75,18.81T2200.88,2091Z" transform="translate(-215.73 -1774.69)"/></svg>';
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
2
3
  const jsxRuntime = require("@emotion/react/jsx-runtime");
3
4
  const react = require("@emotion/react");
4
5
  const theme = require("./theme.cjs");
@@ -38,19 +39,7 @@ const Checkbox = ({ themeColor, onChange, checked }) => {
38
39
  appearance: checked ? "auto" : "none"
39
40
  };
40
41
  }, [hover, theme$1, checked]);
41
- return /* @__PURE__ */ jsxRuntime.jsx(
42
- "input",
43
- {
44
- onMouseEnter: () => setHover(true),
45
- onMouseLeave: () => setHover(false),
46
- css: checkboxBefore,
47
- type: "checkbox",
48
- "aria-live": "assertive",
49
- "aria-haspopup": "true",
50
- onChange,
51
- checked,
52
- style: checkboxStyle
53
- }
54
- );
42
+ return jsxRuntime.jsx("input", { onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), css: checkboxBefore, type: "checkbox", "aria-live": "assertive", "aria-haspopup": "true", onChange, checked, style: checkboxStyle });
55
43
  };
56
- module.exports = Checkbox;
44
+ exports.Checkbox = Checkbox;
45
+ exports.default = Checkbox;
@@ -24,7 +24,7 @@ const LoadingSpinner = ({ themeColor }) => {
24
24
  }
25
25
  }
26
26
  `;
27
- return /* @__PURE__ */ jsxRuntime.jsx(StyledDiv, {});
27
+ return jsxRuntime.jsx(StyledDiv, {});
28
28
  };
29
29
  exports.LoadingSpinner = LoadingSpinner;
30
30
  exports.default = LoadingSpinner;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const CaptchaPlaceholder = require("./CaptchaPlaceholder.cjs");
4
+ const LoadingSpinner = require("./LoadingSpinner.cjs");
5
+ const theme = require("./theme.cjs");
6
+ const Checkbox = require("./Checkbox.cjs");
7
+ exports.ProcaptchaPlaceholder = CaptchaPlaceholder.ProcaptchaPlaceholder;
8
+ exports.LoadingSpinner = LoadingSpinner.LoadingSpinner;
9
+ exports.darkTheme = theme.darkTheme;
10
+ exports.lightTheme = theme.lightTheme;
11
+ exports.Checkbox = Checkbox.Checkbox;
@@ -0,0 +1,10 @@
1
+ import React, { ButtonHTMLAttributes } from 'react';
2
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
3
+ themeColor: 'light' | 'dark';
4
+ buttonType: 'cancel' | 'next';
5
+ onClick: () => void;
6
+ text: string;
7
+ }
8
+ declare const Button: React.FC<ButtonProps>;
9
+ export default Button;
10
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,oBAAoB,EAAoC,MAAM,OAAO,CAAA;AAGrF,UAAU,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACjE,UAAU,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,UAAU,EAAE,QAAQ,GAAG,MAAM,CAAA;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACf;AAgCD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAmCjC,CAAA;AACD,eAAe,MAAM,CAAA"}
@@ -1,69 +1,59 @@
1
- import { jsx } from "@emotion/react/jsx-runtime";
2
- import { lightTheme, darkTheme } from "./theme.js";
3
- import { useMemo, useState } from "react";
4
- import addDataAttr from "../util/index.js";
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { darkTheme, lightTheme } from '@prosopo/web-components';
3
+ import { useMemo, useState } from 'react';
4
+ import addDataAttr from '../util/index.js';
5
5
  const buttonStyleBase = {
6
- display: "inline-flex",
7
- alignItems: "center",
8
- justifyContent: "center",
9
- position: "relative",
10
- boxSizing: "border-box",
11
- outline: "0px",
12
- border: "0px",
13
- margin: "0px",
14
- cursor: "pointer",
15
- userSelect: "none",
16
- verticalAlign: "middle",
17
- appearance: void 0,
18
- textDecoration: "none",
19
- fontWeight: "500",
20
- fontSize: "0.875rem",
21
- lineHeight: "1.75",
22
- letterSpacing: "0.02857em",
23
- textTransform: "uppercase",
24
- minWidth: "64px",
25
- padding: "6px 16px",
26
- borderRadius: "4px",
27
- transition: "background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
28
- color: "rgb(0, 0, 0)",
29
- backgroundColor: "#ffffff",
30
- boxShadow: "rgba(0, 0, 0, 0.2) 0px 3px 1px -2px, rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px"
6
+ display: 'inline-flex',
7
+ alignItems: 'center',
8
+ justifyContent: 'center',
9
+ position: 'relative',
10
+ boxSizing: 'border-box',
11
+ outline: '0px',
12
+ border: '0px',
13
+ margin: '0px',
14
+ cursor: 'pointer',
15
+ userSelect: 'none',
16
+ verticalAlign: 'middle',
17
+ appearance: undefined,
18
+ textDecoration: 'none',
19
+ fontWeight: '500',
20
+ fontSize: '0.875rem',
21
+ lineHeight: '1.75',
22
+ letterSpacing: '0.02857em',
23
+ textTransform: 'uppercase',
24
+ minWidth: '64px',
25
+ padding: '6px 16px',
26
+ borderRadius: '4px',
27
+ transition: 'background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',
28
+ color: 'rgb(0, 0, 0)',
29
+ backgroundColor: '#ffffff',
30
+ boxShadow: 'rgba(0, 0, 0, 0.2) 0px 3px 1px -2px, rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px',
31
31
  };
32
32
  const Button = ({ themeColor, buttonType, text, onClick }) => {
33
- const theme = useMemo(() => themeColor === "light" ? lightTheme : darkTheme, [themeColor]);
34
- const [hover, setHover] = useState(false);
35
- const buttonStyle = useMemo(() => {
36
- const baseStyle = {
37
- ...buttonStyleBase,
38
- color: hover ? theme.palette.primary.contrastText : theme.palette.background.contrastText
39
- };
40
- if (buttonType === "cancel") {
41
- return {
42
- ...baseStyle,
43
- backgroundColor: hover ? theme.palette.grey[600] : "transparent"
44
- };
45
- } else {
46
- return {
47
- ...baseStyle,
48
- backgroundColor: hover ? theme.palette.primary.main : theme.palette.background.default
49
- };
50
- }
51
- }, [buttonType, hover, theme]);
52
- return /* @__PURE__ */ jsx(
53
- "button",
54
- {
55
- ...addDataAttr({ dev: { cy: `button-${buttonType}` } }),
56
- onMouseEnter: () => setHover(true),
57
- onMouseLeave: () => setHover(false),
58
- style: buttonStyle,
59
- onClick: (e) => {
60
- e.preventDefault();
61
- onClick();
62
- },
63
- children: text
64
- }
65
- );
66
- };
67
- export {
68
- Button as default
33
+ const theme = useMemo(() => (themeColor === 'light' ? lightTheme : darkTheme), [themeColor]);
34
+ const [hover, setHover] = useState(false);
35
+ const buttonStyle = useMemo(() => {
36
+ const baseStyle = {
37
+ ...buttonStyleBase,
38
+ color: hover ? theme.palette.primary.contrastText : theme.palette.background.contrastText,
39
+ };
40
+ if (buttonType === 'cancel') {
41
+ return {
42
+ ...baseStyle,
43
+ backgroundColor: hover ? theme.palette.grey[600] : 'transparent',
44
+ };
45
+ }
46
+ else {
47
+ return {
48
+ ...baseStyle,
49
+ backgroundColor: hover ? theme.palette.primary.main : theme.palette.background.default,
50
+ };
51
+ }
52
+ }, [buttonType, hover, theme]);
53
+ return (_jsx("button", { ...addDataAttr({ dev: { cy: `button-${buttonType}` } }), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), style: buttonStyle, onClick: (e) => {
54
+ e.preventDefault();
55
+ onClick();
56
+ }, children: text }));
69
57
  };
58
+ export default Button;
59
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAc,EAAuC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrF,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAS1C,MAAM,eAAe,GAAkB;IACnC,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;IACxB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,MAAM;IAClB,aAAa,EAAE,QAAQ;IACvB,UAAU,EAAE,SAAS;IACrB,cAAc,EAAE,MAAM;IACtB,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,MAAM;IAClB,aAAa,EAAE,WAAW;IAC1B,aAAa,EAAE,WAAW;IAC1B,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,KAAK;IACnB,UAAU,EACN,+MAA+M;IACnN,KAAK,EAAE,cAAc;IACrB,eAAe,EAAE,SAAS;IAC1B,SAAS,EACL,+GAA+G;CACtH,CAAA;AAED,MAAM,MAAM,GAA0B,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAe,EAAE,EAAE;IAC7F,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA;IAC5F,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACzC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE;QAC7B,MAAM,SAAS,GAAG;YACd,GAAG,eAAe;YAClB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY;SAC5F,CAAA;QACD,IAAI,UAAU,KAAK,QAAQ,EAAE;YACzB,OAAO;gBACH,GAAG,SAAS;gBACZ,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa;aACnE,CAAA;SACJ;aAAM;YACH,OAAO;gBACH,GAAG,SAAS;gBACZ,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO;aACzF,CAAA;SACJ;IACL,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;IAE9B,OAAO,CACH,oBACQ,WAAW,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,UAAU,UAAU,EAAE,EAAE,EAAE,CAAC,EACxD,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAClC,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EACnC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACX,CAAC,CAAC,cAAc,EAAE,CAAA;YAClB,OAAO,EAAE,CAAA;QACb,CAAC,YAEA,IAAI,GACA,CACZ,CAAA;AACL,CAAC,CAAA;AACD,eAAe,MAAM,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { GetCaptchaResponse } from '@prosopo/api';
2
+ export interface CaptchaComponentProps {
3
+ challenge: GetCaptchaResponse;
4
+ index: number;
5
+ solutions: string[][];
6
+ onSubmit: () => void;
7
+ onCancel: () => void;
8
+ onClick: (hash: string) => void;
9
+ onNext: () => void;
10
+ themeColor: 'light' | 'dark';
11
+ }
12
+ declare const CaptchaComponent: ({ challenge, index, solutions, onSubmit, onCancel, onClick, onNext, themeColor, }: CaptchaComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
13
+ export default CaptchaComponent;
14
+ //# sourceMappingURL=CaptchaComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CaptchaComponent.d.ts","sourceRoot":"","sources":["../../src/components/CaptchaComponent.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAQjD,MAAM,WAAW,qBAAqB;IAClC,SAAS,EAAE,kBAAkB,CAAA;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,EAAE,EAAE,CAAA;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,UAAU,EAAE,OAAO,GAAG,MAAM,CAAA;CAC/B;AAED,QAAA,MAAM,gBAAgB,sFASnB,qBAAqB,qDA8GvB,CAAA;AAED,eAAe,gBAAgB,CAAA"}