carbon-react 106.6.9 → 107.0.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.
Files changed (212) hide show
  1. package/esm/__internal__/focus-trap/focus-trap-utils.js +25 -1
  2. package/esm/__internal__/focus-trap/focus-trap.component.d.ts +3 -1
  3. package/esm/__internal__/focus-trap/focus-trap.component.js +44 -12
  4. package/esm/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.d.ts +0 -0
  5. package/esm/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.js +0 -0
  6. package/esm/components/advanced-color-picker/advanced-color-picker.component.js +5 -5
  7. package/esm/components/badge/badge.style.d.ts +1 -1
  8. package/esm/components/button/button.component.d.ts +1 -3
  9. package/esm/components/button/button.component.js +1 -12
  10. package/esm/components/button/button.style.d.ts +1 -1
  11. package/esm/components/button-toggle-group/button-toggle-group.component.js +1 -1
  12. package/esm/components/confirm/confirm.component.d.ts +1 -5
  13. package/esm/components/confirm/confirm.component.js +2 -14
  14. package/esm/components/confirm/confirm.d.ts +0 -2
  15. package/esm/components/date/__internal__/date-picker/date-picker.component.js +24 -11
  16. package/esm/components/date/__internal__/date-picker/date-picker.d.ts +2 -0
  17. package/esm/components/date/date.component.js +3 -2
  18. package/esm/components/dialog/dialog.component.js +4 -3
  19. package/esm/components/dialog-full-screen/content.style.js +4 -10
  20. package/esm/components/dialog-full-screen/dialog-full-screen.component.js +4 -3
  21. package/esm/components/heading/heading.component.d.ts +27 -52
  22. package/esm/components/heading/heading.component.js +86 -170
  23. package/esm/components/heading/heading.d.ts +5 -3
  24. package/esm/components/i18n-provider/i18n-provider.component.d.ts +0 -9
  25. package/esm/components/i18n-provider/i18n-provider.component.js +0 -9
  26. package/esm/components/menu/index.d.ts +0 -1
  27. package/esm/components/menu/index.js +0 -1
  28. package/esm/components/menu/menu-full-screen/menu-full-screen.component.js +4 -18
  29. package/esm/components/menu/menu-full-screen/menu-full-screen.style.js +1 -0
  30. package/esm/components/menu/menu-item/menu-item.component.js +0 -6
  31. package/esm/components/multi-action-button/multi-action-button.component.d.ts +1 -1
  32. package/esm/components/multi-action-button/multi-action-button.component.js +1 -11
  33. package/esm/components/navigation-bar/navigation-bar.component.d.ts +1 -6
  34. package/esm/components/navigation-bar/navigation-bar.component.js +1 -15
  35. package/esm/components/navigation-bar/navigation-bar.style.d.ts +0 -4
  36. package/esm/components/navigation-bar/navigation-bar.style.js +0 -8
  37. package/esm/components/radio-button/radio-button-group.component.js +1 -1
  38. package/esm/components/select/select-list/select-list.component.js +2 -2
  39. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +3 -1
  40. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +7 -2
  41. package/esm/components/sidebar/sidebar.component.js +10 -3
  42. package/esm/components/simple-color-picker/simple-color-picker.component.js +1 -1
  43. package/esm/components/split-button/split-button-toggle.style.d.ts +1 -1
  44. package/esm/components/split-button/split-button.component.d.ts +1 -4
  45. package/esm/components/split-button/split-button.component.js +3 -16
  46. package/esm/components/split-button/split-button.d.ts +0 -2
  47. package/esm/components/tile/tile.component.d.ts +1 -2
  48. package/esm/components/tile/tile.component.js +1 -13
  49. package/esm/components/tile/tile.d.ts +0 -2
  50. package/esm/components/tile-select/tile-select-group.component.js +1 -1
  51. package/esm/components/toast/toast.component.d.ts +1 -4
  52. package/esm/components/toast/toast.component.js +1 -13
  53. package/esm/components/toast/toast.d.ts +0 -2
  54. package/esm/locales/en-gb.js +0 -9
  55. package/esm/locales/locale.d.ts +0 -9
  56. package/esm/locales/pl-pl.js +0 -9
  57. package/lib/__internal__/focus-trap/focus-trap-utils.js +25 -1
  58. package/lib/__internal__/focus-trap/focus-trap.component.d.ts +3 -1
  59. package/lib/__internal__/focus-trap/focus-trap.component.js +46 -12
  60. package/lib/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.d.ts +0 -0
  61. package/lib/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.js +0 -0
  62. package/lib/components/advanced-color-picker/advanced-color-picker.component.js +5 -5
  63. package/lib/components/badge/badge.style.d.ts +1 -1
  64. package/lib/components/button/button.component.d.ts +1 -3
  65. package/lib/components/button/button.component.js +1 -14
  66. package/lib/components/button/button.style.d.ts +1 -1
  67. package/lib/components/button-toggle-group/button-toggle-group.component.js +1 -1
  68. package/lib/components/confirm/confirm.component.d.ts +1 -5
  69. package/lib/components/confirm/confirm.component.js +2 -17
  70. package/lib/components/confirm/confirm.d.ts +0 -2
  71. package/lib/components/date/__internal__/date-picker/date-picker.component.js +24 -11
  72. package/lib/components/date/__internal__/date-picker/date-picker.d.ts +2 -0
  73. package/lib/components/date/date.component.js +3 -2
  74. package/lib/components/dialog/dialog.component.js +4 -3
  75. package/lib/components/dialog-full-screen/content.style.js +4 -10
  76. package/lib/components/dialog-full-screen/dialog-full-screen.component.js +4 -3
  77. package/lib/components/heading/heading.component.d.ts +27 -52
  78. package/lib/components/heading/heading.component.js +86 -170
  79. package/lib/components/heading/heading.d.ts +5 -3
  80. package/lib/components/i18n-provider/i18n-provider.component.d.ts +0 -9
  81. package/lib/components/i18n-provider/i18n-provider.component.js +0 -9
  82. package/lib/components/menu/index.d.ts +0 -1
  83. package/lib/components/menu/index.js +0 -8
  84. package/lib/components/menu/menu-full-screen/menu-full-screen.component.js +3 -17
  85. package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +1 -0
  86. package/lib/components/menu/menu-item/menu-item.component.js +0 -7
  87. package/lib/components/multi-action-button/multi-action-button.component.d.ts +1 -1
  88. package/lib/components/multi-action-button/multi-action-button.component.js +1 -14
  89. package/lib/components/navigation-bar/navigation-bar.component.d.ts +1 -6
  90. package/lib/components/navigation-bar/navigation-bar.component.js +1 -18
  91. package/lib/components/navigation-bar/navigation-bar.style.d.ts +0 -4
  92. package/lib/components/navigation-bar/navigation-bar.style.js +0 -8
  93. package/lib/components/radio-button/radio-button-group.component.js +1 -1
  94. package/lib/components/select/select-list/select-list.component.js +2 -2
  95. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +3 -1
  96. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +7 -2
  97. package/lib/components/sidebar/sidebar.component.js +11 -3
  98. package/lib/components/simple-color-picker/simple-color-picker.component.js +1 -1
  99. package/lib/components/split-button/split-button-toggle.style.d.ts +1 -1
  100. package/lib/components/split-button/split-button.component.d.ts +1 -4
  101. package/lib/components/split-button/split-button.component.js +3 -18
  102. package/lib/components/split-button/split-button.d.ts +0 -2
  103. package/lib/components/tile/tile.component.d.ts +1 -2
  104. package/lib/components/tile/tile.component.js +1 -16
  105. package/lib/components/tile/tile.d.ts +0 -2
  106. package/lib/components/tile-select/tile-select-group.component.js +1 -1
  107. package/lib/components/toast/toast.component.d.ts +1 -4
  108. package/lib/components/toast/toast.component.js +1 -16
  109. package/lib/components/toast/toast.d.ts +0 -2
  110. package/lib/locales/en-gb.js +0 -9
  111. package/lib/locales/locale.d.ts +0 -9
  112. package/lib/locales/pl-pl.js +0 -9
  113. package/package.json +1 -1
  114. package/esm/components/app-wrapper/app-wrapper.component.d.ts +0 -25
  115. package/esm/components/app-wrapper/app-wrapper.component.js +0 -104
  116. package/esm/components/app-wrapper/app-wrapper.d.ts +0 -12
  117. package/esm/components/app-wrapper/app-wrapper.style.d.ts +0 -2
  118. package/esm/components/app-wrapper/app-wrapper.style.js +0 -17
  119. package/esm/components/app-wrapper/index.d.ts +0 -1
  120. package/esm/components/app-wrapper/index.js +0 -1
  121. package/esm/components/menu/submenu-block/index.d.ts +0 -2
  122. package/esm/components/menu/submenu-block/index.js +0 -1
  123. package/esm/components/menu/submenu-block/submenu-block.component.d.ts +0 -12
  124. package/esm/components/menu/submenu-block/submenu-block.component.js +0 -34
  125. package/esm/components/menu/submenu-block/submenu-block.d.ts +0 -12
  126. package/esm/components/menu/submenu-block/submenu-block.style.d.ts +0 -2
  127. package/esm/components/menu/submenu-block/submenu-block.style.js +0 -16
  128. package/esm/components/mount-in-app/__spec__.d.ts +0 -1
  129. package/esm/components/mount-in-app/__spec__.js +0 -47
  130. package/esm/components/mount-in-app/index.d.ts +0 -1
  131. package/esm/components/mount-in-app/mount-in-app.d.ts +0 -12
  132. package/esm/components/mount-in-app/mount-in-app.js +0 -90
  133. package/esm/components/mount-in-app/package.json +0 -3
  134. package/esm/components/multi-step-wizard/__spec__.d.ts +0 -1
  135. package/esm/components/multi-step-wizard/__spec__.js +0 -191
  136. package/esm/components/multi-step-wizard/multi-step-wizard.d.ts +0 -109
  137. package/esm/components/multi-step-wizard/multi-step-wizard.js +0 -383
  138. package/esm/components/multi-step-wizard/multi-step-wizard.style.d.ts +0 -2
  139. package/esm/components/multi-step-wizard/multi-step-wizard.style.js +0 -10
  140. package/esm/components/multi-step-wizard/package.json +0 -4
  141. package/esm/components/multi-step-wizard/step/__spec__.d.ts +0 -1
  142. package/esm/components/multi-step-wizard/step/__spec__.js +0 -399
  143. package/esm/components/multi-step-wizard/step/package.json +0 -4
  144. package/esm/components/multi-step-wizard/step/step.d.ts +0 -166
  145. package/esm/components/multi-step-wizard/step/step.js +0 -407
  146. package/esm/components/multi-step-wizard/step/step.style.d.ts +0 -13
  147. package/esm/components/multi-step-wizard/step/step.style.js +0 -138
  148. package/esm/components/scrollable-list/as-scrollable-list-item.wrapper.d.ts +0 -2
  149. package/esm/components/scrollable-list/as-scrollable-list-item.wrapper.js +0 -10
  150. package/esm/components/scrollable-list/index.d.ts +0 -4
  151. package/esm/components/scrollable-list/index.js +0 -4
  152. package/esm/components/scrollable-list/scrollable-list-item.component.d.ts +0 -2
  153. package/esm/components/scrollable-list/scrollable-list-item.component.js +0 -26
  154. package/esm/components/scrollable-list/scrollable-list.component.d.ts +0 -52
  155. package/esm/components/scrollable-list/scrollable-list.component.js +0 -306
  156. package/esm/components/scrollable-list/scrollable-list.context.d.ts +0 -3
  157. package/esm/components/scrollable-list/scrollable-list.context.js +0 -2
  158. package/esm/components/scrollable-list/scrollable-list.style.d.ts +0 -2
  159. package/esm/components/scrollable-list/scrollable-list.style.js +0 -30
  160. package/esm/components/scrollable-list/test-utils.d.ts +0 -2
  161. package/esm/components/scrollable-list/test-utils.js +0 -25
  162. package/lib/components/app-wrapper/app-wrapper.component.d.ts +0 -25
  163. package/lib/components/app-wrapper/app-wrapper.component.js +0 -120
  164. package/lib/components/app-wrapper/app-wrapper.d.ts +0 -12
  165. package/lib/components/app-wrapper/app-wrapper.style.d.ts +0 -2
  166. package/lib/components/app-wrapper/app-wrapper.style.js +0 -28
  167. package/lib/components/app-wrapper/index.d.ts +0 -1
  168. package/lib/components/app-wrapper/index.js +0 -15
  169. package/lib/components/app-wrapper/package.json +0 -6
  170. package/lib/components/menu/submenu-block/index.d.ts +0 -2
  171. package/lib/components/menu/submenu-block/index.js +0 -15
  172. package/lib/components/menu/submenu-block/package.json +0 -6
  173. package/lib/components/menu/submenu-block/submenu-block.component.d.ts +0 -12
  174. package/lib/components/menu/submenu-block/submenu-block.component.js +0 -53
  175. package/lib/components/menu/submenu-block/submenu-block.d.ts +0 -12
  176. package/lib/components/menu/submenu-block/submenu-block.style.d.ts +0 -2
  177. package/lib/components/menu/submenu-block/submenu-block.style.js +0 -33
  178. package/lib/components/mount-in-app/__spec__.d.ts +0 -1
  179. package/lib/components/mount-in-app/__spec__.js +0 -55
  180. package/lib/components/mount-in-app/index.d.ts +0 -1
  181. package/lib/components/mount-in-app/mount-in-app.d.ts +0 -12
  182. package/lib/components/mount-in-app/mount-in-app.js +0 -105
  183. package/lib/components/mount-in-app/package.json +0 -3
  184. package/lib/components/multi-step-wizard/__spec__.d.ts +0 -1
  185. package/lib/components/multi-step-wizard/__spec__.js +0 -202
  186. package/lib/components/multi-step-wizard/multi-step-wizard.d.ts +0 -109
  187. package/lib/components/multi-step-wizard/multi-step-wizard.js +0 -397
  188. package/lib/components/multi-step-wizard/multi-step-wizard.style.d.ts +0 -2
  189. package/lib/components/multi-step-wizard/multi-step-wizard.style.js +0 -21
  190. package/lib/components/multi-step-wizard/package.json +0 -4
  191. package/lib/components/multi-step-wizard/step/__spec__.d.ts +0 -1
  192. package/lib/components/multi-step-wizard/step/__spec__.js +0 -409
  193. package/lib/components/multi-step-wizard/step/package.json +0 -4
  194. package/lib/components/multi-step-wizard/step/step.d.ts +0 -166
  195. package/lib/components/multi-step-wizard/step/step.js +0 -421
  196. package/lib/components/multi-step-wizard/step/step.style.d.ts +0 -13
  197. package/lib/components/multi-step-wizard/step/step.style.js +0 -162
  198. package/lib/components/scrollable-list/as-scrollable-list-item.wrapper.d.ts +0 -2
  199. package/lib/components/scrollable-list/as-scrollable-list-item.wrapper.js +0 -21
  200. package/lib/components/scrollable-list/index.d.ts +0 -4
  201. package/lib/components/scrollable-list/index.js +0 -31
  202. package/lib/components/scrollable-list/package.json +0 -6
  203. package/lib/components/scrollable-list/scrollable-list-item.component.d.ts +0 -2
  204. package/lib/components/scrollable-list/scrollable-list-item.component.js +0 -42
  205. package/lib/components/scrollable-list/scrollable-list.component.d.ts +0 -52
  206. package/lib/components/scrollable-list/scrollable-list.component.js +0 -328
  207. package/lib/components/scrollable-list/scrollable-list.context.d.ts +0 -3
  208. package/lib/components/scrollable-list/scrollable-list.context.js +0 -14
  209. package/lib/components/scrollable-list/scrollable-list.style.d.ts +0 -2
  210. package/lib/components/scrollable-list/scrollable-list.style.js +0 -41
  211. package/lib/components/scrollable-list/test-utils.d.ts +0 -2
  212. package/lib/components/scrollable-list/test-utils.js +0 -37
