@thecb/components 7.12.2-beta.4 → 7.12.2-beta.6
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 +95 -68
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +95 -68
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/alert/Alert.js +6 -2
- package/src/components/atoms/spinner/Spinner.js +26 -4
- package/src/components/molecules/payment-details/PaymentDetails.js +15 -4
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import { Box, Center, Cluster, Stack, Cover, Sidebar } from "../layouts";
|
|
|
4
4
|
import Text from "../text";
|
|
5
5
|
import { fallbackValues } from "./Alert.theme";
|
|
6
6
|
import { themeComponent } from "../../../util/themeUtils";
|
|
7
|
+
import { generateShadows } from "../../../util/generateShadows";
|
|
7
8
|
|
|
8
9
|
const Alert = ({
|
|
9
10
|
heading,
|
|
@@ -17,7 +18,9 @@ const Alert = ({
|
|
|
17
18
|
showQuitLink = true,
|
|
18
19
|
themeValues,
|
|
19
20
|
extraStyles,
|
|
20
|
-
maxContentWidth
|
|
21
|
+
maxContentWidth,
|
|
22
|
+
noBorder = false,
|
|
23
|
+
enableBoxShadow = false
|
|
21
24
|
}) => {
|
|
22
25
|
const Icon = AlertIcons[variant];
|
|
23
26
|
|
|
@@ -70,7 +73,8 @@ const Alert = ({
|
|
|
70
73
|
background={themeValues.background}
|
|
71
74
|
borderRadius="4px"
|
|
72
75
|
borderColor={themeValues.border}
|
|
73
|
-
borderSize="1px"
|
|
76
|
+
borderSize={noBorder ? "0px" : "1px"}
|
|
77
|
+
boxShadow={enableBoxShadow ? generateShadows()?.inset?.base : ""}
|
|
74
78
|
extraStyles={extraStyles}
|
|
75
79
|
>
|
|
76
80
|
{maxContentWidth ? (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import styled from "styled-components";
|
|
2
|
+
import styled, { css } from "styled-components";
|
|
3
3
|
import { fallbackValues } from "./Spinner.theme";
|
|
4
4
|
import { themeComponent } from "../../../util/themeUtils";
|
|
5
5
|
|
|
@@ -32,6 +32,12 @@ const SpinnerSvgAnimation = styled.svg`
|
|
|
32
32
|
stroke-dashoffset: -124;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
${({ centerSpinner }) =>
|
|
36
|
+
centerSpinner
|
|
37
|
+
? css`
|
|
38
|
+
margin: 0;
|
|
39
|
+
`
|
|
40
|
+
: ""}
|
|
35
41
|
`;
|
|
36
42
|
|
|
37
43
|
export const SpinnerContainer = styled.div`
|
|
@@ -41,11 +47,27 @@ export const SpinnerContainer = styled.div`
|
|
|
41
47
|
align-items: center;
|
|
42
48
|
justify-content: center;
|
|
43
49
|
line-height: 1;
|
|
50
|
+
${({ centerSpinner, size }) =>
|
|
51
|
+
centerSpinner
|
|
52
|
+
? css`
|
|
53
|
+
width: ${size}px;
|
|
54
|
+
height: ${size}px;
|
|
55
|
+
`
|
|
56
|
+
: ""}
|
|
44
57
|
`;
|
|
45
58
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
59
|
+
/*
|
|
60
|
+
`centerSpinner` prop alters existing styling of spinner to allow it to properly center itself within
|
|
61
|
+
containers. Default is false to preserve legacy behavior for past uses.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
const Spinner = ({ size = "24", centerSpinner = false, themeValues }) => (
|
|
65
|
+
<SpinnerContainer centerSpinner={centerSpinner} size={size}>
|
|
66
|
+
<SpinnerSvgAnimation
|
|
67
|
+
size={size}
|
|
68
|
+
color={themeValues.color}
|
|
69
|
+
centerSpinner={centerSpinner}
|
|
70
|
+
>
|
|
49
71
|
<circle
|
|
50
72
|
className="path"
|
|
51
73
|
cx="50"
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
FONT_WEIGHT_BOLD,
|
|
22
22
|
FONT_WEIGHT_REGULAR
|
|
23
23
|
} from "../../../constants/style_constants";
|
|
24
|
-
import { ATHENS_GREY,
|
|
24
|
+
import { ATHENS_GREY, GRECIAN_GREY } from "../../../constants/colors";
|
|
25
25
|
import ButtonWithAction from "../../atoms/button-with-action";
|
|
26
26
|
import Text from "../../atoms/text";
|
|
27
27
|
import Alert from "../../atoms/alert";
|
|
@@ -120,11 +120,19 @@ const PaymentDetailsContent = ({
|
|
|
120
120
|
);
|
|
121
121
|
|
|
122
122
|
const LoadingDetails = () => (
|
|
123
|
-
<Box
|
|
123
|
+
<Box
|
|
124
|
+
padding="0"
|
|
125
|
+
background={GRECIAN_GREY}
|
|
126
|
+
borderRadius="4px"
|
|
127
|
+
minHeight="196px"
|
|
128
|
+
>
|
|
124
129
|
<Cover minHeight="196px" singleChild fillCenter>
|
|
125
130
|
<Center intrinsic>
|
|
126
|
-
<Box
|
|
127
|
-
|
|
131
|
+
<Box
|
|
132
|
+
padding="0"
|
|
133
|
+
extraStyles={`flex-grow: 1; display: flex; justify-content: center; align-items: center;`}
|
|
134
|
+
>
|
|
135
|
+
<Spinner size="100" centerSpinner />
|
|
128
136
|
</Box>
|
|
129
137
|
</Center>
|
|
130
138
|
</Cover>
|
|
@@ -138,6 +146,9 @@ const ErrorDetails = () => (
|
|
|
138
146
|
heading="Error Loading Payment"
|
|
139
147
|
text="Please go back and try again."
|
|
140
148
|
showQuitLink={false}
|
|
149
|
+
height="67px"
|
|
150
|
+
noBorder
|
|
151
|
+
enableBoxShadow
|
|
141
152
|
/>
|
|
142
153
|
</Box>
|
|
143
154
|
);
|