@atlaskit/tabs 13.3.3 → 13.3.5
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/CHANGELOG.md +13 -0
- package/dist/cjs/components/tab-list.js +1 -1
- package/dist/cjs/components/tabs.js +1 -1
- package/dist/cjs/internal/styles.js +34 -15
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/tab-list.js +1 -1
- package/dist/es2019/components/tabs.js +1 -1
- package/dist/es2019/internal/styles.js +33 -15
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/tab-list.js +1 -1
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/internal/styles.js +35 -15
- package/dist/esm/version.json +1 -1
- package/package.json +4 -4
- package/report.api.md +44 -202
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/tabs
|
|
2
2
|
|
|
3
|
+
## 13.3.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0637c50e226`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0637c50e226) - Updated Tabs compnent to prefer to use focus-visible over focus css selectors.
|
|
8
|
+
|
|
9
|
+
## 13.3.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`e35fc41dc33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e35fc41dc33) - Internal change to use updated primtive spacing prop values. No expected behaviour change.
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 13.3.3
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -124,7 +124,7 @@ var TabList = function TabList(props) {
|
|
|
124
124
|
role: "tablist",
|
|
125
125
|
display: "flex",
|
|
126
126
|
position: "relative",
|
|
127
|
-
padding: "
|
|
127
|
+
padding: "scale.0",
|
|
128
128
|
ref: ref // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
129
129
|
,
|
|
130
130
|
css: tabListStyles
|
|
@@ -36,7 +36,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
36
36
|
var analyticsAttributes = {
|
|
37
37
|
componentName: 'tabs',
|
|
38
38
|
packageName: "@atlaskit/tabs",
|
|
39
|
-
packageVersion: "13.3.
|
|
39
|
+
packageVersion: "13.3.5"
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
var getTabPanelWithContext = function getTabPanelWithContext(_ref) {
|
|
@@ -23,16 +23,28 @@ var borderRadius = (0, _constants.borderRadius)();
|
|
|
23
23
|
var gridSize = (0, _constants.gridSize)();
|
|
24
24
|
var tabLeftRightPadding = "".concat(gridSize, "px");
|
|
25
25
|
var tabTopBottomPadding = "".concat(gridSize / 2, "px");
|
|
26
|
-
var underlineHeight = '2px';
|
|
26
|
+
var underlineHeight = '2px';
|
|
27
|
+
var highContrastFocusStyles = {
|
|
28
|
+
outline: '1px solid'
|
|
29
|
+
}; // Required so the focus ring is visible in high contrast mode
|
|
27
30
|
|
|
28
31
|
var highContrastFocusRing = {
|
|
29
32
|
'@media screen and (forced-colors: active), screen and (-ms-high-contrast: active)': {
|
|
30
|
-
'&:focus':
|
|
31
|
-
|
|
33
|
+
'&:focus-visible': highContrastFocusStyles,
|
|
34
|
+
'@supports not selector(*:focus-visible)': {
|
|
35
|
+
'&:focus': highContrastFocusStyles
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
};
|
|
35
39
|
|
|
40
|
+
var tabFocusStyles = function tabFocusStyles(mode) {
|
|
41
|
+
return {
|
|
42
|
+
boxShadow: "0 0 0 2px ".concat((0, _colors.getTabPanelFocusColor)(mode), " inset"),
|
|
43
|
+
borderRadius: borderRadius,
|
|
44
|
+
outline: 'none'
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
36
48
|
var getTabPanelStyles = function getTabPanelStyles(mode) {
|
|
37
49
|
return _objectSpread({
|
|
38
50
|
flexGrow: 1,
|
|
@@ -44,10 +56,9 @@ var getTabPanelStyles = function getTabPanelStyles(mode) {
|
|
|
44
56
|
minHeight: '0%',
|
|
45
57
|
display: 'flex',
|
|
46
58
|
padding: "0 ".concat(tabLeftRightPadding),
|
|
47
|
-
'&:focus':
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
outline: 'none'
|
|
59
|
+
'&:focus-visible': tabFocusStyles(mode),
|
|
60
|
+
'@supports not selector(*:focus-visible)': {
|
|
61
|
+
'&:focus': tabFocusStyles(mode)
|
|
51
62
|
}
|
|
52
63
|
}, highContrastFocusRing);
|
|
53
64
|
};
|
|
@@ -94,6 +105,19 @@ var getTabListStyles = function getTabListStyles(mode) {
|
|
|
94
105
|
|
|
95
106
|
exports.getTabListStyles = getTabListStyles;
|
|
96
107
|
|
|
108
|
+
var tabPanelFocusStyles = function tabPanelFocusStyles(mode) {
|
|
109
|
+
var colors = (0, _colors.getTabColors)(mode);
|
|
110
|
+
return {
|
|
111
|
+
boxShadow: "0 0 0 2px ".concat(colors.focusBorderColor, " inset"),
|
|
112
|
+
borderRadius: borderRadius,
|
|
113
|
+
outline: 'none',
|
|
114
|
+
// Hide TabLine on focus
|
|
115
|
+
'&::after': {
|
|
116
|
+
opacity: 0
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
|
|
97
121
|
var getTabStyles = function getTabStyles(mode) {
|
|
98
122
|
var colors = (0, _colors.getTabColors)(mode);
|
|
99
123
|
return _objectSpread(_objectSpread({
|
|
@@ -122,14 +146,9 @@ var getTabStyles = function getTabStyles(mode) {
|
|
|
122
146
|
height: 0
|
|
123
147
|
})
|
|
124
148
|
},
|
|
125
|
-
'&:focus':
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
outline: 'none',
|
|
129
|
-
// Hide TabLine on focus
|
|
130
|
-
'&::after': {
|
|
131
|
-
opacity: 0
|
|
132
|
-
}
|
|
149
|
+
'&:focus-visible': tabPanelFocusStyles(mode),
|
|
150
|
+
'@supports not selector(*:focus-visible)': {
|
|
151
|
+
'&:focus': tabPanelFocusStyles(mode)
|
|
133
152
|
}
|
|
134
153
|
}, highContrastFocusRing), {}, {
|
|
135
154
|
'&[aria-selected="true"]': {
|
package/dist/cjs/version.json
CHANGED
|
@@ -103,7 +103,7 @@ const TabList = props => {
|
|
|
103
103
|
role: "tablist",
|
|
104
104
|
display: "flex",
|
|
105
105
|
position: "relative",
|
|
106
|
-
padding: "
|
|
106
|
+
padding: "scale.0",
|
|
107
107
|
ref: ref // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
108
108
|
,
|
|
109
109
|
css: tabListStyles
|
|
@@ -5,16 +5,26 @@ const borderRadius = getBorderRadius();
|
|
|
5
5
|
const gridSize = getGridSize();
|
|
6
6
|
const tabLeftRightPadding = `${gridSize}px`;
|
|
7
7
|
const tabTopBottomPadding = `${gridSize / 2}px`;
|
|
8
|
-
const underlineHeight = '2px';
|
|
8
|
+
const underlineHeight = '2px';
|
|
9
|
+
const highContrastFocusStyles = {
|
|
10
|
+
outline: '1px solid'
|
|
11
|
+
}; // Required so the focus ring is visible in high contrast mode
|
|
9
12
|
|
|
10
13
|
const highContrastFocusRing = {
|
|
11
14
|
'@media screen and (forced-colors: active), screen and (-ms-high-contrast: active)': {
|
|
12
|
-
'&:focus':
|
|
13
|
-
|
|
15
|
+
'&:focus-visible': highContrastFocusStyles,
|
|
16
|
+
'@supports not selector(*:focus-visible)': {
|
|
17
|
+
'&:focus': highContrastFocusStyles
|
|
14
18
|
}
|
|
15
19
|
}
|
|
16
20
|
};
|
|
17
21
|
|
|
22
|
+
const tabFocusStyles = mode => ({
|
|
23
|
+
boxShadow: `0 0 0 2px ${getTabPanelFocusColor(mode)} inset`,
|
|
24
|
+
borderRadius: borderRadius,
|
|
25
|
+
outline: 'none'
|
|
26
|
+
});
|
|
27
|
+
|
|
18
28
|
const getTabPanelStyles = mode => ({
|
|
19
29
|
flexGrow: 1,
|
|
20
30
|
|
|
@@ -25,10 +35,9 @@ const getTabPanelStyles = mode => ({
|
|
|
25
35
|
minHeight: '0%',
|
|
26
36
|
display: 'flex',
|
|
27
37
|
padding: `0 ${tabLeftRightPadding}`,
|
|
28
|
-
'&:focus':
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
outline: 'none'
|
|
38
|
+
'&:focus-visible': tabFocusStyles(mode),
|
|
39
|
+
'@supports not selector(*:focus-visible)': {
|
|
40
|
+
'&:focus': tabFocusStyles(mode)
|
|
32
41
|
},
|
|
33
42
|
...highContrastFocusRing
|
|
34
43
|
});
|
|
@@ -63,6 +72,20 @@ css({
|
|
|
63
72
|
backgroundColor: getTabLineColor(mode).lineColor
|
|
64
73
|
}
|
|
65
74
|
});
|
|
75
|
+
|
|
76
|
+
const tabPanelFocusStyles = mode => {
|
|
77
|
+
const colors = getTabColors(mode);
|
|
78
|
+
return {
|
|
79
|
+
boxShadow: `0 0 0 2px ${colors.focusBorderColor} inset`,
|
|
80
|
+
borderRadius: borderRadius,
|
|
81
|
+
outline: 'none',
|
|
82
|
+
// Hide TabLine on focus
|
|
83
|
+
'&::after': {
|
|
84
|
+
opacity: 0
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
|
|
66
89
|
export const getTabStyles = mode => {
|
|
67
90
|
const colors = getTabColors(mode);
|
|
68
91
|
return {
|
|
@@ -91,14 +114,9 @@ export const getTabStyles = mode => {
|
|
|
91
114
|
height: 0
|
|
92
115
|
}
|
|
93
116
|
},
|
|
94
|
-
'&:focus':
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
outline: 'none',
|
|
98
|
-
// Hide TabLine on focus
|
|
99
|
-
'&::after': {
|
|
100
|
-
opacity: 0
|
|
101
|
-
}
|
|
117
|
+
'&:focus-visible': tabPanelFocusStyles(mode),
|
|
118
|
+
'@supports not selector(*:focus-visible)': {
|
|
119
|
+
'&:focus': tabPanelFocusStyles(mode)
|
|
102
120
|
},
|
|
103
121
|
...highContrastFocusRing,
|
|
104
122
|
'&[aria-selected="true"]': {
|
package/dist/es2019/version.json
CHANGED
|
@@ -108,7 +108,7 @@ var TabList = function TabList(props) {
|
|
|
108
108
|
role: "tablist",
|
|
109
109
|
display: "flex",
|
|
110
110
|
position: "relative",
|
|
111
|
-
padding: "
|
|
111
|
+
padding: "scale.0",
|
|
112
112
|
ref: ref // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
113
113
|
,
|
|
114
114
|
css: tabListStyles
|
|
@@ -18,7 +18,7 @@ import { onMouseDownBlur } from '../internal/utils';
|
|
|
18
18
|
var analyticsAttributes = {
|
|
19
19
|
componentName: 'tabs',
|
|
20
20
|
packageName: "@atlaskit/tabs",
|
|
21
|
-
packageVersion: "13.3.
|
|
21
|
+
packageVersion: "13.3.5"
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
var getTabPanelWithContext = function getTabPanelWithContext(_ref) {
|
|
@@ -11,16 +11,28 @@ var borderRadius = getBorderRadius();
|
|
|
11
11
|
var gridSize = getGridSize();
|
|
12
12
|
var tabLeftRightPadding = "".concat(gridSize, "px");
|
|
13
13
|
var tabTopBottomPadding = "".concat(gridSize / 2, "px");
|
|
14
|
-
var underlineHeight = '2px';
|
|
14
|
+
var underlineHeight = '2px';
|
|
15
|
+
var highContrastFocusStyles = {
|
|
16
|
+
outline: '1px solid'
|
|
17
|
+
}; // Required so the focus ring is visible in high contrast mode
|
|
15
18
|
|
|
16
19
|
var highContrastFocusRing = {
|
|
17
20
|
'@media screen and (forced-colors: active), screen and (-ms-high-contrast: active)': {
|
|
18
|
-
'&:focus':
|
|
19
|
-
|
|
21
|
+
'&:focus-visible': highContrastFocusStyles,
|
|
22
|
+
'@supports not selector(*:focus-visible)': {
|
|
23
|
+
'&:focus': highContrastFocusStyles
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
};
|
|
23
27
|
|
|
28
|
+
var tabFocusStyles = function tabFocusStyles(mode) {
|
|
29
|
+
return {
|
|
30
|
+
boxShadow: "0 0 0 2px ".concat(getTabPanelFocusColor(mode), " inset"),
|
|
31
|
+
borderRadius: borderRadius,
|
|
32
|
+
outline: 'none'
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
24
36
|
var getTabPanelStyles = function getTabPanelStyles(mode) {
|
|
25
37
|
return _objectSpread({
|
|
26
38
|
flexGrow: 1,
|
|
@@ -32,10 +44,9 @@ var getTabPanelStyles = function getTabPanelStyles(mode) {
|
|
|
32
44
|
minHeight: '0%',
|
|
33
45
|
display: 'flex',
|
|
34
46
|
padding: "0 ".concat(tabLeftRightPadding),
|
|
35
|
-
'&:focus':
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
outline: 'none'
|
|
47
|
+
'&:focus-visible': tabFocusStyles(mode),
|
|
48
|
+
'@supports not selector(*:focus-visible)': {
|
|
49
|
+
'&:focus': tabFocusStyles(mode)
|
|
39
50
|
}
|
|
40
51
|
}, highContrastFocusRing);
|
|
41
52
|
};
|
|
@@ -76,6 +87,20 @@ export var getTabListStyles = function getTabListStyles(mode) {
|
|
|
76
87
|
})
|
|
77
88
|
);
|
|
78
89
|
};
|
|
90
|
+
|
|
91
|
+
var tabPanelFocusStyles = function tabPanelFocusStyles(mode) {
|
|
92
|
+
var colors = getTabColors(mode);
|
|
93
|
+
return {
|
|
94
|
+
boxShadow: "0 0 0 2px ".concat(colors.focusBorderColor, " inset"),
|
|
95
|
+
borderRadius: borderRadius,
|
|
96
|
+
outline: 'none',
|
|
97
|
+
// Hide TabLine on focus
|
|
98
|
+
'&::after': {
|
|
99
|
+
opacity: 0
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
|
|
79
104
|
export var getTabStyles = function getTabStyles(mode) {
|
|
80
105
|
var colors = getTabColors(mode);
|
|
81
106
|
return _objectSpread(_objectSpread({
|
|
@@ -104,14 +129,9 @@ export var getTabStyles = function getTabStyles(mode) {
|
|
|
104
129
|
height: 0
|
|
105
130
|
})
|
|
106
131
|
},
|
|
107
|
-
'&:focus':
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
outline: 'none',
|
|
111
|
-
// Hide TabLine on focus
|
|
112
|
-
'&::after': {
|
|
113
|
-
opacity: 0
|
|
114
|
-
}
|
|
132
|
+
'&:focus-visible': tabPanelFocusStyles(mode),
|
|
133
|
+
'@supports not selector(*:focus-visible)': {
|
|
134
|
+
'&:focus': tabPanelFocusStyles(mode)
|
|
115
135
|
}
|
|
116
136
|
}, highContrastFocusRing), {}, {
|
|
117
137
|
'&[aria-selected="true"]': {
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/tabs",
|
|
3
|
-
"version": "13.3.
|
|
3
|
+
"version": "13.3.5",
|
|
4
4
|
"description": "Tabs are used to organize content by grouping similar information on the same page.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
36
36
|
"@atlaskit/codemod-utils": "^4.1.0",
|
|
37
|
-
"@atlaskit/ds-explorations": "^
|
|
37
|
+
"@atlaskit/ds-explorations": "^1.0.0",
|
|
38
38
|
"@atlaskit/theme": "^12.2.0",
|
|
39
39
|
"@atlaskit/tokens": "^0.10.0",
|
|
40
40
|
"@babel/runtime": "^7.0.0",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"react": "^16.8.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@atlaskit/button": "^16.
|
|
47
|
+
"@atlaskit/button": "^16.4.0",
|
|
48
48
|
"@atlaskit/docs": "*",
|
|
49
49
|
"@atlaskit/ds-lib": "^2.1.0",
|
|
50
50
|
"@atlaskit/section-message": "^6.3.0",
|
|
51
|
-
"@atlaskit/spinner": "^15.
|
|
51
|
+
"@atlaskit/spinner": "^15.2.0",
|
|
52
52
|
"@atlaskit/ssr": "*",
|
|
53
53
|
"@atlaskit/tooltip": "^17.6.0",
|
|
54
54
|
"@atlaskit/visual-regression": "*",
|
package/report.api.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/tabs"
|
|
1
|
+
## API Report File for "@atlaskit/tabs"
|
|
2
2
|
|
|
3
|
-
> Do not edit this file.
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
<!--
|
|
6
|
+
Generated API Report version: 2.0
|
|
7
|
+
-->
|
|
4
8
|
|
|
5
9
|
[Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
6
10
|
|
|
@@ -12,263 +16,101 @@ import { ReactNode } from 'react';
|
|
|
12
16
|
import UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
|
|
13
17
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
// @public (undocumented)
|
|
20
|
+
type OnChangeCallback = (
|
|
16
21
|
index: SelectedType,
|
|
17
22
|
analyticsEvent: UIAnalyticsEvent,
|
|
18
23
|
) => void;
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
// @public (undocumented)
|
|
26
|
+
type SelectedType = number;
|
|
21
27
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
* Tab represents an indivudal Tab displayed in a TabList.
|
|
26
|
-
*
|
|
27
|
-
* - [Examples](https://atlassian.design/components/tabs/examples)
|
|
28
|
-
* - [Code](https://atlassian.design/components/tabs/code)
|
|
29
|
-
* - [Usage](https://atlassian.design/components/tabs/usage)
|
|
30
|
-
*/
|
|
31
|
-
export declare function Tab({ children, testId }: TabProps): jsx.JSX.Element;
|
|
28
|
+
// @public
|
|
29
|
+
export function Tab({ children, testId }: TabProps): jsx.JSX.Element;
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* Changes the selected tab.
|
|
36
|
-
*/
|
|
31
|
+
// @public (undocumented)
|
|
32
|
+
export type TabAttributesType = {
|
|
37
33
|
onClick: () => void;
|
|
38
|
-
/**
|
|
39
|
-
* ID of the tab.
|
|
40
|
-
*/
|
|
41
34
|
id: string;
|
|
42
|
-
/**
|
|
43
|
-
* The id of the tab panel that this tab links.
|
|
44
|
-
*/
|
|
45
35
|
'aria-controls': string;
|
|
46
|
-
/**
|
|
47
|
-
* The position of this tab within the tab list.
|
|
48
|
-
*/
|
|
49
36
|
'aria-posinset': number;
|
|
50
|
-
/**
|
|
51
|
-
* Whether this tab is selected.
|
|
52
|
-
*/
|
|
53
37
|
'aria-selected': boolean;
|
|
54
|
-
/**
|
|
55
|
-
* The number of tabs in this tab list.
|
|
56
|
-
*/
|
|
57
38
|
'aria-setsize': number;
|
|
58
|
-
/**
|
|
59
|
-
* Prevents a focus ring being shown when clicked.
|
|
60
|
-
*/
|
|
61
39
|
onMouseDown: (e: MouseEvent_2<HTMLElement>) => void;
|
|
62
|
-
/**
|
|
63
|
-
* Allows navigation of tabs with automatic activation.
|
|
64
|
-
* Read here for more details: https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-1/tabs.html
|
|
65
|
-
*/
|
|
66
40
|
onKeyDown: (e: KeyboardEvent_2<HTMLElement>) => void;
|
|
67
|
-
/**
|
|
68
|
-
* Role is "tab".
|
|
69
|
-
*/
|
|
70
41
|
role: 'tab';
|
|
71
|
-
/**
|
|
72
|
-
* If the tab is selected the tab index is 0 and is focusable.
|
|
73
|
-
* Otherwise it is -1 and is not focusable.
|
|
74
|
-
*/
|
|
75
42
|
tabIndex: number;
|
|
76
43
|
};
|
|
77
44
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
* <Tabs tabs={tabs} />
|
|
82
|
-
* The codemod changes this to be
|
|
83
|
-
* <Tabs>
|
|
84
|
-
* <TabList>
|
|
85
|
-
* {tabs.map(tab => <Tab testId={tab.testId}>{tab.label}</Tab>)}
|
|
86
|
-
* </TabList>
|
|
87
|
-
* {tabs.map(tab => <TabPanel>{tab.content}</TabPanel>)}
|
|
88
|
-
* </Tabs>
|
|
89
|
-
* The TabData type remains so the variable used in tabs can have a type.
|
|
90
|
-
*/
|
|
91
|
-
export declare interface TabData {
|
|
92
|
-
/**
|
|
93
|
-
* String to be put inside a tab
|
|
94
|
-
*/
|
|
95
|
-
label?: string;
|
|
96
|
-
/**
|
|
97
|
-
* String to be put inside a tab panel
|
|
98
|
-
*/
|
|
45
|
+
// @public @deprecated (undocumented)
|
|
46
|
+
export interface TabData {
|
|
47
|
+
[key: string]: any;
|
|
99
48
|
content?: ReactNode;
|
|
100
|
-
|
|
101
|
-
* A `testId` prop is provided for specified elements, which is a unique
|
|
102
|
-
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
103
|
-
* serving as a hook for automated tests. This `testId` is put on the tab.
|
|
104
|
-
*/
|
|
49
|
+
label?: string;
|
|
105
50
|
testId?: string;
|
|
106
|
-
/**
|
|
107
|
-
* Used by consumers to convey extra information about the tab.
|
|
108
|
-
*/
|
|
109
|
-
[key: string]: any;
|
|
110
51
|
}
|
|
111
52
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
*
|
|
115
|
-
* A TabList groups `Tab` components together.
|
|
116
|
-
*
|
|
117
|
-
* - [Examples](https://atlassian.design/components/tabs/examples)
|
|
118
|
-
* - [Code](https://atlassian.design/components/tabs/code)
|
|
119
|
-
* - [Usage](https://atlassian.design/components/tabs/usage)
|
|
120
|
-
*/
|
|
121
|
-
export declare const TabList: (props: TabListProps) => jsx.JSX.Element;
|
|
53
|
+
// @public
|
|
54
|
+
export const TabList: (props: TabListProps) => jsx.JSX.Element;
|
|
122
55
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
* The index of the selected tab.
|
|
126
|
-
*/
|
|
56
|
+
// @public (undocumented)
|
|
57
|
+
export type TabListAttributesType = {
|
|
127
58
|
selected: SelectedType;
|
|
128
|
-
/**
|
|
129
|
-
* A unique ID that will be used to generate IDs for tabs and tab panels.
|
|
130
|
-
* This is required for accessibility reasons.
|
|
131
|
-
*/
|
|
132
59
|
tabsId: string;
|
|
133
|
-
/**
|
|
134
|
-
* A callback function which will be fired when a tab is changed.
|
|
135
|
-
*/
|
|
136
60
|
onChange: (index: SelectedType) => void;
|
|
137
61
|
};
|
|
138
62
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
* A collection of `Tab`'s. There should be a `Tab` for each `TabPanel`.
|
|
142
|
-
* If you want to customize `Tab` there is documentation in the tab section.
|
|
143
|
-
*/
|
|
63
|
+
// @public (undocumented)
|
|
64
|
+
export interface TabListProps {
|
|
144
65
|
children: ReactNode;
|
|
145
66
|
}
|
|
146
67
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
*
|
|
150
|
-
* A TabPanel houses the contents of a Tab.
|
|
151
|
-
*
|
|
152
|
-
* - [Examples](https://atlassian.design/components/tabs/examples)
|
|
153
|
-
* - [Code](https://atlassian.design/components/tabs/code)
|
|
154
|
-
* - [Usage](https://atlassian.design/components/tabs/usage)
|
|
155
|
-
*/
|
|
156
|
-
export declare const TabPanel: ({
|
|
157
|
-
children,
|
|
158
|
-
testId,
|
|
159
|
-
}: TabPanelProps) => jsx.JSX.Element;
|
|
68
|
+
// @public
|
|
69
|
+
export const TabPanel: ({ children, testId }: TabPanelProps) => jsx.JSX.Element;
|
|
160
70
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
* Role is "tabpanel".
|
|
164
|
-
*/
|
|
71
|
+
// @public (undocumented)
|
|
72
|
+
export type TabPanelAttributesType = {
|
|
165
73
|
role: 'tabpanel';
|
|
166
|
-
/**
|
|
167
|
-
* ID of the the tab panel.
|
|
168
|
-
*/
|
|
169
74
|
id: string;
|
|
170
|
-
/**
|
|
171
|
-
* Hidden is true if it is not the selected tab.
|
|
172
|
-
*/
|
|
173
75
|
hidden?: boolean;
|
|
174
|
-
/**
|
|
175
|
-
* The id of the tab that links to this tab panel.
|
|
176
|
-
*/
|
|
177
76
|
'aria-labelledby': string;
|
|
178
|
-
/**
|
|
179
|
-
* Prevents a focus ring being shown when clicked.
|
|
180
|
-
*/
|
|
181
77
|
onMouseDown: (e: MouseEvent_2<HTMLElement>) => void;
|
|
182
|
-
/**
|
|
183
|
-
* If the tab panel is selected the tab index is 0 and is focusable.
|
|
184
|
-
* Otherwise it is -1 and is not focusable.
|
|
185
|
-
*/
|
|
186
78
|
tabIndex: number;
|
|
187
79
|
};
|
|
188
80
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
* The children to be rendered within a `TabPanel`.
|
|
192
|
-
*/
|
|
81
|
+
// @public (undocumented)
|
|
82
|
+
export interface TabPanelProps {
|
|
193
83
|
children: ReactNode;
|
|
194
|
-
/**
|
|
195
|
-
* A `testId` prop is is a unique string that appears as a data attribute `data-testid`
|
|
196
|
-
* on the `TabPanel` element, serving as a hook for automated tests.
|
|
197
|
-
*/
|
|
198
84
|
testId?: string;
|
|
199
85
|
}
|
|
200
86
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
* The children to be rendered within a `Tab`.
|
|
204
|
-
*/
|
|
87
|
+
// @public (undocumented)
|
|
88
|
+
export interface TabProps {
|
|
205
89
|
children: ReactNode;
|
|
206
|
-
/**
|
|
207
|
-
* A `testId` prop is is a unique string that appears as a data attribute `data-testid`
|
|
208
|
-
* on the `Tab` element, serving as a hook for automated tests.
|
|
209
|
-
*/
|
|
210
90
|
testId?: string;
|
|
211
91
|
}
|
|
212
92
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
*
|
|
216
|
-
* Tabs acts as a container for all Tab components.
|
|
217
|
-
*
|
|
218
|
-
* - [Examples](https://atlassian.design/components/tabs/examples)
|
|
219
|
-
* - [Code](https://atlassian.design/components/tabs/code)
|
|
220
|
-
* - [Usage](https://atlassian.design/components/tabs/usage)
|
|
221
|
-
*/
|
|
222
|
-
declare const Tabs: (props: TabsProps) => jsx.JSX.Element;
|
|
93
|
+
// @public
|
|
94
|
+
const Tabs: (props: TabsProps) => jsx.JSX.Element;
|
|
223
95
|
export default Tabs;
|
|
224
96
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
*/
|
|
97
|
+
// @public (undocumented)
|
|
98
|
+
export interface TabsProps extends WithAnalyticsEventsProps {
|
|
99
|
+
analyticsContext?: Record<string, any>;
|
|
100
|
+
children: ReactNode;
|
|
230
101
|
defaultSelected?: SelectedType;
|
|
231
|
-
|
|
232
|
-
* A callback function which will be fired when a changed. It will be passed
|
|
233
|
-
* the index of the selected tab and a `UIAnalyticsEvent`.
|
|
234
|
-
*/
|
|
102
|
+
id: string;
|
|
235
103
|
onChange?: OnChangeCallback;
|
|
236
|
-
/**
|
|
237
|
-
* The selected tab's index. If this prop is set the component behaves as a
|
|
238
|
-
* controlled component. It will be up to you to listen to `onChange`.
|
|
239
|
-
*/
|
|
240
104
|
selected?: SelectedType;
|
|
241
|
-
/**
|
|
242
|
-
* Tabs by default leaves `TabPanel`'s mounted on the page after they have been selected.
|
|
243
|
-
* If you would like to unmount a `TabPanel` when it is not selected, set this prop to
|
|
244
|
-
* be true.
|
|
245
|
-
*/
|
|
246
105
|
shouldUnmountTabPanelOnChange?: boolean;
|
|
247
|
-
/**
|
|
248
|
-
* Additional information to be included in the `context` of analytics events that come from `Tabs`.
|
|
249
|
-
*/
|
|
250
|
-
analyticsContext?: Record<string, any>;
|
|
251
|
-
/**
|
|
252
|
-
* A `testId` prop is a unique string that appears as a data attribute `data-testid`
|
|
253
|
-
* on the `Tabs` element, serving as a hook for automated tests.
|
|
254
|
-
*/
|
|
255
106
|
testId?: string;
|
|
256
|
-
/**
|
|
257
|
-
* The children of Tabs. The first child should be a `TabList` filled with `Tab`'s.
|
|
258
|
-
* Subsequent children should be `TabPanel`'s. There should be a `Tab` for each `TabPanel`.
|
|
259
|
-
* If you want to customize `Tab` or `TabPanel`, refer to the examples in the documentation.
|
|
260
|
-
*/
|
|
261
|
-
children: ReactNode;
|
|
262
|
-
/**
|
|
263
|
-
* A unique ID that will be used to generate IDs for tabs and tab panels.
|
|
264
|
-
* This is required for accessibility purposes.
|
|
265
|
-
*/
|
|
266
|
-
id: string;
|
|
267
107
|
}
|
|
268
108
|
|
|
269
|
-
|
|
109
|
+
// @public (undocumented)
|
|
110
|
+
export const useTab: () => TabAttributesType;
|
|
270
111
|
|
|
271
|
-
|
|
112
|
+
// @public (undocumented)
|
|
113
|
+
export const useTabPanel: () => TabPanelAttributesType;
|
|
272
114
|
|
|
273
|
-
|
|
115
|
+
// (No @packageDocumentation comment for this package)
|
|
274
116
|
```
|