@thecb/components 8.4.1 → 8.4.3-beta.0

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.4.1",
3
+ "version": "8.4.3-beta.0",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { ROYAL_BLUE_VIVID } from "../../../constants/colors";
3
3
 
4
- const ArrowRightIcon = ({ color = ROYAL_BLUE_VIVID, labeledBy = "" }) => {
4
+ const ArrowRightIcon = ({ color = ROYAL_BLUE_VIVID, labelledBy = "" }) => {
5
5
  return (
6
6
  <svg
7
7
  xmlns="http://www.w3.org/2000/svg"
@@ -9,7 +9,7 @@ const ArrowRightIcon = ({ color = ROYAL_BLUE_VIVID, labeledBy = "" }) => {
9
9
  height="20"
10
10
  viewBox="0 0 20 20"
11
11
  fill="none"
12
- aria-labeledBy={labeledBy}
12
+ aria-labelledby={labelledBy}
13
13
  >
14
14
  <path
15
15
  fillRule="evenodd"
@@ -16,7 +16,7 @@ const ExternalLinkIcon = ({ linkColor, text }) => (
16
16
  />
17
17
  <mask
18
18
  id={`mask0_902_435-${text}`}
19
- style={{ "mask-type": "alpha" }}
19
+ style={{ maskType: "alpha" }}
20
20
  maskUnits="userSpaceOnUse"
21
21
  x="1"
22
22
  y="1"
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { ROYAL_BLUE_VIVID } from "../../../constants/colors";
3
3
 
4
- const PlusCircleIcon = ({ color = ROYAL_BLUE_VIVID, labeledBy = "" }) => {
4
+ const PlusCircleIcon = ({ color = ROYAL_BLUE_VIVID, labelledBy = "" }) => {
5
5
  return (
6
6
  <svg
7
7
  xmlns="http://www.w3.org/2000/svg"
@@ -9,7 +9,7 @@ const PlusCircleIcon = ({ color = ROYAL_BLUE_VIVID, labeledBy = "" }) => {
9
9
  height="20"
10
10
  viewBox="0 0 20 20"
11
11
  fill="none"
12
- aria-labelledby={labeledBy}
12
+ aria-labelledby={labelledBy}
13
13
  >
14
14
  <path
15
15
  fillRule="evenodd"
@@ -5,15 +5,17 @@ import {
5
5
  ItemWrapper,
6
6
  ActionWrapper,
7
7
  TableItemKey,
8
- TableItemValue
8
+ TableItemValue,
9
9
  } from "./EditableTable.styled";
10
10
  import { Box } from "../../atoms/layouts";
11
11
  import Text from "../../atoms/text";
12
12
  import { CHARADE_GREY, GHOST_GREY } from "../../../constants/colors";
13
+ import { noop } from "../../../util/general";
13
14
 
14
15
  const TableListItem = ({
15
16
  title,
16
17
  value,
18
+ onClick = noop,
17
19
  canEdit = false,
18
20
  canRemove = false,
19
21
  isMobile,
@@ -36,7 +38,7 @@ const TableListItem = ({
36
38
  `}
37
39
  >
38
40
  <ItemWrapper>
39
- <EditableTableListItem isMobile={isMobile}>
41
+ <EditableTableListItem isMobile={isMobile} onClick={onClick}>
40
42
  <TableItemKey isMobile={isMobile}>
41
43
  <Text variant="pS" color={CHARADE_GREY}>
42
44
  {title}
@@ -14,6 +14,7 @@ export const EditableTable: React.FC<Expand<EditableTableProps> &
14
14
  export interface TableListItemProps {
15
15
  title: string | JSX.Element;
16
16
  value: string | JSX.Element;
17
+ onClick?: () => void;
17
18
  canEdit?: boolean;
18
19
  canRemove?: boolean;
19
20
  isMobile?: boolean;
@@ -20,12 +20,14 @@ const LinkCard = ({
20
20
  extraActiveStyles = ""
21
21
  }) => {
22
22
  const { isMobile } = useContext(ThemeContext);
23
+ const regex = /\W/g;
24
+ const locatorSlug = title.toLowerCase().replaceAll(regex, "-");
23
25
 
24
26
  return (
25
27
  <Styled.Container
26
28
  border={`1px solid ${themeValues.background};`}
27
29
  borderRadius="8px"
28
- dataQa={`link-card-${title}`}
30
+ dataQa={`link-card-${locatorSlug}`}
29
31
  width="100%"
30
32
  maxWidth={isMobile ? "100%" : "288px"}
31
33
  minWidth={isMobile ? "240px" : "288px"}