@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "10.6.1",
3
+ "version": "10.6.2-beta.1",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -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
- IconAdd,
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
- <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
- };`}
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
- <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
- };
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
- {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"
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
- 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
- );
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,
@@ -30,6 +30,7 @@ export const placeholder = () => (
30
30
  largeIcon={select(iconLabel, icons, defaultIcon, groupId)}
31
31
  key="placeholder"
32
32
  isDisabled={boolean("isDisabled", false, "props")}
33
+ action={() => console.log("placeholder action")}
33
34
  />
34
35
  );
35
36
 
package/src/.DS_Store DELETED
Binary file
Binary file
Binary file