@thecb/components 12.0.0-beta.7 → 12.0.0-beta.8
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 +66 -56
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +66 -56
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/link/InternalLink.js +3 -1
- package/src/components/molecules/editable-list/EditableList.js +22 -9
- package/src/components/molecules/obligation/modules/IconModule.js +1 -1
package/package.json
CHANGED
|
@@ -24,7 +24,8 @@ const InternalLink = forwardRef(
|
|
|
24
24
|
hoverUnderline = true,
|
|
25
25
|
extraHoverStyles = ``,
|
|
26
26
|
extraActiveStyles = ``,
|
|
27
|
-
extraFocusStyles =
|
|
27
|
+
extraFocusStyles = ``,
|
|
28
|
+
...rest
|
|
28
29
|
},
|
|
29
30
|
ref
|
|
30
31
|
) => {
|
|
@@ -57,6 +58,7 @@ const InternalLink = forwardRef(
|
|
|
57
58
|
extraFocusStyles={extraFocusStyles}
|
|
58
59
|
data-qa={dataQa}
|
|
59
60
|
ref={ref}
|
|
61
|
+
{...rest}
|
|
60
62
|
>
|
|
61
63
|
{safeChildren(children, <span />)}
|
|
62
64
|
</StyledInternalLink>
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
import { Box, Stack } from "../../atoms/layouts";
|
|
7
7
|
import Placeholder from "../../atoms/placeholder";
|
|
8
8
|
import ButtonWithAction from "../../atoms/button-with-action";
|
|
9
|
+
import { InternalLink } from "../../atoms/link";
|
|
9
10
|
import Text from "../../atoms/text";
|
|
10
11
|
import Title from "../../atoms/title";
|
|
11
12
|
import {
|
|
@@ -42,7 +43,8 @@ const EditableList = ({
|
|
|
42
43
|
qaPrefix,
|
|
43
44
|
ariaLabel,
|
|
44
45
|
editItemAriaRole = "",
|
|
45
|
-
disablePlaceholder = false
|
|
46
|
+
disablePlaceholder = false,
|
|
47
|
+
getEditHref = null
|
|
46
48
|
}) => {
|
|
47
49
|
const addText = `Add a${
|
|
48
50
|
itemName[0].match(/[aieouAIEOU]/) ? "n" : ""
|
|
@@ -150,14 +152,25 @@ const EditableList = ({
|
|
|
150
152
|
dataQa={qaPrefix + " Edit"}
|
|
151
153
|
key={`Edit ${item.id}`}
|
|
152
154
|
>
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
155
|
+
{getEditHref ? (
|
|
156
|
+
<InternalLink
|
|
157
|
+
to={getEditHref(item)}
|
|
158
|
+
fontWeight="400"
|
|
159
|
+
extraStyles={`margin: 0.5rem; min-width: 0;`}
|
|
160
|
+
aria-label={`Edit ${ariaLabel || itemName}`}
|
|
161
|
+
>
|
|
162
|
+
Edit
|
|
163
|
+
</InternalLink>
|
|
164
|
+
) : (
|
|
165
|
+
<ButtonWithAction
|
|
166
|
+
variant="smallGhost"
|
|
167
|
+
text="Edit"
|
|
168
|
+
action={() => editItem(item.id)}
|
|
169
|
+
extraStyles={`min-width: 0;`}
|
|
170
|
+
aria-label={`Edit ${ariaLabel || itemName}`}
|
|
171
|
+
role={editItemAriaRole}
|
|
172
|
+
/>
|
|
173
|
+
)}
|
|
161
174
|
</Box>
|
|
162
175
|
)}
|
|
163
176
|
</EditableListItemControls>
|