@atlaskit/tabs 13.4.2 → 13.4.4

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/tabs
2
2
 
3
+ ## 13.4.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`56b444b56a8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56b444b56a8) - Fix a bug where text descenders were cut off at high zoom levels on Windows
8
+
9
+ ## 13.4.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`599bfe90ee3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/599bfe90ee3) - Internal change to use shape tokens. There is no expected visual change.
14
+
3
15
  ## 13.4.2
4
16
 
5
17
  ### 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 @repo/internal/react/consistent-css-prop-usage
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.2"
24
+ packageVersion: "13.4.4"
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 @repo/internal/react/consistent-css-prop-usage
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
- var underlineHeight = "var(--ds-width-100, 2px)";
15
+ // TODO this should probably be `border.width.indicator`
16
+ var underlineHeight = "var(--ds-border-width-outline, 2px)";
16
17
  var highContrastFocusStyles = {
17
- outline: '1px solid'
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-100, 3px)",
33
+ borderRadius: "var(--ds-border-radius, 3px)",
33
34
  outline: 'none'
34
35
  };
35
36
  };
@@ -56,7 +57,7 @@ var getTabsStyles = function getTabsStyles(mode) {
56
57
  '& [role="tabpanel"]': getTabPanelStyles(mode),
57
58
  // The hidden attribute doesn't work on flex elements
58
59
  // Change display to be none
59
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
60
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
60
61
  '& > [hidden]': {
61
62
  display: 'none'
62
63
  }
@@ -66,7 +67,7 @@ var getTabsStyles = function getTabsStyles(mode) {
66
67
  exports.getTabsStyles = getTabsStyles;
67
68
  var tabLineStyles = {
68
69
  content: '""',
69
- borderRadius: underlineHeight,
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-100, 3px)",
97
+ borderRadius: "var(--ds-border-radius, 3px)",
97
98
  outline: 'none',
98
99
  // Hide TabLine on focus
99
100
  '&::after': {
@@ -111,8 +112,14 @@ var getTabStyles = function getTabStyles(mode) {
111
112
  padding: "".concat(tabTopBottomPadding, " ").concat(tabLeftRightPadding),
112
113
  position: 'relative',
113
114
  whiteSpace: 'nowrap',
114
- overflow: 'hidden',
115
115
  textOverflow: 'ellipsis',
116
+ // Use "clip" overflow to allow ellipses on x-axis without clipping descenders
117
+ '@supports not (overflow-x: clip)': {
118
+ overflow: 'hidden'
119
+ },
120
+ '@supports (overflow-x: clip)': {
121
+ overflowX: 'clip'
122
+ },
116
123
  '&:hover': {
117
124
  // TODO: interaction states will be reviewed in DSP-1438
118
125
  color: colors.hoverLabelColor,
@@ -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 @repo/internal/react/consistent-css-prop-usage
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.2"
13
+ packageVersion: "13.4.4"
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 @repo/internal/react/consistent-css-prop-usage
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
- const underlineHeight = "var(--ds-width-100, 2px)";
5
+ // TODO this should probably be `border.width.indicator`
6
+ const underlineHeight = "var(--ds-border-width-outline, 2px)";
6
7
  const highContrastFocusStyles = {
7
- outline: '1px solid'
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-100, 3px)",
22
+ borderRadius: "var(--ds-border-radius, 3px)",
22
23
  outline: 'none'
23
24
  });
24
25
  const getTabPanelStyles = mode => ({
@@ -42,14 +43,14 @@ css({
42
43
  '& [role="tabpanel"]': getTabPanelStyles(mode),
43
44
  // The hidden attribute doesn't work on flex elements
44
45
  // Change display to be none
45
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
46
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
46
47
  '& > [hidden]': {
47
48
  display: 'none'
48
49
  }
49
50
  });
50
51
  const tabLineStyles = {
51
52
  content: '""',
52
- borderRadius: underlineHeight,
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-100, 3px)",
77
+ borderRadius: "var(--ds-border-radius, 3px)",
77
78
  outline: 'none',
78
79
  // Hide TabLine on focus
79
80
  '&::after': {
@@ -91,8 +92,14 @@ export const getTabStyles = mode => {
91
92
  padding: `${tabTopBottomPadding} ${tabLeftRightPadding}`,
92
93
  position: 'relative',
93
94
  whiteSpace: 'nowrap',
94
- overflow: 'hidden',
95
95
  textOverflow: 'ellipsis',
96
+ // Use "clip" overflow to allow ellipses on x-axis without clipping descenders
97
+ '@supports not (overflow-x: clip)': {
98
+ overflow: 'hidden'
99
+ },
100
+ '@supports (overflow-x: clip)': {
101
+ overflowX: 'clip'
102
+ },
96
103
  '&:hover': {
97
104
  // TODO: interaction states will be reviewed in DSP-1438
98
105
  color: colors.hoverLabelColor,
@@ -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 @repo/internal/react/consistent-css-prop-usage
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.2"
18
+ packageVersion: "13.4.4"
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 @repo/internal/react/consistent-css-prop-usage
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
- var underlineHeight = "var(--ds-width-100, 2px)";
8
+ // TODO this should probably be `border.width.indicator`
9
+ var underlineHeight = "var(--ds-border-width-outline, 2px)";
9
10
  var highContrastFocusStyles = {
10
- outline: '1px solid'
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-100, 3px)",
26
+ borderRadius: "var(--ds-border-radius, 3px)",
26
27
  outline: 'none'
27
28
  };
28
29
  };
@@ -49,7 +50,7 @@ export var getTabsStyles = function getTabsStyles(mode) {
49
50
  '& [role="tabpanel"]': getTabPanelStyles(mode),
50
51
  // The hidden attribute doesn't work on flex elements
51
52
  // Change display to be none
52
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
53
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
53
54
  '& > [hidden]': {
54
55
  display: 'none'
55
56
  }
@@ -58,7 +59,7 @@ export var getTabsStyles = function getTabsStyles(mode) {
58
59
  };
59
60
  var tabLineStyles = {
60
61
  content: '""',
61
- borderRadius: underlineHeight,
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-100, 3px)",
88
+ borderRadius: "var(--ds-border-radius, 3px)",
88
89
  outline: 'none',
89
90
  // Hide TabLine on focus
90
91
  '&::after': {
@@ -102,8 +103,14 @@ export var getTabStyles = function getTabStyles(mode) {
102
103
  padding: "".concat(tabTopBottomPadding, " ").concat(tabLeftRightPadding),
103
104
  position: 'relative',
104
105
  whiteSpace: 'nowrap',
105
- overflow: 'hidden',
106
106
  textOverflow: 'ellipsis',
107
+ // Use "clip" overflow to allow ellipses on x-axis without clipping descenders
108
+ '@supports not (overflow-x: clip)': {
109
+ overflow: 'hidden'
110
+ },
111
+ '@supports (overflow-x: clip)': {
112
+ overflowX: 'clip'
113
+ },
107
114
  '&:hover': {
108
115
  // TODO: interaction states will be reviewed in DSP-1438
109
116
  color: colors.hoverLabelColor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tabs",
3
- "version": "13.4.2",
3
+ "version": "13.4.4",
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": "scheduled",
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.1.0",
36
+ "@atlaskit/ds-explorations": "^2.2.0",
37
37
  "@atlaskit/theme": "^12.5.0",
38
- "@atlaskit/tokens": "^1.4.0",
38
+ "@atlaskit/tokens": "^1.14.0",
39
39
  "@babel/runtime": "^7.0.0",
40
40
  "@emotion/react": "^11.7.1"
41
41
  },
@@ -43,13 +43,9 @@
43
43
  "react": "^16.8.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@atlaskit/button": "^16.7.0",
47
- "@atlaskit/docs": "*",
46
+ "@af/accessibility-testing": "*",
48
47
  "@atlaskit/ds-lib": "^2.2.0",
49
- "@atlaskit/section-message": "^6.4.0",
50
- "@atlaskit/spinner": "^15.5.0",
51
48
  "@atlaskit/ssr": "*",
52
- "@atlaskit/tooltip": "^17.8.0",
53
49
  "@atlaskit/visual-regression": "*",
54
50
  "@atlaskit/webdriver-runner": "*",
55
51
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -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
+ ```
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/tabs",
3
- "version": "13.4.2",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/tabs",
3
- "version": "13.4.2",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/tabs",
3
- "version": "13.4.2",
4
- "sideEffects": false
5
- }