docs: allow custom props in catalog decorator (#916)

Relates to #702
This commit is contained in:
Thaïs
2023-07-25 20:02:13 +02:00
committed by GitHub
parent a2ccb643ff
commit a5ca913158
6 changed files with 296 additions and 340 deletions

View File

@ -4,17 +4,25 @@ import styled from '@emotion/styled';
import { SoonPill } from '@/ui/pill/components/SoonPill';
import { rgba } from '@/ui/themes/colors';
export type ButtonVariant =
| 'primary'
| 'secondary'
| 'tertiary'
| 'tertiaryBold'
| 'tertiaryLight'
| 'danger';
export enum ButtonSize {
Medium = 'medium',
Small = 'small',
}
export type ButtonSize = 'medium' | 'small';
export enum ButtonPosition {
Left = 'left',
Middle = 'middle',
Right = 'right',
}
export type ButtonPosition = 'left' | 'middle' | 'right' | undefined;
export enum ButtonVariant {
Primary = 'primary',
Secondary = 'secondary',
Tertiary = 'tertiary',
TertiaryBold = 'tertiaryBold',
TertiaryLight = 'tertiaryLight',
Danger = 'danger',
}
export type ButtonProps = {
icon?: React.ReactNode;
@ -24,6 +32,7 @@ export type ButtonProps = {
size?: ButtonSize;
position?: ButtonPosition;
soon?: boolean;
disabled?: boolean;
} & React.ComponentProps<'button'>;
const StyledButton = styled.button<
@ -172,8 +181,8 @@ export function Button({
icon,
title,
fullWidth = false,
variant = 'primary',
size = 'medium',
variant = ButtonVariant.Primary,
size = ButtonSize.Medium,
position,
soon = false,
disabled = false,