diff --git a/.storybook/main.ts b/.storybook/main.ts index 8d181c8db4..1dff5b43c7 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -20,6 +20,7 @@ import type { StorybookConfig } from '@storybook/react-webpack5'; const config: StorybookConfig = { stories: [ + '../packages/*/src/**/*.stories.@(ts|tsx)', '../examples/**/{stories,*.stories}.@(ts|tsx|js|jsx)', ], addons: [ diff --git a/babel.config.js b/babel.config.js index ec84fa13e5..4027f69376 100644 --- a/babel.config.js +++ b/babel.config.js @@ -60,6 +60,7 @@ module.exports = { !!( fileName.includes('-test') || fileName.includes('-Test') || + fileName.includes('.stories') || /\/node_modules\//.test(fileName) || fileName.includes('.d.ts') || fileName.includes('.figma.tsx') diff --git a/examples/bpk-component-badge/BadgeLayout.tsx b/examples/bpk-component-badge/BadgeLayout.tsx deleted file mode 100644 index addf2a3fc0..0000000000 --- a/examples/bpk-component-badge/BadgeLayout.tsx +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Backpack - Skyscanner's Design System - * - * Copyright 2016 Skyscanner Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import type { ReactNode } from 'react'; - -import { cssModules } from '../../packages/bpk-react-utils'; - -import STYLES from './BpkBadgeLayout.module.scss'; - -const getClassName = cssModules(STYLES); - -type Props = { - docked?: string | null; - children: ReactNode; -}; - -const BadgeLayout = ({ children, docked = null }: Props) => { - const classNames = getClassName( - 'bpk-badge-layout__container', - docked && 'bpk-badge-layout__container--light', - ); - - return