@thecb/components 10.6.2-beta.7 → 10.6.2
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 +653 -122
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +653 -122
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
- package/src/components/atoms/icons/WalletIconSmall.js +7 -3
- package/src/components/atoms/icons/icons.stories.js +0 -2
- package/src/components/atoms/layouts/Box.js +0 -2
- package/src/components/atoms/layouts/Box.styled.js +1 -3
- package/src/components/atoms/placeholder/Placeholder.js +126 -91
- package/src/components/atoms/placeholder/Placeholder.stories.js +0 -1
- package/src/components/molecules/editable-list/EditableList.stories.js +2 -7
- package/src/components/molecules/module/Module.js +8 -2
- package/src/components/molecules/payment-details/PaymentDetails.js +8 -4
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { fallbackValues } from "./Icons.theme";
|
|
3
3
|
import { themeComponent } from "../../../util/themeUtils";
|
|
4
4
|
|
|
5
|
-
const WalletIconSmall = ({ themeValues, iconIndex = 0 }) => {
|
|
5
|
+
const WalletIconSmall = ({ themeValues, iconIndex = 0, colorOverride }) => {
|
|
6
6
|
return (
|
|
7
7
|
<svg
|
|
8
8
|
width="20"
|
|
@@ -15,7 +15,7 @@ const WalletIconSmall = ({ themeValues, iconIndex = 0 }) => {
|
|
|
15
15
|
fillRule="evenodd"
|
|
16
16
|
clipRule="evenodd"
|
|
17
17
|
d="M16.3125 6.94643C16.0446 6.70536 15.7232 6.57143 15.3482 6.57143L5.14283 6.57143C5.0089 6.57143 4.90176 6.54464 4.8214 6.46429C4.74104 6.38393 4.71426 6.27678 4.71426 6.14286C4.71426 6.03571 4.74104 5.92857 4.8214 5.84821C4.90176 5.76786 5.0089 5.71428 5.14283 5.71428L15.4285 5.71428C15.5357 5.71428 15.6428 5.6875 15.7232 5.60714C15.8035 5.52678 15.8571 5.41964 15.8571 5.28571C15.8571 4.9375 15.7232 4.64286 15.4821 4.375C15.2143 4.13393 14.9196 4 14.5714 4L4.71426 4C4.23211 4 3.80354 4.1875 3.48211 4.50893C3.16068 4.83036 2.99997 5.23214 2.99997 5.71428V14.2857C2.99997 14.7679 3.16068 15.1964 3.48211 15.5179C3.80354 15.8393 4.23211 16 4.71426 16L15.3482 16C15.7232 16 16.0446 15.8929 16.3125 15.625C16.5803 15.3839 16.7143 15.0893 16.7143 14.7143V7.85714C16.7143 7.50893 16.5803 7.21428 16.3125 6.94643ZM12.7142 13.143C13.661 13.143 14.4285 12.3755 14.4285 11.4288C14.4285 10.482 13.661 9.71447 12.7142 9.71447C11.7674 9.71447 10.9999 10.482 10.9999 11.4288C10.9999 12.3755 11.7674 13.143 12.7142 13.143Z"
|
|
18
|
-
fill={themeValues.singleIconColor}
|
|
18
|
+
fill={colorOverride || themeValues.singleIconColor}
|
|
19
19
|
/>
|
|
20
20
|
<mask
|
|
21
21
|
id={`mask0_503_574-${iconIndex}`}
|
|
@@ -34,7 +34,11 @@ const WalletIconSmall = ({ themeValues, iconIndex = 0 }) => {
|
|
|
34
34
|
/>
|
|
35
35
|
</mask>
|
|
36
36
|
<g mask={`url(#mask0_503_574-${iconIndex})`}>
|
|
37
|
-
<rect
|
|
37
|
+
<rect
|
|
38
|
+
width="20"
|
|
39
|
+
height="20"
|
|
40
|
+
fill={colorOverride || themeValues.singleIconColor}
|
|
41
|
+
/>
|
|
38
42
|
</g>
|
|
39
43
|
</svg>
|
|
40
44
|
);
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
FailedIcon,
|
|
33
33
|
PencilIcon,
|
|
34
34
|
PendingIcon,
|
|
35
|
-
PlusCircleIcon,
|
|
36
35
|
RefundIcon,
|
|
37
36
|
RejectedIcon,
|
|
38
37
|
RejectedVelocityIcon,
|
|
@@ -59,7 +58,6 @@ export const accountsIcon = () => <AccountsIcon />;
|
|
|
59
58
|
export const accountsAddIcon = () => <AccountsAddIcon />;
|
|
60
59
|
export const forgotPasswordIcon = () => <ForgotPasswordIcon />;
|
|
61
60
|
export const goToEmailIcon = () => <GoToEmailIcon />;
|
|
62
|
-
export const plusCircleIcon = () => <PlusCircleIcon />;
|
|
63
61
|
export const verifiedEmailIcon = () => <VerifiedEmailIcon />;
|
|
64
62
|
export const paymentMethodIcon = () => <PaymentMethodIcon />;
|
|
65
63
|
export const accountsIconSmall = () => <AccountsIconSmall />;
|
|
@@ -31,7 +31,6 @@ const Box = forwardRef(
|
|
|
31
31
|
hoverStyles,
|
|
32
32
|
activeStyles,
|
|
33
33
|
disabledStyles,
|
|
34
|
-
focusStyles,
|
|
35
34
|
variant,
|
|
36
35
|
as,
|
|
37
36
|
onClick,
|
|
@@ -69,7 +68,6 @@ const Box = forwardRef(
|
|
|
69
68
|
hoverStyles={hoverStyles}
|
|
70
69
|
activeStyles={activeStyles}
|
|
71
70
|
disabledStyles={disabledStyles}
|
|
72
|
-
focusStyles={focusStyles}
|
|
73
71
|
variant={variant}
|
|
74
72
|
as={as}
|
|
75
73
|
onClick={onClick}
|
|
@@ -13,7 +13,6 @@ import { ROYAL_BLUE } from "../../../constants/colors";
|
|
|
13
13
|
export const BoxWrapper = styled(
|
|
14
14
|
({
|
|
15
15
|
activeStyles,
|
|
16
|
-
focusStyles,
|
|
17
16
|
hoverStyles,
|
|
18
17
|
disabledStyles,
|
|
19
18
|
extraStyles,
|
|
@@ -65,9 +64,8 @@ export const BoxWrapper = styled(
|
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
&:focus {
|
|
68
|
-
${({
|
|
67
|
+
${({ as }) =>
|
|
69
68
|
css`
|
|
70
|
-
${focusStyles}
|
|
71
69
|
outline: 3px solid ${ROYAL_BLUE};
|
|
72
70
|
outline-offset: 2px;
|
|
73
71
|
${as === "button" &&
|
|
@@ -5,17 +5,25 @@ import Text from "../text";
|
|
|
5
5
|
import { Box, Switcher, Center, Cluster, Cover } from "../layouts";
|
|
6
6
|
import { fallbackValues } from "./Placeholder.theme";
|
|
7
7
|
import { themeComponent } from "../../../util/themeUtils";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
STORM_GREY,
|
|
10
|
+
GRECIAN_GREY,
|
|
11
|
+
CHARADE_GREY,
|
|
12
|
+
WHITE,
|
|
13
|
+
TRANSPARENT,
|
|
14
|
+
MANATEE_GREY
|
|
15
|
+
} from "../../../constants/colors";
|
|
9
16
|
import {
|
|
10
17
|
AccountsAddIcon,
|
|
11
18
|
PropertiesAddIcon,
|
|
12
|
-
|
|
19
|
+
IconAdd,
|
|
13
20
|
PaymentMethodAddIcon,
|
|
14
21
|
DisabledAccountsAddIcon,
|
|
15
22
|
DisabledPropertiesAddIcon,
|
|
16
23
|
DisabledPaymentMethodsAddIcon
|
|
17
24
|
} from "../icons";
|
|
18
25
|
import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
|
|
26
|
+
import { noop } from "../../../util/general";
|
|
19
27
|
|
|
20
28
|
const getLargeIcon = (iconName, isDisabled) => {
|
|
21
29
|
switch (iconName) {
|
|
@@ -59,8 +67,6 @@ const renderContent = ({ isLink, destination, dataQa, children, action }) =>
|
|
|
59
67
|
minHeight="100%"
|
|
60
68
|
extraStyles="cursor: pointer;"
|
|
61
69
|
dataQa={dataQa}
|
|
62
|
-
tabIndex="0"
|
|
63
|
-
onKeyPress={e => e.key === "Enter" && action()}
|
|
64
70
|
>
|
|
65
71
|
{children}
|
|
66
72
|
</Box>
|
|
@@ -95,97 +101,126 @@ const Placeholder = ({
|
|
|
95
101
|
themeValues,
|
|
96
102
|
isDisabled = false,
|
|
97
103
|
dataQa
|
|
98
|
-
}) =>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
}) => (
|
|
105
|
+
<PlaceholderContentWrapper
|
|
106
|
+
isLink={isLink}
|
|
107
|
+
action={action}
|
|
108
|
+
destination={destination}
|
|
109
|
+
dataQa={dataQa}
|
|
110
|
+
isDisabled={isDisabled}
|
|
111
|
+
>
|
|
112
|
+
<Box
|
|
113
|
+
padding="0"
|
|
114
|
+
borderRadius="4px"
|
|
115
|
+
border="none"
|
|
116
|
+
minHeight={themeValues.height}
|
|
117
|
+
hiddenStyles={!visible}
|
|
118
|
+
extraStyles={
|
|
119
|
+
isDisabled
|
|
120
|
+
? `border: 1px dashed ${MANATEE_GREY};
|
|
121
|
+
display: flex;
|
|
122
|
+
justify-content: center;
|
|
123
|
+
align-items:center;`
|
|
124
|
+
: `
|
|
125
|
+
background: linear-gradient(
|
|
126
|
+
to right,
|
|
127
|
+
${variant === "large" ? STORM_GREY : themeValues.color} 40%,
|
|
128
|
+
rgba(255, 255, 255, 0) 0%
|
|
129
|
+
),
|
|
130
|
+
linear-gradient(${
|
|
131
|
+
variant === "large" ? STORM_GREY : themeValues.color
|
|
132
|
+
} 40%, rgba(255, 255, 255, 0) 0%),
|
|
133
|
+
linear-gradient(to right, ${
|
|
134
|
+
variant === "large" ? STORM_GREY : themeValues.color
|
|
135
|
+
} 40%, rgba(255, 255, 255, 0) 0%),
|
|
136
|
+
linear-gradient(${
|
|
137
|
+
variant === "large" ? STORM_GREY : themeValues.color
|
|
138
|
+
} 40%, rgba(255, 255, 255, 0) 0%);
|
|
139
|
+
background-position: top, right, bottom, left;
|
|
140
|
+
background-repeat: repeat-x, repeat-y;
|
|
141
|
+
background-size: 5px 1px, 1px 5px;
|
|
142
|
+
display: flex;
|
|
143
|
+
justify-content: center;
|
|
144
|
+
align-items:center;`
|
|
145
|
+
}
|
|
146
|
+
hoverStyles={`background-color: ${
|
|
147
|
+
isDisabled
|
|
148
|
+
? TRANSPARENT
|
|
149
|
+
: variant === "large"
|
|
150
|
+
? GRECIAN_GREY
|
|
151
|
+
: tint(0.9, themeValues.color)
|
|
152
|
+
};`}
|
|
107
153
|
>
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
};`}
|
|
129
|
-
activeStyles={`background-color: ${
|
|
130
|
-
isDisabled ? TRANSPARENT : tint(0.8, themeValues.color)
|
|
131
|
-
}; ${!isDisabled && `background-image:none; border: 2px solid ${borderColor};}`}`}
|
|
132
|
-
>
|
|
133
|
-
<Center maxWidth="300px">
|
|
134
|
-
<Box padding="0">
|
|
135
|
-
<Cluster justify="center" align="center" minHeight="100%">
|
|
136
|
-
<Switcher maxChildren={2} childGap="0">
|
|
137
|
-
{variant === "large" && <div></div>}
|
|
138
|
-
<Box
|
|
139
|
-
padding="0"
|
|
140
|
-
aria-disabled={isDisabled}
|
|
141
|
-
extraStyles={`.fill {
|
|
142
|
-
fill: ${isDisabled ? MANATEE_GREY : themeValues.color};
|
|
154
|
+
<Center maxWidth="300px">
|
|
155
|
+
<Box
|
|
156
|
+
padding="0"
|
|
157
|
+
tabIndex="0"
|
|
158
|
+
onKeyPress={e => (isDisabled ? noop : e.key === "Enter" && action())}
|
|
159
|
+
>
|
|
160
|
+
<Cluster justify="center" align="center" minHeight="100%">
|
|
161
|
+
<Switcher maxChildren={2} childGap="0">
|
|
162
|
+
{variant === "large" && <div></div>}
|
|
163
|
+
<Box
|
|
164
|
+
padding="0"
|
|
165
|
+
aria-disabled={isDisabled}
|
|
166
|
+
extraStyles={`.fill {
|
|
167
|
+
fill: ${
|
|
168
|
+
isDisabled
|
|
169
|
+
? MANATEE_GREY
|
|
170
|
+
: variant === "large"
|
|
171
|
+
? CHARADE_GREY
|
|
172
|
+
: themeValues.color
|
|
173
|
+
};
|
|
143
174
|
} .stroke {
|
|
144
|
-
stroke: ${
|
|
175
|
+
stroke: ${
|
|
176
|
+
isDisabled
|
|
177
|
+
? MANATEE_GREY
|
|
178
|
+
: variant === "large"
|
|
179
|
+
? CHARADE_GREY
|
|
180
|
+
: themeValues.color
|
|
181
|
+
};
|
|
145
182
|
} `}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
183
|
+
>
|
|
184
|
+
{variant === "large" ? (
|
|
185
|
+
<Center intrinsic>
|
|
186
|
+
{getLargeIcon(largeIcon, isDisabled)}
|
|
187
|
+
<Text
|
|
188
|
+
variant="pS"
|
|
189
|
+
color={isDisabled ? MANATEE_GREY : themeValues.color}
|
|
190
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
191
|
+
extraStyles={`text-align: center;`}
|
|
192
|
+
>
|
|
193
|
+
{text}
|
|
194
|
+
</Text>
|
|
195
|
+
</Center>
|
|
196
|
+
) : (
|
|
197
|
+
<Cover singleChild minHeight="100%">
|
|
198
|
+
<Cluster justify="center" align="center">
|
|
199
|
+
<IconAdd
|
|
200
|
+
fill={isDisabled ? MANATEE_GREY : WHITE}
|
|
201
|
+
strokeWidth="2"
|
|
202
|
+
/>
|
|
203
|
+
<Center intrinsic>
|
|
204
|
+
<Text
|
|
205
|
+
variant="pS"
|
|
163
206
|
color={isDisabled ? MANATEE_GREY : themeValues.color}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
</Switcher>
|
|
182
|
-
</Cluster>
|
|
183
|
-
</Box>
|
|
184
|
-
</Center>
|
|
185
|
-
</Box>
|
|
186
|
-
</PlaceholderContentWrapper>
|
|
187
|
-
);
|
|
188
|
-
};
|
|
207
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
208
|
+
extraStyles={`padding: 0 0 0 8px; text-align: center;`}
|
|
209
|
+
>
|
|
210
|
+
{text}
|
|
211
|
+
</Text>
|
|
212
|
+
</Center>
|
|
213
|
+
</Cluster>
|
|
214
|
+
</Cover>
|
|
215
|
+
)}
|
|
216
|
+
</Box>
|
|
217
|
+
</Switcher>
|
|
218
|
+
</Cluster>
|
|
219
|
+
</Box>
|
|
220
|
+
</Center>
|
|
221
|
+
</Box>
|
|
222
|
+
</PlaceholderContentWrapper>
|
|
223
|
+
);
|
|
189
224
|
|
|
190
225
|
export default themeComponent(
|
|
191
226
|
Placeholder,
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { number, boolean } from "@storybook/addon-knobs";
|
|
3
2
|
import EditableList from "./EditableList";
|
|
4
3
|
import page from "../../../../.storybook/page";
|
|
5
4
|
|
|
6
|
-
const groupId = "props";
|
|
7
|
-
|
|
8
5
|
const story = page({
|
|
9
6
|
title: "Components|Molecules/EditableList",
|
|
10
7
|
Component: EditableList
|
|
@@ -15,9 +12,7 @@ export const editableList = () => {
|
|
|
15
12
|
return (
|
|
16
13
|
<EditableList
|
|
17
14
|
as="h2"
|
|
18
|
-
canRemove={
|
|
19
|
-
canAdd={boolean("Can Add", true, groupId)}
|
|
20
|
-
canEdit={boolean("Can Edit", true, groupId)}
|
|
15
|
+
canRemove={false}
|
|
21
16
|
title="Contact first name"
|
|
22
17
|
titleWeight="600"
|
|
23
18
|
editItem={() => console.log("edit click")}
|
|
@@ -25,7 +20,7 @@ export const editableList = () => {
|
|
|
25
20
|
itemName="Contact first name"
|
|
26
21
|
listPadding="0"
|
|
27
22
|
renderItem={contactFirstName => contactFirstName}
|
|
28
|
-
maxItems={
|
|
23
|
+
maxItems={1}
|
|
29
24
|
items={["Ronald"]}
|
|
30
25
|
qaPrefix="Contact first name"
|
|
31
26
|
ariaLabel="Contact first name"
|
|
@@ -28,7 +28,8 @@ const Module = ({
|
|
|
28
28
|
spacingBottom = "2.5rem",
|
|
29
29
|
fontSize,
|
|
30
30
|
themeValues,
|
|
31
|
-
children
|
|
31
|
+
children,
|
|
32
|
+
allowContentOverflow = false
|
|
32
33
|
}) => {
|
|
33
34
|
const themedFontSize =
|
|
34
35
|
variant === "small"
|
|
@@ -64,7 +65,12 @@ const Module = ({
|
|
|
64
65
|
>
|
|
65
66
|
{heading && !rightTitleContent && headingText}
|
|
66
67
|
{heading && rightTitleContent && (
|
|
67
|
-
<Cluster
|
|
68
|
+
<Cluster
|
|
69
|
+
justify="space-between"
|
|
70
|
+
align="center"
|
|
71
|
+
overflow={allowContentOverflow}
|
|
72
|
+
nowrap
|
|
73
|
+
>
|
|
68
74
|
{headingText}
|
|
69
75
|
{rightTitleContent}
|
|
70
76
|
</Cluster>
|
|
@@ -362,9 +362,11 @@ const PaymentDetails = ({
|
|
|
362
362
|
<Box width="100%" padding="none">
|
|
363
363
|
<Cluster justify="space-between" align="center">
|
|
364
364
|
<Title
|
|
365
|
-
weight={
|
|
365
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
366
366
|
as="h2"
|
|
367
|
-
extraStyles={`font-size: 1.
|
|
367
|
+
extraStyles={`font-size: 1.5rem; line-height: ${
|
|
368
|
+
isMobile ? "2.2857rem" : "2.25rem"
|
|
369
|
+
};`}
|
|
368
370
|
id="payment-details-title"
|
|
369
371
|
>
|
|
370
372
|
{titleText}
|
|
@@ -382,9 +384,11 @@ const PaymentDetails = ({
|
|
|
382
384
|
<>
|
|
383
385
|
<Title
|
|
384
386
|
as="h2"
|
|
385
|
-
weight={
|
|
387
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
386
388
|
margin="1rem 0 0 0"
|
|
387
|
-
extraStyles={`font-size: 1.
|
|
389
|
+
extraStyles={`font-size: 1.5rem; line-height: ${
|
|
390
|
+
isMobile ? "2.2857rem" : "2.25rem"
|
|
391
|
+
};`}
|
|
388
392
|
id="payment-details-title"
|
|
389
393
|
>
|
|
390
394
|
{titleText}
|