@thecb/components 10.2.4-beta.2 → 10.2.4-beta.3

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.2.4-beta.2",
3
+ "version": "10.2.4-beta.3",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -45,6 +45,7 @@ const Box = forwardRef(
45
45
  extraStyles,
46
46
  srOnly = false,
47
47
  dataQa,
48
+ disabled = false,
48
49
  children,
49
50
  ...rest
50
51
  },
@@ -41,8 +41,12 @@ const PlaceholderContentWrapper = ({
41
41
  disabled = false
42
42
  }) =>
43
43
  isLink ? (
44
- <Link to={destination} data-qa={dataQa} disabled={disabled}>
45
- <Box padding="0" minHeight="100%" extraStyles={`cursor: pointer;`}>
44
+ <Link to={destination} data-qa={dataQa} aria-disabled={disabled}>
45
+ <Box
46
+ padding="0"
47
+ minHeight="100%"
48
+ extraStyles={disabled ? `cursor: default;` : `cursor: pointer;`}
49
+ >
46
50
  {children}
47
51
  </Box>
48
52
  </Link>
@@ -53,11 +57,7 @@ const PlaceholderContentWrapper = ({
53
57
  minHeight="100%"
54
58
  dataQa={dataQa}
55
59
  aria-disabled={disabled}
56
- extraStyles={
57
- disabled
58
- ? "cursor: default; opacity: 0.7;"
59
- : "cursor: pointer; opacity: 1;"
60
- }
60
+ extraStyles={disabled ? "cursor: default;" : "cursor: pointer;"}
61
61
  >
62
62
  {children}
63
63
  </Box>
@@ -74,21 +74,24 @@ const Placeholder = ({
74
74
  themeValues,
75
75
  dataQa,
76
76
  disabled = false
77
- }) => (
78
- <PlaceholderContentWrapper
79
- isLink={isLink}
80
- action={action}
81
- destination={destination}
82
- dataQa={dataQa}
83
- disabled={disabled}
84
- >
85
- <Box
86
- padding="0"
87
- borderRadius="4px"
88
- border="none"
89
- minHeight={themeValues.height}
90
- hiddenStyles={!visible}
91
- extraStyles={`
77
+ }) => {
78
+ const tintedColor = `${tint(0.9, themeValues.color)}`;
79
+
80
+ return (
81
+ <PlaceholderContentWrapper
82
+ isLink={isLink}
83
+ action={action}
84
+ destination={destination}
85
+ dataQa={dataQa}
86
+ disabled={disabled}
87
+ >
88
+ <Box
89
+ padding="0"
90
+ borderRadius="4px"
91
+ border="none"
92
+ minHeight={themeValues.height}
93
+ hiddenStyles={!visible}
94
+ extraStyles={`
92
95
  background: linear-gradient(
93
96
  to right,
94
97
  ${variant === "large" ? STORM_GREY : themeValues.color} 40%,
@@ -109,22 +112,22 @@ const Placeholder = ({
109
112
  display: flex;
110
113
  justify-content: center;
111
114
  align-items:center;`}
112
- hoverStyles={`background-color: ${
113
- variant === "large" ? GRECIAN_GREY : tint(0.9, themeValues.color)
114
- };`}
115
- >
116
- <Center maxWidth="300px">
117
- <Box
118
- padding="0"
119
- tabIndex="0"
120
- onKeyPress={e => e.key === "Enter" && !disabled && action()}
121
- >
122
- <Cluster justify="center" align="center" minHeight="100%">
123
- <Switcher maxChildren={2} childGap="0">
124
- {variant === "large" && <div></div>}
125
- <Box
126
- padding="0"
127
- extraStyles={`.fill {
115
+ hoverStyles={`background-color: ${
116
+ variant === "large" ? GRECIAN_GREY : tintedColor
117
+ };`}
118
+ >
119
+ <Center maxWidth="300px">
120
+ <Box
121
+ padding="0"
122
+ tabIndex="0"
123
+ onKeyPress={e => e.key === "Enter" && !disabled && action()}
124
+ >
125
+ <Cluster justify="center" align="center" minHeight="100%">
126
+ <Switcher maxChildren={2} childGap="0">
127
+ {variant === "large" && <div></div>}
128
+ <Box
129
+ padding="0"
130
+ extraStyles={`.fill {
128
131
  fill: ${
129
132
  variant === "large" ? CHARADE_GREY : themeValues.color
130
133
  };
@@ -133,44 +136,45 @@ const Placeholder = ({
133
136
  variant === "large" ? CHARADE_GREY : themeValues.color
134
137
  };
135
138
  }`}
136
- >
137
- {variant === "large" ? (
138
- <Center intrinsic>
139
- {getLargeIcon(largeIcon)}
140
- <Text
141
- variant="pS"
142
- color={themeValues.color}
143
- weight={FONT_WEIGHT_REGULAR}
144
- extraStyles={`text-align: center;`}
145
- >
146
- {text}
147
- </Text>
148
- </Center>
149
- ) : (
150
- <Cover singleChild minHeight="100%">
151
- <Cluster justify="center" align="center">
152
- <IconAdd />
153
- <Center intrinsic>
154
- <Text
155
- variant="pS"
156
- color={themeValues.color}
157
- weight={FONT_WEIGHT_REGULAR}
158
- extraStyles={`padding: 0 0 0 8px; text-align: center;`}
159
- >
160
- {text}
161
- </Text>
162
- </Center>
163
- </Cluster>
164
- </Cover>
165
- )}
166
- </Box>
167
- </Switcher>
168
- </Cluster>
169
- </Box>
170
- </Center>
171
- </Box>
172
- </PlaceholderContentWrapper>
173
- );
139
+ >
140
+ {variant === "large" ? (
141
+ <Center intrinsic>
142
+ {getLargeIcon(largeIcon)}
143
+ <Text
144
+ variant="pS"
145
+ color={themeValues.color}
146
+ weight={FONT_WEIGHT_REGULAR}
147
+ extraStyles={`text-align: center;`}
148
+ >
149
+ {text}
150
+ </Text>
151
+ </Center>
152
+ ) : (
153
+ <Cover singleChild minHeight="100%">
154
+ <Cluster justify="center" align="center">
155
+ <IconAdd />
156
+ <Center intrinsic>
157
+ <Text
158
+ variant="pS"
159
+ color={themeValues.color}
160
+ weight={FONT_WEIGHT_REGULAR}
161
+ extraStyles={`padding: 0 0 0 8px; text-align: center;`}
162
+ >
163
+ {text}
164
+ </Text>
165
+ </Center>
166
+ </Cluster>
167
+ </Cover>
168
+ )}
169
+ </Box>
170
+ </Switcher>
171
+ </Cluster>
172
+ </Box>
173
+ </Center>
174
+ </Box>
175
+ </PlaceholderContentWrapper>
176
+ );
177
+ };
174
178
 
175
179
  export default themeComponent(
176
180
  Placeholder,