import { Meta, StoryObj } from '@storybook/react-webpack5'; import Logo, { LogoType, LogoDisplay, LogoFormat } from '../Logo'; import type { LogoSize } from '../Logo'; import { createSandboxStory } from '../../../.storybook/components/sandbox/SandboxEditor'; import { withVariantConfig } from '../../../.storybook/helpers'; import Body from '../../Body'; /** * **Design guidance**: wise.design/foundations/logo */ const meta: Meta = { component: Logo, title: 'Content/Logo', args: { type: 'WISE', }, argTypes: { type: { control: 'radio', options: Object.values(LogoType), }, display: { control: 'radio', options: Object.values(LogoDisplay), }, format: { control: 'radio', options: Object.values(LogoFormat), }, size: { control: 'radio', options: [16, 18, 20, 24, 28, 36] satisfies LogoSize[], }, inverse: { control: { disable: true } }, }, parameters: { docs: { toc: true }, }, }; export default meta; type Story = StoryObj; /** Explore all props via the controls panel. */ export const Playground: Story = { args: { type: 'WISE', format: 'primary-lockup', }, render: (args) => , }; export const Sandbox = createSandboxStory({ code: ``, scope: { Logo }, }); /** * The three logo types: standard Wise, Wise Business, and Wise Platform. */ export const Types: Story = { argTypes: { type: { table: { disable: true } }, }, render: (args) => (
{Object.values(LogoType).map((type) => (
))}
), parameters: { docs: { source: { code: ` `, }, }, }, }; /** * The `format="primary-lockup"` variant shows the product name inline alongside the wordmark. */ export const PrimaryLockup: Story = { argTypes: { type: { table: { disable: true } }, format: { table: { disable: true } }, }, render: (args) => (
{Object.values(LogoType).map((type) => (
))}
), parameters: { docs: { source: { code: ` `, }, }, }, }; /** * The `format="secondary-lockup"` variant uses a stacked two-line layout with the product name. */ export const SecondaryLockup: Story = { argTypes: { type: { table: { disable: true } }, format: { table: { disable: true } }, }, render: (args) => (
{Object.values(LogoType).map((type) => (
))}
), parameters: { docs: { source: { code: ` `, }, }, }, }; /** * Controls the height and width of the logo in pixels. */ export const Sizes: Story = { argTypes: { size: { table: { disable: true } }, }, render: (args) => (
{([16, 18, 20, 24, 28, 36] as const).map((size) => (
{size}
))}
), parameters: { docs: { source: { code: ``, }, }, }, }; /** * When `display` is `"compact"`, only the fast-flag mark is rendered regardless of type or other settings. */ export const Compact: Story = { render: (args) => (
{Object.values(LogoType).map((type) => (
))}
), parameters: { docs: { source: { code: ` `, }, }, }, }; /** * When `display` is `"full"`, the full wordmark/lockup is rendered regardless of screen width. */ export const Full: Story = { render: (args) => (
{Object.values(LogoType).map((type) => (
))}
), ...withVariantConfig(['mobile'], { parameters: { docs: { source: { code: ` `, }, }, }, }), };