@atlaskit/tabs 16.1.2 → 16.2.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 +14 -1
- package/__perf__/default.tsx +16 -16
- package/codemods/13.0.0-lite-mode.tsx +14 -18
- package/codemods/__tests__/13.0.0-lite-mode.tsx +44 -44
- package/codemods/__tests__/add-id-prop.tsx +13 -13
- package/codemods/__tests__/map-tabs-prop.tsx +42 -42
- package/codemods/__tests__/on-select-to-on-change.tsx +49 -49
- package/codemods/__tests__/remove-components-prop.tsx +14 -14
- package/codemods/__tests__/remove-is-selected-test-prop.tsx +14 -14
- package/codemods/__tests__/remove-tab-item-tab-content.tsx +7 -7
- package/codemods/__tests__/remove-types.tsx +14 -14
- package/codemods/__tests__/rename-is-content-persisted-to-should-unmount-tab-panel-on-change.tsx +36 -38
- package/codemods/migrations/add-id-prop.tsx +37 -45
- package/codemods/migrations/map-tabs-prop.tsx +143 -164
- package/codemods/migrations/on-select-to-on-change.tsx +66 -76
- package/codemods/migrations/remove-components-prop.tsx +3 -3
- package/codemods/migrations/remove-is-selected-test-prop.tsx +3 -3
- package/codemods/migrations/remove-tab-item-tab-content.tsx +19 -22
- package/codemods/migrations/remove-types.tsx +32 -32
- package/codemods/migrations/rename-is-content-persisted-to-should-unmount-tab-panel-on-change.tsx +46 -59
- package/codemods/utils.tsx +25 -28
- package/dist/cjs/components/tab-list.js +5 -0
- package/dist/cjs/components/tab-panel.js +5 -0
- package/dist/cjs/components/tab.js +4 -0
- package/dist/cjs/components/tabs.js +4 -2
- package/dist/cjs/internal/styles.js +8 -5
- package/dist/es2019/components/tab-list.js +5 -0
- package/dist/es2019/components/tab-panel.js +5 -0
- package/dist/es2019/components/tab.js +4 -0
- package/dist/es2019/components/tabs.js +6 -1
- package/dist/es2019/internal/styles.js +9 -4
- package/dist/esm/components/tab-list.js +5 -0
- package/dist/esm/components/tab-panel.js +5 -0
- package/dist/esm/components/tab.js +4 -0
- package/dist/esm/components/tabs.js +6 -1
- package/dist/esm/internal/styles.js +8 -4
- package/dist/types/components/tab.d.ts +3 -0
- package/dist/types-ts4.5/components/tab.d.ts +3 -0
- package/extract-react-types/tab-attributes.tsx +1 -1
- package/extract-react-types/tab-panel-attributes.tsx +1 -1
- package/package.json +93 -93
- package/report.api.md +40 -42
package/package.json
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
2
|
+
"name": "@atlaskit/tabs",
|
|
3
|
+
"version": "16.2.0",
|
|
4
|
+
"description": "Tabs are used to organize content by grouping similar information on the same page.",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"registry": "https://registry.npmjs.org/"
|
|
7
|
+
},
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
|
+
"author": "Atlassian Pty Ltd",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"main": "dist/cjs/index.js",
|
|
12
|
+
"module": "dist/esm/index.js",
|
|
13
|
+
"module:es2019": "dist/es2019/index.js",
|
|
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
|
+
"sideEffects": false,
|
|
24
|
+
"atlaskit:src": "src/index.tsx",
|
|
25
|
+
"atlassian": {
|
|
26
|
+
"team": "Design System Team",
|
|
27
|
+
"releaseModel": "continuous",
|
|
28
|
+
"productPushConsumption": [
|
|
29
|
+
"jira"
|
|
30
|
+
],
|
|
31
|
+
"website": {
|
|
32
|
+
"name": "Tabs",
|
|
33
|
+
"category": "Components"
|
|
34
|
+
},
|
|
35
|
+
"runReact18": true
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@atlaskit/analytics-next": "^9.3.0",
|
|
39
|
+
"@atlaskit/codemod-utils": "^4.2.0",
|
|
40
|
+
"@atlaskit/focus-ring": "^1.4.0",
|
|
41
|
+
"@atlaskit/primitives": "^7.3.0",
|
|
42
|
+
"@atlaskit/theme": "^12.10.0",
|
|
43
|
+
"@atlaskit/tokens": "^1.51.0",
|
|
44
|
+
"@babel/runtime": "^7.0.0",
|
|
45
|
+
"@emotion/react": "^11.7.1"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"react": "^16.8.0 || ^17.0.0 || ~18.2.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@af/accessibility-testing": "*",
|
|
52
|
+
"@af/integration-testing": "*",
|
|
53
|
+
"@atlaskit/ds-lib": "^2.3.0",
|
|
54
|
+
"@atlaskit/ssr": "*",
|
|
55
|
+
"@atlaskit/tooltip": "^18.5.0",
|
|
56
|
+
"@atlaskit/visual-regression": "*",
|
|
57
|
+
"@testing-library/react": "^12.1.5",
|
|
58
|
+
"jscodeshift": "^0.13.0",
|
|
59
|
+
"react-dom": "^16.8.0",
|
|
60
|
+
"react-lorem-component": "^0.13.0",
|
|
61
|
+
"storybook-addon-performance": "^0.16.0",
|
|
62
|
+
"typescript": "~5.4.2",
|
|
63
|
+
"wait-for-expect": "^1.2.0"
|
|
64
|
+
},
|
|
65
|
+
"techstack": {
|
|
66
|
+
"@atlassian/frontend": {
|
|
67
|
+
"import-structure": "atlassian-conventions"
|
|
68
|
+
},
|
|
69
|
+
"@repo/internal": {
|
|
70
|
+
"dom-events": "use-bind-event-listener",
|
|
71
|
+
"design-system": "v1",
|
|
72
|
+
"ui-components": [
|
|
73
|
+
"primitives",
|
|
74
|
+
"lite-mode"
|
|
75
|
+
],
|
|
76
|
+
"analytics": "analytics-next",
|
|
77
|
+
"design-tokens": [
|
|
78
|
+
"color",
|
|
79
|
+
"spacing"
|
|
80
|
+
],
|
|
81
|
+
"styling": [
|
|
82
|
+
"static",
|
|
83
|
+
"emotion"
|
|
84
|
+
],
|
|
85
|
+
"deprecation": "no-deprecated-imports"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"af:exports": {
|
|
89
|
+
".": "./src/index.tsx",
|
|
90
|
+
"./types": "./src/types.tsx",
|
|
91
|
+
"./hooks": "./src/hooks.tsx"
|
|
92
|
+
},
|
|
93
|
+
"homepage": "https://atlassian.design/components/tabs/"
|
|
94
|
+
}
|
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/tabs"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -23,10 +24,7 @@ import UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
|
|
|
23
24
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
24
25
|
|
|
25
26
|
// @public (undocumented)
|
|
26
|
-
type OnChangeCallback = (
|
|
27
|
-
index: SelectedType,
|
|
28
|
-
analyticsEvent: UIAnalyticsEvent,
|
|
29
|
-
) => void;
|
|
27
|
+
type OnChangeCallback = (index: SelectedType, analyticsEvent: UIAnalyticsEvent) => void;
|
|
30
28
|
|
|
31
29
|
// @public (undocumented)
|
|
32
30
|
type SelectedType = number;
|
|
@@ -36,24 +34,24 @@ export function Tab({ children, testId }: TabProps): jsx.JSX.Element;
|
|
|
36
34
|
|
|
37
35
|
// @public (undocumented)
|
|
38
36
|
export type TabAttributesType = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
onClick: () => void;
|
|
38
|
+
id: string;
|
|
39
|
+
'aria-controls': string;
|
|
40
|
+
'aria-posinset': number;
|
|
41
|
+
'aria-selected': boolean;
|
|
42
|
+
'aria-setsize': number;
|
|
43
|
+
onMouseDown: (e: MouseEvent_2<HTMLElement>) => void;
|
|
44
|
+
onKeyDown: (e: KeyboardEvent_2<HTMLElement>) => void;
|
|
45
|
+
role: 'tab';
|
|
46
|
+
tabIndex: number;
|
|
49
47
|
};
|
|
50
48
|
|
|
51
49
|
// @public @deprecated (undocumented)
|
|
52
50
|
export interface TabData {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
content?: ReactNode;
|
|
53
|
+
label?: string;
|
|
54
|
+
testId?: string;
|
|
57
55
|
}
|
|
58
56
|
|
|
59
57
|
// @public
|
|
@@ -61,14 +59,14 @@ export const TabList: ({ children }: TabListProps) => jsx.JSX.Element;
|
|
|
61
59
|
|
|
62
60
|
// @public (undocumented)
|
|
63
61
|
export type TabListAttributesType = {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
selected: SelectedType;
|
|
63
|
+
tabsId: string;
|
|
64
|
+
onChange: (index: SelectedType) => void;
|
|
67
65
|
};
|
|
68
66
|
|
|
69
67
|
// @public (undocumented)
|
|
70
68
|
export interface TabListProps {
|
|
71
|
-
|
|
69
|
+
children: ReactNode;
|
|
72
70
|
}
|
|
73
71
|
|
|
74
72
|
// @public
|
|
@@ -76,24 +74,24 @@ export const TabPanel: ({ children, testId }: TabPanelProps) => jsx.JSX.Element;
|
|
|
76
74
|
|
|
77
75
|
// @public (undocumented)
|
|
78
76
|
export type TabPanelAttributesType = {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
role: 'tabpanel';
|
|
78
|
+
id: string;
|
|
79
|
+
hidden?: boolean;
|
|
80
|
+
'aria-labelledby': string;
|
|
81
|
+
onMouseDown: (e: MouseEvent_2<HTMLElement>) => void;
|
|
82
|
+
tabIndex: number;
|
|
85
83
|
};
|
|
86
84
|
|
|
87
85
|
// @public (undocumented)
|
|
88
86
|
export interface TabPanelProps {
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
children: ReactNode;
|
|
88
|
+
testId?: string;
|
|
91
89
|
}
|
|
92
90
|
|
|
93
91
|
// @public (undocumented)
|
|
94
92
|
export interface TabProps {
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
children: ReactNode;
|
|
94
|
+
testId?: string;
|
|
97
95
|
}
|
|
98
96
|
|
|
99
97
|
// @public
|
|
@@ -102,14 +100,14 @@ export default Tabs;
|
|
|
102
100
|
|
|
103
101
|
// @public (undocumented)
|
|
104
102
|
export interface TabsProps extends WithAnalyticsEventsProps {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
analyticsContext?: Record<string, any>;
|
|
104
|
+
children: ReactNode;
|
|
105
|
+
defaultSelected?: SelectedType;
|
|
106
|
+
id: string;
|
|
107
|
+
onChange?: OnChangeCallback;
|
|
108
|
+
selected?: SelectedType;
|
|
109
|
+
shouldUnmountTabPanelOnChange?: boolean;
|
|
110
|
+
testId?: string;
|
|
113
111
|
}
|
|
114
112
|
|
|
115
113
|
// @public (undocumented)
|
|
@@ -129,7 +127,7 @@ export const useTabPanel: () => TabPanelAttributesType;
|
|
|
129
127
|
|
|
130
128
|
```json
|
|
131
129
|
{
|
|
132
|
-
|
|
130
|
+
"react": "^16.8.0"
|
|
133
131
|
}
|
|
134
132
|
```
|
|
135
133
|
|