@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/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
- }; // Required so the focus ring is visible in high contrast mode
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 (// eslint-disable-next-line @repo/internal/styles/no-exported-styles
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 (// eslint-disable-next-line @repo/internal/styles/no-exported-styles
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({
@@ -7,7 +7,6 @@ export var onMouseDownBlur = function onMouseDownBlur(e) {
7
7
  currentTarget.focus();
8
8
  return;
9
9
  }
10
-
11
10
  if (!focusedDuringMouseDown && document.body.contains(currentTarget)) {
12
11
  currentTarget.blur();
13
12
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/tabs",
3
- "version": "13.3.10",
3
+ "version": "13.3.12",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tabs",
3
- "version": "13.3.10",
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": "^8.2.0",
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": "^0.13.0",
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": "spacing",
71
- "theming": "tokens",
70
+ "design-tokens": [
71
+ "color",
72
+ "spacing"
73
+ ],
72
74
  "styling": [
73
75
  "static",
74
76
  "emotion"