Skip to content

docs: add warning notice to internal storybook #7338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions packages/calcite-components/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,42 @@ module.exports = {
],
};
},
managerHead: (head: string): string => {
if (process.env.STORYBOOK_SCREENSHOT_TEST_BUILD) {
return head;
}

return `
<link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
<link rel="stylesheet" href="./build/calcite.css" />
<script type="module" src="./build/calcite.esm.js"></script>

<template id="internalStorybookNotice">
<calcite-notice open icon="exclamation-mark-triangle" closable kind="warning" scale="l" style="font-family: var(--calcite-sans-family)">
<div slot="title">This storybook is on the current @next version and is meant for internal, testing purposes only.</div>
<div slot="link">
Please refer to the
<calcite-link
slot="link"
title="my action"
href="https://developers.arcgis.com/calcite-design-system/components/"
>
Calcite Components documentation site
</calcite-link>
to browse and interact with components.
</div>
</calcite-notice>
</template>

<script>
window.addEventListener(
"load",
() => document.body.prepend(document.getElementById("internalStorybookNotice").content.cloneNode(true)),
{ once: true }
);
</script>

${head}
`;
},
};