Skip to content
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

try: add storybook to showcase progressbar from calypso-ui #33166

Closed
wants to merge 15 commits into from
Closed
2 changes: 2 additions & 0 deletions .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
9 changes: 9 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { configure } from '@storybook/react';

// automatically import all files ending in *.stories.js
const req = require.context( '../', true, /_story\.js$/ );
function loadStories() {
req.keys().forEach( filename => req( filename ) );
}

configure( loadStories, module );
36 changes: 36 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
'use strict';

const path = require( 'path' );
const util = require( 'util' );
const SassConfig = require( '@automattic/calypso-build/webpack/sass' );
const { cssNameFromFilename } = require( '@automattic/calypso-build/webpack/util' );

const outputFilename = '[name].js';
const outputChunkFilename = '[name].js';

const cssFilename = cssNameFromFilename( outputFilename );
const cssChunkFilename = cssNameFromFilename( outputChunkFilename );

module.exports = async ( { config } ) => {
config.module.rules.push(
SassConfig.loader( {
preserveCssCustomProperties: true,
includePaths: [ path.join( __dirname, '../client' ) ],
prelude: `@import '${ path.join(
__dirname,
'../assets/stylesheets/shared/_utils.scss'
) }'; @import '${ path.join(
__dirname,
'../node_modules/@automattic/calypso-color-schemes/src/calypso-color-schemes.scss'
) }';`,
} )
);
config.plugins.push(
...SassConfig.plugins( {
chunkFilename: cssChunkFilename,
filename: cssFilename,
minify: false,
} )
);
return config;
};
1 change: 1 addition & 0 deletions client/components/progress-bar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { ProgressBar as default } from '@automattic/calypso-ui';
14 changes: 1 addition & 13 deletions client/components/screen-reader-text/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
/**
* External dependencies
*/
import React from 'react';

/**
* Style dependencies
*/
import './style.scss';

export default function ScreenReaderText( { children } ) {
return <span className="screen-reader-text">{ children }</span>;
}
export { ScreenReaderText as default } from '@automattic/calypso-ui';
Loading