@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
62 lines (61 loc) • 2.55 kB
TypeScript
/**
* ---------------------------------------------------------------------
* 🔒 AUTOGENERATED BY VENDORISM
* Removing this comment will prevent it from being managed by it.
* ---------------------------------------------------------------------
*/
import SynergyElement from '../../internal/synergy-element.js';
import type { CSSResultGroup } from 'lit';
/**
* @summary Radios buttons allow the user to select a single option from a group using a button-like control.
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-radio-button--docs
* @status stable
* @since 2.0
*
* @slot - The radio button's label.
* @slot prefix - A presentational prefix icon or similar element.
* @slot suffix - A presentational suffix icon or similar element.
*
* @event syn-blur - Emitted when the button loses focus.
* @event syn-focus - Emitted when the button gains focus.
*
* @csspart base - The component's base wrapper.
* @csspart button - The internal `<button>` element.
* @csspart button--checked - The internal button element when the radio button is checked.
* @csspart prefix - The container that wraps the prefix.
* @csspart label - The container that wraps the radio button's label.
* @csspart suffix - The container that wraps the suffix.
*/
export default class SynRadioButton extends SynergyElement {
static styles: CSSResultGroup;
private readonly hasSlotController;
input: HTMLInputElement;
hiddenInput: HTMLInputElement;
protected hasFocus: boolean;
/**
* @internal The radio button's checked state. This is exposed as an "internal" attribute so we can reflect it, making
* it easier to style in button groups.
*/
checked: boolean;
/** The radio's value. When selected, the radio group will receive this value. */
value: string | number;
/** Disables the radio button. */
disabled: boolean;
/**
* The radio button's size. When used inside a radio group, the size will be determined by the radio group's size so
* this attribute can typically be omitted.
*/
size: 'small' | 'medium' | 'large';
/** Draws a pill-style radio button with rounded edges. */
pill: boolean;
connectedCallback(): void;
private handleBlur;
private handleClick;
private handleFocus;
handleDisabledChange(): void;
/** Sets focus on the radio button. */
focus(options?: FocusOptions): void;
/** Removes focus from the radio button. */
blur(): void;
render(): import("lit").TemplateResult;
}