@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.49 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 { MediaButtonStandalone } from './mediaButtonStandAlone';
const MediaButtonComponent = React.forwardRef(({ variant, size, ctv, ...props }, ref) => {
const stylesVariant = useStyles(STYLES_NAME.MEDIA_BUTTON, variant, ctv);
const styles = stylesVariant[size];
return _jsx(MediaButtonStandalone, { ...props, ref: ref, styles: styles });
});
MediaButtonComponent.displayName = 'MediaButtonComponent';
const MediaButtonBoundary = (props, ref) => (_jsx(ErrorBoundary, { fallBackComponent: _jsx(FallbackComponent, { children: _jsx(MediaButtonStandalone, { ...props, ref: ref }) }), children: _jsx(MediaButtonComponent, { ...props, ref: ref }) }));
const MediaButton = React.forwardRef(MediaButtonBoundary);
/**
* @description
* MediaButton component is used to show a button with an icon.
* @param {React.PropsWithChildren<IMediaButton<V>>} props
* @returns {JSX.Element}
* @constructor
* @example
* <MediaButton variant="mediaButton" iconAltText="iconAltText" iconToTransitionAltText="iconToTransitionAltText" iconToTransition={true} />
*/
export { MediaButton };
//# sourceMappingURL=mediaButton.js.map