carbon-react 116.1.2 → 116.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/__internal__/utils/helpers/events/events.d.ts +1 -1
- package/esm/components/accordion/accordion.component.d.ts +1 -1
- package/esm/components/accordion/accordion.component.js +2 -2
- package/esm/components/accordion/accordion.style.d.ts +1 -1
- package/esm/components/accordion/accordion.style.js +1 -1
- package/esm/components/date/date.component.js +9 -1
- package/esm/components/date/date.style.js +5 -2
- package/esm/components/detail/detail.component.d.ts +19 -0
- package/esm/components/detail/detail.component.js +176 -42
- package/esm/components/detail/detail.style.d.ts +10 -0
- package/esm/components/detail/index.d.ts +2 -1
- package/esm/components/drawer/drawer.component.d.ts +1 -1
- package/esm/components/icon/icon.component.js +1 -1
- package/esm/components/menu/index.d.ts +1 -0
- package/esm/components/tabs/__internal__/tab-title/index.d.ts +2 -1
- package/esm/components/tabs/__internal__/tab-title/index.js +1 -1
- package/esm/components/tabs/__internal__/tab-title/tab-title.component.d.ts +37 -3
- package/esm/components/tabs/__internal__/tab-title/tab-title.component.js +99 -97
- package/esm/components/tabs/__internal__/tab-title/tab-title.style.d.ts +18 -4
- package/esm/components/tabs/__internal__/tab-title/tab-title.style.js +14 -50
- package/esm/components/tabs/__internal__/tabs-header/index.d.ts +2 -1
- package/esm/components/tabs/__internal__/tabs-header/tabs-header.component.d.ts +13 -0
- package/esm/components/tabs/__internal__/tabs-header/tabs-header.component.js +8 -8
- package/esm/components/tabs/__internal__/tabs-header/tabs-header.style.d.ts +6 -6
- package/esm/components/tabs/__internal__/tabs-header/tabs-header.style.js +8 -27
- package/esm/components/tabs/index.d.ts +3 -2
- package/esm/components/tabs/tab/index.d.ts +2 -2
- package/esm/components/tabs/tab/tab.component.d.ts +53 -0
- package/esm/components/tabs/tab/tab.component.js +180 -61
- package/esm/components/tabs/tab/tab.style.d.ts +8 -1
- package/esm/components/tabs/tab/tab.style.js +1 -6
- package/esm/components/tabs/tabs.component.d.ts +49 -0
- package/esm/components/tabs/tabs.component.js +188 -70
- package/esm/components/tabs/tabs.style.d.ts +5 -1
- package/esm/components/tabs/tabs.style.js +2 -8
- package/esm/components/textbox/textbox.component.d.ts +1 -1
- package/lib/__internal__/utils/helpers/events/events.d.ts +1 -1
- package/lib/components/accordion/accordion.component.d.ts +1 -1
- package/lib/components/accordion/accordion.component.js +2 -2
- package/lib/components/accordion/accordion.style.d.ts +1 -1
- package/lib/components/accordion/accordion.style.js +1 -1
- package/lib/components/date/date.component.js +9 -1
- package/lib/components/date/date.style.js +5 -2
- package/lib/components/detail/detail.component.d.ts +19 -0
- package/lib/components/detail/detail.component.js +178 -47
- package/lib/components/detail/detail.style.d.ts +10 -0
- package/lib/components/detail/index.d.ts +2 -1
- package/lib/components/drawer/drawer.component.d.ts +1 -1
- package/lib/components/icon/icon.component.js +1 -1
- package/lib/components/menu/index.d.ts +1 -0
- package/lib/components/tabs/__internal__/tab-title/index.d.ts +2 -1
- package/lib/components/tabs/__internal__/tab-title/index.js +10 -2
- package/lib/components/tabs/__internal__/tab-title/tab-title.component.d.ts +37 -3
- package/lib/components/tabs/__internal__/tab-title/tab-title.component.js +99 -97
- package/lib/components/tabs/__internal__/tab-title/tab-title.style.d.ts +18 -4
- package/lib/components/tabs/__internal__/tab-title/tab-title.style.js +17 -53
- package/lib/components/tabs/__internal__/tabs-header/index.d.ts +2 -1
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.component.d.ts +13 -0
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.component.js +8 -8
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.style.d.ts +6 -6
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.style.js +9 -31
- package/lib/components/tabs/index.d.ts +3 -2
- package/lib/components/tabs/tab/index.d.ts +2 -2
- package/lib/components/tabs/tab/tab.component.d.ts +53 -0
- package/lib/components/tabs/tab/tab.component.js +181 -64
- package/lib/components/tabs/tab/tab.style.d.ts +8 -1
- package/lib/components/tabs/tab/tab.style.js +1 -7
- package/lib/components/tabs/tabs.component.d.ts +49 -0
- package/lib/components/tabs/tabs.component.js +188 -73
- package/lib/components/tabs/tabs.style.d.ts +5 -1
- package/lib/components/tabs/tabs.style.js +2 -9
- package/lib/components/textbox/textbox.component.d.ts +1 -1
- package/package.json +1 -1
- package/esm/components/detail/detail.d.ts +0 -16
- package/esm/components/tabs/__internal__/tab-title/tab-title.d.ts +0 -47
- package/esm/components/tabs/__internal__/tabs-header/tab-header.d.ts +0 -16
- package/esm/components/tabs/tab/tab.d.ts +0 -54
- package/esm/components/tabs/tabs.d.ts +0 -51
- package/lib/components/detail/detail.d.ts +0 -16
- package/lib/components/tabs/__internal__/tab-title/tab-title.d.ts +0 -47
- package/lib/components/tabs/__internal__/tabs-header/tab-header.d.ts +0 -16
- package/lib/components/tabs/tab/tab.d.ts +0 -54
- package/lib/components/tabs/tabs.d.ts +0 -51
|
@@ -2,12 +2,9 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React, { useCallback, useEffect, useState } from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import styledSystemPropTypes from "@styled-system/prop-types";
|
|
6
5
|
import StyledTab from "./tab.style";
|
|
7
6
|
import tagComponent from "../../../__internal__/utils/helpers/tags/tags";
|
|
8
|
-
import { filterStyledSystemPaddingProps } from "../../../style/utils";
|
|
9
7
|
const TabContext = /*#__PURE__*/React.createContext({});
|
|
10
|
-
const paddingPropTypes = filterStyledSystemPaddingProps(styledSystemPropTypes.space);
|
|
11
8
|
|
|
12
9
|
const Tab = ({
|
|
13
10
|
ariaLabelledby,
|
|
@@ -21,7 +18,11 @@ const Tab = ({
|
|
|
21
18
|
updateWarnings,
|
|
22
19
|
updateInfos,
|
|
23
20
|
href,
|
|
21
|
+
// title is destructured purely to NOT spread it as part of rest to the underlying HTML element.
|
|
22
|
+
// Both this and titleProps are used as part of child.props inside Tabs component
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
24
24
|
title,
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
25
26
|
titleProps,
|
|
26
27
|
...rest
|
|
27
28
|
}) => {
|
|
@@ -73,65 +74,183 @@ const Tab = ({
|
|
|
73
74
|
}, tagComponent("tab", rest), rest), !href && children));
|
|
74
75
|
};
|
|
75
76
|
|
|
76
|
-
Tab.propTypes = {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
77
|
+
Tab.propTypes = {
|
|
78
|
+
"ariaLabelledby": PropTypes.string,
|
|
79
|
+
"children": PropTypes.node,
|
|
80
|
+
"className": PropTypes.string,
|
|
81
|
+
"customLayout": PropTypes.node,
|
|
82
|
+
"errorMessage": PropTypes.string,
|
|
83
|
+
"href": PropTypes.string,
|
|
84
|
+
"infoMessage": PropTypes.string,
|
|
85
|
+
"isTabSelected": PropTypes.bool,
|
|
86
|
+
"p": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
87
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
88
|
+
"description": PropTypes.string,
|
|
89
|
+
"toString": PropTypes.func.isRequired,
|
|
90
|
+
"valueOf": PropTypes.func.isRequired
|
|
91
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
92
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
93
|
+
"description": PropTypes.string,
|
|
94
|
+
"toString": PropTypes.func.isRequired,
|
|
95
|
+
"valueOf": PropTypes.func.isRequired
|
|
96
|
+
}), PropTypes.string]),
|
|
97
|
+
"padding": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
98
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
99
|
+
"description": PropTypes.string,
|
|
100
|
+
"toString": PropTypes.func.isRequired,
|
|
101
|
+
"valueOf": PropTypes.func.isRequired
|
|
102
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
103
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
104
|
+
"description": PropTypes.string,
|
|
105
|
+
"toString": PropTypes.func.isRequired,
|
|
106
|
+
"valueOf": PropTypes.func.isRequired
|
|
107
|
+
}), PropTypes.string]),
|
|
108
|
+
"paddingBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
109
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
110
|
+
"description": PropTypes.string,
|
|
111
|
+
"toString": PropTypes.func.isRequired,
|
|
112
|
+
"valueOf": PropTypes.func.isRequired
|
|
113
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
114
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
115
|
+
"description": PropTypes.string,
|
|
116
|
+
"toString": PropTypes.func.isRequired,
|
|
117
|
+
"valueOf": PropTypes.func.isRequired
|
|
118
|
+
}), PropTypes.string]),
|
|
119
|
+
"paddingLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
120
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
121
|
+
"description": PropTypes.string,
|
|
122
|
+
"toString": PropTypes.func.isRequired,
|
|
123
|
+
"valueOf": PropTypes.func.isRequired
|
|
124
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
125
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
126
|
+
"description": PropTypes.string,
|
|
127
|
+
"toString": PropTypes.func.isRequired,
|
|
128
|
+
"valueOf": PropTypes.func.isRequired
|
|
129
|
+
}), PropTypes.string]),
|
|
130
|
+
"paddingRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
131
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
132
|
+
"description": PropTypes.string,
|
|
133
|
+
"toString": PropTypes.func.isRequired,
|
|
134
|
+
"valueOf": PropTypes.func.isRequired
|
|
135
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
136
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
137
|
+
"description": PropTypes.string,
|
|
138
|
+
"toString": PropTypes.func.isRequired,
|
|
139
|
+
"valueOf": PropTypes.func.isRequired
|
|
140
|
+
}), PropTypes.string]),
|
|
141
|
+
"paddingTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
142
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
143
|
+
"description": PropTypes.string,
|
|
144
|
+
"toString": PropTypes.func.isRequired,
|
|
145
|
+
"valueOf": PropTypes.func.isRequired
|
|
146
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
147
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
148
|
+
"description": PropTypes.string,
|
|
149
|
+
"toString": PropTypes.func.isRequired,
|
|
150
|
+
"valueOf": PropTypes.func.isRequired
|
|
151
|
+
}), PropTypes.string]),
|
|
152
|
+
"paddingX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
153
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
154
|
+
"description": PropTypes.string,
|
|
155
|
+
"toString": PropTypes.func.isRequired,
|
|
156
|
+
"valueOf": PropTypes.func.isRequired
|
|
157
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
158
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
159
|
+
"description": PropTypes.string,
|
|
160
|
+
"toString": PropTypes.func.isRequired,
|
|
161
|
+
"valueOf": PropTypes.func.isRequired
|
|
162
|
+
}), PropTypes.string]),
|
|
163
|
+
"paddingY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
164
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
165
|
+
"description": PropTypes.string,
|
|
166
|
+
"toString": PropTypes.func.isRequired,
|
|
167
|
+
"valueOf": PropTypes.func.isRequired
|
|
168
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
169
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
170
|
+
"description": PropTypes.string,
|
|
171
|
+
"toString": PropTypes.func.isRequired,
|
|
172
|
+
"valueOf": PropTypes.func.isRequired
|
|
173
|
+
}), PropTypes.string]),
|
|
174
|
+
"pb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
175
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
176
|
+
"description": PropTypes.string,
|
|
177
|
+
"toString": PropTypes.func.isRequired,
|
|
178
|
+
"valueOf": PropTypes.func.isRequired
|
|
179
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
180
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
181
|
+
"description": PropTypes.string,
|
|
182
|
+
"toString": PropTypes.func.isRequired,
|
|
183
|
+
"valueOf": PropTypes.func.isRequired
|
|
184
|
+
}), PropTypes.string]),
|
|
185
|
+
"pl": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
186
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
187
|
+
"description": PropTypes.string,
|
|
188
|
+
"toString": PropTypes.func.isRequired,
|
|
189
|
+
"valueOf": PropTypes.func.isRequired
|
|
190
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
191
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
192
|
+
"description": PropTypes.string,
|
|
193
|
+
"toString": PropTypes.func.isRequired,
|
|
194
|
+
"valueOf": PropTypes.func.isRequired
|
|
195
|
+
}), PropTypes.string]),
|
|
196
|
+
"position": PropTypes.oneOf(["left", "top"]),
|
|
197
|
+
"pr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
198
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
199
|
+
"description": PropTypes.string,
|
|
200
|
+
"toString": PropTypes.func.isRequired,
|
|
201
|
+
"valueOf": PropTypes.func.isRequired
|
|
202
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
203
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
204
|
+
"description": PropTypes.string,
|
|
205
|
+
"toString": PropTypes.func.isRequired,
|
|
206
|
+
"valueOf": PropTypes.func.isRequired
|
|
207
|
+
}), PropTypes.string]),
|
|
208
|
+
"pt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
209
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
210
|
+
"description": PropTypes.string,
|
|
211
|
+
"toString": PropTypes.func.isRequired,
|
|
212
|
+
"valueOf": PropTypes.func.isRequired
|
|
213
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
214
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
215
|
+
"description": PropTypes.string,
|
|
216
|
+
"toString": PropTypes.func.isRequired,
|
|
217
|
+
"valueOf": PropTypes.func.isRequired
|
|
218
|
+
}), PropTypes.string]),
|
|
219
|
+
"px": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
220
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
221
|
+
"description": PropTypes.string,
|
|
222
|
+
"toString": PropTypes.func.isRequired,
|
|
223
|
+
"valueOf": PropTypes.func.isRequired
|
|
224
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
225
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
226
|
+
"description": PropTypes.string,
|
|
227
|
+
"toString": PropTypes.func.isRequired,
|
|
228
|
+
"valueOf": PropTypes.func.isRequired
|
|
229
|
+
}), PropTypes.string]),
|
|
230
|
+
"py": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
231
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
232
|
+
"description": PropTypes.string,
|
|
233
|
+
"toString": PropTypes.func.isRequired,
|
|
234
|
+
"valueOf": PropTypes.func.isRequired
|
|
235
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
236
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
237
|
+
"description": PropTypes.string,
|
|
238
|
+
"toString": PropTypes.func.isRequired,
|
|
239
|
+
"valueOf": PropTypes.func.isRequired
|
|
240
|
+
}), PropTypes.string]),
|
|
241
|
+
"role": PropTypes.string,
|
|
242
|
+
"siblings": PropTypes.node,
|
|
243
|
+
"tabId": PropTypes.string.isRequired,
|
|
244
|
+
"title": PropTypes.string,
|
|
245
|
+
"titlePosition": PropTypes.oneOf(["after", "before"]),
|
|
246
|
+
"titleProps": PropTypes.shape({
|
|
133
247
|
"data-role": PropTypes.string
|
|
134
|
-
})
|
|
248
|
+
}),
|
|
249
|
+
"updateErrors": PropTypes.func,
|
|
250
|
+
"updateInfos": PropTypes.func,
|
|
251
|
+
"updateWarnings": PropTypes.func,
|
|
252
|
+
"warningMessage": PropTypes.string
|
|
135
253
|
};
|
|
254
|
+
export { Tab };
|
|
136
255
|
export { TabContext };
|
|
137
256
|
export default Tab;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
import { ThemeObject } from "../../../style/themes/base";
|
|
2
|
+
import { TabProps } from ".";
|
|
3
|
+
export declare type StyledTabProps = Pick<TabProps, "position" | "isTabSelected"> & {
|
|
4
|
+
theme?: ThemeObject;
|
|
5
|
+
};
|
|
6
|
+
declare const StyledTab: import("styled-components").StyledComponent<"div", any, Pick<TabProps, "position" | "isTabSelected"> & {
|
|
7
|
+
theme?: ThemeObject | undefined;
|
|
8
|
+
}, never>;
|
|
1
9
|
export default StyledTab;
|
|
2
|
-
declare const StyledTab: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import propTypes from "prop-types";
|
|
3
2
|
import { padding } from "styled-system";
|
|
4
3
|
import BaseTheme from "../../../style/themes/base";
|
|
5
4
|
const StyledTab = styled.div`
|
|
@@ -7,7 +6,7 @@ const StyledTab = styled.div`
|
|
|
7
6
|
|
|
8
7
|
${({
|
|
9
8
|
isTabSelected,
|
|
10
|
-
position
|
|
9
|
+
position = "top"
|
|
11
10
|
}) => isTabSelected && css`
|
|
12
11
|
display: block;
|
|
13
12
|
|
|
@@ -19,10 +18,6 @@ const StyledTab = styled.div`
|
|
|
19
18
|
`}
|
|
20
19
|
`;
|
|
21
20
|
StyledTab.defaultProps = {
|
|
22
|
-
position: "top",
|
|
23
21
|
theme: BaseTheme
|
|
24
22
|
};
|
|
25
|
-
StyledTab.propTypes = {
|
|
26
|
-
position: propTypes.oneOf(["top", "left"])
|
|
27
|
-
};
|
|
28
23
|
export default StyledTab;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
3
|
+
import Tab from "./tab";
|
|
4
|
+
export interface TabsProps extends MarginProps {
|
|
5
|
+
/** @ignore @private */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Prevent rendering of hidden tabs, by default this is set to true and therefore all tabs will be rendered */
|
|
8
|
+
renderHiddenTabs?: boolean;
|
|
9
|
+
/** Allows manual control over the currently selected tab. */
|
|
10
|
+
selectedTabId?: string;
|
|
11
|
+
/** The child elements of Tabs need to be Tab components. */
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/** Sets the alignment of the tab titles. Possible values include. */
|
|
14
|
+
align?: "left" | "right";
|
|
15
|
+
/** A callback for when a tab is changed. You can use this to manually control
|
|
16
|
+
* tab changing or to fire other events when a tab is changed.
|
|
17
|
+
*/
|
|
18
|
+
onTabChange?: (tabId: string) => void;
|
|
19
|
+
/** The position of the tab title. */
|
|
20
|
+
position?: "top" | "left";
|
|
21
|
+
/** Sets size of the tab titles. */
|
|
22
|
+
size?: "default" | "large";
|
|
23
|
+
/** Sets the divider of the tab titles header to extend the full width of the parent. */
|
|
24
|
+
extendedLine?: boolean;
|
|
25
|
+
/** Adds a combination of borders to the tab titles. */
|
|
26
|
+
borders?: "off" | "on" | "no left side" | "no right side" | "no sides";
|
|
27
|
+
/** Adds an alternate styling variant to the tab titles. */
|
|
28
|
+
variant?: "default" | "alternate";
|
|
29
|
+
/** sets width to the tab headers. Can be any valid CSS string.
|
|
30
|
+
* The headerWidth prop works only for `position="left"`
|
|
31
|
+
*/
|
|
32
|
+
headerWidth?: string;
|
|
33
|
+
/** An object to support overriding validation statuses, when the Tabs have custom targets for example.
|
|
34
|
+
* The `id` property should match the `tabId`s for the rendered Tabs.
|
|
35
|
+
*/
|
|
36
|
+
validationStatusOverride?: {
|
|
37
|
+
[id: string]: {
|
|
38
|
+
error?: boolean;
|
|
39
|
+
warning?: boolean;
|
|
40
|
+
info?: boolean;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
/** When this prop is set any string validation failures in the children of each Tab
|
|
44
|
+
* will be summaraised in the Tooltip next to the Tab title
|
|
45
|
+
*/
|
|
46
|
+
showValidationsSummary?: boolean;
|
|
47
|
+
}
|
|
48
|
+
declare const Tabs: ({ align, className, children, onTabChange, selectedTabId, renderHiddenTabs, position, extendedLine, size, borders, variant, validationStatusOverride, headerWidth, showValidationsSummary, ...rest }: TabsProps) => JSX.Element;
|
|
49
|
+
export { Tabs, Tab };
|