@thecb/components 4.0.22 → 4.0.23-beta.1

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 CHANGED
@@ -20224,7 +20224,9 @@ var ERRORS = {
20224
20224
  "71": "Passed invalid pixel value %s to %s(), please pass a value like \"12px\" or 12.\n\n",
20225
20225
  "72": "Passed invalid base value %s to %s(), please pass a value like \"12px\" or 12.\n\n",
20226
20226
  "73": "Please provide a valid CSS variable.\n\n",
20227
- "74": "CSS variable not found.\n"
20227
+ "74": "CSS variable not found and no default was provided.\n\n",
20228
+ "75": "important requires a valid style object, got a %s instead.\n\n",
20229
+ "76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n"
20228
20230
  };
20229
20231
  /**
20230
20232
  * super basic version of sprintf
@@ -33897,6 +33899,8 @@ var EditableList = function EditableList(_ref) {
33897
33899
  title = _ref$title === void 0 ? "" : _ref$title,
33898
33900
  _ref$titleWeight = _ref.titleWeight,
33899
33901
  titleWeight = _ref$titleWeight === void 0 ? "400" : _ref$titleWeight,
33902
+ _ref$canAdd = _ref.canAdd,
33903
+ canAdd = _ref$canAdd === void 0 ? true : _ref$canAdd,
33900
33904
  addItem = _ref.addItem,
33901
33905
  removeItem = _ref.removeItem,
33902
33906
  editItem = _ref.editItem,
@@ -33980,7 +33984,7 @@ var EditableList = function EditableList(_ref) {
33980
33984
  },
33981
33985
  extraStyles: "min-width: 0;"
33982
33986
  }))));
33983
- })), (!maxItems || items.length < maxItems) && /*#__PURE__*/React__default.createElement(Box, {
33987
+ })), canAdd && (!maxItems || items.length < maxItems) && /*#__PURE__*/React__default.createElement(Box, {
33984
33988
  padding: items.length === 0 ? "0" : "1rem 0 0"
33985
33989
  }, /*#__PURE__*/React__default.createElement(Placeholder$1, {
33986
33990
  text: "Add a".concat(itemName[0].match(/[aieouAIEOU]/) ? "n" : "", " ").concat(itemName),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "4.0.22",
3
+ "version": "4.0.23-beta.1",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -18,6 +18,7 @@ import {
18
18
  const EditableList = ({
19
19
  title = "",
20
20
  titleWeight = "400",
21
+ canAdd = true,
21
22
  addItem,
22
23
  removeItem,
23
24
  editItem,
@@ -123,7 +124,7 @@ const EditableList = ({
123
124
  );
124
125
  })}
125
126
  </Box>
126
- {(!maxItems || items.length < maxItems) && (
127
+ {canAdd && (!maxItems || items.length < maxItems) && (
127
128
  <Box padding={items.length === 0 ? "0" : "1rem 0 0"}>
128
129
  <Placeholder
129
130
  text={`Add a${