@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
32 lines • 1.9 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Loader = exports.LoaderComponent = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = __importDefault(require("react"));
const stylesName_1 = require("../../constants/stylesName/stylesName");
const useStyles_1 = require("../../hooks/useStyles/useStyles");
const errorBoundary_1 = require("../../provider/errorBoundary/errorBoundary");
const fallbackComponent_1 = require("../../provider/errorBoundary/fallbackComponent");
const loaderStandAlone_1 = require("./loaderStandAlone");
exports.LoaderComponent = react_1.default.forwardRef(({ variant, ...props }, ref) => {
const styles = (0, useStyles_1.useStyles)(stylesName_1.STYLES_NAME.LOADER, variant);
return (0, jsx_runtime_1.jsx)(loaderStandAlone_1.LoaderStandalone, { ref: ref, styles: styles, ...props });
});
exports.LoaderComponent.displayName = 'LoaderComponent';
const LoaderBoundary = (props, ref) => ((0, jsx_runtime_1.jsx)(errorBoundary_1.ErrorBoundary, { fallBackComponent: (0, jsx_runtime_1.jsx)(fallbackComponent_1.FallbackComponent, { children: (0, jsx_runtime_1.jsx)(loaderStandAlone_1.LoaderStandalone, { ...props, ref: ref }) }), children: (0, jsx_runtime_1.jsx)(exports.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_1.default.forwardRef(LoaderBoundary);
exports.Loader = Loader;
//# sourceMappingURL=loader.js.map