@ownclouders/design-system
Version:
ownCloud Design System is based on VueDesign Systems and is used to design ownCloud UI components
36 lines (35 loc) • 2.24 kB
TypeScript
import { AvailableSizeType } from '../../helpers';
/**
* OcSpinner Component
*
* A spinner component used to indicate loading or processing states in the application.
*
* @component
* @name OcSpinner
* @status ready
* @release 1.0.0
*
* @props
* @prop {string} [ariaLabel=''] - Descriptive text for screen readers. Strongly recommended unless the component is used inside a DOM node that is already `aria-hidden="true"`.
* @prop {AvailableSizeType} [size='medium'] - The size of the spinner. Available options: `xsmall`, `small`, `medium`, `large`, `xlarge`, `xxlarge`, `xxxlarge`.
*
* @Accessibility
* Making spinners accessible for screen readers
*
* 1. Making them (only!) programmatically focusable with `tabindex="-1"`. **This is already included in the component.**
* 2. Giving them the [ARIA role](https://developers.google.com/web/fundamentals/accessibility/semantics-aria) of "img" (image) to change the semantics of the spinner element from something meaningless (div) to something meaningful (image). **This is already included in the component.**
* 3. Giving them an accessible name ([explainer for the term](https://developer.paciellogroup.com/blog/2017/04/what-is-an-accessible-name/)) via aria-label/the ariaLabel prop. An element that has an accessible name, but no role is ignored by assistive technology
* 4. During an action of the application that shows the spinner to visual users, the spinner should programmatically receive focus (see 1.), so that the accessible name of it (default: Loading, see 2.) is read out by screen reader software. After completion of the loading process the focus should be sent to a reasonable place of the newly loaded content.
*
* @example
* <oc-spinner
* aria-label="Loading with extra small spinner"
* size="xsmall" class="oc-mr-s"
* />
*/
interface Props {
ariaLabel?: string;
size?: AvailableSizeType;
}
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLSpanElement>;
export default _default;