Files
web/packages/design-system/lib/components/MessageBanner/MessageBanner.stories.tsx
Rasmus Langvad ca6cc5ab6c Merged in feat/SW-3636-storybook-structure (pull request #3309)
feat(SW-3636): Storybook structure

* New sections in Storybook sidebar

* Group Storybook content files and add token files for spacing, border radius and shadows


Approved-by: Joakim Jäderberg
2025-12-08 12:35:14 +00:00

65 lines
1.3 KiB
TypeScript

import type { Meta, StoryObj } from '@storybook/nextjs-vite'
import { MessageBanner } from './index'
type MessageBannerType = 'default' | 'error' | 'info'
type TextColor = 'default' | 'error'
const meta: Meta<typeof MessageBanner> = {
title: 'Core Components/MessageBanner',
component: MessageBanner,
argTypes: {
type: {
control: { type: 'select' },
options: ['default', 'error', 'info'] as MessageBannerType[],
},
textColor: {
control: { type: 'select' },
options: ['default', 'error'] as TextColor[],
},
text: { control: 'text' },
},
}
export default meta
type Story = StoryObj<typeof MessageBanner>
export const Default: Story = {
args: {
type: 'default',
textColor: 'default',
text: 'This is a default message',
},
}
export const Warning: Story = {
args: {
type: 'error',
textColor: 'default',
text: 'This is a warning message',
},
}
export const WarningErrorText: Story = {
args: {
type: 'error',
textColor: 'error',
text: 'Warning with error text color',
},
}
export const Info: Story = {
args: {
type: 'info',
textColor: 'default',
text: 'This is an info message',
},
}
export const InfoErrorText: Story = {
args: {
type: 'info',
textColor: 'error',
text: 'Info with error text color',
},
}