@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
26 lines • 1.36 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
import { STYLES_NAME } from '../../constants/stylesName/stylesName';
import { useStyles } from '../../hooks/useStyles/useStyles';
import { ErrorBoundary } from '../../provider/errorBoundary/errorBoundary';
import { FallbackComponent } from '../../provider/errorBoundary/fallbackComponent';
import { LoaderStandalone } from './loaderStandAlone';
export const LoaderComponent = React.forwardRef(({ variant, ...props }, ref) => {
const styles = useStyles(STYLES_NAME.LOADER, variant);
return _jsx(LoaderStandalone, { ref: ref, styles: styles, ...props });
});
LoaderComponent.displayName = 'LoaderComponent';
const LoaderBoundary = (props, ref) => (_jsx(ErrorBoundary, { fallBackComponent: _jsx(FallbackComponent, { children: _jsx(LoaderStandalone, { ...props, ref: ref }) }), children: _jsx(LoaderComponent, { ...props, ref: ref }) }));
/**
* @deprecated This component has been deprecated and will be removed in the next MAJOR release. Consider using an alternative component.
*
* Loader component is used to show a loading state.
* @param {React.PropsWithChildren<ILoader<V>>} props
* @returns {JSX.Element}
* @constructor
* @example
* <Loader variant="loader" />
*/
const Loader = React.forwardRef(LoaderBoundary);
export { Loader };
//# sourceMappingURL=loader.js.map