import React from 'react' import { type Meta, type StoryObj } from '@storybook/react-vite' import { DocsTemplate } from '../../../.storybook' import PopoverHeader from './PopoverHeader' import { toast } from '../Toast/Toast' import Icon from '../Icons/Icon' const meta: Meta = { title: 'Components/Popover/PopoverHeader', component: PopoverHeader, parameters: { docs: { page: () => ( The PopoverHeader component is a versatile header component designed for use in popovers. It can be customized with various styles, including color themes, icons, and logos. } /> ), }, controls: { sort: 'requiredFirst' }, }, } export default meta type Story = StoryObj const Template: Story = { render: (args) => { const { headerText, logoUrl } = args return logoUrl ? ( ) : ( ) }, } export const Basic: Story = { ...Template, args: {}, } export const Red: Story = { ...Template, args: { styleType: 'red', }, } export const Green: Story = { ...Template, args: { styleType: 'green', }, } export const Blue: Story = { ...Template, args: { styleType: 'blue', }, } export const BasicWithIcon: Story = { ...Template, args: { icon: 'info', }, } export const RedWithIcon: Story = { ...Template, args: { icon: 'flag', styleType: 'red', }, } export const GreenWithIcon: Story = { ...Template, args: { icon: 'check', styleType: 'green', }, } export const BlueWithIcon: Story = { ...Template, args: { icon: 'info', styleType: 'blue', }, } const closeCallout = () => { toast({ message: 'You clicked close', type: 'success' }) } export const BasicWithClose: Story = { ...Template, args: { closeCallout, }, } export const RedWithClose: Story = { ...Template, args: { closeCallout, styleType: 'red', }, } export const GreenWithClose: Story = { ...Template, args: { closeCallout, styleType: 'green', }, } export const BlueWithClose: Story = { ...Template, args: { closeCallout, styleType: 'blue', }, } export const BasicWithIconAndClose: Story = { ...Template, args: { icon: 'info', closeCallout, }, } export const RedWithIconAndClose: Story = { ...Template, args: { icon: 'flag', closeCallout, styleType: 'red', }, } export const GreenWithIconAndClose: Story = { ...Template, args: { icon: 'check', closeCallout, styleType: 'green', }, } export const BlueWithIconAndClose: Story = { ...Template, args: { icon: 'info', closeCallout, styleType: 'blue', }, } export const WithLogo: Story = { ...Template, args: { logoUrl: 'https://images.pattern.com/library/library-logo.svg', closeCallout, }, } export const HasBackButton: Story = { ...Template, args: { hasBackButton: true, closeCallout, }, } export const customHeader: Story = { ...Template, args: { headerText: (
Header Text
Secondary-Text
), }, }