UNPKG

@primer/react-brand

Version:

Primer Brand is a GitHub's design system for creating React-based marketing websites and digital experiences.

49 lines (48 loc) 1.92 kB
import React, { ReactElement } from 'react'; import type { Icon } from '@primer/octicons-react'; import type { BaseProps } from '../component-helpers'; import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css'; export declare const ButtonVariants: readonly ["primary", "secondary", "subtle", "accent"]; export declare const ButtonSizes: readonly ["small", "medium", "large"]; export declare const defaultButtonVariant: "secondary"; export declare const defaultButtonSize: "medium"; type ButtonVariant = (typeof ButtonVariants)[number]; export type ButtonBaseProps = { /** * The leading visual appears before the button content */ leadingVisual?: ReactElement | Icon; /** * The trailing visual appears after the button content */ trailingVisual?: ReactElement | Icon; /** * The styling variations available in Button */ variant?: ButtonVariant; /** * The size variations available in Button */ size?: (typeof ButtonSizes)[number]; /** * A flag to show/hide the arrow icon */ hasArrow?: boolean; /** * The Button spans the full width */ block?: boolean; }; export type ButtonProps<C extends React.ElementType> = BaseProps<C> & { as?: C; } & ButtonBaseProps & React.ComponentPropsWithoutRef<C>; export declare const _Button: React.ForwardRefExoticComponent<Omit<ButtonProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<HTMLButtonElement>>; export declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<HTMLButtonElement>> & { testIds: { root: string; readonly leadingVisual: string; readonly trailingVisual: string; readonly expandableArrow: string; }; }; export {};