UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

128 lines (126 loc) 4.58 kB
/// <reference types="../../index.d.ts" /> import { PublicLitElement as LitElement, JsxNode, TargetedEvent } from '@arcgis/lumina'; import { FormOwner } from '../../utils/form'; import { InteractiveComponent } from '../../utils/interactive'; import { LabelableComponent } from '../../utils/label'; import { Appearance, FlipContext, Kind, Scale, Width } from '../interfaces'; import { IconNameOrString } from '../calcite-icon/interfaces'; import { Label } from '../calcite-label/customElement.js'; import { ButtonAlignment } from './interfaces'; /** * Passing a 'href' will render an anchor link, instead of a button. Role will be set to link, or button, depending on this. * * It is the consumers responsibility to add aria information, rel, target, for links, and any button attributes for form submission * * @slot - A slot for adding text. */ export declare class Button extends LitElement { /** * Specifies the alignment of the component's elements. * * @default "center" */ alignment: ButtonAlignment; /** * Specifies the appearance style of the component. * * @default "solid" */ appearance: Extract<"outline" | "outline-fill" | "solid" | "transparent", Appearance>; /** * When `true`, interaction is prevented and the component is displayed with lower opacity. * * @default false */ disabled: boolean; /** * Prompts the user to save the linked URL instead of navigating to it. Can be used with or without a value: * Without a value, the browser will suggest a filename/extension. * * @see [Global download attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download). * @default false */ download: string | boolean; /** * The `id` of the form that will be associated with the component. * * When not set, the component will be associated with its ancestor form element, if any. */ form: string; /** Specifies the URL of the linked resource, which can be set as an absolute or relative path. */ href: string; /** Specifies an icon to display at the end of the component. */ iconEnd: IconNameOrString; /** Displays the `iconStart` and/or `iconEnd` as flipped when the element direction is right-to-left (`"rtl"`). */ iconFlipRtl: FlipContext; /** Specifies an icon to display at the start of the component. */ iconStart: IconNameOrString; /** * Specifies the kind of the component, which will apply to the border and background if applicable. * * @default "brand" */ kind: Extract<"brand" | "danger" | "inverse" | "neutral", Kind>; /** Accessible name for the component. */ label: string; /** * When `true`, a busy indicator is displayed and interaction is disabled. * * @default false */ loading: boolean; /** Use this property to override individual strings used by the component. */ messageOverrides?: typeof this.messages._overrides; /** Specifies the name of the component on form submission. */ name?: string; /** * Defines the relationship between the `href` value and the current document. * * @mdn [rel](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel) */ rel: string; /** * When `true`, adds a round style to the component. * * @default false */ round: boolean; /** * Specifies the size of the component. * * @default "m" */ scale: Scale; /** * Specifies if the component is a child of a `calcite-split-button`. * * @default false */ splitChild: "primary" | "secondary" | false; /** * Specifies where to open the linked document defined in the `href` property. * * @mdn [target](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target) */ target: string; /** * Specifies the default behavior of the component. * * @mdn [type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) * @default "button" */ type: string; /** * Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead. * * @default "auto" */ width: Extract<Width, "auto" | "half" | "full">; /** Sets focus on the component. */ setFocus(): Promise<void>; private messages: Partial<{ loading: string; }> & import('@arcgis/lumina/controllers').T9nMeta<{ loading: string; }>; }