2021-02-23 19:28:48 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { action } from '@storybook/addon-actions';
|
|
|
|
|
2021-04-30 22:58:57 +00:00
|
|
|
import { Button, ButtonSize, ButtonVariant } from './Button';
|
2021-02-23 19:28:48 +00:00
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
export default {
|
|
|
|
title: 'Components/Button',
|
|
|
|
};
|
2021-02-23 19:28:48 +00:00
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
export const KitchenSink = (): JSX.Element => (
|
2021-02-23 19:28:48 +00:00
|
|
|
<>
|
2021-10-20 23:46:41 +00:00
|
|
|
{Object.values(ButtonVariant).map(variant => (
|
2021-08-26 20:51:55 +00:00
|
|
|
<React.Fragment key={variant}>
|
2021-11-16 16:45:16 +00:00
|
|
|
{[ButtonSize.Large, ButtonSize.Medium, ButtonSize.Small].map(size => (
|
2021-08-26 20:51:55 +00:00
|
|
|
<React.Fragment key={size}>
|
2021-04-30 22:58:57 +00:00
|
|
|
<p>
|
|
|
|
<Button onClick={action('onClick')} size={size} variant={variant}>
|
2021-08-26 20:51:55 +00:00
|
|
|
{variant}
|
2021-04-30 22:58:57 +00:00
|
|
|
</Button>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<Button
|
|
|
|
disabled
|
|
|
|
onClick={action('onClick')}
|
|
|
|
size={size}
|
|
|
|
variant={variant}
|
|
|
|
>
|
2021-08-26 20:51:55 +00:00
|
|
|
{variant}
|
2021-04-30 22:58:57 +00:00
|
|
|
</Button>
|
|
|
|
</p>
|
|
|
|
</React.Fragment>
|
|
|
|
))}
|
2021-04-06 22:14:18 +00:00
|
|
|
</React.Fragment>
|
|
|
|
))}
|
2021-02-23 19:28:48 +00:00
|
|
|
</>
|
2022-06-07 00:48:02 +00:00
|
|
|
);
|
2021-04-27 22:35:35 +00:00
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
KitchenSink.story = {
|
|
|
|
name: 'Kitchen sink',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const AriaLabel = (): JSX.Element => (
|
2021-04-27 22:35:35 +00:00
|
|
|
<Button
|
|
|
|
aria-label="hello"
|
|
|
|
className="module-ForwardMessageModal__header--back"
|
|
|
|
onClick={action('onClick')}
|
|
|
|
/>
|
2022-06-07 00:48:02 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
AriaLabel.story = {
|
|
|
|
name: 'aria-label',
|
|
|
|
};
|
2021-08-17 21:45:18 +00:00
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
export const CustomStyles = (): JSX.Element => (
|
2021-08-17 21:45:18 +00:00
|
|
|
<Button onClick={action('onClick')} style={{ transform: 'rotate(5deg)' }}>
|
|
|
|
Hello world
|
|
|
|
</Button>
|
2022-06-07 00:48:02 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
CustomStyles.story = {
|
|
|
|
name: 'Custom styles',
|
|
|
|
};
|