2021-06-02 03:54:00 +00:00
const webpackOverride = require ( '../webpack.config' ) ;
module . exports = {
stories : [
// WooCommerce Admin / @woocommerce/components components
2024-09-09 15:06:01 +00:00
'../../../packages/js/components/src/**/stories/*.story.@(js|tsx)' ,
2021-06-02 03:54:00 +00:00
// WooCommerce Admin / @woocommerce/experimental components
2024-09-09 15:06:01 +00:00
'../../../packages/js/experimental/src/**/stories/*.story.@(js|tsx)' ,
2023-08-22 09:58:33 +00:00
// WooCommerce Admin / @woocommerce/onboarding components
2024-09-09 15:06:01 +00:00
'../../../packages/js/onboarding/src/**/stories/*.story.@(js|tsx)' ,
'../../../packages/js/product-editor/src/**/*.(stories|story).@(js|tsx)' ,
'../../../plugins/woocommerce-admin/client/**/stories/*.story.@(js|tsx)' ,
2021-06-02 03:54:00 +00:00
] ,
2024-09-09 15:06:01 +00:00
2021-06-02 03:54:00 +00:00
addons : [
'@storybook/addon-docs' ,
2022-03-18 11:45:14 +00:00
'@storybook/addon-controls' ,
// This package has been deprecated, in favor of @storybook/addon-controls
// However, it is still needed for the <Timeline /> story because changing the values with @storybook/addon-controls makes it crash. It seems that we cannot have jsx elements in props.
2021-06-02 03:54:00 +00:00
'@storybook/addon-viewport' ,
'@storybook/addon-a11y' ,
'@storybook/addon-actions' ,
'@storybook/addon-links' ,
] ,
typescript : {
reactDocgen : 'react-docgen-typescript' ,
} ,
2023-07-24 12:34:38 +00:00
staticDirs : [
{
from : '../../../plugins/woocommerce-admin/client' ,
to : 'main/plugins/woocommerce-admin/client' ,
} ,
] ,
2021-06-02 03:54:00 +00:00
webpackFinal : webpackOverride ,
2021-12-21 02:48:28 +00:00
previewHead : ( head ) => `
$ { head }
$ {
process . env . USE _RTL _STYLE === 'true'
? `
< link href = "experimental-css/style-rtl.css" rel = "stylesheet" / >
< link href = "component-css/style-rtl.css" rel = "stylesheet" / >
2023-08-22 09:58:33 +00:00
< link href = "onboarding-css/style-rtl.css" rel = "stylesheet" / >
2023-12-19 16:09:30 +00:00
< link href = "product-editor-css/style-rtl.css" rel = "stylesheet" / >
2023-07-24 12:34:38 +00:00
< link href = "app-css/style-rtl.css" rel = "stylesheet" / >
2021-12-21 02:48:28 +00:00
`
: `
< link href = "component-css/style.css" rel = "stylesheet" / >
< link href = "experimental-css/style.css" rel = "stylesheet" / >
2023-08-22 09:58:33 +00:00
< link href = "onboarding-css/style.css" rel = "stylesheet" / >
2023-12-19 16:09:30 +00:00
< link href = "product-editor-css/style.css" rel = "stylesheet" / >
2023-07-24 12:34:38 +00:00
< link href = "app-css/style.css" rel = "stylesheet" / >
2021-12-21 02:48:28 +00:00
`
}
< style >
/* Use system font, consistent with WordPress core (wp-admin) */
body {
font - family : - apple - system , BlinkMacSystemFont , 'Segoe UI' , Roboto ,
Oxygen - Sans , Ubuntu , Cantarell , 'Helvetica Neue' , sans - serif ;
}
< / s t y l e >
` ,
2024-09-09 15:06:01 +00:00
2023-07-24 12:34:38 +00:00
previewBody : ( body ) => `
< div id = "wpwrap" >
2023-09-15 20:06:42 +00:00
< div class = "woocommerce-layout woocommerce-admin-page" >
2023-07-24 12:34:38 +00:00
$ { body }
` ,
2024-09-09 15:06:01 +00:00
framework : {
name : '@storybook/react-webpack5' ,
options : { } ,
} ,
docs : {
autodocs : true ,
} ,
2021-06-02 03:54:00 +00:00
} ;