@thecb/components 8.3.1-beta.2 → 8.3.1-beta.4

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": "8.3.1-beta.2",
3
+ "version": "8.3.1-beta.4",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -8,6 +8,7 @@ import ButtonWithAction from "../button-with-action";
8
8
  const ButtonWithLink = ({
9
9
  url = "/",
10
10
  active = false,
11
+ activeBackgroundColor = undefined,
11
12
  disabled = false,
12
13
  fileLink = false,
13
14
  extraStyles,
@@ -20,6 +21,7 @@ const ButtonWithLink = ({
20
21
  children,
21
22
  url,
22
23
  active,
24
+ activeBackgroundColor,
23
25
  disabled,
24
26
  newTab,
25
27
  dataQa,
@@ -1,6 +1,6 @@
1
1
  import React, { forwardRef } from "react";
2
2
  import styled from "styled-components";
3
- import { Link } from "react-router-dom";
3
+ import { Link, useMatch } from "react-router-dom";
4
4
  import { ROYAL_BLUE } from "../../../constants/colors";
5
5
  /*
6
6
  The extracting of props and the disabling of the eslint rule is to stop React from complaining about
@@ -13,7 +13,11 @@ export const StyledInternalLink = styled(
13
13
  (
14
14
  { hoverColor, activeColor, active, color, extrastyles, ...props },
15
15
  ref
16
- ) => <Link {...props} ref={ref} />
16
+ ) => {
17
+ let match = useMatch();
18
+ console.log("🚀 ~ file: InternalLink.styled.js:18 ~ match:", match);
19
+ return <Link {...props} ref={ref} />
20
+ }
17
21
  )
18
22
  )`
19
23
  display: flex;
@@ -25,6 +29,8 @@ export const StyledInternalLink = styled(
25
29
  font-family: ${({ fontFamily }) => fontFamily};
26
30
  margin: ${({ margin }) => margin};
27
31
 
32
+ background-color: ${match} ? 'lightblue' : 'transparent',
33
+
28
34
  &:hover {
29
35
  color: ${({ hoverColor }) => hoverColor};
30
36
  text-decoration: underline;
@@ -1,19 +1,24 @@
1
- import { colors } from "../../../constants";
1
+ import {
2
+ SAPPHIRE_BLUE,
3
+ PEACOCK_BLUE,
4
+ INFO_BLUE,
5
+ MATISSE_BLUE,
6
+ } from "../../../constants/colors";
2
7
 
3
8
  const fontFamily = {
4
9
  primary: "Public Sans",
5
- secondary: "Open Sans"
10
+ secondary: "Open Sans",
6
11
  };
7
12
 
8
- const hoverColor = "#116285";
9
- const activeColor = "#0E506D";
10
- const activeBackgroundColor = colors.INFO_BLUE;
11
- const externalLinkColor = "#15749D";
13
+ const hoverColor = SAPPHIRE_BLUE;
14
+ const activeColor = PEACOCK_BLUE;
15
+ const activeBackgroundColor = INFO_BLUE;
16
+ const externalLinkColor = MATISSE_BLUE;
12
17
 
13
18
  export const fallbackValues = {
14
19
  fontFamily,
15
20
  hoverColor,
16
21
  activeColor,
17
22
  activeBackgroundColor,
18
- externalLinkColor
23
+ externalLinkColor,
19
24
  };