carbon-react 134.1.2 → 135.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.
- package/esm/components/heading/heading.style.d.ts +1 -1
- package/esm/components/loader-spinner/loader-spinner.style.d.ts +1 -1
- package/esm/components/portal/portal.js +1 -0
- package/esm/components/toast/toast.component.d.ts +0 -2
- package/esm/components/toast/toast.component.js +7 -15
- package/esm/components/toast/toast.style.d.ts +0 -3
- package/esm/components/toast/toast.style.js +4 -21
- package/esm/components/typography/typography.component.d.ts +3 -1
- package/esm/components/typography/typography.component.js +2 -0
- package/esm/components/typography/typography.style.js +2 -0
- package/lib/components/heading/heading.style.d.ts +1 -1
- package/lib/components/loader-spinner/loader-spinner.style.d.ts +1 -1
- package/lib/components/portal/portal.js +1 -0
- package/lib/components/toast/toast.component.d.ts +0 -2
- package/lib/components/toast/toast.component.js +7 -15
- package/lib/components/toast/toast.style.d.ts +0 -3
- package/lib/components/toast/toast.style.js +4 -21
- package/lib/components/typography/typography.component.d.ts +3 -1
- package/lib/components/typography/typography.component.js +2 -0
- package/lib/components/typography/typography.style.js +2 -0
- package/package.json +1 -1
- package/esm/components/carousel/carousel.component.d.ts +0 -25
- package/esm/components/carousel/carousel.component.js +0 -125
- package/esm/components/carousel/carousel.style.d.ts +0 -20
- package/esm/components/carousel/carousel.style.js +0 -154
- package/esm/components/carousel/index.d.ts +0 -4
- package/esm/components/carousel/index.js +0 -2
- package/esm/components/carousel/slide/index.d.ts +0 -2
- package/esm/components/carousel/slide/index.js +0 -1
- package/esm/components/carousel/slide/slide.component.d.ts +0 -12
- package/esm/components/carousel/slide/slide.component.js +0 -9
- package/esm/components/carousel/slide/slide.style.d.ts +0 -2
- package/esm/components/carousel/slide/slide.style.js +0 -32
- package/esm/components/carousel/slide.config.d.ts +0 -3
- package/esm/components/carousel/slide.config.js +0 -80
- package/esm/components/step-sequence/index.d.ts +0 -4
- package/esm/components/step-sequence/index.js +0 -2
- package/esm/components/step-sequence/step-sequence-item/index.d.ts +0 -2
- package/esm/components/step-sequence/step-sequence-item/index.js +0 -1
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.component.d.ts +0 -19
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.component.js +0 -43
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.d.ts +0 -6
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.js +0 -96
- package/esm/components/step-sequence/step-sequence.component.d.ts +0 -13
- package/esm/components/step-sequence/step-sequence.component.js +0 -29
- package/esm/components/step-sequence/step-sequence.config.d.ts +0 -2
- package/esm/components/step-sequence/step-sequence.config.js +0 -2
- package/esm/components/step-sequence/step-sequence.style.d.ts +0 -4
- package/esm/components/step-sequence/step-sequence.style.js +0 -21
- package/lib/components/carousel/carousel.component.d.ts +0 -25
- package/lib/components/carousel/carousel.component.js +0 -135
- package/lib/components/carousel/carousel.style.d.ts +0 -20
- package/lib/components/carousel/carousel.style.js +0 -162
- package/lib/components/carousel/index.d.ts +0 -4
- package/lib/components/carousel/index.js +0 -20
- package/lib/components/carousel/package.json +0 -6
- package/lib/components/carousel/slide/index.d.ts +0 -2
- package/lib/components/carousel/slide/index.js +0 -13
- package/lib/components/carousel/slide/package.json +0 -6
- package/lib/components/carousel/slide/slide.component.d.ts +0 -12
- package/lib/components/carousel/slide/slide.component.js +0 -16
- package/lib/components/carousel/slide/slide.style.d.ts +0 -2
- package/lib/components/carousel/slide/slide.style.js +0 -39
- package/lib/components/carousel/slide.config.d.ts +0 -3
- package/lib/components/carousel/slide.config.js +0 -85
- package/lib/components/step-sequence/index.d.ts +0 -4
- package/lib/components/step-sequence/index.js +0 -20
- package/lib/components/step-sequence/package.json +0 -6
- package/lib/components/step-sequence/step-sequence-item/index.d.ts +0 -2
- package/lib/components/step-sequence/step-sequence-item/index.js +0 -13
- package/lib/components/step-sequence/step-sequence-item/package.json +0 -6
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.component.d.ts +0 -19
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.component.js +0 -53
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.d.ts +0 -6
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.js +0 -105
- package/lib/components/step-sequence/step-sequence.component.d.ts +0 -13
- package/lib/components/step-sequence/step-sequence.component.js +0 -37
- package/lib/components/step-sequence/step-sequence.config.d.ts +0 -2
- package/lib/components/step-sequence/step-sequence.config.js +0 -8
- package/lib/components/step-sequence/step-sequence.style.d.ts +0 -4
- package/lib/components/step-sequence/step-sequence.style.js +0 -29
|
@@ -12,7 +12,7 @@ declare type StyledHeadingTitleProps = {
|
|
|
12
12
|
withMargin?: boolean;
|
|
13
13
|
};
|
|
14
14
|
declare const StyledHeadingTitle: import("styled-components").StyledComponent<{
|
|
15
|
-
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, className, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, ...rest }: import("../typography").TypographyProps): import("react").JSX.Element;
|
|
15
|
+
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordBreak, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, className, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, ...rest }: import("../typography").TypographyProps): import("react").JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
}, any, StyledHeadingTitleProps, never>;
|
|
18
18
|
declare const StyledHeadingPills: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { LoaderSpinnerProps } from "./loader-spinner.component";
|
|
3
3
|
export declare const StyledSpinnerWrapper: import("styled-components").StyledComponent<"div", any, Pick<LoaderSpinnerProps, "size">, never>;
|
|
4
4
|
export declare const StyledLabel: import("styled-components").StyledComponent<{
|
|
5
|
-
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, className, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, ...rest }: import("../typography").TypographyProps): import("react").JSX.Element;
|
|
5
|
+
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordBreak, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, className, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, ...rest }: import("../typography").TypographyProps): import("react").JSX.Element;
|
|
6
6
|
displayName: string;
|
|
7
7
|
}, any, Required<Pick<LoaderSpinnerProps, "size">>, never>;
|
|
8
8
|
interface StyledSpinnerCircleSvgProps extends Omit<LoaderSpinnerProps, "showSpinnerLabel"> {
|
|
@@ -60,6 +60,7 @@ export const Portal = ({
|
|
|
60
60
|
node = document.createElement("div");
|
|
61
61
|
node.classList.add(portalClassName);
|
|
62
62
|
node.setAttribute("data-portal-exit", uniqueId);
|
|
63
|
+
node.setAttribute("data-role", "carbon-portal-exit");
|
|
63
64
|
if (id !== undefined) {
|
|
64
65
|
node.setAttribute("id", id);
|
|
65
66
|
}
|
|
@@ -26,8 +26,6 @@ export interface ToastProps {
|
|
|
26
26
|
closeButtonDataProps?: Pick<TagProps, "data-role" | "data-element">;
|
|
27
27
|
/** Time for Toast to remain on screen */
|
|
28
28
|
timeout?: string | number;
|
|
29
|
-
/** Centers the Toast on the screen */
|
|
30
|
-
isCenter?: boolean;
|
|
31
29
|
/** Target Portal ID where the Toast will render */
|
|
32
30
|
targetPortalId?: string;
|
|
33
31
|
/** Maximum toast width */
|
|
@@ -9,15 +9,12 @@ import IconButton from "../icon-button";
|
|
|
9
9
|
import Events from "../../__internal__/utils/helpers/events";
|
|
10
10
|
import useLocale from "../../hooks/__internal__/useLocale";
|
|
11
11
|
import useModalManager from "../../hooks/__internal__/useModalManager";
|
|
12
|
-
import Logger from "../../__internal__/utils/logger";
|
|
13
|
-
let isDeprecationWarningTriggered = false;
|
|
14
12
|
const Toast = /*#__PURE__*/React.forwardRef(({
|
|
15
|
-
align,
|
|
13
|
+
align = "center",
|
|
16
14
|
alignY,
|
|
17
15
|
children,
|
|
18
16
|
className,
|
|
19
17
|
id,
|
|
20
|
-
isCenter = true,
|
|
21
18
|
maxWidth,
|
|
22
19
|
onDismiss,
|
|
23
20
|
open = true,
|
|
@@ -41,10 +38,6 @@ const Toast = /*#__PURE__*/React.forwardRef(({
|
|
|
41
38
|
if (ref && typeof ref === "object" && "current" in ref) {
|
|
42
39
|
refToPass = ref;
|
|
43
40
|
}
|
|
44
|
-
if (isCenter !== undefined && !isDeprecationWarningTriggered) {
|
|
45
|
-
isDeprecationWarningTriggered = true;
|
|
46
|
-
Logger.deprecate(`isCenter prop in ${Toast.displayName} is being deprecated in favour of the align prop.`);
|
|
47
|
-
}
|
|
48
41
|
const dismissToast = useCallback(ev => {
|
|
49
42
|
if (onDismiss && Events.isEscKey(ev)) {
|
|
50
43
|
ev.stopImmediatePropagation();
|
|
@@ -131,7 +124,6 @@ const Toast = /*#__PURE__*/React.forwardRef(({
|
|
|
131
124
|
isNotification: isNotification,
|
|
132
125
|
className: className
|
|
133
126
|
}, tagComponent(restProps["data-component"] || "toast", restProps), {
|
|
134
|
-
isCenter: isCenter,
|
|
135
127
|
variant: toastVariant,
|
|
136
128
|
id: id,
|
|
137
129
|
maxWidth: maxWidth,
|
|
@@ -140,25 +132,26 @@ const Toast = /*#__PURE__*/React.forwardRef(({
|
|
|
140
132
|
tabIndex,
|
|
141
133
|
onBlur: () => setTabIndex(undefined)
|
|
142
134
|
}), !isNotice && /*#__PURE__*/React.createElement(TypeIcon, {
|
|
143
|
-
variant: isNotification ? "info" : variant
|
|
135
|
+
variant: isNotification ? "info" : variant,
|
|
136
|
+
"data-role": "toast-type-icon"
|
|
144
137
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
145
138
|
type: toastIcon
|
|
146
139
|
})), /*#__PURE__*/React.createElement(StyledToastContent, {
|
|
147
140
|
isNotice: isNotice,
|
|
148
|
-
isDismiss: !!onDismiss
|
|
141
|
+
isDismiss: !!onDismiss,
|
|
142
|
+
"data-role": "toast-content"
|
|
149
143
|
}, children), renderCloseIcon()));
|
|
150
144
|
}
|
|
151
145
|
return /*#__PURE__*/React.createElement(StyledPortal, {
|
|
152
146
|
id: targetPortalId,
|
|
153
147
|
align: align,
|
|
154
148
|
alignY: alignY,
|
|
155
|
-
isCenter: isCenter,
|
|
156
149
|
isNotice: isNotice
|
|
157
150
|
}, /*#__PURE__*/React.createElement(ToastWrapper, {
|
|
158
151
|
align: align,
|
|
159
|
-
isCenter: isCenter,
|
|
160
152
|
ref: refToPass,
|
|
161
|
-
isNotice: isNotice
|
|
153
|
+
isNotice: isNotice,
|
|
154
|
+
"data-role": "toast-wrapper"
|
|
162
155
|
}, /*#__PURE__*/React.createElement(TransitionGroup, null, renderToastContent())));
|
|
163
156
|
});
|
|
164
157
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -174,7 +167,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
174
167
|
"data-component": PropTypes.string,
|
|
175
168
|
"disableAutoFocus": PropTypes.bool,
|
|
176
169
|
"id": PropTypes.string,
|
|
177
|
-
"isCenter": PropTypes.bool,
|
|
178
170
|
"maxWidth": PropTypes.string,
|
|
179
171
|
"onDismiss": PropTypes.func,
|
|
180
172
|
"open": PropTypes.bool,
|
|
@@ -4,7 +4,6 @@ import { MessageVariant } from "../message/message.component";
|
|
|
4
4
|
declare const StyledPortal: import("styled-components").StyledComponent<({ children, className, id, onReposition, inertOptOut, }: import("../portal/portal").PortalProps) => import("react").JSX.Element, any, {
|
|
5
5
|
align?: "left" | "right" | "center" | undefined;
|
|
6
6
|
alignY?: "bottom" | "top" | "center" | undefined;
|
|
7
|
-
isCenter?: boolean | undefined;
|
|
8
7
|
isNotice?: boolean | undefined;
|
|
9
8
|
}, never>;
|
|
10
9
|
declare type ToastVariants = MessageVariant;
|
|
@@ -12,7 +11,6 @@ declare type ToastStyleProps = {
|
|
|
12
11
|
align?: "left" | "center" | "right";
|
|
13
12
|
alignY?: "top" | "center" | "bottom";
|
|
14
13
|
maxWidth?: string;
|
|
15
|
-
isCenter?: boolean;
|
|
16
14
|
isNotice?: boolean;
|
|
17
15
|
isNotification?: boolean;
|
|
18
16
|
variant: ToastVariants;
|
|
@@ -24,7 +22,6 @@ declare const StyledToastContent: import("styled-components").StyledComponent<"d
|
|
|
24
22
|
}, never>;
|
|
25
23
|
declare const ToastWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
26
24
|
align?: "left" | "right" | "center" | undefined;
|
|
27
|
-
isCenter?: boolean | undefined;
|
|
28
25
|
isNotice?: boolean | undefined;
|
|
29
26
|
}, never>;
|
|
30
27
|
export { StyledPortal, StyledToast, TypeIcon, StyledToastContent, ToastWrapper, };
|
|
@@ -7,7 +7,6 @@ import StyledIcon from "../icon/icon.style";
|
|
|
7
7
|
const StyledPortal = styled(Portal)`
|
|
8
8
|
${({
|
|
9
9
|
theme,
|
|
10
|
-
isCenter,
|
|
11
10
|
isNotice,
|
|
12
11
|
align,
|
|
13
12
|
alignY
|
|
@@ -16,11 +15,6 @@ const StyledPortal = styled(Portal)`
|
|
|
16
15
|
top: 0;
|
|
17
16
|
z-index: ${theme.zIndex.notification};
|
|
18
17
|
|
|
19
|
-
${isCenter && css`
|
|
20
|
-
margin-left: 50%;
|
|
21
|
-
transform: translateX(-50%);
|
|
22
|
-
`}
|
|
23
|
-
|
|
24
18
|
${align === "left" && css`
|
|
25
19
|
left: 0;
|
|
26
20
|
transform: translateX(50%);
|
|
@@ -82,7 +76,6 @@ const iconPositionStyles = css`
|
|
|
82
76
|
const StyledToast = styled.div`
|
|
83
77
|
${({
|
|
84
78
|
maxWidth,
|
|
85
|
-
isCenter,
|
|
86
79
|
align,
|
|
87
80
|
isNotification,
|
|
88
81
|
alignY,
|
|
@@ -113,8 +106,8 @@ const StyledToast = styled.div`
|
|
|
113
106
|
margin-bottom: ${alignY === "bottom" && !isNotice ? "30px" : "0"};
|
|
114
107
|
max-width: ${!maxWidth ? "300px" : maxWidth};
|
|
115
108
|
position: relative;
|
|
116
|
-
margin-right: ${
|
|
117
|
-
margin-left: ${
|
|
109
|
+
margin-right: ${align === "center" || align === "right" ? "auto" : "30px"};
|
|
110
|
+
margin-left: ${align === "center" || align === "left" ? "auto" : "30px"};
|
|
118
111
|
|
|
119
112
|
${isNotification && css`
|
|
120
113
|
border: 1px solid var(--colorsSemanticInfo500);
|
|
@@ -134,8 +127,8 @@ const StyledToast = styled.div`
|
|
|
134
127
|
&${animationName}-enter${animationName}-enter-active {
|
|
135
128
|
opacity: 1;
|
|
136
129
|
transform: ${({
|
|
137
|
-
|
|
138
|
-
}) =>
|
|
130
|
+
align
|
|
131
|
+
}) => align === "center" ? " scale(1) translateY(0)" : "scale(1)"};
|
|
139
132
|
transition: all 300ms cubic-bezier(0.25, 0.25, 0, 1.5);
|
|
140
133
|
}
|
|
141
134
|
|
|
@@ -225,16 +218,6 @@ const ToastWrapper = styled.div`
|
|
|
225
218
|
display: flex;
|
|
226
219
|
`}
|
|
227
220
|
|
|
228
|
-
${({
|
|
229
|
-
isCenter
|
|
230
|
-
}) => isCenter && css`
|
|
231
|
-
position: relative;
|
|
232
|
-
width: auto;
|
|
233
|
-
height: auto;
|
|
234
|
-
justify-content: center;
|
|
235
|
-
display: flex;
|
|
236
|
-
`}
|
|
237
|
-
|
|
238
221
|
${({
|
|
239
222
|
isNotice
|
|
240
223
|
}) => isNotice && css`
|
|
@@ -28,6 +28,8 @@ export interface TypographyProps extends SpaceProps, TagProps {
|
|
|
28
28
|
listStyleType?: string;
|
|
29
29
|
/** Override the white-space */
|
|
30
30
|
whiteSpace?: string;
|
|
31
|
+
/** Override the word-break */
|
|
32
|
+
wordBreak?: string;
|
|
31
33
|
/** Override the word-wrap */
|
|
32
34
|
wordWrap?: string;
|
|
33
35
|
/** Override the text-align */
|
|
@@ -59,7 +61,7 @@ export interface TypographyProps extends SpaceProps, TagProps {
|
|
|
59
61
|
"aria-hidden"?: "true" | "false";
|
|
60
62
|
}
|
|
61
63
|
export declare const Typography: {
|
|
62
|
-
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, className, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, ...rest }: TypographyProps): React.JSX.Element;
|
|
64
|
+
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordBreak, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, className, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, ...rest }: TypographyProps): React.JSX.Element;
|
|
63
65
|
displayName: string;
|
|
64
66
|
};
|
|
65
67
|
export default Typography;
|
|
@@ -18,6 +18,7 @@ export const Typography = ({
|
|
|
18
18
|
display,
|
|
19
19
|
listStyleType,
|
|
20
20
|
whiteSpace,
|
|
21
|
+
wordBreak,
|
|
21
22
|
wordWrap,
|
|
22
23
|
textAlign,
|
|
23
24
|
textOverflow,
|
|
@@ -46,6 +47,7 @@ export const Typography = ({
|
|
|
46
47
|
listStyleType: listStyleType,
|
|
47
48
|
whiteSpace: whiteSpace,
|
|
48
49
|
wordWrap: wordWrap,
|
|
50
|
+
wordBreak: wordBreak,
|
|
49
51
|
textAlign: textAlign,
|
|
50
52
|
textOverflow: textOverflow,
|
|
51
53
|
truncate: truncate,
|
|
@@ -151,6 +151,7 @@ const StyledTypography = styled.span.attrs(({
|
|
|
151
151
|
variant,
|
|
152
152
|
listStyleType,
|
|
153
153
|
whiteSpace,
|
|
154
|
+
wordBreak,
|
|
154
155
|
wordWrap,
|
|
155
156
|
textAlign,
|
|
156
157
|
textOverflow,
|
|
@@ -166,6 +167,7 @@ const StyledTypography = styled.span.attrs(({
|
|
|
166
167
|
margin: ${defaultMargin};
|
|
167
168
|
padding: 0;
|
|
168
169
|
white-space: ${truncate ? "nowrap" : whiteSpace};
|
|
170
|
+
word-break: ${wordBreak};
|
|
169
171
|
word-wrap: ${wordWrap};
|
|
170
172
|
text-align: ${textAlign};
|
|
171
173
|
text-overflow: ${textOverflow || truncate && "ellipsis"};
|
|
@@ -12,7 +12,7 @@ declare type StyledHeadingTitleProps = {
|
|
|
12
12
|
withMargin?: boolean;
|
|
13
13
|
};
|
|
14
14
|
declare const StyledHeadingTitle: import("styled-components").StyledComponent<{
|
|
15
|
-
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, className, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, ...rest }: import("../typography").TypographyProps): import("react").JSX.Element;
|
|
15
|
+
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordBreak, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, className, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, ...rest }: import("../typography").TypographyProps): import("react").JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
}, any, StyledHeadingTitleProps, never>;
|
|
18
18
|
declare const StyledHeadingPills: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { LoaderSpinnerProps } from "./loader-spinner.component";
|
|
3
3
|
export declare const StyledSpinnerWrapper: import("styled-components").StyledComponent<"div", any, Pick<LoaderSpinnerProps, "size">, never>;
|
|
4
4
|
export declare const StyledLabel: import("styled-components").StyledComponent<{
|
|
5
|
-
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, className, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, ...rest }: import("../typography").TypographyProps): import("react").JSX.Element;
|
|
5
|
+
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordBreak, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, className, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, ...rest }: import("../typography").TypographyProps): import("react").JSX.Element;
|
|
6
6
|
displayName: string;
|
|
7
7
|
}, any, Required<Pick<LoaderSpinnerProps, "size">>, never>;
|
|
8
8
|
interface StyledSpinnerCircleSvgProps extends Omit<LoaderSpinnerProps, "showSpinnerLabel"> {
|
|
@@ -69,6 +69,7 @@ const Portal = ({
|
|
|
69
69
|
node = document.createElement("div");
|
|
70
70
|
node.classList.add(portalClassName);
|
|
71
71
|
node.setAttribute("data-portal-exit", uniqueId);
|
|
72
|
+
node.setAttribute("data-role", "carbon-portal-exit");
|
|
72
73
|
if (id !== undefined) {
|
|
73
74
|
node.setAttribute("id", id);
|
|
74
75
|
}
|
|
@@ -26,8 +26,6 @@ export interface ToastProps {
|
|
|
26
26
|
closeButtonDataProps?: Pick<TagProps, "data-role" | "data-element">;
|
|
27
27
|
/** Time for Toast to remain on screen */
|
|
28
28
|
timeout?: string | number;
|
|
29
|
-
/** Centers the Toast on the screen */
|
|
30
|
-
isCenter?: boolean;
|
|
31
29
|
/** Target Portal ID where the Toast will render */
|
|
32
30
|
targetPortalId?: string;
|
|
33
31
|
/** Maximum toast width */
|
|
@@ -14,19 +14,16 @@ var _iconButton = _interopRequireDefault(require("../icon-button"));
|
|
|
14
14
|
var _events = _interopRequireDefault(require("../../__internal__/utils/helpers/events"));
|
|
15
15
|
var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
|
|
16
16
|
var _useModalManager = _interopRequireDefault(require("../../hooks/__internal__/useModalManager"));
|
|
17
|
-
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
18
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
20
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
22
|
-
let isDeprecationWarningTriggered = false;
|
|
23
21
|
const Toast = exports.Toast = /*#__PURE__*/_react.default.forwardRef(({
|
|
24
|
-
align,
|
|
22
|
+
align = "center",
|
|
25
23
|
alignY,
|
|
26
24
|
children,
|
|
27
25
|
className,
|
|
28
26
|
id,
|
|
29
|
-
isCenter = true,
|
|
30
27
|
maxWidth,
|
|
31
28
|
onDismiss,
|
|
32
29
|
open = true,
|
|
@@ -50,10 +47,6 @@ const Toast = exports.Toast = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
50
47
|
if (ref && typeof ref === "object" && "current" in ref) {
|
|
51
48
|
refToPass = ref;
|
|
52
49
|
}
|
|
53
|
-
if (isCenter !== undefined && !isDeprecationWarningTriggered) {
|
|
54
|
-
isDeprecationWarningTriggered = true;
|
|
55
|
-
_logger.default.deprecate(`isCenter prop in ${Toast.displayName} is being deprecated in favour of the align prop.`);
|
|
56
|
-
}
|
|
57
50
|
const dismissToast = (0, _react.useCallback)(ev => {
|
|
58
51
|
if (onDismiss && _events.default.isEscKey(ev)) {
|
|
59
52
|
ev.stopImmediatePropagation();
|
|
@@ -140,7 +133,6 @@ const Toast = exports.Toast = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
140
133
|
isNotification: isNotification,
|
|
141
134
|
className: className
|
|
142
135
|
}, (0, _tags.default)(restProps["data-component"] || "toast", restProps), {
|
|
143
|
-
isCenter: isCenter,
|
|
144
136
|
variant: toastVariant,
|
|
145
137
|
id: id,
|
|
146
138
|
maxWidth: maxWidth,
|
|
@@ -149,25 +141,26 @@ const Toast = exports.Toast = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
149
141
|
tabIndex,
|
|
150
142
|
onBlur: () => setTabIndex(undefined)
|
|
151
143
|
}), !isNotice && /*#__PURE__*/_react.default.createElement(_toast.TypeIcon, {
|
|
152
|
-
variant: isNotification ? "info" : variant
|
|
144
|
+
variant: isNotification ? "info" : variant,
|
|
145
|
+
"data-role": "toast-type-icon"
|
|
153
146
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
154
147
|
type: toastIcon
|
|
155
148
|
})), /*#__PURE__*/_react.default.createElement(_toast.StyledToastContent, {
|
|
156
149
|
isNotice: isNotice,
|
|
157
|
-
isDismiss: !!onDismiss
|
|
150
|
+
isDismiss: !!onDismiss,
|
|
151
|
+
"data-role": "toast-content"
|
|
158
152
|
}, children), renderCloseIcon()));
|
|
159
153
|
}
|
|
160
154
|
return /*#__PURE__*/_react.default.createElement(_toast.StyledPortal, {
|
|
161
155
|
id: targetPortalId,
|
|
162
156
|
align: align,
|
|
163
157
|
alignY: alignY,
|
|
164
|
-
isCenter: isCenter,
|
|
165
158
|
isNotice: isNotice
|
|
166
159
|
}, /*#__PURE__*/_react.default.createElement(_toast.ToastWrapper, {
|
|
167
160
|
align: align,
|
|
168
|
-
isCenter: isCenter,
|
|
169
161
|
ref: refToPass,
|
|
170
|
-
isNotice: isNotice
|
|
162
|
+
isNotice: isNotice,
|
|
163
|
+
"data-role": "toast-wrapper"
|
|
171
164
|
}, /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.TransitionGroup, null, renderToastContent())));
|
|
172
165
|
});
|
|
173
166
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -183,7 +176,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
183
176
|
"data-component": _propTypes.default.string,
|
|
184
177
|
"disableAutoFocus": _propTypes.default.bool,
|
|
185
178
|
"id": _propTypes.default.string,
|
|
186
|
-
"isCenter": _propTypes.default.bool,
|
|
187
179
|
"maxWidth": _propTypes.default.string,
|
|
188
180
|
"onDismiss": _propTypes.default.func,
|
|
189
181
|
"open": _propTypes.default.bool,
|
|
@@ -4,7 +4,6 @@ import { MessageVariant } from "../message/message.component";
|
|
|
4
4
|
declare const StyledPortal: import("styled-components").StyledComponent<({ children, className, id, onReposition, inertOptOut, }: import("../portal/portal").PortalProps) => import("react").JSX.Element, any, {
|
|
5
5
|
align?: "left" | "right" | "center" | undefined;
|
|
6
6
|
alignY?: "bottom" | "top" | "center" | undefined;
|
|
7
|
-
isCenter?: boolean | undefined;
|
|
8
7
|
isNotice?: boolean | undefined;
|
|
9
8
|
}, never>;
|
|
10
9
|
declare type ToastVariants = MessageVariant;
|
|
@@ -12,7 +11,6 @@ declare type ToastStyleProps = {
|
|
|
12
11
|
align?: "left" | "center" | "right";
|
|
13
12
|
alignY?: "top" | "center" | "bottom";
|
|
14
13
|
maxWidth?: string;
|
|
15
|
-
isCenter?: boolean;
|
|
16
14
|
isNotice?: boolean;
|
|
17
15
|
isNotification?: boolean;
|
|
18
16
|
variant: ToastVariants;
|
|
@@ -24,7 +22,6 @@ declare const StyledToastContent: import("styled-components").StyledComponent<"d
|
|
|
24
22
|
}, never>;
|
|
25
23
|
declare const ToastWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
26
24
|
align?: "left" | "right" | "center" | undefined;
|
|
27
|
-
isCenter?: boolean | undefined;
|
|
28
25
|
isNotice?: boolean | undefined;
|
|
29
26
|
}, never>;
|
|
30
27
|
export { StyledPortal, StyledToast, TypeIcon, StyledToastContent, ToastWrapper, };
|
|
@@ -22,7 +22,6 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
22
22
|
const StyledPortal = exports.StyledPortal = (0, _styledComponents.default)(_portal.default)`
|
|
23
23
|
${({
|
|
24
24
|
theme,
|
|
25
|
-
isCenter,
|
|
26
25
|
isNotice,
|
|
27
26
|
align,
|
|
28
27
|
alignY
|
|
@@ -31,11 +30,6 @@ const StyledPortal = exports.StyledPortal = (0, _styledComponents.default)(_port
|
|
|
31
30
|
top: 0;
|
|
32
31
|
z-index: ${theme.zIndex.notification};
|
|
33
32
|
|
|
34
|
-
${isCenter && (0, _styledComponents.css)`
|
|
35
|
-
margin-left: 50%;
|
|
36
|
-
transform: translateX(-50%);
|
|
37
|
-
`}
|
|
38
|
-
|
|
39
33
|
${align === "left" && (0, _styledComponents.css)`
|
|
40
34
|
left: 0;
|
|
41
35
|
transform: translateX(50%);
|
|
@@ -97,7 +91,6 @@ const iconPositionStyles = (0, _styledComponents.css)`
|
|
|
97
91
|
const StyledToast = exports.StyledToast = _styledComponents.default.div`
|
|
98
92
|
${({
|
|
99
93
|
maxWidth,
|
|
100
|
-
isCenter,
|
|
101
94
|
align,
|
|
102
95
|
isNotification,
|
|
103
96
|
alignY,
|
|
@@ -128,8 +121,8 @@ const StyledToast = exports.StyledToast = _styledComponents.default.div`
|
|
|
128
121
|
margin-bottom: ${alignY === "bottom" && !isNotice ? "30px" : "0"};
|
|
129
122
|
max-width: ${!maxWidth ? "300px" : maxWidth};
|
|
130
123
|
position: relative;
|
|
131
|
-
margin-right: ${
|
|
132
|
-
margin-left: ${
|
|
124
|
+
margin-right: ${align === "center" || align === "right" ? "auto" : "30px"};
|
|
125
|
+
margin-left: ${align === "center" || align === "left" ? "auto" : "30px"};
|
|
133
126
|
|
|
134
127
|
${isNotification && (0, _styledComponents.css)`
|
|
135
128
|
border: 1px solid var(--colorsSemanticInfo500);
|
|
@@ -149,8 +142,8 @@ const StyledToast = exports.StyledToast = _styledComponents.default.div`
|
|
|
149
142
|
&${animationName}-enter${animationName}-enter-active {
|
|
150
143
|
opacity: 1;
|
|
151
144
|
transform: ${({
|
|
152
|
-
|
|
153
|
-
}) =>
|
|
145
|
+
align
|
|
146
|
+
}) => align === "center" ? " scale(1) translateY(0)" : "scale(1)"};
|
|
154
147
|
transition: all 300ms cubic-bezier(0.25, 0.25, 0, 1.5);
|
|
155
148
|
}
|
|
156
149
|
|
|
@@ -240,16 +233,6 @@ const ToastWrapper = exports.ToastWrapper = _styledComponents.default.div`
|
|
|
240
233
|
display: flex;
|
|
241
234
|
`}
|
|
242
235
|
|
|
243
|
-
${({
|
|
244
|
-
isCenter
|
|
245
|
-
}) => isCenter && (0, _styledComponents.css)`
|
|
246
|
-
position: relative;
|
|
247
|
-
width: auto;
|
|
248
|
-
height: auto;
|
|
249
|
-
justify-content: center;
|
|
250
|
-
display: flex;
|
|
251
|
-
`}
|
|
252
|
-
|
|
253
236
|
${({
|
|
254
237
|
isNotice
|
|
255
238
|
}) => isNotice && (0, _styledComponents.css)`
|
|
@@ -28,6 +28,8 @@ export interface TypographyProps extends SpaceProps, TagProps {
|
|
|
28
28
|
listStyleType?: string;
|
|
29
29
|
/** Override the white-space */
|
|
30
30
|
whiteSpace?: string;
|
|
31
|
+
/** Override the word-break */
|
|
32
|
+
wordBreak?: string;
|
|
31
33
|
/** Override the word-wrap */
|
|
32
34
|
wordWrap?: string;
|
|
33
35
|
/** Override the text-align */
|
|
@@ -59,7 +61,7 @@ export interface TypographyProps extends SpaceProps, TagProps {
|
|
|
59
61
|
"aria-hidden"?: "true" | "false";
|
|
60
62
|
}
|
|
61
63
|
export declare const Typography: {
|
|
62
|
-
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, className, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, ...rest }: TypographyProps): React.JSX.Element;
|
|
64
|
+
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordBreak, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, className, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, ...rest }: TypographyProps): React.JSX.Element;
|
|
63
65
|
displayName: string;
|
|
64
66
|
};
|
|
65
67
|
export default Typography;
|
|
@@ -25,6 +25,7 @@ const Typography = ({
|
|
|
25
25
|
display,
|
|
26
26
|
listStyleType,
|
|
27
27
|
whiteSpace,
|
|
28
|
+
wordBreak,
|
|
28
29
|
wordWrap,
|
|
29
30
|
textAlign,
|
|
30
31
|
textOverflow,
|
|
@@ -53,6 +54,7 @@ const Typography = ({
|
|
|
53
54
|
listStyleType: listStyleType,
|
|
54
55
|
whiteSpace: whiteSpace,
|
|
55
56
|
wordWrap: wordWrap,
|
|
57
|
+
wordBreak: wordBreak,
|
|
56
58
|
textAlign: textAlign,
|
|
57
59
|
textOverflow: textOverflow,
|
|
58
60
|
truncate: truncate,
|
|
@@ -160,6 +160,7 @@ const StyledTypography = _styledComponents.default.span.attrs(({
|
|
|
160
160
|
variant,
|
|
161
161
|
listStyleType,
|
|
162
162
|
whiteSpace,
|
|
163
|
+
wordBreak,
|
|
163
164
|
wordWrap,
|
|
164
165
|
textAlign,
|
|
165
166
|
textOverflow,
|
|
@@ -175,6 +176,7 @@ const StyledTypography = _styledComponents.default.span.attrs(({
|
|
|
175
176
|
margin: ${defaultMargin};
|
|
176
177
|
padding: 0;
|
|
177
178
|
white-space: ${truncate ? "nowrap" : whiteSpace};
|
|
179
|
+
word-break: ${wordBreak};
|
|
178
180
|
word-wrap: ${wordWrap};
|
|
179
181
|
text-align: ${textAlign};
|
|
180
182
|
text-overflow: ${textOverflow || truncate && "ellipsis"};
|
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
|
|
3
|
-
export interface CarouselProps extends TagProps {
|
|
4
|
-
/** Individual tabs */
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
/** [legacy] Custom className */
|
|
7
|
-
className?: string;
|
|
8
|
-
/** Enables the next button */
|
|
9
|
-
enableNextButton?: boolean;
|
|
10
|
-
/** Enables the previous button */
|
|
11
|
-
enablePreviousButton?: boolean;
|
|
12
|
-
/** Enables the slide selector */
|
|
13
|
-
enableSlideSelector?: boolean;
|
|
14
|
-
/** The selected tab on page load */
|
|
15
|
-
initialSlideIndex?: number | string;
|
|
16
|
-
/** Action to be called on slide change */
|
|
17
|
-
onSlideChange?: (index: number, transitionDirection: string) => void;
|
|
18
|
-
/** The selected slide */
|
|
19
|
-
slideIndex?: number | string;
|
|
20
|
-
}
|
|
21
|
-
export declare const Carousel: {
|
|
22
|
-
({ children, className, enableSlideSelector, enablePreviousButton, enableNextButton, initialSlideIndex, onSlideChange, slideIndex, ...props }: CarouselProps): React.JSX.Element;
|
|
23
|
-
displayName: string;
|
|
24
|
-
};
|
|
25
|
-
export default Carousel;
|