import { customElement, property } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; import { ifDefined } from 'lit/directives/if-defined.js'; import { html } from 'lit/static-html.js'; import styles from '~/components/button/button.styles'; import RadioBase from '~/internal/radio'; import { HasSlotController } from '~/internal/slot'; /** * @since 2.0 * @status stable * * @slot - The radio's label. * * @event sl-blur - Emitted when the button loses focus. * @event sl-change - Emitted when the button's checked state changes. * @event sl-focus - Emitted when the button gains focus. * * @slot - The button's label. * @slot prefix - Used to prepend an icon or similar element to the button. * @slot suffix - Used to append an icon or similar element to the button. * * @csspart base - The component's internal wrapper. * @csspart prefix - The prefix slot's container. * @csspart label - The button's label. * @csspart suffix - The suffix slot's container. */ @customElement('sl-radio-button') export default class SlRadioButton extends RadioBase { static styles = styles; private readonly hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix'); /** The button's variant. */ @property({ reflect: true }) variant: 'default' | 'primary' | 'success' | 'neutral' | 'warning' | 'danger' = 'default'; /** The button's size. */ @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium'; /** * This will be true when the control is in an invalid state. Validity in radio buttons is determined by the message * provided by the `setCustomValidity` method. */ @property({ type: Boolean, reflect: true }) invalid = false; /** Draws a pill-style button with rounded edges. */ @property({ type: Boolean, reflect: true }) pill = false; render() { return html` `; } } declare global { interface HTMLElementTagNameMap { 'sl-radio-button': SlRadioButton; } }