/**
* External dependencies
*/
import type { Meta, StoryObj } from '@storybook/react-vite';
// eslint-disable-next-line @wordpress/use-recommended-components -- admin-ui is a bundled package that depends on @wordpress/ui
import { Badge, Button, Text } from '@wordpress/ui';
import { Icon, wordpress } from '@wordpress/icons';
/**
* Internal dependencies
*/
import Page from '..';
import Breadcrumbs from '../../breadcrumbs';
import { withRouter } from '../../stories/with-router';
const meta: Meta< typeof Page > = {
component: Page,
title: 'Admin UI/Page',
parameters: {
layout: 'fullscreen',
},
decorators: [
( Story ) => (
),
withRouter,
],
};
export default meta;
type Story = StoryObj< typeof meta >;
export const Default: Story = {
args: {
title: 'Page title',
showSidebarToggle: false,
hasPadding: true,
children: Page content here,
},
};
export const WithSubtitle: Story = {
args: {
title: 'Page title',
subTitle: 'All of the subtitle text you need goes here.',
showSidebarToggle: false,
hasPadding: true,
children: Page content here,
},
};
export const WithBreadcrumbs: Story = {
args: {
showSidebarToggle: false,
breadcrumbs: (
),
hasPadding: true,
children: Page content here,
},
};
export const WithVisual: Story = {
args: {
title: 'Page title',
visual: ,
showSidebarToggle: false,
hasPadding: true,
children: Page content here,
},
};
export const WithVisualAndBreadcrumbs: Story = {
args: {
visual: ,
showSidebarToggle: false,
breadcrumbs: (
),
hasPadding: true,
children: Page content here,
},
};
/**
* Demonstrates that large images are constrained by the header visual styles.
*
* The `img` uses an empty `alt` because the visual region is hidden from assistive
* technologies and the page title carries the accessible name.
*/
export const WithImageVisual: Story = {
args: {
title: 'Page title',
visual: (
),
showSidebarToggle: false,
hasPadding: true,
children: Page content here,
},
};
export const WithBreadcrumbsAndSubtitle: Story = {
args: {
showSidebarToggle: false,
subTitle: 'All of the subtitle text you need goes here.',
breadcrumbs: (
),
hasPadding: true,
children: Page content here,
},
};
export const WithoutHeader: Story = {
args: {
showSidebarToggle: false,
hasPadding: true,
children: Page content here,
},
};
export const WithTitleAndBadges: Story = {
args: {
title: 'Page title',
badges: Status,
showSidebarToggle: false,
hasPadding: true,
children: Page content here,
},
};
export const WithBreadcrumbsAndBadges: Story = {
args: {
showSidebarToggle: false,
breadcrumbs: (
),
badges: Published,
hasPadding: true,
children: Page content here,
},
};
export const WithActions: Story = {
args: {
title: 'Page title',
actions: (
<>
>
),
showSidebarToggle: false,
hasPadding: true,
children: Page content here,
},
};
export const FullHeader: Story = {
args: {
visual: ,
subTitle: 'All of the subtitle text you need goes here.',
breadcrumbs: (
),
badges: Status,
actions: (
<>
>
),
showSidebarToggle: false,
hasPadding: true,
children: Page content here,
},
};