@thecb/components 11.2.3-beta.4 → 11.2.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": "11.2.3-beta.4",
3
+ "version": "11.2.3",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -29,12 +29,10 @@ const RegistrationBanner = ({
29
29
  extraStyles={extraStyles}
30
30
  themeValues={themeValues}
31
31
  isMobile={isMobile}
32
- role="banner"
33
32
  aria-label="Registration Banner"
34
33
  justify="center"
35
34
  >
36
35
  <Styled.ContentContainer
37
- role="main"
38
36
  align="center"
39
37
  justify="space-between"
40
38
  overflow="visible"
@@ -1,10 +1,11 @@
1
1
  import styled from "styled-components";
2
2
  import { Box, Cluster, Stack } from "../../atoms/layouts";
3
3
  import ButtonWithLink from "../../atoms/button-with-link/ButtonWithLink";
4
- import { hexToRGBA } from "../../../util/general";
4
+ import { adjustHexColor } from "../../../util/general";
5
5
 
6
6
  export const BannerContainer = styled(Cluster)`
7
- background: ${({ themeValues }) => hexToRGBA(themeValues.background, 0.9)};
7
+ background: ${({ themeValues }) =>
8
+ adjustHexColor(themeValues.background, 10, "lighten")};
8
9
  padding: ${({ isMobile }) => (isMobile ? "1rem 2rem" : " 2rem 8.25rem")};
9
10
  `;
10
11
 
@@ -6,7 +6,7 @@ export interface RegistrationBannerProps {
6
6
  extraStyles?: string;
7
7
  loginLink?: string;
8
8
  registrationLink?: string;
9
- themeValues: any;
9
+ themeValues?: any;
10
10
  titleAs?: string;
11
11
  titleVariant?: string;
12
12
  }
@@ -213,39 +213,3 @@ export const adjustHexColor = (hex, percent, action) => {
213
213
  .slice(1)
214
214
  .padStart(6, "0")}`;
215
215
  };
216
-
217
- /**
218
- * Converts a hex color code to an RGBA color string with the specified alpha value.
219
- *
220
- * @param {string} hex - The hex color code (e.g., "#3498db" or "3498db").
221
- * @param {number} alpha - The alpha value (opacity) between 0 and 1.
222
- * @returns {string} - The RGBA color string (e.g., "rgba(52, 152, 219, 0.5)").
223
- * @throws {Error} - Throws an error if the hex code is not a valid 3 or 6-digit hex color.
224
- */
225
- export const hexToRGBA = (hex, alpha) => {
226
- // Remove hash at the start if present
227
- hex = hex.replace(/^\s*#/, "");
228
-
229
- // If hex is 3 characters, convert it to 6 characters.
230
- if (hex.length === 3) {
231
- hex = hex
232
- .split("")
233
- .map(char => char + char)
234
- .join("");
235
- }
236
-
237
- // Validate hex length
238
- if (hex.length !== 6) {
239
- throw new Error(
240
- "Invalid hex color provided. Expected a 3 or 6-digit hex color."
241
- );
242
- }
243
-
244
- // Parse the hex color components
245
- const bigint = parseInt(hex, 16);
246
- const r = (bigint >> 16) & 255;
247
- const g = (bigint >> 8) & 255;
248
- const b = bigint & 255;
249
-
250
- return `rgba(${r}, ${g}, ${b}, ${alpha})`;
251
- };