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
@@ -3,34 +3,22 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
3
3
  import React from "react";
4
4
  import PropTypes from "prop-types";
5
5
  import StyledNavigationBar from "./navigation-bar.style";
6
- import Logger from "../../__internal__/utils/logger";
7
- let deprecatedWarnTriggered = false;
8
6
 
9
7
  const NavigationBar = ({
10
8
  navigationType = "light",
11
9
  isLoading = false,
12
10
  children,
13
11
  ariaLabel,
14
- stickyOffset = "0",
15
- stickyPosition,
16
12
  position,
17
13
  offset = "0",
18
14
  orientation,
19
15
  ...props
20
16
  }) => {
21
- if (!deprecatedWarnTriggered && stickyPosition) {
22
- deprecatedWarnTriggered = true;
23
- Logger.deprecate( // eslint-disable-next-line max-len
24
- "The `stickyPosition` and `stickyOffset` props are deprecated and will soon be removed. You should use the `position`, `offset` and `orientation` props to achieve the same layout. The following codemods are available to help with updating your code: https://github.com/Sage/carbon-codemod/tree/master/transforms/remove-prop and https://github.com/Sage/carbon-codemod/tree/master/transforms/add-prop");
25
- }
26
-
27
17
  return /*#__PURE__*/React.createElement(StyledNavigationBar, _extends({
28
18
  role: "navigation",
29
19
  "aria-label": ariaLabel,
30
20
  navigationType: navigationType,
31
21
  "data-component": "navigation-bar",
32
- stickyOffset: stickyOffset,
33
- stickyPosition: stickyPosition,
34
22
  position: position,
35
23
  offset: offset,
36
24
  orientation: orientation
@@ -1037,9 +1025,7 @@ NavigationBar.propTypes = {
1037
1025
  "description": PropTypes.string,
1038
1026
  "toString": PropTypes.func.isRequired,
1039
1027
  "valueOf": PropTypes.func.isRequired
1040
- }), PropTypes.string]),
1041
- "stickyOffset": PropTypes.string,
1042
- "stickyPosition": PropTypes.oneOf(["bottom", "top"])
1028
+ }), PropTypes.string])
1043
1029
  };
1044
1030
  export { NavigationBar };
1045
1031
  export default NavigationBar;
@@ -3,10 +3,6 @@ import { Position, Orientation, NavigationType } from "./navigation-bar.componen
3
3
  declare const StyledNavigationBar: import("styled-components").StyledComponent<"nav", any, PaddingProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
4
4
  /** Color scheme of navigation component */
5
5
  navigationType?: NavigationType | undefined;
6
- /** Defines the position of sticky navigation bar */
7
- stickyPosition?: Orientation | undefined;
8
- /** Defines the offset of sticky navigation bar */
9
- stickyOffset?: string | undefined;
10
6
  /** Defines whether the navigation bar should be positioned fixed or sticky */
11
7
  position?: Position | undefined;
12
8
  /** Defines the offset of navigation bar */