@@ -1,13 +1,15 @@
1
1
  export default SidebarHeader;
2
- declare function SidebarHeader({ className, children, ...props }: {
2
+ declare function SidebarHeader({ className, children, id, ...props }: {
3
3
  [x: string]: any;
4
4
  className: any;
5
5
  children: any;
6
+ id: any;
6
7
  }): JSX.Element;
7
8
  declare namespace SidebarHeader {
8
9
  namespace propTypes {
9
10
  const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
10
11
  const className: PropTypes.Requireable<string>;
12
+ const id: PropTypes.Requireable<string>;
11
13
  }
12
14
  }
13
15
  import PropTypes from "prop-types";
@@ -20,9 +20,11 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
20
20
  const SidebarHeader = ({
21
21
  className,
22
22
  children,
23
+ id,
23
24
  ...props
24
25
  }) => /*#__PURE__*/_react.default.createElement(_sidebarHeader.default, _extends({
25
- className: className
26
+ className: className,
27
+ id: id
26
28
  }, (0, _tags.default)("sidebar-header", props)), children);
27
29
 
28
30
  SidebarHeader.propTypes = {
@@ -30,7 +32,10 @@ SidebarHeader.propTypes = {
30
32
  children: _propTypes.default.node,
31
33
 
32
34
  /** A custom class name. */
33
- className: _propTypes.default.string
35
+ className: _propTypes.default.string,
36
+
37
+ /** A custom id. */
38
+ id: _propTypes.default.string
34
39
  };
35
40
  var _default = SidebarHeader;
36
41
  exports.default = _default;
@@ -25,6 +25,8 @@ var _box = _interopRequireDefault(require("../box"));
25
25
 
26
26
  var _sidebar2 = require("./sidebar.config");
27
27
 
28
+ var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid"));
29
+
28
30
  var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
29
31
 
30
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -55,6 +57,9 @@ const Sidebar = /*#__PURE__*/_react.default.forwardRef(({
55
57
  ...rest
56
58
  }, ref) => {
57
59
  const locale = (0, _useLocale.default)();
60
+ const {
61
+ current: titleId
62
+ } = (0, _react.useRef)((0, _guid.default)());
58
63
  let sidebarRef = (0, _react.useRef)();
59
64
  if (ref) sidebarRef = ref;
60
65
 
@@ -79,14 +84,16 @@ const Sidebar = /*#__PURE__*/_react.default.forwardRef(({
79
84
  "aria-modal": !enableBackgroundUI,
80
85
  "aria-describedby": ariaDescribedBy,
81
86
  "aria-label": ariaLabel,
82
- "aria-labelledby": ariaLabelledBy,
87
+ "aria-labelledby": !ariaLabelledBy && !ariaLabel ? titleId : ariaLabelledBy,
83
88
  ref: sidebarRef,
84
89
  position: position,
85
90
  size: size,
86
91
  "data-element": "sidebar",
87
92
  onCancel: onCancel,
88
93
  role: role
89
- }, closeIcon(), header && /*#__PURE__*/_react.default.createElement(_sidebarHeader.default, null, header), /*#__PURE__*/_react.default.createElement(_box.default, {
94
+ }, header && /*#__PURE__*/_react.default.createElement(_sidebarHeader.default, {
95
+ id: titleId
96
+ }, header), closeIcon(), /*#__PURE__*/_react.default.createElement(_box.default, {
90
97
  "data-element": "sidebar-content",
91
98
  p: 4,
92
99
  pt: "27px",
@@ -106,7 +113,8 @@ const Sidebar = /*#__PURE__*/_react.default.forwardRef(({
106
113
  enableBackgroundUI: enableBackgroundUI,
107
114
  className: "carbon-sidebar"
108
115
  }, componentTags), enableBackgroundUI ? sidebar : /*#__PURE__*/_react.default.createElement(_focusTrap.default, {
109
- wrapperRef: sidebarRef
116
+ wrapperRef: sidebarRef,
117
+ isOpen: open
110
118
  }, sidebar));
111
119
  });
112
120
 
@@ -19,7 +19,7 @@ var _fieldset = _interopRequireDefault(require("../../__internal__/fieldset"));
19
19
 
20
20
  var _simpleColor = _interopRequireDefault(require("./simple-color"));
21
21
 
22
- var _radioButtonMapper = _interopRequireDefault(require("../radio-button/radio-button-mapper.component"));
22
+ var _radioButtonMapper = _interopRequireDefault(require("../../__internal__/radio-button-mapper/radio-button-mapper.component"));
23
23
 
24
24
  var _simpleColorPicker = require("./simple-color-picker.style");
25
25
 
@@ -1,4 +1,4 @@
1
1
  export default StyledSplitButtonToggle;
2
- declare const StyledSplitButtonToggle: import("styled-components").StyledComponent<"button", any, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & Omit<import("../button").ButtonProps, "as"> & {
2
+ declare const StyledSplitButtonToggle: import("styled-components").StyledComponent<"button", any, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("../button").ButtonProps & {
3
3
  iconOnly?: boolean | undefined;
4
4
  }, never>;
@@ -1,8 +1,7 @@
1
1
  export default SplitButton;
2
- declare function SplitButton({ align, as, buttonType, children, disabled, iconPosition, iconType, onClick, size, subtext, text, "data-element": dataElement, "data-role": dataRole, ...rest }: {
2
+ declare function SplitButton({ align, buttonType, children, disabled, iconPosition, iconType, onClick, size, subtext, text, "data-element": dataElement, "data-role": dataRole, ...rest }: {
3
3
  [x: string]: any;
4
4
  align?: string | undefined;
5
- as: any;
6
5
  buttonType?: string | undefined;
7
6
  children: any;
8
7
  disabled?: boolean | undefined;
@@ -19,8 +18,6 @@ declare namespace SplitButton {
19
18
  const propTypes: {
20
19
  /** Button type: "primary" | "secondary" */
21
20
  buttonType: PropTypes.Requireable<string>;
22
- /** Button type: "primary" | "secondary" for legacy theme */
23
- as: PropTypes.Requireable<string>;
24
21
  /** The additional button to display. */
25
22
  children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
26
23
  /** A custom value for the data-element attribute */
@@ -35,8 +35,6 @@ var _themes = require("../../style/themes");
35
35
 
36
36
  var _focusTrapUtils = require("../../__internal__/focus-trap/focus-trap-utils");
37
37
 
38
- var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
39
-
40
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
39
 
42
40
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -47,11 +45,9 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
47
45
 
48
46
  const marginPropTypes = (0, _utils.filterStyledSystemMarginProps)(_propTypes2.default.space);
49
47
  const CONTENT_WIDTH_RATIO = 0.75;
50
- let deprecatedWarnTriggered = false;
51
48
 
52
49
  const SplitButton = ({
53
50
  align = "left",
54
- as,
55
51
  buttonType = "secondary",
56
52
  children,
57
53
  disabled = false,
@@ -65,13 +61,6 @@ const SplitButton = ({
65
61
  "data-role": dataRole,
66
62
  ...rest
67
63
  }) => {
68
- if (!deprecatedWarnTriggered && as) {
69
- deprecatedWarnTriggered = true;
70
-
71
- _logger.default.deprecate( // eslint-disable-next-line max-len
72
- "The `as` prop is deprecated and will soon be removed from the `SplitButton` component interface. You should use the `buttonType` prop to achieve the same styling. The following codemod is available to help with updating your code https://github.com/Sage/carbon-codemod/tree/master/transforms/rename-prop");
73
- }
74
-
75
64
  const theme = (0, _react.useContext)(_styledComponents.ThemeContext) || _themes.baseTheme;
76
65
 
77
66
  const isToggleButtonFocused = (0, _react.useRef)(false);
@@ -159,7 +148,6 @@ const SplitButton = ({
159
148
  onFocus: hideButtons,
160
149
  onTouchStart: hideButtons,
161
150
  iconPosition,
162
- as,
163
151
  buttonType,
164
152
  disabled,
165
153
  iconType,
@@ -180,7 +168,7 @@ const SplitButton = ({
180
168
  isToggleButtonFocused.current = false;
181
169
  },
182
170
  onKeyDown: handleToggleButtonKeyDown,
183
- buttonType: as || buttonType,
171
+ buttonType,
184
172
  size
185
173
  };
186
174
 
@@ -204,7 +192,7 @@ const SplitButton = ({
204
192
  primary: theme.colors.white,
205
193
  secondary: theme.colors.primary
206
194
  };
207
- return colorsMap[as || buttonType];
195
+ return colorsMap[buttonType];
208
196
  }
209
197
 
210
198
  function renderMainButton() {
@@ -315,9 +303,6 @@ SplitButton.propTypes = { ...marginPropTypes,
315
303
  /** Button type: "primary" | "secondary" */
316
304
  buttonType: _propTypes.default.oneOf(["primary", "secondary"]),
317
305
 
318
- /** Button type: "primary" | "secondary" for legacy theme */
319
- as: _propTypes.default.oneOf(["primary", "secondary"]),
320
-
321
306
  /** The additional button to display. */
322
307
  children: _propTypes.default.node.isRequired,
323
308
 
@@ -342,6 +327,6 @@ SplitButton.propTypes = { ...marginPropTypes,
342
327
  /** Set align of the rendered content */
343
328
  align: _propTypes.default.oneOf(["left", "right"])
344
329
  };
345
- SplitButton.safeProps = ["buttonType", "as", "disabled", "size"];
330
+ SplitButton.safeProps = ["buttonType", "disabled", "size"];
346
331
  var _default = SplitButton;
347
332
  exports.default = _default;
@@ -6,8 +6,6 @@ export interface SplitButtonProps
6
6
  MarginProps {
7
7
  /** Set align of the rendered content */
8
8
  align?: "left" | "right";
9
- /** Button type: "primary" | "secondary" for legacy theme */
10
- as?: "primary" | "secondary";
11
9
  /** Button type: "primary" | "secondary" */
12
10
  buttonType?: "primary" | "secondary";
13
11
  /** The additional button to display. */
@@ -1,7 +1,6 @@
1
1
  export default Tile;
2
- declare function Tile({ as, variant, p, children, orientation, width, ...props }: {
2
+ declare function Tile({ variant, p, children, orientation, width, ...props }: {
3
3
  [x: string]: any;
4
- as: any;
5
4
  variant?: string | undefined;
6
5
  p?: number | undefined;
7
6
  children: any;
@@ -13,16 +13,11 @@ var _propTypes2 = _interopRequireDefault(require("@styled-system/prop-types"));
13
13
 
14
14
  var _tileStyle = require("./tile.style.js");
15
15
 
16
- var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
17
-
18
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
17
 
20
18
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
19
 
22
- let deprecatedWarnTriggered = false;
23
-
24
20
  const Tile = ({
25
- as,
26
21
  variant = "tile",
27
22
  p = 3,
28
23
  children,
@@ -30,13 +25,6 @@ const Tile = ({
30
25
  width,
31
26
  ...props
32
27
  }) => {
33
- if (!deprecatedWarnTriggered && as) {
34
- deprecatedWarnTriggered = true;
35
-
36
- _logger.default.deprecate( // eslint-disable-next-line max-len
37
- "The `as` prop is deprecated and will soon be removed from the `Tile` component interface. You should use the `variant` prop to achieve the same styling. The following codemod is available to help with updating your code https://github.com/Sage/carbon-codemod/tree/master/transforms/rename-prop");
38
- }
39
-
40
28
  const isHorizontal = () => orientation === "horizontal";
41
29
 
42
30
  const isVertical = () => orientation === "vertical";
@@ -66,7 +54,7 @@ const Tile = ({
66
54
  });
67
55
 
68
56
  return /*#__PURE__*/_react.default.createElement(_tileStyle.StyledTile, _extends({
69
- tileTheme: as || variant,
57
+ tileTheme: variant,
70
58
  width: width,
71
59
  "data-component": "tile",
72
60
  isHorizontal: isHorizontal(orientation),
@@ -78,9 +66,6 @@ Tile.propTypes = {
78
66
  /** Styled system spacing props */
79
67
  ..._propTypes2.default.space,
80
68
 
81
- /** Sets the theme of the tile - either 'tile' or 'transparent' */
82
- as: _propTypes.default.oneOf(["tile", "transparent"]),
83
-
84
69
  /** Sets the theme of the tile - either 'tile' or 'transparent' */
85
70
  variant: _propTypes.default.oneOf(["tile", "transparent"]),
86
71
 
@@ -2,8 +2,6 @@ import * as React from "react";
2
2
  import { SpaceProps } from "styled-system";
3
3
 
4
4
  export interface TileProps extends SpaceProps {
5
- /** Sets the theme of the tile - either 'tile' or 'transparent' */
6
- as?: "tile" | "transparent";
7
5
  /** Sets the theme of the tile - either 'tile' or 'transparent' */
8
6
  variant?: "tile" | "transparent";
9
7
  /**
@@ -15,7 +15,7 @@ var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tag
15
15
 
16
16
  var _tileSelect = _interopRequireDefault(require("./tile-select.component"));
17
17
 
18
- var _radioButtonMapper = _interopRequireDefault(require("../radio-button/radio-button-mapper.component"));
18
+ var _radioButtonMapper = _interopRequireDefault(require("../../__internal__/radio-button-mapper/radio-button-mapper.component"));
19
19
 
20
20
  var _tileSelect2 = require("./tile-select.style");
21
21
 
@@ -1,7 +1,6 @@
1
1
  export default Toast;
2
- declare function Toast({ as, children, className, id, isCenter, maxWidth, onDismiss, open, targetPortalId, timeout, variant, ...restProps }: {
2
+ declare function Toast({ children, className, id, isCenter, maxWidth, onDismiss, open, targetPortalId, timeout, variant, ...restProps }: {
3
3
  [x: string]: any;
4
- as: any;
5
4
  children: any;
6
5
  className: any;
7
6
  id: any;
@@ -17,8 +16,6 @@ declare namespace Toast {
17
16
  const propTypes: {
18
17
  /** Customizes the appearance in the DLS theme */
19
18
  variant: PropTypes.Requireable<string>;
20
- /** Customizes the appearance in a legacy theme through colour (see the 'iconColorSets' for possible values) */
21
- as: PropTypes.Requireable<string>;
22
19
  /** Custom className */
23
20
  className: PropTypes.Requireable<string>;
24
21
  /** Custom id */
@@ -27,8 +27,6 @@ var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLoc
27
27
 
28
28
  var _useModalManager = _interopRequireDefault(require("../../hooks/__internal__/useModalManager"));
29
29
 
30
- var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
31
-
32
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
31
 
34
32
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -37,10 +35,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
37
35
 
38
36
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
39
37
 
40
- let deprecatedWarnTriggered = false;
41
-
42
38
  const Toast = ({
43
- as,
44
39
  children,
45
40
  className,
46
41
  id,
@@ -53,13 +48,6 @@ const Toast = ({
53
48
  variant,
54
49
  ...restProps
55
50
  }) => {
56
- if (!deprecatedWarnTriggered && as) {
57
- deprecatedWarnTriggered = true;
58
-
59
- _logger.default.deprecate( // eslint-disable-next-line max-len
60
- "The `as` prop is deprecated and will soon be removed from the `Toast` component interface. You should use the `variant` prop to achieve the same styling. The following codemod is available to help with updating your code https://github.com/Sage/carbon-codemod/tree/master/transforms/rename-prop");
61
- }
62
-
63
51
  const locale = (0, _useLocale.default)();
64
52
  const toastRef = (0, _react.useRef)();
65
53
  const timer = (0, _react.useRef)();
@@ -99,7 +87,7 @@ const Toast = ({
99
87
  if (!open) return null;
100
88
  const toastProps = {
101
89
  isCenter,
102
- variant: variant || as || "success",
90
+ variant: variant || "success",
103
91
  id,
104
92
  maxWidth
105
93
  };
@@ -139,9 +127,6 @@ Toast.propTypes = {
139
127
  /** Customizes the appearance in the DLS theme */
140
128
  variant: _propTypes.default.oneOf(["error", "info", "success", "warning"]),
141
129
 
142
- /** Customizes the appearance in a legacy theme through colour (see the 'iconColorSets' for possible values) */
143
- as: _propTypes.default.oneOf(["error", "info", "success", "warning"]),
144
-
145
130
  /** Custom className */
146
131
  className: _propTypes.default.string,
147
132
 
@@ -7,8 +7,6 @@ export interface ToastPropTypes {
7
7
  children: React.ReactNode;
8
8
  /** Customizes the appearance in the DLS theme */
9
9
  variant?: ToastVariants;
10
- /** Customizes the appearance in a legacy theme through colour (see the 'iconColorSets' for possible values) */
11
- as?: ToastVariants;
12
10
  /** Custom className */
13
11
  className?: string;
14
12
  /** Custom id */
@@ -125,15 +125,6 @@ const enGB = {
125
125
  ariaLabels: {
126
126
  close: () => "Close"
127
127
  }
128
- },
129
- wizards: {
130
- multiStep: {
131
- buttons: {
132
- submit: () => "Submit",
133
- next: () => "Next",
134
- back: () => "Back"
135
- }
136
- }
137
128
  }
138
129
  };
139
130
  var _default = enGB;
@@ -92,14 +92,5 @@ interface Locale {
92
92
  close: () => string;
93
93
  };
94
94
  };
95
- wizards: {
96
- multiStep: {
97
- buttons: {
98
- submit: () => string;
99
- next: () => string;
100
- back: () => string;
101
- };
102
- };
103
- };
104
95
  }
105
96
  export default Locale;
@@ -123,15 +123,6 @@ const plPL = {
123
123
  ariaLabels: {
124
124
  close: () => "Zamknij"
125
125
  }
126
- },
127
- wizards: {
128
- multiStep: {
129
- buttons: {
130
- submit: () => "Wyślij",
131
- next: () => "Następny",
132
- back: () => "Wstecz"
133
- }
134
- }
135
126
  }
136
127
  };
137
128
  var _default = plPL;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "106.6.9",
3
+ "version": "107.0.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {
@@ -1,25 +0,0 @@
1
- export default AppWrapper;
2
- /**
3
- * Manages the width and containment of your application.
4
- */
5
- declare class AppWrapper extends React.Component<any, any, any> {
6
- constructor(...args: any[]);
7
- /**
8
- * Returns the classes for the component.
9
- *
10
- * @method classes
11
- * @return {String}
12
- */
13
- classes(): string;
14
- /**
15
- * @method render
16
- */
17
- render(): JSX.Element;
18
- }
19
- declare namespace AppWrapper {
20
- namespace propTypes {
21
- const children: Node;
22
- const className: string;
23
- }
24
- }
25
- import React from "react";
@@ -1,104 +0,0 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
-
5
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
-
7
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
8
-
9
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
-
11
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
-
13
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
-
15
- function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
16
-
17
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
-
19
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
-
21
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22
-
23
- import React from "react";
24
- import PropTypes from "prop-types";
25
- import classNames from "classnames";
26
- import tagComponent from "../../__internal__/utils/helpers/tags/tags";
27
- import StyledAppWrapper from "./app-wrapper.style";
28
- import Logger from "../../__internal__/utils/logger";
29
- let deprecatedWarnTriggered = false;
30
- /**
31
- * Manages the width and containment of your application.
32
- */
33
-
34
- let AppWrapper = /*#__PURE__*/function (_React$Component) {
35
- _inherits(AppWrapper, _React$Component);
36
-
37
- var _super = _createSuper(AppWrapper);
38
-
39
- function AppWrapper(...args) {
40
- var _this;
41
-
42
- _classCallCheck(this, AppWrapper);
43
-
44
- _this = _super.call(this, ...args);
45
- _this.classes = _this.classes.bind(_assertThisInitialized(_this));
46
-
47
- if (!deprecatedWarnTriggered) {
48
- deprecatedWarnTriggered = true; // eslint-disable-next-line max-len
49
-
50
- Logger.deprecate("`AppWrapper` component is now deprecated and will soon be removed. Please use the `Box` component instead.");
51
- }
52
-
53
- return _this;
54
- }
55
- /**
56
- * Returns the classes for the component.
57
- *
58
- * @method classes
59
- * @return {String}
60
- */
61
-
62
-
63
- _createClass(AppWrapper, [{
64
- key: "classes",
65
- value: function classes() {
66
- return classNames("carbon-app-wrapper", this.props.className);
67
- }
68
- /**
69
- * @method render
70
- */
71
-
72
- }, {
73
- key: "render",
74
- value: function render() {
75
- const {
76
- children
77
- } = this.props;
78
- return /*#__PURE__*/React.createElement(StyledAppWrapper, _extends({}, this.props, {
79
- className: this.classes()
80
- }, tagComponent("app-wrapper", this.props)), children);
81
- }
82
- }]);
83
-
84
- return AppWrapper;
85
- }(React.Component);
86
-
87
- AppWrapper.propTypes = {
88
- /**
89
- * Children elements
90
- *
91
- * @property children
92
- * @type {Node}
93
- */
94
- children: PropTypes.node,
95
-
96
- /**
97
- * Custom className
98
- *
99
- * @property className
100
- * @type {String}
101
- */
102
- className: PropTypes.string
103
- };
104
- export default AppWrapper;
@@ -1,12 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface AppWrapperProps {
4
- /** Children elements */
5
- children?: React.ReactNode;
6
- /** Custom className */
7
- className?: string;
8
- }
9
-
10
- declare class AppWrapper extends React.Component<AppWrapperProps> {}
11
-
12
- export default AppWrapper;
@@ -1,2 +0,0 @@
1
- export default StyledAppWrapper;
2
- declare const StyledAppWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,17 +0,0 @@
1
- import styled from "styled-components";
2
- const StyledAppWrapper = styled.div`
3
- box-sizing: border-box;
4
- max-width: 1600px;
5
- min-width: 958px;
6
- margin: 0 auto;
7
- padding: 0 40px;
8
-
9
- @media only screen and (max-width: 1366px) {
10
- padding: 0 30px;
11
- }
12
-
13
- @media only screen and (max-width: 1024px) {
14
- padding: 0 25px;
15
- }
16
- `;
17
- export default StyledAppWrapper;
@@ -1 +0,0 @@
1
- export { default } from "./app-wrapper";
@@ -1 +0,0 @@
1
- export { default } from "./app-wrapper.component";
@@ -1,2 +0,0 @@
1
- export { default } from "./submenu-block";
2
- export * from "./submenu-block";
@@ -1 +0,0 @@
1
- export { default } from "./submenu-block.component";
@@ -1,12 +0,0 @@
1
- export default SubmenuBlock;
2
- declare function SubmenuBlock({ children, variant }: {
3
- children: any;
4
- variant?: string | undefined;
5
- }): JSX.Element;
6
- declare namespace SubmenuBlock {
7
- namespace propTypes {
8
- const children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
9
- const variant: PropTypes.Requireable<string>;
10
- }
11
- }
12
- import PropTypes from "prop-types";