UNPKG

@atlaskit/button

Version:

A button triggers an event or action. They let users know what will happen next.

62 lines (61 loc) 2.63 kB
import React from 'react'; import Button from '../new-button/variants/default/button'; import { type LinkButtonProps } from '../new-button/variants/default/link'; import { type IconButtonProps } from '../new-button/variants/icon/button'; import { type LinkIconButtonProps } from '../new-button/variants/icon/link'; import { buttonAppearances } from './button-appearances'; import { buttonSpacing } from './button-spacing'; import { iconButtonAppearances } from './icon-button-appearances'; import { iconButtonShapes } from './icon-button-shapes'; import { iconButtonSpacing } from './icon-button-spacing'; import { linkButtonAppearances } from './link-button-appearances'; type DefaultButtonVariant = { name: 'Button'; Component: typeof Button; elementType: typeof HTMLButtonElement; appearances: typeof buttonAppearances; spacing: typeof buttonSpacing; }; type LinkButtonVariant = { name: 'LinkButton'; Component: typeof LinkButtonRender; elementType: typeof HTMLAnchorElement; appearances: typeof linkButtonAppearances; spacing: typeof buttonSpacing; }; type IconButtonVariant = { name: 'IconButton'; Component: typeof IconButtonRender; elementType: typeof HTMLButtonElement; appearances: typeof iconButtonAppearances; spacing: typeof iconButtonSpacing; shape: typeof iconButtonShapes; }; type LinkIconButtonVariant = { name: 'LinkIconButton'; Component: typeof LinkIconButtonRender; elementType: typeof HTMLAnchorElement; appearances: typeof iconButtonAppearances; spacing: typeof iconButtonSpacing; shape: typeof iconButtonShapes; }; export type Variant = { Button: DefaultButtonVariant; LinkButton: LinkButtonVariant; IconButton: IconButtonVariant; LinkIconButton: LinkIconButtonVariant; }; declare const LinkButtonRender: React.ForwardRefExoticComponent<React.PropsWithoutRef<Omit<LinkButtonProps, 'href'> & { href?: LinkButtonProps['href']; }> & React.RefAttributes<HTMLAnchorElement>>; declare const IconButtonRender: React.ForwardRefExoticComponent<React.PropsWithoutRef<Omit<IconButtonProps, 'icon' | 'label'> & { icon?: IconButtonProps['icon']; label?: IconButtonProps['label']; }> & React.RefAttributes<HTMLButtonElement>>; declare const LinkIconButtonRender: React.ForwardRefExoticComponent<React.PropsWithoutRef<Omit<LinkIconButtonProps, 'href' | 'icon' | 'label'> & { href?: LinkIconButtonProps['href']; icon?: LinkIconButtonProps['icon']; label?: LinkIconButtonProps['label']; }> & React.RefAttributes<HTMLAnchorElement>>; declare const variants: Variant; export default variants;