Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const path = require( 'path' );
const sharedConfig = require( '../config/_shared.json' );
const devConfig = require( '../config/development.json' );
const storybookDefaultConfig = require( '@automattic/calypso-storybook' );
Expand All @@ -12,6 +13,8 @@ const storybookConfig = storybookDefaultConfig( {
'../packages/design-picker/src/**/*.stories.{ts,tsx}',
'../packages/domains-table/src/**/*.stories.{js,jsx,ts,tsx}',
],
webpackAliases: { calypso: path.join( __dirname, '../client' ) },
sassPrelude: `@use 'calypso/assets/stylesheets/shared/_utils.scss' as *;`,
} );

const configData = { ...sharedConfig, ...devConfig };
Expand Down
2 changes: 1 addition & 1 deletion client/dashboard/domains/name-servers/form.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';
import { Card, CardBody } from '../../components/card';
import PageLayout from '../../components/page-layout';
import NameServersForm from './form';
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
"react-router": "^6.23.1",
"react-test-renderer": "^18.3.1",
"redux-mock-store": "^1.5.5",
"storybook": "^8.6.17",
"storybook": "^9.1.20",
"stream-browserify": "^3.0.0"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
"@babel/runtime": "^7.27.1",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
"@signal-noise/stylelint-scales": "^2.0.3",
"@storybook/react": "^8.6.14",
"@storybook/react": "^9.1.20",
"@tanstack/eslint-plugin-query": "^5.100.0",
"@testing-library/jest-dom": "^6.9.1",
"@types/chroma-js": "^2.4.5",
Expand Down Expand Up @@ -319,7 +319,7 @@
"source-map": "^0.7.4",
"stackframe": "^1.1.1",
"stacktrace-gps": "^3.0.3",
"storybook": "^8.6.17",
"storybook": "^9.1.20",
"stylelint": "^16.15.0",
"stylelint-scss": "^6.4.0",
"tslib": "^2.8.1",
Expand Down
13 changes: 4 additions & 9 deletions packages/calypso-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,11 @@
"devDependencies": {
"@automattic/calypso-eslint-overrides": "workspace:^",
"@automattic/calypso-typescript-config": "workspace:^",
"@storybook/addon-actions": "^8.6.14",
"@storybook/addon-controls": "^8.6.14",
"@storybook/addon-docs": "^8.6.14",
"@storybook/addon-themes": "^8.6.14",
"@storybook/addon-toolbars": "^8.6.14",
"@storybook/addon-viewport": "^8.6.14",
"@storybook/addon-docs": "^9.1.20",
"@storybook/addon-themes": "^9.1.20",
"@storybook/addon-webpack5-compiler-babel": "^3.0.6",
"@storybook/react-webpack5": "^8.6.14",
"@storybook/test": "^8.6.14",
"storybook": "^8.6.17"
"@storybook/react-webpack5": "^9.1.20",
"storybook": "^9.1.20"
},
"dependencies": {
"@automattic/calypso-babel-config": "workspace:^",
Expand Down
6 changes: 2 additions & 4 deletions packages/calypso-storybook/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = function storybookDefaultConfig( {
stories,
plugins = [],
webpackAliases = {},
sassPrelude = '',
babelCacheDirectory = path.join( __dirname, '../../../.cache/babel-storybook' ),
} = {} ) {
return {
Expand Down Expand Up @@ -39,11 +40,7 @@ module.exports = function storybookDefaultConfig( {
staticDirs,
stories: stories && stories.length ? stories : [ '../src/**/*.stories.{js,jsx,ts,tsx}' ],
addons: [
'@storybook/addon-controls',
'@storybook/addon-actions',
'@storybook/addon-docs',
'@storybook/addon-toolbars',
'@storybook/addon-viewport',
'@storybook/addon-themes',
'@storybook/addon-webpack5-compiler-babel',
],
Expand Down Expand Up @@ -86,6 +83,7 @@ module.exports = function storybookDefaultConfig( {
{
loader: require.resolve( 'sass-loader' ), // Compiles Sass to CSS
options: {
additionalData: sassPrelude,
api: 'modern',
sassOptions: {
quietDeps: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/.storybook/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from '@storybook/blocks';
import { Meta } from '@storybook/addon-docs/blocks';

# Automattic Components Storybook

Expand Down
2 changes: 1 addition & 1 deletion packages/components/.storybook/unaudited.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from '@storybook/blocks';
import { Meta } from '@storybook/addon-docs/blocks';

<Meta title="Unaudited/What are these?" />

Expand Down
6 changes: 2 additions & 4 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,15 @@
"@automattic/calypso-build": "workspace:^",
"@automattic/calypso-storybook": "workspace:^",
"@automattic/calypso-typescript-config": "workspace:^",
"@storybook/addon-actions": "^8.6.14",
"@storybook/react": "^8.6.14",
"@storybook/test": "^8.6.14",
"@storybook/react": "^9.1.20",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/canvas-confetti": "^1.6.0",
"@types/node": "^24.12.2",
"postcss": "^8.5.3",
"storybook": "^8.6.17",
"storybook": "^9.1.20",
"typescript": "^5.9.3",
"webpack": "^5.99.8"
},
Expand Down
10 changes: 6 additions & 4 deletions packages/components/src/button/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { fn } from '@storybook/test';
import { Button } from '.';
import { fn } from 'storybook/test';
import { Button, type ButtonProps } from '.';
import type { Meta, StoryObj } from '@storybook/react';

type LinkArgs = ButtonProps & { href: string; target?: string };

/**
* This button has been deprecated due to aggressive and generic CSS that breaks many other buttons when imported.
* Use the [`Button` component](https://wordpress.github.io/gutenberg/?path=/docs/components-button--docs)
Expand All @@ -21,7 +23,7 @@ const meta: Meta< typeof Button > = {
};
export default meta;

type Story = StoryObj< typeof meta >;
type Story = StoryObj< ButtonProps >;

export const Default: Story = {
args: {
Expand Down Expand Up @@ -69,7 +71,7 @@ export const Disabled: Story = {
},
};

export const Link: Story = {
export const Link: StoryObj< LinkArgs > = {
...Default,
args: {
...Default.args,
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/experience-control/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useArgs } from '@storybook/preview-api';
import { Meta, StoryObj } from '@storybook/react';
import { fn } from '@storybook/test';
import { useArgs } from 'storybook/preview-api';
import { fn } from 'storybook/test';
import { ExperienceControl } from './index';

const meta: Meta< typeof ExperienceControl > = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { action } from '@storybook/addon-actions';
import { Icon, external } from '@wordpress/icons';
import { action } from 'storybook/actions';
import HorizontalBarList from '../.';
import HorizontalBarListItem from '../horizontal-bar-grid-item';
import StatsCard from '../stats-card';
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/tabs/stories/best-practices.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from '@storybook/blocks';
import { Meta } from '@storybook/addon-docs/blocks';

import * as TabsStories from './index.stories';

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/tabs/stories/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fn } from '@storybook/test';
import { Button, Tooltip, Slot, Fill, SlotFillProvider } from '@wordpress/components';
import { wordpress, more, link } from '@wordpress/icons';
import { useState } from 'react';
import { fn } from 'storybook/test';
import { Tabs } from '..';
import { Icon } from '../../icon';
import type { Meta, StoryFn } from '@storybook/react';
Expand Down
2 changes: 1 addition & 1 deletion packages/composite-checkout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@testing-library/user-event": "^14.6.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.6.17",
"storybook": "^9.1.20",
"typescript": "^5.9.3"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/domain-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"devDependencies": {
"@automattic/calypso-storybook": "workspace:^",
"@automattic/calypso-typescript-config": "workspace:^",
"@storybook/addon-a11y": "^8.6.14",
"@storybook/addon-a11y": "^9.1.20",
"@testing-library/dom": "^10.4.1",
"@testing-library/react": "^16.3.0",
"@types/jest": "^29.5.14",
Expand All @@ -71,7 +71,7 @@
"nock": "^13.5.6",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.6.17",
"storybook": "^9.1.20",
"typescript": "^5.9.3"
},
"peerDependencies": {
Expand Down
8 changes: 3 additions & 5 deletions packages/grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@
"@automattic/calypso-build": "workspace:^",
"@automattic/calypso-storybook": "workspace:^",
"@automattic/calypso-typescript-config": "workspace:^",
"@storybook/addon-actions": "^8.6.14",
"@storybook/addon-controls": "^8.6.14",
"@storybook/addon-docs": "^8.6.14",
"@storybook/react-webpack5": "^8.6.14",
"@storybook/addon-docs": "^9.1.20",
"@storybook/react-webpack5": "^9.1.20",
"postcss": "^8.5.3",
"storybook": "^8.6.17",
"storybook": "^9.1.20",
"typescript": "^5.9.3",
"webpack": "^5.99.8"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/launchpad/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
"@automattic/calypso-build": "workspace:^",
"@automattic/calypso-storybook": "workspace:^",
"@automattic/calypso-typescript-config": "workspace:^",
"@storybook/addon-a11y": "^8.6.14",
"@storybook/addon-a11y": "^9.1.20",
"msw": "^2.1.7",
"msw-storybook-addon": "2.0.7",
"postcss": "^8.5.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.6.17",
"storybook": "^9.1.20",
"typescript": "^5.9.3",
"webpack": "^5.99.8"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/onboarding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@automattic/calypso-typescript-config": "workspace:^",
"@automattic/typography": "workspace:^",
"@automattic/viewport": "workspace:^",
"@storybook/addon-a11y": "^8.6.14",
"@storybook/addon-a11y": "^9.1.20",
"@testing-library/dom": "^10.4.1",
"@testing-library/react": "^16.3.0",
"@wordpress/base-styles": "^8.0.0",
Expand All @@ -72,7 +72,7 @@
"react-dom": "^18.3.1",
"redux": "^5.0.1",
"sass-loader": "^14.2.1",
"storybook": "^8.6.17",
"storybook": "^9.1.20",
"style-loader": "^1.3.0",
"typescript": "^5.9.3",
"webpack": "^5.99.8"
Expand Down
2 changes: 1 addition & 1 deletion packages/plans-grid-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"msw": "^2.2.14",
"msw-storybook-addon": "^2.0.7",
"resize-observer-polyfill": "^1.5.1",
"storybook": "^8.6.17",
"storybook": "^9.1.20",
"typescript": "^5.9.3",
"webpack": "^5.99.8"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/privacy-toolset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@testing-library/react": "^16.3.0",
"postcss": "^8.5.3",
"require-from-string": "^2.0.2",
"storybook": "^8.6.17",
"storybook": "^9.1.20",
"typescript": "^5.9.3",
"webpack": "^5.99.8"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { action } from '@storybook/addon-actions';
import { Story } from '@storybook/react';
import { StoryFn } from '@storybook/react';
import { action } from 'storybook/actions';
import { CookieBanner } from '.';
import type { CookieBannerProps } from '.';

export default {
title: 'Cookie Banner',
};

export const Default: Story< CookieBannerProps > = ( args ) => <CookieBanner { ...args } />;
export const Decline: Story< CookieBannerProps > = ( args ) => <CookieBanner { ...args } />;
export const Default: StoryFn< CookieBannerProps > = ( args ) => <CookieBanner { ...args } />;
export const Decline: StoryFn< CookieBannerProps > = ( args ) => <CookieBanner { ...args } />;

Default.args = {
onAccept: action( 'accept' ),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { action } from '@storybook/addon-actions';
import { Story } from '@storybook/react';
import { StoryFn } from '@storybook/react';
import React, { useState } from 'react';
import { action } from 'storybook/actions';
import { DoNotSellDialog } from '.';
import type { DoNotSellDialogProps } from '.';

export default {
title: 'Do Not Sell Dialog',
};

export const Default: Story< DoNotSellDialogProps > = ( args ) => {
export const Default: StoryFn< DoNotSellDialogProps > = ( args ) => {
const [ isActive, setActive ] = useState( false );
return <DoNotSellDialog { ...args } isActive={ isActive } onToggleActive={ setActive } isOpen />;
};
Expand Down
3 changes: 1 addition & 2 deletions packages/search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"@automattic/calypso-color-schemes": "workspace:^",
"@automattic/calypso-storybook": "workspace:^",
"@automattic/calypso-typescript-config": "workspace:^",
"@storybook/addon-actions": "^8.6.14",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
Expand All @@ -65,7 +64,7 @@
"@wordpress/is-shallow-equal": "^5.46.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"storybook": "^8.6.17",
"storybook": "^9.1.20",
"typescript": "^5.9.3",
"webpack": "^5.99.8"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/search/src/search.stories.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import './search.stories.scss';
import { action } from '@storybook/addon-actions';
import { Icon } from '@wordpress/components';
import { action } from 'storybook/actions';
import Search from './search';

export default { title: 'Search', component: Search };
Expand Down
2 changes: 1 addition & 1 deletion packages/site-admin/.storybook/mock-registry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { createReduxStore, createRegistry } from '@wordpress/data';
import { action } from '@storybook/addon-actions';
import { action } from 'storybook/actions';

/**
* Types
Expand Down
2 changes: 1 addition & 1 deletion packages/site-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@automattic/calypso-typescript-config": "workspace:^",
"copyfiles": "^2.4.1",
"postcss": "^8.5.3",
"storybook": "^8.6.17",
"storybook": "^9.1.20",
"typescript": "^5.9.3",
"webpack": "^5.99.8"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* External dependencies
*/
import { fn } from '@storybook/test';
import { useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import * as allIconComponents from '@wordpress/icons';
import { fn } from 'storybook/test';
/*
* Internal dependencies
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* External dependencies
*/
import { action } from '@storybook/addon-actions';
import { useEffect, useRef } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { action } from 'storybook/actions';
/**
* Internal dependencies
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* External dependencies
*/
import { fn } from '@storybook/test';
import { __experimentalVStack as VStack } from '@wordpress/components';
import { useState } from '@wordpress/element';
import { fn } from 'storybook/test';
/**
* Internal dependencies
*/
Expand Down
Loading
Loading