carbon-react 126.0.0 → 126.0.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.
@@ -6,6 +6,8 @@ export interface MessageContentProps {
6
6
  children?: React.ReactNode;
7
7
  /** determines if the close icon is shown */
8
8
  showCloseIcon?: boolean;
9
+ /** @ignore @private used to reduce the left-padding for the transparent variant */
10
+ reduceLeftPadding?: boolean;
9
11
  }
10
- declare const MessageContent: ({ title, children, showCloseIcon, }: MessageContentProps) => React.JSX.Element;
12
+ declare const MessageContent: ({ title, children, showCloseIcon, reduceLeftPadding, }: MessageContentProps) => React.JSX.Element;
11
13
  export default MessageContent;
@@ -5,10 +5,12 @@ import MessageContentStyle from "./message-content.style";
5
5
  const MessageContent = ({
6
6
  title,
7
7
  children,
8
- showCloseIcon
8
+ showCloseIcon,
9
+ reduceLeftPadding = false
9
10
  }) => {
10
11
  return /*#__PURE__*/React.createElement(MessageContentStyle, {
11
12
  showCloseIcon: showCloseIcon,
13
+ reduceLeftPadding: reduceLeftPadding,
12
14
  "data-element": "message-content"
13
15
  }, /*#__PURE__*/React.createElement(Content, {
14
16
  title: title
@@ -1,3 +1,3 @@
1
1
  import { MessageContentProps } from "./message-content.component";
2
- declare const MessageContentStyle: import("styled-components").StyledComponent<"div", any, Pick<MessageContentProps, "showCloseIcon">, never>;
2
+ declare const MessageContentStyle: import("styled-components").StyledComponent<"div", any, Pick<MessageContentProps, "showCloseIcon" | "reduceLeftPadding">, never>;
3
3
  export default MessageContentStyle;
@@ -3,7 +3,9 @@ const MessageContentStyle = styled.div`
3
3
  padding: 15px ${({
4
4
  showCloseIcon
5
5
  }) => showCloseIcon ? "50px" : "20px"} 15px
6
- 20px;
6
+ ${({
7
+ reduceLeftPadding
8
+ }) => reduceLeftPadding ? "10px" : "20px"};
7
9
  white-space: pre-wrap;
8
10
  flex: 1;
9
11
  `;
@@ -49,7 +49,8 @@ const Message = /*#__PURE__*/React.forwardRef(({
49
49
  transparent: transparent
50
50
  }), /*#__PURE__*/React.createElement(MessageContent, {
51
51
  showCloseIcon: showCloseIcon,
52
- title: title
52
+ title: title,
53
+ reduceLeftPadding: transparent
53
54
  }, children), renderCloseIcon()) : null;
54
55
  });
55
56
  Message.propTypes = {
@@ -6,6 +6,8 @@ export interface MessageContentProps {
6
6
  children?: React.ReactNode;
7
7
  /** determines if the close icon is shown */
8
8
  showCloseIcon?: boolean;
9
+ /** @ignore @private used to reduce the left-padding for the transparent variant */
10
+ reduceLeftPadding?: boolean;
9
11
  }
10
- declare const MessageContent: ({ title, children, showCloseIcon, }: MessageContentProps) => React.JSX.Element;
12
+ declare const MessageContent: ({ title, children, showCloseIcon, reduceLeftPadding, }: MessageContentProps) => React.JSX.Element;
11
13
  export default MessageContent;
@@ -12,10 +12,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
12
12
  const MessageContent = ({
13
13
  title,
14
14
  children,
15
- showCloseIcon
15
+ showCloseIcon,
16
+ reduceLeftPadding = false
16
17
  }) => {
17
18
  return /*#__PURE__*/_react.default.createElement(_messageContent.default, {
18
19
  showCloseIcon: showCloseIcon,
20
+ reduceLeftPadding: reduceLeftPadding,
19
21
  "data-element": "message-content"
20
22
  }, /*#__PURE__*/_react.default.createElement(_content.default, {
21
23
  title: title
@@ -1,3 +1,3 @@
1
1
  import { MessageContentProps } from "./message-content.component";
2
- declare const MessageContentStyle: import("styled-components").StyledComponent<"div", any, Pick<MessageContentProps, "showCloseIcon">, never>;
2
+ declare const MessageContentStyle: import("styled-components").StyledComponent<"div", any, Pick<MessageContentProps, "showCloseIcon" | "reduceLeftPadding">, never>;
3
3
  export default MessageContentStyle;
@@ -10,7 +10,9 @@ const MessageContentStyle = _styledComponents.default.div`
10
10
  padding: 15px ${({
11
11
  showCloseIcon
12
12
  }) => showCloseIcon ? "50px" : "20px"} 15px
13
- 20px;
13
+ ${({
14
+ reduceLeftPadding
15
+ }) => reduceLeftPadding ? "10px" : "20px"};
14
16
  white-space: pre-wrap;
15
17
  flex: 1;
16
18
  `;
@@ -58,7 +58,8 @@ const Message = exports.Message = /*#__PURE__*/_react.default.forwardRef(({
58
58
  transparent: transparent
59
59
  }), /*#__PURE__*/_react.default.createElement(_messageContent.default, {
60
60
  showCloseIcon: showCloseIcon,
61
- title: title
61
+ title: title,
62
+ reduceLeftPadding: transparent
62
63
  }, children), renderCloseIcon()) : null;
63
64
  });
64
65
  Message.propTypes = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "126.0.0",
3
+ "version": "126.0.1",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",