carbon-react 106.6.10 → 107.1.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/esm/__internal__/click-away-wrapper/click-away-wrapper.component.d.ts +12 -0
- package/esm/__internal__/click-away-wrapper/click-away-wrapper.component.js +43 -0
- package/esm/__internal__/click-away-wrapper/index.d.ts +2 -0
- package/esm/__internal__/click-away-wrapper/index.js +1 -0
- package/esm/__internal__/focus-trap/focus-trap-utils.js +25 -1
- package/esm/__internal__/focus-trap/focus-trap.component.d.ts +3 -1
- package/esm/__internal__/focus-trap/focus-trap.component.js +44 -12
- package/esm/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.d.ts +0 -0
- package/esm/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.js +0 -0
- package/esm/components/advanced-color-picker/advanced-color-picker.component.js +5 -5
- package/esm/components/badge/badge.style.d.ts +1 -1
- package/esm/components/button/button.component.d.ts +1 -3
- package/esm/components/button/button.component.js +1 -12
- package/esm/components/button/button.style.d.ts +1 -1
- package/esm/components/button-toggle-group/button-toggle-group.component.js +1 -1
- package/esm/components/confirm/confirm.component.d.ts +1 -5
- package/esm/components/confirm/confirm.component.js +2 -14
- package/esm/components/confirm/confirm.d.ts +0 -2
- package/esm/components/date/date.component.js +19 -20
- package/esm/components/dialog/dialog.component.js +4 -3
- package/esm/components/dialog-full-screen/content.style.js +4 -10
- package/esm/components/dialog-full-screen/dialog-full-screen.component.js +4 -3
- package/esm/components/heading/heading.component.d.ts +27 -52
- package/esm/components/heading/heading.component.js +86 -170
- package/esm/components/heading/heading.d.ts +5 -3
- package/esm/components/i18n-provider/i18n-provider.component.d.ts +0 -9
- package/esm/components/i18n-provider/i18n-provider.component.js +0 -9
- package/esm/components/menu/__internal__/submenu/submenu.component.js +11 -17
- package/esm/components/menu/index.d.ts +0 -1
- package/esm/components/menu/index.js +0 -1
- package/esm/components/menu/menu-full-screen/menu-full-screen.component.js +4 -18
- package/esm/components/menu/menu-full-screen/menu-full-screen.style.js +1 -0
- package/esm/components/menu/menu-item/menu-item.component.js +0 -6
- package/esm/components/multi-action-button/multi-action-button.component.d.ts +1 -1
- package/esm/components/multi-action-button/multi-action-button.component.js +1 -11
- package/esm/components/navigation-bar/navigation-bar.component.d.ts +1 -6
- package/esm/components/navigation-bar/navigation-bar.component.js +1 -15
- package/esm/components/navigation-bar/navigation-bar.style.d.ts +0 -4
- package/esm/components/navigation-bar/navigation-bar.style.js +0 -8
- package/esm/components/popover-container/popover-container.component.js +16 -3
- package/esm/components/radio-button/radio-button-group.component.js +1 -1
- package/esm/components/select/select-list/select-list.component.js +2 -2
- package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +3 -1
- package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +7 -2
- package/esm/components/sidebar/sidebar.component.js +10 -3
- package/esm/components/simple-color-picker/simple-color-picker.component.js +1 -1
- package/esm/components/split-button/split-button-toggle.style.d.ts +1 -1
- package/esm/components/split-button/split-button.component.d.ts +1 -4
- package/esm/components/split-button/split-button.component.js +3 -16
- package/esm/components/split-button/split-button.d.ts +0 -2
- package/esm/components/tile/tile.component.d.ts +1 -2
- package/esm/components/tile/tile.component.js +1 -13
- package/esm/components/tile/tile.d.ts +0 -2
- package/esm/components/tile-select/tile-select-group.component.js +1 -1
- package/esm/components/toast/toast.component.d.ts +1 -4
- package/esm/components/toast/toast.component.js +1 -13
- package/esm/components/toast/toast.d.ts +0 -2
- package/esm/locales/en-gb.js +0 -9
- package/esm/locales/locale.d.ts +0 -9
- package/esm/locales/pl-pl.js +0 -9
- package/lib/__internal__/click-away-wrapper/click-away-wrapper.component.d.ts +12 -0
- package/lib/__internal__/click-away-wrapper/click-away-wrapper.component.js +59 -0
- package/lib/__internal__/click-away-wrapper/index.d.ts +2 -0
- package/lib/{components/menu/submenu-block → __internal__/click-away-wrapper}/index.js +2 -2
- package/lib/{components/scrollable-list → __internal__/click-away-wrapper}/package.json +1 -1
- package/lib/__internal__/focus-trap/focus-trap-utils.js +25 -1
- package/lib/__internal__/focus-trap/focus-trap.component.d.ts +3 -1
- package/lib/__internal__/focus-trap/focus-trap.component.js +46 -12
- package/lib/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.d.ts +0 -0
- package/lib/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.js +0 -0
- package/lib/components/advanced-color-picker/advanced-color-picker.component.js +5 -5
- package/lib/components/badge/badge.style.d.ts +1 -1
- package/lib/components/button/button.component.d.ts +1 -3
- package/lib/components/button/button.component.js +1 -14
- package/lib/components/button/button.style.d.ts +1 -1
- package/lib/components/button-toggle-group/button-toggle-group.component.js +1 -1
- package/lib/components/confirm/confirm.component.d.ts +1 -5
- package/lib/components/confirm/confirm.component.js +2 -17
- package/lib/components/confirm/confirm.d.ts +0 -2
- package/lib/components/date/date.component.js +20 -20
- package/lib/components/dialog/dialog.component.js +4 -3
- package/lib/components/dialog-full-screen/content.style.js +4 -10
- package/lib/components/dialog-full-screen/dialog-full-screen.component.js +4 -3
- package/lib/components/heading/heading.component.d.ts +27 -52
- package/lib/components/heading/heading.component.js +86 -170
- package/lib/components/heading/heading.d.ts +5 -3
- package/lib/components/i18n-provider/i18n-provider.component.d.ts +0 -9
- package/lib/components/i18n-provider/i18n-provider.component.js +0 -9
- package/lib/components/menu/__internal__/submenu/submenu.component.js +12 -17
- package/lib/components/menu/index.d.ts +0 -1
- package/lib/components/menu/index.js +0 -8
- package/lib/components/menu/menu-full-screen/menu-full-screen.component.js +3 -17
- package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +1 -0
- package/lib/components/menu/menu-item/menu-item.component.js +0 -7
- package/lib/components/multi-action-button/multi-action-button.component.d.ts +1 -1
- package/lib/components/multi-action-button/multi-action-button.component.js +1 -14
- package/lib/components/navigation-bar/navigation-bar.component.d.ts +1 -6
- package/lib/components/navigation-bar/navigation-bar.component.js +1 -18
- package/lib/components/navigation-bar/navigation-bar.style.d.ts +0 -4
- package/lib/components/navigation-bar/navigation-bar.style.js +0 -8
- package/lib/components/popover-container/popover-container.component.js +17 -3
- package/lib/components/radio-button/radio-button-group.component.js +1 -1
- package/lib/components/select/select-list/select-list.component.js +2 -2
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +3 -1
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +7 -2
- package/lib/components/sidebar/sidebar.component.js +11 -3
- package/lib/components/simple-color-picker/simple-color-picker.component.js +1 -1
- package/lib/components/split-button/split-button-toggle.style.d.ts +1 -1
- package/lib/components/split-button/split-button.component.d.ts +1 -4
- package/lib/components/split-button/split-button.component.js +3 -18
- package/lib/components/split-button/split-button.d.ts +0 -2
- package/lib/components/tile/tile.component.d.ts +1 -2
- package/lib/components/tile/tile.component.js +1 -16
- package/lib/components/tile/tile.d.ts +0 -2
- package/lib/components/tile-select/tile-select-group.component.js +1 -1
- package/lib/components/toast/toast.component.d.ts +1 -4
- package/lib/components/toast/toast.component.js +1 -16
- package/lib/components/toast/toast.d.ts +0 -2
- package/lib/locales/en-gb.js +0 -9
- package/lib/locales/locale.d.ts +0 -9
- package/lib/locales/pl-pl.js +0 -9
- package/package.json +1 -1
- package/esm/components/app-wrapper/app-wrapper.component.d.ts +0 -25
- package/esm/components/app-wrapper/app-wrapper.component.js +0 -104
- package/esm/components/app-wrapper/app-wrapper.d.ts +0 -12
- package/esm/components/app-wrapper/app-wrapper.style.d.ts +0 -2
- package/esm/components/app-wrapper/app-wrapper.style.js +0 -17
- package/esm/components/app-wrapper/index.d.ts +0 -1
- package/esm/components/app-wrapper/index.js +0 -1
- package/esm/components/menu/submenu-block/index.d.ts +0 -2
- package/esm/components/menu/submenu-block/index.js +0 -1
- package/esm/components/menu/submenu-block/submenu-block.component.d.ts +0 -12
- package/esm/components/menu/submenu-block/submenu-block.component.js +0 -34
- package/esm/components/menu/submenu-block/submenu-block.d.ts +0 -12
- package/esm/components/menu/submenu-block/submenu-block.style.d.ts +0 -2
- package/esm/components/menu/submenu-block/submenu-block.style.js +0 -16
- package/esm/components/mount-in-app/__spec__.d.ts +0 -1
- package/esm/components/mount-in-app/__spec__.js +0 -47
- package/esm/components/mount-in-app/index.d.ts +0 -1
- package/esm/components/mount-in-app/mount-in-app.d.ts +0 -12
- package/esm/components/mount-in-app/mount-in-app.js +0 -90
- package/esm/components/mount-in-app/package.json +0 -3
- package/esm/components/multi-step-wizard/__spec__.d.ts +0 -1
- package/esm/components/multi-step-wizard/__spec__.js +0 -191
- package/esm/components/multi-step-wizard/multi-step-wizard.d.ts +0 -109
- package/esm/components/multi-step-wizard/multi-step-wizard.js +0 -383
- package/esm/components/multi-step-wizard/multi-step-wizard.style.d.ts +0 -2
- package/esm/components/multi-step-wizard/multi-step-wizard.style.js +0 -10
- package/esm/components/multi-step-wizard/package.json +0 -4
- package/esm/components/multi-step-wizard/step/__spec__.d.ts +0 -1
- package/esm/components/multi-step-wizard/step/__spec__.js +0 -399
- package/esm/components/multi-step-wizard/step/package.json +0 -4
- package/esm/components/multi-step-wizard/step/step.d.ts +0 -166
- package/esm/components/multi-step-wizard/step/step.js +0 -407
- package/esm/components/multi-step-wizard/step/step.style.d.ts +0 -13
- package/esm/components/multi-step-wizard/step/step.style.js +0 -138
- package/esm/components/scrollable-list/as-scrollable-list-item.wrapper.d.ts +0 -2
- package/esm/components/scrollable-list/as-scrollable-list-item.wrapper.js +0 -10
- package/esm/components/scrollable-list/index.d.ts +0 -4
- package/esm/components/scrollable-list/index.js +0 -4
- package/esm/components/scrollable-list/scrollable-list-item.component.d.ts +0 -2
- package/esm/components/scrollable-list/scrollable-list-item.component.js +0 -26
- package/esm/components/scrollable-list/scrollable-list.component.d.ts +0 -52
- package/esm/components/scrollable-list/scrollable-list.component.js +0 -306
- package/esm/components/scrollable-list/scrollable-list.context.d.ts +0 -3
- package/esm/components/scrollable-list/scrollable-list.context.js +0 -2
- package/esm/components/scrollable-list/scrollable-list.style.d.ts +0 -2
- package/esm/components/scrollable-list/scrollable-list.style.js +0 -30
- package/esm/components/scrollable-list/test-utils.d.ts +0 -2
- package/esm/components/scrollable-list/test-utils.js +0 -25
- package/lib/components/app-wrapper/app-wrapper.component.d.ts +0 -25
- package/lib/components/app-wrapper/app-wrapper.component.js +0 -120
- package/lib/components/app-wrapper/app-wrapper.d.ts +0 -12
- package/lib/components/app-wrapper/app-wrapper.style.d.ts +0 -2
- package/lib/components/app-wrapper/app-wrapper.style.js +0 -28
- package/lib/components/app-wrapper/index.d.ts +0 -1
- package/lib/components/app-wrapper/index.js +0 -15
- package/lib/components/app-wrapper/package.json +0 -6
- package/lib/components/menu/submenu-block/index.d.ts +0 -2
- package/lib/components/menu/submenu-block/package.json +0 -6
- package/lib/components/menu/submenu-block/submenu-block.component.d.ts +0 -12
- package/lib/components/menu/submenu-block/submenu-block.component.js +0 -53
- package/lib/components/menu/submenu-block/submenu-block.d.ts +0 -12
- package/lib/components/menu/submenu-block/submenu-block.style.d.ts +0 -2
- package/lib/components/menu/submenu-block/submenu-block.style.js +0 -33
- package/lib/components/mount-in-app/__spec__.d.ts +0 -1
- package/lib/components/mount-in-app/__spec__.js +0 -55
- package/lib/components/mount-in-app/index.d.ts +0 -1
- package/lib/components/mount-in-app/mount-in-app.d.ts +0 -12
- package/lib/components/mount-in-app/mount-in-app.js +0 -105
- package/lib/components/mount-in-app/package.json +0 -3
- package/lib/components/multi-step-wizard/__spec__.d.ts +0 -1
- package/lib/components/multi-step-wizard/__spec__.js +0 -202
- package/lib/components/multi-step-wizard/multi-step-wizard.d.ts +0 -109
- package/lib/components/multi-step-wizard/multi-step-wizard.js +0 -397
- package/lib/components/multi-step-wizard/multi-step-wizard.style.d.ts +0 -2
- package/lib/components/multi-step-wizard/multi-step-wizard.style.js +0 -21
- package/lib/components/multi-step-wizard/package.json +0 -4
- package/lib/components/multi-step-wizard/step/__spec__.d.ts +0 -1
- package/lib/components/multi-step-wizard/step/__spec__.js +0 -409
- package/lib/components/multi-step-wizard/step/package.json +0 -4
- package/lib/components/multi-step-wizard/step/step.d.ts +0 -166
- package/lib/components/multi-step-wizard/step/step.js +0 -421
- package/lib/components/multi-step-wizard/step/step.style.d.ts +0 -13
- package/lib/components/multi-step-wizard/step/step.style.js +0 -162
- package/lib/components/scrollable-list/as-scrollable-list-item.wrapper.d.ts +0 -2
- package/lib/components/scrollable-list/as-scrollable-list-item.wrapper.js +0 -21
- package/lib/components/scrollable-list/index.d.ts +0 -4
- package/lib/components/scrollable-list/index.js +0 -31
- package/lib/components/scrollable-list/scrollable-list-item.component.d.ts +0 -2
- package/lib/components/scrollable-list/scrollable-list-item.component.js +0 -42
- package/lib/components/scrollable-list/scrollable-list.component.d.ts +0 -52
- package/lib/components/scrollable-list/scrollable-list.component.js +0 -328
- package/lib/components/scrollable-list/scrollable-list.context.d.ts +0 -3
- package/lib/components/scrollable-list/scrollable-list.context.js +0 -14
- package/lib/components/scrollable-list/scrollable-list.style.d.ts +0 -2
- package/lib/components/scrollable-list/scrollable-list.style.js +0 -41
- package/lib/components/scrollable-list/test-utils.d.ts +0 -2
- package/lib/components/scrollable-list/test-utils.js +0 -37
|
@@ -8,13 +8,10 @@ import Events from "../../__internal__/utils/helpers/events";
|
|
|
8
8
|
import Popover from "../../__internal__/popover";
|
|
9
9
|
import { filterStyledSystemMarginProps, filterOutStyledSystemSpacingProps } from "../../style/utils";
|
|
10
10
|
import { defaultFocusableSelectors } from "../../__internal__/focus-trap/focus-trap-utils";
|
|
11
|
-
import Logger from "../../__internal__/utils/logger";
|
|
12
|
-
let deprecatedWarnTriggered = false;
|
|
13
11
|
|
|
14
12
|
const MultiActionButton = ({
|
|
15
13
|
align = "left",
|
|
16
14
|
disabled,
|
|
17
|
-
as,
|
|
18
15
|
buttonType,
|
|
19
16
|
size,
|
|
20
17
|
children,
|
|
@@ -24,12 +21,6 @@ const MultiActionButton = ({
|
|
|
24
21
|
"data-role": dataRole,
|
|
25
22
|
...rest
|
|
26
23
|
}) => {
|
|
27
|
-
if (!deprecatedWarnTriggered && as) {
|
|
28
|
-
deprecatedWarnTriggered = true;
|
|
29
|
-
Logger.deprecate( // eslint-disable-next-line max-len
|
|
30
|
-
"The `as` prop is deprecated and will soon be removed from the `MultiActionButton` 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");
|
|
31
|
-
}
|
|
32
|
-
|
|
33
24
|
const ref = useRef(null);
|
|
34
25
|
const buttonRef = useRef(null);
|
|
35
26
|
const buttonContainer = useRef(null);
|
|
@@ -188,7 +179,7 @@ const MultiActionButton = ({
|
|
|
188
179
|
onFocus: focusMainButton,
|
|
189
180
|
onBlur: blurMainButton,
|
|
190
181
|
onKeyDown: handleMainButtonKeyDown,
|
|
191
|
-
buttonType
|
|
182
|
+
buttonType,
|
|
192
183
|
size,
|
|
193
184
|
subtext,
|
|
194
185
|
...(!disabled && {
|
|
@@ -282,7 +273,6 @@ MultiActionButton.propTypes = {
|
|
|
282
273
|
"aria-valuemin": PropTypes.number,
|
|
283
274
|
"aria-valuenow": PropTypes.number,
|
|
284
275
|
"aria-valuetext": PropTypes.string,
|
|
285
|
-
"as": PropTypes.oneOf(["primary", "secondary"]),
|
|
286
276
|
"autoCapitalize": PropTypes.string,
|
|
287
277
|
"autoCorrect": PropTypes.string,
|
|
288
278
|
"autoFocus": PropTypes.bool,
|
|
@@ -3,7 +3,6 @@ import { PaddingProps, FlexboxProps } from "styled-system";
|
|
|
3
3
|
export declare type Position = "sticky" | "fixed";
|
|
4
4
|
export declare type Orientation = "top" | "bottom";
|
|
5
5
|
export declare type NavigationType = "light" | "dark" | "white" | "black";
|
|
6
|
-
export declare type StickyPosition = "top" | "bottom";
|
|
7
6
|
export interface NavigationBarProps extends PaddingProps, FlexboxProps {
|
|
8
7
|
children?: React.ReactNode;
|
|
9
8
|
ariaLabel?: string;
|
|
@@ -11,10 +10,6 @@ export interface NavigationBarProps extends PaddingProps, FlexboxProps {
|
|
|
11
10
|
navigationType?: NavigationType;
|
|
12
11
|
/** If 'true' the children will not be visible */
|
|
13
12
|
isLoading?: boolean;
|
|
14
|
-
/** Defines the position of sticky navigation bar */
|
|
15
|
-
stickyPosition?: StickyPosition;
|
|
16
|
-
/** Defines the offset of sticky navigation bar */
|
|
17
|
-
stickyOffset?: string;
|
|
18
13
|
/** Defines whether the navigation bar should be positioned fixed or sticky */
|
|
19
14
|
position?: Position;
|
|
20
15
|
/** Defines the offset of navigation bar */
|
|
@@ -22,5 +17,5 @@ export interface NavigationBarProps extends PaddingProps, FlexboxProps {
|
|
|
22
17
|
/** Defines whether the navigation bar should be positioned top or bottom */
|
|
23
18
|
orientation?: Orientation;
|
|
24
19
|
}
|
|
25
|
-
export declare const NavigationBar: ({ navigationType, isLoading, children, ariaLabel,
|
|
20
|
+
export declare const NavigationBar: ({ navigationType, isLoading, children, ariaLabel, position, offset, orientation, ...props }: NavigationBarProps) => JSX.Element;
|
|
26
21
|
export default NavigationBar;
|
|
@@ -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,
|
|
@@ -8,6 +8,7 @@ import { PopoverContainerWrapperStyle, PopoverContainerHeaderStyle, PopoverConta
|
|
|
8
8
|
import Icon from "../icon";
|
|
9
9
|
import createGuid from "../../__internal__/utils/helpers/guid";
|
|
10
10
|
import { filterStyledSystemPaddingProps } from "../../style/utils";
|
|
11
|
+
import ClickAwayWrapper from "../../__internal__/click-away-wrapper";
|
|
11
12
|
const paddingPropTypes = filterStyledSystemPaddingProps(styledSystemPropTypes.space);
|
|
12
13
|
|
|
13
14
|
const PopoverContainer = ({
|
|
@@ -28,6 +29,7 @@ const PopoverContainer = ({
|
|
|
28
29
|
}) => {
|
|
29
30
|
const isControlled = open !== undefined;
|
|
30
31
|
const [isOpenInternal, setIsOpenInternal] = useState(false);
|
|
32
|
+
const ref = useRef();
|
|
31
33
|
const closeButtonRef = useRef();
|
|
32
34
|
const openButtonRef = useRef();
|
|
33
35
|
const guid = useRef(createGuid());
|
|
@@ -68,10 +70,21 @@ const PopoverContainer = ({
|
|
|
68
70
|
ref: closeButtonRef,
|
|
69
71
|
ariaLabel: closeButtonAriaLabel
|
|
70
72
|
};
|
|
71
|
-
|
|
73
|
+
|
|
74
|
+
const handleClickAway = e => {
|
|
75
|
+
if (!isControlled) setIsOpenInternal(false);
|
|
76
|
+
if (onClose) onClose(e);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
return /*#__PURE__*/React.createElement(ClickAwayWrapper, {
|
|
80
|
+
targets: [ref],
|
|
81
|
+
handleClickAway: handleClickAway,
|
|
82
|
+
eventTypeId: "mousedown"
|
|
83
|
+
}, /*#__PURE__*/React.createElement(PopoverContainerWrapperStyle, {
|
|
72
84
|
"data-component": "popover-container",
|
|
73
85
|
role: "region",
|
|
74
|
-
"aria-labelledby": popoverContainerId
|
|
86
|
+
"aria-labelledby": popoverContainerId,
|
|
87
|
+
ref: ref
|
|
75
88
|
}, renderOpenComponent(renderOpenComponentProps), /*#__PURE__*/React.createElement(Transition, {
|
|
76
89
|
in: isOpen,
|
|
77
90
|
timeout: {
|
|
@@ -95,7 +108,7 @@ const PopoverContainer = ({
|
|
|
95
108
|
}, filterStyledSystemPaddingProps(rest)), /*#__PURE__*/React.createElement(PopoverContainerHeaderStyle, null, /*#__PURE__*/React.createElement(PopoverContainerTitleStyle, {
|
|
96
109
|
id: popoverContainerId,
|
|
97
110
|
"data-element": "popover-container-title"
|
|
98
|
-
}, title), renderCloseComponent(renderCloseComponentProps)), children)));
|
|
111
|
+
}, title), renderCloseComponent(renderCloseComponentProps)), children))));
|
|
99
112
|
};
|
|
100
113
|
|
|
101
114
|
PopoverContainer.propTypes = { ...paddingPropTypes,
|
|
@@ -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 "
|
|
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
|
|
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>)
|
|
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
|
-
},
|
|
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 "
|
|
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> &
|
|
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,
|
|
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
|
|
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[
|
|
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", "
|
|
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({
|
|
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:
|
|
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 "
|
|
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({
|
|
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 ||
|
|
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 */
|
package/esm/locales/en-gb.js
CHANGED
|
@@ -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;
|
package/esm/locales/locale.d.ts
CHANGED
package/esm/locales/pl-pl.js
CHANGED
|
@@ -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;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ClickAwayWrapperProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
handleClickAway: (ev: CustomEvent) => void;
|
|
5
|
+
eventTypeId?: "mousedown" | "click";
|
|
6
|
+
targets: React.RefObject<HTMLElement>[];
|
|
7
|
+
}
|
|
8
|
+
declare const ClickAwayWrapper: {
|
|
9
|
+
({ children, handleClickAway, eventTypeId, targets, }: ClickAwayWrapperProps): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default ClickAwayWrapper;
|