@prosopo/procaptcha-react 1.0.2 → 2.0.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 (49) hide show
  1. package/dist/cjs/components/Button.cjs +14 -7
  2. package/dist/cjs/components/CaptchaComponent.cjs +69 -42
  3. package/dist/cjs/components/CaptchaWidget.cjs +137 -99
  4. package/dist/cjs/components/Modal.cjs +38 -36
  5. package/dist/cjs/components/Procaptcha.cjs +2 -4
  6. package/dist/cjs/components/ProcaptchaWidget.cjs +121 -101
  7. package/dist/cjs/util/index.cjs +6 -2
  8. package/dist/components/Button.d.ts +4 -3
  9. package/dist/components/Button.d.ts.map +1 -1
  10. package/dist/components/Button.js +40 -38
  11. package/dist/components/Button.js.map +1 -1
  12. package/dist/components/CaptchaComponent.d.ts +2 -2
  13. package/dist/components/CaptchaComponent.d.ts.map +1 -1
  14. package/dist/components/CaptchaComponent.js +61 -48
  15. package/dist/components/CaptchaComponent.js.map +1 -1
  16. package/dist/components/CaptchaWidget.d.ts +4 -4
  17. package/dist/components/CaptchaWidget.d.ts.map +1 -1
  18. package/dist/components/CaptchaWidget.js +84 -47
  19. package/dist/components/CaptchaWidget.js.map +1 -1
  20. package/dist/components/Modal.d.ts +1 -1
  21. package/dist/components/Modal.d.ts.map +1 -1
  22. package/dist/components/Modal.js +16 -16
  23. package/dist/components/Modal.js.map +1 -1
  24. package/dist/components/Procaptcha.d.ts +3 -3
  25. package/dist/components/Procaptcha.d.ts.map +1 -1
  26. package/dist/components/Procaptcha.js +3 -3
  27. package/dist/components/Procaptcha.js.map +1 -1
  28. package/dist/components/ProcaptchaWidget.d.ts +1 -1
  29. package/dist/components/ProcaptchaWidget.d.ts.map +1 -1
  30. package/dist/components/ProcaptchaWidget.js +40 -37
  31. package/dist/components/ProcaptchaWidget.js.map +1 -1
  32. package/dist/components/collector.d.ts +1 -1
  33. package/dist/components/collector.d.ts.map +1 -1
  34. package/dist/components/collector.js +4 -4
  35. package/dist/components/collector.js.map +1 -1
  36. package/dist/components/index.d.ts +5 -5
  37. package/dist/components/index.d.ts.map +1 -1
  38. package/dist/components/index.js +5 -5
  39. package/dist/components/index.js.map +1 -1
  40. package/dist/index.d.ts +2 -2
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +2 -2
  43. package/dist/index.js.map +1 -1
  44. package/dist/util/index.d.ts.map +1 -1
  45. package/dist/util/index.js +3 -1
  46. package/dist/util/index.js.map +1 -1
  47. package/package.json +68 -72
  48. package/vite.cjs.config.ts +6 -3
  49. package/dist/cjs/components/collector.cjs +0 -26
@@ -30,8 +30,16 @@ const buttonStyleBase = {
30
30
  backgroundColor: "#ffffff",
31
31
  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"
32
32
  };
