carbon-react 119.11.0 → 119.12.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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Carbon [![npm](https://img.shields.io/npm/v/carbon-react.svg)](https://www.npmjs.com/package/carbon-react) [![Cypress](https://github.com/Sage/carbon/actions/workflows/cypress.yml/badge.svg)](https://github.com/Sage/carbon/actions/workflows/cypress.yml)
1
+ # Carbon [![npm](https://img.shields.io/npm/v/carbon-react.svg)](https://www.npmjs.com/package/carbon-react) [![Cypress](https://github.com/Sage/carbon/actions/workflows/cypress.yml/badge.svg)](https://github.com/Sage/carbon/actions/workflows/cypress.yml) [![Playwright](https://github.com/Sage/carbon/actions/workflows/playwright.yml/badge.svg)](https://github.com/Sage/carbon/actions/workflows/playwright.yml)
2
2
 
3
3
  Carbon is a [React](https://facebook.github.io/react/) component library developed by Sage.
4
4
 
@@ -18,10 +18,10 @@ export interface PodProps extends MarginProps {
18
18
  size?: PodSize;
19
19
  /** Prop to apply a theme to the Pod */
20
20
  variant?: PodVariant;
21
- /** Title for the pod h4 element always shown */
22
- title?: string | React.ReactNode;
21
+ /** Title for the pod */
22
+ title?: React.ReactNode;
23
23
  /** Optional subtitle for the pod */
24
- subtitle?: string;
24
+ subtitle?: React.ReactNode;
25
25
  /** A component to render as a Pod footer */
26
26
  footer?: string | React.ReactNode;
27
27
  /** Supplies an edit action to the pod */
@@ -93,11 +93,11 @@ const Pod = /*#__PURE__*/React.forwardRef(({
93
93
  alignTitle: alignTitle,
94
94
  internalEditButton: internalEditButton,
95
95
  size: size
96
- }, /*#__PURE__*/React.createElement(StyledTitle, {
96
+ }, typeof title === "string" ? /*#__PURE__*/React.createElement(StyledTitle, {
97
97
  "data-element": "title"
98
- }, title), subtitle && /*#__PURE__*/React.createElement(StyledSubtitle, {
98
+ }, title) : title, typeof subtitle === "string" ? /*#__PURE__*/React.createElement(StyledSubtitle, {
99
99
  "data-element": "subtitle"
100
- }, subtitle)), children), footer && /*#__PURE__*/React.createElement(StyledFooter, {
100
+ }, subtitle) : subtitle), children), footer && /*#__PURE__*/React.createElement(StyledFooter, {
101
101
  "data-element": "footer",
102
102
  size: size,
103
103
  variant: variant,
@@ -324,7 +324,7 @@ Pod.propTypes = {
324
324
  "onUndo": PropTypes.func,
325
325
  "size": PropTypes.oneOf(["extra-large", "extra-small", "large", "medium", "small"]),
326
326
  "softDelete": PropTypes.bool,
327
- "subtitle": PropTypes.string,
327
+ "subtitle": PropTypes.node,
328
328
  "title": PropTypes.node,
329
329
  "triggerEditOnContent": PropTypes.bool,
330
330
  "variant": PropTypes.oneOf(["primary", "secondary", "tertiary", "tile", "transparent"])
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ColorProps, SpaceProps } from "styled-system";
3
3
  declare const VARIANT_TYPES: readonly ["h1-large", "h1", "h2", "h3", "h4", "h5", "segment-header", "segment-header-small", "segment-subheader", "segment-subheader-alt", "p", "small", "big", "sup", "sub", "strong", "b", "em", "ul", "ol"];
4
- declare type VariantTypes = typeof VARIANT_TYPES[number];
4
+ export declare type VariantTypes = typeof VARIANT_TYPES[number];
5
5
  export interface TypographyProps extends SpaceProps, ColorProps {
6
6
  /** Override the variant component */
7
7
  as?: React.ElementType;
@@ -18,10 +18,10 @@ export interface PodProps extends MarginProps {
18
18
  size?: PodSize;
19
19
  /** Prop to apply a theme to the Pod */
20
20
  variant?: PodVariant;
21
- /** Title for the pod h4 element always shown */
22
- title?: string | React.ReactNode;
21
+ /** Title for the pod */
22
+ title?: React.ReactNode;
23
23
  /** Optional subtitle for the pod */
24
- subtitle?: string;
24
+ subtitle?: React.ReactNode;
25
25
  /** A component to render as a Pod footer */
26
26
  footer?: string | React.ReactNode;
27
27
  /** Supplies an edit action to the pod */
@@ -102,11 +102,11 @@ const Pod = /*#__PURE__*/_react.default.forwardRef(({
102
102
  alignTitle: alignTitle,
103
103
  internalEditButton: internalEditButton,
104
104
  size: size
105
- }, /*#__PURE__*/_react.default.createElement(_pod.StyledTitle, {
105
+ }, typeof title === "string" ? /*#__PURE__*/_react.default.createElement(_pod.StyledTitle, {
106
106
  "data-element": "title"
107
- }, title), subtitle && /*#__PURE__*/_react.default.createElement(_pod.StyledSubtitle, {
107
+ }, title) : title, typeof subtitle === "string" ? /*#__PURE__*/_react.default.createElement(_pod.StyledSubtitle, {
108
108
  "data-element": "subtitle"
109
- }, subtitle)), children), footer && /*#__PURE__*/_react.default.createElement(_pod.StyledFooter, {
109
+ }, subtitle) : subtitle), children), footer && /*#__PURE__*/_react.default.createElement(_pod.StyledFooter, {
110
110
  "data-element": "footer",
111
111
  size: size,
112
112
  variant: variant,
@@ -333,7 +333,7 @@ Pod.propTypes = {
333
333
  "onUndo": _propTypes.default.func,
334
334
  "size": _propTypes.default.oneOf(["extra-large", "extra-small", "large", "medium", "small"]),
335
335
  "softDelete": _propTypes.default.bool,
336
- "subtitle": _propTypes.default.string,
336
+ "subtitle": _propTypes.default.node,
337
337
  "title": _propTypes.default.node,
338
338
  "triggerEditOnContent": _propTypes.default.bool,
339
339
  "variant": _propTypes.default.oneOf(["primary", "secondary", "tertiary", "tile", "transparent"])
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ColorProps, SpaceProps } from "styled-system";
3
3
  declare const VARIANT_TYPES: readonly ["h1-large", "h1", "h2", "h3", "h4", "h5", "segment-header", "segment-header-small", "segment-subheader", "segment-subheader-alt", "p", "small", "big", "sup", "sub", "strong", "b", "em", "ul", "ol"];
4
- declare type VariantTypes = typeof VARIANT_TYPES[number];
4
+ export declare type VariantTypes = typeof VARIANT_TYPES[number];
5
5
  export interface TypographyProps extends SpaceProps, ColorProps {
6
6
  /** Override the variant component */
7
7
  as?: React.ElementType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "119.11.0",
3
+ "version": "119.12.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",
@@ -93,8 +93,8 @@
93
93
  "@testing-library/react-hooks": "^8.0.1",
94
94
  "@testing-library/user-event": "^14.4.3",
95
95
  "@types/crypto-js": "^4.1.1",
96
- "@types/enzyme": "3.10.8",
97
96
  "@types/draft-js": "^0.11.10",
97
+ "@types/enzyme": "3.10.8",
98
98
  "@types/invariant": "^2.2.35",
99
99
  "@types/jest": "^27.5.0",
100
100
  "@types/lodash": "^4.14.194",
@@ -124,8 +124,10 @@
124
124
  "cypress": "^12.12.0",
125
125
  "cypress-axe": "^1.4.0",
126
126
  "cypress-each": "^1.13.3",
127
+ "cypress-mochawesome-reporter": "^3.5.1",
127
128
  "cypress-plugin-tab": "^1.0.5",
128
129
  "cypress-real-events": "^1.7.6",
130
+ "cypress-split": "^1.3.13",
129
131
  "cz-conventional-changelog": "^3.3.0",
130
132
  "date-fns-tz": "^1.3.8",
131
133
  "draft-js": "^0.11.7",