@@ -35,14 +35,6 @@ const StyledNavigationBar = styled.nav`
35
35
  margin-right: 10px;
36
36
  }
37
37
 
38
- ${({
39
- stickyPosition,
40
- stickyOffset
41
- }) => stickyPosition && css`
42
- position: sticky;
43
- ${stickyPosition}: ${stickyOffset};
44
- `}
45
-
46
38
  ${({
47
39
  position,
48
40
  orientation,
@@ -6,7 +6,7 @@ import styledSystemPropTypes from "@styled-system/prop-types";
6
6
  import tagComponent from "../../__internal__/utils/helpers/tags/tags";
7
7
  import Fieldset from "../../__internal__/fieldset";
8
8
  import RadioButtonGroupStyle from "./radio-button-group.style";
9
- import RadioButtonMapper from "./radio-button-mapper.component";
9
+ import RadioButtonMapper from "../../__internal__/radio-button-mapper/radio-button-mapper.component";
10
10
  import useIsAboveBreakpoint from "../../hooks/__internal__/useIsAboveBreakpoint";
11
11
  import { filterStyledSystemMarginProps } from "../../style/utils";
12
12
  import { TooltipProvider } from "../../__internal__/tooltip-provider";
@@ -228,7 +228,7 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
228
228
  }
229
229
 
230
230
  setListHeight(`${newHeight}px`);
231
- }, [children, listRef.current]);
231
+ }, [children]);
232
232
  useEffect(() => {
233
233
  const keyboardEvent = "keydown";
234
234
  const listElement = listRef.current;
@@ -334,7 +334,7 @@ SelectList.propTypes = {
334
334
  /** The Id of the label */
335
335
  labelId: PropTypes.string,
336
336
 
337
- /** Child components (such as <Option>) for the <ScrollableList> */
337
+ /** Child components (such as <Option>) */
338
338
  children: PropTypes.node,
339
339
 
340
340
  /** Boolean to toggle where DatePicker is rendered in relation to the Date Input */
@@ -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";
@@ -8,9 +8,11 @@ import SidebarHeaderStyle from "./sidebar-header.style";
8
8
  const SidebarHeader = ({
9
9
  className,
10
10
  children,
11
+ id,
11
12
  ...props
12
13
  }) => /*#__PURE__*/React.createElement(SidebarHeaderStyle, _extends({
13
- className: className
14
+ className: className,
15
+ id: id
14
16
  }, tagComponent("sidebar-header", props)), children);
15
17
 
16
18
  SidebarHeader.propTypes = {
@@ -18,6 +20,9 @@ SidebarHeader.propTypes = {
18
20
  children: PropTypes.node,
19
21
 
20
22
  /** A custom class name. */
21
- className: PropTypes.string
23
+ className: PropTypes.string,
24
+
25
+ /** A custom id. */
26
+ id: PropTypes.string
22
27
  };
23
28
  export default SidebarHeader;
@@ -10,6 +10,7 @@ import FocusTrap from "../../__internal__/focus-trap";
10
10
  import SidebarHeader from "./__internal__/sidebar-header";
11
11
  import Box from "../box";
12
12
  import { SIDEBAR_SIZES, SIDEBAR_ALIGNMENTS } from "./sidebar.config";
13
+ import createGuid from "../../__internal__/utils/helpers/guid";
13
14
  import useLocale from "../../hooks/__internal__/useLocale";
14
15
  export const SidebarContext = /*#__PURE__*/React.createContext({});
15
16
  const Sidebar = /*#__PURE__*/React.forwardRef(({
@@ -28,6 +29,9 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
28
29
  ...rest
29
30
  }, ref) => {
30
31
  const locale = useLocale();
32
+ const {
33
+ current: titleId
34
+ } = useRef(createGuid());
31
35
  let sidebarRef = useRef();
32
36
  if (ref) sidebarRef = ref;
33
37
 
@@ -51,14 +55,16 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
51
55
  "aria-modal": !enableBackgroundUI,
52
56
  "aria-describedby": ariaDescribedBy,
53
57
  "aria-label": ariaLabel,
54
- "aria-labelledby": ariaLabelledBy,
58
+ "aria-labelledby": !ariaLabelledBy && !ariaLabel ? titleId : ariaLabelledBy,
55
59
  ref: sidebarRef,
56
60
  position: position,
57
61
  size: size,
58
62
  "data-element": "sidebar",
59
63
  onCancel: onCancel,
60
64
  role: role
61
- }, closeIcon(), header && /*#__PURE__*/React.createElement(SidebarHeader, null, header), /*#__PURE__*/React.createElement(Box, {
65
+ }, header && /*#__PURE__*/React.createElement(SidebarHeader, {
66
+ id: titleId
67
+ }, header), closeIcon(), /*#__PURE__*/React.createElement(Box, {
62
68
  "data-element": "sidebar-content",
63
69
  p: 4,
64
70
  pt: "27px",
@@ -77,7 +83,8 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
77
83
  enableBackgroundUI: enableBackgroundUI,
78
84
  className: "carbon-sidebar"
79
85
  }, componentTags), enableBackgroundUI ? sidebar : /*#__PURE__*/React.createElement(FocusTrap, {
80
- wrapperRef: sidebarRef
86
+ wrapperRef: sidebarRef,
87
+ isOpen: open
81
88
  }, sidebar));
82
89
  });
83
90
  Sidebar.propTypes = {
@@ -7,7 +7,7 @@ import Events from "../../__internal__/utils/helpers/events";
7
7
  import tagComponent from "../../__internal__/utils/helpers/tags/tags";
8
8
  import Fieldset from "../../__internal__/fieldset";
9
9
  import SimpleColor from "./simple-color";
10
- import RadioButtonMapper from "../radio-button/radio-button-mapper.component";
10
+ import RadioButtonMapper from "../../__internal__/radio-button-mapper/radio-button-mapper.component";
11
11
  import { StyledContent, StyledColorOptions } from "./simple-color-picker.style";
12
12
  import ValidationIcon from "../../__internal__/validations/validation-icon.component";
13
13
  import { InputGroupContext } from "../../__internal__/input-behaviour";
@@ -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 */
@@ -15,14 +15,11 @@ import Popover from "../../__internal__/popover";
15
15
  import { filterStyledSystemMarginProps, filterOutStyledSystemSpacingProps } from "../../style/utils";
16
16
  import { baseTheme } from "../../style/themes";
17
17
  import { defaultFocusableSelectors } from "../../__internal__/focus-trap/focus-trap-utils";
18
- import Logger from "../../__internal__/utils/logger";
19
18
  const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
20
19
  const CONTENT_WIDTH_RATIO = 0.75;
21
- let deprecatedWarnTriggered = false;
22
20
 
23
21
  const SplitButton = ({
24
22
  align = "left",
25
- as,
26
23
  buttonType = "secondary",
27
24
  children,
28
25
  disabled = false,
@@ -36,12 +33,6 @@ const SplitButton = ({
36
33
  "data-role": dataRole,
37
34
  ...rest
38
35
  }) => {
39
- if (!deprecatedWarnTriggered && as) {
40
- deprecatedWarnTriggered = true;
41
- Logger.deprecate( // eslint-disable-next-line max-len
42
- "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");
43
- }
44
-
45
36
  const theme = useContext(ThemeContext) || baseTheme;
46
37
  const isToggleButtonFocused = useRef(false);
47
38
  const isFocusedAfterClosing = useRef(false);
@@ -126,7 +117,6 @@ const SplitButton = ({
126
117
  onFocus: hideButtons,
127
118
  onTouchStart: hideButtons,
128
119
  iconPosition,
129
- as,
130
120
  buttonType,
131
121
  disabled,
132
122
  iconType,
@@ -147,7 +137,7 @@ const SplitButton = ({
147
137
  isToggleButtonFocused.current = false;
148
138
  },
149
139
  onKeyDown: handleToggleButtonKeyDown,
150
- buttonType: as || buttonType,
140
+ buttonType,
151
141
  size
152
142
  };
153
143
 
@@ -171,7 +161,7 @@ const SplitButton = ({
171
161
  primary: theme.colors.white,
172
162
  secondary: theme.colors.primary
173
163
  };
174
- return colorsMap[as || buttonType];
164
+ return colorsMap[buttonType];
175
165
  }
176
166
 
177
167
  function renderMainButton() {
@@ -282,9 +272,6 @@ SplitButton.propTypes = { ...marginPropTypes,
282
272
  /** Button type: "primary" | "secondary" */
283
273
  buttonType: PropTypes.oneOf(["primary", "secondary"]),
284
274
 
285
- /** Button type: "primary" | "secondary" for legacy theme */
286
- as: PropTypes.oneOf(["primary", "secondary"]),
287
-
288
275
  /** The additional button to display. */
289
276
  children: PropTypes.node.isRequired,
290
277
 
@@ -309,5 +296,5 @@ SplitButton.propTypes = { ...marginPropTypes,
309
296
  /** Set align of the rendered content */
310
297
  align: PropTypes.oneOf(["left", "right"])
311
298
  };
312
- SplitButton.safeProps = ["buttonType", "as", "disabled", "size"];
299
+ SplitButton.safeProps = ["buttonType", "disabled", "size"];
313
300
  export default SplitButton;
@@ -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;
@@ -4,11 +4,8 @@ import React from "react";
4
4
  import PropTypes from "prop-types";
5
5
  import propTypes from "@styled-system/prop-types";
6
6
  import { StyledTile, TileContent } from "./tile.style.js";
7
- import Logger from "../../__internal__/utils/logger";
8
- let deprecatedWarnTriggered = false;
9
7
 
10
8
  const Tile = ({
11
- as,
12
9
  variant = "tile",
13
10
  p = 3,
14
11
  children,
@@ -16,12 +13,6 @@ const Tile = ({
16
13
  width,
17
14
  ...props
18
15
  }) => {
19
- if (!deprecatedWarnTriggered && as) {
20
- deprecatedWarnTriggered = true;
21
- Logger.deprecate( // eslint-disable-next-line max-len
22
- "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");
23
- }
24
-
25
16
  const isHorizontal = () => orientation === "horizontal";
26
17
 
27
18
  const isVertical = () => orientation === "vertical";
@@ -50,7 +41,7 @@ const Tile = ({
50
41
  }), /*#__PURE__*/React.cloneElement(child, childProps));
51
42
  });
52
43
  return /*#__PURE__*/React.createElement(StyledTile, _extends({
53
- tileTheme: as || variant,
44
+ tileTheme: variant,
54
45
  width: width,
55
46
  "data-component": "tile",
56
47
  isHorizontal: isHorizontal(orientation),
@@ -62,9 +53,6 @@ Tile.propTypes = {
62
53
  /** Styled system spacing props */
63
54
  ...propTypes.space,
64
55
 
65
- /** Sets the theme of the tile - either 'tile' or 'transparent' */
66
- as: PropTypes.oneOf(["tile", "transparent"]),
67
-
68
56
  /** Sets the theme of the tile - either 'tile' or 'transparent' */
69
57
  variant: PropTypes.oneOf(["tile", "transparent"]),
70
58
 
@@ -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
  /**
@@ -5,7 +5,7 @@ import PropTypes from "prop-types";
5
5
  import styledSystemPropTypes from "@styled-system/prop-types";
6
6
  import tagComponent from "../../__internal__/utils/helpers/tags/tags";
7
7
  import TileSelect from "./tile-select.component";
8
- import RadioButtonMapper from "../radio-button/radio-button-mapper.component";
8
+ import RadioButtonMapper from "../../__internal__/radio-button-mapper/radio-button-mapper.component";
9
9
  import { StyledTileSelectFieldset, StyledGroupDescription } from "./tile-select.style";
10
10
  import { filterStyledSystemMarginProps } from "../../style/utils";
11
11
  const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
@@ -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 */
@@ -11,11 +11,8 @@ import IconButton from "../icon-button";
11
11
  import Events from "../../__internal__/utils/helpers/events";
12
12
  import useLocale from "../../hooks/__internal__/useLocale";
13
13
  import useModalManager from "../../hooks/__internal__/useModalManager";
14
- import Logger from "../../__internal__/utils/logger";
15
- let deprecatedWarnTriggered = false;
16
14
 
17
15
  const Toast = ({
18
- as,
19
16
  children,
20
17
  className,
21
18
  id,
@@ -28,12 +25,6 @@ const Toast = ({
28
25
  variant,
29
26
  ...restProps
30
27
  }) => {
31
- if (!deprecatedWarnTriggered && as) {
32
- deprecatedWarnTriggered = true;
33
- Logger.deprecate( // eslint-disable-next-line max-len
34
- "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");
35
- }
36
-
37
28
  const locale = useLocale();
38
29
  const toastRef = useRef();
39
30
  const timer = useRef();
@@ -73,7 +64,7 @@ const Toast = ({
73
64
  if (!open) return null;
74
65
  const toastProps = {
75
66
  isCenter,
76
- variant: variant || as || "success",
67
+ variant: variant || "success",
77
68
  id,
78
69
  maxWidth
79
70
  };
@@ -113,9 +104,6 @@ Toast.propTypes = {
113
104
  /** Customizes the appearance in the DLS theme */
114
105
  variant: PropTypes.oneOf(["error", "info", "success", "warning"]),
115
106
 
116
- /** Customizes the appearance in a legacy theme through colour (see the 'iconColorSets' for possible values) */
117
- as: PropTypes.oneOf(["error", "info", "success", "warning"]),
118
-
119
107
  /** Custom className */
120
108
  className: PropTypes.string,
121
109
 
@@ -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 */
@@ -118,15 +118,6 @@ const enGB = {
118
118
  ariaLabels: {
119
119
  close: () => "Close"
120
120
  }
121
- },
122
- wizards: {
123
- multiStep: {
124
- buttons: {
125
- submit: () => "Submit",
126
- next: () => "Next",
127
- back: () => "Back"
128
- }
129
- }
130
121
  }
131
122
  };
132
123
  export 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;
@@ -116,15 +116,6 @@ const plPL = {
116
116
  ariaLabels: {
117
117
  close: () => "Zamknij"
118
118
  }
119
- },
120
- wizards: {
121
- multiStep: {
122
- buttons: {
123
- submit: () => "Wyślij",
124
- next: () => "Następny",
125
- back: () => "Wstecz"
126
- }
127
- }
128
119
  }
129
120
  };
130
121
  export default plPL;
@@ -8,12 +8,36 @@ exports.isRadio = exports.nextNonRadioElementIndex = exports.defaultFocusableSel
8
8
  const defaultFocusableSelectors = 'button:not([disabled]), [href], input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]';
9
9
  exports.defaultFocusableSelectors = defaultFocusableSelectors;
10
10
 
11
+ const waitForVisibleAndFocus = element => {
12
+ const INTERVAL = 10;
13
+ const MAX_TIME = 100;
14
+ let timeSoFar = 0;
15
+
16
+ const stylesMatch = () => {
17
+ const actualStyles = window.getComputedStyle(element);
18
+ return actualStyles.visibility === "visible";
19
+ };
20
+
21
+ const check = () => {
22
+ /* istanbul ignore else */
23
+ if (stylesMatch()) {
24
+ element.focus();
25
+ } else if (timeSoFar < MAX_TIME) {
26
+ setTimeout(check, INTERVAL);
27
+ timeSoFar += INTERVAL;
28
+ } // just "fail" silently if maxTime exceeded - callback will never be called
29
+
30
+ };
31
+
32
+ check();
33
+ };
34
+
11
35
  function setElementFocus(element) {
12
36
  if (typeof element === "function") {
13
37
  element();
14
38
  } else {
15
39
  const el = element.current || element;
16
- el.focus();
40
+ waitForVisibleAndFocus(el);
17
41
  }
18
42
  }
19
43
 
@@ -1,10 +1,11 @@
1
1
  export default FocusTrap;
2
- declare function FocusTrap({ children, autoFocus, focusFirstElement, bespokeTrap, wrapperRef, }: {
2
+ declare function FocusTrap({ children, autoFocus, focusFirstElement, bespokeTrap, wrapperRef, isOpen, }: {
3
3
  children: any;
4
4
  autoFocus?: boolean | undefined;
5
5
  focusFirstElement: any;
6
6
  bespokeTrap: any;
7
7
  wrapperRef: any;
8
+ isOpen: any;
8
9
  }): JSX.Element;
9
10
  declare namespace FocusTrap {
10
11
  namespace propTypes {
@@ -17,6 +18,7 @@ declare namespace FocusTrap {
17
18
  const wrapperRef: PropTypes.Requireable<PropTypes.InferProps<{
18
19
  current: PropTypes.Requireable<any>;
19
20
  }>>;
21
+ const isOpen: PropTypes.Requireable<boolean>;
20
22
  }
21
23
  }
22
24
  import PropTypes from "prop-types";