import type { Meta, StoryObj } from '@storybook/react-webpack5'; import { action } from 'storybook/actions'; import { Illustration, Assets, Flag } from '@wise/art'; import { FastFlag as FastFlagIcon, Bank as BankIcon, Profile, UpwardGraph as UpwardGraphIcon, FastFlag, } from '@transferwise/icons'; import type { AvatarViewBadgeProps } from '../avatarView/AvatarView'; import { Nudge, Header, Title, Typography, AvatarView, type NavigationOptionProps } from '..'; import NavigationOption from './NavigationOption'; import { fn } from 'storybook/test'; type StoryArgs = NavigationOptionProps & { hasTitleOnly?: boolean }; /** * > ⚠️ This component is **deprecated** and superseded by the [new ListItem component](?path=/docs/content-listitem--docs) with the [ListItem.Navigation control](?path=/docs/content-listitem-listitem-navigation--docs) * (run codemod to migrate: **`npx @wise/wds-codemods@latest list-item`**). */ const meta: Meta = { component: NavigationOption, title: 'Option/NavigationOption', tags: ['deprecated'], argTypes: { href: { control: 'text' }, title: { control: 'text' }, content: { control: 'text' }, complex: { control: 'boolean' }, disabled: { control: 'boolean' }, showMediaAtAllSizes: { control: 'boolean' }, showMediaCircle: { control: 'boolean' }, isContainerAligned: { control: 'boolean' }, className: { control: 'text' }, hasTitleOnly: { control: 'boolean' }, media: { control: false }, }, }; export default meta; const defaultArgs = { title: 'Navigation option', content: 'Button and icon are vertically centered.', complex: false, disabled: false, showMediaAtAllSizes: false, showMediaCircle: true, isContainerAligned: false, hasTitleOnly: false, }; const badgeProps: AvatarViewBadgeProps = { icon: , type: 'action', }; export const Basic: StoryObj = { render: ({ hasTitleOnly, ...args }: StoryArgs) => ( } onClick={fn()} /> ), args: { ...defaultArgs }, }; export const Variants: StoryObj = { render: ({ hasTitleOnly, ...args }: StoryArgs) => (
Has Title Only
} onClick={fn()} />
Full Content
} onClick={fn()} />
With Icon
} content={hasTitleOnly ? null : args.content} onClick={fn()} />
With Icon Avatar
} content={hasTitleOnly ? null : args.content} onClick={fn()} />
With Contact Avatar
} content={hasTitleOnly ? null : args.content} onClick={fn()} />
Not recommended usage

Rendering an Avatar on top of showMediaCircle causes the Avatar background-colour and the circle background-colour to overlap which also causes clipping issues with the Badge component.

} content={hasTitleOnly ? null : args.content} onClick={fn()} />
), args: { ...defaultArgs }, }; export const Multiple: StoryObj = { render: ({ hasTitleOnly, ...args }: StoryArgs) => (
} onClick={fn()} /> } onClick={fn()} /> } onClick={fn()} />
), args: { ...defaultArgs }, }; export const WithIllustration: StoryObj = { render: ({ hasTitleOnly, ...args }: StoryArgs) => ( } showMediaCircle={false} content={hasTitleOnly ? null : args.content} onClick={fn()} /> ), args: { ...defaultArgs }, }; export const WithContainerContent: StoryObj = { render: ({ hasTitleOnly, ...args }: StoryArgs) => (
Choose how to pay } onClick={fn()} /> } onClick={fn()} /> } onClick={fn()} />
), args: { ...defaultArgs }, }; export const BalanceContent: StoryObj = { render: ({ hasTitleOnly, ...args }: StoryArgs) => ( } onClick={fn()} /> ), args: { ...defaultArgs }, }; export const NewContactContent: StoryObj = { render: ({ hasTitleOnly, ...args }: StoryArgs) => ( } onClick={fn()} /> ), args: { ...defaultArgs }, }; export const ExistingContactContent: StoryObj = { render: ({ hasTitleOnly, ...args }: StoryArgs) => ( } onClick={fn()} /> ), args: { ...defaultArgs }, }; export const CardContent: StoryObj = { render: ({ hasTitleOnly, ...args }: StoryArgs) => ( } onClick={fn()} /> ), args: { ...defaultArgs }, }; export const ManageAccountContent: StoryObj = { render: ({ hasTitleOnly, ...args }: StoryArgs) => (
} onClick={fn()} /> } onClick={fn()} />
), };