@atlaskit/tabs 13.4.2 → 13.4.3
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 +6 -0
- package/dist/cjs/components/tab-list.js +1 -1
- package/dist/cjs/components/tabs.js +2 -2
- package/dist/cjs/internal/styles.js +6 -5
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/tab-list.js +1 -1
- package/dist/es2019/components/tabs.js +2 -2
- package/dist/es2019/internal/styles.js +6 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/tab-list.js +1 -1
- package/dist/esm/components/tabs.js +2 -2
- package/dist/esm/internal/styles.js +6 -5
- package/dist/esm/version.json +1 -1
- package/package.json +5 -5
- package/tmp/api-report-tmp.d.ts +109 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/tabs
|
|
2
2
|
|
|
3
|
+
## 13.4.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`599bfe90ee3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/599bfe90ee3) - Internal change to use shape tokens. There is no expected visual change.
|
|
8
|
+
|
|
3
9
|
## 13.4.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -109,7 +109,7 @@ var TabList = function TabList(props) {
|
|
|
109
109
|
position: "relative",
|
|
110
110
|
padding: "space.0",
|
|
111
111
|
ref: ref
|
|
112
|
-
// eslint-disable-next-line @
|
|
112
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
113
113
|
,
|
|
114
114
|
css: tabListStyles
|
|
115
115
|
}, childrenArray.map(function (child, index) {
|
|
@@ -21,7 +21,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
21
21
|
var analyticsAttributes = {
|
|
22
22
|
componentName: 'tabs',
|
|
23
23
|
packageName: "@atlaskit/tabs",
|
|
24
|
-
packageVersion: "13.4.
|
|
24
|
+
packageVersion: "13.4.3"
|
|
25
25
|
};
|
|
26
26
|
var getTabPanelWithContext = function getTabPanelWithContext(_ref) {
|
|
27
27
|
var tabPanel = _ref.tabPanel,
|
|
@@ -130,7 +130,7 @@ var Tabs = function Tabs(props) {
|
|
|
130
130
|
flexBasis: '100%',
|
|
131
131
|
flexGrow: 1
|
|
132
132
|
}
|
|
133
|
-
// eslint-disable-next-line @
|
|
133
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
134
134
|
,
|
|
135
135
|
css: tabsStyles
|
|
136
136
|
}, (0, _react2.jsx)(_context.TabListContext.Provider, {
|
|
@@ -12,9 +12,10 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
12
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
13
|
var tabLeftRightPadding = "var(--ds-space-100, 8px)";
|
|
14
14
|
var tabTopBottomPadding = "var(--ds-space-050, 4px)";
|
|
15
|
-
|
|
15
|
+
// TODO this should probably be `border.width.indicator`
|
|
16
|
+
var underlineHeight = "var(--ds-border-width-outline, 2px)";
|
|
16
17
|
var highContrastFocusStyles = {
|
|
17
|
-
outline:
|
|
18
|
+
outline: "var(--ds-border-width, 1px)".concat(" solid")
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
// Required so the focus ring is visible in high contrast mode
|
|
@@ -29,7 +30,7 @@ var highContrastFocusRing = {
|
|
|
29
30
|
var tabFocusStyles = function tabFocusStyles(mode) {
|
|
30
31
|
return {
|
|
31
32
|
boxShadow: "0 0 0 2px ".concat((0, _colors.getTabPanelFocusColor)(mode), " inset"),
|
|
32
|
-
borderRadius: "var(--ds-radius
|
|
33
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
33
34
|
outline: 'none'
|
|
34
35
|
};
|
|
35
36
|
};
|
|
@@ -66,7 +67,7 @@ var getTabsStyles = function getTabsStyles(mode) {
|
|
|
66
67
|
exports.getTabsStyles = getTabsStyles;
|
|
67
68
|
var tabLineStyles = {
|
|
68
69
|
content: '""',
|
|
69
|
-
borderRadius:
|
|
70
|
+
borderRadius: "var(--ds-border-radius-050, 2px)",
|
|
70
71
|
bottom: 0,
|
|
71
72
|
margin: 0,
|
|
72
73
|
position: 'absolute',
|
|
@@ -93,7 +94,7 @@ var tabPanelFocusStyles = function tabPanelFocusStyles(mode) {
|
|
|
93
94
|
var colors = (0, _colors.getTabColors)(mode);
|
|
94
95
|
return {
|
|
95
96
|
boxShadow: "0 0 0 2px ".concat(colors.focusBorderColor, " inset"),
|
|
96
|
-
borderRadius: "var(--ds-radius
|
|
97
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
97
98
|
outline: 'none',
|
|
98
99
|
// Hide TabLine on focus
|
|
99
100
|
'&::after': {
|
package/dist/cjs/version.json
CHANGED
|
@@ -101,7 +101,7 @@ const TabList = props => {
|
|
|
101
101
|
position: "relative",
|
|
102
102
|
padding: "space.0",
|
|
103
103
|
ref: ref
|
|
104
|
-
// eslint-disable-next-line @
|
|
104
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
105
105
|
,
|
|
106
106
|
css: tabListStyles
|
|
107
107
|
}, childrenArray.map((child, index) => getTabWithContext({
|
|
@@ -10,7 +10,7 @@ import { onMouseDownBlur } from '../internal/utils';
|
|
|
10
10
|
const analyticsAttributes = {
|
|
11
11
|
componentName: 'tabs',
|
|
12
12
|
packageName: "@atlaskit/tabs",
|
|
13
|
-
packageVersion: "13.4.
|
|
13
|
+
packageVersion: "13.4.3"
|
|
14
14
|
};
|
|
15
15
|
const getTabPanelWithContext = ({
|
|
16
16
|
tabPanel,
|
|
@@ -109,7 +109,7 @@ const Tabs = props => {
|
|
|
109
109
|
flexBasis: '100%',
|
|
110
110
|
flexGrow: 1
|
|
111
111
|
}
|
|
112
|
-
// eslint-disable-next-line @
|
|
112
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
113
113
|
,
|
|
114
114
|
css: tabsStyles
|
|
115
115
|
}, jsx(TabListContext.Provider, {
|
|
@@ -2,9 +2,10 @@ import { css } from '@emotion/react';
|
|
|
2
2
|
import { getTabColors, getTabLineColor, getTabPanelFocusColor } from './colors';
|
|
3
3
|
const tabLeftRightPadding = "var(--ds-space-100, 8px)";
|
|
4
4
|
const tabTopBottomPadding = "var(--ds-space-050, 4px)";
|
|
5
|
-
|
|
5
|
+
// TODO this should probably be `border.width.indicator`
|
|
6
|
+
const underlineHeight = "var(--ds-border-width-outline, 2px)";
|
|
6
7
|
const highContrastFocusStyles = {
|
|
7
|
-
outline:
|
|
8
|
+
outline: `${"var(--ds-border-width, 1px)"} solid`
|
|
8
9
|
};
|
|
9
10
|
|
|
10
11
|
// Required so the focus ring is visible in high contrast mode
|
|
@@ -18,7 +19,7 @@ const highContrastFocusRing = {
|
|
|
18
19
|
};
|
|
19
20
|
const tabFocusStyles = mode => ({
|
|
20
21
|
boxShadow: `0 0 0 2px ${getTabPanelFocusColor(mode)} inset`,
|
|
21
|
-
borderRadius: "var(--ds-radius
|
|
22
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
22
23
|
outline: 'none'
|
|
23
24
|
});
|
|
24
25
|
const getTabPanelStyles = mode => ({
|
|
@@ -49,7 +50,7 @@ css({
|
|
|
49
50
|
});
|
|
50
51
|
const tabLineStyles = {
|
|
51
52
|
content: '""',
|
|
52
|
-
borderRadius:
|
|
53
|
+
borderRadius: "var(--ds-border-radius-050, 2px)",
|
|
53
54
|
bottom: 0,
|
|
54
55
|
margin: 0,
|
|
55
56
|
position: 'absolute',
|
|
@@ -73,7 +74,7 @@ const tabPanelFocusStyles = mode => {
|
|
|
73
74
|
const colors = getTabColors(mode);
|
|
74
75
|
return {
|
|
75
76
|
boxShadow: `0 0 0 2px ${colors.focusBorderColor} inset`,
|
|
76
|
-
borderRadius: "var(--ds-radius
|
|
77
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
77
78
|
outline: 'none',
|
|
78
79
|
// Hide TabLine on focus
|
|
79
80
|
'&::after': {
|
package/dist/es2019/version.json
CHANGED
|
@@ -102,7 +102,7 @@ var TabList = function TabList(props) {
|
|
|
102
102
|
position: "relative",
|
|
103
103
|
padding: "space.0",
|
|
104
104
|
ref: ref
|
|
105
|
-
// eslint-disable-next-line @
|
|
105
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
106
106
|
,
|
|
107
107
|
css: tabListStyles
|
|
108
108
|
}, childrenArray.map(function (child, index) {
|
|
@@ -15,7 +15,7 @@ import { onMouseDownBlur } from '../internal/utils';
|
|
|
15
15
|
var analyticsAttributes = {
|
|
16
16
|
componentName: 'tabs',
|
|
17
17
|
packageName: "@atlaskit/tabs",
|
|
18
|
-
packageVersion: "13.4.
|
|
18
|
+
packageVersion: "13.4.3"
|
|
19
19
|
};
|
|
20
20
|
var getTabPanelWithContext = function getTabPanelWithContext(_ref) {
|
|
21
21
|
var tabPanel = _ref.tabPanel,
|
|
@@ -124,7 +124,7 @@ var Tabs = function Tabs(props) {
|
|
|
124
124
|
flexBasis: '100%',
|
|
125
125
|
flexGrow: 1
|
|
126
126
|
}
|
|
127
|
-
// eslint-disable-next-line @
|
|
127
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
128
128
|
,
|
|
129
129
|
css: tabsStyles
|
|
130
130
|
}, jsx(TabListContext.Provider, {
|
|
@@ -5,9 +5,10 @@ import { css } from '@emotion/react';
|
|
|
5
5
|
import { getTabColors, getTabLineColor, getTabPanelFocusColor } from './colors';
|
|
6
6
|
var tabLeftRightPadding = "var(--ds-space-100, 8px)";
|
|
7
7
|
var tabTopBottomPadding = "var(--ds-space-050, 4px)";
|
|
8
|
-
|
|
8
|
+
// TODO this should probably be `border.width.indicator`
|
|
9
|
+
var underlineHeight = "var(--ds-border-width-outline, 2px)";
|
|
9
10
|
var highContrastFocusStyles = {
|
|
10
|
-
outline:
|
|
11
|
+
outline: "var(--ds-border-width, 1px)".concat(" solid")
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
// Required so the focus ring is visible in high contrast mode
|
|
@@ -22,7 +23,7 @@ var highContrastFocusRing = {
|
|
|
22
23
|
var tabFocusStyles = function tabFocusStyles(mode) {
|
|
23
24
|
return {
|
|
24
25
|
boxShadow: "0 0 0 2px ".concat(getTabPanelFocusColor(mode), " inset"),
|
|
25
|
-
borderRadius: "var(--ds-radius
|
|
26
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
26
27
|
outline: 'none'
|
|
27
28
|
};
|
|
28
29
|
};
|
|
@@ -58,7 +59,7 @@ export var getTabsStyles = function getTabsStyles(mode) {
|
|
|
58
59
|
};
|
|
59
60
|
var tabLineStyles = {
|
|
60
61
|
content: '""',
|
|
61
|
-
borderRadius:
|
|
62
|
+
borderRadius: "var(--ds-border-radius-050, 2px)",
|
|
62
63
|
bottom: 0,
|
|
63
64
|
margin: 0,
|
|
64
65
|
position: 'absolute',
|
|
@@ -84,7 +85,7 @@ var tabPanelFocusStyles = function tabPanelFocusStyles(mode) {
|
|
|
84
85
|
var colors = getTabColors(mode);
|
|
85
86
|
return {
|
|
86
87
|
boxShadow: "0 0 0 2px ".concat(colors.focusBorderColor, " inset"),
|
|
87
|
-
borderRadius: "var(--ds-radius
|
|
88
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
88
89
|
outline: 'none',
|
|
89
90
|
// Hide TabLine on focus
|
|
90
91
|
'&::after': {
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/tabs",
|
|
3
|
-
"version": "13.4.
|
|
3
|
+
"version": "13.4.3",
|
|
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/"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"atlaskit:src": "src/index.tsx",
|
|
25
25
|
"atlassian": {
|
|
26
26
|
"team": "Design System Team",
|
|
27
|
-
"releaseModel": "
|
|
27
|
+
"releaseModel": "continuous",
|
|
28
28
|
"website": {
|
|
29
29
|
"name": "Tabs",
|
|
30
30
|
"category": "Components"
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
35
35
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
36
|
-
"@atlaskit/ds-explorations": "^2.
|
|
36
|
+
"@atlaskit/ds-explorations": "^2.2.0",
|
|
37
37
|
"@atlaskit/theme": "^12.5.0",
|
|
38
|
-
"@atlaskit/tokens": "^1.
|
|
38
|
+
"@atlaskit/tokens": "^1.11.0",
|
|
39
39
|
"@babel/runtime": "^7.0.0",
|
|
40
40
|
"@emotion/react": "^11.7.1"
|
|
41
41
|
},
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"react": "^16.8.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@atlaskit/button": "^16.
|
|
46
|
+
"@atlaskit/button": "^16.8.0",
|
|
47
47
|
"@atlaskit/docs": "*",
|
|
48
48
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
49
49
|
"@atlaskit/section-message": "^6.4.0",
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/tabs"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { jsx } from '@emotion/react';
|
|
8
|
+
import { KeyboardEvent as KeyboardEvent_2 } from 'react';
|
|
9
|
+
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
10
|
+
import { ReactNode } from 'react';
|
|
11
|
+
import UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
|
|
12
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
13
|
+
|
|
14
|
+
// @public (undocumented)
|
|
15
|
+
type OnChangeCallback = (index: SelectedType, analyticsEvent: UIAnalyticsEvent) => void;
|
|
16
|
+
|
|
17
|
+
// @public (undocumented)
|
|
18
|
+
type SelectedType = number;
|
|
19
|
+
|
|
20
|
+
// @public
|
|
21
|
+
export function Tab({ children, testId }: TabProps): jsx.JSX.Element;
|
|
22
|
+
|
|
23
|
+
// @public (undocumented)
|
|
24
|
+
export type TabAttributesType = {
|
|
25
|
+
onClick: () => void;
|
|
26
|
+
id: string;
|
|
27
|
+
'aria-controls': string;
|
|
28
|
+
'aria-posinset': number;
|
|
29
|
+
'aria-selected': boolean;
|
|
30
|
+
'aria-setsize': number;
|
|
31
|
+
onMouseDown: (e: MouseEvent_2<HTMLElement>) => void;
|
|
32
|
+
onKeyDown: (e: KeyboardEvent_2<HTMLElement>) => void;
|
|
33
|
+
role: 'tab';
|
|
34
|
+
tabIndex: number;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// @public @deprecated (undocumented)
|
|
38
|
+
export interface TabData {
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
content?: ReactNode;
|
|
41
|
+
label?: string;
|
|
42
|
+
testId?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// @public
|
|
46
|
+
export const TabList: (props: TabListProps) => jsx.JSX.Element;
|
|
47
|
+
|
|
48
|
+
// @public (undocumented)
|
|
49
|
+
export type TabListAttributesType = {
|
|
50
|
+
selected: SelectedType;
|
|
51
|
+
tabsId: string;
|
|
52
|
+
onChange: (index: SelectedType) => void;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// @public (undocumented)
|
|
56
|
+
export interface TabListProps {
|
|
57
|
+
children: ReactNode;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// @public
|
|
61
|
+
export const TabPanel: ({ children, testId }: TabPanelProps) => jsx.JSX.Element;
|
|
62
|
+
|
|
63
|
+
// @public (undocumented)
|
|
64
|
+
export type TabPanelAttributesType = {
|
|
65
|
+
role: 'tabpanel';
|
|
66
|
+
id: string;
|
|
67
|
+
hidden?: boolean;
|
|
68
|
+
'aria-labelledby': string;
|
|
69
|
+
onMouseDown: (e: MouseEvent_2<HTMLElement>) => void;
|
|
70
|
+
tabIndex: number;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// @public (undocumented)
|
|
74
|
+
export interface TabPanelProps {
|
|
75
|
+
children: ReactNode;
|
|
76
|
+
testId?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// @public (undocumented)
|
|
80
|
+
export interface TabProps {
|
|
81
|
+
children: ReactNode;
|
|
82
|
+
testId?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// @public
|
|
86
|
+
const Tabs: (props: TabsProps) => jsx.JSX.Element;
|
|
87
|
+
export default Tabs;
|
|
88
|
+
|
|
89
|
+
// @public (undocumented)
|
|
90
|
+
export interface TabsProps extends WithAnalyticsEventsProps {
|
|
91
|
+
analyticsContext?: Record<string, any>;
|
|
92
|
+
children: ReactNode;
|
|
93
|
+
defaultSelected?: SelectedType;
|
|
94
|
+
id: string;
|
|
95
|
+
onChange?: OnChangeCallback;
|
|
96
|
+
selected?: SelectedType;
|
|
97
|
+
shouldUnmountTabPanelOnChange?: boolean;
|
|
98
|
+
testId?: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// @public (undocumented)
|
|
102
|
+
export const useTab: () => TabAttributesType;
|
|
103
|
+
|
|
104
|
+
// @public (undocumented)
|
|
105
|
+
export const useTabPanel: () => TabPanelAttributesType;
|
|
106
|
+
|
|
107
|
+
// (No @packageDocumentation comment for this package)
|
|
108
|
+
|
|
109
|
+
```
|