shoelace/src/components/spinner/spinner.ts

35 wiersze
950 B
TypeScript

import { LitElement, html } from 'lit';
import { customElement } from 'lit/decorators.js';
import styles from './spinner.styles';
/**
* @since 2.0
* @status stable
*
* @csspart base - The component's base wrapper.
*
* @cssproperty --track-width - The width of the indicator.
* @cssproperty --track-color - The color of the spinner's track.
* @cssproperty --indicator-color - The color of the spinner's indicator.
* @cssproperty --speed - The time it takes for the spinner to complete one animation cycle.
*/
@customElement('sl-spinner')
export default class SlSpinner extends LitElement {
static styles = styles;
render() {
return html`
<svg part="base" class="spinner" aria-busy="true" aria-live="polite">
<circle class="spinner__track"></circle>
<circle class="spinner__indicator"></circle>
</svg>
`;
}
}
declare global {
interface HTMLElementTagNameMap {
'sl-spinner': SlSpinner;
}
}