@atlaskit/tabs 14.1.0 → 15.0.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 +7 -0
- package/dist/cjs/components/tab.js +5 -6
- package/dist/cjs/components/tabs.js +1 -1
- package/dist/cjs/internal/styles.js +11 -8
- package/dist/es2019/components/tab.js +4 -5
- package/dist/es2019/components/tabs.js +1 -1
- package/dist/es2019/internal/styles.js +11 -8
- package/dist/esm/components/tab.js +4 -5
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/internal/styles.js +11 -8
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/tabs
|
|
2
2
|
|
|
3
|
+
## 15.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#91586](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91586) [`e229d87eecd0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e229d87eecd0) - - [ux] Removed horizontal padding from Tab container to ensure Tab labels and panel content align with other elements on the page. Tab label hit-boxes remain the same.
|
|
8
|
+
- Adjusted line height and overall Tab label height to be consistent with the Atlassian Design System.
|
|
9
|
+
|
|
3
10
|
## 14.1.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = Tab;
|
|
8
8
|
var _react = require("@emotion/react");
|
|
9
|
-
var _dsExplorations = require("@atlaskit/ds-explorations");
|
|
10
9
|
var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
|
|
10
|
+
var _primitives = require("@atlaskit/primitives");
|
|
11
11
|
var _hooks = require("../hooks");
|
|
12
12
|
/** @jsx jsx */
|
|
13
13
|
|
|
@@ -48,10 +48,9 @@ function Tab(_ref) {
|
|
|
48
48
|
onKeyDown: onKeyDown,
|
|
49
49
|
role: role,
|
|
50
50
|
tabIndex: tabIndex
|
|
51
|
-
}, (0, _react.jsx)(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
51
|
+
}, (0, _react.jsx)(_primitives.Text, {
|
|
52
|
+
weight: "medium",
|
|
53
|
+
color: "inherit",
|
|
54
|
+
maxLines: 1
|
|
56
55
|
}, children)));
|
|
57
56
|
}
|
|
@@ -30,7 +30,7 @@ var tabsStyles = (0, _styles.getTabsStyles)();
|
|
|
30
30
|
var analyticsAttributes = {
|
|
31
31
|
componentName: 'tabs',
|
|
32
32
|
packageName: "@atlaskit/tabs",
|
|
33
|
-
packageVersion: "
|
|
33
|
+
packageVersion: "15.0.0"
|
|
34
34
|
};
|
|
35
35
|
var getTabPanelWithContext = function getTabPanelWithContext(_ref) {
|
|
36
36
|
var tabPanel = _ref.tabPanel,
|
|
@@ -10,8 +10,9 @@ var _react = require("@emotion/react");
|
|
|
10
10
|
var _colors = require("./colors");
|
|
11
11
|
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; }
|
|
12
12
|
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) { (0, _defineProperty2.default)(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; }
|
|
13
|
-
var
|
|
14
|
-
var
|
|
13
|
+
var tabInlinePadding = "var(--ds-space-100, 8px)";
|
|
14
|
+
var tabBlockPadding = "var(--ds-space-075, 6px)";
|
|
15
|
+
var tabInlineMargin = "var(--ds-space-negative-100, -8px)";
|
|
15
16
|
// TODO this should probably be `border.width.indicator`
|
|
16
17
|
var underlineHeight = "var(--ds-border-width-outline, 2px)";
|
|
17
18
|
var getTabPanelStyles = function getTabPanelStyles() {
|
|
@@ -22,8 +23,7 @@ var getTabPanelStyles = function getTabPanelStyles() {
|
|
|
22
23
|
FF http://stackoverflow.com/questions/28636832/firefox-overflow-y-not-working-with-nested-flexbox
|
|
23
24
|
*/
|
|
24
25
|
minHeight: '0%',
|
|
25
|
-
display: 'flex'
|
|
26
|
-
padding: "0 ".concat(tabLeftRightPadding)
|
|
26
|
+
display: 'flex'
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
var getTabsStyles = exports.getTabsStyles = function getTabsStyles() {
|
|
@@ -47,8 +47,8 @@ var tabLineStyles = {
|
|
|
47
47
|
margin: 0,
|
|
48
48
|
position: 'absolute',
|
|
49
49
|
width: 'inherit',
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
insetInlineStart: tabInlinePadding,
|
|
51
|
+
insetInlineEnd: 0
|
|
52
52
|
};
|
|
53
53
|
var getTabListStyles = exports.getTabListStyles = function getTabListStyles() {
|
|
54
54
|
return (
|
|
@@ -56,6 +56,7 @@ var getTabListStyles = exports.getTabListStyles = function getTabListStyles() {
|
|
|
56
56
|
(0, _react.css)({
|
|
57
57
|
'& [role="tab"]': getTabStyles(),
|
|
58
58
|
fontWeight: "var(--ds-font-weight-medium, 500)",
|
|
59
|
+
marginInlineStart: tabInlineMargin,
|
|
59
60
|
'&::before': _objectSpread(_objectSpread({}, tabLineStyles), {}, {
|
|
60
61
|
height: underlineHeight,
|
|
61
62
|
// This line is not a border so the selected line is visible in high contrast mode
|
|
@@ -69,9 +70,8 @@ var getTabStyles = exports.getTabStyles = function getTabStyles() {
|
|
|
69
70
|
return {
|
|
70
71
|
color: colors.labelColor,
|
|
71
72
|
cursor: 'pointer',
|
|
72
|
-
lineHeight: 1.8,
|
|
73
73
|
margin: 0,
|
|
74
|
-
padding: "".concat(
|
|
74
|
+
padding: "".concat(tabBlockPadding, " ").concat(tabInlinePadding),
|
|
75
75
|
position: 'relative',
|
|
76
76
|
whiteSpace: 'nowrap',
|
|
77
77
|
overflow: 'hidden',
|
|
@@ -80,6 +80,7 @@ var getTabStyles = exports.getTabStyles = function getTabStyles() {
|
|
|
80
80
|
// TODO: interaction states will be reviewed in DSP-1438
|
|
81
81
|
color: colors.hoverLabelColor,
|
|
82
82
|
'&::after': _objectSpread(_objectSpread({}, tabLineStyles), {}, {
|
|
83
|
+
insetInlineEnd: tabInlinePadding,
|
|
83
84
|
borderBottom: "".concat(underlineHeight, " solid ").concat(_colors.tabLineColors.hoveredColor),
|
|
84
85
|
height: 0
|
|
85
86
|
})
|
|
@@ -88,6 +89,7 @@ var getTabStyles = exports.getTabStyles = function getTabStyles() {
|
|
|
88
89
|
// TODO: interaction states will be reviewed in DSP-1438
|
|
89
90
|
color: colors.activeLabelColor,
|
|
90
91
|
'&::after': _objectSpread(_objectSpread({}, tabLineStyles), {}, {
|
|
92
|
+
insetInlineEnd: tabInlinePadding,
|
|
91
93
|
borderBottom: "".concat(underlineHeight, " solid ").concat(_colors.tabLineColors.activeColor),
|
|
92
94
|
height: 0
|
|
93
95
|
})
|
|
@@ -95,6 +97,7 @@ var getTabStyles = exports.getTabStyles = function getTabStyles() {
|
|
|
95
97
|
'&[aria-selected="true"]': {
|
|
96
98
|
color: colors.selectedColor,
|
|
97
99
|
'&::after': _objectSpread(_objectSpread({}, tabLineStyles), {}, {
|
|
100
|
+
insetInlineEnd: tabInlinePadding,
|
|
98
101
|
// This line is a border so it is visible in high contrast mode
|
|
99
102
|
borderBottom: "".concat(underlineHeight, " solid ").concat(_colors.tabLineColors.selectedColor),
|
|
100
103
|
height: 0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
|
|
4
3
|
import FocusRing from '@atlaskit/focus-ring';
|
|
4
|
+
import { Text } from '@atlaskit/primitives';
|
|
5
5
|
import { useTab } from '../hooks';
|
|
6
6
|
/**
|
|
7
7
|
* __Tab__
|
|
@@ -43,9 +43,8 @@ export default function Tab({
|
|
|
43
43
|
role: role,
|
|
44
44
|
tabIndex: tabIndex
|
|
45
45
|
}, jsx(Text, {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
46
|
+
weight: "medium",
|
|
47
|
+
color: "inherit",
|
|
48
|
+
maxLines: 1
|
|
50
49
|
}, children)));
|
|
51
50
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { tabColors, tabLineColors } from './colors';
|
|
3
|
-
const
|
|
4
|
-
const
|
|
3
|
+
const tabInlinePadding = "var(--ds-space-100, 8px)";
|
|
4
|
+
const tabBlockPadding = "var(--ds-space-075, 6px)";
|
|
5
|
+
const tabInlineMargin = "var(--ds-space-negative-100, -8px)";
|
|
5
6
|
// TODO this should probably be `border.width.indicator`
|
|
6
7
|
const underlineHeight = "var(--ds-border-width-outline, 2px)";
|
|
7
8
|
const getTabPanelStyles = () => ({
|
|
@@ -11,8 +12,7 @@ const getTabPanelStyles = () => ({
|
|
|
11
12
|
FF http://stackoverflow.com/questions/28636832/firefox-overflow-y-not-working-with-nested-flexbox
|
|
12
13
|
*/
|
|
13
14
|
minHeight: '0%',
|
|
14
|
-
display: 'flex'
|
|
15
|
-
padding: `0 ${tabLeftRightPadding}`
|
|
15
|
+
display: 'flex'
|
|
16
16
|
});
|
|
17
17
|
export const getTabsStyles = () =>
|
|
18
18
|
// eslint-disable-next-line @repo/internal/styles/no-exported-styles
|
|
@@ -32,14 +32,15 @@ const tabLineStyles = {
|
|
|
32
32
|
margin: 0,
|
|
33
33
|
position: 'absolute',
|
|
34
34
|
width: 'inherit',
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
insetInlineStart: tabInlinePadding,
|
|
36
|
+
insetInlineEnd: 0
|
|
37
37
|
};
|
|
38
38
|
export const getTabListStyles = () =>
|
|
39
39
|
// eslint-disable-next-line @repo/internal/styles/no-exported-styles
|
|
40
40
|
css({
|
|
41
41
|
'& [role="tab"]': getTabStyles(),
|
|
42
42
|
fontWeight: "var(--ds-font-weight-medium, 500)",
|
|
43
|
+
marginInlineStart: tabInlineMargin,
|
|
43
44
|
'&::before': {
|
|
44
45
|
...tabLineStyles,
|
|
45
46
|
height: underlineHeight,
|
|
@@ -52,9 +53,8 @@ export const getTabStyles = () => {
|
|
|
52
53
|
return {
|
|
53
54
|
color: colors.labelColor,
|
|
54
55
|
cursor: 'pointer',
|
|
55
|
-
lineHeight: 1.8,
|
|
56
56
|
margin: 0,
|
|
57
|
-
padding: `${
|
|
57
|
+
padding: `${tabBlockPadding} ${tabInlinePadding}`,
|
|
58
58
|
position: 'relative',
|
|
59
59
|
whiteSpace: 'nowrap',
|
|
60
60
|
overflow: 'hidden',
|
|
@@ -64,6 +64,7 @@ export const getTabStyles = () => {
|
|
|
64
64
|
color: colors.hoverLabelColor,
|
|
65
65
|
'&::after': {
|
|
66
66
|
...tabLineStyles,
|
|
67
|
+
insetInlineEnd: tabInlinePadding,
|
|
67
68
|
borderBottom: `${underlineHeight} solid ${tabLineColors.hoveredColor}`,
|
|
68
69
|
height: 0
|
|
69
70
|
}
|
|
@@ -73,6 +74,7 @@ export const getTabStyles = () => {
|
|
|
73
74
|
color: colors.activeLabelColor,
|
|
74
75
|
'&::after': {
|
|
75
76
|
...tabLineStyles,
|
|
77
|
+
insetInlineEnd: tabInlinePadding,
|
|
76
78
|
borderBottom: `${underlineHeight} solid ${tabLineColors.activeColor}`,
|
|
77
79
|
height: 0
|
|
78
80
|
}
|
|
@@ -81,6 +83,7 @@ export const getTabStyles = () => {
|
|
|
81
83
|
color: colors.selectedColor,
|
|
82
84
|
'&::after': {
|
|
83
85
|
...tabLineStyles,
|
|
86
|
+
insetInlineEnd: tabInlinePadding,
|
|
84
87
|
// This line is a border so it is visible in high contrast mode
|
|
85
88
|
borderBottom: `${underlineHeight} solid ${tabLineColors.selectedColor}`,
|
|
86
89
|
height: 0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
|
|
4
3
|
import FocusRing from '@atlaskit/focus-ring';
|
|
4
|
+
import { Text } from '@atlaskit/primitives';
|
|
5
5
|
import { useTab } from '../hooks';
|
|
6
6
|
/**
|
|
7
7
|
* __Tab__
|
|
@@ -41,9 +41,8 @@ export default function Tab(_ref) {
|
|
|
41
41
|
role: role,
|
|
42
42
|
tabIndex: tabIndex
|
|
43
43
|
}, jsx(Text, {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
44
|
+
weight: "medium",
|
|
45
|
+
color: "inherit",
|
|
46
|
+
maxLines: 1
|
|
48
47
|
}, children)));
|
|
49
48
|
}
|
|
@@ -24,7 +24,7 @@ var tabsStyles = getTabsStyles();
|
|
|
24
24
|
var analyticsAttributes = {
|
|
25
25
|
componentName: 'tabs',
|
|
26
26
|
packageName: "@atlaskit/tabs",
|
|
27
|
-
packageVersion: "
|
|
27
|
+
packageVersion: "15.0.0"
|
|
28
28
|
};
|
|
29
29
|
var getTabPanelWithContext = function getTabPanelWithContext(_ref) {
|
|
30
30
|
var tabPanel = _ref.tabPanel,
|
|
@@ -3,8 +3,9 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
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
5
|
import { tabColors, tabLineColors } from './colors';
|
|
6
|
-
var
|
|
7
|
-
var
|
|
6
|
+
var tabInlinePadding = "var(--ds-space-100, 8px)";
|
|
7
|
+
var tabBlockPadding = "var(--ds-space-075, 6px)";
|
|
8
|
+
var tabInlineMargin = "var(--ds-space-negative-100, -8px)";
|
|
8
9
|
// TODO this should probably be `border.width.indicator`
|
|
9
10
|
var underlineHeight = "var(--ds-border-width-outline, 2px)";
|
|
10
11
|
var getTabPanelStyles = function getTabPanelStyles() {
|
|
@@ -15,8 +16,7 @@ var getTabPanelStyles = function getTabPanelStyles() {
|
|
|
15
16
|
FF http://stackoverflow.com/questions/28636832/firefox-overflow-y-not-working-with-nested-flexbox
|
|
16
17
|
*/
|
|
17
18
|
minHeight: '0%',
|
|
18
|
-
display: 'flex'
|
|
19
|
-
padding: "0 ".concat(tabLeftRightPadding)
|
|
19
|
+
display: 'flex'
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
export var getTabsStyles = function getTabsStyles() {
|
|
@@ -40,8 +40,8 @@ var tabLineStyles = {
|
|
|
40
40
|
margin: 0,
|
|
41
41
|
position: 'absolute',
|
|
42
42
|
width: 'inherit',
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
insetInlineStart: tabInlinePadding,
|
|
44
|
+
insetInlineEnd: 0
|
|
45
45
|
};
|
|
46
46
|
export var getTabListStyles = function getTabListStyles() {
|
|
47
47
|
return (
|
|
@@ -49,6 +49,7 @@ export var getTabListStyles = function getTabListStyles() {
|
|
|
49
49
|
css({
|
|
50
50
|
'& [role="tab"]': getTabStyles(),
|
|
51
51
|
fontWeight: "var(--ds-font-weight-medium, 500)",
|
|
52
|
+
marginInlineStart: tabInlineMargin,
|
|
52
53
|
'&::before': _objectSpread(_objectSpread({}, tabLineStyles), {}, {
|
|
53
54
|
height: underlineHeight,
|
|
54
55
|
// This line is not a border so the selected line is visible in high contrast mode
|
|
@@ -62,9 +63,8 @@ export var getTabStyles = function getTabStyles() {
|
|
|
62
63
|
return {
|
|
63
64
|
color: colors.labelColor,
|
|
64
65
|
cursor: 'pointer',
|
|
65
|
-
lineHeight: 1.8,
|
|
66
66
|
margin: 0,
|
|
67
|
-
padding: "".concat(
|
|
67
|
+
padding: "".concat(tabBlockPadding, " ").concat(tabInlinePadding),
|
|
68
68
|
position: 'relative',
|
|
69
69
|
whiteSpace: 'nowrap',
|
|
70
70
|
overflow: 'hidden',
|
|
@@ -73,6 +73,7 @@ export var getTabStyles = function getTabStyles() {
|
|
|
73
73
|
// TODO: interaction states will be reviewed in DSP-1438
|
|
74
74
|
color: colors.hoverLabelColor,
|
|
75
75
|
'&::after': _objectSpread(_objectSpread({}, tabLineStyles), {}, {
|
|
76
|
+
insetInlineEnd: tabInlinePadding,
|
|
76
77
|
borderBottom: "".concat(underlineHeight, " solid ").concat(tabLineColors.hoveredColor),
|
|
77
78
|
height: 0
|
|
78
79
|
})
|
|
@@ -81,6 +82,7 @@ export var getTabStyles = function getTabStyles() {
|
|
|
81
82
|
// TODO: interaction states will be reviewed in DSP-1438
|
|
82
83
|
color: colors.activeLabelColor,
|
|
83
84
|
'&::after': _objectSpread(_objectSpread({}, tabLineStyles), {}, {
|
|
85
|
+
insetInlineEnd: tabInlinePadding,
|
|
84
86
|
borderBottom: "".concat(underlineHeight, " solid ").concat(tabLineColors.activeColor),
|
|
85
87
|
height: 0
|
|
86
88
|
})
|
|
@@ -88,6 +90,7 @@ export var getTabStyles = function getTabStyles() {
|
|
|
88
90
|
'&[aria-selected="true"]': {
|
|
89
91
|
color: colors.selectedColor,
|
|
90
92
|
'&::after': _objectSpread(_objectSpread({}, tabLineStyles), {}, {
|
|
93
|
+
insetInlineEnd: tabInlinePadding,
|
|
91
94
|
// This line is a border so it is visible in high contrast mode
|
|
92
95
|
borderBottom: "".concat(underlineHeight, " solid ").concat(tabLineColors.selectedColor),
|
|
93
96
|
height: 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/tabs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.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,8 +36,8 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
38
38
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
39
|
-
"@atlaskit/ds-explorations": "^3.4.0",
|
|
40
39
|
"@atlaskit/focus-ring": "^1.3.9",
|
|
40
|
+
"@atlaskit/primitives": "^5.5.0",
|
|
41
41
|
"@atlaskit/theme": "^12.7.0",
|
|
42
42
|
"@atlaskit/tokens": "^1.43.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
@@ -49,10 +49,9 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@af/accessibility-testing": "*",
|
|
51
51
|
"@af/integration-testing": "*",
|
|
52
|
-
"@atlaskit/ds-lib": "^2.
|
|
53
|
-
"@atlaskit/primitives": "*",
|
|
52
|
+
"@atlaskit/ds-lib": "^2.3.0",
|
|
54
53
|
"@atlaskit/ssr": "*",
|
|
55
|
-
"@atlaskit/tooltip": "
|
|
54
|
+
"@atlaskit/tooltip": "^18.2.1",
|
|
56
55
|
"@atlaskit/visual-regression": "*",
|
|
57
56
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
58
57
|
"@testing-library/react": "^12.1.5",
|