carbon-react 110.4.1 → 110.5.2
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/flat-table/flat-table-header/flat-table-header-utils.js +18 -0
- package/esm/components/flat-table/flat-table-header/flat-table-header.component.js +6 -1
- package/esm/components/flat-table/flat-table-header/flat-table-header.style.js +7 -5
- package/esm/components/icon/icon.component.js +22 -9
- package/esm/components/message/index.d.ts +2 -1
- package/esm/components/message/message-content/message-content.component.d.ts +9 -0
- package/esm/components/message/message-content/message-content.component.js +4 -5
- package/esm/components/message/message-content/message-content.style.d.ts +2 -0
- package/esm/components/message/message-content/message-content.style.js +0 -3
- package/esm/components/message/message.component.d.ts +27 -0
- package/esm/components/message/message.component.js +169 -37
- package/esm/components/message/message.style.d.ts +8 -0
- package/esm/components/message/message.style.js +1 -8
- package/esm/components/message/type-icon/type-icon.component.d.ts +10 -0
- package/esm/components/message/type-icon/type-icon.component.js +4 -8
- package/esm/components/message/type-icon/type-icon.style.d.ts +9 -0
- package/esm/components/message/type-icon/type-icon.style.js +0 -10
- package/esm/components/search/search.component.js +28 -2
- package/esm/components/search/search.d.ts +3 -1
- package/esm/components/sidebar/__internal__/sidebar-header/index.d.ts +1 -0
- package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +9 -0
- package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +7 -18
- package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.style.d.ts +2 -0
- package/esm/components/sidebar/index.d.ts +2 -1
- package/esm/components/sidebar/index.js +1 -2
- package/esm/components/sidebar/sidebar.component.d.ts +44 -0
- package/esm/components/sidebar/sidebar.component.js +187 -48
- package/esm/components/sidebar/sidebar.config.d.ts +11 -0
- package/esm/components/sidebar/sidebar.style.d.ts +8 -0
- package/esm/components/step-sequence/index.d.ts +4 -2
- package/esm/components/step-sequence/step-sequence-item/index.d.ts +2 -0
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.component.d.ts +19 -0
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.component.js +26 -41
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.d.ts +9 -0
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.js +18 -2
- package/esm/components/step-sequence/step-sequence.component.d.ts +13 -0
- package/esm/components/step-sequence/step-sequence.component.js +170 -18
- package/esm/components/step-sequence/step-sequence.config.d.ts +2 -0
- package/esm/components/step-sequence/step-sequence.style.d.ts +4 -0
- package/esm/components/tabs/__internal__/tab-title/tab-title.component.d.ts +4 -0
- package/esm/components/tabs/__internal__/tab-title/tab-title.component.js +34 -4
- package/esm/components/tabs/__internal__/tab-title/tab-title.d.ts +6 -0
- package/esm/components/tabs/__internal__/tab-title/tab-title.style.d.ts +4 -0
- package/lib/components/flat-table/flat-table-header/flat-table-header-utils.js +26 -0
- package/lib/components/flat-table/flat-table-header/flat-table-header.component.js +6 -0
- package/lib/components/flat-table/flat-table-header/flat-table-header.style.js +10 -5
- package/lib/components/icon/icon.component.js +22 -8
- package/lib/components/message/index.d.ts +2 -1
- package/lib/components/message/message-content/message-content.component.d.ts +9 -0
- package/lib/components/message/message-content/message-content.component.js +5 -6
- package/lib/components/message/message-content/message-content.style.d.ts +2 -0
- package/lib/components/message/message-content/message-content.style.js +0 -4
- package/lib/components/message/message.component.d.ts +27 -0
- package/lib/components/message/message.component.js +170 -40
- package/lib/components/message/message.style.d.ts +8 -0
- package/lib/components/message/message.style.js +1 -9
- package/lib/components/message/type-icon/type-icon.component.d.ts +10 -0
- package/lib/components/message/type-icon/type-icon.component.js +4 -8
- package/lib/components/message/type-icon/type-icon.style.d.ts +9 -0
- package/lib/components/message/type-icon/type-icon.style.js +0 -13
- package/lib/components/search/search.component.js +28 -2
- package/lib/components/search/search.d.ts +3 -1
- package/lib/components/sidebar/__internal__/sidebar-header/index.d.ts +1 -0
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +9 -0
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +7 -19
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.style.d.ts +2 -0
- package/lib/components/sidebar/index.d.ts +2 -1
- package/lib/components/sidebar/sidebar.component.d.ts +44 -0
- package/lib/components/sidebar/sidebar.component.js +187 -50
- package/lib/components/sidebar/sidebar.config.d.ts +11 -0
- package/lib/components/sidebar/sidebar.style.d.ts +8 -0
- package/lib/components/step-sequence/index.d.ts +4 -2
- package/lib/components/step-sequence/step-sequence-item/index.d.ts +2 -0
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.component.d.ts +19 -0
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.component.js +30 -48
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.d.ts +9 -0
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.js +22 -3
- package/lib/components/step-sequence/step-sequence.component.d.ts +13 -0
- package/lib/components/step-sequence/step-sequence.component.js +171 -21
- package/lib/components/step-sequence/step-sequence.config.d.ts +2 -0
- package/lib/components/step-sequence/step-sequence.style.d.ts +4 -0
- package/lib/components/tabs/__internal__/tab-title/tab-title.component.d.ts +4 -0
- package/lib/components/tabs/__internal__/tab-title/tab-title.component.js +38 -4
- package/lib/components/tabs/__internal__/tab-title/tab-title.d.ts +6 -0
- package/lib/components/tabs/__internal__/tab-title/tab-title.style.d.ts +4 -0
- package/package.json +1 -1
- package/esm/components/message/message.d.ts +0 -29
- package/esm/components/sidebar/__internal__/sidebar-header/__definition__.js +0 -13
- package/esm/components/sidebar/sidebar.d.ts +0 -57
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item-content.style.js +0 -5
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item-hidden-label.style.js +0 -9
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item-indicator.style.js +0 -9
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.d.ts +0 -22
- package/esm/components/step-sequence/step-sequence.d.ts +0 -12
- package/lib/components/message/message.d.ts +0 -29
- package/lib/components/sidebar/__internal__/sidebar-header/__definition__.js +0 -25
- package/lib/components/sidebar/sidebar.d.ts +0 -57
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item-content.style.js +0 -16
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item-hidden-label.style.js +0 -20
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item-indicator.style.js +0 -20
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.d.ts +0 -22
- package/lib/components/step-sequence/step-sequence.d.ts +0 -12
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const getAlternativeBackgroundColor = colorTheme => {
|
|
2
|
+
switch (colorTheme) {
|
|
3
|
+
case "light":
|
|
4
|
+
return "var(--colorsActionMinor100)";
|
|
5
|
+
|
|
6
|
+
case "transparent-base":
|
|
7
|
+
return "var(--colorsUtilityMajor025)";
|
|
8
|
+
|
|
9
|
+
case "transparent-white":
|
|
10
|
+
return "var(--colorsUtilityYang100)";
|
|
11
|
+
// default theme is "dark"
|
|
12
|
+
|
|
13
|
+
default:
|
|
14
|
+
return "var(--colorsActionMinor550)";
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default getAlternativeBackgroundColor;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
-
import React, { useLayoutEffect, useRef } from "react";
|
|
3
|
+
import React, { useLayoutEffect, useRef, useContext } from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import styledSystemPropTypes from "@styled-system/prop-types";
|
|
6
6
|
import StyledFlatTableHeader from "./flat-table-header.style";
|
|
7
7
|
import { filterStyledSystemPaddingProps } from "../../../style/utils";
|
|
8
|
+
import { FlatTableThemeContext } from "../flat-table.component";
|
|
8
9
|
const paddingPropTypes = filterStyledSystemPaddingProps(styledSystemPropTypes.space);
|
|
9
10
|
|
|
10
11
|
const FlatTableHeader = ({
|
|
@@ -21,6 +22,9 @@ const FlatTableHeader = ({
|
|
|
21
22
|
...rest
|
|
22
23
|
}) => {
|
|
23
24
|
const ref = useRef(null);
|
|
25
|
+
const {
|
|
26
|
+
colorTheme
|
|
27
|
+
} = useContext(FlatTableThemeContext);
|
|
24
28
|
useLayoutEffect(() => {
|
|
25
29
|
if (ref.current && reportCellWidth) {
|
|
26
30
|
reportCellWidth(ref.current.offsetWidth, cellIndex);
|
|
@@ -31,6 +35,7 @@ const FlatTableHeader = ({
|
|
|
31
35
|
leftPosition: leftPosition || 0,
|
|
32
36
|
makeCellSticky: !!reportCellWidth,
|
|
33
37
|
align: align,
|
|
38
|
+
colorTheme: colorTheme,
|
|
34
39
|
"data-element": "flat-table-header",
|
|
35
40
|
colSpan: colspan,
|
|
36
41
|
rowSpan: rowspan,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import { padding } from "styled-system";
|
|
3
|
+
import getAlternativeBackgroundColor from "./flat-table-header-utils";
|
|
3
4
|
const verticalBorderSizes = {
|
|
4
5
|
small: "1px",
|
|
5
6
|
medium: "2px",
|
|
@@ -12,7 +13,8 @@ const StyledFlatTableHeader = styled.th`
|
|
|
12
13
|
colWidth,
|
|
13
14
|
leftPosition,
|
|
14
15
|
makeCellSticky,
|
|
15
|
-
verticalBorder
|
|
16
|
+
verticalBorder,
|
|
17
|
+
colorTheme
|
|
16
18
|
}) => css`
|
|
17
19
|
background-color: transparent;
|
|
18
20
|
border-width: 0;
|
|
@@ -47,11 +49,11 @@ const StyledFlatTableHeader = styled.th`
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
${alternativeBgColor && css`
|
|
50
|
-
&&&:first-child {
|
|
51
|
-
border-left: 1px solid var(--colorsActionMinor550);
|
|
52
|
-
}
|
|
53
52
|
&&& {
|
|
54
|
-
background-color:
|
|
53
|
+
background-color: ${getAlternativeBackgroundColor(colorTheme)};
|
|
54
|
+
}
|
|
55
|
+
&&&:first-child {
|
|
56
|
+
border-left: unset;
|
|
55
57
|
}
|
|
56
58
|
`};
|
|
57
59
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useContext } from "react";
|
|
1
|
+
import React, { useContext, useMemo } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import invariant from "invariant";
|
|
4
4
|
import Tooltip from "../tooltip";
|
|
@@ -7,6 +7,7 @@ import { TooltipContext } from "../../__internal__/tooltip-provider";
|
|
|
7
7
|
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
8
8
|
import StyledIcon from "./icon.style";
|
|
9
9
|
import { ICON_TOOLTIP_POSITIONS } from "./icon-config";
|
|
10
|
+
import { TabTitleContext } from "../tabs/__internal__/tab-title/tab-title.component";
|
|
10
11
|
const Icon = /*#__PURE__*/React.forwardRef(({
|
|
11
12
|
"aria-hidden": ariaHidden,
|
|
12
13
|
ariaLabel,
|
|
@@ -47,9 +48,12 @@ const Icon = /*#__PURE__*/React.forwardRef(({
|
|
|
47
48
|
disabled: disabledFromContext,
|
|
48
49
|
target
|
|
49
50
|
} = useContext(TooltipContext);
|
|
51
|
+
const {
|
|
52
|
+
isInTab
|
|
53
|
+
} = useContext(TabTitleContext);
|
|
50
54
|
/** Return Icon type with overrides */
|
|
51
55
|
|
|
52
|
-
const iconType = () => {
|
|
56
|
+
const iconType = useMemo(() => {
|
|
53
57
|
// switch tweaks icon names for actual icons in the set
|
|
54
58
|
switch (type) {
|
|
55
59
|
case "help":
|
|
@@ -71,10 +75,16 @@ const Icon = /*#__PURE__*/React.forwardRef(({
|
|
|
71
75
|
default:
|
|
72
76
|
return type;
|
|
73
77
|
}
|
|
74
|
-
};
|
|
75
|
-
|
|
78
|
+
}, [type]);
|
|
76
79
|
const isFocusable = focusableFromContext !== undefined ? focusableFromContext : focusable;
|
|
77
80
|
const hasTooltip = !disabled && !disabledFromContext && !!tooltipMessage && isFocusable;
|
|
81
|
+
const computedTabIndex = useMemo(() => {
|
|
82
|
+
if (isInTab) {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return hasTooltip && tabIndex === undefined ? 0 : tabIndex;
|
|
87
|
+
}, [isInTab, hasTooltip, tabIndex]);
|
|
78
88
|
const styledIconProps = {
|
|
79
89
|
"aria-hidden": ariaHidden,
|
|
80
90
|
"aria-label": ariaLabel,
|
|
@@ -83,7 +93,7 @@ const Icon = /*#__PURE__*/React.forwardRef(({
|
|
|
83
93
|
bgShape,
|
|
84
94
|
className: className || undefined,
|
|
85
95
|
color,
|
|
86
|
-
"data-element": iconType
|
|
96
|
+
"data-element": iconType,
|
|
87
97
|
disabled: disabledFromContext || disabled,
|
|
88
98
|
fontSize,
|
|
89
99
|
hasTooltip,
|
|
@@ -92,15 +102,18 @@ const Icon = /*#__PURE__*/React.forwardRef(({
|
|
|
92
102
|
key: "icon",
|
|
93
103
|
ref,
|
|
94
104
|
role,
|
|
95
|
-
tabIndex:
|
|
96
|
-
type: iconType
|
|
105
|
+
tabIndex: computedTabIndex,
|
|
106
|
+
type: iconType,
|
|
97
107
|
...tagComponent("icon", rest),
|
|
98
108
|
...filterStyledSystemMarginProps(rest)
|
|
99
109
|
};
|
|
100
110
|
|
|
111
|
+
const shouldShowTooltip = () => {
|
|
112
|
+
return tooltipVisibleFromContext !== undefined ? tooltipVisibleFromContext : tooltipVisible;
|
|
113
|
+
};
|
|
114
|
+
|
|
101
115
|
if (tooltipMessage) {
|
|
102
|
-
const
|
|
103
|
-
const visible = disabled ? undefined : showTooltip;
|
|
116
|
+
const visible = disabled ? undefined : shouldShowTooltip();
|
|
104
117
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
105
118
|
message: tooltipMessage,
|
|
106
119
|
position: tooltipPositionFromContext || tooltipPosition,
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from "./message";
|
|
1
|
+
export { default } from "./message.component";
|
|
2
|
+
export type { MessageProps } from "./message.component";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface MessageContentProps {
|
|
3
|
+
/** set message title */
|
|
4
|
+
title?: React.ReactNode;
|
|
5
|
+
/** set content to component */
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const MessageContent: ({ title, children }: MessageContentProps) => JSX.Element;
|
|
9
|
+
export default MessageContent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
|
-
import Content from "../../content
|
|
3
|
+
import Content from "../../content";
|
|
4
4
|
import MessageContentStyle from "./message-content.style";
|
|
5
5
|
|
|
6
6
|
const MessageContent = ({
|
|
@@ -8,13 +8,12 @@ const MessageContent = ({
|
|
|
8
8
|
children
|
|
9
9
|
}) => {
|
|
10
10
|
return /*#__PURE__*/React.createElement(MessageContentStyle, null, /*#__PURE__*/React.createElement(Content, {
|
|
11
|
-
title: title
|
|
12
|
-
className: "message-content"
|
|
11
|
+
title: title
|
|
13
12
|
}, children));
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
MessageContent.propTypes = {
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
"children": PropTypes.node,
|
|
17
|
+
"title": PropTypes.node
|
|
19
18
|
};
|
|
20
19
|
export default MessageContent;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
-
import { margin } from "styled-system";
|
|
3
2
|
const MessageContentStyle = styled.div`
|
|
4
3
|
padding: 15px 50px 15px 20px;
|
|
5
4
|
white-space: pre-wrap;
|
|
@@ -12,7 +11,5 @@ const MessageContentStyle = styled.div`
|
|
|
12
11
|
.carbon-content__body {
|
|
13
12
|
margin-top: 0px;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
${margin}
|
|
17
14
|
`;
|
|
18
15
|
export default MessageContentStyle;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
3
|
+
export declare type MessageVariant = "error" | "info" | "success" | "warning";
|
|
4
|
+
export interface MessageProps extends MarginProps {
|
|
5
|
+
/** set content to component */
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/** set custom class to component */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** set custom aria label for message close button */
|
|
10
|
+
closeButtonAriaLabel?: string;
|
|
11
|
+
/** set custom id to component root */
|
|
12
|
+
id?: string;
|
|
13
|
+
/** function runs when user click dismiss button */
|
|
14
|
+
onDismiss?: (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>) => void;
|
|
15
|
+
/** show message component */
|
|
16
|
+
open?: boolean;
|
|
17
|
+
/** determines if the close icon is shown */
|
|
18
|
+
showCloseIcon?: boolean;
|
|
19
|
+
/** set message title */
|
|
20
|
+
title?: React.ReactNode;
|
|
21
|
+
/** set background to be invisible */
|
|
22
|
+
transparent?: boolean;
|
|
23
|
+
/** set type of message based on new DLS standard */
|
|
24
|
+
variant?: MessageVariant;
|
|
25
|
+
}
|
|
26
|
+
export declare const Message: ({ open, transparent, title, variant, children, onDismiss, id, className, closeButtonAriaLabel, showCloseIcon, ...props }: MessageProps) => JSX.Element | null;
|
|
27
|
+
export default Message;
|
|
@@ -2,7 +2,6 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import styledSystemPropTypes from "@styled-system/prop-types";
|
|
6
5
|
import MessageStyle from "./message.style";
|
|
7
6
|
import TypeIcon from "./type-icon/type-icon.component";
|
|
8
7
|
import MessageContent from "./message-content/message-content.component";
|
|
@@ -11,7 +10,6 @@ import Icon from "../icon";
|
|
|
11
10
|
import IconButton from "../icon-button";
|
|
12
11
|
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
13
12
|
import useLocale from "../../hooks/__internal__/useLocale";
|
|
14
|
-
const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
|
|
15
13
|
|
|
16
14
|
const Message = ({
|
|
17
15
|
open = true,
|
|
@@ -34,14 +32,13 @@ const Message = ({
|
|
|
34
32
|
return /*#__PURE__*/React.createElement(IconButton, {
|
|
35
33
|
"data-element": "close",
|
|
36
34
|
"aria-label": closeButtonAriaLabel || l.message.closeButtonAriaLabel(),
|
|
37
|
-
onAction: onDismiss
|
|
38
|
-
variant: variant
|
|
35
|
+
onAction: onDismiss
|
|
39
36
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
40
37
|
type: "close"
|
|
41
38
|
}));
|
|
42
39
|
};
|
|
43
40
|
|
|
44
|
-
return open
|
|
41
|
+
return open ? /*#__PURE__*/React.createElement(MessageStyle, _extends({}, tagComponent("Message", props), {
|
|
45
42
|
className: className,
|
|
46
43
|
transparent: transparent,
|
|
47
44
|
variant: variant,
|
|
@@ -52,39 +49,174 @@ const Message = ({
|
|
|
52
49
|
transparent: transparent
|
|
53
50
|
}), /*#__PURE__*/React.createElement(MessageContent, {
|
|
54
51
|
title: title
|
|
55
|
-
}, children), renderCloseIcon());
|
|
52
|
+
}, children), renderCloseIcon()) : null;
|
|
56
53
|
};
|
|
57
54
|
|
|
58
|
-
Message.propTypes = {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
55
|
+
Message.propTypes = {
|
|
56
|
+
"children": PropTypes.node,
|
|
57
|
+
"className": PropTypes.string,
|
|
58
|
+
"closeButtonAriaLabel": PropTypes.string,
|
|
59
|
+
"id": PropTypes.string,
|
|
60
|
+
"m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
61
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
62
|
+
"description": PropTypes.string,
|
|
63
|
+
"toString": PropTypes.func.isRequired,
|
|
64
|
+
"valueOf": PropTypes.func.isRequired
|
|
65
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
66
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
67
|
+
"description": PropTypes.string,
|
|
68
|
+
"toString": PropTypes.func.isRequired,
|
|
69
|
+
"valueOf": PropTypes.func.isRequired
|
|
70
|
+
}), PropTypes.string]),
|
|
71
|
+
"margin": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
72
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
73
|
+
"description": PropTypes.string,
|
|
74
|
+
"toString": PropTypes.func.isRequired,
|
|
75
|
+
"valueOf": PropTypes.func.isRequired
|
|
76
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
77
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
78
|
+
"description": PropTypes.string,
|
|
79
|
+
"toString": PropTypes.func.isRequired,
|
|
80
|
+
"valueOf": PropTypes.func.isRequired
|
|
81
|
+
}), PropTypes.string]),
|
|
82
|
+
"marginBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
83
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
84
|
+
"description": PropTypes.string,
|
|
85
|
+
"toString": PropTypes.func.isRequired,
|
|
86
|
+
"valueOf": PropTypes.func.isRequired
|
|
87
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
88
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
89
|
+
"description": PropTypes.string,
|
|
90
|
+
"toString": PropTypes.func.isRequired,
|
|
91
|
+
"valueOf": PropTypes.func.isRequired
|
|
92
|
+
}), PropTypes.string]),
|
|
93
|
+
"marginLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
94
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
95
|
+
"description": PropTypes.string,
|
|
96
|
+
"toString": PropTypes.func.isRequired,
|
|
97
|
+
"valueOf": PropTypes.func.isRequired
|
|
98
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
99
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
100
|
+
"description": PropTypes.string,
|
|
101
|
+
"toString": PropTypes.func.isRequired,
|
|
102
|
+
"valueOf": PropTypes.func.isRequired
|
|
103
|
+
}), PropTypes.string]),
|
|
104
|
+
"marginRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
105
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
106
|
+
"description": PropTypes.string,
|
|
107
|
+
"toString": PropTypes.func.isRequired,
|
|
108
|
+
"valueOf": PropTypes.func.isRequired
|
|
109
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
110
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
111
|
+
"description": PropTypes.string,
|
|
112
|
+
"toString": PropTypes.func.isRequired,
|
|
113
|
+
"valueOf": PropTypes.func.isRequired
|
|
114
|
+
}), PropTypes.string]),
|
|
115
|
+
"marginTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
116
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
117
|
+
"description": PropTypes.string,
|
|
118
|
+
"toString": PropTypes.func.isRequired,
|
|
119
|
+
"valueOf": PropTypes.func.isRequired
|
|
120
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
121
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
122
|
+
"description": PropTypes.string,
|
|
123
|
+
"toString": PropTypes.func.isRequired,
|
|
124
|
+
"valueOf": PropTypes.func.isRequired
|
|
125
|
+
}), PropTypes.string]),
|
|
126
|
+
"marginX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
127
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
128
|
+
"description": PropTypes.string,
|
|
129
|
+
"toString": PropTypes.func.isRequired,
|
|
130
|
+
"valueOf": PropTypes.func.isRequired
|
|
131
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
132
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
133
|
+
"description": PropTypes.string,
|
|
134
|
+
"toString": PropTypes.func.isRequired,
|
|
135
|
+
"valueOf": PropTypes.func.isRequired
|
|
136
|
+
}), PropTypes.string]),
|
|
137
|
+
"marginY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
138
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
139
|
+
"description": PropTypes.string,
|
|
140
|
+
"toString": PropTypes.func.isRequired,
|
|
141
|
+
"valueOf": PropTypes.func.isRequired
|
|
142
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
143
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
144
|
+
"description": PropTypes.string,
|
|
145
|
+
"toString": PropTypes.func.isRequired,
|
|
146
|
+
"valueOf": PropTypes.func.isRequired
|
|
147
|
+
}), PropTypes.string]),
|
|
148
|
+
"mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
149
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
150
|
+
"description": PropTypes.string,
|
|
151
|
+
"toString": PropTypes.func.isRequired,
|
|
152
|
+
"valueOf": PropTypes.func.isRequired
|
|
153
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
154
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
155
|
+
"description": PropTypes.string,
|
|
156
|
+
"toString": PropTypes.func.isRequired,
|
|
157
|
+
"valueOf": PropTypes.func.isRequired
|
|
158
|
+
}), PropTypes.string]),
|
|
159
|
+
"ml": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
160
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
161
|
+
"description": PropTypes.string,
|
|
162
|
+
"toString": PropTypes.func.isRequired,
|
|
163
|
+
"valueOf": PropTypes.func.isRequired
|
|
164
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
165
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
166
|
+
"description": PropTypes.string,
|
|
167
|
+
"toString": PropTypes.func.isRequired,
|
|
168
|
+
"valueOf": PropTypes.func.isRequired
|
|
169
|
+
}), PropTypes.string]),
|
|
170
|
+
"mr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
171
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
172
|
+
"description": PropTypes.string,
|
|
173
|
+
"toString": PropTypes.func.isRequired,
|
|
174
|
+
"valueOf": PropTypes.func.isRequired
|
|
175
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
176
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
177
|
+
"description": PropTypes.string,
|
|
178
|
+
"toString": PropTypes.func.isRequired,
|
|
179
|
+
"valueOf": PropTypes.func.isRequired
|
|
180
|
+
}), PropTypes.string]),
|
|
181
|
+
"mt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
182
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
183
|
+
"description": PropTypes.string,
|
|
184
|
+
"toString": PropTypes.func.isRequired,
|
|
185
|
+
"valueOf": PropTypes.func.isRequired
|
|
186
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
187
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
188
|
+
"description": PropTypes.string,
|
|
189
|
+
"toString": PropTypes.func.isRequired,
|
|
190
|
+
"valueOf": PropTypes.func.isRequired
|
|
191
|
+
}), PropTypes.string]),
|
|
192
|
+
"mx": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
193
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
194
|
+
"description": PropTypes.string,
|
|
195
|
+
"toString": PropTypes.func.isRequired,
|
|
196
|
+
"valueOf": PropTypes.func.isRequired
|
|
197
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
198
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
199
|
+
"description": PropTypes.string,
|
|
200
|
+
"toString": PropTypes.func.isRequired,
|
|
201
|
+
"valueOf": PropTypes.func.isRequired
|
|
202
|
+
}), PropTypes.string]),
|
|
203
|
+
"my": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
204
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
205
|
+
"description": PropTypes.string,
|
|
206
|
+
"toString": PropTypes.func.isRequired,
|
|
207
|
+
"valueOf": PropTypes.func.isRequired
|
|
208
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
209
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
210
|
+
"description": PropTypes.string,
|
|
211
|
+
"toString": PropTypes.func.isRequired,
|
|
212
|
+
"valueOf": PropTypes.func.isRequired
|
|
213
|
+
}), PropTypes.string]),
|
|
214
|
+
"onDismiss": PropTypes.func,
|
|
215
|
+
"open": PropTypes.bool,
|
|
216
|
+
"showCloseIcon": PropTypes.bool,
|
|
217
|
+
"title": PropTypes.node,
|
|
218
|
+
"transparent": PropTypes.bool,
|
|
219
|
+
"variant": PropTypes.oneOf(["error", "info", "success", "warning"])
|
|
89
220
|
};
|
|
221
|
+
export { Message };
|
|
90
222
|
export default Message;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MarginProps } from "styled-system";
|
|
2
|
+
import { MessageVariant } from "./message.component";
|
|
3
|
+
declare type MessageStyleProps = {
|
|
4
|
+
variant: MessageVariant;
|
|
5
|
+
transparent?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const MessageStyle: import("styled-components").StyledComponent<"div", any, MessageStyleProps & MarginProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>, never>;
|
|
8
|
+
export default MessageStyle;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
import { margin } from "styled-system";
|
|
4
3
|
import BaseTheme from "../../style/themes/base";
|
|
5
4
|
import StyledIconButton from "../icon-button/icon-button.style";
|
|
@@ -37,12 +36,6 @@ const MessageStyle = styled.div`
|
|
|
37
36
|
${margin}
|
|
38
37
|
`;
|
|
39
38
|
MessageStyle.defaultProps = {
|
|
40
|
-
|
|
41
|
-
theme: BaseTheme,
|
|
42
|
-
transparent: false
|
|
43
|
-
};
|
|
44
|
-
MessageStyle.propTypes = {
|
|
45
|
-
variant: PropTypes.string,
|
|
46
|
-
transparent: PropTypes.bool
|
|
39
|
+
theme: BaseTheme
|
|
47
40
|
};
|
|
48
41
|
export default MessageStyle;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MessageVariant } from "../message.component";
|
|
3
|
+
export interface TypeIconProps {
|
|
4
|
+
/** set background to be invisible */
|
|
5
|
+
transparent?: boolean;
|
|
6
|
+
/** set type of message based on new DLS standard */
|
|
7
|
+
variant?: MessageVariant;
|
|
8
|
+
}
|
|
9
|
+
declare const TypeIcon: ({ variant, transparent }: TypeIconProps) => JSX.Element;
|
|
10
|
+
export default TypeIcon;
|
|
@@ -4,8 +4,8 @@ import TypeIconStyle from "./type-icon.style";
|
|
|
4
4
|
import Icon from "../../icon";
|
|
5
5
|
|
|
6
6
|
const TypeIcon = ({
|
|
7
|
-
variant,
|
|
8
|
-
transparent
|
|
7
|
+
variant = "info",
|
|
8
|
+
transparent = false
|
|
9
9
|
}) => {
|
|
10
10
|
return /*#__PURE__*/React.createElement(TypeIconStyle, {
|
|
11
11
|
variant: variant,
|
|
@@ -15,12 +15,8 @@ const TypeIcon = ({
|
|
|
15
15
|
}));
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
TypeIcon.defaultProps = {
|
|
19
|
-
variant: "info",
|
|
20
|
-
transparent: false
|
|
21
|
-
};
|
|
22
18
|
TypeIcon.propTypes = {
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
"transparent": PropTypes.bool,
|
|
20
|
+
"variant": PropTypes.oneOf(["error", "info", "success", "warning"])
|
|
25
21
|
};
|
|
26
22
|
export default TypeIcon;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MessageVariant } from "../message.component";
|
|
2
|
+
declare type TypeIconStyleProps = {
|
|
3
|
+
/** set background to be invisible */
|
|
4
|
+
transparent?: boolean;
|
|
5
|
+
/** set type of message based on new DLS standard */
|
|
6
|
+
variant: MessageVariant;
|
|
7
|
+
};
|
|
8
|
+
declare const TypeIconStyle: import("styled-components").StyledComponent<"div", any, TypeIconStyleProps, never>;
|
|
9
|
+
export default TypeIconStyle;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
const messageVariants = {
|
|
4
3
|
error: "var(--colorsSemanticNegative500)",
|
|
5
4
|
info: "var(--colorsSemanticNeutral500)",
|
|
@@ -34,13 +33,4 @@ const TypeIconStyle = styled.div`
|
|
|
34
33
|
}
|
|
35
34
|
`}
|
|
36
35
|
`;
|
|
37
|
-
TypeIconStyle.defaultProps = {
|
|
38
|
-
variant: "info",
|
|
39
|
-
transparent: false
|
|
40
|
-
};
|
|
41
|
-
TypeIconStyle.propTypes = {
|
|
42
|
-
variant: PropTypes.oneOf(["error", "info", "success", "warning"]),
|
|
43
|
-
border: PropTypes.bool,
|
|
44
|
-
transparent: PropTypes.bool
|
|
45
|
-
};
|
|
46
36
|
export default TypeIconStyle;
|
|
@@ -30,6 +30,10 @@ const Search = ({
|
|
|
30
30
|
"aria-label": ariaLabel = "search",
|
|
31
31
|
inputRef,
|
|
32
32
|
tabIndex,
|
|
33
|
+
error,
|
|
34
|
+
warning,
|
|
35
|
+
info,
|
|
36
|
+
tooltipPosition,
|
|
33
37
|
...rest
|
|
34
38
|
}) => {
|
|
35
39
|
const isControlled = value !== undefined;
|
|
@@ -159,7 +163,11 @@ const Search = ({
|
|
|
159
163
|
onChange: handleChange,
|
|
160
164
|
onKeyDown: handleKeyDown,
|
|
161
165
|
inputRef: assignInput,
|
|
162
|
-
tabIndex: tabIndex
|
|
166
|
+
tabIndex: tabIndex,
|
|
167
|
+
error: error,
|
|
168
|
+
warning: warning,
|
|
169
|
+
info: info,
|
|
170
|
+
tooltipPosition: tooltipPosition
|
|
163
171
|
}), searchButton && /*#__PURE__*/React.createElement(StyledSearchButton, null, Boolean(isFocused || (!isControlled ? searchValue.length : value.length)) && /*#__PURE__*/React.createElement(Button, _extends({
|
|
164
172
|
tabIndex: iconTabIndex,
|
|
165
173
|
size: "medium",
|
|
@@ -238,6 +246,24 @@ Search.propTypes = {
|
|
|
238
246
|
}),
|
|
239
247
|
|
|
240
248
|
/** Input tabindex */
|
|
241
|
-
tabIndex: PropTypes.number
|
|
249
|
+
tabIndex: PropTypes.number,
|
|
250
|
+
|
|
251
|
+
/** Indicate that error has occurred
|
|
252
|
+
Pass string to display icon, tooltip and red border
|
|
253
|
+
Pass true boolean to only display red border */
|
|
254
|
+
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
255
|
+
|
|
256
|
+
/** Indicate that warning has occurred
|
|
257
|
+
Pass string to display icon, tooltip and orange border
|
|
258
|
+
Pass true boolean to only display orange border */
|
|
259
|
+
warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
260
|
+
|
|
261
|
+
/** Indicate additional information
|
|
262
|
+
Pass string to display icon, tooltip and blue border
|
|
263
|
+
Pass true boolean to only display blue border */
|
|
264
|
+
info: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
265
|
+
|
|
266
|
+
/** Overrides the default tooltip position */
|
|
267
|
+
tooltipPosition: PropTypes.oneOf(["top", "bottom", "left", "right"])
|
|
242
268
|
};
|
|
243
269
|
export default Search;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
3
|
|
|
4
|
-
export interface SearchProps extends MarginProps {
|
|
4
|
+
export interface SearchProps extends ValidationProps, MarginProps {
|
|
5
5
|
/** Prop to specify the aria-label of the search component */
|
|
6
6
|
"aria-label"?: string;
|
|
7
7
|
/** Prop for `uncontrolled` use */
|
|
@@ -42,6 +42,8 @@ export interface SearchProps extends MarginProps {
|
|
|
42
42
|
inputRef?: React.RefObject<HTMLInputElement>;
|
|
43
43
|
/** Input tabindex */
|
|
44
44
|
tabIndex?: number;
|
|
45
|
+
/** Overrides the default tooltip position */
|
|
46
|
+
tooltipPosition?: "top" | "bottom" | "left" | "right";
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
declare function Search(props: SearchProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./sidebar-header.component";
|