@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
27 lines • 1.59 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 { ContainerStandAlone } from './containerStandAlone';
const ContainerComponent = React.forwardRef(({ children, variant, ctv, ...props }, ref) => {
const styles = useStyles(STYLES_NAME.CONTAINER, variant, ctv);
return (_jsx(ContainerStandAlone, { ref: ref, ...props, styles: styles, children: children }));
});
ContainerComponent.displayName = 'ContainerComponent';
const ContainerBoundary = (props, ref) => (_jsx(ErrorBoundary, { fallBackComponent: _jsx(FallbackComponent, { children: _jsx(ContainerStandAlone, { ...props, ref: ref, children: props.children }) }), children: _jsx(ContainerComponent, { ...props, ref: ref }) }));
const Container = React.forwardRef(ContainerBoundary);
/**
* A container is a component that wraps the content of a website.
* @module Container
* @interface IContainer
* @category Contaiment Components
* @param children - the content to render inside the container.
* @param variant - the variant of the container.
* @param dataTestId - the data test id of the container.
* @param {React.ForwardedRef<HTMLDivElement> | undefined | null} ref - The component ref.
* @returns {JSX.Element} The rendered component.
*/
export { Container };
//# sourceMappingURL=container.js.map