@thecb/components 11.3.0-beta.0 → 11.3.1-beta.0
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/dist/index.cjs.js +105 -86
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +105 -86
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/jumbo/Jumbo.js +18 -3
- package/src/components/atoms/spinner/Spinner.js +2 -1
- package/src/components/molecules/turnstile-widget/TurnstileWidget.js +18 -12
- package/src/constants/colors.js +8 -1
package/package.json
CHANGED
package/src/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -2,14 +2,17 @@ import React, { useContext } from "react";
|
|
|
2
2
|
import { ThemeContext } from "styled-components";
|
|
3
3
|
|
|
4
4
|
import ButtonWithLink from "../button-with-link";
|
|
5
|
+
import Spinner from "../spinner";
|
|
5
6
|
import { Box, Cluster, Center, Cover, Switcher } from "../layouts";
|
|
6
7
|
import Heading from "../heading";
|
|
7
8
|
import Title from "../title";
|
|
8
9
|
import withWindowSize from "../../withWindowSize";
|
|
10
|
+
import { WHITE } from "../../../constants/colors";
|
|
9
11
|
|
|
10
12
|
const Jumbo = ({
|
|
11
13
|
showButton,
|
|
12
14
|
heading,
|
|
15
|
+
isHeadingLoading = false,
|
|
13
16
|
buttonLink,
|
|
14
17
|
subHeading,
|
|
15
18
|
buttonText,
|
|
@@ -55,16 +58,28 @@ const Jumbo = ({
|
|
|
55
58
|
<Title
|
|
56
59
|
variant={isMobile ? "small" : "large"}
|
|
57
60
|
as="h1"
|
|
58
|
-
color=
|
|
61
|
+
color={WHITE}
|
|
59
62
|
className="themeJumboHeading"
|
|
60
63
|
extraStyles={showCartStatus && isMobile && `max-width: 60%;`}
|
|
61
64
|
>
|
|
62
|
-
{
|
|
65
|
+
{isHeadingLoading ? (
|
|
66
|
+
<Spinner
|
|
67
|
+
size="50"
|
|
68
|
+
cx="25"
|
|
69
|
+
cy="25"
|
|
70
|
+
radius="12.5"
|
|
71
|
+
strokeWidth="3"
|
|
72
|
+
centerSpinner
|
|
73
|
+
color={WHITE}
|
|
74
|
+
/>
|
|
75
|
+
) : (
|
|
76
|
+
heading
|
|
77
|
+
)}
|
|
63
78
|
</Title>
|
|
64
79
|
{subHeading && (
|
|
65
80
|
<Heading
|
|
66
81
|
variant={isMobile ? "h6" : "h2"}
|
|
67
|
-
color=
|
|
82
|
+
color={WHITE}
|
|
68
83
|
className="themeJumboSubheading"
|
|
69
84
|
>
|
|
70
85
|
{subHeading}
|
|
@@ -65,6 +65,7 @@ const Spinner = ({
|
|
|
65
65
|
size = "24",
|
|
66
66
|
centerSpinner = false,
|
|
67
67
|
themeValues,
|
|
68
|
+
color = themeValues.color,
|
|
68
69
|
cx = "50",
|
|
69
70
|
cy = "50",
|
|
70
71
|
radius = "25",
|
|
@@ -73,7 +74,7 @@ const Spinner = ({
|
|
|
73
74
|
<SpinnerContainer centerSpinner={centerSpinner} size={size}>
|
|
74
75
|
<SpinnerSvgAnimation
|
|
75
76
|
size={size}
|
|
76
|
-
color={
|
|
77
|
+
color={color}
|
|
77
78
|
centerSpinner={centerSpinner}
|
|
78
79
|
>
|
|
79
80
|
<circle
|
|
@@ -37,22 +37,27 @@ const TurnstileWidget = forwardRef(
|
|
|
37
37
|
) => {
|
|
38
38
|
if (!verifyURL || !siteKey) return null;
|
|
39
39
|
|
|
40
|
-
const
|
|
40
|
+
const widgetRef = useRef(null);
|
|
41
41
|
const [widgetId, setWidgetId] = useState(null);
|
|
42
42
|
const isTurnstileLoaded = useTurnstileScript(verifyURL);
|
|
43
43
|
|
|
44
44
|
// Allow the parent component to reset the Turnstile widget
|
|
45
|
-
useImperativeHandle(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
useImperativeHandle(
|
|
46
|
+
ref,
|
|
47
|
+
() => ({
|
|
48
|
+
reset: () => {
|
|
49
|
+
if (widgetId && window.turnstile) {
|
|
50
|
+
window.turnstile.reset(widgetId);
|
|
51
|
+
}
|
|
49
52
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
53
|
+
}),
|
|
54
|
+
[widgetId]
|
|
55
|
+
);
|
|
52
56
|
|
|
53
57
|
useEffect(() => {
|
|
54
|
-
if (
|
|
55
|
-
|
|
58
|
+
if (!widgetRef.current || !window.turnstile) return;
|
|
59
|
+
if (!widgetId) {
|
|
60
|
+
const newWidgetId = window.turnstile.render(widgetRef.current, {
|
|
56
61
|
sitekey: siteKey,
|
|
57
62
|
size: size,
|
|
58
63
|
retry: retry,
|
|
@@ -65,8 +70,9 @@ const TurnstileWidget = forwardRef(
|
|
|
65
70
|
setWidgetId(newWidgetId);
|
|
66
71
|
}
|
|
67
72
|
return () => {
|
|
68
|
-
if (widgetId
|
|
69
|
-
window.turnstile
|
|
73
|
+
if (widgetId && window.turnstile) {
|
|
74
|
+
window.turnstile.remove(widgetId);
|
|
75
|
+
setWidgetId(null);
|
|
70
76
|
}
|
|
71
77
|
};
|
|
72
78
|
}, [isTurnstileLoaded, siteKey, widgetId]);
|
|
@@ -77,7 +83,7 @@ const TurnstileWidget = forwardRef(
|
|
|
77
83
|
justify={justify}
|
|
78
84
|
extraStyles={extraStyles}
|
|
79
85
|
>
|
|
80
|
-
<div ref={
|
|
86
|
+
<div ref={widgetRef} />
|
|
81
87
|
</TurnstileWidgetContainer>
|
|
82
88
|
);
|
|
83
89
|
}
|
package/src/constants/colors.js
CHANGED
|
@@ -62,6 +62,7 @@ const ROYAL_BLUE_VIVID = "#3B5BDB";
|
|
|
62
62
|
const ASTRAL_BLUE = "#3176AA";
|
|
63
63
|
const SAPPHIRE_BLUE = "#116285";
|
|
64
64
|
const PEACOCK_BLUE = "#0E506D";
|
|
65
|
+
const HAWKES_BLUE = "#D9D9FB";
|
|
65
66
|
// GREEN
|
|
66
67
|
const FOREST_GREEN = "#19b03F";
|
|
67
68
|
const MEADOW_GREEN = "#16C98D";
|
|
@@ -88,6 +89,9 @@ const RASPBERRY = "#ED125F";
|
|
|
88
89
|
const FANTASY_RED = "#FCF4F4";
|
|
89
90
|
const COSMOS_RED = "#FFD0D3";
|
|
90
91
|
const BLUSH_RED = "#FFF0F5";
|
|
92
|
+
// PURPLE
|
|
93
|
+
const LUCKY_POINT = "#281978";
|
|
94
|
+
const LUCKY_POINT_DARK = "#201460";
|
|
91
95
|
|
|
92
96
|
// Second level color constants
|
|
93
97
|
const ERROR_COLOR = RAZZMATAZZ_RED;
|
|
@@ -200,6 +204,7 @@ export {
|
|
|
200
204
|
ASTRAL_BLUE,
|
|
201
205
|
SAPPHIRE_BLUE,
|
|
202
206
|
PEACOCK_BLUE,
|
|
207
|
+
HAWKES_BLUE,
|
|
203
208
|
FOREST_GREEN,
|
|
204
209
|
MEADOW_GREEN,
|
|
205
210
|
POLAR_GREEN,
|
|
@@ -225,5 +230,7 @@ export {
|
|
|
225
230
|
ALERT_COLORS,
|
|
226
231
|
PILL_COLORS,
|
|
227
232
|
ERROR_COLOR,
|
|
228
|
-
ERROR_BACKGROUND_COLOR
|
|
233
|
+
ERROR_BACKGROUND_COLOR,
|
|
234
|
+
LUCKY_POINT,
|
|
235
|
+
LUCKY_POINT_DARK
|
|
229
236
|
};
|