@thecb/components 10.5.1-beta.4 → 10.5.2-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.
@@ -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,14 @@ const EditableList = ({
161
162
  );
162
163
  })}
163
164
  </Box>
164
- {canAdd && (!maxItems || items.length < maxItems) && (
165
+ {canAdd && !(!maxItems || items.length < maxItems) && (
165
166
  <Box padding={items.length === 0 ? "0" : "1rem 0 0"}>
166
167
  <Placeholder
167
168
  text={addText}
168
169
  action={addItem}
169
170
  dataQa={"Add " + qaPrefix}
170
171
  aria-label={addText}
172
+ isDisabled={disablePlaceholder}
171
173
  />
172
174
  </Box>
173
175
  )}
@@ -1,6 +1,4 @@
1
- import React, { useState } from "react";
2
- import { boolean } from "@storybook/addon-knobs";
3
-
1
+ import React from "react";
4
2
  import EditableList from "./EditableList";
5
3
  import page from "../../../../.storybook/page";
6
4
 
@@ -2,7 +2,6 @@ import React from "react";
2
2
  import { noop } from "../../../../util/general";
3
3
  import ButtonWithAction from "../../../atoms/button-with-action/ButtonWithAction";
4
4
  import { CloseIcon } from "../../../atoms/icons/CloseIcon";
5
- import { button } from "@storybook/addon-knobs";
6
5
 
7
6
  export const CloseIconButton = ({
8
7
  buttonExtraStyles = "",