UNPKG

@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

16 lines 1.1 kB
import { jsx as _jsx } from "react/jsx-runtime"; import React from 'react'; import { useStyles } from '../../hooks/useStyles/useStyles'; import { ErrorBoundary } from '../../provider/errorBoundary/errorBoundary'; import { FallbackComponent } from '../../provider/errorBoundary/fallbackComponent'; import { SnackbarStandAlone } from './snackbarStandAlone'; const SNACKBAR_STYLES = 'SNACKBAR_STYLES'; const SnackbarControlledComponent = React.forwardRef(({ variant, ctv, type, ...props }, ref) => { const styles = useStyles(SNACKBAR_STYLES, variant, ctv); return _jsx(SnackbarStandAlone, { ...props, ref: ref, styles: styles[type] }); }); SnackbarControlledComponent.displayName = 'SnackbarControlledComponent'; const SnackbarBoundary = (props, ref) => (_jsx(ErrorBoundary, { fallBackComponent: _jsx(FallbackComponent, { children: _jsx(SnackbarStandAlone, { ...props, ref: ref }) }), children: _jsx(SnackbarControlledComponent, { ...props, ref: ref }) })); const SnackbarControlled = React.forwardRef(SnackbarBoundary); export { SnackbarControlled }; //# sourceMappingURL=snackbarControlled.js.map