@atlaskit/tabs 13.3.10 → 13.3.12
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 +12 -0
- package/__perf__/default.tsx +0 -1
- package/dist/cjs/components/tab-list.js +19 -36
- package/dist/cjs/components/tab-panel.js +2 -10
- package/dist/cjs/components/tab.js +1 -7
- package/dist/cjs/components/tabs.js +32 -53
- package/dist/cjs/hooks.js +0 -14
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/internal/colors.js +0 -8
- package/dist/cjs/internal/context.js +1 -2
- package/dist/cjs/internal/styles.js +6 -21
- package/dist/cjs/internal/utils.js +0 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/tab-list.js +13 -17
- package/dist/es2019/components/tab-panel.js +0 -4
- package/dist/es2019/components/tab.js +0 -2
- package/dist/es2019/components/tabs.js +16 -16
- package/dist/es2019/hooks.js +0 -6
- package/dist/es2019/internal/styles.js +14 -13
- package/dist/es2019/internal/utils.js +0 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/tab-list.js +19 -27
- package/dist/esm/components/tab-panel.js +1 -5
- package/dist/esm/components/tab.js +1 -3
- package/dist/esm/components/tabs.js +32 -39
- package/dist/esm/hooks.js +0 -6
- package/dist/esm/internal/styles.js +6 -12
- package/dist/esm/internal/utils.js +0 -1
- package/dist/esm/version.json +1 -1
- package/package.json +7 -5
package/dist/esm/hooks.js
CHANGED
|
@@ -2,28 +2,22 @@ import { useContext } from 'react';
|
|
|
2
2
|
import { TabContext, TabListContext, TabPanelContext } from './internal/context';
|
|
3
3
|
export var useTab = function useTab() {
|
|
4
4
|
var tabData = useContext(TabContext);
|
|
5
|
-
|
|
6
5
|
if (tabData == null || typeof tabData === 'undefined') {
|
|
7
6
|
throw Error('@atlaskit/tabs: A Tab must have a TabList parent.');
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
return tabData;
|
|
11
9
|
};
|
|
12
10
|
export var useTabList = function useTabList() {
|
|
13
11
|
var tabListData = useContext(TabListContext);
|
|
14
|
-
|
|
15
12
|
if (tabListData === null || typeof tabListData === 'undefined') {
|
|
16
13
|
throw Error('@atlaskit/tabs: A TabList must have a Tabs parent.');
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
return tabListData;
|
|
20
16
|
};
|
|
21
17
|
export var useTabPanel = function useTabPanel() {
|
|
22
18
|
var tabPanelData = useContext(TabPanelContext);
|
|
23
|
-
|
|
24
19
|
if (tabPanelData === null || typeof tabPanelData === 'undefined') {
|
|
25
20
|
throw Error('@atlaskit/tabs: A TabPanel must have a Tabs parent.');
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
return tabPanelData;
|
|
29
23
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
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) { _defineProperty(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; }
|
|
6
|
-
|
|
7
4
|
import { css } from '@emotion/react';
|
|
8
5
|
import { borderRadius as getBorderRadius, gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
9
6
|
import { getTabColors, getTabLineColor, getTabPanelFocusColor } from './colors';
|
|
@@ -14,8 +11,9 @@ var tabTopBottomPadding = "".concat(gridSize / 2, "px");
|
|
|
14
11
|
var underlineHeight = '2px';
|
|
15
12
|
var highContrastFocusStyles = {
|
|
16
13
|
outline: '1px solid'
|
|
17
|
-
};
|
|
14
|
+
};
|
|
18
15
|
|
|
16
|
+
// Required so the focus ring is visible in high contrast mode
|
|
19
17
|
var highContrastFocusRing = {
|
|
20
18
|
'@media screen and (forced-colors: active), screen and (-ms-high-contrast: active)': {
|
|
21
19
|
'&:focus-visible': highContrastFocusStyles,
|
|
@@ -24,7 +22,6 @@ var highContrastFocusRing = {
|
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
24
|
};
|
|
27
|
-
|
|
28
25
|
var tabFocusStyles = function tabFocusStyles(mode) {
|
|
29
26
|
return {
|
|
30
27
|
boxShadow: "0 0 0 2px ".concat(getTabPanelFocusColor(mode), " inset"),
|
|
@@ -32,11 +29,9 @@ var tabFocusStyles = function tabFocusStyles(mode) {
|
|
|
32
29
|
outline: 'none'
|
|
33
30
|
};
|
|
34
31
|
};
|
|
35
|
-
|
|
36
32
|
var getTabPanelStyles = function getTabPanelStyles(mode) {
|
|
37
33
|
return _objectSpread({
|
|
38
34
|
flexGrow: 1,
|
|
39
|
-
|
|
40
35
|
/*
|
|
41
36
|
NOTE min-height set to 0% because of Firefox bug
|
|
42
37
|
FF http://stackoverflow.com/questions/28636832/firefox-overflow-y-not-working-with-nested-flexbox
|
|
@@ -50,9 +45,9 @@ var getTabPanelStyles = function getTabPanelStyles(mode) {
|
|
|
50
45
|
}
|
|
51
46
|
}, highContrastFocusRing);
|
|
52
47
|
};
|
|
53
|
-
|
|
54
48
|
export var getTabsStyles = function getTabsStyles(mode) {
|
|
55
|
-
return (
|
|
49
|
+
return (
|
|
50
|
+
// eslint-disable-next-line @repo/internal/styles/no-exported-styles
|
|
56
51
|
css({
|
|
57
52
|
'& [role="tabpanel"]': getTabPanelStyles(mode),
|
|
58
53
|
// The hidden attribute doesn't work on flex elements
|
|
@@ -75,7 +70,8 @@ var tabLineStyles = {
|
|
|
75
70
|
right: tabLeftRightPadding
|
|
76
71
|
};
|
|
77
72
|
export var getTabListStyles = function getTabListStyles(mode) {
|
|
78
|
-
return (
|
|
73
|
+
return (
|
|
74
|
+
// eslint-disable-next-line @repo/internal/styles/no-exported-styles
|
|
79
75
|
css({
|
|
80
76
|
'& [role="tab"]': getTabStyles(mode),
|
|
81
77
|
fontWeight: "var(--ds-font-weight-medium, 500)",
|
|
@@ -87,7 +83,6 @@ export var getTabListStyles = function getTabListStyles(mode) {
|
|
|
87
83
|
})
|
|
88
84
|
);
|
|
89
85
|
};
|
|
90
|
-
|
|
91
86
|
var tabPanelFocusStyles = function tabPanelFocusStyles(mode) {
|
|
92
87
|
var colors = getTabColors(mode);
|
|
93
88
|
return {
|
|
@@ -100,7 +95,6 @@ var tabPanelFocusStyles = function tabPanelFocusStyles(mode) {
|
|
|
100
95
|
}
|
|
101
96
|
};
|
|
102
97
|
};
|
|
103
|
-
|
|
104
98
|
export var getTabStyles = function getTabStyles(mode) {
|
|
105
99
|
var colors = getTabColors(mode);
|
|
106
100
|
return _objectSpread(_objectSpread({
|
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.12",
|
|
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,11 +24,11 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@atlaskit/analytics-next": "^
|
|
27
|
+
"@atlaskit/analytics-next": "^9.0.0",
|
|
28
28
|
"@atlaskit/codemod-utils": "^4.1.0",
|
|
29
29
|
"@atlaskit/ds-explorations": "^2.0.0",
|
|
30
30
|
"@atlaskit/theme": "^12.2.0",
|
|
31
|
-
"@atlaskit/tokens": "^
|
|
31
|
+
"@atlaskit/tokens": "^1.2.0",
|
|
32
32
|
"@babel/runtime": "^7.0.0",
|
|
33
33
|
"@emotion/react": "^11.7.1"
|
|
34
34
|
},
|
|
@@ -67,8 +67,10 @@
|
|
|
67
67
|
"lite-mode"
|
|
68
68
|
],
|
|
69
69
|
"analytics": "analytics-next",
|
|
70
|
-
"design-tokens":
|
|
71
|
-
|
|
70
|
+
"design-tokens": [
|
|
71
|
+
"color",
|
|
72
|
+
"spacing"
|
|
73
|
+
],
|
|
72
74
|
"styling": [
|
|
73
75
|
"static",
|
|
74
76
|
"emotion"
|