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
|
@@ -2,31 +2,183 @@ 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 StepSequenceStyle from "./step-sequence.style";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export const StepSequenceContext = /*#__PURE__*/React.createContext({
|
|
7
|
+
orientation: "horizontal"
|
|
8
|
+
});
|
|
10
9
|
|
|
11
|
-
const StepSequence =
|
|
10
|
+
const StepSequence = ({
|
|
11
|
+
children,
|
|
12
|
+
orientation = "horizontal",
|
|
13
|
+
...props
|
|
14
|
+
}) => {
|
|
12
15
|
return /*#__PURE__*/React.createElement(StepSequenceStyle, _extends({
|
|
13
|
-
"data-component": "step-sequence"
|
|
16
|
+
"data-component": "step-sequence",
|
|
17
|
+
orientation: orientation
|
|
14
18
|
}, props), /*#__PURE__*/React.createElement(StepSequenceContext.Provider, {
|
|
15
19
|
value: {
|
|
16
|
-
orientation
|
|
20
|
+
orientation
|
|
17
21
|
}
|
|
18
|
-
},
|
|
22
|
+
}, children));
|
|
19
23
|
};
|
|
20
24
|
|
|
21
|
-
StepSequence.propTypes = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
StepSequence.propTypes = {
|
|
26
|
+
"children": PropTypes.node,
|
|
27
|
+
"m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
28
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
29
|
+
"description": PropTypes.string,
|
|
30
|
+
"toString": PropTypes.func.isRequired,
|
|
31
|
+
"valueOf": PropTypes.func.isRequired
|
|
32
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
33
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
34
|
+
"description": PropTypes.string,
|
|
35
|
+
"toString": PropTypes.func.isRequired,
|
|
36
|
+
"valueOf": PropTypes.func.isRequired
|
|
37
|
+
}), PropTypes.string]),
|
|
38
|
+
"margin": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
39
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
40
|
+
"description": PropTypes.string,
|
|
41
|
+
"toString": PropTypes.func.isRequired,
|
|
42
|
+
"valueOf": PropTypes.func.isRequired
|
|
43
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
44
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
45
|
+
"description": PropTypes.string,
|
|
46
|
+
"toString": PropTypes.func.isRequired,
|
|
47
|
+
"valueOf": PropTypes.func.isRequired
|
|
48
|
+
}), PropTypes.string]),
|
|
49
|
+
"marginBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
50
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
51
|
+
"description": PropTypes.string,
|
|
52
|
+
"toString": PropTypes.func.isRequired,
|
|
53
|
+
"valueOf": PropTypes.func.isRequired
|
|
54
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
55
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
56
|
+
"description": PropTypes.string,
|
|
57
|
+
"toString": PropTypes.func.isRequired,
|
|
58
|
+
"valueOf": PropTypes.func.isRequired
|
|
59
|
+
}), PropTypes.string]),
|
|
60
|
+
"marginLeft": 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
|
+
"marginRight": 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
|
+
"marginTop": 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
|
+
"marginX": 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
|
+
"marginY": 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
|
+
"mb": 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
|
+
"ml": 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
|
+
"mr": 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
|
+
"mt": 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
|
+
"mx": 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
|
+
"my": 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
|
+
"orientation": PropTypes.oneOf(["horizontal", "vertical"])
|
|
31
182
|
};
|
|
183
|
+
export { StepSequence };
|
|
32
184
|
export default StepSequence;
|
|
@@ -1,6 +1,6 @@
|
|
|
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, { useRef } from "react";
|
|
3
|
+
import React, { useRef, useState } from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import { StyledTabTitle, StyledTitleContent, StyledLayoutWrapper, StyledSelectedIndicator } from "./tab-title.style";
|
|
6
6
|
import tagComponent from "../../../../__internal__/utils/helpers/tags/tags";
|
|
@@ -8,6 +8,8 @@ import ValidationIcon from "../../../../__internal__/validations/validation-icon
|
|
|
8
8
|
import createGuid from "../../../../__internal__/utils/helpers/guid";
|
|
9
9
|
import Icon from "../../../icon";
|
|
10
10
|
import Events from "../../../../__internal__/utils/helpers/events";
|
|
11
|
+
import { TooltipProvider } from "../../../../__internal__/tooltip-provider";
|
|
12
|
+
export const TabTitleContext = /*#__PURE__*/React.createContext({});
|
|
11
13
|
const TabTitle = /*#__PURE__*/React.forwardRef(({
|
|
12
14
|
isTabSelected,
|
|
13
15
|
dataTabId,
|
|
@@ -38,6 +40,18 @@ const TabTitle = /*#__PURE__*/React.forwardRef(({
|
|
|
38
40
|
const isHref = !!href;
|
|
39
41
|
const hasAlternateStyling = alternateStyling || isInSidebar;
|
|
40
42
|
const hasFailedValidation = error || warning || info;
|
|
43
|
+
const [shouldShowTooltip, setShouldShowTooltip] = useState(false);
|
|
44
|
+
const hasHover = useRef(false);
|
|
45
|
+
|
|
46
|
+
const showTooltip = () => {
|
|
47
|
+
setShouldShowTooltip(true);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const hideTooltip = () => {
|
|
51
|
+
if ((ref === null || ref === void 0 ? void 0 : ref.current) !== document.activeElement && !hasHover.current) {
|
|
52
|
+
setShouldShowTooltip(false);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
41
55
|
|
|
42
56
|
if (siblings && !keys.current.length) {
|
|
43
57
|
siblings.forEach(() => keys.current.push(createGuid()));
|
|
@@ -102,7 +116,13 @@ const TabTitle = /*#__PURE__*/React.forwardRef(({
|
|
|
102
116
|
return titlePosition === "before" ? [titleText, titleSiblings] : [titleSiblings, titleText];
|
|
103
117
|
};
|
|
104
118
|
|
|
105
|
-
return /*#__PURE__*/React.createElement(
|
|
119
|
+
return /*#__PURE__*/React.createElement(TooltipProvider, {
|
|
120
|
+
tooltipVisible: shouldShowTooltip
|
|
121
|
+
}, /*#__PURE__*/React.createElement(TabTitleContext.Provider, {
|
|
122
|
+
value: {
|
|
123
|
+
isInTab: true
|
|
124
|
+
}
|
|
125
|
+
}, /*#__PURE__*/React.createElement(StyledTabTitle, _extends({
|
|
106
126
|
ref: ref,
|
|
107
127
|
"aria-selected": isTabSelected,
|
|
108
128
|
"data-element": "select-tab",
|
|
@@ -125,7 +145,17 @@ const TabTitle = /*#__PURE__*/React.forwardRef(({
|
|
|
125
145
|
}, tagComponent("tab-header", tabTitleProps), {
|
|
126
146
|
onKeyDown: handleKeyDown,
|
|
127
147
|
onClick: handleClick,
|
|
128
|
-
size: size
|
|
148
|
+
size: size,
|
|
149
|
+
onMouseOver: () => {
|
|
150
|
+
hasHover.current = true;
|
|
151
|
+
showTooltip();
|
|
152
|
+
},
|
|
153
|
+
onMouseLeave: () => {
|
|
154
|
+
hasHover.current = false;
|
|
155
|
+
hideTooltip();
|
|
156
|
+
},
|
|
157
|
+
onFocus: showTooltip,
|
|
158
|
+
onBlur: hideTooltip
|
|
129
159
|
}), /*#__PURE__*/React.createElement(StyledTitleContent, {
|
|
130
160
|
error: error,
|
|
131
161
|
warning: warning,
|
|
@@ -164,7 +194,7 @@ const TabTitle = /*#__PURE__*/React.forwardRef(({
|
|
|
164
194
|
}))), !(hasFailedValidation || hasAlternateStyling) && isTabSelected && /*#__PURE__*/React.createElement(StyledSelectedIndicator, {
|
|
165
195
|
"data-element": "tab-selected-indicator",
|
|
166
196
|
position: position
|
|
167
|
-
}));
|
|
197
|
+
}))));
|
|
168
198
|
});
|
|
169
199
|
TabTitle.propTypes = {
|
|
170
200
|
title: PropTypes.string.isRequired,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
+
export interface TabTitleContextProps {
|
|
4
|
+
isInTab?: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
3
7
|
export interface TabTitleProps {
|
|
4
8
|
title: string;
|
|
5
9
|
id?: string;
|
|
@@ -34,6 +38,8 @@ export interface TabTitleProps {
|
|
|
34
38
|
) => void;
|
|
35
39
|
}
|
|
36
40
|
|
|
41
|
+
declare const TabTitleContext: React.Context<TabTitleContextProps>;
|
|
37
42
|
declare function TabTitle(props: TabTitleProps): JSX.Element;
|
|
38
43
|
|
|
44
|
+
export { TabTitleContext };
|
|
39
45
|
export default TabTitle;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const StyledTabTitle: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
2
|
+
export const StyledTitleContent: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
3
|
+
export const StyledLayoutWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export const StyledSelectedIndicator: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
const getAlternativeBackgroundColor = colorTheme => {
|
|
9
|
+
switch (colorTheme) {
|
|
10
|
+
case "light":
|
|
11
|
+
return "var(--colorsActionMinor100)";
|
|
12
|
+
|
|
13
|
+
case "transparent-base":
|
|
14
|
+
return "var(--colorsUtilityMajor025)";
|
|
15
|
+
|
|
16
|
+
case "transparent-white":
|
|
17
|
+
return "var(--colorsUtilityYang100)";
|
|
18
|
+
// default theme is "dark"
|
|
19
|
+
|
|
20
|
+
default:
|
|
21
|
+
return "var(--colorsActionMinor550)";
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var _default = getAlternativeBackgroundColor;
|
|
26
|
+
exports.default = _default;
|
|
@@ -15,6 +15,8 @@ var _flatTableHeader = _interopRequireDefault(require("./flat-table-header.style
|
|
|
15
15
|
|
|
16
16
|
var _utils = require("../../../style/utils");
|
|
17
17
|
|
|
18
|
+
var _flatTable = require("../flat-table.component");
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
22
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -39,6 +41,9 @@ const FlatTableHeader = ({
|
|
|
39
41
|
...rest
|
|
40
42
|
}) => {
|
|
41
43
|
const ref = (0, _react.useRef)(null);
|
|
44
|
+
const {
|
|
45
|
+
colorTheme
|
|
46
|
+
} = (0, _react.useContext)(_flatTable.FlatTableThemeContext);
|
|
42
47
|
(0, _react.useLayoutEffect)(() => {
|
|
43
48
|
if (ref.current && reportCellWidth) {
|
|
44
49
|
reportCellWidth(ref.current.offsetWidth, cellIndex);
|
|
@@ -49,6 +54,7 @@ const FlatTableHeader = ({
|
|
|
49
54
|
leftPosition: leftPosition || 0,
|
|
50
55
|
makeCellSticky: !!reportCellWidth,
|
|
51
56
|
align: align,
|
|
57
|
+
colorTheme: colorTheme,
|
|
52
58
|
"data-element": "flat-table-header",
|
|
53
59
|
colSpan: colspan,
|
|
54
60
|
rowSpan: rowspan,
|
|
@@ -9,6 +9,10 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
9
9
|
|
|
10
10
|
var _styledSystem = require("styled-system");
|
|
11
11
|
|
|
12
|
+
var _flatTableHeaderUtils = _interopRequireDefault(require("./flat-table-header-utils"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
12
16
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
13
17
|
|
|
14
18
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -25,7 +29,8 @@ const StyledFlatTableHeader = _styledComponents.default.th`
|
|
|
25
29
|
colWidth,
|
|
26
30
|
leftPosition,
|
|
27
31
|
makeCellSticky,
|
|
28
|
-
verticalBorder
|
|
32
|
+
verticalBorder,
|
|
33
|
+
colorTheme
|
|
29
34
|
}) => (0, _styledComponents.css)`
|
|
30
35
|
background-color: transparent;
|
|
31
36
|
border-width: 0;
|
|
@@ -60,11 +65,11 @@ const StyledFlatTableHeader = _styledComponents.default.th`
|
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
${alternativeBgColor && (0, _styledComponents.css)`
|
|
63
|
-
&&&:first-child {
|
|
64
|
-
border-left: 1px solid var(--colorsActionMinor550);
|
|
65
|
-
}
|
|
66
68
|
&&& {
|
|
67
|
-
background-color:
|
|
69
|
+
background-color: ${(0, _flatTableHeaderUtils.default)(colorTheme)};
|
|
70
|
+
}
|
|
71
|
+
&&&:first-child {
|
|
72
|
+
border-left: unset;
|
|
68
73
|
}
|
|
69
74
|
`};
|
|
70
75
|
|
|
@@ -23,6 +23,8 @@ var _icon = _interopRequireDefault(require("./icon.style"));
|
|
|
23
23
|
|
|
24
24
|
var _iconConfig = require("./icon-config");
|
|
25
25
|
|
|
26
|
+
var _tabTitle = require("../tabs/__internal__/tab-title/tab-title.component");
|
|
27
|
+
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
29
|
|
|
28
30
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -69,9 +71,12 @@ const Icon = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
69
71
|
disabled: disabledFromContext,
|
|
70
72
|
target
|
|
71
73
|
} = (0, _react.useContext)(_tooltipProvider.TooltipContext);
|
|
74
|
+
const {
|
|
75
|
+
isInTab
|
|
76
|
+
} = (0, _react.useContext)(_tabTitle.TabTitleContext);
|
|
72
77
|
/** Return Icon type with overrides */
|
|
73
78
|
|
|
74
|
-
const iconType = () => {
|
|
79
|
+
const iconType = (0, _react.useMemo)(() => {
|
|
75
80
|
// switch tweaks icon names for actual icons in the set
|
|
76
81
|
switch (type) {
|
|
77
82
|
case "help":
|
|
@@ -93,10 +98,16 @@ const Icon = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
93
98
|
default:
|
|
94
99
|
return type;
|
|
95
100
|
}
|
|
96
|
-
};
|
|
97
|
-
|
|
101
|
+
}, [type]);
|
|
98
102
|
const isFocusable = focusableFromContext !== undefined ? focusableFromContext : focusable;
|
|
99
103
|
const hasTooltip = !disabled && !disabledFromContext && !!tooltipMessage && isFocusable;
|
|
104
|
+
const computedTabIndex = (0, _react.useMemo)(() => {
|
|
105
|
+
if (isInTab) {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return hasTooltip && tabIndex === undefined ? 0 : tabIndex;
|
|
110
|
+
}, [isInTab, hasTooltip, tabIndex]);
|
|
100
111
|
const styledIconProps = {
|
|
101
112
|
"aria-hidden": ariaHidden,
|
|
102
113
|
"aria-label": ariaLabel,
|
|
@@ -105,7 +116,7 @@ const Icon = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
105
116
|
bgShape,
|
|
106
117
|
className: className || undefined,
|
|
107
118
|
color,
|
|
108
|
-
"data-element": iconType
|
|
119
|
+
"data-element": iconType,
|
|
109
120
|
disabled: disabledFromContext || disabled,
|
|
110
121
|
fontSize,
|
|
111
122
|
hasTooltip,
|
|
@@ -114,15 +125,18 @@ const Icon = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
114
125
|
key: "icon",
|
|
115
126
|
ref,
|
|
116
127
|
role,
|
|
117
|
-
tabIndex:
|
|
118
|
-
type: iconType
|
|
128
|
+
tabIndex: computedTabIndex,
|
|
129
|
+
type: iconType,
|
|
119
130
|
...(0, _tags.default)("icon", rest),
|
|
120
131
|
...(0, _utils.filterStyledSystemMarginProps)(rest)
|
|
121
132
|
};
|
|
122
133
|
|
|
134
|
+
const shouldShowTooltip = () => {
|
|
135
|
+
return tooltipVisibleFromContext !== undefined ? tooltipVisibleFromContext : tooltipVisible;
|
|
136
|
+
};
|
|
137
|
+
|
|
123
138
|
if (tooltipMessage) {
|
|
124
|
-
const
|
|
125
|
-
const visible = disabled ? undefined : showTooltip;
|
|
139
|
+
const visible = disabled ? undefined : shouldShowTooltip();
|
|
126
140
|
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
127
141
|
message: tooltipMessage,
|
|
128
142
|
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;
|
|
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _content = _interopRequireDefault(require("../../content"));
|
|
13
13
|
|
|
14
14
|
var _messageContent = _interopRequireDefault(require("./message-content.style"));
|
|
15
15
|
|
|
@@ -19,15 +19,14 @@ const MessageContent = ({
|
|
|
19
19
|
title,
|
|
20
20
|
children
|
|
21
21
|
}) => {
|
|
22
|
-
return /*#__PURE__*/_react.default.createElement(_messageContent.default, null, /*#__PURE__*/_react.default.createElement(
|
|
23
|
-
title: title
|
|
24
|
-
className: "message-content"
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_messageContent.default, null, /*#__PURE__*/_react.default.createElement(_content.default, {
|
|
23
|
+
title: title
|
|
25
24
|
}, children));
|
|
26
25
|
};
|
|
27
26
|
|
|
28
27
|
MessageContent.propTypes = {
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
"children": _propTypes.default.node,
|
|
29
|
+
"title": _propTypes.default.node
|
|
31
30
|
};
|
|
32
31
|
var _default = MessageContent;
|
|
33
32
|
exports.default = _default;
|
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
|
|
10
|
-
var _styledSystem = require("styled-system");
|
|
11
|
-
|
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
11
|
|
|
14
12
|
const MessageContentStyle = _styledComponents.default.div`
|
|
@@ -23,8 +21,6 @@ const MessageContentStyle = _styledComponents.default.div`
|
|
|
23
21
|
.carbon-content__body {
|
|
24
22
|
margin-top: 0px;
|
|
25
23
|
}
|
|
26
|
-
|
|
27
|
-
${_styledSystem.margin}
|
|
28
24
|
`;
|
|
29
25
|
var _default = MessageContentStyle;
|
|
30
26
|
exports.default = _default;
|
|
@@ -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;
|