@atlaskit/tabs 19.1.0 → 20.0.1
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 +35 -0
- package/dist/cjs/components/tabs.js +3 -2
- package/dist/es2019/components/tabs.js +1 -1
- package/dist/esm/components/tabs.js +3 -2
- package/package.json +16 -23
- package/tab/package.json +1 -8
- package/tab-list/package.json +1 -8
- package/tab-panel/package.json +1 -8
- package/tabs/package.json +1 -8
- package/tabs.docs.tsx +45 -43
- package/types/package.json +1 -8
- package/use-tab/package.json +1 -8
- package/use-tab-panel/package.json +1 -8
- package/dist/types-ts4.5/components/tab-list.d.ts +0 -12
- package/dist/types-ts4.5/components/tab-panel.d.ts +0 -13
- package/dist/types-ts4.5/components/tab.d.ts +0 -13
- package/dist/types-ts4.5/components/tabs.d.ts +0 -12
- package/dist/types-ts4.5/entry-points/tab-list.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/tab-panel.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/tab.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/tabs.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/use-tab-panel.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/use-tab.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -7
- package/dist/types-ts4.5/internal/tab-context.d.ts +0 -2
- package/dist/types-ts4.5/internal/tab-list-context.d.ts +0 -2
- package/dist/types-ts4.5/internal/tab-panel-context.d.ts +0 -2
- package/dist/types-ts4.5/types.d.ts +0 -188
- package/dist/types-ts4.5/use-tab-list.d.ts +0 -4
- package/dist/types-ts4.5/use-tab-panel.d.ts +0 -4
- package/dist/types-ts4.5/use-tab.d.ts +0 -4
- package/offerings.json +0 -37
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @atlaskit/tabs
|
|
2
2
|
|
|
3
|
+
## 20.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ee28cf33718b0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ee28cf33718b0) -
|
|
8
|
+
Add @atlassian/react-compiler-gating as a runtime dependency to enable React Compiler platform
|
|
9
|
+
gating.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 20.0.0
|
|
13
|
+
|
|
14
|
+
### Major Changes
|
|
15
|
+
|
|
16
|
+
- [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
|
|
17
|
+
Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
|
|
18
|
+
|
|
19
|
+
Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
|
|
20
|
+
|
|
21
|
+
Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
|
|
22
|
+
|
|
23
|
+
```diff
|
|
24
|
+
- "typesVersions": {
|
|
25
|
+
- ">=4.5 <4.9": {
|
|
26
|
+
- "*": [
|
|
27
|
+
- "dist/types-ts4.5/*",
|
|
28
|
+
- "dist/types-ts4.5/index.d.ts"
|
|
29
|
+
- ]
|
|
30
|
+
- }
|
|
31
|
+
- },
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- Updated dependencies
|
|
37
|
+
|
|
3
38
|
## 19.1.0
|
|
4
39
|
|
|
5
40
|
### Minor Changes
|
|
@@ -20,12 +20,13 @@ var _tabPanelContext = require("../internal/tab-panel-context");
|
|
|
20
20
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
21
21
|
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; }
|
|
22
22
|
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; }
|
|
23
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
23
24
|
var baseStyles = null;
|
|
24
25
|
var tabsStyles = null;
|
|
25
26
|
var analyticsAttributes = {
|
|
26
27
|
componentName: 'tabs',
|
|
27
28
|
packageName: "@atlaskit/tabs",
|
|
28
|
-
packageVersion: "
|
|
29
|
+
packageVersion: "20.0.0"
|
|
29
30
|
};
|
|
30
31
|
var getTabPanelWithContext = function getTabPanelWithContext(_ref) {
|
|
31
32
|
var tabPanel = _ref.tabPanel,
|
|
@@ -79,7 +80,7 @@ var Tabs = function Tabs(props) {
|
|
|
79
80
|
// First child should be a tabList followed by tab panels
|
|
80
81
|
var _childrenArray = (0, _toArray2.default)(childrenArray),
|
|
81
82
|
tabList = _childrenArray[0],
|
|
82
|
-
tabPanels = _childrenArray.slice(1);
|
|
83
|
+
tabPanels = _arrayLikeToArray(_childrenArray).slice(1);
|
|
83
84
|
|
|
84
85
|
// Keep track of visited and add to a set
|
|
85
86
|
var visited = (0, _react.useRef)(new Set([selected]));
|
|
@@ -7,6 +7,7 @@ import * as React from 'react';
|
|
|
7
7
|
import { ax, ix } from "@compiled/react/runtime";
|
|
8
8
|
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; }
|
|
9
9
|
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; }
|
|
10
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
11
|
import { Children, Fragment, useCallback, useRef, useState } from 'react';
|
|
11
12
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
12
13
|
import { TabListContext } from '../internal/tab-list-context';
|
|
@@ -16,7 +17,7 @@ var tabsStyles = null;
|
|
|
16
17
|
var analyticsAttributes = {
|
|
17
18
|
componentName: 'tabs',
|
|
18
19
|
packageName: "@atlaskit/tabs",
|
|
19
|
-
packageVersion: "
|
|
20
|
+
packageVersion: "20.0.0"
|
|
20
21
|
};
|
|
21
22
|
var getTabPanelWithContext = function getTabPanelWithContext(_ref) {
|
|
22
23
|
var tabPanel = _ref.tabPanel,
|
|
@@ -70,7 +71,7 @@ var Tabs = function Tabs(props) {
|
|
|
70
71
|
// First child should be a tabList followed by tab panels
|
|
71
72
|
var _childrenArray = _toArray(childrenArray),
|
|
72
73
|
tabList = _childrenArray[0],
|
|
73
|
-
tabPanels = _childrenArray.slice(1);
|
|
74
|
+
tabPanels = _arrayLikeToArray(_childrenArray).slice(1);
|
|
74
75
|
|
|
75
76
|
// Keep track of visited and add to a set
|
|
76
77
|
var visited = useRef(new Set([selected]));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/tabs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.1",
|
|
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/"
|
|
@@ -12,14 +12,6 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
-
"typesVersions": {
|
|
16
|
-
">=4.5 <4.9": {
|
|
17
|
-
"*": [
|
|
18
|
-
"dist/types-ts4.5/*",
|
|
19
|
-
"dist/types-ts4.5/index.d.ts"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
15
|
"sideEffects": [
|
|
24
16
|
"**/*.compiled.css"
|
|
25
17
|
],
|
|
@@ -39,10 +31,11 @@
|
|
|
39
31
|
}
|
|
40
32
|
},
|
|
41
33
|
"dependencies": {
|
|
42
|
-
"@atlaskit/analytics-next": "^
|
|
43
|
-
"@atlaskit/platform-feature-flags": "^
|
|
44
|
-
"@atlaskit/primitives": "^
|
|
45
|
-
"@atlaskit/tokens": "^
|
|
34
|
+
"@atlaskit/analytics-next": "^12.0.0",
|
|
35
|
+
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
36
|
+
"@atlaskit/primitives": "^20.0.0",
|
|
37
|
+
"@atlaskit/tokens": "^15.0.0",
|
|
38
|
+
"@atlassian/react-compiler-gating": "^0.2.0",
|
|
46
39
|
"@babel/runtime": "^7.0.0",
|
|
47
40
|
"@compiled/react": "^0.20.0"
|
|
48
41
|
},
|
|
@@ -54,20 +47,20 @@
|
|
|
54
47
|
"@af/integration-testing": "workspace:^",
|
|
55
48
|
"@af/suppress-react-warnings": "workspace:^",
|
|
56
49
|
"@af/visual-regression": "workspace:^",
|
|
57
|
-
"@atlaskit/button": "^
|
|
58
|
-
"@atlaskit/css": "^0.
|
|
59
|
-
"@atlaskit/docs": "^
|
|
60
|
-
"@atlaskit/ds-lib": "^
|
|
61
|
-
"@atlaskit/link": "^
|
|
62
|
-
"@atlaskit/section-message": "^
|
|
63
|
-
"@atlaskit/spinner": "^
|
|
64
|
-
"@atlaskit/tooltip": "^
|
|
65
|
-
"@atlaskit/visually-hidden": "^
|
|
66
|
-
"@atlassian/react-compiler-gating": "workspace:^",
|
|
50
|
+
"@atlaskit/button": "^24.1.0",
|
|
51
|
+
"@atlaskit/css": "^1.0.0",
|
|
52
|
+
"@atlaskit/docs": "^12.0.0",
|
|
53
|
+
"@atlaskit/ds-lib": "^8.0.0",
|
|
54
|
+
"@atlaskit/link": "^4.0.0",
|
|
55
|
+
"@atlaskit/section-message": "^9.1.0",
|
|
56
|
+
"@atlaskit/spinner": "^20.0.0",
|
|
57
|
+
"@atlaskit/tooltip": "^23.0.0",
|
|
58
|
+
"@atlaskit/visually-hidden": "^4.0.0",
|
|
67
59
|
"@atlassian/ssr-tests": "workspace:^",
|
|
68
60
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
69
61
|
"@testing-library/react": "^16.3.0",
|
|
70
62
|
"@testing-library/user-event": "^14.4.3",
|
|
63
|
+
"react": "^18.2.0",
|
|
71
64
|
"react-dom": "^18.2.0",
|
|
72
65
|
"react-lorem-component": "^0.13.0",
|
|
73
66
|
"storybook-addon-performance": "^0.17.3"
|
package/tab/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/tab.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/tab.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/tab.d.ts"
|
|
17
10
|
}
|
package/tab-list/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/tab-list.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/tab-list.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/tab-list.d.ts"
|
|
17
10
|
}
|
package/tab-panel/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/tab-panel.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/tab-panel.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/tab-panel.d.ts"
|
|
17
10
|
}
|
package/tabs/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/tabs.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/tabs.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/tabs.d.ts"
|
|
17
10
|
}
|
package/tabs.docs.tsx
CHANGED
|
@@ -1,51 +1,53 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
|
|
4
4
|
|
|
5
|
-
const documentation:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
description:
|
|
9
|
-
'Tabs are used to organize content by grouping similar information on the same page.',
|
|
10
|
-
status: 'general-availability',
|
|
11
|
-
import: {
|
|
5
|
+
const documentation: StructuredContentSource = {
|
|
6
|
+
components: [
|
|
7
|
+
{
|
|
12
8
|
name: 'Tabs',
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
usageGuidelines: [
|
|
19
|
-
'Use to organize related content on the same page without navigating away',
|
|
20
|
-
'Use for concise content or content users access regularly',
|
|
21
|
-
'Limit the number of tabs to avoid overcrowding',
|
|
22
|
-
'Keep tab labels concise and descriptive',
|
|
23
|
-
'Use consistent tab ordering and grouping',
|
|
24
|
-
'Consider responsive behavior for many tabs',
|
|
25
|
-
],
|
|
26
|
-
contentGuidelines: [
|
|
27
|
-
'Write clear, descriptive tab labels',
|
|
28
|
-
'Group related content logically',
|
|
29
|
-
'Use consistent naming conventions',
|
|
30
|
-
'Ensure tab content is relevant and complete',
|
|
31
|
-
],
|
|
32
|
-
accessibilityGuidelines: [
|
|
33
|
-
'Ensure proper keyboard navigation between tabs',
|
|
34
|
-
'Use appropriate ARIA attributes for tab panels',
|
|
35
|
-
'Provide clear focus indicators',
|
|
36
|
-
'Announce tab changes to screen readers',
|
|
37
|
-
'Ensure tab content is accessible',
|
|
38
|
-
],
|
|
39
|
-
examples: [
|
|
40
|
-
{
|
|
9
|
+
description:
|
|
10
|
+
'Tabs are used to organize content by grouping similar information on the same page.',
|
|
11
|
+
status: 'general-availability',
|
|
12
|
+
import: {
|
|
41
13
|
name: 'Tabs',
|
|
42
|
-
|
|
43
|
-
|
|
14
|
+
package: '@atlaskit/tabs',
|
|
15
|
+
type: 'default',
|
|
16
|
+
packagePath: path.resolve(__dirname),
|
|
17
|
+
packageJson: require('./package.json'),
|
|
44
18
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
19
|
+
usageGuidelines: [
|
|
20
|
+
'Use to organize related content on the same page without navigating away',
|
|
21
|
+
'Use for concise content or content users access regularly',
|
|
22
|
+
'Limit the number of tabs to avoid overcrowding',
|
|
23
|
+
'Keep tab labels concise and descriptive',
|
|
24
|
+
'Use consistent tab ordering and grouping',
|
|
25
|
+
'Consider responsive behavior for many tabs',
|
|
26
|
+
],
|
|
27
|
+
contentGuidelines: [
|
|
28
|
+
'Write clear, descriptive tab labels',
|
|
29
|
+
'Group related content logically',
|
|
30
|
+
'Use consistent naming conventions',
|
|
31
|
+
'Ensure tab content is relevant and complete',
|
|
32
|
+
],
|
|
33
|
+
accessibilityGuidelines: [
|
|
34
|
+
'Ensure proper keyboard navigation between tabs',
|
|
35
|
+
'Use appropriate ARIA attributes for tab panels',
|
|
36
|
+
'Provide clear focus indicators',
|
|
37
|
+
'Announce tab changes to screen readers',
|
|
38
|
+
'Ensure tab content is accessible',
|
|
39
|
+
],
|
|
40
|
+
examples: [
|
|
41
|
+
{
|
|
42
|
+
name: 'Tabs',
|
|
43
|
+
description: 'Tabs example',
|
|
44
|
+
source: path.resolve(__dirname, './examples/ai/tabs.tsx'),
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
keywords: ['tabs', 'navigation', 'content', 'organization', 'grouping'],
|
|
48
|
+
categories: ['navigation'],
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
};
|
|
50
52
|
|
|
51
53
|
export default documentation;
|
package/types/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/types.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/types.d.ts"
|
|
17
10
|
}
|
package/use-tab/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/use-tab.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/use-tab.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/use-tab.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/use-tab-panel.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/use-tab-panel.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/use-tab-panel.d.ts"
|
|
17
10
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type TabListProps } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* __TabList__
|
|
4
|
-
*
|
|
5
|
-
* A TabList groups `Tab` components together.
|
|
6
|
-
*
|
|
7
|
-
* - [Examples](https://atlassian.design/components/tabs/examples)
|
|
8
|
-
* - [Code](https://atlassian.design/components/tabs/code)
|
|
9
|
-
* - [Usage](https://atlassian.design/components/tabs/usage)
|
|
10
|
-
*/
|
|
11
|
-
declare const TabList: ({ children }: TabListProps) => JSX.Element;
|
|
12
|
-
export default TabList;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type TabPanelProps } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* __TabPanel__
|
|
5
|
-
*
|
|
6
|
-
* A TabPanel houses the contents of a Tab.
|
|
7
|
-
*
|
|
8
|
-
* - [Examples](https://atlassian.design/components/tabs/examples)
|
|
9
|
-
* - [Code](https://atlassian.design/components/tabs/code)
|
|
10
|
-
* - [Usage](https://atlassian.design/components/tabs/usage)
|
|
11
|
-
*/
|
|
12
|
-
declare const TabPanel: ({ children, testId }: TabPanelProps) => React.JSX.Element;
|
|
13
|
-
export default TabPanel;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type TabProps } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* __Tab__
|
|
5
|
-
*
|
|
6
|
-
* Tab represents an individual Tab displayed in a TabList.
|
|
7
|
-
*
|
|
8
|
-
* - [Examples](https://atlassian.design/components/tabs/examples)
|
|
9
|
-
* - [Code](https://atlassian.design/components/tabs/code)
|
|
10
|
-
* - [Usage](https://atlassian.design/components/tabs/usage)
|
|
11
|
-
*/
|
|
12
|
-
declare const Tab: React.ForwardRefExoticComponent<React.PropsWithoutRef<TabProps> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
-
export default Tab;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type TabsProps } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* __Tabs__
|
|
4
|
-
*
|
|
5
|
-
* Tabs acts as a container for all Tab components.
|
|
6
|
-
*
|
|
7
|
-
* - [Examples](https://atlassian.design/components/tabs/examples)
|
|
8
|
-
* - [Code](https://atlassian.design/components/tabs/code)
|
|
9
|
-
* - [Usage](https://atlassian.design/components/tabs/usage)
|
|
10
|
-
*/
|
|
11
|
-
declare const Tabs: (props: TabsProps) => JSX.Element;
|
|
12
|
-
export default Tabs;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '../components/tab-list';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '../components/tab-panel';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '../components/tab';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '../components/tabs';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { OnChangeCallback, SelectedType, TabAttributesType, TabData, TabListAttributesType, TabListProps, TabPanelAttributesType, TabPanelProps, TabProps, TabsProps, } from '../types';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '../use-tab-panel';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '../use-tab';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { default } from './components/tabs';
|
|
2
|
-
export { default as TabPanel } from './components/tab-panel';
|
|
3
|
-
export { default as Tab } from './components/tab';
|
|
4
|
-
export { default as TabList } from './components/tab-list';
|
|
5
|
-
export type { TabProps, TabPanelProps, TabsProps, TabListProps, TabAttributesType, TabListAttributesType, TabPanelAttributesType, TabData, } from './types';
|
|
6
|
-
export { default as useTab } from './use-tab';
|
|
7
|
-
export { default as useTabPanel } from './use-tab-panel';
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { type KeyboardEvent, type ReactNode } from 'react';
|
|
2
|
-
import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
|
|
3
|
-
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
4
|
-
export interface TabProps {
|
|
5
|
-
/**
|
|
6
|
-
* The children to be rendered within a `Tab`.
|
|
7
|
-
*/
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* A `testId` prop is is a unique string that appears as a data attribute `data-testid`
|
|
11
|
-
* on the `Tab` element, serving as a hook for automated tests.
|
|
12
|
-
*/
|
|
13
|
-
testId?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface TabPanelProps {
|
|
16
|
-
/**
|
|
17
|
-
* The children to be rendered within a `TabPanel`.
|
|
18
|
-
*/
|
|
19
|
-
children: ReactNode;
|
|
20
|
-
/**
|
|
21
|
-
* A `testId` prop is is a unique string that appears as a data attribute `data-testid`
|
|
22
|
-
* on the `TabPanel` element, serving as a hook for automated tests.
|
|
23
|
-
*/
|
|
24
|
-
testId?: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated
|
|
28
|
-
* Previously this was the type for the tabs prop that was used like
|
|
29
|
-
* <Tabs tabs={tabs} />
|
|
30
|
-
* The codemod changes this to be
|
|
31
|
-
* <Tabs>
|
|
32
|
-
* <TabList>
|
|
33
|
-
* {tabs.map(tab => <Tab testId={tab.testId}>{tab.label}</Tab>)}
|
|
34
|
-
* </TabList>
|
|
35
|
-
* {tabs.map(tab => <TabPanel>{tab.content}</TabPanel>)}
|
|
36
|
-
* </Tabs>
|
|
37
|
-
* The TabData type remains so the variable used in tabs can have a type.
|
|
38
|
-
*/
|
|
39
|
-
export interface TabData {
|
|
40
|
-
/**
|
|
41
|
-
* String to be put inside a tab.
|
|
42
|
-
*/
|
|
43
|
-
label?: string;
|
|
44
|
-
/**
|
|
45
|
-
* String to be put inside a tab panel.
|
|
46
|
-
*/
|
|
47
|
-
content?: ReactNode;
|
|
48
|
-
/**
|
|
49
|
-
* A `testId` prop is provided for specified elements, which is a unique
|
|
50
|
-
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
51
|
-
* serving as a hook for automated tests. This `testId` is put on the tab.
|
|
52
|
-
*/
|
|
53
|
-
testId?: string;
|
|
54
|
-
/**
|
|
55
|
-
* Used by consumers to convey extra information about the tab.
|
|
56
|
-
*/
|
|
57
|
-
[key: string]: any;
|
|
58
|
-
}
|
|
59
|
-
export type SelectedType = number;
|
|
60
|
-
export type OnChangeCallback = (index: SelectedType, analyticsEvent: UIAnalyticsEvent) => void;
|
|
61
|
-
export interface TabsProps extends WithAnalyticsEventsProps {
|
|
62
|
-
/**
|
|
63
|
-
* The index of the tab that will be selected by default when the component mounts.
|
|
64
|
-
* If not set the first tab will be displayed by default.
|
|
65
|
-
*/
|
|
66
|
-
defaultSelected?: SelectedType;
|
|
67
|
-
/**
|
|
68
|
-
* A callback function which will be fired when a changed. It will be passed
|
|
69
|
-
* the index of the selected tab and a `UIAnalyticsEvent`.
|
|
70
|
-
*/
|
|
71
|
-
onChange?: OnChangeCallback;
|
|
72
|
-
/**
|
|
73
|
-
* The selected tab's index. If this prop is set the component behaves as a
|
|
74
|
-
* controlled component. It will be up to you to listen to `onChange`.
|
|
75
|
-
*/
|
|
76
|
-
selected?: SelectedType;
|
|
77
|
-
/**
|
|
78
|
-
* Tabs by default leaves `TabPanel`'s mounted on the page after they have been selected.
|
|
79
|
-
* If you would like to unmount a `TabPanel` when it is not selected, set this prop to
|
|
80
|
-
* be true.
|
|
81
|
-
*/
|
|
82
|
-
shouldUnmountTabPanelOnChange?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Additional information to be included in the `context` of analytics events that come from `Tabs`.
|
|
85
|
-
*/
|
|
86
|
-
analyticsContext?: Record<string, any>;
|
|
87
|
-
/**
|
|
88
|
-
* A `testId` prop is a unique string that appears as a data attribute `data-testid`
|
|
89
|
-
* on the `Tabs` element, serving as a hook for automated tests.
|
|
90
|
-
*/
|
|
91
|
-
testId?: string;
|
|
92
|
-
/**
|
|
93
|
-
* The children of Tabs. The first child should be a `TabList` filled with `Tab`'s.
|
|
94
|
-
* Subsequent children should be `TabPanel`'s. There should be a `Tab` for each `TabPanel`.
|
|
95
|
-
* If you want to customize `Tab` or `TabPanel`, refer to the examples in the documentation.
|
|
96
|
-
*/
|
|
97
|
-
children: ReactNode;
|
|
98
|
-
/**
|
|
99
|
-
* A unique ID that will be used to generate IDs for tabs and tab panels.
|
|
100
|
-
* This is required for accessibility purposes.
|
|
101
|
-
*/
|
|
102
|
-
id: string;
|
|
103
|
-
}
|
|
104
|
-
export interface TabListProps {
|
|
105
|
-
/**
|
|
106
|
-
* A collection of `Tab`'s. There should be a `Tab` for each `TabPanel`.
|
|
107
|
-
* If you want to customize `Tab` there is documentation in the tab section.
|
|
108
|
-
*/
|
|
109
|
-
children: ReactNode;
|
|
110
|
-
}
|
|
111
|
-
export type TabAttributesType = {
|
|
112
|
-
/**
|
|
113
|
-
* Changes the selected tab.
|
|
114
|
-
*/
|
|
115
|
-
onClick: () => void;
|
|
116
|
-
/**
|
|
117
|
-
* ID of the tab.
|
|
118
|
-
*/
|
|
119
|
-
id: string;
|
|
120
|
-
/**
|
|
121
|
-
* The ID of the tab panel that this tab links.
|
|
122
|
-
*/
|
|
123
|
-
'aria-controls': string;
|
|
124
|
-
/**
|
|
125
|
-
* The position of this tab within the tab list.
|
|
126
|
-
*/
|
|
127
|
-
'aria-posinset': number;
|
|
128
|
-
/**
|
|
129
|
-
* Whether this tab is selected.
|
|
130
|
-
*/
|
|
131
|
-
'aria-selected': boolean;
|
|
132
|
-
/**
|
|
133
|
-
* The number of tabs in this tab list.
|
|
134
|
-
*/
|
|
135
|
-
'aria-setsize': number;
|
|
136
|
-
/**
|
|
137
|
-
* Allows navigation of tabs with automatic activation.
|
|
138
|
-
* Read here for more details: https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-1/tabs.html
|
|
139
|
-
*/
|
|
140
|
-
onKeyDown: (e: KeyboardEvent<HTMLElement>) => void;
|
|
141
|
-
/**
|
|
142
|
-
* Role is "tab".
|
|
143
|
-
*/
|
|
144
|
-
role: 'tab';
|
|
145
|
-
/**
|
|
146
|
-
* If the tab is selected the tab index is 0 and is focusable.
|
|
147
|
-
* Otherwise it is -1 and is not focusable.
|
|
148
|
-
*/
|
|
149
|
-
tabIndex: number;
|
|
150
|
-
};
|
|
151
|
-
export type TabListAttributesType = {
|
|
152
|
-
/**
|
|
153
|
-
* The index of the selected tab.
|
|
154
|
-
*/
|
|
155
|
-
selected: SelectedType;
|
|
156
|
-
/**
|
|
157
|
-
* A unique ID that will be used to generate IDs for tabs and tab panels.
|
|
158
|
-
* This is required for accessibility reasons.
|
|
159
|
-
*/
|
|
160
|
-
tabsId: string;
|
|
161
|
-
/**
|
|
162
|
-
* A callback function which will be fired when a tab is changed.
|
|
163
|
-
*/
|
|
164
|
-
onChange: (index: SelectedType) => void;
|
|
165
|
-
};
|
|
166
|
-
export type TabPanelAttributesType = {
|
|
167
|
-
/**
|
|
168
|
-
* Role is "tabpanel".
|
|
169
|
-
*/
|
|
170
|
-
role: 'tabpanel';
|
|
171
|
-
/**
|
|
172
|
-
* ID of the the tab panel.
|
|
173
|
-
*/
|
|
174
|
-
id: string;
|
|
175
|
-
/**
|
|
176
|
-
* Hidden is true if it is not the selected tab.
|
|
177
|
-
*/
|
|
178
|
-
hidden?: boolean;
|
|
179
|
-
/**
|
|
180
|
-
* The id of the tab that links to this tab panel.
|
|
181
|
-
*/
|
|
182
|
-
'aria-labelledby': string;
|
|
183
|
-
/**
|
|
184
|
-
* If the tab panel is selected the tab index is 0 and is focusable.
|
|
185
|
-
* Otherwise it is -1 and is not focusable.
|
|
186
|
-
*/
|
|
187
|
-
tabIndex: number;
|
|
188
|
-
};
|
package/offerings.json
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"name": "Tabs",
|
|
4
|
-
"package": "@atlaskit/tabs",
|
|
5
|
-
"import": {
|
|
6
|
-
"name": "Tabs",
|
|
7
|
-
"package": "@atlaskit/tabs",
|
|
8
|
-
"type": "default"
|
|
9
|
-
},
|
|
10
|
-
"keywords": ["tabs", "navigation", "content", "organization", "grouping"],
|
|
11
|
-
"categories": ["navigation"],
|
|
12
|
-
"shortDescription": "Tabs are used to organize content by grouping similar information on the same page.",
|
|
13
|
-
"status": "general-availability",
|
|
14
|
-
"accessibilityGuidelines": [
|
|
15
|
-
"Ensure proper keyboard navigation between tabs",
|
|
16
|
-
"Use appropriate ARIA attributes for tab panels",
|
|
17
|
-
"Provide clear focus indicators",
|
|
18
|
-
"Announce tab changes to screen readers",
|
|
19
|
-
"Ensure tab content is accessible"
|
|
20
|
-
],
|
|
21
|
-
"usageGuidelines": [
|
|
22
|
-
"Use to organize related content on the same page",
|
|
23
|
-
"Keep tab labels concise and descriptive",
|
|
24
|
-
"Limit the number of tabs to avoid overcrowding",
|
|
25
|
-
"Use consistent tab ordering and grouping",
|
|
26
|
-
"Consider responsive behavior for many tabs"
|
|
27
|
-
],
|
|
28
|
-
"contentGuidelines": [
|
|
29
|
-
"Write clear, descriptive tab labels",
|
|
30
|
-
"Group related content logically",
|
|
31
|
-
"Use consistent naming conventions",
|
|
32
|
-
"Ensure tab content is relevant and complete"
|
|
33
|
-
],
|
|
34
|
-
"generativeInstructions": "./docs/ai/tabs-instructions.md",
|
|
35
|
-
"examples": ["./examples/ai/tabs.tsx"]
|
|
36
|
-
}
|
|
37
|
-
]
|