diff --git a/contribute/style-guides/storybook.md b/contribute/style-guides/storybook.md index d7106baa2a7..04e833b74be 100644 --- a/contribute/style-guides/storybook.md +++ b/contribute/style-guides/storybook.md @@ -10,7 +10,7 @@ Storybook is: ## How to create stories -Stories for a component should be placed next to the component file. The Storybook file requires the same name as the component file. For example, a story for `SomeComponent.tsx` will have the file name `SomeComponent.story.tsx`. +Stories for a component should be placed next to the component file. The Storybook file requires the same name as the component file. For example, a story for `SomeComponent.tsx` will have the file name `SomeComponent.story.tsx`. If a story should be internal, not visible in production, name the file `SomeComponent.story.internal.tsx`. ### Writing stories diff --git a/packages/grafana-ui/.storybook/main.ts b/packages/grafana-ui/.storybook/main.ts index 4d620bbf6c5..4b734bc1c89 100644 --- a/packages/grafana-ui/.storybook/main.ts +++ b/packages/grafana-ui/.storybook/main.ts @@ -1,5 +1,11 @@ +const stories = ['../src/**/*.story.{js,jsx,ts,tsx,mdx}']; + +if (process.env.NODE_ENV !== 'production') { + stories.push('../src/**/*.story.internal.{js,jsx,ts,tsx,mdx}'); +} + module.exports = { - stories: ['../src/**/*.story.{js,jsx,ts,tsx,mdx}'], + stories: stories, addons: [ '@storybook/addon-knobs', '@storybook/addon-actions', diff --git a/packages/grafana-ui/src/components/ValueMappingsEditor/LegacyValueMappingsEditor.story.tsx b/packages/grafana-ui/src/components/ValueMappingsEditor/LegacyValueMappingsEditor.story.internal.tsx similarity index 100% rename from packages/grafana-ui/src/components/ValueMappingsEditor/LegacyValueMappingsEditor.story.tsx rename to packages/grafana-ui/src/components/ValueMappingsEditor/LegacyValueMappingsEditor.story.internal.tsx