@synergy-design-system/components
Version:
This package provides the base of the Synergy Design System as native web components. It uses [lit](https://www.lit.dev) and parts of [shoelace](https://shoelace.style/). Synergy officially supports the latest two versions of all major browsers (as define
70 lines (69 loc) • 2.79 kB
TypeScript
/**
* ---------------------------------------------------------------------
* 🔒 AUTOGENERATED BY VENDORISM
* Removing this comment will prevent it from being managed by it.
* ---------------------------------------------------------------------
*/
import SynergyElement from '../../internal/synergy-element.js';
import SynIcon from '../icon/icon.component.js';
import type { CSSResultGroup } from 'lit';
/**
* @summary Icons buttons are simple, icon-only buttons that can be used for actions and in toolbars.
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-icon-button--docs
* @status stable
* @since 2.0
*
* @dependency syn-icon
*
* @event syn-blur - Emitted when the icon button loses focus.
* @event syn-focus - Emitted when the icon button gains focus.
*
* @csspart base - The component's base wrapper.
*/
export default class SynIconButton extends SynergyElement {
static styles: CSSResultGroup;
static dependencies: {
'syn-icon': typeof SynIcon;
};
button: HTMLButtonElement | HTMLLinkElement;
private hasFocus;
/** The name of the icon to draw. Available names depend on the icon library being used. */
name?: string;
/** The name of a registered custom icon library. */
library?: string;
/**
* An external URL of an SVG file. Be sure you trust the content you are including, as it will be executed as code and
* can result in XSS attacks.
*/
src?: string;
/** When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`. */
href?: string;
/** Tells the browser where to open the link. Only used when `href` is set. */
target?: '_blank' | '_parent' | '_self' | '_top';
/** Tells the browser to download the linked file as this filename. Only used when `href` is set. */
download?: string;
/**
* A description that gets read by assistive devices. For optimal accessibility, you should always include a label
* that describes what the icon button does.
*/
label: string;
/** The icon button's size. */
size: 'small' | 'medium' | 'large' | 'inherit';
/**
* The color of the icon button.
* The default "currentColor" makes it possible to easily style the icon button from outside without any CSS variables.
*/
color: 'currentColor' | 'primary' | 'neutral';
/** Disables the button. */
disabled: boolean;
private handleBlur;
private handleFocus;
private handleClick;
/** Simulates a click on the icon button. */
click(): void;
/** Sets focus on the icon button. */
focus(options?: FocusOptions): void;
/** Removes focus from the icon button. */
blur(): void;
render(): import("lit").TemplateResult;
}