@thecb/components 7.10.1 → 7.10.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": "7.10.1",
3
+ "version": "7.10.3",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import { fallbackValues } from "./Icons.theme";
3
+ import { themeComponent } from "../../../util/themeUtils";
4
+
5
+ const PencilIcon = ({ ariaLabel = "Edit", themeValues }) => (
6
+ <svg
7
+ aria-label={ariaLabel}
8
+ width="24px"
9
+ height="24px"
10
+ fill="none"
11
+ xmlns="http://www.w3.org/2000/svg"
12
+ >
13
+ <path
14
+ fillRule="evenodd"
15
+ clipRule="evenodd"
16
+ d="M19.74 6.84a.885.885 0 0 1 0 1.253l-1.626 1.626-3.333-3.333 1.626-1.626a.885.885 0 0 1 1.253 0l2.08 2.08ZM4 20.5v-3.333l9.83-9.83 3.333 3.333-9.83 9.83H4Z"
17
+ fill={themeValues.subIconColor}
18
+ />
19
+ </svg>
20
+ );
21
+
22
+ export default themeComponent(PencilIcon, "Icons", fallbackValues, "info");
@@ -31,6 +31,7 @@ import {
31
31
  DuplicateIcon,
32
32
  ErroredIcon,
33
33
  FailedIcon,
34
+ PencilIcon,
34
35
  PendingIcon,
35
36
  RefundIcon,
36
37
  RejectedIcon,
@@ -75,6 +76,7 @@ export const chargebackReversalIcon = () => <ChargebackReversalIcon />;
75
76
  export const duplicateIcon = () => <DuplicateIcon />;
76
77
  export const erroredIcon = () => <ErroredIcon />;
77
78
  export const failedIcon = () => <FailedIcon />;
79
+ export const pencilIcon = () => <PencilIcon />;
78
80
  export const pendingIcon = () => <PendingIcon />;
79
81
  export const refundIcon = () => <RefundIcon />;
80
82
  export const rejectedIcon = () => <RejectedIcon />;
@@ -35,6 +35,7 @@ import DuplicateIcon from "./DuplicateIcon";
35
35
  import ErroredIcon from "./ErroredIcon";
36
36
  import ExternalLinkIcon from "./ExternalLinkIcon";
37
37
  import FailedIcon from "./FailedIcon";
38
+ import PencilIcon from "./PencilIcon";
38
39
  import PendingIcon from "./PendingIcon";
39
40
  import RefundIcon from "./RefundIcon";
40
41
  import RejectedIcon from "./RejectedIcon";
@@ -118,6 +119,7 @@ export {
118
119
  ErroredIcon,
119
120
  ExternalLinkIcon,
120
121
  FailedIcon,
122
+ PencilIcon,
121
123
  PendingIcon,
122
124
  RefundIcon,
123
125
  RejectedIcon,
@@ -13,6 +13,7 @@ import {
13
13
  BOSTON_BLUE,
14
14
  CHARADE_GREY
15
15
  } from "../../../constants/colors";
16
+ import { createIdFromString } from "../../../util/general";
16
17
 
17
18
  const ACTIVE = "ACTIVE";
18
19
  const EXPIRED = "EXPIRED";
@@ -36,6 +37,7 @@ const EditableList = ({
36
37
  modalProps,
37
38
  autoPayMethods,
38
39
  as = "p",
40
+ listPadding = "0rem 0rem 1.5rem 0rem",
39
41
  qaPrefix,
40
42
  ariaLabel
41
43
  }) => {
@@ -43,7 +45,20 @@ const EditableList = ({
43
45
  itemName[0].match(/[aieouAIEOU]/) ? "n" : ""
44
46
  } ${itemName}`;
45
47
  return (
46
- <Box padding="0rem 0rem 1.5rem 0rem" as="section" aria-labelledby={`li`}>
48
+ <Box
49
+ padding={listPadding}
50
+ as="section"
51
+ aria-labelledby={
52
+ typeof title === "string"
53
+ ? `editable-list-${createIdFromString(title)}`
54
+ : ""
55
+ }
56
+ aria-label={
57
+ !title && typeof itemName === "string"
58
+ ? `editable-list-${createIdFromString(itemName)}`
59
+ : ""
60
+ }
61
+ >
47
62
  <Stack childGap="0rem">
48
63
  {title !== "" && (
49
64
  <Box padding="0rem 0rem 0.5rem 0rem">
@@ -52,6 +67,11 @@ const EditableList = ({
52
67
  weight={titleWeight}
53
68
  color={CHARADE_GREY}
54
69
  extraStyles="letter-spacing: 0.29px; font-size: 1.125rem;"
70
+ id={
71
+ typeof title === "string"
72
+ ? `editable-list-${createIdFromString(title)}`
73
+ : ""
74
+ }
55
75
  >
56
76
  {title}
57
77
  </Title>