@dnanpm/styleguide
Version:
DNA Styleguide repository provides the set of components and theme object used in various DNA projects.
48 lines (47 loc) • 1.93 kB
TypeScript
import type { ReactNode } from 'react';
import React from 'react';
import type { Props as ButtonProps } from '../Button/Button';
type ButtonArrowDirection = 'up' | 'right' | 'down' | 'left';
type ButtonArrowVariant = 'primary' | 'secondary';
type Props = ({
/**
* Allows to change the direction of chevron icon.
* Either `direction` or `icon` has to be defined
*
* @param {ButtonArrowDirection} up Uses `ChevronUp` icon as content of component
* @param {ButtonArrowDirection} right Uses `ChevronRight` icon as content of component
* @param {ButtonArrowDirection} down Uses `ChevronDown` icon as content of component
* @param {ButtonArrowDirection} left Uses `ChevronLeft` icon as content of component
*/
direction: ButtonArrowDirection;
icon?: never;
} | {
/**
* Allows to change the content of component.
* Either `icon` or `direction` has to be defined
*
* @type Icon | undefined
*/
icon: ReactNode;
direction?: never;
}) & Omit<ButtonProps, 'children' | 'small' | 'fullWidth' | 'loading' | 'data-no-close' | 'href' | 'loadingLabel'> & {
/**
* Allows to change the styling of component
*
* @param {ButtonArrowVariant} primary Using extended `ButtonPrimary` styles with circle shape
* @param {ButtonArrowVariant} secondary Using extended `ButtonSecondary` styles
*
* @default 'primary'
*/
variant?: ButtonArrowVariant;
/**
* Allows to change the type of resulting HTML element from button (`<button></button>`) to anchor (`<a href="..."></a>`)
*
* @deprecated Use `Button` component for href support
*/
href?: string;
};
/** @visibleName Button Arrow */
declare const ButtonArrow: ({ variant, "data-testid": dataTestId, "data-track-value": dataTrackValue, "aria-label": ariaLabel, ...props }: Props) => React.JSX.Element;
/** @component */
export default ButtonArrow;