carbon-react 144.1.1 → 144.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.
@@ -23,7 +23,7 @@ export interface BoxProps extends FlexboxProps, Omit<GridProps, "gridGap" | "gri
23
23
  scrollVariant?: ScrollVariant;
24
24
  /** Set the box-sizing attribute of the Box component */
25
25
  boxSizing?: BoxSizing;
26
- /** Allows a tabindex to be specified */
26
+ /** (Deprecated) Allows a tabindex to be specified */
27
27
  tabIndex?: number;
28
28
  /** Gap, an integer multiplier of the base spacing constant (8px) or any valid CSS string." */
29
29
  gap?: Gap;
@@ -4,6 +4,8 @@ import PropTypes from "prop-types";
4
4
  import { filterStyledSystemMarginProps, filterStyledSystemPaddingProps, filterStyledSystemLayoutProps, filterStyledSystemFlexboxProps, filterStyledSystemGridProps } from "../../style/utils";
5
5
  import StyledBox from "./box.style";
6
6
  import tagComponent from "../../__internal__/utils/helpers/tags";
7
+ import Logger from "../../__internal__/utils/logger";
8
+ let deprecatedTabIndex = false;
7
9
  const Box = /*#__PURE__*/React.forwardRef(({
8
10
  "data-component": dataComponent,
9
11
  as,
@@ -27,6 +29,10 @@ const Box = /*#__PURE__*/React.forwardRef(({
27
29
  "aria-hidden": ariaHidden,
28
30
  ...rest
29
31
  }, ref) => {
32
+ if (!deprecatedTabIndex && tabIndex !== undefined) {
33
+ deprecatedTabIndex = true;
34
+ Logger.deprecate("The `tabIndex` prop for `Box` component has been deprecated and will soon be removed.");
35
+ }
30
36
  return /*#__PURE__*/React.createElement(StyledBox, _extends({
31
37
  as: as,
32
38
  id: id,
@@ -23,7 +23,7 @@ export interface BoxProps extends FlexboxProps, Omit<GridProps, "gridGap" | "gri
23
23
  scrollVariant?: ScrollVariant;
24
24
  /** Set the box-sizing attribute of the Box component */
25
25
  boxSizing?: BoxSizing;
26
- /** Allows a tabindex to be specified */
26
+ /** (Deprecated) Allows a tabindex to be specified */
27
27
  tabIndex?: number;
28
28
  /** Gap, an integer multiplier of the base spacing constant (8px) or any valid CSS string." */
29
29
  gap?: Gap;
@@ -9,8 +9,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _utils = require("../../style/utils");
10
10
  var _box = _interopRequireDefault(require("./box.style"));
11
11
  var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags"));
12
+ var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
14
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
15
+ let deprecatedTabIndex = false;
14
16
  const Box = exports.Box = /*#__PURE__*/_react.default.forwardRef(({
15
17
  "data-component": dataComponent,
16
18
  as,
@@ -34,6 +36,10 @@ const Box = exports.Box = /*#__PURE__*/_react.default.forwardRef(({
34
36
  "aria-hidden": ariaHidden,
35
37
  ...rest
36
38
  }, ref) => {
39
+ if (!deprecatedTabIndex && tabIndex !== undefined) {
40
+ deprecatedTabIndex = true;
41
+ _logger.default.deprecate("The `tabIndex` prop for `Box` component has been deprecated and will soon be removed.");
42
+ }
37
43
  return /*#__PURE__*/_react.default.createElement(_box.default, _extends({
38
44
  as: as,
39
45
  id: id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "144.1.1",
3
+ "version": "144.2.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",
@@ -1 +0,0 @@
1
- export { default } from "./tags-specs";
@@ -1 +0,0 @@
1
- export { default } from "./tags-specs";
@@ -1,3 +0,0 @@
1
- import { ReactWrapper, ShallowWrapper } from "enzyme";
2
- declare const rootTagTest: (rootNode: ReactWrapper | ShallowWrapper, comp: string, elem?: string, role?: string) => void;
3
- export default rootTagTest;
@@ -1,6 +0,0 @@
1
- const rootTagTest = (rootNode, comp, elem, role) => {
2
- expect(rootNode.prop("data-component")).toEqual(comp);
3
- expect(rootNode.prop("data-element")).toEqual(elem);
4
- expect(rootNode.prop("data-role")).toEqual(role);
5
- };
6
- export default rootTagTest;
@@ -1 +0,0 @@
1
- export { default } from "./tags-specs";
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "default", {
7
- enumerable: true,
8
- get: function () {
9
- return _tagsSpecs.default;
10
- }
11
- });
12
- var _tagsSpecs = _interopRequireDefault(require("./tags-specs"));
13
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "module": "../../../../../../esm/__internal__/utils/helpers/tags/tags-specs/index.js",
4
- "main": "./index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,3 +0,0 @@
1
- import { ReactWrapper, ShallowWrapper } from "enzyme";
2
- declare const rootTagTest: (rootNode: ReactWrapper | ShallowWrapper, comp: string, elem?: string, role?: string) => void;
3
- export default rootTagTest;
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- const rootTagTest = (rootNode, comp, elem, role) => {
8
- expect(rootNode.prop("data-component")).toEqual(comp);
9
- expect(rootNode.prop("data-element")).toEqual(elem);
10
- expect(rootNode.prop("data-role")).toEqual(role);
11
- };
12
- var _default = exports.default = rootTagTest;