@thecb/components 10.4.4-beta.0 → 10.4.4-beta.2

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": "10.4.4-beta.0",
3
+ "version": "10.4.4-beta.2",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -51,8 +51,8 @@ const PlaceholderContentWrapper = ({
51
51
  <Box
52
52
  padding="0"
53
53
  minHeight="100%"
54
- extraStyles={isDisabled ? `cursor: default` : `cursor: pointer;`}
55
- aria-disabled={isDisabled}
54
+ extraStyles="cursor: default;"
55
+ aria-disabled={true}
56
56
  >
57
57
  {children}
58
58
  </Box>
@@ -61,31 +61,18 @@ const PlaceholderContentWrapper = ({
61
61
  to={destination}
62
62
  data-qa={dataQa}
63
63
  disabled={isDisabled}
64
- style={
65
- isDisabled
66
- ? {
67
- textDecoration: "none",
68
- color: `${MANATEE_GREY}`,
69
- borderColor: `${MANATEE_GREY}`
70
- }
71
- : { textDecoration: "none" }
72
- }
64
+ style={{ textDecoration: "none" }}
73
65
  >
74
- <Box
75
- padding="0"
76
- minHeight="100%"
77
- extraStyles={isDisabled ? `cursor: default;` : `cursor: pointer;`}
78
- >
66
+ <Box padding="0" minHeight="100%" extraStyles="cursor: pointer;">
79
67
  {children}
80
68
  </Box>
81
69
  </Link>
82
70
  ) : (
83
71
  <Box
84
- onClick={isDisabled ? noop : action}
72
+ onClick={action}
85
73
  padding="0"
86
74
  minHeight="100%"
87
- aria-disabled={isDisabled}
88
- extraStyles={isDisabled ? `cursor: default` : `cursor: pointer;`}
75
+ extraStyles="cursor: pointer;"
89
76
  dataQa={dataQa}
90
77
  >
91
78
  {children}
@@ -40,7 +40,8 @@ const EditableList = ({
40
40
  listPadding = "0rem 0rem 1.5rem 0rem",
41
41
  qaPrefix,
42
42
  ariaLabel,
43
- editItemAriaRole = ""
43
+ editItemAriaRole = "",
44
+ disablePlaceholder = false
44
45
  }) => {
45
46
  const addText = `Add a${
46
47
  itemName[0].match(/[aieouAIEOU]/) ? "n" : ""
@@ -161,13 +162,26 @@ const EditableList = ({
161
162
  );
162
163
  })}
163
164
  </Box>
164
- {canAdd && (!maxItems || items.length < maxItems) && (
165
+ {canAdd &&
166
+ (!maxItems || items.length < maxItems) &&
167
+ !disablePlaceholder ? (
165
168
  <Box padding={items.length === 0 ? "0" : "1rem 0 0"}>
166
169
  <Placeholder
167
170
  text={addText}
168
171
  action={addItem}
169
172
  dataQa={"Add " + qaPrefix}
170
173
  aria-label={addText}
174
+ isDisabled={disablePlaceholder}
175
+ />
176
+ </Box>
177
+ ) : (
178
+ <Box padding={items.length === 0 ? "0" : "1rem 0 0"}>
179
+ <Placeholder
180
+ text={addText}
181
+ action={addItem}
182
+ dataQa={"Add " + qaPrefix}
183
+ aria-label={addText}
184
+ isDisabled={disablePlaceholder}
171
185
  />
172
186
  </Box>
173
187
  )}