@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/dist/index.cjs.js +14 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +14 -9
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/icons/ArrowRightIcon.js +2 -2
- package/src/components/atoms/icons/{ExternalLinkIcon.js → ExternalLinkicon.js} +1 -1
- package/src/components/atoms/icons/PlusCircleIcon.js +2 -2
- package/src/components/molecules/editable-table/TableListItem.js +4 -2
- package/src/components/molecules/editable-table/index.d.ts +1 -0
- package/src/components/molecules/link-card/LinkCard.js +3 -1
package/package.json
CHANGED
|
@@ -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,
|
|
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-
|
|
12
|
+
aria-labelledby={labelledBy}
|
|
13
13
|
>
|
|
14
14
|
<path
|
|
15
15
|
fillRule="evenodd"
|
|
@@ -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,
|
|
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={
|
|
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-${
|
|
30
|
+
dataQa={`link-card-${locatorSlug}`}
|
|
29
31
|
width="100%"
|
|
30
32
|
maxWidth={isMobile ? "100%" : "288px"}
|
|
31
33
|
minWidth={isMobile ? "240px" : "288px"}
|