33
- const Button = ({ themeColor, buttonType, text, onClick }) => {
34
- const theme = React.useMemo(() => themeColor === "light" ? webComponents.lightTheme : webComponents.darkTheme, [themeColor]);
33
+ const Button = ({
34
+ themeColor,
35
+ buttonType,
36
+ text,
37
+ onClick
38
+ }) => {
39
+ const theme = React.useMemo(
40
+ () => themeColor === "light" ? webComponents.lightTheme : webComponents.darkTheme,
41
+ [themeColor]
42
+ );
35
43
  const [hover, setHover] = React.useState(false);
36
44
  const buttonStyle = React.useMemo(() => {
37
45
  const baseStyle = {
@@ -43,12 +51,11 @@ const Button = ({ themeColor, buttonType, text, onClick }) => {
43
51
  ...baseStyle,
44
52
  backgroundColor: hover ? theme.palette.grey[600] : "transparent"
45
53
  };
46
- } else {
47
- return {
48
- ...baseStyle,
49
- backgroundColor: hover ? theme.palette.primary.main : theme.palette.background.default
50
- };
51
54
  }
55
+ return {
56
+ ...baseStyle,
57
+ backgroundColor: hover ? theme.palette.primary.main : theme.palette.background.default
58
+ };
52
59
  }, [buttonType, hover, theme]);
53
60
  return /* @__PURE__ */ jsxRuntime.jsx(
54
61
  "button",
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("@emotion/react/jsx-runtime");
3
- const CaptchaWidget = require("./CaptchaWidget.cjs");
4
- const React = require("react");
3
+ const common = require("@prosopo/common");
5
4
  const util = require("@prosopo/util");
6
5
  const webComponents = require("@prosopo/web-components");
7
- const common = require("@prosopo/common");
8
- const Button = require("./Button.cjs");
6
+ const React = require("react");
9
7
  const index = require("../util/index.cjs");
8
+ const Button = require("./Button.cjs");
9
+ const CaptchaWidget = require("./CaptchaWidget.cjs");
10
10
  const CaptchaComponent = ({
11
11
  challenge,
12
12
  index: index$1,
@@ -20,7 +20,10 @@ const CaptchaComponent = ({
20
20
  const { t } = common.useTranslation();
21
21
  const captcha = challenge.captchas ? util.at(challenge.captchas, index$1) : null;
22
22
  const solution = solutions ? util.at(solutions, index$1) : [];
23
- const theme = React.useMemo(() => themeColor === "light" ? webComponents.lightTheme : webComponents.darkTheme, [themeColor]);
23
+ const theme = React.useMemo(
24
+ () => themeColor === "light" ? webComponents.lightTheme : webComponents.darkTheme,
25
+ [themeColor]
26
+ );
24
27
  return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntime.jsx(
25
28
  "div",
26
29
  {
@@ -32,7 +35,12 @@ const CaptchaComponent = ({
32
35
  maxWidth: "500px",
33
36
  maxHeight: "100%",
34
37
  display: "flex",
35
- flexDirection: "column"
38
+ flexDirection: "column",
39
+ border: "1px solid #dddddd",
40
+ boxShadow: "rgba(255, 255, 255, 0.2) 0px 0px 4px",
41
+ borderRadius: "4px",
42
+ padding: `${theme.spacing.unit}px`,
43
+ backgroundColor: theme.palette.background.default
36
44
  },
37
45
  children: /* @__PURE__ */ jsxRuntime.jsxs(
38
46
  "div",
@@ -44,47 +52,65 @@ const CaptchaComponent = ({
44
52
  minWidth: "300px"
45
53
  },
46
54
  children: [
47
- /* @__PURE__ */ jsxRuntime.jsxs(
55
+ /* @__PURE__ */ jsxRuntime.jsx(
48
56
  "div",
49
57
  {
50
58
  style: {
51
59
  display: "flex",
52
60
  alignItems: "center",
53
- width: "100%",
54
- backgroundColor: theme.palette.primary.main,
55
- padding: "24px 16px"
61
+ width: "100%"
56
62
  },
57
- children: [
58
- /* @__PURE__ */ jsxRuntime.jsxs(
59
- "p",
60
- {
61
- style: {
62
- color: "#ffffff",
63
- fontWeight: 700,
64
- lineHeight: 1.5
65
- },
66
- children: [
67
- t("WIDGET.SELECT_ALL"),
68
- ": "
69
- ]
70
- }
71
- ),
72
- /* @__PURE__ */ jsxRuntime.jsx(
73
- "p",
74
- {
75
- style: {
76
- color: "#ffffff",
77
- fontWeight: 700,
78
- textTransform: "capitalize",
79
- lineHeight: 1.5
80
- },
81
- children: `${util.at(challenge.captchas, index$1).captcha.target}`
82
- }
83
- )
84
- ]
63
+ children: /* @__PURE__ */ jsxRuntime.jsx(
64
+ "div",
65
+ {
66
+ style: {
67
+ backgroundColor: theme.palette.primary.main,
68
+ width: "100%"
69
+ },
70
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
71
+ "div",
72
+ {
73
+ style: {
74
+ paddingLeft: `${theme.spacing.half}px`,
75
+ paddingRight: `${theme.spacing.half}px`
76
+ },
77
+ children: [
78
+ /* @__PURE__ */ jsxRuntime.jsxs(
79
+ "p",
80
+ {
81
+ style: {
82
+ color: "#ffffff",
83
+ fontWeight: 700,
84
+ lineHeight: 1.5
85
+ },
86
+ children: [
87
+ t("WIDGET.SELECT_ALL"),
88
+ ":",
89
+ " ",
90
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { textTransform: "capitalize" }, children: `${util.at(challenge.captchas, index$1).target}` })
91
+ ]
92
+ }
93
+ ),
94
+ /* @__PURE__ */ jsxRuntime.jsx(
95
+ "p",
96
+ {
97
+ style: {
98
+ color: "#ffffff",
99
+ fontWeight: 500,
100
+ lineHeight: 0.8,
101
+ fontSize: "0.8rem"
102
+ },
103
+ children: t("WIDGET.IF_NONE_CLICK_NEXT")
104
+ }
105
+ )
106
+ ]
107
+ }
108
+ )
109
+ }
110
+ )
85
111
  }
86
112
  ),
87
- /* @__PURE__ */ jsxRuntime.jsx("div", { ...index({ dev: { cy: "captcha-" + index$1 } }), children: captcha && /* @__PURE__ */ jsxRuntime.jsx(
113
+ /* @__PURE__ */ jsxRuntime.jsx("div", { ...index({ dev: { cy: `captcha-${index$1}` } }), children: captcha && /* @__PURE__ */ jsxRuntime.jsx(
88
114
  CaptchaWidget.CaptchaWidget,
89
115
  {
90
116
  challenge: captcha,
@@ -109,7 +135,7 @@ const CaptchaComponent = ({
109
135
  "div",
110
136
  {
111
137
  style: {
112
- padding: "8px 16px",
138
+ padding: `0 ${theme.spacing}px`,
113
139
  display: "flex",
114
140
  width: "100%"
115
141
  }
@@ -119,7 +145,7 @@ const CaptchaComponent = ({
119
145
  "div",
120
146
  {
121
147
  style: {
122
- padding: "0 16px 16px",
148
+ padding: `0 ${theme.spacing}px`,
123
149
  display: "flex",
124
150
  alignItems: "center",
125
151
  justifyContent: "space-between",
@@ -143,7 +169,8 @@ const CaptchaComponent = ({
143
169
  buttonType: "next",
144
170
  text: index$1 < challenge.captchas.length - 1 ? t("WIDGET.NEXT") : t("WIDGET.SUBMIT"),
145
171
  onClick: index$1 < challenge.captchas.length - 1 ? onNext : onSubmit,
146
- "aria-label": index$1 < challenge.captchas.length - 1 ? t("WIDGET.NEXT") : t("WIDGET.SUBMIT")
172
+ "aria-label": index$1 < challenge.captchas.length - 1 ? t("WIDGET.NEXT") : t("WIDGET.SUBMIT"),
173
+ "data-cy": "button-next"
147
174
  }
148
175
  )
149
176
  ]
@@ -6,14 +6,50 @@ const webComponents = require("@prosopo/web-components");
6
6
  const React = require("react");
7
7
  const getHash = (item) => {
8
8
  if (!item.hash) {
9
- throw new common.ProsopoDatasetError("CAPTCHA.MISSING_ITEM_HASH", { context: { item } });
9
+ throw new common.ProsopoDatasetError("CAPTCHA.MISSING_ITEM_HASH", {
10
+ context: { item }
11
+ });
10
12
  }
11
13
  return item.hash;
12
14
  };
13
- const CaptchaWidget = ({ challenge, solution, onClick, themeColor }) => {
14
- const items = challenge.captcha.items;
15
- const theme = React.useMemo(() => themeColor === "light" ? webComponents.lightTheme : webComponents.darkTheme, [themeColor]);
15
+ const CaptchaWidget = ({
16
+ challenge,
17
+ solution,
18
+ onClick,
19
+ themeColor
20
+ }) => {
21
+ const items = challenge.items;
22
+ const theme = React.useMemo(
23
+ () => themeColor === "light" ? webComponents.lightTheme : webComponents.darkTheme,
24
+ [themeColor]
25
+ );
16
26
  const isTouchDevice = "ontouchstart" in window;
27
+ const fullSpacing = `${theme.spacing.unit}px`;
28
+ const halfSpacing = `${theme.spacing.half}px`;
29
+ const paddingForImageColumns = {
30
+ 0: {
31
+ paddingLeft: 0,
32
+ paddingRight: halfSpacing,
33
+ paddingTop: halfSpacing,
34
+ paddingBottom: halfSpacing
35
+ },
36
+ 1: {
37
+ paddingLeft: halfSpacing,
38
+ paddingRight: halfSpacing,
39
+ paddingTop: halfSpacing,
40
+ paddingBottom: halfSpacing
41
+ },
42
+ 2: {
43
+ paddingLeft: halfSpacing,
44
+ paddingRight: 0,
45
+ paddingTop: halfSpacing,
46
+ paddingBottom: halfSpacing
47
+ }
48
+ };
49
+ const paddingForImageRows = {
50
+ 0: { paddingTop: fullSpacing },
51
+ 2: { paddingBottom: fullSpacing }
52
+ };
17
53
  return /* @__PURE__ */ jsxRuntime.jsx(
18
54
  "div",
19
55
  {
@@ -30,118 +66,120 @@ const CaptchaWidget = ({ challenge, solution, onClick, themeColor }) => {
30
66
  },
31
67
  children: items.map((item, index) => {
32
68
  const hash = getHash(item);
33
- return /* @__PURE__ */ jsxRuntime.jsx(
69
+ const imageStyle = {
70
+ ...paddingForImageColumns[index % 3],
71
+ ...paddingForImageRows[Math.floor(index / 3)],
72
+ // enable the items in the grid to grow in width to use up excess space
73
+ flexGrow: 1,
74
+ // make the width of each item 1/3rd of the width overall, i.e. 3 columns
75
+ flexBasis: "33.3333%",
76
+ // include the padding / margin / border in the width
77
+ boxSizing: "border-box"
78
+ };
79
+ console.log("imageStyle index ", index, imageStyle);
80
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style: imageStyle, children: /* @__PURE__ */ jsxRuntime.jsxs(
34
81
  "div",
35
82
  {
36
83
  style: {
37
- paddingTop: "4px",
38
- paddingLeft: "4px",
39
- // enable the items in the grid to grow in width to use up excess space
40
- flexGrow: 1,
41
- // make the width of each item 1/3rd of the width overall, i.e. 3 columns
42
- flexBasis: "33.3333%",
43
- // include the padding / margin / border in the width
44
- boxSizing: "border-box"
84
+ cursor: "pointer",
85
+ height: "100%",
86
+ width: "100%",
87
+ border: 1,
88
+ borderStyle: "solid",
89
+ borderColor: theme.palette.grey[300]
45
90
  },
46
- children: /* @__PURE__ */ jsxRuntime.jsxs(
47
- "div",
48
- {
49
- style: { cursor: "pointer", height: "100%", width: "100%" },
50
- onClick: isTouchDevice ? void 0 : () => onClick(hash),
51
- onTouchStart: isTouchDevice ? () => onClick(hash) : void 0,
52
- children: [
53
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { border: 1, borderColor: theme.palette.grey[300] }, children: /* @__PURE__ */ jsxRuntime.jsx(
54
- "img",
55
- {
56
- style: {
57
- width: "100%",
58
- // image should be full width / height of the item
59
- backgroundColor: theme.palette.grey[300],
60
- // colour of the bands when letterboxing and image
61
- opacity: solution.includes(hash) && isTouchDevice ? "50%" : "100%",
62
- // iphone workaround
63
- display: "block",
64
- // removes whitespace below imgs
65
- objectFit: "contain",
66
- // contain the entire image in the img tag
67
- aspectRatio: "1/1",
68
- // force AR to be 1, letterboxing images with different aspect ratios
69
- height: "auto"
70
- // make the img tag responsive to its container
71
- },
72
- src: item.data,
73
- alt: `Captcha image ${index + 1}`
74
- }
75
- ) }),
76
- /* @__PURE__ */ jsxRuntime.jsx(
91
+ onClick: isTouchDevice ? void 0 : () => onClick(hash),
92
+ onTouchStart: isTouchDevice ? () => onClick(hash) : void 0,
93
+ children: [
94
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
95
+ "img",
96
+ {
97
+ style: {
98
+ width: "100%",
99
+ // image should be full width / height of the item
100
+ backgroundColor: theme.palette.grey[300],
101
+ // colour of the bands when letterboxing and image
102
+ opacity: solution.includes(hash) && isTouchDevice ? "50%" : "100%",
103
+ // iphone workaround
104
+ display: "block",
105
+ // removes whitespace below imgs
106
+ objectFit: "contain",
107
+ // contain the entire image in the img tag
108
+ aspectRatio: "1/1",
109
+ // force AR to be 1, letterboxing images with different aspect ratios
110
+ height: "auto"
111
+ // make the img tag responsive to its container
112
+ },
113
+ src: item.data,
114
+ alt: `Captcha image ${index + 1}`
115
+ }
116
+ ) }),
117
+ /* @__PURE__ */ jsxRuntime.jsx(
118
+ "div",
119
+ {
120
+ style: {
121
+ // relative to where the element _should_ be positioned
122
+ position: "relative",
123
+ // make the overlay the full height/width of an item
124
+ width: "100%",
125
+ height: "100%",
126
+ // shift it up 100% to overlay the item element
127
+ top: "-100%",
128
+ visibility: solution.includes(hash) ? "visible" : "hidden",
129
+ // transition on opacity upon (de)selection
130
+ transition: "opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
131
+ opacity: 1
132
+ },
133
+ children: /* @__PURE__ */ jsxRuntime.jsx(
77
134
  "div",
78
135
  {
79
136
  style: {
80
- // relative to where the element _should_ be positioned
81
- position: "relative",
82
- // make the overlay the full height/width of an item
83
- width: "100%",
137
+ // make the overlay absolute positioned compare to its container
138
+ position: "absolute",
139
+ // spread across 100% width/height of the item box
140
+ top: 0,
141
+ left: 0,
142
+ bottom: 0,
143
+ right: 0,
84
144
  height: "100%",
85
- // shift it up 100% to overlay the item element
86
- top: "-100%",
87
- visibility: solution.includes(hash) ? "visible" : "hidden",
88
- // transition on opacity upon (de)selection
89
- transition: "opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
90
- opacity: 1
145
+ width: "100%",
146
+ // display overlays in center
147
+ display: "flex",
148
+ alignItems: "center",
149
+ justifyContent: "center",
150
+ // make bg half opacity, i.e. shadowing the item's img
151
+ backgroundColor: "rgba(0,0,0,0.5)"
91
152
  },
92
153
  children: /* @__PURE__ */ jsxRuntime.jsx(
93
- "div",
154
+ "svg",
94
155
  {
95
156
  style: {
96
- // make the overlay absolute positioned compare to its container
97
- position: "absolute",
98
- // spread across 100% width/height of the item box
99
- top: 0,
100
- left: 0,
101
- bottom: 0,
102
- right: 0,
103
- height: "100%",
104
- width: "100%",
105
- // display overlays in center
106
- display: "flex",
107
- alignItems: "center",
108
- justifyContent: "center",
109
- // make bg half opacity, i.e. shadowing the item's img
110
- backgroundColor: "rgba(0,0,0,0.5)"
157
+ backgroundColor: "transparent",
158
+ // img must be displayed as block otherwise gets a bottom whitespace border
159
+ display: "block",
160
+ // how big the overlay icon is
161
+ width: "35%",
162
+ height: "35%",
163
+ transition: "fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
164
+ userSelect: "none",
165
+ fill: "currentcolor"
111
166
  },
112
- children: /* @__PURE__ */ jsxRuntime.jsx(
113
- "svg",
114
- {
115
- style: {
116
- backgroundColor: "transparent",
117
- // img must be displayed as block otherwise gets a bottom whitespace border
118
- display: "block",
119
- // how big the overlay icon is
120
- width: "35%",
121
- height: "35%",
122
- transition: "fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
123
- userSelect: "none",
124
- fill: "currentcolor"
125
- },
126
- focusable: "false",
127
- color: "#fff",
128
- "aria-hidden": "true",
129
- viewBox: "0 0 24 24",
130
- "data-testid": "CheckIcon",
131
- "aria-label": "Check icon",
132
- children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" })
133
- }
134
- )
167
+ focusable: "false",
168
+ color: "#fff",
169
+ "aria-hidden": "true",
170
+ viewBox: "0 0 24 24",
171
+ "data-testid": "CheckIcon",
172
+ "aria-label": "Check icon",
173
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" })
135
174
  }
136
175
  )
137
176
  }
138
177
  )
139
- ]
140
- }
141
- )
142
- },
143
- index
144
- );
178
+ }
179
+ )
180
+ ]
181
+ }
182
+ ) }, item.hash);
145
183
  })
146
184
  }
147
185
  );
@@ -1,40 +1,42 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("@emotion/react/jsx-runtime");
3
3
  const React = require("react");
4
- const ModalComponent = React.memo((props, nextProps) => {
5
- const { show, children } = props;
6
- const display = show ? "block" : "none";
7
- const ModalOuterDivCss = {
8
- position: "fixed",
9
- zIndex: 2147483646,
10
- inset: 0,
11
- display
12
- };
13
- const ModalBackgroundCSS = {
14
- position: "fixed",
15
- display: "flex",
16
- alignItems: "center",
17
- justifyContent: "center",
18
- right: 0,
19
- bottom: 0,
20
- top: 0,
21
- left: 0,
22
- backgroundColor: "rgba(0, 0, 0, 0.5)",
23
- zIndex: -1
24
- };
25
- const ModalInnerDivCSS = {
26
- position: "absolute",
27
- top: "50%",
28
- left: "50%",
29
- transform: "translate(-50%, -50%)",
30
- width: "400px",
31
- backgroundColor: "rgb(255, 255, 255)",
32
- border: "none",
33
- 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,"
34
- };
35
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modalOuter", style: ModalOuterDivCss, children: [
36
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modalBackground", style: ModalBackgroundCSS }),
37
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modalInner", style: ModalInnerDivCSS, children })
38
- ] });
39
- });
4
+ const ModalComponent = React.memo(
5
+ (props, nextProps) => {
6
+ const { show, children } = props;
7
+ const display = show ? "block" : "none";
8
+ const ModalOuterDivCss = {
9
+ position: "fixed",
10
+ zIndex: 2147483646,
11
+ inset: 0,
12
+ display
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: "transparent",
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
+ };
36
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modalOuter", style: ModalOuterDivCss, children: [
37
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modalBackground", style: ModalBackgroundCSS }),
38
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modalInner", style: ModalInnerDivCSS, children })
39
+ ] });
40
+ }
41
+ );
40
42
  module.exports = ModalComponent;
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("@emotion/react/jsx-runtime");
3
- const React = require("react");
4
3
  const webComponents = require("@prosopo/web-components");
4
+ const React = require("react");
5
5
  const _interopNamespaceDefaultOnly = (e) => Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: "Module" }));
6
- const ProcaptchaWidget = React.lazy(
7
- async () => Promise.resolve().then(() => /* @__PURE__ */ _interopNamespaceDefaultOnly(require("./ProcaptchaWidget.cjs")))
8
- );
6
+ const ProcaptchaWidget = React.lazy(async () => Promise.resolve().then(() => /* @__PURE__ */ _interopNamespaceDefaultOnly(require("./ProcaptchaWidget.cjs"))));
9
7
  const Procaptcha = (props) => /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(webComponents.ProcaptchaPlaceholder, { darkMode: props.config.theme }), children: /* @__PURE__ */ jsxRuntime.jsx(ProcaptchaWidget, { config: props.config, callbacks: props.callbacks }) });
10
8
  module.exports = Procaptcha;