@thecb/components 10.6.1 → 10.6.2-beta.1
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 +13 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +13 -12
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/icons/icons.stories.js +2 -0
- package/src/components/atoms/placeholder/Placeholder.js +88 -126
- package/src/components/atoms/placeholder/Placeholder.stories.js +1 -0
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
package/package.json
CHANGED
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
FailedIcon,
|
|
33
33
|
PencilIcon,
|
|
34
34
|
PendingIcon,
|
|
35
|
+
PlusCircleIcon,
|
|
35
36
|
RefundIcon,
|
|
36
37
|
RejectedIcon,
|
|
37
38
|
RejectedVelocityIcon,
|
|
@@ -58,6 +59,7 @@ export const accountsIcon = () => <AccountsIcon />;
|
|
|
58
59
|
export const accountsAddIcon = () => <AccountsAddIcon />;
|
|
59
60
|
export const forgotPasswordIcon = () => <ForgotPasswordIcon />;
|
|
60
61
|
export const goToEmailIcon = () => <GoToEmailIcon />;
|
|
62
|
+
export const plusCircleIcon = () => <PlusCircleIcon />;
|
|
61
63
|
export const verifiedEmailIcon = () => <VerifiedEmailIcon />;
|
|
62
64
|
export const paymentMethodIcon = () => <PaymentMethodIcon />;
|
|
63
65
|
export const accountsIconSmall = () => <AccountsIconSmall />;
|
|
@@ -5,25 +5,17 @@ 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 {
|
|
9
|
-
STORM_GREY,
|
|
10
|
-
GRECIAN_GREY,
|
|
11
|
-
CHARADE_GREY,
|
|
12
|
-
WHITE,
|
|
13
|
-
TRANSPARENT,
|
|
14
|
-
MANATEE_GREY
|
|
15
|
-
} from "../../../constants/colors";
|
|
8
|
+
import { TRANSPARENT, MANATEE_GREY } from "../../../constants/colors";
|
|
16
9
|
import {
|
|
17
10
|
AccountsAddIcon,
|
|
18
11
|
PropertiesAddIcon,
|
|
19
|
-
|
|
12
|
+
PlusCircleIcon,
|
|
20
13
|
PaymentMethodAddIcon,
|
|
21
14
|
DisabledAccountsAddIcon,
|
|
22
15
|
DisabledPropertiesAddIcon,
|
|
23
16
|
DisabledPaymentMethodsAddIcon
|
|
24
17
|
} from "../icons";
|
|
25
18
|
import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
|
|
26
|
-
import { noop } from "../../../util/general";
|
|
27
19
|
|
|
28
20
|
const getLargeIcon = (iconName, isDisabled) => {
|
|
29
21
|
switch (iconName) {
|
|
@@ -67,6 +59,8 @@ const renderContent = ({ isLink, destination, dataQa, children, action }) =>
|
|
|
67
59
|
minHeight="100%"
|
|
68
60
|
extraStyles="cursor: pointer;"
|
|
69
61
|
dataQa={dataQa}
|
|
62
|
+
tabIndex="0"
|
|
63
|
+
onKeyPress={e => e.key === "Enter" && action()}
|
|
70
64
|
>
|
|
71
65
|
{children}
|
|
72
66
|
</Box>
|
|
@@ -101,126 +95,94 @@ const Placeholder = ({
|
|
|
101
95
|
themeValues,
|
|
102
96
|
isDisabled = false,
|
|
103
97
|
dataQa
|
|
104
|
-
}) =>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
-
};`}
|
|
98
|
+
}) => {
|
|
99
|
+
const borderColor = isDisabled ? MANATEE_GREY : themeValues.color;
|
|
100
|
+
return (
|
|
101
|
+
<PlaceholderContentWrapper
|
|
102
|
+
isLink={isLink}
|
|
103
|
+
action={action}
|
|
104
|
+
destination={destination}
|
|
105
|
+
dataQa={dataQa}
|
|
106
|
+
isDisabled={isDisabled}
|
|
153
107
|
>
|
|
154
|
-
<
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
108
|
+
<Box
|
|
109
|
+
padding="0"
|
|
110
|
+
borderRadius="4px"
|
|
111
|
+
border="none"
|
|
112
|
+
minHeight={themeValues.height}
|
|
113
|
+
hiddenStyles={!visible}
|
|
114
|
+
extraStyles={`
|
|
115
|
+
display: flex;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
align-items:center;
|
|
118
|
+
background-image: repeating-linear-gradient(0deg, ${borderColor}, ${borderColor} 2px, transparent 2px, transparent 4px, ${borderColor} 4px), repeating-linear-gradient(90deg, ${borderColor}, ${borderColor} 2px, transparent 2px, transparent 4px, ${borderColor} 4px), repeating-linear-gradient(180deg, ${borderColor}, ${borderColor} 2px, transparent 2px, transparent 4px, ${borderColor} 4px), repeating-linear-gradient(270deg, ${borderColor}, ${borderColor} 2px, transparent 2px, transparent 4px, ${borderColor} 4px);
|
|
119
|
+
background-size: 2px 100%, 100% 2px, 2px 100% , 100% 2px;
|
|
120
|
+
background-position: 0 0, 0 0, 100% 0, 0 100%;
|
|
121
|
+
background-repeat: no-repeat;
|
|
122
|
+
`}
|
|
123
|
+
hoverStyles={`background-color: ${
|
|
124
|
+
isDisabled ? TRANSPARENT : tint(0.9, themeValues.color)
|
|
125
|
+
};`}
|
|
126
|
+
activeStyles={`background-color: ${
|
|
127
|
+
isDisabled ? TRANSPARENT : tint(0.8, themeValues.color)
|
|
128
|
+
};`}
|
|
129
|
+
>
|
|
130
|
+
<Center maxWidth="300px">
|
|
131
|
+
<Box padding="0">
|
|
132
|
+
<Cluster justify="center" align="center" minHeight="100%">
|
|
133
|
+
<Switcher maxChildren={2} childGap="0">
|
|
134
|
+
{variant === "large" && <div></div>}
|
|
135
|
+
<Box
|
|
136
|
+
padding="0"
|
|
137
|
+
aria-disabled={isDisabled}
|
|
138
|
+
extraStyles={`.fill {
|
|
139
|
+
fill: ${isDisabled ? MANATEE_GREY : themeValues.color};
|
|
174
140
|
} .stroke {
|
|
175
|
-
stroke: ${
|
|
176
|
-
isDisabled
|
|
177
|
-
? MANATEE_GREY
|
|
178
|
-
: variant === "large"
|
|
179
|
-
? CHARADE_GREY
|
|
180
|
-
: themeValues.color
|
|
181
|
-
};
|
|
141
|
+
stroke: ${isDisabled ? MANATEE_GREY : themeValues.color};
|
|
182
142
|
} `}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
fill={isDisabled ? MANATEE_GREY : WHITE}
|
|
201
|
-
strokeWidth="2"
|
|
202
|
-
/>
|
|
203
|
-
<Center intrinsic>
|
|
204
|
-
<Text
|
|
205
|
-
variant="pS"
|
|
143
|
+
>
|
|
144
|
+
{variant === "large" ? (
|
|
145
|
+
<Center intrinsic>
|
|
146
|
+
{getLargeIcon(largeIcon, isDisabled)}
|
|
147
|
+
<Text
|
|
148
|
+
variant="pS"
|
|
149
|
+
color={isDisabled ? MANATEE_GREY : themeValues.color}
|
|
150
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
151
|
+
extraStyles={`text-align: center;`}
|
|
152
|
+
>
|
|
153
|
+
{text}
|
|
154
|
+
</Text>
|
|
155
|
+
</Center>
|
|
156
|
+
) : (
|
|
157
|
+
<Cover singleChild minHeight="100%">
|
|
158
|
+
<Cluster justify="center" align="center">
|
|
159
|
+
<PlusCircleIcon
|
|
206
160
|
color={isDisabled ? MANATEE_GREY : themeValues.color}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
161
|
+
/>
|
|
162
|
+
<Center intrinsic>
|
|
163
|
+
<Text
|
|
164
|
+
variant="pS"
|
|
165
|
+
color={
|
|
166
|
+
isDisabled ? MANATEE_GREY : themeValues.color
|
|
167
|
+
}
|
|
168
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
169
|
+
extraStyles={`padding: 0 0 0 8px; text-align: center;`}
|
|
170
|
+
>
|
|
171
|
+
{text}
|
|
172
|
+
</Text>
|
|
173
|
+
</Center>
|
|
174
|
+
</Cluster>
|
|
175
|
+
</Cover>
|
|
176
|
+
)}
|
|
177
|
+
</Box>
|
|
178
|
+
</Switcher>
|
|
179
|
+
</Cluster>
|
|
180
|
+
</Box>
|
|
181
|
+
</Center>
|
|
182
|
+
</Box>
|
|
183
|
+
</PlaceholderContentWrapper>
|
|
184
|
+
);
|
|
185
|
+
};
|
|
224
186
|
|
|
225
187
|
export default themeComponent(
|
|
226
188
|
Placeholder,
|
package/src/.DS_Store
DELETED
|
Binary file
|
package/src/components/.DS_Store
DELETED
|
Binary file
|
|
Binary file
|