@atlaskit/tabs 14.0.5 → 14.1.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/CHANGELOG.md +6 -0
- package/dist/cjs/components/tab-panel.js +7 -4
- package/dist/cjs/components/tab.js +7 -4
- package/dist/cjs/components/tabs.js +1 -1
- package/dist/cjs/internal/colors.js +2 -3
- package/dist/cjs/internal/styles.js +5 -46
- package/dist/es2019/components/tab-panel.js +6 -4
- package/dist/es2019/components/tab.js +6 -4
- package/dist/es2019/components/tabs.js +1 -1
- package/dist/es2019/internal/colors.js +1 -2
- package/dist/es2019/internal/styles.js +2 -42
- package/dist/esm/components/tab-panel.js +6 -4
- package/dist/esm/components/tab.js +6 -4
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/internal/colors.js +1 -2
- package/dist/esm/internal/styles.js +6 -47
- package/dist/types/internal/colors.d.ts +0 -1
- package/dist/types-ts4.5/internal/colors.d.ts +0 -1
- package/package.json +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/tabs
|
|
2
2
|
|
|
3
|
+
## 14.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#90584](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90584) [`fccb64237f6c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fccb64237f6c) - [ux] Internal changes to focus styles
|
|
8
|
+
|
|
3
9
|
## 14.0.5
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = void 0;
|
|
7
8
|
var _react = require("react");
|
|
8
9
|
var _react2 = require("@emotion/react");
|
|
9
|
-
var
|
|
10
|
+
var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
|
|
10
11
|
var _hooks = require("../hooks");
|
|
11
12
|
/** @jsx jsx */
|
|
12
13
|
|
|
@@ -30,14 +31,16 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
30
31
|
ariaLabelledBy = _useTabPanel['aria-labelledby'],
|
|
31
32
|
onMouseDown = _useTabPanel.onMouseDown,
|
|
32
33
|
tabIndex = _useTabPanel.tabIndex;
|
|
33
|
-
return (0, _react2.jsx)(
|
|
34
|
-
|
|
34
|
+
return (0, _react2.jsx)(_focusRing.default, {
|
|
35
|
+
isInset: true
|
|
36
|
+
}, (0, _react2.jsx)("div", {
|
|
37
|
+
"data-testid": testId,
|
|
35
38
|
role: role,
|
|
36
39
|
id: id,
|
|
37
40
|
hidden: hidden,
|
|
38
41
|
"aria-labelledby": ariaLabelledBy,
|
|
39
42
|
onMouseDown: onMouseDown,
|
|
40
43
|
tabIndex: tabIndex
|
|
41
|
-
}, (0, _react2.jsx)(_react.Fragment, null, children));
|
|
44
|
+
}, (0, _react2.jsx)(_react.Fragment, null, children)));
|
|
42
45
|
};
|
|
43
46
|
var _default = exports.default = TabPanel;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = Tab;
|
|
7
8
|
var _react = require("@emotion/react");
|
|
8
9
|
var _dsExplorations = require("@atlaskit/ds-explorations");
|
|
9
|
-
var
|
|
10
|
+
var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
|
|
10
11
|
var _hooks = require("../hooks");
|
|
11
12
|
/** @jsx jsx */
|
|
12
13
|
|
|
@@ -33,8 +34,10 @@ function Tab(_ref) {
|
|
|
33
34
|
onKeyDown = _useTab.onKeyDown,
|
|
34
35
|
role = _useTab.role,
|
|
35
36
|
tabIndex = _useTab.tabIndex;
|
|
36
|
-
return (0, _react.jsx)(
|
|
37
|
-
|
|
37
|
+
return (0, _react.jsx)(_focusRing.default, {
|
|
38
|
+
isInset: true
|
|
39
|
+
}, (0, _react.jsx)("div", {
|
|
40
|
+
"data-testid": testId,
|
|
38
41
|
onClick: onClick,
|
|
39
42
|
id: id,
|
|
40
43
|
"aria-controls": ariaControls,
|
|
@@ -50,5 +53,5 @@ function Tab(_ref) {
|
|
|
50
53
|
UNSAFE_style: {
|
|
51
54
|
color: 'inherit'
|
|
52
55
|
}
|
|
53
|
-
}, children));
|
|
56
|
+
}, children)));
|
|
54
57
|
}
|
|
@@ -30,7 +30,7 @@ var tabsStyles = (0, _styles.getTabsStyles)();
|
|
|
30
30
|
var analyticsAttributes = {
|
|
31
31
|
componentName: 'tabs',
|
|
32
32
|
packageName: "@atlaskit/tabs",
|
|
33
|
-
packageVersion: "14.0
|
|
33
|
+
packageVersion: "14.1.0"
|
|
34
34
|
};
|
|
35
35
|
var getTabPanelWithContext = function getTabPanelWithContext(_ref) {
|
|
36
36
|
var tabPanel = _ref.tabPanel,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.tabLineColors = exports.tabColors = void 0;
|
|
7
7
|
var _colors = require("@atlaskit/theme/colors");
|
|
8
8
|
var tabColors = exports.tabColors = {
|
|
9
9
|
labelColor: "var(--ds-text-subtle, ".concat(_colors.N500, ")"),
|
|
@@ -17,5 +17,4 @@ var tabLineColors = exports.tabLineColors = {
|
|
|
17
17
|
hoveredColor: "var(--ds-border, transparent)",
|
|
18
18
|
activeColor: "var(--ds-border, transparent)",
|
|
19
19
|
selectedColor: "var(--ds-border-selected, ".concat(_colors.B400, ")")
|
|
20
|
-
};
|
|
21
|
-
var tabPanelFocusColor = exports.tabPanelFocusColor = "var(--ds-border-focused, ".concat(_colors.B100, ")");
|
|
20
|
+
};
|
|
@@ -14,28 +14,8 @@ 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
16
|
var underlineHeight = "var(--ds-border-width-outline, 2px)";
|
|
17
|
-
var highContrastFocusStyles = {
|
|
18
|
-
outline: "var(--ds-border-width, 1px)".concat(" solid")
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
// Required so the focus ring is visible in high contrast mode
|
|
22
|
-
var highContrastFocusRing = {
|
|
23
|
-
'@media screen and (forced-colors: active), screen and (-ms-high-contrast: active)': {
|
|
24
|
-
'&:focus-visible': highContrastFocusStyles,
|
|
25
|
-
'@supports not selector(*:focus-visible)': {
|
|
26
|
-
'&:focus': highContrastFocusStyles
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
var tabFocusStyles = function tabFocusStyles() {
|
|
31
|
-
return {
|
|
32
|
-
boxShadow: "0 0 0 2px ".concat(_colors.tabPanelFocusColor, " inset"),
|
|
33
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
34
|
-
outline: 'none'
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
17
|
var getTabPanelStyles = function getTabPanelStyles() {
|
|
38
|
-
return
|
|
18
|
+
return {
|
|
39
19
|
flexGrow: 1,
|
|
40
20
|
/*
|
|
41
21
|
NOTE min-height set to 0% because of Firefox bug
|
|
@@ -43,12 +23,8 @@ var getTabPanelStyles = function getTabPanelStyles() {
|
|
|
43
23
|
*/
|
|
44
24
|
minHeight: '0%',
|
|
45
25
|
display: 'flex',
|
|
46
|
-
padding: "0 ".concat(tabLeftRightPadding)
|
|
47
|
-
|
|
48
|
-
'@supports not selector(*:focus-visible)': {
|
|
49
|
-
'&:focus': tabFocusStyles()
|
|
50
|
-
}
|
|
51
|
-
}, highContrastFocusRing);
|
|
26
|
+
padding: "0 ".concat(tabLeftRightPadding)
|
|
27
|
+
};
|
|
52
28
|
};
|
|
53
29
|
var getTabsStyles = exports.getTabsStyles = function getTabsStyles() {
|
|
54
30
|
return (
|
|
@@ -88,21 +64,9 @@ var getTabListStyles = exports.getTabListStyles = function getTabListStyles() {
|
|
|
88
64
|
})
|
|
89
65
|
);
|
|
90
66
|
};
|
|
91
|
-
var tabPanelFocusStyles = function tabPanelFocusStyles() {
|
|
92
|
-
var colors = _colors.tabColors;
|
|
93
|
-
return {
|
|
94
|
-
boxShadow: "0 0 0 2px ".concat(colors.focusBorderColor, " inset"),
|
|
95
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
96
|
-
outline: 'none',
|
|
97
|
-
// Hide TabLine on focus
|
|
98
|
-
'&::after': {
|
|
99
|
-
opacity: 0
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
67
|
var getTabStyles = exports.getTabStyles = function getTabStyles() {
|
|
104
68
|
var colors = _colors.tabColors;
|
|
105
|
-
return
|
|
69
|
+
return {
|
|
106
70
|
color: colors.labelColor,
|
|
107
71
|
cursor: 'pointer',
|
|
108
72
|
lineHeight: 1.8,
|
|
@@ -128,11 +92,6 @@ var getTabStyles = exports.getTabStyles = function getTabStyles() {
|
|
|
128
92
|
height: 0
|
|
129
93
|
})
|
|
130
94
|
},
|
|
131
|
-
'&:focus-visible': tabPanelFocusStyles(),
|
|
132
|
-
'@supports not selector(*:focus-visible)': {
|
|
133
|
-
'&:focus': tabPanelFocusStyles()
|
|
134
|
-
}
|
|
135
|
-
}, highContrastFocusRing), {}, {
|
|
136
95
|
'&[aria-selected="true"]': {
|
|
137
96
|
color: colors.selectedColor,
|
|
138
97
|
'&::after': _objectSpread(_objectSpread({}, tabLineStyles), {}, {
|
|
@@ -141,5 +100,5 @@ var getTabStyles = exports.getTabStyles = function getTabStyles() {
|
|
|
141
100
|
height: 0
|
|
142
101
|
})
|
|
143
102
|
}
|
|
144
|
-
}
|
|
103
|
+
};
|
|
145
104
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Fragment } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import
|
|
4
|
+
import FocusRing from '@atlaskit/focus-ring';
|
|
5
5
|
import { useTabPanel } from '../hooks';
|
|
6
6
|
// Note this is not being memoized as children is an unstable reference
|
|
7
7
|
/**
|
|
@@ -25,14 +25,16 @@ const TabPanel = ({
|
|
|
25
25
|
onMouseDown,
|
|
26
26
|
tabIndex
|
|
27
27
|
} = useTabPanel();
|
|
28
|
-
return jsx(
|
|
29
|
-
|
|
28
|
+
return jsx(FocusRing, {
|
|
29
|
+
isInset: true
|
|
30
|
+
}, jsx("div", {
|
|
31
|
+
"data-testid": testId,
|
|
30
32
|
role: role,
|
|
31
33
|
id: id,
|
|
32
34
|
hidden: hidden,
|
|
33
35
|
"aria-labelledby": ariaLabelledBy,
|
|
34
36
|
onMouseDown: onMouseDown,
|
|
35
37
|
tabIndex: tabIndex
|
|
36
|
-
}, jsx(Fragment, null, children));
|
|
38
|
+
}, jsx(Fragment, null, children)));
|
|
37
39
|
};
|
|
38
40
|
export default TabPanel;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
|
|
4
|
-
import
|
|
4
|
+
import FocusRing from '@atlaskit/focus-ring';
|
|
5
5
|
import { useTab } from '../hooks';
|
|
6
6
|
/**
|
|
7
7
|
* __Tab__
|
|
@@ -28,8 +28,10 @@ export default function Tab({
|
|
|
28
28
|
role,
|
|
29
29
|
tabIndex
|
|
30
30
|
} = useTab();
|
|
31
|
-
return jsx(
|
|
32
|
-
|
|
31
|
+
return jsx(FocusRing, {
|
|
32
|
+
isInset: true
|
|
33
|
+
}, jsx("div", {
|
|
34
|
+
"data-testid": testId,
|
|
33
35
|
onClick: onClick,
|
|
34
36
|
id: id,
|
|
35
37
|
"aria-controls": ariaControls,
|
|
@@ -45,5 +47,5 @@ export default function Tab({
|
|
|
45
47
|
UNSAFE_style: {
|
|
46
48
|
color: 'inherit'
|
|
47
49
|
}
|
|
48
|
-
}, children));
|
|
50
|
+
}, children)));
|
|
49
51
|
}
|
|
@@ -11,5 +11,4 @@ export const tabLineColors = {
|
|
|
11
11
|
hoveredColor: "var(--ds-border, transparent)",
|
|
12
12
|
activeColor: "var(--ds-border, transparent)",
|
|
13
13
|
selectedColor: `var(--ds-border-selected, ${B400})`
|
|
14
|
-
};
|
|
15
|
-
export const tabPanelFocusColor = `var(--ds-border-focused, ${B100})`;
|
|
14
|
+
};
|
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
import { tabColors, tabLineColors
|
|
2
|
+
import { tabColors, tabLineColors } 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
6
|
const underlineHeight = "var(--ds-border-width-outline, 2px)";
|
|
7
|
-
const highContrastFocusStyles = {
|
|
8
|
-
outline: `${"var(--ds-border-width, 1px)"} solid`
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
// Required so the focus ring is visible in high contrast mode
|
|
12
|
-
const highContrastFocusRing = {
|
|
13
|
-
'@media screen and (forced-colors: active), screen and (-ms-high-contrast: active)': {
|
|
14
|
-
'&:focus-visible': highContrastFocusStyles,
|
|
15
|
-
'@supports not selector(*:focus-visible)': {
|
|
16
|
-
'&:focus': highContrastFocusStyles
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
const tabFocusStyles = () => ({
|
|
21
|
-
boxShadow: `0 0 0 2px ${tabPanelFocusColor} inset`,
|
|
22
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
23
|
-
outline: 'none'
|
|
24
|
-
});
|
|
25
7
|
const getTabPanelStyles = () => ({
|
|
26
8
|
flexGrow: 1,
|
|
27
9
|
/*
|
|
@@ -30,12 +12,7 @@ const getTabPanelStyles = () => ({
|
|
|
30
12
|
*/
|
|
31
13
|
minHeight: '0%',
|
|
32
14
|
display: 'flex',
|
|
33
|
-
padding: `0 ${tabLeftRightPadding}
|
|
34
|
-
'&:focus-visible': tabFocusStyles(),
|
|
35
|
-
'@supports not selector(*:focus-visible)': {
|
|
36
|
-
'&:focus': tabFocusStyles()
|
|
37
|
-
},
|
|
38
|
-
...highContrastFocusRing
|
|
15
|
+
padding: `0 ${tabLeftRightPadding}`
|
|
39
16
|
});
|
|
40
17
|
export const getTabsStyles = () =>
|
|
41
18
|
// eslint-disable-next-line @repo/internal/styles/no-exported-styles
|
|
@@ -70,18 +47,6 @@ css({
|
|
|
70
47
|
backgroundColor: tabLineColors.lineColor
|
|
71
48
|
}
|
|
72
49
|
});
|
|
73
|
-
const tabPanelFocusStyles = () => {
|
|
74
|
-
const colors = tabColors;
|
|
75
|
-
return {
|
|
76
|
-
boxShadow: `0 0 0 2px ${colors.focusBorderColor} inset`,
|
|
77
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
78
|
-
outline: 'none',
|
|
79
|
-
// Hide TabLine on focus
|
|
80
|
-
'&::after': {
|
|
81
|
-
opacity: 0
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
50
|
export const getTabStyles = () => {
|
|
86
51
|
const colors = tabColors;
|
|
87
52
|
return {
|
|
@@ -112,11 +77,6 @@ export const getTabStyles = () => {
|
|
|
112
77
|
height: 0
|
|
113
78
|
}
|
|
114
79
|
},
|
|
115
|
-
'&:focus-visible': tabPanelFocusStyles(),
|
|
116
|
-
'@supports not selector(*:focus-visible)': {
|
|
117
|
-
'&:focus': tabPanelFocusStyles()
|
|
118
|
-
},
|
|
119
|
-
...highContrastFocusRing,
|
|
120
80
|
'&[aria-selected="true"]': {
|
|
121
81
|
color: colors.selectedColor,
|
|
122
82
|
'&::after': {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Fragment } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import
|
|
4
|
+
import FocusRing from '@atlaskit/focus-ring';
|
|
5
5
|
import { useTabPanel } from '../hooks';
|
|
6
6
|
// Note this is not being memoized as children is an unstable reference
|
|
7
7
|
/**
|
|
@@ -23,14 +23,16 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
23
23
|
ariaLabelledBy = _useTabPanel['aria-labelledby'],
|
|
24
24
|
onMouseDown = _useTabPanel.onMouseDown,
|
|
25
25
|
tabIndex = _useTabPanel.tabIndex;
|
|
26
|
-
return jsx(
|
|
27
|
-
|
|
26
|
+
return jsx(FocusRing, {
|
|
27
|
+
isInset: true
|
|
28
|
+
}, jsx("div", {
|
|
29
|
+
"data-testid": testId,
|
|
28
30
|
role: role,
|
|
29
31
|
id: id,
|
|
30
32
|
hidden: hidden,
|
|
31
33
|
"aria-labelledby": ariaLabelledBy,
|
|
32
34
|
onMouseDown: onMouseDown,
|
|
33
35
|
tabIndex: tabIndex
|
|
34
|
-
}, jsx(Fragment, null, children));
|
|
36
|
+
}, jsx(Fragment, null, children)));
|
|
35
37
|
};
|
|
36
38
|
export default TabPanel;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
|
|
4
|
-
import
|
|
4
|
+
import FocusRing from '@atlaskit/focus-ring';
|
|
5
5
|
import { useTab } from '../hooks';
|
|
6
6
|
/**
|
|
7
7
|
* __Tab__
|
|
@@ -26,8 +26,10 @@ export default function Tab(_ref) {
|
|
|
26
26
|
onKeyDown = _useTab.onKeyDown,
|
|
27
27
|
role = _useTab.role,
|
|
28
28
|
tabIndex = _useTab.tabIndex;
|
|
29
|
-
return jsx(
|
|
30
|
-
|
|
29
|
+
return jsx(FocusRing, {
|
|
30
|
+
isInset: true
|
|
31
|
+
}, jsx("div", {
|
|
32
|
+
"data-testid": testId,
|
|
31
33
|
onClick: onClick,
|
|
32
34
|
id: id,
|
|
33
35
|
"aria-controls": ariaControls,
|
|
@@ -43,5 +45,5 @@ export default function Tab(_ref) {
|
|
|
43
45
|
UNSAFE_style: {
|
|
44
46
|
color: 'inherit'
|
|
45
47
|
}
|
|
46
|
-
}, children));
|
|
48
|
+
}, children)));
|
|
47
49
|
}
|
|
@@ -24,7 +24,7 @@ var tabsStyles = getTabsStyles();
|
|
|
24
24
|
var analyticsAttributes = {
|
|
25
25
|
componentName: 'tabs',
|
|
26
26
|
packageName: "@atlaskit/tabs",
|
|
27
|
-
packageVersion: "14.0
|
|
27
|
+
packageVersion: "14.1.0"
|
|
28
28
|
};
|
|
29
29
|
var getTabPanelWithContext = function getTabPanelWithContext(_ref) {
|
|
30
30
|
var tabPanel = _ref.tabPanel,
|
|
@@ -11,5 +11,4 @@ export var tabLineColors = {
|
|
|
11
11
|
hoveredColor: "var(--ds-border, transparent)",
|
|
12
12
|
activeColor: "var(--ds-border, transparent)",
|
|
13
13
|
selectedColor: "var(--ds-border-selected, ".concat(B400, ")")
|
|
14
|
-
};
|
|
15
|
-
export var tabPanelFocusColor = "var(--ds-border-focused, ".concat(B100, ")");
|
|
14
|
+
};
|
|
@@ -2,33 +2,13 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
|
-
import { tabColors, tabLineColors
|
|
5
|
+
import { tabColors, tabLineColors } 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
9
|
var underlineHeight = "var(--ds-border-width-outline, 2px)";
|
|
10
|
-
var highContrastFocusStyles = {
|
|
11
|
-
outline: "var(--ds-border-width, 1px)".concat(" solid")
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
// Required so the focus ring is visible in high contrast mode
|
|
15
|
-
var highContrastFocusRing = {
|
|
16
|
-
'@media screen and (forced-colors: active), screen and (-ms-high-contrast: active)': {
|
|
17
|
-
'&:focus-visible': highContrastFocusStyles,
|
|
18
|
-
'@supports not selector(*:focus-visible)': {
|
|
19
|
-
'&:focus': highContrastFocusStyles
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
var tabFocusStyles = function tabFocusStyles() {
|
|
24
|
-
return {
|
|
25
|
-
boxShadow: "0 0 0 2px ".concat(tabPanelFocusColor, " inset"),
|
|
26
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
27
|
-
outline: 'none'
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
10
|
var getTabPanelStyles = function getTabPanelStyles() {
|
|
31
|
-
return
|
|
11
|
+
return {
|
|
32
12
|
flexGrow: 1,
|
|
33
13
|
/*
|
|
34
14
|
NOTE min-height set to 0% because of Firefox bug
|
|
@@ -36,12 +16,8 @@ var getTabPanelStyles = function getTabPanelStyles() {
|
|
|
36
16
|
*/
|
|
37
17
|
minHeight: '0%',
|
|
38
18
|
display: 'flex',
|
|
39
|
-
padding: "0 ".concat(tabLeftRightPadding)
|
|
40
|
-
|
|
41
|
-
'@supports not selector(*:focus-visible)': {
|
|
42
|
-
'&:focus': tabFocusStyles()
|
|
43
|
-
}
|
|
44
|
-
}, highContrastFocusRing);
|
|
19
|
+
padding: "0 ".concat(tabLeftRightPadding)
|
|
20
|
+
};
|
|
45
21
|
};
|
|
46
22
|
export var getTabsStyles = function getTabsStyles() {
|
|
47
23
|
return (
|
|
@@ -81,21 +57,9 @@ export var getTabListStyles = function getTabListStyles() {
|
|
|
81
57
|
})
|
|
82
58
|
);
|
|
83
59
|
};
|
|
84
|
-
var tabPanelFocusStyles = function tabPanelFocusStyles() {
|
|
85
|
-
var colors = tabColors;
|
|
86
|
-
return {
|
|
87
|
-
boxShadow: "0 0 0 2px ".concat(colors.focusBorderColor, " inset"),
|
|
88
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
89
|
-
outline: 'none',
|
|
90
|
-
// Hide TabLine on focus
|
|
91
|
-
'&::after': {
|
|
92
|
-
opacity: 0
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
60
|
export var getTabStyles = function getTabStyles() {
|
|
97
61
|
var colors = tabColors;
|
|
98
|
-
return
|
|
62
|
+
return {
|
|
99
63
|
color: colors.labelColor,
|
|
100
64
|
cursor: 'pointer',
|
|
101
65
|
lineHeight: 1.8,
|
|
@@ -121,11 +85,6 @@ export var getTabStyles = function getTabStyles() {
|
|
|
121
85
|
height: 0
|
|
122
86
|
})
|
|
123
87
|
},
|
|
124
|
-
'&:focus-visible': tabPanelFocusStyles(),
|
|
125
|
-
'@supports not selector(*:focus-visible)': {
|
|
126
|
-
'&:focus': tabPanelFocusStyles()
|
|
127
|
-
}
|
|
128
|
-
}, highContrastFocusRing), {}, {
|
|
129
88
|
'&[aria-selected="true"]': {
|
|
130
89
|
color: colors.selectedColor,
|
|
131
90
|
'&::after': _objectSpread(_objectSpread({}, tabLineStyles), {}, {
|
|
@@ -134,5 +93,5 @@ export var getTabStyles = function getTabStyles() {
|
|
|
134
93
|
height: 0
|
|
135
94
|
})
|
|
136
95
|
}
|
|
137
|
-
}
|
|
96
|
+
};
|
|
138
97
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/tabs",
|
|
3
|
-
"version": "14.0
|
|
3
|
+
"version": "14.1.0",
|
|
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/"
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
38
38
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
39
|
-
"@atlaskit/ds-explorations": "^3.
|
|
40
|
-
"@atlaskit/
|
|
41
|
-
"@atlaskit/theme": "^12.
|
|
42
|
-
"@atlaskit/tokens": "^1.
|
|
39
|
+
"@atlaskit/ds-explorations": "^3.4.0",
|
|
40
|
+
"@atlaskit/focus-ring": "^1.3.9",
|
|
41
|
+
"@atlaskit/theme": "^12.7.0",
|
|
42
|
+
"@atlaskit/tokens": "^1.43.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"@emotion/react": "^11.7.1"
|
|
45
45
|
},
|
|
@@ -50,7 +50,9 @@
|
|
|
50
50
|
"@af/accessibility-testing": "*",
|
|
51
51
|
"@af/integration-testing": "*",
|
|
52
52
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
53
|
+
"@atlaskit/primitives": "*",
|
|
53
54
|
"@atlaskit/ssr": "*",
|
|
55
|
+
"@atlaskit/tooltip": "*",
|
|
54
56
|
"@atlaskit/visual-regression": "*",
|
|
55
57
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
56
58
|
"@testing-library/react": "^12.1.5",
|