import React from 'react'; import type { Size } from '../../util/variant-types'; import { type IconName } from '../Icon'; type ButtonHTMLElementProps = React.ButtonHTMLAttributes; export type ButtonProps = ButtonHTMLElementProps & { /** * Component used to render the element. Meant to support interaction with framework navigation libraries. * * **Default is `"button"`**. */ as?: string | React.ElementType; /** * `Button` contents or label. */ children?: string; /** * Determine the behavior of the button upon click: * - **button** `Button` is a clickable button with no default behavior * - **submit** `Button` is a clickable button that submits form data * - **reset** `Button` is a clickable button that resets the form-data to its initial values */ type?: 'button' | 'reset' | 'submit'; /** * Sets the hierarchy rank of the button * * **Default is `"primary"`**. */ rank?: 'primary' | 'secondary' | 'tertiary'; /** * The size of the button on screen */ size?: Extract; /** * The variant of the default tertiary button. */ context?: 'default' | 'standalone'; /** * Icon from the set of defined EDS icon set, when `iconLayout` is used. */ icon?: IconName; /** * Allows configuation of the icon's positioning within `Button`. * * - When set to a value besides `"none"`, an icon must be specified. * - When `"icon-only"`, `aria-label` must be given a value. */ iconLayout?: 'none' | 'left' | 'right' | 'icon-only'; /** * Status (color) variant for `Button`. * * **Default is `"default"`**. */ variant?: 'default' | 'neutral' | 'critical' | 'inverse'; /** * Whether the width of the button is set to the full layout. */ isFullWidth?: boolean; /** * Whether `Button` is set to disabled state (disables interaction and updates appearance). * * Note: this will set the internal field to `disabled` as well. Prefer this to just setting `disabled`. */ isDisabled?: boolean; /** * Loading state passed down from higher level used to trigger loader and text change. */ isLoading?: boolean; } & ExtendedElement; /** * `import {Button} from "@chanzuckerberg/eds";` * * Component for making buttons that do not navigate the user to another page. Use button to trigger actions, menus, * or other in-page activity. * * - If you need to style a navigation anchor, please use the `Link` component. * - If you need the button to use some other tag or component, use the `as` prop. */ export declare const Button: React.ForwardRefExoticComponent; /** * The variant of the default tertiary button. */ context?: "default" | "standalone"; /** * Icon from the set of defined EDS icon set, when `iconLayout` is used. */ icon?: IconName; /** * Allows configuation of the icon's positioning within `Button`. * * - When set to a value besides `"none"`, an icon must be specified. * - When `"icon-only"`, `aria-label` must be given a value. */ iconLayout?: "none" | "left" | "right" | "icon-only"; /** * Status (color) variant for `Button`. * * **Default is `"default"`**. */ variant?: "default" | "neutral" | "critical" | "inverse"; /** * Whether the width of the button is set to the full layout. */ isFullWidth?: boolean; /** * Whether `Button` is set to disabled state (disables interaction and updates appearance). * * Note: this will set the internal field to `disabled` as well. Prefer this to just setting `disabled`. */ isDisabled?: boolean; /** * Loading state passed down from higher level used to trigger loader and text change. */ isLoading?: boolean; } & React.RefAttributes>; export {};