@carbon/upgrade 11.40.0 → 11.41.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/cli.js +313 -251
- package/package.json +3 -3
- package/transforms/__testfixtures__/ibm-products-update-page-header-composable-aliased.input.js +19 -0
- package/transforms/__testfixtures__/ibm-products-update-page-header-composable-aliased.output.js +16 -0
- package/transforms/__testfixtures__/ibm-products-update-page-header-composable.input.js +182 -0
- package/transforms/__testfixtures__/ibm-products-update-page-header-composable.output.js +152 -0
- package/transforms/__tests__/ibm-products-update-page-header-composable-test.js +12 -0
- package/transforms/ibm-products-update-page-header-composable.js +391 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/upgrade",
|
|
3
3
|
"description": "A tool for upgrading Carbon versions",
|
|
4
|
-
"version": "11.
|
|
4
|
+
"version": "11.41.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": {
|
|
7
7
|
"carbon-upgrade": "./bin/carbon-upgrade.js"
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
"npm-which": "^3.0.1",
|
|
54
54
|
"rimraf": "^6.0.1",
|
|
55
55
|
"semver": "^7.7.2",
|
|
56
|
-
"tsdown": "^0.
|
|
56
|
+
"tsdown": "^0.22.0",
|
|
57
57
|
"yargs": "^17.0.1"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@ibm/telemetry-js": "^1.5.0",
|
|
61
61
|
"jscodeshift": "^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "30ca2b932469a5c89da10cb8d1fa82586ed14018"
|
|
64
64
|
}
|
package/transforms/__testfixtures__/ibm-products-update-page-header-composable-aliased.input.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { preview__PageHeader as ProductsPageHeader } from '@carbon/ibm-products';
|
|
10
|
+
|
|
11
|
+
// Test: PageHeader with aliased import
|
|
12
|
+
export const AliasedPageHeader = () => (
|
|
13
|
+
<ProductsPageHeader>
|
|
14
|
+
<ProductsPageHeader.Content title="Page title">
|
|
15
|
+
<ProductsPageHeader.ContentText subtitle="Optional subtitle" />
|
|
16
|
+
<p>Content</p>
|
|
17
|
+
</ProductsPageHeader.Content>
|
|
18
|
+
</ProductsPageHeader>
|
|
19
|
+
);
|
package/transforms/__testfixtures__/ibm-products-update-page-header-composable-aliased.output.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { preview__PageHeader as ProductsPageHeader } from '@carbon/ibm-products';
|
|
10
|
+
|
|
11
|
+
// Test: PageHeader with aliased import
|
|
12
|
+
export const AliasedPageHeader = () => (
|
|
13
|
+
<ProductsPageHeader><ProductsPageHeader.Content title="Page title"><ProductsPageHeader.ContentText subtitle="Optional subtitle" />
|
|
14
|
+
<p>Content</p>
|
|
15
|
+
</ProductsPageHeader.Content></ProductsPageHeader>
|
|
16
|
+
);
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { PageHeader } from '@carbon/ibm-products';
|
|
10
|
+
import { Button, Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react';
|
|
11
|
+
import { Lightning, Settings } from '@carbon/react/icons';
|
|
12
|
+
|
|
13
|
+
// Test 1: Basic PageHeader with title only
|
|
14
|
+
export const BasicPageHeader = () => <PageHeader title="Page title" />;
|
|
15
|
+
|
|
16
|
+
// Test 2: PageHeader with title and subtitle
|
|
17
|
+
export const PageHeaderWithSubtitle = () => (
|
|
18
|
+
<PageHeader title="Page title" subtitle="Optional subtitle" />
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// Test 3: PageHeader with title, subtitle, and children
|
|
22
|
+
export const PageHeaderWithChildren = () => (
|
|
23
|
+
<PageHeader title="Page title" subtitle="Optional subtitle">
|
|
24
|
+
<p>Additional content in the page header</p>
|
|
25
|
+
</PageHeader>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// Test 4: PageHeader with breadcrumbs
|
|
29
|
+
export const PageHeaderWithBreadcrumbs = () => (
|
|
30
|
+
<PageHeader
|
|
31
|
+
title="Page title"
|
|
32
|
+
breadcrumbs={[
|
|
33
|
+
{ href: '#', key: 'breadcrumb-1', label: 'Home' },
|
|
34
|
+
{ href: '#', key: 'breadcrumb-2', label: 'Level 2' },
|
|
35
|
+
]}
|
|
36
|
+
breadcrumbOverflowAriaLabel="Open breadcrumb menu"
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
// Test 5: PageHeader with pageActions
|
|
41
|
+
export const PageHeaderWithPageActions = () => (
|
|
42
|
+
<PageHeader
|
|
43
|
+
title="Page title"
|
|
44
|
+
pageActions={[
|
|
45
|
+
{
|
|
46
|
+
key: 'action-1',
|
|
47
|
+
label: 'Primary action',
|
|
48
|
+
kind: 'primary',
|
|
49
|
+
onClick: () => console.log('Primary action'),
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: 'action-2',
|
|
53
|
+
label: 'Secondary action',
|
|
54
|
+
kind: 'secondary',
|
|
55
|
+
onClick: () => console.log('Secondary action'),
|
|
56
|
+
},
|
|
57
|
+
]}
|
|
58
|
+
pageActionsOverflowLabel="More actions"
|
|
59
|
+
/>
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
// Test 6: PageHeader with actionBarItems
|
|
63
|
+
export const PageHeaderWithActionBar = () => (
|
|
64
|
+
<PageHeader
|
|
65
|
+
title="Page title"
|
|
66
|
+
actionBarItems={[
|
|
67
|
+
{
|
|
68
|
+
key: 'action-1',
|
|
69
|
+
renderIcon: Lightning,
|
|
70
|
+
iconDescription: 'Lightning',
|
|
71
|
+
onClick: () => console.log('Lightning'),
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: 'action-2',
|
|
75
|
+
renderIcon: Settings,
|
|
76
|
+
iconDescription: 'Settings',
|
|
77
|
+
onClick: () => console.log('Settings'),
|
|
78
|
+
},
|
|
79
|
+
]}
|
|
80
|
+
actionBarOverflowAriaLabel="Action bar overflow"
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
// Test 7: PageHeader with navigation (Tabs)
|
|
85
|
+
export const PageHeaderWithNavigation = () => (
|
|
86
|
+
<PageHeader
|
|
87
|
+
title="Page title"
|
|
88
|
+
navigation={
|
|
89
|
+
<Tabs>
|
|
90
|
+
<TabList aria-label="Tab navigation">
|
|
91
|
+
<Tab>Tab 1</Tab>
|
|
92
|
+
<Tab>Tab 2</Tab>
|
|
93
|
+
<Tab>Tab 3</Tab>
|
|
94
|
+
</TabList>
|
|
95
|
+
<TabPanels>
|
|
96
|
+
<TabPanel>Content 1</TabPanel>
|
|
97
|
+
<TabPanel>Content 2</TabPanel>
|
|
98
|
+
<TabPanel>Content 3</TabPanel>
|
|
99
|
+
</TabPanels>
|
|
100
|
+
</Tabs>
|
|
101
|
+
}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
// Test 8: PageHeader with tags
|
|
106
|
+
export const PageHeaderWithTags = () => (
|
|
107
|
+
<PageHeader
|
|
108
|
+
title="Page title"
|
|
109
|
+
tags={[
|
|
110
|
+
{ label: 'Tag 1', key: 'tag-1' },
|
|
111
|
+
{ label: 'Tag 2', key: 'tag-2' },
|
|
112
|
+
{ label: 'Tag 3', key: 'tag-3' },
|
|
113
|
+
]}
|
|
114
|
+
/>
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
// Test 9: Complete PageHeader with all features
|
|
118
|
+
export const CompletePageHeader = () => (
|
|
119
|
+
<PageHeader
|
|
120
|
+
title="Complete page title"
|
|
121
|
+
subtitle="With all the features"
|
|
122
|
+
breadcrumbs={[
|
|
123
|
+
{ href: '#', key: 'breadcrumb-1', label: 'Home' },
|
|
124
|
+
{ href: '#', key: 'breadcrumb-2', label: 'Level 2' },
|
|
125
|
+
]}
|
|
126
|
+
breadcrumbOverflowAriaLabel="Open breadcrumb menu"
|
|
127
|
+
actionBarItems={[
|
|
128
|
+
{
|
|
129
|
+
key: 'action-1',
|
|
130
|
+
renderIcon: Lightning,
|
|
131
|
+
iconDescription: 'Lightning',
|
|
132
|
+
onClick: () => console.log('Lightning'),
|
|
133
|
+
},
|
|
134
|
+
]}
|
|
135
|
+
actionBarOverflowAriaLabel="Action bar overflow"
|
|
136
|
+
pageActions={[
|
|
137
|
+
{
|
|
138
|
+
key: 'action-1',
|
|
139
|
+
label: 'Primary action',
|
|
140
|
+
kind: 'primary',
|
|
141
|
+
onClick: () => console.log('Primary action'),
|
|
142
|
+
},
|
|
143
|
+
]}
|
|
144
|
+
pageActionsOverflowLabel="More actions"
|
|
145
|
+
navigation={
|
|
146
|
+
<Tabs>
|
|
147
|
+
<TabList aria-label="Tab navigation">
|
|
148
|
+
<Tab>Tab 1</Tab>
|
|
149
|
+
<Tab>Tab 2</Tab>
|
|
150
|
+
</TabList>
|
|
151
|
+
</Tabs>
|
|
152
|
+
}
|
|
153
|
+
tags={[
|
|
154
|
+
{ label: 'Tag 1', key: 'tag-1' },
|
|
155
|
+
{ label: 'Tag 2', key: 'tag-2' },
|
|
156
|
+
]}>
|
|
157
|
+
<p>Page content goes here</p>
|
|
158
|
+
</PageHeader>
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
// Test 10: PageHeader with title as object
|
|
162
|
+
export const PageHeaderWithTitleObject = () => (
|
|
163
|
+
<PageHeader
|
|
164
|
+
title={{
|
|
165
|
+
text: 'Page title',
|
|
166
|
+
icon: Lightning,
|
|
167
|
+
}}
|
|
168
|
+
/>
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
// Test 11: PageHeader with deprecated props (should be ignored)
|
|
172
|
+
export const PageHeaderWithDeprecatedProps = () => (
|
|
173
|
+
<PageHeader
|
|
174
|
+
title="Page title"
|
|
175
|
+
collapseHeader={false}
|
|
176
|
+
hasCollapseHeaderToggle={true}
|
|
177
|
+
collapseHeaderIconDescription="Collapse"
|
|
178
|
+
expandHeaderIconDescription="Expand"
|
|
179
|
+
enableBreadcrumbScroll={true}
|
|
180
|
+
withoutBackground={false}
|
|
181
|
+
/>
|
|
182
|
+
);
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { preview__PageHeader as PageHeader } from '@carbon/ibm-products';
|
|
10
|
+
import { Button, Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react';
|
|
11
|
+
import { Lightning, Settings } from '@carbon/react/icons';
|
|
12
|
+
|
|
13
|
+
// Test 1: Basic PageHeader with title only
|
|
14
|
+
export const BasicPageHeader = () => <PageHeader><PageHeader.Content title="Page title" /></PageHeader>;
|
|
15
|
+
|
|
16
|
+
// Test 2: PageHeader with title and subtitle
|
|
17
|
+
export const PageHeaderWithSubtitle = () => (
|
|
18
|
+
<PageHeader><PageHeader.Content title="Page title"><PageHeader.ContentText subtitle="Optional subtitle" /></PageHeader.Content></PageHeader>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// Test 3: PageHeader with title, subtitle, and children
|
|
22
|
+
export const PageHeaderWithChildren = () => (
|
|
23
|
+
<PageHeader><PageHeader.Content title="Page title"><PageHeader.ContentText subtitle="Optional subtitle" />
|
|
24
|
+
<p>Additional content in the page header</p>
|
|
25
|
+
</PageHeader.Content></PageHeader>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// Test 4: PageHeader with breadcrumbs
|
|
29
|
+
export const PageHeaderWithBreadcrumbs = () => (
|
|
30
|
+
<PageHeader><PageHeader.BreadcrumbBar
|
|
31
|
+
breadcrumbs={[
|
|
32
|
+
{ href: '#', key: 'breadcrumb-1', label: 'Home' },
|
|
33
|
+
{ href: '#', key: 'breadcrumb-2', label: 'Level 2' },
|
|
34
|
+
]}
|
|
35
|
+
breadcrumbOverflowAriaLabel="Open breadcrumb menu" /><PageHeader.Content title="Page title" /></PageHeader>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
// Test 5: PageHeader with pageActions
|
|
39
|
+
export const PageHeaderWithPageActions = () => (
|
|
40
|
+
<PageHeader pageActionsOverflowLabel="More actions"><PageHeader.Content
|
|
41
|
+
title="Page title"
|
|
42
|
+
pageActions={[
|
|
43
|
+
{
|
|
44
|
+
key: 'action-1',
|
|
45
|
+
label: 'Primary action',
|
|
46
|
+
kind: 'primary',
|
|
47
|
+
onClick: () => console.log('Primary action'),
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: 'action-2',
|
|
51
|
+
label: 'Secondary action',
|
|
52
|
+
kind: 'secondary',
|
|
53
|
+
onClick: () => console.log('Secondary action'),
|
|
54
|
+
},
|
|
55
|
+
]} /></PageHeader>
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
// Test 6: PageHeader with actionBarItems
|
|
59
|
+
export const PageHeaderWithActionBar = () => (
|
|
60
|
+
<PageHeader actionBarOverflowAriaLabel="Action bar overflow"><PageHeader.Content
|
|
61
|
+
title="Page title"
|
|
62
|
+
contextualActions={[
|
|
63
|
+
{
|
|
64
|
+
key: 'action-1',
|
|
65
|
+
renderIcon: Lightning,
|
|
66
|
+
iconDescription: 'Lightning',
|
|
67
|
+
onClick: () => console.log('Lightning'),
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: 'action-2',
|
|
71
|
+
renderIcon: Settings,
|
|
72
|
+
iconDescription: 'Settings',
|
|
73
|
+
onClick: () => console.log('Settings'),
|
|
74
|
+
},
|
|
75
|
+
]} /></PageHeader>
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
// Test 7: PageHeader with navigation (Tabs)
|
|
79
|
+
export const PageHeaderWithNavigation = () => (
|
|
80
|
+
<PageHeader><PageHeader.Content title="Page title" /><PageHeader.TabBar><Tabs>
|
|
81
|
+
<TabList aria-label="Tab navigation">
|
|
82
|
+
<Tab>Tab 1</Tab>
|
|
83
|
+
<Tab>Tab 2</Tab>
|
|
84
|
+
<Tab>Tab 3</Tab>
|
|
85
|
+
</TabList>
|
|
86
|
+
<TabPanels>
|
|
87
|
+
<TabPanel>Content 1</TabPanel>
|
|
88
|
+
<TabPanel>Content 2</TabPanel>
|
|
89
|
+
<TabPanel>Content 3</TabPanel>
|
|
90
|
+
</TabPanels>
|
|
91
|
+
</Tabs></PageHeader.TabBar></PageHeader>
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
// Test 8: PageHeader with tags
|
|
95
|
+
export const PageHeaderWithTags = () => (
|
|
96
|
+
<PageHeader><PageHeader.Content title="Page title" /><PageHeader.TagOverflow
|
|
97
|
+
tags={[
|
|
98
|
+
{ label: 'Tag 1', key: 'tag-1' },
|
|
99
|
+
{ label: 'Tag 2', key: 'tag-2' },
|
|
100
|
+
{ label: 'Tag 3', key: 'tag-3' },
|
|
101
|
+
]} /></PageHeader>
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
// Test 9: Complete PageHeader with all features
|
|
105
|
+
export const CompletePageHeader = () => (
|
|
106
|
+
<PageHeader
|
|
107
|
+
actionBarOverflowAriaLabel="Action bar overflow"
|
|
108
|
+
pageActionsOverflowLabel="More actions"><PageHeader.BreadcrumbBar
|
|
109
|
+
breadcrumbs={[
|
|
110
|
+
{ href: '#', key: 'breadcrumb-1', label: 'Home' },
|
|
111
|
+
{ href: '#', key: 'breadcrumb-2', label: 'Level 2' },
|
|
112
|
+
]}
|
|
113
|
+
breadcrumbOverflowAriaLabel="Open breadcrumb menu" /><PageHeader.Content
|
|
114
|
+
title="Complete page title"
|
|
115
|
+
pageActions={[
|
|
116
|
+
{
|
|
117
|
+
key: 'action-1',
|
|
118
|
+
label: 'Primary action',
|
|
119
|
+
kind: 'primary',
|
|
120
|
+
onClick: () => console.log('Primary action'),
|
|
121
|
+
},
|
|
122
|
+
]}
|
|
123
|
+
contextualActions={[
|
|
124
|
+
{
|
|
125
|
+
key: 'action-1',
|
|
126
|
+
renderIcon: Lightning,
|
|
127
|
+
iconDescription: 'Lightning',
|
|
128
|
+
onClick: () => console.log('Lightning'),
|
|
129
|
+
},
|
|
130
|
+
]}><PageHeader.ContentText subtitle="With all the features" />
|
|
131
|
+
<p>Page content goes here</p>
|
|
132
|
+
</PageHeader.Content><PageHeader.TabBar><Tabs>
|
|
133
|
+
<TabList aria-label="Tab navigation">
|
|
134
|
+
<Tab>Tab 1</Tab>
|
|
135
|
+
<Tab>Tab 2</Tab>
|
|
136
|
+
</TabList>
|
|
137
|
+
</Tabs></PageHeader.TabBar><PageHeader.TagOverflow
|
|
138
|
+
tags={[
|
|
139
|
+
{ label: 'Tag 1', key: 'tag-1' },
|
|
140
|
+
{ label: 'Tag 2', key: 'tag-2' },
|
|
141
|
+
]} /></PageHeader>
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
// Test 10: PageHeader with title as object
|
|
145
|
+
export const PageHeaderWithTitleObject = () => (
|
|
146
|
+
<PageHeader><PageHeader.Content title={'Page title'} renderIcon={Lightning} /></PageHeader>
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
// Test 11: PageHeader with deprecated props (should be ignored)
|
|
150
|
+
export const PageHeaderWithDeprecatedProps = () => (
|
|
151
|
+
<PageHeader><PageHeader.Content title="Page title" /></PageHeader>
|
|
152
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
const { defineTest } = require('jscodeshift/dist/testUtils');
|
|
11
|
+
|
|
12
|
+
defineTest(__dirname, 'ibm-products-update-page-header-composable');
|