@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
119 lines (118 loc) • 5.33 kB
TypeScript
/// <reference path="../../index.d.ts" />
import type { PublicLitElement as LitElement, LuminaJsx } from "@arcgis/lumina";
import type { Alignment, Appearance, AriaAttributesCamelCased, Scale } from "../interfaces.js";
import type { IconName } from "../calcite-icon/interfaces.js";
/**
* @cssproperty [--calcite-action-background-color-hover] - Specifies the component's background color when hovered.
* @cssproperty [--calcite-action-background-color-press] - Specifies the component's background color when active.
* @cssproperty [--calcite-action-background-color-pressed] - [Deprecated] Use --calcite-action-background-color-press. Specifies the component's background color when active.
* @cssproperty [--calcite-action-background-color] - Specifies the component's background color.
* @cssproperty [--calcite-action-corner-radius-end-end] - [Deprecated] Use --calcite-action-corner-radius. Specifies the component's corner radius end end.
* @cssproperty [--calcite-action-corner-radius-end-start] - [Deprecated] Use --calcite-action-corner-radius. Specifies the component's corner radius end start.
* @cssproperty [--calcite-action-corner-radius-start-end] - [Deprecated] Use --calcite-action-corner-radius. Specifies the component's corner radius start end.
* @cssproperty [--calcite-action-corner-radius-start-start] - [Deprecated] Use --calcite-action-corner-radius. Specifies the component's corner radius start start.
* @cssproperty [--calcite-action-corner-radius] - Specifies the component's corner radius.
* @cssproperty [--calcite-action-indicator-color] - Specifies the component's indicator color.
* @cssproperty [--calcite-action-text-color-press] - Specifies the component's text color when pressed or hovered.
* @cssproperty [--calcite-action-text-color-pressed] - [Deprecated] Use --calcite-action-text-color-press. Specifies the component's text color when hovered.
* @cssproperty [--calcite-action-text-color] - Specifies the component's text color.
* @slot - A slot for adding non-interactive content, such as a `calcite-icon`.
*/
export abstract class Action extends LitElement {
/**
* When `true`, the component is highlighted.
*
* @default false
*/
accessor active: boolean;
/** Specifies the horizontal alignment of button elements with text content. */
accessor alignment: Alignment;
/**
* Specifies the appearance of the component.
*
* @deprecated in v5.0.0, removal target v6.0.0 - No longer necessary.
* @default "transparent"
*/
accessor appearance: Extract<"solid" | "transparent", Appearance>;
/** When specified, overrides or extends ARIA properties and attributes on the component's button. Refer to the component's accessibility section for configuration considerations. */
accessor aria: Partial<Pick<AriaAttributesCamelCased, "controlsElements" | "describedByElements" | "expanded" | "hasPopup" | "labelledByElements" | "ownsElements" | "pressed" | "checked"> & Pick<LuminaJsx.HTMLAttributes, "role">> | undefined;
/**
* When `true`, the side padding of the component is reduced.
*
* @deprecated in v2.11.0, removal target v5.0.0 - No longer necessary.
* @default false
*/
accessor compact: boolean;
/**
* When `true`, interaction is prevented and the component is displayed with lower opacity.
*
* @default false
*/
accessor disabled: boolean;
/**
* Specifies the `id` of the component's associated form.
*
* When not set, the component is associated with its ancestor form element, if one exists.
*/
accessor form: string;
/** Specifies an icon to display. */
accessor icon: IconName;
/**
* When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`).
*
* @default false
*/
accessor iconFlipRtl: boolean;
/**
* When `true`, displays a visual indicator.
*
* @default false
*/
accessor indicator: boolean;
/** Specifies an accessible label for the component. If no label is provided, the label inherits what's provided for the `text` prop. */
accessor label: string;
/**
* When `true`, a busy indicator is displayed.
*
* @default false
*/
accessor loading: boolean;
/** Overrides individual strings used by the component. */
accessor messageOverrides: {
loading?: string;
indicator?: string;
indicatorLabel?: string;
};
/**
* Specifies the size of the component.
*
* @default "m"
*/
accessor scale: Scale;
/**
* Specifies text that accompanies the icon.
*
* @required
*/
accessor text: string;
/**
* When `true`, indicates whether the text is displayed.
*
* @default false
*/
accessor textEnabled: boolean;
/**
* Specifies the default behavior of the component.
*
* @default "button"
* @mdn [type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type)
*/
accessor type: HTMLButtonElement["type"];
/**
* Sets focus on the component.
*
* @param options - When specified an optional object customizes the component's focusing process. When `preventScroll` is `true`, scrolling will not occur on the component.
* @mdn [focus(options)](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
*/
setFocus(options?: FocusOptions): Promise<void>;
}