@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
21 lines • 1.11 kB
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { ROLES } from '../../types/role/role';
import { ScreenReaderOnly } from '../screenReaderOnly/screenReaderOnly';
// styles
import { LoaderStyled, LoaderWrapperStyled } from './loader.styled';
const LoaderStandaloneComponent = ({ dataTestId = 'loader', ...props }, ref) => {
return (_jsx(LoaderWrapperStyled, { role: ROLES.STATUS, styles: props.styles, children: props.visible && (_jsxs(_Fragment, { children: [_jsx(LoaderStyled, { ref: ref, "$width": props.width, "data-testid": dataTestId, position: props.position, styles: props.styles }), _jsx(ScreenReaderOnly, { children: props.altText })] })) }));
};
/**
* @description
* Loader component is used to show a loading state.
* @param {React.PropsWithChildren<ILoaderStandAlone>} props
* @returns {JSX.Element}
* @constructor
* @example
* <LoaderStandalone />
* <LoaderStandalone width="100px" />
*/
export const LoaderStandalone = React.forwardRef(LoaderStandaloneComponent);
//# sourceMappingURL=loaderStandAlone.js.map