@thecb/components 10.6.0-beta.3 → 10.6.0-beta.5
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 +393 -45
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +391 -46
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/icons/DisabledAccountsAddIcon.js +200 -0
- package/src/components/atoms/icons/DisabledPaymentMethodsAddIcon.js +62 -0
- package/src/components/atoms/icons/DisabledPropertiesAddIcon.js +54 -0
- package/src/components/atoms/icons/PropertiesAddIcon.js +1 -0
- package/src/components/atoms/icons/icons.stories.js +9 -1
- package/src/components/atoms/icons/index.js +7 -1
- package/src/components/atoms/placeholder/Placeholder.js +85 -26
- package/src/components/atoms/placeholder/Placeholder.stories.js +2 -0
- package/src/components/atoms/placeholder/Placeholder.theme.js +8 -2
- package/src/components/atoms/spinner/Spinner.js +13 -5
- package/src/components/atoms/spinner/index.d.ts +4 -0
- package/src/components/atoms/wallet-name/WalletName.js +21 -12
- package/src/components/atoms/wallet-name/WalletName.stories.js +1 -0
- package/src/components/atoms/wallet-name/WalletName.theme.js +6 -2
- package/src/components/atoms/wallet-name/index.d.ts +3 -2
- package/src/components/molecules/editable-list/EditableList.js +3 -1
- package/src/components/molecules/editable-list/EditableList.stories.js +1 -3
|
@@ -61,7 +61,15 @@ export const SpinnerContainer = styled.div`
|
|
|
61
61
|
containers. Default is false to preserve legacy behavior for past uses.
|
|
62
62
|
*/
|
|
63
63
|
|
|
64
|
-
const Spinner = ({
|
|
64
|
+
const Spinner = ({
|
|
65
|
+
size = "24",
|
|
66
|
+
centerSpinner = false,
|
|
67
|
+
themeValues,
|
|
68
|
+
cx = "50",
|
|
69
|
+
cy = "50",
|
|
70
|
+
radius = "25",
|
|
71
|
+
strokeWidth = "6"
|
|
72
|
+
}) => (
|
|
65
73
|
<SpinnerContainer centerSpinner={centerSpinner} size={size}>
|
|
66
74
|
<SpinnerSvgAnimation
|
|
67
75
|
size={size}
|
|
@@ -70,11 +78,11 @@ const Spinner = ({ size = "24", centerSpinner = false, themeValues }) => (
|
|
|
70
78
|
>
|
|
71
79
|
<circle
|
|
72
80
|
className="path"
|
|
73
|
-
cx=
|
|
74
|
-
cy=
|
|
75
|
-
r=
|
|
81
|
+
cx={cx}
|
|
82
|
+
cy={cy}
|
|
83
|
+
r={radius}
|
|
76
84
|
fill="none"
|
|
77
|
-
strokeWidth=
|
|
85
|
+
strokeWidth={strokeWidth}
|
|
78
86
|
/>
|
|
79
87
|
</SpinnerSvgAnimation>
|
|
80
88
|
</SpinnerContainer>
|
|
@@ -2,10 +2,12 @@ import React, { Fragment, useContext } from "react";
|
|
|
2
2
|
import { Box, Cluster } from "../layouts";
|
|
3
3
|
import { themeComponent } from "../../../util/themeUtils";
|
|
4
4
|
import ButtonWithAction from "../button-with-action";
|
|
5
|
+
import { Center } from "../layouts";
|
|
5
6
|
import Text from "../text/Text";
|
|
6
7
|
import { ThemeContext } from "styled-components";
|
|
7
8
|
import { fallbackValues } from "./WalletName.theme";
|
|
8
9
|
import Module from "../../molecules/module/Module";
|
|
10
|
+
import Spinner from "../spinner/Spinner";
|
|
9
11
|
|
|
10
12
|
const WalletName = ({
|
|
11
13
|
mainText,
|
|
@@ -14,7 +16,8 @@ const WalletName = ({
|
|
|
14
16
|
actionText,
|
|
15
17
|
themeValues,
|
|
16
18
|
disableAction = false,
|
|
17
|
-
buttonExtraStyles = ""
|
|
19
|
+
buttonExtraStyles = "",
|
|
20
|
+
isLoading = false
|
|
18
21
|
}) => {
|
|
19
22
|
const { isMobile } = useContext(ThemeContext);
|
|
20
23
|
|
|
@@ -23,21 +26,27 @@ const WalletName = ({
|
|
|
23
26
|
<Module spacingBottom={isMobile ? "0" : "1.5rem"}>
|
|
24
27
|
<Cluster
|
|
25
28
|
align="center"
|
|
26
|
-
justify={
|
|
27
|
-
!!text || !!actionText
|
|
28
|
-
? "space-between"
|
|
29
|
-
: !text && !actionText && isMobile
|
|
30
|
-
? "flex-end"
|
|
31
|
-
: "flex-end"
|
|
32
|
-
}
|
|
29
|
+
justify={!!text || !!actionText ? "space-between" : "flex-start"}
|
|
33
30
|
extraStyles={`
|
|
34
|
-
box-shadow: ${themeValues.boxShadow};
|
|
31
|
+
box-shadow: ${themeValues.boxShadow};
|
|
35
32
|
padding: 1.5rem;
|
|
36
33
|
${isMobile ? `span {text-align: right;}` : ``}
|
|
37
34
|
`}
|
|
38
35
|
>
|
|
39
|
-
<Box padding="0
|
|
40
|
-
|
|
36
|
+
<Box padding="0" extraStyles="">
|
|
37
|
+
{isLoading ? (
|
|
38
|
+
<Center as="span" style={{ padding: "24px 24px 0" }} intrinsic>
|
|
39
|
+
<Spinner
|
|
40
|
+
strokeWidth="2"
|
|
41
|
+
size="24"
|
|
42
|
+
radius="10"
|
|
43
|
+
cx="12"
|
|
44
|
+
cy="12"
|
|
45
|
+
/>
|
|
46
|
+
</Center>
|
|
47
|
+
) : (
|
|
48
|
+
<Text>{mainText}</Text>
|
|
49
|
+
)}
|
|
41
50
|
</Box>
|
|
42
51
|
{!isMobile && (
|
|
43
52
|
<Box padding="0">
|
|
@@ -65,7 +74,7 @@ const WalletName = ({
|
|
|
65
74
|
<Cluster
|
|
66
75
|
align="center"
|
|
67
76
|
justify={text || actionText ? "flex-end" : "flex-start"}
|
|
68
|
-
extraStyles="margin-top: 0.
|
|
77
|
+
extraStyles="margin-top: 0.5rem;"
|
|
69
78
|
>
|
|
70
79
|
{text && <Text extraStyles="font-size: 12px">{text}</Text>}
|
|
71
80
|
{(text || actionText) && <> </>}
|
|
@@ -11,6 +11,7 @@ export const walletName = () => {
|
|
|
11
11
|
actionText={text("actionText", "Check out as a guest", "props")}
|
|
12
12
|
text={text("text", "Not you?", "props")}
|
|
13
13
|
disableAction={boolean("disableAction", false, "props")}
|
|
14
|
+
isLoading={boolean("isLoading", false, "props")}
|
|
14
15
|
/>
|
|
15
16
|
);
|
|
16
17
|
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
CHARADE_GREY,
|
|
3
|
+
ROYAL_BLUE_VIVID,
|
|
4
|
+
WHITE
|
|
5
|
+
} from "../../../constants/colors";
|
|
2
6
|
|
|
3
7
|
const backgroundColor = {
|
|
4
8
|
primary: WHITE
|
|
5
9
|
};
|
|
6
10
|
|
|
7
11
|
const color = {
|
|
8
|
-
primary:
|
|
12
|
+
primary: ROYAL_BLUE_VIVID
|
|
9
13
|
};
|
|
10
14
|
|
|
11
15
|
const boxShadow = {
|
|
@@ -2,12 +2,13 @@ import React from "react";
|
|
|
2
2
|
import Expand from "../../../util/expand";
|
|
3
3
|
|
|
4
4
|
export interface WalletNameProps {
|
|
5
|
-
|
|
5
|
+
mainText: string;
|
|
6
|
+
action: () => void;
|
|
6
7
|
text: string;
|
|
7
8
|
actionText: string;
|
|
8
|
-
mainText: string;
|
|
9
9
|
disableAction?: boolean;
|
|
10
10
|
buttonExtraStyles?: string;
|
|
11
|
+
isLoading?: boolean;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export const WalletName: React.FC<Expand<WalletNameProps> &
|
|
@@ -40,7 +40,8 @@ const EditableList = ({
|
|
|
40
40
|
listPadding = "0rem 0rem 1.5rem 0rem",
|
|
41
41
|
qaPrefix,
|
|
42
42
|
ariaLabel,
|
|
43
|
-
editItemAriaRole = ""
|
|
43
|
+
editItemAriaRole = "",
|
|
44
|
+
disablePlaceholder = false
|
|
44
45
|
}) => {
|
|
45
46
|
const addText = `Add a${
|
|
46
47
|
itemName[0].match(/[aieouAIEOU]/) ? "n" : ""
|
|
@@ -168,6 +169,7 @@ const EditableList = ({
|
|
|
168
169
|
action={addItem}
|
|
169
170
|
dataQa={"Add " + qaPrefix}
|
|
170
171
|
aria-label={addText}
|
|
172
|
+
isDisabled={disablePlaceholder}
|
|
171
173
|
/>
|
|
172
174
|
</Box>
|
|
173
175
|
)}
|