@thecb/components 7.12.2-beta.1 → 7.12.2-beta.10
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 +118 -74
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +118 -74
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/alert/Alert.js +19 -5
- package/src/components/atoms/spinner/Spinner.js +26 -4
- package/src/components/molecules/payment-details/PaymentDetails.js +20 -6
- package/src/util/generateShadows.js +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/molecules/.DS_Store +0 -0
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,13 +18,21 @@ const Alert = ({
|
|
|
17
18
|
showQuitLink = true,
|
|
18
19
|
themeValues,
|
|
19
20
|
extraStyles,
|
|
20
|
-
maxContentWidth
|
|
21
|
+
maxContentWidth,
|
|
22
|
+
noBorder = false,
|
|
23
|
+
enableBoxShadow = false,
|
|
24
|
+
enableSmallText = false,
|
|
25
|
+
innerContentPadding = "1rem",
|
|
26
|
+
iconPadding = "0 0 0 1rem"
|
|
21
27
|
}) => {
|
|
22
28
|
const Icon = AlertIcons[variant];
|
|
29
|
+
let contentPadding = maxContentWidth
|
|
30
|
+
? `${padding} 1rem`
|
|
31
|
+
: innerContentPadding;
|
|
23
32
|
|
|
24
33
|
const content = (
|
|
25
34
|
<Sidebar width="24px" childGap="0rem">
|
|
26
|
-
<Box padding=
|
|
35
|
+
<Box padding={iconPadding} minHeight="100%">
|
|
27
36
|
<Cover minHeight="100%" singleChild>
|
|
28
37
|
<Box padding="0" width="1.5rem" minHeight="1.5rem">
|
|
29
38
|
<Icon />
|
|
@@ -32,13 +41,17 @@ const Alert = ({
|
|
|
32
41
|
</Box>
|
|
33
42
|
<Box padding="0">
|
|
34
43
|
<Sidebar sidebarOnRight width="24px" childGap="0rem">
|
|
35
|
-
<Box padding={
|
|
44
|
+
<Box padding={contentPadding}>
|
|
36
45
|
<Cluster justify="flex-start" align="center">
|
|
37
46
|
{textOverride ? (
|
|
38
47
|
textOverride
|
|
39
48
|
) : (
|
|
40
49
|
<Stack fullHeight childGap="0.25rem">
|
|
41
|
-
<Text
|
|
50
|
+
<Text
|
|
51
|
+
variant={enableSmallText ? "pS" : "p"}
|
|
52
|
+
color={themeValues.text}
|
|
53
|
+
weight="600"
|
|
54
|
+
>
|
|
42
55
|
{heading}
|
|
43
56
|
</Text>
|
|
44
57
|
<Text variant="pS" color={themeValues.text}>
|
|
@@ -70,7 +83,8 @@ const Alert = ({
|
|
|
70
83
|
background={themeValues.background}
|
|
71
84
|
borderRadius="4px"
|
|
72
85
|
borderColor={themeValues.border}
|
|
73
|
-
borderSize="1px"
|
|
86
|
+
borderSize={noBorder ? "0px" : "1px"}
|
|
87
|
+
boxShadow={enableBoxShadow ? generateShadows()?.inset?.base : ""}
|
|
74
88
|
extraStyles={extraStyles}
|
|
75
89
|
>
|
|
76
90
|
{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";
|
|
@@ -67,7 +67,7 @@ const PaymentDetailsContent = ({
|
|
|
67
67
|
text="Void"
|
|
68
68
|
padding="0"
|
|
69
69
|
extraStyles={`
|
|
70
|
-
min-width: 65px;
|
|
70
|
+
min-width: 65px;
|
|
71
71
|
margin: 0px;
|
|
72
72
|
min-height: 0px;
|
|
73
73
|
`}
|
|
@@ -120,11 +120,19 @@ const PaymentDetailsContent = ({
|
|
|
120
120
|
);
|
|
121
121
|
|
|
122
122
|
const LoadingDetails = () => (
|
|
123
|
-
<Box
|
|
124
|
-
|
|
123
|
+
<Box
|
|
124
|
+
padding="0"
|
|
125
|
+
background={GRECIAN_GREY}
|
|
126
|
+
borderRadius="4px"
|
|
127
|
+
minHeight="196px"
|
|
128
|
+
>
|
|
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,12 @@ const ErrorDetails = () => (
|
|
|
138
146
|
heading="Error Loading Payment"
|
|
139
147
|
text="Please go back and try again."
|
|
140
148
|
showQuitLink={false}
|
|
149
|
+
noBorder
|
|
150
|
+
enableBoxShadow
|
|
151
|
+
enableSmallText
|
|
152
|
+
innerContentPadding="0 1rem"
|
|
153
|
+
extraStyles={`min-height: 67px; height: 67px;`}
|
|
154
|
+
iconPadding="0 0 0 0.75rem"
|
|
141
155
|
/>
|
|
142
156
|
</Box>
|
|
143
157
|
);
|
|
@@ -28,7 +28,7 @@ const rgbToRgba = (rgbValue = "", opacity = "") => {
|
|
|
28
28
|
)}, ${opacity}${rgbValue.slice(-1)}`;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export const generateShadows = baseColorRGB => {
|
|
31
|
+
export const generateShadows = (baseColorRGB = "rgb(41, 42, 51)") => {
|
|
32
32
|
const colorTen = rgbToRgba(baseColorRGB, "0.1") || "rgba(41, 42, 51, 0.1)";
|
|
33
33
|
const colorTwenty = rgbToRgba(baseColorRGB, "0.2") || "rgba(41, 42, 51, 0.2)";
|
|
34
34
|
const colorTwentyFive =
|
package/src/.DS_Store
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|