mirror of
https://github.com/hanzoai/o11y-components.git
synced 2026-11-03 02:06:37 +00:00
53 lines
1.5 KiB
TypeScript
53 lines
1.5 KiB
TypeScript
import { PersistedAnnouncementBanner } from '@signozhq/ui';
|
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
|
|
const meta: Meta<typeof PersistedAnnouncementBanner> = {
|
|
title: 'Composed Components/AnnouncementBanner/PersistedAnnouncementBanner',
|
|
component: PersistedAnnouncementBanner,
|
|
parameters: {
|
|
layout: 'fullscreen',
|
|
},
|
|
tags: ['autodocs'],
|
|
argTypes: {
|
|
storageKey: {
|
|
control: 'text',
|
|
description: 'localStorage key used to persist dismiss state.',
|
|
table: { category: 'Behavior' },
|
|
},
|
|
type: {
|
|
control: 'select',
|
|
options: ['warning', 'info', 'error', 'success'],
|
|
description: 'The type of banner.',
|
|
table: { category: 'Appearance', defaultValue: { summary: 'warning' } },
|
|
},
|
|
children: {
|
|
control: 'text',
|
|
description: 'The message content.',
|
|
table: { category: 'Content' },
|
|
},
|
|
onDismiss: {
|
|
control: false,
|
|
description: 'Called when the banner is dismissed.',
|
|
table: { category: 'Events', type: { summary: '() => void' } },
|
|
},
|
|
},
|
|
args: {
|
|
storageKey: 'announcement-banner-story-demo',
|
|
type: 'info',
|
|
children:
|
|
'This banner persists its dismiss state in localStorage. Dismiss it and refresh to see it stay hidden.',
|
|
},
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof PersistedAnnouncementBanner>;
|
|
|
|
export const Default: Story = {
|
|
args: {
|
|
storageKey: 'announcement-banner-story-demo',
|
|
type: 'info',
|
|
children:
|
|
'This banner persists its dismiss state in localStorage. Dismiss it and refresh to see it stay hidden.',
|
|
},
|
|
};
|