Skip to content

Commit 1b6b605

Browse files
authored
docs: add warning notice to internal storybook (#7338)
**Related Issue:** N/A ## Summary This displays a notice for anyone that might still be looking at the storybook link, which has now been deprecated (as component doc) in favor of the official documentation site. **Note**: this won't be displayed for Chromatic Storybook builds
1 parent de7b135 commit 1b6b605

File tree

1 file changed

+38
-0
lines changed
  • packages/calcite-components/.storybook

1 file changed

+38
-0
lines changed

packages/calcite-components/.storybook/main.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,42 @@ module.exports = {
2323
],
2424
};
2525
},
26+
managerHead: (head: string): string => {
27+
if (process.env.STORYBOOK_SCREENSHOT_TEST_BUILD) {
28+
return head;
29+
}
30+
31+
return `
32+
<link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
33+
<link rel="stylesheet" href="./build/calcite.css" />
34+
<script type="module" src="./build/calcite.esm.js"></script>
35+
36+
<template id="internalStorybookNotice">
37+
<calcite-notice open icon="exclamation-mark-triangle" closable kind="warning" scale="l" style="font-family: var(--calcite-sans-family)">
38+
<div slot="title">This storybook is on the current @next version and is meant for internal, testing purposes only.</div>
39+
<div slot="link">
40+
Please refer to the
41+
<calcite-link
42+
slot="link"
43+
title="my action"
44+
href="https://developers.arcgis.com/calcite-design-system/components/"
45+
>
46+
Calcite Components documentation site
47+
</calcite-link>
48+
to browse and interact with components.
49+
</div>
50+
</calcite-notice>
51+
</template>
52+
53+
<script>
54+
window.addEventListener(
55+
"load",
56+
() => document.body.prepend(document.getElementById("internalStorybookNotice").content.cloneNode(true)),
57+
{ once: true }
58+
);
59+
</script>
60+
61+
${head}
62+
`;
63+
},
2664
};

0 commit comments

Comments
 (0)