Skip to content

Commit c3ddeb8

Browse files
authored
fix(stackblitz): fix and standardize masthead examples for v2 (#11199)
### Related Ticket(s) ### Description Updates the masthead component's ~~CodeSandbox~~ Stackblitz examples with up-to-date demonstrations for v2. ### Changelog **Changed** - Updates masthead Stackblitz examples for v2. <!-- React and Web Component deploy previews are enabled by default. --> <!-- To enable additional available deploy previews, apply the following --> <!-- labels for the corresponding package: --> <!-- *** "test: e2e": Codesandbox examples and e2e integration tests --> <!-- *** "package: services": Services --> <!-- *** "package: utilities": Utilities --> <!-- *** "RTL": React / Web Components (RTL) --> <!-- *** "feature flag": React / Web Components (experimental) -->
1 parent d20ec1f commit c3ddeb8

File tree

33 files changed

+933
-132
lines changed

33 files changed

+933
-132
lines changed

packages/carbon-web-components/src/components/date-picker/append-to-plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license
33
*
4-
* Copyright IBM Corp. 2019, 2022
4+
* Copyright IBM Corp. 2019, 2023
55
*
66
* This source code is licensed under the Apache-2.0 license found in the
77
* LICENSE file in the root directory of this source tree.

packages/carbon-web-components/src/components/date-picker/month-select-plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license
33
*
4-
* Copyright IBM Corp. 2019, 2022
4+
* Copyright IBM Corp. 2019, 2023
55
*
66
* This source code is licensed under the Apache-2.0 license found in the
77
* LICENSE file in the root directory of this source tree.

packages/carbon-web-components/src/components/radio-button/radio-button.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license
33
*
4-
* Copyright IBM Corp. 2019, 2023
4+
* Copyright IBM Corp. 2019, 2024
55
*
66
* This source code is licensed under the Apache-2.0 license found in the
77
* LICENSE file in the root directory of this source tree.

packages/carbon-web-components/src/polyfills/element-closest.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license
33
*
4-
* Copyright IBM Corp. 2019, 2022
4+
* Copyright IBM Corp. 2019, 2023
55
*
66
* This source code is licensed under the Apache-2.0 license found in the
77
* LICENSE file in the root directory of this source tree.

packages/services-store/src/actions/__tests__/translateAPI.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license
33
*
4-
* Copyright IBM Corp. 2020, 2023
4+
* Copyright IBM Corp. 2020, 2024
55
*
66
* This source code is licensed under the Apache-2.0 license found in the
77
* LICENSE file in the root directory of this source tree.

packages/services-store/src/reducers/__tests__/translateAPI.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license
33
*
4-
* Copyright IBM Corp. 2020, 2023
4+
* Copyright IBM Corp. 2020, 2024
55
*
66
* This source code is licensed under the Apache-2.0 license found in the
77
* LICENSE file in the root directory of this source tree.

packages/services-store/tests/utils/search-params.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license
33
*
4-
* Copyright IBM Corp. 2020
4+
* Copyright IBM Corp. 2020, 2023
55
*
66
* This source code is licensed under the Apache-2.0 license found in the
77
* LICENSE file in the root directory of this source tree.

packages/services/src/services/KalturaPlayer/KalturaPlayer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2020, 2022
2+
* Copyright IBM Corp. 2020, 2023
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/services/src/services/MastheadLogo/MastheadLogo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2016, 2022
2+
* Copyright IBM Corp. 2016, 2023
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/storybook-addon-theme/src/components/Panel.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2020, 2022
2+
* Copyright IBM Corp. 2020, 2023
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/styles/scss/components/background-media/_background-media.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2016, 2023
2+
* Copyright IBM Corp. 2016, 2024
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/styles/scss/components/masthead/_masthead-l1.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2016, 2023
2+
* Copyright IBM Corp. 2016, 2024
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/styles/scss/components/masthead/_masthead-megamenu.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2016, 2023
2+
* Copyright IBM Corp. 2016, 2024
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/styles/scss/components/video-player/_video-player.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2016, 2023
2+
* Copyright IBM Corp. 2016, 2024
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/utilities/src/utilities/calculateTotalWidth/calculateTotalWidth.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2016, 2022
2+
* Copyright IBM Corp. 2016, 2023
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/web-components/examples/stackblitz/components/masthead-l1/cdn-rtl.html

+13-3
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,25 @@
1616
<link rel="stylesheet" href="src/index.scss" />
1717
<style type="text/css">
1818
/* Suppress custom element until styles are loaded */
19-
c4d-masthead-composite:not(:defined) {
19+
c4d-masthead-container:not(:defined) {
2020
display: none;
2121
}
2222
</style>
23+
<script src="src/index-cdn.js" defer></script>
24+
<script src="src/ddo.js"></script>
25+
26+
<!-- IBM Tag Management and Site Analytics -->
27+
<script src="//1.www.s81c.com/common/stats/ibm-common.js" async="async" defer></script>
28+
<!-- IBM CMaaS -->
29+
<script src="//www.ibm.com/common/digitaladvisor/cm-app/latest/cm-app.min.js" defer></script>
30+
31+
<!-- CDN bundle -->
2332
<script type="module" src="https://1.www.s81c.com/common/carbon-for-ibm-dotcom/tag/v2/latest/rtl/masthead.rtl.min.js"></script>
24-
<script type="module" src="src/index-cdn.js"></script>
2533
</head>
2634
<body>
27-
<c4d-masthead-composite></c4d-masthead-composite>
35+
<c4d-masthead-container
36+
data-endpoint="/common/carbon-for-ibm-dotcom/translations/masthead-footer/v2.1"
37+
></c4d-masthead-container>
2838
<main class="cds--content cds-ce-demo--ui-shell-content">
2939
<div class="cds--grid">
3040
<div class="cds--row">

packages/web-components/examples/stackblitz/components/masthead-l1/cdn.html

+13-3
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,25 @@
1616
<link rel="stylesheet" href="src/index.scss" />
1717
<style type="text/css">
1818
/* Suppress custom element until styles are loaded */
19-
c4d-masthead-composite:not(:defined) {
19+
c4d-masthead-container:not(:defined) {
2020
display: none;
2121
}
2222
</style>
23+
<script src="src/index-cdn.js" defer></script>
24+
<script src="src/ddo.js"></script>
25+
26+
<!-- IBM Tag Management and Site Analytics -->
27+
<script src="//1.www.s81c.com/common/stats/ibm-common.js" async="async" defer></script>
28+
<!-- IBM CMaaS -->
29+
<script src="//www.ibm.com/common/digitaladvisor/cm-app/latest/cm-app.min.js" defer></script>
30+
31+
<!-- CDN bundle -->
2332
<script type="module" src="https://1.www.s81c.com/common/carbon-for-ibm-dotcom/tag/v2/latest/masthead.min.js"></script>
24-
<script type="module" src="src/index-cdn.js"></script>
2533
</head>
2634
<body>
27-
<c4d-masthead-composite></c4d-masthead-composite>
35+
<c4d-masthead-container
36+
data-endpoint="/common/carbon-for-ibm-dotcom/translations/masthead-footer/v2.1"
37+
></c4d-masthead-container>
2838
<main class="cds--content cds-ce-demo--ui-shell-content">
2939
<div class="cds--grid">
3040
<div class="cds--row">

packages/web-components/examples/stackblitz/components/masthead-l1/index.html

+11-3
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,22 @@
1414
<link rel="stylesheet" href="https://1.www.s81c.com/common/carbon-for-ibm-dotcom/tag/v1/latest/plex.css" />
1515
<style type="text/css">
1616
/* Suppress custom element until styles are loaded */
17-
cds-masthead-composite:not(:defined) {
17+
c4d-masthead-container:not(:defined) {
1818
display: none;
1919
}
2020
</style>
21-
<script type="module" src="src/index.js"></script>
21+
<script src="src/index.js" defer></script>
22+
<script src="src/ddo.js"></script>
23+
24+
<!-- IBM Tag Management and Site Analytics -->
25+
<script src="//1.www.s81c.com/common/stats/ibm-common.js" async="async" defer></script>
26+
<!-- IBM CMaaS -->
27+
<script src="//www.ibm.com/common/digitaladvisor/cm-app/latest/cm-app.min.js" defer></script>
2228
</head>
2329
<body>
24-
<c4d-masthead-composite></c4d-masthead-composite>
30+
<c4d-masthead-container
31+
data-endpoint="/common/carbon-for-ibm-dotcom/translations/masthead-footer/v2.1"
32+
></c4d-masthead-container>
2533
<main class="cds--content cds-ce-demo--ui-shell-content">
2634
<div class="cds--grid">
2735
<div class="cds--row">

packages/web-components/examples/stackblitz/components/masthead-l1/package.json

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
},
1616
"devDependencies": {
1717
"@babel/core": "^7.0.0-0",
18-
"@babel/plugin-transform-runtime": "^7.15.0",
19-
"@babel/preset-env": "~7.23.2",
2018
"carbon-components": "^10.36.0",
2119
"parcel-bundler": "1.12.3",
2220
"rimraf": "^3.0.2",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/**
2+
* @license
3+
*
4+
* Copyright IBM Corp. 2022, 2023
5+
*
6+
* This source code is licensed under the Apache-2.0 license found in the
7+
* LICENSE file in the root directory of this source tree.
8+
*/
9+
10+
import './index.scss';
11+
12+
window.digitalData = {
13+
page: {
14+
category: {
15+
primaryCategory: '',
16+
},
17+
pageInfo: {
18+
effectiveDate: '06-14-2022',
19+
expiryDate: '06-14-2026',
20+
language: 'en-au',
21+
publishDate: '06-14-2022',
22+
publisher: 'IBM Corporation',
23+
version: 'Carbon for IBM.com',
24+
ibm: {
25+
contentDelivery: 'HTML',
26+
contentProducer: 'IBM Experience Engine-Digital',
27+
country: 'au',
28+
industry: 'zz',
29+
owner: 'Corporate Webmaster/New York/IBM',
30+
siteID: 'GLOBAL',
31+
subject: 'IBM Experience Engine-Digital',
32+
type: 'zz',
33+
messaging: {
34+
routing: {
35+
focusArea: 'Miscellaneous - Cross IBM - ISV',
36+
languageCode: 'en',
37+
regionCode: 'AU',
38+
},
39+
translation: {
40+
languageCode: 'en',
41+
regionCode: 'AU',
42+
},
43+
},
44+
},
45+
hotjar: {
46+
enable: false,
47+
},
48+
},
49+
},
50+
};

0 commit comments

Comments
 (0)