2023-04-19 19:36:01 +02:00
|
|
|
import React from 'react';
|
|
|
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
2023-04-25 23:27:54 +02:00
|
|
|
|
|
|
|
import {
|
|
|
|
TextVariant,
|
|
|
|
TextAlign,
|
|
|
|
DISPLAY,
|
|
|
|
FLEX_DIRECTION,
|
|
|
|
AlignItems,
|
|
|
|
JustifyContent,
|
|
|
|
} from '../../../helpers/constants/design-system';
|
|
|
|
|
2023-08-28 23:42:00 +02:00
|
|
|
import { AvatarAccount, ButtonSize, Button, Text } from '..';
|
2023-04-25 23:27:54 +02:00
|
|
|
|
2023-04-19 19:36:01 +02:00
|
|
|
import { PopoverHeader } from './popover-header';
|
|
|
|
import README from './README.mdx';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'Components/ComponentLibrary/PopoverHeader',
|
|
|
|
component: PopoverHeader,
|
|
|
|
parameters: {
|
|
|
|
docs: {
|
|
|
|
page: README,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
argTypes: {
|
|
|
|
children: { control: 'text' },
|
|
|
|
className: { control: 'text' },
|
|
|
|
onBack: { action: 'onBack' },
|
|
|
|
onClose: { action: 'onClose' },
|
|
|
|
},
|
|
|
|
args: {
|
|
|
|
children: 'PopoverHeader',
|
|
|
|
},
|
|
|
|
} as ComponentMeta<typeof PopoverHeader>;
|
|
|
|
|
|
|
|
const Template: ComponentStory<typeof PopoverHeader> = (args) => {
|
2023-04-25 23:27:54 +02:00
|
|
|
return <PopoverHeader {...args} />;
|
2023-04-19 19:36:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export const DefaultStory = Template.bind({});
|
|
|
|
DefaultStory.storyName = 'Default';
|
|
|
|
|
|
|
|
export const Children: ComponentStory<typeof PopoverHeader> = (args) => (
|
2023-04-25 23:27:54 +02:00
|
|
|
<>
|
|
|
|
<PopoverHeader {...args} marginBottom={4}>
|
|
|
|
Children as string
|
|
|
|
</PopoverHeader>
|
|
|
|
<PopoverHeader
|
|
|
|
{...args}
|
|
|
|
childrenWrapperProps={{
|
|
|
|
display: DISPLAY.FLEX,
|
|
|
|
flexDirection: FLEX_DIRECTION.COLUMN,
|
|
|
|
alignItems: AlignItems.center,
|
|
|
|
justifyContent: JustifyContent.center,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<AvatarAccount address="0x1234" />
|
|
|
|
<Text variant={TextVariant.headingSm} textAlign={TextAlign.Center}>
|
|
|
|
Custom header using multiple components
|
|
|
|
</Text>
|
|
|
|
</PopoverHeader>
|
|
|
|
</>
|
2023-04-19 19:36:01 +02:00
|
|
|
);
|
|
|
|
|
2023-04-25 23:27:54 +02:00
|
|
|
export const OnBack = Template.bind({});
|
|
|
|
OnBack.args = {
|
|
|
|
children: 'OnBack demo',
|
2023-04-19 19:36:01 +02:00
|
|
|
};
|
|
|
|
|
2023-04-25 23:27:54 +02:00
|
|
|
export const OnClose = Template.bind({});
|
|
|
|
OnClose.args = {
|
|
|
|
children: 'OnClose demo',
|
|
|
|
};
|
2023-04-19 19:36:01 +02:00
|
|
|
|
2023-04-25 23:27:54 +02:00
|
|
|
export const StartAccessory = Template.bind({});
|
|
|
|
StartAccessory.args = {
|
|
|
|
children: 'StartAccessory demo',
|
2023-08-28 23:42:00 +02:00
|
|
|
startAccessory: <Button size={ButtonSize.Sm}>Demo</Button>,
|
2023-04-25 23:27:54 +02:00
|
|
|
};
|
2023-04-19 19:36:01 +02:00
|
|
|
|
2023-04-25 23:27:54 +02:00
|
|
|
export const EndAccessory = Template.bind({});
|
|
|
|
EndAccessory.args = {
|
|
|
|
children: 'EndAccessory demo',
|
2023-08-28 23:42:00 +02:00
|
|
|
endAccessory: <Button size={ButtonSize.Sm}>Demo</Button>,
|
2023-04-25 23:27:54 +02:00
|
|
|
};
|