import * as React from 'react';
import { Button, ButtonProps } from '@fluentui/react-button';
import { Playground } from '../Playground';
import { PlaygroundProps, PropDefinition } from '../Playground.types';
// TODO: this is here while waiting for react-icons to merge
const SVGIcon = () => (
);
export const Default = () => ;
//
// Anatomy & Layout
//
export const TextOnly = () => ;
export const TextOnlyLong = () => ;
export const IconWithText = () => (
<>
}>Text
} iconPosition="after">
Text
>
);
export const IconOnly = () => } />;
//
// Size
//
const SizeExample = ({ size }: { size?: ButtonProps['size'] }) => (
<>
{size || '(default)'}
}>
Text
} />
>
);
export const Size = () => (
<>
>
);
//
// Appearance
//
const AppearanceExample = (props: ButtonProps) => (
<>
} />
}>
Text
} iconPosition="after">
Text
>
);
export const Primary = () => ;
//
// States
//
export const Disabled = () => (
<>
}>
Default disabled
}>
Primary disabled
>
);
type ExampleProps = { iconOnly?: string };
export const buttonBaseProps: PropDefinition[] = [
{ propName: 'block', propType: 'boolean' },
{ propName: 'circular', propType: 'boolean' },
{ propName: 'content', propType: 'string', defaultValue: 'This is a button', dependsOnProps: ['~iconOnly'] },
{ propName: 'disabled', propType: 'boolean', dependsOnProps: ['~disabledFocusable'] },
{ propName: 'disabledFocusable', propType: 'boolean', dependsOnProps: ['~disabled'] },
{ propName: 'icon', propType: 'boolean' },
{ propName: 'iconOnly', propType: 'boolean', dependsOnProps: ['icon'] },
{
propName: 'iconPosition',
propType: ['before', 'after'],
defaultValue: 'before',
dependsOnProps: ['icon', '~iconOnly'],
},
{ propName: 'outline', propType: 'boolean', dependsOnProps: ['~primary', '~subtle', '~transparent'] },
{ propName: 'primary', propType: 'boolean', dependsOnProps: ['~outline', '~subtle', '~transparent'] },
{ propName: 'size', propType: ['small', 'medium', 'large'], defaultValue: 'medium' },
{ propName: 'subtle', propType: 'boolean', dependsOnProps: ['~outline', '~primary', '~transparent'] },
{ propName: 'transparent', propType: 'boolean', dependsOnProps: ['~outline', '~primary', '~subtle'] },
];
const buttonProps: PlaygroundProps['sections'] = [
{ sectionName: 'Button props', propList: buttonBaseProps },
];
export const ButtonPlayground = () => (
);