carbon-react 116.1.3 → 116.2.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.
@@ -3,7 +3,7 @@ import { SpaceProps } from "styled-system";
3
3
  import { StyledAccordionContainerProps } from "./accordion.style";
4
4
  export interface AccordionProps extends StyledAccordionContainerProps, SpaceProps {
5
5
  /** Width of the buttonHeading when it's set, defaults to 150px */
6
- buttonWidth?: number;
6
+ buttonWidth?: number | string;
7
7
  /** Content of the Accordion component */
8
8
  children?: React.ReactNode;
9
9
  /** Set the default state of expansion of the Accordion if component is meant to be used as uncontrolled */
@@ -29,7 +29,7 @@ const Accordion = /*#__PURE__*/React.forwardRef(({
29
29
  warning,
30
30
  info,
31
31
  buttonHeading,
32
- buttonWidth = 150,
32
+ buttonWidth = "150px",
33
33
  openTitle,
34
34
  ...rest
35
35
  }, ref) => {
@@ -130,7 +130,7 @@ const Accordion = /*#__PURE__*/React.forwardRef(({
130
130
  Accordion.propTypes = {
131
131
  "borders": PropTypes.oneOf(["default", "full", "none"]),
132
132
  "buttonHeading": PropTypes.bool,
133
- "buttonWidth": PropTypes.number,
133
+ "buttonWidth": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
134
134
  "children": PropTypes.node,
135
135
  "defaultExpanded": PropTypes.bool,
136
136
  "disableContentPadding": PropTypes.bool,
@@ -28,7 +28,7 @@ interface StyledAccordionHeadingsContainerProps {
28
28
  declare const StyledAccordionHeadingsContainer: import("styled-components").StyledComponent<"div", any, StyledAccordionHeadingsContainerProps, never>;
29
29
  interface StyledAccordionTitleContainerProps {
30
30
  buttonHeading?: boolean;
31
- buttonWidth?: number;
31
+ buttonWidth?: number | string;
32
32
  hasButtonProps?: boolean;
33
33
  iconAlign?: "left" | "right";
34
34
  size?: "large" | "small";
@@ -156,7 +156,7 @@ const StyledAccordionTitleContainer = styled.div`
156
156
  }
157
157
 
158
158
  ${buttonWidth && css`
159
- width: ${buttonWidth}px;
159
+ width: ${typeof buttonWidth === "number" ? `${buttonWidth}px` : buttonWidth};
160
160
  `}
161
161
  `}
162
162
  `}
@@ -3,7 +3,7 @@ import { SpaceProps } from "styled-system";
3
3
  import { StyledAccordionContainerProps } from "./accordion.style";
4
4
  export interface AccordionProps extends StyledAccordionContainerProps, SpaceProps {
5
5
  /** Width of the buttonHeading when it's set, defaults to 150px */
6
- buttonWidth?: number;
6
+ buttonWidth?: number | string;
7
7
  /** Content of the Accordion component */
8
8
  children?: React.ReactNode;
9
9
  /** Set the default state of expansion of the Accordion if component is meant to be used as uncontrolled */
@@ -49,7 +49,7 @@ const Accordion = /*#__PURE__*/_react.default.forwardRef(({
49
49
  warning,
50
50
  info,
51
51
  buttonHeading,
52
- buttonWidth = 150,
52
+ buttonWidth = "150px",
53
53
  openTitle,
54
54
  ...rest
55
55
  }, ref) => {
@@ -152,7 +152,7 @@ exports.Accordion = Accordion;
152
152
  Accordion.propTypes = {
153
153
  "borders": _propTypes.default.oneOf(["default", "full", "none"]),
154
154
  "buttonHeading": _propTypes.default.bool,
155
- "buttonWidth": _propTypes.default.number,
155
+ "buttonWidth": _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
156
156
  "children": _propTypes.default.node,
157
157
  "defaultExpanded": _propTypes.default.bool,
158
158
  "disableContentPadding": _propTypes.default.bool,
@@ -28,7 +28,7 @@ interface StyledAccordionHeadingsContainerProps {
28
28
  declare const StyledAccordionHeadingsContainer: import("styled-components").StyledComponent<"div", any, StyledAccordionHeadingsContainerProps, never>;
29
29
  interface StyledAccordionTitleContainerProps {
30
30
  buttonHeading?: boolean;
31
- buttonWidth?: number;
31
+ buttonWidth?: number | string;
32
32
  hasButtonProps?: boolean;
33
33
  iconAlign?: "left" | "right";
34
34
  size?: "large" | "small";
@@ -180,7 +180,7 @@ const StyledAccordionTitleContainer = _styledComponents.default.div`
180
180
  }
181
181
 
182
182
  ${buttonWidth && (0, _styledComponents.css)`
183
- width: ${buttonWidth}px;
183
+ width: ${typeof buttonWidth === "number" ? `${buttonWidth}px` : buttonWidth};
184
184
  `}
185
185
  `}
186
186
  `}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "116.1.3",
3
+ "version": "116.2.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",